@cesdk/node 1.76.0-nightly.20260511 → 1.76.0-nightly.20260513

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
@@ -2619,6 +2619,60 @@ export declare class BlockAPI {
2619
2619
  * @returns The current mode: 'Crop', 'Cover' or 'Contain'.
2620
2620
  */
2621
2621
  getContentFillMode(id: DesignBlockId): ContentFillMode;
2622
+ /**
2623
+ * Sets the horizontal alignment of the content fill within a block.
2624
+ *
2625
+ * Only affects 'Contain' and 'Cover' fill modes; has no visible effect in 'Crop' mode,
2626
+ * where the user positions the content explicitly.
2627
+ *
2628
+ * ```javascript
2629
+ * engine.block.setContentFillHorizontalAlignment(image, 'Left');
2630
+ * ```
2631
+ *
2632
+ * @category Block Fills
2633
+ * @param id - The block to update.
2634
+ * @param alignment - The horizontal alignment: 'Left', 'Center' or 'Right'.
2635
+ */
2636
+ setContentFillHorizontalAlignment(id: DesignBlockId, alignment: HorizontalContentFillAlignment): void;
2637
+ /**
2638
+ * Gets the horizontal alignment of the content fill within a block.
2639
+ *
2640
+ * ```javascript
2641
+ * engine.block.getContentFillHorizontalAlignment(image);
2642
+ * ```
2643
+ *
2644
+ * @category Block Fills
2645
+ * @param id - The block to query.
2646
+ * @returns The current alignment: 'Left', 'Center' or 'Right'.
2647
+ */
2648
+ getContentFillHorizontalAlignment(id: DesignBlockId): HorizontalContentFillAlignment;
2649
+ /**
2650
+ * Sets the vertical alignment of the content fill within a block.
2651
+ *
2652
+ * Only affects 'Contain' and 'Cover' fill modes; has no visible effect in 'Crop' mode,
2653
+ * where the user positions the content explicitly.
2654
+ *
2655
+ * ```javascript
2656
+ * engine.block.setContentFillVerticalAlignment(image, 'Top');
2657
+ * ```
2658
+ *
2659
+ * @category Block Fills
2660
+ * @param id - The block to update.
2661
+ * @param alignment - The vertical alignment: 'Top', 'Center' or 'Bottom'.
2662
+ */
2663
+ setContentFillVerticalAlignment(id: DesignBlockId, alignment: VerticalContentFillAlignment): void;
2664
+ /**
2665
+ * Gets the vertical alignment of the content fill within a block.
2666
+ *
2667
+ * ```javascript
2668
+ * engine.block.getContentFillVerticalAlignment(image);
2669
+ * ```
2670
+ *
2671
+ * @category Block Fills
2672
+ * @param id - The block to query.
2673
+ * @returns The current alignment: 'Top', 'Center' or 'Bottom'.
2674
+ */
2675
+ getContentFillVerticalAlignment(id: DesignBlockId): VerticalContentFillAlignment;
2622
2676
  /**
2623
2677
  * Duplicates a block and its children.
2624
2678
  *
@@ -4436,6 +4490,38 @@ export declare class BlockAPI {
4436
4490
  * @param to - The end index of the UTF-16 range. Defaults to the end of the current selection or text.
4437
4491
  */
4438
4492
  setTextDecoration(id: DesignBlockId, config: TextDecorationConfig, from?: number, to?: number): void;
4493
+ /**
4494
+ * Sets kerning for a grapheme range.
4495
+ *
4496
+ * Applies an additional offset in em units on top of the font's built-in kern.
4497
+ * `1.0` equals the run's font size, so the offset scales proportionally with text size.
4498
+ *
4499
+ * ```javascript
4500
+ * engine.block.setTextKerning(text, 0.1); // add 10% of font size as extra spacing
4501
+ * engine.block.setTextKerning(text, -0.05, 0, 5); // tighten first 5 graphemes
4502
+ * engine.block.setTextKerning(text, 0); // reset to no extra offset
4503
+ * ```
4504
+ *
4505
+ * @category Block Text
4506
+ * @param id - The text block to modify.
4507
+ * @param kerning - Additional kerning in em units (1.0 = one full em). Use 0 for no extra offset.
4508
+ * @param from - The start index of the UTF-16 range. Defaults to the start of the current selection or text.
4509
+ * @param to - The end index of the UTF-16 range. Defaults to the end of the current selection or text.
4510
+ */
4511
+ setTextKerning(id: DesignBlockId, kerning: number, from?: number, to?: number): void;
4512
+ /**
4513
+ * Returns the unique kerning values across the grapheme range.
4514
+ *
4515
+ * ```javascript
4516
+ * const kernings = engine.block.getTextKernings(text); // e.g. [0] or [0.1, 0]
4517
+ * ```
4518
+ *
4519
+ * @category Block Text
4520
+ * @param id - The text block to query.
4521
+ * @param from - The start index of the UTF-16 range. Defaults to the start of the current selection or text.
4522
+ * @param to - The end index of the UTF-16 range. Defaults to the end of the current selection or text.
4523
+ */
4524
+ getTextKernings(id: DesignBlockId, from?: number, to?: number): number[];
4439
4525
  /**
4440
4526
  * Toggles the underline decoration for a text range.
4441
4527
  *
@@ -6835,19 +6921,27 @@ export declare class EditorAPI {
6835
6921
  /**
6836
6922
  * Subscribe to undo/redo history changes.
6837
6923
  *
6924
+ * The callback receives a {@link HistoryUpdate} describing what kind of update happened so consumers can
6925
+ * distinguish a real change to the active history's snapshots (e.g. an edit, undo, or redo) from a pure activation
6926
+ * via `setActiveHistory`.
6927
+ *
6838
6928
  * ```javascript
6839
- * const unsubscribe = engine.editor.onHistoryUpdated(() => {
6929
+ * const unsubscribe = engine.editor.onHistoryUpdated((kind) => {
6930
+ * if (kind === 'Activated') {
6931
+ * // The active history was switched; no scene change happened on this event.
6932
+ * return;
6933
+ * }
6840
6934
  * const canUndo = engine.editor.canUndo();
6841
6935
  * const canRedo = engine.editor.canRedo();
6842
- * console.log("History updated", {canUndo, canRedo});
6843
- * })
6936
+ * console.log('History updated', { canUndo, canRedo });
6937
+ * });
6844
6938
  * ```
6845
6939
  *
6846
6940
  * @category Event Subscriptions
6847
- * @param callback - Function called when the undo/redo history changes.
6941
+ * @param callback - Function called when the undo/redo history changes. The argument describes the kind of update.
6848
6942
  * @returns A method to unsubscribe from the event.
6849
6943
  */
6850
- onHistoryUpdated: (callback: () => void) => (() => void);
6944
+ onHistoryUpdated: (callback: (kind: HistoryUpdate) => void) => (() => void);
6851
6945
  /**
6852
6946
  * Subscribe to editor settings changes.
6853
6947
  *
@@ -7991,9 +8085,27 @@ export declare type HexColorString = string;
7991
8085
  */
7992
8086
  export declare type HistoryId = number;
7993
8087
 
8088
+ /**
8089
+ * Describes the kind of update that triggered an `onHistoryUpdated` callback.
8090
+ *
8091
+ * - `Updated`: The active history's snapshots changed: a new snapshot was added (e.g. after an edit), or undo/redo
8092
+ * was applied. The scene state changed as a direct consequence.
8093
+ * - `Activated`: A different history buffer was activated via `setActiveHistory`. The undo/redo stack visible to the
8094
+ * user changed, but no new snapshot was created and no undo/redo was applied as part of this event.
8095
+ *
8096
+ * @public
8097
+ */
8098
+ export declare type HistoryUpdate = 'Updated' | 'Activated';
8099
+
7994
8100
  /** @public */
7995
8101
  export declare type HorizontalBlockAlignment = TextHorizontalAlignment;
7996
8102
 
8103
+ /** @public */
8104
+ export declare type HorizontalContentFillAlignment = (typeof HorizontalContentFillAlignmentValues)[number];
8105
+
8106
+ /** @public */
8107
+ export declare const HorizontalContentFillAlignmentValues: readonly ["Left", "Center", "Right"];
8108
+
7997
8109
  /**
7998
8110
  * Represents the image MIME types used in the editor.
7999
8111
  *
@@ -9894,6 +10006,12 @@ export declare interface Vec3 {
9894
10006
  /** @public */
9895
10007
  export declare type VerticalBlockAlignment = TextVerticalAlignment;
9896
10008
 
10009
+ /** @public */
10010
+ export declare type VerticalContentFillAlignment = (typeof VerticalContentFillAlignmentValues)[number];
10011
+
10012
+ /** @public */
10013
+ export declare const VerticalContentFillAlignmentValues: readonly ["Top", "Center", "Bottom"];
10014
+
9897
10015
  /**
9898
10016
  * Represents the options for exporting a video.
9899
10017
  *