@weaverse/core 0.7.60 → 0.7.62
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 +3 -13
- package/dist/index.js +2 -19
- package/dist/index.mjs +2 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -61,14 +61,6 @@ interface ProjectDataType {
|
|
|
61
61
|
};
|
|
62
62
|
pageId?: string;
|
|
63
63
|
}
|
|
64
|
-
interface InitializeData {
|
|
65
|
-
id: string;
|
|
66
|
-
handle: string;
|
|
67
|
-
data: ProjectDataType;
|
|
68
|
-
published: boolean;
|
|
69
|
-
projectKey?: string;
|
|
70
|
-
studioUrl?: string;
|
|
71
|
-
}
|
|
72
64
|
interface BreakPoints {
|
|
73
65
|
mobile: string;
|
|
74
66
|
desktop: string;
|
|
@@ -110,7 +102,7 @@ type GridSize = {
|
|
|
110
102
|
rowSpan: number;
|
|
111
103
|
colSpan: number;
|
|
112
104
|
};
|
|
113
|
-
type ToolbarAction = "general-settings" | "edit-text" | "duplicate" | "delete" | "copy-styles" | "paste-styles" | "move-up" | "move-down" | "toggle-visibility" | "more-actions";
|
|
105
|
+
type ToolbarAction = "general-settings" | "settings-level-2" | "edit-text" | "duplicate" | "delete" | "copy-styles" | "paste-styles" | "move-up" | "move-down" | "toggle-visibility" | "more-actions";
|
|
114
106
|
interface ElementSchema {
|
|
115
107
|
title: string;
|
|
116
108
|
type: string;
|
|
@@ -321,9 +313,7 @@ declare class Weaverse {
|
|
|
321
313
|
*/
|
|
322
314
|
constructor({ appUrl, projectKey, projectData, mediaBreakPoints, isDesignMode, ssrMode }?: WeaverseType);
|
|
323
315
|
init({ appUrl, projectKey, projectData, mediaBreakPoints, isDesignMode, ssrMode }?: WeaverseType): void;
|
|
324
|
-
|
|
325
|
-
initializeData: (data: InitializeData) => void;
|
|
326
|
-
loadStudio(): void;
|
|
316
|
+
loadStudio(version: string): void;
|
|
327
317
|
/**
|
|
328
318
|
* Register the custom React Component to Weaverse, store it into Weaverse.elementInstances
|
|
329
319
|
* @param element {WeaverseElement} custom React Component
|
|
@@ -348,4 +338,4 @@ declare class Weaverse {
|
|
|
348
338
|
initProjectItemData(): void;
|
|
349
339
|
}
|
|
350
340
|
|
|
351
|
-
export { AdditionalInputConfigs, AdvancedGroup, AdvancedGroupType, BasicGroup, BasicInput, BreakPoints, CatalogGroup, ChildElement, ChildElementCSS, ChildElementSelector, ElementCSS, ElementCatalog, ElementData, ElementDataInCatalog, ElementFlags, ElementInspector, ElementSchema, FlagType, GridSize,
|
|
341
|
+
export { AdditionalInputConfigs, AdvancedGroup, AdvancedGroupType, BasicGroup, BasicInput, BreakPoints, CatalogGroup, ChildElement, ChildElementCSS, ChildElementSelector, ElementCSS, ElementCatalog, ElementData, ElementDataInCatalog, ElementFlags, ElementInspector, ElementSchema, FlagType, GridSize, InputType, ParentType, ProjectDataType, RangeInputConfigs, SelectInputConfigs, SortableInputConfigs, SortableItemAction, ToggleGroupConfigs, ToolbarAction, Weaverse, WeaverseCSSProperties, WeaverseElement, WeaverseItemStore, WeaverseType, isBrowser, isIframe, isReactNative, merge, stichesUtils };
|
package/dist/index.js
CHANGED
|
@@ -165,22 +165,6 @@ var Weaverse = class {
|
|
|
165
165
|
desktop: "all",
|
|
166
166
|
mobile: "(max-width: 767.98px)"
|
|
167
167
|
};
|
|
168
|
-
this.initialized = false;
|
|
169
|
-
this.initializeData = (data) => {
|
|
170
|
-
if (!this.initialized) {
|
|
171
|
-
let { data: pageData, published, id, projectKey, studioUrl } = data;
|
|
172
|
-
this.projectKey = projectKey || this.projectKey;
|
|
173
|
-
this.appUrl = studioUrl || this.appUrl;
|
|
174
|
-
this.projectData = { ...pageData, pageId: id };
|
|
175
|
-
this.isDesignMode = !published;
|
|
176
|
-
this.initProjectItemData();
|
|
177
|
-
if (this.isDesignMode) {
|
|
178
|
-
this.triggerUpdate();
|
|
179
|
-
this.loadStudio();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
this.initialized = true;
|
|
183
|
-
};
|
|
184
168
|
this.initStitches = () => {
|
|
185
169
|
this.stitchesInstance = this.stitchesInstance || stitches.createStitches({
|
|
186
170
|
prefix: "weaverse",
|
|
@@ -200,7 +184,7 @@ var Weaverse = class {
|
|
|
200
184
|
this.initStitches();
|
|
201
185
|
this.initProjectItemData();
|
|
202
186
|
}
|
|
203
|
-
loadStudio() {
|
|
187
|
+
loadStudio(version) {
|
|
204
188
|
setTimeout(() => {
|
|
205
189
|
if (isIframe && this.isDesignMode && !this.studioBridge) {
|
|
206
190
|
const initStudio = () => {
|
|
@@ -209,8 +193,7 @@ var Weaverse = class {
|
|
|
209
193
|
};
|
|
210
194
|
if (!window.WeaverseStudioBridge) {
|
|
211
195
|
let studioBridgeScript = document.createElement("script");
|
|
212
|
-
|
|
213
|
-
studioBridgeScript.src = `${this.appUrl}/assets/studio/studio-bridge.js?t=${timeStamp}`;
|
|
196
|
+
studioBridgeScript.src = `${this.appUrl}/assets/studio/studio-bridge.js?v=${version}`;
|
|
214
197
|
studioBridgeScript.type = "module";
|
|
215
198
|
studioBridgeScript.onload = initStudio;
|
|
216
199
|
document.body.appendChild(studioBridgeScript);
|
package/dist/index.mjs
CHANGED
|
@@ -127,22 +127,6 @@ var Weaverse = class {
|
|
|
127
127
|
desktop: "all",
|
|
128
128
|
mobile: "(max-width: 767.98px)"
|
|
129
129
|
};
|
|
130
|
-
this.initialized = false;
|
|
131
|
-
this.initializeData = (data) => {
|
|
132
|
-
if (!this.initialized) {
|
|
133
|
-
let { data: pageData, published, id, projectKey, studioUrl } = data;
|
|
134
|
-
this.projectKey = projectKey || this.projectKey;
|
|
135
|
-
this.appUrl = studioUrl || this.appUrl;
|
|
136
|
-
this.projectData = { ...pageData, pageId: id };
|
|
137
|
-
this.isDesignMode = !published;
|
|
138
|
-
this.initProjectItemData();
|
|
139
|
-
if (this.isDesignMode) {
|
|
140
|
-
this.triggerUpdate();
|
|
141
|
-
this.loadStudio();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
this.initialized = true;
|
|
145
|
-
};
|
|
146
130
|
this.initStitches = () => {
|
|
147
131
|
this.stitchesInstance = this.stitchesInstance || stitches.createStitches({
|
|
148
132
|
prefix: "weaverse",
|
|
@@ -162,7 +146,7 @@ var Weaverse = class {
|
|
|
162
146
|
this.initStitches();
|
|
163
147
|
this.initProjectItemData();
|
|
164
148
|
}
|
|
165
|
-
loadStudio() {
|
|
149
|
+
loadStudio(version) {
|
|
166
150
|
setTimeout(() => {
|
|
167
151
|
if (isIframe && this.isDesignMode && !this.studioBridge) {
|
|
168
152
|
const initStudio = () => {
|
|
@@ -171,8 +155,7 @@ var Weaverse = class {
|
|
|
171
155
|
};
|
|
172
156
|
if (!window.WeaverseStudioBridge) {
|
|
173
157
|
let studioBridgeScript = document.createElement("script");
|
|
174
|
-
|
|
175
|
-
studioBridgeScript.src = `${this.appUrl}/assets/studio/studio-bridge.js?t=${timeStamp}`;
|
|
158
|
+
studioBridgeScript.src = `${this.appUrl}/assets/studio/studio-bridge.js?v=${version}`;
|
|
176
159
|
studioBridgeScript.type = "module";
|
|
177
160
|
studioBridgeScript.onload = initStudio;
|
|
178
161
|
document.body.appendChild(studioBridgeScript);
|
package/package.json
CHANGED