@worktile/theia 16.0.0 → 16.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/conversion-hint/conversion-hint.component.d.ts +2 -2
- package/components/inline-toolbar/inline-toolbar.component.d.ts +3 -2
- package/components/plugin-menu/plugin-menu.component.d.ts +7 -5
- package/components/template/template.component.d.ts +2 -2
- package/components/toolbar/toolbar.component.d.ts +3 -3
- package/components/toolbar-dropdown/toolbar-dropdown.component.d.ts +2 -2
- package/components/toolbar-group/toolbar-group.component.d.ts +5 -4
- package/core/toolbar-item/base-toolbar-item.d.ts +5 -4
- package/core/utils/plugin-menu.d.ts +2 -2
- package/editor.module.d.ts +3 -3
- package/esm2022/components/conversion-hint/conversion-hint.component.mjs +1 -1
- package/esm2022/components/inline-toolbar/inline-toolbar.component.mjs +1 -1
- package/esm2022/components/plugin-menu/plugin-menu.component.mjs +19 -6
- package/esm2022/components/template/template.component.mjs +1 -1
- package/esm2022/components/toolbar/toolbar.component.mjs +2 -2
- package/esm2022/components/toolbar-dropdown/toolbar-dropdown.component.mjs +1 -1
- package/esm2022/components/toolbar-group/toolbar-group.component.mjs +1 -1
- package/esm2022/constants/auto-format-rules.mjs +1 -1
- package/esm2022/constants/plugin-menu.mjs +2 -5
- package/esm2022/core/toolbar-item/base-toolbar-item.mjs +1 -1
- package/esm2022/core/utils/combine-plugins.mjs +1 -1
- package/esm2022/core/utils/plugin-menu.mjs +1 -1
- package/esm2022/custom-types.mjs +1 -1
- package/esm2022/editor.module.mjs +4 -4
- package/esm2022/interfaces/auto-format.mjs +1 -1
- package/esm2022/interfaces/editor.mjs +1 -1
- package/esm2022/interfaces/image.mjs +1 -1
- package/esm2022/interfaces/plugins/plugin-menu.mjs +1 -1
- package/esm2022/interfaces/plugins/with-override.mjs +1 -1
- package/esm2022/interfaces/reset-block-type-plugin-options.mjs +1 -1
- package/esm2022/interfaces/toolbar.mjs +1 -1
- package/esm2022/interfaces/view-base.mjs +1 -1
- package/esm2022/pipes.mjs +17 -1
- package/esm2022/plugins/align/align.editor.mjs +2 -2
- package/esm2022/plugins/align/align.plugin.mjs +1 -1
- package/esm2022/plugins/autoformat/autoformat.plugin.mjs +1 -1
- package/esm2022/plugins/autoformat/transforms/auto-format-block.mjs +2 -2
- package/esm2022/plugins/autoformat/transforms/auto-format-inline.mjs +1 -1
- package/esm2022/plugins/blockquote/blockquote.component.mjs +1 -1
- package/esm2022/plugins/blockquote/blockquote.editor.mjs +5 -2
- package/esm2022/plugins/blockquote/blockquote.plugin.mjs +3 -3
- package/esm2022/plugins/code/code.component.mjs +1 -1
- package/esm2022/plugins/code/code.editor.mjs +1 -1
- package/esm2022/plugins/code/code.plugin.mjs +1 -1
- package/esm2022/plugins/color/color.editor.mjs +1 -1
- package/esm2022/plugins/common/block-card.plugin.mjs +1 -1
- package/esm2022/plugins/common/common.plugin.mjs +1 -1
- package/esm2022/plugins/common/get-fragment.plugin.mjs +1 -1
- package/esm2022/plugins/common/history.plugin.mjs +1 -1
- package/esm2022/plugins/common/insert-data-by-invalid-type.mjs +1 -1
- package/esm2022/plugins/common/move-selection.plugin.mjs +1 -1
- package/esm2022/plugins/common/remove-empty.plugin.mjs +1 -1
- package/esm2022/plugins/common/remove-void.plugin.mjs +1 -1
- package/esm2022/plugins/common/reset-type.plugin.mjs +1 -1
- package/esm2022/plugins/common/transforms.plugin.mjs +1 -1
- package/esm2022/plugins/deserialize/deserialize-html.plugin.mjs +3 -3
- package/esm2022/plugins/deserialize/deserialize-md.plugin.mjs +2 -2
- package/esm2022/plugins/font-size/font-size.editor.mjs +1 -1
- package/esm2022/plugins/heading/heading.editor.mjs +3 -3
- package/esm2022/plugins/heading/heading.plugin.mjs +1 -1
- package/esm2022/plugins/hr/hr.component.mjs +1 -1
- package/esm2022/plugins/hr/hr.editor.mjs +2 -2
- package/esm2022/plugins/hr/hr.plugin.mjs +1 -1
- package/esm2022/plugins/image/image.component.mjs +23 -4
- package/esm2022/plugins/image/image.editor.mjs +2 -2
- package/esm2022/plugins/indent/indent.editor.mjs +7 -7
- package/esm2022/plugins/indent/indent.plugin.mjs +1 -1
- package/esm2022/plugins/indent/on-keydown-indent.mjs +2 -2
- package/esm2022/plugins/inline-code/inline-code.component.mjs +1 -1
- package/esm2022/plugins/inline-code/inline-code.editor.mjs +3 -3
- package/esm2022/plugins/inline-code/inline-code.plugin.mjs +1 -1
- package/esm2022/plugins/link/edit/link-edit.component.mjs +1 -1
- package/esm2022/plugins/link/link.component.mjs +2 -2
- package/esm2022/plugins/link/link.editor.mjs +3 -3
- package/esm2022/plugins/link/link.plugin.mjs +1 -1
- package/esm2022/plugins/list/components/bulleted-list.component.mjs +1 -1
- package/esm2022/plugins/list/components/list-item.component.mjs +1 -1
- package/esm2022/plugins/list/components/numbered-list.component.mjs +1 -1
- package/esm2022/plugins/list/list.editor.mjs +8 -8
- package/esm2022/plugins/list/list.plugin.mjs +2 -2
- package/esm2022/plugins/list/normalizers/get-list-normalizer.mjs +1 -1
- package/esm2022/plugins/list/normalizers/normalize-list-item.mjs +1 -1
- package/esm2022/plugins/list/normalizers/normalize-no.mjs +1 -1
- package/esm2022/plugins/list/on-key-down-list.mjs +1 -1
- package/esm2022/plugins/list/queries/get-list-item-entry.mjs +2 -2
- package/esm2022/plugins/list/queries/get-start-list-item.mjs +1 -1
- package/esm2022/plugins/list/queries/has-list-in-list-item.mjs +1 -1
- package/esm2022/plugins/list/queries/is-in-list.mjs +2 -2
- package/esm2022/plugins/list/queries/is-list-nested.mjs +1 -1
- package/esm2022/plugins/list/queries/is-list.mjs +1 -1
- package/esm2022/plugins/list/queries/is-node-type-list.mjs +1 -1
- package/esm2022/plugins/list/queries/is-selection-at-list-item-start.mjs +2 -2
- package/esm2022/plugins/list/queries/is-selection-in-same-list-item.mjs +1 -1
- package/esm2022/plugins/list/queries/is-single-list-item.mjs +1 -1
- package/esm2022/plugins/list/transforms/insert-list-data.mjs +2 -2
- package/esm2022/plugins/list/transforms/insert-list-item.mjs +6 -5
- package/esm2022/plugins/list/transforms/move-list-item-down.mjs +1 -1
- package/esm2022/plugins/list/transforms/move-list-item-sublist-items-to-list-item-sublist.mjs +1 -1
- package/esm2022/plugins/list/transforms/move-list-item-sublist-items-to-list.mjs +1 -1
- package/esm2022/plugins/list/transforms/move-list-item-up.mjs +4 -4
- package/esm2022/plugins/list/transforms/unwrap-list.mjs +2 -2
- package/esm2022/plugins/mark/mark.editor.mjs +1 -1
- package/esm2022/plugins/mark/mark.plugin.mjs +1 -1
- package/esm2022/plugins/mention/mention.editor.mjs +1 -1
- package/esm2022/plugins/mention/mention.plugin.mjs +3 -3
- package/esm2022/plugins/node-id/node-id.plugin.mjs +1 -1
- package/esm2022/plugins/normalizers/insert-paragraph-nodes.mjs +1 -1
- package/esm2022/plugins/normalizers/remove-empty-nodes.mjs +1 -1
- package/esm2022/plugins/normalizers/trailing-node.plugin.mjs +1 -1
- package/esm2022/plugins/paint-format/paint-format.editor.mjs +1 -1
- package/esm2022/plugins/quick-insert/components/quick-insert.component.mjs +1 -1
- package/esm2022/plugins/quick-insert/quick-insert.editor.mjs +1 -1
- package/esm2022/plugins/quick-insert/quick-insert.plugin.mjs +1 -1
- package/esm2022/plugins/table/components/insert-mark/insert-mark.component.mjs +1 -1
- package/esm2022/plugins/table/components/table.component.mjs +1 -1
- package/esm2022/plugins/table/components/td/td.component.mjs +1 -1
- package/esm2022/plugins/table/components/toolbar/table-options.component.mjs +1 -1
- package/esm2022/plugins/table/components/toolbar/table-toolbar.component.mjs +1 -1
- package/esm2022/plugins/table/table.editor.mjs +3 -3
- package/esm2022/plugins/table/table.plugin.mjs +3 -3
- package/esm2022/plugins/table/table.store.mjs +1 -1
- package/esm2022/plugins/table/table.types.mjs +1 -1
- package/esm2022/plugins/table/transforms/clear-cell.mjs +1 -1
- package/esm2022/plugins/table/transforms/clear-table-node.mjs +1 -1
- package/esm2022/plugins/table/transforms/insert-column.mjs +2 -2
- package/esm2022/plugins/table/transforms/insert-row.mjs +1 -1
- package/esm2022/plugins/table/transforms/insert-table.mjs +1 -1
- package/esm2022/plugins/table/transforms/remove-column.mjs +1 -1
- package/esm2022/plugins/table/transforms/remove-row.mjs +1 -1
- package/esm2022/plugins/table/transforms/remove-table.mjs +1 -1
- package/esm2022/plugins/table/utils/calc-anchor-position.mjs +1 -1
- package/esm2022/plugins/table/utils/cell-position.mjs +1 -1
- package/esm2022/plugins/table/utils/create-table-position.mjs +1 -1
- package/esm2022/plugins/table/utils/get-min-max-cell-index.mjs +1 -1
- package/esm2022/plugins/table/utils/get-select-cell-node.mjs +1 -1
- package/esm2022/plugins/table/utils/handle-cell.mjs +2 -2
- package/esm2022/plugins/table/utils/is-range-in-table.mjs +1 -1
- package/esm2022/plugins/table/utils/is-selection-in-table.mjs +1 -1
- package/esm2022/plugins/table/utils/merge-cell.mjs +2 -2
- package/esm2022/plugins/table/utils/set-menu-cell-invisibility.mjs +1 -1
- package/esm2022/plugins/table/utils/split-cell.mjs +2 -2
- package/esm2022/plugins/table/utils/table-entry.mjs +1 -1
- package/esm2022/plugins/todo-item/todo-item.component.mjs +2 -2
- package/esm2022/plugins/todo-item/todo-item.editor.mjs +1 -1
- package/esm2022/plugins/todo-item/todo-item.plugin.mjs +5 -5
- package/esm2022/plugins/vertical-align/toolbar-item.component.mjs +1 -1
- package/esm2022/queries/anchor-block-entry.mjs +2 -2
- package/esm2022/queries/anchor-block.mjs +1 -1
- package/esm2022/queries/anchor-inline-entry.mjs +1 -1
- package/esm2022/queries/find-descendant.mjs +1 -1
- package/esm2022/queries/find-node.mjs +1 -1
- package/esm2022/queries/get-above-by-type.mjs +2 -2
- package/esm2022/queries/get-above.mjs +1 -1
- package/esm2022/queries/get-anchor-block-entry.mjs +2 -2
- package/esm2022/queries/get-block-above.mjs +2 -2
- package/esm2022/queries/get-block-card-above.mjs +2 -2
- package/esm2022/queries/get-block-card-cursor.mjs +1 -1
- package/esm2022/queries/get-container-blocks.mjs +1 -1
- package/esm2022/queries/get-insert-elements-path.mjs +2 -2
- package/esm2022/queries/get-last-node.mjs +1 -1
- package/esm2022/queries/get-node.mjs +1 -1
- package/esm2022/queries/get-nodes-by-type.mjs +2 -2
- package/esm2022/queries/get-nodes.mjs +1 -1
- package/esm2022/queries/get-parent.mjs +1 -1
- package/esm2022/queries/get-plain-text.mjs +1 -1
- package/esm2022/queries/get-plugin-by-toolbar.mjs +1 -1
- package/esm2022/queries/get-point-before.mjs +1 -1
- package/esm2022/queries/get-point-from-location.mjs +1 -1
- package/esm2022/queries/get-rang-from-block-start.mjs +1 -1
- package/esm2022/queries/get-range-before.mjs +1 -1
- package/esm2022/queries/get-selection-marks.mjs +1 -1
- package/esm2022/queries/get-selection-nodes-by-type.mjs +1 -1
- package/esm2022/queries/get-text.mjs +1 -1
- package/esm2022/queries/get-toolbar-disabled.mjs +1 -1
- package/esm2022/queries/is-across-blocks.mjs +1 -1
- package/esm2022/queries/is-ancestor-empty.mjs +1 -1
- package/esm2022/queries/is-block-above-empty.mjs +1 -1
- package/esm2022/queries/is-block-active.mjs +2 -2
- package/esm2022/queries/is-block-card-cursor.mjs +1 -1
- package/esm2022/queries/is-block-text-empty-after-selection.mjs +1 -1
- package/esm2022/queries/is-contain-nested-type.mjs +3 -3
- package/esm2022/queries/is-container-type.mjs +1 -1
- package/esm2022/queries/is-empty-content-filter.mjs +1 -1
- package/esm2022/queries/is-empty-content.mjs +1 -1
- package/esm2022/queries/is-empty-paragraph-by-path.mjs +1 -1
- package/esm2022/queries/is-empty-paragraph.mjs +1 -1
- package/esm2022/queries/is-global-collapsed.mjs +1 -1
- package/esm2022/queries/is-include-types.mjs +1 -1
- package/esm2022/queries/is-node-type-in.mjs +1 -1
- package/esm2022/queries/is-node-type.mjs +1 -1
- package/esm2022/queries/is-paragraph.mjs +2 -2
- package/esm2022/queries/is-range-across-blocks.mjs +1 -1
- package/esm2022/queries/is-start.mjs +1 -1
- package/esm2022/queries/some-node.mjs +1 -1
- package/esm2022/shortcuts/index.mjs +1 -1
- package/esm2022/shortcuts/mark.mjs +1 -1
- package/esm2022/test/utils/with-plugin.mjs +6 -3
- package/esm2022/transforms/clear-marks.mjs +1 -1
- package/esm2022/transforms/close-conversion-hint.mjs +1 -1
- package/esm2022/transforms/delete-element.mjs +1 -1
- package/esm2022/transforms/handle-continual-delete-backward.mjs +2 -2
- package/esm2022/transforms/handle-continual-insert-break.mjs +2 -2
- package/esm2022/transforms/insert-elements.mjs +2 -2
- package/esm2022/transforms/insert-paragraph.mjs +1 -1
- package/esm2022/transforms/move-children.mjs +1 -1
- package/esm2022/transforms/on-keydown-reset-block-type.mjs +3 -2
- package/esm2022/transforms/set-end-selection.mjs +1 -1
- package/esm2022/transforms/set-marks.mjs +1 -1
- package/esm2022/transforms/set-node.mjs +1 -1
- package/esm2022/transforms/un-hang-range.mjs +1 -1
- package/esm2022/transforms/un-wrap.mjs +2 -2
- package/esm2022/transforms/unwrap-nodes-by-type.mjs +2 -2
- package/esm2022/utils/auto-focus.mjs +1 -1
- package/esm2022/utils/copy-node.mjs +1 -1
- package/esm2022/utils/create-empty-paragraph.mjs +12 -3
- package/esm2022/utils/dom.mjs +1 -1
- package/esm2022/utils/editor-uuid.mjs +1 -1
- package/esm2022/utils/fragment.mjs +2 -2
- package/esm2022/utils/get-editable-element-height.mjs +1 -1
- package/esm2022/utils/get-toolbar-class.mjs +1 -1
- package/esm2022/utils/index.mjs +1 -2
- package/esm2022/utils/insert-data-by-invalid-type.mjs +2 -2
- package/esm2022/utils/is-clean-empty-paragraph.mjs +1 -1
- package/esm2022/utils/is-inline.mjs +2 -2
- package/esm2022/utils/match.mjs +1 -1
- package/esm2022/utils/merge-element-options.mjs +2 -2
- package/esm2022/utils/scroll-into-view.mjs +1 -1
- package/fesm2022/worktile-theia.mjs +131 -93
- package/fesm2022/worktile-theia.mjs.map +1 -1
- package/interfaces/auto-format.d.ts +5 -5
- package/interfaces/editor.d.ts +6 -6
- package/interfaces/image.d.ts +1 -0
- package/interfaces/plugins/plugin-menu.d.ts +6 -6
- package/interfaces/plugins/with-override.d.ts +2 -2
- package/interfaces/reset-block-type-plugin-options.d.ts +3 -3
- package/interfaces/toolbar.d.ts +5 -5
- package/interfaces/view-base.d.ts +2 -3
- package/package.json +4 -4
- package/pipes.d.ts +8 -3
- package/plugins/align/align.editor.d.ts +4 -4
- package/plugins/align/align.plugin.d.ts +1 -2
- package/plugins/autoformat/autoformat.plugin.d.ts +1 -2
- package/plugins/autoformat/transforms/auto-format-block.d.ts +4 -5
- package/plugins/autoformat/transforms/auto-format-inline.d.ts +2 -2
- package/plugins/blockquote/blockquote.component.d.ts +3 -3
- package/plugins/blockquote/blockquote.editor.d.ts +2 -2
- package/plugins/blockquote/blockquote.plugin.d.ts +1 -2
- package/plugins/code/code.component.d.ts +3 -2
- package/plugins/code/code.editor.d.ts +3 -3
- package/plugins/code/code.plugin.d.ts +1 -2
- package/plugins/color/color.editor.d.ts +3 -3
- package/plugins/common/block-card.plugin.d.ts +1 -2
- package/plugins/common/common.plugin.d.ts +1 -2
- package/plugins/common/get-fragment.plugin.d.ts +1 -2
- package/plugins/common/history.plugin.d.ts +6 -6
- package/plugins/common/insert-data-by-invalid-type.d.ts +1 -2
- package/plugins/common/move-selection.plugin.d.ts +1 -2
- package/plugins/common/remove-empty.plugin.d.ts +1 -2
- package/plugins/common/remove-void.plugin.d.ts +1 -2
- package/plugins/common/reset-type.plugin.d.ts +1 -2
- package/plugins/common/transforms.plugin.d.ts +1 -2
- package/plugins/deserialize/deserialize-html.plugin.d.ts +1 -2
- package/plugins/deserialize/deserialize-md.plugin.d.ts +1 -2
- package/plugins/font-size/font-size.editor.d.ts +4 -3
- package/plugins/heading/heading.editor.d.ts +4 -3
- package/plugins/heading/heading.plugin.d.ts +2 -2
- package/plugins/hr/hr.component.d.ts +3 -3
- package/plugins/hr/hr.editor.d.ts +3 -3
- package/plugins/hr/hr.plugin.d.ts +1 -2
- package/plugins/image/image.component.d.ts +5 -2
- package/plugins/image/image.component.scss +37 -8
- package/plugins/image/image.editor.d.ts +7 -8
- package/plugins/indent/indent.editor.d.ts +4 -3
- package/plugins/indent/indent.plugin.d.ts +1 -2
- package/plugins/indent/on-keydown-indent.d.ts +2 -2
- package/plugins/inline-code/inline-code.component.d.ts +3 -2
- package/plugins/inline-code/inline-code.editor.d.ts +5 -6
- package/plugins/inline-code/inline-code.plugin.d.ts +1 -2
- package/plugins/link/edit/link-edit.component.d.ts +2 -3
- package/plugins/link/link.component.d.ts +3 -2
- package/plugins/link/link.editor.d.ts +5 -5
- package/plugins/link/link.plugin.d.ts +1 -2
- package/plugins/list/components/bulleted-list.component.d.ts +3 -2
- package/plugins/list/components/list-item.component.d.ts +3 -3
- package/plugins/list/components/numbered-list.component.d.ts +3 -2
- package/plugins/list/list.editor.d.ts +9 -11
- package/plugins/list/list.plugin.d.ts +1 -2
- package/plugins/list/normalizers/get-list-normalizer.d.ts +2 -3
- package/plugins/list/normalizers/normalize-list-item.d.ts +2 -3
- package/plugins/list/normalizers/normalize-no.d.ts +2 -3
- package/plugins/list/on-key-down-list.d.ts +2 -2
- package/plugins/list/queries/get-list-item-entry.d.ts +2 -3
- package/plugins/list/queries/get-start-list-item.d.ts +2 -2
- package/plugins/list/queries/has-list-in-list-item.d.ts +4 -5
- package/plugins/list/queries/is-in-list.d.ts +2 -3
- package/plugins/list/queries/is-list-nested.d.ts +2 -3
- package/plugins/list/queries/is-list.d.ts +2 -2
- package/plugins/list/queries/is-node-type-list.d.ts +1 -2
- package/plugins/list/queries/is-selection-at-list-item-start.d.ts +2 -2
- package/plugins/list/queries/is-selection-in-same-list-item.d.ts +2 -2
- package/plugins/list/transforms/insert-list-data.d.ts +3 -5
- package/plugins/list/transforms/insert-list-item.d.ts +2 -2
- package/plugins/list/transforms/move-list-item-down.d.ts +2 -3
- package/plugins/list/transforms/move-list-item-sublist-items-to-list-item-sublist.d.ts +2 -3
- package/plugins/list/transforms/move-list-item-sublist-items-to-list.d.ts +2 -3
- package/plugins/list/transforms/move-list-item-up.d.ts +2 -3
- package/plugins/list/transforms/unwrap-list.d.ts +2 -2
- package/plugins/mark/mark.editor.d.ts +2 -3
- package/plugins/mark/mark.plugin.d.ts +1 -2
- package/plugins/mention/mention.plugin.d.ts +1 -2
- package/plugins/node-id/node-id.plugin.d.ts +2 -2
- package/plugins/normalizers/insert-paragraph-nodes.d.ts +1 -2
- package/plugins/normalizers/trailing-node.plugin.d.ts +2 -2
- package/plugins/quick-insert/components/quick-insert.component.d.ts +2 -2
- package/plugins/quick-insert/quick-insert.editor.d.ts +6 -6
- package/plugins/quick-insert/quick-insert.plugin.d.ts +3 -3
- package/plugins/table/components/insert-mark/insert-mark.component.d.ts +2 -2
- package/plugins/table/components/table.component.d.ts +4 -3
- package/plugins/table/components/td/td.component.d.ts +2 -2
- package/plugins/table/components/toolbar/table-options.component.d.ts +2 -2
- package/plugins/table/components/toolbar/table-toolbar.component.d.ts +2 -2
- package/plugins/table/table.editor.d.ts +11 -11
- package/plugins/table/table.store.d.ts +12 -12
- package/plugins/table/table.types.d.ts +3 -4
- package/plugins/table/transforms/clear-cell.d.ts +2 -3
- package/plugins/table/transforms/clear-table-node.d.ts +2 -2
- package/plugins/table/transforms/insert-column.d.ts +4 -5
- package/plugins/table/transforms/insert-row.d.ts +2 -2
- package/plugins/table/transforms/insert-table.d.ts +2 -3
- package/plugins/table/transforms/remove-column.d.ts +2 -2
- package/plugins/table/transforms/remove-row.d.ts +2 -2
- package/plugins/table/transforms/remove-table.d.ts +2 -2
- package/plugins/table/utils/calc-anchor-position.d.ts +2 -2
- package/plugins/table/utils/cell-position.d.ts +3 -3
- package/plugins/table/utils/create-table-position.d.ts +2 -3
- package/plugins/table/utils/get-min-max-cell-index.d.ts +2 -2
- package/plugins/table/utils/get-select-cell-node.d.ts +3 -3
- package/plugins/table/utils/handle-cell.d.ts +2 -3
- package/plugins/table/utils/is-range-in-table.d.ts +2 -3
- package/plugins/table/utils/is-selection-in-table.d.ts +3 -3
- package/plugins/table/utils/merge-cell.d.ts +5 -6
- package/plugins/table/utils/set-menu-cell-invisibility.d.ts +2 -2
- package/plugins/table/utils/split-cell.d.ts +3 -3
- package/plugins/table/utils/table-entry.d.ts +5 -5
- package/plugins/todo-item/todo-item.component.d.ts +3 -2
- package/plugins/todo-item/todo-item.editor.d.ts +3 -3
- package/plugins/todo-item/todo-item.plugin.d.ts +1 -2
- package/plugins/vertical-align/toolbar-item.component.d.ts +3 -2
- package/queries/anchor-block-entry.d.ts +2 -4
- package/queries/anchor-block.d.ts +2 -3
- package/queries/anchor-inline-entry.d.ts +2 -3
- package/queries/find-descendant.d.ts +2 -3
- package/queries/find-node.d.ts +3 -3
- package/queries/get-above-by-type.d.ts +3 -2
- package/queries/get-above.d.ts +3 -3
- package/queries/get-anchor-block-entry.d.ts +2 -4
- package/queries/get-block-above.d.ts +3 -3
- package/queries/get-block-card-above.d.ts +3 -3
- package/queries/get-block-card-cursor.d.ts +2 -2
- package/queries/get-container-blocks.d.ts +2 -2
- package/queries/get-last-node.d.ts +2 -3
- package/queries/get-node.d.ts +2 -3
- package/queries/get-nodes-by-type.d.ts +3 -2
- package/queries/get-nodes.d.ts +3 -2
- package/queries/get-parent.d.ts +3 -3
- package/queries/get-plain-text.d.ts +2 -2
- package/queries/get-plugin-by-toolbar.d.ts +3 -2
- package/queries/get-point-before.d.ts +2 -3
- package/queries/get-point-from-location.d.ts +2 -3
- package/queries/get-rang-from-block-start.d.ts +3 -2
- package/queries/get-range-before.d.ts +2 -3
- package/queries/get-selection-marks.d.ts +2 -2
- package/queries/get-selection-nodes-by-type.d.ts +2 -3
- package/queries/get-text.d.ts +2 -3
- package/queries/get-toolbar-disabled.d.ts +3 -2
- package/queries/is-across-blocks.d.ts +2 -3
- package/queries/is-ancestor-empty.d.ts +2 -3
- package/queries/is-block-above-empty.d.ts +2 -2
- package/queries/is-block-active.d.ts +2 -2
- package/queries/is-block-card-cursor.d.ts +2 -2
- package/queries/is-block-text-empty-after-selection.d.ts +2 -2
- package/queries/is-contain-nested-type.d.ts +2 -2
- package/queries/is-container-type.d.ts +2 -3
- package/queries/is-empty-content-filter.d.ts +2 -2
- package/queries/is-empty-paragraph-by-path.d.ts +2 -3
- package/queries/is-empty-paragraph.d.ts +4 -6
- package/queries/is-global-collapsed.d.ts +2 -2
- package/queries/is-include-types.d.ts +2 -2
- package/queries/is-node-type-in.d.ts +3 -2
- package/queries/is-paragraph.d.ts +2 -2
- package/queries/is-range-across-blocks.d.ts +3 -3
- package/queries/is-start.d.ts +2 -3
- package/queries/some-node.d.ts +2 -3
- package/shortcuts/index.d.ts +2 -2
- package/shortcuts/mark.d.ts +2 -2
- package/transforms/clear-marks.d.ts +2 -2
- package/transforms/close-conversion-hint.d.ts +2 -2
- package/transforms/delete-element.d.ts +2 -3
- package/transforms/handle-continual-delete-backward.d.ts +3 -4
- package/transforms/handle-continual-insert-break.d.ts +3 -3
- package/transforms/insert-elements.d.ts +2 -3
- package/transforms/insert-paragraph.d.ts +2 -3
- package/transforms/move-children.d.ts +2 -3
- package/transforms/on-keydown-reset-block-type.d.ts +2 -2
- package/transforms/set-end-selection.d.ts +2 -2
- package/transforms/set-marks.d.ts +2 -3
- package/transforms/set-node.d.ts +2 -3
- package/transforms/un-hang-range.d.ts +2 -3
- package/transforms/un-wrap.d.ts +2 -2
- package/transforms/unwrap-nodes-by-type.d.ts +3 -2
- package/utils/auto-focus.d.ts +2 -2
- package/utils/copy-node.d.ts +3 -5
- package/utils/dom.d.ts +2 -2
- package/utils/editor-uuid.d.ts +3 -3
- package/utils/fragment.d.ts +5 -7
- package/utils/get-editable-element-height.d.ts +2 -2
- package/utils/get-toolbar-class.d.ts +2 -2
- package/utils/index.d.ts +0 -1
- package/utils/is-clean-empty-paragraph.d.ts +3 -4
- package/utils/is-inline.d.ts +2 -3
- package/utils/match.d.ts +2 -2
- package/utils/merge-element-options.d.ts +1 -1
- package/utils/scroll-into-view.d.ts +2 -2
- package/esm2022/test/utils/with-editor.mjs +0 -8
- package/esm2022/utils/create-paragraph.mjs +0 -14
- package/test/utils/with-editor.d.ts +0 -2
- package/utils/create-paragraph.d.ts +0 -2
|
@@ -422,15 +422,12 @@ const ToolbarMoreGroup = {
|
|
|
422
422
|
icon: 'more'
|
|
423
423
|
};
|
|
424
424
|
|
|
425
|
-
const BaseMenuGroup = {
|
|
426
|
-
groupName: '基础'
|
|
427
|
-
};
|
|
428
425
|
const DefaultPluginMenu = [
|
|
429
426
|
...STANDARD_HEADING_TYPES,
|
|
430
427
|
ElementKinds.numberedList,
|
|
431
428
|
ElementKinds.bulletedList,
|
|
432
429
|
ElementKinds.link,
|
|
433
|
-
|
|
430
|
+
{ groupName: '基础' },
|
|
434
431
|
ElementKinds.image,
|
|
435
432
|
ElementKinds.table,
|
|
436
433
|
ElementKinds.blockquote,
|
|
@@ -790,6 +787,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
|
790
787
|
name: 'elementClass'
|
|
791
788
|
}]
|
|
792
789
|
}] });
|
|
790
|
+
class PluginMenuPipe {
|
|
791
|
+
transform(icon, sceneKey) {
|
|
792
|
+
if (typeof icon === 'function') {
|
|
793
|
+
return icon(sceneKey);
|
|
794
|
+
}
|
|
795
|
+
return icon;
|
|
796
|
+
}
|
|
797
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: PluginMenuPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
798
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: PluginMenuPipe, name: "getMenuIcon" }); }
|
|
799
|
+
}
|
|
800
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: PluginMenuPipe, decorators: [{
|
|
801
|
+
type: Pipe,
|
|
802
|
+
args: [{
|
|
803
|
+
name: 'getMenuIcon'
|
|
804
|
+
}]
|
|
805
|
+
}] });
|
|
793
806
|
|
|
794
807
|
class TheTemplateComponent {
|
|
795
808
|
constructor() {
|
|
@@ -925,7 +938,7 @@ const isCollapsed = (range) => !!range && Range.isCollapsed(range);
|
|
|
925
938
|
|
|
926
939
|
const getAnchorBlockEntry = (editor, at) => {
|
|
927
940
|
return Editor.above(editor, {
|
|
928
|
-
match:
|
|
941
|
+
match: n => Editor.isBlock(editor, n),
|
|
929
942
|
at
|
|
930
943
|
});
|
|
931
944
|
};
|
|
@@ -961,14 +974,14 @@ const isLogicEmptyParagraphElement = (editor, element) => {
|
|
|
961
974
|
|
|
962
975
|
const isParagraph = (editor) => {
|
|
963
976
|
const [match] = Editor.nodes(editor, {
|
|
964
|
-
match:
|
|
977
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.paragraph
|
|
965
978
|
});
|
|
966
979
|
return !!match;
|
|
967
980
|
};
|
|
968
981
|
|
|
969
982
|
const isBlockActive = (editor, format) => {
|
|
970
983
|
const [match] = Editor.nodes(editor, {
|
|
971
|
-
match:
|
|
984
|
+
match: n => Element$1.isElement(n) && n.type === format
|
|
972
985
|
});
|
|
973
986
|
return !!match;
|
|
974
987
|
};
|
|
@@ -981,7 +994,7 @@ const getAboveByType = (editor, types, options = {}) => {
|
|
|
981
994
|
types = [types];
|
|
982
995
|
}
|
|
983
996
|
return Editor.above(editor, {
|
|
984
|
-
match:
|
|
997
|
+
match: n => Element$1.isElement(n) && types.includes(n.type),
|
|
985
998
|
...options
|
|
986
999
|
});
|
|
987
1000
|
};
|
|
@@ -1010,7 +1023,7 @@ const anchorBlockEntry = (editor, at) => {
|
|
|
1010
1023
|
at = getBlockCardCenterCursor(editor);
|
|
1011
1024
|
}
|
|
1012
1025
|
return Editor.above(editor, {
|
|
1013
|
-
match:
|
|
1026
|
+
match: n => Editor.isBlock(editor, n),
|
|
1014
1027
|
at
|
|
1015
1028
|
});
|
|
1016
1029
|
};
|
|
@@ -1038,7 +1051,7 @@ const getNodesByType = (editor, types, options = {}) => {
|
|
|
1038
1051
|
types = [types];
|
|
1039
1052
|
}
|
|
1040
1053
|
return getNodes(editor, {
|
|
1041
|
-
match:
|
|
1054
|
+
match: n => Element$1.isElement(n) && types.includes(n.type),
|
|
1042
1055
|
...options
|
|
1043
1056
|
});
|
|
1044
1057
|
};
|
|
@@ -1053,7 +1066,7 @@ const anchorBlock = (editor) => {
|
|
|
1053
1066
|
* If not found, return the editor entry.
|
|
1054
1067
|
*/
|
|
1055
1068
|
const getBlockAbove = (editor, options = {}) => Editor.above(editor, {
|
|
1056
|
-
match:
|
|
1069
|
+
match: n => Editor.isBlock(editor, n),
|
|
1057
1070
|
...options
|
|
1058
1071
|
}) || [editor, []];
|
|
1059
1072
|
|
|
@@ -1534,7 +1547,7 @@ function filterTextFormat(node) {
|
|
|
1534
1547
|
});
|
|
1535
1548
|
}
|
|
1536
1549
|
function recursionNodes(nodes, callback) {
|
|
1537
|
-
nodes.forEach(
|
|
1550
|
+
nodes.forEach(element => {
|
|
1538
1551
|
if (Element$1.isElement(element)) {
|
|
1539
1552
|
recursionNodes(element.children, callback);
|
|
1540
1553
|
}
|
|
@@ -1603,7 +1616,7 @@ const getRangeBefore = (editor, at, options) => {
|
|
|
1603
1616
|
* If not found, return the editor entry.
|
|
1604
1617
|
*/
|
|
1605
1618
|
const getBlockCardAbove = (editor, options = {}) => Editor.above(editor, {
|
|
1606
|
-
match:
|
|
1619
|
+
match: n => editor.isBlockCard(n),
|
|
1607
1620
|
...options
|
|
1608
1621
|
});
|
|
1609
1622
|
|
|
@@ -1668,7 +1681,7 @@ const getInsertElementsPath = (editor, allowParentTypes) => {
|
|
|
1668
1681
|
const [, anchorPath] = getBlockAbove(editor);
|
|
1669
1682
|
if (!anchorPath)
|
|
1670
1683
|
return false;
|
|
1671
|
-
let parentEntry = Editor.above(editor, { match:
|
|
1684
|
+
let parentEntry = Editor.above(editor, { match: n => Editor.isBlock(editor, n) && allowParentTypes.includes(n.type) });
|
|
1672
1685
|
if (!parentEntry)
|
|
1673
1686
|
return false;
|
|
1674
1687
|
const [, anchorBlockPath] = anchorBlockEntry(editor);
|
|
@@ -1712,13 +1725,13 @@ const isContainNestedType = (editor, types) => {
|
|
|
1712
1725
|
const [, anchorPath] = getBlockAbove(editor);
|
|
1713
1726
|
if (!anchorPath)
|
|
1714
1727
|
return false;
|
|
1715
|
-
const parentEntry = Editor.above(editor, { match:
|
|
1728
|
+
const parentEntry = Editor.above(editor, { match: n => Element$1.isElement(n) && types.includes(n.type) });
|
|
1716
1729
|
if (!parentEntry)
|
|
1717
1730
|
return false;
|
|
1718
1731
|
const [, parentPath] = parentEntry;
|
|
1719
1732
|
const entry = Editor.above(editor, {
|
|
1720
1733
|
at: parentPath,
|
|
1721
|
-
match:
|
|
1734
|
+
match: n => {
|
|
1722
1735
|
if (!Element$1.isElement(n))
|
|
1723
1736
|
return false;
|
|
1724
1737
|
const isNestedStructure = editor.nestedStructureByKey[n.type];
|
|
@@ -2044,22 +2057,18 @@ function idCreator(length = 5) {
|
|
|
2044
2057
|
return key;
|
|
2045
2058
|
}
|
|
2046
2059
|
|
|
2047
|
-
const
|
|
2060
|
+
const createEmptyParagraph = () => {
|
|
2048
2061
|
return {
|
|
2049
2062
|
type: ElementKinds.paragraph,
|
|
2050
2063
|
key: idCreator(),
|
|
2051
2064
|
children: [
|
|
2052
2065
|
{
|
|
2053
|
-
text
|
|
2066
|
+
text: ''
|
|
2054
2067
|
}
|
|
2055
2068
|
]
|
|
2056
2069
|
};
|
|
2057
2070
|
};
|
|
2058
2071
|
|
|
2059
|
-
const createEmptyParagraph = () => {
|
|
2060
|
-
return createParagraph('');
|
|
2061
|
-
};
|
|
2062
|
-
|
|
2063
2072
|
function plainToTheia(text) {
|
|
2064
2073
|
if (typeof text !== 'string') {
|
|
2065
2074
|
return text;
|
|
@@ -2171,7 +2180,7 @@ const mergeElementOptions = (elementOptions) => {
|
|
|
2171
2180
|
elementOptions = elementOptions.filter(item => item.invalidChildrenTypes.length > 0);
|
|
2172
2181
|
const combinationData = [...DefaultElementOptions, ...elementOptions];
|
|
2173
2182
|
const dataInfo = {};
|
|
2174
|
-
combinationData.forEach(
|
|
2183
|
+
combinationData.forEach(item => {
|
|
2175
2184
|
const { type, invalidChildrenTypes, isSecondaryContainer } = item;
|
|
2176
2185
|
if (!dataInfo[type]) {
|
|
2177
2186
|
dataInfo[type] = {
|
|
@@ -2398,7 +2407,7 @@ function insertDataByInvalidType(editor, fragment) {
|
|
|
2398
2407
|
const { selection } = editor;
|
|
2399
2408
|
const [start] = Editor.edges(editor, selection);
|
|
2400
2409
|
// query whether there is a node to be verified
|
|
2401
|
-
const tryVerifyNode = allElementOptions.find(
|
|
2410
|
+
const tryVerifyNode = allElementOptions.find(item => getAboveByType(editor, item.type, { at: start, mode: 'lowest' }));
|
|
2402
2411
|
if (tryVerifyNode) {
|
|
2403
2412
|
// is exist invalid element type in fragment
|
|
2404
2413
|
const invalidIndex = fragment.findIndex(item => tryVerifyNode.invalidChildrenTypes.includes(item.type));
|
|
@@ -2970,7 +2979,7 @@ class TheToolbarComponent {
|
|
|
2970
2979
|
this.resizeObserver.observe(editableElement);
|
|
2971
2980
|
}
|
|
2972
2981
|
isTableActive() {
|
|
2973
|
-
const [table] = Editor.nodes(this.editor, { match:
|
|
2982
|
+
const [table] = Editor.nodes(this.editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.table });
|
|
2974
2983
|
return !!table;
|
|
2975
2984
|
}
|
|
2976
2985
|
selectionChange(editor) {
|
|
@@ -4195,7 +4204,7 @@ const unwrapNodesByType = (editor, types, options = {}) => {
|
|
|
4195
4204
|
types = [types];
|
|
4196
4205
|
}
|
|
4197
4206
|
Transforms.unwrapNodes(editor, {
|
|
4198
|
-
match:
|
|
4207
|
+
match: n => Element$1.isElement(n) && types.includes(n.type),
|
|
4199
4208
|
...options
|
|
4200
4209
|
});
|
|
4201
4210
|
};
|
|
@@ -4275,7 +4284,7 @@ const unWrap = (editor, kind) => {
|
|
|
4275
4284
|
Editor.withoutNormalizing(editor, () => {
|
|
4276
4285
|
Transforms.setNodes(editor, { type: ElementKinds.paragraph });
|
|
4277
4286
|
Transforms.unwrapNodes(editor, {
|
|
4278
|
-
match:
|
|
4287
|
+
match: n => Element$1.isElement(n) && n.type === kind,
|
|
4279
4288
|
split: true
|
|
4280
4289
|
});
|
|
4281
4290
|
});
|
|
@@ -4322,7 +4331,7 @@ function handleContinualInsertBreak(editor, lowestBlock, type) {
|
|
|
4322
4331
|
const isEmpty = Editor.isEmpty(editor, lowestBlock);
|
|
4323
4332
|
const isEnd = Editor.isEnd(editor, editor.selection.anchor, editor.selection.focus.path);
|
|
4324
4333
|
const aboveResult = Editor.above(editor, {
|
|
4325
|
-
match:
|
|
4334
|
+
match: n => Editor.isBlock(editor, n) && n.type === type
|
|
4326
4335
|
});
|
|
4327
4336
|
if (aboveResult && aboveResult[0] && isEnd && isEmpty) {
|
|
4328
4337
|
const wrapBlock = aboveResult[0];
|
|
@@ -4696,13 +4705,14 @@ function removeTable(opts, editor) {
|
|
|
4696
4705
|
const BlockquoteEditor = {
|
|
4697
4706
|
toggleBlockquote(editor) {
|
|
4698
4707
|
const isActive = isBlockActive(editor, ElementKinds.blockquote);
|
|
4708
|
+
const allowParentTypes = getPluginOptions(editor, PluginKeys.blockquote)?.allowParentTypes || [];
|
|
4699
4709
|
if (!isActive) {
|
|
4700
4710
|
Transforms.wrapNodes(editor, { type: ElementKinds.blockquote, children: [] }, {
|
|
4701
4711
|
mode: 'lowest'
|
|
4702
4712
|
});
|
|
4703
4713
|
}
|
|
4704
4714
|
else {
|
|
4705
|
-
Transforms.unwrapNodes(editor, { match:
|
|
4715
|
+
Transforms.unwrapNodes(editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.blockquote });
|
|
4706
4716
|
}
|
|
4707
4717
|
}
|
|
4708
4718
|
};
|
|
@@ -4787,7 +4797,7 @@ const HeadingEditor = {
|
|
|
4787
4797
|
const cleanupTypes = getPluginOptions(editor, PluginKeys.heading).cleanupTypes;
|
|
4788
4798
|
Transforms.unwrapNodes(editor, {
|
|
4789
4799
|
at: editor.selection,
|
|
4790
|
-
match:
|
|
4800
|
+
match: n => Element$1.isElement(n) && cleanupTypes.includes(n.type),
|
|
4791
4801
|
mode: 'all',
|
|
4792
4802
|
split: true
|
|
4793
4803
|
});
|
|
@@ -4805,7 +4815,7 @@ const HeadingEditor = {
|
|
|
4805
4815
|
},
|
|
4806
4816
|
isHeadingActive(editor, heading) {
|
|
4807
4817
|
const [match] = Editor.nodes(editor, {
|
|
4808
|
-
match:
|
|
4818
|
+
match: n => Element$1.isElement(n) && n.type === heading,
|
|
4809
4819
|
universal: true
|
|
4810
4820
|
});
|
|
4811
4821
|
return !!match;
|
|
@@ -4830,7 +4840,7 @@ const HrEditor = {
|
|
|
4830
4840
|
},
|
|
4831
4841
|
isHrActive(editor) {
|
|
4832
4842
|
const [match] = Editor.nodes(editor, {
|
|
4833
|
-
match:
|
|
4843
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.hr,
|
|
4834
4844
|
universal: true
|
|
4835
4845
|
});
|
|
4836
4846
|
return !!match;
|
|
@@ -4900,7 +4910,7 @@ const ImageEditor = {
|
|
|
4900
4910
|
},
|
|
4901
4911
|
isImageActive(editor) {
|
|
4902
4912
|
const [match] = Editor.nodes(editor, {
|
|
4903
|
-
match:
|
|
4913
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.image,
|
|
4904
4914
|
universal: true
|
|
4905
4915
|
});
|
|
4906
4916
|
return !!match;
|
|
@@ -4919,10 +4929,10 @@ const IndentEditor = {
|
|
|
4919
4929
|
return;
|
|
4920
4930
|
}
|
|
4921
4931
|
const allowedTypes = IndentEditor.getAllowedTypes(editor);
|
|
4922
|
-
const maxIndent = getPluginOptions(editor, PluginKeys.indent)?.maxIndent ??
|
|
4932
|
+
const maxIndent = getPluginOptions(editor, PluginKeys.indent)?.maxIndent ?? [];
|
|
4923
4933
|
const nodes = Array.from(Editor.nodes(editor, {
|
|
4924
4934
|
mode: 'highest',
|
|
4925
|
-
match:
|
|
4935
|
+
match: n => Element$1.isElement(n) && allowedTypes.includes(n.type)
|
|
4926
4936
|
}));
|
|
4927
4937
|
const [startBlock] = nodes;
|
|
4928
4938
|
if (startBlock) {
|
|
@@ -4931,7 +4941,7 @@ const IndentEditor = {
|
|
|
4931
4941
|
if (indent <= maxIndent) {
|
|
4932
4942
|
Transforms.setNodes(editor, { indent }, {
|
|
4933
4943
|
mode: 'highest',
|
|
4934
|
-
match:
|
|
4944
|
+
match: n => Element$1.isElement(n) && allowedTypes.includes(n.type)
|
|
4935
4945
|
});
|
|
4936
4946
|
}
|
|
4937
4947
|
}
|
|
@@ -4943,7 +4953,7 @@ const IndentEditor = {
|
|
|
4943
4953
|
const allowedTypes = IndentEditor.getAllowedTypes(editor);
|
|
4944
4954
|
const nodes = Array.from(Editor.nodes(editor, {
|
|
4945
4955
|
mode: 'highest',
|
|
4946
|
-
match:
|
|
4956
|
+
match: n => Element$1.isElement(n) && allowedTypes.includes(n.type)
|
|
4947
4957
|
}));
|
|
4948
4958
|
const [startBlock] = nodes;
|
|
4949
4959
|
if (startBlock) {
|
|
@@ -4951,14 +4961,14 @@ const IndentEditor = {
|
|
|
4951
4961
|
indent = indent ? --indent : 0;
|
|
4952
4962
|
Transforms.setNodes(editor, { indent }, {
|
|
4953
4963
|
mode: 'highest',
|
|
4954
|
-
match:
|
|
4964
|
+
match: n => Element$1.isElement(n) && allowedTypes.includes(n.type)
|
|
4955
4965
|
});
|
|
4956
4966
|
}
|
|
4957
4967
|
},
|
|
4958
4968
|
setTextIndent(editor, kinds, textIndent) {
|
|
4959
4969
|
Transforms.setNodes(editor, { textIndent }, {
|
|
4960
4970
|
mode: 'highest',
|
|
4961
|
-
match:
|
|
4971
|
+
match: node => Element$1.isElement(node) && kinds.includes(node.type)
|
|
4962
4972
|
});
|
|
4963
4973
|
},
|
|
4964
4974
|
cancelTextIntent(editor, event, anchorBlock, kinds) {
|
|
@@ -5029,7 +5039,7 @@ const LinkEditor = {
|
|
|
5029
5039
|
}
|
|
5030
5040
|
},
|
|
5031
5041
|
isLinkActive(editor) {
|
|
5032
|
-
const [link] = Editor.nodes(editor, { match:
|
|
5042
|
+
const [link] = Editor.nodes(editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.link });
|
|
5033
5043
|
return !!link;
|
|
5034
5044
|
},
|
|
5035
5045
|
wrapLink(editor, text, url) {
|
|
@@ -5052,7 +5062,7 @@ const LinkEditor = {
|
|
|
5052
5062
|
}
|
|
5053
5063
|
},
|
|
5054
5064
|
unwrapLink(editor) {
|
|
5055
|
-
Transforms.unwrapNodes(editor, { match:
|
|
5065
|
+
Transforms.unwrapNodes(editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.link });
|
|
5056
5066
|
}
|
|
5057
5067
|
};
|
|
5058
5068
|
|
|
@@ -5074,7 +5084,7 @@ const ListEditor = {
|
|
|
5074
5084
|
const types = [ElementKinds.bulletedList, ElementKinds.numberedList];
|
|
5075
5085
|
Editor.withoutNormalizing(editor, () => {
|
|
5076
5086
|
const [...listItems] = Editor.nodes(editor, {
|
|
5077
|
-
match:
|
|
5087
|
+
match: node => Element$1.isElement(node) && node.type === ElementKinds.listItem,
|
|
5078
5088
|
mode: 'lowest'
|
|
5079
5089
|
});
|
|
5080
5090
|
const firstListItemPath = listItems.length && listItems[0][1];
|
|
@@ -5095,26 +5105,26 @@ const ListEditor = {
|
|
|
5095
5105
|
Transforms.moveNodes(editor, {
|
|
5096
5106
|
at: editor.selection,
|
|
5097
5107
|
to: Path.next(upListItem),
|
|
5098
|
-
match:
|
|
5108
|
+
match: node => Element$1.isElement(node) && node.type === ElementKinds.listItem
|
|
5099
5109
|
});
|
|
5100
5110
|
}
|
|
5101
5111
|
else {
|
|
5102
5112
|
Transforms.unwrapNodes(editor, {
|
|
5103
|
-
match:
|
|
5113
|
+
match: node => Element$1.isElement(node) && node.type === ElementKinds.listItem
|
|
5104
5114
|
});
|
|
5105
5115
|
}
|
|
5106
5116
|
return;
|
|
5107
5117
|
}
|
|
5108
5118
|
// 跨级、同级且类型不同
|
|
5109
5119
|
if (activeListNode && types.includes(activeListNode.type)) {
|
|
5110
|
-
Transforms.setNodes(editor, { type }, { match:
|
|
5120
|
+
Transforms.setNodes(editor, { type }, { match: node => Element$1.isElement(node) && node.type !== type && types.includes(node.type) });
|
|
5111
5121
|
return;
|
|
5112
5122
|
}
|
|
5113
5123
|
// wrap
|
|
5114
5124
|
ListEditor.buildListItem(editor);
|
|
5115
5125
|
Transforms.wrapNodes(editor, { type, children: [], start: startIndex }, {
|
|
5116
5126
|
at: editor.selection,
|
|
5117
|
-
match:
|
|
5127
|
+
match: node => Element$1.isElement(node) && node.type === ElementKinds.listItem
|
|
5118
5128
|
});
|
|
5119
5129
|
});
|
|
5120
5130
|
},
|
|
@@ -5148,7 +5158,7 @@ const ListEditor = {
|
|
|
5148
5158
|
},
|
|
5149
5159
|
buildListItem(editor) {
|
|
5150
5160
|
const nodes = Editor.nodes(editor, {
|
|
5151
|
-
match:
|
|
5161
|
+
match: node => Editor.isBlock(editor, node),
|
|
5152
5162
|
mode: 'lowest'
|
|
5153
5163
|
});
|
|
5154
5164
|
for (const [node, path] of nodes) {
|
|
@@ -5380,14 +5390,14 @@ const MentionEditor = {
|
|
|
5380
5390
|
|
|
5381
5391
|
const withMention = (editor) => {
|
|
5382
5392
|
const { isInline, isVoid, insertText, deleteBackward, renderElement, deleteFragment, onKeydown } = editor;
|
|
5383
|
-
editor.isInline =
|
|
5393
|
+
editor.isInline = element => {
|
|
5384
5394
|
const mentions = getPluginOptions(editor, PluginKeys.mention)?.mentions;
|
|
5385
5395
|
if (mentions?.some(mention => element?.type === mention?.type)) {
|
|
5386
5396
|
return true;
|
|
5387
5397
|
}
|
|
5388
5398
|
return isInline(element);
|
|
5389
5399
|
};
|
|
5390
|
-
editor.isVoid =
|
|
5400
|
+
editor.isVoid = element => {
|
|
5391
5401
|
const mentions = getPluginOptions(editor, PluginKeys.mention)?.mentions;
|
|
5392
5402
|
if (mentions?.some(mention => element?.type === mention?.type)) {
|
|
5393
5403
|
return true;
|
|
@@ -5924,6 +5934,7 @@ class ThePluginMenuComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
5924
5934
|
this.cdr = cdr;
|
|
5925
5935
|
this.ngZone = ngZone;
|
|
5926
5936
|
this.thyPopoverRef = thyPopoverRef;
|
|
5937
|
+
this.listBoxAutoActiveFirstItem = true;
|
|
5927
5938
|
this.groupMenu = [];
|
|
5928
5939
|
this.iconMenu = [];
|
|
5929
5940
|
this.ThePluginMenuItemType = ThePluginMenuItemType;
|
|
@@ -5933,7 +5944,7 @@ class ThePluginMenuComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
5933
5944
|
};
|
|
5934
5945
|
this.expandPopoverOptions = {
|
|
5935
5946
|
placement: 'rightTop',
|
|
5936
|
-
width: '
|
|
5947
|
+
width: '262px'
|
|
5937
5948
|
};
|
|
5938
5949
|
this.tableSelectPopoverConfig = {
|
|
5939
5950
|
panelClass: 'plugin-menu-table-select-container',
|
|
@@ -5943,6 +5954,7 @@ class ThePluginMenuComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
5943
5954
|
};
|
|
5944
5955
|
this.containerClassName = `the-plugin-menu-container`;
|
|
5945
5956
|
this.theDisplaySearch = false;
|
|
5957
|
+
this.autoActiveFirstItem = true;
|
|
5946
5958
|
this.removeKeywords = () => {
|
|
5947
5959
|
const node = Node.get(this.editor, this.editor.selection.anchor.path);
|
|
5948
5960
|
if (node && Node.string(node).length > 0) {
|
|
@@ -5951,7 +5963,9 @@ class ThePluginMenuComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
5951
5963
|
};
|
|
5952
5964
|
}
|
|
5953
5965
|
ngOnInit() {
|
|
5954
|
-
this.autoActiveFirstItem
|
|
5966
|
+
if (!this.autoActiveFirstItem || this.theDisplaySearch) {
|
|
5967
|
+
this.listBoxAutoActiveFirstItem = false;
|
|
5968
|
+
}
|
|
5955
5969
|
this.initializeSearch();
|
|
5956
5970
|
this.initializePluginMenu();
|
|
5957
5971
|
this.buildMenus();
|
|
@@ -6027,7 +6041,9 @@ class ThePluginMenuComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
6027
6041
|
QuickInsertEditor.updatePluginMenuRef(this.editor, null);
|
|
6028
6042
|
}
|
|
6029
6043
|
updateKeywords(keywords) {
|
|
6030
|
-
this.autoActiveFirstItem
|
|
6044
|
+
if (this.autoActiveFirstItem) {
|
|
6045
|
+
this.listBoxAutoActiveFirstItem = true;
|
|
6046
|
+
}
|
|
6031
6047
|
this.keyWords = keywords.toLowerCase().trim();
|
|
6032
6048
|
this.buildMenus();
|
|
6033
6049
|
if (this.scrollContainer) {
|
|
@@ -6065,11 +6081,11 @@ class ThePluginMenuComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
6065
6081
|
super.ngOnDestroy();
|
|
6066
6082
|
}
|
|
6067
6083
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ThePluginMenuComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6068
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ThePluginMenuComponent, selector: "the-plugin-menu", inputs: { editor: "editor", theDisplaySearch: "theDisplaySearch", thePluginMenu: "thePluginMenu" }, host: { properties: { "class": "this.containerClassName" } }, viewQueries: [{ propertyName: "dropdownTriggers", predicate: ["dropdownTriggers"], descendants: true, read: ThyDropdownDirective }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"theDisplaySearch\" class=\"menu-search px-5 pt-5 pb-2\">\n <thy-input-search [(ngModel)]=\"keyWords\" placeholder=\"\u641C\u7D22\" thyIconPosition=\"after\" (ngModelChange)=\"updateKeywords(keyWords)\">\n </thy-input-search>\n</div>\n\n<div\n *ngIf=\"groupMenu.length > 0; else thyEmpty\"\n theListBox\n [keyboardContainer]=\"keyboardContainer\"\n [autoActiveFirstItem]=\"autoActiveFirstItem\"\n (theListboxChange)=\"theListboxChange($event)\"\n class=\"thy-dropdown-menu the-plugin-menu-scroll-container pb-2 pt-0\"\n>\n <div *ngIf=\"iconMenu?.length > 0\" theListboxGroup [horizontalColumn]=\"6\" class=\"icon-menu d-flex pl-5 py-1\">\n <ng-container *ngFor=\"let item of iconMenu; trackBy: trackByFn\">\n <a\n *ngIf=\"item.type === ThePluginMenuItemType.icon\"\n href=\"javascript:;\"\n class=\"mt-2\"\n thyAction\n theListboxOption\n [theOptionValue]=\"item\"\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item?.name\"\n [thyDisabled]=\"item.disabled\"\n [theOptionDisabled]=\"item.disabled\"\n thePreventDefault\n (click)=\"handleItemSelection(item)\"\n ></a>\n </ng-container>\n </div>\n\n <thy-divider *ngIf=\"this.iconMenu?.length\" class=\"my-2\"></thy-divider>\n <div theListboxGroup>\n <ng-container *ngFor=\"let item of groupMenu; trackBy: trackByFn\">\n <ng-container *ngIf=\"item.isMenuItem && !(item.children?.length > 0) && item.key !== 'table'\">\n <div\n thyDropdownMenuItem\n theListboxOption\n [theOptionValue]=\"item\"\n class=\"py-0\"\n thePreventDefault\n [thyDisabled]=\"item.disabled\"\n [theOptionDisabled]=\"item.disabled\"\n (click)=\"handleItemSelection(item)\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"item.isMenuItem && item.children?.length > 0\" #hasExpanded>\n <div\n #dropdownTriggers\n [thyDropdown]=\"expand\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n [thyDisabled]=\"item.disabled\"\n theListboxOption\n [theOptionValue]=\"item\"\n [theOptionDisabled]=\"item.disabled\"\n [thyPopoverOptions]=\"expandPopoverOptions\"\n class=\"py-0\"\n thePreventDefault\n (click)=\"handleItemSelection(item)\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n <div *ngIf=\"item.children?.length > 0\">\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n <thy-dropdown-menu #expand>\n <div class=\"the-plugin-menu-container expand-menu\" theListboxGroup>\n <ng-container *ngFor=\"let child of item.children\">\n <div\n *ngIf=\"child.type === ThePluginMenuItemType.group\"\n thyDropdownMenuItem\n theListboxOption\n class=\"py-0\"\n thePreventDefault\n [theOptionDisabled]=\"item.disabled\"\n [thyDisabled]=\"child.disabled\"\n (click)=\"handleItemSelection(child)\"\n [theOptionValue]=\"child\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"child.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ child.name }}\n </div>\n </div>\n </div>\n <thy-divider *ngIf=\"child === 'divider'\" class=\"my-2\"></thy-divider>\n </ng-container>\n </div>\n </thy-dropdown-menu>\n </div>\n </ng-container>\n <ng-container *ngIf=\"item.isMenuItem && item.key === 'table'\">\n <div\n #dropdownTriggers\n [thyPopover]=\"tableSelect\"\n thyPlacement=\"rightTop\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n theListboxOption\n [thyConfig]=\"tableSelectPopoverConfig\"\n [theOptionValue]=\"item\"\n [theOptionDisabled]=\"item.disabled\"\n [thyDisabled]=\"item.disabled\"\n class=\"py-0\"\n thePreventDefault\n (click)=\"handleItemSelection(item)\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n <div>\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n\n <ng-template #tableSelect>\n <table-select\n class=\"plugin-menu-table the-table-selector-panel\"\n [editor]=\"editor\"\n [beforeInsert]=\"removeKeywords\"\n ></table-select>\n </ng-template>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!item.isMenuItem\" #menuGroup>\n <thy-dropdown-menu-group class=\"font-size-sm\" [thyTitle]=\"item.groupName\"></thy-dropdown-menu-group>\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<ng-template #thyEmpty>\n <div class=\"empty d-flex align-items-center justify-content-center\">\n <thy-empty [thyMessage]=\"thyMessage\"></thy-empty>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i6$1.ThyInputSearchComponent, selector: "thy-input-search", inputs: ["name", "placeholder", "thyTheme", "thySearchFocus", "thyIconPosition", "thySize"], outputs: ["clear", "thyClear"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i8$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "directive", type: i6.ThyDropdownDirective, selector: "[thyDropdown]", inputs: ["thyDropdownMenu", "thyDropdown", "thyTrigger", "thyShowDelay", "thyHideDelay", "thyActiveClass", "thyPopoverOptions", "thyPlacement", "thyMenuInsideClosable", "thyPanelClass"], outputs: ["thyActiveChange"] }, { kind: "component", type: i6.ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth", "thyImmediateRender"] }, { kind: "component", type: i6.ThyDropdownMenuGroupComponent, selector: "thy-dropdown-menu-group", inputs: ["thyTitle"] }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "component", type: i10.ThyEmptyComponent, selector: "thy-empty", inputs: ["thyMessage", "thyTranslationKey", "thyTranslationValues", "thyEntityName", "thyEntityNameTranslateKey", "thyIconName", "thySize", "thyMarginTop", "thyTopAuto", "thyContainer", "thyImageUrl", "thyImageLoading", "thyImageFetchPriority", "thyDescription"] }, { kind: "directive", type: i1$1.ThyPopoverDirective, selector: "[thyPopover]", inputs: ["thyPopover", "thyTrigger", "thyPlacement", "thyOffset", "thyConfig", "thyShowDelay", "thyHideDelay", "thyAutoAdaptive", "thyDisabled"] }, { kind: "component", type: TheTableSelectComponent, selector: "table-select", inputs: ["optionsParam", "editor", "beforeInsert"] }, { kind: "directive", type: TheListboxOptionDirective, selector: "[theListboxOption]", inputs: ["theOptionValue", "theOptionDisabled"], exportAs: ["theListboxOption"] }, { kind: "directive", type: TheListboxGroupDirective, selector: "[theListboxGroup]", inputs: ["horizontalColumn"], exportAs: ["theListboxGroup"] }, { kind: "directive", type: TheListboxDirective, selector: "[theListBox]", inputs: ["keyboardContainer", "autoActiveFirstItem"], outputs: ["theListboxChange"], exportAs: ["theListBox"] }, { kind: "directive", type: ThePreventDefaultDirective, selector: "[thePreventDefault]", exportAs: ["thePreventDefault"] }] }); }
|
|
6084
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ThePluginMenuComponent, selector: "the-plugin-menu", inputs: { editor: "editor", theDisplaySearch: "theDisplaySearch", thePluginMenu: "thePluginMenu", sceneKey: "sceneKey", subPanelClass: "subPanelClass", autoActiveFirstItem: "autoActiveFirstItem" }, host: { properties: { "class": "this.containerClassName" } }, viewQueries: [{ propertyName: "dropdownTriggers", predicate: ["dropdownTriggers"], descendants: true, read: ThyDropdownDirective }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"theDisplaySearch\" class=\"menu-search px-5 pt-5 pb-2\">\n <thy-input-search [(ngModel)]=\"keyWords\" placeholder=\"\u641C\u7D22\" thyIconPosition=\"after\" (ngModelChange)=\"updateKeywords(keyWords)\">\n </thy-input-search>\n</div>\n\n<div\n *ngIf=\"groupMenu.length > 0; else thyEmpty\"\n theListBox\n [keyboardContainer]=\"keyboardContainer\"\n [autoActiveFirstItem]=\"listBoxAutoActiveFirstItem\"\n (theListboxChange)=\"theListboxChange($event)\"\n class=\"thy-dropdown-menu the-plugin-menu-scroll-container pb-2 pt-0\"\n>\n <div *ngIf=\"iconMenu?.length > 0\" theListboxGroup [horizontalColumn]=\"6\" class=\"icon-menu d-flex pl-5 py-1\">\n <ng-container *ngFor=\"let item of iconMenu; trackBy: trackByFn\">\n <a\n *ngIf=\"item.type === ThePluginMenuItemType.icon\"\n href=\"javascript:;\"\n class=\"mt-2\"\n thyAction\n theListboxOption\n [theOptionValue]=\"item\"\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item?.name\"\n [thyDisabled]=\"item.disabled\"\n [theOptionDisabled]=\"item.disabled\"\n thePreventDefault\n (click)=\"handleItemSelection(item)\"\n ></a>\n </ng-container>\n </div>\n\n <thy-divider *ngIf=\"this.iconMenu?.length\" class=\"my-2\"></thy-divider>\n <div theListboxGroup>\n <ng-container *ngFor=\"let item of groupMenu; trackBy: trackByFn\">\n <ng-container *ngIf=\"item.isMenuItem && !(item.children?.length > 0) && item.key !== 'table'\">\n <div\n thyDropdownMenuItem\n theListboxOption\n [theOptionValue]=\"item\"\n class=\"py-0\"\n thePreventDefault\n [thyDisabled]=\"item.disabled\"\n [theOptionDisabled]=\"item.disabled\"\n (click)=\"handleItemSelection(item)\"\n >\n <div *ngIf=\"item.menuIcon\" class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"item.isMenuItem && item.children?.length > 0\" #hasExpanded>\n <div\n #dropdownTriggers\n [thyDropdown]=\"expand\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n [thyDisabled]=\"item.disabled\"\n theListboxOption\n [theOptionValue]=\"item\"\n [theOptionDisabled]=\"item.disabled\"\n [thyPopoverOptions]=\"expandPopoverOptions\"\n class=\"py-0\"\n thePreventDefault\n [thyPanelClass]=\"subPanelClass\"\n (click)=\"handleItemSelection(item)\"\n >\n <div *ngIf=\"item.menuIcon\" class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n <div *ngIf=\"item.children?.length > 0\">\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n <thy-dropdown-menu #expand>\n <div class=\"the-plugin-menu-container expand-menu\" theListboxGroup>\n <ng-container *ngFor=\"let child of item.children\">\n <div\n *ngIf=\"child.type === ThePluginMenuItemType.group\"\n thyDropdownMenuItem\n theListboxOption\n class=\"py-0\"\n thePreventDefault\n [theOptionDisabled]=\"item.disabled\"\n [thyDisabled]=\"child.disabled\"\n (click)=\"handleItemSelection(child)\"\n [theOptionValue]=\"child\"\n >\n <div *ngIf=\"child.menuIcon\" class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"child.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ child.name }}\n </div>\n </div>\n </div>\n <thy-divider *ngIf=\"child === 'divider'\" class=\"my-2\"></thy-divider>\n </ng-container>\n </div>\n </thy-dropdown-menu>\n </div>\n </ng-container>\n <ng-container *ngIf=\"item.isMenuItem && item.key === 'table'\">\n <div\n #dropdownTriggers\n [thyPopover]=\"tableSelect\"\n thyPlacement=\"rightTop\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n theListboxOption\n [thyConfig]=\"tableSelectPopoverConfig\"\n [theOptionValue]=\"item\"\n [theOptionDisabled]=\"item.disabled\"\n [thyDisabled]=\"item.disabled\"\n class=\"py-0\"\n thePreventDefault\n (click)=\"handleItemSelection(item)\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n <div>\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n\n <ng-template #tableSelect>\n <table-select\n class=\"plugin-menu-table the-table-selector-panel\"\n [editor]=\"editor\"\n [beforeInsert]=\"removeKeywords\"\n ></table-select>\n </ng-template>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!item.isMenuItem\" #menuGroup>\n <thy-dropdown-menu-group class=\"font-size-sm\" [thyTitle]=\"item.groupName\"></thy-dropdown-menu-group>\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<ng-template #thyEmpty>\n <div class=\"empty d-flex align-items-center justify-content-center\">\n <thy-empty [thyMessage]=\"thyMessage\"></thy-empty>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i6$1.ThyInputSearchComponent, selector: "thy-input-search", inputs: ["name", "placeholder", "thyTheme", "thySearchFocus", "thyIconPosition", "thySize"], outputs: ["clear", "thyClear"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i8$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "directive", type: i6.ThyDropdownDirective, selector: "[thyDropdown]", inputs: ["thyDropdownMenu", "thyDropdown", "thyTrigger", "thyShowDelay", "thyHideDelay", "thyActiveClass", "thyPopoverOptions", "thyPlacement", "thyMenuInsideClosable", "thyPanelClass"], outputs: ["thyActiveChange"] }, { kind: "component", type: i6.ThyDropdownMenuComponent, selector: "thy-dropdown-menu", inputs: ["thyWidth", "thyImmediateRender"] }, { kind: "component", type: i6.ThyDropdownMenuGroupComponent, selector: "thy-dropdown-menu-group", inputs: ["thyTitle"] }, { kind: "directive", type: i6.ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }, { kind: "component", type: i10.ThyEmptyComponent, selector: "thy-empty", inputs: ["thyMessage", "thyTranslationKey", "thyTranslationValues", "thyEntityName", "thyEntityNameTranslateKey", "thyIconName", "thySize", "thyMarginTop", "thyTopAuto", "thyContainer", "thyImageUrl", "thyImageLoading", "thyImageFetchPriority", "thyDescription"] }, { kind: "directive", type: i1$1.ThyPopoverDirective, selector: "[thyPopover]", inputs: ["thyPopover", "thyTrigger", "thyPlacement", "thyOffset", "thyConfig", "thyShowDelay", "thyHideDelay", "thyAutoAdaptive", "thyDisabled"] }, { kind: "component", type: TheTableSelectComponent, selector: "table-select", inputs: ["optionsParam", "editor", "beforeInsert"] }, { kind: "directive", type: TheListboxOptionDirective, selector: "[theListboxOption]", inputs: ["theOptionValue", "theOptionDisabled"], exportAs: ["theListboxOption"] }, { kind: "directive", type: TheListboxGroupDirective, selector: "[theListboxGroup]", inputs: ["horizontalColumn"], exportAs: ["theListboxGroup"] }, { kind: "directive", type: TheListboxDirective, selector: "[theListBox]", inputs: ["keyboardContainer", "autoActiveFirstItem"], outputs: ["theListboxChange"], exportAs: ["theListBox"] }, { kind: "directive", type: ThePreventDefaultDirective, selector: "[thePreventDefault]", exportAs: ["thePreventDefault"] }, { kind: "pipe", type: PluginMenuPipe, name: "getMenuIcon" }] }); }
|
|
6069
6085
|
}
|
|
6070
6086
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ThePluginMenuComponent, decorators: [{
|
|
6071
6087
|
type: Component,
|
|
6072
|
-
args: [{ selector: 'the-plugin-menu', template: "<div *ngIf=\"theDisplaySearch\" class=\"menu-search px-5 pt-5 pb-2\">\n <thy-input-search [(ngModel)]=\"keyWords\" placeholder=\"\u641C\u7D22\" thyIconPosition=\"after\" (ngModelChange)=\"updateKeywords(keyWords)\">\n </thy-input-search>\n</div>\n\n<div\n *ngIf=\"groupMenu.length > 0; else thyEmpty\"\n theListBox\n [keyboardContainer]=\"keyboardContainer\"\n [autoActiveFirstItem]=\"
|
|
6088
|
+
args: [{ selector: 'the-plugin-menu', template: "<div *ngIf=\"theDisplaySearch\" class=\"menu-search px-5 pt-5 pb-2\">\n <thy-input-search [(ngModel)]=\"keyWords\" placeholder=\"\u641C\u7D22\" thyIconPosition=\"after\" (ngModelChange)=\"updateKeywords(keyWords)\">\n </thy-input-search>\n</div>\n\n<div\n *ngIf=\"groupMenu.length > 0; else thyEmpty\"\n theListBox\n [keyboardContainer]=\"keyboardContainer\"\n [autoActiveFirstItem]=\"listBoxAutoActiveFirstItem\"\n (theListboxChange)=\"theListboxChange($event)\"\n class=\"thy-dropdown-menu the-plugin-menu-scroll-container pb-2 pt-0\"\n>\n <div *ngIf=\"iconMenu?.length > 0\" theListboxGroup [horizontalColumn]=\"6\" class=\"icon-menu d-flex pl-5 py-1\">\n <ng-container *ngFor=\"let item of iconMenu; trackBy: trackByFn\">\n <a\n *ngIf=\"item.type === ThePluginMenuItemType.icon\"\n href=\"javascript:;\"\n class=\"mt-2\"\n thyAction\n theListboxOption\n [theOptionValue]=\"item\"\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item?.name\"\n [thyDisabled]=\"item.disabled\"\n [theOptionDisabled]=\"item.disabled\"\n thePreventDefault\n (click)=\"handleItemSelection(item)\"\n ></a>\n </ng-container>\n </div>\n\n <thy-divider *ngIf=\"this.iconMenu?.length\" class=\"my-2\"></thy-divider>\n <div theListboxGroup>\n <ng-container *ngFor=\"let item of groupMenu; trackBy: trackByFn\">\n <ng-container *ngIf=\"item.isMenuItem && !(item.children?.length > 0) && item.key !== 'table'\">\n <div\n thyDropdownMenuItem\n theListboxOption\n [theOptionValue]=\"item\"\n class=\"py-0\"\n thePreventDefault\n [thyDisabled]=\"item.disabled\"\n [theOptionDisabled]=\"item.disabled\"\n (click)=\"handleItemSelection(item)\"\n >\n <div *ngIf=\"item.menuIcon\" class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"item.isMenuItem && item.children?.length > 0\" #hasExpanded>\n <div\n #dropdownTriggers\n [thyDropdown]=\"expand\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n [thyDisabled]=\"item.disabled\"\n theListboxOption\n [theOptionValue]=\"item\"\n [theOptionDisabled]=\"item.disabled\"\n [thyPopoverOptions]=\"expandPopoverOptions\"\n class=\"py-0\"\n thePreventDefault\n [thyPanelClass]=\"subPanelClass\"\n (click)=\"handleItemSelection(item)\"\n >\n <div *ngIf=\"item.menuIcon\" class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n <div *ngIf=\"item.children?.length > 0\">\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n <thy-dropdown-menu #expand>\n <div class=\"the-plugin-menu-container expand-menu\" theListboxGroup>\n <ng-container *ngFor=\"let child of item.children\">\n <div\n *ngIf=\"child.type === ThePluginMenuItemType.group\"\n thyDropdownMenuItem\n theListboxOption\n class=\"py-0\"\n thePreventDefault\n [theOptionDisabled]=\"item.disabled\"\n [thyDisabled]=\"child.disabled\"\n (click)=\"handleItemSelection(child)\"\n [theOptionValue]=\"child\"\n >\n <div *ngIf=\"child.menuIcon\" class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"child.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ child.name }}\n </div>\n </div>\n </div>\n <thy-divider *ngIf=\"child === 'divider'\" class=\"my-2\"></thy-divider>\n </ng-container>\n </div>\n </thy-dropdown-menu>\n </div>\n </ng-container>\n <ng-container *ngIf=\"item.isMenuItem && item.key === 'table'\">\n <div\n #dropdownTriggers\n [thyPopover]=\"tableSelect\"\n thyPlacement=\"rightTop\"\n thyTrigger=\"hover\"\n thyDropdownMenuItem\n theListboxOption\n [thyConfig]=\"tableSelectPopoverConfig\"\n [theOptionValue]=\"item\"\n [theOptionDisabled]=\"item.disabled\"\n [thyDisabled]=\"item.disabled\"\n class=\"py-0\"\n thePreventDefault\n (click)=\"handleItemSelection(item)\"\n >\n <div class=\"menu-icon mr-2\">\n <thy-icon [thyIconName]=\"item.menuIcon | getMenuIcon: sceneKey\"></thy-icon>\n </div>\n <div class=\"menu-content d-flex align-items-center\">\n <div class=\"menu-item-title w-100\">\n {{ item.name }}\n </div>\n </div>\n <div>\n <thy-icon class=\"text-muted\" thyIconName=\"angle-right\"></thy-icon>\n </div>\n\n <ng-template #tableSelect>\n <table-select\n class=\"plugin-menu-table the-table-selector-panel\"\n [editor]=\"editor\"\n [beforeInsert]=\"removeKeywords\"\n ></table-select>\n </ng-template>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!item.isMenuItem\" #menuGroup>\n <thy-dropdown-menu-group class=\"font-size-sm\" [thyTitle]=\"item.groupName\"></thy-dropdown-menu-group>\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<ng-template #thyEmpty>\n <div class=\"empty d-flex align-items-center justify-content-center\">\n <thy-empty [thyMessage]=\"thyMessage\"></thy-empty>\n </div>\n</ng-template>\n" }]
|
|
6073
6089
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.ThyPopoverRef }]; }, propDecorators: { dropdownTriggers: [{
|
|
6074
6090
|
type: ViewChildren,
|
|
6075
6091
|
args: ['dropdownTriggers', { read: ThyDropdownDirective }]
|
|
@@ -6082,6 +6098,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
|
6082
6098
|
type: Input
|
|
6083
6099
|
}], thePluginMenu: [{
|
|
6084
6100
|
type: Input
|
|
6101
|
+
}], sceneKey: [{
|
|
6102
|
+
type: Input
|
|
6103
|
+
}], subPanelClass: [{
|
|
6104
|
+
type: Input
|
|
6105
|
+
}], autoActiveFirstItem: [{
|
|
6106
|
+
type: Input
|
|
6085
6107
|
}] } });
|
|
6086
6108
|
|
|
6087
6109
|
const QuickInsertEditor = {
|
|
@@ -6332,12 +6354,12 @@ const InlineCodeEditor = {
|
|
|
6332
6354
|
}
|
|
6333
6355
|
},
|
|
6334
6356
|
unwrapInlineCode(editor) {
|
|
6335
|
-
Transforms.unwrapNodes(editor, { match:
|
|
6357
|
+
Transforms.unwrapNodes(editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.inlineCode });
|
|
6336
6358
|
},
|
|
6337
6359
|
isInlineCodeActive(editor, path) {
|
|
6338
6360
|
const [inlineCode] = Editor.nodes(editor, {
|
|
6339
6361
|
at: path ? path : editor.selection?.anchor.path,
|
|
6340
|
-
match:
|
|
6362
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.inlineCode
|
|
6341
6363
|
});
|
|
6342
6364
|
return !!inlineCode;
|
|
6343
6365
|
}
|
|
@@ -6352,7 +6374,7 @@ function setCellIndent(editor, indentType, child, at) {
|
|
|
6352
6374
|
if (!Element$1.isElement(child) || !allowedTypes.includes(child.type)) {
|
|
6353
6375
|
return;
|
|
6354
6376
|
}
|
|
6355
|
-
const maxIndent = getPluginOptions(editor, PluginKeys.indent)?.maxIndent ??
|
|
6377
|
+
const maxIndent = getPluginOptions(editor, PluginKeys.indent)?.maxIndent ?? [];
|
|
6356
6378
|
let { indent } = child;
|
|
6357
6379
|
indent = indentType === Indents.indentRight ? (indent ? ++indent : 1) : indent ? --indent : 0;
|
|
6358
6380
|
if (indent <= maxIndent) {
|
|
@@ -6393,7 +6415,7 @@ const TableEditor = {
|
|
|
6393
6415
|
clearCell(opts, editor, nodeEntry);
|
|
6394
6416
|
},
|
|
6395
6417
|
isActive(editor) {
|
|
6396
|
-
const [table] = Editor.nodes(editor, { match:
|
|
6418
|
+
const [table] = Editor.nodes(editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.table });
|
|
6397
6419
|
return !!table;
|
|
6398
6420
|
},
|
|
6399
6421
|
getSelectedCells(editor) {
|
|
@@ -6526,7 +6548,7 @@ const TableEditor = {
|
|
|
6526
6548
|
},
|
|
6527
6549
|
hasHeaderRowCell(editor) {
|
|
6528
6550
|
const isHeaderRow = Editor.nodes(editor, {
|
|
6529
|
-
match:
|
|
6551
|
+
match: n => Element$1.isElement(n) &&
|
|
6530
6552
|
((n.type === ElementKinds.tableRow && n.header) || (n.type === ElementKinds.table && n.options?.headerRow))
|
|
6531
6553
|
});
|
|
6532
6554
|
const selectedCells = TableEditor.getSelectedCells(editor) ?? [];
|
|
@@ -6662,7 +6684,7 @@ const autoFormatBlock = (editor, type, at, { preFormat, format }, markups) => {
|
|
|
6662
6684
|
preFormat(editor);
|
|
6663
6685
|
}
|
|
6664
6686
|
if (!format) {
|
|
6665
|
-
Transforms.setNodes(editor, { type }, { match:
|
|
6687
|
+
Transforms.setNodes(editor, { type }, { match: n => Editor.isBlock(editor, n) });
|
|
6666
6688
|
}
|
|
6667
6689
|
else {
|
|
6668
6690
|
format(editor, markups);
|
|
@@ -7031,7 +7053,7 @@ const withBlockquote = (editor) => {
|
|
|
7031
7053
|
};
|
|
7032
7054
|
editor.deleteBackward = unit => {
|
|
7033
7055
|
const aboveResult = Editor.above(editor, {
|
|
7034
|
-
match:
|
|
7056
|
+
match: n => Editor.isBlock(editor, n) && n.type === ElementKinds.blockquote
|
|
7035
7057
|
});
|
|
7036
7058
|
if (!aboveResult) {
|
|
7037
7059
|
return deleteBackward(unit);
|
|
@@ -7053,7 +7075,7 @@ const withBlockquote = (editor) => {
|
|
|
7053
7075
|
return;
|
|
7054
7076
|
}
|
|
7055
7077
|
const voidEntry = Editor.above(editor, {
|
|
7056
|
-
match:
|
|
7078
|
+
match: n => Editor.isBlock(editor, n) && Editor.isVoid(editor, n)
|
|
7057
7079
|
});
|
|
7058
7080
|
if (voidEntry && voidEntry[0]) {
|
|
7059
7081
|
Transforms.insertNodes(editor, createEmptyParagraph());
|
|
@@ -7851,7 +7873,7 @@ const createTheHistoryPlugin = createPluginFactory({
|
|
|
7851
7873
|
const isInline = (editor, path) => {
|
|
7852
7874
|
const [inlineNode] = Editor.nodes(editor, {
|
|
7853
7875
|
at: path ? path : editor.selection?.anchor.path,
|
|
7854
|
-
match:
|
|
7876
|
+
match: n => Element$1.isElement(n) && Editor.isInline(editor, n) && !Editor.isVoid(editor, n)
|
|
7855
7877
|
});
|
|
7856
7878
|
return !!inlineNode;
|
|
7857
7879
|
};
|
|
@@ -8108,7 +8130,7 @@ const withDeserializeHTML = (editor) => {
|
|
|
8108
8130
|
const htmlDom = new DOMParser().parseFromString(html, 'text/html');
|
|
8109
8131
|
const fragment = TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
8110
8132
|
// 无法识别HTML内容时后退一下:识别纯文本
|
|
8111
|
-
if (fragment.every(
|
|
8133
|
+
if (fragment.every(block => block.type === ElementKinds.paragraph && isLogicEmptyParagraphElement(editor, block))) {
|
|
8112
8134
|
insertData(data);
|
|
8113
8135
|
return;
|
|
8114
8136
|
}
|
|
@@ -8119,7 +8141,7 @@ const withDeserializeHTML = (editor) => {
|
|
|
8119
8141
|
return;
|
|
8120
8142
|
}
|
|
8121
8143
|
// 过滤 text 节点的 color/background-color 属性
|
|
8122
|
-
fragment.forEach(
|
|
8144
|
+
fragment.forEach(node => filterTextFormat(node));
|
|
8123
8145
|
// base 64 图片处理
|
|
8124
8146
|
recursionNodes(fragment, (node) => {
|
|
8125
8147
|
const isImage = Element$1.isElement(node) && node.type === ElementKinds.image;
|
|
@@ -8272,7 +8294,7 @@ const createDeserializeMdPlugin = createPluginFactory({
|
|
|
8272
8294
|
withOverrides: withDeserializeMd
|
|
8273
8295
|
});
|
|
8274
8296
|
const isUnformatted = (elements) => {
|
|
8275
|
-
return elements.every(
|
|
8297
|
+
return elements.every(element => element.type === ElementKinds.default &&
|
|
8276
8298
|
element.children.every((node) => {
|
|
8277
8299
|
return Text.isText(node) && Object.keys(node).length === 1;
|
|
8278
8300
|
}));
|
|
@@ -8640,6 +8662,7 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
8640
8662
|
this.percentage = 0;
|
|
8641
8663
|
this.layoutDefaultWidth = 368;
|
|
8642
8664
|
this.disablePreview = false;
|
|
8665
|
+
this.loadImageError = false;
|
|
8643
8666
|
this.layoutOptions = [
|
|
8644
8667
|
{
|
|
8645
8668
|
key: Alignment.left,
|
|
@@ -8693,7 +8716,8 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
8693
8716
|
originUrl = `${baseUrl}${slice}${originUrl.slice(originUrl.indexOf(slice) + slice.length, originUrl.length)}`;
|
|
8694
8717
|
}
|
|
8695
8718
|
this.imageEntry = {
|
|
8696
|
-
name: value.element.name,
|
|
8719
|
+
// name: value.element.name,
|
|
8720
|
+
name: undefined,
|
|
8697
8721
|
width: value.element.width,
|
|
8698
8722
|
height: value.element.height,
|
|
8699
8723
|
thumbUrl,
|
|
@@ -8813,6 +8837,9 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
8813
8837
|
this.setImageNodes(imageInfo);
|
|
8814
8838
|
}
|
|
8815
8839
|
startDrag(event, axis) {
|
|
8840
|
+
if (this.imageError || !this.img) {
|
|
8841
|
+
return;
|
|
8842
|
+
}
|
|
8816
8843
|
event.preventDefault();
|
|
8817
8844
|
this.dragable = true;
|
|
8818
8845
|
const imgElement = this.img.nativeElement;
|
|
@@ -8912,6 +8939,9 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
8912
8939
|
(this?.readonly || !this.isCollapsedAndNonReadonly || !isGlobalCollapsed(this.editor) || this.uploading));
|
|
8913
8940
|
}
|
|
8914
8941
|
openLayoutToolbar() {
|
|
8942
|
+
if (!this.img) {
|
|
8943
|
+
return;
|
|
8944
|
+
}
|
|
8915
8945
|
this.layoutToolbarRef = this.thyPopover.open(this.layoutToolbar, {
|
|
8916
8946
|
origin: this.imageContent,
|
|
8917
8947
|
panelClass: 'the-plugin-toolbar-popover',
|
|
@@ -8979,17 +9009,28 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
8979
9009
|
this.naturalWidth = img.naturalWidth;
|
|
8980
9010
|
this.naturalHeight = img.naturalHeight;
|
|
8981
9011
|
}
|
|
9012
|
+
imageError(event) {
|
|
9013
|
+
const img = event.target;
|
|
9014
|
+
const errorImageUrl = this.imagePluginOptions?.errorImageUrl;
|
|
9015
|
+
if (errorImageUrl) {
|
|
9016
|
+
const url = typeof errorImageUrl === 'function' ? errorImageUrl(this.editor) : errorImageUrl;
|
|
9017
|
+
this.disablePreview = true;
|
|
9018
|
+
this.imageContent.nativeElement.classList.add('the-image-error');
|
|
9019
|
+
img.src = url;
|
|
9020
|
+
}
|
|
9021
|
+
img.onerror = null;
|
|
9022
|
+
}
|
|
8982
9023
|
// 组件库 dialog 弹出时,会记录当前的焦点。阻止 mousedown 默认行为,使得图片原本的 click 事件能获取到正确的焦点。
|
|
8983
9024
|
preventDefault(event) {
|
|
8984
9025
|
event.preventDefault();
|
|
8985
9026
|
event.stopPropagation();
|
|
8986
9027
|
}
|
|
8987
9028
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: TheImageComponent, deps: [{ token: i0.ElementRef }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0.ChangeDetectorRef }, { token: TheContextService }, { token: i1$1.ThyPopover }, { token: i2$1.Overlay }, { token: i0.ViewContainerRef }, { token: i4$1.ThyImageGroupComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8988
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }, { propertyName: "imageDirective", first: true, predicate: ThyImageDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.pointer]=\"!selection\">\n <img\n #img\n thyImage\n
|
|
9029
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }, { propertyName: "imageDirective", first: true, predicate: ThyImageDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.cursor-pointer]=\"!selection\">\n <img\n #img\n thyImage\n class=\"main-image\"\n [class.image-collapsed]=\"selection && !uploading\"\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [alt]=\"imageEntry.name\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyDisablePreview]=\"disablePreview\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n (error)=\"imageError($event)\"\n (click)=\"imageClick($event)\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <ng-container *ngIf=\"!imageError\">\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </ng-container>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"> </thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading cursor-pointer\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "component", type: i4.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i9$1.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips", "thyShape", "thyGapDegree", "thyGapPosition", "thyStrokeWidth"] }, { kind: "directive", type: i4$1.ThyImageDirective, selector: "img[thyImage]", inputs: ["thySrc", "thyPreviewSrc", "thyOriginSrc", "thyImageMeta", "thyDisablePreview", "thyResolveSize"], exportAs: ["thyImage"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i7.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i8$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }] }); }
|
|
8989
9030
|
}
|
|
8990
9031
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: TheImageComponent, decorators: [{
|
|
8991
9032
|
type: Component,
|
|
8992
|
-
args: [{ selector: 'the-image, [theImage]', template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.pointer]=\"!selection\">\n <img\n #img\n thyImage\n
|
|
9033
|
+
args: [{ selector: 'the-image, [theImage]', template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.cursor-pointer]=\"!selection\">\n <img\n #img\n thyImage\n class=\"main-image\"\n [class.image-collapsed]=\"selection && !uploading\"\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [alt]=\"imageEntry.name\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyDisablePreview]=\"disablePreview\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n (error)=\"imageError($event)\"\n (click)=\"imageClick($event)\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <ng-container *ngIf=\"!imageError\">\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </ng-container>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"> </thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading cursor-pointer\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n" }]
|
|
8993
9034
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
8994
9035
|
type: Inject,
|
|
8995
9036
|
args: [THE_UPLOAD_SERVICE_TOKEN]
|
|
@@ -9077,7 +9118,7 @@ const onKeydownTextIndent = (editor, event, kinds, textIndentDisabled) => {
|
|
|
9077
9118
|
const isExpanded = Range.isExpanded(selection);
|
|
9078
9119
|
const nodes = Array.from(Editor.nodes(editor, {
|
|
9079
9120
|
mode: 'highest',
|
|
9080
|
-
match:
|
|
9121
|
+
match: node => Element$1.isElement(node) && kinds.includes(node.type)
|
|
9081
9122
|
}));
|
|
9082
9123
|
const [startBlock] = nodes;
|
|
9083
9124
|
if (!startBlock) {
|
|
@@ -9464,7 +9505,7 @@ class TheBaseLinkComponent extends TheBaseElementComponent {
|
|
|
9464
9505
|
this.openLinkEdit(LinkTags.edit);
|
|
9465
9506
|
},
|
|
9466
9507
|
deleteHandle: () => {
|
|
9467
|
-
Transforms.unwrapNodes(this.editor, { match:
|
|
9508
|
+
Transforms.unwrapNodes(this.editor, { match: n => Element$1.isElement(n) && n.type === ElementKinds.link });
|
|
9468
9509
|
this.closeHoverPopover();
|
|
9469
9510
|
}
|
|
9470
9511
|
},
|
|
@@ -9844,7 +9885,7 @@ const moveListItemUp = (editor, { list, listItem }, options) => {
|
|
|
9844
9885
|
}
|
|
9845
9886
|
});
|
|
9846
9887
|
// 处理listItem下方有段落的情况
|
|
9847
|
-
const listIndex = listParentNode.children.findIndex(
|
|
9888
|
+
const listIndex = listParentNode.children.findIndex(item => item.key === listNode.key);
|
|
9848
9889
|
const behindNode = listParentNode.children.slice(listIndex + 1);
|
|
9849
9890
|
if (behindNode.length > 0) {
|
|
9850
9891
|
const nextPath = Path.next(newListItemPath);
|
|
@@ -9858,7 +9899,7 @@ const moveListItemUp = (editor, { list, listItem }, options) => {
|
|
|
9858
9899
|
Transforms.moveNodes(editor, {
|
|
9859
9900
|
at: moveRange,
|
|
9860
9901
|
to: nextPath.concat(0),
|
|
9861
|
-
match:
|
|
9902
|
+
match: node => behindNode.includes(node)
|
|
9862
9903
|
});
|
|
9863
9904
|
}
|
|
9864
9905
|
// 删除子列表(如果它是第一个列表项)
|
|
@@ -9916,8 +9957,8 @@ const insertListItem = (editor) => {
|
|
|
9916
9957
|
Transforms.splitNodes(editor, {
|
|
9917
9958
|
always: true,
|
|
9918
9959
|
mode: 'highest',
|
|
9919
|
-
match:
|
|
9920
|
-
const path =
|
|
9960
|
+
match: node => {
|
|
9961
|
+
const path = node && TheEditor.findPath(editor, node);
|
|
9921
9962
|
return path && path.length === nextListItemPath.length;
|
|
9922
9963
|
}
|
|
9923
9964
|
});
|
|
@@ -9930,8 +9971,9 @@ const insertListItem = (editor) => {
|
|
|
9930
9971
|
Transforms.moveNodes(editor, {
|
|
9931
9972
|
at: Editor.range(editor, nextNodePath, nextEnd),
|
|
9932
9973
|
to: nextListItemPath.concat(1),
|
|
9933
|
-
match:
|
|
9934
|
-
|
|
9974
|
+
match: node => {
|
|
9975
|
+
// TODO: types
|
|
9976
|
+
return listItemNode.children.includes(node);
|
|
9935
9977
|
}
|
|
9936
9978
|
});
|
|
9937
9979
|
}
|
|
@@ -10518,7 +10560,7 @@ const withList = (editor) => {
|
|
|
10518
10560
|
const text = data.getData('text/plain');
|
|
10519
10561
|
const fragment = extractFragment(data);
|
|
10520
10562
|
const aboveEntry = Editor.above(editor, {
|
|
10521
|
-
match:
|
|
10563
|
+
match: n => Editor.isBlock(editor, n) && n.type === ElementKinds.listItem
|
|
10522
10564
|
});
|
|
10523
10565
|
if (fragment) {
|
|
10524
10566
|
const res = getListItemEntry(editor, {});
|
|
@@ -11378,7 +11420,7 @@ function mergeCellContent(editor, leftTopCellPath, cellPath) {
|
|
|
11378
11420
|
Transforms.moveNodes(editor, {
|
|
11379
11421
|
at: endRange,
|
|
11380
11422
|
to: nextPath,
|
|
11381
|
-
match:
|
|
11423
|
+
match: node => {
|
|
11382
11424
|
if (Element$1.isElement(node) && node.type === ElementKinds.tableCell) {
|
|
11383
11425
|
tableCell = node;
|
|
11384
11426
|
}
|
|
@@ -14995,7 +15037,7 @@ const withTable = (editor) => {
|
|
|
14995
15037
|
}
|
|
14996
15038
|
const { selection } = editor;
|
|
14997
15039
|
const [, startBlockPath] = Editor.above(editor, {
|
|
14998
|
-
match:
|
|
15040
|
+
match: n => Editor.isBlock(editor, n)
|
|
14999
15041
|
});
|
|
15000
15042
|
const startPosition = createTablePosition(editor);
|
|
15001
15043
|
if (startBlockPath.length <= startPosition.cellEntry[1].length + 1 &&
|
|
@@ -15288,7 +15330,7 @@ const withTable = (editor) => {
|
|
|
15288
15330
|
setTimeout(() => {
|
|
15289
15331
|
Editor.withoutNormalizing(editor, () => {
|
|
15290
15332
|
const [, currentPath] = findNode(editor, {
|
|
15291
|
-
match:
|
|
15333
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.table
|
|
15292
15334
|
});
|
|
15293
15335
|
const nextPath = Path.next(currentPath);
|
|
15294
15336
|
const hasNextNode = Node.has(editor, nextPath);
|
|
@@ -15560,7 +15602,7 @@ const withTodoItem = (editor) => {
|
|
|
15560
15602
|
const { selection } = editor;
|
|
15561
15603
|
if (selection && Range.isCollapsed(selection)) {
|
|
15562
15604
|
const [match] = Editor.nodes(editor, {
|
|
15563
|
-
match:
|
|
15605
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.checkItem
|
|
15564
15606
|
});
|
|
15565
15607
|
if (match) {
|
|
15566
15608
|
const [, path] = match;
|
|
@@ -15570,7 +15612,7 @@ const withTodoItem = (editor) => {
|
|
|
15570
15612
|
type: ElementKinds.default,
|
|
15571
15613
|
checked: undefined
|
|
15572
15614
|
}, {
|
|
15573
|
-
match:
|
|
15615
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.checkItem
|
|
15574
15616
|
});
|
|
15575
15617
|
return;
|
|
15576
15618
|
}
|
|
@@ -15586,13 +15628,13 @@ const withTodoItem = (editor) => {
|
|
|
15586
15628
|
const { selection } = editor;
|
|
15587
15629
|
if (selection && Range.isCollapsed(selection)) {
|
|
15588
15630
|
const [match] = Editor.nodes(editor, {
|
|
15589
|
-
match:
|
|
15631
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.checkItem
|
|
15590
15632
|
});
|
|
15591
15633
|
if (match) {
|
|
15592
15634
|
const [, path] = match;
|
|
15593
15635
|
if (Editor.isStart(editor, selection.anchor, path)) {
|
|
15594
15636
|
Transforms.setNodes(editor, { type: ElementKinds.default, checked: undefined }, {
|
|
15595
|
-
match:
|
|
15637
|
+
match: n => Element$1.isElement(n) && n.type === ElementKinds.checkItem
|
|
15596
15638
|
});
|
|
15597
15639
|
return;
|
|
15598
15640
|
}
|
|
@@ -16460,10 +16502,10 @@ const PLUGIN_COMPONENTS = [
|
|
|
16460
16502
|
TheTdComponent,
|
|
16461
16503
|
TheInlineCodeComponent
|
|
16462
16504
|
];
|
|
16463
|
-
const PIPES = [ElementStylePipe, ElementClassPipe, TableFreezeColumnPipe, TableFreezeRowPipe];
|
|
16505
|
+
const PIPES = [ElementStylePipe, ElementClassPipe, TableFreezeColumnPipe, TableFreezeRowPipe, PluginMenuPipe];
|
|
16464
16506
|
class TheEditorModule {
|
|
16465
16507
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: TheEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
16466
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: TheEditorModule, declarations: [TheEditorComponent, ElementStylePipe, ElementClassPipe, TableFreezeColumnPipe, TableFreezeRowPipe, TheToolbarComponent,
|
|
16508
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: TheEditorModule, declarations: [TheEditorComponent, ElementStylePipe, ElementClassPipe, TableFreezeColumnPipe, TableFreezeRowPipe, PluginMenuPipe, TheToolbarComponent,
|
|
16467
16509
|
TheToolbarDropdownComponent,
|
|
16468
16510
|
TheToolbarGroupComponent,
|
|
16469
16511
|
TheToolbarItemComponent,
|
|
@@ -16613,12 +16655,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
|
16613
16655
|
type: Injectable
|
|
16614
16656
|
}] });
|
|
16615
16657
|
|
|
16616
|
-
const withEditor = (plugins = []) => {
|
|
16617
|
-
return withTheia(withHistory(withAngular(createEditor())), plugins);
|
|
16618
|
-
};
|
|
16619
|
-
|
|
16620
16658
|
const withTestPlugin = (plugins, initValue) => {
|
|
16621
|
-
let editor =
|
|
16659
|
+
let editor = withTheia(withHistory(withAngular(createEditor())), plugins);
|
|
16622
16660
|
editor.children = initValue || [createEmptyParagraph()];
|
|
16623
16661
|
return editor;
|
|
16624
16662
|
};
|
|
@@ -16631,5 +16669,5 @@ const withTestPlugin = (plugins, initValue) => {
|
|
|
16631
16669
|
* Generated bundle index. Do not edit.
|
|
16632
16670
|
*/
|
|
16633
16671
|
|
|
16634
|
-
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, ColumnResizeNotifierSource, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DISABLED_OPERATE_TYPES, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultPluginMenu, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HoveredCellInfo, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, InlineCodeEditor, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, MentionEditor, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, PluginKeys, PluginMenuIcons, PluginMenuSvgs, Position, QuickInsertEditor, STANDARD_HEADING_TYPES, ScrollDirection, SpecialBackgroundColor, TAB_SPACE, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_ORIGIN_ANCHOR, THE_EDITOR_POPOVER_REF, THE_EDITOR_PREVIOUS_SELECTION, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_LISTBOX_PARENT_GROUP_TOKEN, THE_LISTBOX_PARENT_OPTION_TOKEN, THE_LISTBOX_TOKEN, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_PLUGIN_MENU_REF, THE_UPLOAD_SERVICE_TOKEN, TableCellEventDispatcher, TableEditor, TableHeaderBackgroundColor, TheBaseElementComponent, TheBaseSuggestion, TheBaseToolbarDropdown, TheBaseToolbarItem, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheListboxDirective, TheListboxGroupDirective, TheListboxOptionDirective, TheMode, TheModeConfig, ThePluginMenu, ThePluginMenuComponent, ThePluginMenuItemType, ThePreventDefaultDirective, index$1 as TheQueries, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, autoFocus, base64toBlob, buildPluginMenu, buildPluginMenuItemMap, coercePixelsFromCssValue, combinePlugins, copyNode, copyNodeForSafari, createEmptyParagraph, createMentionPlugin,
|
|
16672
|
+
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETE_BACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, ColorEditor, ColumnResizeNotifierSource, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DISABLED_OPERATE_TYPES, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultPluginMenu, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HoveredCellInfo, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, InlineCodeEditor, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, MentionEditor, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, PluginKeys, PluginMenuIcons, PluginMenuSvgs, Position, QuickInsertEditor, STANDARD_HEADING_TYPES, ScrollDirection, SpecialBackgroundColor, TAB_SPACE, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_ORIGIN_ANCHOR, THE_EDITOR_POPOVER_REF, THE_EDITOR_PREVIOUS_SELECTION, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_LISTBOX_PARENT_GROUP_TOKEN, THE_LISTBOX_PARENT_OPTION_TOKEN, THE_LISTBOX_TOKEN, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_PLUGIN_MENU_REF, THE_UPLOAD_SERVICE_TOKEN, TableCellEventDispatcher, TableEditor, TableHeaderBackgroundColor, TheBaseElementComponent, TheBaseSuggestion, TheBaseToolbarDropdown, TheBaseToolbarItem, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheListboxDirective, TheListboxGroupDirective, TheListboxOptionDirective, TheMode, TheModeConfig, ThePluginMenu, ThePluginMenuComponent, ThePluginMenuItemType, ThePreventDefaultDirective, index$1 as TheQueries, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, autoFocus, base64toBlob, buildPluginMenu, buildPluginMenuItemMap, coercePixelsFromCssValue, combinePlugins, copyNode, copyNodeForSafari, createEmptyParagraph, createMentionPlugin, createPluginFactory, createToolbar, createVerticalAlignPlugin, dataDeserialize, dataSerializing, deleteElementKey, extractFragment, filterTextFormat, flattenDeepPlugins, getColsTotalWidth, getEditorUUID, getElementClassByPrefix, getElementHeight, getElementWidth, getEndBlock, getPlugin, getPluginOptions, getPlugins, getRowsTotalHeight, getStartBlock, getToolbarClass, headingOptions, htmlToTheia, idCreator, inValidTypes, initializeDefaultMenuIcons, insertDataByInvalidType, internalPlugins, isCleanEmptyParagraph, isColorIndicator, isColorInput, isColorPanel, isDirectionKeydown, isPureEmptyParagraph, mergeArray, mergeDeepPlugins, mergeElementOptions, mergeOptions, nestedStructureByKey, plainToTheia, pluginsByKey, reSelection, recursionNodes, refocus, scrollIntoView, setEditorUUID, useElementStyle, withMention, withTestPlugin, withTheia };
|
|
16635
16673
|
//# sourceMappingURL=worktile-theia.mjs.map
|