@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.
Files changed (48) hide show
  1. package/README.md +33 -3
  2. package/dist/{dataset-DQ21hyBo.js → countdown-timer.node-d0EtGQ4_.js} +2592 -3029
  3. package/dist/editor.js +9702 -1240
  4. package/dist/hooks/use-first-mount-state.d.ts +1 -0
  5. package/dist/hooks/use-update-effect.d.ts +2 -0
  6. package/dist/index-3PtMdwiC.js +188 -0
  7. package/dist/index-tISPdvwn.js +4 -0
  8. package/dist/index.js +92 -212
  9. package/dist/lib/accordion-group/index.d.ts +0 -1
  10. package/dist/lib/box/README.md +3 -10
  11. package/dist/lib/box/index.d.ts +0 -1
  12. package/dist/lib/button/index.d.ts +0 -1
  13. package/dist/lib/cell/index.d.ts +0 -1
  14. package/dist/lib/container/README.md +86 -0
  15. package/dist/lib/container/index.d.ts +0 -1
  16. package/dist/lib/countdown-timer/index.d.ts +0 -1
  17. package/dist/lib/flex-item/README.md +1 -0
  18. package/dist/lib/flex-item/index.d.ts +0 -1
  19. package/dist/lib/flexbox/README.md +0 -6
  20. package/dist/lib/flexbox/index.d.ts +0 -1
  21. package/dist/lib/grid/README.md +5 -4
  22. package/dist/lib/grid/index.d.ts +0 -1
  23. package/dist/lib/heading/README.md +38 -8
  24. package/dist/lib/heading/index.d.ts +0 -2
  25. package/dist/lib/icon/index.d.ts +0 -1
  26. package/dist/lib/image/index.d.ts +0 -1
  27. package/dist/lib/index.d.ts +0 -1
  28. package/dist/lib/link/index.d.ts +0 -1
  29. package/dist/lib/marquee/index.d.ts +0 -1
  30. package/dist/lib/paragraph/README.md +9 -5
  31. package/dist/lib/paragraph/index.d.ts +0 -2
  32. package/dist/lib/paragraph/paragraph.node/types.d.ts +2 -2
  33. package/dist/lib/swiper/index.d.ts +0 -1
  34. package/dist/lib/tabs/index.d.ts +0 -1
  35. package/dist/lib/unordered-list/index.d.ts +0 -1
  36. package/dist/lib/video/index.d.ts +0 -1
  37. package/dist/minus-BrRnjbhB.js +4 -0
  38. package/dist/templates.js +17 -33
  39. package/dist/{tooltip-Bi1eNiUc.js → tooltip-5WmNiI2z.js} +1 -1
  40. package/package.json +1 -2
  41. package/dist/countdown-timer.inspector-EFXiJ973.js +0 -8192
  42. package/dist/index-Cx5nImHp.js +0 -4
  43. package/dist/lib/paragraph/paragraph/paragraph.d.ts +0 -2
  44. package/dist/lib/paragraph/paragraph/types.d.ts +0 -2
  45. package/dist/lib/text/README.md +0 -90
  46. package/dist/lib/text/index.d.ts +0 -1
  47. package/dist/lib/text/text.inspector/index.d.ts +0 -1
  48. package/dist/lib/text/text.inspector/text.inspector.d.ts +0 -6
@@ -0,0 +1 @@
1
+ export declare function useFirstMountState(): boolean;
@@ -0,0 +1,2 @@
1
+ import { DependencyList, EffectCallback } from 'react';
2
+ export declare const useUpdateEffect: (effect: EffectCallback, deps: DependencyList) => void;
@@ -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
+ };
@@ -0,0 +1,4 @@
1
+ import { W as p } from "./tooltip-5WmNiI2z.js";
2
+ export {
3
+ p as WbTooltip
4
+ };
package/dist/index.js CHANGED
@@ -1,215 +1,95 @@
1
- import { u as f, f as T, g as x, h as H, i as _ } from "./dataset-DQ21hyBo.js";
2
- import { e as ie, A as pe, c as ce, d as ue, j as Ne, B as me, k as le, a as Pe, C as Ie, l as ge, F as fe, m as Te, G as xe, H as be, n as he, I as Ce, L as Le, o as Ae, p as Se, q as ve, P as He, R as _e, S as Me, r as Fe, T as we, s as Ee, v as Re, w as ye, x as Be, U as Ge, y as Ue, V as ke, z as De, D as qe, E as Ve, J as je, K as ze, N as Je, O as Ke, Q as Oe, W as Qe, X as We, Y as Xe } from "./dataset-DQ21hyBo.js";
3
- import { u as i, D as b, a as h, T as C } from "./countdown-timer.inspector-EFXiJ973.js";
4
- import { A as Ze, B as $e, b as eo, C as oo, c as so, d as ro, e as to, f as ao, F as no, g as io, G as po, H as co, I as uo, h as No, L as mo, M as lo, N as Po, P as Io, S as go, i as fo, j as To, k as xo, U as bo, V as ho, l as Co, m as Lo, n as Ao, o as So, p as vo, q as Ho, r as _o, s as Mo, t as Fo, v as wo, w as Eo, x as Ro, y as yo, z as Bo, E as Go, J as Uo, K as ko, O as Do, Q as qo, R as Vo } from "./countdown-timer.inspector-EFXiJ973.js";
5
- import { useNode as L } from "@craftjs/core";
6
- import { useNode as zo } from "@craftjs/core";
7
- import { isNil as A } from "lodash-es";
8
- import { useRef as a, useEffect as S, Fragment as n } from "react";
9
- import { jsxs as d, jsx as s } from "@emotion/react/jsx-runtime";
10
- import "flat";
11
- import { useDebounceCallback as v } from "usehooks-ts";
12
- import "@janbox/storefront-ui/utils";
13
- import "@janbox/storefront-ui/hooks";
14
- import "@emotion/react";
15
- import "@floating-ui/react";
16
- import "react-use";
17
- import "@janbox/storefront-ui/theme";
18
- import "react-colorful";
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
- ie as AccordionContentNode,
118
- Ze as AccordionGroupInspector,
119
- pe as AccordionGroupNode,
120
- ce as AccordionNode,
121
- ue as AccordionSummaryNode,
122
- $e as BoxInspector,
123
- Ne as BoxNode,
124
- eo as ButtonInspector,
125
- me as ButtonNode,
126
- oo as Canvas,
127
- le as CanvasPlaceholder,
128
- so as CellInspector,
129
- Pe as CellNode,
130
- ro as Composer,
131
- to as ContainerInspector,
132
- Ie as ContainerNode,
133
- ao as CountdownTimerInspector,
134
- ge as CountdownTimerNode,
135
- no as FlexItemInspector,
136
- fe as FlexItemNode,
137
- io as FlexboxInspector,
138
- Te as FlexboxNode,
139
- po as GridInspector,
140
- xe as GridNode,
141
- _ as Heading,
142
- co as HeadingInspector,
143
- be as HeadingNode,
144
- re as HeadingRenderer,
145
- uo as IconInspector,
146
- he as IconNode,
147
- No as ImageInspector,
148
- Ce as ImageNode,
149
- mo as LinkInspector,
150
- Le as LinkNode,
151
- Ae as ListItemNode,
152
- lo as MarqueeInspector,
153
- Se as MarqueeItemNode,
154
- ve as MarqueeNode,
155
- Po as NodeElement,
156
- Io as ParagraphInspector,
157
- He as ParagraphNode,
158
- se as ParagraphRenderer,
159
- _e as RootNode,
160
- go as SizeField,
161
- fo as SwiperInspector,
162
- Me as SwiperNode,
163
- Fe as SwiperSlideNode,
164
- we as TabContentNode,
165
- Ee as TabListNode,
166
- Re as TabNode,
167
- ye as TabPanelNode,
168
- To as TabsInspector,
169
- Be as TabsNode,
170
- xo as TextInspector,
171
- Ge as UnknownNode,
172
- bo as UnorderedListInspector,
173
- Ue as UnorderedListNode,
174
- ho as VariantField,
175
- Co as VideoInspector,
176
- ke as VideoNode,
177
- De as defineNode,
178
- qe as getNodeCustom,
179
- Ve as getNodeDisplayName,
180
- je as getNodeInfo,
181
- ze as getNodeRelated,
182
- Je as getNodeResolved,
183
- Ke as isNodeSelectable,
184
- Oe as parseNumber,
185
- Qe as parseSvgString,
186
- We as registerNodeRelated,
187
- Xe as toResponsiveCss,
188
- Lo as useAccordionGroupNodeProps,
189
- Ao as useAccordionNodeProps,
190
- So as useBoxNodeProps,
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
  };
@@ -1,2 +1 @@
1
1
  export * from './accordion-group.node';
2
- export * from './accordion-group.inspector';
@@ -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={{ padding: 16 }}>
70
- <TextNode>Hello</TextNode>
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
- // Container với responsive padding
78
+ // Responsive padding
85
79
  <BoxNode
86
- container
87
80
  sx={{
88
81
  paddingTop: 24,
89
82
  paddingBottom: 24,
@@ -1,2 +1 @@
1
1
  export * from './box.node';
2
- export * from './box.inspector';
@@ -1,2 +1 @@
1
1
  export * from './button.node';
2
- export * from './button.inspector';
@@ -1,2 +1 @@
1
1
  export * from './cell.node';
2
- export * from './cell.inspector';
@@ -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.
@@ -1,2 +1 @@
1
1
  export * from './container.node';
2
- export * from './container.inspector';
@@ -1,2 +1 @@
1
1
  export * from './countdown-timer.node';
2
- export * from './countdown-timer.inspector';
@@ -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
@@ -1,2 +1 @@
1
1
  export * from './flex-item.node';
2
- export * from './flex-item.inspector';
@@ -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