@atlaskit/editor-core 175.0.5 → 176.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 +23 -57
- package/CHANGELOG.md +70 -0
- package/dist/cjs/create-editor/ReactEditorView.js +1 -1
- package/dist/cjs/create-editor/create-plugins-list.js +2 -4
- package/dist/cjs/keymaps/index.js +0 -6
- package/dist/cjs/labs/next/presets/cxhtml.js +1 -3
- package/dist/cjs/labs/next/presets/mobile.js +1 -3
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +12 -5
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/alignment/pm-plugins/keymap.js +0 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +27 -4
- package/dist/cjs/plugins/annotation/nodeviews/index.js +7 -35
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +28 -2
- package/dist/cjs/plugins/annotation/utils.js +7 -3
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +1 -0
- package/dist/cjs/plugins/caption/nodeviews/index.js +4 -1
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +1 -0
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -1
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +7 -3
- package/dist/cjs/plugins/code-block/refresh-browser-selection.js +3 -1
- package/dist/cjs/plugins/code-block/styles.js +6 -2
- package/dist/cjs/plugins/code-block/ui/class-names.js +2 -0
- package/dist/cjs/plugins/collab-edit/utils.js +4 -0
- package/dist/cjs/plugins/copy-button/commands.js +5 -3
- package/dist/cjs/plugins/emoji/messages.js +17 -0
- package/dist/cjs/plugins/emoji/nodeviews/emoji.js +18 -2
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +11 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +17 -13
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/index.js +2 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +9 -1
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +20 -1
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +6 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Select.js +10 -4
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -0
- package/dist/cjs/plugins/help-dialog/ui/index.js +1 -4
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +2 -2
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -9
- package/dist/cjs/plugins/media/index.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +27 -3
- package/dist/cjs/plugins/media/pm-plugins/main.js +17 -2
- package/dist/cjs/plugins/media/toolbar/alt-text.js +1 -0
- package/dist/cjs/plugins/media/toolbar/linking.js +1 -0
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +9 -6
- package/dist/cjs/plugins/media/ui/ToolbarMedia/toolbar-media-messages.js +2 -2
- package/dist/cjs/plugins/mentions/messages.js +5 -0
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +18 -2
- package/dist/cjs/plugins/mentions/styles.js +1 -1
- package/dist/cjs/plugins/mentions/ui/Mention/index.js +15 -0
- package/dist/cjs/plugins/panel/actions.js +1 -1
- package/dist/cjs/plugins/panel/index.js +1 -0
- package/dist/cjs/plugins/panel/toolbar.js +2 -2
- package/dist/cjs/plugins/paste/index.js +2 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/quick-insert/assets/action.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/code.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/custom-panel.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/date.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/decision.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/divider.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/emoji.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/expand.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/fallback.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/feedback.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/heading1.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/heading2.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/heading3.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/heading4.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/heading5.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/heading6.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/images.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/layout.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/link.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/list-number.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/list.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/mention.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/panel-error.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/panel-note.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/panel-success.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/panel-warning.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/panel.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/quote.js +3 -0
- package/dist/cjs/plugins/quick-insert/assets/status.js +3 -0
- package/dist/cjs/plugins/selection/gap-cursor/actions.js +26 -3
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +41 -4
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/styles.js +6 -1
- package/dist/cjs/plugins/text-color/utils/color.js +3 -0
- package/dist/cjs/plugins/type-ahead/commands/insert-type-ahead-item.js +4 -3
- package/dist/cjs/plugins/type-ahead/index.js +42 -22
- package/dist/cjs/plugins/type-ahead/messages.js +13 -3
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +25 -16
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +126 -64
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +12 -14
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +37 -14
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +36 -5
- package/dist/cjs/plugins/type-ahead/utils.js +3 -1
- package/dist/cjs/ui/Alignment/index.js +0 -1
- package/dist/cjs/ui/Appearance/Chromeless.js +1 -1
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +6 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +4 -0
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -4
- package/dist/cjs/ui/ConfigPanel/Fields/Select.js +1 -3
- package/dist/cjs/ui/Dropdown/index.js +28 -1
- package/dist/cjs/ui/DropdownMenu/index.js +25 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +0 -1
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +166 -0
- package/dist/cjs/ui/styles.js +12 -18
- package/dist/cjs/utils/clipboard.js +17 -12
- package/dist/cjs/utils/document.js +13 -0
- package/dist/cjs/utils/index.js +0 -9
- package/dist/cjs/utils/input-rules.js +7 -5
- package/dist/cjs/utils/table.js +35 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +2 -4
- package/dist/es2019/keymaps/index.js +1 -1
- package/dist/es2019/labs/next/presets/cxhtml.js +1 -3
- package/dist/es2019/labs/next/presets/mobile.js +1 -3
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +11 -4
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/alignment/pm-plugins/keymap.js +1 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +26 -4
- package/dist/es2019/plugins/annotation/nodeviews/index.js +7 -31
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +24 -3
- package/dist/es2019/plugins/annotation/utils.js +8 -4
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +1 -0
- package/dist/es2019/plugins/caption/nodeviews/index.js +4 -1
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +1 -0
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -1
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +7 -3
- package/dist/es2019/plugins/code-block/refresh-browser-selection.js +2 -1
- package/dist/es2019/plugins/code-block/styles.js +21 -5
- package/dist/es2019/plugins/code-block/ui/class-names.js +2 -0
- package/dist/es2019/plugins/collab-edit/utils.js +5 -1
- package/dist/es2019/plugins/copy-button/commands.js +5 -3
- package/dist/es2019/plugins/emoji/messages.js +8 -0
- package/dist/es2019/plugins/emoji/nodeviews/emoji.js +16 -2
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +10 -1
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +17 -13
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -0
- package/dist/es2019/plugins/floating-toolbar/index.js +2 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +9 -1
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +20 -1
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Select.js +9 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -0
- package/dist/es2019/plugins/help-dialog/ui/index.js +1 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +2 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +15 -2
- package/dist/es2019/plugins/media/index.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +25 -4
- package/dist/es2019/plugins/media/pm-plugins/main.js +14 -1
- package/dist/es2019/plugins/media/toolbar/alt-text.js +1 -0
- package/dist/es2019/plugins/media/toolbar/linking.js +1 -0
- package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +4 -2
- package/dist/es2019/plugins/media/ui/ToolbarMedia/toolbar-media-messages.js +2 -2
- package/dist/es2019/plugins/mentions/messages.js +5 -0
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -2
- package/dist/es2019/plugins/mentions/styles.js +2 -1
- package/dist/es2019/plugins/mentions/ui/Mention/index.js +12 -0
- package/dist/es2019/plugins/panel/actions.js +2 -2
- package/dist/es2019/plugins/panel/index.js +1 -0
- package/dist/es2019/plugins/panel/toolbar.js +3 -3
- package/dist/es2019/plugins/paste/index.js +2 -3
- package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/quick-insert/assets/action.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/code.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/custom-panel.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/date.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/decision.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/divider.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/emoji.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/expand.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/fallback.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/feedback.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/heading1.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/heading2.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/heading3.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/heading4.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/heading5.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/heading6.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/images.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/layout.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/link.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/list-number.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/list.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/mention.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/panel-error.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/panel-note.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/panel-success.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/panel-warning.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/panel.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/quote.js +3 -0
- package/dist/es2019/plugins/quick-insert/assets/status.js +3 -0
- package/dist/es2019/plugins/selection/gap-cursor/actions.js +26 -5
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +42 -4
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/styles.js +6 -1
- package/dist/es2019/plugins/text-color/utils/color.js +3 -0
- package/dist/es2019/plugins/type-ahead/commands/insert-type-ahead-item.js +4 -3
- package/dist/es2019/plugins/type-ahead/index.js +17 -4
- package/dist/es2019/plugins/type-ahead/messages.js +13 -3
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +24 -16
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +108 -61
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +12 -14
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +32 -8
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +42 -7
- package/dist/es2019/plugins/type-ahead/utils.js +3 -1
- package/dist/es2019/ui/Alignment/index.js +1 -2
- package/dist/es2019/ui/Appearance/Chromeless.js +4 -0
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +5 -2
- package/dist/es2019/ui/ColorPickerButton/index.js +4 -0
- package/dist/es2019/ui/ConfigPanel/Fields/CustomSelect.js +2 -4
- package/dist/es2019/ui/ConfigPanel/Fields/Select.js +1 -3
- package/dist/es2019/ui/Dropdown/index.js +16 -1
- package/dist/es2019/ui/DropdownMenu/index.js +13 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +148 -0
- package/dist/es2019/ui/styles.js +1 -7
- package/dist/es2019/utils/clipboard.js +11 -9
- package/dist/es2019/utils/document.js +14 -1
- package/dist/es2019/utils/index.js +0 -7
- package/dist/es2019/utils/input-rules.js +4 -3
- package/dist/es2019/utils/table.js +28 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +2 -4
- package/dist/esm/keymaps/index.js +1 -1
- package/dist/esm/labs/next/presets/cxhtml.js +1 -3
- package/dist/esm/labs/next/presets/mobile.js +1 -3
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +11 -4
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/alignment/pm-plugins/keymap.js +1 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +29 -4
- package/dist/esm/plugins/annotation/nodeviews/index.js +7 -33
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +28 -3
- package/dist/esm/plugins/annotation/utils.js +8 -4
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +1 -0
- package/dist/esm/plugins/caption/nodeviews/index.js +4 -1
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +1 -0
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -1
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +7 -3
- package/dist/esm/plugins/code-block/refresh-browser-selection.js +2 -1
- package/dist/esm/plugins/code-block/styles.js +7 -2
- package/dist/esm/plugins/code-block/ui/class-names.js +2 -0
- package/dist/esm/plugins/collab-edit/utils.js +5 -2
- package/dist/esm/plugins/copy-button/commands.js +5 -3
- package/dist/esm/plugins/emoji/messages.js +8 -0
- package/dist/esm/plugins/emoji/nodeviews/emoji.js +15 -2
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +10 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +17 -13
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -0
- package/dist/esm/plugins/floating-toolbar/index.js +2 -0
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -1
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +20 -1
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +5 -2
- package/dist/esm/plugins/floating-toolbar/ui/Select.js +9 -3
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -0
- package/dist/esm/plugins/help-dialog/ui/index.js +1 -4
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +2 -2
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +23 -9
- package/dist/esm/plugins/media/index.js +2 -2
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +25 -4
- package/dist/esm/plugins/media/pm-plugins/main.js +14 -1
- package/dist/esm/plugins/media/toolbar/alt-text.js +1 -0
- package/dist/esm/plugins/media/toolbar/linking.js +1 -0
- package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
- package/dist/esm/plugins/media/ui/ToolbarMedia/toolbar-media-messages.js +2 -2
- package/dist/esm/plugins/mentions/messages.js +5 -0
- package/dist/esm/plugins/mentions/nodeviews/mention.js +15 -2
- package/dist/esm/plugins/mentions/styles.js +1 -1
- package/dist/esm/plugins/mentions/ui/Mention/index.js +13 -0
- package/dist/esm/plugins/panel/actions.js +2 -2
- package/dist/esm/plugins/panel/index.js +1 -0
- package/dist/esm/plugins/panel/toolbar.js +3 -3
- package/dist/esm/plugins/paste/index.js +2 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/quick-insert/assets/action.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/code.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/custom-panel.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/date.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/decision.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/divider.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/emoji.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/expand.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/fallback.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/feedback.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/heading1.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/heading2.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/heading3.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/heading4.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/heading5.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/heading6.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/images.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/layout.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/link.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/list-number.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/list.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/mention.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/panel-error.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/panel-note.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/panel-success.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/panel-warning.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/panel.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/quote.js +3 -0
- package/dist/esm/plugins/quick-insert/assets/status.js +3 -0
- package/dist/esm/plugins/selection/gap-cursor/actions.js +24 -5
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +44 -4
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/styles.js +6 -1
- package/dist/esm/plugins/text-color/utils/color.js +3 -0
- package/dist/esm/plugins/type-ahead/commands/insert-type-ahead-item.js +4 -3
- package/dist/esm/plugins/type-ahead/index.js +35 -22
- package/dist/esm/plugins/type-ahead/messages.js +13 -3
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +24 -16
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +124 -64
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +12 -14
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +35 -14
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +38 -7
- package/dist/esm/plugins/type-ahead/utils.js +3 -1
- package/dist/esm/ui/Alignment/index.js +1 -2
- package/dist/esm/ui/Appearance/Chromeless.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +5 -2
- package/dist/esm/ui/ColorPickerButton/index.js +4 -0
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +2 -4
- package/dist/esm/ui/ConfigPanel/Fields/Select.js +1 -3
- package/dist/esm/ui/Dropdown/index.js +17 -1
- package/dist/esm/ui/DropdownMenu/index.js +14 -1
- package/dist/esm/ui/ElementBrowser/constants.js +0 -1
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +147 -0
- package/dist/esm/ui/styles.js +12 -16
- package/dist/esm/utils/clipboard.js +17 -12
- package/dist/esm/utils/document.js +14 -1
- package/dist/esm/utils/index.js +0 -7
- package/dist/esm/utils/input-rules.js +4 -3
- package/dist/esm/utils/table.js +28 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/keymaps/index.d.ts +1 -1
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +2 -0
- package/dist/types/plugins/annotation/utils.d.ts +2 -2
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +2 -0
- package/dist/types/plugins/code-block/refresh-browser-selection.d.ts +2 -0
- package/dist/types/plugins/code-block/ui/class-names.d.ts +2 -0
- package/dist/types/plugins/emoji/messages.d.ts +7 -0
- package/dist/types/plugins/extension/index.d.ts +0 -1
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +6 -0
- package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +3 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +1 -0
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +4 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/media/ui/CaptionPlaceholder/index.d.ts +3 -3
- package/dist/types/plugins/mentions/messages.d.ts +5 -0
- package/dist/types/plugins/mentions/ui/Mention/index.d.ts +1 -0
- package/dist/types/plugins/paste/index.d.ts +1 -2
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/selection/gap-cursor/actions.d.ts +2 -0
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +3 -0
- package/dist/types/plugins/type-ahead/messages.d.ts +10 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadPopup.d.ts +7 -1
- package/dist/types/plugins/type-ahead/utils.d.ts +1 -0
- package/dist/types/types/extension-config.d.ts +0 -1
- package/dist/types/ui/ConfigPanel/Fields/SelectItem.d.ts +1 -1
- package/dist/types/ui/Dropdown/index.d.ts +6 -1
- package/dist/types/ui/DropdownMenu/index.d.ts +2 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +3 -1
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +18 -0
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types/utils/clipboard.d.ts +1 -1
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/input-rules.d.ts +2 -2
- package/dist/types/utils/table.d.ts +3 -0
- package/docs/3-annotations.tsx +1 -0
- package/package.json +20 -18
- package/report.api.md +74 -74
|
@@ -75,11 +75,12 @@ export const ExtensionsPlaceholder = props => {
|
|
|
75
75
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
76
|
|
|
77
77
|
}, []);
|
|
78
|
+
const nodeAdf = React.useMemo(() => nodeToJSON(node), [node]);
|
|
78
79
|
const extensionItems = React.useMemo(() => {
|
|
79
|
-
return getContextualToolbarItemsFromModule(extensions,
|
|
80
|
+
return getContextualToolbarItemsFromModule(extensions, nodeAdf, createExtensionAPI({
|
|
80
81
|
editorView
|
|
81
82
|
}));
|
|
82
|
-
}, [extensions,
|
|
83
|
+
}, [extensions, nodeAdf, editorView]);
|
|
83
84
|
|
|
84
85
|
if (!extensionItems.length) {
|
|
85
86
|
return null;
|
|
@@ -10,9 +10,14 @@ export default function Search(props) {
|
|
|
10
10
|
width
|
|
11
11
|
}),
|
|
12
12
|
menuPortal: base => {
|
|
13
|
-
var _selectRef$current;
|
|
13
|
+
var _selectRef$current, _selectRef$current$se, _selectRef$current$se2, _selectRef$current2, _selectRef$current2$s, _selectRef$current2$s2, _selectRef$current2$s3;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
// ED:16095: We add two possible getter paths for safely reaching into the underlying
|
|
16
|
+
// react-select element. We first try a getter that conforms with react-select v5 APIs,
|
|
17
|
+
// Failing that, we try a getter consistent with react-select v4 APIs. (We
|
|
18
|
+
// handle both as consumers may control the time of the actual dependency version
|
|
19
|
+
// cutover).
|
|
20
|
+
const controlWrapper = (selectRef === null || selectRef === void 0 ? void 0 : (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : (_selectRef$current$se = _selectRef$current.select) === null || _selectRef$current$se === void 0 ? void 0 : (_selectRef$current$se2 = _selectRef$current$se.controlRef) === null || _selectRef$current$se2 === void 0 ? void 0 : _selectRef$current$se2.parentNode) || (selectRef === null || selectRef === void 0 ? void 0 : (_selectRef$current2 = selectRef.current) === null || _selectRef$current2 === void 0 ? void 0 : (_selectRef$current2$s = _selectRef$current2.select) === null || _selectRef$current2$s === void 0 ? void 0 : (_selectRef$current2$s2 = _selectRef$current2$s.select) === null || _selectRef$current2$s2 === void 0 ? void 0 : (_selectRef$current2$s3 = _selectRef$current2$s2.controlRef) === null || _selectRef$current2$s3 === void 0 ? void 0 : _selectRef$current2$s3.parentNode);
|
|
16
21
|
const menuPortalStyles = controlWrapper && props.setDisableParentScroll ? {
|
|
17
22
|
// since the portal is now outside, we need to position it as before
|
|
18
23
|
top: controlWrapper.offsetTop,
|
|
@@ -51,6 +56,7 @@ export default function Search(props) {
|
|
|
51
56
|
styles: style,
|
|
52
57
|
menuPortalTarget: props.mountPoint,
|
|
53
58
|
onMenuOpen: onMenuOpen,
|
|
54
|
-
onMenuClose: onMenuClose
|
|
59
|
+
onMenuClose: onMenuClose,
|
|
60
|
+
"aria-label": props.ariaLabel
|
|
55
61
|
});
|
|
56
62
|
}
|
|
@@ -344,6 +344,7 @@ class Toolbar extends Component {
|
|
|
344
344
|
if (event.key === 'Escape') {
|
|
345
345
|
var _this$props$editorVie;
|
|
346
346
|
|
|
347
|
+
this.currentSelectedItemIndex = 0;
|
|
347
348
|
(_this$props$editorVie = this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
|
|
348
349
|
event.preventDefault();
|
|
349
350
|
event.stopPropagation();
|
|
@@ -243,8 +243,7 @@ export const formatting = ({
|
|
|
243
243
|
keymap: () => keymaps.alignLeft
|
|
244
244
|
}, {
|
|
245
245
|
name: formatMessage(alignmentMessages.alignRight),
|
|
246
|
-
type: 'alignment'
|
|
247
|
-
keymap: () => keymaps.alignRight
|
|
246
|
+
type: 'alignment'
|
|
248
247
|
}];
|
|
249
248
|
const shortcutNamesWithoutKeymap = ['emoji', 'mention', 'quickInsert'];
|
|
250
249
|
|
|
@@ -70,8 +70,8 @@ const createInsertBlockItems = config => {
|
|
|
70
70
|
|
|
71
71
|
if (mediaSupported && mediaUploadsEnabled) {
|
|
72
72
|
items.push(media({
|
|
73
|
-
content: formatMessage(messages.
|
|
74
|
-
tooltipDescription: formatMessage(messages.
|
|
73
|
+
content: formatMessage(messages.addMediaFiles),
|
|
74
|
+
tooltipDescription: formatMessage(messages.mediaFilesDescription),
|
|
75
75
|
disabled: false
|
|
76
76
|
}));
|
|
77
77
|
}
|
|
@@ -84,13 +84,19 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
_defineProperty(this, "togglePlusMenuVisibility",
|
|
87
|
+
_defineProperty(this, "togglePlusMenuVisibility", event => {
|
|
88
88
|
const {
|
|
89
89
|
isPlusMenuOpen
|
|
90
90
|
} = this.state;
|
|
91
91
|
this.onOpenChange({
|
|
92
92
|
isPlusMenuOpen: !isPlusMenuOpen
|
|
93
93
|
});
|
|
94
|
+
|
|
95
|
+
if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
|
|
96
|
+
var _ref;
|
|
97
|
+
|
|
98
|
+
(_ref = this.plusButtonRef || this.dropdownButtonRef) === null || _ref === void 0 ? void 0 : _ref.focus();
|
|
99
|
+
}
|
|
94
100
|
});
|
|
95
101
|
|
|
96
102
|
_defineProperty(this, "toggleEmojiPicker", (inputMethod = INPUT_METHOD.TOOLBAR) => {
|
|
@@ -118,7 +124,10 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
118
124
|
});
|
|
119
125
|
|
|
120
126
|
_defineProperty(this, "handleEmojiPressEscape", () => {
|
|
127
|
+
var _this$emojiButtonRef;
|
|
128
|
+
|
|
121
129
|
this.toggleEmojiPicker(INPUT_METHOD.KEYBOARD);
|
|
130
|
+
(_this$emojiButtonRef = this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 ? void 0 : _this$emojiButtonRef.focus();
|
|
122
131
|
});
|
|
123
132
|
|
|
124
133
|
_defineProperty(this, "handleEmojiClickOutside", e => {
|
|
@@ -155,6 +164,10 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
155
164
|
}
|
|
156
165
|
});
|
|
157
166
|
|
|
167
|
+
_defineProperty(this, "handleClick", () => {
|
|
168
|
+
this.togglePlusMenuVisibility();
|
|
169
|
+
});
|
|
170
|
+
|
|
158
171
|
_defineProperty(this, "toggleLinkPanel", inputMethod => {
|
|
159
172
|
const {
|
|
160
173
|
editorView
|
|
@@ -559,7 +572,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
559
572
|
items: this.state.dropdownItems,
|
|
560
573
|
onRef: this.handleDropDownButtonRef,
|
|
561
574
|
onPlusButtonRef: this.handlePlusButtonRef,
|
|
562
|
-
onClick: this.
|
|
575
|
+
onClick: this.handleClick,
|
|
563
576
|
onItemActivated: this.insertInsertMenuItem,
|
|
564
577
|
onInsert: this.insertInsertMenuItem,
|
|
565
578
|
onOpenChange: this.onOpenChange,
|
|
@@ -175,8 +175,8 @@ const mediaPlugin = options => ({
|
|
|
175
175
|
formatMessage
|
|
176
176
|
}) => [{
|
|
177
177
|
id: 'media',
|
|
178
|
-
title: formatMessage(messages.
|
|
179
|
-
description: formatMessage(messages.
|
|
178
|
+
title: formatMessage(messages.mediaFiles),
|
|
179
|
+
description: formatMessage(messages.mediaFilesDescription),
|
|
180
180
|
priority: 400,
|
|
181
181
|
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
|
|
182
182
|
icon: () => /*#__PURE__*/React.createElement(IconImages, null),
|
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
|
-
import { Component } from 'react';
|
|
6
|
+
import React, { Component } from 'react';
|
|
7
7
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
8
8
|
import { MediaSingle, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
@@ -13,7 +13,7 @@ import { pluginKey as widthPluginKey } from '../../width';
|
|
|
13
13
|
import { setNodeSelection, setTextSelection } from '../../../utils';
|
|
14
14
|
import ResizableMediaSingle from '../ui/ResizableMediaSingle';
|
|
15
15
|
import { createDisplayGrid } from '../../../plugins/grid';
|
|
16
|
-
import { stateKey as mediaPluginKey } from '../pm-plugins/main';
|
|
16
|
+
import { stateKey as mediaPluginKey, MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
|
|
17
17
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
18
18
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
19
19
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
@@ -37,6 +37,10 @@ export default class MediaSingleNode extends Component {
|
|
|
37
37
|
isCopying: false
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
_defineProperty(this, "mediaSingleWrapperRef", /*#__PURE__*/React.createRef());
|
|
41
|
+
|
|
42
|
+
_defineProperty(this, "captionPlaceHolderRef", /*#__PURE__*/React.createRef());
|
|
43
|
+
|
|
40
44
|
_defineProperty(this, "createMediaNodeUpdater", props => {
|
|
41
45
|
const node = this.props.node.firstChild;
|
|
42
46
|
return new MediaNodeUpdater({ ...props,
|
|
@@ -161,6 +165,20 @@ export default class MediaSingleNode extends Component {
|
|
|
161
165
|
return dispatch(tr);
|
|
162
166
|
});
|
|
163
167
|
|
|
168
|
+
_defineProperty(this, "onMediaSingleClicked", event => {
|
|
169
|
+
var _this$captionPlaceHol;
|
|
170
|
+
|
|
171
|
+
if (!browser.ios) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (this.mediaSingleWrapperRef.current !== event.target) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
(_this$captionPlaceHol = this.captionPlaceHolderRef.current) === null || _this$captionPlaceHol === void 0 ? void 0 : _this$captionPlaceHol.click();
|
|
180
|
+
});
|
|
181
|
+
|
|
164
182
|
_defineProperty(this, "clickPlaceholder", () => {
|
|
165
183
|
const {
|
|
166
184
|
view,
|
|
@@ -304,11 +322,14 @@ export default class MediaSingleNode extends Component {
|
|
|
304
322
|
const isSelected = selected();
|
|
305
323
|
const shouldShowPlaceholder = getMediaFeatureFlag('captions', mediaOptions.featureFlags) && node.childCount !== 2 && isSelected && state.selection instanceof NodeSelection;
|
|
306
324
|
const MediaChildren = jsx("figure", {
|
|
325
|
+
ref: this.mediaSingleWrapperRef,
|
|
307
326
|
css: figureWrapper,
|
|
308
|
-
className: MediaSingleNodeSelector
|
|
327
|
+
className: MediaSingleNodeSelector,
|
|
328
|
+
onClick: this.onMediaSingleClicked
|
|
309
329
|
}, jsx("div", {
|
|
310
330
|
ref: this.props.forwardRef
|
|
311
331
|
}), shouldShowPlaceholder && jsx(CaptionPlaceholder, {
|
|
332
|
+
ref: this.captionPlaceHolderRef,
|
|
312
333
|
onClick: this.clickPlaceholder
|
|
313
334
|
}));
|
|
314
335
|
return canResize ? jsx(ResizableMediaSingle, _extends({}, mediaSingleProps, {
|
|
@@ -373,7 +394,7 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
373
394
|
|
|
374
395
|
getContentDOM() {
|
|
375
396
|
const dom = document.createElement('div');
|
|
376
|
-
dom.classList.add(
|
|
397
|
+
dom.classList.add(MEDIA_CONTENT_WRAP_CLASS_NAME);
|
|
377
398
|
return {
|
|
378
399
|
dom
|
|
379
400
|
};
|
|
@@ -25,6 +25,7 @@ import { CAPTION_PLACEHOLDER_ID } from '../ui/CaptionPlaceholder';
|
|
|
25
25
|
import { RawIntlProvider } from 'react-intl-next';
|
|
26
26
|
import { MediaTaskManager } from './mediaTaskManager';
|
|
27
27
|
export { stateKey } from './plugin-key';
|
|
28
|
+
export const MEDIA_CONTENT_WRAP_CLASS_NAME = 'media-content-wrap';
|
|
28
29
|
|
|
29
30
|
const createDropPlaceholder = (intl, allowDropLine) => {
|
|
30
31
|
const dropPlaceholder = document.createElement('div');
|
|
@@ -717,7 +718,19 @@ export const createPlugin = (_schema, options, reactContext, getIntl, dispatch,
|
|
|
717
718
|
// Returning true prevents that updateSelection() is getting called in the commit below:
|
|
718
719
|
// @see https://github.com/ProseMirror/prosemirror-view/compare/1.18.5...1.18.6
|
|
719
720
|
|
|
720
|
-
|
|
721
|
+
if ((browser.chrome || browser.safari) && clickedInsideCaptionPlaceholder) {
|
|
722
|
+
return true;
|
|
723
|
+
} // Workaound for iOS 16 Caption selection issue
|
|
724
|
+
// @see https://product-fabric.atlassian.net/browse/MEX-2012
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
if (browser.ios) {
|
|
728
|
+
var _event$target2;
|
|
729
|
+
|
|
730
|
+
return !!((_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.closest(`[class="${MEDIA_CONTENT_WRAP_CLASS_NAME}"]`));
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
return false;
|
|
721
734
|
}
|
|
722
735
|
}
|
|
723
736
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
5
|
import { N200 } from '@atlaskit/theme/colors';
|
|
@@ -12,10 +13,11 @@ const placeholder = css`
|
|
|
12
13
|
display: block;
|
|
13
14
|
`;
|
|
14
15
|
export const CAPTION_PLACEHOLDER_ID = 'caption-placeholder';
|
|
15
|
-
export default (({
|
|
16
|
+
export default /*#__PURE__*/React.forwardRef(({
|
|
16
17
|
onClick
|
|
17
|
-
}) => {
|
|
18
|
+
}, ref) => {
|
|
18
19
|
return jsx("span", {
|
|
20
|
+
ref: ref,
|
|
19
21
|
css: placeholder,
|
|
20
22
|
onClick: onClick,
|
|
21
23
|
"data-id": CAPTION_PLACEHOLDER_ID,
|
|
@@ -2,7 +2,7 @@ import { defineMessages } from 'react-intl-next';
|
|
|
2
2
|
export const toolbarMediaMessages = defineMessages({
|
|
3
3
|
toolbarMediaTitle: {
|
|
4
4
|
id: 'fabric.editor.toolbarMediaTitle',
|
|
5
|
-
defaultMessage: '
|
|
6
|
-
description: 'a label for an icon that describes files and images'
|
|
5
|
+
defaultMessage: 'Add image, video, or file',
|
|
6
|
+
description: 'a label for an icon that describes files, videos and images'
|
|
7
7
|
}
|
|
8
8
|
});
|
|
@@ -14,5 +14,10 @@ export const messages = defineMessages({
|
|
|
14
14
|
id: 'fabric.editor.mentionsIconLabel',
|
|
15
15
|
defaultMessage: 'Mention',
|
|
16
16
|
description: 'icon label to describe the mention icon'
|
|
17
|
+
},
|
|
18
|
+
mentionsNodeLabel: {
|
|
19
|
+
id: 'fabric.editor.mentionNode.label',
|
|
20
|
+
defaultMessage: 'Tagged user',
|
|
21
|
+
description: 'Label to indicate mention node to Screen reader users, that preceeds with user name ex: "Tagged user @XXX'
|
|
17
22
|
}
|
|
18
23
|
});
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Mention from '../ui/Mention';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
4
|
+
import { messages } from '../messages';
|
|
5
|
+
const MentionAssistiveTextComponent = /*#__PURE__*/React.memo(({
|
|
6
|
+
mentionedName
|
|
7
|
+
}) => {
|
|
8
|
+
const intl = useIntl();
|
|
9
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10
|
+
className: 'assistive'
|
|
11
|
+
}, `${intl.formatMessage(messages.mentionsNodeLabel)} ${mentionedName}`);
|
|
12
|
+
});
|
|
3
13
|
export const MentionNodeView = props => {
|
|
4
14
|
const {
|
|
5
15
|
providerFactory
|
|
@@ -9,10 +19,14 @@ export const MentionNodeView = props => {
|
|
|
9
19
|
text,
|
|
10
20
|
accessLevel
|
|
11
21
|
} = props.node.attrs;
|
|
12
|
-
return /*#__PURE__*/React.createElement(
|
|
22
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MentionAssistiveTextComponent, {
|
|
23
|
+
mentionedName: text
|
|
24
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Mention, {
|
|
13
27
|
id: id,
|
|
14
28
|
text: text,
|
|
15
29
|
accessLevel: accessLevel,
|
|
16
30
|
providers: providerFactory
|
|
17
|
-
});
|
|
31
|
+
})));
|
|
18
32
|
};
|
|
@@ -16,12 +16,13 @@ export const mentionsStyles = css`
|
|
|
16
16
|
|
|
17
17
|
.danger {
|
|
18
18
|
.${MentionSharedCssClassName.MENTION_CONTAINER}.${akEditorSelectedNodeClassName}
|
|
19
|
+
> span
|
|
19
20
|
> span
|
|
20
21
|
> span {
|
|
21
22
|
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
|
|
22
23
|
background-color: ${token('color.background.danger', akEditorDeleteBackgroundWithOpacity)};
|
|
23
24
|
}
|
|
24
|
-
.${MentionSharedCssClassName.MENTION_CONTAINER} > span > span {
|
|
25
|
+
.${MentionSharedCssClassName.MENTION_CONTAINER} > span > span > span {
|
|
25
26
|
background-color: ${token('color.background.neutral', N30A)};
|
|
26
27
|
color: ${token('color.text.subtle', N500)};
|
|
27
28
|
}
|
|
@@ -4,6 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import { PureComponent } from 'react';
|
|
5
5
|
import { ResourcedMention } from '@atlaskit/mention/element';
|
|
6
6
|
import { ProviderFactory, WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
7
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
8
|
+
import { refreshBrowserSelection } from '../../../code-block/refresh-browser-selection';
|
|
7
9
|
export default class Mention extends PureComponent {
|
|
8
10
|
constructor(props) {
|
|
9
11
|
super(props);
|
|
@@ -33,6 +35,16 @@ export default class Mention extends PureComponent {
|
|
|
33
35
|
this.providerFactory = props.providers || new ProviderFactory();
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
componentDidMount() {
|
|
39
|
+
// Workaround an issue where the selection is not updated immediately after adding
|
|
40
|
+
// a mention when "sanitizePrivateContent" is enabled in the editor on safari.
|
|
41
|
+
// This affects both insertion and paste behaviour it is applied to the component.
|
|
42
|
+
// https://product-fabric.atlassian.net/browse/ED-14859
|
|
43
|
+
if (browser.safari) {
|
|
44
|
+
setTimeout(refreshBrowserSelection, 0);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
36
48
|
componentWillUnmount() {
|
|
37
49
|
if (!this.props.providers) {
|
|
38
50
|
// new ProviderFactory is created if no `providers` has been set
|
|
@@ -2,7 +2,7 @@ import { removeParentNodeOfType, findSelectedNodeOfType, removeSelectedNode, fin
|
|
|
2
2
|
import { NodeSelection } from 'prosemirror-state';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, addAnalytics } from '../analytics';
|
|
4
4
|
import { findPanel } from './utils';
|
|
5
|
-
import {
|
|
5
|
+
import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
6
6
|
export const removePanel = () => (state, dispatch) => {
|
|
7
7
|
const {
|
|
8
8
|
schema: {
|
|
@@ -54,7 +54,7 @@ export const changePanelType = (panelType, panelOptions = {}, allowCustomPanel =
|
|
|
54
54
|
let newTr;
|
|
55
55
|
|
|
56
56
|
if (allowCustomPanel) {
|
|
57
|
-
let previousColor = panelNode.node.attrs.panelColor ||
|
|
57
|
+
let previousColor = panelNode.node.attrs.panelType === 'custom' ? panelNode.node.attrs.panelColor || 'none' : getPanelTypeBackgroundNoTokens(previousType);
|
|
58
58
|
let previousIcon = panelNode.node.attrs.panelIcon;
|
|
59
59
|
let previousIconId = panelNode.node.attrs.panelIconId;
|
|
60
60
|
let previousIconText = panelNode.node.attrs.panelIconText;
|
|
@@ -141,6 +141,7 @@ const panelPlugin = (options = {}) => ({
|
|
|
141
141
|
panelIcon: ':rainbow:',
|
|
142
142
|
panelIconId: '1f308',
|
|
143
143
|
panelIconText: '🌈',
|
|
144
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
144
145
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
145
146
|
panelColor: T50
|
|
146
147
|
}, state, insert);
|
|
@@ -9,7 +9,7 @@ import commonMessages from '../../messages';
|
|
|
9
9
|
import { removePanel, changePanelType } from './actions';
|
|
10
10
|
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
11
11
|
import { panelBackgroundPalette } from '../../ui/ColorPalette/Palettes/panelBackgroundPalette';
|
|
12
|
-
import {
|
|
12
|
+
import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
13
13
|
import { findPanel } from './utils';
|
|
14
14
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
15
15
|
import { DEFAULT_BORDER_COLOR } from '../../ui/ColorPalette/Palettes';
|
|
@@ -94,7 +94,7 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
94
94
|
return false;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
let previousColor = panelNode.node.attrs.panelColor ||
|
|
97
|
+
let previousColor = panelNode.node.attrs.panelType === 'custom' ? panelNode.node.attrs.panelColor || 'none' : getPanelTypeBackgroundNoTokens(panelNode.node.attrs.panelType);
|
|
98
98
|
const emojiInfo = panelNode.node.attrs.panelType;
|
|
99
99
|
const panelEmoji = panelIconMap[emojiInfo];
|
|
100
100
|
const previousEmoji = panelEmoji ? {
|
|
@@ -191,7 +191,7 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
191
191
|
return false;
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
-
const panelColor = activePanelType === PanelType.CUSTOM ? activePanelColor ||
|
|
194
|
+
const panelColor = activePanelType === PanelType.CUSTOM ? activePanelColor || getPanelTypeBackgroundNoTokens(PanelType.INFO) : getPanelTypeBackgroundNoTokens(activePanelType);
|
|
195
195
|
const defaultPalette = panelBackgroundPalette.find(item => item.value === panelColor) || {
|
|
196
196
|
label: 'Custom',
|
|
197
197
|
value: panelColor,
|
|
@@ -2,8 +2,7 @@ import { createPlugin } from './pm-plugins/main';
|
|
|
2
2
|
|
|
3
3
|
const pastePlugin = ({
|
|
4
4
|
cardOptions,
|
|
5
|
-
sanitizePrivateContent
|
|
6
|
-
plainTextPasteLinkification
|
|
5
|
+
sanitizePrivateContent
|
|
7
6
|
}) => ({
|
|
8
7
|
name: 'paste',
|
|
9
8
|
|
|
@@ -15,7 +14,7 @@ const pastePlugin = ({
|
|
|
15
14
|
providerFactory,
|
|
16
15
|
dispatchAnalyticsEvent,
|
|
17
16
|
dispatch
|
|
18
|
-
}) => createPlugin(schema, dispatchAnalyticsEvent, dispatch,
|
|
17
|
+
}) => createPlugin(schema, dispatchAnalyticsEvent, dispatch, cardOptions, sanitizePrivateContent, providerFactory)
|
|
19
18
|
}];
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -30,7 +30,7 @@ import { extractSliceFromStep } from '../../../utils/step';
|
|
|
30
30
|
import { pluginKey as stateKey, createPluginState } from './plugin-factory';
|
|
31
31
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
32
32
|
export { md } from '../md';
|
|
33
|
-
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch,
|
|
33
|
+
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
34
34
|
const atlassianMarkDownParser = new MarkdownTransformer(schema, md);
|
|
35
35
|
|
|
36
36
|
function getMarkdownSlice(text, openStart, openEnd) {
|
|
@@ -200,7 +200,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, plainText
|
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
slice = handleParagraphBlockMarks(state, slice);
|
|
203
|
-
const plainTextPasteSlice =
|
|
203
|
+
const plainTextPasteSlice = linkifyContent(state.schema)(slice);
|
|
204
204
|
|
|
205
205
|
if (handlePasteAsPlainTextWithAnalytics(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
206
206
|
return true;
|