@norio-office/rich-text 0.6.0 → 0.7.1
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 +819 -249
- package/dist/components/BlockColorPanel.vue.d.ts +21 -0
- package/dist/components/ColorPalettePanel.vue.d.ts +13 -0
- package/dist/components/FormulaEditorDialog.vue.d.ts +2 -2
- package/dist/components/ImageBlockView.vue.d.ts +3 -0
- package/dist/components/RichTextEditor.vue.d.ts +19 -14
- package/dist/components/RichTextOutline.vue.d.ts +2 -2
- package/dist/components/TableThemePanel.vue.d.ts +25 -0
- package/dist/components/TextSelectionMenu.vue.d.ts +56 -0
- package/dist/composables/useNodeViewEditable.d.ts +2 -0
- package/dist/extensions/styled-horizontal-rule.d.ts +1 -0
- package/dist/extensions/themed-table.d.ts +1 -0
- package/dist/feature-codes.d.ts +45 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8536 -6934
- package/dist/index.umd.cjs +1865 -1394
- package/dist/style.css +1 -1
- package/dist/types.d.ts +13 -4
- package/dist/utils/color-palette.d.ts +2 -0
- package/dist/utils/divider.d.ts +13 -0
- package/dist/utils/table-theme.d.ts +44 -0
- package/package.json +2 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { JSONContent } from '@tiptap/core';
|
|
2
|
+
import { RichTextEditorExportItemKey, RichTextEditorCode, RichTextEditorFeatureItemKey, RichTextEditorInsertMenuItemKey, RichTextEditorOutlinePlacement, RichTextEditorToolbarActionKey } from './feature-codes';
|
|
3
|
+
export type { RichTextEditorExportItemKey, RichTextEditorCode, RichTextEditorFeatureCode, RichTextEditorFeatureItemKey, RichTextEditorInsertMenuItemKey, RichTextEditorOutlinePlacement, RichTextEditorToolbarActionKey, } from './feature-codes';
|
|
2
4
|
export type RichTextEditorProps = {
|
|
3
5
|
modelValue?: JSONContent | null;
|
|
4
6
|
documentName?: string;
|
|
5
7
|
editable?: boolean;
|
|
6
8
|
mode?: 'edit' | 'preview';
|
|
9
|
+
showToolbar?: boolean;
|
|
7
10
|
watermark?: RichTextEditorWatermarkOptions | null;
|
|
8
11
|
showOutline?: boolean;
|
|
9
|
-
outlinePlacement?:
|
|
12
|
+
outlinePlacement?: RichTextEditorOutlinePlacement;
|
|
10
13
|
messages?: RichTextEditorMessages | null;
|
|
14
|
+
featureCodes?: RichTextEditorCode[] | null;
|
|
15
|
+
enabledFeatureItems?: RichTextEditorFeatureItemKey[] | null;
|
|
11
16
|
enabledExportItems?: RichTextEditorExportItemKey[] | null;
|
|
12
17
|
enabledInsertMenuItems?: RichTextEditorInsertMenuItemKey[] | null;
|
|
13
18
|
enabledToolbarActions?: RichTextEditorToolbarActionKey[] | null;
|
|
@@ -36,9 +41,6 @@ export type RichTextEditorWatermarkOptions = {
|
|
|
36
41
|
rotate?: number;
|
|
37
42
|
showInEdit?: boolean;
|
|
38
43
|
};
|
|
39
|
-
export type RichTextEditorExportItemKey = 'pdf' | 'html' | 'image' | 'print';
|
|
40
|
-
export type RichTextEditorInsertMenuItemKey = 'image' | 'video' | 'table' | 'local-file' | 'columns' | 'highlight-block' | 'date' | 'code-block' | 'formula' | 'blockquote' | 'emoji' | 'link' | 'divider' | 'countdown' | 'markdown-import';
|
|
41
|
-
export type RichTextEditorToolbarActionKey = 'blockquote';
|
|
42
44
|
export type RichTextEditorCollaborationDocument = {
|
|
43
45
|
getXmlFragment: (field: string) => unknown;
|
|
44
46
|
};
|
|
@@ -87,6 +89,7 @@ export type RichTextEditorUploadInput = {
|
|
|
87
89
|
kind: RichTextEditorUploadKind;
|
|
88
90
|
};
|
|
89
91
|
export type RichTextEditorUploadResult = {
|
|
92
|
+
assetId?: string;
|
|
90
93
|
url: string;
|
|
91
94
|
name?: string;
|
|
92
95
|
size?: number;
|
|
@@ -188,14 +191,18 @@ export type RichTextEditorCommentResolvePayload = {
|
|
|
188
191
|
resolved: boolean;
|
|
189
192
|
};
|
|
190
193
|
export type RichTextEditorImagePayload = {
|
|
194
|
+
assetId?: string;
|
|
191
195
|
src: string;
|
|
192
196
|
alt?: string;
|
|
193
197
|
name?: string;
|
|
194
198
|
description?: string;
|
|
199
|
+
descriptionVisible?: boolean;
|
|
195
200
|
link?: string;
|
|
201
|
+
linkTarget?: '_blank' | '_self';
|
|
196
202
|
rotation?: number;
|
|
197
203
|
};
|
|
198
204
|
export type RichTextEditorVideoPayload = {
|
|
205
|
+
assetId?: string;
|
|
199
206
|
src: string;
|
|
200
207
|
name?: string;
|
|
201
208
|
description?: string;
|
|
@@ -205,6 +212,7 @@ export type RichTextEditorVideoPayload = {
|
|
|
205
212
|
height?: number;
|
|
206
213
|
};
|
|
207
214
|
export type RichTextEditorFilePayload = {
|
|
215
|
+
assetId?: string;
|
|
208
216
|
url: string;
|
|
209
217
|
name: string;
|
|
210
218
|
displayMode?: 'text' | 'card' | 'preview';
|
|
@@ -213,6 +221,7 @@ export type RichTextEditorFilePayload = {
|
|
|
213
221
|
height?: number;
|
|
214
222
|
};
|
|
215
223
|
export type RichTextEditorLocalFilePayload = {
|
|
224
|
+
assetId?: string;
|
|
216
225
|
url: string;
|
|
217
226
|
name: string;
|
|
218
227
|
size?: number;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const colorGrid: readonly [readonly ["#FFFFFF", "#16181D", "#4C5563", "#2F6BFF", "#1DA1F2", "#19B36B", "#F2573F", "#FF8B24", "#F7C200", "#9333EA"], readonly ["#F4F5F7", "#D9DEE7", "#C2C9D6", "#DDE9FF", "#D6EFFB", "#D8F4E5", "#FDE1DD", "#FFE9D2", "#FFF3C4", "#F1D8FF"], readonly ["#E6E8EC", "#BFC6D4", "#A8B1C4", "#BED3FF", "#B9E5F8", "#B8ECD2", "#F9C3BC", "#FFD6AC", "#FFE58C", "#E4BCFF"], readonly ["#D1D5DB", "#9CA3AF", "#6B7280", "#8BB2FF", "#86D3F3", "#7DDEAB", "#F69B8F", "#FFBB79", "#F9D45C", "#CE97FF"], readonly ["#9AA4B2", "#4B5563", "#374151", "#4C7DFF", "#2BAFE3", "#22C55E", "#EF6B59", "#F59E0B", "#D4A500", "#A855F7"], readonly ["#6B7280", "#111827", "#1F2937", "#1D4ED8", "#1473C5", "#15803D", "#DC2626", "#C56A06", "#A16207", "#6B21A8"]];
|
|
2
|
+
export declare const standardColors: string[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const dividerDefaultColor = "#dfe5ee";
|
|
2
|
+
export declare const dividerStyles: readonly [{
|
|
3
|
+
readonly value: "solid";
|
|
4
|
+
readonly label: "实线";
|
|
5
|
+
}, {
|
|
6
|
+
readonly value: "dashed";
|
|
7
|
+
readonly label: "虚线";
|
|
8
|
+
}, {
|
|
9
|
+
readonly value: "dotted";
|
|
10
|
+
readonly label: "点状线";
|
|
11
|
+
}];
|
|
12
|
+
export declare function normalizeDividerStyle(value: unknown): "dashed" | "dotted" | "solid";
|
|
13
|
+
export declare function normalizeDividerColor(value: unknown): string | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type TableThemeColors = {
|
|
2
|
+
header: string;
|
|
3
|
+
odd: string;
|
|
4
|
+
even: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const tableThemePresets: readonly [{
|
|
7
|
+
readonly id: "blue";
|
|
8
|
+
readonly name: "经典蓝";
|
|
9
|
+
readonly header: "#1670d2";
|
|
10
|
+
readonly odd: "#e8f2ff";
|
|
11
|
+
readonly even: "#ffffff";
|
|
12
|
+
}, {
|
|
13
|
+
readonly id: "green";
|
|
14
|
+
readonly name: "清新绿";
|
|
15
|
+
readonly header: "#21864b";
|
|
16
|
+
readonly odd: "#e7f5ec";
|
|
17
|
+
readonly even: "#ffffff";
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: "purple";
|
|
20
|
+
readonly name: "优雅紫";
|
|
21
|
+
readonly header: "#7950c5";
|
|
22
|
+
readonly odd: "#f0eafa";
|
|
23
|
+
readonly even: "#ffffff";
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "orange";
|
|
26
|
+
readonly name: "活力橙";
|
|
27
|
+
readonly header: "#c75312";
|
|
28
|
+
readonly odd: "#fff0e5";
|
|
29
|
+
readonly even: "#ffffff";
|
|
30
|
+
}, {
|
|
31
|
+
readonly id: "pink";
|
|
32
|
+
readonly name: "玫瑰粉";
|
|
33
|
+
readonly header: "#c9346d";
|
|
34
|
+
readonly odd: "#fceaf1";
|
|
35
|
+
readonly even: "#ffffff";
|
|
36
|
+
}, {
|
|
37
|
+
readonly id: "gray";
|
|
38
|
+
readonly name: "简约灰";
|
|
39
|
+
readonly header: "#586574";
|
|
40
|
+
readonly odd: "#edf0f3";
|
|
41
|
+
readonly even: "#ffffff";
|
|
42
|
+
}];
|
|
43
|
+
export declare function normalizeTableTheme(value: unknown): TableThemeColors | null;
|
|
44
|
+
export declare function getTableThemeHTMLAttributes(value: unknown): Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norio-office/rich-text",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "A reusable Vue 3 rich text editor component built with Tiptap 3.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@tiptap/extension-collaboration": "^3.22.2",
|
|
44
44
|
"@tiptap/extension-collaboration-caret": "^3.22.2",
|
|
45
45
|
"@tiptap/extension-font-family": "^3.22.1",
|
|
46
|
+
"@tiptap/extension-horizontal-rule": "^3.22.1",
|
|
46
47
|
"@tiptap/extension-placeholder": "^3.22.1",
|
|
47
48
|
"@tiptap/extension-subscript": "^3.22.1",
|
|
48
49
|
"@tiptap/extension-superscript": "^3.22.1",
|