@idealyst/markdown 1.2.38 → 1.2.40

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.
@@ -0,0 +1,202 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
2
+ import type { Size, Intent } from '@idealyst/theme';
3
+
4
+ /**
5
+ * Toolbar item types available in the editor
6
+ */
7
+ export type ToolbarItem =
8
+ | 'bold'
9
+ | 'italic'
10
+ | 'underline'
11
+ | 'strikethrough'
12
+ | 'code'
13
+ | 'heading' // Dropdown for H1-H6
14
+ | 'heading1'
15
+ | 'heading2'
16
+ | 'heading3'
17
+ | 'heading4'
18
+ | 'heading5'
19
+ | 'heading6'
20
+ | 'bulletList'
21
+ | 'orderedList'
22
+ | 'taskList'
23
+ | 'blockquote'
24
+ | 'codeBlock'
25
+ | 'horizontalRule'
26
+ | 'link'
27
+ | 'image'
28
+ | 'undo'
29
+ | 'redo';
30
+
31
+ /**
32
+ * Toolbar configuration
33
+ */
34
+ export interface ToolbarConfig {
35
+ /**
36
+ * Items to show in the toolbar
37
+ * @default ['bold', 'italic', 'underline', 'strikethrough', 'code', 'heading1', 'heading2', 'bulletList', 'orderedList', 'blockquote', 'codeBlock', 'link']
38
+ */
39
+ items?: ToolbarItem[];
40
+
41
+ /**
42
+ * Items to disable in the toolbar (they will still be visible but grayed out)
43
+ */
44
+ disabledItems?: ToolbarItem[];
45
+
46
+ /**
47
+ * Whether to show the toolbar
48
+ * @default true
49
+ */
50
+ visible?: boolean;
51
+
52
+ /**
53
+ * Toolbar position
54
+ * @default 'top'
55
+ */
56
+ position?: 'top' | 'bottom';
57
+ }
58
+
59
+ /**
60
+ * Editor ref methods available to parent components
61
+ */
62
+ export interface MarkdownEditorRef {
63
+ /**
64
+ * Get the current markdown content
65
+ */
66
+ getMarkdown: () => Promise<string>;
67
+
68
+ /**
69
+ * Set the markdown content
70
+ */
71
+ setMarkdown: (markdown: string) => void;
72
+
73
+ /**
74
+ * Focus the editor
75
+ */
76
+ focus: () => void;
77
+
78
+ /**
79
+ * Blur the editor
80
+ */
81
+ blur: () => void;
82
+
83
+ /**
84
+ * Check if editor has content
85
+ */
86
+ isEmpty: () => Promise<boolean>;
87
+
88
+ /**
89
+ * Clear all content
90
+ */
91
+ clear: () => void;
92
+
93
+ /**
94
+ * Undo last action
95
+ */
96
+ undo: () => void;
97
+
98
+ /**
99
+ * Redo last undone action
100
+ */
101
+ redo: () => void;
102
+ }
103
+
104
+ /**
105
+ * MarkdownEditor component props
106
+ */
107
+ export interface MarkdownEditorProps {
108
+ /**
109
+ * Initial markdown content
110
+ */
111
+ initialValue?: string;
112
+
113
+ /**
114
+ * Controlled value (makes the component controlled)
115
+ */
116
+ value?: string;
117
+
118
+ /**
119
+ * Called when content changes with the markdown string
120
+ */
121
+ onChange?: (markdown: string) => void;
122
+
123
+ /**
124
+ * Called when the editor gains focus
125
+ */
126
+ onFocus?: () => void;
127
+
128
+ /**
129
+ * Called when the editor loses focus
130
+ */
131
+ onBlur?: () => void;
132
+
133
+ /**
134
+ * Whether the editor is editable
135
+ * @default true
136
+ */
137
+ editable?: boolean;
138
+
139
+ /**
140
+ * Whether to autofocus on mount
141
+ * @default false
142
+ */
143
+ autoFocus?: boolean;
144
+
145
+ /**
146
+ * Placeholder text when editor is empty
147
+ */
148
+ placeholder?: string;
149
+
150
+ /**
151
+ * Toolbar configuration
152
+ */
153
+ toolbar?: ToolbarConfig;
154
+
155
+ /**
156
+ * Text size variant
157
+ * @default 'md'
158
+ */
159
+ size?: Size;
160
+
161
+ /**
162
+ * Link color intent
163
+ * @default 'primary'
164
+ */
165
+ linkIntent?: Intent;
166
+
167
+ /**
168
+ * Minimum height of the editor
169
+ */
170
+ minHeight?: number;
171
+
172
+ /**
173
+ * Maximum height of the editor (enables scrolling)
174
+ */
175
+ maxHeight?: number;
176
+
177
+ /**
178
+ * Container style
179
+ */
180
+ style?: StyleProp<ViewStyle>;
181
+
182
+ /**
183
+ * Test identifier
184
+ */
185
+ testID?: string;
186
+
187
+ /**
188
+ * Unique identifier
189
+ */
190
+ id?: string;
191
+
192
+ /**
193
+ * Accessibility label
194
+ */
195
+ accessibilityLabel?: string;
196
+
197
+ /**
198
+ * Native only: Avoid iOS keyboard by adding padding
199
+ * @default true
200
+ */
201
+ avoidIosKeyboard?: boolean;
202
+ }
@@ -0,0 +1 @@
1
+ export { MarkdownEditorExamples } from '../Editor/examples/MarkdownEditorExamples';