@weaverse/core 0.7.19 → 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.
Files changed (2) hide show
  1. package/dist/index.d.ts +38 -25
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -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,7 +175,33 @@ 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
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 {
@@ -321,4 +334,4 @@ declare class Weaverse {
321
334
  initProjectItemData(): void;
322
335
  }
323
336
 
324
- 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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.19",
2
+ "version": "0.7.20",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",