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,181 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, createBlock, openBlock, unref, withCtx, renderSlot, createElementVNode, normalizeClass, toDisplayString, createElementBlock, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode } from 'vue';
|
|
2
|
-
import stdin_default$2 from '../picker/picker.vue.js';
|
|
3
|
-
import stdin_default$1 from './color-picker.style.js';
|
|
4
|
-
import { colorNames, colorPalettes } from './color-picker.js';
|
|
5
|
-
import { Icon as _Icon } from '../../../icon/index.js';
|
|
6
|
-
import { ElInput } from 'element-plus';
|
|
7
|
-
import { TinyColor } from '@ctrl/tinycolor';
|
|
8
|
-
import { useHistoryColor } from './useHistoryColor.js';
|
|
9
|
-
import { useComponentConfig } from '../../../config-provider/config-provider.api.js';
|
|
10
|
-
import { useLocale } from '../../../../hooks/useLocale.js';
|
|
11
|
-
|
|
12
|
-
const _hoisted_1 = ["onClick"];
|
|
13
|
-
const _hoisted_2 = ["onClick"];
|
|
14
|
-
var stdin_default = /* @__PURE__ */defineComponent({
|
|
15
|
-
__name: "color-picker",
|
|
16
|
-
props: {
|
|
17
|
-
visible: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
required: false
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
emits: ["update:visible", "select", "clear"],
|
|
23
|
-
setup(__props, {
|
|
24
|
-
emit: __emit
|
|
25
|
-
}) {
|
|
26
|
-
const props = __props;
|
|
27
|
-
const emit = __emit;
|
|
28
|
-
const {
|
|
29
|
-
prefixCls
|
|
30
|
-
} = useComponentConfig("editor-color-picker");
|
|
31
|
-
const {
|
|
32
|
-
hashId
|
|
33
|
-
} = stdin_default$1(prefixCls);
|
|
34
|
-
const {
|
|
35
|
-
t
|
|
36
|
-
} = useLocale();
|
|
37
|
-
const innerVisible = computed({
|
|
38
|
-
get() {
|
|
39
|
-
return props.visible;
|
|
40
|
-
},
|
|
41
|
-
set(visible) {
|
|
42
|
-
emit("update:visible", visible);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const inputColor = ref("");
|
|
46
|
-
const {
|
|
47
|
-
historyColors,
|
|
48
|
-
pushHistory
|
|
49
|
-
} = useHistoryColor();
|
|
50
|
-
const mapHistoryColors = computed(() => {
|
|
51
|
-
return Array(colorNames.length).fill(0).map((_, i) => {
|
|
52
|
-
return historyColors.value[i] || "";
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
const normalInputColor = computed(() => new TinyColor(inputColor.value).toHexString());
|
|
56
|
-
const isEyeDropperSupported = computed(() => typeof window.EyeDropper === "function");
|
|
57
|
-
const select = color => {
|
|
58
|
-
pushHistory(color);
|
|
59
|
-
emit("select", color);
|
|
60
|
-
emit("update:visible", false);
|
|
61
|
-
};
|
|
62
|
-
const onSelect = color => {
|
|
63
|
-
if (color) {
|
|
64
|
-
select(color);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const onCustomSelect = () => {
|
|
68
|
-
select(normalInputColor.value);
|
|
69
|
-
};
|
|
70
|
-
const onClear = () => {
|
|
71
|
-
emit("clear");
|
|
72
|
-
emit("update:visible", false);
|
|
73
|
-
};
|
|
74
|
-
const onAbsorb = () => {
|
|
75
|
-
const eyeDropper = new window.EyeDropper();
|
|
76
|
-
eyeDropper.open().then(result => {
|
|
77
|
-
inputColor.value = result.sRGBHex;
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
return (_ctx, _cache) => {
|
|
81
|
-
return openBlock(), createBlock(stdin_default$2, {
|
|
82
|
-
"popper-class": [unref(hashId), unref(prefixCls)],
|
|
83
|
-
visible: innerVisible.value,
|
|
84
|
-
"onUpdate:visible": _cache[1] || (_cache[1] = $event => innerVisible.value = $event)
|
|
85
|
-
}, {
|
|
86
|
-
content: withCtx(() => [createElementVNode("div", {
|
|
87
|
-
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
88
|
-
}, toDisplayString(unref(t)("co.colorPicker.preset")), 3
|
|
89
|
-
/* TEXT, CLASS */), createElementVNode("div", {
|
|
90
|
-
class: normalizeClass(`${unref(prefixCls)}-preset`)
|
|
91
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(colorPalettes), (row, i) => {
|
|
92
|
-
return openBlock(), createElementBlock("div", {
|
|
93
|
-
key: i,
|
|
94
|
-
class: normalizeClass(`${unref(prefixCls)}-row`)
|
|
95
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (color, j) => {
|
|
96
|
-
return openBlock(), createElementBlock("div", {
|
|
97
|
-
key: j,
|
|
98
|
-
class: normalizeClass(`${unref(prefixCls)}-item`)
|
|
99
|
-
}, [createElementVNode("button", {
|
|
100
|
-
type: "button",
|
|
101
|
-
class: normalizeClass([`${unref(prefixCls)}-color`, `${unref(prefixCls)}-btn`]),
|
|
102
|
-
style: normalizeStyle({
|
|
103
|
-
background: color
|
|
104
|
-
}),
|
|
105
|
-
onClick: $event => onSelect(color)
|
|
106
|
-
}, null, 14, _hoisted_1)], 2
|
|
107
|
-
/* CLASS */);
|
|
108
|
-
}), 128
|
|
109
|
-
/* KEYED_FRAGMENT */))], 2
|
|
110
|
-
/* CLASS */);
|
|
111
|
-
}), 128
|
|
112
|
-
/* KEYED_FRAGMENT */))], 2
|
|
113
|
-
/* CLASS */), createElementVNode("div", {
|
|
114
|
-
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
115
|
-
}, toDisplayString(unref(t)("co.colorPicker.recents")), 3
|
|
116
|
-
/* TEXT, CLASS */), createElementVNode("div", {
|
|
117
|
-
class: normalizeClass(`${unref(prefixCls)}-row`)
|
|
118
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(mapHistoryColors.value, (color, i) => {
|
|
119
|
-
return openBlock(), createElementBlock("div", {
|
|
120
|
-
key: i,
|
|
121
|
-
class: normalizeClass(`${unref(prefixCls)}-item`)
|
|
122
|
-
}, [createElementVNode("button", {
|
|
123
|
-
type: "button",
|
|
124
|
-
class: normalizeClass([`${unref(prefixCls)}-color`, `${unref(prefixCls)}-btn`, {
|
|
125
|
-
"is-empty": !color
|
|
126
|
-
}]),
|
|
127
|
-
style: normalizeStyle({
|
|
128
|
-
background: color
|
|
129
|
-
}),
|
|
130
|
-
onClick: $event => onSelect(color)
|
|
131
|
-
}, null, 14, _hoisted_2)], 2
|
|
132
|
-
/* CLASS */);
|
|
133
|
-
}), 128
|
|
134
|
-
/* KEYED_FRAGMENT */))], 2
|
|
135
|
-
/* CLASS */), createElementVNode("div", {
|
|
136
|
-
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
137
|
-
}, toDisplayString(unref(t)("co.colorPicker.manual")), 3
|
|
138
|
-
/* TEXT, CLASS */), createElementVNode("div", {
|
|
139
|
-
class: normalizeClass(`${unref(prefixCls)}-manual`)
|
|
140
|
-
}, [isEyeDropperSupported.value ? (openBlock(), createElementBlock("button", {
|
|
141
|
-
key: 0,
|
|
142
|
-
type: "button",
|
|
143
|
-
class: normalizeClass([`${unref(prefixCls)}-btn`]),
|
|
144
|
-
onClick: onAbsorb
|
|
145
|
-
}, [createVNode(unref(_Icon), {
|
|
146
|
-
name: "co:eyedropper",
|
|
147
|
-
size: "lg"
|
|
148
|
-
})], 2
|
|
149
|
-
/* CLASS */)) : createCommentVNode("v-if", true), createVNode(unref(ElInput), {
|
|
150
|
-
modelValue: inputColor.value,
|
|
151
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => inputColor.value = $event),
|
|
152
|
-
size: "small",
|
|
153
|
-
placeholder: unref(t)("co.common.pleaseInput"),
|
|
154
|
-
class: normalizeClass([`${unref(prefixCls)}-input`])
|
|
155
|
-
}, null, 8, ["modelValue", "placeholder", "class"]), createElementVNode("button", {
|
|
156
|
-
type: "button",
|
|
157
|
-
class: normalizeClass([`${unref(prefixCls)}-color`, `${unref(prefixCls)}-btn`]),
|
|
158
|
-
style: normalizeStyle({
|
|
159
|
-
backgroundColor: normalInputColor.value
|
|
160
|
-
}),
|
|
161
|
-
onClick: onCustomSelect
|
|
162
|
-
}, null, 6
|
|
163
|
-
/* CLASS, STYLE */), createElementVNode("button", {
|
|
164
|
-
type: "button",
|
|
165
|
-
class: normalizeClass([`${unref(prefixCls)}-color`, `${unref(prefixCls)}-btn`, `${unref(prefixCls)}-clear`]),
|
|
166
|
-
onClick: onClear
|
|
167
|
-
}, [createVNode(unref(_Icon), {
|
|
168
|
-
name: "co:slash-forward",
|
|
169
|
-
size: "lg"
|
|
170
|
-
})], 2
|
|
171
|
-
/* CLASS */)], 2
|
|
172
|
-
/* CLASS */)]),
|
|
173
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
174
|
-
_: 3
|
|
175
|
-
/* FORWARDED */
|
|
176
|
-
}, 8, ["popper-class", "visible"]);
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
export { stdin_default as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ListItem } from './list';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
selectedValue?: any;
|
|
4
|
-
list: ListItem[];
|
|
5
|
-
};
|
|
6
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
7
|
-
select: (item: ListItem) => any;
|
|
8
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
-
onSelect?: ((item: ListItem) => any) | undefined;
|
|
10
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
-
export default _default;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, normalizeStyle, toDisplayString } from 'vue';
|
|
2
|
-
import stdin_default$1 from './list.style.js';
|
|
3
|
-
import { useComponentConfig } from '../../../config-provider/config-provider.api.js';
|
|
4
|
-
|
|
5
|
-
const _hoisted_1 = ["onClick"];
|
|
6
|
-
var stdin_default = /* @__PURE__ */defineComponent({
|
|
7
|
-
__name: "list",
|
|
8
|
-
props: {
|
|
9
|
-
selectedValue: {
|
|
10
|
-
type: null,
|
|
11
|
-
required: false
|
|
12
|
-
},
|
|
13
|
-
list: {
|
|
14
|
-
type: Array,
|
|
15
|
-
required: true
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
emits: ["select"],
|
|
19
|
-
setup(__props, {
|
|
20
|
-
emit: __emit
|
|
21
|
-
}) {
|
|
22
|
-
const emit = __emit;
|
|
23
|
-
const {
|
|
24
|
-
prefixCls
|
|
25
|
-
} = useComponentConfig("editor-list");
|
|
26
|
-
const {
|
|
27
|
-
hashId
|
|
28
|
-
} = stdin_default$1(prefixCls);
|
|
29
|
-
const onSelect = item => {
|
|
30
|
-
emit("select", item);
|
|
31
|
-
};
|
|
32
|
-
return (_ctx, _cache) => {
|
|
33
|
-
return openBlock(), createElementBlock("div", {
|
|
34
|
-
class: normalizeClass([unref(hashId), unref(prefixCls)])
|
|
35
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, item => {
|
|
36
|
-
return openBlock(), createElementBlock("div", {
|
|
37
|
-
key: item.value,
|
|
38
|
-
class: normalizeClass([`${unref(prefixCls)}-item`, {
|
|
39
|
-
"is-active": _ctx.selectedValue === item.value
|
|
40
|
-
}]),
|
|
41
|
-
style: normalizeStyle(item.style),
|
|
42
|
-
onClick: $event => onSelect(item)
|
|
43
|
-
}, toDisplayString(item.label), 15, _hoisted_1);
|
|
44
|
-
}), 128
|
|
45
|
-
/* KEYED_FRAGMENT */))], 2
|
|
46
|
-
/* CLASS */);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export { stdin_default as default };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
popperClass?: any;
|
|
3
|
-
visible?: boolean;
|
|
4
|
-
maxHeight?: string;
|
|
5
|
-
triggerTarget?: HTMLElement | null;
|
|
6
|
-
nopadding?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare var __VLS_6: {}, __VLS_8: {};
|
|
9
|
-
type __VLS_Slots = {} & {
|
|
10
|
-
content?: (props: typeof __VLS_6) => any;
|
|
11
|
-
} & {
|
|
12
|
-
default?: (props: typeof __VLS_8) => any;
|
|
13
|
-
};
|
|
14
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
|
-
"update:visible": (visible: boolean) => any;
|
|
16
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
18
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
|
-
export default _default;
|
|
21
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
-
new (): {
|
|
23
|
-
$slots: S;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, ref, provide, computed, onMounted, onBeforeUnmount, createBlock, openBlock, unref, withCtx, renderSlot, createElementVNode, normalizeStyle, normalizeClass } from 'vue';
|
|
2
|
-
import { ElTooltip } from 'element-plus';
|
|
3
|
-
import stdin_default$1 from './picker.style.js';
|
|
4
|
-
import { pickerContextKey } from './picker.js';
|
|
5
|
-
import { useComponentConfig } from '../../../config-provider/config-provider.api.js';
|
|
6
|
-
|
|
7
|
-
var stdin_default = /* @__PURE__ */defineComponent({
|
|
8
|
-
__name: "picker",
|
|
9
|
-
props: {
|
|
10
|
-
popperClass: {
|
|
11
|
-
type: null,
|
|
12
|
-
required: false
|
|
13
|
-
},
|
|
14
|
-
visible: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
required: false
|
|
17
|
-
},
|
|
18
|
-
maxHeight: {
|
|
19
|
-
type: String,
|
|
20
|
-
required: false
|
|
21
|
-
},
|
|
22
|
-
triggerTarget: {
|
|
23
|
-
type: null,
|
|
24
|
-
required: false
|
|
25
|
-
},
|
|
26
|
-
nopadding: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
required: false
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
emits: ["update:visible"],
|
|
32
|
-
setup(__props, {
|
|
33
|
-
emit: __emit
|
|
34
|
-
}) {
|
|
35
|
-
const props = __props;
|
|
36
|
-
const emit = __emit;
|
|
37
|
-
const {
|
|
38
|
-
prefixCls
|
|
39
|
-
} = useComponentConfig("editor-picker");
|
|
40
|
-
const {
|
|
41
|
-
hashId
|
|
42
|
-
} = stdin_default$1(prefixCls);
|
|
43
|
-
const contentRef = useTemplateRef("content");
|
|
44
|
-
const contextTriggerTarget = ref();
|
|
45
|
-
provide(pickerContextKey, {
|
|
46
|
-
triggerTarget: contextTriggerTarget
|
|
47
|
-
});
|
|
48
|
-
const mergedTriggerTarget = computed(() => {
|
|
49
|
-
return props.triggerTarget || contextTriggerTarget.value;
|
|
50
|
-
});
|
|
51
|
-
const onDocClick = event => {
|
|
52
|
-
const target = event.target;
|
|
53
|
-
if (!props.visible || mergedTriggerTarget.value && mergedTriggerTarget.value.contains(target) || contentRef.value?.contains(target)) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
emit("update:visible", false);
|
|
57
|
-
};
|
|
58
|
-
onMounted(() => {
|
|
59
|
-
document.addEventListener("click", onDocClick, false);
|
|
60
|
-
});
|
|
61
|
-
onBeforeUnmount(() => {
|
|
62
|
-
document.removeEventListener("click", onDocClick, false);
|
|
63
|
-
});
|
|
64
|
-
return (_ctx, _cache) => {
|
|
65
|
-
return openBlock(), createBlock(unref(ElTooltip), {
|
|
66
|
-
visible: _ctx.visible,
|
|
67
|
-
"show-arrow": false,
|
|
68
|
-
placement: "bottom-start",
|
|
69
|
-
offset: 0,
|
|
70
|
-
"gpu-acceleration": false,
|
|
71
|
-
"popper-class": [unref(hashId), _ctx.popperClass, `${unref(prefixCls)}-panel`],
|
|
72
|
-
"stop-popper-mouse-event": false,
|
|
73
|
-
effect: "light",
|
|
74
|
-
trigger: "click",
|
|
75
|
-
persistent: ""
|
|
76
|
-
}, {
|
|
77
|
-
content: withCtx(() => [createElementVNode("div", {
|
|
78
|
-
ref: "content",
|
|
79
|
-
class: normalizeClass([`${unref(prefixCls)}-content`, {
|
|
80
|
-
"is-nopadding": _ctx.nopadding
|
|
81
|
-
}]),
|
|
82
|
-
style: normalizeStyle({
|
|
83
|
-
maxHeight: _ctx.maxHeight
|
|
84
|
-
})
|
|
85
|
-
}, [renderSlot(_ctx.$slots, "content")], 6
|
|
86
|
-
/* CLASS, STYLE */)]),
|
|
87
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
88
|
-
_: 3
|
|
89
|
-
/* FORWARDED */
|
|
90
|
-
}, 8, ["visible", "popper-class"]);
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
export { stdin_default as default };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface Rect {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
}
|
|
7
|
-
export type ResizePosition = 'nw' | 'ne' | 'sw' | 'se';
|
|
8
|
-
export type ResizeAlign = 'left' | 'center' | 'right';
|
|
9
|
-
export declare const mapIcons: {
|
|
10
|
-
left: string;
|
|
11
|
-
center: string;
|
|
12
|
-
right: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const getAlign: (el?: HTMLElement) => ResizeAlign | null;
|
|
15
|
-
export declare const onDrag: (downRect: Rect, currRect: Rect, options: {
|
|
16
|
-
position: ResizePosition;
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
min: number;
|
|
20
|
-
max: number;
|
|
21
|
-
cb: (rect: Rect) => void;
|
|
22
|
-
}) => void;
|
|
23
|
-
export declare const setAlignStyle: (el: HTMLElement, align: ResizeAlign | null) => void;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
const mapIcons = {
|
|
2
|
-
left: "co:text-align-left",
|
|
3
|
-
center: "co:text-align-center",
|
|
4
|
-
right: "co:text-align-right"
|
|
5
|
-
};
|
|
6
|
-
const getAlign = (el) => {
|
|
7
|
-
if (!el) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
const style = el.style;
|
|
11
|
-
if (style.float === "left") {
|
|
12
|
-
return "left";
|
|
13
|
-
}
|
|
14
|
-
if (style.float === "right") {
|
|
15
|
-
return "right";
|
|
16
|
-
}
|
|
17
|
-
if (style.marginInlineStart === "auto" && style.marginInlineEnd === "auto" && style.display === "block") {
|
|
18
|
-
return "center";
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
};
|
|
22
|
-
const onDrag = (downRect, currRect, options) => {
|
|
23
|
-
const { x, y } = currRect;
|
|
24
|
-
const aspectScale = downRect.width / downRect.height;
|
|
25
|
-
let width = 0;
|
|
26
|
-
switch (options.position) {
|
|
27
|
-
case "nw":
|
|
28
|
-
case "sw":
|
|
29
|
-
width = downRect.x + downRect.width - options.x;
|
|
30
|
-
break;
|
|
31
|
-
case "ne":
|
|
32
|
-
case "se":
|
|
33
|
-
width = options.x - downRect.x;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
if (width < options.min) {
|
|
37
|
-
width = options.min;
|
|
38
|
-
} else if (width > options.max) {
|
|
39
|
-
width = options.max;
|
|
40
|
-
}
|
|
41
|
-
const height = width / aspectScale;
|
|
42
|
-
options.cb({
|
|
43
|
-
x,
|
|
44
|
-
y,
|
|
45
|
-
width,
|
|
46
|
-
height
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
const setAlignStyle = (el, align) => {
|
|
50
|
-
let style;
|
|
51
|
-
switch (align) {
|
|
52
|
-
case null:
|
|
53
|
-
style = {
|
|
54
|
-
display: "",
|
|
55
|
-
float: "",
|
|
56
|
-
marginInlineStart: "",
|
|
57
|
-
marginInlineEnd: ""
|
|
58
|
-
};
|
|
59
|
-
break;
|
|
60
|
-
case "left":
|
|
61
|
-
style = {
|
|
62
|
-
display: "",
|
|
63
|
-
float: "left",
|
|
64
|
-
marginInlineStart: "",
|
|
65
|
-
marginInlineEnd: ""
|
|
66
|
-
};
|
|
67
|
-
break;
|
|
68
|
-
case "center":
|
|
69
|
-
style = {
|
|
70
|
-
display: "block",
|
|
71
|
-
float: "",
|
|
72
|
-
marginInlineStart: "auto",
|
|
73
|
-
marginInlineEnd: "auto"
|
|
74
|
-
};
|
|
75
|
-
break;
|
|
76
|
-
case "right":
|
|
77
|
-
style = {
|
|
78
|
-
display: "",
|
|
79
|
-
float: "right",
|
|
80
|
-
marginInlineStart: "",
|
|
81
|
-
marginInlineEnd: ""
|
|
82
|
-
};
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
Object.assign(el.style, style);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export { getAlign, mapIcons, onDrag, setAlignStyle };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
export default _default;
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, inject, ref, shallowRef, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createElementVNode, Fragment, renderList, createVNode, withCtx, toDisplayString } from 'vue';
|
|
2
|
-
import Quill from 'quill';
|
|
3
|
-
import stdin_default$1 from './resize.style.js';
|
|
4
|
-
import { getAlign, mapIcons, onDrag, setAlignStyle } from './resize.js';
|
|
5
|
-
import { Icon as _Icon } from '../../../icon/index.js';
|
|
6
|
-
import stdin_default$3 from '../button.vue.js';
|
|
7
|
-
import stdin_default$2 from '../button-group.vue.js';
|
|
8
|
-
import { editorContextKey } from '../../quillContext.js';
|
|
9
|
-
import { useRectObserver } from '../../../../hooks/useRectObserver.js';
|
|
10
|
-
import { useComponentConfig } from '../../../config-provider/config-provider.api.js';
|
|
11
|
-
|
|
12
|
-
const _hoisted_1 = ["onPointerdown", "onPointermove", "onPointerup", "onPointercancel"];
|
|
13
|
-
var stdin_default = /* @__PURE__ */defineComponent({
|
|
14
|
-
__name: "resize",
|
|
15
|
-
setup(__props) {
|
|
16
|
-
const {
|
|
17
|
-
prefixCls
|
|
18
|
-
} = useComponentConfig("editor-resize");
|
|
19
|
-
const {
|
|
20
|
-
hashId
|
|
21
|
-
} = stdin_default$1(prefixCls);
|
|
22
|
-
const overlayEl = useTemplateRef("overlay");
|
|
23
|
-
const {
|
|
24
|
-
quill
|
|
25
|
-
} = inject(editorContextKey);
|
|
26
|
-
const visible = ref(false);
|
|
27
|
-
const target = shallowRef(null);
|
|
28
|
-
const currentAlign = ref(null);
|
|
29
|
-
const corners = ["nw", "ne", "sw", "se"];
|
|
30
|
-
const aligns = ["left", "center", "right"];
|
|
31
|
-
const downs = {};
|
|
32
|
-
let downRect = null;
|
|
33
|
-
const displaySize = ref("");
|
|
34
|
-
const isOutSize = ref(false);
|
|
35
|
-
const overlayStyle = ref();
|
|
36
|
-
const setOverlayRect = rect => {
|
|
37
|
-
const parent = overlayEl.value?.offsetParent;
|
|
38
|
-
if (parent) {
|
|
39
|
-
const parentRect = parent.getBoundingClientRect();
|
|
40
|
-
const width = ~~rect.width;
|
|
41
|
-
const height = ~~rect.height;
|
|
42
|
-
overlayStyle.value = {
|
|
43
|
-
insetInlineStart: ~~(rect.x - parentRect.x) + "px",
|
|
44
|
-
insetBlockStart: ~~(rect.y - parentRect.y) + "px",
|
|
45
|
-
width: width + "px",
|
|
46
|
-
height: height + "px"
|
|
47
|
-
};
|
|
48
|
-
displaySize.value = `${width} x ${height}`;
|
|
49
|
-
isOutSize.value = width < 64;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
useRectObserver(target, rect => {
|
|
53
|
-
setOverlayRect(rect);
|
|
54
|
-
});
|
|
55
|
-
const onPointerDown = (corner, event) => {
|
|
56
|
-
downs[corner] = true;
|
|
57
|
-
const el = event.currentTarget;
|
|
58
|
-
el.setPointerCapture(event.pointerId);
|
|
59
|
-
downRect = target.value.getBoundingClientRect();
|
|
60
|
-
};
|
|
61
|
-
const onPointerMove = (corner, event) => {
|
|
62
|
-
if (downs[corner]) {
|
|
63
|
-
const rect = target.value.getBoundingClientRect();
|
|
64
|
-
onDrag(downRect, rect, {
|
|
65
|
-
position: corner,
|
|
66
|
-
x: event.clientX,
|
|
67
|
-
y: event.clientY,
|
|
68
|
-
min: 16,
|
|
69
|
-
max: Infinity,
|
|
70
|
-
cb: rect2 => {
|
|
71
|
-
target.value.setAttribute("width", `${~~rect2.width}`);
|
|
72
|
-
target.value.setAttribute("height", `${~~rect2.height}`);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
const onPointerUp = corner => {
|
|
78
|
-
downs[corner] = false;
|
|
79
|
-
};
|
|
80
|
-
const onAlignClick = align => {
|
|
81
|
-
if (align === currentAlign.value) {
|
|
82
|
-
currentAlign.value = null;
|
|
83
|
-
} else {
|
|
84
|
-
currentAlign.value = align;
|
|
85
|
-
}
|
|
86
|
-
setAlignStyle(target.value, currentAlign.value);
|
|
87
|
-
};
|
|
88
|
-
watch(() => target.value, () => {
|
|
89
|
-
if (target.value) {
|
|
90
|
-
currentAlign.value = getAlign(target.value);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
const show = el => {
|
|
94
|
-
target.value = el;
|
|
95
|
-
const blot = Quill.find(el);
|
|
96
|
-
const index = quill.value.getIndex(blot);
|
|
97
|
-
quill.value.setSelection(index + 1);
|
|
98
|
-
quill.value.setSelection(null);
|
|
99
|
-
visible.value = true;
|
|
100
|
-
};
|
|
101
|
-
const hide = () => {
|
|
102
|
-
if (visible.value) {
|
|
103
|
-
target.value = null;
|
|
104
|
-
visible.value = false;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const onDocMouseDown = event => {
|
|
108
|
-
const el = event.target;
|
|
109
|
-
if (target.value && (el === target.value || overlayEl.value.contains(el))) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (["img", "video"].includes(el.tagName.toLowerCase()) && quill.value.container.contains(el)) {
|
|
113
|
-
if (target.value) {
|
|
114
|
-
hide();
|
|
115
|
-
}
|
|
116
|
-
show(el);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
hide();
|
|
120
|
-
};
|
|
121
|
-
const onDocKeyDown = event => {
|
|
122
|
-
if (!target.value) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
event.preventDefault();
|
|
126
|
-
const blot = Quill.find(target.value);
|
|
127
|
-
let index = quill.value.getIndex(blot);
|
|
128
|
-
switch (event.key) {
|
|
129
|
-
case "ArrowLeft":
|
|
130
|
-
case "ArrowUp":
|
|
131
|
-
break;
|
|
132
|
-
case "ArrowRight":
|
|
133
|
-
case "ArrowDown":
|
|
134
|
-
index += 1;
|
|
135
|
-
break;
|
|
136
|
-
case "Backspace":
|
|
137
|
-
case "Delete":
|
|
138
|
-
quill.value.deleteText(index, 1);
|
|
139
|
-
break;
|
|
140
|
-
default:
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
hide();
|
|
144
|
-
setTimeout(() => {
|
|
145
|
-
quill.value.setSelection(index);
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
onMounted(() => {
|
|
149
|
-
document.addEventListener("mousedown", onDocMouseDown, false);
|
|
150
|
-
document.addEventListener("keydown", onDocKeyDown, false);
|
|
151
|
-
});
|
|
152
|
-
onBeforeUnmount(() => {
|
|
153
|
-
document.removeEventListener("mousedown", onDocMouseDown, false);
|
|
154
|
-
document.removeEventListener("keydown", onDocKeyDown, false);
|
|
155
|
-
});
|
|
156
|
-
return (_ctx, _cache) => {
|
|
157
|
-
return openBlock(), createElementBlock("div", {
|
|
158
|
-
ref: "overlay",
|
|
159
|
-
class: normalizeClass([unref(hashId), unref(prefixCls), {
|
|
160
|
-
"is-show": visible.value
|
|
161
|
-
}]),
|
|
162
|
-
style: normalizeStyle(overlayStyle.value)
|
|
163
|
-
}, [(openBlock(), createElementBlock(Fragment, null, renderList(corners, corner => {
|
|
164
|
-
return createElementVNode("div", {
|
|
165
|
-
key: corner,
|
|
166
|
-
class: normalizeClass([`${unref(prefixCls)}-corner`, `${unref(prefixCls)}-corner-${corner}`]),
|
|
167
|
-
onPointerdown: $event => onPointerDown(corner, $event),
|
|
168
|
-
onPointermove: $event => onPointerMove(corner, $event),
|
|
169
|
-
onPointerup: $event => onPointerUp(corner),
|
|
170
|
-
onPointercancel: $event => onPointerUp(corner)
|
|
171
|
-
}, null, 42, _hoisted_1);
|
|
172
|
-
}), 64
|
|
173
|
-
/* STABLE_FRAGMENT */)), createElementVNode("div", {
|
|
174
|
-
class: normalizeClass(`${unref(prefixCls)}-align`)
|
|
175
|
-
}, [createVNode(stdin_default$2, null, {
|
|
176
|
-
default: withCtx(() => [(openBlock(), createElementBlock(Fragment, null, renderList(aligns, align => {
|
|
177
|
-
return createVNode(stdin_default$3, {
|
|
178
|
-
key: align,
|
|
179
|
-
active: align === currentAlign.value,
|
|
180
|
-
onClick: $event => onAlignClick(align)
|
|
181
|
-
}, {
|
|
182
|
-
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
183
|
-
name: unref(mapIcons)[align]
|
|
184
|
-
}, null, 8, ["name"])]),
|
|
185
|
-
_: 2
|
|
186
|
-
/* DYNAMIC */
|
|
187
|
-
}, 1032, ["active", "onClick"]);
|
|
188
|
-
}), 64
|
|
189
|
-
/* STABLE_FRAGMENT */))]),
|
|
190
|
-
_: 1
|
|
191
|
-
/* STABLE */
|
|
192
|
-
})], 2
|
|
193
|
-
/* CLASS */), createElementVNode("div", {
|
|
194
|
-
class: normalizeClass([`${unref(prefixCls)}-size`, {
|
|
195
|
-
"is-outside": isOutSize.value
|
|
196
|
-
}])
|
|
197
|
-
}, toDisplayString(displaySize.value), 3
|
|
198
|
-
/* TEXT, CLASS */)], 6
|
|
199
|
-
/* CLASS, STYLE */);
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
export { stdin_default as default };
|