@weaverse/react 0.7.57 → 0.7.59
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 +64 -5
- package/dist/index.js +757 -392
- package/dist/index.mjs +747 -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",
|
|
@@ -526,6 +489,7 @@ var Text = React10.forwardRef(
|
|
|
526
489
|
);
|
|
527
490
|
var css7 = {
|
|
528
491
|
"@desktop": {
|
|
492
|
+
display: "flex",
|
|
529
493
|
padding: "10px",
|
|
530
494
|
overflow: "hidden",
|
|
531
495
|
".wv-text-content": {
|
|
@@ -662,39 +626,18 @@ Video.defaultProps = {
|
|
|
662
626
|
};
|
|
663
627
|
var Video_default = Video;
|
|
664
628
|
|
|
665
|
-
// src/elements/
|
|
666
|
-
import
|
|
667
|
-
|
|
668
|
-
|
|
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;
|
|
629
|
+
// src/elements/Slideshow/index.tsx
|
|
630
|
+
import { css as stitchesCss } from "@stitches/react";
|
|
631
|
+
import clsx5 from "clsx";
|
|
632
|
+
import React20, { forwardRef as forwardRef8 } from "react";
|
|
683
633
|
|
|
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";
|
|
634
|
+
// src/components/Slider/Arrows.tsx
|
|
635
|
+
import { styled } from "@stitches/react";
|
|
636
|
+
import clsx2 from "clsx";
|
|
637
|
+
import React17 from "react";
|
|
695
638
|
|
|
696
639
|
// src/components/Icons/index.tsx
|
|
697
|
-
import
|
|
640
|
+
import React16 from "react";
|
|
698
641
|
|
|
699
642
|
// src/components/Icons/Phosphor.tsx
|
|
700
643
|
var Phosphor_exports = {};
|
|
@@ -709,39 +652,39 @@ __export(Phosphor_exports, {
|
|
|
709
652
|
ShoppingCart: () => ShoppingCart,
|
|
710
653
|
X: () => X
|
|
711
654
|
});
|
|
712
|
-
import
|
|
655
|
+
import React15 from "react";
|
|
713
656
|
var CircleNotch = (props) => {
|
|
714
|
-
return /* @__PURE__ */
|
|
657
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
715
658
|
xmlns: "http://www.w3.org/2000/svg",
|
|
716
659
|
fill: "none",
|
|
717
660
|
viewBox: "0 0 24 24",
|
|
718
661
|
...props
|
|
719
|
-
}, /* @__PURE__ */
|
|
662
|
+
}, /* @__PURE__ */ React15.createElement("circle", {
|
|
720
663
|
style: { opacity: ".25" },
|
|
721
664
|
cx: "12",
|
|
722
665
|
cy: "12",
|
|
723
666
|
r: "10",
|
|
724
667
|
stroke: "currentColor",
|
|
725
668
|
strokeWidth: "4"
|
|
726
|
-
}), /* @__PURE__ */
|
|
669
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
727
670
|
style: { opacity: ".75" },
|
|
728
671
|
fill: "currentColor",
|
|
729
672
|
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
673
|
}));
|
|
731
674
|
};
|
|
732
675
|
var X = (props) => {
|
|
733
|
-
return /* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
734
677
|
xmlns: "http://www.w3.org/2000/svg",
|
|
735
678
|
width: "20",
|
|
736
679
|
height: "20",
|
|
737
680
|
fill: "currentColor",
|
|
738
681
|
viewBox: "0 0 256 256",
|
|
739
682
|
...props
|
|
740
|
-
}, /* @__PURE__ */
|
|
683
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
741
684
|
width: "256",
|
|
742
685
|
height: "256",
|
|
743
686
|
fill: "none"
|
|
744
|
-
}), /* @__PURE__ */
|
|
687
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
745
688
|
x1: "200",
|
|
746
689
|
y1: "56",
|
|
747
690
|
x2: "56",
|
|
@@ -751,7 +694,7 @@ var X = (props) => {
|
|
|
751
694
|
strokeLinecap: "round",
|
|
752
695
|
strokeLinejoin: "round",
|
|
753
696
|
strokeWidth: "12"
|
|
754
|
-
}), /* @__PURE__ */
|
|
697
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
755
698
|
x1: "200",
|
|
756
699
|
y1: "200",
|
|
757
700
|
x2: "56",
|
|
@@ -764,7 +707,7 @@ var X = (props) => {
|
|
|
764
707
|
}));
|
|
765
708
|
};
|
|
766
709
|
var Minus = (props) => {
|
|
767
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
768
711
|
width: "196",
|
|
769
712
|
height: "196",
|
|
770
713
|
fill: "currentColor",
|
|
@@ -772,12 +715,12 @@ var Minus = (props) => {
|
|
|
772
715
|
xmlns: "http://www.w3.org/2000/svg",
|
|
773
716
|
viewBox: "0 0 384 512",
|
|
774
717
|
...props
|
|
775
|
-
}, /* @__PURE__ */
|
|
718
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
776
719
|
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
720
|
}));
|
|
778
721
|
};
|
|
779
722
|
var Plus = (props) => {
|
|
780
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
781
724
|
width: "196",
|
|
782
725
|
height: "196",
|
|
783
726
|
fill: "currentColor",
|
|
@@ -785,23 +728,23 @@ var Plus = (props) => {
|
|
|
785
728
|
xmlns: "http://www.w3.org/2000/svg",
|
|
786
729
|
viewBox: "0 0 384 512",
|
|
787
730
|
...props
|
|
788
|
-
}, /* @__PURE__ */
|
|
731
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
789
732
|
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
733
|
}));
|
|
791
734
|
};
|
|
792
735
|
var ArrowLeft = (props) => {
|
|
793
|
-
return /* @__PURE__ */
|
|
736
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
794
737
|
xmlns: "http://www.w3.org/2000/svg",
|
|
795
738
|
width: "192",
|
|
796
739
|
height: "192",
|
|
797
740
|
fill: "currentColor",
|
|
798
741
|
viewBox: "0 0 256 256",
|
|
799
742
|
...props
|
|
800
|
-
}, /* @__PURE__ */
|
|
743
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
801
744
|
width: "256",
|
|
802
745
|
height: "256",
|
|
803
746
|
fill: "none"
|
|
804
|
-
}), /* @__PURE__ */
|
|
747
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
805
748
|
x1: "216",
|
|
806
749
|
y1: "128",
|
|
807
750
|
x2: "40",
|
|
@@ -811,7 +754,7 @@ var ArrowLeft = (props) => {
|
|
|
811
754
|
strokeLinecap: "round",
|
|
812
755
|
strokeLinejoin: "round",
|
|
813
756
|
strokeWidth: "16"
|
|
814
|
-
}), /* @__PURE__ */
|
|
757
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
815
758
|
points: "112 56 40 128 112 200",
|
|
816
759
|
fill: "none",
|
|
817
760
|
stroke: "currentColor",
|
|
@@ -821,18 +764,18 @@ var ArrowLeft = (props) => {
|
|
|
821
764
|
}));
|
|
822
765
|
};
|
|
823
766
|
var ArrowRight = (props) => {
|
|
824
|
-
return /* @__PURE__ */
|
|
767
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
825
768
|
xmlns: "http://www.w3.org/2000/svg",
|
|
826
769
|
width: "192",
|
|
827
770
|
height: "192",
|
|
828
771
|
fill: "currentColor",
|
|
829
772
|
viewBox: "0 0 256 256",
|
|
830
773
|
...props
|
|
831
|
-
}, /* @__PURE__ */
|
|
774
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
832
775
|
width: "256",
|
|
833
776
|
height: "256",
|
|
834
777
|
fill: "none"
|
|
835
|
-
}), /* @__PURE__ */
|
|
778
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
836
779
|
x1: "40",
|
|
837
780
|
y1: "128",
|
|
838
781
|
x2: "216",
|
|
@@ -842,7 +785,7 @@ var ArrowRight = (props) => {
|
|
|
842
785
|
strokeLinecap: "round",
|
|
843
786
|
strokeLinejoin: "round",
|
|
844
787
|
strokeWidth: "16"
|
|
845
|
-
}), /* @__PURE__ */
|
|
788
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
846
789
|
points: "144 56 216 128 144 200",
|
|
847
790
|
fill: "none",
|
|
848
791
|
stroke: "currentColor",
|
|
@@ -852,36 +795,36 @@ var ArrowRight = (props) => {
|
|
|
852
795
|
}));
|
|
853
796
|
};
|
|
854
797
|
var Image2 = (props) => {
|
|
855
|
-
return /* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
856
799
|
xmlns: "http://www.w3.org/2000/svg",
|
|
857
800
|
"aria-hidden": "true",
|
|
858
801
|
fill: "currentColor",
|
|
859
802
|
viewBox: "0 0 640 512",
|
|
860
803
|
...props
|
|
861
|
-
}, /* @__PURE__ */
|
|
804
|
+
}, /* @__PURE__ */ React15.createElement("path", {
|
|
862
805
|
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
806
|
}));
|
|
864
807
|
};
|
|
865
808
|
var ShoppingCart = (props) => {
|
|
866
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
867
810
|
xmlns: "http://www.w3.org/2000/svg",
|
|
868
811
|
width: "192",
|
|
869
812
|
height: "192",
|
|
870
813
|
fill: "currentColor",
|
|
871
814
|
viewBox: "0 0 256 256",
|
|
872
815
|
...props
|
|
873
|
-
}, /* @__PURE__ */
|
|
816
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
874
817
|
width: "256",
|
|
875
818
|
height: "256",
|
|
876
819
|
fill: "none"
|
|
877
|
-
}), /* @__PURE__ */
|
|
820
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
878
821
|
d: "M184,184H69.8L41.9,30.6A8,8,0,0,0,34.1,24H16",
|
|
879
822
|
fill: "none",
|
|
880
823
|
stroke: "currentColor",
|
|
881
824
|
strokeLinecap: "round",
|
|
882
825
|
strokeLinejoin: "round",
|
|
883
826
|
strokeWidth: "16"
|
|
884
|
-
}), /* @__PURE__ */
|
|
827
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
885
828
|
cx: "80",
|
|
886
829
|
cy: "204",
|
|
887
830
|
r: "20",
|
|
@@ -890,7 +833,7 @@ var ShoppingCart = (props) => {
|
|
|
890
833
|
strokeLinecap: "round",
|
|
891
834
|
strokeLinejoin: "round",
|
|
892
835
|
strokeWidth: "16"
|
|
893
|
-
}), /* @__PURE__ */
|
|
836
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
894
837
|
cx: "184",
|
|
895
838
|
cy: "204",
|
|
896
839
|
r: "20",
|
|
@@ -899,7 +842,7 @@ var ShoppingCart = (props) => {
|
|
|
899
842
|
strokeLinecap: "round",
|
|
900
843
|
strokeLinejoin: "round",
|
|
901
844
|
strokeWidth: "16"
|
|
902
|
-
}), /* @__PURE__ */
|
|
845
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
903
846
|
d: "M62.5,144H188.1a15.9,15.9,0,0,0,15.7-13.1L216,64H48",
|
|
904
847
|
fill: "none",
|
|
905
848
|
stroke: "currentColor",
|
|
@@ -909,25 +852,25 @@ var ShoppingCart = (props) => {
|
|
|
909
852
|
}));
|
|
910
853
|
};
|
|
911
854
|
var Eye = (props) => {
|
|
912
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
913
856
|
xmlns: "http://www.w3.org/2000/svg",
|
|
914
857
|
width: "192",
|
|
915
858
|
height: "192",
|
|
916
859
|
fill: "currentColor",
|
|
917
860
|
viewBox: "0 0 256 256",
|
|
918
861
|
...props
|
|
919
|
-
}, /* @__PURE__ */
|
|
862
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
920
863
|
width: "256",
|
|
921
864
|
height: "256",
|
|
922
865
|
fill: "none"
|
|
923
|
-
}), /* @__PURE__ */
|
|
866
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
924
867
|
d: "M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Z",
|
|
925
868
|
fill: "none",
|
|
926
869
|
stroke: "currentColor",
|
|
927
870
|
strokeLinecap: "round",
|
|
928
871
|
strokeLinejoin: "round",
|
|
929
872
|
strokeWidth: "12"
|
|
930
|
-
}), /* @__PURE__ */
|
|
873
|
+
}), /* @__PURE__ */ React15.createElement("circle", {
|
|
931
874
|
cx: "128",
|
|
932
875
|
cy: "128",
|
|
933
876
|
r: "40",
|
|
@@ -940,19 +883,663 @@ var Eye = (props) => {
|
|
|
940
883
|
};
|
|
941
884
|
|
|
942
885
|
// src/components/Icons/index.tsx
|
|
943
|
-
import
|
|
886
|
+
import clsx from "clsx";
|
|
944
887
|
function Icon({ name, className, ...props }) {
|
|
945
888
|
let WeaverseIcon = Phosphor_exports[name];
|
|
946
|
-
let cls =
|
|
947
|
-
return /* @__PURE__ */
|
|
889
|
+
let cls = clsx("wv-icon", className);
|
|
890
|
+
return /* @__PURE__ */ React16.createElement(WeaverseIcon, {
|
|
948
891
|
className: cls,
|
|
949
892
|
...props
|
|
950
893
|
});
|
|
951
894
|
}
|
|
952
895
|
|
|
896
|
+
// src/components/Slider/Arrows.tsx
|
|
897
|
+
function Arrows(props) {
|
|
898
|
+
let { currentSlide, instanceRef, className, offset } = props;
|
|
899
|
+
let isFirst = currentSlide === 0;
|
|
900
|
+
let isLast = false;
|
|
901
|
+
if (instanceRef.current) {
|
|
902
|
+
isLast = currentSlide === instanceRef?.current?.track?.details?.maxIdx;
|
|
903
|
+
}
|
|
904
|
+
let style = {
|
|
905
|
+
"--offset": `${offset}px`
|
|
906
|
+
};
|
|
907
|
+
return /* @__PURE__ */ React17.createElement(StyledArrows, {
|
|
908
|
+
className,
|
|
909
|
+
style
|
|
910
|
+
}, /* @__PURE__ */ React17.createElement("button", {
|
|
911
|
+
type: "button",
|
|
912
|
+
className: clsx2("arrow arrow--left", isFirst && "arrow--disabled"),
|
|
913
|
+
onClick: (e) => {
|
|
914
|
+
e.stopPropagation();
|
|
915
|
+
instanceRef?.current?.prev();
|
|
916
|
+
}
|
|
917
|
+
}, /* @__PURE__ */ React17.createElement(Icon, {
|
|
918
|
+
name: "ArrowLeft"
|
|
919
|
+
})), /* @__PURE__ */ React17.createElement("button", {
|
|
920
|
+
type: "button",
|
|
921
|
+
className: clsx2("arrow arrow--right", isLast && "arrow--disabled"),
|
|
922
|
+
onClick: (e) => {
|
|
923
|
+
e.stopPropagation();
|
|
924
|
+
instanceRef?.current?.next();
|
|
925
|
+
}
|
|
926
|
+
}, /* @__PURE__ */ React17.createElement(Icon, {
|
|
927
|
+
name: "ArrowRight"
|
|
928
|
+
})));
|
|
929
|
+
}
|
|
930
|
+
var StyledArrows = styled("div", {
|
|
931
|
+
".arrow": {
|
|
932
|
+
position: "absolute",
|
|
933
|
+
top: "50%",
|
|
934
|
+
transform: "translateY(-50%)",
|
|
935
|
+
width: "44px",
|
|
936
|
+
height: "44px",
|
|
937
|
+
padding: "8px",
|
|
938
|
+
color: "#191919",
|
|
939
|
+
backgroundColor: "#f2f2f2",
|
|
940
|
+
textAlign: "center",
|
|
941
|
+
transition: "all 0.2s ease-in-out",
|
|
942
|
+
borderRadius: "4px",
|
|
943
|
+
border: "none",
|
|
944
|
+
cursor: "pointer",
|
|
945
|
+
"&:hover": {
|
|
946
|
+
backgroundColor: "#191919",
|
|
947
|
+
color: "#f2f2f2"
|
|
948
|
+
},
|
|
949
|
+
svg: {
|
|
950
|
+
verticalAlign: "middle",
|
|
951
|
+
width: "22px",
|
|
952
|
+
height: "22px"
|
|
953
|
+
},
|
|
954
|
+
"&.arrow--left": {
|
|
955
|
+
left: "var(--offset, 0px)"
|
|
956
|
+
},
|
|
957
|
+
"&.arrow--right": {
|
|
958
|
+
right: "var(--offset, 0px)"
|
|
959
|
+
},
|
|
960
|
+
"&.arrow--disabled": {
|
|
961
|
+
opacity: 0.5
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
"@media (max-width: 768px)": {
|
|
965
|
+
".arrow": {
|
|
966
|
+
display: "none"
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
// src/components/Slider/Dots.tsx
|
|
972
|
+
import { styled as styled2 } from "@stitches/react";
|
|
973
|
+
import clsx3 from "clsx";
|
|
974
|
+
import React18 from "react";
|
|
975
|
+
function Dots(props) {
|
|
976
|
+
let { currentSlide, instanceRef, className, absolute, position, color } = props;
|
|
977
|
+
let _className = clsx3(
|
|
978
|
+
className,
|
|
979
|
+
absolute && "dots--absolute",
|
|
980
|
+
position && `dots--${position}`,
|
|
981
|
+
color && `dots--${color}`
|
|
982
|
+
);
|
|
983
|
+
return /* @__PURE__ */ React18.createElement(StyledDots, {
|
|
984
|
+
className: _className
|
|
985
|
+
}, [...Array(instanceRef.current?.track.details.slides.length).keys()].map(
|
|
986
|
+
(idx) => {
|
|
987
|
+
let className2 = clsx3("dot", currentSlide === idx && "dot--active");
|
|
988
|
+
return /* @__PURE__ */ React18.createElement("button", {
|
|
989
|
+
key: idx,
|
|
990
|
+
type: "button",
|
|
991
|
+
onClick: () => instanceRef.current?.moveToIdx(idx),
|
|
992
|
+
className: className2
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
));
|
|
996
|
+
}
|
|
997
|
+
var StyledDots = styled2("div", {
|
|
998
|
+
padding: "10px 0",
|
|
999
|
+
display: "flex",
|
|
1000
|
+
justifyContent: "center",
|
|
1001
|
+
alignItems: "center",
|
|
1002
|
+
gap: "12px",
|
|
1003
|
+
"&.dots--absolute": {
|
|
1004
|
+
position: "absolute",
|
|
1005
|
+
"&.dots--top, &.dots--bottom": { left: 0, right: 0 },
|
|
1006
|
+
"&.dots--top": { top: 10 },
|
|
1007
|
+
"&.dots--bottom": { bottom: 10 },
|
|
1008
|
+
"&.dots--left, &.dots--right": {
|
|
1009
|
+
top: 0,
|
|
1010
|
+
bottom: 0,
|
|
1011
|
+
flexDirection: "column"
|
|
1012
|
+
},
|
|
1013
|
+
"&.dots--left": { left: 20 },
|
|
1014
|
+
"&.dots--right": { right: 20 }
|
|
1015
|
+
},
|
|
1016
|
+
"&.dots--light": {
|
|
1017
|
+
".dot": {
|
|
1018
|
+
backgroundColor: "#ffffff66",
|
|
1019
|
+
"&.dot--active": {
|
|
1020
|
+
backgroundColor: "#ffffff"
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
"&.dots--dark": {
|
|
1025
|
+
".dot": {
|
|
1026
|
+
backgroundColor: "#00000033",
|
|
1027
|
+
"&.dot--active": {
|
|
1028
|
+
backgroundColor: "#000000"
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
},
|
|
1032
|
+
".dot": {
|
|
1033
|
+
width: "9px",
|
|
1034
|
+
height: "9px",
|
|
1035
|
+
padding: "0",
|
|
1036
|
+
border: "none",
|
|
1037
|
+
borderRadius: "50%",
|
|
1038
|
+
transition: "all 0.2s ease-in-out"
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
// src/elements/Slideshow/useSlideshowConfigs.ts
|
|
1043
|
+
import { useKeenSlider } from "keen-slider/react";
|
|
1044
|
+
import React19, { useContext as useContext4, useEffect as useEffect2, useState } from "react";
|
|
1045
|
+
|
|
1046
|
+
// src/components/Slider/AutoplayPlugin.ts
|
|
1047
|
+
function AutoplayPlugin(changeSlidesEvery) {
|
|
1048
|
+
return (slider) => {
|
|
1049
|
+
let timeout;
|
|
1050
|
+
let mouseOver = false;
|
|
1051
|
+
function clearNextTimeout() {
|
|
1052
|
+
clearTimeout(timeout);
|
|
1053
|
+
}
|
|
1054
|
+
function nextTimeout() {
|
|
1055
|
+
clearTimeout(timeout);
|
|
1056
|
+
if (mouseOver)
|
|
1057
|
+
return;
|
|
1058
|
+
timeout = setTimeout(() => {
|
|
1059
|
+
slider.next();
|
|
1060
|
+
}, changeSlidesEvery * 1e3);
|
|
1061
|
+
}
|
|
1062
|
+
slider.on("created", () => {
|
|
1063
|
+
slider.container.addEventListener("mouseover", () => {
|
|
1064
|
+
mouseOver = true;
|
|
1065
|
+
clearNextTimeout();
|
|
1066
|
+
});
|
|
1067
|
+
slider.container.addEventListener("mouseout", () => {
|
|
1068
|
+
mouseOver = false;
|
|
1069
|
+
nextTimeout();
|
|
1070
|
+
});
|
|
1071
|
+
nextTimeout();
|
|
1072
|
+
});
|
|
1073
|
+
slider.on("dragStarted", clearNextTimeout);
|
|
1074
|
+
slider.on("animationEnded", nextTimeout);
|
|
1075
|
+
slider.on("updated", nextTimeout);
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
// src/components/Slider/ResizePlugin.ts
|
|
1080
|
+
var ResizePlugin = (slider) => {
|
|
1081
|
+
let observer = new ResizeObserver(() => slider.update());
|
|
1082
|
+
slider.on("created", () => {
|
|
1083
|
+
observer.observe(slider.container);
|
|
1084
|
+
});
|
|
1085
|
+
slider.on("destroyed", () => {
|
|
1086
|
+
observer.unobserve(slider.container);
|
|
1087
|
+
});
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
// src/utils/css.ts
|
|
1091
|
+
import clsx4 from "clsx";
|
|
1092
|
+
function formatCSS(css11) {
|
|
1093
|
+
return {
|
|
1094
|
+
"@desktop": css11["@desktop"],
|
|
1095
|
+
"@mobile": css11["@mobile"]
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
var permanentClasses = {};
|
|
1099
|
+
function generateItemClassName(instance, stitchesInstance) {
|
|
1100
|
+
let { css: css11, type, className: cls = "" } = instance.data;
|
|
1101
|
+
let className = "";
|
|
1102
|
+
let permanentClass = "";
|
|
1103
|
+
let perCss = instance.Element?.permanentCss;
|
|
1104
|
+
if (perCss) {
|
|
1105
|
+
if (type in permanentClasses) {
|
|
1106
|
+
permanentClass = permanentClasses[type];
|
|
1107
|
+
} else {
|
|
1108
|
+
let { className: perCls } = stitchesInstance.css(perCss)();
|
|
1109
|
+
Object.assign(permanentClasses, { [type]: perCls });
|
|
1110
|
+
permanentClass = perCls;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
className = permanentClass;
|
|
1114
|
+
if (css11) {
|
|
1115
|
+
let formattedCss = formatCSS(css11);
|
|
1116
|
+
let newStitchesClass = stitchesInstance.css(formattedCss)().className || "";
|
|
1117
|
+
let { stitchesClass } = instance;
|
|
1118
|
+
let otherClass = (instance.ref.current?.className || "").replace(stitchesClass, "").replace(cls, "").replace(permanentClass, "").trim();
|
|
1119
|
+
className = clsx4(permanentClass, cls, newStitchesClass, otherClass);
|
|
1120
|
+
instance.stitchesClass = newStitchesClass;
|
|
1121
|
+
}
|
|
1122
|
+
return className;
|
|
1123
|
+
}
|
|
1124
|
+
function loadCSS(attrs) {
|
|
1125
|
+
return new Promise((resolve, reject) => {
|
|
1126
|
+
let found = document.querySelector(`link[href="${attrs.href}"]`);
|
|
1127
|
+
if (found) {
|
|
1128
|
+
return resolve(true);
|
|
1129
|
+
}
|
|
1130
|
+
let link = document.createElement("link");
|
|
1131
|
+
Object.assign(link, attrs);
|
|
1132
|
+
link.addEventListener("load", () => resolve(true));
|
|
1133
|
+
link.onerror = reject;
|
|
1134
|
+
document.head.appendChild(link);
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
// src/elements/Slideshow/useSlideshowConfigs.ts
|
|
1139
|
+
function useSlideshowConfigs(props) {
|
|
1140
|
+
let {
|
|
1141
|
+
animation,
|
|
1142
|
+
slidesPerView,
|
|
1143
|
+
loop,
|
|
1144
|
+
autoRotate,
|
|
1145
|
+
changeSlidesEvery,
|
|
1146
|
+
children
|
|
1147
|
+
} = props;
|
|
1148
|
+
let { isDesignMode } = useContext4(WeaverseContext);
|
|
1149
|
+
let [opacities, setOpacities] = React19.useState([]);
|
|
1150
|
+
let [cssLoaded, setCssLoaded] = useState(false);
|
|
1151
|
+
let [created, setCreated] = useState(false);
|
|
1152
|
+
let [ready, setReady] = useState(false);
|
|
1153
|
+
let [currentSlide, setCurrentSlide] = useState(0);
|
|
1154
|
+
let sliderPlugins = [ResizePlugin];
|
|
1155
|
+
if (autoRotate && !isDesignMode) {
|
|
1156
|
+
sliderPlugins.push(AutoplayPlugin(changeSlidesEvery));
|
|
1157
|
+
}
|
|
1158
|
+
let [sliderRef, instanceRef] = useKeenSlider(
|
|
1159
|
+
{
|
|
1160
|
+
slides: animation === "fade" ? React19.Children.count(children) : { perView: slidesPerView },
|
|
1161
|
+
drag: !isDesignMode,
|
|
1162
|
+
loop,
|
|
1163
|
+
selector: animation === "fade" ? null : ".keen-slider__slide",
|
|
1164
|
+
created: () => {
|
|
1165
|
+
setCreated(true);
|
|
1166
|
+
},
|
|
1167
|
+
slideChanged: (slider) => {
|
|
1168
|
+
setCurrentSlide(slider.track.details.rel);
|
|
1169
|
+
},
|
|
1170
|
+
detailsChanged: (slider) => {
|
|
1171
|
+
let newOpacities = slider.track?.details?.slides?.map(
|
|
1172
|
+
(slide) => slide.portion
|
|
1173
|
+
);
|
|
1174
|
+
setOpacities(newOpacities);
|
|
1175
|
+
}
|
|
1176
|
+
},
|
|
1177
|
+
sliderPlugins
|
|
1178
|
+
);
|
|
1179
|
+
useEffect2(() => {
|
|
1180
|
+
loadCSS({
|
|
1181
|
+
rel: "stylesheet",
|
|
1182
|
+
href: "https://cdn.jsdelivr.net/npm/keen-slider@latest/keen-slider.min.css"
|
|
1183
|
+
}).then(() => setCssLoaded(true));
|
|
1184
|
+
}, []);
|
|
1185
|
+
useEffect2(() => {
|
|
1186
|
+
if (created && cssLoaded) {
|
|
1187
|
+
setReady(true);
|
|
1188
|
+
}
|
|
1189
|
+
}, [created, cssLoaded]);
|
|
1190
|
+
return {
|
|
1191
|
+
sliderRef,
|
|
1192
|
+
instanceRef,
|
|
1193
|
+
currentSlide,
|
|
1194
|
+
opacities,
|
|
1195
|
+
ready,
|
|
1196
|
+
created
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
// src/elements/Slideshow/index.tsx
|
|
1201
|
+
var Slideshow = forwardRef8((props, ref) => {
|
|
1202
|
+
let {
|
|
1203
|
+
animation,
|
|
1204
|
+
showArrows,
|
|
1205
|
+
showDots,
|
|
1206
|
+
dotsPosition,
|
|
1207
|
+
dotsColor,
|
|
1208
|
+
children,
|
|
1209
|
+
...rest
|
|
1210
|
+
} = props;
|
|
1211
|
+
let { sliderRef, instanceRef, currentSlide, opacities, ready, created } = useSlideshowConfigs(props);
|
|
1212
|
+
let style = {
|
|
1213
|
+
"--slider-opacity": ready ? 1 : 0
|
|
1214
|
+
};
|
|
1215
|
+
let faderClass = "";
|
|
1216
|
+
if (animation === "fade") {
|
|
1217
|
+
faderClass = stitchesCss({
|
|
1218
|
+
".keen-slider__slide": opacities.reduce((acc, opacity, index) => {
|
|
1219
|
+
acc[`&:nth-child(${index + 1})`] = {
|
|
1220
|
+
opacity
|
|
1221
|
+
};
|
|
1222
|
+
return acc;
|
|
1223
|
+
}, {})
|
|
1224
|
+
})().className;
|
|
1225
|
+
}
|
|
1226
|
+
let _className = clsx5(
|
|
1227
|
+
faderClass,
|
|
1228
|
+
animation === "slide" ? "keen-slider" : "keen-fader"
|
|
1229
|
+
);
|
|
1230
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
1231
|
+
ref,
|
|
1232
|
+
style,
|
|
1233
|
+
...rest
|
|
1234
|
+
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1235
|
+
ref: sliderRef,
|
|
1236
|
+
className: _className
|
|
1237
|
+
}, children), showArrows && created && instanceRef?.current && /* @__PURE__ */ React20.createElement(Arrows, {
|
|
1238
|
+
instanceRef,
|
|
1239
|
+
currentSlide,
|
|
1240
|
+
className: "wv-slideshow--arrows",
|
|
1241
|
+
offset: 20
|
|
1242
|
+
}), showDots && created && instanceRef?.current && /* @__PURE__ */ React20.createElement(Dots, {
|
|
1243
|
+
instanceRef,
|
|
1244
|
+
currentSlide,
|
|
1245
|
+
className: "wv-slideshow--dots",
|
|
1246
|
+
position: dotsPosition,
|
|
1247
|
+
color: dotsColor,
|
|
1248
|
+
absolute: true
|
|
1249
|
+
}));
|
|
1250
|
+
});
|
|
1251
|
+
var css9 = {
|
|
1252
|
+
"@desktop": {
|
|
1253
|
+
opacity: "var(--slider-opacity, 0)",
|
|
1254
|
+
padding: "32px 0",
|
|
1255
|
+
position: "relative",
|
|
1256
|
+
".keen-slider": {
|
|
1257
|
+
height: "100%"
|
|
1258
|
+
},
|
|
1259
|
+
".keen-fader": {
|
|
1260
|
+
position: "relative",
|
|
1261
|
+
height: "100%",
|
|
1262
|
+
".keen-slider__slide": {
|
|
1263
|
+
position: "absolute",
|
|
1264
|
+
inset: 0
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
Slideshow.defaultProps = {
|
|
1270
|
+
animation: "slide",
|
|
1271
|
+
slidesPerView: 1,
|
|
1272
|
+
spacing: 0,
|
|
1273
|
+
showArrows: true,
|
|
1274
|
+
showDots: true,
|
|
1275
|
+
dotsPosition: "bottom",
|
|
1276
|
+
dotsColor: "light",
|
|
1277
|
+
loop: true,
|
|
1278
|
+
autoRotate: false,
|
|
1279
|
+
changeSlidesEvery: 5
|
|
1280
|
+
};
|
|
1281
|
+
var Slideshow_default = Slideshow;
|
|
1282
|
+
|
|
1283
|
+
// src/elements/Slideshow/Slide.tsx
|
|
1284
|
+
import React24, { forwardRef as forwardRef10 } from "react";
|
|
1285
|
+
|
|
1286
|
+
// src/components/Background.tsx
|
|
1287
|
+
import { styled as styled3 } from "@stitches/react";
|
|
1288
|
+
import React21 from "react";
|
|
1289
|
+
function Background2(props) {
|
|
1290
|
+
let {
|
|
1291
|
+
backgroundColor,
|
|
1292
|
+
backgroundImage,
|
|
1293
|
+
backgroundFit,
|
|
1294
|
+
backgroundPosition,
|
|
1295
|
+
className
|
|
1296
|
+
} = props;
|
|
1297
|
+
let style = {
|
|
1298
|
+
["--bg-color"]: backgroundColor,
|
|
1299
|
+
["--bg-fit"]: backgroundFit,
|
|
1300
|
+
["--bg-position"]: backgroundPosition
|
|
1301
|
+
};
|
|
1302
|
+
if (backgroundImage || backgroundColor) {
|
|
1303
|
+
return /* @__PURE__ */ React21.createElement(StyledBackground, {
|
|
1304
|
+
style,
|
|
1305
|
+
className
|
|
1306
|
+
}, backgroundImage && /* @__PURE__ */ React21.createElement("img", {
|
|
1307
|
+
width: "100%",
|
|
1308
|
+
height: "100%",
|
|
1309
|
+
"data-blink-src": backgroundImage,
|
|
1310
|
+
alt: "Background"
|
|
1311
|
+
}));
|
|
1312
|
+
}
|
|
1313
|
+
return null;
|
|
1314
|
+
}
|
|
1315
|
+
var StyledBackground = styled3("div", {
|
|
1316
|
+
display: "block !important",
|
|
1317
|
+
position: "absolute",
|
|
1318
|
+
inset: 0,
|
|
1319
|
+
backgroundColor: "var(--bg-color)",
|
|
1320
|
+
img: {
|
|
1321
|
+
objectFit: "var(--bg-fit, cover)",
|
|
1322
|
+
objectPosition: "var(--bg-position, 50% 50%)"
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
|
|
1326
|
+
// src/components/Overlay.tsx
|
|
1327
|
+
import { styled as styled4 } from "@stitches/react";
|
|
1328
|
+
import React22 from "react";
|
|
1329
|
+
function Overlay2(props) {
|
|
1330
|
+
let { enableOverlay: enabled, overlayOpacity: opacity, className } = props;
|
|
1331
|
+
if (enabled) {
|
|
1332
|
+
return /* @__PURE__ */ React22.createElement(StyledOverlay, {
|
|
1333
|
+
className,
|
|
1334
|
+
css: { ["--overlay-opacity"]: opacity / 100 }
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
return null;
|
|
1338
|
+
}
|
|
1339
|
+
var StyledOverlay = styled4("div", {
|
|
1340
|
+
display: "block !important",
|
|
1341
|
+
position: "absolute",
|
|
1342
|
+
inset: 0,
|
|
1343
|
+
backgroundColor: "rgba(0, 0, 0, var(--overlay-opacity, .3))"
|
|
1344
|
+
});
|
|
1345
|
+
|
|
1346
|
+
// src/components/Placeholder.tsx
|
|
1347
|
+
import React23, { forwardRef as forwardRef9 } from "react";
|
|
1348
|
+
var Placeholder = forwardRef9(
|
|
1349
|
+
(props, ref) => {
|
|
1350
|
+
let { element, className, children, ...rest } = props;
|
|
1351
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1352
|
+
"data-wv-placeholder": true,
|
|
1353
|
+
ref,
|
|
1354
|
+
className,
|
|
1355
|
+
...rest
|
|
1356
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1357
|
+
style: { fontWeight: 600, marginBottom: "10px" }
|
|
1358
|
+
}, element), /* @__PURE__ */ React23.createElement("div", null, children));
|
|
1359
|
+
}
|
|
1360
|
+
);
|
|
1361
|
+
var Placeholder_default = Placeholder;
|
|
1362
|
+
|
|
1363
|
+
// src/elements/Slideshow/position.ts
|
|
1364
|
+
var slidePositionMap = {
|
|
1365
|
+
"top left": {
|
|
1366
|
+
justifyContent: "flex-start",
|
|
1367
|
+
alignItems: "flex-start"
|
|
1368
|
+
},
|
|
1369
|
+
"top center": {
|
|
1370
|
+
justifyContent: "flex-start",
|
|
1371
|
+
alignItems: "center"
|
|
1372
|
+
},
|
|
1373
|
+
"top right": {
|
|
1374
|
+
justifyContent: "flex-start",
|
|
1375
|
+
alignItems: "flex-end"
|
|
1376
|
+
},
|
|
1377
|
+
"center left": {
|
|
1378
|
+
justifyContent: "center",
|
|
1379
|
+
alignItems: "flex-start"
|
|
1380
|
+
},
|
|
1381
|
+
"center center": {
|
|
1382
|
+
justifyContent: "center",
|
|
1383
|
+
alignItems: "center"
|
|
1384
|
+
},
|
|
1385
|
+
"center right": {
|
|
1386
|
+
justifyContent: "center",
|
|
1387
|
+
alignItems: "flex-end"
|
|
1388
|
+
},
|
|
1389
|
+
"bottom left": {
|
|
1390
|
+
justifyContent: "flex-end",
|
|
1391
|
+
alignItems: "flex-start"
|
|
1392
|
+
},
|
|
1393
|
+
"bottom center": {
|
|
1394
|
+
justifyContent: "flex-end",
|
|
1395
|
+
alignItems: "center"
|
|
1396
|
+
},
|
|
1397
|
+
"bottom right": {
|
|
1398
|
+
justifyContent: "flex-end",
|
|
1399
|
+
alignItems: "flex-end"
|
|
1400
|
+
}
|
|
1401
|
+
};
|
|
1402
|
+
|
|
1403
|
+
// src/elements/Slideshow/Slide.tsx
|
|
1404
|
+
var Slide = forwardRef10((props, ref) => {
|
|
1405
|
+
let {
|
|
1406
|
+
contentPosition,
|
|
1407
|
+
backgroundColor,
|
|
1408
|
+
backgroundImage,
|
|
1409
|
+
backgroundFit,
|
|
1410
|
+
backgroundPosition,
|
|
1411
|
+
enableOverlay,
|
|
1412
|
+
overlayOpacity,
|
|
1413
|
+
children,
|
|
1414
|
+
...rest
|
|
1415
|
+
} = props;
|
|
1416
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1417
|
+
className: "keen-slider__slide"
|
|
1418
|
+
}, /* @__PURE__ */ React24.createElement(Background2, {
|
|
1419
|
+
backgroundColor,
|
|
1420
|
+
backgroundImage,
|
|
1421
|
+
backgroundFit,
|
|
1422
|
+
backgroundPosition,
|
|
1423
|
+
className: "slide-background"
|
|
1424
|
+
}), /* @__PURE__ */ React24.createElement(Overlay2, {
|
|
1425
|
+
enableOverlay,
|
|
1426
|
+
overlayOpacity,
|
|
1427
|
+
className: "slide-overlay"
|
|
1428
|
+
}), /* @__PURE__ */ React24.createElement("div", {
|
|
1429
|
+
ref,
|
|
1430
|
+
style: slidePositionMap[contentPosition],
|
|
1431
|
+
...rest
|
|
1432
|
+
}, children?.length ? children : /* @__PURE__ */ React24.createElement(Placeholder_default, {
|
|
1433
|
+
element: "Slide",
|
|
1434
|
+
className: "wv-slide-placeholder"
|
|
1435
|
+
}, "Drag and drop elements here")));
|
|
1436
|
+
});
|
|
1437
|
+
var css10 = {
|
|
1438
|
+
"@desktop": {
|
|
1439
|
+
position: "relative",
|
|
1440
|
+
height: "100%",
|
|
1441
|
+
width: "1224px",
|
|
1442
|
+
maxWidth: "100%",
|
|
1443
|
+
margin: "0 auto",
|
|
1444
|
+
display: "flex",
|
|
1445
|
+
flexDirection: "column",
|
|
1446
|
+
padding: "100px 20px",
|
|
1447
|
+
".wv-slide-placeholder": {
|
|
1448
|
+
height: "200px",
|
|
1449
|
+
zIndex: 1
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
};
|
|
1453
|
+
Slide.defaultProps = {
|
|
1454
|
+
contentPosition: "center center",
|
|
1455
|
+
backgroundFit: "cover",
|
|
1456
|
+
backgroundPosition: "center center",
|
|
1457
|
+
enableOverlay: false,
|
|
1458
|
+
overlayOpacity: 30
|
|
1459
|
+
};
|
|
1460
|
+
var Slide_default = Slide;
|
|
1461
|
+
|
|
1462
|
+
// src/elements/index.ts
|
|
1463
|
+
var Elements = {
|
|
1464
|
+
Countdown: {
|
|
1465
|
+
Component: Countdown_default,
|
|
1466
|
+
type: "countdown",
|
|
1467
|
+
defaultCss: css3
|
|
1468
|
+
},
|
|
1469
|
+
Button: {
|
|
1470
|
+
Component: Button_default,
|
|
1471
|
+
type: "button",
|
|
1472
|
+
defaultCss: css
|
|
1473
|
+
},
|
|
1474
|
+
Container: {
|
|
1475
|
+
Component: Container_default,
|
|
1476
|
+
type: "container",
|
|
1477
|
+
defaultCss: css2
|
|
1478
|
+
},
|
|
1479
|
+
Image: {
|
|
1480
|
+
Component: Image_default,
|
|
1481
|
+
type: "image",
|
|
1482
|
+
defaultCss: css4
|
|
1483
|
+
},
|
|
1484
|
+
Layout: {
|
|
1485
|
+
Component: Layout_default,
|
|
1486
|
+
type: "layout",
|
|
1487
|
+
defaultCss: css5
|
|
1488
|
+
},
|
|
1489
|
+
Map: {
|
|
1490
|
+
Component: Map_default,
|
|
1491
|
+
type: "map",
|
|
1492
|
+
defaultCss: css6
|
|
1493
|
+
},
|
|
1494
|
+
Text: {
|
|
1495
|
+
Component: Text_default,
|
|
1496
|
+
type: "text",
|
|
1497
|
+
defaultCss: css7
|
|
1498
|
+
},
|
|
1499
|
+
Video: {
|
|
1500
|
+
Component: Video_default,
|
|
1501
|
+
type: "video",
|
|
1502
|
+
defaultCss: css8
|
|
1503
|
+
},
|
|
1504
|
+
Slideshow: {
|
|
1505
|
+
Component: Slideshow_default,
|
|
1506
|
+
type: "slideshow",
|
|
1507
|
+
defaultCss: css9
|
|
1508
|
+
},
|
|
1509
|
+
Slide: {
|
|
1510
|
+
Component: Slide_default,
|
|
1511
|
+
type: "slide",
|
|
1512
|
+
defaultCss: css10
|
|
1513
|
+
}
|
|
1514
|
+
};
|
|
1515
|
+
|
|
1516
|
+
// src/context.ts
|
|
1517
|
+
var createRootContext = (configs) => {
|
|
1518
|
+
let rootContext = new Weaverse(configs);
|
|
1519
|
+
Object.keys(Elements).forEach((key) => {
|
|
1520
|
+
rootContext.registerElement(Elements[key]);
|
|
1521
|
+
});
|
|
1522
|
+
return rootContext;
|
|
1523
|
+
};
|
|
1524
|
+
var WeaverseContext = createContext({});
|
|
1525
|
+
var WeaverseContextProvider = WeaverseContext.Provider;
|
|
1526
|
+
var WeaverseContextConsumer = WeaverseContext.Consumer;
|
|
1527
|
+
|
|
1528
|
+
// src/components/Modal/index.tsx
|
|
1529
|
+
var Modal_exports = {};
|
|
1530
|
+
__export(Modal_exports, {
|
|
1531
|
+
Modal: () => Modal,
|
|
1532
|
+
ModalClose: () => ModalClose,
|
|
1533
|
+
ModalContent: () => ModalContent,
|
|
1534
|
+
ModalHeader: () => ModalHeader,
|
|
1535
|
+
ModalTrigger: () => ModalTrigger
|
|
1536
|
+
});
|
|
1537
|
+
import { Close, Portal, Root, Trigger } from "@radix-ui/react-dialog";
|
|
1538
|
+
import React25, { forwardRef as forwardRef11 } from "react";
|
|
1539
|
+
|
|
953
1540
|
// src/components/Modal/styled.ts
|
|
954
|
-
import { Content, Overlay as
|
|
955
|
-
import { keyframes, styled } from "@stitches/react";
|
|
1541
|
+
import { Content, Overlay as Overlay3, Title } from "@radix-ui/react-dialog";
|
|
1542
|
+
import { keyframes, styled as styled5 } from "@stitches/react";
|
|
956
1543
|
var overlayShow = keyframes({
|
|
957
1544
|
"0%": { opacity: 0 },
|
|
958
1545
|
"100%": { opacity: 1 }
|
|
@@ -961,7 +1548,7 @@ var contentShow = keyframes({
|
|
|
961
1548
|
"0%": { opacity: 0, transform: "translate(-50%, -48%) scale(.96)" },
|
|
962
1549
|
"100%": { opacity: 1, transform: "translate(-50%, -50%) scale(1)" }
|
|
963
1550
|
});
|
|
964
|
-
var
|
|
1551
|
+
var StyledOverlay2 = styled5(Overlay3, {
|
|
965
1552
|
display: "block !important",
|
|
966
1553
|
backgroundColor: "rgba(0, 0, 0, .3)",
|
|
967
1554
|
position: "fixed",
|
|
@@ -969,7 +1556,7 @@ var StyledOverlay = styled(Overlay2, {
|
|
|
969
1556
|
inset: 0,
|
|
970
1557
|
animation: `${overlayShow} 300ms cubic-bezier(0.16, 1, 0.3, 1)`
|
|
971
1558
|
});
|
|
972
|
-
var StyledTitle =
|
|
1559
|
+
var StyledTitle = styled5(Title, {
|
|
973
1560
|
margin: "0 0 24px",
|
|
974
1561
|
fontWeight: 500,
|
|
975
1562
|
fontSize: 24,
|
|
@@ -978,7 +1565,7 @@ var StyledTitle = styled(Title, {
|
|
|
978
1565
|
fontSize: 20
|
|
979
1566
|
}
|
|
980
1567
|
});
|
|
981
|
-
var StyledContent =
|
|
1568
|
+
var StyledContent = styled5(Content, {
|
|
982
1569
|
backgroundColor: "white",
|
|
983
1570
|
borderRadius: 6,
|
|
984
1571
|
boxShadow: "hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px",
|
|
@@ -1009,7 +1596,7 @@ var StyledContent = styled(Content, {
|
|
|
1009
1596
|
}
|
|
1010
1597
|
}
|
|
1011
1598
|
});
|
|
1012
|
-
var StyledCloseIcon =
|
|
1599
|
+
var StyledCloseIcon = styled5("button", {
|
|
1013
1600
|
all: "unset",
|
|
1014
1601
|
cursor: "pointer",
|
|
1015
1602
|
fontFamily: "inherit",
|
|
@@ -1034,10 +1621,10 @@ var StyledCloseIcon = styled("button", {
|
|
|
1034
1621
|
});
|
|
1035
1622
|
|
|
1036
1623
|
// src/components/Modal/useOpenChangeEffect.ts
|
|
1037
|
-
import { useContext as
|
|
1624
|
+
import { useContext as useContext5, useEffect as useEffect3 } from "react";
|
|
1038
1625
|
function useOpenChangeEffect(props) {
|
|
1039
1626
|
let { open, defaultOpen, onOpenChange } = props;
|
|
1040
|
-
let rootCtx =
|
|
1627
|
+
let rootCtx = useContext5(WeaverseContext);
|
|
1041
1628
|
let toggleRootzIndex = (open2) => {
|
|
1042
1629
|
let { contentRootElement } = rootCtx;
|
|
1043
1630
|
if (contentRootElement) {
|
|
@@ -1048,7 +1635,7 @@ function useOpenChangeEffect(props) {
|
|
|
1048
1635
|
}
|
|
1049
1636
|
}
|
|
1050
1637
|
};
|
|
1051
|
-
|
|
1638
|
+
useEffect3(() => {
|
|
1052
1639
|
let isOpen = open || defaultOpen;
|
|
1053
1640
|
toggleRootzIndex(isOpen);
|
|
1054
1641
|
}, [open, defaultOpen]);
|
|
@@ -1063,7 +1650,7 @@ function useOpenChangeEffect(props) {
|
|
|
1063
1650
|
var Modal = (props) => {
|
|
1064
1651
|
let { children, open, defaultOpen, onOpenChange, ...rest } = props;
|
|
1065
1652
|
let handleOpenChange = useOpenChangeEffect(props);
|
|
1066
|
-
return /* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ React25.createElement(Root, {
|
|
1067
1654
|
open,
|
|
1068
1655
|
defaultOpen,
|
|
1069
1656
|
onOpenChange: handleOpenChange,
|
|
@@ -1071,30 +1658,30 @@ var Modal = (props) => {
|
|
|
1071
1658
|
}, children);
|
|
1072
1659
|
};
|
|
1073
1660
|
var ModalTrigger = Trigger;
|
|
1074
|
-
var ModalHeader =
|
|
1661
|
+
var ModalHeader = forwardRef11(
|
|
1075
1662
|
(props, ref) => {
|
|
1076
1663
|
let { children, ...rest } = props;
|
|
1077
|
-
return /* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ React25.createElement(StyledTitle, {
|
|
1078
1665
|
ref,
|
|
1079
1666
|
...rest,
|
|
1080
1667
|
"data-wv-modal-header": true
|
|
1081
1668
|
}, children);
|
|
1082
1669
|
}
|
|
1083
1670
|
);
|
|
1084
|
-
var ModalContent =
|
|
1671
|
+
var ModalContent = forwardRef11(
|
|
1085
1672
|
(props, ref) => {
|
|
1086
1673
|
let { children, size, portal, ...rest } = props;
|
|
1087
|
-
let modalContent = /* @__PURE__ */
|
|
1674
|
+
let modalContent = /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(StyledOverlay2, null), /* @__PURE__ */ React25.createElement(StyledContent, {
|
|
1088
1675
|
...rest,
|
|
1089
1676
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
1090
1677
|
"data-wv-modal": true,
|
|
1091
1678
|
"data-size": size,
|
|
1092
1679
|
ref
|
|
1093
|
-
}, /* @__PURE__ */
|
|
1680
|
+
}, /* @__PURE__ */ React25.createElement(ModalClose, null), /* @__PURE__ */ React25.createElement("div", {
|
|
1094
1681
|
className: "wv-modal-content"
|
|
1095
1682
|
}, children)));
|
|
1096
1683
|
if (portal) {
|
|
1097
|
-
return /* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ React25.createElement(Portal, null, modalContent);
|
|
1098
1685
|
}
|
|
1099
1686
|
return modalContent;
|
|
1100
1687
|
}
|
|
@@ -1103,13 +1690,13 @@ ModalContent.defaultProps = {
|
|
|
1103
1690
|
size: "auto",
|
|
1104
1691
|
portal: false
|
|
1105
1692
|
};
|
|
1106
|
-
var ModalClose =
|
|
1693
|
+
var ModalClose = forwardRef11(
|
|
1107
1694
|
(props, ref) => {
|
|
1108
1695
|
let { asChild, children, ...rest } = props;
|
|
1109
|
-
let closeIcon = /* @__PURE__ */
|
|
1696
|
+
let closeIcon = /* @__PURE__ */ React25.createElement(StyledCloseIcon, null, /* @__PURE__ */ React25.createElement(Icon, {
|
|
1110
1697
|
name: "X"
|
|
1111
1698
|
}));
|
|
1112
|
-
return /* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ React25.createElement(Close, {
|
|
1113
1700
|
asChild: true,
|
|
1114
1701
|
...rest,
|
|
1115
1702
|
ref
|
|
@@ -1118,131 +1705,33 @@ var ModalClose = forwardRef9(
|
|
|
1118
1705
|
);
|
|
1119
1706
|
|
|
1120
1707
|
// src/components/Spinner.tsx
|
|
1121
|
-
import
|
|
1708
|
+
import React26 from "react";
|
|
1122
1709
|
function Spinner() {
|
|
1123
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ React26.createElement("span", {
|
|
1124
1711
|
className: "wv-spinner-wrapper"
|
|
1125
|
-
}, /* @__PURE__ */
|
|
1712
|
+
}, /* @__PURE__ */ React26.createElement(Icon, {
|
|
1126
1713
|
name: "CircleNotch",
|
|
1127
1714
|
className: "wv-spinner"
|
|
1128
1715
|
}));
|
|
1129
1716
|
}
|
|
1130
1717
|
|
|
1131
1718
|
// src/components/Tooltip.tsx
|
|
1132
|
-
import
|
|
1719
|
+
import React27 from "react";
|
|
1133
1720
|
function Tooltip({ children }) {
|
|
1134
|
-
return /* @__PURE__ */
|
|
1721
|
+
return /* @__PURE__ */ React27.createElement("span", {
|
|
1135
1722
|
className: "wv-tooltip"
|
|
1136
1723
|
}, children);
|
|
1137
1724
|
}
|
|
1138
1725
|
|
|
1139
1726
|
// src/components/Slider/index.tsx
|
|
1140
|
-
import
|
|
1141
|
-
import { useKeenSlider } from "keen-slider/react";
|
|
1142
|
-
import
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
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
|
|
1242
|
-
function Slider({ children, className, gap }) {
|
|
1243
|
-
let [currentSlide, setCurrentSlide] = useState(0);
|
|
1244
|
-
let [created, setCreated] = useState(false);
|
|
1245
|
-
let [ref, instanceRef] = useKeenSlider(
|
|
1727
|
+
import clsx6 from "clsx";
|
|
1728
|
+
import { useKeenSlider as useKeenSlider2 } from "keen-slider/react";
|
|
1729
|
+
import React28, { useState as useState2 } from "react";
|
|
1730
|
+
function Slider(props) {
|
|
1731
|
+
let { children, className, gap, arrowOffset } = props;
|
|
1732
|
+
let [currentSlide, setCurrentSlide] = useState2(0);
|
|
1733
|
+
let [created, setCreated] = useState2(false);
|
|
1734
|
+
let [ref, instanceRef] = useKeenSlider2(
|
|
1246
1735
|
{
|
|
1247
1736
|
slides: { perView: 4, spacing: gap },
|
|
1248
1737
|
breakpoints: {
|
|
@@ -1265,169 +1754,43 @@ function Slider({ children, className, gap }) {
|
|
|
1265
1754
|
},
|
|
1266
1755
|
[ResizePlugin]
|
|
1267
1756
|
);
|
|
1268
|
-
let _className =
|
|
1269
|
-
let arrowsClass =
|
|
1270
|
-
return /* @__PURE__ */
|
|
1757
|
+
let _className = clsx6("keen-slider", className);
|
|
1758
|
+
let arrowsClass = clsx6(className && `${className}-arrows`);
|
|
1759
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", {
|
|
1271
1760
|
ref,
|
|
1272
1761
|
className: _className
|
|
1273
|
-
}, /* @__PURE__ */
|
|
1762
|
+
}, /* @__PURE__ */ React28.createElement("link", {
|
|
1274
1763
|
rel: "stylesheet",
|
|
1275
1764
|
href: "https://cdn.jsdelivr.net/npm/keen-slider@latest/keen-slider.min.css"
|
|
1276
|
-
}), children), created && instanceRef?.current && /* @__PURE__ */
|
|
1765
|
+
}), children), created && instanceRef?.current && /* @__PURE__ */ React28.createElement(Arrows, {
|
|
1277
1766
|
currentSlide,
|
|
1278
1767
|
instanceRef,
|
|
1279
|
-
className: arrowsClass
|
|
1768
|
+
className: arrowsClass,
|
|
1769
|
+
offset: arrowOffset
|
|
1280
1770
|
}));
|
|
1281
1771
|
}
|
|
1282
1772
|
|
|
1283
1773
|
// src/components/index.ts
|
|
1284
1774
|
var Components = {
|
|
1775
|
+
Background: Background2,
|
|
1776
|
+
Icon,
|
|
1777
|
+
ModalComponents: Modal_exports,
|
|
1778
|
+
Overlay: Overlay2,
|
|
1285
1779
|
Placeholder: Placeholder_default,
|
|
1286
1780
|
Spinner,
|
|
1287
|
-
ModalComponents: Modal_exports,
|
|
1288
|
-
Icon,
|
|
1289
1781
|
Slider,
|
|
1290
1782
|
Tooltip
|
|
1291
1783
|
};
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
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
|
-
}
|
|
1784
|
+
var SliderComponents = {
|
|
1785
|
+
Arrows,
|
|
1786
|
+
Dots,
|
|
1787
|
+
ResizePlugin,
|
|
1788
|
+
AutoplayPlugin
|
|
1414
1789
|
};
|
|
1415
1790
|
|
|
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
1791
|
// src/renderer.tsx
|
|
1429
1792
|
import { isBrowser } from "@weaverse/core";
|
|
1430
|
-
import
|
|
1793
|
+
import React29, { useContext as useContext6, useEffect as useEffect5, useRef, useState as useState3 } from "react";
|
|
1431
1794
|
var WeaverseRoot = ({ context }) => {
|
|
1432
1795
|
let [, setData] = useState3(context.projectData);
|
|
1433
1796
|
let rootRef = useRef();
|
|
@@ -1442,13 +1805,13 @@ var WeaverseRoot = ({ context }) => {
|
|
|
1442
1805
|
let eventHandlers = context?.studioBridge?.eventHandlers || {};
|
|
1443
1806
|
let themeClass = context.stitchesInstance.theme.className;
|
|
1444
1807
|
if (context.projectData?.rootId) {
|
|
1445
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ React29.createElement("div", {
|
|
1446
1809
|
className: `weaverse-content-root ${themeClass}`,
|
|
1447
1810
|
...eventHandlers,
|
|
1448
1811
|
ref: rootRef
|
|
1449
|
-
}, /* @__PURE__ */
|
|
1812
|
+
}, /* @__PURE__ */ React29.createElement(WeaverseContextProvider, {
|
|
1450
1813
|
value: context
|
|
1451
|
-
}, /* @__PURE__ */
|
|
1814
|
+
}, /* @__PURE__ */ React29.createElement(ItemInstance, {
|
|
1452
1815
|
id: context.projectData.rootId
|
|
1453
1816
|
})));
|
|
1454
1817
|
}
|
|
@@ -1457,7 +1820,7 @@ var WeaverseRoot = ({ context }) => {
|
|
|
1457
1820
|
var ItemComponent = ({ instance }) => {
|
|
1458
1821
|
let { stitchesInstance, elementInstances } = useContext6(WeaverseContext);
|
|
1459
1822
|
let [data, setData] = useState3(instance.data);
|
|
1460
|
-
let { id, type, childIds = [], css:
|
|
1823
|
+
let { id, type, childIds = [], css: css11, className, ...rest } = data;
|
|
1461
1824
|
useEffect5(() => {
|
|
1462
1825
|
let render = (data2) => setData({ ...data2 });
|
|
1463
1826
|
instance.subscribe(render);
|
|
@@ -1474,13 +1837,13 @@ var ItemComponent = ({ instance }) => {
|
|
|
1474
1837
|
if (Component.$$typeof === Symbol.for("react.forward_ref")) {
|
|
1475
1838
|
rest.ref = instance.ref;
|
|
1476
1839
|
}
|
|
1477
|
-
return /* @__PURE__ */
|
|
1840
|
+
return /* @__PURE__ */ React29.createElement(Component, {
|
|
1478
1841
|
key: id,
|
|
1479
1842
|
"data-wv-type": type,
|
|
1480
1843
|
"data-wv-id": id,
|
|
1481
1844
|
className: generateItemClassName(instance, stitchesInstance),
|
|
1482
1845
|
...rest
|
|
1483
|
-
}, childIds.map((id2) => /* @__PURE__ */
|
|
1846
|
+
}, childIds.map((id2) => /* @__PURE__ */ React29.createElement(ItemInstance, {
|
|
1484
1847
|
key: id2,
|
|
1485
1848
|
id: id2
|
|
1486
1849
|
})));
|
|
@@ -1494,11 +1857,11 @@ var ItemInstance = ({ id }) => {
|
|
|
1494
1857
|
let { itemInstances } = context;
|
|
1495
1858
|
let instance = itemInstances.get(id);
|
|
1496
1859
|
if (!instance) {
|
|
1497
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ React29.createElement("div", {
|
|
1498
1861
|
style: { display: "none" }
|
|
1499
1862
|
}, "Item instance ", id, " not found");
|
|
1500
1863
|
}
|
|
1501
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ React29.createElement(ItemComponent, {
|
|
1502
1865
|
key: id,
|
|
1503
1866
|
instance
|
|
1504
1867
|
});
|
|
@@ -1506,6 +1869,7 @@ var ItemInstance = ({ id }) => {
|
|
|
1506
1869
|
export {
|
|
1507
1870
|
Components,
|
|
1508
1871
|
Elements,
|
|
1872
|
+
SliderComponents,
|
|
1509
1873
|
WeaverseContext,
|
|
1510
1874
|
WeaverseContextConsumer,
|
|
1511
1875
|
WeaverseContextProvider,
|