Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f605f26
feat: migrate Zod to pure TS w/ JSDoc, improve type safety and simpli…
ssalbdivad Oct 18, 2024
139d623
chore(release): 5.0.0-beta.1 [skip ci]
semantic-release-bot Oct 18, 2024
6c6b55e
push
colbyfayock Oct 18, 2024
689d02d
chore(release): 6.0.0-beta.1 [skip ci]
semantic-release-bot Oct 18, 2024
8b99479
chore(release): 2.0.0-beta.1 [skip ci]
semantic-release-bot Oct 18, 2024
05cd33e
fix: Add TypeScript Types for Cloudinary Product Gallery Widget (#218)
Mrinank-Bhowmick Oct 22, 2024
d262d80
chore(release): 2.0.0-beta.2 [skip ci]
semantic-release-bot Oct 22, 2024
5f7ccbe
Merge branch 'main' into beta
colbyfayock Oct 22, 2024
e0b1bef
chore(release): 6.0.0-beta.2 [skip ci]
semantic-release-bot Oct 22, 2024
f65d4d4
Merge branch 'main' into beta
colbyfayock Oct 22, 2024
6f43022
Merge branch 'beta' of github.com:cloudinary-community/cloudinary-uti…
colbyfayock Oct 22, 2024
731d545
feat: enumerate plugin props (#224)
ssalbdivad Oct 24, 2024
2f86156
chore(release): 6.0.0-beta.3 [skip ci]
semantic-release-bot Oct 24, 2024
672009a
fix: adding string and number back to replaceBackground
colbyfayock Oct 25, 2024
ef7e57a
fix: adding applyWhen to streaming profile to prevent abr plugin from…
colbyfayock Oct 25, 2024
5e9849e
chore(release): 6.0.0-beta.4 [skip ci]
semantic-release-bot Oct 25, 2024
163cb2f
fix: make plugins and cloudinaryPluginProps tree-shakeable (#227)
Andarist Oct 31, 2024
23e9afd
chore(release): 6.0.0-beta.5 [skip ci]
semantic-release-bot Oct 31, 2024
90d07c2
fix: remove applyWhen in favor of explicit props overlap check with a…
ssalbdivad Oct 31, 2024
b122ab2
chore(release): 6.0.0-beta.6 [skip ci]
semantic-release-bot Oct 31, 2024
6f321c1
chore(release): 2.0.0-beta.3 [skip ci]
semantic-release-bot Oct 31, 2024
4f02f79
chore(release): 5.0.0-beta.2 [skip ci]
semantic-release-bot Oct 31, 2024
b6a5563
fix: make all individual plugin declarations tree-shakeable (#229)
Andarist Oct 31, 2024
72f8a1d
chore(release): 6.0.0-beta.7 [skip ci]
semantic-release-bot Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ module.exports = defineConfig({
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-namespace": ["warn", { allowDeclarations: true }],
},
});
2 changes: 1 addition & 1 deletion docs/src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export function sortByKey(
array: Array<object> = [],
key: string,
type: string = "asc"
type: string = "asc",
) {
function compare(a: object, b: object) {
let keyA = a[key];
Expand Down
84 changes: 38 additions & 46 deletions packages/types/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudinary-util/types",
"version": "1.5.11",
"version": "2.0.0-beta.2",
"type": "module",
"main": "./dist/index.cjs",
"types": "./dist/index.d.cts",
Expand Down
24 changes: 17 additions & 7 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export type {
CloudinaryResource, CloudinaryResourceAccessMode, CloudinaryResourceContext, CloudinaryResourceDeliveryType, CloudinaryResourceResourceType
CloudinaryResource,
CloudinaryResourceAccessMode,
CloudinaryResourceContext,
CloudinaryResourceDeliveryType,
CloudinaryResourceResourceType,
} from "./types/resources.js";

export type {
Expand All @@ -14,24 +18,30 @@ export type {
CloudinaryUploadWidgetInstanceMethods,
CloudinaryUploadWidgetOptions,
CloudinaryUploadWidgetResults,
CloudinaryUploadWidgetSources
CloudinaryUploadWidgetSources,
} from "./types/cloudinary-upload-widget.js";

export type {
CloudinaryVideoPlayer,
CloudinaryVideoPlayerOptionPosterOptions,
CloudinaryVideoPlayerOptions,
CloudinaryVideoPlayerOptionsColors,
CloudinaryVideoPlayerOptionsLogo, CloudinaryVideoPlayerPlaylistByTagOptions,
CloudinaryVideoPlayerPlaylistOptions, CloudinaryVideoPlayerTextTracks, CloudinaryVideoPlayerTextTracksTrack, CloudinaryVideoPlayerTextTracksTrackOptions, CloudinaryVideoPlayerTextTracksTrackOptionsBox,
CloudinaryVideoPlayerOptionsLogo,
CloudinaryVideoPlayerPlaylistByTagOptions,
CloudinaryVideoPlayerPlaylistOptions,
CloudinaryVideoPlayerTextTracks,
CloudinaryVideoPlayerTextTracksTrack,
CloudinaryVideoPlayerTextTracksTrackOptions,
CloudinaryVideoPlayerTextTracksTrackOptionsBox,
CloudinaryVideoPlayerTextTracksTrackOptionsGravity,
CloudinaryVideoPlayerTextTracksTrackOptionsTheme
CloudinaryVideoPlayerTextTracksTrackOptionsTheme,
} from "./types/cloudinary-video-player.js";

export type { CloudinaryProductGallery } from "./types/cloudinary-product-gallery.js";

export type {
CloudinaryAssetConfiguration,
CloudinaryAssetConfigurationAuthToken,
CloudinaryAssetConfigurationCloud,
CloudinaryAssetConfigurationUrl
CloudinaryAssetConfigurationUrl,
} from "./types/configuration.js";

135 changes: 135 additions & 0 deletions packages/types/src/types/cloudinary-product-gallery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
export interface CloudinaryProductGallery {
// Required parameters
cloudName?: string;
mediaAssets?:
| {
publicId?: string;
tag?: string;
mediaType?: string;
resourceType?: string;
transformation?: object;
thumbnailTransformation?: object;
altText?: string;
videoPlayerSource?: object;
}[]
| string[]; // string[] is a list of publicIDs
container?: string | HTMLElement;

// Widget
analytics?: boolean;
displayProps?: {
mode?: "classic" | "expanded";
spacing?: number;
columns?: number;
topOffset?: number;
bottomOffset?: number;
};
focus?: boolean;
loaderProps?: {
color?: string;
opacity?: number;
style?: "cloudinary" | "circle" | "custom";
url?: string;
};
placeholderImage?: boolean;
sort?: "none" | "asc" | "desc";
sortProps?: {
source?: string;
id?: string;
direction?: string;
};
themeProps?: {
primary?: string; // Default: "#FFFFFF"
onPrimary?: string; // Default: "#000000"
active?: string; // Default: "#0078FF"
};
viewportBreakpoints?: {
breakpoint: number; // Required
[key: string]: any; // Other configuration parameters to override
}[];

// Main viewer parameters
accessibilityProps?: {
mediaAltSource?: string;
mediaAltId?: string;
};
ar3dProps?: {
shadows?: boolean;
showAR?: boolean;
};
aspectRatio?:
| "square"
| "1:1"
| "3:4"
| "4:3"
| "4:6"
| "6:4"
| "5:7"
| "7:5"
| "5:8"
| "8:5"
| "9:16"
| "16:9";
borderColor?: string;
borderWidth?: number;
imageBreakpoint?: number;
videoBreakpoint?: number;
preload?: string[];
radius?: number;
spinProps?: {
animate?: "none" | "start" | "end" | "both";
spinDirection?: "clockwise" | "counter-clockwise";
disableZoom?: boolean;
showTip?: "always" | "never" | "touch";
tipPosition?: "top" | "center" | "bottom";
tipText?: string; // Default: "Drag to rotate"
tipTouchText?: string; // Default: "Swipe to rotate"
};
startIndex?: number;
tipProps?: {
textColor?: string;
color?: string;
radius?: number;
opacity?: number;
};
transition?: "slide" | "fade" | "none";
videoProps?: {
controls?: string;
sound?: boolean;
autoplay?: boolean;
loop?: boolean;
playerType?: string;
};
zoom?: boolean;
zoomProps?: any;
zoomPopupProps?: {
backdropColor?: string;
backdropOpacity?: number;
zIndex?: number;
};

// Carousel parameters
carouselLocation?: "left" | "right" | "top" | "bottom";
carouselOffset?: number;
carouselStyle?: "none" | "thumbnails" | "indicators";
indicatorProps?: {
color?: string;
selectedColor?: string;
shape?: "round" | "square" | "radius";
size?: number;
spacing?: number;
sticky?: boolean;
};
thumbnailProps?: any;

// Navigation parameters
navigation?: "none" | "always" | "mouseover";
navigationButtonProps?: {
shape?: "none" | "round" | "square" | "radius" | "rectangle";
iconColor?: string;
color?: string;
size?: number;
};
navigationOffset?: number;
navigationPosition?: "inside" | "outside" | "offset";
}
2 changes: 1 addition & 1 deletion packages/types/src/types/cloudinary-upload-widget.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CloudinaryResource } from './resources.js';
import type { CloudinaryResource } from "./resources.js";

// Sourced from: https://cloudinary.com/documentation/upload_widget_reference

Expand Down
17 changes: 10 additions & 7 deletions packages/types/src/types/cloudinary-video-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,8 @@ export interface CloudinaryVideoPlayer {
videojs: {
cloudinary: {
dispose: () => void;
}
}

};
};
}

export interface CloudinaryVideoPlayerOptionsLogo {
Expand Down Expand Up @@ -366,8 +365,10 @@ export interface CloudinaryVideoPlayerTextTracksTrack {

export interface CloudinaryVideoPlayerTextTracks {
captions?: CloudinaryVideoPlayerTextTracksTrack;
options?: CloudinaryVideoPlayerTextTracksTrackOptions
subtitles?: CloudinaryVideoPlayerTextTracksTrack | Array<CloudinaryVideoPlayerTextTracksTrack>;
options?: CloudinaryVideoPlayerTextTracksTrackOptions;
subtitles?:
| CloudinaryVideoPlayerTextTracksTrack
| Array<CloudinaryVideoPlayerTextTracksTrack>;
}

export interface CloudinaryVideoPlayerOptions
Expand Down Expand Up @@ -442,7 +443,9 @@ export interface CloudinaryVideoPlayerOptions
};
analytics?: boolean;
allowUsageReport?: boolean;
cloudinaryAnalytics?: boolean | CloudinaryVideoPlayerOptionsCloudinaryAnalytics;
cloudinaryAnalytics?:
| boolean
| CloudinaryVideoPlayerOptionsCloudinaryAnalytics;

// ------------ Delivery ------------
cloud_name?: string;
Expand Down Expand Up @@ -495,4 +498,4 @@ export interface CloudinaryVideoPlayerOptionsCloudinaryAnalyticsCustomData {
customData3?: string;
customData4?: string;
customData5?: string;
}
}
6 changes: 3 additions & 3 deletions packages/types/src/types/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export interface CloudinaryAssetConfigurationUrl {
useRootPath?: boolean;
forceVersion?: boolean;
queryParams?: Record<string, string | number | boolean> | string;
};
}

export interface CloudinaryAssetConfigurationCloud {
cloudName?: string;
apiKey?: string;
apiSecret?: string;
authToken?: CloudinaryAssetConfigurationAuthToken;
};
}

export interface CloudinaryAssetConfiguration {
cloud?: CloudinaryAssetConfigurationCloud;
url?: CloudinaryAssetConfigurationUrl;
}
}
14 changes: 11 additions & 3 deletions packages/types/src/types/resources.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
export type CloudinaryResourceAccessMode = "public" | "authenticated" | (string & {});
export type CloudinaryResourceResourceType = "image" | "video" | "raw" | "auto" | (string & {});
export type CloudinaryResourceAccessMode =
| "public"
| "authenticated"
| (string & {});
export type CloudinaryResourceResourceType =
| "image"
| "video"
| "raw"
| "auto"
| (string & {});
export type CloudinaryResourceDeliveryType =
| "animoto"
| "asset"
Expand Down Expand Up @@ -68,4 +76,4 @@ export interface CloudinaryResource {
version: number;
width: number;
[key: string]: unknown;
}
}
Loading
Loading