@opentiny/fluent-editor 3.22.0 → 3.23.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 +2 -0
- package/es/config/editor.config.es.js +9 -3
- package/es/config/editor.config.es.js.map +1 -1
- package/es/config/i18n/en-us.es.js +47 -26
- package/es/config/i18n/en-us.es.js.map +1 -1
- package/es/config/i18n/zh-cn.es.js +47 -26
- package/es/config/i18n/zh-cn.es.js.map +1 -1
- package/es/config/index.es.js +3 -44
- package/es/config/index.es.js.map +1 -1
- package/es/counter/index.es.js +16 -11
- package/es/counter/index.es.js.map +1 -1
- package/es/custom-clipboard.es.js +4 -4
- package/es/custom-clipboard.es.js.map +1 -1
- package/es/fluent-editor.es.js +28 -3
- package/es/fluent-editor.es.js.map +1 -1
- package/es/fullscreen/handler.es.js +10 -0
- package/es/fullscreen/handler.es.js.map +1 -1
- package/es/index.es.js +4 -3
- package/es/link/modules/tooltip.es.js +22 -5
- package/es/link/modules/tooltip.es.js.map +1 -1
- package/es/table/modules/table-operation-menu.es.js +213 -203
- package/es/table/modules/table-operation-menu.es.js.map +1 -1
- package/es/table/modules/table-selection.es.js.map +1 -1
- package/es/table/utils/node-matchers.es.js +1 -1
- package/es/table/utils/node-matchers.es.js.map +1 -1
- package/es/toolbar/index.es.js +2 -0
- package/es/toolbar/index.es.js.map +1 -1
- package/es/toolbar/toolbar-tip.es.js +106 -0
- package/es/toolbar/toolbar-tip.es.js.map +1 -0
- package/es/utils/debounce.es.js +2 -1
- package/es/utils/debounce.es.js.map +1 -1
- package/es/utils/is.es.js +10 -0
- package/es/utils/is.es.js.map +1 -0
- package/es/utils/method.es.js +0 -5
- package/es/utils/method.es.js.map +1 -1
- package/lib/config/editor.config.cjs.js +8 -2
- package/lib/config/editor.config.cjs.js.map +1 -1
- package/lib/config/i18n/en-us.cjs.js +47 -26
- package/lib/config/i18n/en-us.cjs.js.map +1 -1
- package/lib/config/i18n/zh-cn.cjs.js +47 -26
- package/lib/config/i18n/zh-cn.cjs.js.map +1 -1
- package/lib/config/index.cjs.js +3 -43
- package/lib/config/index.cjs.js.map +1 -1
- package/lib/counter/index.cjs.js +15 -10
- package/lib/counter/index.cjs.js.map +1 -1
- package/lib/custom-clipboard.cjs.js +3 -3
- package/lib/custom-clipboard.cjs.js.map +1 -1
- package/lib/fluent-editor.cjs.js +27 -2
- package/lib/fluent-editor.cjs.js.map +1 -1
- package/lib/fullscreen/handler.cjs.js +10 -0
- package/lib/fullscreen/handler.cjs.js.map +1 -1
- package/lib/index.cjs.js +2 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/link/modules/tooltip.cjs.js +22 -5
- package/lib/link/modules/tooltip.cjs.js.map +1 -1
- package/lib/table/modules/table-operation-menu.cjs.js +213 -203
- package/lib/table/modules/table-operation-menu.cjs.js.map +1 -1
- package/lib/table/modules/table-selection.cjs.js.map +1 -1
- package/lib/table/utils/node-matchers.cjs.js +1 -1
- package/lib/table/utils/node-matchers.cjs.js.map +1 -1
- package/lib/toolbar/index.cjs.js +2 -0
- package/lib/toolbar/index.cjs.js.map +1 -1
- package/lib/toolbar/toolbar-tip.cjs.js +106 -0
- package/lib/toolbar/toolbar-tip.cjs.js.map +1 -0
- package/lib/utils/debounce.cjs.js +2 -1
- package/lib/utils/debounce.cjs.js.map +1 -1
- package/lib/utils/is.cjs.js +10 -0
- package/lib/utils/is.cjs.js.map +1 -0
- package/lib/utils/method.cjs.js +0 -5
- package/lib/utils/method.cjs.js.map +1 -1
- package/package.json +4 -3
- package/style.css +15 -1
- package/types/config/editor.config.d.ts +214 -84
- package/types/config/i18n/en-us.d.ts +46 -26
- package/types/config/i18n/zh-cn.d.ts +46 -26
- package/types/config/index.d.ts +0 -41
- package/types/config/types/editor-config.interface.d.ts +2 -0
- package/types/counter/index.d.ts +9 -4
- package/types/custom-clipboard.d.ts +6 -3
- package/types/fluent-editor.d.ts +7 -1
- package/types/link/modules/tooltip.d.ts +1 -0
- package/types/table/modules/table-operation-menu.d.ts +6 -0
- package/types/toolbar/index.d.ts +1 -0
- package/types/toolbar/toolbar-tip.d.ts +9 -0
- package/types/utils/is.d.ts +2 -0
- package/types/utils/method.d.ts +0 -1
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const EN_US = {
|
|
4
|
-
"undo": "Undo",
|
|
5
|
-
"redo": "Redo",
|
|
6
|
-
"clean": "Clear Formatting",
|
|
7
4
|
"header": "Paragraph Formatting",
|
|
8
5
|
"normal": "Normal",
|
|
9
6
|
"h1": "Heading 1",
|
|
@@ -12,38 +9,17 @@ const EN_US = {
|
|
|
12
9
|
"h4": "Heading 4",
|
|
13
10
|
"h5": "Heading 5",
|
|
14
11
|
"h6": "Heading 6",
|
|
15
|
-
"font": "Font",
|
|
16
|
-
"size": "Size",
|
|
17
12
|
"lineheight": "Line Height",
|
|
18
13
|
"songti": "SimSun",
|
|
19
14
|
"yahei": "Microsoft Yahei",
|
|
20
15
|
"kaiti": "KaiTi",
|
|
21
16
|
"heiti": "SimHei",
|
|
22
17
|
"lishu": "LiSu",
|
|
23
|
-
"bold": "Bold",
|
|
24
|
-
"italic": "Italic",
|
|
25
|
-
"underline": "Underline",
|
|
26
|
-
"strike": "Strikethrough",
|
|
27
|
-
"color": "Font Color",
|
|
28
|
-
"background": "Background Color",
|
|
29
|
-
"orderedlist": "Ordered List",
|
|
30
|
-
"bulletlist": "Unordered List",
|
|
31
|
-
"checklist": "Task List",
|
|
32
18
|
"left": "Left",
|
|
33
19
|
"center": "Centered",
|
|
34
20
|
"right": "Right",
|
|
35
|
-
"image": "Image",
|
|
36
|
-
"file": "File",
|
|
37
|
-
"table": "Table",
|
|
38
|
-
"link": "Hyperlink",
|
|
39
|
-
"code": "Inline Code",
|
|
40
21
|
"codeblock": "Code Block",
|
|
41
|
-
"blockquote": "Quote",
|
|
42
|
-
"superscript": "Superscript",
|
|
43
|
-
"subscript": "Subscript",
|
|
44
22
|
"globallink": "Link",
|
|
45
|
-
"emoji": "Emoji",
|
|
46
|
-
"fullscreen": "Full Screen",
|
|
47
23
|
"exit-fullscreen": "Exit Full Screen",
|
|
48
24
|
"help": "Help",
|
|
49
25
|
"more": "More",
|
|
@@ -81,10 +57,55 @@ const EN_US = {
|
|
|
81
57
|
"pasting": "A large amount of content to paste. Loading...",
|
|
82
58
|
"img-error": "Image Copy Error",
|
|
83
59
|
"img-error-info": "Failed to copy the image. Save it to your local computer and then upload it by clicking Image on the toolbar.",
|
|
84
|
-
"
|
|
60
|
+
"last-modified": "Last Modified Date:",
|
|
85
61
|
"screenshot": "Screenshot",
|
|
86
62
|
"uploading": "Uploading...",
|
|
87
|
-
"
|
|
63
|
+
"sub-title-bg-color": "Background Color",
|
|
64
|
+
// blot tip name
|
|
65
|
+
"emoji": "Emoji",
|
|
66
|
+
"fullscreen": "Full Screen",
|
|
67
|
+
"blockquote": "Quote",
|
|
68
|
+
"undo": "Undo",
|
|
69
|
+
"redo": "Redo",
|
|
70
|
+
"clean": "Clear Formatting",
|
|
71
|
+
"bold": "Bold",
|
|
72
|
+
"italic": "Italic",
|
|
73
|
+
"underline": "Underline",
|
|
74
|
+
"strike": "Strikethrough",
|
|
75
|
+
"image": "Image",
|
|
76
|
+
"file": "File",
|
|
77
|
+
"table": "Table",
|
|
78
|
+
"link": "Hyperlink",
|
|
79
|
+
"code": "Inline Code",
|
|
80
|
+
"better-table": "Table",
|
|
81
|
+
"code-block": "Code Block",
|
|
82
|
+
"formula": "Formula",
|
|
83
|
+
"format-painter": "Format Painter",
|
|
84
|
+
"video": "Video",
|
|
85
|
+
"color": "Font Color",
|
|
86
|
+
"background": "Background Color",
|
|
87
|
+
"font": "Font",
|
|
88
|
+
"size": "Size",
|
|
89
|
+
"list-ordered": "Ordered List",
|
|
90
|
+
"list-bullet": "Unordered List",
|
|
91
|
+
"list-check": "Task List",
|
|
92
|
+
"align-left": "Left aligned",
|
|
93
|
+
"align-center": "Center aligned",
|
|
94
|
+
"align-right": "Right aligned",
|
|
95
|
+
"align-justify": "Justify aligned",
|
|
96
|
+
"direction-ltr": "Text Direction Left To Right",
|
|
97
|
+
"direction-rtl": "Text Direction Right To Left",
|
|
98
|
+
"indent--1": "Minus Indent",
|
|
99
|
+
"indent-+1": "Add Indent",
|
|
100
|
+
"script-super": "Superscript",
|
|
101
|
+
"script-sub": "Subscript",
|
|
102
|
+
"header-normal": "Text",
|
|
103
|
+
"header-1": "Heading 1",
|
|
104
|
+
"header-2": "Heading 2",
|
|
105
|
+
"header-3": "Heading 3",
|
|
106
|
+
"header-4": "Heading 4",
|
|
107
|
+
"header-5": "Heading 5",
|
|
108
|
+
"header-6": "Heading 6"
|
|
88
109
|
};
|
|
89
110
|
exports.EN_US = EN_US;
|
|
90
111
|
//# sourceMappingURL=en-us.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-us.cjs.js","sources":["../../../../src/config/i18n/en-us.ts"],"sourcesContent":["export const EN_US = {\r\n
|
|
1
|
+
{"version":3,"file":"en-us.cjs.js","sources":["../../../../src/config/i18n/en-us.ts"],"sourcesContent":["export const EN_US = {\r\n\r\n 'header': 'Paragraph Formatting',\r\n 'normal': 'Normal',\r\n 'h1': 'Heading 1',\r\n 'h2': 'Heading 2',\r\n 'h3': 'Heading 3',\r\n 'h4': 'Heading 4',\r\n 'h5': 'Heading 5',\r\n 'h6': 'Heading 6',\r\n\r\n 'lineheight': 'Line Height',\r\n 'songti': 'SimSun',\r\n 'yahei': 'Microsoft Yahei',\r\n 'kaiti': 'KaiTi',\r\n 'heiti': 'SimHei',\r\n 'lishu': 'LiSu',\r\n\r\n 'left': 'Left',\r\n 'center': 'Centered',\r\n 'right': 'Right',\r\n\r\n 'codeblock': 'Code Block',\r\n 'globallink': 'Link',\r\n\r\n 'exit-fullscreen': 'Exit Full Screen',\r\n 'help': 'Help',\r\n 'more': 'More',\r\n\r\n 'help-format': 'Format',\r\n 'help-insert': 'Insert',\r\n 'help-operation': 'Edit',\r\n 'mention': 'Mention People',\r\n 'quick-menu': 'Shortcut',\r\n 'toggle-help-panel': 'Open/Close Help Panel',\r\n 'scroll-table': 'Horizontal Scroll',\r\n 'mouse-wheel': 'Mouse Wheel',\r\n 'save': 'Save',\r\n\r\n 'copy-cells': 'Copy',\r\n 'copy-table': 'Copy Table',\r\n 'cut-cells': 'Cut',\r\n 'empty-cells': 'Clear Contents',\r\n\r\n 'insert-row-up': 'Insert Rows Above',\r\n 'insert-row-down': 'Insert Rows Below',\r\n 'insert-column-left': 'Insert Columns to the Left',\r\n 'insert-column-right': 'Insert Columns to the Right',\r\n\r\n 'merge-cells': 'Merge Cells',\r\n 'unmerge-cells': 'Split Cells',\r\n\r\n 'delete-row': 'Delete Entire Row',\r\n 'delete-column': 'Delete Entire Column',\r\n 'delete-table': 'Delete Table',\r\n\r\n 'default-link-text': 'Link',\r\n 'basicblock': 'Card',\r\n 'linkplaceholder': 'Enter an address and press Enter.',\r\n 'counter-template': `{{count}}/{{totalCount}} {{countUnit}}`,\r\n 'char': 'characters',\r\n 'word': 'words',\r\n 'counter-limit-tips':\r\n 'The number of {{countUnit}} exceeds the maximum allowed limit.',\r\n 'ie-msg':\r\n 'In order to have a better experience, it is recommended to use the latest version of Chrome browser.',\r\n\r\n 'loading': 'Loading...',\r\n 'pasting': 'A large amount of content to paste. Loading...',\r\n 'img-error': 'Image Copy Error',\r\n 'img-error-info':\r\n 'Failed to copy the image. Save it to your local computer and then upload it by clicking Image on the toolbar.',\r\n\r\n 'last-modified': 'Last Modified Date:',\r\n 'screenshot': 'Screenshot',\r\n 'uploading': 'Uploading...',\r\n 'sub-title-bg-color': 'Background Color',\r\n\r\n // blot tip name\r\n 'emoji': 'Emoji',\r\n 'fullscreen': 'Full Screen',\r\n 'blockquote': 'Quote',\r\n 'undo': 'Undo',\r\n 'redo': 'Redo',\r\n 'clean': 'Clear Formatting',\r\n 'bold': 'Bold',\r\n 'italic': 'Italic',\r\n 'underline': 'Underline',\r\n 'strike': 'Strikethrough',\r\n 'image': 'Image',\r\n 'file': 'File',\r\n 'table': 'Table',\r\n 'link': 'Hyperlink',\r\n 'code': 'Inline Code',\r\n 'better-table': 'Table',\r\n 'code-block': 'Code Block',\r\n 'formula': 'Formula',\r\n 'format-painter': 'Format Painter',\r\n 'video': 'Video',\r\n 'color': 'Font Color',\r\n 'background': 'Background Color',\r\n 'font': 'Font',\r\n 'size': 'Size',\r\n 'list-ordered': 'Ordered List',\r\n 'list-bullet': 'Unordered List',\r\n 'list-check': 'Task List',\r\n 'align-left': 'Left aligned',\r\n 'align-center': 'Center aligned',\r\n 'align-right': 'Right aligned',\r\n 'align-justify': 'Justify aligned',\r\n 'direction-ltr': 'Text Direction Left To Right',\r\n 'direction-rtl': 'Text Direction Right To Left',\r\n 'indent--1': 'Minus Indent',\r\n 'indent-+1': 'Add Indent',\r\n 'script-super': 'Superscript',\r\n 'script-sub': 'Subscript',\r\n 'header-normal': 'Text',\r\n 'header-1': 'Heading 1',\r\n 'header-2': 'Heading 2',\r\n 'header-3': 'Heading 3',\r\n 'header-4': 'Heading 4',\r\n 'header-5': 'Heading 5',\r\n 'header-6': 'Heading 6',\r\n}\r\n"],"names":[],"mappings":";;AAAO,MAAM,QAAQ;AAAA,EAEnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EAEN,cAAc;AAAA,EACd,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EAET,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EAET,aAAa;AAAA,EACb,cAAc;AAAA,EAEd,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,eAAe;AAAA,EACf,eAAe;AAAA,E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BAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AACd;;"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const ZH_CN = {
|
|
4
|
-
"undo": "撤销",
|
|
5
|
-
"redo": "重做",
|
|
6
|
-
"clean": "清除格式",
|
|
7
4
|
"header": "段落格式",
|
|
8
5
|
"normal": "正文",
|
|
9
6
|
"h1": "标题1",
|
|
@@ -12,38 +9,17 @@ const ZH_CN = {
|
|
|
12
9
|
"h4": "标题4",
|
|
13
10
|
"h5": "标题5",
|
|
14
11
|
"h6": "标题6",
|
|
15
|
-
"font": "字体",
|
|
16
|
-
"size": "字号",
|
|
17
12
|
"lineheight": "行距",
|
|
18
13
|
"songti": "宋体",
|
|
19
14
|
"yahei": "微软雅黑",
|
|
20
15
|
"kaiti": "楷体",
|
|
21
16
|
"heiti": "黑体",
|
|
22
17
|
"lishu": "隶书",
|
|
23
|
-
"bold": "粗体",
|
|
24
|
-
"italic": "斜体",
|
|
25
|
-
"underline": "下划线",
|
|
26
|
-
"strike": "删除线",
|
|
27
|
-
"color": "字体颜色",
|
|
28
|
-
"background": "背景色",
|
|
29
|
-
"orderedlist": "有序列表",
|
|
30
|
-
"bulletlist": "无序列表",
|
|
31
|
-
"checklist": "任务列表",
|
|
32
18
|
"left": "左对齐",
|
|
33
19
|
"center": "居中对齐",
|
|
34
20
|
"right": "右对齐",
|
|
35
|
-
"image": "图片",
|
|
36
|
-
"file": "文件",
|
|
37
|
-
"table": "表格",
|
|
38
|
-
"link": "超链接",
|
|
39
|
-
"code": "行内代码",
|
|
40
21
|
"codeblock": "代码块",
|
|
41
|
-
"blockquote": "引用",
|
|
42
|
-
"superscript": "上标",
|
|
43
|
-
"subscript": "下标",
|
|
44
22
|
"globallink": "全局链接",
|
|
45
|
-
"emoji": "表情",
|
|
46
|
-
"fullscreen": "全屏",
|
|
47
23
|
"exit-fullscreen": "退出全屏",
|
|
48
24
|
"help": "帮助",
|
|
49
25
|
"more": "更多",
|
|
@@ -81,10 +57,55 @@ const ZH_CN = {
|
|
|
81
57
|
"pasting": "您粘贴的内容较多,正在努力加载中,请耐心等待...",
|
|
82
58
|
"img-error": "图片复制出错",
|
|
83
59
|
"img-error-info": "此图片不支持复制,请将原图下载至本地后点击工具栏【插入图片】,重新上传。",
|
|
84
|
-
"
|
|
60
|
+
"last-modified": "最后修改时间:",
|
|
85
61
|
"screenshot": "截图",
|
|
86
62
|
"uploading": "上传中...",
|
|
87
|
-
"
|
|
63
|
+
"sub-title-bg-color": "背景颜色",
|
|
64
|
+
// blot tip name
|
|
65
|
+
"emoji": "表情",
|
|
66
|
+
"fullscreen": "全屏",
|
|
67
|
+
"blockquote": "引用",
|
|
68
|
+
"undo": "撤销",
|
|
69
|
+
"redo": "重做",
|
|
70
|
+
"clean": "清除格式",
|
|
71
|
+
"bold": "粗体",
|
|
72
|
+
"italic": "斜体",
|
|
73
|
+
"underline": "下划线",
|
|
74
|
+
"strike": "删除线",
|
|
75
|
+
"image": "图片",
|
|
76
|
+
"file": "文件",
|
|
77
|
+
"table": "表格",
|
|
78
|
+
"link": "超链接",
|
|
79
|
+
"code": "行内代码",
|
|
80
|
+
"better-table": "表格",
|
|
81
|
+
"code-block": "代码块",
|
|
82
|
+
"formula": "公式",
|
|
83
|
+
"format-painter": "格式刷",
|
|
84
|
+
"video": "视频",
|
|
85
|
+
"color": "字体颜色",
|
|
86
|
+
"background": "背景色",
|
|
87
|
+
"font": "字体",
|
|
88
|
+
"size": "字号",
|
|
89
|
+
"list-ordered": "有序列表",
|
|
90
|
+
"list-bullet": "无序列表",
|
|
91
|
+
"list-check": "任务列表",
|
|
92
|
+
"align-left": "左对齐",
|
|
93
|
+
"align-center": "居中对齐",
|
|
94
|
+
"align-right": "右对齐",
|
|
95
|
+
"align-justify": "两端对齐",
|
|
96
|
+
"direction-ltr": "文本方向左到右",
|
|
97
|
+
"direction-rtl": "文本方向右到左",
|
|
98
|
+
"indent--1": "减少缩进",
|
|
99
|
+
"indent-+1": "增加缩进",
|
|
100
|
+
"script-super": "上标",
|
|
101
|
+
"script-sub": "下标",
|
|
102
|
+
"header-normal": "正文",
|
|
103
|
+
"header-1": "标题1",
|
|
104
|
+
"header-2": "标题2",
|
|
105
|
+
"header-3": "标题3",
|
|
106
|
+
"header-4": "标题4",
|
|
107
|
+
"header-5": "标题5",
|
|
108
|
+
"header-6": "标题6"
|
|
88
109
|
};
|
|
89
110
|
exports.ZH_CN = ZH_CN;
|
|
90
111
|
//# sourceMappingURL=zh-cn.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh-cn.cjs.js","sources":["../../../../src/config/i18n/zh-cn.ts"],"sourcesContent":["export const ZH_CN = {\r\n '
|
|
1
|
+
{"version":3,"file":"zh-cn.cjs.js","sources":["../../../../src/config/i18n/zh-cn.ts"],"sourcesContent":["export const ZH_CN = {\r\n\r\n 'header': '段落格式',\r\n 'normal': '正文',\r\n 'h1': '标题1',\r\n 'h2': '标题2',\r\n 'h3': '标题3',\r\n 'h4': '标题4',\r\n 'h5': '标题5',\r\n 'h6': '标题6',\r\n\r\n 'lineheight': '行距',\r\n 'songti': '宋体',\r\n 'yahei': '微软雅黑',\r\n 'kaiti': '楷体',\r\n 'heiti': '黑体',\r\n 'lishu': '隶书',\r\n\r\n 'left': '左对齐',\r\n 'center': '居中对齐',\r\n 'right': '右对齐',\r\n\r\n 'codeblock': '代码块',\r\n 'globallink': '全局链接',\r\n\r\n 'exit-fullscreen': '退出全屏',\r\n 'help': '帮助',\r\n 'more': '更多',\r\n\r\n 'help-format': '格式',\r\n 'help-insert': '插入',\r\n 'help-operation': '操作',\r\n 'mention': '提及某人',\r\n 'quick-menu': '快捷菜单',\r\n 'toggle-help-panel': '打开/关闭帮助面板',\r\n 'scroll-table': '水平滚动表格',\r\n 'mouse-wheel': '鼠标滚轮',\r\n 'save': '保存',\r\n\r\n 'copy-cells': '复制',\r\n 'copy-table': '复制表格',\r\n 'cut-cells': '剪切',\r\n 'empty-cells': '清空内容',\r\n\r\n 'insert-row-up': '上插入行',\r\n 'insert-row-down': '下插入行',\r\n 'insert-column-left': '左插入列',\r\n 'insert-column-right': '右插入列',\r\n\r\n 'merge-cells': '合并单元格',\r\n 'unmerge-cells': '拆分单元格',\r\n\r\n 'delete-row': '删除当前行',\r\n 'delete-column': '删除当前列',\r\n 'delete-table': '删除表格',\r\n\r\n 'default-link-text': '链接',\r\n 'basicblock': '卡片',\r\n 'linkplaceholder': '请输入链接地址,按回车键确认',\r\n 'counter-template': '{{count}}/{{totalCount}}',\r\n 'char': '字符',\r\n 'word': '单词',\r\n 'counter-limit-tips': '{{countUnit}}数超出最大允许值',\r\n 'ie-msg': '为了有更好的体验,推荐使用最新版Chrome浏览器。',\r\n\r\n 'loading': '正在加载中...',\r\n 'pasting': '您粘贴的内容较多,正在努力加载中,请耐心等待...',\r\n 'img-error': '图片复制出错',\r\n 'img-error-info':\r\n '此图片不支持复制,请将原图下载至本地后点击工具栏【插入图片】,重新上传。',\r\n\r\n 'last-modified': '最后修改时间:',\r\n 'screenshot': '截图',\r\n 'uploading': '上传中...',\r\n 'sub-title-bg-color': '背景颜色',\r\n\r\n // blot tip name\r\n 'emoji': '表情',\r\n 'fullscreen': '全屏',\r\n 'blockquote': '引用',\r\n 'undo': '撤销',\r\n 'redo': '重做',\r\n 'clean': '清除格式',\r\n 'bold': '粗体',\r\n 'italic': '斜体',\r\n 'underline': '下划线',\r\n 'strike': '删除线',\r\n 'image': '图片',\r\n 'file': '文件',\r\n 'table': '表格',\r\n 'link': '超链接',\r\n 'code': '行内代码',\r\n 'better-table': '表格',\r\n 'code-block': '代码块',\r\n 'formula': '公式',\r\n 'format-painter': '格式刷',\r\n 'video': '视频',\r\n 'color': '字体颜色',\r\n 'background': '背景色',\r\n 'font': '字体',\r\n 'size': '字号',\r\n 'list-ordered': '有序列表',\r\n 'list-bullet': '无序列表',\r\n 'list-check': '任务列表',\r\n 'align-left': '左对齐',\r\n 'align-center': '居中对齐',\r\n 'align-right': '右对齐',\r\n 'align-justify': '两端对齐',\r\n 'direction-ltr': '文本方向左到右',\r\n 'direction-rtl': '文本方向右到左',\r\n 'indent--1': '减少缩进',\r\n 'indent-+1': '增加缩进',\r\n 'script-super': '上标',\r\n 'script-sub': '下标',\r\n 'header-normal': '正文',\r\n 'header-1': '标题1',\r\n 'header-2': '标题2',\r\n 'header-3': '标题3',\r\n 'header-4': '标题4',\r\n 'header-5': '标题5',\r\n 'header-6': '标题6',\r\n}\r\n"],"names":[],"mappings":";;AAAO,MAAM,QAAQ;AAAA,EAEnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EAEN,cAAc;AAAA,EACd,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EAET,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EAET,aAAa;AAAA,EACb,cAAc;AAAA,EAEd,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,eAAe;AAAA,EACf,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,QAAQ;AAAA,EAER,cAAc;AAAA,EACd,cAAc;AAAA,EACd,aAAa;AAAA,EACb,eAAe;AAAA,EAEf,iBAAiB;A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Y;AAAA,EACZ,YAAY;AACd;;"}
|
package/lib/config/index.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const editor_config = require("./editor.config.cjs.js");
|
|
4
3
|
const editor_utils = require("./editor.utils.cjs.js");
|
|
5
4
|
const icons_config = require("./icons.config.cjs.js");
|
|
5
|
+
const editor_config = require("./editor.config.cjs.js");
|
|
6
6
|
const ICONS_CONFIG = {
|
|
7
7
|
"undo": icons_config.UNDO_ICON,
|
|
8
8
|
"redo": icons_config.REDO_ICON,
|
|
@@ -48,47 +48,6 @@ const ICONS_CONFIG = {
|
|
|
48
48
|
"screenshot": icons_config.SCREENSHOT_ICON,
|
|
49
49
|
"format-painter": icons_config.FORMAT_PAINTER_ICON
|
|
50
50
|
};
|
|
51
|
-
const TABLE_RIGHT_MENU_CONFIG = {
|
|
52
|
-
copyCells: {
|
|
53
|
-
text: editor_config.LANG_CONF["copy-cells"]
|
|
54
|
-
},
|
|
55
|
-
copyTable: {
|
|
56
|
-
text: editor_config.LANG_CONF["copy-table"]
|
|
57
|
-
},
|
|
58
|
-
cutCells: {
|
|
59
|
-
text: editor_config.LANG_CONF["cut-cells"]
|
|
60
|
-
},
|
|
61
|
-
emptyCells: {
|
|
62
|
-
text: editor_config.LANG_CONF["empty-cells"]
|
|
63
|
-
},
|
|
64
|
-
insertRowUp: {
|
|
65
|
-
text: editor_config.LANG_CONF["insert-row-up"]
|
|
66
|
-
},
|
|
67
|
-
insertRowDown: {
|
|
68
|
-
text: editor_config.LANG_CONF["insert-row-down"]
|
|
69
|
-
},
|
|
70
|
-
insertColumnLeft: {
|
|
71
|
-
text: editor_config.LANG_CONF["insert-column-left"]
|
|
72
|
-
},
|
|
73
|
-
insertColumnRight: {
|
|
74
|
-
text: editor_config.LANG_CONF["insert-column-right"]
|
|
75
|
-
},
|
|
76
|
-
mergeCells: {
|
|
77
|
-
text: editor_config.LANG_CONF["merge-cells"]
|
|
78
|
-
},
|
|
79
|
-
unmergeCells: {
|
|
80
|
-
text: editor_config.LANG_CONF["unmerge-cells"]
|
|
81
|
-
},
|
|
82
|
-
deleteRow: {
|
|
83
|
-
text: editor_config.LANG_CONF["delete-row"]
|
|
84
|
-
},
|
|
85
|
-
deleteColumn: {
|
|
86
|
-
text: editor_config.LANG_CONF["delete-column"]
|
|
87
|
-
},
|
|
88
|
-
deleteTable: {
|
|
89
|
-
text: editor_config.LANG_CONF["delete-table"]
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
51
|
function inputFile(type, accept) {
|
|
93
52
|
const defaultMIMETypes = this.quill.uploader.options[type].join(", ");
|
|
94
53
|
const mimeTypes = accept || defaultMIMETypes;
|
|
@@ -126,6 +85,7 @@ function getListValue(value, preListValue) {
|
|
|
126
85
|
const namespace = "fe";
|
|
127
86
|
exports.AUDIO_VIDEO_UPLOADER_MIME_TYPES = editor_config.AUDIO_VIDEO_UPLOADER_MIME_TYPES;
|
|
128
87
|
exports.BIG_DELTA_LIMIT = editor_config.BIG_DELTA_LIMIT;
|
|
88
|
+
exports.CHANGE_LANGUAGE_EVENT = editor_config.CHANGE_LANGUAGE_EVENT;
|
|
129
89
|
exports.COMPRESSED_UPLOADER_MIME_TYPES = editor_config.COMPRESSED_UPLOADER_MIME_TYPES;
|
|
130
90
|
exports.DOC_UPLOADER_MIME_TYPES = editor_config.DOC_UPLOADER_MIME_TYPES;
|
|
131
91
|
exports.FILE_UPLOADER_MIME_TYPES = editor_config.FILE_UPLOADER_MIME_TYPES;
|
|
@@ -134,8 +94,8 @@ exports.LANG_CONF = editor_config.LANG_CONF;
|
|
|
134
94
|
exports.OTHER_FILE_UPLOADER_MIME_TYPES = editor_config.OTHER_FILE_UPLOADER_MIME_TYPES;
|
|
135
95
|
exports.PPT_UPLOADER_MIME_TYPES = editor_config.PPT_UPLOADER_MIME_TYPES;
|
|
136
96
|
exports.XSL_UPLOADER_MIME_TYPES = editor_config.XSL_UPLOADER_MIME_TYPES;
|
|
97
|
+
exports.defaultLanguage = editor_config.defaultLanguage;
|
|
137
98
|
exports.ICONS_CONFIG = ICONS_CONFIG;
|
|
138
|
-
exports.TABLE_RIGHT_MENU_CONFIG = TABLE_RIGHT_MENU_CONFIG;
|
|
139
99
|
exports.getListValue = getListValue;
|
|
140
100
|
exports.inputFile = inputFile;
|
|
141
101
|
exports.namespace = namespace;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/config/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/config/index.ts"],"sourcesContent":["import { isNullOrUndefined } from './editor.utils'\r\nimport {\r\n ALIGN_CENTER_ICON,\r\n ALIGN_LEFT_ICON,\r\n ALIGN_RIGHT_ICON,\r\n BACKGROUND_COLOR_ICON,\r\n BLOCKQUOTE_ICON,\r\n BOLD_ICON,\r\n CLEAN_ICON,\r\n CODE_BLOCK_ICON,\r\n CODE_ICON,\r\n COLOR_ICON,\r\n EMOJI_ICON,\r\n FILE_ICON,\r\n FORMAT_PAINTER_ICON,\r\n FULLSCREEN_EXIT_ICON,\r\n FULLSCREEN_ICON,\r\n GLOBAL_LINK_ICON,\r\n HELP_ICON,\r\n IMAGE_ICON,\r\n ITALIC_ICON,\r\n LINK_ICON,\r\n LIST_CHECK_ICON,\r\n LIST_ORDERED_ICON,\r\n LIST_UNORDERED_ICON,\r\n REDO_ICON,\r\n SCREENSHOT_ICON,\r\n STRIKE_ICON,\r\n TABLE_ICON,\r\n TRIANGLE_DOWN_ICON,\r\n UNDERLINE_ICON,\r\n UNDO_ICON,\r\n} from './icons.config'\r\n\r\nexport * from './editor.config'\r\n\r\nexport const ICONS_CONFIG: { [key: string]: any } = {\r\n 'undo': UNDO_ICON,\r\n 'redo': REDO_ICON,\r\n 'clean': CLEAN_ICON,\r\n\r\n 'bold': BOLD_ICON,\r\n 'italic': ITALIC_ICON,\r\n 'underline': UNDERLINE_ICON,\r\n 'strike': STRIKE_ICON,\r\n\r\n 'font': '',\r\n 'size': '',\r\n\r\n 'color': `<span class=\"ql-color-inner\">\r\n ${COLOR_ICON}\r\n ${TRIANGLE_DOWN_ICON}\r\n <span class=\"current-color-line\"></span>\r\n </span>`,\r\n 'background': `<span class=\"ql-color-inner\">\r\n ${BACKGROUND_COLOR_ICON}\r\n ${TRIANGLE_DOWN_ICON}\r\n <span class=\"current-color-line color-line-background\"></span>\r\n </span>`,\r\n\r\n 'align': {\r\n '': ALIGN_LEFT_ICON,\r\n 'center': ALIGN_CENTER_ICON,\r\n 'right': ALIGN_RIGHT_ICON,\r\n },\r\n 'list': {\r\n bullet: LIST_UNORDERED_ICON,\r\n ordered: LIST_ORDERED_ICON,\r\n check: LIST_CHECK_ICON,\r\n },\r\n\r\n 'code': CODE_ICON,\r\n 'code-block': CODE_BLOCK_ICON,\r\n 'blockquote': BLOCKQUOTE_ICON,\r\n\r\n 'image': IMAGE_ICON,\r\n 'file': FILE_ICON,\r\n 'better-table': TABLE_ICON,\r\n 'link': LINK_ICON,\r\n 'global-link': GLOBAL_LINK_ICON,\r\n 'fullscreen': FULLSCREEN_ICON,\r\n 'fullscreen-exit': FULLSCREEN_EXIT_ICON,\r\n 'emoji': EMOJI_ICON,\r\n 'help': HELP_ICON,\r\n 'screenshot': SCREENSHOT_ICON,\r\n 'format-painter': FORMAT_PAINTER_ICON,\r\n}\r\n\r\n// 触发上传\r\nexport function inputFile(type, accept) {\r\n const defaultMIMETypes = this.quill.uploader.options[type].join(', ')\r\n const mimeTypes = accept || defaultMIMETypes\r\n let fileInput = this.container.querySelector(`input.ql-${type}[type=file]`)\r\n if (isNullOrUndefined(fileInput)) {\r\n fileInput = document.createElement('input')\r\n fileInput.classList.add(`ql-${type}`)\r\n fileInput.setAttribute('type', 'file')\r\n fileInput.setAttribute('accept', mimeTypes)\r\n if (\r\n this.quill.uploader.options.enableMultiUpload === true\r\n || (this.quill.uploader.options.enableMultiUpload.file && type === 'file')\r\n || (this.quill.uploader.options.enableMultiUpload.image && type === 'image')\r\n ) {\r\n fileInput.setAttribute('multiple', '')\r\n }\r\n fileInput.addEventListener('change', () => {\r\n const range = this.quill.getSelection(true)\r\n this.quill.uploader.upload(range, fileInput.files, type === 'file')\r\n fileInput.value = ''\r\n })\r\n this.container.appendChild(fileInput)\r\n }\r\n fileInput.click()\r\n}\r\n\r\nexport function getListValue(value, preListValue) {\r\n let curListValue = value\r\n if (preListValue && preListValue === value) {\r\n curListValue = false\r\n }\r\n else if (value === 'check') {\r\n if (preListValue === 'checked' || preListValue === 'unchecked') {\r\n curListValue = false\r\n }\r\n else {\r\n curListValue = 'unchecked'\r\n }\r\n }\r\n return curListValue\r\n}\r\n/** css namespace */\r\nexport const namespace = 'fe'\r\n"],"names":["UNDO_ICON","REDO_ICON","CLEAN_ICON","BOLD_ICON","ITALIC_ICON","UNDERLINE_ICON","STRIKE_ICON","COLOR_ICON","TRIANGLE_DOWN_ICON","BACKGROUND_COLOR_ICON","ALIGN_LEFT_ICON","ALIGN_CENTER_ICON","ALIGN_RIGHT_ICON","LIST_UNORDERED_ICON","LIST_ORDERED_ICON","LIST_CHECK_ICON","CODE_ICON","CODE_BLOCK_ICON","BLOCKQUOTE_ICON","IMAGE_ICON","FILE_ICON","TABLE_ICON","LINK_ICON","GLOBAL_LINK_ICON","FULLSCREEN_ICON","FULLSCREEN_EXIT_ICON","EMOJI_ICON","HELP_ICON","SCREENSHOT_ICON","FORMAT_PAINTER_ICON","isNullOrUndefined"],"mappings":";;;;;AAoCO,MAAM,eAAuC;AAAA,EAClD,QAAQA,aAAA;AAAA,EACR,QAAQC,aAAA;AAAA,EACR,SAASC,aAAA;AAAA,EAET,QAAQC,aAAA;AAAA,EACR,UAAUC,aAAA;AAAA,EACV,aAAaC,aAAA;AAAA,EACb,UAAUC,aAAA;AAAA,EAEV,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,SAAS;AAAA,MACLC,uB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AAA,iBAAiB,UAAU,MAAM;AACzC,YAAM,QAAQ,KAAK,MAAM,aAAa,IAAI;AAC1C,WAAK,MAAM,SAAS,OAAO,OAAO,UAAU,OAAO,SAAS,MAAM;AAClE,gBAAU,QAAQ;AAAA,IAAA,CACnB;AACI,SAAA,UAAU,YAAY,SAAS;AAAA,EACtC;AACA,YAAU,MAAM;AAClB;AAEgB,SAAA,aAAa,OAAO,cAAc;AAChD,MAAI,eAAe;AACf,MAAA,gBAAgB,iBAAiB,OAAO;AAC3B,mBAAA;AAAA,EAAA,WAER,UAAU,SAAS;AACtB,QAAA,iBAAiB,aAAa,iBAAiB,aAAa;AAC/C,qBAAA;AAAA,IAAA,OAEZ;AACY,qBAAA;AAAA,IACjB;AAAA,EACF;AACO,SAAA;AACT;AAEO,MAAM,YAAY;;;;;;;;;;;;;;;;;"}
|
package/lib/counter/index.cjs.js
CHANGED
|
@@ -4,27 +4,20 @@ const Quill = require("quill");
|
|
|
4
4
|
require("../config/index.cjs.js");
|
|
5
5
|
const editor_config = require("../config/editor.config.cjs.js");
|
|
6
6
|
class Counter {
|
|
7
|
-
// @ts-ignore
|
|
8
7
|
constructor(quill, options) {
|
|
9
8
|
this.quill = quill;
|
|
10
|
-
this.defaultOptions = {
|
|
11
|
-
format: "text",
|
|
12
|
-
unit: "char",
|
|
13
|
-
template: editor_config.LANG_CONF["counter-template"],
|
|
14
|
-
count: 500
|
|
15
|
-
};
|
|
16
9
|
this.renderCount = () => {
|
|
17
10
|
setTimeout(() => {
|
|
18
11
|
const { format, count: totalCount, unit, template: counterTemplate, errorTemplate } = this.options;
|
|
19
12
|
const count = this.getContentLength(format);
|
|
20
13
|
const restCount = totalCount - count;
|
|
21
|
-
const countUnit = unit === "char" ?
|
|
14
|
+
const countUnit = unit === "char" ? this.quill.options.langText.char : this.quill.options.langText.word;
|
|
22
15
|
let template = counterTemplate;
|
|
23
16
|
if (typeof template === "function") {
|
|
24
17
|
template = template(count, restCount);
|
|
25
18
|
}
|
|
26
19
|
const desc = template.replace("{{count}}", count).replace("{{totalCount}}", String(totalCount)).replace("{{restCount}}", String(restCount)).replace(/{{countUnit}}/g, countUnit);
|
|
27
|
-
let limitTemplate = errorTemplate ||
|
|
20
|
+
let limitTemplate = errorTemplate || this.quill.options.langText["counter-limit-tips"];
|
|
28
21
|
if (typeof limitTemplate === "function") {
|
|
29
22
|
limitTemplate = limitTemplate(count, restCount);
|
|
30
23
|
}
|
|
@@ -36,11 +29,23 @@ class Counter {
|
|
|
36
29
|
}
|
|
37
30
|
});
|
|
38
31
|
};
|
|
39
|
-
this.options =
|
|
32
|
+
this.options = this.resolveOptions(options);
|
|
40
33
|
this.container = quill.addContainer("ql-counter");
|
|
41
34
|
quill.on(Quill.events.TEXT_CHANGE, this.renderCount);
|
|
35
|
+
this.quill.on(editor_config.CHANGE_LANGUAGE_EVENT, () => {
|
|
36
|
+
this.options = this.resolveOptions(options);
|
|
37
|
+
this.renderCount();
|
|
38
|
+
});
|
|
42
39
|
this.renderCount();
|
|
43
40
|
}
|
|
41
|
+
resolveOptions(options) {
|
|
42
|
+
return Object.assign({
|
|
43
|
+
format: "text",
|
|
44
|
+
unit: "char",
|
|
45
|
+
template: this.quill.options.langText["counter-template"],
|
|
46
|
+
count: 500
|
|
47
|
+
}, options);
|
|
48
|
+
}
|
|
44
49
|
getContentLength(format) {
|
|
45
50
|
let content = this.quill.getText();
|
|
46
51
|
if (format === "html") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/counter/index.ts"],"sourcesContent":["import type { ICounterOption } from '../config/types'\r\nimport Quill from 'quill'\r\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/counter/index.ts"],"sourcesContent":["import type { FluentEditor } from 'src/fluent-editor'\r\nimport type { ICounterOption } from '../config/types'\r\nimport Quill from 'quill'\r\nimport { CHANGE_LANGUAGE_EVENT } from '../config'\r\n\r\nexport default class Counter {\r\n container: HTMLDivElement\r\n options: ICounterOption\r\n\r\n constructor(public quill: FluentEditor, options: ICounterOption) {\r\n this.options = this.resolveOptions(options)\r\n this.container = quill.addContainer('ql-counter')\r\n quill.on(Quill.events.TEXT_CHANGE, this.renderCount)\r\n this.quill.on(CHANGE_LANGUAGE_EVENT, () => {\r\n this.options = this.resolveOptions(options)\r\n this.renderCount()\r\n })\r\n this.renderCount()\r\n }\r\n\r\n resolveOptions(options: ICounterOption) {\r\n return Object.assign({\r\n format: 'text',\r\n unit: 'char',\r\n template: this.quill.options.langText['counter-template'],\r\n count: 500,\r\n }, options)\r\n }\r\n\r\n renderCount = () => {\r\n setTimeout(() => {\r\n // @ts-ignore\r\n const { format, count: totalCount, unit, template: counterTemplate, errorTemplate } = this.options\r\n const count = this.getContentLength(format)\r\n const restCount = totalCount - count\r\n const countUnit = unit === 'char' ? this.quill.options.langText.char : this.quill.options.langText.word\r\n let template: any = counterTemplate\r\n if (typeof template === 'function') {\r\n template = template(count, restCount)\r\n }\r\n const desc = template.replace('{{count}}', count)\r\n .replace('{{totalCount}}', String(totalCount))\r\n .replace('{{restCount}}', String(restCount))\r\n .replace(/{{countUnit}}/g, countUnit)\r\n\r\n let limitTemplate: any = errorTemplate || this.quill.options.langText['counter-limit-tips']\r\n if (typeof limitTemplate === 'function') {\r\n limitTemplate = limitTemplate(count, restCount)\r\n }\r\n const limitTips = limitTemplate.replace('{{countUnit}}', countUnit)\r\n if (restCount < 0) {\r\n this.container.innerHTML = errorTemplate ? limitTips : `<span style=\"color:red\">${limitTips}</span>`\r\n }\r\n else {\r\n this.container.innerHTML = desc\r\n }\r\n })\r\n }\r\n\r\n getContentLength(format) {\r\n let content = this.quill.getText()\r\n if (format === 'html') {\r\n let html = this.quill.root.innerHTML\r\n // 编辑器初始时\r\n if (html === '<p><br></p>' || html === '<div><br><div>') {\r\n html = ''\r\n }\r\n content = html\r\n }\r\n const text = content.replace(/\\s/g, '').trim()\r\n if (this.options.unit === 'word') {\r\n return !content.trim() ? 0 : content.tr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AAC1C,WAAK,YAAY;AAAA,IAAA,CAClB;AACD,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,eAAe,SAAyB;AACtC,WAAO,OAAO,OAAO;AAAA,MACnB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,UAAU,KAAK,MAAM,QAAQ,SAAS,kBAAkB;AAAA,MACxD,OAAO;AAAA,OACN,OAAO;AAAA,EACZ;AAAA,EAgCA,iBAAiB,QAAQ;AACnB,QAAA,UAAU,KAAK,MAAM,QAAQ;AACjC,QAAI,WAAW,QAAQ;AACjB,UAAA,OAAO,KAAK,MAAM,KAAK;AAEvB,UAAA,SAAS,iBAAiB,SAAS,kBAAkB;AAChD,eAAA;AAAA,MACT;AACU,gBAAA;AAAA,IACZ;AACA,UAAM,OAAO,QAAQ,QAAQ,OAAO,EAAE,EAAE;AACpC,QAAA,KAAK,QAAQ,SAAS,QAAQ;AACzB,aAAA,CAAC,QAAQ,KAAS,IAAA,IAAI,QAAQ,KAAK,EAAE,MAAM,KAAK,EAAE;AAAA,IAC3D;AACA,WAAO,KAAK;AAAA,EACd;AACF;;"}
|
|
@@ -4,7 +4,7 @@ const Quill = require("quill");
|
|
|
4
4
|
const base64Image = require("./config/base64-image.cjs.js");
|
|
5
5
|
const editor_config = require("./config/editor.config.cjs.js");
|
|
6
6
|
const editor_utils = require("./config/editor.utils.cjs.js");
|
|
7
|
-
const Clipboard = Quill.
|
|
7
|
+
const Clipboard = Quill.import("modules/clipboard");
|
|
8
8
|
const Delta = Quill.import("delta");
|
|
9
9
|
class CustomClipboard extends Clipboard {
|
|
10
10
|
prepareMatching(container, nodeMatches) {
|
|
@@ -110,7 +110,7 @@ class CustomClipboard extends Clipboard {
|
|
|
110
110
|
let loadingTipsContainer;
|
|
111
111
|
if (deltaLength > editor_config.BIG_DELTA_LIMIT) {
|
|
112
112
|
loadingTipsContainer = this.quill.addContainer("ql-loading-tips");
|
|
113
|
-
loadingTipsContainer.innerHTML =
|
|
113
|
+
loadingTipsContainer.innerHTML = this.quill.options.langText.pasting;
|
|
114
114
|
}
|
|
115
115
|
const linePos = { index: range.index, length: range.length, fix: 0 };
|
|
116
116
|
const [line, offset] = this.quill.getLine(range.index);
|
|
@@ -341,7 +341,7 @@ class CustomClipboard extends Clipboard {
|
|
|
341
341
|
});
|
|
342
342
|
} else if (image.src.startsWith("http")) {
|
|
343
343
|
} else {
|
|
344
|
-
const errorImagePlaceholderJpg =
|
|
344
|
+
const errorImagePlaceholderJpg = this.quill.options.langText["img-error"] === "Image Copy Error" ? base64Image.ERROR_IMAGE_PLACEHOLDER_EN : base64Image.ERROR_IMAGE_PLACEHOLDER_CN;
|
|
345
345
|
file = await editor_utils.imageUrlToFile(errorImagePlaceholderJpg, true);
|
|
346
346
|
isPlaceholderImage = true;
|
|
347
347
|
}
|