@opentiny/fluent-editor 3.22.0 → 3.23.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/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/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/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
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Fluent Editor
|
|
2
2
|
|
|
3
3
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
4
|
+
|
|
4
5
|
[](#contributors-)
|
|
6
|
+
|
|
5
7
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
6
8
|
|
|
7
9
|
Fluent Editor is a rich text editor based on Quill 2.0, which extends Quill with rich modules and formats such as tables, images, hyperlinks, copy and paste, inserting emoticons, file uploads, @ reminders, and diagonal menu. It is framework-independent, compatible with Quill API, and compatible with Quill module ecosystem.
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { EN_US } from "./i18n/en-us.es.js";
|
|
2
2
|
import { ZH_CN } from "./i18n/zh-cn.es.js";
|
|
3
3
|
const BIG_DELTA_LIMIT = 2e3;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const LANG_CONF = {
|
|
5
|
+
"en-US": EN_US,
|
|
6
|
+
"zh-CN": ZH_CN
|
|
7
|
+
};
|
|
8
|
+
const CHANGE_LANGUAGE_EVENT = "change-language";
|
|
9
|
+
const defaultLanguage = "en-US";
|
|
6
10
|
const IMAGE_UPLOADER_MIME_TYPES = [
|
|
7
11
|
"image/png",
|
|
8
12
|
"image/jpeg",
|
|
@@ -74,6 +78,7 @@ const FILE_UPLOADER_MIME_TYPES = [
|
|
|
74
78
|
export {
|
|
75
79
|
AUDIO_VIDEO_UPLOADER_MIME_TYPES,
|
|
76
80
|
BIG_DELTA_LIMIT,
|
|
81
|
+
CHANGE_LANGUAGE_EVENT,
|
|
77
82
|
COMPRESSED_UPLOADER_MIME_TYPES,
|
|
78
83
|
DOC_UPLOADER_MIME_TYPES,
|
|
79
84
|
FILE_UPLOADER_MIME_TYPES,
|
|
@@ -81,6 +86,7 @@ export {
|
|
|
81
86
|
LANG_CONF,
|
|
82
87
|
OTHER_FILE_UPLOADER_MIME_TYPES,
|
|
83
88
|
PPT_UPLOADER_MIME_TYPES,
|
|
84
|
-
XSL_UPLOADER_MIME_TYPES
|
|
89
|
+
XSL_UPLOADER_MIME_TYPES,
|
|
90
|
+
defaultLanguage
|
|
85
91
|
};
|
|
86
92
|
//# sourceMappingURL=editor.config.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.config.es.js","sources":["../../../src/config/editor.config.ts"],"sourcesContent":["import { EN_US } from './i18n/en-us'\r\nimport { ZH_CN } from './i18n/zh-cn'\r\n\r\n// Delta数据行太多超出该限制时,加载会比较慢,需要提示用户\r\nexport const BIG_DELTA_LIMIT = 2000\r\
|
|
1
|
+
{"version":3,"file":"editor.config.es.js","sources":["../../../src/config/editor.config.ts"],"sourcesContent":["import { EN_US } from './i18n/en-us'\r\nimport { ZH_CN } from './i18n/zh-cn'\r\n\r\n// Delta数据行太多超出该限制时,加载会比较慢,需要提示用户\r\nexport const BIG_DELTA_LIMIT = 2000\r\nexport const LANG_CONF = {\r\n 'en-US': EN_US,\r\n 'zh-CN': ZH_CN,\r\n}\r\nexport const CHANGE_LANGUAGE_EVENT = 'change-language'\r\nexport const defaultLanguage = 'en-US'\r\n\r\n// Image\r\nexport const IMAGE_UPLOADER_MIME_TYPES = [\r\n 'image/png',\r\n 'image/jpeg',\r\n 'image/gif',\r\n 'image/svg+xml',\r\n]\r\n\r\n// 常用文件格式\r\nexport const OTHER_FILE_UPLOADER_MIME_TYPES = [\r\n 'text/plain',\r\n 'application/json',\r\n 'application/pdf',\r\n]\r\n\r\nexport const AUDIO_VIDEO_UPLOADER_MIME_TYPES = [\r\n 'audio/wave',\r\n 'audio/wav',\r\n 'audio/x-wav',\r\n 'audio/x-pn-wav',\r\n 'audio/mpeg',\r\n 'video/mpeg',\r\n 'video/x-msvideo',\r\n]\r\n\r\n// MS office\r\nexport const DOC_UPLOADER_MIME_TYPES = [\r\n 'application/msword',\r\n 'application/msword',\r\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\r\n 'application/vnd.ms-word.document.macroEnabled.12',\r\n 'application/vnd.ms-word.template.macroEnabled.12',\r\n]\r\n\r\nexport const XSL_UPLOADER_MIME_TYPES = [\r\n 'application/vnd.ms-excel',\r\n 'application/vnd.ms-excel',\r\n 'application/vnd.ms-excel',\r\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\r\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\r\n 'application/vnd.ms-excel.sheet.macroEnabled.12',\r\n 'application/vnd.ms-excel.template.macroEnabled.12',\r\n 'application/vnd.ms-excel.addin.macroEnabled.12',\r\n 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\r\n]\r\n\r\nexport const PPT_UPLOADER_MIME_TYPES = [\r\n 'application/vnd.ms-powerpoint',\r\n 'application/vnd.ms-powerpoint',\r\n 'application/vnd.ms-powerpoint',\r\n 'application/vnd.ms-powerpoint',\r\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\r\n 'application/vnd.openxmlformats-officedocument.presentationml.template',\r\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\r\n 'application/vnd.ms-powerpoint.addin.macroEnabled.12',\r\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',\r\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',\r\n 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',\r\n]\r\n\r\n// Compressed files\r\nexport const COMPRESSED_UPLOADER_MIME_TYPES = [\r\n 'application/x-tar',\r\n 'application/x-zip-compressed',\r\n 'application/zip-compressed',\r\n 'application/gzip',\r\n '.rar',\r\n '.7z',\r\n]\r\n\r\n// default\r\nexport const FILE_UPLOADER_MIME_TYPES = [\r\n ...OTHER_FILE_UPLOADER_MIME_TYPES,\r\n ...AUDIO_VIDEO_UPLOADER_MIME_TYPES,\r\n ...DOC_UPLOADER_MIME_TYPES,\r\n ...XSL_UPLOADER_MIME_TYPES,\r\n ...PPT_UPLOADER_MIME_TYPES,\r\n ...COMPRESSED_UPLOADER_MIME_TYPES,\r\n]\r\n"],"names":[],"mappings":";;AAIO,MAAM,kBAAkB;AACxB,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,SAAS;AACX;AACO,MAAM,wBAAwB;AAC9B,MAAM,kBAAkB;AAGxB,MAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,iCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,kCAAkC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,iCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,2BAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
const EN_US = {
|
|
2
|
-
"undo": "Undo",
|
|
3
|
-
"redo": "Redo",
|
|
4
|
-
"clean": "Clear Formatting",
|
|
5
2
|
"header": "Paragraph Formatting",
|
|
6
3
|
"normal": "Normal",
|
|
7
4
|
"h1": "Heading 1",
|
|
@@ -10,38 +7,17 @@ const EN_US = {
|
|
|
10
7
|
"h4": "Heading 4",
|
|
11
8
|
"h5": "Heading 5",
|
|
12
9
|
"h6": "Heading 6",
|
|
13
|
-
"font": "Font",
|
|
14
|
-
"size": "Size",
|
|
15
10
|
"lineheight": "Line Height",
|
|
16
11
|
"songti": "SimSun",
|
|
17
12
|
"yahei": "Microsoft Yahei",
|
|
18
13
|
"kaiti": "KaiTi",
|
|
19
14
|
"heiti": "SimHei",
|
|
20
15
|
"lishu": "LiSu",
|
|
21
|
-
"bold": "Bold",
|
|
22
|
-
"italic": "Italic",
|
|
23
|
-
"underline": "Underline",
|
|
24
|
-
"strike": "Strikethrough",
|
|
25
|
-
"color": "Font Color",
|
|
26
|
-
"background": "Background Color",
|
|
27
|
-
"orderedlist": "Ordered List",
|
|
28
|
-
"bulletlist": "Unordered List",
|
|
29
|
-
"checklist": "Task List",
|
|
30
16
|
"left": "Left",
|
|
31
17
|
"center": "Centered",
|
|
32
18
|
"right": "Right",
|
|
33
|
-
"image": "Image",
|
|
34
|
-
"file": "File",
|
|
35
|
-
"table": "Table",
|
|
36
|
-
"link": "Hyperlink",
|
|
37
|
-
"code": "Inline Code",
|
|
38
19
|
"codeblock": "Code Block",
|
|
39
|
-
"blockquote": "Quote",
|
|
40
|
-
"superscript": "Superscript",
|
|
41
|
-
"subscript": "Subscript",
|
|
42
20
|
"globallink": "Link",
|
|
43
|
-
"emoji": "Emoji",
|
|
44
|
-
"fullscreen": "Full Screen",
|
|
45
21
|
"exit-fullscreen": "Exit Full Screen",
|
|
46
22
|
"help": "Help",
|
|
47
23
|
"more": "More",
|
|
@@ -79,10 +55,55 @@ const EN_US = {
|
|
|
79
55
|
"pasting": "A large amount of content to paste. Loading...",
|
|
80
56
|
"img-error": "Image Copy Error",
|
|
81
57
|
"img-error-info": "Failed to copy the image. Save it to your local computer and then upload it by clicking Image on the toolbar.",
|
|
82
|
-
"
|
|
58
|
+
"last-modified": "Last Modified Date:",
|
|
83
59
|
"screenshot": "Screenshot",
|
|
84
60
|
"uploading": "Uploading...",
|
|
85
|
-
"
|
|
61
|
+
"sub-title-bg-color": "Background Color",
|
|
62
|
+
// blot tip name
|
|
63
|
+
"emoji": "Emoji",
|
|
64
|
+
"fullscreen": "Full Screen",
|
|
65
|
+
"blockquote": "Quote",
|
|
66
|
+
"undo": "Undo",
|
|
67
|
+
"redo": "Redo",
|
|
68
|
+
"clean": "Clear Formatting",
|
|
69
|
+
"bold": "Bold",
|
|
70
|
+
"italic": "Italic",
|
|
71
|
+
"underline": "Underline",
|
|
72
|
+
"strike": "Strikethrough",
|
|
73
|
+
"image": "Image",
|
|
74
|
+
"file": "File",
|
|
75
|
+
"table": "Table",
|
|
76
|
+
"link": "Hyperlink",
|
|
77
|
+
"code": "Inline Code",
|
|
78
|
+
"better-table": "Table",
|
|
79
|
+
"code-block": "Code Block",
|
|
80
|
+
"formula": "Formula",
|
|
81
|
+
"format-painter": "Format Painter",
|
|
82
|
+
"video": "Video",
|
|
83
|
+
"color": "Font Color",
|
|
84
|
+
"background": "Background Color",
|
|
85
|
+
"font": "Font",
|
|
86
|
+
"size": "Size",
|
|
87
|
+
"list-ordered": "Ordered List",
|
|
88
|
+
"list-bullet": "Unordered List",
|
|
89
|
+
"list-check": "Task List",
|
|
90
|
+
"align-left": "Left aligned",
|
|
91
|
+
"align-center": "Center aligned",
|
|
92
|
+
"align-right": "Right aligned",
|
|
93
|
+
"align-justify": "Justify aligned",
|
|
94
|
+
"direction-ltr": "Text Direction Left To Right",
|
|
95
|
+
"direction-rtl": "Text Direction Right To Left",
|
|
96
|
+
"indent--1": "Minus Indent",
|
|
97
|
+
"indent-+1": "Add Indent",
|
|
98
|
+
"script-super": "Superscript",
|
|
99
|
+
"script-sub": "Subscript",
|
|
100
|
+
"header-normal": "Text",
|
|
101
|
+
"header-1": "Heading 1",
|
|
102
|
+
"header-2": "Heading 2",
|
|
103
|
+
"header-3": "Heading 3",
|
|
104
|
+
"header-4": "Heading 4",
|
|
105
|
+
"header-5": "Heading 5",
|
|
106
|
+
"header-6": "Heading 6"
|
|
86
107
|
};
|
|
87
108
|
export {
|
|
88
109
|
EN_US
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-us.es.js","sources":["../../../../src/config/i18n/en-us.ts"],"sourcesContent":["export const EN_US = {\r\n
|
|
1
|
+
{"version":3,"file":"en-us.es.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,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;AAAA,EACjB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EAEvB,eAAe;AAAA,EACf,iBAAiB;AAAA,EAEjB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAEhB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,sBACE;AAAA,EACF,UACE;AAAA,EAEF,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,kBACE;AAAA,EAEF,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,sBAAsB;AAAA;AAAA,EAGtB,SAAS;AAAA,EACT,cAAc;AAAA,EACd,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,aAAa;AAAA,EACb,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,iBAAiB;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,7 +1,4 @@
|
|
|
1
1
|
const ZH_CN = {
|
|
2
|
-
"undo": "撤销",
|
|
3
|
-
"redo": "重做",
|
|
4
|
-
"clean": "清除格式",
|
|
5
2
|
"header": "段落格式",
|
|
6
3
|
"normal": "正文",
|
|
7
4
|
"h1": "标题1",
|
|
@@ -10,38 +7,17 @@ const ZH_CN = {
|
|
|
10
7
|
"h4": "标题4",
|
|
11
8
|
"h5": "标题5",
|
|
12
9
|
"h6": "标题6",
|
|
13
|
-
"font": "字体",
|
|
14
|
-
"size": "字号",
|
|
15
10
|
"lineheight": "行距",
|
|
16
11
|
"songti": "宋体",
|
|
17
12
|
"yahei": "微软雅黑",
|
|
18
13
|
"kaiti": "楷体",
|
|
19
14
|
"heiti": "黑体",
|
|
20
15
|
"lishu": "隶书",
|
|
21
|
-
"bold": "粗体",
|
|
22
|
-
"italic": "斜体",
|
|
23
|
-
"underline": "下划线",
|
|
24
|
-
"strike": "删除线",
|
|
25
|
-
"color": "字体颜色",
|
|
26
|
-
"background": "背景色",
|
|
27
|
-
"orderedlist": "有序列表",
|
|
28
|
-
"bulletlist": "无序列表",
|
|
29
|
-
"checklist": "任务列表",
|
|
30
16
|
"left": "左对齐",
|
|
31
17
|
"center": "居中对齐",
|
|
32
18
|
"right": "右对齐",
|
|
33
|
-
"image": "图片",
|
|
34
|
-
"file": "文件",
|
|
35
|
-
"table": "表格",
|
|
36
|
-
"link": "超链接",
|
|
37
|
-
"code": "行内代码",
|
|
38
19
|
"codeblock": "代码块",
|
|
39
|
-
"blockquote": "引用",
|
|
40
|
-
"superscript": "上标",
|
|
41
|
-
"subscript": "下标",
|
|
42
20
|
"globallink": "全局链接",
|
|
43
|
-
"emoji": "表情",
|
|
44
|
-
"fullscreen": "全屏",
|
|
45
21
|
"exit-fullscreen": "退出全屏",
|
|
46
22
|
"help": "帮助",
|
|
47
23
|
"more": "更多",
|
|
@@ -79,10 +55,55 @@ const ZH_CN = {
|
|
|
79
55
|
"pasting": "您粘贴的内容较多,正在努力加载中,请耐心等待...",
|
|
80
56
|
"img-error": "图片复制出错",
|
|
81
57
|
"img-error-info": "此图片不支持复制,请将原图下载至本地后点击工具栏【插入图片】,重新上传。",
|
|
82
|
-
"
|
|
58
|
+
"last-modified": "最后修改时间:",
|
|
83
59
|
"screenshot": "截图",
|
|
84
60
|
"uploading": "上传中...",
|
|
85
|
-
"
|
|
61
|
+
"sub-title-bg-color": "背景颜色",
|
|
62
|
+
// blot tip name
|
|
63
|
+
"emoji": "表情",
|
|
64
|
+
"fullscreen": "全屏",
|
|
65
|
+
"blockquote": "引用",
|
|
66
|
+
"undo": "撤销",
|
|
67
|
+
"redo": "重做",
|
|
68
|
+
"clean": "清除格式",
|
|
69
|
+
"bold": "粗体",
|
|
70
|
+
"italic": "斜体",
|
|
71
|
+
"underline": "下划线",
|
|
72
|
+
"strike": "删除线",
|
|
73
|
+
"image": "图片",
|
|
74
|
+
"file": "文件",
|
|
75
|
+
"table": "表格",
|
|
76
|
+
"link": "超链接",
|
|
77
|
+
"code": "行内代码",
|
|
78
|
+
"better-table": "表格",
|
|
79
|
+
"code-block": "代码块",
|
|
80
|
+
"formula": "公式",
|
|
81
|
+
"format-painter": "格式刷",
|
|
82
|
+
"video": "视频",
|
|
83
|
+
"color": "字体颜色",
|
|
84
|
+
"background": "背景色",
|
|
85
|
+
"font": "字体",
|
|
86
|
+
"size": "字号",
|
|
87
|
+
"list-ordered": "有序列表",
|
|
88
|
+
"list-bullet": "无序列表",
|
|
89
|
+
"list-check": "任务列表",
|
|
90
|
+
"align-left": "左对齐",
|
|
91
|
+
"align-center": "居中对齐",
|
|
92
|
+
"align-right": "右对齐",
|
|
93
|
+
"align-justify": "两端对齐",
|
|
94
|
+
"direction-ltr": "文本方向左到右",
|
|
95
|
+
"direction-rtl": "文本方向右到左",
|
|
96
|
+
"indent--1": "减少缩进",
|
|
97
|
+
"indent-+1": "增加缩进",
|
|
98
|
+
"script-super": "上标",
|
|
99
|
+
"script-sub": "下标",
|
|
100
|
+
"header-normal": "正文",
|
|
101
|
+
"header-1": "标题1",
|
|
102
|
+
"header-2": "标题2",
|
|
103
|
+
"header-3": "标题3",
|
|
104
|
+
"header-4": "标题4",
|
|
105
|
+
"header-5": "标题5",
|
|
106
|
+
"header-6": "标题6"
|
|
86
107
|
};
|
|
87
108
|
export {
|
|
88
109
|
ZH_CN
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh-cn.es.js","sources":["../../../../src/config/i18n/zh-cn.ts"],"sourcesContent":["export const ZH_CN = {\r\n '
|
|
1
|
+
{"version":3,"file":"zh-cn.es.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;AAAA,EACjB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EAEvB,eAAe;AAAA,EACf,iBAAiB;AAAA,EAEjB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAEhB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,sBAAsB;AAAA,EACtB,UAAU;AAAA,EAEV,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,kBACE;AAAA,EAEF,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,sBAAsB;AAAA;AAAA,EAGtB,SAAS;AAAA,EACT,cAAc;AAAA,EACd,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,aAAa;AAAA,EACb,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,iBAAiB;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;"}
|
package/es/config/index.es.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { LANG_CONF } from "./editor.config.es.js";
|
|
2
|
-
import { AUDIO_VIDEO_UPLOADER_MIME_TYPES, BIG_DELTA_LIMIT, COMPRESSED_UPLOADER_MIME_TYPES, DOC_UPLOADER_MIME_TYPES, FILE_UPLOADER_MIME_TYPES, IMAGE_UPLOADER_MIME_TYPES, OTHER_FILE_UPLOADER_MIME_TYPES, PPT_UPLOADER_MIME_TYPES, XSL_UPLOADER_MIME_TYPES } from "./editor.config.es.js";
|
|
3
1
|
import { isNullOrUndefined } from "./editor.utils.es.js";
|
|
4
2
|
import { 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 } from "./icons.config.es.js";
|
|
3
|
+
import { AUDIO_VIDEO_UPLOADER_MIME_TYPES, BIG_DELTA_LIMIT, CHANGE_LANGUAGE_EVENT, COMPRESSED_UPLOADER_MIME_TYPES, DOC_UPLOADER_MIME_TYPES, FILE_UPLOADER_MIME_TYPES, IMAGE_UPLOADER_MIME_TYPES, LANG_CONF, OTHER_FILE_UPLOADER_MIME_TYPES, PPT_UPLOADER_MIME_TYPES, XSL_UPLOADER_MIME_TYPES, defaultLanguage } from "./editor.config.es.js";
|
|
5
4
|
const ICONS_CONFIG = {
|
|
6
5
|
"undo": UNDO_ICON,
|
|
7
6
|
"redo": REDO_ICON,
|
|
@@ -47,47 +46,6 @@ const ICONS_CONFIG = {
|
|
|
47
46
|
"screenshot": SCREENSHOT_ICON,
|
|
48
47
|
"format-painter": FORMAT_PAINTER_ICON
|
|
49
48
|
};
|
|
50
|
-
const TABLE_RIGHT_MENU_CONFIG = {
|
|
51
|
-
copyCells: {
|
|
52
|
-
text: LANG_CONF["copy-cells"]
|
|
53
|
-
},
|
|
54
|
-
copyTable: {
|
|
55
|
-
text: LANG_CONF["copy-table"]
|
|
56
|
-
},
|
|
57
|
-
cutCells: {
|
|
58
|
-
text: LANG_CONF["cut-cells"]
|
|
59
|
-
},
|
|
60
|
-
emptyCells: {
|
|
61
|
-
text: LANG_CONF["empty-cells"]
|
|
62
|
-
},
|
|
63
|
-
insertRowUp: {
|
|
64
|
-
text: LANG_CONF["insert-row-up"]
|
|
65
|
-
},
|
|
66
|
-
insertRowDown: {
|
|
67
|
-
text: LANG_CONF["insert-row-down"]
|
|
68
|
-
},
|
|
69
|
-
insertColumnLeft: {
|
|
70
|
-
text: LANG_CONF["insert-column-left"]
|
|
71
|
-
},
|
|
72
|
-
insertColumnRight: {
|
|
73
|
-
text: LANG_CONF["insert-column-right"]
|
|
74
|
-
},
|
|
75
|
-
mergeCells: {
|
|
76
|
-
text: LANG_CONF["merge-cells"]
|
|
77
|
-
},
|
|
78
|
-
unmergeCells: {
|
|
79
|
-
text: LANG_CONF["unmerge-cells"]
|
|
80
|
-
},
|
|
81
|
-
deleteRow: {
|
|
82
|
-
text: LANG_CONF["delete-row"]
|
|
83
|
-
},
|
|
84
|
-
deleteColumn: {
|
|
85
|
-
text: LANG_CONF["delete-column"]
|
|
86
|
-
},
|
|
87
|
-
deleteTable: {
|
|
88
|
-
text: LANG_CONF["delete-table"]
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
49
|
function inputFile(type, accept) {
|
|
92
50
|
const defaultMIMETypes = this.quill.uploader.options[type].join(", ");
|
|
93
51
|
const mimeTypes = accept || defaultMIMETypes;
|
|
@@ -126,6 +84,7 @@ const namespace = "fe";
|
|
|
126
84
|
export {
|
|
127
85
|
AUDIO_VIDEO_UPLOADER_MIME_TYPES,
|
|
128
86
|
BIG_DELTA_LIMIT,
|
|
87
|
+
CHANGE_LANGUAGE_EVENT,
|
|
129
88
|
COMPRESSED_UPLOADER_MIME_TYPES,
|
|
130
89
|
DOC_UPLOADER_MIME_TYPES,
|
|
131
90
|
FILE_UPLOADER_MIME_TYPES,
|
|
@@ -134,8 +93,8 @@ export {
|
|
|
134
93
|
LANG_CONF,
|
|
135
94
|
OTHER_FILE_UPLOADER_MIME_TYPES,
|
|
136
95
|
PPT_UPLOADER_MIME_TYPES,
|
|
137
|
-
TABLE_RIGHT_MENU_CONFIG,
|
|
138
96
|
XSL_UPLOADER_MIME_TYPES,
|
|
97
|
+
defaultLanguage,
|
|
139
98
|
getListValue,
|
|
140
99
|
inputFile,
|
|
141
100
|
namespace
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../src/config/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.es.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":[],"mappings":";;;AAoCO,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EAET,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,aAAa;AAAA,EACb,UAAU;AAAA,EAEV,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,SAAS;AAAA,MACL,UAAU;AAAA,MACV,kBAAkB;AAAA;AAAA;AAAA,EAGtB,cAAc;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA;AAAA;AAAA,EAItB,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EAEA,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,cAAc;AAAA,EAEd,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,kBAAkB;AACpB;AAGgB,SAAA,UAAU,MAAM,QAAQ;AAChC,QAAA,mBAAmB,KAAK,MAAM,SAAS,QAAQ,IAAI,EAAE,KAAK,IAAI;AACpE,QAAM,YAAY,UAAU;AAC5B,MAAI,YAAY,KAAK,UAAU,cAAc,YAAY,IAAI,aAAa;AACtE,MAAA,kBAAkB,SAAS,GAAG;AACpB,gBAAA,SAAS,cAAc,OAAO;AAC1C,cAAU,UAAU,IAAI,MAAM,IAAI,EAAE;AAC1B,cAAA,aAAa,QAAQ,MAAM;AAC3B,cAAA,aAAa,UAAU,SAAS;AAExC,QAAA,KAAK,MAAM,SAAS,QAAQ,sBAAsB,QAC9C,KAAK,MAAM,SAAS,QAAQ,kBAAkB,QAAQ,SAAS,UAC/D,KAAK,MAAM,SAAS,QAAQ,kBAAkB,SAAS,SAAS,SACpE;AACU,gBAAA,aAAa,YAAY,EAAE;AAAA,IACvC;AACU,cAAA,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/es/counter/index.es.js
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
import Quill from "quill";
|
|
2
2
|
import "../config/index.es.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CHANGE_LANGUAGE_EVENT } from "../config/editor.config.es.js";
|
|
4
4
|
class Counter {
|
|
5
|
-
// @ts-ignore
|
|
6
5
|
constructor(quill, options) {
|
|
7
6
|
this.quill = quill;
|
|
8
|
-
this.defaultOptions = {
|
|
9
|
-
format: "text",
|
|
10
|
-
unit: "char",
|
|
11
|
-
template: LANG_CONF["counter-template"],
|
|
12
|
-
count: 500
|
|
13
|
-
};
|
|
14
7
|
this.renderCount = () => {
|
|
15
8
|
setTimeout(() => {
|
|
16
9
|
const { format, count: totalCount, unit, template: counterTemplate, errorTemplate } = this.options;
|
|
17
10
|
const count = this.getContentLength(format);
|
|
18
11
|
const restCount = totalCount - count;
|
|
19
|
-
const countUnit = unit === "char" ?
|
|
12
|
+
const countUnit = unit === "char" ? this.quill.options.langText.char : this.quill.options.langText.word;
|
|
20
13
|
let template = counterTemplate;
|
|
21
14
|
if (typeof template === "function") {
|
|
22
15
|
template = template(count, restCount);
|
|
23
16
|
}
|
|
24
17
|
const desc = template.replace("{{count}}", count).replace("{{totalCount}}", String(totalCount)).replace("{{restCount}}", String(restCount)).replace(/{{countUnit}}/g, countUnit);
|
|
25
|
-
let limitTemplate = errorTemplate ||
|
|
18
|
+
let limitTemplate = errorTemplate || this.quill.options.langText["counter-limit-tips"];
|
|
26
19
|
if (typeof limitTemplate === "function") {
|
|
27
20
|
limitTemplate = limitTemplate(count, restCount);
|
|
28
21
|
}
|
|
@@ -34,11 +27,23 @@ class Counter {
|
|
|
34
27
|
}
|
|
35
28
|
});
|
|
36
29
|
};
|
|
37
|
-
this.options =
|
|
30
|
+
this.options = this.resolveOptions(options);
|
|
38
31
|
this.container = quill.addContainer("ql-counter");
|
|
39
32
|
quill.on(Quill.events.TEXT_CHANGE, this.renderCount);
|
|
33
|
+
this.quill.on(CHANGE_LANGUAGE_EVENT, () => {
|
|
34
|
+
this.options = this.resolveOptions(options);
|
|
35
|
+
this.renderCount();
|
|
36
|
+
});
|
|
40
37
|
this.renderCount();
|
|
41
38
|
}
|
|
39
|
+
resolveOptions(options) {
|
|
40
|
+
return Object.assign({
|
|
41
|
+
format: "text",
|
|
42
|
+
unit: "char",
|
|
43
|
+
template: this.quill.options.langText["counter-template"],
|
|
44
|
+
count: 500
|
|
45
|
+
}, options);
|
|
46
|
+
}
|
|
42
47
|
getContentLength(format) {
|
|
43
48
|
let content = this.quill.getText();
|
|
44
49
|
if (format === "html") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.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.es.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.trim().split(/\\s+/).length\r\n }\r\n return text.length\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAKA,MAAqB,QAAQ;AAAA,EAI3B,YAAmB,OAAqB,SAAyB;AAA9C,SAAA,QAAA;AAoBnB,SAAA,cAAc,MAAM;AAClB,iBAAW,MAAM;AAET,cAAA,EAAE,QAAQ,OAAO,YAAY,MAAM,UAAU,iBAAiB,cAAc,IAAI,KAAK;AACrF,cAAA,QAAQ,KAAK,iBAAiB,MAAM;AAC1C,cAAM,YAAY,aAAa;AACzB,cAAA,YAAY,SAAS,SAAS,KAAK,MAAM,QAAQ,SAAS,OAAO,KAAK,MAAM,QAAQ,SAAS;AACnG,YAAI,WAAgB;AAChB,YAAA,OAAO,aAAa,YAAY;AACvB,qBAAA,SAAS,OAAO,SAAS;AAAA,QACtC;AACM,cAAA,OAAO,SAAS,QAAQ,aAAa,KAAK,EAC7C,QAAQ,kBAAkB,OAAO,UAAU,CAAC,EAC5C,QAAQ,iBAAiB,OAAO,SAAS,CAAC,EAC1C,QAAQ,kBAAkB,SAAS;AAEtC,YAAI,gBAAqB,iBAAiB,KAAK,MAAM,QAAQ,SAAS,oBAAoB;AACtF,YAAA,OAAO,kBAAkB,YAAY;AACvB,0BAAA,cAAc,OAAO,SAAS;AAAA,QAChD;AACA,cAAM,YAAY,cAAc,QAAQ,iBAAiB,SAAS;AAClE,YAAI,YAAY,GAAG;AACjB,eAAK,UAAU,YAAY,gBAAgB,YAAY,2BAA2B,SAAS;AAAA,QAAA,OAExF;AACH,eAAK,UAAU,YAAY;AAAA,QAC7B;AAAA,MAAA,CACD;AAAA,IAAA;AA9CI,SAAA,UAAU,KAAK,eAAe,OAAO;AACrC,SAAA,YAAY,MAAM,aAAa,YAAY;AAChD,UAAM,GAAG,MAAM,OAAO,aAAa,KAAK,WAAW;AAC9C,SAAA,MAAM,GAAG,uBAAuB,MAAM;AACpC,WAAA,UAAU,KAAK,eAAe,OAAO;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;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Quill from "quill";
|
|
2
2
|
import { ERROR_IMAGE_PLACEHOLDER_EN, ERROR_IMAGE_PLACEHOLDER_CN } from "./config/base64-image.es.js";
|
|
3
|
-
import { BIG_DELTA_LIMIT
|
|
3
|
+
import { BIG_DELTA_LIMIT } from "./config/editor.config.es.js";
|
|
4
4
|
import { isNullOrUndefined, insideTable, replaceDeltaImage, imageFileToUrl, imageUrlToFile, splitWithBreak, omit, hexToRgbA } from "./config/editor.utils.es.js";
|
|
5
|
-
const Clipboard = Quill.
|
|
5
|
+
const Clipboard = Quill.import("modules/clipboard");
|
|
6
6
|
const Delta = Quill.import("delta");
|
|
7
7
|
class CustomClipboard extends Clipboard {
|
|
8
8
|
prepareMatching(container, nodeMatches) {
|
|
@@ -108,7 +108,7 @@ class CustomClipboard extends Clipboard {
|
|
|
108
108
|
let loadingTipsContainer;
|
|
109
109
|
if (deltaLength > BIG_DELTA_LIMIT) {
|
|
110
110
|
loadingTipsContainer = this.quill.addContainer("ql-loading-tips");
|
|
111
|
-
loadingTipsContainer.innerHTML =
|
|
111
|
+
loadingTipsContainer.innerHTML = this.quill.options.langText.pasting;
|
|
112
112
|
}
|
|
113
113
|
const linePos = { index: range.index, length: range.length, fix: 0 };
|
|
114
114
|
const [line, offset] = this.quill.getLine(range.index);
|
|
@@ -339,7 +339,7 @@ class CustomClipboard extends Clipboard {
|
|
|
339
339
|
});
|
|
340
340
|
} else if (image.src.startsWith("http")) {
|
|
341
341
|
} else {
|
|
342
|
-
const errorImagePlaceholderJpg =
|
|
342
|
+
const errorImagePlaceholderJpg = this.quill.options.langText["img-error"] === "Image Copy Error" ? ERROR_IMAGE_PLACEHOLDER_EN : ERROR_IMAGE_PLACEHOLDER_CN;
|
|
343
343
|
file = await imageUrlToFile(errorImagePlaceholderJpg, true);
|
|
344
344
|
isPlaceholderImage = true;
|
|
345
345
|
}
|