@wix/editor 1.477.0 → 1.479.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.
@@ -4,7 +4,7 @@ import { WorkspaceHost as WorkspaceHost$1, AppsNamespace } from '@wix/workspace'
4
4
  import * as _wix_sdk_types from '@wix/sdk-types';
5
5
  import { Host } from '@wix/sdk-types';
6
6
  import * as _wix_editor_platform_transport from '@wix/editor-platform-transport';
7
- import { IElement, ComponentRef, ElementStyleDefinitions, ElementStyles, ElementStylesUpdate, ElementStylesRemoval, ElementDataDefinitions, ElementData, ElementDataInput, ElementPresetDefinitions, ElementStateDefinitions, ElementLink, BackgroundPickerOptions, DsItem, BuilderStyle, StyleRef, OpenLinkPanelFn, OpenColorPickerFn, ListProvidersOptions, Provider, BindingProperties, UnbindAll, ListBindingsOptions } from '@wix/public-editor-platform-interfaces';
7
+ import { IElement, ComponentRef, ElementStyleDefinitions, ElementStyles, ElementStylesUpdate, ElementStylesRemoval, ElementDataDefinitions, ElementData, ElementDataInput, ElementPresetDefinitions, ElementStateDefinitions, SelectFontParams, IFontFamilyAndWeight, SelectFontFamilyParams, IFontFamily, SelectMediaParams, SelectLinkParams, ElementLink, SelectColorParams, BackgroundPickerOptions, SelectFontWeightParams, IFontWeight, SelectTextThemeParams, DsItem, BuilderStyle, StyleRef, OpenLinkPanelFn, OpenColorPickerFn, ListProvidersOptions, Provider, BindingProperties, UnbindAll, ListBindingsOptions } from '@wix/public-editor-platform-interfaces';
8
8
  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 } from '@wix/public-editor-platform-interfaces';
9
9
 
10
10
  declare class Workspace implements NonNullable<WorkspaceHost$1['workspace']> {
@@ -133,31 +133,6 @@ declare class ModalsSDKShape extends BaseSDKShape {
133
133
  }
134
134
  declare const _default$6: ModalsSDKShape & _wix_sdk_types.HostModule<ModalsSDKShape, _wix_sdk_types.Host>;
135
135
 
136
- /** Represents a font family and its weight. */
137
- interface IFontFamily {
138
- /** The font family name. For example, 'Arial' or 'Helvetica Neue'. */
139
- family: string;
140
- /** The font weight. For example, '400' or 'bold'. */
141
- weight: string;
142
- }
143
- /** Represents a font weight value. */
144
- interface IFontWeight {
145
- /** The font weight. For example, '400' or 'bold'. */
146
- weight: string;
147
- }
148
- /** Combination of font family and weight properties. */
149
- type IFontFamilyAndWeight = IFontFamily & IFontWeight;
150
- type ISelectLinkSharedOptions = {
151
- /** Identifier for the origin of the link selection (used for BI tracking). */
152
- origin?: string;
153
- };
154
- /** Options for positioning a picker panel relative to a target element. */
155
- type IPanelOptions = {
156
- /** Where to place the picker panel relative to the target element. */
157
- placement?: 'top' | 'bottom' | 'top-start' | 'bottom-start' | 'top-end' | 'bottom-end';
158
- /** Vertical offset in pixels to shift the panel from its computed position. */
159
- YShift?: number;
160
- };
161
136
  /**
162
137
  * Methods for interacting with a component from a custom panel.
163
138
  *
@@ -177,10 +152,28 @@ type IPanelOptions = {
177
152
  * }
178
153
  * ```
179
154
  */
180
- declare class ElementSDKShape extends BaseSDKShape {
155
+ declare class ElementSDKShape extends BaseSDKShape implements IElement {
156
+ #private;
181
157
  protected overriddenApplicationContext: Promise<ApplicationContext> | null;
182
158
  private childPath;
183
- constructor(overriddenApplicationContext?: Promise<ApplicationContext> | null, childPath?: number[]);
159
+ readonly type: string | null;
160
+ readonly compRef?: unknown;
161
+ constructor(overriddenApplicationContext?: Promise<ApplicationContext> | null, childPath?: number[], overrides?: {
162
+ manifestContextId?: string;
163
+ type?: string;
164
+ compRef?: unknown;
165
+ });
166
+ protected getManifestContextId(): Promise<string | null | undefined>;
167
+ /**
168
+ * Reads a single data-item value by key. Equivalent to `(await getData())[prop]`.
169
+ * Provided for interface parity with elements.getSelection() results.
170
+ */
171
+ getProp<T = unknown>(prop: string): Promise<T | null | undefined | void>;
172
+ /**
173
+ * Writes a single data-item value by key. Equivalent to
174
+ * `setData({ [prop]: value })`. Other data items are left unchanged.
175
+ */
176
+ setProp<T = unknown>(prop: string, value: T | null | undefined): Promise<void>;
184
177
  /**
185
178
  * Retrieves the style definitions declared in the component's manifest,
186
179
  * including `cssProperties` and `cssCustomProperties`.
@@ -476,15 +469,7 @@ declare class ElementSDKShape extends BaseSDKShape {
476
469
  * });
477
470
  * ```
478
471
  */
479
- selectFont(params: {
480
- styleItemKey: string;
481
- } | {
482
- selectedFontFamily?: IFontFamilyAndWeight;
483
- target?: HTMLElement;
484
- panelOptions?: IPanelOptions;
485
- onChange?: (value: IFontFamilyAndWeight) => void;
486
- onPreview?: (value: IFontFamilyAndWeight) => void;
487
- }): Promise<any>;
472
+ selectFont(params: SelectFontParams): Promise<IFontFamilyAndWeight | undefined>;
488
473
  /**
489
474
  * Opens the font family picker for selecting a font family without
490
475
  * weight options. Works the same as {@link selectFont} but without
@@ -505,15 +490,7 @@ declare class ElementSDKShape extends BaseSDKShape {
505
490
  * });
506
491
  * ```
507
492
  */
508
- selectFontFamily(params: {
509
- styleItemKey: string;
510
- } | {
511
- selectedFontFamily?: IFontFamily;
512
- target?: HTMLElement;
513
- panelOptions?: IPanelOptions;
514
- onChange?: (value: IFontFamily) => void;
515
- onPreview?: (value: IFontFamily) => void;
516
- }): Promise<any>;
493
+ selectFontFamily(params: SelectFontFamilyParams): Promise<IFontFamily | undefined>;
517
494
  /**
518
495
  * Opens the media picker for selecting images, videos, or other media
519
496
  * from the Wix Media Manager.
@@ -536,12 +513,7 @@ declare class ElementSDKShape extends BaseSDKShape {
536
513
  * });
537
514
  * ```
538
515
  */
539
- selectMedia(params: {
540
- dataItemKey: string;
541
- } | {
542
- isMultiSelect?: boolean;
543
- category?: string;
544
- }): Promise<any>;
516
+ selectMedia(params: SelectMediaParams): Promise<any>;
545
517
  /**
546
518
  * Opens the link picker for creating or editing a link.
547
519
  *
@@ -563,15 +535,7 @@ declare class ElementSDKShape extends BaseSDKShape {
563
535
  * });
564
536
  * ```
565
537
  */
566
- selectLink(params: {
567
- dataItemKey: string;
568
- options?: ISelectLinkSharedOptions;
569
- } | {
570
- value?: ElementLink;
571
- options?: ISelectLinkSharedOptions & {
572
- linkTypes?: string[];
573
- };
574
- }): Promise<ElementLink | null | undefined>;
538
+ selectLink(params: SelectLinkParams): Promise<ElementLink | null | undefined>;
575
539
  /**
576
540
  * Opens the color picker for selecting a color.
577
541
  *
@@ -596,27 +560,7 @@ declare class ElementSDKShape extends BaseSDKShape {
596
560
  * });
597
561
  * ```
598
562
  */
599
- selectColor(params: {
600
- styleItemKey: string;
601
- } | {
602
- initialValue?: string;
603
- mode?: ('solid' | 'gradient')[];
604
- showBrand?: boolean;
605
- showCustom?: boolean;
606
- showAdvancedSettings?: boolean;
607
- showOpacity?: boolean;
608
- position?: {
609
- x: number;
610
- y: number;
611
- };
612
- biData?: {
613
- origin: string;
614
- };
615
- onChange?: (color: string) => void;
616
- onApply?: (color: string) => void;
617
- onClose?: () => void;
618
- onCancel?: () => void;
619
- }): Promise<any>;
563
+ selectColor(params: SelectColorParams): Promise<any>;
620
564
  /**
621
565
  * Opens the background picker for selecting a background fill
622
566
  * (color, gradient, or image).
@@ -660,16 +604,7 @@ declare class ElementSDKShape extends BaseSDKShape {
660
604
  * });
661
605
  * ```
662
606
  */
663
- selectFontWeight(params: {
664
- fontFamilyStyleItemKey: string;
665
- fontWeightStyleItemKey: string;
666
- } | {
667
- fontStyleItemKey: string;
668
- } | {
669
- fontFamily?: IFontFamily;
670
- target?: HTMLElement;
671
- onChange?: (value: IFontWeight) => void;
672
- }): Promise<IFontWeight>;
607
+ selectFontWeight(params: SelectFontWeightParams): Promise<IFontWeight>;
673
608
  /**
674
609
  * Opens the text theme picker for selecting a predefined text theme
675
610
  * (a combination of font and color from the site's theme).
@@ -688,13 +623,7 @@ declare class ElementSDKShape extends BaseSDKShape {
688
623
  * });
689
624
  * ```
690
625
  */
691
- selectTextTheme(params: {
692
- target?: HTMLElement;
693
- initialValue?: {
694
- font?: string;
695
- color?: string;
696
- };
697
- }): Promise<any>;
626
+ selectTextTheme(params: SelectTextThemeParams): Promise<any>;
698
627
  /**
699
628
  * Retrieves the currently selected index in an array items data group.
700
629
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor",
3
- "version": "1.477.0",
3
+ "version": "1.479.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Editor Platform <editor-platform-dev@wix.com>",
@@ -31,11 +31,11 @@
31
31
  "*.{js,ts}": "yarn lint"
32
32
  },
33
33
  "dependencies": {
34
- "@wix/editor-platform-contexts": "1.96.0",
35
- "@wix/editor-platform-environment-api": "1.97.0",
34
+ "@wix/editor-platform-contexts": "1.97.0",
35
+ "@wix/editor-platform-environment-api": "1.98.0",
36
36
  "@wix/monitoring-browser-sdk-host": "^0.1.8",
37
37
  "@wix/public-editor-platform-errors": "1.9.0",
38
- "@wix/public-editor-platform-interfaces": "1.39.0",
38
+ "@wix/public-editor-platform-interfaces": "1.40.0",
39
39
  "@wix/sdk-runtime": "^0.7.0",
40
40
  "@wix/sdk-types": "^1.14.0",
41
41
  "@wix/workspace": "^1.3.1"
@@ -69,5 +69,5 @@
69
69
  ]
70
70
  }
71
71
  },
72
- "falconPackageHash": "e7d8f40ce3d89b996645408c49500420bf39d50cec28c3e43448acf0"
72
+ "falconPackageHash": "d6ae6b7d87cb5a00afdff75bd971fdd50dad88d821cbe0c2809a2f8f"
73
73
  }