@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
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { keymap } from 'prosemirror-keymap';
|
|
2
|
-
import { bindKeymapWithCommand, alignLeft
|
|
2
|
+
import { bindKeymapWithCommand, alignLeft } from '../../../keymaps';
|
|
3
3
|
import { changeAlignment } from '../commands';
|
|
4
4
|
export function keymapPlugin() {
|
|
5
5
|
const list = {};
|
|
6
6
|
bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
|
|
7
|
-
bindKeymapWithCommand(alignRight.common, changeAlignment('end'), list);
|
|
8
7
|
return keymap(list);
|
|
9
8
|
}
|
|
@@ -15,6 +15,8 @@ export class AlignmentToolbar extends React.Component {
|
|
|
15
15
|
constructor(...args) {
|
|
16
16
|
super(...args);
|
|
17
17
|
|
|
18
|
+
_defineProperty(this, "toolbarItemRef", /*#__PURE__*/React.createRef());
|
|
19
|
+
|
|
18
20
|
_defineProperty(this, "state", {
|
|
19
21
|
isOpen: false
|
|
20
22
|
});
|
|
@@ -38,13 +40,27 @@ export class AlignmentToolbar extends React.Component {
|
|
|
38
40
|
});
|
|
39
41
|
});
|
|
40
42
|
|
|
41
|
-
_defineProperty(this, "hide",
|
|
43
|
+
_defineProperty(this, "hide", attrs => {
|
|
42
44
|
if (this.state.isOpen) {
|
|
43
45
|
this.setState({
|
|
44
46
|
isOpen: false
|
|
45
47
|
});
|
|
48
|
+
|
|
49
|
+
if ((attrs === null || attrs === void 0 ? void 0 : attrs.event) instanceof KeyboardEvent && attrs.event.key === 'Escape') {
|
|
50
|
+
var _this$toolbarItemRef, _this$toolbarItemRef$;
|
|
51
|
+
|
|
52
|
+
(_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();
|
|
53
|
+
}
|
|
46
54
|
}
|
|
47
55
|
});
|
|
56
|
+
|
|
57
|
+
_defineProperty(this, "hideonEsc", () => {
|
|
58
|
+
var _this$toolbarItemRef2, _this$toolbarItemRef3;
|
|
59
|
+
|
|
60
|
+
this.hide(); //To set the focus on the textcolor button when the menu is closed by 'Esc' only (aria guidelines)
|
|
61
|
+
|
|
62
|
+
(_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();
|
|
63
|
+
});
|
|
48
64
|
}
|
|
49
65
|
|
|
50
66
|
render() {
|
|
@@ -68,10 +84,15 @@ export class AlignmentToolbar extends React.Component {
|
|
|
68
84
|
boundariesElement: popupsBoundariesElement,
|
|
69
85
|
scrollableElement: popupsScrollableElement,
|
|
70
86
|
isOpen: isOpen,
|
|
71
|
-
handleClickOutside: this.hide
|
|
72
|
-
|
|
87
|
+
handleClickOutside: event => this.hide({
|
|
88
|
+
isOpen: false,
|
|
89
|
+
event
|
|
90
|
+
}),
|
|
91
|
+
handleEscapeKeydown: this.hideonEsc,
|
|
92
|
+
onOpenChange: this.hide,
|
|
73
93
|
fitWidth: 112,
|
|
74
94
|
fitHeight: 80,
|
|
95
|
+
closeonTab: true,
|
|
75
96
|
trigger: jsx(ToolbarButton, {
|
|
76
97
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
77
98
|
disabled: disabled,
|
|
@@ -90,7 +111,8 @@ export class AlignmentToolbar extends React.Component {
|
|
|
90
111
|
css: expandIconWrapper
|
|
91
112
|
}, jsx(ExpandIcon, {
|
|
92
113
|
label: ""
|
|
93
|
-
})))
|
|
114
|
+
}))),
|
|
115
|
+
ref: this.toolbarItemRef
|
|
94
116
|
})
|
|
95
117
|
}, jsx(Alignment, {
|
|
96
118
|
onClick: align => this.changeAlignment(align),
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { ReactNodeView } from '../../../nodeviews';
|
|
4
|
-
import WithPluginState from '../../../ui/WithPluginState';
|
|
5
|
-
import { inlineCommentPluginKey } from '../utils';
|
|
6
4
|
export class AnnotationNodeView extends ReactNodeView {
|
|
7
5
|
createDomRef() {
|
|
8
6
|
return document.createElement('span');
|
|
@@ -17,35 +15,13 @@ export class AnnotationNodeView extends ReactNodeView {
|
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
render(_props, forwardRef) {
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}) => {
|
|
28
|
-
if (!(inlineCommentState !== null && inlineCommentState !== void 0 && inlineCommentState.isVisible)) {
|
|
29
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
30
|
-
ref: forwardRef
|
|
31
|
-
});
|
|
32
|
-
} // Check if selection includes current annotation ID
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const {
|
|
36
|
-
annotations,
|
|
37
|
-
selectedAnnotations
|
|
38
|
-
} = inlineCommentState;
|
|
39
|
-
const id = this.node.attrs.id;
|
|
40
|
-
const isUnresolved = annotations[id] === false;
|
|
41
|
-
const annotationHasFocus = selectedAnnotations.some(x => x.id === id);
|
|
42
|
-
const className = getAnnotationViewClassname(isUnresolved, annotationHasFocus);
|
|
43
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
44
|
-
className: className,
|
|
45
|
-
ref: forwardRef
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
18
|
+
return (
|
|
19
|
+
/*#__PURE__*/
|
|
20
|
+
// all inline comment states are now set in decorations at ../pm-plugins/inline-comment.ts
|
|
21
|
+
React.createElement("span", {
|
|
22
|
+
ref: forwardRef
|
|
23
|
+
})
|
|
24
|
+
);
|
|
49
25
|
}
|
|
50
26
|
|
|
51
27
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RESOLVE_METHOD } from './../../analytics/types/inline-comment-events';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
3
4
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
4
|
-
import { AnnotationNodeView } from '../nodeviews';
|
|
5
|
+
import { AnnotationNodeView, getAnnotationViewClassname } from '../nodeviews';
|
|
5
6
|
import { updateInlineCommentResolvedState, updateMouseState, clearDirtyMark, setInlineCommentsVisibility } from '../commands';
|
|
6
7
|
import { getAllAnnotations, inlineCommentPluginKey, getPluginState } from '../utils';
|
|
7
8
|
import { createPluginState } from './plugin-factory';
|
|
@@ -166,10 +167,30 @@ export const inlineCommentPlugin = options => {
|
|
|
166
167
|
},
|
|
167
168
|
|
|
168
169
|
decorations(state) {
|
|
170
|
+
// highlight comments, depending on state
|
|
169
171
|
const {
|
|
170
|
-
draftDecorationSet
|
|
172
|
+
draftDecorationSet,
|
|
173
|
+
annotations,
|
|
174
|
+
selectedAnnotations,
|
|
175
|
+
isVisible
|
|
171
176
|
} = getPluginState(state);
|
|
172
|
-
|
|
177
|
+
let decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : DecorationSet.empty;
|
|
178
|
+
const focusDecorations = [];
|
|
179
|
+
state.doc.descendants((node, pos) => {
|
|
180
|
+
node.marks.filter(mark => mark.type === state.schema.marks.annotation).forEach(mark => {
|
|
181
|
+
const isSelected = selectedAnnotations.some(selectedAnnotation => selectedAnnotation.id === mark.attrs.id);
|
|
182
|
+
const isUnresolved = annotations[mark.attrs.id] === false;
|
|
183
|
+
|
|
184
|
+
if (isVisible) {
|
|
185
|
+
focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
|
|
186
|
+
class: `${getAnnotationViewClassname(isUnresolved, isSelected)} ${isUnresolved}`,
|
|
187
|
+
nodeName: 'span'
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
decorations = decorations.add(state.doc, focusDecorations);
|
|
193
|
+
return decorations;
|
|
173
194
|
}
|
|
174
195
|
|
|
175
196
|
}
|
|
@@ -4,7 +4,7 @@ import { AnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
|
|
|
4
4
|
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
6
6
|
import { AnnotationSelectionType } from './types';
|
|
7
|
-
import { sum } from '../../utils';
|
|
7
|
+
import { isText, isParagraph, sum } from '../../utils';
|
|
8
8
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION } from '../analytics';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -255,7 +255,7 @@ export const isSelectionValid = state => {
|
|
|
255
255
|
return AnnotationSelectionType.DISABLED;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection)) {
|
|
258
|
+
if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection, state.schema)) {
|
|
259
259
|
return AnnotationSelectionType.INVALID;
|
|
260
260
|
}
|
|
261
261
|
|
|
@@ -308,10 +308,14 @@ function isEmptyTextSelection(selection, schema) {
|
|
|
308
308
|
*/
|
|
309
309
|
|
|
310
310
|
|
|
311
|
-
export function hasInvalidWhitespaceNode(selection) {
|
|
311
|
+
export function hasInvalidWhitespaceNode(selection, schema) {
|
|
312
312
|
let foundInvalidWhitespace = false;
|
|
313
313
|
const content = selection.content().content;
|
|
314
314
|
content.descendants(node => {
|
|
315
|
+
if (isText(node, schema)) {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
|
|
315
319
|
if (node.textContent.trim() === '') {
|
|
316
320
|
// Trailing new lines do not result in the annotation spanning into
|
|
317
321
|
// the trailing new line so can be ignored when looking for invalid
|
|
@@ -319,7 +323,7 @@ export function hasInvalidWhitespaceNode(selection) {
|
|
|
319
323
|
const nodeIsTrailingNewLine = // it is the final node
|
|
320
324
|
node.eq(content.lastChild) && // and there are multiple nodes
|
|
321
325
|
!node.eq(content.firstChild) && // and it is a paragraph node
|
|
322
|
-
node
|
|
326
|
+
isParagraph(node, schema);
|
|
323
327
|
|
|
324
328
|
if (!nodeIsTrailingNewLine) {
|
|
325
329
|
foundInvalidWhitespace = true;
|
|
@@ -44,6 +44,7 @@ export default (() => {
|
|
|
44
44
|
const createWidget = side => {
|
|
45
45
|
const node = document.createElement('span');
|
|
46
46
|
node.contentEditable = 'true';
|
|
47
|
+
node.setAttribute('aria-hidden', 'true');
|
|
47
48
|
node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE));
|
|
48
49
|
node.className = 'cursor-target';
|
|
49
50
|
return Decoration.widget(selection.from, node, {
|
|
@@ -16,7 +16,10 @@ export class CaptionNodeView extends SelectionBasedNodeView {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
getContentDOM() {
|
|
19
|
-
const dom = document.createElement('div');
|
|
19
|
+
const dom = document.createElement('div'); // setting a className prevents PM/Chrome mutation observer from
|
|
20
|
+
// incorrectly deleting nodes
|
|
21
|
+
|
|
22
|
+
dom.className = 'caption-wrapper';
|
|
20
23
|
return {
|
|
21
24
|
dom
|
|
22
25
|
};
|
|
@@ -65,8 +65,9 @@ const getCustomStyles = (selected, disabled) => {
|
|
|
65
65
|
return [primitiveStyles, unselectedStyles, interactiveStyles];
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
//tabindex is -1 as the menu options should be focusable explicitly only by arrow keys.
|
|
68
69
|
const OptionRoot = props => jsx("div", _extends({}, props, {
|
|
69
|
-
tabIndex:
|
|
70
|
+
tabIndex: -1
|
|
70
71
|
}));
|
|
71
72
|
|
|
72
73
|
const Option = ({
|
|
@@ -13,6 +13,8 @@ const toDOM = node => ['div', {
|
|
|
13
13
|
class: codeBlockClassNames.start,
|
|
14
14
|
contenteditable: 'false'
|
|
15
15
|
}], ['div', {
|
|
16
|
+
class: codeBlockClassNames.contentWrapper
|
|
17
|
+
}, ['div', {
|
|
16
18
|
class: codeBlockClassNames.gutter,
|
|
17
19
|
contenteditable: 'false'
|
|
18
20
|
}], ['div', {
|
|
@@ -22,7 +24,7 @@ const toDOM = node => ['div', {
|
|
|
22
24
|
spellcheck: 'false',
|
|
23
25
|
contenteditable: 'true',
|
|
24
26
|
'data-testid': 'code-block--code'
|
|
25
|
-
}, 0]], ['div', {
|
|
27
|
+
}, 0]]], ['div', {
|
|
26
28
|
class: codeBlockClassNames.end,
|
|
27
29
|
contenteditable: 'false'
|
|
28
30
|
}]];
|
|
@@ -67,7 +69,8 @@ export class CodeBlockView {
|
|
|
67
69
|
if ((_this$dom = this.dom) !== null && _this$dom !== void 0 && _this$dom.childNodes && this.dom.childNodes.length > 1) {
|
|
68
70
|
var _contentView$childNod;
|
|
69
71
|
|
|
70
|
-
const
|
|
72
|
+
const contentWrapper = this.dom.childNodes[1];
|
|
73
|
+
const contentView = contentWrapper === null || contentWrapper === void 0 ? void 0 : contentWrapper.childNodes[1];
|
|
71
74
|
|
|
72
75
|
if ((contentView === null || contentView === void 0 ? void 0 : (_contentView$childNod = contentView.childNodes) === null || _contentView$childNod === void 0 ? void 0 : _contentView$childNod.length) > 0) {
|
|
73
76
|
const codeElement = contentView.firstChild;
|
|
@@ -88,7 +91,8 @@ export class CodeBlockView {
|
|
|
88
91
|
var _this$dom2;
|
|
89
92
|
|
|
90
93
|
if ((_this$dom2 = this.dom) !== null && _this$dom2 !== void 0 && _this$dom2.childNodes && this.dom.childNodes.length > 1) {
|
|
91
|
-
const
|
|
94
|
+
const contentWrapper = this.dom.childNodes[1];
|
|
95
|
+
const contentView = contentWrapper === null || contentWrapper === void 0 ? void 0 : contentWrapper.childNodes[1];
|
|
92
96
|
|
|
93
97
|
if (contentView !== null && contentView !== void 0 && contentView.childNodes && contentView.childNodes.length > 1) {
|
|
94
98
|
let savedInnerHTML = '';
|
|
@@ -4,6 +4,19 @@ import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderS
|
|
|
4
4
|
import { token } from '@atlaskit/tokens';
|
|
5
5
|
import { codeBlockClassNames } from './ui/class-names';
|
|
6
6
|
import { codeBlockSharedStyles } from '@atlaskit/editor-common/styles';
|
|
7
|
+
|
|
8
|
+
const GutterDangerOverlay = () => css`
|
|
9
|
+
&::after {
|
|
10
|
+
height: 100%;
|
|
11
|
+
content: '';
|
|
12
|
+
position: absolute;
|
|
13
|
+
left: 0;
|
|
14
|
+
top: 0;
|
|
15
|
+
width: 24px;
|
|
16
|
+
background-color: ${token('color.blanket.danger', 'none')};
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
7
20
|
export const codeBlockStyles = props => css`
|
|
8
21
|
.ProseMirror {
|
|
9
22
|
${codeBlockSharedStyles(props)}
|
|
@@ -30,27 +43,30 @@ export const codeBlockStyles = props => css`
|
|
|
30
43
|
|
|
31
44
|
/* Danger when top level node */
|
|
32
45
|
.ProseMirror .danger.code-block {
|
|
33
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
|
|
46
|
+
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
|
|
47
|
+
${token('color.border.danger', akEditorDeleteBorder)};
|
|
34
48
|
|
|
35
49
|
.${codeBlockClassNames.gutter} {
|
|
36
|
-
background-color: ${token('color.
|
|
50
|
+
background-color: ${token('color.background.danger', R75)};
|
|
37
51
|
color: ${token('color.text.danger', akEditorDeleteIconColor)};
|
|
52
|
+
${GutterDangerOverlay()};
|
|
38
53
|
}
|
|
39
54
|
|
|
40
55
|
.${codeBlockClassNames.content} {
|
|
41
|
-
background-color: ${token('color.
|
|
56
|
+
background-color: ${token('color.blanket.danger', akEditorDeleteBackground)};
|
|
42
57
|
}
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
/* Danger when nested node */
|
|
46
61
|
.ProseMirror .danger .code-block {
|
|
47
62
|
.${codeBlockClassNames.gutter} {
|
|
48
|
-
background-color: ${token('color.
|
|
63
|
+
background-color: ${token('color.background.danger', 'rgba(255, 143, 115, 0.5)')};
|
|
49
64
|
color: ${token('color.text.danger', akEditorDeleteIconColor)};
|
|
65
|
+
${GutterDangerOverlay()};
|
|
50
66
|
}
|
|
51
67
|
|
|
52
68
|
.${codeBlockClassNames.content} {
|
|
53
|
-
background-color: ${token('color.
|
|
69
|
+
background-color: ${token('color.blanket.danger', 'rgba(255, 189, 173, 0.5)')};
|
|
54
70
|
}
|
|
55
71
|
}
|
|
56
72
|
`;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
2
2
|
export const codeBlockClassNames = {
|
|
3
|
+
container: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER,
|
|
3
4
|
start: CodeBlockSharedCssClassName.CODEBLOCK_START,
|
|
4
5
|
end: CodeBlockSharedCssClassName.CODEBLOCK_END,
|
|
6
|
+
contentWrapper: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER,
|
|
5
7
|
gutter: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER,
|
|
6
8
|
content: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
7
9
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
1
|
import { Selection, TextSelection } from 'prosemirror-state';
|
|
3
2
|
import { Decoration } from 'prosemirror-view';
|
|
4
3
|
import * as themeColors from '@atlaskit/theme/colors';
|
|
@@ -6,10 +5,15 @@ import { hexToRgba } from '@atlaskit/adf-schema';
|
|
|
6
5
|
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/utils';
|
|
7
6
|
import { addAnalytics } from '../analytics/utils';
|
|
8
7
|
import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '../analytics/types';
|
|
8
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-7269
|
|
9
|
+
|
|
10
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
9
11
|
export const colors = [themeColors.R100, themeColors.R300, themeColors.R500, themeColors.Y100, themeColors.Y300, themeColors.Y500, themeColors.G100, themeColors.G300, themeColors.G500, themeColors.T100, themeColors.T300, themeColors.T500, themeColors.B100, themeColors.B300, themeColors.B500, themeColors.P100, themeColors.P300, themeColors.P500, themeColors.N70, themeColors.N200, themeColors.N800].map(solid => ({
|
|
10
12
|
solid,
|
|
11
13
|
selection: hexToRgba(solid, 0.2)
|
|
12
14
|
}));
|
|
15
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
16
|
+
|
|
13
17
|
export const getAvatarColor = str => {
|
|
14
18
|
let hash = 0;
|
|
15
19
|
|
|
@@ -26,8 +26,10 @@ export function createToolbarCopyCommandForMark(markType) {
|
|
|
26
26
|
// since we're copying the text inside a paragraph, it will always be 1 1
|
|
27
27
|
// https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
|
|
28
28
|
|
|
29
|
-
div.firstChild.setAttribute('data-pm-slice', '1 1 []');
|
|
30
|
-
|
|
29
|
+
div.firstChild.setAttribute('data-pm-slice', '1 1 []'); // If we're copying a hyperlink, we'd copy the url as the fallback plain text
|
|
30
|
+
|
|
31
|
+
const linkUrl = domNode.getAttribute('href');
|
|
32
|
+
copyHTMLToClipboard(div, markType.name === 'link' && linkUrl ? linkUrl : undefined);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
const copyToClipboardTr = state.tr;
|
|
@@ -136,7 +138,7 @@ export const createToolbarCopyCommandForNode = nodeType => (state, dispatch) =>
|
|
|
136
138
|
div.firstChild.setAttribute('data-pm-slice', '0 0 []');
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
copyHTMLToClipboard(div
|
|
141
|
+
copyHTMLToClipboard(div);
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
copyToClipboardTr.setMeta('scrollIntoView', false);
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Emoji from '../ui/Emoji';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
4
|
+
import { messages } from '../messages';
|
|
5
|
+
const EmojiAssistiveTextComponent = /*#__PURE__*/React.memo(({
|
|
6
|
+
emojiShortName
|
|
7
|
+
}) => {
|
|
8
|
+
const intl = useIntl();
|
|
9
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10
|
+
className: 'assistive'
|
|
11
|
+
}, `${intl.formatMessage(messages.emojiNodeLabel)} ${emojiShortName}`);
|
|
12
|
+
});
|
|
3
13
|
export function EmojiNodeView(props) {
|
|
4
14
|
const {
|
|
5
15
|
shortName,
|
|
6
16
|
id,
|
|
7
17
|
text
|
|
8
18
|
} = props.node.attrs;
|
|
9
|
-
return /*#__PURE__*/React.createElement(
|
|
19
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EmojiAssistiveTextComponent, {
|
|
20
|
+
emojiShortName: shortName
|
|
21
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Emoji, {
|
|
10
24
|
providers: props.providerFactory,
|
|
11
25
|
id: id,
|
|
12
26
|
shortName: shortName,
|
|
13
27
|
fallback: text
|
|
14
|
-
});
|
|
28
|
+
})));
|
|
15
29
|
}
|
|
@@ -8,6 +8,7 @@ import { expandClassNames } from '../ui/class-names';
|
|
|
8
8
|
import { deleteExpand, focusTitle } from '../commands';
|
|
9
9
|
import { getPluginState as getSelectionPluginState } from '../../selection/plugin-factory';
|
|
10
10
|
import { RelativeSelectionPos } from '../../selection/types';
|
|
11
|
+
import { isPositionNearTableRow } from '../../../utils/table';
|
|
11
12
|
|
|
12
13
|
const isExpandNode = node => {
|
|
13
14
|
return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
|
|
@@ -111,7 +112,15 @@ export function expandKeymap() {
|
|
|
111
112
|
} = state.selection;
|
|
112
113
|
|
|
113
114
|
if (editorView.endOfTextblock('up')) {
|
|
114
|
-
const expand = findExpand(state);
|
|
115
|
+
const expand = findExpand(state); // Moving UP in a table should move the cursor to the row above
|
|
116
|
+
// however when an expand is in a table cell to the left of the
|
|
117
|
+
// current table cell, arrow UP moves the cursor to the left
|
|
118
|
+
// see ED-15425
|
|
119
|
+
|
|
120
|
+
if (isPositionNearTableRow($from, schema, 'before') && !expand) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
|
|
115
124
|
const prevCursorPos = Math.max($from.pos - $from.parentOffset - 1, 0); // move cursor from expand's content to its title
|
|
116
125
|
|
|
117
126
|
if (expand && expand.start === prevCursorPos) {
|
|
@@ -26,7 +26,7 @@ function getSpellCheck(featureFlags) {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
export function createFeatureFlagsFromProps(props) {
|
|
29
|
-
var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$
|
|
29
|
+
var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$collabEdit, _props$collabEdit2, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39;
|
|
30
30
|
|
|
31
31
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
32
32
|
const tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
@@ -53,19 +53,23 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
53
53
|
errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useErrorBoundaryDocStructure) : false),
|
|
54
54
|
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.synchronyErrorDocStructure) : false),
|
|
55
55
|
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.enableViewUpdateSubscription) : false),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactions) : false)),
|
|
56
|
+
collabAvatarScroll: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.collabAvatarScroll) : false),
|
|
57
|
+
ufo: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.ufo) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.ufo) : false),
|
|
58
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.twoLineEditorToolbar) : false),
|
|
59
|
+
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
|
|
61
60
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
62
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
63
|
-
viewChangingExperimentToolbarStyle: typeof ((_props$
|
|
61
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
62
|
+
viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
|
|
64
63
|
tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
|
|
65
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
66
|
-
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
67
|
-
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$
|
|
68
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
69
|
-
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags)
|
|
64
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.showHoverPreview) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.showHoverPreview) : false),
|
|
65
|
+
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags33 = props.featureFlags) !== null && _props$featureFlags33 !== void 0 && _props$featureFlags33.indentationButtonsInTheToolbar) : false)),
|
|
66
|
+
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags35 = props.featureFlags) !== null && _props$featureFlags35 !== void 0 && _props$featureFlags35.floatingToolbarCopyButton) : false)),
|
|
67
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
68
|
+
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
69
|
+
// Including fallback to props.featureFlags so that mobile feature flags
|
|
70
|
+
// are included (they are not kebab cased)
|
|
71
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.restartNumberedLists) === true,
|
|
72
|
+
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.listNumberContinuity) === true,
|
|
73
|
+
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.restartNumberedListsToolbar) === true
|
|
70
74
|
};
|
|
71
75
|
}
|
|
@@ -88,6 +88,7 @@ class FindReplaceToolbarButton extends React.PureComponent {
|
|
|
88
88
|
},
|
|
89
89
|
fitWidth: 352,
|
|
90
90
|
zIndex: stackBelowOtherEditorFloatingPanels,
|
|
91
|
+
disableArrowKeyNavigation: true,
|
|
91
92
|
trigger: jsx(ToolbarButton, {
|
|
92
93
|
buttonId: TOOLBAR_BUTTON.FIND_REPLACE,
|
|
93
94
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -187,6 +187,7 @@ const floatingToolbarPlugin = () => ({
|
|
|
187
187
|
className = '',
|
|
188
188
|
height,
|
|
189
189
|
width,
|
|
190
|
+
zIndex,
|
|
190
191
|
offset = [0, 12],
|
|
191
192
|
forcePlacement,
|
|
192
193
|
onPositionCalculated
|
|
@@ -229,6 +230,7 @@ const floatingToolbarPlugin = () => ({
|
|
|
229
230
|
fitWidth: width,
|
|
230
231
|
alignX: align,
|
|
231
232
|
stick: true,
|
|
233
|
+
zIndex: zIndex,
|
|
232
234
|
mountTo: popupsMountPoint,
|
|
233
235
|
boundariesElement: popupsBoundariesElement,
|
|
234
236
|
scrollableElement: popupsScrollableElement,
|
|
@@ -56,6 +56,14 @@ export default class Dropdown extends Component {
|
|
|
56
56
|
isOpen: false
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
|
+
|
|
60
|
+
_defineProperty(this, "hideonEsc", () => {
|
|
61
|
+
var _document$querySelect;
|
|
62
|
+
|
|
63
|
+
this.hide(); //Focus the trigger button only on Escape
|
|
64
|
+
|
|
65
|
+
(_document$querySelect = document.querySelector(`[data-testid=${this.props.buttonTestId}]`)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
|
|
66
|
+
});
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
render() {
|
|
@@ -120,7 +128,7 @@ export default class Dropdown extends Component {
|
|
|
120
128
|
scrollableElement: scrollableElement,
|
|
121
129
|
isOpen: isOpen,
|
|
122
130
|
handleClickOutside: this.hide,
|
|
123
|
-
handleEscapeKeydown: this.
|
|
131
|
+
handleEscapeKeydown: this.hideonEsc,
|
|
124
132
|
fitWidth: fitWidth + fitTolerance,
|
|
125
133
|
fitHeight: fitHeight + fitTolerance,
|
|
126
134
|
trigger: trigger
|
|
@@ -32,6 +32,7 @@ const menuContainer = css`
|
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
export const itemSpacing = gridSize() / 2;
|
|
35
|
+
const DropdownButtonItem = ButtonItem;
|
|
35
36
|
|
|
36
37
|
class Dropdown extends Component {
|
|
37
38
|
render() {
|
|
@@ -44,7 +45,7 @@ class Dropdown extends Component {
|
|
|
44
45
|
return jsx("div", {
|
|
45
46
|
css: menuContainer
|
|
46
47
|
}, items.filter(item => !item.hidden).map((item, idx) => {
|
|
47
|
-
const itemContent = jsx(
|
|
48
|
+
const itemContent = jsx(DropdownButtonItem, {
|
|
48
49
|
key: idx,
|
|
49
50
|
iconBefore: this.renderSelected(item, intl),
|
|
50
51
|
iconAfter: item.elemAfter,
|
|
@@ -62,6 +63,24 @@ class Dropdown extends Component {
|
|
|
62
63
|
isDisabled: item.disabled,
|
|
63
64
|
onMouseDown: e => {
|
|
64
65
|
e.preventDefault();
|
|
66
|
+
},
|
|
67
|
+
onMouseOver: e => {
|
|
68
|
+
if (item.onMouseOver) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
dispatchCommand(item.onMouseOver);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
onMouseEnter: e => {
|
|
74
|
+
if (item.onMouseEnter) {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
dispatchCommand(item.onMouseEnter);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
onMouseLeave: e => {
|
|
80
|
+
if (item.onMouseLeave) {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
dispatchCommand(item.onMouseLeave);
|
|
83
|
+
}
|
|
65
84
|
}
|
|
66
85
|
}, item.title);
|
|
67
86
|
|