@atlaskit/editor-core 176.0.2 → 177.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -2
- package/CHANGELOG.md +114 -0
- package/codemods/{173.0.0-rename-unsafe-allowUndoRedoButton-prop.ts → 175.0.0-rename-unsafe-allowUndoRedoButton-prop.ts} +0 -0
- package/dist/cjs/create-editor/ReactEditorView.js +3 -1
- package/dist/cjs/create-editor/create-plugins-list.js +9 -6
- package/dist/cjs/create-editor/messages.js +17 -0
- package/dist/cjs/i18n/en.js +2 -2
- package/dist/cjs/i18n/en_GB.js +2 -2
- package/dist/cjs/i18n/en_ZZ.js +2 -2
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/i18n/languages.js +9 -4
- package/dist/cjs/labs/next/presets/mobile.js +2 -2
- package/dist/cjs/labs/next/presets/preset.js +38 -6
- package/dist/cjs/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +6 -1
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -1
- package/dist/cjs/plugins/card/pm-plugins/doc.js +18 -29
- package/dist/cjs/plugins/card/pm-plugins/main.js +7 -21
- package/dist/cjs/plugins/card/toolbar.js +24 -8
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +9 -5
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +19 -53
- package/dist/cjs/plugins/card/utils.js +17 -3
- package/dist/cjs/plugins/collab-edit/actions.js +3 -3
- package/dist/cjs/plugins/copy-button/toolbar.js +5 -3
- package/dist/cjs/plugins/date/index.js +1 -7
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/cjs/plugins/emoji/index.js +7 -14
- package/dist/cjs/plugins/expand/pm-plugins/main.js +4 -1
- package/dist/cjs/plugins/expand/toolbar.js +1 -0
- package/dist/cjs/plugins/extension/commands.js +17 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/cjs/plugins/extension/toolbar.js +49 -7
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +99 -0
- package/dist/cjs/plugins/floating-toolbar/ui/ConfirmationModal.js +10 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +108 -55
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +51 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/cjs/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/cjs/plugins/floating-toolbar/utils.js +4 -19
- package/dist/cjs/plugins/help-dialog/index.js +3 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +20 -1
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +26 -12
- package/dist/cjs/plugins/layout/toolbar.js +1 -0
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +34 -4
- package/dist/cjs/plugins/list/commands/outdent-list.js +1 -1
- package/dist/cjs/plugins/list/index.js +6 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/cjs/plugins/list/pm-plugins/main.js +32 -10
- package/dist/cjs/plugins/media/index.js +35 -0
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +6 -0
- package/dist/cjs/plugins/media/toolbar/index.js +3 -0
- package/dist/cjs/plugins/media/utils/media-single.js +19 -3
- package/dist/cjs/plugins/panel/toolbar.js +1 -0
- package/dist/cjs/plugins/panel/utils.js +1 -1
- package/dist/cjs/plugins/paste/index.js +2 -1
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +19 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/paste/util/index.js +2 -2
- package/dist/cjs/plugins/placeholder/index.js +24 -47
- package/dist/cjs/plugins/placeholder/styles.js +2 -4
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +7 -3
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +10 -5
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +5 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -6
- package/dist/cjs/plugins/type-ahead/index.js +2 -8
- package/dist/cjs/plugins/type-ahead/messages.js +44 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +9 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/cjs/plugins/type-ahead/utils.js +44 -2
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -2
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -1
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/cjs/ui/CollapsedEditor/index.js +4 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -4
- package/dist/cjs/ui/ConfigPanel/FormContent.js +2 -1
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +3 -1
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +55 -33
- package/dist/cjs/utils/commands.js +25 -13
- package/dist/cjs/utils/input-rules.js +26 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -1
- package/dist/es2019/create-editor/create-plugins-list.js +9 -6
- package/dist/es2019/create-editor/messages.js +8 -0
- package/dist/es2019/i18n/en.js +2 -2
- package/dist/es2019/i18n/en_GB.js +2 -2
- package/dist/es2019/i18n/en_ZZ.js +2 -2
- package/dist/es2019/i18n/index.js +4 -4
- package/dist/es2019/i18n/languages.js +9 -4
- package/dist/es2019/labs/next/presets/mobile.js +2 -2
- package/dist/es2019/labs/next/presets/preset.js +28 -7
- package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -19
- package/dist/es2019/plugins/card/pm-plugins/main.js +4 -19
- package/dist/es2019/plugins/card/toolbar.js +19 -2
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -36
- package/dist/es2019/plugins/card/utils.js +15 -2
- package/dist/es2019/plugins/collab-edit/actions.js +3 -3
- package/dist/es2019/plugins/copy-button/toolbar.js +5 -3
- package/dist/es2019/plugins/date/index.js +0 -7
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/es2019/plugins/emoji/index.js +7 -13
- package/dist/es2019/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/expand/toolbar.js +1 -0
- package/dist/es2019/plugins/extension/commands.js +10 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/es2019/plugins/extension/toolbar.js +43 -8
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/es2019/plugins/floating-toolbar/index.js +15 -5
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +70 -0
- package/dist/es2019/plugins/floating-toolbar/ui/ConfirmationModal.js +8 -27
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +96 -50
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +29 -76
- package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +32 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +26 -46
- package/dist/es2019/plugins/floating-toolbar/ui/messages.js +14 -4
- package/dist/es2019/plugins/floating-toolbar/utils.js +4 -17
- package/dist/es2019/plugins/help-dialog/index.js +2 -2
- package/dist/es2019/plugins/hyperlink/Toolbar.js +18 -2
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/es2019/plugins/layout/toolbar.js +1 -0
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +24 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +1 -1
- package/dist/es2019/plugins/list/index.js +7 -3
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/es2019/plugins/list/pm-plugins/main.js +31 -11
- package/dist/es2019/plugins/media/index.js +38 -0
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +6 -5
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -0
- package/dist/es2019/plugins/media/toolbar/index.js +3 -0
- package/dist/es2019/plugins/media/utils/media-single.js +20 -3
- package/dist/es2019/plugins/panel/toolbar.js +1 -0
- package/dist/es2019/plugins/panel/utils.js +1 -1
- package/dist/es2019/plugins/paste/index.js +2 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/paste/util/index.js +2 -2
- package/dist/es2019/plugins/placeholder/index.js +21 -47
- package/dist/es2019/plugins/placeholder/styles.js +1 -19
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +8 -7
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +18 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/es2019/plugins/type-ahead/index.js +2 -2
- package/dist/es2019/plugins/type-ahead/messages.js +44 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/es2019/plugins/type-ahead/utils.js +38 -0
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/es2019/ui/CollapsedEditor/index.js +3 -2
- package/dist/es2019/ui/ColorPickerButton/index.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/es2019/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/es2019/ui/ContentStyles/index.js +7 -2
- package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/es2019/utils/commands.js +26 -14
- package/dist/es2019/utils/input-rules.js +22 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -1
- package/dist/esm/create-editor/create-plugins-list.js +9 -6
- package/dist/esm/create-editor/messages.js +8 -0
- package/dist/esm/i18n/en.js +2 -2
- package/dist/esm/i18n/en_GB.js +2 -2
- package/dist/esm/i18n/en_ZZ.js +2 -2
- package/dist/esm/i18n/index.js +4 -4
- package/dist/esm/i18n/languages.js +9 -4
- package/dist/esm/labs/next/presets/mobile.js +2 -2
- package/dist/esm/labs/next/presets/preset.js +36 -6
- package/dist/esm/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +10 -20
- package/dist/esm/plugins/card/pm-plugins/main.js +4 -17
- package/dist/esm/plugins/card/toolbar.js +24 -8
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +9 -39
- package/dist/esm/plugins/card/utils.js +15 -2
- package/dist/esm/plugins/collab-edit/actions.js +3 -3
- package/dist/esm/plugins/copy-button/toolbar.js +5 -3
- package/dist/esm/plugins/date/index.js +1 -6
- package/dist/esm/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/esm/plugins/emoji/index.js +7 -13
- package/dist/esm/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/expand/toolbar.js +1 -0
- package/dist/esm/plugins/extension/commands.js +12 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/esm/plugins/extension/toolbar.js +50 -8
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/esm/plugins/floating-toolbar/index.js +16 -4
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +75 -0
- package/dist/esm/plugins/floating-toolbar/ui/ConfirmationModal.js +11 -25
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +100 -47
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +30 -0
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/esm/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/esm/plugins/floating-toolbar/utils.js +4 -17
- package/dist/esm/plugins/help-dialog/index.js +3 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +20 -2
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -3
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/esm/plugins/layout/toolbar.js +1 -0
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +30 -4
- package/dist/esm/plugins/list/commands/outdent-list.js +1 -1
- package/dist/esm/plugins/list/index.js +7 -3
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/esm/plugins/list/pm-plugins/main.js +31 -11
- package/dist/esm/plugins/media/index.js +33 -0
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -0
- package/dist/esm/plugins/media/toolbar/index.js +3 -0
- package/dist/esm/plugins/media/utils/media-single.js +18 -3
- package/dist/esm/plugins/panel/toolbar.js +1 -0
- package/dist/esm/plugins/panel/utils.js +1 -1
- package/dist/esm/plugins/paste/index.js +2 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/paste/util/index.js +2 -2
- package/dist/esm/plugins/placeholder/index.js +23 -45
- package/dist/esm/plugins/placeholder/styles.js +1 -2
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +9 -5
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/esm/plugins/type-ahead/index.js +2 -2
- package/dist/esm/plugins/type-ahead/messages.js +44 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/esm/plugins/type-ahead/utils.js +38 -0
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/esm/ui/CollapsedEditor/index.js +3 -2
- package/dist/esm/ui/ColorPickerButton/index.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/esm/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/esm/utils/commands.js +25 -13
- package/dist/esm/utils/input-rules.js +23 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/messages.d.ts +7 -0
- package/dist/types/i18n/index.d.ts +4 -4
- package/dist/types/i18n/languages.d.ts +8 -3
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -2
- package/dist/types/labs/next/presets/mobile.d.ts +1 -1
- package/dist/types/labs/next/presets/preset.d.ts +10 -6
- package/dist/types/plugins/alignment/index.d.ts +2 -2
- package/dist/types/plugins/analytics/plugin.d.ts +2 -2
- package/dist/types/plugins/annotation/index.d.ts +2 -2
- package/dist/types/plugins/avatar-group/index.d.ts +4 -3
- package/dist/types/plugins/base/index.d.ts +2 -2
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +4 -3
- package/dist/types/plugins/block-type/index.d.ts +2 -2
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -1
- package/dist/types/plugins/breakout/index.d.ts +2 -2
- package/dist/types/plugins/caption/index.d.ts +2 -2
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +4 -4
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +5 -5
- package/dist/types/plugins/card/utils.d.ts +2 -1
- package/dist/types/plugins/clear-marks-on-change-to-empty-document/index.d.ts +2 -2
- package/dist/types/plugins/clipboard/index.d.ts +2 -2
- package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -3
- package/dist/types/plugins/code-block/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +2 -2
- package/dist/types/plugins/context-panel/index.d.ts +2 -2
- package/dist/types/plugins/copy-button/index.d.ts +2 -2
- package/dist/types/plugins/custom-autoformat/index.d.ts +2 -2
- package/dist/types/plugins/data-consumer/index.d.ts +2 -2
- package/dist/types/plugins/date/index.d.ts +2 -2
- package/dist/types/plugins/date/ui/DatePicker/index.d.ts +0 -1
- package/dist/types/plugins/editor-disabled/index.d.ts +2 -2
- package/dist/types/plugins/emoji/index.d.ts +2 -2
- package/dist/types/plugins/emoji/types.d.ts +2 -1
- package/dist/types/plugins/expand/index.d.ts +2 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/extension/commands.d.ts +2 -0
- package/dist/types/plugins/extension/index.d.ts +2 -2
- package/dist/types/plugins/extension/toolbar.d.ts +10 -0
- package/dist/types/plugins/fake-text-cursor/index.d.ts +2 -2
- package/dist/types/plugins/feature-flags-context/index.d.ts +2 -2
- package/dist/types/plugins/feedback-dialog/index.d.ts +3 -2
- package/dist/types/plugins/find-replace/index.d.ts +4 -3
- package/dist/types/plugins/floating-toolbar/index.d.ts +2 -2
- package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +1 -8
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +3 -0
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/messages.d.ts +10 -0
- package/dist/types/plugins/floating-toolbar/ui/types.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/utils.d.ts +2 -3
- package/dist/types/plugins/fragment/index.d.ts +2 -2
- package/dist/types/plugins/grid/index.d.ts +2 -2
- package/dist/types/plugins/help-dialog/index.d.ts +2 -3
- package/dist/types/plugins/history/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
- package/dist/types/plugins/image-upload/index.d.ts +2 -2
- package/dist/types/plugins/indentation/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
- package/dist/types/plugins/jira-issue/index.d.ts +2 -2
- package/dist/types/plugins/layout/index.d.ts +2 -2
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -2
- package/dist/types/plugins/list/index.d.ts +3 -2
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +3 -1
- package/dist/types/plugins/list/pm-plugins/main.d.ts +2 -2
- package/dist/types/plugins/list/types.d.ts +2 -0
- package/dist/types/plugins/macro/index.d.ts +2 -2
- package/dist/types/plugins/max-content-size/index.d.ts +2 -2
- package/dist/types/plugins/media/index.d.ts +2 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/mentions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +2 -2
- package/dist/types/plugins/panel/index.d.ts +2 -2
- package/dist/types/plugins/paste/index.d.ts +3 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
- package/dist/types/plugins/placeholder/index.d.ts +4 -4
- package/dist/types/plugins/placeholder/styles.d.ts +0 -1
- package/dist/types/plugins/placeholder-text/index.d.ts +2 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -2
- package/dist/types/plugins/rule/index.d.ts +2 -2
- package/dist/types/plugins/save-on-enter/index.d.ts +3 -2
- package/dist/types/plugins/scroll-into-view/index.d.ts +2 -2
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/status/index.d.ts +2 -2
- package/dist/types/plugins/submit-editor/index.d.ts +4 -2
- package/dist/types/plugins/tasks-and-decisions/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/plugins/text-formatting/index.d.ts +2 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +4 -3
- package/dist/types/plugins/type-ahead/index.d.ts +2 -2
- package/dist/types/plugins/type-ahead/messages.d.ts +41 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +3 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +7 -1
- package/dist/types/plugins/undo-redo/index.d.ts +2 -2
- package/dist/types/plugins/unsupported-content/index.d.ts +2 -2
- package/dist/types/plugins/view-update-subscription/index.d.ts +2 -2
- package/dist/types/plugins/width/index.d.ts +2 -2
- package/dist/types/test-utils.d.ts +2 -1
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +0 -2
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/Fields/Fieldset.d.ts +2 -1
- package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -23
- package/dist/types/ui/ConfigPanel/types.d.ts +22 -0
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +1 -0
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +4 -1
- package/package.json +24 -24
- package/report.api.md +25 -16
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +0 -181
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -66
- package/dist/cjs/plugins/emoji/ui/EmojiContextProvider/index.js +0 -61
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +0 -151
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/es2019/plugins/emoji/ui/EmojiContextProvider/index.js +0 -21
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +0 -161
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/esm/plugins/emoji/ui/EmojiContextProvider/index.js +0 -46
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +0 -25
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +0 -5
- package/dist/types/plugins/emoji/ui/EmojiContextProvider/index.d.ts +0 -13
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import { Fragment } from 'prosemirror-model';
|
|
5
|
-
import
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import nodeNames from '../../../messages';
|
|
6
6
|
import { isSupportedInParent } from '../../../utils/nodes';
|
|
7
|
-
import Dropdown from '../../floating-toolbar/ui/Dropdown';
|
|
8
7
|
import { messages } from '../messages';
|
|
9
|
-
import
|
|
10
|
-
import { getFeatureFlags } from '../../../plugins/feature-flags-context';
|
|
11
|
-
import { LinkToolbarIconDropdown } from './LinkToolbarIconDropdown';
|
|
12
|
-
import { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
8
|
+
import { changeSelectedCardToLink, setSelectedCardAppearance } from '../pm-plugins/doc';
|
|
13
9
|
import { getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
14
|
-
import {
|
|
10
|
+
import { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
15
11
|
export class LinkToolbarAppearance extends React.Component {
|
|
16
12
|
constructor(...args) {
|
|
17
13
|
super(...args);
|
|
@@ -82,34 +78,9 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
82
78
|
options.push(embedOption);
|
|
83
79
|
}
|
|
84
80
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (viewChangingExperimentToolbarStyle === 'toolbarIcons') {
|
|
90
|
-
return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
|
|
91
|
-
key: "link-toolbar-button-group",
|
|
92
|
-
options: options.map(option => getButtonGroupOption(intl, dispatchCommand, option))
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (viewChangingExperimentToolbarStyle === 'newDropdown') {
|
|
97
|
-
return /*#__PURE__*/React.createElement(LinkToolbarIconDropdown, {
|
|
98
|
-
key: "link-toolbar-icon-dropdown",
|
|
99
|
-
title: "Change view",
|
|
100
|
-
buttonTestId: "link-toolbar-appearance-button",
|
|
101
|
-
dispatchCommand: dispatchCommand,
|
|
102
|
-
options: options.map(option => getIconDropdownOption(intl, dispatchCommand, option))
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const title = intl.formatMessage(currentAppearance ? messages[currentAppearance] : messages.url);
|
|
107
|
-
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
108
|
-
key: "link-toolbar",
|
|
109
|
-
buttonTestId: "link-toolbar-appearance-button",
|
|
110
|
-
title: title,
|
|
111
|
-
dispatchCommand: dispatchCommand,
|
|
112
|
-
options: options
|
|
81
|
+
return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
|
|
82
|
+
key: "link-toolbar-button-group",
|
|
83
|
+
options: options.map(option => getButtonGroupOption(intl, dispatchCommand, option))
|
|
113
84
|
});
|
|
114
85
|
});
|
|
115
86
|
}
|
|
@@ -41,18 +41,31 @@ export const findCardInfo = state => {
|
|
|
41
41
|
const pluginState = pluginKey.getState(state);
|
|
42
42
|
return pluginState.cards.find(cardInfo => cardInfo.pos === state.selection.from);
|
|
43
43
|
};
|
|
44
|
-
export const transformUnsupportedBlockCardToInline = (slice, state) => {
|
|
44
|
+
export const transformUnsupportedBlockCardToInline = (slice, state, cardOptions) => {
|
|
45
45
|
const {
|
|
46
46
|
blockCard,
|
|
47
47
|
inlineCard
|
|
48
48
|
} = state.schema.nodes;
|
|
49
49
|
const children = [];
|
|
50
50
|
mapChildren(slice.content, (node, i, frag) => {
|
|
51
|
-
|
|
51
|
+
var _cardOptions$allowBlo;
|
|
52
|
+
|
|
53
|
+
if (node.type === blockCard && !isBlockCardSupported(state, frag, (_cardOptions$allowBlo = cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowBlockCards) !== null && _cardOptions$allowBlo !== void 0 ? _cardOptions$allowBlo : false)) {
|
|
52
54
|
children.push(inlineCard.createChecked(node.attrs, node.content, node.marks));
|
|
53
55
|
} else {
|
|
54
56
|
children.push(node);
|
|
55
57
|
}
|
|
56
58
|
});
|
|
57
59
|
return new Slice(Fragment.fromArray(children), slice.openStart, slice.openEnd);
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Function to determine if a block card is supported by the editor
|
|
63
|
+
* @param state
|
|
64
|
+
* @param frag
|
|
65
|
+
* @param allowBlockCards
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
const isBlockCardSupported = (state, frag, allowBlockCards) => {
|
|
70
|
+
return allowBlockCards && isSupportedInParent(state, frag);
|
|
58
71
|
};
|
|
@@ -18,7 +18,7 @@ export const handleInit = (initData, view, options) => {
|
|
|
18
18
|
tr.setMeta('isRemote', true);
|
|
19
19
|
view.dispatch(tr);
|
|
20
20
|
} else if (json) {
|
|
21
|
-
applyRemoteSteps(json,
|
|
21
|
+
applyRemoteSteps(json, view);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
export const handleConnection = (connectionData, view) => {
|
|
@@ -44,10 +44,10 @@ export const applyRemoteData = (remoteData, view, options) => {
|
|
|
44
44
|
} = remoteData;
|
|
45
45
|
|
|
46
46
|
if (json) {
|
|
47
|
-
applyRemoteSteps(json,
|
|
47
|
+
applyRemoteSteps(json, view, userIds, options);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
export const applyRemoteSteps = (json,
|
|
50
|
+
export const applyRemoteSteps = (json, view, userIds, options) => {
|
|
51
51
|
if (!json || !json.length) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
@@ -17,7 +17,9 @@ export function getCopyButtonConfig(options) {
|
|
|
17
17
|
state,
|
|
18
18
|
formatMessage,
|
|
19
19
|
onMouseEnter,
|
|
20
|
-
onMouseLeave
|
|
20
|
+
onMouseLeave,
|
|
21
|
+
onFocus,
|
|
22
|
+
onBlur
|
|
21
23
|
} = options;
|
|
22
24
|
const copyButtonState = copyButtonPluginKey.getState(state);
|
|
23
25
|
let buttonActionHandlers;
|
|
@@ -28,11 +30,11 @@ export function getCopyButtonConfig(options) {
|
|
|
28
30
|
// Note for future changes: these two handlers should perform
|
|
29
31
|
// the same action.
|
|
30
32
|
onMouseEnter: onMouseEnter || hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
|
|
31
|
-
onFocus: hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
|
|
33
|
+
onFocus: onFocus || hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
|
|
32
34
|
// Note for future changes: these two handlers should perform
|
|
33
35
|
// the same action.
|
|
34
36
|
onMouseLeave: resetCopiedState(options.nodeType, onMouseLeave),
|
|
35
|
-
onBlur: resetCopiedState(options.nodeType)
|
|
37
|
+
onBlur: resetCopiedState(options.nodeType, onBlur)
|
|
36
38
|
};
|
|
37
39
|
} else {
|
|
38
40
|
buttonActionHandlers = {
|
|
@@ -6,7 +6,6 @@ import WithPluginState from '../../ui/WithPluginState';
|
|
|
6
6
|
import { insertDate, closeDatePicker, closeDatePickerWithAnalytics, createDate, deleteDate } from './actions';
|
|
7
7
|
import createDatePlugin from './pm-plugins/main';
|
|
8
8
|
import keymap from './pm-plugins/keymap';
|
|
9
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
10
9
|
import { pluginKey as editorDisabledPluginKey } from '../editor-disabled';
|
|
11
10
|
import { IconDate } from '../quick-insert/assets';
|
|
12
11
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
|
|
@@ -53,7 +52,6 @@ const datePlugin = () => ({
|
|
|
53
52
|
popupsScrollableElement
|
|
54
53
|
}) {
|
|
55
54
|
const {
|
|
56
|
-
state,
|
|
57
55
|
dispatch
|
|
58
56
|
} = editorView;
|
|
59
57
|
const domAtPos = editorView.domAtPos.bind(editorView);
|
|
@@ -76,16 +74,11 @@ const datePlugin = () => ({
|
|
|
76
74
|
focusDateInput
|
|
77
75
|
} = datePlugin;
|
|
78
76
|
const element = findDomRefAtPos(showDatePickerAt, domAtPos);
|
|
79
|
-
const allFlags = getFeatureFlags(state);
|
|
80
|
-
const {
|
|
81
|
-
keyboardAccessibleDatepicker
|
|
82
|
-
} = allFlags;
|
|
83
77
|
return /*#__PURE__*/React.createElement(DatePicker, {
|
|
84
78
|
mountTo: popupsMountPoint,
|
|
85
79
|
boundariesElement: popupsBoundariesElement,
|
|
86
80
|
scrollableElement: popupsScrollableElement,
|
|
87
81
|
key: showDatePickerAt,
|
|
88
|
-
showTextField: keyboardAccessibleDatepicker,
|
|
89
82
|
element: element,
|
|
90
83
|
isNew: isNew,
|
|
91
84
|
autoFocus: focusDateInput,
|
|
@@ -101,7 +101,6 @@ class DatePicker extends React.Component {
|
|
|
101
101
|
mountTo,
|
|
102
102
|
boundariesElement,
|
|
103
103
|
scrollableElement,
|
|
104
|
-
showTextField,
|
|
105
104
|
intl,
|
|
106
105
|
dispatchAnalyticsEvent,
|
|
107
106
|
isNew,
|
|
@@ -143,7 +142,7 @@ class DatePicker extends React.Component {
|
|
|
143
142
|
scrollableElement: scrollableElement
|
|
144
143
|
}, jsx("div", {
|
|
145
144
|
css: popupContentWrapper
|
|
146
|
-
},
|
|
145
|
+
}, jsx(DatePickerInput, {
|
|
147
146
|
date: date,
|
|
148
147
|
onNewDate: this.handleNewDate,
|
|
149
148
|
onSubmitDate: this.handleKeyboardSubmitDate,
|
|
@@ -10,7 +10,6 @@ import { inputRulePlugin as asciiInputRulePlugin } from './pm-plugins/ascii-inpu
|
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
|
|
11
11
|
import { IconEmoji } from '../quick-insert/assets';
|
|
12
12
|
import { EmojiNodeView } from './nodeviews/emoji';
|
|
13
|
-
import { EmojiContextProvider } from './ui/EmojiContextProvider';
|
|
14
13
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
15
14
|
import { openTypeAheadAtCursor } from '../type-ahead/transforms/open-typeahead-at-cursor';
|
|
16
15
|
export const emojiToTypeaheadItem = (emoji, emojiProvider) => ({
|
|
@@ -22,18 +21,13 @@ export const emojiToTypeaheadItem = (emoji, emojiProvider) => ({
|
|
|
22
21
|
onClick,
|
|
23
22
|
onHover
|
|
24
23
|
}) {
|
|
25
|
-
return (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
selected: isSelected,
|
|
33
|
-
onMouseMove: onHover,
|
|
34
|
-
onSelection: onClick
|
|
35
|
-
}))
|
|
36
|
-
);
|
|
24
|
+
return /*#__PURE__*/React.createElement(EmojiTypeAheadItem, {
|
|
25
|
+
emoji: emoji,
|
|
26
|
+
selected: isSelected,
|
|
27
|
+
onMouseMove: onHover,
|
|
28
|
+
onSelection: onClick,
|
|
29
|
+
emojiProvider: emojiProvider
|
|
30
|
+
});
|
|
37
31
|
},
|
|
38
32
|
|
|
39
33
|
emoji
|
|
@@ -6,11 +6,11 @@ import { setExpandRef } from '../commands';
|
|
|
6
6
|
import { findExpand } from '../utils';
|
|
7
7
|
import { expandClassNames } from '../ui/class-names';
|
|
8
8
|
import { getPluginState, createPluginState, pluginKey } from './plugin-factory';
|
|
9
|
+
export function containsClass(element, className) {
|
|
10
|
+
var _element$classList;
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
return !!element && element.classList.contains(className);
|
|
12
|
+
return Boolean(element === null || element === void 0 ? void 0 : (_element$classList = element.classList) === null || _element$classList === void 0 ? void 0 : _element$classList.contains(className));
|
|
12
13
|
}
|
|
13
|
-
|
|
14
14
|
export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLongPressSelection = false) => {
|
|
15
15
|
const state = createPluginState(dispatch, {});
|
|
16
16
|
const isMobile = appearance === 'mobile';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { removeSelectedNode, removeParentNodeOfType } from 'prosemirror-utils';
|
|
2
2
|
import { applyChange } from '../context-panel/transforms';
|
|
3
3
|
import { createCommand } from './plugin-factory';
|
|
4
|
-
import { getSelectedExtension } from './utils';
|
|
4
|
+
import { getSelectedExtension } from './utils';
|
|
5
|
+
import { removeConnectedNodes } from '@atlaskit/editor-common/utils'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
5
6
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
6
7
|
|
|
7
8
|
export function updateState(state) {
|
|
@@ -70,4 +71,12 @@ export const removeExtension = () => createCommand({
|
|
|
70
71
|
} else {
|
|
71
72
|
return removeParentNodeOfType(state.schema.nodes.bodiedExtension)(tr);
|
|
72
73
|
}
|
|
74
|
+
});
|
|
75
|
+
export const removeDescendantNodes = sourceNode => createCommand({
|
|
76
|
+
type: 'UPDATE_STATE',
|
|
77
|
+
data: {
|
|
78
|
+
element: undefined
|
|
79
|
+
}
|
|
80
|
+
}, (tr, state) => {
|
|
81
|
+
return sourceNode ? removeConnectedNodes(state, sourceNode) : tr;
|
|
73
82
|
});
|
|
@@ -129,6 +129,16 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
|
|
|
129
129
|
if (!selectedExtension) {
|
|
130
130
|
if (showContextPanel) {
|
|
131
131
|
clearEditingContext(state, dispatch);
|
|
132
|
+
} // if an extension is no longer selected, but the plugin has cached the previous selected extension id/ref
|
|
133
|
+
// then this should clear those values so that if an exention is selected again, then this sees it as a change
|
|
134
|
+
// and updates the state correctly.
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
if (!!localId || !!element) {
|
|
138
|
+
updateState({
|
|
139
|
+
localId: undefined,
|
|
140
|
+
element: undefined
|
|
141
|
+
})(state, dispatch);
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
return;
|
|
@@ -10,24 +10,34 @@ import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
|
10
10
|
import { editExtension } from './actions';
|
|
11
11
|
import { getPluginState } from './pm-plugins/main';
|
|
12
12
|
import { getSelectedExtension } from './utils';
|
|
13
|
-
import { updateExtensionLayout, removeExtension } from './commands';
|
|
13
|
+
import { updateExtensionLayout, removeExtension, removeDescendantNodes } from './commands';
|
|
14
14
|
import { pluginKey as macroPluginKey } from '../macro/plugin-key';
|
|
15
|
-
import { isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
15
|
+
import { isReferencedSource, getChildrenInfo, getNodeName } from '@atlaskit/editor-common/utils';
|
|
16
16
|
export const messages = defineMessages({
|
|
17
17
|
edit: {
|
|
18
18
|
id: 'fabric.editor.edit',
|
|
19
19
|
defaultMessage: 'Edit',
|
|
20
20
|
description: 'Edit the properties for this extension.'
|
|
21
21
|
},
|
|
22
|
+
deleteElementTitle: {
|
|
23
|
+
id: 'fabric.editor.extension.deleteElementTitle',
|
|
24
|
+
defaultMessage: 'Delete element',
|
|
25
|
+
description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
|
|
26
|
+
},
|
|
22
27
|
confirmDeleteLinkedModalOKButton: {
|
|
23
28
|
id: 'fabric.editor.extension.confirmDeleteLinkedModalOKButton',
|
|
24
|
-
defaultMessage: '
|
|
29
|
+
defaultMessage: 'Delete',
|
|
25
30
|
description: 'Action button label for confirm modal when deleting an extension linked to a data consumer.'
|
|
26
31
|
},
|
|
27
32
|
confirmDeleteLinkedModalMessage: {
|
|
28
33
|
id: 'fabric.editor.extension.confirmDeleteLinkedModalMessage',
|
|
29
|
-
defaultMessage: '
|
|
34
|
+
defaultMessage: 'Deleting {nodeName} will break anything connected to it.',
|
|
30
35
|
description: 'Message for confirm modal when deleting a extension linked to an data consumer.'
|
|
36
|
+
},
|
|
37
|
+
confirmModalCheckboxLabel: {
|
|
38
|
+
id: 'fabric.editor.floatingToolbar.confirmModalCheckboxLabel',
|
|
39
|
+
defaultMessage: 'Also delete connected elements',
|
|
40
|
+
description: 'checkbox label text'
|
|
31
41
|
}
|
|
32
42
|
});
|
|
33
43
|
|
|
@@ -106,7 +116,8 @@ const editButton = (formatMessage, extensionState) => {
|
|
|
106
116
|
return true;
|
|
107
117
|
},
|
|
108
118
|
title: formatMessage(messages.edit),
|
|
109
|
-
tabIndex: null
|
|
119
|
+
tabIndex: null,
|
|
120
|
+
focusEditoronEnter: true
|
|
110
121
|
}];
|
|
111
122
|
};
|
|
112
123
|
|
|
@@ -125,9 +136,18 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
|
|
|
125
136
|
let confirmDialog;
|
|
126
137
|
|
|
127
138
|
if (isReferencedSource(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)) {
|
|
128
|
-
confirmDialog = {
|
|
129
|
-
|
|
130
|
-
|
|
139
|
+
confirmDialog = () => {
|
|
140
|
+
return {
|
|
141
|
+
title: formatMessage(messages.deleteElementTitle),
|
|
142
|
+
okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
|
|
143
|
+
message: formatMessage(messages.confirmDeleteLinkedModalMessage, {
|
|
144
|
+
nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
|
|
145
|
+
}),
|
|
146
|
+
isReferentialityDialog: true,
|
|
147
|
+
getChildrenInfo: () => getChildrenInfo(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node),
|
|
148
|
+
checkboxLabel: formatMessage(messages.confirmModalCheckboxLabel),
|
|
149
|
+
onConfirm: (isChecked = false) => clickWithCheckboxHandler(isChecked, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
|
|
150
|
+
};
|
|
131
151
|
};
|
|
132
152
|
}
|
|
133
153
|
|
|
@@ -160,6 +180,7 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
|
|
|
160
180
|
onMouseLeave: hoverDecoration(nodeType, false),
|
|
161
181
|
onFocus: hoverDecoration(nodeType, true),
|
|
162
182
|
onBlur: hoverDecoration(nodeType, false),
|
|
183
|
+
focusEditoronEnter: true,
|
|
163
184
|
title: formatMessage(commonMessages.remove),
|
|
164
185
|
tabIndex: null,
|
|
165
186
|
confirmDialog
|
|
@@ -169,4 +190,18 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
|
|
|
169
190
|
}
|
|
170
191
|
|
|
171
192
|
return;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const clickWithCheckboxHandler = (isChecked, node) => (state, dispatch) => {
|
|
196
|
+
if (!node) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (!isChecked) {
|
|
201
|
+
removeExtension()(state, dispatch);
|
|
202
|
+
} else {
|
|
203
|
+
removeDescendantNodes(node)(state, dispatch);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return true;
|
|
172
207
|
};
|
|
@@ -26,7 +26,7 @@ function getSpellCheck(featureFlags) {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
export function createFeatureFlagsFromProps(props) {
|
|
29
|
-
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;
|
|
29
|
+
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;
|
|
30
30
|
|
|
31
31
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
32
32
|
const tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
@@ -34,11 +34,9 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
34
34
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
35
35
|
interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
|
|
36
36
|
placeholderBracketHint: !!props.placeholderBracketHint,
|
|
37
|
-
placeholderHints: Array.isArray(props.placeholderHints) && props.placeholderHints.length > 0,
|
|
38
37
|
moreTextColors: typeof props.allowTextColor === 'boolean' ? false : Boolean(((_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) === true),
|
|
39
38
|
findReplace: !!props.allowFindReplace,
|
|
40
39
|
findReplaceMatchCase: typeof props.allowFindReplace === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
|
|
41
|
-
keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
|
|
42
40
|
addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
|
|
43
41
|
singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
44
42
|
undoRedoButtons: props.allowUndoRedoButtons,
|
|
@@ -59,17 +57,19 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
59
57
|
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)),
|
|
60
58
|
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),
|
|
61
59
|
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
62
|
-
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,
|
|
63
60
|
tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
|
|
64
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
65
|
-
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
66
|
-
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$
|
|
67
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
61
|
+
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),
|
|
62
|
+
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)),
|
|
63
|
+
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)),
|
|
64
|
+
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,
|
|
68
65
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
69
66
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
70
67
|
// are included (they are not kebab cased)
|
|
71
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
72
|
-
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$
|
|
73
|
-
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$
|
|
68
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.restartNumberedLists) === true,
|
|
69
|
+
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.listNumberContinuity) === true,
|
|
70
|
+
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedListsToolbar) === true,
|
|
71
|
+
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)),
|
|
72
|
+
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
73
|
+
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)
|
|
74
74
|
};
|
|
75
75
|
}
|
|
@@ -11,7 +11,8 @@ import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
|
|
|
11
11
|
import Dropdown from '../../../ui/Dropdown';
|
|
12
12
|
import FindReplace from './FindReplace';
|
|
13
13
|
import { TRIGGER_METHOD } from '../../analytics/types';
|
|
14
|
-
import { ToolTipContent, findKeymapByDescription } from '../../../keymaps';
|
|
14
|
+
import { ToolTipContent, findKeymapByDescription, tooltip } from '../../../keymaps';
|
|
15
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
15
16
|
const toolbarButtonWrapper = css`
|
|
16
17
|
display: flex;
|
|
17
18
|
flex: 1 1 auto;
|
|
@@ -72,6 +73,7 @@ class FindReplaceToolbarButton extends React.PureComponent {
|
|
|
72
73
|
} = this.props;
|
|
73
74
|
const title = formatMessage(messages.findReplaceToolbarButton);
|
|
74
75
|
const stackBelowOtherEditorFloatingPanels = akEditorFloatingPanelZIndex - 1;
|
|
76
|
+
const keymap = findKeymapByDescription('Find');
|
|
75
77
|
return jsx("div", {
|
|
76
78
|
css: [toolbarButtonWrapper, takeFullWidth && toolbarButtonWrapperFullWith]
|
|
77
79
|
}, jsx(Dropdown, {
|
|
@@ -95,14 +97,16 @@ class FindReplaceToolbarButton extends React.PureComponent {
|
|
|
95
97
|
selected: isActive,
|
|
96
98
|
title: jsx(ToolTipContent, {
|
|
97
99
|
description: title,
|
|
98
|
-
keymap:
|
|
100
|
+
keymap: keymap
|
|
99
101
|
}),
|
|
100
102
|
iconBefore: jsx(EditorSearchIcon, {
|
|
101
103
|
label: title
|
|
102
104
|
}),
|
|
103
105
|
onClick: this.toggleOpen,
|
|
104
106
|
"aria-expanded": isActive,
|
|
105
|
-
"aria-haspopup": true
|
|
107
|
+
"aria-haspopup": true,
|
|
108
|
+
"aria-label": keymap ? tooltip(keymap, title) : title,
|
|
109
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(keymap)
|
|
106
110
|
})
|
|
107
111
|
}, jsx("div", {
|
|
108
112
|
css: wrapper
|
|
@@ -190,7 +190,9 @@ const floatingToolbarPlugin = () => ({
|
|
|
190
190
|
zIndex,
|
|
191
191
|
offset = [0, 12],
|
|
192
192
|
forcePlacement,
|
|
193
|
-
|
|
193
|
+
preventPopupOverflow,
|
|
194
|
+
onPositionCalculated,
|
|
195
|
+
focusTrap
|
|
194
196
|
} = config;
|
|
195
197
|
const targetRef = getDomRef(editorView, dispatchAnalyticsEvent);
|
|
196
198
|
|
|
@@ -215,6 +217,7 @@ const floatingToolbarPlugin = () => ({
|
|
|
215
217
|
} = floatingToolbarData || {};
|
|
216
218
|
const confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
217
219
|
const scrollable = getFeatureFlags(editorView.state).floatingToolbarCopyButton && config.scrollable;
|
|
220
|
+
const 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;
|
|
218
221
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
219
222
|
component: ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
220
223
|
componentId: camelCase(title),
|
|
@@ -237,7 +240,9 @@ const floatingToolbarPlugin = () => ({
|
|
|
237
240
|
onPositionCalculated: customPositionCalculation,
|
|
238
241
|
style: scrollable ? {
|
|
239
242
|
maxWidth: '100%'
|
|
240
|
-
} : {}
|
|
243
|
+
} : {},
|
|
244
|
+
focusTrap: focusTrap,
|
|
245
|
+
preventOverflow: preventPopupOverflow
|
|
241
246
|
}, /*#__PURE__*/React.createElement(ToolbarLoader, {
|
|
242
247
|
target: targetRef,
|
|
243
248
|
items: toolbarItems,
|
|
@@ -254,9 +259,14 @@ const floatingToolbarPlugin = () => ({
|
|
|
254
259
|
extensionsProvider: extensionsState === null || extensionsState === void 0 ? void 0 : extensionsState.extensionProvider,
|
|
255
260
|
scrollable: scrollable
|
|
256
261
|
})), /*#__PURE__*/React.createElement(ConfirmationModal, {
|
|
257
|
-
options:
|
|
258
|
-
onConfirm: () => {
|
|
259
|
-
|
|
262
|
+
options: confirmDialogOptions,
|
|
263
|
+
onConfirm: (isChecked = false) => {
|
|
264
|
+
if (!!confirmDialogOptions.onConfirm) {
|
|
265
|
+
dispatchCommand(confirmDialogOptions.onConfirm(isChecked));
|
|
266
|
+
} else {
|
|
267
|
+
dispatchCommand(confirmButtonItem.onClick);
|
|
268
|
+
}
|
|
269
|
+
|
|
260
270
|
dispatchCommand(hideConfirmDialog());
|
|
261
271
|
} // When closed without clicking OK or cancel buttons
|
|
262
272
|
,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import Button from '@atlaskit/button/standard-button';
|
|
4
|
+
import { Checkbox } from '@atlaskit/checkbox';
|
|
5
|
+
import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
6
|
+
import messages from './messages';
|
|
7
|
+
export const CheckboxModal = props => {
|
|
8
|
+
const [isChecked, setCheckbox] = useState(false);
|
|
9
|
+
const {
|
|
10
|
+
onConfirm,
|
|
11
|
+
onClose,
|
|
12
|
+
options,
|
|
13
|
+
intl: {
|
|
14
|
+
formatMessage
|
|
15
|
+
},
|
|
16
|
+
testId
|
|
17
|
+
} = props;
|
|
18
|
+
const heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(messages.confirmModalDefaultHeading);
|
|
19
|
+
const okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
20
|
+
const cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
21
|
+
const checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
22
|
+
|
|
23
|
+
const ListComponent = ({
|
|
24
|
+
nodes
|
|
25
|
+
}) => {
|
|
26
|
+
if (!nodes) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return /*#__PURE__*/React.createElement("ul", null, nodes.map(node => /*#__PURE__*/React.createElement(ListItem, _extends({}, node, {
|
|
31
|
+
key: node.id
|
|
32
|
+
}))));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const ListItem = props => {
|
|
36
|
+
const {
|
|
37
|
+
id,
|
|
38
|
+
name,
|
|
39
|
+
amount
|
|
40
|
+
} = props;
|
|
41
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
42
|
+
id: id
|
|
43
|
+
}, formatMessage(messages.confirmModalListUnit, {
|
|
44
|
+
name,
|
|
45
|
+
amount
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
50
|
+
onClose: onClose,
|
|
51
|
+
testId: testId
|
|
52
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
53
|
+
appearance: "warning"
|
|
54
|
+
}, 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, {
|
|
55
|
+
nodes: options === null || options === void 0 ? void 0 : options.getChildrenInfo()
|
|
56
|
+
}), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
57
|
+
isChecked: isChecked,
|
|
58
|
+
onChange: () => setCheckbox(!isChecked),
|
|
59
|
+
label: checkboxlabel,
|
|
60
|
+
testId: testId ? `${testId}-checkbox` : undefined
|
|
61
|
+
}))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
62
|
+
appearance: "default",
|
|
63
|
+
onClick: onClose,
|
|
64
|
+
testId: testId ? `${testId}-cancel-button` : undefined
|
|
65
|
+
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
66
|
+
appearance: "warning",
|
|
67
|
+
onClick: () => onConfirm(isChecked),
|
|
68
|
+
testId: testId ? `${testId}-confirm-button` : undefined
|
|
69
|
+
}, okButtonLabel)));
|
|
70
|
+
};
|