@trycourier/react-designer 0.0.2 → 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.
- package/README.md +3 -2
- package/dist/channels.d.ts +7 -0
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +2 -2
- package/dist/cjs/index.js +44 -30
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/styles.css +485 -31
- package/dist/components/BrandEditor/BrandEditor.types.d.ts +36 -0
- package/dist/components/BrandEditor/Editor/BrandFooter/BrandFooter.d.ts +8 -3
- package/dist/components/BrandEditor/Editor/Editor.d.ts +2 -40
- package/dist/components/BrandEditor/Editor/SideBar/SideBar.d.ts +2 -7
- package/dist/components/Providers/TemplateProvider.d.ts +1 -1
- package/dist/components/Providers/api/template.d.ts +2 -1
- package/dist/components/Providers/store.d.ts +8 -9
- package/dist/components/TemplateEditor/Channels/Channels.d.ts +6 -0
- package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +55 -0
- package/dist/components/TemplateEditor/Channels/Email/Email.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Email/EmailEditor.d.ts +17 -0
- package/dist/components/TemplateEditor/Channels/Email/EmailEditor.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Email/EmailLayout.d.ts +9 -0
- package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBar.d.ts +7 -0
- package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItemDetails/SideBarItemDetails.d.ts +1 -2
- package/dist/components/TemplateEditor/Channels/Email/SideBar/index.d.ts +2 -0
- package/dist/components/TemplateEditor/Channels/Email/index.d.ts +3 -0
- package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +29 -0
- package/dist/components/TemplateEditor/Channels/Inbox/Inbox.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Inbox/InboxEditor.d.ts +4 -0
- package/dist/components/TemplateEditor/Channels/Inbox/InboxEditor.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Inbox/InboxLayout.d.ts +4 -0
- package/dist/components/TemplateEditor/Channels/Inbox/SideBar/SideBar.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Inbox/index.d.ts +3 -0
- package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +29 -0
- package/dist/components/TemplateEditor/Channels/Push/Push.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Push/PushEditor.d.ts +5 -0
- package/dist/components/TemplateEditor/Channels/Push/PushEditor.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Push/PushLayout.d.ts +4 -0
- package/dist/components/TemplateEditor/Channels/Push/index.d.ts +3 -0
- package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +29 -0
- package/dist/components/TemplateEditor/Channels/SMS/SMS.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/SMS/SMSEditor.d.ts +5 -0
- package/dist/components/TemplateEditor/Channels/SMS/SMSEditor.test.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/SMS/SMSLayout.d.ts +4 -0
- package/dist/components/TemplateEditor/Channels/SMS/index.d.ts +3 -0
- package/dist/components/TemplateEditor/Channels/index.d.ts +6 -0
- package/dist/components/TemplateEditor/Channels/useChannels.d.ts +14 -0
- package/dist/components/TemplateEditor/Channels/useChannels.test.d.ts +1 -0
- package/dist/components/TemplateEditor/IPhoneFrame/IPhoneFrame.d.ts +4 -0
- package/dist/components/TemplateEditor/IPhoneFrame/index.d.ts +1 -0
- package/dist/components/TemplateEditor/Layout/Layout.d.ts +8 -0
- package/dist/components/TemplateEditor/Layout/index.d.ts +1 -0
- package/dist/components/TemplateEditor/TemplateEditor.d.ts +4 -0
- package/dist/components/TemplateEditor/index.d.ts +16 -0
- package/dist/components/TemplateEditor/store.d.ts +13 -0
- package/dist/components/extensions/Blockquote/Blockquote.test.d.ts +1 -0
- package/dist/components/extensions/Blockquote/Blockquote.types.d.ts +2 -2
- package/dist/components/extensions/Button/Button.test.d.ts +1 -0
- package/dist/components/extensions/Button/Button.types.d.ts +6 -6
- package/dist/components/extensions/ButtonRow/ButtonRow.d.ts +11 -0
- package/dist/components/extensions/ButtonRow/ButtonRow.test.d.ts +1 -0
- package/dist/components/extensions/ButtonRow/ButtonRow.types.d.ts +45 -0
- package/dist/components/extensions/ButtonRow/ButtonRowComponent.d.ts +5 -0
- package/dist/components/extensions/ButtonRow/index.d.ts +4 -0
- package/dist/components/extensions/Divider/Divider.test.d.ts +1 -0
- package/dist/components/extensions/DragPlaceholder/DragPlaceholder.test.d.ts +1 -0
- package/dist/components/extensions/FileHandler/FileHandler.test.d.ts +1 -0
- package/dist/components/extensions/FixedChannelPaste/FixedChannelPaste.d.ts +11 -0
- package/dist/components/extensions/FixedChannelPaste/FixedChannelPaste.test.d.ts +1 -0
- package/dist/components/extensions/FixedChannelPaste/index.d.ts +2 -0
- package/dist/components/extensions/FixedChannelSelection/FixedChannelSelection.d.ts +14 -0
- package/dist/components/extensions/FixedChannelSelection/FixedChannelSelection.test.d.ts +1 -0
- package/dist/components/extensions/FixedChannelSelection/index.d.ts +1 -0
- package/dist/components/extensions/Heading/Heading.test.d.ts +1 -0
- package/dist/components/extensions/Image/Image.test.d.ts +1 -0
- package/dist/components/extensions/ImageBlock/ImageBlock.test.d.ts +1 -0
- package/dist/components/extensions/Link/Link.test.d.ts +1 -0
- package/dist/components/extensions/Paragraph/Paragraph.test.d.ts +1 -0
- package/dist/components/extensions/Selection/Selection.test.d.ts +1 -0
- package/dist/components/extensions/TextBlock/TextBlock.test.d.ts +1 -0
- package/dist/components/extensions/TextBlock/TextBlock.types.d.ts +4 -4
- package/dist/components/extensions/UniqueId/UniqueId.test.d.ts +1 -0
- package/dist/components/extensions/Variable/Variable.test.d.ts +1 -0
- package/dist/components/extensions/Variable/VariablePaste.d.ts +2 -0
- package/dist/components/extensions/Variable/VariablePaste.test.d.ts +1 -0
- package/dist/components/extensions/Variable/index.d.ts +1 -0
- package/dist/components/extensions/extension-kit.d.ts +1 -4
- package/dist/components/extensions/index.d.ts +4 -1
- package/dist/components/ui/MainLayout/MainLayout.d.ts +9 -0
- package/dist/components/ui/MainLayout/index.d.ts +1 -0
- package/dist/components/ui/PreviewPanel/PreviewPanel.d.ts +3 -2
- package/dist/components/ui/Status/Status.d.ts +1 -1
- package/dist/components/ui/TextMenu/BubbleTextMenu.d.ts +6 -0
- package/dist/components/ui/TextMenu/TextMenu.d.ts +3 -1
- package/dist/components/ui/TextMenu/config.d.ts +1 -1
- package/dist/components/ui/TextMenu/hooks/useTextmenuStates.d.ts +3 -5
- package/dist/components/ui/TextMenu/store.d.ts +1 -16
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui-kit/AlertDialog/AlertDialog.d.ts +20 -0
- package/dist/components/ui-kit/AlertDialog/index.d.ts +1 -0
- package/dist/components/ui-kit/Button/Button.d.ts +1 -2
- package/dist/components/ui-kit/Icon/BatteryIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/ExpandIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/HamburgerMenuIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/InAppIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/InboxIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/MoreMenuIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/PushIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/SMSIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/SignalIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/WiFiIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/index.d.ts +10 -0
- package/dist/components/ui-kit/Separator/Separator.d.ts +4 -0
- package/dist/components/ui-kit/Separator/index.d.ts +1 -0
- package/dist/components/ui-kit/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/components/ui-kit/index.d.ts +2 -0
- package/dist/components/utils/index.d.ts +1 -0
- package/dist/components/utils/safeGetPos.d.ts +13 -0
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +2 -2
- package/dist/esm/index.js +44 -30
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/styles.css +485 -31
- package/dist/lib/utils/convertElementalToTiptap/convertElementalToTiptap.d.ts +5 -1
- package/dist/lib/utils/convertElementalToTiptap/convertElementalToTiptap.test.d.ts +1 -0
- package/dist/lib/utils/convertMarkdownToTiptap/convertMarkdownToTiptap.test.d.ts +1 -0
- package/dist/lib/utils/convertTiptapToElemental/convertTiptapToElemental.d.ts +2 -2
- package/dist/lib/utils/convertTiptapToElemental/convertTiptapToElemental.test.d.ts +1 -0
- package/dist/lib/utils/convertTiptapToMarkdown/convertTiptapToMarkdown.test.d.ts +1 -0
- package/dist/lib/utils/index.d.ts +2 -1
- package/dist/lib/utils/updateElemental/index.d.ts +1 -0
- package/dist/lib/utils/updateElemental/updateElemental.d.ts +11 -0
- package/dist/lib/utils/updateElemental/updateElemental.test.d.ts +1 -0
- package/dist/store.d.ts +7 -2
- package/dist/styles.css +485 -31
- package/dist/types/elemental.schema.d.ts +3 -3
- package/dist/types/elemental.types.d.ts +0 -1
- package/package.json +14 -11
- package/dist/components/BrandEditor/Editor/useBlockEditor.d.ts +0 -23
- package/dist/components/TemplateEditor/Editor/Editor.d.ts +0 -11
- package/dist/components/TemplateEditor/Editor/SideBar/SideBar.d.ts +0 -7
- package/dist/components/TemplateEditor/Editor/index.d.ts +0 -1
- package/dist/components/TemplateEditor/Editor/useBlockEditor.d.ts +0 -23
- package/dist/components/ui/EditorLayout/EditorLayout.d.ts +0 -6
- package/dist/components/ui/EditorLayout/index.d.ts +0 -1
- /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItem/SideBarItem.d.ts +0 -0
- /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItem/index.d.ts +0 -0
- /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItemDetails/index.d.ts +0 -0
- /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarSortableItemWrapper/SideBarSortableItemWrapper.d.ts +0 -0
- /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarSortableItemWrapper/index.d.ts +0 -0
- /package/dist/components/TemplateEditor/{Editor → Channels/Inbox}/SideBar/index.d.ts +0 -0
|
@@ -44,3 +44,39 @@ export declare const brandEditorSchema: z.ZodObject<{
|
|
|
44
44
|
}>;
|
|
45
45
|
export type BrandEditorFormValues = z.infer<typeof brandEditorSchema>;
|
|
46
46
|
export declare const defaultBrandEditorFormValues: BrandEditorFormValues;
|
|
47
|
+
export interface BrandSettings {
|
|
48
|
+
colors?: {
|
|
49
|
+
primary?: string;
|
|
50
|
+
secondary?: string;
|
|
51
|
+
tertiary?: string;
|
|
52
|
+
};
|
|
53
|
+
email?: {
|
|
54
|
+
header?: {
|
|
55
|
+
barColor?: string;
|
|
56
|
+
logo?: {
|
|
57
|
+
href?: string;
|
|
58
|
+
image?: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
footer?: {
|
|
62
|
+
markdown?: string;
|
|
63
|
+
social?: {
|
|
64
|
+
facebook?: {
|
|
65
|
+
url?: string;
|
|
66
|
+
};
|
|
67
|
+
instagram?: {
|
|
68
|
+
url?: string;
|
|
69
|
+
};
|
|
70
|
+
linkedin?: {
|
|
71
|
+
url?: string;
|
|
72
|
+
};
|
|
73
|
+
medium?: {
|
|
74
|
+
url?: string;
|
|
75
|
+
};
|
|
76
|
+
twitter?: {
|
|
77
|
+
url?: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Transaction } from "@tiptap/pm/state";
|
|
2
|
+
import type { Editor } from "@tiptap/react";
|
|
2
3
|
interface BrandFooterProps {
|
|
4
|
+
value?: string | null;
|
|
3
5
|
variables?: Record<string, unknown>;
|
|
4
|
-
setEditor?: (editor: TiptapEditor | null) => void;
|
|
5
6
|
readOnly?: boolean;
|
|
6
7
|
facebookLink?: string;
|
|
7
8
|
linkedinLink?: string;
|
|
8
9
|
instagramLink?: string;
|
|
9
10
|
mediumLink?: string;
|
|
10
11
|
xLink?: string;
|
|
12
|
+
onUpdate?: (props: {
|
|
13
|
+
editor: Editor;
|
|
14
|
+
transaction: Transaction;
|
|
15
|
+
}) => void;
|
|
11
16
|
}
|
|
12
|
-
export declare const BrandFooter: import("react").MemoExoticComponent<({ variables, facebookLink, linkedinLink, instagramLink, mediumLink, xLink, readOnly,
|
|
17
|
+
export declare const BrandFooter: import("react").MemoExoticComponent<({ variables, facebookLink, linkedinLink, instagramLink, mediumLink, xLink, readOnly, value, onUpdate, }: BrandFooterProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
18
|
export {};
|
|
@@ -1,48 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
colors?: {
|
|
3
|
-
primary?: string;
|
|
4
|
-
secondary?: string;
|
|
5
|
-
tertiary?: string;
|
|
6
|
-
};
|
|
7
|
-
email?: {
|
|
8
|
-
header?: {
|
|
9
|
-
barColor?: string;
|
|
10
|
-
logo?: {
|
|
11
|
-
href?: string;
|
|
12
|
-
image?: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
footer?: {
|
|
16
|
-
markdown?: string;
|
|
17
|
-
social?: {
|
|
18
|
-
facebook?: {
|
|
19
|
-
url?: string;
|
|
20
|
-
};
|
|
21
|
-
instagram?: {
|
|
22
|
-
url?: string;
|
|
23
|
-
};
|
|
24
|
-
linkedin?: {
|
|
25
|
-
url?: string;
|
|
26
|
-
};
|
|
27
|
-
medium?: {
|
|
28
|
-
url?: string;
|
|
29
|
-
};
|
|
30
|
-
twitter?: {
|
|
31
|
-
url?: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}
|
|
1
|
+
import type { BrandEditorFormValues } from "../BrandEditor.types";
|
|
37
2
|
export interface EditorProps {
|
|
38
3
|
hidePublish?: boolean;
|
|
39
4
|
autoSaveDebounce?: number;
|
|
40
5
|
autoSave?: boolean;
|
|
41
6
|
templateEditor?: boolean;
|
|
42
|
-
isVisible?: boolean;
|
|
43
7
|
variables?: Record<string, unknown>;
|
|
44
|
-
value?:
|
|
45
|
-
onChange?: (value: BrandSettings) => void;
|
|
8
|
+
value?: BrandEditorFormValues;
|
|
46
9
|
}
|
|
47
10
|
export declare const Editor: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<EditorProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
48
|
-
export {};
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const SideBar: ({ editor, setForm, currentForm, }: {
|
|
4
|
-
editor: Editor;
|
|
5
|
-
setForm: (form: BrandEditorFormValues) => void;
|
|
6
|
-
currentForm?: BrandEditorFormValues;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const SideBarComponent: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const SideBar: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -3,7 +3,7 @@ export declare function useTemplateActions(): {
|
|
|
3
3
|
getTenant: (options?: {
|
|
4
4
|
includeBrand?: boolean;
|
|
5
5
|
} | undefined) => Promise<void>;
|
|
6
|
-
saveTemplate: () => Promise<any>;
|
|
6
|
+
saveTemplate: (routing?: import("./store").MessageRouting | undefined) => Promise<any>;
|
|
7
7
|
publishTemplate: () => Promise<any>;
|
|
8
8
|
isTenantLoading: boolean | null;
|
|
9
9
|
isTenantSaving: boolean | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type MessageRouting } from "../store";
|
|
2
|
+
export declare const saveTemplateAtom: import("jotai").WritableAtom<null, [routing?: MessageRouting | undefined], Promise<any>> & {
|
|
2
3
|
init: null;
|
|
3
4
|
};
|
|
4
5
|
export declare const publishTemplateAtom: import("jotai").WritableAtom<null, [], Promise<any>> & {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type { Editor } from "@tiptap/react";
|
|
2
1
|
import type { ElementalContent } from "@/types/elemental.types";
|
|
2
|
+
export type MessageRoutingMethod = "all" | "single";
|
|
3
|
+
export type MessageRoutingChannel = string | MessageRouting;
|
|
4
|
+
export interface MessageRouting {
|
|
5
|
+
method: MessageRoutingMethod;
|
|
6
|
+
channels: MessageRoutingChannel[];
|
|
7
|
+
}
|
|
3
8
|
export interface TenantData {
|
|
4
9
|
data?: {
|
|
5
10
|
tenant?: {
|
|
@@ -7,15 +12,12 @@ export interface TenantData {
|
|
|
7
12
|
name?: string;
|
|
8
13
|
notification?: {
|
|
9
14
|
createdAt?: string;
|
|
15
|
+
publishedAt?: string | null;
|
|
10
16
|
notificationId?: string;
|
|
11
17
|
version?: string;
|
|
12
18
|
data?: {
|
|
13
19
|
content?: ElementalContent;
|
|
14
|
-
routing?:
|
|
15
|
-
method?: string;
|
|
16
|
-
channels?: string[];
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
};
|
|
20
|
+
routing?: MessageRouting;
|
|
19
21
|
[key: string]: unknown;
|
|
20
22
|
};
|
|
21
23
|
[key: string]: unknown;
|
|
@@ -108,6 +110,3 @@ export declare const tenantErrorAtom: import("jotai").PrimitiveAtom<string | nul
|
|
|
108
110
|
export declare const brandApplyAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
109
111
|
init: boolean;
|
|
110
112
|
};
|
|
111
|
-
export declare const tenantEditorAtom: import("jotai").PrimitiveAtom<Editor | null> & {
|
|
112
|
-
init: Editor | null;
|
|
113
|
-
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TemplateEditorProps } from "../TemplateEditor";
|
|
2
|
+
interface ChannelsProps extends Pick<TemplateEditorProps, "hidePublish" | "channels"> {
|
|
3
|
+
routing?: TemplateEditorProps["routing"];
|
|
4
|
+
}
|
|
5
|
+
export declare const Channels: ({ hidePublish, channels: channelsProp, routing, }: ChannelsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { TiptapDoc } from "@/lib/utils";
|
|
2
|
+
import type { ChannelType } from "@/store";
|
|
3
|
+
import type { ElementalNode } from "@/types/elemental.types";
|
|
4
|
+
import type { UniqueIdentifier } from "@dnd-kit/core";
|
|
5
|
+
import type { SortingStrategy } from "@dnd-kit/sortable";
|
|
6
|
+
import type { Node } from "@tiptap/pm/model";
|
|
7
|
+
import type { Editor } from "@tiptap/react";
|
|
8
|
+
import type { MessageRouting, TenantData } from "../../../Providers/store";
|
|
9
|
+
import type { TemplateEditorProps } from "../../TemplateEditor";
|
|
10
|
+
interface BrandSettingsData {
|
|
11
|
+
brandColor?: string;
|
|
12
|
+
textColor?: string;
|
|
13
|
+
subtleColor?: string;
|
|
14
|
+
headerStyle: "border" | "plain";
|
|
15
|
+
logo?: string;
|
|
16
|
+
link?: string;
|
|
17
|
+
facebookLink?: string;
|
|
18
|
+
linkedinLink?: string;
|
|
19
|
+
instagramLink?: string;
|
|
20
|
+
mediumLink?: string;
|
|
21
|
+
xLink?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "brandEditor" | "channels" | "variables" | "theme" | "routing"> {
|
|
24
|
+
isLoading?: boolean;
|
|
25
|
+
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
26
|
+
hidePublish?: boolean;
|
|
27
|
+
channels?: ChannelType[];
|
|
28
|
+
routing?: MessageRouting;
|
|
29
|
+
}) => React.ReactNode;
|
|
30
|
+
render?: ({ subject, handleSubjectChange, selectedNode, setSelectedNode, previewMode, emailEditor, ref, isBrandApply, brandSettings, items, content, strategy, syncEditorItems, brandEditorContent, tenantData, togglePreviewMode, }: {
|
|
31
|
+
subject: string | null;
|
|
32
|
+
handleSubjectChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
33
|
+
selectedNode: Node | null;
|
|
34
|
+
setSelectedNode: (node: Node | null) => void;
|
|
35
|
+
previewMode: "desktop" | "mobile" | undefined;
|
|
36
|
+
emailEditor: Editor | null;
|
|
37
|
+
ref: React.RefObject<HTMLDivElement> | null;
|
|
38
|
+
isBrandApply: boolean;
|
|
39
|
+
brandSettings: BrandSettingsData | null;
|
|
40
|
+
items: Items;
|
|
41
|
+
content: TiptapDoc | null;
|
|
42
|
+
strategy: SortingStrategy;
|
|
43
|
+
syncEditorItems: (editor: Editor) => void;
|
|
44
|
+
brandEditorContent: string | null;
|
|
45
|
+
tenantData: TenantData | null;
|
|
46
|
+
togglePreviewMode: (mode: "desktop" | "mobile" | undefined) => void;
|
|
47
|
+
}) => React.ReactNode;
|
|
48
|
+
}
|
|
49
|
+
interface Items {
|
|
50
|
+
Editor: UniqueIdentifier[];
|
|
51
|
+
Sidebar: UniqueIdentifier[];
|
|
52
|
+
}
|
|
53
|
+
export declare const defaultEmailContent: ElementalNode[];
|
|
54
|
+
export declare const Email: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<EmailProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TiptapDoc } from "@/types";
|
|
2
|
+
import type { Editor } from "@tiptap/core";
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
editor: Editor | null;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface EmailEditorProps {
|
|
9
|
+
value?: TiptapDoc;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
subject?: string | null;
|
|
12
|
+
variables?: Record<string, unknown>;
|
|
13
|
+
onDestroy?: () => void;
|
|
14
|
+
onUpdate?: (editor: Editor) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const EmailEditor: ({ value, readOnly, variables, onDestroy, onUpdate, subject: propSubject, }: EmailEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default EmailEditor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import { type EmailProps } from "./Email";
|
|
3
|
+
export declare const EmailEditorContainer: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const EmailEditorMain: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
previewMode: "desktop" | "mobile" | undefined;
|
|
6
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export interface EmailLayoutProps extends EmailProps {
|
|
8
|
+
}
|
|
9
|
+
export declare const EmailLayout: ({ variables, theme, isLoading, hidePublish, channels, brandEditor, routing, }: EmailLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UniqueIdentifier } from "@dnd-kit/core";
|
|
2
|
+
export interface SideBarProps {
|
|
3
|
+
items: UniqueIdentifier[];
|
|
4
|
+
brandEditor?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const SideBar: ({ items, brandEditor, label }: SideBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
|
2
2
|
import type { Editor } from "@tiptap/react";
|
|
3
|
-
interface SideBarItemDetailsProps {
|
|
3
|
+
export interface SideBarItemDetailsProps {
|
|
4
4
|
element?: ProseMirrorNode;
|
|
5
5
|
editor: Editor | null;
|
|
6
6
|
}
|
|
7
7
|
export declare const SideBarItemDetails: ({ element, editor }: SideBarItemDetailsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MessageRouting } from "@/components/Providers/store";
|
|
2
|
+
import type { TextMenuConfig } from "@/components/ui/TextMenu/config";
|
|
3
|
+
import type { TiptapDoc } from "@/lib/utils";
|
|
4
|
+
import type { ChannelType } from "@/store";
|
|
5
|
+
import type { ElementalNode } from "@/types/elemental.types";
|
|
6
|
+
import type { AnyExtension, Editor } from "@tiptap/react";
|
|
7
|
+
import type { TemplateEditorProps } from "../../TemplateEditor";
|
|
8
|
+
export declare const defaultInboxContent: ElementalNode[];
|
|
9
|
+
export declare const InboxConfig: TextMenuConfig;
|
|
10
|
+
export declare const InboxEditorContent: () => null;
|
|
11
|
+
export interface InboxRenderProps {
|
|
12
|
+
content: TiptapDoc;
|
|
13
|
+
extensions: AnyExtension[];
|
|
14
|
+
editable: boolean;
|
|
15
|
+
autofocus: boolean;
|
|
16
|
+
onUpdate: ({ editor }: {
|
|
17
|
+
editor: Editor;
|
|
18
|
+
}) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
23
|
+
hidePublish?: boolean;
|
|
24
|
+
channels?: ChannelType[];
|
|
25
|
+
routing?: MessageRouting;
|
|
26
|
+
}) => React.ReactNode;
|
|
27
|
+
render?: (props: InboxRenderProps) => React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const Inbox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<InboxProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SideBar: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MessageRouting } from "@/components/Providers/store";
|
|
2
|
+
import type { TextMenuConfig } from "@/components/ui/TextMenu/config";
|
|
3
|
+
import type { TiptapDoc } from "@/lib/utils";
|
|
4
|
+
import type { ChannelType } from "@/store";
|
|
5
|
+
import type { ElementalNode } from "@/types/elemental.types";
|
|
6
|
+
import type { AnyExtension, Editor } from "@tiptap/react";
|
|
7
|
+
import type { TemplateEditorProps } from "../../TemplateEditor";
|
|
8
|
+
export declare const PushEditorContent: () => null;
|
|
9
|
+
export interface PushRenderProps {
|
|
10
|
+
content: TiptapDoc;
|
|
11
|
+
extensions: AnyExtension[];
|
|
12
|
+
editable: boolean;
|
|
13
|
+
autofocus: boolean;
|
|
14
|
+
onUpdate: ({ editor }: {
|
|
15
|
+
editor: Editor;
|
|
16
|
+
}) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
21
|
+
hidePublish?: boolean;
|
|
22
|
+
channels?: ChannelType[];
|
|
23
|
+
routing?: MessageRouting;
|
|
24
|
+
}) => React.ReactNode;
|
|
25
|
+
render?: (props: PushRenderProps) => React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare const defaultPushContent: ElementalNode[];
|
|
28
|
+
export declare const PushConfig: TextMenuConfig;
|
|
29
|
+
export declare const Push: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<PushProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import { type PushRenderProps } from "./Push";
|
|
3
|
+
export interface PushEditorProps extends PushRenderProps, Omit<HTMLAttributes<HTMLDivElement>, "content"> {
|
|
4
|
+
}
|
|
5
|
+
export declare const PushEditor: ({ content, extensions, editable, autofocus, onUpdate, className, }: PushEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TextMenuConfig } from "@/components/ui/TextMenu/config";
|
|
2
|
+
import type { TiptapDoc } from "@/lib/utils";
|
|
3
|
+
import type { ElementalNode } from "@/types/elemental.types";
|
|
4
|
+
import type { AnyExtension, Editor } from "@tiptap/react";
|
|
5
|
+
import type { MessageRouting } from "../../../Providers/store";
|
|
6
|
+
import type { ChannelType } from "@/store";
|
|
7
|
+
import type { TemplateEditorProps } from "../../TemplateEditor";
|
|
8
|
+
export declare const defaultSMSContent: ElementalNode[];
|
|
9
|
+
export declare const SMSEditorContent: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export interface SMSRenderProps {
|
|
11
|
+
content: TiptapDoc;
|
|
12
|
+
extensions: AnyExtension[];
|
|
13
|
+
editable: boolean;
|
|
14
|
+
autofocus: boolean;
|
|
15
|
+
onUpdate: ({ editor }: {
|
|
16
|
+
editor: Editor;
|
|
17
|
+
}) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing"> {
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
22
|
+
hidePublish?: boolean;
|
|
23
|
+
channels?: ChannelType[];
|
|
24
|
+
routing?: MessageRouting;
|
|
25
|
+
}) => React.ReactNode;
|
|
26
|
+
render?: (props: SMSRenderProps) => React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export declare const SMSConfig: TextMenuConfig;
|
|
29
|
+
export declare const SMS: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<SMSProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import type { SMSRenderProps } from "./SMS";
|
|
3
|
+
export interface SMSEditorProps extends SMSRenderProps, Omit<HTMLAttributes<HTMLDivElement>, "content"> {
|
|
4
|
+
}
|
|
5
|
+
export declare const SMSEditor: ({ content, extensions, editable, autofocus, onUpdate, className, }: SMSEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Channel, type ChannelType } from "@/store";
|
|
2
|
+
import type { TemplateEditorProps } from "../TemplateEditor";
|
|
3
|
+
export declare const useChannels: ({ channels, routing, }: {
|
|
4
|
+
channels?: ChannelType[];
|
|
5
|
+
routing?: TemplateEditorProps["routing"];
|
|
6
|
+
}) => {
|
|
7
|
+
enabledChannels: Channel[];
|
|
8
|
+
disabledChannels: Channel[];
|
|
9
|
+
channel: ChannelType;
|
|
10
|
+
channelOptions: Channel[];
|
|
11
|
+
setChannel: (channelType: ChannelType) => void;
|
|
12
|
+
addChannel: (channelType: ChannelType) => void;
|
|
13
|
+
removeChannel: (channelToRemove: ChannelType) => Promise<void>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./IPhoneFrame";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
export declare const ChannelRootContainer: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
previewMode: "desktop" | "mobile" | undefined;
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const EditorSidebar: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
previewMode: "desktop" | "mobile" | undefined;
|
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Layout";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ElementalContent } from "@/types/elemental.types";
|
|
2
|
+
import type { ChannelType } from "../../store";
|
|
2
3
|
import type { BrandEditorProps } from "../BrandEditor";
|
|
4
|
+
import { type MessageRouting } from "../Providers/store";
|
|
3
5
|
import type { Theme } from "../ui-kit/ThemeProvider/ThemeProvider.types";
|
|
4
6
|
export interface TemplateEditorProps {
|
|
5
7
|
theme?: Theme | string;
|
|
@@ -11,5 +13,7 @@ export interface TemplateEditorProps {
|
|
|
11
13
|
autoSaveDebounce?: number;
|
|
12
14
|
brandEditor?: boolean;
|
|
13
15
|
brandProps?: BrandEditorProps;
|
|
16
|
+
channels?: ChannelType[];
|
|
17
|
+
routing?: MessageRouting;
|
|
14
18
|
}
|
|
15
19
|
export declare const TemplateEditor: import("react").NamedExoticComponent<TemplateEditorProps>;
|
|
@@ -1 +1,17 @@
|
|
|
1
|
+
export { BrandFooter } from "@/components/BrandEditor/Editor/BrandFooter";
|
|
2
|
+
export { PreviewPanel } from "@/components/ui/PreviewPanel";
|
|
3
|
+
export { TextMenu } from "@/components/ui/TextMenu";
|
|
4
|
+
export { cn } from "@/lib/utils";
|
|
5
|
+
export { SortableContext } from "@dnd-kit/sortable";
|
|
6
|
+
export { useChannels } from "./Channels";
|
|
7
|
+
export { default as EmailEditor } from "./Channels/Email/EmailEditor";
|
|
1
8
|
export * from "./TemplateEditor";
|
|
9
|
+
export { SideBar as EmailSideBar, SideBarItemDetails as EmailSideBarItemDetails, } from "./Channels/Email/SideBar";
|
|
10
|
+
export { SideBar as InboxSideBar } from "./Channels/Inbox/SideBar";
|
|
11
|
+
export declare const EmailChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").EmailProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
12
|
+
export declare const SMSChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").SMSProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
13
|
+
export declare const PushChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").PushProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
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";
|
|
16
|
+
export { ChannelRootContainer, EditorSidebar } from "./Layout";
|
|
17
|
+
export { InboxEditor, PushEditor, SMSEditor } from "./Channels";
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import type { ElementalContent } from "@/types/elemental.types";
|
|
2
|
+
import type { Editor } from "@tiptap/react";
|
|
2
3
|
export declare const subjectAtom: import("jotai").PrimitiveAtom<string | null> & {
|
|
3
4
|
init: string | null;
|
|
4
5
|
};
|
|
5
6
|
export declare const templateEditorContentAtom: import("jotai").PrimitiveAtom<ElementalContent | null | undefined> & {
|
|
6
7
|
init: ElementalContent | null | undefined;
|
|
7
8
|
};
|
|
9
|
+
export declare const templateEditorPublishedAtAtom: import("jotai").PrimitiveAtom<string | null | undefined> & {
|
|
10
|
+
init: string | null | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const templateEditorVersionAtom: import("jotai").PrimitiveAtom<string | null | undefined> & {
|
|
13
|
+
init: string | null | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const emailEditorAtom: import("jotai").PrimitiveAtom<Editor | null> & {
|
|
16
|
+
init: Editor | null;
|
|
17
|
+
};
|
|
18
|
+
export declare const brandEditorAtom: import("jotai").PrimitiveAtom<Editor | null> & {
|
|
19
|
+
init: Editor | null;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,17 +7,17 @@ export declare const blockquoteSchema: z.ZodObject<{
|
|
|
7
7
|
borderColor: z.ZodString;
|
|
8
8
|
id: z.ZodOptional<z.ZodString>;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
backgroundColor: string;
|
|
10
11
|
paddingVertical: number;
|
|
11
12
|
paddingHorizontal: number;
|
|
12
13
|
borderColor: string;
|
|
13
|
-
backgroundColor: string;
|
|
14
14
|
borderLeftWidth: number;
|
|
15
15
|
id?: string | undefined;
|
|
16
16
|
}, {
|
|
17
|
+
backgroundColor: string;
|
|
17
18
|
paddingVertical: number;
|
|
18
19
|
paddingHorizontal: number;
|
|
19
20
|
borderColor: string;
|
|
20
|
-
backgroundColor: string;
|
|
21
21
|
borderLeftWidth: number;
|
|
22
22
|
id?: string | undefined;
|
|
23
23
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|