@trycourier/react-designer 0.0.0-canary-20250725092737 → 0.0.0-canary-20250828155722
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.
- package/README.md +21 -20
- package/dist/cjs/index.js +34 -34
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/Providers/BrandProvider.d.ts +0 -12
- package/dist/components/Providers/TemplateProvider.d.ts +7 -12
- package/dist/components/Providers/api/common.d.ts +1 -1
- package/dist/components/Providers/api/template.d.ts +1 -1
- package/dist/components/Providers/index.d.ts +4 -2
- package/dist/components/Providers/store.d.ts +15 -5
- package/dist/components/Providers/useBrandActions.d.ts +13 -0
- package/dist/components/Providers/useTemplateActions.d.ts +19 -0
- package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +4 -4
- package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +7 -3
- package/dist/components/TemplateEditor/Channels/Inbox/InboxEditor.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +6 -4
- package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +6 -4
- package/dist/components/TemplateEditor/TemplateEditor.d.ts +2 -2
- package/dist/components/TemplateEditor/index.d.ts +4 -1
- package/dist/components/ui/Status/Status.d.ts +4 -1
- package/dist/esm/index.js +34 -34
- package/dist/esm/index.js.map +4 -4
- package/package.json +1 -1
|
@@ -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,18 +1,13 @@
|
|
|
1
1
|
import type { BasicProviderProps } from "./Providers.types";
|
|
2
|
-
|
|
3
|
-
getTenant: (options?: {
|
|
4
|
-
includeBrand?: boolean;
|
|
5
|
-
} | undefined) => Promise<void>;
|
|
6
|
-
saveTemplate: (routing: import("./store").MessageRouting) => 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 { useTemplateActions } from "./useTemplateActions";
|
|
14
3
|
type TemplateProviderProps = BasicProviderProps & {
|
|
15
4
|
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;
|
|
16
11
|
};
|
|
17
12
|
export declare const TemplateProvider: import("react").NamedExoticComponent<TemplateProviderProps>;
|
|
18
13
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MessageRouting } from "../store";
|
|
2
|
-
export declare const saveTemplateAtom: import("jotai").WritableAtom<null, [routing
|
|
2
|
+
export declare const saveTemplateAtom: import("jotai").WritableAtom<null, [routing?: MessageRouting | undefined], Promise<any>> & {
|
|
3
3
|
init: null;
|
|
4
4
|
};
|
|
5
5
|
export declare const publishTemplateAtom: import("jotai").WritableAtom<null, [], Promise<any>> & {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export {
|
|
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";
|
|
@@ -92,21 +92,31 @@ 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
|
|
95
|
+
export declare const templateDataAtom: import("jotai").PrimitiveAtom<TenantData | null> & {
|
|
96
96
|
init: TenantData | null;
|
|
97
97
|
};
|
|
98
|
-
export declare const
|
|
98
|
+
export declare const isTemplateLoadingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
|
|
99
99
|
init: boolean | null;
|
|
100
100
|
};
|
|
101
|
-
export declare const
|
|
101
|
+
export declare const isTemplateSavingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
|
|
102
102
|
init: boolean | null;
|
|
103
103
|
};
|
|
104
|
-
export declare const
|
|
104
|
+
export declare const isTemplatePublishingAtom: import("jotai").PrimitiveAtom<boolean | null> & {
|
|
105
105
|
init: boolean | null;
|
|
106
106
|
};
|
|
107
|
-
export declare const
|
|
107
|
+
export declare const templateErrorAtom: 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
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function useBrandActions(): {
|
|
2
|
+
getTemplate: (options?: {
|
|
3
|
+
includeBrand?: boolean;
|
|
4
|
+
}) => Promise<void>;
|
|
5
|
+
saveTemplate: (options?: any) => Promise<void>;
|
|
6
|
+
saveBrand: (settings?: Record<string, unknown> | undefined) => Promise<any>;
|
|
7
|
+
publishBrand: () => Promise<any>;
|
|
8
|
+
isTemplateLoading: boolean | null;
|
|
9
|
+
isTemplateSaving: boolean | null;
|
|
10
|
+
isTemplatePublishing: boolean | null;
|
|
11
|
+
templateError: string | null;
|
|
12
|
+
templateData: import("./store").TenantData | null;
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function useTemplateActions(): {
|
|
2
|
+
getTemplate: (options?: {
|
|
3
|
+
includeBrand?: boolean;
|
|
4
|
+
}) => Promise<void>;
|
|
5
|
+
saveTemplate: (options?: any) => Promise<void>;
|
|
6
|
+
publishTemplate: () => Promise<any>;
|
|
7
|
+
isTemplateLoading: boolean | null;
|
|
8
|
+
setIsTemplateLoading: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
|
|
9
|
+
isTemplateSaving: boolean | null;
|
|
10
|
+
setIsTemplateSaving: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
|
|
11
|
+
isTemplatePublishing: boolean | null;
|
|
12
|
+
setIsTemplatePublishing: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
|
|
13
|
+
templateError: string | null;
|
|
14
|
+
setTemplateError: (args_0: string | ((prev: string | null) => string | null) | null) => void;
|
|
15
|
+
templateData: import("./store").TenantData | null;
|
|
16
|
+
setTemplateData: (args_0: import("./store").TenantData | ((prev: import("./store").TenantData | null) => import("./store").TenantData | null) | null) => void;
|
|
17
|
+
templateEditorContent: import("../TemplateEditor").ElementalContent | null | undefined;
|
|
18
|
+
setTemplateEditorContent: (args_0: import("../TemplateEditor").ElementalContent | ((prev: import("../TemplateEditor").ElementalContent | null | undefined) => import("../TemplateEditor").ElementalContent | null | undefined) | null | undefined) => void;
|
|
19
|
+
};
|
|
@@ -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
|
-
routing
|
|
28
|
+
routing?: MessageRouting;
|
|
29
29
|
}) => React.ReactNode;
|
|
30
|
-
render?: ({ subject, handleSubjectChange, selectedNode, setSelectedNode, previewMode, emailEditor, ref, isBrandApply, brandSettings, items, content, strategy, syncEditorItems, brandEditorContent,
|
|
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
|
-
|
|
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
|
-
|
|
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,13 +20,14 @@ 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;
|
|
24
27
|
channels?: ChannelType[];
|
|
25
|
-
routing
|
|
28
|
+
routing?: MessageRouting;
|
|
26
29
|
}) => React.ReactNode;
|
|
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;
|
|
@@ -5,9 +5,11 @@ import type { ChannelType } from "@/store";
|
|
|
5
5
|
import type { ElementalNode } from "@/types/elemental.types";
|
|
6
6
|
import type { AnyExtension, Editor } from "@tiptap/react";
|
|
7
7
|
import type { TemplateEditorProps } from "../../TemplateEditor";
|
|
8
|
-
export declare const PushEditorContent: (
|
|
8
|
+
export declare const PushEditorContent: ({ value }: {
|
|
9
|
+
value?: TiptapDoc | null;
|
|
10
|
+
}) => null;
|
|
9
11
|
export interface PushRenderProps {
|
|
10
|
-
content: TiptapDoc;
|
|
12
|
+
content: TiptapDoc | null;
|
|
11
13
|
extensions: AnyExtension[];
|
|
12
14
|
editable: boolean;
|
|
13
15
|
autofocus: boolean;
|
|
@@ -15,12 +17,12 @@ export interface PushRenderProps {
|
|
|
15
17
|
editor: Editor;
|
|
16
18
|
}) => void;
|
|
17
19
|
}
|
|
18
|
-
export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
|
|
20
|
+
export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value"> {
|
|
19
21
|
readOnly?: boolean;
|
|
20
22
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
21
23
|
hidePublish?: boolean;
|
|
22
24
|
channels?: ChannelType[];
|
|
23
|
-
routing
|
|
25
|
+
routing?: MessageRouting;
|
|
24
26
|
}) => React.ReactNode;
|
|
25
27
|
render?: (props: PushRenderProps) => React.ReactNode;
|
|
26
28
|
}
|
|
@@ -6,9 +6,11 @@ import type { MessageRouting } from "../../../Providers/store";
|
|
|
6
6
|
import type { ChannelType } from "@/store";
|
|
7
7
|
import type { TemplateEditorProps } from "../../TemplateEditor";
|
|
8
8
|
export declare const defaultSMSContent: ElementalNode[];
|
|
9
|
-
export declare const SMSEditorContent: (
|
|
9
|
+
export declare const SMSEditorContent: ({ value }: {
|
|
10
|
+
value?: TiptapDoc | null;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export interface SMSRenderProps {
|
|
11
|
-
content: TiptapDoc;
|
|
13
|
+
content: TiptapDoc | null;
|
|
12
14
|
extensions: AnyExtension[];
|
|
13
15
|
editable: boolean;
|
|
14
16
|
autofocus: boolean;
|
|
@@ -16,12 +18,12 @@ export interface SMSRenderProps {
|
|
|
16
18
|
editor: Editor;
|
|
17
19
|
}) => void;
|
|
18
20
|
}
|
|
19
|
-
export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
|
|
21
|
+
export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value"> {
|
|
20
22
|
readOnly?: boolean;
|
|
21
23
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
22
24
|
hidePublish?: boolean;
|
|
23
25
|
channels?: ChannelType[];
|
|
24
|
-
routing
|
|
26
|
+
routing?: MessageRouting;
|
|
25
27
|
}) => React.ReactNode;
|
|
26
28
|
render?: (props: SMSRenderProps) => React.ReactNode;
|
|
27
29
|
}
|
|
@@ -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;
|
|
@@ -14,6 +14,6 @@ export interface TemplateEditorProps {
|
|
|
14
14
|
brandEditor?: boolean;
|
|
15
15
|
brandProps?: BrandEditorProps;
|
|
16
16
|
channels?: ChannelType[];
|
|
17
|
-
routing
|
|
17
|
+
routing?: MessageRouting;
|
|
18
18
|
}
|
|
19
19
|
export declare const TemplateEditor: import("react").NamedExoticComponent<TemplateEditorProps>;
|
|
@@ -12,6 +12,9 @@ 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
|
|
15
|
+
export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type InboxEditorProps, type PushEditorProps, type SMSEditorProps, } from "./Channels";
|
|
16
|
+
export type { ElementalContent } from "@/types";
|
|
16
17
|
export { ChannelRootContainer, EditorSidebar } from "./Layout";
|
|
17
18
|
export { InboxEditor, PushEditor, SMSEditor } from "./Channels";
|
|
19
|
+
export { useAutoSave } from "@/hooks/useAutoSave";
|
|
20
|
+
export { Status as TemplateStatus } from "@/components/ui/Status";
|
|
@@ -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 {};
|