@cesdk/engine 1.11.0-preview.1 → 1.11.0-rc.0

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
@@ -1621,6 +1621,51 @@ export declare class BlockAPI {
1621
1621
  * @returns The drop shadow's clipping.
1622
1622
  */
1623
1623
  getDropShadowClip(id: DesignBlockId): boolean;
1624
+ /**
1625
+ * Create a Cutout block.
1626
+ * @param blocks - The blocks whose shape will serve as the basis for the cutout's path.
1627
+ * @returns The handle of the created Cutout.
1628
+ */
1629
+ createCutoutFromBlocks(ids: DesignBlockId[]): DesignBlockId;
1630
+ /**
1631
+ * Create a Cutout block.
1632
+ * @param path - An SVG string describing a path.
1633
+ * @returns The handle of the created Cutout.
1634
+ */
1635
+ createCutoutFromPath(path: string): DesignBlockId;
1636
+ /**
1637
+ * Set the cutout's offset from the underlying path.
1638
+ * @param block - The block whose offset should be set.
1639
+ * @param offset - The offset to be set.
1640
+ */
1641
+ setCutoutOffset(id: DesignBlockId, offset: number): void;
1642
+ /**
1643
+ * Get the cutout's offset from the underlying path.
1644
+ * @param block - The block whose offset should be queried.
1645
+ * @returns The cutout's offset.
1646
+ */
1647
+ getCutoutOffset(id: DesignBlockId): number;
1648
+ /**
1649
+ * Set the cutout's type.
1650
+ * @param block - The block whose type should be set.
1651
+ * @param type - The type to be set.
1652
+ */
1653
+ setCutoutType(id: DesignBlockId, type: CutoutType): void;
1654
+ /**
1655
+ * Get the cutout's type.
1656
+ * @param block - The block whose type should be queried.
1657
+ * @returns The cutout's type.
1658
+ */
1659
+ getCutoutType(id: DesignBlockId): CutoutType;
1660
+ /** Perform a boolean operation on the given Cutout blocks.
1661
+ * The cutout offset of the new block is 0.
1662
+ * The cutout type of the new block is that of the first block.
1663
+ * When performing a `Difference` operation, the first block is the block subtracted from.
1664
+ * @param blocks - The blocks with which to perform to the operation.
1665
+ * @param op - The boolean operation to perform.
1666
+ * @returns The newly created block or an error.
1667
+ */
1668
+ createCutoutFromOperation(ids: DesignBlockId[], op: CutoutOperation): DesignBlockId;
1624
1669
  /**
1625
1670
  * Inserts the given text into the selected range of the text block.
1626
1671
  * @param block - The text block into which to insert the given text.
@@ -1657,9 +1702,11 @@ export declare class BlockAPI {
1657
1702
  * Returns the ordered unique list of colors of the text in the selected range.
1658
1703
  * @param block - The text block whose colors should be returned.
1659
1704
  * @param from - The start index of the UTF-16 range whose colors should be returned.
1660
- * If the value is negative, this will fall back to the start of the entire text range.
1705
+ * If the value is negative and the block is currently being edited, this will fall back to the start of the current cursor index / selected grapheme range.
1706
+ * If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
1661
1707
  * @param to - The UTF-16 index after the last grapheme whose colors should be returned.
1662
- * If the value is negative, this will fall back to the end of the entire text range.
1708
+ * If the value is negative and the block is currently being edited, this will fall back to the end of the current cursor index / selected grapheme range.
1709
+ * If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
1663
1710
  */
1664
1711
  getTextColors(id: DesignBlockId, from?: number, to?: number): Array<RGBAColor | SpotColor>;
1665
1712
  /**
@@ -1684,6 +1731,29 @@ export declare class BlockAPI {
1684
1731
  * If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
1685
1732
  */
1686
1733
  getTextFontStyles(id: DesignBlockId, from?: number, to?: number): FontStyle[];
1734
+ /**
1735
+ * Returns the ordered list of text cases of the text in the selected range.
1736
+ * @param block - The text block whose text cases should be returned.
1737
+ * @param from - The start index of the UTF-16 range whose text cases should be returned.
1738
+ * If the value is negative and the block is currently being edited, this will fall back to the start of the current cursor index / selected grapheme range.
1739
+ * If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
1740
+ * @param to - The UTF-16 index after the last grapheme whose text cases should be returned.
1741
+ * If the value is negative and the block is currently being edited, this will fall back to the end of the current cursor index / selected grapheme range.
1742
+ * If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
1743
+ */
1744
+ getTextCases(id: DesignBlockId, from?: number, to?: number): TextCase[];
1745
+ /**
1746
+ * Sets the given text case for the selected range of text.
1747
+ * @param id - The text block whose text case should be changed.
1748
+ * @param textCase - The new text case value.
1749
+ * @param from - The start index of the UTF-16 range whose text cases should be returned.
1750
+ * If the value is negative and the block is currently being edited, this will fall back to the start of the current cursor index / selected grapheme range.
1751
+ * If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
1752
+ * @param to - The UTF-16 index after the last grapheme whose text cases should be returned.
1753
+ * If the value is negative and the block is currently being edited, this will fall back to the end of the current cursor index / selected grapheme range.
1754
+ * If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
1755
+ */
1756
+ setTextCase(id: DesignBlockId, textCase: TextCase, from?: number, to?: number): void;
1687
1757
  /**
1688
1758
  * Query if the given block has fill color properties.
1689
1759
  * @param id - The block to query.
@@ -2229,26 +2299,32 @@ export declare interface CMYKColor {
2229
2299
  }
2230
2300
 
2231
2301
  /**
2232
- * A color definition for the custom color palette.
2233
- * The RGB and CMYK components must all be specified in the range [0-1].
2302
+ * @deprecated This type definition has been removed.
2303
+ * Instead of `ConfigTypes.Color`, this can be imported directly as `PaletteColor`.
2234
2304
  * @public
2235
2305
  */
2236
- declare type Color_2 = HexColorString | RGBColor | RGBAColor | SpotColor;
2306
+ declare type Color_2 = PaletteColor;
2237
2307
 
2238
- /** @public */
2308
+ /**
2309
+ * @deprecated This type definition is not used anymore and will be removed.
2310
+ * @public
2311
+ */
2239
2312
  declare type ColorDefinition = Preset & {
2240
2313
  value: Color_2;
2241
2314
  };
2242
2315
 
2243
- /** @public */
2316
+ /**
2317
+ * @deprecated This type definition is not used anymore and will be removed.
2318
+ * @public
2319
+ */
2244
2320
  declare type ColorPaletteDefinition = Preset & {
2245
2321
  entries: Color_2[];
2246
2322
  };
2247
2323
 
2248
2324
  declare namespace ConfigTypes {
2249
2325
  export {
2250
- HexColorString,
2251
2326
  Color_2 as Color,
2327
+ HexColorString_2 as HexColorString,
2252
2328
  AssetSources,
2253
2329
  AssetSource_2 as AssetSource,
2254
2330
  AssetResult_2 as AssetResult,
@@ -2372,12 +2448,11 @@ declare class CreativeEngine {
2372
2448
  * `base_url` defaults to 'https://cdn.img.ly/assets/v1'.
2373
2449
  * Each source is created via `addLocalSource` and populated with the parsed assets. To modify the available
2374
2450
  * assets, you may either exclude certain IDs via `excludeAssetSourceIds` or alter the sources after creation.
2375
- *
2376
- * @param baseURL - The source of the asset definitions, must be absolute. Defaults to `'https://cdn.img.ly/assets/v1'`.
2377
- * @param excludeAssetSourceIds - A list of IDs, that will be ignored during load.
2378
2451
  */
2379
2452
  addDefaultAssetSources({ baseURL, excludeAssetSourceIds }?: {
2453
+ /** The source of the asset definitions, must be absolute. Defaults to `'https://cdn.img.ly/assets/v1'`. */
2380
2454
  baseURL?: string;
2455
+ /** A list of IDs, that will be ignored during load. */
2381
2456
  excludeAssetSourceIds?: DefaultAssetSourceId[];
2382
2457
  }): Promise<void>;
2383
2458
  /**
@@ -2392,14 +2467,13 @@ declare class CreativeEngine {
2392
2467
  * - `'ly.img.audio.upload'` - Demo source to upload audio assets
2393
2468
  * - `'ly.img.video'` - Sample videos
2394
2469
  * - `'ly.img.video.upload'` - Demo source to upload video assets
2395
- *
2396
- * @param excludeAssetSourceIds - A list of IDs, that will be ignored during load.
2397
- * @param sceneMode - if 'Video' video specific demo asset sources will be loaded as well (default 'Design')
2398
- * @param withUploadAssetSources - if 'true' asset sources for uploads are added (default false)
2399
2470
  */
2400
2471
  addDemoAssetSources({ excludeAssetSourceIds, sceneMode, withUploadAssetSources }?: {
2472
+ /** A list of IDs, that will be ignored during load */
2401
2473
  excludeAssetSourceIds?: DemoAssetSourceId[];
2474
+ /** If 'Video' video specific demo asset sources will be loaded as well (default 'Design') */
2402
2475
  sceneMode?: SceneMode;
2476
+ /** If 'true' asset sources for uploads are added (default false) */
2403
2477
  withUploadAssetSources?: boolean;
2404
2478
  }): Promise<void>;
2405
2479
 
@@ -2420,6 +2494,16 @@ export declare interface CursorEvent extends CustomEvent<string> {
2420
2494
  preventDefault(): void;
2421
2495
  }
2422
2496
 
2497
+ /**
2498
+ * @public
2499
+ */
2500
+ export declare type CutoutOperation = 'Difference' | 'Intersection' | 'Union' | 'XOR';
2501
+
2502
+ /**
2503
+ * @public
2504
+ */
2505
+ export declare type CutoutType = 'Solid' | 'Dashed';
2506
+
2423
2507
  /**
2424
2508
  * @public
2425
2509
  */
@@ -2447,6 +2531,7 @@ export declare enum DesignBlockType {
2447
2531
  Image = "//ly.img.ubq/image",
2448
2532
  Video = "//ly.img.ubq/video",
2449
2533
  VideoFill = "//ly.img.ubq/fill/video",
2534
+ ImageFill = "//ly.img.ubq/fill/image",
2450
2535
  Audio = "//ly.img.ubq/audio",
2451
2536
  Text = "//ly.img.ubq/text",
2452
2537
  Sticker = "//ly.img.ubq/sticker",
@@ -2456,7 +2541,8 @@ export declare enum DesignBlockType {
2456
2541
  StarShape = "//ly.img.ubq/shapes/star",
2457
2542
  PolygonShape = "//ly.img.ubq/shapes/polygon",
2458
2543
  EllipseShape = "//ly.img.ubq/shapes/ellipse",
2459
- Group = "//ly.img.ubq/group"
2544
+ Group = "//ly.img.ubq/group",
2545
+ Cutout = "//ly.img.ubq/cutout"
2460
2546
  }
2461
2547
 
2462
2548
  /**
@@ -2722,6 +2808,19 @@ export declare class EditorAPI {
2722
2808
  * @returns An empty result on success, an error otherwise.
2723
2809
  */
2724
2810
  removeSpotColor(name: string): void;
2811
+ /**
2812
+ * Set the spot color assign to a cutout type.
2813
+ * All cutout blocks of the given type will be immediately assigned that spot color.
2814
+ * @param type - The cutout type.
2815
+ * @param name - The spot color name to assign.
2816
+ */
2817
+ setSpotColorForCutoutType(type: CutoutType, color: string): void;
2818
+ /**
2819
+ * Get the name of the spot color assigned to a cutout type.
2820
+ * @param type - The cutout type.
2821
+ * @returns The color spot name.
2822
+ */
2823
+ getSpotColorForCutoutType(type: CutoutType): string;
2725
2824
  }
2726
2825
 
2727
2826
  /**
@@ -2878,7 +2977,14 @@ declare type Handler<T> = (v: T) => void;
2878
2977
  * @example #6686FF or #6686FFFF
2879
2978
  * @public
2880
2979
  */
2881
- declare type HexColorString = string;
2980
+ export declare type HexColorString = string;
2981
+
2982
+ /**
2983
+ * @deprecated This type definition has been moved
2984
+ * It can instead be imported directly as `HexColorString`
2985
+ * @public
2986
+ */
2987
+ declare type HexColorString_2 = HexColorString;
2882
2988
 
2883
2989
  /**
2884
2990
  * A numerical identifier for a history stack
@@ -2947,6 +3053,7 @@ declare enum MimeType_2 {
2947
3053
  Jpeg = "image/jpeg",
2948
3054
  Tga = "image/x-tga",
2949
3055
  Mp4 = "video/mp4",
3056
+ QuickTime = "video/quicktime",
2950
3057
  Binary = "application/octet-stream",
2951
3058
  Pdf = "application/pdf",
2952
3059
  Zip = "application/zip"
@@ -3018,14 +3125,28 @@ export declare interface PageDuration {
3018
3125
  end: number;
3019
3126
  }
3020
3127
 
3021
- /** @public */
3128
+ /**
3129
+ * @deprecated This type definition is unused and will be removed
3130
+ * @public
3131
+ */
3022
3132
  declare type PageFormatDefinition = Preset & {
3023
3133
  width: number;
3024
3134
  height: number;
3025
- unit: 'px' | 'mm' | 'in';
3135
+ /** @deprecated This property is unused and will be removed */
3136
+ dpi?: number;
3137
+ /** @deprecated This property is unused and will be removed */
3138
+ bleedMargin?: number;
3139
+ unit: 'px' | 'mm' | 'in' | DesignUnit;
3026
3140
  fixedOrientation?: boolean;
3027
3141
  };
3028
3142
 
3143
+ /**
3144
+ * A color definition for the custom color palette.
3145
+ * The RGB and CMYK components must all be specified in the range [0-1].
3146
+ * @public
3147
+ */
3148
+ export declare type PaletteColor = HexColorString | RGBColor | RGBAColor | SpotColor;
3149
+
3029
3150
  /**
3030
3151
  * - Absolute: Position in absolute design units.
3031
3152
  * - Percent: Position in relation to the block's parent's size in percent, where 1.0 means 100%.
@@ -3035,7 +3156,10 @@ declare type PageFormatDefinition = Preset & {
3035
3156
  */
3036
3157
  export declare type PositionMode = 'Absolute' | 'Percent' | 'Auto';
3037
3158
 
3038
- /** @public */
3159
+ /**
3160
+ * @deprecated This type definition is not used anymore and will be removed.
3161
+ * @public
3162
+ */
3039
3163
  declare type Preset = {
3040
3164
  meta?: {
3041
3165
  default?: boolean;
@@ -3044,20 +3168,28 @@ declare type Preset = {
3044
3168
  };
3045
3169
  };
3046
3170
 
3047
- /** @public */
3171
+ /**
3172
+ * @deprecated This type definition will be removed.
3173
+ * If you need to reference this type in your code,
3174
+ * use `Configuration['presets']` instead of `ConfigTypes.Presets`.
3175
+ * @public
3176
+ */
3048
3177
  declare type Presets = {
3178
+ /**
3179
+ * @deprecated The configuration option `presets.colors` does not exist anymore.
3180
+ */
3049
3181
  colors?: {
3050
- [id: string]: ColorDefinition;
3182
+ [id: string]: Color_2;
3051
3183
  };
3052
3184
  typefaces?: {
3053
3185
  [id: string]: TypefaceDefinition;
3054
3186
  };
3055
- pageFormats?: {
3056
- [id: string]: PageFormatDefinition;
3057
- };
3058
3187
  colorPalettes?: {
3059
3188
  [id: string]: ColorPaletteDefinition;
3060
3189
  };
3190
+ pageFormats?: {
3191
+ [id: string]: PageFormatDefinition;
3192
+ };
3061
3193
  templates?: {
3062
3194
  [id: string]: TemplateDefinition;
3063
3195
  };
@@ -3469,14 +3601,23 @@ export declare function supportsVideo(): boolean;
3469
3601
  export declare function supportsWasm(): boolean;
3470
3602
 
3471
3603
  /** @public */
3472
- declare type TemplateDefinition = Preset & {
3604
+ declare type TemplateDefinition = {
3605
+ /** @deprecated The meta field is not used anymore */
3606
+ meta?: Preset['meta'];
3473
3607
  label: string;
3474
3608
  scene: string | URL | (() => Promise<string>);
3475
3609
  thumbnailURL?: string | URL;
3476
3610
  };
3477
3611
 
3612
+ /**
3613
+ * @public
3614
+ */
3615
+ export declare type TextCase = 'Normal' | 'Uppercase' | 'Lowercase' | 'Titlecase';
3616
+
3478
3617
  /** @public */
3479
- declare type TypefaceDefinition = Preset & {
3618
+ declare type TypefaceDefinition = {
3619
+ /** @deprecated The meta field is not used anymore */
3620
+ meta?: Preset['meta'];
3480
3621
  family: string;
3481
3622
  fonts: {
3482
3623
  fontURL: string;