@cesdk/cesdk-js 1.7.0-alpha.2 → 1.7.0-alpha.5
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.wasm +0 -0
- package/assets/i18n/de.json +2 -2
- package/assets/i18n/en.json +3 -3
- package/assets/ui/stylesheets/cesdk.css +17 -19
- package/cesdk-engine.umd.d.ts +222 -110
- package/cesdk-engine.umd.js +1 -1
- package/cesdk.umd.js +1 -1
- package/index.d.ts +542 -101
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -11,11 +11,118 @@ declare type A11y = {
|
|
|
11
11
|
|
|
12
12
|
/** @public */
|
|
13
13
|
export declare class API {
|
|
14
|
+
asset: AssetAPI;
|
|
14
15
|
block: BlockAPI;
|
|
15
|
-
|
|
16
|
+
editor: EditorAPI;
|
|
16
17
|
event: EventAPI;
|
|
18
|
+
scene: SceneAPI;
|
|
17
19
|
variable: VariableAPI;
|
|
18
|
-
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Generic asset information
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
declare interface Asset {
|
|
27
|
+
/**
|
|
28
|
+
* Is a combination of source id, extension pack id (optional), type and asset id
|
|
29
|
+
* e.g. "extension://ly.img.cesdk.images.samples/ly.img.image/sample.1"
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
/** E.g. `ly.img.image` */
|
|
33
|
+
/** Groups of the asset. */
|
|
34
|
+
groups?: Groups;
|
|
35
|
+
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
36
|
+
thumbUri: string;
|
|
37
|
+
|
|
38
|
+
/** Asset-specific and custom meta information */
|
|
39
|
+
meta?: {
|
|
40
|
+
uri?: string;
|
|
41
|
+
filename?: string;
|
|
42
|
+
vectorPath?: string;
|
|
43
|
+
} & Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare class AssetAPI {
|
|
50
|
+
#private;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Adds a custom asset source. Its ID has to be unique.
|
|
54
|
+
* @param source - The asset source.
|
|
55
|
+
*/
|
|
56
|
+
addSource(source: AssetSource_2): void;
|
|
57
|
+
/**
|
|
58
|
+
* Removes an asset source with the given ID.
|
|
59
|
+
* @param id - The ID to refer to the asset source.
|
|
60
|
+
*/
|
|
61
|
+
removeSource(id: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Finds all registered asset sources.
|
|
64
|
+
* @returns A list with the IDs of all registered asset sources.
|
|
65
|
+
*/
|
|
66
|
+
findAllSources(): string[];
|
|
67
|
+
/**
|
|
68
|
+
* Finds assets of a given type in a specific asset source.
|
|
69
|
+
* @param sourceId - The ID of the asset source.
|
|
70
|
+
* @param query - All the options to filter the search results by.
|
|
71
|
+
* @returns The search results.
|
|
72
|
+
*/
|
|
73
|
+
findAssets(sourceId: string, query: AssetQueryData): Promise<AssetsQueryResult_2>;
|
|
74
|
+
/**
|
|
75
|
+
* Queries the asset source's groups for a certain asset type.
|
|
76
|
+
* @param id - The ID of the asset source.
|
|
77
|
+
* @returns The asset groups.
|
|
78
|
+
*/
|
|
79
|
+
getGroups(id: string): Promise<string[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Queries the asset source's credits info.
|
|
82
|
+
* @param sourceId - The ID of the asset source.
|
|
83
|
+
* @returns The asset source's credits info consisting of a name and an optional URL.
|
|
84
|
+
*/
|
|
85
|
+
getCredits(sourceId: string): {
|
|
86
|
+
name: string;
|
|
87
|
+
url: string | undefined;
|
|
88
|
+
} | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Queries the asset source's license info.
|
|
91
|
+
* @param sourceId - The ID of the asset source.
|
|
92
|
+
* @returns The asset source's license info consisting of a name and an optional URL.
|
|
93
|
+
*/
|
|
94
|
+
getLicense(sourceId: string): {
|
|
95
|
+
name: string;
|
|
96
|
+
url: string | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
canManageAssets(sourceId: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Apply an asset result to the active scene.
|
|
101
|
+
* The default behavior will instantiate a block and configure it according to the asset's properties.
|
|
102
|
+
* Note that this can be overridden by providing an `applyAsset` function when adding the asset source.
|
|
103
|
+
* @param sourceId - The ID of the asset source.
|
|
104
|
+
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
105
|
+
*/
|
|
106
|
+
apply(sourceId: string, assetResult: AssetResult_2): Promise<void>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Definition of an assets used if an asset is added to an asset source.
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
declare interface AssetDefinition extends Asset {
|
|
114
|
+
/**
|
|
115
|
+
* Label used to display in aria-label and as a tooltip.
|
|
116
|
+
* Will be also searched in a query and should be localized
|
|
117
|
+
*/
|
|
118
|
+
label?: Record<Locale, string>;
|
|
119
|
+
/**
|
|
120
|
+
* Tags for this asset. Can be used for filtering, but is also useful for
|
|
121
|
+
* free-text search. Since the label is searched as well as used for tooltips
|
|
122
|
+
* you do not want to overdo it, but still add things which are searched.
|
|
123
|
+
* Thus, it should be localized similar to the `label`.
|
|
124
|
+
*/
|
|
125
|
+
tags?: Record<Locale, string[]>;
|
|
19
126
|
}
|
|
20
127
|
|
|
21
128
|
/** @public */
|
|
@@ -26,6 +133,94 @@ export declare interface _AssetElement {
|
|
|
26
133
|
thumbUri: string;
|
|
27
134
|
}
|
|
28
135
|
|
|
136
|
+
declare type AssetLibraryEntries = AssetLibraryEntry[] | ((currentAssetLibraryEntries: AssetLibraryEntry[]) => AssetLibraryEntry[]);
|
|
137
|
+
|
|
138
|
+
declare interface AssetLibraryEntry extends AssetLibraryEntryData, AssetLibraryEntryView {
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare interface AssetLibraryEntryData {
|
|
142
|
+
id: string;
|
|
143
|
+
sourceIds: string[];
|
|
144
|
+
excludeGroups?: string[];
|
|
145
|
+
includeGroups?: string[];
|
|
146
|
+
title?: (options?: {
|
|
147
|
+
group?: string;
|
|
148
|
+
}) => string;
|
|
149
|
+
managed?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare interface AssetLibraryEntryView {
|
|
153
|
+
showGroupOverview?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Determines how many asset results will be show in an overview or
|
|
156
|
+
* section overview.
|
|
157
|
+
*/
|
|
158
|
+
previewLength?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Determines if the thumbUri is set as a background that will be
|
|
161
|
+
* contained or covered by the card in an overview or section overview.
|
|
162
|
+
*/
|
|
163
|
+
previewBackgroundType?: 'cover' | 'contain';
|
|
164
|
+
/**
|
|
165
|
+
* Determines if the thumbUri is set as a background that will be
|
|
166
|
+
* contained or covered by the card in the grid view
|
|
167
|
+
*/
|
|
168
|
+
gridBackgroundType?: 'cover' | 'contain';
|
|
169
|
+
/**
|
|
170
|
+
* Number of columns in the grid view
|
|
171
|
+
*/
|
|
172
|
+
gridColumns?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Determines the height of an item in the grid view.
|
|
175
|
+
*
|
|
176
|
+
* - `auto` automatically determine height yielding a masonry-like grid view
|
|
177
|
+
* - `square` every card will have the same square size
|
|
178
|
+
*/
|
|
179
|
+
gridItemHeight?: 'auto' | 'square';
|
|
180
|
+
/**
|
|
181
|
+
* Overwrite the label of a card for a specific asset result
|
|
182
|
+
*/
|
|
183
|
+
cardLabel?: (assetResult: AssetResult_2) => string | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Add custom styles to a card for a specific asset result
|
|
186
|
+
*/
|
|
187
|
+
cardStyle?: (assetResult: AssetResult_2) => Record<string, string | undefined>;
|
|
188
|
+
/**
|
|
189
|
+
* Add custom styles to a label for a specific asset result
|
|
190
|
+
*/
|
|
191
|
+
cardLabelStyle?: (assetResult: AssetResult_2) => Record<string, string | undefined>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Defines a request for querying assets
|
|
196
|
+
* @public
|
|
197
|
+
*/
|
|
198
|
+
declare interface AssetQueryData {
|
|
199
|
+
/** A query string used for (fuzzy) searching of labels and tags */
|
|
200
|
+
query?: string;
|
|
201
|
+
/** The current page queried for paginated views. */
|
|
202
|
+
page: number;
|
|
203
|
+
/**
|
|
204
|
+
* Tags are searched with the query parameter, but this search is fuzzy.
|
|
205
|
+
* If one needs to get assets with exactly the tag (from a tag cloud or filter)
|
|
206
|
+
* this query parameter should be used.
|
|
207
|
+
*/
|
|
208
|
+
tags?: string | string[];
|
|
209
|
+
/** Query only these groups */
|
|
210
|
+
groups?: Groups;
|
|
211
|
+
/** Filter out assets with this groups */
|
|
212
|
+
excludeGroups?: Groups;
|
|
213
|
+
/** Choose the locale of the labels and tags for localized search and filtering */
|
|
214
|
+
locale?: Locale;
|
|
215
|
+
/**
|
|
216
|
+
* The number of results queried. How many assets shall be returned regardless
|
|
217
|
+
* of the total number of assets available.
|
|
218
|
+
*
|
|
219
|
+
* Together with `page` this can be used for pagination.
|
|
220
|
+
*/
|
|
221
|
+
perPage: number;
|
|
222
|
+
}
|
|
223
|
+
|
|
29
224
|
/**
|
|
30
225
|
* Single asset result of a query from the engine.
|
|
31
226
|
* @public
|
|
@@ -33,8 +228,6 @@ export declare interface _AssetElement {
|
|
|
33
228
|
declare interface AssetResult {
|
|
34
229
|
/** A unique id of this asset */
|
|
35
230
|
id: string;
|
|
36
|
-
/** E.g. `ly.img.image` */
|
|
37
|
-
type: string;
|
|
38
231
|
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
39
232
|
thumbUri: string;
|
|
40
233
|
/** Original size of the asset. */
|
|
@@ -68,36 +261,53 @@ declare interface AssetResult {
|
|
|
68
261
|
};
|
|
69
262
|
}
|
|
70
263
|
|
|
264
|
+
/**
|
|
265
|
+
* Single asset result of a query from the engine.
|
|
266
|
+
* @public
|
|
267
|
+
*/
|
|
268
|
+
declare interface AssetResult_2 extends Asset {
|
|
269
|
+
/** The locale of the label and tags */
|
|
270
|
+
locale?: Locale;
|
|
271
|
+
/** The label of the result. Used for description and tooltips. */
|
|
272
|
+
label?: string;
|
|
273
|
+
/** The tags of this asset. Used for filtering and free-text searching. */
|
|
274
|
+
tags?: string[];
|
|
275
|
+
|
|
276
|
+
/** Credits for the artist of the asset */
|
|
277
|
+
credits?: {
|
|
278
|
+
name: string;
|
|
279
|
+
url?: string;
|
|
280
|
+
};
|
|
281
|
+
/** License for this asset. Overwrites the source license if present */
|
|
282
|
+
license?: {
|
|
283
|
+
name: string;
|
|
284
|
+
url?: string;
|
|
285
|
+
};
|
|
286
|
+
/** UTM parameters for the links inside the credits */
|
|
287
|
+
utm?: {
|
|
288
|
+
source?: string;
|
|
289
|
+
medium?: string;
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
71
293
|
/** @public */
|
|
72
294
|
declare interface AssetResultContext {
|
|
73
295
|
sourceId: string;
|
|
74
296
|
createdByRole: string;
|
|
75
297
|
}
|
|
76
298
|
|
|
77
|
-
declare interface AssetResultCredits {
|
|
78
|
-
name: string;
|
|
79
|
-
url: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare interface AssetResultLicense {
|
|
83
|
-
name: string;
|
|
84
|
-
url: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
declare interface AssetResultUtm {
|
|
88
|
-
source: string;
|
|
89
|
-
medium: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
299
|
/**
|
|
93
300
|
* API to query for assets
|
|
94
301
|
* @public
|
|
95
302
|
*/
|
|
96
303
|
declare interface AssetSource {
|
|
97
|
-
/** The asset types returned by this source. Will default to ['ly.img.image']. */
|
|
98
|
-
types?: string[];
|
|
99
304
|
/** Find all asset for the given type and the provided query data. */
|
|
100
|
-
findAssets(
|
|
305
|
+
findAssets(queryData?: QueryData): Promise<AssetsQueryResult | undefined>;
|
|
306
|
+
/**
|
|
307
|
+
* Apply the given asset result to the active scene.
|
|
308
|
+
* You can override this with custom behavior.
|
|
309
|
+
*/
|
|
310
|
+
applyAsset?: (asset: AssetResult) => Promise<void>;
|
|
101
311
|
/**
|
|
102
312
|
* Indicates if the asset shall be downloaded to handle the raw data instead
|
|
103
313
|
* of an URL reference. Do this if you do not want to depend on
|
|
@@ -118,6 +328,72 @@ declare interface AssetSource {
|
|
|
118
328
|
};
|
|
119
329
|
}
|
|
120
330
|
|
|
331
|
+
/**
|
|
332
|
+
* A source of assets
|
|
333
|
+
* @public
|
|
334
|
+
*/
|
|
335
|
+
declare interface AssetSource_2 {
|
|
336
|
+
/** The unique id of the API */
|
|
337
|
+
id: string;
|
|
338
|
+
/** Find all asset for the given type and the provided query data. */
|
|
339
|
+
findAssets(queryData: AssetQueryData): Promise<AssetsQueryResult_2>;
|
|
340
|
+
/** Return every available group */
|
|
341
|
+
getGroups: () => Promise<string[]>;
|
|
342
|
+
/** Credits for the source/api */
|
|
343
|
+
credits?: {
|
|
344
|
+
name: string;
|
|
345
|
+
url?: string;
|
|
346
|
+
};
|
|
347
|
+
/** General license for all asset from this source */
|
|
348
|
+
license?: {
|
|
349
|
+
name: string;
|
|
350
|
+
url?: string;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Indicates if the asset shall be downloaded to handle the raw data instead
|
|
354
|
+
* of an URL reference. Do this if you do not want to depend on
|
|
355
|
+
* a service after adding the asset to the scene. If this is your own API
|
|
356
|
+
* with your own service, you do not need to set this and avoid downloading /
|
|
357
|
+
* re-uploading the assets.
|
|
358
|
+
*/
|
|
359
|
+
downloadAssets?: (asset: AssetResult_2) => Promise<Blob>;
|
|
360
|
+
/**
|
|
361
|
+
* @returns the asset or undefined if no asset with the given id could be found
|
|
362
|
+
*/
|
|
363
|
+
getAsset(id: string): Promise<AssetResult_2 | undefined>;
|
|
364
|
+
/**
|
|
365
|
+
* Can the source add, update and remove assets dynamically? If `false`
|
|
366
|
+
* methods like `addAsset` `updateAsset` and `removeAsset` will throw an
|
|
367
|
+
* error.
|
|
368
|
+
*/
|
|
369
|
+
canManageAssets?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Apply the given asset result to the active scene.
|
|
372
|
+
* You can override this with custom behavior.
|
|
373
|
+
*/
|
|
374
|
+
applyAsset?: (asset: AssetResult_2) => Promise<void>;
|
|
375
|
+
/**
|
|
376
|
+
* Adds the given asset to this source. Throws an error if `canManageAssets`
|
|
377
|
+
* is `false`.
|
|
378
|
+
*
|
|
379
|
+
* @returns the id of the added asset
|
|
380
|
+
*/
|
|
381
|
+
addAsset(asset: AssetDefinition): Promise<string>;
|
|
382
|
+
/**
|
|
383
|
+
* Updates the asset of this source. Throws an error if `canManageAssets`
|
|
384
|
+
* is `false` or no asset with the given id could not be found.
|
|
385
|
+
*
|
|
386
|
+
* @returns the id of the added asset
|
|
387
|
+
*/
|
|
388
|
+
updateAsset(assetId: string, asset: AssetDefinition): Promise<void>;
|
|
389
|
+
/**
|
|
390
|
+
* Removes the given asset from this source.
|
|
391
|
+
*
|
|
392
|
+
* @returns true if asset was found and removed, and false otherwise
|
|
393
|
+
*/
|
|
394
|
+
removeAsset(assetId: string): Promise<boolean>;
|
|
395
|
+
}
|
|
396
|
+
|
|
121
397
|
/** @public */
|
|
122
398
|
declare type AssetSources = {
|
|
123
399
|
[id: string]: AssetSource;
|
|
@@ -138,6 +414,21 @@ declare interface AssetsQueryResult {
|
|
|
138
414
|
total: number;
|
|
139
415
|
}
|
|
140
416
|
|
|
417
|
+
/**
|
|
418
|
+
* Return type of a `findAssets` query.
|
|
419
|
+
* @public
|
|
420
|
+
*/
|
|
421
|
+
declare interface AssetsQueryResult_2 {
|
|
422
|
+
/** The assets in the requested page */
|
|
423
|
+
assets: AssetResult_2[];
|
|
424
|
+
/** The current, requested page */
|
|
425
|
+
currentPage: number;
|
|
426
|
+
/** The next page to query if it exists */
|
|
427
|
+
nextPage?: number;
|
|
428
|
+
/** How many assets are there in total for the current query regardless of the page */
|
|
429
|
+
total: number;
|
|
430
|
+
}
|
|
431
|
+
|
|
141
432
|
/**
|
|
142
433
|
* Bleed margin configuration options for a single design unit type.
|
|
143
434
|
* @public
|
|
@@ -992,6 +1283,99 @@ export declare class BlockAPI {
|
|
|
992
1283
|
* @deprecated Use `getStrokeWidth`.
|
|
993
1284
|
*/
|
|
994
1285
|
getOutlineWidth(id: DesignBlockId): number;
|
|
1286
|
+
/**
|
|
1287
|
+
* Query if the given block has a drop shadow property.
|
|
1288
|
+
* @param id - The block to query.
|
|
1289
|
+
* @returns True if the block has a drop shadow property.
|
|
1290
|
+
*/
|
|
1291
|
+
hasDropShadow(id: DesignBlockId): boolean;
|
|
1292
|
+
/**
|
|
1293
|
+
* Enable or disable the drop shadow of the given design block.
|
|
1294
|
+
* @param id - The block whose drop shadow should be enabled or disabled.
|
|
1295
|
+
* @param enabled - If true, the drop shadow will be enabled.
|
|
1296
|
+
*/
|
|
1297
|
+
setDropShadowEnabled(id: DesignBlockId, enabled: boolean): void;
|
|
1298
|
+
/**
|
|
1299
|
+
* Query if the drop shadow of the given design block is enabled.
|
|
1300
|
+
* @param id - The block whose drop shadow state should be queried.
|
|
1301
|
+
* @returns True if the block's drop shadow is enabled.
|
|
1302
|
+
*/
|
|
1303
|
+
isDropShadowEnabled(id: DesignBlockId): boolean;
|
|
1304
|
+
/**
|
|
1305
|
+
* Set the drop shadow color of the given design block.
|
|
1306
|
+
* @param id - The block whose drop shadow color should be set.
|
|
1307
|
+
* @param r - The red color component in the range of 0 to 1.
|
|
1308
|
+
* @param g - The green color component in the range of 0 to 1.
|
|
1309
|
+
* @param b - The blue color component in the range of 0 to 1.
|
|
1310
|
+
* @param a - The alpha color component in the range of 0 to 1.
|
|
1311
|
+
*/
|
|
1312
|
+
setDropShadowColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
|
|
1313
|
+
/**
|
|
1314
|
+
* Get the drop shadow color of the given design block.
|
|
1315
|
+
* @param id - The block whose background color should be queried.
|
|
1316
|
+
* @returns The background color.
|
|
1317
|
+
*/
|
|
1318
|
+
getDropShadowColorRGBA(id: DesignBlockId): RGBA;
|
|
1319
|
+
/**
|
|
1320
|
+
* Set the drop shadow's X offset of the given design block.
|
|
1321
|
+
* @param id - The block whose drop shadow's X offset should be set.
|
|
1322
|
+
* @param xOffset - The X offset to be set.
|
|
1323
|
+
*/
|
|
1324
|
+
setDropShadowXOffset(id: DesignBlockId, xOffset: number): void;
|
|
1325
|
+
/**
|
|
1326
|
+
* Get the drop shadow's X offset of the given design block.
|
|
1327
|
+
* @param id - The block whose drop shadow's X offset should be queried.
|
|
1328
|
+
* @returns The offset.
|
|
1329
|
+
*/
|
|
1330
|
+
getDropShadowXOffset(id: DesignBlockId): number;
|
|
1331
|
+
/**
|
|
1332
|
+
* Set the drop shadow's Y offset of the given design block.
|
|
1333
|
+
* @param id - The block whose drop shadow's Y offset should be set.
|
|
1334
|
+
* @param yOffset - The X offset to be set.
|
|
1335
|
+
*/
|
|
1336
|
+
setDropShadowYOffset(id: DesignBlockId, yOffset: number): void;
|
|
1337
|
+
/**
|
|
1338
|
+
* Get the drop shadow's Y offset of the given design block.
|
|
1339
|
+
* @param id - The block whose drop shadow's Y offset should be queried.
|
|
1340
|
+
* @returns The offset.
|
|
1341
|
+
*/
|
|
1342
|
+
getDropShadowYOffset(id: DesignBlockId): number;
|
|
1343
|
+
/**
|
|
1344
|
+
* Set the drop shadow's blur radius on the X axis of the given design block.
|
|
1345
|
+
* @param id - The block whose drop shadow's blur radius should be set.
|
|
1346
|
+
* @param xBlurRadius - The blur radius to be set.
|
|
1347
|
+
*/
|
|
1348
|
+
setDropShadowXBlurRadius(id: DesignBlockId, xBlurRadius: number): void;
|
|
1349
|
+
/**
|
|
1350
|
+
* Get the drop shadow's blur radius on the X axis of the given design block.
|
|
1351
|
+
* @param id - The block whose drop shadow's blur radius should be queried.
|
|
1352
|
+
* @returns The blur radius.
|
|
1353
|
+
*/
|
|
1354
|
+
getDropShadowXBlurRadius(id: DesignBlockId): number;
|
|
1355
|
+
/**
|
|
1356
|
+
* Set the drop shadow's blur radius on the Y axis of the given design block.
|
|
1357
|
+
* @param id - The block whose drop shadow's blur radius should be set.
|
|
1358
|
+
* @param yBlurRadius - The blur radius to be set.
|
|
1359
|
+
*/
|
|
1360
|
+
setDropShadowYBlurRadius(id: DesignBlockId, yBlurRadius: number): void;
|
|
1361
|
+
/**
|
|
1362
|
+
* Get the drop shadow's blur radius on the Y axis of the given design block.
|
|
1363
|
+
* @param id - The block whose drop shadow's blur radius should be queried.
|
|
1364
|
+
* @returns The blur radius.
|
|
1365
|
+
*/
|
|
1366
|
+
getDropShadowYBlurRadius(id: DesignBlockId): number;
|
|
1367
|
+
/**
|
|
1368
|
+
* Set the drop shadow's clipping of the given design block. (Only applies to shapes.)
|
|
1369
|
+
* @param id - The block whose drop shadow's clip should be set.
|
|
1370
|
+
* @param clip - The drop shadow's clip to be set.
|
|
1371
|
+
*/
|
|
1372
|
+
setDropShadowClip(id: DesignBlockId, clip: boolean): void;
|
|
1373
|
+
/**
|
|
1374
|
+
* Get the drop shadow's clipping of the given design block.
|
|
1375
|
+
* @param id - The block whose drop shadow's clipping should be queried.
|
|
1376
|
+
* @returns The drop shadow's clipping.
|
|
1377
|
+
*/
|
|
1378
|
+
getDropShadowClip(id: DesignBlockId): boolean;
|
|
995
1379
|
/**
|
|
996
1380
|
* Query if the given block has fill color properties.
|
|
997
1381
|
* @param id - The block to query.
|
|
@@ -1011,6 +1395,12 @@ export declare class BlockAPI {
|
|
|
1011
1395
|
* @returns An empty result on success, an error otherwise.
|
|
1012
1396
|
*/
|
|
1013
1397
|
setFillEnabled(id: DesignBlockId, enabled: boolean): void;
|
|
1398
|
+
/**
|
|
1399
|
+
* Returns the block containing the fill properties of the given block.
|
|
1400
|
+
* @param id - The block whose fill block should be returned.
|
|
1401
|
+
* @returns The block that currently defines the given block's fill.
|
|
1402
|
+
*/
|
|
1403
|
+
getFill(id: DesignBlockId): DesignBlockId;
|
|
1014
1404
|
/**
|
|
1015
1405
|
* Set the fill type of the given design block.
|
|
1016
1406
|
* @param id - The block whose fill type should be set.
|
|
@@ -1123,6 +1513,36 @@ export declare class BlockAPI {
|
|
|
1123
1513
|
* @returns the gradient's radius, an error otherwise.
|
|
1124
1514
|
*/
|
|
1125
1515
|
getFillGradientRadius(id: DesignBlockId): number;
|
|
1516
|
+
/**
|
|
1517
|
+
* Set a metadata value of a block identified by a key.
|
|
1518
|
+
* If the key does not exist, yet, it will be added.
|
|
1519
|
+
* @param block - The block whose metadata will be accessed.
|
|
1520
|
+
* @param key - The key used to identify the desired piece of metadata.
|
|
1521
|
+
* @param value - The value to set.
|
|
1522
|
+
*/
|
|
1523
|
+
setMetadata(id: DesignBlockId, key: string, value: string): void;
|
|
1524
|
+
/**
|
|
1525
|
+
* Get a metadata value of a block identified by a key.
|
|
1526
|
+
* If the key does not exist, yet, this method will fail.
|
|
1527
|
+
* @param block - The block whose metadata will be accessed.
|
|
1528
|
+
* @param key - The key used to identify the desired piece of metadata.
|
|
1529
|
+
* @returns the value associated with the key.
|
|
1530
|
+
*/
|
|
1531
|
+
getMetadata(id: DesignBlockId, key: string): string;
|
|
1532
|
+
/**
|
|
1533
|
+
* Check if the block has metadata associated with the key.
|
|
1534
|
+
* @param block - The block whose metadata will be accessed.
|
|
1535
|
+
* @param key - The key used to identify the desired piece of metadata.
|
|
1536
|
+
* @returns whether the key exists.
|
|
1537
|
+
*/
|
|
1538
|
+
hasMetadata(id: DesignBlockId, key: string): boolean;
|
|
1539
|
+
/**
|
|
1540
|
+
* Remove metadata associated with the key from the given block.
|
|
1541
|
+
* If the key does not exist, this method will fail.
|
|
1542
|
+
* @param block - The block whose metadata will be accessed.
|
|
1543
|
+
* @param key - The key used to identify the desired piece of metadata.
|
|
1544
|
+
*/
|
|
1545
|
+
removeMetadata(id: DesignBlockId, key: string): void;
|
|
1126
1546
|
}
|
|
1127
1547
|
|
|
1128
1548
|
/**
|
|
@@ -1215,7 +1635,7 @@ export { ConfigTypes }
|
|
|
1215
1635
|
* optional and what mandatory. This is Configuration, but `ui` is recursively
|
|
1216
1636
|
* optional, and all other props are non-recursively optional
|
|
1217
1637
|
*/
|
|
1218
|
-
export declare type Configuration = Partial<
|
|
1638
|
+
export declare type Configuration = Partial<_RequiredConfiguration>;
|
|
1219
1639
|
|
|
1220
1640
|
/**
|
|
1221
1641
|
* - Crop: Manual crop.
|
|
@@ -1321,6 +1741,7 @@ declare class CreativeEditorSDK {
|
|
|
1321
1741
|
unstable_getPages(): Promise<number[]>;
|
|
1322
1742
|
unstable_getActivePage(): Promise<number>;
|
|
1323
1743
|
unstable_onActivePageChanged(callback: (id: number) => void): () => void;
|
|
1744
|
+
unstable_focusPage(pageId: number): Promise<void>;
|
|
1324
1745
|
/**
|
|
1325
1746
|
* Disposes the editor and engine if no longer needed.
|
|
1326
1747
|
*/
|
|
@@ -1378,6 +1799,12 @@ export declare enum DesignBlockType {
|
|
|
1378
1799
|
/** @public */
|
|
1379
1800
|
export declare type DesignUnit = 'mm' | 'px' | 'in';
|
|
1380
1801
|
|
|
1802
|
+
declare interface DockGroup {
|
|
1803
|
+
id: string;
|
|
1804
|
+
showOverview?: boolean;
|
|
1805
|
+
entryIds?: string[];
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1381
1808
|
/**
|
|
1382
1809
|
* @public
|
|
1383
1810
|
*/
|
|
@@ -1423,16 +1850,6 @@ export declare class EditorAPI {
|
|
|
1423
1850
|
* @returns The text cursor's y position in screen space.
|
|
1424
1851
|
*/
|
|
1425
1852
|
getTextCursorPositionInScreenSpaceY(): number;
|
|
1426
|
-
/**
|
|
1427
|
-
* Sets the zoom level of the scene.
|
|
1428
|
-
* @param zoomLevel - The new zoom level.
|
|
1429
|
-
*/
|
|
1430
|
-
setZoomLevel(zoomLevel?: number): void;
|
|
1431
|
-
/**
|
|
1432
|
-
* Query a camera zoom level.
|
|
1433
|
-
* @returns The zoom level of the block's (main) camera.
|
|
1434
|
-
*/
|
|
1435
|
-
getZoomLevel(): number;
|
|
1436
1853
|
/**
|
|
1437
1854
|
* Adds a new history state to the stack, if undoable changes were made.
|
|
1438
1855
|
*/
|
|
@@ -1457,6 +1874,12 @@ export declare class EditorAPI {
|
|
|
1457
1874
|
* @returns True if a redo step is available.
|
|
1458
1875
|
*/
|
|
1459
1876
|
canRedo(): boolean;
|
|
1877
|
+
/**
|
|
1878
|
+
* Subscribe to changes to the editor settings.
|
|
1879
|
+
* @param callback - This function is called at the end of the engine update, if the editor settings have changed.
|
|
1880
|
+
* @returns A method to unsubscribe.
|
|
1881
|
+
*/
|
|
1882
|
+
onSettingsChanged(callback: () => void): () => void;
|
|
1460
1883
|
/**
|
|
1461
1884
|
* Set a boolean setting.
|
|
1462
1885
|
* @param keypath - The settings keypath, e.g. `ubq://doubleClickToCropEnabled`
|
|
@@ -1700,23 +2123,7 @@ declare type Extensions = {
|
|
|
1700
2123
|
*/
|
|
1701
2124
|
export declare type FillType = 'Solid' | 'Gradient';
|
|
1702
2125
|
|
|
1703
|
-
|
|
1704
|
-
id: string;
|
|
1705
|
-
type: string;
|
|
1706
|
-
groups: Vector<string>;
|
|
1707
|
-
thumbUri: string;
|
|
1708
|
-
width: number;
|
|
1709
|
-
height: number;
|
|
1710
|
-
meta: UnorderedMap<string, string>;
|
|
1711
|
-
locale: string;
|
|
1712
|
-
label: string;
|
|
1713
|
-
tags: Vector<string>;
|
|
1714
|
-
context: AssetResultContext;
|
|
1715
|
-
credits: AssetResultCredits;
|
|
1716
|
-
license: AssetResultLicense;
|
|
1717
|
-
utm: AssetResultUtm;
|
|
1718
|
-
}
|
|
1719
|
-
|
|
2126
|
+
/** @public */
|
|
1720
2127
|
declare interface FindAssetsQuery {
|
|
1721
2128
|
perPage: number;
|
|
1722
2129
|
page: number;
|
|
@@ -1727,23 +2134,6 @@ declare interface FindAssetsQuery {
|
|
|
1727
2134
|
locale: string;
|
|
1728
2135
|
}
|
|
1729
2136
|
|
|
1730
|
-
declare interface FindAssetsQueryCpp {
|
|
1731
|
-
perPage: number;
|
|
1732
|
-
page: number;
|
|
1733
|
-
query: string;
|
|
1734
|
-
tags: Vector<string>;
|
|
1735
|
-
groups: Vector<string>;
|
|
1736
|
-
excludeGroups: Vector<string>;
|
|
1737
|
-
locale: string;
|
|
1738
|
-
}
|
|
1739
|
-
|
|
1740
|
-
declare interface FindAssetsResult {
|
|
1741
|
-
assets: Vector<FindAssetResult>;
|
|
1742
|
-
currentPage: number;
|
|
1743
|
-
nextPage: number;
|
|
1744
|
-
total: number;
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
2137
|
/** @public */
|
|
1748
2138
|
declare interface Flip {
|
|
1749
2139
|
horizontal: boolean;
|
|
@@ -1786,6 +2176,17 @@ a: number
|
|
|
1786
2176
|
*/
|
|
1787
2177
|
export declare type GradientType = 'Linear' | 'Radial' | 'Conical';
|
|
1788
2178
|
|
|
2179
|
+
/**
|
|
2180
|
+
* An asset can be member of multiple groups. Groups have a semantic meaning
|
|
2181
|
+
* used to build and group UIs exploring the assets, e.g.sections in the
|
|
2182
|
+
* content library, or for things like topics in Unsplash for instance.
|
|
2183
|
+
*
|
|
2184
|
+
* Tags in comparison have are more loosely hold meaning used for extended
|
|
2185
|
+
* searching/filtering.
|
|
2186
|
+
* @public
|
|
2187
|
+
*/
|
|
2188
|
+
declare type Groups = string[];
|
|
2189
|
+
|
|
1789
2190
|
/**
|
|
1790
2191
|
* A hexadecimal color value (RGB or RGBA) that starts with a '#'
|
|
1791
2192
|
* @example #6686FF or #6686FFFF
|
|
@@ -1820,6 +2221,12 @@ export declare interface _ImageElement extends _AssetElement {
|
|
|
1820
2221
|
};
|
|
1821
2222
|
}
|
|
1822
2223
|
|
|
2224
|
+
/**
|
|
2225
|
+
* e.g. `en`, `de`, etc.
|
|
2226
|
+
* @public
|
|
2227
|
+
*/
|
|
2228
|
+
declare type Locale = string;
|
|
2229
|
+
|
|
1823
2230
|
/** @public */
|
|
1824
2231
|
export declare type Logger = (message: string, level: LogLevel) => void;
|
|
1825
2232
|
|
|
@@ -2098,6 +2505,31 @@ export declare class SceneAPI {
|
|
|
2098
2505
|
* @returns A Promise that resolves once the template was applied or rejects if there was an error.
|
|
2099
2506
|
*/
|
|
2100
2507
|
applyTemplateFromURL(url: string): Promise<void>;
|
|
2508
|
+
/**
|
|
2509
|
+
* Sets the zoom level of the active scene.
|
|
2510
|
+
* Only has an effect if the zoom level is not handled by the UI.
|
|
2511
|
+
*
|
|
2512
|
+
* @param zoomLevel - The new zoom level.
|
|
2513
|
+
*/
|
|
2514
|
+
setZoomLevel(zoomLevel?: number): void;
|
|
2515
|
+
/**
|
|
2516
|
+
* Query a camera zoom level of the active scene.
|
|
2517
|
+
* @returns The zoom level of the block's camera.
|
|
2518
|
+
*/
|
|
2519
|
+
getZoomLevel(): number;
|
|
2520
|
+
/**
|
|
2521
|
+
* Sets the zoom and focus to show a block.
|
|
2522
|
+
* Only has an effect if the zoom level is not handled by the UI.
|
|
2523
|
+
* Without padding, this results in a tight view on the block.
|
|
2524
|
+
*
|
|
2525
|
+
* @param id - The block that should be focused on.
|
|
2526
|
+
* @param paddingLeft - Optional padding in screen pixels to the left of the block.
|
|
2527
|
+
* @param paddingTop - Optional padding in screen pixels to the top of the block.
|
|
2528
|
+
* @param paddingRight - Optional padding in screen pixels to the right of the block.
|
|
2529
|
+
* @param paddingBottom - Optional padding in screen pixels to the bottom of the block.
|
|
2530
|
+
* @returns A promise that resolves once the zoom was set or rejects with an error otherwise.
|
|
2531
|
+
*/
|
|
2532
|
+
zoomToBlock(id: DesignBlockId, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): Promise<void>;
|
|
2101
2533
|
/**
|
|
2102
2534
|
* Converts all values of the current scene into the given design unit.
|
|
2103
2535
|
* @param designUnit - The new design unit of the scene
|
|
@@ -2175,18 +2607,11 @@ declare interface UIOptionsPerDesignUnit {
|
|
|
2175
2607
|
in: UIOptionsForSingleDesignUnit;
|
|
2176
2608
|
}
|
|
2177
2609
|
|
|
2178
|
-
declare interface UnorderedMap<K, V> {
|
|
2179
|
-
size: () => number;
|
|
2180
|
-
get: (key: K) => V;
|
|
2181
|
-
set: (key: K, value: V) => void;
|
|
2182
|
-
keys: () => Vector<K>;
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
2610
|
/** @public */
|
|
2186
2611
|
export declare interface UserInterface {
|
|
2187
|
-
baseURL
|
|
2612
|
+
baseURL?: string;
|
|
2188
2613
|
scale?: Scale;
|
|
2189
|
-
elements
|
|
2614
|
+
elements?: UserInterfaceElements_2;
|
|
2190
2615
|
stylesheets?: {
|
|
2191
2616
|
disableShadowDOM?: boolean;
|
|
2192
2617
|
disableTagInsertion?: boolean;
|
|
@@ -2231,6 +2656,11 @@ declare namespace UserInterfaceElements {
|
|
|
2231
2656
|
UserInterfaceCustomActionIconName,
|
|
2232
2657
|
UserInterfaceCustomAction,
|
|
2233
2658
|
UserInterfaceNavigation,
|
|
2659
|
+
DockGroup,
|
|
2660
|
+
AssetLibraryEntryView,
|
|
2661
|
+
AssetLibraryEntryData,
|
|
2662
|
+
AssetLibraryEntry,
|
|
2663
|
+
AssetLibraryEntries,
|
|
2234
2664
|
UserInterfaceElements_2 as UserInterfaceElements
|
|
2235
2665
|
}
|
|
2236
2666
|
}
|
|
@@ -2238,11 +2668,7 @@ export { UserInterfaceElements }
|
|
|
2238
2668
|
|
|
2239
2669
|
/** @public */
|
|
2240
2670
|
declare interface UserInterfaceElements_2 {
|
|
2241
|
-
view?:
|
|
2242
|
-
adopter?: {
|
|
2243
|
-
style?: 'default' | 'advanced';
|
|
2244
|
-
};
|
|
2245
|
-
};
|
|
2671
|
+
view?: 'default' | 'advanced';
|
|
2246
2672
|
panels?: {
|
|
2247
2673
|
inspector?: UserInterfaceInspector | boolean;
|
|
2248
2674
|
settings?: UserInterfaceSettings | boolean;
|
|
@@ -2252,26 +2678,41 @@ declare interface UserInterfaceElements_2 {
|
|
|
2252
2678
|
dock?: {
|
|
2253
2679
|
iconSize?: Scale;
|
|
2254
2680
|
hideLabels?: boolean;
|
|
2681
|
+
/**
|
|
2682
|
+
* If groups are used this group will contain all entries that are
|
|
2683
|
+
* not included in other groups.
|
|
2684
|
+
*/
|
|
2685
|
+
defaultGroupId?: string;
|
|
2686
|
+
/**
|
|
2687
|
+
* If set the entries will be grouped by these dock groups
|
|
2688
|
+
*/
|
|
2689
|
+
groups?: DockGroup[];
|
|
2255
2690
|
};
|
|
2256
2691
|
libraries?: {
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2692
|
+
insert?: {
|
|
2693
|
+
entries: AssetLibraryEntries;
|
|
2694
|
+
};
|
|
2695
|
+
replace?: {
|
|
2696
|
+
entries: AssetLibraryEntries;
|
|
2697
|
+
};
|
|
2698
|
+
/**
|
|
2699
|
+
* TODO Group this under `insert` and `replace`
|
|
2700
|
+
* We should probably group these together with the insert/replace key
|
|
2701
|
+
* together with the entries, e.g. `libraries.insert.panel.autoClose` etc
|
|
2702
|
+
*/
|
|
2703
|
+
panel?: {
|
|
2704
|
+
insert?: {
|
|
2264
2705
|
autoClose?: boolean | (() => boolean);
|
|
2265
2706
|
floating?: boolean;
|
|
2266
2707
|
};
|
|
2267
|
-
replace
|
|
2708
|
+
replace?: {
|
|
2268
2709
|
autoClose?: boolean | (() => boolean);
|
|
2269
2710
|
floating?: boolean;
|
|
2270
2711
|
};
|
|
2271
2712
|
};
|
|
2272
2713
|
};
|
|
2273
2714
|
blocks?: UserInterfaceInspectorBlocks;
|
|
2274
|
-
navigation
|
|
2715
|
+
navigation?: UserInterfaceNavigation;
|
|
2275
2716
|
}
|
|
2276
2717
|
|
|
2277
2718
|
/** @public */
|
|
@@ -2301,8 +2742,8 @@ declare interface UserInterfaceInspectorBlockImage extends UserInterfaceInspecto
|
|
|
2301
2742
|
declare interface UserInterfaceInspectorBlocks {
|
|
2302
2743
|
opacity?: UserInterfaceElement | boolean;
|
|
2303
2744
|
transform?: UserInterfaceElement | boolean;
|
|
2304
|
-
'//ly.img.ubq/image'
|
|
2305
|
-
'//ly.img.ubq/text'
|
|
2745
|
+
'//ly.img.ubq/image'?: UserInterfaceInspectorBlockImage;
|
|
2746
|
+
'//ly.img.ubq/text'?: UserInterfaceInspectorBlockText;
|
|
2306
2747
|
}
|
|
2307
2748
|
|
|
2308
2749
|
/** @public */
|
|
@@ -2314,17 +2755,17 @@ declare interface UserInterfaceInspectorBlockText extends UserInterfaceInspector
|
|
|
2314
2755
|
|
|
2315
2756
|
/** @public */
|
|
2316
2757
|
declare interface UserInterfaceNavigation extends UserInterfaceElement {
|
|
2317
|
-
position
|
|
2758
|
+
position?: NavigationPosition;
|
|
2318
2759
|
title?: string | null;
|
|
2319
2760
|
action?: {
|
|
2320
|
-
close
|
|
2321
|
-
back
|
|
2322
|
-
save
|
|
2323
|
-
export
|
|
2324
|
-
share
|
|
2325
|
-
load
|
|
2326
|
-
download
|
|
2327
|
-
custom
|
|
2761
|
+
close?: UserInterfaceElement | boolean;
|
|
2762
|
+
back?: UserInterfaceElement | boolean;
|
|
2763
|
+
save?: UserInterfaceElement | boolean;
|
|
2764
|
+
export?: UserInterfaceExportAction | boolean;
|
|
2765
|
+
share?: UserInterfaceElement | boolean;
|
|
2766
|
+
load?: UserInterfaceElement | boolean;
|
|
2767
|
+
download?: UserInterfaceElement | boolean;
|
|
2768
|
+
custom?: UserInterfaceCustomAction[];
|
|
2328
2769
|
};
|
|
2329
2770
|
}
|
|
2330
2771
|
|