@weaverse/core 0.7.15 → 0.7.17

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
@@ -4,7 +4,7 @@ import Stitches$1 from '@stitches/core/types/stitches';
4
4
 
5
5
  declare function loadScript(url: string): Promise<unknown>;
6
6
 
7
- declare const stichesUtils: {
7
+ declare let stichesUtils: {
8
8
  m: (value: string) => {
9
9
  margin: string;
10
10
  };
@@ -41,6 +41,7 @@ declare const stichesUtils: {
41
41
  paddingBottom: string;
42
42
  };
43
43
  };
44
+ declare function createGlobalStyles(stitches: Stitches$1): void;
44
45
 
45
46
  declare const isReactNative: boolean;
46
47
  declare const isBrowser: boolean;
@@ -82,28 +83,28 @@ interface WeaverseElement {
82
83
  defaultCss?: ElementCSS;
83
84
  permanentCss?: ElementCSS;
84
85
  }
85
- interface ElementsMap {
86
- [key: string]: WeaverseElement;
87
- }
88
- declare type CatalogGroup = "essential" | "composition" | "other";
86
+ declare type CatalogGroup = "essential" | "composition" | "shopify";
89
87
  interface ElementCatalog {
90
88
  name: string;
91
89
  icon?: string;
92
90
  group?: CatalogGroup;
93
- data?: ElementData[];
91
+ data?: ElementDataInCatalog[];
92
+ }
93
+ interface ElementDataInCatalog extends Omit<ElementData, "id"> {
94
+ id: string | number;
94
95
  }
95
- declare type FlagType = "draggable" | "resizable" | "sortable" | "droppable" | "ignoreShortcutKeys" | "hasContextMenu";
96
+ declare type FlagType = "draggable" | "resizable" | "sortable" | "ignoreShortcutKeys" | "hasContextMenu";
96
97
  declare type ElementFlags = Partial<Record<FlagType, boolean>>;
97
98
  interface ChildElement {
98
99
  label: string;
99
100
  selector: string;
100
101
  }
101
- declare type ParentType = "container" | "layout" | "root" | "product.content";
102
+ declare type ParentType = "container" | "layout" | "root" | "product-details" | "product-info";
102
103
  declare type GridSize = {
103
104
  rowSpan: number;
104
105
  colSpan: number;
105
106
  };
106
- declare type ToolbarAction = "duplicate" | "delete" | "copy-styles" | "paste-styles";
107
+ declare type ToolbarAction = "general-settings" | "edit-text" | "duplicate" | "delete" | "copy-styles" | "paste-styles" | "move-up" | "move-down" | "toggle-visibility";
107
108
  interface ElementSchema {
108
109
  title: string;
109
110
  type: string;
@@ -142,15 +143,16 @@ interface BasicGroup {
142
143
  groupHeader: string;
143
144
  inputs: BasicInput[];
144
145
  }
145
- declare type AdvancedGroupType = "border" | "alignment" | "background" | "dimensions" | "spacing" | "typography" | "visibility";
146
+ declare type AdvancedGroupType = "border" | "alignment" | "background" | "dimensions" | "spacing" | "typography" | "visibility" | "shadows-and-effects";
146
147
  interface BasicInput {
147
148
  type: InputType;
148
- label: string;
149
+ label?: string;
150
+ binding?: "style" | "data";
149
151
  /**
150
152
  * The key of the value in the element data or css
151
153
  */
152
- name: string;
153
- defaultValue?: string;
154
+ name?: string;
155
+ defaultValue?: string | number | boolean;
154
156
  placeholder?: string;
155
157
  helpText?: string;
156
158
  /**
@@ -186,11 +188,17 @@ interface BasicInput {
186
188
  */
187
189
  condition?: string;
188
190
  }
189
- declare type InputType = "color" | "datepicker" | "image" | "range" | "select" | "sortable" | "switch" | "text" | "textarea" | "toggle-group" | "form" | "product" | "custom.html" | "instagram";
191
+ declare type InputType = "color" | "datepicker" | "image" | "range" | "select" | "sortable" | "switch" | "text" | "textarea" | "toggle-group" | "form" | "product" | "product-swatches" | "custom.html" | "instagram";
190
192
  declare global {
191
193
  interface Window {
192
194
  WeaverseStudioBridge: any;
195
+ weaverseShopifyConfigs: any;
193
196
  weaverseShopifyProducts: any;
197
+ weaverseShopifyProductsByCollection: any;
198
+ weaverseShopifyCollections: any;
199
+ weaverseShopifyArticles: any;
200
+ weaverseShopifyBlogs: any;
201
+ weaverseCartHelpers: any;
194
202
  Blinkloader: any;
195
203
  }
196
204
  }
@@ -315,10 +323,7 @@ declare class Weaverse {
315
323
  projectKey?: string;
316
324
  }): any;
317
325
  setProjectData(projectData: ProjectDataType): void;
318
- /**
319
- * fetch and update the project data, then trigger update to re-render the WeaverseRoot
320
- */
321
326
  initProjectItemData(): void;
322
327
  }
323
328
 
324
- 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 };
329
+ 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 };
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ var src_exports = {};
28
28
  __export(src_exports, {
29
29
  Weaverse: () => Weaverse,
30
30
  WeaverseItemStore: () => WeaverseItemStore,
31
+ createGlobalStyles: () => createGlobalStyles,
31
32
  isBrowser: () => isBrowser,
32
33
  isIframe: () => isIframe,
33
34
  isReactNative: () => isReactNative,
@@ -89,6 +90,24 @@ var stichesUtils = {
89
90
  paddingBottom: value
90
91
  })
91
92
  };
93
+ function createGlobalStyles(stitches2) {
94
+ let globalStyles = stitches2.globalCss({
95
+ "@keyframes spin": {
96
+ from: { transform: "rotate(0deg)" },
97
+ to: { transform: "rotate(360deg)" }
98
+ },
99
+ input: {
100
+ "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
101
+ "-webkit-appearance": "none",
102
+ margin: 0
103
+ },
104
+ "&[type=number]": {
105
+ "-moz-appearance": "textfield"
106
+ }
107
+ }
108
+ });
109
+ globalStyles();
110
+ }
92
111
 
93
112
  // src/utils/index.ts
94
113
  var isReactNative = typeof navigator === "object" && navigator.product === "ReactNative";
@@ -187,6 +206,7 @@ var Weaverse = class {
187
206
  media: this.mediaBreakPoints,
188
207
  utils: stichesUtils
189
208
  });
209
+ createGlobalStyles(this.stitchesInstance);
190
210
  };
191
211
  this.init({ appUrl, projectKey, projectData, mediaBreakPoints, isDesignMode, ssrMode });
192
212
  }
@@ -266,6 +286,7 @@ Weaverse.WeaverseItemStore = WeaverseItemStore;
266
286
  0 && (module.exports = {
267
287
  Weaverse,
268
288
  WeaverseItemStore,
289
+ createGlobalStyles,
269
290
  isBrowser,
270
291
  isIframe,
271
292
  isReactNative,
package/dist/index.mjs CHANGED
@@ -51,6 +51,24 @@ var stichesUtils = {
51
51
  paddingBottom: value
52
52
  })
53
53
  };
54
+ function createGlobalStyles(stitches2) {
55
+ let globalStyles = stitches2.globalCss({
56
+ "@keyframes spin": {
57
+ from: { transform: "rotate(0deg)" },
58
+ to: { transform: "rotate(360deg)" }
59
+ },
60
+ input: {
61
+ "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
62
+ "-webkit-appearance": "none",
63
+ margin: 0
64
+ },
65
+ "&[type=number]": {
66
+ "-moz-appearance": "textfield"
67
+ }
68
+ }
69
+ });
70
+ globalStyles();
71
+ }
54
72
 
55
73
  // src/utils/index.ts
56
74
  var isReactNative = typeof navigator === "object" && navigator.product === "ReactNative";
@@ -149,6 +167,7 @@ var Weaverse = class {
149
167
  media: this.mediaBreakPoints,
150
168
  utils: stichesUtils
151
169
  });
170
+ createGlobalStyles(this.stitchesInstance);
152
171
  };
153
172
  this.init({ appUrl, projectKey, projectData, mediaBreakPoints, isDesignMode, ssrMode });
154
173
  }
@@ -227,6 +246,7 @@ Weaverse.WeaverseItemStore = WeaverseItemStore;
227
246
  export {
228
247
  Weaverse,
229
248
  WeaverseItemStore,
249
+ createGlobalStyles,
230
250
  isBrowser,
231
251
  isIframe,
232
252
  isReactNative,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.15",
2
+ "version": "0.7.17",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",