antdv-next-tiptap 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/LICENSE +21 -0
- package/README.md +282 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.css +2 -0
- package/dist/index.mjs +9132 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/src/commands/colorButton.vue.d.ts +15 -0
- package/dist/types/src/commands/fontFamilySelect.vue.d.ts +7 -0
- package/dist/types/src/commands/fontSizeSelect.vue.d.ts +7 -0
- package/dist/types/src/commands/fullscreenButton.vue.d.ts +7 -0
- package/dist/types/src/commands/headingSelect.vue.d.ts +7 -0
- package/dist/types/src/commands/imageButton.vue.d.ts +7 -0
- package/dist/types/src/commands/imageModal.vue.d.ts +23 -0
- package/dist/types/src/commands/imageView.vue.d.ts +93 -0
- package/dist/types/src/commands/linkButton.vue.d.ts +7 -0
- package/dist/types/src/commands/listSelect.vue.d.ts +7 -0
- package/dist/types/src/commands/tableButton.vue.d.ts +7 -0
- package/dist/types/src/commands/tableToolbar.vue.d.ts +7 -0
- package/dist/types/src/commands/taskItemView.vue.d.ts +4 -0
- package/dist/types/src/commands/textBubbleMenu.vue.d.ts +7 -0
- package/dist/types/src/commands/videoButton.vue.d.ts +7 -0
- package/dist/types/src/commands/videoModal.vue.d.ts +21 -0
- package/dist/types/src/commands/videoView.vue.d.ts +93 -0
- package/dist/types/src/extensions/base.d.ts +2 -0
- package/dist/types/src/extensions/blockquote.d.ts +6 -0
- package/dist/types/src/extensions/bold.d.ts +2 -0
- package/dist/types/src/extensions/bulletList.d.ts +2 -0
- package/dist/types/src/extensions/clearFormat.d.ts +7 -0
- package/dist/types/src/extensions/code.d.ts +6 -0
- package/dist/types/src/extensions/codeBlock.d.ts +6 -0
- package/dist/types/src/extensions/color.d.ts +2 -0
- package/dist/types/src/extensions/fontFamily.d.ts +6 -0
- package/dist/types/src/extensions/fontSize.d.ts +6 -0
- package/dist/types/src/extensions/fullscreen.d.ts +2 -0
- package/dist/types/src/extensions/heading.d.ts +2 -0
- package/dist/types/src/extensions/highlight.d.ts +7 -0
- package/dist/types/src/extensions/horizontalRule.d.ts +6 -0
- package/dist/types/src/extensions/image.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts +3 -0
- package/dist/types/src/extensions/italic.d.ts +2 -0
- package/dist/types/src/extensions/link.d.ts +6 -0
- package/dist/types/src/extensions/orderedList.d.ts +2 -0
- package/dist/types/src/extensions/print.d.ts +2 -0
- package/dist/types/src/extensions/strike.d.ts +6 -0
- package/dist/types/src/extensions/table.d.ts +2 -0
- package/dist/types/src/extensions/taskList.d.ts +2 -0
- package/dist/types/src/extensions/textAlign.d.ts +2 -0
- package/dist/types/src/extensions/textStyle.d.ts +7 -0
- package/dist/types/src/extensions/types.d.ts +31 -0
- package/dist/types/src/extensions/underline.d.ts +6 -0
- package/dist/types/src/extensions/undoRedo.d.ts +6 -0
- package/dist/types/src/extensions/video.d.ts +2 -0
- package/dist/types/src/extensions/videoNode.d.ts +27 -0
- package/dist/types/src/injectionKeys.d.ts +5 -0
- package/dist/types/src/tiptap.vue.d.ts +30 -0
- package/dist/types/src/tiptapProps.d.ts +39 -0
- package/dist/types/src/toolbarItem.vue.d.ts +9 -0
- package/package.json +112 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type PluginName = 'undoRedo' | 'heading' | 'bold' | 'italic' | 'underline' | 'strike' | 'code' | 'codeBlock' | 'blockquote' | 'bulletList' | 'orderedList' | 'taskList' | 'list' | 'textAlign' | 'horizontalRule' | 'clearFormat' | 'color' | 'highlight' | 'link' | 'image' | 'video' | 'table' | 'fontFamily' | 'fontSize' | 'print' | 'fullscreen';
|
|
2
|
+
export type OutputFormat = 'html' | 'json';
|
|
3
|
+
/** 上传函数签名,onProgress 回调传入 0-100 的进度百分比 */
|
|
4
|
+
export type UploadFn = (file: File, onProgress: (percent: number) => void) => Promise<string>;
|
|
5
|
+
export interface TiptapProps {
|
|
6
|
+
/** 内容区域高度 */
|
|
7
|
+
height?: number;
|
|
8
|
+
/** 是否可编辑 */
|
|
9
|
+
editable?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 禁用的插件名称列表,对应 TiptapPlugin.name
|
|
12
|
+
* @example ['image', 'video', 'table']
|
|
13
|
+
*/
|
|
14
|
+
disabledPlugins?: PluginName[];
|
|
15
|
+
/**
|
|
16
|
+
* 自定义图片上传函数,返回图片 URL
|
|
17
|
+
* 不提供时使用 base64 内嵌
|
|
18
|
+
* @example async (file) => { const url = await uploadToOSS(file); return url }
|
|
19
|
+
*/
|
|
20
|
+
uploadImage?: UploadFn;
|
|
21
|
+
/**
|
|
22
|
+
* 自定义视频上传函数,返回视频 URL;onProgress 传入 0-100 的上传进度
|
|
23
|
+
* 不提供时仅支持输入视频地址,无本地上传入口
|
|
24
|
+
* @example async (file, onProgress) => { const url = await uploadToOSS(file, onProgress); return url }
|
|
25
|
+
*/
|
|
26
|
+
uploadVideo?: UploadFn;
|
|
27
|
+
/**
|
|
28
|
+
* 字符计数。true 仅展示计数,number 同时限制最大字符数
|
|
29
|
+
* @example true
|
|
30
|
+
* @example 500
|
|
31
|
+
*/
|
|
32
|
+
wordCount?: true | number;
|
|
33
|
+
/**
|
|
34
|
+
* 输出格式,默认 'html'
|
|
35
|
+
* - 'html':modelValue 为 HTML 字符串
|
|
36
|
+
* - 'json':modelValue 为 JSON 字符串(Tiptap doc 格式)
|
|
37
|
+
*/
|
|
38
|
+
outputFormat?: OutputFormat;
|
|
39
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import { ToolbarButton, ToolbarComponent } from './extensions/types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
item: ToolbarButton | ToolbarComponent;
|
|
5
|
+
editor?: Editor;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
package/package.json
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "antdv-next-tiptap",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"module": "dist/index.mjs",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/types/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./style": "./dist/index.css"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"antdv-next": "^1.3.3",
|
|
19
|
+
"vue": "^3.6.0-beta.14"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@iconify-json/ri": "^1.2.10",
|
|
23
|
+
"@iconify/vue": "^5.0.1",
|
|
24
|
+
"@tiptap/core": "^3.26.0",
|
|
25
|
+
"@tiptap/extension-blockquote": "^3.26.0",
|
|
26
|
+
"@tiptap/extension-bold": "^3.26.0",
|
|
27
|
+
"@tiptap/extension-bullet-list": "^3.26.0",
|
|
28
|
+
"@tiptap/extension-code": "^3.26.0",
|
|
29
|
+
"@tiptap/extension-code-block": "^3.26.0",
|
|
30
|
+
"@tiptap/extension-code-block-lowlight": "^3.26.0",
|
|
31
|
+
"@tiptap/extension-color": "^3.26.0",
|
|
32
|
+
"@tiptap/extension-document": "^3.26.0",
|
|
33
|
+
"@tiptap/extension-dropcursor": "^3.26.0",
|
|
34
|
+
"@tiptap/extension-font-family": "^3.26.0",
|
|
35
|
+
"@tiptap/extension-font-size": "3.0.0-next.3",
|
|
36
|
+
"@tiptap/extension-gapcursor": "^3.26.0",
|
|
37
|
+
"@tiptap/extension-hard-break": "^3.26.0",
|
|
38
|
+
"@tiptap/extension-heading": "^3.26.0",
|
|
39
|
+
"@tiptap/extension-highlight": "^3.26.0",
|
|
40
|
+
"@tiptap/extension-horizontal-rule": "^3.26.0",
|
|
41
|
+
"@tiptap/extension-image": "^3.26.0",
|
|
42
|
+
"@tiptap/extension-italic": "^3.26.0",
|
|
43
|
+
"@tiptap/extension-link": "^3.26.0",
|
|
44
|
+
"@tiptap/extension-list": "^3.26.0",
|
|
45
|
+
"@tiptap/extension-list-item": "^3.26.0",
|
|
46
|
+
"@tiptap/extension-ordered-list": "^3.26.0",
|
|
47
|
+
"@tiptap/extension-paragraph": "^3.26.0",
|
|
48
|
+
"@tiptap/extension-strike": "^3.26.0",
|
|
49
|
+
"@tiptap/extension-table": "^3.26.0",
|
|
50
|
+
"@tiptap/extension-task-item": "^3.26.0",
|
|
51
|
+
"@tiptap/extension-task-list": "^3.26.0",
|
|
52
|
+
"@tiptap/extension-text": "^3.26.0",
|
|
53
|
+
"@tiptap/extension-text-align": "^3.26.0",
|
|
54
|
+
"@tiptap/extension-text-style": "^3.26.0",
|
|
55
|
+
"@tiptap/extension-underline": "^3.26.0",
|
|
56
|
+
"@tiptap/extensions": "^3.26.0",
|
|
57
|
+
"@tiptap/pm": "^3.26.0",
|
|
58
|
+
"@tiptap/starter-kit": "^3.26.0",
|
|
59
|
+
"@tiptap/vue-3": "^3.26.0",
|
|
60
|
+
"highlight.js": "^11.11.1",
|
|
61
|
+
"lowlight": "^3.3.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@antdv-next/auto-import-resolver": "^1.1.0",
|
|
65
|
+
"@antdv-next/unocss": "^1.1.0",
|
|
66
|
+
"@tsconfig/node24": "^24.0.4",
|
|
67
|
+
"@types/jsdom": "^28.0.3",
|
|
68
|
+
"@types/node": "^25.9.3",
|
|
69
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
70
|
+
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
71
|
+
"@vue/language-core": "^3.3.5",
|
|
72
|
+
"@vue/test-utils": "^2.4.11",
|
|
73
|
+
"@vue/tsconfig": "^0.9.1",
|
|
74
|
+
"jiti": "^2.7.0",
|
|
75
|
+
"jsdom": "^29.1.1",
|
|
76
|
+
"npm-run-all2": "^9.0.1",
|
|
77
|
+
"oxfmt": "^0.54.0",
|
|
78
|
+
"oxlint": "~1.69.0",
|
|
79
|
+
"sass": "^1.100.0",
|
|
80
|
+
"typescript": "~6.0.3",
|
|
81
|
+
"unocss": "^66.7.0",
|
|
82
|
+
"unplugin-auto-import": "^21.0.0",
|
|
83
|
+
"unplugin-vue-components": "^32.1.0",
|
|
84
|
+
"vite": "8.0.16",
|
|
85
|
+
"vite-plugin-dts": "^5.0.2",
|
|
86
|
+
"vite-svg-loader": "^5.1.1",
|
|
87
|
+
"vue-tsc": "^3.3.5"
|
|
88
|
+
},
|
|
89
|
+
"homepage": "https://github.com/pengyinghao/antdv-next-tiptap#readme",
|
|
90
|
+
"repository": {
|
|
91
|
+
"type": "git",
|
|
92
|
+
"url": "git+https://github.com/pengyinghao/antdv-next-tiptap.git"
|
|
93
|
+
},
|
|
94
|
+
"bugs": {
|
|
95
|
+
"url": "https://github.com/pengyinghao/antdv-next-tiptap/issues"
|
|
96
|
+
},
|
|
97
|
+
"engines": {
|
|
98
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
99
|
+
},
|
|
100
|
+
"scripts": {
|
|
101
|
+
"dev": "vite",
|
|
102
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
103
|
+
"build:lib": "vite build --config vite.lib.config.ts",
|
|
104
|
+
"preview": "vite preview",
|
|
105
|
+
"build-only": "vite build",
|
|
106
|
+
"type-check": "vue-tsc --build",
|
|
107
|
+
"lint": "run-s lint:*",
|
|
108
|
+
"lint:oxlint": "oxlint . --fix",
|
|
109
|
+
"lint:eslint": "eslint . --fix --cache",
|
|
110
|
+
"format": "oxfmt src/"
|
|
111
|
+
}
|
|
112
|
+
}
|