@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
|
@@ -2,9 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { PluginKey } from 'prosemirror-state';
|
|
4
4
|
import { DecorationSet, Decoration } from 'prosemirror-view';
|
|
5
|
-
import {
|
|
6
|
-
import { pluginKey as alignmentPluginKey } from '../alignment/pm-plugins/main';
|
|
7
|
-
import { placeHolderClassName } from './styles';
|
|
5
|
+
import { isEmptyDocument, bracketTyped } from '../../utils/document';
|
|
8
6
|
export var pluginKey = new PluginKey('placeholderPlugin');
|
|
9
7
|
import { focusStateKey } from '../base/pm-plugins/focus-handler';
|
|
10
8
|
import { isTypeAheadOpen } from '../type-ahead/utils';
|
|
@@ -14,22 +12,24 @@ function getPlaceholderState(editorState) {
|
|
|
14
12
|
return pluginKey.getState(editorState);
|
|
15
13
|
}
|
|
16
14
|
|
|
15
|
+
export var placeholderTestId = 'placeholder-test-id';
|
|
17
16
|
export function createPlaceholderDecoration(editorState, placeholderText) {
|
|
18
17
|
var pos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
19
18
|
var placeholderDecoration = document.createElement('span');
|
|
20
|
-
var
|
|
21
|
-
|
|
19
|
+
var placeholderNodeWithText = placeholderDecoration;
|
|
20
|
+
placeholderDecoration.setAttribute('data-testid', placeholderTestId);
|
|
21
|
+
placeholderDecoration.className = 'placeholder-decoration'; // PM sets contenteditable to false on Decorations so Firefox doesn't display the flashing cursor
|
|
22
|
+
// So adding an extra span which will contain the placeholder text
|
|
22
23
|
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
if (browser.gecko) {
|
|
25
|
+
var placeholderNode = document.createElement('span');
|
|
26
|
+
placeholderNode.setAttribute('contenteditable', 'true'); // explicitly overriding the default Decoration behaviour
|
|
27
|
+
|
|
28
|
+
placeholderDecoration.appendChild(placeholderNode);
|
|
29
|
+
placeholderNodeWithText = placeholderNode;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
var placeholderNode = document.createElement('span');
|
|
31
|
-
placeholderNode.textContent = placeholderText;
|
|
32
|
-
placeholderDecoration.appendChild(placeholderNode); // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
|
|
32
|
+
placeholderNodeWithText.textContent = placeholderText || ' '; // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
|
|
33
33
|
// Add a editable buff node as the cursor moving forward is inevitable
|
|
34
34
|
// when backspace in GBoard composition
|
|
35
35
|
|
|
@@ -41,7 +41,7 @@ export function createPlaceholderDecoration(editorState, placeholderText) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return DecorationSet.create(editorState.doc, [Decoration.widget(pos, placeholderDecoration, {
|
|
44
|
-
side:
|
|
44
|
+
side: 0,
|
|
45
45
|
key: 'placeholder'
|
|
46
46
|
})]);
|
|
47
47
|
}
|
|
@@ -58,7 +58,7 @@ var emptyPlaceholder = {
|
|
|
58
58
|
hasPlaceholder: false
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
function createPlaceHolderStateFrom(editorState,
|
|
61
|
+
function createPlaceHolderStateFrom(editorState, defaultPlaceholderText, bracketPlaceholderText) {
|
|
62
62
|
var isEditorFocused = focusStateKey.getState(editorState);
|
|
63
63
|
|
|
64
64
|
if (isTypeAheadOpen(editorState)) {
|
|
@@ -69,48 +69,26 @@ function createPlaceHolderStateFrom(editorState, getPlaceholderHintMessage, defa
|
|
|
69
69
|
return setPlaceHolderState(defaultPlaceholderText);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
var placeholderHint = getPlaceholderHintMessage();
|
|
73
|
-
|
|
74
|
-
if (placeholderHint && isInEmptyLine(editorState) && isEditorFocused) {
|
|
75
|
-
var $from = editorState.selection.$from;
|
|
76
|
-
return setPlaceHolderState(placeholderHint, $from.pos);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
72
|
if (bracketPlaceholderText && bracketTyped(editorState) && isEditorFocused) {
|
|
80
|
-
var
|
|
73
|
+
var $from = editorState.selection.$from; // Space is to account for positioning of the bracket
|
|
81
74
|
|
|
82
75
|
var bracketHint = ' ' + bracketPlaceholderText;
|
|
83
|
-
return setPlaceHolderState(bracketHint,
|
|
76
|
+
return setPlaceHolderState(bracketHint, $from.pos - 1);
|
|
84
77
|
}
|
|
85
78
|
|
|
86
79
|
return emptyPlaceholder;
|
|
87
80
|
}
|
|
88
81
|
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
return function () {
|
|
92
|
-
if (!placeholderHints || placeholderHints.length === 0) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
var length = placeholderHints.length;
|
|
97
|
-
var placeholder = placeholderHints[index++];
|
|
98
|
-
index = index % length;
|
|
99
|
-
return placeholder;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function createPlugin(defaultPlaceholderText, placeholderHints, bracketPlaceholderText) {
|
|
104
|
-
if (!defaultPlaceholderText && !placeholderHints && !bracketPlaceholderText) {
|
|
82
|
+
export function createPlugin(defaultPlaceholderText, bracketPlaceholderText) {
|
|
83
|
+
if (!defaultPlaceholderText && !bracketPlaceholderText) {
|
|
105
84
|
return;
|
|
106
85
|
}
|
|
107
86
|
|
|
108
|
-
var getPlaceholderHintMessage = createGetPlaceholderHintMessage(placeholderHints);
|
|
109
87
|
return new SafePlugin({
|
|
110
88
|
key: pluginKey,
|
|
111
89
|
state: {
|
|
112
90
|
init: function init(_, state) {
|
|
113
|
-
return createPlaceHolderStateFrom(state,
|
|
91
|
+
return createPlaceHolderStateFrom(state, defaultPlaceholderText, bracketPlaceholderText);
|
|
114
92
|
},
|
|
115
93
|
apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
|
|
116
94
|
var meta = tr.getMeta(pluginKey);
|
|
@@ -121,11 +99,11 @@ export function createPlugin(defaultPlaceholderText, placeholderHints, bracketPl
|
|
|
121
99
|
}
|
|
122
100
|
|
|
123
101
|
if (meta.applyPlaceholderIfEmpty) {
|
|
124
|
-
return createPlaceHolderStateFrom(newEditorState,
|
|
102
|
+
return createPlaceHolderStateFrom(newEditorState, defaultPlaceholderText, bracketPlaceholderText);
|
|
125
103
|
}
|
|
126
104
|
}
|
|
127
105
|
|
|
128
|
-
return createPlaceHolderStateFrom(newEditorState,
|
|
106
|
+
return createPlaceHolderStateFrom(newEditorState, defaultPlaceholderText, bracketPlaceholderText);
|
|
129
107
|
}
|
|
130
108
|
},
|
|
131
109
|
props: {
|
|
@@ -152,7 +130,7 @@ var placeholderPlugin = function placeholderPlugin(options) {
|
|
|
152
130
|
return [{
|
|
153
131
|
name: 'placeholder',
|
|
154
132
|
plugin: function plugin() {
|
|
155
|
-
return createPlugin(options && options.placeholder, options && options.
|
|
133
|
+
return createPlugin(options && options.placeholder, options && options.placeholderBracketHint);
|
|
156
134
|
}
|
|
157
135
|
}];
|
|
158
136
|
}
|
|
@@ -5,5 +5,4 @@ var _templateObject;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { N200 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { token } from '@atlaskit/tokens';
|
|
8
|
-
export var
|
|
9
|
-
export var placeholderStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror .", " {\n position: relative;\n color: ", ";\n width: 100%;\n\n pointer-events: none;\n display: block;\n user-select: none;\n\n > span {\n position: absolute;\n pointer-events: none;\n outline: none;\n }\n\n &.align-end > span {\n right: 0;\n }\n\n &.align-center > span {\n left: 0;\n }\n }\n"])), placeHolderClassName, token('color.text.subtlest', N200));
|
|
8
|
+
export var placeholderStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror .placeholder-decoration {\n color: ", ";\n width: 100%;\n pointer-events: none;\n user-select: none;\n }\n"])), token('color.text.subtlest', N200));
|
|
@@ -17,6 +17,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
17
|
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { AnalyticsListener } from '@atlaskit/analytics-next';
|
|
20
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
20
21
|
import { ReactNodeView } from '../../../nodeviews';
|
|
21
22
|
import WithPluginState from '../../../ui/WithPluginState';
|
|
22
23
|
import { stateKey as taskPluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -42,12 +43,14 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
42
43
|
_defineProperty(_assertThisInitialized(_this), "handleOnChange", function (taskId, isChecked) {
|
|
43
44
|
var tr = _this.view.state.tr;
|
|
44
45
|
|
|
45
|
-
var nodePos = _this.getPos();
|
|
46
|
+
var nodePos = _this.getPos(); // SetAttrsStep should be used to prevent task updates from being dropped when mapping task ticks
|
|
47
|
+
// from a previous version of the document, such as a published page.
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
|
|
50
|
+
tr.step(new SetAttrsStep(nodePos, {
|
|
48
51
|
state: isChecked ? 'DONE' : 'TODO',
|
|
49
52
|
localId: taskId
|
|
50
|
-
});
|
|
53
|
+
}));
|
|
51
54
|
tr.setMeta('scrollIntoView', false);
|
|
52
55
|
|
|
53
56
|
_this.view.dispatch(tr);
|
|
@@ -65,6 +65,7 @@ export var ToolbarDecision = /*#__PURE__*/function (_PureComponent) {
|
|
|
65
65
|
disabled: disabled || isDisabled,
|
|
66
66
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
67
67
|
title: "".concat(label, " <>"),
|
|
68
|
+
"aria-keyshortcuts": "Shift+, Shift+. space",
|
|
68
69
|
iconBefore: /*#__PURE__*/React.createElement(DecisionIcon, {
|
|
69
70
|
label: label
|
|
70
71
|
})
|
|
@@ -29,6 +29,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../
|
|
|
29
29
|
import * as commands from '../../commands/change-color';
|
|
30
30
|
import { EditorTextColorIcon } from './icon';
|
|
31
31
|
import { backgroundDisabled, textColorIconBar, textColorIconWrapper } from './styles';
|
|
32
|
+
import { getFeatureFlags } from '../../../feature-flags-context/get-feature-flags';
|
|
32
33
|
var EXPERIMENT_NAME = 'editor.toolbarTextColor.moreColors';
|
|
33
34
|
var EXPERIMENT_GROUP_CONTROL = 'control';
|
|
34
35
|
export var messages = defineMessages({
|
|
@@ -78,10 +79,9 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
78
79
|
|
|
79
80
|
var _this$props$pluginSta = _this.props.pluginState,
|
|
80
81
|
palette = _this$props$pluginSta.palette,
|
|
81
|
-
paletteExpanded = _this$props$pluginSta.paletteExpanded,
|
|
82
82
|
defaultColor = _this$props$pluginSta.defaultColor; // we store color names in analytics
|
|
83
83
|
|
|
84
|
-
var swatch =
|
|
84
|
+
var swatch = palette.find(function (sw) {
|
|
85
85
|
return sw.value === color;
|
|
86
86
|
});
|
|
87
87
|
var isNewColor = color !== defaultColor && !originalTextColors.some(function (col) {
|
|
@@ -179,11 +179,14 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
179
179
|
popupsScrollableElement = _this$props.popupsScrollableElement,
|
|
180
180
|
isReducedSpacing = _this$props.isReducedSpacing,
|
|
181
181
|
pluginState = _this$props.pluginState,
|
|
182
|
-
paletteExpanded = _this$props.pluginState.paletteExpanded,
|
|
183
182
|
formatMessage = _this$props.intl.formatMessage,
|
|
184
183
|
disabled = _this$props.disabled;
|
|
185
184
|
var labelTextColor = formatMessage(messages.textColor);
|
|
186
|
-
var palette =
|
|
185
|
+
var palette = pluginState.palette;
|
|
186
|
+
|
|
187
|
+
var _getFeatureFlags = getFeatureFlags(this.props.editorView.state),
|
|
188
|
+
useSomewhatSemanticTextColorNames = _getFeatureFlags.useSomewhatSemanticTextColorNames;
|
|
189
|
+
|
|
187
190
|
var fitWidth;
|
|
188
191
|
|
|
189
192
|
if (document.body.clientWidth <= 740) {
|
|
@@ -239,7 +242,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
239
242
|
return _this2.changeTextColor(color, pluginState.disabled);
|
|
240
243
|
},
|
|
241
244
|
selectedColor: pluginState.color,
|
|
242
|
-
textPalette: true
|
|
245
|
+
textPalette: true,
|
|
246
|
+
useSomewhatSemanticTextColorNames: useSomewhatSemanticTextColorNames
|
|
243
247
|
}))), jsx("span", {
|
|
244
248
|
css: separatorStyles
|
|
245
249
|
}));
|
|
@@ -15,6 +15,7 @@ import { pluginKey as textFormattingPluginKey } from '../../../pm-plugins/plugin
|
|
|
15
15
|
import { toggleCode, toggleStrikethrough, toggleUnderline, tooltip, toggleBold, toggleItalic, toggleSubscript, toggleSuperscript, ToolTipContent } from '../../../../../keymaps';
|
|
16
16
|
import { INPUT_METHOD } from '../../../../analytics/types/enums';
|
|
17
17
|
import { IconTypes } from '../types';
|
|
18
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
18
19
|
|
|
19
20
|
var withToolbarInputMethod = function withToolbarInputMethod(func) {
|
|
20
21
|
return func({
|
|
@@ -98,7 +99,9 @@ var getIcon = function getIcon(_ref) {
|
|
|
98
99
|
name: iconType
|
|
99
100
|
},
|
|
100
101
|
isActive: isActive,
|
|
101
|
-
isDisabled: isDisabled
|
|
102
|
+
isDisabled: isDisabled,
|
|
103
|
+
'aria-label': tooltipKeymap ? tooltip(tooltipKeymap, String(content)) : String(content),
|
|
104
|
+
'aria-keyshortcuts': getAriaKeyshortcuts(tooltipKeymap)
|
|
102
105
|
};
|
|
103
106
|
};
|
|
104
107
|
|
|
@@ -16,8 +16,11 @@ export var SingleToolbarButtons = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
16
16
|
return jsx("span", {
|
|
17
17
|
css: buttonGroupStyle
|
|
18
18
|
}, items.map(function (item) {
|
|
19
|
+
var _item$ariaLabel;
|
|
20
|
+
|
|
19
21
|
return jsx(ToolbarButton, {
|
|
20
22
|
key: item.key,
|
|
23
|
+
testId: "editor-toolbar__".concat(String(item.content)),
|
|
21
24
|
buttonId: item.buttonId,
|
|
22
25
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
23
26
|
onClick: onClick(item.command),
|
|
@@ -26,7 +29,8 @@ export var SingleToolbarButtons = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
26
29
|
title: item.tooltipElement,
|
|
27
30
|
iconBefore: item.iconElement,
|
|
28
31
|
"aria-pressed": item.isActive,
|
|
29
|
-
"aria-label": String(item.content)
|
|
32
|
+
"aria-label": (_item$ariaLabel = item['aria-label']) !== null && _item$ariaLabel !== void 0 ? _item$ariaLabel : String(item.content),
|
|
33
|
+
"aria-keyshortcuts": item['aria-keyshortcuts']
|
|
30
34
|
});
|
|
31
35
|
}));
|
|
32
36
|
});
|
|
@@ -5,11 +5,12 @@ import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
|
|
|
5
5
|
import NumberListIcon from '@atlaskit/icon/glyph/editor/number-list';
|
|
6
6
|
import IndentIcon from '@atlaskit/icon/glyph/editor/indent';
|
|
7
7
|
import OutdentIcon from '@atlaskit/icon/glyph/editor/outdent';
|
|
8
|
-
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, ToolTipContent } from '../../../keymaps';
|
|
8
|
+
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, ToolTipContent, tooltip } from '../../../keymaps';
|
|
9
9
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
|
|
10
10
|
import { messages } from '../../list/messages';
|
|
11
11
|
import { messages as indentationMessages } from '../../indentation/messages';
|
|
12
12
|
import { buttonGroupStyle, separatorStyles } from '../../../ui/styles';
|
|
13
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
13
14
|
export function Toolbar(props) {
|
|
14
15
|
var _useIntl = useIntl(),
|
|
15
16
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -26,6 +27,8 @@ export function Toolbar(props) {
|
|
|
26
27
|
onItemActivated = props.onItemActivated;
|
|
27
28
|
var labelUnorderedList = formatMessage(messages.unorderedList);
|
|
28
29
|
var labelOrderedList = formatMessage(messages.orderedList);
|
|
30
|
+
var indentMessage = formatMessage(indentationMessages.indent);
|
|
31
|
+
var outdentMessage = formatMessage(indentationMessages.outdent);
|
|
29
32
|
|
|
30
33
|
var handleOnItemActivated = function handleOnItemActivated(buttonName) {
|
|
31
34
|
return function (event) {
|
|
@@ -40,11 +43,13 @@ export function Toolbar(props) {
|
|
|
40
43
|
css: buttonGroupStyle
|
|
41
44
|
}, jsx(ToolbarButton, {
|
|
42
45
|
buttonId: TOOLBAR_BUTTON.BULLET_LIST,
|
|
46
|
+
testId: labelUnorderedList,
|
|
43
47
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
44
48
|
onClick: handleOnItemActivated('bullet_list'),
|
|
45
49
|
selected: bulletListActive,
|
|
46
50
|
"aria-pressed": bulletListActive,
|
|
47
|
-
"aria-label": labelUnorderedList,
|
|
51
|
+
"aria-label": tooltip(toggleBulletListKeymap, labelUnorderedList),
|
|
52
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleBulletListKeymap),
|
|
48
53
|
disabled: bulletListDisabled || disabled,
|
|
49
54
|
title: jsx(ToolTipContent, {
|
|
50
55
|
description: labelUnorderedList,
|
|
@@ -55,11 +60,13 @@ export function Toolbar(props) {
|
|
|
55
60
|
})
|
|
56
61
|
}), jsx(ToolbarButton, {
|
|
57
62
|
buttonId: TOOLBAR_BUTTON.ORDERED_LIST,
|
|
63
|
+
testId: labelOrderedList,
|
|
58
64
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
59
65
|
onClick: handleOnItemActivated('ordered_list'),
|
|
60
66
|
selected: orderedListActive,
|
|
61
67
|
"aria-pressed": orderedListActive,
|
|
62
|
-
"aria-label": labelOrderedList,
|
|
68
|
+
"aria-label": tooltip(toggleOrderedListKeymap, labelOrderedList),
|
|
69
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOrderedListKeymap),
|
|
63
70
|
disabled: orderedListDisabled || disabled,
|
|
64
71
|
title: jsx(ToolTipContent, {
|
|
65
72
|
description: labelOrderedList,
|
|
@@ -77,9 +84,10 @@ export function Toolbar(props) {
|
|
|
77
84
|
label: ""
|
|
78
85
|
}),
|
|
79
86
|
disabled: outdentDisabled || disabled,
|
|
80
|
-
"aria-label":
|
|
87
|
+
"aria-label": tooltip(toggleOutdentKeymap, outdentMessage),
|
|
88
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOutdentKeymap),
|
|
81
89
|
title: jsx(ToolTipContent, {
|
|
82
|
-
description:
|
|
90
|
+
description: outdentMessage,
|
|
83
91
|
keymap: toggleOutdentKeymap
|
|
84
92
|
})
|
|
85
93
|
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
@@ -91,9 +99,10 @@ export function Toolbar(props) {
|
|
|
91
99
|
label: ""
|
|
92
100
|
}),
|
|
93
101
|
disabled: indentDisabled || disabled,
|
|
94
|
-
"aria-label":
|
|
102
|
+
"aria-label": tooltip(toggleIndentKeymap, indentMessage),
|
|
103
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleIndentKeymap),
|
|
95
104
|
title: jsx(ToolTipContent, {
|
|
96
|
-
description:
|
|
105
|
+
description: indentMessage,
|
|
97
106
|
keymap: toggleIndentKeymap
|
|
98
107
|
})
|
|
99
108
|
}), jsx("span", {
|
|
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
import React
|
|
11
|
+
import React from 'react';
|
|
12
12
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
13
13
|
import { createPlugin } from './pm-plugins/main';
|
|
14
14
|
import { createPlugin as createInsertItemPlugin } from './pm-plugins/insert-item-plugin';
|
|
@@ -60,7 +60,7 @@ var TypeAheadMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
}, [onItemInsert, query]);
|
|
63
|
-
var cancel = useCallback(function (_ref3) {
|
|
63
|
+
var cancel = React.useCallback(function (_ref3) {
|
|
64
64
|
var setSelectionAt = _ref3.setSelectionAt,
|
|
65
65
|
addPrefixTrigger = _ref3.addPrefixTrigger,
|
|
66
66
|
forceFocusOnEditor = _ref3.forceFocusOnEditor;
|
|
@@ -1,13 +1,53 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export var 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: {
|
|
@@ -42,7 +42,6 @@ export var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
42
42
|
|
|
43
43
|
typeaheadComponent.setAttribute('id', decorationId);
|
|
44
44
|
typeaheadComponent.setAttribute('role', 'search');
|
|
45
|
-
typeaheadComponent.setAttribute('aria-label', "On ".concat(triggerHandler.id));
|
|
46
45
|
typeaheadComponent.dataset.typeAheadQuery = 'true';
|
|
47
46
|
typeaheadComponent.dataset.trigger = triggerHandler.trigger; // This line below seems weird,
|
|
48
47
|
// we need that cuz the clickAreaHelper
|
|
@@ -43,6 +43,22 @@ var isSelectAllShortcut = function isSelectAllShortcut(event) {
|
|
|
43
43
|
return (event.ctrlKey || event.metaKey) && key === 'a';
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
var getAriaLabel = function getAriaLabel(triggerPrefix, intl) {
|
|
47
|
+
switch (triggerPrefix) {
|
|
48
|
+
case '@':
|
|
49
|
+
return typeAheadListMessages.mentionInputLabel;
|
|
50
|
+
|
|
51
|
+
case '/':
|
|
52
|
+
return typeAheadListMessages.quickInsertInputLabel;
|
|
53
|
+
|
|
54
|
+
case ':':
|
|
55
|
+
return typeAheadListMessages.emojiInputLabel;
|
|
56
|
+
|
|
57
|
+
default:
|
|
58
|
+
return typeAheadListMessages.quickInsertInputLabel;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
46
62
|
export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
47
63
|
var triggerQueryPrefix = _ref.triggerQueryPrefix,
|
|
48
64
|
cancel = _ref.cancel,
|
|
@@ -439,7 +455,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
439
455
|
style: {
|
|
440
456
|
display: 'none'
|
|
441
457
|
}
|
|
442
|
-
}, intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)), jsx(AssistiveText, {
|
|
458
|
+
}, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)), jsx(AssistiveText, {
|
|
443
459
|
assistiveText: items.length === 0 ? intl.formatMessage(typeAheadListMessages.noSearchResultsLabel, {
|
|
444
460
|
itemsLength: items.length
|
|
445
461
|
}) : '',
|
|
@@ -13,7 +13,7 @@ import { List } from 'react-virtualized/dist/commonjs/List';
|
|
|
13
13
|
import { ICON_HEIGHT, ITEM_PADDING, TypeAheadListItem } from './TypeAheadListItem';
|
|
14
14
|
import { injectIntl, useIntl } from 'react-intl-next';
|
|
15
15
|
import { typeAheadListMessages } from '../messages';
|
|
16
|
-
import { moveSelectedIndex } from '../utils';
|
|
16
|
+
import { getTypeAheadListAriaLabels, moveSelectedIndex } from '../utils';
|
|
17
17
|
import { updateSelectedIndex } from '../commands/update-selected-index';
|
|
18
18
|
import { AssistiveText } from './AssistiveText';
|
|
19
19
|
import { TYPE_AHEAD_DECORATION_ELEMENT_ID } from '../constants';
|
|
@@ -40,7 +40,8 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
40
40
|
onItemClick = _ref2.onItemClick,
|
|
41
41
|
intl = _ref2.intl,
|
|
42
42
|
fitHeight = _ref2.fitHeight,
|
|
43
|
-
decorationElement = _ref2.decorationElement
|
|
43
|
+
decorationElement = _ref2.decorationElement,
|
|
44
|
+
triggerHandler = _ref2.triggerHandler;
|
|
44
45
|
var listRef = useRef();
|
|
45
46
|
var listContainerRef = useRef(null);
|
|
46
47
|
var lastVisibleIndexes = useRef({
|
|
@@ -223,6 +224,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
223
224
|
key = _ref4.key,
|
|
224
225
|
style = _ref4.style,
|
|
225
226
|
parent = _ref4.parent;
|
|
227
|
+
var currentItem = items[index];
|
|
226
228
|
return jsx(CellMeasurer, {
|
|
227
229
|
key: key,
|
|
228
230
|
cache: cache,
|
|
@@ -236,21 +238,24 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
236
238
|
"data-testid": "list-item-height-observed-".concat(index)
|
|
237
239
|
}, jsx(TypeAheadListItem, {
|
|
238
240
|
key: items[index].title,
|
|
239
|
-
item:
|
|
241
|
+
item: currentItem,
|
|
240
242
|
itemsLength: items.length,
|
|
241
243
|
itemIndex: index,
|
|
242
244
|
selectedIndex: selectedIndex,
|
|
243
|
-
onItemClick: actions.onItemClick
|
|
245
|
+
onItemClick: actions.onItemClick,
|
|
246
|
+
ariaLabel: getTypeAheadListAriaLabels(triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.trigger, intl, currentItem).listItemAriaLabel
|
|
244
247
|
}))));
|
|
245
248
|
};
|
|
246
249
|
|
|
250
|
+
var popupAriaLabel = getTypeAheadListAriaLabels(triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.trigger, intl).popupAriaLabel;
|
|
251
|
+
|
|
247
252
|
if (!Array.isArray(items)) {
|
|
248
253
|
return null;
|
|
249
254
|
}
|
|
250
255
|
|
|
251
256
|
var menuGroupId = ((_decorationElement$qu2 = decorationElement.querySelector("[role='combobox']")) === null || _decorationElement$qu2 === void 0 ? void 0 : _decorationElement$qu2.getAttribute('aria-controls')) || TYPE_AHEAD_DECORATION_ELEMENT_ID;
|
|
252
257
|
return jsx(MenuGroup, {
|
|
253
|
-
"aria-label":
|
|
258
|
+
"aria-label": popupAriaLabel,
|
|
254
259
|
"aria-relevant": "additions removals"
|
|
255
260
|
}, jsx("div", {
|
|
256
261
|
id: menuGroupId,
|
|
@@ -71,7 +71,8 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
71
71
|
itemsLength = _ref3.itemsLength,
|
|
72
72
|
selectedIndex = _ref3.selectedIndex,
|
|
73
73
|
onItemClick = _ref3.onItemClick,
|
|
74
|
-
itemIndex = _ref3.itemIndex
|
|
74
|
+
itemIndex = _ref3.itemIndex,
|
|
75
|
+
ariaLabel = _ref3.ariaLabel;
|
|
75
76
|
|
|
76
77
|
/**
|
|
77
78
|
* To select and highlight the first Item when no item is selected
|
|
@@ -117,21 +118,23 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
117
118
|
var listItemClasses = [customRenderItemDivStyle, isSelected && selectedStyle];
|
|
118
119
|
return jsx("div", {
|
|
119
120
|
"aria-selected": isSelected,
|
|
120
|
-
"aria-label": title,
|
|
121
121
|
role: "option",
|
|
122
|
+
"aria-label": ariaLabel,
|
|
122
123
|
"aria-setsize": itemsLength,
|
|
123
124
|
tabIndex: 0,
|
|
124
125
|
css: listItemClasses,
|
|
125
126
|
className: "ak-typeahead-item ".concat(isSelected ? 'typeahead-selected-item' : '') //CSS classes added for test cases purpose
|
|
126
127
|
,
|
|
127
128
|
ref: customItemRef
|
|
129
|
+
}, jsx("div", {
|
|
130
|
+
"aria-hidden": true
|
|
128
131
|
}, jsx(Comp, {
|
|
129
132
|
onClick: insertSelectedItem,
|
|
130
133
|
isSelected: false //The selection styles are handled in the parent div instead. Hence isSelected is made false always.
|
|
131
134
|
,
|
|
132
135
|
onHover: noop
|
|
133
|
-
}));
|
|
134
|
-
}, [customRenderItem,
|
|
136
|
+
})));
|
|
137
|
+
}, [customRenderItem, isSelected, ariaLabel, itemsLength, customItemRef, insertSelectedItem]);
|
|
135
138
|
|
|
136
139
|
if (customItem) {
|
|
137
140
|
return customItem;
|
|
@@ -144,7 +147,7 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref3) {
|
|
|
144
147
|
iconBefore: elementIcon,
|
|
145
148
|
isSelected: isSelected,
|
|
146
149
|
"aria-selected": isSelected,
|
|
147
|
-
"aria-label":
|
|
150
|
+
"aria-label": title,
|
|
148
151
|
"aria-setsize": itemsLength,
|
|
149
152
|
role: "option",
|
|
150
153
|
ref: buttonItemRef
|
|
@@ -208,7 +208,8 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
|
|
|
208
208
|
onItemClick: onItemInsert,
|
|
209
209
|
fitHeight: fitHeight,
|
|
210
210
|
editorView: editorView,
|
|
211
|
-
decorationElement: anchorElement
|
|
211
|
+
decorationElement: anchorElement,
|
|
212
|
+
triggerHandler: triggerHandler
|
|
212
213
|
})));
|
|
213
214
|
});
|
|
214
215
|
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 var findTypeAheadDecorations = function findTypeAheadDecorations(state) {
|
|
8
9
|
var selection = state.selection;
|
|
9
10
|
|
|
@@ -101,4 +102,41 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
|
101
102
|
|
|
102
103
|
updateSelectedIndex(nextIndex)(editorView.state, editorView.dispatch);
|
|
103
104
|
};
|
|
105
|
+
};
|
|
106
|
+
export var getTypeAheadListAriaLabels = function getTypeAheadListAriaLabels(trigger, intl, item) {
|
|
107
|
+
var _item$mention, _item$mention2, _item$emoji, _item$emoji2, _item$emoji3;
|
|
108
|
+
|
|
109
|
+
switch (trigger) {
|
|
110
|
+
case '@':
|
|
111
|
+
return {
|
|
112
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
|
|
113
|
+
listItemAriaLabel: intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
|
|
114
|
+
name: (item === null || item === void 0 ? void 0 : (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.name) || '',
|
|
115
|
+
shortName: (item === null || item === void 0 ? void 0 : (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.mentionName) || ''
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
case '/':
|
|
120
|
+
return {
|
|
121
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.quickInsertPopupLabel),
|
|
122
|
+
listItemAriaLabel: intl.formatMessage(typeAheadListMessages.emojiListItemLabel, {
|
|
123
|
+
name: (item === null || item === void 0 ? void 0 : item.title) || '',
|
|
124
|
+
shortcut: (item === null || item === void 0 ? void 0 : (_item$emoji = item.emoji) === null || _item$emoji === void 0 ? void 0 : _item$emoji.shortName) || ''
|
|
125
|
+
})
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
case ':':
|
|
129
|
+
return {
|
|
130
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.emojiPopupLabel),
|
|
131
|
+
listItemAriaLabel: intl.formatMessage(typeAheadListMessages.emojiListItemLabel, {
|
|
132
|
+
name: (item === null || item === void 0 ? void 0 : (_item$emoji2 = item.emoji) === null || _item$emoji2 === void 0 ? void 0 : _item$emoji2.name) || '',
|
|
133
|
+
shortcut: (item === null || item === void 0 ? void 0 : (_item$emoji3 = item.emoji) === null || _item$emoji3 === void 0 ? void 0 : _item$emoji3.shortName) || ''
|
|
134
|
+
})
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
default:
|
|
138
|
+
return {
|
|
139
|
+
popupAriaLabel: intl.formatMessage(typeAheadListMessages.typeAheadPopupLabel)
|
|
140
|
+
};
|
|
141
|
+
}
|
|
104
142
|
};
|