@cesdk/engine 1.58.0-nightly.20250807 → 1.58.0-nightly.20250809

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/index.d.ts CHANGED
@@ -271,11 +271,83 @@ export declare class AssetAPI {
271
271
  addLocalSource(id: string, supportedMimeTypes?: string[], applyAsset?: (asset: CompleteAssetResult) => Promise<DesignBlockId | undefined>, applyAssetToBlock?: (asset: CompleteAssetResult, block: DesignBlockId) => Promise<void>): void;
272
272
  /**
273
273
  * Creates a new local asset source from a JSON string containing asset definitions.
274
+ *
275
+ * The JSON structure should contain a `version` field, an `id` field specifying the asset source identifier,
276
+ * and an `assets` array with asset definitions. Each asset should have an `id`, localized `label` object,
277
+ * and a `meta` object containing asset-specific properties like `uri`, `thumbUri`, `blockType`, etc.
278
+ *
279
+ * @category Asset Source Management
274
280
  * @param contentJSON - The JSON string containing the asset definitions.
275
281
  * @param basePath - An optional base path with which \{\{base_url\}\} strings in the assets should be replaced. If no value is provided, settings.basePath is used.
276
- * @returns The ID of the newly created asset source or an error if that could not be created.
282
+ * @returns The ID of the newly created asset source (as specified in the JSON's `id` field).
283
+ *
284
+ * @example
285
+ * ```javascript
286
+ * const json = JSON.stringify({
287
+ * "version": "2.0.0",
288
+ * "id": "my.custom.assets",
289
+ * "assets": [
290
+ * {
291
+ * "id": "sample_asset",
292
+ * "label": { "en": "Sample Asset" },
293
+ * "meta": {
294
+ * "uri": "https://example.com/asset.jpg",
295
+ * "thumbUri": "https://example.com/thumb.jpg",
296
+ * "blockType": "//ly.img.ubq/image"
297
+ * }
298
+ * }
299
+ * ]
300
+ * });
301
+ * const sourceId = await engine.asset.addLocalAssetSourceFromJSONString(json);
302
+ * console.log('Created asset source:', sourceId); // "my.custom.assets"
303
+ * ```
277
304
  */
278
305
  addLocalAssetSourceFromJSONString(contentJSON: string, basePath?: string): Promise<string>;
306
+ /**
307
+ * Creates a new local asset source from a JSON URI.
308
+ *
309
+ * Loads and parses a JSON file from the specified URI to create an asset source. The JSON structure
310
+ * should contain a `version` field, an `id` field specifying the asset source identifier, and an
311
+ * `assets` array with asset definitions. The created asset source will have the ID specified in the
312
+ * JSON's `id` field, and all assets defined in the JSON will be added to the source.
313
+ *
314
+ * Note: The parent directory of the content.json URI will be used as the base path for resolving
315
+ * relative URLs in the asset definitions (e.g., `{{base_url}}` placeholders).
316
+ *
317
+ * @category Asset Source Management
318
+ * @param contentURI - The URI for the JSON file to load and parse.
319
+ * @returns The ID of the newly created asset source (as specified in the JSON's `id` field).
320
+ *
321
+ * @example
322
+ * ```javascript
323
+ * // Load audio assets from IMG.LY's CDN
324
+ * const sourceId = await engine.asset.addLocalAssetSourceFromJSONURI(
325
+ * 'https://cdn.img.ly/assets/demo/v2/ly.img.audio/content.json'
326
+ * );
327
+ * console.log('Loaded asset source:', sourceId); // "ly.img.audio"
328
+ *
329
+ * // The parent directory (https://cdn.img.ly/assets/demo/v2/ly.img.audio/)
330
+ * // will be used as base path for resolving relative asset URLs
331
+ *
332
+ * // The JSON at this URL contains audio assets with structure like:
333
+ * // {
334
+ * // "version": "2.0.0",
335
+ * // "id": "ly.img.audio",
336
+ * // "assets": [
337
+ * // {
338
+ * // "id": "dance_harder",
339
+ * // "label": { "en": "Dance Harder" },
340
+ * // "meta": {
341
+ * // "uri": "https://cdn.img.ly/.../dance_harder.m4a",
342
+ * // "blockType": "//ly.img.ubq/audio",
343
+ * // "mimeType": "audio/x-m4a"
344
+ * // }
345
+ * // }
346
+ * // ]
347
+ * // }
348
+ * ```
349
+ */
350
+ addLocalAssetSourceFromJSONURI(contentURI: string): Promise<string>;
279
351
  /**
280
352
  * Remove a registered asset source.
281
353
  *
@@ -5717,12 +5789,15 @@ export declare class EditorAPI {
5717
5789
  *
5718
5790
  * ```javascript
5719
5791
  * engine.editor.setEditMode('Crop');
5792
+ * // With a base mode
5793
+ * engine.editor.setEditMode('CustomMode', 'Crop');
5720
5794
  * ```
5721
5795
  *
5722
5796
  * @category Edit Mode Management
5723
5797
  * @param mode - "Transform", "Crop", "Text", "Playback", "Trim" or a custom value.
5798
+ * @param baseMode - Optional base mode from which the custom mode will inherit the settings.
5724
5799
  */
5725
- setEditMode(mode: EditMode): void;
5800
+ setEditMode(mode: EditMode, baseMode?: string): void;
5726
5801
  /**
5727
5802
  * Get the editor's current edit mode.
5728
5803
  *
@@ -7878,7 +7953,7 @@ export declare type Scope = 'text/edit' | 'text/character' | 'fill/change' | 'fi
7878
7953
  *
7879
7954
  * @public
7880
7955
  */
7881
- export declare type SettingsBool = 'controlGizmo/showCropHandles' | 'controlGizmo/showCropScaleHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showScaleHandles' | 'doubleClickToCropEnabled' | 'features/singlePageModeEnabled' | 'features/pageCarouselEnabled' | 'features/transformEditsRetainCoverMode' | 'mouse/enableScroll' | 'mouse/enableZoom' | 'page/allowCropInteraction' | 'page/allowMoveInteraction' | 'page/allowResizeInteraction' | 'page/allowRotateInteraction' | 'page/dimOutOfPageAreas' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/moveChildrenWhenCroppingFill' | 'page/selectWhenNoBlocksSelected' | 'page/title/appendPageName' | 'page/title/show' | 'page/title/showOnSinglePage' | 'page/title/showPageTitleTemplate' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'showBuildVersion' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning' | 'useSystemFontFallback' | 'forceSystemEmojis';
7956
+ export declare type SettingsBool = 'controlGizmo/showCropHandles' | 'controlGizmo/showCropScaleHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showScaleHandles' | 'doubleClickToCropEnabled' | 'features/singlePageModeEnabled' | 'features/pageCarouselEnabled' | 'features/transformEditsRetainCoverMode' | 'mouse/enableScroll' | 'mouse/enableZoom' | 'page/allowCropInteraction' | 'page/allowMoveInteraction' | 'page/allowResizeInteraction' | 'page/allowRotateInteraction' | 'page/dimOutOfPageAreas' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/moveChildrenWhenCroppingFill' | 'page/title/appendPageName' | 'page/title/show' | 'page/title/showOnSinglePage' | 'page/title/showPageTitleTemplate' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'showBuildVersion' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning' | 'useSystemFontFallback' | 'forceSystemEmojis';
7882
7957
 
7883
7958
  /**
7884
7959
  * Represents the color settings available in the editor.