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,342 @@
|
|
|
1
|
+
import { escapeHtml, hyphenate, parseStringStyle } from '@vue/shared';
|
|
2
|
+
import { Text, Editor, Node as Node$1, Element } from 'slate-vue3/core';
|
|
3
|
+
import { jsx } from 'slate-vue3/hyperscript';
|
|
4
|
+
import { mapElementTypeTagName, tagToElementTypeMap } from '../types.js';
|
|
5
|
+
import { INDENT_DELTA } from './render.js';
|
|
6
|
+
import { deserializeList } from './list/deserialize.js';
|
|
7
|
+
import { serializeList } from './list/serialize.js';
|
|
8
|
+
import { toArray } from '../../../utils/array.js';
|
|
9
|
+
import { isUndefined } from '../../../utils/is.js';
|
|
10
|
+
|
|
11
|
+
function stringifyStyle(styles) {
|
|
12
|
+
let ret = "";
|
|
13
|
+
for (const key in styles) {
|
|
14
|
+
const value = styles[key];
|
|
15
|
+
if (typeof value === "number" || value) {
|
|
16
|
+
const normalizedKey = hyphenate(key);
|
|
17
|
+
ret += `${normalizedKey}:${value};`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return ret;
|
|
21
|
+
}
|
|
22
|
+
function getStyleObject(element) {
|
|
23
|
+
const styleStr = element.getAttribute("style");
|
|
24
|
+
return styleStr ? parseStringStyle(styleStr) : {};
|
|
25
|
+
}
|
|
26
|
+
function serializeElement(tag, attrs, children) {
|
|
27
|
+
let sAttrs = attrs.filter((item) => item[1]).map(([key, value]) => {
|
|
28
|
+
return value === true ? key : `${key}="${value}"`;
|
|
29
|
+
}).join(" ");
|
|
30
|
+
sAttrs = sAttrs ? ` ${sAttrs}` : "";
|
|
31
|
+
return `<${tag}${sAttrs}${isUndefined(children) ? ` />` : `>${children || ""}</${tag}>`}`;
|
|
32
|
+
}
|
|
33
|
+
function getLanguageByClass(cls) {
|
|
34
|
+
return cls.match(/language-([^ ]+)/)?.[1] || "text";
|
|
35
|
+
}
|
|
36
|
+
function serializeText(node) {
|
|
37
|
+
let string = escapeHtml(node.text);
|
|
38
|
+
if (node.bold) {
|
|
39
|
+
string = serializeElement("strong", [], string);
|
|
40
|
+
}
|
|
41
|
+
if (node.italic) {
|
|
42
|
+
string = serializeElement("em", [], string);
|
|
43
|
+
}
|
|
44
|
+
if (node.underline) {
|
|
45
|
+
string = serializeElement("u", [], string);
|
|
46
|
+
}
|
|
47
|
+
if (node.strikethrough) {
|
|
48
|
+
string = serializeElement("s", [], string);
|
|
49
|
+
}
|
|
50
|
+
if (node.code) {
|
|
51
|
+
string = serializeElement("code", [], string);
|
|
52
|
+
}
|
|
53
|
+
if (node.superscript) {
|
|
54
|
+
string = serializeElement("sup", [], string);
|
|
55
|
+
}
|
|
56
|
+
if (node.subscript) {
|
|
57
|
+
string = serializeElement("sub", [], string);
|
|
58
|
+
}
|
|
59
|
+
return serializeElement(
|
|
60
|
+
"span",
|
|
61
|
+
[
|
|
62
|
+
[
|
|
63
|
+
"style",
|
|
64
|
+
stringifyStyle({
|
|
65
|
+
fontFamily: node.font,
|
|
66
|
+
fontSize: node.size,
|
|
67
|
+
color: node.color,
|
|
68
|
+
background: node.background
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
],
|
|
72
|
+
string
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function serialize(node) {
|
|
76
|
+
if (Text.isText(node)) {
|
|
77
|
+
return serializeText(node);
|
|
78
|
+
}
|
|
79
|
+
if (Editor.isEditor(node)) {
|
|
80
|
+
return node.children.map((n) => serialize(n)).join("");
|
|
81
|
+
}
|
|
82
|
+
switch (node.type) {
|
|
83
|
+
case "image":
|
|
84
|
+
return serializeElement("img", [
|
|
85
|
+
["src", node.url],
|
|
86
|
+
["width", node.width],
|
|
87
|
+
["height", node.height]
|
|
88
|
+
]);
|
|
89
|
+
case "video":
|
|
90
|
+
return serializeElement("video", [
|
|
91
|
+
["src", node.url],
|
|
92
|
+
["width", node.width],
|
|
93
|
+
["height", node.height],
|
|
94
|
+
["controls", true]
|
|
95
|
+
]);
|
|
96
|
+
case "code-block":
|
|
97
|
+
return serializeElement(
|
|
98
|
+
"pre",
|
|
99
|
+
[["class", `language-${node.language}`]],
|
|
100
|
+
node.children.map((n) => serialize(n)).join("\n")
|
|
101
|
+
);
|
|
102
|
+
case "formula":
|
|
103
|
+
return serializeElement(
|
|
104
|
+
mapElementTypeTagName[node.type],
|
|
105
|
+
[["data-value", node.formula.replace(/"/g, """)]],
|
|
106
|
+
""
|
|
107
|
+
);
|
|
108
|
+
case "bulleted-list":
|
|
109
|
+
case "numbered-list":
|
|
110
|
+
return serializeList(node, serialize);
|
|
111
|
+
}
|
|
112
|
+
const children = node.children.map((n) => serialize(n)).join("");
|
|
113
|
+
switch (node.type) {
|
|
114
|
+
case "paragraph":
|
|
115
|
+
case "block-quote":
|
|
116
|
+
case "heading-one":
|
|
117
|
+
case "heading-two":
|
|
118
|
+
case "heading-three":
|
|
119
|
+
case "heading-four":
|
|
120
|
+
case "heading-five":
|
|
121
|
+
case "heading-six": {
|
|
122
|
+
return serializeElement(
|
|
123
|
+
mapElementTypeTagName[node.type],
|
|
124
|
+
[
|
|
125
|
+
[
|
|
126
|
+
"style",
|
|
127
|
+
stringifyStyle({
|
|
128
|
+
paddingLeft: node.indent ? node.indent * INDENT_DELTA + "px" : null,
|
|
129
|
+
textAlign: node.align
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
],
|
|
133
|
+
children
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
case "link":
|
|
137
|
+
return serializeElement(
|
|
138
|
+
"a",
|
|
139
|
+
[
|
|
140
|
+
["href", node.url],
|
|
141
|
+
["target", node.target]
|
|
142
|
+
],
|
|
143
|
+
children
|
|
144
|
+
);
|
|
145
|
+
case "nested-bulleted-list":
|
|
146
|
+
case "nested-numbered-list":
|
|
147
|
+
case "nested-list-item":
|
|
148
|
+
case "list-item":
|
|
149
|
+
case "table":
|
|
150
|
+
case "table-head":
|
|
151
|
+
case "table-body":
|
|
152
|
+
case "table-row":
|
|
153
|
+
case "table-cell":
|
|
154
|
+
return serializeElement(mapElementTypeTagName[node.type], [], children);
|
|
155
|
+
default:
|
|
156
|
+
return children;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function deserialize(node, markAttributes = {}) {
|
|
160
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
161
|
+
if (!node.textContent || /^\s+$/.test(node.textContent)) return null;
|
|
162
|
+
return jsx("text", markAttributes, node.textContent.replace(/\n+/g, " ").replace(/ +/g, " "));
|
|
163
|
+
}
|
|
164
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
const element = node;
|
|
168
|
+
const tagName = element.tagName;
|
|
169
|
+
switch (tagName) {
|
|
170
|
+
case "PRE":
|
|
171
|
+
return jsx(
|
|
172
|
+
"element",
|
|
173
|
+
{
|
|
174
|
+
type: "code-block",
|
|
175
|
+
language: getLanguageByClass(element.getAttribute("class") || "")
|
|
176
|
+
},
|
|
177
|
+
(element.textContent || "").split("\n").map(
|
|
178
|
+
(text) => jsx(
|
|
179
|
+
"element",
|
|
180
|
+
{
|
|
181
|
+
type: "code-line"
|
|
182
|
+
},
|
|
183
|
+
[jsx("text", {}, text)]
|
|
184
|
+
)
|
|
185
|
+
)
|
|
186
|
+
);
|
|
187
|
+
case "UL":
|
|
188
|
+
case "OL":
|
|
189
|
+
return deserializeList(element, deserialize);
|
|
190
|
+
case "math": {
|
|
191
|
+
const value = element.getAttribute("data-value");
|
|
192
|
+
if (value) {
|
|
193
|
+
return jsx(
|
|
194
|
+
"element",
|
|
195
|
+
{
|
|
196
|
+
type: "formula",
|
|
197
|
+
formula: value.replace(/"/g, '"')
|
|
198
|
+
},
|
|
199
|
+
{ text: "" }
|
|
200
|
+
);
|
|
201
|
+
} else {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
case "IMG":
|
|
206
|
+
return jsx(
|
|
207
|
+
"element",
|
|
208
|
+
{
|
|
209
|
+
type: "image",
|
|
210
|
+
url: element.getAttribute("src"),
|
|
211
|
+
width: element.getAttribute("width"),
|
|
212
|
+
height: element.getAttribute("height")
|
|
213
|
+
},
|
|
214
|
+
{ text: "" }
|
|
215
|
+
);
|
|
216
|
+
case "VIDEO":
|
|
217
|
+
return jsx(
|
|
218
|
+
"element",
|
|
219
|
+
{
|
|
220
|
+
type: "video",
|
|
221
|
+
url: element.getAttribute("src"),
|
|
222
|
+
width: element.getAttribute("width"),
|
|
223
|
+
height: element.getAttribute("height")
|
|
224
|
+
},
|
|
225
|
+
{ text: "" }
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
const nodeAttributes = {
|
|
229
|
+
...markAttributes
|
|
230
|
+
};
|
|
231
|
+
switch (tagName) {
|
|
232
|
+
case "STRONG":
|
|
233
|
+
case "B":
|
|
234
|
+
nodeAttributes.bold = true;
|
|
235
|
+
break;
|
|
236
|
+
case "EM":
|
|
237
|
+
case "I":
|
|
238
|
+
nodeAttributes.italic = true;
|
|
239
|
+
break;
|
|
240
|
+
case "U":
|
|
241
|
+
nodeAttributes.underline = true;
|
|
242
|
+
break;
|
|
243
|
+
case "DEL":
|
|
244
|
+
case "S":
|
|
245
|
+
nodeAttributes.strikethrough = true;
|
|
246
|
+
break;
|
|
247
|
+
case "CODE":
|
|
248
|
+
nodeAttributes.code = true;
|
|
249
|
+
break;
|
|
250
|
+
case "SUP":
|
|
251
|
+
nodeAttributes.superscript = true;
|
|
252
|
+
break;
|
|
253
|
+
case "SUB":
|
|
254
|
+
nodeAttributes.subscript = true;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
const children = Array.from(element.childNodes).map((node2) => deserialize(node2, nodeAttributes)).flat().filter(Boolean);
|
|
258
|
+
if (children.length === 0) {
|
|
259
|
+
children.push(jsx("text", nodeAttributes, ""));
|
|
260
|
+
}
|
|
261
|
+
switch (tagName) {
|
|
262
|
+
case "BODY":
|
|
263
|
+
return jsx("fragment", {}, children);
|
|
264
|
+
case "P":
|
|
265
|
+
case "BLOCKQUOTE":
|
|
266
|
+
case "H1":
|
|
267
|
+
case "H2":
|
|
268
|
+
case "H3":
|
|
269
|
+
case "H4":
|
|
270
|
+
case "H5":
|
|
271
|
+
case "H6": {
|
|
272
|
+
const attributes = {};
|
|
273
|
+
const style = getStyleObject(element);
|
|
274
|
+
if (style["padding-left"]) {
|
|
275
|
+
attributes.indent = parseFloat(style["padding-left"]) / INDENT_DELTA;
|
|
276
|
+
}
|
|
277
|
+
if (style["text-align"]) {
|
|
278
|
+
attributes.align = style["text-align"];
|
|
279
|
+
}
|
|
280
|
+
return jsx("element", { type: tagToElementTypeMap[tagName], ...attributes }, children);
|
|
281
|
+
}
|
|
282
|
+
case "LI":
|
|
283
|
+
case "TABLE":
|
|
284
|
+
case "THEAD":
|
|
285
|
+
case "TBODY":
|
|
286
|
+
case "TR":
|
|
287
|
+
case "TD":
|
|
288
|
+
case "TH": {
|
|
289
|
+
return jsx("element", { type: tagToElementTypeMap[tagName] }, children);
|
|
290
|
+
}
|
|
291
|
+
case "A":
|
|
292
|
+
return jsx(
|
|
293
|
+
"element",
|
|
294
|
+
{
|
|
295
|
+
type: "link",
|
|
296
|
+
target: element.getAttribute("target"),
|
|
297
|
+
url: element.getAttribute("href")
|
|
298
|
+
},
|
|
299
|
+
children
|
|
300
|
+
);
|
|
301
|
+
default:
|
|
302
|
+
return children;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function setContent(editor, html) {
|
|
306
|
+
const selection = editor.selection;
|
|
307
|
+
const fragment = editor.deserialize(html);
|
|
308
|
+
editor.select([]);
|
|
309
|
+
editor.delete();
|
|
310
|
+
editor.insertFragment(fragment);
|
|
311
|
+
if (selection) {
|
|
312
|
+
const anchorNode = Node$1.getIf(editor, selection.anchor.path);
|
|
313
|
+
const focusNode = Node$1.getIf(editor, selection.focus.path);
|
|
314
|
+
if (anchorNode && focusNode) {
|
|
315
|
+
editor.setSelection(selection);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function getContent(editor) {
|
|
320
|
+
const { children } = editor;
|
|
321
|
+
const isEmpty = children.length === 1 && Element.isElement(children[0]) && editor.isEmpty(children[0]);
|
|
322
|
+
return isEmpty ? "" : editor.serialize();
|
|
323
|
+
}
|
|
324
|
+
function withSerialize(editor) {
|
|
325
|
+
editor.serialize = () => {
|
|
326
|
+
return serialize(editor).trim();
|
|
327
|
+
};
|
|
328
|
+
editor.deserialize = (html) => {
|
|
329
|
+
const document = new DOMParser().parseFromString(html, "text/html");
|
|
330
|
+
const deserializedResult = deserialize(document.body);
|
|
331
|
+
return deserializedResult ? toArray(deserializedResult) : [];
|
|
332
|
+
};
|
|
333
|
+
editor.setContent = (html) => {
|
|
334
|
+
setContent(editor, html);
|
|
335
|
+
};
|
|
336
|
+
editor.getContent = () => {
|
|
337
|
+
return getContent(editor);
|
|
338
|
+
};
|
|
339
|
+
return editor;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export { withSerialize };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Editor } from 'slate-vue3/core';
|
|
2
|
+
declare module 'slate-vue3/core' {
|
|
3
|
+
interface BaseEditor {
|
|
4
|
+
formatSize: (value: string) => void;
|
|
5
|
+
formatSizeDelta: (delta: number, callback: (numSize: number) => void) => void;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare function withSize(editor: Editor): import("../types").CustomEditor;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Range, Editor } from 'slate-vue3/core';
|
|
2
|
+
import { DOMEditor } from 'slate-vue3/dom';
|
|
3
|
+
import { getStyle } from '../../../utils/css.js';
|
|
4
|
+
|
|
5
|
+
function formatSize(editor, value) {
|
|
6
|
+
if (!editor.selection) return;
|
|
7
|
+
if (Range.isCollapsed(editor.selection)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
Editor.addMark(editor, "size", value);
|
|
11
|
+
}
|
|
12
|
+
function formatSizeDelta(editor, delta, callback) {
|
|
13
|
+
if (!editor.selection) return;
|
|
14
|
+
if (Range.isCollapsed(editor.selection)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const marks = Editor.marks(editor);
|
|
18
|
+
const size = marks ? marks["size"] : "";
|
|
19
|
+
let numSize = 14;
|
|
20
|
+
if (size) {
|
|
21
|
+
numSize = parseInt(size);
|
|
22
|
+
} else {
|
|
23
|
+
const domRange = DOMEditor.toDOMRange(editor, editor.selection);
|
|
24
|
+
let node = domRange.startContainer;
|
|
25
|
+
if (node.nodeType === 3) {
|
|
26
|
+
node = node.parentElement;
|
|
27
|
+
}
|
|
28
|
+
numSize = parseInt(getStyle(node, "fontSize"));
|
|
29
|
+
}
|
|
30
|
+
numSize += delta;
|
|
31
|
+
if (numSize < 0) {
|
|
32
|
+
numSize = 0;
|
|
33
|
+
}
|
|
34
|
+
Editor.addMark(editor, "size", numSize + "px");
|
|
35
|
+
callback(numSize);
|
|
36
|
+
}
|
|
37
|
+
function withSize(editor) {
|
|
38
|
+
editor.formatSize = (value) => {
|
|
39
|
+
formatSize(editor, value);
|
|
40
|
+
};
|
|
41
|
+
editor.formatSizeDelta = (delta, callback) => {
|
|
42
|
+
formatSizeDelta(editor, delta, callback);
|
|
43
|
+
};
|
|
44
|
+
return editor;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { withSize };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Editor, Path } from 'slate-vue3/core';
|
|
2
|
+
import { type TableElement, type TableCellElement } from '../types';
|
|
3
|
+
declare module 'slate-vue3/core' {
|
|
4
|
+
interface BaseEditor {
|
|
5
|
+
insertTable: (rowCount: number, columnCount: number) => void;
|
|
6
|
+
insertRow: (tablePath: Path, cellPath: Path, isNext?: boolean) => void;
|
|
7
|
+
insertRowAbove: (tablePath: Path, cellPath: Path) => void;
|
|
8
|
+
insertRowBelow: (tablePath: Path, cellPath: Path) => void;
|
|
9
|
+
insertColumn: (tablePath: Path, cellPath: Path, isNext?: boolean) => void;
|
|
10
|
+
insertColumnLeft: (tablePath: Path, cellPath: Path) => void;
|
|
11
|
+
insertColumnRight: (tablePath: Path, cellPath: Path) => void;
|
|
12
|
+
deleteRow: (tablePath: Path, cellPath: Path) => void;
|
|
13
|
+
deleteColumn: (tablePath: Path, cellPath: Path) => void;
|
|
14
|
+
deleteTable: (tablePath: Path) => void;
|
|
15
|
+
moveToHead: (tablePath: Path, cellPath: Path) => void;
|
|
16
|
+
moveToBody: (tablePath: Path, cellPath: Path) => void;
|
|
17
|
+
isTable: (node: any) => node is TableElement;
|
|
18
|
+
isTableCell: (node: any) => node is TableCellElement;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare function withTable(editor: Editor): import("../types").CustomEditor;
|