@weaverse/react 0.7.64 → 0.7.66
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 +71 -60
- package/dist/index.js +247 -81
- package/dist/index.mjs +250 -84
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export * from "@weaverse/core";
|
|
|
11
11
|
import { Weaverse } from "@weaverse/core";
|
|
12
12
|
import { createContext } from "react";
|
|
13
13
|
|
|
14
|
-
// src/elements/
|
|
14
|
+
// src/elements/button.tsx
|
|
15
15
|
import * as React from "react";
|
|
16
16
|
import { useContext } from "react";
|
|
17
17
|
var Button = React.forwardRef((props, ref) => {
|
|
@@ -56,9 +56,9 @@ var css = {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
var
|
|
59
|
+
var button_default = Button;
|
|
60
60
|
|
|
61
|
-
// src/elements/
|
|
61
|
+
// src/elements/container.tsx
|
|
62
62
|
import React2, { forwardRef as forwardRef2 } from "react";
|
|
63
63
|
var Container = forwardRef2(
|
|
64
64
|
(props, ref) => {
|
|
@@ -79,9 +79,9 @@ var css2 = {
|
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
Container.defaultProps = {};
|
|
82
|
-
var
|
|
82
|
+
var container_default = Container;
|
|
83
83
|
|
|
84
|
-
// src/elements/
|
|
84
|
+
// src/elements/countdown/index.tsx
|
|
85
85
|
import React4, { forwardRef as forwardRef3, useContext as useContext2, useEffect } from "react";
|
|
86
86
|
|
|
87
87
|
// src/constant/index.ts
|
|
@@ -114,7 +114,7 @@ function getVimeoId(url) {
|
|
|
114
114
|
return match ? match[1] : null;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
// src/elements/
|
|
117
|
+
// src/elements/countdown/timer-block.tsx
|
|
118
118
|
import React3 from "react";
|
|
119
119
|
function TimerBlock({ value, label }) {
|
|
120
120
|
return /* @__PURE__ */ React3.createElement("div", {
|
|
@@ -126,7 +126,7 @@ function TimerBlock({ value, label }) {
|
|
|
126
126
|
}, label));
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// src/elements/
|
|
129
|
+
// src/elements/countdown/index.tsx
|
|
130
130
|
var Countdown = forwardRef3(
|
|
131
131
|
(props, ref) => {
|
|
132
132
|
const { isDesignMode } = useContext2(WeaverseContext);
|
|
@@ -239,9 +239,9 @@ Countdown.defaultProps = {
|
|
|
239
239
|
showLabel: true,
|
|
240
240
|
showColon: true
|
|
241
241
|
};
|
|
242
|
-
var
|
|
242
|
+
var countdown_default = Countdown;
|
|
243
243
|
|
|
244
|
-
// src/elements/
|
|
244
|
+
// src/elements/image.tsx
|
|
245
245
|
import React5 from "react";
|
|
246
246
|
var Image = React5.forwardRef(
|
|
247
247
|
(props, ref) => {
|
|
@@ -264,16 +264,19 @@ var Image = React5.forwardRef(
|
|
|
264
264
|
"data-blink-src": src
|
|
265
265
|
});
|
|
266
266
|
if (clickAction === "openLink" && linkTo) {
|
|
267
|
-
let target = openLinkInNewTab ? "_blank" : "_self";
|
|
268
267
|
content = /* @__PURE__ */ React5.createElement("a", {
|
|
269
268
|
href: linkTo,
|
|
270
|
-
target
|
|
271
|
-
|
|
269
|
+
target: openLinkInNewTab ? "_blank" : "_self",
|
|
270
|
+
rel: "noreferrer"
|
|
271
|
+
}, /* @__PURE__ */ React5.createElement("img", {
|
|
272
|
+
alt,
|
|
273
|
+
"data-blink-src": src
|
|
274
|
+
}));
|
|
272
275
|
}
|
|
273
276
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
274
277
|
ref,
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
style,
|
|
279
|
+
...rest
|
|
277
280
|
}, content);
|
|
278
281
|
}
|
|
279
282
|
);
|
|
@@ -281,6 +284,8 @@ var css4 = {
|
|
|
281
284
|
"@desktop": {
|
|
282
285
|
display: "flex",
|
|
283
286
|
overflow: "hidden",
|
|
287
|
+
justifyContent: "center",
|
|
288
|
+
alignItems: "center",
|
|
284
289
|
img: {
|
|
285
290
|
width: "100%",
|
|
286
291
|
height: "100%",
|
|
@@ -290,20 +295,20 @@ var css4 = {
|
|
|
290
295
|
}
|
|
291
296
|
};
|
|
292
297
|
Image.defaultProps = {
|
|
293
|
-
src: "https://ucarecdn.com/
|
|
294
|
-
alt: "
|
|
298
|
+
src: "https://ucarecdn.com/dac0f414-2b1f-46df-99ce-41554f0f653a/",
|
|
299
|
+
alt: "Alternative information",
|
|
295
300
|
objectFit: "cover",
|
|
296
301
|
objectPosition: "center center",
|
|
297
302
|
clickAction: "none",
|
|
298
303
|
openLinkInNewTab: false,
|
|
299
304
|
linkTo: ""
|
|
300
305
|
};
|
|
301
|
-
var
|
|
306
|
+
var image_default = Image;
|
|
302
307
|
|
|
303
|
-
// src/elements/
|
|
308
|
+
// src/elements/layout/index.tsx
|
|
304
309
|
import React8, { forwardRef as forwardRef4 } from "react";
|
|
305
310
|
|
|
306
|
-
// src/elements/
|
|
311
|
+
// src/elements/layout/Background.tsx
|
|
307
312
|
import React6 from "react";
|
|
308
313
|
function Background(props) {
|
|
309
314
|
let { bgColor, imgUrl, objectFit, objectPosition } = props;
|
|
@@ -326,7 +331,7 @@ function Background(props) {
|
|
|
326
331
|
return null;
|
|
327
332
|
}
|
|
328
333
|
|
|
329
|
-
// src/elements/
|
|
334
|
+
// src/elements/layout/Overlay.tsx
|
|
330
335
|
import React7 from "react";
|
|
331
336
|
function Overlay(props) {
|
|
332
337
|
let { enableOverlay, overlayOpacity } = props;
|
|
@@ -342,7 +347,7 @@ function Overlay(props) {
|
|
|
342
347
|
return null;
|
|
343
348
|
}
|
|
344
349
|
|
|
345
|
-
// src/elements/
|
|
350
|
+
// src/elements/layout/index.tsx
|
|
346
351
|
var Layout = forwardRef4((props, ref) => {
|
|
347
352
|
let {
|
|
348
353
|
children,
|
|
@@ -437,9 +442,9 @@ Layout.defaultProps = {
|
|
|
437
442
|
enableOverlay: false,
|
|
438
443
|
overlayOpacity: 30
|
|
439
444
|
};
|
|
440
|
-
var
|
|
445
|
+
var layout_default = Layout;
|
|
441
446
|
|
|
442
|
-
// src/elements/
|
|
447
|
+
// src/elements/map.tsx
|
|
443
448
|
import React9, { forwardRef as forwardRef5 } from "react";
|
|
444
449
|
var Map = forwardRef5((props, ref) => {
|
|
445
450
|
let { place, zoom, ...rest } = props;
|
|
@@ -471,9 +476,9 @@ Map.defaultProps = {
|
|
|
471
476
|
place: "Hanoi",
|
|
472
477
|
zoom: 14
|
|
473
478
|
};
|
|
474
|
-
var
|
|
479
|
+
var map_default = Map;
|
|
475
480
|
|
|
476
|
-
// src/elements/
|
|
481
|
+
// src/elements/text.tsx
|
|
477
482
|
import * as React10 from "react";
|
|
478
483
|
var Text = React10.forwardRef(
|
|
479
484
|
(props, ref) => {
|
|
@@ -502,12 +507,12 @@ var css7 = {
|
|
|
502
507
|
Text.defaultProps = {
|
|
503
508
|
value: "<p>The quick brown fox jumps over the lazy dog</p>"
|
|
504
509
|
};
|
|
505
|
-
var
|
|
510
|
+
var text_default = Text;
|
|
506
511
|
|
|
507
|
-
// src/elements/
|
|
512
|
+
// src/elements/video/index.tsx
|
|
508
513
|
import React14, { forwardRef as forwardRef7, useContext as useContext3 } from "react";
|
|
509
514
|
|
|
510
|
-
// src/elements/
|
|
515
|
+
// src/elements/video/html-video.tsx
|
|
511
516
|
import React11 from "react";
|
|
512
517
|
function HTMLVideo(props) {
|
|
513
518
|
let { src, type, controls, autoPlay, loop, muted } = props;
|
|
@@ -527,7 +532,7 @@ function HTMLVideo(props) {
|
|
|
527
532
|
}), "Your browser does not support the video tag.");
|
|
528
533
|
}
|
|
529
534
|
|
|
530
|
-
// src/elements/
|
|
535
|
+
// src/elements/video/vimeo.tsx
|
|
531
536
|
import React12 from "react";
|
|
532
537
|
function Vimeo(props) {
|
|
533
538
|
let { vimeoId, controls, autoPlay, loop, muted } = props;
|
|
@@ -541,7 +546,7 @@ function Vimeo(props) {
|
|
|
541
546
|
});
|
|
542
547
|
}
|
|
543
548
|
|
|
544
|
-
// src/elements/
|
|
549
|
+
// src/elements/video/youtube.tsx
|
|
545
550
|
import React13 from "react";
|
|
546
551
|
function Youtube(props) {
|
|
547
552
|
let { youtubeId, controls, autoPlay, loop, muted } = props;
|
|
@@ -557,12 +562,11 @@ function Youtube(props) {
|
|
|
557
562
|
src: youtubeSrc,
|
|
558
563
|
width: "100%",
|
|
559
564
|
height: "100%",
|
|
560
|
-
allowFullScreen: true,
|
|
561
565
|
allow
|
|
562
566
|
});
|
|
563
567
|
}
|
|
564
568
|
|
|
565
|
-
// src/elements/
|
|
569
|
+
// src/elements/video/index.tsx
|
|
566
570
|
var Video = forwardRef7((props, ref) => {
|
|
567
571
|
let { isDesignMode } = useContext3(WeaverseContext);
|
|
568
572
|
let {
|
|
@@ -624,32 +628,35 @@ Video.defaultProps = {
|
|
|
624
628
|
autoPlay: true,
|
|
625
629
|
muted: true
|
|
626
630
|
};
|
|
627
|
-
var
|
|
631
|
+
var video_default = Video;
|
|
628
632
|
|
|
629
|
-
// src/elements/
|
|
633
|
+
// src/elements/slideshow/index.tsx
|
|
630
634
|
import { css as stitchesCss } from "@stitches/react";
|
|
631
635
|
import clsx5 from "clsx";
|
|
632
636
|
import React20, { forwardRef as forwardRef8 } from "react";
|
|
633
637
|
|
|
634
|
-
// src/components/
|
|
638
|
+
// src/components/slider/arrows.tsx
|
|
635
639
|
import { styled } from "@stitches/react";
|
|
636
640
|
import clsx2 from "clsx";
|
|
637
641
|
import React17 from "react";
|
|
638
642
|
|
|
639
|
-
// src/components/
|
|
643
|
+
// src/components/icons/index.tsx
|
|
640
644
|
import React16 from "react";
|
|
641
645
|
|
|
642
|
-
// src/components/
|
|
643
|
-
var
|
|
644
|
-
__export(
|
|
646
|
+
// src/components/icons/phosphor.tsx
|
|
647
|
+
var phosphor_exports = {};
|
|
648
|
+
__export(phosphor_exports, {
|
|
645
649
|
ArrowLeft: () => ArrowLeft,
|
|
646
650
|
ArrowRight: () => ArrowRight,
|
|
651
|
+
Backpack: () => Backpack,
|
|
647
652
|
CircleNotch: () => CircleNotch,
|
|
648
653
|
Eye: () => Eye,
|
|
649
654
|
Image: () => Image2,
|
|
650
655
|
Minus: () => Minus,
|
|
656
|
+
Package: () => Package,
|
|
651
657
|
Plus: () => Plus,
|
|
652
658
|
ShoppingCart: () => ShoppingCart,
|
|
659
|
+
Storefront: () => Storefront,
|
|
653
660
|
X: () => X
|
|
654
661
|
});
|
|
655
662
|
import React15 from "react";
|
|
@@ -851,6 +858,165 @@ var ShoppingCart = (props) => {
|
|
|
851
858
|
strokeWidth: "16"
|
|
852
859
|
}));
|
|
853
860
|
};
|
|
861
|
+
var Storefront = (props) => {
|
|
862
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
863
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
864
|
+
width: "192",
|
|
865
|
+
height: "192",
|
|
866
|
+
fill: "currentColor",
|
|
867
|
+
viewBox: "0 0 256 256",
|
|
868
|
+
...props
|
|
869
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
870
|
+
width: "256",
|
|
871
|
+
height: "256",
|
|
872
|
+
fill: "none"
|
|
873
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
874
|
+
d: "M48,139.6V208a8,8,0,0,0,8,8H200a8,8,0,0,0,8-8V139.6",
|
|
875
|
+
fill: "none",
|
|
876
|
+
stroke: "currentColor",
|
|
877
|
+
strokeLinecap: "round",
|
|
878
|
+
strokeLinejoin: "round",
|
|
879
|
+
strokeWidth: "12"
|
|
880
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
881
|
+
d: "M54,40H202a8.1,8.1,0,0,1,7.7,5.8L224,96H32L46.3,45.8A8.1,8.1,0,0,1,54,40Z",
|
|
882
|
+
fill: "none",
|
|
883
|
+
stroke: "currentColor",
|
|
884
|
+
strokeLinecap: "round",
|
|
885
|
+
strokeLinejoin: "round",
|
|
886
|
+
strokeWidth: "12"
|
|
887
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
888
|
+
d: "M96,96v16a32,32,0,0,1-64,0V96",
|
|
889
|
+
fill: "none",
|
|
890
|
+
stroke: "currentColor",
|
|
891
|
+
strokeLinecap: "round",
|
|
892
|
+
strokeLinejoin: "round",
|
|
893
|
+
strokeWidth: "12"
|
|
894
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
895
|
+
d: "M160,96v16a32,32,0,0,1-64,0V96",
|
|
896
|
+
fill: "none",
|
|
897
|
+
stroke: "currentColor",
|
|
898
|
+
strokeLinecap: "round",
|
|
899
|
+
strokeLinejoin: "round",
|
|
900
|
+
strokeWidth: "12"
|
|
901
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
902
|
+
d: "M224,96v16a32,32,0,0,1-64,0V96",
|
|
903
|
+
fill: "none",
|
|
904
|
+
stroke: "currentColor",
|
|
905
|
+
strokeLinecap: "round",
|
|
906
|
+
strokeLinejoin: "round",
|
|
907
|
+
strokeWidth: "12"
|
|
908
|
+
}));
|
|
909
|
+
};
|
|
910
|
+
var Package = (props) => {
|
|
911
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
912
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
913
|
+
width: "192",
|
|
914
|
+
height: "192",
|
|
915
|
+
fill: "currentColor",
|
|
916
|
+
viewBox: "0 0 256 256",
|
|
917
|
+
...props
|
|
918
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
919
|
+
width: "256",
|
|
920
|
+
height: "256",
|
|
921
|
+
fill: "none"
|
|
922
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
923
|
+
d: "M224,177.3V78.7a8.1,8.1,0,0,0-4.1-7l-88-49.5a7.8,7.8,0,0,0-7.8,0l-88,49.5a8.1,8.1,0,0,0-4.1,7v98.6a8.1,8.1,0,0,0,4.1,7l88,49.5a7.8,7.8,0,0,0,7.8,0l88-49.5A8.1,8.1,0,0,0,224,177.3Z",
|
|
924
|
+
fill: "none",
|
|
925
|
+
stroke: "currentColor",
|
|
926
|
+
strokeLinecap: "round",
|
|
927
|
+
strokeLinejoin: "round",
|
|
928
|
+
strokeWidth: "8"
|
|
929
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
930
|
+
points: "177 152.5 177 100.5 80 47",
|
|
931
|
+
fill: "none",
|
|
932
|
+
stroke: "currentColor",
|
|
933
|
+
strokeLinecap: "round",
|
|
934
|
+
strokeLinejoin: "round",
|
|
935
|
+
strokeWidth: "8"
|
|
936
|
+
}), /* @__PURE__ */ React15.createElement("polyline", {
|
|
937
|
+
points: "222.9 74.6 128.9 128 33.1 74.6",
|
|
938
|
+
fill: "none",
|
|
939
|
+
stroke: "currentColor",
|
|
940
|
+
strokeLinecap: "round",
|
|
941
|
+
strokeLinejoin: "round",
|
|
942
|
+
strokeWidth: "8"
|
|
943
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
944
|
+
x1: "128.9",
|
|
945
|
+
y1: "128",
|
|
946
|
+
x2: "128",
|
|
947
|
+
y2: "234.8",
|
|
948
|
+
fill: "none",
|
|
949
|
+
stroke: "currentColor",
|
|
950
|
+
strokeLinecap: "round",
|
|
951
|
+
strokeLinejoin: "round",
|
|
952
|
+
strokeWidth: "8"
|
|
953
|
+
}));
|
|
954
|
+
};
|
|
955
|
+
var Backpack = (props) => {
|
|
956
|
+
return /* @__PURE__ */ React15.createElement("svg", {
|
|
957
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
958
|
+
width: "192",
|
|
959
|
+
height: "192",
|
|
960
|
+
fill: "currentColor",
|
|
961
|
+
viewBox: "0 0 256 256",
|
|
962
|
+
...props
|
|
963
|
+
}, /* @__PURE__ */ React15.createElement("rect", {
|
|
964
|
+
width: "256",
|
|
965
|
+
height: "256",
|
|
966
|
+
fill: "none"
|
|
967
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
968
|
+
d: "M96,48h64a48,48,0,0,1,48,48V216a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V96A48,48,0,0,1,96,48Z",
|
|
969
|
+
fill: "none",
|
|
970
|
+
stroke: "currentColor",
|
|
971
|
+
strokeLinecap: "round",
|
|
972
|
+
strokeLinejoin: "round",
|
|
973
|
+
strokeWidth: "12"
|
|
974
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
975
|
+
d: "M80,224V152a16,16,0,0,1,16-16h64a16,16,0,0,1,16,16v72",
|
|
976
|
+
fill: "none",
|
|
977
|
+
stroke: "currentColor",
|
|
978
|
+
strokeLinecap: "round",
|
|
979
|
+
strokeLinejoin: "round",
|
|
980
|
+
strokeWidth: "12"
|
|
981
|
+
}), /* @__PURE__ */ React15.createElement("path", {
|
|
982
|
+
d: "M96,48V32a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V48",
|
|
983
|
+
fill: "none",
|
|
984
|
+
stroke: "currentColor",
|
|
985
|
+
strokeLinecap: "round",
|
|
986
|
+
strokeLinejoin: "round",
|
|
987
|
+
strokeWidth: "12"
|
|
988
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
989
|
+
x1: "112",
|
|
990
|
+
y1: "88",
|
|
991
|
+
x2: "144",
|
|
992
|
+
y2: "88",
|
|
993
|
+
fill: "none",
|
|
994
|
+
stroke: "currentColor",
|
|
995
|
+
strokeLinecap: "round",
|
|
996
|
+
strokeLinejoin: "round",
|
|
997
|
+
strokeWidth: "12"
|
|
998
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
999
|
+
x1: "80",
|
|
1000
|
+
y1: "168",
|
|
1001
|
+
x2: "176",
|
|
1002
|
+
y2: "168",
|
|
1003
|
+
fill: "none",
|
|
1004
|
+
stroke: "currentColor",
|
|
1005
|
+
strokeLinecap: "round",
|
|
1006
|
+
strokeLinejoin: "round",
|
|
1007
|
+
strokeWidth: "12"
|
|
1008
|
+
}), /* @__PURE__ */ React15.createElement("line", {
|
|
1009
|
+
x1: "144",
|
|
1010
|
+
y1: "168",
|
|
1011
|
+
x2: "144",
|
|
1012
|
+
y2: "184",
|
|
1013
|
+
fill: "none",
|
|
1014
|
+
stroke: "currentColor",
|
|
1015
|
+
strokeLinecap: "round",
|
|
1016
|
+
strokeLinejoin: "round",
|
|
1017
|
+
strokeWidth: "12"
|
|
1018
|
+
}));
|
|
1019
|
+
};
|
|
854
1020
|
var Eye = (props) => {
|
|
855
1021
|
return /* @__PURE__ */ React15.createElement("svg", {
|
|
856
1022
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -882,10 +1048,10 @@ var Eye = (props) => {
|
|
|
882
1048
|
}));
|
|
883
1049
|
};
|
|
884
1050
|
|
|
885
|
-
// src/components/
|
|
1051
|
+
// src/components/icons/index.tsx
|
|
886
1052
|
import clsx from "clsx";
|
|
887
1053
|
function Icon({ name, className, ...props }) {
|
|
888
|
-
let WeaverseIcon =
|
|
1054
|
+
let WeaverseIcon = phosphor_exports[name];
|
|
889
1055
|
let cls = clsx("wv-icon", className);
|
|
890
1056
|
return /* @__PURE__ */ React16.createElement(WeaverseIcon, {
|
|
891
1057
|
className: cls,
|
|
@@ -893,7 +1059,7 @@ function Icon({ name, className, ...props }) {
|
|
|
893
1059
|
});
|
|
894
1060
|
}
|
|
895
1061
|
|
|
896
|
-
// src/components/
|
|
1062
|
+
// src/components/slider/arrows.tsx
|
|
897
1063
|
function Arrows(props) {
|
|
898
1064
|
let { currentSlide, instanceRef, className, offset } = props;
|
|
899
1065
|
let isFirst = currentSlide === 0;
|
|
@@ -968,7 +1134,7 @@ var StyledArrows = styled("div", {
|
|
|
968
1134
|
}
|
|
969
1135
|
});
|
|
970
1136
|
|
|
971
|
-
// src/components/
|
|
1137
|
+
// src/components/slider/dots.tsx
|
|
972
1138
|
import { styled as styled2 } from "@stitches/react";
|
|
973
1139
|
import clsx3 from "clsx";
|
|
974
1140
|
import React18 from "react";
|
|
@@ -1039,11 +1205,11 @@ var StyledDots = styled2("div", {
|
|
|
1039
1205
|
}
|
|
1040
1206
|
});
|
|
1041
1207
|
|
|
1042
|
-
// src/elements/
|
|
1208
|
+
// src/elements/slideshow/use-slideshow-configs.ts
|
|
1043
1209
|
import { useKeenSlider } from "keen-slider/react";
|
|
1044
1210
|
import React19, { useContext as useContext4, useEffect as useEffect2, useState } from "react";
|
|
1045
1211
|
|
|
1046
|
-
// src/components/
|
|
1212
|
+
// src/components/slider/autoplay-plugin.ts
|
|
1047
1213
|
function AutoplayPlugin(changeSlidesEvery) {
|
|
1048
1214
|
return (slider) => {
|
|
1049
1215
|
let timeout;
|
|
@@ -1076,7 +1242,7 @@ function AutoplayPlugin(changeSlidesEvery) {
|
|
|
1076
1242
|
};
|
|
1077
1243
|
}
|
|
1078
1244
|
|
|
1079
|
-
// src/components/
|
|
1245
|
+
// src/components/slider/resize-plugin.ts
|
|
1080
1246
|
var ResizePlugin = (slider) => {
|
|
1081
1247
|
let observer = new ResizeObserver(() => slider.update());
|
|
1082
1248
|
slider.on("created", () => {
|
|
@@ -1135,7 +1301,7 @@ function loadCSS(attrs) {
|
|
|
1135
1301
|
});
|
|
1136
1302
|
}
|
|
1137
1303
|
|
|
1138
|
-
// src/elements/
|
|
1304
|
+
// src/elements/slideshow/use-slideshow-configs.ts
|
|
1139
1305
|
function useSlideshowConfigs(props) {
|
|
1140
1306
|
let {
|
|
1141
1307
|
animation,
|
|
@@ -1208,7 +1374,7 @@ function useSlideshowConfigs(props) {
|
|
|
1208
1374
|
};
|
|
1209
1375
|
}
|
|
1210
1376
|
|
|
1211
|
-
// src/elements/
|
|
1377
|
+
// src/elements/slideshow/index.tsx
|
|
1212
1378
|
var Slideshow = forwardRef8((props, ref) => {
|
|
1213
1379
|
let {
|
|
1214
1380
|
animation,
|
|
@@ -1289,12 +1455,12 @@ Slideshow.defaultProps = {
|
|
|
1289
1455
|
autoRotate: false,
|
|
1290
1456
|
changeSlidesEvery: 5
|
|
1291
1457
|
};
|
|
1292
|
-
var
|
|
1458
|
+
var slideshow_default = Slideshow;
|
|
1293
1459
|
|
|
1294
|
-
// src/elements/
|
|
1460
|
+
// src/elements/slideshow/slide.tsx
|
|
1295
1461
|
import React24, { forwardRef as forwardRef10 } from "react";
|
|
1296
1462
|
|
|
1297
|
-
// src/components/
|
|
1463
|
+
// src/components/background.tsx
|
|
1298
1464
|
import { styled as styled3 } from "@stitches/react";
|
|
1299
1465
|
import React21 from "react";
|
|
1300
1466
|
function Background2(props) {
|
|
@@ -1334,7 +1500,7 @@ var StyledBackground = styled3("div", {
|
|
|
1334
1500
|
}
|
|
1335
1501
|
});
|
|
1336
1502
|
|
|
1337
|
-
// src/components/
|
|
1503
|
+
// src/components/overlay.tsx
|
|
1338
1504
|
import { styled as styled4 } from "@stitches/react";
|
|
1339
1505
|
import React22 from "react";
|
|
1340
1506
|
function Overlay2(props) {
|
|
@@ -1354,7 +1520,7 @@ var StyledOverlay = styled4("div", {
|
|
|
1354
1520
|
backgroundColor: "rgba(0, 0, 0, var(--overlay-opacity, .3))"
|
|
1355
1521
|
});
|
|
1356
1522
|
|
|
1357
|
-
// src/components/
|
|
1523
|
+
// src/components/placeholder.tsx
|
|
1358
1524
|
import React23, { forwardRef as forwardRef9 } from "react";
|
|
1359
1525
|
var Placeholder = forwardRef9(
|
|
1360
1526
|
(props, ref) => {
|
|
@@ -1369,9 +1535,9 @@ var Placeholder = forwardRef9(
|
|
|
1369
1535
|
}, element), /* @__PURE__ */ React23.createElement("div", null, children));
|
|
1370
1536
|
}
|
|
1371
1537
|
);
|
|
1372
|
-
var
|
|
1538
|
+
var placeholder_default = Placeholder;
|
|
1373
1539
|
|
|
1374
|
-
// src/elements/
|
|
1540
|
+
// src/elements/slideshow/position.ts
|
|
1375
1541
|
var slidePositionMap = {
|
|
1376
1542
|
"top left": {
|
|
1377
1543
|
justifyContent: "flex-start",
|
|
@@ -1411,7 +1577,7 @@ var slidePositionMap = {
|
|
|
1411
1577
|
}
|
|
1412
1578
|
};
|
|
1413
1579
|
|
|
1414
|
-
// src/elements/
|
|
1580
|
+
// src/elements/slideshow/slide.tsx
|
|
1415
1581
|
var Slide = forwardRef10((props, ref) => {
|
|
1416
1582
|
let {
|
|
1417
1583
|
contentPosition,
|
|
@@ -1440,7 +1606,7 @@ var Slide = forwardRef10((props, ref) => {
|
|
|
1440
1606
|
ref,
|
|
1441
1607
|
style: slidePositionMap[contentPosition],
|
|
1442
1608
|
...rest
|
|
1443
|
-
}, children?.length ? children : /* @__PURE__ */ React24.createElement(
|
|
1609
|
+
}, children?.length ? children : /* @__PURE__ */ React24.createElement(placeholder_default, {
|
|
1444
1610
|
element: "Slide",
|
|
1445
1611
|
className: "wv-slide-placeholder"
|
|
1446
1612
|
}, "Drag and drop elements here")));
|
|
@@ -1468,57 +1634,57 @@ Slide.defaultProps = {
|
|
|
1468
1634
|
enableOverlay: false,
|
|
1469
1635
|
overlayOpacity: 30
|
|
1470
1636
|
};
|
|
1471
|
-
var
|
|
1637
|
+
var slide_default = Slide;
|
|
1472
1638
|
|
|
1473
1639
|
// src/elements/index.ts
|
|
1474
1640
|
var Elements = {
|
|
1475
1641
|
Countdown: {
|
|
1476
|
-
Component:
|
|
1642
|
+
Component: countdown_default,
|
|
1477
1643
|
type: "countdown",
|
|
1478
1644
|
defaultCss: css3
|
|
1479
1645
|
},
|
|
1480
1646
|
Button: {
|
|
1481
|
-
Component:
|
|
1647
|
+
Component: button_default,
|
|
1482
1648
|
type: "button",
|
|
1483
1649
|
defaultCss: css
|
|
1484
1650
|
},
|
|
1485
1651
|
Container: {
|
|
1486
|
-
Component:
|
|
1652
|
+
Component: container_default,
|
|
1487
1653
|
type: "container",
|
|
1488
1654
|
defaultCss: css2
|
|
1489
1655
|
},
|
|
1490
1656
|
Image: {
|
|
1491
|
-
Component:
|
|
1657
|
+
Component: image_default,
|
|
1492
1658
|
type: "image",
|
|
1493
1659
|
defaultCss: css4
|
|
1494
1660
|
},
|
|
1495
1661
|
Layout: {
|
|
1496
|
-
Component:
|
|
1662
|
+
Component: layout_default,
|
|
1497
1663
|
type: "layout",
|
|
1498
1664
|
defaultCss: css5
|
|
1499
1665
|
},
|
|
1500
1666
|
Map: {
|
|
1501
|
-
Component:
|
|
1667
|
+
Component: map_default,
|
|
1502
1668
|
type: "map",
|
|
1503
1669
|
defaultCss: css6
|
|
1504
1670
|
},
|
|
1505
1671
|
Text: {
|
|
1506
|
-
Component:
|
|
1672
|
+
Component: text_default,
|
|
1507
1673
|
type: "text",
|
|
1508
1674
|
defaultCss: css7
|
|
1509
1675
|
},
|
|
1510
1676
|
Video: {
|
|
1511
|
-
Component:
|
|
1677
|
+
Component: video_default,
|
|
1512
1678
|
type: "video",
|
|
1513
1679
|
defaultCss: css8
|
|
1514
1680
|
},
|
|
1515
1681
|
Slideshow: {
|
|
1516
|
-
Component:
|
|
1682
|
+
Component: slideshow_default,
|
|
1517
1683
|
type: "slideshow",
|
|
1518
1684
|
defaultCss: css9
|
|
1519
1685
|
},
|
|
1520
1686
|
Slide: {
|
|
1521
|
-
Component:
|
|
1687
|
+
Component: slide_default,
|
|
1522
1688
|
type: "slide",
|
|
1523
1689
|
defaultCss: css10
|
|
1524
1690
|
}
|
|
@@ -1536,9 +1702,9 @@ var WeaverseContext = createContext({});
|
|
|
1536
1702
|
var WeaverseContextProvider = WeaverseContext.Provider;
|
|
1537
1703
|
var WeaverseContextConsumer = WeaverseContext.Consumer;
|
|
1538
1704
|
|
|
1539
|
-
// src/components/
|
|
1540
|
-
var
|
|
1541
|
-
__export(
|
|
1705
|
+
// src/components/modal/index.tsx
|
|
1706
|
+
var modal_exports = {};
|
|
1707
|
+
__export(modal_exports, {
|
|
1542
1708
|
Modal: () => Modal,
|
|
1543
1709
|
ModalClose: () => ModalClose,
|
|
1544
1710
|
ModalContent: () => ModalContent,
|
|
@@ -1548,7 +1714,7 @@ __export(Modal_exports, {
|
|
|
1548
1714
|
import { Close, Portal, Root, Trigger } from "@radix-ui/react-dialog";
|
|
1549
1715
|
import React25, { forwardRef as forwardRef11 } from "react";
|
|
1550
1716
|
|
|
1551
|
-
// src/components/
|
|
1717
|
+
// src/components/modal/styled.ts
|
|
1552
1718
|
import { Content, Overlay as Overlay3, Title } from "@radix-ui/react-dialog";
|
|
1553
1719
|
import { keyframes, styled as styled5 } from "@stitches/react";
|
|
1554
1720
|
var overlayShow = keyframes({
|
|
@@ -1631,7 +1797,7 @@ var StyledCloseIcon = styled5("button", {
|
|
|
1631
1797
|
}
|
|
1632
1798
|
});
|
|
1633
1799
|
|
|
1634
|
-
// src/components/
|
|
1800
|
+
// src/components/modal/use-open-change-effect.ts
|
|
1635
1801
|
import { useContext as useContext5, useEffect as useEffect3 } from "react";
|
|
1636
1802
|
function useOpenChangeEffect(props) {
|
|
1637
1803
|
let { open, defaultOpen, onOpenChange } = props;
|
|
@@ -1657,7 +1823,7 @@ function useOpenChangeEffect(props) {
|
|
|
1657
1823
|
return handleOpenChange;
|
|
1658
1824
|
}
|
|
1659
1825
|
|
|
1660
|
-
// src/components/
|
|
1826
|
+
// src/components/modal/index.tsx
|
|
1661
1827
|
var Modal = (props) => {
|
|
1662
1828
|
let { children, open, defaultOpen, onOpenChange, ...rest } = props;
|
|
1663
1829
|
let handleOpenChange = useOpenChangeEffect(props);
|
|
@@ -1715,7 +1881,7 @@ var ModalClose = forwardRef11(
|
|
|
1715
1881
|
}
|
|
1716
1882
|
);
|
|
1717
1883
|
|
|
1718
|
-
// src/components/
|
|
1884
|
+
// src/components/spinner.tsx
|
|
1719
1885
|
import React26 from "react";
|
|
1720
1886
|
function Spinner() {
|
|
1721
1887
|
return /* @__PURE__ */ React26.createElement("span", {
|
|
@@ -1726,7 +1892,7 @@ function Spinner() {
|
|
|
1726
1892
|
}));
|
|
1727
1893
|
}
|
|
1728
1894
|
|
|
1729
|
-
// src/components/
|
|
1895
|
+
// src/components/tooltip.tsx
|
|
1730
1896
|
import React27 from "react";
|
|
1731
1897
|
function Tooltip({ children }) {
|
|
1732
1898
|
return /* @__PURE__ */ React27.createElement("span", {
|
|
@@ -1734,17 +1900,17 @@ function Tooltip({ children }) {
|
|
|
1734
1900
|
}, children);
|
|
1735
1901
|
}
|
|
1736
1902
|
|
|
1737
|
-
// src/components/
|
|
1903
|
+
// src/components/slider/index.tsx
|
|
1738
1904
|
import clsx6 from "clsx";
|
|
1739
1905
|
import { useKeenSlider as useKeenSlider2 } from "keen-slider/react";
|
|
1740
1906
|
import React28, { useState as useState2 } from "react";
|
|
1741
1907
|
function Slider(props) {
|
|
1742
|
-
let { children, className, gap, arrowOffset } = props;
|
|
1908
|
+
let { children, className, gap, slidesPerView, arrowOffset } = props;
|
|
1743
1909
|
let [currentSlide, setCurrentSlide] = useState2(0);
|
|
1744
1910
|
let [created, setCreated] = useState2(false);
|
|
1745
1911
|
let [ref, instanceRef] = useKeenSlider2(
|
|
1746
1912
|
{
|
|
1747
|
-
slides: { perView:
|
|
1913
|
+
slides: { perView: slidesPerView, spacing: gap },
|
|
1748
1914
|
breakpoints: {
|
|
1749
1915
|
"(max-width: 1024px)": {
|
|
1750
1916
|
slides: { perView: 3, spacing: gap }
|
|
@@ -1785,9 +1951,9 @@ function Slider(props) {
|
|
|
1785
1951
|
var Components = {
|
|
1786
1952
|
Background: Background2,
|
|
1787
1953
|
Icon,
|
|
1788
|
-
ModalComponents:
|
|
1954
|
+
ModalComponents: modal_exports,
|
|
1789
1955
|
Overlay: Overlay2,
|
|
1790
|
-
Placeholder:
|
|
1956
|
+
Placeholder: placeholder_default,
|
|
1791
1957
|
Spinner,
|
|
1792
1958
|
Slider,
|
|
1793
1959
|
Tooltip
|
|
@@ -1801,12 +1967,12 @@ var SliderComponents = {
|
|
|
1801
1967
|
|
|
1802
1968
|
// src/renderer.tsx
|
|
1803
1969
|
import { isBrowser } from "@weaverse/core";
|
|
1804
|
-
import React29, { useContext as useContext6, useEffect as
|
|
1970
|
+
import React29, { useContext as useContext6, useEffect as useEffect4, useRef, useState as useState3 } from "react";
|
|
1805
1971
|
var WeaverseRoot = ({ context }) => {
|
|
1806
1972
|
let [, setData] = useState3(context.projectData);
|
|
1807
1973
|
let rootRef = useRef();
|
|
1808
1974
|
let renderRoot = () => setData({});
|
|
1809
|
-
|
|
1975
|
+
useEffect4(() => {
|
|
1810
1976
|
context.subscribe(renderRoot);
|
|
1811
1977
|
context.contentRootElement = rootRef.current;
|
|
1812
1978
|
return () => {
|
|
@@ -1832,7 +1998,7 @@ var ItemComponent = ({ instance }) => {
|
|
|
1832
1998
|
let { stitchesInstance, elementInstances } = useContext6(WeaverseContext);
|
|
1833
1999
|
let [data, setData] = useState3(instance.data);
|
|
1834
2000
|
let { id, type, childIds = [], css: css11, className, ...rest } = data;
|
|
1835
|
-
|
|
2001
|
+
useEffect4(() => {
|
|
1836
2002
|
let render = (data2) => setData({ ...data2 });
|
|
1837
2003
|
instance.subscribe(render);
|
|
1838
2004
|
if (isBrowser && !instance.ref.current) {
|