@weaverse/core 2.8.5 → 2.8.8

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.mts CHANGED
@@ -105,15 +105,52 @@ declare let stitchesUtils: {
105
105
  };
106
106
  };
107
107
 
108
- interface WeaverseProjectDataType {
109
- items: ElementData[];
110
- rootId: string;
108
+ type PlatformTypeEnum = 'shopify-section' | 'shopify-hydrogen' | 'nextjs';
109
+ type ToolbarAction = 'general-settings' | 'settings-level-2' | 'duplicate' | 'delete';
110
+ type AdvancedGroupType = 'border' | 'alignment' | 'background' | 'dimensions' | 'spacing' | 'typography' | 'visibility' | 'shadows-and-effects' | 'layout-background';
111
+ type PositionInputValue = 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right';
112
+ type InputType = 'blog' | 'collection' | 'collection-list' | 'color' | 'datepicker' | 'image' | 'map-autocomplete' | 'position' | 'product' | 'product-list' | 'range' | 'richtext' | 'select' | 'switch' | 'text' | 'textarea' | 'toggle-group' | 'swatches';
113
+ type WeaverseCSSProperties = stitches.CSS & Partial<Record<keyof typeof stitchesUtils, string | number>>;
114
+ type ChildElementCSS = Partial<{
115
+ [selector: string]: WeaverseCSSProperties & ChildElementCSS;
116
+ }>;
117
+ type WeaverseResourcePickerData = {
118
+ id: number;
119
+ handle: string;
120
+ };
121
+ type WeaverseImage = {
122
+ id: string;
123
+ url: string;
124
+ altText: string;
125
+ width: number;
126
+ height: number;
127
+ };
128
+ type AdditionalInputConfigs = SelectInputConfigs | ToggleGroupConfigs | RangeInputConfigs;
129
+ interface ElementCSS {
130
+ '@desktop'?: WeaverseCSSProperties | ChildElementCSS;
131
+ '@mobile'?: WeaverseCSSProperties | ChildElementCSS;
132
+ }
133
+ interface ElementData {
134
+ id: string;
135
+ type: string;
136
+ [key: string]: any;
137
+ }
138
+ interface WeaverseElement {
139
+ Component: ForwardRefExoticComponent<any>;
140
+ type: string;
141
+ }
142
+ interface ElementSchema {
143
+ title: string;
144
+ type: string;
111
145
  }
112
146
  interface BreakPoints {
113
147
  mobile: string;
114
148
  desktop: string;
115
149
  }
116
- type PlatformTypeEnum = 'shopify-section' | 'shopify-hydrogen' | 'nextjs';
150
+ interface WeaverseProjectDataType {
151
+ items: ElementData[];
152
+ rootId: string;
153
+ }
117
154
  interface WeaverseCoreParams {
118
155
  mediaBreakPoints?: BreakPoints;
119
156
  weaverseHost?: string;
@@ -124,57 +161,25 @@ interface WeaverseCoreParams {
124
161
  platformType?: PlatformTypeEnum;
125
162
  ItemConstructor: typeof WeaverseItemStore;
126
163
  }
127
- interface WeaverseElement {
128
- Component: ForwardRefExoticComponent<any>;
129
- type: string;
130
- }
131
- type ToolbarAction = 'general-settings' | 'settings-level-2' | 'duplicate' | 'delete';
132
- interface ElementSchema {
133
- title: string;
134
- type: string;
135
- }
136
- interface ElementData {
137
- id: string;
138
- type: string;
139
- [key: string]: any;
140
- }
141
- type WeaverseCSSProperties = stitches.CSS & Partial<Record<keyof typeof stitchesUtils, string | number>>;
142
- type ChildElementCSS = Partial<{
143
- [selector: string]: WeaverseCSSProperties & ChildElementCSS;
144
- }>;
145
- interface ElementCSS {
146
- '@desktop'?: WeaverseCSSProperties | ChildElementCSS;
147
- '@mobile'?: WeaverseCSSProperties | ChildElementCSS;
148
- }
149
- type AdvancedGroupType = 'border' | 'alignment' | 'background' | 'dimensions' | 'spacing' | 'typography' | 'visibility' | 'shadows-and-effects' | 'layout-background';
164
+ /**
165
+ * BasicInput interface
166
+ *
167
+ * @property {InputType} type - The type of the input
168
+ * @property {string} name - The key of the value of the element data or styles
169
+ * @property {string} [label] - The label of the input
170
+ * @property {ConfigsType} [configs] - Additional options for inputs that require more configuration
171
+ *
172
+ * @example
173
+ * // Bind to `element.data.title`
174
+ * name: "title"
175
+ * // Bind to `element.css["@desktop"].backgroundColor`
176
+ * name: "backgroundColor"
177
+ */
150
178
  interface BasicInput<ConfigsType = AdditionalInputConfigs> {
151
179
  type: InputType;
152
- /**
153
- * The key of the value of the element data or styles
154
- * @example
155
- * // Bind to `element.data.title`
156
- * name: "title"
157
- * // Bind to `element.css["@desktop"].backgroundColor`
158
- * name: "backgroundColor"
159
- */
160
180
  name: string;
161
181
  label?: string;
162
- /**
163
- * Additional options for inputs that require more configuration
164
- */
165
182
  configs?: ConfigsType;
166
- /**
167
- * Only display if condition matches.
168
- *
169
- * Format: `bindingName.conditionalOperator.value`
170
- *
171
- * Supported operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`
172
- *
173
- * @example
174
- * `clickAction.eq.openLink`
175
- * `clickAction.ne.openLink`
176
- * `imagesPerRow.gt.1`
177
- */
178
183
  condition?: string;
179
184
  defaultValue?: string | number | boolean | Partial<WeaverseImage> | {
180
185
  [x: string]: any;
@@ -182,18 +187,6 @@ interface BasicInput<ConfigsType = AdditionalInputConfigs> {
182
187
  placeholder?: string;
183
188
  helpText?: string;
184
189
  }
185
- type WeaverseResourcePickerData = {
186
- id: number;
187
- handle: string;
188
- };
189
- type WeaverseImage = {
190
- id: string;
191
- url: string;
192
- altText: string;
193
- width: number;
194
- height: number;
195
- };
196
- type AdditionalInputConfigs = SelectInputConfigs | ToggleGroupConfigs | RangeInputConfigs;
197
190
  interface SelectInputConfigs {
198
191
  options?: {
199
192
  value: string;
@@ -214,8 +207,6 @@ interface RangeInputConfigs {
214
207
  step?: number;
215
208
  unit?: string;
216
209
  }
217
- type PositionInputValue = 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right';
218
- type InputType = 'blog' | 'collection' | 'collection-list' | 'color' | 'datepicker' | 'image' | 'map-autocomplete' | 'position' | 'product' | 'product-list' | 'range' | 'richtext' | 'select' | 'switch' | 'text' | 'textarea' | 'toggle-group' | 'swatches';
219
210
  declare global {
220
211
  interface Window {
221
212
  weaverseStudio: any;
package/dist/index.d.ts CHANGED
@@ -105,15 +105,52 @@ declare let stitchesUtils: {
105
105
  };
106
106
  };
107
107
 
108
- interface WeaverseProjectDataType {
109
- items: ElementData[];
110
- rootId: string;
108
+ type PlatformTypeEnum = 'shopify-section' | 'shopify-hydrogen' | 'nextjs';
109
+ type ToolbarAction = 'general-settings' | 'settings-level-2' | 'duplicate' | 'delete';
110
+ type AdvancedGroupType = 'border' | 'alignment' | 'background' | 'dimensions' | 'spacing' | 'typography' | 'visibility' | 'shadows-and-effects' | 'layout-background';
111
+ type PositionInputValue = 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right';
112
+ type InputType = 'blog' | 'collection' | 'collection-list' | 'color' | 'datepicker' | 'image' | 'map-autocomplete' | 'position' | 'product' | 'product-list' | 'range' | 'richtext' | 'select' | 'switch' | 'text' | 'textarea' | 'toggle-group' | 'swatches';
113
+ type WeaverseCSSProperties = stitches.CSS & Partial<Record<keyof typeof stitchesUtils, string | number>>;
114
+ type ChildElementCSS = Partial<{
115
+ [selector: string]: WeaverseCSSProperties & ChildElementCSS;
116
+ }>;
117
+ type WeaverseResourcePickerData = {
118
+ id: number;
119
+ handle: string;
120
+ };
121
+ type WeaverseImage = {
122
+ id: string;
123
+ url: string;
124
+ altText: string;
125
+ width: number;
126
+ height: number;
127
+ };
128
+ type AdditionalInputConfigs = SelectInputConfigs | ToggleGroupConfigs | RangeInputConfigs;
129
+ interface ElementCSS {
130
+ '@desktop'?: WeaverseCSSProperties | ChildElementCSS;
131
+ '@mobile'?: WeaverseCSSProperties | ChildElementCSS;
132
+ }
133
+ interface ElementData {
134
+ id: string;
135
+ type: string;
136
+ [key: string]: any;
137
+ }
138
+ interface WeaverseElement {
139
+ Component: ForwardRefExoticComponent<any>;
140
+ type: string;
141
+ }
142
+ interface ElementSchema {
143
+ title: string;
144
+ type: string;
111
145
  }
112
146
  interface BreakPoints {
113
147
  mobile: string;
114
148
  desktop: string;
115
149
  }
116
- type PlatformTypeEnum = 'shopify-section' | 'shopify-hydrogen' | 'nextjs';
150
+ interface WeaverseProjectDataType {
151
+ items: ElementData[];
152
+ rootId: string;
153
+ }
117
154
  interface WeaverseCoreParams {
118
155
  mediaBreakPoints?: BreakPoints;
119
156
  weaverseHost?: string;
@@ -124,57 +161,25 @@ interface WeaverseCoreParams {
124
161
  platformType?: PlatformTypeEnum;
125
162
  ItemConstructor: typeof WeaverseItemStore;
126
163
  }
127
- interface WeaverseElement {
128
- Component: ForwardRefExoticComponent<any>;
129
- type: string;
130
- }
131
- type ToolbarAction = 'general-settings' | 'settings-level-2' | 'duplicate' | 'delete';
132
- interface ElementSchema {
133
- title: string;
134
- type: string;
135
- }
136
- interface ElementData {
137
- id: string;
138
- type: string;
139
- [key: string]: any;
140
- }
141
- type WeaverseCSSProperties = stitches.CSS & Partial<Record<keyof typeof stitchesUtils, string | number>>;
142
- type ChildElementCSS = Partial<{
143
- [selector: string]: WeaverseCSSProperties & ChildElementCSS;
144
- }>;
145
- interface ElementCSS {
146
- '@desktop'?: WeaverseCSSProperties | ChildElementCSS;
147
- '@mobile'?: WeaverseCSSProperties | ChildElementCSS;
148
- }
149
- type AdvancedGroupType = 'border' | 'alignment' | 'background' | 'dimensions' | 'spacing' | 'typography' | 'visibility' | 'shadows-and-effects' | 'layout-background';
164
+ /**
165
+ * BasicInput interface
166
+ *
167
+ * @property {InputType} type - The type of the input
168
+ * @property {string} name - The key of the value of the element data or styles
169
+ * @property {string} [label] - The label of the input
170
+ * @property {ConfigsType} [configs] - Additional options for inputs that require more configuration
171
+ *
172
+ * @example
173
+ * // Bind to `element.data.title`
174
+ * name: "title"
175
+ * // Bind to `element.css["@desktop"].backgroundColor`
176
+ * name: "backgroundColor"
177
+ */
150
178
  interface BasicInput<ConfigsType = AdditionalInputConfigs> {
151
179
  type: InputType;
152
- /**
153
- * The key of the value of the element data or styles
154
- * @example
155
- * // Bind to `element.data.title`
156
- * name: "title"
157
- * // Bind to `element.css["@desktop"].backgroundColor`
158
- * name: "backgroundColor"
159
- */
160
180
  name: string;
161
181
  label?: string;
162
- /**
163
- * Additional options for inputs that require more configuration
164
- */
165
182
  configs?: ConfigsType;
166
- /**
167
- * Only display if condition matches.
168
- *
169
- * Format: `bindingName.conditionalOperator.value`
170
- *
171
- * Supported operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`
172
- *
173
- * @example
174
- * `clickAction.eq.openLink`
175
- * `clickAction.ne.openLink`
176
- * `imagesPerRow.gt.1`
177
- */
178
183
  condition?: string;
179
184
  defaultValue?: string | number | boolean | Partial<WeaverseImage> | {
180
185
  [x: string]: any;
@@ -182,18 +187,6 @@ interface BasicInput<ConfigsType = AdditionalInputConfigs> {
182
187
  placeholder?: string;
183
188
  helpText?: string;
184
189
  }
185
- type WeaverseResourcePickerData = {
186
- id: number;
187
- handle: string;
188
- };
189
- type WeaverseImage = {
190
- id: string;
191
- url: string;
192
- altText: string;
193
- width: number;
194
- height: number;
195
- };
196
- type AdditionalInputConfigs = SelectInputConfigs | ToggleGroupConfigs | RangeInputConfigs;
197
190
  interface SelectInputConfigs {
198
191
  options?: {
199
192
  value: string;
@@ -214,8 +207,6 @@ interface RangeInputConfigs {
214
207
  step?: number;
215
208
  unit?: string;
216
209
  }
217
- type PositionInputValue = 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right';
218
- type InputType = 'blog' | 'collection' | 'collection-list' | 'color' | 'datepicker' | 'image' | 'map-autocomplete' | 'position' | 'product' | 'product-list' | 'range' | 'richtext' | 'select' | 'switch' | 'text' | 'textarea' | 'toggle-group' | 'swatches';
219
210
  declare global {
220
211
  interface Window {
221
212
  weaverseStudio: any;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@weaverse/core",
3
3
  "author": "Weaverse Team",
4
4
  "description": "Weaverse Core",
5
- "version": "2.8.5",
5
+ "version": "2.8.8",
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",