@weaverse/core 0.7.10 → 0.7.12

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
@@ -46,7 +46,6 @@ declare const isReactNative: boolean;
46
46
  declare const isBrowser: boolean;
47
47
  declare const isIframe: boolean;
48
48
 
49
- declare type TODO = any;
50
49
  interface ProjectDataType {
51
50
  items: ElementData[];
52
51
  rootId: string;
@@ -64,10 +63,10 @@ interface InitializeData {
64
63
  projectKey?: string;
65
64
  studioUrl?: string;
66
65
  }
67
- declare type BreakPoints = {
66
+ interface BreakPoints {
68
67
  mobile: string;
69
68
  desktop: string;
70
- };
69
+ }
71
70
  interface WeaverseType {
72
71
  mediaBreakPoints?: BreakPoints;
73
72
  appUrl?: string;
@@ -81,6 +80,7 @@ interface WeaverseElement {
81
80
  type: string;
82
81
  schema?: ElementSchema;
83
82
  defaultCss?: ElementCSS;
83
+ permanentCss?: ElementCSS;
84
84
  }
85
85
  interface ElementsMap {
86
86
  [key: string]: WeaverseElement;
@@ -94,16 +94,16 @@ interface ElementCatalog {
94
94
  }
95
95
  declare type FlagType = "draggable" | "resizable" | "sortable" | "droppable" | "deletable" | "duplicable";
96
96
  declare type ElementFlags = Partial<Record<FlagType, boolean>>;
97
- declare type ToolbarAction = "duplicate" | "delete" | "copy-styles" | "paste-styles";
98
97
  interface ChildElement {
99
98
  label: string;
100
99
  selector: string;
101
100
  }
102
- declare type ParentType = "container" | "layout" | "root";
101
+ declare type ParentType = "container" | "layout" | "root" | "product.content";
103
102
  declare type GridSize = {
104
103
  rowSpan: number;
105
104
  colSpan: number;
106
105
  };
106
+ declare type ToolbarAction = "duplicate" | "delete" | "copy-styles" | "paste-styles";
107
107
  interface ElementSchema {
108
108
  title: string;
109
109
  type: string;
@@ -134,18 +134,21 @@ interface ElementInspector {
134
134
  settings?: (AdvancedGroup | BasicGroup)[];
135
135
  styles?: (AdvancedGroup | BasicGroup)[];
136
136
  }
137
- declare type AdvancedGroup = {
138
- type: AdvancedInput;
139
- };
140
- declare type BasicGroup = {
141
- type: "basic";
142
- label: string;
137
+ interface AdvancedGroup {
138
+ groupType: AdvancedGroupType;
139
+ }
140
+ interface BasicGroup {
141
+ groupType: "basic";
142
+ groupHeader: string;
143
143
  inputs: BasicInput[];
144
- };
145
- declare type AdvancedInput = "border" | "alignment" | "background" | "dimensions" | "spacing" | "visibility";
144
+ }
145
+ declare type AdvancedGroupType = "border" | "alignment" | "background" | "dimensions" | "spacing" | "typography" | "visibility";
146
146
  interface BasicInput {
147
147
  type: InputType;
148
148
  label: string;
149
+ /**
150
+ * The key of the value in the element data or css
151
+ */
149
152
  name: string;
150
153
  defaultValue?: string;
151
154
  placeholder?: string;
@@ -165,6 +168,10 @@ interface BasicInput {
165
168
  min?: number;
166
169
  max?: number;
167
170
  step?: number;
171
+ /**
172
+ * For `sortable` input
173
+ */
174
+ visibleType?: boolean;
168
175
  /**
169
176
  * Only display if condition matches.
170
177
  *
@@ -182,9 +189,8 @@ interface BasicInput {
182
189
  declare type InputType = "color" | "datepicker" | "image" | "range" | "select" | "sortable" | "switch" | "text" | "textarea" | "toggle-group" | "form" | "product" | "custom.html" | "instagram";
183
190
  declare global {
184
191
  interface Window {
185
- WeaverseStudioBridge: TODO;
186
- weaverseShopifyProducts: TODO;
187
- weaverseGlobalSettings: TODO;
192
+ WeaverseStudioBridge: any;
193
+ weaverseShopifyProducts: any;
188
194
  }
189
195
  }
190
196
 
@@ -314,4 +320,4 @@ declare class Weaverse {
314
320
  initProjectItemData(): void;
315
321
  }
316
322
 
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 };
323
+ export { AdvancedGroup, AdvancedGroupType, BasicGroup, BasicInput, BreakPoints, CatalogGroup, ChildElement, ChildElementCSS, ElementCSS, ElementCatalog, ElementData, ElementFlags, ElementInspector, ElementSchema, ElementsMap, FlagType, GridSize, InitializeData, InputType, ParentType, ProjectDataType, ToolbarAction, Weaverse, WeaverseCSSProperties, WeaverseElement, WeaverseItemStore, WeaverseType, isBrowser, isIframe, isReactNative, loadScript, stichesUtils };
package/dist/index.js CHANGED
@@ -142,7 +142,9 @@ var WeaverseItemStore = class {
142
142
  }
143
143
  get data() {
144
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 };
145
+ let css = (_a = this.Element) == null ? void 0 : _a.defaultCss;
146
+ let defaultData = { ...(_c = (_b = this.Element) == null ? void 0 : _b.Component) == null ? void 0 : _c.defaultProps, ...css && { css } };
147
+ return { ...defaultData, ...this._data };
146
148
  }
147
149
  };
148
150
  var Weaverse = class {
package/dist/index.mjs CHANGED
@@ -104,7 +104,9 @@ var WeaverseItemStore = class {
104
104
  }
105
105
  get data() {
106
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 };
107
+ let css = (_a = this.Element) == null ? void 0 : _a.defaultCss;
108
+ let defaultData = { ...(_c = (_b = this.Element) == null ? void 0 : _b.Component) == null ? void 0 : _c.defaultProps, ...css && { css } };
109
+ return { ...defaultData, ...this._data };
108
110
  }
109
111
  };
110
112
  var Weaverse = class {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.10",
2
+ "version": "0.7.12",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",