@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
|
@@ -43,7 +43,7 @@ function getSpellCheck(featureFlags) {
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
function createFeatureFlagsFromProps(props) {
|
|
46
|
-
var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$collabEdit, _props$collabEdit2, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39;
|
|
46
|
+
var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$collabEdit, _props$collabEdit2, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42;
|
|
47
47
|
|
|
48
48
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
49
49
|
var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
@@ -51,11 +51,9 @@ function createFeatureFlagsFromProps(props) {
|
|
|
51
51
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
52
52
|
interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
|
|
53
53
|
placeholderBracketHint: !!props.placeholderBracketHint,
|
|
54
|
-
placeholderHints: Array.isArray(props.placeholderHints) && props.placeholderHints.length > 0,
|
|
55
54
|
moreTextColors: typeof props.allowTextColor === 'boolean' ? false : Boolean(((_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) === true),
|
|
56
55
|
findReplace: !!props.allowFindReplace,
|
|
57
56
|
findReplaceMatchCase: (0, _typeof2.default)(props.allowFindReplace) === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
|
|
58
|
-
keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
|
|
59
57
|
addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
|
|
60
58
|
singleLayout: (0, _typeof2.default)(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
61
59
|
undoRedoButtons: props.allowUndoRedoButtons,
|
|
@@ -76,17 +74,19 @@ function createFeatureFlagsFromProps(props) {
|
|
|
76
74
|
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
|
|
77
75
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
78
76
|
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
79
|
-
viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
|
|
80
77
|
tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
|
|
81
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
82
|
-
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
83
|
-
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$
|
|
84
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
78
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.showHoverPreview) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.showHoverPreview) : false),
|
|
79
|
+
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.indentationButtonsInTheToolbar) : false)),
|
|
80
|
+
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.floatingToolbarCopyButton) : false)),
|
|
81
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
85
82
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
86
83
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
87
84
|
// are included (they are not kebab cased)
|
|
88
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
89
|
-
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$
|
|
90
|
-
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$
|
|
85
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.restartNumberedLists) === true,
|
|
86
|
+
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.listNumberContinuity) === true,
|
|
87
|
+
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedListsToolbar) === true,
|
|
88
|
+
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags40 = props.featureFlags) !== null && _props$featureFlags40 !== void 0 && _props$featureFlags40.useSomewhatSemanticTextColorNames) : false)),
|
|
89
|
+
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
90
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42['prevent-popup-overflow']) : false)
|
|
91
91
|
});
|
|
92
92
|
}
|
|
@@ -47,6 +47,8 @@ var _types = require("../../analytics/types");
|
|
|
47
47
|
|
|
48
48
|
var _keymaps = require("../../../keymaps");
|
|
49
49
|
|
|
50
|
+
var _keymaps2 = require("@atlaskit/editor-common/keymaps");
|
|
51
|
+
|
|
50
52
|
var _templateObject, _templateObject2, _templateObject3;
|
|
51
53
|
|
|
52
54
|
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); }
|
|
@@ -114,6 +116,7 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
114
116
|
takeFullWidth = _this$props.takeFullWidth;
|
|
115
117
|
var title = formatMessage(messages.findReplaceToolbarButton);
|
|
116
118
|
var stackBelowOtherEditorFloatingPanels = _editorSharedStyles.akEditorFloatingPanelZIndex - 1;
|
|
119
|
+
var keymap = (0, _keymaps.findKeymapByDescription)('Find');
|
|
117
120
|
return (0, _react2.jsx)("div", {
|
|
118
121
|
css: [toolbarButtonWrapper, takeFullWidth && toolbarButtonWrapperFullWith]
|
|
119
122
|
}, (0, _react2.jsx)(_Dropdown.default, {
|
|
@@ -137,14 +140,16 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
140
|
selected: isActive,
|
|
138
141
|
title: (0, _react2.jsx)(_keymaps.ToolTipContent, {
|
|
139
142
|
description: title,
|
|
140
|
-
keymap:
|
|
143
|
+
keymap: keymap
|
|
141
144
|
}),
|
|
142
145
|
iconBefore: (0, _react2.jsx)(_search.default, {
|
|
143
146
|
label: title
|
|
144
147
|
}),
|
|
145
148
|
onClick: this.toggleOpen,
|
|
146
149
|
"aria-expanded": isActive,
|
|
147
|
-
"aria-haspopup": true
|
|
150
|
+
"aria-haspopup": true,
|
|
151
|
+
"aria-label": keymap ? (0, _keymaps.tooltip)(keymap, title) : title,
|
|
152
|
+
"aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(keymap)
|
|
148
153
|
})
|
|
149
154
|
}, (0, _react2.jsx)("div", {
|
|
150
155
|
css: wrapper
|
|
@@ -224,7 +224,9 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
|
224
224
|
_config$offset = config.offset,
|
|
225
225
|
offset = _config$offset === void 0 ? [0, 12] : _config$offset,
|
|
226
226
|
forcePlacement = config.forcePlacement,
|
|
227
|
-
|
|
227
|
+
preventPopupOverflow = config.preventPopupOverflow,
|
|
228
|
+
onPositionCalculated = config.onPositionCalculated,
|
|
229
|
+
focusTrap = config.focusTrap;
|
|
228
230
|
var targetRef = getDomRef(editorView, dispatchAnalyticsEvent);
|
|
229
231
|
|
|
230
232
|
if (!targetRef || editorDisabledPlugin && editorDisabledPlugin.editorDisabled) {
|
|
@@ -250,6 +252,7 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
|
250
252
|
|
|
251
253
|
var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
252
254
|
var scrollable = (0, _featureFlagsContext.getFeatureFlags)(editorView.state).floatingToolbarCopyButton && config.scrollable;
|
|
255
|
+
var confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
|
|
253
256
|
return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.ErrorBoundary, {
|
|
254
257
|
component: _analytics.ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
255
258
|
componentId: (0, _camelCase.default)(title),
|
|
@@ -272,7 +275,9 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
|
272
275
|
onPositionCalculated: customPositionCalculation,
|
|
273
276
|
style: scrollable ? {
|
|
274
277
|
maxWidth: '100%'
|
|
275
|
-
} : {}
|
|
278
|
+
} : {},
|
|
279
|
+
focusTrap: focusTrap,
|
|
280
|
+
preventOverflow: preventPopupOverflow
|
|
276
281
|
}, /*#__PURE__*/_react.default.createElement(_ToolbarLoader.ToolbarLoader, {
|
|
277
282
|
target: targetRef,
|
|
278
283
|
items: toolbarItems,
|
|
@@ -291,9 +296,16 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
|
291
296
|
extensionsProvider: extensionsState === null || extensionsState === void 0 ? void 0 : extensionsState.extensionProvider,
|
|
292
297
|
scrollable: scrollable
|
|
293
298
|
})), /*#__PURE__*/_react.default.createElement(_ConfirmationModal.ConfirmationModal, {
|
|
294
|
-
options:
|
|
299
|
+
options: confirmDialogOptions,
|
|
295
300
|
onConfirm: function onConfirm() {
|
|
296
|
-
|
|
301
|
+
var isChecked = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
302
|
+
|
|
303
|
+
if (!!confirmDialogOptions.onConfirm) {
|
|
304
|
+
dispatchCommand(confirmDialogOptions.onConfirm(isChecked));
|
|
305
|
+
} else {
|
|
306
|
+
dispatchCommand(confirmButtonItem.onClick);
|
|
307
|
+
}
|
|
308
|
+
|
|
297
309
|
dispatchCommand((0, _commands.hideConfirmDialog)());
|
|
298
310
|
} // When closed without clicking OK or cancel buttons
|
|
299
311
|
,
|
|
@@ -0,0 +1,99 @@
|
|
|
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.CheckboxModal = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
19
|
+
|
|
20
|
+
var _checkbox = require("@atlaskit/checkbox");
|
|
21
|
+
|
|
22
|
+
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
23
|
+
|
|
24
|
+
var _messages = _interopRequireDefault(require("./messages"));
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var CheckboxModal = function CheckboxModal(props) {
|
|
31
|
+
var _useState = (0, _react.useState)(false),
|
|
32
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
+
isChecked = _useState2[0],
|
|
34
|
+
setCheckbox = _useState2[1];
|
|
35
|
+
|
|
36
|
+
var onConfirm = props.onConfirm,
|
|
37
|
+
onClose = props.onClose,
|
|
38
|
+
options = props.options,
|
|
39
|
+
formatMessage = props.intl.formatMessage,
|
|
40
|
+
testId = props.testId;
|
|
41
|
+
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(_messages.default.confirmModalDefaultHeading);
|
|
42
|
+
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
|
|
43
|
+
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
|
|
44
|
+
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
45
|
+
|
|
46
|
+
var ListComponent = function ListComponent(_ref) {
|
|
47
|
+
var nodes = _ref.nodes;
|
|
48
|
+
|
|
49
|
+
if (!nodes) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement("ul", null, nodes.map(function (node) {
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(ListItem, (0, _extends2.default)({}, node, {
|
|
55
|
+
key: node.id
|
|
56
|
+
}));
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var ListItem = function ListItem(props) {
|
|
61
|
+
var id = props.id,
|
|
62
|
+
name = props.name,
|
|
63
|
+
amount = props.amount;
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
65
|
+
id: id
|
|
66
|
+
}, formatMessage(_messages.default.confirmModalListUnit, {
|
|
67
|
+
name: name,
|
|
68
|
+
amount: amount
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
73
|
+
onClose: onClose,
|
|
74
|
+
testId: testId
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
76
|
+
appearance: "warning"
|
|
77
|
+
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (options === null || options === void 0 ? void 0 : options.getChildrenInfo) && /*#__PURE__*/_react.default.createElement(ListComponent, {
|
|
78
|
+
nodes: options === null || options === void 0 ? void 0 : options.getChildrenInfo()
|
|
79
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
|
|
80
|
+
isChecked: isChecked,
|
|
81
|
+
onChange: function onChange() {
|
|
82
|
+
return setCheckbox(!isChecked);
|
|
83
|
+
},
|
|
84
|
+
label: checkboxlabel,
|
|
85
|
+
testId: testId ? "".concat(testId, "-checkbox") : undefined
|
|
86
|
+
}))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
87
|
+
appearance: "default",
|
|
88
|
+
onClick: onClose,
|
|
89
|
+
testId: testId ? "".concat(testId, "-cancel-button") : undefined
|
|
90
|
+
}, cancelButtonLabel), /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
91
|
+
appearance: "warning",
|
|
92
|
+
onClick: function onClick() {
|
|
93
|
+
return onConfirm(isChecked);
|
|
94
|
+
},
|
|
95
|
+
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
96
|
+
}, okButtonLabel)));
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
exports.CheckboxModal = CheckboxModal;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -13,39 +11,21 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
11
|
|
|
14
12
|
var _reactIntlNext = require("react-intl-next");
|
|
15
13
|
|
|
16
|
-
var
|
|
14
|
+
var _SimpleModal = require("./SimpleModal");
|
|
17
15
|
|
|
18
|
-
var
|
|
16
|
+
var _CheckboxModal = require("./CheckboxModal");
|
|
19
17
|
|
|
20
|
-
var
|
|
18
|
+
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
|
|
21
|
+
var options = props.options;
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
var renderModel = function renderModel() {
|
|
24
|
+
var isReferentialityDialog = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
25
|
+
return isReferentialityDialog ? /*#__PURE__*/_react.default.createElement(_CheckboxModal.CheckboxModal, props) : /*#__PURE__*/_react.default.createElement(_SimpleModal.SimpleModal, props);
|
|
26
|
+
};
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
var onConfirm = props.onConfirm,
|
|
28
|
-
onClose = props.onClose,
|
|
29
|
-
options = props.options,
|
|
30
|
-
formatMessage = props.intl.formatMessage,
|
|
31
|
-
testId = props.testId;
|
|
32
|
-
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(_messages.default.confirmModalDefaultHeading);
|
|
33
|
-
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
|
|
34
|
-
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, options && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
36
|
-
onClose: onClose,
|
|
37
|
-
testId: testId
|
|
38
|
-
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
39
|
-
appearance: "warning"
|
|
40
|
-
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options.message)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
41
|
-
appearance: "default",
|
|
42
|
-
onClick: onClose,
|
|
43
|
-
testId: testId ? "".concat(testId, "-cancel-button") : undefined
|
|
44
|
-
}, cancelButtonLabel), /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
45
|
-
appearance: "warning",
|
|
46
|
-
onClick: onConfirm,
|
|
47
|
-
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
48
|
-
}, okButtonLabel))));
|
|
28
|
+
return options ? /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
|
|
49
29
|
};
|
|
50
30
|
|
|
51
31
|
var ConfirmationModal = (0, _reactIntlNext.injectIntl)(ConfirmationModalImpl);
|
|
@@ -82,12 +82,14 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
82
82
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderArrayOptions", function (options) {
|
|
83
83
|
var _this$props = _this.props,
|
|
84
84
|
showSelected = _this$props.showSelected,
|
|
85
|
-
dispatchCommand = _this$props.dispatchCommand
|
|
85
|
+
dispatchCommand = _this$props.dispatchCommand,
|
|
86
|
+
editorView = _this$props.editorView;
|
|
86
87
|
return (0, _react2.jsx)(_DropdownMenu.default, {
|
|
87
88
|
hide: _this.hide,
|
|
88
89
|
dispatchCommand: dispatchCommand,
|
|
89
90
|
items: options,
|
|
90
|
-
showSelected: showSelected
|
|
91
|
+
showSelected: showSelected,
|
|
92
|
+
editorView: editorView
|
|
91
93
|
});
|
|
92
94
|
});
|
|
93
95
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
|
|
@@ -108,6 +110,13 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
108
110
|
|
|
109
111
|
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
|
|
110
112
|
});
|
|
113
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChanged", function (openChangedEvent) {
|
|
114
|
+
if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
|
|
115
|
+
var _openChangedEvent$eve;
|
|
116
|
+
|
|
117
|
+
((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? _this.hideonEsc() : _this.hide();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
111
120
|
return _this;
|
|
112
121
|
}
|
|
113
122
|
|
|
@@ -127,7 +136,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
127
136
|
disabled = _this$props2.disabled,
|
|
128
137
|
tooltip = _this$props2.tooltip,
|
|
129
138
|
buttonTestId = _this$props2.buttonTestId,
|
|
130
|
-
dropdownWidth = _this$props2.dropdownWidth
|
|
139
|
+
dropdownWidth = _this$props2.dropdownWidth,
|
|
140
|
+
editorView = _this$props2.editorView;
|
|
131
141
|
var trigger;
|
|
132
142
|
|
|
133
143
|
if (icon) {
|
|
@@ -173,9 +183,11 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
173
183
|
isOpen: isOpen,
|
|
174
184
|
handleClickOutside: this.hide,
|
|
175
185
|
handleEscapeKeydown: this.hideonEsc,
|
|
186
|
+
onOpenChange: this.onOpenChanged,
|
|
176
187
|
fitWidth: fitWidth + fitTolerance,
|
|
177
188
|
fitHeight: fitHeight + fitTolerance,
|
|
178
|
-
trigger: trigger
|
|
189
|
+
trigger: trigger,
|
|
190
|
+
editorView: editorView
|
|
179
191
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
|
|
180
192
|
hide: this.hide,
|
|
181
193
|
dispatchCommand: dispatchCommand
|
|
@@ -17,11 +17,13 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
17
17
|
|
|
18
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
19
|
|
|
20
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
|
+
|
|
20
22
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
21
23
|
|
|
22
|
-
var _react = require("
|
|
24
|
+
var _react = require("react");
|
|
23
25
|
|
|
24
|
-
var _react2 = require("react");
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
25
27
|
|
|
26
28
|
var _constants = require("@atlaskit/theme/constants");
|
|
27
29
|
|
|
@@ -50,12 +52,101 @@ var menuItemDimensions = {
|
|
|
50
52
|
height: 32
|
|
51
53
|
};
|
|
52
54
|
exports.menuItemDimensions = menuItemDimensions;
|
|
53
|
-
var spacer = (0,
|
|
54
|
-
var menuContainer = (0,
|
|
55
|
+
var spacer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1;\n padding: 8px;\n"])));
|
|
56
|
+
var menuContainer = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n min-width: ", "px;\n\n // temporary solution to retain spacing defined by @atlaskit/Item\n & button {\n min-height: ", "px;\n padding: 8px 8px 7px;\n\n & > [data-item-elem-before] {\n margin-right: ", "px;\n }\n }\n"])), menuItemDimensions.width, (0, _constants.gridSize)() * 4, (0, _constants.gridSize)() / 2);
|
|
55
57
|
var itemSpacing = (0, _constants.gridSize)() / 2;
|
|
56
58
|
exports.itemSpacing = itemSpacing;
|
|
57
59
|
var DropdownButtonItem = _menu.ButtonItem;
|
|
58
60
|
|
|
61
|
+
var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
62
|
+
var item = _ref.item,
|
|
63
|
+
hide = _ref.hide,
|
|
64
|
+
dispatchCommand = _ref.dispatchCommand,
|
|
65
|
+
editorView = _ref.editorView,
|
|
66
|
+
iconBefore = _ref.iconBefore;
|
|
67
|
+
|
|
68
|
+
var _useState = (0, _react.useState)(item.tooltip || ''),
|
|
69
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
70
|
+
tooltipContent = _useState2[0],
|
|
71
|
+
setTooltipContent = _useState2[1];
|
|
72
|
+
|
|
73
|
+
var handleTooltipMouseOut = (0, _react.useCallback)(function () {
|
|
74
|
+
setTooltipContent('');
|
|
75
|
+
}, []);
|
|
76
|
+
var handleItemMouseDown = (0, _react.useCallback)(function (e) {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
}, []);
|
|
79
|
+
var handleItemMouseOver = (0, _react.useCallback)(function (e) {
|
|
80
|
+
setTooltipContent(item.tooltip || '');
|
|
81
|
+
|
|
82
|
+
if (item.onMouseOver) {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
dispatchCommand(item.onMouseOver);
|
|
85
|
+
}
|
|
86
|
+
}, [item.tooltip, item.onMouseOver, dispatchCommand]);
|
|
87
|
+
var handleItemMouseEnter = (0, _react.useCallback)(function (e) {
|
|
88
|
+
if (item.onMouseEnter) {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
dispatchCommand(item.onMouseEnter);
|
|
91
|
+
}
|
|
92
|
+
}, [item.onMouseEnter, dispatchCommand]);
|
|
93
|
+
var handleItemMouseLeave = (0, _react.useCallback)(function (e) {
|
|
94
|
+
if (item.onMouseLeave) {
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
dispatchCommand(item.onMouseLeave);
|
|
97
|
+
}
|
|
98
|
+
}, [item.onMouseLeave, dispatchCommand]);
|
|
99
|
+
var handleItemOnFocus = (0, _react.useCallback)(function (e) {
|
|
100
|
+
if (item.onFocus) {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
dispatchCommand(item.onFocus);
|
|
103
|
+
}
|
|
104
|
+
}, [item.onFocus, dispatchCommand]);
|
|
105
|
+
var handleItemOnBlur = (0, _react.useCallback)(function (e) {
|
|
106
|
+
if (item.onBlur) {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
dispatchCommand(item.onBlur);
|
|
109
|
+
}
|
|
110
|
+
}, [item.onBlur, dispatchCommand]);
|
|
111
|
+
var handleItemClick = (0, _react.useCallback)(function () {
|
|
112
|
+
/**
|
|
113
|
+
* The order of dispatching the event and hide() is important, because
|
|
114
|
+
* the ClickAreaBlock will be relying on the element to calculate the
|
|
115
|
+
* click coordinate.
|
|
116
|
+
* 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
|
|
117
|
+
*/
|
|
118
|
+
dispatchCommand(item.onClick);
|
|
119
|
+
hide();
|
|
120
|
+
|
|
121
|
+
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
122
|
+
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
123
|
+
}
|
|
124
|
+
}, [dispatchCommand, item.onClick, hide, editorView]);
|
|
125
|
+
var itemContent = (0, _react2.jsx)(DropdownButtonItem, {
|
|
126
|
+
iconBefore: iconBefore,
|
|
127
|
+
iconAfter: item.elemAfter,
|
|
128
|
+
onClick: handleItemClick,
|
|
129
|
+
"data-testid": item.testId,
|
|
130
|
+
isDisabled: item.disabled,
|
|
131
|
+
onMouseDown: handleItemMouseDown,
|
|
132
|
+
onMouseOver: handleItemMouseOver,
|
|
133
|
+
onMouseEnter: handleItemMouseEnter,
|
|
134
|
+
onMouseLeave: handleItemMouseLeave,
|
|
135
|
+
onFocus: handleItemOnFocus,
|
|
136
|
+
onBlur: handleItemOnBlur
|
|
137
|
+
}, item.title);
|
|
138
|
+
|
|
139
|
+
if (tooltipContent) {
|
|
140
|
+
return (0, _react2.jsx)(_tooltip.default, {
|
|
141
|
+
content: tooltipContent
|
|
142
|
+
}, (0, _react2.jsx)("div", {
|
|
143
|
+
onMouseOut: handleTooltipMouseOut
|
|
144
|
+
}, itemContent));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return itemContent;
|
|
148
|
+
};
|
|
149
|
+
|
|
59
150
|
var Dropdown = /*#__PURE__*/function (_Component) {
|
|
60
151
|
(0, _inherits2.default)(Dropdown, _Component);
|
|
61
152
|
|
|
@@ -75,59 +166,21 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
75
166
|
hide = _this$props.hide,
|
|
76
167
|
dispatchCommand = _this$props.dispatchCommand,
|
|
77
168
|
items = _this$props.items,
|
|
78
|
-
intl = _this$props.intl
|
|
79
|
-
|
|
169
|
+
intl = _this$props.intl,
|
|
170
|
+
editorView = _this$props.editorView;
|
|
171
|
+
return (0, _react2.jsx)("div", {
|
|
80
172
|
css: menuContainer
|
|
81
173
|
}, items.filter(function (item) {
|
|
82
174
|
return !item.hidden;
|
|
83
175
|
}).map(function (item, idx) {
|
|
84
|
-
|
|
176
|
+
return (0, _react2.jsx)(DropdownMenuItem, {
|
|
85
177
|
key: idx,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
* click coordinate.
|
|
93
|
-
* 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
|
|
94
|
-
*/
|
|
95
|
-
dispatchCommand(item.onClick);
|
|
96
|
-
hide();
|
|
97
|
-
},
|
|
98
|
-
"data-testid": item.testId,
|
|
99
|
-
isDisabled: item.disabled,
|
|
100
|
-
onMouseDown: function onMouseDown(e) {
|
|
101
|
-
e.preventDefault();
|
|
102
|
-
},
|
|
103
|
-
onMouseOver: function onMouseOver(e) {
|
|
104
|
-
if (item.onMouseOver) {
|
|
105
|
-
e.preventDefault();
|
|
106
|
-
dispatchCommand(item.onMouseOver);
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
onMouseEnter: function onMouseEnter(e) {
|
|
110
|
-
if (item.onMouseEnter) {
|
|
111
|
-
e.preventDefault();
|
|
112
|
-
dispatchCommand(item.onMouseEnter);
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
116
|
-
if (item.onMouseLeave) {
|
|
117
|
-
e.preventDefault();
|
|
118
|
-
dispatchCommand(item.onMouseLeave);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}, item.title);
|
|
122
|
-
|
|
123
|
-
if (item.tooltip) {
|
|
124
|
-
return (0, _react.jsx)(_tooltip.default, {
|
|
125
|
-
key: idx,
|
|
126
|
-
content: item.tooltip
|
|
127
|
-
}, itemContent);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return itemContent;
|
|
178
|
+
item: item,
|
|
179
|
+
hide: hide,
|
|
180
|
+
dispatchCommand: dispatchCommand,
|
|
181
|
+
editorView: editorView,
|
|
182
|
+
iconBefore: _this.renderSelected(item, intl)
|
|
183
|
+
});
|
|
131
184
|
}));
|
|
132
185
|
}
|
|
133
186
|
}, {
|
|
@@ -138,20 +191,20 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
138
191
|
var selected = item.selected;
|
|
139
192
|
|
|
140
193
|
if (showSelected && selected) {
|
|
141
|
-
return (0,
|
|
194
|
+
return (0, _react2.jsx)(_done.default, {
|
|
142
195
|
primaryColor: (0, _tokens.token)('color.icon.selected', _colors.B400),
|
|
143
196
|
size: "small",
|
|
144
197
|
label: intl.formatMessage(_messages.default.confirmModalOK)
|
|
145
198
|
});
|
|
146
199
|
}
|
|
147
200
|
|
|
148
|
-
return (0,
|
|
201
|
+
return (0, _react2.jsx)("span", {
|
|
149
202
|
css: spacer
|
|
150
203
|
});
|
|
151
204
|
}
|
|
152
205
|
}]);
|
|
153
206
|
return Dropdown;
|
|
154
|
-
}(
|
|
207
|
+
}(_react.Component);
|
|
155
208
|
|
|
156
209
|
var _default = (0, _reactIntlNext.injectIntl)(Dropdown);
|
|
157
210
|
|
|
@@ -37,6 +37,7 @@ var emojiPickerButtonWrapper = (0, _react.css)(_templateObject || (_templateObje
|
|
|
37
37
|
// https://product-fabric.atlassian.net/browse/CETI-148
|
|
38
38
|
|
|
39
39
|
var emojiPickerWrapper = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: -12px;\n margin-top: -4px;\n"])));
|
|
40
|
+
var EmojiPickerWithListener = (0, _withOuterListeners.default)(_emoji.EmojiPicker);
|
|
40
41
|
|
|
41
42
|
var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
42
43
|
var buttonRef = _react2.default.useRef(null);
|
|
@@ -46,8 +47,6 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
46
47
|
isPopupOpen = _React$useState2[0],
|
|
47
48
|
setIsPopupOpen = _React$useState2[1];
|
|
48
49
|
|
|
49
|
-
var EmojiPickerWithListener = (0, _withOuterListeners.default)(_emoji.EmojiPicker);
|
|
50
|
-
|
|
51
50
|
_react2.default.useEffect(function () {
|
|
52
51
|
if (props.setDisableParentScroll) {
|
|
53
52
|
props.setDisableParentScroll(isPopupOpen);
|