@weaverse/react 0.4.1 → 0.4.4
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 +1 -2
- package/dist/index.js +136 -39
- package/dist/index.mjs +136 -39
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ export * from '@weaverse/core';
|
|
|
4
4
|
declare const createRootContext: (configs: WeaverseType) => Weaverse;
|
|
5
5
|
declare type WeaverseRootPropsType = {
|
|
6
6
|
context: Weaverse;
|
|
7
|
-
defaultData: any;
|
|
8
7
|
};
|
|
9
|
-
declare const WeaverseRoot: ({ context
|
|
8
|
+
declare const WeaverseRoot: ({ context }: WeaverseRootPropsType) => JSX.Element;
|
|
10
9
|
|
|
11
10
|
export { WeaverseRoot, WeaverseRootPropsType, createRootContext };
|
package/dist/index.js
CHANGED
|
@@ -70,7 +70,9 @@ BaseElement.defaultProps = {
|
|
|
70
70
|
style: {}
|
|
71
71
|
};
|
|
72
72
|
var schema = {
|
|
73
|
-
type: "base"
|
|
73
|
+
type: "base",
|
|
74
|
+
title: "Base",
|
|
75
|
+
settings: []
|
|
74
76
|
};
|
|
75
77
|
var base_default = BaseElement;
|
|
76
78
|
|
|
@@ -100,6 +102,16 @@ var schema2 = {
|
|
|
100
102
|
}
|
|
101
103
|
]
|
|
102
104
|
},
|
|
105
|
+
{
|
|
106
|
+
tab: "Settings",
|
|
107
|
+
label: "Spacing",
|
|
108
|
+
inspectors: [
|
|
109
|
+
{
|
|
110
|
+
binding: "style",
|
|
111
|
+
type: "spacing"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
103
115
|
{
|
|
104
116
|
tab: "Settings",
|
|
105
117
|
label: "Overlay",
|
|
@@ -165,11 +177,84 @@ var schema2 = {
|
|
|
165
177
|
};
|
|
166
178
|
var button_default = Button;
|
|
167
179
|
|
|
180
|
+
// src/elements/flex.tsx
|
|
181
|
+
var import_react2 = __toESM(require("react"));
|
|
182
|
+
var Flex = (0, import_react2.forwardRef)((props, ref) => {
|
|
183
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", __spreadValues({
|
|
184
|
+
ref
|
|
185
|
+
}, props));
|
|
186
|
+
});
|
|
187
|
+
var schema3 = {
|
|
188
|
+
title: "Flex",
|
|
189
|
+
type: "flex",
|
|
190
|
+
data: {
|
|
191
|
+
css: {
|
|
192
|
+
"@desktop": {
|
|
193
|
+
display: "flex",
|
|
194
|
+
backgroundColor: "rgba(248,203,203,0.38)",
|
|
195
|
+
gridArea: "1 / 1 / 3 / 3"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
settings: [
|
|
200
|
+
{
|
|
201
|
+
tab: "Layout",
|
|
202
|
+
label: "Flex",
|
|
203
|
+
inspectors: [
|
|
204
|
+
{
|
|
205
|
+
type: "flex"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
};
|
|
211
|
+
var flex_default = Flex;
|
|
212
|
+
|
|
213
|
+
// src/elements/grid.tsx
|
|
214
|
+
var import_react3 = __toESM(require("react"));
|
|
215
|
+
var Grid = (0, import_react3.forwardRef)((props, ref) => {
|
|
216
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", __spreadValues({
|
|
217
|
+
ref
|
|
218
|
+
}, props));
|
|
219
|
+
});
|
|
220
|
+
var schema4 = {
|
|
221
|
+
title: "Grid",
|
|
222
|
+
type: "grid",
|
|
223
|
+
data: {
|
|
224
|
+
css: {
|
|
225
|
+
"@desktop": {
|
|
226
|
+
display: "grid",
|
|
227
|
+
gridTemplateRows: "repeat(auto-fill, $rowSize)",
|
|
228
|
+
gridTemplateColumns: "repeat($columns, 1fr)",
|
|
229
|
+
gridGap: "$gap",
|
|
230
|
+
minHeight: "480px",
|
|
231
|
+
backgroundColor: "#c7c7c7"
|
|
232
|
+
},
|
|
233
|
+
"@mobile": {
|
|
234
|
+
gridTemplateRows: "100%",
|
|
235
|
+
gridTemplateColumns: "100%"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
settings: [
|
|
240
|
+
{
|
|
241
|
+
tab: "Layout",
|
|
242
|
+
label: "Grid",
|
|
243
|
+
inspectors: [
|
|
244
|
+
{
|
|
245
|
+
type: "grid"
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
};
|
|
251
|
+
var grid_default = Grid;
|
|
252
|
+
|
|
168
253
|
// src/elements/text.tsx
|
|
169
|
-
var
|
|
170
|
-
var Text =
|
|
254
|
+
var React5 = __toESM(require("react"));
|
|
255
|
+
var Text = React5.forwardRef((props, ref) => {
|
|
171
256
|
let _a = props, { children, value } = _a, rest = __objRest(_a, ["children", "value"]);
|
|
172
|
-
return /* @__PURE__ */
|
|
257
|
+
return /* @__PURE__ */ React5.createElement("span", __spreadProps(__spreadValues({
|
|
173
258
|
ref
|
|
174
259
|
}, rest), {
|
|
175
260
|
contentEditable: true,
|
|
@@ -180,18 +265,25 @@ Text.defaultProps = {
|
|
|
180
265
|
value: "sample text",
|
|
181
266
|
tag: "span"
|
|
182
267
|
};
|
|
183
|
-
var
|
|
268
|
+
var schema5 = {
|
|
184
269
|
type: "text",
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
binding: "data",
|
|
188
|
-
key: "value",
|
|
189
|
-
componentType: "textarea"
|
|
190
|
-
},
|
|
270
|
+
title: "Text Settings",
|
|
271
|
+
settings: [
|
|
191
272
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
273
|
+
tab: "General",
|
|
274
|
+
label: "Text",
|
|
275
|
+
inspectors: [
|
|
276
|
+
{
|
|
277
|
+
binding: "data",
|
|
278
|
+
key: "value",
|
|
279
|
+
type: "textarea"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
binding: "style",
|
|
283
|
+
key: "color",
|
|
284
|
+
type: "color"
|
|
285
|
+
}
|
|
286
|
+
]
|
|
195
287
|
}
|
|
196
288
|
]
|
|
197
289
|
};
|
|
@@ -209,6 +301,14 @@ var elements = {
|
|
|
209
301
|
},
|
|
210
302
|
Text: {
|
|
211
303
|
Component: text_default,
|
|
304
|
+
schema: schema5
|
|
305
|
+
},
|
|
306
|
+
Grid: {
|
|
307
|
+
Component: grid_default,
|
|
308
|
+
schema: schema4
|
|
309
|
+
},
|
|
310
|
+
Flex: {
|
|
311
|
+
Component: flex_default,
|
|
212
312
|
schema: schema3
|
|
213
313
|
}
|
|
214
314
|
};
|
|
@@ -225,7 +325,7 @@ var shortCssObject = (css) => {
|
|
|
225
325
|
|
|
226
326
|
// src/renderer.tsx
|
|
227
327
|
var import_core = require("@weaverse/core");
|
|
228
|
-
var
|
|
328
|
+
var React6 = __toESM(require("react"));
|
|
229
329
|
var createRootContext = (configs) => {
|
|
230
330
|
const rootContext = new import_core.Weaverse(configs);
|
|
231
331
|
Object.keys(elements_default).forEach((key) => {
|
|
@@ -233,39 +333,34 @@ var createRootContext = (configs) => {
|
|
|
233
333
|
});
|
|
234
334
|
return rootContext;
|
|
235
335
|
};
|
|
236
|
-
var WeaverseRoot = ({
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
var _a, _b, _c;
|
|
241
|
-
let [, setData] = React4.useState(context.projectData);
|
|
242
|
-
React4.useEffect(() => {
|
|
336
|
+
var WeaverseRoot = ({ context }) => {
|
|
337
|
+
var _a;
|
|
338
|
+
let [, setData] = React6.useState(context.projectData);
|
|
339
|
+
React6.useEffect(() => {
|
|
243
340
|
let handleUpdate = () => {
|
|
244
|
-
setData(
|
|
341
|
+
setData({});
|
|
245
342
|
};
|
|
246
343
|
context.subscribe(handleUpdate);
|
|
247
|
-
context.
|
|
344
|
+
if (context.projectData) {
|
|
345
|
+
setTimeout(handleUpdate, 110);
|
|
346
|
+
}
|
|
248
347
|
return () => {
|
|
249
348
|
context.unsubscribe(handleUpdate);
|
|
250
349
|
};
|
|
251
350
|
}, []);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return /* @__PURE__ */ React4.createElement("div", __spreadValues({
|
|
258
|
-
className: `weaverse-root`,
|
|
259
|
-
id: "weaverse-root"
|
|
260
|
-
}, handleProps), /* @__PURE__ */ React4.createElement(RenderItem, {
|
|
351
|
+
let handleProps = ((_a = context == null ? void 0 : context.studioBridge) == null ? void 0 : _a.handleProps) || {};
|
|
352
|
+
let themeClass = context.stitchesInstance.theme.className;
|
|
353
|
+
return /* @__PURE__ */ React6.createElement("div", __spreadValues({
|
|
354
|
+
className: `weaverse-content-root ${themeClass}`
|
|
355
|
+
}, handleProps), /* @__PURE__ */ React6.createElement(RenderItem, {
|
|
261
356
|
itemId: context.projectData.rootId || 0,
|
|
262
357
|
context
|
|
263
358
|
}));
|
|
264
359
|
};
|
|
265
360
|
var Item = ({ itemInstance, elementInstances, context }) => {
|
|
266
|
-
let [data, setData] =
|
|
361
|
+
let [data, setData] = React6.useState(itemInstance.data);
|
|
267
362
|
let _a = data, { id, type, childIds, css, className } = _a, rest = __objRest(_a, ["id", "type", "childIds", "css", "className"]);
|
|
268
|
-
|
|
363
|
+
React6.useEffect(() => {
|
|
269
364
|
let handleUpdate = (update) => {
|
|
270
365
|
setData(__spreadValues({}, update));
|
|
271
366
|
};
|
|
@@ -291,12 +386,13 @@ var Item = ({ itemInstance, elementInstances, context }) => {
|
|
|
291
386
|
if (Component.$$typeof === Symbol.for("react.forward_ref")) {
|
|
292
387
|
rest.ref = itemInstance.ref;
|
|
293
388
|
}
|
|
294
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ React6.createElement(Component, __spreadProps(__spreadValues({
|
|
295
390
|
key: id,
|
|
391
|
+
"data-wv-type": type,
|
|
296
392
|
"data-wv-id": id
|
|
297
393
|
}, rest), {
|
|
298
394
|
className: realClassName
|
|
299
|
-
}), Array.isArray(childIds) && childIds.map((childId) => /* @__PURE__ */
|
|
395
|
+
}), Array.isArray(childIds) && childIds.map((childId) => /* @__PURE__ */ React6.createElement(RenderItem, {
|
|
300
396
|
key: childId,
|
|
301
397
|
itemId: childId,
|
|
302
398
|
context
|
|
@@ -311,13 +407,14 @@ var RenderItem = ({
|
|
|
311
407
|
let { itemInstances, elementInstances } = context;
|
|
312
408
|
let itemInstance = itemInstances.get(itemId);
|
|
313
409
|
if (itemInstance) {
|
|
314
|
-
return /* @__PURE__ */
|
|
410
|
+
return /* @__PURE__ */ React6.createElement(Item, {
|
|
315
411
|
itemInstance,
|
|
316
412
|
elementInstances,
|
|
317
413
|
context
|
|
318
414
|
});
|
|
319
415
|
}
|
|
320
|
-
|
|
416
|
+
console.warn(`Item instance ${itemId} not found`);
|
|
417
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null);
|
|
321
418
|
};
|
|
322
419
|
|
|
323
420
|
// src/index.ts
|
package/dist/index.mjs
CHANGED
|
@@ -43,7 +43,9 @@ BaseElement.defaultProps = {
|
|
|
43
43
|
style: {}
|
|
44
44
|
};
|
|
45
45
|
var schema = {
|
|
46
|
-
type: "base"
|
|
46
|
+
type: "base",
|
|
47
|
+
title: "Base",
|
|
48
|
+
settings: []
|
|
47
49
|
};
|
|
48
50
|
var base_default = BaseElement;
|
|
49
51
|
|
|
@@ -73,6 +75,16 @@ var schema2 = {
|
|
|
73
75
|
}
|
|
74
76
|
]
|
|
75
77
|
},
|
|
78
|
+
{
|
|
79
|
+
tab: "Settings",
|
|
80
|
+
label: "Spacing",
|
|
81
|
+
inspectors: [
|
|
82
|
+
{
|
|
83
|
+
binding: "style",
|
|
84
|
+
type: "spacing"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
76
88
|
{
|
|
77
89
|
tab: "Settings",
|
|
78
90
|
label: "Overlay",
|
|
@@ -138,11 +150,84 @@ var schema2 = {
|
|
|
138
150
|
};
|
|
139
151
|
var button_default = Button;
|
|
140
152
|
|
|
153
|
+
// src/elements/flex.tsx
|
|
154
|
+
import React3, { forwardRef as forwardRef2 } from "react";
|
|
155
|
+
var Flex = forwardRef2((props, ref) => {
|
|
156
|
+
return /* @__PURE__ */ React3.createElement("div", __spreadValues({
|
|
157
|
+
ref
|
|
158
|
+
}, props));
|
|
159
|
+
});
|
|
160
|
+
var schema3 = {
|
|
161
|
+
title: "Flex",
|
|
162
|
+
type: "flex",
|
|
163
|
+
data: {
|
|
164
|
+
css: {
|
|
165
|
+
"@desktop": {
|
|
166
|
+
display: "flex",
|
|
167
|
+
backgroundColor: "rgba(248,203,203,0.38)",
|
|
168
|
+
gridArea: "1 / 1 / 3 / 3"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
settings: [
|
|
173
|
+
{
|
|
174
|
+
tab: "Layout",
|
|
175
|
+
label: "Flex",
|
|
176
|
+
inspectors: [
|
|
177
|
+
{
|
|
178
|
+
type: "flex"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
};
|
|
184
|
+
var flex_default = Flex;
|
|
185
|
+
|
|
186
|
+
// src/elements/grid.tsx
|
|
187
|
+
import React4, { forwardRef as forwardRef3 } from "react";
|
|
188
|
+
var Grid = forwardRef3((props, ref) => {
|
|
189
|
+
return /* @__PURE__ */ React4.createElement("div", __spreadValues({
|
|
190
|
+
ref
|
|
191
|
+
}, props));
|
|
192
|
+
});
|
|
193
|
+
var schema4 = {
|
|
194
|
+
title: "Grid",
|
|
195
|
+
type: "grid",
|
|
196
|
+
data: {
|
|
197
|
+
css: {
|
|
198
|
+
"@desktop": {
|
|
199
|
+
display: "grid",
|
|
200
|
+
gridTemplateRows: "repeat(auto-fill, $rowSize)",
|
|
201
|
+
gridTemplateColumns: "repeat($columns, 1fr)",
|
|
202
|
+
gridGap: "$gap",
|
|
203
|
+
minHeight: "480px",
|
|
204
|
+
backgroundColor: "#c7c7c7"
|
|
205
|
+
},
|
|
206
|
+
"@mobile": {
|
|
207
|
+
gridTemplateRows: "100%",
|
|
208
|
+
gridTemplateColumns: "100%"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
settings: [
|
|
213
|
+
{
|
|
214
|
+
tab: "Layout",
|
|
215
|
+
label: "Grid",
|
|
216
|
+
inspectors: [
|
|
217
|
+
{
|
|
218
|
+
type: "grid"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
};
|
|
224
|
+
var grid_default = Grid;
|
|
225
|
+
|
|
141
226
|
// src/elements/text.tsx
|
|
142
|
-
import * as
|
|
143
|
-
var Text =
|
|
227
|
+
import * as React5 from "react";
|
|
228
|
+
var Text = React5.forwardRef((props, ref) => {
|
|
144
229
|
let _a = props, { children, value } = _a, rest = __objRest(_a, ["children", "value"]);
|
|
145
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ React5.createElement("span", __spreadProps(__spreadValues({
|
|
146
231
|
ref
|
|
147
232
|
}, rest), {
|
|
148
233
|
contentEditable: true,
|
|
@@ -153,18 +238,25 @@ Text.defaultProps = {
|
|
|
153
238
|
value: "sample text",
|
|
154
239
|
tag: "span"
|
|
155
240
|
};
|
|
156
|
-
var
|
|
241
|
+
var schema5 = {
|
|
157
242
|
type: "text",
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
binding: "data",
|
|
161
|
-
key: "value",
|
|
162
|
-
componentType: "textarea"
|
|
163
|
-
},
|
|
243
|
+
title: "Text Settings",
|
|
244
|
+
settings: [
|
|
164
245
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
246
|
+
tab: "General",
|
|
247
|
+
label: "Text",
|
|
248
|
+
inspectors: [
|
|
249
|
+
{
|
|
250
|
+
binding: "data",
|
|
251
|
+
key: "value",
|
|
252
|
+
type: "textarea"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
binding: "style",
|
|
256
|
+
key: "color",
|
|
257
|
+
type: "color"
|
|
258
|
+
}
|
|
259
|
+
]
|
|
168
260
|
}
|
|
169
261
|
]
|
|
170
262
|
};
|
|
@@ -182,6 +274,14 @@ var elements = {
|
|
|
182
274
|
},
|
|
183
275
|
Text: {
|
|
184
276
|
Component: text_default,
|
|
277
|
+
schema: schema5
|
|
278
|
+
},
|
|
279
|
+
Grid: {
|
|
280
|
+
Component: grid_default,
|
|
281
|
+
schema: schema4
|
|
282
|
+
},
|
|
283
|
+
Flex: {
|
|
284
|
+
Component: flex_default,
|
|
185
285
|
schema: schema3
|
|
186
286
|
}
|
|
187
287
|
};
|
|
@@ -201,7 +301,7 @@ import {
|
|
|
201
301
|
isBrowser,
|
|
202
302
|
Weaverse
|
|
203
303
|
} from "@weaverse/core";
|
|
204
|
-
import * as
|
|
304
|
+
import * as React6 from "react";
|
|
205
305
|
var createRootContext = (configs) => {
|
|
206
306
|
const rootContext = new Weaverse(configs);
|
|
207
307
|
Object.keys(elements_default).forEach((key) => {
|
|
@@ -209,39 +309,34 @@ var createRootContext = (configs) => {
|
|
|
209
309
|
});
|
|
210
310
|
return rootContext;
|
|
211
311
|
};
|
|
212
|
-
var WeaverseRoot = ({
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
var _a, _b, _c;
|
|
217
|
-
let [, setData] = React4.useState(context.projectData);
|
|
218
|
-
React4.useEffect(() => {
|
|
312
|
+
var WeaverseRoot = ({ context }) => {
|
|
313
|
+
var _a;
|
|
314
|
+
let [, setData] = React6.useState(context.projectData);
|
|
315
|
+
React6.useEffect(() => {
|
|
219
316
|
let handleUpdate = () => {
|
|
220
|
-
setData(
|
|
317
|
+
setData({});
|
|
221
318
|
};
|
|
222
319
|
context.subscribe(handleUpdate);
|
|
223
|
-
context.
|
|
320
|
+
if (context.projectData) {
|
|
321
|
+
setTimeout(handleUpdate, 110);
|
|
322
|
+
}
|
|
224
323
|
return () => {
|
|
225
324
|
context.unsubscribe(handleUpdate);
|
|
226
325
|
};
|
|
227
326
|
}, []);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return /* @__PURE__ */ React4.createElement("div", __spreadValues({
|
|
234
|
-
className: `weaverse-root`,
|
|
235
|
-
id: "weaverse-root"
|
|
236
|
-
}, handleProps), /* @__PURE__ */ React4.createElement(RenderItem, {
|
|
327
|
+
let handleProps = ((_a = context == null ? void 0 : context.studioBridge) == null ? void 0 : _a.handleProps) || {};
|
|
328
|
+
let themeClass = context.stitchesInstance.theme.className;
|
|
329
|
+
return /* @__PURE__ */ React6.createElement("div", __spreadValues({
|
|
330
|
+
className: `weaverse-content-root ${themeClass}`
|
|
331
|
+
}, handleProps), /* @__PURE__ */ React6.createElement(RenderItem, {
|
|
237
332
|
itemId: context.projectData.rootId || 0,
|
|
238
333
|
context
|
|
239
334
|
}));
|
|
240
335
|
};
|
|
241
336
|
var Item = ({ itemInstance, elementInstances, context }) => {
|
|
242
|
-
let [data, setData] =
|
|
337
|
+
let [data, setData] = React6.useState(itemInstance.data);
|
|
243
338
|
let _a = data, { id, type, childIds, css, className } = _a, rest = __objRest(_a, ["id", "type", "childIds", "css", "className"]);
|
|
244
|
-
|
|
339
|
+
React6.useEffect(() => {
|
|
245
340
|
let handleUpdate = (update) => {
|
|
246
341
|
setData(__spreadValues({}, update));
|
|
247
342
|
};
|
|
@@ -267,12 +362,13 @@ var Item = ({ itemInstance, elementInstances, context }) => {
|
|
|
267
362
|
if (Component.$$typeof === Symbol.for("react.forward_ref")) {
|
|
268
363
|
rest.ref = itemInstance.ref;
|
|
269
364
|
}
|
|
270
|
-
return /* @__PURE__ */
|
|
365
|
+
return /* @__PURE__ */ React6.createElement(Component, __spreadProps(__spreadValues({
|
|
271
366
|
key: id,
|
|
367
|
+
"data-wv-type": type,
|
|
272
368
|
"data-wv-id": id
|
|
273
369
|
}, rest), {
|
|
274
370
|
className: realClassName
|
|
275
|
-
}), Array.isArray(childIds) && childIds.map((childId) => /* @__PURE__ */
|
|
371
|
+
}), Array.isArray(childIds) && childIds.map((childId) => /* @__PURE__ */ React6.createElement(RenderItem, {
|
|
276
372
|
key: childId,
|
|
277
373
|
itemId: childId,
|
|
278
374
|
context
|
|
@@ -287,13 +383,14 @@ var RenderItem = ({
|
|
|
287
383
|
let { itemInstances, elementInstances } = context;
|
|
288
384
|
let itemInstance = itemInstances.get(itemId);
|
|
289
385
|
if (itemInstance) {
|
|
290
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ React6.createElement(Item, {
|
|
291
387
|
itemInstance,
|
|
292
388
|
elementInstances,
|
|
293
389
|
context
|
|
294
390
|
});
|
|
295
391
|
}
|
|
296
|
-
|
|
392
|
+
console.warn(`Item instance ${itemId} not found`);
|
|
393
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null);
|
|
297
394
|
};
|
|
298
395
|
|
|
299
396
|
// src/index.ts
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.4.
|
|
2
|
+
"version": "0.4.4",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"name": "@weaverse/react",
|
|
32
32
|
"author": "Weaverse Team",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@weaverse/core": "^0.4.
|
|
34
|
+
"@weaverse/core": "^0.4.4"
|
|
35
35
|
}
|
|
36
36
|
}
|