@trycourier/react-designer 0.1.0 → 0.3.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 (117) hide show
  1. package/README.md +150 -49
  2. package/dist/cjs/index.js +70 -47
  3. package/dist/cjs/index.js.map +4 -4
  4. package/dist/cjs/styles.css +1604 -509
  5. package/dist/components/BrandEditor/BrandEditor.d.ts +1 -0
  6. package/dist/components/BrandEditor/Editor/BrandFooter/BrandFooter.d.ts +1 -1
  7. package/dist/components/BrandEditor/Editor/Editor.d.ts +1 -0
  8. package/dist/components/Providers/api/template.d.ts +33 -1
  9. package/dist/components/Providers/store.d.ts +11 -0
  10. package/dist/components/Providers/useBrandActions.d.ts +1 -1
  11. package/dist/components/Providers/useTemplateActions.d.ts +24 -2
  12. package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +7 -6
  13. package/dist/components/TemplateEditor/Channels/Email/EmailEditor.d.ts +1 -1
  14. package/dist/components/TemplateEditor/Channels/Email/EmailLayout.d.ts +1 -1
  15. package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBar.d.ts +9 -3
  16. package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBarSortableItemWrapper/SideBarSortableItemWrapper.d.ts +4 -18
  17. package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +1 -1
  18. package/dist/components/TemplateEditor/Channels/Inbox/InboxLayout.d.ts +1 -1
  19. package/dist/components/TemplateEditor/Channels/MSTeams/MSTeams.d.ts +5 -3
  20. package/dist/components/TemplateEditor/Channels/MSTeams/MSTeamsEditor.d.ts +2 -1
  21. package/dist/components/TemplateEditor/Channels/MSTeams/MSTeamsLayout.d.ts +1 -1
  22. package/dist/components/TemplateEditor/Channels/MSTeams/SideBar/SideBar.d.ts +5 -3
  23. package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +1 -1
  24. package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +1 -1
  25. package/dist/components/TemplateEditor/Channels/SMS/SMSLayout.d.ts +1 -1
  26. package/dist/components/TemplateEditor/Channels/Slack/SideBar/SideBar.d.ts +5 -3
  27. package/dist/components/TemplateEditor/Channels/Slack/Slack.d.ts +5 -3
  28. package/dist/components/TemplateEditor/Channels/Slack/SlackEditor.d.ts +2 -1
  29. package/dist/components/TemplateEditor/Channels/Slack/SlackLayout.d.ts +1 -1
  30. package/dist/components/TemplateEditor/Channels/useChannels.d.ts +1 -1
  31. package/dist/components/TemplateEditor/ReadOnlyEditorContent.d.ts +7 -0
  32. package/dist/components/TemplateEditor/TemplateEditor.d.ts +2 -1
  33. package/dist/components/TemplateEditor/hooks/index.d.ts +1 -0
  34. package/dist/components/TemplateEditor/hooks/useDebouncedFlush.d.ts +10 -0
  35. package/dist/components/TemplateEditor/hooks/useDndRef.d.ts +18 -0
  36. package/dist/components/TemplateEditor/hooks/useEditorDnd.d.ts +12 -16
  37. package/dist/components/TemplateEditor/hooks/usePragmaticDnd.d.ts +22 -0
  38. package/dist/components/TemplateEditor/hooks/useSyncEditorItems.d.ts +3 -2
  39. package/dist/components/TemplateEditor/index.d.ts +4 -1
  40. package/dist/components/TemplateEditor/store.d.ts +144 -2
  41. package/dist/components/extensions/Blockquote/Blockquote.types.d.ts +2 -2
  42. package/dist/components/extensions/Button/Button.types.d.ts +18 -24
  43. package/dist/components/extensions/Button/ButtonComponent.d.ts +1 -0
  44. package/dist/components/extensions/ButtonRow/ButtonRowComponent.d.ts +5 -1
  45. package/dist/components/extensions/Column/Column.d.ts +11 -0
  46. package/dist/components/extensions/Column/Column.types.d.ts +44 -0
  47. package/dist/components/extensions/Column/ColumnComponent.d.ts +9 -0
  48. package/dist/components/extensions/Column/ColumnForm.d.ts +8 -0
  49. package/dist/components/extensions/Column/index.d.ts +5 -0
  50. package/dist/components/extensions/ColumnCell/ColumnCell.d.ts +10 -0
  51. package/dist/components/extensions/ColumnCell/ColumnCellComponent.d.ts +2 -0
  52. package/dist/components/extensions/ColumnCell/index.d.ts +2 -0
  53. package/dist/components/extensions/ColumnRow/ColumnRow.d.ts +10 -0
  54. package/dist/components/extensions/ColumnRow/ColumnRowComponent.d.ts +2 -0
  55. package/dist/components/extensions/ColumnRow/index.d.ts +2 -0
  56. package/dist/components/extensions/ImageBlock/ImageBlock.types.d.ts +2 -6
  57. package/dist/components/extensions/Selection/Selection.d.ts +1 -0
  58. package/dist/components/extensions/TextBlock/TextBlock.types.d.ts +4 -12
  59. package/dist/components/extensions/Variable/Variable.d.ts +14 -2
  60. package/dist/components/extensions/Variable/Variable.types.d.ts +33 -18
  61. package/dist/components/extensions/Variable/VariableIcon.d.ts +6 -0
  62. package/dist/components/extensions/extension-kit.d.ts +1 -1
  63. package/dist/components/extensions/index.d.ts +4 -1
  64. package/dist/components/hooks/index.d.ts +2 -0
  65. package/dist/components/hooks/useBlockConfig.d.ts +110 -0
  66. package/dist/components/hooks/useVariables.d.ts +40 -0
  67. package/dist/components/ui/Blocks/ColumnBlock/ColumnBlock.d.ts +3 -0
  68. package/dist/components/ui/Blocks/ColumnBlock/index.d.ts +1 -0
  69. package/dist/components/ui/Blocks/CustomCodeBlock/index.d.ts +1 -1
  70. package/dist/components/ui/Blocks/index.d.ts +1 -0
  71. package/dist/components/ui/ContentIcon/ContentIcon.d.ts +1 -0
  72. package/dist/components/ui/DraggableItem/DraggableItem.d.ts +16 -0
  73. package/dist/components/ui/DraggableItem/index.d.ts +1 -0
  74. package/dist/components/ui/DropIndicatorPlaceholder/DropIndicatorPlaceholder.d.ts +5 -0
  75. package/dist/components/ui/DropIndicatorPlaceholder/index.d.ts +1 -0
  76. package/dist/components/ui/FormHeader/FormHeader.d.ts +2 -1
  77. package/dist/components/ui/MainLayout/MainLayout.d.ts +1 -1
  78. package/dist/components/ui/PreviewPanel/PreviewPanel.d.ts +2 -1
  79. package/dist/components/ui/SortableItemWrapper/SortableItemWrapper.d.ts +11 -8
  80. package/dist/components/ui/TextInput/TextInput.d.ts +0 -1
  81. package/dist/components/ui/TextMenu/config.d.ts +16 -0
  82. package/dist/components/ui/TextMenu/hooks/useConditionalRules.d.ts +18 -0
  83. package/dist/components/ui/TextMenu/hooks/useTextmenuCommands.d.ts +15 -1
  84. package/dist/components/ui/VariableEditor/VariableChipBase.d.ts +35 -0
  85. package/dist/components/ui/VariableEditor/VariableEditorToolbar.d.ts +15 -0
  86. package/dist/components/ui/VariableEditor/VariableInput.d.ts +13 -0
  87. package/dist/components/ui/VariableEditor/VariableTextarea.d.ts +11 -0
  88. package/dist/components/ui/VariableEditor/index.d.ts +8 -0
  89. package/dist/components/ui/VariableEditor/shared.d.ts +47 -0
  90. package/dist/components/ui-kit/Icon/EmailIcon.d.ts +3 -0
  91. package/dist/components/ui-kit/Icon/MSTeamsIcon.d.ts +1 -1
  92. package/dist/components/ui-kit/Icon/PushIcon.d.ts +1 -1
  93. package/dist/components/ui-kit/Icon/VariableIcon.d.ts +1 -1
  94. package/dist/components/ui-kit/Icon/index.d.ts +1 -0
  95. package/dist/components/ui-kit/ThemeProvider/ThemeProvider.d.ts +1 -1
  96. package/dist/components/ui-kit/Toggle/Toggle.d.ts +2 -2
  97. package/dist/components/ui-kit/ToggleGroup/ToggleGroup.d.ts +2 -2
  98. package/dist/components/utils/extractVariablesFromContent.d.ts +13 -0
  99. package/dist/components/utils/index.d.ts +1 -0
  100. package/dist/components/utils/multipleContainersKeyboardCoordinates.d.ts +1 -2
  101. package/dist/components/utils/validateVariableName.d.ts +9 -0
  102. package/dist/esm/index.js +70 -47
  103. package/dist/esm/index.js.map +4 -4
  104. package/dist/esm/styles.css +1604 -509
  105. package/dist/hooks/useAutoSave.d.ts +2 -1
  106. package/dist/index.d.ts +1 -1
  107. package/dist/lib/utils/image.d.ts +5 -0
  108. package/dist/styles.css +1604 -509
  109. package/dist/types/elemental.schema.d.ts +3 -3
  110. package/dist/types/elemental.types.d.ts +48 -4
  111. package/package.json +7 -6
  112. package/dist/cjs/index.css +0 -2
  113. package/dist/cjs/index.css.map +0 -7
  114. package/dist/components/extensions/Variable/VariableSuggestions.d.ts +0 -7
  115. package/dist/components/extensions/Variable/suggestion.d.ts +0 -2
  116. package/dist/esm/index.css +0 -2
  117. package/dist/esm/index.css.map +0 -7
@@ -2,7 +2,8 @@ export { BrandFooter } from "@/components/BrandEditor/Editor/BrandFooter";
2
2
  export { PreviewPanel } from "@/components/ui/PreviewPanel";
3
3
  export { TextMenu } from "@/components/ui/TextMenu";
4
4
  export { cn, convertElementalToTiptap, convertTiptapToElemental } from "@/lib/utils";
5
- export { SortableContext } from "@dnd-kit/sortable";
5
+ export { VariableInput, VariableTextarea } from "@/components/ui/VariableEditor";
6
+ export { getFlattenedVariables } from "@/components/utils/getFlattenedVariables";
6
7
  export { useChannels } from "./Channels";
7
8
  export { default as EmailEditor } from "./Channels/Email/EmailEditor";
8
9
  export * from "./TemplateEditor";
@@ -17,11 +18,13 @@ export declare const InboxChannel: import("react").MemoExoticComponent<import("r
17
18
  export declare const MSTeamsChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").MSTeamsProps & import("react").RefAttributes<HTMLDivElement>>>;
18
19
  export declare const SlackChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").SlackProps & import("react").RefAttributes<HTMLDivElement>>>;
19
20
  export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type InboxEditorProps, type MSTeamsEditorProps, type PushEditorProps, type SlackEditorProps, type SMSEditorProps, } from "./Channels";
21
+ export { CHANNELS } from "@/channels";
20
22
  export type { ChannelType } from "@/store";
21
23
  export type { ElementalContent } from "@/types";
22
24
  export { ChannelRootContainer, EditorSidebar } from "./Layout";
23
25
  export { InboxEditor, MSTeamsEditor, PushEditor, SlackEditor, SMSEditor } from "./Channels";
24
26
  export { useAutoSave } from "@/hooks/useAutoSave";
27
+ export { useDebouncedFlush } from "./hooks/useDebouncedFlush";
25
28
  export { Status as TemplateStatus } from "@/components/ui/Status";
26
29
  export { MonacoCodeEditor } from "@/components/extensions/CustomCode/MonacoCodeEditor";
27
30
  export { ToggleGroup } from "@/components/ui-kit";
@@ -3,9 +3,11 @@ import type { Editor } from "@tiptap/react";
3
3
  export declare const subjectAtom: import("jotai").PrimitiveAtom<string | null> & {
4
4
  init: string | null;
5
5
  };
6
- export declare const templateEditorContentAtom: import("jotai").PrimitiveAtom<ElementalContent | null | undefined> & {
7
- init: ElementalContent | null | undefined;
6
+ export type ContentTransformer = (content: ElementalContent) => ElementalContent;
7
+ export declare const contentTransformerAtom: import("jotai").PrimitiveAtom<ContentTransformer | null> & {
8
+ init: ContentTransformer | null;
8
9
  };
10
+ export declare const templateEditorContentAtom: import("jotai").WritableAtom<ElementalContent | null | undefined, [content: ElementalContent | null | undefined], void>;
9
11
  export declare const templateEditorPublishedAtAtom: import("jotai").PrimitiveAtom<string | null | undefined> & {
10
12
  init: string | null | undefined;
11
13
  };
@@ -24,3 +26,143 @@ export declare const isTemplateTransitioningAtom: import("jotai").PrimitiveAtom<
24
26
  export declare const isSidebarExpandedAtom: import("jotai").PrimitiveAtom<boolean> & {
25
27
  init: boolean;
26
28
  };
29
+ export declare const variableValuesAtom: import("jotai").PrimitiveAtom<Record<string, string>> & {
30
+ init: Record<string, string>;
31
+ };
32
+ export declare const isDraggingAtom: import("jotai").PrimitiveAtom<boolean> & {
33
+ init: boolean;
34
+ };
35
+ export declare const pendingAutoSaveAtom: import("jotai").PrimitiveAtom<ElementalContent | null> & {
36
+ init: ElementalContent | null;
37
+ };
38
+ export declare const lastSavedContentAtom: import("jotai").PrimitiveAtom<string | null> & {
39
+ init: string | null;
40
+ };
41
+ export type FlushFunction = () => void;
42
+ export declare const flushFunctionsAtom: import("jotai").WritableAtom<Map<string, FlushFunction>, [update: {
43
+ action: "register" | "unregister";
44
+ id: string;
45
+ fn?: FlushFunction;
46
+ }], void>;
47
+ export declare const flushAllPendingUpdates: (flushFunctions: Map<string, FlushFunction>) => void;
48
+ /**
49
+ * Available block element types that can be used in the sidebar
50
+ */
51
+ export type BlockElementType = "heading" | "text" | "image" | "spacer" | "divider" | "button" | "customCode" | "column" | "blockquote";
52
+ /**
53
+ * Attributes that can be set as defaults or in presets for blocks.
54
+ * Types match the actual TipTap node attribute types for each extension.
55
+ */
56
+ export interface BlockAttributes {
57
+ /** Background color (string, e.g., "#ffffff" or "transparent") */
58
+ backgroundColor?: string;
59
+ /** Border color */
60
+ borderColor?: string;
61
+ /** Border width in pixels */
62
+ borderWidth?: number;
63
+ /** Border radius in pixels */
64
+ borderRadius?: number;
65
+ /** Vertical padding in pixels */
66
+ paddingVertical?: number;
67
+ /** Horizontal padding in pixels */
68
+ paddingHorizontal?: number;
69
+ /** Text alignment */
70
+ textAlign?: "left" | "center" | "right" | "justify";
71
+ /** Button label text */
72
+ label?: string;
73
+ /** Button link URL */
74
+ link?: string;
75
+ /** Button alignment */
76
+ alignment?: "left" | "center" | "right";
77
+ /** Button padding in pixels */
78
+ padding?: number;
79
+ /** Font weight */
80
+ fontWeight?: "normal" | "bold";
81
+ /** Font style */
82
+ fontStyle?: "normal" | "italic";
83
+ /** Underline text */
84
+ isUnderline?: boolean;
85
+ /** Strikethrough text */
86
+ isStrike?: boolean;
87
+ /** @deprecated Text color - legacy property */
88
+ textColor?: string;
89
+ /** Divider color */
90
+ color?: string;
91
+ /** Divider line thickness in pixels */
92
+ size?: number;
93
+ /** Divider corner radius */
94
+ radius?: number;
95
+ /** Divider variant type */
96
+ variant?: "divider" | "spacer";
97
+ /** Image source path/URL */
98
+ sourcePath?: string;
99
+ /** Image alt text */
100
+ alt?: string;
101
+ /** Image width as ratio (0-1, where 1 = 100%) */
102
+ width?: number;
103
+ /** HTML code content */
104
+ code?: string;
105
+ /** Number of columns (1-4) */
106
+ columnsCount?: number;
107
+ /** Left border width for blockquote */
108
+ borderLeftWidth?: number;
109
+ [key: string]: unknown;
110
+ }
111
+ /**
112
+ * A block preset is a pre-configured variant of an existing block type.
113
+ * For example, a "Portal Button" preset is a button with specific href and label.
114
+ */
115
+ export interface BlockPreset {
116
+ /** The base block type this preset is built on */
117
+ type: BlockElementType;
118
+ /** Unique identifier for this preset */
119
+ key: string;
120
+ /** Display label in the sidebar */
121
+ label: string;
122
+ /** Optional custom icon (React node) */
123
+ icon?: React.ReactNode;
124
+ /** Pre-configured attributes for this preset */
125
+ attributes: BlockAttributes;
126
+ }
127
+ /**
128
+ * A reference to a preset in the visible blocks list
129
+ */
130
+ export interface PresetReference {
131
+ /** The base block type */
132
+ type: BlockElementType;
133
+ /** The preset key */
134
+ preset: string;
135
+ }
136
+ /**
137
+ * A visible block item can be either:
138
+ * - A built-in block type string (e.g., "text", "button")
139
+ * - A preset reference (e.g., { type: "button", preset: "portal" })
140
+ */
141
+ export type VisibleBlockItem = BlockElementType | PresetReference;
142
+ /**
143
+ * Type guard to check if a VisibleBlockItem is a PresetReference
144
+ */
145
+ export declare const isPresetReference: (item: VisibleBlockItem) => item is PresetReference;
146
+ /**
147
+ * Default block elements available in the sidebar
148
+ */
149
+ export declare const DEFAULT_VISIBLE_BLOCKS: VisibleBlockItem[];
150
+ /**
151
+ * Atom to store visible blocks in the sidebar (and their order)
152
+ */
153
+ export declare const visibleBlocksAtom: import("jotai").PrimitiveAtom<VisibleBlockItem[]> & {
154
+ init: VisibleBlockItem[];
155
+ };
156
+ /**
157
+ * Atom to store default attributes for each block type
158
+ * When a new block is created, these defaults are applied
159
+ */
160
+ export declare const blockDefaultsAtom: import("jotai").PrimitiveAtom<Partial<Record<BlockElementType, BlockAttributes>>> & {
161
+ init: Partial<Record<BlockElementType, BlockAttributes>>;
162
+ };
163
+ /**
164
+ * Atom to store registered block presets
165
+ */
166
+ export declare const blockPresetsAtom: import("jotai").PrimitiveAtom<BlockPreset[]> & {
167
+ init: BlockPreset[];
168
+ };
@@ -8,16 +8,16 @@ export declare const blockquoteSchema: z.ZodObject<{
8
8
  id: z.ZodOptional<z.ZodString>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  backgroundColor: string;
11
+ borderColor: string;
11
12
  paddingVertical: number;
12
13
  paddingHorizontal: number;
13
- borderColor: string;
14
14
  borderLeftWidth: number;
15
15
  id?: string | undefined;
16
16
  }, {
17
17
  backgroundColor: string;
18
+ borderColor: string;
18
19
  paddingVertical: number;
19
20
  paddingHorizontal: number;
20
- borderColor: string;
21
21
  borderLeftWidth: number;
22
22
  id?: string | undefined;
23
23
  }>;
@@ -3,61 +3,55 @@ export declare const buttonSchema: z.ZodObject<{
3
3
  label: z.ZodString;
4
4
  link: z.ZodOptional<z.ZodString>;
5
5
  alignment: z.ZodEnum<["left", "center", "right"]>;
6
- size: z.ZodEnum<["default", "full"]>;
7
6
  backgroundColor: z.ZodString;
8
- textColor: z.ZodString;
9
- borderWidth: z.ZodNumber;
10
7
  borderRadius: z.ZodNumber;
11
- borderColor: z.ZodString;
12
8
  padding: z.ZodNumber;
13
9
  fontWeight: z.ZodEnum<["normal", "bold"]>;
14
10
  fontStyle: z.ZodEnum<["normal", "italic"]>;
15
11
  isUnderline: z.ZodBoolean;
16
12
  isStrike: z.ZodBoolean;
13
+ textColor: z.ZodOptional<z.ZodString>;
14
+ borderColor: z.ZodOptional<z.ZodString>;
17
15
  }, "strip", z.ZodTypeAny, {
18
- padding: number;
19
- label: string;
20
16
  backgroundColor: string;
21
- textColor: string;
22
- borderColor: string;
23
- size: "full" | "default";
24
- borderWidth: number;
25
17
  borderRadius: number;
18
+ label: string;
26
19
  alignment: "left" | "center" | "right";
27
- fontStyle: "italic" | "normal";
28
- fontWeight: "bold" | "normal";
20
+ padding: number;
21
+ fontWeight: "normal" | "bold";
22
+ fontStyle: "normal" | "italic";
29
23
  isUnderline: boolean;
30
24
  isStrike: boolean;
31
25
  link?: string | undefined;
26
+ borderColor?: string | undefined;
27
+ textColor?: string | undefined;
32
28
  }, {
33
- padding: number;
34
- label: string;
35
29
  backgroundColor: string;
36
- textColor: string;
37
- borderColor: string;
38
- size: "full" | "default";
39
- borderWidth: number;
40
30
  borderRadius: number;
31
+ label: string;
41
32
  alignment: "left" | "center" | "right";
42
- fontStyle: "italic" | "normal";
43
- fontWeight: "bold" | "normal";
33
+ padding: number;
34
+ fontWeight: "normal" | "bold";
35
+ fontStyle: "normal" | "italic";
44
36
  isUnderline: boolean;
45
37
  isStrike: boolean;
46
38
  link?: string | undefined;
39
+ borderColor?: string | undefined;
40
+ textColor?: string | undefined;
47
41
  }>;
48
42
  export interface ButtonProps {
49
43
  label: string;
50
44
  link?: string;
51
45
  alignment: "left" | "center" | "right";
52
- size: "default" | "full";
53
46
  backgroundColor: string;
54
- textColor: string;
55
- borderWidth: number;
56
47
  borderRadius: number;
57
- borderColor: string;
58
48
  padding: number;
59
49
  fontWeight: "normal" | "bold";
60
50
  fontStyle: "normal" | "italic";
61
51
  isUnderline: boolean;
62
52
  isStrike: boolean;
53
+ /** @deprecated Legacy property - not supported by Elemental */
54
+ textColor?: string;
55
+ /** @deprecated Legacy property - not supported by Elemental */
56
+ borderColor?: string;
63
57
  }
@@ -7,5 +7,6 @@ export declare const ButtonComponent: React.FC<ButtonProps & {
7
7
  fontWeight?: string;
8
8
  isUnderline?: boolean;
9
9
  isStrike?: boolean;
10
+ children?: React.ReactNode;
10
11
  }>;
11
12
  export declare const ButtonComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,9 @@
1
1
  import { type NodeViewProps } from "@tiptap/react";
2
2
  import React from "react";
3
3
  import type { ButtonRowProps } from "./ButtonRow.types";
4
- export declare const ButtonRowComponent: React.FC<ButtonRowProps>;
4
+ export declare const ButtonRowComponent: React.FC<ButtonRowProps & {
5
+ onButton1LabelChange?: (label: string) => void;
6
+ onButton2LabelChange?: (label: string) => void;
7
+ editable?: boolean;
8
+ }>;
5
9
  export declare const ButtonRowComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { Node } from "@tiptap/core";
2
+ import type { ColumnProps } from "./Column.types";
3
+ declare module "@tiptap/core" {
4
+ interface Commands<ReturnType> {
5
+ column: {
6
+ setColumn: (props: Partial<ColumnProps>) => ReturnType;
7
+ };
8
+ }
9
+ }
10
+ export declare const defaultColumnProps: ColumnProps;
11
+ export declare const Column: Node<any, any>;
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ import type { JSONContent } from "@tiptap/core";
3
+ export interface CellContent {
4
+ elements: JSONContent[];
5
+ }
6
+ export declare const columnSchema: z.ZodObject<{
7
+ columnsCount: z.ZodDefault<z.ZodNumber>;
8
+ paddingHorizontal: z.ZodDefault<z.ZodNumber>;
9
+ paddingVertical: z.ZodDefault<z.ZodNumber>;
10
+ backgroundColor: z.ZodDefault<z.ZodString>;
11
+ borderWidth: z.ZodDefault<z.ZodNumber>;
12
+ borderRadius: z.ZodDefault<z.ZodNumber>;
13
+ borderColor: z.ZodDefault<z.ZodString>;
14
+ cells: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ elements: z.ZodArray<z.ZodAny, "many">;
16
+ }, "strip", z.ZodTypeAny, {
17
+ elements: any[];
18
+ }, {
19
+ elements: any[];
20
+ }>, "many">>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ backgroundColor: string;
23
+ borderColor: string;
24
+ borderWidth: number;
25
+ borderRadius: number;
26
+ paddingVertical: number;
27
+ paddingHorizontal: number;
28
+ columnsCount: number;
29
+ cells?: {
30
+ elements: any[];
31
+ }[] | undefined;
32
+ }, {
33
+ backgroundColor?: string | undefined;
34
+ borderColor?: string | undefined;
35
+ borderWidth?: number | undefined;
36
+ borderRadius?: number | undefined;
37
+ paddingVertical?: number | undefined;
38
+ paddingHorizontal?: number | undefined;
39
+ columnsCount?: number | undefined;
40
+ cells?: {
41
+ elements: any[];
42
+ }[] | undefined;
43
+ }>;
44
+ export type ColumnProps = z.infer<typeof columnSchema>;
@@ -0,0 +1,9 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ import type { Node } from "@tiptap/pm/model";
3
+ import type { ColumnProps } from "./Column.types";
4
+ export declare const ColumnComponent: React.FC<ColumnProps & {
5
+ node: Node;
6
+ columnsCount: number;
7
+ isPreviewMode?: boolean;
8
+ }>;
9
+ export declare const ColumnComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
2
+ import type { Editor } from "@tiptap/react";
3
+ interface ColumnFormProps {
4
+ element?: ProseMirrorNode;
5
+ editor: Editor | null;
6
+ }
7
+ export declare const ColumnForm: ({ element, editor }: ColumnFormProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ export { Column, defaultColumnProps } from "./Column";
2
+ export { ColumnComponent, ColumnComponentNode } from "./ColumnComponent";
3
+ export { ColumnForm } from "./ColumnForm";
4
+ export type { ColumnProps } from "./Column.types";
5
+ export { columnSchema } from "./Column.types";
@@ -0,0 +1,10 @@
1
+ import { Node } from "@tiptap/core";
2
+ declare module "@tiptap/core" {
3
+ interface Commands<ReturnType> {
4
+ columnCell: {
5
+ insertColumnCell: () => ReturnType;
6
+ };
7
+ }
8
+ }
9
+ export declare const ColumnCell: Node<any, any>;
10
+ export default ColumnCell;
@@ -0,0 +1,2 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ export declare const ColumnCellComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ColumnCell, default } from "./ColumnCell";
2
+ export { ColumnCellComponentNode } from "./ColumnCellComponent";
@@ -0,0 +1,10 @@
1
+ import { Node } from "@tiptap/core";
2
+ declare module "@tiptap/core" {
3
+ interface Commands<ReturnType> {
4
+ columnRow: {
5
+ insertColumnRow: () => ReturnType;
6
+ };
7
+ }
8
+ }
9
+ export declare const ColumnRow: Node<any, any>;
10
+ export default ColumnRow;
@@ -0,0 +1,2 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ export declare const ColumnRowComponentNode: (_props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ColumnRow, default } from "./ColumnRow";
2
+ export { ColumnRowComponentNode } from "./ColumnRowComponent";
@@ -6,28 +6,25 @@ export declare const imageBlockSchema: z.ZodObject<{
6
6
  alignment: z.ZodEnum<["left", "center", "right"]>;
7
7
  width: z.ZodNumber;
8
8
  borderWidth: z.ZodNumber;
9
- borderRadius: z.ZodNumber;
10
9
  borderColor: z.ZodString;
11
10
  isUploading: z.ZodOptional<z.ZodBoolean>;
12
11
  imageNaturalWidth: z.ZodNumber;
13
12
  }, "strip", z.ZodTypeAny, {
14
- width: number;
15
13
  borderColor: string;
16
14
  borderWidth: number;
17
- borderRadius: number;
18
15
  alignment: "left" | "center" | "right";
19
16
  sourcePath: string;
17
+ width: number;
20
18
  imageNaturalWidth: number;
21
19
  link?: string | undefined;
22
20
  alt?: string | undefined;
23
21
  isUploading?: boolean | undefined;
24
22
  }, {
25
- width: number;
26
23
  borderColor: string;
27
24
  borderWidth: number;
28
- borderRadius: number;
29
25
  alignment: "left" | "center" | "right";
30
26
  sourcePath: string;
27
+ width: number;
31
28
  imageNaturalWidth: number;
32
29
  link?: string | undefined;
33
30
  alt?: string | undefined;
@@ -40,7 +37,6 @@ export interface ImageBlockProps {
40
37
  alignment: "left" | "center" | "right";
41
38
  width: number;
42
39
  borderWidth: number;
43
- borderRadius: number;
44
40
  borderColor: string;
45
41
  isUploading?: boolean;
46
42
  imageNaturalWidth: number;
@@ -4,6 +4,7 @@ import { PluginKey } from "@tiptap/pm/state";
4
4
  export interface SelectionOptions {
5
5
  HTMLAttributes: Record<string, unknown>;
6
6
  setSelectedNode: (node: Node) => void;
7
+ shouldHandleClick?: () => boolean;
7
8
  }
8
9
  declare module "@tiptap/core" {
9
10
  interface Commands<ReturnType> {
@@ -4,31 +4,25 @@ export declare const textBlockSchema: z.ZodObject<{
4
4
  paddingHorizontal: z.ZodNumber;
5
5
  backgroundColor: z.ZodString;
6
6
  borderWidth: z.ZodNumber;
7
- borderRadius: z.ZodNumber;
8
7
  borderColor: z.ZodString;
9
- textColor: z.ZodString;
10
8
  textAlign: z.ZodDefault<z.ZodEnum<["left", "center", "right", "justify"]>>;
11
9
  selected: z.ZodDefault<z.ZodBoolean>;
12
10
  id: z.ZodOptional<z.ZodString>;
13
11
  }, "strip", z.ZodTypeAny, {
14
12
  backgroundColor: string;
15
- textColor: string;
16
- paddingVertical: number;
17
- paddingHorizontal: number;
18
13
  borderColor: string;
19
14
  borderWidth: number;
20
- borderRadius: number;
15
+ paddingVertical: number;
16
+ paddingHorizontal: number;
21
17
  textAlign: "left" | "center" | "right" | "justify";
22
18
  selected: boolean;
23
19
  id?: string | undefined;
24
20
  }, {
25
21
  backgroundColor: string;
26
- textColor: string;
27
- paddingVertical: number;
28
- paddingHorizontal: number;
29
22
  borderColor: string;
30
23
  borderWidth: number;
31
- borderRadius: number;
24
+ paddingVertical: number;
25
+ paddingHorizontal: number;
32
26
  id?: string | undefined;
33
27
  textAlign?: "left" | "center" | "right" | "justify" | undefined;
34
28
  selected?: boolean | undefined;
@@ -38,9 +32,7 @@ export interface TextBlockProps {
38
32
  paddingHorizontal: number;
39
33
  backgroundColor: string;
40
34
  borderWidth: number;
41
- borderRadius: number;
42
35
  borderColor: string;
43
- textColor: string;
44
36
  textAlign: "left" | "center" | "right" | "justify";
45
37
  selected: boolean;
46
38
  id?: string;
@@ -1,4 +1,16 @@
1
1
  import { Extension, Node } from "@tiptap/core";
2
- import type { VariableNodeOptions, VariableOptions } from "./Variable.types";
2
+ import type { VariableNodeOptions } from "./Variable.types";
3
3
  export declare const VariableNode: Node<VariableNodeOptions, any>;
4
- export declare const Variable: Extension<VariableOptions, any>;
4
+ /**
5
+ * Extension that inserts an empty variable chip when user types {{
6
+ */
7
+ export declare const VariableInputRule: Extension<any, any>;
8
+ /**
9
+ * @deprecated Use `VariableInputRule` instead. This alias will be removed in a future major version.
10
+ */
11
+ export declare const Variable: Extension<any, any>;
12
+ /**
13
+ * @deprecated This extension has been removed. Variable conversion now happens via VariableInputRule.
14
+ * This is a no-op extension provided for backwards compatibility and will be removed in a future major version.
15
+ */
16
+ export declare const VariableTypeHandler: Extension<any, any>;
@@ -1,35 +1,51 @@
1
1
  import type { Editor, Range } from "@tiptap/core";
2
2
  import type { SuggestionOptions, SuggestionProps } from "@tiptap/suggestion";
3
- interface Props {
4
- editor: Editor;
5
- range: Range;
6
- clientRect: () => DOMRect | null;
7
- items: string[];
8
- command: (props: {
9
- editor: Editor;
10
- range: Range;
11
- props: string;
12
- }) => void;
3
+ export interface VariableNodeOptions {
4
+ HTMLAttributes?: Record<string, unknown>;
13
5
  }
6
+ export interface VariableNodeAttributes {
7
+ id: string;
8
+ isInvalid: boolean;
9
+ }
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.
13
+ */
14
14
  export interface VariableOptions {
15
15
  HTMLAttributes?: Record<string, unknown>;
16
16
  suggestion?: Partial<SuggestionOptions>;
17
17
  variables?: Record<string, unknown>;
18
+ disableSuggestions?: boolean;
18
19
  }
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
+ */
19
24
  export interface VariableCommandProps {
20
25
  editor: Editor;
21
26
  range: Range;
22
27
  props: string;
23
28
  }
24
- export interface VariableSuggestionProps extends Props {
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
+ export interface VariableSuggestionProps {
34
+ editor: Editor;
35
+ range: Range;
36
+ clientRect: () => DOMRect | null;
37
+ items: string[];
38
+ command: (props: {
39
+ editor: Editor;
40
+ range: Range;
41
+ props: string;
42
+ }) => void;
25
43
  selected: number;
26
44
  }
27
- export interface VariableNodeOptions {
28
- HTMLAttributes?: Record<string, unknown>;
29
- }
30
- export interface VariableNodeAttributes {
31
- id: string | null;
32
- }
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
+ */
33
49
  export interface VariableSuggestionsProps extends SuggestionProps {
34
50
  items: string[];
35
51
  command: (item: string) => void;
@@ -37,4 +53,3 @@ export interface VariableSuggestionsProps extends SuggestionProps {
37
53
  query: string;
38
54
  selected: number;
39
55
  }
40
- export {};
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface VariableIconProps {
3
+ color?: string;
4
+ }
5
+ export declare const VariableIcon: React.FC<VariableIconProps>;
6
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { Node } from "@tiptap/pm/model";
2
2
  export declare const ExtensionKit: (options?: {
3
- variables?: Record<string, unknown>;
4
3
  setSelectedNode?: (node: Node) => void;
4
+ shouldHandleClick?: () => boolean;
5
5
  }) => (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any>)[];
6
6
  export default ExtensionKit;
@@ -10,6 +10,9 @@ export { StarterKit } from "@tiptap/starter-kit";
10
10
  export { Blockquote } from "./Blockquote";
11
11
  export { Button } from "./Button";
12
12
  export { ButtonRow } from "./ButtonRow";
13
+ export { Column } from "./Column";
14
+ export { ColumnRow } from "./ColumnRow";
15
+ export { ColumnCell } from "./ColumnCell";
13
16
  export { CustomCode } from "./CustomCode";
14
17
  export { Divider } from "./Divider";
15
18
  export { Document } from "./Document";
@@ -24,4 +27,4 @@ export { Paragraph } from "./Paragraph";
24
27
  export { Selection } from "./Selection";
25
28
  export { SlashMenu } from "./SlashMenu";
26
29
  export { UniqueId } from "./UniqueId";
27
- export { Variable, VariableNode, VariablePaste } from "./Variable";
30
+ export { VariableNode, VariableInputRule, VariablePaste, Variable, VariableTypeHandler, } from "./Variable";
@@ -1 +1,3 @@
1
1
  export * from "./useNodeAttributes";
2
+ export * from "./useVariables";
3
+ export * from "./useBlockConfig";