@veevarts/design-system 0.1.17 → 0.1.19

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 (48) hide show
  1. package/dist/index.cjs +106 -1
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.js +17284 -153
  4. package/dist/patterns/RichText/RichText.d.ts +105 -0
  5. package/dist/patterns/RichText/RichText.test.d.ts +1 -0
  6. package/dist/patterns/RichText/TipTapArea/TipTapArea.d.ts +60 -0
  7. package/dist/patterns/RichText/commands/index.d.ts +5 -0
  8. package/dist/patterns/RichText/commands/registry.d.ts +14 -0
  9. package/dist/patterns/RichText/config/colors.d.ts +39 -0
  10. package/dist/patterns/RichText/config/defaults.d.ts +34 -0
  11. package/dist/patterns/RichText/config/icons.d.ts +26 -0
  12. package/dist/patterns/RichText/config/index.d.ts +7 -0
  13. package/dist/patterns/RichText/core/TipTapEditor.d.ts +7 -0
  14. package/dist/patterns/RichText/core/TipTapEditor.test.d.ts +1 -0
  15. package/dist/patterns/RichText/examples/ControlledExample.d.ts +1 -0
  16. package/dist/patterns/RichText/examples/FormWithValidationExample.d.ts +1 -0
  17. package/dist/patterns/RichText/extensions/index.d.ts +22 -0
  18. package/dist/patterns/RichText/extensions/registry.d.ts +19 -0
  19. package/dist/patterns/RichText/index.d.ts +11 -0
  20. package/dist/patterns/RichText/presets.d.ts +36 -0
  21. package/dist/patterns/RichText/toolbar/Toolbar.d.ts +34 -0
  22. package/dist/patterns/RichText/toolbar/ToolbarDivider.d.ts +15 -0
  23. package/dist/patterns/RichText/toolbar/ToolbarSection.d.ts +29 -0
  24. package/dist/patterns/RichText/toolbar/components/ColorPalette.d.ts +28 -0
  25. package/dist/patterns/RichText/toolbar/components/ColorPicker.d.ts +29 -0
  26. package/dist/patterns/RichText/toolbar/components/CustomColorInput.d.ts +28 -0
  27. package/dist/patterns/RichText/toolbar/components/HeadingDropdown.d.ts +21 -0
  28. package/dist/patterns/RichText/toolbar/components/ListDropdown.d.ts +20 -0
  29. package/dist/patterns/RichText/toolbar/components/ToolbarButton.d.ts +40 -0
  30. package/dist/patterns/RichText/toolbar/components/ZoomControls.d.ts +35 -0
  31. package/dist/patterns/RichText/toolbar/components/index.d.ts +17 -0
  32. package/dist/patterns/RichText/toolbar/hooks/index.d.ts +6 -0
  33. package/dist/patterns/RichText/toolbar/hooks/useToolbarCommands.d.ts +14 -0
  34. package/dist/patterns/RichText/toolbar/hooks/useToolbarState.d.ts +14 -0
  35. package/dist/patterns/RichText/toolbar/hooks/useZoomState.d.ts +21 -0
  36. package/dist/patterns/RichText/toolbar/index.d.ts +12 -0
  37. package/dist/patterns/RichText/toolbar/sections/TextFormattingSection.d.ts +7 -0
  38. package/dist/patterns/RichText/types/commands.d.ts +68 -0
  39. package/dist/patterns/RichText/types/extensions.d.ts +71 -0
  40. package/dist/patterns/RichText/types/index.d.ts +14 -0
  41. package/dist/patterns/RichText/types/marks.d.ts +86 -0
  42. package/dist/patterns/RichText/types/modifiers.d.ts +125 -0
  43. package/dist/patterns/RichText/types/nodes.d.ts +80 -0
  44. package/dist/patterns/RichText/types/props.d.ts +151 -0
  45. package/dist/patterns/RichText/types/toolbar.d.ts +88 -0
  46. package/dist/patterns/Stepper/Stepper.d.ts +2 -2
  47. package/dist/patterns/index.d.ts +2 -0
  48. package/package.json +15 -3
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Rich Text Editor - Zoom Controls Component
3
+ *
4
+ * Zoom in/out controls for editor content.
5
+ * Separated from editor state for clean architecture.
6
+ */
7
+ export interface ZoomControlsProps {
8
+ /**
9
+ * Current zoom level (percentage)
10
+ */
11
+ zoom: number;
12
+ /**
13
+ * Callback when zoom changes
14
+ */
15
+ onZoomChange: (zoom: number) => void;
16
+ /**
17
+ * Minimum zoom level
18
+ * @default 50
19
+ */
20
+ min?: number;
21
+ /**
22
+ * Maximum zoom level
23
+ * @default 200
24
+ */
25
+ max?: number;
26
+ /**
27
+ * Zoom step increment
28
+ * @default 10
29
+ */
30
+ step?: number;
31
+ }
32
+ /**
33
+ * Zoom in/out controls with percentage display
34
+ */
35
+ export declare function ZoomControls({ zoom, onZoomChange, min, max, step, }: ZoomControlsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Rich Text Editor - Toolbar Components Exports
3
+ */
4
+ export { ToolbarButton } from './ToolbarButton';
5
+ export type { ToolbarButtonProps } from './ToolbarButton';
6
+ export { HeadingDropdown } from './HeadingDropdown';
7
+ export type { HeadingDropdownProps } from './HeadingDropdown';
8
+ export { ListDropdown } from './ListDropdown';
9
+ export type { ListDropdownProps } from './ListDropdown';
10
+ export { ColorPalette } from './ColorPalette';
11
+ export type { ColorPaletteProps } from './ColorPalette';
12
+ export { CustomColorInput } from './CustomColorInput';
13
+ export type { CustomColorInputProps } from './CustomColorInput';
14
+ export { ColorPicker } from './ColorPicker';
15
+ export type { ColorPickerProps } from './ColorPicker';
16
+ export { ZoomControls } from './ZoomControls';
17
+ export type { ZoomControlsProps } from './ZoomControls';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Rich Text Editor - Toolbar Hooks Exports
3
+ */
4
+ export { useToolbarState, getModifierState } from './useToolbarState';
5
+ export { useToolbarCommands } from './useToolbarCommands';
6
+ export { useZoomState } from './useZoomState';
@@ -0,0 +1,14 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { ModifierType, ModifierConfig } from '../../types';
3
+ /**
4
+ * Hook to execute toolbar commands
5
+ *
6
+ * @param editor - TipTap editor instance
7
+ * @returns Command execution functions
8
+ */
9
+ export declare function useToolbarCommands(editor: Editor | null): {
10
+ executeCommand: (modifierType: ModifierType, config?: ModifierConfig) => void;
11
+ toggleModifier: (modifierType: ModifierType) => void;
12
+ canExecute: (modifierType: ModifierType, config?: ModifierConfig) => boolean;
13
+ isActive: (modifierType: ModifierType, config?: ModifierConfig) => boolean;
14
+ };
@@ -0,0 +1,14 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { ModifierIdentifier, ModifierType, ToolbarState } from '../../types';
3
+ /**
4
+ * Hook to manage toolbar state for all modifiers
5
+ *
6
+ * @param editor - TipTap editor instance
7
+ * @param modifiers - Array of active modifiers
8
+ * @returns Toolbar state object with button states
9
+ */
10
+ export declare function useToolbarState(editor: Editor | null, modifiers: ModifierIdentifier[]): Partial<ToolbarState>;
11
+ /**
12
+ * Get state for a specific modifier
13
+ */
14
+ export declare function getModifierState(toolbarState: Partial<ToolbarState>, modifierType: ModifierType): import('../../types').ToolbarButtonState;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Rich Text Editor - Zoom State Hook
3
+ *
4
+ * Manages zoom level state independently of editor content.
5
+ */
6
+ /**
7
+ * Hook to manage zoom state
8
+ *
9
+ * @param initialZoom - Initial zoom percentage
10
+ * @returns Zoom state and setters
11
+ */
12
+ export declare function useZoomState(initialZoom?: number): {
13
+ zoom: number;
14
+ setZoom: (newZoom: number) => void;
15
+ zoomIn: (step?: number) => void;
16
+ zoomOut: (step?: number) => void;
17
+ resetZoom: () => void;
18
+ isMinZoom: boolean;
19
+ isMaxZoom: boolean;
20
+ isDefaultZoom: boolean;
21
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Rich Text Editor - Toolbar Exports
3
+ */
4
+ export { Toolbar } from './Toolbar';
5
+ export type { ToolbarProps } from './Toolbar';
6
+ export { ToolbarDivider } from './ToolbarDivider';
7
+ export type { ToolbarDividerProps } from './ToolbarDivider';
8
+ export { ToolbarSection } from './ToolbarSection';
9
+ export type { ToolbarSectionProps } from './ToolbarSection';
10
+ export * from './components';
11
+ export * from './hooks';
12
+ export * from './sections/TextFormattingSection';
@@ -0,0 +1,7 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { ModifierIdentifier } from '../../types';
3
+ export interface TextFormattingSectionProps {
4
+ editor: Editor | null;
5
+ modifiers: ModifierIdentifier[];
6
+ }
7
+ export declare function TextFormattingSection({ editor, modifiers }: TextFormattingSectionProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,68 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { ModifierConfig, ModifierType } from './modifiers';
3
+ /**
4
+ * Command execution context
5
+ * Provides editor instance and optional configuration
6
+ */
7
+ export interface CommandContext {
8
+ editor: Editor;
9
+ config?: ModifierConfig;
10
+ }
11
+ /**
12
+ * Command function signature
13
+ * Takes a context and executes a command on the editor
14
+ */
15
+ export type CommandFunction = (context: CommandContext) => void;
16
+ /**
17
+ * Command check function signature
18
+ * Returns whether a command can be executed or is active
19
+ */
20
+ export type CommandCheckFunction = (editor: Editor, config?: ModifierConfig) => boolean;
21
+ /**
22
+ * Complete command definition
23
+ * Includes execution, availability check, and active state check
24
+ */
25
+ export interface CommandDefinition {
26
+ /**
27
+ * Execute the command
28
+ */
29
+ execute: CommandFunction;
30
+ /**
31
+ * Check if command can be executed
32
+ * Returns false if command is disabled
33
+ */
34
+ canExecute?: CommandCheckFunction;
35
+ /**
36
+ * Check if command is currently active
37
+ * Used for button highlighting in toolbar
38
+ */
39
+ isActive?: CommandCheckFunction;
40
+ /**
41
+ * Optional keyboard shortcut
42
+ */
43
+ shortcut?: string;
44
+ /**
45
+ * Optional command label
46
+ */
47
+ label?: string;
48
+ }
49
+ /**
50
+ * Command registry mapping modifier types to their command definitions
51
+ */
52
+ export type CommandRegistry = {
53
+ [K in ModifierType]?: CommandDefinition;
54
+ };
55
+ /**
56
+ * Command execution result
57
+ */
58
+ export interface CommandResult {
59
+ success: boolean;
60
+ error?: string;
61
+ }
62
+ /**
63
+ * Command state for a specific modifier
64
+ */
65
+ export interface CommandState {
66
+ canExecute: boolean;
67
+ isActive: boolean;
68
+ }
@@ -0,0 +1,71 @@
1
+ import { Extension, Mark, Node } from '@tiptap/core';
2
+ import { ModifierType } from './modifiers';
3
+ /**
4
+ * Extension category
5
+ * Determines how the extension integrates with the editor
6
+ */
7
+ export type ExtensionCategory = 'node' | 'mark' | 'extension';
8
+ /**
9
+ * Extension configuration
10
+ * Defines how a modifier maps to a TipTap extension
11
+ */
12
+ export interface ExtensionConfig<TOptions = any> {
13
+ /**
14
+ * Extension category
15
+ */
16
+ category: ExtensionCategory;
17
+ /**
18
+ * TipTap extension class or instance
19
+ */
20
+ extension: Node | Mark | Extension;
21
+ /**
22
+ * Default options for the extension
23
+ */
24
+ defaultOptions?: TOptions;
25
+ /**
26
+ * Required extensions that must be loaded alongside this one
27
+ * (e.g., 'textColor' requires 'textStyle')
28
+ */
29
+ requiredExtensions?: ModifierType[];
30
+ /**
31
+ * Optional dependencies (extensions that enhance this one but aren't required)
32
+ */
33
+ optionalExtensions?: ModifierType[];
34
+ /**
35
+ * Priority order for loading (higher loads first)
36
+ * @default 100
37
+ */
38
+ priority?: number;
39
+ }
40
+ /**
41
+ * Extension registry map
42
+ * Maps modifier types to their extension configurations
43
+ */
44
+ export type ExtensionRegistry = {
45
+ [K in ModifierType]?: ExtensionConfig;
46
+ };
47
+ /**
48
+ * Extension factory function
49
+ * Creates an array of TipTap extensions from modifier identifiers
50
+ */
51
+ export type ExtensionFactory = (modifiers: ModifierType[]) => Array<Node | Mark | Extension>;
52
+ /**
53
+ * Extension load result
54
+ */
55
+ export interface ExtensionLoadResult {
56
+ /**
57
+ * Successfully loaded extensions
58
+ */
59
+ loaded: ModifierType[];
60
+ /**
61
+ * Extensions that failed to load
62
+ */
63
+ failed: Array<{
64
+ modifier: ModifierType;
65
+ error: string;
66
+ }>;
67
+ /**
68
+ * Extensions that were automatically added as dependencies
69
+ */
70
+ dependencies: ModifierType[];
71
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Rich Text Editor - Type System Exports
3
+ *
4
+ * Centralized exports for all type definitions.
5
+ */
6
+ export type { BlockNodeType, InlineMarkType, UtilityModifierType, ModifierType, HeadingLevel, TextAlignment, HeadingModifier, TextAlignModifier, TextColorModifier, HighlightModifier, LinkModifier, SimpleModifier, ModifierConfig, ModifierIdentifier, } from './modifiers';
7
+ export { isHeadingModifier, isTextAlignModifier, isTextColorModifier, isHighlightModifier, isLinkModifier, getModifierType, isSameModifierType, } from './modifiers';
8
+ export type { ParagraphNode, HeadingNode, BulletListNode, OrderedListNode, TaskListNode, CodeBlockNode, BlockquoteNode, HorizontalRuleNode, BlockNode, BlockNodeMap, GetBlockNode, } from './nodes';
9
+ export type { BoldMark, ItalicMark, StrikeMark, UnderlineMark, CodeMark, TextColorMark, HighlightMark, LinkMark, InlineMark, InlineMarkMap, GetInlineMark, MarkAttributes, } from './marks';
10
+ export type { CommandContext, CommandFunction, CommandCheckFunction, CommandDefinition, CommandRegistry, CommandResult, CommandState, } from './commands';
11
+ export type { ToolbarSectionConfig, ToolbarConfig, ToolbarButtonState, ToolbarState, ToolbarPreset, ToolbarSectionId, } from './toolbar';
12
+ export { TOOLBAR_SECTION_IDS } from './toolbar';
13
+ export type { ExtensionCategory, ExtensionConfig, ExtensionRegistry, ExtensionFactory, ExtensionLoadResult, } from './extensions';
14
+ export type { EditorContentProps, EditorCounterProps, EditorContent, RichTextAreaProps, TipTapEditorProps, } from './props';
@@ -0,0 +1,86 @@
1
+ import { InlineMarkType } from './modifiers';
2
+ /**
3
+ * Bold mark configuration
4
+ */
5
+ export interface BoldMark {
6
+ type: 'bold';
7
+ }
8
+ /**
9
+ * Italic mark configuration
10
+ */
11
+ export interface ItalicMark {
12
+ type: 'italic';
13
+ }
14
+ /**
15
+ * Strike mark configuration
16
+ */
17
+ export interface StrikeMark {
18
+ type: 'strike';
19
+ }
20
+ /**
21
+ * Underline mark configuration
22
+ */
23
+ export interface UnderlineMark {
24
+ type: 'underline';
25
+ }
26
+ /**
27
+ * Inline code mark configuration
28
+ */
29
+ export interface CodeMark {
30
+ type: 'code';
31
+ }
32
+ /**
33
+ * Text color mark configuration
34
+ */
35
+ export interface TextColorMark {
36
+ type: 'textColor';
37
+ attrs: {
38
+ color: string;
39
+ };
40
+ }
41
+ /**
42
+ * Highlight/background color mark configuration
43
+ */
44
+ export interface HighlightMark {
45
+ type: 'highlight';
46
+ attrs: {
47
+ color: string;
48
+ };
49
+ }
50
+ /**
51
+ * Link mark configuration
52
+ */
53
+ export interface LinkMark {
54
+ type: 'link';
55
+ attrs: {
56
+ href: string;
57
+ target?: '_blank' | '_self';
58
+ rel?: string;
59
+ class?: string;
60
+ };
61
+ }
62
+ /**
63
+ * Union of all inline mark types
64
+ */
65
+ export type InlineMark = BoldMark | ItalicMark | StrikeMark | UnderlineMark | CodeMark | TextColorMark | HighlightMark | LinkMark;
66
+ /**
67
+ * Map of inline mark type to its configuration
68
+ */
69
+ export type InlineMarkMap = {
70
+ bold: BoldMark;
71
+ italic: ItalicMark;
72
+ strike: StrikeMark;
73
+ underline: UnderlineMark;
74
+ code: CodeMark;
75
+ textColor: TextColorMark;
76
+ highlight: HighlightMark;
77
+ link: LinkMark;
78
+ };
79
+ /**
80
+ * Extract mark configuration by type
81
+ */
82
+ export type GetInlineMark<T extends InlineMarkType> = InlineMarkMap[T];
83
+ /**
84
+ * Mark attributes by type
85
+ */
86
+ export type MarkAttributes<T extends InlineMarkType> = T extends 'textColor' ? TextColorMark['attrs'] : T extends 'highlight' ? HighlightMark['attrs'] : T extends 'link' ? LinkMark['attrs'] : never;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Rich Text Editor - Type-Safe Modifier System
3
+ *
4
+ * This file defines the core type system for the RichText editor,
5
+ * implementing strict separation between:
6
+ * - Block-level nodes (Nodos): Document structure elements
7
+ * - Inline-level marks (Marcas): Text formatting elements
8
+ * - Utility modifiers: Editor actions and behaviors
9
+ */
10
+ /**
11
+ * Block-level node types (Nodos)
12
+ * These define document structure and cannot be arbitrarily nested
13
+ */
14
+ export type BlockNodeType = 'paragraph' | 'heading' | 'bulletList' | 'orderedList' | 'taskList' | 'codeBlock' | 'blockquote' | 'horizontalRule';
15
+ /**
16
+ * Inline-level mark types (Marcas)
17
+ * These can be combined and applied to text content
18
+ */
19
+ export type InlineMarkType = 'bold' | 'italic' | 'strike' | 'underline' | 'code' | 'textColor' | 'highlight' | 'link';
20
+ /**
21
+ * Utility modifier types
22
+ * Actions that modify editor state or behavior
23
+ */
24
+ export type UtilityModifierType = 'clearMarks' | 'clearNodes' | 'undo' | 'redo' | 'hardBreak' | 'textAlign';
25
+ /**
26
+ * All possible modifier types
27
+ */
28
+ export type ModifierType = BlockNodeType | InlineMarkType | UtilityModifierType;
29
+ /**
30
+ * Heading levels (H1-H6)
31
+ */
32
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
33
+ /**
34
+ * Text alignment options
35
+ */
36
+ export type TextAlignment = 'left' | 'center' | 'right' | 'justify';
37
+ /**
38
+ * Heading modifier with level specification
39
+ */
40
+ export interface HeadingModifier {
41
+ type: 'heading';
42
+ level: HeadingLevel;
43
+ }
44
+ /**
45
+ * Text alignment modifier
46
+ */
47
+ export interface TextAlignModifier {
48
+ type: 'textAlign';
49
+ alignment: TextAlignment;
50
+ }
51
+ /**
52
+ * Text color modifier
53
+ */
54
+ export interface TextColorModifier {
55
+ type: 'textColor';
56
+ color: string;
57
+ }
58
+ /**
59
+ * Highlight/background color modifier
60
+ */
61
+ export interface HighlightModifier {
62
+ type: 'highlight';
63
+ color: string;
64
+ }
65
+ /**
66
+ * Link modifier with URL and optional attributes
67
+ */
68
+ export interface LinkModifier {
69
+ type: 'link';
70
+ href: string;
71
+ target?: '_blank' | '_self';
72
+ rel?: string;
73
+ }
74
+ /**
75
+ * Simple modifier (no additional configuration needed)
76
+ */
77
+ export interface SimpleModifier {
78
+ type: Exclude<ModifierType, 'heading' | 'textAlign' | 'textColor' | 'highlight' | 'link'>;
79
+ }
80
+ /**
81
+ * Discriminated union of all modifier configurations
82
+ * This ensures type safety when working with modifiers that need configuration
83
+ */
84
+ export type ModifierConfig = HeadingModifier | TextAlignModifier | TextColorModifier | HighlightModifier | LinkModifier | SimpleModifier;
85
+ /**
86
+ * Modifier identifier - allows both simple strings and complex configurations
87
+ * This is the main type used in the component API
88
+ *
89
+ * @example
90
+ * // Simple string modifier
91
+ * 'bold'
92
+ *
93
+ * @example
94
+ * // Complex modifier with configuration
95
+ * { type: 'heading', level: 2 }
96
+ */
97
+ export type ModifierIdentifier = ModifierType | ModifierConfig;
98
+ /**
99
+ * Type guard to check if a modifier is a heading
100
+ */
101
+ export declare function isHeadingModifier(modifier: ModifierIdentifier): modifier is HeadingModifier;
102
+ /**
103
+ * Type guard to check if a modifier is text alignment
104
+ */
105
+ export declare function isTextAlignModifier(modifier: ModifierIdentifier): modifier is TextAlignModifier;
106
+ /**
107
+ * Type guard to check if a modifier is text color
108
+ */
109
+ export declare function isTextColorModifier(modifier: ModifierIdentifier): modifier is TextColorModifier;
110
+ /**
111
+ * Type guard to check if a modifier is highlight
112
+ */
113
+ export declare function isHighlightModifier(modifier: ModifierIdentifier): modifier is HighlightModifier;
114
+ /**
115
+ * Type guard to check if a modifier is a link
116
+ */
117
+ export declare function isLinkModifier(modifier: ModifierIdentifier): modifier is LinkModifier;
118
+ /**
119
+ * Extract the modifier type from a ModifierIdentifier
120
+ */
121
+ export declare function getModifierType(modifier: ModifierIdentifier): ModifierType;
122
+ /**
123
+ * Check if two modifiers are the same type
124
+ */
125
+ export declare function isSameModifierType(a: ModifierIdentifier, b: ModifierIdentifier): boolean;
@@ -0,0 +1,80 @@
1
+ import { BlockNodeType } from './modifiers';
2
+ /**
3
+ * Paragraph node configuration
4
+ */
5
+ export interface ParagraphNode {
6
+ type: 'paragraph';
7
+ }
8
+ /**
9
+ * Heading node configuration
10
+ */
11
+ export interface HeadingNode {
12
+ type: 'heading';
13
+ attrs: {
14
+ level: 1 | 2 | 3 | 4 | 5 | 6;
15
+ textAlign?: 'left' | 'center' | 'right' | 'justify';
16
+ };
17
+ }
18
+ /**
19
+ * Bullet list node configuration
20
+ */
21
+ export interface BulletListNode {
22
+ type: 'bulletList';
23
+ }
24
+ /**
25
+ * Ordered list node configuration
26
+ */
27
+ export interface OrderedListNode {
28
+ type: 'orderedList';
29
+ attrs?: {
30
+ start?: number;
31
+ };
32
+ }
33
+ /**
34
+ * Task list node configuration
35
+ */
36
+ export interface TaskListNode {
37
+ type: 'taskList';
38
+ }
39
+ /**
40
+ * Code block node configuration
41
+ */
42
+ export interface CodeBlockNode {
43
+ type: 'codeBlock';
44
+ attrs?: {
45
+ language?: string;
46
+ };
47
+ }
48
+ /**
49
+ * Blockquote node configuration
50
+ */
51
+ export interface BlockquoteNode {
52
+ type: 'blockquote';
53
+ }
54
+ /**
55
+ * Horizontal rule node configuration
56
+ */
57
+ export interface HorizontalRuleNode {
58
+ type: 'horizontalRule';
59
+ }
60
+ /**
61
+ * Union of all block node types
62
+ */
63
+ export type BlockNode = ParagraphNode | HeadingNode | BulletListNode | OrderedListNode | TaskListNode | CodeBlockNode | BlockquoteNode | HorizontalRuleNode;
64
+ /**
65
+ * Map of block node type to its configuration
66
+ */
67
+ export type BlockNodeMap = {
68
+ paragraph: ParagraphNode;
69
+ heading: HeadingNode;
70
+ bulletList: BulletListNode;
71
+ orderedList: OrderedListNode;
72
+ taskList: TaskListNode;
73
+ codeBlock: CodeBlockNode;
74
+ blockquote: BlockquoteNode;
75
+ horizontalRule: HorizontalRuleNode;
76
+ };
77
+ /**
78
+ * Extract node configuration by type
79
+ */
80
+ export type GetBlockNode<T extends BlockNodeType> = BlockNodeMap[T];