@vibe-tiptap/vue-adapter 0.0.0-stage → 1.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/LICENSE +15 -0
- package/README.md +20 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/vue-editor.d.ts +49 -0
- package/dist/vue-editor.d.ts.map +1 -0
- package/dist/vue-editor.js +143 -0
- package/dist/vue-editor.js.map +1 -0
- package/package.json +35 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vibe-tiptap contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vibe-tiptap/vue-adapter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vibe Tiptap 的 Vue 3 适配层,提供编辑器生命周期、响应式上下文和 Tiptap Vue 内容组件。
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @vibe-tiptap/vue-adapter vue
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import { EditorContent, useVueEditor } from '@vibe-tiptap/vue-adapter'
|
|
12
|
+
|
|
13
|
+
const editor = useVueEditor({ content: '<p>正文</p>' })
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<EditorContent v-if="editor.context.value" :editor="editor.context.value.editor" />
|
|
18
|
+
</template>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
需要完整的 Naive UI 编辑器时,请直接使用 `@vibe-tiptap/naive-ui`。
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EditorContent, NodeViewContent, NodeViewWrapper, VueMarkViewRenderer, VueNodeViewRenderer, } from '@tiptap/vue-3';
|
|
2
|
+
export * from '@vibe-tiptap/core';
|
|
3
|
+
export type { VueEditorContent, VueEditorContext, VueEditorOptions } from './vue-editor';
|
|
4
|
+
export { createVueEditor, useVueEditor } from './vue-editor';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,eAAe,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACxF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,eAAe,CAAA;AACtB,cAAc,mBAAmB,CAAA;AAEjC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type CoreEditorContext, type CoreEditorOptions, type Editor, type EditorCommands, type FindReplaceState, type JSONContent, type SlashCommandBridgeOptions } from '@vibe-tiptap/core';
|
|
2
|
+
import { type ComputedRef, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue';
|
|
3
|
+
export type VueEditorContent = string | JSONContent;
|
|
4
|
+
/** Vue 输入允许传普通值、ref 或 getter;content 仅在创建时取值。 */
|
|
5
|
+
export interface VueEditorOptions extends Omit<CoreEditorOptions, 'content' | 'editable'> {
|
|
6
|
+
/** 仅在编辑器初始化时读取。 */
|
|
7
|
+
content?: MaybeRefOrGetter<VueEditorContent | undefined>;
|
|
8
|
+
editable?: MaybeRefOrGetter<boolean | undefined>;
|
|
9
|
+
}
|
|
10
|
+
/** Core 上下文的 Vue 响应式视图。Editor 实例本身保持非代理对象。 */
|
|
11
|
+
export interface VueEditorContext {
|
|
12
|
+
readonly core: CoreEditorContext;
|
|
13
|
+
readonly editor: Editor;
|
|
14
|
+
readonly commands: EditorCommands;
|
|
15
|
+
readonly loaded: true;
|
|
16
|
+
readonly html: ComputedRef<string>;
|
|
17
|
+
readonly json: ComputedRef<object>;
|
|
18
|
+
readonly markdown: ComputedRef<string>;
|
|
19
|
+
readonly wordCount: ComputedRef<CoreEditorContext['wordCount']>;
|
|
20
|
+
readonly tableState: ComputedRef<CoreEditorContext['tableState']>;
|
|
21
|
+
readonly findReplaceState: ComputedRef<FindReplaceState>;
|
|
22
|
+
readonly revision: Readonly<Ref<number>>;
|
|
23
|
+
readonly documentRevision: Readonly<Ref<number>>;
|
|
24
|
+
readonly selectionRevision: Readonly<Ref<number>>;
|
|
25
|
+
readonly isActive: CoreEditorContext['isActive'];
|
|
26
|
+
readonly getContent: CoreEditorContext['getContent'];
|
|
27
|
+
readonly getHTML: CoreEditorContext['getHTML'];
|
|
28
|
+
readonly getJSON: CoreEditorContext['getJSON'];
|
|
29
|
+
readonly getMarkdown: CoreEditorContext['getMarkdown'];
|
|
30
|
+
readonly importMarkdown: CoreEditorContext['importMarkdown'];
|
|
31
|
+
readonly notify: CoreEditorContext['notify'];
|
|
32
|
+
readonly t: CoreEditorContext['t'];
|
|
33
|
+
readonly setContent: CoreEditorContext['setContent'];
|
|
34
|
+
readonly setEditable: CoreEditorContext['setEditable'];
|
|
35
|
+
readonly destroy: CoreEditorContext['destroy'];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 创建带 Vue 响应式状态的编辑器。
|
|
39
|
+
*
|
|
40
|
+
* 此函数不依赖组件 setup,可用于手动管理场景;调用方最终需要执行 destroy。
|
|
41
|
+
*/
|
|
42
|
+
export declare function createVueEditor(options?: VueEditorOptions, slashCommandBridge?: SlashCommandBridgeOptions): VueEditorContext;
|
|
43
|
+
/**
|
|
44
|
+
* 在组件中创建编辑器,并在挂载前保持空值以支持 SSR。
|
|
45
|
+
*
|
|
46
|
+
* 组件外调用时会立即创建编辑器;若存在 effect scope,则随 scope 自动销毁。
|
|
47
|
+
*/
|
|
48
|
+
export declare function useVueEditor(options?: VueEditorOptions, slashCommandBridge?: SlashCommandBridgeOptions): Readonly<ShallowRef<VueEditorContext | undefined>>;
|
|
49
|
+
//# sourceMappingURL=vue-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-editor.d.ts","sourceRoot":"","sources":["../src/vue-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,gBAAgB,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
|
|
2
|
+
import { computed, effectScope, getCurrentInstance, getCurrentScope, onBeforeUnmount, onMounted, onScopeDispose, readonly, ref, shallowReadonly, shallowRef, toValue, watch, } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* 创建带 Vue 响应式状态的编辑器。
|
|
5
|
+
*
|
|
6
|
+
* 此函数不依赖组件 setup,可用于手动管理场景;调用方最终需要执行 destroy。
|
|
7
|
+
*/
|
|
8
|
+
export function createVueEditor(options = {}, slashCommandBridge) {
|
|
9
|
+
const initialContent = options.content === undefined ? undefined : toValue(options.content);
|
|
10
|
+
const initialEditable = options.editable === undefined ? undefined : toValue(options.editable);
|
|
11
|
+
const core = createCoreEditor({
|
|
12
|
+
...options,
|
|
13
|
+
get uploadAsset() {
|
|
14
|
+
return options.uploadAsset;
|
|
15
|
+
},
|
|
16
|
+
get editorBehaviorOptions() {
|
|
17
|
+
return options.editorBehaviorOptions;
|
|
18
|
+
},
|
|
19
|
+
content: initialContent,
|
|
20
|
+
editable: initialEditable,
|
|
21
|
+
onUpdate: options.onUpdate,
|
|
22
|
+
}, slashCommandBridge);
|
|
23
|
+
const scope = effectScope(true);
|
|
24
|
+
const revision = ref(0);
|
|
25
|
+
const documentRevision = ref(0);
|
|
26
|
+
const selectionRevision = ref(0);
|
|
27
|
+
let destroyed = false;
|
|
28
|
+
const unsubscribe = core.subscribe((event) => {
|
|
29
|
+
revision.value += 1;
|
|
30
|
+
if (event.docChanged)
|
|
31
|
+
documentRevision.value += 1;
|
|
32
|
+
if (event.docChanged || event.selectionSet || event.findReplaceChanged) {
|
|
33
|
+
selectionRevision.value += 1;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
scope.run(() => {
|
|
37
|
+
if (options.editable !== undefined) {
|
|
38
|
+
watch(() => toValue(options.editable), (editable) => {
|
|
39
|
+
if (editable === undefined)
|
|
40
|
+
return;
|
|
41
|
+
core.setEditable(editable);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const trackDocumentState = () => documentRevision.value;
|
|
46
|
+
const trackSelectionState = () => selectionRevision.value;
|
|
47
|
+
const html = computed(() => {
|
|
48
|
+
trackDocumentState();
|
|
49
|
+
return core.getHTML();
|
|
50
|
+
});
|
|
51
|
+
const json = computed(() => {
|
|
52
|
+
trackDocumentState();
|
|
53
|
+
return core.getJSON();
|
|
54
|
+
});
|
|
55
|
+
const markdown = computed(() => {
|
|
56
|
+
trackDocumentState();
|
|
57
|
+
return core.getMarkdown();
|
|
58
|
+
});
|
|
59
|
+
const wordCount = computed(() => {
|
|
60
|
+
trackDocumentState();
|
|
61
|
+
return core.wordCount;
|
|
62
|
+
});
|
|
63
|
+
const tableState = computed(() => {
|
|
64
|
+
trackSelectionState();
|
|
65
|
+
return core.tableState;
|
|
66
|
+
});
|
|
67
|
+
const findReplaceState = computed(() => {
|
|
68
|
+
trackSelectionState();
|
|
69
|
+
return core.findReplaceState;
|
|
70
|
+
});
|
|
71
|
+
const isActive = (name, attrs) => {
|
|
72
|
+
trackSelectionState();
|
|
73
|
+
return core.isActive(name, attrs);
|
|
74
|
+
};
|
|
75
|
+
const destroy = () => {
|
|
76
|
+
if (destroyed)
|
|
77
|
+
return;
|
|
78
|
+
destroyed = true;
|
|
79
|
+
scope.stop();
|
|
80
|
+
unsubscribe();
|
|
81
|
+
core.destroy();
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
core,
|
|
85
|
+
editor: core.editor,
|
|
86
|
+
commands: core.commands,
|
|
87
|
+
loaded: true,
|
|
88
|
+
html,
|
|
89
|
+
json,
|
|
90
|
+
markdown,
|
|
91
|
+
wordCount,
|
|
92
|
+
tableState,
|
|
93
|
+
findReplaceState,
|
|
94
|
+
revision: readonly(revision),
|
|
95
|
+
documentRevision: readonly(documentRevision),
|
|
96
|
+
selectionRevision: readonly(selectionRevision),
|
|
97
|
+
isActive,
|
|
98
|
+
getContent: core.getContent,
|
|
99
|
+
getHTML: core.getHTML,
|
|
100
|
+
getJSON: core.getJSON,
|
|
101
|
+
getMarkdown: core.getMarkdown,
|
|
102
|
+
importMarkdown: core.importMarkdown,
|
|
103
|
+
notify: core.notify,
|
|
104
|
+
t: core.t,
|
|
105
|
+
setContent: core.setContent,
|
|
106
|
+
setEditable: core.setEditable,
|
|
107
|
+
destroy,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 在组件中创建编辑器,并在挂载前保持空值以支持 SSR。
|
|
112
|
+
*
|
|
113
|
+
* 组件外调用时会立即创建编辑器;若存在 effect scope,则随 scope 自动销毁。
|
|
114
|
+
*/
|
|
115
|
+
export function useVueEditor(options = {}, slashCommandBridge) {
|
|
116
|
+
const context = shallowRef();
|
|
117
|
+
let current;
|
|
118
|
+
let disposed = false;
|
|
119
|
+
const dispose = () => {
|
|
120
|
+
if (disposed)
|
|
121
|
+
return;
|
|
122
|
+
disposed = true;
|
|
123
|
+
current?.destroy();
|
|
124
|
+
current = undefined;
|
|
125
|
+
context.value = undefined;
|
|
126
|
+
};
|
|
127
|
+
if (getCurrentScope())
|
|
128
|
+
onScopeDispose(dispose);
|
|
129
|
+
if (getCurrentInstance()) {
|
|
130
|
+
onMounted(() => {
|
|
131
|
+
if (disposed || current)
|
|
132
|
+
return;
|
|
133
|
+
current = createVueEditor(options, slashCommandBridge);
|
|
134
|
+
context.value = current;
|
|
135
|
+
});
|
|
136
|
+
onBeforeUnmount(dispose);
|
|
137
|
+
return shallowReadonly(context);
|
|
138
|
+
}
|
|
139
|
+
current = createVueEditor(options, slashCommandBridge);
|
|
140
|
+
context.value = current;
|
|
141
|
+
return shallowReadonly(context);
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=vue-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-editor.js","sourceRoot":"","sources":["../src/vue-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,GAMjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAEL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vibe-tiptap/vue-adapter",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Vibe Tiptap 的 Vue 3 编辑器适配层",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@vibe-tiptap/core": "1.1.0",
|
|
24
|
+
"@tiptap/vue-3": "3.31.3"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"vue": "^3.3.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"happy-dom": "^20.10.6",
|
|
31
|
+
"vue": "^3.5.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -p tsconfig.json",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"test": "vitest run"
|
|
37
|
+
}
|
|
6
38
|
}
|