@wix/editor 1.561.0 → 1.563.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.
@@ -5,7 +5,7 @@ import * as _wix_sdk_types from '@wix/sdk-types';
5
5
  import { Host } from '@wix/sdk-types';
6
6
  import * as _wix_sdk_runtime_host_modules from '@wix/sdk-runtime/host-modules';
7
7
  import * as _wix_editor_platform_transport from '@wix/editor-platform-transport';
8
- import { IElement, SiteLocale, ComponentRef, ElementStyleDefinitions, ElementStyles, ElementStylesUpdate, ElementStylesRemoval, ElementDataDefinitions, ElementData, ElementDataInput, ElementPresetDefinitions, ElementStateDefinitions, ElementLink, BackgroundPickerOptions, DsItem, BuilderStyle, StyleRef, OpenLinkPanelFn, OpenColorPickerFn, ListProvidersOptions, Provider, BindingProperties, BindingDetailsMap, UnbindAll, ListBindingsOptions, BindingTargetDetails, findBindingCandidatesOptions, BindingCandidate, SelectBindingOptions, IRouter, IPage, AddTemplateOptions, AddExtensionOptions } from '@wix/public-editor-platform-interfaces';
8
+ import { IElement, SiteLocale, ComponentRef, IElementSDK, ElementStyleDefinitions, ElementStyles, ElementStylesUpdate, ElementStylesRemoval, ElementDataDefinitions, ElementData, ElementDataInput, ElementPresetDefinitions, ElementStateDefinitions, SelectFontParams, SelectFontFamilyParams, SelectMediaParams, SelectLinkParams, ElementLink, SelectColorParams, BackgroundPickerOptions, SelectFontWeightParams, IFontWeight, SelectTextThemeParams, DsItem, BuilderStyle, StyleRef, OpenLinkPanelFn, OpenColorPickerFn, ListProvidersOptions, Provider, BindingProperties, BindingDetailsMap, UnbindAll, ListBindingsOptions, BindingTargetDetails, findBindingCandidatesOptions, BindingCandidate, SelectBindingOptions, IRouter, IPage, AddTemplateOptions, AddExtensionOptions } from '@wix/public-editor-platform-interfaces';
9
9
  export { DataType, ElementA11y, ElementAddressLink, ElementAnchorLink, ElementAudio, ElementData, ElementDataDefinition, ElementDataDefinitions, ElementDataInput, ElementDataObject, ElementDataValue, ElementDirection, ElementDocumentLink, ElementDynamicPageLink, ElementEmailLink, ElementExternalLink, ElementImage, ElementLink, ElementLoginToWixLink, ElementMenuItems, ElementPageLink, ElementPhoneLink, ElementPresetDefinition, ElementPresetDefinitions, ElementRichText, ElementStateDefinition, ElementStateDefinitions, ElementStyleDefinition, ElementStyleDefinitions, ElementStyles, ElementStylesRemoval, ElementStylesUpdate, ElementTextLink, ElementTpaPageLink, ElementVectorArt, ElementVideo, ElementWhatsAppLink, NativeStateType, SiteLocale } from '@wix/public-editor-platform-interfaces';
10
10
 
11
11
  declare class Workspace implements NonNullable<WorkspaceHost$1['workspace']> {
@@ -139,31 +139,6 @@ declare class ModalsSDKShape extends BaseSDKShape {
139
139
  }
140
140
  declare const _default$8: ModalsSDKShape & _wix_sdk_runtime_host_modules.HostModule<ModalsSDKShape, _wix_sdk_types.Host>;
141
141
 
142
- /** Represents a font family and its weight. */
143
- interface IFontFamily {
144
- /** The font family name. For example, 'Arial' or 'Helvetica Neue'. */
145
- family: string;
146
- /** The font weight. For example, '400' or 'bold'. */
147
- weight: string;
148
- }
149
- /** Represents a font weight value. */
150
- interface IFontWeight {
151
- /** The font weight. For example, '400' or 'bold'. */
152
- weight: string;
153
- }
154
- /** Combination of font family and weight properties. */
155
- type IFontFamilyAndWeight = IFontFamily & IFontWeight;
156
- type ISelectLinkSharedOptions = {
157
- /** Identifier for the origin of the link selection (used for BI tracking). */
158
- origin?: string;
159
- };
160
- /** Options for positioning a picker panel relative to a target element. */
161
- type IPanelOptions = {
162
- /** Where to place the picker panel relative to the target element. */
163
- placement?: 'top' | 'bottom' | 'top-start' | 'bottom-start' | 'top-end' | 'bottom-end';
164
- /** Vertical offset in pixels to shift the panel from its computed position. */
165
- YShift?: number;
166
- };
167
142
  /**
168
143
  * Methods for interacting with a component from a custom panel.
169
144
  *
@@ -183,7 +158,7 @@ type IPanelOptions = {
183
158
  * }
184
159
  * ```
185
160
  */
186
- declare class ElementSDKShape extends BaseSDKShape {
161
+ declare class ElementSDKShape extends BaseSDKShape implements IElementSDK {
187
162
  protected overriddenApplicationContext: Promise<ApplicationContext> | null;
188
163
  private childPath;
189
164
  constructor(overriddenApplicationContext?: Promise<ApplicationContext> | null, childPath?: number[]);
@@ -256,9 +231,11 @@ declare class ElementSDKShape extends BaseSDKShape {
256
231
  */
257
232
  removeStyles(values?: ElementStylesRemoval): Promise<void>;
258
233
  /**
259
- * Retrieves the data item definitions declared in the component's manifest.
234
+ * Lists the data fields defined on the selected component's manifest.
260
235
  *
261
- * @returns Data item definitions keyed by data item key.
236
+ * Each key in the result is a valid **`dataItemKey`** for `getData`, `setData`, and `getResolvedData`.
237
+ *
238
+ * @returns Definitions keyed by `dataItemKey`.
262
239
  *
263
240
  * @example
264
241
  * ```ts
@@ -283,19 +260,21 @@ declare class ElementSDKShape extends BaseSDKShape {
283
260
  */
284
261
  getData<T extends ElementData = ElementData>(): Promise<T>;
285
262
  /**
286
- * Retrieves the resolved value of a specific data item.
263
+ * Returns one data field from the selected component by **`dataItemKey`**.
264
+ *
265
+ * A **`dataItemKey`** is the property name of a data field in that component's manifest — the same names
266
+ * returned from `getDataDefinitions`. Example: `'heroImage'` for a field declared under `editorElement.data`.
287
267
  *
288
- * Unlike {@link getData}, this method returns the fully resolved value
289
- * for a single data item.
268
+ * `getData` returns all fields at once. This method returns only the field you name.
290
269
  *
291
- * @param options - Object containing the `dataItemKey` to resolve.
292
- * @returns Resolved value for the specified data item.
270
+ * @param options.dataItemKey - Key of the data field to read. Must exist on the component manifest.
271
+ * @returns Value for that data field.
293
272
  *
294
273
  * @example
295
274
  * ```ts
296
275
  * import { reactElements } from '@wix/editor';
297
276
  *
298
- * const resolved = await reactElements.getResolvedData({
277
+ * const hero = await reactElements.getResolvedData({
299
278
  * dataItemKey: 'heroImage',
300
279
  * });
301
280
  * ```
@@ -321,7 +300,7 @@ declare class ElementSDKShape extends BaseSDKShape {
321
300
  /**
322
301
  * Retrieves the preset definitions declared in the component's manifest.
323
302
  *
324
- * @returns Preset definitions keyed by preset key.
303
+ * @returns An object mapping each preset key to its definition.
325
304
  *
326
305
  * @example
327
306
  * ```ts
@@ -396,7 +375,7 @@ declare class ElementSDKShape extends BaseSDKShape {
396
375
  */
397
376
  getDisplayName(): Promise<any>;
398
377
  /**
399
- * Retrieves the currently active state for the component.
378
+ * Retrieves the active state for the component.
400
379
  *
401
380
  * @returns Key of the active state, or `null` if the default state is active.
402
381
  *
@@ -427,7 +406,7 @@ declare class ElementSDKShape extends BaseSDKShape {
427
406
  /**
428
407
  * Retrieves the state definitions declared in the component's manifest.
429
408
  *
430
- * @returns State definitions keyed by state key.
409
+ * @returns An object mapping each state key to its definition.
431
410
  *
432
411
  * @example
433
412
  * ```ts
@@ -462,137 +441,90 @@ declare class ElementSDKShape extends BaseSDKShape {
462
441
  value: unknown;
463
442
  }) => void): Promise<() => {}>;
464
443
  /**
465
- * Opens the font picker for selecting a font family and weight.
444
+ * Opens the font picker for selecting a font family and weight from a custom panel.
466
445
  *
467
- * Pass `styleItemKey` to bind the picker to a manifest style item,
468
- * or pass manual options to handle the selection via callbacks.
446
+ * Pass `target` and `panelOptions` to position the popup next to the control that opened it.
447
+ * Use `onChange` / `onPreview` to handle the selection; the editor does not write to the manifest for you.
469
448
  *
470
- * @param params - `styleItemKey` for manifest binding, or manual picker options.
449
+ * @param params - Picker options.
471
450
  * @returns Selected font family and weight, or `undefined` if dismissed.
472
451
  *
473
452
  * @example
474
453
  * ```ts
475
454
  * import { reactElements } from '@wix/editor';
476
455
  *
477
- * const font = await reactElements.selectFont({ styleItemKey: 'headingFont' });
478
- *
479
456
  * const font = await reactElements.selectFont({
480
457
  * selectedFontFamily: { family: 'Arial', weight: '400' },
458
+ * target: buttonRef.current,
481
459
  * onChange: (value) => console.log('Selected:', value),
482
460
  * });
483
461
  * ```
484
462
  */
485
- selectFont(params: {
486
- styleItemKey: string;
487
- } | {
488
- selectedFontFamily?: IFontFamilyAndWeight;
489
- target?: HTMLElement;
490
- panelOptions?: IPanelOptions;
491
- onChange?: (value: IFontFamilyAndWeight) => void;
492
- onPreview?: (value: IFontFamilyAndWeight) => void;
493
- }): Promise<any>;
463
+ selectFont(params: SelectFontParams): Promise<any>;
494
464
  /**
495
- * Opens the font family picker for selecting a font family without
496
- * weight options. Works the same as {@link selectFont} but without
497
- * the weight selector.
465
+ * Opens the font family picker without weight selection, from a custom panel.
498
466
  *
499
- * @param params - `styleItemKey` for manifest binding, or manual picker options.
467
+ * Same pattern as {@link selectFont}: `target`, `panelOptions`, and callbacks.
468
+ *
469
+ * @param params - Picker options.
500
470
  * @returns Selected font family, or `undefined` if dismissed.
501
471
  *
502
472
  * @example
503
473
  * ```ts
504
474
  * import { reactElements } from '@wix/editor';
505
475
  *
506
- * const font = await reactElements.selectFontFamily({ styleItemKey: 'bodyFont' });
507
- *
508
476
  * const font = await reactElements.selectFontFamily({
509
477
  * selectedFontFamily: { family: 'Helvetica', weight: '400' },
478
+ * target: buttonRef.current,
510
479
  * onChange: (value) => console.log('Selected:', value.family),
511
480
  * });
512
481
  * ```
513
482
  */
514
- selectFontFamily(params: {
515
- styleItemKey: string;
516
- } | {
517
- selectedFontFamily?: IFontFamily;
518
- target?: HTMLElement;
519
- panelOptions?: IPanelOptions;
520
- onChange?: (value: IFontFamily) => void;
521
- onPreview?: (value: IFontFamily) => void;
522
- }): Promise<any>;
483
+ selectFontFamily(params: SelectFontFamilyParams): Promise<any>;
523
484
  /**
524
- * Opens the media picker for selecting images, videos, or other media
525
- * from the Wix Media Manager.
526
- *
527
- * Pass `dataItemKey` to bind the picker to a manifest data item,
528
- * or pass manual options to configure the picker.
485
+ * Opens the media picker for selecting images, videos, or other media from a custom panel.
529
486
  *
530
- * @param params - `dataItemKey` for manifest binding, or manual picker options.
487
+ * @param params - Picker options.
531
488
  * @returns Selected media items.
532
489
  *
533
490
  * @example
534
491
  * ```ts
535
492
  * import { reactElements } from '@wix/editor';
536
493
  *
537
- * const media = await reactElements.selectMedia({ dataItemKey: 'heroImage' });
538
- *
539
494
  * const media = await reactElements.selectMedia({
540
495
  * isMultiSelect: true,
541
496
  * category: 'image',
542
497
  * });
543
498
  * ```
544
499
  */
545
- selectMedia(params: {
546
- dataItemKey: string;
547
- } | {
548
- isMultiSelect?: boolean;
549
- category?: string;
550
- }): Promise<any>;
500
+ selectMedia(params: SelectMediaParams): Promise<any>;
551
501
  /**
552
- * Opens the link picker for creating or editing a link.
502
+ * Opens the link picker for creating or editing a link from a custom panel.
553
503
  *
554
- * Pass `dataItemKey` to bind the picker to a manifest data item,
555
- * or pass a `value` and optional `linkTypes` to configure manually.
556
- *
557
- * @param params - `dataItemKey` for manifest binding, or manual picker options.
504
+ * @param params - Picker options.
558
505
  * @returns Selected link, or `null`/`undefined` if dismissed.
559
506
  *
560
507
  * @example
561
508
  * ```ts
562
509
  * import { reactElements } from '@wix/editor';
563
510
  *
564
- * const link = await reactElements.selectLink({ dataItemKey: 'buttonLink' });
565
- *
566
511
  * const link = await reactElements.selectLink({
567
512
  * value: currentLink,
568
513
  * options: { linkTypes: ['ExternalLink', 'PageLink'] },
569
514
  * });
570
515
  * ```
571
516
  */
572
- selectLink(params: {
573
- dataItemKey: string;
574
- options?: ISelectLinkSharedOptions;
575
- } | {
576
- value?: ElementLink;
577
- options?: ISelectLinkSharedOptions & {
578
- linkTypes?: string[];
579
- };
580
- }): Promise<ElementLink | null | undefined>;
517
+ selectLink(params: SelectLinkParams): Promise<ElementLink | null | undefined>;
581
518
  /**
582
- * Opens the color picker for selecting a color.
519
+ * Opens the color picker for selecting a color from a custom panel.
583
520
  *
584
- * Pass `styleItemKey` to bind the picker to a manifest style item,
585
- * or pass manual options to configure the picker.
586
- *
587
- * @param params - `styleItemKey` for manifest binding, or manual picker options.
521
+ * @param params - Picker options.
588
522
  * @returns Selected color value, or `undefined` if dismissed.
589
523
  *
590
524
  * @example
591
525
  * ```ts
592
526
  * import { reactElements } from '@wix/editor';
593
527
  *
594
- * const color = await reactElements.selectColor({ styleItemKey: 'backgroundColor' });
595
- *
596
528
  * const color = await reactElements.selectColor({
597
529
  * initialValue: '#ff0000',
598
530
  * mode: ['solid', 'gradient'],
@@ -602,27 +534,7 @@ declare class ElementSDKShape extends BaseSDKShape {
602
534
  * });
603
535
  * ```
604
536
  */
605
- selectColor(params: {
606
- styleItemKey: string;
607
- } | {
608
- initialValue?: string;
609
- mode?: ('solid' | 'gradient')[];
610
- showBrand?: boolean;
611
- showCustom?: boolean;
612
- showAdvancedSettings?: boolean;
613
- showOpacity?: boolean;
614
- position?: {
615
- x: number;
616
- y: number;
617
- };
618
- biData?: {
619
- origin: string;
620
- };
621
- onChange?: (color: string) => void;
622
- onApply?: (color: string) => void;
623
- onClose?: () => void;
624
- onCancel?: () => void;
625
- }): Promise<any>;
537
+ selectColor(params: SelectColorParams): Promise<any>;
626
538
  /**
627
539
  * Opens the background picker for selecting a background fill
628
540
  * (color, gradient, or image).
@@ -642,13 +554,9 @@ declare class ElementSDKShape extends BaseSDKShape {
642
554
  */
643
555
  selectBackground(options: BackgroundPickerOptions): Promise<any>;
644
556
  /**
645
- * Opens the font weight picker for selecting a font weight for a specified
646
- * font family.
647
- *
648
- * Pass manifest style item keys to bind the picker, or pass manual
649
- * options to handle the selection via callbacks.
557
+ * Opens the font weight picker for a specified font family, from a custom panel.
650
558
  *
651
- * @param params - Manifest style item keys, or manual picker options.
559
+ * @param params - Picker options.
652
560
  * @returns Selected font weight.
653
561
  *
654
562
  * @example
@@ -656,32 +564,17 @@ declare class ElementSDKShape extends BaseSDKShape {
656
564
  * import { reactElements } from '@wix/editor';
657
565
  *
658
566
  * const weight = await reactElements.selectFontWeight({
659
- * fontFamilyStyleItemKey: 'headingFontFamily',
660
- * fontWeightStyleItemKey: 'headingFontWeight',
661
- * });
662
- *
663
- * const weight = await reactElements.selectFontWeight({
664
567
  * fontFamily: { family: 'Arial', weight: '400' },
568
+ * target: buttonRef.current,
665
569
  * onChange: (value) => console.log('Selected weight:', value.weight),
666
570
  * });
667
571
  * ```
668
572
  */
669
- selectFontWeight(params: {
670
- fontFamilyStyleItemKey: string;
671
- fontWeightStyleItemKey: string;
672
- } | {
673
- fontStyleItemKey: string;
674
- } | {
675
- fontFamily?: IFontFamily;
676
- target?: HTMLElement;
677
- onChange?: (value: IFontWeight) => void;
678
- }): Promise<IFontWeight>;
573
+ selectFontWeight(params: SelectFontWeightParams): Promise<IFontWeight>;
679
574
  /**
680
- * Opens the text theme picker for selecting a predefined text theme
681
- * (a combination of font and color from the site's theme).
575
+ * Opens the text theme picker from a custom panel — a site theme combination of font and color.
682
576
  *
683
- * @param params - Text theme picker configuration.
684
- * @param params.target - HTML element to anchor the picker to.
577
+ * @param params - Picker options. Pass `target` for the element in your panel that opened the picker.
685
578
  * @param params.initialValue - Initial font and color values.
686
579
  * @returns Selected text theme.
687
580
  *
@@ -690,17 +583,12 @@ declare class ElementSDKShape extends BaseSDKShape {
690
583
  * import { reactElements } from '@wix/editor';
691
584
  *
692
585
  * const theme = await reactElements.selectTextTheme({
586
+ * target: buttonRef.current,
693
587
  * initialValue: { font: 'Heading 1', color: '#333' },
694
588
  * });
695
589
  * ```
696
590
  */
697
- selectTextTheme(params: {
698
- target?: HTMLElement;
699
- initialValue?: {
700
- font?: string;
701
- color?: string;
702
- };
703
- }): Promise<any>;
591
+ selectTextTheme(params: SelectTextThemeParams): Promise<any>;
704
592
  /**
705
593
  * Retrieves the currently selected index in an array items data group.
706
594
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor",
3
- "version": "1.561.0",
3
+ "version": "1.563.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Editor Platform <editor-platform-dev@wix.com>",
@@ -25,17 +25,17 @@
25
25
  "lint": "prettier --check ./src",
26
26
  "lint:fix": "prettier --write ./src",
27
27
  "typecheck": "tsc --noEmit",
28
- "docs": "docs-ts-model --entryPoint src/element/index.ts"
28
+ "docs": "docs-ts-model --entryPoint ../public-editor-platform-interfaces/src/Element.ts"
29
29
  },
30
30
  "lint-staged": {
31
31
  "*.{js,ts}": "yarn lint"
32
32
  },
33
33
  "dependencies": {
34
- "@wix/editor-platform-contexts": "1.116.0",
35
- "@wix/editor-platform-environment-api": "1.117.0",
34
+ "@wix/editor-platform-contexts": "1.117.0",
35
+ "@wix/editor-platform-environment-api": "1.118.0",
36
36
  "@wix/monitoring-browser-sdk-host": "^0.1.25",
37
37
  "@wix/public-editor-platform-errors": "1.9.0",
38
- "@wix/public-editor-platform-interfaces": "1.59.0",
38
+ "@wix/public-editor-platform-interfaces": "1.60.0",
39
39
  "@wix/sdk-runtime": "^0.7.0",
40
40
  "@wix/sdk-types": "^1.17.8",
41
41
  "@wix/workspace": "^1.3.11"
@@ -69,5 +69,5 @@
69
69
  ]
70
70
  }
71
71
  },
72
- "falconPackageHash": "13d9fc6128892b1df425d237539e2b26279e553174192b16e9f01a3f"
72
+ "falconPackageHash": "df6bc8486e4cea7ca1fd33278a2ae2f82ff049469776285f10543ffd"
73
73
  }