@opentiny/fluent-editor 4.0.0-alpha.0 → 4.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -24
- package/es/config/editor.config.es.js +0 -7
- package/es/config/editor.config.es.js.map +1 -1
- package/es/config/editor.utils.es.js +0 -2
- package/es/config/editor.utils.es.js.map +1 -1
- package/es/config/i18n/en-us.es.js +0 -13
- package/es/config/i18n/en-us.es.js.map +1 -1
- package/es/config/i18n/zh-cn.es.js +0 -13
- package/es/config/i18n/zh-cn.es.js.map +1 -1
- package/es/config/index.es.js +8 -13
- package/es/config/index.es.js.map +1 -1
- package/es/config/types/index.es.js +0 -20
- package/es/config/types/index.es.js.map +1 -1
- package/es/core/fluent-editor.es.js +7 -5
- package/es/core/fluent-editor.es.js.map +1 -1
- package/es/fluent-editor.es.js +36 -22
- package/es/fluent-editor.es.js.map +1 -1
- package/es/formats/emoji.es.js +14 -0
- package/es/formats/emoji.es.js.map +1 -0
- package/es/formats/index.es.js +11 -0
- package/es/formats/index.es.js.map +1 -0
- package/es/formats/soft-break.es.js +12 -5
- package/es/formats/soft-break.es.js.map +1 -1
- package/es/formats/strike.es.js +8 -5
- package/es/formats/strike.es.js.map +1 -1
- package/es/formats/video.es.js +14 -10
- package/es/formats/video.es.js.map +1 -1
- package/es/index.es.js +92 -32
- package/es/index.es.js.map +1 -1
- package/es/modules/counter.es.js +8 -3
- package/es/modules/counter.es.js.map +1 -1
- package/es/modules/custom-clipboard.es.js +23 -27
- package/es/modules/custom-clipboard.es.js.map +1 -1
- package/es/modules/custom-image/actions/action.es.js +19 -0
- package/es/modules/custom-image/actions/action.es.js.map +1 -0
- package/es/modules/custom-image/actions/{CustomResizeAction.es.js → custom-resize-action.es.js} +24 -11
- package/es/modules/custom-image/actions/{CustomResizeAction.es.js.map → custom-resize-action.es.js.map} +1 -1
- package/es/modules/custom-image/actions/{DeleteAction.es.js → delete-action.es.js} +8 -5
- package/es/modules/custom-image/actions/delete-action.es.js.map +1 -0
- package/es/modules/custom-image/actions/image-toolbar-buttons.es.js +137 -0
- package/es/modules/custom-image/actions/image-toolbar-buttons.es.js.map +1 -0
- package/es/modules/custom-image/actions/index.es.js +18 -0
- package/es/modules/custom-image/actions/index.es.js.map +1 -0
- package/es/modules/custom-image/actions/toolbar-action.es.js +33 -0
- package/es/modules/custom-image/actions/toolbar-action.es.js.map +1 -0
- package/es/modules/custom-image/actions/toolbar.es.js +110 -0
- package/es/modules/custom-image/actions/toolbar.es.js.map +1 -0
- package/es/modules/custom-image/{BlotFormatter.es.js → blot-formatter.es.js} +23 -50
- package/es/modules/custom-image/blot-formatter.es.js.map +1 -0
- package/es/modules/custom-image/image.es.js +34 -21
- package/es/modules/custom-image/image.es.js.map +1 -1
- package/es/modules/custom-image/index.es.js +9 -0
- package/es/modules/custom-image/index.es.js.map +1 -0
- package/es/modules/custom-image/options.es.js +85 -0
- package/es/modules/custom-image/options.es.js.map +1 -0
- package/es/modules/custom-image/specs/blot-spec.es.js +33 -0
- package/es/modules/custom-image/specs/blot-spec.es.js.map +1 -0
- package/es/modules/custom-image/specs/{CustomImageSpec.es.js → custom-image-spec.es.js} +13 -14
- package/es/modules/custom-image/specs/custom-image-spec.es.js.map +1 -0
- package/es/modules/custom-image/specs/image-spec.es.js +32 -0
- package/es/modules/custom-image/specs/image-spec.es.js.map +1 -0
- package/es/modules/custom-image/specs/index.es.js +9 -0
- package/es/modules/custom-image/specs/index.es.js.map +1 -0
- package/es/modules/custom-uploader.es.js +63 -194
- package/es/modules/custom-uploader.es.js.map +1 -1
- package/es/modules/divider.es.js +8 -7
- package/es/modules/divider.es.js.map +1 -1
- package/es/modules/emoji.es.js +175 -0
- package/es/modules/emoji.es.js.map +1 -0
- package/es/modules/file/formats/file.es.js +13 -13
- package/es/modules/file/formats/file.es.js.map +1 -1
- package/es/modules/file/index.es.js +6 -29
- package/es/modules/file/index.es.js.map +1 -1
- package/es/modules/file/modules/file-bar.es.js +11 -3
- package/es/modules/file/modules/file-bar.es.js.map +1 -1
- package/es/modules/file/modules/file-module.es.js +35 -0
- package/es/modules/file/modules/file-module.es.js.map +1 -0
- package/es/modules/i18n.es.js +33 -11
- package/es/modules/i18n.es.js.map +1 -1
- package/es/modules/index.es.js +26 -0
- package/es/modules/index.es.js.map +1 -0
- package/es/modules/link/formats/link.es.js +14 -10
- package/es/modules/link/formats/link.es.js.map +1 -1
- package/es/modules/link/index.es.js +4 -12
- package/es/modules/link/index.es.js.map +1 -1
- package/es/modules/link/modules/tooltip.es.js +31 -21
- package/es/modules/link/modules/tooltip.es.js.map +1 -1
- package/es/modules/mathlive/formats.es.js +10 -7
- package/es/modules/mathlive/formats.es.js.map +1 -1
- package/es/modules/mathlive/index.es.js +6 -30
- package/es/modules/mathlive/index.es.js.map +1 -1
- package/es/modules/mathlive/module.es.js +40 -0
- package/es/modules/mathlive/module.es.js.map +1 -0
- package/es/modules/mathlive/tooltip.es.js +9 -5
- package/es/modules/mathlive/tooltip.es.js.map +1 -1
- package/es/modules/mention/index.es.js +7 -0
- package/es/modules/{emoji/emoji-list → mention}/index.es.js.map +1 -1
- package/es/modules/mention/{MentionLink.es.js → mention-link.es.js} +14 -6
- package/es/modules/mention/mention-link.es.js.map +1 -0
- package/es/modules/mention/{Mention.es.js → mention.es.js} +28 -20
- package/es/modules/mention/mention.es.js.map +1 -0
- package/es/modules/shortcut-key/index.es.js +17 -1
- package/es/modules/shortcut-key/index.es.js.map +1 -1
- package/es/modules/syntax.es.js +4 -0
- package/es/modules/syntax.es.js.map +1 -1
- package/es/modules/table-up/index.es.js +9 -2
- package/es/modules/table-up/index.es.js.map +1 -1
- package/es/modules/toolbar/better-picker.es.js +5 -0
- package/es/modules/toolbar/better-picker.es.js.map +1 -1
- package/es/modules/toolbar/better-toolbar.es.js +138 -0
- package/es/modules/toolbar/better-toolbar.es.js.map +1 -0
- package/es/modules/toolbar/index.es.js +5 -135
- package/es/modules/toolbar/index.es.js.map +1 -1
- package/es/modules/toolbar/toolbar-tip.es.js +6 -1
- package/es/modules/toolbar/toolbar-tip.es.js.map +1 -1
- package/es/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.es.js +40145 -0
- package/es/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.es.js.map +1 -0
- package/es/node_modules/.pnpm/@floating-ui_core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.es.js +938 -0
- package/es/node_modules/.pnpm/@floating-ui_core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.es.js.map +1 -0
- package/es/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.es.js +624 -0
- package/es/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.es.js.map +1 -0
- package/es/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +174 -0
- package/es/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.es.js.map +1 -0
- package/es/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.es.js +159 -0
- package/es/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.es.js.map +1 -0
- package/es/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.es.js +2849 -0
- package/es/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.es.js.map +1 -0
- package/es/themes/snow.es.js +18 -15
- package/es/themes/snow.es.js.map +1 -1
- package/es/tools/fullscreen.es.js.map +1 -1
- package/es/ui/icons.config.es.js +8 -0
- package/es/ui/icons.config.es.js.map +1 -1
- package/es/ui/icons.es.js.map +1 -1
- package/es/utils/is.es.js +4 -0
- package/es/utils/is.es.js.map +1 -1
- package/lib/config/editor.config.cjs.js +0 -7
- package/lib/config/editor.config.cjs.js.map +1 -1
- package/lib/config/editor.utils.cjs.js +0 -2
- package/lib/config/editor.utils.cjs.js.map +1 -1
- package/lib/config/i18n/en-us.cjs.js +0 -13
- package/lib/config/i18n/en-us.cjs.js.map +1 -1
- package/lib/config/i18n/zh-cn.cjs.js +0 -13
- package/lib/config/i18n/zh-cn.cjs.js.map +1 -1
- package/lib/config/index.cjs.js +6 -11
- package/lib/config/index.cjs.js.map +1 -1
- package/lib/config/types/index.cjs.js +0 -20
- package/lib/config/types/index.cjs.js.map +1 -1
- package/lib/core/fluent-editor.cjs.js +6 -4
- package/lib/core/fluent-editor.cjs.js.map +1 -1
- package/lib/fluent-editor.cjs.js +44 -30
- package/lib/fluent-editor.cjs.js.map +1 -1
- package/lib/formats/emoji.cjs.js +14 -0
- package/lib/formats/emoji.cjs.js.map +1 -0
- package/lib/formats/index.cjs.js +11 -0
- package/lib/formats/index.cjs.js.map +1 -0
- package/lib/formats/soft-break.cjs.js +13 -6
- package/lib/formats/soft-break.cjs.js.map +1 -1
- package/lib/formats/strike.cjs.js +9 -6
- package/lib/formats/strike.cjs.js.map +1 -1
- package/lib/formats/video.cjs.js +15 -11
- package/lib/formats/video.cjs.js.map +1 -1
- package/lib/index.cjs.js +112 -34
- package/lib/index.cjs.js.map +1 -1
- package/lib/modules/counter.cjs.js +8 -3
- package/lib/modules/counter.cjs.js.map +1 -1
- package/lib/modules/custom-clipboard.cjs.js +23 -27
- package/lib/modules/custom-clipboard.cjs.js.map +1 -1
- package/lib/modules/custom-image/actions/action.cjs.js +19 -0
- package/lib/modules/custom-image/actions/action.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/{CustomResizeAction.cjs.js → custom-resize-action.cjs.js} +26 -13
- package/lib/modules/custom-image/actions/{CustomResizeAction.cjs.js.map → custom-resize-action.cjs.js.map} +1 -1
- package/lib/modules/custom-image/actions/{DeleteAction.cjs.js → delete-action.cjs.js} +10 -7
- package/lib/modules/custom-image/actions/delete-action.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/image-toolbar-buttons.cjs.js +137 -0
- package/lib/modules/custom-image/actions/image-toolbar-buttons.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/index.cjs.js +18 -0
- package/lib/modules/custom-image/actions/index.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/toolbar-action.cjs.js +33 -0
- package/lib/modules/custom-image/actions/toolbar-action.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/toolbar.cjs.js +110 -0
- package/lib/modules/custom-image/actions/toolbar.cjs.js.map +1 -0
- package/lib/modules/custom-image/{BlotFormatter.cjs.js → blot-formatter.cjs.js} +24 -51
- package/lib/modules/custom-image/blot-formatter.cjs.js.map +1 -0
- package/lib/modules/custom-image/image.cjs.js +35 -22
- package/lib/modules/custom-image/image.cjs.js.map +1 -1
- package/lib/modules/custom-image/index.cjs.js +9 -0
- package/lib/modules/custom-image/index.cjs.js.map +1 -0
- package/lib/modules/custom-image/options.cjs.js +85 -0
- package/lib/modules/custom-image/options.cjs.js.map +1 -0
- package/lib/modules/custom-image/specs/blot-spec.cjs.js +33 -0
- package/lib/modules/custom-image/specs/blot-spec.cjs.js.map +1 -0
- package/lib/modules/custom-image/specs/{CustomImageSpec.cjs.js → custom-image-spec.cjs.js} +14 -15
- package/lib/modules/custom-image/specs/custom-image-spec.cjs.js.map +1 -0
- package/lib/modules/custom-image/specs/image-spec.cjs.js +32 -0
- package/lib/modules/custom-image/specs/image-spec.cjs.js.map +1 -0
- package/lib/modules/custom-image/specs/index.cjs.js +9 -0
- package/lib/modules/custom-image/specs/index.cjs.js.map +1 -0
- package/lib/modules/custom-uploader.cjs.js +64 -195
- package/lib/modules/custom-uploader.cjs.js.map +1 -1
- package/lib/modules/divider.cjs.js +9 -8
- package/lib/modules/divider.cjs.js.map +1 -1
- package/lib/modules/emoji.cjs.js +175 -0
- package/lib/modules/emoji.cjs.js.map +1 -0
- package/lib/modules/file/formats/file.cjs.js +14 -14
- package/lib/modules/file/formats/file.cjs.js.map +1 -1
- package/lib/modules/file/index.cjs.js +5 -28
- package/lib/modules/file/index.cjs.js.map +1 -1
- package/lib/modules/file/modules/file-bar.cjs.js +12 -4
- package/lib/modules/file/modules/file-bar.cjs.js.map +1 -1
- package/lib/modules/file/modules/file-module.cjs.js +35 -0
- package/lib/modules/file/modules/file-module.cjs.js.map +1 -0
- package/lib/modules/i18n.cjs.js +32 -10
- package/lib/modules/i18n.cjs.js.map +1 -1
- package/lib/modules/index.cjs.js +26 -0
- package/lib/modules/index.cjs.js.map +1 -0
- package/lib/modules/link/formats/link.cjs.js +15 -11
- package/lib/modules/link/formats/link.cjs.js.map +1 -1
- package/lib/modules/link/index.cjs.js +4 -12
- package/lib/modules/link/index.cjs.js.map +1 -1
- package/lib/modules/link/modules/tooltip.cjs.js +30 -20
- package/lib/modules/link/modules/tooltip.cjs.js.map +1 -1
- package/lib/modules/mathlive/formats.cjs.js +11 -8
- package/lib/modules/mathlive/formats.cjs.js.map +1 -1
- package/lib/modules/mathlive/index.cjs.js +5 -29
- package/lib/modules/mathlive/index.cjs.js.map +1 -1
- package/lib/modules/mathlive/module.cjs.js +40 -0
- package/lib/modules/mathlive/module.cjs.js.map +1 -0
- package/lib/modules/mathlive/tooltip.cjs.js +10 -6
- package/lib/modules/mathlive/tooltip.cjs.js.map +1 -1
- package/lib/modules/mention/index.cjs.js +7 -0
- package/lib/modules/{emoji/emoji-list → mention}/index.cjs.js.map +1 -1
- package/lib/modules/mention/{MentionLink.cjs.js → mention-link.cjs.js} +15 -7
- package/lib/modules/mention/mention-link.cjs.js.map +1 -0
- package/lib/modules/mention/{Mention.cjs.js → mention.cjs.js} +30 -22
- package/lib/modules/mention/mention.cjs.js.map +1 -0
- package/lib/modules/shortcut-key/index.cjs.js +16 -0
- package/lib/modules/shortcut-key/index.cjs.js.map +1 -1
- package/lib/modules/syntax.cjs.js +4 -0
- package/lib/modules/syntax.cjs.js.map +1 -1
- package/lib/modules/table-up/index.cjs.js +9 -2
- package/lib/modules/table-up/index.cjs.js.map +1 -1
- package/lib/modules/toolbar/better-picker.cjs.js +5 -0
- package/lib/modules/toolbar/better-picker.cjs.js.map +1 -1
- package/lib/modules/toolbar/better-toolbar.cjs.js +138 -0
- package/lib/modules/toolbar/better-toolbar.cjs.js.map +1 -0
- package/lib/modules/toolbar/index.cjs.js +6 -136
- package/lib/modules/toolbar/index.cjs.js.map +1 -1
- package/lib/modules/toolbar/toolbar-tip.cjs.js +6 -1
- package/lib/modules/toolbar/toolbar-tip.cjs.js.map +1 -1
- package/lib/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.cjs.js +40145 -0
- package/lib/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.cjs.js.map +1 -0
- package/lib/node_modules/.pnpm/@floating-ui_core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.cjs.js +938 -0
- package/lib/node_modules/.pnpm/@floating-ui_core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.cjs.js.map +1 -0
- package/lib/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs.js +624 -0
- package/lib/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs.js.map +1 -0
- package/lib/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs.js +159 -0
- package/lib/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs.js.map +1 -0
- package/lib/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js +174 -0
- package/lib/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js.map +1 -0
- package/lib/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.cjs.js +2847 -0
- package/lib/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.cjs.js.map +1 -0
- package/lib/themes/snow.cjs.js +19 -16
- package/lib/themes/snow.cjs.js.map +1 -1
- package/lib/tools/fullscreen.cjs.js.map +1 -1
- package/lib/ui/icons.cjs.js.map +1 -1
- package/lib/ui/icons.config.cjs.js +8 -0
- package/lib/ui/icons.config.cjs.js.map +1 -1
- package/lib/utils/is.cjs.js +4 -0
- package/lib/utils/is.cjs.js.map +1 -1
- package/package.json +8 -7
- package/style.css +8 -952
- package/types/config/editor.config.d.ts +0 -274
- package/types/config/editor.utils.d.ts +0 -1
- package/types/config/i18n/en-us.d.ts +0 -13
- package/types/config/i18n/zh-cn.d.ts +0 -13
- package/types/config/index.d.ts +2 -1
- package/types/config/types/editor-config.interface.d.ts +0 -26
- package/types/config/types/editor-modules.interface.d.ts +22 -11
- package/types/config/types/index.d.ts +0 -20
- package/types/config/types/type.d.ts +0 -4
- package/types/core/fluent-editor.d.ts +3 -2
- package/types/formats/emoji.d.ts +9 -0
- package/types/formats/index.d.ts +4 -0
- package/types/formats/soft-break.d.ts +6 -7
- package/types/formats/strike.d.ts +6 -4
- package/types/formats/video.d.ts +4 -6
- package/types/index.d.ts +5 -3
- package/types/modules/counter.d.ts +9 -2
- package/types/modules/custom-clipboard.d.ts +4 -7
- package/types/modules/custom-image/Options.d.ts +34 -23
- package/types/modules/custom-image/actions/Action.d.ts +5 -3
- package/types/modules/custom-image/actions/custom-resize-action.d.ts +24 -0
- package/types/modules/custom-image/actions/delete-action.d.ts +7 -0
- package/types/modules/custom-image/actions/image-toolbar-buttons.d.ts +17 -0
- package/types/modules/custom-image/actions/index.d.ts +6 -0
- package/types/modules/custom-image/actions/toolbar-action.d.ts +12 -0
- package/types/modules/custom-image/actions/toolbar.d.ts +20 -0
- package/types/modules/custom-image/blot-formatter.d.ts +24 -0
- package/types/modules/custom-image/image-bar.d.ts +9 -7
- package/types/modules/custom-image/image.d.ts +22 -23
- package/types/modules/custom-image/index.d.ts +4 -0
- package/types/modules/custom-image/specs/blot-spec.d.ts +13 -0
- package/types/modules/custom-image/specs/custom-image-spec.d.ts +18 -0
- package/types/modules/custom-image/specs/image-spec.d.ts +9 -0
- package/types/modules/custom-image/specs/index.d.ts +3 -0
- package/types/modules/custom-uploader.d.ts +38 -28
- package/types/modules/divider.d.ts +6 -4
- package/types/modules/emoji/formats/emoji-blot.d.ts +9 -7
- package/types/modules/emoji/index.d.ts +3 -10
- package/types/modules/emoji/modules/emoji.d.ts +6 -6
- package/types/modules/emoji/modules/toolbar-emoji.d.ts +7 -6
- package/types/modules/emoji.d.ts +35 -0
- package/types/modules/file/formats/file.d.ts +14 -10
- package/types/modules/file/index.d.ts +3 -11
- package/types/modules/file/modules/file-bar.d.ts +1 -1
- package/types/modules/file/modules/file-module.d.ts +10 -0
- package/types/modules/i18n.d.ts +4 -5
- package/types/modules/index.d.ts +15 -0
- package/types/modules/link/formats/link.d.ts +5 -5
- package/types/modules/link/index.d.ts +2 -6
- package/types/modules/link/modules/tooltip.d.ts +5 -10
- package/types/modules/mathlive/formats.d.ts +2 -2
- package/types/modules/mathlive/index.d.ts +3 -9
- package/types/modules/mathlive/module.d.ts +10 -0
- package/types/modules/mathlive/tooltip.d.ts +1 -1
- package/types/modules/mention/Mention.d.ts +3 -4
- package/types/modules/mention/index.d.ts +2 -0
- package/types/modules/mention/mention-link.d.ts +17 -0
- package/types/modules/shortcut-key/index.d.ts +16 -41
- package/types/modules/table-up/index.d.ts +27 -27
- package/types/modules/toolbar/better-toolbar.d.ts +8 -0
- package/types/modules/toolbar/index.d.ts +2 -8
- package/types/tools/fullscreen.d.ts +5 -1
- package/types/ui/icons.config.d.ts +1 -0
- package/types/utils/is.d.ts +3 -1
- package/es/config/types/additional-toolbar-item.interface.es.js +0 -2
- package/es/config/types/additional-toolbar-item.interface.es.js.map +0 -1
- package/es/config/types/content-change.interface.es.js +0 -2
- package/es/config/types/content-change.interface.es.js.map +0 -1
- package/es/config/types/content-save.interface.es.js +0 -2
- package/es/config/types/content-save.interface.es.js.map +0 -1
- package/es/config/types/counter-option.interface.es.js +0 -2
- package/es/config/types/counter-option.interface.es.js.map +0 -1
- package/es/config/types/editor-toolbar.interface.es.js +0 -2
- package/es/config/types/editor-toolbar.interface.es.js.map +0 -1
- package/es/config/types/file-operation.interface.es.js +0 -2
- package/es/config/types/file-operation.interface.es.js.map +0 -1
- package/es/config/types/focus-change.interface.es.js +0 -2
- package/es/config/types/focus-change.interface.es.js.map +0 -1
- package/es/config/types/fullscreen-module.interface.es.js +0 -2
- package/es/config/types/fullscreen-module.interface.es.js.map +0 -1
- package/es/config/types/help-panel-item.interface.es.js +0 -2
- package/es/config/types/help-panel-item.interface.es.js.map +0 -1
- package/es/config/types/help-panel-option.interface.es.js +0 -2
- package/es/config/types/help-panel-option.interface.es.js.map +0 -1
- package/es/config/types/image-module.interface.es.js +0 -2
- package/es/config/types/image-module.interface.es.js.map +0 -1
- package/es/config/types/image-upload.interface.es.js +0 -2
- package/es/config/types/image-upload.interface.es.js.map +0 -1
- package/es/config/types/load-on-demand-module.interface.es.js +0 -2
- package/es/config/types/load-on-demand-module.interface.es.js.map +0 -1
- package/es/config/types/mention-module.interface.es.js +0 -2
- package/es/config/types/mention-module.interface.es.js.map +0 -1
- package/es/config/types/paste-change.interface.es.js +0 -2
- package/es/config/types/paste-change.interface.es.js.map +0 -1
- package/es/config/types/quick-menu-module.interface.es.js +0 -2
- package/es/config/types/quick-menu-module.interface.es.js.map +0 -1
- package/es/config/types/range.interface.es.js +0 -2
- package/es/config/types/range.interface.es.js.map +0 -1
- package/es/config/types/registry-options.interface.es.js +0 -2
- package/es/config/types/registry-options.interface.es.js.map +0 -1
- package/es/config/types/selection-change.interface.es.js +0 -2
- package/es/config/types/selection-change.interface.es.js.map +0 -1
- package/es/config/types/toolbar-item.interface.es.js +0 -2
- package/es/config/types/toolbar-item.interface.es.js.map +0 -1
- package/es/config/types/validate-error.interface.es.js +0 -2
- package/es/config/types/validate-error.interface.es.js.map +0 -1
- package/es/modules/custom-image/BlotFormatter.es.js.map +0 -1
- package/es/modules/custom-image/Options.es.js +0 -95
- package/es/modules/custom-image/Options.es.js.map +0 -1
- package/es/modules/custom-image/actions/Action.es.js +0 -15
- package/es/modules/custom-image/actions/Action.es.js.map +0 -1
- package/es/modules/custom-image/actions/DeleteAction.es.js.map +0 -1
- package/es/modules/custom-image/image-bar.es.js +0 -127
- package/es/modules/custom-image/image-bar.es.js.map +0 -1
- package/es/modules/custom-image/specs/BlotSpec.es.js +0 -27
- package/es/modules/custom-image/specs/BlotSpec.es.js.map +0 -1
- package/es/modules/custom-image/specs/CustomImageSpec.es.js.map +0 -1
- package/es/modules/custom-image/specs/ImageSpec.es.js +0 -29
- package/es/modules/custom-image/specs/ImageSpec.es.js.map +0 -1
- package/es/modules/emoji/emoji-list/index.es.js +0 -5
- package/es/modules/emoji/emoji-list/people.es.js +0 -114
- package/es/modules/emoji/emoji-list/people.es.js.map +0 -1
- package/es/modules/emoji/emoji-list.es.js +0 -9
- package/es/modules/emoji/emoji-list.es.js.map +0 -1
- package/es/modules/emoji/emoji-map.es.js +0 -9
- package/es/modules/emoji/emoji-map.es.js.map +0 -1
- package/es/modules/emoji/emoji-sprite.es.js +0 -5
- package/es/modules/emoji/emoji-sprite.es.js.map +0 -1
- package/es/modules/emoji/formats/emoji-blot.es.js +0 -41
- package/es/modules/emoji/formats/emoji-blot.es.js.map +0 -1
- package/es/modules/emoji/index.es.js +0 -8
- package/es/modules/emoji/index.es.js.map +0 -1
- package/es/modules/emoji/modules/emoji.es.js +0 -248
- package/es/modules/emoji/modules/emoji.es.js.map +0 -1
- package/es/modules/emoji/modules/toolbar-emoji.es.js +0 -153
- package/es/modules/emoji/modules/toolbar-emoji.es.js.map +0 -1
- package/es/modules/emoji/utils.es.js +0 -19
- package/es/modules/emoji/utils.es.js.map +0 -1
- package/es/modules/mention/Mention.es.js.map +0 -1
- package/es/modules/mention/MentionLink.es.js.map +0 -1
- package/lib/config/types/additional-toolbar-item.interface.cjs.js +0 -2
- package/lib/config/types/additional-toolbar-item.interface.cjs.js.map +0 -1
- package/lib/config/types/content-change.interface.cjs.js +0 -2
- package/lib/config/types/content-change.interface.cjs.js.map +0 -1
- package/lib/config/types/content-save.interface.cjs.js +0 -2
- package/lib/config/types/content-save.interface.cjs.js.map +0 -1
- package/lib/config/types/counter-option.interface.cjs.js +0 -2
- package/lib/config/types/counter-option.interface.cjs.js.map +0 -1
- package/lib/config/types/editor-toolbar.interface.cjs.js +0 -2
- package/lib/config/types/editor-toolbar.interface.cjs.js.map +0 -1
- package/lib/config/types/file-operation.interface.cjs.js +0 -2
- package/lib/config/types/file-operation.interface.cjs.js.map +0 -1
- package/lib/config/types/focus-change.interface.cjs.js +0 -2
- package/lib/config/types/focus-change.interface.cjs.js.map +0 -1
- package/lib/config/types/fullscreen-module.interface.cjs.js +0 -2
- package/lib/config/types/fullscreen-module.interface.cjs.js.map +0 -1
- package/lib/config/types/help-panel-item.interface.cjs.js +0 -2
- package/lib/config/types/help-panel-item.interface.cjs.js.map +0 -1
- package/lib/config/types/help-panel-option.interface.cjs.js +0 -2
- package/lib/config/types/help-panel-option.interface.cjs.js.map +0 -1
- package/lib/config/types/image-module.interface.cjs.js +0 -2
- package/lib/config/types/image-module.interface.cjs.js.map +0 -1
- package/lib/config/types/image-upload.interface.cjs.js +0 -2
- package/lib/config/types/image-upload.interface.cjs.js.map +0 -1
- package/lib/config/types/load-on-demand-module.interface.cjs.js +0 -2
- package/lib/config/types/load-on-demand-module.interface.cjs.js.map +0 -1
- package/lib/config/types/mention-module.interface.cjs.js +0 -2
- package/lib/config/types/mention-module.interface.cjs.js.map +0 -1
- package/lib/config/types/paste-change.interface.cjs.js +0 -2
- package/lib/config/types/paste-change.interface.cjs.js.map +0 -1
- package/lib/config/types/quick-menu-module.interface.cjs.js +0 -2
- package/lib/config/types/quick-menu-module.interface.cjs.js.map +0 -1
- package/lib/config/types/range.interface.cjs.js +0 -2
- package/lib/config/types/range.interface.cjs.js.map +0 -1
- package/lib/config/types/registry-options.interface.cjs.js +0 -2
- package/lib/config/types/registry-options.interface.cjs.js.map +0 -1
- package/lib/config/types/selection-change.interface.cjs.js +0 -2
- package/lib/config/types/selection-change.interface.cjs.js.map +0 -1
- package/lib/config/types/toolbar-item.interface.cjs.js +0 -2
- package/lib/config/types/toolbar-item.interface.cjs.js.map +0 -1
- package/lib/config/types/validate-error.interface.cjs.js +0 -2
- package/lib/config/types/validate-error.interface.cjs.js.map +0 -1
- package/lib/modules/custom-image/BlotFormatter.cjs.js.map +0 -1
- package/lib/modules/custom-image/Options.cjs.js +0 -95
- package/lib/modules/custom-image/Options.cjs.js.map +0 -1
- package/lib/modules/custom-image/actions/Action.cjs.js +0 -15
- package/lib/modules/custom-image/actions/Action.cjs.js.map +0 -1
- package/lib/modules/custom-image/actions/DeleteAction.cjs.js.map +0 -1
- package/lib/modules/custom-image/image-bar.cjs.js +0 -127
- package/lib/modules/custom-image/image-bar.cjs.js.map +0 -1
- package/lib/modules/custom-image/specs/BlotSpec.cjs.js +0 -27
- package/lib/modules/custom-image/specs/BlotSpec.cjs.js.map +0 -1
- package/lib/modules/custom-image/specs/CustomImageSpec.cjs.js.map +0 -1
- package/lib/modules/custom-image/specs/ImageSpec.cjs.js +0 -29
- package/lib/modules/custom-image/specs/ImageSpec.cjs.js.map +0 -1
- package/lib/modules/emoji/emoji-list/index.cjs.js +0 -5
- package/lib/modules/emoji/emoji-list/people.cjs.js +0 -114
- package/lib/modules/emoji/emoji-list/people.cjs.js.map +0 -1
- package/lib/modules/emoji/emoji-list.cjs.js +0 -9
- package/lib/modules/emoji/emoji-list.cjs.js.map +0 -1
- package/lib/modules/emoji/emoji-map.cjs.js +0 -9
- package/lib/modules/emoji/emoji-map.cjs.js.map +0 -1
- package/lib/modules/emoji/emoji-sprite.cjs.js +0 -5
- package/lib/modules/emoji/emoji-sprite.cjs.js.map +0 -1
- package/lib/modules/emoji/formats/emoji-blot.cjs.js +0 -41
- package/lib/modules/emoji/formats/emoji-blot.cjs.js.map +0 -1
- package/lib/modules/emoji/index.cjs.js +0 -8
- package/lib/modules/emoji/index.cjs.js.map +0 -1
- package/lib/modules/emoji/modules/emoji.cjs.js +0 -248
- package/lib/modules/emoji/modules/emoji.cjs.js.map +0 -1
- package/lib/modules/emoji/modules/toolbar-emoji.cjs.js +0 -153
- package/lib/modules/emoji/modules/toolbar-emoji.cjs.js.map +0 -1
- package/lib/modules/emoji/utils.cjs.js +0 -19
- package/lib/modules/emoji/utils.cjs.js.map +0 -1
- package/lib/modules/mention/Mention.cjs.js.map +0 -1
- package/lib/modules/mention/MentionLink.cjs.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
8
8
|
|
|
9
|
+
[](https://deepwiki.com/opentiny/tiny-editor)
|
|
10
|
+
|
|
9
11
|
TinyEditor is a rich text editor based on Quill 2.0, which extends Quill with rich modules and formats such as table, image, link, clipboard, emoji, file, mention, and quick menu. It is framework-independent, compatible with Quill API, and compatible with Quill module ecosystem.
|
|
10
12
|
|
|
11
13
|
English | [简体中文](README.zh-CN.md)
|
|
@@ -66,30 +68,11 @@ Open your browser and visit: [http://localhost:5173/tiny-editor/](http://localho
|
|
|
66
68
|
|
|
67
69
|
## Contributors ✨
|
|
68
70
|
|
|
69
|
-
Contributors are community members who have
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<!-- prettier-ignore-start -->
|
|
75
|
-
<!-- markdownlint-disable -->
|
|
76
|
-
<table>
|
|
77
|
-
<tbody>
|
|
78
|
-
<tr>
|
|
79
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zzxming"><img src="https://avatars.githubusercontent.com/u/74341337?v=4?s=100" width="100px;" alt="zzxming"/><br /><sub><b>zzxming</b></sub></a><br /><a href="https://github.com/opentiny/tiny-editor/commits?author=zzxming" title="Code">💻</a></td>
|
|
80
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Janson1012"><img src="https://avatars.githubusercontent.com/u/60996238?v=4?s=100" width="100px;" alt="Janson1012"/><br /><sub><b>Janson1012</b></sub></a><br /><a href="https://github.com/opentiny/tiny-editor/commits?author=Janson1012" title="Code">💻</a></td>
|
|
81
|
-
<td align="center" valign="top" width="14.28%"><a href="https://kagol.github.io/blogs"><img src="https://avatars.githubusercontent.com/u/9566362?v=4?s=100" width="100px;" alt="Kagol"/><br /><sub><b>Kagol</b></sub></a><br /><a href="https://github.com/opentiny/tiny-editor/commits?author=kagol" title="Code">💻</a></td>
|
|
82
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kiss-keray"><img src="https://avatars.githubusercontent.com/u/24504763?v=4?s=100" width="100px;" alt="keray"/><br /><sub><b>keray</b></sub></a><br /><a href="https://github.com/opentiny/tiny-editor/commits?author=kiss-keray" title="Code">💻</a></td>
|
|
83
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/qwangry"><img src="https://avatars.githubusercontent.com/u/58112936?v=4?s=100" width="100px;" alt="qwangry"/><br /><sub><b>qwangry</b></sub></a><br /><a href="https://github.com/opentiny/tiny-editor/commits?author=qwangry" title="Code">💻</a></td>
|
|
84
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jany55555"><img src="https://avatars.githubusercontent.com/u/173228510?v=4?s=100" width="100px;" alt="jany55555"/><br /><sub><b>jany55555</b></sub></a><br /><a href="https://github.com/opentiny/tiny-editor/commits?author=jany55555" title="Code">💻</a></td>
|
|
85
|
-
</tr>
|
|
86
|
-
</tbody>
|
|
87
|
-
</table>
|
|
88
|
-
|
|
89
|
-
<!-- markdownlint-restore -->
|
|
90
|
-
<!-- prettier-ignore-end -->
|
|
91
|
-
|
|
92
|
-
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
71
|
+
Contributors are community members who have made contributions in OpenTiny.
|
|
72
|
+
|
|
73
|
+
<a href="https://www.openomy.com/github/opentiny/tiny-editor" target="_blank" style="display: block; width: 100%;" align="center">
|
|
74
|
+
<img src="https://www.openomy.com/svg?repo=opentiny/tiny-editor&chart=bubble&latestMonth=99" target="_blank" alt="Contribution Leaderboard" style="display: block; width: 100%;" />
|
|
75
|
+
</a>
|
|
93
76
|
|
|
94
77
|
## Credits ❤️
|
|
95
78
|
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { EN_US } from "./i18n/en-us.es.js";
|
|
2
|
-
import { ZH_CN } from "./i18n/zh-cn.es.js";
|
|
3
1
|
const BIG_DELTA_LIMIT = 2e3;
|
|
4
|
-
const LANG_CONF = {
|
|
5
|
-
"en-US": EN_US,
|
|
6
|
-
"zh-CN": ZH_CN
|
|
7
|
-
};
|
|
8
2
|
const CHANGE_LANGUAGE_EVENT = "change-language";
|
|
9
3
|
const defaultLanguage = "en-US";
|
|
10
4
|
const IMAGE_UPLOADER_MIME_TYPES = [
|
|
@@ -83,7 +77,6 @@ export {
|
|
|
83
77
|
DOC_UPLOADER_MIME_TYPES,
|
|
84
78
|
FILE_UPLOADER_MIME_TYPES,
|
|
85
79
|
IMAGE_UPLOADER_MIME_TYPES,
|
|
86
|
-
LANG_CONF,
|
|
87
80
|
OTHER_FILE_UPLOADER_MIME_TYPES,
|
|
88
81
|
PPT_UPLOADER_MIME_TYPES,
|
|
89
82
|
XSL_UPLOADER_MIME_TYPES,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.config.es.js","sources":["../../../src/config/editor.config.ts"],"sourcesContent":["
|
|
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;"}
|
|
@@ -121,7 +121,6 @@ function isInside(position, dom) {
|
|
|
121
121
|
const inside = left > areaLeft && left < areaLeft + areaWidth && top > areaTop && top < areaTop + areaHeight;
|
|
122
122
|
return inside;
|
|
123
123
|
}
|
|
124
|
-
const isPureIE = !!document.documentMode;
|
|
125
124
|
export {
|
|
126
125
|
getEventComposedPath,
|
|
127
126
|
hadProtocol,
|
|
@@ -130,7 +129,6 @@ export {
|
|
|
130
129
|
imageUrlToFile,
|
|
131
130
|
isInside,
|
|
132
131
|
isNullOrUndefined,
|
|
133
|
-
isPureIE,
|
|
134
132
|
omit,
|
|
135
133
|
replaceDeltaImage,
|
|
136
134
|
sanitize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.utils.es.js","sources":["../../../src/config/editor.utils.ts"],"sourcesContent":["import Quill from 'quill'\r\n\r\nconst Delta = Quill.import('delta')\r\n\r\n// color hex to rgba\r\nexport function hexToRgbA(hex: string) {\r\n let color\r\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\r\n color = hex.substring(1).split('')\r\n if (color.length === 3) {\r\n color = [color[0], color[0], color[1], color[1], color[2], color[2]]\r\n }\r\n color = `0x${color.join('')}`\r\n return (\r\n `rgba(${\r\n [(color >> 16) & 255, (color >> 8) & 255, color & 255].join(',')\r\n },1)`\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * 将File格式的图片转换成Url格式\r\n * @param imageFile File格式的图片\r\n */\r\nexport function imageFileToUrl(imageFile) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(imageFile)\r\n reader.onload = function (e) {\r\n resolve(e.target.result)\r\n }\r\n reader.onerror = reject\r\n }).catch((error) => {\r\n console.error('Error reading file:', error)\r\n })\r\n}\r\n\r\n/**\r\n * 将Url格式的图片转换成File格式\r\n * @param imageUrl 图片的URL\r\n */\r\nexport function imageUrlToFile(imageUrl, isErrorImage?: boolean) {\r\n return new Promise((resolve, reject) => {\r\n fetch(imageUrl, {\r\n method: 'get',\r\n mode: 'no-cors',\r\n })\r\n .then(res => res.blob())\r\n .then((blob) => {\r\n if (!blob.type.includes('image') || !blob.type) {\r\n return reject()\r\n }\r\n const fileType = blob.type.replace(/^.*\\//, '')\r\n const fileName = isErrorImage\r\n ? 'editorx-error-image.png'\r\n : `image-${new Date().getTime()}.${fileType}`\r\n const file = new File([blob], fileName, blob)\r\n resolve(file)\r\n })\r\n .catch(reject)\r\n })\r\n}\r\n\r\nexport function isNullOrUndefined(param) {\r\n return param === null || param === undefined\r\n}\r\n\r\n/**\r\n * omit\r\n * @param obj target Object\r\n * @param uselessKeys keys of removed properties\r\n * @return new Object without useless properties\r\n */\r\nexport function omit(obj, uselessKeys) {\r\n return (\r\n obj\r\n && Object.keys(obj).reduce((acc, key) => {\r\n return uselessKeys.includes(key) ? acc : { ...acc, [key]: obj[key] }\r\n }, {})\r\n )\r\n}\r\n\r\n/**\r\n * 将delta中的图片替换成制定的图片数组,用于图片上传到服务器的场景\r\n * @param delta 原始delta\r\n * @param imageUrls 图片数组\r\n * @param imagePlaceholder 标识是否是占位图的数组,与图片数组一一对应\r\n * @return 替换之后的delta\r\n */\r\nexport function replaceDeltaImage(delta, imageUrls, imagePlaceholder) {\r\n let imageIndex = 0\r\n return delta.reduce((newDelta, op) => {\r\n if (op.insert.image && !op.insert.image.hasExisted) {\r\n const attributes = imagePlaceholder[imageIndex]\r\n ? { ...op.attributes, width: 'auto', height: 225 } // 占位图片应该固定大小\r\n : op.attributes\r\n newDelta.insert({ image: imageUrls[imageIndex] }, attributes)\r\n imageIndex++\r\n }\r\n else {\r\n newDelta.insert(op.insert, op.attributes)\r\n }\r\n return newDelta\r\n }, new Delta())\r\n}\r\n\r\nexport function splitWithBreak(insertContent: string) {\r\n const lines = []\r\n const insertStr = insertContent\r\n let start = 0\r\n for (let i = 0; i < insertContent.length; i++) {\r\n if (insertStr.charAt(i) === '\\n') {\r\n if (i === 0) {\r\n lines.push('\\n')\r\n }\r\n else {\r\n lines.push(insertStr.substring(start, i))\r\n lines.push('\\n')\r\n }\r\n start = i + 1\r\n }\r\n }\r\n\r\n const tailStr = insertStr.substring(start)\r\n if (tailStr) {\r\n lines.push(tailStr)\r\n }\r\n\r\n return lines\r\n}\r\n\r\n/**\r\n * getEventComposedPath\r\n * compatibility fixed for Event.path/Event.composedPath\r\n * Event.path is only for chrome/opera\r\n * Event.composedPath is for Safari, FF\r\n * Neither for Micro Edge\r\n * @return an array of event.path\r\n */\r\nexport function getEventComposedPath(evt) {\r\n let path\r\n // chrome, opera, safari, firefox\r\n path = evt.path || (evt.composedPath && evt.composedPath())\r\n\r\n // other: edge\r\n if (path === undefined && evt.target) {\r\n path = []\r\n let target = evt.target\r\n path.push(target)\r\n\r\n while (target && target.parentNode) {\r\n target = target.parentNode\r\n path.push(target)\r\n }\r\n }\r\n\r\n return path\r\n}\r\n\r\nexport function sanitize(url, protocols) {\r\n const anchor = document.createElement('a')\r\n anchor.href = url\r\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'))\r\n return protocols.includes(protocol)\r\n}\r\n\r\nexport function hadProtocol(url: string) {\r\n if (!url || !/^(?:f|ht)tps?\\:\\/\\//.test(url)) {\r\n return false\r\n }\r\n return true\r\n}\r\n\r\nexport function isInside(position, dom) {\r\n const areaPosition = dom.getBoundingClientRect()\r\n const { pageX, pageY } = position\r\n // getBoundingClientRect是不考虑窗口滚动的\r\n const left = pageX - window.scrollX\r\n const top = pageY - window.scrollY\r\n const {\r\n left: areaLeft,\r\n top: areaTop,\r\n width: areaWidth,\r\n height: areaHeight,\r\n } = areaPosition\r\n const inside\r\n = left > areaLeft\r\n && left < areaLeft + areaWidth\r\n && top > areaTop\r\n && top < areaTop + areaHeight\r\n return inside\r\n}\r\n
|
|
1
|
+
{"version":3,"file":"editor.utils.es.js","sources":["../../../src/config/editor.utils.ts"],"sourcesContent":["import Quill from 'quill'\r\n\r\nconst Delta = Quill.import('delta')\r\n\r\n// color hex to rgba\r\nexport function hexToRgbA(hex: string) {\r\n let color\r\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\r\n color = hex.substring(1).split('')\r\n if (color.length === 3) {\r\n color = [color[0], color[0], color[1], color[1], color[2], color[2]]\r\n }\r\n color = `0x${color.join('')}`\r\n return (\r\n `rgba(${\r\n [(color >> 16) & 255, (color >> 8) & 255, color & 255].join(',')\r\n },1)`\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * 将File格式的图片转换成Url格式\r\n * @param imageFile File格式的图片\r\n */\r\nexport function imageFileToUrl(imageFile) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(imageFile)\r\n reader.onload = function (e) {\r\n resolve(e.target.result)\r\n }\r\n reader.onerror = reject\r\n }).catch((error) => {\r\n console.error('Error reading file:', error)\r\n })\r\n}\r\n\r\n/**\r\n * 将Url格式的图片转换成File格式\r\n * @param imageUrl 图片的URL\r\n */\r\nexport function imageUrlToFile(imageUrl, isErrorImage?: boolean) {\r\n return new Promise((resolve, reject) => {\r\n fetch(imageUrl, {\r\n method: 'get',\r\n mode: 'no-cors',\r\n })\r\n .then(res => res.blob())\r\n .then((blob) => {\r\n if (!blob.type.includes('image') || !blob.type) {\r\n return reject()\r\n }\r\n const fileType = blob.type.replace(/^.*\\//, '')\r\n const fileName = isErrorImage\r\n ? 'editorx-error-image.png'\r\n : `image-${new Date().getTime()}.${fileType}`\r\n const file = new File([blob], fileName, blob)\r\n resolve(file)\r\n })\r\n .catch(reject)\r\n })\r\n}\r\n\r\nexport function isNullOrUndefined(param) {\r\n return param === null || param === undefined\r\n}\r\n\r\n/**\r\n * omit\r\n * @param obj target Object\r\n * @param uselessKeys keys of removed properties\r\n * @return new Object without useless properties\r\n */\r\nexport function omit(obj, uselessKeys) {\r\n return (\r\n obj\r\n && Object.keys(obj).reduce((acc, key) => {\r\n return uselessKeys.includes(key) ? acc : { ...acc, [key]: obj[key] }\r\n }, {})\r\n )\r\n}\r\n\r\n/**\r\n * 将delta中的图片替换成制定的图片数组,用于图片上传到服务器的场景\r\n * @param delta 原始delta\r\n * @param imageUrls 图片数组\r\n * @param imagePlaceholder 标识是否是占位图的数组,与图片数组一一对应\r\n * @return 替换之后的delta\r\n */\r\nexport function replaceDeltaImage(delta, imageUrls, imagePlaceholder) {\r\n let imageIndex = 0\r\n return delta.reduce((newDelta, op) => {\r\n if (op.insert.image && !op.insert.image.hasExisted) {\r\n const attributes = imagePlaceholder[imageIndex]\r\n ? { ...op.attributes, width: 'auto', height: 225 } // 占位图片应该固定大小\r\n : op.attributes\r\n newDelta.insert({ image: imageUrls[imageIndex] }, attributes)\r\n imageIndex++\r\n }\r\n else {\r\n newDelta.insert(op.insert, op.attributes)\r\n }\r\n return newDelta\r\n }, new Delta())\r\n}\r\n\r\nexport function splitWithBreak(insertContent: string) {\r\n const lines = []\r\n const insertStr = insertContent\r\n let start = 0\r\n for (let i = 0; i < insertContent.length; i++) {\r\n if (insertStr.charAt(i) === '\\n') {\r\n if (i === 0) {\r\n lines.push('\\n')\r\n }\r\n else {\r\n lines.push(insertStr.substring(start, i))\r\n lines.push('\\n')\r\n }\r\n start = i + 1\r\n }\r\n }\r\n\r\n const tailStr = insertStr.substring(start)\r\n if (tailStr) {\r\n lines.push(tailStr)\r\n }\r\n\r\n return lines\r\n}\r\n\r\n/**\r\n * getEventComposedPath\r\n * compatibility fixed for Event.path/Event.composedPath\r\n * Event.path is only for chrome/opera\r\n * Event.composedPath is for Safari, FF\r\n * Neither for Micro Edge\r\n * @return an array of event.path\r\n */\r\nexport function getEventComposedPath(evt) {\r\n let path\r\n // chrome, opera, safari, firefox\r\n path = evt.path || (evt.composedPath && evt.composedPath())\r\n\r\n // other: edge\r\n if (path === undefined && evt.target) {\r\n path = []\r\n let target = evt.target\r\n path.push(target)\r\n\r\n while (target && target.parentNode) {\r\n target = target.parentNode\r\n path.push(target)\r\n }\r\n }\r\n\r\n return path\r\n}\r\n\r\nexport function sanitize(url, protocols) {\r\n const anchor = document.createElement('a')\r\n anchor.href = url\r\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'))\r\n return protocols.includes(protocol)\r\n}\r\n\r\nexport function hadProtocol(url: string) {\r\n if (!url || !/^(?:f|ht)tps?\\:\\/\\//.test(url)) {\r\n return false\r\n }\r\n return true\r\n}\r\n\r\nexport function isInside(position, dom) {\r\n const areaPosition = dom.getBoundingClientRect()\r\n const { pageX, pageY } = position\r\n // getBoundingClientRect是不考虑窗口滚动的\r\n const left = pageX - window.scrollX\r\n const top = pageY - window.scrollY\r\n const {\r\n left: areaLeft,\r\n top: areaTop,\r\n width: areaWidth,\r\n height: areaHeight,\r\n } = areaPosition\r\n const inside\r\n = left > areaLeft\r\n && left < areaLeft + areaWidth\r\n && top > areaTop\r\n && top < areaTop + areaHeight\r\n return inside\r\n}\r\n"],"names":[],"mappings":";AAEA,MAAM,QAAQ,MAAM,OAAO,OAAO;AAG3B,SAAS,UAAU,KAAa;AACjC,MAAA;AACA,MAAA,2BAA2B,KAAK,GAAG,GAAG;AACxC,YAAQ,IAAI,UAAU,CAAC,EAAE,MAAM,EAAE;AAC7B,QAAA,MAAM,WAAW,GAAG;AACtB,cAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAAA,IAAA;AAErE,YAAQ,KAAK,MAAM,KAAK,EAAE,CAAC;AAC3B,WACE,QACE,CAAE,SAAS,KAAM,KAAM,SAAS,IAAK,KAAK,QAAQ,GAAG,EAAE,KAAK,GAAG,CACjE;AAAA,EAAA;AAGN;AAMO,SAAS,eAAe,WAAW;AACxC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAChC,UAAA,SAAS,IAAI,WAAW;AAC9B,WAAO,cAAc,SAAS;AACvB,WAAA,SAAS,SAAU,GAAG;AACnB,cAAA,EAAE,OAAO,MAAM;AAAA,IACzB;AACA,WAAO,UAAU;AAAA,EAAA,CAClB,EAAE,MAAM,CAAC,UAAU;AACV,YAAA,MAAM,uBAAuB,KAAK;AAAA,EAAA,CAC3C;AACH;AAMgB,SAAA,eAAe,UAAU,cAAwB;AAC/D,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,UAAU;AAAA,MACd,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA,CACP,EACE,KAAK,CAAO,QAAA,IAAI,MAAM,EACtB,KAAK,CAAC,SAAS;AACV,UAAA,CAAC,KAAK,KAAK,SAAS,OAAO,KAAK,CAAC,KAAK,MAAM;AAC9C,eAAO,OAAO;AAAA,MAAA;AAEhB,YAAM,WAAW,KAAK,KAAK,QAAQ,SAAS,EAAE;AACxC,YAAA,WAAW,eACb,4BACA,UAAS,oBAAI,QAAO,QAAA,CAAS,IAAI,QAAQ;AAC7C,YAAM,OAAO,IAAI,KAAK,CAAC,IAAI,GAAG,UAAU,IAAI;AAC5C,cAAQ,IAAI;AAAA,IAAA,CACb,EACA,MAAM,MAAM;AAAA,EAAA,CAChB;AACH;AAEO,SAAS,kBAAkB,OAAO;AAChC,SAAA,UAAU,QAAQ,UAAU;AACrC;AAQgB,SAAA,KAAK,KAAK,aAAa;AAEnC,SAAA,OACG,OAAO,KAAK,GAAG,EAAE,OAAO,CAAC,KAAK,QAAQ;AACvC,WAAO,YAAY,SAAS,GAAG,IAAI,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE;AAAA,EACrE,GAAG,EAAE;AAET;AASgB,SAAA,kBAAkB,OAAO,WAAW,kBAAkB;AACpE,MAAI,aAAa;AACjB,SAAO,MAAM,OAAO,CAAC,UAAU,OAAO;AACpC,QAAI,GAAG,OAAO,SAAS,CAAC,GAAG,OAAO,MAAM,YAAY;AAClD,YAAM,aAAa,iBAAiB,UAAU,IAC1C,EAAE,GAAG,GAAG,YAAY,OAAO,QAAQ,QAAQ,QAC3C,GAAG;AACP,eAAS,OAAO,EAAE,OAAO,UAAU,UAAU,KAAK,UAAU;AAC5D;AAAA,IAAA,OAEG;AACH,eAAS,OAAO,GAAG,QAAQ,GAAG,UAAU;AAAA,IAAA;AAEnC,WAAA;AAAA,EAAA,GACN,IAAI,MAAA,CAAO;AAChB;AAEO,SAAS,eAAe,eAAuB;AACpD,QAAM,QAAQ,CAAC;AACf,QAAM,YAAY;AAClB,MAAI,QAAQ;AACZ,WAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;AAC7C,QAAI,UAAU,OAAO,CAAC,MAAM,MAAM;AAChC,UAAI,MAAM,GAAG;AACX,cAAM,KAAK,IAAI;AAAA,MAAA,OAEZ;AACH,cAAM,KAAK,UAAU,UAAU,OAAO,CAAC,CAAC;AACxC,cAAM,KAAK,IAAI;AAAA,MAAA;AAEjB,cAAQ,IAAI;AAAA,IAAA;AAAA,EACd;AAGI,QAAA,UAAU,UAAU,UAAU,KAAK;AACzC,MAAI,SAAS;AACX,UAAM,KAAK,OAAO;AAAA,EAAA;AAGb,SAAA;AACT;AAUO,SAAS,qBAAqB,KAAK;AACpC,MAAA;AAEJ,SAAO,IAAI,QAAS,IAAI,gBAAgB,IAAI,aAAa;AAGrD,MAAA,SAAS,UAAa,IAAI,QAAQ;AACpC,WAAO,CAAC;AACR,QAAI,SAAS,IAAI;AACjB,SAAK,KAAK,MAAM;AAET,WAAA,UAAU,OAAO,YAAY;AAClC,eAAS,OAAO;AAChB,WAAK,KAAK,MAAM;AAAA,IAAA;AAAA,EAClB;AAGK,SAAA;AACT;AAEgB,SAAA,SAAS,KAAK,WAAW;AACjC,QAAA,SAAS,SAAS,cAAc,GAAG;AACzC,SAAO,OAAO;AACR,QAAA,WAAW,OAAO,KAAK,MAAM,GAAG,OAAO,KAAK,QAAQ,GAAG,CAAC;AACvD,SAAA,UAAU,SAAS,QAAQ;AACpC;AAEO,SAAS,YAAY,KAAa;AACvC,MAAI,CAAC,OAAO,CAAC,sBAAsB,KAAK,GAAG,GAAG;AACrC,WAAA;AAAA,EAAA;AAEF,SAAA;AACT;AAEgB,SAAA,SAAS,UAAU,KAAK;AAChC,QAAA,eAAe,IAAI,sBAAsB;AACzC,QAAA,EAAE,OAAO,MAAA,IAAU;AAEnB,QAAA,OAAO,QAAQ,OAAO;AACtB,QAAA,MAAM,QAAQ,OAAO;AACrB,QAAA;AAAA,IACJ,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,EAAA,IACN;AACE,QAAA,SACF,OAAO,YACJ,OAAO,WAAW,aAClB,MAAM,WACN,MAAM,UAAU;AAChB,SAAA;AACT;"}
|
|
@@ -30,19 +30,6 @@ const EN_US = {
|
|
|
30
30
|
"scroll-table": "Horizontal Scroll",
|
|
31
31
|
"mouse-wheel": "Mouse Wheel",
|
|
32
32
|
"save": "Save",
|
|
33
|
-
"copy-cells": "Copy",
|
|
34
|
-
"copy-table": "Copy Table",
|
|
35
|
-
"cut-cells": "Cut",
|
|
36
|
-
"empty-cells": "Clear Contents",
|
|
37
|
-
"insert-row-up": "Insert Rows Above",
|
|
38
|
-
"insert-row-down": "Insert Rows Below",
|
|
39
|
-
"insert-column-left": "Insert Columns to the Left",
|
|
40
|
-
"insert-column-right": "Insert Columns to the Right",
|
|
41
|
-
"merge-cells": "Merge Cells",
|
|
42
|
-
"unmerge-cells": "Split Cells",
|
|
43
|
-
"delete-row": "Delete Entire Row",
|
|
44
|
-
"delete-column": "Delete Entire Column",
|
|
45
|
-
"delete-table": "Delete Table",
|
|
46
33
|
"default-link-text": "Link",
|
|
47
34
|
"basicblock": "Card",
|
|
48
35
|
"linkplaceholder": "Enter an address and press Enter.",
|
|
@@ -1 +1 @@
|
|
|
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 'line-height': '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 '
|
|
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 'line-height': '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 '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 'link': 'Hyperlink',\r\n 'code': 'Inline Code',\r\n 'table': 'Table',\r\n 'table-up': 'Table',\r\n 'code-block': 'Code Block',\r\n 'formula': 'Formula',\r\n 'format-painter': 'Format Painter',\r\n 'divider': 'Divider',\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': 'List',\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 'header-list': 'Heading List',\r\n 'input-recall-menu-placeholder': 'Input / recall menu',\r\n 'clear-color': 'Clear color',\r\n 'custom-color': 'Color picker',\r\n // table-up texts\r\n 'fullCheckboxText': 'Insert full width table',\r\n 'customBtnText': 'Custom',\r\n 'confirmText': 'Confirm',\r\n 'cancelText': 'Cancel',\r\n 'rowText': 'Row',\r\n 'colText': 'Column',\r\n 'notPositiveNumberError': 'Please enter a positive integer',\r\n 'custom': 'Custom',\r\n 'clear': 'Clear',\r\n 'transparent': 'Transparent',\r\n 'perWidthInsufficient': 'The percentage width is insufficient. To complete the operation, the table needs to be converted to a fixed width. Do you want to continue?',\r\n 'CopyCell': 'Copy cell',\r\n 'CutCell': 'Cut cell',\r\n 'InsertTop': 'Insert row above',\r\n 'InsertRight': 'Insert column right',\r\n 'InsertBottom': 'Insert row below',\r\n 'InsertLeft': 'Insert column Left',\r\n 'MergeCell': 'Merge Cell',\r\n 'SplitCell': 'Split Cell',\r\n 'DeleteRow': 'Delete Row',\r\n 'DeleteColumn': 'Delete Column',\r\n 'DeleteTable': 'Delete table',\r\n 'BackgroundColor': 'Set background color',\r\n 'BorderColor': 'Set border color',\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,eAAe;AAAA,EACf,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,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,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,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;AAAA,EACZ,eAAe;AAAA,EACf,iCAAiC;AAAA,EACjC,eAAe;AAAA,EACf,gBAAgB;AAAA;AAAA,EAEhB,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,aAAa;AAAA,EACb,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,eAAe;AACjB;"}
|
|
@@ -30,19 +30,6 @@ const ZH_CN = {
|
|
|
30
30
|
"scroll-table": "水平滚动表格",
|
|
31
31
|
"mouse-wheel": "鼠标滚轮",
|
|
32
32
|
"save": "保存",
|
|
33
|
-
"copy-cells": "复制",
|
|
34
|
-
"copy-table": "复制表格",
|
|
35
|
-
"cut-cells": "剪切",
|
|
36
|
-
"empty-cells": "清空内容",
|
|
37
|
-
"insert-row-up": "上插入行",
|
|
38
|
-
"insert-row-down": "下插入行",
|
|
39
|
-
"insert-column-left": "左插入列",
|
|
40
|
-
"insert-column-right": "右插入列",
|
|
41
|
-
"merge-cells": "合并单元格",
|
|
42
|
-
"unmerge-cells": "拆分单元格",
|
|
43
|
-
"delete-row": "删除当前行",
|
|
44
|
-
"delete-column": "删除当前列",
|
|
45
|
-
"delete-table": "删除表格",
|
|
46
33
|
"default-link-text": "链接",
|
|
47
34
|
"basicblock": "卡片",
|
|
48
35
|
"linkplaceholder": "请输入链接地址,按回车键确认",
|
|
@@ -1 +1 @@
|
|
|
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 'line-height': '行距',\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 '
|
|
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 'line-height': '行距',\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 '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 'link': '超链接',\r\n 'divider': '分割线',\r\n 'code': '行内代码',\r\n 'table': '表格',\r\n 'table-up': '表格',\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': '列表',\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 'header-list': '标题列表',\r\n 'input-recall-menu-placeholder': '输入 / 唤起菜单',\r\n 'clear-color': '清除颜色',\r\n 'custom-color': '选择颜色',\r\n // table-up texts\r\n 'fullCheckboxText': '插入满宽度表格',\r\n 'customBtnText': '自定义行列数',\r\n 'confirmText': '确认',\r\n 'cancelText': '取消',\r\n 'rowText': '行数',\r\n 'colText': '列数',\r\n 'notPositiveNumberError': '请输入正整数',\r\n 'custom': '自定义',\r\n 'clear': '清除',\r\n 'transparent': '透明',\r\n 'perWidthInsufficient': '百分比宽度不足, 如需完成操作需要转换表格为固定宽度,是否继续?',\r\n 'CopyCell': '复制单元格',\r\n 'CutCell': '剪切单元格',\r\n 'InsertTop': '向上插入一行',\r\n 'InsertRight': '向右插入一列',\r\n 'InsertBottom': '向下插入一行',\r\n 'InsertLeft': '向左插入一列',\r\n 'MergeCell': '合并单元格',\r\n 'SplitCell': '拆分单元格',\r\n 'DeleteRow': '删除当前行',\r\n 'DeleteColumn': '删除当前列',\r\n 'DeleteTable': '删除当前表格',\r\n 'BackgroundColor': '设置背景颜色',\r\n 'BorderColor': '设置边框颜色',\r\n\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,eAAe;AAAA,EACf,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,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,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,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;AAAA,EACZ,eAAe;AAAA,EACf,iCAAiC;AAAA,EACjC,eAAe;AAAA,EACf,gBAAgB;AAAA;AAAA,EAEhB,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,aAAa;AAAA,EACb,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,eAAe;AAEjB;"}
|
package/es/config/index.es.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { isNullOrUndefined } from "./editor.utils.es.js";
|
|
2
|
-
import { getEventComposedPath, hadProtocol, hexToRgbA, imageFileToUrl, imageUrlToFile, isInside,
|
|
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,
|
|
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";
|
|
4
|
+
import "./types/index.es.js";
|
|
4
5
|
function inputFile(type, accept) {
|
|
5
|
-
|
|
6
|
-
const defaultMIMETypes = this.quill.uploader.options[type].join(", ");
|
|
7
|
-
const mimeTypes = accept || defaultMIMETypes;
|
|
6
|
+
if (accept.length <= 0) return;
|
|
8
7
|
let fileInput = this.container.querySelector(`input.ql-${type}[type=file]`);
|
|
9
|
-
this.quill.uploader.options.enableMultiUpload = (_a = this.quill.options.uploadOption) == null ? void 0 : _a.multiple;
|
|
10
8
|
if (isNullOrUndefined(fileInput)) {
|
|
11
9
|
fileInput = document.createElement("input");
|
|
10
|
+
fileInput.style.display = "none";
|
|
12
11
|
fileInput.classList.add(`ql-${type}`);
|
|
13
12
|
fileInput.setAttribute("type", "file");
|
|
14
|
-
fileInput.setAttribute("accept",
|
|
15
|
-
|
|
16
|
-
fileInput.setAttribute("multiple", "");
|
|
17
|
-
}
|
|
13
|
+
fileInput.setAttribute("accept", accept.map((mime) => mime === "*" ? `${type}/*` : mime).join(","));
|
|
14
|
+
fileInput.setAttribute("multiple", "");
|
|
18
15
|
fileInput.addEventListener("change", () => {
|
|
19
16
|
const range = this.quill.getSelection(true);
|
|
20
|
-
this.quill.uploader.upload(range, fileInput.files
|
|
17
|
+
this.quill.uploader.upload(range, fileInput.files);
|
|
21
18
|
fileInput.value = "";
|
|
22
19
|
});
|
|
23
20
|
this.container.appendChild(fileInput);
|
|
@@ -46,7 +43,6 @@ export {
|
|
|
46
43
|
DOC_UPLOADER_MIME_TYPES,
|
|
47
44
|
FILE_UPLOADER_MIME_TYPES,
|
|
48
45
|
IMAGE_UPLOADER_MIME_TYPES,
|
|
49
|
-
LANG_CONF,
|
|
50
46
|
OTHER_FILE_UPLOADER_MIME_TYPES,
|
|
51
47
|
PPT_UPLOADER_MIME_TYPES,
|
|
52
48
|
XSL_UPLOADER_MIME_TYPES,
|
|
@@ -60,7 +56,6 @@ export {
|
|
|
60
56
|
inputFile,
|
|
61
57
|
isInside,
|
|
62
58
|
isNullOrUndefined,
|
|
63
|
-
isPureIE,
|
|
64
59
|
namespace,
|
|
65
60
|
omit,
|
|
66
61
|
replaceDeltaImage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.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\n\r\n// 触发上传\r\nexport function inputFile(type
|
|
1
|
+
{"version":3,"file":"index.es.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":[],"mappings":";;;;AAOgB,SAAA,UAAU,MAAkC,QAAkB;AACxE,MAAA,OAAO,UAAU,EAAG;AACxB,MAAI,YAAY,KAAK,UAAU,cAAc,YAAY,IAAI,aAAa;AACtE,MAAA,kBAAkB,SAAS,GAAG;AACpB,gBAAA,SAAS,cAAc,OAAO;AAC1C,cAAU,MAAM,UAAU;AAC1B,cAAU,UAAU,IAAI,MAAM,IAAI,EAAE;AAC1B,cAAA,aAAa,QAAQ,MAAM;AACrC,cAAU,aAAa,UAAU,OAAO,IAAI,UAAQ,SAAS,MAAM,GAAG,IAAI,OAAO,IAAI,EAAE,KAAK,GAAG,CAAC;AACtF,cAAA,aAAa,YAAY,EAAE;AAC3B,cAAA,iBAAiB,UAAU,MAAM;AACzC,YAAM,QAAQ,KAAK,MAAM,aAAa,IAAI;AAC1C,WAAK,MAAM,SAAS,OAAO,OAAO,UAAU,KAAK;AACjD,gBAAU,QAAQ;AAAA,IAAA,CACnB;AACI,SAAA,UAAU,YAAY,SAAS;AAAA,EAAA;AAEtC,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,IAAA;AAAA,EACjB;AAEK,SAAA;AACT;AAEO,MAAM,YAAY;"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import "./additional-toolbar-item.interface.es.js";
|
|
2
|
-
import "./content-change.interface.es.js";
|
|
3
|
-
import "./content-save.interface.es.js";
|
|
4
|
-
import "./counter-option.interface.es.js";
|
|
5
1
|
import "./editor-config.interface.es.js";
|
|
6
2
|
import "./editor-modules.interface.es.js";
|
|
7
|
-
import "./editor-toolbar.interface.es.js";
|
|
8
|
-
import "./file-operation.interface.es.js";
|
|
9
|
-
import "./focus-change.interface.es.js";
|
|
10
|
-
import "./fullscreen-module.interface.es.js";
|
|
11
|
-
import "./help-panel-option.interface.es.js";
|
|
12
|
-
import "./image-module.interface.es.js";
|
|
13
|
-
import "./image-upload.interface.es.js";
|
|
14
|
-
import "./load-on-demand-module.interface.es.js";
|
|
15
|
-
import "./mention-module.interface.es.js";
|
|
16
|
-
import "./paste-change.interface.es.js";
|
|
17
|
-
import "./quick-menu-module.interface.es.js";
|
|
18
|
-
import "./range.interface.es.js";
|
|
19
|
-
import "./registry-options.interface.es.js";
|
|
20
|
-
import "./selection-change.interface.es.js";
|
|
21
|
-
import "./toolbar-item.interface.es.js";
|
|
22
3
|
import "./type.es.js";
|
|
23
|
-
import "./validate-error.interface.es.js";
|
|
24
4
|
//# 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":";;;"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1
4
|
import Quill from "quill";
|
|
2
5
|
import "../config/index.es.js";
|
|
3
|
-
import {
|
|
6
|
+
import { I18N } from "../modules/i18n.es.js";
|
|
7
|
+
import { defaultLanguage } from "../config/editor.config.es.js";
|
|
4
8
|
class FluentEditor extends Quill {
|
|
5
9
|
constructor(container, options = {}) {
|
|
6
10
|
super(container, options);
|
|
7
|
-
this
|
|
11
|
+
__publicField(this, "isFullscreen", false);
|
|
8
12
|
}
|
|
9
13
|
static register(...args) {
|
|
10
14
|
super.register(...args);
|
|
@@ -14,9 +18,7 @@ class FluentEditor extends Quill {
|
|
|
14
18
|
return i18nModule ? i18nModule.options.lang : defaultLanguage;
|
|
15
19
|
}
|
|
16
20
|
getLangText(name) {
|
|
17
|
-
|
|
18
|
-
if (!i18nModule) return LANG_CONF[defaultLanguage][name];
|
|
19
|
-
return i18nModule.options.langText[name];
|
|
21
|
+
return I18N.parserText(name, this.lang);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluent-editor.es.js","sources":["../../../src/core/fluent-editor.ts"],"sourcesContent":["import type { ExpandedQuillOptions } from 'quill'\r\nimport type { IEditorConfig } from '../config/types'\r\nimport type
|
|
1
|
+
{"version":3,"file":"fluent-editor.es.js","sources":["../../../src/core/fluent-editor.ts"],"sourcesContent":["import type { ExpandedQuillOptions } from 'quill'\r\nimport type { IEditorConfig } from '../config/types'\r\nimport type { FileUploader } from '../modules/custom-uploader'\r\nimport Quill from 'quill'\r\nimport { defaultLanguage } from '../config'\r\nimport I18N from '../modules/i18n'\r\n\r\nclass FluentEditor extends Quill {\r\n isFullscreen: boolean = false\r\n declare options: IEditorConfig & ExpandedQuillOptions\r\n declare uploader: FileUploader\r\n\r\n static register(...args: any[]): void {\r\n super.register(...args as Parameters<typeof Quill.register>)\r\n }\r\n\r\n get lang() {\r\n const i18nModule = this.getModule('i18n') as I18N\r\n return i18nModule ? i18nModule.options.lang : defaultLanguage\r\n }\r\n\r\n constructor(container: HTMLElement | string, options: IEditorConfig = {}) {\r\n super(container, options)\r\n }\r\n\r\n getLangText(name: string) {\r\n return I18N.parserText(name, this.lang)\r\n }\r\n}\r\n\r\nexport default FluentEditor\r\n"],"names":[],"mappings":";;;;;;;AAOA,MAAM,qBAAqB,MAAM;AAAA,EAc/B,YAAY,WAAiC,UAAyB,IAAI;AACxE,UAAM,WAAW,OAAO;AAd1B,wCAAwB;AAAA,EAcE;AAAA,EAV1B,OAAO,YAAY,MAAmB;AAC9B,UAAA,SAAS,GAAG,IAAyC;AAAA,EAAA;AAAA,EAG7D,IAAI,OAAO;AACH,UAAA,aAAa,KAAK,UAAU,MAAM;AACjC,WAAA,aAAa,WAAW,QAAQ,OAAO;AAAA,EAAA;AAAA,EAOhD,YAAY,MAAc;AACxB,WAAO,KAAK,WAAW,MAAM,KAAK,IAAI;AAAA,EAAA;AAE1C;"}
|
package/es/fluent-editor.es.js
CHANGED
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
import "./attributors/index.es.js";
|
|
2
|
+
import { EN_US } from "./config/i18n/en-us.es.js";
|
|
3
|
+
import { ZH_CN } from "./config/i18n/zh-cn.es.js";
|
|
2
4
|
import FluentEditor from "./core/fluent-editor.es.js";
|
|
3
|
-
import
|
|
4
|
-
import StrikeBlot from "./formats/strike.es.js";
|
|
5
|
-
import Video from "./formats/video.es.js";
|
|
5
|
+
import "./formats/index.es.js";
|
|
6
6
|
import Counter from "./modules/counter.es.js";
|
|
7
|
-
import CustomClipboard from "./modules/custom-clipboard.es.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import DividerBlot from "./modules/divider.es.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import I18N from "./modules/i18n.es.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import Mention from "./modules/mention/Mention.es.js";
|
|
7
|
+
import { CustomClipboard } from "./modules/custom-clipboard.es.js";
|
|
8
|
+
import "./modules/custom-image/index.es.js";
|
|
9
|
+
import { FileUploader } from "./modules/custom-uploader.es.js";
|
|
10
|
+
import { DividerBlot } from "./modules/divider.es.js";
|
|
11
|
+
import { EmojiModule } from "./modules/emoji.es.js";
|
|
12
|
+
import "./modules/file/index.es.js";
|
|
13
|
+
import { I18N } from "./modules/i18n.es.js";
|
|
14
|
+
import "./modules/link/index.es.js";
|
|
15
|
+
import "./modules/mathlive/index.es.js";
|
|
16
|
+
import "./modules/mention/index.es.js";
|
|
18
17
|
import { ShortCutKey } from "./modules/shortcut-key/index.es.js";
|
|
19
18
|
import CustomSyntax from "./modules/syntax.es.js";
|
|
20
|
-
import
|
|
19
|
+
import "./modules/toolbar/index.es.js";
|
|
21
20
|
import { Picker, ColorPicker } from "./modules/toolbar/better-picker.es.js";
|
|
22
21
|
import SnowTheme from "./themes/snow.es.js";
|
|
23
22
|
import Icons from "./ui/icons.es.js";
|
|
24
23
|
import { FontStyle } from "./attributors/font-style.es.js";
|
|
25
24
|
import { SizeStyle } from "./attributors/font-size.es.js";
|
|
26
25
|
import { LineHeightStyle } from "./attributors/line-height.es.js";
|
|
26
|
+
import { EmojiBlot } from "./formats/emoji.es.js";
|
|
27
|
+
import { SoftBreak } from "./formats/soft-break.es.js";
|
|
28
|
+
import { StrikeBlot } from "./formats/strike.es.js";
|
|
27
29
|
import { TextIndentStyle } from "./attributors/text-indent.es.js";
|
|
30
|
+
import { Video } from "./formats/video.es.js";
|
|
31
|
+
import { LinkBlot } from "./modules/link/formats/link.es.js";
|
|
32
|
+
import { FileModule } from "./modules/file/modules/file-module.es.js";
|
|
33
|
+
import { BlotFormatter } from "./modules/custom-image/blot-formatter.es.js";
|
|
34
|
+
import { MathliveModule } from "./modules/mathlive/module.es.js";
|
|
35
|
+
import { Mention } from "./modules/mention/mention.es.js";
|
|
36
|
+
import { BetterToolbar } from "./modules/toolbar/better-toolbar.es.js";
|
|
37
|
+
I18N.register(
|
|
38
|
+
{
|
|
39
|
+
"en-US": EN_US,
|
|
40
|
+
"zh-CN": ZH_CN
|
|
41
|
+
},
|
|
42
|
+
true
|
|
43
|
+
);
|
|
28
44
|
FluentEditor.register(
|
|
29
45
|
{
|
|
30
46
|
"attributors/style/font": FontStyle,
|
|
@@ -33,26 +49,24 @@ FluentEditor.register(
|
|
|
33
49
|
"formats/font": FontStyle,
|
|
34
50
|
"formats/line-height": LineHeightStyle,
|
|
35
51
|
"formats/size": SizeStyle,
|
|
36
|
-
"formats/emoji":
|
|
37
|
-
[`formats/${MathliveBlot.blotName}`]: MathliveBlot,
|
|
52
|
+
"formats/emoji": EmojiBlot,
|
|
38
53
|
"formats/softBreak": SoftBreak,
|
|
39
54
|
"formats/strike": StrikeBlot,
|
|
40
55
|
"formats/text-indent": TextIndentStyle,
|
|
41
56
|
"formats/video": Video,
|
|
57
|
+
"formats/divider": DividerBlot,
|
|
58
|
+
"formats/link": LinkBlot,
|
|
42
59
|
"modules/clipboard": CustomClipboard,
|
|
43
60
|
"modules/counter": Counter,
|
|
44
|
-
"modules/
|
|
45
|
-
"modules/emoji-shortname": Emoji.ShortNameEmoji,
|
|
46
|
-
"modules/emoji-toolbar": Emoji.ToolbarEmoji,
|
|
61
|
+
"modules/emoji": EmojiModule,
|
|
47
62
|
"modules/file": FileModule,
|
|
48
63
|
"modules/i18n": I18N,
|
|
49
64
|
"modules/image": BlotFormatter,
|
|
50
|
-
"modules/link": Link,
|
|
51
65
|
"modules/mathlive": MathliveModule,
|
|
52
66
|
"modules/mention": Mention,
|
|
53
67
|
"modules/syntax": CustomSyntax,
|
|
54
68
|
"modules/toolbar": BetterToolbar,
|
|
55
|
-
"modules/uploader":
|
|
69
|
+
"modules/uploader": FileUploader,
|
|
56
70
|
"modules/shortcut-key": ShortCutKey,
|
|
57
71
|
"themes/snow": SnowTheme,
|
|
58
72
|
"ui/icons": Icons,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluent-editor.es.js","sources":["../../src/fluent-editor.ts"],"sourcesContent":["import { FontStyle, LineHeightStyle, SizeStyle, TextIndentStyle } from './attributors'\r\nimport
|
|
1
|
+
{"version":3,"file":"fluent-editor.es.js","sources":["../../src/fluent-editor.ts"],"sourcesContent":["import { FontStyle, LineHeightStyle, SizeStyle, TextIndentStyle } from './attributors'\r\nimport { EN_US } from './config/i18n/en-us'\r\nimport { ZH_CN } from './config/i18n/zh-cn'\r\nimport FluentEditor from './core/fluent-editor'\r\nimport { EmojiBlot, SoftBreak, StrikeBlot, Video } from './formats'\r\nimport Counter from './modules/counter' // 字符统计\r\nimport { CustomClipboard } from './modules/custom-clipboard' // 粘贴板\r\nimport { BlotFormatter } from './modules/custom-image' // 图片\r\nimport { FileUploader } from './modules/custom-uploader' // 上传\r\nimport { DividerBlot } from './modules/divider' // 分割线\r\nimport { EmojiModule } from './modules/emoji'\r\nimport { FileModule } from './modules/file' // 文件\r\nimport I18N from './modules/i18n'\r\nimport { LinkBlot } from './modules/link' // 超链接\r\nimport { MathliveModule } from './modules/mathlive' // latex公式\r\nimport { Mention } from './modules/mention' // @提醒\r\nimport { ShortCutKey } from './modules/shortcut-key'\r\nimport Syntax from './modules/syntax' // 代码块高亮\r\nimport { BetterToolbar } from './modules/toolbar' // 工具栏\r\nimport { ColorPicker, Picker } from './modules/toolbar/better-picker'\r\nimport SnowTheme from './themes/snow'\r\nimport Icons from './ui/icons'\r\n\r\nI18N.register(\r\n {\r\n 'en-US': EN_US,\r\n 'zh-CN': ZH_CN,\r\n },\r\n true,\r\n)\r\nFluentEditor.register(\r\n {\r\n 'attributors/style/font': FontStyle,\r\n 'attributors/style/size': SizeStyle,\r\n 'attributors/style/line-height': LineHeightStyle,\r\n\r\n 'formats/font': FontStyle,\r\n 'formats/line-height': LineHeightStyle,\r\n 'formats/size': SizeStyle,\r\n 'formats/emoji': EmojiBlot,\r\n 'formats/softBreak': SoftBreak,\r\n 'formats/strike': StrikeBlot,\r\n 'formats/text-indent': TextIndentStyle,\r\n 'formats/video': Video,\r\n 'formats/divider': DividerBlot,\r\n 'formats/link': LinkBlot,\r\n\r\n 'modules/clipboard': CustomClipboard,\r\n 'modules/counter': Counter,\r\n 'modules/emoji': EmojiModule,\r\n 'modules/file': FileModule,\r\n 'modules/i18n': I18N,\r\n 'modules/image': BlotFormatter,\r\n 'modules/mathlive': MathliveModule,\r\n 'modules/mention': Mention,\r\n 'modules/syntax': Syntax,\r\n 'modules/toolbar': BetterToolbar,\r\n 'modules/uploader': FileUploader,\r\n 'modules/shortcut-key': ShortCutKey,\r\n\r\n 'themes/snow': SnowTheme,\r\n\r\n 'ui/icons': Icons,\r\n 'ui/picker': Picker,\r\n 'ui/color-picker': ColorPicker,\r\n },\r\n true, // 覆盖内部模块\r\n)\r\n\r\nexport default FluentEditor\r\n"],"names":["Syntax"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,KAAK;AAAA,EACH;AAAA,IACE,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AAAA,EACA;AACF;AACA,aAAa;AAAA,EACX;AAAA,IACE,0BAA0B;AAAA,IAC1B,0BAA0B;AAAA,IAC1B,iCAAiC;AAAA,IAEjC,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAEhB,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,mBAAmB;AAAA,IACnB,kBAAkBA;AAAAA,IAClB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IAExB,eAAe;AAAA,IAEf,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA;AACF;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import Quill from "quill";
|
|
5
|
+
const Inline = Quill.import("blots/inline");
|
|
6
|
+
class EmojiBlot extends Inline {
|
|
7
|
+
}
|
|
8
|
+
__publicField(EmojiBlot, "blotName", "emoji");
|
|
9
|
+
__publicField(EmojiBlot, "tagName", "span");
|
|
10
|
+
__publicField(EmojiBlot, "className", "ql-emoji-format");
|
|
11
|
+
export {
|
|
12
|
+
EmojiBlot
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=emoji.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emoji.es.js","sources":["../../../src/formats/emoji.ts"],"sourcesContent":["import type TypeInline from 'quill/blots/inline'\r\nimport Quill from 'quill'\r\n\r\nconst Inline = Quill.import('blots/inline') as typeof TypeInline\r\n\r\nexport class EmojiBlot extends Inline {\r\n static blotName = 'emoji'\r\n static tagName = 'span'\r\n static className = 'ql-emoji-format'\r\n}\r\n"],"names":[],"mappings":";;;;AAGA,MAAM,SAAS,MAAM,OAAO,cAAc;AAEnC,MAAM,kBAAkB,OAAO;AAItC;AAHE,cADW,WACJ,YAAW;AAClB,cAFW,WAEJ,WAAU;AACjB,cAHW,WAGJ,aAAY;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EmojiBlot } from "./emoji.es.js";
|
|
2
|
+
import { SoftBreak } from "./soft-break.es.js";
|
|
3
|
+
import { StrikeBlot } from "./strike.es.js";
|
|
4
|
+
import { Video } from "./video.es.js";
|
|
5
|
+
export {
|
|
6
|
+
EmojiBlot,
|
|
7
|
+
SoftBreak,
|
|
8
|
+
StrikeBlot,
|
|
9
|
+
Video
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|