@weaverse/react 0.6.18 → 0.6.21
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 -9
- package/dist/index.js +49 -101
- package/dist/index.mjs +39 -91
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -13,18 +13,11 @@ interface WeaverseElementProps {
|
|
|
13
13
|
declare type WeaverseRootPropsType = {
|
|
14
14
|
context: Weaverse;
|
|
15
15
|
};
|
|
16
|
+
declare type CountdownTimeKey = 'days' | 'hours' | 'minutes' | 'seconds';
|
|
16
17
|
declare type ItemComponentProps = {
|
|
17
18
|
instance: InstanceType<typeof WeaverseItemStore>;
|
|
18
19
|
};
|
|
19
|
-
declare type CountdownTimeKey = 'days' | 'hours' | 'minutes' | 'seconds';
|
|
20
|
-
declare type InstagramMedia = {
|
|
21
|
-
id: string;
|
|
22
|
-
media_type: 'IMAGE' | 'CAROUSEL_ALBUM';
|
|
23
|
-
media_url: string;
|
|
24
|
-
permalink: string;
|
|
25
|
-
caption: string;
|
|
26
|
-
};
|
|
27
20
|
|
|
28
21
|
declare let WeaverseRoot: ({ context }: WeaverseRootPropsType) => JSX.Element;
|
|
29
22
|
|
|
30
|
-
export { CountdownTimeKey,
|
|
23
|
+
export { CountdownTimeKey, ItemComponentProps, WeaverseContext, WeaverseContextConsumer, WeaverseContextProvider, WeaverseElementProps, WeaverseRoot, WeaverseRootPropsType, createRootContext };
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
62
62
|
|
|
63
63
|
// src/context.ts
|
|
64
64
|
var import_core = require("@weaverse/core");
|
|
65
|
-
var
|
|
65
|
+
var import_react9 = require("react");
|
|
66
66
|
|
|
67
67
|
// src/elements/button.tsx
|
|
68
68
|
var React = __toESM(require("react"));
|
|
@@ -412,102 +412,50 @@ Video.defaultProps = {
|
|
|
412
412
|
var video_default = Video;
|
|
413
413
|
|
|
414
414
|
// src/elements/instagram.tsx
|
|
415
|
-
var import_react9 = __toESM(require("react"));
|
|
416
|
-
|
|
417
|
-
// src/elements/shared/Placeholder.tsx
|
|
418
415
|
var import_react8 = __toESM(require("react"));
|
|
419
|
-
var
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
};
|
|
429
|
-
return /* @__PURE__ */ import_react8.default.createElement("div", __spreadValues({
|
|
430
|
-
style,
|
|
431
|
-
ref
|
|
432
|
-
}, rest), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
433
|
-
style: { fontWeight: 600, marginBottom: "10px" }
|
|
434
|
-
}, element), /* @__PURE__ */ import_react8.default.createElement("div", null, children));
|
|
435
|
-
});
|
|
436
|
-
var Placeholder_default = Placeholder;
|
|
437
|
-
|
|
438
|
-
// src/elements/instagram.tsx
|
|
439
|
-
var INSTAGRAM_API = "https://graph.instagram.com";
|
|
440
|
-
var Instagram = (0, import_react9.forwardRef)((props, ref) => {
|
|
441
|
-
const _a = props, { token, username, numberOfImages, imagesPerRow, gap } = _a, rest = __objRest(_a, ["token", "username", "numberOfImages", "imagesPerRow", "gap"]);
|
|
442
|
-
const [media, setMedia] = (0, import_react9.useState)([]);
|
|
443
|
-
const [error, setError] = (0, import_react9.useState)(null);
|
|
444
|
-
let { isDesignMode } = (0, import_react9.useContext)(WeaverseContext);
|
|
445
|
-
(0, import_react9.useEffect)(() => {
|
|
446
|
-
if (token) {
|
|
447
|
-
let params = new URLSearchParams({
|
|
448
|
-
access_token: token,
|
|
449
|
-
fields: "id,media_type,caption,media_url,permalink"
|
|
450
|
-
});
|
|
451
|
-
fetch(`${INSTAGRAM_API}/me/media?${params.toString()}`).then((res) => res.json()).then((res) => {
|
|
452
|
-
if (res.error) {
|
|
453
|
-
setError(res);
|
|
454
|
-
} else {
|
|
455
|
-
setError(null);
|
|
456
|
-
setMedia([...res.data]);
|
|
457
|
-
}
|
|
458
|
-
}).catch(console.error);
|
|
459
|
-
}
|
|
416
|
+
var Instagram = (0, import_react8.forwardRef)((props, ref) => {
|
|
417
|
+
const { stitchesInstance } = (0, import_react8.useContext)(WeaverseContext);
|
|
418
|
+
const _a = props, { token, numberOfImages, imagesPerRow, className } = _a, rest = __objRest(_a, ["token", "numberOfImages", "imagesPerRow", "className"]);
|
|
419
|
+
const [media, setMedia] = (0, import_react8.useState)([]);
|
|
420
|
+
(0, import_react8.useEffect)(() => {
|
|
421
|
+
const url = `https://graph.instagram.com/me/media?fields=id,media_type,caption,media_url&access_token=${token}`;
|
|
422
|
+
fetch(url).then((res) => res.json()).then((res) => {
|
|
423
|
+
setMedia(res.data);
|
|
424
|
+
});
|
|
460
425
|
}, [token]);
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
ref
|
|
464
|
-
}, rest), /* @__PURE__ */ import_react9.default.createElement(Placeholder_default, {
|
|
465
|
-
element: "Instagram"
|
|
466
|
-
}, !token ? "Connect your Instagram account to display photos on your site." : "Invalid or expired token!"));
|
|
467
|
-
}
|
|
468
|
-
let style = {
|
|
469
|
-
"--wv-ig-images-per-row": imagesPerRow,
|
|
470
|
-
"--wv-ig-images-gap": gap
|
|
426
|
+
const css = {
|
|
427
|
+
gridTemplateColumns: `repeat(${imagesPerRow[0] || 1}, 1fr)`
|
|
471
428
|
};
|
|
472
|
-
|
|
429
|
+
const { className: instagramClass = "" } = stitchesInstance.css(css)();
|
|
430
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", __spreadValues({
|
|
431
|
+
className: `${className} ${instagramClass}`,
|
|
473
432
|
ref
|
|
474
|
-
}, rest), {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
linkProps = { href: item.permalink, target: "_blank" };
|
|
482
|
-
}
|
|
483
|
-
return /* @__PURE__ */ import_react9.default.createElement("a", __spreadValues({
|
|
484
|
-
key: item.id
|
|
485
|
-
}, linkProps), /* @__PURE__ */ import_react9.default.createElement("img", {
|
|
433
|
+
}, rest), !token ? "Token is empty" : media.map((item, key) => {
|
|
434
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
435
|
+
key,
|
|
436
|
+
className: "wv-instagram-item"
|
|
437
|
+
}, /* @__PURE__ */ import_react8.default.createElement("img", {
|
|
438
|
+
width: "100%",
|
|
439
|
+
height: "100%",
|
|
486
440
|
alt: item.caption,
|
|
487
441
|
src: item.media_url
|
|
488
442
|
}));
|
|
489
|
-
}))
|
|
443
|
+
}));
|
|
490
444
|
});
|
|
491
445
|
Instagram.defaultProps = {
|
|
492
446
|
token: "",
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
imagesPerRow: 4,
|
|
496
|
-
gap: 0,
|
|
447
|
+
numberOfImages: [12],
|
|
448
|
+
imagesPerRow: [4],
|
|
497
449
|
css: {
|
|
498
450
|
"@desktop": {
|
|
499
|
-
"
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
aspectRatio: "1 / 1",
|
|
508
|
-
width: "100%",
|
|
509
|
-
height: "100%",
|
|
510
|
-
objectFit: "cover"
|
|
451
|
+
display: "grid",
|
|
452
|
+
gridTemplateColumns: "repeat(4, 1fr)",
|
|
453
|
+
"& .wv-instagram-item": {
|
|
454
|
+
width: "100%",
|
|
455
|
+
height: "100%",
|
|
456
|
+
backgroundColor: "red",
|
|
457
|
+
"& img": {
|
|
458
|
+
objectFit: "contain"
|
|
511
459
|
}
|
|
512
460
|
}
|
|
513
461
|
}
|
|
@@ -564,13 +512,13 @@ var createRootContext = (configs) => {
|
|
|
564
512
|
});
|
|
565
513
|
return rootContext;
|
|
566
514
|
};
|
|
567
|
-
var WeaverseContext = (0,
|
|
515
|
+
var WeaverseContext = (0, import_react9.createContext)({});
|
|
568
516
|
var WeaverseContextProvider = WeaverseContext.Provider;
|
|
569
517
|
var WeaverseContextConsumer = WeaverseContext.Consumer;
|
|
570
518
|
|
|
571
519
|
// src/renderer.tsx
|
|
572
520
|
var import_core2 = require("@weaverse/core");
|
|
573
|
-
var
|
|
521
|
+
var import_react10 = __toESM(require("react"));
|
|
574
522
|
|
|
575
523
|
// src/utils/index.ts
|
|
576
524
|
var shortCssObject = (css) => {
|
|
@@ -598,9 +546,9 @@ function generateItemClass(instance, stitchesInstance) {
|
|
|
598
546
|
// src/renderer.tsx
|
|
599
547
|
var WeaverseRoot = ({ context }) => {
|
|
600
548
|
var _a;
|
|
601
|
-
let [, setData] = (0,
|
|
602
|
-
let rootRef = (0,
|
|
603
|
-
(0,
|
|
549
|
+
let [, setData] = (0, import_react10.useState)(context.projectData);
|
|
550
|
+
let rootRef = (0, import_react10.useRef)();
|
|
551
|
+
(0, import_react10.useEffect)(() => {
|
|
604
552
|
let update = () => setData({});
|
|
605
553
|
context.subscribe(update);
|
|
606
554
|
if (context.projectData) {
|
|
@@ -613,21 +561,21 @@ var WeaverseRoot = ({ context }) => {
|
|
|
613
561
|
}, []);
|
|
614
562
|
let eventHandlers = ((_a = context == null ? void 0 : context.studioBridge) == null ? void 0 : _a.eventHandlers) || {};
|
|
615
563
|
let themeClass = context.stitchesInstance.theme.className;
|
|
616
|
-
return /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", __spreadProps(__spreadValues({
|
|
617
565
|
className: `weaverse-content-root ${themeClass}`
|
|
618
566
|
}, eventHandlers), {
|
|
619
567
|
ref: rootRef
|
|
620
|
-
}), /* @__PURE__ */
|
|
568
|
+
}), /* @__PURE__ */ import_react10.default.createElement(WeaverseContextProvider, {
|
|
621
569
|
value: context
|
|
622
|
-
}, /* @__PURE__ */
|
|
570
|
+
}, /* @__PURE__ */ import_react10.default.createElement(ItemInstance, {
|
|
623
571
|
id: context.projectData.rootId || 0
|
|
624
572
|
})));
|
|
625
573
|
};
|
|
626
574
|
var ItemComponent = ({ instance }) => {
|
|
627
|
-
let { stitchesInstance, elementInstances } = (0,
|
|
628
|
-
let [data, setData] = (0,
|
|
575
|
+
let { stitchesInstance, elementInstances } = (0, import_react10.useContext)(WeaverseContext);
|
|
576
|
+
let [data, setData] = (0, import_react10.useState)(instance.data);
|
|
629
577
|
let _a = data, { id, type, childIds = [], css, className } = _a, rest = __objRest(_a, ["id", "type", "childIds", "css", "className"]);
|
|
630
|
-
(0,
|
|
578
|
+
(0, import_react10.useEffect)(() => {
|
|
631
579
|
var _a2;
|
|
632
580
|
let update = (data2) => setData(__spreadValues({}, data2));
|
|
633
581
|
instance.subscribe(update);
|
|
@@ -647,12 +595,12 @@ var ItemComponent = ({ instance }) => {
|
|
|
647
595
|
if (Component.$$typeof === Symbol.for("react.forward_ref")) {
|
|
648
596
|
rest.ref = instance.ref;
|
|
649
597
|
}
|
|
650
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ import_react10.default.createElement(Component, __spreadValues({
|
|
651
599
|
key: id,
|
|
652
600
|
"data-wv-type": type,
|
|
653
601
|
"data-wv-id": id,
|
|
654
602
|
className: generateItemClass(instance, stitchesInstance)
|
|
655
|
-
}, rest), childIds.map((id2) => /* @__PURE__ */
|
|
603
|
+
}, rest), childIds.map((id2) => /* @__PURE__ */ import_react10.default.createElement(ItemInstance, {
|
|
656
604
|
key: id2,
|
|
657
605
|
id: id2
|
|
658
606
|
})));
|
|
@@ -660,15 +608,15 @@ var ItemComponent = ({ instance }) => {
|
|
|
660
608
|
return null;
|
|
661
609
|
};
|
|
662
610
|
var ItemInstance = ({ id }) => {
|
|
663
|
-
let context = (0,
|
|
611
|
+
let context = (0, import_react10.useContext)(WeaverseContext);
|
|
664
612
|
let { itemInstances } = context;
|
|
665
613
|
let instance = itemInstances.get(id);
|
|
666
614
|
if (!instance) {
|
|
667
|
-
return /* @__PURE__ */
|
|
615
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
668
616
|
style: { display: "none" }
|
|
669
617
|
}, "Item instance ", id, " not found");
|
|
670
618
|
}
|
|
671
|
-
return /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ import_react10.default.createElement(ItemComponent, {
|
|
672
620
|
instance
|
|
673
621
|
});
|
|
674
622
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -382,102 +382,50 @@ Video.defaultProps = {
|
|
|
382
382
|
var video_default = Video;
|
|
383
383
|
|
|
384
384
|
// src/elements/instagram.tsx
|
|
385
|
-
import
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
var Placeholder = forwardRef8((props, ref) => {
|
|
390
|
-
let _a = props, { element, children } = _a, rest = __objRest(_a, ["element", "children"]);
|
|
391
|
-
let style = {
|
|
392
|
-
height: "100%",
|
|
393
|
-
display: "flex",
|
|
394
|
-
flexDirection: "column",
|
|
395
|
-
alignItems: "center",
|
|
396
|
-
justifyContent: "center",
|
|
397
|
-
color: "#374151"
|
|
398
|
-
};
|
|
399
|
-
return /* @__PURE__ */ React10.createElement("div", __spreadValues({
|
|
400
|
-
style,
|
|
401
|
-
ref
|
|
402
|
-
}, rest), /* @__PURE__ */ React10.createElement("div", {
|
|
403
|
-
style: { fontWeight: 600, marginBottom: "10px" }
|
|
404
|
-
}, element), /* @__PURE__ */ React10.createElement("div", null, children));
|
|
405
|
-
});
|
|
406
|
-
var Placeholder_default = Placeholder;
|
|
407
|
-
|
|
408
|
-
// src/elements/instagram.tsx
|
|
409
|
-
var INSTAGRAM_API = "https://graph.instagram.com";
|
|
410
|
-
var Instagram = forwardRef9((props, ref) => {
|
|
411
|
-
const _a = props, { token, username, numberOfImages, imagesPerRow, gap } = _a, rest = __objRest(_a, ["token", "username", "numberOfImages", "imagesPerRow", "gap"]);
|
|
385
|
+
import React10, { forwardRef as forwardRef8, useContext as useContext3, useEffect as useEffect2, useState } from "react";
|
|
386
|
+
var Instagram = forwardRef8((props, ref) => {
|
|
387
|
+
const { stitchesInstance } = useContext3(WeaverseContext);
|
|
388
|
+
const _a = props, { token, numberOfImages, imagesPerRow, className } = _a, rest = __objRest(_a, ["token", "numberOfImages", "imagesPerRow", "className"]);
|
|
412
389
|
const [media, setMedia] = useState([]);
|
|
413
|
-
const [error, setError] = useState(null);
|
|
414
|
-
let { isDesignMode } = useContext3(WeaverseContext);
|
|
415
390
|
useEffect2(() => {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
});
|
|
421
|
-
fetch(`${INSTAGRAM_API}/me/media?${params.toString()}`).then((res) => res.json()).then((res) => {
|
|
422
|
-
if (res.error) {
|
|
423
|
-
setError(res);
|
|
424
|
-
} else {
|
|
425
|
-
setError(null);
|
|
426
|
-
setMedia([...res.data]);
|
|
427
|
-
}
|
|
428
|
-
}).catch(console.error);
|
|
429
|
-
}
|
|
391
|
+
const url = `https://graph.instagram.com/me/media?fields=id,media_type,caption,media_url&access_token=${token}`;
|
|
392
|
+
fetch(url).then((res) => res.json()).then((res) => {
|
|
393
|
+
setMedia(res.data);
|
|
394
|
+
});
|
|
430
395
|
}, [token]);
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
ref
|
|
434
|
-
}, rest), /* @__PURE__ */ React11.createElement(Placeholder_default, {
|
|
435
|
-
element: "Instagram"
|
|
436
|
-
}, !token ? "Connect your Instagram account to display photos on your site." : "Invalid or expired token!"));
|
|
437
|
-
}
|
|
438
|
-
let style = {
|
|
439
|
-
"--wv-ig-images-per-row": imagesPerRow,
|
|
440
|
-
"--wv-ig-images-gap": gap
|
|
396
|
+
const css = {
|
|
397
|
+
gridTemplateColumns: `repeat(${imagesPerRow[0] || 1}, 1fr)`
|
|
441
398
|
};
|
|
442
|
-
|
|
399
|
+
const { className: instagramClass = "" } = stitchesInstance.css(css)();
|
|
400
|
+
return /* @__PURE__ */ React10.createElement("div", __spreadValues({
|
|
401
|
+
className: `${className} ${instagramClass}`,
|
|
443
402
|
ref
|
|
444
|
-
}, rest), {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
linkProps = { href: item.permalink, target: "_blank" };
|
|
452
|
-
}
|
|
453
|
-
return /* @__PURE__ */ React11.createElement("a", __spreadValues({
|
|
454
|
-
key: item.id
|
|
455
|
-
}, linkProps), /* @__PURE__ */ React11.createElement("img", {
|
|
403
|
+
}, rest), !token ? "Token is empty" : media.map((item, key) => {
|
|
404
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
405
|
+
key,
|
|
406
|
+
className: "wv-instagram-item"
|
|
407
|
+
}, /* @__PURE__ */ React10.createElement("img", {
|
|
408
|
+
width: "100%",
|
|
409
|
+
height: "100%",
|
|
456
410
|
alt: item.caption,
|
|
457
411
|
src: item.media_url
|
|
458
412
|
}));
|
|
459
|
-
}))
|
|
413
|
+
}));
|
|
460
414
|
});
|
|
461
415
|
Instagram.defaultProps = {
|
|
462
416
|
token: "",
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
imagesPerRow: 4,
|
|
466
|
-
gap: 0,
|
|
417
|
+
numberOfImages: [12],
|
|
418
|
+
imagesPerRow: [4],
|
|
467
419
|
css: {
|
|
468
420
|
"@desktop": {
|
|
469
|
-
"
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
aspectRatio: "1 / 1",
|
|
478
|
-
width: "100%",
|
|
479
|
-
height: "100%",
|
|
480
|
-
objectFit: "cover"
|
|
421
|
+
display: "grid",
|
|
422
|
+
gridTemplateColumns: "repeat(4, 1fr)",
|
|
423
|
+
"& .wv-instagram-item": {
|
|
424
|
+
width: "100%",
|
|
425
|
+
height: "100%",
|
|
426
|
+
backgroundColor: "red",
|
|
427
|
+
"& img": {
|
|
428
|
+
objectFit: "contain"
|
|
481
429
|
}
|
|
482
430
|
}
|
|
483
431
|
}
|
|
@@ -540,7 +488,7 @@ var WeaverseContextConsumer = WeaverseContext.Consumer;
|
|
|
540
488
|
|
|
541
489
|
// src/renderer.tsx
|
|
542
490
|
import { isBrowser } from "@weaverse/core";
|
|
543
|
-
import
|
|
491
|
+
import React11, { useContext as useContext4, useEffect as useEffect3, useRef, useState as useState2 } from "react";
|
|
544
492
|
|
|
545
493
|
// src/utils/index.ts
|
|
546
494
|
var shortCssObject = (css) => {
|
|
@@ -583,13 +531,13 @@ var WeaverseRoot = ({ context }) => {
|
|
|
583
531
|
}, []);
|
|
584
532
|
let eventHandlers = ((_a = context == null ? void 0 : context.studioBridge) == null ? void 0 : _a.eventHandlers) || {};
|
|
585
533
|
let themeClass = context.stitchesInstance.theme.className;
|
|
586
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ React11.createElement("div", __spreadProps(__spreadValues({
|
|
587
535
|
className: `weaverse-content-root ${themeClass}`
|
|
588
536
|
}, eventHandlers), {
|
|
589
537
|
ref: rootRef
|
|
590
|
-
}), /* @__PURE__ */
|
|
538
|
+
}), /* @__PURE__ */ React11.createElement(WeaverseContextProvider, {
|
|
591
539
|
value: context
|
|
592
|
-
}, /* @__PURE__ */
|
|
540
|
+
}, /* @__PURE__ */ React11.createElement(ItemInstance, {
|
|
593
541
|
id: context.projectData.rootId || 0
|
|
594
542
|
})));
|
|
595
543
|
};
|
|
@@ -617,12 +565,12 @@ var ItemComponent = ({ instance }) => {
|
|
|
617
565
|
if (Component.$$typeof === Symbol.for("react.forward_ref")) {
|
|
618
566
|
rest.ref = instance.ref;
|
|
619
567
|
}
|
|
620
|
-
return /* @__PURE__ */
|
|
568
|
+
return /* @__PURE__ */ React11.createElement(Component, __spreadValues({
|
|
621
569
|
key: id,
|
|
622
570
|
"data-wv-type": type,
|
|
623
571
|
"data-wv-id": id,
|
|
624
572
|
className: generateItemClass(instance, stitchesInstance)
|
|
625
|
-
}, rest), childIds.map((id2) => /* @__PURE__ */
|
|
573
|
+
}, rest), childIds.map((id2) => /* @__PURE__ */ React11.createElement(ItemInstance, {
|
|
626
574
|
key: id2,
|
|
627
575
|
id: id2
|
|
628
576
|
})));
|
|
@@ -634,11 +582,11 @@ var ItemInstance = ({ id }) => {
|
|
|
634
582
|
let { itemInstances } = context;
|
|
635
583
|
let instance = itemInstances.get(id);
|
|
636
584
|
if (!instance) {
|
|
637
|
-
return /* @__PURE__ */
|
|
585
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
638
586
|
style: { display: "none" }
|
|
639
587
|
}, "Item instance ", id, " not found");
|
|
640
588
|
}
|
|
641
|
-
return /* @__PURE__ */
|
|
589
|
+
return /* @__PURE__ */ React11.createElement(ItemComponent, {
|
|
642
590
|
instance
|
|
643
591
|
});
|
|
644
592
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.6.
|
|
2
|
+
"version": "0.6.21",
|
|
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.6.
|
|
34
|
+
"@weaverse/core": "0.6.21"
|
|
35
35
|
}
|
|
36
36
|
}
|