@atlaskit/editor-core 176.0.2 → 177.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -2
- package/CHANGELOG.md +114 -0
- package/codemods/{173.0.0-rename-unsafe-allowUndoRedoButton-prop.ts → 175.0.0-rename-unsafe-allowUndoRedoButton-prop.ts} +0 -0
- package/dist/cjs/create-editor/ReactEditorView.js +3 -1
- package/dist/cjs/create-editor/create-plugins-list.js +9 -6
- package/dist/cjs/create-editor/messages.js +17 -0
- package/dist/cjs/i18n/en.js +2 -2
- package/dist/cjs/i18n/en_GB.js +2 -2
- package/dist/cjs/i18n/en_ZZ.js +2 -2
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/i18n/languages.js +9 -4
- package/dist/cjs/labs/next/presets/mobile.js +2 -2
- package/dist/cjs/labs/next/presets/preset.js +38 -6
- package/dist/cjs/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +6 -1
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -1
- package/dist/cjs/plugins/card/pm-plugins/doc.js +18 -29
- package/dist/cjs/plugins/card/pm-plugins/main.js +7 -21
- package/dist/cjs/plugins/card/toolbar.js +24 -8
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +9 -5
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +19 -53
- package/dist/cjs/plugins/card/utils.js +17 -3
- package/dist/cjs/plugins/collab-edit/actions.js +3 -3
- package/dist/cjs/plugins/copy-button/toolbar.js +5 -3
- package/dist/cjs/plugins/date/index.js +1 -7
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/cjs/plugins/emoji/index.js +7 -14
- package/dist/cjs/plugins/expand/pm-plugins/main.js +4 -1
- package/dist/cjs/plugins/expand/toolbar.js +1 -0
- package/dist/cjs/plugins/extension/commands.js +17 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/cjs/plugins/extension/toolbar.js +49 -7
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +99 -0
- package/dist/cjs/plugins/floating-toolbar/ui/ConfirmationModal.js +10 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +108 -55
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +51 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/cjs/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/cjs/plugins/floating-toolbar/utils.js +4 -19
- package/dist/cjs/plugins/help-dialog/index.js +3 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +20 -1
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +26 -12
- package/dist/cjs/plugins/layout/toolbar.js +1 -0
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +34 -4
- package/dist/cjs/plugins/list/commands/outdent-list.js +1 -1
- package/dist/cjs/plugins/list/index.js +6 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/cjs/plugins/list/pm-plugins/main.js +32 -10
- package/dist/cjs/plugins/media/index.js +35 -0
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +6 -0
- package/dist/cjs/plugins/media/toolbar/index.js +3 -0
- package/dist/cjs/plugins/media/utils/media-single.js +19 -3
- package/dist/cjs/plugins/panel/toolbar.js +1 -0
- package/dist/cjs/plugins/panel/utils.js +1 -1
- package/dist/cjs/plugins/paste/index.js +2 -1
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +19 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/paste/util/index.js +2 -2
- package/dist/cjs/plugins/placeholder/index.js +24 -47
- package/dist/cjs/plugins/placeholder/styles.js +2 -4
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +7 -3
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +10 -5
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +5 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -6
- package/dist/cjs/plugins/type-ahead/index.js +2 -8
- package/dist/cjs/plugins/type-ahead/messages.js +44 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +9 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/cjs/plugins/type-ahead/utils.js +44 -2
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -2
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -1
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/cjs/ui/CollapsedEditor/index.js +4 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -4
- package/dist/cjs/ui/ConfigPanel/FormContent.js +2 -1
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +3 -1
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +55 -33
- package/dist/cjs/utils/commands.js +25 -13
- package/dist/cjs/utils/input-rules.js +26 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -1
- package/dist/es2019/create-editor/create-plugins-list.js +9 -6
- package/dist/es2019/create-editor/messages.js +8 -0
- package/dist/es2019/i18n/en.js +2 -2
- package/dist/es2019/i18n/en_GB.js +2 -2
- package/dist/es2019/i18n/en_ZZ.js +2 -2
- package/dist/es2019/i18n/index.js +4 -4
- package/dist/es2019/i18n/languages.js +9 -4
- package/dist/es2019/labs/next/presets/mobile.js +2 -2
- package/dist/es2019/labs/next/presets/preset.js +28 -7
- package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -19
- package/dist/es2019/plugins/card/pm-plugins/main.js +4 -19
- package/dist/es2019/plugins/card/toolbar.js +19 -2
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -36
- package/dist/es2019/plugins/card/utils.js +15 -2
- package/dist/es2019/plugins/collab-edit/actions.js +3 -3
- package/dist/es2019/plugins/copy-button/toolbar.js +5 -3
- package/dist/es2019/plugins/date/index.js +0 -7
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/es2019/plugins/emoji/index.js +7 -13
- package/dist/es2019/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/expand/toolbar.js +1 -0
- package/dist/es2019/plugins/extension/commands.js +10 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/es2019/plugins/extension/toolbar.js +43 -8
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/es2019/plugins/floating-toolbar/index.js +15 -5
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +70 -0
- package/dist/es2019/plugins/floating-toolbar/ui/ConfirmationModal.js +8 -27
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +96 -50
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +29 -76
- package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +32 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +26 -46
- package/dist/es2019/plugins/floating-toolbar/ui/messages.js +14 -4
- package/dist/es2019/plugins/floating-toolbar/utils.js +4 -17
- package/dist/es2019/plugins/help-dialog/index.js +2 -2
- package/dist/es2019/plugins/hyperlink/Toolbar.js +18 -2
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/es2019/plugins/layout/toolbar.js +1 -0
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +24 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +1 -1
- package/dist/es2019/plugins/list/index.js +7 -3
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/es2019/plugins/list/pm-plugins/main.js +31 -11
- package/dist/es2019/plugins/media/index.js +38 -0
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +6 -5
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -0
- package/dist/es2019/plugins/media/toolbar/index.js +3 -0
- package/dist/es2019/plugins/media/utils/media-single.js +20 -3
- package/dist/es2019/plugins/panel/toolbar.js +1 -0
- package/dist/es2019/plugins/panel/utils.js +1 -1
- package/dist/es2019/plugins/paste/index.js +2 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/paste/util/index.js +2 -2
- package/dist/es2019/plugins/placeholder/index.js +21 -47
- package/dist/es2019/plugins/placeholder/styles.js +1 -19
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +8 -7
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +18 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/es2019/plugins/type-ahead/index.js +2 -2
- package/dist/es2019/plugins/type-ahead/messages.js +44 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/es2019/plugins/type-ahead/utils.js +38 -0
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/es2019/ui/CollapsedEditor/index.js +3 -2
- package/dist/es2019/ui/ColorPickerButton/index.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/es2019/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/es2019/ui/ContentStyles/index.js +7 -2
- package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/es2019/utils/commands.js +26 -14
- package/dist/es2019/utils/input-rules.js +22 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -1
- package/dist/esm/create-editor/create-plugins-list.js +9 -6
- package/dist/esm/create-editor/messages.js +8 -0
- package/dist/esm/i18n/en.js +2 -2
- package/dist/esm/i18n/en_GB.js +2 -2
- package/dist/esm/i18n/en_ZZ.js +2 -2
- package/dist/esm/i18n/index.js +4 -4
- package/dist/esm/i18n/languages.js +9 -4
- package/dist/esm/labs/next/presets/mobile.js +2 -2
- package/dist/esm/labs/next/presets/preset.js +36 -6
- package/dist/esm/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +10 -20
- package/dist/esm/plugins/card/pm-plugins/main.js +4 -17
- package/dist/esm/plugins/card/toolbar.js +24 -8
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +9 -39
- package/dist/esm/plugins/card/utils.js +15 -2
- package/dist/esm/plugins/collab-edit/actions.js +3 -3
- package/dist/esm/plugins/copy-button/toolbar.js +5 -3
- package/dist/esm/plugins/date/index.js +1 -6
- package/dist/esm/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/esm/plugins/emoji/index.js +7 -13
- package/dist/esm/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/expand/toolbar.js +1 -0
- package/dist/esm/plugins/extension/commands.js +12 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/esm/plugins/extension/toolbar.js +50 -8
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/esm/plugins/floating-toolbar/index.js +16 -4
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +75 -0
- package/dist/esm/plugins/floating-toolbar/ui/ConfirmationModal.js +11 -25
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +100 -47
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +30 -0
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/esm/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/esm/plugins/floating-toolbar/utils.js +4 -17
- package/dist/esm/plugins/help-dialog/index.js +3 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +20 -2
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -3
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/esm/plugins/layout/toolbar.js +1 -0
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +30 -4
- package/dist/esm/plugins/list/commands/outdent-list.js +1 -1
- package/dist/esm/plugins/list/index.js +7 -3
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/esm/plugins/list/pm-plugins/main.js +31 -11
- package/dist/esm/plugins/media/index.js +33 -0
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -0
- package/dist/esm/plugins/media/toolbar/index.js +3 -0
- package/dist/esm/plugins/media/utils/media-single.js +18 -3
- package/dist/esm/plugins/panel/toolbar.js +1 -0
- package/dist/esm/plugins/panel/utils.js +1 -1
- package/dist/esm/plugins/paste/index.js +2 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/paste/util/index.js +2 -2
- package/dist/esm/plugins/placeholder/index.js +23 -45
- package/dist/esm/plugins/placeholder/styles.js +1 -2
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +9 -5
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/esm/plugins/type-ahead/index.js +2 -2
- package/dist/esm/plugins/type-ahead/messages.js +44 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/esm/plugins/type-ahead/utils.js +38 -0
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/esm/ui/CollapsedEditor/index.js +3 -2
- package/dist/esm/ui/ColorPickerButton/index.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/esm/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/esm/utils/commands.js +25 -13
- package/dist/esm/utils/input-rules.js +23 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/messages.d.ts +7 -0
- package/dist/types/i18n/index.d.ts +4 -4
- package/dist/types/i18n/languages.d.ts +8 -3
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -2
- package/dist/types/labs/next/presets/mobile.d.ts +1 -1
- package/dist/types/labs/next/presets/preset.d.ts +10 -6
- package/dist/types/plugins/alignment/index.d.ts +2 -2
- package/dist/types/plugins/analytics/plugin.d.ts +2 -2
- package/dist/types/plugins/annotation/index.d.ts +2 -2
- package/dist/types/plugins/avatar-group/index.d.ts +4 -3
- package/dist/types/plugins/base/index.d.ts +2 -2
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +4 -3
- package/dist/types/plugins/block-type/index.d.ts +2 -2
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -1
- package/dist/types/plugins/breakout/index.d.ts +2 -2
- package/dist/types/plugins/caption/index.d.ts +2 -2
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +4 -4
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +5 -5
- package/dist/types/plugins/card/utils.d.ts +2 -1
- package/dist/types/plugins/clear-marks-on-change-to-empty-document/index.d.ts +2 -2
- package/dist/types/plugins/clipboard/index.d.ts +2 -2
- package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -3
- package/dist/types/plugins/code-block/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +2 -2
- package/dist/types/plugins/context-panel/index.d.ts +2 -2
- package/dist/types/plugins/copy-button/index.d.ts +2 -2
- package/dist/types/plugins/custom-autoformat/index.d.ts +2 -2
- package/dist/types/plugins/data-consumer/index.d.ts +2 -2
- package/dist/types/plugins/date/index.d.ts +2 -2
- package/dist/types/plugins/date/ui/DatePicker/index.d.ts +0 -1
- package/dist/types/plugins/editor-disabled/index.d.ts +2 -2
- package/dist/types/plugins/emoji/index.d.ts +2 -2
- package/dist/types/plugins/emoji/types.d.ts +2 -1
- package/dist/types/plugins/expand/index.d.ts +2 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/extension/commands.d.ts +2 -0
- package/dist/types/plugins/extension/index.d.ts +2 -2
- package/dist/types/plugins/extension/toolbar.d.ts +10 -0
- package/dist/types/plugins/fake-text-cursor/index.d.ts +2 -2
- package/dist/types/plugins/feature-flags-context/index.d.ts +2 -2
- package/dist/types/plugins/feedback-dialog/index.d.ts +3 -2
- package/dist/types/plugins/find-replace/index.d.ts +4 -3
- package/dist/types/plugins/floating-toolbar/index.d.ts +2 -2
- package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +1 -8
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +3 -0
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/messages.d.ts +10 -0
- package/dist/types/plugins/floating-toolbar/ui/types.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/utils.d.ts +2 -3
- package/dist/types/plugins/fragment/index.d.ts +2 -2
- package/dist/types/plugins/grid/index.d.ts +2 -2
- package/dist/types/plugins/help-dialog/index.d.ts +2 -3
- package/dist/types/plugins/history/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
- package/dist/types/plugins/image-upload/index.d.ts +2 -2
- package/dist/types/plugins/indentation/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
- package/dist/types/plugins/jira-issue/index.d.ts +2 -2
- package/dist/types/plugins/layout/index.d.ts +2 -2
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -2
- package/dist/types/plugins/list/index.d.ts +3 -2
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +3 -1
- package/dist/types/plugins/list/pm-plugins/main.d.ts +2 -2
- package/dist/types/plugins/list/types.d.ts +2 -0
- package/dist/types/plugins/macro/index.d.ts +2 -2
- package/dist/types/plugins/max-content-size/index.d.ts +2 -2
- package/dist/types/plugins/media/index.d.ts +2 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/mentions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +2 -2
- package/dist/types/plugins/panel/index.d.ts +2 -2
- package/dist/types/plugins/paste/index.d.ts +3 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
- package/dist/types/plugins/placeholder/index.d.ts +4 -4
- package/dist/types/plugins/placeholder/styles.d.ts +0 -1
- package/dist/types/plugins/placeholder-text/index.d.ts +2 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -2
- package/dist/types/plugins/rule/index.d.ts +2 -2
- package/dist/types/plugins/save-on-enter/index.d.ts +3 -2
- package/dist/types/plugins/scroll-into-view/index.d.ts +2 -2
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/status/index.d.ts +2 -2
- package/dist/types/plugins/submit-editor/index.d.ts +4 -2
- package/dist/types/plugins/tasks-and-decisions/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/plugins/text-formatting/index.d.ts +2 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +4 -3
- package/dist/types/plugins/type-ahead/index.d.ts +2 -2
- package/dist/types/plugins/type-ahead/messages.d.ts +41 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +3 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +7 -1
- package/dist/types/plugins/undo-redo/index.d.ts +2 -2
- package/dist/types/plugins/unsupported-content/index.d.ts +2 -2
- package/dist/types/plugins/view-update-subscription/index.d.ts +2 -2
- package/dist/types/plugins/width/index.d.ts +2 -2
- package/dist/types/test-utils.d.ts +2 -1
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +0 -2
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/Fields/Fieldset.d.ts +2 -1
- package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -23
- package/dist/types/ui/ConfigPanel/types.d.ts +22 -0
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +1 -0
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +4 -1
- package/package.json +24 -24
- package/report.api.md +25 -16
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +0 -181
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -66
- package/dist/cjs/plugins/emoji/ui/EmojiContextProvider/index.js +0 -61
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +0 -151
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/es2019/plugins/emoji/ui/EmojiContextProvider/index.js +0 -21
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +0 -161
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/esm/plugins/emoji/ui/EmojiContextProvider/index.js +0 -46
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +0 -25
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +0 -5
- package/dist/types/plugins/emoji/ui/EmojiContextProvider/index.d.ts +0 -13
|
@@ -23,7 +23,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
23
23
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
24
24
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
25
25
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
26
|
-
import { compareArrays, getFirstFocusableElement,
|
|
26
|
+
import { compareArrays, getFirstFocusableElement, shallowEqual } from '../utils';
|
|
27
27
|
import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
28
28
|
import Button from './Button';
|
|
29
29
|
import Dropdown from './Dropdown';
|
|
@@ -39,6 +39,7 @@ import messages from './messages';
|
|
|
39
39
|
import { token } from '@atlaskit/tokens';
|
|
40
40
|
import { decorationStateKey, ACTIONS } from '../../base/pm-plugins/decoration';
|
|
41
41
|
import ScrollButtons from './ScrollButtons';
|
|
42
|
+
import { ToolbarArrowKeyNavigationProvider } from '../../../ui/ToolbarArrowKeyNavigationProvider';
|
|
42
43
|
var akGridSize = gridSize();
|
|
43
44
|
var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
44
45
|
var items = _ref.items,
|
|
@@ -67,6 +68,10 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
67
68
|
dispatchCommand(showConfirmDialog(idx));
|
|
68
69
|
} else {
|
|
69
70
|
dispatchCommand(item.onClick);
|
|
71
|
+
|
|
72
|
+
if (item.focusEditoronEnter && !(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
73
|
+
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
74
|
+
}
|
|
70
75
|
}
|
|
71
76
|
};
|
|
72
77
|
|
|
@@ -140,6 +145,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
140
145
|
scrollableElement: popupsScrollableElement,
|
|
141
146
|
dropdownWidth: item.dropdownWidth,
|
|
142
147
|
showSelected: item.showSelected,
|
|
148
|
+
buttonTestId: item.testId,
|
|
149
|
+
editorView: editorView,
|
|
143
150
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined
|
|
144
151
|
});
|
|
145
152
|
|
|
@@ -338,56 +345,25 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
338
345
|
}
|
|
339
346
|
});
|
|
340
347
|
|
|
341
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
348
|
+
_defineProperty(_assertThisInitialized(_this), "shouldHandleArrowKeys", function () {
|
|
342
349
|
var _this$props$items;
|
|
343
350
|
|
|
344
|
-
//To prevent the keydown
|
|
345
|
-
|
|
351
|
+
//To prevent the keydown handling of arrow keys for custom toolbar items with 'disableArrowNavigation' prop enabled,
|
|
352
|
+
//Usually the button which has menus or popups
|
|
353
|
+
return !((_this$props$items = _this.props.items) !== null && _this$props$items !== void 0 && _this$props$items.find(function (item) {
|
|
346
354
|
return item.type === 'custom' && item.disableArrowNavigation;
|
|
347
|
-
}))
|
|
348
|
-
|
|
349
|
-
}
|
|
355
|
+
}));
|
|
356
|
+
});
|
|
350
357
|
|
|
351
|
-
|
|
358
|
+
_defineProperty(_assertThisInitialized(_this), "handleEscape", function (event) {
|
|
359
|
+
//If any dropdown is open inside the floating toolbar 'Esc' key should not
|
|
360
|
+
//focus the editorview. The event cannot be stopped as dropdown is not childnode of floating toolbar
|
|
361
|
+
if (!document.querySelector('[data-role="droplistContent"]')) {
|
|
352
362
|
var _this$props$editorVie;
|
|
353
363
|
|
|
354
|
-
_this.currentSelectedItemIndex = 0;
|
|
355
364
|
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
|
|
356
365
|
event.preventDefault();
|
|
357
366
|
event.stopPropagation();
|
|
358
|
-
} else {
|
|
359
|
-
var _this$toolbarContaine2, _this$toolbarContaine3, _this$toolbarContaine4;
|
|
360
|
-
|
|
361
|
-
//To trap the focus inside the toolbar using left and right arrow keys
|
|
362
|
-
var focusableElements = getFocusableElements((_this$toolbarContaine2 = _this.toolbarContainerRef) === null || _this$toolbarContaine2 === void 0 ? void 0 : _this$toolbarContaine2.current);
|
|
363
|
-
var firstFocsuableElement = getFirstFocusableElement((_this$toolbarContaine3 = _this.toolbarContainerRef) === null || _this$toolbarContaine3 === void 0 ? void 0 : _this$toolbarContaine3.current);
|
|
364
|
-
var lastFocsuableElement = getLastFocusableElement((_this$toolbarContaine4 = _this.toolbarContainerRef) === null || _this$toolbarContaine4 === void 0 ? void 0 : _this$toolbarContaine4.current);
|
|
365
|
-
|
|
366
|
-
if (!focusableElements || focusableElements.length === 0) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (event.key === 'ArrowRight') {
|
|
371
|
-
if (_this.currentSelectedItemIndex === focusableElements.length - 1) {
|
|
372
|
-
firstFocsuableElement === null || firstFocsuableElement === void 0 ? void 0 : firstFocsuableElement.focus();
|
|
373
|
-
_this.currentSelectedItemIndex = 0;
|
|
374
|
-
} else {
|
|
375
|
-
var _focusableElements;
|
|
376
|
-
|
|
377
|
-
(_focusableElements = focusableElements[_this.currentSelectedItemIndex + 1]) === null || _focusableElements === void 0 ? void 0 : _focusableElements.focus();
|
|
378
|
-
_this.currentSelectedItemIndex++;
|
|
379
|
-
}
|
|
380
|
-
} else if (event.key === 'ArrowLeft') {
|
|
381
|
-
if (_this.currentSelectedItemIndex === 0) {
|
|
382
|
-
lastFocsuableElement === null || lastFocsuableElement === void 0 ? void 0 : lastFocsuableElement.focus();
|
|
383
|
-
_this.currentSelectedItemIndex = focusableElements.length - 1;
|
|
384
|
-
} else {
|
|
385
|
-
var _focusableElements2;
|
|
386
|
-
|
|
387
|
-
(_focusableElements2 = focusableElements[_this.currentSelectedItemIndex - 1]) === null || _focusableElements2 === void 0 ? void 0 : _focusableElements2.focus();
|
|
388
|
-
_this.currentSelectedItemIndex--;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
367
|
}
|
|
392
368
|
});
|
|
393
369
|
|
|
@@ -398,7 +374,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
398
374
|
scrollDisabled: false,
|
|
399
375
|
mounted: false
|
|
400
376
|
};
|
|
401
|
-
_this.currentSelectedItemIndex = 0;
|
|
402
377
|
return _this;
|
|
403
378
|
} // remove any decorations added by toolbar buttons i.e danger and selected styling
|
|
404
379
|
// this prevents https://product-fabric.atlassian.net/browse/ED-10207
|
|
@@ -491,7 +466,12 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
491
466
|
var hasSelect = items.find(function (item) {
|
|
492
467
|
return item.type === 'select' && item.selectType === 'list';
|
|
493
468
|
});
|
|
494
|
-
return jsx(React.Fragment, null, jsx(
|
|
469
|
+
return jsx(React.Fragment, null, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
470
|
+
editorView: this.props.editorView,
|
|
471
|
+
handleEscape: this.handleEscape,
|
|
472
|
+
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
473
|
+
childComponentSelector: "[data-testid='editor-floating-toolbar']"
|
|
474
|
+
}, jsx("div", {
|
|
495
475
|
ref: this.toolbarContainerRef,
|
|
496
476
|
css: function css(theme) {
|
|
497
477
|
return [toolbarContainer({
|
|
@@ -500,8 +480,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
500
480
|
},
|
|
501
481
|
"aria-label": intl.formatMessage(messages.floatingToolbarAriaLabel),
|
|
502
482
|
role: "toolbar",
|
|
503
|
-
|
|
504
|
-
|
|
483
|
+
"data-testid": "editor-floating-toolbar",
|
|
484
|
+
className: className
|
|
505
485
|
}, jsx(Announcer, {
|
|
506
486
|
text: intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
507
487
|
delay: 250
|
|
@@ -519,7 +499,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
519
499
|
disabled: this.state.scrollDisabled
|
|
520
500
|
})), jsx("div", {
|
|
521
501
|
ref: this.mountRef
|
|
522
|
-
}));
|
|
502
|
+
})));
|
|
523
503
|
}
|
|
524
504
|
}]);
|
|
525
505
|
|
|
@@ -15,6 +15,16 @@ export default defineMessages({
|
|
|
15
15
|
defaultMessage: 'Cancel',
|
|
16
16
|
description: 'Cancel button for floating toolbar confirmation modal.'
|
|
17
17
|
},
|
|
18
|
+
confirmModalListUnit: {
|
|
19
|
+
id: 'fabric.editor.floatingToolbar.confirmModalConnectedUnit',
|
|
20
|
+
defaultMessage: '{name}{amount, plural, =0 {} one { (+1 connected element)} other { (+# connected elements)}}',
|
|
21
|
+
description: 'Text displayed in confirmation modal which highlights the nodes and the amount of connected nodes that will be deleted'
|
|
22
|
+
},
|
|
23
|
+
confirmDeleteLinkedModalMessage: {
|
|
24
|
+
id: 'fabric.editor.extension.confirmDeleteLinkedModalMessage',
|
|
25
|
+
defaultMessage: 'Deleting {nodeName} will break anything connected to it.',
|
|
26
|
+
description: 'Message for confirm modal when deleting a extension linked to an data consumer.'
|
|
27
|
+
},
|
|
18
28
|
floatingToolbarAriaLabel: {
|
|
19
29
|
id: 'fabric.editor.floatingToolbar.floatingToolbarAriaLabel',
|
|
20
30
|
defaultMessage: 'Floating Toolbar',
|
|
@@ -23,16 +33,16 @@ export default defineMessages({
|
|
|
23
33
|
floatingToolbarAnnouncer: {
|
|
24
34
|
id: 'fabric.editor.floatingToolbar.floatingToolbarAnnouncer',
|
|
25
35
|
defaultMessage: 'Floating toolbar controls have been opened',
|
|
26
|
-
description:
|
|
36
|
+
description: 'message that will be announced to screenreaders that the floating toolbar is opened'
|
|
27
37
|
},
|
|
28
38
|
floatingToolbarScrollLeft: {
|
|
29
39
|
id: 'fabric.editor.floatingToolbar.scrollLeft',
|
|
30
40
|
defaultMessage: 'Scroll left',
|
|
31
|
-
description:
|
|
41
|
+
description: 'Button to scroll left when the toolbar is in the overflow state'
|
|
32
42
|
},
|
|
33
43
|
floatingToolbarScrollRight: {
|
|
34
44
|
id: 'fabric.editor.floatingToolbar.scrollRight',
|
|
35
45
|
defaultMessage: 'Scroll right',
|
|
36
|
-
description:
|
|
46
|
+
description: 'Button to scroll right when the toolbar is in the overflow state'
|
|
37
47
|
}
|
|
38
48
|
});
|
|
@@ -63,27 +63,14 @@ export function findNode(parent, predicate) {
|
|
|
63
63
|
});
|
|
64
64
|
return matchedNode;
|
|
65
65
|
}
|
|
66
|
-
export function getFirstFocusableElement(rootNode) {
|
|
67
|
-
if (!rootNode) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
72
|
-
return focusableModalElements[0];
|
|
73
|
-
}
|
|
74
66
|
export function getFocusableElements(rootNode) {
|
|
75
67
|
if (!rootNode) {
|
|
76
|
-
return;
|
|
68
|
+
return [];
|
|
77
69
|
}
|
|
78
70
|
|
|
79
71
|
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
80
|
-
return focusableModalElements;
|
|
72
|
+
return Array.from(focusableModalElements) || [];
|
|
81
73
|
}
|
|
82
|
-
export function
|
|
83
|
-
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
88
|
-
return focusableModalElements[focusableModalElements.length - 1];
|
|
74
|
+
export function getFirstFocusableElement(rootNode) {
|
|
75
|
+
return getFocusableElements(rootNode)[0];
|
|
89
76
|
}
|
|
@@ -46,7 +46,8 @@ export function createPlugin(dispatch, imageEnabled) {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
var helpDialog = function helpDialog(
|
|
49
|
+
var helpDialog = function helpDialog() {
|
|
50
|
+
var imageUploadProviderExists = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
50
51
|
return {
|
|
51
52
|
name: 'helpDialog',
|
|
52
53
|
pmPlugins: function pmPlugins() {
|
|
@@ -54,7 +55,7 @@ var helpDialog = function helpDialog(legacyImageUploadProvider) {
|
|
|
54
55
|
name: 'helpDialog',
|
|
55
56
|
plugin: function plugin(_ref) {
|
|
56
57
|
var dispatch = _ref.dispatch;
|
|
57
|
-
return createPlugin(dispatch,
|
|
58
|
+
return createPlugin(dispatch, imageUploadProviderExists);
|
|
58
59
|
}
|
|
59
60
|
}, {
|
|
60
61
|
name: 'helpDialogKeymap',
|
|
@@ -15,7 +15,7 @@ import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
|
15
15
|
import { normalizeUrl } from './utils';
|
|
16
16
|
import { linkToolbarMessages as linkToolbarCommonMessages, linkMessages } from '../../messages';
|
|
17
17
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
18
|
-
import { RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '../../ui/LinkSearch/ToolbarComponents';
|
|
18
|
+
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '../../ui/LinkSearch/ToolbarComponents';
|
|
19
19
|
import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
20
20
|
import { addAnalytics, ACTION_SUBJECT_ID } from '../analytics';
|
|
21
21
|
import { buildVisitedLinkPayload, buildOpenedSettingsPayload } from '../../utils/linking-utils';
|
|
@@ -85,6 +85,16 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
85
85
|
return function (state, intl, providerFactory) {
|
|
86
86
|
var formatMessage = intl.formatMessage;
|
|
87
87
|
var linkState = stateKey.getState(state);
|
|
88
|
+
/**
|
|
89
|
+
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
var _getFeatureFlags2 = getFeatureFlags(state),
|
|
93
|
+
lpLinkPicker = _getFeatureFlags2.lpLinkPicker,
|
|
94
|
+
lpLinkPickerFocusTrap = _getFeatureFlags2.lpLinkPickerFocusTrap,
|
|
95
|
+
preventPopupOverflow = _getFeatureFlags2.preventPopupOverflow;
|
|
96
|
+
|
|
97
|
+
var shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
88
98
|
|
|
89
99
|
if (linkState && linkState.activeLinkMark) {
|
|
90
100
|
var activeLinkMark = linkState.activeLinkMark;
|
|
@@ -189,6 +199,8 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
189
199
|
case 'EDIT_INSERTED':
|
|
190
200
|
case 'INSERT':
|
|
191
201
|
{
|
|
202
|
+
var _options$linkPicker, _options$linkPicker$p;
|
|
203
|
+
|
|
192
204
|
var _link;
|
|
193
205
|
|
|
194
206
|
if (isEditLink(activeLinkMark) && activeLinkMark.node) {
|
|
@@ -200,9 +212,12 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
200
212
|
}
|
|
201
213
|
|
|
202
214
|
var displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
|
|
215
|
+
var popupHeight = lpLinkPicker && Boolean(options === null || options === void 0 ? void 0 : (_options$linkPicker = options.linkPicker) === null || _options$linkPicker === void 0 ? void 0 : (_options$linkPicker$p = _options$linkPicker.plugins) === null || _options$linkPicker$p === void 0 ? void 0 : _options$linkPicker$p.length) ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX;
|
|
203
216
|
return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
|
|
204
|
-
|
|
217
|
+
preventPopupOverflow: preventPopupOverflow,
|
|
218
|
+
height: popupHeight,
|
|
205
219
|
width: RECENT_SEARCH_WIDTH_IN_PX,
|
|
220
|
+
focusTrap: shouldEnableFocusTrap,
|
|
206
221
|
items: [{
|
|
207
222
|
type: 'custom',
|
|
208
223
|
fallback: [],
|
|
@@ -219,6 +234,9 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
219
234
|
displayUrl: _link,
|
|
220
235
|
displayText: displayText || '',
|
|
221
236
|
providerFactory: providerFactory,
|
|
237
|
+
onCancel: function onCancel() {
|
|
238
|
+
return view.focus();
|
|
239
|
+
},
|
|
222
240
|
onSubmit: function onSubmit(href) {
|
|
223
241
|
var _options$cardOptions;
|
|
224
242
|
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["view"];
|
|
3
|
+
var _excluded = ["view", "onCancel"];
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { LinkPicker } from '@atlaskit/link-picker';
|
|
6
6
|
import { hideLinkToolbar as cardHideLinkToolbar } from '../../../card/pm-plugins/actions';
|
|
7
7
|
import { hideLinkToolbar } from '../../commands';
|
|
8
8
|
import { useEscapeClickaway } from './useEscapeClickaway';
|
|
9
|
+
/**
|
|
10
|
+
* Returns a type that matches T but where keys (K) are now optional
|
|
11
|
+
*/
|
|
12
|
+
|
|
9
13
|
export var EditorLinkPicker = function EditorLinkPicker(_ref) {
|
|
10
14
|
var view = _ref.view,
|
|
15
|
+
onCancel = _ref.onCancel,
|
|
11
16
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
12
17
|
|
|
13
18
|
var onEscape = useCallback(function () {
|
|
14
19
|
hideLinkToolbar()(view.state, view.dispatch);
|
|
15
20
|
view.dispatch(cardHideLinkToolbar(view.state.tr));
|
|
16
|
-
|
|
21
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
22
|
+
}, [view, onCancel]);
|
|
17
23
|
var onClickAway = useCallback(function () {
|
|
18
24
|
hideLinkToolbar()(view.state, view.dispatch);
|
|
19
|
-
|
|
25
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
26
|
+
}, [view, onCancel]);
|
|
20
27
|
var ref = useEscapeClickaway(onEscape, onClickAway);
|
|
21
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
22
29
|
ref: ref
|
|
@@ -53,7 +53,8 @@ var HyperlinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
53
53
|
displayText = _this$props.displayText,
|
|
54
54
|
displayUrl = _this$props.displayUrl,
|
|
55
55
|
providerFactory = _this$props.providerFactory,
|
|
56
|
-
view = _this$props.view
|
|
56
|
+
view = _this$props.view,
|
|
57
|
+
onCancel = _this$props.onCancel;
|
|
57
58
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
58
59
|
providers: ['activityProvider', 'searchProvider'],
|
|
59
60
|
providerFactory: providerFactory,
|
|
@@ -66,25 +67,19 @@ var HyperlinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
67
|
hyperlinkPluginState: pluginKey
|
|
67
68
|
},
|
|
68
69
|
render: function render(_ref3) {
|
|
69
|
-
var _linkPickerOptions$pl;
|
|
70
|
-
|
|
71
70
|
var hyperlinkPluginState = _ref3.hyperlinkPluginState;
|
|
72
71
|
|
|
73
72
|
var _getFeatureFlags = getFeatureFlags(view.state),
|
|
74
73
|
lpLinkPicker = _getFeatureFlags.lpLinkPicker;
|
|
75
|
-
/**
|
|
76
|
-
* If activityProvider or searchProvider are present then only enable if there are plugins supplied to
|
|
77
|
-
* faciliate providing link search capabilities
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
74
|
|
|
81
|
-
if (lpLinkPicker
|
|
75
|
+
if (lpLinkPicker) {
|
|
82
76
|
return /*#__PURE__*/React.createElement(EditorLinkPicker, _extends({
|
|
83
77
|
view: view
|
|
84
78
|
}, linkPickerOptions, {
|
|
85
79
|
url: displayUrl,
|
|
86
80
|
displayText: displayText,
|
|
87
|
-
onSubmit: onSubmitInterface(onSubmit)
|
|
81
|
+
onSubmit: onSubmitInterface(onSubmit),
|
|
82
|
+
onCancel: onCancel
|
|
88
83
|
}));
|
|
89
84
|
}
|
|
90
85
|
|
|
@@ -27,7 +27,8 @@ export var DropDownButton = /*#__PURE__*/React.memo(function (props) {
|
|
|
27
27
|
spacing: props.spacing,
|
|
28
28
|
"aria-expanded": props['aria-expanded'],
|
|
29
29
|
"aria-haspopup": props['aria-haspopup'],
|
|
30
|
-
"aria-
|
|
30
|
+
"aria-keyshortcuts": props['aria-keyshortcuts'],
|
|
31
|
+
"aria-label": "".concat(props.label, " /"),
|
|
31
32
|
iconBefore: jsx(DropDownButtonIcon, {
|
|
32
33
|
label: ""
|
|
33
34
|
}),
|
|
@@ -536,6 +536,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
536
536
|
}, buttons.map(function (btn) {
|
|
537
537
|
return jsx(ToolbarButton, {
|
|
538
538
|
item: btn,
|
|
539
|
+
testId: String(btn.content),
|
|
539
540
|
ref: btn.value.name === 'emoji' ? _this2.handleEmojiButtonRef : noop,
|
|
540
541
|
key: btn.value.name,
|
|
541
542
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -545,6 +546,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
545
546
|
title: btn.title,
|
|
546
547
|
"aria-label": btn['aria-label'],
|
|
547
548
|
"aria-haspopup": btn['aria-haspopup'],
|
|
549
|
+
"aria-keyshortcuts": btn['aria-keyshortcuts'],
|
|
548
550
|
onItemClick: _this2.insertToolbarMenuItem
|
|
549
551
|
});
|
|
550
552
|
}), jsx("span", {
|
|
@@ -22,6 +22,7 @@ import QuoteIcon from '@atlaskit/icon/glyph/quote';
|
|
|
22
22
|
import { shortcutStyle } from '../../../../ui/styles';
|
|
23
23
|
import { tooltip, addLink, toggleTable } from '../../../../keymaps';
|
|
24
24
|
import { shallowEquals } from './shallow-equals';
|
|
25
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
25
26
|
|
|
26
27
|
var from = function from(init) {
|
|
27
28
|
return {
|
|
@@ -36,8 +37,9 @@ var from = function from(init) {
|
|
|
36
37
|
elemAfter: init.shortcut ? jsx("div", {
|
|
37
38
|
css: shortcutStyle
|
|
38
39
|
}, init.shortcut) : undefined,
|
|
39
|
-
'aria-label': init.content,
|
|
40
|
+
'aria-label': init.shortcut ? init.content + ' ' + init.shortcut : init.content,
|
|
40
41
|
'aria-haspopup': init['aria-haspopup'],
|
|
42
|
+
'aria-keyshortcuts': init['aria-keyshortcuts'],
|
|
41
43
|
shortcut: init.shortcut,
|
|
42
44
|
isDisabled: init.disabled
|
|
43
45
|
};
|
|
@@ -54,7 +56,8 @@ export var action = mem(function (init) {
|
|
|
54
56
|
disabled: init.disabled,
|
|
55
57
|
name: 'action',
|
|
56
58
|
shortcut: '[]',
|
|
57
|
-
Icon: TaskIcon
|
|
59
|
+
Icon: TaskIcon,
|
|
60
|
+
'aria-keyshortcuts': '[ ] Space'
|
|
58
61
|
});
|
|
59
62
|
});
|
|
60
63
|
export var link = mem(function (init) {
|
|
@@ -65,7 +68,8 @@ export var link = mem(function (init) {
|
|
|
65
68
|
name: 'link',
|
|
66
69
|
shortcut: tooltip(addLink),
|
|
67
70
|
Icon: LinkIcon,
|
|
68
|
-
'aria-haspopup': init['aria-haspopup']
|
|
71
|
+
'aria-haspopup': init['aria-haspopup'],
|
|
72
|
+
'aria-keyshortcuts': getAriaKeyshortcuts(addLink)
|
|
69
73
|
});
|
|
70
74
|
});
|
|
71
75
|
export var media = mem(function (init) {
|
|
@@ -94,7 +98,8 @@ export var mention = mem(function (init) {
|
|
|
94
98
|
name: 'mention',
|
|
95
99
|
Icon: MentionIcon,
|
|
96
100
|
shortcut: '@',
|
|
97
|
-
'aria-haspopup': init['aria-haspopup']
|
|
101
|
+
'aria-haspopup': init['aria-haspopup'],
|
|
102
|
+
'aria-keyshortcuts': 'Shift+2 Space'
|
|
98
103
|
});
|
|
99
104
|
});
|
|
100
105
|
export var emoji = mem(function (init) {
|
|
@@ -105,7 +110,8 @@ export var emoji = mem(function (init) {
|
|
|
105
110
|
name: 'emoji',
|
|
106
111
|
Icon: EmojiIcon,
|
|
107
112
|
shortcut: ':',
|
|
108
|
-
'aria-haspopup': init['aria-haspopup']
|
|
113
|
+
'aria-haspopup': init['aria-haspopup'],
|
|
114
|
+
'aria-keyshortcuts': 'Shift+;'
|
|
109
115
|
});
|
|
110
116
|
});
|
|
111
117
|
export var table = mem(function (init) {
|
|
@@ -115,7 +121,8 @@ export var table = mem(function (init) {
|
|
|
115
121
|
disabled: init.disabled,
|
|
116
122
|
name: 'table',
|
|
117
123
|
Icon: TableIcon,
|
|
118
|
-
shortcut: tooltip(toggleTable)
|
|
124
|
+
shortcut: tooltip(toggleTable),
|
|
125
|
+
'aria-keyshortcuts': getAriaKeyshortcuts(toggleTable)
|
|
119
126
|
});
|
|
120
127
|
});
|
|
121
128
|
export var layout = mem(function (init) {
|
|
@@ -134,7 +141,8 @@ export var codeblock = mem(function (init) {
|
|
|
134
141
|
disabled: init.disabled,
|
|
135
142
|
name: 'codeblock',
|
|
136
143
|
Icon: CodeIcon,
|
|
137
|
-
shortcut: init.shortcut
|
|
144
|
+
shortcut: init.shortcut,
|
|
145
|
+
'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
|
|
138
146
|
});
|
|
139
147
|
});
|
|
140
148
|
export var panel = mem(function (init) {
|
|
@@ -144,7 +152,8 @@ export var panel = mem(function (init) {
|
|
|
144
152
|
disabled: init.disabled,
|
|
145
153
|
name: 'panel',
|
|
146
154
|
Icon: InfoIcon,
|
|
147
|
-
shortcut: init.shortcut
|
|
155
|
+
shortcut: init.shortcut,
|
|
156
|
+
'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
|
|
148
157
|
});
|
|
149
158
|
});
|
|
150
159
|
export var blockquote = mem(function (init) {
|
|
@@ -154,7 +163,8 @@ export var blockquote = mem(function (init) {
|
|
|
154
163
|
disabled: init.disabled,
|
|
155
164
|
name: 'blockquote',
|
|
156
165
|
Icon: QuoteIcon,
|
|
157
|
-
shortcut: init.shortcut
|
|
166
|
+
shortcut: init.shortcut,
|
|
167
|
+
'aria-keyshortcuts': 'Shift+. Space'
|
|
158
168
|
});
|
|
159
169
|
});
|
|
160
170
|
export var decision = mem(function (init) {
|
|
@@ -164,7 +174,8 @@ export var decision = mem(function (init) {
|
|
|
164
174
|
disabled: init.disabled,
|
|
165
175
|
name: 'decision',
|
|
166
176
|
Icon: DecisionIcon,
|
|
167
|
-
shortcut: '<>'
|
|
177
|
+
shortcut: '<>',
|
|
178
|
+
'aria-keyshortcuts': 'Shift+, Shift+. Space'
|
|
168
179
|
});
|
|
169
180
|
});
|
|
170
181
|
export var horizontalrule = mem(function (init) {
|
|
@@ -174,7 +185,8 @@ export var horizontalrule = mem(function (init) {
|
|
|
174
185
|
disabled: init.disabled,
|
|
175
186
|
name: 'horizontalrule',
|
|
176
187
|
Icon: HorizontalRuleIcon,
|
|
177
|
-
shortcut: '---'
|
|
188
|
+
shortcut: '---',
|
|
189
|
+
'aria-keyshortcuts': '- - -'
|
|
178
190
|
});
|
|
179
191
|
});
|
|
180
192
|
export var expand = mem(function (init) {
|
|
@@ -193,7 +205,8 @@ export var date = mem(function (init) {
|
|
|
193
205
|
disabled: init.disabled,
|
|
194
206
|
name: 'date',
|
|
195
207
|
Icon: DateIcon,
|
|
196
|
-
shortcut: '//'
|
|
208
|
+
shortcut: '//',
|
|
209
|
+
'aria-keyshortcuts': '/ / Enter'
|
|
197
210
|
});
|
|
198
211
|
});
|
|
199
212
|
export var placeholder = mem(function (init) {
|
|
@@ -72,6 +72,7 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
|
|
|
72
72
|
id: 'editor.layout.delete',
|
|
73
73
|
type: 'button',
|
|
74
74
|
appearance: 'danger',
|
|
75
|
+
focusEditoronEnter: true,
|
|
75
76
|
icon: RemoveIcon,
|
|
76
77
|
testId: commonMessages.remove.id,
|
|
77
78
|
title: intl.formatMessage(commonMessages.remove),
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
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
|
+
|
|
1
7
|
import { Selection, TextSelection, NodeSelection } from 'prosemirror-state';
|
|
2
8
|
import { NodeRange, Slice, Fragment } from 'prosemirror-model';
|
|
3
9
|
import { liftTarget, ReplaceAroundStep, ReplaceStep } from 'prosemirror-transform';
|
|
10
|
+
import { getOrderFromOrderedListNode } from '@atlaskit/editor-common/utils';
|
|
4
11
|
import { isListNode, isListItemNode, joinSiblingLists, JoinDirection } from '../utils/node';
|
|
5
12
|
import { findFirstParentListItemNode, findRootParentListNode } from '../utils/find';
|
|
6
13
|
import { normalizeListItemsSelection, createListNodeRange } from '../utils/selection';
|
|
7
14
|
import { GapCursorSelection } from '../../selection/gap-cursor-selection';
|
|
8
|
-
|
|
15
|
+
import { getFeatureFlags } from '../../feature-flags-context';
|
|
16
|
+
export var outdentListItemsSelected = function outdentListItemsSelected(tr, state) {
|
|
9
17
|
var originalSelection = tr.selection;
|
|
10
18
|
var normalizedSelection = normalizeListItemsSelection({
|
|
11
19
|
selection: tr.selection,
|
|
@@ -45,7 +53,8 @@ export var outdentListItemsSelected = function outdentListItemsSelected(tr) {
|
|
|
45
53
|
} else {
|
|
46
54
|
extractListItemsRangeFromList({
|
|
47
55
|
tr: tr,
|
|
48
|
-
range: mappedRange
|
|
56
|
+
range: mappedRange,
|
|
57
|
+
state: state
|
|
49
58
|
});
|
|
50
59
|
hasNormalizedToPositionLiftedOut = hasNormalizedToPositionLiftedOut || oldTo >= range.from && oldTo < range.to;
|
|
51
60
|
hasNormalizedFromPositionLiftedOut = hasNormalizedFromPositionLiftedOut || oldFrom >= range.from && oldFrom < range.to;
|
|
@@ -190,7 +199,8 @@ var outdentRangeToParentList = function outdentRangeToParentList(_ref2) {
|
|
|
190
199
|
|
|
191
200
|
var extractListItemsRangeFromList = function extractListItemsRangeFromList(_ref3) {
|
|
192
201
|
var tr = _ref3.tr,
|
|
193
|
-
range = _ref3.range
|
|
202
|
+
range = _ref3.range,
|
|
203
|
+
state = _ref3.state;
|
|
194
204
|
var list = range.parent;
|
|
195
205
|
var $start = tr.doc.resolve(range.start);
|
|
196
206
|
var listStart = $start.start(range.depth);
|
|
@@ -215,7 +225,23 @@ var extractListItemsRangeFromList = function extractListItemsRangeFromList(_ref3
|
|
|
215
225
|
}
|
|
216
226
|
}
|
|
217
227
|
|
|
218
|
-
var
|
|
228
|
+
var nextList = list.copy(Fragment.empty);
|
|
229
|
+
var featureFlags = getFeatureFlags(state);
|
|
230
|
+
|
|
231
|
+
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists) {
|
|
232
|
+
// if splitting a numbered list, keep the splitted item
|
|
233
|
+
// counter as the start of the next (second half) list (instead
|
|
234
|
+
// of reverting back to 1 as a starting number)
|
|
235
|
+
var order = getOrderFromOrderedListNode(list);
|
|
236
|
+
|
|
237
|
+
if (list.type.name === 'orderedList') {
|
|
238
|
+
nextList.attrs = _objectSpread(_objectSpread({}, nextList.attrs), {}, {
|
|
239
|
+
order: range.endIndex - 1 + order
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
var nextListFragment = listItemContent.append(Fragment.from(nextList));
|
|
219
245
|
|
|
220
246
|
if (isTheEntireList) {
|
|
221
247
|
var slice = new Slice(listItemContent, 0, 0);
|
|
@@ -30,7 +30,7 @@ export function outdentList() {
|
|
|
30
30
|
closeHistory(state.tr);
|
|
31
31
|
var actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
32
32
|
var customTr = state.tr;
|
|
33
|
-
outdentListAction(customTr);
|
|
33
|
+
outdentListAction(customTr, state);
|
|
34
34
|
|
|
35
35
|
if (!customTr || !customTr.docChanged) {
|
|
36
36
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|