@cesdk/cesdk-js 1.24.0 → 1.25.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
@@ -2551,12 +2551,14 @@ export declare type BooleanOperation = 'Difference' | 'Intersection' | 'Union' |
2551
2551
  */
2552
2552
  declare interface Builder {
2553
2553
  Button: (id: string, options: ButtonOptions) => void;
2554
+ MediaPreview: (id: string, options: MediaPreviewOptions) => void;
2554
2555
  Section: (id: string, options: SectionOptions) => void;
2555
2556
  Separator: (id: string) => void;
2556
2557
  TextArea: (id: string, options: TextAreaOptions) => void;
2557
2558
  TextInput: (id: string, options: TextInputOptions) => void;
2558
2559
  NumberInput: (id: string, options: NumberInputOptions) => void;
2559
2560
  Slider: (id: string, options: SliderOptions) => void;
2561
+ Library: (id: string, options: LibraryOptions) => void;
2560
2562
  }
2561
2563
 
2562
2564
  /**
@@ -3286,6 +3288,18 @@ export declare class EditorAPI {
3286
3288
  * @returns A method to unsubscribe.
3287
3289
  */
3288
3290
  onSettingsChanged: (callback: () => void) => (() => void);
3291
+ /**
3292
+ * Subscribe to changes to the editor role.
3293
+ *
3294
+ * This lets you react to changes in the role of the user and update engine
3295
+ * and editor settings in response.
3296
+ *
3297
+ * @param callback - This function will be called immediately after a role has
3298
+ * been set and the default settings for that role have been applied. This function
3299
+ * will also be called in case the role is set to the same value as before.
3300
+ * @returns A function for unsubscribing
3301
+ */
3302
+ onRoleChanged: (callback: (role: RoleString) => void) => (() => void);
3289
3303
  /**
3290
3304
  * Set a boolean setting.
3291
3305
  * @param keypath - The settings keypath, e.g. `doubleClickToCropEnabled`
@@ -3387,7 +3401,7 @@ export declare class EditorAPI {
3387
3401
  getSettingColorRGBA(keypath: SettingsColorRGBA | `ubq://${SettingsColorRGBA}`): RGBA;
3388
3402
  /**
3389
3403
  * Set an enum setting.
3390
- * @param keypath - The settings keypath, e.g. `role`.
3404
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3391
3405
  * @param value - The enum value as string.
3392
3406
  */
3393
3407
  setSettingEnum<T extends keyof SettingsEnum>(keypath: T, value: SettingsEnum[T]): void;
@@ -3396,7 +3410,7 @@ export declare class EditorAPI {
3396
3410
 
3397
3411
  /**
3398
3412
  * Get an enum setting.
3399
- * @param keypath - The settings keypath, e.g. `role`.
3413
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3400
3414
  * @returns The value as string.
3401
3415
  */
3402
3416
  getSettingEnum<T extends keyof SettingsEnum>(keypath: T): SettingsEnum[T];
@@ -3405,12 +3419,20 @@ export declare class EditorAPI {
3405
3419
 
3406
3420
  /**
3407
3421
  * Get the possible enum options for a given enum setting.
3408
- * @param keypath - The settings keypath, e.g. `role`.
3422
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3409
3423
  * @returns The possible enum options as strings.
3410
3424
  */
3411
3425
  getSettingEnumOptions<T extends keyof SettingsEnum>(keypath: T): string[];
3412
3426
  /** @deprecated Support for `ubq://` prefixed keypaths will be removed in a future release. */
3413
3427
  getSettingEnumOptions<T extends keyof SettingsEnum>(keypath: `ubq://${T}`): string[];
3428
+ /**
3429
+ * Set the role of the user and apply role-dependent defaults for scopes and settings
3430
+ */
3431
+ setRole(role: RoleString): void;
3432
+ /**
3433
+ * Get the current role of the user
3434
+ */
3435
+ getRole(): RoleString;
3414
3436
  /**
3415
3437
  * Returns a list of all the settings available.
3416
3438
  * @returns A list of settings keypaths.
@@ -3418,7 +3440,7 @@ export declare class EditorAPI {
3418
3440
  findAllSettings(): string[];
3419
3441
  /**
3420
3442
  * Returns the type of a setting.
3421
- * @param keypath - The settings keypath, e.g. `role`.
3443
+ * @param keypath - The settings keypath, e.g. `doubleClickSelectionMode`.
3422
3444
  * @returns The setting type.
3423
3445
  */
3424
3446
  getSettingType(keypath: string): SettingType;
@@ -4166,6 +4188,12 @@ declare type IsEnabledFeatureContext = {
4166
4188
  engine: CreativeEngine;
4167
4189
  };
4168
4190
 
4191
+ declare interface LibraryOptions {
4192
+ entries: AssetLibraryEntry[];
4193
+ onSelect?: (asset: CompleteAssetResult) => Promise<void>;
4194
+ searchable?: boolean;
4195
+ }
4196
+
4169
4197
  /**
4170
4198
  * e.g. `en`, `de`, etc.
4171
4199
  * @public
@@ -4191,6 +4219,12 @@ export declare const LogLevel: {
4191
4219
  readonly Error: "Error";
4192
4220
  };
4193
4221
 
4222
+ declare interface MediaPreviewOptions {
4223
+ size?: 'small' | 'medium';
4224
+ preview?: PreviewType;
4225
+ action?: ButtonOptions;
4226
+ }
4227
+
4194
4228
  /** @public */
4195
4229
  declare enum MimeType_2 {
4196
4230
  Png = "image/png",
@@ -4332,6 +4366,18 @@ declare type PluginContext = {
4332
4366
  */
4333
4367
  export declare type PositionMode = 'Absolute' | 'Percent' | 'Auto';
4334
4368
 
4369
+ declare type PreviewType = PreviewTypeImage | PreviewTypeColor;
4370
+
4371
+ declare type PreviewTypeColor = {
4372
+ type: 'color';
4373
+ color: string;
4374
+ };
4375
+
4376
+ declare type PreviewTypeImage = {
4377
+ type: 'image';
4378
+ uri: string;
4379
+ };
4380
+
4335
4381
  /** @public */
4336
4382
  export declare type PropertyType = 'Bool' | 'Int' | 'Float' | 'String' | 'Color' | 'Enum' | 'Struct' | 'Double' | 'SourceSet';
4337
4383
 
@@ -4793,7 +4839,6 @@ export declare type SettingsColorRGBA = SettingsColor;
4793
4839
 
4794
4840
  /** @public */
4795
4841
  export declare type SettingsEnum = {
4796
- role: RoleString;
4797
4842
  doubleClickSelectionMode: 'Direct' | 'Hierarchical';
4798
4843
  'touch/pinchAction': 'None' | 'Zoom' | 'Scale';
4799
4844
  'touch/rotateAction': 'None' | 'Rotate';