@trycourier/react-designer 0.3.0 → 0.5.0

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 (70) hide show
  1. package/README.md +114 -2
  2. package/dist/cjs/index.js +61 -57
  3. package/dist/cjs/index.js.map +4 -4
  4. package/dist/cjs/styles.css +454 -145
  5. package/dist/components/BrandEditor/Editor/Editor.d.ts +16 -1
  6. package/dist/components/Providers/useTemplateActions.d.ts +2 -2
  7. package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +1 -1
  8. package/dist/components/TemplateEditor/Channels/Email/EmailEditor.d.ts +2 -1
  9. package/dist/components/TemplateEditor/Channels/Email/EmailLayout.d.ts +1 -1
  10. package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBarItemDetails/SideBarItemDetails.d.ts +2 -1
  11. package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +1 -1
  12. package/dist/components/TemplateEditor/Channels/Inbox/InboxLayout.d.ts +1 -1
  13. package/dist/components/TemplateEditor/Channels/MSTeams/MSTeams.d.ts +1 -1
  14. package/dist/components/TemplateEditor/Channels/MSTeams/MSTeamsLayout.d.ts +1 -1
  15. package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +1 -1
  16. package/dist/components/TemplateEditor/Channels/Push/PushLayout.d.ts +1 -1
  17. package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +1 -1
  18. package/dist/components/TemplateEditor/Channels/SMS/SMSLayout.d.ts +1 -1
  19. package/dist/components/TemplateEditor/Channels/Slack/Slack.d.ts +1 -1
  20. package/dist/components/TemplateEditor/Channels/Slack/SlackLayout.d.ts +1 -1
  21. package/dist/components/TemplateEditor/Channels/useChannels.d.ts +8 -0
  22. package/dist/components/TemplateEditor/TemplateEditor.d.ts +16 -1
  23. package/dist/components/TemplateEditor/index.d.ts +2 -14
  24. package/dist/components/TemplateEditor/store.d.ts +10 -0
  25. package/dist/components/extensions/Blockquote/BlockquoteForm.d.ts +2 -1
  26. package/dist/components/extensions/Button/ButtonForm.d.ts +2 -1
  27. package/dist/components/extensions/Column/ColumnForm.d.ts +2 -1
  28. package/dist/components/extensions/CustomCode/CustomCodeForm.d.ts +2 -1
  29. package/dist/components/extensions/Divider/DividerForm.d.ts +2 -1
  30. package/dist/components/extensions/ImageBlock/components/ImageBlockForm.d.ts +2 -1
  31. package/dist/components/extensions/List/List.d.ts +15 -0
  32. package/dist/components/extensions/List/List.types.d.ts +38 -0
  33. package/dist/components/extensions/List/ListComponent.d.ts +12 -0
  34. package/dist/components/extensions/List/ListForm.d.ts +9 -0
  35. package/dist/components/extensions/List/index.d.ts +4 -0
  36. package/dist/components/extensions/ListItem/ListItem.d.ts +34 -0
  37. package/dist/components/extensions/ListItem/ListItem.types.d.ts +7 -0
  38. package/dist/components/extensions/ListItem/ListItemComponent.d.ts +7 -0
  39. package/dist/components/extensions/ListItem/index.d.ts +2 -0
  40. package/dist/components/extensions/TextBlock/TextBlockForm.d.ts +2 -1
  41. package/dist/components/extensions/Variable/Variable.d.ts +8 -4
  42. package/dist/components/extensions/Variable/Variable.types.d.ts +3 -14
  43. package/dist/components/extensions/Variable/VariableSuggestions.d.ts +7 -0
  44. package/dist/components/extensions/Variable/index.d.ts +1 -0
  45. package/dist/components/extensions/Variable/suggestion.d.ts +2 -0
  46. package/dist/components/extensions/extension-kit.d.ts +7 -2
  47. package/dist/components/extensions/index.d.ts +2 -0
  48. package/dist/components/ui/Blocks/ListBlock/ListBlock.d.ts +2 -0
  49. package/dist/components/ui/Blocks/ListBlock/index.d.ts +1 -0
  50. package/dist/components/ui/Blocks/index.d.ts +1 -0
  51. package/dist/components/ui/FormHeader/FormHeader.d.ts +3 -2
  52. package/dist/components/ui/SortableItemWrapper/SortableItemWrapper.d.ts +3 -1
  53. package/dist/components/ui/TextMenu/config.d.ts +2 -0
  54. package/dist/components/ui/TextMenu/hooks/useTextmenuCommands.d.ts +4 -0
  55. package/dist/components/ui/TextMenu/hooks/useTextmenuStates.d.ts +2 -0
  56. package/dist/components/ui/VariableEditor/VariableAutocomplete.d.ts +16 -0
  57. package/dist/components/ui/VariableEditor/VariableChipBase.d.ts +2 -0
  58. package/dist/components/ui-kit/Icon/UnorderedListIcon.d.ts +3 -0
  59. package/dist/components/ui-kit/Icon/index.d.ts +1 -1
  60. package/dist/esm/index.js +61 -57
  61. package/dist/esm/index.js.map +4 -4
  62. package/dist/esm/styles.css +454 -145
  63. package/dist/index.d.ts +14 -0
  64. package/dist/lib/utils/index.d.ts +1 -0
  65. package/dist/styles.css +454 -145
  66. package/dist/types/elemental.types.d.ts +6 -0
  67. package/dist/types/index.d.ts +1 -0
  68. package/dist/types/validation.types.d.ts +53 -0
  69. package/package.json +1 -1
  70. package/dist/components/ui-kit/Icon/BulletListIcon.d.ts +0 -3
@@ -1,11 +1,26 @@
1
+ import type { VariableValidationConfig } from "@/types/validation.types";
1
2
  import type { BrandEditorFormValues } from "../BrandEditor.types";
2
3
  export interface EditorProps {
3
4
  hidePublish?: boolean;
4
5
  autoSaveDebounce?: number;
5
6
  autoSave?: boolean;
6
7
  templateEditor?: boolean;
7
- /** @deprecated The variables prop is no longer used. Users can now type any variable directly without autocomplete suggestions. */
8
+ /**
9
+ * Variables available for autocomplete suggestions.
10
+ * When provided, typing {{ will show a dropdown with matching variables.
11
+ */
8
12
  variables?: Record<string, unknown>;
13
+ /**
14
+ * When true, disables variable autocomplete and allows users to type any variable name.
15
+ * When false (default), shows autocomplete dropdown with variables from the `variables` prop.
16
+ * @default false
17
+ */
18
+ disableVariablesAutocomplete?: boolean;
19
+ /**
20
+ * Configuration for custom variable validation.
21
+ * Allows restricting which variable names are allowed and defining behavior on validation failure.
22
+ */
23
+ variableValidation?: VariableValidationConfig;
9
24
  value?: BrandEditorFormValues;
10
25
  }
11
26
  export declare const Editor: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<EditorProps & import("react").RefAttributes<HTMLDivElement>>>;
@@ -19,8 +19,8 @@ export declare function useTemplateActions(): {
19
19
  setTemplateError: (error: string | TemplateError | null) => void;
20
20
  templateData: import("./store").TenantData | null;
21
21
  setTemplateData: (args_0: import("./store").TenantData | ((prev: import("./store").TenantData | null) => import("./store").TenantData | null) | null) => void;
22
- templateEditorContent: import("../TemplateEditor").ElementalContent | null | undefined;
23
- setTemplateEditorContent: (content: import("../TemplateEditor").ElementalContent | null | undefined) => void;
22
+ templateEditorContent: import("../..").ElementalContent | null | undefined;
23
+ setTemplateEditorContent: (content: import("../..").ElementalContent | null | undefined) => void;
24
24
  createCustomError: (message: string, toastProps?: import("sonner").ExternalToast) => TemplateError;
25
25
  convertLegacyError: (error: string | TemplateError) => TemplateError;
26
26
  /**
@@ -20,7 +20,7 @@ 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" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
23
+ export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "brandEditor" | "channels" | "variables" | "disableVariablesAutocomplete" | "theme" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
24
24
  isLoading?: boolean;
25
25
  headerRenderer?: ({ hidePublish, channels, routing, }: {
26
26
  hidePublish?: boolean;
@@ -5,8 +5,9 @@ export interface EmailEditorProps {
5
5
  readOnly?: boolean;
6
6
  subject?: string | null;
7
7
  variables?: Record<string, unknown>;
8
+ disableVariablesAutocomplete?: boolean;
8
9
  onDestroy?: () => void;
9
10
  onUpdate?: (editor: Editor) => void;
10
11
  }
11
- declare const EmailEditor: ({ value, readOnly, onDestroy, onUpdate, subject: propSubject, }: EmailEditorProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const EmailEditor: ({ value, readOnly, onDestroy, onUpdate, subject: propSubject, variables, disableVariablesAutocomplete, }: EmailEditorProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export default EmailEditor;
@@ -6,4 +6,4 @@ export declare const EmailEditorMain: import("react").ForwardRefExoticComponent<
6
6
  } & import("react").RefAttributes<HTMLDivElement>>;
7
7
  export interface EmailLayoutProps extends EmailProps {
8
8
  }
9
- export declare const EmailLayout: ({ variables, theme, isLoading, hidePublish, channels, brandEditor, routing, colorScheme, ...rest }: EmailLayoutProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const EmailLayout: ({ variables, disableVariablesAutocomplete, theme, isLoading, hidePublish, channels, brandEditor, routing, colorScheme, ...rest }: EmailLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,5 +3,6 @@ import type { Editor } from "@tiptap/react";
3
3
  export interface SideBarItemDetailsProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const SideBarItemDetails: ({ element, editor }: SideBarItemDetailsProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const SideBarItemDetails: ({ element, editor, hideCloseButton, }: SideBarItemDetailsProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -21,7 +21,7 @@ export interface InboxRenderProps {
21
21
  editor: Editor;
22
22
  }) => void;
23
23
  }
24
- export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
24
+ export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "disableVariablesAutocomplete" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
25
25
  readOnly?: boolean;
26
26
  headerRenderer?: ({ hidePublish, channels, routing, }: {
27
27
  hidePublish?: boolean;
@@ -1,4 +1,4 @@
1
1
  import type { InboxProps } from "./Inbox";
2
2
  export interface InboxLayoutProps extends InboxProps {
3
3
  }
4
- export declare const InboxLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, ...rest }: InboxLayoutProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const InboxLayout: ({ hidePublish, theme, variables, disableVariablesAutocomplete, channels, routing, colorScheme, ...rest }: InboxLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -28,7 +28,7 @@ export interface MSTeamsRenderProps {
28
28
  selectedNode: Node | null;
29
29
  msteamsEditor: Editor | null;
30
30
  }
31
- export interface MSTeamsProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
31
+ export interface MSTeamsProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "disableVariablesAutocomplete" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
32
32
  readOnly?: boolean;
33
33
  headerRenderer?: ({ hidePublish, channels, routing, }: {
34
34
  hidePublish?: boolean;
@@ -4,4 +4,4 @@ export interface MSTeamsLayoutProps extends MSTeamsProps {
4
4
  }
5
5
  export declare const MSTeamsEditorContainer: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
6
6
  export declare const MSTeamsEditorMain: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
7
- export declare const MSTeamsLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, }: MSTeamsLayoutProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const MSTeamsLayout: ({ hidePublish, theme, variables, disableVariablesAutocomplete, channels, routing, colorScheme, }: MSTeamsLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -18,7 +18,7 @@ export interface PushRenderProps {
18
18
  editor: Editor;
19
19
  }) => void;
20
20
  }
21
- export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
21
+ export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "disableVariablesAutocomplete" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
22
22
  readOnly?: boolean;
23
23
  headerRenderer?: ({ hidePublish, channels, routing, }: {
24
24
  hidePublish?: boolean;
@@ -1,4 +1,4 @@
1
1
  import type { PushProps } from "./Push";
2
2
  export interface PushLayoutProps extends PushProps {
3
3
  }
4
- export declare const PushLayout: ({ hidePublish, theme, variables, channels, routing, ...rest }: PushLayoutProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const PushLayout: ({ hidePublish, theme, variables, disableVariablesAutocomplete, channels, routing, ...rest }: PushLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -19,7 +19,7 @@ export interface SMSRenderProps {
19
19
  editor: Editor;
20
20
  }) => void;
21
21
  }
22
- export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
22
+ export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "disableVariablesAutocomplete" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
23
23
  readOnly?: boolean;
24
24
  headerRenderer?: ({ hidePublish, channels, routing, }: {
25
25
  hidePublish?: boolean;
@@ -1,4 +1,4 @@
1
1
  import type { SMSProps } from "./SMS";
2
2
  export interface SMSLayoutProps extends SMSProps {
3
3
  }
4
- export declare const SMSLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, ...rest }: SMSLayoutProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const SMSLayout: ({ hidePublish, theme, variables, disableVariablesAutocomplete, channels, routing, colorScheme, ...rest }: SMSLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -28,7 +28,7 @@ export interface SlackRenderProps {
28
28
  selectedNode: Node | null;
29
29
  slackEditor: Editor | null;
30
30
  }
31
- export interface SlackProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
31
+ export interface SlackProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "disableVariablesAutocomplete" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
32
32
  readOnly?: boolean;
33
33
  headerRenderer?: ({ hidePublish, channels, routing, }: {
34
34
  hidePublish?: boolean;
@@ -4,4 +4,4 @@ export interface SlackLayoutProps extends SlackProps {
4
4
  }
5
5
  export declare const SlackEditorContainer: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
6
6
  export declare const SlackEditorMain: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
7
- export declare const SlackLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, }: SlackLayoutProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const SlackLayout: ({ hidePublish, theme, variables, disableVariablesAutocomplete, channels, routing, colorScheme, }: SlackLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,13 @@
1
1
  import { type Channel, type ChannelType } from "@/store";
2
+ import type { ElementalNode } from "@/types/elemental.types";
2
3
  import type { TemplateEditorProps } from "../TemplateEditor";
4
+ export declare const getChannelDefaults: (type: ChannelType) => {
5
+ elements: ElementalNode[];
6
+ raw?: {
7
+ title?: string;
8
+ text?: string;
9
+ };
10
+ };
3
11
  export declare const useChannels: ({ channels, routing, }: {
4
12
  /** @deprecated Use routing.channels instead. Will be removed in a future version. */
5
13
  channels?: ChannelType[];
@@ -1,4 +1,5 @@
1
1
  import type { ElementalContent } from "@/types/elemental.types";
2
+ import type { VariableValidationConfig } from "@/types/validation.types";
2
3
  import type { HTMLAttributes } from "react";
3
4
  import type { ChannelType } from "../../store";
4
5
  import type { BrandEditorProps } from "../BrandEditor";
@@ -8,8 +9,22 @@ export interface TemplateEditorProps extends Omit<HTMLAttributes<HTMLDivElement>
8
9
  theme?: Theme | string;
9
10
  value?: ElementalContent | null;
10
11
  onChange?: (value: ElementalContent) => void;
11
- /** @deprecated The variables prop is no longer used. Users can now type any variable directly without autocomplete suggestions. */
12
+ /**
13
+ * Variables available for autocomplete suggestions.
14
+ * When provided, typing {{ will show a dropdown with matching variables.
15
+ */
12
16
  variables?: Record<string, unknown>;
17
+ /**
18
+ * When true, disables variable autocomplete and allows users to type any variable name.
19
+ * When false (default), shows autocomplete dropdown with variables from the `variables` prop.
20
+ * @default false
21
+ */
22
+ disableVariablesAutocomplete?: boolean;
23
+ /**
24
+ * Configuration for custom variable validation.
25
+ * Allows restricting which variable names are allowed and defining behavior on validation failure.
26
+ */
27
+ variableValidation?: VariableValidationConfig;
13
28
  hidePublish?: boolean;
14
29
  autoSave?: boolean;
15
30
  autoSaveDebounce?: number;
@@ -1,30 +1,18 @@
1
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, convertElementalToTiptap, convertTiptapToElemental } from "@/lib/utils";
5
- export { VariableInput, VariableTextarea } from "@/components/ui/VariableEditor";
6
- export { getFlattenedVariables } from "@/components/utils/getFlattenedVariables";
7
- export { useChannels } from "./Channels";
2
+ export { useChannels, getChannelDefaults } from "./Channels";
8
3
  export { default as EmailEditor } from "./Channels/Email/EmailEditor";
9
4
  export * from "./TemplateEditor";
10
5
  export { SideBar as EmailSideBar, SideBarItemDetails as EmailSideBarItemDetails, } from "./Channels/Email/SideBar";
11
6
  export { SideBar as InboxSideBar } from "./Channels/Inbox/SideBar";
12
7
  export { MSTeamsSideBar } from "./Channels/MSTeams/SideBar";
13
8
  export { SlackSideBar, SlackSideBarItemDetails } from "./Channels/Slack/SideBar";
9
+ export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type InboxEditorProps, type MSTeamsEditorProps, type PushEditorProps, type SlackEditorProps, type SMSEditorProps, } from "./Channels";
14
10
  export declare const EmailChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").EmailProps & import("react").RefAttributes<HTMLDivElement>>>;
15
11
  export declare const SMSChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").SMSProps & import("react").RefAttributes<HTMLDivElement>>>;
16
12
  export declare const PushChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").PushProps & import("react").RefAttributes<HTMLDivElement>>>;
17
13
  export declare const InboxChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").InboxProps & import("react").RefAttributes<HTMLDivElement>>>;
18
14
  export declare const MSTeamsChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").MSTeamsProps & import("react").RefAttributes<HTMLDivElement>>>;
19
15
  export declare const SlackChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").SlackProps & import("react").RefAttributes<HTMLDivElement>>>;
20
- export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type InboxEditorProps, type MSTeamsEditorProps, type PushEditorProps, type SlackEditorProps, type SMSEditorProps, } from "./Channels";
21
- export { CHANNELS } from "@/channels";
22
- export type { ChannelType } from "@/store";
23
- export type { ElementalContent } from "@/types";
24
16
  export { ChannelRootContainer, EditorSidebar } from "./Layout";
25
17
  export { InboxEditor, MSTeamsEditor, PushEditor, SlackEditor, SMSEditor } from "./Channels";
26
- export { useAutoSave } from "@/hooks/useAutoSave";
27
18
  export { useDebouncedFlush } from "./hooks/useDebouncedFlush";
28
- export { Status as TemplateStatus } from "@/components/ui/Status";
29
- export { MonacoCodeEditor } from "@/components/extensions/CustomCode/MonacoCodeEditor";
30
- export { ToggleGroup } from "@/components/ui-kit";
@@ -1,4 +1,5 @@
1
1
  import type { ElementalContent } from "@/types/elemental.types";
2
+ import type { VariableValidationConfig } from "@/types/validation.types";
2
3
  import type { Editor } from "@tiptap/react";
3
4
  export declare const subjectAtom: import("jotai").PrimitiveAtom<string | null> & {
4
5
  init: string | null;
@@ -29,6 +30,15 @@ export declare const isSidebarExpandedAtom: import("jotai").PrimitiveAtom<boolea
29
30
  export declare const variableValuesAtom: import("jotai").PrimitiveAtom<Record<string, string>> & {
30
31
  init: Record<string, string>;
31
32
  };
33
+ export declare const availableVariablesAtom: import("jotai").PrimitiveAtom<Record<string, unknown>> & {
34
+ init: Record<string, unknown>;
35
+ };
36
+ export declare const disableVariablesAutocompleteAtom: import("jotai").PrimitiveAtom<boolean> & {
37
+ init: boolean;
38
+ };
39
+ export declare const variableValidationAtom: import("jotai").PrimitiveAtom<VariableValidationConfig | undefined> & {
40
+ init: VariableValidationConfig | undefined;
41
+ };
32
42
  export declare const isDraggingAtom: import("jotai").PrimitiveAtom<boolean> & {
33
43
  init: boolean;
34
44
  };
@@ -3,6 +3,7 @@ import type { Editor } from "@tiptap/react";
3
3
  interface BlockquoteFormProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const BlockquoteForm: ({ element, editor }: BlockquoteFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const BlockquoteForm: ({ element, editor, hideCloseButton, }: BlockquoteFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -3,6 +3,7 @@ import type { Editor } from "@tiptap/react";
3
3
  interface ButtonFormProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const ButtonForm: ({ element, editor }: ButtonFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const ButtonForm: ({ element, editor, hideCloseButton }: ButtonFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -3,6 +3,7 @@ import type { Editor } from "@tiptap/react";
3
3
  interface ColumnFormProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const ColumnForm: ({ element, editor }: ColumnFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const ColumnForm: ({ element, editor, hideCloseButton }: ColumnFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -3,6 +3,7 @@ import type { Editor } from "@tiptap/react";
3
3
  interface CustomCodeFormProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const CustomCodeForm: ({ element, editor }: CustomCodeFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const CustomCodeForm: ({ element, editor, hideCloseButton, }: CustomCodeFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -3,6 +3,7 @@ import type { Editor } from "@tiptap/react";
3
3
  interface DividerFormProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const DividerForm: ({ element, editor }: DividerFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const DividerForm: ({ element, editor, hideCloseButton }: DividerFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -3,5 +3,6 @@ import type { Editor } from "@tiptap/react";
3
3
  export interface ImageBlockFormProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const ImageBlockForm: ({ element, editor }: ImageBlockFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const ImageBlockForm: ({ element, editor, hideCloseButton, }: ImageBlockFormProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,15 @@
1
+ import { Node } from "@tiptap/core";
2
+ import { defaultListProps, type ListProps } from "./List.types";
3
+ declare module "@tiptap/core" {
4
+ interface Commands<ReturnType> {
5
+ list: {
6
+ setList: (props?: Partial<ListProps>) => ReturnType;
7
+ toggleList: () => ReturnType;
8
+ toggleOrderedList: () => ReturnType;
9
+ toggleUnorderedList: () => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export { defaultListProps };
14
+ export declare const List: Node<any, any>;
15
+ export default List;
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ export declare const listSchema: z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodString>;
4
+ listType: z.ZodEnum<["ordered", "unordered"]>;
5
+ borderColor: z.ZodString;
6
+ borderWidth: z.ZodNumber;
7
+ paddingVertical: z.ZodNumber;
8
+ paddingHorizontal: z.ZodNumber;
9
+ }, "strip", z.ZodTypeAny, {
10
+ borderColor: string;
11
+ borderWidth: number;
12
+ paddingVertical: number;
13
+ paddingHorizontal: number;
14
+ listType: "ordered" | "unordered";
15
+ id?: string | undefined;
16
+ }, {
17
+ borderColor: string;
18
+ borderWidth: number;
19
+ paddingVertical: number;
20
+ paddingHorizontal: number;
21
+ listType: "ordered" | "unordered";
22
+ id?: string | undefined;
23
+ }>;
24
+ export interface ListProps {
25
+ /** Whether the list is ordered (numbered) or unordered (bulleted) */
26
+ listType: "ordered" | "unordered";
27
+ /** Unique identifier for the list node */
28
+ id?: string;
29
+ /** Border color for list markers (bullets/numbers) */
30
+ borderColor?: string;
31
+ /** Border width in pixels */
32
+ borderWidth?: number;
33
+ /** Vertical padding in pixels */
34
+ paddingVertical?: number;
35
+ /** Horizontal padding in pixels */
36
+ paddingHorizontal?: number;
37
+ }
38
+ export declare const defaultListProps: ListProps;
@@ -0,0 +1,12 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ /**
3
+ * List NodeView component that renders the list.
4
+ *
5
+ * Uses SortableItemWrapper for proper drag-and-drop reordering,
6
+ * selection styling, and action buttons (duplicate, delete).
7
+ *
8
+ * When nested inside a blockquote, uses a simpler wrapper without
9
+ * drag handles or selection behavior to let the blockquote handle those.
10
+ */
11
+ export declare const ListComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default ListComponentNode;
@@ -0,0 +1,9 @@
1
+ import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
2
+ import type { Editor } from "@tiptap/react";
3
+ interface ListFormProps {
4
+ element?: ProseMirrorNode;
5
+ editor: Editor | null;
6
+ hideCloseButton?: boolean;
7
+ }
8
+ export declare const ListForm: ({ element, editor, hideCloseButton }: ListFormProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ export { List, defaultListProps } from "./List";
2
+ export { ListForm } from "./ListForm";
3
+ export type { ListProps } from "./List.types";
4
+ export { listSchema } from "./List.types";
@@ -0,0 +1,34 @@
1
+ import { Node } from "@tiptap/core";
2
+ import type { ListItemProps } from "./ListItem.types";
3
+ declare module "@tiptap/core" {
4
+ interface Commands<ReturnType> {
5
+ listItem: {
6
+ /** Split the list item at the current cursor position */
7
+ splitListItem: (typeOrName: string) => ReturnType;
8
+ /** Lift the list item out of the list (outdent) */
9
+ liftListItem: (typeOrName: string) => ReturnType;
10
+ /** Sink the list item into a nested list (indent) */
11
+ sinkListItem: (typeOrName: string) => ReturnType;
12
+ /** Wrap selection in a list */
13
+ wrapInList: (typeOrName: string, attrs?: Record<string, unknown>) => ReturnType;
14
+ };
15
+ }
16
+ }
17
+ export declare const defaultListItemProps: ListItemProps;
18
+ /**
19
+ * Custom ListItem extension with prosemirror-schema-list commands.
20
+ *
21
+ * Provides commands:
22
+ * - splitListItem: Split list item at cursor (creates new bullet)
23
+ * - liftListItem: Lift list item out of list (outdent)
24
+ * - sinkListItem: Sink list item into nested list (indent)
25
+ * - wrapInList: Wrap selection in a list
26
+ *
27
+ * Keyboard shortcuts:
28
+ * - Enter: Split list item (handled in List extension)
29
+ * - Tab: Sink list item (handled in List extension)
30
+ * - Shift-Tab: Lift list item (handled in List extension)
31
+ * - Shift-Enter: Add a hard break (new line within the paragraph)
32
+ */
33
+ export declare const ListItem: Node<any, any>;
34
+ export default ListItem;
@@ -0,0 +1,7 @@
1
+ export interface ListItemProps {
2
+ /** Background color for the list item */
3
+ backgroundColor?: string;
4
+ /** Unique identifier for the list item node */
5
+ id?: string;
6
+ }
7
+ export declare const defaultListItemProps: ListItemProps;
@@ -0,0 +1,7 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ /**
3
+ * Simple ListItem NodeView that renders as a standard <li> element.
4
+ * Uses NodeViewContent to allow prosemirror to manage the content.
5
+ */
6
+ export declare const ListItemComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ListItemComponentNode;
@@ -0,0 +1,2 @@
1
+ export { ListItem, defaultListItemProps } from "./ListItem";
2
+ export type { ListItemProps } from "./ListItem.types";
@@ -3,6 +3,7 @@ import type { Editor } from "@tiptap/react";
3
3
  interface TextBlockFormProps {
4
4
  element?: ProseMirrorNode;
5
5
  editor: Editor | null;
6
+ hideCloseButton?: boolean;
6
7
  }
7
- export declare const TextBlockForm: ({ element, editor }: TextBlockFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const TextBlockForm: ({ element, editor, hideCloseButton }: TextBlockFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -1,16 +1,20 @@
1
1
  import { Extension, Node } from "@tiptap/core";
2
- import type { VariableNodeOptions } from "./Variable.types";
2
+ import type { VariableNodeOptions, VariableOptions } from "./Variable.types";
3
3
  export declare const VariableNode: Node<VariableNodeOptions, any>;
4
4
  /**
5
5
  * Extension that inserts an empty variable chip when user types {{
6
+ * This is used when autocomplete is disabled (disableVariablesAutocomplete=true)
6
7
  */
7
8
  export declare const VariableInputRule: Extension<any, any>;
8
9
  /**
9
- * @deprecated Use `VariableInputRule` instead. This alias will be removed in a future major version.
10
+ * Extension that provides variable autocomplete suggestions.
11
+ * When user types {{, shows a dropdown with available variables.
12
+ * Pass `variables` option to configure available variables.
13
+ * Pass `disableSuggestions: true` to disable autocomplete (falls back to VariableInputRule behavior).
10
14
  */
11
- export declare const Variable: Extension<any, any>;
15
+ export declare const Variable: Extension<VariableOptions, any>;
12
16
  /**
13
- * @deprecated This extension has been removed. Variable conversion now happens via VariableInputRule.
17
+ * @deprecated This extension has been removed. Variable conversion now happens via VariableInputRule or Variable.
14
18
  * This is a no-op extension provided for backwards compatibility and will be removed in a future major version.
15
19
  */
16
20
  export declare const VariableTypeHandler: Extension<any, any>;
@@ -8,28 +8,21 @@ export interface VariableNodeAttributes {
8
8
  isInvalid: boolean;
9
9
  }
10
10
  /**
11
- * @deprecated This interface has been removed as the suggestion feature was removed.
12
- * Provided for backwards compatibility and will be removed in a future major version.
11
+ * Options for the Variable suggestion extension that provides autocomplete.
13
12
  */
14
13
  export interface VariableOptions {
15
14
  HTMLAttributes?: Record<string, unknown>;
16
15
  suggestion?: Partial<SuggestionOptions>;
16
+ /** Variables available for autocomplete suggestions */
17
17
  variables?: Record<string, unknown>;
18
+ /** When true, disables the autocomplete dropdown */
18
19
  disableSuggestions?: boolean;
19
20
  }
20
- /**
21
- * @deprecated This interface has been removed as the suggestion feature was removed.
22
- * Provided for backwards compatibility and will be removed in a future major version.
23
- */
24
21
  export interface VariableCommandProps {
25
22
  editor: Editor;
26
23
  range: Range;
27
24
  props: string;
28
25
  }
29
- /**
30
- * @deprecated This interface has been removed as the suggestion feature was removed.
31
- * Provided for backwards compatibility and will be removed in a future major version.
32
- */
33
26
  export interface VariableSuggestionProps {
34
27
  editor: Editor;
35
28
  range: Range;
@@ -42,10 +35,6 @@ export interface VariableSuggestionProps {
42
35
  }) => void;
43
36
  selected: number;
44
37
  }
45
- /**
46
- * @deprecated This interface has been removed as the suggestion feature was removed.
47
- * Provided for backwards compatibility and will be removed in a future major version.
48
- */
49
38
  export interface VariableSuggestionsProps extends SuggestionProps {
50
39
  items: string[];
51
40
  command: (item: string) => void;
@@ -0,0 +1,7 @@
1
+ interface VariableSuggestionsProps {
2
+ items: string[];
3
+ command: (item: string) => void;
4
+ selected: number;
5
+ }
6
+ export declare const VariableSuggestions: React.FC<VariableSuggestionsProps>;
7
+ export {};
@@ -1,3 +1,4 @@
1
1
  export * from "./Variable";
2
2
  export * from "./Variable.types";
3
3
  export * from "./VariablePaste";
4
+ export * from "./VariableSuggestions";
@@ -0,0 +1,2 @@
1
+ import type { SuggestionOptions } from "@tiptap/suggestion";
2
+ export declare const suggestion: Partial<SuggestionOptions>;
@@ -1,6 +1,11 @@
1
1
  import type { Node } from "@tiptap/pm/model";
2
- export declare const ExtensionKit: (options?: {
2
+ export interface ExtensionKitOptions {
3
3
  setSelectedNode?: (node: Node) => void;
4
4
  shouldHandleClick?: () => boolean;
5
- }) => (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any>)[];
5
+ /** Variables available for autocomplete suggestions */
6
+ variables?: Record<string, unknown>;
7
+ /** When true, disables variable autocomplete and allows typing any variable */
8
+ disableVariablesAutocomplete?: boolean;
9
+ }
10
+ export declare const ExtensionKit: (options?: ExtensionKitOptions) => (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any>)[];
6
11
  export default ExtensionKit;
@@ -23,6 +23,8 @@ export { FixedChannelSelection } from "./FixedChannelSelection";
23
23
  export { Heading } from "./Heading";
24
24
  export { ImageBlock } from "./ImageBlock";
25
25
  export { Link } from "./Link";
26
+ export { List } from "./List";
27
+ export { ListItem } from "./ListItem";
26
28
  export { Paragraph } from "./Paragraph";
27
29
  export { Selection } from "./Selection";
28
30
  export { SlashMenu } from "./SlashMenu";
@@ -0,0 +1,2 @@
1
+ import { type BlockBaseProps } from "../Block";
2
+ export declare const ListBlock: ({ draggable }: Pick<BlockBaseProps, "draggable">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./ListBlock";