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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import stdin_default$2 from '../../icon/icon.js';
|
|
4
|
+
import stdin_default$1 from '../button.js';
|
|
5
|
+
import { useBlockValueActive } from '../hooks/useBlockValueActive.js';
|
|
6
|
+
|
|
7
|
+
var stdin_default = defineComponent({
|
|
8
|
+
name: "CoEditorFormatAlign",
|
|
9
|
+
props: {
|
|
10
|
+
icon: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
format: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(props) {
|
|
20
|
+
const editor = useEditor();
|
|
21
|
+
const isActive = useBlockValueActive("align", props.format);
|
|
22
|
+
const onClick = () => {
|
|
23
|
+
editor.formatAlign(props.format);
|
|
24
|
+
};
|
|
25
|
+
return () => {
|
|
26
|
+
return createVNode(stdin_default$1, {
|
|
27
|
+
"active": isActive.value,
|
|
28
|
+
"onClick": onClick
|
|
29
|
+
}, {
|
|
30
|
+
default: () => [createVNode(stdin_default$2, {
|
|
31
|
+
"name": props.icon
|
|
32
|
+
}, null)]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent, ref, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import stdin_default$2 from '../button-split.js';
|
|
4
|
+
import stdin_default$1 from './color-picker.js';
|
|
5
|
+
|
|
6
|
+
var stdin_default = defineComponent({
|
|
7
|
+
name: "CoEditorFormatBackground",
|
|
8
|
+
setup() {
|
|
9
|
+
const editor = useEditor();
|
|
10
|
+
const visible = ref(false);
|
|
11
|
+
const current = ref("#000");
|
|
12
|
+
const select = color => {
|
|
13
|
+
editor.formatBackground(color);
|
|
14
|
+
};
|
|
15
|
+
const onChevronClick = () => {
|
|
16
|
+
visible.value = !visible.value;
|
|
17
|
+
};
|
|
18
|
+
const onBtnClick = () => {
|
|
19
|
+
select(current.value);
|
|
20
|
+
};
|
|
21
|
+
const onSelect = color => {
|
|
22
|
+
current.value = color;
|
|
23
|
+
select(color);
|
|
24
|
+
};
|
|
25
|
+
const onClear = () => {
|
|
26
|
+
select();
|
|
27
|
+
};
|
|
28
|
+
return () => {
|
|
29
|
+
return createVNode(stdin_default$1, {
|
|
30
|
+
"visible": visible.value,
|
|
31
|
+
"onUpdate:visible": $event => visible.value = $event,
|
|
32
|
+
"onSelect": onSelect,
|
|
33
|
+
"onClear": onClear
|
|
34
|
+
}, {
|
|
35
|
+
default: () => [createVNode(stdin_default$2, {
|
|
36
|
+
"chevron-active": visible.value,
|
|
37
|
+
"onClick": onBtnClick,
|
|
38
|
+
"onChevron-click": onChevronClick
|
|
39
|
+
}, {
|
|
40
|
+
default: () => [createVNode("svg", {
|
|
41
|
+
"width": "24",
|
|
42
|
+
"height": "24",
|
|
43
|
+
"viewBox": "0 0 24 24"
|
|
44
|
+
}, [createVNode("g", {
|
|
45
|
+
"fill-rule": "evenodd"
|
|
46
|
+
}, [createVNode("path", {
|
|
47
|
+
"d": "M3 18h18v3H3z",
|
|
48
|
+
"fill": current.value
|
|
49
|
+
}, null), createVNode("path", {
|
|
50
|
+
"fill-rule": "nonzero",
|
|
51
|
+
"fill": "currentColor",
|
|
52
|
+
"d": "M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"
|
|
53
|
+
}, null)])])]
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import stdin_default$2 from '../../icon/icon.js';
|
|
4
|
+
import stdin_default$1 from '../button.js';
|
|
5
|
+
|
|
6
|
+
var stdin_default = defineComponent({
|
|
7
|
+
name: "CoEditorFormatBlockQuote",
|
|
8
|
+
setup() {
|
|
9
|
+
const editor = useEditor();
|
|
10
|
+
const isActive = computed(() => editor.isBlockQuoteActive());
|
|
11
|
+
const onClick = () => {
|
|
12
|
+
editor.formatBlockQuote();
|
|
13
|
+
};
|
|
14
|
+
return () => {
|
|
15
|
+
return createVNode(stdin_default$1, {
|
|
16
|
+
"active": isActive.value,
|
|
17
|
+
"onClick": onClick
|
|
18
|
+
}, {
|
|
19
|
+
default: () => [createVNode(stdin_default$2, {
|
|
20
|
+
"name": "co:quotes"
|
|
21
|
+
}, null)]
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import stdin_default$2 from '../../icon/icon.js';
|
|
4
|
+
import stdin_default$1 from '../button.js';
|
|
5
|
+
|
|
6
|
+
var stdin_default = defineComponent({
|
|
7
|
+
name: "CoEditorFormatClear",
|
|
8
|
+
setup() {
|
|
9
|
+
const editor = useEditor();
|
|
10
|
+
const onClick = () => {
|
|
11
|
+
editor.clearForamts();
|
|
12
|
+
};
|
|
13
|
+
return () => {
|
|
14
|
+
return createVNode(stdin_default$1, {
|
|
15
|
+
"onClick": onClick
|
|
16
|
+
}, {
|
|
17
|
+
default: () => [createVNode(stdin_default$2, {
|
|
18
|
+
"name": "co:text-clear-format"
|
|
19
|
+
}, null)]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import stdin_default$2 from '../../icon/icon.js';
|
|
4
|
+
import stdin_default$1 from '../button.js';
|
|
5
|
+
|
|
6
|
+
var stdin_default = defineComponent({
|
|
7
|
+
name: "CoEditorFormatCodeBlock",
|
|
8
|
+
setup() {
|
|
9
|
+
const editor = useEditor();
|
|
10
|
+
const isActive = computed(() => editor.isCodeBlockActive());
|
|
11
|
+
const onClick = () => {
|
|
12
|
+
editor.formatCodeBlock();
|
|
13
|
+
};
|
|
14
|
+
return () => {
|
|
15
|
+
return createVNode(stdin_default$1, {
|
|
16
|
+
"active": isActive.value,
|
|
17
|
+
"onClick": onClick
|
|
18
|
+
}, {
|
|
19
|
+
default: () => [createVNode(stdin_default$2, {
|
|
20
|
+
"name": "co:code-block"
|
|
21
|
+
}, null)]
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineComponent, ref, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import stdin_default$2 from '../button-split.js';
|
|
4
|
+
import stdin_default$1 from './color-picker.js';
|
|
5
|
+
|
|
6
|
+
var stdin_default = defineComponent({
|
|
7
|
+
name: "CoEditorFormatColor",
|
|
8
|
+
setup() {
|
|
9
|
+
const editor = useEditor();
|
|
10
|
+
const visible = ref(false);
|
|
11
|
+
const current = ref("#000");
|
|
12
|
+
const select = color => {
|
|
13
|
+
editor.formatColor(color);
|
|
14
|
+
};
|
|
15
|
+
const onChevronClick = () => {
|
|
16
|
+
visible.value = !visible.value;
|
|
17
|
+
};
|
|
18
|
+
const onBtnClick = () => {
|
|
19
|
+
select(current.value);
|
|
20
|
+
};
|
|
21
|
+
const onSelect = color => {
|
|
22
|
+
current.value = color;
|
|
23
|
+
select(color);
|
|
24
|
+
};
|
|
25
|
+
const onClear = () => {
|
|
26
|
+
select();
|
|
27
|
+
};
|
|
28
|
+
return () => {
|
|
29
|
+
return createVNode(stdin_default$1, {
|
|
30
|
+
"visible": visible.value,
|
|
31
|
+
"onUpdate:visible": $event => visible.value = $event,
|
|
32
|
+
"onSelect": onSelect,
|
|
33
|
+
"onClear": onClear
|
|
34
|
+
}, {
|
|
35
|
+
default: () => [createVNode(stdin_default$2, {
|
|
36
|
+
"chevronActive": visible.value,
|
|
37
|
+
"onClick": onBtnClick,
|
|
38
|
+
"onChevron-click": onChevronClick
|
|
39
|
+
}, {
|
|
40
|
+
default: () => [createVNode("svg", {
|
|
41
|
+
"width": "24",
|
|
42
|
+
"height": "24",
|
|
43
|
+
"viewBox": "0 0 24 24"
|
|
44
|
+
}, [createVNode("g", {
|
|
45
|
+
"fill-rule": "evenodd"
|
|
46
|
+
}, [createVNode("path", {
|
|
47
|
+
"fill": current.value,
|
|
48
|
+
"d": "M3 18h18v3H3z"
|
|
49
|
+
}, null), createVNode("path", {
|
|
50
|
+
"fill": "currentColor",
|
|
51
|
+
"d": "M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"
|
|
52
|
+
}, null)])])]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import stdin_default$1 from './select.js';
|
|
4
|
+
import { useMarkValue } from '../hooks/useMarkValue.js';
|
|
5
|
+
|
|
6
|
+
const fonts = [
|
|
7
|
+
// 中文
|
|
8
|
+
["Microsoft YaHei", '"Microsoft YaHei"'], ["PingFang SC", '"PingFang SC"'], ["Hiragino Sans GB", '"Hiragino Sans GB"'], ["SimSun", "SimSun"], ["STHeiti", "STHeiti"],
|
|
9
|
+
// 英文
|
|
10
|
+
["Andale Mono", '"andale mono", monospace'], ["Arial", "arial, helvetica, sans-serif"], ["Arial Black", '"arial black", sans-serif'], ["Book Antiqua", '"book antiqua", palatino, serif'], ["Comic Sans MS", '"comic sans ms", sans-serif'], ["Courier New", '"courier new", courier, monospace'], ["Georgia", "georgia, palatino, serif"], ["Helvetica", "helvetica, arial, sans-serif"], ["Impact", "impact, sans-serif"], ["Symbol", "symbol"], ["Tahoma", "tahoma, arial, helvetica, sans-serif"], ["Terminal", "terminal, monaco, monospace"], ["Times New Roman", '"times new roman", times, serif'], ["Trebuchet MS", '"trebuchet ms", geneva, sans-serif'], ["Verdana", "verdana, geneva, sans-serif"]];
|
|
11
|
+
var stdin_default = defineComponent({
|
|
12
|
+
name: "CoEditorFormatFont",
|
|
13
|
+
setup() {
|
|
14
|
+
const list = computed(() => {
|
|
15
|
+
const sizeList = fonts.map(([label, value]) => {
|
|
16
|
+
return {
|
|
17
|
+
label,
|
|
18
|
+
value,
|
|
19
|
+
style: {
|
|
20
|
+
fontFamily: value
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
return [{
|
|
25
|
+
label: "\u9ED8\u8BA4\u5B57\u4F53",
|
|
26
|
+
value: ""
|
|
27
|
+
}, ...sizeList];
|
|
28
|
+
});
|
|
29
|
+
const editor = useEditor();
|
|
30
|
+
const current = useMarkValue("font");
|
|
31
|
+
const onChange = value => {
|
|
32
|
+
editor.formatFont(value);
|
|
33
|
+
};
|
|
34
|
+
return () => {
|
|
35
|
+
return createVNode(stdin_default$1, {
|
|
36
|
+
"modelValue": current.value,
|
|
37
|
+
"onUpdate:modelValue": $event => current.value = $event,
|
|
38
|
+
"list": list.value,
|
|
39
|
+
"button-width": "100px",
|
|
40
|
+
"onChange": onChange
|
|
41
|
+
}, null);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, reactive, useTemplateRef, watch, createVNode, Fragment, isVNode } from 'vue';
|
|
2
|
+
import { ElSpace, ElButton, ElInput } from 'element-plus';
|
|
3
|
+
import { useEditor } from 'slate-vue3';
|
|
4
|
+
import katex from 'katex';
|
|
5
|
+
import stdin_default$1 from '../button.js';
|
|
6
|
+
import { Panel as _Panel } from '../../panel/index.js';
|
|
7
|
+
import stdin_default$3 from '../../form-dialog/form-dialog.js';
|
|
8
|
+
import { Form as _Form } from '../../form/index.js';
|
|
9
|
+
import stdin_default$4 from '../../row/index.js';
|
|
10
|
+
import stdin_default$5 from '../../col/index.js';
|
|
11
|
+
import stdin_default$2 from '../../icon/index.js';
|
|
12
|
+
import { formulas } from '../plugins/formula.js';
|
|
13
|
+
import { isPointingAt, getPointingOptions } from '../utils.js';
|
|
14
|
+
|
|
15
|
+
function _isSlot(s) {
|
|
16
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
17
|
+
}
|
|
18
|
+
var stdin_default = defineComponent({
|
|
19
|
+
name: "CoEditorFormatFormula",
|
|
20
|
+
setup() {
|
|
21
|
+
const editor = useEditor();
|
|
22
|
+
const isActive = computed(() => isPointingAt(editor, "formula"));
|
|
23
|
+
const visible = ref(false);
|
|
24
|
+
const formModel = reactive({
|
|
25
|
+
formula: ""
|
|
26
|
+
});
|
|
27
|
+
const onSubmit = () => {
|
|
28
|
+
if (formModel.formula) {
|
|
29
|
+
editor.insertFormula(formModel.formula);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const onClick = () => {
|
|
33
|
+
if (!editor.selection) return;
|
|
34
|
+
const nodes = editor.nodes(getPointingOptions(editor, "formula"));
|
|
35
|
+
const {
|
|
36
|
+
done,
|
|
37
|
+
value
|
|
38
|
+
} = nodes.next();
|
|
39
|
+
if (done) {
|
|
40
|
+
formModel.formula = "";
|
|
41
|
+
} else {
|
|
42
|
+
const [node] = value;
|
|
43
|
+
formModel.formula = node.formula;
|
|
44
|
+
}
|
|
45
|
+
visible.value = true;
|
|
46
|
+
};
|
|
47
|
+
const previewEl = useTemplateRef("preview");
|
|
48
|
+
watch([previewEl, () => formModel.formula], ([el, formula]) => {
|
|
49
|
+
if (el) {
|
|
50
|
+
katex.render(formula, el, {
|
|
51
|
+
throwOnError: false,
|
|
52
|
+
errorColor: "#f00",
|
|
53
|
+
output: "mathml"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return () => {
|
|
58
|
+
let _slot;
|
|
59
|
+
return createVNode(Fragment, null, [createVNode(stdin_default$1, {
|
|
60
|
+
"active": isActive.value,
|
|
61
|
+
"onClick": onClick
|
|
62
|
+
}, {
|
|
63
|
+
default: () => [createVNode(stdin_default$2, {
|
|
64
|
+
"name": "co:function-math"
|
|
65
|
+
}, null)]
|
|
66
|
+
}), createVNode(stdin_default$3, {
|
|
67
|
+
"modelValue": visible.value,
|
|
68
|
+
"onUpdate:modelValue": $event => visible.value = $event,
|
|
69
|
+
"title": "LaTeX \u516C\u5F0F",
|
|
70
|
+
"width": "760px"
|
|
71
|
+
}, {
|
|
72
|
+
default: () => [createVNode(stdin_default$4, {
|
|
73
|
+
"gutter": 8,
|
|
74
|
+
"style": "row-gap: 8px"
|
|
75
|
+
}, {
|
|
76
|
+
default: () => [createVNode(stdin_default$5, {
|
|
77
|
+
"sm": 8
|
|
78
|
+
}, {
|
|
79
|
+
default: () => [createVNode(_Panel, {
|
|
80
|
+
"header": "\u6570\u5B66\u516C\u5F0F",
|
|
81
|
+
"maxHeight": "300px"
|
|
82
|
+
}, {
|
|
83
|
+
default: () => [createVNode(ElSpace, {
|
|
84
|
+
"fill": true
|
|
85
|
+
}, _isSlot(_slot = formulas.map(item => createVNode(ElButton, {
|
|
86
|
+
"key": item.formula,
|
|
87
|
+
"onClick": () => formModel.formula = item.formula
|
|
88
|
+
}, {
|
|
89
|
+
default: () => [item.name]
|
|
90
|
+
}))) ? _slot : {
|
|
91
|
+
default: () => [_slot]
|
|
92
|
+
})]
|
|
93
|
+
})]
|
|
94
|
+
}), createVNode(stdin_default$5, {
|
|
95
|
+
"sm": 16
|
|
96
|
+
}, {
|
|
97
|
+
default: () => [createVNode(ElSpace, {
|
|
98
|
+
"fill": true,
|
|
99
|
+
"style": "display: flex"
|
|
100
|
+
}, {
|
|
101
|
+
default: () => [createVNode(_Panel, {
|
|
102
|
+
"header": "\u7F16\u8F91\u516C\u5F0F"
|
|
103
|
+
}, {
|
|
104
|
+
default: () => [createVNode(_Form, {
|
|
105
|
+
"model": formModel,
|
|
106
|
+
"submit": onSubmit
|
|
107
|
+
}, {
|
|
108
|
+
default: () => [createVNode(ElInput, {
|
|
109
|
+
"modelValue": formModel.formula,
|
|
110
|
+
"onUpdate:modelValue": $event => formModel.formula = $event,
|
|
111
|
+
"type": "textarea",
|
|
112
|
+
"placeholder": "\u8BF7\u8F93\u5165\u516C\u5F0F",
|
|
113
|
+
"resize": "none",
|
|
114
|
+
"rows": 6
|
|
115
|
+
}, null)]
|
|
116
|
+
})]
|
|
117
|
+
}), createVNode(_Panel, {
|
|
118
|
+
"header": "\u9884\u89C8"
|
|
119
|
+
}, {
|
|
120
|
+
default: () => [createVNode("div", {
|
|
121
|
+
"ref": "preview",
|
|
122
|
+
"style": "height: 80px"
|
|
123
|
+
}, null)]
|
|
124
|
+
})]
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
})]
|
|
128
|
+
})]);
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
|
+
import { useEditor } from 'slate-vue3';
|
|
3
|
+
import { useToken } from '../../theme/util/useToken.js';
|
|
4
|
+
import stdin_default$1 from './select.js';
|
|
5
|
+
import { HEADING_TYPES } from '../types.js';
|
|
6
|
+
|
|
7
|
+
var stdin_default = defineComponent({
|
|
8
|
+
name: "CoEditorFormatHeading",
|
|
9
|
+
setup() {
|
|
10
|
+
const {
|
|
11
|
+
token
|
|
12
|
+
} = useToken();
|
|
13
|
+
const list = computed(() => {
|
|
14
|
+
const headingList = HEADING_TYPES.map((item, i) => {
|
|
15
|
+
const n = i + 1;
|
|
16
|
+
return {
|
|
17
|
+
label: `\u6807\u9898 ${n}`,
|
|
18
|
+
value: item,
|
|
19
|
+
style: {
|
|
20
|
+
fontSize: token.value[`fontSizeHeading${n}`] + "px",
|
|
21
|
+
lineHeight: token.value[`lineHeightHeading${n}`],
|
|
22
|
+
fontWeight: token.value["fontWeightStrong"]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return [{
|
|
27
|
+
label: "\u6B63\u6587",
|
|
28
|
+
value: "paragraph",
|
|
29
|
+
style: {
|
|
30
|
+
lineHeight: token.value["lineHeight"],
|
|
31
|
+
fontSize: token.value["fontSize"] + "px"
|
|
32
|
+
}
|
|
33
|
+
}, ...headingList];
|
|
34
|
+
});
|
|
35
|
+
const editor = useEditor();
|
|
36
|
+
const activeType = computed(() => editor.getActiveHeadingType());
|
|
37
|
+
const onChange = value => {
|
|
38
|
+
editor.formatHeading(value);
|
|
39
|
+
};
|
|
40
|
+
return () => {
|
|
41
|
+
return createVNode(stdin_default$1, {
|
|
42
|
+
"modelValue": activeType.value,
|
|
43
|
+
"onUpdate:modelValue": $event => activeType.value = $event,
|
|
44
|
+
"list": list.value,
|
|
45
|
+
"button-width": "100px",
|
|
46
|
+
"onChange": onChange
|
|
47
|
+
}, null);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, reactive, createVNode, Fragment } from 'vue';
|
|
2
|
+
import { ElButton } from 'element-plus';
|
|
3
|
+
import { useEditor } from 'slate-vue3';
|
|
4
|
+
import stdin_default$2 from '../../icon/icon.js';
|
|
5
|
+
import stdin_default$1 from '../button.js';
|
|
6
|
+
import stdin_default$3 from '../../form-dialog/form-dialog.js';
|
|
7
|
+
import stdin_default$4 from '../../form/form.js';
|
|
8
|
+
import stdin_default$5 from '../../form/form-item.vue.js';
|
|
9
|
+
import { isPointingAt, getPointingOptions } from '../utils.js';
|
|
10
|
+
import { useLocale } from '../../../hooks/useLocale.js';
|
|
11
|
+
import { chooseFiles } from '../../../utils/file.js';
|
|
12
|
+
|
|
13
|
+
var stdin_default = defineComponent({
|
|
14
|
+
name: "CoEditorFormatImage",
|
|
15
|
+
setup() {
|
|
16
|
+
const {
|
|
17
|
+
t
|
|
18
|
+
} = useLocale();
|
|
19
|
+
const editor = useEditor();
|
|
20
|
+
const isActive = computed(() => isPointingAt(editor, "image"));
|
|
21
|
+
const onSelect = () => {
|
|
22
|
+
visible.value = false;
|
|
23
|
+
chooseFiles({
|
|
24
|
+
accept: "image/*",
|
|
25
|
+
multiple: false
|
|
26
|
+
}).then(files => {
|
|
27
|
+
files.forEach(file => {
|
|
28
|
+
editor.insertImage("", file);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const onClick = () => {
|
|
33
|
+
if (!editor.selection) return;
|
|
34
|
+
const nodes = editor.nodes(getPointingOptions(editor, "image"));
|
|
35
|
+
const {
|
|
36
|
+
done,
|
|
37
|
+
value
|
|
38
|
+
} = nodes.next();
|
|
39
|
+
if (done) {
|
|
40
|
+
Object.assign(model, {
|
|
41
|
+
url: "",
|
|
42
|
+
width: "",
|
|
43
|
+
height: ""
|
|
44
|
+
});
|
|
45
|
+
actionType.value = "insert";
|
|
46
|
+
} else {
|
|
47
|
+
const [node] = value;
|
|
48
|
+
Object.assign(model, {
|
|
49
|
+
url: node.url,
|
|
50
|
+
width: node.width,
|
|
51
|
+
height: node.height
|
|
52
|
+
});
|
|
53
|
+
actionType.value = "update";
|
|
54
|
+
}
|
|
55
|
+
visible.value = true;
|
|
56
|
+
};
|
|
57
|
+
const visible = ref(false);
|
|
58
|
+
const actionType = ref("insert");
|
|
59
|
+
const title = computed(() => `${actionType.value === "update" ? t("co.editor.edit") : t("co.editor.insert")}${t("co.editor.image")}`);
|
|
60
|
+
const model = reactive({
|
|
61
|
+
url: "",
|
|
62
|
+
width: "",
|
|
63
|
+
height: ""
|
|
64
|
+
});
|
|
65
|
+
const onSubmit = () => {
|
|
66
|
+
if (!editor.selection) return;
|
|
67
|
+
if (!model.url.trim()) return;
|
|
68
|
+
if (actionType.value === "update") {
|
|
69
|
+
editor.setNodes({
|
|
70
|
+
...model
|
|
71
|
+
}, getPointingOptions(editor, "image"));
|
|
72
|
+
} else {
|
|
73
|
+
editor.insertImage(model.url, void 0, model.width, model.height);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return () => {
|
|
77
|
+
return createVNode(Fragment, null, [createVNode(stdin_default$1, {
|
|
78
|
+
"active": isActive.value,
|
|
79
|
+
"onClick": onClick
|
|
80
|
+
}, {
|
|
81
|
+
default: () => [createVNode(stdin_default$2, {
|
|
82
|
+
"name": "co:image"
|
|
83
|
+
}, null)]
|
|
84
|
+
}), createVNode(stdin_default$3, {
|
|
85
|
+
"modelValue": visible.value,
|
|
86
|
+
"onUpdate:modelValue": $event => visible.value = $event,
|
|
87
|
+
"title": title.value,
|
|
88
|
+
"width": "sm"
|
|
89
|
+
}, {
|
|
90
|
+
default: () => [createVNode(stdin_default$4, {
|
|
91
|
+
"model": model,
|
|
92
|
+
"labelWidth": "auto",
|
|
93
|
+
"grid": true,
|
|
94
|
+
"rowProps": {
|
|
95
|
+
gutter: 16
|
|
96
|
+
},
|
|
97
|
+
"submit": onSubmit
|
|
98
|
+
}, {
|
|
99
|
+
default: () => [createVNode(stdin_default$5, {
|
|
100
|
+
"modelValue": model.url,
|
|
101
|
+
"onUpdate:modelValue": $event => model.url = $event,
|
|
102
|
+
"prop": "url",
|
|
103
|
+
"label": "URL",
|
|
104
|
+
"field-type": "input",
|
|
105
|
+
"colProps": {
|
|
106
|
+
span: 20
|
|
107
|
+
}
|
|
108
|
+
}, null), createVNode(ElButton, {
|
|
109
|
+
"text": true,
|
|
110
|
+
"onClick": onSelect
|
|
111
|
+
}, {
|
|
112
|
+
default: () => [createVNode(stdin_default$2, {
|
|
113
|
+
"name": "co:upload"
|
|
114
|
+
}, null)]
|
|
115
|
+
}), createVNode(stdin_default$5, {
|
|
116
|
+
"modelValue": model.width,
|
|
117
|
+
"onUpdate:modelValue": $event => model.width = $event,
|
|
118
|
+
"prop": "width",
|
|
119
|
+
"label": t("co.editor.width"),
|
|
120
|
+
"field-type": "input",
|
|
121
|
+
"colProps": {
|
|
122
|
+
span: 12
|
|
123
|
+
}
|
|
124
|
+
}, null), createVNode(stdin_default$5, {
|
|
125
|
+
"modelValue": model.height,
|
|
126
|
+
"onUpdate:modelValue": $event => model.height = $event,
|
|
127
|
+
"prop": "height",
|
|
128
|
+
"label": t("co.editor.height"),
|
|
129
|
+
"field-type": "input",
|
|
130
|
+
"colProps": {
|
|
131
|
+
span: 12
|
|
132
|
+
}
|
|
133
|
+
}, null)]
|
|
134
|
+
})]
|
|
135
|
+
})]);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
icon: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
delta: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
icon: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
delta: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|