@weaverse/core 0.7.19 → 0.7.21
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 +40 -26
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -144,41 +144,28 @@ interface BasicGroup {
|
|
|
144
144
|
groupHeader: string;
|
|
145
145
|
inputs: BasicInput[];
|
|
146
146
|
}
|
|
147
|
-
declare type AdvancedGroupType = "border" | "alignment" | "background" | "dimensions" | "spacing" | "typography" | "visibility" | "shadows-and-effects";
|
|
148
|
-
interface BasicInput {
|
|
147
|
+
declare type AdvancedGroupType = "border" | "alignment" | "background" | "dimensions" | "spacing" | "typography" | "visibility" | "shadows-and-effects" | "layoutBackground";
|
|
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
|
|
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"
|
|
154
159
|
*/
|
|
155
160
|
name?: string;
|
|
156
|
-
defaultValue?: string | number | boolean;
|
|
157
|
-
placeholder?: string;
|
|
158
|
-
helpText?: string;
|
|
159
161
|
/**
|
|
160
|
-
*
|
|
162
|
+
* Additional options for inputs that require more configuration
|
|
161
163
|
*/
|
|
162
|
-
|
|
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
|
-
/**
|
|
175
|
-
* For `sortable` input
|
|
176
|
-
*/
|
|
177
|
-
visibleType?: boolean;
|
|
164
|
+
configs?: ConfigsType;
|
|
178
165
|
/**
|
|
179
166
|
* Only display if condition matches.
|
|
180
167
|
*
|
|
181
|
-
* Format: `
|
|
168
|
+
* Format: `dataBindingKey.conditionalOperator.value`
|
|
182
169
|
*
|
|
183
170
|
* Supported operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`
|
|
184
171
|
*
|
|
@@ -188,7 +175,34 @@ interface BasicInput {
|
|
|
188
175
|
* `imagesPerRow.gt.1`
|
|
189
176
|
*/
|
|
190
177
|
condition?: string;
|
|
191
|
-
|
|
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
|
+
declare type SortableItemAction = "add" | "edit" | "duplicate" | "delete" | "toggle-visibility";
|
|
204
|
+
interface SortableInputConfigs {
|
|
205
|
+
actions: SortableItemAction[];
|
|
192
206
|
}
|
|
193
207
|
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
208
|
declare global {
|
|
@@ -321,4 +335,4 @@ declare class Weaverse {
|
|
|
321
335
|
initProjectItemData(): void;
|
|
322
336
|
}
|
|
323
337
|
|
|
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 };
|
|
338
|
+
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, SortableItemAction, ToggleGroupConfigs, ToolbarAction, Weaverse, WeaverseCSSProperties, WeaverseElement, WeaverseItemStore, WeaverseType, createGlobalStyles, isBrowser, isIframe, isReactNative, loadScript, stichesUtils };
|
package/package.json
CHANGED