@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,181 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.LinkToolbarIconDropdown = exports.ICON_WIDTH = exports.ICON_HEIGHT = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _react2 = require("@emotion/react");
|
|
17
|
-
|
|
18
|
-
var _menu = require("@atlaskit/menu");
|
|
19
|
-
|
|
20
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
21
|
-
|
|
22
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
23
|
-
|
|
24
|
-
var _tokens = require("@atlaskit/tokens");
|
|
25
|
-
|
|
26
|
-
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
27
|
-
|
|
28
|
-
var _Dropdown = _interopRequireDefault(require("../../floating-toolbar/ui/Dropdown"));
|
|
29
|
-
|
|
30
|
-
var _excluded = ["options"];
|
|
31
|
-
var ICON_HEIGHT = 40;
|
|
32
|
-
exports.ICON_HEIGHT = ICON_HEIGHT;
|
|
33
|
-
var ICON_WIDTH = 40;
|
|
34
|
-
exports.ICON_WIDTH = ICON_WIDTH;
|
|
35
|
-
var iconBoxStyles = (0, _react2.css)({
|
|
36
|
-
width: ICON_HEIGHT,
|
|
37
|
-
height: ICON_WIDTH,
|
|
38
|
-
overflow: 'hidden',
|
|
39
|
-
border: "1px solid ".concat((0, _tokens.token)('color.border', 'rgba(223, 225, 229, 0.5)'))
|
|
40
|
-
/* N60 at 50% */
|
|
41
|
-
,
|
|
42
|
-
borderRadius: (0, _constants.borderRadius)(),
|
|
43
|
-
boxSizing: 'border-box',
|
|
44
|
-
display: 'flex',
|
|
45
|
-
justifyContent: 'center',
|
|
46
|
-
alignItems: 'center',
|
|
47
|
-
backgroundColor: (0, _tokens.token)('elevation.surface', 'white')
|
|
48
|
-
});
|
|
49
|
-
var primitiveStyles = (0, _react2.css)({
|
|
50
|
-
padding: '0.75rem',
|
|
51
|
-
alignItems: 'flex-start'
|
|
52
|
-
});
|
|
53
|
-
var interactiveStyles = (0, _react2.css)({
|
|
54
|
-
'&:active': {
|
|
55
|
-
backgroundColor: (0, _tokens.token)('color.background.selected.pressed', _colors.B50),
|
|
56
|
-
color: (0, _tokens.token)('color.text.selected', _colors.B400)
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
var unselectedStyles = (0, _react2.css)({
|
|
60
|
-
'&:hover': {
|
|
61
|
-
backgroundColor: (0, _tokens.token)('color.background.neutral.subtle.hovered', _colors.N20),
|
|
62
|
-
color: (0, _tokens.token)('color.text.brand', 'currentColor')
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
var selectedOptionStyles = (0, _react2.css)({
|
|
66
|
-
backgroundColor: (0, _tokens.token)('color.background.selected.pressed', _colors.B50),
|
|
67
|
-
color: (0, _tokens.token)('color.text.selected', 'currentColor'),
|
|
68
|
-
'&:hover': {
|
|
69
|
-
backgroundColor: (0, _tokens.token)('color.background.selected.pressed', _colors.B50),
|
|
70
|
-
color: (0, _tokens.token)('color.text.selected', 'currentColor')
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
var titleOffsetStyles = (0, _react2.css)({
|
|
74
|
-
marginTop: '0.125rem'
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
var getCustomStyles = function getCustomStyles(selected, disabled) {
|
|
78
|
-
if (disabled) {
|
|
79
|
-
return [primitiveStyles];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (selected) {
|
|
83
|
-
return [primitiveStyles, selectedOptionStyles, interactiveStyles];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return [primitiveStyles, unselectedStyles, interactiveStyles];
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
//tabindex is -1 as the menu options should be focusable explicitly only by arrow keys.
|
|
90
|
-
var OptionRoot = function OptionRoot(props) {
|
|
91
|
-
return (0, _react2.jsx)("div", (0, _extends2.default)({}, props, {
|
|
92
|
-
tabIndex: -1
|
|
93
|
-
}));
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
var Option = function Option(_ref) {
|
|
97
|
-
var title = _ref.title,
|
|
98
|
-
description = _ref.description,
|
|
99
|
-
selected = _ref.selected,
|
|
100
|
-
disabled = _ref.disabled,
|
|
101
|
-
_onClick = _ref.onClick,
|
|
102
|
-
Icon = _ref.icon,
|
|
103
|
-
testId = _ref.testId,
|
|
104
|
-
tooltipContent = _ref.tooltipContent,
|
|
105
|
-
hide = _ref.hide;
|
|
106
|
-
var option = (0, _react2.jsx)(_menu.CustomItem, {
|
|
107
|
-
"aria-label": title,
|
|
108
|
-
component: OptionRoot,
|
|
109
|
-
iconBefore: (0, _react2.jsx)("div", {
|
|
110
|
-
css: iconBoxStyles
|
|
111
|
-
}, (0, _react2.jsx)(Icon, {
|
|
112
|
-
width: 38,
|
|
113
|
-
height: 38,
|
|
114
|
-
label: title
|
|
115
|
-
})) // @ts-ignore Overriding Menu styles is not supported
|
|
116
|
-
,
|
|
117
|
-
css: getCustomStyles(selected, disabled),
|
|
118
|
-
description: description,
|
|
119
|
-
testId: testId,
|
|
120
|
-
onClick: function onClick(event) {
|
|
121
|
-
event.preventDefault();
|
|
122
|
-
|
|
123
|
-
if (!disabled) {
|
|
124
|
-
_onClick();
|
|
125
|
-
|
|
126
|
-
hide();
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
onKeyDown: function onKeyDown(event) {
|
|
130
|
-
if (event.key === 'Enter' || event.key === 'Space') {
|
|
131
|
-
event.preventDefault();
|
|
132
|
-
|
|
133
|
-
if (!disabled) {
|
|
134
|
-
_onClick();
|
|
135
|
-
|
|
136
|
-
hide();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
role: "option",
|
|
141
|
-
"aria-selected": selected,
|
|
142
|
-
isSelected: selected,
|
|
143
|
-
isDisabled: disabled,
|
|
144
|
-
shouldDescriptionWrap: true
|
|
145
|
-
}, (0, _react2.jsx)("div", {
|
|
146
|
-
css: titleOffsetStyles
|
|
147
|
-
}, title));
|
|
148
|
-
|
|
149
|
-
if (tooltipContent) {
|
|
150
|
-
return (0, _react2.jsx)(_tooltip.default, {
|
|
151
|
-
content: tooltipContent
|
|
152
|
-
}, option);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return option;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
var LinkToolbarIconDropdown = function LinkToolbarIconDropdown(_ref2) {
|
|
159
|
-
var options = _ref2.options,
|
|
160
|
-
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
161
|
-
return (0, _react2.jsx)(_Dropdown.default, (0, _extends2.default)({}, rest, {
|
|
162
|
-
options: {
|
|
163
|
-
render: function render(_ref3) {
|
|
164
|
-
var hide = _ref3.hide;
|
|
165
|
-
return (0, _react2.jsx)(_menu.MenuGroup, null, (0, _react2.jsx)("div", {
|
|
166
|
-
role: "listbox"
|
|
167
|
-
}, (0, _react2.jsx)(_menu.Section, null, options.map(function (props) {
|
|
168
|
-
return (0, _react2.jsx)(Option, (0, _extends2.default)({
|
|
169
|
-
key: props.testId
|
|
170
|
-
}, props, {
|
|
171
|
-
hide: hide
|
|
172
|
-
}));
|
|
173
|
-
}))));
|
|
174
|
-
},
|
|
175
|
-
width: 320,
|
|
176
|
-
height: 200
|
|
177
|
-
}
|
|
178
|
-
}));
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
exports.LinkToolbarIconDropdown = LinkToolbarIconDropdown;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getIconDropdownOption = void 0;
|
|
7
|
-
|
|
8
|
-
var _messages = require("../messages");
|
|
9
|
-
|
|
10
|
-
var _card = require("./assets/card");
|
|
11
|
-
|
|
12
|
-
var _embed = require("./assets/embed");
|
|
13
|
-
|
|
14
|
-
var _inline = require("./assets/inline");
|
|
15
|
-
|
|
16
|
-
var _url = require("./assets/url");
|
|
17
|
-
|
|
18
|
-
var appearancePropsMap = {
|
|
19
|
-
url: {
|
|
20
|
-
title: _messages.messages.urlTitle,
|
|
21
|
-
description: _messages.messages.urlDescription,
|
|
22
|
-
icon: _url.IconUrl
|
|
23
|
-
},
|
|
24
|
-
inline: {
|
|
25
|
-
title: _messages.messages.inlineTitle,
|
|
26
|
-
description: _messages.messages.inlineDescription,
|
|
27
|
-
icon: _inline.IconInline
|
|
28
|
-
},
|
|
29
|
-
block: {
|
|
30
|
-
title: _messages.messages.blockTitle,
|
|
31
|
-
description: _messages.messages.blockDescription,
|
|
32
|
-
icon: _card.IconCard
|
|
33
|
-
},
|
|
34
|
-
embed: {
|
|
35
|
-
title: _messages.messages.embedTitle,
|
|
36
|
-
description: _messages.messages.embedDescription,
|
|
37
|
-
icon: _embed.IconEmbed
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var getIconDropdownOption = function getIconDropdownOption(intl, dispatchCommand, _ref) {
|
|
42
|
-
var disabled = _ref.disabled,
|
|
43
|
-
_onClick = _ref.onClick,
|
|
44
|
-
selected = _ref.selected,
|
|
45
|
-
appearance = _ref.appearance,
|
|
46
|
-
testId = _ref.testId,
|
|
47
|
-
tooltip = _ref.tooltip;
|
|
48
|
-
var _appearancePropsMap = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'],
|
|
49
|
-
title = _appearancePropsMap.title,
|
|
50
|
-
description = _appearancePropsMap.description,
|
|
51
|
-
icon = _appearancePropsMap.icon;
|
|
52
|
-
return {
|
|
53
|
-
title: intl.formatMessage(title),
|
|
54
|
-
description: intl.formatMessage(description),
|
|
55
|
-
icon: icon,
|
|
56
|
-
onClick: function onClick() {
|
|
57
|
-
return dispatchCommand(_onClick);
|
|
58
|
-
},
|
|
59
|
-
selected: Boolean(selected),
|
|
60
|
-
disabled: Boolean(disabled),
|
|
61
|
-
tooltipContent: tooltip,
|
|
62
|
-
testId: testId
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
exports.getIconDropdownOption = getIconDropdownOption;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.EmojiContextProvider = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
|
-
var _react = _interopRequireDefault(require("react"));
|
|
23
|
-
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
|
-
|
|
28
|
-
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; } }
|
|
29
|
-
|
|
30
|
-
var EmojiContextProvider = /*#__PURE__*/function (_React$Component) {
|
|
31
|
-
(0, _inherits2.default)(EmojiContextProvider, _React$Component);
|
|
32
|
-
|
|
33
|
-
var _super = _createSuper(EmojiContextProvider);
|
|
34
|
-
|
|
35
|
-
function EmojiContextProvider() {
|
|
36
|
-
(0, _classCallCheck2.default)(this, EmojiContextProvider);
|
|
37
|
-
return _super.apply(this, arguments);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
(0, _createClass2.default)(EmojiContextProvider, [{
|
|
41
|
-
key: "getChildContext",
|
|
42
|
-
value: function getChildContext() {
|
|
43
|
-
return {
|
|
44
|
-
emoji: {
|
|
45
|
-
emojiProvider: this.props.emojiProvider
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}, {
|
|
50
|
-
key: "render",
|
|
51
|
-
value: function render() {
|
|
52
|
-
return this.props.children;
|
|
53
|
-
}
|
|
54
|
-
}]);
|
|
55
|
-
return EmojiContextProvider;
|
|
56
|
-
}(_react.default.Component);
|
|
57
|
-
|
|
58
|
-
exports.EmojiContextProvider = EmojiContextProvider;
|
|
59
|
-
(0, _defineProperty2.default)(EmojiContextProvider, "childContextTypes", {
|
|
60
|
-
emoji: _propTypes.default.object
|
|
61
|
-
});
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
/** @jsx jsx */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/react';
|
|
6
|
-
import { MenuGroup, Section, CustomItem } from '@atlaskit/menu';
|
|
7
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
|
-
import { B50, N20, B400 } from '@atlaskit/theme/colors';
|
|
9
|
-
import { token } from '@atlaskit/tokens';
|
|
10
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
11
|
-
import Dropdown from '../../floating-toolbar/ui/Dropdown';
|
|
12
|
-
export const ICON_HEIGHT = 40;
|
|
13
|
-
export const ICON_WIDTH = 40;
|
|
14
|
-
const iconBoxStyles = css({
|
|
15
|
-
width: ICON_HEIGHT,
|
|
16
|
-
height: ICON_WIDTH,
|
|
17
|
-
overflow: 'hidden',
|
|
18
|
-
border: `1px solid ${token('color.border', 'rgba(223, 225, 229, 0.5)')}`
|
|
19
|
-
/* N60 at 50% */
|
|
20
|
-
,
|
|
21
|
-
borderRadius: borderRadius(),
|
|
22
|
-
boxSizing: 'border-box',
|
|
23
|
-
display: 'flex',
|
|
24
|
-
justifyContent: 'center',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
backgroundColor: token('elevation.surface', 'white')
|
|
27
|
-
});
|
|
28
|
-
const primitiveStyles = css({
|
|
29
|
-
padding: '0.75rem',
|
|
30
|
-
alignItems: 'flex-start'
|
|
31
|
-
});
|
|
32
|
-
const interactiveStyles = css({
|
|
33
|
-
'&:active': {
|
|
34
|
-
backgroundColor: token('color.background.selected.pressed', B50),
|
|
35
|
-
color: token('color.text.selected', B400)
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const unselectedStyles = css({
|
|
39
|
-
'&:hover': {
|
|
40
|
-
backgroundColor: token('color.background.neutral.subtle.hovered', N20),
|
|
41
|
-
color: token('color.text.brand', 'currentColor')
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const selectedOptionStyles = css({
|
|
45
|
-
backgroundColor: token('color.background.selected.pressed', B50),
|
|
46
|
-
color: token('color.text.selected', 'currentColor'),
|
|
47
|
-
'&:hover': {
|
|
48
|
-
backgroundColor: token('color.background.selected.pressed', B50),
|
|
49
|
-
color: token('color.text.selected', 'currentColor')
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
const titleOffsetStyles = css({
|
|
53
|
-
marginTop: '0.125rem'
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const getCustomStyles = (selected, disabled) => {
|
|
57
|
-
if (disabled) {
|
|
58
|
-
return [primitiveStyles];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (selected) {
|
|
62
|
-
return [primitiveStyles, selectedOptionStyles, interactiveStyles];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return [primitiveStyles, unselectedStyles, interactiveStyles];
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
//tabindex is -1 as the menu options should be focusable explicitly only by arrow keys.
|
|
69
|
-
const OptionRoot = props => jsx("div", _extends({}, props, {
|
|
70
|
-
tabIndex: -1
|
|
71
|
-
}));
|
|
72
|
-
|
|
73
|
-
const Option = ({
|
|
74
|
-
title,
|
|
75
|
-
description,
|
|
76
|
-
selected,
|
|
77
|
-
disabled,
|
|
78
|
-
onClick,
|
|
79
|
-
icon: Icon,
|
|
80
|
-
testId,
|
|
81
|
-
tooltipContent,
|
|
82
|
-
hide
|
|
83
|
-
}) => {
|
|
84
|
-
const option = jsx(CustomItem, {
|
|
85
|
-
"aria-label": title,
|
|
86
|
-
component: OptionRoot,
|
|
87
|
-
iconBefore: jsx("div", {
|
|
88
|
-
css: iconBoxStyles
|
|
89
|
-
}, jsx(Icon, {
|
|
90
|
-
width: 38,
|
|
91
|
-
height: 38,
|
|
92
|
-
label: title
|
|
93
|
-
})) // @ts-ignore Overriding Menu styles is not supported
|
|
94
|
-
,
|
|
95
|
-
css: getCustomStyles(selected, disabled),
|
|
96
|
-
description: description,
|
|
97
|
-
testId: testId,
|
|
98
|
-
onClick: event => {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
|
|
101
|
-
if (!disabled) {
|
|
102
|
-
onClick();
|
|
103
|
-
hide();
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
onKeyDown: event => {
|
|
107
|
-
if (event.key === 'Enter' || event.key === 'Space') {
|
|
108
|
-
event.preventDefault();
|
|
109
|
-
|
|
110
|
-
if (!disabled) {
|
|
111
|
-
onClick();
|
|
112
|
-
hide();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
role: "option",
|
|
117
|
-
"aria-selected": selected,
|
|
118
|
-
isSelected: selected,
|
|
119
|
-
isDisabled: disabled,
|
|
120
|
-
shouldDescriptionWrap: true
|
|
121
|
-
}, jsx("div", {
|
|
122
|
-
css: titleOffsetStyles
|
|
123
|
-
}, title));
|
|
124
|
-
|
|
125
|
-
if (tooltipContent) {
|
|
126
|
-
return jsx(Tooltip, {
|
|
127
|
-
content: tooltipContent
|
|
128
|
-
}, option);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return option;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const LinkToolbarIconDropdown = ({
|
|
135
|
-
options,
|
|
136
|
-
...rest
|
|
137
|
-
}) => jsx(Dropdown, _extends({}, rest, {
|
|
138
|
-
options: {
|
|
139
|
-
render: ({
|
|
140
|
-
hide
|
|
141
|
-
}) => jsx(MenuGroup, null, jsx("div", {
|
|
142
|
-
role: "listbox"
|
|
143
|
-
}, jsx(Section, null, options.map(props => jsx(Option, _extends({
|
|
144
|
-
key: props.testId
|
|
145
|
-
}, props, {
|
|
146
|
-
hide: hide
|
|
147
|
-
})))))),
|
|
148
|
-
width: 320,
|
|
149
|
-
height: 200
|
|
150
|
-
}
|
|
151
|
-
}));
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { messages } from '../messages';
|
|
2
|
-
import { IconCard } from './assets/card';
|
|
3
|
-
import { IconEmbed } from './assets/embed';
|
|
4
|
-
import { IconInline } from './assets/inline';
|
|
5
|
-
import { IconUrl } from './assets/url';
|
|
6
|
-
const appearancePropsMap = {
|
|
7
|
-
url: {
|
|
8
|
-
title: messages.urlTitle,
|
|
9
|
-
description: messages.urlDescription,
|
|
10
|
-
icon: IconUrl
|
|
11
|
-
},
|
|
12
|
-
inline: {
|
|
13
|
-
title: messages.inlineTitle,
|
|
14
|
-
description: messages.inlineDescription,
|
|
15
|
-
icon: IconInline
|
|
16
|
-
},
|
|
17
|
-
block: {
|
|
18
|
-
title: messages.blockTitle,
|
|
19
|
-
description: messages.blockDescription,
|
|
20
|
-
icon: IconCard
|
|
21
|
-
},
|
|
22
|
-
embed: {
|
|
23
|
-
title: messages.embedTitle,
|
|
24
|
-
description: messages.embedDescription,
|
|
25
|
-
icon: IconEmbed
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export const getIconDropdownOption = (intl, dispatchCommand, {
|
|
29
|
-
disabled,
|
|
30
|
-
onClick,
|
|
31
|
-
selected,
|
|
32
|
-
appearance,
|
|
33
|
-
testId,
|
|
34
|
-
tooltip
|
|
35
|
-
}) => {
|
|
36
|
-
const {
|
|
37
|
-
title,
|
|
38
|
-
description,
|
|
39
|
-
icon
|
|
40
|
-
} = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'];
|
|
41
|
-
return {
|
|
42
|
-
title: intl.formatMessage(title),
|
|
43
|
-
description: intl.formatMessage(description),
|
|
44
|
-
icon,
|
|
45
|
-
onClick: () => dispatchCommand(onClick),
|
|
46
|
-
selected: Boolean(selected),
|
|
47
|
-
disabled: Boolean(disabled),
|
|
48
|
-
tooltipContent: tooltip,
|
|
49
|
-
testId
|
|
50
|
-
};
|
|
51
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
export class EmojiContextProvider extends React.Component {
|
|
5
|
-
getChildContext() {
|
|
6
|
-
return {
|
|
7
|
-
emoji: {
|
|
8
|
-
emojiProvider: this.props.emojiProvider
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
render() {
|
|
14
|
-
return this.props.children;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
_defineProperty(EmojiContextProvider, "childContextTypes", {
|
|
20
|
-
emoji: PropTypes.object
|
|
21
|
-
});
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
var _excluded = ["options"];
|
|
4
|
-
|
|
5
|
-
/** @jsx jsx */
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import { MenuGroup, Section, CustomItem } from '@atlaskit/menu';
|
|
9
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
|
-
import { B50, N20, B400 } from '@atlaskit/theme/colors';
|
|
11
|
-
import { token } from '@atlaskit/tokens';
|
|
12
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
13
|
-
import Dropdown from '../../floating-toolbar/ui/Dropdown';
|
|
14
|
-
export var ICON_HEIGHT = 40;
|
|
15
|
-
export var ICON_WIDTH = 40;
|
|
16
|
-
var iconBoxStyles = css({
|
|
17
|
-
width: ICON_HEIGHT,
|
|
18
|
-
height: ICON_WIDTH,
|
|
19
|
-
overflow: 'hidden',
|
|
20
|
-
border: "1px solid ".concat(token('color.border', 'rgba(223, 225, 229, 0.5)'))
|
|
21
|
-
/* N60 at 50% */
|
|
22
|
-
,
|
|
23
|
-
borderRadius: borderRadius(),
|
|
24
|
-
boxSizing: 'border-box',
|
|
25
|
-
display: 'flex',
|
|
26
|
-
justifyContent: 'center',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
backgroundColor: token('elevation.surface', 'white')
|
|
29
|
-
});
|
|
30
|
-
var primitiveStyles = css({
|
|
31
|
-
padding: '0.75rem',
|
|
32
|
-
alignItems: 'flex-start'
|
|
33
|
-
});
|
|
34
|
-
var interactiveStyles = css({
|
|
35
|
-
'&:active': {
|
|
36
|
-
backgroundColor: token('color.background.selected.pressed', B50),
|
|
37
|
-
color: token('color.text.selected', B400)
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
var unselectedStyles = css({
|
|
41
|
-
'&:hover': {
|
|
42
|
-
backgroundColor: token('color.background.neutral.subtle.hovered', N20),
|
|
43
|
-
color: token('color.text.brand', 'currentColor')
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
var selectedOptionStyles = css({
|
|
47
|
-
backgroundColor: token('color.background.selected.pressed', B50),
|
|
48
|
-
color: token('color.text.selected', 'currentColor'),
|
|
49
|
-
'&:hover': {
|
|
50
|
-
backgroundColor: token('color.background.selected.pressed', B50),
|
|
51
|
-
color: token('color.text.selected', 'currentColor')
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var titleOffsetStyles = css({
|
|
55
|
-
marginTop: '0.125rem'
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
var getCustomStyles = function getCustomStyles(selected, disabled) {
|
|
59
|
-
if (disabled) {
|
|
60
|
-
return [primitiveStyles];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (selected) {
|
|
64
|
-
return [primitiveStyles, selectedOptionStyles, interactiveStyles];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return [primitiveStyles, unselectedStyles, interactiveStyles];
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
//tabindex is -1 as the menu options should be focusable explicitly only by arrow keys.
|
|
71
|
-
var OptionRoot = function OptionRoot(props) {
|
|
72
|
-
return jsx("div", _extends({}, props, {
|
|
73
|
-
tabIndex: -1
|
|
74
|
-
}));
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
var Option = function Option(_ref) {
|
|
78
|
-
var title = _ref.title,
|
|
79
|
-
description = _ref.description,
|
|
80
|
-
selected = _ref.selected,
|
|
81
|
-
disabled = _ref.disabled,
|
|
82
|
-
_onClick = _ref.onClick,
|
|
83
|
-
Icon = _ref.icon,
|
|
84
|
-
testId = _ref.testId,
|
|
85
|
-
tooltipContent = _ref.tooltipContent,
|
|
86
|
-
hide = _ref.hide;
|
|
87
|
-
var option = jsx(CustomItem, {
|
|
88
|
-
"aria-label": title,
|
|
89
|
-
component: OptionRoot,
|
|
90
|
-
iconBefore: jsx("div", {
|
|
91
|
-
css: iconBoxStyles
|
|
92
|
-
}, jsx(Icon, {
|
|
93
|
-
width: 38,
|
|
94
|
-
height: 38,
|
|
95
|
-
label: title
|
|
96
|
-
})) // @ts-ignore Overriding Menu styles is not supported
|
|
97
|
-
,
|
|
98
|
-
css: getCustomStyles(selected, disabled),
|
|
99
|
-
description: description,
|
|
100
|
-
testId: testId,
|
|
101
|
-
onClick: function onClick(event) {
|
|
102
|
-
event.preventDefault();
|
|
103
|
-
|
|
104
|
-
if (!disabled) {
|
|
105
|
-
_onClick();
|
|
106
|
-
|
|
107
|
-
hide();
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
onKeyDown: function onKeyDown(event) {
|
|
111
|
-
if (event.key === 'Enter' || event.key === 'Space') {
|
|
112
|
-
event.preventDefault();
|
|
113
|
-
|
|
114
|
-
if (!disabled) {
|
|
115
|
-
_onClick();
|
|
116
|
-
|
|
117
|
-
hide();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
role: "option",
|
|
122
|
-
"aria-selected": selected,
|
|
123
|
-
isSelected: selected,
|
|
124
|
-
isDisabled: disabled,
|
|
125
|
-
shouldDescriptionWrap: true
|
|
126
|
-
}, jsx("div", {
|
|
127
|
-
css: titleOffsetStyles
|
|
128
|
-
}, title));
|
|
129
|
-
|
|
130
|
-
if (tooltipContent) {
|
|
131
|
-
return jsx(Tooltip, {
|
|
132
|
-
content: tooltipContent
|
|
133
|
-
}, option);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return option;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export var LinkToolbarIconDropdown = function LinkToolbarIconDropdown(_ref2) {
|
|
140
|
-
var options = _ref2.options,
|
|
141
|
-
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
142
|
-
|
|
143
|
-
return jsx(Dropdown, _extends({}, rest, {
|
|
144
|
-
options: {
|
|
145
|
-
render: function render(_ref3) {
|
|
146
|
-
var hide = _ref3.hide;
|
|
147
|
-
return jsx(MenuGroup, null, jsx("div", {
|
|
148
|
-
role: "listbox"
|
|
149
|
-
}, jsx(Section, null, options.map(function (props) {
|
|
150
|
-
return jsx(Option, _extends({
|
|
151
|
-
key: props.testId
|
|
152
|
-
}, props, {
|
|
153
|
-
hide: hide
|
|
154
|
-
}));
|
|
155
|
-
}))));
|
|
156
|
-
},
|
|
157
|
-
width: 320,
|
|
158
|
-
height: 200
|
|
159
|
-
}
|
|
160
|
-
}));
|
|
161
|
-
};
|