@weaverse/core 0.7.7 → 0.7.10
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 +26 -11
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -76,14 +76,11 @@ interface WeaverseType {
|
|
|
76
76
|
isDesignMode?: boolean;
|
|
77
77
|
ssrMode?: boolean;
|
|
78
78
|
}
|
|
79
|
-
interface ElementComponentProps extends ElementData {
|
|
80
|
-
css: ElementCSS;
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}
|
|
83
79
|
interface WeaverseElement {
|
|
84
|
-
Component: ForwardRefExoticComponent<
|
|
80
|
+
Component: ForwardRefExoticComponent<any>;
|
|
85
81
|
type: string;
|
|
86
82
|
schema?: ElementSchema;
|
|
83
|
+
defaultCss?: ElementCSS;
|
|
87
84
|
}
|
|
88
85
|
interface ElementsMap {
|
|
89
86
|
[key: string]: WeaverseElement;
|
|
@@ -95,9 +92,9 @@ interface ElementCatalog {
|
|
|
95
92
|
group?: CatalogGroup;
|
|
96
93
|
data?: ElementData[];
|
|
97
94
|
}
|
|
98
|
-
declare type FlagType = "draggable" | "resizable" | "sortable" | "droppable";
|
|
95
|
+
declare type FlagType = "draggable" | "resizable" | "sortable" | "droppable" | "deletable" | "duplicable";
|
|
99
96
|
declare type ElementFlags = Partial<Record<FlagType, boolean>>;
|
|
100
|
-
declare type ToolbarAction = "duplicate" | "delete" | "
|
|
97
|
+
declare type ToolbarAction = "duplicate" | "delete" | "copy-styles" | "paste-styles";
|
|
101
98
|
interface ChildElement {
|
|
102
99
|
label: string;
|
|
103
100
|
selector: string;
|
|
@@ -145,7 +142,7 @@ declare type BasicGroup = {
|
|
|
145
142
|
label: string;
|
|
146
143
|
inputs: BasicInput[];
|
|
147
144
|
};
|
|
148
|
-
declare type AdvancedInput = "
|
|
145
|
+
declare type AdvancedInput = "border" | "alignment" | "background" | "dimensions" | "spacing" | "visibility";
|
|
149
146
|
interface BasicInput {
|
|
150
147
|
type: InputType;
|
|
151
148
|
label: string;
|
|
@@ -153,18 +150,36 @@ interface BasicInput {
|
|
|
153
150
|
defaultValue?: string;
|
|
154
151
|
placeholder?: string;
|
|
155
152
|
helpText?: string;
|
|
153
|
+
/**
|
|
154
|
+
* For `select` or `toggle-group` input
|
|
155
|
+
*/
|
|
156
156
|
options?: {
|
|
157
157
|
value: string;
|
|
158
158
|
label: string;
|
|
159
159
|
icon?: string;
|
|
160
160
|
weight?: string;
|
|
161
161
|
}[];
|
|
162
|
+
/**
|
|
163
|
+
* For `range` input
|
|
164
|
+
*/
|
|
162
165
|
min?: number;
|
|
163
166
|
max?: number;
|
|
164
167
|
step?: number;
|
|
165
|
-
|
|
168
|
+
/**
|
|
169
|
+
* Only display if condition matches.
|
|
170
|
+
*
|
|
171
|
+
* Format: `bindingName.conditionalOperator.value`
|
|
172
|
+
*
|
|
173
|
+
* Supported operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* `clickAction.eq.openLink`
|
|
177
|
+
* `clickAction.ne.openLink`
|
|
178
|
+
* `imagesPerRow.gt.1`
|
|
179
|
+
*/
|
|
180
|
+
condition?: string;
|
|
166
181
|
}
|
|
167
|
-
declare type InputType = "color" | "
|
|
182
|
+
declare type InputType = "color" | "datepicker" | "image" | "range" | "select" | "sortable" | "switch" | "text" | "textarea" | "toggle-group" | "form" | "product" | "custom.html" | "instagram";
|
|
168
183
|
declare global {
|
|
169
184
|
interface Window {
|
|
170
185
|
WeaverseStudioBridge: TODO;
|
|
@@ -299,4 +314,4 @@ declare class Weaverse {
|
|
|
299
314
|
initProjectItemData(): void;
|
|
300
315
|
}
|
|
301
316
|
|
|
302
|
-
export { AdvancedGroup, AdvancedInput, BasicGroup, BasicInput, BreakPoints, CatalogGroup, ChildElement, ChildElementCSS, ElementCSS, ElementCatalog,
|
|
317
|
+
export { AdvancedGroup, AdvancedInput, BasicGroup, BasicInput, BreakPoints, CatalogGroup, ChildElement, ChildElementCSS, ElementCSS, ElementCatalog, ElementData, ElementFlags, ElementInspector, ElementSchema, ElementsMap, FlagType, GridSize, InitializeData, InputType, ParentType, ProjectDataType, TODO, ToolbarAction, Weaverse, WeaverseCSSProperties, WeaverseElement, WeaverseItemStore, WeaverseType, isBrowser, isIframe, isReactNative, loadScript, stichesUtils };
|
package/dist/index.js
CHANGED
|
@@ -141,8 +141,8 @@ var WeaverseItemStore = class {
|
|
|
141
141
|
this._data = { ...this.data, ...data };
|
|
142
142
|
}
|
|
143
143
|
get data() {
|
|
144
|
-
var _a, _b;
|
|
145
|
-
return { ...(
|
|
144
|
+
var _a, _b, _c;
|
|
145
|
+
return { css: (_a = this.Element) == null ? void 0 : _a.defaultCss, ...(_c = (_b = this.Element) == null ? void 0 : _b.Component) == null ? void 0 : _c.defaultProps, ...this._data };
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
var Weaverse = class {
|
package/dist/index.mjs
CHANGED
|
@@ -103,8 +103,8 @@ var WeaverseItemStore = class {
|
|
|
103
103
|
this._data = { ...this.data, ...data };
|
|
104
104
|
}
|
|
105
105
|
get data() {
|
|
106
|
-
var _a, _b;
|
|
107
|
-
return { ...(
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
return { css: (_a = this.Element) == null ? void 0 : _a.defaultCss, ...(_c = (_b = this.Element) == null ? void 0 : _b.Component) == null ? void 0 : _c.defaultProps, ...this._data };
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
var Weaverse = class {
|
package/package.json
CHANGED