@weaverse/core 0.7.21 → 0.7.23

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
@@ -108,7 +108,7 @@ declare type ToolbarAction = "general-settings" | "edit-text" | "duplicate" | "d
108
108
  interface ElementSchema {
109
109
  title: string;
110
110
  type: string;
111
- parentType: ParentType;
111
+ parentTypes: ParentType[];
112
112
  gridSize?: GridSize;
113
113
  inspector?: ElementInspector;
114
114
  toolbar?: (ToolbarAction | ToolbarAction[])[];
@@ -144,7 +144,7 @@ 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" | "layoutBackground";
147
+ declare type AdvancedGroupType = "border" | "alignment" | "background" | "dimensions" | "spacing" | "typography" | "visibility" | "shadows-and-effects" | "layout-background";
148
148
  interface BasicInput<ConfigsType = AdditionalInputConfigs> {
149
149
  type: InputType;
150
150
  label?: string;
package/dist/index.js CHANGED
@@ -114,6 +114,7 @@ function createGlobalStyles(stitches2) {
114
114
  boxShadow: "none",
115
115
  color: "currentColor",
116
116
  verticalAlign: "middle",
117
+ backgroundColor: "transparent",
117
118
  backgroundPosition: "center",
118
119
  backgroundRepeat: "no-repeat",
119
120
  backgroundImage: "url(https://ucarecdn.com/4bb6a6e7-1ce8-4201-8f2d-da00a50105f3/ardown.svg)",
@@ -122,6 +123,16 @@ function createGlobalStyles(stitches2) {
122
123
  paddingLeft: "12px",
123
124
  paddingRight: "35px !important",
124
125
  cursor: "pointer"
126
+ },
127
+ button: {
128
+ outline: "none",
129
+ boxShadow: "none",
130
+ cursor: "pointer",
131
+ border: "none",
132
+ "&:focus": {
133
+ outline: "none",
134
+ boxShadow: "none"
135
+ }
125
136
  }
126
137
  },
127
138
  ".wv-spinner-wrapper": {
@@ -192,9 +203,8 @@ var WeaverseItemStore = class {
192
203
  this._data = { ...this.data, ...data };
193
204
  }
194
205
  get data() {
195
- var _a, _b, _c;
196
- let css = (_a = this.Element) == null ? void 0 : _a.defaultCss;
197
- let defaultData = { ...(_c = (_b = this.Element) == null ? void 0 : _b.Component) == null ? void 0 : _c.defaultProps, ...css && { css } };
206
+ let css = this.Element?.defaultCss;
207
+ let defaultData = { ...this.Element?.Component?.defaultProps, ...css && { css } };
198
208
  return { ...defaultData, ...this._data };
199
209
  }
200
210
  };
@@ -272,11 +282,11 @@ var Weaverse = class {
272
282
  }, 2e3);
273
283
  }
274
284
  registerElement(element) {
275
- if (element == null ? void 0 : element.type) {
285
+ if (element?.type) {
276
286
  if (this.elementInstances.has(element.type)) {
277
287
  throw new Error(`Weaverse: Element '${element.type}' already registered`);
278
288
  }
279
- this.elementInstances.set(element == null ? void 0 : element.type, element);
289
+ this.elementInstances.set(element?.type, element);
280
290
  } else {
281
291
  throw new Error("Weaverse: registerElement: `type` is required");
282
292
  }
@@ -304,7 +314,7 @@ var Weaverse = class {
304
314
  }
305
315
  initProjectItemData() {
306
316
  const data = this.projectData;
307
- if (data == null ? void 0 : data.items) {
317
+ if (data?.items) {
308
318
  data.items.forEach((item) => {
309
319
  if (!this.itemInstances.get(item.id)) {
310
320
  new WeaverseItemStore(item, this);
package/dist/index.mjs CHANGED
@@ -75,6 +75,7 @@ function createGlobalStyles(stitches2) {
75
75
  boxShadow: "none",
76
76
  color: "currentColor",
77
77
  verticalAlign: "middle",
78
+ backgroundColor: "transparent",
78
79
  backgroundPosition: "center",
79
80
  backgroundRepeat: "no-repeat",
80
81
  backgroundImage: "url(https://ucarecdn.com/4bb6a6e7-1ce8-4201-8f2d-da00a50105f3/ardown.svg)",
@@ -83,6 +84,16 @@ function createGlobalStyles(stitches2) {
83
84
  paddingLeft: "12px",
84
85
  paddingRight: "35px !important",
85
86
  cursor: "pointer"
87
+ },
88
+ button: {
89
+ outline: "none",
90
+ boxShadow: "none",
91
+ cursor: "pointer",
92
+ border: "none",
93
+ "&:focus": {
94
+ outline: "none",
95
+ boxShadow: "none"
96
+ }
86
97
  }
87
98
  },
88
99
  ".wv-spinner-wrapper": {
@@ -153,9 +164,8 @@ var WeaverseItemStore = class {
153
164
  this._data = { ...this.data, ...data };
154
165
  }
155
166
  get data() {
156
- var _a, _b, _c;
157
- let css = (_a = this.Element) == null ? void 0 : _a.defaultCss;
158
- let defaultData = { ...(_c = (_b = this.Element) == null ? void 0 : _b.Component) == null ? void 0 : _c.defaultProps, ...css && { css } };
167
+ let css = this.Element?.defaultCss;
168
+ let defaultData = { ...this.Element?.Component?.defaultProps, ...css && { css } };
159
169
  return { ...defaultData, ...this._data };
160
170
  }
161
171
  };
@@ -233,11 +243,11 @@ var Weaverse = class {
233
243
  }, 2e3);
234
244
  }
235
245
  registerElement(element) {
236
- if (element == null ? void 0 : element.type) {
246
+ if (element?.type) {
237
247
  if (this.elementInstances.has(element.type)) {
238
248
  throw new Error(`Weaverse: Element '${element.type}' already registered`);
239
249
  }
240
- this.elementInstances.set(element == null ? void 0 : element.type, element);
250
+ this.elementInstances.set(element?.type, element);
241
251
  } else {
242
252
  throw new Error("Weaverse: registerElement: `type` is required");
243
253
  }
@@ -265,7 +275,7 @@ var Weaverse = class {
265
275
  }
266
276
  initProjectItemData() {
267
277
  const data = this.projectData;
268
- if (data == null ? void 0 : data.items) {
278
+ if (data?.items) {
269
279
  data.items.forEach((item) => {
270
280
  if (!this.itemInstances.get(item.id)) {
271
281
  new WeaverseItemStore(item, this);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.21",
2
+ "version": "0.7.23",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",