@agilehub/agile-editor 1.8.0 → 1.8.2
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/dist/agile-editor.css +1 -1
- package/dist/agile-editor.js +7935 -6907
- package/dist/{i18n-DCR9QpaV.js → i18n-DID6uqiw.js} +33 -1
- package/dist/types/components/editor/thousands-separator-dialog.vue.d.ts +3 -0
- package/dist/types/components/index.vue.d.ts +48 -0
- package/dist/types/components/menus/toolbar/tools/thousands-separator.vue.d.ts +3 -0
- package/dist/types/components/toolbar/classic.vue.d.ts +10 -10
- package/dist/types/components/toolbar/ribbon.vue.d.ts +10 -10
- package/dist/types/composables/i18n.d.ts +48 -0
- package/dist/types/extensions/bookmark-anchor.d.ts +3 -0
- package/dist/types/extensions/bookmark-transaction.d.ts +2 -0
- package/dist/types/extensions/callout/paragraph.d.ts +2 -0
- package/dist/types/extensions/font-style.d.ts +2 -0
- package/dist/types/extensions/imported-style-normalizer.d.ts +26 -0
- package/dist/types/extensions/indent.d.ts +1 -0
- package/dist/types/extensions/index.d.ts +1 -1
- package/dist/types/extensions/thousands-separator.d.ts +60 -0
- package/dist/types/i18n.d.ts +48 -0
- package/dist/types/utils/default-paragraph-indent.d.ts +4 -0
- package/dist/types/utils/font-size.d.ts +13 -0
- package/dist/types/utils/inline-style.d.ts +8 -0
- package/dist/types/utils/style-mark-update.d.ts +8 -0
- package/dist/types/utils/style-target.d.ts +1 -0
- package/dist/types/utils/text-style-cleanup.d.ts +16 -0
- package/dist/types/utils/thousands-separator.d.ts +15 -0
- package/dist/{viewer-CyuLA7YS.js → viewer-CoKl4QoQ.js} +2 -2
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @agilehub/agile-editor 1.8.
|
|
2
|
+
* @agilehub/agile-editor 1.8.2
|
|
3
3
|
* @license Apache-2.0
|
|
4
4
|
* @author undefined undefined
|
|
5
5
|
* @see undefined
|
|
@@ -729,6 +729,20 @@ var o = ["width", "height"], s = ["xlink:href", "fill"], c = /* @__PURE__ */ n({
|
|
|
729
729
|
text: "Chinese Case",
|
|
730
730
|
tip: "Chinese Case Conversion"
|
|
731
731
|
},
|
|
732
|
+
"thousands-separator": {
|
|
733
|
+
text: "Thousands Separator",
|
|
734
|
+
tip: "Format the selected number with thousands separators",
|
|
735
|
+
edit: "Edit Thousands Separator",
|
|
736
|
+
delete: "Remove Thousands Separator",
|
|
737
|
+
separator: "Separator",
|
|
738
|
+
space: "Space",
|
|
739
|
+
comma: "Comma",
|
|
740
|
+
"group-size": "Digits per Group",
|
|
741
|
+
"allow-wrap": "Allow Line Breaks",
|
|
742
|
+
preview: "Preview",
|
|
743
|
+
"selection-required": "Select a number first",
|
|
744
|
+
"invalid-number": "Select a valid number"
|
|
745
|
+
},
|
|
732
746
|
math: {
|
|
733
747
|
text: "Mathematics",
|
|
734
748
|
insert: "Insert LaTeX Math",
|
|
@@ -1123,8 +1137,10 @@ var o = ["width", "height"], s = ["xlink:href", "fill"], c = /* @__PURE__ */ n({
|
|
|
1123
1137
|
background: "Background Color",
|
|
1124
1138
|
border: "Border Settings",
|
|
1125
1139
|
borderColor: "Border Color",
|
|
1140
|
+
borderRadius: "Corner Radius",
|
|
1126
1141
|
borderStyle: "Border Style",
|
|
1127
1142
|
noBorder: "No Border",
|
|
1143
|
+
showBorder: "Show Border",
|
|
1128
1144
|
writingMode: "Writing Mode",
|
|
1129
1145
|
horizontalTb: "Horizontal Text",
|
|
1130
1146
|
verticalLr: "Vertical Text (Left to Right)",
|
|
@@ -2099,6 +2115,20 @@ var o = ["width", "height"], s = ["xlink:href", "fill"], c = /* @__PURE__ */ n({
|
|
|
2099
2115
|
text: "中文大小写",
|
|
2100
2116
|
tip: "中文大小写"
|
|
2101
2117
|
},
|
|
2118
|
+
"thousands-separator": {
|
|
2119
|
+
text: "千分位转换",
|
|
2120
|
+
tip: "将选中数字转换为千分位格式",
|
|
2121
|
+
edit: "编辑千分位格式",
|
|
2122
|
+
delete: "删除千分位格式",
|
|
2123
|
+
separator: "分割方式",
|
|
2124
|
+
space: "空格",
|
|
2125
|
+
comma: "逗号",
|
|
2126
|
+
"group-size": "数字间隔",
|
|
2127
|
+
"allow-wrap": "允许换行",
|
|
2128
|
+
preview: "效果预览",
|
|
2129
|
+
"selection-required": "请先选中数字",
|
|
2130
|
+
"invalid-number": "请选择有效的数字"
|
|
2131
|
+
},
|
|
2102
2132
|
math: {
|
|
2103
2133
|
text: "公式",
|
|
2104
2134
|
insert: "插入 LaTex 公式",
|
|
@@ -2498,8 +2528,10 @@ var o = ["width", "height"], s = ["xlink:href", "fill"], c = /* @__PURE__ */ n({
|
|
|
2498
2528
|
background: "背景颜色",
|
|
2499
2529
|
border: "边框设置",
|
|
2500
2530
|
borderColor: "边框颜色",
|
|
2531
|
+
borderRadius: "圆角",
|
|
2501
2532
|
borderStyle: "边框样式",
|
|
2502
2533
|
noBorder: "不显示边框",
|
|
2534
|
+
showBorder: "显示边框",
|
|
2503
2535
|
writingMode: "文字排列方式",
|
|
2504
2536
|
horizontalTb: "默认",
|
|
2505
2537
|
verticalLr: "垂直排列(从左到右)",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -748,6 +748,20 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
748
748
|
text: string;
|
|
749
749
|
tip: string;
|
|
750
750
|
};
|
|
751
|
+
"thousands-separator": {
|
|
752
|
+
text: string;
|
|
753
|
+
tip: string;
|
|
754
|
+
edit: string;
|
|
755
|
+
delete: string;
|
|
756
|
+
separator: string;
|
|
757
|
+
space: string;
|
|
758
|
+
comma: string;
|
|
759
|
+
"group-size": string;
|
|
760
|
+
"allow-wrap": string;
|
|
761
|
+
preview: string;
|
|
762
|
+
"selection-required": string;
|
|
763
|
+
"invalid-number": string;
|
|
764
|
+
};
|
|
751
765
|
math: {
|
|
752
766
|
text: string;
|
|
753
767
|
insert: string;
|
|
@@ -1146,8 +1160,10 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
1146
1160
|
background: string;
|
|
1147
1161
|
border: string;
|
|
1148
1162
|
borderColor: string;
|
|
1163
|
+
borderRadius: string;
|
|
1149
1164
|
borderStyle: string;
|
|
1150
1165
|
noBorder: string;
|
|
1166
|
+
showBorder: string;
|
|
1151
1167
|
writingMode: string;
|
|
1152
1168
|
horizontalTb: string;
|
|
1153
1169
|
verticalLr: string;
|
|
@@ -2131,6 +2147,20 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
2131
2147
|
text: string;
|
|
2132
2148
|
tip: string;
|
|
2133
2149
|
};
|
|
2150
|
+
"thousands-separator": {
|
|
2151
|
+
text: string;
|
|
2152
|
+
tip: string;
|
|
2153
|
+
edit: string;
|
|
2154
|
+
delete: string;
|
|
2155
|
+
separator: string;
|
|
2156
|
+
space: string;
|
|
2157
|
+
comma: string;
|
|
2158
|
+
"group-size": string;
|
|
2159
|
+
"allow-wrap": string;
|
|
2160
|
+
preview: string;
|
|
2161
|
+
"selection-required": string;
|
|
2162
|
+
"invalid-number": string;
|
|
2163
|
+
};
|
|
2134
2164
|
math: {
|
|
2135
2165
|
text: string;
|
|
2136
2166
|
insert: string;
|
|
@@ -2530,8 +2560,10 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
2530
2560
|
background: string;
|
|
2531
2561
|
border: string;
|
|
2532
2562
|
borderColor: string;
|
|
2563
|
+
borderRadius: string;
|
|
2533
2564
|
borderStyle: string;
|
|
2534
2565
|
noBorder: string;
|
|
2566
|
+
showBorder: string;
|
|
2535
2567
|
writingMode: string;
|
|
2536
2568
|
horizontalTb: string;
|
|
2537
2569
|
verticalLr: string;
|
|
@@ -3502,6 +3534,20 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3502
3534
|
text: string;
|
|
3503
3535
|
tip: string;
|
|
3504
3536
|
};
|
|
3537
|
+
"thousands-separator": {
|
|
3538
|
+
text: string;
|
|
3539
|
+
tip: string;
|
|
3540
|
+
edit: string;
|
|
3541
|
+
delete: string;
|
|
3542
|
+
separator: string;
|
|
3543
|
+
space: string;
|
|
3544
|
+
comma: string;
|
|
3545
|
+
"group-size": string;
|
|
3546
|
+
"allow-wrap": string;
|
|
3547
|
+
preview: string;
|
|
3548
|
+
"selection-required": string;
|
|
3549
|
+
"invalid-number": string;
|
|
3550
|
+
};
|
|
3505
3551
|
math: {
|
|
3506
3552
|
text: string;
|
|
3507
3553
|
insert: string;
|
|
@@ -3901,8 +3947,10 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
3901
3947
|
background: string;
|
|
3902
3948
|
border: string;
|
|
3903
3949
|
borderColor: string;
|
|
3950
|
+
borderRadius: string;
|
|
3904
3951
|
borderStyle: string;
|
|
3905
3952
|
noBorder: string;
|
|
3953
|
+
showBorder: string;
|
|
3906
3954
|
writingMode: string;
|
|
3907
3955
|
horizontalTb: string;
|
|
3908
3956
|
verticalLr: string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -5,15 +5,15 @@ declare var __VLS_172: {
|
|
|
5
5
|
toolbarMode: string;
|
|
6
6
|
}, __VLS_401: {
|
|
7
7
|
toolbarMode: string;
|
|
8
|
-
},
|
|
8
|
+
}, __VLS_463: {
|
|
9
9
|
toolbarMode: string;
|
|
10
|
-
},
|
|
10
|
+
}, __VLS_505: {
|
|
11
11
|
toolbarMode: string;
|
|
12
|
-
},
|
|
12
|
+
}, __VLS_507: {
|
|
13
13
|
toolbarMode: string;
|
|
14
|
-
},
|
|
14
|
+
}, __VLS_509: {
|
|
15
15
|
toolbarMode: string;
|
|
16
|
-
},
|
|
16
|
+
}, __VLS_511: {
|
|
17
17
|
toolbarMode: string;
|
|
18
18
|
};
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
@@ -23,15 +23,15 @@ type __VLS_Slots = {} & {
|
|
|
23
23
|
} & {
|
|
24
24
|
toolbar_table?: (props: typeof __VLS_401) => any;
|
|
25
25
|
} & {
|
|
26
|
-
toolbar_tools?: (props: typeof
|
|
26
|
+
toolbar_tools?: (props: typeof __VLS_463) => any;
|
|
27
27
|
} & {
|
|
28
|
-
toolbar_view?: (props: typeof
|
|
28
|
+
toolbar_view?: (props: typeof __VLS_505) => any;
|
|
29
29
|
} & {
|
|
30
|
-
toolbar_review?: (props: typeof
|
|
30
|
+
toolbar_review?: (props: typeof __VLS_507) => any;
|
|
31
31
|
} & {
|
|
32
|
-
toolbar_extension?: (props: typeof
|
|
32
|
+
toolbar_extension?: (props: typeof __VLS_509) => any;
|
|
33
33
|
} & {
|
|
34
|
-
toolbar_enhancement?: (props: typeof
|
|
34
|
+
toolbar_enhancement?: (props: typeof __VLS_511) => any;
|
|
35
35
|
};
|
|
36
36
|
declare const __VLS_base: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
37
37
|
menus: {
|
|
@@ -5,15 +5,15 @@ declare var __VLS_173: {
|
|
|
5
5
|
toolbarMode: string;
|
|
6
6
|
}, __VLS_402: {
|
|
7
7
|
toolbarMode: string;
|
|
8
|
-
},
|
|
8
|
+
}, __VLS_464: {
|
|
9
9
|
toolbarMode: string;
|
|
10
|
-
},
|
|
10
|
+
}, __VLS_506: {
|
|
11
11
|
toolbarMode: string;
|
|
12
|
-
},
|
|
12
|
+
}, __VLS_508: {
|
|
13
13
|
toolbarMode: string;
|
|
14
|
-
},
|
|
14
|
+
}, __VLS_510: {
|
|
15
15
|
toolbarMode: string;
|
|
16
|
-
},
|
|
16
|
+
}, __VLS_512: {
|
|
17
17
|
toolbarMode: string;
|
|
18
18
|
};
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
@@ -23,15 +23,15 @@ type __VLS_Slots = {} & {
|
|
|
23
23
|
} & {
|
|
24
24
|
toolbar_table?: (props: typeof __VLS_402) => any;
|
|
25
25
|
} & {
|
|
26
|
-
toolbar_tools?: (props: typeof
|
|
26
|
+
toolbar_tools?: (props: typeof __VLS_464) => any;
|
|
27
27
|
} & {
|
|
28
|
-
toolbar_view?: (props: typeof
|
|
28
|
+
toolbar_view?: (props: typeof __VLS_506) => any;
|
|
29
29
|
} & {
|
|
30
|
-
toolbar_review?: (props: typeof
|
|
30
|
+
toolbar_review?: (props: typeof __VLS_508) => any;
|
|
31
31
|
} & {
|
|
32
|
-
toolbar_extension?: (props: typeof
|
|
32
|
+
toolbar_extension?: (props: typeof __VLS_510) => any;
|
|
33
33
|
} & {
|
|
34
|
-
toolbar_enhancement?: (props: typeof
|
|
34
|
+
toolbar_enhancement?: (props: typeof __VLS_512) => any;
|
|
35
35
|
};
|
|
36
36
|
declare const __VLS_base: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
37
37
|
menus: {
|
|
@@ -704,6 +704,20 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
|
|
|
704
704
|
text: string;
|
|
705
705
|
tip: string;
|
|
706
706
|
};
|
|
707
|
+
"thousands-separator": {
|
|
708
|
+
text: string;
|
|
709
|
+
tip: string;
|
|
710
|
+
edit: string;
|
|
711
|
+
delete: string;
|
|
712
|
+
separator: string;
|
|
713
|
+
space: string;
|
|
714
|
+
comma: string;
|
|
715
|
+
"group-size": string;
|
|
716
|
+
"allow-wrap": string;
|
|
717
|
+
preview: string;
|
|
718
|
+
"selection-required": string;
|
|
719
|
+
"invalid-number": string;
|
|
720
|
+
};
|
|
707
721
|
math: {
|
|
708
722
|
text: string;
|
|
709
723
|
insert: string;
|
|
@@ -1102,8 +1116,10 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
|
|
|
1102
1116
|
background: string;
|
|
1103
1117
|
border: string;
|
|
1104
1118
|
borderColor: string;
|
|
1119
|
+
borderRadius: string;
|
|
1105
1120
|
borderStyle: string;
|
|
1106
1121
|
noBorder: string;
|
|
1122
|
+
showBorder: string;
|
|
1107
1123
|
writingMode: string;
|
|
1108
1124
|
horizontalTb: string;
|
|
1109
1125
|
verticalLr: string;
|
|
@@ -2087,6 +2103,20 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
|
|
|
2087
2103
|
text: string;
|
|
2088
2104
|
tip: string;
|
|
2089
2105
|
};
|
|
2106
|
+
"thousands-separator": {
|
|
2107
|
+
text: string;
|
|
2108
|
+
tip: string;
|
|
2109
|
+
edit: string;
|
|
2110
|
+
delete: string;
|
|
2111
|
+
separator: string;
|
|
2112
|
+
space: string;
|
|
2113
|
+
comma: string;
|
|
2114
|
+
"group-size": string;
|
|
2115
|
+
"allow-wrap": string;
|
|
2116
|
+
preview: string;
|
|
2117
|
+
"selection-required": string;
|
|
2118
|
+
"invalid-number": string;
|
|
2119
|
+
};
|
|
2090
2120
|
math: {
|
|
2091
2121
|
text: string;
|
|
2092
2122
|
insert: string;
|
|
@@ -2486,8 +2516,10 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
|
|
|
2486
2516
|
background: string;
|
|
2487
2517
|
border: string;
|
|
2488
2518
|
borderColor: string;
|
|
2519
|
+
borderRadius: string;
|
|
2489
2520
|
borderStyle: string;
|
|
2490
2521
|
noBorder: string;
|
|
2522
|
+
showBorder: string;
|
|
2491
2523
|
writingMode: string;
|
|
2492
2524
|
horizontalTb: string;
|
|
2493
2525
|
verticalLr: string;
|
|
@@ -3458,6 +3490,20 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
|
|
|
3458
3490
|
text: string;
|
|
3459
3491
|
tip: string;
|
|
3460
3492
|
};
|
|
3493
|
+
"thousands-separator": {
|
|
3494
|
+
text: string;
|
|
3495
|
+
tip: string;
|
|
3496
|
+
edit: string;
|
|
3497
|
+
delete: string;
|
|
3498
|
+
separator: string;
|
|
3499
|
+
space: string;
|
|
3500
|
+
comma: string;
|
|
3501
|
+
"group-size": string;
|
|
3502
|
+
"allow-wrap": string;
|
|
3503
|
+
preview: string;
|
|
3504
|
+
"selection-required": string;
|
|
3505
|
+
"invalid-number": string;
|
|
3506
|
+
};
|
|
3461
3507
|
math: {
|
|
3462
3508
|
text: string;
|
|
3463
3509
|
insert: string;
|
|
@@ -3857,8 +3903,10 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
|
|
|
3857
3903
|
background: string;
|
|
3858
3904
|
border: string;
|
|
3859
3905
|
borderColor: string;
|
|
3906
|
+
borderRadius: string;
|
|
3860
3907
|
borderStyle: string;
|
|
3861
3908
|
noBorder: string;
|
|
3909
|
+
showBorder: string;
|
|
3862
3910
|
writingMode: string;
|
|
3863
3911
|
horizontalTb: string;
|
|
3864
3912
|
verticalLr: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
2
|
import type { Transaction } from '@tiptap/pm/state';
|
|
3
|
+
export declare const rangeContainsMark: (doc: ProseMirrorNode, from: number, to: number, markName: string) => boolean;
|
|
4
|
+
export declare const transactionTouchesMark: (transaction: Transaction, markName: string, includeBoundaries?: boolean) => boolean;
|
|
3
5
|
export declare const rangeContainsBookmark: (doc: ProseMirrorNode, from: number, to: number) => boolean;
|
|
4
6
|
export declare const transactionTouchesBookmark: (transaction: Transaction) => boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
+
type TextCleanup = {
|
|
4
|
+
attributes: Set<string>;
|
|
5
|
+
from: number;
|
|
6
|
+
properties: Set<string>;
|
|
7
|
+
to: number;
|
|
8
|
+
};
|
|
9
|
+
type NodeCleanup = {
|
|
10
|
+
node: ProseMirrorNode;
|
|
11
|
+
position: number;
|
|
12
|
+
properties: Set<string>;
|
|
13
|
+
};
|
|
14
|
+
export declare const collectImportedTextStyleCleanups: (oldDoc: ProseMirrorNode, newDoc: ProseMirrorNode, ranges: Array<{
|
|
15
|
+
newRange: {
|
|
16
|
+
from: number;
|
|
17
|
+
to: number;
|
|
18
|
+
};
|
|
19
|
+
oldRange: any;
|
|
20
|
+
}>) => TextCleanup[];
|
|
21
|
+
export declare const collectImportedNodeStyleCleanups: (oldDoc: ProseMirrorNode, newDoc: ProseMirrorNode, ranges: Array<{
|
|
22
|
+
from: number;
|
|
23
|
+
to: number;
|
|
24
|
+
}>) => NodeCleanup[];
|
|
25
|
+
declare const _default: Extension<any, any>;
|
|
26
|
+
export default _default;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* 注意事项:表格内段落默认不缩进,但允许用户手动设置。
|
|
5
5
|
*/
|
|
6
6
|
import { Extension } from '@tiptap/core';
|
|
7
|
+
export declare const resolveIndentAttributes: (attrs: any, indent: any, minLevel: any, config: any, fallbackUnit?: string) => any;
|
|
7
8
|
declare const _default: Extension<{
|
|
8
9
|
types: string[];
|
|
9
10
|
minLevel: number;
|
|
@@ -9,7 +9,7 @@ export declare const getDefaultExtensions: ({ container, options, uploadFileMap
|
|
|
9
9
|
container: any;
|
|
10
10
|
options: any;
|
|
11
11
|
uploadFileMap: any;
|
|
12
|
-
}) => (import("@tiptap/core").Extension<any, any> | import("@tiptap/core").
|
|
12
|
+
}) => (import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Node<any, any> | import("@tiptap/core").Mark<any, any>)[];
|
|
13
13
|
/**
|
|
14
14
|
* 根据文档配置决定是否启用 Markdown 输入和粘贴规则。
|
|
15
15
|
* @param options - 包含 Markdown 开关的响应式编辑器配置。
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
import { type ThousandsSeparator } from '@/utils/thousands-separator';
|
|
3
|
+
export interface ThousandsSeparatorFormat {
|
|
4
|
+
original: string;
|
|
5
|
+
separator: ThousandsSeparator;
|
|
6
|
+
groupSize: number;
|
|
7
|
+
allowWrap: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ThousandsSeparatorDialogState extends ThousandsSeparatorFormat {
|
|
10
|
+
visible: boolean;
|
|
11
|
+
from: number | null;
|
|
12
|
+
to: number | null;
|
|
13
|
+
session: number;
|
|
14
|
+
}
|
|
15
|
+
export interface FormatThousandsOptions {
|
|
16
|
+
from?: number;
|
|
17
|
+
to?: number;
|
|
18
|
+
separator?: ThousandsSeparator;
|
|
19
|
+
groupSize?: number;
|
|
20
|
+
allowWrap?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare module '@tiptap/core' {
|
|
23
|
+
interface Storage {
|
|
24
|
+
thousandsSeparator: {
|
|
25
|
+
dialog: ThousandsSeparatorDialogState;
|
|
26
|
+
openEditor: (range: {
|
|
27
|
+
from: number;
|
|
28
|
+
to: number;
|
|
29
|
+
}, format: ThousandsSeparatorFormat) => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface Commands<ReturnType> {
|
|
33
|
+
thousandsSeparator: {
|
|
34
|
+
formatThousands: (options?: FormatThousandsOptions) => ReturnType;
|
|
35
|
+
removeThousandsFormat: (range?: {
|
|
36
|
+
from: number;
|
|
37
|
+
to: number;
|
|
38
|
+
}) => ReturnType;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
declare const _default: Mark<{
|
|
43
|
+
HTMLAttributes: {};
|
|
44
|
+
}, {
|
|
45
|
+
dialog: {
|
|
46
|
+
visible: boolean;
|
|
47
|
+
from: number | null;
|
|
48
|
+
to: number | null;
|
|
49
|
+
session: number;
|
|
50
|
+
original: string;
|
|
51
|
+
separator: ThousandsSeparator;
|
|
52
|
+
groupSize: number;
|
|
53
|
+
allowWrap: boolean;
|
|
54
|
+
};
|
|
55
|
+
openEditor(range: {
|
|
56
|
+
from: number;
|
|
57
|
+
to: number;
|
|
58
|
+
}, format: ThousandsSeparatorFormat): void;
|
|
59
|
+
}>;
|
|
60
|
+
export default _default;
|
package/dist/types/i18n.d.ts
CHANGED
|
@@ -691,6 +691,20 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
691
691
|
text: string;
|
|
692
692
|
tip: string;
|
|
693
693
|
};
|
|
694
|
+
"thousands-separator": {
|
|
695
|
+
text: string;
|
|
696
|
+
tip: string;
|
|
697
|
+
edit: string;
|
|
698
|
+
delete: string;
|
|
699
|
+
separator: string;
|
|
700
|
+
space: string;
|
|
701
|
+
comma: string;
|
|
702
|
+
"group-size": string;
|
|
703
|
+
"allow-wrap": string;
|
|
704
|
+
preview: string;
|
|
705
|
+
"selection-required": string;
|
|
706
|
+
"invalid-number": string;
|
|
707
|
+
};
|
|
694
708
|
math: {
|
|
695
709
|
text: string;
|
|
696
710
|
insert: string;
|
|
@@ -1089,8 +1103,10 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1089
1103
|
background: string;
|
|
1090
1104
|
border: string;
|
|
1091
1105
|
borderColor: string;
|
|
1106
|
+
borderRadius: string;
|
|
1092
1107
|
borderStyle: string;
|
|
1093
1108
|
noBorder: string;
|
|
1109
|
+
showBorder: string;
|
|
1094
1110
|
writingMode: string;
|
|
1095
1111
|
horizontalTb: string;
|
|
1096
1112
|
verticalLr: string;
|
|
@@ -2074,6 +2090,20 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
2074
2090
|
text: string;
|
|
2075
2091
|
tip: string;
|
|
2076
2092
|
};
|
|
2093
|
+
"thousands-separator": {
|
|
2094
|
+
text: string;
|
|
2095
|
+
tip: string;
|
|
2096
|
+
edit: string;
|
|
2097
|
+
delete: string;
|
|
2098
|
+
separator: string;
|
|
2099
|
+
space: string;
|
|
2100
|
+
comma: string;
|
|
2101
|
+
"group-size": string;
|
|
2102
|
+
"allow-wrap": string;
|
|
2103
|
+
preview: string;
|
|
2104
|
+
"selection-required": string;
|
|
2105
|
+
"invalid-number": string;
|
|
2106
|
+
};
|
|
2077
2107
|
math: {
|
|
2078
2108
|
text: string;
|
|
2079
2109
|
insert: string;
|
|
@@ -2473,8 +2503,10 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
2473
2503
|
background: string;
|
|
2474
2504
|
border: string;
|
|
2475
2505
|
borderColor: string;
|
|
2506
|
+
borderRadius: string;
|
|
2476
2507
|
borderStyle: string;
|
|
2477
2508
|
noBorder: string;
|
|
2509
|
+
showBorder: string;
|
|
2478
2510
|
writingMode: string;
|
|
2479
2511
|
horizontalTb: string;
|
|
2480
2512
|
verticalLr: string;
|
|
@@ -3445,6 +3477,20 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
3445
3477
|
text: string;
|
|
3446
3478
|
tip: string;
|
|
3447
3479
|
};
|
|
3480
|
+
"thousands-separator": {
|
|
3481
|
+
text: string;
|
|
3482
|
+
tip: string;
|
|
3483
|
+
edit: string;
|
|
3484
|
+
delete: string;
|
|
3485
|
+
separator: string;
|
|
3486
|
+
space: string;
|
|
3487
|
+
comma: string;
|
|
3488
|
+
"group-size": string;
|
|
3489
|
+
"allow-wrap": string;
|
|
3490
|
+
preview: string;
|
|
3491
|
+
"selection-required": string;
|
|
3492
|
+
"invalid-number": string;
|
|
3493
|
+
};
|
|
3448
3494
|
math: {
|
|
3449
3495
|
text: string;
|
|
3450
3496
|
insert: string;
|
|
@@ -3844,8 +3890,10 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
3844
3890
|
background: string;
|
|
3845
3891
|
border: string;
|
|
3846
3892
|
borderColor: string;
|
|
3893
|
+
borderRadius: string;
|
|
3847
3894
|
borderStyle: string;
|
|
3848
3895
|
noBorder: string;
|
|
3896
|
+
showBorder: string;
|
|
3849
3897
|
writingMode: string;
|
|
3850
3898
|
horizontalTb: string;
|
|
3851
3899
|
verticalLr: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Fragment } from '@tiptap/pm/model';
|
|
2
|
+
export declare const createZeroIndentParagraph: (schema: any) => any;
|
|
3
|
+
export declare const normalizeDefaultParagraphIndent: (content: Fragment) => Fragment;
|
|
4
|
+
export declare const resetParagraphIndent: (content: Fragment) => Fragment;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const FONT_SIZE_STEPS: readonly ["12px", "14px", "16px", "18px", "20px", "22px", "24px", "26px", "28px", "30px", "32px", "34px", "36px"];
|
|
2
|
+
/**
|
|
3
|
+
* 将 pt 字号按 1pt = 96/72px 换算为最接近的偶数像素。
|
|
4
|
+
* 非 pt 单位和不合法值保持原样。
|
|
5
|
+
*/
|
|
6
|
+
export declare const convertFontSizeToPx: (value: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* 按当前字号单位计算相邻字号。
|
|
9
|
+
*
|
|
10
|
+
* 绝对单位和关键字会映射到工具栏 px 档位;em、rem 和百分比按相对幅度
|
|
11
|
+
* 调整,避免导入的 pt 字号导致增大/减小按钮无响应。
|
|
12
|
+
*/
|
|
13
|
+
export declare const stepFontSize: (current: string | null | undefined, direction: 1 | -1, steps?: readonly string[]) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 从内联样式中移除指定 CSS 属性,保留其他声明及其顺序。
|
|
3
|
+
*
|
|
4
|
+
* 浏览器内使用 CSSStyleDeclaration 解析,避免破坏 data URI 等复杂值;无 DOM
|
|
5
|
+
* 环境使用等价的声明扫描逻辑,便于在 Node 单元测试中验证。
|
|
6
|
+
*/
|
|
7
|
+
export declare const removeInlineStyleProperties: (styleText: string | null | undefined, properties: string[]) => string;
|
|
8
|
+
export declare const setInlineStyleProperty: (styleText: string | null | undefined, property: string, value: string) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Transaction } from '@tiptap/pm/state';
|
|
2
|
+
export declare const updateMatchingMarkRanges: (transaction: Transaction, options: {
|
|
3
|
+
from: number;
|
|
4
|
+
markAttrs?: Record<string, unknown>;
|
|
5
|
+
markName: string;
|
|
6
|
+
nextAttrs: Record<string, unknown>;
|
|
7
|
+
to: number;
|
|
8
|
+
}) => number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Transaction } from '@tiptap/pm/state';
|
|
2
|
+
/**
|
|
3
|
+
* 清理选区内的重复文本样式声明。
|
|
4
|
+
*
|
|
5
|
+
* textStyle 和语义 mark 是权威样式;customStyle 与原始内联样式只保留其余
|
|
6
|
+
* 声明,避免导入文档中的旧样式覆盖菜单设置。
|
|
7
|
+
*/
|
|
8
|
+
export declare const stripTextStyleProperties: (transaction: Transaction, from: number, to: number, properties: string[]) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 清除 textStyle mark 上的指定属性。
|
|
11
|
+
*/
|
|
12
|
+
export declare const stripTextStyleMarkAttributes: (transaction: Transaction, from: number, to: number, attributes: string[]) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 清理块节点自身内联样式中的重复声明。
|
|
15
|
+
*/
|
|
16
|
+
export declare const stripNodeStyleProperties: (transaction: Transaction, from: number, to: number, properties: string[], nodeTypes?: string[]) => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ThousandsSeparator = 'space' | 'comma';
|
|
2
|
+
export interface ThousandsFormatOptions {
|
|
3
|
+
separator?: ThousandsSeparator;
|
|
4
|
+
groupSize?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const DEFAULT_THOUSANDS_SEPARATOR: ThousandsSeparator;
|
|
7
|
+
export declare const DEFAULT_THOUSANDS_GROUP_SIZE = 3;
|
|
8
|
+
export declare const MIN_THOUSANDS_GROUP_SIZE = 1;
|
|
9
|
+
export declare const MAX_THOUSANDS_GROUP_SIZE = 6;
|
|
10
|
+
export declare const normalizeThousandsSeparator: (value: unknown) => ThousandsSeparator;
|
|
11
|
+
export declare const normalizeThousandsGroupSize: (value: unknown) => number;
|
|
12
|
+
/** 去除已有千分位分隔符,并校验为单个整数或小数。 */
|
|
13
|
+
export declare const normalizeThousandsNumber: (value: unknown) => string;
|
|
14
|
+
/** 按指定分隔符和分组位数格式化数字。 */
|
|
15
|
+
export declare const formatThousandsNumber: (value: unknown, options?: ThousandsFormatOptions) => string;
|