@opentiny/fluent-editor 3.25.0 → 3.25.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 -5
- package/es/config/base64-image.es.js +0 -2
- package/es/config/base64-image.es.js.map +1 -1
- package/es/config/index.es.js +0 -49
- package/es/config/index.es.js.map +1 -1
- package/es/core/fluent-editor.es.js +22 -0
- package/es/core/fluent-editor.es.js.map +1 -0
- package/es/fluent-editor.es.js +58 -196
- package/es/fluent-editor.es.js.map +1 -1
- package/es/{soft-break/index.es.js → formats/soft-break.es.js} +1 -1
- package/es/formats/soft-break.es.js.map +1 -0
- package/es/{strike/index.es.js → formats/strike.es.js} +1 -1
- package/es/formats/strike.es.js.map +1 -0
- package/es/{video/index.es.js → formats/video.es.js} +1 -1
- package/es/formats/video.es.js.map +1 -0
- package/es/index.es.js +4 -4
- package/es/index.es.js.map +1 -1
- package/es/{counter/index.es.js → modules/counter.es.js} +1 -1
- package/es/modules/counter.es.js.map +1 -0
- package/es/{custom-clipboard.es.js → modules/custom-clipboard.es.js} +3 -3
- package/es/modules/custom-clipboard.es.js.map +1 -0
- package/es/{custom-image → modules/custom-image}/BlotFormatter.es.js +28 -0
- package/es/modules/custom-image/BlotFormatter.es.js.map +1 -0
- package/es/modules/custom-image/Options.es.js.map +1 -0
- package/es/modules/custom-image/actions/Action.es.js.map +1 -0
- package/es/modules/custom-image/actions/CustomResizeAction.es.js.map +1 -0
- package/es/modules/custom-image/actions/DeleteAction.es.js.map +1 -0
- package/es/modules/custom-image/image-bar.es.js +126 -0
- package/es/modules/custom-image/image-bar.es.js.map +1 -0
- package/es/{custom-image → modules/custom-image}/image.es.js +1 -1
- package/es/modules/custom-image/image.es.js.map +1 -0
- package/es/modules/custom-image/specs/BlotSpec.es.js.map +1 -0
- package/es/{custom-image → modules/custom-image}/specs/CustomImageSpec.es.js +1 -1
- package/es/modules/custom-image/specs/CustomImageSpec.es.js.map +1 -0
- package/es/modules/custom-image/specs/ImageSpec.es.js.map +1 -0
- package/es/{custom-uploader.es.js → modules/custom-uploader.es.js} +2 -2
- package/es/modules/custom-uploader.es.js.map +1 -0
- package/es/{divider/index.es.js → modules/divider.es.js} +1 -1
- package/es/modules/divider.es.js.map +1 -0
- package/es/modules/emoji/emoji-list/people.es.js.map +1 -0
- package/es/modules/emoji/emoji-list.es.js.map +1 -0
- package/es/modules/emoji/emoji-map.es.js.map +1 -0
- package/es/modules/emoji/emoji-sprite.es.js +5 -0
- package/es/modules/emoji/emoji-sprite.es.js.map +1 -0
- package/es/modules/emoji/formats/emoji-blot.es.js.map +1 -0
- package/es/modules/emoji/index.es.js.map +1 -0
- package/es/modules/emoji/modules/emoji.es.js.map +1 -0
- package/es/{emoji → modules/emoji}/modules/toolbar-emoji.es.js +1 -1
- package/{lib/emoji/modules/toolbar-emoji.cjs.js.map → es/modules/emoji/modules/toolbar-emoji.es.js.map} +1 -1
- package/es/modules/emoji/utils.es.js.map +1 -0
- package/es/{file → modules/file}/formats/file.es.js +1 -1
- package/es/modules/file/formats/file.es.js.map +1 -0
- package/es/modules/file/index.es.js.map +1 -0
- package/es/{file → modules/file}/modules/file-bar.es.js +1 -1
- package/es/modules/file/modules/file-bar.es.js.map +1 -0
- package/es/modules/global-link/constants.es.js.map +1 -0
- package/es/modules/global-link/formats/customer-widget-link.es.js.map +1 -0
- package/es/modules/global-link/formats/doc-link.es.js.map +1 -0
- package/es/modules/global-link/formats/wiki-link.es.js.map +1 -0
- package/es/modules/global-link/formats/work-item-link.es.js.map +1 -0
- package/es/{global-link → modules/global-link}/index.es.js +1 -1
- package/es/modules/global-link/index.es.js.map +1 -0
- package/es/modules/global-link/utils/createTable.es.js.map +1 -0
- package/es/{i18n/index.es.js → modules/i18n.es.js} +2 -2
- package/es/modules/i18n.es.js.map +1 -0
- package/es/{link → modules/link}/formats/link.es.js +1 -1
- package/es/modules/link/formats/link.es.js.map +1 -0
- package/es/modules/link/index.es.js.map +1 -0
- package/es/{link → modules/link}/modules/tooltip.es.js +4 -4
- package/es/modules/link/modules/tooltip.es.js.map +1 -0
- package/es/modules/mathlive/formats.es.js.map +1 -0
- package/es/modules/mathlive/index.es.js.map +1 -0
- package/es/modules/mathlive/tooltip.es.js.map +1 -0
- package/es/{mention → modules/mention}/Mention.es.js +1 -1
- package/es/modules/mention/Mention.es.js.map +1 -0
- package/es/modules/mention/MentionLink.es.js.map +1 -0
- package/es/modules/mention/constants.es.js.map +1 -0
- package/es/{quick-menu/index.es.js → modules/quick-menu.es.js} +1 -1
- package/es/modules/quick-menu.es.js.map +1 -0
- package/es/{syntax/index.es.js → modules/syntax.es.js} +1 -1
- package/es/modules/syntax.es.js.map +1 -0
- package/es/{table → modules/table}/better-table.es.js +1 -1
- package/es/modules/table/better-table.es.js.map +1 -0
- package/es/{table → modules/table}/formats/header.es.js +1 -1
- package/es/modules/table/formats/header.es.js.map +1 -0
- package/es/modules/table/formats/list.es.js.map +1 -0
- package/es/{table → modules/table}/formats/table.es.js +2 -2
- package/es/modules/table/formats/table.es.js.map +1 -0
- package/es/modules/table/modules/table-column-tool.es.js.map +1 -0
- package/es/{table → modules/table}/modules/table-operation-menu.es.js +2 -2
- package/es/modules/table/modules/table-operation-menu.es.js.map +1 -0
- package/es/modules/table/modules/table-scroll-bar.es.js.map +1 -0
- package/es/modules/table/modules/table-selection.es.js.map +1 -0
- package/es/modules/table/modules/table-selector.es.js.map +1 -0
- package/es/modules/table/table-config.es.js.map +1 -0
- package/es/modules/table/utils/index.es.js.map +1 -0
- package/es/{table → modules/table}/utils/node-matchers.es.js +1 -1
- package/es/modules/table/utils/node-matchers.es.js.map +1 -0
- package/es/{toolbar → modules/toolbar}/better-picker.es.js +1 -1
- package/es/modules/toolbar/better-picker.es.js.map +1 -0
- package/es/{toolbar → modules/toolbar}/index.es.js +1 -1
- package/es/modules/toolbar/index.es.js.map +1 -0
- package/es/{toolbar → modules/toolbar}/toolbar-tip.es.js +2 -2
- package/es/modules/toolbar/toolbar-tip.es.js.map +1 -0
- package/es/themes/snow.es.js +119 -0
- package/es/themes/snow.es.js.map +1 -0
- package/es/{format-painter/index.es.js → tools/format-painter.es.js} +1 -1
- package/es/tools/format-painter.es.js.map +1 -0
- package/es/{fullscreen/handler.es.js → tools/fullscreen.es.js} +3 -2
- package/es/tools/fullscreen.es.js.map +1 -0
- package/es/{screenshot/index.es.js → tools/screenshot.es.js} +1 -1
- package/es/tools/screenshot.es.js.map +1 -0
- package/es/ui/icons.config.es.js.map +1 -0
- package/es/ui/icons.es.js +58 -0
- package/es/ui/icons.es.js.map +1 -0
- package/lib/config/base64-image.cjs.js +0 -2
- package/lib/config/base64-image.cjs.js.map +1 -1
- package/lib/config/index.cjs.js +0 -49
- package/lib/config/index.cjs.js.map +1 -1
- package/lib/core/fluent-editor.cjs.js +22 -0
- package/lib/core/fluent-editor.cjs.js.map +1 -0
- package/lib/fluent-editor.cjs.js +58 -196
- package/lib/fluent-editor.cjs.js.map +1 -1
- package/lib/{soft-break/index.cjs.js → formats/soft-break.cjs.js} +1 -1
- package/lib/formats/soft-break.cjs.js.map +1 -0
- package/lib/{strike/index.cjs.js → formats/strike.cjs.js} +1 -1
- package/lib/formats/strike.cjs.js.map +1 -0
- package/lib/{video/index.cjs.js → formats/video.cjs.js} +1 -1
- package/lib/formats/video.cjs.js.map +1 -0
- package/lib/index.cjs.js +4 -4
- package/lib/{counter/index.cjs.js → modules/counter.cjs.js} +1 -1
- package/{es/counter/index.es.js.map → lib/modules/counter.cjs.js.map} +1 -1
- package/lib/{custom-clipboard.cjs.js → modules/custom-clipboard.cjs.js} +3 -3
- package/lib/modules/custom-clipboard.cjs.js.map +1 -0
- package/lib/{custom-image → modules/custom-image}/BlotFormatter.cjs.js +28 -0
- package/lib/modules/custom-image/BlotFormatter.cjs.js.map +1 -0
- package/lib/modules/custom-image/Options.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/Action.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/CustomResizeAction.cjs.js.map +1 -0
- package/lib/modules/custom-image/actions/DeleteAction.cjs.js.map +1 -0
- package/lib/modules/custom-image/image-bar.cjs.js +126 -0
- package/lib/modules/custom-image/image-bar.cjs.js.map +1 -0
- package/lib/{custom-image → modules/custom-image}/image.cjs.js +1 -1
- package/lib/modules/custom-image/image.cjs.js.map +1 -0
- package/lib/modules/custom-image/specs/BlotSpec.cjs.js.map +1 -0
- package/lib/{custom-image → modules/custom-image}/specs/CustomImageSpec.cjs.js +1 -1
- package/lib/modules/custom-image/specs/CustomImageSpec.cjs.js.map +1 -0
- package/lib/modules/custom-image/specs/ImageSpec.cjs.js.map +1 -0
- package/lib/{custom-uploader.cjs.js → modules/custom-uploader.cjs.js} +2 -2
- package/lib/modules/custom-uploader.cjs.js.map +1 -0
- package/lib/{divider/index.cjs.js → modules/divider.cjs.js} +1 -1
- package/lib/modules/divider.cjs.js.map +1 -0
- package/lib/modules/emoji/emoji-list/people.cjs.js.map +1 -0
- package/lib/modules/emoji/emoji-list.cjs.js.map +1 -0
- package/lib/modules/emoji/emoji-map.cjs.js.map +1 -0
- package/lib/modules/emoji/emoji-sprite.cjs.js +5 -0
- package/lib/modules/emoji/emoji-sprite.cjs.js.map +1 -0
- package/lib/modules/emoji/formats/emoji-blot.cjs.js.map +1 -0
- package/lib/modules/emoji/index.cjs.js.map +1 -0
- package/lib/modules/emoji/modules/emoji.cjs.js.map +1 -0
- package/lib/{emoji → modules/emoji}/modules/toolbar-emoji.cjs.js +2 -2
- package/lib/modules/emoji/modules/toolbar-emoji.cjs.js.map +1 -0
- package/lib/modules/emoji/utils.cjs.js.map +1 -0
- package/lib/{file → modules/file}/formats/file.cjs.js +1 -1
- package/lib/modules/file/formats/file.cjs.js.map +1 -0
- package/lib/modules/file/index.cjs.js.map +1 -0
- package/lib/{file → modules/file}/modules/file-bar.cjs.js +1 -1
- package/lib/modules/file/modules/file-bar.cjs.js.map +1 -0
- package/lib/modules/global-link/constants.cjs.js.map +1 -0
- package/lib/modules/global-link/formats/customer-widget-link.cjs.js.map +1 -0
- package/lib/modules/global-link/formats/doc-link.cjs.js.map +1 -0
- package/lib/modules/global-link/formats/wiki-link.cjs.js.map +1 -0
- package/lib/modules/global-link/formats/work-item-link.cjs.js.map +1 -0
- package/lib/{global-link → modules/global-link}/index.cjs.js +1 -1
- package/lib/modules/global-link/index.cjs.js.map +1 -0
- package/lib/modules/global-link/utils/createTable.cjs.js.map +1 -0
- package/lib/{i18n/index.cjs.js → modules/i18n.cjs.js} +3 -3
- package/lib/modules/i18n.cjs.js.map +1 -0
- package/lib/{link → modules/link}/formats/link.cjs.js +1 -1
- package/lib/modules/link/formats/link.cjs.js.map +1 -0
- package/lib/modules/link/index.cjs.js.map +1 -0
- package/lib/{link → modules/link}/modules/tooltip.cjs.js +4 -4
- package/lib/modules/link/modules/tooltip.cjs.js.map +1 -0
- package/lib/modules/mathlive/formats.cjs.js.map +1 -0
- package/lib/modules/mathlive/index.cjs.js.map +1 -0
- package/lib/modules/mathlive/tooltip.cjs.js.map +1 -0
- package/lib/{mention → modules/mention}/Mention.cjs.js +1 -1
- package/lib/modules/mention/Mention.cjs.js.map +1 -0
- package/lib/modules/mention/MentionLink.cjs.js.map +1 -0
- package/lib/modules/mention/constants.cjs.js.map +1 -0
- package/lib/{quick-menu/index.cjs.js → modules/quick-menu.cjs.js} +1 -1
- package/lib/modules/quick-menu.cjs.js.map +1 -0
- package/lib/{syntax/index.cjs.js → modules/syntax.cjs.js} +1 -1
- package/lib/modules/syntax.cjs.js.map +1 -0
- package/lib/{table → modules/table}/better-table.cjs.js +1 -1
- package/lib/modules/table/better-table.cjs.js.map +1 -0
- package/lib/{table → modules/table}/formats/header.cjs.js +1 -1
- package/lib/modules/table/formats/header.cjs.js.map +1 -0
- package/lib/modules/table/formats/list.cjs.js.map +1 -0
- package/lib/{table → modules/table}/formats/table.cjs.js +2 -2
- package/lib/modules/table/formats/table.cjs.js.map +1 -0
- package/lib/modules/table/modules/table-column-tool.cjs.js.map +1 -0
- package/lib/{table → modules/table}/modules/table-operation-menu.cjs.js +2 -2
- package/lib/modules/table/modules/table-operation-menu.cjs.js.map +1 -0
- package/lib/modules/table/modules/table-scroll-bar.cjs.js.map +1 -0
- package/lib/modules/table/modules/table-selection.cjs.js.map +1 -0
- package/lib/modules/table/modules/table-selector.cjs.js.map +1 -0
- package/lib/modules/table/table-config.cjs.js.map +1 -0
- package/lib/modules/table/utils/index.cjs.js.map +1 -0
- package/lib/{table → modules/table}/utils/node-matchers.cjs.js +1 -1
- package/lib/modules/table/utils/node-matchers.cjs.js.map +1 -0
- package/lib/{toolbar → modules/toolbar}/better-picker.cjs.js +1 -1
- package/lib/modules/toolbar/better-picker.cjs.js.map +1 -0
- package/lib/{toolbar → modules/toolbar}/index.cjs.js +1 -1
- package/lib/modules/toolbar/index.cjs.js.map +1 -0
- package/lib/{toolbar → modules/toolbar}/toolbar-tip.cjs.js +2 -2
- package/lib/modules/toolbar/toolbar-tip.cjs.js.map +1 -0
- package/lib/themes/snow.cjs.js +119 -0
- package/lib/themes/snow.cjs.js.map +1 -0
- package/lib/{format-painter/index.cjs.js → tools/format-painter.cjs.js} +1 -1
- package/lib/tools/format-painter.cjs.js.map +1 -0
- package/lib/{fullscreen/handler.cjs.js → tools/fullscreen.cjs.js} +4 -3
- package/lib/tools/fullscreen.cjs.js.map +1 -0
- package/lib/{screenshot/index.cjs.js → tools/screenshot.cjs.js} +1 -1
- package/lib/tools/screenshot.cjs.js.map +1 -0
- package/lib/ui/icons.cjs.js +58 -0
- package/lib/ui/icons.cjs.js.map +1 -0
- package/lib/ui/icons.config.cjs.js.map +1 -0
- package/package.json +2 -2
- package/style.css +193 -0
- package/types/config/base64-image.d.ts +0 -1
- package/types/config/index.d.ts +0 -3
- package/types/config/types/editor-config.interface.d.ts +1 -1
- package/types/config/types/editor-toolbar.interface.d.ts +1 -1
- package/types/core/fluent-editor.d.ts +12 -0
- package/types/fluent-editor.d.ts +2 -11
- package/types/index.d.ts +2 -2
- package/types/{counter/index.d.ts → modules/counter.d.ts} +1 -1
- package/types/{custom-clipboard.d.ts → modules/custom-clipboard.d.ts} +1 -1
- package/types/{custom-image → modules/custom-image}/BlotFormatter.d.ts +5 -0
- package/types/modules/custom-image/image-bar.d.ts +15 -0
- package/types/modules/emoji/emoji-sprite.d.ts +1 -0
- package/types/{i18n/index.d.ts → modules/i18n.d.ts} +5 -3
- package/types/{table → modules/table}/formats/list.d.ts +1 -1
- package/types/{toolbar → modules/toolbar}/toolbar-tip.d.ts +2 -2
- package/types/themes/snow.d.ts +4 -0
- package/types/ui/icons.d.ts +6 -0
- package/es/config/icons.config.es.js.map +0 -1
- package/es/custom-clipboard.es.js.map +0 -1
- package/es/custom-image/BlotFormatter.es.js.map +0 -1
- package/es/custom-image/Options.es.js.map +0 -1
- package/es/custom-image/actions/Action.es.js.map +0 -1
- package/es/custom-image/actions/CustomResizeAction.es.js.map +0 -1
- package/es/custom-image/actions/DeleteAction.es.js.map +0 -1
- package/es/custom-image/image.es.js.map +0 -1
- package/es/custom-image/specs/BlotSpec.es.js.map +0 -1
- package/es/custom-image/specs/CustomImageSpec.es.js.map +0 -1
- package/es/custom-image/specs/ImageSpec.es.js.map +0 -1
- package/es/custom-uploader.es.js.map +0 -1
- package/es/divider/index.es.js.map +0 -1
- package/es/emoji/emoji-list/people.es.js.map +0 -1
- package/es/emoji/emoji-list.es.js.map +0 -1
- package/es/emoji/emoji-map.es.js.map +0 -1
- package/es/emoji/formats/emoji-blot.es.js.map +0 -1
- package/es/emoji/index.es.js.map +0 -1
- package/es/emoji/modules/emoji.es.js.map +0 -1
- package/es/emoji/modules/toolbar-emoji.es.js.map +0 -1
- package/es/emoji/utils.es.js.map +0 -1
- package/es/file/formats/file.es.js.map +0 -1
- package/es/file/index.es.js.map +0 -1
- package/es/file/modules/file-bar.es.js.map +0 -1
- package/es/format-painter/index.es.js.map +0 -1
- package/es/fullscreen/handler.es.js.map +0 -1
- package/es/global-link/constants.es.js.map +0 -1
- package/es/global-link/formats/customer-widget-link.es.js.map +0 -1
- package/es/global-link/formats/doc-link.es.js.map +0 -1
- package/es/global-link/formats/wiki-link.es.js.map +0 -1
- package/es/global-link/formats/work-item-link.es.js.map +0 -1
- package/es/global-link/index.es.js.map +0 -1
- package/es/global-link/utils/createTable.es.js.map +0 -1
- package/es/i18n/index.es.js.map +0 -1
- package/es/link/formats/link.es.js.map +0 -1
- package/es/link/index.es.js.map +0 -1
- package/es/link/modules/tooltip.es.js.map +0 -1
- package/es/mathlive/formats.es.js.map +0 -1
- package/es/mathlive/index.es.js.map +0 -1
- package/es/mathlive/tooltip.es.js.map +0 -1
- package/es/mention/Mention.es.js.map +0 -1
- package/es/mention/MentionLink.es.js.map +0 -1
- package/es/mention/constants.es.js.map +0 -1
- package/es/quick-menu/index.es.js.map +0 -1
- package/es/screenshot/index.es.js.map +0 -1
- package/es/soft-break/index.es.js.map +0 -1
- package/es/strike/index.es.js.map +0 -1
- package/es/syntax/index.es.js.map +0 -1
- package/es/table/better-table.es.js.map +0 -1
- package/es/table/formats/header.es.js.map +0 -1
- package/es/table/formats/list.es.js.map +0 -1
- package/es/table/formats/table.es.js.map +0 -1
- package/es/table/modules/table-column-tool.es.js.map +0 -1
- package/es/table/modules/table-operation-menu.es.js.map +0 -1
- package/es/table/modules/table-scroll-bar.es.js.map +0 -1
- package/es/table/modules/table-selection.es.js.map +0 -1
- package/es/table/modules/table-selector.es.js.map +0 -1
- package/es/table/table-config.es.js.map +0 -1
- package/es/table/utils/index.es.js.map +0 -1
- package/es/table/utils/node-matchers.es.js.map +0 -1
- package/es/toolbar/better-picker.es.js.map +0 -1
- package/es/toolbar/index.es.js.map +0 -1
- package/es/toolbar/toolbar-tip.es.js.map +0 -1
- package/es/video/index.es.js.map +0 -1
- package/lib/config/icons.config.cjs.js.map +0 -1
- package/lib/counter/index.cjs.js.map +0 -1
- package/lib/custom-clipboard.cjs.js.map +0 -1
- package/lib/custom-image/BlotFormatter.cjs.js.map +0 -1
- package/lib/custom-image/Options.cjs.js.map +0 -1
- package/lib/custom-image/actions/Action.cjs.js.map +0 -1
- package/lib/custom-image/actions/CustomResizeAction.cjs.js.map +0 -1
- package/lib/custom-image/actions/DeleteAction.cjs.js.map +0 -1
- package/lib/custom-image/image.cjs.js.map +0 -1
- package/lib/custom-image/specs/BlotSpec.cjs.js.map +0 -1
- package/lib/custom-image/specs/CustomImageSpec.cjs.js.map +0 -1
- package/lib/custom-image/specs/ImageSpec.cjs.js.map +0 -1
- package/lib/custom-uploader.cjs.js.map +0 -1
- package/lib/divider/index.cjs.js.map +0 -1
- package/lib/emoji/emoji-list/people.cjs.js.map +0 -1
- package/lib/emoji/emoji-list.cjs.js.map +0 -1
- package/lib/emoji/emoji-map.cjs.js.map +0 -1
- package/lib/emoji/formats/emoji-blot.cjs.js.map +0 -1
- package/lib/emoji/index.cjs.js.map +0 -1
- package/lib/emoji/modules/emoji.cjs.js.map +0 -1
- package/lib/emoji/utils.cjs.js.map +0 -1
- package/lib/file/formats/file.cjs.js.map +0 -1
- package/lib/file/index.cjs.js.map +0 -1
- package/lib/file/modules/file-bar.cjs.js.map +0 -1
- package/lib/format-painter/index.cjs.js.map +0 -1
- package/lib/fullscreen/handler.cjs.js.map +0 -1
- package/lib/global-link/constants.cjs.js.map +0 -1
- package/lib/global-link/formats/customer-widget-link.cjs.js.map +0 -1
- package/lib/global-link/formats/doc-link.cjs.js.map +0 -1
- package/lib/global-link/formats/wiki-link.cjs.js.map +0 -1
- package/lib/global-link/formats/work-item-link.cjs.js.map +0 -1
- package/lib/global-link/index.cjs.js.map +0 -1
- package/lib/global-link/utils/createTable.cjs.js.map +0 -1
- package/lib/i18n/index.cjs.js.map +0 -1
- package/lib/link/formats/link.cjs.js.map +0 -1
- package/lib/link/index.cjs.js.map +0 -1
- package/lib/link/modules/tooltip.cjs.js.map +0 -1
- package/lib/mathlive/formats.cjs.js.map +0 -1
- package/lib/mathlive/index.cjs.js.map +0 -1
- package/lib/mathlive/tooltip.cjs.js.map +0 -1
- package/lib/mention/Mention.cjs.js.map +0 -1
- package/lib/mention/MentionLink.cjs.js.map +0 -1
- package/lib/mention/constants.cjs.js.map +0 -1
- package/lib/quick-menu/index.cjs.js.map +0 -1
- package/lib/screenshot/index.cjs.js.map +0 -1
- package/lib/soft-break/index.cjs.js.map +0 -1
- package/lib/strike/index.cjs.js.map +0 -1
- package/lib/syntax/index.cjs.js.map +0 -1
- package/lib/table/better-table.cjs.js.map +0 -1
- package/lib/table/formats/header.cjs.js.map +0 -1
- package/lib/table/formats/list.cjs.js.map +0 -1
- package/lib/table/formats/table.cjs.js.map +0 -1
- package/lib/table/modules/table-column-tool.cjs.js.map +0 -1
- package/lib/table/modules/table-operation-menu.cjs.js.map +0 -1
- package/lib/table/modules/table-scroll-bar.cjs.js.map +0 -1
- package/lib/table/modules/table-selection.cjs.js.map +0 -1
- package/lib/table/modules/table-selector.cjs.js.map +0 -1
- package/lib/table/table-config.cjs.js.map +0 -1
- package/lib/table/utils/index.cjs.js.map +0 -1
- package/lib/table/utils/node-matchers.cjs.js.map +0 -1
- package/lib/toolbar/better-picker.cjs.js.map +0 -1
- package/lib/toolbar/index.cjs.js.map +0 -1
- package/lib/toolbar/toolbar-tip.cjs.js.map +0 -1
- package/lib/video/index.cjs.js.map +0 -1
- /package/es/{custom-image → modules/custom-image}/Options.es.js +0 -0
- /package/es/{custom-image → modules/custom-image}/actions/Action.es.js +0 -0
- /package/es/{custom-image → modules/custom-image}/actions/CustomResizeAction.es.js +0 -0
- /package/es/{custom-image → modules/custom-image}/actions/DeleteAction.es.js +0 -0
- /package/es/{custom-image → modules/custom-image}/specs/BlotSpec.es.js +0 -0
- /package/es/{custom-image → modules/custom-image}/specs/ImageSpec.es.js +0 -0
- /package/es/{emoji → modules/emoji}/emoji-list/index.es.js +0 -0
- /package/es/{emoji → modules/emoji}/emoji-list/index.es.js.map +0 -0
- /package/es/{emoji → modules/emoji}/emoji-list/people.es.js +0 -0
- /package/es/{emoji → modules/emoji}/emoji-list.es.js +0 -0
- /package/es/{emoji → modules/emoji}/emoji-map.es.js +0 -0
- /package/es/{emoji → modules/emoji}/formats/emoji-blot.es.js +0 -0
- /package/es/{emoji → modules/emoji}/index.es.js +0 -0
- /package/es/{emoji → modules/emoji}/modules/emoji.es.js +0 -0
- /package/es/{emoji → modules/emoji}/utils.es.js +0 -0
- /package/es/{file → modules/file}/index.es.js +0 -0
- /package/es/{global-link → modules/global-link}/constants.es.js +0 -0
- /package/es/{global-link → modules/global-link}/formats/customer-widget-link.es.js +0 -0
- /package/es/{global-link → modules/global-link}/formats/doc-link.es.js +0 -0
- /package/es/{global-link → modules/global-link}/formats/wiki-link.es.js +0 -0
- /package/es/{global-link → modules/global-link}/formats/work-item-link.es.js +0 -0
- /package/es/{global-link → modules/global-link}/global-link-panel.es.js +0 -0
- /package/es/{global-link → modules/global-link}/global-link-panel.es.js.map +0 -0
- /package/es/{global-link → modules/global-link}/utils/createTable.es.js +0 -0
- /package/es/{link → modules/link}/index.es.js +0 -0
- /package/es/{mathlive → modules/mathlive}/formats.es.js +0 -0
- /package/es/{mathlive → modules/mathlive}/index.es.js +0 -0
- /package/es/{mathlive → modules/mathlive}/tooltip.es.js +0 -0
- /package/es/{mention → modules/mention}/MentionLink.es.js +0 -0
- /package/es/{mention → modules/mention}/constants.es.js +0 -0
- /package/es/{table → modules/table}/formats/list.es.js +0 -0
- /package/es/{table → modules/table}/modules/table-column-tool.es.js +0 -0
- /package/es/{table → modules/table}/modules/table-scroll-bar.es.js +0 -0
- /package/es/{table → modules/table}/modules/table-selection.es.js +0 -0
- /package/es/{table → modules/table}/modules/table-selector.es.js +0 -0
- /package/es/{table → modules/table}/table-config.es.js +0 -0
- /package/es/{table → modules/table}/utils/index.es.js +0 -0
- /package/es/{config → ui}/icons.config.es.js +0 -0
- /package/lib/{custom-image → modules/custom-image}/Options.cjs.js +0 -0
- /package/lib/{custom-image → modules/custom-image}/actions/Action.cjs.js +0 -0
- /package/lib/{custom-image → modules/custom-image}/actions/CustomResizeAction.cjs.js +0 -0
- /package/lib/{custom-image → modules/custom-image}/actions/DeleteAction.cjs.js +0 -0
- /package/lib/{custom-image → modules/custom-image}/specs/BlotSpec.cjs.js +0 -0
- /package/lib/{custom-image → modules/custom-image}/specs/ImageSpec.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/emoji-list/index.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/emoji-list/index.cjs.js.map +0 -0
- /package/lib/{emoji → modules/emoji}/emoji-list/people.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/emoji-list.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/emoji-map.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/formats/emoji-blot.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/index.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/modules/emoji.cjs.js +0 -0
- /package/lib/{emoji → modules/emoji}/utils.cjs.js +0 -0
- /package/lib/{file → modules/file}/index.cjs.js +0 -0
- /package/lib/{global-link → modules/global-link}/constants.cjs.js +0 -0
- /package/lib/{global-link → modules/global-link}/formats/customer-widget-link.cjs.js +0 -0
- /package/lib/{global-link → modules/global-link}/formats/doc-link.cjs.js +0 -0
- /package/lib/{global-link → modules/global-link}/formats/wiki-link.cjs.js +0 -0
- /package/lib/{global-link → modules/global-link}/formats/work-item-link.cjs.js +0 -0
- /package/lib/{global-link → modules/global-link}/global-link-panel.cjs.js +0 -0
- /package/lib/{global-link → modules/global-link}/global-link-panel.cjs.js.map +0 -0
- /package/lib/{global-link → modules/global-link}/utils/createTable.cjs.js +0 -0
- /package/lib/{link → modules/link}/index.cjs.js +0 -0
- /package/lib/{mathlive → modules/mathlive}/formats.cjs.js +0 -0
- /package/lib/{mathlive → modules/mathlive}/index.cjs.js +0 -0
- /package/lib/{mathlive → modules/mathlive}/tooltip.cjs.js +0 -0
- /package/lib/{mention → modules/mention}/MentionLink.cjs.js +0 -0
- /package/lib/{mention → modules/mention}/constants.cjs.js +0 -0
- /package/lib/{table → modules/table}/formats/list.cjs.js +0 -0
- /package/lib/{table → modules/table}/modules/table-column-tool.cjs.js +0 -0
- /package/lib/{table → modules/table}/modules/table-scroll-bar.cjs.js +0 -0
- /package/lib/{table → modules/table}/modules/table-selection.cjs.js +0 -0
- /package/lib/{table → modules/table}/modules/table-selector.cjs.js +0 -0
- /package/lib/{table → modules/table}/table-config.cjs.js +0 -0
- /package/lib/{table → modules/table}/utils/index.cjs.js +0 -0
- /package/lib/{config → ui}/icons.config.cjs.js +0 -0
- /package/types/{soft-break/index.d.ts → formats/soft-break.d.ts} +0 -0
- /package/types/{strike/index.d.ts → formats/strike.d.ts} +0 -0
- /package/types/{video/index.d.ts → formats/video.d.ts} +0 -0
- /package/types/{custom-image → modules/custom-image}/Options.d.ts +0 -0
- /package/types/{custom-image → modules/custom-image}/actions/Action.d.ts +0 -0
- /package/types/{custom-image → modules/custom-image}/actions/CustomResizeAction.d.ts +0 -0
- /package/types/{custom-image → modules/custom-image}/actions/DeleteAction.d.ts +0 -0
- /package/types/{custom-image → modules/custom-image}/image.d.ts +0 -0
- /package/types/{custom-image → modules/custom-image}/specs/BlotSpec.d.ts +0 -0
- /package/types/{custom-image → modules/custom-image}/specs/CustomImageSpec.d.ts +0 -0
- /package/types/{custom-image → modules/custom-image}/specs/ImageSpec.d.ts +0 -0
- /package/types/{custom-uploader.d.ts → modules/custom-uploader.d.ts} +0 -0
- /package/types/{divider/index.d.ts → modules/divider.d.ts} +0 -0
- /package/types/{emoji → modules/emoji}/emoji-list/index.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/emoji-list/people.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/emoji-list.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/emoji-map.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/formats/emoji-blot.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/index.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/modules/emoji.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/modules/toolbar-emoji.d.ts +0 -0
- /package/types/{emoji → modules/emoji}/utils.d.ts +0 -0
- /package/types/{file → modules/file}/formats/file.d.ts +0 -0
- /package/types/{file → modules/file}/index.d.ts +0 -0
- /package/types/{file → modules/file}/modules/file-bar.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/constants.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/formats/customer-widget-link.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/formats/doc-link.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/formats/wiki-link.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/formats/work-item-link.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/global-link-panel.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/index.d.ts +0 -0
- /package/types/{global-link → modules/global-link}/utils/createTable.d.ts +0 -0
- /package/types/{link → modules/link}/formats/link.d.ts +0 -0
- /package/types/{link → modules/link}/index.d.ts +0 -0
- /package/types/{link → modules/link}/modules/tooltip.d.ts +0 -0
- /package/types/{mathlive → modules/mathlive}/formats.d.ts +0 -0
- /package/types/{mathlive → modules/mathlive}/index.d.ts +0 -0
- /package/types/{mathlive → modules/mathlive}/tooltip.d.ts +0 -0
- /package/types/{mention → modules/mention}/Mention.d.ts +0 -0
- /package/types/{mention → modules/mention}/MentionLink.d.ts +0 -0
- /package/types/{mention → modules/mention}/constants.d.ts +0 -0
- /package/types/{quick-menu/index.d.ts → modules/quick-menu.d.ts} +0 -0
- /package/types/{syntax/index.d.ts → modules/syntax.d.ts} +0 -0
- /package/types/{table → modules/table}/better-table.d.ts +0 -0
- /package/types/{table → modules/table}/formats/header.d.ts +0 -0
- /package/types/{table → modules/table}/formats/table.d.ts +0 -0
- /package/types/{table → modules/table}/modules/table-column-tool.d.ts +0 -0
- /package/types/{table → modules/table}/modules/table-operation-menu.d.ts +0 -0
- /package/types/{table → modules/table}/modules/table-scroll-bar.d.ts +0 -0
- /package/types/{table → modules/table}/modules/table-selection.d.ts +0 -0
- /package/types/{table → modules/table}/modules/table-selector.d.ts +0 -0
- /package/types/{table → modules/table}/table-config.d.ts +0 -0
- /package/types/{table → modules/table}/utils/index.d.ts +0 -0
- /package/types/{table → modules/table}/utils/node-matchers.d.ts +0 -0
- /package/types/{toolbar → modules/toolbar}/better-picker.d.ts +0 -0
- /package/types/{toolbar → modules/toolbar}/index.d.ts +0 -0
- /package/types/{format-painter/index.d.ts → tools/format-painter.d.ts} +0 -0
- /package/types/{fullscreen/handler.d.ts → tools/fullscreen.d.ts} +0 -0
- /package/types/{screenshot/index.d.ts → tools/screenshot.d.ts} +0 -0
- /package/types/{config → ui}/icons.config.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"better-picker.cjs.js","sources":["../../../../src/modules/toolbar/better-picker.ts"],"sourcesContent":["import Quill from 'quill'\r\nimport { isNullOrUndefined } from '../../config/editor.utils'\r\n\r\nconst SnowTheme = Quill.imports['themes/snow']\r\n\r\nlet optionsCounter = 0\r\n\r\nfunction toggleAriaAttribute(element, attribute) {\r\n element.setAttribute(\r\n attribute,\r\n element.getAttribute(attribute) !== 'true',\r\n )\r\n}\r\n\r\nclass Picker {\r\n container: any\r\n label: any\r\n options: any\r\n select: any\r\n constructor(select) {\r\n this.select = select\r\n this.container = document.createElement('span')\r\n this.buildPicker()\r\n this.select.style.display = 'none'\r\n this.select.parentNode.insertBefore(this.container, this.select)\r\n\r\n this.label.addEventListener('mousedown', (e) => {\r\n this.togglePicker()\r\n e.preventDefault()\r\n })\r\n this.label.addEventListener('keydown', (event) => {\r\n switch (event.key) {\r\n case 'Enter':\r\n this.togglePicker()\r\n break\r\n case 'Escape':\r\n this.escape()\r\n event.preventDefault()\r\n break\r\n default:\r\n }\r\n })\r\n this.select.addEventListener('change', this.update.bind(this))\r\n }\r\n\r\n togglePicker() {\r\n this.container.classList.toggle('ql-expanded')\r\n // Toggle aria-expanded and aria-hidden to make the picker accessible\r\n toggleAriaAttribute(this.label, 'aria-expanded')\r\n toggleAriaAttribute(this.options, 'aria-hidden')\r\n }\r\n\r\n buildItem(option) {\r\n const item = document.createElement('span')\r\n item.tabIndex = 0\r\n item.setAttribute('role', 'button')\r\n item.classList.add('ql-picker-item')\r\n if (option.hasAttribute('value')) {\r\n item.setAttribute('data-value', option.getAttribute('value'))\r\n }\r\n if (option.textContent) {\r\n item.setAttribute('data-label', option.textContent)\r\n }\r\n item.addEventListener('click', () => {\r\n this.selectItem(item, true)\r\n })\r\n item.addEventListener('keydown', (event) => {\r\n switch (event.key) {\r\n case 'Enter':\r\n this.selectItem(item, true)\r\n event.preventDefault()\r\n break\r\n case 'Escape':\r\n this.escape()\r\n event.preventDefault()\r\n break\r\n default:\r\n }\r\n })\r\n\r\n return item\r\n }\r\n\r\n buildLabel() {\r\n const label = document.createElement('span')\r\n label.classList.add('ql-picker-label')\r\n label.innerHTML = `\r\n <svg viewbox=\"0 0 18 18\">\r\n <polygon class=\"ql-stroke\" points=\"7 11 9 13 11 11 7 11\"></polygon>\r\n <polygon class=\"ql-stroke\" points=\"7 7 9 5 11 7 7 7\"></polygon>\r\n </svg>\r\n `\r\n label.tabIndex = 0\r\n label.setAttribute('role', 'button')\r\n label.setAttribute('aria-expanded', 'false')\r\n this.container.appendChild(label)\r\n return label\r\n }\r\n\r\n buildOptions() {\r\n const options = document.createElement('span')\r\n options.classList.add('ql-picker-options')\r\n\r\n // Don't want screen readers to read this until options are visible\r\n options.setAttribute('aria-hidden', 'true')\r\n options.tabIndex = -1\r\n\r\n // Need a unique id for aria-controls\r\n options.id = `ql-picker-options-${optionsCounter}`\r\n optionsCounter += 1\r\n this.label.setAttribute('aria-controls', options.id)\r\n\r\n this.options = options\r\n\r\n Array.from(this.select.options).forEach((option: any) => {\r\n const item = this.buildItem(option)\r\n options.appendChild(item)\r\n if (option.selected === true) {\r\n this.selectItem(item)\r\n }\r\n })\r\n this.container.appendChild(options)\r\n }\r\n\r\n buildPicker() {\r\n Array.from(this.select.attributes).forEach((item: any) => {\r\n this.container.setAttribute(item.name, item.value)\r\n })\r\n this.container.classList.add('ql-picker')\r\n this.label = this.buildLabel()\r\n this.buildOptions()\r\n }\r\n\r\n escape() {\r\n // Close menu and return focus to trigger label\r\n this.close()\r\n // Need setTimeout for accessibility to ensure that the browser executes\r\n // focus on the next process thread and after any DOM content changes\r\n setTimeout(() => this.label.focus(), 1)\r\n }\r\n\r\n close() {\r\n this.container.classList.remove('ql-expanded')\r\n this.label.setAttribute('aria-expanded', 'false')\r\n this.options.setAttribute('aria-hidden', 'true')\r\n }\r\n\r\n selectItem(item, trigger = false) {\r\n const selected = this.container.querySelector('.ql-selected')\r\n if (item === selected) return\r\n if (!isNullOrUndefined(selected)) {\r\n selected.classList.remove('ql-selected')\r\n }\r\n if (isNullOrUndefined(item)) return\r\n item.classList.add('ql-selected')\r\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\r\n item,\r\n )\r\n if (item.hasAttribute('data-value')) {\r\n this.label.setAttribute('data-value', item.getAttribute('data-value'))\r\n }\r\n else {\r\n this.label.removeAttribute('data-value')\r\n }\r\n if (item.hasAttribute('data-label')) {\r\n this.label.setAttribute('data-label', item.getAttribute('data-label'))\r\n }\r\n else {\r\n this.label.removeAttribute('data-label')\r\n }\r\n if (trigger) {\r\n let ev\r\n if (typeof Event === 'function') {\r\n ev = new Event('change')\r\n }\r\n else {\r\n ev = document.createEvent('Event')\r\n ev.initEvent('change', true, true)\r\n }\r\n this.select.dispatchEvent(ev)\r\n this.close()\r\n }\r\n }\r\n\r\n update() {\r\n let option\r\n if (this.select.selectedIndex > -1) {\r\n const item = this.container.querySelector('.ql-picker-options').children[\r\n this.select.selectedIndex\r\n ]\r\n option = this.select.options[this.select.selectedIndex]\r\n this.selectItem(item)\r\n }\r\n else {\r\n this.selectItem(null)\r\n }\r\n const isActive\r\n = !isNullOrUndefined(option)\r\n && option !== this.select.querySelector('option[selected]')\r\n\r\n if (isActive) {\r\n this.label.classList.add('ql-active')\r\n }\r\n else {\r\n this.label.classList.remove('ql-active')\r\n }\r\n }\r\n}\r\n\r\nclass IconPicker extends Picker {\r\n defaultItem: any\r\n constructor(select, icons) {\r\n super(select)\r\n this.container.classList.add('ql-icon-picker')\r\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\r\n (item: any) => {\r\n item.innerHTML = icons[item.getAttribute('data-value') || '']\r\n },\r\n )\r\n this.defaultItem = this.container.querySelector('.ql-selected')\r\n this.selectItem(this.defaultItem, null)\r\n }\r\n\r\n selectItem(target, trigger) {\r\n super.selectItem(target, trigger)\r\n const item = target || this.defaultItem\r\n if (this.label.innerHTML === item.innerHTML) return\r\n this.label.innerHTML = item.innerHTML\r\n }\r\n}\r\n\r\nclass ColorPicker extends Picker {\r\n constructor(select, label) {\r\n super(select)\r\n this.label.innerHTML = label\r\n this.container.classList.add('ql-color-picker')\r\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\r\n .slice(0, 7)\r\n .forEach((item: any) => {\r\n item.classList.add('ql-primary')\r\n })\r\n }\r\n\r\n buildItem(option) {\r\n const item = super.buildItem(option)\r\n item.style.backgroundColor = option.getAttribute('value') || ''\r\n return item\r\n }\r\n\r\n selectItem(item, trigger) {\r\n super.selectItem(item, trigger)\r\n const colorLabel = this.label.querySelector('.ql-color-label')\r\n const value = item ? item.getAttribute('data-value') || '' : ''\r\n if (colorLabel) {\r\n if (colorLabel.tagName === 'line') {\r\n colorLabel.style.stroke = value\r\n }\r\n else {\r\n colorLabel.style.fill = value\r\n }\r\n }\r\n }\r\n}\r\n\r\nQuill.register('ui/picker', Picker, true)\r\nQuill.register('ui/icon-picker', IconPicker, true)\r\nQuill.register('ui/color-picker', ColorPicker, true)\r\n\r\nconst ALIGNS = [false, 'center', 'right']\r\n\r\nconst COLORS = [\r\n '#000000',\r\n '#e60000',\r\n '#ff9900',\r\n '#ffff00',\r\n '#008a00',\r\n '#0066cc',\r\n '#9933ff',\r\n '#ffffff',\r\n '#facccc',\r\n '#ffebcc',\r\n '#ffffcc',\r\n '#cce8cc',\r\n '#cce0f5',\r\n '#ebd6ff',\r\n '#bbbbbb',\r\n '#f06666',\r\n '#ffc266',\r\n '#ffff66',\r\n '#66b966',\r\n '#66a3e0',\r\n '#c285ff',\r\n '#888888',\r\n '#a10000',\r\n '#b26b00',\r\n '#b2b200',\r\n '#006100',\r\n '#0047b2',\r\n '#6b24b2',\r\n '#444444',\r\n '#5c0000',\r\n '#663d00',\r\n '#666600',\r\n '#003700',\r\n '#002966',\r\n '#3d1466',\r\n]\r\n\r\nconst FONTS = [false, 'serif', 'monospace']\r\n\r\nconst HEADERS = ['1', '2', '3', false]\r\n\r\nconst SIZES = ['small', false, 'large', 'huge']\r\n\r\nSnowTheme.prototype.buildPickers = function (selects, icons) {\r\n this.pickers = Array.from(selects).map((select: any) => {\r\n if (select.classList.contains('ql-align')) {\r\n if (isNullOrUndefined(select.querySelector('option'))) {\r\n fillSelect(select, ALIGNS)\r\n }\r\n return new IconPicker(select, icons.align)\r\n }\r\n if (\r\n select.classList.contains('ql-background')\r\n || select.classList.contains('ql-color')\r\n ) {\r\n const format = select.classList.contains('ql-background')\r\n ? 'background'\r\n : 'color'\r\n if (isNullOrUndefined(select.querySelector('option'))) {\r\n fillSelect(\r\n select,\r\n COLORS,\r\n )\r\n }\r\n return new ColorPicker(select, icons[format])\r\n }\r\n if (isNullOrUndefined(select.querySelector('option'))) {\r\n if (select.classList.contains('ql-font')) {\r\n fillSelect(select, FONTS)\r\n }\r\n else if (select.classList.contains('ql-header')) {\r\n fillSelect(select, HEADERS)\r\n }\r\n else if (select.classList.contains('ql-size')) {\r\n fillSelect(select, SIZES)\r\n }\r\n }\r\n return new Picker(select)\r\n })\r\n const update = () => {\r\n this.pickers.forEach((picker) => {\r\n picker.update()\r\n })\r\n }\r\n this.quill.on(Quill.events.EDITOR_CHANGE, update)\r\n}\r\n\r\nfunction fillSelect(select, values, defaultValue = false) {\r\n values.forEach((value) => {\r\n const option = document.createElement('option')\r\n if (value === defaultValue) {\r\n option.setAttribute('selected', 'selected')\r\n }\r\n else {\r\n option.setAttribute('value', value)\r\n }\r\n select.appendChild(option)\r\n })\r\n}\r\n"],"names":["isNullOrUndefined"],"mappings":";;;AAGA,MAAM,YAAY,MAAM,QAAQ,aAAa;AAE7C,IAAI,iBAAiB;AAErB,SAAS,oBAAoB,SAAS,WAAW;AACvC,UAAA;AAAA,IACN;AAAA,IACA,QAAQ,aAAa,SAAS,MAAM;AAAA,EACtC;AACF;AAEA,MAAM,OAAO;AAAA,EAKX,YAAY,QAAQ;AAClB,SAAK,SAAS;AACT,SAAA,YAAY,SAAS,cAAc,MAAM;AAC9C,SAAK,YAAY;AACZ,SAAA,OAAO,MAAM,UAAU;AAC5B,SAAK,OAAO,WAAW,aAAa,KAAK,WAAW,KAAK,MAAM;AAE/D,SAAK,MAAM,iBAAiB,aAAa,CAAC,MAAM;AAC9C,WAAK,aAAa;AAClB,QAAE,eAAe;AAAA,IAAA,CAClB;AACD,SAAK,MAAM,iBAAiB,WAAW,CAAC,UAAU;AAChD,cAAQ,MAAM,KAAK;AAAA,QACjB,KAAK;AACH,eAAK,aAAa;AAClB;AAAA,QACF,KAAK;AACH,eAAK,OAAO;AACZ,gBAAM,eAAe;AACrB;AAAA,QACF;AAAA,MAAA;AAAA,IACF,CACD;AACD,SAAK,OAAO,iBAAiB,UAAU,KAAK,OAAO,KAAK,IAAI,CAAC;AAAA,EAAA;AAAA,EAG/D,eAAe;AACR,SAAA,UAAU,UAAU,OAAO,aAAa;AAEzB,wBAAA,KAAK,OAAO,eAAe;AAC3B,wBAAA,KAAK,SAAS,aAAa;AAAA,EAAA;AAAA,EAGjD,UAAU,QAAQ;AACV,UAAA,OAAO,SAAS,cAAc,MAAM;AAC1C,SAAK,WAAW;AACX,SAAA,aAAa,QAAQ,QAAQ;AAC7B,SAAA,UAAU,IAAI,gBAAgB;AAC/B,QAAA,OAAO,aAAa,OAAO,GAAG;AAChC,WAAK,aAAa,cAAc,OAAO,a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;AAAA,IAAA,CACf;AAAA,EACH;AACA,OAAK,MAAM,GAAG,MAAM,OAAO,eAAe,MAAM;AAClD;AAEA,SAAS,WAAW,QAAQ,QAAQ,eAAe,OAAO;AACjD,SAAA,QAAQ,CAAC,UAAU;AAClB,UAAA,SAAS,SAAS,cAAc,QAAQ;AAC9C,QAAI,UAAU,cAAc;AACnB,aAAA,aAAa,YAAY,UAAU;AAAA,IAAA,OAEvC;AACI,aAAA,aAAa,SAAS,KAAK;AAAA,IAAA;AAEpC,WAAO,YAAY,MAAM;AAAA,EAAA,CAC1B;AACH;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const Quill = require("quill");
|
|
4
|
-
const editor_utils = require("
|
|
4
|
+
const editor_utils = require("../../config/editor.utils.cjs.js");
|
|
5
5
|
require("./better-picker.cjs.js");
|
|
6
6
|
const toolbarTip = require("./toolbar-tip.cjs.js");
|
|
7
7
|
const Delta = Quill.import("delta");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/modules/toolbar/index.ts"],"sourcesContent":["import type TypeToolbar from 'quill/modules/toolbar'\r\nimport Quill from 'quill'\r\nimport { isNullOrUndefined } from '../../config/editor.utils'\r\nimport './better-picker'\r\n\r\nconst Delta = Quill.import('delta')\r\nconst Parchment = Quill.import('parchment')\r\nconst levels = ['error', 'warn', 'log', 'info'] as const\r\nlet level = 'warn' as const\r\n\r\nfunction debuglogger(method: typeof levels[number], ...args) {\r\n if (levels.indexOf(method) <= levels.indexOf(level)) {\r\n console[method](...args) // eslint-disable-line no-console\r\n }\r\n}\r\n\r\nfunction namespace(ns) {\r\n return levels.reduce((logger, method) => {\r\n logger[method] = debuglogger.bind(console, method, ns)\r\n return logger\r\n }, {} as Record<typeof levels[number], (...args: any) => void>)\r\n}\r\n\r\nnamespace.level = (newLevel) => {\r\n level = newLevel\r\n}\r\ndebuglogger.level = namespace.level\r\nconst debug = namespace('quill:toolbar')\r\n\r\nconst Toolbar = Quill.import('modules/toolbar') as typeof TypeToolbar\r\n// let oldClean = Toolbar.DEFAULTS.handlers.clean\r\n\r\nclass BetterToolbar extends Toolbar {\r\n update(range) {\r\n const formats = isNullOrUndefined(range) ? {} : this.quill.getFormat(range) as Record<string, any>\r\n this.controls.forEach((pair) => {\r\n const [format, input] = pair\r\n if (input.tagName === 'SELECT') {\r\n const select = input as HTMLSelectElement\r\n let option\r\n if (isNullOrUndefined(range)) {\r\n option = null\r\n }\r\n else if (isNullOrUndefined(formats[format])) {\r\n option = select.querySelector('option[selected]')\r\n }\r\n else if (!Array.isArray(formats[format])) {\r\n let value = format === 'header' ? formats[format].value : formats[format]\r\n if (typeof value === 'string') {\r\n value = value.replace(/\"/g, '\\\\\"')\r\n }\r\n option = select.querySelector(`option[value=\"${value}\"]`)\r\n }\r\n if (isNullOrUndefined(option)) {\r\n select.value = '' // TODO make configurable?\r\n select.selectedIndex = -1\r\n }\r\n else {\r\n option.selected = true\r\n }\r\n }\r\n else if (isNullOrUndefined(range)) {\r\n input.classList.remove('ql-active')\r\n }\r\n else if (input.hasAttribute('value')) {\r\n // both being null should match (default values)\r\n // '1' should match with 1 (headers)\r\n let isActive\r\n = formats[format] === input.getAttribute('value')\r\n || (!isNullOrUndefined(formats[format])\r\n && (formats[format].value === input.getAttribute('value')\r\n || formats[format].toString() === input.getAttribute('value')))\r\n || (isNullOrUndefined(formats[format]) && !input.getAttribute('value'))\r\n\r\n if (!isActive) {\r\n const checkFormat = formats[format]\r\n if (checkFormat === 'checked' || checkFormat === 'unchecked') {\r\n isActive = input.getAttribute('value') === 'check'\r\n }\r\n }\r\n\r\n if (isActive) {\r\n input.classList.add('ql-active')\r\n }\r\n else {\r\n input.classList.remove('ql-active')\r\n }\r\n }\r\n else {\r\n if (!isNullOrUndefined(formats[format])) {\r\n input.classList.add('ql-active')\r\n }\r\n else {\r\n input.classList.remove('ql-active')\r\n }\r\n }\r\n })\r\n }\r\n\r\n attach(input: HTMLElement) {\r\n let format = Array.from(input.classList).find((className) => {\r\n return className.indexOf('ql-') === 0\r\n })\r\n if (!format) return\r\n format = format.slice('ql-'.length)\r\n\r\n if (input.tagName === 'BUTTON') {\r\n input.setAttribute('type', 'button')\r\n }\r\n\r\n if (this.handlers[format] == null && this.quill.scroll.query(format) == null) {\r\n debug.warn('ignoring attaching to nonexistent format', format, input)\r\n return\r\n }\r\n\r\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click'\r\n input.addEventListener(eventName, (e) => {\r\n let value: boolean | string\r\n\r\n if (input.tagName === 'SELECT') {\r\n const select = input as HTMLSelectElement\r\n if (select.selectedIndex < 0) return\r\n const selected = select.options[select.selectedIndex]\r\n\r\n if (selected.hasAttribute('selected')) {\r\n value = false\r\n }\r\n else {\r\n value = selected.value || false\r\n }\r\n }\r\n else {\r\n const button = input as HTMLButtonElement\r\n if (button.classList.contains('ql-active')) {\r\n value = false\r\n }\r\n else {\r\n value = button.value || !button.hasAttribute('value')\r\n }\r\n e.preventDefault()\r\n }\r\n\r\n this.quill.focus({ preventScroll: format === 'screenshot' })\r\n const [range] = this.quill.selection.getRange()\r\n if (this.handlers[format] != null) {\r\n // @ts-ignore\r\n if (!isNullOrUndefined(window.quillIsIntable) && window.quillIsIntable === true && (format === 'blockquote' || format === 'code-block' || format === 'list' || format === 'indent' || format === 'clean')) {\r\n return\r\n }\r\n this.handlers[format].call(this, value)\r\n }\r\n else if (\r\n // @ts-ignore\r\n this.quill.scroll.query(format).prototype instanceof Parchment.EmbedBlot\r\n ) {\r\n value = prompt(`Enter ${format}`)\r\n if (!value) return\r\n this.quill.updateContents(\r\n new Delta()\r\n .retain(range.index)\r\n .delete(range.length)\r\n .insert({ [format]: value }),\r\n Quill.sources.USER,\r\n )\r\n }\r\n else {\r\n // @ts-ignore\r\n if (!isNullOrUndefined(window.quillIsIntable) && window.quillIsIntable === true && (format === 'blockquote' || format === 'code-block' || format === 'list' || format === 'indent' || format === 'clean')) {\r\n return\r\n }\r\n this.quill.format(format, value, Quill.sources.USER)\r\n }\r\n\r\n this.update(range)\r\n })\r\n this.controls.push([format, input])\r\n }\r\n}\r\n\r\nexport default BetterToolbar\r\nexport * from './toolbar-tip'\r\n"],"names":["isNullOrUndefined"],"mappings":";;;;;;AAKA,MAAM,QAAQ,MAAM,OAAO,OAAO;AAClC,MAAM,YAAY,MAAM,OAAO,WAAW;AAC1C,MAAM,SAAS,CAAC,SAAS,QAAQ,OAAO,MAAM;AAC9C,IAAI,QAAQ;AAEZ,SAAS,YAAY,WAAkC,MAAM;AAC3D,MAAI,OAAO,QAAQ,MAAM,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC3C,YAAA,MAAM,EAAE,GAAG,IAAI;AAAA,EAAA;AAE3B;AAEA,SAAS,UAAU,IAAI;AACrB,SAAO,OAAO,OAAO,CAAC,QAAQ,WAAW;AACvC,WAAO,MAAM,IAAI,YAAY,KAAK,SAAS,QAAQ,EAAE;AAC9C,WAAA;AAAA,EACT,GAAG,EAA2D;AAChE;AAEA,UAAU,QAAQ,CAAC,aAAa;AACtB,UAAA;AACV;AACA,YAAY,QAAQ,UAAU;AAC9B,MAAM,QAAQ,UAAU,eAAe;AAEvC,MAAM,UAAU,MAAM,OAAO,iBAAiB;AAG9C,MAAM,sBAAsB,QAAQ;AAAA,EAClC,OAAO,OAAO;AACN,UAAA,UAAUA,+BAAkB,KAAK,IAAI,CAAK,IAAA,KAAK,MAAM,UAAU,KAAK;AACrE,SAAA,SAAS,QAAQ,CAAC,SAAS;AACxB,YAAA,CAAC,QAAQ,KAAK,IAAI;AACpB,UAAA,MAAM,YAAY,UAAU;AAC9B,cAAM,SAAS;AACX,YAAA;AACA,YAAAA,aAAAA,kBAAkB,KAAK,GAAG;AACnB,mBAAA;AAAA,QAEF,WAAAA,aAAA,kBAAkB,QAAQ,MAAM,CAAC,GAAG;AAClC,mBA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AAO,mBAAmB,SAAS,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,UAAU,WAAW,YAAY,WAAW,UAAU;AACzM;AAAA,QAAA;AAEF,aAAK,SAAS,MAAM,EAAE,KAAK,MAAM,KAAK;AAAA,MAAA;AAAA;AAAA,QAItC,KAAK,MAAM,OAAO,MAAM,MAAM,EAAE,qBAAqB,UAAU;AAAA,QAC/D;AACQ,gBAAA,OAAO,SAAS,MAAM,EAAE;AAChC,YAAI,CAAC,MAAO;AACZ,aAAK,MAAM;AAAA,UACT,IAAI,MAAM,EACP,OAAO,MAAM,KAAK,EAClB,OAAO,MAAM,MAAM,EACnB,OAAO,EAAE,CAAC,MAAM,GAAG,OAAO;AAAA,UAC7B,MAAM,QAAQ;AAAA,QAChB;AAAA,MAAA,OAEG;AAEH,YAAI,CAACA,aAAkB,kBAAA,OAAO,cAAc,KAAK,OAAO,mBAAmB,SAAS,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,UAAU,WAAW,YAAY,WAAW,UAAU;AACzM;AAAA,QAAA;AAEF,aAAK,MAAM,OAAO,QAAQ,OAAO,MAAM,QAAQ,IAAI;AAAA,MAAA;AAGrD,WAAK,OAAO,KAAK;AAAA,IAAA,CAClB;AACD,SAAK,SAAS,KAAK,CAAC,QAAQ,KAAK,CAAC;AAAA,EAAA;AAEtC;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
require("
|
|
4
|
-
const editor_config = require("
|
|
3
|
+
require("../../config/index.cjs.js");
|
|
4
|
+
const editor_config = require("../../config/editor.config.cjs.js");
|
|
5
5
|
function generateToolbarTip(QuillToolbarTip) {
|
|
6
6
|
return class extends QuillToolbarTip {
|
|
7
7
|
constructor(quill, options) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-tip.cjs.js","sources":["../../../../src/modules/toolbar/toolbar-tip.ts"],"sourcesContent":["import type { Constructor } from '../../config/types'\r\nimport type FluentEditor from '../../fluent-editor'\r\nimport { CHANGE_LANGUAGE_EVENT } from '../../config'\r\n\r\nexport function generateToolbarTip(QuillToolbarTip: Constructor) {\r\n return class extends QuillToolbarTip {\r\n constructor(public quill: FluentEditor, options: Partial<Record<string, any>>) {\r\n if (!options?.tipTextMap) {\r\n options.tipTextMap = {}\r\n }\r\n super(quill, options)\r\n\r\n this.quill.emitter.on(CHANGE_LANGUAGE_EVENT, () => {\r\n this.destroyAllTips()\r\n this.options = this.resolveOptions(options)\r\n this.createToolbarTip()\r\n })\r\n }\r\n\r\n resolveOptions(options: Partial<Record<string, any>>): Record<string, any> {\r\n const result = super.resolveOptions(options)\r\n if (!this.quill.lang) return result\r\n const btnTips = [\r\n 'bold',\r\n 'italic',\r\n 'strike',\r\n 'underline',\r\n 'undo',\r\n 'redo',\r\n 'clean',\r\n 'link',\r\n 'divider',\r\n 'blockquote',\r\n 'code',\r\n 'image',\r\n 'file',\r\n 'emoji',\r\n 'video',\r\n 'screenshot',\r\n 'better-table',\r\n 'code-block',\r\n 'formula',\r\n 'format-painter',\r\n 'header-list',\r\n ].reduce((map, name) => {\r\n map[name] = this.quill.getLangText(name)\r\n return map\r\n }, {} as Record<string, string>)\r\n const selectTips = [\r\n 'color',\r\n 'background',\r\n 'font',\r\n 'size',\r\n 'lineheight',\r\n ].reduce((map, name) => {\r\n map[name] = {\r\n onShow: () => {\r\n return this.quill.getLangText(name)\r\n },\r\n }\r\n return map\r\n }, {})\r\n const valueControlTips = [\r\n 'list',\r\n 'align',\r\n 'script',\r\n 'indent',\r\n 'header',\r\n 'direction',\r\n ].reduce((map, name) => {\r\n map[name] = {\r\n onShow: (target: HTMLElement, value: string) => {\r\n if (name === 'direction') {\r\n value = target.classList.contains('ql-active') ? 'rtl' : 'ltr'\r\n }\r\n if (!value) {\r\n if (name === 'align') {\r\n value = 'left'\r\n }\r\n else if (name === 'header') {\r\n value = 'normal'\r\n }\r\n }\r\n return this.quill.getLangText(`${name}-${value}`)\r\n },\r\n }\r\n return map\r\n }, {})\r\n const textMap = {\r\n ...btnTips,\r\n ...valueControlTips,\r\n ...selectTips,\r\n fullscreen: {\r\n onShow: () => {\r\n return this.quill.getLangText(this.quill.isFullscreen ? 'exit-fullscreen' : 'fullscreen')\r\n },\r\n },\r\n }\r\n return {\r\n ...result,\r\n tipTextMap: {\r\n ...textMap,\r\n ...options.tipTextMap,\r\n },\r\n }\r\n }\r\n }\r\n}\r\n"],"names":["CHANGE_LANGUAGE_EVENT"],"mappings":";;;;AAIO,SAAS,mBAAmB,iBAA8B;AAC/D,SAAO,cAAc,gBAAgB;AAAA,IACnC,YAAmB,OAAqB,SAAuC;AACzE,UAAA,EAAC,mCAAS,aAAY;AACxB,gBAAQ,aAAa,CAAC;AAAA,MAAA;AAExB,YAAM,OAAO,OAAO;AAJH,WAAA,QAAA;AAMjB,WAAK,MAAM,QAAQ,GAAGA,cAAA,uBAAuB,MAAM;AACjD,aAAK,eAAe;AACf,aAAA,UAAU,KAAK,eAAe,OAAO;AAC1C,aAAK,iBAAiB;AAAA,MAAA,CACvB;AAAA,IAAA;AAAA,IAGH,eAAe,SAA4D;AACnE,YAAA,SAAS,MAAM,eAAe,OAAO;AAC3C,UAAI,CAAC,KAAK,MAAM,KAAa,QAAA;AAC7B,YAAM,UAAU;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA,EACA,OAAO,CAAC,KAAK,SAAS;AACtB,YAAI,IAAI,IAAI,KAAK,MAAM,YAAY,IAAI;AAChC,eAAA;AAAA,MACT,GAAG,EAA4B;AAC/B,YAAM,aAAa;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA,EACA,OAAO,CAAC,KAAK,SAAS;AACtB,YAAI,IAAI,IAAI;AAAA,UACV,QAAQ,MAAM;AACL,mBAAA,KAAK,MAAM,YAAY,IAAI;AAAA,UAAA;AAAA,QAEtC;AACO,eAAA;AAAA,MACT,GAAG,EAAE;AACL,YAAM,mBAAmB;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA,EACA,OAAO,CAAC,KAAK,SAAS;AACtB,YAAI,IAAI,IAAI;AAAA,UACV,QAAQ,CAAC,QAAqB,UAAkB;AAC9C,gBAAI,SAAS,aAAa;AACxB,sBAAQ,OAAO,UAAU,SAAS,WAAW,IAAI,QAAQ;AAAA,YAAA;AAE3D,gBAAI,CAAC,OAAO;AACV,kBAAI,SAAS,SAAS;AACZ,wBAAA;AAAA,cAAA,WAED,SAAS,UAAU;AAClB,wBAAA;AAAA,cAAA;AAAA,YACV;AAEF,mBAAO,KAAK,MAAM,YAAY,GAAG,IAAI,IAAI,KAAK,EAAE;AAAA,UAAA;AAAA,QAEpD;AACO,eAAA;AAAA,MACT,GAAG,EAAE;AACL,YAAM,UAAU;AAAA,QACd,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,YAAY;AAAA,UACV,QAAQ,MAAM;AACZ,mBAAO,KAAK,MAAM,YAAY,KAAK,MAAM,eAAe,oBAAoB,YAAY;AAAA,UAAA;AAAA,QAC1F;AAAA,MAEJ;AACO,aAAA;AAAA,QACL,GAAG;AAAA,QACH,YAAY;AAAA,UACV,GAAG;AAAA,UACH,GAAG,QAAQ;AAAA,QAAA;AAAA,MAEf;AAAA,IAAA;AAAA,EAEJ;AACF;;"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const index = require("../config/index.cjs.js");
|
|
4
|
+
const fluentEditor = require("../core/fluent-editor.cjs.js");
|
|
5
|
+
const CustomImageSpec = require("../modules/custom-image/specs/CustomImageSpec.cjs.js");
|
|
6
|
+
const betterTable = require("../modules/table/better-table.cjs.js");
|
|
7
|
+
const formatPainter = require("../tools/format-painter.cjs.js");
|
|
8
|
+
const fullscreen = require("../tools/fullscreen.cjs.js");
|
|
9
|
+
const screenshot = require("../tools/screenshot.cjs.js");
|
|
10
|
+
const SnowTheme = fluentEditor.default.imports["themes/snow"];
|
|
11
|
+
SnowTheme.DEFAULTS = {
|
|
12
|
+
modules: {
|
|
13
|
+
"i18n": true,
|
|
14
|
+
"keyboard": {
|
|
15
|
+
bindings: {
|
|
16
|
+
...betterTable.default.keyboardBindings
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"toolbar": {
|
|
20
|
+
handlers: {
|
|
21
|
+
...SnowTheme.DEFAULTS.modules.toolbar.handlers,
|
|
22
|
+
"formula": function() {
|
|
23
|
+
if (!this.quill.isEnabled()) return;
|
|
24
|
+
const mathlive = this.quill.getModule("mathlive");
|
|
25
|
+
if (!mathlive) {
|
|
26
|
+
this.quill.theme.tooltip.edit("formula");
|
|
27
|
+
} else {
|
|
28
|
+
mathlive.createDialog();
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"undo": function() {
|
|
32
|
+
this.quill.history.undo();
|
|
33
|
+
},
|
|
34
|
+
"redo": function() {
|
|
35
|
+
this.quill.history.redo();
|
|
36
|
+
},
|
|
37
|
+
"better-table": function() {
|
|
38
|
+
this.quill.getModule("better-table").insertTable(3, 3);
|
|
39
|
+
},
|
|
40
|
+
"file": function() {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const accept = (_b = (_a = this.quill.options) == null ? void 0 : _a.uploadOption) == null ? void 0 : _b.fileAccept;
|
|
43
|
+
index.inputFile.call(this, "file", accept);
|
|
44
|
+
},
|
|
45
|
+
"image": function() {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
const accept = (_b = (_a = this.quill.options) == null ? void 0 : _a.uploadOption) == null ? void 0 : _b.imageAccept;
|
|
48
|
+
index.inputFile.call(this, "image", accept);
|
|
49
|
+
},
|
|
50
|
+
"emoji": function() {
|
|
51
|
+
},
|
|
52
|
+
"fullscreen": fullscreen.fullscreenHandler,
|
|
53
|
+
"list": function(value) {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const range = this.quill.getSelection();
|
|
56
|
+
const formats = this.quill.getFormat(range);
|
|
57
|
+
const preListValue = Array.isArray(formats.list) ? (_a = formats.list[0]) == null ? void 0 : _a.value : (_b = formats.list) == null ? void 0 : _b.value;
|
|
58
|
+
const curListValue = index.getListValue(value, preListValue);
|
|
59
|
+
const lines = this.quill.getLines(range.index, range.length);
|
|
60
|
+
const tableCols = lines.filter((line) => line.statics.blotName === "table-col" && !line.prev);
|
|
61
|
+
if (tableCols.length) {
|
|
62
|
+
let start = range.index;
|
|
63
|
+
tableCols.forEach((item, index2) => {
|
|
64
|
+
const table = item.domNode.closest("table.quill-better-table");
|
|
65
|
+
const tableBlot = fluentEditor.default.find(table);
|
|
66
|
+
const tableLength = tableBlot.length();
|
|
67
|
+
const tableStart = this.quill.getIndex(item);
|
|
68
|
+
const tableEnd = tableStart + tableLength;
|
|
69
|
+
const beforeTableRangeLength = tableStart - start;
|
|
70
|
+
this.quill.setSelection(start, beforeTableRangeLength, fluentEditor.default.sources.SILENT);
|
|
71
|
+
this.quill.format("list", curListValue, fluentEditor.default.sources.USER);
|
|
72
|
+
table.parentNode.classList.remove("quill-better-table-selected");
|
|
73
|
+
start = tableEnd;
|
|
74
|
+
if (index2 === tableCols.length - 1) {
|
|
75
|
+
this.quill.setSelection(tableEnd, range.index + range.length - tableEnd);
|
|
76
|
+
this.quill.format("list", curListValue, fluentEditor.default.sources.USER);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
} else {
|
|
80
|
+
this.quill.format("list", curListValue, fluentEditor.default.sources.USER);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
[formatPainter.FormatPainter.toolName]: formatPainter.FormatPainter,
|
|
84
|
+
[screenshot.Screenshot.toolName]: screenshot.Screenshot,
|
|
85
|
+
"lineheight": function(value) {
|
|
86
|
+
this.quill.format("line-height", value);
|
|
87
|
+
},
|
|
88
|
+
"divider": function() {
|
|
89
|
+
const range = this.quill.getSelection(true);
|
|
90
|
+
this.quill.insertText(range.index, "\n", fluentEditor.default.sources.USER);
|
|
91
|
+
this.quill.insertEmbed(range.index + 1, "divider", true, fluentEditor.default.sources.USER);
|
|
92
|
+
this.quill.setSelection(range.index + 2, fluentEditor.default.sources.SILENT);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"better-table": {
|
|
97
|
+
operationMenu: {
|
|
98
|
+
color: true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"image": {
|
|
102
|
+
specs: [CustomImageSpec.CustomImageSpec],
|
|
103
|
+
overlay: {
|
|
104
|
+
style: {
|
|
105
|
+
border: "1px dashed rgb(68, 68, 68)"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
align: {
|
|
109
|
+
icons: {
|
|
110
|
+
left: '<i class="icon-text-align-left"></i>',
|
|
111
|
+
center: '<i class="icon-text-align-center"></i>',
|
|
112
|
+
right: '<i class="icon-text-align-right"></i>'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
exports.default = SnowTheme;
|
|
119
|
+
//# sourceMappingURL=snow.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snow.cjs.js","sources":["../../../src/themes/snow.ts"],"sourcesContent":["import type { Module, TypeParchment } from '../core/fluent-editor'\r\nimport { getListValue, inputFile } from '../config'\r\nimport FluentEditor from '../core/fluent-editor'\r\nimport { CustomImageSpec } from '../modules/custom-image/specs/CustomImageSpec'\r\nimport BetterTable from '../modules/table/better-table'\r\nimport { FormatPainter } from '../tools/format-painter'\r\nimport { fullscreenHandler } from '../tools/fullscreen'\r\nimport { Screenshot } from '../tools/screenshot'\r\n\r\nconst SnowTheme = FluentEditor.imports['themes/snow'] as typeof Module\r\n\r\nSnowTheme.DEFAULTS = {\r\n modules: {\r\n 'i18n': true,\r\n 'keyboard': {\r\n bindings: {\r\n ...BetterTable.keyboardBindings,\r\n },\r\n },\r\n 'toolbar': {\r\n handlers: {\r\n ...(SnowTheme.DEFAULTS as Record<string, any>).modules.toolbar.handlers,\r\n 'formula': function () {\r\n if (!this.quill.isEnabled()) return\r\n const mathlive = this.quill.getModule('mathlive')\r\n if (!mathlive) {\r\n this.quill.theme.tooltip.edit('formula')\r\n }\r\n else {\r\n mathlive.createDialog()\r\n }\r\n },\r\n 'undo': function () {\r\n this.quill.history.undo()\r\n },\r\n 'redo': function () {\r\n this.quill.history.redo()\r\n },\r\n 'better-table': function () {\r\n this.quill.getModule('better-table').insertTable(3, 3)\r\n },\r\n 'file': function () {\r\n const accept = this.quill.options?.uploadOption?.fileAccept\r\n inputFile.call(this, 'file', accept)\r\n },\r\n 'image': function () {\r\n const accept = this.quill.options?.uploadOption?.imageAccept\r\n inputFile.call(this, 'image', accept)\r\n },\r\n 'emoji': function () {},\r\n 'fullscreen': fullscreenHandler,\r\n 'list': function (value) {\r\n const range = this.quill.getSelection()\r\n const formats = this.quill.getFormat(range)\r\n const preListValue = Array.isArray(formats.list) ? formats.list[0]?.value : formats.list?.value\r\n const curListValue = getListValue(value, preListValue)\r\n // 如果设置list的选区中有表格,判断第一个table-col位置,将表格前的内容设置为list格式\r\n const lines = this.quill.getLines(range.index, range.length)\r\n const tableCols = lines.filter(line => line.statics.blotName === 'table-col' && !line.prev)\r\n if (tableCols.length) {\r\n let start = range.index\r\n // 遍历table-col群组,以之获取表格,将表格前选区设置为对应list格式\r\n tableCols.forEach((item, index) => {\r\n const table = item.domNode.closest('table.quill-better-table')\r\n const tableBlot = FluentEditor.find(table) as TypeParchment.Blot\r\n const tableLength = tableBlot.length()\r\n const tableStart = this.quill.getIndex(item)\r\n const tableEnd = tableStart + tableLength\r\n const beforeTableRangeLength = tableStart - start\r\n // 在表格前设置列表\r\n this.quill.setSelection(start, beforeTableRangeLength, FluentEditor.sources.SILENT)\r\n this.quill.format('list', curListValue, FluentEditor.sources.USER)\r\n table.parentNode.classList.remove('quill-better-table-selected')\r\n // 当前表格末尾为下一个选取的开始\r\n start = tableEnd\r\n if (index === tableCols.length - 1) {\r\n // 将最后一个表格之后所有选区内容设置list格式\r\n this.quill.setSelection(tableEnd, range.index + range.length - tableEnd)\r\n this.quill.format('list', curListValue, FluentEditor.sources.USER)\r\n }\r\n })\r\n }\r\n else {\r\n this.quill.format('list', curListValue, FluentEditor.sources.USER)\r\n }\r\n },\r\n [FormatPainter.toolName]: FormatPainter,\r\n [Screenshot.toolName]: Screenshot,\r\n 'lineheight': function (value) {\r\n this.quill.format('line-height', value)\r\n },\r\n 'divider': function () {\r\n const range = this.quill.getSelection(true)\r\n this.quill.insertText(range.index, '\\n', FluentEditor.sources.USER)\r\n this.quill.insertEmbed(range.index + 1, 'divider', true, FluentEditor.sources.USER)\r\n this.quill.setSelection(range.index + 2, FluentEditor.sources.SILENT)\r\n },\r\n },\r\n },\r\n 'better-table': {\r\n operationMenu: {\r\n color: true,\r\n },\r\n },\r\n 'image': {\r\n specs: [CustomImageSpec],\r\n overlay: {\r\n style: {\r\n border: '1px dashed rgb(68, 68, 68)',\r\n },\r\n },\r\n align: {\r\n icons: {\r\n left: '<i class=\"icon-text-align-left\"></i>',\r\n center: '<i class=\"icon-text-align-center\"></i>',\r\n right: '<i class=\"icon-text-align-right\"></i>',\r\n },\r\n },\r\n },\r\n },\r\n}\r\n\r\nexport default SnowTheme\r\n"],"names":["FluentEditor","BetterTable","inputFile","fullscreenHandler","getListValue","index","FormatPainter","Screenshot","CustomImageSpec"],"mappings":";;;;;;;;;AASM,MAAA,YAAYA,aAAAA,QAAa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QACA,WAAW,WAAY;AACrB,gBAAM,QAAQ,KAAK,MAAM,aAAa,IAAI;AAC1C,eAAK,MAAM,WAAW,MAAM,OAAO,MAAMP,aAAAA,QAAa,QAAQ,IAAI;AAC7D,eAAA,MAAM,YAAY,MAAM,QAAQ,GAAG,WAAW,MAAMA,qBAAa,QAAQ,IAAI;AAClF,eAAK,MAAM,aAAa,MAAM,QAAQ,GAAGA,aAAAA,QAAa,QAAQ,MAAM;AAAA,QAAA;AAAA,MACtE;AAAA,IAEJ;AAAA,IACA,gBAAgB;AAAA,MACd,eAAe;AAAA,QACb,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,IACA,SAAS;AAAA,MACP,OAAO,CAACQ,gBAAAA,eAAe;AAAA,MACvB,SAAS;AAAA,QACP,OAAO;AAAA,UACL,QAAQ;AAAA,QAAA;AAAA,MAEZ;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEJ;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-painter.cjs.js","sources":["../../../src/tools/format-painter.ts"],"sourcesContent":["import type { Range } from 'quill'\r\nimport type Toolbar from 'quill/modules/toolbar'\r\nimport Quill from 'quill'\r\n\r\ninterface FormatData {\r\n formatPainter: {\r\n rangeFormat: Record<string, any>\r\n isFormatterLock: boolean\r\n isFormating: boolean\r\n prepareLock: boolean\r\n }\r\n}\r\nexport function FormatPainter(this: Toolbar & FormatData) {\r\n if (!this.formatPainter) {\r\n this.formatPainter = {\r\n rangeFormat: {},\r\n isFormatterLock: false,\r\n isFormating: false,\r\n prepareLock: false,\r\n }\r\n }\r\n const [, formatterBtn] = this.controls.find(([name]) => name === FormatPainter.toolName)\r\n const formatRange = (range: Range | null) => {\r\n if (!range) return\r\n this.quill.removeFormat(range.index, range.length)\r\n for (const format in this.formatPainter.rangeFormat) {\r\n this.quill.format(format, this.formatPainter.rangeFormat[format], Quill.sources.USER)\r\n }\r\n if (!this.formatPainter.isFormatterLock) {\r\n unbindFormatSelect()\r\n }\r\n else {\r\n btnActive()\r\n }\r\n }\r\n // setTime for Toolbar.update\r\n const btnActive = () => {\r\n setTimeout(() => {\r\n formatterBtn.classList.add('ql-active')\r\n }, 0)\r\n }\r\n const btnRemoveActive = () => {\r\n setTimeout(() => {\r\n formatterBtn.classList.remove('ql-active')\r\n }, 0)\r\n }\r\n const bindFormatSelect = () => {\r\n const range = this.quill.getSelection()\r\n if (range.length === 0) return\r\n this.formatPainter.rangeFormat = this.quill.getFormat(range)\r\n this.formatPainter.isFormating = true\r\n this.quill.on(Quill.events.SELECTION_CHANGE, formatRange)\r\n btnActive()\r\n }\r\n const unbindFormatSelect = () => {\r\n this.quill.off(Quill.events.SELECTION_CHANGE, formatRange)\r\n this.formatPainter.rangeFormat = undefined\r\n btnRemoveActive()\r\n this.formatPainter.isFormating = false\r\n this.formatPainter.isFormatterLock = false\r\n }\r\n\r\n if (this.formatPainter.isFormatterLock || (this.formatPainter.isFormating && !this.formatPainter.prepareLock)) {\r\n unbindFormatSelect()\r\n }\r\n else if (this.formatPainter.isFormating && this.formatPainter.prepareLock) {\r\n this.formatPainter.isFormatterLock = true\r\n btnActive()\r\n }\r\n else {\r\n // imitate double click\r\n this.formatPainter.prepareLock = true\r\n setTimeout(() => {\r\n this.formatPainter.prepareLock = false\r\n }, 200)\r\n bindFormatSelect()\r\n }\r\n}\r\nFormatPainter.toolName = 'format-painter'\r\n"],"names":[],"mappings":";;;AAYO,SAAS,gBAA0C;AACpD,MAAA,CAAC,KAAK,eAAe;AACvB,SAAK,gBAAgB;AAAA,MACnB,aAAa,CAAC;AAAA,MACd,iBAAiB;AAAA,MACjB,aAAa;AAAA,MACb,aAAa;AAAA,IACf;AAAA,EAAA;AAEF,QAAM,GAAG,YAAY,IAAI,KAAK,SAAS,KAAK,CAAC,CAAC,IAAI,MAAM,SAAS,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,cAAc,cAAc;AAAA,OAChC,GAAG;AACW,qBAAA;AAAA,EAAA;AAErB;AACA,cAAc,WAAW;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const index = require("../config/index.cjs.js");
|
|
4
|
+
const icons = require("../ui/icons.cjs.js");
|
|
4
5
|
const scrollLock = require("../utils/scroll-lock.cjs.js");
|
|
5
6
|
let exitEscHandlerBindToolbar;
|
|
6
7
|
let resizeHandlerBindToolbar;
|
|
@@ -23,7 +24,7 @@ function intoFullscreen(toolbar) {
|
|
|
23
24
|
cleanLock = scrollLock.lockScroll();
|
|
24
25
|
resizeHandlerBindToolbar();
|
|
25
26
|
const [, btn] = toolbar.controls.find((item) => item[0] === "fullscreen");
|
|
26
|
-
btn.innerHTML =
|
|
27
|
+
btn.innerHTML = icons.ICONS_CONFIG["fullscreen-exit"];
|
|
27
28
|
window.addEventListener("resize", resizeHandlerBindToolbar);
|
|
28
29
|
document.addEventListener("keydown", exitEscHandlerBindToolbar);
|
|
29
30
|
const toolbarTipModule = toolbar.quill.getModule("toolbar-tip");
|
|
@@ -38,7 +39,7 @@ function exitFullscreen(toolbar) {
|
|
|
38
39
|
cleanLock();
|
|
39
40
|
document.documentElement.scrollTop = originScrollTop;
|
|
40
41
|
const [, btn] = toolbar.controls.find((item) => item[0] === "fullscreen");
|
|
41
|
-
btn.innerHTML =
|
|
42
|
+
btn.innerHTML = icons.ICONS_CONFIG.fullscreen;
|
|
42
43
|
window.removeEventListener("resize", resizeHandlerBindToolbar);
|
|
43
44
|
document.removeEventListener("keydown", exitEscHandlerBindToolbar);
|
|
44
45
|
const toolbarTipModule = toolbar.quill.getModule("toolbar-tip");
|
|
@@ -56,4 +57,4 @@ function fullscreenHandler() {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
exports.fullscreenHandler = fullscreenHandler;
|
|
59
|
-
//# sourceMappingURL=
|
|
60
|
+
//# sourceMappingURL=fullscreen.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullscreen.cjs.js","sources":["../../../src/tools/fullscreen.ts"],"sourcesContent":["import type { FluentEditorToolbar } from '../config/types'\r\nimport { namespace } from '../config'\r\nimport { ICONS_CONFIG } from '../ui/icons'\r\nimport { lockScroll } from '../utils/scroll-lock'\r\n\r\nlet exitEscHandlerBindToolbar: (e: KeyboardEvent) => void\r\nlet resizeHandlerBindToolbar: () => void\r\nlet cleanLock: ReturnType<typeof lockScroll>\r\nlet originScrollTop = 0\r\nfunction exitEscHandler(toolbar: FluentEditorToolbar, e: KeyboardEvent) {\r\n if (e.code === 'Escape') {\r\n exitFullscreen(toolbar)\r\n }\r\n}\r\nfunction updateToolbarHeight(toolbar: FluentEditorToolbar) {\r\n const toolbarRect = toolbar.container.getBoundingClientRect()\r\n toolbar.quill.container.style.setProperty(`--${namespace}-top`, `${toolbarRect.height}px`)\r\n}\r\nfunction intoFullscreen(toolbar: FluentEditorToolbar) {\r\n toolbar.quill.isFullscreen = true\r\n originScrollTop = document.documentElement.scrollTop\r\n toolbar.container.classList.add('fullscreen')\r\n toolbar.quill.container.classList.add('fullscreen')\r\n cleanLock = lockScroll()\r\n resizeHandlerBindToolbar()\r\n const [, btn] = toolbar.controls.find(item => item[0] === 'fullscreen')\r\n btn.innerHTML = ICONS_CONFIG['fullscreen-exit']\r\n window.addEventListener('resize', resizeHandlerBindToolbar)\r\n document.addEventListener('keydown', exitEscHandlerBindToolbar)\r\n // TODO: clear hard code\r\n const toolbarTipModule = toolbar.quill.getModule('toolbar-tip') as any\r\n if (toolbarTipModule) {\r\n toolbarTipModule.hideAllTips()\r\n }\r\n}\r\nfunction exitFullscreen(toolbar: FluentEditorToolbar) {\r\n toolbar.quill.isFullscreen = false\r\n toolbar.container.classList.remove('fullscreen')\r\n toolbar.quill.container.classList.remove('fullscreen')\r\n cleanLock()\r\n document.documentElement.scrollTop = originScrollTop\r\n const [, btn] = toolbar.controls.find(item => item[0] === 'fullscreen')\r\n btn.innerHTML = ICONS_CONFIG.fullscreen\r\n window.removeEventListener('resize', resizeHandlerBindToolbar)\r\n document.removeEventListener('keydown', exitEscHandlerBindToolbar)\r\n // TODO: clear hard code\r\n const toolbarTipModule = toolbar.quill.getModule('toolbar-tip') as any\r\n if (toolbarTipModule) {\r\n toolbarTipModule.hideAllTips()\r\n }\r\n}\r\nexport function fullscreenHandler(this: FluentEditorToolbar) {\r\n if (this.quill.isFullscreen) {\r\n exitFullscreen(this)\r\n }\r\n else {\r\n exitEscHandlerBindToolbar = exitEscHandler.bind(undefined, this)\r\n resizeHandlerBindToolbar = updateToolbarHeight.bind(undefined, this)\r\n intoFullscreen(this)\r\n }\r\n}\r\n"],"names":["namespace","lockScroll","ICONS_CONFIG"],"mappings":";;;;;AAKA,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI,kBAAkB;AACtB,SAAS,eAAe,SAA8B,GAAkB;AAClE,MAAA,EAAE,SAAS,UAAU;AACvB,mBAAe,OAAO;AAAA,EAAA;AAE1B;AACA,SAAS,oBAAoB,SAA8B;AACnD,QAAA,cAAc,QAAQ,UAAU,sBAAsB;AACpD,UAAA,MAAM,UAAU,MAAM,YAAY,KAAKA,eAAS,QAAQ,GAAG,YAAY,MAAM,IAAI;AAC3F;AACA,SAAS,eAAe,SAA8B;AACpD,UAAQ,MAAM,eAAe;AAC7B,oBAAkB,SAAS,gBAAgB;AACnC,UAAA,UAAU,UAAU,IAAI,YAAY;AAC5C,UAAQ,MAAM,UAAU,UAAU,IAAI,YAAY;AAClD,cAAYC,WAAAA,WAAW;AACE,2BAAA;AACnB,QAAA,GAAG,GAAG,IAAI,QAAQ,SAAS,KAAK,CAAQ,SAAA,KAAK,CAAC,MAAM,YAAY;AAClE,MAAA,YAAYC,mBAAa,iBAAiB;AACvC,SAAA,iBAAiB,UAAU,wBAAwB;AACjD,WAAA,iBAAiB,WAAW,yBAAyB;AAE9D,QAAM,mBAAmB,QAAQ,MAAM,UAAU,aAAa;AAC9D,MAAI,kBAAkB;AACpB,qBAAiB,YAAY;AAAA,EAAA;AAEjC;AACA,SAAS,eAAe,SAA8B;AACpD,UAAQ,MAAM,eAAe;AACrB,UAAA,UAAU,UAAU,OAAO,YAAY;AAC/C,UAAQ,MAAM,UAAU,UAAU,OAAO,YAAY;AAC3C,YAAA;AACV,WAAS,gBAAgB,YAAY;AAC/B,QAAA,GAAG,GAAG,IAAI,QAAQ,SAAS,KAAK,CAAQ,SAAA,KAAK,CAAC,MAAM,YAAY;AACtE,MAAI,YAAYA,MAAAA,aAAa;AACtB,SAAA,oBAAoB,UAAU,wBAAwB;AACpD,WAAA,oBAAoB,WAAW,yBAAyB;AAEjE,QAAM,mBAAmB,QAAQ,MAAM,UAAU,aAAa;AAC9D,MAAI,kBAAkB;AACpB,qBAAiB,YAAY;AAAA,EAAA;AAEjC;AACO,SAAS,oBAA6C;AACvD,MAAA,KAAK,MAAM,cAAc;AAC3B,mBAAe,IAAI;AAAA,EAAA,OAEhB;AACyB,gCAAA,eAAe,KAAK,QAAW,IAAI;AACpC,+BAAA,oBAAoB,KAAK,QAAW,IAAI;AACnE,mBAAe,IAAI;AAAA,EAAA;AAEvB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot.cjs.js","sources":["../../../src/tools/screenshot.ts"],"sourcesContent":["import type html2canvas from 'html2canvas'\r\nimport type { Options as Html2CanvasOptions } from 'html2canvas'\r\nimport type Toolbar from 'quill/modules/toolbar'\r\nimport Quill from 'quill'\r\nimport { imgToBase64 } from '../utils/image'\r\nimport { lockScroll } from '../utils/scroll-lock'\r\n\r\nconst Delta = Quill.import('delta')\r\n\r\nexport type ScreenShotOptions = Partial<Html2CanvasOptions> & {\r\n Html2Canvas: typeof html2canvas\r\n beforeCreateCanvas: () => void | Promise<void>\r\n beforeCreateImage: (canvas: HTMLCanvasElement) => HTMLCanvasElement | string | Promise<HTMLCanvasElement | string>\r\n}\r\ninterface ScreenShotOptionsInQuill {\r\n quill: {\r\n options: {\r\n screenshot: Partial<ScreenShotOptions>\r\n }\r\n }\r\n}\r\n\r\nfunction resolveOptions(options: Partial<ScreenShotOptions>) {\r\n return Object.assign({\r\n // @ts-ignore\r\n Html2Canvas: window.Html2Canvas,\r\n useCORS: true,\r\n scale: 1,\r\n foreignObjectRendering: true,\r\n beforeCreateImage: undefined,\r\n beforeCreateCanvas: undefined,\r\n }, options)\r\n}\r\n\r\nfunction init() {\r\n const maskExits = document.querySelectorAll('.ql-screenshot-mask')\r\n if (maskExits) {\r\n maskExits.forEach(item => item && item.remove())\r\n }\r\n // 创建截图图层\r\n const wrapper = document.createElement('div')\r\n wrapper.classList.add('ql-screenshot-wrapper')\r\n const mask = document.createElement('div')\r\n mask.className = 'ql-screenshot-mask'\r\n const cutter = document.createElement('div')\r\n cutter.className = 'ql-screenshot-cutter'\r\n const coordinate = document.createElement('p')\r\n coordinate.className = 'ql-screenshot-coordinate'\r\n cutter.appendChild(coordinate)\r\n wrapper.appendChild(mask)\r\n wrapper.appendChild(cutter)\r\n document.body.appendChild(wrapper)\r\n return { wrapper, mask, cutter, coordinate }\r\n}\r\n\r\nfunction findParentFixed(dom: HTMLElement) {\r\n if (dom.tagName === 'BODY') return false\r\n if (['fixed', 'sticky'].includes(dom.parentElement.style.position)) return true\r\n return findParentFixed(dom.parentElement)\r\n}\r\nasync function renderImage(\r\n Html2Canvas: typeof html2canvas,\r\n html2canvasOptions: Partial<Html2CanvasOptions>,\r\n rect: DOMRect,\r\n options?: Omit<ScreenShotOptions, 'Html2Canvas' | keyof Html2CanvasOptions>,\r\n) {\r\n if (options && options.beforeCreateCanvas) {\r\n await options.beforeCreateCanvas()\r\n }\r\n const canvas: CanvasImageSource = await Html2Canvas(document.body, {\r\n ...html2canvasOptions,\r\n onclone: async (doc: Document, el: HTMLElement) => {\r\n // find all fixed or sticky dom\r\n const fixedDom = Array.from(doc.querySelectorAll('*[style*=\"position: fixed\"]')) as HTMLElement[]\r\n const stickyDom = Array.from(doc.querySelectorAll('*[style*=\"position: sticky\"]')) as HTMLElement[]\r\n const fixedDomList = new Set([...fixedDom, ...stickyDom])\r\n for (const dom of fixedDomList) {\r\n // if parent dom already has fixed or sticky style\r\n // means that transform will be settle. skip\r\n if (findParentFixed(dom)) continue\r\n // use transform move to correct position\r\n let x = 0\r\n let y = 0\r\n if (dom.style.top !== 'auto') {\r\n y = window.scrollY\r\n }\r\n if (dom.style.left !== 'auto') {\r\n x = window.scrollX\r\n }\r\n if (x !== 0 || y !== 0) {\r\n dom.style.transform = `translate(${x}px, ${y}px)`\r\n }\r\n }\r\n\r\n const imgs = doc.querySelectorAll('img')\r\n const promises = Array.from(imgs).map(async (img) => {\r\n img.src = await imgToBase64(img.src)\r\n })\r\n await Promise.all(promises)\r\n html2canvasOptions.onclone && await html2canvasOptions.onclone(doc, el)\r\n },\r\n })\r\n // 当前canvas为body全局截图,从当前截图中截取想要的部分重新绘制转成base64插入富文本\r\n let cropCanvas: HTMLCanvasElement | string = document.createElement('canvas')\r\n cropCanvas.width = rect.width\r\n cropCanvas.height = rect.height\r\n const cropCanvasCtx = cropCanvas.getContext('2d')\r\n cropCanvasCtx.drawImage(\r\n canvas,\r\n rect.x + window.scrollX,\r\n rect.y + window.scrollY,\r\n rect.width,\r\n rect.height,\r\n 0,\r\n 0,\r\n rect.width,\r\n rect.height,\r\n )\r\n if (options && options.beforeCreateImage) {\r\n cropCanvas = await options.beforeCreateImage(cropCanvas)\r\n }\r\n return typeof cropCanvas === 'string' ? cropCanvas : cropCanvas.toDataURL()\r\n}\r\n\r\nexport function Screenshot(this: Toolbar & ScreenShotOptionsInQuill) {\r\n this.quill.options.screenshot = resolveOptions(this.quill.options.screenshot)\r\n const options = this.quill.options.screenshot\r\n // @ts-ignore\r\n const { Html2Canvas, beforeCreateImage, beforeCreateCanvas, ...html2CanvasOptions } = options\r\n if (!Html2Canvas) {\r\n throw new Error('ScreenShot module requires html2canvas. Please include the library on the page before FluentEditor.')\r\n }\r\n const range = this.quill.getSelection()\r\n const { wrapper, mask, cutter, coordinate } = init()\r\n const status: {\r\n leftClickLockFlag: boolean\r\n start?: {\r\n x: number\r\n y: number\r\n }\r\n } = {\r\n leftClickLockFlag: false,\r\n start: undefined,\r\n }\r\n const cleanLock = lockScroll()\r\n\r\n const removeContextmenu = (event: Event) => {\r\n event.preventDefault()\r\n wrapper.remove()\r\n cleanLock()\r\n document.removeEventListener('contextmenu', removeContextmenu)\r\n }\r\n const afterShotCtrl = async (event: MouseEvent) => {\r\n document.removeEventListener('mousedown', toggleRect)\r\n const cutterRect = cutter.getBoundingClientRect()\r\n const target = event.target as HTMLElement\r\n wrapper.remove()\r\n cleanLock()\r\n if (target && target.className === 'ql-screenshot-confirm') {\r\n const image = await renderImage(Html2Canvas, html2CanvasOptions, cutterRect, { beforeCreateCanvas, beforeCreateImage })\r\n\r\n const delta = new Delta()\r\n .retain(range.index)\r\n .delete(range.length)\r\n .insert({ image })\r\n this.quill.updateContents(delta, Quill.sources.USER)\r\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT)\r\n }\r\n status.start = undefined\r\n }\r\n const drawRect = (event: MouseEvent) => {\r\n // 通过鼠标移动描绘截图图层\r\n const startX = status.start.x\r\n const startY = status.start.y\r\n const endX = event.clientX\r\n const endY = event.clientY\r\n const width = Math.abs(endX - startX)\r\n const height = Math.abs(endY - startY)\r\n const top = startY < endY ? startY : endY\r\n const left = startX < endX ? startX : endX\r\n const bottom = window.innerHeight - height - top\r\n const right = window.innerWidth - width - left\r\n\r\n const maskPath = `\r\n linear-gradient(to top, #fff, #fff) top / 100% ${top}px,\r\n linear-gradient(to bottom, #fff, #fff) bottom /100% ${bottom}px,\r\n linear-gradient(to left, #fff, #fff) left / ${left}px 100%,\r\n linear-gradient(to right, #fff, #fff) right / ${right}px 100%\r\n `\r\n Object.assign(cutter.style, {\r\n width: `${width}px`,\r\n height: `${height}px`,\r\n left: `${left}px`,\r\n top: `${top}px`,\r\n })\r\n Object.assign(mask.style, {\r\n 'mask': maskPath,\r\n '-webkit-mask-repeat': 'no-repeat',\r\n })\r\n coordinate.textContent = `${width}, ${height}`\r\n }\r\n const toggleRect = (event: MouseEvent) => {\r\n // 右键取消截图操作\r\n if (event.button === 2) {\r\n document.removeEventListener('mousemove', drawRect)\r\n document.removeEventListener('mousedown', toggleRect)\r\n document.addEventListener('contextmenu', removeContextmenu)\r\n return\r\n }\r\n if (!status.leftClickLockFlag) {\r\n if (status.start) {\r\n // 如果有起点,则当前触发坐标为终点,移除监听事件并添加确认和取消按钮\r\n document.removeEventListener('mousemove', drawRect)\r\n const doneBtn = document.createElement('div')\r\n doneBtn.innerHTML = `<div class=\"ql-screenshot-confirm\"></div><div class=\"ql-screenshot-cancel\"></div>`\r\n doneBtn.className = 'ql-screenshot-done'\r\n doneBtn.addEventListener('click', afterShotCtrl)\r\n coordinate.remove()\r\n cutter.appendChild(doneBtn)\r\n status.leftClickLockFlag = true\r\n }\r\n else {\r\n // 无起点则设置起点坐标,监听鼠标移动\r\n status.start = { x: event.clientX, y: event.clientY }\r\n document.addEventListener('mousemove', drawRect)\r\n }\r\n }\r\n }\r\n document.addEventListener('mousedown', toggleRect)\r\n}\r\nScreenshot.toolName = 'screenshot'\r\n"],"names":["imgToBase64","lockScroll","image"],"mappings":";;;;;AAOA,MAAM,QAAQ,MAAM,OAAO,OAAO;AAelC,SAAS,eAAe,SAAqC;AAC3D,SAAO,OAAO,OAAO;AAAA;AAAA,IAEnB,aAAa,OAAO;AAAA,IACpB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,wBAAwB;AAAA,IACxB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,KACnB,OAAO;AACZ;AAEA,SAAS,OAAO;AACR,QAAA,YAAY,SAAS,iBAAiB,qBAAqB;AACjE,MAAI,WAAW;AACb,cAAU,QAAQ,CAAA,SAAQ,QAAQ,KAAK,QAAQ;AAAA,EAAA;AAG3C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AG,MAAM;AAAA,MACjB,MAAM,GAAG,IAAI;AAAA,MACb,KAAK,GAAG,GAAG;AAAA,IAAA,CACZ;AACM,WAAA,OAAO,KAAK,OAAO;AAAA,MACxB,QAAQ;AAAA,MACR,uBAAuB;AAAA,IAAA,CACxB;AACD,eAAW,cAAc,GAAG,KAAK,KAAK,MAAM;AAAA,EAC9C;AACM,QAAA,aAAa,CAAC,UAAsB;AAEpC,QAAA,MAAM,WAAW,GAAG;AACb,eAAA,oBAAoB,aAAa,QAAQ;AACzC,eAAA,oBAAoB,aAAa,UAAU;AAC3C,eAAA,iBAAiB,eAAe,iBAAiB;AAC1D;AAAA,IAAA;AAEE,QAAA,CAAC,OAAO,mBAAmB;AAC7B,UAAI,OAAO,OAAO;AAEP,iBAAA,oBAAoB,aAAa,QAAQ;AAC5C,cAAA,UAAU,SAAS,cAAc,KAAK;AAC5C,gBAAQ,YAAY;AACpB,gBAAQ,YAAY;AACZ,gBAAA,iBAAiB,SAAS,aAAa;AAC/C,mBAAW,OAAO;AAClB,eAAO,YAAY,OAAO;AAC1B,eAAO,oBAAoB;AAAA,MAAA,OAExB;AAEH,eAAO,QAAQ,EAAE,GAAG,MAAM,SAAS,GAAG,MAAM,QAAQ;AAC3C,iBAAA,iBAAiB,aAAa,QAAQ;AAAA,MAAA;AAAA,IACjD;AAAA,EAEJ;AACS,WAAA,iBAAiB,aAAa,UAAU;AACnD;AACA,WAAW,WAAW;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const fluentEditor = require("../core/fluent-editor.cjs.js");
|
|
4
|
+
const icons_config = require("./icons.config.cjs.js");
|
|
5
|
+
const ICONS_CONFIG = {
|
|
6
|
+
"undo": icons_config.UNDO_ICON,
|
|
7
|
+
"redo": icons_config.REDO_ICON,
|
|
8
|
+
"clean": icons_config.CLEAN_ICON,
|
|
9
|
+
"bold": icons_config.BOLD_ICON,
|
|
10
|
+
"italic": icons_config.ITALIC_ICON,
|
|
11
|
+
"underline": icons_config.UNDERLINE_ICON,
|
|
12
|
+
"strike": icons_config.STRIKE_ICON,
|
|
13
|
+
"font": "",
|
|
14
|
+
"size": "",
|
|
15
|
+
"color": `<span class="ql-color-inner">
|
|
16
|
+
${icons_config.COLOR_ICON}
|
|
17
|
+
${icons_config.TRIANGLE_DOWN_ICON}
|
|
18
|
+
<span class="current-color-line"></span>
|
|
19
|
+
</span>`,
|
|
20
|
+
"background": `<span class="ql-color-inner">
|
|
21
|
+
${icons_config.BACKGROUND_COLOR_ICON}
|
|
22
|
+
${icons_config.TRIANGLE_DOWN_ICON}
|
|
23
|
+
<span class="current-color-line color-line-background"></span>
|
|
24
|
+
</span>`,
|
|
25
|
+
"align": {
|
|
26
|
+
"": icons_config.ALIGN_LEFT_ICON,
|
|
27
|
+
"center": icons_config.ALIGN_CENTER_ICON,
|
|
28
|
+
"right": icons_config.ALIGN_RIGHT_ICON,
|
|
29
|
+
"justify": icons_config.ALIGN_JUSTIFY_ICON
|
|
30
|
+
},
|
|
31
|
+
"list": {
|
|
32
|
+
bullet: icons_config.LIST_UNORDERED_ICON,
|
|
33
|
+
ordered: icons_config.LIST_ORDERED_ICON,
|
|
34
|
+
check: icons_config.LIST_CHECK_ICON
|
|
35
|
+
},
|
|
36
|
+
"code": icons_config.CODE_ICON,
|
|
37
|
+
"code-block": icons_config.CODE_BLOCK_ICON,
|
|
38
|
+
"blockquote": icons_config.BLOCKQUOTE_ICON,
|
|
39
|
+
"image": icons_config.IMAGE_ICON,
|
|
40
|
+
"file": icons_config.FILE_ICON,
|
|
41
|
+
"better-table": icons_config.TABLE_ICON,
|
|
42
|
+
"link": icons_config.LINK_ICON,
|
|
43
|
+
"global-link": icons_config.GLOBAL_LINK_ICON,
|
|
44
|
+
"fullscreen": icons_config.FULLSCREEN_ICON,
|
|
45
|
+
"fullscreen-exit": icons_config.FULLSCREEN_EXIT_ICON,
|
|
46
|
+
"emoji": icons_config.EMOJI_ICON,
|
|
47
|
+
"help": icons_config.HELP_ICON,
|
|
48
|
+
"screenshot": icons_config.SCREENSHOT_ICON,
|
|
49
|
+
"format-painter": icons_config.FORMAT_PAINTER_ICON,
|
|
50
|
+
"divider": icons_config.DIVIDER_ICON
|
|
51
|
+
};
|
|
52
|
+
const Icons = fluentEditor.default.import("ui/icons");
|
|
53
|
+
Object.entries(ICONS_CONFIG).forEach(([key, icon]) => {
|
|
54
|
+
Icons[key] = icon;
|
|
55
|
+
});
|
|
56
|
+
exports.ICONS_CONFIG = ICONS_CONFIG;
|
|
57
|
+
exports.default = Icons;
|
|
58
|
+
//# sourceMappingURL=icons.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.cjs.js","sources":["../../../src/ui/icons.ts"],"sourcesContent":["import FluentEditor from '../core/fluent-editor'\r\nimport {\r\n ALIGN_CENTER_ICON,\r\n ALIGN_JUSTIFY_ICON,\r\n ALIGN_LEFT_ICON,\r\n ALIGN_RIGHT_ICON,\r\n BACKGROUND_COLOR_ICON,\r\n BLOCKQUOTE_ICON,\r\n BOLD_ICON,\r\n CLEAN_ICON,\r\n CODE_BLOCK_ICON,\r\n CODE_ICON,\r\n COLOR_ICON,\r\n DIVIDER_ICON,\r\n EMOJI_ICON,\r\n FILE_ICON,\r\n FORMAT_PAINTER_ICON,\r\n FULLSCREEN_EXIT_ICON,\r\n FULLSCREEN_ICON,\r\n GLOBAL_LINK_ICON,\r\n HELP_ICON,\r\n IMAGE_ICON,\r\n ITALIC_ICON,\r\n LINK_ICON,\r\n LIST_CHECK_ICON,\r\n LIST_ORDERED_ICON,\r\n LIST_UNORDERED_ICON,\r\n REDO_ICON,\r\n SCREENSHOT_ICON,\r\n STRIKE_ICON,\r\n TABLE_ICON,\r\n TRIANGLE_DOWN_ICON,\r\n UNDERLINE_ICON,\r\n UNDO_ICON,\r\n} from './icons.config'\r\n\r\nconst ICONS_CONFIG: { [key: string]: any } = {\r\n 'undo': UNDO_ICON,\r\n 'redo': REDO_ICON,\r\n 'clean': CLEAN_ICON,\r\n\r\n 'bold': BOLD_ICON,\r\n 'italic': ITALIC_ICON,\r\n 'underline': UNDERLINE_ICON,\r\n 'strike': STRIKE_ICON,\r\n\r\n 'font': '',\r\n 'size': '',\r\n\r\n 'color': `<span class=\"ql-color-inner\">\r\n ${COLOR_ICON}\r\n ${TRIANGLE_DOWN_ICON}\r\n <span class=\"current-color-line\"></span>\r\n </span>`,\r\n 'background': `<span class=\"ql-color-inner\">\r\n ${BACKGROUND_COLOR_ICON}\r\n ${TRIANGLE_DOWN_ICON}\r\n <span class=\"current-color-line color-line-background\"></span>\r\n </span>`,\r\n\r\n 'align': {\r\n '': ALIGN_LEFT_ICON,\r\n 'center': ALIGN_CENTER_ICON,\r\n 'right': ALIGN_RIGHT_ICON,\r\n 'justify': ALIGN_JUSTIFY_ICON,\r\n },\r\n 'list': {\r\n bullet: LIST_UNORDERED_ICON,\r\n ordered: LIST_ORDERED_ICON,\r\n check: LIST_CHECK_ICON,\r\n },\r\n\r\n 'code': CODE_ICON,\r\n 'code-block': CODE_BLOCK_ICON,\r\n 'blockquote': BLOCKQUOTE_ICON,\r\n\r\n 'image': IMAGE_ICON,\r\n 'file': FILE_ICON,\r\n 'better-table': TABLE_ICON,\r\n 'link': LINK_ICON,\r\n 'global-link': GLOBAL_LINK_ICON,\r\n 'fullscreen': FULLSCREEN_ICON,\r\n 'fullscreen-exit': FULLSCREEN_EXIT_ICON,\r\n 'emoji': EMOJI_ICON,\r\n 'help': HELP_ICON,\r\n 'screenshot': SCREENSHOT_ICON,\r\n 'format-painter': FORMAT_PAINTER_ICON,\r\n 'divider': DIVIDER_ICON,\r\n}\r\n\r\nconst Icons = FluentEditor.import('ui/icons')\r\nObject.entries(ICONS_CONFIG).forEach(([key, icon]) => {\r\n Icons[key] = icon\r\n})\r\n\r\nexport { ICONS_CONFIG }\r\n\r\nexport default Icons\r\n"],"names":["UNDO_ICON","REDO_ICON","CLEAN_ICON","BOLD_ICON","ITALIC_ICON","UNDERLINE_ICON","STRIKE_ICON","COLOR_ICON","TRIANGLE_DOWN_ICON","BACKGROUND_COLOR_ICON","ALIGN_LEFT_ICON","ALIGN_CENTER_ICON","ALIGN_RIGHT_ICON","ALIGN_JUSTIFY_ICON","LIST_UNORDERED_ICON","LIST_ORDERED_ICON","LIST_CHECK_ICON","CODE_ICON","CODE_BLOCK_ICON","BLOCKQUOTE_ICON","IMAGE_ICON","FILE_ICON","TABLE_ICON","LINK_ICON","GLOBAL_LINK_ICON","FULLSCREEN_ICON","FULLSCREEN_EXIT_ICON","EMOJI_ICON","HELP_ICON","SCREENSHOT_ICON","FORMAT_PAINTER_ICON","DIVIDER_ICON","FluentEditor"],"mappings":";;;;AAoCA,MAAM,eAAuC;AAAA,EAC3C,QAAQA,aAAA;AAAA,EACR,QAAQC,aAAA;AAAA,EACR,SAASC,aAAA;AAAA,EAET,QAAQC,aAAA;AAAA,EACR,UAAUC,aAAA;AAAA,EACV,aAAaC,aAAA;AAAA,EACb,UAAUC,aAAA;AAAA,EAEV,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,SAAS;AAAA,MACLC,aAAU,UAAA;AAAA,MACVC,aAAkB,kBAAA;AAAA;AAAA;AAAA,EAGtB,cAAc;AAAA,MACVC,aAAqB,qBAAA;AAAA,MACrBD,aAAkB,kBAAA;AAAA;AAAA;AAAA,EAItB,SAAS;AAAA,IACP,IAAIE,aAAA;AAAA,IACJ,UAAUC,aAAA;AAAA,IACV,SAASC,aAAA;AAAA,IACT,WAAWC,aAAAA;AAAAA,EACb;AAAA,EACA,QAAQ;AAAA,IACN,QAAQC,aAAA;AAAA,IACR,SAASC,aAAA;AAAA,IACT,OAAOC,aAAAA;AAAAA,EACT;AAAA,EAEA,QAAQC,aAAA;AAAA,EACR,cAAcC,aAAA;AAAA,EACd,cAAcC,aAAA;AAAA,EAEd,SAASC,aAAA;AAAA,EACT,QAAQC,aAAA;AAAA,EACR,gBAAgBC,aAAA;AAAA,EAChB,QAAQC,aAAA;AAAA,EACR,eAAeC,aAAA;AAAA,EACf,cAAcC,aAAA;AAAA,EACd,mBAAmBC,aAAA;AAAA,EACnB,SAASC,aAAA;AAAA,EACT,QAAQC,aAAA;AAAA,EACR,cAAcC,aAAA;AAAA,EACd,kBAAkBC,aAAA;AAAA,EAClB,WAAWC,aAAAA;AACb;AAEM,MAAA,QAAQC,aAAAA,QAAa,OAAO,UAAU;AAC5C,OAAO,QAAQ,YAAY,EAAE,QAAQ,CAAC,CAAC,KAAK,IAAI,MAAM;AACpD,QAAM,GAAG,IAAI;AACf,CAAC;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.config.cjs.js","sources":["../../../src/ui/icons.config.ts"],"sourcesContent":["export const UNDO_ICON = `<svg width=\"16px\" height=\"14px\" viewBox=\"0 0 16 14\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(0.000000, -1.000000)\" fill=\"#293040\">\r\n <path d=\"M11,5 C13.7614237,5 16,7.23857625 16,10 C16,12.7614237 13.7614237,15 11,15 L7,15 L7,14 L11,14\r\n C13.209139,14 15,12.209139 15,10 C15,7.790861 13.209139,6 11,6 L5,6 L5,10 L0,5.5 L5,1 L5,5 L11,5 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const REDO_ICON = `<svg width=\"16px\" height=\"14px\" viewBox=\"0 0 16 14\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(0.000000, -1.000000)\" fill=\"#293040\">\r\n <path d=\"M5,5 L11,5 L11,1 L16,5.5 L11,10 L11,6 L5,6 C2.790861,6 1,7.790861 1,10 C1,12.209139 2.790861,14 5,14 L9,14\r\n L9,15 L5,15 C2.23857625,15 0,12.7614237 0,10 C0,7.23857625 2.23857625,5 5,5 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const CLEAN_ICON = `<svg width=\"16px\" height=\"15px\" viewBox=\"0 0 16 15\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g fill=\"#293040\">\r\n <path d=\"M4.32708124,14 L8.37150583,14 L10.5729409,11.5550586 L4.6297198,6.20375828 L1.25465311,9.95542661\r\n C1.09078634,10.1375782 1.0006437,10.3742369 1.00180556,10.6192474 C1.00295568,10.8617824 1.10621221,11.092615\r\n 1.28624979,11.2551297 L4.32708124,14 Z M16,14 L16,15 L3.93760008,15 L0.597250175,11.9923354 C0.217072683,11.6500221\r\n 1.59049582e-13,11.1091757 1.59428026e-13,10.6149383 C1.59806471e-13,10.1207008 0.183000942,9.64396706 0.513710349,9.27667705\r\n L8.56855175,0.330869394 L16,7.02217546 L9.71713856,14 L16,14 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const BOLD_ICON = `<svg width=\"12px\" height=\"16px\" viewBox=\"0 0 12 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-2.000000, 0.000000)\" fill=\"#293040\" fill-rule=\"nonzero\">\r\n <path d=\"M11.540636,7.0842147 C13.0068647,7.89340318 14,9.45459285 14,11.2477417 C14,13.8723415 11.8723415,16\r\n 9.2477417,16 L2,16 L2,7.99258423 L2,-5.06261699e-14 L9.00370789,-4.75175455e-14 C11.2107991,-4.79229815e-14 13,1.78920092\r\n 13,3.99629211 C13,5.24014846 12.4317244,6.35127692 11.540636,7.0842147 Z M3.5,1.5 L3.5,6.49258423 L9.00370789,6.49258423\r\n C10.382372,6.49258423 11.5,5.37495618 11.5,3.99629211 C11.5,2.61762805 10.382372,1.5 9.00370789,1.5 L3.5,1.5 Z M3.5,14.5\r\n L9.2477417,14.5 C11.0439144,14.5 12.5,13.0439144 12.5,11.2477417 C12.5,9.45156904 11.0439144,7.9954834 9.2477417,7.9954834\r\n L3.5,7.9954834 L3.5,14.5 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const ITALIC_ICON = `<svg width=\"9px\" height=\"16px\" viewBox=\"0 0 9 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-4.000000, 0.000000)\" fill=\"#293040\">\r\n <path d=\"M10.2565501,1.5 L8.41332415,14.5 L12,14.5 L12,16 L4,16 L4,14.5 L6.90083611,14.5 L8.74406208,1.5 L5,1.5\r\n L5,0 L13,0 L13,1.5 L10.2565501,1.5 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const UNDERLINE_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <polygon fill=\"#293040\" points=\"2 14 14 14 14 16 2 16\"></polygon>\r\n <path d=\"M4.5,3 L4.5,7 C4.5,8.93299662 6.06700338,10.5 8,10.5 C9.93299662,10.5 11.5,8.93299662 11.5,7 L11.5,1.5\r\n L11.4998322,0 L13,0 L13,7 C13,9.76142375 10.7614237,12 8,12 C5.23857625,12 3,9.76142375 3,7 L3,0 L4.49893188,0\r\n L4.49893188,3 L4.5,3 Z\" fill=\"#293040\" fill-rule=\"nonzero\"></path>\r\n</g>\r\n</svg>`\r\n\r\nexport const STRIKE_ICON = `<svg width=\"14px\" height=\"16px\" viewBox=\"0 0 14 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-1.000000, 0.000000)\" fill=\"#293040\">\r\n <path d=\"M9.93321102,9 L1,9 L1,7 L3.84197169,7 C3.31015092,6.28495098 3,5.42507332 3,4.5 C3,2.01471863\r\n 5.23857625,0 8,0 C10.5736409,0 12.6931261,1.75002477 12.969484,4 L11.4507289,4 C11.1737591,2.60626201 9.76011738,1.5 8,1.5\r\n C6.03382604,1.5 4.5,2.88044344 4.5,4.5 C4.5,5.52604325 5.11562351,6.45611494 6.06678898,7 L15,7 L15,9 L12.1580283,9\r\n C12.6898491,9.71504902 13,10.5749267 13,11.5 C13,13.9852814 10.7614237,16 8,16 C5.42635908,16 3.30687393,14.2499752\r\n 3.03051599,12 L4.54927112,12 C4.82624092,13.393738 6.23988262,14.5 8,14.5 C9.96617396,14.5 11.5,13.1195566 11.5,11.5\r\n C11.5,10.4739568 10.8843765,9.54388506 9.93321102,9 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const COLOR_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <polygon fill=\"#293040\" points=\"2 14 14 14 14 16 2 16\"></polygon>\r\n <path d=\"M10.9166667,8.5 L5.08333333,8.5 L4.26618123,10.461165 L3.62338765,12 L2,12 L7,0 L9,0 L14,12 L12.3824972,12\r\n L11.5753038,10.0807292 L10.9166667,8.5 Z M10.2916667,7 L8,1.5 L5.70833333,7 L10.2916667,7 Z\"\r\n fill=\"#293040\" fill-rule=\"nonzero\"></path>\r\n</g>\r\n</svg>`\r\n\r\nexport const BACKGROUND_COLOR_ICON = ` <svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M4.64447006,9.66583547 L3.17597929,8.33216965 L6.15933183,5.11039074 L5.42508645,4.44355783\r\n L9.39179153,1.0658141e-13 L16,6.00149616 L12.0332949,10.445054 L11.2990495,9.77822108 L8.31569698,13 L6.84720621,11.6663342\r\n L5.69344476,12.9587937 L2.36400649,12.9587937 L2,12.6282074 L4.64447006,9.66583547 Z M4.57134219,8.25840959\r\n L8.24256911,11.5925741 L10.5648041,9.11138818 L6.89357722,5.77722364 L4.57134219,8.25840959 Z M14.6046371,6.07525623\r\n L9.4649194,1.40742588 L6.82044935,4.36979777 L11.960167,9.03762811 L14.6046371,6.07525623 Z M2,14 L14,14 L14,16 L2,16 L2,14 Z\"\r\n fill=\"#293040\"></path>\r\n</g>\r\n</svg>`\r\n\r\nexport const ALIGN_LEFT_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M0,0 L1.5,0 L1.5,16 L0,16 L0,0 Z M4,3 L13,3 L13,7 L4,7 L4,3 Z M5,4 L5,6 L12,6 L12,4 L5,4 Z M4,9 L16,9\r\n L16,13 L4,13 L4,9 Z M5,10 L5,12 L15,12 L15,10 L5,10 Z\" fill=\"#293040\"></path>\r\n</g>\r\n</svg>`\r\n\r\nexport const ALIGN_CENTER_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M8.75,7 L8.75,9 L16,9 L16,13 L8.75,13 L8.75,16 L7.25,16 L7.25,13 L0,13 L0,9 L7.25,9 L7.25,7 L2,7\r\n L2,3 L7.25,3 L7.25,0 L8.75,0 L8.75,3 L14,3 L14,7 L8.75,7 Z M1,10 L1,12 L15,12 L15,10 L1,10 Z M3,4 L3,6 L13,6\r\n L13,4 L3,4 Z\" fill=\"#293040\"></path>\r\n</g>\r\n</svg>`\r\n\r\nexport const ALIGN_JUSTIFY_ICON = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 15 15\"><path fill=\"none\" stroke=\"currentColor\" d=\"M0 3.5h15m-15 8h15m-15-4h15\"/></svg>`\r\n\r\nexport const ALIGN_RIGHT_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M14.5,0 L16,0 L16,16 L14.5,16 L14.5,0 Z M3,3 L12,3 L12,7 L3,7 L3,3 Z M4,4 L4,6 L11,6 L11,4 L4,4 Z\r\n M0,9 L12,9 L12,13 L0,13 L0,9 Z M1,10 L1,12 L11,12 L11,10 L1,10 Z\" fill=\"#293040\"></path>\r\n</g>\r\n</svg>`\r\n\r\nexport const LIST_UNORDERED_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g fill=\"#293040\">\r\n <path d=\"M5,1 L16,1 L16,2.5 L5,2.5 L5,1 Z M2,4 C0.8954305,4 0,3.1045695 0,2 C0,0.8954305 0.8954305,0 2,0\r\n C3.1045695,0 4,0.8954305 4,2 C4,3.1045695 3.1045695,4 2,4 Z M2,3 C2.55228475,3 3,2.55228475 3,2 C3,1.44771525\r\n 2.55228475,1 2,1 C1.44771525,1 1,1.44771525 1,2 C1,2.55228475 1.44771525,3 2,3 Z M2,10 C0.8954305,10 0,9.1045695\r\n 0,8 C0,6.8954305 0.8954305,6 2,6 C3.1045695,6 4,6.8954305 4,8 C4,9.1045695 3.1045695,10 2,10 Z M2,9 C2.55228475,9\r\n 3,8.55228475 3,8 C3,7.44771525 2.55228475,7 2,7 C1.44771525,7 1,7.44771525 1,8 C1,8.55228475 1.44771525,9 2,9 Z\r\n M2,16 C0.8954305,16 0,15.1045695 0,14 C0,12.8954305 0.8954305,12 2,12 C3.1045695,12 4,12.8954305 4,14 C4,15.1045695\r\n 3.1045695,16 2,16 Z M2,15 C2.55228475,15 3,14.5522847 3,14 C3,13.4477153 2.55228475,13 2,13 C1.44771525,13 1,13.4477153\r\n 1,14 C1,14.5522847 1.44771525,15 2,15 Z M5,7 L16,7 L16,8.5 L5,8.5 L5,7 Z M5,13 L16,13 L16,14.5 L5,14.5 L5,13 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const LIST_ORDERED_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g fill=\"#293040\">\r\n <path d=\"M5,1 L16,1 L16,2.5 L5,2.5 L5,1 Z M0,0 L2,0 L2,3 L3,3 L3,4 L0,4 L0,3 L1,3 L1,1 L0,1 L0,0 Z M5,7 L16,7\r\n L16,8.5 L5,8.5 L5,7 Z M5,13 L16,13 L16,14.5 L5,14.5 L5,13 Z M0,15 L1.75,15 C1.88807119,15 2,14.8880712 2,14.75\r\n C2,14.6119288 1.88807119,14.5 1.75,14.5 L0,14.5 L0,13.5 L1.75,13.5 C1.88807119,13.5 2,13.3880712 2,13.25 C2,13.1119288\r\n 1.88807119,13 1.75,13 L0,13 L0,12 L1.5,12 C2.32842712,12 3,12.6715729 3,13.5 C3,13.6753177 2.96992289,13.8436105\r\n 2.91464715,14 C2.96992289,14.1563895 3,14.3246823 3,14.5 C3,15.3284271 2.32842712,16 1.5,16 L0,16 L0,15 Z M2,7.5\r\n C2,7.35127258 1.9375,7.22627258 1.84375,7.13845444 C1.76307119,7.05596441 1.63807119,7 1.5,7 C1.22385763,7 1,7.22385763\r\n 1,7.5 L1.62630326e-19,7.5 C0.147399902,6.5 0.647399902,6 1.5,6 C2.32842712,6 3,6.67157288 3,7.5 C3,8.07312512\r\n 2.50016007,8.55650475 2.22821045,8.74661255 C1.95626083,8.93672035 1.77325955,8.99789088 1.76769962,9 L3,9 L3,10\r\n L0,10 L1.62630326e-19,9 C0.619515577,8.77257137 1.06188822,8.55939591 1.32711792,8.36047363 C1.6371448,8.12795347\r\n 1.87259637,7.91592701 1.96143498,7.69289356 C1.98627694,7.633537 2,7.5683711 2,7.5 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const LIST_CHECK_ICON = `<svg width=\"15px\" height=\"14px\" viewBox=\"0 0 15 14\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-1058.000000, -97.000000)\">\r\n <g transform=\"translate(407.000000, 93.000000)\">\r\n <g transform=\"translate(650.000000, 2.000000)\">\r\n <rect x=\"0\" y=\"0\" width=\"16\" height=\"16\"></rect>\r\n <polygon fill=\"#293040\" fill-rule=\"nonzero\" points=\"14 15 14 9.37100497 15 9.37100497 15\r\n 16 1 16 1 2 10.1946467 2 10.1946467 3 2 3 2 15\"></polygon>\r\n <path d=\"M14.4525049,2.48740937 C14.7356009,2.1850362 15.8305911,3.21021745 15.5474951,3.51259063\r\n L8.45990379,11.0828057 L4.46558382,7.02621226 C4.17496481,6.73106236 4.17863783,6.25620283 4.47378774,5.96558382\r\n C4.76893764,5.67496481 5.24379717,5.67863783 5.53441618,5.97378774 L8.43263799,8.91719429 L14.4525049,2.48740937 Z\"\r\n fill=\"#293040\" fill-rule=\"nonzero\"></path>\r\n </g>\r\n </g>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const CODE_BLOCK_ICON = `<svg t=\"1565073788159\" class=\"icon\" viewBox=\"0 0 1024 1024\" width=\"16\" height=\"16\">\r\n<path d=\"M110.78 469.52l70.44-39.24A60 60 0 0 0 212 377.9L212 212a120 120 0 0 1 120-120l60 0a30\r\n30 0 0 1 0 60L332 152a60 60 0 0 0-59.99999999 60l0 175.38a120 120 0 0\r\n1-63.48000001 105.9L173.42 512l35.1 18.72A120 120 0 0 1 272 636.56L272.00000001 812a60 60 0 0 0 59.99999999 60l60 0a30 30\r\n0 1 1 0 60L332 932a120 120 0 0 1-120-120l0-165.9a60\r\n60 0 0 0-30.78-52.38l-70.44-39.24a45 45 0 0 1 0-84.96z m742.44 1e-8a45 45 0 0 1 0 84.95999998l-70.44 39.24000001a60\r\n60 0 0 0-30.78000001 52.38L751.99999999 812a120 120 0 0 1-119.99999999 120L572 932a30 30\r\n0 1 1 0-60l60 0a60 60 0 0 0 60-60l0-175.38a120 120\r\n0 0 1 63.48-105.9L790.58 512l-35.1-18.72A120 120 0 0 1 692 387.44L692 212a60 60 0 0 0-60-60L572 152a30\r\n30 0 0 1 0-60l60 0a120 120 0 0 1 119.99999999 120l0 165.9a60 60 0 0 0 30.78000001 52.38l70.44 39.24000001z\"></path></svg>`\r\n\r\nexport const BLOCKQUOTE_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(0.000000, 1.000000)\" fill=\"#000000\" fill-rule=\"nonzero\">\r\n <path d=\"M6.86733556,12.5574136 L6.86733556,7.99108138 L2.52931996,7.99108138 C2.41516165,5.02296544\r\n 3.10011148,3.42474916 5.72575251,2.0548495 L5.72575251,0 C1.84437012,1.36989967 -0.0963210702,3.88138239 0.0178372352,7.76276477\r\n L0.0178372352,12.5574136 L6.86733556,12.5574136 Z M16,12.5574136 L16,7.99108138 L11.6619844,7.99108138 C11.5478261,5.02296544\r\n 12.2327759,3.42474916 14.8584169,2.0548495 L14.8584169,0 C10.9770346,1.36989967 9.03634337,3.88138239 9.15050167,7.76276477\r\n L9.15050167,12.5574136 L16,12.5574136 Z\"></path>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const IMAGE_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-1196.000000, -96.000000)\" fill=\"#293040\" fill-rule=\"nonzero\">\r\n <g transform=\"translate(407.000000, 93.000000)\">\r\n <path d=\"M804,4 L790,4 L790,11.940983 L794.058237,9.91186456 L798.536534,13.3949845 L801.014076,11.908459\r\n L804,13.8990748 L804,4 Z M803.72265,14.9160251 L800.985924,13.091541 L798.463466,14.6050155 L793.941763,11.0881354\r\n L790.223607,12.9472136 C790.151699,12.9831673 790.07527,13.000168 790,13.0001094 L790,18 L804,18 L804,15.0000529\r\n C803.90455,15.0001406 803.80803,14.9729453 803.72265,14.9160251 Z M789,19 L789,3 L805,3 L805,19 L789,19 Z M801,9\r\n C800.447715,9 800,8.55228475 800,8 C800,7.44771525 800.447715,7 801,7 C801.552285,7 802,7.44771525 802,8 C802,8.55228475\r\n 801.552285,9 801,9 Z\"></path>\r\n </g>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const FILE_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\" >\r\n<g id=\"icon/01\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M16,16 L1,16 L1,0 L12,0 L16,4 L16,16 Z M11,1 L2,1 L2,15 L15,15 L15,\r\n 5 L11,5 L11,1 Z M12,1.533 L12,4 L14.52,4 L12,1.533 Z\"\r\n id=\"Combined-Shape\" fill=\"#293040\" fill-rule=\"nonzero\">\r\n </path>\r\n <polygon id=\"path\" fill=\"#293040\" points=\"8 8 6 8 8.5 5 11 8 9 8 9 12 8 12\"></polygon>\r\n</g>\r\n</svg>`\r\n\r\nexport const TABLE_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-1227.000000, -96.000000)\" fill=\"#293040\">\r\n <g transform=\"translate(407.000000, 93.000000)\">\r\n <path d=\"M820,3 L836,3 L836,19 L820,19 L820,3 Z M821,4 L821,8 L835,8 L835,4 L821,4 Z M821,9 L821,13 L825,\r\n 13 L825,9 L821,9 Z M821,14 L821,18 L825,18 L825,14 L821,14 Z M826,9 L826,13 L830,13 L830,9 L826,9 Z M826,\r\n 14 L826,18 L830,18 L830,14 L826,14 Z M831,9 L831,13 L835,13 L835,9 L831,9 Z M831,14 L831,18 L835,18 L835,\r\n 14 L831,14 Z\"></path>\r\n </g>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const LINK_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-1258.000000, -96.000000)\" fill=\"#293040\" fill-rule=\"nonzero\">\r\n <g transform=\"translate(407.000000, 93.000000)\">\r\n <path d=\"M855.499,13.863 L861.863,7.499 L862.573,8.209 L856.209,14.573 L855.499,13.863 Z M854.646498,9.99452063\r\n C854.661947,10.0108615 854.677673,10.0270363 854.693676,10.0430391 L855.388521,10.7378841 L852.802248,13.3241571\r\n C851.732584,14.3938208 851.732584,16.1280884 852.802248,17.1977522 C853.871912,18.2674159 855.606179,18.2674159\r\n 856.675843,17.1977522 L859.262116,14.6114792 L859.956961,15.3063242 C859.972964,15.3223269 859.989138,15.3380528\r\n 860.005479,15.3535018 L857.468863,17.8901187 C855.989021,19.3699604 853.589723,19.3699604 852.109881,17.8901187\r\n C850.63004,16.4102769 850.63004,14.0109793 852.109881,12.5311375 L854.646498,9.99452063 Z M857.994521,6.64649819\r\n L860.531137,4.10988134 C862.010979,2.63003955 864.410277,2.63003955 865.890119,4.10988134 C867.36996,5.58972313\r\n 867.36996,7.98902073 865.890119,9.46886252 L863.353502,12.0054794 C863.338053,11.9891385 863.322327,11.9729637\r\n 863.306324,11.9569609 L862.611479,11.2621159 L865.197752,8.67584293 C866.267416,7.60617918 866.267416,5.87191157\r\n 865.197752,4.80224782 C864.128088,3.73258406 862.393821,3.73258406 861.324157,4.80224782 L858.737884,7.38852082\r\n L858.043039,6.69367584 C858.027036,6.67767307 858.010862,6.66194719 857.994521,6.64649819 Z\"></path>\r\n </g>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const EMOJI_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <path d=\"M8,16 C3.581722,16 0,12.418278 0,8 C0,3.581722 3.581722,0 8,0 C12.418278,0 16,3.581722 16,8 C16,12.418278\r\n 12.418278,16 8,16 Z M8,15 C11.8659932,15 15,11.8659932 15,8 C15,4.13400675 11.8659932,1 8,1 C4.13400675,1 1,4.13400675\r\n 1,8 C1,11.8659932 4.13400675,15 8,15 Z M5,7 C4.44771525,7 4,6.55228475 4,6 C4,5.44771525 4.44771525,5 5,5 C5.55228475,5\r\n 6,5.44771525 6,6 C6,6.55228475 5.55228475,7 5,7 Z M11,7 C10.4477153,7 10,6.55228475 10,6 C10,5.44771525 10.4477153,5 11,5\r\n C11.5522847,5 12,5.44771525 12,6 C12,6.55228475 11.5522847,7 11,7 Z M4,10 L12,10 C11.5415129,11.7252272 9.9244686,13 8,13\r\n C6.0755314,13 4.45848714,11.7252272 4,10 Z\" fill=\"#293040\"></path>\r\n</g>\r\n</svg>`\r\n\r\nexport const SCREENSHOT_ICON = `<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\" version=\"1.1\">\r\n<g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(-1529.000000, -96.000000)\">\r\n <g transform=\"translate(1529.000000, 96.000000)\">\r\n <rect fill=\"#000000\" fill-rule=\"nonzero\" opacity=\"0\" x=\"0\" y=\"0\" width=\"16\" height=\"16\"></rect>\r\n <polyline stroke=\"currentColor\" points=\"16 14 2 14 2 0 2 0\"></polyline>\r\n <polyline stroke=\"currentColor\" points=\"4 2 14 2 14 12\"></polyline>\r\n <rect fill=\"currentColor\" x=\"0\" y=\"1.5\" width=\"2\" height=\"1\"></rect>\r\n <rect fill=\"currentColor\"\r\n transform=\"translate(14.000000, 15.000000)\r\n rotate(-90.000000)\r\n translate(-14.000000, -15.000000) \" x=\"13\" y=\"14.5\" width=\"2\" height=\"1\">\r\n </rect>\r\n </g>\r\n </g>\r\n</g>\r\n</svg>`\r\n\r\nexport const CODE_ICON = `<svg t=\"1721956397010\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"4254\" width=\"20\" height=\"20\"><path d=\"M438.4 849.1l222.7-646.7c0.2-0.5 0.3-1.1 0.4-1.6L438.4 849.1z\" opacity=\".224\" p-id=\"4255\"></path><path d=\"M661.2 168.7h-67.5c-3.4 0-6.5 2.2-7.6 5.4L354.7 846c-0.3 0.8-0.4 1.7-0.4 2.6 0 4.4 3.6 8 8 8h67.8c3.4 0 6.5-2.2 7.6-5.4l0.7-2.1 223.1-648.3 7.4-21.4c0.3-0.8 0.4-1.7 0.4-2.6-0.1-4.5-3.6-8.1-8.1-8.1zM954.6 502.1c-0.8-1-1.7-1.9-2.7-2.7l-219-171.3c-3.5-2.7-8.5-2.1-11.2 1.4-1.1 1.4-1.7 3.1-1.7 4.9v81.3c0 2.5 1.1 4.8 3.1 6.3l115 90-115 90c-1.9 1.5-3.1 3.8-3.1 6.3v81.3c0 4.4 3.6 8 8 8 1.8 0 3.5-0.6 4.9-1.7l219-171.3c6.9-5.4 8.2-15.5 2.7-22.5zM291.1 328.1l-219 171.3c-1 0.8-1.9 1.7-2.7 2.7-5.4 7-4.2 17 2.7 22.5l219 171.3c1.4 1.1 3.1 1.7 4.9 1.7 4.4 0 8-3.6 8-8v-81.3c0-2.5-1.1-4.8-3.1-6.3l-115-90 115-90c1.9-1.5 3.1-3.8 3.1-6.3v-81.3c0-1.8-0.6-3.5-1.7-4.9-2.7-3.5-7.7-4.1-11.2-1.4z\" p-id=\"4256\"></path></svg>`\r\n\r\nexport const MENTION_ICON = `<i class=\"icon-set-keyword\"></i>`\r\n\r\nexport const QUICK_MENU_ICON = `<i class=\"icon-publish\"></i>`\r\n\r\nexport const SAVE_ICON = `<i class=\"icon-save\"></i>`\r\n\r\nexport const HELP_ICON = `<svg t=\"1721963829631\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"9764\" width=\"20\" height=\"20\"><path d=\"M512 74.666667C270.933333 74.666667 74.666667 270.933333 74.666667 512S270.933333 949.333333 512 949.333333 949.333333 753.066667 949.333333 512 753.066667 74.666667 512 74.666667z m0 810.666666c-204.8 0-373.333333-168.533333-373.333333-373.333333S307.2 138.666667 512 138.666667 885.333333 307.2 885.333333 512 716.8 885.333333 512 885.333333z\" fill=\"#000000\" p-id=\"9765\"></path><path d=\"M512 746.666667m-42.666667 0a42.666667 42.666667 0 1 0 85.333334 0 42.666667 42.666667 0 1 0-85.333334 0Z\" fill=\"#000000\" p-id=\"9766\"></path><path d=\"M512 245.333333c-76.8 0-138.666667 61.866667-138.666667 138.666667 0 17.066667 14.933333 32 32 32s32-14.933333 32-32c0-40.533333 34.133333-74.666667 74.666667-74.666667s74.666667 34.133333 74.666667 74.666667c0 27.733333-53.333333 76.8-91.733334 100.266667-8.533333 6.4-14.933333 17.066667-14.933333 27.733333v106.666667c0 17.066667 14.933333 32 32 32s32-14.933333 32-32v-89.6c34.133333-25.6 106.666667-83.2 106.666667-145.066667 0-76.8-61.866667-138.666667-138.666667-138.666667z\" fill=\"#000000\" p-id=\"9767\"></path></svg>`\r\n\r\nexport const SCROLL_TABLE_ICON = `<i class=\"icon-switch\"></i>`\r\n\r\nexport const GLOBAL_LINK_ICON = `<svg t=\"1721963743677\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8628\" width=\"20\" height=\"20\"><path d=\"M713.130667 283.221333V228.352a9.159111 9.159111 0 0 0-9.130667-9.130667H265.102222a9.159111 9.159111 0 0 0-9.102222 9.130667v54.869333c0 5.034667 4.096 9.130667 9.130667 9.130667H704a9.159111 9.159111 0 0 0 9.130667-9.130667z m-448 100.579556a9.130667 9.130667 0 0 0-9.130667 9.130667v54.869333c0 5.006222 4.096 9.130667 9.130667 9.130667h210.289777a9.159111 9.159111 0 0 0 9.159112-9.130667v-54.869333a9.159111 9.159111 0 0 0-9.159112-9.130667H265.130667z m164.579555 516.551111H164.579556V95.800889h640v279.352889c0 5.034667 4.096 9.159111 9.130666 9.159111h64a9.159111 9.159111 0 0 0 9.130667-9.159111V50.090667c0-20.252444-16.327111-36.579556-36.551111-36.579556H118.840889c-20.195556 0-36.551111 16.327111-36.551111 36.579556v896c0 20.195556 16.327111 36.551111 36.551111 36.551111h310.869333a9.159111 9.159111 0 0 0 9.130667-9.130667v-64a9.159111 9.159111 0 0 0-9.130667-9.159111z\" fill=\"#000000\" fill-opacity=\".85\" p-id=\"8629\"></path><path d=\"M837.859556 656.298667l-107.861334 186.794666-68.977778-39.822222 107.861334-186.794667 68.977778 39.822223z\" fill=\"#000000\" p-id=\"8630\"></path><path d=\"M691.114667 514.844444a159.146667 159.146667 0 0 1 217.315555-58.225777 159.061333 159.061333 0 0 1 58.197334 217.315555l-55.637334 96.369778-68.977778-39.822222 55.637334-96.369778a79.416889 79.416889 0 1 0-137.557334-79.416889l-55.637333 96.369778-68.977778-39.822222 55.637334-96.369778V514.844444z m-28.558223 208.782223l-56.462222 97.792a79.416889 79.416889 0 0 0 137.557334 79.388444l56.462222-97.763555 68.977778 39.822222-56.462223 97.763555a159.061333 159.061333 0 1 1-275.484444-159.061333l56.433778-97.763556 68.977777 39.822223z\" fill=\"#000000\" p-id=\"8631\"></path></svg>`\r\n\r\nexport const FULLSCREEN_ICON = `<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon\" width=\"100%\" height=\"100%\" viewBox=\"0 0 1024 1024\" version=\"1.1\">\r\n <path fill=\"#333333\" d=\"M64 384h96V160h224.2V64H64zM639.8 64v96H864v224h96V64zM864 864H639.8v96H960V639.61h-96zM160 639.61H64V960h320.2v-96H160z\"/>\r\n</svg>`\r\n\r\nexport const FULLSCREEN_EXIT_ICON = `\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\">\r\n <path fill=\"currentColor\" d=\"M6 21v-3H3v-2h5v5zm10 0v-5h5v2h-3v3zM3 8V6h3V3h2v5zm13 0V3h2v3h3v2z\"/>\r\n </svg>\r\n`\r\n\r\nexport const TRIANGLE_DOWN_ICON = `<i class=\"icon-triangle-down\"></i>`\r\n\r\nexport const FORMAT_PAINTER_ICON = `<svg viewBox=\"0 0 32 32\"><path fill=\"currentColor\" d=\"M28.83 23.17L23 17.33V13a1 1 0 0 0-.29-.71l-10-10a1 1 0 0 0-1.42 0l-9 9a1 1 0 0 0 0 1.42l10 10A1 1 0 0 0 13 23h4.34l5.83 5.84a4 4 0 0 0 5.66-5.66ZM6 10.41l2.29 2.3l1.42-1.42L7.41 9L9 7.41l4.29 4.3l1.42-1.42L10.41 6L12 4.41L18.59 11L11 18.59L4.41 12Zm21.41 17a2 2 0 0 1-2.82 0l-6.13-6.12a1.8 1.8 0 0 0-.71-.29h-4.34l-1-1L20 12.41l1 1v4.34a1 1 0 0 0 .29.7l6.12 6.14a2 2 0 0 1 0 2.82\"/></svg>`\r\n\r\nexport const DIVIDER_ICON = `<svg viewBox=\"0 0 18 18\"><line x1=\"0\" y1=\"9\" x2=\"18\" y2=\"9\" stroke=\"currentColor\" stroke-width=\"2\"/></svg>`\r\n"],"names":[],"mappings":";;AAAO,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASlB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASlB,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYnB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAalB,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASpB,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASvB,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAapB,MAAM,aAAa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AA;AAAA;AAWnB,MAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBxB,MAAM,YAAY;AAElB,MAAM,eAAe;AAErB,MAAM,kBAAkB;AAExB,MAAM,YAAY;AAElB,MAAM,YAAY;AAElB,MAAM,oBAAoB;AAE1B,MAAM,mBAAmB;AAEzB,MAAM,kBAAkB;AAAA;AAAA;AAIxB,MAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAM7B,MAAM,qBAAqB;AAE3B,MAAM,sBAAsB;AAE5B,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/fluent-editor",
|
|
3
|
-
"version": "3.25.
|
|
3
|
+
"version": "3.25.2",
|
|
4
4
|
"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.",
|
|
5
5
|
"author": "OpenTiny Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
"vite": "^5.0.0",
|
|
54
54
|
"vite-plugin-dts": "^4.3.0"
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|