@trycourier/react-designer 0.0.2 → 0.0.4

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 (166) hide show
  1. package/README.md +143 -22
  2. package/dist/channels.d.ts +7 -0
  3. package/dist/cjs/index.css +1 -1
  4. package/dist/cjs/index.css.map +2 -2
  5. package/dist/cjs/index.js +50 -30
  6. package/dist/cjs/index.js.map +4 -4
  7. package/dist/cjs/styles.css +505 -31
  8. package/dist/components/BrandEditor/BrandEditor.types.d.ts +36 -0
  9. package/dist/components/BrandEditor/Editor/BrandFooter/BrandFooter.d.ts +8 -3
  10. package/dist/components/BrandEditor/Editor/Editor.d.ts +2 -40
  11. package/dist/components/BrandEditor/Editor/SideBar/SideBar.d.ts +2 -7
  12. package/dist/components/Providers/BrandProvider.d.ts +0 -12
  13. package/dist/components/Providers/Providers.types.d.ts +1 -0
  14. package/dist/components/Providers/TemplateProvider.d.ts +7 -12
  15. package/dist/components/Providers/api/common.d.ts +1 -1
  16. package/dist/components/Providers/api/template.d.ts +2 -1
  17. package/dist/components/Providers/index.d.ts +4 -2
  18. package/dist/components/Providers/store.d.ts +48 -14
  19. package/dist/components/Providers/useBrandActions.d.ts +22 -0
  20. package/dist/components/Providers/useTemplateActions.d.ts +23 -0
  21. package/dist/components/TemplateEditor/Channels/Channels.d.ts +6 -0
  22. package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +55 -0
  23. package/dist/components/TemplateEditor/Channels/Email/Email.test.d.ts +1 -0
  24. package/dist/components/TemplateEditor/Channels/Email/EmailEditor.d.ts +17 -0
  25. package/dist/components/TemplateEditor/Channels/Email/EmailEditor.test.d.ts +1 -0
  26. package/dist/components/TemplateEditor/Channels/Email/EmailLayout.d.ts +9 -0
  27. package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBar.d.ts +7 -0
  28. package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItemDetails/SideBarItemDetails.d.ts +1 -2
  29. package/dist/components/TemplateEditor/Channels/Email/SideBar/index.d.ts +2 -0
  30. package/dist/components/TemplateEditor/Channels/Email/index.d.ts +3 -0
  31. package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +33 -0
  32. package/dist/components/TemplateEditor/Channels/Inbox/Inbox.test.d.ts +1 -0
  33. package/dist/components/TemplateEditor/Channels/Inbox/InboxEditor.d.ts +4 -0
  34. package/dist/components/TemplateEditor/Channels/Inbox/InboxEditor.test.d.ts +1 -0
  35. package/dist/components/TemplateEditor/Channels/Inbox/InboxLayout.d.ts +4 -0
  36. package/dist/components/TemplateEditor/Channels/Inbox/SideBar/SideBar.d.ts +1 -0
  37. package/dist/components/TemplateEditor/Channels/Inbox/index.d.ts +3 -0
  38. package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +35 -0
  39. package/dist/components/TemplateEditor/Channels/Push/Push.test.d.ts +1 -0
  40. package/dist/components/TemplateEditor/Channels/Push/PushEditor.d.ts +5 -0
  41. package/dist/components/TemplateEditor/Channels/Push/PushEditor.test.d.ts +1 -0
  42. package/dist/components/TemplateEditor/Channels/Push/PushLayout.d.ts +4 -0
  43. package/dist/components/TemplateEditor/Channels/Push/index.d.ts +3 -0
  44. package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +34 -0
  45. package/dist/components/TemplateEditor/Channels/SMS/SMS.test.d.ts +1 -0
  46. package/dist/components/TemplateEditor/Channels/SMS/SMSEditor.d.ts +5 -0
  47. package/dist/components/TemplateEditor/Channels/SMS/SMSEditor.test.d.ts +1 -0
  48. package/dist/components/TemplateEditor/Channels/SMS/SMSLayout.d.ts +4 -0
  49. package/dist/components/TemplateEditor/Channels/SMS/index.d.ts +3 -0
  50. package/dist/components/TemplateEditor/Channels/index.d.ts +6 -0
  51. package/dist/components/TemplateEditor/Channels/useChannels.d.ts +14 -0
  52. package/dist/components/TemplateEditor/Channels/useChannels.test.d.ts +1 -0
  53. package/dist/components/TemplateEditor/IPhoneFrame/IPhoneFrame.d.ts +4 -0
  54. package/dist/components/TemplateEditor/IPhoneFrame/index.d.ts +1 -0
  55. package/dist/components/TemplateEditor/Layout/Layout.d.ts +8 -0
  56. package/dist/components/TemplateEditor/Layout/index.d.ts +1 -0
  57. package/dist/components/TemplateEditor/TemplateEditor.d.ts +5 -1
  58. package/dist/components/TemplateEditor/index.d.ts +19 -0
  59. package/dist/components/TemplateEditor/store.d.ts +16 -0
  60. package/dist/components/extensions/Blockquote/Blockquote.test.d.ts +1 -0
  61. package/dist/components/extensions/Blockquote/Blockquote.types.d.ts +2 -2
  62. package/dist/components/extensions/Button/Button.test.d.ts +1 -0
  63. package/dist/components/extensions/Button/Button.types.d.ts +6 -6
  64. package/dist/components/extensions/ButtonRow/ButtonRow.d.ts +11 -0
  65. package/dist/components/extensions/ButtonRow/ButtonRow.test.d.ts +1 -0
  66. package/dist/components/extensions/ButtonRow/ButtonRow.types.d.ts +45 -0
  67. package/dist/components/extensions/ButtonRow/ButtonRowComponent.d.ts +5 -0
  68. package/dist/components/extensions/ButtonRow/index.d.ts +4 -0
  69. package/dist/components/extensions/Divider/Divider.test.d.ts +1 -0
  70. package/dist/components/extensions/Divider/Divider.types.d.ts +2 -2
  71. package/dist/components/extensions/DragPlaceholder/DragPlaceholder.test.d.ts +1 -0
  72. package/dist/components/extensions/FileHandler/FileHandler.test.d.ts +1 -0
  73. package/dist/components/extensions/FixedChannelPaste/FixedChannelPaste.d.ts +11 -0
  74. package/dist/components/extensions/FixedChannelPaste/FixedChannelPaste.test.d.ts +1 -0
  75. package/dist/components/extensions/FixedChannelPaste/index.d.ts +2 -0
  76. package/dist/components/extensions/FixedChannelSelection/FixedChannelSelection.d.ts +14 -0
  77. package/dist/components/extensions/FixedChannelSelection/FixedChannelSelection.test.d.ts +1 -0
  78. package/dist/components/extensions/FixedChannelSelection/index.d.ts +1 -0
  79. package/dist/components/extensions/Heading/Heading.test.d.ts +1 -0
  80. package/dist/components/extensions/Image/Image.test.d.ts +1 -0
  81. package/dist/components/extensions/ImageBlock/ImageBlock.test.d.ts +1 -0
  82. package/dist/components/extensions/Link/Link.test.d.ts +1 -0
  83. package/dist/components/extensions/Paragraph/Paragraph.test.d.ts +1 -0
  84. package/dist/components/extensions/Selection/Selection.test.d.ts +1 -0
  85. package/dist/components/extensions/TextBlock/TextBlock.test.d.ts +1 -0
  86. package/dist/components/extensions/TextBlock/TextBlock.types.d.ts +4 -4
  87. package/dist/components/extensions/UniqueId/UniqueId.test.d.ts +1 -0
  88. package/dist/components/extensions/Variable/Variable.test.d.ts +1 -0
  89. package/dist/components/extensions/Variable/VariablePaste.d.ts +2 -0
  90. package/dist/components/extensions/Variable/VariablePaste.test.d.ts +1 -0
  91. package/dist/components/extensions/Variable/index.d.ts +1 -0
  92. package/dist/components/extensions/extension-kit.d.ts +1 -4
  93. package/dist/components/extensions/index.d.ts +4 -1
  94. package/dist/components/ui/MainLayout/MainLayout.d.ts +9 -0
  95. package/dist/components/ui/MainLayout/index.d.ts +1 -0
  96. package/dist/components/ui/PreviewPanel/PreviewPanel.d.ts +3 -2
  97. package/dist/components/ui/Status/Status.d.ts +5 -2
  98. package/dist/components/ui/TextMenu/BubbleTextMenu.d.ts +6 -0
  99. package/dist/components/ui/TextMenu/TextMenu.d.ts +3 -1
  100. package/dist/components/ui/TextMenu/config.d.ts +1 -1
  101. package/dist/components/ui/TextMenu/hooks/useTextmenuStates.d.ts +3 -5
  102. package/dist/components/ui/TextMenu/store.d.ts +1 -16
  103. package/dist/components/ui/index.d.ts +1 -1
  104. package/dist/components/ui-kit/AlertDialog/AlertDialog.d.ts +20 -0
  105. package/dist/components/ui-kit/AlertDialog/index.d.ts +1 -0
  106. package/dist/components/ui-kit/Button/Button.d.ts +2 -3
  107. package/dist/components/ui-kit/ErrorBoundary/ErrorBoundary.d.ts +22 -0
  108. package/dist/components/ui-kit/ErrorBoundary/index.d.ts +1 -0
  109. package/dist/components/ui-kit/Icon/BatteryIcon.d.ts +3 -0
  110. package/dist/components/ui-kit/Icon/ExpandIcon.d.ts +3 -0
  111. package/dist/components/ui-kit/Icon/HamburgerMenuIcon.d.ts +3 -0
  112. package/dist/components/ui-kit/Icon/InAppIcon.d.ts +3 -0
  113. package/dist/components/ui-kit/Icon/InboxIcon.d.ts +3 -0
  114. package/dist/components/ui-kit/Icon/MoreMenuIcon.d.ts +3 -0
  115. package/dist/components/ui-kit/Icon/PushIcon.d.ts +3 -0
  116. package/dist/components/ui-kit/Icon/SMSIcon.d.ts +3 -0
  117. package/dist/components/ui-kit/Icon/SignalIcon.d.ts +3 -0
  118. package/dist/components/ui-kit/Icon/WiFiIcon.d.ts +3 -0
  119. package/dist/components/ui-kit/Icon/index.d.ts +10 -0
  120. package/dist/components/ui-kit/Separator/Separator.d.ts +4 -0
  121. package/dist/components/ui-kit/Separator/index.d.ts +1 -0
  122. package/dist/components/ui-kit/ThemeProvider/ThemeProvider.d.ts +1 -1
  123. package/dist/components/ui-kit/index.d.ts +3 -0
  124. package/dist/components/utils/index.d.ts +1 -0
  125. package/dist/components/utils/safeGetPos.d.ts +13 -0
  126. package/dist/esm/index.css +1 -1
  127. package/dist/esm/index.css.map +2 -2
  128. package/dist/esm/index.js +50 -30
  129. package/dist/esm/index.js.map +4 -4
  130. package/dist/esm/styles.css +505 -31
  131. package/dist/index.d.ts +2 -0
  132. package/dist/lib/api/uploadImage.d.ts +0 -1
  133. package/dist/lib/utils/convertElementalToTiptap/convertElementalToTiptap.d.ts +5 -1
  134. package/dist/lib/utils/convertElementalToTiptap/convertElementalToTiptap.test.d.ts +1 -0
  135. package/dist/lib/utils/convertMarkdownToTiptap/convertMarkdownToTiptap.test.d.ts +1 -0
  136. package/dist/lib/utils/convertTiptapToElemental/convertTiptapToElemental.d.ts +2 -2
  137. package/dist/lib/utils/convertTiptapToElemental/convertTiptapToElemental.test.d.ts +1 -0
  138. package/dist/lib/utils/convertTiptapToMarkdown/convertTiptapToMarkdown.test.d.ts +1 -0
  139. package/dist/lib/utils/errors.d.ts +26 -0
  140. package/dist/lib/utils/getTitle/demo.d.ts +1 -0
  141. package/dist/lib/utils/getTitle/getTitle.d.ts +18 -0
  142. package/dist/lib/utils/getTitle/getTitle.test.d.ts +1 -0
  143. package/dist/lib/utils/getTitle/index.d.ts +2 -0
  144. package/dist/lib/utils/getTitle/preserveStorageFormat.d.ts +30 -0
  145. package/dist/lib/utils/getTitle/preserveStorageFormat.test.d.ts +1 -0
  146. package/dist/lib/utils/index.d.ts +3 -1
  147. package/dist/lib/utils/updateElemental/index.d.ts +1 -0
  148. package/dist/lib/utils/updateElemental/updateElemental.d.ts +11 -0
  149. package/dist/lib/utils/updateElemental/updateElemental.test.d.ts +1 -0
  150. package/dist/store.d.ts +7 -2
  151. package/dist/styles.css +505 -31
  152. package/dist/types/elemental.schema.d.ts +3 -3
  153. package/package.json +14 -11
  154. package/dist/components/BrandEditor/Editor/useBlockEditor.d.ts +0 -23
  155. package/dist/components/TemplateEditor/Editor/Editor.d.ts +0 -11
  156. package/dist/components/TemplateEditor/Editor/SideBar/SideBar.d.ts +0 -7
  157. package/dist/components/TemplateEditor/Editor/index.d.ts +0 -1
  158. package/dist/components/TemplateEditor/Editor/useBlockEditor.d.ts +0 -23
  159. package/dist/components/ui/EditorLayout/EditorLayout.d.ts +0 -6
  160. package/dist/components/ui/EditorLayout/index.d.ts +0 -1
  161. /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItem/SideBarItem.d.ts +0 -0
  162. /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItem/index.d.ts +0 -0
  163. /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarItemDetails/index.d.ts +0 -0
  164. /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarSortableItemWrapper/SideBarSortableItemWrapper.d.ts +0 -0
  165. /package/dist/components/TemplateEditor/{Editor → Channels/Email}/SideBar/SideBarSortableItemWrapper/index.d.ts +0 -0
  166. /package/dist/components/TemplateEditor/{Editor → Channels/Inbox}/SideBar/index.d.ts +0 -0
@@ -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,4 @@
1
+ import type { SMSProps } from "./SMS";
2
+ export interface SMSLayoutProps extends SMSProps {
3
+ }
4
+ export declare const SMSLayout: ({ hidePublish, theme, variables, channels, routing }: SMSLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from "./SMS";
2
+ export * from "./SMSEditor";
3
+ export * from "./SMSLayout";
@@ -0,0 +1,6 @@
1
+ export * from "./Channels";
2
+ export * from "./Email";
3
+ export * from "./Inbox";
4
+ export * from "./Push";
5
+ export * from "./SMS";
6
+ export * from "./useChannels";
@@ -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,4 @@
1
+ import type { ReactNode } from "react";
2
+ export declare const IPhoneFrame: ({ children }: {
3
+ children: ReactNode | ReactNode[];
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -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,9 +1,11 @@
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;
6
- value?: ElementalContent;
8
+ value?: ElementalContent | null;
7
9
  onChange?: (value: ElementalContent) => void;
8
10
  variables?: Record<string, unknown>;
9
11
  hidePublish?: boolean;
@@ -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,20 @@
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 InboxEditorProps, type PushEditorProps, type SMSEditorProps, } from "./Channels";
16
+ export type { ElementalContent } from "@/types";
17
+ export { ChannelRootContainer, EditorSidebar } from "./Layout";
18
+ export { InboxEditor, PushEditor, SMSEditor } from "./Channels";
19
+ export { useAutoSave } from "@/hooks/useAutoSave";
20
+ export { Status as TemplateStatus } from "@/components/ui/Status";
@@ -1,7 +1,23 @@
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
+ };
21
+ export declare const isTemplateTransitioningAtom: import("jotai").PrimitiveAtom<boolean> & {
22
+ init: boolean;
23
+ };
@@ -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 {};
@@ -17,12 +17,12 @@ export declare const buttonSchema: z.ZodObject<{
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  padding: number;
19
19
  borderWidth: number;
20
+ label: string;
21
+ backgroundColor: string;
22
+ textColor: string;
20
23
  borderColor: string;
21
24
  size: "full" | "default";
22
25
  borderRadius: number;
23
- textColor: string;
24
- backgroundColor: string;
25
- label: string;
26
26
  alignment: "left" | "center" | "right";
27
27
  fontStyle: "italic" | "normal";
28
28
  fontWeight: "bold" | "normal";
@@ -32,12 +32,12 @@ export declare const buttonSchema: z.ZodObject<{
32
32
  }, {
33
33
  padding: number;
34
34
  borderWidth: number;
35
+ label: string;
36
+ backgroundColor: string;
37
+ textColor: string;
35
38
  borderColor: string;
36
39
  size: "full" | "default";
37
40
  borderRadius: number;
38
- textColor: string;
39
- backgroundColor: string;
40
- label: string;
41
41
  alignment: "left" | "center" | "right";
42
42
  fontStyle: "italic" | "normal";
43
43
  fontWeight: "bold" | "normal";
@@ -0,0 +1,11 @@
1
+ import { Node } from "@tiptap/core";
2
+ import type { ButtonRowProps } from "./ButtonRow.types";
3
+ declare module "@tiptap/core" {
4
+ interface Commands<ReturnType> {
5
+ buttonRow: {
6
+ setButtonRow: (props: Partial<ButtonRowProps>) => ReturnType;
7
+ };
8
+ }
9
+ }
10
+ export declare const defaultButtonRowProps: ButtonRowProps;
11
+ export declare const ButtonRow: Node<any, any>;
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ export interface ButtonRowProps {
3
+ id?: string;
4
+ button1Label: string;
5
+ button1Link: string;
6
+ button1BackgroundColor: string;
7
+ button1TextColor: string;
8
+ button2Label: string;
9
+ button2Link: string;
10
+ button2BackgroundColor: string;
11
+ button2TextColor: string;
12
+ padding?: number;
13
+ }
14
+ export declare const buttonRowSchema: z.ZodObject<{
15
+ button1Label: z.ZodString;
16
+ button1Link: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
17
+ button1BackgroundColor: z.ZodOptional<z.ZodString>;
18
+ button1TextColor: z.ZodOptional<z.ZodString>;
19
+ button2Label: z.ZodString;
20
+ button2Link: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
21
+ button2BackgroundColor: z.ZodOptional<z.ZodString>;
22
+ button2TextColor: z.ZodOptional<z.ZodString>;
23
+ padding: z.ZodOptional<z.ZodNumber>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ button1Label: string;
26
+ button2Label: string;
27
+ padding?: number | undefined;
28
+ button1Link?: string | undefined;
29
+ button1BackgroundColor?: string | undefined;
30
+ button1TextColor?: string | undefined;
31
+ button2Link?: string | undefined;
32
+ button2BackgroundColor?: string | undefined;
33
+ button2TextColor?: string | undefined;
34
+ }, {
35
+ button1Label: string;
36
+ button2Label: string;
37
+ padding?: number | undefined;
38
+ button1Link?: string | undefined;
39
+ button1BackgroundColor?: string | undefined;
40
+ button1TextColor?: string | undefined;
41
+ button2Link?: string | undefined;
42
+ button2BackgroundColor?: string | undefined;
43
+ button2TextColor?: string | undefined;
44
+ }>;
45
+ export type ButtonRowFormData = z.infer<typeof buttonRowSchema>;
@@ -0,0 +1,5 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ import React from "react";
3
+ import type { ButtonRowProps } from "./ButtonRow.types";
4
+ export declare const ButtonRowComponent: React.FC<ButtonRowProps>;
5
+ export declare const ButtonRowComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { ButtonRow, defaultButtonRowProps } from "./ButtonRow";
2
+ export { ButtonRowComponent, ButtonRowComponentNode } from "./ButtonRowComponent";
3
+ export type { ButtonRowProps, ButtonRowFormData } from "./ButtonRow.types";
4
+ export { buttonRowSchema } from "./ButtonRow.types";
@@ -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;
@@ -0,0 +1,11 @@
1
+ import { Extension } from "@tiptap/core";
2
+ import { PluginKey } from "@tiptap/pm/state";
3
+ export interface FixedChannelPasteOptions {
4
+ /**
5
+ * Channels that have fixed element structure (like PushEditor, SMS, Inbox)
6
+ * For these channels, multi-element paste should be converted to merged text
7
+ */
8
+ fixedChannels?: string[];
9
+ }
10
+ export declare const FixedChannelPastePlugin: PluginKey<any>;
11
+ export declare const FixedChannelPaste: Extension<FixedChannelPasteOptions, any>;
@@ -0,0 +1,2 @@
1
+ export { FixedChannelPaste } from "./FixedChannelPaste";
2
+ export type { FixedChannelPasteOptions } from "./FixedChannelPaste";
@@ -0,0 +1,14 @@
1
+ import { Extension } from "@tiptap/core";
2
+ import { PluginKey } from "@tiptap/pm/state";
3
+ export interface FixedChannelSelectionOptions {
4
+ channels: Array<"push" | "sms" | "inbox">;
5
+ }
6
+ declare module "@tiptap/core" {
7
+ interface Commands<ReturnType> {
8
+ fixedChannelSelection: {
9
+ constrainSelectionToElement: () => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export declare const FixedChannelSelectionPlugin: PluginKey<any>;
14
+ export declare const FixedChannelSelection: Extension<FixedChannelSelectionOptions, any>;
@@ -0,0 +1 @@
1
+ export { FixedChannelSelection, type FixedChannelSelectionOptions } from "./FixedChannelSelection";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom/vitest";
@@ -12,23 +12,23 @@ export declare const textBlockSchema: z.ZodObject<{
12
12
  id: z.ZodOptional<z.ZodString>;
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  borderWidth: number;
15
+ backgroundColor: string;
16
+ textColor: string;
15
17
  paddingVertical: number;
16
18
  paddingHorizontal: number;
17
19
  borderColor: string;
18
20
  borderRadius: number;
19
21
  textAlign: "left" | "center" | "right" | "justify";
20
- textColor: string;
21
- backgroundColor: string;
22
22
  selected: boolean;
23
23
  id?: string | undefined;
24
24
  }, {
25
25
  borderWidth: number;
26
+ backgroundColor: string;
27
+ textColor: string;
26
28
  paddingVertical: number;
27
29
  paddingHorizontal: number;
28
30
  borderColor: string;
29
31
  borderRadius: number;
30
- textColor: string;
31
- backgroundColor: string;
32
32
  id?: string | undefined;
33
33
  textAlign?: "left" | "center" | "right" | "justify" | undefined;
34
34
  selected?: boolean | undefined;
@@ -0,0 +1,2 @@
1
+ import { Extension } from "@tiptap/core";
2
+ export declare const VariablePaste: Extension<any, any>;
@@ -1,2 +1,3 @@
1
1
  export * from "./Variable";
2
2
  export * from "./Variable.types";
3
+ export * from "./VariablePaste";
@@ -2,8 +2,5 @@ import type { Node } from "@tiptap/pm/model";
2
2
  export declare const ExtensionKit: (options?: {
3
3
  variables?: Record<string, unknown>;
4
4
  setSelectedNode?: (node: Node) => void;
5
- }) => (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("./FileHandler/FileHandler").FileHandlerOptions, any> | import("@tiptap/core").Extension<import("./Selection").SelectionOptions, any> | import("@tiptap/core").Extension<import("./Variable").VariableOptions, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | {
6
- new (): History;
7
- prototype: History;
8
- } | import("@tiptap/core").Extension<import("@tiptap/extension-color").ColorOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-typography").TypographyOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-dropcursor").DropcursorOptions, any>)[];
5
+ }) => (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any>)[];
9
6
  export default ExtensionKit;
@@ -9,10 +9,13 @@ export { Underline } from "@tiptap/extension-underline";
9
9
  export { StarterKit } from "@tiptap/starter-kit";
10
10
  export { Blockquote } from "./Blockquote";
11
11
  export { Button } from "./Button";
12
+ export { ButtonRow } from "./ButtonRow";
12
13
  export { Divider } from "./Divider";
13
14
  export { Document } from "./Document";
14
15
  export * from "./DragPlaceholder";
15
16
  export { FileHandler } from "./FileHandler";
17
+ export { FixedChannelPaste } from "./FixedChannelPaste";
18
+ export { FixedChannelSelection } from "./FixedChannelSelection";
16
19
  export { Heading } from "./Heading";
17
20
  export { ImageBlock } from "./ImageBlock";
18
21
  export { Link } from "./Link";
@@ -20,4 +23,4 @@ export { Paragraph } from "./Paragraph";
20
23
  export { Selection } from "./Selection";
21
24
  export { SlashMenu } from "./SlashMenu";
22
25
  export { UniqueId } from "./UniqueId";
23
- export { Variable, VariableNode } from "./Variable";
26
+ export { Variable, VariableNode, VariablePaste } from "./Variable";
@@ -0,0 +1,9 @@
1
+ import type { Theme } from "@/components/ui-kit/ThemeProvider/ThemeProvider.types";
2
+ export interface MainLayoutProps {
3
+ theme?: Theme | string;
4
+ children: React.ReactNode;
5
+ isLoading?: boolean;
6
+ SideBar?: React.ReactNode;
7
+ Header?: React.ReactNode;
8
+ }
9
+ export declare const MainLayout: import("react").ForwardRefExoticComponent<MainLayoutProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export * from "./MainLayout";
@@ -1,6 +1,7 @@
1
- interface PreviewPanelProps {
1
+ import type { HTMLAttributes } from "react";
2
+ interface PreviewPanelProps extends HTMLAttributes<HTMLDivElement> {
2
3
  previewMode: "desktop" | "mobile" | undefined;
3
4
  togglePreviewMode: (mode?: "desktop" | "mobile" | undefined) => void;
4
5
  }
5
- export declare const PreviewPanel: ({ previewMode, togglePreviewMode }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const PreviewPanel: ({ previewMode, togglePreviewMode, ...props }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -1,7 +1,10 @@
1
1
  interface StatusProps {
2
2
  isError?: boolean;
3
- isSaving?: boolean;
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 {};
@@ -0,0 +1,6 @@
1
+ import type { TextMenuConfig } from "./config";
2
+ interface BubbleTextMenuProps {
3
+ config?: TextMenuConfig;
4
+ }
5
+ export declare const BubbleTextMenu: ({ config }: BubbleTextMenuProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -1,5 +1,7 @@
1
1
  import type { Editor } from "@tiptap/react";
2
+ import type { TextMenuConfig } from "./config";
2
3
  export interface TextMenuProps {
3
4
  editor: Editor;
5
+ config?: TextMenuConfig;
4
6
  }
5
- export declare const TextMenu: ({ editor }: TextMenuProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const TextMenu: ({ editor, config }: TextMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -17,4 +17,4 @@ export interface TextMenuConfig {
17
17
  variable?: TextMenuItem;
18
18
  }
19
19
  export declare const defaultTextMenuConfig: TextMenuConfig;
20
- export declare const getTextMenuConfigForNode: (nodeName: string) => TextMenuConfig;
20
+ export declare const getTextMenuConfigForNode: (nodeName: string, hasTextSelection?: boolean) => TextMenuConfig;
@@ -1,6 +1,5 @@
1
1
  import type { Editor } from "@tiptap/react";
2
- import type { EditorView } from "@tiptap/pm/view";
3
- export declare const useTextmenuStates: (editor: Editor) => {
2
+ export declare const useTextmenuStates: (editor: Editor | null) => {
4
3
  isBold: boolean;
5
4
  isItalic: boolean;
6
5
  isUnderline: boolean;
@@ -11,8 +10,7 @@ export declare const useTextmenuStates: (editor: Editor) => {
11
10
  isAlignJustify: boolean;
12
11
  isQuote: boolean;
13
12
  isLink: boolean;
14
- shouldShow: ({ view, from }: {
15
- view: EditorView;
16
- from: number;
13
+ shouldShow: ({ editor }: {
14
+ editor: Editor;
17
15
  }) => boolean;
18
16
  };
@@ -39,22 +39,7 @@ export declare const textInputStateAtom: import("jotai").PrimitiveAtom<{
39
39
  showVariablePopup: boolean;
40
40
  };
41
41
  };
42
- export declare const getNodeConfigAtom: import("jotai").Atom<(nodeName: string) => TextMenuConfig | {
43
- variable: {
44
- state: string;
45
- };
46
- contentType?: import("./config").TextMenuItem;
47
- bold?: import("./config").TextMenuItem;
48
- italic?: import("./config").TextMenuItem;
49
- underline?: import("./config").TextMenuItem;
50
- strike?: import("./config").TextMenuItem;
51
- alignLeft?: import("./config").TextMenuItem;
52
- alignCenter?: import("./config").TextMenuItem;
53
- alignRight?: import("./config").TextMenuItem;
54
- alignJustify?: import("./config").TextMenuItem;
55
- quote?: import("./config").TextMenuItem;
56
- link?: import("./config").TextMenuItem;
57
- }>;
42
+ export declare const getNodeConfigAtom: import("jotai").Atom<(nodeName: string, hasTextSelection?: boolean) => TextMenuConfig>;
58
43
  export declare const setNodeConfigAtom: import("jotai").WritableAtom<null, [{
59
44
  nodeName: string;
60
45
  config: Partial<TextMenuConfig>;
@@ -1,5 +1,5 @@
1
1
  export * from "./Blocks";
2
- export * from "./EditorLayout";
2
+ export * from "./MainLayout";
3
3
  export * from "./FormHeader";
4
4
  export * from "./Handle";
5
5
  export * from "./PreviewPanel";
@@ -0,0 +1,20 @@
1
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
2
+ import * as React from "react";
3
+ declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
4
+ declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
6
+ declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const AlertDialogHeader: {
9
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ declare const AlertDialogFooter: {
13
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
16
+ declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
17
+ declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
18
+ declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
19
+ declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
20
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -0,0 +1 @@
1
+ export * from "./AlertDialog";
@@ -2,9 +2,9 @@ import { type VariantProps } from "class-variance-authority";
2
2
  import type { ButtonHTMLAttributes } from "react";
3
3
  export type ButtonVariant = "primary" | "secondary" | "tertiary" | "quaternary" | "outline" | "ghost" | "link";
4
4
  export type ButtonSize = "medium" | "small" | "icon" | "iconSmall";
5
- declare const buttonVariants: (props?: ({
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;
@@ -16,4 +16,3 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Va
16
16
  buttonSize?: ButtonSize;
17
17
  }
18
18
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
19
- export {};