@cesdk/cesdk-js 1.60.0-rc.0 → 1.60.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular/index.d.ts +38 -0
- package/angular/index.js +146 -0
- package/assets/core/{cesdk-v1.60.0-rc.0-PVJODEZF.wasm → cesdk-v1.60.0-rc.1-GLF6PJ6E.wasm} +0 -0
- package/assets/core/{worker-host-v1.60.0-rc.0.js → worker-host-v1.60.0-rc.1.js} +1 -1
- package/cesdk.umd.js +1 -1
- package/index.d.ts +562 -12
- package/index.js +1 -1
- package/package.json +24 -8
- package/vue/index.js +1 -0
- package/integrations/vue.js +0 -171
- /package/assets/core/{cesdk-v1.60.0-rc.0-44YCFRT6.data → cesdk-v1.60.0-rc.1-44YCFRT6.data} +0 -0
- /package/{integrations/react.d.ts → react/index.d.ts} +0 -0
- /package/{integrations/react.js → react/index.js} +0 -0
- /package/{integrations/vue.d.ts → vue/index.d.ts} +0 -0
package/index.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ import { SizeMode } from '@cesdk/engine';
|
|
|
132
132
|
import { SortingOrder } from '@cesdk/engine';
|
|
133
133
|
import { Source } from '@cesdk/engine';
|
|
134
134
|
import { _Source } from '@cesdk/engine';
|
|
135
|
+
import { SplitOptions } from '@cesdk/engine';
|
|
135
136
|
import { SpotColor } from '@cesdk/engine';
|
|
136
137
|
import { StrokeCornerGeometry } from '@cesdk/engine';
|
|
137
138
|
import { StrokePosition } from '@cesdk/engine';
|
|
@@ -167,6 +168,92 @@ declare type A11y = {
|
|
|
167
168
|
headingsHierarchyStart: 1 | 2 | 3 | 4 | 5 | 6;
|
|
168
169
|
};
|
|
169
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Type helper for retrieving the correct action function type based on the action ID.
|
|
173
|
+
* Returns the strongly-typed action for known actions, or a custom action type for unknown IDs.
|
|
174
|
+
*
|
|
175
|
+
* @typeParam T - The action ID type
|
|
176
|
+
* @typeParam C - The custom action function type (defaults to CustomActionFunction)
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
export declare type ActionFunction<T extends ActionId, C = CustomActionFunction> = T extends keyof RegisteredActions ? RegisteredActions[T] : C;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Available action event types that can be registered with the ActionsAPI.
|
|
183
|
+
* These correspond to different UI actions that can be customized.
|
|
184
|
+
* Supports both predefined action types from the Actions interface and custom string identifiers.
|
|
185
|
+
*
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
export declare type ActionId = keyof RegisteredActions | (string & {});
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* ActionsAPI provides a centralized way to manage and customize actions
|
|
192
|
+
* for various user interactions in the Creative Engine SDK.
|
|
193
|
+
*
|
|
194
|
+
* This API allows you to:
|
|
195
|
+
* - Register custom actions for events (export, load, download, etc.)
|
|
196
|
+
* - Use default implementations when no custom action is registered
|
|
197
|
+
* - Maintain consistent behavior across different UI components
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
export declare class ActionsAPI {
|
|
201
|
+
#private;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Registers a custom action for a specific event type.
|
|
205
|
+
*
|
|
206
|
+
* @param actionId - The event type to register an action for
|
|
207
|
+
* @param action - The custom action function
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* actionsAPI.register('downloadFile', async (blob, mimeType) => {
|
|
212
|
+
* // Custom download logic
|
|
213
|
+
* await customDownloadAction(blob, mimeType);
|
|
214
|
+
* });
|
|
215
|
+
* ```
|
|
216
|
+
* @public
|
|
217
|
+
*/
|
|
218
|
+
register<T extends ActionId>(actionId: T, action: ActionFunction<T>): void;
|
|
219
|
+
/**
|
|
220
|
+
* Returns the custom export video action if registered, otherwise returns the default.
|
|
221
|
+
*
|
|
222
|
+
* @param actionId - The event type to get an action for
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* const exportAction = actionsAPI.get('export');
|
|
227
|
+
* if (exportAction) {
|
|
228
|
+
* const result = await exportAction(options);
|
|
229
|
+
* }
|
|
230
|
+
* ```
|
|
231
|
+
* @public
|
|
232
|
+
*/
|
|
233
|
+
get<T extends ActionId, C = CustomActionFunction>(actionId: T): ActionFunction<T, C> | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* Executes a registered action with the provided parameters.
|
|
236
|
+
* Throws an error if the action is not registered.
|
|
237
|
+
*
|
|
238
|
+
* @param actionId - The event type to execute
|
|
239
|
+
* @param args - The arguments to pass to the action
|
|
240
|
+
* @returns The result of the action execution
|
|
241
|
+
* @throws Error if the action is not registered
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* try {
|
|
246
|
+
* const result = await actionsAPI.run('exportDesign', exportOptions);
|
|
247
|
+
* console.log('Export completed', result);
|
|
248
|
+
* } catch (error) {
|
|
249
|
+
* console.error('Export action not registered');
|
|
250
|
+
* }
|
|
251
|
+
* ```
|
|
252
|
+
* @public
|
|
253
|
+
*/
|
|
254
|
+
run<T extends ActionId, C = CustomActionFunction>(actionId: T, ...args: ActionFunction<T, C> extends CustomActionFunction ? Parameters<ActionFunction<T, C>> : never[]): Promise<ActionFunction<T, C> extends (...args: any[]) => infer R ? R : never>;
|
|
255
|
+
}
|
|
256
|
+
|
|
170
257
|
export { AddImageOptions }
|
|
171
258
|
|
|
172
259
|
export { AddVideoOptions }
|
|
@@ -703,19 +790,51 @@ export declare interface ButtonOptions {
|
|
|
703
790
|
* upload, and unsupported browser events.
|
|
704
791
|
*
|
|
705
792
|
* @public
|
|
793
|
+
* @deprecated Use the `cesdk.actions` API and the Order API instead.
|
|
706
794
|
*/
|
|
707
795
|
declare type Callbacks = {
|
|
796
|
+
/**
|
|
797
|
+
* @deprecated Use the onClick on `'ly.img.back.navigationBar'` and the Order API instead.
|
|
798
|
+
*/
|
|
708
799
|
onBack?: () => void | Promise<void>;
|
|
800
|
+
/**
|
|
801
|
+
* @deprecated Use the onClick on `'ly.img.close.navigationBar'` and the Order API instead.
|
|
802
|
+
*/
|
|
709
803
|
onClose?: () => void | Promise<void>;
|
|
804
|
+
/**
|
|
805
|
+
* @deprecated Use the onClick on `'ly.img.shareScene.navigationBar'` and the Order API instead.
|
|
806
|
+
*/
|
|
710
807
|
onShare?: (s: string) => void | Promise<void>;
|
|
808
|
+
/**
|
|
809
|
+
* @deprecated Use the onClick on `'ly.img.saveScene.navigationBar'` and the Order API instead.
|
|
810
|
+
*/
|
|
711
811
|
onSave?: (s: string) => void | Promise<void>;
|
|
812
|
+
/**
|
|
813
|
+
* @deprecated Use the onClick on `'ly.img.importScene.navigationBar'` and the Order API instead.
|
|
814
|
+
*/
|
|
712
815
|
onLoad?: (() => Promise<string>) | 'upload';
|
|
816
|
+
/**
|
|
817
|
+
* @deprecated Use the onClick on `'ly.img.importArchive.navigationBar'` and the Order API instead.
|
|
818
|
+
*/
|
|
713
819
|
onLoadArchive?: (() => Promise<string>) | 'uploadArchive';
|
|
820
|
+
/**
|
|
821
|
+
* @deprecated Use the onClick on `'ly.img.exportScene.navigationBar'` and the Order API instead.
|
|
822
|
+
*/
|
|
714
823
|
onDownload?: ((s: string) => void | Promise<void>) | 'download';
|
|
824
|
+
/**
|
|
825
|
+
* @deprecated Use the onClick on `'ly.img.export.navigationBar'` and the Order API instead.
|
|
826
|
+
*/
|
|
715
827
|
onExport?: ((blobs: Blob[], options: ExportOptions) => void | Promise<void>) | 'download';
|
|
828
|
+
/**
|
|
829
|
+
* @deprecated Use the `cesdk.actions.register('uploadFile', action)` and `engine.editor.setSetting('upload/supportedMimeTypes', '<mimeType>,<mimeType>')` instead.
|
|
830
|
+
* Note: If you are using `addDemoAssetSources`, now you will have to explicitly enable upload sources by setting `withUploadAssetSources: true`.
|
|
831
|
+
*/
|
|
716
832
|
onUpload?: OnUploadCallback | 'local' | (Partial<OnUploadOptions> & {
|
|
717
833
|
callback: OnUploadCallback;
|
|
718
834
|
});
|
|
835
|
+
/**
|
|
836
|
+
* @deprecated Use the `cesdk.actions.register('onUnsupportedBrowser', action)` instead.
|
|
837
|
+
*/
|
|
719
838
|
onUnsupportedBrowser?: () => void;
|
|
720
839
|
};
|
|
721
840
|
|
|
@@ -775,6 +894,9 @@ export declare interface CESDKConfiguration {
|
|
|
775
894
|
*/
|
|
776
895
|
i18n: I18n;
|
|
777
896
|
a11y: A11y;
|
|
897
|
+
/**
|
|
898
|
+
* @deprecated The `callbacks` property is deprecated in favor of the `cesdk.actions` API and navigation bar order APIs.
|
|
899
|
+
*/
|
|
778
900
|
callbacks: Callbacks;
|
|
779
901
|
featureFlags?: _EngineConfiguration['featureFlags'];
|
|
780
902
|
logger: _EngineConfiguration['logger'];
|
|
@@ -1014,6 +1136,16 @@ declare class CreativeEditorSDK {
|
|
|
1014
1136
|
* @category Members
|
|
1015
1137
|
* */
|
|
1016
1138
|
feature: FeatureAPI;
|
|
1139
|
+
/**
|
|
1140
|
+
* Access to the {@link ActionsAPI} to control event actions
|
|
1141
|
+
* @category Members
|
|
1142
|
+
*/
|
|
1143
|
+
actions: ActionsAPI;
|
|
1144
|
+
/**
|
|
1145
|
+
* Access to the {@link UtilsAPI} for utility functions
|
|
1146
|
+
* @category Members
|
|
1147
|
+
*/
|
|
1148
|
+
utils: UtilsAPI;
|
|
1017
1149
|
/**
|
|
1018
1150
|
* The version of the Creative Editor SDK
|
|
1019
1151
|
* @category Members
|
|
@@ -1061,10 +1193,11 @@ declare class CreativeEditorSDK {
|
|
|
1061
1193
|
* @category Asset Management
|
|
1062
1194
|
* @param options - Configuration options for asset sources. Contains `baseURL` (defaults to 'https://cdn.img.ly/assets/demo/v2'), `excludeAssetSourceIds` (IDs to ignore during load), and `sceneMode` (loads video-specific sources if 'Video').
|
|
1063
1195
|
*/
|
|
1064
|
-
addDemoAssetSources({ baseURL, excludeAssetSourceIds, sceneMode }?: {
|
|
1196
|
+
addDemoAssetSources({ baseURL, excludeAssetSourceIds, sceneMode, withUploadAssetSources }?: {
|
|
1065
1197
|
baseURL?: string;
|
|
1066
1198
|
excludeAssetSourceIds?: DemoAssetSourceId[];
|
|
1067
1199
|
sceneMode?: SceneMode;
|
|
1200
|
+
withUploadAssetSources?: boolean;
|
|
1068
1201
|
}): Promise<void>;
|
|
1069
1202
|
/**
|
|
1070
1203
|
* Exports one or multiple page(s) as an file in the given mimeType
|
|
@@ -1246,6 +1379,16 @@ export default CreativeEditorSDK;
|
|
|
1246
1379
|
|
|
1247
1380
|
export { CreativeEngine }
|
|
1248
1381
|
|
|
1382
|
+
/**
|
|
1383
|
+
* A generic action function type for custom actions.
|
|
1384
|
+
* Supports both synchronous and asynchronous implementations with flexible parameters.
|
|
1385
|
+
*
|
|
1386
|
+
* @param args - Variable number of arguments of any type
|
|
1387
|
+
* @returns Any value or a promise that resolves to any value
|
|
1388
|
+
* @public
|
|
1389
|
+
*/
|
|
1390
|
+
export declare type CustomActionFunction = (...args: any[]) => any | Promise<any>;
|
|
1391
|
+
|
|
1249
1392
|
/**
|
|
1250
1393
|
* @public
|
|
1251
1394
|
* Type representing the background of a custom card, which can be either an image or an SVG vector path.
|
|
@@ -1770,6 +1913,18 @@ export declare namespace ExperimentalUserInterfaceAPI {
|
|
|
1770
1913
|
}
|
|
1771
1914
|
}
|
|
1772
1915
|
|
|
1916
|
+
/**
|
|
1917
|
+
* Action function for handling export operations.
|
|
1918
|
+
* Can be called with or without options to customize the export behavior.
|
|
1919
|
+
* Supports both standard and video export workflows through a generic type parameter.
|
|
1920
|
+
* The return type is automatically inferred based on the input options type.
|
|
1921
|
+
*
|
|
1922
|
+
* @param options - Optional export configuration for standard or video exports
|
|
1923
|
+
* @returns A promise that resolves when the export operation is complete, or void for synchronous operations
|
|
1924
|
+
* @public
|
|
1925
|
+
*/
|
|
1926
|
+
export declare type ExportAction = (options?: EngineExportOptions | VideoExportOptions) => void | Promise<void>;
|
|
1927
|
+
|
|
1773
1928
|
/**
|
|
1774
1929
|
* @public
|
|
1775
1930
|
* Type representing the export format.
|
|
@@ -1796,6 +1951,19 @@ export declare interface ExportOptions extends Pick<EngineExportOptions, 'pngCom
|
|
|
1796
1951
|
pages?: number[];
|
|
1797
1952
|
}
|
|
1798
1953
|
|
|
1954
|
+
/**
|
|
1955
|
+
* Action function for handling scene export operations.
|
|
1956
|
+
*
|
|
1957
|
+
* @param options - Options for configuring the export operation
|
|
1958
|
+
* - options.format: The format of the exported scene data.
|
|
1959
|
+
* - options.scene: The scene data to export.
|
|
1960
|
+
* @returns A promise that resolves when the export operation is complete, or void for synchronous operations
|
|
1961
|
+
* @public
|
|
1962
|
+
*/
|
|
1963
|
+
export declare type ExportSceneAction = (options: {
|
|
1964
|
+
format: 'scene' | 'archive';
|
|
1965
|
+
}) => void | Promise<void>;
|
|
1966
|
+
|
|
1799
1967
|
/**
|
|
1800
1968
|
* Controls the availability of features within the Creative Editor SDK.
|
|
1801
1969
|
*
|
|
@@ -1878,6 +2046,12 @@ export declare type FeaturePredicateContext = IsEnabledFeatureContext & {
|
|
|
1878
2046
|
defaultPredicate: () => boolean;
|
|
1879
2047
|
};
|
|
1880
2048
|
|
|
2049
|
+
/**
|
|
2050
|
+
* Represents the MIME types for files supported by the file operations in UtilsAPI.
|
|
2051
|
+
* @public
|
|
2052
|
+
*/
|
|
2053
|
+
export declare type FileMimeType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/x-tga' | 'audio/wav' | 'video/mp4' | 'video/quicktime' | 'video/webm' | 'video/matroska' | 'application/octet-stream' | 'application/pdf' | 'application/zip' | 'text/plain;charset=UTF-8';
|
|
2054
|
+
|
|
1881
2055
|
export { FillType }
|
|
1882
2056
|
|
|
1883
2057
|
export { FillTypeLonghand }
|
|
@@ -1944,6 +2118,18 @@ declare type ImageBlockConfig = {
|
|
|
1944
2118
|
|
|
1945
2119
|
export { ImageMimeType }
|
|
1946
2120
|
|
|
2121
|
+
/**
|
|
2122
|
+
* Action function for handling scene import operations.
|
|
2123
|
+
*
|
|
2124
|
+
* @param options - Options for configuring the import operation
|
|
2125
|
+
* - options.format: The format of the imported scene data.
|
|
2126
|
+
* @returns A promise that resolves with the imported scene data as a string, or the scene data directly
|
|
2127
|
+
* @public
|
|
2128
|
+
*/
|
|
2129
|
+
export declare type ImportSceneAction = (options: {
|
|
2130
|
+
format?: 'scene' | 'archive';
|
|
2131
|
+
}) => void | Promise<void>;
|
|
2132
|
+
|
|
1947
2133
|
/**
|
|
1948
2134
|
* Represents options for an input.
|
|
1949
2135
|
*
|
|
@@ -2139,14 +2325,61 @@ export declare interface MediaPreviewOptions {
|
|
|
2139
2325
|
export { MimeType_2 as MimeType }
|
|
2140
2326
|
|
|
2141
2327
|
/**
|
|
2142
|
-
*
|
|
2143
|
-
*
|
|
2144
|
-
*
|
|
2145
|
-
* It includes predefined IDs for separators, spacers, and various navigation items, as well as a catch-all type for custom IDs.
|
|
2328
|
+
* @public
|
|
2329
|
+
* Base interface for action buttons in the navigation bar.
|
|
2330
|
+
* Contains common properties shared across all action button types.
|
|
2146
2331
|
*
|
|
2332
|
+
* - `onClick`: Handler invoked when the button is clicked.
|
|
2333
|
+
* - `label`: Optional label for the button.
|
|
2334
|
+
* - `icon`: Optional icon name to display on the button.
|
|
2335
|
+
* - `variant`: Optional style variant of the button, either 'regular' or 'plain'.
|
|
2336
|
+
* - `color`: Optional color which can be either 'accent' or 'danger'.
|
|
2337
|
+
* - `isDisabled`: Optional disabled property.
|
|
2338
|
+
* - `isLoading`: Optional loading property.
|
|
2339
|
+
*/
|
|
2340
|
+
export declare interface NavigationBarActionButton extends OrderComponent {
|
|
2341
|
+
id: 'ly.img.saveScene.navigationBar' | 'ly.img.exportArchive.navigationBar' | 'ly.img.exportScene.navigationBar' | 'ly.img.exportImage.navigationBar' | 'ly.img.exportPDF.navigationBar' | 'ly.img.exportVideo.navigationBar' | 'ly.img.importScene.navigationBar' | 'ly.img.importArchive.navigationBar' | 'ly.img.shareScene.navigationBar' | 'ly.img.back.navigationBar' | 'ly.img.close.navigationBar';
|
|
2342
|
+
onClick: () => void | Promise<void>;
|
|
2343
|
+
label?: string;
|
|
2344
|
+
icon?: string;
|
|
2345
|
+
variant?: 'regular' | 'plain';
|
|
2346
|
+
color?: 'accent' | 'danger';
|
|
2347
|
+
isDisabled?: boolean;
|
|
2348
|
+
isLoading?: boolean;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
/**
|
|
2352
|
+
* A list of the component IDs that can be used in the navigation bar.
|
|
2353
|
+
* @public
|
|
2354
|
+
*/
|
|
2355
|
+
export declare type NavigationBarComponentId = 'ly.img.separator' | 'ly.img.spacer' | 'ly.img.back.navigationBar' | 'ly.img.undoRedo.navigationBar' | 'ly.img.pageResize.navigationBar' | 'ly.img.title.navigationBar' | 'ly.img.zoom.navigationBar' | 'ly.img.preview.navigationBar' | 'ly.img.actions.navigationBar' | 'ly.img.close.navigationBar' | 'ly.img.saveScene.navigationBar' | 'ly.img.exportImage.navigationBar' | 'ly.img.exportPDF.navigationBar' | 'ly.img.exportVideo.navigationBar' | 'ly.img.shareScene.navigationBar' | 'ly.img.exportScene.navigationBar' | 'ly.img.exportArchive.navigationBar' | 'ly.img.importScene.navigationBar' | 'ly.img.importArchive.navigationBar' | 'ly.img.action.navigationBar' | (string & {});
|
|
2356
|
+
|
|
2357
|
+
/**
|
|
2358
|
+
* @public
|
|
2359
|
+
*/
|
|
2360
|
+
export declare type NavigationBarComponents = NavigationBarActionButton | NavigationBarCustomActionButton;
|
|
2361
|
+
|
|
2362
|
+
/**
|
|
2363
|
+
* @public
|
|
2364
|
+
* Interface representing a generic Action Button in the navigation bar component.
|
|
2365
|
+
* Note: This component requires a key and has a required label, unlike other action buttons.
|
|
2366
|
+
*/
|
|
2367
|
+
export declare interface NavigationBarCustomActionButton extends OrderComponent {
|
|
2368
|
+
id: 'ly.img.action.navigationBar';
|
|
2369
|
+
key: string;
|
|
2370
|
+
onClick: () => void | Promise<void>;
|
|
2371
|
+
label: string;
|
|
2372
|
+
icon?: string;
|
|
2373
|
+
variant?: 'regular' | 'plain';
|
|
2374
|
+
color?: 'accent' | 'danger';
|
|
2375
|
+
isDisabled?: boolean;
|
|
2376
|
+
isLoading?: boolean;
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
/**
|
|
2147
2380
|
* @public
|
|
2148
2381
|
*/
|
|
2149
|
-
export declare type
|
|
2382
|
+
export declare type NavigationBarOrderComponent = NavigationBarComponents | OrderComponentWithChildren<NavigationBarComponentId, NavigationBarComponents>;
|
|
2150
2383
|
|
|
2151
2384
|
/**
|
|
2152
2385
|
* This enum is used to specify the position of the navigation bar within the user interface.
|
|
@@ -2240,6 +2473,41 @@ export { ObjectTypeShorthand }
|
|
|
2240
2473
|
|
|
2241
2474
|
export { OffscreenCanvas_2 as OffscreenCanvas }
|
|
2242
2475
|
|
|
2476
|
+
/**
|
|
2477
|
+
* This interface extends the base ExportOptions with additional information about the export,
|
|
2478
|
+
* including which design blocks were exported and the mimeType.
|
|
2479
|
+
*
|
|
2480
|
+
* @see ExportOptions For base export configuration options
|
|
2481
|
+
* @see DesignBlockId For design block identifier type
|
|
2482
|
+
*
|
|
2483
|
+
* @public
|
|
2484
|
+
*/
|
|
2485
|
+
export declare type OnExportOptions = EngineExportOptions & {
|
|
2486
|
+
mimeType: Required<EngineExportOptions>['mimeType'];
|
|
2487
|
+
exportedBlocks?: DesignBlockId[];
|
|
2488
|
+
};
|
|
2489
|
+
|
|
2490
|
+
/**
|
|
2491
|
+
* This interface extends the base VideoExportOptions with additional information about the export,
|
|
2492
|
+
* including which design blocks were exported and the mimeType.
|
|
2493
|
+
*
|
|
2494
|
+
* @see VideoExportOptions For base export configuration options
|
|
2495
|
+
* @see DesignBlockId For design block identifier type
|
|
2496
|
+
* @public
|
|
2497
|
+
*/
|
|
2498
|
+
export declare type OnExportVideoOptions = VideoExportOptions & {
|
|
2499
|
+
mimeType: VideoMimeType;
|
|
2500
|
+
exportedBlocks?: DesignBlockId[];
|
|
2501
|
+
};
|
|
2502
|
+
|
|
2503
|
+
/**
|
|
2504
|
+
* Action function that is invoked when an unsupported browser is detected.
|
|
2505
|
+
* This allows custom handling of unsupported browser scenarios.
|
|
2506
|
+
*
|
|
2507
|
+
* @public
|
|
2508
|
+
*/
|
|
2509
|
+
export declare type OnUnsupportedBrowserAction = () => void;
|
|
2510
|
+
|
|
2243
2511
|
/**
|
|
2244
2512
|
* Represents the upload callback function for the Creative Editor SDK.
|
|
2245
2513
|
* This type defines a function that handles file uploads, including progress updates and context.
|
|
@@ -2285,7 +2553,20 @@ export declare interface OrderComponent<I = ComponentId> extends ComponentPayloa
|
|
|
2285
2553
|
*
|
|
2286
2554
|
* @public
|
|
2287
2555
|
*/
|
|
2288
|
-
export declare type OrderComponentMatcher<C extends OrderComponent> = C['id'] | Partial<C> | ((component: C, index: number) => boolean);
|
|
2556
|
+
export declare type OrderComponentMatcher<C extends OrderComponent> = 'first' | 'last' | number | C['id'] | Partial<C> | ((component: C, index: number) => boolean);
|
|
2557
|
+
|
|
2558
|
+
/**
|
|
2559
|
+
* Represents a custom dock component.
|
|
2560
|
+
*
|
|
2561
|
+
* The CustomDockComponent interface defines the structure of a custom dock component.
|
|
2562
|
+
* It includes properties for the ID and payload.
|
|
2563
|
+
*
|
|
2564
|
+
* @public
|
|
2565
|
+
*/
|
|
2566
|
+
export declare interface OrderComponentWithChildren<I extends ComponentId, C = OrderComponent<I>> extends OrderComponent<I> {
|
|
2567
|
+
/** A list of children as order components */
|
|
2568
|
+
children?: (OrderComponentWithChildren<I, C> | I | C)[];
|
|
2569
|
+
}
|
|
2289
2570
|
|
|
2290
2571
|
/**
|
|
2291
2572
|
* Interface representing the context for ordering components.
|
|
@@ -2446,6 +2727,33 @@ export { PropertyType }
|
|
|
2446
2727
|
|
|
2447
2728
|
export { Range_2 as Range }
|
|
2448
2729
|
|
|
2730
|
+
/**
|
|
2731
|
+
* Represents a collection of action functions used throughout the application.
|
|
2732
|
+
* Each property corresponds to a specific UI action or event that can be customized.
|
|
2733
|
+
*
|
|
2734
|
+
* @public
|
|
2735
|
+
*/
|
|
2736
|
+
export declare interface RegisteredActions {
|
|
2737
|
+
/** Action invoked to handle scene saving. */
|
|
2738
|
+
saveScene: SaveSceneAction;
|
|
2739
|
+
/** Action invoked to handle scene sharing. */
|
|
2740
|
+
shareScene: ShareSceneAction;
|
|
2741
|
+
/** Action invoked to handle export actions. */
|
|
2742
|
+
exportDesign: ExportAction;
|
|
2743
|
+
/** Action invoked to handle import actions. */
|
|
2744
|
+
importScene: ImportSceneAction;
|
|
2745
|
+
/** Action invoked to handle scene export actions. */
|
|
2746
|
+
exportScene: ExportSceneAction;
|
|
2747
|
+
/** Action invoked to handle file uploads. */
|
|
2748
|
+
uploadFile: UploadAction;
|
|
2749
|
+
/** Action invoked when an unsupported browser is detected. */
|
|
2750
|
+
onUnsupportedBrowser: OnUnsupportedBrowserAction;
|
|
2751
|
+
/**
|
|
2752
|
+
* Action invoked when the add clip button is pressed in the video timeline
|
|
2753
|
+
*/
|
|
2754
|
+
addClip: VoidFunction;
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2449
2757
|
/**
|
|
2450
2758
|
* @public
|
|
2451
2759
|
* Provides context for replacing asset library entries, including selected blocks and default entry IDs.
|
|
@@ -2467,6 +2775,14 @@ export { RGBColor }
|
|
|
2467
2775
|
|
|
2468
2776
|
export { RoleString }
|
|
2469
2777
|
|
|
2778
|
+
/**
|
|
2779
|
+
* Action function for handling scene saving operations.
|
|
2780
|
+
*
|
|
2781
|
+
* @returns A promise that resolves when the save operation is complete, or void for synchronous operations
|
|
2782
|
+
* @public
|
|
2783
|
+
*/
|
|
2784
|
+
export declare type SaveSceneAction = () => void | Promise<void>;
|
|
2785
|
+
|
|
2470
2786
|
/**
|
|
2471
2787
|
* Represents the base scale values for the Creative Editor SDK.
|
|
2472
2788
|
* This type defines the concrete scales that can be rendered.
|
|
@@ -2571,6 +2887,14 @@ export { ShapeTypeLonghand }
|
|
|
2571
2887
|
|
|
2572
2888
|
export { ShapeTypeShorthand }
|
|
2573
2889
|
|
|
2890
|
+
/**
|
|
2891
|
+
* Action function for handling scene sharing operations.
|
|
2892
|
+
*
|
|
2893
|
+
* @returns A promise that resolves when the share operation is complete, or void for synchronous operations
|
|
2894
|
+
* @public
|
|
2895
|
+
*/
|
|
2896
|
+
export declare type ShareSceneAction = () => void | Promise<void>;
|
|
2897
|
+
|
|
2574
2898
|
export { SizeMode }
|
|
2575
2899
|
|
|
2576
2900
|
/**
|
|
@@ -2594,6 +2918,8 @@ export { SortingOrder }
|
|
|
2594
2918
|
|
|
2595
2919
|
export { Source }
|
|
2596
2920
|
|
|
2921
|
+
export { SplitOptions }
|
|
2922
|
+
|
|
2597
2923
|
export { SpotColor }
|
|
2598
2924
|
|
|
2599
2925
|
export { StrokeCornerGeometry }
|
|
@@ -4020,6 +4346,17 @@ export declare type UnknownPanelPayload = {
|
|
|
4020
4346
|
[key: string]: unknown;
|
|
4021
4347
|
};
|
|
4022
4348
|
|
|
4349
|
+
/**
|
|
4350
|
+
* Action function for uploading files to asset sources.
|
|
4351
|
+
*
|
|
4352
|
+
* @param file - The file to upload
|
|
4353
|
+
* @param onProgress - Progress action that receives upload progress (0-100)
|
|
4354
|
+
* @param context - Optional context information for the upload operation
|
|
4355
|
+
* @returns A promise that resolves with the uploaded asset definition
|
|
4356
|
+
* @public
|
|
4357
|
+
*/
|
|
4358
|
+
export declare type UploadAction = (file: File, onProgress: (progress: number) => void, context?: UploadCallbackContext) => Promise<AssetDefinition>;
|
|
4359
|
+
|
|
4023
4360
|
/**
|
|
4024
4361
|
* Represents the context for the upload callback in the Creative Editor SDK.
|
|
4025
4362
|
* This interface defines the source ID and an optional group for the upload context.
|
|
@@ -4663,7 +5000,7 @@ export declare class UserInterfaceAPI {
|
|
|
4663
5000
|
* @param navigationBarOrder - Array of component IDs defining the navigation bar order.
|
|
4664
5001
|
* @param orderContext - Optional context specifying when this order applies.
|
|
4665
5002
|
*/
|
|
4666
|
-
setNavigationBarOrder(navigationBarOrder: (NavigationBarComponentId |
|
|
5003
|
+
setNavigationBarOrder(navigationBarOrder: (NavigationBarComponentId | NavigationBarOrderComponent)[], orderContext?: OrderContext): void;
|
|
4667
5004
|
/**
|
|
4668
5005
|
* Updates a component in the render order of the navigation bar.
|
|
4669
5006
|
*
|
|
@@ -4681,9 +5018,9 @@ export declare class UserInterfaceAPI {
|
|
|
4681
5018
|
* @param orderContext - Optional context specifying which order to update.
|
|
4682
5019
|
* @returns An object containing the number of updated components and the updated navigation bar order array.
|
|
4683
5020
|
*/
|
|
4684
|
-
updateNavigationBarOrderComponent(matcher: OrderComponentMatcher<OrderComponent<NavigationBarComponentId>>, update: NavigationBarComponentId | Partial<
|
|
5021
|
+
updateNavigationBarOrderComponent(matcher: OrderComponentMatcher<OrderComponent<NavigationBarComponentId>>, update: NavigationBarComponentId | Partial<NavigationBarOrderComponent> | ((component: NavigationBarOrderComponent) => Partial<NavigationBarOrderComponent>), orderContext?: OrderContext): {
|
|
4685
5022
|
updated: number;
|
|
4686
|
-
order:
|
|
5023
|
+
order: NavigationBarOrderComponent[];
|
|
4687
5024
|
};
|
|
4688
5025
|
/**
|
|
4689
5026
|
* Removes a component from the render order of the navigation bar.
|
|
@@ -4700,7 +5037,7 @@ export declare class UserInterfaceAPI {
|
|
|
4700
5037
|
*/
|
|
4701
5038
|
removeNavigationBarOrderComponent(matcher: OrderComponentMatcher<OrderComponent<NavigationBarComponentId>>, orderContext?: OrderContext): {
|
|
4702
5039
|
removed: number;
|
|
4703
|
-
order:
|
|
5040
|
+
order: NavigationBarOrderComponent[];
|
|
4704
5041
|
};
|
|
4705
5042
|
/**
|
|
4706
5043
|
* Inserts a component into the render order of the navigation bar.
|
|
@@ -4718,7 +5055,7 @@ export declare class UserInterfaceAPI {
|
|
|
4718
5055
|
* @param orderContext - Optional context specifying which order to update.
|
|
4719
5056
|
* @returns The updated navigation bar order array.
|
|
4720
5057
|
*/
|
|
4721
|
-
insertNavigationBarOrderComponent(matcher: OrderComponentMatcher<OrderComponent<NavigationBarComponentId>>, component: NavigationBarComponentId |
|
|
5058
|
+
insertNavigationBarOrderComponent(matcher: OrderComponentMatcher<OrderComponent<NavigationBarComponentId>>, component: NavigationBarComponentId | NavigationBarOrderComponent, location?: InsertOrderComponentLocation, orderContext?: OrderContext): {
|
|
4722
5059
|
inserted: boolean;
|
|
4723
5060
|
order: OrderComponent<NavigationBarComponentId>[];
|
|
4724
5061
|
};
|
|
@@ -4871,6 +5208,20 @@ export declare class UserInterfaceAPI {
|
|
|
4871
5208
|
*
|
|
4872
5209
|
* @category Asset Library
|
|
4873
5210
|
* @param backgroundTrackAssetLibraryEntries - Array of asset library entry IDs for the background track.
|
|
5211
|
+
* @deprecated please use the cesdk.actions API to register an action for 'addClip' and implement your own logic.
|
|
5212
|
+
* @example
|
|
5213
|
+
* ```ts
|
|
5214
|
+
* // Before
|
|
5215
|
+
* cesdk.ui.setBackgroundTrackAssetLibraryEntries(['ly.img.video', 'ly.img.image']);
|
|
5216
|
+
* // After
|
|
5217
|
+
* cesdk.actions.register('addClip', async () => {
|
|
5218
|
+
* cesdk.ui.openPanel('//ly.img.panel/assetLibrary', {
|
|
5219
|
+
* payload: {
|
|
5220
|
+
* entries: ['ly.img.video', 'ly.img.image']
|
|
5221
|
+
* }
|
|
5222
|
+
* });
|
|
5223
|
+
* });
|
|
5224
|
+
* ```
|
|
4874
5225
|
*/
|
|
4875
5226
|
setBackgroundTrackAssetLibraryEntries(backgroundTrackAssetLibraryEntries: string[]): void;
|
|
4876
5227
|
/**
|
|
@@ -4880,6 +5231,7 @@ export declare class UserInterfaceAPI {
|
|
|
4880
5231
|
*
|
|
4881
5232
|
* @category Asset Library
|
|
4882
5233
|
* @returns Array of asset library entry IDs configured for the background track.
|
|
5234
|
+
* @deprecated The background track entries are now defined via the cesdk.actions API.
|
|
4883
5235
|
*/
|
|
4884
5236
|
getBackgroundTrackAssetLibraryEntries(): string[];
|
|
4885
5237
|
/**
|
|
@@ -5054,6 +5406,19 @@ declare interface UserInterfaceElements_2 {
|
|
|
5054
5406
|
entries?: AssetLibraryEntries;
|
|
5055
5407
|
autoClose?: boolean | (() => boolean);
|
|
5056
5408
|
floating?: boolean;
|
|
5409
|
+
/**
|
|
5410
|
+
* @deprecated please use the cesdk.actions API to register an action for 'addClip' and implement your own logic.
|
|
5411
|
+
* @example
|
|
5412
|
+
* ```ts
|
|
5413
|
+
* cesdk.actions.register('addClip', async () => {
|
|
5414
|
+
* cesdk.ui.openPanel('//ly.img.panel/assetLibrary', {
|
|
5415
|
+
* payload: {
|
|
5416
|
+
* entries: ['ly.img.video', 'ly.img.image']
|
|
5417
|
+
* }
|
|
5418
|
+
* });
|
|
5419
|
+
* });
|
|
5420
|
+
* ```
|
|
5421
|
+
*/
|
|
5057
5422
|
backgroundTrackLibraryEntries?: string[] | ((entries: AssetLibraryEntry[]) => string[]);
|
|
5058
5423
|
};
|
|
5059
5424
|
replace?: {
|
|
@@ -5240,14 +5605,41 @@ declare interface UserInterfaceInspectorBlockVideoFill extends UserInterfaceInsp
|
|
|
5240
5605
|
declare interface UserInterfaceNavigation extends UserInterfaceElement {
|
|
5241
5606
|
position?: NavigationPosition;
|
|
5242
5607
|
title?: string | null;
|
|
5608
|
+
/**
|
|
5609
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5610
|
+
*/
|
|
5243
5611
|
action?: {
|
|
5612
|
+
/**
|
|
5613
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5614
|
+
*/
|
|
5244
5615
|
close?: UserInterfaceElement | boolean;
|
|
5616
|
+
/**
|
|
5617
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5618
|
+
*/
|
|
5245
5619
|
back?: UserInterfaceElement | boolean;
|
|
5620
|
+
/**
|
|
5621
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5622
|
+
*/
|
|
5246
5623
|
save?: UserInterfaceElement | boolean;
|
|
5624
|
+
/**
|
|
5625
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5626
|
+
*/
|
|
5247
5627
|
export?: UserInterfaceExportAction | boolean;
|
|
5628
|
+
/**
|
|
5629
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5630
|
+
*/
|
|
5248
5631
|
share?: UserInterfaceElement | boolean;
|
|
5632
|
+
/**
|
|
5633
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5634
|
+
*/
|
|
5249
5635
|
load?: UserInterfaceElement | boolean;
|
|
5636
|
+
/**
|
|
5637
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5638
|
+
*/
|
|
5250
5639
|
download?: UserInterfaceElement | boolean;
|
|
5640
|
+
/**
|
|
5641
|
+
* @deprecated Use the Order API to configure the actions instead.
|
|
5642
|
+
*/
|
|
5251
5643
|
custom?: UserInterfaceCustomAction[];
|
|
5252
5644
|
};
|
|
5253
5645
|
}
|
|
@@ -5259,6 +5651,164 @@ declare interface UserInterfaceNavigation extends UserInterfaceElement {
|
|
|
5259
5651
|
declare interface UserInterfaceSettings extends UserInterfaceElement {
|
|
5260
5652
|
}
|
|
5261
5653
|
|
|
5654
|
+
/**
|
|
5655
|
+
* UtilsAPI provides utility functions for common operations in the Creative Engine SDK.
|
|
5656
|
+
*
|
|
5657
|
+
* This API includes utilities for:
|
|
5658
|
+
* - Creating and managing loading dialogs
|
|
5659
|
+
* - Exporting content (images, PDFs, videos)
|
|
5660
|
+
* - Loading and downloading files
|
|
5661
|
+
* - Local file uploads
|
|
5662
|
+
* @public
|
|
5663
|
+
*/
|
|
5664
|
+
export declare class UtilsAPI {
|
|
5665
|
+
#private;
|
|
5666
|
+
|
|
5667
|
+
/**
|
|
5668
|
+
* Shows and manages a loading dialog with progress tracking
|
|
5669
|
+
*
|
|
5670
|
+
* @param options - Options for configuring the loading dialog
|
|
5671
|
+
* @returns A controller object for managing the dialog
|
|
5672
|
+
*
|
|
5673
|
+
* @example
|
|
5674
|
+
* ```typescript
|
|
5675
|
+
* const controller = cesdk.utils.showLoadingDialog({
|
|
5676
|
+
* title: 'Exporting',
|
|
5677
|
+
* message: 'Please wait...',
|
|
5678
|
+
* onAbort: () => console.log('Aborted')
|
|
5679
|
+
* });
|
|
5680
|
+
*
|
|
5681
|
+
* // Update progress
|
|
5682
|
+
* controller.updateProgress({ value: 50, max: 100 });
|
|
5683
|
+
*
|
|
5684
|
+
* // Show success
|
|
5685
|
+
* controller.showSuccess({
|
|
5686
|
+
* title: 'Success',
|
|
5687
|
+
* message: 'Export completed!'
|
|
5688
|
+
* });
|
|
5689
|
+
* ```
|
|
5690
|
+
* @public
|
|
5691
|
+
*/
|
|
5692
|
+
showLoadingDialog(options?: {
|
|
5693
|
+
title?: string;
|
|
5694
|
+
message?: string | string[];
|
|
5695
|
+
cancelLabel?: string;
|
|
5696
|
+
abortLabel?: string;
|
|
5697
|
+
abortTitle?: string;
|
|
5698
|
+
abortMessage?: string | string[];
|
|
5699
|
+
size?: 'regular' | 'large';
|
|
5700
|
+
clickOutsideToClose?: boolean;
|
|
5701
|
+
progress?: DialogProgress;
|
|
5702
|
+
onDone?: () => void;
|
|
5703
|
+
onAbort?: () => void;
|
|
5704
|
+
}): {
|
|
5705
|
+
dialogId: string;
|
|
5706
|
+
updateProgress(progress: DialogProgress): void;
|
|
5707
|
+
showSuccess(options: {
|
|
5708
|
+
title?: string;
|
|
5709
|
+
message: string | string[];
|
|
5710
|
+
}): void;
|
|
5711
|
+
showError(options: {
|
|
5712
|
+
title?: string;
|
|
5713
|
+
message: string | string[];
|
|
5714
|
+
}): void;
|
|
5715
|
+
close(): void;
|
|
5716
|
+
};
|
|
5717
|
+
/**
|
|
5718
|
+
* Exports content with a loading dialog and progress tracking.
|
|
5719
|
+
* Automatically handles both static exports (images, PDFs) and video exports based on MIME type.
|
|
5720
|
+
*
|
|
5721
|
+
* @param options - Export options. Type inference based on mimeType.
|
|
5722
|
+
* @returns Export result - either blobs array for static or single blob for video
|
|
5723
|
+
*
|
|
5724
|
+
* @example
|
|
5725
|
+
* ```typescript
|
|
5726
|
+
* // Image export
|
|
5727
|
+
* const imageResult = await cesdk.utils.export({
|
|
5728
|
+
* mimeType: 'image/png',
|
|
5729
|
+
* pngCompressionLevel: 7
|
|
5730
|
+
* });
|
|
5731
|
+
*
|
|
5732
|
+
* // Video export
|
|
5733
|
+
* const videoResult = await cesdk.utils.export({
|
|
5734
|
+
* mimeType: 'video/mp4',
|
|
5735
|
+
* onProgress: (rendered, encoded, total) => console.log(`${rendered}/${total}`)
|
|
5736
|
+
* });
|
|
5737
|
+
* ```
|
|
5738
|
+
* @public
|
|
5739
|
+
*/
|
|
5740
|
+
export<T extends EngineExportOptions | VideoExportOptions>(options?: T): Promise<{
|
|
5741
|
+
blobs: Blob[];
|
|
5742
|
+
options: T extends VideoExportOptions ? OnExportVideoOptions : OnExportOptions;
|
|
5743
|
+
}>;
|
|
5744
|
+
|
|
5745
|
+
|
|
5746
|
+
/**
|
|
5747
|
+
* Opens a file picker dialog for the user to select a file
|
|
5748
|
+
*
|
|
5749
|
+
* @param options - Options for the file load operation
|
|
5750
|
+
* @returns The loaded file content in the requested format
|
|
5751
|
+
*
|
|
5752
|
+
* @example
|
|
5753
|
+
* ```typescript
|
|
5754
|
+
* // Load a text file
|
|
5755
|
+
* const text = await cesdk.utils.loadFile({
|
|
5756
|
+
* accept: '.txt',
|
|
5757
|
+
* returnType: 'text'
|
|
5758
|
+
* });
|
|
5759
|
+
*
|
|
5760
|
+
* // Load an image as blob
|
|
5761
|
+
* const blob = await cesdk.utils.loadFile({
|
|
5762
|
+
* accept: 'image/*',
|
|
5763
|
+
* returnType: 'blob'
|
|
5764
|
+
* });
|
|
5765
|
+
* ```
|
|
5766
|
+
* @public
|
|
5767
|
+
*/
|
|
5768
|
+
loadFile<T extends 'dataURL' | 'text' | 'blob' | 'arrayBuffer' | 'File'>({ accept, returnType }: {
|
|
5769
|
+
accept: string;
|
|
5770
|
+
returnType?: T;
|
|
5771
|
+
}): Promise<T extends 'dataURL' ? string : T extends 'text' ? string : T extends 'blob' ? Blob : T extends 'arrayBuffer' ? ArrayBuffer : File>;
|
|
5772
|
+
/**
|
|
5773
|
+
* Downloads a blob or string as a file to the user's device
|
|
5774
|
+
*
|
|
5775
|
+
* @param file - The content to download (Blob or string)
|
|
5776
|
+
* @param mimeType - The MIME type of the content
|
|
5777
|
+
*
|
|
5778
|
+
* @example
|
|
5779
|
+
* ```typescript
|
|
5780
|
+
* // Download a text file
|
|
5781
|
+
* await cesdk.utils.downloadFile('Hello World', 'text/plain');
|
|
5782
|
+
*
|
|
5783
|
+
* // Download a blob
|
|
5784
|
+
* const blob = new Blob(['content'], { type: 'text/plain' });
|
|
5785
|
+
* await cesdk.utils.downloadFile(blob, 'text/plain');
|
|
5786
|
+
* ```
|
|
5787
|
+
* @public
|
|
5788
|
+
*/
|
|
5789
|
+
downloadFile(file: Blob | string, mimeType?: FileMimeType): Promise<void>;
|
|
5790
|
+
/**
|
|
5791
|
+
* Performs a local upload of a file (development only)
|
|
5792
|
+
*
|
|
5793
|
+
* Note: This is meant for development testing only. In production,
|
|
5794
|
+
* you should implement a proper upload handler using the callbacks API.
|
|
5795
|
+
*
|
|
5796
|
+
* @param file - The file to upload
|
|
5797
|
+
* @param context - Optional context information for the upload operation
|
|
5798
|
+
* @returns The asset definition for the uploaded file
|
|
5799
|
+
*
|
|
5800
|
+
* @example
|
|
5801
|
+
* ```typescript
|
|
5802
|
+
* const file = new File(['content'], 'test.txt');
|
|
5803
|
+
* const asset = await cesdk.utils.localUpload(file, {
|
|
5804
|
+
* context: { source: 'user-upload' }
|
|
5805
|
+
* });
|
|
5806
|
+
* ```
|
|
5807
|
+
* @public
|
|
5808
|
+
*/
|
|
5809
|
+
localUpload(file: File, context?: UploadCallbackContext): Promise<AssetDefinition>;
|
|
5810
|
+
}
|
|
5811
|
+
|
|
5262
5812
|
export { VariableAPI }
|
|
5263
5813
|
|
|
5264
5814
|
export { VerticalBlockAlignment }
|