@weaverse/react 0.7.30 → 0.7.32

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 CHANGED
@@ -49,10 +49,10 @@ interface WeaverseElementProps extends ReactElement {
49
49
  ['data-wv-id']: string;
50
50
  children?: ReactElement | ReactElement[] | ReactNode | ReactNode[];
51
51
  }
52
- declare type WeaverseRootPropsType = {
52
+ type WeaverseRootPropsType = {
53
53
  context: Weaverse;
54
54
  };
55
- declare type ItemComponentProps = {
55
+ type ItemComponentProps = {
56
56
  instance: InstanceType<typeof WeaverseItemStore>;
57
57
  };
58
58
  interface PlaceholderProps {
@@ -90,8 +90,13 @@ interface BackgroundDataProps {
90
90
  backgroundImage?: string;
91
91
  objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
92
92
  }
93
- interface LayoutElementProps extends BackgroundDataProps, GridContentElementProps {
93
+ interface LayoutElementProps extends BackgroundDataProps, WeaverseElementProps {
94
+ contentSize: number;
94
95
  gridSize: number;
96
+ rows: number;
97
+ columns: number;
98
+ gap: number;
99
+ rowSize: number;
95
100
  }
96
101
  interface LayoutBackgroundProps {
97
102
  imgUrl?: string;
@@ -114,15 +119,15 @@ interface VideoCommonProps {
114
119
  autoPlay: boolean;
115
120
  muted: boolean;
116
121
  }
117
- declare type VideoElementProps = VideoCommonProps & WeaverseElementProps;
122
+ type VideoElementProps = VideoCommonProps & WeaverseElementProps;
118
123
  interface YoutubeElementProps extends VideoCommonProps {
119
124
  youtubeId: string;
120
125
  }
121
126
  interface VimeoElementProps extends VideoCommonProps {
122
127
  vimeoId: string;
123
128
  }
124
- declare type CountdownTimeKey = 'days' | 'hours' | 'minutes' | 'seconds';
125
- declare type CountdownTimerType = 'fixed-time' | 'evergreen';
129
+ type CountdownTimeKey = 'days' | 'hours' | 'minutes' | 'seconds';
130
+ type CountdownTimerType = 'fixed-time' | 'evergreen';
126
131
  interface CountdownElementProps extends WeaverseElementProps {
127
132
  timerType: CountdownTimerType;
128
133
  startTime: number;
@@ -133,7 +138,7 @@ interface CountdownElementProps extends WeaverseElementProps {
133
138
  showLabel: boolean;
134
139
  showColon: boolean;
135
140
  }
136
- declare type TimerBlockProps = {
141
+ type TimerBlockProps = {
137
142
  label: string;
138
143
  value: string | number;
139
144
  };
@@ -144,7 +149,7 @@ interface InstagramElementProps extends WeaverseElementProps {
144
149
  imagesPerRow: number;
145
150
  gap: number;
146
151
  }
147
- declare type InstagramMedia = {
152
+ type InstagramMedia = {
148
153
  id: string;
149
154
  media_type: 'IMAGE' | 'CAROUSEL_ALBUM';
150
155
  media_url: string;
package/dist/index.js CHANGED
@@ -64,20 +64,26 @@ var Button = React.forwardRef((props, ref) => {
64
64
  });
65
65
  Button.defaultProps = {
66
66
  type: "button",
67
- text: "Shop now",
67
+ text: "Button",
68
68
  clickAction: "none",
69
69
  linkTo: "",
70
70
  openInNewTab: false
71
71
  };
72
72
  var css = {
73
73
  "@desktop": {
74
- borderRadius: "72px",
74
+ borderRadius: "8px",
75
75
  border: "none",
76
- backgroundColor: "#0F71FF",
76
+ backgroundColor: "#393e46",
77
77
  color: "#fff",
78
- fontSize: "13px",
78
+ fontSize: "14px",
79
+ fontWeight: "medium",
79
80
  padding: "10px 20px",
80
- textDecoration: "none"
81
+ height: "42px",
82
+ minWidth: "120px",
83
+ textDecoration: "none",
84
+ ":hover": {
85
+ backgroundColor: "#222831"
86
+ }
81
87
  }
82
88
  };
83
89
  var Button_default = Button;
@@ -340,6 +346,8 @@ var Image = import_react5.default.forwardRef(
340
346
  );
341
347
  var css4 = {
342
348
  "@desktop": {
349
+ display: "flex",
350
+ overflow: "hidden",
343
351
  img: {
344
352
  width: "100%",
345
353
  height: "100%",
@@ -371,6 +379,7 @@ var Layout = (0, import_react6.forwardRef)((props, ref) => {
371
379
  gap,
372
380
  rowSize,
373
381
  columns,
382
+ contentSize,
374
383
  gridSize,
375
384
  backgroundColor,
376
385
  backgroundImage,
@@ -378,6 +387,8 @@ var Layout = (0, import_react6.forwardRef)((props, ref) => {
378
387
  ...rest
379
388
  } = props;
380
389
  let style = {
390
+ "--layout-content-width": "100vw",
391
+ "--content-size": contentSize + "px",
381
392
  "--grid-size": gridSize + "px",
382
393
  "--rows": rows,
383
394
  "--columns": columns,
@@ -385,7 +396,7 @@ var Layout = (0, import_react6.forwardRef)((props, ref) => {
385
396
  "--row-size": rowSize + "px",
386
397
  "--col-size": "calc((var(--grid-size) - calc(var(--columns) - 1) * var(--gap)) / var(--columns))"
387
398
  };
388
- return /* @__PURE__ */ import_react6.default.createElement("section", {
399
+ return /* @__PURE__ */ import_react6.default.createElement("div", {
389
400
  ref,
390
401
  ...rest,
391
402
  style
@@ -403,42 +414,44 @@ var LayoutBackground = (props) => {
403
414
  ["--bg-color"]: bgColor,
404
415
  ["--object-fit"]: objectFit
405
416
  };
406
- return imgUrl || bgColor ? /* @__PURE__ */ import_react6.default.createElement("div", {
407
- "data-wv-bg": true,
408
- style
409
- }, imgUrl && /* @__PURE__ */ import_react6.default.createElement("img", {
410
- width: "100%",
411
- height: "100%",
412
- "data-blink-src": imgUrl,
413
- alt: "wv-layout-background"
414
- })) : null;
417
+ if (imgUrl || bgColor) {
418
+ return /* @__PURE__ */ import_react6.default.createElement("div", {
419
+ style,
420
+ className: "wv-layout-background"
421
+ }, imgUrl && /* @__PURE__ */ import_react6.default.createElement("img", {
422
+ width: "100%",
423
+ height: "100%",
424
+ "data-blink-src": imgUrl,
425
+ alt: "Section background"
426
+ }));
427
+ }
428
+ return null;
415
429
  };
416
430
  var css5 = {
417
431
  "@desktop": {
418
- paddingTop: "16px",
419
- paddingBottom: "16px",
420
- paddingLeft: "var(--gap)",
421
- paddingRight: "var(--gap)",
422
432
  "> [data-layout-content]": {
433
+ paddingTop: "var(--gap)",
434
+ paddingBottom: "var(--gap)",
423
435
  margin: "0 auto",
424
- display: "grid !important",
436
+ display: "grid",
425
437
  gridTemplateRows: "repeat(var(--rows), var(--row-size))",
426
- gridTemplateColumns: "repeat(var(--columns), minmax(0, var(--col-size)))",
438
+ gridTemplateColumns: "calc((var(--layout-content-width) - var(--content-size)) / 2) 1fr repeat(var(--columns), minmax(0, var(--col-size))) 1fr calc((var(--layout-content-width) - var(--content-size)) / 2)",
439
+ gridAutoRows: "var(--row-size)",
427
440
  gap: "var(--gap)",
428
- maxWidth: "var(--grid-size)"
441
+ maxWidth: "var(--layout-content-width)"
429
442
  }
430
443
  },
431
444
  "@mobile": {
432
445
  padding: "0 16px",
433
446
  "> [data-layout-content]": {
434
- display: "flex !important",
447
+ display: "flex",
435
448
  flexDirection: "column"
436
449
  }
437
450
  }
438
451
  };
439
452
  var permanentCss = {
440
453
  "@desktop": {
441
- "[data-wv-bg]": {
454
+ ".wv-layout-background": {
442
455
  position: "absolute",
443
456
  inset: 0,
444
457
  backgroundColor: "var(--bg-color)"
@@ -449,8 +462,9 @@ var permanentCss = {
449
462
  }
450
463
  };
451
464
  Layout.defaultProps = {
465
+ contentSize: 1600,
452
466
  gridSize: 1224,
453
- rows: 12,
467
+ rows: 16,
454
468
  columns: 12,
455
469
  gap: 16,
456
470
  rowSize: 48
@@ -466,7 +480,6 @@ var Map = (0, import_react7.forwardRef)((props, ref) => {
466
480
  ...rest
467
481
  }, /* @__PURE__ */ import_react7.default.createElement("iframe", {
468
482
  loading: "lazy",
469
- scrolling: "no",
470
483
  width: "100%",
471
484
  height: "100%",
472
485
  title: "map",
@@ -474,7 +487,18 @@ var Map = (0, import_react7.forwardRef)((props, ref) => {
474
487
  style: { pointerEvents: "none" }
475
488
  }));
476
489
  });
477
- var css6 = {};
490
+ var css6 = {
491
+ "@desktop": {
492
+ iframe: {
493
+ border: "none"
494
+ }
495
+ },
496
+ "@mobile": {
497
+ iframe: {
498
+ border: "none"
499
+ }
500
+ }
501
+ };
478
502
  Map.defaultProps = {
479
503
  place: "Hanoi",
480
504
  zoom: 14
@@ -607,6 +631,14 @@ var css8 = {
607
631
  height: "100%",
608
632
  width: "100%",
609
633
  aspectRatio: "16 / 9"
634
+ },
635
+ iframe: {
636
+ border: "none"
637
+ }
638
+ },
639
+ "@mobile": {
640
+ iframe: {
641
+ border: "none"
610
642
  }
611
643
  }
612
644
  };
package/dist/index.mjs CHANGED
@@ -33,20 +33,26 @@ var Button = React.forwardRef((props, ref) => {
33
33
  });
34
34
  Button.defaultProps = {
35
35
  type: "button",
36
- text: "Shop now",
36
+ text: "Button",
37
37
  clickAction: "none",
38
38
  linkTo: "",
39
39
  openInNewTab: false
40
40
  };
41
41
  var css = {
42
42
  "@desktop": {
43
- borderRadius: "72px",
43
+ borderRadius: "8px",
44
44
  border: "none",
45
- backgroundColor: "#0F71FF",
45
+ backgroundColor: "#393e46",
46
46
  color: "#fff",
47
- fontSize: "13px",
47
+ fontSize: "14px",
48
+ fontWeight: "medium",
48
49
  padding: "10px 20px",
49
- textDecoration: "none"
50
+ height: "42px",
51
+ minWidth: "120px",
52
+ textDecoration: "none",
53
+ ":hover": {
54
+ backgroundColor: "#222831"
55
+ }
50
56
  }
51
57
  };
52
58
  var Button_default = Button;
@@ -309,6 +315,8 @@ var Image = React5.forwardRef(
309
315
  );
310
316
  var css4 = {
311
317
  "@desktop": {
318
+ display: "flex",
319
+ overflow: "hidden",
312
320
  img: {
313
321
  width: "100%",
314
322
  height: "100%",
@@ -340,6 +348,7 @@ var Layout = forwardRef4((props, ref) => {
340
348
  gap,
341
349
  rowSize,
342
350
  columns,
351
+ contentSize,
343
352
  gridSize,
344
353
  backgroundColor,
345
354
  backgroundImage,
@@ -347,6 +356,8 @@ var Layout = forwardRef4((props, ref) => {
347
356
  ...rest
348
357
  } = props;
349
358
  let style = {
359
+ "--layout-content-width": "100vw",
360
+ "--content-size": contentSize + "px",
350
361
  "--grid-size": gridSize + "px",
351
362
  "--rows": rows,
352
363
  "--columns": columns,
@@ -354,7 +365,7 @@ var Layout = forwardRef4((props, ref) => {
354
365
  "--row-size": rowSize + "px",
355
366
  "--col-size": "calc((var(--grid-size) - calc(var(--columns) - 1) * var(--gap)) / var(--columns))"
356
367
  };
357
- return /* @__PURE__ */ React6.createElement("section", {
368
+ return /* @__PURE__ */ React6.createElement("div", {
358
369
  ref,
359
370
  ...rest,
360
371
  style
@@ -372,42 +383,44 @@ var LayoutBackground = (props) => {
372
383
  ["--bg-color"]: bgColor,
373
384
  ["--object-fit"]: objectFit
374
385
  };
375
- return imgUrl || bgColor ? /* @__PURE__ */ React6.createElement("div", {
376
- "data-wv-bg": true,
377
- style
378
- }, imgUrl && /* @__PURE__ */ React6.createElement("img", {
379
- width: "100%",
380
- height: "100%",
381
- "data-blink-src": imgUrl,
382
- alt: "wv-layout-background"
383
- })) : null;
386
+ if (imgUrl || bgColor) {
387
+ return /* @__PURE__ */ React6.createElement("div", {
388
+ style,
389
+ className: "wv-layout-background"
390
+ }, imgUrl && /* @__PURE__ */ React6.createElement("img", {
391
+ width: "100%",
392
+ height: "100%",
393
+ "data-blink-src": imgUrl,
394
+ alt: "Section background"
395
+ }));
396
+ }
397
+ return null;
384
398
  };
385
399
  var css5 = {
386
400
  "@desktop": {
387
- paddingTop: "16px",
388
- paddingBottom: "16px",
389
- paddingLeft: "var(--gap)",
390
- paddingRight: "var(--gap)",
391
401
  "> [data-layout-content]": {
402
+ paddingTop: "var(--gap)",
403
+ paddingBottom: "var(--gap)",
392
404
  margin: "0 auto",
393
- display: "grid !important",
405
+ display: "grid",
394
406
  gridTemplateRows: "repeat(var(--rows), var(--row-size))",
395
- gridTemplateColumns: "repeat(var(--columns), minmax(0, var(--col-size)))",
407
+ gridTemplateColumns: "calc((var(--layout-content-width) - var(--content-size)) / 2) 1fr repeat(var(--columns), minmax(0, var(--col-size))) 1fr calc((var(--layout-content-width) - var(--content-size)) / 2)",
408
+ gridAutoRows: "var(--row-size)",
396
409
  gap: "var(--gap)",
397
- maxWidth: "var(--grid-size)"
410
+ maxWidth: "var(--layout-content-width)"
398
411
  }
399
412
  },
400
413
  "@mobile": {
401
414
  padding: "0 16px",
402
415
  "> [data-layout-content]": {
403
- display: "flex !important",
416
+ display: "flex",
404
417
  flexDirection: "column"
405
418
  }
406
419
  }
407
420
  };
408
421
  var permanentCss = {
409
422
  "@desktop": {
410
- "[data-wv-bg]": {
423
+ ".wv-layout-background": {
411
424
  position: "absolute",
412
425
  inset: 0,
413
426
  backgroundColor: "var(--bg-color)"
@@ -418,8 +431,9 @@ var permanentCss = {
418
431
  }
419
432
  };
420
433
  Layout.defaultProps = {
434
+ contentSize: 1600,
421
435
  gridSize: 1224,
422
- rows: 12,
436
+ rows: 16,
423
437
  columns: 12,
424
438
  gap: 16,
425
439
  rowSize: 48
@@ -435,7 +449,6 @@ var Map = forwardRef5((props, ref) => {
435
449
  ...rest
436
450
  }, /* @__PURE__ */ React7.createElement("iframe", {
437
451
  loading: "lazy",
438
- scrolling: "no",
439
452
  width: "100%",
440
453
  height: "100%",
441
454
  title: "map",
@@ -443,7 +456,18 @@ var Map = forwardRef5((props, ref) => {
443
456
  style: { pointerEvents: "none" }
444
457
  }));
445
458
  });
446
- var css6 = {};
459
+ var css6 = {
460
+ "@desktop": {
461
+ iframe: {
462
+ border: "none"
463
+ }
464
+ },
465
+ "@mobile": {
466
+ iframe: {
467
+ border: "none"
468
+ }
469
+ }
470
+ };
447
471
  Map.defaultProps = {
448
472
  place: "Hanoi",
449
473
  zoom: 14
@@ -576,6 +600,14 @@ var css8 = {
576
600
  height: "100%",
577
601
  width: "100%",
578
602
  aspectRatio: "16 / 9"
603
+ },
604
+ iframe: {
605
+ border: "none"
606
+ }
607
+ },
608
+ "@mobile": {
609
+ iframe: {
610
+ border: "none"
579
611
  }
580
612
  }
581
613
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.30",
2
+ "version": "0.7.32",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@radix-ui/react-dialog": "^1.0.2",
35
35
  "@stitches/react": "^1.2.8",
36
- "@weaverse/core": "0.7.30",
37
- "nuka-carousel": "^5.4.0"
36
+ "@weaverse/core": "0.7.32",
37
+ "nuka-carousel": "^5.4.1"
38
38
  }
39
39
  }