@weaverse/react 1.0.22 → 1.0.24
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 +5 -3
- package/dist/index.js +40 -18
- package/dist/index.mjs +41 -19
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -158,9 +158,11 @@ declare function Dots(props: SliderDotsProps): JSX.Element;
|
|
|
158
158
|
|
|
159
159
|
declare function AutoplayPlugin(changeSlidesEvery: number): KeenSliderPlugin;
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
type NoHydrateProps = {
|
|
162
|
+
id: string;
|
|
162
163
|
getHTML?: () => string;
|
|
163
|
-
} & JSX.IntrinsicElements['div']
|
|
164
|
+
} & JSX.IntrinsicElements['div'];
|
|
165
|
+
declare function NoHydrate({ id, getHTML, ...rest }: NoHydrateProps): JSX.Element;
|
|
164
166
|
|
|
165
167
|
declare let Components: {
|
|
166
168
|
Background: typeof Background;
|
|
@@ -176,7 +178,7 @@ declare let Components: {
|
|
|
176
178
|
declare let SliderComponents: {
|
|
177
179
|
Arrows: typeof Arrows;
|
|
178
180
|
Dots: typeof Dots;
|
|
179
|
-
ResizePlugin: keen_slider_react.KeenSliderPlugin
|
|
181
|
+
ResizePlugin: keen_slider_react.KeenSliderPlugin;
|
|
180
182
|
AutoplayPlugin: typeof AutoplayPlugin;
|
|
181
183
|
};
|
|
182
184
|
|
package/dist/index.js
CHANGED
|
@@ -70,16 +70,16 @@ var Button = React.forwardRef((props, ref) => {
|
|
|
70
70
|
});
|
|
71
71
|
Button.defaultProps = {
|
|
72
72
|
type: "button",
|
|
73
|
-
text: "
|
|
73
|
+
text: "BUTTON",
|
|
74
74
|
clickAction: "none",
|
|
75
75
|
linkTo: "",
|
|
76
76
|
openInNewTab: false
|
|
77
77
|
};
|
|
78
78
|
var css = {
|
|
79
79
|
"@desktop": {
|
|
80
|
-
borderRadius: "
|
|
80
|
+
borderRadius: "4px",
|
|
81
81
|
border: "none",
|
|
82
|
-
backgroundColor: "#
|
|
82
|
+
backgroundColor: "#3E3F40",
|
|
83
83
|
color: "#fff",
|
|
84
84
|
fontSize: "14px",
|
|
85
85
|
lineHeight: "1.5",
|
|
@@ -90,8 +90,8 @@ var css = {
|
|
|
90
90
|
minWidth: "120px",
|
|
91
91
|
textDecoration: "none",
|
|
92
92
|
textAlign: "center",
|
|
93
|
-
"
|
|
94
|
-
backgroundColor: "#
|
|
93
|
+
"&:hover": {
|
|
94
|
+
backgroundColor: "#1A1B1B"
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
};
|
|
@@ -111,7 +111,12 @@ var css2 = {
|
|
|
111
111
|
alignItems: "flex-start",
|
|
112
112
|
justifyContent: "flex-start",
|
|
113
113
|
gridArea: "1 / 1 / 3 / 6",
|
|
114
|
-
overflow: "hidden"
|
|
114
|
+
overflow: "hidden",
|
|
115
|
+
// minWidth: '300px',
|
|
116
|
+
minHeight: "100px"
|
|
117
|
+
},
|
|
118
|
+
"@mobile": {
|
|
119
|
+
minHeight: "100px"
|
|
115
120
|
}
|
|
116
121
|
};
|
|
117
122
|
Container.defaultProps = {};
|
|
@@ -426,8 +431,8 @@ var css5 = {
|
|
|
426
431
|
"@desktop": {
|
|
427
432
|
position: "relative",
|
|
428
433
|
"> [data-layout-content]": {
|
|
429
|
-
paddingTop:
|
|
430
|
-
paddingBottom:
|
|
434
|
+
// paddingTop: 'var(--gap)',
|
|
435
|
+
// paddingBottom: 'var(--gap)',
|
|
431
436
|
margin: "0 auto",
|
|
432
437
|
display: "grid",
|
|
433
438
|
gridTemplateRows: "repeat(var(--rows), var(--row-size))",
|
|
@@ -1938,11 +1943,7 @@ var placeholder_default = Placeholder;
|
|
|
1938
1943
|
|
|
1939
1944
|
// src/components/no-hydrate.tsx
|
|
1940
1945
|
var import_react30 = __toESM(require("react"));
|
|
1941
|
-
function NoHydrate({
|
|
1942
|
-
getHTML,
|
|
1943
|
-
...rest
|
|
1944
|
-
}) {
|
|
1945
|
-
let id = (0, import_react30.useId)();
|
|
1946
|
+
function NoHydrate({ id, getHTML, ...rest }) {
|
|
1946
1947
|
let [html] = (0, import_react30.useState)(() => {
|
|
1947
1948
|
if (typeof document === "undefined") {
|
|
1948
1949
|
return getHTML?.() ?? "";
|
|
@@ -2100,7 +2101,7 @@ function formatCSS(css13) {
|
|
|
2100
2101
|
}
|
|
2101
2102
|
var permanentClasses = {};
|
|
2102
2103
|
function generateItemClassName(instance, stitchesInstance) {
|
|
2103
|
-
let { css: css13, type, className: cls = "" } = instance.data;
|
|
2104
|
+
let { css: css13, type, className: cls = "", tailwindClasses } = instance.data;
|
|
2104
2105
|
let className = "";
|
|
2105
2106
|
let permanentClass = "";
|
|
2106
2107
|
let perCss = instance.Element?.permanentCss;
|
|
@@ -2119,7 +2120,13 @@ function generateItemClassName(instance, stitchesInstance) {
|
|
|
2119
2120
|
let newStitchesClass = stitchesInstance.css(formattedCss)().className || "";
|
|
2120
2121
|
let { stitchesClass } = instance;
|
|
2121
2122
|
let otherClass = (instance.ref.current?.className || "").replace(stitchesClass, "").replace(cls, "").replace(permanentClass, "").trim();
|
|
2122
|
-
className = (0, import_clsx5.default)(
|
|
2123
|
+
className = (0, import_clsx5.default)(
|
|
2124
|
+
permanentClass,
|
|
2125
|
+
cls,
|
|
2126
|
+
tailwindClasses,
|
|
2127
|
+
newStitchesClass,
|
|
2128
|
+
otherClass
|
|
2129
|
+
);
|
|
2123
2130
|
instance.stitchesClass = newStitchesClass;
|
|
2124
2131
|
}
|
|
2125
2132
|
return className;
|
|
@@ -2577,9 +2584,23 @@ var WeaverseRoot = ({ context }) => {
|
|
|
2577
2584
|
return null;
|
|
2578
2585
|
};
|
|
2579
2586
|
var ItemComponent = ({ instance }) => {
|
|
2580
|
-
let
|
|
2587
|
+
let context = (0, import_react38.useContext)(WeaverseContext);
|
|
2588
|
+
let { stitchesInstance, elementInstances } = context;
|
|
2581
2589
|
let [data, setData] = (0, import_react38.useState)(instance.data);
|
|
2582
|
-
let {
|
|
2590
|
+
let {
|
|
2591
|
+
id,
|
|
2592
|
+
type,
|
|
2593
|
+
childIds = [],
|
|
2594
|
+
children = [],
|
|
2595
|
+
parentId,
|
|
2596
|
+
createdAt,
|
|
2597
|
+
updatedAt,
|
|
2598
|
+
deletedAt,
|
|
2599
|
+
tailwindClasses,
|
|
2600
|
+
css: css13,
|
|
2601
|
+
className,
|
|
2602
|
+
...rest
|
|
2603
|
+
} = data;
|
|
2583
2604
|
(0, import_react38.useEffect)(() => {
|
|
2584
2605
|
let render = (data2) => setData({ ...data2 });
|
|
2585
2606
|
instance.subscribe(render);
|
|
@@ -2605,7 +2626,8 @@ var ItemComponent = ({ instance }) => {
|
|
|
2605
2626
|
className: generateItemClassName(instance, stitchesInstance),
|
|
2606
2627
|
...rest
|
|
2607
2628
|
},
|
|
2608
|
-
childIds.map((
|
|
2629
|
+
childIds.map((cid) => /* @__PURE__ */ import_react38.default.createElement(ItemInstance, { key: cid, id: cid })),
|
|
2630
|
+
children.map((item) => /* @__PURE__ */ import_react38.default.createElement(ItemInstance, { key: item.id, id: item.id }))
|
|
2609
2631
|
);
|
|
2610
2632
|
} else {
|
|
2611
2633
|
console.log(`Unknown element: ${type}`);
|
package/dist/index.mjs
CHANGED
|
@@ -34,16 +34,16 @@ var Button = React.forwardRef((props, ref) => {
|
|
|
34
34
|
});
|
|
35
35
|
Button.defaultProps = {
|
|
36
36
|
type: "button",
|
|
37
|
-
text: "
|
|
37
|
+
text: "BUTTON",
|
|
38
38
|
clickAction: "none",
|
|
39
39
|
linkTo: "",
|
|
40
40
|
openInNewTab: false
|
|
41
41
|
};
|
|
42
42
|
var css = {
|
|
43
43
|
"@desktop": {
|
|
44
|
-
borderRadius: "
|
|
44
|
+
borderRadius: "4px",
|
|
45
45
|
border: "none",
|
|
46
|
-
backgroundColor: "#
|
|
46
|
+
backgroundColor: "#3E3F40",
|
|
47
47
|
color: "#fff",
|
|
48
48
|
fontSize: "14px",
|
|
49
49
|
lineHeight: "1.5",
|
|
@@ -54,8 +54,8 @@ var css = {
|
|
|
54
54
|
minWidth: "120px",
|
|
55
55
|
textDecoration: "none",
|
|
56
56
|
textAlign: "center",
|
|
57
|
-
"
|
|
58
|
-
backgroundColor: "#
|
|
57
|
+
"&:hover": {
|
|
58
|
+
backgroundColor: "#1A1B1B"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
};
|
|
@@ -75,7 +75,12 @@ var css2 = {
|
|
|
75
75
|
alignItems: "flex-start",
|
|
76
76
|
justifyContent: "flex-start",
|
|
77
77
|
gridArea: "1 / 1 / 3 / 6",
|
|
78
|
-
overflow: "hidden"
|
|
78
|
+
overflow: "hidden",
|
|
79
|
+
// minWidth: '300px',
|
|
80
|
+
minHeight: "100px"
|
|
81
|
+
},
|
|
82
|
+
"@mobile": {
|
|
83
|
+
minHeight: "100px"
|
|
79
84
|
}
|
|
80
85
|
};
|
|
81
86
|
Container.defaultProps = {};
|
|
@@ -390,8 +395,8 @@ var css5 = {
|
|
|
390
395
|
"@desktop": {
|
|
391
396
|
position: "relative",
|
|
392
397
|
"> [data-layout-content]": {
|
|
393
|
-
paddingTop:
|
|
394
|
-
paddingBottom:
|
|
398
|
+
// paddingTop: 'var(--gap)',
|
|
399
|
+
// paddingBottom: 'var(--gap)',
|
|
395
400
|
margin: "0 auto",
|
|
396
401
|
display: "grid",
|
|
397
402
|
gridTemplateRows: "repeat(var(--rows), var(--row-size))",
|
|
@@ -1901,12 +1906,8 @@ var Placeholder = forwardRef9(
|
|
|
1901
1906
|
var placeholder_default = Placeholder;
|
|
1902
1907
|
|
|
1903
1908
|
// src/components/no-hydrate.tsx
|
|
1904
|
-
import React25, {
|
|
1905
|
-
function NoHydrate({
|
|
1906
|
-
getHTML,
|
|
1907
|
-
...rest
|
|
1908
|
-
}) {
|
|
1909
|
-
let id = useId();
|
|
1909
|
+
import React25, { useState as useState3 } from "react";
|
|
1910
|
+
function NoHydrate({ id, getHTML, ...rest }) {
|
|
1910
1911
|
let [html] = useState3(() => {
|
|
1911
1912
|
if (typeof document === "undefined") {
|
|
1912
1913
|
return getHTML?.() ?? "";
|
|
@@ -2064,7 +2065,7 @@ function formatCSS(css13) {
|
|
|
2064
2065
|
}
|
|
2065
2066
|
var permanentClasses = {};
|
|
2066
2067
|
function generateItemClassName(instance, stitchesInstance) {
|
|
2067
|
-
let { css: css13, type, className: cls = "" } = instance.data;
|
|
2068
|
+
let { css: css13, type, className: cls = "", tailwindClasses } = instance.data;
|
|
2068
2069
|
let className = "";
|
|
2069
2070
|
let permanentClass = "";
|
|
2070
2071
|
let perCss = instance.Element?.permanentCss;
|
|
@@ -2083,7 +2084,13 @@ function generateItemClassName(instance, stitchesInstance) {
|
|
|
2083
2084
|
let newStitchesClass = stitchesInstance.css(formattedCss)().className || "";
|
|
2084
2085
|
let { stitchesClass } = instance;
|
|
2085
2086
|
let otherClass = (instance.ref.current?.className || "").replace(stitchesClass, "").replace(cls, "").replace(permanentClass, "").trim();
|
|
2086
|
-
className = clsx5(
|
|
2087
|
+
className = clsx5(
|
|
2088
|
+
permanentClass,
|
|
2089
|
+
cls,
|
|
2090
|
+
tailwindClasses,
|
|
2091
|
+
newStitchesClass,
|
|
2092
|
+
otherClass
|
|
2093
|
+
);
|
|
2087
2094
|
instance.stitchesClass = newStitchesClass;
|
|
2088
2095
|
}
|
|
2089
2096
|
return className;
|
|
@@ -2541,9 +2548,23 @@ var WeaverseRoot = ({ context }) => {
|
|
|
2541
2548
|
return null;
|
|
2542
2549
|
};
|
|
2543
2550
|
var ItemComponent = ({ instance }) => {
|
|
2544
|
-
let
|
|
2551
|
+
let context = useContext6(WeaverseContext);
|
|
2552
|
+
let { stitchesInstance, elementInstances } = context;
|
|
2545
2553
|
let [data, setData] = useState6(instance.data);
|
|
2546
|
-
let {
|
|
2554
|
+
let {
|
|
2555
|
+
id,
|
|
2556
|
+
type,
|
|
2557
|
+
childIds = [],
|
|
2558
|
+
children = [],
|
|
2559
|
+
parentId,
|
|
2560
|
+
createdAt,
|
|
2561
|
+
updatedAt,
|
|
2562
|
+
deletedAt,
|
|
2563
|
+
tailwindClasses,
|
|
2564
|
+
css: css13,
|
|
2565
|
+
className,
|
|
2566
|
+
...rest
|
|
2567
|
+
} = data;
|
|
2547
2568
|
useEffect5(() => {
|
|
2548
2569
|
let render = (data2) => setData({ ...data2 });
|
|
2549
2570
|
instance.subscribe(render);
|
|
@@ -2569,7 +2590,8 @@ var ItemComponent = ({ instance }) => {
|
|
|
2569
2590
|
className: generateItemClassName(instance, stitchesInstance),
|
|
2570
2591
|
...rest
|
|
2571
2592
|
},
|
|
2572
|
-
childIds.map((
|
|
2593
|
+
childIds.map((cid) => /* @__PURE__ */ React30.createElement(ItemInstance, { key: cid, id: cid })),
|
|
2594
|
+
children.map((item) => /* @__PURE__ */ React30.createElement(ItemInstance, { key: item.id, id: item.id }))
|
|
2573
2595
|
);
|
|
2574
2596
|
} else {
|
|
2575
2597
|
console.log(`Unknown element: ${type}`);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.24",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@radix-ui/react-dialog": "^1.0.3",
|
|
36
36
|
"@stitches/react": "^1.2.8",
|
|
37
|
-
"@weaverse/core": "1.0.
|
|
37
|
+
"@weaverse/core": "1.0.24",
|
|
38
38
|
"clsx": "^1.2.1",
|
|
39
39
|
"keen-slider": "^6.8.5"
|
|
40
40
|
}
|