@janbox/storefront-builder 1.0.9 → 2.0.0

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.
@@ -9,5 +9,5 @@ export type EditorProps = {
9
9
  handlers: EditorHandlers;
10
10
  };
11
11
  export type { EditorHandlers } from '../hooks/use-editor';
12
- export type { InsertElementGroup, InsertSectionGroup } from './sidebar/insert-action';
12
+ export type { InsertTemplate, InsertTemplateGroup } from './sidebar/insert-action';
13
13
  export declare const Editor: ({ theme, insert, resolver, handlers }: EditorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,30 +1,23 @@
1
1
  import { WbSvgLoaderProps } from '../../ui';
2
2
  import { NodeTree } from '../../../types';
3
- export type InsertElementGroup = {
4
- name: string;
5
- elements: {
6
- name: string;
7
- template: React.ReactElement | (() => NodeTree | React.ReactElement);
8
- icon: WbSvgLoaderProps;
9
- autoFocus?: boolean | ((nodeTree: NodeTree) => boolean);
10
- onCreate?: (nodeTree: NodeTree) => void;
11
- }[];
3
+ export type InsertTemplate = {
4
+ name?: string;
5
+ icon?: WbSvgLoaderProps;
6
+ template: React.ReactElement | (() => NodeTree | React.ReactElement);
7
+ autoFocus?: boolean | ((nodeTree: NodeTree) => boolean);
8
+ onCreate?: (nodeTree: NodeTree) => void;
12
9
  };
13
- export type InsertSectionGroup = {
10
+ export type InsertTemplateGroup = {
14
11
  name: string;
15
- icon: WbSvgLoaderProps;
16
- sections: {
17
- template: React.ReactElement | (() => NodeTree | React.ReactElement);
18
- autoFocus?: boolean | ((nodeTree: NodeTree) => boolean);
19
- onCreate?: (nodeTree: NodeTree) => void;
20
- }[];
12
+ icon?: WbSvgLoaderProps;
13
+ templates?: InsertTemplate[];
14
+ renderer?: React.ComponentType;
21
15
  };
22
16
  export interface InsertActionProps {
23
- elements?: InsertElementGroup[];
24
- sections?: InsertSectionGroup[];
17
+ groups?: InsertTemplateGroup[];
25
18
  }
26
- export declare const InsertAction: ({ elements, sections }: InsertActionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
27
- export declare const SectionInsertionGroup: ({ group }: {
28
- group: InsertSectionGroup;
19
+ export declare const InsertAction: ({ groups }: InsertActionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
20
+ export declare const TemplateInsertionGroup: ({ group }: {
21
+ group: InsertTemplateGroup;
29
22
  }) => import("@emotion/react/jsx-runtime").JSX.Element;
30
- export declare const SectionInsertion: ({ template, autoFocus, onCreate }: InsertSectionGroup["sections"][number]) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ export declare const TemplateInsertion: ({ template, autoFocus, onCreate }: InsertTemplate) => import("@emotion/react/jsx-runtime").JSX.Element;