@cesdk/engine 1.58.0-nightly.20250801 → 1.58.0-nightly.20250808

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
@@ -1390,6 +1390,10 @@ export declare class BlockAPI {
1390
1390
  * @category Block Lifecycle
1391
1391
  * @param blocks - The blocks to save.
1392
1392
  * @param allowedResourceSchemes - The resource schemes to allow in the saved string. Defaults to ['buffer', 'http', 'https'].
1393
+ * @param onDisallowedResourceScheme - An optional callback that is called for each resource URL that has a scheme absent from
1394
+ * `resourceSchemesAllowed`. The `url` parameter is the resource URL and the `dataHash` parameter is the hash of the
1395
+ * resource's data. The callback should return a new URL for the resource, which will be used in the serialized
1396
+ * scene. The callback is expected to return the original URL if no persistence is needed.
1393
1397
  * @returns A promise that resolves to a string representing the blocks or an error.
1394
1398
  * @example
1395
1399
  * ```typescript
@@ -1402,7 +1406,7 @@ export declare class BlockAPI {
1402
1406
  * const serialized = await engine.block.saveToString([page]);
1403
1407
  * ```
1404
1408
  */
1405
- saveToString(blocks: DesignBlockId[], allowedResourceSchemes?: string[]): Promise<string>;
1409
+ saveToString(blocks: DesignBlockId[], allowedResourceSchemes?: string[], onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>): Promise<string>;
1406
1410
  /**
1407
1411
  * Saves the given blocks and their assets to a zip archive.
1408
1412
  *
@@ -5713,12 +5717,15 @@ export declare class EditorAPI {
5713
5717
  *
5714
5718
  * ```javascript
5715
5719
  * engine.editor.setEditMode('Crop');
5720
+ * // With a base mode
5721
+ * engine.editor.setEditMode('CustomMode', 'Crop');
5716
5722
  * ```
5717
5723
  *
5718
5724
  * @category Edit Mode Management
5719
5725
  * @param mode - "Transform", "Crop", "Text", "Playback", "Trim" or a custom value.
5726
+ * @param baseMode - Optional base mode from which the custom mode will inherit the settings.
5720
5727
  */
5721
- setEditMode(mode: EditMode): void;
5728
+ setEditMode(mode: EditMode, baseMode?: string): void;
5722
5729
  /**
5723
5730
  * Get the editor's current edit mode.
5724
5731
  *
@@ -7303,9 +7310,10 @@ export declare class SceneAPI {
7303
7310
  *
7304
7311
  * @category Scene Loading
7305
7312
  * @param sceneContent - The scene file contents, a base64 string.
7313
+ * @param overrideEditorConfig - Whether to override editor configuration with settings and data from the scene file. Defaults to false.
7306
7314
  * @returns A handle to the loaded scene.
7307
7315
  */
7308
- loadFromString(sceneContent: string): Promise<DesignBlockId>;
7316
+ loadFromString(sceneContent: string, overrideEditorConfig?: boolean): Promise<DesignBlockId>;
7309
7317
  /**
7310
7318
  * Load a scene from the URL to the scene file.
7311
7319
  *
@@ -7318,9 +7326,10 @@ export declare class SceneAPI {
7318
7326
  *
7319
7327
  * @category Scene Loading
7320
7328
  * @param url - The URL of the scene file.
7329
+ * @param overrideEditorConfig - Whether to override editor configuration with settings and data from the scene file. Defaults to false.
7321
7330
  * @returns scene A promise that resolves once the scene was loaded or rejects with an error otherwise.
7322
7331
  */
7323
- loadFromURL(url: string): Promise<DesignBlockId>;
7332
+ loadFromURL(url: string, overrideEditorConfig?: boolean): Promise<DesignBlockId>;
7324
7333
  /**
7325
7334
  * Load a previously archived scene from the URL to the scene file.
7326
7335
  *
@@ -7329,16 +7338,22 @@ export declare class SceneAPI {
7329
7338
  *
7330
7339
  * @category Scene Loading
7331
7340
  * @param url - The URL of the scene file.
7341
+ * @param overrideEditorConfig - Whether to override editor configuration with settings and data from the scene file. Defaults to false.
7332
7342
  * @returns scene A promise that resolves once the scene was loaded or rejects with an error otherwise.
7333
7343
  */
7334
- loadFromArchiveURL(url: string): Promise<DesignBlockId>;
7344
+ loadFromArchiveURL(url: string, overrideEditorConfig?: boolean): Promise<DesignBlockId>;
7335
7345
  /**
7336
7346
  * Serializes the current scene into a string. Selection is discarded.
7337
7347
  *
7338
7348
  * @category Scene Saving
7349
+ * @param allowedResourceSchemes - The resource schemes to allow in the saved string. Defaults to ['blob', 'bundle', 'file', 'http', 'https', 'opfs'].
7350
+ * @param onDisallowedResourceScheme - An optional callback that is called for each resource URL that has a scheme absent from
7351
+ * `resourceSchemesAllowed`. The `url` parameter is the resource URL and the `dataHash` parameter is the hash of the
7352
+ * resource's data. The callback should return a new URL for the resource, which will be used in the serialized
7353
+ * scene. The callback is expected to return the original URL if no persistence is needed.
7339
7354
  * @returns A promise that resolves with a string on success or an error on failure.
7340
7355
  */
7341
- saveToString(allowedResourceSchemes?: string[]): Promise<string>;
7356
+ saveToString(allowedResourceSchemes?: string[], onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>): Promise<string>;
7342
7357
  /**
7343
7358
  * Saves the current scene and all of its referenced assets into an archive.
7344
7359
  *
@@ -7866,7 +7881,7 @@ export declare type Scope = 'text/edit' | 'text/character' | 'fill/change' | 'fi
7866
7881
  *
7867
7882
  * @public
7868
7883
  */
7869
- 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';
7884
+ 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';
7870
7885
 
7871
7886
  /**
7872
7887
  * Represents the color settings available in the editor.