@wix/react-component-schema 1.1.0 → 1.2.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/dist/index.d.ts CHANGED
@@ -1516,7 +1516,9 @@ declare enum DisplayValueEnumDisplayValue {
1516
1516
  listItem = "listItem"
1517
1517
  }
1518
1518
 
1519
- export declare type EditorElement = EditorElement_2 & Required<Pick<EditorElement_2, 'selector' | 'displayName'>>;
1519
+ export declare type EditorElement = EditorElement_2 & RequiredFields<EditorElement_2, 'selector' | 'displayName'> & {
1520
+ presets: Record<string, PresetItem & RequiredFields<PresetItem, 'displayName'>>;
1521
+ };
1520
1522
 
1521
1523
  declare interface EditorElement_2 {
1522
1524
  /**
@@ -2600,6 +2602,8 @@ declare interface RefInnerElementDefaults {
2600
2602
  cssCustomProperties?: Record<string, CssPropertyItemDefaults>;
2601
2603
  }
2602
2604
 
2605
+ declare type RequiredFields<T, K extends keyof T> = Required<Pick<T, K>>;
2606
+
2603
2607
  declare enum ResizeDirection {
2604
2608
  /** Default value when direction is not specified */
2605
2609
  UNKNOWN_ResizeDirection = "UNKNOWN_ResizeDirection",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "registry": "https://registry.npmjs.org/",
5
5
  "access": "public"
6
6
  },
7
- "version": "1.1.0",
7
+ "version": "1.2.0",
8
8
  "description": "Schema constants and types for EditorReactComponent extension",
9
9
  "type": "module",
10
10
  "main": "dist/index.js",
@@ -48,5 +48,5 @@
48
48
  ]
49
49
  }
50
50
  },
51
- "falconPackageHash": "02b91df4f5928ec7fa0b957958ec2dcb26e070a985419bbab3d51a41"
51
+ "falconPackageHash": "a02cedbcd193d7307a0fe5f9e71bf46bcad0d7f8520a23bffe6b321b"
52
52
  }
@@ -1519,7 +1519,9 @@ declare enum DisplayValueEnumDisplayValue {
1519
1519
  listItem = "listItem"
1520
1520
  }
1521
1521
 
1522
- export declare type EditorElement = EditorElement_2 & Required<Pick<EditorElement_2, 'selector' | 'displayName'>>;
1522
+ export declare type EditorElement = EditorElement_2 & RequiredFields<EditorElement_2, 'selector' | 'displayName'> & {
1523
+ presets: Record<string, PresetItem & RequiredFields<PresetItem, 'displayName'>>;
1524
+ };
1523
1525
 
1524
1526
  declare interface EditorElement_2 {
1525
1527
  /**
@@ -2603,6 +2605,8 @@ declare interface RefInnerElementDefaults {
2603
2605
  cssCustomProperties?: Record<string, CssPropertyItemDefaults>;
2604
2606
  }
2605
2607
 
2608
+ declare type RequiredFields<T, K extends keyof T> = Required<Pick<T, K>>;
2609
+
2606
2610
  declare enum ResizeDirection {
2607
2611
  /** Default value when direction is not specified */
2608
2612
  UNKNOWN_ResizeDirection = "UNKNOWN_ResizeDirection",
package/src/index.ts CHANGED
@@ -83,7 +83,12 @@ export type {
83
83
  ListItem,
84
84
  } from '@wix/component-protocol/schema'
85
85
 
86
- import type { EditorElement as RawEditorElement } from '@wix/component-protocol/schema'
86
+ import type { PresetItem, EditorElement as RawEditorElement } from '@wix/component-protocol/schema'
87
+
88
+ type RequiredFields<T, K extends keyof T> = Required<Pick<T, K>>
87
89
 
88
90
  // make selector and displayName required to be consistant with headless-integration repo
89
- export type EditorElement = RawEditorElement & Required<Pick<RawEditorElement, 'selector' | 'displayName'>>
91
+ export type EditorElement = RawEditorElement &
92
+ RequiredFields<RawEditorElement, 'selector' | 'displayName'> & {
93
+ presets: Record<string, PresetItem & RequiredFields<PresetItem, 'displayName'>>
94
+ }