@weaverse/core 1.0.1 → 1.0.3
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 +2 -4
- package/dist/index.js +26 -17
- package/dist/index.mjs +26 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -309,10 +309,8 @@ declare class Weaverse {
|
|
|
309
309
|
* @param elementSchemas {Array<ElementSchema>} List of element schemas
|
|
310
310
|
* @param platformType {PlatformTypeEnum} Check the platform, shopify-section or react-ssr(hydrogen)
|
|
311
311
|
*/
|
|
312
|
-
constructor({ weaverseHost, projectId, data, mediaBreakPoints, isDesignMode, ssrMode, elementSchemas, platformType }?: WeaverseType);
|
|
313
|
-
init({ weaverseHost, elementSchemas, platformType, projectId, data, mediaBreakPoints, isDesignMode, ssrMode }?: WeaverseType): void;
|
|
314
|
-
initialized: boolean;
|
|
315
|
-
initializeData: (data: any) => void;
|
|
312
|
+
constructor({ weaverseHost, projectId, data, mediaBreakPoints, isDesignMode, ssrMode, elementSchemas, platformType, }?: WeaverseType);
|
|
313
|
+
init({ weaverseHost, elementSchemas, platformType, projectId, data, mediaBreakPoints, isDesignMode, ssrMode, }?: WeaverseType): void;
|
|
316
314
|
loadStudio(version?: string): void;
|
|
317
315
|
/**
|
|
318
316
|
* Register the custom React Component to Weaverse, store it into Weaverse.elementInstances
|
package/dist/index.js
CHANGED
|
@@ -233,22 +233,6 @@ var Weaverse = class {
|
|
|
233
233
|
// tablet: "(max-width: 1023.98px)", // to set css for tablet, {'@tablet' : { // css }},
|
|
234
234
|
mobile: "(max-width: 767.98px)"
|
|
235
235
|
};
|
|
236
|
-
this.initialized = false;
|
|
237
|
-
this.initializeData = (data) => {
|
|
238
|
-
if (!this.initialized) {
|
|
239
|
-
let { data: d, isDesignMode, id, projectId, weaverseHost } = data;
|
|
240
|
-
this.projectId = projectId || this.projectId;
|
|
241
|
-
this.weaverseHost = weaverseHost || this.weaverseHost;
|
|
242
|
-
this.data = { ...d, pageId: id };
|
|
243
|
-
this.isDesignMode = isDesignMode;
|
|
244
|
-
this.initProjectItemData();
|
|
245
|
-
if (this.isDesignMode) {
|
|
246
|
-
this.triggerUpdate();
|
|
247
|
-
this.loadStudio();
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
this.initialized = true;
|
|
251
|
-
};
|
|
252
236
|
this.initStitches = () => {
|
|
253
237
|
this.stitchesInstance = this.stitchesInstance || stitches.createStitches({
|
|
254
238
|
prefix: "weaverse",
|
|
@@ -258,7 +242,16 @@ var Weaverse = class {
|
|
|
258
242
|
};
|
|
259
243
|
this.init({ weaverseHost, projectId, data, platformType, mediaBreakPoints, isDesignMode, ssrMode, elementSchemas });
|
|
260
244
|
}
|
|
261
|
-
init({
|
|
245
|
+
init({
|
|
246
|
+
weaverseHost,
|
|
247
|
+
elementSchemas,
|
|
248
|
+
platformType,
|
|
249
|
+
projectId,
|
|
250
|
+
data,
|
|
251
|
+
mediaBreakPoints,
|
|
252
|
+
isDesignMode,
|
|
253
|
+
ssrMode
|
|
254
|
+
} = {}) {
|
|
262
255
|
this.elementSchemas = elementSchemas || this.elementSchemas;
|
|
263
256
|
this.weaverseHost = weaverseHost || this.weaverseHost;
|
|
264
257
|
this.projectId = projectId || this.projectId;
|
|
@@ -270,6 +263,22 @@ var Weaverse = class {
|
|
|
270
263
|
this.initProjectItemData();
|
|
271
264
|
this.initStitches();
|
|
272
265
|
}
|
|
266
|
+
// initialized = false
|
|
267
|
+
// initializeData = (data: any) => {
|
|
268
|
+
// if (!this.initialized) {
|
|
269
|
+
// let { data: d, isDesignMode, id, projectId, weaverseHost } = data
|
|
270
|
+
// this.projectId = projectId || this.projectId
|
|
271
|
+
// this.weaverseHost = weaverseHost || this.weaverseHost
|
|
272
|
+
// this.data = { ...d, pageId: id }
|
|
273
|
+
// this.isDesignMode = isDesignMode
|
|
274
|
+
// this.initProjectItemData()
|
|
275
|
+
// if (this.isDesignMode) {
|
|
276
|
+
// this.triggerUpdate()
|
|
277
|
+
// this.loadStudio()
|
|
278
|
+
// }
|
|
279
|
+
// }
|
|
280
|
+
// this.initialized = true
|
|
281
|
+
// }
|
|
273
282
|
loadStudio(version) {
|
|
274
283
|
if (isIframe && this.isDesignMode && !this.studioBridge) {
|
|
275
284
|
const initStudio = () => {
|
package/dist/index.mjs
CHANGED
|
@@ -192,22 +192,6 @@ var Weaverse = class {
|
|
|
192
192
|
// tablet: "(max-width: 1023.98px)", // to set css for tablet, {'@tablet' : { // css }},
|
|
193
193
|
mobile: "(max-width: 767.98px)"
|
|
194
194
|
};
|
|
195
|
-
this.initialized = false;
|
|
196
|
-
this.initializeData = (data) => {
|
|
197
|
-
if (!this.initialized) {
|
|
198
|
-
let { data: d, isDesignMode, id, projectId, weaverseHost } = data;
|
|
199
|
-
this.projectId = projectId || this.projectId;
|
|
200
|
-
this.weaverseHost = weaverseHost || this.weaverseHost;
|
|
201
|
-
this.data = { ...d, pageId: id };
|
|
202
|
-
this.isDesignMode = isDesignMode;
|
|
203
|
-
this.initProjectItemData();
|
|
204
|
-
if (this.isDesignMode) {
|
|
205
|
-
this.triggerUpdate();
|
|
206
|
-
this.loadStudio();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
this.initialized = true;
|
|
210
|
-
};
|
|
211
195
|
this.initStitches = () => {
|
|
212
196
|
this.stitchesInstance = this.stitchesInstance || stitches.createStitches({
|
|
213
197
|
prefix: "weaverse",
|
|
@@ -217,7 +201,16 @@ var Weaverse = class {
|
|
|
217
201
|
};
|
|
218
202
|
this.init({ weaverseHost, projectId, data, platformType, mediaBreakPoints, isDesignMode, ssrMode, elementSchemas });
|
|
219
203
|
}
|
|
220
|
-
init({
|
|
204
|
+
init({
|
|
205
|
+
weaverseHost,
|
|
206
|
+
elementSchemas,
|
|
207
|
+
platformType,
|
|
208
|
+
projectId,
|
|
209
|
+
data,
|
|
210
|
+
mediaBreakPoints,
|
|
211
|
+
isDesignMode,
|
|
212
|
+
ssrMode
|
|
213
|
+
} = {}) {
|
|
221
214
|
this.elementSchemas = elementSchemas || this.elementSchemas;
|
|
222
215
|
this.weaverseHost = weaverseHost || this.weaverseHost;
|
|
223
216
|
this.projectId = projectId || this.projectId;
|
|
@@ -229,6 +222,22 @@ var Weaverse = class {
|
|
|
229
222
|
this.initProjectItemData();
|
|
230
223
|
this.initStitches();
|
|
231
224
|
}
|
|
225
|
+
// initialized = false
|
|
226
|
+
// initializeData = (data: any) => {
|
|
227
|
+
// if (!this.initialized) {
|
|
228
|
+
// let { data: d, isDesignMode, id, projectId, weaverseHost } = data
|
|
229
|
+
// this.projectId = projectId || this.projectId
|
|
230
|
+
// this.weaverseHost = weaverseHost || this.weaverseHost
|
|
231
|
+
// this.data = { ...d, pageId: id }
|
|
232
|
+
// this.isDesignMode = isDesignMode
|
|
233
|
+
// this.initProjectItemData()
|
|
234
|
+
// if (this.isDesignMode) {
|
|
235
|
+
// this.triggerUpdate()
|
|
236
|
+
// this.loadStudio()
|
|
237
|
+
// }
|
|
238
|
+
// }
|
|
239
|
+
// this.initialized = true
|
|
240
|
+
// }
|
|
232
241
|
loadStudio(version) {
|
|
233
242
|
if (isIframe && this.isDesignMode && !this.studioBridge) {
|
|
234
243
|
const initStudio = () => {
|
package/package.json
CHANGED