@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 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-1qwGcpRC.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-1qwGcpRC.js";
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-DYjYzzu9.js";
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-1qwGcpRC.js";
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 }) => {
@@ -0,0 +1,4 @@
1
+ import { W as p } from "./toaster-DMjFxzB_.js";
2
+ export {
3
+ p as WbTooltip
4
+ };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { N as n, c as t } from "./toaster-1qwGcpRC.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-1qwGcpRC.js";
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-DYjYzzu9.js";
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(() => {
@@ -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
- | `dangerouslySetInnerHTML.__html` | `string` | Text hiển thị trong button |
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
- color="primary"
58
- variant="contained"
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
- color="primary"
66
- variant="contained"
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
- dangerouslySetInnerHTML={{ __html: 'View products' }}
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 `dangerouslySetInnerHTML.__html` trong inspector.
88
+ - Nội dung button được chỉnh qua prop `children` trong inspector.
@@ -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
- Tất cả props nằm trong `sx`. Không có top-level prop riêng.
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
@@ -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
- | `sm` | `{ cols?: number }` | Override `cols` tại breakpoint sm |
19
- | `md` | `{ cols?: number }` | Override `cols` tại breakpoint md |
20
- | `lg` | `{ cols?: number }` | Override `cols` tại breakpoint lg |
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
 
@@ -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 `dangerouslySetInnerHTML` đang được dùng.
106
+ - **canMoveIn**: bị block khi prop `children` đang 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
@@ -12,14 +12,14 @@ Tab header button — click để switch giữa các panels.
12
12
 
13
13
  | Prop | Type | Description |
14
14
  | --- | --- | --- |
15
- | `dangerouslySetInnerHTML.__html` | `string` | Text hiển thị trong tab button |
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 dangerouslySetInnerHTML={{ __html: 'Overview' }} />
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 dangerouslySetInnerHTML={{ __html: 'Tab 1' }} />
20
- <TabNode dangerouslySetInnerHTML={{ __html: 'Tab 2' }} />
21
- <TabNode dangerouslySetInnerHTML={{ __html: 'Tab 3' }} />
19
+ <TabNode>Tab 1</TabNode>
20
+ <TabNode>Tab 2</TabNode>
21
+ <TabNode>Tab 3</TabNode>
22
22
  </TabListNode>
23
23
  ```
24
24
 
@@ -0,0 +1,2 @@
1
+ import { InsertTemplateGroup } from '../../../editor';
2
+ export declare const ABOUT_SECTION_GROUP: InsertTemplateGroup;
@@ -0,0 +1,2 @@
1
+ import { InsertTemplateGroup } from '../../../editor';
2
+ export declare const BRAND_STORY_SECTION_GROUP: InsertTemplateGroup;
@@ -1,3 +1,5 @@
1
1
  export * from './hero';
2
2
  export * from './faqs';
3
3
  export * from './guarantee';
4
+ export * from './brand-story';
5
+ export * from './about';