@agilehub/agile-editor 1.8.0 → 1.8.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @agilehub/agile-editor 1.8.0
2
+ * @agilehub/agile-editor 1.8.1
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",
@@ -2099,6 +2113,20 @@ var o = ["width", "height"], s = ["xlink:href", "fill"], c = /* @__PURE__ */ n({
2099
2113
  text: "中文大小写",
2100
2114
  tip: "中文大小写"
2101
2115
  },
2116
+ "thousands-separator": {
2117
+ text: "千分位转换",
2118
+ tip: "将选中数字转换为千分位格式",
2119
+ edit: "编辑千分位格式",
2120
+ delete: "删除千分位格式",
2121
+ separator: "分割方式",
2122
+ space: "空格",
2123
+ comma: "逗号",
2124
+ "group-size": "数字间隔",
2125
+ "allow-wrap": "允许换行",
2126
+ preview: "效果预览",
2127
+ "selection-required": "请先选中数字",
2128
+ "invalid-number": "请选择有效的数字"
2129
+ },
2102
2130
  math: {
2103
2131
  text: "公式",
2104
2132
  insert: "插入 LaTex 公式",
@@ -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;
@@ -2131,6 +2145,20 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
2131
2145
  text: string;
2132
2146
  tip: string;
2133
2147
  };
2148
+ "thousands-separator": {
2149
+ text: string;
2150
+ tip: string;
2151
+ edit: string;
2152
+ delete: string;
2153
+ separator: string;
2154
+ space: string;
2155
+ comma: string;
2156
+ "group-size": string;
2157
+ "allow-wrap": string;
2158
+ preview: string;
2159
+ "selection-required": string;
2160
+ "invalid-number": string;
2161
+ };
2134
2162
  math: {
2135
2163
  text: string;
2136
2164
  insert: string;
@@ -3502,6 +3530,20 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
3502
3530
  text: string;
3503
3531
  tip: string;
3504
3532
  };
3533
+ "thousands-separator": {
3534
+ text: string;
3535
+ tip: string;
3536
+ edit: string;
3537
+ delete: string;
3538
+ separator: string;
3539
+ space: string;
3540
+ comma: string;
3541
+ "group-size": string;
3542
+ "allow-wrap": string;
3543
+ preview: string;
3544
+ "selection-required": string;
3545
+ "invalid-number": string;
3546
+ };
3505
3547
  math: {
3506
3548
  text: string;
3507
3549
  insert: 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
- }, __VLS_458: {
8
+ }, __VLS_463: {
9
9
  toolbarMode: string;
10
- }, __VLS_500: {
10
+ }, __VLS_505: {
11
11
  toolbarMode: string;
12
- }, __VLS_502: {
12
+ }, __VLS_507: {
13
13
  toolbarMode: string;
14
- }, __VLS_504: {
14
+ }, __VLS_509: {
15
15
  toolbarMode: string;
16
- }, __VLS_506: {
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 __VLS_458) => any;
26
+ toolbar_tools?: (props: typeof __VLS_463) => any;
27
27
  } & {
28
- toolbar_view?: (props: typeof __VLS_500) => any;
28
+ toolbar_view?: (props: typeof __VLS_505) => any;
29
29
  } & {
30
- toolbar_review?: (props: typeof __VLS_502) => any;
30
+ toolbar_review?: (props: typeof __VLS_507) => any;
31
31
  } & {
32
- toolbar_extension?: (props: typeof __VLS_504) => any;
32
+ toolbar_extension?: (props: typeof __VLS_509) => any;
33
33
  } & {
34
- toolbar_enhancement?: (props: typeof __VLS_506) => any;
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
- }, __VLS_459: {
8
+ }, __VLS_464: {
9
9
  toolbarMode: string;
10
- }, __VLS_501: {
10
+ }, __VLS_506: {
11
11
  toolbarMode: string;
12
- }, __VLS_503: {
12
+ }, __VLS_508: {
13
13
  toolbarMode: string;
14
- }, __VLS_505: {
14
+ }, __VLS_510: {
15
15
  toolbarMode: string;
16
- }, __VLS_507: {
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 __VLS_459) => any;
26
+ toolbar_tools?: (props: typeof __VLS_464) => any;
27
27
  } & {
28
- toolbar_view?: (props: typeof __VLS_501) => any;
28
+ toolbar_view?: (props: typeof __VLS_506) => any;
29
29
  } & {
30
- toolbar_review?: (props: typeof __VLS_503) => any;
30
+ toolbar_review?: (props: typeof __VLS_508) => any;
31
31
  } & {
32
- toolbar_extension?: (props: typeof __VLS_505) => any;
32
+ toolbar_extension?: (props: typeof __VLS_510) => any;
33
33
  } & {
34
- toolbar_enhancement?: (props: typeof __VLS_507) => any;
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;
@@ -2087,6 +2101,20 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
2087
2101
  text: string;
2088
2102
  tip: string;
2089
2103
  };
2104
+ "thousands-separator": {
2105
+ text: string;
2106
+ tip: string;
2107
+ edit: string;
2108
+ delete: string;
2109
+ separator: string;
2110
+ space: string;
2111
+ comma: string;
2112
+ "group-size": string;
2113
+ "allow-wrap": string;
2114
+ preview: string;
2115
+ "selection-required": string;
2116
+ "invalid-number": string;
2117
+ };
2090
2118
  math: {
2091
2119
  text: string;
2092
2120
  insert: string;
@@ -3458,6 +3486,20 @@ export declare const useI18n: () => import("vue-i18n").Composer<{
3458
3486
  text: string;
3459
3487
  tip: string;
3460
3488
  };
3489
+ "thousands-separator": {
3490
+ text: string;
3491
+ tip: string;
3492
+ edit: string;
3493
+ delete: string;
3494
+ separator: string;
3495
+ space: string;
3496
+ comma: string;
3497
+ "group-size": string;
3498
+ "allow-wrap": string;
3499
+ preview: string;
3500
+ "selection-required": string;
3501
+ "invalid-number": string;
3502
+ };
3461
3503
  math: {
3462
3504
  text: string;
3463
3505
  insert: 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,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;
@@ -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;
@@ -2074,6 +2088,20 @@ export declare const i18n: import("vue-i18n").I18n<{
2074
2088
  text: string;
2075
2089
  tip: string;
2076
2090
  };
2091
+ "thousands-separator": {
2092
+ text: string;
2093
+ tip: string;
2094
+ edit: string;
2095
+ delete: string;
2096
+ separator: string;
2097
+ space: string;
2098
+ comma: string;
2099
+ "group-size": string;
2100
+ "allow-wrap": string;
2101
+ preview: string;
2102
+ "selection-required": string;
2103
+ "invalid-number": string;
2104
+ };
2077
2105
  math: {
2078
2106
  text: string;
2079
2107
  insert: string;
@@ -3445,6 +3473,20 @@ export declare const i18n: import("vue-i18n").I18n<{
3445
3473
  text: string;
3446
3474
  tip: string;
3447
3475
  };
3476
+ "thousands-separator": {
3477
+ text: string;
3478
+ tip: string;
3479
+ edit: string;
3480
+ delete: string;
3481
+ separator: string;
3482
+ space: string;
3483
+ comma: string;
3484
+ "group-size": string;
3485
+ "allow-wrap": string;
3486
+ preview: string;
3487
+ "selection-required": string;
3488
+ "invalid-number": string;
3489
+ };
3448
3490
  math: {
3449
3491
  text: string;
3450
3492
  insert: string;
@@ -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;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @agilehub/agile-editor 1.8.0
2
+ * @agilehub/agile-editor 1.8.1
3
3
  * @license Apache-2.0
4
4
  * @author undefined undefined
5
5
  * @see undefined
6
6
  **/
7
7
  import "./agile-editor.css";
8
- import { a as e, n as t } from "./i18n-DCR9QpaV.js";
8
+ import { a as e, n as t } from "./i18n-DkkDy5cy.js";
9
9
  import { createBlock as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, guardReactiveProps as s, markRaw as c, normalizeProps as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, resolveDynamicComponent as m, shallowRef as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
10
10
  //#region src/extensions/smart-sheet/viewer.vue?vue&type=script&setup=true&lang.ts
11
11
  var y = { class: "agile-smart-sheet-viewer" }, b = {
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@agilehub/agile-editor",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Rich text editor based on Vue 3 and Tiptap 3",
5
- "author": "lytdev <lytdev@outlook.com>",
6
5
  "keywords": [
7
6
  "docs editor",
8
7
  "document editor",
@@ -19,13 +18,11 @@
19
18
  "word editor"
20
19
  ],
21
20
  "license": "Apache-2.0",
21
+ "author": "lytdev <lytdev@outlook.com>",
22
22
  "repository": {
23
23
  "type": "git",
24
24
  "url": "https://github.com/lytdev/agile-editor.git"
25
25
  },
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
26
  "files": [
30
27
  "dist",
31
28
  "docs"
@@ -41,9 +38,12 @@
41
38
  "import": "./dist/agile-editor.css"
42
39
  }
43
40
  },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
44
  "scripts": {
45
45
  "build": "vue-tsc --noEmit && vite build && vue-tsc -p tsconfig.types.json",
46
- "test:style-target": "node --test tests/style-target.test.mjs tests/style-schema.test.mjs tests/iframe.test.mjs tests/bookmark-transaction.test.mjs",
46
+ "test:style-target": "node --test tests/style-target.test.mjs tests/style-schema.test.mjs tests/iframe.test.mjs tests/bookmark-transaction.test.mjs tests/thousands-separator.test.mjs",
47
47
  "typecheck": "vue-tsc --noEmit",
48
48
  "dev": "vite --port 9000 --open --force",
49
49
  "format": "oxfmt --write .",
@@ -142,8 +142,8 @@
142
142
  "vue-tsc": "^3.3.13"
143
143
  },
144
144
  "overrides": {
145
- "rolldown": "^1.2.14",
146
- "prosemirror-model": "1.25.12"
145
+ "prosemirror-model": "1.25.12",
146
+ "rolldown": "^1.2.14"
147
147
  },
148
148
  "lint-staged": {
149
149
  "*.ts": [