@atlaskit/editor-core 176.0.3 → 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 +108 -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 +23 -23
- 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
|
@@ -1,13 +1,53 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export const typeAheadListMessages = defineMessages({
|
|
3
|
-
|
|
4
|
-
id: 'fabric.editor.
|
|
5
|
-
defaultMessage: '
|
|
3
|
+
typeAheadPopupLabel: {
|
|
4
|
+
id: 'fabric.editor.typeAhead.popupLabel',
|
|
5
|
+
defaultMessage: 'Typeahead results',
|
|
6
6
|
description: 'the result of a typeahead, similar to autocomplete results+'
|
|
7
7
|
},
|
|
8
|
+
quickInsertPopupLabel: {
|
|
9
|
+
id: 'fabric.editor.typeAhead.quickInsertPopupLabel',
|
|
10
|
+
defaultMessage: 'Shortcuts for inserts and formatting',
|
|
11
|
+
description: 'the result of a quick insert typeahead, similar to autocomplete results+'
|
|
12
|
+
},
|
|
13
|
+
quickInsertInputLabel: {
|
|
14
|
+
id: 'fabric.editor.typeAhead.quickInsertInputLabel',
|
|
15
|
+
defaultMessage: 'Begin typing to search or filter shortcut options',
|
|
16
|
+
description: 'assisitve text for typeahed input field'
|
|
17
|
+
},
|
|
18
|
+
emojiPopupLabel: {
|
|
19
|
+
id: 'fabric.editor.typeahead.emojiPopupLabel',
|
|
20
|
+
defaultMessage: 'Emoji shortcuts',
|
|
21
|
+
description: 'the result of a emoji typeahead, similar to autocomplete results+'
|
|
22
|
+
},
|
|
23
|
+
emojiInputLabel: {
|
|
24
|
+
id: 'fabric.editor.typeahead.emojiInputLabel',
|
|
25
|
+
defaultMessage: 'Begin typing to search or filter emoji options',
|
|
26
|
+
description: 'assisitve text for typeahed input field'
|
|
27
|
+
},
|
|
28
|
+
mentionPopupLabel: {
|
|
29
|
+
id: 'fabric.editor.typeahead.mentionPopupLabel',
|
|
30
|
+
defaultMessage: 'Users you can tag',
|
|
31
|
+
description: 'the aria label of a mention typeahead popup'
|
|
32
|
+
},
|
|
33
|
+
mentionInputLabel: {
|
|
34
|
+
id: 'fabric.editor.typeahead.mentionInputLabel',
|
|
35
|
+
defaultMessage: 'Begin typing to search for users to tag',
|
|
36
|
+
description: 'assisitve text for typeahed input field'
|
|
37
|
+
},
|
|
38
|
+
metionListItemLabel: {
|
|
39
|
+
id: 'fabric.editor.typeahead.metionListItemLabel',
|
|
40
|
+
defaultMessage: 'User {name} @{shortName}',
|
|
41
|
+
description: 'assistive text for user mention items username and nickname'
|
|
42
|
+
},
|
|
43
|
+
emojiListItemLabel: {
|
|
44
|
+
id: 'fabric.editor.typeahead.emojiListItemLabel',
|
|
45
|
+
defaultMessage: 'Emoji {name} Text Shortcut {shortcut}',
|
|
46
|
+
description: 'assistive text for emoji name and shortcut'
|
|
47
|
+
},
|
|
8
48
|
inputQueryAssistiveLabel: {
|
|
9
49
|
id: 'fabric.editor.inputQueryAssistiveTxt',
|
|
10
|
-
defaultMessage: 'When autocomplete results are available use up and down arrows to review and enter to select.
|
|
50
|
+
defaultMessage: 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.',
|
|
11
51
|
description: 'Assistive text to the user when using typeahead shortcut'
|
|
12
52
|
},
|
|
13
53
|
searchResultsLabel: {
|
|
@@ -47,7 +47,6 @@ export const factoryDecorations = ({
|
|
|
47
47
|
|
|
48
48
|
typeaheadComponent.setAttribute('id', decorationId);
|
|
49
49
|
typeaheadComponent.setAttribute('role', 'search');
|
|
50
|
-
typeaheadComponent.setAttribute('aria-label', `On ${triggerHandler.id}`);
|
|
51
50
|
typeaheadComponent.dataset.typeAheadQuery = 'true';
|
|
52
51
|
typeaheadComponent.dataset.trigger = triggerHandler.trigger; // This line below seems weird,
|
|
53
52
|
// we need that cuz the clickAreaHelper
|
|
@@ -40,6 +40,22 @@ const isSelectAllShortcut = event => {
|
|
|
40
40
|
return (event.ctrlKey || event.metaKey) && key === 'a';
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
const getAriaLabel = (triggerPrefix, intl) => {
|
|
44
|
+
switch (triggerPrefix) {
|
|
45
|
+
case '@':
|
|
46
|
+
return typeAheadListMessages.mentionInputLabel;
|
|
47
|
+
|
|
48
|
+
case '/':
|
|
49
|
+
return typeAheadListMessages.quickInsertInputLabel;
|
|
50
|
+
|
|
51
|
+
case ':':
|
|
52
|
+
return typeAheadListMessages.emojiInputLabel;
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
return typeAheadListMessages.quickInsertInputLabel;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
43
59
|
export const InputQuery = /*#__PURE__*/React.memo(({
|
|
44
60
|
triggerQueryPrefix,
|
|
45
61
|
cancel,
|
|
@@ -426,7 +442,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
426
442
|
style: {
|
|
427
443
|
display: 'none'
|
|
428
444
|
}
|
|
429
|
-
}, intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)), jsx(AssistiveText, {
|
|
445
|
+
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)), jsx(AssistiveText, {
|
|
430
446
|
assistiveText: items.length === 0 ? intl.formatMessage(typeAheadListMessages.noSearchResultsLabel, {
|
|
431
447
|
itemsLength: items.length
|
|
432
448
|
}) : '',
|
|
@@ -8,7 +8,7 @@ import { List } from 'react-virtualized/dist/commonjs/List';
|
|
|
8
8
|
import { ICON_HEIGHT, ITEM_PADDING, TypeAheadListItem } from './TypeAheadListItem';
|
|
9
9
|
import { injectIntl, useIntl } from 'react-intl-next';
|
|
10
10
|
import { typeAheadListMessages } from '../messages';
|
|
11
|
-
import { moveSelectedIndex } from '../utils';
|
|
11
|
+
import { getTypeAheadListAriaLabels, moveSelectedIndex } from '../utils';
|
|
12
12
|
import { updateSelectedIndex } from '../commands/update-selected-index';
|
|
13
13
|
import { AssistiveText } from './AssistiveText';
|
|
14
14
|
import { TYPE_AHEAD_DECORATION_ELEMENT_ID } from '../constants';
|
|
@@ -34,7 +34,8 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
34
34
|
onItemClick,
|
|
35
35
|
intl,
|
|
36
36
|
fitHeight,
|
|
37
|
-
decorationElement
|
|
37
|
+
decorationElement,
|
|
38
|
+
triggerHandler
|
|
38
39
|
}) => {
|
|
39
40
|
var _decorationElement$qu2;
|
|
40
41
|
|
|
@@ -208,6 +209,7 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
208
209
|
style,
|
|
209
210
|
parent
|
|
210
211
|
}) => {
|
|
212
|
+
const currentItem = items[index];
|
|
211
213
|
return jsx(CellMeasurer, {
|
|
212
214
|
key: key,
|
|
213
215
|
cache: cache,
|
|
@@ -221,21 +223,24 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
221
223
|
"data-testid": `list-item-height-observed-${index}`
|
|
222
224
|
}, jsx(TypeAheadListItem, {
|
|
223
225
|
key: items[index].title,
|
|
224
|
-
item:
|
|
226
|
+
item: currentItem,
|
|
225
227
|
itemsLength: items.length,
|
|
226
228
|
itemIndex: index,
|
|
227
229
|
selectedIndex: selectedIndex,
|
|
228
|
-
onItemClick: actions.onItemClick
|
|
230
|
+
onItemClick: actions.onItemClick,
|
|
231
|
+
ariaLabel: getTypeAheadListAriaLabels(triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.trigger, intl, currentItem).listItemAriaLabel
|
|
229
232
|
}))));
|
|
230
233
|
};
|
|
231
234
|
|
|
235
|
+
const popupAriaLabel = getTypeAheadListAriaLabels(triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.trigger, intl).popupAriaLabel;
|
|
236
|
+
|
|
232
237
|
if (!Array.isArray(items)) {
|
|
233
238
|
return null;
|
|
234
239
|
}
|
|
235
240
|
|
|
236
241
|
const menuGroupId = ((_decorationElement$qu2 = decorationElement.querySelector(`[role='combobox']`)) === null || _decorationElement$qu2 === void 0 ? void 0 : _decorationElement$qu2.getAttribute('aria-controls')) || TYPE_AHEAD_DECORATION_ELEMENT_ID;
|
|
237
242
|
return jsx(MenuGroup, {
|
|
238
|
-
"aria-label":
|
|
243
|
+
"aria-label": popupAriaLabel,
|
|
239
244
|
"aria-relevant": "additions removals"
|
|
240
245
|
}, jsx("div", {
|
|
241
246
|
id: menuGroupId,
|
|
@@ -112,7 +112,8 @@ export const TypeAheadListItem = ({
|
|
|
112
112
|
itemsLength,
|
|
113
113
|
selectedIndex,
|
|
114
114
|
onItemClick,
|
|
115
|
-
itemIndex
|
|
115
|
+
itemIndex,
|
|
116
|
+
ariaLabel
|
|
116
117
|
}) => {
|
|
117
118
|
/**
|
|
118
119
|
* To select and highlight the first Item when no item is selected
|
|
@@ -160,21 +161,23 @@ export const TypeAheadListItem = ({
|
|
|
160
161
|
const listItemClasses = [customRenderItemDivStyle, isSelected && selectedStyle];
|
|
161
162
|
return jsx("div", {
|
|
162
163
|
"aria-selected": isSelected,
|
|
163
|
-
"aria-label": title,
|
|
164
164
|
role: "option",
|
|
165
|
+
"aria-label": ariaLabel,
|
|
165
166
|
"aria-setsize": itemsLength,
|
|
166
167
|
tabIndex: 0,
|
|
167
168
|
css: listItemClasses,
|
|
168
169
|
className: `ak-typeahead-item ${isSelected ? 'typeahead-selected-item' : ''}` //CSS classes added for test cases purpose
|
|
169
170
|
,
|
|
170
171
|
ref: customItemRef
|
|
172
|
+
}, jsx("div", {
|
|
173
|
+
"aria-hidden": true
|
|
171
174
|
}, jsx(Comp, {
|
|
172
175
|
onClick: insertSelectedItem,
|
|
173
176
|
isSelected: false //The selection styles are handled in the parent div instead. Hence isSelected is made false always.
|
|
174
177
|
,
|
|
175
178
|
onHover: noop
|
|
176
|
-
}));
|
|
177
|
-
}, [customRenderItem,
|
|
179
|
+
})));
|
|
180
|
+
}, [customRenderItem, isSelected, ariaLabel, itemsLength, customItemRef, insertSelectedItem]);
|
|
178
181
|
|
|
179
182
|
if (customItem) {
|
|
180
183
|
return customItem;
|
|
@@ -187,7 +190,7 @@ export const TypeAheadListItem = ({
|
|
|
187
190
|
iconBefore: elementIcon,
|
|
188
191
|
isSelected: isSelected,
|
|
189
192
|
"aria-selected": isSelected,
|
|
190
|
-
"aria-label":
|
|
193
|
+
"aria-label": title,
|
|
191
194
|
"aria-setsize": itemsLength,
|
|
192
195
|
role: "option",
|
|
193
196
|
ref: buttonItemRef
|
|
@@ -210,7 +210,8 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
|
|
|
210
210
|
onItemClick: onItemInsert,
|
|
211
211
|
fitHeight: fitHeight,
|
|
212
212
|
editorView: editorView,
|
|
213
|
-
decorationElement: anchorElement
|
|
213
|
+
decorationElement: anchorElement,
|
|
214
|
+
triggerHandler: triggerHandler
|
|
214
215
|
})));
|
|
215
216
|
});
|
|
216
217
|
TypeAheadPopup.displayName = 'TypeAheadPopup';
|
|
@@ -4,6 +4,7 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
|
4
4
|
import { pluginKey as typeAheadPluginKey } from './pm-plugins/key';
|
|
5
5
|
import { updateSelectedIndex } from './commands/update-selected-index';
|
|
6
6
|
import { StatsModifier } from './stats-modifier';
|
|
7
|
+
import { typeAheadListMessages } from './messages';
|
|
7
8
|
export const findTypeAheadDecorations = state => {
|
|
8
9
|
const {
|
|
9
10
|
selection
|
|
@@ -107,4 +108,41 @@ export const moveSelectedIndex = ({
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
updateSelectedIndex(nextIndex)(editorView.state, editorView.dispatch);
|
|
111
|
+
};
|
|
112
|
+
export const getTypeAheadListAriaLabels = (trigger, intl, item) => {
|
|
113
|
+
var _item$mention, _item$mention2, _item$emoji, _item$emoji2, _item$emoji3;
|
|
114
|
+
|
|
115
|
+
switch (trigger) {
|
|
116
|
+
case '@':
|
|
117
|
+
return {
|
|
118
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
|
|
119
|
+
listItemAriaLabel: intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
|
|
120
|
+
name: (item === null || item === void 0 ? void 0 : (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.name) || '',
|
|
121
|
+
shortName: (item === null || item === void 0 ? void 0 : (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.mentionName) || ''
|
|
122
|
+
})
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
case '/':
|
|
126
|
+
return {
|
|
127
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.quickInsertPopupLabel),
|
|
128
|
+
listItemAriaLabel: intl.formatMessage(typeAheadListMessages.emojiListItemLabel, {
|
|
129
|
+
name: (item === null || item === void 0 ? void 0 : item.title) || '',
|
|
130
|
+
shortcut: (item === null || item === void 0 ? void 0 : (_item$emoji = item.emoji) === null || _item$emoji === void 0 ? void 0 : _item$emoji.shortName) || ''
|
|
131
|
+
})
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
case ':':
|
|
135
|
+
return {
|
|
136
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.emojiPopupLabel),
|
|
137
|
+
listItemAriaLabel: intl.formatMessage(typeAheadListMessages.emojiListItemLabel, {
|
|
138
|
+
name: (item === null || item === void 0 ? void 0 : (_item$emoji2 = item.emoji) === null || _item$emoji2 === void 0 ? void 0 : _item$emoji2.name) || '',
|
|
139
|
+
shortcut: (item === null || item === void 0 ? void 0 : (_item$emoji3 = item.emoji) === null || _item$emoji3 === void 0 ? void 0 : _item$emoji3.shortName) || ''
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
default:
|
|
144
|
+
return {
|
|
145
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.typeAheadPopupLabel)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
110
148
|
};
|
|
@@ -4,12 +4,13 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
import UndoIcon from '@atlaskit/icon/glyph/undo';
|
|
6
6
|
import RedoIcon from '@atlaskit/icon/glyph/redo';
|
|
7
|
-
import { undo as undoKeymap, redo as redoKeymap, ToolTipContent } from '../../../../keymaps';
|
|
7
|
+
import { undo as undoKeymap, redo as redoKeymap, ToolTipContent, tooltip } from '../../../../keymaps';
|
|
8
8
|
import { buttonGroupStyle, separatorStyles } from '../../../../ui/styles';
|
|
9
9
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
|
|
10
10
|
import { messages } from '../../messages';
|
|
11
11
|
import { createTypeAheadTools } from '../../../type-ahead/api';
|
|
12
12
|
import { undoFromToolbar, redoFromToolbar } from '../../commands';
|
|
13
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
13
14
|
|
|
14
15
|
const closeTypeAheadAndRunCommand = editorView => command => {
|
|
15
16
|
if (!editorView) {
|
|
@@ -69,7 +70,8 @@ export class ToolbarUndoRedo extends PureComponent {
|
|
|
69
70
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
70
71
|
onClick: handleUndo,
|
|
71
72
|
disabled: !canUndo || disabled,
|
|
72
|
-
"aria-label": labelUndo,
|
|
73
|
+
"aria-label": tooltip(undoKeymap, labelUndo),
|
|
74
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(undoKeymap),
|
|
73
75
|
title: jsx(ToolTipContent, {
|
|
74
76
|
description: labelUndo,
|
|
75
77
|
keymap: undoKeymap
|
|
@@ -91,7 +93,8 @@ export class ToolbarUndoRedo extends PureComponent {
|
|
|
91
93
|
label: ""
|
|
92
94
|
}),
|
|
93
95
|
testId: "ak-editor-toolbar-button-redo",
|
|
94
|
-
"aria-label": labelRedo
|
|
96
|
+
"aria-label": tooltip(redoKeymap, labelRedo),
|
|
97
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(redoKeymap)
|
|
95
98
|
}), jsx("span", {
|
|
96
99
|
css: separatorStyles
|
|
97
100
|
}));
|
|
@@ -2,7 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PureComponent } from 'react';
|
|
4
4
|
import ToolbarButton from '../../ToolbarButton';
|
|
5
|
-
import { ToolTipContent } from '../../../keymaps';
|
|
5
|
+
import { ToolTipContent, tooltip } from '../../../keymaps';
|
|
6
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
6
7
|
|
|
7
8
|
class AlignmentButton extends PureComponent {
|
|
8
9
|
constructor(...args) {
|
|
@@ -32,8 +33,9 @@ class AlignmentButton extends PureComponent {
|
|
|
32
33
|
description: label,
|
|
33
34
|
keymap: shortcut
|
|
34
35
|
}),
|
|
35
|
-
"aria-label": label,
|
|
36
|
+
"aria-label": shortcut ? tooltip(shortcut, label) : label,
|
|
36
37
|
"aria-pressed": isSelected,
|
|
38
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(shortcut),
|
|
37
39
|
onClick: this.onClick,
|
|
38
40
|
iconBefore: content
|
|
39
41
|
});
|
|
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
5
|
import { N30 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { token } from '@atlaskit/tokens';
|
|
7
|
-
import { akEditorToolbarKeylineHeight,
|
|
7
|
+
import { akEditorToolbarKeylineHeight, akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
export const TableControlsPadding = 20;
|
|
9
9
|
const mainToolbarWrapperStyle = css`
|
|
10
10
|
position: relative;
|
|
@@ -33,7 +33,7 @@ const stickyToolbarWrapperStyle = css`
|
|
|
33
33
|
position: sticky;
|
|
34
34
|
/* stylelint-enable declaration-block-no-duplicate-properties */
|
|
35
35
|
padding-bottom: ${gridSize()}px;
|
|
36
|
-
z-index: ${
|
|
36
|
+
z-index: ${akEditorMenuZIndex};
|
|
37
37
|
transition: box-shadow ease-in-out 0.2s;
|
|
38
38
|
&.show-keyline {
|
|
39
39
|
box-shadow: 0 ${akEditorToolbarKeylineHeight}px 0 0
|
|
@@ -71,7 +71,8 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
71
71
|
var _props$featureFlags8, _props$featureFlags9, _props$featureFlags10;
|
|
72
72
|
|
|
73
73
|
return jsx(ToolbarArrowKeyNavigationProvider, {
|
|
74
|
-
editorView: props.editorView
|
|
74
|
+
editorView: props.editorView,
|
|
75
|
+
childComponentSelector: "[data-testid='ak-editor-main-toolbar']"
|
|
75
76
|
}, jsx("div", {
|
|
76
77
|
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
|
|
77
78
|
"data-testid": "ak-editor-main-toolbar"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { IntlProviderIfMissingWrapper } from '@atlaskit/editor-common/ui';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import Editor from '../../editor';
|
|
4
5
|
import EditorWithActions from '../../labs/EditorWithActions';
|
|
@@ -40,10 +41,10 @@ export default class CollapsedEditor extends React.Component {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
if (!this.props.isExpanded) {
|
|
43
|
-
return /*#__PURE__*/React.createElement(ChromeCollapsed, {
|
|
44
|
+
return /*#__PURE__*/React.createElement(IntlProviderIfMissingWrapper, null, /*#__PURE__*/React.createElement(ChromeCollapsed, {
|
|
44
45
|
onFocus: this.props.onFocus,
|
|
45
46
|
text: this.props.placeholder
|
|
46
|
-
});
|
|
47
|
+
}));
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -88,7 +88,8 @@ const ColorPickerButton = props => {
|
|
|
88
88
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
89
89
|
ariaLabel: "Color picker popup"
|
|
90
90
|
}, jsx("div", {
|
|
91
|
-
css: colorPickerWrapper
|
|
91
|
+
css: colorPickerWrapper,
|
|
92
|
+
"data-test-id": "color-picker-menu"
|
|
92
93
|
}, jsx(ColorPaletteWithListeners, {
|
|
93
94
|
palette: props.colorPalette,
|
|
94
95
|
cols: props.cols,
|
|
@@ -8,9 +8,7 @@ import SectionMessage from '@atlaskit/section-message';
|
|
|
8
8
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
9
9
|
import Select from '@atlaskit/select';
|
|
10
10
|
import AddCircleIcon from '@atlaskit/icon/glyph/add-circle';
|
|
11
|
-
import { messages } from '../messages';
|
|
12
|
-
|
|
13
|
-
import FormContent from '../FormContent';
|
|
11
|
+
import { messages } from '../messages';
|
|
14
12
|
import { getNameFromDuplicateField, isDuplicateField } from '../utils';
|
|
15
13
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
16
14
|
import { N40A } from '@atlaskit/theme/colors';
|
|
@@ -209,7 +207,8 @@ class FieldsetField extends React.Component {
|
|
|
209
207
|
extensionManifest,
|
|
210
208
|
onFieldChange,
|
|
211
209
|
firstVisibleFieldName,
|
|
212
|
-
error
|
|
210
|
+
error,
|
|
211
|
+
formComponent: FormComponent
|
|
213
212
|
} = this.props;
|
|
214
213
|
const {
|
|
215
214
|
label,
|
|
@@ -223,7 +222,7 @@ class FieldsetField extends React.Component {
|
|
|
223
222
|
const children = this.renderActions();
|
|
224
223
|
return jsx(Fragment, null, error && jsx(FieldsetError, {
|
|
225
224
|
message: error
|
|
226
|
-
}), jsx("div", null, options.showTitle && jsx("h5", null, label), jsx(
|
|
225
|
+
}), jsx("div", null, options.showTitle && jsx("h5", null, label), jsx(FormComponent, {
|
|
227
226
|
fields: selectedFields,
|
|
228
227
|
parentName: name,
|
|
229
228
|
extensionManifest: extensionManifest,
|
|
@@ -5,8 +5,7 @@ import Boolean from './Fields/Boolean';
|
|
|
5
5
|
import CustomSelect from './Fields/CustomSelect';
|
|
6
6
|
import Date from './Fields/Date';
|
|
7
7
|
import DateRange from './Fields/DateRange';
|
|
8
|
-
import Enum from './Fields/Enum';
|
|
9
|
-
|
|
8
|
+
import Enum from './Fields/Enum';
|
|
10
9
|
import Fieldset from './Fields/Fieldset';
|
|
11
10
|
import Number from './Fields/Number';
|
|
12
11
|
import String from './Fields/String';
|
|
@@ -121,7 +120,8 @@ export function FieldComponent({
|
|
|
121
120
|
onFieldChange: onFieldChange,
|
|
122
121
|
extensionManifest: extensionManifest,
|
|
123
122
|
parameters: defaultValue || {},
|
|
124
|
-
error: error
|
|
123
|
+
error: error,
|
|
124
|
+
formComponent: FormContent
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
case 'user':
|
|
@@ -131,8 +131,13 @@ const contentStyles = props => css`
|
|
|
131
131
|
text-align: center;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
.pm-table-header-content-wrap,
|
|
135
|
-
.pm-table-
|
|
134
|
+
.pm-table-header-content-wrap :not(.fabric-editor-alignment),
|
|
135
|
+
.pm-table-header-content-wrap
|
|
136
|
+
:not(p, .fabric-editor-block-mark)
|
|
137
|
+
+ div.fabric-editor-block-mark,
|
|
138
|
+
.pm-table-cell-content-wrap
|
|
139
|
+
:not(p, .fabric-editor-block-mark)
|
|
140
|
+
+ div.fabric-editor-block-mark {
|
|
136
141
|
p:first-of-type {
|
|
137
142
|
margin-top: 0;
|
|
138
143
|
}
|
|
@@ -2,6 +2,7 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
export const RECENT_SEARCH_WIDTH_IN_PX = 420;
|
|
3
3
|
export const RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
|
|
4
4
|
export const RECENT_SEARCH_HEIGHT_IN_PX = 360;
|
|
5
|
+
export const LINKPICKER_HEIGHT_IN_PX = 570;
|
|
5
6
|
export const inputWrapper = css`
|
|
6
7
|
display: flex;
|
|
7
8
|
line-height: 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import React, { useLayoutEffect, useRef } from 'react';
|
|
2
|
+
import React, { useCallback, useLayoutEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
** The context is used to handle the keydown events of submenus.
|
|
@@ -20,33 +20,34 @@ export const KeyDownHandlerContext = /*#__PURE__*/React.createContext({
|
|
|
20
20
|
|
|
21
21
|
export const ToolbarArrowKeyNavigationProvider = ({
|
|
22
22
|
children,
|
|
23
|
-
editorView
|
|
23
|
+
editorView,
|
|
24
|
+
childComponentSelector,
|
|
25
|
+
handleEscape,
|
|
26
|
+
disableArrowKeyNavigation
|
|
24
27
|
}) => {
|
|
25
28
|
const wrapperRef = useRef(null);
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
currentSelectedItemIndex.current = 0;
|
|
29
|
+
const selectedItemIndex = useRef(0);
|
|
30
|
+
const incrementIndex = useCallback(list => {
|
|
31
|
+
if (selectedItemIndex.current === list.length - 1) {
|
|
32
|
+
selectedItemIndex.current = 0;
|
|
31
33
|
} else {
|
|
32
|
-
|
|
34
|
+
selectedItemIndex.current = selectedItemIndex.current + 1;
|
|
33
35
|
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
currentSelectedItemIndex.current = list.length - 1;
|
|
36
|
+
}, []);
|
|
37
|
+
const decrementIndex = useCallback(list => {
|
|
38
|
+
if (selectedItemIndex.current === 0) {
|
|
39
|
+
selectedItemIndex.current = list.length - 1;
|
|
39
40
|
} else {
|
|
40
|
-
|
|
41
|
+
selectedItemIndex.current = selectedItemIndex.current - 1;
|
|
41
42
|
}
|
|
42
|
-
};
|
|
43
|
+
}, []);
|
|
43
44
|
|
|
44
45
|
const handleArrowRight = () => {
|
|
45
46
|
var _filteredFocusableEle;
|
|
46
47
|
|
|
47
48
|
const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
48
49
|
incrementIndex(filteredFocusableElements);
|
|
49
|
-
(_filteredFocusableEle = filteredFocusableElements[
|
|
50
|
+
(_filteredFocusableEle = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle === void 0 ? void 0 : _filteredFocusableEle.focus();
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
const handleArrowLeft = () => {
|
|
@@ -54,14 +55,23 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
54
55
|
|
|
55
56
|
const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
56
57
|
decrementIndex(filteredFocusableElements);
|
|
57
|
-
(_filteredFocusableEle2 = filteredFocusableElements[
|
|
58
|
+
(_filteredFocusableEle2 = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle2 === void 0 ? void 0 : _filteredFocusableEle2.focus();
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
const handleTab = () => {
|
|
61
62
|
var _filteredFocusableEle3;
|
|
62
63
|
|
|
63
64
|
const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
64
|
-
(_filteredFocusableEle3 = filteredFocusableElements[
|
|
65
|
+
(_filteredFocusableEle3 = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle3 === void 0 ? void 0 : _filteredFocusableEle3.focus();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const focusAndScrollToElement = element => {
|
|
69
|
+
element === null || element === void 0 ? void 0 : element.scrollIntoView({
|
|
70
|
+
behavior: 'smooth',
|
|
71
|
+
block: 'center',
|
|
72
|
+
inline: 'nearest'
|
|
73
|
+
});
|
|
74
|
+
element.focus();
|
|
65
75
|
};
|
|
66
76
|
|
|
67
77
|
const submenuKeydownHandleContext = {
|
|
@@ -70,7 +80,7 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
70
80
|
handleTab
|
|
71
81
|
};
|
|
72
82
|
useLayoutEffect(() => {
|
|
73
|
-
if (!wrapperRef.current) {
|
|
83
|
+
if (!wrapperRef.current || disableArrowKeyNavigation) {
|
|
74
84
|
return;
|
|
75
85
|
}
|
|
76
86
|
|
|
@@ -83,17 +93,17 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
83
93
|
*/
|
|
84
94
|
|
|
85
95
|
const handleKeyDown = event => {
|
|
86
|
-
var _document$querySelect, _wrapperRef$current
|
|
96
|
+
var _document$querySelect, _document$querySelect2, _wrapperRef$current;
|
|
87
97
|
|
|
88
|
-
//To trap the focus inside the horizontal
|
|
89
|
-
const targetElement = event.target; //To filter out the events outside the
|
|
98
|
+
//To trap the focus inside the horizontal toolbar for left and right arrow keys
|
|
99
|
+
const targetElement = event.target; //To filter out the events outside the child component
|
|
90
100
|
|
|
91
|
-
if (!targetElement.closest(
|
|
101
|
+
if (!targetElement.closest(`${childComponentSelector}`)) {
|
|
92
102
|
return;
|
|
93
103
|
} //The key events are from child components such as dropdown menus / popups are ignored
|
|
94
104
|
|
|
95
105
|
|
|
96
|
-
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) || event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
106
|
+
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) {
|
|
97
107
|
return;
|
|
98
108
|
}
|
|
99
109
|
|
|
@@ -106,25 +116,37 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
106
116
|
|
|
107
117
|
|
|
108
118
|
if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
|
|
109
|
-
|
|
119
|
+
selectedItemIndex.current = -1;
|
|
110
120
|
} else {
|
|
111
|
-
|
|
121
|
+
selectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
|
|
112
122
|
}
|
|
113
123
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
switch (event.key) {
|
|
125
|
+
case 'ArrowRight':
|
|
126
|
+
incrementIndex(filteredFocusableElements);
|
|
127
|
+
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current]);
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
break;
|
|
130
|
+
|
|
131
|
+
case 'ArrowLeft':
|
|
132
|
+
decrementIndex(filteredFocusableElements);
|
|
133
|
+
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current]);
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
break;
|
|
119
136
|
|
|
120
|
-
|
|
137
|
+
case 'Escape':
|
|
138
|
+
handleEscape(event);
|
|
139
|
+
break;
|
|
140
|
+
|
|
141
|
+
default:
|
|
142
|
+
}
|
|
121
143
|
};
|
|
122
144
|
|
|
123
145
|
element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
|
|
124
146
|
return () => {
|
|
125
147
|
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
|
|
126
148
|
};
|
|
127
|
-
}, [
|
|
149
|
+
}, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex]);
|
|
128
150
|
return /*#__PURE__*/React.createElement("div", {
|
|
129
151
|
className: "custom-key-handler-wrapper",
|
|
130
152
|
ref: wrapperRef
|
|
@@ -144,5 +166,5 @@ function getFocusableElements(rootNode) {
|
|
|
144
166
|
|
|
145
167
|
function getFilteredFocusableElements(rootNode) {
|
|
146
168
|
//The focusable elements from child components such as dropdown menus / popups are ignored
|
|
147
|
-
return getFocusableElements(rootNode).filter(elm => !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]'));
|
|
169
|
+
return getFocusableElements(rootNode).filter(elm => !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons'));
|
|
148
170
|
}
|