@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
|
@@ -39,20 +39,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
39
39
|
|
|
40
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
41
41
|
|
|
42
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
43
|
-
|
|
44
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
45
|
-
|
|
46
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
47
|
-
|
|
48
42
|
var akGridSize = (0, _constants.gridSize)();
|
|
49
43
|
var toolbarScrollButtons = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: ", "px;\n padding: ", "px ", "px;\n border-left: solid ", " 1px;\n flex-shrink: 0;\n align-items: center;\n"])), akGridSize / 2, akGridSize / 2, akGridSize, (0, _tokens.token)('color.border', _colors.N30));
|
|
50
44
|
var LeftIcon = _chevronLeftLarge.default;
|
|
51
45
|
var RightIcon = _chevronRightLarge.default;
|
|
52
46
|
|
|
53
47
|
var _default = function _default(_ref) {
|
|
54
|
-
var _scrollContainerRef$c, _scrollContainerRef$c2;
|
|
55
|
-
|
|
56
48
|
var intl = _ref.intl,
|
|
57
49
|
scrollContainerRef = _ref.scrollContainerRef,
|
|
58
50
|
node = _ref.node,
|
|
@@ -74,7 +66,6 @@ var _default = function _default(_ref) {
|
|
|
74
66
|
canScrollRight = _useState6[0],
|
|
75
67
|
setCanScrollRight = _useState6[1];
|
|
76
68
|
|
|
77
|
-
var 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) || {});
|
|
78
69
|
var scheduledSetCanScroll = (0, _rafSchd.default)(function () {
|
|
79
70
|
var _ref2 = scrollContainerRef.current,
|
|
80
71
|
scrollLeft = _ref2.scrollLeft,
|
|
@@ -89,115 +80,44 @@ var _default = function _default(_ref) {
|
|
|
89
80
|
};
|
|
90
81
|
|
|
91
82
|
var scrollLeft = function scrollLeft() {
|
|
92
|
-
|
|
93
|
-
var _iterator = _createForOfIteratorHelper(items.reverse().entries()),
|
|
94
|
-
_step;
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
98
|
-
var _scrollContainerRef$c3;
|
|
99
|
-
|
|
100
|
-
var _step$value = (0, _slicedToArray2.default)(_step.value, 2),
|
|
101
|
-
itemIndex = _step$value[0],
|
|
102
|
-
item = _step$value[1];
|
|
103
|
-
|
|
104
|
-
var _item$getBoundingClie = item.getBoundingClientRect(),
|
|
105
|
-
itemLeft = _item$getBoundingClie.left,
|
|
106
|
-
itemWidth = _item$getBoundingClie.width;
|
|
107
|
-
|
|
108
|
-
var _ref3 = ((_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.getBoundingClientRect()) || {},
|
|
109
|
-
_ref3$left = _ref3.left,
|
|
110
|
-
scrollContainerLeft = _ref3$left === void 0 ? 0 : _ref3$left,
|
|
111
|
-
_ref3$width = _ref3.width,
|
|
112
|
-
scrollContainerWidth = _ref3$width === void 0 ? 0 : _ref3$width; // if item is partially visible on the left, scroll to it so it became the last item visible
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (itemLeft <= scrollContainerLeft) {
|
|
116
|
-
var _scrollContainerRef$c4, _scrollContainerRef$c5;
|
|
117
|
-
|
|
118
|
-
var gap = scrollContainerWidth - itemWidth;
|
|
119
|
-
var scrollTo = item.offsetLeft - gap; // if scrollTo is same as current scrollLeft
|
|
120
|
-
|
|
121
|
-
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)) {
|
|
122
|
-
// if this is the first item, scroll to the beginning, otherwise find next item to scroll to
|
|
123
|
-
if (itemIndex === items.length - 1) {
|
|
124
|
-
scrollTo = 0;
|
|
125
|
-
} else {
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : (_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.scrollTo({
|
|
131
|
-
top: 0,
|
|
132
|
-
left: scrollTo,
|
|
133
|
-
behavior: 'smooth'
|
|
134
|
-
});
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
} catch (err) {
|
|
139
|
-
_iterator.e(err);
|
|
140
|
-
} finally {
|
|
141
|
-
_iterator.f();
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
var scrollRight = function scrollRight() {
|
|
146
|
-
// find the last item partially visible
|
|
147
|
-
var _iterator2 = _createForOfIteratorHelper(items),
|
|
148
|
-
_step2;
|
|
83
|
+
var _scrollContainerRef$c, _scrollContainerRef$c2, _scrollContainerRef$c3;
|
|
149
84
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
85
|
+
var _ref3 = ((_scrollContainerRef$c = scrollContainerRef.current) === null || _scrollContainerRef$c === void 0 ? void 0 : _scrollContainerRef$c.getBoundingClientRect()) || {},
|
|
86
|
+
_ref3$width = _ref3.width,
|
|
87
|
+
scrollContainerWidth = _ref3$width === void 0 ? 0 : _ref3$width;
|
|
153
88
|
|
|
154
|
-
|
|
89
|
+
var scrollLeft = ((_scrollContainerRef$c2 = scrollContainerRef.current) === null || _scrollContainerRef$c2 === void 0 ? void 0 : _scrollContainerRef$c2.scrollLeft) || 0; // scroll to current position - scroll container width
|
|
155
90
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
_ref4$width = _ref4.width,
|
|
164
|
-
scrollContainerWidth = _ref4$width === void 0 ? 0 : _ref4$width; // if item is partially visible on the right
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (itemLeft + itemWidth >= scrollContainerLeft + scrollContainerWidth) {
|
|
168
|
-
var _scrollContainerRef$c7, _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
169
|
-
|
|
170
|
-
var scrollTo = item.offsetLeft; // if the item is longer than the entire container width, just scroll past it
|
|
91
|
+
var scrollTo = scrollLeft - scrollContainerWidth;
|
|
92
|
+
(_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.scrollTo({
|
|
93
|
+
top: 0,
|
|
94
|
+
left: scrollTo,
|
|
95
|
+
behavior: 'smooth'
|
|
96
|
+
});
|
|
97
|
+
};
|
|
171
98
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
} // if scrollTo is same as current scrollLeft, find next item to scroll to
|
|
99
|
+
var scrollRight = function scrollRight() {
|
|
100
|
+
var _scrollContainerRef$c4, _scrollContainerRef$c5, _scrollContainerRef$c6;
|
|
175
101
|
|
|
102
|
+
var _ref4 = ((_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 ? void 0 : _scrollContainerRef$c4.getBoundingClientRect()) || {},
|
|
103
|
+
_ref4$width = _ref4.width,
|
|
104
|
+
scrollContainerWidth = _ref4$width === void 0 ? 0 : _ref4$width;
|
|
176
105
|
|
|
177
|
-
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
106
|
+
var scrollLeft = ((_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.scrollLeft) || 0; // scroll to current position + scroll container width
|
|
180
107
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
} catch (err) {
|
|
190
|
-
_iterator2.e(err);
|
|
191
|
-
} finally {
|
|
192
|
-
_iterator2.f();
|
|
193
|
-
}
|
|
108
|
+
var scrollTo = scrollLeft + scrollContainerWidth;
|
|
109
|
+
(_scrollContainerRef$c6 = scrollContainerRef.current) === null || _scrollContainerRef$c6 === void 0 ? void 0 : _scrollContainerRef$c6.scrollTo({
|
|
110
|
+
top: 0,
|
|
111
|
+
left: scrollTo,
|
|
112
|
+
behavior: 'smooth'
|
|
113
|
+
});
|
|
194
114
|
};
|
|
195
115
|
|
|
196
116
|
var resizeObserver = new ResizeObserver(function (t) {
|
|
197
|
-
var _scrollContainerRef$
|
|
117
|
+
var _scrollContainerRef$c7, _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
198
118
|
|
|
199
|
-
var widthNeededToShowAllItems = ((_scrollContainerRef$
|
|
200
|
-
var availableSpace = (_scrollContainerRef$
|
|
119
|
+
var widthNeededToShowAllItems = ((_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 ? void 0 : _scrollContainerRef$c7.scrollWidth) || 0;
|
|
120
|
+
var 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;
|
|
201
121
|
|
|
202
122
|
if (availableSpace >= widthNeededToShowAllItems) {
|
|
203
123
|
setNeedScroll(false);
|
|
@@ -230,7 +150,8 @@ var _default = function _default(_ref) {
|
|
|
230
150
|
}, [node, scrollContainerRef]);
|
|
231
151
|
return needScroll ? (0, _react2.jsx)("div", {
|
|
232
152
|
ref: buttonsContainerRef,
|
|
233
|
-
css: toolbarScrollButtons
|
|
153
|
+
css: toolbarScrollButtons,
|
|
154
|
+
className: "scroll-buttons"
|
|
234
155
|
}, (0, _react2.jsx)(_Button.default, {
|
|
235
156
|
title: intl.formatMessage(_messages.default.floatingToolbarScrollLeft),
|
|
236
157
|
icon: (0, _react2.jsx)(LeftIcon, {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.SimpleModal = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
15
|
+
|
|
16
|
+
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
17
|
+
|
|
18
|
+
var _messages = _interopRequireDefault(require("./messages"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
var SimpleModal = function SimpleModal(props) {
|
|
25
|
+
var onConfirm = props.onConfirm,
|
|
26
|
+
onClose = props.onClose,
|
|
27
|
+
options = props.options,
|
|
28
|
+
formatMessage = props.intl.formatMessage,
|
|
29
|
+
testId = props.testId;
|
|
30
|
+
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(_messages.default.confirmModalDefaultHeading);
|
|
31
|
+
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
|
|
32
|
+
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
34
|
+
onClose: onClose,
|
|
35
|
+
testId: testId
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
37
|
+
appearance: "warning"
|
|
38
|
+
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
39
|
+
appearance: "default",
|
|
40
|
+
onClick: onClose,
|
|
41
|
+
testId: testId ? "".concat(testId, "-cancel-button") : undefined
|
|
42
|
+
}, cancelButtonLabel), /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
43
|
+
appearance: "warning",
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
return onConfirm();
|
|
46
|
+
},
|
|
47
|
+
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
48
|
+
}, okButtonLabel)));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.SimpleModal = SimpleModal;
|
|
@@ -73,6 +73,8 @@ var _decoration = require("../../base/pm-plugins/decoration");
|
|
|
73
73
|
|
|
74
74
|
var _ScrollButtons = _interopRequireDefault(require("./ScrollButtons"));
|
|
75
75
|
|
|
76
|
+
var _ToolbarArrowKeyNavigationProvider = require("../../../ui/ToolbarArrowKeyNavigationProvider");
|
|
77
|
+
|
|
76
78
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
77
79
|
|
|
78
80
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -112,6 +114,10 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
112
114
|
dispatchCommand((0, _commands.showConfirmDialog)(idx));
|
|
113
115
|
} else {
|
|
114
116
|
dispatchCommand(item.onClick);
|
|
117
|
+
|
|
118
|
+
if (item.focusEditoronEnter && !(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
119
|
+
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
120
|
+
}
|
|
115
121
|
}
|
|
116
122
|
};
|
|
117
123
|
|
|
@@ -185,6 +191,8 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
185
191
|
scrollableElement: popupsScrollableElement,
|
|
186
192
|
dropdownWidth: item.dropdownWidth,
|
|
187
193
|
showSelected: item.showSelected,
|
|
194
|
+
buttonTestId: item.testId,
|
|
195
|
+
editorView: editorView,
|
|
188
196
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined
|
|
189
197
|
});
|
|
190
198
|
|
|
@@ -385,56 +393,24 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
385
393
|
(_getFirstFocusableEle = (0, _utils.getFirstFocusableElement)((_this$toolbarContaine = _this.toolbarContainerRef) === null || _this$toolbarContaine === void 0 ? void 0 : _this$toolbarContaine.current)) === null || _getFirstFocusableEle === void 0 ? void 0 : _getFirstFocusableEle.focus();
|
|
386
394
|
}
|
|
387
395
|
});
|
|
388
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
396
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "shouldHandleArrowKeys", function () {
|
|
389
397
|
var _this$props$items;
|
|
390
398
|
|
|
391
|
-
//To prevent the keydown
|
|
392
|
-
|
|
399
|
+
//To prevent the keydown handling of arrow keys for custom toolbar items with 'disableArrowNavigation' prop enabled,
|
|
400
|
+
//Usually the button which has menus or popups
|
|
401
|
+
return !((_this$props$items = _this.props.items) !== null && _this$props$items !== void 0 && _this$props$items.find(function (item) {
|
|
393
402
|
return item.type === 'custom' && item.disableArrowNavigation;
|
|
394
|
-
}))
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
403
|
+
}));
|
|
404
|
+
});
|
|
405
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEscape", function (event) {
|
|
406
|
+
//If any dropdown is open inside the floating toolbar 'Esc' key should not
|
|
407
|
+
//focus the editorview. The event cannot be stopped as dropdown is not childnode of floating toolbar
|
|
408
|
+
if (!document.querySelector('[data-role="droplistContent"]')) {
|
|
399
409
|
var _this$props$editorVie;
|
|
400
410
|
|
|
401
|
-
_this.currentSelectedItemIndex = 0;
|
|
402
411
|
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
|
|
403
412
|
event.preventDefault();
|
|
404
413
|
event.stopPropagation();
|
|
405
|
-
} else {
|
|
406
|
-
var _this$toolbarContaine2, _this$toolbarContaine3, _this$toolbarContaine4;
|
|
407
|
-
|
|
408
|
-
//To trap the focus inside the toolbar using left and right arrow keys
|
|
409
|
-
var focusableElements = (0, _utils.getFocusableElements)((_this$toolbarContaine2 = _this.toolbarContainerRef) === null || _this$toolbarContaine2 === void 0 ? void 0 : _this$toolbarContaine2.current);
|
|
410
|
-
var firstFocsuableElement = (0, _utils.getFirstFocusableElement)((_this$toolbarContaine3 = _this.toolbarContainerRef) === null || _this$toolbarContaine3 === void 0 ? void 0 : _this$toolbarContaine3.current);
|
|
411
|
-
var lastFocsuableElement = (0, _utils.getLastFocusableElement)((_this$toolbarContaine4 = _this.toolbarContainerRef) === null || _this$toolbarContaine4 === void 0 ? void 0 : _this$toolbarContaine4.current);
|
|
412
|
-
|
|
413
|
-
if (!focusableElements || focusableElements.length === 0) {
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (event.key === 'ArrowRight') {
|
|
418
|
-
if (_this.currentSelectedItemIndex === focusableElements.length - 1) {
|
|
419
|
-
firstFocsuableElement === null || firstFocsuableElement === void 0 ? void 0 : firstFocsuableElement.focus();
|
|
420
|
-
_this.currentSelectedItemIndex = 0;
|
|
421
|
-
} else {
|
|
422
|
-
var _focusableElements;
|
|
423
|
-
|
|
424
|
-
(_focusableElements = focusableElements[_this.currentSelectedItemIndex + 1]) === null || _focusableElements === void 0 ? void 0 : _focusableElements.focus();
|
|
425
|
-
_this.currentSelectedItemIndex++;
|
|
426
|
-
}
|
|
427
|
-
} else if (event.key === 'ArrowLeft') {
|
|
428
|
-
if (_this.currentSelectedItemIndex === 0) {
|
|
429
|
-
lastFocsuableElement === null || lastFocsuableElement === void 0 ? void 0 : lastFocsuableElement.focus();
|
|
430
|
-
_this.currentSelectedItemIndex = focusableElements.length - 1;
|
|
431
|
-
} else {
|
|
432
|
-
var _focusableElements2;
|
|
433
|
-
|
|
434
|
-
(_focusableElements2 = focusableElements[_this.currentSelectedItemIndex - 1]) === null || _focusableElements2 === void 0 ? void 0 : _focusableElements2.focus();
|
|
435
|
-
_this.currentSelectedItemIndex--;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
414
|
}
|
|
439
415
|
});
|
|
440
416
|
_this.scrollContainerRef = /*#__PURE__*/_react.default.createRef();
|
|
@@ -444,7 +420,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
444
420
|
scrollDisabled: false,
|
|
445
421
|
mounted: false
|
|
446
422
|
};
|
|
447
|
-
_this.currentSelectedItemIndex = 0;
|
|
448
423
|
return _this;
|
|
449
424
|
} // remove any decorations added by toolbar buttons i.e danger and selected styling
|
|
450
425
|
// this prevents https://product-fabric.atlassian.net/browse/ED-10207
|
|
@@ -537,7 +512,12 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
537
512
|
var hasSelect = items.find(function (item) {
|
|
538
513
|
return item.type === 'select' && item.selectType === 'list';
|
|
539
514
|
});
|
|
540
|
-
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
515
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_ToolbarArrowKeyNavigationProvider.ToolbarArrowKeyNavigationProvider, {
|
|
516
|
+
editorView: this.props.editorView,
|
|
517
|
+
handleEscape: this.handleEscape,
|
|
518
|
+
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
519
|
+
childComponentSelector: "[data-testid='editor-floating-toolbar']"
|
|
520
|
+
}, (0, _react2.jsx)("div", {
|
|
541
521
|
ref: this.toolbarContainerRef,
|
|
542
522
|
css: function css(theme) {
|
|
543
523
|
return [toolbarContainer({
|
|
@@ -546,8 +526,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
546
526
|
},
|
|
547
527
|
"aria-label": intl.formatMessage(_messages.default.floatingToolbarAriaLabel),
|
|
548
528
|
role: "toolbar",
|
|
549
|
-
|
|
550
|
-
|
|
529
|
+
"data-testid": "editor-floating-toolbar",
|
|
530
|
+
className: className
|
|
551
531
|
}, (0, _react2.jsx)(_announcer.default, {
|
|
552
532
|
text: intl.formatMessage(_messages.default.floatingToolbarAnnouncer),
|
|
553
533
|
delay: 250
|
|
@@ -565,7 +545,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
565
545
|
disabled: this.state.scrollDisabled
|
|
566
546
|
})), (0, _react2.jsx)("div", {
|
|
567
547
|
ref: this.mountRef
|
|
568
|
-
}));
|
|
548
|
+
})));
|
|
569
549
|
}
|
|
570
550
|
}]);
|
|
571
551
|
return Toolbar;
|
|
@@ -23,6 +23,16 @@ var _default = (0, _reactIntlNext.defineMessages)({
|
|
|
23
23
|
defaultMessage: 'Cancel',
|
|
24
24
|
description: 'Cancel button for floating toolbar confirmation modal.'
|
|
25
25
|
},
|
|
26
|
+
confirmModalListUnit: {
|
|
27
|
+
id: 'fabric.editor.floatingToolbar.confirmModalConnectedUnit',
|
|
28
|
+
defaultMessage: '{name}{amount, plural, =0 {} one { (+1 connected element)} other { (+# connected elements)}}',
|
|
29
|
+
description: 'Text displayed in confirmation modal which highlights the nodes and the amount of connected nodes that will be deleted'
|
|
30
|
+
},
|
|
31
|
+
confirmDeleteLinkedModalMessage: {
|
|
32
|
+
id: 'fabric.editor.extension.confirmDeleteLinkedModalMessage',
|
|
33
|
+
defaultMessage: 'Deleting {nodeName} will break anything connected to it.',
|
|
34
|
+
description: 'Message for confirm modal when deleting a extension linked to an data consumer.'
|
|
35
|
+
},
|
|
26
36
|
floatingToolbarAriaLabel: {
|
|
27
37
|
id: 'fabric.editor.floatingToolbar.floatingToolbarAriaLabel',
|
|
28
38
|
defaultMessage: 'Floating Toolbar',
|
|
@@ -31,17 +41,17 @@ var _default = (0, _reactIntlNext.defineMessages)({
|
|
|
31
41
|
floatingToolbarAnnouncer: {
|
|
32
42
|
id: 'fabric.editor.floatingToolbar.floatingToolbarAnnouncer',
|
|
33
43
|
defaultMessage: 'Floating toolbar controls have been opened',
|
|
34
|
-
description:
|
|
44
|
+
description: 'message that will be announced to screenreaders that the floating toolbar is opened'
|
|
35
45
|
},
|
|
36
46
|
floatingToolbarScrollLeft: {
|
|
37
47
|
id: 'fabric.editor.floatingToolbar.scrollLeft',
|
|
38
48
|
defaultMessage: 'Scroll left',
|
|
39
|
-
description:
|
|
49
|
+
description: 'Button to scroll left when the toolbar is in the overflow state'
|
|
40
50
|
},
|
|
41
51
|
floatingToolbarScrollRight: {
|
|
42
52
|
id: 'fabric.editor.floatingToolbar.scrollRight',
|
|
43
53
|
defaultMessage: 'Scroll right',
|
|
44
|
-
description:
|
|
54
|
+
description: 'Button to scroll right when the toolbar is in the overflow state'
|
|
45
55
|
}
|
|
46
56
|
});
|
|
47
57
|
|
|
@@ -7,7 +7,6 @@ exports.compareArrays = void 0;
|
|
|
7
7
|
exports.findNode = findNode;
|
|
8
8
|
exports.getFirstFocusableElement = getFirstFocusableElement;
|
|
9
9
|
exports.getFocusableElements = getFocusableElements;
|
|
10
|
-
exports.getLastFocusableElement = getLastFocusableElement;
|
|
11
10
|
exports.shallowEqual = void 0;
|
|
12
11
|
|
|
13
12
|
var shallowEqual = function shallowEqual(objA, objB) {
|
|
@@ -82,29 +81,15 @@ function findNode(parent, predicate) {
|
|
|
82
81
|
return matchedNode;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
function getFirstFocusableElement(rootNode) {
|
|
86
|
-
if (!rootNode) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
91
|
-
return focusableModalElements[0];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
84
|
function getFocusableElements(rootNode) {
|
|
95
85
|
if (!rootNode) {
|
|
96
|
-
return;
|
|
86
|
+
return [];
|
|
97
87
|
}
|
|
98
88
|
|
|
99
89
|
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
100
|
-
return focusableModalElements;
|
|
90
|
+
return Array.from(focusableModalElements) || [];
|
|
101
91
|
}
|
|
102
92
|
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
109
|
-
return focusableModalElements[focusableModalElements.length - 1];
|
|
93
|
+
function getFirstFocusableElement(rootNode) {
|
|
94
|
+
return getFocusableElements(rootNode)[0];
|
|
110
95
|
}
|
|
@@ -74,7 +74,8 @@ function createPlugin(dispatch, imageEnabled) {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
var helpDialog = function helpDialog(
|
|
77
|
+
var helpDialog = function helpDialog() {
|
|
78
|
+
var imageUploadProviderExists = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
78
79
|
return {
|
|
79
80
|
name: 'helpDialog',
|
|
80
81
|
pmPlugins: function pmPlugins() {
|
|
@@ -82,7 +83,7 @@ var helpDialog = function helpDialog(legacyImageUploadProvider) {
|
|
|
82
83
|
name: 'helpDialog',
|
|
83
84
|
plugin: function plugin(_ref) {
|
|
84
85
|
var dispatch = _ref.dispatch;
|
|
85
|
-
return createPlugin(dispatch,
|
|
86
|
+
return createPlugin(dispatch, imageUploadProviderExists);
|
|
86
87
|
}
|
|
87
88
|
}, {
|
|
88
89
|
name: 'helpDialogKeymap',
|
|
@@ -110,6 +110,17 @@ var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
110
110
|
var formatMessage = intl.formatMessage;
|
|
111
111
|
|
|
112
112
|
var linkState = _main.stateKey.getState(state);
|
|
113
|
+
/**
|
|
114
|
+
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
var _getFeatureFlags2 = (0, _featureFlagsContext.getFeatureFlags)(state),
|
|
119
|
+
lpLinkPicker = _getFeatureFlags2.lpLinkPicker,
|
|
120
|
+
lpLinkPickerFocusTrap = _getFeatureFlags2.lpLinkPickerFocusTrap,
|
|
121
|
+
preventPopupOverflow = _getFeatureFlags2.preventPopupOverflow;
|
|
122
|
+
|
|
123
|
+
var shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
113
124
|
|
|
114
125
|
if (linkState && linkState.activeLinkMark) {
|
|
115
126
|
var activeLinkMark = linkState.activeLinkMark;
|
|
@@ -214,6 +225,8 @@ var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
214
225
|
case 'EDIT_INSERTED':
|
|
215
226
|
case 'INSERT':
|
|
216
227
|
{
|
|
228
|
+
var _options$linkPicker, _options$linkPicker$p;
|
|
229
|
+
|
|
217
230
|
var _link;
|
|
218
231
|
|
|
219
232
|
if (isEditLink(activeLinkMark) && activeLinkMark.node) {
|
|
@@ -225,9 +238,12 @@ var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
225
238
|
}
|
|
226
239
|
|
|
227
240
|
var displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
|
|
241
|
+
var popupHeight = lpLinkPicker && Boolean(options === null || options === void 0 ? void 0 : (_options$linkPicker = options.linkPicker) === null || _options$linkPicker === void 0 ? void 0 : (_options$linkPicker$p = _options$linkPicker.plugins) === null || _options$linkPicker$p === void 0 ? void 0 : _options$linkPicker$p.length) ? _ToolbarComponents.LINKPICKER_HEIGHT_IN_PX : _ToolbarComponents.RECENT_SEARCH_HEIGHT_IN_PX;
|
|
228
242
|
return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
|
|
229
|
-
|
|
243
|
+
preventPopupOverflow: preventPopupOverflow,
|
|
244
|
+
height: popupHeight,
|
|
230
245
|
width: _ToolbarComponents.RECENT_SEARCH_WIDTH_IN_PX,
|
|
246
|
+
focusTrap: shouldEnableFocusTrap,
|
|
231
247
|
items: [{
|
|
232
248
|
type: 'custom',
|
|
233
249
|
fallback: [],
|
|
@@ -244,6 +260,9 @@ var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
244
260
|
displayUrl: _link,
|
|
245
261
|
displayText: displayText || '',
|
|
246
262
|
providerFactory: providerFactory,
|
|
263
|
+
onCancel: function onCancel() {
|
|
264
|
+
return view.focus();
|
|
265
|
+
},
|
|
247
266
|
onSubmit: function onSubmit(href) {
|
|
248
267
|
var _options$cardOptions;
|
|
249
268
|
|
|
@@ -23,7 +23,7 @@ var _commands = require("../../commands");
|
|
|
23
23
|
|
|
24
24
|
var _useEscapeClickaway = require("./useEscapeClickaway");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["view"];
|
|
26
|
+
var _excluded = ["view", "onCancel"];
|
|
27
27
|
|
|
28
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
29
|
|
|
@@ -31,14 +31,17 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
31
31
|
|
|
32
32
|
var EditorLinkPicker = function EditorLinkPicker(_ref) {
|
|
33
33
|
var view = _ref.view,
|
|
34
|
+
onCancel = _ref.onCancel,
|
|
34
35
|
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
35
36
|
var onEscape = (0, _react.useCallback)(function () {
|
|
36
37
|
(0, _commands.hideLinkToolbar)()(view.state, view.dispatch);
|
|
37
38
|
view.dispatch((0, _actions.hideLinkToolbar)(view.state.tr));
|
|
38
|
-
|
|
39
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
40
|
+
}, [view, onCancel]);
|
|
39
41
|
var onClickAway = (0, _react.useCallback)(function () {
|
|
40
42
|
(0, _commands.hideLinkToolbar)()(view.state, view.dispatch);
|
|
41
|
-
|
|
43
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
44
|
+
}, [view, onCancel]);
|
|
42
45
|
var ref = (0, _useEscapeClickaway.useEscapeClickaway)(onEscape, onClickAway);
|
|
43
46
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
44
47
|
ref: ref
|
|
@@ -73,7 +73,8 @@ var HyperlinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
73
73
|
displayText = _this$props.displayText,
|
|
74
74
|
displayUrl = _this$props.displayUrl,
|
|
75
75
|
providerFactory = _this$props.providerFactory,
|
|
76
|
-
view = _this$props.view
|
|
76
|
+
view = _this$props.view,
|
|
77
|
+
onCancel = _this$props.onCancel;
|
|
77
78
|
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders, {
|
|
78
79
|
providers: ['activityProvider', 'searchProvider'],
|
|
79
80
|
providerFactory: providerFactory,
|
|
@@ -86,25 +87,19 @@ var HyperlinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
86
87
|
hyperlinkPluginState: _main.stateKey
|
|
87
88
|
},
|
|
88
89
|
render: function render(_ref3) {
|
|
89
|
-
var _linkPickerOptions$pl;
|
|
90
|
-
|
|
91
90
|
var hyperlinkPluginState = _ref3.hyperlinkPluginState;
|
|
92
91
|
|
|
93
92
|
var _getFeatureFlags = (0, _featureFlagsContext.getFeatureFlags)(view.state),
|
|
94
93
|
lpLinkPicker = _getFeatureFlags.lpLinkPicker;
|
|
95
|
-
/**
|
|
96
|
-
* If activityProvider or searchProvider are present then only enable if there are plugins supplied to
|
|
97
|
-
* faciliate providing link search capabilities
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
94
|
|
|
101
|
-
if (lpLinkPicker
|
|
95
|
+
if (lpLinkPicker) {
|
|
102
96
|
return /*#__PURE__*/_react.default.createElement(_EditorLinkPicker.EditorLinkPicker, (0, _extends2.default)({
|
|
103
97
|
view: view
|
|
104
98
|
}, linkPickerOptions, {
|
|
105
99
|
url: displayUrl,
|
|
106
100
|
displayText: displayText,
|
|
107
|
-
onSubmit: onSubmitInterface(onSubmit)
|
|
101
|
+
onSubmit: onSubmitInterface(onSubmit),
|
|
102
|
+
onCancel: onCancel
|
|
108
103
|
}));
|
|
109
104
|
}
|
|
110
105
|
|
|
@@ -45,7 +45,8 @@ var DropDownButton = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
45
45
|
spacing: props.spacing,
|
|
46
46
|
"aria-expanded": props['aria-expanded'],
|
|
47
47
|
"aria-haspopup": props['aria-haspopup'],
|
|
48
|
-
"aria-
|
|
48
|
+
"aria-keyshortcuts": props['aria-keyshortcuts'],
|
|
49
|
+
"aria-label": "".concat(props.label, " /"),
|
|
49
50
|
iconBefore: (0, _react2.jsx)(DropDownButtonIcon, {
|
|
50
51
|
label: ""
|
|
51
52
|
}),
|