@mario9/tiptap-editor 0.1.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 +23 -0
- package/dist/index.d.ts +80 -0
- package/dist/tiptap-vue.css +1 -0
- package/dist/tiptap-vue.js +1689 -0
- package/dist/tiptap-vue.umd.cjs +1 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Tiptap Vue 富文本编辑器
|
|
2
|
+
|
|
3
|
+
## 技术栈
|
|
4
|
+
- vue 3.5.25
|
|
5
|
+
- element-plus 2.13.3
|
|
6
|
+
- @tiptap/core 3.20.0
|
|
7
|
+
|
|
8
|
+
## 代码结构
|
|
9
|
+
```
|
|
10
|
+
src/
|
|
11
|
+
├── App.vue # 初始化编辑器,渲染工具栏 + 编辑器内容
|
|
12
|
+
├── editor.scss # 工具栏和编辑器样式
|
|
13
|
+
├── components/
|
|
14
|
+
│ └── IconButton.tsx # 基础按钮,包裹 ElButton 和 ElTooltip
|
|
15
|
+
├── tiptap-ui/ # 工具栏按钮组
|
|
16
|
+
│ ├── UndoRedoButton.tsx # 撤销重做
|
|
17
|
+
│ ├── TextStyleButton.tsx # 加粗、斜体、删除线、下划线、链接
|
|
18
|
+
│ ├── TextAlignButton.tsx # 左边对齐、中间对齐、右边对齐、两端对齐
|
|
19
|
+
│ ├── ListButton.tsx # 无序列表、有序列表、任务列表
|
|
20
|
+
│ └── ImageButton.tsx # 图片上传
|
|
21
|
+
├── tiptap-icons/ # SVG 图标组件 (TSX)
|
|
22
|
+
└── tiptap-extension/ # Tiptap extensions
|
|
23
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { DefineComponent } from 'vue';
|
|
5
|
+
import { ExtractPropTypes } from 'vue';
|
|
6
|
+
import { ImageOptions } from '@tiptap/extension-image';
|
|
7
|
+
import { JSX } from 'vue/jsx-runtime';
|
|
8
|
+
import { Node as Node_2 } from '@tiptap/core';
|
|
9
|
+
import { PropType } from 'vue';
|
|
10
|
+
import { PublicProps } from 'vue';
|
|
11
|
+
|
|
12
|
+
declare type __VLS_Props = {
|
|
13
|
+
modelValue?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export declare const IconButton: DefineComponent<ExtractPropTypes< {
|
|
18
|
+
icon: {
|
|
19
|
+
type: PropType<Component>;
|
|
20
|
+
required: boolean;
|
|
21
|
+
};
|
|
22
|
+
tooltip: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
required: boolean;
|
|
25
|
+
};
|
|
26
|
+
isActive: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
};
|
|
29
|
+
disabled: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
onClick: {
|
|
34
|
+
type: PropType<() => void>;
|
|
35
|
+
};
|
|
36
|
+
}>, () => JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
37
|
+
icon: {
|
|
38
|
+
type: PropType<Component>;
|
|
39
|
+
required: boolean;
|
|
40
|
+
};
|
|
41
|
+
tooltip: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
required: boolean;
|
|
44
|
+
};
|
|
45
|
+
isActive: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
};
|
|
48
|
+
disabled: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
52
|
+
onClick: {
|
|
53
|
+
type: PropType<() => void>;
|
|
54
|
+
};
|
|
55
|
+
}>> & Readonly<{}>, {
|
|
56
|
+
isActive: boolean;
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
59
|
+
|
|
60
|
+
export declare const ImageWithAlign: Node_2<ImageOptions, any>;
|
|
61
|
+
|
|
62
|
+
export declare const TiptapEditor: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
63
|
+
"update:modelValue": (value: string) => any;
|
|
64
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
65
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
66
|
+
}>, {
|
|
67
|
+
placeholder: string;
|
|
68
|
+
modelValue: string;
|
|
69
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
70
|
+
|
|
71
|
+
export { }
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
declare module '@tiptap/core' {
|
|
75
|
+
interface Commands<ReturnType> {
|
|
76
|
+
imageUpload: {
|
|
77
|
+
setImageUploadNode: () => ReturnType;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|