@trycourier/react-designer 0.0.0-canary-20250820153811 → 0.0.3

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.
@@ -1,2 +1,14 @@
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
+ };
2
14
  export declare const BrandProvider: import("react").NamedExoticComponent<BasicProviderProps>;
@@ -1,13 +1,18 @@
1
1
  import type { BasicProviderProps } from "./Providers.types";
2
- import { useTemplateActions } from "./useTemplateActions";
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
+ };
3
14
  type TemplateProviderProps = BasicProviderProps & {
4
15
  templateId: string;
5
- getTemplate?: (actions: ReturnType<typeof useTemplateActions>) => Promise<void>;
6
- saveTemplate?: (actions: ReturnType<typeof useTemplateActions>, options?: any) => Promise<void>;
7
- };
8
- export declare const overrideFunctions: {
9
- getTemplate: TemplateProviderProps["getTemplate"] | null;
10
- saveTemplate: TemplateProviderProps["saveTemplate"] | null;
11
16
  };
12
17
  export declare const TemplateProvider: import("react").NamedExoticComponent<TemplateProviderProps>;
13
18
  export {};
@@ -1,4 +1,4 @@
1
- export declare const getTemplateAtom: import("jotai").WritableAtom<null, [options?: {
1
+ export declare const getTenantAtom: import("jotai").WritableAtom<null, [options?: {
2
2
  includeBrand?: boolean;
3
3
  } | undefined], Promise<void>> & {
4
4
  init: null;
@@ -1,5 +1,3 @@
1
- export { BrandProvider } from "./BrandProvider";
1
+ export { TemplateProvider, useTemplateActions } from "./TemplateProvider";
2
+ export { BrandProvider, useBrandActions } from "./BrandProvider";
2
3
  export * from "./store";
3
- export { TemplateProvider } from "./TemplateProvider";
4
- export { useBrandActions } from "./useBrandActions";
5
- export { useTemplateActions } from "./useTemplateActions";
@@ -92,31 +92,21 @@ export declare const tenantIdAtom: import("jotai").PrimitiveAtom<string> & {
92
92
  export declare const templateIdAtom: import("jotai").PrimitiveAtom<string> & {
93
93
  init: string;
94
94
  };
95
- export declare const templateDataAtom: import("jotai").PrimitiveAtom<TenantData | null> & {
95
+ export declare const tenantDataAtom: import("jotai").PrimitiveAtom<TenantData | null> & {
96
96
  init: TenantData | null;
97
97
  };
98
- export declare const isTemplateLoadingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
98
+ export declare const isTenantLoadingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
99
99
  init: boolean | null;
100
100
  };
101
- export declare const isTemplateSavingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
101
+ export declare const isTenantSavingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
102
102
  init: boolean | null;
103
103
  };
104
- export declare const isTemplatePublishingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
104
+ export declare const isTenantPublishingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
105
105
  init: boolean | null;
106
106
  };
107
- export declare const templateErrorAtom: import("jotai").PrimitiveAtom<string | null> & {
107
+ export declare const tenantErrorAtom: import("jotai").PrimitiveAtom<string | null> & {
108
108
  init: string | null;
109
109
  };
110
110
  export declare const brandApplyAtom: import("jotai").PrimitiveAtom<boolean> & {
111
111
  init: boolean;
112
112
  };
113
- export declare const getTemplateOverrideAtom: import("jotai").PrimitiveAtom<((options?: {
114
- includeBrand?: boolean;
115
- }) => Promise<void>) | null> & {
116
- init: ((options?: {
117
- includeBrand?: boolean;
118
- }) => Promise<void>) | null;
119
- };
120
- export declare const saveTemplateOverrideAtom: import("jotai").PrimitiveAtom<((actions: any, options?: any) => Promise<void>) | null> & {
121
- init: ((actions: any, options?: any) => Promise<void>) | null;
122
- };
@@ -27,7 +27,7 @@ export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "b
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, templateData, togglePreviewMode, }: {
30
+ render?: ({ subject, handleSubjectChange, selectedNode, setSelectedNode, previewMode, emailEditor, ref, isBrandApply, brandSettings, items, content, strategy, syncEditorItems, brandEditorContent, tenantData, 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
- templateData: TenantData | null;
45
+ tenantData: TenantData | null;
46
46
  togglePreviewMode: (mode: "desktop" | "mobile" | undefined) => void;
47
47
  }) => React.ReactNode;
48
48
  }
@@ -12,8 +12,6 @@ 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 InboxEditorProps, type PushEditorProps, type SMSEditorProps, } from "./Channels";
15
+ export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type SMSEditorProps, type InboxEditorProps, type PushEditorProps, } from "./Channels";
16
16
  export { ChannelRootContainer, EditorSidebar } from "./Layout";
17
17
  export { InboxEditor, PushEditor, SMSEditor } from "./Channels";
18
- export { useAutoSave } from "@/hooks/useAutoSave";
19
- export { Status as TemplateStatus } from "@/components/ui/Status";
@@ -2,9 +2,6 @@ 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;
8
5
  }
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;
6
+ export declare const Status: ({ isError, isSaving, isLoading }: StatusProps) => import("react/jsx-runtime").JSX.Element | null;
10
7
  export {};