@worktile/theia 3.0.9 → 3.1.0-next.0
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 +11 -11
- package/components/color-select/color-select.component.d.ts +32 -32
- package/components/color-select/color-select.component.scss +107 -107
- package/components/column-resize/column-resize-notifier.d.ts +35 -35
- package/components/column-resize/column-resize.directive.d.ts +26 -26
- package/components/column-resize/column-resize.module.d.ts +14 -14
- package/components/column-resize/event-dispatcher.d.ts +31 -31
- package/components/column-resize/overlay-handle.component.d.ts +33 -33
- package/components/column-resize/resize-ref.d.ts +25 -25
- package/components/column-resize/resizing.store.d.ts +28 -28
- package/components/column-resize/selectors.d.ts +3 -3
- package/components/contextmenu/contextmenu.component.d.ts +22 -22
- package/components/conversion-hint/conversion-hint.component.d.ts +18 -18
- package/components/conversion-hint/conversion-hint.component.scss +11 -11
- package/components/element/element.component.d.ts +7 -7
- package/components/inline-toolbar/inline-toolbar.component.d.ts +26 -26
- package/components/nav-split-line/nav-split-line.component.d.ts +13 -13
- package/components/table-select/table-select.component.d.ts +20 -20
- package/components/table-select/table-select.component.scss +35 -35
- package/components/template/template.component.d.ts +15 -15
- package/components/text/text.component.d.ts +14 -14
- package/components/toolbar/toolbar.component.d.ts +64 -65
- package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +33 -33
- package/components/toolbar-group/toolbar-group.component.d.ts +33 -33
- package/components/toolbar-group/toolbar-group.component.scss +17 -17
- package/components/toolbar-item/toolbar-item.component.d.ts +17 -18
- package/constants/auto-format-rules.d.ts +2 -2
- package/constants/code.d.ts +9 -9
- package/constants/color-select.d.ts +14 -14
- package/constants/default.d.ts +9 -9
- package/constants/error.d.ts +5 -5
- package/constants/index.d.ts +5 -5
- package/constants/node-types.d.ts +99 -99
- package/constants/selector.d.ts +2 -2
- package/constants/toolbar.d.ts +17 -17
- package/core/create-plugin.d.ts +2 -2
- package/core/create-toolbar.d.ts +5 -5
- package/core/index.d.ts +4 -4
- package/core/toolbar-item/base-toolbar-item.d.ts +29 -29
- package/core/utils/combine-plugins.d.ts +2 -2
- package/core/utils/flatten-deep-plugins.d.ts +6 -6
- package/core/utils/get-plugin-options.d.ts +2 -2
- package/core/utils/get-plugin.d.ts +2 -2
- package/core/utils/get-plugins.d.ts +2 -2
- package/core/utils/index.d.ts +10 -10
- package/core/utils/merge-array.d.ts +1 -1
- package/core/utils/merge-deep-plugins.d.ts +2 -2
- package/core/utils/merge-options.d.ts +2 -2
- package/core/utils/nested-structure-by-key.d.ts +2 -2
- package/core/utils/plugins-by-key.d.ts +2 -2
- package/core/with-theia.d.ts +4 -4
- package/custom-types.d.ts +131 -131
- package/editor.component.d.ts +92 -92
- package/editor.module.d.ts +98 -98
- package/esm2020/components/color-select/color-select.component.mjs +109 -0
- package/esm2020/components/column-resize/column-resize-notifier.mjs +31 -0
- package/{esm2015/components/column-resize/column-resize.directive.js → esm2020/components/column-resize/column-resize.directive.mjs} +99 -99
- package/esm2020/components/column-resize/column-resize.module.mjs +33 -0
- package/{esm2015/components/column-resize/event-dispatcher.js → esm2020/components/column-resize/event-dispatcher.mjs} +56 -56
- package/{esm2015/components/column-resize/overlay-handle.component.js → esm2020/components/column-resize/overlay-handle.component.mjs} +140 -140
- package/{esm2015/components/column-resize/resize-ref.js → esm2020/components/column-resize/resize-ref.mjs} +25 -25
- package/{esm2015/components/column-resize/resizing.store.js → esm2020/components/column-resize/resizing.store.mjs} +155 -155
- package/{esm2015/components/column-resize/selectors.js → esm2020/components/column-resize/selectors.mjs} +4 -4
- package/esm2020/components/contextmenu/contextmenu.component.mjs +61 -0
- package/esm2020/components/conversion-hint/conversion-hint.component.mjs +54 -0
- package/esm2020/components/element/element.component.mjs +23 -0
- package/esm2020/components/inline-toolbar/inline-toolbar.component.mjs +138 -0
- package/{esm2015/components/nav-split-line/nav-split-line.component.js → esm2020/components/nav-split-line/nav-split-line.component.mjs} +37 -37
- package/esm2020/components/table-select/table-select.component.mjs +50 -0
- package/esm2020/components/template/template.component.mjs +62 -0
- package/{esm2015/components/text/text.component.js → esm2020/components/text/text.component.mjs} +58 -58
- package/esm2020/components/toolbar/toolbar.component.mjs +241 -0
- package/esm2020/components/toolbar-dropdown/toolbar-dropdown.component.mjs +129 -0
- package/esm2020/components/toolbar-group/toolbar-group.component.mjs +110 -0
- package/esm2020/components/toolbar-item/toolbar-item.component.mjs +101 -0
- package/{esm2015/constants/auto-format-rules.js → esm2020/constants/auto-format-rules.mjs} +166 -166
- package/{esm2015/constants/code.js → esm2020/constants/code.mjs} +88 -88
- package/{esm2015/constants/color-select.js → esm2020/constants/color-select.mjs} +61 -61
- package/{esm2015/constants/default.js → esm2020/constants/default.mjs} +9 -9
- package/{esm2015/constants/error.js → esm2020/constants/error.mjs} +7 -7
- package/{esm2015/constants/index.js → esm2020/constants/index.mjs} +5 -5
- package/{esm2015/constants/node-types.js → esm2020/constants/node-types.mjs} +132 -132
- package/{esm2015/constants/selector.js → esm2020/constants/selector.mjs} +3 -3
- package/{esm2015/constants/toolbar.js → esm2020/constants/toolbar.mjs} +69 -69
- package/{esm2015/core/create-plugin.js → esm2020/core/create-plugin.mjs} +4 -4
- package/esm2020/core/create-toolbar.mjs +56 -0
- package/{esm2015/core/index.js → esm2020/core/index.mjs} +4 -4
- package/esm2020/core/toolbar-item/base-toolbar-item.mjs +90 -0
- package/{esm2015/core/utils/combine-plugins.js → esm2020/core/utils/combine-plugins.mjs} +9 -9
- package/{esm2015/core/utils/flatten-deep-plugins.js → esm2020/core/utils/flatten-deep-plugins.mjs} +18 -18
- package/esm2020/core/utils/get-plugin-options.mjs +3 -0
- package/{esm2015/core/utils/get-plugin.js → esm2020/core/utils/get-plugin.mjs} +1 -1
- package/esm2020/core/utils/get-plugins.mjs +4 -0
- package/{esm2015/core/utils/index.js → esm2020/core/utils/index.mjs} +10 -10
- package/esm2020/core/utils/merge-array.mjs +18 -0
- package/{esm2015/core/utils/merge-deep-plugins.js → esm2020/core/utils/merge-deep-plugins.mjs} +13 -13
- package/{esm2015/core/utils/merge-options.js → esm2020/core/utils/merge-options.mjs} +19 -19
- package/{esm2015/core/utils/nested-structure-by-key.js → esm2020/core/utils/nested-structure-by-key.mjs} +10 -10
- package/{esm2015/core/utils/plugins-by-key.js → esm2020/core/utils/plugins-by-key.mjs} +9 -9
- package/{esm2015/core/with-theia.js → esm2020/core/with-theia.mjs} +22 -22
- package/{esm2015/custom-types.js → esm2020/custom-types.mjs} +1 -1
- package/esm2020/editor.component.mjs +431 -0
- package/{esm2015/editor.module.js → esm2020/editor.module.mjs} +201 -202
- package/{esm2015/interfaces/auto-format.js → esm2020/interfaces/auto-format.mjs} +1 -1
- package/esm2020/interfaces/editor.mjs +25 -0
- package/{esm2015/interfaces/element.js → esm2020/interfaces/element.mjs} +1 -1
- package/{esm2015/interfaces/image.js → esm2020/interfaces/image.mjs} +2 -2
- package/{esm2015/interfaces/index.js → esm2020/interfaces/index.mjs} +8 -8
- package/{esm2015/interfaces/plugins/index.js → esm2020/interfaces/plugins/index.mjs} +4 -4
- package/{esm2015/interfaces/plugins/no-infer.js → esm2020/interfaces/plugins/no-infer.mjs} +1 -1
- package/{esm2015/interfaces/plugins/plugin-key.js → esm2020/interfaces/plugins/plugin-key.mjs} +39 -39
- package/{esm2015/interfaces/plugins/plugins.js → esm2020/interfaces/plugins/plugins.mjs} +1 -1
- package/{esm2015/interfaces/plugins/with-override.js → esm2020/interfaces/plugins/with-override.mjs} +1 -1
- package/esm2020/interfaces/reset-block-type-plugin-options.mjs +2 -0
- package/{esm2015/interfaces/toolbar.js → esm2020/interfaces/toolbar.mjs} +11 -11
- package/esm2020/interfaces/upload.mjs +2 -0
- package/{esm2015/interfaces/utility/index.js → esm2020/interfaces/utility/index.mjs} +3 -3
- package/{esm2015/interfaces/utility/nested-structure-by-key.js → esm2020/interfaces/utility/nested-structure-by-key.mjs} +1 -1
- package/{esm2015/interfaces/utility/override-by-key.js → esm2020/interfaces/utility/override-by-key.mjs} +1 -1
- package/{esm2015/interfaces/utility/types.js → esm2020/interfaces/utility/types.mjs} +1 -1
- package/{esm2015/interfaces/valid-children-types.js → esm2020/interfaces/valid-children-types.mjs} +35 -35
- package/{esm2015/interfaces/view-base.js → esm2020/interfaces/view-base.mjs} +21 -21
- package/{esm2015/pipes.js → esm2020/pipes.mjs} +42 -42
- package/esm2020/plugins/align/align.editor.mjs +47 -0
- package/{esm2015/plugins/align/align.plugin.js → esm2020/plugins/align/align.plugin.mjs} +63 -63
- package/esm2020/plugins/autoformat/autoformat.plugin.mjs +109 -0
- package/{esm2015/plugins/autoformat/transforms/auto-format-block.js → esm2020/plugins/autoformat/transforms/auto-format-block.mjs} +14 -14
- package/{esm2015/plugins/autoformat/transforms/auto-format-inline.js → esm2020/plugins/autoformat/transforms/auto-format-inline.mjs} +77 -77
- package/{esm2015/plugins/blockquote/blockquote.component.js → esm2020/plugins/blockquote/blockquote.component.mjs} +21 -21
- package/esm2020/plugins/blockquote/blockquote.editor.mjs +20 -0
- package/{esm2015/plugins/blockquote/blockquote.plugin.js → esm2020/plugins/blockquote/blockquote.plugin.mjs} +70 -70
- package/esm2020/plugins/code/code.component.mjs +241 -0
- package/{esm2015/plugins/code/code.editor.js → esm2020/plugins/code/code.editor.mjs} +47 -47
- package/{esm2015/plugins/code/code.plugin.js → esm2020/plugins/code/code.plugin.mjs} +41 -41
- package/esm2020/plugins/color/color.editor.mjs +44 -0
- package/{esm2015/plugins/color/color.plugin.js → esm2020/plugins/color/color.plugin.mjs} +27 -27
- package/esm2020/plugins/color/toolbar-item.component.mjs +123 -0
- package/esm2020/plugins/common/auto-insert-data..mjs +77 -0
- package/{esm2015/plugins/common/block-card.plugin.js → esm2020/plugins/common/block-card.plugin.mjs} +287 -287
- package/esm2020/plugins/common/get-fragment.plugin.mjs +24 -0
- package/{esm2015/plugins/common/history.plugin.js → esm2020/plugins/common/history.plugin.mjs} +30 -30
- package/{esm2015/plugins/common/move-selection.plugin.js → esm2020/plugins/common/move-selection.plugin.mjs} +89 -89
- package/{esm2015/plugins/common/remove-empty.plugin.js → esm2020/plugins/common/remove-empty.plugin.mjs} +59 -59
- package/{esm2015/plugins/common/remove-void.plugin.js → esm2020/plugins/common/remove-void.plugin.mjs} +56 -56
- package/{esm2015/plugins/common/reset-type.plugin.js → esm2020/plugins/common/reset-type.plugin.mjs} +34 -34
- package/{esm2015/plugins/common/transforms.plugin.js → esm2020/plugins/common/transforms.plugin.mjs} +17 -17
- package/{esm2015/plugins/deserializers/deserialize-html.plugin.js → esm2020/plugins/deserializers/deserialize-html.plugin.mjs} +38 -38
- package/{esm2015/plugins/deserializers/deserialize-md.plugin.js → esm2020/plugins/deserializers/deserialize-md.plugin.mjs} +121 -121
- package/esm2020/plugins/font-size/font-size.editor.mjs +98 -0
- package/{esm2015/plugins/heading/heading.editor.js → esm2020/plugins/heading/heading.editor.mjs} +53 -53
- package/{esm2015/plugins/heading/heading.plugin.js → esm2020/plugins/heading/heading.plugin.mjs} +84 -84
- package/{esm2015/plugins/hr/hr.component.js → esm2020/plugins/hr/hr.component.mjs} +40 -40
- package/{esm2015/plugins/hr/hr.editor.js → esm2020/plugins/hr/hr.editor.mjs} +7 -7
- package/{esm2015/plugins/hr/hr.plugin.js → esm2020/plugins/hr/hr.plugin.mjs} +41 -41
- package/esm2020/plugins/image/image.component.mjs +365 -0
- package/{esm2015/plugins/image/image.editor.js → esm2020/plugins/image/image.editor.mjs} +57 -57
- package/esm2020/plugins/image/image.plugin.mjs +57 -0
- package/esm2020/plugins/indent/indent.editor.mjs +71 -0
- package/esm2020/plugins/indent/indent.plugin.mjs +58 -0
- package/{esm2015/plugins/indent/on-keydown-indent.js → esm2020/plugins/indent/on-keydown-indent.mjs} +53 -53
- package/{esm2015/plugins/index.js → esm2020/plugins/index.mjs} +70 -70
- package/{esm2015/plugins/inline-code/inline-code.component.js → esm2020/plugins/inline-code/inline-code.component.mjs} +23 -23
- package/{esm2015/plugins/inline-code/inline-code.editor.js → esm2020/plugins/inline-code/inline-code.editor.mjs} +48 -49
- package/{esm2015/plugins/inline-code/inline-code.plugin.js → esm2020/plugins/inline-code/inline-code.plugin.mjs} +65 -65
- package/esm2020/plugins/link/edit/link-edit.component.mjs +105 -0
- package/esm2020/plugins/link/hover/link-hover.component.mjs +36 -0
- package/{esm2015/plugins/link/link.component.js → esm2020/plugins/link/link.component.mjs} +164 -164
- package/{esm2015/plugins/link/link.editor.js → esm2020/plugins/link/link.editor.mjs} +66 -66
- package/{esm2015/plugins/link/link.plugin.js → esm2020/plugins/link/link.plugin.mjs} +58 -58
- package/{esm2015/plugins/link/link.types.js → esm2020/plugins/link/link.types.mjs} +12 -12
- package/esm2020/plugins/list/components/bulleted-list.component.mjs +33 -0
- package/esm2020/plugins/list/components/list-item.component.mjs +93 -0
- package/esm2020/plugins/list/components/numbered-list.component.mjs +39 -0
- package/{esm2015/plugins/list/list.editor.js → esm2020/plugins/list/list.editor.mjs} +125 -125
- package/esm2020/plugins/list/list.plugin.mjs +286 -0
- package/{esm2015/plugins/list/normalizers/get-list-normalizer.js → esm2020/plugins/list/normalizers/get-list-normalizer.mjs} +39 -39
- package/esm2020/plugins/list/normalizers/normalize-list-item.mjs +18 -0
- package/{esm2015/plugins/list/normalizers/normalize-no.js → esm2020/plugins/list/normalizers/normalize-no.mjs} +42 -42
- package/{esm2015/plugins/list/on-key-down-list.js → esm2020/plugins/list/on-key-down-list.mjs} +32 -32
- package/{esm2015/plugins/list/queries/get-list-item-entry.js → esm2020/plugins/list/queries/get-list-item-entry.mjs} +27 -27
- package/{esm2015/plugins/list/queries/get-list-item-sublist.js → esm2020/plugins/list/queries/get-list-item-sublist.mjs} +12 -12
- package/{esm2015/plugins/list/queries/get-list-types.js → esm2020/plugins/list/queries/get-list-types.mjs} +5 -5
- package/{esm2015/plugins/list/queries/get-start-list-item.js → esm2020/plugins/list/queries/get-start-list-item.mjs} +26 -26
- package/{esm2015/plugins/list/queries/has-list-in-list-item.js → esm2020/plugins/list/queries/has-list-in-list-item.mjs} +27 -27
- package/{esm2015/plugins/list/queries/is-in-list.js → esm2020/plugins/list/queries/is-in-list.mjs} +5 -5
- package/{esm2015/plugins/list/queries/is-list-nested.js → esm2020/plugins/list/queries/is-list-nested.mjs} +10 -10
- package/{esm2015/plugins/list/queries/is-list.js → esm2020/plugins/list/queries/is-list.mjs} +5 -5
- package/{esm2015/plugins/list/queries/is-node-type-list.js → esm2020/plugins/list/queries/is-node-type-list.mjs} +4 -4
- package/{esm2015/plugins/list/queries/is-selection-at-list-item-start.js → esm2020/plugins/list/queries/is-selection-at-list-item-start.mjs} +12 -12
- package/{esm2015/plugins/list/queries/is-selection-in-same-list-item.js → esm2020/plugins/list/queries/is-selection-in-same-list-item.mjs} +16 -16
- package/{esm2015/plugins/list/queries/is-single-list-item.js → esm2020/plugins/list/queries/is-single-list-item.mjs} +9 -9
- package/{esm2015/plugins/list/transforms/insert-list-data.js → esm2020/plugins/list/transforms/insert-list-data.mjs} +71 -71
- package/{esm2015/plugins/list/transforms/insert-list-item.js → esm2020/plugins/list/transforms/insert-list-item.mjs} +72 -72
- package/{esm2015/plugins/list/transforms/move-list-item-down.js → esm2020/plugins/list/transforms/move-list-item-down.mjs} +41 -41
- package/{esm2015/plugins/list/transforms/move-list-item-sublist-items-to-list-item-sublist.js → esm2020/plugins/list/transforms/move-list-item-sublist-items-to-list-item-sublist.mjs} +42 -42
- package/{esm2015/plugins/list/transforms/move-list-item-sublist-items-to-list.js → esm2020/plugins/list/transforms/move-list-item-sublist-items-to-list.mjs} +29 -29
- package/{esm2015/plugins/list/transforms/move-list-item-up.js → esm2020/plugins/list/transforms/move-list-item-up.mjs} +77 -77
- package/{esm2015/plugins/list/transforms/unwrap-list.js → esm2020/plugins/list/transforms/unwrap-list.mjs} +9 -9
- package/esm2020/plugins/list/types.mjs +2 -0
- package/esm2020/plugins/mark/mark.editor.mjs +28 -0
- package/esm2020/plugins/mark/mark.plugin.mjs +105 -0
- package/esm2020/plugins/node-id/node-id.plugin.mjs +78 -0
- package/esm2020/plugins/normalizers/insert-paragraph-nodes.mjs +28 -0
- package/{esm2015/plugins/normalizers/remove-empty-nodes.js → esm2020/plugins/normalizers/remove-empty-nodes.mjs} +17 -17
- package/esm2020/plugins/normalizers/trailing-node.plugin.mjs +33 -0
- package/{esm2015/plugins/paint-format/paint-format.editor.js → esm2020/plugins/paint-format/paint-format.editor.mjs} +122 -122
- package/{esm2015/plugins/public-api.js → esm2020/plugins/public-api.mjs} +15 -15
- package/esm2020/plugins/quick-insert/components/quick-insert.component.mjs +96 -0
- package/esm2020/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.mjs +80 -0
- package/{esm2015/plugins/quick-insert/quick-insert.editor.js → esm2020/plugins/quick-insert/quick-insert.editor.mjs} +52 -52
- package/esm2020/plugins/quick-insert/quick-insert.plugin.mjs +74 -0
- package/esm2020/plugins/soft-break/soft-break.plugin.mjs +36 -0
- package/{esm2015/plugins/soft-break/soft-break.types.js → esm2020/plugins/soft-break/soft-break.types.mjs} +1 -1
- package/esm2020/plugins/table/components/insert-mark/insert-mark.component.mjs +100 -0
- package/{esm2015/plugins/table/components/row/row.component.js → esm2020/plugins/table/components/row/row.component.mjs} +47 -47
- package/esm2020/plugins/table/components/table.component.mjs +461 -0
- package/esm2020/plugins/table/components/td/td.component.mjs +696 -0
- package/{esm2015/plugins/table/components/toolbar/table-options.component.js → esm2020/plugins/table/components/toolbar/table-options.component.mjs} +72 -69
- package/esm2020/plugins/table/components/toolbar/table-toolbar.component.mjs +159 -0
- package/{esm2015/plugins/table/table.editor.js → esm2020/plugins/table/table.editor.mjs} +182 -182
- package/esm2020/plugins/table/table.plugin.mjs +427 -0
- package/{esm2015/plugins/table/table.service.js → esm2020/plugins/table/table.service.mjs} +103 -103
- package/esm2020/plugins/table/table.store.mjs +484 -0
- package/{esm2015/plugins/table/table.types.js → esm2020/plugins/table/table.types.mjs} +33 -33
- package/esm2020/plugins/table/toolbar-item.component.mjs +85 -0
- package/esm2020/plugins/table/transforms/clear-cell.mjs +14 -0
- package/{esm2015/plugins/table/transforms/clear-table-node.js → esm2020/plugins/table/transforms/clear-table-node.mjs} +27 -27
- package/{esm2015/plugins/table/transforms/insert-column.js → esm2020/plugins/table/transforms/insert-column.mjs} +57 -57
- package/{esm2015/plugins/table/transforms/insert-row.js → esm2020/plugins/table/transforms/insert-row.mjs} +42 -42
- package/esm2020/plugins/table/transforms/insert-table.mjs +15 -0
- package/{esm2015/plugins/table/transforms/remove-column.js → esm2020/plugins/table/transforms/remove-column.mjs} +51 -51
- package/{esm2015/plugins/table/transforms/remove-row.js → esm2020/plugins/table/transforms/remove-row.mjs} +50 -50
- package/{esm2015/plugins/table/transforms/remove-table.js → esm2020/plugins/table/transforms/remove-table.mjs} +49 -49
- package/{esm2015/plugins/table/utils/add-columns.js → esm2020/plugins/table/utils/add-columns.mjs} +28 -28
- package/{esm2015/plugins/table/utils/calc-anchor-position.js → esm2020/plugins/table/utils/calc-anchor-position.mjs} +24 -24
- package/{esm2015/plugins/table/utils/calc-span.js → esm2020/plugins/table/utils/calc-span.mjs} +72 -72
- package/{esm2015/plugins/table/utils/create-cell.js → esm2020/plugins/table/utils/create-cell.mjs} +19 -19
- package/{esm2015/plugins/table/utils/create-row.js → esm2020/plugins/table/utils/create-row.mjs} +12 -12
- package/{esm2015/plugins/table/utils/create-table.js → esm2020/plugins/table/utils/create-table.mjs} +13 -13
- package/{esm2015/plugins/table/utils/get-base-height.js → esm2020/plugins/table/utils/get-base-height.mjs} +22 -22
- package/{esm2015/plugins/table/utils/get-select-cell-node.js → esm2020/plugins/table/utils/get-select-cell-node.mjs} +19 -16
- package/{esm2015/plugins/table/utils/index.js → esm2020/plugins/table/utils/index.mjs} +8 -8
- package/{esm2015/plugins/table/utils/is-range-in-table.js → esm2020/plugins/table/utils/is-range-in-table.mjs} +16 -16
- package/{esm2015/plugins/table/utils/is-selection-in-table.js → esm2020/plugins/table/utils/is-selection-in-table.mjs} +11 -11
- package/{esm2015/plugins/table/utils/is-virtual-key.js → esm2020/plugins/table/utils/is-virtual-key.mjs} +13 -13
- package/{esm2015/plugins/table/utils/merge-cell.js → esm2020/plugins/table/utils/merge-cell.mjs} +90 -90
- package/{esm2015/plugins/table/utils/next-path.js → esm2020/plugins/table/utils/next-path.mjs} +5 -5
- package/{esm2015/plugins/table/utils/normalize-table.js → esm2020/plugins/table/utils/normalize-table.mjs} +30 -30
- package/{esm2015/plugins/table/utils/remove-columns.js → esm2020/plugins/table/utils/remove-columns.mjs} +23 -23
- package/{esm2015/plugins/table/utils/set-menu-cell-invisibility.js → esm2020/plugins/table/utils/set-menu-cell-invisibility.mjs} +15 -15
- package/{esm2015/plugins/table/utils/split-cell.js → esm2020/plugins/table/utils/split-cell.mjs} +31 -31
- package/{esm2015/plugins/table/utils/table-position.js → esm2020/plugins/table/utils/table-position.mjs} +242 -242
- package/esm2020/plugins/todo-item/todo-item.component.mjs +64 -0
- package/{esm2015/plugins/todo-item/todo-item.editor.js → esm2020/plugins/todo-item/todo-item.editor.mjs} +31 -31
- package/{esm2015/plugins/todo-item/todo-item.plugin.js → esm2020/plugins/todo-item/todo-item.plugin.mjs} +78 -78
- package/esm2020/plugins/vertical-align/toolbar-item.component.mjs +83 -0
- package/{esm2015/plugins/vertical-align/vertical-align.editor.js → esm2020/plugins/vertical-align/vertical-align.editor.mjs} +54 -54
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +23 -23
- package/{esm2015/queries/anchor-block-entry.js → esm2020/queries/anchor-block-entry.mjs} +13 -13
- package/{esm2015/queries/anchor-block.js → esm2020/queries/anchor-block.mjs} +6 -6
- package/{esm2015/queries/anchor-inline-entry.js → esm2020/queries/anchor-inline-entry.mjs} +10 -10
- package/{esm2015/queries/find-descendant.js → esm2020/queries/find-descendant.mjs} +47 -47
- package/{esm2015/queries/find-node.js → esm2020/queries/find-node.mjs} +45 -45
- package/{esm2015/queries/find-path.js → esm2020/queries/find-path.mjs} +28 -28
- package/esm2020/queries/get-above-by-type.mjs +14 -0
- package/{esm2015/queries/get-above.js → esm2020/queries/get-above.mjs} +9 -9
- package/{esm2015/queries/get-anchor-block-entry.js → esm2020/queries/get-anchor-block-entry.mjs} +8 -8
- package/esm2020/queries/get-block-above.mjs +10 -0
- package/esm2020/queries/get-block-card-above.mjs +10 -0
- package/{esm2015/queries/get-block-card-cursor.js → esm2020/queries/get-block-card-cursor.mjs} +5 -5
- package/{esm2015/queries/get-container-blocks.js → esm2020/queries/get-container-blocks.mjs} +11 -11
- package/{esm2015/queries/get-directly-parent.js → esm2020/queries/get-directly-parent.mjs} +11 -11
- package/{esm2015/queries/get-insert-elements-path.js → esm2020/queries/get-insert-elements-path.mjs} +43 -43
- package/{esm2015/queries/get-last-child-path.js → esm2020/queries/get-last-child-path.mjs} +9 -9
- package/{esm2015/queries/get-last-node.js → esm2020/queries/get-last-node.mjs} +17 -17
- package/{esm2015/queries/get-next-sibling-nodes.js → esm2020/queries/get-next-sibling-nodes.mjs} +17 -17
- package/{esm2015/queries/get-node.js → esm2020/queries/get-node.mjs} +10 -10
- package/esm2020/queries/get-nodes-by-type.mjs +15 -0
- package/{esm2015/queries/get-nodes.js → esm2020/queries/get-nodes.mjs} +7 -7
- package/{esm2015/queries/get-parent.js → esm2020/queries/get-parent.mjs} +12 -12
- package/esm2020/queries/get-plain-text.mjs +16 -0
- package/{esm2015/queries/get-plugin-by-toolbar.js → esm2020/queries/get-plugin-by-toolbar.mjs} +12 -12
- package/{esm2015/queries/get-point-before.js → esm2020/queries/get-point-before.mjs} +62 -62
- package/{esm2015/queries/get-point-from-location.js → esm2020/queries/get-point-from-location.mjs} +15 -15
- package/{esm2015/queries/get-previous-path.js → esm2020/queries/get-previous-path.mjs} +9 -9
- package/{esm2015/queries/get-rang-from-block-start.js → esm2020/queries/get-rang-from-block-start.mjs} +16 -16
- package/{esm2015/queries/get-range-before.js → esm2020/queries/get-range-before.mjs} +17 -17
- package/esm2020/queries/get-selection-marks.mjs +18 -0
- package/{esm2015/queries/get-selection-nodes-by-type.js → esm2020/queries/get-selection-nodes-by-type.mjs} +29 -29
- package/{esm2015/queries/get-text.js → esm2020/queries/get-text.mjs} +9 -9
- package/esm2020/queries/get-toolbar-disabled.mjs +13 -0
- package/{esm2015/queries/index.js → esm2020/queries/index.mjs} +58 -58
- package/{esm2015/queries/is-across-blocks.js → esm2020/queries/is-across-blocks.mjs} +7 -7
- package/{esm2015/queries/is-ancestor-empty.js → esm2020/queries/is-ancestor-empty.mjs} +6 -6
- package/{esm2015/queries/is-ancestor.js → esm2020/queries/is-ancestor.mjs} +3 -3
- package/{esm2015/queries/is-block-above-empty.js → esm2020/queries/is-block-above-empty.mjs} +11 -11
- package/{esm2015/queries/is-block-active.js → esm2020/queries/is-block-active.mjs} +7 -7
- package/{esm2015/queries/is-block-card-cursor.js → esm2020/queries/is-block-card-cursor.mjs} +4 -4
- package/{esm2015/queries/is-block-text-empty-after-selection.js → esm2020/queries/is-block-text-empty-after-selection.mjs} +31 -31
- package/{esm2015/queries/is-collapsed.js → esm2020/queries/is-collapsed.mjs} +7 -7
- package/{esm2015/queries/is-contain-nested-type.js → esm2020/queries/is-contain-nested-type.mjs} +28 -28
- package/{esm2015/queries/is-container-type.js → esm2020/queries/is-container-type.mjs} +2 -2
- package/{esm2015/queries/is-descendant.js → esm2020/queries/is-descendant.mjs} +3 -3
- package/{esm2015/queries/is-empty-content.js → esm2020/queries/is-empty-content.mjs} +14 -14
- package/{esm2015/queries/is-empty-paragraph-by-path.js → esm2020/queries/is-empty-paragraph-by-path.mjs} +7 -7
- package/{esm2015/queries/is-empty-paragraph.js → esm2020/queries/is-empty-paragraph.mjs} +11 -11
- package/{esm2015/queries/is-first-child.js → esm2020/queries/is-first-child.mjs} +5 -5
- package/{esm2015/queries/is-include-types.js → esm2020/queries/is-include-types.mjs} +11 -11
- package/{esm2015/queries/is-node-type-in.js → esm2020/queries/is-node-type-in.mjs} +9 -9
- package/{esm2015/queries/is-node-type.js → esm2020/queries/is-node-type.mjs} +15 -15
- package/{esm2015/queries/is-paragraph.js → esm2020/queries/is-paragraph.mjs} +9 -9
- package/{esm2015/queries/is-point-at-root.js → esm2020/queries/is-point-at-root.mjs} +2 -2
- package/esm2020/queries/is-range-across-blocks.mjs +22 -0
- package/{esm2015/queries/is-range-at-root.js → esm2020/queries/is-range-at-root.mjs} +3 -3
- package/{esm2015/queries/is-start.js → esm2020/queries/is-start.mjs} +6 -6
- package/{esm2015/queries/some-node.js → esm2020/queries/some-node.mjs} +9 -9
- package/{esm2015/services/color-select.service.js → esm2020/services/color-select.service.mjs} +50 -50
- package/esm2020/services/context.service.mjs +59 -0
- package/{esm2015/services/table-contextmenu.service.js → esm2020/services/table-contextmenu.service.mjs} +190 -190
- package/esm2020/services/toolbar.service.mjs +48 -0
- package/{esm2015/shortcuts/index.js → esm2020/shortcuts/index.mjs} +5 -5
- package/{esm2015/shortcuts/mark.js → esm2020/shortcuts/mark.mjs} +24 -24
- package/{esm2015/transforms/apply-deep-to-nodes.js → esm2020/transforms/apply-deep-to-nodes.mjs} +21 -21
- package/{esm2015/transforms/clear-marks.js → esm2020/transforms/clear-marks.mjs} +23 -23
- package/{esm2015/transforms/close-conversion-hint.js → esm2020/transforms/close-conversion-hint.mjs} +8 -8
- package/{esm2015/transforms/delete-element.js → esm2020/transforms/delete-element.mjs} +11 -11
- package/{esm2015/transforms/handle-continual-delete-backward.js → esm2020/transforms/handle-continual-delete-backward.mjs} +17 -17
- package/{esm2015/transforms/handle-continual-insert-break.js → esm2020/transforms/handle-continual-insert-break.mjs} +19 -19
- package/{esm2015/transforms/index.js → esm2020/transforms/index.mjs} +18 -18
- package/esm2020/transforms/insert-elements.mjs +34 -0
- package/{esm2015/transforms/insert-paragraph.js → esm2020/transforms/insert-paragraph.mjs} +6 -6
- package/esm2020/transforms/merge-deep-to-nodes.mjs +9 -0
- package/{esm2015/transforms/move-children.js → esm2020/transforms/move-children.mjs} +21 -21
- package/{esm2015/transforms/on-keydown-reset-block-type.js → esm2020/transforms/on-keydown-reset-block-type.mjs} +22 -22
- package/{esm2015/transforms/set-end-selection.js → esm2020/transforms/set-end-selection.mjs} +10 -10
- package/{esm2015/transforms/set-marks.js → esm2020/transforms/set-marks.mjs} +9 -9
- package/{esm2015/transforms/set-node.js → esm2020/transforms/set-node.mjs} +5 -5
- package/{esm2015/transforms/split-node.js → esm2020/transforms/split-node.mjs} +31 -31
- package/{esm2015/transforms/un-hang-range.js → esm2020/transforms/un-hang-range.mjs} +11 -11
- package/{esm2015/transforms/un-wrap.js → esm2020/transforms/un-wrap.mjs} +11 -11
- package/esm2020/transforms/unwrap-nodes-by-type.mjs +14 -0
- package/{esm2015/utils/auto-focus.js → esm2020/utils/auto-focus.mjs} +13 -13
- package/{esm2015/utils/auto-scroll-view.js → esm2020/utils/auto-scroll-view.mjs} +24 -24
- package/{esm2015/utils/cast-array.js → esm2020/utils/cast-array.mjs} +7 -7
- package/{esm2015/utils/common.js → esm2020/utils/common.mjs} +2 -2
- package/{esm2015/utils/create-empty-paragraph.js → esm2020/utils/create-empty-paragraph.mjs} +14 -14
- package/{esm2015/utils/data-transform.js → esm2020/utils/data-transform.mjs} +48 -48
- package/{esm2015/utils/dom.js → esm2020/utils/dom.mjs} +46 -46
- package/{esm2015/utils/editor-uuid.js → esm2020/utils/editor-uuid.mjs} +8 -8
- package/{esm2015/utils/fragment.js → esm2020/utils/fragment.mjs} +65 -65
- package/{esm2015/utils/get-editable-element-height.js → esm2020/utils/get-editable-element-height.mjs} +6 -6
- package/{esm2015/utils/get-toolbar-class.js → esm2020/utils/get-toolbar-class.mjs} +6 -6
- package/{esm2015/utils/id-creator.js → esm2020/utils/id-creator.mjs} +11 -11
- package/{esm2015/utils/index.js → esm2020/utils/index.mjs} +13 -13
- package/{esm2015/utils/is-clean-empty-paragraph.js → esm2020/utils/is-clean-empty-paragraph.mjs} +36 -36
- package/esm2020/utils/is-inline.mjs +9 -0
- package/{esm2015/utils/lodash.js → esm2020/utils/lodash.mjs} +3 -3
- package/esm2020/utils/match.mjs +32 -0
- package/{esm2015/utils/merge-element-options.js → esm2020/utils/merge-element-options.mjs} +19 -19
- package/{esm2015/utils/weak-maps.js → esm2020/utils/weak-maps.mjs} +3 -3
- package/{esm2015/worktile-theia.js → esm2020/worktile-theia.mjs} +4 -4
- package/fesm2015/{worktile-theia.js → worktile-theia.mjs} +13096 -13169
- package/fesm2015/worktile-theia.mjs.map +1 -0
- package/fesm2020/worktile-theia.mjs +13739 -0
- package/fesm2020/worktile-theia.mjs.map +1 -0
- package/interfaces/auto-format.d.ts +64 -64
- package/interfaces/editor.d.ts +146 -146
- package/interfaces/element.d.ts +9 -9
- package/interfaces/image.d.ts +25 -25
- package/interfaces/index.d.ts +8 -8
- package/interfaces/plugins/index.d.ts +4 -4
- package/interfaces/plugins/no-infer.d.ts +1 -1
- package/interfaces/plugins/plugin-key.d.ts +48 -48
- package/interfaces/plugins/plugins.d.ts +45 -45
- package/interfaces/plugins/with-override.d.ts +7 -7
- package/interfaces/reset-block-type-plugin-options.d.ts +23 -23
- package/interfaces/toolbar.d.ts +64 -64
- package/interfaces/upload.d.ts +11 -11
- package/interfaces/utility/index.d.ts +3 -3
- package/interfaces/utility/nested-structure-by-key.d.ts +3 -3
- package/interfaces/utility/override-by-key.d.ts +3 -3
- package/interfaces/utility/types.d.ts +1 -1
- package/interfaces/valid-children-types.d.ts +9 -9
- package/interfaces/view-base.d.ts +9 -9
- package/package.json +19 -6
- package/pipes.d.ts +16 -16
- package/plugins/align/align.editor.d.ts +7 -7
- package/plugins/align/align.plugin.d.ts +2 -2
- package/plugins/autoformat/autoformat.plugin.d.ts +6 -6
- package/plugins/autoformat/transforms/auto-format-block.d.ts +5 -5
- package/plugins/autoformat/transforms/auto-format-inline.d.ts +9 -9
- package/plugins/blockquote/blockquote.component.d.ts +11 -11
- package/plugins/blockquote/blockquote.editor.d.ts +4 -4
- package/plugins/blockquote/blockquote.plugin.d.ts +2 -2
- package/plugins/code/code.component.d.ts +65 -65
- package/plugins/code/code.editor.d.ts +8 -8
- package/plugins/code/code.plugin.d.ts +2 -2
- package/plugins/color/color.editor.d.ts +8 -8
- package/plugins/color/color.plugin.d.ts +1 -1
- package/plugins/color/toolbar-item.component.d.ts +16 -16
- package/plugins/common/auto-insert-data..d.ts +2 -2
- package/plugins/common/block-card.plugin.d.ts +2 -2
- package/plugins/common/get-fragment.plugin.d.ts +6 -6
- package/plugins/common/history.plugin.d.ts +9 -9
- package/plugins/common/move-selection.plugin.d.ts +2 -2
- package/plugins/common/remove-empty.plugin.d.ts +2 -2
- package/plugins/common/remove-void.plugin.d.ts +2 -2
- package/plugins/common/reset-type.plugin.d.ts +2 -2
- package/plugins/common/transforms.plugin.d.ts +8 -8
- package/plugins/deserializers/deserialize-html.plugin.d.ts +2 -2
- package/plugins/deserializers/deserialize-md.plugin.d.ts +2 -2
- package/plugins/font-size/font-size.editor.d.ts +10 -10
- package/plugins/heading/heading.editor.d.ts +9 -9
- package/plugins/heading/heading.plugin.d.ts +7 -7
- package/plugins/hr/hr.component.d.ts +12 -12
- package/plugins/hr/hr.editor.d.ts +4 -4
- package/plugins/hr/hr.plugin.d.ts +2 -2
- package/plugins/image/image.component.d.ts +74 -74
- package/plugins/image/image.editor.d.ts +12 -12
- package/plugins/image/image.plugin.d.ts +7 -7
- package/plugins/indent/indent.editor.d.ts +10 -10
- package/plugins/indent/indent.plugin.d.ts +8 -8
- package/plugins/indent/on-keydown-indent.d.ts +3 -3
- package/plugins/index.d.ts +1 -1
- package/plugins/inline-code/inline-code.component.d.ts +9 -9
- package/plugins/inline-code/inline-code.editor.d.ts +7 -7
- package/plugins/inline-code/inline-code.plugin.d.ts +2 -2
- package/plugins/link/edit/link-edit.component.d.ts +36 -36
- package/plugins/link/hover/link-hover.component.d.ts +15 -15
- package/plugins/link/link.component.d.ts +39 -39
- package/plugins/link/link.editor.d.ts +7 -7
- package/plugins/link/link.plugin.d.ts +2 -2
- package/plugins/link/link.types.d.ts +9 -9
- package/plugins/list/components/bulleted-list.component.d.ts +15 -15
- package/plugins/list/components/list-item.component.d.ts +20 -20
- package/plugins/list/components/numbered-list.component.d.ts +16 -16
- package/plugins/list/list.editor.d.ts +12 -12
- package/plugins/list/list.plugin.d.ts +3 -3
- package/plugins/list/normalizers/get-list-normalizer.d.ts +6 -6
- package/plugins/list/normalizers/normalize-list-item.d.ts +5 -5
- package/plugins/list/normalizers/normalize-no.d.ts +2 -2
- package/plugins/list/on-key-down-list.d.ts +2 -2
- package/plugins/list/queries/get-list-item-entry.d.ts +10 -10
- package/plugins/list/queries/get-list-item-sublist.d.ts +6 -6
- package/plugins/list/queries/get-list-types.d.ts +2 -2
- package/plugins/list/queries/get-start-list-item.d.ts +8 -8
- package/plugins/list/queries/has-list-in-list-item.d.ts +15 -15
- package/plugins/list/queries/is-in-list.d.ts +2 -2
- package/plugins/list/queries/is-list-nested.d.ts +5 -5
- package/plugins/list/queries/is-list.d.ts +2 -2
- package/plugins/list/queries/is-node-type-list.d.ts +2 -2
- package/plugins/list/queries/is-selection-at-list-item-start.d.ts +5 -5
- package/plugins/list/queries/is-selection-in-same-list-item.d.ts +5 -5
- package/plugins/list/queries/is-single-list-item.d.ts +5 -5
- package/plugins/list/transforms/insert-list-data.d.ts +12 -12
- package/plugins/list/transforms/insert-list-item.d.ts +5 -5
- package/plugins/list/transforms/move-list-item-down.d.ts +6 -6
- package/plugins/list/transforms/move-list-item-sublist-items-to-list-item-sublist.d.ts +20 -20
- package/plugins/list/transforms/move-list-item-sublist-items-to-list.d.ts +19 -19
- package/plugins/list/transforms/move-list-item-up.d.ts +10 -10
- package/plugins/list/transforms/unwrap-list.d.ts +2 -2
- package/plugins/list/types.d.ts +7 -7
- package/plugins/mark/mark.editor.d.ts +8 -8
- package/plugins/mark/mark.plugin.d.ts +3 -3
- package/plugins/node-id/node-id.plugin.d.ts +8 -8
- package/plugins/normalizers/insert-paragraph-nodes.d.ts +7 -7
- package/plugins/normalizers/remove-empty-nodes.d.ts +7 -7
- package/plugins/normalizers/trailing-node.plugin.d.ts +9 -9
- package/plugins/paint-format/paint-format.editor.d.ts +8 -8
- package/plugins/public-api.d.ts +15 -15
- package/plugins/quick-insert/components/quick-insert.component.d.ts +28 -28
- package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +28 -28
- package/plugins/quick-insert/quick-insert.editor.d.ts +7 -7
- package/plugins/quick-insert/quick-insert.plugin.d.ts +10 -10
- package/plugins/soft-break/soft-break.plugin.d.ts +5 -5
- package/plugins/soft-break/soft-break.types.d.ts +8 -8
- package/plugins/table/components/insert-mark/insert-mark.component.d.ts +24 -24
- package/plugins/table/components/row/row.component.d.ts +14 -14
- package/plugins/table/components/table.component.d.ts +79 -79
- package/plugins/table/components/td/td.component.d.ts +95 -95
- package/plugins/table/components/toolbar/table-options.component.d.ts +20 -20
- package/plugins/table/components/toolbar/table-toolbar.component.d.ts +38 -38
- package/plugins/table/table.editor.d.ts +25 -25
- package/plugins/table/table.plugin.d.ts +3 -3
- package/plugins/table/table.service.d.ts +30 -30
- package/plugins/table/table.store.d.ts +71 -71
- package/plugins/table/table.types.d.ts +67 -67
- package/plugins/table/toolbar-item.component.d.ts +17 -17
- package/plugins/table/transforms/clear-cell.d.ts +6 -6
- package/plugins/table/transforms/clear-table-node.d.ts +6 -6
- package/plugins/table/transforms/insert-column.d.ts +12 -12
- package/plugins/table/transforms/insert-row.d.ts +6 -6
- package/plugins/table/transforms/insert-table.d.ts +6 -6
- package/plugins/table/transforms/remove-column.d.ts +3 -3
- package/plugins/table/transforms/remove-row.d.ts +3 -3
- package/plugins/table/transforms/remove-table.d.ts +3 -3
- package/plugins/table/utils/add-columns.d.ts +2 -2
- package/plugins/table/utils/calc-anchor-position.d.ts +6 -6
- package/plugins/table/utils/calc-span.d.ts +11 -11
- package/plugins/table/utils/create-cell.d.ts +16 -16
- package/plugins/table/utils/create-row.d.ts +7 -7
- package/plugins/table/utils/create-table.d.ts +7 -7
- package/plugins/table/utils/get-base-height.d.ts +9 -9
- package/plugins/table/utils/get-select-cell-node.d.ts +7 -7
- package/plugins/table/utils/index.d.ts +7 -7
- package/plugins/table/utils/is-range-in-table.d.ts +6 -6
- package/plugins/table/utils/is-selection-in-table.d.ts +6 -6
- package/plugins/table/utils/is-virtual-key.d.ts +1 -1
- package/plugins/table/utils/merge-cell.d.ts +21 -21
- package/plugins/table/utils/next-path.d.ts +2 -2
- package/plugins/table/utils/normalize-table.d.ts +2 -2
- package/plugins/table/utils/remove-columns.d.ts +2 -2
- package/plugins/table/utils/set-menu-cell-invisibility.d.ts +3 -3
- package/plugins/table/utils/split-cell.d.ts +4 -4
- package/plugins/table/utils/table-position.d.ts +97 -97
- package/plugins/todo-item/todo-item.component.d.ts +21 -21
- package/plugins/todo-item/todo-item.editor.d.ts +5 -5
- package/plugins/todo-item/todo-item.plugin.d.ts +5 -5
- package/plugins/vertical-align/toolbar-item.component.d.ts +25 -25
- package/plugins/vertical-align/vertical-align.editor.d.ts +7 -7
- package/public-api.d.ts +20 -20
- package/queries/anchor-block-entry.d.ts +2 -2
- package/queries/anchor-block.d.ts +2 -2
- package/queries/anchor-inline-entry.d.ts +2 -2
- package/queries/find-descendant.d.ts +10 -10
- package/queries/find-node.d.ts +15 -15
- package/queries/find-path.d.ts +6 -6
- package/queries/get-above-by-type.d.ts +6 -6
- package/queries/get-above.d.ts +6 -6
- package/queries/get-anchor-block-entry.d.ts +2 -2
- package/queries/get-block-above.d.ts +7 -7
- package/queries/get-block-card-above.d.ts +7 -7
- package/queries/get-block-card-cursor.d.ts +2 -2
- package/queries/get-container-blocks.d.ts +2 -2
- package/queries/get-directly-parent.d.ts +2 -2
- package/queries/get-insert-elements-path.d.ts +7 -7
- package/queries/get-last-child-path.d.ts +6 -6
- package/queries/get-last-node.d.ts +2 -2
- package/queries/get-next-sibling-nodes.d.ts +7 -7
- package/queries/get-node.d.ts +2 -2
- package/queries/get-nodes-by-type.d.ts +6 -6
- package/queries/get-nodes.d.ts +4 -4
- package/queries/get-parent.d.ts +7 -7
- package/queries/get-plain-text.d.ts +6 -6
- package/queries/get-plugin-by-toolbar.d.ts +3 -3
- package/queries/get-point-before.d.ts +38 -38
- package/queries/get-point-from-location.d.ts +5 -5
- package/queries/get-previous-path.d.ts +2 -2
- package/queries/get-rang-from-block-start.d.ts +9 -9
- package/queries/get-range-before.d.ts +7 -7
- package/queries/get-selection-marks.d.ts +12 -12
- package/queries/get-selection-nodes-by-type.d.ts +3 -3
- package/queries/get-text.d.ts +6 -6
- package/queries/get-toolbar-disabled.d.ts +4 -4
- package/queries/index.d.ts +58 -58
- package/queries/is-across-blocks.d.ts +2 -2
- package/queries/is-ancestor-empty.d.ts +5 -5
- package/queries/is-ancestor.d.ts +2 -2
- package/queries/is-block-above-empty.d.ts +5 -5
- package/queries/is-block-active.d.ts +3 -3
- package/queries/is-block-card-cursor.d.ts +2 -2
- package/queries/is-block-text-empty-after-selection.d.ts +7 -7
- package/queries/is-collapsed.d.ts +6 -6
- package/queries/is-contain-nested-type.d.ts +2 -2
- package/queries/is-container-type.d.ts +2 -2
- package/queries/is-descendant.d.ts +2 -2
- package/queries/is-empty-content.d.ts +2 -2
- package/queries/is-empty-paragraph-by-path.d.ts +2 -2
- package/queries/is-empty-paragraph.d.ts +2 -2
- package/queries/is-first-child.d.ts +5 -5
- package/queries/is-include-types.d.ts +3 -3
- package/queries/is-node-type-in.d.ts +6 -6
- package/queries/is-node-type.d.ts +6 -6
- package/queries/is-paragraph.d.ts +2 -2
- package/queries/is-point-at-root.d.ts +2 -2
- package/queries/is-range-across-blocks.d.ts +8 -8
- package/queries/is-range-at-root.d.ts +2 -2
- package/queries/is-start.d.ts +5 -5
- package/queries/some-node.d.ts +7 -7
- package/services/color-select.service.d.ts +20 -20
- package/services/context.service.d.ts +49 -49
- package/services/table-contextmenu.service.d.ts +25 -25
- package/services/toolbar.service.d.ts +9 -9
- package/shortcuts/index.d.ts +2 -2
- package/shortcuts/mark.d.ts +2 -2
- package/transforms/apply-deep-to-nodes.d.ts +12 -12
- package/transforms/clear-marks.d.ts +2 -2
- package/transforms/close-conversion-hint.d.ts +2 -2
- package/transforms/delete-element.d.ts +2 -2
- package/transforms/handle-continual-delete-backward.d.ts +3 -3
- package/transforms/handle-continual-insert-break.d.ts +3 -3
- package/transforms/index.d.ts +18 -18
- package/transforms/insert-elements.d.ts +2 -2
- package/transforms/insert-paragraph.d.ts +2 -2
- package/transforms/merge-deep-to-nodes.d.ts +5 -5
- package/transforms/move-children.d.ts +24 -24
- package/transforms/on-keydown-reset-block-type.d.ts +3 -3
- package/transforms/set-end-selection.d.ts +2 -2
- package/transforms/set-marks.d.ts +12 -12
- package/transforms/set-node.d.ts +2 -2
- package/transforms/split-node.d.ts +3 -3
- package/transforms/un-hang-range.d.ts +10 -10
- package/transforms/un-wrap.d.ts +3 -3
- package/transforms/unwrap-nodes-by-type.d.ts +6 -6
- package/utils/auto-focus.d.ts +2 -2
- package/utils/auto-scroll-view.d.ts +6 -6
- package/utils/cast-array.d.ts +1 -1
- package/utils/common.d.ts +2 -2
- package/utils/create-empty-paragraph.d.ts +2 -2
- package/utils/data-transform.d.ts +6 -6
- package/utils/dom.d.ts +10 -10
- package/utils/editor-uuid.d.ts +3 -3
- package/utils/fragment.d.ts +10 -10
- package/utils/get-editable-element-height.d.ts +2 -2
- package/utils/get-toolbar-class.d.ts +2 -2
- package/utils/id-creator.d.ts +1 -1
- package/utils/index.d.ts +13 -13
- package/utils/is-clean-empty-paragraph.d.ts +9 -9
- package/utils/is-inline.d.ts +2 -2
- package/utils/lodash.d.ts +1 -1
- package/utils/match.d.ts +18 -18
- package/utils/merge-element-options.d.ts +2 -2
- package/utils/weak-maps.d.ts +5 -5
- package/worktile-theia.d.ts +5 -5
- package/bundles/worktile-theia.umd.js +0 -14919
- package/bundles/worktile-theia.umd.js.map +0 -1
- package/esm2015/components/color-select/color-select.component.js +0 -113
- package/esm2015/components/column-resize/column-resize-notifier.js +0 -31
- package/esm2015/components/column-resize/column-resize.module.js +0 -34
- package/esm2015/components/contextmenu/contextmenu.component.js +0 -64
- package/esm2015/components/conversion-hint/conversion-hint.component.js +0 -59
- package/esm2015/components/element/element.component.js +0 -24
- package/esm2015/components/inline-toolbar/inline-toolbar.component.js +0 -139
- package/esm2015/components/table-select/table-select.component.js +0 -53
- package/esm2015/components/template/template.component.js +0 -66
- package/esm2015/components/toolbar/toolbar.component.js +0 -250
- package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +0 -133
- package/esm2015/components/toolbar-group/toolbar-group.component.js +0 -116
- package/esm2015/components/toolbar-item/toolbar-item.component.js +0 -105
- package/esm2015/core/create-toolbar.js +0 -57
- package/esm2015/core/toolbar-item/base-toolbar-item.js +0 -92
- package/esm2015/core/utils/get-plugin-options.js +0 -3
- package/esm2015/core/utils/get-plugins.js +0 -5
- package/esm2015/core/utils/merge-array.js +0 -18
- package/esm2015/editor.component.js +0 -440
- package/esm2015/interfaces/editor.js +0 -23
- package/esm2015/interfaces/reset-block-type-plugin-options.js +0 -2
- package/esm2015/interfaces/upload.js +0 -2
- package/esm2015/plugins/align/align.editor.js +0 -48
- package/esm2015/plugins/autoformat/autoformat.plugin.js +0 -110
- package/esm2015/plugins/blockquote/blockquote.editor.js +0 -21
- package/esm2015/plugins/code/code.component.js +0 -245
- package/esm2015/plugins/color/color.editor.js +0 -45
- package/esm2015/plugins/color/toolbar-item.component.js +0 -124
- package/esm2015/plugins/common/auto-insert-data..js +0 -78
- package/esm2015/plugins/common/get-fragment.plugin.js +0 -25
- package/esm2015/plugins/font-size/font-size.editor.js +0 -98
- package/esm2015/plugins/image/image.component.js +0 -370
- package/esm2015/plugins/image/image.plugin.js +0 -58
- package/esm2015/plugins/indent/indent.editor.js +0 -73
- package/esm2015/plugins/indent/indent.plugin.js +0 -60
- package/esm2015/plugins/link/edit/link-edit.component.js +0 -108
- package/esm2015/plugins/link/hover/link-hover.component.js +0 -39
- package/esm2015/plugins/list/components/bulleted-list.component.js +0 -34
- package/esm2015/plugins/list/components/list-item.component.js +0 -95
- package/esm2015/plugins/list/components/numbered-list.component.js +0 -40
- package/esm2015/plugins/list/list.plugin.js +0 -281
- package/esm2015/plugins/list/normalizers/normalize-list-item.js +0 -19
- package/esm2015/plugins/list/types.js +0 -2
- package/esm2015/plugins/mark/mark.editor.js +0 -29
- package/esm2015/plugins/mark/mark.plugin.js +0 -102
- package/esm2015/plugins/node-id/node-id.plugin.js +0 -69
- package/esm2015/plugins/normalizers/insert-paragraph-nodes.js +0 -29
- package/esm2015/plugins/normalizers/trailing-node.plugin.js +0 -34
- package/esm2015/plugins/quick-insert/components/quick-insert.component.js +0 -102
- package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +0 -84
- package/esm2015/plugins/quick-insert/quick-insert.plugin.js +0 -75
- package/esm2015/plugins/soft-break/soft-break.plugin.js +0 -37
- package/esm2015/plugins/table/components/insert-mark/insert-mark.component.js +0 -103
- package/esm2015/plugins/table/components/table.component.js +0 -470
- package/esm2015/plugins/table/components/td/td.component.js +0 -698
- package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +0 -162
- package/esm2015/plugins/table/table.plugin.js +0 -424
- package/esm2015/plugins/table/table.store.js +0 -480
- package/esm2015/plugins/table/toolbar-item.component.js +0 -86
- package/esm2015/plugins/table/transforms/clear-cell.js +0 -11
- package/esm2015/plugins/table/transforms/insert-table.js +0 -15
- package/esm2015/plugins/todo-item/todo-item.component.js +0 -66
- package/esm2015/plugins/vertical-align/toolbar-item.component.js +0 -90
- package/esm2015/queries/get-above-by-type.js +0 -11
- package/esm2015/queries/get-block-above.js +0 -7
- package/esm2015/queries/get-block-card-above.js +0 -7
- package/esm2015/queries/get-nodes-by-type.js +0 -12
- package/esm2015/queries/get-plain-text.js +0 -16
- package/esm2015/queries/get-selection-marks.js +0 -19
- package/esm2015/queries/get-toolbar-disabled.js +0 -14
- package/esm2015/queries/is-range-across-blocks.js +0 -18
- package/esm2015/services/context.service.js +0 -60
- package/esm2015/services/toolbar.service.js +0 -48
- package/esm2015/transforms/insert-elements.js +0 -35
- package/esm2015/transforms/merge-deep-to-nodes.js +0 -9
- package/esm2015/transforms/unwrap-nodes-by-type.js +0 -11
- package/esm2015/utils/is-inline.js +0 -10
- package/esm2015/utils/match.js +0 -29
- package/fesm2015/worktile-theia.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Transforms, Element } from 'slate';
|
|
2
|
+
/**
|
|
3
|
+
* Unwrap nodes by type
|
|
4
|
+
*/
|
|
5
|
+
export const unwrapNodesByType = (editor, types, options = {}) => {
|
|
6
|
+
if (!Array.isArray(types)) {
|
|
7
|
+
types = [types];
|
|
8
|
+
}
|
|
9
|
+
Transforms.unwrapNodes(editor, {
|
|
10
|
+
match: n => Element.isElement(n) && types.includes(n.type),
|
|
11
|
+
...options
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW53cmFwLW5vZGVzLWJ5LXR5cGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zcmMvdHJhbnNmb3Jtcy91bndyYXAtbm9kZXMtYnktdHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQVUsVUFBVSxFQUFFLE9BQU8sRUFBRSxNQUFNLE9BQU8sQ0FBQztBQUdwRDs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLENBQUMsTUFBYyxFQUFFLEtBQXdCLEVBQUUsVUFBc0MsRUFBRSxFQUFFLEVBQUU7SUFDcEgsSUFBSSxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDdkIsS0FBSyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUM7S0FDbkI7SUFDRCxVQUFVLENBQUMsV0FBVyxDQUFDLE1BQU0sRUFBRTtRQUMzQixLQUFLLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxJQUFJLEtBQUssQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLElBQWMsQ0FBQztRQUNwRSxHQUFHLE9BQU87S0FDYixDQUFDLENBQUM7QUFDUCxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBFZGl0b3IsIFRyYW5zZm9ybXMsIEVsZW1lbnQgfSBmcm9tICdzbGF0ZSc7XG5pbXBvcnQgeyBXcmFwT3B0aW9ucyB9IGZyb20gJy4uL2ludGVyZmFjZXMnO1xuXG4vKipcbiAqIFVud3JhcCBub2RlcyBieSB0eXBlXG4gKi9cbmV4cG9ydCBjb25zdCB1bndyYXBOb2Rlc0J5VHlwZSA9IChlZGl0b3I6IEVkaXRvciwgdHlwZXM6IHN0cmluZ1tdIHwgc3RyaW5nLCBvcHRpb25zOiBPbWl0PFdyYXBPcHRpb25zLCAnbWF0Y2gnPiA9IHt9KSA9PiB7XG4gICAgaWYgKCFBcnJheS5pc0FycmF5KHR5cGVzKSkge1xuICAgICAgICB0eXBlcyA9IFt0eXBlc107XG4gICAgfVxuICAgIFRyYW5zZm9ybXMudW53cmFwTm9kZXMoZWRpdG9yLCB7XG4gICAgICAgIG1hdGNoOiBuID0+IEVsZW1lbnQuaXNFbGVtZW50KG4pICYmIHR5cGVzLmluY2x1ZGVzKG4udHlwZSBhcyBzdHJpbmcpLFxuICAgICAgICAuLi5vcHRpb25zXG4gICAgfSk7XG59O1xuIl19
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Editor, Transforms } from 'slate';
|
|
2
|
-
import { AngularEditor } from 'slate-angular';
|
|
3
|
-
import { HistoryEditor } from 'slate-history';
|
|
4
|
-
export const autoFocus = (editor, isFocus) => {
|
|
5
|
-
setTimeout(() => {
|
|
6
|
-
if (editor && editor.children.length > 0 && isFocus) {
|
|
7
|
-
HistoryEditor.withoutMerging(editor, () => {
|
|
8
|
-
Transforms.select(editor, Editor.start(editor, [0]));
|
|
9
|
-
AngularEditor.focus(editor);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
};
|
|
1
|
+
import { Editor, Transforms } from 'slate';
|
|
2
|
+
import { AngularEditor } from 'slate-angular';
|
|
3
|
+
import { HistoryEditor } from 'slate-history';
|
|
4
|
+
export const autoFocus = (editor, isFocus) => {
|
|
5
|
+
setTimeout(() => {
|
|
6
|
+
if (editor && editor.children.length > 0 && isFocus) {
|
|
7
|
+
HistoryEditor.withoutMerging(editor, () => {
|
|
8
|
+
Transforms.select(editor, Editor.start(editor, [0]));
|
|
9
|
+
AngularEditor.focus(editor);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
14
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0by1mb2N1cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy91dGlscy9hdXRvLWZvY3VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sT0FBTyxDQUFDO0FBQzNDLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDOUMsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUU5QyxNQUFNLENBQUMsTUFBTSxTQUFTLEdBQUcsQ0FBQyxNQUFjLEVBQUUsT0FBZ0IsRUFBRSxFQUFFO0lBQzFELFVBQVUsQ0FBQyxHQUFHLEVBQUU7UUFDWixJQUFJLE1BQU0sSUFBSSxNQUFNLENBQUMsUUFBUSxDQUFDLE1BQU0sR0FBRyxDQUFDLElBQUksT0FBTyxFQUFFO1lBQ2pELGFBQWEsQ0FBQyxjQUF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height';
|
|
2
|
-
let previousHeight = 0;
|
|
3
|
-
/**
|
|
4
|
-
* reset the sliding distance when the viewport position of the sliding
|
|
5
|
-
* container coincides with the viewport position of the focus element
|
|
6
|
-
*/
|
|
7
|
-
export const autoScrollViewHandle = (editor, scrollContainer) => {
|
|
8
|
-
const currentHeight = getEditableElementHeight(editor);
|
|
9
|
-
const currentNodeElement = window.getSelection().focusNode.parentElement;
|
|
10
|
-
const scrollContainerElement = currentNodeElement.closest(scrollContainer);
|
|
11
|
-
// the added sliding distance is the height of the
|
|
12
|
-
// current editing area minus the height of the last editing area
|
|
13
|
-
const scrollHeight = currentHeight - previousHeight;
|
|
14
|
-
if (scrollContainerElement && previousHeight !== 0 && scrollHeight > 0) {
|
|
15
|
-
const focusBlockRect = currentNodeElement.getBoundingClientRect();
|
|
16
|
-
const scrollContainerRect = scrollContainerElement.getBoundingClientRect();
|
|
17
|
-
const bottom = scrollContainerRect.bottom - focusBlockRect.bottom;
|
|
18
|
-
if (bottom < 30) {
|
|
19
|
-
scrollContainerElement.scrollTop = scrollContainerElement.scrollTop + scrollHeight;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
previousHeight = currentHeight;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { getEditableElementHeight } from './get-editable-element-height';
|
|
2
|
+
let previousHeight = 0;
|
|
3
|
+
/**
|
|
4
|
+
* reset the sliding distance when the viewport position of the sliding
|
|
5
|
+
* container coincides with the viewport position of the focus element
|
|
6
|
+
*/
|
|
7
|
+
export const autoScrollViewHandle = (editor, scrollContainer) => {
|
|
8
|
+
const currentHeight = getEditableElementHeight(editor);
|
|
9
|
+
const currentNodeElement = window.getSelection().focusNode.parentElement;
|
|
10
|
+
const scrollContainerElement = currentNodeElement.closest(scrollContainer);
|
|
11
|
+
// the added sliding distance is the height of the
|
|
12
|
+
// current editing area minus the height of the last editing area
|
|
13
|
+
const scrollHeight = currentHeight - previousHeight;
|
|
14
|
+
if (scrollContainerElement && previousHeight !== 0 && scrollHeight > 0) {
|
|
15
|
+
const focusBlockRect = currentNodeElement.getBoundingClientRect();
|
|
16
|
+
const scrollContainerRect = scrollContainerElement.getBoundingClientRect();
|
|
17
|
+
const bottom = scrollContainerRect.bottom - focusBlockRect.bottom;
|
|
18
|
+
if (bottom < 30) {
|
|
19
|
+
scrollContainerElement.scrollTop = scrollContainerElement.scrollTop + scrollHeight;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
previousHeight = currentHeight;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0by1zY3JvbGwtdmlldy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy91dGlscy9hdXRvLXNjcm9sbC12aWV3LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRXpFLElBQUksY0FBYyxHQUFHLENBQUMsQ0FBQztBQUV2Qjs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxvQkFBb0IsR0FBRyxDQUFDLE1BQWMsRUFBRSxlQUF1QixFQUFFLEVBQUU7SUFDNUUsTUFBTSxhQUFhLEdBQUcsd0JBQXdCLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDdkQsTUFBTSxrQkFBa0IsR0FBRyxNQUFNLENBQUMsWUFBWSxFQUFFLENBQUMsU0FBUyxDQUFDLGFBQWEsQ0FBQztJQUN6RSxNQUFNLHNCQUFzQixHQUFHLGtCQUFrQixDQUFDLE9BQU8sQ0FBQyxlQUFlLENBQUMsQ0FBQztJQUUzRSxrREFBa0Q7SUFDbEQsaUVBQWlFO0lBQ2pFLE1BQU0sWUFBWSxHQUFHLGFBQWEsR0FBRyxjQUFjLENBQUM7SUFFcE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0O1xuICAgICAgICB9XG4gICAgfVxuICAgIHByZXZpb3VzSGVpZ2h0ID0gY3VycmVudEhlaWdodDtcbn07XG4iXX0=
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function castArray(data) {
|
|
2
|
-
if (!data) {
|
|
3
|
-
return [];
|
|
4
|
-
}
|
|
5
|
-
return Array.isArray(data) ? data : [data];
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FzdC1hcnJheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy91dGlscy9jYXN0LWFycmF5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sVUFBVSxTQUFTLENBQUMsSUFBVTtJQUNoQyxJQUFJLENBQUMsSUFBSSxFQUFFO1FBQ1AsT0FBTyxFQUFFLENBQUM7S0FDYjtJQUNELE9BQU8sS0FBSyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQy9DLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gY2FzdEFycmF5KGRhdGE/
|
|
1
|
+
export function castArray(data) {
|
|
2
|
+
if (!data) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
return Array.isArray(data) ? data : [data];
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FzdC1hcnJheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy91dGlscy9jYXN0LWFycmF5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sVUFBVSxTQUFTLENBQUMsSUFBVTtJQUNoQyxJQUFJLENBQUMsSUFBSSxFQUFFO1FBQ1AsT0FBTyxFQUFFLENBQUM7S0FDYjtJQUNELE9BQU8sS0FBSyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQy9DLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gY2FzdEFycmF5KGRhdGE/OiBhbnkpIHtcbiAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgcmV0dXJuIFtdO1xuICAgIH1cbiAgICByZXR1cm4gQXJyYXkuaXNBcnJheShkYXRhKSA/IGRhdGEgOiBbZGF0YV07XG59XG4iXX0=
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
2
|
-
export const CONTROL_KEY = IS_MAC ? '⌘' : 'Ctrl';
|
|
1
|
+
export const IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
2
|
+
export const CONTROL_KEY = IS_MAC ? '⌘' : 'Ctrl';
|
|
3
3
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3V0aWxzL2NvbW1vbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxNQUFNLEdBQUcsT0FBTyxNQUFNLElBQUksV0FBVyxJQUFJLHNCQUFzQixDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBRTdHLE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRyxNQUFNLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IElTX01BQyA9IHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCcgJiYgL01hY3xpUG9kfGlQaG9uZXxpUGFkLy50ZXN0KHdpbmRvdy5uYXZpZ2F0b3IucGxhdGZvcm0pO1xuXG5leHBvcnQgY29uc3QgQ09OVFJPTF9LRVkgPSBJU19NQUMgPyAn4oyYJyA6ICdDdHJsJztcbiJdfQ==
|
package/{esm2015/utils/create-empty-paragraph.js → esm2020/utils/create-empty-paragraph.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ElementKinds } from '../constants/node-types';
|
|
2
|
-
import { idCreator } from './id-creator';
|
|
3
|
-
export const createEmptyParagraph = () => {
|
|
4
|
-
return {
|
|
5
|
-
type: ElementKinds.paragraph,
|
|
6
|
-
key: idCreator(),
|
|
7
|
-
children: [
|
|
8
|
-
{
|
|
9
|
-
text: ''
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { ElementKinds } from '../constants/node-types';
|
|
2
|
+
import { idCreator } from './id-creator';
|
|
3
|
+
export const createEmptyParagraph = () => {
|
|
4
|
+
return {
|
|
5
|
+
type: ElementKinds.paragraph,
|
|
6
|
+
key: idCreator(),
|
|
7
|
+
children: [
|
|
8
|
+
{
|
|
9
|
+
text: ''
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWVtcHR5LXBhcmFncmFwaC5qcyIsInNvdXJjZVJvb3QiOiIi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2
|
-
import { ElementKinds } from '../constants';
|
|
3
|
-
import { TheDataMode } from '../interfaces';
|
|
4
|
-
import { createEmptyParagraph } from './create-empty-paragraph';
|
|
5
|
-
export function plainToTheia(text) {
|
|
6
|
-
if (typeof text !== 'string') {
|
|
7
|
-
return text;
|
|
8
|
-
}
|
|
9
|
-
return text.split('\n').map(i => {
|
|
10
|
-
return {
|
|
11
|
-
type: ElementKinds.paragraph,
|
|
12
|
-
children: [
|
|
13
|
-
{
|
|
14
|
-
text: i
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export function htmlToTheia(value) {
|
|
21
|
-
if (typeof value === 'string') {
|
|
22
|
-
const htmlDom = new DOMParser().parseFromString(value, 'text/html');
|
|
23
|
-
return TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
24
|
-
}
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
export function dataDeserialize(mode, value) {
|
|
28
|
-
if (!value) {
|
|
29
|
-
return [createEmptyParagraph()];
|
|
30
|
-
}
|
|
31
|
-
if (mode === TheDataMode.html) {
|
|
32
|
-
if (typeof value !== 'string') {
|
|
33
|
-
return value;
|
|
34
|
-
}
|
|
35
|
-
if (/<[^>]+>/.test(value)) {
|
|
36
|
-
return htmlToTheia(value);
|
|
37
|
-
}
|
|
38
|
-
return plainToTheia(value);
|
|
39
|
-
}
|
|
40
|
-
return value || [createEmptyParagraph()];
|
|
41
|
-
}
|
|
42
|
-
export function dataSerializing(mode, value) {
|
|
43
|
-
if (mode === TheDataMode.html) {
|
|
44
|
-
return TheiaConverter.convertToHtml(value);
|
|
45
|
-
}
|
|
46
|
-
return value;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { TheiaConverter } from '@atinc/selene';
|
|
2
|
+
import { ElementKinds } from '../constants';
|
|
3
|
+
import { TheDataMode } from '../interfaces';
|
|
4
|
+
import { createEmptyParagraph } from './create-empty-paragraph';
|
|
5
|
+
export function plainToTheia(text) {
|
|
6
|
+
if (typeof text !== 'string') {
|
|
7
|
+
return text;
|
|
8
|
+
}
|
|
9
|
+
return text.split('\n').map(i => {
|
|
10
|
+
return {
|
|
11
|
+
type: ElementKinds.paragraph,
|
|
12
|
+
children: [
|
|
13
|
+
{
|
|
14
|
+
text: i
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function htmlToTheia(value) {
|
|
21
|
+
if (typeof value === 'string') {
|
|
22
|
+
const htmlDom = new DOMParser().parseFromString(value, 'text/html');
|
|
23
|
+
return TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
export function dataDeserialize(mode, value) {
|
|
28
|
+
if (!value) {
|
|
29
|
+
return [createEmptyParagraph()];
|
|
30
|
+
}
|
|
31
|
+
if (mode === TheDataMode.html) {
|
|
32
|
+
if (typeof value !== 'string') {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
if (/<[^>]+>/.test(value)) {
|
|
36
|
+
return htmlToTheia(value);
|
|
37
|
+
}
|
|
38
|
+
return plainToTheia(value);
|
|
39
|
+
}
|
|
40
|
+
return value || [createEmptyParagraph()];
|
|
41
|
+
}
|
|
42
|
+
export function dataSerializing(mode, value) {
|
|
43
|
+
if (mode === TheDataMode.html) {
|
|
44
|
+
return TheiaConverter.convertToHtml(value);
|
|
45
|
+
}
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YS10cmFuc2Zvcm0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zcmMvdXRpbHMvZGF0YS10cmFuc2Zvcm0udHMiXSwibmFtZXMiO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XRhTW9kZS5odG1sKSB7XG4gICAgICAgIGlmICh0eXBlb2YgdmFsdWUgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKC88W14+XSs+Ly50ZXN0KHZhbHVlKSkge1xuICAgICAgICAgICAgcmV0dXJuIGh0bWxUb1RoZWlhKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcGxhaW5Ub1RoZWlhKHZhbHVlKTtcbiAgICB9XG4gICAgcmV0dXJuICh2YWx1ZSBhcyBEZXNjZW5kYW50W10pIHx8IFtjcmVhdGVFbXB0eVBhcmFncmFwaCgpXTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGRhdGFTZXJpYWxpemluZyhtb2RlOiBUaGVEYXRhTW9kZSwgdmFsdWU6IERlc2NlbmRhbnRbXSk6IHN0cmluZyB8IERlc2NlbmRhbnRbXSB7XG4gICAgaWYgKG1vZGUgPT09IFRoZURhdGFNb2RlLmh0bWwpIHtcbiAgICAgICAgcmV0dXJuIFRoZWlhQ29udmVydGVyLmNvbnZlcnRUb0h0bWwodmFsdWUgYXMgYW55KTtcbiAgICB9XG4gICAgcmV0dXJuIHZhbHVlO1xufVxuIl19
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { Alignment } from '../constants';
|
|
2
|
-
/** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
|
|
3
|
-
export function coercePixelsFromCssValue(cssValue) {
|
|
4
|
-
const match = cssValue.match(/(\d+(\.\d+)?)px/);
|
|
5
|
-
if (match) {
|
|
6
|
-
return Number(match[1]);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export function getElementWidth(element) {
|
|
10
|
-
// Optimization: Check style.width first as we probably set it already before reading
|
|
11
|
-
// offsetWidth which triggers layout.
|
|
12
|
-
return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
|
|
13
|
-
}
|
|
14
|
-
export function getElementHeight(element) {
|
|
15
|
-
return element.getBoundingClientRect().height;
|
|
16
|
-
}
|
|
17
|
-
export function getColsTotalWidth(cols) {
|
|
18
|
-
return cols.reduce((total, col) => {
|
|
19
|
-
return total + getElementWidth(col);
|
|
20
|
-
}, 0);
|
|
21
|
-
}
|
|
22
|
-
export function getRowsTotalHeight(rows) {
|
|
23
|
-
return rows.reduce((total, row) => {
|
|
24
|
-
return total + getElementHeight(row);
|
|
25
|
-
}, 0);
|
|
26
|
-
}
|
|
27
|
-
export function useElementStyle(el, element) {
|
|
28
|
-
if (element.align) {
|
|
29
|
-
el.style.textAlign = element.align || Alignment.left;
|
|
30
|
-
}
|
|
31
|
-
if (element.textIndent) {
|
|
32
|
-
el.style.textIndent = element.textIndent + 'em';
|
|
33
|
-
}
|
|
34
|
-
if (element.verticalAlign) {
|
|
35
|
-
el.style.verticalAlign = element.verticalAlign;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export function getElementClassByPrefix(el, prefix) {
|
|
39
|
-
let matchClass = null;
|
|
40
|
-
el.classList.forEach((value, key) => {
|
|
41
|
-
if (value.includes(prefix)) {
|
|
42
|
-
matchClass = value;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return matchClass;
|
|
46
|
-
}
|
|
1
|
+
import { Alignment } from '../constants';
|
|
2
|
+
/** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
|
|
3
|
+
export function coercePixelsFromCssValue(cssValue) {
|
|
4
|
+
const match = cssValue.match(/(\d+(\.\d+)?)px/);
|
|
5
|
+
if (match) {
|
|
6
|
+
return Number(match[1]);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function getElementWidth(element) {
|
|
10
|
+
// Optimization: Check style.width first as we probably set it already before reading
|
|
11
|
+
// offsetWidth which triggers layout.
|
|
12
|
+
return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
|
|
13
|
+
}
|
|
14
|
+
export function getElementHeight(element) {
|
|
15
|
+
return element.getBoundingClientRect().height;
|
|
16
|
+
}
|
|
17
|
+
export function getColsTotalWidth(cols) {
|
|
18
|
+
return cols.reduce((total, col) => {
|
|
19
|
+
return total + getElementWidth(col);
|
|
20
|
+
}, 0);
|
|
21
|
+
}
|
|
22
|
+
export function getRowsTotalHeight(rows) {
|
|
23
|
+
return rows.reduce((total, row) => {
|
|
24
|
+
return total + getElementHeight(row);
|
|
25
|
+
}, 0);
|
|
26
|
+
}
|
|
27
|
+
export function useElementStyle(el, element) {
|
|
28
|
+
if (element.align) {
|
|
29
|
+
el.style.textAlign = element.align || Alignment.left;
|
|
30
|
+
}
|
|
31
|
+
if (element.textIndent) {
|
|
32
|
+
el.style.textIndent = element.textIndent + 'em';
|
|
33
|
+
}
|
|
34
|
+
if (element.verticalAlign) {
|
|
35
|
+
el.style.verticalAlign = element.verticalAlign;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function getElementClassByPrefix(el, prefix) {
|
|
39
|
+
let matchClass = null;
|
|
40
|
+
el.classList.forEach((value, key) => {
|
|
41
|
+
if (value.includes(prefix)) {
|
|
42
|
+
matchClass = value;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return matchClass;
|
|
46
|
+
}
|
|
47
47
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9tLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3V0aWxzL2RvbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRXpDLGlHQUFpRztBQUNqRyxNQUFNLFVBQVUsd0JBQXdCLENBQUMsUUFBZ0I7SUFDckQsTUFBTSxLQUFLLEdBQUcsUUFBUSxDQUFDLEtBQUssQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO0lBQ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HtcbiAgICByZXR1cm4gcm93cy5yZWR1Y2UoKHRvdGFsLCByb3cpID0+IHtcbiAgICAgICAgcmV0dXJuIHRvdGFsICsgZ2V0RWxlbWVudEhlaWdodChyb3cpO1xuICAgIH0sIDApO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gdXNlRWxlbWVudFN0eWxlKGVsOiBIVE1MRWxlbWVudCwgZWxlbWVudDogRWxlbWVudCkge1xuICAgIGlmIChlbGVtZW50LmFsaWduKSB7XG4gICAgICAgIGVsLnN0eWxlLnRleHRBbGlnbiA9IChlbGVtZW50LmFsaWduIGFzIHN0cmluZykgfHwgQWxpZ25tZW50LmxlZnQ7XG4gICAgfVxuXG4gICAgaWYgKGVsZW1lbnQudGV4dEluZGVudCkge1xuICAgICAgICBlbC5zdHlsZS50ZXh0SW5kZW50ID0gZWxlbWVudC50ZXh0SW5kZW50ICsgJ2VtJztcbiAgICB9XG5cbiAgICBpZiAoZWxlbWVudC52ZXJ0aWNhbEFsaWduKSB7XG4gICAgICAgIGVsLnN0eWxlLnZlcnRpY2FsQWxpZ24gPSBlbGVtZW50LnZlcnRpY2FsQWxpZ247XG4gICAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gZ2V0RWxlbWVudENsYXNzQnlQcmVmaXgoZWw6IERPTUVsZW1lbnQsIHByZWZpeDogc3RyaW5nKSB7XG4gICAgbGV0IG1hdGNoQ2xhc3MgPSBudWxsO1xuICAgIGVsLmNsYXNzTGlzdC5mb3JFYWNoKCh2YWx1ZSwga2V5KSA9PiB7XG4gICAgICAgIGlmICh2YWx1ZS5pbmNsdWRlcyhwcmVmaXgpKSB7XG4gICAgICAgICAgICBtYXRjaENsYXNzID0gdmFsdWU7XG4gICAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gbWF0Y2hDbGFzcztcbn1cbiJdfQ==
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { THE_EDITOR_UUID } from './weak-maps';
|
|
2
|
-
export const getEditorUUID = (editor) => {
|
|
3
|
-
return THE_EDITOR_UUID.get(editor);
|
|
4
|
-
};
|
|
5
|
-
export const setEditorUUID = (editor, uuid) => {
|
|
6
|
-
THE_EDITOR_UUID.set(editor, uuid);
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { THE_EDITOR_UUID } from './weak-maps';
|
|
2
|
+
export const getEditorUUID = (editor) => {
|
|
3
|
+
return THE_EDITOR_UUID.get(editor);
|
|
4
|
+
};
|
|
5
|
+
export const setEditorUUID = (editor, uuid) => {
|
|
6
|
+
THE_EDITOR_UUID.set(editor, uuid);
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWRpdG9yLXV1aWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zcmMvdXRpbHMvZWRpdG9yLXV1aWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUU5QyxNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsQ0FBQyxNQUFjLEVBQUUsRUFBRTtJQUM1QyxPQUFPLGVBQWUsQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDdkMsQ0FBQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLENBQUMsTUFBYyxFQUFFLElBQVksRUFBRSxFQUFFO0lBQzFELGVBQWUsQ0FBQyxHQUFHLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxDQUFDO0FBQ3RDLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEVkaXRvciB9IGZyb20gJ3NsYXRlJztcbmltcG9ydCB7IFRIRV9FRElUT1JfVVVJRCB9IGZyb20gJy4vd2Vhay1tYXBzJztcblxuZXhwb3J0IGNvbnN0IGdldEVkaXRvclVVSUQgPSAoZWRpdG9yOiBFZGl0b3IpID0+IHtcbiAgICByZXR1cm4gVEhFX0VESVRPUl9VVUlELmdldChlZGl0b3IpO1xufTtcblxuZXhwb3J0IGNvbnN0IHNldEVkaXRvclVVSUQgPSAoZWRpdG9yOiBFZGl0b3IsIHV1aWQ6IHN0cmluZykgPT4ge1xuICAgIFRIRV9FRElUT1JfVVVJRC5zZXQoZWRpdG9yLCB1dWlkKTtcbn07XG4iXX0=
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { Editor, Element, Text } from 'slate';
|
|
2
|
-
import { CLIPBOARD_FORMAT_KEY, ELEMENT_UNIQUE_ID } from '../constants/default';
|
|
3
|
-
export const getStartBlock = (editor, fragment) => {
|
|
4
|
-
const firstChild = fragment.children && fragment.children[0];
|
|
5
|
-
if (firstChild && !Editor.isInline(editor, firstChild) && !Text.isText(firstChild) && Element.isElement(firstChild)) {
|
|
6
|
-
return getStartBlock(editor, firstChild);
|
|
7
|
-
}
|
|
8
|
-
return fragment;
|
|
9
|
-
};
|
|
10
|
-
export const getEndBlock = (editor, fragment) => {
|
|
11
|
-
const lastChild = fragment.children && fragment.children[fragment.children.length - 1];
|
|
12
|
-
if (lastChild && !Editor.isInline(editor, lastChild) && !Text.isText(lastChild) && Element.isElement(lastChild)) {
|
|
13
|
-
return getEndBlock(editor, lastChild);
|
|
14
|
-
}
|
|
15
|
-
return fragment;
|
|
16
|
-
};
|
|
17
|
-
export const extractFragment = (data, deleteKey = ELEMENT_UNIQUE_ID) => {
|
|
18
|
-
const fragment = data.getData(`application/${CLIPBOARD_FORMAT_KEY}`);
|
|
19
|
-
if (fragment) {
|
|
20
|
-
const decoded = decodeURIComponent(window.atob(fragment));
|
|
21
|
-
let nodes = JSON.parse(decoded);
|
|
22
|
-
if (!Array.isArray(nodes)) {
|
|
23
|
-
nodes = [nodes];
|
|
24
|
-
}
|
|
25
|
-
// delete key to avoid duplicate keys
|
|
26
|
-
if (deleteKey) {
|
|
27
|
-
deleteElementKey(nodes, deleteKey);
|
|
28
|
-
}
|
|
29
|
-
return nodes;
|
|
30
|
-
}
|
|
31
|
-
return null;
|
|
32
|
-
};
|
|
33
|
-
export function deleteElementKey(nodes, key) {
|
|
34
|
-
nodes.forEach((node) => {
|
|
35
|
-
if (node[key]) {
|
|
36
|
-
delete node[key];
|
|
37
|
-
}
|
|
38
|
-
if (Element.isElement(node) && node.children) {
|
|
39
|
-
deleteElementKey(node.children, key);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return nodes;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* 过滤文本格式:颜色/背景色/字体大小
|
|
46
|
-
* @param node
|
|
47
|
-
*/
|
|
48
|
-
export function filterTextFormat(node) {
|
|
49
|
-
node.children.forEach((child) => {
|
|
50
|
-
if (Text.isText(child)) {
|
|
51
|
-
if (child['color']) {
|
|
52
|
-
delete child['color'];
|
|
53
|
-
}
|
|
54
|
-
if (child['background-color']) {
|
|
55
|
-
delete child['background-color'];
|
|
56
|
-
}
|
|
57
|
-
if (child['font-size']) {
|
|
58
|
-
delete child['font-size'];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
filterTextFormat(child);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
1
|
+
import { Editor, Element, Text } from 'slate';
|
|
2
|
+
import { CLIPBOARD_FORMAT_KEY, ELEMENT_UNIQUE_ID } from '../constants/default';
|
|
3
|
+
export const getStartBlock = (editor, fragment) => {
|
|
4
|
+
const firstChild = fragment.children && fragment.children[0];
|
|
5
|
+
if (firstChild && !Editor.isInline(editor, firstChild) && !Text.isText(firstChild) && Element.isElement(firstChild)) {
|
|
6
|
+
return getStartBlock(editor, firstChild);
|
|
7
|
+
}
|
|
8
|
+
return fragment;
|
|
9
|
+
};
|
|
10
|
+
export const getEndBlock = (editor, fragment) => {
|
|
11
|
+
const lastChild = fragment.children && fragment.children[fragment.children.length - 1];
|
|
12
|
+
if (lastChild && !Editor.isInline(editor, lastChild) && !Text.isText(lastChild) && Element.isElement(lastChild)) {
|
|
13
|
+
return getEndBlock(editor, lastChild);
|
|
14
|
+
}
|
|
15
|
+
return fragment;
|
|
16
|
+
};
|
|
17
|
+
export const extractFragment = (data, deleteKey = ELEMENT_UNIQUE_ID) => {
|
|
18
|
+
const fragment = data.getData(`application/${CLIPBOARD_FORMAT_KEY}`);
|
|
19
|
+
if (fragment) {
|
|
20
|
+
const decoded = decodeURIComponent(window.atob(fragment));
|
|
21
|
+
let nodes = JSON.parse(decoded);
|
|
22
|
+
if (!Array.isArray(nodes)) {
|
|
23
|
+
nodes = [nodes];
|
|
24
|
+
}
|
|
25
|
+
// delete key to avoid duplicate keys
|
|
26
|
+
if (deleteKey) {
|
|
27
|
+
deleteElementKey(nodes, deleteKey);
|
|
28
|
+
}
|
|
29
|
+
return nodes;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
export function deleteElementKey(nodes, key) {
|
|
34
|
+
nodes.forEach((node) => {
|
|
35
|
+
if (node[key]) {
|
|
36
|
+
delete node[key];
|
|
37
|
+
}
|
|
38
|
+
if (Element.isElement(node) && node.children) {
|
|
39
|
+
deleteElementKey(node.children, key);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return nodes;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 过滤文本格式:颜色/背景色/字体大小
|
|
46
|
+
* @param node
|
|
47
|
+
*/
|
|
48
|
+
export function filterTextFormat(node) {
|
|
49
|
+
node.children.forEach((child) => {
|
|
50
|
+
if (Text.isText(child)) {
|
|
51
|
+
if (child['color']) {
|
|
52
|
+
delete child['color'];
|
|
53
|
+
}
|
|
54
|
+
if (child['background-color']) {
|
|
55
|
+
delete child['background-color'];
|
|
56
|
+
}
|
|
57
|
+
if (child['font-size']) {
|
|
58
|
+
delete child['font-size'];
|
|
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AgICAgIGlmIChub2RlW2tleV0pIHtcbiAgICAgICAgICAgIGRlbGV0ZSBub2RlW2tleV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKEVsZW1lbnQuaXNFbGVtZW50KG5vZGUpICYmIG5vZGUuY2hpbGRyZW4pIHtcbiAgICAgICAgICAgIGRlbGV0ZUVsZW1lbnRLZXkobm9kZS5jaGlsZHJlbiwga2V5KTtcbiAgICAgICAgfVxuICAgIH0pO1xuICAgIHJldHVybiBub2Rlcztcbn1cblxuLyoqXG4gKiDov4fmu6TmlofmnKzmoLzlvI/vvJrpopzoibIv6IOM5pmv6ImyL+Wtl+S9k+Wkp+Wwj1xuICogQHBhcmFtIG5vZGUgXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBmaWx0ZXJUZXh0Rm9ybWF0KG5vZGU6IEVsZW1lbnQpIHtcbiAgICBub2RlLmNoaWxkcmVuLmZvckVhY2goKGNoaWxkKSA9PiB7XG4gICAgICAgIGlmIChUZXh0LmlzVGV4dChjaGlsZCkpIHtcbiAgICAgICAgICAgIGlmIChjaGlsZFsnY29sb3InXSkge1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBjaGlsZFsnY29sb3InXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjaGlsZFsnYmFja2dyb3VuZC1jb2xvciddKSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIGNoaWxkWydiYWNrZ3JvdW5kLWNvbG9yJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2hpbGRbJ2ZvbnQtc2l6ZSddKSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIGNoaWxkWydmb250LXNpemUnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZpbHRlclRleHRGb3JtYXQoY2hpbGQpO1xuICAgICAgICB9XG4gICAgfSk7XG59XG4iXX0=
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AngularEditor } from 'slate-angular';
|
|
2
|
-
export const getEditableElementHeight = (editor) => {
|
|
3
|
-
const editable = AngularEditor.toDOMNode(editor, editor);
|
|
4
|
-
return editable.clientHeight;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { AngularEditor } from 'slate-angular';
|
|
2
|
+
export const getEditableElementHeight = (editor) => {
|
|
3
|
+
const editable = AngularEditor.toDOMNode(editor, editor);
|
|
4
|
+
return editable.clientHeight;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWVkaXRhYmxlLWVsZW1lbnQtaGVpZ2h0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3V0aWxzL2dldC1lZGl0YWJsZS1lbGVtZW50LWhlaWdodC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTlDLE1BQU0sQ0FBQyxNQUFNLHdCQUF3QixHQUFHLENBQUMsTUFBYyxFQUFFLEVBQUU7SUFDdkQsTUFBTSxRQUFRLEdBQUcsYUFBYSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFDekQsT0FBTyxRQUFRLENBQUMsWUFBWSxDQUFDO0FBQ2pDLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEVkaXRvciB9IGZyb20gJ3NsYXRlJztcbmltcG9ydCB7IEFuZ3VsYXJFZGl0b3IgfSBmcm9tICdzbGF0ZS1hbmd1bGFyJztcblxuZXhwb3J0IGNvbnN0IGdldEVkaXRhYmxlRWxlbWVudEhlaWdodCA9IChlZGl0b3I6IEVkaXRvcikgPT4ge1xuICAgIGNvbnN0IGVkaXRhYmxlID0gQW5ndWxhckVkaXRvci50b0RPTU5vZGUoZWRpdG9yLCBlZGl0b3IpO1xuICAgIHJldHVybiBlZGl0YWJsZS5jbGllbnRIZWlnaHQ7XG59O1xuIl19
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getEditorUUID } from './editor-uuid';
|
|
2
|
-
export const getToolbarClass = (editor) => {
|
|
3
|
-
const uuid = getEditorUUID(editor);
|
|
4
|
-
return `the-toolbar-${uuid}`;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { getEditorUUID } from './editor-uuid';
|
|
2
|
+
export const getToolbarClass = (editor) => {
|
|
3
|
+
const uuid = getEditorUUID(editor);
|
|
4
|
+
return `the-toolbar-${uuid}`;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXRvb2xiYXItY2xhc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zcmMvdXRpbHMvZ2V0LXRvb2xiYXItY2xhc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUU5QyxNQUFNLENBQUMsTUFBTSxlQUFlLEdBQUcsQ0FBQyxNQUFjLEVBQUUsRUFBRTtJQUM5QyxNQUFNLElBQUksR0FBRyxhQUFhLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDbkMsT0FBTyxlQUFlLElBQUksRUFBRSxDQUFDO0FBQ2pDLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEVkaXRvciB9IGZyb20gJ3NsYXRlJztcbmltcG9ydCB7IGdldEVkaXRvclVVSUQgfSBmcm9tICcuL2VkaXRvci11dWlkJztcblxuZXhwb3J0IGNvbnN0IGdldFRvb2xiYXJDbGFzcyA9IChlZGl0b3I6IEVkaXRvcikgPT4ge1xuICAgIGNvbnN0IHV1aWQgPSBnZXRFZGl0b3JVVUlEKGVkaXRvcik7XG4gICAgcmV0dXJuIGB0aGUtdG9vbGJhci0ke3V1aWR9YDtcbn07XG4iXX0=
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export function idCreator(length = 5) {
|
|
2
|
-
// remove numeral
|
|
3
|
-
const $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
|
|
4
|
-
const maxPosition = $chars.length;
|
|
5
|
-
let key = '';
|
|
6
|
-
for (let i = 0; i < length; i++) {
|
|
7
|
-
key += $chars.charAt(Math.floor(Math.random() * maxPosition));
|
|
8
|
-
}
|
|
9
|
-
return key;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export function idCreator(length = 5) {
|
|
2
|
+
// remove numeral
|
|
3
|
+
const $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
|
|
4
|
+
const maxPosition = $chars.length;
|
|
5
|
+
let key = '';
|
|
6
|
+
for (let i = 0; i < length; i++) {
|
|
7
|
+
key += $chars.charAt(Math.floor(Math.random() * maxPosition));
|
|
8
|
+
}
|
|
9
|
+
return key;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWQtY3JlYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy91dGlscy9pZC1jcmVhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sVUFBVSxTQUFTLENBQUMsTUFBTSxHQUFHLENBQUM7SUFDaEMsaUJBQWlCO0lBQ2pC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