@cesdk/cesdk-js 1.9.2 → 1.10.0-preview.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/.browserslistrc +4 -0
- package/assets/core/{cesdk-v1.9.2.data → cesdk-v1.10.0-preview.1.data} +0 -0
- package/assets/core/{cesdk-v1.9.2.wasm → cesdk-v1.10.0-preview.1.wasm} +0 -0
- package/assets/extensions/ly.img.cesdk.images.samples/manifest.json +45 -45
- package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/manifest.json +47 -46
- package/assets/i18n/de.json +21 -8
- package/assets/i18n/en.json +20 -7
- package/assets/ui/stylesheets/cesdk.css +21 -20
- package/cesdk.umd.js +1 -1
- package/index.d.ts +259 -104
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -25,21 +25,24 @@ export declare class API {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare interface Asset {
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* e.g. "extension://ly.img.cesdk.images.samples/ly.img.image/sample.1"
|
|
28
|
+
* The unique id of this asset.
|
|
30
29
|
*/
|
|
31
30
|
id: string;
|
|
32
|
-
/** E.g. `ly.img.image` */
|
|
33
31
|
/** Groups of the asset. */
|
|
34
32
|
groups?: Groups;
|
|
35
|
-
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
36
|
-
thumbUri: string;
|
|
37
|
-
|
|
38
33
|
/** Asset-specific and custom meta information */
|
|
39
34
|
meta?: {
|
|
35
|
+
/** The mime type of this asset or the data behind the asset's uri. */
|
|
36
|
+
mimeType?: string;
|
|
37
|
+
/** The type id of the design block that should be created from this asset. */
|
|
38
|
+
blockType?: string;
|
|
40
39
|
uri?: string;
|
|
40
|
+
thumbUri?: string;
|
|
41
|
+
previewUri?: string;
|
|
41
42
|
filename?: string;
|
|
42
43
|
vectorPath?: string;
|
|
44
|
+
width?: number;
|
|
45
|
+
height?: number;
|
|
43
46
|
duration?: string;
|
|
44
47
|
} & Record<string, unknown>;
|
|
45
48
|
}
|
|
@@ -55,6 +58,16 @@ export declare class AssetAPI {
|
|
|
55
58
|
* @param source - The asset source.
|
|
56
59
|
*/
|
|
57
60
|
addSource(source: AssetSource): void;
|
|
61
|
+
/**
|
|
62
|
+
* Adds a local asset source. Its ID has to be unique.
|
|
63
|
+
* @param source - The asset source.
|
|
64
|
+
* @param supportedMimeTypes - The mime types of assets that are allowed to be added to this local source.
|
|
65
|
+
* @param applyAsset - An optional callback that can be used to override the default behavior of applying a given
|
|
66
|
+
* asset result to the active scene.
|
|
67
|
+
* @param applyAssetToBlock - An optional callback that can be used to override the default behavior of applying
|
|
68
|
+
* an asset result to a given block.
|
|
69
|
+
*/
|
|
70
|
+
addLocalSource(id: string, supportedMimeTypes?: string[], applyAsset?: (asset: AssetResult) => Promise<DesignBlockId | undefined>, applyAssetToBlock?: (asset: AssetResult, block: DesignBlockId) => Promise<void>): void;
|
|
58
71
|
/**
|
|
59
72
|
* Removes an asset source with the given ID.
|
|
60
73
|
* @param id - The ID to refer to the asset source.
|
|
@@ -78,6 +91,7 @@ export declare class AssetAPI {
|
|
|
78
91
|
* @returns The asset groups.
|
|
79
92
|
*/
|
|
80
93
|
getGroups(id: string): Promise<string[]>;
|
|
94
|
+
getSupportedMimeTypes(sourceId: string): string[];
|
|
81
95
|
/**
|
|
82
96
|
* Queries the asset source's credits info.
|
|
83
97
|
* @param sourceId - The ID of the asset source.
|
|
@@ -97,9 +111,18 @@ export declare class AssetAPI {
|
|
|
97
111
|
url: string | undefined;
|
|
98
112
|
} | undefined;
|
|
99
113
|
canManageAssets(sourceId: string): boolean;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Adds the given asset to a local asset source.
|
|
116
|
+
* @param sourceId - The local asset source ID that the asset should be added to.
|
|
117
|
+
* @param asset - The asset to be added to the asset source.
|
|
118
|
+
*/
|
|
119
|
+
addAssetToSource(sourceId: string, asset: AssetDefinition): void;
|
|
120
|
+
/**
|
|
121
|
+
* Removes the specified asset from its local asset source.
|
|
122
|
+
* @param sourceId - The id of the local asset source that currently contains the asset.
|
|
123
|
+
* @param assetId - The id of the asset to be removed.
|
|
124
|
+
*/
|
|
125
|
+
removeAssetFromSource(sourceId: string, assetId: string): void;
|
|
103
126
|
|
|
104
127
|
/**
|
|
105
128
|
* Apply an asset result to the active scene.
|
|
@@ -108,7 +131,7 @@ export declare class AssetAPI {
|
|
|
108
131
|
* @param sourceId - The ID of the asset source.
|
|
109
132
|
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
110
133
|
*/
|
|
111
|
-
apply(sourceId: string, assetResult: AssetResult): Promise<
|
|
134
|
+
apply(sourceId: string, assetResult: AssetResult): Promise<DesignBlockId | undefined>;
|
|
112
135
|
/**
|
|
113
136
|
* Apply an asset result to the given block.
|
|
114
137
|
* @param sourceId - The ID of the asset source.
|
|
@@ -121,7 +144,7 @@ export declare class AssetAPI {
|
|
|
121
144
|
* This implementation is used when no `applyAsset` function is provided to `addSource`.
|
|
122
145
|
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
123
146
|
*/
|
|
124
|
-
defaultApplyAsset(assetResult: AssetResult): Promise<
|
|
147
|
+
defaultApplyAsset(assetResult: AssetResult): Promise<DesignBlockId | undefined>;
|
|
125
148
|
/**
|
|
126
149
|
* The default implementation for applying an asset to an existing block.
|
|
127
150
|
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
@@ -132,7 +155,7 @@ export declare class AssetAPI {
|
|
|
132
155
|
}
|
|
133
156
|
|
|
134
157
|
/**
|
|
135
|
-
* Definition of an
|
|
158
|
+
* Definition of an asset used if an asset is added to an asset source.
|
|
136
159
|
* @public
|
|
137
160
|
*/
|
|
138
161
|
export declare interface AssetDefinition extends Asset {
|
|
@@ -150,14 +173,6 @@ export declare interface AssetDefinition extends Asset {
|
|
|
150
173
|
tags?: Record<Locale, string[]>;
|
|
151
174
|
}
|
|
152
175
|
|
|
153
|
-
/** @public */
|
|
154
|
-
export declare interface _AssetElement {
|
|
155
|
-
id: string;
|
|
156
|
-
name: string;
|
|
157
|
-
uri: string;
|
|
158
|
-
thumbUri: string;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
176
|
/** @public */
|
|
162
177
|
declare type AssetLibraryEntries = AssetLibraryEntry[] | ((currentAssetLibraryEntries: AssetLibraryEntry[], context: {
|
|
163
178
|
selectedBlocks: {
|
|
@@ -297,13 +312,6 @@ export declare interface AssetResult extends Asset {
|
|
|
297
312
|
declare interface AssetResult_2 {
|
|
298
313
|
/** A unique id of this asset */
|
|
299
314
|
id: string;
|
|
300
|
-
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
301
|
-
thumbUri: string;
|
|
302
|
-
/** Original size of the asset. */
|
|
303
|
-
size: {
|
|
304
|
-
width: number;
|
|
305
|
-
height: number;
|
|
306
|
-
};
|
|
307
315
|
/** Asset-specific and custom meta information */
|
|
308
316
|
meta?: {
|
|
309
317
|
uri?: string;
|
|
@@ -371,16 +379,17 @@ export declare interface AssetSource {
|
|
|
371
379
|
*/
|
|
372
380
|
getAsset?(id: string): Promise<AssetResult | undefined>;
|
|
373
381
|
/**
|
|
374
|
-
* Can the source add
|
|
375
|
-
* methods like `addAsset`
|
|
382
|
+
* Can the source add and remove assets dynamically? If `false`
|
|
383
|
+
* methods like `addAsset` and `removeAsset` will throw an
|
|
376
384
|
* error.
|
|
377
385
|
*/
|
|
378
386
|
canManageAssets?: boolean;
|
|
379
387
|
/**
|
|
380
388
|
* Apply the given asset result to the active scene.
|
|
381
389
|
* You can override this with custom behavior.
|
|
390
|
+
* @returns the id of a new block if one was created from the asset.
|
|
382
391
|
*/
|
|
383
|
-
applyAsset?: (asset: AssetResult) => Promise<
|
|
392
|
+
applyAsset?: (asset: AssetResult) => Promise<DesignBlockId | undefined>;
|
|
384
393
|
/**
|
|
385
394
|
* Apply the given asset result to the given block.
|
|
386
395
|
* You can override this with custom behavior.
|
|
@@ -390,22 +399,12 @@ export declare interface AssetSource {
|
|
|
390
399
|
* Adds the given asset to this source. Throws an error if `canManageAssets`
|
|
391
400
|
* is `false`.
|
|
392
401
|
*
|
|
393
|
-
* @returns the id of the added asset
|
|
394
|
-
*/
|
|
395
|
-
addAsset?(asset: AssetDefinition): Promise<string>;
|
|
396
|
-
/**
|
|
397
|
-
* Updates the asset of this source. Throws an error if `canManageAssets`
|
|
398
|
-
* is `false` or no asset with the given id could not be found.
|
|
399
|
-
*
|
|
400
|
-
* @returns the id of the added asset
|
|
401
402
|
*/
|
|
402
|
-
|
|
403
|
+
addAsset?(asset: AssetDefinition): void;
|
|
403
404
|
/**
|
|
404
405
|
* Removes the given asset from this source.
|
|
405
|
-
*
|
|
406
|
-
* @returns true if asset was found and removed, and false otherwise
|
|
407
406
|
*/
|
|
408
|
-
removeAsset?(assetId: string):
|
|
407
|
+
removeAsset?(assetId: string): void;
|
|
409
408
|
/**
|
|
410
409
|
* Generates a list of supported mime types for this source.
|
|
411
410
|
*
|
|
@@ -425,7 +424,7 @@ declare interface AssetSource_2 {
|
|
|
425
424
|
* Apply the given asset result to the active scene.
|
|
426
425
|
* You can override this with custom behavior.
|
|
427
426
|
*/
|
|
428
|
-
applyAsset?: (asset: AssetResult_2) => Promise<
|
|
427
|
+
applyAsset?: (asset: AssetResult_2) => Promise<DesignBlockId | undefined>;
|
|
429
428
|
/**
|
|
430
429
|
* Apply the given asset result to the given block.
|
|
431
430
|
* You can override this with custom behavior.
|
|
@@ -496,11 +495,6 @@ declare interface AssetsQueryResult_2 {
|
|
|
496
495
|
total: number;
|
|
497
496
|
}
|
|
498
497
|
|
|
499
|
-
/** @public */
|
|
500
|
-
declare interface AudioElement extends _AssetElement {
|
|
501
|
-
duration: number;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
498
|
/**
|
|
505
499
|
* Bleed margin configuration options for a single design unit type.
|
|
506
500
|
* @public
|
|
@@ -566,6 +560,7 @@ export declare class BlockAPI {
|
|
|
566
560
|
/**
|
|
567
561
|
* Loads existing blocks from the given string.
|
|
568
562
|
* The blocks are not attached by default and won't be visible until attached to a page or the scene.
|
|
563
|
+
* The UUID of the loaded blocks is replaced with a new one.
|
|
569
564
|
* @param content - A string representing the given blocks.
|
|
570
565
|
* @returns A promise that resolves with a list of handles representing the found blocks or an error.
|
|
571
566
|
*/
|
|
@@ -589,13 +584,17 @@ export declare class BlockAPI {
|
|
|
589
584
|
* @returns The created fill's handle.
|
|
590
585
|
*/
|
|
591
586
|
createFill(type: string): DesignBlockId;
|
|
592
|
-
|
|
593
587
|
/**
|
|
594
588
|
* Get the type of the given block, fails if the block is invalid.
|
|
595
589
|
* @param id - The block to query.
|
|
596
590
|
* @returns The blocks type.
|
|
597
591
|
*/
|
|
598
592
|
getType(id: DesignBlockId): DesignBlockType;
|
|
593
|
+
/**
|
|
594
|
+
* Selects the given block and deselects all other blocks.
|
|
595
|
+
* @param id - The block to be selected.
|
|
596
|
+
*/
|
|
597
|
+
select(id: DesignBlockId): void;
|
|
599
598
|
/**
|
|
600
599
|
* Update the selection state of a block.
|
|
601
600
|
* Fails for invalid blocks.
|
|
@@ -757,6 +756,46 @@ export declare class BlockAPI {
|
|
|
757
756
|
* @param mode - The y position mode: absolute, percent or undefined.
|
|
758
757
|
*/
|
|
759
758
|
setPositionYMode(id: DesignBlockId, mode: PositionMode): void;
|
|
759
|
+
/**
|
|
760
|
+
* Update the block's always-on-top property. If true, this blocks's global sorting order is automatically
|
|
761
|
+
* adjusted to be higher than all other siblings
|
|
762
|
+
* without this property. If more than one block is set to be always-on-top, the child order decides which is on top.
|
|
763
|
+
*
|
|
764
|
+
* @param id - the block to update.
|
|
765
|
+
* @param enabled - whether the block shall be always-on-top.
|
|
766
|
+
*/
|
|
767
|
+
setAlwaysOnTop(id: DesignBlockId, enabled: boolean): void;
|
|
768
|
+
/**
|
|
769
|
+
* Query a block's always-on-top property.
|
|
770
|
+
*
|
|
771
|
+
* @param id - the block to query.
|
|
772
|
+
* @returns true if the block is set to be always-on-top, false otherwise.
|
|
773
|
+
*/
|
|
774
|
+
isAlwaysOnTop(id: DesignBlockId): boolean;
|
|
775
|
+
/**
|
|
776
|
+
* Updates the sorting order of this block and all of its manually created siblings
|
|
777
|
+
* so that the given block has the highest sorting order.
|
|
778
|
+
* @param id - The id of the block to be given the highest sorting order among its siblings.
|
|
779
|
+
*/
|
|
780
|
+
bringToFront(id: DesignBlockId): void;
|
|
781
|
+
/**
|
|
782
|
+
* Updates the sorting order of this block and all of its manually created siblings
|
|
783
|
+
* so that the given block has the lowest sorting order.
|
|
784
|
+
* @param id - The id of the block to be given the lowest sorting order among its siblings.
|
|
785
|
+
*/
|
|
786
|
+
sendToBack(id: DesignBlockId): void;
|
|
787
|
+
/**
|
|
788
|
+
* Updates the sorting order of this block and all of its superjacent siblings
|
|
789
|
+
* so that the given block has a higher sorting order than the next superjacent sibling.
|
|
790
|
+
* @param id - The id of the block to be given a higher sorting than the next superjacent sibling.
|
|
791
|
+
*/
|
|
792
|
+
bringForward(id: DesignBlockId): void;
|
|
793
|
+
/**
|
|
794
|
+
* Updates the sorting order of this block and all of its manually created and subjacent siblings
|
|
795
|
+
* so that the given block will have a lower sorting order than the next subjacent sibling.
|
|
796
|
+
* @param id - The id of the block to be given a lower sorting order than the next subjacent sibling.
|
|
797
|
+
*/
|
|
798
|
+
sendBackward(id: DesignBlockId): void;
|
|
760
799
|
/**
|
|
761
800
|
* Query a block's rotation in radians.
|
|
762
801
|
* @param id - The block to query.
|
|
@@ -823,12 +862,6 @@ export declare class BlockAPI {
|
|
|
823
862
|
* @returns The current mode for the height: absolute, percent or auto.
|
|
824
863
|
*/
|
|
825
864
|
getHeightMode(id: DesignBlockId): SizeMode;
|
|
826
|
-
/**
|
|
827
|
-
* Query a block's content fill mode.
|
|
828
|
-
* @param id - The block to query.
|
|
829
|
-
* @returns The current mode: crop, cover or contain.
|
|
830
|
-
*/
|
|
831
|
-
getContentFillMode(id: DesignBlockId): ContentFillMode;
|
|
832
865
|
/**
|
|
833
866
|
* Update a block's width.
|
|
834
867
|
* @param id - The block to update.
|
|
@@ -854,25 +887,45 @@ export declare class BlockAPI {
|
|
|
854
887
|
*/
|
|
855
888
|
setHeightMode(id: DesignBlockId, mode: SizeMode): void;
|
|
856
889
|
/**
|
|
857
|
-
*
|
|
858
|
-
*
|
|
859
|
-
* @param
|
|
890
|
+
* Get a block's layout position on the x-axis. The position is only available after an
|
|
891
|
+
* internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
|
|
892
|
+
* @param id - The block to query.
|
|
893
|
+
* @returns The layout position on the x-axis.
|
|
860
894
|
*/
|
|
861
|
-
|
|
895
|
+
getFrameX(id: DesignBlockId): number;
|
|
862
896
|
/**
|
|
863
|
-
* Get a block's layout
|
|
864
|
-
* internal update loop
|
|
897
|
+
* Get a block's layout position on the y-axis. The position is only available after an
|
|
898
|
+
* internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
|
|
899
|
+
* @param id - The block to query.
|
|
900
|
+
* @returns The layout position on the y-axis.
|
|
901
|
+
*/
|
|
902
|
+
getFrameY(id: DesignBlockId): number;
|
|
903
|
+
/**
|
|
904
|
+
* Get a block's layout width. The width is only available after an
|
|
905
|
+
* internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
|
|
865
906
|
* @param id - The block to query.
|
|
866
907
|
* @returns The layout width.
|
|
867
908
|
*/
|
|
868
909
|
getFrameWidth(id: DesignBlockId): number;
|
|
869
910
|
/**
|
|
870
|
-
* Get a block's layout height. The
|
|
871
|
-
* internal update loop
|
|
911
|
+
* Get a block's layout height. The height is only available after an
|
|
912
|
+
* internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
|
|
872
913
|
* @param id - The block to query.
|
|
873
914
|
* @returns The layout height.
|
|
874
915
|
*/
|
|
875
916
|
getFrameHeight(id: DesignBlockId): number;
|
|
917
|
+
/**
|
|
918
|
+
* Set a block's content fill mode.
|
|
919
|
+
* @param id - The block to update.
|
|
920
|
+
* @param mode - The content fill mode mode: crop, cover or contain.
|
|
921
|
+
*/
|
|
922
|
+
setContentFillMode(id: DesignBlockId, mode: ContentFillMode): void;
|
|
923
|
+
/**
|
|
924
|
+
* Query a block's content fill mode.
|
|
925
|
+
* @param id - The block to query.
|
|
926
|
+
* @returns The current mode: crop, cover or contain.
|
|
927
|
+
*/
|
|
928
|
+
getContentFillMode(id: DesignBlockId): ContentFillMode;
|
|
876
929
|
/**
|
|
877
930
|
* Duplicates a block including its children.
|
|
878
931
|
* @param id - The block to duplicate.
|
|
@@ -951,6 +1004,12 @@ export declare class BlockAPI {
|
|
|
951
1004
|
* @returns float The height of the axis-aligned bounding box.
|
|
952
1005
|
*/
|
|
953
1006
|
getGlobalBoundingBoxHeight(id: DesignBlockId): number;
|
|
1007
|
+
/**
|
|
1008
|
+
* Get the position and size of the axis-aligned bounding box for the given blocks in screen space.
|
|
1009
|
+
* @param ids - The block to query.
|
|
1010
|
+
* @returns The position and size of the bounding box.
|
|
1011
|
+
*/
|
|
1012
|
+
getScreenSpaceBoundingBoxXYWH(ids: DesignBlockId[]): XYWH;
|
|
954
1013
|
/**
|
|
955
1014
|
* Scales the block and all of its children proportionally around the specified
|
|
956
1015
|
* relative anchor point.
|
|
@@ -1995,6 +2054,48 @@ export declare class BlockAPI {
|
|
|
1995
2054
|
* @returns Whether solo playback is enabled for this block.
|
|
1996
2055
|
*/
|
|
1997
2056
|
isSoloPlaybackEnabled(id: DesignBlockId): boolean;
|
|
2057
|
+
/**
|
|
2058
|
+
* Returns whether the block supports a playback control.
|
|
2059
|
+
* @param block - The block to query.
|
|
2060
|
+
* @returns Whether the block has playback control.
|
|
2061
|
+
*/
|
|
2062
|
+
hasPlaybackControl(id: DesignBlockId): boolean;
|
|
2063
|
+
/**
|
|
2064
|
+
* Set whether the block should start from the beginning again or stop.
|
|
2065
|
+
* @param block - The block or video fill to update.
|
|
2066
|
+
* @param looping - Whether the block should loop to the beginning or stop.
|
|
2067
|
+
*/
|
|
2068
|
+
setLooping(id: DesignBlockId, looping: boolean): void;
|
|
2069
|
+
/**
|
|
2070
|
+
* Query whether the block is looping.
|
|
2071
|
+
* @param block - The block to query.
|
|
2072
|
+
* @returns Whether the block is looping.
|
|
2073
|
+
*/
|
|
2074
|
+
isLooping(id: DesignBlockId): boolean;
|
|
2075
|
+
/**
|
|
2076
|
+
* Set whether the audio of the block is muted.
|
|
2077
|
+
* @param block - The block or video fill to update.
|
|
2078
|
+
* @param muted - Whether the audio should be muted.
|
|
2079
|
+
*/
|
|
2080
|
+
setMuted(id: DesignBlockId, muted: boolean): void;
|
|
2081
|
+
/**
|
|
2082
|
+
* Query whether the block is muted.
|
|
2083
|
+
* @param block - The block to query.
|
|
2084
|
+
* @returns Whether the block is muted.
|
|
2085
|
+
*/
|
|
2086
|
+
isMuted(id: DesignBlockId): boolean;
|
|
2087
|
+
/**
|
|
2088
|
+
* Set the audio volume of the given block.
|
|
2089
|
+
* @param block - The block or video fill to update.
|
|
2090
|
+
* @param volume - The desired volume with a range of [0, 1].
|
|
2091
|
+
*/
|
|
2092
|
+
setVolume(id: DesignBlockId, volume: number): void;
|
|
2093
|
+
/**
|
|
2094
|
+
* Get the audio volume of the given block.
|
|
2095
|
+
* @param block - The block to query.
|
|
2096
|
+
* @returns The volume with a range of [0, 1].
|
|
2097
|
+
*/
|
|
2098
|
+
getVolume(id: DesignBlockId): number;
|
|
1998
2099
|
/**
|
|
1999
2100
|
* Begins loading the required audio and video resource for the given video fill or audio block.
|
|
2000
2101
|
* @param id - The video fill or audio block whose resource should be loaded.
|
|
@@ -2093,9 +2194,6 @@ declare namespace ConfigTypes {
|
|
|
2093
2194
|
_RequiredConfiguration as Configuration,
|
|
2094
2195
|
Theme,
|
|
2095
2196
|
Scale,
|
|
2096
|
-
PartialImageElement,
|
|
2097
|
-
PartialVideoElement,
|
|
2098
|
-
PartialAudioElement,
|
|
2099
2197
|
I18n,
|
|
2100
2198
|
A11y,
|
|
2101
2199
|
OnUploadCallback,
|
|
@@ -2191,16 +2289,6 @@ declare class CreativeEditorSDK {
|
|
|
2191
2289
|
setVariableDefinitions(definitions: {
|
|
2192
2290
|
[id: string]: _EngineConfigTypes.VariableDefinition;
|
|
2193
2291
|
}): Promise<void>;
|
|
2194
|
-
/**
|
|
2195
|
-
* Adds an image definition which can be used in the image library.
|
|
2196
|
-
*
|
|
2197
|
-
* @param definitions - image definitions
|
|
2198
|
-
*
|
|
2199
|
-
* @returns a resolved promise if all images were add successfully
|
|
2200
|
-
*/
|
|
2201
|
-
setImageDefinitions(definitions: {
|
|
2202
|
-
[id: string]: _EngineConfigTypes.ImageDefinition;
|
|
2203
|
-
}): Promise<void[]>;
|
|
2204
2292
|
/**
|
|
2205
2293
|
* Adds translations to be used by the editor.
|
|
2206
2294
|
*
|
|
@@ -2474,6 +2562,16 @@ export declare class EditorAPI {
|
|
|
2474
2562
|
* @returns The value as string.
|
|
2475
2563
|
*/
|
|
2476
2564
|
getSettingEnum(keypath: string): string;
|
|
2565
|
+
/**
|
|
2566
|
+
* Get the currently available memory in bytes.
|
|
2567
|
+
* @returns The currently available memory in bytes.
|
|
2568
|
+
*/
|
|
2569
|
+
getAvailableMemory(): number;
|
|
2570
|
+
/**
|
|
2571
|
+
* Get the current memory usage of the engine in bytes.
|
|
2572
|
+
* @returns The current memory usage in bytes.
|
|
2573
|
+
*/
|
|
2574
|
+
getUsedMemory(): number;
|
|
2477
2575
|
/**
|
|
2478
2576
|
* Sets a custom URI resolver.
|
|
2479
2577
|
* This function can be called more than once. Subsequent calls will overwrite previous calls.
|
|
@@ -2801,15 +2899,6 @@ declare type ImageDefinition = Preset & {
|
|
|
2801
2899
|
};
|
|
2802
2900
|
};
|
|
2803
2901
|
|
|
2804
|
-
/** @public */
|
|
2805
|
-
export declare interface _ImageElement extends _AssetElement {
|
|
2806
|
-
previewUri?: string;
|
|
2807
|
-
size: {
|
|
2808
|
-
width: number;
|
|
2809
|
-
height: number;
|
|
2810
|
-
};
|
|
2811
|
-
}
|
|
2812
|
-
|
|
2813
2902
|
/**
|
|
2814
2903
|
* e.g. `en`, `de`, etc.
|
|
2815
2904
|
* @public
|
|
@@ -2845,7 +2934,7 @@ declare enum NavigationPosition {
|
|
|
2845
2934
|
}
|
|
2846
2935
|
|
|
2847
2936
|
/** @public */
|
|
2848
|
-
declare type OnUploadCallback = (file: File, onProgress: (progress: number) => void) => Promise<
|
|
2937
|
+
declare type OnUploadCallback = (file: File, onProgress: (progress: number) => void) => Promise<AssetDefinition>;
|
|
2849
2938
|
|
|
2850
2939
|
/** @public */
|
|
2851
2940
|
declare type OnUploadOptions = {
|
|
@@ -2893,15 +2982,6 @@ declare enum PanelPosition {
|
|
|
2893
2982
|
Right = "right"
|
|
2894
2983
|
}
|
|
2895
2984
|
|
|
2896
|
-
/** @public */
|
|
2897
|
-
declare type PartialAudioElement = Optional<AudioElement, 'duration'>;
|
|
2898
|
-
|
|
2899
|
-
/** @public */
|
|
2900
|
-
declare type PartialImageElement = Optional<_ImageElement, 'size'>;
|
|
2901
|
-
|
|
2902
|
-
/** @public */
|
|
2903
|
-
declare type PartialVideoElement = Optional<VideoElement, 'size' | 'duration'>;
|
|
2904
|
-
|
|
2905
2985
|
/**
|
|
2906
2986
|
* - Absolute: Position in absolute design units.
|
|
2907
2987
|
* - Percent: Position in relation to the block's parent's size in percent, where 1.0 means 100%.
|
|
@@ -3111,6 +3191,11 @@ export declare class SceneAPI {
|
|
|
3111
3191
|
* @returns The current mode of the scene.
|
|
3112
3192
|
*/
|
|
3113
3193
|
getMode(): SceneMode;
|
|
3194
|
+
/**
|
|
3195
|
+
* Get the sorted list of pages in the scene.
|
|
3196
|
+
* @returns The sorted list of pages in the scene.
|
|
3197
|
+
*/
|
|
3198
|
+
getPages(): DesignBlockId[];
|
|
3114
3199
|
/**
|
|
3115
3200
|
* Sets the zoom level of the active scene.
|
|
3116
3201
|
* Only has an effect if the zoom level is not handled by the UI.
|
|
@@ -3136,6 +3221,47 @@ export declare class SceneAPI {
|
|
|
3136
3221
|
* @returns A promise that resolves once the zoom was set or rejects with an error otherwise.
|
|
3137
3222
|
*/
|
|
3138
3223
|
zoomToBlock(id: DesignBlockId, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): Promise<void>;
|
|
3224
|
+
/**
|
|
3225
|
+
* Continually adjusts the zoom level to fit the width or height of a block's axis-aligned bounding box.
|
|
3226
|
+
* Only has an effect if the zoom level is not handled by the UI.
|
|
3227
|
+
* Without padding, this results in a tight view on the block.
|
|
3228
|
+
* No more than one block per scene can have zoom auto-fit enabled.
|
|
3229
|
+
* Calling `setZoomLevel` or `zoomToBlock` disables the continuous adjustment.
|
|
3230
|
+
*
|
|
3231
|
+
* @param id - The block for which the zoom is adjusted.
|
|
3232
|
+
* @param axis - The block axis for which the zoom is adjusted.
|
|
3233
|
+
* @param paddingBefore - Optional padding in screen pixels before the block.
|
|
3234
|
+
* @param paddingAfter - Optional padding in screen pixels after the block.
|
|
3235
|
+
*/
|
|
3236
|
+
enableZoomAutoFit(id: DesignBlockId, axis: 'Horizontal' | 'Vertical', paddingBefore?: number, paddingAfter?: number): void;
|
|
3237
|
+
/**
|
|
3238
|
+
* Continually adjusts the zoom level to fit the width or height of a block's axis-aligned bounding box.
|
|
3239
|
+
* Only has an effect if the zoom level is not handled by the UI.
|
|
3240
|
+
* Without padding, this results in a tight view on the block.
|
|
3241
|
+
* Calling `setZoomLevel` or `zoomToBlock` disables the continuous adjustment.
|
|
3242
|
+
*
|
|
3243
|
+
* @param id - The block for which the zoom is adjusted.
|
|
3244
|
+
* @param axis - The block axis for which the zoom is adjusted.
|
|
3245
|
+
* @param paddingLeft - Optional padding in screen pixels to the left of the block.
|
|
3246
|
+
* @param paddingTop - Optional padding in screen pixels to the top of the block.
|
|
3247
|
+
* @param paddingRight - Optional padding in screen pixels to the right of the block.
|
|
3248
|
+
* @param paddingBottom - Optional padding in screen pixels to the bottom of the block.
|
|
3249
|
+
*/
|
|
3250
|
+
enableZoomAutoFit(id: DesignBlockId, axis: 'Both', paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): void;
|
|
3251
|
+
/**
|
|
3252
|
+
* Disables any previously set zoom auto-fit.
|
|
3253
|
+
*
|
|
3254
|
+
* @param blockOrScene - The scene or a block in the scene for which to disable a zoom auto-fit.
|
|
3255
|
+
*/
|
|
3256
|
+
disableZoomAutoFit(blockOrScene: DesignBlockId): void;
|
|
3257
|
+
/**
|
|
3258
|
+
* Queries whether zoom auto-fit is enabled.
|
|
3259
|
+
*
|
|
3260
|
+
* @param blockOrScene - The scene or a block in the scene for which to disable a zoom auto-fit.
|
|
3261
|
+
* @returns True if the given block has auto-fit set or the scene contains a block for which auto-fit is set, false
|
|
3262
|
+
* otherwise.
|
|
3263
|
+
*/
|
|
3264
|
+
isZoomAutoFitEnabled(blockOrScene: DesignBlockId): boolean;
|
|
3139
3265
|
/**
|
|
3140
3266
|
* Subscribe to changes to the zoom level.
|
|
3141
3267
|
* @param callback - This function is called at the end of the engine update, if the zoom level has changed.
|
|
@@ -3201,6 +3327,12 @@ export declare type StrokeStyle = 'Dashed' | 'DashedRound' | 'Dotted' | 'LongDas
|
|
|
3201
3327
|
/** @public */
|
|
3202
3328
|
declare type Subscription = number;
|
|
3203
3329
|
|
|
3330
|
+
/**
|
|
3331
|
+
* Checks if the current browser supports necessary technologies to match our supported browsers
|
|
3332
|
+
* @public
|
|
3333
|
+
*/
|
|
3334
|
+
export declare function supportsBrowser(): boolean;
|
|
3335
|
+
|
|
3204
3336
|
/**
|
|
3205
3337
|
* Checks if the current browser supports video editing
|
|
3206
3338
|
* @public
|
|
@@ -3293,6 +3425,8 @@ declare namespace UserInterfaceElements {
|
|
|
3293
3425
|
UserInterfaceInspectorBlockPage,
|
|
3294
3426
|
UserInterfaceInspectorBlockText,
|
|
3295
3427
|
UserInterfaceInspectorBlockImage,
|
|
3428
|
+
UserInterfaceInspectorBlockVideoFill,
|
|
3429
|
+
UserInterfaceInspectorBlockRectShape,
|
|
3296
3430
|
UserInterfaceInspector,
|
|
3297
3431
|
UserInterfaceSettings,
|
|
3298
3432
|
UserInterfaceAssetLibrary,
|
|
@@ -3378,12 +3512,22 @@ declare interface UserInterfaceInspectorBlockPage extends UserInterfaceInspector
|
|
|
3378
3512
|
manage?: UserInterfaceElement | boolean;
|
|
3379
3513
|
}
|
|
3380
3514
|
|
|
3515
|
+
/** @public */
|
|
3516
|
+
declare interface UserInterfaceInspectorBlockRectShape extends UserInterfaceInspectorBlock {
|
|
3517
|
+
filters?: UserInterfaceElement | boolean;
|
|
3518
|
+
adjustments?: UserInterfaceElement | boolean;
|
|
3519
|
+
effects?: UserInterfaceElement | boolean;
|
|
3520
|
+
blur?: UserInterfaceElement | boolean;
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3381
3523
|
/** @public */
|
|
3382
3524
|
declare interface UserInterfaceInspectorBlocks {
|
|
3383
3525
|
opacity?: UserInterfaceElement | boolean;
|
|
3384
3526
|
transform?: UserInterfaceElement | boolean;
|
|
3385
3527
|
trim?: UserInterfaceElement | boolean;
|
|
3386
3528
|
'//ly.img.ubq/image'?: UserInterfaceInspectorBlockImage;
|
|
3529
|
+
'//ly.img.ubq/fill/video': UserInterfaceInspectorBlockVideoFill;
|
|
3530
|
+
'//ly.img.ubq/shapes/rect': UserInterfaceInspectorBlockRectShape;
|
|
3387
3531
|
'//ly.img.ubq/text'?: UserInterfaceInspectorBlockText;
|
|
3388
3532
|
'//ly.img.ubq/page'?: UserInterfaceInspectorBlockPage;
|
|
3389
3533
|
}
|
|
@@ -3394,6 +3538,15 @@ declare interface UserInterfaceInspectorBlockText extends UserInterfaceInspector
|
|
|
3394
3538
|
color?: UserInterfaceElement | boolean;
|
|
3395
3539
|
}
|
|
3396
3540
|
|
|
3541
|
+
/** @public */
|
|
3542
|
+
declare interface UserInterfaceInspectorBlockVideoFill extends UserInterfaceInspectorBlock {
|
|
3543
|
+
crop?: UserInterfaceElement | boolean;
|
|
3544
|
+
filters?: UserInterfaceElement | boolean;
|
|
3545
|
+
adjustments?: UserInterfaceElement | boolean;
|
|
3546
|
+
effects?: UserInterfaceElement | boolean;
|
|
3547
|
+
blur?: UserInterfaceElement | boolean;
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3397
3550
|
/** @public */
|
|
3398
3551
|
declare interface UserInterfaceNavigation extends UserInterfaceElement {
|
|
3399
3552
|
position?: NavigationPosition;
|
|
@@ -3467,19 +3620,21 @@ declare interface Vec3 {
|
|
|
3467
3620
|
z: number;
|
|
3468
3621
|
}
|
|
3469
3622
|
|
|
3470
|
-
/** @public */
|
|
3471
|
-
declare interface VideoElement extends _AssetElement {
|
|
3472
|
-
duration: number;
|
|
3473
|
-
size: {
|
|
3474
|
-
width: number;
|
|
3475
|
-
height: number;
|
|
3476
|
-
};
|
|
3477
|
-
}
|
|
3478
|
-
|
|
3479
3623
|
/** @public */
|
|
3480
3624
|
declare enum ViewStyle {
|
|
3481
3625
|
Advanced = "advanced",
|
|
3482
3626
|
Default = "default"
|
|
3483
3627
|
}
|
|
3484
3628
|
|
|
3629
|
+
/**
|
|
3630
|
+
* Describes a rectangle on the screen
|
|
3631
|
+
* - `x` and `y` indicate the position
|
|
3632
|
+
* - `w` and `h` indicate the width and height
|
|
3633
|
+
* @public
|
|
3634
|
+
*/
|
|
3635
|
+
export declare type XYWH = [x: number, y: number, w: number, h: number];
|
|
3636
|
+
|
|
3637
|
+
/** @public */
|
|
3638
|
+
export declare type ZoomAutoFitAxis = 'Horizontal' | 'Vertical' | 'Both';
|
|
3639
|
+
|
|
3485
3640
|
export { }
|