@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
@@ -1,2 +1 @@
1
1
  export * from './flexbox.node';
2
- export * from './flexbox.inspector';
@@ -8,14 +8,16 @@ A CSS Grid container node. Accepts only `CellNode` children — the editor enfor
8
8
 
9
9
  ## Configurable props
10
10
 
11
- Props mà user có thể chỉnh trong editor inspector. Tất cả đều hỗ trợ responsive trừ `container`.
11
+ Props mà user có thể chỉnh trong editor inspector.
12
12
 
13
13
  ### Top-level props
14
14
 
15
15
  | Prop | Type | Description |
16
16
  | --- | --- | --- |
17
17
  | `cols` | `number` | Số cột — generates `grid-template-columns: repeat(cols, minmax(0, 1fr))` |
18
- | `container` | `boolean` | Bật max-width container constraint |
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 |
19
21
 
20
22
  ### `sx` props
21
23
 
@@ -108,9 +110,8 @@ import { GridNode, CellNode } from '@janbox/storefront-builder';
108
110
  <CellNode>...</CellNode>
109
111
  </GridNode>
110
112
 
111
- // Container với background
113
+ // Grid với background
112
114
  <GridNode
113
- container
114
115
  cols={2}
115
116
  sx={{
116
117
  backgroundColor: '#f5f5f5',
@@ -1,2 +1 @@
1
1
  export * from './grid.node';
2
- export * from './grid.inspector';
@@ -1,6 +1,6 @@
1
1
  # HeadingNode
2
2
 
3
- Text node dành cho tiêu đề. Dùng chung `TextInspector` với `TextNode` nhưng giới hạn tag trong `h1`–`h6` và `div`.
3
+ Text node dành cho tiêu đề. Render qua component `Text` từ `@janbox/storefront-ui`.
4
4
 
5
5
  ## Resolved name
6
6
 
@@ -8,20 +8,51 @@ Text node dành cho tiêu đề. Dùng chung `TextInspector` với `TextNode` nh
8
8
 
9
9
  ## Configurable props
10
10
 
11
- Giống hệt `TextNode`. Xem chi tiết tại [TextNode](../text/README.md#configurable-props).
11
+ ### Top-level props
12
12
 
13
- ### Điểm khác biệt
14
-
15
- | Prop | Giá trị cho phép | Default |
13
+ | Prop | Type | Description |
16
14
  | --- | --- | --- |
17
- | `as` | `'h1' \| 'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6' \| 'div'` | `'p'` (từ Text) |
15
+ | `as` | `'h1' \| 'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6' \| 'div'` | HTML tag (chọn qua inspector) |
16
+ | `sizeVariant` | `TypographySizeVariant` | Kích cỡ typography (responsive) |
17
+
18
+ ### `sx` props
19
+
20
+ ```ts
21
+ sx?: {
22
+ // typography
23
+ color?: string
24
+ fontStyle?: 'normal' | 'italic'
25
+ fontWeight?: number | string
26
+ textDecorationLine?: 'none' | 'underline' | 'line-through'
27
+ textAlign?: 'left' | 'center' | 'right' | 'justify'
28
+ textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize'
29
+
30
+ // size
31
+ width?: number | string
32
+
33
+ // spacing
34
+ paddingTop?: number
35
+ paddingRight?: number
36
+ paddingBottom?: number
37
+ paddingLeft?: number
38
+ marginTop?: number
39
+ marginRight?: number
40
+ marginBottom?: number
41
+ marginLeft?: number
42
+
43
+ // responsive overrides
44
+ sm?: { /* same keys above */ }
45
+ md?: { /* same keys above */ }
46
+ lg?: { /* same keys above */ }
47
+ }
48
+ ```
18
49
 
19
50
  ## Usage
20
51
 
21
52
  ```tsx
22
53
  import { HeadingNode } from '@janbox/storefront-builder';
23
54
 
24
- // H1 mặc định
55
+ // H1
25
56
  <HeadingNode as="h1" sizeVariant="4xl">
26
57
  Page Title
27
58
  </HeadingNode>
@@ -49,5 +80,4 @@ import { HeadingNode } from '@janbox/storefront-builder';
49
80
 
50
81
  ## Related nodes
51
82
 
52
- - [`TextNode`](../text/README.md) — base component dùng chung inspector
53
83
  - [`ParagraphNode`](../paragraph/README.md) — dành cho nội dung dạng đoạn văn
@@ -1,4 +1,2 @@
1
1
  export * from './heading.node';
2
- export * from './heading.inspector';
3
2
  export * from './heading';
4
- export * from './heading.renderer';
@@ -1,2 +1 @@
1
1
  export * from './icon.node';
2
- export * from './icon.inspector';
@@ -1,2 +1 @@
1
1
  export * from './image.node';
2
- export * from './image.inspector';
@@ -6,7 +6,6 @@ export * from './link';
6
6
  export * from './button';
7
7
  export * from './flexbox';
8
8
  export * from './flex-item';
9
- export * from './text';
10
9
  export * from './paragraph';
11
10
  export * from './heading';
12
11
  export * from './image';
@@ -1,2 +1 @@
1
1
  export * from './link.node';
2
- export * from './link.inspector';
@@ -1,2 +1 @@
1
1
  export * from './marquee.node';
2
- export * from './marquee.inspector';
@@ -1,6 +1,6 @@
1
1
  # ParagraphNode
2
2
 
3
- Text node dành cho đoạn văn bản. Dùng chung `TextInspector` với `TextNode` nhưng không cho phép đổi tag — luôn render ra `p`.
3
+ Text node dành cho đoạn văn bản. Render qua component `Text` từ `@janbox/storefront-ui`.
4
4
 
5
5
  ## Resolved name
6
6
 
@@ -8,13 +8,18 @@ Text node dành cho đoạn văn bản. Dùng chung `TextInspector` với `TextN
8
8
 
9
9
  ## Configurable props
10
10
 
11
- Giống hệt `TextNode` ngoại trừ prop `as` bị loại bỏ. Xem chi tiết tại [TextNode](../text/README.md#configurable-props).
11
+ ### Top-level props
12
+
13
+ | Prop | Type | Description |
14
+ | --- | --- | --- |
15
+ | `as` | `'p' \| 'div'` | HTML tag (chọn qua inspector) |
16
+ | `sizeVariant` | `TypographySizeVariant` | Kích cỡ typography (responsive) |
12
17
 
13
18
  ### `sx` props
14
19
 
15
20
  ```ts
16
21
  sx?: {
17
- // typography (áp dụng toàn breakpoint — không responsive)
22
+ // typography
18
23
  color?: string
19
24
  fontStyle?: 'normal' | 'italic'
20
25
  fontWeight?: number | string
@@ -74,9 +79,8 @@ import { ParagraphNode } from '@janbox/storefront-builder';
74
79
 
75
80
  - **Canvas**: no — không chứa node con.
76
81
  - **Inline editing**: có thể double-click để chỉnh nội dung trong canvas.
77
- - **Tag**: cố định `p`, không thể đổi.
82
+ - **Tag**: chọn qua inspector, giới hạn `p` hoặc `div`.
78
83
 
79
84
  ## Related nodes
80
85
 
81
- - [`TextNode`](../text/README.md) — base component dùng chung inspector
82
86
  - [`HeadingNode`](../heading/README.md) — dành cho tiêu đề với tag `h1`–`h6`
@@ -1,3 +1 @@
1
1
  export * from './paragraph.node';
2
- export * from './paragraph.inspector';
3
- export * from './paragraph.renderer';
@@ -1,2 +1,2 @@
1
- import { ParagraphProps } from '../paragraph/types';
2
- export type ParagraphNodeProps = ParagraphProps;
1
+ import { TextProps } from '@janbox/storefront-ui';
2
+ export type ParagraphNodeProps = TextProps;
@@ -1,2 +1 @@
1
1
  export * from './swiper.node';
2
- export * from './swiper.inspector';
@@ -1,2 +1 @@
1
1
  export * from './tabs.node';
2
- export * from './tabs.inspector';
@@ -1,2 +1 @@
1
1
  export * from './unordered-list.node';
2
- export * from './unordered-list.inspector';
@@ -1,2 +1 @@
1
1
  export * from './video.node';
2
- export * from './video.inspector';
@@ -0,0 +1,4 @@
1
+ const t = '<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19,13H5a1,1,0,0,1,0-2H19a1,1,0,0,1,0,2Z"></path></svg>';
2
+ export {
3
+ t as M
4
+ };
package/dist/templates.js CHANGED
@@ -1,30 +1,14 @@
1
1
  import { jsx as e, jsxs as o, Fragment as c } from "@emotion/react/jsx-runtime";
2
2
  import { getColorVar as u } from "@janbox/storefront-ui/theme";
3
3
  import { renderToString as p } from "react-dom/server";
4
- import { C as s, G as h, a, H as d, P as t, B as x, I as g, A as f, M as T, b as y, c as n, d as r, e as i } from "./dataset-DQ21hyBo.js";
4
+ import { f as s, G as h, e as a, i as d, P as t, d as x, j as g, a as f, Q as T, b as n, c as r, A as i } from "./countdown-timer.node-d0EtGQ4_.js";
5
5
  import "@craftjs/core";
6
6
  import "lodash-es";
7
7
  import "react";
8
8
  import "flat";
9
9
  import "@janbox/storefront-ui";
10
- import "@janbox/storefront-ui/utils";
11
- import "@janbox/storefront-ui/hooks";
12
- import "@emotion/react";
13
- import "@floating-ui/react";
14
- import "react-use";
15
- import "react-colorful";
16
- import "overlayscrollbars-react";
17
- import "@tanstack/react-virtual";
18
- import "react-dropzone";
19
- import "react-datepicker";
20
- import "@tiptap/extension-text-style";
21
- import "@tiptap/react";
22
- import "@tiptap/react/menus";
23
- import "@tiptap/starter-kit";
24
- import "react-frame-component";
25
- import "@hello-pangea/dnd";
26
- import "usehooks-ts";
27
- const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ import { M as y } from "./minus-BrRnjbhB.js";
11
+ const l = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
28
12
  <path d="M17.0021 19.5031H3.99667" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
29
13
  <path d="M8.99875 14.5012H3.99667" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
30
14
  <path d="M8.99875 9.49874H3.99667" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -32,9 +16,9 @@ const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="ht
32
16
  <path d="M19.0029 8.97259C20.3915 10.3612 20.3915 12.6121 19.0029 14.0007C17.6143 15.3893 15.3634 15.3893 13.9748 14.0007C12.5862 12.6121 12.5862 10.3612 13.9748 8.97259C15.3634 7.58401 17.6143 7.58401 19.0029 8.97259" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
33
17
  <path fill-rule="evenodd" clip-rule="evenodd" d="M21.0037 16.0018L19.0029 14.001L21.0037 16.0018Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
34
18
  </svg>
35
- `, Z = {
19
+ `, N = {
36
20
  name: "Hero",
37
- icon: { source: m },
21
+ icon: { source: l },
38
22
  templates: [
39
23
  {
40
24
  template: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ o(
@@ -132,9 +116,9 @@ const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="ht
132
116
  ) })
133
117
  }
134
118
  ]
135
- }, $ = {
119
+ }, V = {
136
120
  name: "FAQs",
137
- icon: { source: m },
121
+ icon: { source: l },
138
122
  templates: [
139
123
  {
140
124
  template: /* @__PURE__ */ o(s, { children: [
@@ -177,8 +161,8 @@ const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="ht
177
161
  expandIcon: {
178
162
  position: "right",
179
163
  source: {
180
- expanded: y,
181
- collapsed: T
164
+ expanded: T,
165
+ collapsed: y
182
166
  }
183
167
  }
184
168
  },
@@ -326,9 +310,9 @@ const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="ht
326
310
  image: "https://ucarecdn.com/8a7a086c-1ef5-43a9-a036-daaf1f15a9f1/-/format/auto/",
327
311
  title: "Secure Online Payment"
328
312
  }
329
- ], J = {
313
+ ], q = {
330
314
  name: "Guarantee",
331
- icon: { source: m },
315
+ icon: { source: l },
332
316
  templates: [
333
317
  {
334
318
  template: /* @__PURE__ */ o(s, { children: [
@@ -388,7 +372,7 @@ const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="ht
388
372
  md: {
389
373
  cols: 4
390
374
  },
391
- children: S.map((l, _) => /* @__PURE__ */ o(a, { children: [
375
+ children: S.map((m, _) => /* @__PURE__ */ o(a, { children: [
392
376
  /* @__PURE__ */ e(
393
377
  g,
394
378
  {
@@ -397,14 +381,14 @@ const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="ht
397
381
  marginLeft: "auto",
398
382
  marginRight: "auto"
399
383
  },
400
- src: l.image
384
+ src: m.image
401
385
  }
402
386
  ),
403
387
  /* @__PURE__ */ e(
404
388
  t,
405
389
  {
406
390
  dangerouslySetInnerHTML: {
407
- __html: l.title
391
+ __html: m.title
408
392
  },
409
393
  sizeVariant: "lg",
410
394
  sx: {
@@ -422,7 +406,7 @@ const m = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="ht
422
406
  ]
423
407
  };
424
408
  export {
425
- $ as FAQS_SECTION_GROUP,
426
- J as GUARANTEE_SECTION_GROUP,
427
- Z as HERO_SECTION_GROUP
409
+ V as FAQS_SECTION_GROUP,
410
+ q as GUARANTEE_SECTION_GROUP,
411
+ N as HERO_SECTION_GROUP
428
412
  };
@@ -4,7 +4,7 @@ import { useFloating as P, autoUpdate as S, flip as j, offset as V, size as W, a
4
4
  import { get as L } from "lodash-es";
5
5
  import { FLOATING_Z_INDEX as U } from "@janbox/storefront-ui/theme";
6
6
  import { useControllableState as X } from "@janbox/storefront-ui/hooks";
7
- import { t as o } from "./dataset-DQ21hyBo.js";
7
+ import { t as o } from "./countdown-timer.node-d0EtGQ4_.js";
8
8
  const Y = ({ placement: d = "top", open: p, onOpenChange: c, children: e, content: m }) => {
9
9
  const [n, u] = X({
10
10
  defaultValue: !1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janbox/storefront-builder",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Standalone storefront builder library extracted from craft-layers-portal",
5
5
  "type": "module",
6
6
  "files": [
@@ -50,7 +50,6 @@
50
50
  "react-datepicker": "^8.8.0",
51
51
  "react-dropzone": "^14.2.3",
52
52
  "react-frame-component": "^5.2.7",
53
- "react-use": "^17.5.1",
54
53
  "usehooks-ts": "^3.1.1"
55
54
  },
56
55
  "devDependencies": {