@weaverse/core 0.6.31 → 0.6.32
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.js +9 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
8
|
var __export = (target, all) => {
|
|
25
9
|
for (var name in all)
|
|
26
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -33,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
33
17
|
}
|
|
34
18
|
return to;
|
|
35
19
|
};
|
|
36
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
37
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
25
|
|
|
39
26
|
// src/index.ts
|
|
@@ -124,7 +111,7 @@ var WeaverseItemStore = class {
|
|
|
124
111
|
this.weaverse = weaverse;
|
|
125
112
|
if (id && type) {
|
|
126
113
|
weaverse.itemInstances.set(id, this);
|
|
127
|
-
this.data =
|
|
114
|
+
this.data = { ...itemData };
|
|
128
115
|
}
|
|
129
116
|
}
|
|
130
117
|
get _id() {
|
|
@@ -137,11 +124,11 @@ var WeaverseItemStore = class {
|
|
|
137
124
|
return this.weaverse.elementInstances.get(this._data.type);
|
|
138
125
|
}
|
|
139
126
|
set data(data) {
|
|
140
|
-
this._data =
|
|
127
|
+
this._data = { ...this.data, ...data };
|
|
141
128
|
}
|
|
142
129
|
get data() {
|
|
143
130
|
var _a, _b;
|
|
144
|
-
return
|
|
131
|
+
return { ...(_b = (_a = this.Element) == null ? void 0 : _a.Component) == null ? void 0 : _b.defaultProps, ...this._data };
|
|
145
132
|
}
|
|
146
133
|
};
|
|
147
134
|
var Weaverse = class {
|
|
@@ -167,7 +154,7 @@ var Weaverse = class {
|
|
|
167
154
|
if (!this.initialized) {
|
|
168
155
|
let { data: pageData, published, id, projectKey } = data;
|
|
169
156
|
this.projectKey = projectKey || this.projectKey;
|
|
170
|
-
this.projectData =
|
|
157
|
+
this.projectData = { ...pageData, pageId: id };
|
|
171
158
|
this.isDesignMode = !published;
|
|
172
159
|
this.initProjectItemData();
|
|
173
160
|
if (this.isDesignMode) {
|
package/package.json
CHANGED