@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
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
-
export var moveTargetIntoList = function moveTargetIntoList(_ref) {
|
|
3
|
-
var _$target$nodeAfter;
|
|
4
|
-
var insertPosition = _ref.insertPosition,
|
|
5
|
-
$target = _ref.$target;
|
|
6
|
-
// take the text content of the paragraph and insert after the paragraph up until before the the cut
|
|
7
|
-
var from = insertPosition;
|
|
8
|
-
var to = $target.pos + (((_$target$nodeAfter = $target.nodeAfter) === null || _$target$nodeAfter === void 0 ? void 0 : _$target$nodeAfter.nodeSize) || 0); //$cut.pos + $cut.nodeAfter.nodeSize;
|
|
9
|
-
var gapFrom = $target.posAtIndex(0, $target.depth + 1); // start pos of the child
|
|
10
|
-
var gapTo = $target.doc.resolve(gapFrom).end(); // end pos of the paragraph
|
|
11
|
-
|
|
12
|
-
if (gapTo - gapFrom === 0) {
|
|
13
|
-
return new ReplaceStep(from, to, $target.doc.slice(insertPosition, $target.pos));
|
|
14
|
-
}
|
|
15
|
-
var step = new ReplaceAroundStep(from, to, gapFrom, gapTo, $target.doc.slice(insertPosition, $target.pos), 0, true);
|
|
16
|
-
return step;
|
|
17
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl-next';
|
|
2
|
-
export default defineMessages({
|
|
3
|
-
toolbarLabel: {
|
|
4
|
-
id: 'fabric.editor.toolbarLabel',
|
|
5
|
-
defaultMessage: 'Editor toolbar',
|
|
6
|
-
description: 'Label for the ARIA region landmark'
|
|
7
|
-
},
|
|
8
|
-
pageActionsLabel: {
|
|
9
|
-
id: 'fabric.editor.pageActionsLabel',
|
|
10
|
-
defaultMessage: 'Page actions',
|
|
11
|
-
description: 'Label for the ARIA region landmark'
|
|
12
|
-
},
|
|
13
|
-
editableContentLabel: {
|
|
14
|
-
id: 'fabric.editor.editableContentLabel',
|
|
15
|
-
defaultMessage: 'Editable content',
|
|
16
|
-
description: 'Label for the ARIA region landmark'
|
|
17
|
-
}
|
|
18
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
3
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
-
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; }
|
|
5
|
-
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) { _defineProperty(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; }
|
|
6
|
-
import { DropdownMenu as DropdownComponent } from '@atlaskit/editor-common/ui-menu';
|
|
7
|
-
import React, { useContext } from 'react';
|
|
8
|
-
import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
|
|
9
|
-
var DropdownMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
10
|
-
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
11
|
-
var keyDownHandlerContext = useContext(KeyDownHandlerContext);
|
|
12
|
-
//This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
13
|
-
//Default context has the void callbacks for above key events
|
|
14
|
-
return /*#__PURE__*/React.createElement(DropdownComponent, _extends({
|
|
15
|
-
arrowKeyNavigationProviderOptions: _objectSpread(_objectSpread({}, props.arrowKeyNavigationProviderOptions), {}, {
|
|
16
|
-
keyDownHandlerContext: keyDownHandlerContext
|
|
17
|
-
})
|
|
18
|
-
}, props));
|
|
19
|
-
});
|
|
20
|
-
export default DropdownMenu;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import { centeredToolbarContainer } from '../styles';
|
|
5
|
-
import React, { useCallback, useLayoutEffect, useRef } from 'react';
|
|
6
|
-
import { EDIT_AREA_ID } from '../../create-editor/ReactEditorViewInternal';
|
|
7
|
-
import messages from '../Appearance/FullPage/messages';
|
|
8
|
-
/*
|
|
9
|
-
** The context is used to handle the keydown events of submenus.
|
|
10
|
-
** Because the keyboard navigation is explicitly managed for main toolbar items
|
|
11
|
-
** Few key presses such as Tab,Arrow Right/Left need ot be handled here via context
|
|
12
|
-
*/
|
|
13
|
-
export var KeyDownHandlerContext = /*#__PURE__*/React.createContext({
|
|
14
|
-
handleArrowLeft: function handleArrowLeft() {},
|
|
15
|
-
handleArrowRight: function handleArrowRight() {},
|
|
16
|
-
handleTab: function handleTab() {}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* This component is a wrapper of main toolbar which listens to keydown events of children
|
|
21
|
-
* and handles left/right arrow key navigation for all focusable elements
|
|
22
|
-
* @param
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvider(_ref) {
|
|
26
|
-
var children = _ref.children,
|
|
27
|
-
editorView = _ref.editorView,
|
|
28
|
-
childComponentSelector = _ref.childComponentSelector,
|
|
29
|
-
handleEscape = _ref.handleEscape,
|
|
30
|
-
disableArrowKeyNavigation = _ref.disableArrowKeyNavigation,
|
|
31
|
-
isShortcutToFocusToolbar = _ref.isShortcutToFocusToolbar,
|
|
32
|
-
editorAppearance = _ref.editorAppearance,
|
|
33
|
-
useStickyToolbar = _ref.useStickyToolbar,
|
|
34
|
-
intl = _ref.intl;
|
|
35
|
-
var wrapperRef = useRef(null);
|
|
36
|
-
var selectedItemIndex = useRef(0);
|
|
37
|
-
var incrementIndex = useCallback(function (list) {
|
|
38
|
-
var index = 0;
|
|
39
|
-
if (document.activeElement) {
|
|
40
|
-
index = list.indexOf(document.activeElement);
|
|
41
|
-
index = (index + 1) % list.length;
|
|
42
|
-
}
|
|
43
|
-
selectedItemIndex.current = index;
|
|
44
|
-
}, []);
|
|
45
|
-
var decrementIndex = useCallback(function (list) {
|
|
46
|
-
var index = 0;
|
|
47
|
-
if (document.activeElement) {
|
|
48
|
-
index = list.indexOf(document.activeElement);
|
|
49
|
-
index = (list.length + index - 1) % list.length;
|
|
50
|
-
}
|
|
51
|
-
selectedItemIndex.current = index;
|
|
52
|
-
}, []);
|
|
53
|
-
var handleArrowRight = function handleArrowRight() {
|
|
54
|
-
var _filteredFocusableEle;
|
|
55
|
-
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
56
|
-
incrementIndex(filteredFocusableElements);
|
|
57
|
-
(_filteredFocusableEle = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle === void 0 ? void 0 : _filteredFocusableEle.focus();
|
|
58
|
-
};
|
|
59
|
-
var handleArrowLeft = function handleArrowLeft() {
|
|
60
|
-
var _filteredFocusableEle2;
|
|
61
|
-
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
62
|
-
decrementIndex(filteredFocusableElements);
|
|
63
|
-
(_filteredFocusableEle2 = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle2 === void 0 ? void 0 : _filteredFocusableEle2.focus();
|
|
64
|
-
};
|
|
65
|
-
var handleTab = function handleTab() {
|
|
66
|
-
var _filteredFocusableEle3;
|
|
67
|
-
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
68
|
-
(_filteredFocusableEle3 = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle3 === void 0 ? void 0 : _filteredFocusableEle3.focus();
|
|
69
|
-
};
|
|
70
|
-
var handleTabLocal = function handleTabLocal() {
|
|
71
|
-
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
72
|
-
filteredFocusableElements.forEach(function (element) {
|
|
73
|
-
element.setAttribute('tabindex', '-1');
|
|
74
|
-
});
|
|
75
|
-
filteredFocusableElements[selectedItemIndex.current].setAttribute('tabindex', '0');
|
|
76
|
-
};
|
|
77
|
-
var focusAndScrollToElement = function focusAndScrollToElement(element) {
|
|
78
|
-
var scrollToElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
79
|
-
if (scrollToElement) {
|
|
80
|
-
element === null || element === void 0 ? void 0 : element.scrollIntoView({
|
|
81
|
-
behavior: 'smooth',
|
|
82
|
-
block: 'center',
|
|
83
|
-
inline: 'nearest'
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
element.focus();
|
|
87
|
-
};
|
|
88
|
-
var submenuKeydownHandleContext = {
|
|
89
|
-
handleArrowLeft: handleArrowLeft,
|
|
90
|
-
handleArrowRight: handleArrowRight,
|
|
91
|
-
handleTab: handleTab
|
|
92
|
-
};
|
|
93
|
-
useLayoutEffect(function () {
|
|
94
|
-
if (!wrapperRef.current || disableArrowKeyNavigation) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
var element = wrapperRef.current;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* To handle the key events on the list
|
|
101
|
-
* @param event
|
|
102
|
-
*/
|
|
103
|
-
var handleKeyDown = function handleKeyDown(event) {
|
|
104
|
-
var _document$querySelect, _document$querySelect2, _wrapperRef$current;
|
|
105
|
-
//To trap the focus inside the horizontal toolbar for left and right arrow keys
|
|
106
|
-
var targetElement = event.target;
|
|
107
|
-
|
|
108
|
-
//To filter out the events outside the child component
|
|
109
|
-
if (!targetElement.closest("".concat(childComponentSelector))) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
//The key events are from child components such as dropdown menus / popups are ignored
|
|
114
|
-
if ((_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
var menuWrapper = document.querySelector('.menu-key-handler-wrapper');
|
|
118
|
-
if (menuWrapper) {
|
|
119
|
-
// if menu wrapper exists, then a menu is open and arrow keys will be handled by MenuArrowKeyNavigationProvider
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
123
|
-
if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
//This is kind of hack to reset the current focused toolbar item
|
|
128
|
-
//to handle some use cases such as Tab in/out of main toolbar
|
|
129
|
-
if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
|
|
130
|
-
selectedItemIndex.current = -1;
|
|
131
|
-
} else {
|
|
132
|
-
selectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
//do not scroll to focused element for sticky toolbar when navigating with arrows to avoid unnesessary scroll jump
|
|
136
|
-
var allowScrollToElement = !(editorAppearance === 'comment' && !!useStickyToolbar);
|
|
137
|
-
switch (event.key) {
|
|
138
|
-
case 'ArrowRight':
|
|
139
|
-
incrementIndex(filteredFocusableElements);
|
|
140
|
-
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current], allowScrollToElement);
|
|
141
|
-
event.preventDefault();
|
|
142
|
-
break;
|
|
143
|
-
case 'ArrowLeft':
|
|
144
|
-
decrementIndex(filteredFocusableElements);
|
|
145
|
-
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current], allowScrollToElement);
|
|
146
|
-
event.preventDefault();
|
|
147
|
-
break;
|
|
148
|
-
case 'Tab':
|
|
149
|
-
handleTabLocal();
|
|
150
|
-
break;
|
|
151
|
-
case 'Escape':
|
|
152
|
-
handleEscape(event);
|
|
153
|
-
break;
|
|
154
|
-
default:
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
var globalKeyDownHandler = function globalKeyDownHandler(event) {
|
|
158
|
-
//To focus the first element in the toolbar
|
|
159
|
-
if (isShortcutToFocusToolbar(event)) {
|
|
160
|
-
var _filteredFocusableEle4, _filteredFocusableEle5;
|
|
161
|
-
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
162
|
-
(_filteredFocusableEle4 = filteredFocusableElements[0]) === null || _filteredFocusableEle4 === void 0 ? void 0 : _filteredFocusableEle4.focus();
|
|
163
|
-
(_filteredFocusableEle5 = filteredFocusableElements[0]) === null || _filteredFocusableEle5 === void 0 ? void 0 : _filteredFocusableEle5.scrollIntoView({
|
|
164
|
-
behavior: 'smooth',
|
|
165
|
-
block: 'center',
|
|
166
|
-
inline: 'nearest'
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
|
|
171
|
-
var editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
|
|
172
|
-
if (isShortcutToFocusToolbar) {
|
|
173
|
-
editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.addEventListener('keydown', globalKeyDownHandler);
|
|
174
|
-
}
|
|
175
|
-
return function () {
|
|
176
|
-
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
|
|
177
|
-
if (isShortcutToFocusToolbar) {
|
|
178
|
-
editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
}, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex, isShortcutToFocusToolbar, editorAppearance, useStickyToolbar]);
|
|
182
|
-
return jsx("div", {
|
|
183
|
-
css: editorAppearance === 'comment' && centeredToolbarContainer,
|
|
184
|
-
className: "custom-key-handler-wrapper",
|
|
185
|
-
ref: wrapperRef,
|
|
186
|
-
role: "toolbar",
|
|
187
|
-
"aria-label": intl.formatMessage(messages.toolbarLabel),
|
|
188
|
-
"aria-controls": EDIT_AREA_ID
|
|
189
|
-
}, jsx(KeyDownHandlerContext.Provider, {
|
|
190
|
-
value: submenuKeydownHandleContext
|
|
191
|
-
}, children));
|
|
192
|
-
};
|
|
193
|
-
function getFocusableElements(rootNode) {
|
|
194
|
-
if (!rootNode) {
|
|
195
|
-
return [];
|
|
196
|
-
}
|
|
197
|
-
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, div[tabindex="-1"], div[tabindex="0"]') || [];
|
|
198
|
-
return Array.from(focusableModalElements);
|
|
199
|
-
}
|
|
200
|
-
function getFilteredFocusableElements(rootNode) {
|
|
201
|
-
//The focusable elements from child components such as dropdown menus / popups are ignored
|
|
202
|
-
return getFocusableElements(rootNode).filter(function (elm) {
|
|
203
|
-
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons');
|
|
204
|
-
});
|
|
205
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { canJoin } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks whether two adjacent nodes can be joined. If so, the document
|
|
5
|
-
* will be updated to join those nodes. If not, the original transaction
|
|
6
|
-
* remains untouched.
|
|
7
|
-
*
|
|
8
|
-
* Nodes are considered joinable if the `isJoinable` predicate returns true or,
|
|
9
|
-
* if an array of strings was passed, if their node type name is in that array.
|
|
10
|
-
*
|
|
11
|
-
* Adapted from https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L597-L610
|
|
12
|
-
*/
|
|
13
|
-
export function autoJoinTr(tr, isJoinable) {
|
|
14
|
-
if (Array.isArray(isJoinable)) {
|
|
15
|
-
var types = isJoinable;
|
|
16
|
-
isJoinable = function isJoinable(node) {
|
|
17
|
-
return types.indexOf(node.type.name) > -1;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
var ranges = [];
|
|
21
|
-
for (var i = 0; i < tr.mapping.maps.length; i++) {
|
|
22
|
-
var map = tr.mapping.maps[i];
|
|
23
|
-
for (var j = 0; j < ranges.length; j++) {
|
|
24
|
-
ranges[j] = map.map(ranges[j]);
|
|
25
|
-
}
|
|
26
|
-
map.forEach(function (_s, _e, from, to) {
|
|
27
|
-
return ranges.push(from, to);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Figure out which joinable points exist inside those ranges,
|
|
32
|
-
// by checking all node boundaries in their parent nodes.
|
|
33
|
-
var joinable = [];
|
|
34
|
-
for (var _i = 0; _i < ranges.length; _i += 2) {
|
|
35
|
-
var from = ranges[_i];
|
|
36
|
-
var to = ranges[_i + 1];
|
|
37
|
-
var $from = tr.doc.resolve(from);
|
|
38
|
-
var depth = $from.sharedDepth(to);
|
|
39
|
-
var parent = $from.node(depth);
|
|
40
|
-
for (var index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {
|
|
41
|
-
var _after = parent.maybeChild(index);
|
|
42
|
-
if (!_after) {
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
if (index && joinable.indexOf(pos) === -1) {
|
|
46
|
-
var _before = parent.child(index - 1);
|
|
47
|
-
if (_before.type === _after.type && isJoinable(_before, _after)) {
|
|
48
|
-
joinable.push(pos);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
pos += _after.nodeSize;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// Join the joinable points
|
|
55
|
-
joinable.sort(function (a, b) {
|
|
56
|
-
return a - b;
|
|
57
|
-
});
|
|
58
|
-
for (var _i2 = joinable.length - 1; _i2 >= 0; _i2--) {
|
|
59
|
-
if (canJoin(tr.doc, joinable[_i2])) {
|
|
60
|
-
tr.join(joinable[_i2]);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
type Params = {
|
|
4
|
-
insertPosition: number;
|
|
5
|
-
$target: ResolvedPos;
|
|
6
|
-
};
|
|
7
|
-
export declare const moveTargetIntoList: ({ insertPosition, $target, }: Params) => Step;
|
|
8
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
toolbarLabel: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
pageActionsLabel: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
editableContentLabel: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import type { EditorAppearance } from '../../types';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { ReactNode } from 'react';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { UseStickyToolbarType } from '../../types/editor-props';
|
|
8
|
-
import type { IntlShape } from 'react-intl-next/src/types';
|
|
9
|
-
export interface KeyDownHandlerContext {
|
|
10
|
-
handleArrowLeft: () => void;
|
|
11
|
-
handleArrowRight: () => void;
|
|
12
|
-
handleTab: () => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const KeyDownHandlerContext: React.Context<KeyDownHandlerContext>;
|
|
15
|
-
/**
|
|
16
|
-
* This component is a wrapper of main toolbar which listens to keydown events of children
|
|
17
|
-
* and handles left/right arrow key navigation for all focusable elements
|
|
18
|
-
* @param
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
export declare const ToolbarArrowKeyNavigationProvider: ({ children, editorView, childComponentSelector, handleEscape, disableArrowKeyNavigation, isShortcutToFocusToolbar, editorAppearance, useStickyToolbar, intl, }: {
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
editorView?: EditorView | undefined;
|
|
24
|
-
childComponentSelector: string;
|
|
25
|
-
handleEscape?: ((event: KeyboardEvent) => void) | undefined;
|
|
26
|
-
disableArrowKeyNavigation?: boolean | undefined;
|
|
27
|
-
isShortcutToFocusToolbar?: ((event: KeyboardEvent) => boolean) | undefined;
|
|
28
|
-
editorAppearance?: EditorAppearance | undefined;
|
|
29
|
-
useStickyToolbar?: UseStickyToolbarType | undefined;
|
|
30
|
-
intl: IntlShape;
|
|
31
|
-
}) => jsx.JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
/**
|
|
4
|
-
* Checks whether two adjacent nodes can be joined. If so, the document
|
|
5
|
-
* will be updated to join those nodes. If not, the original transaction
|
|
6
|
-
* remains untouched.
|
|
7
|
-
*
|
|
8
|
-
* Nodes are considered joinable if the `isJoinable` predicate returns true or,
|
|
9
|
-
* if an array of strings was passed, if their node type name is in that array.
|
|
10
|
-
*
|
|
11
|
-
* Adapted from https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L597-L610
|
|
12
|
-
*/
|
|
13
|
-
export declare function autoJoinTr(tr: Transaction, isJoinable: ((before: Node, after: Node) => boolean) | string[]): void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
type Params = {
|
|
4
|
-
insertPosition: number;
|
|
5
|
-
$target: ResolvedPos;
|
|
6
|
-
};
|
|
7
|
-
export declare const moveTargetIntoList: ({ insertPosition, $target, }: Params) => Step;
|
|
8
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
toolbarLabel: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
pageActionsLabel: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
editableContentLabel: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import type { EditorAppearance } from '../../types';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { ReactNode } from 'react';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { UseStickyToolbarType } from '../../types/editor-props';
|
|
8
|
-
import type { IntlShape } from 'react-intl-next/src/types';
|
|
9
|
-
export interface KeyDownHandlerContext {
|
|
10
|
-
handleArrowLeft: () => void;
|
|
11
|
-
handleArrowRight: () => void;
|
|
12
|
-
handleTab: () => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const KeyDownHandlerContext: React.Context<KeyDownHandlerContext>;
|
|
15
|
-
/**
|
|
16
|
-
* This component is a wrapper of main toolbar which listens to keydown events of children
|
|
17
|
-
* and handles left/right arrow key navigation for all focusable elements
|
|
18
|
-
* @param
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
export declare const ToolbarArrowKeyNavigationProvider: ({ children, editorView, childComponentSelector, handleEscape, disableArrowKeyNavigation, isShortcutToFocusToolbar, editorAppearance, useStickyToolbar, intl, }: {
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
editorView?: EditorView | undefined;
|
|
24
|
-
childComponentSelector: string;
|
|
25
|
-
handleEscape?: ((event: KeyboardEvent) => void) | undefined;
|
|
26
|
-
disableArrowKeyNavigation?: boolean | undefined;
|
|
27
|
-
isShortcutToFocusToolbar?: ((event: KeyboardEvent) => boolean) | undefined;
|
|
28
|
-
editorAppearance?: EditorAppearance | undefined;
|
|
29
|
-
useStickyToolbar?: UseStickyToolbarType | undefined;
|
|
30
|
-
intl: IntlShape;
|
|
31
|
-
}) => jsx.JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
/**
|
|
4
|
-
* Checks whether two adjacent nodes can be joined. If so, the document
|
|
5
|
-
* will be updated to join those nodes. If not, the original transaction
|
|
6
|
-
* remains untouched.
|
|
7
|
-
*
|
|
8
|
-
* Nodes are considered joinable if the `isJoinable` predicate returns true or,
|
|
9
|
-
* if an array of strings was passed, if their node type name is in that array.
|
|
10
|
-
*
|
|
11
|
-
* Adapted from https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L597-L610
|
|
12
|
-
*/
|
|
13
|
-
export declare function autoJoinTr(tr: Transaction, isJoinable: ((before: Node, after: Node) => boolean) | string[]): void;
|