@weaverse/react 0.7.57 → 0.7.58
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 +40 -4
- package/dist/index.js +609 -391
- package/dist/index.mjs +601 -383
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -87,42 +87,6 @@ import React4, { forwardRef as forwardRef3, useContext as useContext2, useEffect
|
|
|
87
87
|
// src/constant/index.ts
|
|
88
88
|
var TIMES = ["days", "hours", "minutes", "seconds"];
|
|
89
89
|
var COUNTDOWN_KEY = "wv-cd-evergreen-start";
|
|
90
|
-
var INSTAGRAM_API = "https://graph.instagram.com";
|
|
91
|
-
|
|
92
|
-
// src/utils/css.ts
|
|
93
|
-
import clsx from "clsx";
|
|
94
|
-
function formatCSS(css10) {
|
|
95
|
-
return {
|
|
96
|
-
"@desktop": css10["@desktop"],
|
|
97
|
-
"@mobile": css10["@mobile"]
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
var permanentClasses = {};
|
|
101
|
-
function generateItemClassName(instance, stitchesInstance) {
|
|
102
|
-
let { css: css10, type, className: cls = "" } = instance.data;
|
|
103
|
-
let className = "";
|
|
104
|
-
let permanentClass = "";
|
|
105
|
-
let perCss = instance.Element?.permanentCss;
|
|
106
|
-
if (perCss) {
|
|
107
|
-
if (type in permanentClasses) {
|
|
108
|
-
permanentClass = permanentClasses[type];
|
|
109
|
-
} else {
|
|
110
|
-
let { className: perCls } = stitchesInstance.css(perCss)();
|
|
111
|
-
Object.assign(permanentClasses, { [type]: perCls });
|
|
112
|
-
permanentClass = perCls;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
className = permanentClass;
|
|
116
|
-
if (css10) {
|
|
117
|
-
let formattedCss = formatCSS(css10);
|
|
118
|
-
let newStitchesClass = stitchesInstance.css(formattedCss)().className || "";
|
|
119
|
-
let { stitchesClass } = instance;
|
|
120
|
-
let otherClass = (instance.ref.current?.className || "").replace(stitchesClass, "").replace(cls, "").replace(permanentClass, "").trim();
|
|
121
|
-
className = clsx(permanentClass, cls, newStitchesClass, otherClass);
|
|
122
|
-
instance.stitchesClass = newStitchesClass;
|
|
123
|
-
}
|
|
124
|
-
return className;
|
|
125
|
-
}
|
|
126
90
|
|
|
127
91
|
// src/utils/index.ts
|
|
128
92
|
function getTime(_seconds) {
|
|
@@ -239,7 +203,6 @@ var Countdown = forwardRef3(
|
|
|
239
203
|
);
|
|
240
204
|
var css3 = {
|
|
241
205
|
"@desktop": {
|
|
242
|
-
fontFamily: "Inter",
|
|
243
206
|
fontSize: "36px",
|
|
244
207
|
fontWeight: 500,
|
|
245
208
|
display: "flex",
|
|
@@ -662,39 +625,17 @@ Video.defaultProps = {
|
|
|
662
625
|
};
|
|
663
626
|
var Video_default = Video;
|
|
664
627
|
|
|
665
|
-
// src/elements/
|
|
666
|
-
import
|
|
667
|
-
|
|
668
|
-
// src/components/Placeholder.tsx
|
|
669
|
-
import React15, { forwardRef as forwardRef8 } from "react";
|
|
670
|
-
var Placeholder = forwardRef8(
|
|
671
|
-
(props, ref) => {
|
|
672
|
-
let { element, children, ...rest } = props;
|
|
673
|
-
return /* @__PURE__ */ React15.createElement("div", {
|
|
674
|
-
"data-wv-placeholder": true,
|
|
675
|
-
ref,
|
|
676
|
-
...rest
|
|
677
|
-
}, /* @__PURE__ */ React15.createElement("div", {
|
|
678
|
-
style: { fontWeight: 600, marginBottom: "10px" }
|
|
679
|
-
}, element), /* @__PURE__ */ React15.createElement("div", null, children));
|
|
680
|
-
}
|
|
681
|
-
);
|
|
682
|
-
var Placeholder_default = Placeholder;
|
|
628
|
+
// src/elements/Slideshow/index.tsx
|
|
629
|
+
import { useKeenSlider } from "keen-slider/react";
|
|
630
|
+
import React19, { forwardRef as forwardRef8, useEffect as useEffect2, useState } from "react";
|
|
683
631
|
|
|
684
|
-
// src/components/
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
ModalClose: () => ModalClose,
|
|
689
|
-
ModalContent: () => ModalContent,
|
|
690
|
-
ModalHeader: () => ModalHeader,
|
|
691
|
-
ModalTrigger: () => ModalTrigger
|
|
692
|
-
});
|
|
693
|
-
import { Close, Portal, Root, Trigger } from "@radix-ui/react-dialog";
|
|
694
|
-
import React18, { forwardRef as forwardRef9 } from "react";
|
|
632
|
+
// src/components/Slider/Arrows.tsx
|
|
633
|
+
import { styled } from "@stitches/react";
|
|
634
|
+
import clsx2 from "clsx";
|
|
635
|
+
import React17 from "react";
|
|
695
636
|
|
|
696
637
|
// src/components/Icons/index.tsx
|
|
697
|
-
import
|
|
638
|
+
import React16 from "react";
|
|
698
639
|
|
|
699
640
|
// src/components/Icons/Phosphor.tsx
|
|
700
641
|
var Phosphor_exports = {};
|
|
@@ -709,39 +650,39 @@ __export(Phosphor_exports, {
|
|
|
709
650
|
ShoppingCart: () => ShoppingCart,
|
|
710
651
|
X: () => X
|
|
711
652
|
});
|
|
712
|
-
import
|
|
653
|
+
import React15 from "react";
|
|
713
654
|
var CircleNotch = (props) => {
|
|
714
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
715
656
|
xmlns: "http://www.w3.org/2000/svg",
|
|
716
657
|
fill: "none",
|
|
717
658
|
viewBox: "0 0 24 24",
|
|
718
659
|
...props
|
|
719
|
-
}, /* @__PURE__ */
|
|
660
|
+
}, /* @__PURE__ */ React15.createElement("circle", {
|
|
720
661
|
style: { opacity: ".25" },
|
|
721
662
|
cx: "12",
|
|
722
663
|
cy: "12",
|
|
723
664
|
r: "10",
|
|
724
665
|
stroke: "currentColor",
|
|
725
666
|
strokeWidth: "4"
|
|
726
|
-
}), /* @__PURE__ */
|
|
667
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
727
668
|
style: { opacity: ".75" },
|
|
728
669
|
fill: "currentColor",
|
|
729
670
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
730
671
|
}));
|
|
731
672
|
};
|
|
732
673
|
var X = (props) => {
|
|
733
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
734
675
|
xmlns: "http://www.w3.org/2000/svg",
|
|
735
676
|
width: "20",
|
|
736
677
|
height: "20",
|
|
737
678
|
fill: "currentColor",
|
|
738
679
|
viewBox: "0 0 256 256",
|
|
739
680
|
...props
|
|
740
|
-
}, /* @__PURE__ */
|
|
681
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
741
682
|
width: "256",
|
|
742
683
|
height: "256",
|
|
743
684
|
fill: "none"
|
|
744
|
-
}), /* @__PURE__ */
|
|
685
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
745
686
|
x1: "200",
|
|
746
687
|
y1: "56",
|
|
747
688
|
x2: "56",
|
|
@@ -751,7 +692,7 @@ var X = (props) => {
|
|
|
751
692
|
strokeLinecap: "round",
|
|
752
693
|
strokeLinejoin: "round",
|
|
753
694
|
strokeWidth: "12"
|
|
754
|
-
}), /* @__PURE__ */
|
|
695
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
755
696
|
x1: "200",
|
|
756
697
|
y1: "200",
|
|
757
698
|
x2: "56",
|
|
@@ -764,7 +705,7 @@ var X = (props) => {
|
|
|
764
705
|
}));
|
|
765
706
|
};
|
|
766
707
|
var Minus = (props) => {
|
|
767
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
768
709
|
width: "196",
|
|
769
710
|
height: "196",
|
|
770
711
|
fill: "currentColor",
|
|
@@ -772,12 +713,12 @@ var Minus = (props) => {
|
|
|
772
713
|
xmlns: "http://www.w3.org/2000/svg",
|
|
773
714
|
viewBox: "0 0 384 512",
|
|
774
715
|
...props
|
|
775
|
-
}, /* @__PURE__ */
|
|
716
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
776
717
|
d: "M376 232H8c-4.42 0-8 3.58-8 8v32c0 4.42 3.58 8 8 8h368c4.42 0 8-3.58 8-8v-32c0-4.42-3.58-8-8-8z"
|
|
777
718
|
}));
|
|
778
719
|
};
|
|
779
720
|
var Plus = (props) => {
|
|
780
|
-
return /* @__PURE__ */
|
|
721
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
781
722
|
width: "196",
|
|
782
723
|
height: "196",
|
|
783
724
|
fill: "currentColor",
|
|
@@ -785,23 +726,23 @@ var Plus = (props) => {
|
|
|
785
726
|
xmlns: "http://www.w3.org/2000/svg",
|
|
786
727
|
viewBox: "0 0 384 512",
|
|
787
728
|
...props
|
|
788
|
-
}, /* @__PURE__ */
|
|
729
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
789
730
|
d: "M376 232H216V72c0-4.42-3.58-8-8-8h-32c-4.42 0-8 3.58-8 8v160H8c-4.42 0-8 3.58-8 8v32c0 4.42 3.58 8 8 8h160v160c0 4.42 3.58 8 8 8h32c4.42 0 8-3.58 8-8V280h160c4.42 0 8-3.58 8-8v-32c0-4.42-3.58-8-8-8z"
|
|
790
731
|
}));
|
|
791
732
|
};
|
|
792
733
|
var ArrowLeft = (props) => {
|
|
793
|
-
return /* @__PURE__ */
|
|
734
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
794
735
|
xmlns: "http://www.w3.org/2000/svg",
|
|
795
736
|
width: "192",
|
|
796
737
|
height: "192",
|
|
797
738
|
fill: "currentColor",
|
|
798
739
|
viewBox: "0 0 256 256",
|
|
799
740
|
...props
|
|
800
|
-
}, /* @__PURE__ */
|
|
741
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
801
742
|
width: "256",
|
|
802
743
|
height: "256",
|
|
803
744
|
fill: "none"
|
|
804
|
-
}), /* @__PURE__ */
|
|
745
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
805
746
|
x1: "216",
|
|
806
747
|
y1: "128",
|
|
807
748
|
x2: "40",
|
|
@@ -811,7 +752,7 @@ var ArrowLeft = (props) => {
|
|
|
811
752
|
strokeLinecap: "round",
|
|
812
753
|
strokeLinejoin: "round",
|
|
813
754
|
strokeWidth: "16"
|
|
814
|
-
}), /* @__PURE__ */
|
|
755
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
815
756
|
points: "112 56 40 128 112 200",
|
|
816
757
|
fill: "none",
|
|
817
758
|
stroke: "currentColor",
|
|
@@ -821,18 +762,18 @@ var ArrowLeft = (props) => {
|
|
|
821
762
|
}));
|
|
822
763
|
};
|
|
823
764
|
var ArrowRight = (props) => {
|
|
824
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
825
766
|
xmlns: "http://www.w3.org/2000/svg",
|
|
826
767
|
width: "192",
|
|
827
768
|
height: "192",
|
|
828
769
|
fill: "currentColor",
|
|
829
770
|
viewBox: "0 0 256 256",
|
|
830
771
|
...props
|
|
831
|
-
}, /* @__PURE__ */
|
|
772
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
832
773
|
width: "256",
|
|
833
774
|
height: "256",
|
|
834
775
|
fill: "none"
|
|
835
|
-
}), /* @__PURE__ */
|
|
776
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
836
777
|
x1: "40",
|
|
837
778
|
y1: "128",
|
|
838
779
|
x2: "216",
|
|
@@ -842,7 +783,7 @@ var ArrowRight = (props) => {
|
|
|
842
783
|
strokeLinecap: "round",
|
|
843
784
|
strokeLinejoin: "round",
|
|
844
785
|
strokeWidth: "16"
|
|
845
|
-
}), /* @__PURE__ */
|
|
786
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
846
787
|
points: "144 56 216 128 144 200",
|
|
847
788
|
fill: "none",
|
|
848
789
|
stroke: "currentColor",
|
|
@@ -852,36 +793,36 @@ var ArrowRight = (props) => {
|
|
|
852
793
|
}));
|
|
853
794
|
};
|
|
854
795
|
var Image2 = (props) => {
|
|
855
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
856
797
|
xmlns: "http://www.w3.org/2000/svg",
|
|
857
798
|
"aria-hidden": "true",
|
|
858
799
|
fill: "currentColor",
|
|
859
800
|
viewBox: "0 0 640 512",
|
|
860
801
|
...props
|
|
861
|
-
}, /* @__PURE__ */
|
|
802
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
862
803
|
d: "M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"
|
|
863
804
|
}));
|
|
864
805
|
};
|
|
865
806
|
var ShoppingCart = (props) => {
|
|
866
|
-
return /* @__PURE__ */
|
|
807
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
867
808
|
xmlns: "http://www.w3.org/2000/svg",
|
|
868
809
|
width: "192",
|
|
869
810
|
height: "192",
|
|
870
811
|
fill: "currentColor",
|
|
871
812
|
viewBox: "0 0 256 256",
|
|
872
813
|
...props
|
|
873
|
-
}, /* @__PURE__ */
|
|
814
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
874
815
|
width: "256",
|
|
875
816
|
height: "256",
|
|
876
817
|
fill: "none"
|
|
877
|
-
}), /* @__PURE__ */
|
|
818
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
878
819
|
d: "M184,184H69.8L41.9,30.6A8,8,0,0,0,34.1,24H16",
|
|
879
820
|
fill: "none",
|
|
880
821
|
stroke: "currentColor",
|
|
881
822
|
strokeLinecap: "round",
|
|
882
823
|
strokeLinejoin: "round",
|
|
883
824
|
strokeWidth: "16"
|
|
884
|
-
}), /* @__PURE__ */
|
|
825
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
885
826
|
cx: "80",
|
|
886
827
|
cy: "204",
|
|
887
828
|
r: "20",
|
|
@@ -890,7 +831,7 @@ var ShoppingCart = (props) => {
|
|
|
890
831
|
strokeLinecap: "round",
|
|
891
832
|
strokeLinejoin: "round",
|
|
892
833
|
strokeWidth: "16"
|
|
893
|
-
}), /* @__PURE__ */
|
|
834
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
894
835
|
cx: "184",
|
|
895
836
|
cy: "204",
|
|
896
837
|
r: "20",
|
|
@@ -899,7 +840,7 @@ var ShoppingCart = (props) => {
|
|
|
899
840
|
strokeLinecap: "round",
|
|
900
841
|
strokeLinejoin: "round",
|
|
901
842
|
strokeWidth: "16"
|
|
902
|
-
}), /* @__PURE__ */
|
|
843
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
903
844
|
d: "M62.5,144H188.1a15.9,15.9,0,0,0,15.7-13.1L216,64H48",
|
|
904
845
|
fill: "none",
|
|
905
846
|
stroke: "currentColor",
|
|
@@ -909,25 +850,25 @@ var ShoppingCart = (props) => {
|
|
|
909
850
|
}));
|
|
910
851
|
};
|
|
911
852
|
var Eye = (props) => {
|
|
912
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
913
854
|
xmlns: "http://www.w3.org/2000/svg",
|
|
914
855
|
width: "192",
|
|
915
856
|
height: "192",
|
|
916
857
|
fill: "currentColor",
|
|
917
858
|
viewBox: "0 0 256 256",
|
|
918
859
|
...props
|
|
919
|
-
}, /* @__PURE__ */
|
|
860
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
920
861
|
width: "256",
|
|
921
862
|
height: "256",
|
|
922
863
|
fill: "none"
|
|
923
|
-
}), /* @__PURE__ */
|
|
864
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
924
865
|
d: "M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Z",
|
|
925
866
|
fill: "none",
|
|
926
867
|
stroke: "currentColor",
|
|
927
868
|
strokeLinecap: "round",
|
|
928
869
|
strokeLinejoin: "round",
|
|
929
870
|
strokeWidth: "12"
|
|
930
|
-
}), /* @__PURE__ */
|
|
871
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
931
872
|
cx: "128",
|
|
932
873
|
cy: "128",
|
|
933
874
|
r: "40",
|
|
@@ -940,19 +881,528 @@ var Eye = (props) => {
|
|
|
940
881
|
};
|
|
941
882
|
|
|
942
883
|
// src/components/Icons/index.tsx
|
|
943
|
-
import
|
|
884
|
+
import clsx from "clsx";
|
|
944
885
|
function Icon({ name, className, ...props }) {
|
|
945
886
|
let WeaverseIcon = Phosphor_exports[name];
|
|
946
|
-
let cls =
|
|
947
|
-
return /* @__PURE__ */
|
|
887
|
+
let cls = clsx("wv-icon", className);
|
|
888
|
+
return /* @__PURE__ */ React16.createElement(WeaverseIcon, {
|
|
948
889
|
className: cls,
|
|
949
890
|
...props
|
|
950
891
|
});
|
|
951
892
|
}
|
|
952
893
|
|
|
894
|
+
// src/components/Slider/Arrows.tsx
|
|
895
|
+
function Arrows(props) {
|
|
896
|
+
let { currentSlide, instanceRef, className } = props;
|
|
897
|
+
let isFirstSlide = currentSlide === 0;
|
|
898
|
+
let isLastSlide = false;
|
|
899
|
+
if (instanceRef.current) {
|
|
900
|
+
isLastSlide = currentSlide === instanceRef?.current?.track?.details?.maxIdx;
|
|
901
|
+
}
|
|
902
|
+
let arrowLeftClass = clsx2(
|
|
903
|
+
"wv-slider-arrow arrow--left",
|
|
904
|
+
isFirstSlide && "arrow--disabled"
|
|
905
|
+
);
|
|
906
|
+
let arrowRightClass = clsx2(
|
|
907
|
+
"wv-slider-arrow arrow--right",
|
|
908
|
+
isLastSlide && "arrow--disabled"
|
|
909
|
+
);
|
|
910
|
+
return /* @__PURE__ */ React17.createElement(StyledArrows, {
|
|
911
|
+
className
|
|
912
|
+
}, /* @__PURE__ */ React17.createElement("button", {
|
|
913
|
+
type: "button",
|
|
914
|
+
className: arrowLeftClass,
|
|
915
|
+
onClick: (e) => {
|
|
916
|
+
e.stopPropagation();
|
|
917
|
+
instanceRef?.current?.prev();
|
|
918
|
+
}
|
|
919
|
+
}, /* @__PURE__ */ React17.createElement(Icon, {
|
|
920
|
+
name: "ArrowLeft"
|
|
921
|
+
})), /* @__PURE__ */ React17.createElement("button", {
|
|
922
|
+
type: "button",
|
|
923
|
+
className: arrowRightClass,
|
|
924
|
+
onClick: (e) => {
|
|
925
|
+
e.stopPropagation();
|
|
926
|
+
instanceRef?.current?.next();
|
|
927
|
+
}
|
|
928
|
+
}, /* @__PURE__ */ React17.createElement(Icon, {
|
|
929
|
+
name: "ArrowRight"
|
|
930
|
+
})));
|
|
931
|
+
}
|
|
932
|
+
var StyledArrows = styled("div", {
|
|
933
|
+
".wv-slider-arrow": {
|
|
934
|
+
position: "absolute",
|
|
935
|
+
top: "50%",
|
|
936
|
+
transform: "translateY(-50%)",
|
|
937
|
+
width: "44px",
|
|
938
|
+
height: "44px",
|
|
939
|
+
padding: "8px",
|
|
940
|
+
color: "#191919",
|
|
941
|
+
backgroundColor: "#f2f2f2",
|
|
942
|
+
textAlign: "center",
|
|
943
|
+
transition: "all 0.2s ease-in-out",
|
|
944
|
+
borderRadius: "4px",
|
|
945
|
+
border: "none",
|
|
946
|
+
cursor: "pointer",
|
|
947
|
+
"&:hover": {
|
|
948
|
+
backgroundColor: "#191919",
|
|
949
|
+
color: "#f2f2f2"
|
|
950
|
+
},
|
|
951
|
+
svg: {
|
|
952
|
+
verticalAlign: "middle",
|
|
953
|
+
width: "22px",
|
|
954
|
+
height: "22px"
|
|
955
|
+
},
|
|
956
|
+
"&.arrow--left": {
|
|
957
|
+
left: "-80px"
|
|
958
|
+
},
|
|
959
|
+
"&.arrow--right": {
|
|
960
|
+
right: "-80px"
|
|
961
|
+
},
|
|
962
|
+
"&.arrow--disabled": {
|
|
963
|
+
opacity: 0.5
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
"@media (max-width: 768px)": {
|
|
967
|
+
".wv-slider-arrow": {
|
|
968
|
+
display: "none"
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
// src/components/Slider/Dots.tsx
|
|
974
|
+
import { styled as styled2 } from "@stitches/react";
|
|
975
|
+
import clsx3 from "clsx";
|
|
976
|
+
import React18 from "react";
|
|
977
|
+
function Dots(props) {
|
|
978
|
+
let { currentSlide, instanceRef, className } = props;
|
|
979
|
+
return /* @__PURE__ */ React18.createElement(StyledDots, {
|
|
980
|
+
className
|
|
981
|
+
}, [...Array(instanceRef.current?.track.details.slides.length).keys()].map(
|
|
982
|
+
(idx) => {
|
|
983
|
+
let className2 = clsx3("dot", currentSlide === idx && "dot--active");
|
|
984
|
+
return /* @__PURE__ */ React18.createElement("button", {
|
|
985
|
+
key: idx,
|
|
986
|
+
type: "button",
|
|
987
|
+
onClick: () => instanceRef.current?.moveToIdx(idx),
|
|
988
|
+
className: className2
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
));
|
|
992
|
+
}
|
|
993
|
+
var StyledDots = styled2("div", {
|
|
994
|
+
padding: "10px 0",
|
|
995
|
+
justifyContent: "center",
|
|
996
|
+
".dot": {
|
|
997
|
+
width: "9px",
|
|
998
|
+
height: "9px",
|
|
999
|
+
padding: "0",
|
|
1000
|
+
margin: "0 5px",
|
|
1001
|
+
border: "none",
|
|
1002
|
+
borderRadius: "50%",
|
|
1003
|
+
background: "#2125291a",
|
|
1004
|
+
transition: "all 0.2s ease-in-out",
|
|
1005
|
+
"&.dot--active": {
|
|
1006
|
+
background: "#212529"
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
// src/components/Slider/ResizePlugin.ts
|
|
1012
|
+
var ResizePlugin = (slider) => {
|
|
1013
|
+
let observer = new ResizeObserver(() => slider.update());
|
|
1014
|
+
slider.on("created", () => {
|
|
1015
|
+
observer.observe(slider.container);
|
|
1016
|
+
});
|
|
1017
|
+
slider.on("destroyed", () => {
|
|
1018
|
+
observer.unobserve(slider.container);
|
|
1019
|
+
});
|
|
1020
|
+
};
|
|
1021
|
+
|
|
1022
|
+
// src/utils/css.ts
|
|
1023
|
+
import clsx4 from "clsx";
|
|
1024
|
+
function formatCSS(css11) {
|
|
1025
|
+
return {
|
|
1026
|
+
"@desktop": css11["@desktop"],
|
|
1027
|
+
"@mobile": css11["@mobile"]
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
var permanentClasses = {};
|
|
1031
|
+
function generateItemClassName(instance, stitchesInstance) {
|
|
1032
|
+
let { css: css11, type, className: cls = "" } = instance.data;
|
|
1033
|
+
let className = "";
|
|
1034
|
+
let permanentClass = "";
|
|
1035
|
+
let perCss = instance.Element?.permanentCss;
|
|
1036
|
+
if (perCss) {
|
|
1037
|
+
if (type in permanentClasses) {
|
|
1038
|
+
permanentClass = permanentClasses[type];
|
|
1039
|
+
} else {
|
|
1040
|
+
let { className: perCls } = stitchesInstance.css(perCss)();
|
|
1041
|
+
Object.assign(permanentClasses, { [type]: perCls });
|
|
1042
|
+
permanentClass = perCls;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
className = permanentClass;
|
|
1046
|
+
if (css11) {
|
|
1047
|
+
let formattedCss = formatCSS(css11);
|
|
1048
|
+
let newStitchesClass = stitchesInstance.css(formattedCss)().className || "";
|
|
1049
|
+
let { stitchesClass } = instance;
|
|
1050
|
+
let otherClass = (instance.ref.current?.className || "").replace(stitchesClass, "").replace(cls, "").replace(permanentClass, "").trim();
|
|
1051
|
+
className = clsx4(permanentClass, cls, newStitchesClass, otherClass);
|
|
1052
|
+
instance.stitchesClass = newStitchesClass;
|
|
1053
|
+
}
|
|
1054
|
+
return className;
|
|
1055
|
+
}
|
|
1056
|
+
function loadCSS(attrs) {
|
|
1057
|
+
return new Promise((resolve, reject) => {
|
|
1058
|
+
let found = document.querySelector(`link[href="${attrs.href}"]`);
|
|
1059
|
+
if (found) {
|
|
1060
|
+
return resolve(true);
|
|
1061
|
+
}
|
|
1062
|
+
let link = document.createElement("link");
|
|
1063
|
+
Object.assign(link, attrs);
|
|
1064
|
+
link.addEventListener("load", () => resolve(true));
|
|
1065
|
+
link.onerror = reject;
|
|
1066
|
+
document.head.appendChild(link);
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// src/elements/Slideshow/index.tsx
|
|
1071
|
+
var Slideshow = forwardRef8((props, ref) => {
|
|
1072
|
+
let {
|
|
1073
|
+
animation,
|
|
1074
|
+
slidesPerView,
|
|
1075
|
+
spacing,
|
|
1076
|
+
showArrows,
|
|
1077
|
+
showDots,
|
|
1078
|
+
dotsPosition,
|
|
1079
|
+
autoRotate,
|
|
1080
|
+
changeSlidesEvery,
|
|
1081
|
+
children,
|
|
1082
|
+
...rest
|
|
1083
|
+
} = props;
|
|
1084
|
+
let [cssLoaded, setCssLoaded] = useState(false);
|
|
1085
|
+
let [created, setCreated] = useState(false);
|
|
1086
|
+
let [ready, setReady] = useState(false);
|
|
1087
|
+
let [currentSlide, setCurrentSlide] = useState(0);
|
|
1088
|
+
let [sliderRef, instanceRef] = useKeenSlider(
|
|
1089
|
+
{
|
|
1090
|
+
slides: {
|
|
1091
|
+
perView: slidesPerView
|
|
1092
|
+
},
|
|
1093
|
+
created: () => {
|
|
1094
|
+
setCreated(true);
|
|
1095
|
+
},
|
|
1096
|
+
slideChanged: (slider) => {
|
|
1097
|
+
setCurrentSlide(slider.track.details.rel);
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
[ResizePlugin]
|
|
1101
|
+
);
|
|
1102
|
+
useEffect2(() => {
|
|
1103
|
+
loadCSS({
|
|
1104
|
+
rel: "stylesheet",
|
|
1105
|
+
href: "https://cdn.jsdelivr.net/npm/keen-slider@latest/keen-slider.min.css"
|
|
1106
|
+
}).then(() => setCssLoaded(true));
|
|
1107
|
+
}, []);
|
|
1108
|
+
useEffect2(() => {
|
|
1109
|
+
if (created && cssLoaded) {
|
|
1110
|
+
setReady(true);
|
|
1111
|
+
}
|
|
1112
|
+
}, [created, cssLoaded]);
|
|
1113
|
+
let style = {
|
|
1114
|
+
"--slider-opacity": ready ? 1 : 0
|
|
1115
|
+
};
|
|
1116
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1117
|
+
ref,
|
|
1118
|
+
style,
|
|
1119
|
+
...rest
|
|
1120
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
1121
|
+
ref: sliderRef,
|
|
1122
|
+
className: "keen-slider"
|
|
1123
|
+
}, children), showArrows && created && instanceRef?.current && /* @__PURE__ */ React19.createElement(Arrows, {
|
|
1124
|
+
instanceRef,
|
|
1125
|
+
currentSlide,
|
|
1126
|
+
className: "wv-slideshow--arrows"
|
|
1127
|
+
}), showDots && created && instanceRef?.current && /* @__PURE__ */ React19.createElement(Dots, {
|
|
1128
|
+
instanceRef,
|
|
1129
|
+
currentSlide,
|
|
1130
|
+
className: "wv-slideshow--dots"
|
|
1131
|
+
}));
|
|
1132
|
+
});
|
|
1133
|
+
var css9 = {
|
|
1134
|
+
"@desktop": {
|
|
1135
|
+
opacity: "var(--slider-opacity, 0)",
|
|
1136
|
+
padding: "32px 0",
|
|
1137
|
+
".keen-slider": {
|
|
1138
|
+
height: "100%"
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1142
|
+
Slideshow.defaultProps = {
|
|
1143
|
+
animation: "fade",
|
|
1144
|
+
slidesPerView: 1,
|
|
1145
|
+
spacing: 0,
|
|
1146
|
+
showArrows: true,
|
|
1147
|
+
showDots: true,
|
|
1148
|
+
dotsPosition: "bottom",
|
|
1149
|
+
autoRotate: false,
|
|
1150
|
+
changeSlidesEvery: 5
|
|
1151
|
+
};
|
|
1152
|
+
var Slideshow_default = Slideshow;
|
|
1153
|
+
|
|
1154
|
+
// src/elements/Slideshow/Slide.tsx
|
|
1155
|
+
import React22, { forwardRef as forwardRef9 } from "react";
|
|
1156
|
+
|
|
1157
|
+
// src/components/Background.tsx
|
|
1158
|
+
import { styled as styled3 } from "@stitches/react";
|
|
1159
|
+
import React20 from "react";
|
|
1160
|
+
function Background2(props) {
|
|
1161
|
+
let {
|
|
1162
|
+
backgroundColor,
|
|
1163
|
+
backgroundImage,
|
|
1164
|
+
backgroundFit,
|
|
1165
|
+
backgroundPosition,
|
|
1166
|
+
className
|
|
1167
|
+
} = props;
|
|
1168
|
+
let style = {
|
|
1169
|
+
["--bg-color"]: backgroundColor,
|
|
1170
|
+
["--bg-fit"]: backgroundFit,
|
|
1171
|
+
["--bg-position"]: backgroundPosition
|
|
1172
|
+
};
|
|
1173
|
+
if (backgroundImage || backgroundColor) {
|
|
1174
|
+
return /* @__PURE__ */ React20.createElement(StyledBackground, {
|
|
1175
|
+
style,
|
|
1176
|
+
className
|
|
1177
|
+
}, backgroundImage && /* @__PURE__ */ React20.createElement("img", {
|
|
1178
|
+
width: "100%",
|
|
1179
|
+
height: "100%",
|
|
1180
|
+
"data-blink-src": backgroundImage,
|
|
1181
|
+
alt: "Background"
|
|
1182
|
+
}));
|
|
1183
|
+
}
|
|
1184
|
+
return null;
|
|
1185
|
+
}
|
|
1186
|
+
var StyledBackground = styled3("div", {
|
|
1187
|
+
display: "block !important",
|
|
1188
|
+
position: "absolute",
|
|
1189
|
+
inset: 0,
|
|
1190
|
+
backgroundColor: "var(--bg-color)",
|
|
1191
|
+
img: {
|
|
1192
|
+
objectFit: "var(--bg-fit, cover)",
|
|
1193
|
+
objectPosition: "var(--bg-position, 50% 50%)"
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
|
|
1197
|
+
// src/components/Overlay.tsx
|
|
1198
|
+
import { styled as styled4 } from "@stitches/react";
|
|
1199
|
+
import React21 from "react";
|
|
1200
|
+
function Overlay2(props) {
|
|
1201
|
+
let { enableOverlay: enabled, overlayOpacity: opacity, className } = props;
|
|
1202
|
+
if (enabled) {
|
|
1203
|
+
return /* @__PURE__ */ React21.createElement(StyledOverlay, {
|
|
1204
|
+
className,
|
|
1205
|
+
css: { ["--overlay-opacity"]: opacity / 100 }
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
return null;
|
|
1209
|
+
}
|
|
1210
|
+
var StyledOverlay = styled4("div", {
|
|
1211
|
+
display: "block !important",
|
|
1212
|
+
position: "absolute",
|
|
1213
|
+
inset: 0,
|
|
1214
|
+
backgroundColor: "rgba(0, 0, 0, var(--overlay-opacity, .3))"
|
|
1215
|
+
});
|
|
1216
|
+
|
|
1217
|
+
// src/elements/Slideshow/position.ts
|
|
1218
|
+
var slidePositionMap = {
|
|
1219
|
+
"top left": {
|
|
1220
|
+
justifyContent: "flex-start",
|
|
1221
|
+
alignItems: "flex-start"
|
|
1222
|
+
},
|
|
1223
|
+
"top center": {
|
|
1224
|
+
justifyContent: "flex-start",
|
|
1225
|
+
alignItems: "center"
|
|
1226
|
+
},
|
|
1227
|
+
"top right": {
|
|
1228
|
+
justifyContent: "flex-start",
|
|
1229
|
+
alignItems: "flex-end"
|
|
1230
|
+
},
|
|
1231
|
+
"center left": {
|
|
1232
|
+
justifyContent: "center",
|
|
1233
|
+
alignItems: "flex-start"
|
|
1234
|
+
},
|
|
1235
|
+
"center center": {
|
|
1236
|
+
justifyContent: "center",
|
|
1237
|
+
alignItems: "center"
|
|
1238
|
+
},
|
|
1239
|
+
"center right": {
|
|
1240
|
+
justifyContent: "center",
|
|
1241
|
+
alignItems: "flex-end"
|
|
1242
|
+
},
|
|
1243
|
+
"bottom left": {
|
|
1244
|
+
justifyContent: "flex-end",
|
|
1245
|
+
alignItems: "flex-start"
|
|
1246
|
+
},
|
|
1247
|
+
"bottom center": {
|
|
1248
|
+
justifyContent: "flex-end",
|
|
1249
|
+
alignItems: "center"
|
|
1250
|
+
},
|
|
1251
|
+
"bottom right": {
|
|
1252
|
+
justifyContent: "flex-end",
|
|
1253
|
+
alignItems: "flex-end"
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
// src/elements/Slideshow/Slide.tsx
|
|
1258
|
+
var Slide = forwardRef9((props, ref) => {
|
|
1259
|
+
let {
|
|
1260
|
+
contentPosition,
|
|
1261
|
+
backgroundColor,
|
|
1262
|
+
backgroundImage,
|
|
1263
|
+
backgroundFit,
|
|
1264
|
+
backgroundPosition,
|
|
1265
|
+
enableOverlay,
|
|
1266
|
+
overlayOpacity,
|
|
1267
|
+
children,
|
|
1268
|
+
...rest
|
|
1269
|
+
} = props;
|
|
1270
|
+
let style = slidePositionMap[contentPosition];
|
|
1271
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
1272
|
+
className: "keen-slider__slide"
|
|
1273
|
+
}, /* @__PURE__ */ React22.createElement(Background2, {
|
|
1274
|
+
backgroundColor,
|
|
1275
|
+
backgroundImage,
|
|
1276
|
+
backgroundFit,
|
|
1277
|
+
backgroundPosition,
|
|
1278
|
+
className: "slide-background"
|
|
1279
|
+
}), /* @__PURE__ */ React22.createElement(Overlay2, {
|
|
1280
|
+
enableOverlay,
|
|
1281
|
+
overlayOpacity,
|
|
1282
|
+
className: "slide-overlay"
|
|
1283
|
+
}), /* @__PURE__ */ React22.createElement("div", {
|
|
1284
|
+
ref,
|
|
1285
|
+
style,
|
|
1286
|
+
...rest
|
|
1287
|
+
}, children?.length ? children : "Add element here"));
|
|
1288
|
+
});
|
|
1289
|
+
var css10 = {
|
|
1290
|
+
"@desktop": {
|
|
1291
|
+
position: "relative",
|
|
1292
|
+
height: "100%",
|
|
1293
|
+
width: "1224px",
|
|
1294
|
+
margin: "0 auto",
|
|
1295
|
+
display: "flex",
|
|
1296
|
+
flexDirection: "column",
|
|
1297
|
+
padding: "100px 20px"
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
Slide.defaultProps = {
|
|
1301
|
+
contentPosition: "center center",
|
|
1302
|
+
backgroundFit: "cover",
|
|
1303
|
+
backgroundPosition: "center center",
|
|
1304
|
+
enableOverlay: false,
|
|
1305
|
+
overlayOpacity: 30
|
|
1306
|
+
};
|
|
1307
|
+
var Slide_default = Slide;
|
|
1308
|
+
|
|
1309
|
+
// src/elements/index.ts
|
|
1310
|
+
var Elements = {
|
|
1311
|
+
Countdown: {
|
|
1312
|
+
Component: Countdown_default,
|
|
1313
|
+
type: "countdown",
|
|
1314
|
+
defaultCss: css3
|
|
1315
|
+
},
|
|
1316
|
+
Button: {
|
|
1317
|
+
Component: Button_default,
|
|
1318
|
+
type: "button",
|
|
1319
|
+
defaultCss: css
|
|
1320
|
+
},
|
|
1321
|
+
Container: {
|
|
1322
|
+
Component: Container_default,
|
|
1323
|
+
type: "container",
|
|
1324
|
+
defaultCss: css2
|
|
1325
|
+
},
|
|
1326
|
+
Image: {
|
|
1327
|
+
Component: Image_default,
|
|
1328
|
+
type: "image",
|
|
1329
|
+
defaultCss: css4
|
|
1330
|
+
},
|
|
1331
|
+
Layout: {
|
|
1332
|
+
Component: Layout_default,
|
|
1333
|
+
type: "layout",
|
|
1334
|
+
defaultCss: css5
|
|
1335
|
+
},
|
|
1336
|
+
Map: {
|
|
1337
|
+
Component: Map_default,
|
|
1338
|
+
type: "map",
|
|
1339
|
+
defaultCss: css6
|
|
1340
|
+
},
|
|
1341
|
+
Text: {
|
|
1342
|
+
Component: Text_default,
|
|
1343
|
+
type: "text",
|
|
1344
|
+
defaultCss: css7
|
|
1345
|
+
},
|
|
1346
|
+
Video: {
|
|
1347
|
+
Component: Video_default,
|
|
1348
|
+
type: "video",
|
|
1349
|
+
defaultCss: css8
|
|
1350
|
+
},
|
|
1351
|
+
Slideshow: {
|
|
1352
|
+
Component: Slideshow_default,
|
|
1353
|
+
type: "slideshow",
|
|
1354
|
+
defaultCss: css9
|
|
1355
|
+
},
|
|
1356
|
+
Slide: {
|
|
1357
|
+
Component: Slide_default,
|
|
1358
|
+
type: "slide",
|
|
1359
|
+
defaultCss: css10
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
// src/context.ts
|
|
1364
|
+
var createRootContext = (configs) => {
|
|
1365
|
+
let rootContext = new Weaverse(configs);
|
|
1366
|
+
Object.keys(Elements).forEach((key) => {
|
|
1367
|
+
rootContext.registerElement(Elements[key]);
|
|
1368
|
+
});
|
|
1369
|
+
return rootContext;
|
|
1370
|
+
};
|
|
1371
|
+
var WeaverseContext = createContext({});
|
|
1372
|
+
var WeaverseContextProvider = WeaverseContext.Provider;
|
|
1373
|
+
var WeaverseContextConsumer = WeaverseContext.Consumer;
|
|
1374
|
+
|
|
1375
|
+
// src/components/Placeholder.tsx
|
|
1376
|
+
import React23, { forwardRef as forwardRef10 } from "react";
|
|
1377
|
+
var Placeholder = forwardRef10(
|
|
1378
|
+
(props, ref) => {
|
|
1379
|
+
let { element, children, ...rest } = props;
|
|
1380
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1381
|
+
"data-wv-placeholder": true,
|
|
1382
|
+
ref,
|
|
1383
|
+
...rest
|
|
1384
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1385
|
+
style: { fontWeight: 600, marginBottom: "10px" }
|
|
1386
|
+
}, element), /* @__PURE__ */ React23.createElement("div", null, children));
|
|
1387
|
+
}
|
|
1388
|
+
);
|
|
1389
|
+
var Placeholder_default = Placeholder;
|
|
1390
|
+
|
|
1391
|
+
// src/components/Modal/index.tsx
|
|
1392
|
+
var Modal_exports = {};
|
|
1393
|
+
__export(Modal_exports, {
|
|
1394
|
+
Modal: () => Modal,
|
|
1395
|
+
ModalClose: () => ModalClose,
|
|
1396
|
+
ModalContent: () => ModalContent,
|
|
1397
|
+
ModalHeader: () => ModalHeader,
|
|
1398
|
+
ModalTrigger: () => ModalTrigger
|
|
1399
|
+
});
|
|
1400
|
+
import { Close, Portal, Root, Trigger } from "@radix-ui/react-dialog";
|
|
1401
|
+
import React24, { forwardRef as forwardRef11 } from "react";
|
|
1402
|
+
|
|
953
1403
|
// src/components/Modal/styled.ts
|
|
954
|
-
import { Content, Overlay as
|
|
955
|
-
import { keyframes, styled } from "@stitches/react";
|
|
1404
|
+
import { Content, Overlay as Overlay3, Title } from "@radix-ui/react-dialog";
|
|
1405
|
+
import { keyframes, styled as styled5 } from "@stitches/react";
|
|
956
1406
|
var overlayShow = keyframes({
|
|
957
1407
|
"0%": { opacity: 0 },
|
|
958
1408
|
"100%": { opacity: 1 }
|
|
@@ -961,7 +1411,7 @@ var contentShow = keyframes({
|
|
|
961
1411
|
"0%": { opacity: 0, transform: "translate(-50%, -48%) scale(.96)" },
|
|
962
1412
|
"100%": { opacity: 1, transform: "translate(-50%, -50%) scale(1)" }
|
|
963
1413
|
});
|
|
964
|
-
var
|
|
1414
|
+
var StyledOverlay2 = styled5(Overlay3, {
|
|
965
1415
|
display: "block !important",
|
|
966
1416
|
backgroundColor: "rgba(0, 0, 0, .3)",
|
|
967
1417
|
position: "fixed",
|
|
@@ -969,7 +1419,7 @@ var StyledOverlay = styled(Overlay2, {
|
|
|
969
1419
|
inset: 0,
|
|
970
1420
|
animation: `${overlayShow} 300ms cubic-bezier(0.16, 1, 0.3, 1)`
|
|
971
1421
|
});
|
|
972
|
-
var StyledTitle =
|
|
1422
|
+
var StyledTitle = styled5(Title, {
|
|
973
1423
|
margin: "0 0 24px",
|
|
974
1424
|
fontWeight: 500,
|
|
975
1425
|
fontSize: 24,
|
|
@@ -978,7 +1428,7 @@ var StyledTitle = styled(Title, {
|
|
|
978
1428
|
fontSize: 20
|
|
979
1429
|
}
|
|
980
1430
|
});
|
|
981
|
-
var StyledContent =
|
|
1431
|
+
var StyledContent = styled5(Content, {
|
|
982
1432
|
backgroundColor: "white",
|
|
983
1433
|
borderRadius: 6,
|
|
984
1434
|
boxShadow: "hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px",
|
|
@@ -1009,7 +1459,7 @@ var StyledContent = styled(Content, {
|
|
|
1009
1459
|
}
|
|
1010
1460
|
}
|
|
1011
1461
|
});
|
|
1012
|
-
var StyledCloseIcon =
|
|
1462
|
+
var StyledCloseIcon = styled5("button", {
|
|
1013
1463
|
all: "unset",
|
|
1014
1464
|
cursor: "pointer",
|
|
1015
1465
|
fontFamily: "inherit",
|
|
@@ -1034,7 +1484,7 @@ var StyledCloseIcon = styled("button", {
|
|
|
1034
1484
|
});
|
|
1035
1485
|
|
|
1036
1486
|
// src/components/Modal/useOpenChangeEffect.ts
|
|
1037
|
-
import { useContext as useContext4, useEffect as
|
|
1487
|
+
import { useContext as useContext4, useEffect as useEffect3 } from "react";
|
|
1038
1488
|
function useOpenChangeEffect(props) {
|
|
1039
1489
|
let { open, defaultOpen, onOpenChange } = props;
|
|
1040
1490
|
let rootCtx = useContext4(WeaverseContext);
|
|
@@ -1048,7 +1498,7 @@ function useOpenChangeEffect(props) {
|
|
|
1048
1498
|
}
|
|
1049
1499
|
}
|
|
1050
1500
|
};
|
|
1051
|
-
|
|
1501
|
+
useEffect3(() => {
|
|
1052
1502
|
let isOpen = open || defaultOpen;
|
|
1053
1503
|
toggleRootzIndex(isOpen);
|
|
1054
1504
|
}, [open, defaultOpen]);
|
|
@@ -1063,7 +1513,7 @@ function useOpenChangeEffect(props) {
|
|
|
1063
1513
|
var Modal = (props) => {
|
|
1064
1514
|
let { children, open, defaultOpen, onOpenChange, ...rest } = props;
|
|
1065
1515
|
let handleOpenChange = useOpenChangeEffect(props);
|
|
1066
|
-
return /* @__PURE__ */
|
|
1516
|
+
return /* @__PURE__ */ React24.createElement(Root, {
|
|
1067
1517
|
open,
|
|
1068
1518
|
defaultOpen,
|
|
1069
1519
|
onOpenChange: handleOpenChange,
|
|
@@ -1071,30 +1521,30 @@ var Modal = (props) => {
|
|
|
1071
1521
|
}, children);
|
|
1072
1522
|
};
|
|
1073
1523
|
var ModalTrigger = Trigger;
|
|
1074
|
-
var ModalHeader =
|
|
1524
|
+
var ModalHeader = forwardRef11(
|
|
1075
1525
|
(props, ref) => {
|
|
1076
1526
|
let { children, ...rest } = props;
|
|
1077
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ React24.createElement(StyledTitle, {
|
|
1078
1528
|
ref,
|
|
1079
1529
|
...rest,
|
|
1080
1530
|
"data-wv-modal-header": true
|
|
1081
1531
|
}, children);
|
|
1082
1532
|
}
|
|
1083
1533
|
);
|
|
1084
|
-
var ModalContent =
|
|
1534
|
+
var ModalContent = forwardRef11(
|
|
1085
1535
|
(props, ref) => {
|
|
1086
1536
|
let { children, size, portal, ...rest } = props;
|
|
1087
|
-
let modalContent = /* @__PURE__ */
|
|
1537
|
+
let modalContent = /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(StyledOverlay2, null), /* @__PURE__ */ React24.createElement(StyledContent, {
|
|
1088
1538
|
...rest,
|
|
1089
1539
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
1090
1540
|
"data-wv-modal": true,
|
|
1091
1541
|
"data-size": size,
|
|
1092
1542
|
ref
|
|
1093
|
-
}, /* @__PURE__ */
|
|
1543
|
+
}, /* @__PURE__ */ React24.createElement(ModalClose, null), /* @__PURE__ */ React24.createElement("div", {
|
|
1094
1544
|
className: "wv-modal-content"
|
|
1095
1545
|
}, children)));
|
|
1096
1546
|
if (portal) {
|
|
1097
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ React24.createElement(Portal, null, modalContent);
|
|
1098
1548
|
}
|
|
1099
1549
|
return modalContent;
|
|
1100
1550
|
}
|
|
@@ -1103,13 +1553,13 @@ ModalContent.defaultProps = {
|
|
|
1103
1553
|
size: "auto",
|
|
1104
1554
|
portal: false
|
|
1105
1555
|
};
|
|
1106
|
-
var ModalClose =
|
|
1556
|
+
var ModalClose = forwardRef11(
|
|
1107
1557
|
(props, ref) => {
|
|
1108
1558
|
let { asChild, children, ...rest } = props;
|
|
1109
|
-
let closeIcon = /* @__PURE__ */
|
|
1559
|
+
let closeIcon = /* @__PURE__ */ React24.createElement(StyledCloseIcon, null, /* @__PURE__ */ React24.createElement(Icon, {
|
|
1110
1560
|
name: "X"
|
|
1111
1561
|
}));
|
|
1112
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ React24.createElement(Close, {
|
|
1113
1563
|
asChild: true,
|
|
1114
1564
|
...rest,
|
|
1115
1565
|
ref
|
|
@@ -1118,131 +1568,32 @@ var ModalClose = forwardRef9(
|
|
|
1118
1568
|
);
|
|
1119
1569
|
|
|
1120
1570
|
// src/components/Spinner.tsx
|
|
1121
|
-
import
|
|
1571
|
+
import React25 from "react";
|
|
1122
1572
|
function Spinner() {
|
|
1123
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ React25.createElement("span", {
|
|
1124
1574
|
className: "wv-spinner-wrapper"
|
|
1125
|
-
}, /* @__PURE__ */
|
|
1575
|
+
}, /* @__PURE__ */ React25.createElement(Icon, {
|
|
1126
1576
|
name: "CircleNotch",
|
|
1127
1577
|
className: "wv-spinner"
|
|
1128
1578
|
}));
|
|
1129
1579
|
}
|
|
1130
1580
|
|
|
1131
1581
|
// src/components/Tooltip.tsx
|
|
1132
|
-
import
|
|
1582
|
+
import React26 from "react";
|
|
1133
1583
|
function Tooltip({ children }) {
|
|
1134
|
-
return /* @__PURE__ */
|
|
1584
|
+
return /* @__PURE__ */ React26.createElement("span", {
|
|
1135
1585
|
className: "wv-tooltip"
|
|
1136
1586
|
}, children);
|
|
1137
1587
|
}
|
|
1138
1588
|
|
|
1139
1589
|
// src/components/Slider/index.tsx
|
|
1140
|
-
import
|
|
1141
|
-
import { useKeenSlider } from "keen-slider/react";
|
|
1142
|
-
import
|
|
1143
|
-
|
|
1144
|
-
// src/components/Slider/Arrows.tsx
|
|
1145
|
-
import clsx3 from "clsx";
|
|
1146
|
-
import React21, { useContext as useContext5 } from "react";
|
|
1147
|
-
function Arrows(props) {
|
|
1148
|
-
let { currentSlide, instanceRef, className } = props;
|
|
1149
|
-
let { stitchesInstance } = useContext5(WeaverseContext);
|
|
1150
|
-
let { className: cssClass } = stitchesInstance.css(css9)();
|
|
1151
|
-
let isFirstSlide = currentSlide === 0;
|
|
1152
|
-
let isLastSlide = false;
|
|
1153
|
-
if (instanceRef.current) {
|
|
1154
|
-
isLastSlide = currentSlide === instanceRef?.current?.track?.details?.maxIdx;
|
|
1155
|
-
}
|
|
1156
|
-
let _className = clsx3(className, cssClass);
|
|
1157
|
-
let arrowLeftClass = clsx3(
|
|
1158
|
-
"wv-slider-arrow arrow--left",
|
|
1159
|
-
isFirstSlide && "arrow--disabled"
|
|
1160
|
-
);
|
|
1161
|
-
let arrowRightClass = clsx3(
|
|
1162
|
-
"wv-slider-arrow arrow--right",
|
|
1163
|
-
isLastSlide && "arrow--disabled"
|
|
1164
|
-
);
|
|
1165
|
-
return /* @__PURE__ */ React21.createElement("div", {
|
|
1166
|
-
className: _className
|
|
1167
|
-
}, /* @__PURE__ */ React21.createElement("button", {
|
|
1168
|
-
type: "button",
|
|
1169
|
-
className: arrowLeftClass,
|
|
1170
|
-
onClick: (e) => {
|
|
1171
|
-
e.stopPropagation();
|
|
1172
|
-
instanceRef?.current?.prev();
|
|
1173
|
-
}
|
|
1174
|
-
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1175
|
-
name: "ArrowLeft"
|
|
1176
|
-
})), /* @__PURE__ */ React21.createElement("button", {
|
|
1177
|
-
type: "button",
|
|
1178
|
-
className: arrowRightClass,
|
|
1179
|
-
onClick: (e) => {
|
|
1180
|
-
e.stopPropagation();
|
|
1181
|
-
instanceRef?.current?.next();
|
|
1182
|
-
}
|
|
1183
|
-
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1184
|
-
name: "ArrowRight"
|
|
1185
|
-
})));
|
|
1186
|
-
}
|
|
1187
|
-
var css9 = {
|
|
1188
|
-
"@desktop": {
|
|
1189
|
-
".wv-slider-arrow": {
|
|
1190
|
-
position: "absolute",
|
|
1191
|
-
top: "50%",
|
|
1192
|
-
transform: "translateY(-50%)",
|
|
1193
|
-
width: "44px",
|
|
1194
|
-
height: "44px",
|
|
1195
|
-
padding: "8px",
|
|
1196
|
-
color: "#191919",
|
|
1197
|
-
backgroundColor: "#f2f2f2",
|
|
1198
|
-
textAlign: "center",
|
|
1199
|
-
transition: "all 0.2s ease-in-out",
|
|
1200
|
-
borderRadius: "4px",
|
|
1201
|
-
border: "none",
|
|
1202
|
-
cursor: "pointer",
|
|
1203
|
-
"&:hover": {
|
|
1204
|
-
backgroundColor: "#191919",
|
|
1205
|
-
color: "#f2f2f2"
|
|
1206
|
-
},
|
|
1207
|
-
svg: {
|
|
1208
|
-
verticalAlign: "middle",
|
|
1209
|
-
width: "22px",
|
|
1210
|
-
height: "22px"
|
|
1211
|
-
},
|
|
1212
|
-
"&.arrow--left": {
|
|
1213
|
-
left: "-80px"
|
|
1214
|
-
},
|
|
1215
|
-
"&.arrow--right": {
|
|
1216
|
-
right: "-80px"
|
|
1217
|
-
},
|
|
1218
|
-
"&.arrow--disabled": {
|
|
1219
|
-
opacity: 0.5
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
},
|
|
1223
|
-
"@mobile": {
|
|
1224
|
-
".wv-slider-arrow": {
|
|
1225
|
-
display: "none"
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
};
|
|
1229
|
-
|
|
1230
|
-
// src/components/Slider/ResizePlugin.ts
|
|
1231
|
-
var ResizePlugin = (slider) => {
|
|
1232
|
-
let observer = new ResizeObserver(() => slider.update());
|
|
1233
|
-
slider.on("created", () => {
|
|
1234
|
-
observer.observe(slider.container);
|
|
1235
|
-
});
|
|
1236
|
-
slider.on("destroyed", () => {
|
|
1237
|
-
observer.unobserve(slider.container);
|
|
1238
|
-
});
|
|
1239
|
-
};
|
|
1240
|
-
|
|
1241
|
-
// src/components/Slider/index.tsx
|
|
1590
|
+
import clsx5 from "clsx";
|
|
1591
|
+
import { useKeenSlider as useKeenSlider2 } from "keen-slider/react";
|
|
1592
|
+
import React27, { useState as useState2 } from "react";
|
|
1242
1593
|
function Slider({ children, className, gap }) {
|
|
1243
|
-
let [currentSlide, setCurrentSlide] =
|
|
1244
|
-
let [created, setCreated] =
|
|
1245
|
-
let [ref, instanceRef] =
|
|
1594
|
+
let [currentSlide, setCurrentSlide] = useState2(0);
|
|
1595
|
+
let [created, setCreated] = useState2(false);
|
|
1596
|
+
let [ref, instanceRef] = useKeenSlider2(
|
|
1246
1597
|
{
|
|
1247
1598
|
slides: { perView: 4, spacing: gap },
|
|
1248
1599
|
breakpoints: {
|
|
@@ -1265,15 +1616,15 @@ function Slider({ children, className, gap }) {
|
|
|
1265
1616
|
},
|
|
1266
1617
|
[ResizePlugin]
|
|
1267
1618
|
);
|
|
1268
|
-
let _className =
|
|
1269
|
-
let arrowsClass =
|
|
1270
|
-
return /* @__PURE__ */
|
|
1619
|
+
let _className = clsx5("keen-slider", className);
|
|
1620
|
+
let arrowsClass = clsx5(className && `${className}-arrows`);
|
|
1621
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("div", {
|
|
1271
1622
|
ref,
|
|
1272
1623
|
className: _className
|
|
1273
|
-
}, /* @__PURE__ */
|
|
1624
|
+
}, /* @__PURE__ */ React27.createElement("link", {
|
|
1274
1625
|
rel: "stylesheet",
|
|
1275
1626
|
href: "https://cdn.jsdelivr.net/npm/keen-slider@latest/keen-slider.min.css"
|
|
1276
|
-
}), children), created && instanceRef?.current && /* @__PURE__ */
|
|
1627
|
+
}), children), created && instanceRef?.current && /* @__PURE__ */ React27.createElement(Arrows, {
|
|
1277
1628
|
currentSlide,
|
|
1278
1629
|
instanceRef,
|
|
1279
1630
|
className: arrowsClass
|
|
@@ -1282,152 +1633,19 @@ function Slider({ children, className, gap }) {
|
|
|
1282
1633
|
|
|
1283
1634
|
// src/components/index.ts
|
|
1284
1635
|
var Components = {
|
|
1636
|
+
Background: Background2,
|
|
1637
|
+
Icon,
|
|
1638
|
+
ModalComponents: Modal_exports,
|
|
1639
|
+
Overlay: Overlay2,
|
|
1285
1640
|
Placeholder: Placeholder_default,
|
|
1286
1641
|
Spinner,
|
|
1287
|
-
ModalComponents: Modal_exports,
|
|
1288
|
-
Icon,
|
|
1289
1642
|
Slider,
|
|
1290
1643
|
Tooltip
|
|
1291
1644
|
};
|
|
1292
1645
|
|
|
1293
|
-
// src/elements/Instagram.tsx
|
|
1294
|
-
var Instagram = forwardRef10(
|
|
1295
|
-
(props, ref) => {
|
|
1296
|
-
let { token, username, numberOfImages, imagesPerRow, gap, ...rest } = props;
|
|
1297
|
-
let [media, setMedia] = useState2([]);
|
|
1298
|
-
let [error, setError] = useState2(null);
|
|
1299
|
-
useEffect4(() => {
|
|
1300
|
-
if (token) {
|
|
1301
|
-
let params = new URLSearchParams({
|
|
1302
|
-
access_token: token,
|
|
1303
|
-
fields: "id,media_type,caption,media_url,permalink,thumbnail_url"
|
|
1304
|
-
});
|
|
1305
|
-
fetch(`${INSTAGRAM_API}/me/media?${params.toString()}`).then((res) => res.json()).then((res) => {
|
|
1306
|
-
if (res.error) {
|
|
1307
|
-
setError(res);
|
|
1308
|
-
} else {
|
|
1309
|
-
setError(null);
|
|
1310
|
-
setMedia([...res.data]);
|
|
1311
|
-
}
|
|
1312
|
-
}).catch(setError);
|
|
1313
|
-
}
|
|
1314
|
-
}, [token]);
|
|
1315
|
-
if (!token || error) {
|
|
1316
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
1317
|
-
ref,
|
|
1318
|
-
...rest
|
|
1319
|
-
}, /* @__PURE__ */ React23.createElement(Components.Placeholder, {
|
|
1320
|
-
element: "Instagram"
|
|
1321
|
-
}, !token ? "Connect to Instagram to display photos on your site." : "Invalid or expired token!"));
|
|
1322
|
-
}
|
|
1323
|
-
let style = {
|
|
1324
|
-
"--wv-ig-images-per-row": imagesPerRow,
|
|
1325
|
-
"--wv-ig-images-gap": gap + "px"
|
|
1326
|
-
};
|
|
1327
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
1328
|
-
ref,
|
|
1329
|
-
...rest,
|
|
1330
|
-
style
|
|
1331
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1332
|
-
className: "wv-ig-media-container"
|
|
1333
|
-
}, media.slice(0, numberOfImages).map((item) => {
|
|
1334
|
-
let {
|
|
1335
|
-
id,
|
|
1336
|
-
permalink,
|
|
1337
|
-
caption,
|
|
1338
|
-
media_url,
|
|
1339
|
-
media_type,
|
|
1340
|
-
thumbnail_url
|
|
1341
|
-
} = item;
|
|
1342
|
-
if (media_type === "VIDEO") {
|
|
1343
|
-
return /* @__PURE__ */ React23.createElement("video", {
|
|
1344
|
-
key: id,
|
|
1345
|
-
controls: true,
|
|
1346
|
-
poster: thumbnail_url
|
|
1347
|
-
}, /* @__PURE__ */ React23.createElement("source", {
|
|
1348
|
-
src: media_url,
|
|
1349
|
-
type: "video/mp4"
|
|
1350
|
-
}));
|
|
1351
|
-
}
|
|
1352
|
-
return /* @__PURE__ */ React23.createElement("a", {
|
|
1353
|
-
key: id,
|
|
1354
|
-
href: permalink,
|
|
1355
|
-
target: "_blank",
|
|
1356
|
-
rel: "noreferrer"
|
|
1357
|
-
}, /* @__PURE__ */ React23.createElement("img", {
|
|
1358
|
-
alt: caption,
|
|
1359
|
-
src: media_url
|
|
1360
|
-
}));
|
|
1361
|
-
})));
|
|
1362
|
-
}
|
|
1363
|
-
);
|
|
1364
|
-
Instagram.defaultProps = {
|
|
1365
|
-
token: "",
|
|
1366
|
-
username: "",
|
|
1367
|
-
numberOfImages: 8,
|
|
1368
|
-
imagesPerRow: 4,
|
|
1369
|
-
gap: 0
|
|
1370
|
-
};
|
|
1371
|
-
|
|
1372
|
-
// src/elements/index.ts
|
|
1373
|
-
var Elements = {
|
|
1374
|
-
Countdown: {
|
|
1375
|
-
Component: Countdown_default,
|
|
1376
|
-
type: "countdown",
|
|
1377
|
-
defaultCss: css3
|
|
1378
|
-
},
|
|
1379
|
-
Button: {
|
|
1380
|
-
Component: Button_default,
|
|
1381
|
-
type: "button",
|
|
1382
|
-
defaultCss: css
|
|
1383
|
-
},
|
|
1384
|
-
Container: {
|
|
1385
|
-
Component: Container_default,
|
|
1386
|
-
type: "container",
|
|
1387
|
-
defaultCss: css2
|
|
1388
|
-
},
|
|
1389
|
-
Image: {
|
|
1390
|
-
Component: Image_default,
|
|
1391
|
-
type: "image",
|
|
1392
|
-
defaultCss: css4
|
|
1393
|
-
},
|
|
1394
|
-
Layout: {
|
|
1395
|
-
Component: Layout_default,
|
|
1396
|
-
type: "layout",
|
|
1397
|
-
defaultCss: css5
|
|
1398
|
-
},
|
|
1399
|
-
Map: {
|
|
1400
|
-
Component: Map_default,
|
|
1401
|
-
type: "map",
|
|
1402
|
-
defaultCss: css6
|
|
1403
|
-
},
|
|
1404
|
-
Text: {
|
|
1405
|
-
Component: Text_default,
|
|
1406
|
-
type: "text",
|
|
1407
|
-
defaultCss: css7
|
|
1408
|
-
},
|
|
1409
|
-
Video: {
|
|
1410
|
-
Component: Video_default,
|
|
1411
|
-
type: "video",
|
|
1412
|
-
defaultCss: css8
|
|
1413
|
-
}
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
// src/context.ts
|
|
1417
|
-
var createRootContext = (configs) => {
|
|
1418
|
-
let rootContext = new Weaverse(configs);
|
|
1419
|
-
Object.keys(Elements).forEach((key) => {
|
|
1420
|
-
rootContext.registerElement(Elements[key]);
|
|
1421
|
-
});
|
|
1422
|
-
return rootContext;
|
|
1423
|
-
};
|
|
1424
|
-
var WeaverseContext = createContext({});
|
|
1425
|
-
var WeaverseContextProvider = WeaverseContext.Provider;
|
|
1426
|
-
var WeaverseContextConsumer = WeaverseContext.Consumer;
|
|
1427
|
-
|
|
1428
1646
|
// src/renderer.tsx
|
|
1429
1647
|
import { isBrowser } from "@weaverse/core";
|
|
1430
|
-
import
|
|
1648
|
+
import React28, { useContext as useContext5, useEffect as useEffect5, useRef, useState as useState3 } from "react";
|
|
1431
1649
|
var WeaverseRoot = ({ context }) => {
|
|
1432
1650
|
let [, setData] = useState3(context.projectData);
|
|
1433
1651
|
let rootRef = useRef();
|
|
@@ -1442,22 +1660,22 @@ var WeaverseRoot = ({ context }) => {
|
|
|
1442
1660
|
let eventHandlers = context?.studioBridge?.eventHandlers || {};
|
|
1443
1661
|
let themeClass = context.stitchesInstance.theme.className;
|
|
1444
1662
|
if (context.projectData?.rootId) {
|
|
1445
|
-
return /* @__PURE__ */
|
|
1663
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
|
1446
1664
|
className: `weaverse-content-root ${themeClass}`,
|
|
1447
1665
|
...eventHandlers,
|
|
1448
1666
|
ref: rootRef
|
|
1449
|
-
}, /* @__PURE__ */
|
|
1667
|
+
}, /* @__PURE__ */ React28.createElement(WeaverseContextProvider, {
|
|
1450
1668
|
value: context
|
|
1451
|
-
}, /* @__PURE__ */
|
|
1669
|
+
}, /* @__PURE__ */ React28.createElement(ItemInstance, {
|
|
1452
1670
|
id: context.projectData.rootId
|
|
1453
1671
|
})));
|
|
1454
1672
|
}
|
|
1455
1673
|
return null;
|
|
1456
1674
|
};
|
|
1457
1675
|
var ItemComponent = ({ instance }) => {
|
|
1458
|
-
let { stitchesInstance, elementInstances } =
|
|
1676
|
+
let { stitchesInstance, elementInstances } = useContext5(WeaverseContext);
|
|
1459
1677
|
let [data, setData] = useState3(instance.data);
|
|
1460
|
-
let { id, type, childIds = [], css:
|
|
1678
|
+
let { id, type, childIds = [], css: css11, className, ...rest } = data;
|
|
1461
1679
|
useEffect5(() => {
|
|
1462
1680
|
let render = (data2) => setData({ ...data2 });
|
|
1463
1681
|
instance.subscribe(render);
|
|
@@ -1474,13 +1692,13 @@ var ItemComponent = ({ instance }) => {
|
|
|
1474
1692
|
if (Component.$$typeof === Symbol.for("react.forward_ref")) {
|
|
1475
1693
|
rest.ref = instance.ref;
|
|
1476
1694
|
}
|
|
1477
|
-
return /* @__PURE__ */
|
|
1695
|
+
return /* @__PURE__ */ React28.createElement(Component, {
|
|
1478
1696
|
key: id,
|
|
1479
1697
|
"data-wv-type": type,
|
|
1480
1698
|
"data-wv-id": id,
|
|
1481
1699
|
className: generateItemClassName(instance, stitchesInstance),
|
|
1482
1700
|
...rest
|
|
1483
|
-
}, childIds.map((id2) => /* @__PURE__ */
|
|
1701
|
+
}, childIds.map((id2) => /* @__PURE__ */ React28.createElement(ItemInstance, {
|
|
1484
1702
|
key: id2,
|
|
1485
1703
|
id: id2
|
|
1486
1704
|
})));
|
|
@@ -1490,15 +1708,15 @@ var ItemComponent = ({ instance }) => {
|
|
|
1490
1708
|
}
|
|
1491
1709
|
};
|
|
1492
1710
|
var ItemInstance = ({ id }) => {
|
|
1493
|
-
let context =
|
|
1711
|
+
let context = useContext5(WeaverseContext);
|
|
1494
1712
|
let { itemInstances } = context;
|
|
1495
1713
|
let instance = itemInstances.get(id);
|
|
1496
1714
|
if (!instance) {
|
|
1497
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
|
1498
1716
|
style: { display: "none" }
|
|
1499
1717
|
}, "Item instance ", id, " not found");
|
|
1500
1718
|
}
|
|
1501
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ React28.createElement(ItemComponent, {
|
|
1502
1720
|
key: id,
|
|
1503
1721
|
instance
|
|
1504
1722
|
});
|