@opentiny/fluent-editor 4.0.0-alpha.14 → 4.0.0-alpha.15

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.
@@ -69,13 +69,40 @@ const FILE_UPLOADER_MIME_TYPES = [
69
69
  ...PPT_UPLOADER_MIME_TYPES,
70
70
  ...COMPRESSED_UPLOADER_MIME_TYPES
71
71
  ];
72
+ const DEFAULT_TOOLBAR = [
73
+ [{ header: [] }],
74
+ ["bold", "italic", "underline", "link"],
75
+ [{ list: "ordered" }, { list: "bullet" }],
76
+ ["clean"]
77
+ ];
78
+ const FULL_TOOLBAR = [
79
+ ["undo", "redo", "clean", "format-painter"],
80
+ [
81
+ { header: [1, 2, 3, 4, 5, 6, false] },
82
+ { font: [false, "宋体", "微软雅黑", "楷体", "黑体", "隶书", "andale mono", "arial", "arial black", "comic sans ms", "impact", "times new roman"] },
83
+ { size: [false, "12px", "14px", "16px", "18px", "20px", "24px", "32px", "36px", "48px", "72px"] },
84
+ { "line-height": [false, "1.2", "1.5", "1.75", "2", "3", "4", "5"] }
85
+ ],
86
+ ["bold", "italic", "strike", "underline", "divider"],
87
+ [{ color: [] }, { background: [] }],
88
+ [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
89
+ [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
90
+ [{ script: "sub" }, { script: "super" }],
91
+ [{ indent: "-1" }, { indent: "+1" }],
92
+ [{ direction: "rtl" }],
93
+ ["link", "blockquote", "code", "code-block"],
94
+ ["image", "file", { "table-up": [] }],
95
+ ["emoji", "video", "formula", "screenshot", "fullscreen"]
96
+ ];
72
97
  export {
73
98
  AUDIO_VIDEO_UPLOADER_MIME_TYPES,
74
99
  BIG_DELTA_LIMIT,
75
100
  CHANGE_LANGUAGE_EVENT,
76
101
  COMPRESSED_UPLOADER_MIME_TYPES,
102
+ DEFAULT_TOOLBAR,
77
103
  DOC_UPLOADER_MIME_TYPES,
78
104
  FILE_UPLOADER_MIME_TYPES,
105
+ FULL_TOOLBAR,
79
106
  IMAGE_UPLOADER_MIME_TYPES,
80
107
  OTHER_FILE_UPLOADER_MIME_TYPES,
81
108
  PPT_UPLOADER_MIME_TYPES,
@@ -1 +1 @@
1
- {"version":3,"file":"editor.config.es.js","sources":["../../../src/config/editor.config.ts"],"sourcesContent":["// Delta数据行太多超出该限制时,加载会比较慢,需要提示用户\r\nexport const BIG_DELTA_LIMIT = 2000\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":"AACO,MAAM,kBAAkB;AAExB,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
+ {"version":3,"file":"editor.config.es.js","sources":["../../../src/config/editor.config.ts"],"sourcesContent":["// Delta数据行太多超出该限制时,加载会比较慢,需要提示用户\r\nexport const BIG_DELTA_LIMIT = 2000\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\r\nexport const DEFAULT_TOOLBAR = [\r\n [{ header: [] }],\r\n ['bold', 'italic', 'underline', 'link'],\r\n [{ list: 'ordered' }, { list: 'bullet' }],\r\n ['clean'],\r\n]\r\n\r\nexport const FULL_TOOLBAR = [\r\n ['undo', 'redo', 'clean', 'format-painter'],\r\n [\r\n { header: [1, 2, 3, 4, 5, 6, false] },\r\n { font: [false, '宋体', '微软雅黑', '楷体', '黑体', '隶书', 'andale mono', 'arial', 'arial black', 'comic sans ms', 'impact', 'times new roman'] },\r\n { size: [false, '12px', '14px', '16px', '18px', '20px', '24px', '32px', '36px', '48px', '72px'] },\r\n { 'line-height': [false, '1.2', '1.5', '1.75', '2', '3', '4', '5'] },\r\n ],\r\n ['bold', 'italic', 'strike', 'underline', 'divider'],\r\n [{ color: [] }, { background: [] }],\r\n [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }],\r\n [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],\r\n [{ script: 'sub' }, { script: 'super' }],\r\n [{ indent: '-1' }, { indent: '+1' }],\r\n [{ direction: 'rtl' }],\r\n ['link', 'blockquote', 'code', 'code-block'],\r\n ['image', 'file', { 'table-up': [] }],\r\n ['emoji', 'video', 'formula', 'screenshot', 'fullscreen'],\r\n]\r\n"],"names":[],"mappings":"AACO,MAAM,kBAAkB;AAExB,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;AAEO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,EAAE,QAAQ,CAAA,GAAI;AAAA,EACf,CAAC,QAAQ,UAAU,aAAa,MAAM;AAAA,EACtC,CAAC,EAAE,MAAM,UAAA,GAAa,EAAE,MAAM,UAAU;AAAA,EACxC,CAAC,OAAO;AACV;AAEO,MAAM,eAAe;AAAA,EAC1B,CAAC,QAAQ,QAAQ,SAAS,gBAAgB;AAAA,EAC1C;AAAA,IACE,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,EAAA;AAAA,IAClC,EAAE,MAAM,CAAC,OAAO,MAAM,QAAQ,MAAM,MAAM,MAAM,eAAe,SAAS,eAAe,iBAAiB,UAAU,iBAAiB,EAAA;AAAA,IACnI,EAAE,MAAM,CAAC,OAAO,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,EAAA;AAAA,IAC9F,EAAE,eAAe,CAAC,OAAO,OAAO,OAAO,QAAQ,KAAK,KAAK,KAAK,GAAG,EAAA;AAAA,EAAE;AAAA,EAErE,CAAC,QAAQ,UAAU,UAAU,aAAa,SAAS;AAAA,EACnD,CAAC,EAAE,OAAO,CAAA,EAAC,GAAK,EAAE,YAAY,CAAA,EAAC,CAAG;AAAA,EAClC,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,SAAA,GAAY,EAAE,OAAO,QAAA,GAAW,EAAE,OAAO,WAAW;AAAA,EAC7E,CAAC,EAAE,MAAM,UAAA,GAAa,EAAE,MAAM,YAAY,EAAE,MAAM,SAAS;AAAA,EAC3D,CAAC,EAAE,QAAQ,MAAA,GAAS,EAAE,QAAQ,SAAS;AAAA,EACvC,CAAC,EAAE,QAAQ,KAAA,GAAQ,EAAE,QAAQ,MAAM;AAAA,EACnC,CAAC,EAAE,WAAW,OAAO;AAAA,EACrB,CAAC,QAAQ,cAAc,QAAQ,YAAY;AAAA,EAC3C,CAAC,SAAS,QAAQ,EAAE,YAAY,CAAA,GAAI;AAAA,EACpC,CAAC,SAAS,SAAS,WAAW,cAAc,YAAY;AAC1D;"}
@@ -1,6 +1,6 @@
1
1
  import { isNullOrUndefined } from "./editor.utils.es.js";
2
2
  import { getEventComposedPath, hadProtocol, hexToRgbA, imageFileToUrl, imageUrlToFile, isInside, omit, replaceDeltaImage, sanitize, splitWithBreak } from "./editor.utils.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, OTHER_FILE_UPLOADER_MIME_TYPES, PPT_UPLOADER_MIME_TYPES, XSL_UPLOADER_MIME_TYPES, defaultLanguage } from "./editor.config.es.js";
3
+ import { AUDIO_VIDEO_UPLOADER_MIME_TYPES, BIG_DELTA_LIMIT, CHANGE_LANGUAGE_EVENT, COMPRESSED_UPLOADER_MIME_TYPES, DEFAULT_TOOLBAR, DOC_UPLOADER_MIME_TYPES, FILE_UPLOADER_MIME_TYPES, FULL_TOOLBAR, IMAGE_UPLOADER_MIME_TYPES, OTHER_FILE_UPLOADER_MIME_TYPES, PPT_UPLOADER_MIME_TYPES, XSL_UPLOADER_MIME_TYPES, defaultLanguage } from "./editor.config.es.js";
4
4
  import "./types/index.es.js";
5
5
  function inputFile(type, accept) {
6
6
  if (accept.length <= 0) return;
@@ -40,8 +40,10 @@ export {
40
40
  BIG_DELTA_LIMIT,
41
41
  CHANGE_LANGUAGE_EVENT,
42
42
  COMPRESSED_UPLOADER_MIME_TYPES,
43
+ DEFAULT_TOOLBAR,
43
44
  DOC_UPLOADER_MIME_TYPES,
44
45
  FILE_UPLOADER_MIME_TYPES,
46
+ FULL_TOOLBAR,
45
47
  IMAGE_UPLOADER_MIME_TYPES,
46
48
  OTHER_FILE_UPLOADER_MIME_TYPES,
47
49
  PPT_UPLOADER_MIME_TYPES,
package/es/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./fluent-editor.es.js";
2
2
  import "./attributors/index.es.js";
3
- import "./config/types/index.es.js";
3
+ import { getListValue, inputFile, namespace } from "./config/index.es.js";
4
4
  import "./formats/index.es.js";
5
5
  import "./modules/index.es.js";
6
6
  import { generateTableUpShortKeyMenu } from "quill-shortcut-key";
@@ -10,6 +10,8 @@ import { SizeStyle } from "./attributors/font-size.es.js";
10
10
  import { FontStyle } from "./attributors/font-style.es.js";
11
11
  import { LineHeightStyle } from "./attributors/line-height.es.js";
12
12
  import { TextIndentStyle } from "./attributors/text-indent.es.js";
13
+ import { AUDIO_VIDEO_UPLOADER_MIME_TYPES, BIG_DELTA_LIMIT, CHANGE_LANGUAGE_EVENT, COMPRESSED_UPLOADER_MIME_TYPES, DEFAULT_TOOLBAR, DOC_UPLOADER_MIME_TYPES, FILE_UPLOADER_MIME_TYPES, FULL_TOOLBAR, IMAGE_UPLOADER_MIME_TYPES, OTHER_FILE_UPLOADER_MIME_TYPES, PPT_UPLOADER_MIME_TYPES, XSL_UPLOADER_MIME_TYPES, defaultLanguage } from "./config/editor.config.es.js";
14
+ import { getEventComposedPath, hadProtocol, hexToRgbA, imageFileToUrl, imageUrlToFile, isInside, isNullOrUndefined, omit, replaceDeltaImage, sanitize, splitWithBreak } from "./config/editor.utils.es.js";
13
15
  import { EmojiBlot } from "./formats/emoji.es.js";
14
16
  import { SoftBreak } from "./formats/soft-break.es.js";
15
17
  import { StrikeBlot } from "./formats/strike.es.js";
@@ -50,22 +52,30 @@ import { BetterToolbar } from "./modules/toolbar/better-toolbar.es.js";
50
52
  import { generateToolbarTip } from "./modules/toolbar/toolbar-tip.es.js";
51
53
  export {
52
54
  ALIGN_ATTR,
55
+ AUDIO_VIDEO_UPLOADER_MIME_TYPES,
53
56
  Action,
54
57
  AttributeMap,
58
+ BIG_DELTA_LIMIT,
55
59
  BetterToolbar,
56
60
  BlotFormatter,
57
61
  BlotSpec,
62
+ CHANGE_LANGUAGE_EVENT,
63
+ COMPRESSED_UPLOADER_MIME_TYPES,
58
64
  CollaborationModule,
59
65
  ColorPicker,
60
66
  CustomClipboard,
61
67
  CustomImage,
62
68
  CustomImageSpec,
63
69
  CustomResizeAction,
70
+ DEFAULT_TOOLBAR,
71
+ DOC_UPLOADER_MIME_TYPES,
64
72
  DeleteAction,
65
73
  Delta,
66
74
  DividerBlot,
67
75
  EmojiBlot,
68
76
  EmojiModule,
77
+ FILE_UPLOADER_MIME_TYPES,
78
+ FULL_TOOLBAR,
69
79
  File,
70
80
  FileBar,
71
81
  FileModule,
@@ -73,6 +83,7 @@ export {
73
83
  FlowChartModule,
74
84
  FontStyle,
75
85
  I18N,
86
+ IMAGE_UPLOADER_MIME_TYPES,
76
87
  ImageSpec,
77
88
  ImageToolbar,
78
89
  ImageToolbarAction,
@@ -86,8 +97,10 @@ export {
86
97
  Mention,
87
98
  MentionLink,
88
99
  MindMapModule,
100
+ OTHER_FILE_UPLOADER_MIME_TYPES,
89
101
  Op,
90
102
  OpIterator,
103
+ PPT_UPLOADER_MIME_TYPES,
91
104
  Parchment,
92
105
  Picker,
93
106
  Range,
@@ -97,12 +110,28 @@ export {
97
110
  StrikeBlot,
98
111
  TextIndentStyle,
99
112
  Video,
113
+ XSL_UPLOADER_MIME_TYPES,
100
114
  alignmentHandler,
101
115
  FluentEditor as default,
116
+ defaultLanguage,
102
117
  generateTableUp,
103
118
  generateTableUpShortKeyMenu,
104
119
  generateToolbarTip,
120
+ getEventComposedPath,
121
+ getListValue,
122
+ hadProtocol,
123
+ hexToRgbA,
124
+ imageFileToUrl,
125
+ imageUrlToFile,
126
+ inputFile,
127
+ isInside,
128
+ isNullOrUndefined,
129
+ namespace,
130
+ omit,
131
+ replaceDeltaImage,
132
+ sanitize,
105
133
  setAlignStyle,
106
- shortKey
134
+ shortKey,
135
+ splitWithBreak
107
136
  };
108
137
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -71,12 +71,39 @@ const FILE_UPLOADER_MIME_TYPES = [
71
71
  ...PPT_UPLOADER_MIME_TYPES,
72
72
  ...COMPRESSED_UPLOADER_MIME_TYPES
73
73
  ];
74
+ const DEFAULT_TOOLBAR = [
75
+ [{ header: [] }],
76
+ ["bold", "italic", "underline", "link"],
77
+ [{ list: "ordered" }, { list: "bullet" }],
78
+ ["clean"]
79
+ ];
80
+ const FULL_TOOLBAR = [
81
+ ["undo", "redo", "clean", "format-painter"],
82
+ [
83
+ { header: [1, 2, 3, 4, 5, 6, false] },
84
+ { font: [false, "宋体", "微软雅黑", "楷体", "黑体", "隶书", "andale mono", "arial", "arial black", "comic sans ms", "impact", "times new roman"] },
85
+ { size: [false, "12px", "14px", "16px", "18px", "20px", "24px", "32px", "36px", "48px", "72px"] },
86
+ { "line-height": [false, "1.2", "1.5", "1.75", "2", "3", "4", "5"] }
87
+ ],
88
+ ["bold", "italic", "strike", "underline", "divider"],
89
+ [{ color: [] }, { background: [] }],
90
+ [{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
91
+ [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
92
+ [{ script: "sub" }, { script: "super" }],
93
+ [{ indent: "-1" }, { indent: "+1" }],
94
+ [{ direction: "rtl" }],
95
+ ["link", "blockquote", "code", "code-block"],
96
+ ["image", "file", { "table-up": [] }],
97
+ ["emoji", "video", "formula", "screenshot", "fullscreen"]
98
+ ];
74
99
  exports.AUDIO_VIDEO_UPLOADER_MIME_TYPES = AUDIO_VIDEO_UPLOADER_MIME_TYPES;
75
100
  exports.BIG_DELTA_LIMIT = BIG_DELTA_LIMIT;
76
101
  exports.CHANGE_LANGUAGE_EVENT = CHANGE_LANGUAGE_EVENT;
77
102
  exports.COMPRESSED_UPLOADER_MIME_TYPES = COMPRESSED_UPLOADER_MIME_TYPES;
103
+ exports.DEFAULT_TOOLBAR = DEFAULT_TOOLBAR;
78
104
  exports.DOC_UPLOADER_MIME_TYPES = DOC_UPLOADER_MIME_TYPES;
79
105
  exports.FILE_UPLOADER_MIME_TYPES = FILE_UPLOADER_MIME_TYPES;
106
+ exports.FULL_TOOLBAR = FULL_TOOLBAR;
80
107
  exports.IMAGE_UPLOADER_MIME_TYPES = IMAGE_UPLOADER_MIME_TYPES;
81
108
  exports.OTHER_FILE_UPLOADER_MIME_TYPES = OTHER_FILE_UPLOADER_MIME_TYPES;
82
109
  exports.PPT_UPLOADER_MIME_TYPES = PPT_UPLOADER_MIME_TYPES;
@@ -1 +1 @@
1
- {"version":3,"file":"editor.config.cjs.js","sources":["../../../src/config/editor.config.ts"],"sourcesContent":["// Delta数据行太多超出该限制时,加载会比较慢,需要提示用户\r\nexport const BIG_DELTA_LIMIT = 2000\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":";;AACO,MAAM,kBAAkB;AAExB,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
+ {"version":3,"file":"editor.config.cjs.js","sources":["../../../src/config/editor.config.ts"],"sourcesContent":["// Delta数据行太多超出该限制时,加载会比较慢,需要提示用户\r\nexport const BIG_DELTA_LIMIT = 2000\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\r\nexport const DEFAULT_TOOLBAR = [\r\n [{ header: [] }],\r\n ['bold', 'italic', 'underline', 'link'],\r\n [{ list: 'ordered' }, { list: 'bullet' }],\r\n ['clean'],\r\n]\r\n\r\nexport const FULL_TOOLBAR = [\r\n ['undo', 'redo', 'clean', 'format-painter'],\r\n [\r\n { header: [1, 2, 3, 4, 5, 6, false] },\r\n { font: [false, '宋体', '微软雅黑', '楷体', '黑体', '隶书', 'andale mono', 'arial', 'arial black', 'comic sans ms', 'impact', 'times new roman'] },\r\n { size: [false, '12px', '14px', '16px', '18px', '20px', '24px', '32px', '36px', '48px', '72px'] },\r\n { 'line-height': [false, '1.2', '1.5', '1.75', '2', '3', '4', '5'] },\r\n ],\r\n ['bold', 'italic', 'strike', 'underline', 'divider'],\r\n [{ color: [] }, { background: [] }],\r\n [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }],\r\n [{ list: 'ordered' }, { list: 'bullet' }, { list: 'check' }],\r\n [{ script: 'sub' }, { script: 'super' }],\r\n [{ indent: '-1' }, { indent: '+1' }],\r\n [{ direction: 'rtl' }],\r\n ['link', 'blockquote', 'code', 'code-block'],\r\n ['image', 'file', { 'table-up': [] }],\r\n ['emoji', 'video', 'formula', 'screenshot', 'fullscreen'],\r\n]\r\n"],"names":[],"mappings":";;AACO,MAAM,kBAAkB;AAExB,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;AAEO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,EAAE,QAAQ,CAAA,GAAI;AAAA,EACf,CAAC,QAAQ,UAAU,aAAa,MAAM;AAAA,EACtC,CAAC,EAAE,MAAM,UAAA,GAAa,EAAE,MAAM,UAAU;AAAA,EACxC,CAAC,OAAO;AACV;AAEO,MAAM,eAAe;AAAA,EAC1B,CAAC,QAAQ,QAAQ,SAAS,gBAAgB;AAAA,EAC1C;AAAA,IACE,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,EAAA;AAAA,IAClC,EAAE,MAAM,CAAC,OAAO,MAAM,QAAQ,MAAM,MAAM,MAAM,eAAe,SAAS,eAAe,iBAAiB,UAAU,iBAAiB,EAAA;AAAA,IACnI,EAAE,MAAM,CAAC,OAAO,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,EAAA;AAAA,IAC9F,EAAE,eAAe,CAAC,OAAO,OAAO,OAAO,QAAQ,KAAK,KAAK,KAAK,GAAG,EAAA;AAAA,EAAE;AAAA,EAErE,CAAC,QAAQ,UAAU,UAAU,aAAa,SAAS;AAAA,EACnD,CAAC,EAAE,OAAO,CAAA,EAAC,GAAK,EAAE,YAAY,CAAA,EAAC,CAAG;AAAA,EAClC,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,SAAA,GAAY,EAAE,OAAO,QAAA,GAAW,EAAE,OAAO,WAAW;AAAA,EAC7E,CAAC,EAAE,MAAM,UAAA,GAAa,EAAE,MAAM,YAAY,EAAE,MAAM,SAAS;AAAA,EAC3D,CAAC,EAAE,QAAQ,MAAA,GAAS,EAAE,QAAQ,SAAS;AAAA,EACvC,CAAC,EAAE,QAAQ,KAAA,GAAQ,EAAE,QAAQ,MAAM;AAAA,EACnC,CAAC,EAAE,WAAW,OAAO;AAAA,EACrB,CAAC,QAAQ,cAAc,QAAQ,YAAY;AAAA,EAC3C,CAAC,SAAS,QAAQ,EAAE,YAAY,CAAA,GAAI;AAAA,EACpC,CAAC,SAAS,SAAS,WAAW,cAAc,YAAY;AAC1D;;;;;;;;;;;;;;"}
@@ -51,8 +51,10 @@ exports.AUDIO_VIDEO_UPLOADER_MIME_TYPES = editor_config.AUDIO_VIDEO_UPLOADER_MIM
51
51
  exports.BIG_DELTA_LIMIT = editor_config.BIG_DELTA_LIMIT;
52
52
  exports.CHANGE_LANGUAGE_EVENT = editor_config.CHANGE_LANGUAGE_EVENT;
53
53
  exports.COMPRESSED_UPLOADER_MIME_TYPES = editor_config.COMPRESSED_UPLOADER_MIME_TYPES;
54
+ exports.DEFAULT_TOOLBAR = editor_config.DEFAULT_TOOLBAR;
54
55
  exports.DOC_UPLOADER_MIME_TYPES = editor_config.DOC_UPLOADER_MIME_TYPES;
55
56
  exports.FILE_UPLOADER_MIME_TYPES = editor_config.FILE_UPLOADER_MIME_TYPES;
57
+ exports.FULL_TOOLBAR = editor_config.FULL_TOOLBAR;
56
58
  exports.IMAGE_UPLOADER_MIME_TYPES = editor_config.IMAGE_UPLOADER_MIME_TYPES;
57
59
  exports.OTHER_FILE_UPLOADER_MIME_TYPES = editor_config.OTHER_FILE_UPLOADER_MIME_TYPES;
58
60
  exports.PPT_UPLOADER_MIME_TYPES = editor_config.PPT_UPLOADER_MIME_TYPES;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../src/config/index.ts"],"sourcesContent":["import { isNullOrUndefined } from './editor.utils'\r\n\r\nexport * from './editor.config'\r\nexport * from './editor.utils'\r\nexport * from './types'\r\n\r\n// 触发上传\r\nexport function inputFile(type: 'image' | 'video' | 'file', accept: string[]) {\r\n if (accept.length <= 0) return\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.style.display = 'none'\r\n fileInput.classList.add(`ql-${type}`)\r\n fileInput.setAttribute('type', 'file')\r\n fileInput.setAttribute('accept', accept.map(mime => mime === '*' ? `${type}/*` : mime).join(','))\r\n fileInput.setAttribute('multiple', '')\r\n fileInput.addEventListener('change', () => {\r\n const range = this.quill.getSelection(true)\r\n this.quill.uploader.upload(range, fileInput.files)\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":["isNullOrUndefined"],"mappings":";;;;;AAOO,SAAS,UAAU,MAAkC,QAAkB;AAC5E,MAAI,OAAO,UAAU,EAAG;AACxB,MAAI,YAAY,KAAK,UAAU,cAAc,YAAY,IAAI,aAAa;AAC1E,MAAIA,aAAAA,kBAAkB,SAAS,GAAG;AAChC,gBAAY,SAAS,cAAc,OAAO;AAC1C,cAAU,MAAM,UAAU;AAC1B,cAAU,UAAU,IAAI,MAAM,IAAI,EAAE;AACpC,cAAU,aAAa,QAAQ,MAAM;AACrC,cAAU,aAAa,UAAU,OAAO,IAAI,UAAQ,SAAS,MAAM,GAAG,IAAI,OAAO,IAAI,EAAE,KAAK,GAAG,CAAC;AAChG,cAAU,aAAa,YAAY,EAAE;AACrC,cAAU,iBAAiB,UAAU,MAAM;AACzC,YAAM,QAAQ,KAAK,MAAM,aAAa,IAAI;AAC1C,WAAK,MAAM,SAAS,OAAO,OAAO,UAAU,KAAK;AACjD,gBAAU,QAAQ;AAAA,IACpB,CAAC;AACD,SAAK,UAAU,YAAY,SAAS;AAAA,EACtC;AACA,YAAU,MAAA;AACZ;AAEO,SAAS,aAAa,OAAO,cAAc;AAChD,MAAI,eAAe;AACnB,MAAI,gBAAgB,iBAAiB,OAAO;AAC1C,mBAAe;AAAA,EACjB,WACS,UAAU,SAAS;AAC1B,QAAI,iBAAiB,aAAa,iBAAiB,aAAa;AAC9D,qBAAe;AAAA,IACjB,OACK;AACH,qBAAe;AAAA,IACjB;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../src/config/index.ts"],"sourcesContent":["import { isNullOrUndefined } from './editor.utils'\r\n\r\nexport * from './editor.config'\r\nexport * from './editor.utils'\r\nexport * from './types'\r\n\r\n// 触发上传\r\nexport function inputFile(type: 'image' | 'video' | 'file', accept: string[]) {\r\n if (accept.length <= 0) return\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.style.display = 'none'\r\n fileInput.classList.add(`ql-${type}`)\r\n fileInput.setAttribute('type', 'file')\r\n fileInput.setAttribute('accept', accept.map(mime => mime === '*' ? `${type}/*` : mime).join(','))\r\n fileInput.setAttribute('multiple', '')\r\n fileInput.addEventListener('change', () => {\r\n const range = this.quill.getSelection(true)\r\n this.quill.uploader.upload(range, fileInput.files)\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":["isNullOrUndefined"],"mappings":";;;;;AAOO,SAAS,UAAU,MAAkC,QAAkB;AAC5E,MAAI,OAAO,UAAU,EAAG;AACxB,MAAI,YAAY,KAAK,UAAU,cAAc,YAAY,IAAI,aAAa;AAC1E,MAAIA,aAAAA,kBAAkB,SAAS,GAAG;AAChC,gBAAY,SAAS,cAAc,OAAO;AAC1C,cAAU,MAAM,UAAU;AAC1B,cAAU,UAAU,IAAI,MAAM,IAAI,EAAE;AACpC,cAAU,aAAa,QAAQ,MAAM;AACrC,cAAU,aAAa,UAAU,OAAO,IAAI,UAAQ,SAAS,MAAM,GAAG,IAAI,OAAO,IAAI,EAAE,KAAK,GAAG,CAAC;AAChG,cAAU,aAAa,YAAY,EAAE;AACrC,cAAU,iBAAiB,UAAU,MAAM;AACzC,YAAM,QAAQ,KAAK,MAAM,aAAa,IAAI;AAC1C,WAAK,MAAM,SAAS,OAAO,OAAO,UAAU,KAAK;AACjD,gBAAU,QAAQ;AAAA,IACpB,CAAC;AACD,SAAK,UAAU,YAAY,SAAS;AAAA,EACtC;AACA,YAAU,MAAA;AACZ;AAEO,SAAS,aAAa,OAAO,cAAc;AAChD,MAAI,eAAe;AACnB,MAAI,gBAAgB,iBAAiB,OAAO;AAC1C,mBAAe;AAAA,EACjB,WACS,UAAU,SAAS;AAC1B,QAAI,iBAAiB,aAAa,iBAAiB,aAAa;AAC9D,qBAAe;AAAA,IACjB,OACK;AACH,qBAAe;AAAA,IACjB;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/lib/index.cjs.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  require("./fluent-editor.cjs.js");
4
4
  require("./attributors/index.cjs.js");
5
- require("./config/types/index.cjs.js");
5
+ const index = require("./config/index.cjs.js");
6
6
  require("./formats/index.cjs.js");
7
7
  require("./modules/index.cjs.js");
8
8
  const QuillShortcutKey = require("quill-shortcut-key");
@@ -12,6 +12,8 @@ const fontSize = require("./attributors/font-size.cjs.js");
12
12
  const fontStyle = require("./attributors/font-style.cjs.js");
13
13
  const lineHeight = require("./attributors/line-height.cjs.js");
14
14
  const textIndent = require("./attributors/text-indent.cjs.js");
15
+ const editor_config = require("./config/editor.config.cjs.js");
16
+ const editor_utils = require("./config/editor.utils.cjs.js");
15
17
  const emoji = require("./formats/emoji.cjs.js");
16
18
  const softBreak = require("./formats/soft-break.cjs.js");
17
19
  const strike = require("./formats/strike.cjs.js");
@@ -35,7 +37,7 @@ const emoji$1 = require("./modules/emoji.cjs.js");
35
37
  const file = require("./modules/file/formats/file.cjs.js");
36
38
  const fileBar = require("./modules/file/modules/file-bar.cjs.js");
37
39
  const fileModule = require("./modules/file/modules/file-module.cjs.js");
38
- const index = require("./modules/flow-chart/index.cjs.js");
40
+ const index$1 = require("./modules/flow-chart/index.cjs.js");
39
41
  const i18n = require("./modules/i18n.cjs.js");
40
42
  const link = require("./modules/link/formats/link.cjs.js");
41
43
  const tooltip = require("./modules/link/modules/tooltip.cjs.js");
@@ -44,12 +46,15 @@ const module$2 = require("./modules/mathlive/module.cjs.js");
44
46
  const tooltip$1 = require("./modules/mathlive/tooltip.cjs.js");
45
47
  const mention = require("./modules/mention/mention.cjs.js");
46
48
  const mentionLink = require("./modules/mention/mention-link.cjs.js");
47
- const index$1 = require("./modules/mind-map/index.cjs.js");
48
- const index$2 = require("./modules/shortcut-key/index.cjs.js");
49
- const index$3 = require("./modules/table-up/index.cjs.js");
49
+ const index$2 = require("./modules/mind-map/index.cjs.js");
50
+ const index$3 = require("./modules/shortcut-key/index.cjs.js");
51
+ const index$4 = require("./modules/table-up/index.cjs.js");
50
52
  const betterPicker = require("./modules/toolbar/better-picker.cjs.js");
51
53
  const betterToolbar = require("./modules/toolbar/better-toolbar.cjs.js");
52
54
  const toolbarTip = require("./modules/toolbar/toolbar-tip.cjs.js");
55
+ exports.getListValue = index.getListValue;
56
+ exports.inputFile = index.inputFile;
57
+ exports.namespace = index.namespace;
53
58
  Object.defineProperty(exports, "generateTableUpShortKeyMenu", {
54
59
  enumerable: true,
55
60
  get: () => QuillShortcutKey.generateTableUpShortKeyMenu
@@ -83,6 +88,30 @@ exports.SizeStyle = fontSize.SizeStyle;
83
88
  exports.FontStyle = fontStyle.FontStyle;
84
89
  exports.LineHeightStyle = lineHeight.LineHeightStyle;
85
90
  exports.TextIndentStyle = textIndent.TextIndentStyle;
91
+ exports.AUDIO_VIDEO_UPLOADER_MIME_TYPES = editor_config.AUDIO_VIDEO_UPLOADER_MIME_TYPES;
92
+ exports.BIG_DELTA_LIMIT = editor_config.BIG_DELTA_LIMIT;
93
+ exports.CHANGE_LANGUAGE_EVENT = editor_config.CHANGE_LANGUAGE_EVENT;
94
+ exports.COMPRESSED_UPLOADER_MIME_TYPES = editor_config.COMPRESSED_UPLOADER_MIME_TYPES;
95
+ exports.DEFAULT_TOOLBAR = editor_config.DEFAULT_TOOLBAR;
96
+ exports.DOC_UPLOADER_MIME_TYPES = editor_config.DOC_UPLOADER_MIME_TYPES;
97
+ exports.FILE_UPLOADER_MIME_TYPES = editor_config.FILE_UPLOADER_MIME_TYPES;
98
+ exports.FULL_TOOLBAR = editor_config.FULL_TOOLBAR;
99
+ exports.IMAGE_UPLOADER_MIME_TYPES = editor_config.IMAGE_UPLOADER_MIME_TYPES;
100
+ exports.OTHER_FILE_UPLOADER_MIME_TYPES = editor_config.OTHER_FILE_UPLOADER_MIME_TYPES;
101
+ exports.PPT_UPLOADER_MIME_TYPES = editor_config.PPT_UPLOADER_MIME_TYPES;
102
+ exports.XSL_UPLOADER_MIME_TYPES = editor_config.XSL_UPLOADER_MIME_TYPES;
103
+ exports.defaultLanguage = editor_config.defaultLanguage;
104
+ exports.getEventComposedPath = editor_utils.getEventComposedPath;
105
+ exports.hadProtocol = editor_utils.hadProtocol;
106
+ exports.hexToRgbA = editor_utils.hexToRgbA;
107
+ exports.imageFileToUrl = editor_utils.imageFileToUrl;
108
+ exports.imageUrlToFile = editor_utils.imageUrlToFile;
109
+ exports.isInside = editor_utils.isInside;
110
+ exports.isNullOrUndefined = editor_utils.isNullOrUndefined;
111
+ exports.omit = editor_utils.omit;
112
+ exports.replaceDeltaImage = editor_utils.replaceDeltaImage;
113
+ exports.sanitize = editor_utils.sanitize;
114
+ exports.splitWithBreak = editor_utils.splitWithBreak;
86
115
  exports.EmojiBlot = emoji.EmojiBlot;
87
116
  exports.SoftBreak = softBreak.SoftBreak;
88
117
  exports.StrikeBlot = strike.StrikeBlot;
@@ -109,7 +138,7 @@ exports.EmojiModule = emoji$1.EmojiModule;
109
138
  exports.File = file.File;
110
139
  exports.FileBar = fileBar.FileBar;
111
140
  exports.FileModule = fileModule.FileModule;
112
- exports.FlowChartModule = index.FlowChartModule;
141
+ exports.FlowChartModule = index$1.FlowChartModule;
113
142
  exports.I18N = i18n.I18N;
114
143
  exports.LinkBlot = link.LinkBlot;
115
144
  exports.LinkTooltip = tooltip.LinkTooltip;
@@ -118,10 +147,10 @@ exports.MathliveModule = module$2.MathliveModule;
118
147
  exports.MathliveTooltip = tooltip$1.MathliveTooltip;
119
148
  exports.Mention = mention.Mention;
120
149
  exports.MentionLink = mentionLink.MentionLink;
121
- exports.MindMapModule = index$1.MindMapModule;
122
- exports.ShortCutKey = index$2.ShortCutKey;
123
- exports.shortKey = index$2.shortKey;
124
- exports.generateTableUp = index$3.generateTableUp;
150
+ exports.MindMapModule = index$2.MindMapModule;
151
+ exports.ShortCutKey = index$3.ShortCutKey;
152
+ exports.shortKey = index$3.shortKey;
153
+ exports.generateTableUp = index$4.generateTableUp;
125
154
  exports.ColorPicker = betterPicker.ColorPicker;
126
155
  exports.Picker = betterPicker.Picker;
127
156
  exports.BetterToolbar = betterToolbar.BetterToolbar;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opentiny/fluent-editor",
3
3
  "type": "module",
4
- "version": "4.0.0-alpha.14",
4
+ "version": "4.0.0-alpha.15",
5
5
  "description": "A rich text editor based on Quill 2.0, which extends rich modules and formats on the basis of Quill. It's powerful and out-of-the-box.",
6
6
  "author": "OpenTiny Team",
7
7
  "license": "MIT",
package/style.css CHANGED
@@ -367,7 +367,7 @@ li.unchecked > .ql-ui {
367
367
  }
368
368
  .ql-size.ql-picker .ql-picker-label[data-value]::before,
369
369
  .ql-size.ql-picker .ql-picker-item[data-value]::before {
370
- content: attr(data-value);
370
+ content: attr(data-value) !important;
371
371
  }
372
372
 
373
373
  .ql-formats .ql-font.ql-picker {
@@ -9,3 +9,47 @@ export declare const XSL_UPLOADER_MIME_TYPES: string[];
9
9
  export declare const PPT_UPLOADER_MIME_TYPES: string[];
10
10
  export declare const COMPRESSED_UPLOADER_MIME_TYPES: string[];
11
11
  export declare const FILE_UPLOADER_MIME_TYPES: string[];
12
+ export declare const DEFAULT_TOOLBAR: (string[] | {
13
+ header: any[];
14
+ }[] | {
15
+ list: string;
16
+ }[])[];
17
+ export declare const FULL_TOOLBAR: (({
18
+ header: (number | boolean)[];
19
+ font?: undefined;
20
+ size?: undefined;
21
+ 'line-height'?: undefined;
22
+ } | {
23
+ font: (string | boolean)[];
24
+ header?: undefined;
25
+ size?: undefined;
26
+ 'line-height'?: undefined;
27
+ } | {
28
+ size: (string | boolean)[];
29
+ header?: undefined;
30
+ font?: undefined;
31
+ 'line-height'?: undefined;
32
+ } | {
33
+ 'line-height': (string | boolean)[];
34
+ header?: undefined;
35
+ font?: undefined;
36
+ size?: undefined;
37
+ })[] | ({
38
+ color: any[];
39
+ background?: undefined;
40
+ } | {
41
+ background: any[];
42
+ color?: undefined;
43
+ })[] | {
44
+ align: string;
45
+ }[] | {
46
+ list: string;
47
+ }[] | {
48
+ script: string;
49
+ }[] | {
50
+ indent: string;
51
+ }[] | {
52
+ direction: string;
53
+ }[] | (string | {
54
+ 'table-up': any[];
55
+ })[])[];
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { default as FluentEditor } from './fluent-editor';
2
2
 
3
3
  export * from './attributors';
4
- export * from './config/types';
4
+ export * from './config';
5
5
  export * from './formats';
6
6
  export * from './modules';
7
7
  export { generateTableUpShortKeyMenu } from 'quill-shortcut-key';