@atlaskit/editor-core 176.0.2 → 177.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -2
- package/CHANGELOG.md +114 -0
- package/codemods/{173.0.0-rename-unsafe-allowUndoRedoButton-prop.ts → 175.0.0-rename-unsafe-allowUndoRedoButton-prop.ts} +0 -0
- package/dist/cjs/create-editor/ReactEditorView.js +3 -1
- package/dist/cjs/create-editor/create-plugins-list.js +9 -6
- package/dist/cjs/create-editor/messages.js +17 -0
- package/dist/cjs/i18n/en.js +2 -2
- package/dist/cjs/i18n/en_GB.js +2 -2
- package/dist/cjs/i18n/en_ZZ.js +2 -2
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/i18n/languages.js +9 -4
- package/dist/cjs/labs/next/presets/mobile.js +2 -2
- package/dist/cjs/labs/next/presets/preset.js +38 -6
- package/dist/cjs/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +6 -1
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -1
- package/dist/cjs/plugins/card/pm-plugins/doc.js +18 -29
- package/dist/cjs/plugins/card/pm-plugins/main.js +7 -21
- package/dist/cjs/plugins/card/toolbar.js +24 -8
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +9 -5
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +19 -53
- package/dist/cjs/plugins/card/utils.js +17 -3
- package/dist/cjs/plugins/collab-edit/actions.js +3 -3
- package/dist/cjs/plugins/copy-button/toolbar.js +5 -3
- package/dist/cjs/plugins/date/index.js +1 -7
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/cjs/plugins/emoji/index.js +7 -14
- package/dist/cjs/plugins/expand/pm-plugins/main.js +4 -1
- package/dist/cjs/plugins/expand/toolbar.js +1 -0
- package/dist/cjs/plugins/extension/commands.js +17 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/cjs/plugins/extension/toolbar.js +49 -7
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +99 -0
- package/dist/cjs/plugins/floating-toolbar/ui/ConfirmationModal.js +10 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +108 -55
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +51 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/cjs/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/cjs/plugins/floating-toolbar/utils.js +4 -19
- package/dist/cjs/plugins/help-dialog/index.js +3 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +20 -1
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +26 -12
- package/dist/cjs/plugins/layout/toolbar.js +1 -0
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +34 -4
- package/dist/cjs/plugins/list/commands/outdent-list.js +1 -1
- package/dist/cjs/plugins/list/index.js +6 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/cjs/plugins/list/pm-plugins/main.js +32 -10
- package/dist/cjs/plugins/media/index.js +35 -0
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +6 -0
- package/dist/cjs/plugins/media/toolbar/index.js +3 -0
- package/dist/cjs/plugins/media/utils/media-single.js +19 -3
- package/dist/cjs/plugins/panel/toolbar.js +1 -0
- package/dist/cjs/plugins/panel/utils.js +1 -1
- package/dist/cjs/plugins/paste/index.js +2 -1
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +19 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/paste/util/index.js +2 -2
- package/dist/cjs/plugins/placeholder/index.js +24 -47
- package/dist/cjs/plugins/placeholder/styles.js +2 -4
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +7 -3
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +10 -5
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +5 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -6
- package/dist/cjs/plugins/type-ahead/index.js +2 -8
- package/dist/cjs/plugins/type-ahead/messages.js +44 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +9 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/cjs/plugins/type-ahead/utils.js +44 -2
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -2
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -1
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/cjs/ui/CollapsedEditor/index.js +4 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -4
- package/dist/cjs/ui/ConfigPanel/FormContent.js +2 -1
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +3 -1
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +55 -33
- package/dist/cjs/utils/commands.js +25 -13
- package/dist/cjs/utils/input-rules.js +26 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -1
- package/dist/es2019/create-editor/create-plugins-list.js +9 -6
- package/dist/es2019/create-editor/messages.js +8 -0
- package/dist/es2019/i18n/en.js +2 -2
- package/dist/es2019/i18n/en_GB.js +2 -2
- package/dist/es2019/i18n/en_ZZ.js +2 -2
- package/dist/es2019/i18n/index.js +4 -4
- package/dist/es2019/i18n/languages.js +9 -4
- package/dist/es2019/labs/next/presets/mobile.js +2 -2
- package/dist/es2019/labs/next/presets/preset.js +28 -7
- package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -19
- package/dist/es2019/plugins/card/pm-plugins/main.js +4 -19
- package/dist/es2019/plugins/card/toolbar.js +19 -2
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -36
- package/dist/es2019/plugins/card/utils.js +15 -2
- package/dist/es2019/plugins/collab-edit/actions.js +3 -3
- package/dist/es2019/plugins/copy-button/toolbar.js +5 -3
- package/dist/es2019/plugins/date/index.js +0 -7
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/es2019/plugins/emoji/index.js +7 -13
- package/dist/es2019/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/expand/toolbar.js +1 -0
- package/dist/es2019/plugins/extension/commands.js +10 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/es2019/plugins/extension/toolbar.js +43 -8
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/es2019/plugins/floating-toolbar/index.js +15 -5
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +70 -0
- package/dist/es2019/plugins/floating-toolbar/ui/ConfirmationModal.js +8 -27
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +96 -50
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +29 -76
- package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +32 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +26 -46
- package/dist/es2019/plugins/floating-toolbar/ui/messages.js +14 -4
- package/dist/es2019/plugins/floating-toolbar/utils.js +4 -17
- package/dist/es2019/plugins/help-dialog/index.js +2 -2
- package/dist/es2019/plugins/hyperlink/Toolbar.js +18 -2
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/es2019/plugins/layout/toolbar.js +1 -0
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +24 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +1 -1
- package/dist/es2019/plugins/list/index.js +7 -3
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/es2019/plugins/list/pm-plugins/main.js +31 -11
- package/dist/es2019/plugins/media/index.js +38 -0
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +6 -5
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -0
- package/dist/es2019/plugins/media/toolbar/index.js +3 -0
- package/dist/es2019/plugins/media/utils/media-single.js +20 -3
- package/dist/es2019/plugins/panel/toolbar.js +1 -0
- package/dist/es2019/plugins/panel/utils.js +1 -1
- package/dist/es2019/plugins/paste/index.js +2 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/paste/util/index.js +2 -2
- package/dist/es2019/plugins/placeholder/index.js +21 -47
- package/dist/es2019/plugins/placeholder/styles.js +1 -19
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +8 -7
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +18 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/es2019/plugins/type-ahead/index.js +2 -2
- package/dist/es2019/plugins/type-ahead/messages.js +44 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/es2019/plugins/type-ahead/utils.js +38 -0
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/es2019/ui/CollapsedEditor/index.js +3 -2
- package/dist/es2019/ui/ColorPickerButton/index.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/es2019/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/es2019/ui/ContentStyles/index.js +7 -2
- package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/es2019/utils/commands.js +26 -14
- package/dist/es2019/utils/input-rules.js +22 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -1
- package/dist/esm/create-editor/create-plugins-list.js +9 -6
- package/dist/esm/create-editor/messages.js +8 -0
- package/dist/esm/i18n/en.js +2 -2
- package/dist/esm/i18n/en_GB.js +2 -2
- package/dist/esm/i18n/en_ZZ.js +2 -2
- package/dist/esm/i18n/index.js +4 -4
- package/dist/esm/i18n/languages.js +9 -4
- package/dist/esm/labs/next/presets/mobile.js +2 -2
- package/dist/esm/labs/next/presets/preset.js +36 -6
- package/dist/esm/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +10 -20
- package/dist/esm/plugins/card/pm-plugins/main.js +4 -17
- package/dist/esm/plugins/card/toolbar.js +24 -8
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +9 -39
- package/dist/esm/plugins/card/utils.js +15 -2
- package/dist/esm/plugins/collab-edit/actions.js +3 -3
- package/dist/esm/plugins/copy-button/toolbar.js +5 -3
- package/dist/esm/plugins/date/index.js +1 -6
- package/dist/esm/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/esm/plugins/emoji/index.js +7 -13
- package/dist/esm/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/expand/toolbar.js +1 -0
- package/dist/esm/plugins/extension/commands.js +12 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/esm/plugins/extension/toolbar.js +50 -8
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/esm/plugins/floating-toolbar/index.js +16 -4
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +75 -0
- package/dist/esm/plugins/floating-toolbar/ui/ConfirmationModal.js +11 -25
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +100 -47
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +30 -0
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/esm/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/esm/plugins/floating-toolbar/utils.js +4 -17
- package/dist/esm/plugins/help-dialog/index.js +3 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +20 -2
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -3
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/esm/plugins/layout/toolbar.js +1 -0
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +30 -4
- package/dist/esm/plugins/list/commands/outdent-list.js +1 -1
- package/dist/esm/plugins/list/index.js +7 -3
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/esm/plugins/list/pm-plugins/main.js +31 -11
- package/dist/esm/plugins/media/index.js +33 -0
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -0
- package/dist/esm/plugins/media/toolbar/index.js +3 -0
- package/dist/esm/plugins/media/utils/media-single.js +18 -3
- package/dist/esm/plugins/panel/toolbar.js +1 -0
- package/dist/esm/plugins/panel/utils.js +1 -1
- package/dist/esm/plugins/paste/index.js +2 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/paste/util/index.js +2 -2
- package/dist/esm/plugins/placeholder/index.js +23 -45
- package/dist/esm/plugins/placeholder/styles.js +1 -2
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +9 -5
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/esm/plugins/type-ahead/index.js +2 -2
- package/dist/esm/plugins/type-ahead/messages.js +44 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/esm/plugins/type-ahead/utils.js +38 -0
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/esm/ui/CollapsedEditor/index.js +3 -2
- package/dist/esm/ui/ColorPickerButton/index.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/esm/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/esm/utils/commands.js +25 -13
- package/dist/esm/utils/input-rules.js +23 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/messages.d.ts +7 -0
- package/dist/types/i18n/index.d.ts +4 -4
- package/dist/types/i18n/languages.d.ts +8 -3
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -2
- package/dist/types/labs/next/presets/mobile.d.ts +1 -1
- package/dist/types/labs/next/presets/preset.d.ts +10 -6
- package/dist/types/plugins/alignment/index.d.ts +2 -2
- package/dist/types/plugins/analytics/plugin.d.ts +2 -2
- package/dist/types/plugins/annotation/index.d.ts +2 -2
- package/dist/types/plugins/avatar-group/index.d.ts +4 -3
- package/dist/types/plugins/base/index.d.ts +2 -2
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +4 -3
- package/dist/types/plugins/block-type/index.d.ts +2 -2
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -1
- package/dist/types/plugins/breakout/index.d.ts +2 -2
- package/dist/types/plugins/caption/index.d.ts +2 -2
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +4 -4
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +5 -5
- package/dist/types/plugins/card/utils.d.ts +2 -1
- package/dist/types/plugins/clear-marks-on-change-to-empty-document/index.d.ts +2 -2
- package/dist/types/plugins/clipboard/index.d.ts +2 -2
- package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -3
- package/dist/types/plugins/code-block/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +2 -2
- package/dist/types/plugins/context-panel/index.d.ts +2 -2
- package/dist/types/plugins/copy-button/index.d.ts +2 -2
- package/dist/types/plugins/custom-autoformat/index.d.ts +2 -2
- package/dist/types/plugins/data-consumer/index.d.ts +2 -2
- package/dist/types/plugins/date/index.d.ts +2 -2
- package/dist/types/plugins/date/ui/DatePicker/index.d.ts +0 -1
- package/dist/types/plugins/editor-disabled/index.d.ts +2 -2
- package/dist/types/plugins/emoji/index.d.ts +2 -2
- package/dist/types/plugins/emoji/types.d.ts +2 -1
- package/dist/types/plugins/expand/index.d.ts +2 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/extension/commands.d.ts +2 -0
- package/dist/types/plugins/extension/index.d.ts +2 -2
- package/dist/types/plugins/extension/toolbar.d.ts +10 -0
- package/dist/types/plugins/fake-text-cursor/index.d.ts +2 -2
- package/dist/types/plugins/feature-flags-context/index.d.ts +2 -2
- package/dist/types/plugins/feedback-dialog/index.d.ts +3 -2
- package/dist/types/plugins/find-replace/index.d.ts +4 -3
- package/dist/types/plugins/floating-toolbar/index.d.ts +2 -2
- package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +1 -8
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +3 -0
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/messages.d.ts +10 -0
- package/dist/types/plugins/floating-toolbar/ui/types.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/utils.d.ts +2 -3
- package/dist/types/plugins/fragment/index.d.ts +2 -2
- package/dist/types/plugins/grid/index.d.ts +2 -2
- package/dist/types/plugins/help-dialog/index.d.ts +2 -3
- package/dist/types/plugins/history/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
- package/dist/types/plugins/image-upload/index.d.ts +2 -2
- package/dist/types/plugins/indentation/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
- package/dist/types/plugins/jira-issue/index.d.ts +2 -2
- package/dist/types/plugins/layout/index.d.ts +2 -2
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -2
- package/dist/types/plugins/list/index.d.ts +3 -2
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +3 -1
- package/dist/types/plugins/list/pm-plugins/main.d.ts +2 -2
- package/dist/types/plugins/list/types.d.ts +2 -0
- package/dist/types/plugins/macro/index.d.ts +2 -2
- package/dist/types/plugins/max-content-size/index.d.ts +2 -2
- package/dist/types/plugins/media/index.d.ts +2 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/mentions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +2 -2
- package/dist/types/plugins/panel/index.d.ts +2 -2
- package/dist/types/plugins/paste/index.d.ts +3 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
- package/dist/types/plugins/placeholder/index.d.ts +4 -4
- package/dist/types/plugins/placeholder/styles.d.ts +0 -1
- package/dist/types/plugins/placeholder-text/index.d.ts +2 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -2
- package/dist/types/plugins/rule/index.d.ts +2 -2
- package/dist/types/plugins/save-on-enter/index.d.ts +3 -2
- package/dist/types/plugins/scroll-into-view/index.d.ts +2 -2
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/status/index.d.ts +2 -2
- package/dist/types/plugins/submit-editor/index.d.ts +4 -2
- package/dist/types/plugins/tasks-and-decisions/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/plugins/text-formatting/index.d.ts +2 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +4 -3
- package/dist/types/plugins/type-ahead/index.d.ts +2 -2
- package/dist/types/plugins/type-ahead/messages.d.ts +41 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +3 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +7 -1
- package/dist/types/plugins/undo-redo/index.d.ts +2 -2
- package/dist/types/plugins/unsupported-content/index.d.ts +2 -2
- package/dist/types/plugins/view-update-subscription/index.d.ts +2 -2
- package/dist/types/plugins/width/index.d.ts +2 -2
- package/dist/types/test-utils.d.ts +2 -1
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +0 -2
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/Fields/Fieldset.d.ts +2 -1
- package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -23
- package/dist/types/ui/ConfigPanel/types.d.ts +22 -0
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +1 -0
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +4 -1
- package/package.json +24 -24
- package/report.api.md +25 -16
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +0 -181
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -66
- package/dist/cjs/plugins/emoji/ui/EmojiContextProvider/index.js +0 -61
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +0 -151
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/es2019/plugins/emoji/ui/EmojiContextProvider/index.js +0 -21
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +0 -161
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/esm/plugins/emoji/ui/EmojiContextProvider/index.js +0 -46
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +0 -25
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +0 -5
- package/dist/types/plugins/emoji/ui/EmojiContextProvider/index.d.ts +0 -13
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { SimpleModal } from './SimpleModal';
|
|
4
|
+
import { CheckboxModal } from './CheckboxModal';
|
|
5
|
+
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
6
6
|
|
|
7
7
|
const ConfirmationModalImpl = props => {
|
|
8
8
|
const {
|
|
9
|
-
|
|
10
|
-
onClose,
|
|
11
|
-
options,
|
|
12
|
-
intl: {
|
|
13
|
-
formatMessage
|
|
14
|
-
},
|
|
15
|
-
testId
|
|
9
|
+
options
|
|
16
10
|
} = props;
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
return /*#__PURE__*/React.createElement(ModalTransition, null, options
|
|
21
|
-
onClose: onClose,
|
|
22
|
-
testId: testId
|
|
23
|
-
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
24
|
-
appearance: "warning"
|
|
25
|
-
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
26
|
-
appearance: "default",
|
|
27
|
-
onClick: onClose,
|
|
28
|
-
testId: testId ? `${testId}-cancel-button` : undefined
|
|
29
|
-
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
30
|
-
appearance: "warning",
|
|
31
|
-
onClick: onConfirm,
|
|
32
|
-
testId: testId ? `${testId}-confirm-button` : undefined
|
|
33
|
-
}, okButtonLabel))));
|
|
11
|
+
|
|
12
|
+
const renderModel = (isReferentialityDialog = false) => isReferentialityDialog ? /*#__PURE__*/React.createElement(CheckboxModal, props) : /*#__PURE__*/React.createElement(SimpleModal, props);
|
|
13
|
+
|
|
14
|
+
return options ? /*#__PURE__*/React.createElement(ModalTransition, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
|
|
34
15
|
};
|
|
35
16
|
|
|
36
17
|
export const ConfirmationModal = injectIntl(ConfirmationModalImpl);
|
|
@@ -35,13 +35,15 @@ export default class Dropdown extends Component {
|
|
|
35
35
|
_defineProperty(this, "renderArrayOptions", options => {
|
|
36
36
|
const {
|
|
37
37
|
showSelected,
|
|
38
|
-
dispatchCommand
|
|
38
|
+
dispatchCommand,
|
|
39
|
+
editorView
|
|
39
40
|
} = this.props;
|
|
40
41
|
return jsx(DropdownMenu, {
|
|
41
42
|
hide: this.hide,
|
|
42
43
|
dispatchCommand: dispatchCommand,
|
|
43
44
|
items: options,
|
|
44
|
-
showSelected: showSelected
|
|
45
|
+
showSelected: showSelected,
|
|
46
|
+
editorView: editorView
|
|
45
47
|
});
|
|
46
48
|
});
|
|
47
49
|
|
|
@@ -64,6 +66,14 @@ export default class Dropdown extends Component {
|
|
|
64
66
|
|
|
65
67
|
(_document$querySelect = document.querySelector(`[data-testid=${this.props.buttonTestId}]`)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
|
|
66
68
|
});
|
|
69
|
+
|
|
70
|
+
_defineProperty(this, "onOpenChanged", openChangedEvent => {
|
|
71
|
+
if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
|
|
72
|
+
var _openChangedEvent$eve;
|
|
73
|
+
|
|
74
|
+
((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? this.hideonEsc() : this.hide();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
67
77
|
}
|
|
68
78
|
|
|
69
79
|
render() {
|
|
@@ -82,7 +92,8 @@ export default class Dropdown extends Component {
|
|
|
82
92
|
disabled,
|
|
83
93
|
tooltip,
|
|
84
94
|
buttonTestId,
|
|
85
|
-
dropdownWidth
|
|
95
|
+
dropdownWidth,
|
|
96
|
+
editorView
|
|
86
97
|
} = this.props;
|
|
87
98
|
let trigger;
|
|
88
99
|
|
|
@@ -129,9 +140,11 @@ export default class Dropdown extends Component {
|
|
|
129
140
|
isOpen: isOpen,
|
|
130
141
|
handleClickOutside: this.hide,
|
|
131
142
|
handleEscapeKeydown: this.hideonEsc,
|
|
143
|
+
onOpenChange: this.onOpenChanged,
|
|
132
144
|
fitWidth: fitWidth + fitTolerance,
|
|
133
145
|
fitHeight: fitHeight + fitTolerance,
|
|
134
|
-
trigger: trigger
|
|
146
|
+
trigger: trigger,
|
|
147
|
+
editorView: editorView
|
|
135
148
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
|
|
136
149
|
hide: this.hide,
|
|
137
150
|
dispatchCommand
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
import { useState, useCallback } from 'react';
|
|
2
3
|
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { Component } from 'react';
|
|
4
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -34,65 +35,110 @@ const menuContainer = css`
|
|
|
34
35
|
export const itemSpacing = gridSize() / 2;
|
|
35
36
|
const DropdownButtonItem = ButtonItem;
|
|
36
37
|
|
|
38
|
+
const DropdownMenuItem = ({
|
|
39
|
+
item,
|
|
40
|
+
hide,
|
|
41
|
+
dispatchCommand,
|
|
42
|
+
editorView,
|
|
43
|
+
iconBefore
|
|
44
|
+
}) => {
|
|
45
|
+
const [tooltipContent, setTooltipContent] = useState(item.tooltip || '');
|
|
46
|
+
const handleTooltipMouseOut = useCallback(() => {
|
|
47
|
+
setTooltipContent('');
|
|
48
|
+
}, []);
|
|
49
|
+
const handleItemMouseDown = useCallback(e => {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
}, []);
|
|
52
|
+
const handleItemMouseOver = useCallback(e => {
|
|
53
|
+
setTooltipContent(item.tooltip || '');
|
|
54
|
+
|
|
55
|
+
if (item.onMouseOver) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
dispatchCommand(item.onMouseOver);
|
|
58
|
+
}
|
|
59
|
+
}, [item.tooltip, item.onMouseOver, dispatchCommand]);
|
|
60
|
+
const handleItemMouseEnter = useCallback(e => {
|
|
61
|
+
if (item.onMouseEnter) {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
dispatchCommand(item.onMouseEnter);
|
|
64
|
+
}
|
|
65
|
+
}, [item.onMouseEnter, dispatchCommand]);
|
|
66
|
+
const handleItemMouseLeave = useCallback(e => {
|
|
67
|
+
if (item.onMouseLeave) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
dispatchCommand(item.onMouseLeave);
|
|
70
|
+
}
|
|
71
|
+
}, [item.onMouseLeave, dispatchCommand]);
|
|
72
|
+
const handleItemOnFocus = useCallback(e => {
|
|
73
|
+
if (item.onFocus) {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
dispatchCommand(item.onFocus);
|
|
76
|
+
}
|
|
77
|
+
}, [item.onFocus, dispatchCommand]);
|
|
78
|
+
const handleItemOnBlur = useCallback(e => {
|
|
79
|
+
if (item.onBlur) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
dispatchCommand(item.onBlur);
|
|
82
|
+
}
|
|
83
|
+
}, [item.onBlur, dispatchCommand]);
|
|
84
|
+
const handleItemClick = useCallback(() => {
|
|
85
|
+
/**
|
|
86
|
+
* The order of dispatching the event and hide() is important, because
|
|
87
|
+
* the ClickAreaBlock will be relying on the element to calculate the
|
|
88
|
+
* click coordinate.
|
|
89
|
+
* For more details, please visit the comment in this PR https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5328/edm-1321-set-selection-near-smart-link?link_source=email#chg-packages/editor/editor-core/src/plugins/floating-toolbar/ui/DropdownMenu.tsx
|
|
90
|
+
*/
|
|
91
|
+
dispatchCommand(item.onClick);
|
|
92
|
+
hide();
|
|
93
|
+
|
|
94
|
+
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
95
|
+
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
96
|
+
}
|
|
97
|
+
}, [dispatchCommand, item.onClick, hide, editorView]);
|
|
98
|
+
const itemContent = jsx(DropdownButtonItem, {
|
|
99
|
+
iconBefore: iconBefore,
|
|
100
|
+
iconAfter: item.elemAfter,
|
|
101
|
+
onClick: handleItemClick,
|
|
102
|
+
"data-testid": item.testId,
|
|
103
|
+
isDisabled: item.disabled,
|
|
104
|
+
onMouseDown: handleItemMouseDown,
|
|
105
|
+
onMouseOver: handleItemMouseOver,
|
|
106
|
+
onMouseEnter: handleItemMouseEnter,
|
|
107
|
+
onMouseLeave: handleItemMouseLeave,
|
|
108
|
+
onFocus: handleItemOnFocus,
|
|
109
|
+
onBlur: handleItemOnBlur
|
|
110
|
+
}, item.title);
|
|
111
|
+
|
|
112
|
+
if (tooltipContent) {
|
|
113
|
+
return jsx(Tooltip, {
|
|
114
|
+
content: tooltipContent
|
|
115
|
+
}, jsx("div", {
|
|
116
|
+
onMouseOut: handleTooltipMouseOut
|
|
117
|
+
}, itemContent));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return itemContent;
|
|
121
|
+
};
|
|
122
|
+
|
|
37
123
|
class Dropdown extends Component {
|
|
38
124
|
render() {
|
|
39
125
|
const {
|
|
40
126
|
hide,
|
|
41
127
|
dispatchCommand,
|
|
42
128
|
items,
|
|
43
|
-
intl
|
|
129
|
+
intl,
|
|
130
|
+
editorView
|
|
44
131
|
} = this.props;
|
|
45
132
|
return jsx("div", {
|
|
46
133
|
css: menuContainer
|
|
47
|
-
}, items.filter(item => !item.hidden).map((item, idx) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* the ClickAreaBlock will be relying on the element to calculate the
|
|
56
|
-
* click coordinate.
|
|
57
|
-
* For more details, please visit the comment in this PR https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5328/edm-1321-set-selection-near-smart-link?link_source=email#chg-packages/editor/editor-core/src/plugins/floating-toolbar/ui/DropdownMenu.tsx
|
|
58
|
-
*/
|
|
59
|
-
dispatchCommand(item.onClick);
|
|
60
|
-
hide();
|
|
61
|
-
},
|
|
62
|
-
"data-testid": item.testId,
|
|
63
|
-
isDisabled: item.disabled,
|
|
64
|
-
onMouseDown: e => {
|
|
65
|
-
e.preventDefault();
|
|
66
|
-
},
|
|
67
|
-
onMouseOver: e => {
|
|
68
|
-
if (item.onMouseOver) {
|
|
69
|
-
e.preventDefault();
|
|
70
|
-
dispatchCommand(item.onMouseOver);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
onMouseEnter: e => {
|
|
74
|
-
if (item.onMouseEnter) {
|
|
75
|
-
e.preventDefault();
|
|
76
|
-
dispatchCommand(item.onMouseEnter);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
onMouseLeave: e => {
|
|
80
|
-
if (item.onMouseLeave) {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
dispatchCommand(item.onMouseLeave);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}, item.title);
|
|
86
|
-
|
|
87
|
-
if (item.tooltip) {
|
|
88
|
-
return jsx(Tooltip, {
|
|
89
|
-
key: idx,
|
|
90
|
-
content: item.tooltip
|
|
91
|
-
}, itemContent);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return itemContent;
|
|
95
|
-
}));
|
|
134
|
+
}, items.filter(item => !item.hidden).map((item, idx) => jsx(DropdownMenuItem, {
|
|
135
|
+
key: idx,
|
|
136
|
+
item: item,
|
|
137
|
+
hide: hide,
|
|
138
|
+
dispatchCommand: dispatchCommand,
|
|
139
|
+
editorView: editorView,
|
|
140
|
+
iconBefore: this.renderSelected(item, intl)
|
|
141
|
+
})));
|
|
96
142
|
}
|
|
97
143
|
|
|
98
144
|
renderSelected(item, intl) {
|
|
@@ -19,10 +19,10 @@ const emojiPickerWrapper = css`
|
|
|
19
19
|
margin-bottom: -12px;
|
|
20
20
|
margin-top: -4px;
|
|
21
21
|
`;
|
|
22
|
+
const EmojiPickerWithListener = withOuterListeners(EmojiPicker);
|
|
22
23
|
export const EmojiPickerButton = props => {
|
|
23
24
|
const buttonRef = React.useRef(null);
|
|
24
25
|
const [isPopupOpen, setIsPopupOpen] = React.useState(false);
|
|
25
|
-
const EmojiPickerWithListener = withOuterListeners(EmojiPicker);
|
|
26
26
|
React.useEffect(() => {
|
|
27
27
|
if (props.setDisableParentScroll) {
|
|
28
28
|
props.setDisableParentScroll(isPopupOpen);
|
|
@@ -27,13 +27,10 @@ export default (({
|
|
|
27
27
|
node,
|
|
28
28
|
disabled
|
|
29
29
|
}) => {
|
|
30
|
-
var _scrollContainerRef$c, _scrollContainerRef$c2;
|
|
31
|
-
|
|
32
30
|
const buttonsContainerRef = useRef(null);
|
|
33
31
|
const [needScroll, setNeedScroll] = useState(false);
|
|
34
32
|
const [canScrollLeft, setCanScrollLeft] = useState(true);
|
|
35
33
|
const [canScrollRight, setCanScrollRight] = useState(true);
|
|
36
|
-
const items = Array.from(((_scrollContainerRef$c = scrollContainerRef.current) === null || _scrollContainerRef$c === void 0 ? void 0 : (_scrollContainerRef$c2 = _scrollContainerRef$c.firstChild) === null || _scrollContainerRef$c2 === void 0 ? void 0 : _scrollContainerRef$c2.childNodes) || {});
|
|
37
34
|
const scheduledSetCanScroll = rafSchedule(() => {
|
|
38
35
|
const {
|
|
39
36
|
scrollLeft,
|
|
@@ -47,87 +44,42 @@ export default (({
|
|
|
47
44
|
const onScroll = () => scheduledSetCanScroll();
|
|
48
45
|
|
|
49
46
|
const scrollLeft = () => {
|
|
50
|
-
|
|
51
|
-
for (const [itemIndex, item] of items.reverse().entries()) {
|
|
52
|
-
var _scrollContainerRef$c3;
|
|
53
|
-
|
|
54
|
-
const {
|
|
55
|
-
left: itemLeft,
|
|
56
|
-
width: itemWidth
|
|
57
|
-
} = item.getBoundingClientRect();
|
|
58
|
-
const {
|
|
59
|
-
left: scrollContainerLeft = 0,
|
|
60
|
-
width: scrollContainerWidth = 0
|
|
61
|
-
} = ((_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.getBoundingClientRect()) || {}; // if item is partially visible on the left, scroll to it so it became the last item visible
|
|
62
|
-
|
|
63
|
-
if (itemLeft <= scrollContainerLeft) {
|
|
64
|
-
var _scrollContainerRef$c4, _scrollContainerRef$c5;
|
|
65
|
-
|
|
66
|
-
const gap = scrollContainerWidth - itemWidth;
|
|
67
|
-
let scrollTo = item.offsetLeft - gap; // if scrollTo is same as current scrollLeft
|
|
68
|
-
|
|
69
|
-
if (Math.floor(scrollTo) === Math.floor((scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : (_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 ? void 0 : _scrollContainerRef$c4.scrollLeft) || 0)) {
|
|
70
|
-
// if this is the first item, scroll to the beginning, otherwise find next item to scroll to
|
|
71
|
-
if (itemIndex === items.length - 1) {
|
|
72
|
-
scrollTo = 0;
|
|
73
|
-
} else {
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
47
|
+
var _scrollContainerRef$c, _scrollContainerRef$c2, _scrollContainerRef$c3;
|
|
77
48
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
49
|
+
const {
|
|
50
|
+
width: scrollContainerWidth = 0
|
|
51
|
+
} = ((_scrollContainerRef$c = scrollContainerRef.current) === null || _scrollContainerRef$c === void 0 ? void 0 : _scrollContainerRef$c.getBoundingClientRect()) || {};
|
|
52
|
+
const scrollLeft = ((_scrollContainerRef$c2 = scrollContainerRef.current) === null || _scrollContainerRef$c2 === void 0 ? void 0 : _scrollContainerRef$c2.scrollLeft) || 0; // scroll to current position - scroll container width
|
|
53
|
+
|
|
54
|
+
let scrollTo = scrollLeft - scrollContainerWidth;
|
|
55
|
+
(_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.scrollTo({
|
|
56
|
+
top: 0,
|
|
57
|
+
left: scrollTo,
|
|
58
|
+
behavior: 'smooth'
|
|
59
|
+
});
|
|
86
60
|
};
|
|
87
61
|
|
|
88
62
|
const scrollRight = () => {
|
|
89
|
-
|
|
90
|
-
for (const item of items) {
|
|
91
|
-
var _scrollContainerRef$c6;
|
|
92
|
-
|
|
93
|
-
const {
|
|
94
|
-
left: itemLeft,
|
|
95
|
-
width: itemWidth
|
|
96
|
-
} = item.getBoundingClientRect();
|
|
97
|
-
const {
|
|
98
|
-
left: scrollContainerLeft = 0,
|
|
99
|
-
width: scrollContainerWidth = 0
|
|
100
|
-
} = ((_scrollContainerRef$c6 = scrollContainerRef.current) === null || _scrollContainerRef$c6 === void 0 ? void 0 : _scrollContainerRef$c6.getBoundingClientRect()) || {}; // if item is partially visible on the right
|
|
63
|
+
var _scrollContainerRef$c4, _scrollContainerRef$c5, _scrollContainerRef$c6;
|
|
101
64
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
(_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0 ? void 0 : _scrollContainerRef$c9.scrollTo({
|
|
117
|
-
top: 0,
|
|
118
|
-
left: scrollTo,
|
|
119
|
-
behavior: 'smooth'
|
|
120
|
-
});
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
65
|
+
const {
|
|
66
|
+
width: scrollContainerWidth = 0
|
|
67
|
+
} = ((_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 ? void 0 : _scrollContainerRef$c4.getBoundingClientRect()) || {};
|
|
68
|
+
const scrollLeft = ((_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.scrollLeft) || 0; // scroll to current position + scroll container width
|
|
69
|
+
|
|
70
|
+
let scrollTo = scrollLeft + scrollContainerWidth;
|
|
71
|
+
(_scrollContainerRef$c6 = scrollContainerRef.current) === null || _scrollContainerRef$c6 === void 0 ? void 0 : _scrollContainerRef$c6.scrollTo({
|
|
72
|
+
top: 0,
|
|
73
|
+
left: scrollTo,
|
|
74
|
+
behavior: 'smooth'
|
|
75
|
+
});
|
|
124
76
|
};
|
|
125
77
|
|
|
126
78
|
const resizeObserver = new ResizeObserver(t => {
|
|
127
|
-
var _scrollContainerRef$
|
|
79
|
+
var _scrollContainerRef$c7, _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
128
80
|
|
|
129
|
-
const widthNeededToShowAllItems = ((_scrollContainerRef$
|
|
130
|
-
const availableSpace = (_scrollContainerRef$
|
|
81
|
+
const widthNeededToShowAllItems = ((_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 ? void 0 : _scrollContainerRef$c7.scrollWidth) || 0;
|
|
82
|
+
const availableSpace = (_scrollContainerRef$c8 = scrollContainerRef.current) === null || _scrollContainerRef$c8 === void 0 ? void 0 : (_scrollContainerRef$c9 = _scrollContainerRef$c8.parentNode) === null || _scrollContainerRef$c9 === void 0 ? void 0 : _scrollContainerRef$c9.offsetWidth;
|
|
131
83
|
|
|
132
84
|
if (availableSpace >= widthNeededToShowAllItems) {
|
|
133
85
|
setNeedScroll(false);
|
|
@@ -160,7 +112,8 @@ export default (({
|
|
|
160
112
|
}, [node, scrollContainerRef]);
|
|
161
113
|
return needScroll ? jsx("div", {
|
|
162
114
|
ref: buttonsContainerRef,
|
|
163
|
-
css: toolbarScrollButtons
|
|
115
|
+
css: toolbarScrollButtons,
|
|
116
|
+
className: "scroll-buttons"
|
|
164
117
|
}, jsx(Button, {
|
|
165
118
|
title: intl.formatMessage(messages.floatingToolbarScrollLeft),
|
|
166
119
|
icon: jsx(LeftIcon, {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '@atlaskit/button/standard-button';
|
|
3
|
+
import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
4
|
+
import messages from './messages';
|
|
5
|
+
export const SimpleModal = props => {
|
|
6
|
+
const {
|
|
7
|
+
onConfirm,
|
|
8
|
+
onClose,
|
|
9
|
+
options,
|
|
10
|
+
intl: {
|
|
11
|
+
formatMessage
|
|
12
|
+
},
|
|
13
|
+
testId
|
|
14
|
+
} = props;
|
|
15
|
+
const heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(messages.confirmModalDefaultHeading);
|
|
16
|
+
const okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
17
|
+
const cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
18
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
19
|
+
onClose: onClose,
|
|
20
|
+
testId: testId
|
|
21
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
22
|
+
appearance: "warning"
|
|
23
|
+
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
appearance: "default",
|
|
25
|
+
onClick: onClose,
|
|
26
|
+
testId: testId ? `${testId}-cancel-button` : undefined
|
|
27
|
+
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
28
|
+
appearance: "warning",
|
|
29
|
+
onClick: () => onConfirm(),
|
|
30
|
+
testId: testId ? `${testId}-confirm-button` : undefined
|
|
31
|
+
}, okButtonLabel)));
|
|
32
|
+
};
|
|
@@ -10,7 +10,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
10
10
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
11
11
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
12
12
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
13
|
-
import { compareArrays, getFirstFocusableElement,
|
|
13
|
+
import { compareArrays, getFirstFocusableElement, shallowEqual } from '../utils';
|
|
14
14
|
import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
15
15
|
import Button from './Button';
|
|
16
16
|
import Dropdown from './Dropdown';
|
|
@@ -26,6 +26,7 @@ import messages from './messages';
|
|
|
26
26
|
import { token } from '@atlaskit/tokens';
|
|
27
27
|
import { decorationStateKey, ACTIONS } from '../../base/pm-plugins/decoration';
|
|
28
28
|
import ScrollButtons from './ScrollButtons';
|
|
29
|
+
import { ToolbarArrowKeyNavigationProvider } from '../../../ui/ToolbarArrowKeyNavigationProvider';
|
|
29
30
|
const akGridSize = gridSize();
|
|
30
31
|
const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
31
32
|
items,
|
|
@@ -53,6 +54,10 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
53
54
|
dispatchCommand(showConfirmDialog(idx));
|
|
54
55
|
} else {
|
|
55
56
|
dispatchCommand(item.onClick);
|
|
57
|
+
|
|
58
|
+
if (item.focusEditoronEnter && !(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
59
|
+
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
};
|
|
58
63
|
|
|
@@ -114,6 +119,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
114
119
|
scrollableElement: popupsScrollableElement,
|
|
115
120
|
dropdownWidth: item.dropdownWidth,
|
|
116
121
|
showSelected: item.showSelected,
|
|
122
|
+
buttonTestId: item.testId,
|
|
123
|
+
editorView: editorView,
|
|
117
124
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined
|
|
118
125
|
});
|
|
119
126
|
|
|
@@ -333,54 +340,23 @@ class Toolbar extends Component {
|
|
|
333
340
|
}
|
|
334
341
|
});
|
|
335
342
|
|
|
336
|
-
_defineProperty(this, "
|
|
343
|
+
_defineProperty(this, "shouldHandleArrowKeys", () => {
|
|
337
344
|
var _this$props$items;
|
|
338
345
|
|
|
339
|
-
//To prevent the keydown
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
346
|
+
//To prevent the keydown handling of arrow keys for custom toolbar items with 'disableArrowNavigation' prop enabled,
|
|
347
|
+
//Usually the button which has menus or popups
|
|
348
|
+
return !((_this$props$items = this.props.items) !== null && _this$props$items !== void 0 && _this$props$items.find(item => item.type === 'custom' && item.disableArrowNavigation));
|
|
349
|
+
});
|
|
343
350
|
|
|
344
|
-
|
|
351
|
+
_defineProperty(this, "handleEscape", event => {
|
|
352
|
+
//If any dropdown is open inside the floating toolbar 'Esc' key should not
|
|
353
|
+
//focus the editorview. The event cannot be stopped as dropdown is not childnode of floating toolbar
|
|
354
|
+
if (!document.querySelector('[data-role="droplistContent"]')) {
|
|
345
355
|
var _this$props$editorVie;
|
|
346
356
|
|
|
347
|
-
this.currentSelectedItemIndex = 0;
|
|
348
357
|
(_this$props$editorVie = this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
|
|
349
358
|
event.preventDefault();
|
|
350
359
|
event.stopPropagation();
|
|
351
|
-
} else {
|
|
352
|
-
var _this$toolbarContaine2, _this$toolbarContaine3, _this$toolbarContaine4;
|
|
353
|
-
|
|
354
|
-
//To trap the focus inside the toolbar using left and right arrow keys
|
|
355
|
-
const focusableElements = getFocusableElements((_this$toolbarContaine2 = this.toolbarContainerRef) === null || _this$toolbarContaine2 === void 0 ? void 0 : _this$toolbarContaine2.current);
|
|
356
|
-
const firstFocsuableElement = getFirstFocusableElement((_this$toolbarContaine3 = this.toolbarContainerRef) === null || _this$toolbarContaine3 === void 0 ? void 0 : _this$toolbarContaine3.current);
|
|
357
|
-
const lastFocsuableElement = getLastFocusableElement((_this$toolbarContaine4 = this.toolbarContainerRef) === null || _this$toolbarContaine4 === void 0 ? void 0 : _this$toolbarContaine4.current);
|
|
358
|
-
|
|
359
|
-
if (!focusableElements || focusableElements.length === 0) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (event.key === 'ArrowRight') {
|
|
364
|
-
if (this.currentSelectedItemIndex === focusableElements.length - 1) {
|
|
365
|
-
firstFocsuableElement === null || firstFocsuableElement === void 0 ? void 0 : firstFocsuableElement.focus();
|
|
366
|
-
this.currentSelectedItemIndex = 0;
|
|
367
|
-
} else {
|
|
368
|
-
var _focusableElements;
|
|
369
|
-
|
|
370
|
-
(_focusableElements = focusableElements[this.currentSelectedItemIndex + 1]) === null || _focusableElements === void 0 ? void 0 : _focusableElements.focus();
|
|
371
|
-
this.currentSelectedItemIndex++;
|
|
372
|
-
}
|
|
373
|
-
} else if (event.key === 'ArrowLeft') {
|
|
374
|
-
if (this.currentSelectedItemIndex === 0) {
|
|
375
|
-
lastFocsuableElement === null || lastFocsuableElement === void 0 ? void 0 : lastFocsuableElement.focus();
|
|
376
|
-
this.currentSelectedItemIndex = focusableElements.length - 1;
|
|
377
|
-
} else {
|
|
378
|
-
var _focusableElements2;
|
|
379
|
-
|
|
380
|
-
(_focusableElements2 = focusableElements[this.currentSelectedItemIndex - 1]) === null || _focusableElements2 === void 0 ? void 0 : _focusableElements2.focus();
|
|
381
|
-
this.currentSelectedItemIndex--;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
360
|
}
|
|
385
361
|
});
|
|
386
362
|
|
|
@@ -391,7 +367,6 @@ class Toolbar extends Component {
|
|
|
391
367
|
scrollDisabled: false,
|
|
392
368
|
mounted: false
|
|
393
369
|
};
|
|
394
|
-
this.currentSelectedItemIndex = 0;
|
|
395
370
|
} // remove any decorations added by toolbar buttons i.e danger and selected styling
|
|
396
371
|
// this prevents https://product-fabric.atlassian.net/browse/ED-10207
|
|
397
372
|
|
|
@@ -474,15 +449,20 @@ class Toolbar extends Component {
|
|
|
474
449
|
|
|
475
450
|
const firstElementIsSelect = items[0].type === 'select';
|
|
476
451
|
const hasSelect = items.find(item => item.type === 'select' && item.selectType === 'list');
|
|
477
|
-
return jsx(React.Fragment, null, jsx(
|
|
452
|
+
return jsx(React.Fragment, null, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
453
|
+
editorView: this.props.editorView,
|
|
454
|
+
handleEscape: this.handleEscape,
|
|
455
|
+
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
456
|
+
childComponentSelector: "[data-testid='editor-floating-toolbar']"
|
|
457
|
+
}, jsx("div", {
|
|
478
458
|
ref: this.toolbarContainerRef,
|
|
479
459
|
css: theme => [toolbarContainer({
|
|
480
460
|
theme
|
|
481
461
|
}, scrollable, hasSelect !== undefined, firstElementIsSelect)],
|
|
482
462
|
"aria-label": intl.formatMessage(messages.floatingToolbarAriaLabel),
|
|
483
463
|
role: "toolbar",
|
|
484
|
-
|
|
485
|
-
|
|
464
|
+
"data-testid": "editor-floating-toolbar",
|
|
465
|
+
className: className
|
|
486
466
|
}, jsx(Announcer, {
|
|
487
467
|
text: intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
488
468
|
delay: 250
|
|
@@ -500,7 +480,7 @@ class Toolbar extends Component {
|
|
|
500
480
|
disabled: this.state.scrollDisabled
|
|
501
481
|
})), jsx("div", {
|
|
502
482
|
ref: this.mountRef
|
|
503
|
-
}));
|
|
483
|
+
})));
|
|
504
484
|
}
|
|
505
485
|
|
|
506
486
|
}
|
|
@@ -15,24 +15,34 @@ export default defineMessages({
|
|
|
15
15
|
defaultMessage: 'Cancel',
|
|
16
16
|
description: 'Cancel button for floating toolbar confirmation modal.'
|
|
17
17
|
},
|
|
18
|
+
confirmModalListUnit: {
|
|
19
|
+
id: 'fabric.editor.floatingToolbar.confirmModalConnectedUnit',
|
|
20
|
+
defaultMessage: '{name}{amount, plural, =0 {} one { (+1 connected element)} other { (+# connected elements)}}',
|
|
21
|
+
description: 'Text displayed in confirmation modal which highlights the nodes and the amount of connected nodes that will be deleted'
|
|
22
|
+
},
|
|
23
|
+
confirmDeleteLinkedModalMessage: {
|
|
24
|
+
id: 'fabric.editor.extension.confirmDeleteLinkedModalMessage',
|
|
25
|
+
defaultMessage: 'Deleting {nodeName} will break anything connected to it.',
|
|
26
|
+
description: 'Message for confirm modal when deleting a extension linked to an data consumer.'
|
|
27
|
+
},
|
|
18
28
|
floatingToolbarAriaLabel: {
|
|
19
29
|
id: 'fabric.editor.floatingToolbar.floatingToolbarAriaLabel',
|
|
20
30
|
defaultMessage: 'Floating Toolbar',
|
|
21
|
-
description:
|
|
31
|
+
description: "a floating toolbar's aria label"
|
|
22
32
|
},
|
|
23
33
|
floatingToolbarAnnouncer: {
|
|
24
34
|
id: 'fabric.editor.floatingToolbar.floatingToolbarAnnouncer',
|
|
25
35
|
defaultMessage: 'Floating toolbar controls have been opened',
|
|
26
|
-
description:
|
|
36
|
+
description: 'message that will be announced to screenreaders that the floating toolbar is opened'
|
|
27
37
|
},
|
|
28
38
|
floatingToolbarScrollLeft: {
|
|
29
39
|
id: 'fabric.editor.floatingToolbar.scrollLeft',
|
|
30
40
|
defaultMessage: 'Scroll left',
|
|
31
|
-
description:
|
|
41
|
+
description: 'Button to scroll left when the toolbar is in the overflow state'
|
|
32
42
|
},
|
|
33
43
|
floatingToolbarScrollRight: {
|
|
34
44
|
id: 'fabric.editor.floatingToolbar.scrollRight',
|
|
35
45
|
defaultMessage: 'Scroll right',
|
|
36
|
-
description:
|
|
46
|
+
description: 'Button to scroll right when the toolbar is in the overflow state'
|
|
37
47
|
}
|
|
38
48
|
});
|
|
@@ -61,27 +61,14 @@ export function findNode(parent, predicate) {
|
|
|
61
61
|
});
|
|
62
62
|
return matchedNode;
|
|
63
63
|
}
|
|
64
|
-
export function getFirstFocusableElement(rootNode) {
|
|
65
|
-
if (!rootNode) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
70
|
-
return focusableModalElements[0];
|
|
71
|
-
}
|
|
72
64
|
export function getFocusableElements(rootNode) {
|
|
73
65
|
if (!rootNode) {
|
|
74
|
-
return;
|
|
66
|
+
return [];
|
|
75
67
|
}
|
|
76
68
|
|
|
77
69
|
const focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
78
|
-
return focusableModalElements;
|
|
70
|
+
return Array.from(focusableModalElements) || [];
|
|
79
71
|
}
|
|
80
|
-
export function
|
|
81
|
-
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
86
|
-
return focusableModalElements[focusableModalElements.length - 1];
|
|
72
|
+
export function getFirstFocusableElement(rootNode) {
|
|
73
|
+
return getFocusableElements(rootNode)[0];
|
|
87
74
|
}
|