@cesdk/cesdk-js 1.7.0-alpha.3 → 1.7.0-alpha.4
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/assets/core/cesdk.data +0 -0
- package/assets/core/cesdk.wasm +0 -0
- package/assets/i18n/de.json +22 -27
- package/assets/i18n/en.json +23 -28
- package/assets/ui/stylesheets/cesdk-themes.css +1 -1
- package/assets/ui/stylesheets/cesdk.css +14 -15
- package/cesdk-engine.umd.d.ts +69 -101
- package/cesdk-engine.umd.js +1 -1
- package/cesdk.umd.js +1 -1
- package/index.d.ts +389 -92
- package/package.json +1 -1
package/cesdk-engine.umd.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare interface Asset {
|
|
|
11
11
|
*/
|
|
12
12
|
id: string;
|
|
13
13
|
/** E.g. `ly.img.image` */
|
|
14
|
-
type: string;
|
|
15
14
|
/** Groups of the asset. */
|
|
16
15
|
groups?: Groups;
|
|
17
16
|
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
@@ -21,6 +20,7 @@ export declare interface Asset {
|
|
|
21
20
|
meta?: {
|
|
22
21
|
uri?: string;
|
|
23
22
|
filename?: string;
|
|
23
|
+
vectorPath?: string;
|
|
24
24
|
} & Record<string, unknown>;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -45,57 +45,46 @@ export declare class AssetAPI {
|
|
|
45
45
|
* @returns A list with the IDs of all registered asset sources.
|
|
46
46
|
*/
|
|
47
47
|
findAllSources(): string[];
|
|
48
|
-
/**
|
|
49
|
-
* Finds all asset sources which support the given asset type.
|
|
50
|
-
* @returns A list of the IDs of the supported asset sources.
|
|
51
|
-
*/
|
|
52
|
-
findSourcesByType(type: string): string[];
|
|
53
48
|
/**
|
|
54
49
|
* Finds assets of a given type in a specific asset source.
|
|
55
|
-
* @param
|
|
56
|
-
* @param type - The asset type to look for.
|
|
50
|
+
* @param sourceId - The ID of the asset source.
|
|
57
51
|
* @param query - All the options to filter the search results by.
|
|
58
52
|
* @returns The search results.
|
|
59
53
|
*/
|
|
60
|
-
|
|
54
|
+
findAssets(sourceId: string, query: AssetQueryData): Promise<AssetsQueryResult>;
|
|
61
55
|
/**
|
|
62
56
|
* Queries the asset source's groups for a certain asset type.
|
|
63
57
|
* @param id - The ID of the asset source.
|
|
64
|
-
* @param type - The asset type to filter by.
|
|
65
58
|
* @returns The asset groups.
|
|
66
59
|
*/
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Queries the asset source's supported asset types.
|
|
70
|
-
* @param id - The ID of the asset source.
|
|
71
|
-
* @returns A list of the asset source's supported types.
|
|
72
|
-
*/
|
|
73
|
-
getTypesInSource(id: string): string[];
|
|
74
|
-
/**
|
|
75
|
-
* Checks whether the asset source supports the given asset type.
|
|
76
|
-
* @param id - The ID of the asset source.
|
|
77
|
-
* @param type - The asset type to check.
|
|
78
|
-
* @returns A boolean indicating whether the type is supported.
|
|
79
|
-
*/
|
|
80
|
-
hasTypeInSource(id: string, type: string): boolean;
|
|
60
|
+
getGroups(id: string): Promise<string[]>;
|
|
81
61
|
/**
|
|
82
62
|
* Queries the asset source's credits info.
|
|
83
|
-
* @param
|
|
63
|
+
* @param sourceId - The ID of the asset source.
|
|
84
64
|
* @returns The asset source's credits info consisting of a name and an optional URL.
|
|
85
65
|
*/
|
|
86
|
-
|
|
66
|
+
getCredits(sourceId: string): {
|
|
87
67
|
name: string;
|
|
88
68
|
url: string | undefined;
|
|
89
69
|
} | undefined;
|
|
90
70
|
/**
|
|
91
71
|
* Queries the asset source's license info.
|
|
92
|
-
* @param
|
|
72
|
+
* @param sourceId - The ID of the asset source.
|
|
93
73
|
* @returns The asset source's license info consisting of a name and an optional URL.
|
|
94
74
|
*/
|
|
95
|
-
|
|
75
|
+
getLicense(sourceId: string): {
|
|
96
76
|
name: string;
|
|
97
77
|
url: string | undefined;
|
|
98
78
|
} | undefined;
|
|
79
|
+
canManageAssets(sourceId: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Apply an asset result to the active scene.
|
|
82
|
+
* The default behavior will instantiate a block and configure it according to the asset's properties.
|
|
83
|
+
* Note that this can be overridden by providing an `applyAsset` function when adding the asset source.
|
|
84
|
+
* @param sourceId - The ID of the asset source.
|
|
85
|
+
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
86
|
+
*/
|
|
87
|
+
apply(sourceId: string, assetResult: AssetResult): Promise<void>;
|
|
99
88
|
}
|
|
100
89
|
|
|
101
90
|
/**
|
|
@@ -183,8 +172,6 @@ export declare interface AssetResult extends Asset {
|
|
|
183
172
|
declare interface AssetResult_2 {
|
|
184
173
|
/** A unique id of this asset */
|
|
185
174
|
id: string;
|
|
186
|
-
/** E.g. `ly.img.image` */
|
|
187
|
-
type: string;
|
|
188
175
|
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
189
176
|
thumbUri: string;
|
|
190
177
|
/** Original size of the asset. */
|
|
@@ -224,21 +211,6 @@ declare interface AssetResultContext {
|
|
|
224
211
|
createdByRole: string;
|
|
225
212
|
}
|
|
226
213
|
|
|
227
|
-
declare interface AssetResultCredits {
|
|
228
|
-
name: string;
|
|
229
|
-
url: string;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
declare interface AssetResultLicense {
|
|
233
|
-
name: string;
|
|
234
|
-
url: string;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
declare interface AssetResultUtm {
|
|
238
|
-
source: string;
|
|
239
|
-
medium: string;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
214
|
/**
|
|
243
215
|
* A source of assets
|
|
244
216
|
* @public
|
|
@@ -247,13 +219,9 @@ export declare interface AssetSource {
|
|
|
247
219
|
/** The unique id of the API */
|
|
248
220
|
id: string;
|
|
249
221
|
/** Find all asset for the given type and the provided query data. */
|
|
250
|
-
findAssets(
|
|
251
|
-
/**
|
|
252
|
-
getGroups: (
|
|
253
|
-
/** Return all registered/available types */
|
|
254
|
-
getTypes: () => string[];
|
|
255
|
-
/** The given type is registered. */
|
|
256
|
-
hasType: (type: string) => boolean;
|
|
222
|
+
findAssets(queryData: AssetQueryData): Promise<AssetsQueryResult>;
|
|
223
|
+
/** Return every available group */
|
|
224
|
+
getGroups: () => Promise<string[]>;
|
|
257
225
|
/** Credits for the source/api */
|
|
258
226
|
credits?: {
|
|
259
227
|
name: string;
|
|
@@ -282,13 +250,18 @@ export declare interface AssetSource {
|
|
|
282
250
|
* error.
|
|
283
251
|
*/
|
|
284
252
|
canManageAssets?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Apply the given asset result to the active scene.
|
|
255
|
+
* You can override this with custom behavior.
|
|
256
|
+
*/
|
|
257
|
+
applyAsset?: (asset: AssetResult) => Promise<void>;
|
|
285
258
|
/**
|
|
286
259
|
* Adds the given asset to this source. Throws an error if `canManageAssets`
|
|
287
260
|
* is `false`.
|
|
288
261
|
*
|
|
289
262
|
* @returns the id of the added asset
|
|
290
263
|
*/
|
|
291
|
-
addAsset(
|
|
264
|
+
addAsset(asset: AssetDefinition): Promise<string>;
|
|
292
265
|
/**
|
|
293
266
|
* Updates the asset of this source. Throws an error if `canManageAssets`
|
|
294
267
|
* is `false` or no asset with the given id could not be found.
|
|
@@ -309,10 +282,13 @@ export declare interface AssetSource {
|
|
|
309
282
|
* @public
|
|
310
283
|
*/
|
|
311
284
|
declare interface AssetSource_2 {
|
|
312
|
-
/** The asset types returned by this source. Will default to ['ly.img.image']. */
|
|
313
|
-
types?: string[];
|
|
314
285
|
/** Find all asset for the given type and the provided query data. */
|
|
315
|
-
findAssets(
|
|
286
|
+
findAssets(queryData?: QueryData): Promise<AssetsQueryResult_2 | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* Apply the given asset result to the active scene.
|
|
289
|
+
* You can override this with custom behavior.
|
|
290
|
+
*/
|
|
291
|
+
applyAsset?: (asset: AssetResult_2) => Promise<void>;
|
|
316
292
|
/**
|
|
317
293
|
* Indicates if the asset shall be downloaded to handle the raw data instead
|
|
318
294
|
* of an URL reference. Do this if you do not want to depend on
|
|
@@ -1482,6 +1458,19 @@ declare interface BlockEvent_2 {
|
|
|
1482
1458
|
type: 'Created' | 'Updated' | 'Destroyed';
|
|
1483
1459
|
}
|
|
1484
1460
|
|
|
1461
|
+
/**
|
|
1462
|
+
* Dispatched on the engine canvas when the text input has been blurred.
|
|
1463
|
+
* Call `preventDefault()` to disallow this and refocus the engine text input.
|
|
1464
|
+
* @public
|
|
1465
|
+
*/
|
|
1466
|
+
export declare interface BlurEvent extends CustomEvent<EventTarget | null> {
|
|
1467
|
+
readonly type: 'cesdk-blur';
|
|
1468
|
+
/** Contains the element that has received focus during the blur, or null */
|
|
1469
|
+
readonly detail: EventTarget | null;
|
|
1470
|
+
/** Force focus back to the engine input */
|
|
1471
|
+
preventDefault(): void;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1485
1474
|
/** @public */
|
|
1486
1475
|
declare type Callbacks = {
|
|
1487
1476
|
log?: Logger;
|
|
@@ -1589,12 +1578,12 @@ declare type Core = {
|
|
|
1589
1578
|
*/
|
|
1590
1579
|
declare class CreativeEngine {
|
|
1591
1580
|
#private;
|
|
1581
|
+
asset: AssetAPI;
|
|
1592
1582
|
block: BlockAPI;
|
|
1593
|
-
scene: SceneAPI;
|
|
1594
|
-
variable: VariableAPI;
|
|
1595
1583
|
editor: EditorAPI;
|
|
1596
|
-
asset: AssetAPI;
|
|
1597
1584
|
event: EventAPI;
|
|
1585
|
+
scene: SceneAPI;
|
|
1586
|
+
variable: VariableAPI;
|
|
1598
1587
|
|
|
1599
1588
|
/**
|
|
1600
1589
|
* Dispose the engine.
|
|
@@ -1710,6 +1699,12 @@ export declare class EditorAPI {
|
|
|
1710
1699
|
* @returns True if a redo step is available.
|
|
1711
1700
|
*/
|
|
1712
1701
|
canRedo(): boolean;
|
|
1702
|
+
/**
|
|
1703
|
+
* Subscribe to changes to the editor settings.
|
|
1704
|
+
* @param callback - This function is called at the end of the engine update, if the editor settings have changed.
|
|
1705
|
+
* @returns A method to unsubscribe.
|
|
1706
|
+
*/
|
|
1707
|
+
onSettingsChanged(callback: () => void): () => void;
|
|
1713
1708
|
/**
|
|
1714
1709
|
* Set a boolean setting.
|
|
1715
1710
|
* @param keypath - The settings keypath, e.g. `ubq://doubleClickToCropEnabled`
|
|
@@ -1889,23 +1884,7 @@ declare type Extensions = {
|
|
|
1889
1884
|
*/
|
|
1890
1885
|
export declare type FillType = 'Solid' | 'Gradient';
|
|
1891
1886
|
|
|
1892
|
-
|
|
1893
|
-
id: string;
|
|
1894
|
-
type: string;
|
|
1895
|
-
groups: Vector<string>;
|
|
1896
|
-
thumbUri: string;
|
|
1897
|
-
width: number;
|
|
1898
|
-
height: number;
|
|
1899
|
-
meta: UnorderedMap<string, string>;
|
|
1900
|
-
locale: string;
|
|
1901
|
-
label: string;
|
|
1902
|
-
tags: Vector<string>;
|
|
1903
|
-
context: AssetResultContext;
|
|
1904
|
-
credits: AssetResultCredits;
|
|
1905
|
-
license: AssetResultLicense;
|
|
1906
|
-
utm: AssetResultUtm;
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1887
|
+
/** @public */
|
|
1909
1888
|
declare interface FindAssetsQuery {
|
|
1910
1889
|
perPage: number;
|
|
1911
1890
|
page: number;
|
|
@@ -1916,23 +1895,6 @@ declare interface FindAssetsQuery {
|
|
|
1916
1895
|
locale: string;
|
|
1917
1896
|
}
|
|
1918
1897
|
|
|
1919
|
-
declare interface FindAssetsQueryCpp {
|
|
1920
|
-
perPage: number;
|
|
1921
|
-
page: number;
|
|
1922
|
-
query: string;
|
|
1923
|
-
tags: Vector<string>;
|
|
1924
|
-
groups: Vector<string>;
|
|
1925
|
-
excludeGroups: Vector<string>;
|
|
1926
|
-
locale: string;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
declare interface FindAssetsResult {
|
|
1930
|
-
assets: Vector<FindAssetResult>;
|
|
1931
|
-
currentPage: number;
|
|
1932
|
-
nextPage: number;
|
|
1933
|
-
total: number;
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
1898
|
/** @public */
|
|
1937
1899
|
declare interface Flip {
|
|
1938
1900
|
horizontal: boolean;
|
|
@@ -2109,6 +2071,19 @@ declare interface QueryData {
|
|
|
2109
2071
|
page: number;
|
|
2110
2072
|
}
|
|
2111
2073
|
|
|
2074
|
+
/**
|
|
2075
|
+
* Dispatched on the engine canvas right before the engine will refocus its text
|
|
2076
|
+
* input after a blur. Call `preventDefault()` to prevent the refocusing.
|
|
2077
|
+
* @public
|
|
2078
|
+
*/
|
|
2079
|
+
export declare interface RefocusEvent extends CustomEvent<EventTarget | null> {
|
|
2080
|
+
readonly type: 'cesdk-refocus';
|
|
2081
|
+
/** Contains the element that has received focus during the blur, or null */
|
|
2082
|
+
readonly detail: EventTarget | null;
|
|
2083
|
+
/** Prevent refocusing the engine input */
|
|
2084
|
+
preventDefault(): void;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2112
2087
|
/**
|
|
2113
2088
|
* @public
|
|
2114
2089
|
*/
|
|
@@ -2250,7 +2225,7 @@ export declare class SceneAPI {
|
|
|
2250
2225
|
* Only has an effect if the zoom level is not handled by the UI.
|
|
2251
2226
|
* Without padding, this results in a tight view on the block.
|
|
2252
2227
|
*
|
|
2253
|
-
* @param id - The block that should be
|
|
2228
|
+
* @param id - The block that should be focused on.
|
|
2254
2229
|
* @param paddingLeft - Optional padding in screen pixels to the left of the block.
|
|
2255
2230
|
* @param paddingTop - Optional padding in screen pixels to the top of the block.
|
|
2256
2231
|
* @param paddingRight - Optional padding in screen pixels to the right of the block.
|
|
@@ -2321,13 +2296,6 @@ declare type TypefaceDefinition = Preset & {
|
|
|
2321
2296
|
}[];
|
|
2322
2297
|
};
|
|
2323
2298
|
|
|
2324
|
-
declare interface UnorderedMap<K, V> {
|
|
2325
|
-
size: () => number;
|
|
2326
|
-
get: (key: K) => V;
|
|
2327
|
-
set: (key: K, value: V) => void;
|
|
2328
|
-
keys: () => Vector<K>;
|
|
2329
|
-
}
|
|
2330
|
-
|
|
2331
2299
|
/**
|
|
2332
2300
|
* @public
|
|
2333
2301
|
*/
|