@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
|
@@ -92,11 +92,21 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
92
92
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
93
93
|
isOpen: false
|
|
94
94
|
});
|
|
95
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toolbarItemRef", /*#__PURE__*/_react.default.createRef());
|
|
95
96
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeColor", function (color) {
|
|
96
97
|
return commands.changeColor(color)(_this.props.editorView.state, _this.props.editorView.dispatch);
|
|
97
98
|
});
|
|
99
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function (attrs) {
|
|
100
|
+
_this.handleOpenChange({
|
|
101
|
+
isOpen: attrs.isOpen,
|
|
102
|
+
logCloseEvent: true,
|
|
103
|
+
event: attrs.event
|
|
104
|
+
});
|
|
105
|
+
});
|
|
98
106
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTextColor", function (color, disabled) {
|
|
99
107
|
if (!disabled) {
|
|
108
|
+
var _this$props$editorVie;
|
|
109
|
+
|
|
100
110
|
var _this$props$pluginSta = _this.props.pluginState,
|
|
101
111
|
palette = _this$props$pluginSta.palette,
|
|
102
112
|
paletteExpanded = _this$props$pluginSta.paletteExpanded,
|
|
@@ -119,7 +129,10 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
119
129
|
logCloseEvent: false
|
|
120
130
|
});
|
|
121
131
|
|
|
122
|
-
|
|
132
|
+
_this.changeColor(color); //To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
|
|
123
136
|
}
|
|
124
137
|
|
|
125
138
|
return false;
|
|
@@ -132,7 +145,8 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
132
145
|
});
|
|
133
146
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOpenChange", function (_ref) {
|
|
134
147
|
var isOpen = _ref.isOpen,
|
|
135
|
-
logCloseEvent = _ref.logCloseEvent
|
|
148
|
+
logCloseEvent = _ref.logCloseEvent,
|
|
149
|
+
event = _ref.event;
|
|
136
150
|
|
|
137
151
|
_this.setState({
|
|
138
152
|
isOpen: isOpen
|
|
@@ -143,6 +157,12 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
143
157
|
noSelect: isOpen === false
|
|
144
158
|
}));
|
|
145
159
|
}
|
|
160
|
+
|
|
161
|
+
if (!isOpen && event instanceof KeyboardEvent && (event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
|
|
162
|
+
var _this$toolbarItemRef, _this$toolbarItemRef$;
|
|
163
|
+
|
|
164
|
+
(_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 ? void 0 : (_this$toolbarItemRef$ = _this$toolbarItemRef.current) === null || _this$toolbarItemRef$ === void 0 ? void 0 : _this$toolbarItemRef$.focus();
|
|
165
|
+
}
|
|
146
166
|
});
|
|
147
167
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hide", function (e) {
|
|
148
168
|
var isOpen = _this.state.isOpen;
|
|
@@ -155,8 +175,21 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
155
175
|
_this.setState({
|
|
156
176
|
isOpen: false
|
|
157
177
|
});
|
|
178
|
+
|
|
179
|
+
if (e instanceof KeyboardEvent && e.key === 'Escape') {
|
|
180
|
+
var _this$toolbarItemRef2, _this$toolbarItemRef3;
|
|
181
|
+
|
|
182
|
+
(_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 ? void 0 : (_this$toolbarItemRef3 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef3 === void 0 ? void 0 : _this$toolbarItemRef3.focus();
|
|
183
|
+
}
|
|
158
184
|
}
|
|
159
185
|
});
|
|
186
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideonEsc", function (e) {
|
|
187
|
+
var _this$toolbarItemRef4, _this$toolbarItemRef5;
|
|
188
|
+
|
|
189
|
+
_this.hide(e);
|
|
190
|
+
|
|
191
|
+
(_this$toolbarItemRef4 = _this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 ? void 0 : (_this$toolbarItemRef5 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef5 === void 0 ? void 0 : _this$toolbarItemRef5.focus();
|
|
192
|
+
});
|
|
160
193
|
return _this;
|
|
161
194
|
}
|
|
162
195
|
|
|
@@ -196,9 +229,11 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
196
229
|
scrollableElement: popupsScrollableElement,
|
|
197
230
|
isOpen: isOpen && !pluginState.disabled,
|
|
198
231
|
handleClickOutside: this.hide,
|
|
199
|
-
handleEscapeKeydown: this.
|
|
232
|
+
handleEscapeKeydown: this.hideonEsc,
|
|
200
233
|
zIndex: _editorSharedStyles.akEditorMenuZIndex,
|
|
201
234
|
fitWidth: fitWidth,
|
|
235
|
+
onOpenChange: this.onOpenChange,
|
|
236
|
+
closeonTab: true,
|
|
202
237
|
trigger: (0, _react2.jsx)(_ToolbarButton.default, {
|
|
203
238
|
buttonId: _ToolbarButton.TOOLBAR_BUTTON.TEXT_COLOR,
|
|
204
239
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -209,6 +244,7 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
209
244
|
"aria-haspopup": true,
|
|
210
245
|
title: labelTextColor,
|
|
211
246
|
onClick: this.toggleOpen,
|
|
247
|
+
ref: this.toolbarItemRef,
|
|
212
248
|
iconBefore: (0, _react2.jsx)("div", {
|
|
213
249
|
css: _styles.triggerWrapperStyles
|
|
214
250
|
}, (0, _react2.jsx)("div", {
|
|
@@ -228,7 +264,8 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
228
264
|
onClick: function onClick(color) {
|
|
229
265
|
return _this2.changeTextColor(color, pluginState.disabled);
|
|
230
266
|
},
|
|
231
|
-
selectedColor: pluginState.color
|
|
267
|
+
selectedColor: pluginState.color,
|
|
268
|
+
textPalette: true
|
|
232
269
|
}))), (0, _react2.jsx)("span", {
|
|
233
270
|
css: _styles.separatorStyles
|
|
234
271
|
}));
|
|
@@ -38,10 +38,15 @@ var createSteppedRainbow = function createSteppedRainbow(colors) {
|
|
|
38
38
|
|
|
39
39
|
return "\n ".concat(color, " ").concat((pos - 1) * inc, "%,\n ").concat(color, " ").concat(pos * inc, "%,\n ");
|
|
40
40
|
}).join('\n'), "\n );\n ");
|
|
41
|
-
};
|
|
41
|
+
}; // TODO: https://product-fabric.atlassian.net/browse/DSP-4137
|
|
42
|
+
|
|
43
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
44
|
+
|
|
42
45
|
|
|
43
46
|
var rainbow = createSteppedRainbow([colors.P300, colors.T300, colors.Y400, colors.R400]);
|
|
44
47
|
var disabledRainbow = createSteppedRainbow([colors.N80, colors.N60, colors.N40, colors.N60]);
|
|
48
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
49
|
+
|
|
45
50
|
var textColorIconWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
46
51
|
exports.textColorIconWrapper = textColorIconWrapper;
|
|
47
52
|
var textColorIconBar = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n left: 0;\n right: 0;\n top: 16px;\n margin: auto;\n width: 12px;\n height: 3px;\n border-radius: ", ";\n background: ", ";\n"])), (0, _constants.borderRadius)() + 'px', rainbow);
|
|
@@ -8,6 +8,9 @@ exports.getActiveColor = exports.DEFAULT_COLOR = void 0;
|
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
|
|
10
10
|
var DEFAULT_COLOR = {
|
|
11
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4137
|
|
12
|
+
|
|
13
|
+
/* eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage */
|
|
11
14
|
color: _colors.N800.toLowerCase(),
|
|
12
15
|
label: 'Dark gray'
|
|
13
16
|
};
|
|
@@ -58,7 +58,6 @@ var createInsertCallback = function createInsertCallback(_ref2) {
|
|
|
58
58
|
var state = _ref2.editorState,
|
|
59
59
|
handler = _ref2.handler,
|
|
60
60
|
query = _ref2.query,
|
|
61
|
-
mode = _ref2.mode,
|
|
62
61
|
wasInsertedBySpace = _ref2.wasInsertedBySpace,
|
|
63
62
|
selectedIndex = _ref2.selectedIndex,
|
|
64
63
|
textStartPosition = _ref2.textStartPosition,
|
|
@@ -166,9 +165,11 @@ var insertTypeAheadItem = function insertTypeAheadItem(view) {
|
|
|
166
165
|
|
|
167
166
|
if (mode === _typeAhead.SelectItemMode.SPACE) {
|
|
168
167
|
text = text.trim().concat(' ');
|
|
169
|
-
}
|
|
168
|
+
} // We want to always persist selectedIndex as -1 upon selecting an item from typeahead
|
|
169
|
+
// in order to retain exist focus behaviour when undoing
|
|
170
|
+
|
|
170
171
|
|
|
171
|
-
var selectedIndex =
|
|
172
|
+
var selectedIndex = -1;
|
|
172
173
|
var wasInsertedBySpace = mode === _typeAhead.SelectItemMode.SPACE;
|
|
173
174
|
var textStartPosition = tr.selection.from;
|
|
174
175
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -15,7 +17,7 @@ Object.defineProperty(exports, "typeAheadPluginKey", {
|
|
|
15
17
|
|
|
16
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
19
|
|
|
18
|
-
var _react =
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
21
|
|
|
20
22
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
21
23
|
|
|
@@ -43,6 +45,10 @@ var _statsModifier = require("./stats-modifier");
|
|
|
43
45
|
|
|
44
46
|
var _analytics = require("../analytics");
|
|
45
47
|
|
|
48
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
49
|
+
|
|
50
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
51
|
+
|
|
46
52
|
/**
|
|
47
53
|
*
|
|
48
54
|
* Revamped typeahead using decorations instead of the `typeAheadQuery` mark
|
|
@@ -69,6 +75,7 @@ var TypeAheadMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
69
75
|
var _useItemInsert = (0, _useItemInsert3.useItemInsert)(triggerHandler, editorView, items),
|
|
70
76
|
_useItemInsert2 = (0, _slicedToArray2.default)(_useItemInsert, 3),
|
|
71
77
|
onItemInsert = _useItemInsert2[0],
|
|
78
|
+
onTextInsert = _useItemInsert2[1],
|
|
72
79
|
onItemMatch = _useItemInsert2[2];
|
|
73
80
|
|
|
74
81
|
var setSelectedItem = _react.default.useCallback(function (_ref2) {
|
|
@@ -90,6 +97,18 @@ var TypeAheadMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
90
97
|
});
|
|
91
98
|
}, [onItemInsert, query]);
|
|
92
99
|
|
|
100
|
+
var cancel = (0, _react.useCallback)(function (_ref3) {
|
|
101
|
+
var setSelectionAt = _ref3.setSelectionAt,
|
|
102
|
+
addPrefixTrigger = _ref3.addPrefixTrigger,
|
|
103
|
+
forceFocusOnEditor = _ref3.forceFocusOnEditor;
|
|
104
|
+
var fullQuery = addPrefixTrigger ? "".concat(triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.trigger).concat(query) : query;
|
|
105
|
+
onTextInsert({
|
|
106
|
+
forceFocusOnEditor: forceFocusOnEditor,
|
|
107
|
+
setSelectionAt: setSelectionAt,
|
|
108
|
+
text: fullQuery
|
|
109
|
+
});
|
|
110
|
+
}, [triggerHandler, onTextInsert, query]);
|
|
111
|
+
|
|
93
112
|
_react.default.useEffect(function () {
|
|
94
113
|
if (!isOpen || !query) {
|
|
95
114
|
return;
|
|
@@ -128,7 +147,8 @@ var TypeAheadMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
128
147
|
setSelectedItem: setSelectedItem,
|
|
129
148
|
onItemInsert: insertItem,
|
|
130
149
|
decorationSet: decorationSet,
|
|
131
|
-
isEmptyQuery: !query
|
|
150
|
+
isEmptyQuery: !query,
|
|
151
|
+
cancel: cancel
|
|
132
152
|
});
|
|
133
153
|
});
|
|
134
154
|
/**
|
|
@@ -150,7 +170,7 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
150
170
|
name: 'typeAhead',
|
|
151
171
|
marks: function marks() {
|
|
152
172
|
// We need to keep this to make sure
|
|
153
|
-
// All documents with typeahead marks will be loaded
|
|
173
|
+
// All documents with typeahead marks will be loaded normally
|
|
154
174
|
return [{
|
|
155
175
|
name: 'typeAheadQuery',
|
|
156
176
|
mark: _adfSchema.typeAheadQuery
|
|
@@ -160,9 +180,9 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
160
180
|
var typeAhead = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
161
181
|
return [{
|
|
162
182
|
name: 'typeAhead',
|
|
163
|
-
plugin: function plugin(
|
|
164
|
-
var dispatch =
|
|
165
|
-
getIntl =
|
|
183
|
+
plugin: function plugin(_ref4) {
|
|
184
|
+
var dispatch = _ref4.dispatch,
|
|
185
|
+
getIntl = _ref4.getIntl;
|
|
166
186
|
return (0, _main.createPlugin)({
|
|
167
187
|
getIntl: getIntl,
|
|
168
188
|
popupMountRef: popupMountRef,
|
|
@@ -176,20 +196,20 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
176
196
|
plugin: _insertItemPlugin.createPlugin
|
|
177
197
|
}, {
|
|
178
198
|
name: 'typeAheadInputRule',
|
|
179
|
-
plugin: function plugin(
|
|
180
|
-
var schema =
|
|
181
|
-
featureFlags =
|
|
199
|
+
plugin: function plugin(_ref5) {
|
|
200
|
+
var schema = _ref5.schema,
|
|
201
|
+
featureFlags = _ref5.featureFlags;
|
|
182
202
|
return (0, _inputRules.inputRulePlugin)(schema, typeAhead, featureFlags);
|
|
183
203
|
}
|
|
184
204
|
}];
|
|
185
205
|
},
|
|
186
|
-
contentComponent: function contentComponent(
|
|
187
|
-
var editorView =
|
|
188
|
-
containerElement =
|
|
189
|
-
popupsMountPoint =
|
|
190
|
-
popupsBoundariesElement =
|
|
191
|
-
popupsScrollableElement =
|
|
192
|
-
wrapperElement =
|
|
206
|
+
contentComponent: function contentComponent(_ref6) {
|
|
207
|
+
var editorView = _ref6.editorView,
|
|
208
|
+
containerElement = _ref6.containerElement,
|
|
209
|
+
popupsMountPoint = _ref6.popupsMountPoint,
|
|
210
|
+
popupsBoundariesElement = _ref6.popupsBoundariesElement,
|
|
211
|
+
popupsScrollableElement = _ref6.popupsScrollableElement,
|
|
212
|
+
wrapperElement = _ref6.wrapperElement;
|
|
193
213
|
popupMountRef.current = {
|
|
194
214
|
popupsMountPoint: popupsMountPoint || wrapperElement || undefined,
|
|
195
215
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -199,8 +219,8 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
199
219
|
plugins: {
|
|
200
220
|
typeAheadState: _key.pluginKey
|
|
201
221
|
},
|
|
202
|
-
render: function render(
|
|
203
|
-
var typeAheadState =
|
|
222
|
+
render: function render(_ref7) {
|
|
223
|
+
var typeAheadState = _ref7.typeAheadState;
|
|
204
224
|
|
|
205
225
|
if (!typeAheadState) {
|
|
206
226
|
return null;
|
|
@@ -215,10 +235,10 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
215
235
|
}
|
|
216
236
|
});
|
|
217
237
|
},
|
|
218
|
-
onEditorViewStateUpdated: function onEditorViewStateUpdated(
|
|
219
|
-
var originalTransaction =
|
|
220
|
-
oldEditorState =
|
|
221
|
-
newEditorState =
|
|
238
|
+
onEditorViewStateUpdated: function onEditorViewStateUpdated(_ref8) {
|
|
239
|
+
var originalTransaction = _ref8.originalTransaction,
|
|
240
|
+
oldEditorState = _ref8.oldEditorState,
|
|
241
|
+
newEditorState = _ref8.newEditorState;
|
|
222
242
|
var oldPluginState = (0, _utils.getPluginState)(oldEditorState);
|
|
223
243
|
var newPluginState = (0, _utils.getPluginState)(newEditorState);
|
|
224
244
|
|
|
@@ -16,17 +16,27 @@ var typeAheadListMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
16
16
|
inputQueryAssistiveLabel: {
|
|
17
17
|
id: 'fabric.editor.inputQueryAssistiveTxt',
|
|
18
18
|
defaultMessage: 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.',
|
|
19
|
-
description: '
|
|
19
|
+
description: 'Assistive text to the user when using typeahead shortcut'
|
|
20
20
|
},
|
|
21
21
|
searchResultsLabel: {
|
|
22
22
|
id: 'fabric.editor.searchResults',
|
|
23
23
|
defaultMessage: '{itemsLength, plural, one {# search result} other {# search results}} available',
|
|
24
|
-
description: '
|
|
24
|
+
description: 'Assistive text to the user when using typeahead shortcut and it preceeds with a number - Ex: 10 search results available'
|
|
25
25
|
},
|
|
26
26
|
noSearchResultsLabel: {
|
|
27
27
|
id: 'fabric.editor.noSearchResults',
|
|
28
28
|
defaultMessage: 'No search results',
|
|
29
|
-
description: '
|
|
29
|
+
description: 'Assistive text to the user when using typeahead shortcut'
|
|
30
|
+
},
|
|
31
|
+
descriptionLabel: {
|
|
32
|
+
id: 'fabric.editor.description',
|
|
33
|
+
defaultMessage: 'Description',
|
|
34
|
+
description: 'Description'
|
|
35
|
+
},
|
|
36
|
+
shortcutLabel: {
|
|
37
|
+
id: 'fabric.editor.shortcut',
|
|
38
|
+
defaultMessage: 'Text shortcut',
|
|
39
|
+
description: 'Text shortcut'
|
|
30
40
|
}
|
|
31
41
|
});
|
|
32
42
|
exports.typeAheadListMessages = typeAheadListMessages;
|
|
@@ -7,6 +7,8 @@ exports.openTypeAheadAtCursor = exports.openTypeAhead = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
9
|
|
|
10
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
11
|
+
|
|
10
12
|
var _key = require("../pm-plugins/key");
|
|
11
13
|
|
|
12
14
|
var _actions = require("../pm-plugins/actions");
|
|
@@ -36,8 +38,6 @@ var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
36
38
|
inputMethod = _ref.inputMethod,
|
|
37
39
|
query = _ref.query;
|
|
38
40
|
return function (tr) {
|
|
39
|
-
var _selection$$head, _selection$$head$pare, _selection$$head$pare2, _selection$$head$pare3;
|
|
40
|
-
|
|
41
41
|
openTypeAhead({
|
|
42
42
|
triggerHandler: triggerHandler,
|
|
43
43
|
inputMethod: inputMethod,
|
|
@@ -45,28 +45,37 @@ var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
45
45
|
})(tr);
|
|
46
46
|
var selection = tr.selection;
|
|
47
47
|
|
|
48
|
-
if (!(selection instanceof _prosemirrorState.TextSelection)) {
|
|
48
|
+
if (!(selection instanceof _prosemirrorState.TextSelection || selection instanceof _selection.GapCursorSelection)) {
|
|
49
49
|
return tr;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} // Search & Destroy placeholder
|
|
52
|
+
if (selection instanceof _selection.GapCursorSelection) {
|
|
53
|
+
// Create space for the typeahead menu in gap cursor
|
|
54
|
+
tr.insertText(' '); // delete 1 pos before wherever selection is now - that will delete the empty space
|
|
56
55
|
|
|
56
|
+
tr.delete(tr.selection.from - 1, tr.selection.from);
|
|
57
|
+
} else {
|
|
58
|
+
var _selection$$head, _selection$$head$pare, _selection$$head$pare2, _selection$$head$pare3;
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
if (!selection.$cursor) {
|
|
61
|
+
tr.deleteSelection();
|
|
62
|
+
return tr;
|
|
63
|
+
} // Search & Destroy placeholder
|
|
61
64
|
|
|
62
|
-
if (nodeAtCursor && isPlaceholderAtCursorPosition) {
|
|
63
|
-
tr.delete(cursorPos, cursorPos + nodeAtCursor.nodeSize);
|
|
64
|
-
} // ME-2375 remove the superfluous '@' inserted before decoration
|
|
65
|
-
// by composition (https://github.com/ProseMirror/prosemirror/issues/903)
|
|
66
65
|
|
|
66
|
+
var cursorPos = selection.$cursor.pos;
|
|
67
|
+
var nodeAtCursor = tr.doc.nodeAt(cursorPos);
|
|
68
|
+
var isPlaceholderAtCursorPosition = nodeAtCursor && nodeAtCursor.type.name === 'placeholder';
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
if (nodeAtCursor && isPlaceholderAtCursorPosition) {
|
|
71
|
+
tr.delete(cursorPos, cursorPos + nodeAtCursor.nodeSize);
|
|
72
|
+
} // ME-2375 remove the superfluous '@' inserted before decoration
|
|
73
|
+
// by composition (https://github.com/ProseMirror/prosemirror/issues/903)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if (_utils.browser.chrome && _utils.browser.android && cursorPos > 2 && !!(selection !== null && selection !== void 0 && (_selection$$head = selection.$head) !== null && _selection$$head !== void 0 && (_selection$$head$pare = _selection$$head.parent) !== null && _selection$$head$pare !== void 0 && _selection$$head$pare.textContent) && (_selection$$head$pare2 = (_selection$$head$pare3 = selection.$head.parent.textContent).endsWith) !== null && _selection$$head$pare2 !== void 0 && _selection$$head$pare2.call(_selection$$head$pare3, '@')) {
|
|
77
|
+
tr.delete(cursorPos - 1, cursorPos);
|
|
78
|
+
}
|
|
70
79
|
}
|
|
71
80
|
|
|
72
81
|
return tr;
|