@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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import Button from '@atlaskit/button/standard-button';
|
|
5
|
+
import { Checkbox } from '@atlaskit/checkbox';
|
|
6
|
+
import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
export var CheckboxModal = function CheckboxModal(props) {
|
|
9
|
+
var _useState = useState(false),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
isChecked = _useState2[0],
|
|
12
|
+
setCheckbox = _useState2[1];
|
|
13
|
+
|
|
14
|
+
var onConfirm = props.onConfirm,
|
|
15
|
+
onClose = props.onClose,
|
|
16
|
+
options = props.options,
|
|
17
|
+
formatMessage = props.intl.formatMessage,
|
|
18
|
+
testId = props.testId;
|
|
19
|
+
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(messages.confirmModalDefaultHeading);
|
|
20
|
+
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
21
|
+
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
22
|
+
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
23
|
+
|
|
24
|
+
var ListComponent = function ListComponent(_ref) {
|
|
25
|
+
var nodes = _ref.nodes;
|
|
26
|
+
|
|
27
|
+
if (!nodes) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return /*#__PURE__*/React.createElement("ul", null, nodes.map(function (node) {
|
|
32
|
+
return /*#__PURE__*/React.createElement(ListItem, _extends({}, node, {
|
|
33
|
+
key: node.id
|
|
34
|
+
}));
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var ListItem = function ListItem(props) {
|
|
39
|
+
var id = props.id,
|
|
40
|
+
name = props.name,
|
|
41
|
+
amount = props.amount;
|
|
42
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
43
|
+
id: id
|
|
44
|
+
}, formatMessage(messages.confirmModalListUnit, {
|
|
45
|
+
name: name,
|
|
46
|
+
amount: amount
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
51
|
+
onClose: onClose,
|
|
52
|
+
testId: testId
|
|
53
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
54
|
+
appearance: "warning"
|
|
55
|
+
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (options === null || options === void 0 ? void 0 : options.getChildrenInfo) && /*#__PURE__*/React.createElement(ListComponent, {
|
|
56
|
+
nodes: options === null || options === void 0 ? void 0 : options.getChildrenInfo()
|
|
57
|
+
}), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
58
|
+
isChecked: isChecked,
|
|
59
|
+
onChange: function onChange() {
|
|
60
|
+
return setCheckbox(!isChecked);
|
|
61
|
+
},
|
|
62
|
+
label: checkboxlabel,
|
|
63
|
+
testId: testId ? "".concat(testId, "-checkbox") : undefined
|
|
64
|
+
}))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
65
|
+
appearance: "default",
|
|
66
|
+
onClick: onClose,
|
|
67
|
+
testId: testId ? "".concat(testId, "-cancel-button") : undefined
|
|
68
|
+
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
69
|
+
appearance: "warning",
|
|
70
|
+
onClick: function onClick() {
|
|
71
|
+
return onConfirm(isChecked);
|
|
72
|
+
},
|
|
73
|
+
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
74
|
+
}, okButtonLabel)));
|
|
75
|
+
};
|
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { SimpleModal } from './SimpleModal';
|
|
4
|
+
import { CheckboxModal } from './CheckboxModal';
|
|
5
|
+
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
6
6
|
|
|
7
7
|
var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return /*#__PURE__*/React.createElement(ModalTransition, null, options && /*#__PURE__*/React.createElement(Modal, {
|
|
17
|
-
onClose: onClose,
|
|
18
|
-
testId: testId
|
|
19
|
-
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
20
|
-
appearance: "warning"
|
|
21
|
-
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
22
|
-
appearance: "default",
|
|
23
|
-
onClick: onClose,
|
|
24
|
-
testId: testId ? "".concat(testId, "-cancel-button") : undefined
|
|
25
|
-
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
26
|
-
appearance: "warning",
|
|
27
|
-
onClick: onConfirm,
|
|
28
|
-
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
29
|
-
}, okButtonLabel))));
|
|
8
|
+
var options = props.options;
|
|
9
|
+
|
|
10
|
+
var renderModel = function renderModel() {
|
|
11
|
+
var isReferentialityDialog = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
12
|
+
return isReferentialityDialog ? /*#__PURE__*/React.createElement(CheckboxModal, props) : /*#__PURE__*/React.createElement(SimpleModal, props);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return options ? /*#__PURE__*/React.createElement(ModalTransition, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
|
|
30
16
|
};
|
|
31
17
|
|
|
32
18
|
export var ConfirmationModal = injectIntl(ConfirmationModalImpl);
|
|
@@ -57,12 +57,14 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
57
57
|
_defineProperty(_assertThisInitialized(_this), "renderArrayOptions", function (options) {
|
|
58
58
|
var _this$props = _this.props,
|
|
59
59
|
showSelected = _this$props.showSelected,
|
|
60
|
-
dispatchCommand = _this$props.dispatchCommand
|
|
60
|
+
dispatchCommand = _this$props.dispatchCommand,
|
|
61
|
+
editorView = _this$props.editorView;
|
|
61
62
|
return jsx(DropdownMenu, {
|
|
62
63
|
hide: _this.hide,
|
|
63
64
|
dispatchCommand: dispatchCommand,
|
|
64
65
|
items: options,
|
|
65
|
-
showSelected: showSelected
|
|
66
|
+
showSelected: showSelected,
|
|
67
|
+
editorView: editorView
|
|
66
68
|
});
|
|
67
69
|
});
|
|
68
70
|
|
|
@@ -87,6 +89,14 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
87
89
|
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
|
|
88
90
|
});
|
|
89
91
|
|
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "onOpenChanged", function (openChangedEvent) {
|
|
93
|
+
if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
|
|
94
|
+
var _openChangedEvent$eve;
|
|
95
|
+
|
|
96
|
+
((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? _this.hideonEsc() : _this.hide();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
90
100
|
return _this;
|
|
91
101
|
}
|
|
92
102
|
|
|
@@ -106,7 +116,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
106
116
|
disabled = _this$props2.disabled,
|
|
107
117
|
tooltip = _this$props2.tooltip,
|
|
108
118
|
buttonTestId = _this$props2.buttonTestId,
|
|
109
|
-
dropdownWidth = _this$props2.dropdownWidth
|
|
119
|
+
dropdownWidth = _this$props2.dropdownWidth,
|
|
120
|
+
editorView = _this$props2.editorView;
|
|
110
121
|
var trigger;
|
|
111
122
|
|
|
112
123
|
if (icon) {
|
|
@@ -152,9 +163,11 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
152
163
|
isOpen: isOpen,
|
|
153
164
|
handleClickOutside: this.hide,
|
|
154
165
|
handleEscapeKeydown: this.hideonEsc,
|
|
166
|
+
onOpenChange: this.onOpenChanged,
|
|
155
167
|
fitWidth: fitWidth + fitTolerance,
|
|
156
168
|
fitHeight: fitHeight + fitTolerance,
|
|
157
|
-
trigger: trigger
|
|
169
|
+
trigger: trigger,
|
|
170
|
+
editorView: editorView
|
|
158
171
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
|
|
159
172
|
hide: this.hide,
|
|
160
173
|
dispatchCommand: dispatchCommand
|
|
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
7
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
7
8
|
|
|
8
9
|
var _templateObject, _templateObject2;
|
|
@@ -12,6 +13,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
14
|
|
|
14
15
|
/** @jsx jsx */
|
|
16
|
+
import { useState, useCallback } from 'react';
|
|
15
17
|
import { css, jsx } from '@emotion/react';
|
|
16
18
|
import { Component } from 'react';
|
|
17
19
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -31,6 +33,95 @@ var menuContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateL
|
|
|
31
33
|
export var itemSpacing = gridSize() / 2;
|
|
32
34
|
var DropdownButtonItem = ButtonItem;
|
|
33
35
|
|
|
36
|
+
var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
37
|
+
var item = _ref.item,
|
|
38
|
+
hide = _ref.hide,
|
|
39
|
+
dispatchCommand = _ref.dispatchCommand,
|
|
40
|
+
editorView = _ref.editorView,
|
|
41
|
+
iconBefore = _ref.iconBefore;
|
|
42
|
+
|
|
43
|
+
var _useState = useState(item.tooltip || ''),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
tooltipContent = _useState2[0],
|
|
46
|
+
setTooltipContent = _useState2[1];
|
|
47
|
+
|
|
48
|
+
var handleTooltipMouseOut = useCallback(function () {
|
|
49
|
+
setTooltipContent('');
|
|
50
|
+
}, []);
|
|
51
|
+
var handleItemMouseDown = useCallback(function (e) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
}, []);
|
|
54
|
+
var handleItemMouseOver = useCallback(function (e) {
|
|
55
|
+
setTooltipContent(item.tooltip || '');
|
|
56
|
+
|
|
57
|
+
if (item.onMouseOver) {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
dispatchCommand(item.onMouseOver);
|
|
60
|
+
}
|
|
61
|
+
}, [item.tooltip, item.onMouseOver, dispatchCommand]);
|
|
62
|
+
var handleItemMouseEnter = useCallback(function (e) {
|
|
63
|
+
if (item.onMouseEnter) {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
dispatchCommand(item.onMouseEnter);
|
|
66
|
+
}
|
|
67
|
+
}, [item.onMouseEnter, dispatchCommand]);
|
|
68
|
+
var handleItemMouseLeave = useCallback(function (e) {
|
|
69
|
+
if (item.onMouseLeave) {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
dispatchCommand(item.onMouseLeave);
|
|
72
|
+
}
|
|
73
|
+
}, [item.onMouseLeave, dispatchCommand]);
|
|
74
|
+
var handleItemOnFocus = useCallback(function (e) {
|
|
75
|
+
if (item.onFocus) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
dispatchCommand(item.onFocus);
|
|
78
|
+
}
|
|
79
|
+
}, [item.onFocus, dispatchCommand]);
|
|
80
|
+
var handleItemOnBlur = useCallback(function (e) {
|
|
81
|
+
if (item.onBlur) {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
dispatchCommand(item.onBlur);
|
|
84
|
+
}
|
|
85
|
+
}, [item.onBlur, dispatchCommand]);
|
|
86
|
+
var handleItemClick = useCallback(function () {
|
|
87
|
+
/**
|
|
88
|
+
* The order of dispatching the event and hide() is important, because
|
|
89
|
+
* the ClickAreaBlock will be relying on the element to calculate the
|
|
90
|
+
* click coordinate.
|
|
91
|
+
* 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
|
|
92
|
+
*/
|
|
93
|
+
dispatchCommand(item.onClick);
|
|
94
|
+
hide();
|
|
95
|
+
|
|
96
|
+
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
97
|
+
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
98
|
+
}
|
|
99
|
+
}, [dispatchCommand, item.onClick, hide, editorView]);
|
|
100
|
+
var itemContent = jsx(DropdownButtonItem, {
|
|
101
|
+
iconBefore: iconBefore,
|
|
102
|
+
iconAfter: item.elemAfter,
|
|
103
|
+
onClick: handleItemClick,
|
|
104
|
+
"data-testid": item.testId,
|
|
105
|
+
isDisabled: item.disabled,
|
|
106
|
+
onMouseDown: handleItemMouseDown,
|
|
107
|
+
onMouseOver: handleItemMouseOver,
|
|
108
|
+
onMouseEnter: handleItemMouseEnter,
|
|
109
|
+
onMouseLeave: handleItemMouseLeave,
|
|
110
|
+
onFocus: handleItemOnFocus,
|
|
111
|
+
onBlur: handleItemOnBlur
|
|
112
|
+
}, item.title);
|
|
113
|
+
|
|
114
|
+
if (tooltipContent) {
|
|
115
|
+
return jsx(Tooltip, {
|
|
116
|
+
content: tooltipContent
|
|
117
|
+
}, jsx("div", {
|
|
118
|
+
onMouseOut: handleTooltipMouseOut
|
|
119
|
+
}, itemContent));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return itemContent;
|
|
123
|
+
};
|
|
124
|
+
|
|
34
125
|
var Dropdown = /*#__PURE__*/function (_Component) {
|
|
35
126
|
_inherits(Dropdown, _Component);
|
|
36
127
|
|
|
@@ -51,59 +142,21 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
51
142
|
hide = _this$props.hide,
|
|
52
143
|
dispatchCommand = _this$props.dispatchCommand,
|
|
53
144
|
items = _this$props.items,
|
|
54
|
-
intl = _this$props.intl
|
|
145
|
+
intl = _this$props.intl,
|
|
146
|
+
editorView = _this$props.editorView;
|
|
55
147
|
return jsx("div", {
|
|
56
148
|
css: menuContainer
|
|
57
149
|
}, items.filter(function (item) {
|
|
58
150
|
return !item.hidden;
|
|
59
151
|
}).map(function (item, idx) {
|
|
60
|
-
|
|
152
|
+
return jsx(DropdownMenuItem, {
|
|
61
153
|
key: idx,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
* click coordinate.
|
|
69
|
-
* 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
|
|
70
|
-
*/
|
|
71
|
-
dispatchCommand(item.onClick);
|
|
72
|
-
hide();
|
|
73
|
-
},
|
|
74
|
-
"data-testid": item.testId,
|
|
75
|
-
isDisabled: item.disabled,
|
|
76
|
-
onMouseDown: function onMouseDown(e) {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
},
|
|
79
|
-
onMouseOver: function onMouseOver(e) {
|
|
80
|
-
if (item.onMouseOver) {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
dispatchCommand(item.onMouseOver);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
onMouseEnter: function onMouseEnter(e) {
|
|
86
|
-
if (item.onMouseEnter) {
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
dispatchCommand(item.onMouseEnter);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
92
|
-
if (item.onMouseLeave) {
|
|
93
|
-
e.preventDefault();
|
|
94
|
-
dispatchCommand(item.onMouseLeave);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}, item.title);
|
|
98
|
-
|
|
99
|
-
if (item.tooltip) {
|
|
100
|
-
return jsx(Tooltip, {
|
|
101
|
-
key: idx,
|
|
102
|
-
content: item.tooltip
|
|
103
|
-
}, itemContent);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return itemContent;
|
|
154
|
+
item: item,
|
|
155
|
+
hide: hide,
|
|
156
|
+
dispatchCommand: dispatchCommand,
|
|
157
|
+
editorView: editorView,
|
|
158
|
+
iconBefore: _this.renderSelected(item, intl)
|
|
159
|
+
});
|
|
107
160
|
}));
|
|
108
161
|
}
|
|
109
162
|
}, {
|
|
@@ -19,6 +19,7 @@ var emojiPickerButtonWrapper = css(_templateObject || (_templateObject = _tagged
|
|
|
19
19
|
// https://product-fabric.atlassian.net/browse/CETI-148
|
|
20
20
|
|
|
21
21
|
var emojiPickerWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-bottom: -12px;\n margin-top: -4px;\n"])));
|
|
22
|
+
var EmojiPickerWithListener = withOuterListeners(EmojiPicker);
|
|
22
23
|
export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
23
24
|
var buttonRef = React.useRef(null);
|
|
24
25
|
|
|
@@ -27,7 +28,6 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
27
28
|
isPopupOpen = _React$useState2[0],
|
|
28
29
|
setIsPopupOpen = _React$useState2[1];
|
|
29
30
|
|
|
30
|
-
var EmojiPickerWithListener = withOuterListeners(EmojiPicker);
|
|
31
31
|
React.useEffect(function () {
|
|
32
32
|
if (props.setDisableParentScroll) {
|
|
33
33
|
props.setDisableParentScroll(isPopupOpen);
|
|
@@ -3,12 +3,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
|
|
4
4
|
var _templateObject;
|
|
5
5
|
|
|
6
|
-
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; } } }; }
|
|
7
|
-
|
|
8
|
-
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); }
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
6
|
/** @jsx jsx */
|
|
13
7
|
import React, { useEffect, useState, useRef } from 'react';
|
|
14
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -25,8 +19,6 @@ var toolbarScrollButtons = css(_templateObject || (_templateObject = _taggedTemp
|
|
|
25
19
|
var LeftIcon = ChevronLeftLargeIcon;
|
|
26
20
|
var RightIcon = ChevronRightLargeIcon;
|
|
27
21
|
export default (function (_ref) {
|
|
28
|
-
var _scrollContainerRef$c, _scrollContainerRef$c2;
|
|
29
|
-
|
|
30
22
|
var intl = _ref.intl,
|
|
31
23
|
scrollContainerRef = _ref.scrollContainerRef,
|
|
32
24
|
node = _ref.node,
|
|
@@ -48,7 +40,6 @@ export default (function (_ref) {
|
|
|
48
40
|
canScrollRight = _useState6[0],
|
|
49
41
|
setCanScrollRight = _useState6[1];
|
|
50
42
|
|
|
51
|
-
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) || {});
|
|
52
43
|
var scheduledSetCanScroll = rafSchedule(function () {
|
|
53
44
|
var _ref2 = scrollContainerRef.current,
|
|
54
45
|
scrollLeft = _ref2.scrollLeft,
|
|
@@ -63,115 +54,44 @@ export default (function (_ref) {
|
|
|
63
54
|
};
|
|
64
55
|
|
|
65
56
|
var scrollLeft = function scrollLeft() {
|
|
66
|
-
|
|
67
|
-
var _iterator = _createForOfIteratorHelper(items.reverse().entries()),
|
|
68
|
-
_step;
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
72
|
-
var _scrollContainerRef$c3;
|
|
73
|
-
|
|
74
|
-
var _step$value = _slicedToArray(_step.value, 2),
|
|
75
|
-
itemIndex = _step$value[0],
|
|
76
|
-
item = _step$value[1];
|
|
77
|
-
|
|
78
|
-
var _item$getBoundingClie = item.getBoundingClientRect(),
|
|
79
|
-
itemLeft = _item$getBoundingClie.left,
|
|
80
|
-
itemWidth = _item$getBoundingClie.width;
|
|
81
|
-
|
|
82
|
-
var _ref3 = ((_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.getBoundingClientRect()) || {},
|
|
83
|
-
_ref3$left = _ref3.left,
|
|
84
|
-
scrollContainerLeft = _ref3$left === void 0 ? 0 : _ref3$left,
|
|
85
|
-
_ref3$width = _ref3.width,
|
|
86
|
-
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
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (itemLeft <= scrollContainerLeft) {
|
|
90
|
-
var _scrollContainerRef$c4, _scrollContainerRef$c5;
|
|
91
|
-
|
|
92
|
-
var gap = scrollContainerWidth - itemWidth;
|
|
93
|
-
var scrollTo = item.offsetLeft - gap; // if scrollTo is same as current scrollLeft
|
|
94
|
-
|
|
95
|
-
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)) {
|
|
96
|
-
// if this is the first item, scroll to the beginning, otherwise find next item to scroll to
|
|
97
|
-
if (itemIndex === items.length - 1) {
|
|
98
|
-
scrollTo = 0;
|
|
99
|
-
} else {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : (_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.scrollTo({
|
|
105
|
-
top: 0,
|
|
106
|
-
left: scrollTo,
|
|
107
|
-
behavior: 'smooth'
|
|
108
|
-
});
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
} catch (err) {
|
|
113
|
-
_iterator.e(err);
|
|
114
|
-
} finally {
|
|
115
|
-
_iterator.f();
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
var scrollRight = function scrollRight() {
|
|
120
|
-
// find the last item partially visible
|
|
121
|
-
var _iterator2 = _createForOfIteratorHelper(items),
|
|
122
|
-
_step2;
|
|
57
|
+
var _scrollContainerRef$c, _scrollContainerRef$c2, _scrollContainerRef$c3;
|
|
123
58
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
59
|
+
var _ref3 = ((_scrollContainerRef$c = scrollContainerRef.current) === null || _scrollContainerRef$c === void 0 ? void 0 : _scrollContainerRef$c.getBoundingClientRect()) || {},
|
|
60
|
+
_ref3$width = _ref3.width,
|
|
61
|
+
scrollContainerWidth = _ref3$width === void 0 ? 0 : _ref3$width;
|
|
127
62
|
|
|
128
|
-
|
|
63
|
+
var scrollLeft = ((_scrollContainerRef$c2 = scrollContainerRef.current) === null || _scrollContainerRef$c2 === void 0 ? void 0 : _scrollContainerRef$c2.scrollLeft) || 0; // scroll to current position - scroll container width
|
|
129
64
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
_ref4$width = _ref4.width,
|
|
138
|
-
scrollContainerWidth = _ref4$width === void 0 ? 0 : _ref4$width; // if item is partially visible on the right
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (itemLeft + itemWidth >= scrollContainerLeft + scrollContainerWidth) {
|
|
142
|
-
var _scrollContainerRef$c7, _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
143
|
-
|
|
144
|
-
var scrollTo = item.offsetLeft; // if the item is longer than the entire container width, just scroll past it
|
|
65
|
+
var scrollTo = scrollLeft - scrollContainerWidth;
|
|
66
|
+
(_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.scrollTo({
|
|
67
|
+
top: 0,
|
|
68
|
+
left: scrollTo,
|
|
69
|
+
behavior: 'smooth'
|
|
70
|
+
});
|
|
71
|
+
};
|
|
145
72
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
} // if scrollTo is same as current scrollLeft, find next item to scroll to
|
|
73
|
+
var scrollRight = function scrollRight() {
|
|
74
|
+
var _scrollContainerRef$c4, _scrollContainerRef$c5, _scrollContainerRef$c6;
|
|
149
75
|
|
|
76
|
+
var _ref4 = ((_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 ? void 0 : _scrollContainerRef$c4.getBoundingClientRect()) || {},
|
|
77
|
+
_ref4$width = _ref4.width,
|
|
78
|
+
scrollContainerWidth = _ref4$width === void 0 ? 0 : _ref4$width;
|
|
150
79
|
|
|
151
|
-
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
80
|
+
var scrollLeft = ((_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.scrollLeft) || 0; // scroll to current position + scroll container width
|
|
154
81
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
} catch (err) {
|
|
164
|
-
_iterator2.e(err);
|
|
165
|
-
} finally {
|
|
166
|
-
_iterator2.f();
|
|
167
|
-
}
|
|
82
|
+
var scrollTo = scrollLeft + scrollContainerWidth;
|
|
83
|
+
(_scrollContainerRef$c6 = scrollContainerRef.current) === null || _scrollContainerRef$c6 === void 0 ? void 0 : _scrollContainerRef$c6.scrollTo({
|
|
84
|
+
top: 0,
|
|
85
|
+
left: scrollTo,
|
|
86
|
+
behavior: 'smooth'
|
|
87
|
+
});
|
|
168
88
|
};
|
|
169
89
|
|
|
170
90
|
var resizeObserver = new ResizeObserver(function (t) {
|
|
171
|
-
var _scrollContainerRef$
|
|
91
|
+
var _scrollContainerRef$c7, _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
172
92
|
|
|
173
|
-
var widthNeededToShowAllItems = ((_scrollContainerRef$
|
|
174
|
-
var availableSpace = (_scrollContainerRef$
|
|
93
|
+
var widthNeededToShowAllItems = ((_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 ? void 0 : _scrollContainerRef$c7.scrollWidth) || 0;
|
|
94
|
+
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;
|
|
175
95
|
|
|
176
96
|
if (availableSpace >= widthNeededToShowAllItems) {
|
|
177
97
|
setNeedScroll(false);
|
|
@@ -204,7 +124,8 @@ export default (function (_ref) {
|
|
|
204
124
|
}, [node, scrollContainerRef]);
|
|
205
125
|
return needScroll ? jsx("div", {
|
|
206
126
|
ref: buttonsContainerRef,
|
|
207
|
-
css: toolbarScrollButtons
|
|
127
|
+
css: toolbarScrollButtons,
|
|
128
|
+
className: "scroll-buttons"
|
|
208
129
|
}, jsx(Button, {
|
|
209
130
|
title: intl.formatMessage(messages.floatingToolbarScrollLeft),
|
|
210
131
|
icon: jsx(LeftIcon, {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '@atlaskit/button/standard-button';
|
|
3
|
+
import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
4
|
+
import messages from './messages';
|
|
5
|
+
export var SimpleModal = function SimpleModal(props) {
|
|
6
|
+
var onConfirm = props.onConfirm,
|
|
7
|
+
onClose = props.onClose,
|
|
8
|
+
options = props.options,
|
|
9
|
+
formatMessage = props.intl.formatMessage,
|
|
10
|
+
testId = props.testId;
|
|
11
|
+
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(messages.confirmModalDefaultHeading);
|
|
12
|
+
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
13
|
+
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
14
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
15
|
+
onClose: onClose,
|
|
16
|
+
testId: testId
|
|
17
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
18
|
+
appearance: "warning"
|
|
19
|
+
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
20
|
+
appearance: "default",
|
|
21
|
+
onClick: onClose,
|
|
22
|
+
testId: testId ? "".concat(testId, "-cancel-button") : undefined
|
|
23
|
+
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
appearance: "warning",
|
|
25
|
+
onClick: function onClick() {
|
|
26
|
+
return onConfirm();
|
|
27
|
+
},
|
|
28
|
+
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
29
|
+
}, okButtonLabel)));
|
|
30
|
+
};
|