@cesdk/node 1.76.0-nightly.20260522 → 1.76.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/index.d.ts CHANGED
@@ -3640,6 +3640,25 @@ export declare class BlockAPI {
3640
3640
  * @param locked - Whether aspect ratio should be locked.
3641
3641
  */
3642
3642
  setCropAspectRatioLocked(id: DesignBlockId, locked: boolean): void;
3643
+ /**
3644
+ * Checks whether the "Original" crop preset (`ContentAspectRatio`) can be applied to a block.
3645
+ *
3646
+ * This runs the same preliminary check the apply path performs: it resolves the intrinsic
3647
+ * content dimensions from the block's image/video fill (an image fill resolves only from its
3648
+ * `sourceSet`; a video fill resolves from its `sourceSet` or the first decoded frame). Use it
3649
+ * to gate UI that would otherwise call the preset and fail — e.g. an unreplaced placeholder
3650
+ * image fill with an empty `sourceSet`.
3651
+ *
3652
+ * ```javascript
3653
+ * const canRevert = engine.block.canRevertToOriginalRatio(block);
3654
+ * ```
3655
+ *
3656
+ * @category Block Crop
3657
+ * @param id - The block to query.
3658
+ * @returns True if the preset would resolve, false if it cannot (no/placeholder fill, empty
3659
+ * sourceSet, video not yet decoded, or unsupported fill type).
3660
+ */
3661
+ canRevertToOriginalRatio(id: DesignBlockId): boolean;
3643
3662
  /**
3644
3663
  * Checks if a block has an opacity property.
3645
3664
  *
@@ -6536,7 +6555,7 @@ export declare const ContentFillModeValues: readonly ["Crop", "Cover", "Contain"
6536
6555
  */
6537
6556
  export declare type CreateSceneOptions = {
6538
6557
  /** The page options */
6539
- page: {
6558
+ page?: {
6540
6559
  /** The size of the page */
6541
6560
  size: number | {
6542
6561
  width: number;
@@ -6545,6 +6564,15 @@ export declare type CreateSceneOptions = {
6545
6564
  /** The background color of the page */
6546
6565
  color?: Color;
6547
6566
  };
6567
+ /**
6568
+ * The design unit of the new scene. Defaults to `Pixel`.
6569
+ */
6570
+ designUnit?: SceneDesignUnit;
6571
+ /**
6572
+ * The unit in which font sizes for `setTextFontSize` and `getTextFontSizes` are interpreted.
6573
+ * If omitted, it is paired with `designUnit`: `Pixel` scenes get `Pixel`, all other scenes get `Point`.
6574
+ */
6575
+ fontSizeUnit?: SceneFontSizeUnit;
6548
6576
  };
6549
6577
 
6550
6578
  /**
@@ -7192,6 +7220,17 @@ export declare class EditorAPI {
7192
7220
  * @returns True if a redo step is available.
7193
7221
  */
7194
7222
  canRedo(): boolean;
7223
+ /**
7224
+ * Subscribe to undo/redo history changes.
7225
+ *
7226
+ * @deprecated Use {@link onHistoryUpdatedWithKind} instead, which additionally reports a {@link HistoryUpdate}
7227
+ * describing the kind of update.
7228
+ *
7229
+ * @category Event Subscriptions
7230
+ * @param callback - Function called when the undo/redo history changes.
7231
+ * @returns A method to unsubscribe from the event.
7232
+ */
7233
+ onHistoryUpdated: (callback: () => void) => (() => void);
7195
7234
  /**
7196
7235
  * Subscribe to undo/redo history changes.
7197
7236
  *
@@ -7200,7 +7239,7 @@ export declare class EditorAPI {
7200
7239
  * via `setActiveHistory`.
7201
7240
  *
7202
7241
  * ```javascript
7203
- * const unsubscribe = engine.editor.onHistoryUpdated((kind) => {
7242
+ * const unsubscribe = engine.editor.onHistoryUpdatedWithKind((kind) => {
7204
7243
  * if (kind === 'Activated') {
7205
7244
  * // The active history was switched; no scene change happened on this event.
7206
7245
  * return;
@@ -7215,7 +7254,7 @@ export declare class EditorAPI {
7215
7254
  * @param callback - Function called when the undo/redo history changes. The argument describes the kind of update.
7216
7255
  * @returns A method to unsubscribe from the event.
7217
7256
  */
7218
- onHistoryUpdated: (callback: (kind: HistoryUpdate) => void) => (() => void);
7257
+ onHistoryUpdatedWithKind: (callback: (kind: HistoryUpdate) => void) => (() => void);
7219
7258
  /**
7220
7259
  * Subscribe to editor settings changes.
7221
7260
  *
@@ -8347,7 +8386,7 @@ export declare type HexColorString = string;
8347
8386
  export declare type HistoryId = number;
8348
8387
 
8349
8388
  /**
8350
- * Describes the kind of update that triggered an `onHistoryUpdated` callback.
8389
+ * Describes the kind of update that triggered an `onHistoryUpdatedWithKind` callback.
8351
8390
  *
8352
8391
  * - `Updated`: The active history's snapshots changed: a new snapshot was added (e.g. after an edit), or undo/redo
8353
8392
  * was applied. The scene state changed as a direct consequence.
@@ -8894,6 +8933,8 @@ export declare class SceneAPI {
8894
8933
  *
8895
8934
  * ```javascript
8896
8935
  * const scene = engine.scene.create(layout);
8936
+ * // With a specific design unit and auto-paired font-size unit:
8937
+ * const pxScene = engine.scene.create('Free', { designUnit: 'Pixel' });
8897
8938
  * ```
8898
8939
  *
8899
8940
  * @category Scene Creation
@@ -8902,6 +8943,9 @@ export declare class SceneAPI {
8902
8943
  * - `page` - Page options. Properties:
8903
8944
  * - `size` - The size of the page.
8904
8945
  * - `color` - Optional background color of the page.
8946
+ * - `designUnit` - The design unit of the new scene. Defaults to `Pixel`.
8947
+ * - `fontSizeUnit` - The font-size unit. If omitted, paired with `designUnit`
8948
+ * (`Pixel` design unit → `Pixel` font unit, others → `Point`).
8905
8949
  * @returns The scene's handle.
8906
8950
  */
8907
8951
  create(sceneLayout?: SceneLayout, options?: CreateSceneOptions): DesignBlockId;
@@ -9045,6 +9089,30 @@ export declare class SceneAPI {
9045
9089
  * @returns The current design unit.
9046
9090
  */
9047
9091
  getDesignUnit(): SceneDesignUnit;
9092
+ /**
9093
+ * Sets the unit in which font sizes for `setTextFontSize` and `getTextFontSizes` are interpreted.
9094
+ * The engine continues to store font sizes in points internally; this only affects how values
9095
+ * are interpreted at the API boundary when callers don't specify a `unit` in `TextFontSizeOptions`.
9096
+ *
9097
+ * ```javascript
9098
+ * engine.scene.setFontSizeUnit('Pixel');
9099
+ * ```
9100
+ *
9101
+ * @category Scene Properties
9102
+ * @param fontSizeUnit - The new font-size unit of the scene.
9103
+ */
9104
+ setFontSizeUnit(fontSizeUnit: SceneFontSizeUnit): void;
9105
+ /**
9106
+ * Returns the font-size unit of the current scene.
9107
+ *
9108
+ * ```javascript
9109
+ * engine.scene.getFontSizeUnit();
9110
+ * ```
9111
+ *
9112
+ * @category Scene Properties
9113
+ * @returns The current font-size unit.
9114
+ */
9115
+ getFontSizeUnit(): SceneFontSizeUnit;
9048
9116
  /**
9049
9117
  * Get the layout of the current scene.
9050
9118
  *
@@ -9390,6 +9458,12 @@ export { SceneDesignUnit }
9390
9458
  /** @public */
9391
9459
  export declare const SceneDesignUnitValues: readonly ["Pixel", "Millimeter", "Inch"];
9392
9460
 
9461
+ /** @public */
9462
+ export declare type SceneFontSizeUnit = (typeof SceneFontSizeUnitValues)[number];
9463
+
9464
+ /** @public */
9465
+ export declare const SceneFontSizeUnitValues: readonly ["Pixel", "Point"];
9466
+
9393
9467
  /** @public */
9394
9468
  export declare type SceneLayout = (typeof SceneLayoutValues)[number];
9395
9469
 
@@ -9420,7 +9494,7 @@ export declare const SceneModeValues: readonly ["Design", "Video"];
9420
9494
  export declare type Scope = 'text/edit' | 'text/character' | 'fill/change' | 'fill/changeType' | 'stroke/change' | 'shape/change' | 'layer/move' | 'layer/resize' | 'layer/rotate' | 'layer/flip' | 'layer/crop' | 'layer/opacity' | 'layer/blendMode' | 'layer/visibility' | 'layer/clipping' | 'appearance/adjustments' | 'appearance/filter' | 'appearance/effect' | 'appearance/blur' | 'appearance/shadow' | 'appearance/animation' | 'lifecycle/destroy' | 'lifecycle/duplicate' | 'editor/add' | 'editor/select';
9421
9495
 
9422
9496
  /** @public */
9423
- export declare type SettingBoolPropertyName = 'alwaysHighlightPlaceholders' | 'doubleClickToCropEnabled' | 'showBuildVersion' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'renderTextCursorAndSelectionInEngine' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning' | 'mouse/enableZoom' | 'mouse/enableScroll' | 'controlGizmo/showCropHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/dynamicMoveHandleVisibility' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showScaleHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showCropScaleHandles' | 'page/title/canEdit' | 'page/title/show' | 'page/title/showPageTitleTemplate' | 'page/title/appendPageName' | 'page/title/showOnSinglePage' | 'page/dimOutOfPageAreas' | 'page/allowCropInteraction' | 'page/allowResizeInteraction' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/allowRotateInteraction' | 'page/allowMoveInteraction' | 'page/marqueeSelectOnBodyDrag' | 'page/restrictPageSelectionToBorderAndTitle' | 'page/moveChildrenWhenCroppingFill' | 'page/selectWhenNoBlocksSelected' | 'page/highlightWhenCropping' | 'page/highlightDropTarget' | 'page/reparentBlocksToSceneWhenOutOfPage' | 'colorMaskingSettings/secondPass' | 'clampThumbnailTextureSizes' | 'useSystemFontFallback' | 'forceSystemEmojis' | 'features/textEditModeTransformHandlesEnabled' | 'features/videoStreamingEnabled' | 'grid/enabled' | 'grid/snapEnabled' | 'features/enableAutomaticEnumerations' | 'features/transparentClickThroughEnabled' | 'features/fontLineGapEnabled' | (string & {});
9497
+ export declare type SettingBoolPropertyName = 'alwaysHighlightPlaceholders' | 'doubleClickToCropEnabled' | 'showBuildVersion' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'playback/showAllBlocks' | 'renderTextCursorAndSelectionInEngine' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning' | 'mouse/enableZoom' | 'mouse/enableScroll' | 'controlGizmo/showCropHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/dynamicMoveHandleVisibility' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showScaleHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showCropScaleHandles' | 'page/title/canEdit' | 'page/title/show' | 'page/title/showPageTitleTemplate' | 'page/title/appendPageName' | 'page/title/showOnSinglePage' | 'page/dimOutOfPageAreas' | 'page/allowCropInteraction' | 'page/allowResizeInteraction' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/allowRotateInteraction' | 'page/allowMoveInteraction' | 'page/marqueeSelectOnBodyDrag' | 'page/restrictPageSelectionToBorderAndTitle' | 'page/moveChildrenWhenCroppingFill' | 'page/selectWhenNoBlocksSelected' | 'page/highlightWhenCropping' | 'page/highlightDropTarget' | 'page/reparentBlocksToSceneWhenOutOfPage' | 'colorMaskingSettings/secondPass' | 'clampThumbnailTextureSizes' | 'useSystemFontFallback' | 'forceSystemEmojis' | 'features/textEditModeTransformHandlesEnabled' | 'features/videoStreamingEnabled' | 'grid/enabled' | 'grid/snapEnabled' | 'features/enableAutomaticEnumerations' | 'features/transparentClickThroughEnabled' | 'features/fontLineGapEnabled' | (string & {});
9424
9498
 
9425
9499
  /** @public */
9426
9500
  export declare type SettingColorPropertyName = 'clearColor' | 'handleFillColor' | 'highlightColor' | 'pageHighlightColor' | 'placeholderHighlightColor' | 'snappingGuideColor' | 'rotationSnappingGuideColor' | 'cropOverlayColor' | 'textVariableHighlightColor' | 'borderOutlineColor' | 'progressColor' | 'errorStateColor' | 'page/title/color' | 'page/marginFillColor' | 'page/marginFrameColor' | 'page/innerBorderColor' | 'page/outerBorderColor' | 'colorMaskingSettings/maskColor' | 'grid/color' | (string & {});
@@ -9540,6 +9614,11 @@ export declare interface Settings {
9540
9614
  'placeholderControls/showOverlay': boolean;
9541
9615
  /** Whether animations should be enabled or not. */
9542
9616
  'blockAnimations/enabled': boolean;
9617
+ /**
9618
+ * When enabled, every block stays visible regardless of the current playback time, instead of being
9619
+ * culled outside its time offset/duration. No effect on export.
9620
+ */
9621
+ 'playback/showAllBlocks': boolean;
9543
9622
  /** Whether the background grid is shown on pages. */
9544
9623
  'grid/enabled': boolean;
9545
9624
  /** Whether elements should snap to grid lines when dragged. */
@@ -10010,7 +10089,10 @@ export declare type TextDecorationStyle = 'Solid' | 'Double' | 'Dotted' | 'Dashe
10010
10089
  * @public
10011
10090
  */
10012
10091
  export declare interface TextFontSizeOptions {
10013
- /** The unit of the font size. Defaults to 'Point' */
10092
+ /**
10093
+ * The unit of the font size. Defaults to the scene's `fontSizeUnit`
10094
+ * (configured via `engine.scene.setFontSizeUnit()`), which itself defaults to `'Point'`.
10095
+ */
10014
10096
  unit?: FontSizeUnit;
10015
10097
  /** The start index of the UTF-16 range. Defaults to -1 (start of selection/text) */
10016
10098
  from?: number;