neweditor 1.0.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.
- package/README.md +301 -0
- package/dist/components/BubbleItem.vue.d.ts +32 -0
- package/dist/components/Editor.vue.d.ts +53 -0
- package/dist/components/EditorBubbleMenu.vue.d.ts +14 -0
- package/dist/components/EditorHeader.vue.d.ts +13 -0
- package/dist/components/block/BlockActionButton.vue.d.ts +24 -0
- package/dist/components/block/BlockActionInput.vue.d.ts +13 -0
- package/dist/components/block/BlockActionSeparator.vue.d.ts +2 -0
- package/dist/components/block/BlockCard.vue.d.ts +27 -0
- package/dist/components/block/index.d.ts +4 -0
- package/dist/components/common/ColorPickerDropdown.vue.d.ts +27 -0
- package/dist/components/icon/MdiDeleteForeverOutline.vue.d.ts +2 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/toolbar/ToolbarItem.vue.d.ts +19 -0
- package/dist/components/toolbar/ToolbarSubItem.vue.d.ts +16 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbox/ToolboxItem.vue.d.ts +17 -0
- package/dist/components/toolbox/index.d.ts +1 -0
- package/dist/dev/App.vue.d.ts +2 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/extensions/audio/AudioView.vue.d.ts +5 -0
- package/dist/extensions/audio/BubbleItemAudioLink.vue.d.ts +18 -0
- package/dist/extensions/audio/index.d.ts +14 -0
- package/dist/extensions/blockquote/index.d.ts +4 -0
- package/dist/extensions/bold/index.d.ts +3 -0
- package/dist/extensions/bullet-list/index.d.ts +3 -0
- package/dist/extensions/clear-format/index.d.ts +4 -0
- package/dist/extensions/code/index.d.ts +4 -0
- package/dist/extensions/code-block/CodeBlockSelect.vue.d.ts +24 -0
- package/dist/extensions/code-block/CodeBlockViewRenderer.vue.d.ts +3 -0
- package/dist/extensions/code-block/code-block.d.ts +68 -0
- package/dist/extensions/code-block/index.d.ts +2 -0
- package/dist/extensions/code-block/lowlight-plugin.d.ts +2 -0
- package/dist/extensions/color/ColorBubbleItem.vue.d.ts +18 -0
- package/dist/extensions/color/ColorToolbarItem.vue.d.ts +19 -0
- package/dist/extensions/color/index.d.ts +4 -0
- package/dist/extensions/columns/column.d.ts +3 -0
- package/dist/extensions/columns/columns.d.ts +23 -0
- package/dist/extensions/columns/index.d.ts +2 -0
- package/dist/extensions/commands-menu/CommandsView.vue.d.ts +27 -0
- package/dist/extensions/commands-menu/commands.d.ts +3 -0
- package/dist/extensions/commands-menu/index.d.ts +1 -0
- package/dist/extensions/details/index.d.ts +6 -0
- package/dist/extensions/draggable/index.d.ts +13 -0
- package/dist/extensions/font-size/index.d.ts +5 -0
- package/dist/extensions/format-brush/index.d.ts +15 -0
- package/dist/extensions/format-brush/util.d.ts +27 -0
- package/dist/extensions/fullscreen/index.d.ts +6 -0
- package/dist/extensions/gap-cursor/gap-cursor-selection.d.ts +44 -0
- package/dist/extensions/gap-cursor/index.d.ts +41 -0
- package/dist/extensions/heading/index.d.ts +4 -0
- package/dist/extensions/highlight/HighlightBubbleItem.vue.d.ts +18 -0
- package/dist/extensions/highlight/HighlightToolbarItem.vue.d.ts +19 -0
- package/dist/extensions/highlight/index.d.ts +4 -0
- package/dist/extensions/history/index.d.ts +3 -0
- package/dist/extensions/iframe/BubbleItemIframeLink.vue.d.ts +18 -0
- package/dist/extensions/iframe/BubbleItemIframeSize.vue.d.ts +6 -0
- package/dist/extensions/iframe/IframeView.vue.d.ts +5 -0
- package/dist/extensions/iframe/index.d.ts +14 -0
- package/dist/extensions/image/BubbleItemImageAlt.vue.d.ts +18 -0
- package/dist/extensions/image/BubbleItemImageHref.vue.d.ts +18 -0
- package/dist/extensions/image/BubbleItemImageLink.vue.d.ts +18 -0
- package/dist/extensions/image/BubbleItemImageSize.vue.d.ts +18 -0
- package/dist/extensions/image/ImageView.vue.d.ts +6 -0
- package/dist/extensions/image/index.d.ts +6 -0
- package/dist/extensions/indent/index.d.ts +24 -0
- package/dist/extensions/index.d.ts +55 -0
- package/dist/extensions/italic/index.d.ts +3 -0
- package/dist/extensions/link/LinkBubbleButton.vue.d.ts +18 -0
- package/dist/extensions/link/index.d.ts +4 -0
- package/dist/extensions/list-keymap/index.d.ts +7 -0
- package/dist/extensions/node-selected/index.d.ts +6 -0
- package/dist/extensions/ordered-list/index.d.ts +3 -0
- package/dist/extensions/paragraph/index.d.ts +6 -0
- package/dist/extensions/range-selection/index.d.ts +22 -0
- package/dist/extensions/range-selection/range-selection.d.ts +64 -0
- package/dist/extensions/search-and-replace/SearchAndReplace.vue.d.ts +36 -0
- package/dist/extensions/search-and-replace/SearchAndReplacePlugin.d.ts +109 -0
- package/dist/extensions/search-and-replace/index.d.ts +34 -0
- package/dist/extensions/sidebar-toggle/index.d.ts +25 -0
- package/dist/extensions/strike/index.d.ts +3 -0
- package/dist/extensions/subscript/index.d.ts +3 -0
- package/dist/extensions/superscript/index.d.ts +3 -0
- package/dist/extensions/table/index.d.ts +6 -0
- package/dist/extensions/table/table-cell.d.ts +6 -0
- package/dist/extensions/table/table-header.d.ts +6 -0
- package/dist/extensions/table/table-row.d.ts +2 -0
- package/dist/extensions/table/util.d.ts +44 -0
- package/dist/extensions/task-list/index.d.ts +3 -0
- package/dist/extensions/text/index.d.ts +5 -0
- package/dist/extensions/text-align/index.d.ts +4 -0
- package/dist/extensions/text-style/index.d.ts +2 -0
- package/dist/extensions/trailing-node/index.d.ts +9 -0
- package/dist/extensions/underline/index.d.ts +3 -0
- package/dist/extensions/video/BubbleItemVideoLink.vue.d.ts +18 -0
- package/dist/extensions/video/BubbleItemVideoSize.vue.d.ts +18 -0
- package/dist/extensions/video/VideoView.vue.d.ts +5 -0
- package/dist/extensions/video/index.d.ts +14 -0
- package/dist/index.d.ts +9 -0
- package/dist/locales/index.d.ts +7 -0
- package/dist/rich-text-editor.es.js +56411 -0
- package/dist/style.css +10 -0
- package/dist/tiptap/core/index.d.ts +1 -0
- package/dist/tiptap/index.d.ts +6 -0
- package/dist/tiptap/pm/index.d.ts +19 -0
- package/dist/tiptap/vue-3/index.d.ts +1 -0
- package/dist/types/index.d.ts +139 -0
- package/dist/utils/anchor.d.ts +2 -0
- package/dist/utils/delete-node.d.ts +4 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/is-allowed-uri.d.ts +1 -0
- package/dist/utils/is-list-active.d.ts +12 -0
- package/dist/utils/is-node-empty.d.ts +4 -0
- package/package.json +115 -0
package/README.md
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# TestFox RichText Editor
|
|
2
|
+
|
|
3
|
+
基于 TipTap 的富文本编辑器,专为 TestFox 项目设计,支持完整的主题系统和亮色/暗色模式切换。
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- ✅ 完整的富文本编辑功能
|
|
8
|
+
- ✅ 支持 40+ 种编程语言语法高亮
|
|
9
|
+
- ✅ Slash Command(斜杠命令)快捷操作
|
|
10
|
+
- ✅ 图片粘贴功能(Ctrl+V)
|
|
11
|
+
- ✅ 拖拽排序功能
|
|
12
|
+
- ✅ 表格编辑(合并单元格、调整列宽等)
|
|
13
|
+
- ✅ 多语言支持(中文/英文)
|
|
14
|
+
- ✅ 主题系统(亮色/暗色模式)
|
|
15
|
+
- ✅ 响应式设计
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install testfox-richtext-editor
|
|
21
|
+
# 或
|
|
22
|
+
pnpm install testfox-richtext-editor
|
|
23
|
+
# 或
|
|
24
|
+
yarn add testfox-richtext-editor
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 使用
|
|
28
|
+
|
|
29
|
+
### 基础使用
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<template>
|
|
33
|
+
<RichTextEditor :editor="editor" locale="zh-CN" />
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup>
|
|
37
|
+
import { useEditor, RichTextEditor, allExtensions } from 'testfox-richtext-editor'
|
|
38
|
+
import 'testfox-richtext-editor/dist/style.css'
|
|
39
|
+
|
|
40
|
+
const editor = useEditor({
|
|
41
|
+
extensions: allExtensions,
|
|
42
|
+
content: '<p>Hello World!</p>',
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 完整示例
|
|
48
|
+
|
|
49
|
+
```vue
|
|
50
|
+
<template>
|
|
51
|
+
<div class="editor-wrapper">
|
|
52
|
+
<RichTextEditor
|
|
53
|
+
:editor="editor"
|
|
54
|
+
locale="zh-CN"
|
|
55
|
+
class="my-editor"
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup>
|
|
61
|
+
import { ref } from 'vue'
|
|
62
|
+
import { useEditor, RichTextEditor, allExtensions } from 'testfox-richtext-editor'
|
|
63
|
+
import 'testfox-richtext-editor/dist/style.css'
|
|
64
|
+
|
|
65
|
+
const content = ref('<p>初始内容</p>')
|
|
66
|
+
|
|
67
|
+
const editor = useEditor({
|
|
68
|
+
extensions: allExtensions,
|
|
69
|
+
content: content.value,
|
|
70
|
+
editable: true,
|
|
71
|
+
autofocus: false,
|
|
72
|
+
editorProps: {
|
|
73
|
+
attributes: {
|
|
74
|
+
'data-placeholder': '请输入内容...',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
onUpdate: ({ editor }) => {
|
|
78
|
+
content.value = editor.getHTML()
|
|
79
|
+
},
|
|
80
|
+
onFocus: ({ editor }) => {
|
|
81
|
+
console.log('编辑器获得焦点')
|
|
82
|
+
},
|
|
83
|
+
onBlur: ({ editor }) => {
|
|
84
|
+
console.log('编辑器失去焦点')
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style>
|
|
90
|
+
.editor-wrapper {
|
|
91
|
+
border: 1px solid #d9d9d9;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## API
|
|
98
|
+
|
|
99
|
+
### useEditor(options)
|
|
100
|
+
|
|
101
|
+
创建编辑器实例的 Hook。
|
|
102
|
+
|
|
103
|
+
**参数:**
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
interface EditorOptions {
|
|
107
|
+
extensions: Extension[] // 扩展列表
|
|
108
|
+
content?: string // 初始内容(HTML)
|
|
109
|
+
editable?: boolean // 是否可编辑
|
|
110
|
+
autofocus?: boolean // 是否自动聚焦
|
|
111
|
+
editorProps?: EditorProps // 编辑器属性
|
|
112
|
+
onUpdate?: (props) => void // 内容更新回调
|
|
113
|
+
onFocus?: (props) => void // 获得焦点回调
|
|
114
|
+
onBlur?: (props) => void // 失去焦点回调
|
|
115
|
+
onCreate?: (props) => void // 创建完成回调
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**返回值:**
|
|
120
|
+
|
|
121
|
+
返回一个响应式的编辑器实例。
|
|
122
|
+
|
|
123
|
+
### RichTextEditor 组件
|
|
124
|
+
|
|
125
|
+
编辑器 UI 组件。
|
|
126
|
+
|
|
127
|
+
**Props:**
|
|
128
|
+
|
|
129
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
130
|
+
|------|------|--------|------|
|
|
131
|
+
| `editor` | Editor | - | 编辑器实例(必需) |
|
|
132
|
+
| `locale` | String | `'zh-CN'` | 语言设置(zh-CN/en) |
|
|
133
|
+
|
|
134
|
+
### allExtensions
|
|
135
|
+
|
|
136
|
+
包含所有内置扩展的数组,包括:
|
|
137
|
+
|
|
138
|
+
- 文本格式化(粗体、斜体、下划线、删除线等)
|
|
139
|
+
- 标题(H1-H6)
|
|
140
|
+
- 列表(有序、无序、任务列表)
|
|
141
|
+
- 代码(行内代码、代码块)
|
|
142
|
+
- 表格
|
|
143
|
+
- 图片、视频、音频
|
|
144
|
+
- 链接
|
|
145
|
+
- 引用块
|
|
146
|
+
- 分栏布局
|
|
147
|
+
- 折叠面板
|
|
148
|
+
- Slash Command
|
|
149
|
+
- 拖拽排序
|
|
150
|
+
- 搜索和替换
|
|
151
|
+
- 等等...
|
|
152
|
+
|
|
153
|
+
## 编辑器功能
|
|
154
|
+
|
|
155
|
+
### 文本格式化
|
|
156
|
+
- 粗体、斜体、下划线、删除线、上标、下标
|
|
157
|
+
- 标题(H1-H6)
|
|
158
|
+
- 文本颜色和背景色
|
|
159
|
+
- 字体大小
|
|
160
|
+
- 文本对齐
|
|
161
|
+
- 清除格式
|
|
162
|
+
- 格式刷
|
|
163
|
+
|
|
164
|
+
### 列表和引用
|
|
165
|
+
- 无序列表
|
|
166
|
+
- 有序列表
|
|
167
|
+
- 任务列表
|
|
168
|
+
- 引用块
|
|
169
|
+
- 缩进
|
|
170
|
+
|
|
171
|
+
### 代码
|
|
172
|
+
- 行内代码
|
|
173
|
+
- 代码块(支持 40+ 种语言语法高亮)
|
|
174
|
+
|
|
175
|
+
### 媒体内容
|
|
176
|
+
- 图片(支持粘贴、拖拽调整大小)
|
|
177
|
+
- 视频
|
|
178
|
+
- 音频
|
|
179
|
+
- iframe
|
|
180
|
+
|
|
181
|
+
### 表格
|
|
182
|
+
- 创建表格
|
|
183
|
+
- 添加/删除行和列
|
|
184
|
+
- 合并/拆分单元格
|
|
185
|
+
- 调整列宽
|
|
186
|
+
- 表格拖拽排序
|
|
187
|
+
|
|
188
|
+
### 快捷功能
|
|
189
|
+
- Slash Command(输入 `/` 或 `、` 触发)
|
|
190
|
+
- 拖拽排序
|
|
191
|
+
- 搜索和替换
|
|
192
|
+
- 撤销/重做
|
|
193
|
+
- 字符统计
|
|
194
|
+
|
|
195
|
+
## 快捷键
|
|
196
|
+
|
|
197
|
+
| 快捷键 | 功能 |
|
|
198
|
+
|--------|------|
|
|
199
|
+
| `Ctrl/Cmd + B` | 粗体 |
|
|
200
|
+
| `Ctrl/Cmd + I` | 斜体 |
|
|
201
|
+
| `Ctrl/Cmd + U` | 下划线 |
|
|
202
|
+
| `Ctrl/Cmd + Shift + X` | 删除线 |
|
|
203
|
+
| `Ctrl/Cmd + E` | 行内代码 |
|
|
204
|
+
| `Ctrl/Cmd + Z` | 撤销 |
|
|
205
|
+
| `Ctrl/Cmd + Shift + Z` | 重做 |
|
|
206
|
+
| `Ctrl/Cmd + K` | 插入链接 |
|
|
207
|
+
| `Ctrl/Cmd + V` | 粘贴图片 |
|
|
208
|
+
| `/` 或 `、` | Slash Command |
|
|
209
|
+
| `Tab` | 增加缩进 |
|
|
210
|
+
| `Shift + Tab` | 减少缩进 |
|
|
211
|
+
|
|
212
|
+
## 主题系统
|
|
213
|
+
|
|
214
|
+
编辑器支持亮色和暗色两种主题模式,通过 CSS 变量控制。
|
|
215
|
+
|
|
216
|
+
### 主题变量
|
|
217
|
+
|
|
218
|
+
```css
|
|
219
|
+
/* 亮色主题 */
|
|
220
|
+
.theme-light .testfox-rich-text-editor {
|
|
221
|
+
--editor-primary-color: #9373ee;
|
|
222
|
+
--editor-text-color: rgba(0, 0, 0, 0.85);
|
|
223
|
+
--editor-background-color: #ffffff;
|
|
224
|
+
--editor-border-color: #f0f0f0;
|
|
225
|
+
/* ... 更多变量 */
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* 暗色主题 */
|
|
229
|
+
.theme-dark .testfox-rich-text-editor {
|
|
230
|
+
--editor-primary-color: #9373ee;
|
|
231
|
+
--editor-text-color: rgba(255, 255, 255, 0.85);
|
|
232
|
+
--editor-background-color: #1f1f1f;
|
|
233
|
+
--editor-border-color: #303030;
|
|
234
|
+
/* ... 更多变量 */
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 自定义主题
|
|
239
|
+
|
|
240
|
+
可以通过覆盖 CSS 变量来自定义主题:
|
|
241
|
+
|
|
242
|
+
```css
|
|
243
|
+
.my-editor {
|
|
244
|
+
--editor-primary-color: #your-color;
|
|
245
|
+
--editor-background-color: #your-bg;
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## 开发
|
|
250
|
+
|
|
251
|
+
### 安装依赖
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
npm install
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### 开发模式
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
npm run dev
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 构建
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
npm run build
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 类型检查
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
npm run typecheck
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## 扩展开发
|
|
276
|
+
|
|
277
|
+
如需为编辑器添加新功能,可以创建自定义扩展。详细的扩展开发指南请参考:
|
|
278
|
+
|
|
279
|
+
- [扩展开发文档](./docs/extension.md)
|
|
280
|
+
- [Slash Command 指南](./docs/slash-command-guide.md)
|
|
281
|
+
- [Slash Command 示例](./docs/slash-command-examples.md)
|
|
282
|
+
|
|
283
|
+
## 浏览器兼容性
|
|
284
|
+
|
|
285
|
+
- Chrome/Edge: ✅ 完全支持
|
|
286
|
+
- Firefox: ✅ 完全支持
|
|
287
|
+
- Safari: ✅ 完全支持
|
|
288
|
+
- IE: ❌ 不支持
|
|
289
|
+
|
|
290
|
+
## 相关链接
|
|
291
|
+
|
|
292
|
+
- [Gitee 仓库](https://gitee.com/xzq_95/testfox-richtext-editor)
|
|
293
|
+
- [TipTap 官方文档](https://tiptap.dev/)
|
|
294
|
+
|
|
295
|
+
## 许可证
|
|
296
|
+
|
|
297
|
+
GPL-3.0
|
|
298
|
+
|
|
299
|
+
## 贡献
|
|
300
|
+
|
|
301
|
+
欢迎提交 Issue 和 Pull Request!
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Editor } from '../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive?: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
iconStyle?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
action?: ({ editor }: {
|
|
15
|
+
editor: Editor;
|
|
16
|
+
}) => Component | boolean | void;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
title: string;
|
|
20
|
+
icon: Component;
|
|
21
|
+
isActive: ({ editor }: {
|
|
22
|
+
editor: Editor;
|
|
23
|
+
}) => boolean;
|
|
24
|
+
action: ({ editor }: {
|
|
25
|
+
editor: Editor;
|
|
26
|
+
}) => Component | boolean | void;
|
|
27
|
+
visible: ({ editor }: {
|
|
28
|
+
editor: Editor;
|
|
29
|
+
}) => boolean;
|
|
30
|
+
iconStyle: string;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { VueEditor } from '../tiptap';
|
|
2
|
+
import { CSSProperties, PropType } from 'vue';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: {
|
|
6
|
+
content?(_: {}): any;
|
|
7
|
+
extra?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
14
|
+
editor: {
|
|
15
|
+
type: PropType<VueEditor>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
contentStyles: {
|
|
19
|
+
type: PropType<CSSProperties>;
|
|
20
|
+
required: false;
|
|
21
|
+
default: () => {};
|
|
22
|
+
};
|
|
23
|
+
locale: {
|
|
24
|
+
type: PropType<"zh-CN" | "en" | "zh" | "en-US">;
|
|
25
|
+
required: false;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
29
|
+
editor: {
|
|
30
|
+
type: PropType<VueEditor>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
contentStyles: {
|
|
34
|
+
type: PropType<CSSProperties>;
|
|
35
|
+
required: false;
|
|
36
|
+
default: () => {};
|
|
37
|
+
};
|
|
38
|
+
locale: {
|
|
39
|
+
type: PropType<"zh-CN" | "en" | "zh" | "en-US">;
|
|
40
|
+
required: false;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
}>> & Readonly<{}>, {
|
|
44
|
+
locale: "zh-CN" | "en" | "zh" | "en-US";
|
|
45
|
+
contentStyles: CSSProperties;
|
|
46
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VueEditor } from '../tiptap';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<VueEditor>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
9
|
+
editor: {
|
|
10
|
+
type: PropType<VueEditor>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VueEditor } from '../tiptap';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
editor: {
|
|
4
|
+
type: typeof VueEditor;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
8
|
+
editor: {
|
|
9
|
+
type: typeof VueEditor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
tooltip?: string;
|
|
3
|
+
selected?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
icon?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: HTMLDivElement;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
|
+
tooltip: string;
|
|
16
|
+
selected: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
18
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
tooltip?: string;
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
6
|
+
"update:modelValue": (value: string) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
9
|
+
}>, {
|
|
10
|
+
tooltip: string;
|
|
11
|
+
modelValue: string;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLInputElement>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
selected: boolean;
|
|
4
|
+
editor: Editor;
|
|
5
|
+
getPos: () => number;
|
|
6
|
+
deleteNode: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: {
|
|
11
|
+
content?(_: {}): any;
|
|
12
|
+
actions?(_: {}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {};
|
|
15
|
+
rootEl: HTMLElement;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
selected: boolean;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as BlockActionButton } from './BlockActionButton.vue';
|
|
2
|
+
export { default as BlockActionInput } from './BlockActionInput.vue';
|
|
3
|
+
export { default as BlockActionSeparator } from './BlockActionSeparator.vue';
|
|
4
|
+
export { default as BlockCard } from './BlockCard.vue';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
};
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
attrs: Partial<{}>;
|
|
6
|
+
slots: {
|
|
7
|
+
default?(_: {}): any;
|
|
8
|
+
prefix?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: any;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
15
|
+
"update:modelValue": (value?: string | undefined) => any;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value?: string | undefined) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
modelValue: string;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './block';
|
|
2
|
+
export * from './toolbar';
|
|
3
|
+
export * from './toolbox';
|
|
4
|
+
export { default as BubbleItem } from './BubbleItem.vue';
|
|
5
|
+
export { default as RichTextEditor } from './Editor.vue';
|
|
6
|
+
export { default as EditorBubbleMenu } from './EditorBubbleMenu.vue';
|
|
7
|
+
export { default as EditorHeader } from './EditorHeader.vue';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ToolbarItemType } from '../../types';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
action?: () => void;
|
|
8
|
+
icon?: Component;
|
|
9
|
+
children?: ToolbarItemType[];
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
title: string;
|
|
13
|
+
children: ToolbarItemType[];
|
|
14
|
+
icon: Component;
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
action: () => void;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
isActive?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
action?: () => void;
|
|
7
|
+
icon?: Component;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
title: string;
|
|
11
|
+
icon: Component;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
action: () => void;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor?: Editor;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
action?: () => void;
|
|
8
|
+
icon?: Component;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
title: string;
|
|
12
|
+
editor: Editor;
|
|
13
|
+
icon: Component;
|
|
14
|
+
action: () => void;
|
|
15
|
+
description: string;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ToolboxItem } from './ToolboxItem.vue';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NodeViewProps } from '../../tiptap/vue-3';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<NodeViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
3
|
+
inputRef: HTMLInputElement;
|
|
4
|
+
}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLInputElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Node, PluginKey } from '../../tiptap';
|
|
2
|
+
import { ExtensionOptions } from '../../types';
|
|
3
|
+
declare module '../../tiptap' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
audio: {
|
|
6
|
+
setAudio: (options: {
|
|
7
|
+
src: string;
|
|
8
|
+
}) => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const AUDIO_BUBBLE_MENU_KEY: PluginKey<any>;
|
|
13
|
+
declare const Audio: Node<ExtensionOptions, any>;
|
|
14
|
+
export default Audio;
|