@ap666/office-word 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/LICENSE +21 -0
- package/README.md +175 -0
- package/dist/chunk-efA98nb6.js +13 -0
- package/dist/components/ColumnsBlockView.vue.d.ts +26 -0
- package/dist/components/CountdownBlockView.vue.d.ts +3 -0
- package/dist/components/EmojiPickerPanel.vue.d.ts +11 -0
- package/dist/components/FormulaBlockView.vue.d.ts +3 -0
- package/dist/components/FormulaEditorDialog.vue.d.ts +20 -0
- package/dist/components/HighlightBlockView.vue.d.ts +28 -0
- package/dist/components/ImageBlockView.vue.d.ts +6 -0
- package/dist/components/LinkBlockView.vue.d.ts +5 -0
- package/dist/components/OfficeCodeBlockView.vue.d.ts +28 -0
- package/dist/components/OfficeColorIcon.vue.d.ts +10 -0
- package/dist/components/OfficeIcon.vue.d.ts +12 -0
- package/dist/components/OutlinePanel.vue.d.ts +17 -0
- package/dist/components/RichTextEditor.vue.d.ts +51 -0
- package/dist/components/ScrollArea.vue.d.ts +24 -0
- package/dist/components/VideoBlockView.vue.d.ts +7 -0
- package/dist/composables/useRichTextEditor.d.ts +9 -0
- package/dist/data/emoji.d.ts +13 -0
- package/dist/extensions/columns-block.d.ts +2 -0
- package/dist/extensions/columns-column.d.ts +2 -0
- package/dist/extensions/countdown-block.d.ts +2 -0
- package/dist/extensions/formula-block.d.ts +2 -0
- package/dist/extensions/highlight-block.d.ts +2 -0
- package/dist/extensions/image-block.d.ts +2 -0
- package/dist/extensions/indent.d.ts +17 -0
- package/dist/extensions/link-block.d.ts +2 -0
- package/dist/extensions/office-code-block.d.ts +1 -0
- package/dist/extensions/quote-style.d.ts +19 -0
- package/dist/extensions/text-align.d.ts +12 -0
- package/dist/extensions/video-block.d.ts +2 -0
- package/dist/html2canvas-Bwmq6fGh.js +4025 -0
- package/dist/icons.d.ts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.es-C4X5YiRo.js +5751 -0
- package/dist/index.js +54037 -0
- package/dist/index.umd.cjs +5319 -0
- package/dist/jspdf.es.min-ByaXFVjc.js +18214 -0
- package/dist/purify.es-B5ixYH9L.js +549 -0
- package/dist/style.css +2 -0
- package/dist/typeof-Dz1Ap89p.js +11 -0
- package/dist/types.d.ts +57 -0
- package/dist/utils/columns.d.ts +4 -0
- package/dist/utils/markdown-import.d.ts +2 -0
- package/docs/usage.md +19 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# @ap666/office-word
|
|
2
|
+
|
|
3
|
+
A reusable Vue 3 rich text editor component built with Tiptap 3.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @ap666/office-word
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic Use
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { ref } from 'vue'
|
|
16
|
+
import type { JSONContent } from '@tiptap/core'
|
|
17
|
+
import { RichTextEditor } from '@ap666/office-word'
|
|
18
|
+
|
|
19
|
+
const content = ref<JSONContent | null>(null)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<RichTextEditor v-model="content" />
|
|
24
|
+
</template>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The package imports its own styles from the entry, so no extra CSS import is required for the default setup.
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
- `modelValue?: JSONContent | null`
|
|
32
|
+
- `editable?: boolean`
|
|
33
|
+
- `placeholder?: string`
|
|
34
|
+
|
|
35
|
+
## Instance API
|
|
36
|
+
|
|
37
|
+
Use a Vue `ref` to access the editor instance methods.
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import { ref } from 'vue'
|
|
42
|
+
import { RichTextEditor } from '@ap666/office-word'
|
|
43
|
+
import type { RichTextEditorInstance } from '@ap666/office-word'
|
|
44
|
+
|
|
45
|
+
const editorRef = ref<RichTextEditorInstance | null>(null)
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<RichTextEditor ref="editorRef" />
|
|
50
|
+
</template>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Available methods:
|
|
54
|
+
|
|
55
|
+
- `exportPdf(): Promise<Blob | null>`
|
|
56
|
+
- `exportImage(options?): Promise<Blob | null>`
|
|
57
|
+
- `exportHtml(): string | null`
|
|
58
|
+
- `insertImage(payload | payload[]): boolean`
|
|
59
|
+
- `insertVideo(payload): boolean`
|
|
60
|
+
- `insertFile(payload): boolean`
|
|
61
|
+
- `focus(): void`
|
|
62
|
+
- `getJSON(): JSONContent | null`
|
|
63
|
+
|
|
64
|
+
## Export Example
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
async function handleExportPdf() {
|
|
68
|
+
const blob = await editorRef.value?.exportPdf()
|
|
69
|
+
if (!blob) return
|
|
70
|
+
|
|
71
|
+
const url = URL.createObjectURL(blob)
|
|
72
|
+
const link = document.createElement('a')
|
|
73
|
+
link.href = url
|
|
74
|
+
link.download = 'demo.pdf'
|
|
75
|
+
link.click()
|
|
76
|
+
URL.revokeObjectURL(url)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function handleExportImage() {
|
|
80
|
+
const blob = await editorRef.value?.exportImage({
|
|
81
|
+
type: 'image/png',
|
|
82
|
+
})
|
|
83
|
+
if (!blob) return
|
|
84
|
+
|
|
85
|
+
const url = URL.createObjectURL(blob)
|
|
86
|
+
window.open(url, '_blank')
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function handleExportHtml() {
|
|
90
|
+
const html = editorRef.value?.exportHtml()
|
|
91
|
+
if (!html) return
|
|
92
|
+
|
|
93
|
+
console.log(html)
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Upload And Insert Example
|
|
98
|
+
|
|
99
|
+
Recommended integration flow:
|
|
100
|
+
|
|
101
|
+
1. Upload the asset from your own business layer.
|
|
102
|
+
2. Wait for the API to return the final accessible URL.
|
|
103
|
+
3. Call the editor instance method to insert the returned content.
|
|
104
|
+
|
|
105
|
+
### Insert Image
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
async function uploadImage(file: File) {
|
|
109
|
+
const imageUrl = await yourUploadApi(file)
|
|
110
|
+
|
|
111
|
+
editorRef.value?.insertImage({
|
|
112
|
+
src: imageUrl,
|
|
113
|
+
name: file.name,
|
|
114
|
+
alt: file.name,
|
|
115
|
+
description: '',
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
You can also insert up to 4 images in one call:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
editorRef.value?.insertImage([
|
|
124
|
+
{ src: 'https://cdn.example.com/a.png', name: 'a.png' },
|
|
125
|
+
{ src: 'https://cdn.example.com/b.png', name: 'b.png' },
|
|
126
|
+
])
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Insert Video
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
async function uploadVideo(file: File) {
|
|
133
|
+
const videoUrl = await yourUploadApi(file)
|
|
134
|
+
|
|
135
|
+
editorRef.value?.insertVideo({
|
|
136
|
+
src: videoUrl,
|
|
137
|
+
name: file.name,
|
|
138
|
+
mimeType: file.type || 'video/mp4',
|
|
139
|
+
description: 'video description',
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Insert File
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
async function uploadFile(file: File) {
|
|
148
|
+
const fileUrl = await yourUploadApi(file)
|
|
149
|
+
|
|
150
|
+
editorRef.value?.insertFile({
|
|
151
|
+
url: fileUrl,
|
|
152
|
+
name: file.name,
|
|
153
|
+
displayMode: 'text',
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`insertFile()` currently inserts a compact file link block. If a dedicated file block is needed later, that can be extended without changing the external upload flow.
|
|
159
|
+
|
|
160
|
+
## Type Imports
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
import type {
|
|
164
|
+
RichTextEditorFilePayload,
|
|
165
|
+
RichTextEditorImageExportOptions,
|
|
166
|
+
RichTextEditorImagePayload,
|
|
167
|
+
RichTextEditorInstance,
|
|
168
|
+
RichTextEditorVideoPayload,
|
|
169
|
+
} from '@ap666/office-word'
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Package Docs
|
|
173
|
+
|
|
174
|
+
- usage guide: `docs/usage.md`
|
|
175
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), s = (e, i, o, s) => {
|
|
3
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
4
|
+
get: ((e) => i[e]).bind(null, d),
|
|
5
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
6
|
+
});
|
|
7
|
+
return e;
|
|
8
|
+
}, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
|
|
9
|
+
value: n,
|
|
10
|
+
enumerable: !0
|
|
11
|
+
}) : a, n));
|
|
12
|
+
//#endregion
|
|
13
|
+
export { c as n, o as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
contentRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
as: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
9
|
+
as: string;
|
|
10
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
11
|
+
P: {};
|
|
12
|
+
B: {};
|
|
13
|
+
D: {};
|
|
14
|
+
C: {};
|
|
15
|
+
M: {};
|
|
16
|
+
Defaults: {};
|
|
17
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
as: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
23
|
+
as: string;
|
|
24
|
+
}> | null;
|
|
25
|
+
}, any>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
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, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
selectedEmoji?: string | null;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
select: (emoji: string) => any;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
onSelect?: ((emoji: string) => any) | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
selectedEmoji: string | null;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
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, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
value?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
submitLabel?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
close: () => any;
|
|
9
|
+
submit: (value: string) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onClose?: (() => any) | undefined;
|
|
12
|
+
onSubmit?: ((value: string) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
title: string;
|
|
15
|
+
value: string;
|
|
16
|
+
submitLabel: string;
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
18
|
+
textareaRef: HTMLTextAreaElement;
|
|
19
|
+
}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
wrapperRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
as: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
9
|
+
as: string;
|
|
10
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
11
|
+
P: {};
|
|
12
|
+
B: {};
|
|
13
|
+
D: {};
|
|
14
|
+
C: {};
|
|
15
|
+
M: {};
|
|
16
|
+
Defaults: {};
|
|
17
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
as: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
23
|
+
as: string;
|
|
24
|
+
}> | null;
|
|
25
|
+
emojiTriggerRef: HTMLButtonElement;
|
|
26
|
+
emojiPickerRef: HTMLDivElement;
|
|
27
|
+
}, any>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
alignDropdownRef: HTMLDivElement;
|
|
4
|
+
inputRef: HTMLInputElement;
|
|
5
|
+
}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -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
|
+
alignDropdownRef: HTMLDivElement;
|
|
4
|
+
}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
wrapperRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
as: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
9
|
+
as: string;
|
|
10
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
11
|
+
P: {};
|
|
12
|
+
B: {};
|
|
13
|
+
D: {};
|
|
14
|
+
C: {};
|
|
15
|
+
M: {};
|
|
16
|
+
Defaults: {};
|
|
17
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
as: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
23
|
+
as: string;
|
|
24
|
+
}> | null;
|
|
25
|
+
languageMenuRef: HTMLDivElement;
|
|
26
|
+
settingsMenuRef: HTMLDivElement;
|
|
27
|
+
}, any>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name: string;
|
|
3
|
+
size?: number | string;
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
size: number | string;
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name: string;
|
|
3
|
+
size?: number | string;
|
|
4
|
+
color?: string;
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
8
|
+
size: number | string;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
color: string;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
items: Array<{
|
|
4
|
+
pos: number;
|
|
5
|
+
level: number;
|
|
6
|
+
text: string;
|
|
7
|
+
}>;
|
|
8
|
+
activePos: number | null;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
select: (pos: number) => any;
|
|
12
|
+
toggle: () => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onSelect?: ((pos: number) => any) | undefined;
|
|
15
|
+
onToggle?: (() => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/core';
|
|
2
|
+
import { RichTextEditorFilePayload, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorProps, RichTextEditorVideoPayload } from '../types';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
|
|
4
|
+
exportPdf: () => Promise<Blob | null>;
|
|
5
|
+
exportImage: (options?: RichTextEditorImageExportOptions) => Promise<Blob | null>;
|
|
6
|
+
exportHtml: () => string | null;
|
|
7
|
+
insertImage: (payload: RichTextEditorImagePayload | RichTextEditorImagePayload[]) => boolean;
|
|
8
|
+
insertVideo: (payload: RichTextEditorVideoPayload) => boolean;
|
|
9
|
+
insertFile: (payload: RichTextEditorFilePayload) => boolean;
|
|
10
|
+
focus: () => void;
|
|
11
|
+
getJSON: () => JSONContent | null;
|
|
12
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
change: (value: JSONContent) => any;
|
|
14
|
+
"update:modelValue": (value: JSONContent) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<RichTextEditorProps> & Readonly<{
|
|
16
|
+
onChange?: ((value: JSONContent) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
placeholder: string;
|
|
20
|
+
editable: boolean;
|
|
21
|
+
modelValue: JSONContent | null;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
23
|
+
rootRef: HTMLDivElement;
|
|
24
|
+
insertMenuRef: HTMLDivElement;
|
|
25
|
+
insertMenuPanelRef: HTMLDivElement;
|
|
26
|
+
countdownDateTriggerRef: HTMLButtonElement;
|
|
27
|
+
countdownPickerRef: HTMLDivElement;
|
|
28
|
+
headingMenuRef: HTMLDivElement;
|
|
29
|
+
fontFamilyMenuRef: HTMLDivElement;
|
|
30
|
+
fontSizeMenuRef: HTMLDivElement;
|
|
31
|
+
colorMenuRef: HTMLDivElement;
|
|
32
|
+
colorPickerRef: HTMLInputElement;
|
|
33
|
+
highlightMenuRef: HTMLDivElement;
|
|
34
|
+
highlightPickerRef: HTMLInputElement;
|
|
35
|
+
scriptMenuRef: HTMLDivElement;
|
|
36
|
+
alignMenuRef: HTMLDivElement;
|
|
37
|
+
quoteMenuRef: HTMLDivElement;
|
|
38
|
+
exportMenuRef: HTMLDivElement;
|
|
39
|
+
pageRef: HTMLDivElement;
|
|
40
|
+
tableHeadingMenuRef: HTMLDivElement;
|
|
41
|
+
tableListMenuRef: HTMLDivElement;
|
|
42
|
+
tableColorMenuRef: HTMLDivElement;
|
|
43
|
+
tableHighlightMenuRef: HTMLDivElement;
|
|
44
|
+
tableActionColorMenuRef: HTMLDivElement;
|
|
45
|
+
highlightBlockColorMenuRef: HTMLDivElement;
|
|
46
|
+
highlightBlockSettingsMenuRef: HTMLDivElement;
|
|
47
|
+
countdownBubbleMenuRef: HTMLDivElement;
|
|
48
|
+
countdownBubbleEditButtonRef: HTMLButtonElement;
|
|
49
|
+
markdownImportInputRef: HTMLInputElement;
|
|
50
|
+
}, HTMLDivElement>;
|
|
51
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
maxHeight?: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
};
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): 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
|
+
maxHeight: string;
|
|
16
|
+
className: string;
|
|
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,7 @@
|
|
|
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
|
+
alignDropdownRef: HTMLDivElement;
|
|
4
|
+
videoRef: HTMLVideoElement;
|
|
5
|
+
inputRef: HTMLInputElement;
|
|
6
|
+
}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/core';
|
|
2
|
+
type UseRichTextEditorOptions = {
|
|
3
|
+
content: JSONContent;
|
|
4
|
+
editable: boolean;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
onUpdate: (value: JSONContent) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function useRichTextEditor(options: UseRichTextEditorOptions): import('vue').ShallowRef<import('@tiptap/vue-3').Editor | undefined, import('@tiptap/vue-3').Editor | undefined>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type EmojiCategoryId = 'recent' | 'smileys' | 'people' | 'animals' | 'food' | 'travel' | 'objects' | 'symbols';
|
|
2
|
+
export type EmojiItem = {
|
|
3
|
+
emoji: string;
|
|
4
|
+
label: string;
|
|
5
|
+
keywords: string[];
|
|
6
|
+
category: Exclude<EmojiCategoryId, 'recent'>;
|
|
7
|
+
};
|
|
8
|
+
export declare const emojiCategoryTabs: Array<{
|
|
9
|
+
id: EmojiCategoryId;
|
|
10
|
+
icon: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const emojiItems: EmojiItem[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
type IndentOptions = {
|
|
3
|
+
types: string[];
|
|
4
|
+
minLevel: number;
|
|
5
|
+
maxLevel: number;
|
|
6
|
+
stepEm: number;
|
|
7
|
+
};
|
|
8
|
+
declare module '@tiptap/core' {
|
|
9
|
+
interface Commands<ReturnType> {
|
|
10
|
+
indent: {
|
|
11
|
+
increaseIndent: () => ReturnType;
|
|
12
|
+
decreaseIndent: () => ReturnType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const Indent: Extension<IndentOptions, any>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OfficeCodeBlock: import('@tiptap/core').Node<import('@tiptap/extension-code-block-lowlight').CodeBlockLowlightOptions, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
type QuoteStyleOptions = {
|
|
3
|
+
defaultBorderColor: string;
|
|
4
|
+
defaultBackgroundColor: string;
|
|
5
|
+
};
|
|
6
|
+
type QuoteStyleAttrs = {
|
|
7
|
+
quoteBorderColor?: string;
|
|
8
|
+
quoteBackgroundColor?: string;
|
|
9
|
+
};
|
|
10
|
+
declare module '@tiptap/core' {
|
|
11
|
+
interface Commands<ReturnType> {
|
|
12
|
+
quoteStyle: {
|
|
13
|
+
setQuoteStyle: (attributes: QuoteStyleAttrs) => ReturnType;
|
|
14
|
+
resetQuoteStyle: () => ReturnType;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export declare const QuoteStyle: Extension<QuoteStyleOptions, any>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
type TextAlignValue = 'left' | 'center' | 'right';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
textAlign: {
|
|
6
|
+
setTextAlign: (alignment: TextAlignValue) => ReturnType;
|
|
7
|
+
unsetTextAlign: () => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const TextAlign: Extension<any, any>;
|
|
12
|
+
export {};
|