react-tiptap-base-editor 1.0.0 → 1.1.1

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.
package/README.md CHANGED
@@ -1,69 +1,385 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
-
14
- ```js
15
- export default defineConfig([
16
- globalIgnores(['dist']),
17
- {
18
- files: ['**/*.{ts,tsx}'],
19
- extends: [
20
- // Other configs...
21
-
22
- // Remove tseslint.configs.recommended and replace with this
23
- tseslint.configs.recommendedTypeChecked,
24
- // Alternatively, use this for stricter rules
25
- tseslint.configs.strictTypeChecked,
26
- // Optionally, add this for stylistic rules
27
- tseslint.configs.stylisticTypeChecked,
28
-
29
- // Other configs...
30
- ],
31
- languageOptions: {
32
- parserOptions: {
33
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
34
- tsconfigRootDir: import.meta.dirname,
35
- },
36
- // other options...
37
- },
38
- },
39
- ])
40
- ```
41
-
42
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
43
-
44
- ```js
45
- // eslint.config.js
46
- import reactX from 'eslint-plugin-react-x'
47
- import reactDom from 'eslint-plugin-react-dom'
48
-
49
- export default defineConfig([
50
- globalIgnores(['dist']),
51
- {
52
- files: ['**/*.{ts,tsx}'],
53
- extends: [
54
- // Other configs...
55
- // Enable lint rules for React
56
- reactX.configs['recommended-typescript'],
57
- // Enable lint rules for React DOM
58
- reactDom.configs.recommended,
59
- ],
60
- languageOptions: {
61
- parserOptions: {
62
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
63
- tsconfigRootDir: import.meta.dirname,
64
- },
65
- // other options...
66
- },
67
- },
68
- ])
1
+ # React Tiptap Base Editor
2
+
3
+ 一個基於 Tiptap 的現代化富文本編輯器 React 組件庫,提供完整的編輯功能和可自定義的 UI 組件。
4
+
5
+ ## 特色功能
6
+
7
+ ### 📝 豐富的編輯功能
8
+
9
+ - **文字格式化**: 粗體、斜體、底線、刪除線、行內程式碼
10
+ - **標題**: 支援 H1-H6 標題層級
11
+ - **清單**: 無序清單、有序清單、任務清單(支援巢狀結構)
12
+ - **文字對齊**: 左對齊、置中、右對齊、兩端對齊
13
+ - **引用區塊**: 美觀的引用樣式
14
+ - **程式碼區塊**: 語法高亮的程式碼區塊
15
+ - **上標/下標**: 數學公式和化學符號支援
16
+ - **文字高亮**: 多色彩高亮標記
17
+ - **連結管理**: 智能連結插入和編輯
18
+ - **圖片上傳**: 拖拽上傳,支援進度顯示
19
+ - **水平分隔線**: 內容區塊分隔
20
+ - **復原/重做**: 完整的編輯歷史管理
21
+
22
+ ### 📱 響應式設計
23
+
24
+ - **桌面優化**: 完整工具列和快捷鍵支援
25
+ - **行動裝置友善**: 適應性工具列和觸控操作
26
+ - **動態工具列**: 根據游標位置智能顯示
27
+
28
+ ### 🎨 可自定義 UI
29
+
30
+ - **模組化組件**: 每個功能都是獨立的 React 組件
31
+ - **主題支援**: 內建深色/淺色主題切換
32
+ - **SCSS 樣式**: 完全可自定義的樣式系統
33
+ - **無障礙設計**: 完整的 ARIA 標籤和鍵盤導航
34
+
35
+ ## 🚀 快速開始
36
+
37
+ ### 安裝
38
+
39
+ ```bash
40
+ npm install react-tiptap-base-editor
41
+ ```
42
+
43
+ ### 基本使用
44
+
45
+ ```tsx
46
+ import { TiptapEditor } from 'react-tiptap-base-editor'
47
+ import 'react-tiptap-base-editor/dist/styles/index.css'
48
+
49
+ function App() {
50
+ return (
51
+ <div className='App'>
52
+ <TiptapEditor />
53
+ </div>
54
+ )
55
+ }
56
+ ```
57
+
58
+ ### 進階自定義
59
+
60
+ ```tsx
61
+ import {
62
+ TiptapEditor,
63
+ MarkButton,
64
+ HeadingDropdownMenu,
65
+ ListDropdownMenu,
66
+ Toolbar,
67
+ ToolbarGroup
68
+ } from 'react-tiptap-base-editor'
69
+
70
+ function CustomEditor() {
71
+ return (
72
+ <div className='custom-editor'>
73
+ {/* 自定義工具列 */}
74
+ <Toolbar>
75
+ <ToolbarGroup>
76
+ <MarkButton type='bold' />
77
+ <MarkButton type='italic' />
78
+ <HeadingDropdownMenu levels={[1, 2, 3]} />
79
+ <ListDropdownMenu types={['bulletList', 'orderedList']} />
80
+ </ToolbarGroup>
81
+ </Toolbar>
82
+
83
+ {/* 編輯器內容區 */}
84
+ <TiptapEditor />
85
+ </div>
86
+ )
87
+ }
88
+ ```
89
+
90
+ ## 📦 組件 API
91
+
92
+ ### 主要組件
93
+
94
+ #### `TiptapEditor`
95
+
96
+ 主要的編輯器組件,包含完整的編輯功能和工具列。
97
+
98
+ ```tsx
99
+ <TiptapEditor />
100
+ ```
101
+
102
+ #### `MarkButton`
103
+
104
+ 文字格式化按鈕組件。
105
+
106
+ ```tsx
107
+ <MarkButton
108
+ type="bold" | "italic" | "strike" | "code" | "underline" | "superscript" | "subscript"
109
+ editor={editor}
110
+ hideWhenUnavailable={false}
111
+ onToggled={() => console.log('格式已切換')}
112
+ />
113
+ ```
114
+
115
+ #### `HeadingDropdownMenu`
116
+
117
+ 標題選擇下拉選單。
118
+
119
+ ```tsx
120
+ <HeadingDropdownMenu
121
+ levels={[1, 2, 3, 4, 5, 6]}
122
+ editor={editor}
123
+ portal={false}
124
+ />
125
+ ```
126
+
127
+ #### `ListDropdownMenu`
128
+
129
+ 清單類型選擇下拉選單。
130
+
131
+ ```tsx
132
+ <ListDropdownMenu
133
+ types={['bulletList', 'orderedList', 'taskList']}
134
+ editor={editor}
135
+ portal={false}
136
+ />
137
+ ```
138
+
139
+ #### `TextAlignButton`
140
+
141
+ 文字對齊按鈕。
142
+
143
+ ```tsx
144
+ <TextAlignButton
145
+ align="left" | "center" | "right" | "justify"
146
+ editor={editor}
147
+ />
148
+ ```
149
+
150
+ #### `ImageUploadButton`
151
+
152
+ 圖片上傳按鈕。
153
+
154
+ ```tsx
155
+ <ImageUploadButton text='上傳圖片' editor={editor} />
156
+ ```
157
+
158
+ ### UI 基礎組件
159
+
160
+ #### `Toolbar` / `ToolbarGroup` / `ToolbarSeparator`
161
+
162
+ 工具列佈局組件。
163
+
164
+ ```tsx
165
+ <Toolbar>
166
+ <ToolbarGroup>
167
+ <MarkButton type='bold' />
168
+ <MarkButton type='italic' />
169
+ </ToolbarGroup>
170
+ <ToolbarSeparator />
171
+ <ToolbarGroup>
172
+ <HeadingDropdownMenu />
173
+ </ToolbarGroup>
174
+ </Toolbar>
175
+ ```
176
+
177
+ #### `Button`
178
+
179
+ 基礎按鈕組件。
180
+
181
+ ```tsx
182
+ <Button
183
+ data-style="ghost" | "outline" | "solid"
184
+ data-active-state="on" | "off"
185
+ tooltip="提示文字"
186
+ >
187
+ 按鈕內容
188
+ </Button>
189
+ ```
190
+
191
+ ## 🎯 Hooks
192
+
193
+ ### `useTiptapEditor`
194
+
195
+ 獲取編輯器實例的 Hook。
196
+
197
+ ```tsx
198
+ import { useTiptapEditor } from 'react-tiptap-base-editor'
199
+
200
+ function CustomComponent() {
201
+ const { editor, editorState, canCommand } = useTiptapEditor()
202
+
203
+ return (
204
+ <button
205
+ onClick={() => editor?.chain().focus().toggleBold().run()}
206
+ disabled={!canCommand?.().toggleBold()}
207
+ >
208
+ 粗體
209
+ </button>
210
+ )
211
+ }
212
+ ```
213
+
214
+ ### `useIsMobile`
215
+
216
+ 檢測是否為行動裝置。
217
+
218
+ ```tsx
219
+ import { useIsMobile } from 'react-tiptap-base-editor'
220
+
221
+ function ResponsiveComponent() {
222
+ const isMobile = useIsMobile()
223
+
224
+ return (
225
+ <div className={isMobile ? 'mobile-layout' : 'desktop-layout'}>
226
+ {/* 響應式內容 */}
227
+ </div>
228
+ )
229
+ }
230
+ ```
231
+
232
+ ### `useWindowSize`
233
+
234
+ 獲取視窗尺寸。
235
+
236
+ ```tsx
237
+ import { useWindowSize } from 'react-tiptap-base-editor'
238
+
239
+ function SizeAwareComponent() {
240
+ const { width, height } = useWindowSize()
241
+
242
+ return (
243
+ <div>
244
+ 視窗尺寸: {width} x {height}
245
+ </div>
246
+ )
247
+ }
248
+ ```
249
+
250
+ ## 🛠 工具函數
251
+
252
+ ### `onUploadImage`
253
+
254
+ 圖片上傳處理函數。
255
+
256
+ ```tsx
257
+ import { onUploadImage, MAX_FILE_SIZE } from 'react-tiptap-base-editor'
258
+
259
+ // 自定義上傳邏輯
260
+ const customUpload = async (file: File) => {
261
+ if (file.size > MAX_FILE_SIZE) {
262
+ throw new Error('檔案過大')
263
+ }
264
+
265
+ // 實作你的上傳邏輯
266
+ const url = await uploadToServer(file)
267
+ return url
268
+ }
269
+ ```
270
+
271
+ ## 🎨 樣式自定義
272
+
273
+ ### CSS 變數
274
+
275
+ 編輯器使用 CSS 變數來管理主題,你可以覆寫這些變數來自定義外觀:
276
+
277
+ ```css
278
+ :root {
279
+ /* 主要顏色 */
280
+ --tiptap-color-primary: #3b82f6;
281
+ --tiptap-color-secondary: #64748b;
282
+
283
+ /* 背景顏色 */
284
+ --tiptap-color-background: #ffffff;
285
+ --tiptap-color-surface: #f8fafc;
286
+
287
+ /* 文字顏色 */
288
+ --tiptap-color-text: #1e293b;
289
+ --tiptap-color-text-muted: #64748b;
290
+
291
+ /* 邊框 */
292
+ --tiptap-border-radius: 6px;
293
+ --tiptap-border-width: 1px;
294
+ --tiptap-border-color: #e2e8f0;
295
+ }
296
+ ```
297
+
298
+ ### SCSS 匯入
299
+
300
+ 如果你使用 SCSS,可以匯入變數檔案進行更深度的自定義:
301
+
302
+ ```scss
303
+ @import 'react-tiptap-base-editor/src/styles/variables';
304
+
305
+ // 覆寫變數
306
+ $primary-color: #your-color;
307
+
308
+ @import 'react-tiptap-base-editor/dist/styles/index.css';
309
+ ```
310
+
311
+ ## 📱 響應式支援
312
+
313
+ 編輯器會自動檢測裝置類型並調整 UI:
314
+
315
+ - **桌面**: 顯示完整工具列,支援滑鼠懸停效果
316
+ - **平板**: 適中的按鈕尺寸,觸控友善
317
+ - **手機**: 簡化工具列,大按鈕設計,分層選單
318
+
319
+ ## ⌨️ 快捷鍵
320
+
321
+ | 功能 | Windows/Linux | macOS |
322
+ | -------- | ------------- | ----- |
323
+ | 粗體 | Ctrl+B | ⌘B |
324
+ | 斜體 | Ctrl+I | ⌘I |
325
+ | 底線 | Ctrl+U | ⌘U |
326
+ | 刪除線 | Ctrl+Shift+S | ⌘⇧S |
327
+ | 程式碼 | Ctrl+E | ⌘E |
328
+ | 復原 | Ctrl+Z | ⌘Z |
329
+ | 重做 | Ctrl+Y | ⌘Y |
330
+ | 標題 1 | Ctrl+Alt+1 | ⌘⌥1 |
331
+ | 標題 2 | Ctrl+Alt+2 | ⌘⌥2 |
332
+ | 無序清單 | Ctrl+Shift+8 | ⌘⇧8 |
333
+ | 有序清單 | Ctrl+Shift+7 | ⌘⇧7 |
334
+
335
+ ## 🔧 開發
336
+
337
+ ### 本地開發
338
+
339
+ ```bash
340
+ # 安裝依賴
341
+ npm install
342
+
343
+ # 啟動開發伺服器
344
+ npm run dev
345
+
346
+ # 建置組件庫
347
+ npm run build
348
+
349
+ # 代碼檢查
350
+ npm run lint
351
+ ```
352
+
353
+ ### 專案結構
354
+
355
+ ```
356
+ src/
357
+ ├── components/
358
+ │ ├── tiptap-icons/ # 圖示組件
359
+ │ ├── tiptap-node/ # 節點樣式
360
+ │ ├── tiptap-templates/ # 編輯器模板
361
+ │ ├── tiptap-ui/ # UI 功能組件
362
+ │ └── tiptap-ui-primitive/ # 基礎 UI 組件
363
+ ├── hooks/ # React Hooks
364
+ ├── lib/ # 工具函數
365
+ └── styles/ # 樣式檔案
69
366
  ```
367
+
368
+ ## 📄 授權
369
+
370
+ MIT License
371
+
372
+ ## 🤝 貢獻
373
+
374
+ 歡迎提交 Issue 和 Pull Request!
375
+
376
+ ## 📞 支援
377
+
378
+ 如有問題或建議,請透過以下方式聯繫:
379
+
380
+ - GitHub Issues: [提交問題](https://github.com/your-repo/issues)
381
+ - 文件: [查看完整文件](https://your-docs-site.com)
382
+
383
+ ---
384
+
385
+ **React Tiptap Base Editor** - 讓富文本編輯變得簡單而強大 ✨
@@ -0,0 +1,4 @@
1
+ export { ResizableImage } from './resizable-image-extension';
2
+ export { ResizableImageComponent } from './resizable-image-component';
3
+ export type { ResizableImageOptions } from './resizable-image-extension';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-node/resizable-image-node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACrE,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { NodeViewProps } from '@tiptap/react';
3
+ export declare const ResizableImageComponent: React.FC<NodeViewProps>;
4
+ //# sourceMappingURL=resizable-image-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable-image-component.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-node/resizable-image-node/resizable-image-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkN3D,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { Node } from '@tiptap/core';
2
+ export interface ResizableImageOptions {
3
+ inline: boolean;
4
+ allowBase64: boolean;
5
+ HTMLAttributes: Record<string, any>;
6
+ }
7
+ declare module '@tiptap/core' {
8
+ interface Commands<ReturnType> {
9
+ resizableImage: {
10
+ /**
11
+ * Add a resizable image
12
+ */
13
+ setResizableImage: (options: {
14
+ src: string;
15
+ alt?: string;
16
+ title?: string;
17
+ width?: number;
18
+ }) => ReturnType;
19
+ /**
20
+ * Update image size
21
+ */
22
+ setImageSize: (options: {
23
+ width?: number;
24
+ }) => ReturnType;
25
+ };
26
+ }
27
+ }
28
+ export declare const ResizableImage: Node<ResizableImageOptions, any>;
29
+ //# sourceMappingURL=resizable-image-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable-image-extension.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-node/resizable-image-node/resizable-image-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAA;AAIpD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACpC;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,cAAc,EAAE;YACd;;eAEG;YACH,iBAAiB,EAAE,CAAC,OAAO,EAAE;gBAC3B,GAAG,EAAE,MAAM,CAAA;gBACX,GAAG,CAAC,EAAE,MAAM,CAAA;gBACZ,KAAK,CAAC,EAAE,MAAM,CAAA;gBACd,KAAK,CAAC,EAAE,MAAM,CAAA;aACf,KAAK,UAAU,CAAA;YAChB;;eAEG;YACH,YAAY,EAAE,CAAC,OAAO,EAAE;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,KAAK,UAAU,CAAA;SAC1D,CAAA;KACF;CACF;AAED,eAAO,MAAM,cAAc,kCA8GzB,CAAA"}
@@ -3,8 +3,17 @@ import '@/components/tiptap-node/code-block-node/code-block-node.scss';
3
3
  import '@/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.scss';
4
4
  import '@/components/tiptap-node/list-node/list-node.scss';
5
5
  import '@/components/tiptap-node/image-node/image-node.scss';
6
+ import '@/components/tiptap-node/resizable-image-node/resizable-image-node.scss';
6
7
  import '@/components/tiptap-node/heading-node/heading-node.scss';
7
8
  import '@/components/tiptap-node/paragraph-node/paragraph-node.scss';
8
9
  import '@/components/tiptap-templates/simple/simple-editor.scss';
9
- export declare function TiptapEditor(): import("react/jsx-runtime").JSX.Element;
10
+ export type TiptapEditorProps = {
11
+ id: string;
12
+ value: string;
13
+ onChange: (value: string) => void;
14
+ onUploadImage?: (file: File, onProgress?: (event: {
15
+ progress: number;
16
+ }) => void, abortSignal?: AbortSignal) => Promise<string>;
17
+ };
18
+ export declare function TiptapEditor(props: TiptapEditorProps): import("react/jsx-runtime").JSX.Element;
10
19
  //# sourceMappingURL=simple-editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simple-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-templates/simple/simple-editor.tsx"],"names":[],"mappings":"AA4BA,OAAO,+DAA+D,CAAA;AACtE,OAAO,+DAA+D,CAAA;AACtE,OAAO,yEAAyE,CAAA;AAChF,OAAO,mDAAmD,CAAA;AAC1D,OAAO,qDAAqD,CAAA;AAC5D,OAAO,yDAAyD,CAAA;AAChE,OAAO,6DAA6D,CAAA;AAuCpE,OAAO,yDAAyD,CAAA;AAgHhE,wBAAgB,YAAY,4CA+F3B"}
1
+ {"version":3,"file":"simple-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-templates/simple/simple-editor.tsx"],"names":[],"mappings":"AA+BA,OAAO,+DAA+D,CAAA;AACtE,OAAO,+DAA+D,CAAA;AACtE,OAAO,yEAAyE,CAAA;AAChF,OAAO,mDAAmD,CAAA;AAC1D,OAAO,qDAAqD,CAAA;AAC5D,OAAO,yEAAyE,CAAA;AAChF,OAAO,yDAAyD,CAAA;AAChE,OAAO,6DAA6D,CAAA;AAoCpE,OAAO,yDAAyD,CAAA;AA6GhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,aAAa,CAAC,EAAE,CACd,IAAI,EAAE,IAAI,EACV,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,EAClD,WAAW,CAAC,EAAE,WAAW,KACtB,OAAO,CAAC,MAAM,CAAC,CAAA;CACrB,CAAA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAwHpD"}
@@ -72,7 +72,7 @@ export declare function shouldShowButton(props: {
72
72
  */
73
73
  export declare function useBlockquote(config?: UseBlockquoteConfig): {
74
74
  isVisible: boolean;
75
- isActive: boolean;
75
+ isActive: any;
76
76
  handleToggle: () => boolean;
77
77
  canToggle: boolean;
78
78
  label: string;
@@ -79,7 +79,7 @@ export declare function shouldShowButton(props: {
79
79
  */
80
80
  export declare function useCodeBlock(config?: UseCodeBlockConfig): {
81
81
  isVisible: boolean;
82
- isActive: boolean;
82
+ isActive: any;
83
83
  handleToggle: () => boolean;
84
84
  canToggle: boolean;
85
85
  label: string;
@@ -1,4 +1,8 @@
1
- import type { Editor } from "@tiptap/react";
1
+ export interface TiptapEditorInstance {
2
+ editor: any | null;
3
+ editorState?: any;
4
+ canCommand?: any;
5
+ }
2
6
  /**
3
7
  * Hook that provides access to a Tiptap editor instance.
4
8
  *
@@ -10,9 +14,5 @@ import type { Editor } from "@tiptap/react";
10
14
  * @param providedEditor - Optional editor instance to use instead of the context editor
11
15
  * @returns The provided editor or the editor from context, whichever is available
12
16
  */
13
- export declare function useTiptapEditor(providedEditor?: Editor | null): {
14
- editor: Editor | null;
15
- editorState?: Editor["state"];
16
- canCommand?: Editor["can"];
17
- };
17
+ export declare function useTiptapEditor(providedEditor?: any | null): TiptapEditorInstance;
18
18
  //# sourceMappingURL=use-tiptap-editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-tiptap-editor.d.ts","sourceRoot":"","sources":["../../src/hooks/use-tiptap-editor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG;IAC/D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAC3B,CA2BA"}
1
+ {"version":3,"file":"use-tiptap-editor.d.ts","sourceRoot":"","sources":["../../src/hooks/use-tiptap-editor.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,GAAG,GAAG,IAAI,CAAA;IAClB,WAAW,CAAC,EAAE,GAAG,CAAA;IACjB,UAAU,CAAC,EAAE,GAAG,CAAA;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,cAAc,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,oBAAoB,CA2BjF"}