@wix/public-editor-platform-interfaces 1.67.0 → 1.69.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.
@@ -7,7 +7,7 @@ export interface DataItem extends DataItemDataValueOneOf {
7
7
  textEnum?: TextEnum;
8
8
  /** Image reference with optional metadata. */
9
9
  image?: Image;
10
- /** Numeric value (integer or decimal). */
10
+ /** Numeric value, either integer or decimal. */
11
11
  number?: _Number;
12
12
  /** Date without time component. */
13
13
  localDate?: LocalDate;
@@ -35,7 +35,7 @@ export interface DataItem extends DataItemDataValueOneOf {
35
35
  link?: Link;
36
36
  /** Container reference. */
37
37
  container?: Container;
38
- /** Text direction (LTR/RTL/auto). */
38
+ /** Text direction value: LTR, RTL, or auto. */
39
39
  direction?: Direction;
40
40
  /** Menu items collection. */
41
41
  menuItems?: MenuItems;
@@ -51,7 +51,11 @@ export interface DataItem extends DataItemDataValueOneOf {
51
51
  arrayItems?: ArrayItems;
52
52
  /** Function definition with parameters, return value, and async flag. */
53
53
  function?: _Function;
54
- /** Data type of this item. Uses the app-service `DataTypeEnum.DataType` enum. */
54
+ /** WQL-compliant filter expression for querying data. */
55
+ filter?: Filter;
56
+ /** WQL-compliant sort specification for ordering data. */
57
+ sort?: Sort;
58
+ /** Data type of this item. Determines which `dataValue` field is populated. */
55
59
  dataType?: DataType;
56
60
  }
57
61
  export interface DataItemDataValueOneOf {
@@ -63,7 +67,7 @@ export interface DataItemDataValueOneOf {
63
67
  textEnum?: TextEnum;
64
68
  /** Image reference with optional metadata. */
65
69
  image?: Image;
66
- /** Numeric value (integer or decimal). */
70
+ /** Numeric value, either integer or decimal. */
67
71
  number?: _Number;
68
72
  /** Date without time component. */
69
73
  localDate?: LocalDate;
@@ -91,7 +95,7 @@ export interface DataItemDataValueOneOf {
91
95
  link?: Link;
92
96
  /** Container reference. */
93
97
  container?: Container;
94
- /** Text direction (LTR/RTL/auto). */
98
+ /** Text direction value: LTR, RTL, or auto. */
95
99
  direction?: Direction;
96
100
  /** Menu items collection. */
97
101
  menuItems?: MenuItems;
@@ -107,6 +111,10 @@ export interface DataItemDataValueOneOf {
107
111
  arrayItems?: ArrayItems;
108
112
  /** Function definition with parameters, return value, and async flag. */
109
113
  function?: _Function;
114
+ /** WQL-compliant filter expression for querying data. */
115
+ filter?: Filter;
116
+ /** WQL-compliant sort specification for ordering data. */
117
+ sort?: Sort;
110
118
  }
111
119
  export declare enum DataType {
112
120
  UNKNOWN_DataType = "UNKNOWN_DataType",
@@ -164,16 +172,20 @@ export declare enum DataType {
164
172
  data = "data",
165
173
  /** A custom function that can be used to call a function from a custom library */
166
174
  'function' = "function",
167
- /** Standard [onClick handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event), can also handle: `()=>void` */
175
+ /** Deprecated: use function with pointerEvent parameter. Standard [onClick handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) */
168
176
  onClick = "onClick",
169
- /** Standard input event [onChange](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for text inputs, can also handle: `(value: string) => void` */
177
+ /** Deprecated: use function with changeEvent parameter. Standard [onChange handler](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) */
170
178
  onChange = "onChange",
171
- /** Standard [onKeyPress handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event), can also handle: `(event: KeyboardEvent) => void` */
179
+ /** Deprecated: use function with keyboardEvent parameter. Standard [onKeyPress handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event) */
172
180
  onKeyPress = "onKeyPress",
173
- /** Standard [onKeyUp handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event), can also handle: `(event: KeyboardEvent) => void` */
181
+ /** Deprecated: use function with keyboardEvent parameter. Standard [onKeyUp handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event) */
174
182
  onKeyUp = "onKeyUp",
175
- /** Standard [onSubmit handler](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event), can also handle: `() => void` */
176
- onSubmit = "onSubmit"
183
+ /** Deprecated: use function with submitEvent parameter. Standard [onSubmit handler](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event) */
184
+ onSubmit = "onSubmit",
185
+ /** A WQL-compliant filter definition for querying data */
186
+ filter = "filter",
187
+ /** A WQL-compliant sort definition for ordering data */
188
+ sort = "sort"
177
189
  }
178
190
  export interface Text {
179
191
  /**
@@ -225,13 +237,13 @@ export interface Image {
225
237
  crop?: Crop;
226
238
  }
227
239
  export interface Crop {
228
- /** Width of the crop region as a fraction of the original image (0.0 to 1.0). */
240
+ /** Width of the crop region as a fraction of the original image, from 0.0 to 1.0. */
229
241
  width?: number;
230
- /** Height of the crop region as a fraction of the original image (0.0 to 1.0). */
242
+ /** Height of the crop region as a fraction of the original image, from 0.0 to 1.0. */
231
243
  height?: number;
232
- /** X-coordinate of the crop origin as a fraction of the original image (0.0 to 1.0). */
244
+ /** X-coordinate of the crop origin as a fraction of the original image, from 0.0 to 1.0. */
233
245
  x?: number;
234
- /** Y-coordinate of the crop origin as a fraction of the original image (0.0 to 1.0). */
246
+ /** Y-coordinate of the crop origin as a fraction of the original image, from 0.0 to 1.0. */
235
247
  y?: number;
236
248
  }
237
249
  export interface _Number {
@@ -240,21 +252,21 @@ export interface _Number {
240
252
  }
241
253
  export interface LocalDate {
242
254
  /**
243
- * Date value in YYYY-MM-DD format.
255
+ * Date value in `YYYY-MM-DD` format.
244
256
  * @format LOCAL_DATE
245
257
  */
246
258
  value?: string;
247
259
  }
248
260
  export interface LocalTime {
249
261
  /**
250
- * Time value in HH:MM:SS format.
262
+ * Time value in `HH:MM:SS` format.
251
263
  * @format LOCAL_TIME
252
264
  */
253
265
  value?: string;
254
266
  }
255
267
  export interface LocalDateTime {
256
268
  /**
257
- * Date-time value in ISO 8601 format.
269
+ * Date-time value in ISO 8601 format, such as `2024-03-15T14:30:00`.
258
270
  * @format LOCAL_DATE_TIME
259
271
  */
260
272
  value?: string;
@@ -487,7 +499,7 @@ export interface Audio {
487
499
  loop?: boolean | null;
488
500
  /** Whether the audio player is visible. */
489
501
  visible?: boolean | null;
490
- /** Volume level (0-100). */
502
+ /** Volume level, from 0 to 100. */
491
503
  volume?: number | null;
492
504
  /**
493
505
  * Audio track title.
@@ -512,6 +524,52 @@ export interface VectorArt {
512
524
  */
513
525
  uri?: string | null;
514
526
  }
527
+ export interface Filter {
528
+ /** Per-field conditions keyed by field name. Multiple fields are implicitly combined with logical AND. */
529
+ fields?: Record<string, FieldConditions>;
530
+ /**
531
+ * Subfilters combined with logical AND, corresponding to `$and` in the underlying JSON schema.
532
+ * @maxSize 100
533
+ */
534
+ and?: Filter[];
535
+ /**
536
+ * Subfilters combined with logical OR, corresponding to `$or` in the underlying JSON schema.
537
+ * @maxSize 100
538
+ */
539
+ or?: Filter[];
540
+ /**
541
+ * Negated subfilters, corresponding to `$not` in the underlying JSON schema.
542
+ * @maxSize 100
543
+ */
544
+ not?: Filter[];
545
+ }
546
+ export interface Sort {
547
+ /**
548
+ * Ordered list of sort directives, applied in sequence.
549
+ * @maxSize 100
550
+ */
551
+ items?: SortItem[];
552
+ }
553
+ export interface FieldConditions {
554
+ operators?: Record<string, any>;
555
+ }
556
+ export interface SortItem {
557
+ /**
558
+ * Name of the field to sort by.
559
+ * @maxLength 200
560
+ */
561
+ fieldName?: string;
562
+ /** Sort direction. */
563
+ order?: SortOrderEnumSortOrder;
564
+ }
565
+ export declare enum SortOrderEnumSortOrder {
566
+ /** Unknown sort order. */
567
+ UNKNOWN_SORT_ORDER = "UNKNOWN_SORT_ORDER",
568
+ /** Ascending order. */
569
+ ASC = "ASC",
570
+ /** Descending order. */
571
+ DESC = "DESC"
572
+ }
515
573
  export interface ComponentData {
516
574
  /** Data properties keyed by property name. Available properties depend on the component type. */
517
575
  properties?: Record<string, DataItem>;
@@ -577,7 +635,7 @@ export declare enum StyleType {
577
635
  export interface CssStyleProperties {
578
636
  /** CSS properties keyed by property name. For example, `backgroundColor`, `borderWidth`. */
579
637
  properties?: Record<string, string>;
580
- /** CSS custom properties (variables) keyed by variable name. For example, `--primary-color`, `--spacing-unit`. */
638
+ /** CSS custom properties, also known as CSS variables, keyed by variable name. For example, `--primary-color`, `--spacing-unit`. */
581
639
  customProperties?: Record<string, string>;
582
640
  }
583
641
  export interface LegacyStyleProperties {
@@ -600,22 +658,22 @@ export declare enum PropertySource {
600
658
  }
601
659
  export interface PartialTextTheme {
602
660
  /**
603
- * Font style (normal, italic).
661
+ * Font style, such as `normal` or `italic`.
604
662
  * @maxLength 100
605
663
  */
606
664
  fontStyle?: string | null;
607
665
  /**
608
- * Font weight (normal, bold, 100-900).
666
+ * Font weight, such as `normal`, `bold`, or a numeric value from `100` to `900`.
609
667
  * @maxLength 100
610
668
  */
611
669
  fontWeight?: string | null;
612
670
  /**
613
- * Font variant (normal, small-caps, inherit).
671
+ * Font variant, such as `normal`, `small-caps`, or `inherit`.
614
672
  * @maxLength 100
615
673
  */
616
674
  fontVariant?: string | null;
617
675
  /**
618
- * Font size with unit (e.g., "14px", "1em").
676
+ * Font size with unit, such as `14px` or `1em`.
619
677
  * @maxLength 100
620
678
  */
621
679
  fontSize?: string | null;
@@ -686,7 +744,7 @@ export interface ComponentStyleOverrideStylePropertiesOneOf {
686
744
  }
687
745
  export interface ConditionalTrigger {
688
746
  /**
689
- * ID of the condition that triggers this override. Examples include responsive breakpoint IDs and interaction states such as hover.
747
+ * ID of the condition that triggers this override. Condition IDs are system-defined identifiers for responsive breakpoints and interaction states such as hover. To discover available condition IDs for a component, retrieve the component and inspect any existing style overrides.
690
748
  * @maxLength 100
691
749
  */
692
750
  conditionId?: string;
@@ -2,7 +2,7 @@
2
2
  // Auto-generated from Ambassador packages
3
3
  // Do not edit manually - run 'yarn generate:public-types' to regenerate
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.AriaInvalid = exports.AriaCurrent = exports.AriaLive = exports.AriaRole = exports.AriaRelevant = exports.AriaHaspopup = exports.AriaPressed = exports.LoginDialog = exports.TextLinkType = exports.LinkType = exports.LinkRelEnumLinkRel = exports.LinkTarget = exports.PropertySource = exports.StyleType = exports.AdaptiveFormat = exports.VideoFormat = exports.VideoQuality = exports.DirectionValue = exports.DataType = void 0;
5
+ exports.AriaInvalid = exports.AriaCurrent = exports.AriaLive = exports.AriaRole = exports.AriaRelevant = exports.AriaHaspopup = exports.AriaPressed = exports.LoginDialog = exports.TextLinkType = exports.LinkType = exports.LinkRelEnumLinkRel = exports.LinkTarget = exports.PropertySource = exports.StyleType = exports.SortOrderEnumSortOrder = exports.AdaptiveFormat = exports.VideoFormat = exports.VideoQuality = exports.DirectionValue = exports.DataType = void 0;
6
6
  var DataType;
7
7
  (function (DataType) {
8
8
  DataType["UNKNOWN_DataType"] = "UNKNOWN_DataType";
@@ -60,16 +60,20 @@ var DataType;
60
60
  DataType["data"] = "data";
61
61
  /** A custom function that can be used to call a function from a custom library */
62
62
  DataType["function"] = "function";
63
- /** Standard [onClick handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event), can also handle: `()=>void` */
63
+ /** Deprecated: use function with pointerEvent parameter. Standard [onClick handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) */
64
64
  DataType["onClick"] = "onClick";
65
- /** Standard input event [onChange](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for text inputs, can also handle: `(value: string) => void` */
65
+ /** Deprecated: use function with changeEvent parameter. Standard [onChange handler](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) */
66
66
  DataType["onChange"] = "onChange";
67
- /** Standard [onKeyPress handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event), can also handle: `(event: KeyboardEvent) => void` */
67
+ /** Deprecated: use function with keyboardEvent parameter. Standard [onKeyPress handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event) */
68
68
  DataType["onKeyPress"] = "onKeyPress";
69
- /** Standard [onKeyUp handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event), can also handle: `(event: KeyboardEvent) => void` */
69
+ /** Deprecated: use function with keyboardEvent parameter. Standard [onKeyUp handler](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event) */
70
70
  DataType["onKeyUp"] = "onKeyUp";
71
- /** Standard [onSubmit handler](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event), can also handle: `() => void` */
71
+ /** Deprecated: use function with submitEvent parameter. Standard [onSubmit handler](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event) */
72
72
  DataType["onSubmit"] = "onSubmit";
73
+ /** A WQL-compliant filter definition for querying data */
74
+ DataType["filter"] = "filter";
75
+ /** A WQL-compliant sort definition for ordering data */
76
+ DataType["sort"] = "sort";
73
77
  })(DataType || (exports.DataType = DataType = {}));
74
78
  var DirectionValue;
75
79
  (function (DirectionValue) {
@@ -113,6 +117,15 @@ var AdaptiveFormat;
113
117
  /** Dynamic Adaptive Streaming over HTTP. */
114
118
  AdaptiveFormat["DASH"] = "DASH";
115
119
  })(AdaptiveFormat || (exports.AdaptiveFormat = AdaptiveFormat = {}));
120
+ var SortOrderEnumSortOrder;
121
+ (function (SortOrderEnumSortOrder) {
122
+ /** Unknown sort order. */
123
+ SortOrderEnumSortOrder["UNKNOWN_SORT_ORDER"] = "UNKNOWN_SORT_ORDER";
124
+ /** Ascending order. */
125
+ SortOrderEnumSortOrder["ASC"] = "ASC";
126
+ /** Descending order. */
127
+ SortOrderEnumSortOrder["DESC"] = "DESC";
128
+ })(SortOrderEnumSortOrder || (exports.SortOrderEnumSortOrder = SortOrderEnumSortOrder = {}));
116
129
  var StyleType;
117
130
  (function (StyleType) {
118
131
  /** Unknown style type. */
@@ -118,7 +118,9 @@ export type ElementRichText = Omit<DmTypes.RichText, 'linkList'> & {
118
118
  linkList?: ElementLink[];
119
119
  };
120
120
  export type ElementFunctionDefinition = DmTypes._Function;
121
- export type ElementDataValue = string | number | boolean | ElementLink | ElementImage | ElementVideo | ElementAudio | ElementVectorArt | ElementMenuItems | ElementA11y | ElementRichText | ElementFunctionDefinition | ElementDirection | ElementDataObject | ElementDataValue[] | null | undefined;
121
+ export type ElementFilter = DmTypes.Filter;
122
+ export type ElementSort = DmTypes.Sort;
123
+ export type ElementDataValue = string | number | boolean | ElementLink | ElementImage | ElementVideo | ElementAudio | ElementVectorArt | ElementMenuItems | ElementA11y | ElementRichText | ElementFunctionDefinition | ElementDirection | ElementFilter | ElementSort | ElementDataObject | ElementDataValue[] | null | undefined;
122
124
  export type ElementDataObject = {
123
125
  [key: string]: ElementDataValue;
124
126
  };
@@ -157,6 +159,8 @@ export type ElementDataTypeMap = {
157
159
  [DataType.onSubmit]: ElementFunctionDefinition;
158
160
  [DataType.schema]: ElementDataValue;
159
161
  [DataType.UNKNOWN_DataType]: ElementDataValue;
162
+ [DataType.filter]: ElementFilter;
163
+ [DataType.sort]: ElementSort;
160
164
  ['function']: ElementFunctionDefinition;
161
165
  };
162
166
  export type ElementDefaultValueFor<TypeKey extends keyof ElementDataTypeMap> = ElementDataTypeMap[TypeKey];
@@ -6,6 +6,7 @@ import type { DataType } from '../generated/dm-types';
6
6
  import type { ElementDataTypeMap, ElementDataValue } from './data';
7
7
  import type { CssPropertyType, CssPropertyOptions } from './css-properties';
8
8
  import type { ElementStyleValue, CssPropertyKey } from './styles';
9
+ import type { FilterDefinition, SortDefinition } from '@wix/app-extensions/trusted';
9
10
  export { DataType } from '../generated/dm-types';
10
11
  export type ElementStyleDefinition = {
11
12
  displayName?: string | null;
@@ -41,11 +42,20 @@ export type ElementStateDefinition = {
41
42
  props?: Record<string, unknown>;
42
43
  };
43
44
  export type ElementStateDefinitions = Record<string, ElementStateDefinition>;
45
+ type ElementDataDefinitionExtraFields = {
46
+ [DataType.filter]: {
47
+ filter?: FilterDefinition;
48
+ };
49
+ [DataType.sort]: {
50
+ sort?: SortDefinition;
51
+ };
52
+ };
53
+ type ExtraFieldsFor<TypeKey extends DataType> = TypeKey extends keyof ElementDataDefinitionExtraFields ? ElementDataDefinitionExtraFields[TypeKey] : {};
44
54
  export type ElementDataDefinition<TypeKey extends DataType = DataType> = {
45
55
  dataType?: TypeKey;
46
56
  displayName?: string | null;
47
57
  defaultValue?: TypeKey extends keyof ElementDataTypeMap ? ElementDataTypeMap[TypeKey] : ElementDataValue;
48
- };
58
+ } & ExtraFieldsFor<TypeKey>;
49
59
  export type ElementDataDefinitions = Record<string, ElementDataDefinition>;
50
60
  export type ElementDataDefaultValues = Partial<{
51
61
  [Key in DataType]: ElementDataTypeMap[Key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/public-editor-platform-interfaces",
3
- "version": "1.67.0",
3
+ "version": "1.69.0",
4
4
  "license": "UNLICENSED",
5
5
  "contributors": [
6
6
  {
@@ -23,7 +23,7 @@
23
23
  "*.{js,ts}": "yarn lint"
24
24
  },
25
25
  "dependencies": {
26
- "@wix/app-extensions": "^1.0.62",
26
+ "@wix/app-extensions": "^1.0.63",
27
27
  "@wix/sdk-types": "^1.17.8"
28
28
  },
29
29
  "devDependencies": {
@@ -52,5 +52,5 @@
52
52
  ]
53
53
  }
54
54
  },
55
- "falconPackageHash": "b78f464ba0c437442061d894a336cd428688212329ca5e6dcdca14c7"
55
+ "falconPackageHash": "a09ce2e428999c892c11295fca4b72a865e2ff9337e8239e12f897e4"
56
56
  }