@weaverse/react 0.7.56 → 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 +46 -9
- package/dist/index.js +618 -396
- package/dist/index.mjs +610 -388
- 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",
|
|
@@ -330,7 +293,7 @@ Image.defaultProps = {
|
|
|
330
293
|
src: "https://ucarecdn.com/cf54e41e-36a0-4547-a140-a302e0387890/",
|
|
331
294
|
alt: "Image alt text",
|
|
332
295
|
objectFit: "cover",
|
|
333
|
-
objectPosition: "center",
|
|
296
|
+
objectPosition: "center center",
|
|
334
297
|
clickAction: "none",
|
|
335
298
|
openLinkInNewTab: false,
|
|
336
299
|
linkTo: ""
|
|
@@ -468,7 +431,11 @@ Layout.defaultProps = {
|
|
|
468
431
|
rows: 16,
|
|
469
432
|
columns: 12,
|
|
470
433
|
gap: 16,
|
|
471
|
-
rowSize: 48
|
|
434
|
+
rowSize: 48,
|
|
435
|
+
objectFit: "cover",
|
|
436
|
+
objectPosition: "center center",
|
|
437
|
+
enableOverlay: false,
|
|
438
|
+
overlayOpacity: 30
|
|
472
439
|
};
|
|
473
440
|
var Layout_default = Layout;
|
|
474
441
|
|
|
@@ -658,39 +625,17 @@ Video.defaultProps = {
|
|
|
658
625
|
};
|
|
659
626
|
var Video_default = Video;
|
|
660
627
|
|
|
661
|
-
// src/elements/
|
|
662
|
-
import
|
|
663
|
-
|
|
664
|
-
// src/components/Placeholder.tsx
|
|
665
|
-
import React15, { forwardRef as forwardRef8 } from "react";
|
|
666
|
-
var Placeholder = forwardRef8(
|
|
667
|
-
(props, ref) => {
|
|
668
|
-
let { element, children, ...rest } = props;
|
|
669
|
-
return /* @__PURE__ */ React15.createElement("div", {
|
|
670
|
-
"data-wv-placeholder": true,
|
|
671
|
-
ref,
|
|
672
|
-
...rest
|
|
673
|
-
}, /* @__PURE__ */ React15.createElement("div", {
|
|
674
|
-
style: { fontWeight: 600, marginBottom: "10px" }
|
|
675
|
-
}, element), /* @__PURE__ */ React15.createElement("div", null, children));
|
|
676
|
-
}
|
|
677
|
-
);
|
|
678
|
-
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";
|
|
679
631
|
|
|
680
|
-
// src/components/
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
ModalClose: () => ModalClose,
|
|
685
|
-
ModalContent: () => ModalContent,
|
|
686
|
-
ModalHeader: () => ModalHeader,
|
|
687
|
-
ModalTrigger: () => ModalTrigger
|
|
688
|
-
});
|
|
689
|
-
import { Close, Portal, Root, Trigger } from "@radix-ui/react-dialog";
|
|
690
|
-
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";
|
|
691
636
|
|
|
692
637
|
// src/components/Icons/index.tsx
|
|
693
|
-
import
|
|
638
|
+
import React16 from "react";
|
|
694
639
|
|
|
695
640
|
// src/components/Icons/Phosphor.tsx
|
|
696
641
|
var Phosphor_exports = {};
|
|
@@ -705,39 +650,39 @@ __export(Phosphor_exports, {
|
|
|
705
650
|
ShoppingCart: () => ShoppingCart,
|
|
706
651
|
X: () => X
|
|
707
652
|
});
|
|
708
|
-
import
|
|
653
|
+
import React15 from "react";
|
|
709
654
|
var CircleNotch = (props) => {
|
|
710
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
711
656
|
xmlns: "http://www.w3.org/2000/svg",
|
|
712
657
|
fill: "none",
|
|
713
658
|
viewBox: "0 0 24 24",
|
|
714
659
|
...props
|
|
715
|
-
}, /* @__PURE__ */
|
|
660
|
+
}, /* @__PURE__ */ React15.createElement("circle", {
|
|
716
661
|
style: { opacity: ".25" },
|
|
717
662
|
cx: "12",
|
|
718
663
|
cy: "12",
|
|
719
664
|
r: "10",
|
|
720
665
|
stroke: "currentColor",
|
|
721
666
|
strokeWidth: "4"
|
|
722
|
-
}), /* @__PURE__ */
|
|
667
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
723
668
|
style: { opacity: ".75" },
|
|
724
669
|
fill: "currentColor",
|
|
725
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"
|
|
726
671
|
}));
|
|
727
672
|
};
|
|
728
673
|
var X = (props) => {
|
|
729
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
730
675
|
xmlns: "http://www.w3.org/2000/svg",
|
|
731
676
|
width: "20",
|
|
732
677
|
height: "20",
|
|
733
678
|
fill: "currentColor",
|
|
734
679
|
viewBox: "0 0 256 256",
|
|
735
680
|
...props
|
|
736
|
-
}, /* @__PURE__ */
|
|
681
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
737
682
|
width: "256",
|
|
738
683
|
height: "256",
|
|
739
684
|
fill: "none"
|
|
740
|
-
}), /* @__PURE__ */
|
|
685
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
741
686
|
x1: "200",
|
|
742
687
|
y1: "56",
|
|
743
688
|
x2: "56",
|
|
@@ -747,7 +692,7 @@ var X = (props) => {
|
|
|
747
692
|
strokeLinecap: "round",
|
|
748
693
|
strokeLinejoin: "round",
|
|
749
694
|
strokeWidth: "12"
|
|
750
|
-
}), /* @__PURE__ */
|
|
695
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
751
696
|
x1: "200",
|
|
752
697
|
y1: "200",
|
|
753
698
|
x2: "56",
|
|
@@ -760,7 +705,7 @@ var X = (props) => {
|
|
|
760
705
|
}));
|
|
761
706
|
};
|
|
762
707
|
var Minus = (props) => {
|
|
763
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
764
709
|
width: "196",
|
|
765
710
|
height: "196",
|
|
766
711
|
fill: "currentColor",
|
|
@@ -768,12 +713,12 @@ var Minus = (props) => {
|
|
|
768
713
|
xmlns: "http://www.w3.org/2000/svg",
|
|
769
714
|
viewBox: "0 0 384 512",
|
|
770
715
|
...props
|
|
771
|
-
}, /* @__PURE__ */
|
|
716
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
772
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"
|
|
773
718
|
}));
|
|
774
719
|
};
|
|
775
720
|
var Plus = (props) => {
|
|
776
|
-
return /* @__PURE__ */
|
|
721
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
777
722
|
width: "196",
|
|
778
723
|
height: "196",
|
|
779
724
|
fill: "currentColor",
|
|
@@ -781,23 +726,23 @@ var Plus = (props) => {
|
|
|
781
726
|
xmlns: "http://www.w3.org/2000/svg",
|
|
782
727
|
viewBox: "0 0 384 512",
|
|
783
728
|
...props
|
|
784
|
-
}, /* @__PURE__ */
|
|
729
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
785
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"
|
|
786
731
|
}));
|
|
787
732
|
};
|
|
788
733
|
var ArrowLeft = (props) => {
|
|
789
|
-
return /* @__PURE__ */
|
|
734
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
790
735
|
xmlns: "http://www.w3.org/2000/svg",
|
|
791
736
|
width: "192",
|
|
792
737
|
height: "192",
|
|
793
738
|
fill: "currentColor",
|
|
794
739
|
viewBox: "0 0 256 256",
|
|
795
740
|
...props
|
|
796
|
-
}, /* @__PURE__ */
|
|
741
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
797
742
|
width: "256",
|
|
798
743
|
height: "256",
|
|
799
744
|
fill: "none"
|
|
800
|
-
}), /* @__PURE__ */
|
|
745
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
801
746
|
x1: "216",
|
|
802
747
|
y1: "128",
|
|
803
748
|
x2: "40",
|
|
@@ -807,7 +752,7 @@ var ArrowLeft = (props) => {
|
|
|
807
752
|
strokeLinecap: "round",
|
|
808
753
|
strokeLinejoin: "round",
|
|
809
754
|
strokeWidth: "16"
|
|
810
|
-
}), /* @__PURE__ */
|
|
755
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
811
756
|
points: "112 56 40 128 112 200",
|
|
812
757
|
fill: "none",
|
|
813
758
|
stroke: "currentColor",
|
|
@@ -817,18 +762,18 @@ var ArrowLeft = (props) => {
|
|
|
817
762
|
}));
|
|
818
763
|
};
|
|
819
764
|
var ArrowRight = (props) => {
|
|
820
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
821
766
|
xmlns: "http://www.w3.org/2000/svg",
|
|
822
767
|
width: "192",
|
|
823
768
|
height: "192",
|
|
824
769
|
fill: "currentColor",
|
|
825
770
|
viewBox: "0 0 256 256",
|
|
826
771
|
...props
|
|
827
|
-
}, /* @__PURE__ */
|
|
772
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
828
773
|
width: "256",
|
|
829
774
|
height: "256",
|
|
830
775
|
fill: "none"
|
|
831
|
-
}), /* @__PURE__ */
|
|
776
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
832
777
|
x1: "40",
|
|
833
778
|
y1: "128",
|
|
834
779
|
x2: "216",
|
|
@@ -838,7 +783,7 @@ var ArrowRight = (props) => {
|
|
|
838
783
|
strokeLinecap: "round",
|
|
839
784
|
strokeLinejoin: "round",
|
|
840
785
|
strokeWidth: "16"
|
|
841
|
-
}), /* @__PURE__ */
|
|
786
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
842
787
|
points: "144 56 216 128 144 200",
|
|
843
788
|
fill: "none",
|
|
844
789
|
stroke: "currentColor",
|
|
@@ -848,36 +793,36 @@ var ArrowRight = (props) => {
|
|
|
848
793
|
}));
|
|
849
794
|
};
|
|
850
795
|
var Image2 = (props) => {
|
|
851
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
852
797
|
xmlns: "http://www.w3.org/2000/svg",
|
|
853
798
|
"aria-hidden": "true",
|
|
854
799
|
fill: "currentColor",
|
|
855
800
|
viewBox: "0 0 640 512",
|
|
856
801
|
...props
|
|
857
|
-
}, /* @__PURE__ */
|
|
802
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
858
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"
|
|
859
804
|
}));
|
|
860
805
|
};
|
|
861
806
|
var ShoppingCart = (props) => {
|
|
862
|
-
return /* @__PURE__ */
|
|
807
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
863
808
|
xmlns: "http://www.w3.org/2000/svg",
|
|
864
809
|
width: "192",
|
|
865
810
|
height: "192",
|
|
866
811
|
fill: "currentColor",
|
|
867
812
|
viewBox: "0 0 256 256",
|
|
868
813
|
...props
|
|
869
|
-
}, /* @__PURE__ */
|
|
814
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
870
815
|
width: "256",
|
|
871
816
|
height: "256",
|
|
872
817
|
fill: "none"
|
|
873
|
-
}), /* @__PURE__ */
|
|
818
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
874
819
|
d: "M184,184H69.8L41.9,30.6A8,8,0,0,0,34.1,24H16",
|
|
875
820
|
fill: "none",
|
|
876
821
|
stroke: "currentColor",
|
|
877
822
|
strokeLinecap: "round",
|
|
878
823
|
strokeLinejoin: "round",
|
|
879
824
|
strokeWidth: "16"
|
|
880
|
-
}), /* @__PURE__ */
|
|
825
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
881
826
|
cx: "80",
|
|
882
827
|
cy: "204",
|
|
883
828
|
r: "20",
|
|
@@ -886,7 +831,7 @@ var ShoppingCart = (props) => {
|
|
|
886
831
|
strokeLinecap: "round",
|
|
887
832
|
strokeLinejoin: "round",
|
|
888
833
|
strokeWidth: "16"
|
|
889
|
-
}), /* @__PURE__ */
|
|
834
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
890
835
|
cx: "184",
|
|
891
836
|
cy: "204",
|
|
892
837
|
r: "20",
|
|
@@ -895,7 +840,7 @@ var ShoppingCart = (props) => {
|
|
|
895
840
|
strokeLinecap: "round",
|
|
896
841
|
strokeLinejoin: "round",
|
|
897
842
|
strokeWidth: "16"
|
|
898
|
-
}), /* @__PURE__ */
|
|
843
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
899
844
|
d: "M62.5,144H188.1a15.9,15.9,0,0,0,15.7-13.1L216,64H48",
|
|
900
845
|
fill: "none",
|
|
901
846
|
stroke: "currentColor",
|
|
@@ -905,25 +850,25 @@ var ShoppingCart = (props) => {
|
|
|
905
850
|
}));
|
|
906
851
|
};
|
|
907
852
|
var Eye = (props) => {
|
|
908
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
909
854
|
xmlns: "http://www.w3.org/2000/svg",
|
|
910
855
|
width: "192",
|
|
911
856
|
height: "192",
|
|
912
857
|
fill: "currentColor",
|
|
913
858
|
viewBox: "0 0 256 256",
|
|
914
859
|
...props
|
|
915
|
-
}, /* @__PURE__ */
|
|
860
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
916
861
|
width: "256",
|
|
917
862
|
height: "256",
|
|
918
863
|
fill: "none"
|
|
919
|
-
}), /* @__PURE__ */
|
|
864
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
920
865
|
d: "M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Z",
|
|
921
866
|
fill: "none",
|
|
922
867
|
stroke: "currentColor",
|
|
923
868
|
strokeLinecap: "round",
|
|
924
869
|
strokeLinejoin: "round",
|
|
925
870
|
strokeWidth: "12"
|
|
926
|
-
}), /* @__PURE__ */
|
|
871
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
927
872
|
cx: "128",
|
|
928
873
|
cy: "128",
|
|
929
874
|
r: "40",
|
|
@@ -936,19 +881,528 @@ var Eye = (props) => {
|
|
|
936
881
|
};
|
|
937
882
|
|
|
938
883
|
// src/components/Icons/index.tsx
|
|
939
|
-
import
|
|
884
|
+
import clsx from "clsx";
|
|
940
885
|
function Icon({ name, className, ...props }) {
|
|
941
886
|
let WeaverseIcon = Phosphor_exports[name];
|
|
942
|
-
let cls =
|
|
943
|
-
return /* @__PURE__ */
|
|
887
|
+
let cls = clsx("wv-icon", className);
|
|
888
|
+
return /* @__PURE__ */ React16.createElement(WeaverseIcon, {
|
|
944
889
|
className: cls,
|
|
945
890
|
...props
|
|
946
891
|
});
|
|
947
892
|
}
|
|
948
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
|
+
|
|
949
1403
|
// src/components/Modal/styled.ts
|
|
950
|
-
import { Content, Overlay as
|
|
951
|
-
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";
|
|
952
1406
|
var overlayShow = keyframes({
|
|
953
1407
|
"0%": { opacity: 0 },
|
|
954
1408
|
"100%": { opacity: 1 }
|
|
@@ -957,7 +1411,7 @@ var contentShow = keyframes({
|
|
|
957
1411
|
"0%": { opacity: 0, transform: "translate(-50%, -48%) scale(.96)" },
|
|
958
1412
|
"100%": { opacity: 1, transform: "translate(-50%, -50%) scale(1)" }
|
|
959
1413
|
});
|
|
960
|
-
var
|
|
1414
|
+
var StyledOverlay2 = styled5(Overlay3, {
|
|
961
1415
|
display: "block !important",
|
|
962
1416
|
backgroundColor: "rgba(0, 0, 0, .3)",
|
|
963
1417
|
position: "fixed",
|
|
@@ -965,7 +1419,7 @@ var StyledOverlay = styled(Overlay2, {
|
|
|
965
1419
|
inset: 0,
|
|
966
1420
|
animation: `${overlayShow} 300ms cubic-bezier(0.16, 1, 0.3, 1)`
|
|
967
1421
|
});
|
|
968
|
-
var StyledTitle =
|
|
1422
|
+
var StyledTitle = styled5(Title, {
|
|
969
1423
|
margin: "0 0 24px",
|
|
970
1424
|
fontWeight: 500,
|
|
971
1425
|
fontSize: 24,
|
|
@@ -974,7 +1428,7 @@ var StyledTitle = styled(Title, {
|
|
|
974
1428
|
fontSize: 20
|
|
975
1429
|
}
|
|
976
1430
|
});
|
|
977
|
-
var StyledContent =
|
|
1431
|
+
var StyledContent = styled5(Content, {
|
|
978
1432
|
backgroundColor: "white",
|
|
979
1433
|
borderRadius: 6,
|
|
980
1434
|
boxShadow: "hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px",
|
|
@@ -1005,7 +1459,7 @@ var StyledContent = styled(Content, {
|
|
|
1005
1459
|
}
|
|
1006
1460
|
}
|
|
1007
1461
|
});
|
|
1008
|
-
var StyledCloseIcon =
|
|
1462
|
+
var StyledCloseIcon = styled5("button", {
|
|
1009
1463
|
all: "unset",
|
|
1010
1464
|
cursor: "pointer",
|
|
1011
1465
|
fontFamily: "inherit",
|
|
@@ -1030,7 +1484,7 @@ var StyledCloseIcon = styled("button", {
|
|
|
1030
1484
|
});
|
|
1031
1485
|
|
|
1032
1486
|
// src/components/Modal/useOpenChangeEffect.ts
|
|
1033
|
-
import { useContext as useContext4, useEffect as
|
|
1487
|
+
import { useContext as useContext4, useEffect as useEffect3 } from "react";
|
|
1034
1488
|
function useOpenChangeEffect(props) {
|
|
1035
1489
|
let { open, defaultOpen, onOpenChange } = props;
|
|
1036
1490
|
let rootCtx = useContext4(WeaverseContext);
|
|
@@ -1044,7 +1498,7 @@ function useOpenChangeEffect(props) {
|
|
|
1044
1498
|
}
|
|
1045
1499
|
}
|
|
1046
1500
|
};
|
|
1047
|
-
|
|
1501
|
+
useEffect3(() => {
|
|
1048
1502
|
let isOpen = open || defaultOpen;
|
|
1049
1503
|
toggleRootzIndex(isOpen);
|
|
1050
1504
|
}, [open, defaultOpen]);
|
|
@@ -1059,7 +1513,7 @@ function useOpenChangeEffect(props) {
|
|
|
1059
1513
|
var Modal = (props) => {
|
|
1060
1514
|
let { children, open, defaultOpen, onOpenChange, ...rest } = props;
|
|
1061
1515
|
let handleOpenChange = useOpenChangeEffect(props);
|
|
1062
|
-
return /* @__PURE__ */
|
|
1516
|
+
return /* @__PURE__ */ React24.createElement(Root, {
|
|
1063
1517
|
open,
|
|
1064
1518
|
defaultOpen,
|
|
1065
1519
|
onOpenChange: handleOpenChange,
|
|
@@ -1067,30 +1521,30 @@ var Modal = (props) => {
|
|
|
1067
1521
|
}, children);
|
|
1068
1522
|
};
|
|
1069
1523
|
var ModalTrigger = Trigger;
|
|
1070
|
-
var ModalHeader =
|
|
1524
|
+
var ModalHeader = forwardRef11(
|
|
1071
1525
|
(props, ref) => {
|
|
1072
1526
|
let { children, ...rest } = props;
|
|
1073
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ React24.createElement(StyledTitle, {
|
|
1074
1528
|
ref,
|
|
1075
1529
|
...rest,
|
|
1076
1530
|
"data-wv-modal-header": true
|
|
1077
1531
|
}, children);
|
|
1078
1532
|
}
|
|
1079
1533
|
);
|
|
1080
|
-
var ModalContent =
|
|
1534
|
+
var ModalContent = forwardRef11(
|
|
1081
1535
|
(props, ref) => {
|
|
1082
1536
|
let { children, size, portal, ...rest } = props;
|
|
1083
|
-
let modalContent = /* @__PURE__ */
|
|
1537
|
+
let modalContent = /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(StyledOverlay2, null), /* @__PURE__ */ React24.createElement(StyledContent, {
|
|
1084
1538
|
...rest,
|
|
1085
1539
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
1086
1540
|
"data-wv-modal": true,
|
|
1087
1541
|
"data-size": size,
|
|
1088
1542
|
ref
|
|
1089
|
-
}, /* @__PURE__ */
|
|
1543
|
+
}, /* @__PURE__ */ React24.createElement(ModalClose, null), /* @__PURE__ */ React24.createElement("div", {
|
|
1090
1544
|
className: "wv-modal-content"
|
|
1091
1545
|
}, children)));
|
|
1092
1546
|
if (portal) {
|
|
1093
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ React24.createElement(Portal, null, modalContent);
|
|
1094
1548
|
}
|
|
1095
1549
|
return modalContent;
|
|
1096
1550
|
}
|
|
@@ -1099,13 +1553,13 @@ ModalContent.defaultProps = {
|
|
|
1099
1553
|
size: "auto",
|
|
1100
1554
|
portal: false
|
|
1101
1555
|
};
|
|
1102
|
-
var ModalClose =
|
|
1556
|
+
var ModalClose = forwardRef11(
|
|
1103
1557
|
(props, ref) => {
|
|
1104
1558
|
let { asChild, children, ...rest } = props;
|
|
1105
|
-
let closeIcon = /* @__PURE__ */
|
|
1559
|
+
let closeIcon = /* @__PURE__ */ React24.createElement(StyledCloseIcon, null, /* @__PURE__ */ React24.createElement(Icon, {
|
|
1106
1560
|
name: "X"
|
|
1107
1561
|
}));
|
|
1108
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ React24.createElement(Close, {
|
|
1109
1563
|
asChild: true,
|
|
1110
1564
|
...rest,
|
|
1111
1565
|
ref
|
|
@@ -1114,136 +1568,37 @@ var ModalClose = forwardRef9(
|
|
|
1114
1568
|
);
|
|
1115
1569
|
|
|
1116
1570
|
// src/components/Spinner.tsx
|
|
1117
|
-
import
|
|
1571
|
+
import React25 from "react";
|
|
1118
1572
|
function Spinner() {
|
|
1119
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ React25.createElement("span", {
|
|
1120
1574
|
className: "wv-spinner-wrapper"
|
|
1121
|
-
}, /* @__PURE__ */
|
|
1575
|
+
}, /* @__PURE__ */ React25.createElement(Icon, {
|
|
1122
1576
|
name: "CircleNotch",
|
|
1123
1577
|
className: "wv-spinner"
|
|
1124
1578
|
}));
|
|
1125
1579
|
}
|
|
1126
1580
|
|
|
1127
1581
|
// src/components/Tooltip.tsx
|
|
1128
|
-
import
|
|
1582
|
+
import React26 from "react";
|
|
1129
1583
|
function Tooltip({ children }) {
|
|
1130
|
-
return /* @__PURE__ */
|
|
1584
|
+
return /* @__PURE__ */ React26.createElement("span", {
|
|
1131
1585
|
className: "wv-tooltip"
|
|
1132
1586
|
}, children);
|
|
1133
1587
|
}
|
|
1134
1588
|
|
|
1135
1589
|
// src/components/Slider/index.tsx
|
|
1136
|
-
import
|
|
1137
|
-
import { useKeenSlider } from "keen-slider/react";
|
|
1138
|
-
import
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
function Arrows(props) {
|
|
1144
|
-
let { currentSlide, instanceRef, className } = props;
|
|
1145
|
-
let { stitchesInstance } = useContext5(WeaverseContext);
|
|
1146
|
-
let { className: cssClass } = stitchesInstance.css(css9)();
|
|
1147
|
-
let isFirstSlide = currentSlide === 0;
|
|
1148
|
-
let isLastSlide = false;
|
|
1149
|
-
if (instanceRef.current) {
|
|
1150
|
-
isLastSlide = currentSlide === instanceRef?.current?.track?.details?.maxIdx;
|
|
1151
|
-
}
|
|
1152
|
-
let _className = clsx3(className, cssClass);
|
|
1153
|
-
let arrowLeftClass = clsx3(
|
|
1154
|
-
"wv-slider-arrow arrow--left",
|
|
1155
|
-
isFirstSlide && "arrow--disabled"
|
|
1156
|
-
);
|
|
1157
|
-
let arrowRightClass = clsx3(
|
|
1158
|
-
"wv-slider-arrow arrow--right",
|
|
1159
|
-
isLastSlide && "arrow--disabled"
|
|
1160
|
-
);
|
|
1161
|
-
return /* @__PURE__ */ React21.createElement("div", {
|
|
1162
|
-
className: _className
|
|
1163
|
-
}, /* @__PURE__ */ React21.createElement("button", {
|
|
1164
|
-
type: "button",
|
|
1165
|
-
className: arrowLeftClass,
|
|
1166
|
-
onClick: (e) => {
|
|
1167
|
-
e.stopPropagation();
|
|
1168
|
-
instanceRef?.current?.prev();
|
|
1169
|
-
}
|
|
1170
|
-
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1171
|
-
name: "ArrowLeft"
|
|
1172
|
-
})), /* @__PURE__ */ React21.createElement("button", {
|
|
1173
|
-
type: "button",
|
|
1174
|
-
className: arrowRightClass,
|
|
1175
|
-
onClick: (e) => {
|
|
1176
|
-
e.stopPropagation();
|
|
1177
|
-
instanceRef?.current?.next();
|
|
1178
|
-
}
|
|
1179
|
-
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1180
|
-
name: "ArrowRight"
|
|
1181
|
-
})));
|
|
1182
|
-
}
|
|
1183
|
-
var css9 = {
|
|
1184
|
-
"@desktop": {
|
|
1185
|
-
".wv-slider-arrow": {
|
|
1186
|
-
position: "absolute",
|
|
1187
|
-
top: "50%",
|
|
1188
|
-
transform: "translateY(-50%)",
|
|
1189
|
-
width: "44px",
|
|
1190
|
-
height: "44px",
|
|
1191
|
-
padding: "8px",
|
|
1192
|
-
color: "#191919",
|
|
1193
|
-
backgroundColor: "#f2f2f2",
|
|
1194
|
-
textAlign: "center",
|
|
1195
|
-
transition: "all 0.2s ease-in-out",
|
|
1196
|
-
borderRadius: "4px",
|
|
1197
|
-
border: "none",
|
|
1198
|
-
cursor: "pointer",
|
|
1199
|
-
"&:hover": {
|
|
1200
|
-
backgroundColor: "#191919",
|
|
1201
|
-
color: "#f2f2f2"
|
|
1202
|
-
},
|
|
1203
|
-
svg: {
|
|
1204
|
-
verticalAlign: "middle",
|
|
1205
|
-
width: "22px",
|
|
1206
|
-
height: "22px"
|
|
1207
|
-
},
|
|
1208
|
-
"&.arrow--left": {
|
|
1209
|
-
left: "-80px"
|
|
1210
|
-
},
|
|
1211
|
-
"&.arrow--right": {
|
|
1212
|
-
right: "-80px"
|
|
1213
|
-
},
|
|
1214
|
-
"&.arrow--disabled": {
|
|
1215
|
-
opacity: 0.5
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
},
|
|
1219
|
-
"@mobile": {
|
|
1220
|
-
".wv-slider-arrow": {
|
|
1221
|
-
display: "none"
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
};
|
|
1225
|
-
|
|
1226
|
-
// src/components/Slider/ResizePlugin.ts
|
|
1227
|
-
var ResizePlugin = (slider) => {
|
|
1228
|
-
let observer = new ResizeObserver(() => slider.update());
|
|
1229
|
-
slider.on("created", () => {
|
|
1230
|
-
observer.observe(slider.container);
|
|
1231
|
-
});
|
|
1232
|
-
slider.on("destroyed", () => {
|
|
1233
|
-
observer.unobserve(slider.container);
|
|
1234
|
-
});
|
|
1235
|
-
};
|
|
1236
|
-
|
|
1237
|
-
// src/components/Slider/index.tsx
|
|
1238
|
-
function Slider({ children, className }) {
|
|
1239
|
-
let [currentSlide, setCurrentSlide] = useState(0);
|
|
1240
|
-
let [created, setCreated] = useState(false);
|
|
1241
|
-
let [ref, instanceRef] = useKeenSlider(
|
|
1590
|
+
import clsx5 from "clsx";
|
|
1591
|
+
import { useKeenSlider as useKeenSlider2 } from "keen-slider/react";
|
|
1592
|
+
import React27, { useState as useState2 } from "react";
|
|
1593
|
+
function Slider({ children, className, gap }) {
|
|
1594
|
+
let [currentSlide, setCurrentSlide] = useState2(0);
|
|
1595
|
+
let [created, setCreated] = useState2(false);
|
|
1596
|
+
let [ref, instanceRef] = useKeenSlider2(
|
|
1242
1597
|
{
|
|
1243
|
-
slides: { perView: 4, spacing:
|
|
1598
|
+
slides: { perView: 4, spacing: gap },
|
|
1244
1599
|
breakpoints: {
|
|
1245
1600
|
"(max-width: 1024px)": {
|
|
1246
|
-
slides: { perView: 3, spacing:
|
|
1601
|
+
slides: { perView: 3, spacing: gap }
|
|
1247
1602
|
},
|
|
1248
1603
|
"(max-width: 768px)": {
|
|
1249
1604
|
slides: {
|
|
@@ -1261,15 +1616,15 @@ function Slider({ children, className }) {
|
|
|
1261
1616
|
},
|
|
1262
1617
|
[ResizePlugin]
|
|
1263
1618
|
);
|
|
1264
|
-
let _className =
|
|
1265
|
-
let arrowsClass =
|
|
1266
|
-
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", {
|
|
1267
1622
|
ref,
|
|
1268
1623
|
className: _className
|
|
1269
|
-
}, /* @__PURE__ */
|
|
1624
|
+
}, /* @__PURE__ */ React27.createElement("link", {
|
|
1270
1625
|
rel: "stylesheet",
|
|
1271
1626
|
href: "https://cdn.jsdelivr.net/npm/keen-slider@latest/keen-slider.min.css"
|
|
1272
|
-
}), children), created && instanceRef?.current && /* @__PURE__ */
|
|
1627
|
+
}), children), created && instanceRef?.current && /* @__PURE__ */ React27.createElement(Arrows, {
|
|
1273
1628
|
currentSlide,
|
|
1274
1629
|
instanceRef,
|
|
1275
1630
|
className: arrowsClass
|
|
@@ -1278,152 +1633,19 @@ function Slider({ children, className }) {
|
|
|
1278
1633
|
|
|
1279
1634
|
// src/components/index.ts
|
|
1280
1635
|
var Components = {
|
|
1636
|
+
Background: Background2,
|
|
1637
|
+
Icon,
|
|
1638
|
+
ModalComponents: Modal_exports,
|
|
1639
|
+
Overlay: Overlay2,
|
|
1281
1640
|
Placeholder: Placeholder_default,
|
|
1282
1641
|
Spinner,
|
|
1283
|
-
ModalComponents: Modal_exports,
|
|
1284
|
-
Icon,
|
|
1285
1642
|
Slider,
|
|
1286
1643
|
Tooltip
|
|
1287
1644
|
};
|
|
1288
1645
|
|
|
1289
|
-
// src/elements/Instagram.tsx
|
|
1290
|
-
var Instagram = forwardRef10(
|
|
1291
|
-
(props, ref) => {
|
|
1292
|
-
let { token, username, numberOfImages, imagesPerRow, gap, ...rest } = props;
|
|
1293
|
-
let [media, setMedia] = useState2([]);
|
|
1294
|
-
let [error, setError] = useState2(null);
|
|
1295
|
-
useEffect4(() => {
|
|
1296
|
-
if (token) {
|
|
1297
|
-
let params = new URLSearchParams({
|
|
1298
|
-
access_token: token,
|
|
1299
|
-
fields: "id,media_type,caption,media_url,permalink,thumbnail_url"
|
|
1300
|
-
});
|
|
1301
|
-
fetch(`${INSTAGRAM_API}/me/media?${params.toString()}`).then((res) => res.json()).then((res) => {
|
|
1302
|
-
if (res.error) {
|
|
1303
|
-
setError(res);
|
|
1304
|
-
} else {
|
|
1305
|
-
setError(null);
|
|
1306
|
-
setMedia([...res.data]);
|
|
1307
|
-
}
|
|
1308
|
-
}).catch(setError);
|
|
1309
|
-
}
|
|
1310
|
-
}, [token]);
|
|
1311
|
-
if (!token || error) {
|
|
1312
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
1313
|
-
ref,
|
|
1314
|
-
...rest
|
|
1315
|
-
}, /* @__PURE__ */ React23.createElement(Components.Placeholder, {
|
|
1316
|
-
element: "Instagram"
|
|
1317
|
-
}, !token ? "Connect to Instagram to display photos on your site." : "Invalid or expired token!"));
|
|
1318
|
-
}
|
|
1319
|
-
let style = {
|
|
1320
|
-
"--wv-ig-images-per-row": imagesPerRow,
|
|
1321
|
-
"--wv-ig-images-gap": gap + "px"
|
|
1322
|
-
};
|
|
1323
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
1324
|
-
ref,
|
|
1325
|
-
...rest,
|
|
1326
|
-
style
|
|
1327
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1328
|
-
className: "wv-ig-media-container"
|
|
1329
|
-
}, media.slice(0, numberOfImages).map((item) => {
|
|
1330
|
-
let {
|
|
1331
|
-
id,
|
|
1332
|
-
permalink,
|
|
1333
|
-
caption,
|
|
1334
|
-
media_url,
|
|
1335
|
-
media_type,
|
|
1336
|
-
thumbnail_url
|
|
1337
|
-
} = item;
|
|
1338
|
-
if (media_type === "VIDEO") {
|
|
1339
|
-
return /* @__PURE__ */ React23.createElement("video", {
|
|
1340
|
-
key: id,
|
|
1341
|
-
controls: true,
|
|
1342
|
-
poster: thumbnail_url
|
|
1343
|
-
}, /* @__PURE__ */ React23.createElement("source", {
|
|
1344
|
-
src: media_url,
|
|
1345
|
-
type: "video/mp4"
|
|
1346
|
-
}));
|
|
1347
|
-
}
|
|
1348
|
-
return /* @__PURE__ */ React23.createElement("a", {
|
|
1349
|
-
key: id,
|
|
1350
|
-
href: permalink,
|
|
1351
|
-
target: "_blank",
|
|
1352
|
-
rel: "noreferrer"
|
|
1353
|
-
}, /* @__PURE__ */ React23.createElement("img", {
|
|
1354
|
-
alt: caption,
|
|
1355
|
-
src: media_url
|
|
1356
|
-
}));
|
|
1357
|
-
})));
|
|
1358
|
-
}
|
|
1359
|
-
);
|
|
1360
|
-
Instagram.defaultProps = {
|
|
1361
|
-
token: "",
|
|
1362
|
-
username: "",
|
|
1363
|
-
numberOfImages: 8,
|
|
1364
|
-
imagesPerRow: 4,
|
|
1365
|
-
gap: 0
|
|
1366
|
-
};
|
|
1367
|
-
|
|
1368
|
-
// src/elements/index.ts
|
|
1369
|
-
var Elements = {
|
|
1370
|
-
Countdown: {
|
|
1371
|
-
Component: Countdown_default,
|
|
1372
|
-
type: "countdown",
|
|
1373
|
-
defaultCss: css3
|
|
1374
|
-
},
|
|
1375
|
-
Button: {
|
|
1376
|
-
Component: Button_default,
|
|
1377
|
-
type: "button",
|
|
1378
|
-
defaultCss: css
|
|
1379
|
-
},
|
|
1380
|
-
Container: {
|
|
1381
|
-
Component: Container_default,
|
|
1382
|
-
type: "container",
|
|
1383
|
-
defaultCss: css2
|
|
1384
|
-
},
|
|
1385
|
-
Image: {
|
|
1386
|
-
Component: Image_default,
|
|
1387
|
-
type: "image",
|
|
1388
|
-
defaultCss: css4
|
|
1389
|
-
},
|
|
1390
|
-
Layout: {
|
|
1391
|
-
Component: Layout_default,
|
|
1392
|
-
type: "layout",
|
|
1393
|
-
defaultCss: css5
|
|
1394
|
-
},
|
|
1395
|
-
Map: {
|
|
1396
|
-
Component: Map_default,
|
|
1397
|
-
type: "map",
|
|
1398
|
-
defaultCss: css6
|
|
1399
|
-
},
|
|
1400
|
-
Text: {
|
|
1401
|
-
Component: Text_default,
|
|
1402
|
-
type: "text",
|
|
1403
|
-
defaultCss: css7
|
|
1404
|
-
},
|
|
1405
|
-
Video: {
|
|
1406
|
-
Component: Video_default,
|
|
1407
|
-
type: "video",
|
|
1408
|
-
defaultCss: css8
|
|
1409
|
-
}
|
|
1410
|
-
};
|
|
1411
|
-
|
|
1412
|
-
// src/context.ts
|
|
1413
|
-
var createRootContext = (configs) => {
|
|
1414
|
-
let rootContext = new Weaverse(configs);
|
|
1415
|
-
Object.keys(Elements).forEach((key) => {
|
|
1416
|
-
rootContext.registerElement(Elements[key]);
|
|
1417
|
-
});
|
|
1418
|
-
return rootContext;
|
|
1419
|
-
};
|
|
1420
|
-
var WeaverseContext = createContext({});
|
|
1421
|
-
var WeaverseContextProvider = WeaverseContext.Provider;
|
|
1422
|
-
var WeaverseContextConsumer = WeaverseContext.Consumer;
|
|
1423
|
-
|
|
1424
1646
|
// src/renderer.tsx
|
|
1425
1647
|
import { isBrowser } from "@weaverse/core";
|
|
1426
|
-
import
|
|
1648
|
+
import React28, { useContext as useContext5, useEffect as useEffect5, useRef, useState as useState3 } from "react";
|
|
1427
1649
|
var WeaverseRoot = ({ context }) => {
|
|
1428
1650
|
let [, setData] = useState3(context.projectData);
|
|
1429
1651
|
let rootRef = useRef();
|
|
@@ -1438,22 +1660,22 @@ var WeaverseRoot = ({ context }) => {
|
|
|
1438
1660
|
let eventHandlers = context?.studioBridge?.eventHandlers || {};
|
|
1439
1661
|
let themeClass = context.stitchesInstance.theme.className;
|
|
1440
1662
|
if (context.projectData?.rootId) {
|
|
1441
|
-
return /* @__PURE__ */
|
|
1663
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
|
1442
1664
|
className: `weaverse-content-root ${themeClass}`,
|
|
1443
1665
|
...eventHandlers,
|
|
1444
1666
|
ref: rootRef
|
|
1445
|
-
}, /* @__PURE__ */
|
|
1667
|
+
}, /* @__PURE__ */ React28.createElement(WeaverseContextProvider, {
|
|
1446
1668
|
value: context
|
|
1447
|
-
}, /* @__PURE__ */
|
|
1669
|
+
}, /* @__PURE__ */ React28.createElement(ItemInstance, {
|
|
1448
1670
|
id: context.projectData.rootId
|
|
1449
1671
|
})));
|
|
1450
1672
|
}
|
|
1451
1673
|
return null;
|
|
1452
1674
|
};
|
|
1453
1675
|
var ItemComponent = ({ instance }) => {
|
|
1454
|
-
let { stitchesInstance, elementInstances } =
|
|
1676
|
+
let { stitchesInstance, elementInstances } = useContext5(WeaverseContext);
|
|
1455
1677
|
let [data, setData] = useState3(instance.data);
|
|
1456
|
-
let { id, type, childIds = [], css:
|
|
1678
|
+
let { id, type, childIds = [], css: css11, className, ...rest } = data;
|
|
1457
1679
|
useEffect5(() => {
|
|
1458
1680
|
let render = (data2) => setData({ ...data2 });
|
|
1459
1681
|
instance.subscribe(render);
|
|
@@ -1470,13 +1692,13 @@ var ItemComponent = ({ instance }) => {
|
|
|
1470
1692
|
if (Component.$$typeof === Symbol.for("react.forward_ref")) {
|
|
1471
1693
|
rest.ref = instance.ref;
|
|
1472
1694
|
}
|
|
1473
|
-
return /* @__PURE__ */
|
|
1695
|
+
return /* @__PURE__ */ React28.createElement(Component, {
|
|
1474
1696
|
key: id,
|
|
1475
1697
|
"data-wv-type": type,
|
|
1476
1698
|
"data-wv-id": id,
|
|
1477
1699
|
className: generateItemClassName(instance, stitchesInstance),
|
|
1478
1700
|
...rest
|
|
1479
|
-
}, childIds.map((id2) => /* @__PURE__ */
|
|
1701
|
+
}, childIds.map((id2) => /* @__PURE__ */ React28.createElement(ItemInstance, {
|
|
1480
1702
|
key: id2,
|
|
1481
1703
|
id: id2
|
|
1482
1704
|
})));
|
|
@@ -1486,15 +1708,15 @@ var ItemComponent = ({ instance }) => {
|
|
|
1486
1708
|
}
|
|
1487
1709
|
};
|
|
1488
1710
|
var ItemInstance = ({ id }) => {
|
|
1489
|
-
let context =
|
|
1711
|
+
let context = useContext5(WeaverseContext);
|
|
1490
1712
|
let { itemInstances } = context;
|
|
1491
1713
|
let instance = itemInstances.get(id);
|
|
1492
1714
|
if (!instance) {
|
|
1493
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
|
1494
1716
|
style: { display: "none" }
|
|
1495
1717
|
}, "Item instance ", id, " not found");
|
|
1496
1718
|
}
|
|
1497
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ React28.createElement(ItemComponent, {
|
|
1498
1720
|
key: id,
|
|
1499
1721
|
instance
|
|
1500
1722
|
});
|