@worktile/theia 3.0.9 → 3.1.0-next.2
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 +20 -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
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { Transforms } from 'slate';
|
|
2
|
-
import { ElementKinds } from '../../constants';
|
|
3
|
-
import { ListEditor } from '../list/list.editor';
|
|
4
|
-
import * as TheQueries from '../../queries';
|
|
5
|
-
export const TodoItemEditor = {
|
|
6
|
-
isActive(editor) {
|
|
7
|
-
const [match] = TheQueries.getNodesByType(editor, ElementKinds.checkItem);
|
|
8
|
-
return !!match;
|
|
9
|
-
},
|
|
10
|
-
insertTodoItem(editor) {
|
|
11
|
-
if (!editor.selection) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const isActive = TodoItemEditor.isActive(editor);
|
|
15
|
-
const isNumberedList = ListEditor.isActive(editor, ElementKinds.numberedList);
|
|
16
|
-
const isBulletedList = ListEditor.isActive(editor, ElementKinds.bulletedList);
|
|
17
|
-
if (isActive) {
|
|
18
|
-
Transforms.setNodes(editor, {
|
|
19
|
-
type: ElementKinds.paragraph
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
if (isNumberedList || isBulletedList) {
|
|
24
|
-
ListEditor.unwrapList(editor);
|
|
25
|
-
}
|
|
26
|
-
Transforms.setNodes(editor, {
|
|
27
|
-
type: ElementKinds.checkItem
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
1
|
+
import { Transforms } from 'slate';
|
|
2
|
+
import { ElementKinds } from '../../constants';
|
|
3
|
+
import { ListEditor } from '../list/list.editor';
|
|
4
|
+
import * as TheQueries from '../../queries';
|
|
5
|
+
export const TodoItemEditor = {
|
|
6
|
+
isActive(editor) {
|
|
7
|
+
const [match] = TheQueries.getNodesByType(editor, ElementKinds.checkItem);
|
|
8
|
+
return !!match;
|
|
9
|
+
},
|
|
10
|
+
insertTodoItem(editor) {
|
|
11
|
+
if (!editor.selection) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const isActive = TodoItemEditor.isActive(editor);
|
|
15
|
+
const isNumberedList = ListEditor.isActive(editor, ElementKinds.numberedList);
|
|
16
|
+
const isBulletedList = ListEditor.isActive(editor, ElementKinds.bulletedList);
|
|
17
|
+
if (isActive) {
|
|
18
|
+
Transforms.setNodes(editor, {
|
|
19
|
+
type: ElementKinds.paragraph
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
if (isNumberedList || isBulletedList) {
|
|
24
|
+
ListEditor.unwrapList(editor);
|
|
25
|
+
}
|
|
26
|
+
Transforms.setNodes(editor, {
|
|
27
|
+
type: ElementKinds.checkItem
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
32
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9kby1pdGVtLmVkaXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy9wbHVnaW5zL3RvZG8taXRlbS90b2RvLWl0ZW0uZWRpdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBVSxVQUFVLEVBQUUsTUFBTSxPQUFPLENBQUM7QUFDM0MsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNqRCxPQUFPLEtBQUssVUFBVSxNQUFNLGVBQWUsQ0FBQztBQUU1QyxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUc7SUFDMUIsUUFBUSxDQUFDLE1BQWM7UUFDbkIsTUFBTSxDQUFDLEtBQUssQ0FBQy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CdWxsZXRlZExpc3QpIHtcbiAgICAgICAgICAgICAgICBMaXN0RWRpdG9yLnVud3JhcExpc3QoZWRpdG9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFRyYW5zZm9ybXMuc2V0Tm9kZXMoZWRpdG9yLCB7XG4gICAgICAgICAgICAgICAgdHlwZTogRWxlbWVudEtpbmRzLmNoZWNrSXRlbVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG59O1xuIl19
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { Transforms, Range, Editor, Element } from 'slate';
|
|
2
|
-
import { createPluginFactory } from '../../core';
|
|
3
|
-
import { PluginKeys } from '../../interfaces';
|
|
4
|
-
import { ElementKinds } from '../../constants';
|
|
5
|
-
import { TheTodoItemComponent } from './todo-item.component';
|
|
6
|
-
import { TodoItemEditor } from './todo-item.editor';
|
|
7
|
-
import * as TheQueries from '../../queries';
|
|
8
|
-
export const withTodoItem = (editor) => {
|
|
9
|
-
const { insertBreak, deleteBackward, renderElement } = editor;
|
|
10
|
-
editor.insertBreak = () => {
|
|
11
|
-
const { selection } = editor;
|
|
12
|
-
if (selection && Range.isCollapsed(selection)) {
|
|
13
|
-
const [match] = Editor.nodes(editor, {
|
|
14
|
-
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
15
|
-
});
|
|
16
|
-
if (match) {
|
|
17
|
-
const [, path] = match;
|
|
18
|
-
const block = TheQueries.anchorBlock(editor);
|
|
19
|
-
if (block && Editor.isStart(editor, selection.anchor, path) && Editor.isEmpty(editor, block)) {
|
|
20
|
-
Transforms.setNodes(editor, {
|
|
21
|
-
type: ElementKinds.default,
|
|
22
|
-
checked: undefined
|
|
23
|
-
}, {
|
|
24
|
-
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
25
|
-
});
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
insertBreak();
|
|
31
|
-
const anchorBlock = TheQueries.anchorBlock(editor);
|
|
32
|
-
if (anchorBlock && anchorBlock.type === ElementKinds.checkItem) {
|
|
33
|
-
Transforms.setNodes(editor, { checked: false });
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
editor.deleteBackward = unit => {
|
|
37
|
-
const { selection } = editor;
|
|
38
|
-
if (selection && Range.isCollapsed(selection)) {
|
|
39
|
-
const [match] = Editor.nodes(editor, {
|
|
40
|
-
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
41
|
-
});
|
|
42
|
-
if (match) {
|
|
43
|
-
const [, path] = match;
|
|
44
|
-
if (Editor.isStart(editor, selection.anchor, path)) {
|
|
45
|
-
Transforms.setNodes(editor, { type: ElementKinds.default, checked: undefined }, {
|
|
46
|
-
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
47
|
-
});
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
deleteBackward(unit);
|
|
53
|
-
};
|
|
54
|
-
editor.renderElement = (element) => {
|
|
55
|
-
if (element.type === ElementKinds.checkItem) {
|
|
56
|
-
return TheTodoItemComponent;
|
|
57
|
-
}
|
|
58
|
-
return renderElement(element);
|
|
59
|
-
};
|
|
60
|
-
return editor;
|
|
61
|
-
};
|
|
62
|
-
export const createTodoItemPlugin = createPluginFactory({
|
|
63
|
-
key: PluginKeys.checkItem,
|
|
64
|
-
withOverrides: withTodoItem,
|
|
65
|
-
toolbarItems: [
|
|
66
|
-
{
|
|
67
|
-
key: ElementKinds.checkItem,
|
|
68
|
-
icon: 'list-check',
|
|
69
|
-
name: '待办事项',
|
|
70
|
-
execute: editor => TodoItemEditor.insertTodoItem(editor),
|
|
71
|
-
active: editor => TodoItemEditor.isActive(editor)
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
options: {
|
|
75
|
-
allowParentTypes: [ElementKinds.tableCell, ElementKinds.blockquote],
|
|
76
|
-
editableWithReadonly: false
|
|
77
|
-
}
|
|
78
|
-
});
|
|
1
|
+
import { Transforms, Range, Editor, Element } from 'slate';
|
|
2
|
+
import { createPluginFactory } from '../../core';
|
|
3
|
+
import { PluginKeys } from '../../interfaces';
|
|
4
|
+
import { ElementKinds } from '../../constants';
|
|
5
|
+
import { TheTodoItemComponent } from './todo-item.component';
|
|
6
|
+
import { TodoItemEditor } from './todo-item.editor';
|
|
7
|
+
import * as TheQueries from '../../queries';
|
|
8
|
+
export const withTodoItem = (editor) => {
|
|
9
|
+
const { insertBreak, deleteBackward, renderElement } = editor;
|
|
10
|
+
editor.insertBreak = () => {
|
|
11
|
+
const { selection } = editor;
|
|
12
|
+
if (selection && Range.isCollapsed(selection)) {
|
|
13
|
+
const [match] = Editor.nodes(editor, {
|
|
14
|
+
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
15
|
+
});
|
|
16
|
+
if (match) {
|
|
17
|
+
const [, path] = match;
|
|
18
|
+
const block = TheQueries.anchorBlock(editor);
|
|
19
|
+
if (block && Editor.isStart(editor, selection.anchor, path) && Editor.isEmpty(editor, block)) {
|
|
20
|
+
Transforms.setNodes(editor, {
|
|
21
|
+
type: ElementKinds.default,
|
|
22
|
+
checked: undefined
|
|
23
|
+
}, {
|
|
24
|
+
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
25
|
+
});
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
insertBreak();
|
|
31
|
+
const anchorBlock = TheQueries.anchorBlock(editor);
|
|
32
|
+
if (anchorBlock && anchorBlock.type === ElementKinds.checkItem) {
|
|
33
|
+
Transforms.setNodes(editor, { checked: false });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
editor.deleteBackward = unit => {
|
|
37
|
+
const { selection } = editor;
|
|
38
|
+
if (selection && Range.isCollapsed(selection)) {
|
|
39
|
+
const [match] = Editor.nodes(editor, {
|
|
40
|
+
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
41
|
+
});
|
|
42
|
+
if (match) {
|
|
43
|
+
const [, path] = match;
|
|
44
|
+
if (Editor.isStart(editor, selection.anchor, path)) {
|
|
45
|
+
Transforms.setNodes(editor, { type: ElementKinds.default, checked: undefined }, {
|
|
46
|
+
match: n => Element.isElement(n) && n.type === ElementKinds.checkItem
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
deleteBackward(unit);
|
|
53
|
+
};
|
|
54
|
+
editor.renderElement = (element) => {
|
|
55
|
+
if (element.type === ElementKinds.checkItem) {
|
|
56
|
+
return TheTodoItemComponent;
|
|
57
|
+
}
|
|
58
|
+
return renderElement(element);
|
|
59
|
+
};
|
|
60
|
+
return editor;
|
|
61
|
+
};
|
|
62
|
+
export const createTodoItemPlugin = createPluginFactory({
|
|
63
|
+
key: PluginKeys.checkItem,
|
|
64
|
+
withOverrides: withTodoItem,
|
|
65
|
+
toolbarItems: [
|
|
66
|
+
{
|
|
67
|
+
key: ElementKinds.checkItem,
|
|
68
|
+
icon: 'list-check',
|
|
69
|
+
name: '待办事项',
|
|
70
|
+
execute: editor => TodoItemEditor.insertTodoItem(editor),
|
|
71
|
+
active: editor => TodoItemEditor.isActive(editor)
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
options: {
|
|
75
|
+
allowParentTypes: [ElementKinds.tableCell, ElementKinds.blockquote],
|
|
76
|
+
editableWithReadonly: false
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
79
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9kby1pdGVtLnBsdWdpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3NyYy9wbHVnaW5zL3RvZG8taXRlbS90b2RvLWl0ZW0ucGx1Z2luLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3M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bmNob3JCbG9jayhlZGl0b3IpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGJsb2NrICYmIEVkaXRvci5pc1N0YXJ0KGVkaXRvciwgc2VsZWN0aW9uLmFuY2hvciwgcGF0aCkgJiYgRWRpdG9yLmlzRW1wdHkoZWRpdG9yLCBibG9jaykpIHtcbiAgICAgICAgICAgICAgICAgICAgVHJhbnNmb3Jtcy5zZXROb2RlcyhcbiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRvcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBFbGVtZW50S2luZHMuZGVmYXVsdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja2VkOiB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gYXMgUGFydGlhbDxEZXNjZW5kYW50PixcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXRjaDogbiA9PiBFbGVtZW50LmlzRWxlbWVudChuKSAmJiBuLnR5cGUgPT09IEVsZW1lbnRLaW5kcy5jaGVja0l0ZW1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpbnNlcnRCcmVhaygpO1xuXG4gICAgICAgIGNvbnN0IGFuY2hvckJsb2NrID0gVGhlUXVlcmllcy5hbmNob3JCbG9jayhlZGl0b3IpO1xuICAgICAgICBpZiAoYW5jaG9yQmxvY2sgJiYgYW5jaG9yQmxvY2sudHlwZSA9PT0gRWxlbWVudEtpbmRzLmNoZWNrSXRlbSkge1xuICAgICAgICAgICAgVHJhbnNmb3Jtcy5zZXROb2RlcyhlZGl0b3IsIHsgY2hlY2tlZDogZmFsc2UgfSk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgZWRpdG9yLmRlbGV0ZUJhY2t3YXJkID0gdW5pdCA9PiB7XG4gICAgICAgIGNvbnN0IHsgc2VsZWN0aW9uIH0gPSBlZGl0b3I7XG5cbiAgICAgICAgaWYgKHNlbGVjdGlvbiAmJiBSYW5nZS5pc0NvbGxhcHNlZChzZWxlY3Rpb24pKSB7XG4gICAgICAgICAgICBjb25zdCBbbWF0Y2hdID0gRWRpdG9yLm5vZGVzKGVkaXRvciwge1xuICAgICAgICAgICAgICAgIG1hdGNoOiBuID0+IEVsZW1lbnQuaXNFbGVtZW50KG4pICYmIG4udHlwZSA9PT0gRWxlbWVudEtpbmRzLmNoZWNrSXRlbVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IFssIHBhdGhdID0gbWF0Y2g7XG5cbiAgICAgICAgICAgICAgICBpZiAoRWRpdG9yLmlzU3RhcnQoZWRpdG9yLCBzZWxlY3Rpb24uYW5jaG9yLCBwYXRoKSkge1xuICAgICAgICAgICAgICAgICAgICBUcmFuc2Zvcm1zLnNldE5vZGVzKGVkaXRvciwgeyB0eXBlOiBFbGVtZW50S2luZHMuZGVmYXVsdCwgY2hlY2tlZDogdW5kZWZpbmVkIH0gYXMgUGFydGlhbDxEZXNjZW5kYW50Piwge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2g6IG4gPT4gRWxlbWVudC5pc0VsZW1lbnQobikgJiYgbi50eXBlID09PSBFbGVtZW50S2luZHMuY2hlY2tJdGVtXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGRlbGV0ZUJhY2t3YXJkKHVuaXQpO1xuICAgIH07XG5cbiAgICBlZGl0b3IucmVuZGVyRWxlbWVudCA9IChlbGVtZW50OiBFbGVtZW50KSA9PiB7XG4gICAgICAgIGlmIChlbGVtZW50LnR5cGUgPT09IEVsZW1lbnRLaW5kcy5jaGVja0l0ZW0pIHtcbiAgICAgICAgICAgIHJldHVybiBUaGVUb2RvSXRlbUNvbXBvbmVudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVuZGVyRWxlbWVudChlbGVtZW50KTtcbiAgICB9O1xuXG4gICAgcmV0dXJuIGVkaXRvcjtcbn07XG5cbmV4cG9ydCBjb25zdCBjcmVhdGVUb2RvSXRlbVBsdWdpbiA9IGNyZWF0ZVBsdWdpbkZhY3Rvcnk8VG9kb0l0ZW1QbHVnaW5PcHRpb25zPih7XG4gICAga2V5OiBQbHVnaW5LZXlzLmNoZWNrSXRlbSxcbiAgICB3aXRoT3ZlcnJpZGVzOiB3aXRoVG9kb0l0ZW0sXG4gICAgdG9vbGJhckl0ZW1zOiBbXG4gICAgICAgIHtcbiAgICAgICAgICAgIGtleTogRWxlbWVudEtpbmRzLmNoZWNrSXRlbSxcbiAgICAgICAgICAgIGljb246ICdsaXN0LWNoZWNrJyxcbiAgICAgICAgICAgIG5hbWU6ICflvoXlip7kuovpobknLFxuICAgICAgICAgICAgZXhlY3V0ZTogZWRpdG9yID0+IFRvZG9JdGVtRWRpdG9yLmluc2VydFRvZG9JdGVtKGVkaXRvciksXG4gICAgICAgICAgICBhY3RpdmU6IGVkaXRvciA9PiBUb2RvSXRlbUVkaXRvci5pc0FjdGl2ZShlZGl0b3IpXG4gICAgICAgIH1cbiAgICBdLFxuICAgIG9wdGlvbnM6IHtcbiAgICAgICAgYWxsb3dQYXJlbnRUeXBlczogW0VsZW1lbnRLaW5kcy50YWJsZUNlbGwsIEVsZW1lbnRLaW5kcy5ibG9ja3F1b3RlXSxcbiAgICAgICAgZWRpdGFibGVXaXRoUmVhZG9ubHk6IGZhbHNlXG4gICAgfVxufSk7XG4iXX0=
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Component, HostListener, TemplateRef, ViewChild } from '@angular/core';
|
|
2
|
+
import { TheBaseToolbarDropdown } from '../../core/toolbar-item/base-toolbar-item';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "ngx-tethys";
|
|
5
|
+
import * as i2 from "ngx-tethys/nav";
|
|
6
|
+
import * as i3 from "ngx-tethys/icon";
|
|
7
|
+
import * as i4 from "ngx-tethys/action-menu";
|
|
8
|
+
import * as i5 from "ngx-tethys/tooltip";
|
|
9
|
+
import * as i6 from "@angular/common";
|
|
10
|
+
export class TheVerticalToolbarItemComponent extends TheBaseToolbarDropdown {
|
|
11
|
+
constructor(elementRef, thyPopover, viewContainerRef) {
|
|
12
|
+
super();
|
|
13
|
+
this.elementRef = elementRef;
|
|
14
|
+
this.thyPopover = thyPopover;
|
|
15
|
+
this.viewContainerRef = viewContainerRef;
|
|
16
|
+
this.isHide = true;
|
|
17
|
+
}
|
|
18
|
+
get isOpened() {
|
|
19
|
+
return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
|
|
20
|
+
}
|
|
21
|
+
handleDocumentMouseDown(event) {
|
|
22
|
+
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
23
|
+
this.close();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
ngOnInit() { }
|
|
27
|
+
menusActive(editor) {
|
|
28
|
+
return this.menus.find(i => {
|
|
29
|
+
if (this.editor?.selection && i?.active) {
|
|
30
|
+
return i?.active(editor);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
execute(event) {
|
|
35
|
+
super.execute(event);
|
|
36
|
+
if (this.editor?.readOnly || this.editor?.disabled) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.openPopover();
|
|
40
|
+
}
|
|
41
|
+
itemMousedown(event, item) {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
this.close();
|
|
45
|
+
if (item?.execute) {
|
|
46
|
+
item?.execute(this.editor);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
openPopover() {
|
|
50
|
+
this.dropdownPopoverRef = this.thyPopover.open(this.template, {
|
|
51
|
+
origin: this.elementRef,
|
|
52
|
+
panelClass: ['the-toolbar-dropdown-popover', this.toolbarItem?.key],
|
|
53
|
+
placement: 'bottomLeft',
|
|
54
|
+
offset: 10,
|
|
55
|
+
minWidth: 0,
|
|
56
|
+
viewContainerRef: this.viewContainerRef,
|
|
57
|
+
insideClosable: false,
|
|
58
|
+
backdropClosable: false,
|
|
59
|
+
hasBackdrop: false
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
close() {
|
|
63
|
+
if (this.dropdownPopoverRef) {
|
|
64
|
+
this.dropdownPopoverRef.close();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
TheVerticalToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: TheVerticalToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
+
TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenuItem?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenuItem?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i2.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i4.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i4.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i4.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: TheVerticalToolbarItemComponent, decorators: [{
|
|
71
|
+
type: Component,
|
|
72
|
+
args: [{ selector: 'the-toolbar-vertical-align-item', host: {
|
|
73
|
+
class: 'the-toolbar-dropdown-container verticalAlign',
|
|
74
|
+
'[class.hide]': '!active'
|
|
75
|
+
}, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenuItem?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenuItem?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n" }]
|
|
76
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.ThyPopover }, { type: i0.ViewContainerRef }]; }, propDecorators: { template: [{
|
|
77
|
+
type: ViewChild,
|
|
78
|
+
args: ['VerticalAlignItems', { read: TemplateRef, static: true }]
|
|
79
|
+
}], handleDocumentMouseDown: [{
|
|
80
|
+
type: HostListener,
|
|
81
|
+
args: ['document: mousedown', ['$event']]
|
|
82
|
+
}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WVudUl0ZW1cbiAgICAgICAgICAgICAgICBocmVmPVwiamF2YXNjcmlwdDo7XCJcbiAgICAgICAgICAgICAgICBbdGh5QWN0aW9uTWVudUl0ZW1BY3RpdmVdPVwibWVudS5rZXkgPT09IGFjdGl2ZU1lbnVJdGVtPy5rZXlcIlxuICAgICAgICAgICAgICAgIChtb3VzZWRvd24pPVwiaXRlbU1vdXNlZG93bigkZXZlbnQsIG1lbnUpXCJcbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8c3BhbiAqbmdJZj1cIm1lbnUuaWNvblwiIHRoeUFjdGlvbk1lbnVJdGVtSWNvbj5cbiAgICAgICAgICAgICAgICAgICAgPHRoeS1pY29uIFt0aHlJY29uTmFtZV09XCJtZW51Py5pY29uXCI+PC90aHktaWNvbj5cbiAgICAgICAgICAgICAgICA8L3NwYW4+XG4gICAgICAgICAgICAgICAgPHNwYW4gdGh5QWN0aW9uTWVudUl0ZW1OYW1lPnt7IG1lbnUubmFtZSB9fTwvc3Bhbj5cbiAgICAgICAgICAgIDwvYT5cbiAgICAgICAgPC9uZy1jb250YWluZXI+XG4gICAgPC90aHktYWN0aW9uLW1lbnU+XG48L25nLXRlbXBsYXRlPlxuIl19
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { createPluginFactory } from '../../core';
|
|
2
|
-
import { DropdownMode, ToolbarActionTypes, VerticalAlignment } from '../../constants';
|
|
3
|
-
import { PluginKeys, ToolbarItemType } from '../../interfaces';
|
|
4
|
-
import { TableEditor } from '../table/table.editor';
|
|
5
|
-
import { TheVerticalToolbarItemComponent } from './toolbar-item.component';
|
|
6
|
-
export const VerticalAlignEditor = {
|
|
7
|
-
isVerticalActive(editor, alignment) {
|
|
8
|
-
const tableCellAlign = TableEditor.isVerticalAlignActive(editor, alignment);
|
|
9
|
-
if (tableCellAlign !== null) {
|
|
10
|
-
return tableCellAlign;
|
|
11
|
-
}
|
|
12
|
-
return false;
|
|
13
|
-
},
|
|
14
|
-
setVerticalAlign(editor, alignment) {
|
|
15
|
-
if (TableEditor.setVerticalAlign(editor, alignment)) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export const createVerticalAlignPlugin = createPluginFactory({
|
|
21
|
-
key: PluginKeys.verticalAlign,
|
|
22
|
-
toolbarItems: [
|
|
23
|
-
{
|
|
24
|
-
key: ToolbarActionTypes.verticalAlign,
|
|
25
|
-
name: '垂直对齐',
|
|
26
|
-
type: ToolbarItemType.dropdown,
|
|
27
|
-
dropdownMode: DropdownMode.icon,
|
|
28
|
-
iconComponent: TheVerticalToolbarItemComponent,
|
|
29
|
-
includes: [ToolbarActionTypes.verticalAlignTop, ToolbarActionTypes.verticalAlignMiddle, ToolbarActionTypes.verticalAlignBottom],
|
|
30
|
-
active: editor => TableEditor.isActive(editor)
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
key: ToolbarActionTypes.verticalAlignTop,
|
|
34
|
-
icon: 'align-top',
|
|
35
|
-
name: '顶部对齐',
|
|
36
|
-
execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.top),
|
|
37
|
-
active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.top)
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
key: ToolbarActionTypes.verticalAlignMiddle,
|
|
41
|
-
icon: 'align-middle',
|
|
42
|
-
name: '垂直居中',
|
|
43
|
-
execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.middle),
|
|
44
|
-
active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.middle)
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
key: ToolbarActionTypes.verticalAlignBottom,
|
|
48
|
-
icon: 'align-bottom',
|
|
49
|
-
name: '底部对齐',
|
|
50
|
-
execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.bottom),
|
|
51
|
-
active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.bottom)
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
});
|
|
1
|
+
import { createPluginFactory } from '../../core';
|
|
2
|
+
import { DropdownMode, ToolbarActionTypes, VerticalAlignment } from '../../constants';
|
|
3
|
+
import { PluginKeys, ToolbarItemType } from '../../interfaces';
|
|
4
|
+
import { TableEditor } from '../table/table.editor';
|
|
5
|
+
import { TheVerticalToolbarItemComponent } from './toolbar-item.component';
|
|
6
|
+
export const VerticalAlignEditor = {
|
|
7
|
+
isVerticalActive(editor, alignment) {
|
|
8
|
+
const tableCellAlign = TableEditor.isVerticalAlignActive(editor, alignment);
|
|
9
|
+
if (tableCellAlign !== null) {
|
|
10
|
+
return tableCellAlign;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
},
|
|
14
|
+
setVerticalAlign(editor, alignment) {
|
|
15
|
+
if (TableEditor.setVerticalAlign(editor, alignment)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export const createVerticalAlignPlugin = createPluginFactory({
|
|
21
|
+
key: PluginKeys.verticalAlign,
|
|
22
|
+
toolbarItems: [
|
|
23
|
+
{
|
|
24
|
+
key: ToolbarActionTypes.verticalAlign,
|
|
25
|
+
name: '垂直对齐',
|
|
26
|
+
type: ToolbarItemType.dropdown,
|
|
27
|
+
dropdownMode: DropdownMode.icon,
|
|
28
|
+
iconComponent: TheVerticalToolbarItemComponent,
|
|
29
|
+
includes: [ToolbarActionTypes.verticalAlignTop, ToolbarActionTypes.verticalAlignMiddle, ToolbarActionTypes.verticalAlignBottom],
|
|
30
|
+
active: editor => TableEditor.isActive(editor)
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: ToolbarActionTypes.verticalAlignTop,
|
|
34
|
+
icon: 'align-top',
|
|
35
|
+
name: '顶部对齐',
|
|
36
|
+
execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.top),
|
|
37
|
+
active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.top)
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: ToolbarActionTypes.verticalAlignMiddle,
|
|
41
|
+
icon: 'align-middle',
|
|
42
|
+
name: '垂直居中',
|
|
43
|
+
execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.middle),
|
|
44
|
+
active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.middle)
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: ToolbarActionTypes.verticalAlignBottom,
|
|
48
|
+
icon: 'align-bottom',
|
|
49
|
+
name: '底部对齐',
|
|
50
|
+
execute: editor => VerticalAlignEditor.setVerticalAlign(editor, VerticalAlignment.bottom),
|
|
51
|
+
active: editor => VerticalAlignEditor.isVerticalActive(editor, VerticalAlignment.bottom)
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
55
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVydGljYWwtYWxpZ24uZWRpdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3BsdWdpbnMvdmVydGljYWwtYWxpZ24vdmVydGljYWwtYWxpZ24uZWRpdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUNqRCxPQUFPLEVBQUUsWUFBWSxFQUFFLGtCQUFrQixFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDdEYsT0FBTyxFQUFFLFVBQVUsRUFBYSxlQUFlLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUMxRSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDcEQsT0FBTyxFQUFFLC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J0aWNhbEFjdGl2ZShlZGl0b3IsIFZlcnRpY2FsQWxpZ25tZW50LmJvdHRvbSlcbiAgICAgICAgfVxuICAgIF1cbn0pO1xuIl19
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of editor
|
|
3
|
-
*/
|
|
4
|
-
export * from './editor.module';
|
|
5
|
-
export * from './interfaces';
|
|
6
|
-
export * from './constants';
|
|
7
|
-
export * from './core/index';
|
|
8
|
-
export * from './plugins';
|
|
9
|
-
export * from './plugins/public-api';
|
|
10
|
-
export * from './custom-types';
|
|
11
|
-
export * from './plugins/image/image.component';
|
|
12
|
-
export * from './services/toolbar.service';
|
|
13
|
-
export * from './editor.component';
|
|
14
|
-
export * from './components/toolbar/toolbar.component';
|
|
15
|
-
export * from './core/toolbar-item/base-toolbar-item';
|
|
16
|
-
export * from './components/toolbar-dropdown/toolbar-dropdown.component';
|
|
17
|
-
export * from './components/toolbar-group/toolbar-group.component';
|
|
18
|
-
export * from './components/toolbar-item/toolbar-item.component';
|
|
19
|
-
export * from './components/element/element.component';
|
|
20
|
-
export * as TheQueries from './queries/index';
|
|
21
|
-
export * as TheTransforms from './transforms/index';
|
|
22
|
-
export * from './utils/index';
|
|
23
|
-
export * from './services/context.service';
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of editor
|
|
3
|
+
*/
|
|
4
|
+
export * from './editor.module';
|
|
5
|
+
export * from './interfaces';
|
|
6
|
+
export * from './constants';
|
|
7
|
+
export * from './core/index';
|
|
8
|
+
export * from './plugins';
|
|
9
|
+
export * from './plugins/public-api';
|
|
10
|
+
export * from './custom-types';
|
|
11
|
+
export * from './plugins/image/image.component';
|
|
12
|
+
export * from './services/toolbar.service';
|
|
13
|
+
export * from './editor.component';
|
|
14
|
+
export * from './components/toolbar/toolbar.component';
|
|
15
|
+
export * from './core/toolbar-item/base-toolbar-item';
|
|
16
|
+
export * from './components/toolbar-dropdown/toolbar-dropdown.component';
|
|
17
|
+
export * from './components/toolbar-group/toolbar-group.component';
|
|
18
|
+
export * from './components/toolbar-item/toolbar-item.component';
|
|
19
|
+
export * from './components/element/element.component';
|
|
20
|
+
export * as TheQueries from './queries/index';
|
|
21
|
+
export * as TheTransforms from './transforms/index';
|
|
22
|
+
export * from './utils/index';
|
|
23
|
+
export * from './services/context.service';
|
|
24
24
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLFdBQVcsQ0FBQztBQUMxQixjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyx3Q0FBd0MsQ0FBQztBQUN2RCxjQUFjLHVDQUF1QyxDQUFDO0FBQ3RELGNBQWMsMERBQTBELENBQUM7QUFDekUsY0FBYyxvREFBb0QsQ0FBQztBQUNuRSxjQUFjLGtEQUFrRCxDQUFDO0FBQ2pFLGNBQWMsd0NBQXdDLENBQUM7QUFDdkQsT0FBTyxLQUFLLFVBQVUsTUFBTSxpQkFBaUIsQ0FBQztBQUM5QyxPQUFPLEtBQUssYUFBYSxNQUFNLG9CQUFvQixDQUFDO0FBQ3BELGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsNEJBQTRCLENBQUMiLCJzb3VyY2VzQ29udG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JpZXMvaW5kZXgnO1xuZXhwb3J0ICogYXMgVGhlVHJhbnNmb3JtcyBmcm9tICcuL3RyYW5zZm9ybXMvaW5kZXgnO1xuZXhwb3J0ICogZnJvbSAnLi91dGlscy9pbmRleCc7XG5leHBvcnQgKiBmcm9tICcuL3NlcnZpY2VzL2NvbnRleHQuc2VydmljZSc7XG4iXX0=
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
|
-
import { getBlockCardCenterCursor } from './get-block-card-cursor';
|
|
3
|
-
import { isBlockCardCursor } from './is-block-card-cursor';
|
|
4
|
-
export const anchorBlockEntry = (editor, at) => {
|
|
5
|
-
if (!at && isBlockCardCursor(editor)) {
|
|
6
|
-
at = getBlockCardCenterCursor(editor);
|
|
7
|
-
}
|
|
8
|
-
return Editor.above(editor, {
|
|
9
|
-
match: n => Editor.isBlock(editor, n),
|
|
10
|
-
at
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Editor } from 'slate';
|
|
2
|
+
import { getBlockCardCenterCursor } from './get-block-card-cursor';
|
|
3
|
+
import { isBlockCardCursor } from './is-block-card-cursor';
|
|
4
|
+
export const anchorBlockEntry = (editor, at) => {
|
|
5
|
+
if (!at && isBlockCardCursor(editor)) {
|
|
6
|
+
at = getBlockCardCenterCursor(editor);
|
|
7
|
+
}
|
|
8
|
+
return Editor.above(editor, {
|
|
9
|
+
match: n => Editor.isBlock(editor, n),
|
|
10
|
+
at
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5jaG9yLWJsb2NrLWVudHJ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3F1ZXJpZXMvYW5jaG9yLWJsb2NrLWVudHJ5LnRzIl0sIm5hbWVzIjpb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pbmVkID0+IHtcbiAgICBpZiAoIWF0ICYmIGlzQmxvY2tDYXJkQ3Vyc29yKGVkaXRvcikpIHtcbiAgICAgICAgYXQgPSBnZXRCbG9ja0NhcmRDZW50ZXJDdXJzb3IoZWRpdG9yKTtcbiAgICB9XG5cbiAgICByZXR1cm4gRWRpdG9yLmFib3ZlPEVsZW1lbnQ+KGVkaXRvciwge1xuICAgICAgICBtYXRjaDogbiA9PiBFZGl0b3IuaXNCbG9jayhlZGl0b3IsIG4pLFxuICAgICAgICBhdFxuICAgIH0pO1xufTtcbiJdfQ==
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { anchorBlockEntry } from './anchor-block-entry';
|
|
2
|
-
export const anchorBlock = (editor) => {
|
|
3
|
-
const entry = anchorBlockEntry(editor, editor.selection.anchor);
|
|
4
|
-
return entry ? entry[0] : null;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { anchorBlockEntry } from './anchor-block-entry';
|
|
2
|
+
export const anchorBlock = (editor) => {
|
|
3
|
+
const entry = anchorBlockEntry(editor, editor.selection.anchor);
|
|
4
|
+
return entry ? entry[0] : null;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5jaG9yLWJsb2NrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3F1ZXJpZXMvYW5jaG9yLWJsb2NrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRXhELE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRyxDQUFDLE1BQWMsRUFBVyxFQUFFO0lBQ25ELE1BQU0sS0FBSyxHQUFHLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxNQUFNLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ2hFLE9BQU8sS0FBSyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQztBQUNuQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBFZGl0b3IsIEVsZW1lbnQgfSBmcm9tICdzbGF0ZSc7XG5pbXBvcnQgeyBhbmNob3JCbG9ja0VudHJ5IH0gZnJvbSAnLi9hbmNob3ItYmxvY2stZW50cnknO1xuXG5leHBvcnQgY29uc3QgYW5jaG9yQmxvY2sgPSAoZWRpdG9yOiBFZGl0b3IpOiBFbGVtZW50ID0+IHtcbiAgICBjb25zdCBlbnRyeSA9IGFuY2hvckJsb2NrRW50cnkoZWRpdG9yLCBlZGl0b3Iuc2VsZWN0aW9uLmFuY2hvcik7XG4gICAgcmV0dXJuIGVudHJ5ID8gZW50cnlbMF0gOiBudWxsO1xufTtcbiJdfQ==
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
|
-
export const anchorInlineEntry = (editor) => {
|
|
3
|
-
const match = Editor.above(editor, {
|
|
4
|
-
match: n => Editor.isInline(editor, n)
|
|
5
|
-
});
|
|
6
|
-
if (match) {
|
|
7
|
-
return match;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Editor } from 'slate';
|
|
2
|
+
export const anchorInlineEntry = (editor) => {
|
|
3
|
+
const match = Editor.above(editor, {
|
|
4
|
+
match: n => Editor.isInline(editor, n)
|
|
5
|
+
});
|
|
6
|
+
if (match) {
|
|
7
|
+
return match;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5jaG9yLWlubGluZS1lbnRyeS5qcyIsInNvdXJj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