@weaverse/core 0.7.18 → 0.7.20

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
@@ -99,7 +99,7 @@ interface ChildElement {
99
99
  label: string;
100
100
  selector: string;
101
101
  }
102
- declare type ParentType = 'container' | 'layout' | 'root' | 'product-details' | 'product-info' | 'collection.box' | 'collection-box' | 'article-box' | 'article-list' | 'slider' | 'tab' | 'accordion' | 'accordion.wrapper';
102
+ declare type ParentType = "container" | "layout" | "root" | "product-details" | "product-info" | "collection.box" | "collection-box" | "article-box" | "article-list" | "slider" | "tab" | "accordion" | "accordion.wrapper";
103
103
  declare type GridSize = {
104
104
  rowSpan: number;
105
105
  colSpan: number;
@@ -145,40 +145,27 @@ interface BasicGroup {
145
145
  inputs: BasicInput[];
146
146
  }
147
147
  declare type AdvancedGroupType = "border" | "alignment" | "background" | "dimensions" | "spacing" | "typography" | "visibility" | "shadows-and-effects";
148
- interface BasicInput {
148
+ interface BasicInput<ConfigsType = AdditionalInputConfigs> {
149
149
  type: InputType;
150
150
  label?: string;
151
151
  binding?: "style" | "data";
152
152
  /**
153
- * The key of the value in the element data or css
153
+ * The key of the value in 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"
154
159
  */
155
160
  name?: string;
156
- defaultValue?: string | number | boolean;
157
- placeholder?: string;
158
- helpText?: string;
159
- /**
160
- * For `select` or `toggle-group` input
161
- */
162
- options?: {
163
- value: string;
164
- label: string;
165
- icon?: string;
166
- weight?: string;
167
- }[];
168
- /**
169
- * For `range` input
170
- */
171
- min?: number;
172
- max?: number;
173
- step?: number;
174
161
  /**
175
- * For `sortable` input
162
+ * Additional options for inputs that require more configuration
176
163
  */
177
- visibleType?: boolean;
164
+ configs?: ConfigsType;
178
165
  /**
179
166
  * Only display if condition matches.
180
167
  *
181
- * Format: `bindingName.conditionalOperator.value`
168
+ * Format: `dataBindingKey.conditionalOperator.value`
182
169
  *
183
170
  * Supported operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`
184
171
  *
@@ -188,19 +175,38 @@ interface BasicInput {
188
175
  * `imagesPerRow.gt.1`
189
176
  */
190
177
  condition?: string;
191
- default?: string | number | boolean;
178
+ defaultValue?: string | number | boolean;
179
+ placeholder?: string;
180
+ }
181
+ declare type AdditionalInputConfigs = SelectInputConfigs | ToggleGroupConfigs | RangeInputConfigs | SortableInputConfigs;
182
+ interface SelectInputConfigs {
183
+ options?: {
184
+ value: string;
185
+ label: string;
186
+ icon?: string;
187
+ weight?: string;
188
+ }[];
189
+ }
190
+ interface ToggleGroupConfigs {
191
+ options?: {
192
+ value: string;
193
+ label: string;
194
+ icon?: string;
195
+ weight?: string;
196
+ }[];
197
+ }
198
+ interface RangeInputConfigs {
199
+ min?: number;
200
+ max?: number;
201
+ step?: number;
202
+ }
203
+ interface SortableInputConfigs {
204
+ visibleType?: boolean;
192
205
  }
193
- declare type InputType = 'color' | 'datepicker' | 'image' | 'range' | 'select' | 'sortable' | 'switch' | 'text' | 'textarea' | 'toggle-group' | 'form' | 'product' | 'product-swatches' | 'custom.html' | 'instagram' | 'collection-list' | 'collection' | 'article-list';
206
+ declare type InputType = "color" | "datepicker" | "image" | "range" | "select" | "sortable" | "switch" | "text" | "textarea" | "toggle-group" | "form" | "product" | "product-swatches" | "custom.html" | "instagram" | "collection-list" | "collection" | "article-list";
194
207
  declare global {
195
208
  interface Window {
196
209
  WeaverseStudioBridge: any;
197
- weaverseShopifyConfigs: any;
198
- weaverseShopifyProducts: any;
199
- weaverseShopifyProductsByCollection: any;
200
- weaverseShopifyCollections: any;
201
- weaverseShopifyArticles: any;
202
- weaverseShopifyBlogs: any;
203
- weaverseCartHelpers: any;
204
210
  Blinkloader: any;
205
211
  }
206
212
  }
@@ -328,4 +334,4 @@ declare class Weaverse {
328
334
  initProjectItemData(): void;
329
335
  }
330
336
 
331
- export { AdvancedGroup, AdvancedGroupType, BasicGroup, BasicInput, BreakPoints, CatalogGroup, ChildElement, ChildElementCSS, ElementCSS, ElementCatalog, ElementData, ElementDataInCatalog, ElementFlags, ElementInspector, ElementSchema, FlagType, GridSize, InitializeData, InputType, ParentType, ProjectDataType, ToolbarAction, Weaverse, WeaverseCSSProperties, WeaverseElement, WeaverseItemStore, WeaverseType, createGlobalStyles, isBrowser, isIframe, isReactNative, loadScript, stichesUtils };
337
+ export { AdditionalInputConfigs, AdvancedGroup, AdvancedGroupType, BasicGroup, BasicInput, BreakPoints, CatalogGroup, ChildElement, ChildElementCSS, ElementCSS, ElementCatalog, ElementData, ElementDataInCatalog, ElementFlags, ElementInspector, ElementSchema, FlagType, GridSize, InitializeData, InputType, ParentType, ProjectDataType, RangeInputConfigs, SelectInputConfigs, SortableInputConfigs, ToggleGroupConfigs, ToolbarAction, Weaverse, WeaverseCSSProperties, WeaverseElement, WeaverseItemStore, WeaverseType, createGlobalStyles, isBrowser, isIframe, isReactNative, loadScript, stichesUtils };
package/dist/index.js CHANGED
@@ -96,13 +96,32 @@ function createGlobalStyles(stitches2) {
96
96
  from: { transform: "rotate(0deg)" },
97
97
  to: { transform: "rotate(360deg)" }
98
98
  },
99
- input: {
100
- "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
101
- "-webkit-appearance": "none",
102
- margin: 0
99
+ ".weaverse-content-root": {
100
+ input: {
101
+ "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
102
+ "-webkit-appearance": "none",
103
+ margin: 0
104
+ },
105
+ "&[type=number]": {
106
+ "-moz-appearance": "textfield"
107
+ }
103
108
  },
104
- "&[type=number]": {
105
- "-moz-appearance": "textfield"
109
+ select: {
110
+ WebkitAppearance: "none",
111
+ MozAppearance: "none",
112
+ appearance: "none",
113
+ outline: "none",
114
+ boxShadow: "none",
115
+ color: "currentColor",
116
+ verticalAlign: "middle",
117
+ backgroundPosition: "center",
118
+ backgroundRepeat: "no-repeat",
119
+ backgroundImage: "url(https://ucarecdn.com/4bb6a6e7-1ce8-4201-8f2d-da00a50105f3/ardown.svg)",
120
+ backgroundSize: "10px",
121
+ backgroundPositionX: "calc(100% - 12px)",
122
+ paddingLeft: "12px",
123
+ paddingRight: "35px !important",
124
+ cursor: "pointer"
106
125
  }
107
126
  },
108
127
  ".wv-spinner-wrapper": {
package/dist/index.mjs CHANGED
@@ -57,13 +57,32 @@ function createGlobalStyles(stitches2) {
57
57
  from: { transform: "rotate(0deg)" },
58
58
  to: { transform: "rotate(360deg)" }
59
59
  },
60
- input: {
61
- "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
62
- "-webkit-appearance": "none",
63
- margin: 0
60
+ ".weaverse-content-root": {
61
+ input: {
62
+ "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
63
+ "-webkit-appearance": "none",
64
+ margin: 0
65
+ },
66
+ "&[type=number]": {
67
+ "-moz-appearance": "textfield"
68
+ }
64
69
  },
65
- "&[type=number]": {
66
- "-moz-appearance": "textfield"
70
+ select: {
71
+ WebkitAppearance: "none",
72
+ MozAppearance: "none",
73
+ appearance: "none",
74
+ outline: "none",
75
+ boxShadow: "none",
76
+ color: "currentColor",
77
+ verticalAlign: "middle",
78
+ backgroundPosition: "center",
79
+ backgroundRepeat: "no-repeat",
80
+ backgroundImage: "url(https://ucarecdn.com/4bb6a6e7-1ce8-4201-8f2d-da00a50105f3/ardown.svg)",
81
+ backgroundSize: "10px",
82
+ backgroundPositionX: "calc(100% - 12px)",
83
+ paddingLeft: "12px",
84
+ paddingRight: "35px !important",
85
+ cursor: "pointer"
67
86
  }
68
87
  },
69
88
  ".wv-spinner-wrapper": {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.18",
2
+ "version": "0.7.20",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",