@janbox/storefront-builder 2.0.21 → 2.0.23
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/editor.js +3 -3
- package/dist/{index-DYjYzzu9.js → index-BBoR6Gy_.js} +1 -1
- package/dist/index-BPG8gpQT.js +4 -0
- package/dist/index.js +3 -3
- package/dist/lib/box/README.md +8 -0
- package/dist/lib/button/README.md +11 -17
- package/dist/lib/cell/README.md +2 -1
- package/dist/lib/container/README.md +8 -0
- package/dist/lib/flex-item/README.md +7 -1
- package/dist/lib/flexbox/README.md +8 -0
- package/dist/lib/grid/README.md +4 -3
- package/dist/lib/link/README.md +1 -1
- package/dist/lib/tab/README.md +2 -2
- package/dist/lib/tab-list/README.md +3 -3
- package/dist/templates/sections/about/index.d.ts +2 -0
- package/dist/templates/sections/brand-story/index.d.ts +2 -0
- package/dist/templates/sections/index.d.ts +2 -0
- package/dist/templates.js +938 -74
- package/dist/{toaster-1qwGcpRC.js → toaster-DMjFxzB_.js} +17 -21
- package/package.json +1 -1
- package/dist/index-CTOgorCO.js +0 -4
package/dist/editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n, jsxs as w, Fragment as Fe } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { at as ft, au as bt, av as wt, aw as b, ax as kt, ay as ce, az as $, aA as fe, b as Te, B as Ie, a1 as mt, aB as J, aC as Oe, aD as Ct, aE as W, aF as I, as as He, ar as vt, aG as xt, aH as yt, aI as Tt, aJ as It, aK as Mt, aL as St, aM as Et, aN as $e, aO as Lt, aP as Wt, aQ as Nt, aR as Rt, aS as At, u as H, aT as Dt, aU as Bt, aV as oe, m as Pt, i as jt, G as Vt, l as Me, o as Ft, F as Se, s as Ot, V as Ht, I as $t, aW as _t, q as Gt, P as zt, aX as _e, aY as Ut, aZ as Zt, a_ as Yt, a$ as Xt, b0 as qt, b1 as _, b2 as Ge, b3 as Jt, b4 as Kt, b5 as ze, b6 as Qt, b7 as en, b8 as tn, a0 as Ue, Z as Ze, b9 as Ee, ba as nn, N as ke, bb as rn, bc as on, bd as sn, $ as an, be as Le, bf as cn } from "./toaster-
|
|
3
|
-
import { bg as So, bh as Eo, bi as Lo, bj as Wo, bk as No, bl as Ro, bm as Ao, bn as Do, bo as Bo, bp as Po, bq as jo, br as Vo, bs as Fo, bt as Oo, bu as Ho, bv as $o, bw as _o, bx as Go, by as zo, bz as Uo, bA as Zo, bB as Yo, bC as Xo, bD as qo, bE as Jo, bF as Ko, bG as Qo, bH as es, bI as ts, bJ as ns, bK as rs, bL as os, bM as ss, bN as is, bO as as, bP as cs, bQ as ls, bR as ds, bS as hs, bT as us, bU as ps, bV as gs, bW as fs, bX as bs, bY as ws, bZ as ks, b_ as ms, b$ as Cs, c0 as vs, c1 as xs, c2 as ys, c3 as Ts, W as Is, c4 as Ms, c5 as Ss, c6 as Es, c7 as Ls, c8 as Ws } from "./toaster-
|
|
2
|
+
import { at as ft, au as bt, av as wt, aw as b, ax as kt, ay as ce, az as $, aA as fe, b as Te, B as Ie, a1 as mt, aB as J, aC as Oe, aD as Ct, aE as W, aF as I, as as He, ar as vt, aG as xt, aH as yt, aI as Tt, aJ as It, aK as Mt, aL as St, aM as Et, aN as $e, aO as Lt, aP as Wt, aQ as Nt, aR as Rt, aS as At, u as H, aT as Dt, aU as Bt, aV as oe, m as Pt, i as jt, G as Vt, l as Me, o as Ft, F as Se, s as Ot, V as Ht, I as $t, aW as _t, q as Gt, P as zt, aX as _e, aY as Ut, aZ as Zt, a_ as Yt, a$ as Xt, b0 as qt, b1 as _, b2 as Ge, b3 as Jt, b4 as Kt, b5 as ze, b6 as Qt, b7 as en, b8 as tn, a0 as Ue, Z as Ze, b9 as Ee, ba as nn, N as ke, bb as rn, bc as on, bd as sn, $ as an, be as Le, bf as cn } from "./toaster-DMjFxzB_.js";
|
|
3
|
+
import { bg as So, bh as Eo, bi as Lo, bj as Wo, bk as No, bl as Ro, bm as Ao, bn as Do, bo as Bo, bp as Po, bq as jo, br as Vo, bs as Fo, bt as Oo, bu as Ho, bv as $o, bw as _o, bx as Go, by as zo, bz as Uo, bA as Zo, bB as Yo, bC as Xo, bD as qo, bE as Jo, bF as Ko, bG as Qo, bH as es, bI as ts, bJ as ns, bK as rs, bL as os, bM as ss, bN as is, bO as as, bP as cs, bQ as ls, bR as ds, bS as hs, bT as us, bU as ps, bV as gs, bW as fs, bX as bs, bY as ws, bZ as ks, b_ as ms, b$ as Cs, c0 as vs, c1 as xs, c2 as ys, c3 as Ts, W as Is, c4 as Ms, c5 as Ss, c6 as Es, c7 as Ls, c8 as Ws } from "./toaster-DMjFxzB_.js";
|
|
4
4
|
import { throttle as ln, isFunction as We, isNumber as se, isNil as ee, isEqual as dn } from "lodash-es";
|
|
5
5
|
import { useImperativeHandle as hn, useMemo as un, isValidElement as pn, useState as P, useRef as z, useEffect as V, Fragment as ie, Suspense as gn, createElement as Ye, useCallback as fn } from "react";
|
|
6
6
|
import "flat";
|
|
@@ -14,7 +14,7 @@ import "@tanstack/react-virtual";
|
|
|
14
14
|
import In, { useFrame as Ce } from "react-frame-component";
|
|
15
15
|
import "react-dropzone";
|
|
16
16
|
import "react-datepicker";
|
|
17
|
-
import { a as rt, C as ot } from "./index-
|
|
17
|
+
import { a as rt, C as ot } from "./index-BBoR6Gy_.js";
|
|
18
18
|
import "@janbox/storefront-ui/utils";
|
|
19
19
|
import { useToggle as st } from "usehooks-ts";
|
|
20
20
|
import "@hello-pangea/dnd";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useMemo as m, useEffect as f } from "react";
|
|
3
|
-
import { u as c, C as v, D as p, a as N, d as h, N as E, g as b, r as D, b as y, B as l } from "./toaster-
|
|
3
|
+
import { u as c, C as v, D as p, a as N, d as h, N as E, g as b, r as D, b as y, B as l } from "./toaster-DMjFxzB_.js";
|
|
4
4
|
import { isNil as u, isString as d } from "lodash-es";
|
|
5
5
|
import "flat";
|
|
6
6
|
const k = ({ children: t, data: e }) => {
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { N as n, c as t } from "./toaster-
|
|
2
|
-
import { A as C, e as L, f as T, h as x, i as S, j as A, k as E, l as w, m as R, n as h, F, o as k, p as q, G as B, H as G, q as H, I as M, s as U, t as y, v as V, L as j, w as D, M as z, x as J, y as K, P as O, R as Q, S as X, z as Y, T as Z, E as _, J as $, K as W, O as ee, U as oe, Q as se, V as ae, X as re, Y as de, Z as te, _ as ne, $ as Ne, g as ue, a0 as ie, a1 as pe, a2 as me, a3 as Pe, a4 as ce, a5 as le, a6 as ge, a7 as be, a8 as fe, a9 as ve, u as Ie, aa as Ce, ab as Le, ac as Te, ad as xe, ae as Se, af as Ae, ag as Ee, ah as we, ai as Re, aj as he, ak as Fe, al as ke, am as qe, an as Be, ao as Ge, ap as He, aq as Me } from "./toaster-
|
|
1
|
+
import { N as n, c as t } from "./toaster-DMjFxzB_.js";
|
|
2
|
+
import { A as C, e as L, f as T, h as x, i as S, j as A, k as E, l as w, m as R, n as h, F, o as k, p as q, G as B, H as G, q as H, I as M, s as U, t as y, v as V, L as j, w as D, M as z, x as J, y as K, P as O, R as Q, S as X, z as Y, T as Z, E as _, J as $, K as W, O as ee, U as oe, Q as se, V as ae, X as re, Y as de, Z as te, _ as ne, $ as Ne, g as ue, a0 as ie, a1 as pe, a2 as me, a3 as Pe, a4 as ce, a5 as le, a6 as ge, a7 as be, a8 as fe, a9 as ve, u as Ie, aa as Ce, ab as Le, ac as Te, ad as xe, ae as Se, af as Ae, ag as Ee, ah as we, ai as Re, aj as he, ak as Fe, al as ke, am as qe, an as Be, ao as Ge, ap as He, aq as Me } from "./toaster-DMjFxzB_.js";
|
|
3
3
|
import "lodash-es";
|
|
4
4
|
import { useRef as N, useEffect as u } from "react";
|
|
5
5
|
import { getTabPanelProps as i, getListItemProps as p } from "@janbox/storefront-ui";
|
|
6
|
-
import { C as ye, a as Ve } from "./index-
|
|
6
|
+
import { C as ye, a as Ve } from "./index-BBoR6Gy_.js";
|
|
7
7
|
const g = ({ enabled: a, onChange: r }) => {
|
|
8
8
|
const { dom: e } = n((s) => ({ dom: s.dom })), o = N(void 0);
|
|
9
9
|
u(() => {
|
package/dist/lib/box/README.md
CHANGED
|
@@ -8,6 +8,14 @@ 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
|
+
| `hidden` | `boolean` | Ẩn node ở breakpoint `xs` (mặc định). Hỗ trợ responsive qua `sm`, `md`, `lg` |
|
|
16
|
+
|
|
17
|
+
`hidden` hỗ trợ responsive: `hidden={true}` ẩn trên mobile, `md={{ hidden: false }}` hiện lại trên desktop.
|
|
18
|
+
|
|
11
19
|
### `sx` props
|
|
12
20
|
|
|
13
21
|
```ts
|
|
@@ -12,7 +12,7 @@ CTA button node dùng component `Button` từ `@janbox/storefront-ui`. Có thể
|
|
|
12
12
|
|
|
13
13
|
| Prop | Type | Description |
|
|
14
14
|
| --- | --- | --- |
|
|
15
|
-
| `
|
|
15
|
+
| `children` | `ReactNode` | Nội dung hiển thị trong button |
|
|
16
16
|
| `color` | `ColorScale` | Màu theme của button |
|
|
17
17
|
| `variant` | `ButtonVariant` | Kiểu hiển thị của button |
|
|
18
18
|
| `size` | `ButtonSizeVariant` | Kích thước button |
|
|
@@ -53,21 +53,14 @@ sx?: {
|
|
|
53
53
|
import { ButtonNode } from '@janbox/storefront-builder';
|
|
54
54
|
|
|
55
55
|
// Button cơ bản
|
|
56
|
-
<ButtonNode
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
size="md"
|
|
60
|
-
dangerouslySetInnerHTML={{ __html: 'Buy now' }}
|
|
61
|
-
/>
|
|
56
|
+
<ButtonNode color="primary" variant="contained" size="md">
|
|
57
|
+
Buy now
|
|
58
|
+
</ButtonNode>
|
|
62
59
|
|
|
63
60
|
// Link button
|
|
64
|
-
<ButtonNode
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
size="lg"
|
|
68
|
-
anchor={{ to: '/checkout', target: '_self' }}
|
|
69
|
-
dangerouslySetInnerHTML={{ __html: 'Checkout' }}
|
|
70
|
-
/>
|
|
61
|
+
<ButtonNode color="primary" variant="contained" size="lg" anchor={{ to: '/checkout', target: '_self' }}>
|
|
62
|
+
Checkout
|
|
63
|
+
</ButtonNode>
|
|
71
64
|
|
|
72
65
|
// Responsive size + width
|
|
73
66
|
<ButtonNode
|
|
@@ -83,12 +76,13 @@ import { ButtonNode } from '@janbox/storefront-builder';
|
|
|
83
76
|
marginTop: 24,
|
|
84
77
|
},
|
|
85
78
|
}}
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
>
|
|
80
|
+
View products
|
|
81
|
+
</ButtonNode>
|
|
88
82
|
```
|
|
89
83
|
|
|
90
84
|
## Rules
|
|
91
85
|
|
|
92
86
|
- **Canvas**: no — không chứa node con.
|
|
93
87
|
- Khi editor đang bật, `anchor` bị unset lúc render để tránh navigate trong canvas.
|
|
94
|
-
- Nội dung button được chỉnh qua `
|
|
88
|
+
- Nội dung button được chỉnh qua prop `children` trong inspector.
|
package/dist/lib/cell/README.md
CHANGED
|
@@ -13,8 +13,9 @@ Một ô (column) trong `GridNode`. Hỗ trợ `colSpan` để chiếm nhiều c
|
|
|
13
13
|
| Prop | Type | Description |
|
|
14
14
|
| --- | --- | --- |
|
|
15
15
|
| `colSpan` | `number` | Số cột mà cell chiếm (`grid-column: span colSpan`) |
|
|
16
|
+
| `hidden` | `boolean` | Ẩn node ở breakpoint `xs` (mặc định). Hỗ trợ responsive qua `sm`, `md`, `lg` |
|
|
16
17
|
|
|
17
|
-
`colSpan` hỗ trợ responsive: `colSpan={1}` cho mobile, `md={{ colSpan: 2 }}` cho desktop.
|
|
18
|
+
`colSpan` và `hidden` hỗ trợ responsive: `colSpan={1}` cho mobile, `md={{ colSpan: 2 }}` cho desktop. `hidden={true}` ẩn trên mobile, `md={{ hidden: false }}` hiện lại trên desktop.
|
|
18
19
|
|
|
19
20
|
### `sx` props
|
|
20
21
|
|
|
@@ -8,6 +8,14 @@ Block container có max-width cố định, căn giữa theo chiều ngang. Dùn
|
|
|
8
8
|
|
|
9
9
|
## Configurable props
|
|
10
10
|
|
|
11
|
+
### Top-level props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Description |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `hidden` | `boolean` | Ẩn node ở breakpoint `xs` (mặc định). Hỗ trợ responsive qua `sm`, `md`, `lg` |
|
|
16
|
+
|
|
17
|
+
`hidden` hỗ trợ responsive: `hidden={true}` ẩn trên mobile, `md={{ hidden: false }}` hiện lại trên desktop.
|
|
18
|
+
|
|
11
19
|
### `sx` props
|
|
12
20
|
|
|
13
21
|
```ts
|
|
@@ -8,7 +8,13 @@ Một item trong `FlexboxNode`. Kiểm soát kích thước, grow/shrink, thứ
|
|
|
8
8
|
|
|
9
9
|
## Configurable props
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Top-level props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Description |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `hidden` | `boolean` | Ẩn node ở breakpoint `xs` (mặc định). Hỗ trợ responsive qua `sm`, `md`, `lg` |
|
|
16
|
+
|
|
17
|
+
`hidden` hỗ trợ responsive: `hidden={true}` ẩn trên mobile, `md={{ hidden: false }}` hiện lại trên desktop.
|
|
12
18
|
|
|
13
19
|
### `sx` props
|
|
14
20
|
|
|
@@ -8,6 +8,14 @@ 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
|
+
| `hidden` | `boolean` | Ẩn node ở breakpoint `xs` (mặc định). Hỗ trợ responsive qua `sm`, `md`, `lg` |
|
|
16
|
+
|
|
17
|
+
`hidden` hỗ trợ responsive: `hidden={true}` ẩn trên mobile, `md={{ hidden: false }}` hiện lại trên desktop.
|
|
18
|
+
|
|
11
19
|
### `sx` props
|
|
12
20
|
|
|
13
21
|
```ts
|
package/dist/lib/grid/README.md
CHANGED
|
@@ -15,9 +15,10 @@ Props mà user có thể chỉnh trong editor inspector.
|
|
|
15
15
|
| Prop | Type | Description |
|
|
16
16
|
| --- | --- | --- |
|
|
17
17
|
| `cols` | `number` | Số cột — generates `grid-template-columns: repeat(cols, minmax(0, 1fr))` |
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
18
|
+
| `hidden` | `boolean` | Ẩn node ở breakpoint `xs` (mặc định). Hỗ trợ responsive qua `sm`, `md`, `lg` |
|
|
19
|
+
| `sm` | `{ cols?: number, hidden?: boolean }` | Override tại breakpoint sm |
|
|
20
|
+
| `md` | `{ cols?: number, hidden?: boolean }` | Override tại breakpoint md |
|
|
21
|
+
| `lg` | `{ cols?: number, hidden?: boolean }` | Override tại breakpoint lg |
|
|
21
22
|
|
|
22
23
|
### `sx` props
|
|
23
24
|
|
package/dist/lib/link/README.md
CHANGED
|
@@ -103,7 +103,7 @@ import { LinkNode } from '@janbox/storefront-builder';
|
|
|
103
103
|
## Rules
|
|
104
104
|
|
|
105
105
|
- **Canvas**: yes — chứa node con.
|
|
106
|
-
- **canMoveIn**: bị block khi prop `
|
|
106
|
+
- **canMoveIn**: bị block khi prop `children` đang có nội dung inline.
|
|
107
107
|
- Editor preview: click bị `preventDefault` khi editor đang bật để tránh navigate.
|
|
108
108
|
|
|
109
109
|
## Related nodes
|
package/dist/lib/tab/README.md
CHANGED
|
@@ -12,14 +12,14 @@ Tab header button — click để switch giữa các panels.
|
|
|
12
12
|
|
|
13
13
|
| Prop | Type | Description |
|
|
14
14
|
| --- | --- | --- |
|
|
15
|
-
| `
|
|
15
|
+
| `children` | `ReactNode` | Text hiển thị trong tab button |
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
20
|
import { TabNode } from '@janbox/storefront-builder';
|
|
21
21
|
|
|
22
|
-
<TabNode
|
|
22
|
+
<TabNode>Overview</TabNode>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Rules
|
|
@@ -16,9 +16,9 @@ Không có props riêng. Styling được control qua parent `TabsNode`.
|
|
|
16
16
|
import { TabListNode, TabNode } from '@janbox/storefront-builder';
|
|
17
17
|
|
|
18
18
|
<TabListNode>
|
|
19
|
-
<TabNode
|
|
20
|
-
<TabNode
|
|
21
|
-
<TabNode
|
|
19
|
+
<TabNode>Tab 1</TabNode>
|
|
20
|
+
<TabNode>Tab 2</TabNode>
|
|
21
|
+
<TabNode>Tab 3</TabNode>
|
|
22
22
|
</TabListNode>
|
|
23
23
|
```
|
|
24
24
|
|