@weaverse/core 5.8.3 → 5.8.5
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.mts +3 -51
- package/dist/index.d.ts +3 -51
- package/dist/index.js +15 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CreateStitches } from '@stitches/core';
|
|
3
|
-
import Stitches$1 from '@stitches/core/types/stitches';
|
|
4
|
-
import { ForwardRefExoticComponent, RefObject } from 'react';
|
|
1
|
+
import { CSSProperties, ForwardRefExoticComponent, RefObject } from 'react';
|
|
5
2
|
|
|
6
3
|
// This file is generated from Weaverse Studio
|
|
7
4
|
|
|
@@ -218,50 +215,11 @@ type IconName =
|
|
|
218
215
|
| 'youtube'
|
|
219
216
|
| 'zap'
|
|
220
217
|
|
|
221
|
-
declare let stitchesUtils: {
|
|
222
|
-
m: (value: string) => {
|
|
223
|
-
margin: string;
|
|
224
|
-
};
|
|
225
|
-
mt: (value: string) => {
|
|
226
|
-
marginTop: string;
|
|
227
|
-
};
|
|
228
|
-
mr: (value: string) => {
|
|
229
|
-
marginRight: string;
|
|
230
|
-
};
|
|
231
|
-
mb: (value: string) => {
|
|
232
|
-
marginBottom: string;
|
|
233
|
-
};
|
|
234
|
-
ml: (value: string) => {
|
|
235
|
-
marginLeft: string;
|
|
236
|
-
};
|
|
237
|
-
mx: (value: string) => {
|
|
238
|
-
marginLeft: string;
|
|
239
|
-
marginRight: string;
|
|
240
|
-
};
|
|
241
|
-
my: (value: string) => {
|
|
242
|
-
marginTop: string;
|
|
243
|
-
marginBottom: string;
|
|
244
|
-
};
|
|
245
|
-
size: (value: string) => {
|
|
246
|
-
width: string;
|
|
247
|
-
height: string;
|
|
248
|
-
};
|
|
249
|
-
px: (value: string) => {
|
|
250
|
-
paddingLeft: string;
|
|
251
|
-
paddingRight: string;
|
|
252
|
-
};
|
|
253
|
-
py: (value: string) => {
|
|
254
|
-
paddingTop: string;
|
|
255
|
-
paddingBottom: string;
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
type PlatformTypeEnum = 'shopify-section' | 'shopify-hydrogen' | 'nextjs';
|
|
260
218
|
type ToolbarAction = 'general-settings' | 'settings-level-2' | 'duplicate' | 'delete' | 'global-sections';
|
|
261
219
|
type AdvancedGroupType = 'border' | 'alignment' | 'background' | 'dimensions' | 'spacing' | 'typography' | 'visibility' | 'shadows-and-effects' | 'layout-background';
|
|
262
220
|
type PositionInputValue = 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right';
|
|
263
221
|
type InputType = 'blog' | 'collection' | 'collection-list' | 'color' | 'datepicker' | 'image' | 'video' | 'map-autocomplete' | 'position' | 'product' | 'product-list' | 'range' | 'richtext' | 'select' | 'switch' | 'text' | 'textarea' | 'toggle-group' | 'swatches' | 'metaobject' | 'url';
|
|
264
|
-
type WeaverseCSSProperties =
|
|
222
|
+
type WeaverseCSSProperties = CSSProperties;
|
|
265
223
|
type ChildElementCSS = Partial<{
|
|
266
224
|
[selector: string]: WeaverseCSSProperties & ChildElementCSS;
|
|
267
225
|
}>;
|
|
@@ -321,7 +279,6 @@ type WeaverseCoreParams = {
|
|
|
321
279
|
projectId: string;
|
|
322
280
|
data: WeaverseProjectDataType;
|
|
323
281
|
isDesignMode?: boolean;
|
|
324
|
-
platformType?: PlatformTypeEnum;
|
|
325
282
|
};
|
|
326
283
|
/**
|
|
327
284
|
* BasicInput interface
|
|
@@ -387,7 +344,6 @@ declare class WeaverseItemStore extends EventEmitter {
|
|
|
387
344
|
weaverse: Weaverse;
|
|
388
345
|
ref: RefObject<HTMLElement | null>;
|
|
389
346
|
_store: ElementData;
|
|
390
|
-
stitchesClass: string;
|
|
391
347
|
constructor(initialData: ElementData, weaverse: Weaverse);
|
|
392
348
|
get _id(): string;
|
|
393
349
|
get _element(): HTMLElement | null;
|
|
@@ -408,12 +364,10 @@ declare class Weaverse extends EventEmitter {
|
|
|
408
364
|
projectId: string;
|
|
409
365
|
isDesignMode: boolean;
|
|
410
366
|
isPreviewMode: boolean;
|
|
411
|
-
static stitchesInstance: Stitches$1 | any;
|
|
412
367
|
studioBridge?: any;
|
|
413
368
|
static ItemConstructor: typeof WeaverseItemStore;
|
|
414
369
|
data: WeaverseProjectDataType;
|
|
415
370
|
dataContext: Record<string, unknown> | null;
|
|
416
|
-
platformType: PlatformTypeEnum;
|
|
417
371
|
static elementRegistry: Map<any, any>;
|
|
418
372
|
static mediaBreakPoints: BreakPoints;
|
|
419
373
|
constructor(params: WeaverseCoreParams);
|
|
@@ -424,8 +378,6 @@ declare class Weaverse extends EventEmitter {
|
|
|
424
378
|
initProject: () => void;
|
|
425
379
|
get itemInstances(): Map<any, any>;
|
|
426
380
|
createItemInstance: (data: ElementData) => WeaverseItemStore;
|
|
427
|
-
static initStitches: (externalConfig?: CreateStitches) => void;
|
|
428
|
-
get stitchesInstance(): any;
|
|
429
381
|
/**
|
|
430
382
|
* Register the custom React Component to Weaverse, store it into Weaverse.elementRegistry
|
|
431
383
|
*/
|
|
@@ -458,4 +410,4 @@ declare function merge(target: Record<string, any>, source: Record<string, any>)
|
|
|
458
410
|
};
|
|
459
411
|
declare function loadScript(src: string): Promise<unknown>;
|
|
460
412
|
|
|
461
|
-
export { type AdditionalInputConfigs, type AdvancedGroupType, type BasicInput, type BreakPoints, type ChildElementCSS, type ElementCSS, type ElementData, type ElementSchema, EventEmitter, type InputType, type
|
|
413
|
+
export { type AdditionalInputConfigs, type AdvancedGroupType, type BasicInput, type BreakPoints, type ChildElementCSS, type ElementCSS, type ElementData, type ElementSchema, EventEmitter, type InputType, type PositionInputValue, type RangeInputConfigs, type SelectInputConfigs, type ToggleGroupConfigs, type ToolbarAction, Weaverse, type WeaverseCSSProperties, type WeaverseCoreParams, type WeaverseElement, type WeaverseImage, WeaverseItemStore, type WeaverseProjectDataType, type WeaverseResourcePickerData, type WeaverseVideo, isBrowser, isIframe, isReactNative, loadScript, merge, registerElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CreateStitches } from '@stitches/core';
|
|
3
|
-
import Stitches$1 from '@stitches/core/types/stitches';
|
|
4
|
-
import { ForwardRefExoticComponent, RefObject } from 'react';
|
|
1
|
+
import { CSSProperties, ForwardRefExoticComponent, RefObject } from 'react';
|
|
5
2
|
|
|
6
3
|
// This file is generated from Weaverse Studio
|
|
7
4
|
|
|
@@ -218,50 +215,11 @@ type IconName =
|
|
|
218
215
|
| 'youtube'
|
|
219
216
|
| 'zap'
|
|
220
217
|
|
|
221
|
-
declare let stitchesUtils: {
|
|
222
|
-
m: (value: string) => {
|
|
223
|
-
margin: string;
|
|
224
|
-
};
|
|
225
|
-
mt: (value: string) => {
|
|
226
|
-
marginTop: string;
|
|
227
|
-
};
|
|
228
|
-
mr: (value: string) => {
|
|
229
|
-
marginRight: string;
|
|
230
|
-
};
|
|
231
|
-
mb: (value: string) => {
|
|
232
|
-
marginBottom: string;
|
|
233
|
-
};
|
|
234
|
-
ml: (value: string) => {
|
|
235
|
-
marginLeft: string;
|
|
236
|
-
};
|
|
237
|
-
mx: (value: string) => {
|
|
238
|
-
marginLeft: string;
|
|
239
|
-
marginRight: string;
|
|
240
|
-
};
|
|
241
|
-
my: (value: string) => {
|
|
242
|
-
marginTop: string;
|
|
243
|
-
marginBottom: string;
|
|
244
|
-
};
|
|
245
|
-
size: (value: string) => {
|
|
246
|
-
width: string;
|
|
247
|
-
height: string;
|
|
248
|
-
};
|
|
249
|
-
px: (value: string) => {
|
|
250
|
-
paddingLeft: string;
|
|
251
|
-
paddingRight: string;
|
|
252
|
-
};
|
|
253
|
-
py: (value: string) => {
|
|
254
|
-
paddingTop: string;
|
|
255
|
-
paddingBottom: string;
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
type PlatformTypeEnum = 'shopify-section' | 'shopify-hydrogen' | 'nextjs';
|
|
260
218
|
type ToolbarAction = 'general-settings' | 'settings-level-2' | 'duplicate' | 'delete' | 'global-sections';
|
|
261
219
|
type AdvancedGroupType = 'border' | 'alignment' | 'background' | 'dimensions' | 'spacing' | 'typography' | 'visibility' | 'shadows-and-effects' | 'layout-background';
|
|
262
220
|
type PositionInputValue = 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right';
|
|
263
221
|
type InputType = 'blog' | 'collection' | 'collection-list' | 'color' | 'datepicker' | 'image' | 'video' | 'map-autocomplete' | 'position' | 'product' | 'product-list' | 'range' | 'richtext' | 'select' | 'switch' | 'text' | 'textarea' | 'toggle-group' | 'swatches' | 'metaobject' | 'url';
|
|
264
|
-
type WeaverseCSSProperties =
|
|
222
|
+
type WeaverseCSSProperties = CSSProperties;
|
|
265
223
|
type ChildElementCSS = Partial<{
|
|
266
224
|
[selector: string]: WeaverseCSSProperties & ChildElementCSS;
|
|
267
225
|
}>;
|
|
@@ -321,7 +279,6 @@ type WeaverseCoreParams = {
|
|
|
321
279
|
projectId: string;
|
|
322
280
|
data: WeaverseProjectDataType;
|
|
323
281
|
isDesignMode?: boolean;
|
|
324
|
-
platformType?: PlatformTypeEnum;
|
|
325
282
|
};
|
|
326
283
|
/**
|
|
327
284
|
* BasicInput interface
|
|
@@ -387,7 +344,6 @@ declare class WeaverseItemStore extends EventEmitter {
|
|
|
387
344
|
weaverse: Weaverse;
|
|
388
345
|
ref: RefObject<HTMLElement | null>;
|
|
389
346
|
_store: ElementData;
|
|
390
|
-
stitchesClass: string;
|
|
391
347
|
constructor(initialData: ElementData, weaverse: Weaverse);
|
|
392
348
|
get _id(): string;
|
|
393
349
|
get _element(): HTMLElement | null;
|
|
@@ -408,12 +364,10 @@ declare class Weaverse extends EventEmitter {
|
|
|
408
364
|
projectId: string;
|
|
409
365
|
isDesignMode: boolean;
|
|
410
366
|
isPreviewMode: boolean;
|
|
411
|
-
static stitchesInstance: Stitches$1 | any;
|
|
412
367
|
studioBridge?: any;
|
|
413
368
|
static ItemConstructor: typeof WeaverseItemStore;
|
|
414
369
|
data: WeaverseProjectDataType;
|
|
415
370
|
dataContext: Record<string, unknown> | null;
|
|
416
|
-
platformType: PlatformTypeEnum;
|
|
417
371
|
static elementRegistry: Map<any, any>;
|
|
418
372
|
static mediaBreakPoints: BreakPoints;
|
|
419
373
|
constructor(params: WeaverseCoreParams);
|
|
@@ -424,8 +378,6 @@ declare class Weaverse extends EventEmitter {
|
|
|
424
378
|
initProject: () => void;
|
|
425
379
|
get itemInstances(): Map<any, any>;
|
|
426
380
|
createItemInstance: (data: ElementData) => WeaverseItemStore;
|
|
427
|
-
static initStitches: (externalConfig?: CreateStitches) => void;
|
|
428
|
-
get stitchesInstance(): any;
|
|
429
381
|
/**
|
|
430
382
|
* Register the custom React Component to Weaverse, store it into Weaverse.elementRegistry
|
|
431
383
|
*/
|
|
@@ -458,4 +410,4 @@ declare function merge(target: Record<string, any>, source: Record<string, any>)
|
|
|
458
410
|
};
|
|
459
411
|
declare function loadScript(src: string): Promise<unknown>;
|
|
460
412
|
|
|
461
|
-
export { type AdditionalInputConfigs, type AdvancedGroupType, type BasicInput, type BreakPoints, type ChildElementCSS, type ElementCSS, type ElementData, type ElementSchema, EventEmitter, type InputType, type
|
|
413
|
+
export { type AdditionalInputConfigs, type AdvancedGroupType, type BasicInput, type BreakPoints, type ChildElementCSS, type ElementCSS, type ElementData, type ElementSchema, EventEmitter, type InputType, type PositionInputValue, type RangeInputConfigs, type SelectInputConfigs, type ToggleGroupConfigs, type ToolbarAction, Weaverse, type WeaverseCSSProperties, type WeaverseCoreParams, type WeaverseElement, type WeaverseImage, WeaverseItemStore, type WeaverseProjectDataType, type WeaverseResourcePickerData, type WeaverseVideo, isBrowser, isIframe, isReactNative, loadScript, merge, registerElement };
|
package/dist/index.js
CHANGED
|
@@ -33,18 +33,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
var require_react_production = __commonJS({
|
|
34
34
|
"../../node_modules/react/cjs/react.production.js"(exports2) {
|
|
35
35
|
"use strict";
|
|
36
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
|
|
37
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
38
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
39
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
40
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
41
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
|
|
42
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
43
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
44
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
45
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
46
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
47
|
-
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
36
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
37
|
+
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
38
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
39
|
+
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
40
|
+
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
41
|
+
var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
|
|
42
|
+
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
43
|
+
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
44
|
+
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
45
|
+
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
46
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
47
|
+
var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
|
|
48
48
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
49
49
|
function getIteratorFn(maybeIterable) {
|
|
50
50
|
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
@@ -939,7 +939,7 @@ var require_react_development = __commonJS({
|
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
942
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
942
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
943
943
|
isMounted: function() {
|
|
944
944
|
return false;
|
|
945
945
|
},
|
|
@@ -982,7 +982,7 @@ var require_react_development = __commonJS({
|
|
|
982
982
|
deprecatedAPIs.constructor = PureComponent;
|
|
983
983
|
assign(deprecatedAPIs, Component.prototype);
|
|
984
984
|
deprecatedAPIs.isPureReactComponent = true;
|
|
985
|
-
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
985
|
+
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
986
986
|
H: null,
|
|
987
987
|
A: null,
|
|
988
988
|
T: null,
|
|
@@ -1470,11 +1470,10 @@ __export(index_exports, {
|
|
|
1470
1470
|
module.exports = __toCommonJS(index_exports);
|
|
1471
1471
|
|
|
1472
1472
|
// src/core.ts
|
|
1473
|
-
var import_core = require("@stitches/core");
|
|
1474
1473
|
var import_react = __toESM(require_react());
|
|
1475
1474
|
|
|
1476
1475
|
// package.json
|
|
1477
|
-
var version = "5.8.
|
|
1476
|
+
var version = "5.8.4";
|
|
1478
1477
|
|
|
1479
1478
|
// src/utils/index.ts
|
|
1480
1479
|
var isReactNative = typeof navigator === "object" && navigator.product === "ReactNative";
|
|
@@ -1525,51 +1524,11 @@ var EventEmitter = class {
|
|
|
1525
1524
|
};
|
|
1526
1525
|
};
|
|
1527
1526
|
|
|
1528
|
-
// src/utils/stitches.ts
|
|
1529
|
-
var stitchesUtils = {
|
|
1530
|
-
m: (value) => ({
|
|
1531
|
-
margin: value
|
|
1532
|
-
}),
|
|
1533
|
-
mt: (value) => ({
|
|
1534
|
-
marginTop: value
|
|
1535
|
-
}),
|
|
1536
|
-
mr: (value) => ({
|
|
1537
|
-
marginRight: value
|
|
1538
|
-
}),
|
|
1539
|
-
mb: (value) => ({
|
|
1540
|
-
marginBottom: value
|
|
1541
|
-
}),
|
|
1542
|
-
ml: (value) => ({
|
|
1543
|
-
marginLeft: value
|
|
1544
|
-
}),
|
|
1545
|
-
mx: (value) => ({
|
|
1546
|
-
marginLeft: value,
|
|
1547
|
-
marginRight: value
|
|
1548
|
-
}),
|
|
1549
|
-
my: (value) => ({
|
|
1550
|
-
marginTop: value,
|
|
1551
|
-
marginBottom: value
|
|
1552
|
-
}),
|
|
1553
|
-
size: (value) => ({
|
|
1554
|
-
width: value,
|
|
1555
|
-
height: value
|
|
1556
|
-
}),
|
|
1557
|
-
px: (value) => ({
|
|
1558
|
-
paddingLeft: value,
|
|
1559
|
-
paddingRight: value
|
|
1560
|
-
}),
|
|
1561
|
-
py: (value) => ({
|
|
1562
|
-
paddingTop: value,
|
|
1563
|
-
paddingBottom: value
|
|
1564
|
-
})
|
|
1565
|
-
};
|
|
1566
|
-
|
|
1567
1527
|
// src/core.ts
|
|
1568
1528
|
var WeaverseItemStore = class extends EventEmitter {
|
|
1569
1529
|
weaverse;
|
|
1570
1530
|
ref = (0, import_react.createRef)();
|
|
1571
1531
|
_store = { id: "", type: "" };
|
|
1572
|
-
stitchesClass = "";
|
|
1573
1532
|
constructor(initialData, weaverse) {
|
|
1574
1533
|
super();
|
|
1575
1534
|
const { type, id } = initialData || {};
|
|
@@ -1623,7 +1582,6 @@ var Weaverse = class _Weaverse extends EventEmitter {
|
|
|
1623
1582
|
projectId = "";
|
|
1624
1583
|
isDesignMode = false;
|
|
1625
1584
|
isPreviewMode = false;
|
|
1626
|
-
static stitchesInstance;
|
|
1627
1585
|
studioBridge;
|
|
1628
1586
|
static elementRegistry = /* @__PURE__ */ new Map();
|
|
1629
1587
|
static mediaBreakPoints = {
|
|
@@ -1639,7 +1597,6 @@ var Weaverse = class _Weaverse extends EventEmitter {
|
|
|
1639
1597
|
this[key] = value || this[key];
|
|
1640
1598
|
}
|
|
1641
1599
|
this.initProject();
|
|
1642
|
-
_Weaverse.initStitches();
|
|
1643
1600
|
}
|
|
1644
1601
|
getSnapShot = () => this.data;
|
|
1645
1602
|
/**
|
|
@@ -1663,17 +1620,6 @@ var Weaverse = class _Weaverse extends EventEmitter {
|
|
|
1663
1620
|
return _Weaverse.itemInstances;
|
|
1664
1621
|
}
|
|
1665
1622
|
createItemInstance = (data) => new _Weaverse.ItemConstructor(data, this);
|
|
1666
|
-
static initStitches = (externalConfig) => {
|
|
1667
|
-
_Weaverse.stitchesInstance = _Weaverse.stitchesInstance || (0, import_core.createStitches)({
|
|
1668
|
-
prefix: "weaverse",
|
|
1669
|
-
media: _Weaverse.mediaBreakPoints,
|
|
1670
|
-
utils: stitchesUtils,
|
|
1671
|
-
...externalConfig
|
|
1672
|
-
});
|
|
1673
|
-
};
|
|
1674
|
-
get stitchesInstance() {
|
|
1675
|
-
return _Weaverse.stitchesInstance;
|
|
1676
|
-
}
|
|
1677
1623
|
/**
|
|
1678
1624
|
* Register the custom React Component to Weaverse, store it into Weaverse.elementRegistry
|
|
1679
1625
|
*/
|