@janbox/storefront-builder 2.0.9 → 2.0.10
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/README.md +33 -3
- package/dist/{dataset-DQ21hyBo.js → countdown-timer.node-d0EtGQ4_.js} +2592 -3029
- package/dist/editor.js +9702 -1240
- package/dist/hooks/use-first-mount-state.d.ts +1 -0
- package/dist/hooks/use-update-effect.d.ts +2 -0
- package/dist/index-3PtMdwiC.js +188 -0
- package/dist/index-tISPdvwn.js +4 -0
- package/dist/index.js +92 -212
- package/dist/lib/accordion-group/index.d.ts +0 -1
- package/dist/lib/box/README.md +3 -10
- package/dist/lib/box/index.d.ts +0 -1
- package/dist/lib/button/index.d.ts +0 -1
- package/dist/lib/cell/index.d.ts +0 -1
- package/dist/lib/container/README.md +86 -0
- package/dist/lib/container/index.d.ts +0 -1
- package/dist/lib/countdown-timer/index.d.ts +0 -1
- package/dist/lib/flex-item/README.md +1 -0
- package/dist/lib/flex-item/index.d.ts +0 -1
- package/dist/lib/flexbox/README.md +0 -6
- package/dist/lib/flexbox/index.d.ts +0 -1
- package/dist/lib/grid/README.md +5 -4
- package/dist/lib/grid/index.d.ts +0 -1
- package/dist/lib/heading/README.md +38 -8
- package/dist/lib/heading/index.d.ts +0 -2
- package/dist/lib/icon/index.d.ts +0 -1
- package/dist/lib/image/index.d.ts +0 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/link/index.d.ts +0 -1
- package/dist/lib/marquee/index.d.ts +0 -1
- package/dist/lib/paragraph/README.md +9 -5
- package/dist/lib/paragraph/index.d.ts +0 -2
- package/dist/lib/paragraph/paragraph.node/types.d.ts +2 -2
- package/dist/lib/swiper/index.d.ts +0 -1
- package/dist/lib/tabs/index.d.ts +0 -1
- package/dist/lib/unordered-list/index.d.ts +0 -1
- package/dist/lib/video/index.d.ts +0 -1
- package/dist/minus-BrRnjbhB.js +4 -0
- package/dist/templates.js +17 -33
- package/dist/{tooltip-Bi1eNiUc.js → tooltip-5WmNiI2z.js} +1 -1
- package/package.json +1 -2
- package/dist/countdown-timer.inspector-EFXiJ973.js +0 -8192
- package/dist/index-Cx5nImHp.js +0 -4
- package/dist/lib/paragraph/paragraph/paragraph.d.ts +0 -2
- package/dist/lib/paragraph/paragraph/types.d.ts +0 -2
- package/dist/lib/text/README.md +0 -90
- package/dist/lib/text/index.d.ts +0 -1
- package/dist/lib/text/text.inspector/index.d.ts +0 -1
- package/dist/lib/text/text.inspector/text.inspector.d.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFirstMountState(): boolean;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { useNode as T, Element as C, Frame as I, Editor as v, DefaultEventHandlers as A } from "@craftjs/core";
|
|
2
|
+
import { isFunction as w, merge as x, set as h, isNil as g, isString as P } from "lodash-es";
|
|
3
|
+
import { useMemo as E, useEffect as L } from "react";
|
|
4
|
+
import { N, W as e, g as S, A as k, c as B, b as F, a as y, p as M, T as q, o as G, n as R, q as U, M as D, l as H, m as j, S as O, k as V, r as _, L as $, I as z, V as J, j as W, f as X, B as Y, F as K, h as Q, e as Z, G as ee, i as oe, P as re, d as se, U as te, R as ne, y as ae, X as de, Y as f } from "./countdown-timer.node-d0EtGQ4_.js";
|
|
5
|
+
import { getGridProps as ue, getCellProps as ie, getLinkProps as ce, getButtonProps as pe, getFlexboxProps as Ne, getFlexItemProps as me, getImageProps as le, getMarqueeProps as Pe, getTabsProps as fe, getSwiperProps as ge, getUnorderedListProps as be, getIconProps as Te, getAccordionProps as Ce, getAccordionGroupProps as Ie, getVideoProps as ve, getBoxProps as Ae, getContainerProps as we } from "@janbox/storefront-ui";
|
|
6
|
+
import { jsx as b } from "@emotion/react/jsx-runtime";
|
|
7
|
+
import { flatten as xe } from "flat";
|
|
8
|
+
const o = (s = {}) => {
|
|
9
|
+
const { id: r } = T(), t = s?.nodeId ?? r, { nodeProps: n, actions: a } = N((d) => ({
|
|
10
|
+
nodeProps: d.nodes[t ?? r]?.data.props ?? {}
|
|
11
|
+
})), u = (d, c) => w(d) ? a.setProp(t, d) : a.setProp(t, (p) => {
|
|
12
|
+
if (c?.merge) {
|
|
13
|
+
x(p, d);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const m = xe(d);
|
|
17
|
+
Object.keys(m).forEach((l) => {
|
|
18
|
+
h(p, l, m[l]);
|
|
19
|
+
});
|
|
20
|
+
}), i = (d, c, p) => u(
|
|
21
|
+
c === "xs" ? d : {
|
|
22
|
+
[c]: d
|
|
23
|
+
},
|
|
24
|
+
p
|
|
25
|
+
);
|
|
26
|
+
return {
|
|
27
|
+
id: t,
|
|
28
|
+
nodeProps: s?.transform?.(n) ?? n,
|
|
29
|
+
setNodeProps: u,
|
|
30
|
+
setNodeResponsiveProps: i
|
|
31
|
+
};
|
|
32
|
+
}, Ge = () => o({
|
|
33
|
+
transform: ue
|
|
34
|
+
}), Re = () => o({
|
|
35
|
+
transform: ie
|
|
36
|
+
}), Ue = () => o({
|
|
37
|
+
transform: ce
|
|
38
|
+
}), De = () => o({
|
|
39
|
+
transform: pe
|
|
40
|
+
}), He = () => o({
|
|
41
|
+
transform: Ne
|
|
42
|
+
}), je = () => o({
|
|
43
|
+
transform: me
|
|
44
|
+
}), Oe = () => o({
|
|
45
|
+
transform: le
|
|
46
|
+
}), Ve = () => o({
|
|
47
|
+
transform: Pe
|
|
48
|
+
}), _e = (s) => o({
|
|
49
|
+
transform: fe,
|
|
50
|
+
nodeId: s
|
|
51
|
+
}), $e = (s) => o({
|
|
52
|
+
nodeId: s
|
|
53
|
+
}), ze = () => o({
|
|
54
|
+
transform: ge
|
|
55
|
+
}), Je = () => o({
|
|
56
|
+
transform: be
|
|
57
|
+
}), We = () => o({
|
|
58
|
+
transform: Te
|
|
59
|
+
}), Xe = (s) => o({
|
|
60
|
+
transform: Ce,
|
|
61
|
+
nodeId: s
|
|
62
|
+
}), Ye = () => o({
|
|
63
|
+
transform: Ie
|
|
64
|
+
}), Ke = () => o({
|
|
65
|
+
transform: ve
|
|
66
|
+
}), Qe = () => o({
|
|
67
|
+
transform: Ae
|
|
68
|
+
}), Ze = () => o({
|
|
69
|
+
transform: we
|
|
70
|
+
}), eo = () => o(), oo = C, ro = ({ children: s, data: r }) => {
|
|
71
|
+
const { resolver: t } = N((a) => ({
|
|
72
|
+
resolver: a.options.resolver
|
|
73
|
+
})), n = E(() => {
|
|
74
|
+
if (g(r)) return r;
|
|
75
|
+
const a = P(r) ? JSON.parse(r) : r;
|
|
76
|
+
return Object.entries(a).forEach(([, u]) => {
|
|
77
|
+
const i = P(u.type) ? u.type : u.type.resolvedName;
|
|
78
|
+
t[i] || (console.error(`Unknown node: ${i}`), u.type = {
|
|
79
|
+
resolvedName: e.Unknown
|
|
80
|
+
});
|
|
81
|
+
}), a;
|
|
82
|
+
}, [r, t]);
|
|
83
|
+
return /* @__PURE__ */ b(I, { data: n, children: s });
|
|
84
|
+
}, he = {
|
|
85
|
+
// Root
|
|
86
|
+
[e.Root]: ne,
|
|
87
|
+
// Unknown
|
|
88
|
+
[e.Unknown]: te,
|
|
89
|
+
// Button
|
|
90
|
+
[e.Button]: se,
|
|
91
|
+
// Text
|
|
92
|
+
[e.Paragraph]: re,
|
|
93
|
+
[e.Heading]: oe,
|
|
94
|
+
// Layout
|
|
95
|
+
[e.Grid]: ee,
|
|
96
|
+
[e.Cell]: Z,
|
|
97
|
+
[e.Flexbox]: Q,
|
|
98
|
+
[e.FlexItem]: K,
|
|
99
|
+
[e.Box]: Y,
|
|
100
|
+
[e.Container]: X,
|
|
101
|
+
// Media
|
|
102
|
+
[e.Image]: W,
|
|
103
|
+
[e.Video]: J,
|
|
104
|
+
[e.Icon]: z,
|
|
105
|
+
// Navigation
|
|
106
|
+
[e.Link]: $,
|
|
107
|
+
// List
|
|
108
|
+
[e.UnorderedList]: _,
|
|
109
|
+
[e.ListItem]: V,
|
|
110
|
+
// Carousel
|
|
111
|
+
[e.Swiper]: O,
|
|
112
|
+
[e.SwiperSlide]: j,
|
|
113
|
+
[e.Marquee]: H,
|
|
114
|
+
[e.MarqueeItem]: D,
|
|
115
|
+
// Tabs
|
|
116
|
+
[e.Tabs]: U,
|
|
117
|
+
[e.TabList]: R,
|
|
118
|
+
[e.Tab]: G,
|
|
119
|
+
[e.TabContent]: q,
|
|
120
|
+
[e.TabPanel]: M,
|
|
121
|
+
// Accordion
|
|
122
|
+
[e.AccordionGroup]: y,
|
|
123
|
+
[e.Accordion]: F,
|
|
124
|
+
[e.AccordionSummary]: B,
|
|
125
|
+
[e.AccordionContent]: k,
|
|
126
|
+
// Timer
|
|
127
|
+
[e.CountdownTimer]: S
|
|
128
|
+
}, so = ({ resolver: s, children: r, ...t }) => /* @__PURE__ */ b(
|
|
129
|
+
v,
|
|
130
|
+
{
|
|
131
|
+
enabled: !1,
|
|
132
|
+
onRender: Ee,
|
|
133
|
+
handlers: (n) => new Le({
|
|
134
|
+
store: n,
|
|
135
|
+
removeHoverOnMouseleave: !0,
|
|
136
|
+
isMultiSelectEnabled: () => !1
|
|
137
|
+
}),
|
|
138
|
+
resolver: { ...he, ...s },
|
|
139
|
+
...t,
|
|
140
|
+
children: r
|
|
141
|
+
}
|
|
142
|
+
), Ee = ({ render: s }) => {
|
|
143
|
+
const { id: r } = o(), { query: t } = N();
|
|
144
|
+
return L(() => {
|
|
145
|
+
const n = t.node(r).get(), a = ae(n);
|
|
146
|
+
if (g(a))
|
|
147
|
+
throw new Error(
|
|
148
|
+
`The node with id "${n.data.displayName}" does not have a resolved ID. Please check your node configuration.`
|
|
149
|
+
);
|
|
150
|
+
}, [r, t]), s;
|
|
151
|
+
};
|
|
152
|
+
class Le extends A {
|
|
153
|
+
handlers() {
|
|
154
|
+
const r = super.handlers();
|
|
155
|
+
return {
|
|
156
|
+
...r,
|
|
157
|
+
select(t, n) {
|
|
158
|
+
return (t.getAttribute(de.DATA_NODE_SELECTABLE) ?? f.True) === f.True ? r.select(t, n) : () => {
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
ro as C,
|
|
166
|
+
oo as N,
|
|
167
|
+
so as a,
|
|
168
|
+
Ye as b,
|
|
169
|
+
Xe as c,
|
|
170
|
+
Qe as d,
|
|
171
|
+
De as e,
|
|
172
|
+
Re as f,
|
|
173
|
+
Ze as g,
|
|
174
|
+
eo as h,
|
|
175
|
+
je as i,
|
|
176
|
+
He as j,
|
|
177
|
+
Ge as k,
|
|
178
|
+
We as l,
|
|
179
|
+
Oe as m,
|
|
180
|
+
Ue as n,
|
|
181
|
+
Ve as o,
|
|
182
|
+
ze as p,
|
|
183
|
+
$e as q,
|
|
184
|
+
_e as r,
|
|
185
|
+
Je as s,
|
|
186
|
+
Ke as t,
|
|
187
|
+
o as u
|
|
188
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,215 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useNode as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import "overlayscrollbars-react";
|
|
20
|
-
import "@tanstack/react-virtual";
|
|
21
|
-
import "react-dropzone";
|
|
22
|
-
import "react-datepicker";
|
|
23
|
-
import "react-frame-component";
|
|
24
|
-
import { getTextProps as M, getListItemProps as F, getTabPanelProps as w } from "@janbox/storefront-ui";
|
|
25
|
-
const E = () => i(), se = () => {
|
|
26
|
-
const p = f(), { connectors: c } = L(), u = a(null), {
|
|
27
|
-
id: N,
|
|
28
|
-
nodeProps: { dangerouslySetInnerHTML: t, ...m },
|
|
29
|
-
setNodeProps: l
|
|
30
|
-
} = E(), o = a(t?.__html), { isActive: r } = T((e, g) => ({
|
|
31
|
-
isActive: g.getEvent("selected").contains(N)
|
|
32
|
-
}));
|
|
33
|
-
S(() => {
|
|
34
|
-
r || A(o.current) || (l({
|
|
35
|
-
dangerouslySetInnerHTML: { __html: o.current }
|
|
36
|
-
}), o.current = void 0);
|
|
37
|
-
}, [r]);
|
|
38
|
-
const P = v(({ editor: e }) => {
|
|
39
|
-
o.current = e.getHTML();
|
|
40
|
-
}), { mode: I } = x();
|
|
41
|
-
return /* @__PURE__ */ d(n, { children: [
|
|
42
|
-
r && I === "full" && /* @__PURE__ */ d(n, { children: [
|
|
43
|
-
/* @__PURE__ */ s(b, {}),
|
|
44
|
-
/* @__PURE__ */ s(h, {})
|
|
45
|
-
] }),
|
|
46
|
-
/* @__PURE__ */ s(
|
|
47
|
-
H,
|
|
48
|
-
{
|
|
49
|
-
...m,
|
|
50
|
-
...p,
|
|
51
|
-
ref: (e) => {
|
|
52
|
-
e && c.connect(e);
|
|
53
|
-
},
|
|
54
|
-
children: /* @__PURE__ */ s(
|
|
55
|
-
C,
|
|
56
|
-
{
|
|
57
|
-
ref: u,
|
|
58
|
-
options: {
|
|
59
|
-
content: t?.__html,
|
|
60
|
-
onUpdate: P
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
] });
|
|
67
|
-
}, R = () => i({
|
|
68
|
-
transform: M
|
|
69
|
-
}), re = () => {
|
|
70
|
-
const p = f(), { connectors: c } = L(), u = a(null), {
|
|
71
|
-
id: N,
|
|
72
|
-
nodeProps: { dangerouslySetInnerHTML: t, ...m },
|
|
73
|
-
setNodeProps: l
|
|
74
|
-
} = R(), o = a(t?.__html), { isActive: r } = T((e, g) => ({
|
|
75
|
-
isActive: g.getEvent("selected").contains(N)
|
|
76
|
-
}));
|
|
77
|
-
S(() => {
|
|
78
|
-
r || A(o.current) || (l({
|
|
79
|
-
dangerouslySetInnerHTML: { __html: o.current }
|
|
80
|
-
}), o.current = void 0);
|
|
81
|
-
}, [r]);
|
|
82
|
-
const P = v(({ editor: e }) => {
|
|
83
|
-
o.current = e.getHTML();
|
|
84
|
-
}), { mode: I } = x();
|
|
85
|
-
return /* @__PURE__ */ d(n, { children: [
|
|
86
|
-
r && I === "full" && /* @__PURE__ */ d(n, { children: [
|
|
87
|
-
/* @__PURE__ */ s(b, {}),
|
|
88
|
-
/* @__PURE__ */ s(h, {})
|
|
89
|
-
] }),
|
|
90
|
-
/* @__PURE__ */ s(
|
|
91
|
-
_,
|
|
92
|
-
{
|
|
93
|
-
...m,
|
|
94
|
-
...p,
|
|
95
|
-
ref: (e) => {
|
|
96
|
-
e && c.connect(e);
|
|
97
|
-
},
|
|
98
|
-
children: /* @__PURE__ */ s(
|
|
99
|
-
C,
|
|
100
|
-
{
|
|
101
|
-
ref: u,
|
|
102
|
-
options: {
|
|
103
|
-
content: t?.__html,
|
|
104
|
-
onUpdate: P
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
] });
|
|
111
|
-
}, te = () => i({
|
|
112
|
-
transform: F
|
|
113
|
-
}), ae = () => i({
|
|
114
|
-
transform: w
|
|
1
|
+
import { A as c, a as g, b, c as C, B as x, d as f, C as T, e as I, f as L, g as S, F as A, h as v, G as w, H as R, i as h, I as k, j as q, L as B, k as F, M as G, l as H, P as M, R as U, S as y, m as D, T as V, n as j, o as E, p as z, q as J, U as K, r as O, V as Q, s as W, u as X, v as Y, w as Z, x as _, y as $, z as ee, D as oe, E as se, J as ae, K as re, N as de, O as Ne } from "./countdown-timer.node-d0EtGQ4_.js";
|
|
2
|
+
import { u as e } from "./index-3PtMdwiC.js";
|
|
3
|
+
import { C as ne, a as pe, N as ue, b as ie, c as Pe, d as me, e as le, f as ce, g as ge, h as be, i as Ce, j as xe, k as fe, l as Te, m as Ie, n as Le, o as Se, p as Ae, q as ve, r as we, s as Re, t as he } from "./index-3PtMdwiC.js";
|
|
4
|
+
import { getTextProps as s, getTabPanelProps as a, getListItemProps as r } from "@janbox/storefront-ui";
|
|
5
|
+
import { useNode as qe } from "@craftjs/core";
|
|
6
|
+
import "lodash-es";
|
|
7
|
+
import "react";
|
|
8
|
+
const p = () => e({
|
|
9
|
+
transform: (o) => s({
|
|
10
|
+
...o,
|
|
11
|
+
as: o.as ?? "div"
|
|
12
|
+
})
|
|
13
|
+
}), u = () => e({
|
|
14
|
+
transform: s
|
|
15
|
+
}), i = () => e({
|
|
16
|
+
transform: a
|
|
17
|
+
}), P = () => e({
|
|
18
|
+
transform: r
|
|
115
19
|
});
|
|
116
20
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
vo as useButtonNodeProps,
|
|
192
|
-
Ho as useCellNodeProps,
|
|
193
|
-
T as useComposer,
|
|
194
|
-
_o as useContainerNodeProps,
|
|
195
|
-
Mo as useCountdownTimerNodeProps,
|
|
196
|
-
Fo as useFlexItemNodeProps,
|
|
197
|
-
wo as useFlexboxNodeProps,
|
|
198
|
-
Eo as useGridNodeProps,
|
|
199
|
-
R as useHeadingNodeProps,
|
|
200
|
-
Ro as useIconNodeProps,
|
|
201
|
-
yo as useImageNodeProps,
|
|
202
|
-
Bo as useLinkNodeProps,
|
|
203
|
-
te as useListItemNodeProps,
|
|
204
|
-
Go as useMarqueeNodeProps,
|
|
205
|
-
zo as useNode,
|
|
206
|
-
f as useNodeDataAttributes,
|
|
207
|
-
i as useNodeProps,
|
|
208
|
-
E as useParagraphNodeProps,
|
|
209
|
-
Uo as useSwiperNodeProps,
|
|
210
|
-
ko as useTabNodeProps,
|
|
211
|
-
ae as useTabPanelNodeProps,
|
|
212
|
-
Do as useTabsNodeProps,
|
|
213
|
-
qo as useUnorderedListNodeProps,
|
|
214
|
-
Vo as useVideoNodeProps
|
|
21
|
+
c as AccordionContentNode,
|
|
22
|
+
g as AccordionGroupNode,
|
|
23
|
+
b as AccordionNode,
|
|
24
|
+
C as AccordionSummaryNode,
|
|
25
|
+
x as BoxNode,
|
|
26
|
+
f as ButtonNode,
|
|
27
|
+
ne as Canvas,
|
|
28
|
+
T as CanvasPlaceholder,
|
|
29
|
+
I as CellNode,
|
|
30
|
+
pe as Composer,
|
|
31
|
+
L as ContainerNode,
|
|
32
|
+
S as CountdownTimerNode,
|
|
33
|
+
A as FlexItemNode,
|
|
34
|
+
v as FlexboxNode,
|
|
35
|
+
w as GridNode,
|
|
36
|
+
R as Heading,
|
|
37
|
+
h as HeadingNode,
|
|
38
|
+
k as IconNode,
|
|
39
|
+
q as ImageNode,
|
|
40
|
+
B as LinkNode,
|
|
41
|
+
F as ListItemNode,
|
|
42
|
+
G as MarqueeItemNode,
|
|
43
|
+
H as MarqueeNode,
|
|
44
|
+
ue as NodeElement,
|
|
45
|
+
M as ParagraphNode,
|
|
46
|
+
U as RootNode,
|
|
47
|
+
y as SwiperNode,
|
|
48
|
+
D as SwiperSlideNode,
|
|
49
|
+
V as TabContentNode,
|
|
50
|
+
j as TabListNode,
|
|
51
|
+
E as TabNode,
|
|
52
|
+
z as TabPanelNode,
|
|
53
|
+
J as TabsNode,
|
|
54
|
+
K as UnknownNode,
|
|
55
|
+
O as UnorderedListNode,
|
|
56
|
+
Q as VideoNode,
|
|
57
|
+
W as defineNode,
|
|
58
|
+
X as getNodeCustom,
|
|
59
|
+
Y as getNodeDisplayName,
|
|
60
|
+
Z as getNodeInfo,
|
|
61
|
+
_ as getNodeRelated,
|
|
62
|
+
$ as getNodeResolved,
|
|
63
|
+
ee as isNodeSelectable,
|
|
64
|
+
oe as parseNumber,
|
|
65
|
+
se as parseSvgString,
|
|
66
|
+
ae as registerNodeRelated,
|
|
67
|
+
re as toResponsiveCss,
|
|
68
|
+
ie as useAccordionGroupNodeProps,
|
|
69
|
+
Pe as useAccordionNodeProps,
|
|
70
|
+
me as useBoxNodeProps,
|
|
71
|
+
le as useButtonNodeProps,
|
|
72
|
+
ce as useCellNodeProps,
|
|
73
|
+
de as useComposer,
|
|
74
|
+
ge as useContainerNodeProps,
|
|
75
|
+
be as useCountdownTimerNodeProps,
|
|
76
|
+
Ce as useFlexItemNodeProps,
|
|
77
|
+
xe as useFlexboxNodeProps,
|
|
78
|
+
fe as useGridNodeProps,
|
|
79
|
+
u as useHeadingNodeProps,
|
|
80
|
+
Te as useIconNodeProps,
|
|
81
|
+
Ie as useImageNodeProps,
|
|
82
|
+
Le as useLinkNodeProps,
|
|
83
|
+
P as useListItemNodeProps,
|
|
84
|
+
Se as useMarqueeNodeProps,
|
|
85
|
+
qe as useNode,
|
|
86
|
+
Ne as useNodeDataAttributes,
|
|
87
|
+
e as useNodeProps,
|
|
88
|
+
p as useParagraphNodeProps,
|
|
89
|
+
Ae as useSwiperNodeProps,
|
|
90
|
+
ve as useTabNodeProps,
|
|
91
|
+
i as useTabPanelNodeProps,
|
|
92
|
+
we as useTabsNodeProps,
|
|
93
|
+
Re as useUnorderedListNodeProps,
|
|
94
|
+
he as useVideoNodeProps
|
|
215
95
|
};
|
package/dist/lib/box/README.md
CHANGED
|
@@ -8,12 +8,6 @@ Block container đa năng (render ra `div`). Là canvas node — chứa bất k
|
|
|
8
8
|
|
|
9
9
|
## Configurable props
|
|
10
10
|
|
|
11
|
-
### Top-level props
|
|
12
|
-
|
|
13
|
-
| Prop | Type | Description |
|
|
14
|
-
| --- | --- | --- |
|
|
15
|
-
| `container` | `boolean` | Bật max-width container constraint |
|
|
16
|
-
|
|
17
11
|
### `sx` props
|
|
18
12
|
|
|
19
13
|
```ts
|
|
@@ -66,8 +60,8 @@ sx?: {
|
|
|
66
60
|
import { BoxNode } from '@janbox/storefront-builder';
|
|
67
61
|
|
|
68
62
|
// Wrapper đơn giản
|
|
69
|
-
<BoxNode sx={{
|
|
70
|
-
<
|
|
63
|
+
<BoxNode sx={{ paddingTop: 16, paddingRight: 16, paddingBottom: 16, paddingLeft: 16 }}>
|
|
64
|
+
<HeadingNode as="h2">Hello</HeadingNode>
|
|
71
65
|
</BoxNode>
|
|
72
66
|
|
|
73
67
|
// Section có background
|
|
@@ -81,9 +75,8 @@ import { BoxNode } from '@janbox/storefront-builder';
|
|
|
81
75
|
...
|
|
82
76
|
</BoxNode>
|
|
83
77
|
|
|
84
|
-
//
|
|
78
|
+
// Responsive padding
|
|
85
79
|
<BoxNode
|
|
86
|
-
container
|
|
87
80
|
sx={{
|
|
88
81
|
paddingTop: 24,
|
|
89
82
|
paddingBottom: 24,
|
package/dist/lib/box/index.d.ts
CHANGED
package/dist/lib/cell/index.d.ts
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# ContainerNode
|
|
2
|
+
|
|
3
|
+
Block container có max-width cố định, căn giữa theo chiều ngang. Dùng để tạo section có width bị giới hạn (ví dụ: content area trong một full-width background section).
|
|
4
|
+
|
|
5
|
+
## Resolved name
|
|
6
|
+
|
|
7
|
+
`Container`
|
|
8
|
+
|
|
9
|
+
## Configurable props
|
|
10
|
+
|
|
11
|
+
### `sx` props
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
sx?: {
|
|
15
|
+
// size
|
|
16
|
+
height?: number | string
|
|
17
|
+
|
|
18
|
+
// spacing
|
|
19
|
+
paddingTop?: number
|
|
20
|
+
paddingRight?: number
|
|
21
|
+
paddingBottom?: number
|
|
22
|
+
paddingLeft?: number
|
|
23
|
+
marginTop?: number
|
|
24
|
+
marginRight?: number
|
|
25
|
+
marginBottom?: number
|
|
26
|
+
marginLeft?: number
|
|
27
|
+
|
|
28
|
+
// border
|
|
29
|
+
borderStyle?: string
|
|
30
|
+
borderColor?: string
|
|
31
|
+
borderTopWidth?: number
|
|
32
|
+
borderRightWidth?: number
|
|
33
|
+
borderBottomWidth?: number
|
|
34
|
+
borderLeftWidth?: number
|
|
35
|
+
borderTopLeftRadius?: number | string
|
|
36
|
+
borderTopRightRadius?: number | string
|
|
37
|
+
borderBottomRightRadius?: number | string
|
|
38
|
+
borderBottomLeftRadius?: number | string
|
|
39
|
+
|
|
40
|
+
// background
|
|
41
|
+
backgroundColor?: string
|
|
42
|
+
backgroundImage?: string
|
|
43
|
+
backgroundPosition?: string
|
|
44
|
+
backgroundRepeat?: string
|
|
45
|
+
backgroundSize?: string
|
|
46
|
+
backgroundAttachment?: string
|
|
47
|
+
background?: string
|
|
48
|
+
|
|
49
|
+
// responsive overrides
|
|
50
|
+
sm?: { /* same keys above */ }
|
|
51
|
+
md?: { /* same keys above */ }
|
|
52
|
+
lg?: { /* same keys above */ }
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { BoxNode, ContainerNode } from '@janbox/storefront-builder';
|
|
60
|
+
|
|
61
|
+
// Full-width background, content bị giới hạn width
|
|
62
|
+
<BoxNode sx={{ backgroundColor: '#f5f5f5' }}>
|
|
63
|
+
<ContainerNode sx={{ paddingTop: 48, paddingBottom: 48 }}>
|
|
64
|
+
...
|
|
65
|
+
</ContainerNode>
|
|
66
|
+
</BoxNode>
|
|
67
|
+
|
|
68
|
+
// Responsive padding
|
|
69
|
+
<ContainerNode
|
|
70
|
+
sx={{
|
|
71
|
+
paddingTop: 24,
|
|
72
|
+
paddingBottom: 24,
|
|
73
|
+
md: {
|
|
74
|
+
paddingTop: 48,
|
|
75
|
+
paddingBottom: 48,
|
|
76
|
+
},
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
...
|
|
80
|
+
</ContainerNode>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Rules
|
|
84
|
+
|
|
85
|
+
- **Canvas**: yes — chứa bất kỳ node con nào.
|
|
86
|
+
- **canMoveIn**: không giới hạn node type.
|
|
@@ -104,6 +104,7 @@ import { FlexboxNode, FlexItemNode } from '@janbox/storefront-builder';
|
|
|
104
104
|
## Rules
|
|
105
105
|
|
|
106
106
|
- **Canvas**: yes — chứa bất kỳ node con nào.
|
|
107
|
+
- **canDrag**: false — không thể kéo ra khỏi parent. Thứ tự item được điều chỉnh qua `sx.order` trong inspector.
|
|
107
108
|
- **Parent**: phải là `FlexboxNode`.
|
|
108
109
|
|
|
109
110
|
## Related nodes
|
|
@@ -8,12 +8,6 @@ Flex container node (`display: flex`). Chỉ chấp nhận `FlexItemNode` làm c
|
|
|
8
8
|
|
|
9
9
|
## Configurable props
|
|
10
10
|
|
|
11
|
-
### Top-level props
|
|
12
|
-
|
|
13
|
-
| Prop | Type | Description |
|
|
14
|
-
| --- | --- | --- |
|
|
15
|
-
| `container` | `boolean` | Bật max-width container constraint |
|
|
16
|
-
|
|
17
11
|
### `sx` props
|
|
18
12
|
|
|
19
13
|
```ts
|