@atlaskit/editor-core 187.8.3 → 187.8.10
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/CHANGELOG.md +15 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +4 -5
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/plugins/annotation/commands/transform.js +2 -2
- package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/cjs/plugins/block-type/commands/block-type.js +2 -2
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +4 -4
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -2
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +5 -5
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -2
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -2
- package/dist/cjs/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/list/actions/conversions.js +5 -5
- package/dist/cjs/plugins/list/actions/indent-list-items-selected.js +11 -11
- package/dist/cjs/plugins/list/actions/join-list-items-forward.js +6 -6
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +6 -7
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +3 -4
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +3 -4
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +2 -2
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +2 -2
- package/dist/cjs/plugins/list/actions/merge-lists.js +3 -3
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +11 -11
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +2 -2
- package/dist/cjs/plugins/list/commands/indent-list.js +6 -7
- package/dist/cjs/plugins/list/commands/index.js +8 -10
- package/dist/cjs/plugins/list/commands/join-list-item-forward.js +5 -5
- package/dist/cjs/plugins/list/commands/listBackspace.js +13 -14
- package/dist/cjs/plugins/list/commands/outdent-list.js +4 -3
- package/dist/cjs/plugins/list/pm-plugins/main.js +5 -6
- package/dist/cjs/plugins/list/utils/analytics.js +1 -35
- package/dist/cjs/plugins/list/utils/indentation.js +2 -20
- package/dist/cjs/plugins/list/utils/node.js +2 -106
- package/dist/cjs/plugins/list/utils/selection.js +3 -54
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +17 -18
- package/dist/cjs/plugins/text-color/commands/toggle-color.js +2 -2
- package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +9 -9
- package/dist/cjs/plugins/text-formatting/commands/transform-to-code.js +2 -2
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -5
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +2 -2
- package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +2 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +2 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +2 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +5 -6
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +5 -5
- package/dist/cjs/ui/Dropdown/index.js +1 -2
- package/dist/cjs/ui/styles.js +3 -5
- package/dist/cjs/utils/commands.js +3 -222
- package/dist/cjs/utils/document.js +1 -26
- package/dist/cjs/utils/index.js +0 -19
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -6
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/plugins/annotation/commands/transform.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/es2019/plugins/block-type/commands/block-type.js +1 -1
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -5
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
- package/dist/es2019/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/actions/conversions.js +2 -2
- package/dist/es2019/plugins/list/actions/indent-list-items-selected.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-forward.js +1 -1
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
- package/dist/es2019/plugins/list/actions/merge-lists.js +1 -1
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +3 -3
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +1 -1
- package/dist/es2019/plugins/list/commands/indent-list.js +3 -4
- package/dist/es2019/plugins/list/commands/index.js +4 -5
- package/dist/es2019/plugins/list/commands/join-list-item-forward.js +1 -1
- package/dist/es2019/plugins/list/commands/listBackspace.js +1 -2
- package/dist/es2019/plugins/list/commands/outdent-list.js +3 -2
- package/dist/es2019/plugins/list/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/utils/analytics.js +0 -36
- package/dist/es2019/plugins/list/utils/indentation.js +0 -18
- package/dist/es2019/plugins/list/utils/node.js +3 -89
- package/dist/es2019/plugins/list/utils/selection.js +1 -52
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/es2019/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +1 -1
- package/dist/es2019/plugins/text-formatting/commands/transform-to-code.js +1 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +6 -5
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +3 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/es2019/ui/Dropdown/index.js +1 -2
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/es2019/ui/styles.js +0 -5
- package/dist/es2019/utils/commands.js +2 -214
- package/dist/es2019/utils/document.js +1 -26
- package/dist/es2019/utils/index.js +1 -13
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +3 -6
- package/dist/esm/index.js +1 -1
- package/dist/esm/plugins/annotation/commands/transform.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -5
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
- package/dist/esm/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/actions/conversions.js +2 -2
- package/dist/esm/plugins/list/actions/indent-list-items-selected.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-forward.js +1 -1
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
- package/dist/esm/plugins/list/actions/merge-lists.js +1 -1
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +3 -3
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +1 -1
- package/dist/esm/plugins/list/commands/indent-list.js +3 -4
- package/dist/esm/plugins/list/commands/index.js +4 -5
- package/dist/esm/plugins/list/commands/join-list-item-forward.js +1 -1
- package/dist/esm/plugins/list/commands/listBackspace.js +1 -2
- package/dist/esm/plugins/list/commands/outdent-list.js +3 -2
- package/dist/esm/plugins/list/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/utils/analytics.js +0 -32
- package/dist/esm/plugins/list/utils/indentation.js +0 -17
- package/dist/esm/plugins/list/utils/node.js +3 -81
- package/dist/esm/plugins/list/utils/selection.js +3 -51
- package/dist/esm/plugins/tasks-and-decisions/commands.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/esm/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/esm/plugins/text-formatting/commands/text-formatting.js +1 -1
- package/dist/esm/plugins/text-formatting/commands/transform-to-code.js +1 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +4 -5
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/esm/ui/Dropdown/index.js +1 -2
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/esm/ui/styles.js +2 -3
- package/dist/esm/utils/commands.js +2 -211
- package/dist/esm/utils/document.js +1 -26
- package/dist/esm/utils/index.js +1 -13
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/block-type/commands/block-type.d.ts +1 -2
- package/dist/types/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
- package/dist/types/plugins/list/actions/join-list-items-forward.d.ts +1 -1
- package/dist/types/plugins/list/commands/indent-list.d.ts +2 -1
- package/dist/types/plugins/list/commands/index.d.ts +2 -1
- package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +1 -1
- package/dist/types/plugins/list/commands/listBackspace.d.ts +1 -1
- package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types/plugins/list/utils/analytics.d.ts +2 -4
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -5
- package/dist/types/plugins/list/utils/node.d.ts +2 -17
- package/dist/types/plugins/list/utils/selection.d.ts +1 -12
- package/dist/types/plugins/text-color/commands/toggle-color.d.ts +1 -1
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +4 -4
- package/dist/types/types/editor-instance.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +5 -8
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +2 -2
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +1 -1
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types/utils/commands.d.ts +3 -42
- package/dist/types/utils/document.d.ts +0 -4
- package/dist/types/utils/index.d.ts +1 -5
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +1 -2
- package/dist/types-ts4.5/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-forward.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/commands/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/utils/analytics.d.ts +2 -4
- package/dist/types-ts4.5/plugins/list/utils/indentation.d.ts +0 -5
- package/dist/types-ts4.5/plugins/list/utils/node.d.ts +2 -17
- package/dist/types-ts4.5/plugins/list/utils/selection.d.ts +1 -12
- package/dist/types-ts4.5/plugins/text-color/commands/toggle-color.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-appearance-component.d.ts +4 -4
- package/dist/types-ts4.5/types/editor-instance.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +5 -8
- package/dist/types-ts4.5/ui/Appearance/Comment/Comment.d.ts +2 -2
- package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +1 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types-ts4.5/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
- package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +1 -1
- package/dist/types-ts4.5/ui/styles.d.ts +0 -1
- package/dist/types-ts4.5/utils/commands.d.ts +3 -48
- package/dist/types-ts4.5/utils/document.d.ts +0 -4
- package/dist/types-ts4.5/utils/index.d.ts +1 -5
- package/package.json +3 -3
- package/report.api.md +2 -13
- package/tmp/api-report-tmp.d.ts +2 -10
- package/dist/cjs/plugins/list/utils/replace-content.js +0 -24
- package/dist/cjs/ui/Appearance/FullPage/messages.js +0 -25
- package/dist/cjs/ui/DropdownMenu/index.js +0 -31
- package/dist/cjs/ui/DropdownMenu/types.js +0 -5
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -218
- package/dist/cjs/utils/prosemirror/autojoin.js +0 -68
- package/dist/es2019/plugins/list/utils/replace-content.js +0 -18
- package/dist/es2019/ui/Appearance/FullPage/messages.js +0 -18
- package/dist/es2019/ui/DropdownMenu/index.js +0 -18
- package/dist/es2019/ui/DropdownMenu/types.js +0 -1
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
- package/dist/es2019/utils/prosemirror/autojoin.js +0 -57
- package/dist/esm/plugins/list/utils/replace-content.js +0 -17
- package/dist/esm/ui/Appearance/FullPage/messages.js +0 -18
- package/dist/esm/ui/DropdownMenu/index.js +0 -20
- package/dist/esm/ui/DropdownMenu/types.js +0 -1
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
- package/dist/esm/utils/prosemirror/autojoin.js +0 -63
- package/dist/types/plugins/list/utils/replace-content.d.ts +0 -8
- package/dist/types/ui/Appearance/FullPage/messages.d.ts +0 -18
- package/dist/types/ui/DropdownMenu/index.d.ts +0 -3
- package/dist/types/ui/DropdownMenu/types.d.ts +0 -1
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +0 -31
- package/dist/types/utils/prosemirror/autojoin.d.ts +0 -13
- package/dist/types-ts4.5/plugins/list/utils/replace-content.d.ts +0 -8
- package/dist/types-ts4.5/ui/Appearance/FullPage/messages.d.ts +0 -18
- package/dist/types-ts4.5/ui/DropdownMenu/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/DropdownMenu/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +0 -31
- package/dist/types-ts4.5/utils/prosemirror/autojoin.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.8.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d8c1bcdc71a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8c1bcdc71a) - ED-19217 decoupled lists related util functions from editor-core
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 187.8.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`22e9c894ca1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/22e9c894ca1) - update test for numbered column table
|
|
15
|
+
- [`3a1cd78b42a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a1cd78b42a) - [ED-19203] Moving some common logic, styles, and types to editor-common to make it easier to extract the text-formatting plugin from editor-core
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 187.8.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.ReactEditorView =
|
|
7
|
+
exports.ReactEditorView = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -35,12 +35,13 @@ var _document = require("../utils/document");
|
|
|
35
35
|
var _createSchema = require("./create-schema");
|
|
36
36
|
var _pluginPerformanceObserver = require("../utils/performance/plugin-performance-observer");
|
|
37
37
|
var _getParticipantsCount = require("../plugins/collab-edit/get-participants-count");
|
|
38
|
-
var _countNodes2 = require("../utils/count-nodes");
|
|
39
38
|
var _trackTransactions = require("../utils/performance/track-transactions");
|
|
39
|
+
var _countNodes2 = require("../utils/count-nodes");
|
|
40
40
|
var _consts = require("./consts");
|
|
41
41
|
var _contextIdentifier = require("../plugins/base/pm-plugins/context-identifier");
|
|
42
42
|
var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
|
|
43
43
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
44
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
44
45
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
45
46
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
46
47
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -82,8 +83,6 @@ function handleEditorFocus(view) {
|
|
|
82
83
|
view.focus();
|
|
83
84
|
}, 0);
|
|
84
85
|
}
|
|
85
|
-
var EDIT_AREA_ID = 'ak-editor-textarea';
|
|
86
|
-
exports.EDIT_AREA_ID = EDIT_AREA_ID;
|
|
87
86
|
var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
88
87
|
(0, _inherits2.default)(ReactEditorView, _React$Component);
|
|
89
88
|
var _super = _createSuper(ReactEditorView);
|
|
@@ -529,7 +528,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
529
528
|
,
|
|
530
529
|
"aria-multiline": _this.props.editorProps.appearance !== 'mobile' ? true : false,
|
|
531
530
|
role: "textbox",
|
|
532
|
-
id: EDIT_AREA_ID
|
|
531
|
+
id: _ui.EDIT_AREA_ID
|
|
533
532
|
});
|
|
534
533
|
});
|
|
535
534
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "editor", _this.createEditor(_this.props.editorProps.assistiveLabel));
|
package/dist/cjs/index.js
CHANGED
|
@@ -287,12 +287,6 @@ Object.defineProperty(exports, "getNodesCount", {
|
|
|
287
287
|
return _utils.getNodesCount;
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
|
-
Object.defineProperty(exports, "hasVisibleContent", {
|
|
291
|
-
enumerable: true,
|
|
292
|
-
get: function get() {
|
|
293
|
-
return _utils.hasVisibleContent;
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
290
|
Object.defineProperty(exports, "historyPluginKey", {
|
|
297
291
|
enumerable: true,
|
|
298
292
|
get: function get() {
|
|
@@ -9,7 +9,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _utils = require("../../analytics/utils");
|
|
11
11
|
var _utils2 = require("../utils");
|
|
12
|
-
var
|
|
12
|
+
var _mark = require("@atlaskit/editor-common/mark");
|
|
13
13
|
var addAnnotationMark = function addAnnotationMark(id) {
|
|
14
14
|
return function (transaction, state) {
|
|
15
15
|
var inlineCommentState = (0, _utils2.getPluginState)(state);
|
|
@@ -22,7 +22,7 @@ var addAnnotationMark = function addAnnotationMark(id) {
|
|
|
22
22
|
type: _adfSchema.AnnotationTypes.INLINE_COMMENT
|
|
23
23
|
});
|
|
24
24
|
// Apply the mark only to text node in the range.
|
|
25
|
-
var tr = (0,
|
|
25
|
+
var tr = (0, _mark.applyMarkOnRange)(from, to, false, annotationMark, transaction);
|
|
26
26
|
// set selection back to the end of annotation once annotation mark is applied
|
|
27
27
|
tr.setSelection(_state.TextSelection.create(tr.doc, head));
|
|
28
28
|
return tr;
|
|
@@ -27,7 +27,7 @@ var _default = function _default() {
|
|
|
27
27
|
key: newlinePreserveMarksKey,
|
|
28
28
|
props: {
|
|
29
29
|
handleKeyDown: (0, _keymap.keydownHandler)({
|
|
30
|
-
Enter: (0, _utils.
|
|
30
|
+
Enter: (0, _utils.filterCommand)([_utils2.isSelectionEndOfParagraph, isSelectionAligned], splitBlockPreservingMarks)
|
|
31
31
|
})
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -22,7 +22,7 @@ var _insert = require("@atlaskit/editor-common/insert");
|
|
|
22
22
|
var _analytics = require("../../analytics");
|
|
23
23
|
var _analytics2 = require("@atlaskit/editor-common/analytics");
|
|
24
24
|
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
25
|
-
var
|
|
25
|
+
var _mark2 = require("@atlaskit/editor-common/mark");
|
|
26
26
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
27
27
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
28
28
|
var _transformToCodeBlock = require("./transform-to-code-block");
|
|
@@ -78,7 +78,7 @@ function withCurrentHeadingLevel(fn) {
|
|
|
78
78
|
var _state$schema$nodes = state.schema.nodes,
|
|
79
79
|
heading = _state$schema$nodes.heading,
|
|
80
80
|
paragraph = _state$schema$nodes.paragraph;
|
|
81
|
-
var nodes = (0,
|
|
81
|
+
var nodes = (0, _mark2.filterChildrenBetween)(state.doc, state.selection.from, state.selection.to, function (node) {
|
|
82
82
|
return node.type === heading || node.type === paragraph;
|
|
83
83
|
});
|
|
84
84
|
|
|
@@ -12,13 +12,13 @@ var commands = _interopRequireWildcard(require("../../../commands"));
|
|
|
12
12
|
var blockTypes = _interopRequireWildcard(require("../types"));
|
|
13
13
|
var _keymap = require("../../../utils/keymap");
|
|
14
14
|
var _commands3 = require("../commands");
|
|
15
|
-
var
|
|
15
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
16
|
var _analytics = require("../../analytics");
|
|
17
|
-
var
|
|
17
|
+
var _utils2 = require("../utils");
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
-
var backspace = (0, _commands.chainCommands)(_commands3.cleanUpAtTheStartOfDocument, (0, _commands3.deleteBlockContent)(
|
|
21
|
-
var del = (0, _commands.chainCommands)((0,
|
|
20
|
+
var backspace = (0, _commands.chainCommands)(_commands3.cleanUpAtTheStartOfDocument, (0, _commands3.deleteBlockContent)(_utils2.isNodeAWrappingBlockNode), _commands3.deleteAndMoveCursor);
|
|
21
|
+
var del = (0, _commands.chainCommands)((0, _utils.deleteEmptyParagraphAndMoveBlockUp)(_utils2.isNodeAWrappingBlockNode), (0, _commands3.deleteBlockContent)(_utils2.isNodeAWrappingBlockNode), _commands3.deleteAndMoveCursor);
|
|
22
22
|
function keymapPlugin(schema, featureFlags, editorAnalyticsApi) {
|
|
23
23
|
var list = {};
|
|
24
24
|
keymaps.bindKeymapWithCommand(keymaps.insertNewLine.common, commands.insertNewLineWithAnalytics, list);
|
|
@@ -16,7 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
var _reactIntlNext = require("react-intl-next");
|
|
18
18
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
|
-
var
|
|
19
|
+
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
20
20
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
21
21
|
var _styled = require("./styled");
|
|
22
22
|
var _keymaps = require("../../../../keymaps");
|
|
@@ -137,7 +137,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
137
|
var items = this.createItems();
|
|
138
138
|
return (0, _react2.jsx)("span", {
|
|
139
139
|
css: _styles.wrapperStyle
|
|
140
|
-
}, (0, _react2.jsx)(
|
|
140
|
+
}, (0, _react2.jsx)(_uiMenu.DropdownMenuWithKeyboardNavigation, {
|
|
141
141
|
items: items,
|
|
142
142
|
onOpenChange: this.onOpenChange,
|
|
143
143
|
onItemActivated: this.handleSelectBlockType,
|
|
@@ -95,10 +95,10 @@ var _default = new _safePlugin.SafePlugin({
|
|
|
95
95
|
}
|
|
96
96
|
return false;
|
|
97
97
|
},
|
|
98
|
-
Enter: (0, _utils3.
|
|
99
|
-
'Mod-]': (0, _utils3.
|
|
100
|
-
'Mod-[': (0, _utils3.
|
|
101
|
-
Tab: (0, _utils3.
|
|
98
|
+
Enter: (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.insertNewlineWithIndent),
|
|
99
|
+
'Mod-]': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.indent),
|
|
100
|
+
'Mod-[': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
|
|
101
|
+
Tab: (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, function (state, dispatch) {
|
|
102
102
|
if (!dispatch) {
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
@@ -107,7 +107,7 @@ var _default = new _safePlugin.SafePlugin({
|
|
|
107
107
|
}
|
|
108
108
|
return (0, _commands.indent)(state, dispatch);
|
|
109
109
|
}),
|
|
110
|
-
'Shift-Tab': (0, _utils3.
|
|
110
|
+
'Shift-Tab': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
|
|
111
111
|
'Mod-a': function ModA(state, dispatch) {
|
|
112
112
|
if ((0, _lineHandling.isSelectionEntirelyInsideCodeBlock)(state)) {
|
|
113
113
|
var _state$selection = state.selection,
|
|
@@ -37,7 +37,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
37
37
|
var _messages = _interopRequireDefault(require("./messages"));
|
|
38
38
|
var _commands2 = require("@atlaskit/editor-plugin-table/commands");
|
|
39
39
|
var _ScrollButtons = _interopRequireDefault(require("./ScrollButtons"));
|
|
40
|
-
var
|
|
40
|
+
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
41
41
|
var _forceFocus = require("../pm-plugins/force-focus");
|
|
42
42
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
43
43
|
/** @jsx jsx */
|
|
@@ -454,7 +454,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
454
454
|
//Alt + F10 to reach first element in this floating toolbar
|
|
455
455
|
return event.altKey && (event.key === 'F10' || event.keyCode === 121);
|
|
456
456
|
};
|
|
457
|
-
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
457
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
458
458
|
editorView: this.props.editorView,
|
|
459
459
|
handleEscape: this.handleEscape,
|
|
460
460
|
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.BlockInsertMenuLegacy = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
10
|
-
var
|
|
10
|
+
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
11
11
|
var _dropdownButton = require("./dropdown-button");
|
|
12
12
|
var BlockInsertMenuLegacy = function BlockInsertMenuLegacy(props) {
|
|
13
13
|
var items = props.items;
|
|
@@ -16,7 +16,7 @@ var BlockInsertMenuLegacy = function BlockInsertMenuLegacy(props) {
|
|
|
16
16
|
items: items
|
|
17
17
|
}];
|
|
18
18
|
}, [items]);
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation, {
|
|
20
20
|
items: dropdownItems,
|
|
21
21
|
onItemActivated: props.onItemActivated,
|
|
22
22
|
onOpenChange: props.onOpenChange,
|
|
@@ -96,7 +96,7 @@ var _default = function _default(options) {
|
|
|
96
96
|
return undefined;
|
|
97
97
|
},
|
|
98
98
|
handleKeyDown: (0, _keymap.keydownHandler)({
|
|
99
|
-
Tab: (0, _utils2.
|
|
99
|
+
Tab: (0, _utils2.filterCommand)(isWholeSelectionInsideLayoutColumn, moveCursorToNextColumn)
|
|
100
100
|
}),
|
|
101
101
|
handleClickOn: (0, _utils3.createSelectionClickHandler)(['layoutColumn'], function (target) {
|
|
102
102
|
return target.hasAttribute('data-layout-section') || target.hasAttribute('data-layout-column');
|
|
@@ -8,8 +8,8 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
8
8
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
9
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
|
-
var _node = require("../utils/node");
|
|
12
11
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
12
|
+
var _lists = require("@atlaskit/editor-common/lists");
|
|
13
13
|
var _find = require("../utils/find");
|
|
14
14
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
15
15
|
function convertListType(_ref) {
|
|
@@ -25,7 +25,7 @@ function convertListType(_ref) {
|
|
|
25
25
|
var nodeSize = ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.nodeSize) || 1;
|
|
26
26
|
listRange = $from.blockRange($from.doc.resolve($from.pos + nodeSize));
|
|
27
27
|
} else {
|
|
28
|
-
listRange = $from.blockRange($to,
|
|
28
|
+
listRange = $from.blockRange($to, _utils2.isListNode);
|
|
29
29
|
}
|
|
30
30
|
if (listRange) {
|
|
31
31
|
return convertSelectedList({
|
|
@@ -52,7 +52,7 @@ function convertListType(_ref) {
|
|
|
52
52
|
var resolvedPosition = doc.resolve(position);
|
|
53
53
|
var currentChild = parentNode.child(i);
|
|
54
54
|
var currentNodeRange = resolvedPosition.blockRange(tr.doc.resolve(position + currentChild.nodeSize));
|
|
55
|
-
if (currentNodeRange && !(0,
|
|
55
|
+
if (currentNodeRange && !(0, _utils2.isListNode)(currentChild) && !(0, _transform.findWrapping)(currentNodeRange, nextListNodeType)) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -84,7 +84,7 @@ function convertListType(_ref) {
|
|
|
84
84
|
nextListNodeType: nextListNodeType
|
|
85
85
|
});
|
|
86
86
|
if (tr.docChanged) {
|
|
87
|
-
(0,
|
|
87
|
+
(0, _lists.joinSiblingLists)({
|
|
88
88
|
tr: tr,
|
|
89
89
|
forceListType: nextListNodeType
|
|
90
90
|
});
|
|
@@ -115,7 +115,7 @@ var convertSelectedList = function convertSelectedList(_ref2) {
|
|
|
115
115
|
|
|
116
116
|
// use those positions to get the closest parent list nodes
|
|
117
117
|
nodePositions.reduce(function (acc, pos) {
|
|
118
|
-
var closestParentListNode = (0, _utils.findParentNodeClosestToPos)(tr.doc.resolve(pos),
|
|
118
|
+
var closestParentListNode = (0, _utils.findParentNodeClosestToPos)(tr.doc.resolve(pos), _utils2.isListNode);
|
|
119
119
|
if (!closestParentListNode) {
|
|
120
120
|
return acc;
|
|
121
121
|
}
|
|
@@ -8,13 +8,13 @@ exports.indentListItemsSelected = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
|
-
var
|
|
11
|
+
var _lists = require("@atlaskit/editor-common/lists");
|
|
12
12
|
var _find = require("../utils/find");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
15
15
|
var indentListItemsSelected = function indentListItemsSelected(tr) {
|
|
16
16
|
var originalSelection = tr.selection;
|
|
17
|
-
var normalizedSelection = (0,
|
|
17
|
+
var normalizedSelection = (0, _lists.normalizeListItemsSelection)({
|
|
18
18
|
selection: originalSelection,
|
|
19
19
|
doc: tr.doc
|
|
20
20
|
});
|
|
@@ -38,17 +38,17 @@ var indentListItemsSelected = function indentListItemsSelected(tr) {
|
|
|
38
38
|
// @ts-ignore
|
|
39
39
|
var positionListItemPosition = resolvedPos.posAtIndex(listItemIndex - 1);
|
|
40
40
|
var previousListItem = tr.doc.nodeAt(positionListItemPosition);
|
|
41
|
-
if (!previousListItem || !(0,
|
|
41
|
+
if (!previousListItem || !(0, _utils.isListItemNode)(previousListItem)) {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
|
-
if ((0,
|
|
44
|
+
if ((0, _utils.isListItemNode)(previousListItem) && listItemIndex === 0) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
var listItemSelectedCommonParent = range.parent;
|
|
48
|
-
var previousNestedList = (0,
|
|
48
|
+
var previousNestedList = (0, _utils.isListNode)(previousListItem.lastChild) ? previousListItem.lastChild : null;
|
|
49
49
|
var listNodeType = previousNestedList ? previousNestedList.type : listItemSelectedCommonParent.type;
|
|
50
50
|
var nestedList = listItemsSelected.to.node.lastChild;
|
|
51
|
-
var nestedItemsOffset = nestedList && (0,
|
|
51
|
+
var nestedItemsOffset = nestedList && (0, _utils.isListNode)(nestedList) ? nestedList.nodeSize : 0;
|
|
52
52
|
var from = listItemsSelected.from.pos;
|
|
53
53
|
var to = listItemsSelected.to.pos + listItemsSelected.to.node.nodeSize - nestedItemsOffset;
|
|
54
54
|
var _createIndentedListIt = createIndentedListItemsSlice({
|
|
@@ -83,7 +83,7 @@ var calculateRange = function calculateRange(_ref) {
|
|
|
83
83
|
var selection = _ref.selection;
|
|
84
84
|
var $from = selection.$from,
|
|
85
85
|
$to = selection.$to;
|
|
86
|
-
var range = $from.blockRange($to,
|
|
86
|
+
var range = $from.blockRange($to, _utils.isListNode);
|
|
87
87
|
if (!range) {
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
@@ -97,9 +97,9 @@ var calculateNewSelection = function calculateNewSelection(_ref2) {
|
|
|
97
97
|
var offset = hasPreviousNestedList ? 2 : 0;
|
|
98
98
|
var $from = normalizedSelection.$from,
|
|
99
99
|
$to = normalizedSelection.$to;
|
|
100
|
-
if (normalizedSelection instanceof
|
|
100
|
+
if (normalizedSelection instanceof _selection.GapCursorSelection) {
|
|
101
101
|
var _nextSelectionFrom = tr.doc.resolve($from.pos - offset);
|
|
102
|
-
return new
|
|
102
|
+
return new _selection.GapCursorSelection(_nextSelectionFrom, normalizedSelection.side);
|
|
103
103
|
}
|
|
104
104
|
if (originalSelection instanceof _state.NodeSelection) {
|
|
105
105
|
return _state.NodeSelection.create(tr.doc, $from.pos - offset);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.calcJoinListScenario = void 0;
|
|
7
7
|
var _analytics = require("../../analytics");
|
|
8
|
-
var
|
|
8
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
9
|
var _selection = require("../utils/selection");
|
|
10
10
|
var _joinListItemsScenarios = require("./join-list-items-scenarios");
|
|
11
11
|
var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
|
|
@@ -17,7 +17,7 @@ var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
|
|
|
17
17
|
var headInParagraph = (0, _selection.isPosInsideParagraph)($head);
|
|
18
18
|
var headInLastNonListChild = headGrandParent && headGrandParent.lastChild && (headGrandParent.lastChild === headParent || headGrandParent.childCount > 1 && headGrandParent.child(headGrandParent.childCount - 2) === headParent &&
|
|
19
19
|
//find the second last child if a list item may be the last child
|
|
20
|
-
(0,
|
|
20
|
+
(0, _utils.isListNode)(headGrandParent.lastChild));
|
|
21
21
|
var nextInList = (0, _selection.isPosInsideList)($next);
|
|
22
22
|
var nextInParagraph = (0, _selection.isPosInsideParagraph)($next);
|
|
23
23
|
if (!headInList && headInParagraph && nextInList) {
|
|
@@ -35,11 +35,11 @@ var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
|
|
|
35
35
|
var nextNodeAfter = $next.nodeAfter;
|
|
36
36
|
var nextGrandParent = $next.node(-1);
|
|
37
37
|
var headGreatGrandParent = $head.node(-2);
|
|
38
|
-
var nextInListItem = (0,
|
|
39
|
-
var nextNodeAfterListItem = (0,
|
|
38
|
+
var nextInListItem = (0, _utils.isListItemNode)($next.parent);
|
|
39
|
+
var nextNodeAfterListItem = (0, _utils.isListItemNode)(nextNodeAfter);
|
|
40
40
|
var nextListItemHasFirstChildParagraph = nextNodeAfter &&
|
|
41
41
|
//Redundant check but the linter complains otherwise
|
|
42
|
-
nextNodeAfterListItem && (0,
|
|
42
|
+
nextNodeAfterListItem && (0, _utils.isParagraphNode)(nextNodeAfter.firstChild);
|
|
43
43
|
if (!nextInListItem && nextListItemHasFirstChildParagraph) {
|
|
44
44
|
return [_analytics.LIST_TEXT_SCENARIOS.JOIN_DESCENDANT_TO_PARENT, _joinListItemsScenarios.joinNestedListWithParentListItem];
|
|
45
45
|
}
|
|
@@ -47,7 +47,7 @@ var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
|
|
|
47
47
|
return false;
|
|
48
48
|
}
|
|
49
49
|
var nextParentSiblingOfHeadParent = nextGrandParent && nextGrandParent === headGreatGrandParent;
|
|
50
|
-
var nextNodeAfterIsParagraph = (0,
|
|
50
|
+
var nextNodeAfterIsParagraph = (0, _utils.isParagraphNode)(nextNodeAfter);
|
|
51
51
|
if (!nextNodeAfterIsParagraph) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js
CHANGED
|
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.joinListItemWithParagraph = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
8
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
|
-
var _node = require("../../utils/node");
|
|
10
9
|
// Case for when a users selection is at the end of a paragraph, the paragraph
|
|
11
10
|
// is followed by a list, and they delete forward
|
|
12
11
|
var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
|
|
@@ -15,7 +14,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
|
|
|
15
14
|
$head = _ref.$head;
|
|
16
15
|
// For empty paragraphs before a list
|
|
17
16
|
if ($head.parent.content.size < 1) {
|
|
18
|
-
(0,
|
|
17
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
19
18
|
return tr.doc.resolve($head.pos);
|
|
20
19
|
}, [], [[$head.pos - 1, $head.pos]]);
|
|
21
20
|
return true;
|
|
@@ -33,7 +32,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
|
|
|
33
32
|
var lastChildOfFirstListItem = firstListItem.lastChild;
|
|
34
33
|
var firstGrandchildOfFirstListItem = firstChildNodeOfFirstListItem.firstChild;
|
|
35
34
|
var firstListItemHasOneChildWithNoNestedLists = hasSingleChild(firstListItem) && firstChildNodeOfFirstListItem.childCount < 2 && $next.nodeAfter;
|
|
36
|
-
var firstListItemContainsParagraphAndNestedList = !hasSingleChild(firstListItem) && lastChildOfFirstListItem && (0,
|
|
35
|
+
var firstListItemContainsParagraphAndNestedList = !hasSingleChild(firstListItem) && lastChildOfFirstListItem && (0, _utils.isListNode)(lastChildOfFirstListItem);
|
|
37
36
|
var insertions = [];
|
|
38
37
|
var deletions = [];
|
|
39
38
|
|
|
@@ -53,7 +52,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
|
|
|
53
52
|
deletions.push([tr.mapping.map($next.pos), tr.mapping.map($next.pos + firstListItem.nodeSize - 1)]);
|
|
54
53
|
var firstListItemText = _model.Fragment.from(firstChildNodeOfFirstListItem.content);
|
|
55
54
|
insertions.push([firstListItemText, paragraphPosition]);
|
|
56
|
-
(0,
|
|
55
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
57
56
|
return tr.doc.resolve($head.pos);
|
|
58
57
|
}, insertions, deletions);
|
|
59
58
|
return true;
|
|
@@ -63,7 +62,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
|
|
|
63
62
|
if (firstListItem.childCount > 1) {
|
|
64
63
|
insertions.push([_model.Fragment.from(firstChildNodeOfFirstListItem.content), paragraphPosition]);
|
|
65
64
|
deletions.push([tr.mapping.map($next.pos + 1), tr.mapping.map($next.pos + firstChildNodeOfFirstListItem.nodeSize + 1)]);
|
|
66
|
-
(0,
|
|
65
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
67
66
|
return tr.doc.resolve($head.pos);
|
|
68
67
|
}, insertions, deletions);
|
|
69
68
|
return true;
|
|
@@ -78,7 +77,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
|
|
|
78
77
|
var nodeSizeOfFirstChild = firstChildNodeOfFirstListItem.nodeSize;
|
|
79
78
|
deletions.push([tr.mapping.map($next.pos), tr.mapping.map($next.pos + 2 + nodeSizeOfFirstChild)]);
|
|
80
79
|
}
|
|
81
|
-
(0,
|
|
80
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
82
81
|
return tr.doc.resolve($head.pos);
|
|
83
82
|
}, insertions, deletions);
|
|
84
83
|
return true;
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.joinListItemWithParentNestedList = void 0;
|
|
7
|
-
var
|
|
8
|
-
var _node = require("../../utils/node");
|
|
7
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
8
|
//Case for two adjacent list items with the first being of greater indentation
|
|
10
9
|
var joinListItemWithParentNestedList = function joinListItemWithParentNestedList(_ref) {
|
|
11
10
|
var tr = _ref.tr,
|
|
@@ -70,7 +69,7 @@ var joinListItemWithParentNestedList = function joinListItemWithParentNestedList
|
|
|
70
69
|
var beforeListItemK = $next.before();
|
|
71
70
|
var afterListItemB = $next.before();
|
|
72
71
|
var afterListItemK = $next.after();
|
|
73
|
-
var containsChildrenO = (0,
|
|
72
|
+
var containsChildrenO = (0, _utils.isListNode)(listItemK.lastChild);
|
|
74
73
|
var textInsertPos = $head.pos;
|
|
75
74
|
var childrenMInsertPos = $head.pos + 1;
|
|
76
75
|
var childrenOInsertPos = afterListItemB - 2;
|
|
@@ -78,7 +77,7 @@ var joinListItemWithParentNestedList = function joinListItemWithParentNestedList
|
|
|
78
77
|
var childrenMContent = containsChildrenO ? listItemK.content.cut(listItemK.firstChild.nodeSize, listItemK.nodeSize - listItemK.lastChild.nodeSize - 2 //Get the position before
|
|
79
78
|
) : listItemK.content.cut(listItemK.firstChild.nodeSize);
|
|
80
79
|
var childrenOContent = listItemK.lastChild.content;
|
|
81
|
-
(0,
|
|
80
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
82
81
|
return tr.doc.resolve(textInsertPos);
|
|
83
82
|
}, containsChildrenO ? [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos], [childrenOContent, childrenOInsertPos]] : [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos]], [[beforeListItemK, afterListItemK]]);
|
|
84
83
|
return true;
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.joinNestedListWithParentListItem = void 0;
|
|
7
|
-
var
|
|
8
|
-
var _node = require("../../utils/node");
|
|
7
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
8
|
//Case for two adjacent list items with the first being of lower indentation
|
|
10
9
|
var joinNestedListWithParentListItem = function joinNestedListWithParentListItem(_ref) {
|
|
11
10
|
var tr = _ref.tr,
|
|
@@ -62,7 +61,7 @@ var joinNestedListWithParentListItem = function joinNestedListWithParentListItem
|
|
|
62
61
|
var afterListE = $next.after();
|
|
63
62
|
var afterListItemF = tr.doc.resolve($next.pos + 1).after(); //List must always have at least one listItem
|
|
64
63
|
|
|
65
|
-
var containsChildrenJ = (0,
|
|
64
|
+
var containsChildrenJ = (0, _utils.isListNode)(listItemF.lastChild);
|
|
66
65
|
var shouldRemoveListE = listE.childCount === 1 && !containsChildrenJ; //Assures no Children J and K
|
|
67
66
|
|
|
68
67
|
var textInsertPos = $head.pos;
|
|
@@ -72,7 +71,7 @@ var joinNestedListWithParentListItem = function joinNestedListWithParentListItem
|
|
|
72
71
|
var childrenHContent = containsChildrenJ ? listItemF.content.cut(paragraphG.nodeSize, listItemF.nodeSize - listItemF.lastChild.nodeSize - 2) : listItemF.content.cut(paragraphG.nodeSize); //If Children J doesn't exist then Children H will include the last node
|
|
73
72
|
var childrenJContent = listItemF.lastChild.content; //Will be invalid if there are no Children J but it will be unused
|
|
74
73
|
|
|
75
|
-
(0,
|
|
74
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
76
75
|
return tr.doc.resolve(textInsertPos);
|
|
77
76
|
}, containsChildrenJ ? [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos], [childrenJContent, childrenJInsertPos]] : [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos]], [shouldRemoveListE ? [beforeListE, afterListE] : [beforeListItemF, afterListItemF]]);
|
|
78
77
|
return true;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.joinParagrapWithList = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
8
|
//Case for two adjacent nodes with the first being a list item and the last being a paragraph
|
|
9
9
|
var joinParagrapWithList = function joinParagrapWithList(_ref) {
|
|
10
10
|
var tr = _ref.tr,
|
|
@@ -37,7 +37,7 @@ var joinParagrapWithList = function joinParagrapWithList(_ref) {
|
|
|
37
37
|
var afterParagraphE = $next.after();
|
|
38
38
|
var textInsertPos = $head.pos;
|
|
39
39
|
var textContent = paragraphE.content;
|
|
40
|
-
(0,
|
|
40
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
41
41
|
return tr.doc.resolve(textInsertPos);
|
|
42
42
|
}, [[textContent, textInsertPos]], [[beforeParagraphE, afterParagraphE]]);
|
|
43
43
|
return true;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.joinSiblingListItems = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
8
|
//Case for two adjacent list items of the same indentation
|
|
9
9
|
var joinSiblingListItems = function joinSiblingListItems(_ref) {
|
|
10
10
|
var tr = _ref.tr,
|
|
@@ -48,7 +48,7 @@ var joinSiblingListItems = function joinSiblingListItems(_ref) {
|
|
|
48
48
|
var childrenGInsertPos = endListItemB;
|
|
49
49
|
var textContent = paragraphF.content;
|
|
50
50
|
var childrenGContent = listItemE.content.cut(paragraphF.nodeSize);
|
|
51
|
-
(0,
|
|
51
|
+
(0, _utils.insertContentDeleteRange)(tr, function (tr) {
|
|
52
52
|
return tr.doc.resolve(textInsertPos);
|
|
53
53
|
}, [[textContent, textInsertPos], [childrenGContent, childrenGInsertPos]], [[beforeListItemE, afterListItemE]]);
|
|
54
54
|
return true;
|
|
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mergeNextListAtPosition = mergeNextListAtPosition;
|
|
7
|
-
var
|
|
7
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
8
|
function mergeNextListAtPosition(_ref) {
|
|
9
9
|
var tr = _ref.tr,
|
|
10
10
|
listPosition = _ref.listPosition;
|
|
11
11
|
var listNodeAtPosition = tr.doc.nodeAt(listPosition);
|
|
12
|
-
if (!(0,
|
|
12
|
+
if (!(0, _utils.isListNode)(listNodeAtPosition)) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
var listPositionResolved = tr.doc.resolve(listPosition + listNodeAtPosition.nodeSize);
|
|
16
16
|
var pos = listPositionResolved.pos,
|
|
17
17
|
nodeAfter = listPositionResolved.nodeAfter,
|
|
18
18
|
nodeBefore = listPositionResolved.nodeBefore;
|
|
19
|
-
if (!(0,
|
|
19
|
+
if (!(0, _utils.isListNode)(nodeBefore) || !(0, _utils.isListNode)(nodeAfter)) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if ((nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.type.name) !== (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type.name)) {
|