cosey 0.9.5 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/audio-card/audio-card.js +1 -1
- package/components/close/close.js +1 -1
- package/components/col/col.api.d.ts +1 -1
- package/components/context-menu/content.js +1 -1
- package/components/dnd-sort/dnd-sort-item.js +1 -1
- package/components/editor/button-group.d.ts +2 -0
- package/components/editor/button-group.js +20 -0
- package/components/editor/button-select.d.ts +14 -0
- package/components/editor/button-select.js +51 -0
- package/components/editor/button-split.d.ts +25 -0
- package/components/editor/button-split.js +68 -0
- package/components/editor/button.d.ts +19 -0
- package/components/editor/button.js +40 -0
- package/components/editor/contents/content-code-block.d.ts +18 -0
- package/components/editor/contents/content-code-block.js +51 -0
- package/components/editor/contents/content-formula.d.ts +12 -0
- package/components/editor/contents/content-formula.js +48 -0
- package/components/editor/contents/content-formula.style.js +14 -0
- package/components/editor/contents/content-image.d.ts +29 -0
- package/components/editor/contents/content-image.js +89 -0
- package/components/editor/{components/list/list.style.d.ts → contents/content-image.style.d.ts} +1 -1
- package/components/editor/contents/content-image.style.js +20 -0
- package/components/editor/contents/content-link.d.ts +16 -0
- package/components/editor/contents/content-link.js +74 -0
- package/components/editor/contents/content-link.stye.d.ts +4 -0
- package/components/editor/contents/content-link.stye.js +17 -0
- package/components/editor/contents/content-list-item.d.ts +21 -0
- package/components/editor/contents/content-list-item.js +41 -0
- package/components/editor/contents/content-list-item.style.d.ts +4 -0
- package/components/editor/contents/content-list-item.style.js +52 -0
- package/components/editor/contents/content-placeholder.d.ts +2 -0
- package/components/editor/contents/content-placeholder.js +24 -0
- package/components/editor/contents/content-placeholder.style.d.ts +4 -0
- package/components/editor/contents/content-placeholder.style.js +19 -0
- package/components/editor/contents/content-table.d.ts +2 -0
- package/components/editor/contents/content-table.js +133 -0
- package/components/editor/contents/content-table.style.d.ts +4 -0
- package/components/editor/contents/content-table.style.js +21 -0
- package/components/editor/contents/content-video.d.ts +26 -0
- package/components/editor/contents/content-video.js +73 -0
- package/components/editor/contents/content-video.style.d.ts +4 -0
- package/components/editor/contents/content-video.style.js +20 -0
- package/components/editor/contents/resize.d.ts +37 -0
- package/components/editor/contents/resize.js +133 -0
- package/components/editor/{components/resize → contents}/resize.style.d.ts +1 -1
- package/components/editor/{components/resize → contents}/resize.style.js +14 -34
- package/components/editor/contents/upload.d.ts +17 -0
- package/components/editor/contents/upload.js +80 -0
- package/components/editor/contents/upload.style.d.ts +4 -0
- package/components/editor/contents/upload.style.js +38 -0
- package/components/editor/contents/widget-popover.d.ts +389 -0
- package/components/editor/contents/widget-popover.js +36 -0
- package/components/editor/contents/widget-popover.style.d.ts +4 -0
- package/components/editor/contents/widget-popover.style.js +15 -0
- package/components/editor/editor.api.d.ts +14 -6
- package/components/editor/editor.api.js +10 -6
- package/components/editor/editor.d.ts +15 -8
- package/components/editor/editor.js +178 -76
- package/components/editor/editor.style.d.ts +5 -1
- package/components/editor/editor.style.js +121 -253
- package/components/editor/{components/color-picker/color-picker.js → formats/color-picker.api.js} +3 -3
- package/components/editor/formats/color-picker.d.ts +20 -0
- package/components/editor/formats/color-picker.js +154 -0
- package/components/editor/{components/color-picker → formats}/color-picker.style.d.ts +1 -1
- package/components/editor/{components/color-picker → formats}/color-picker.style.js +1 -1
- package/components/editor/formats/format-align.d.ts +22 -0
- package/components/editor/formats/format-align.js +38 -0
- package/components/editor/formats/format-background.d.ts +2 -0
- package/components/editor/formats/format-background.js +60 -0
- package/components/editor/formats/format-block-quote.d.ts +2 -0
- package/components/editor/formats/format-block-quote.js +27 -0
- package/components/editor/formats/format-clear.d.ts +2 -0
- package/components/editor/formats/format-clear.js +25 -0
- package/components/editor/formats/format-code-block.d.ts +2 -0
- package/components/editor/formats/format-code-block.js +27 -0
- package/components/editor/formats/format-color.d.ts +2 -0
- package/components/editor/formats/format-color.js +59 -0
- package/components/editor/formats/format-font.d.ts +2 -0
- package/components/editor/formats/format-font.js +46 -0
- package/components/editor/formats/format-formula.d.ts +2 -0
- package/components/editor/formats/format-formula.js +133 -0
- package/components/editor/formats/format-heading.d.ts +2 -0
- package/components/editor/formats/format-heading.js +52 -0
- package/components/editor/formats/format-image.d.ts +2 -0
- package/components/editor/formats/format-image.js +140 -0
- package/components/editor/formats/format-indent.d.ts +20 -0
- package/components/editor/formats/format-indent.js +35 -0
- package/components/editor/formats/format-link.d.ts +2 -0
- package/components/editor/formats/format-link.js +114 -0
- package/components/editor/formats/format-list.d.ts +22 -0
- package/components/editor/formats/format-list.js +39 -0
- package/components/editor/formats/format-mark.d.ts +20 -0
- package/components/editor/formats/format-mark.js +38 -0
- package/components/editor/formats/format-size-delta.d.ts +24 -0
- package/components/editor/formats/format-size-delta.js +43 -0
- package/components/editor/formats/format-size.d.ts +2 -0
- package/components/editor/formats/format-size.js +51 -0
- package/components/editor/formats/format-source.d.ts +2 -0
- package/components/editor/formats/format-source.js +69 -0
- package/components/editor/formats/format-table.d.ts +2 -0
- package/components/editor/formats/format-table.js +85 -0
- package/components/editor/formats/format-table.style.d.ts +4 -0
- package/components/editor/{components/toolbar/formats/table.style.js → formats/format-table.style.js} +2 -2
- package/components/editor/formats/format-video.d.ts +2 -0
- package/components/editor/formats/format-video.js +117 -0
- package/components/editor/formats/picker.d.ts +45 -0
- package/components/editor/formats/picker.js +91 -0
- package/components/editor/{components/picker → formats}/picker.style.d.ts +1 -1
- package/components/editor/{components/picker → formats}/picker.style.js +1 -1
- package/components/editor/formats/select-list.d.ts +28 -0
- package/components/editor/formats/select-list.js +47 -0
- package/components/editor/formats/select-list.style.d.ts +4 -0
- package/components/editor/{components/list/list.style.js → formats/select-list.style.js} +2 -2
- package/components/editor/formats/select.d.ts +32 -0
- package/components/editor/formats/select.js +61 -0
- package/components/editor/hooks/useBlockValueActive.d.ts +1 -0
- package/components/editor/hooks/useBlockValueActive.js +21 -0
- package/components/editor/hooks/useFocus.d.ts +5 -0
- package/components/editor/hooks/useFocus.js +18 -0
- package/components/editor/{components/color-picker → hooks}/useHistoryColor.js +1 -1
- package/components/editor/hooks/useMarkActive.d.ts +1 -0
- package/components/editor/hooks/useMarkActive.js +13 -0
- package/components/editor/hooks/useMarkValue.d.ts +1 -0
- package/components/editor/hooks/useMarkValue.js +21 -0
- package/components/editor/index.d.ts +25 -13
- package/components/editor/index.js +3 -21
- package/components/editor/plugins/align.d.ts +8 -0
- package/components/editor/plugins/align.js +13 -0
- package/components/editor/plugins/background.d.ts +7 -0
- package/components/editor/plugins/background.js +19 -0
- package/components/editor/plugins/block-quote.d.ts +8 -0
- package/components/editor/plugins/block-quote.js +34 -0
- package/components/editor/plugins/clear.d.ts +7 -0
- package/components/editor/plugins/clear.js +53 -0
- package/components/editor/plugins/code-block.d.ts +13 -0
- package/components/editor/plugins/code-block.js +356 -0
- package/components/editor/plugins/color.d.ts +7 -0
- package/components/editor/plugins/color.js +21 -0
- package/components/editor/plugins/font.d.ts +7 -0
- package/components/editor/plugins/font.js +17 -0
- package/components/editor/plugins/formula.d.ts +11 -0
- package/components/editor/{components/toolbar/formats → plugins}/formula.js +50 -1
- package/components/editor/plugins/heading.d.ts +9 -0
- package/components/editor/plugins/heading.js +70 -0
- package/components/editor/plugins/html.d.ts +7 -0
- package/components/editor/plugins/html.js +30 -0
- package/components/editor/plugins/image.d.ts +8 -0
- package/components/editor/plugins/image.js +63 -0
- package/components/editor/plugins/indent.d.ts +7 -0
- package/components/editor/plugins/indent.js +47 -0
- package/components/editor/plugins/index.d.ts +2 -0
- package/components/editor/plugins/index.js +50 -0
- package/components/editor/plugins/keyboard.d.ts +41 -0
- package/components/editor/plugins/keyboard.js +120 -0
- package/components/editor/plugins/link.d.ts +8 -0
- package/components/editor/plugins/link.js +56 -0
- package/components/editor/plugins/list/deserialize.d.ts +3 -0
- package/components/editor/plugins/list/deserialize.js +106 -0
- package/components/editor/plugins/list/format.d.ts +3 -0
- package/components/editor/plugins/list/format.js +155 -0
- package/components/editor/plugins/list/indent.d.ts +2 -0
- package/components/editor/plugins/list/indent.js +38 -0
- package/components/editor/plugins/list/index.d.ts +10 -0
- package/components/editor/plugins/list/index.js +61 -0
- package/components/editor/plugins/list/insert-break.d.ts +2 -0
- package/components/editor/plugins/list/insert-break.js +19 -0
- package/components/editor/plugins/list/normalize.d.ts +3 -0
- package/components/editor/plugins/list/normalize.js +168 -0
- package/components/editor/plugins/list/serialize.d.ts +3 -0
- package/components/editor/plugins/list/serialize.js +63 -0
- package/components/editor/plugins/list/utils.d.ts +6 -0
- package/components/editor/plugins/list/utils.js +24 -0
- package/components/editor/plugins/mark.d.ts +7 -0
- package/components/editor/plugins/mark.js +27 -0
- package/components/editor/plugins/render.d.ts +11 -0
- package/components/editor/plugins/render.js +54 -0
- package/components/editor/plugins/serialize.d.ts +10 -0
- package/components/editor/plugins/serialize.js +342 -0
- package/components/editor/plugins/size.d.ts +8 -0
- package/components/editor/plugins/size.js +47 -0
- package/components/editor/plugins/table.d.ts +21 -0
- package/components/editor/plugins/table.js +702 -0
- package/components/editor/plugins/video.d.ts +8 -0
- package/components/editor/plugins/video.js +40 -0
- package/components/editor/toolbar.d.ts +2 -0
- package/components/editor/toolbar.js +20 -0
- package/components/editor/types.d.ts +194 -0
- package/components/editor/types.js +55 -0
- package/components/editor/usePopoverContainer.d.ts +8 -0
- package/components/editor/usePopoverContainer.js +31 -0
- package/components/editor/utils.d.ts +77 -0
- package/components/editor/utils.js +165 -0
- package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
- package/components/field/components/editor/editor.d.ts +16 -0
- package/components/field/components/editor/editor.vue.d.ts +4 -0
- package/components/field/components/editor/editor.vue.js +21 -0
- package/components/field/components/password/password.vue.js +1 -1
- package/components/field/components/select/select.vue.js +1 -1
- package/components/field/field.api.d.ts +3 -0
- package/components/field/field.api.js +18 -16
- package/components/file-card/file-card.js +1 -1
- package/components/form/form-item.vue.js +2 -2
- package/components/form/form.api.d.ts +3 -3
- package/components/form/form.api.js +1 -1
- package/components/form/form.d.ts +6 -6
- package/components/form/index.d.ts +17 -17
- package/components/form/useBubbleTemplate.js +1 -1
- package/components/form-dialog/form-dialog.api.js +1 -1
- package/components/form-dialog/form-dialog.d.ts +5 -5
- package/components/form-drawer/form-drawer.d.ts +5 -5
- package/components/form-drawer/index.d.ts +15 -15
- package/components/form-group/form-group.js +1 -1
- package/components/form-list/index.d.ts +5 -5
- package/components/form-query/form-query.d.ts +5 -5
- package/components/form-query/form-query.js +1 -1
- package/components/form-query/index.d.ts +15 -15
- package/components/highlight/highlight.api.d.ts +30 -12
- package/components/highlight/highlight.api.js +3 -19
- package/components/highlight/highlight.d.ts +7 -3
- package/components/highlight/highlight.js +6 -6
- package/components/highlight/highlight.style.d.ts +1 -0
- package/components/highlight/highlight.style.js +288 -54
- package/components/highlight/index.d.ts +15 -6
- package/components/highlight/index.js +1 -1
- package/components/icon/icon.api.d.ts +11 -0
- package/components/icon/icon.api.js +10 -0
- package/components/icon/icon.d.ts +16 -5
- package/components/icon/icon.js +59 -0
- package/components/icon/icon.style.d.ts +4 -0
- package/components/icon/{style/index.js → icon.style.js} +1 -1
- package/components/icon/index.d.ts +24 -7
- package/components/icon/index.js +2 -1
- package/components/iconify-icon/iconify-icon.api.d.ts +15 -0
- package/components/iconify-icon/iconify-icon.api.js +20 -0
- package/components/iconify-icon/iconify-icon.d.ts +21 -6
- package/components/iconify-icon/iconify-icon.js +22 -8
- package/components/iconify-icon/index.d.ts +37 -4
- package/components/iconify-icon/index.js +2 -2
- package/components/index.d.ts +1 -0
- package/components/index.js +5 -4
- package/components/input-number-range/index.d.ts +39 -30
- package/components/input-number-range/input-number-range.api.d.ts +10 -10
- package/components/input-number-range/input-number-range.d.ts +23 -20
- package/components/input-number-range/input-number-range.js +1 -1
- package/components/snug-menu/snug-menu-item.vue.js +2 -2
- package/components/stack-dialog/index.d.ts +3 -3
- package/components/stack-dialog/stack-dialog.d.ts +1 -1
- package/components/svg-icon/index.d.ts +16 -4
- package/components/svg-icon/index.js +2 -1
- package/components/svg-icon/svg-icon.api.d.ts +7 -0
- package/components/svg-icon/svg-icon.api.js +7 -0
- package/components/svg-icon/svg-icon.d.ts +10 -3
- package/components/svg-icon/svg-icon.js +18 -0
- package/components/table/index.d.ts +12 -12
- package/components/table/table-column/table-column.js +1 -1
- package/components/table/table-export/table-export.d.ts +5 -5
- package/components/table/table-query/table-query.d.ts +5 -5
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +1 -1
- package/components/table/table.vue.d.ts +7 -7
- package/components/table/table.vue.js +5 -5
- package/components/table-action/item.js +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/upload/index.d.ts +3 -4
- package/components/upload/index.js +0 -1
- package/components/upload/upload-item.js +1 -1
- package/components/upload/upload.api.d.ts +2 -2
- package/components/upload/upload.d.ts +2 -2
- package/components/upload/upload.js +4 -4
- package/components/video-card/video-card.js +1 -1
- package/config/root-config-provider.js +2 -2
- package/{components/upload-context.d.ts → config/upload.d.ts} +2 -2
- package/{components/upload-context.js → config/upload.js} +3 -3
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +2 -0
- package/hooks/useObjectUrl.d.ts +2 -0
- package/hooks/useObjectUrl.js +27 -0
- package/hooks/useSingleUpload.d.ts +15 -0
- package/hooks/useSingleUpload.js +64 -0
- package/layout/layout-menu/style/index.js +1 -1
- package/locale/lang/ar.d.ts +2 -0
- package/locale/lang/ar.js +3 -1
- package/locale/lang/en.d.ts +2 -0
- package/locale/lang/en.js +3 -1
- package/locale/lang/zh-cn.d.ts +2 -0
- package/locale/lang/zh-cn.js +3 -1
- package/package.json +11 -7
- package/utils/array.d.ts +1 -1
- package/utils/browser.d.ts +1 -0
- package/utils/browser.js +3 -2
- package/utils/file.d.ts +5 -0
- package/utils/file.js +24 -1
- package/utils/index.js +2 -2
- package/utils/url.d.ts +4 -0
- package/utils/url.js +10 -0
- package/components/editor/components/button-group.vue.d.ts +0 -12
- package/components/editor/components/button-group.vue.js +0 -19
- package/components/editor/components/button.vue.d.ts +0 -17
- package/components/editor/components/button.vue.js +0 -35
- package/components/editor/components/color-picker/color-picker.vue.d.ts +0 -23
- package/components/editor/components/color-picker/color-picker.vue.js +0 -181
- package/components/editor/components/list/list.d.ts +0 -6
- package/components/editor/components/list/list.vue.d.ts +0 -11
- package/components/editor/components/list/list.vue.js +0 -51
- package/components/editor/components/picker/picker.vue.d.ts +0 -25
- package/components/editor/components/picker/picker.vue.js +0 -95
- package/components/editor/components/resize/resize.d.ts +0 -23
- package/components/editor/components/resize/resize.js +0 -88
- package/components/editor/components/resize/resize.vue.d.ts +0 -2
- package/components/editor/components/resize/resize.vue.js +0 -204
- package/components/editor/components/select-button.vue.d.ts +0 -15
- package/components/editor/components/select-button.vue.js +0 -46
- package/components/editor/components/select.vue.d.ts +0 -14
- package/components/editor/components/select.vue.js +0 -67
- package/components/editor/components/split-button.vue.d.ts +0 -22
- package/components/editor/components/split-button.vue.js +0 -69
- package/components/editor/components/table-toolbar/table-toolbar.style.d.ts +0 -4
- package/components/editor/components/table-toolbar/table-toolbar.style.js +0 -22
- package/components/editor/components/table-toolbar/table-toolbar.vue.d.ts +0 -2
- package/components/editor/components/table-toolbar/table-toolbar.vue.js +0 -182
- package/components/editor/components/toolbar/formats/align.vue.d.ts +0 -5
- package/components/editor/components/toolbar/formats/align.vue.js +0 -52
- package/components/editor/components/toolbar/formats/background.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/background.vue.js +0 -70
- package/components/editor/components/toolbar/formats/blockquote.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/blockquote.vue.js +0 -39
- package/components/editor/components/toolbar/formats/bold.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/bold.vue.js +0 -39
- package/components/editor/components/toolbar/formats/clean.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/clean.vue.js +0 -26
- package/components/editor/components/toolbar/formats/code-block.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/code-block.vue.js +0 -39
- package/components/editor/components/toolbar/formats/code.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/code.vue.js +0 -39
- package/components/editor/components/toolbar/formats/color.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/color.vue.js +0 -69
- package/components/editor/components/toolbar/formats/font.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/font.vue.js +0 -59
- package/components/editor/components/toolbar/formats/formula.d.ts +0 -4
- package/components/editor/components/toolbar/formats/formula.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/formula.vue.js +0 -154
- package/components/editor/components/toolbar/formats/header.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/header.vue.js +0 -68
- package/components/editor/components/toolbar/formats/image.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/image.vue.js +0 -26
- package/components/editor/components/toolbar/formats/indent.vue.d.ts +0 -5
- package/components/editor/components/toolbar/formats/indent.vue.js +0 -36
- package/components/editor/components/toolbar/formats/italic.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/italic.vue.js +0 -39
- package/components/editor/components/toolbar/formats/link.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/link.vue.js +0 -218
- package/components/editor/components/toolbar/formats/list.vue.d.ts +0 -5
- package/components/editor/components/toolbar/formats/list.vue.js +0 -50
- package/components/editor/components/toolbar/formats/script.vue.d.ts +0 -5
- package/components/editor/components/toolbar/formats/script.vue.js +0 -50
- package/components/editor/components/toolbar/formats/size-delta.vue.d.ts +0 -5
- package/components/editor/components/toolbar/formats/size-delta.vue.js +0 -79
- package/components/editor/components/toolbar/formats/size.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/size.vue.js +0 -56
- package/components/editor/components/toolbar/formats/source.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/source.vue.js +0 -78
- package/components/editor/components/toolbar/formats/strike.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/strike.vue.js +0 -39
- package/components/editor/components/toolbar/formats/strikethrough.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/strikethrough.vue.js +0 -39
- package/components/editor/components/toolbar/formats/table.style.d.ts +0 -4
- package/components/editor/components/toolbar/formats/table.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/table.vue.js +0 -100
- package/components/editor/components/toolbar/formats/underline.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/underline.vue.js +0 -39
- package/components/editor/components/toolbar/formats/video.vue.d.ts +0 -2
- package/components/editor/components/toolbar/formats/video.vue.js +0 -123
- package/components/editor/components/toolbar/toolbar.d.ts +0 -36
- package/components/editor/components/toolbar/toolbar.js +0 -137
- package/components/editor/components/toolbar/toolbar.vue.d.ts +0 -3
- package/components/editor/components/toolbar/toolbar.vue.js +0 -130
- package/components/editor/components/toolbar/toolbarContext.d.ts +0 -8
- package/components/editor/components/toolbar/toolbarContext.js +0 -3
- package/components/editor/formats/align.d.ts +0 -2
- package/components/editor/formats/align.js +0 -6
- package/components/editor/formats/font.d.ts +0 -7
- package/components/editor/formats/font.js +0 -36
- package/components/editor/formats/formula.d.ts +0 -9
- package/components/editor/formats/formula.js +0 -29
- package/components/editor/formats/image.d.ts +0 -13
- package/components/editor/formats/image.js +0 -46
- package/components/editor/formats/indent.d.ts +0 -10
- package/components/editor/formats/indent.js +0 -37
- package/components/editor/formats/kbd.d.ts +0 -7
- package/components/editor/formats/kbd.js +0 -13
- package/components/editor/formats/link.d.ts +0 -28
- package/components/editor/formats/link.js +0 -51
- package/components/editor/formats/list.d.ts +0 -13
- package/components/editor/formats/list.js +0 -57
- package/components/editor/formats/size.d.ts +0 -3
- package/components/editor/formats/size.js +0 -9
- package/components/editor/formats/video.d.ts +0 -16
- package/components/editor/formats/video.js +0 -44
- package/components/editor/modules/custom-list.d.ts +0 -5
- package/components/editor/modules/custom-list.js +0 -23
- package/components/editor/modules/image-uploader/formats/image-loading.d.ts +0 -16
- package/components/editor/modules/image-uploader/formats/image-loading.js +0 -31
- package/components/editor/modules/image-uploader/formats/image-loading.style.d.ts +0 -2
- package/components/editor/modules/image-uploader/formats/image-loading.style.js +0 -46
- package/components/editor/modules/image-uploader/image-uploader.d.ts +0 -18
- package/components/editor/modules/image-uploader/image-uploader.js +0 -134
- package/components/editor/modules/syntax/index.d.ts +0 -2
- package/components/editor/modules/syntax/index.js +0 -1
- package/components/editor/modules/syntax/syntaxOptions.d.ts +0 -8
- package/components/editor/modules/syntax/syntaxOptions.js +0 -23
- package/components/editor/quill.d.ts +0 -1
- package/components/editor/quill.js +0 -33
- package/components/editor/quillContext.d.ts +0 -6
- package/components/editor/quillContext.js +0 -3
- package/components/icon/icon.vue.d.ts +0 -13
- package/components/icon/icon.vue.js +0 -76
- package/components/iconify-icon/iconify-icon.vue.d.ts +0 -3
- package/components/iconify-icon/iconify-icon.vue.js +0 -38
- package/components/svg-icon/svg-icon.vue.d.ts +0 -3
- package/components/svg-icon/svg-icon.vue.js +0 -29
- /package/components/{icon/style/index.d.ts → editor/contents/content-formula.style.d.ts} +0 -0
- /package/components/editor/{components/color-picker/color-picker.d.ts → formats/color-picker.api.d.ts} +0 -0
- /package/components/editor/{components/picker/picker.d.ts → formats/picker.api.d.ts} +0 -0
- /package/components/editor/{components/picker/picker.js → formats/picker.api.js} +0 -0
- /package/components/editor/{components/color-picker → hooks}/useHistoryColor.d.ts +0 -0
- /package/components/{editor/components/list/list.js → field/components/editor/editor.js} +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import katex from 'katex';
|
|
2
|
-
import Embed from 'quill/blots/embed';
|
|
3
|
-
|
|
4
|
-
class Formula extends Embed {
|
|
5
|
-
static blotName = "formula";
|
|
6
|
-
static className = "ql-formula";
|
|
7
|
-
static tagName = "SPAN";
|
|
8
|
-
static create(value) {
|
|
9
|
-
const node = super.create(value);
|
|
10
|
-
if (typeof value === "string") {
|
|
11
|
-
katex.render(value, node, {
|
|
12
|
-
throwOnError: false,
|
|
13
|
-
errorColor: "#f00",
|
|
14
|
-
output: "mathml"
|
|
15
|
-
});
|
|
16
|
-
node.setAttribute("data-value", value);
|
|
17
|
-
}
|
|
18
|
-
return node;
|
|
19
|
-
}
|
|
20
|
-
static value(domNode) {
|
|
21
|
-
return domNode.getAttribute("data-value");
|
|
22
|
-
}
|
|
23
|
-
html() {
|
|
24
|
-
const { formula } = this.value();
|
|
25
|
-
return `<span class="${Formula.className}" data-value="${formula}"></span>`;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { Formula };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Parchment } from 'quill';
|
|
2
|
-
declare class Image extends Parchment.EmbedBlot {
|
|
3
|
-
static blotName: string;
|
|
4
|
-
static tagName: string;
|
|
5
|
-
static create(value: string): Element;
|
|
6
|
-
static formats(domNode: Element): Record<string, string | null>;
|
|
7
|
-
static match(url: string): boolean;
|
|
8
|
-
static sanitize(url: string): string;
|
|
9
|
-
static value(domNode: Element): string | null;
|
|
10
|
-
domNode: HTMLImageElement;
|
|
11
|
-
format(name: string, value: string): void;
|
|
12
|
-
}
|
|
13
|
-
export default Image;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { sanitize } from './link.js';
|
|
2
|
-
import { Parchment } from 'quill';
|
|
3
|
-
|
|
4
|
-
const ATTRIBUTES = ["alt", "height", "width", "style"];
|
|
5
|
-
class Image extends Parchment.EmbedBlot {
|
|
6
|
-
static blotName = "image";
|
|
7
|
-
static tagName = "IMG";
|
|
8
|
-
static create(value) {
|
|
9
|
-
const node = super.create(value);
|
|
10
|
-
if (typeof value === "string") {
|
|
11
|
-
node.setAttribute("src", this.sanitize(value));
|
|
12
|
-
}
|
|
13
|
-
return node;
|
|
14
|
-
}
|
|
15
|
-
static formats(domNode) {
|
|
16
|
-
return ATTRIBUTES.reduce((formats, attribute) => {
|
|
17
|
-
if (domNode.hasAttribute(attribute)) {
|
|
18
|
-
formats[attribute] = domNode.getAttribute(attribute);
|
|
19
|
-
}
|
|
20
|
-
return formats;
|
|
21
|
-
}, {});
|
|
22
|
-
}
|
|
23
|
-
static match(url) {
|
|
24
|
-
return /\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url);
|
|
25
|
-
}
|
|
26
|
-
static sanitize(url) {
|
|
27
|
-
return sanitize(url, ["http", "https", "data"]) ? url : "//:0";
|
|
28
|
-
}
|
|
29
|
-
static value(domNode) {
|
|
30
|
-
return domNode.getAttribute("src");
|
|
31
|
-
}
|
|
32
|
-
format(name, value) {
|
|
33
|
-
if (ATTRIBUTES.indexOf(name) > -1) {
|
|
34
|
-
if (value) {
|
|
35
|
-
this.domNode.setAttribute(name, value);
|
|
36
|
-
} else {
|
|
37
|
-
this.domNode.removeAttribute(name);
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
super.format(name, value);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
var stdin_default = Image;
|
|
45
|
-
|
|
46
|
-
export { stdin_default as default };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Parchment } from 'quill';
|
|
2
|
-
export declare const INDENT_STEP = 3;
|
|
3
|
-
declare class IndentAttributor extends Parchment.StyleAttributor {
|
|
4
|
-
normalize(value: number): number | undefined;
|
|
5
|
-
add(node: HTMLElement, value: string | number): boolean;
|
|
6
|
-
canAdd(node: HTMLElement, value: string): boolean;
|
|
7
|
-
value(node: HTMLElement): number | undefined;
|
|
8
|
-
}
|
|
9
|
-
declare const IndentStyle: IndentAttributor;
|
|
10
|
-
export { IndentStyle };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Parchment } from 'quill';
|
|
2
|
-
|
|
3
|
-
const INDENT_STEP = 3;
|
|
4
|
-
class IndentAttributor extends Parchment.StyleAttributor {
|
|
5
|
-
normalize(value) {
|
|
6
|
-
if (!value) {
|
|
7
|
-
return void 0;
|
|
8
|
-
}
|
|
9
|
-
return Math.ceil(value / INDENT_STEP) * INDENT_STEP;
|
|
10
|
-
}
|
|
11
|
-
add(node, value) {
|
|
12
|
-
let normalizedValue = 0;
|
|
13
|
-
if (value === "+1" || value === "-1") {
|
|
14
|
-
const indent = this.value(node) || 0;
|
|
15
|
-
normalizedValue = value === "+1" ? indent + INDENT_STEP : indent - INDENT_STEP;
|
|
16
|
-
} else if (typeof value === "number") {
|
|
17
|
-
normalizedValue = value;
|
|
18
|
-
}
|
|
19
|
-
if (normalizedValue <= 0) {
|
|
20
|
-
this.remove(node);
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
return super.add(node, `${normalizedValue}em`);
|
|
24
|
-
}
|
|
25
|
-
canAdd(node, value) {
|
|
26
|
-
return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));
|
|
27
|
-
}
|
|
28
|
-
value(node) {
|
|
29
|
-
return this.normalize(parseInt(super.value(node), 10));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const IndentStyle = new IndentAttributor("indent", "padding-inline-start", {
|
|
33
|
-
scope: Parchment.Scope.BLOCK,
|
|
34
|
-
whitelist: Array(INDENT_STEP * 9).fill(0).map((_, i) => i + 1)
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export { INDENT_STEP, IndentStyle };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Inline from 'quill/blots/inline';
|
|
2
|
-
|
|
3
|
-
class Kbd extends Inline {
|
|
4
|
-
static blotName = "kbd";
|
|
5
|
-
static tagName = "KBD";
|
|
6
|
-
static create() {
|
|
7
|
-
const node = super.create();
|
|
8
|
-
return node;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
var stdin_default = Kbd;
|
|
12
|
-
|
|
13
|
-
export { stdin_default as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import Inline from 'quill/blots/inline';
|
|
2
|
-
interface LinkValue {
|
|
3
|
-
href: string | null;
|
|
4
|
-
title: string | null;
|
|
5
|
-
target: string | null;
|
|
6
|
-
}
|
|
7
|
-
declare class Link extends Inline {
|
|
8
|
-
static blotName: string;
|
|
9
|
-
static tagName: string;
|
|
10
|
-
static SANITIZED_URL: string;
|
|
11
|
-
static PROTOCOL_WHITELIST: string[];
|
|
12
|
-
static create(value: LinkValue): HTMLElement;
|
|
13
|
-
static formats(domNode: HTMLElement): {
|
|
14
|
-
href: string | null;
|
|
15
|
-
title: string | null;
|
|
16
|
-
target: string | null;
|
|
17
|
-
};
|
|
18
|
-
static sanitize(url: string): string;
|
|
19
|
-
static toggleAttribute(domNode: HTMLElement, attrName: string, attrValue: any): void;
|
|
20
|
-
static setAttributes(domNode: HTMLElement, value: LinkValue): void;
|
|
21
|
-
format(name: string, value: {
|
|
22
|
-
href: string | null;
|
|
23
|
-
title: string | null;
|
|
24
|
-
target: string | null;
|
|
25
|
-
}): void;
|
|
26
|
-
}
|
|
27
|
-
declare function sanitize(url: string, protocols: string[]): boolean;
|
|
28
|
-
export { Link, sanitize };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import Inline from 'quill/blots/inline';
|
|
2
|
-
|
|
3
|
-
class Link extends Inline {
|
|
4
|
-
static blotName = "link";
|
|
5
|
-
static tagName = "A";
|
|
6
|
-
static SANITIZED_URL = "about:blank";
|
|
7
|
-
static PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel", "sms"];
|
|
8
|
-
static create(value) {
|
|
9
|
-
const node = super.create(value);
|
|
10
|
-
this.setAttributes(node, value);
|
|
11
|
-
return node;
|
|
12
|
-
}
|
|
13
|
-
static formats(domNode) {
|
|
14
|
-
return {
|
|
15
|
-
href: domNode.getAttribute("href"),
|
|
16
|
-
title: domNode.getAttribute("title"),
|
|
17
|
-
target: domNode.getAttribute("target")
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
static sanitize(url) {
|
|
21
|
-
return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
|
|
22
|
-
}
|
|
23
|
-
static toggleAttribute(domNode, attrName, attrValue) {
|
|
24
|
-
if (!attrValue) {
|
|
25
|
-
domNode.removeAttribute(attrName);
|
|
26
|
-
} else {
|
|
27
|
-
domNode.setAttribute(attrName, attrValue);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
static setAttributes(domNode, value) {
|
|
31
|
-
this.toggleAttribute(domNode, "href", value.href);
|
|
32
|
-
this.toggleAttribute(domNode, "title", value.title);
|
|
33
|
-
this.toggleAttribute(domNode, "target", value.target);
|
|
34
|
-
this.toggleAttribute(domNode, "rel", value.target === "_blank" ? "noopener noreferrer" : "");
|
|
35
|
-
}
|
|
36
|
-
format(name, value) {
|
|
37
|
-
if (name !== this.statics.blotName || !value) {
|
|
38
|
-
super.format(name, value);
|
|
39
|
-
} else {
|
|
40
|
-
Link.setAttributes(this.domNode, value);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function sanitize(url, protocols) {
|
|
45
|
-
const anchor = document.createElement("a");
|
|
46
|
-
anchor.href = url;
|
|
47
|
-
const protocol = anchor.href.slice(0, anchor.href.indexOf(":"));
|
|
48
|
-
return protocols.indexOf(protocol) > -1;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { Link, sanitize };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Block from 'quill/blots/block';
|
|
2
|
-
import Container from 'quill/blots/container';
|
|
3
|
-
import type Scroll from 'quill/blots/scroll';
|
|
4
|
-
declare class ListContainer extends Container {
|
|
5
|
-
}
|
|
6
|
-
declare class ListItem extends Block {
|
|
7
|
-
static create(value: string): HTMLElement;
|
|
8
|
-
static formats(domNode: HTMLElement): string | undefined;
|
|
9
|
-
static register(): void;
|
|
10
|
-
constructor(scroll: Scroll, domNode: HTMLElement);
|
|
11
|
-
format(name: string, value: string): void;
|
|
12
|
-
}
|
|
13
|
-
export { ListContainer, ListItem as default };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import Block from 'quill/blots/block';
|
|
2
|
-
import Container from 'quill/blots/container';
|
|
3
|
-
import Quill from 'quill/core/quill';
|
|
4
|
-
import { IndentStyle, INDENT_STEP } from './indent.js';
|
|
5
|
-
|
|
6
|
-
class ListContainer extends Container {
|
|
7
|
-
}
|
|
8
|
-
ListContainer.blotName = "list-container";
|
|
9
|
-
ListContainer.tagName = "OL";
|
|
10
|
-
class ListItem extends Block {
|
|
11
|
-
static create(value) {
|
|
12
|
-
const node = super.create();
|
|
13
|
-
node.setAttribute("data-list", value);
|
|
14
|
-
return node;
|
|
15
|
-
}
|
|
16
|
-
static formats(domNode) {
|
|
17
|
-
return domNode.getAttribute("data-list") || void 0;
|
|
18
|
-
}
|
|
19
|
-
static register() {
|
|
20
|
-
Quill.register(ListContainer);
|
|
21
|
-
}
|
|
22
|
-
constructor(scroll, domNode) {
|
|
23
|
-
super(scroll, domNode);
|
|
24
|
-
const ui = domNode.ownerDocument.createElement("span");
|
|
25
|
-
const listEventHandler = (e) => {
|
|
26
|
-
if (!scroll.isEnabled()) return;
|
|
27
|
-
const format = this.statics.formats(domNode, scroll);
|
|
28
|
-
if (format === "checked") {
|
|
29
|
-
this.format("list", "unchecked");
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
} else if (format === "unchecked") {
|
|
32
|
-
this.format("list", "checked");
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
ui.addEventListener("mousedown", listEventHandler);
|
|
37
|
-
ui.addEventListener("touchstart", listEventHandler);
|
|
38
|
-
this.attachUI(ui);
|
|
39
|
-
}
|
|
40
|
-
format(name, value) {
|
|
41
|
-
if (name === this.statics.blotName && value) {
|
|
42
|
-
this.domNode.setAttribute("data-list", value);
|
|
43
|
-
} else {
|
|
44
|
-
if (name === IndentStyle.attrName) {
|
|
45
|
-
super.format(name, +value * INDENT_STEP);
|
|
46
|
-
} else {
|
|
47
|
-
super.format(name, value);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
ListItem.blotName = "list";
|
|
53
|
-
ListItem.tagName = "LI";
|
|
54
|
-
ListContainer.allowedChildren = [ListItem];
|
|
55
|
-
ListItem.requiredContainer = ListContainer;
|
|
56
|
-
|
|
57
|
-
export { ListContainer, ListItem as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Parchment } from 'quill';
|
|
2
|
-
|
|
3
|
-
const sizes = Array(100).fill(0).map((_, i) => i + 1 + "px");
|
|
4
|
-
const SizeStyle = new Parchment.StyleAttributor("size", "font-size", {
|
|
5
|
-
scope: Parchment.Scope.INLINE,
|
|
6
|
-
whitelist: sizes
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export { SizeStyle, sizes };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BlockEmbed } from 'quill/blots/block';
|
|
2
|
-
interface VideoValue {
|
|
3
|
-
url: string;
|
|
4
|
-
width: string;
|
|
5
|
-
height: string;
|
|
6
|
-
}
|
|
7
|
-
declare class Video extends BlockEmbed {
|
|
8
|
-
static blotName: string;
|
|
9
|
-
static tagName: string;
|
|
10
|
-
static create(value: VideoValue): Element;
|
|
11
|
-
static formats(domNode: Element): Record<string, string | null>;
|
|
12
|
-
static sanitize(url: string): string;
|
|
13
|
-
static value(domNode: Element): string | null;
|
|
14
|
-
format(name: string, value: string): void;
|
|
15
|
-
}
|
|
16
|
-
export default Video;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { BlockEmbed } from 'quill/blots/block';
|
|
2
|
-
import { Link } from './link.js';
|
|
3
|
-
|
|
4
|
-
const ATTRIBUTES = ["height", "width", "src", "controls", "style"];
|
|
5
|
-
class Video extends BlockEmbed {
|
|
6
|
-
static blotName = "video";
|
|
7
|
-
static tagName = "VIDEO";
|
|
8
|
-
static create(value) {
|
|
9
|
-
const node = super.create(value);
|
|
10
|
-
node.setAttribute("controls", "true");
|
|
11
|
-
node.setAttribute("src", this.sanitize(value.url));
|
|
12
|
-
node.setAttribute("width", value.width);
|
|
13
|
-
node.setAttribute("height", value.height);
|
|
14
|
-
return node;
|
|
15
|
-
}
|
|
16
|
-
static formats(domNode) {
|
|
17
|
-
return ATTRIBUTES.reduce((formats, attribute) => {
|
|
18
|
-
if (domNode.hasAttribute(attribute)) {
|
|
19
|
-
formats[attribute] = domNode.getAttribute(attribute);
|
|
20
|
-
}
|
|
21
|
-
return formats;
|
|
22
|
-
}, {});
|
|
23
|
-
}
|
|
24
|
-
static sanitize(url) {
|
|
25
|
-
return Link.sanitize(url);
|
|
26
|
-
}
|
|
27
|
-
static value(domNode) {
|
|
28
|
-
return domNode.getAttribute("src");
|
|
29
|
-
}
|
|
30
|
-
format(name, value) {
|
|
31
|
-
if (ATTRIBUTES.indexOf(name) > -1) {
|
|
32
|
-
if (value) {
|
|
33
|
-
this.domNode.setAttribute(name, value);
|
|
34
|
-
} else {
|
|
35
|
-
this.domNode.removeAttribute(name);
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
super.format(name, value);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
var stdin_default = Video;
|
|
43
|
-
|
|
44
|
-
export { stdin_default as default };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import Quill, { Module } from 'quill';
|
|
2
|
-
|
|
3
|
-
class CustomList extends Module {
|
|
4
|
-
constructor(quill) {
|
|
5
|
-
super(quill);
|
|
6
|
-
quill.keyboard.bindings["Enter"].unshift({
|
|
7
|
-
key: "Enter",
|
|
8
|
-
format: ["olist", "ulist"],
|
|
9
|
-
collapsed: true,
|
|
10
|
-
empty: true,
|
|
11
|
-
handler(range, context) {
|
|
12
|
-
const formats = { olist: false, ulist: false };
|
|
13
|
-
if (context.format.indent) {
|
|
14
|
-
formats.indent = false;
|
|
15
|
-
}
|
|
16
|
-
this.quill.formatLine(range.index, range.length, formats, Quill.sources.USER);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
var stdin_default = CustomList;
|
|
22
|
-
|
|
23
|
-
export { stdin_default as default };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Embed from 'quill/blots/embed';
|
|
2
|
-
export declare class ImageLoading extends Embed {
|
|
3
|
-
static blotName: string;
|
|
4
|
-
static className: string;
|
|
5
|
-
static tagName: string;
|
|
6
|
-
static create({ src, id }: {
|
|
7
|
-
src: string;
|
|
8
|
-
id: string;
|
|
9
|
-
}): HTMLElement;
|
|
10
|
-
static createLoading(): HTMLDivElement;
|
|
11
|
-
deleteAt(index: number, length: number): void;
|
|
12
|
-
static value(domNode: HTMLElement): {
|
|
13
|
-
src: string | undefined;
|
|
14
|
-
custom: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import Embed from 'quill/blots/embed';
|
|
2
|
-
|
|
3
|
-
class ImageLoading extends Embed {
|
|
4
|
-
static blotName = "imageLoading";
|
|
5
|
-
static className = "co-editor-image-loading";
|
|
6
|
-
static tagName = "SPAN";
|
|
7
|
-
static create({ src, id }) {
|
|
8
|
-
const node = super.create();
|
|
9
|
-
node.id = id;
|
|
10
|
-
const image = document.createElement("img");
|
|
11
|
-
image.setAttribute("src", src);
|
|
12
|
-
node.appendChild(image);
|
|
13
|
-
const loading = this.createLoading();
|
|
14
|
-
node.appendChild(loading);
|
|
15
|
-
return node;
|
|
16
|
-
}
|
|
17
|
-
static createLoading() {
|
|
18
|
-
const box = document.createElement("div");
|
|
19
|
-
box.innerHTML = '<svg viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none"></circle></svg>';
|
|
20
|
-
return box;
|
|
21
|
-
}
|
|
22
|
-
deleteAt(index, length) {
|
|
23
|
-
super.deleteAt(index, length);
|
|
24
|
-
}
|
|
25
|
-
static value(domNode) {
|
|
26
|
-
const { src, custom } = domNode.dataset;
|
|
27
|
-
return { src, custom };
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { ImageLoading };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { getGlobalStyleHook } from '../../../../theme/getGlobalStyleHook.js';
|
|
2
|
-
import { spinner, rotation } from '../../../../style/animation.js';
|
|
3
|
-
|
|
4
|
-
var stdin_default = getGlobalStyleHook("EditorImageLoading", (token) => {
|
|
5
|
-
return {
|
|
6
|
-
".co-editor-image-loading": {
|
|
7
|
-
position: "relative",
|
|
8
|
-
display: "inline-block",
|
|
9
|
-
img: {
|
|
10
|
-
maxWidth: "98%",
|
|
11
|
-
filter: "blur(5px)",
|
|
12
|
-
opacity: 0.3,
|
|
13
|
-
pointerEvents: "none"
|
|
14
|
-
},
|
|
15
|
-
div: {
|
|
16
|
-
position: "absolute",
|
|
17
|
-
insetBlockStart: "50%",
|
|
18
|
-
width: "100%",
|
|
19
|
-
marginBlockStart: -20,
|
|
20
|
-
textAlign: "center",
|
|
21
|
-
svg: {
|
|
22
|
-
display: "inline",
|
|
23
|
-
height: 42,
|
|
24
|
-
width: 42,
|
|
25
|
-
animationName: rotation,
|
|
26
|
-
animationDuration: "2s",
|
|
27
|
-
animationTimingFunction: "linear",
|
|
28
|
-
animationIterationCount: "infinite",
|
|
29
|
-
circle: {
|
|
30
|
-
animationName: spinner,
|
|
31
|
-
animationDuration: "1.5s",
|
|
32
|
-
animationTimingFunction: "ease-in-out",
|
|
33
|
-
animationIterationCount: "infinite",
|
|
34
|
-
strokeDasharray: "90, 150",
|
|
35
|
-
strokeDashoffset: 0,
|
|
36
|
-
strokeWidth: 2,
|
|
37
|
-
stroke: token.colorPrimary,
|
|
38
|
-
strokeLinecap: "round"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export { stdin_default as default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import Quill, { Module, Parchment } from 'quill';
|
|
2
|
-
export interface ImageUploaderOptions {
|
|
3
|
-
upload: (file: File) => Promise<string>;
|
|
4
|
-
}
|
|
5
|
-
export declare class ImageUploader extends Module<ImageUploaderOptions> {
|
|
6
|
-
static DEFAULTS: ImageUploaderOptions;
|
|
7
|
-
static register(): void;
|
|
8
|
-
options: ImageUploaderOptions;
|
|
9
|
-
mapFile: WeakMap<File, Parchment.Blot | null>;
|
|
10
|
-
constructor(quill: Quill, options: ImageUploaderOptions);
|
|
11
|
-
selectLocalImage: () => void;
|
|
12
|
-
handleDrop: (evt: DragEvent) => void;
|
|
13
|
-
handlePaste: (evt: ClipboardEvent) => void;
|
|
14
|
-
readAndUploadFile(file: File): void;
|
|
15
|
-
insertBase64Image(file: File, url: string): void;
|
|
16
|
-
insertToEditor(file: File, url: string): void;
|
|
17
|
-
removeBase64Image(file: File): number;
|
|
18
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import Quill, { Module } from 'quill';
|
|
2
|
-
import { ImageLoading } from './formats/image-loading.js';
|
|
3
|
-
import { chooseFiles, readAsDataURL } from '../../../../utils/file.js';
|
|
4
|
-
import { uniqid } from '../../../../utils/string.js';
|
|
5
|
-
|
|
6
|
-
const IMAGE_MIME_REGEX = /^image\/(jpe?g|gif|png|svg|webp)$/i;
|
|
7
|
-
class ImageUploader extends Module {
|
|
8
|
-
static DEFAULTS;
|
|
9
|
-
static register() {
|
|
10
|
-
Quill.register(ImageLoading, true);
|
|
11
|
-
}
|
|
12
|
-
options;
|
|
13
|
-
mapFile = /* @__PURE__ */ new WeakMap();
|
|
14
|
-
constructor(quill, options) {
|
|
15
|
-
super(quill, options);
|
|
16
|
-
this.quill = quill;
|
|
17
|
-
this.options = options;
|
|
18
|
-
if (typeof this.options.upload !== "function")
|
|
19
|
-
console.warn("[Missing config] upload function that returns a promise is required");
|
|
20
|
-
const toolbar = this.quill.getModule("toolbar");
|
|
21
|
-
if (toolbar) {
|
|
22
|
-
toolbar.addHandler("image", this.selectLocalImage);
|
|
23
|
-
}
|
|
24
|
-
this.quill.root.addEventListener("drop", this.handleDrop, false);
|
|
25
|
-
this.quill.root.addEventListener("paste", this.handlePaste, false);
|
|
26
|
-
}
|
|
27
|
-
selectLocalImage = () => {
|
|
28
|
-
chooseFiles({
|
|
29
|
-
accept: "image/*",
|
|
30
|
-
multiple: false
|
|
31
|
-
}).then((files) => {
|
|
32
|
-
files.forEach((file) => {
|
|
33
|
-
this.readAndUploadFile(file);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
handleDrop = (evt) => {
|
|
38
|
-
if (evt.dataTransfer && evt.dataTransfer.files && evt.dataTransfer.files.length) {
|
|
39
|
-
evt.stopPropagation();
|
|
40
|
-
evt.preventDefault();
|
|
41
|
-
if (document.caretRangeFromPoint) {
|
|
42
|
-
const selection = document.getSelection();
|
|
43
|
-
const range = document.caretRangeFromPoint(evt.clientX, evt.clientY);
|
|
44
|
-
if (selection && range) {
|
|
45
|
-
selection.setBaseAndExtent(
|
|
46
|
-
range.startContainer,
|
|
47
|
-
range.startOffset,
|
|
48
|
-
range.startContainer,
|
|
49
|
-
range.startOffset
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
const selection = document.getSelection();
|
|
54
|
-
const range = document.caretPositionFromPoint(evt.clientX, evt.clientY);
|
|
55
|
-
if (selection && range) {
|
|
56
|
-
selection.setBaseAndExtent(
|
|
57
|
-
range.offsetNode,
|
|
58
|
-
range.offset,
|
|
59
|
-
range.offsetNode,
|
|
60
|
-
range.offset
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
Array.from(evt.dataTransfer.files).forEach((file) => {
|
|
65
|
-
if (IMAGE_MIME_REGEX.test(file.type)) {
|
|
66
|
-
this.readAndUploadFile(file);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
handlePaste = (evt) => {
|
|
72
|
-
const clipboard = evt.clipboardData;
|
|
73
|
-
if (clipboard && clipboard.files) {
|
|
74
|
-
const files = clipboard.files;
|
|
75
|
-
for (let i = 0; i < files.length; i++) {
|
|
76
|
-
const file = files[i];
|
|
77
|
-
if (IMAGE_MIME_REGEX.test(file.type)) {
|
|
78
|
-
this.readAndUploadFile(file);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
readAndUploadFile(file) {
|
|
84
|
-
if (IMAGE_MIME_REGEX.test(file.type)) {
|
|
85
|
-
this.mapFile.set(file, null);
|
|
86
|
-
readAsDataURL(file).then((result) => {
|
|
87
|
-
this.insertBase64Image(file, result);
|
|
88
|
-
this.options.upload(file).then((imageUrl) => {
|
|
89
|
-
this.insertToEditor(file, imageUrl);
|
|
90
|
-
}).catch(() => {
|
|
91
|
-
this.removeBase64Image(file);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
insertBase64Image(file, url) {
|
|
97
|
-
const range = this.quill.getSelection(true);
|
|
98
|
-
const id = uniqid();
|
|
99
|
-
this.quill.insertEmbed(
|
|
100
|
-
range.index,
|
|
101
|
-
ImageLoading.blotName,
|
|
102
|
-
{
|
|
103
|
-
src: `${url}`,
|
|
104
|
-
id
|
|
105
|
-
},
|
|
106
|
-
Quill.sources.USER
|
|
107
|
-
);
|
|
108
|
-
const node = this.quill.container.querySelector(`#${id}`);
|
|
109
|
-
const blot = Quill.find(node);
|
|
110
|
-
this.mapFile.set(file, blot);
|
|
111
|
-
range.index++;
|
|
112
|
-
this.quill.setSelection(range, Quill.sources.USER);
|
|
113
|
-
}
|
|
114
|
-
insertToEditor(file, url) {
|
|
115
|
-
const blot = this.mapFile.get(file);
|
|
116
|
-
if (!blot || !blot.domNode.isConnected) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const beforeRange = this.quill.getSelection(true);
|
|
120
|
-
const index = this.removeBase64Image(file);
|
|
121
|
-
this.quill.insertEmbed(index, "image", `${url}`, Quill.sources.USER);
|
|
122
|
-
if (beforeRange) {
|
|
123
|
-
this.quill.setSelection(beforeRange, Quill.sources.USER);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
removeBase64Image(file) {
|
|
127
|
-
const blot = this.mapFile.get(file);
|
|
128
|
-
const index = this.quill.getIndex(blot);
|
|
129
|
-
this.quill.deleteText(index, 1, Quill.sources.USER);
|
|
130
|
-
return index;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export { ImageUploader };
|