@trycourier/react-designer 0.0.3 → 0.0.5

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 (43) hide show
  1. package/README.md +206 -22
  2. package/dist/cjs/index.js +41 -35
  3. package/dist/cjs/index.js.map +4 -4
  4. package/dist/cjs/styles.css +20 -0
  5. package/dist/components/Providers/BrandProvider.d.ts +0 -12
  6. package/dist/components/Providers/Providers.types.d.ts +1 -0
  7. package/dist/components/Providers/TemplateProvider.d.ts +7 -12
  8. package/dist/components/Providers/api/common.d.ts +1 -1
  9. package/dist/components/Providers/index.d.ts +4 -2
  10. package/dist/components/Providers/store.d.ts +41 -6
  11. package/dist/components/Providers/useBrandActions.d.ts +22 -0
  12. package/dist/components/Providers/useTemplateActions.d.ts +23 -0
  13. package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +3 -3
  14. package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +6 -2
  15. package/dist/components/TemplateEditor/Channels/Inbox/InboxEditor.d.ts +1 -1
  16. package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +11 -5
  17. package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +10 -5
  18. package/dist/components/TemplateEditor/TemplateEditor.d.ts +1 -1
  19. package/dist/components/TemplateEditor/index.d.ts +5 -1
  20. package/dist/components/TemplateEditor/store.d.ts +3 -0
  21. package/dist/components/extensions/Divider/Divider.types.d.ts +2 -2
  22. package/dist/components/ui/Status/Status.d.ts +4 -1
  23. package/dist/components/ui-kit/Button/Button.d.ts +1 -1
  24. package/dist/components/ui-kit/ErrorBoundary/ErrorBoundary.d.ts +22 -0
  25. package/dist/components/ui-kit/ErrorBoundary/index.d.ts +1 -0
  26. package/dist/components/ui-kit/index.d.ts +1 -0
  27. package/dist/esm/index.js +41 -35
  28. package/dist/esm/index.js.map +4 -4
  29. package/dist/esm/styles.css +20 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/lib/api/uploadImage.d.ts +0 -1
  32. package/dist/lib/utils/errors.d.ts +26 -0
  33. package/dist/lib/utils/getTitle/demo.d.ts +1 -0
  34. package/dist/lib/utils/getTitle/getTitle.d.ts +18 -0
  35. package/dist/lib/utils/getTitle/getTitle.test.d.ts +1 -0
  36. package/dist/lib/utils/getTitle/index.d.ts +2 -0
  37. package/dist/lib/utils/getTitle/preserveStorageFormat.d.ts +30 -0
  38. package/dist/lib/utils/getTitle/preserveStorageFormat.test.d.ts +1 -0
  39. package/dist/lib/utils/index.d.ts +1 -0
  40. package/dist/lib/utils/updateElemental/updateElemental.d.ts +1 -1
  41. package/dist/styles.css +20 -0
  42. package/dist/types/elemental.types.d.ts +1 -0
  43. package/package.json +1 -1
@@ -1637,6 +1637,10 @@ body {
1637
1637
  .courier-border-primary {
1638
1638
  border-color: var(--primary);
1639
1639
  }
1640
+ .courier-border-red-200 {
1641
+ --tw-border-opacity: 1;
1642
+ border-color: rgb(254 202 202 / var(--tw-border-opacity, 1));
1643
+ }
1640
1644
  .courier-border-transparent {
1641
1645
  border-color: transparent;
1642
1646
  }
@@ -1745,6 +1749,10 @@ body {
1745
1749
  .courier-bg-primary {
1746
1750
  background-color: var(--primary);
1747
1751
  }
1752
+ .courier-bg-red-50 {
1753
+ --tw-bg-opacity: 1;
1754
+ background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));
1755
+ }
1748
1756
  .courier-bg-red-500 {
1749
1757
  --tw-bg-opacity: 1;
1750
1758
  background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
@@ -2052,6 +2060,10 @@ body {
2052
2060
  --tw-text-opacity: 1;
2053
2061
  color: rgb(107 114 128 / var(--tw-text-opacity, 1));
2054
2062
  }
2063
+ .courier-text-gray-600 {
2064
+ --tw-text-opacity: 1;
2065
+ color: rgb(75 85 99 / var(--tw-text-opacity, 1));
2066
+ }
2055
2067
  .courier-text-inherit {
2056
2068
  color: inherit;
2057
2069
  }
@@ -2077,6 +2089,14 @@ body {
2077
2089
  --tw-text-opacity: 1;
2078
2090
  color: rgb(239 68 68 / var(--tw-text-opacity, 1));
2079
2091
  }
2092
+ .courier-text-red-600 {
2093
+ --tw-text-opacity: 1;
2094
+ color: rgb(220 38 38 / var(--tw-text-opacity, 1));
2095
+ }
2096
+ .courier-text-red-800 {
2097
+ --tw-text-opacity: 1;
2098
+ color: rgb(153 27 27 / var(--tw-text-opacity, 1));
2099
+ }
2080
2100
  .courier-text-ring {
2081
2101
  color: var(--ring);
2082
2102
  }
@@ -1,14 +1,2 @@
1
1
  import type { BasicProviderProps } from "./Providers.types";
2
- export declare function useBrandActions(): {
3
- getTenant: (options?: {
4
- includeBrand?: boolean;
5
- } | undefined) => Promise<void>;
6
- saveBrand: (settings?: Record<string, unknown> | undefined) => Promise<any>;
7
- publishBrand: () => Promise<any>;
8
- isTenantLoading: boolean | null;
9
- isTenantSaving: boolean | null;
10
- isTenantPublishing: boolean | null;
11
- tenantError: string | null;
12
- tenantData: import("./store").TenantData | null;
13
- };
14
2
  export declare const BrandProvider: import("react").NamedExoticComponent<BasicProviderProps>;
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  export interface BasicProviderProps {
3
3
  apiUrl?: string;
4
+ uploadImageUrl?: string;
4
5
  children: ReactNode;
5
6
  tenantId: string;
6
7
  token: string;
@@ -1,18 +1,13 @@
1
1
  import type { BasicProviderProps } from "./Providers.types";
2
- export declare function useTemplateActions(): {
3
- getTenant: (options?: {
4
- includeBrand?: boolean;
5
- } | undefined) => Promise<void>;
6
- saveTemplate: (routing?: import("./store").MessageRouting | undefined) => Promise<any>;
7
- publishTemplate: () => Promise<any>;
8
- isTenantLoading: boolean | null;
9
- isTenantSaving: boolean | null;
10
- isTenantPublishing: boolean | null;
11
- tenantError: string | null;
12
- tenantData: import("./store").TenantData | null;
13
- };
2
+ import { type TemplateActions, type MessageRouting } from "./store";
14
3
  type TemplateProviderProps = BasicProviderProps & {
15
4
  templateId: string;
5
+ getTemplate?: (actions: TemplateActions) => Promise<void>;
6
+ saveTemplate?: (actions: TemplateActions, options?: MessageRouting) => Promise<void>;
7
+ };
8
+ export declare const overrideFunctions: {
9
+ getTemplate: TemplateProviderProps["getTemplate"] | null;
10
+ saveTemplate: TemplateProviderProps["saveTemplate"] | null;
16
11
  };
17
12
  export declare const TemplateProvider: import("react").NamedExoticComponent<TemplateProviderProps>;
18
13
  export {};
@@ -1,4 +1,4 @@
1
- export declare const getTenantAtom: import("jotai").WritableAtom<null, [options?: {
1
+ export declare const getTemplateAtom: import("jotai").WritableAtom<null, [options?: {
2
2
  includeBrand?: boolean;
3
3
  } | undefined], Promise<void>> & {
4
4
  init: null;
@@ -1,3 +1,5 @@
1
- export { TemplateProvider, useTemplateActions } from "./TemplateProvider";
2
- export { BrandProvider, useBrandActions } from "./BrandProvider";
1
+ export { BrandProvider } from "./BrandProvider";
3
2
  export * from "./store";
3
+ export { TemplateProvider } from "./TemplateProvider";
4
+ export { useBrandActions } from "./useBrandActions";
5
+ export { useTemplateActions } from "./useTemplateActions";
@@ -1,4 +1,5 @@
1
1
  import type { ElementalContent } from "@/types/elemental.types";
2
+ import type { TemplateError } from "@/lib/utils/errors";
2
3
  export type MessageRoutingMethod = "all" | "single";
3
4
  export type MessageRoutingChannel = string | MessageRouting;
4
5
  export interface MessageRouting {
@@ -83,6 +84,9 @@ export declare const editorStore: {
83
84
  export declare const apiUrlAtom: import("jotai").PrimitiveAtom<string> & {
84
85
  init: string;
85
86
  };
87
+ export declare const uploadImageUrlAtom: import("jotai").PrimitiveAtom<string> & {
88
+ init: string;
89
+ };
86
90
  export declare const tokenAtom: import("jotai").PrimitiveAtom<string> & {
87
91
  init: string;
88
92
  };
@@ -92,21 +96,52 @@ export declare const tenantIdAtom: import("jotai").PrimitiveAtom<string> & {
92
96
  export declare const templateIdAtom: import("jotai").PrimitiveAtom<string> & {
93
97
  init: string;
94
98
  };
95
- export declare const tenantDataAtom: import("jotai").PrimitiveAtom<TenantData | null> & {
99
+ export declare const templateDataAtom: import("jotai").PrimitiveAtom<TenantData | null> & {
96
100
  init: TenantData | null;
97
101
  };
98
- export declare const isTenantLoadingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
102
+ export declare const isTemplateLoadingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
99
103
  init: boolean | null;
100
104
  };
101
- export declare const isTenantSavingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
105
+ export declare const isTemplateSavingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
102
106
  init: boolean | null;
103
107
  };
104
- export declare const isTenantPublishingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
108
+ export declare const isTemplatePublishingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
105
109
  init: boolean | null;
106
110
  };
107
- export declare const tenantErrorAtom: import("jotai").PrimitiveAtom<string | null> & {
108
- init: string | null;
111
+ export declare const templateErrorAtom: import("jotai").PrimitiveAtom<TemplateError | null> & {
112
+ init: TemplateError | null;
109
113
  };
110
114
  export declare const brandApplyAtom: import("jotai").PrimitiveAtom<boolean> & {
111
115
  init: boolean;
112
116
  };
117
+ export interface TemplateActions {
118
+ getTemplate: (options?: {
119
+ includeBrand?: boolean;
120
+ }) => Promise<void>;
121
+ saveTemplate: (options?: MessageRouting) => Promise<void>;
122
+ publishTemplate: () => Promise<unknown>;
123
+ isTemplateLoading: boolean | null;
124
+ setIsTemplateLoading: (loading: boolean | null) => void;
125
+ isTemplateSaving: boolean | null;
126
+ setIsTemplateSaving: (saving: boolean | null) => void;
127
+ isTemplatePublishing: boolean | null;
128
+ setIsTemplatePublishing: (publishing: boolean | null) => void;
129
+ templateError: TemplateError | null;
130
+ setTemplateError: (error: string | TemplateError | null) => void;
131
+ templateData: TenantData | null;
132
+ setTemplateData: (data: TenantData | null) => void;
133
+ templateEditorContent: ElementalContent | null | undefined;
134
+ setTemplateEditorContent: (content: ElementalContent | null) => void;
135
+ createCustomError: (message: string, details?: Record<string, unknown>) => TemplateError;
136
+ convertLegacyError: (error: string | TemplateError) => TemplateError;
137
+ }
138
+ export declare const getTemplateOverrideAtom: import("jotai").PrimitiveAtom<((options?: {
139
+ includeBrand?: boolean;
140
+ }) => Promise<void>) | null> & {
141
+ init: ((options?: {
142
+ includeBrand?: boolean;
143
+ }) => Promise<void>) | null;
144
+ };
145
+ export declare const saveTemplateOverrideAtom: import("jotai").PrimitiveAtom<((actions: TemplateActions, options?: MessageRouting) => Promise<void>) | null> & {
146
+ init: ((actions: TemplateActions, options?: MessageRouting) => Promise<void>) | null;
147
+ };
@@ -0,0 +1,22 @@
1
+ import { type TemplateError } from "@/lib/utils/errors";
2
+ import { type MessageRouting } from "./store";
3
+ export declare function useBrandActions(): {
4
+ getTemplate: (options?: {
5
+ includeBrand?: boolean;
6
+ }) => Promise<void>;
7
+ saveTemplate: (options?: MessageRouting) => Promise<void>;
8
+ saveBrand: (settings?: Record<string, unknown> | undefined) => Promise<any>;
9
+ publishBrand: () => Promise<any>;
10
+ isTemplateLoading: boolean | null;
11
+ setIsTemplateLoading: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
12
+ isTemplateSaving: boolean | null;
13
+ setIsTemplateSaving: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
14
+ isTemplatePublishing: boolean | null;
15
+ setIsTemplatePublishing: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
16
+ templateError: TemplateError | null;
17
+ setTemplateError: (error: string | TemplateError | null) => void;
18
+ templateData: import("./store").TenantData | null;
19
+ setTemplateData: (args_0: import("./store").TenantData | ((prev: import("./store").TenantData | null) => import("./store").TenantData | null) | null) => void;
20
+ createCustomError: (message: string, toastProps?: import("sonner").ExternalToast) => TemplateError;
21
+ convertLegacyError: (error: string | TemplateError) => TemplateError;
22
+ };
@@ -0,0 +1,23 @@
1
+ import { type TemplateError } from "@/lib/utils/errors";
2
+ import { type MessageRouting } from "./store";
3
+ export declare function useTemplateActions(): {
4
+ getTemplate: (options?: {
5
+ includeBrand?: boolean;
6
+ }) => Promise<void>;
7
+ saveTemplate: (options?: MessageRouting) => Promise<void>;
8
+ publishTemplate: () => Promise<any>;
9
+ isTemplateLoading: boolean | null;
10
+ setIsTemplateLoading: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
11
+ isTemplateSaving: boolean | null;
12
+ setIsTemplateSaving: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
13
+ isTemplatePublishing: boolean | null;
14
+ setIsTemplatePublishing: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
15
+ templateError: TemplateError | null;
16
+ setTemplateError: (error: string | TemplateError | null) => void;
17
+ templateData: import("./store").TenantData | null;
18
+ setTemplateData: (args_0: import("./store").TenantData | ((prev: import("./store").TenantData | null) => import("./store").TenantData | null) | null) => void;
19
+ templateEditorContent: import("../TemplateEditor").ElementalContent | null | undefined;
20
+ setTemplateEditorContent: (args_0: import("../TemplateEditor").ElementalContent | ((prev: import("../TemplateEditor").ElementalContent | null | undefined) => import("../TemplateEditor").ElementalContent | null | undefined) | null | undefined) => void;
21
+ createCustomError: (message: string, toastProps?: import("sonner").ExternalToast) => TemplateError;
22
+ convertLegacyError: (error: string | TemplateError) => TemplateError;
23
+ };
@@ -20,14 +20,14 @@ interface BrandSettingsData {
20
20
  mediumLink?: string;
21
21
  xLink?: string;
22
22
  }
23
- export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "brandEditor" | "channels" | "variables" | "theme" | "routing"> {
23
+ export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "brandEditor" | "channels" | "variables" | "theme" | "routing" | "value"> {
24
24
  isLoading?: boolean;
25
25
  headerRenderer?: ({ hidePublish, channels, routing, }: {
26
26
  hidePublish?: boolean;
27
27
  channels?: ChannelType[];
28
28
  routing?: MessageRouting;
29
29
  }) => React.ReactNode;
30
- render?: ({ subject, handleSubjectChange, selectedNode, setSelectedNode, previewMode, emailEditor, ref, isBrandApply, brandSettings, items, content, strategy, syncEditorItems, brandEditorContent, tenantData, togglePreviewMode, }: {
30
+ render?: ({ subject, handleSubjectChange, selectedNode, setSelectedNode, previewMode, emailEditor, ref, isBrandApply, brandSettings, items, content, strategy, syncEditorItems, brandEditorContent, templateData, togglePreviewMode, }: {
31
31
  subject: string | null;
32
32
  handleSubjectChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
33
33
  selectedNode: Node | null;
@@ -42,7 +42,7 @@ export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "b
42
42
  strategy: SortingStrategy;
43
43
  syncEditorItems: (editor: Editor) => void;
44
44
  brandEditorContent: string | null;
45
- tenantData: TenantData | null;
45
+ templateData: TenantData | null;
46
46
  togglePreviewMode: (mode: "desktop" | "mobile" | undefined) => void;
47
47
  }) => React.ReactNode;
48
48
  }
@@ -7,7 +7,10 @@ import type { AnyExtension, Editor } from "@tiptap/react";
7
7
  import type { TemplateEditorProps } from "../../TemplateEditor";
8
8
  export declare const defaultInboxContent: ElementalNode[];
9
9
  export declare const InboxConfig: TextMenuConfig;
10
- export declare const InboxEditorContent: () => null;
10
+ interface InboxEditorContentProps {
11
+ value?: TiptapDoc;
12
+ }
13
+ export declare const InboxEditorContent: ({ value }: InboxEditorContentProps) => null;
11
14
  export interface InboxRenderProps {
12
15
  content: TiptapDoc;
13
16
  extensions: AnyExtension[];
@@ -17,7 +20,7 @@ export interface InboxRenderProps {
17
20
  editor: Editor;
18
21
  }) => void;
19
22
  }
20
- export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
23
+ export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value"> {
21
24
  readOnly?: boolean;
22
25
  headerRenderer?: ({ hidePublish, channels, routing, }: {
23
26
  hidePublish?: boolean;
@@ -27,3 +30,4 @@ export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "t
27
30
  render?: (props: InboxRenderProps) => React.ReactNode;
28
31
  }
29
32
  export declare const Inbox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<InboxProps & import("react").RefAttributes<HTMLDivElement>>>;
33
+ export {};
@@ -1,4 +1,4 @@
1
1
  import type { InboxRenderProps } from "./Inbox";
2
2
  export interface InboxEditorProps extends InboxRenderProps {
3
3
  }
4
- export declare const InboxEditor: ({ content, extensions, editable, autofocus, onUpdate, }: InboxEditorProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const InboxEditor: ({ content, extensions, editable, autofocus, onUpdate, }: InboxEditorProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -2,12 +2,13 @@ import type { MessageRouting } from "@/components/Providers/store";
2
2
  import type { TextMenuConfig } from "@/components/ui/TextMenu/config";
3
3
  import type { TiptapDoc } from "@/lib/utils";
4
4
  import type { ChannelType } from "@/store";
5
- import type { ElementalNode } from "@/types/elemental.types";
6
5
  import type { AnyExtension, Editor } from "@tiptap/react";
7
6
  import type { TemplateEditorProps } from "../../TemplateEditor";
8
- export declare const PushEditorContent: () => null;
7
+ export declare const PushEditorContent: ({ value }: {
8
+ value?: TiptapDoc | null;
9
+ }) => null;
9
10
  export interface PushRenderProps {
10
- content: TiptapDoc;
11
+ content: TiptapDoc | null;
11
12
  extensions: AnyExtension[];
12
13
  editable: boolean;
13
14
  autofocus: boolean;
@@ -15,7 +16,7 @@ export interface PushRenderProps {
15
16
  editor: Editor;
16
17
  }) => void;
17
18
  }
18
- export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
19
+ export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value"> {
19
20
  readOnly?: boolean;
20
21
  headerRenderer?: ({ hidePublish, channels, routing, }: {
21
22
  hidePublish?: boolean;
@@ -24,6 +25,11 @@ export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "th
24
25
  }) => React.ReactNode;
25
26
  render?: (props: PushRenderProps) => React.ReactNode;
26
27
  }
27
- export declare const defaultPushContent: ElementalNode[];
28
+ export declare const defaultPushContent: {
29
+ raw: {
30
+ title: string;
31
+ text: string;
32
+ };
33
+ };
28
34
  export declare const PushConfig: TextMenuConfig;
29
35
  export declare const Push: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<PushProps & import("react").RefAttributes<HTMLDivElement>>>;
@@ -1,14 +1,19 @@
1
1
  import type { TextMenuConfig } from "@/components/ui/TextMenu/config";
2
2
  import type { TiptapDoc } from "@/lib/utils";
3
- import type { ElementalNode } from "@/types/elemental.types";
4
3
  import type { AnyExtension, Editor } from "@tiptap/react";
5
4
  import type { MessageRouting } from "../../../Providers/store";
6
5
  import type { ChannelType } from "@/store";
7
6
  import type { TemplateEditorProps } from "../../TemplateEditor";
8
- export declare const defaultSMSContent: ElementalNode[];
9
- export declare const SMSEditorContent: () => import("react/jsx-runtime").JSX.Element;
7
+ export declare const defaultSMSContent: {
8
+ raw: {
9
+ text: string;
10
+ };
11
+ };
12
+ export declare const SMSEditorContent: ({ value }: {
13
+ value?: TiptapDoc | null;
14
+ }) => import("react/jsx-runtime").JSX.Element;
10
15
  export interface SMSRenderProps {
11
- content: TiptapDoc;
16
+ content: TiptapDoc | null;
12
17
  extensions: AnyExtension[];
13
18
  editable: boolean;
14
19
  autofocus: boolean;
@@ -16,7 +21,7 @@ export interface SMSRenderProps {
16
21
  editor: Editor;
17
22
  }) => void;
18
23
  }
19
- export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
24
+ export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value"> {
20
25
  readOnly?: boolean;
21
26
  headerRenderer?: ({ hidePublish, channels, routing, }: {
22
27
  hidePublish?: boolean;
@@ -5,7 +5,7 @@ import { type MessageRouting } from "../Providers/store";
5
5
  import type { Theme } from "../ui-kit/ThemeProvider/ThemeProvider.types";
6
6
  export interface TemplateEditorProps {
7
7
  theme?: Theme | string;
8
- value?: ElementalContent;
8
+ value?: ElementalContent | null;
9
9
  onChange?: (value: ElementalContent) => void;
10
10
  variables?: Record<string, unknown>;
11
11
  hidePublish?: boolean;
@@ -12,6 +12,10 @@ export declare const EmailChannel: import("react").MemoExoticComponent<import("r
12
12
  export declare const SMSChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").SMSProps & import("react").RefAttributes<HTMLDivElement>>>;
13
13
  export declare const PushChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").PushProps & import("react").RefAttributes<HTMLDivElement>>>;
14
14
  export declare const InboxChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").InboxProps & import("react").RefAttributes<HTMLDivElement>>>;
15
- export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type SMSEditorProps, type InboxEditorProps, type PushEditorProps, } from "./Channels";
15
+ export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type InboxEditorProps, type PushEditorProps, type SMSEditorProps, } from "./Channels";
16
+ export type { ChannelType } from "@/store";
17
+ export type { ElementalContent } from "@/types";
16
18
  export { ChannelRootContainer, EditorSidebar } from "./Layout";
17
19
  export { InboxEditor, PushEditor, SMSEditor } from "./Channels";
20
+ export { useAutoSave } from "@/hooks/useAutoSave";
21
+ export { Status as TemplateStatus } from "@/components/ui/Status";
@@ -18,3 +18,6 @@ export declare const emailEditorAtom: import("jotai").PrimitiveAtom<Editor | nul
18
18
  export declare const brandEditorAtom: import("jotai").PrimitiveAtom<Editor | null> & {
19
19
  init: Editor | null;
20
20
  };
21
+ export declare const isTemplateTransitioningAtom: import("jotai").PrimitiveAtom<boolean> & {
22
+ init: boolean;
23
+ };
@@ -6,14 +6,14 @@ export declare const dividerSchema: z.ZodObject<{
6
6
  radius: z.ZodNumber;
7
7
  variant: z.ZodDefault<z.ZodEnum<["divider", "spacer"]>>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- color: string;
10
9
  padding: number;
10
+ color: string;
11
11
  size: number;
12
12
  radius: number;
13
13
  variant: "divider" | "spacer";
14
14
  }, {
15
- color: string;
16
15
  padding: number;
16
+ color: string;
17
17
  size: number;
18
18
  radius: number;
19
19
  variant?: "divider" | "spacer" | undefined;
@@ -2,6 +2,9 @@ interface StatusProps {
2
2
  isError?: boolean;
3
3
  isSaving?: boolean | null;
4
4
  isLoading?: boolean;
5
+ renderIsSaving?: (isSaving: boolean) => React.ReactNode;
6
+ renderIsError?: (isError: boolean) => React.ReactNode;
7
+ renderSaved?: (isSaved: boolean) => React.ReactNode;
5
8
  }
6
- export declare const Status: ({ isError, isSaving, isLoading }: StatusProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export declare const Status: ({ isError, isSaving, isLoading, renderIsSaving, renderIsError, renderSaved, }: StatusProps) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
7
10
  export {};
@@ -4,7 +4,7 @@ export type ButtonVariant = "primary" | "secondary" | "tertiary" | "quaternary"
4
4
  export type ButtonSize = "medium" | "small" | "icon" | "iconSmall";
5
5
  export declare const buttonVariants: (props?: ({
6
6
  variant?: "link" | "primary" | "secondary" | "tertiary" | "quaternary" | "outline" | "ghost" | null | undefined;
7
- size?: "small" | "medium" | "icon" | "iconSmall" | null | undefined;
7
+ size?: "icon" | "small" | "medium" | "iconSmall" | null | undefined;
8
8
  active?: boolean | null | undefined;
9
9
  disabled?: boolean | null | undefined;
10
10
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -0,0 +1,22 @@
1
+ import type { ErrorInfo, ReactNode } from "react";
2
+ import { Component } from "react";
3
+ interface ErrorBoundaryProps {
4
+ children: ReactNode;
5
+ fallback?: ReactNode;
6
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
7
+ }
8
+ interface ErrorBoundaryState {
9
+ hasError: boolean;
10
+ error?: Error;
11
+ }
12
+ /**
13
+ * Error Boundary component that catches JavaScript errors in the component tree
14
+ * and integrates with the template error system
15
+ */
16
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
17
+ constructor(props: ErrorBoundaryProps);
18
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
19
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
20
+ render(): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
21
+ }
22
+ export {};
@@ -0,0 +1 @@
1
+ export { ErrorBoundary } from "./ErrorBoundary";
@@ -1,6 +1,7 @@
1
1
  export * from "./Button";
2
2
  export * from "./Divider";
3
3
  export * from "./DropdownMenu";
4
+ export * from "./ErrorBoundary";
4
5
  export * from "./Form";
5
6
  export * from "./AlertDialog";
6
7
  export * from "./Input";