@janbox/storefront-builder 2.0.24 → 2.0.26

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 (127) hide show
  1. package/dist/components/composer/composer.d.ts +4 -0
  2. package/dist/components/composer/dataset.d.ts +2 -0
  3. package/dist/components/composer/index.d.ts +1 -4
  4. package/dist/{index-BBoR6Gy_.js → composer-DBRKIqu7.js} +1 -1
  5. package/dist/constants/index.d.ts +2 -0
  6. package/dist/editor/components/image-gallery-dialog.d.ts +9 -0
  7. package/dist/editor/components/image-source-selection.d.ts +3 -2
  8. package/dist/editor/components/index.d.ts +1 -0
  9. package/dist/editor/hooks/use-editor.d.ts +3 -0
  10. package/dist/editor/lib/index.d.ts +4 -1
  11. package/dist/editor/related/button/index.d.ts +1 -0
  12. package/dist/editor/related/count-up/count-up.inspector/count-up.inspector.d.ts +1 -0
  13. package/dist/editor/related/count-up/count-up.inspector/index.d.ts +1 -0
  14. package/dist/editor/related/image/index.d.ts +1 -0
  15. package/dist/editor/related/rating/rating.inspector/index.d.ts +1 -0
  16. package/dist/editor/related/rating/rating.inspector/rating.inspector.d.ts +1 -0
  17. package/dist/editor/types/index.d.ts +11 -0
  18. package/dist/editor/ui/cascader/cascader.d.ts +41 -0
  19. package/dist/editor/ui/cascader/index.d.ts +1 -0
  20. package/dist/editor/ui/date-picker/date-picker.d.ts +7 -18
  21. package/dist/editor/ui/index.d.ts +1 -0
  22. package/dist/editor.js +1112 -968
  23. package/dist/hooks/use-toggle.d.ts +2 -0
  24. package/dist/index-CpLNXUi2.js +4 -0
  25. package/dist/index.js +66 -60
  26. package/dist/lib/count-up/README.md +129 -0
  27. package/dist/lib/count-up/count-up.node/count-up.node.d.ts +2 -0
  28. package/dist/lib/count-up/count-up.node/helpers.d.ts +3 -0
  29. package/dist/lib/count-up/count-up.node/index.d.ts +3 -0
  30. package/dist/lib/count-up/count-up.node/types.d.ts +2 -0
  31. package/dist/lib/count-up/index.d.ts +1 -0
  32. package/dist/lib/icon/README.md +9 -18
  33. package/dist/lib/index.d.ts +2 -0
  34. package/dist/lib/inline/index.d.ts +0 -1
  35. package/dist/lib/rating/README.md +126 -0
  36. package/dist/lib/rating/index.d.ts +2 -0
  37. package/dist/lib/rating/rating/helpers.d.ts +4 -0
  38. package/dist/lib/rating/rating/index.d.ts +3 -0
  39. package/dist/lib/rating/rating/rating.d.ts +2 -0
  40. package/dist/lib/rating/rating/types.d.ts +10 -0
  41. package/dist/lib/rating/rating.node/helpers.d.ts +3 -0
  42. package/dist/lib/rating/rating.node/index.d.ts +3 -0
  43. package/dist/lib/rating/rating.node/rating.node.d.ts +2 -0
  44. package/dist/lib/rating/rating.node/types.d.ts +2 -0
  45. package/dist/style.css +1 -1
  46. package/dist/templates/sections/brand-story/about-story.d.ts +2 -0
  47. package/dist/templates/sections/hero/notebook-hero.d.ts +2 -0
  48. package/dist/templates/sections/index.d.ts +1 -0
  49. package/dist/templates/sections/testimonial/before-after.d.ts +2 -0
  50. package/dist/templates/sections/testimonial/index.d.ts +2 -0
  51. package/dist/templates.js +816 -204
  52. package/dist/{toaster-DMjFxzB_.js → toaster-Bx7Helq-.js} +10146 -9626
  53. package/dist/utils/internal.d.ts +0 -0
  54. package/package.json +4 -7
  55. package/dist/index-BPG8gpQT.js +0 -4
  56. /package/dist/{lib → editor/related}/accordion-group/accordion-group.inspector/accordion-group.inspector.d.ts +0 -0
  57. /package/dist/{lib → editor/related}/accordion-group/accordion-group.inspector/accordion-items-field.d.ts +0 -0
  58. /package/dist/{lib → editor/related}/accordion-group/accordion-group.inspector/expand-icon-field.d.ts +0 -0
  59. /package/dist/{lib → editor/related}/accordion-group/accordion-group.inspector/index.d.ts +0 -0
  60. /package/dist/{lib → editor/related}/accordion-group/accordion-group.inspector/open-mode-field.d.ts +0 -0
  61. /package/dist/{lib → editor/related}/box/box.inspector/box.inspector.d.ts +0 -0
  62. /package/dist/{lib → editor/related}/box/box.inspector/index.d.ts +0 -0
  63. /package/dist/{lib → editor/related}/button/button.inspector/button.inspector.d.ts +0 -0
  64. /package/dist/{lib → editor/related}/button/button.inspector/index.d.ts +0 -0
  65. /package/dist/{lib → editor/related}/button/button.inspector/link-field.d.ts +0 -0
  66. /package/dist/{lib → editor/related}/button/button.inspector/size-field.d.ts +0 -0
  67. /package/dist/{lib → editor/related}/button/button.inspector/variant-field.d.ts +0 -0
  68. /package/dist/{lib → editor/related}/cell/cell.inspector/cell.inspector.d.ts +0 -0
  69. /package/dist/{lib → editor/related}/cell/cell.inspector/col-span-field.d.ts +0 -0
  70. /package/dist/{lib → editor/related}/cell/cell.inspector/index.d.ts +0 -0
  71. /package/dist/{lib → editor/related}/container/container.inspector/container.inspector.d.ts +0 -0
  72. /package/dist/{lib → editor/related}/container/container.inspector/index.d.ts +0 -0
  73. /package/dist/{lib → editor/related}/countdown-timer/countdown-timer.inspector/caption-style-fields.d.ts +0 -0
  74. /package/dist/{lib → editor/related}/countdown-timer/countdown-timer.inspector/countdown-timer.inspector.d.ts +0 -0
  75. /package/dist/{lib → editor/related}/countdown-timer/countdown-timer.inspector/index.d.ts +0 -0
  76. /package/dist/{lib → editor/related}/countdown-timer/countdown-timer.inspector/time-style-fields.d.ts +0 -0
  77. /package/dist/{lib → editor/related}/countdown-timer/countdown-timer.inspector/unit-item-style-fields.d.ts +0 -0
  78. /package/dist/{lib → editor/related}/countdown-timer/countdown-timer.inspector/units-field.d.ts +0 -0
  79. /package/dist/{lib → editor/related}/flex-item/flex-item.inspector/auto-grow-field.d.ts +0 -0
  80. /package/dist/{lib → editor/related}/flex-item/flex-item.inspector/auto-shrink-field.d.ts +0 -0
  81. /package/dist/{lib → editor/related}/flex-item/flex-item.inspector/flex-item.inspector.d.ts +0 -0
  82. /package/dist/{lib → editor/related}/flex-item/flex-item.inspector/index.d.ts +0 -0
  83. /package/dist/{lib → editor/related}/flexbox/flexbox.inspector/direction-field.d.ts +0 -0
  84. /package/dist/{lib → editor/related}/flexbox/flexbox.inspector/flexbox.inspector.d.ts +0 -0
  85. /package/dist/{lib → editor/related}/flexbox/flexbox.inspector/index.d.ts +0 -0
  86. /package/dist/{lib → editor/related}/grid/grid.inspector/grid.inspector.d.ts +0 -0
  87. /package/dist/{lib → editor/related}/grid/grid.inspector/index.d.ts +0 -0
  88. /package/dist/{lib → editor/related}/heading/heading.inspector/heading.inspector.d.ts +0 -0
  89. /package/dist/{lib → editor/related}/heading/heading.inspector/index.d.ts +0 -0
  90. /package/dist/{lib → editor/related}/heading/heading.toolbar/heading.toolbar.d.ts +0 -0
  91. /package/dist/{lib → editor/related}/heading/heading.toolbar/index.d.ts +0 -0
  92. /package/dist/{lib → editor/related}/icon/icon.inspector/icon.inspector.d.ts +0 -0
  93. /package/dist/{lib → editor/related}/icon/icon.inspector/index.d.ts +0 -0
  94. /package/dist/{lib → editor/related}/image/image.inspector/alt-text-field.d.ts +0 -0
  95. /package/dist/{lib → editor/related}/image/image.inspector/image.inspector.d.ts +0 -0
  96. /package/dist/{lib → editor/related}/image/image.inspector/index.d.ts +0 -0
  97. /package/dist/{lib → editor/related}/image/image.inspector/preload-field.d.ts +0 -0
  98. /package/dist/{lib → editor/related}/image/image.inspector/proportion-field.d.ts +0 -0
  99. /package/dist/{lib → editor/related}/image/image.inspector/source-field.d.ts +0 -0
  100. /package/dist/{lib → editor/related}/inline/inline.inspector/index.d.ts +0 -0
  101. /package/dist/{lib → editor/related}/inline/inline.inspector/inline.inspector.d.ts +0 -0
  102. /package/dist/{lib → editor/related}/link/link.inspector/destination-field.d.ts +0 -0
  103. /package/dist/{lib → editor/related}/link/link.inspector/index.d.ts +0 -0
  104. /package/dist/{lib → editor/related}/link/link.inspector/link.inspector.d.ts +0 -0
  105. /package/dist/{lib → editor/related}/link/link.inspector/rel-field.d.ts +0 -0
  106. /package/dist/{lib → editor/related}/link/link.toolbar/index.d.ts +0 -0
  107. /package/dist/{lib → editor/related}/link/link.toolbar/link.toolbar.d.ts +0 -0
  108. /package/dist/{lib → editor/related}/marquee/marquee.inspector/index.d.ts +0 -0
  109. /package/dist/{lib → editor/related}/marquee/marquee.inspector/marquee.inspector.d.ts +0 -0
  110. /package/dist/{lib → editor/related}/marquee/marquee.inspector/play-state-field.d.ts +0 -0
  111. /package/dist/{lib → editor/related}/paragraph/paragraph.inspector/index.d.ts +0 -0
  112. /package/dist/{lib → editor/related}/paragraph/paragraph.inspector/paragraph.inspector.d.ts +0 -0
  113. /package/dist/{lib → editor/related}/paragraph/paragraph.toolbar/index.d.ts +0 -0
  114. /package/dist/{lib → editor/related}/paragraph/paragraph.toolbar/paragraph.toolbar.d.ts +0 -0
  115. /package/dist/{lib → editor/related}/swiper/swiper.inspector/autoplay-delay-field.d.ts +0 -0
  116. /package/dist/{lib → editor/related}/swiper/swiper.inspector/autoplay-loop-field.d.ts +0 -0
  117. /package/dist/{lib → editor/related}/swiper/swiper.inspector/index.d.ts +0 -0
  118. /package/dist/{lib → editor/related}/swiper/swiper.inspector/slides-per-view-field.d.ts +0 -0
  119. /package/dist/{lib → editor/related}/swiper/swiper.inspector/swiper.inspector.d.ts +0 -0
  120. /package/dist/{lib → editor/related}/tabs/tabs.inspector/child-tabs-field.d.ts +0 -0
  121. /package/dist/{lib → editor/related}/tabs/tabs.inspector/default-active-field.d.ts +0 -0
  122. /package/dist/{lib → editor/related}/tabs/tabs.inspector/index.d.ts +0 -0
  123. /package/dist/{lib → editor/related}/tabs/tabs.inspector/tabs.inspector.d.ts +0 -0
  124. /package/dist/{lib → editor/related}/unordered-list/unordered-list.inspector/index.d.ts +0 -0
  125. /package/dist/{lib → editor/related}/unordered-list/unordered-list.inspector/unordered-list.inspector.d.ts +0 -0
  126. /package/dist/{lib → editor/related}/video/video.inspector/index.d.ts +0 -0
  127. /package/dist/{lib → editor/related}/video/video.inspector/video.inspector.d.ts +0 -0
@@ -0,0 +1,4 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Editor } from '@craftjs/core';
3
+ export type ComposerProps = ComponentProps<typeof Editor>;
4
+ export declare const Composer: ({ resolver, children, ...props }: ComposerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -32,4 +32,6 @@ export declare const defaultResolver: {
32
32
  "accordion-summary": ({ children, ...props }: import('../../lib/accordion-summary/accordion-summary.node').AccordionSummaryNodeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
33
33
  "accordion-content": ({ children, ...props }: import('../../lib/accordion-content/accordion-content.node').AccordionContentNodeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
34
34
  "countdown-timer": ({ unitItemProps, captionProps, timeProps, units, date, hideAfterExpired, ...props }: import('../../lib/countdown-timer/countdown-timer.node/types').CountdownTimerNodeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
35
+ "count-up": (props: import('../../lib/count-up/count-up.node').CountUpNodeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
36
+ rating: (props: import('../../lib/rating/rating.node').RatingNodeProps) => import("@emotion/react/jsx-runtime").JSX.Element;
35
37
  };
@@ -1,4 +1 @@
1
- import { ComponentProps } from 'react';
2
- import { Editor } from '@craftjs/core';
3
- export type ComposerProps = ComponentProps<typeof Editor>;
4
- export declare const Composer: ({ resolver, children, ...props }: ComposerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
1
+ export * from './composer';
@@ -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-DMjFxzB_.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-Bx7Helq-.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 }) => {
@@ -33,6 +33,8 @@ export declare enum CoreNodeResolvedEnum {
33
33
  AccordionContent = "accordion-content",
34
34
  Container = "container",
35
35
  CountdownTimer = "countdown-timer",
36
+ CountUp = "count-up",
37
+ Rating = "rating",
36
38
  Inline = "inline"
37
39
  }
38
40
  export declare enum NodeDatasetAttributes {
@@ -0,0 +1,9 @@
1
+ import { ImageSource } from '../types';
2
+ interface ImageGalleryDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ images?: ImageSource[];
6
+ onSelect?: (source: ImageSource) => void;
7
+ }
8
+ export declare const ImageGalleryDialog: ({ open, onOpenChange, images, onSelect }: ImageGalleryDialogProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,7 +1,8 @@
1
1
  import { default as React } from 'react';
2
+ import { ImageSource } from '../types';
2
3
  interface ImageSourceSelectionProps {
3
- source?: string;
4
- onChange?: (source?: string) => void;
4
+ source?: ImageSource;
5
+ onChange?: (source?: ImageSource) => void;
5
6
  previewStyle?: React.CSSProperties;
6
7
  }
7
8
  export declare const ImageSourceSelection: ({ source, onChange, previewStyle }: ImageSourceSelectionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ export * from './color-picker-popover';
3
3
  export * from './color-preview';
4
4
  export * from './css-size-input';
5
5
  export * from './degree-picker';
6
+ export * from './image-gallery-dialog';
6
7
  export * from './image-source-selection';
7
8
  export * from './toolbar-field';
8
9
  export * from './toolbar-group';
@@ -1,5 +1,6 @@
1
1
  import { Screen, Theme } from '@janbox/storefront-ui/theme';
2
2
  import { SerializedNodes } from '../../types';
3
+ import { EditorResources } from '../types';
3
4
  export type EditorMode = 'full' | 'compact';
4
5
  export type VariableOption = {
5
6
  label: string;
@@ -23,6 +24,8 @@ export type EditorState = {
23
24
  screen: Screen;
24
25
  action?: string;
25
26
  variableDefinitions?: VariableDefinition[];
27
+ /** Tài nguyên edit-time do consumer cấp. Truyền một lần lúc init, bất biến. */
28
+ resources?: EditorResources;
26
29
  };
27
30
  type MutableEditorState = Pick<EditorState, 'theme' | 'mode' | 'screen' | 'action' | 'variableDefinitions'>;
28
31
  type EditorStateValue = EditorState & {
@@ -1,6 +1,7 @@
1
1
  import { Theme } from '@janbox/storefront-ui/theme';
2
2
  import { SidebarProps } from './sidebar';
3
3
  import { Resolver } from '../../types';
4
+ import { EditorResources } from '../types';
4
5
  import { EditorHandlers, VariableDefinition } from '../hooks/use-editor';
5
6
  import { PropsWithChildren, ReactNode } from 'react';
6
7
  export type EditorProps = PropsWithChildren<{
@@ -10,7 +11,9 @@ export type EditorProps = PropsWithChildren<{
10
11
  handlers: EditorHandlers;
11
12
  variableDefinitions?: VariableDefinition[];
12
13
  headerActions?: ReactNode;
14
+ resources?: EditorResources;
13
15
  }>;
14
16
  export type { EditorHandlers, VariableDefinition, VariableOption } from '../hooks/use-editor';
17
+ export type { EditorResources, ImageSource } from '../types';
15
18
  export type { InsertTemplate, InsertTemplateGroup } from './sidebar/insert-action';
16
- export declare const Editor: ({ theme, insert, resolver, handlers, variableDefinitions, headerActions, children, }: EditorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
19
+ export declare const Editor: ({ theme, insert, resolver, handlers, variableDefinitions, headerActions, resources, children, }: EditorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './button.inspector';
@@ -0,0 +1 @@
1
+ export declare const CountUpInspector: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './count-up.inspector';
@@ -0,0 +1 @@
1
+ export * from './image.inspector';
@@ -0,0 +1 @@
1
+ export * from './rating.inspector';
@@ -0,0 +1 @@
1
+ export declare const RatingInspector: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +1,12 @@
1
1
  export type CssUnit = 'px' | '%';
2
+ export type ImageSource = {
3
+ src: string;
4
+ alt?: string;
5
+ };
6
+ /**
7
+ * Tài nguyên edit-time do consumer cấp cho Editor (prop `resources`).
8
+ * Flat, không gắn riêng node nào — dùng chung ở nhiều nơi (image inspector, background, ...).
9
+ */
10
+ export type EditorResources = {
11
+ imageSources?: ImageSource[];
12
+ };
@@ -0,0 +1,41 @@
1
+ import { JSX, Ref } from 'react';
2
+ import { Placement, UseFloatingOptions, UseDismissProps } from '@floating-ui/react';
3
+ import { ShallowMerge } from '@janbox/storefront-ui/types';
4
+ export interface WbCascaderOption {
5
+ label: React.ReactNode;
6
+ value: string;
7
+ disabled?: boolean;
8
+ children?: WbCascaderOption[];
9
+ }
10
+ interface WbCascaderExtendedProps {
11
+ innerRef?: Ref<HTMLDivElement>;
12
+ placement?: Placement;
13
+ contentWidth?: number | 'fit-parent';
14
+ onOpenChange?: UseFloatingOptions['onOpenChange'];
15
+ visible?: boolean;
16
+ dissmiss?: UseDismissProps;
17
+ defaultValue?: string[];
18
+ value?: string[] | null;
19
+ options: WbCascaderOption[];
20
+ /** Fires with the full value path and matching option path. */
21
+ onChange?: (value: string[], options: WbCascaderOption[]) => void;
22
+ /** How each column expands to reveal its children. Default: `click` */
23
+ expandTrigger?: 'click' | 'hover';
24
+ /** Allow committing a value at any level, not just leaves. Default: `false` */
25
+ changeOnSelect?: boolean;
26
+ placeholder?: string;
27
+ /** Show a clear button when a value is selected. Default: `false` */
28
+ allowClear?: boolean;
29
+ /** Renders the selected path in the trigger. Defaults to labels joined by `separator`. */
30
+ displayRender?: (labels: React.ReactNode[], options: WbCascaderOption[]) => React.ReactNode;
31
+ separator?: React.ReactNode;
32
+ prefix?: React.ReactNode;
33
+ suffix?: React.ReactNode;
34
+ size?: '28' | '32' | '36';
35
+ columnWidth?: number;
36
+ columnMaxHeight?: number;
37
+ emptyText?: React.ReactNode;
38
+ }
39
+ export type WbCascaderProps = ShallowMerge<JSX.IntrinsicElements['button'], WbCascaderExtendedProps>;
40
+ export declare const WbCascader: (props: WbCascaderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
41
+ export {};
@@ -0,0 +1 @@
1
+ export * from './cascader';
@@ -1,21 +1,10 @@
1
- import { JSX, Ref } from 'react';
2
- import { Placement, UseFloatingOptions, UseDismissProps } from '@floating-ui/react';
3
- type WbDatePickerProps = {
4
- innerRef?: Ref<HTMLDivElement>;
5
- placement?: Placement;
6
- contentWidth?: number | 'fit-parent';
7
- onOpenChange?: UseFloatingOptions['onOpenChange'];
8
- open?: boolean;
9
- dissmiss?: UseDismissProps;
10
- value?: Date | null;
1
+ import { HTMLInputTypeAttribute } from 'react';
2
+ import { WbInputProps } from '../input';
3
+ type InputDateType = Extract<HTMLInputTypeAttribute, 'date' | 'datetime-local'>;
4
+ type WbDatePickerProps = Omit<WbInputProps, 'value' | 'defaultValue' | 'type'> & {
11
5
  defaultValue?: Date;
12
- onChange?: (value: Date) => void;
13
- placeholder?: string;
14
- prefix?: React.ReactNode;
15
- suffix?: React.ReactNode;
16
- size?: '28' | '32' | '36';
17
- referenceProps?: JSX.IntrinsicElements['button'];
18
- showTimeInput?: boolean;
6
+ value?: Date;
7
+ type?: InputDateType;
19
8
  };
20
- export declare const WbDatePicker: (props: WbDatePickerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export declare const WbDatePicker: ({ type, ...props }: WbDatePickerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
21
10
  export {};
@@ -10,6 +10,7 @@ export * from './radio-button';
10
10
  export * from './tabs';
11
11
  export * from './scroll-view';
12
12
  export * from './select';
13
+ export * from './cascader';
13
14
  export * from './loading-overlay';
14
15
  export * from './switch';
15
16
  export * from './textarea';