@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
|
@@ -30,9 +30,7 @@ export default function SelectField(_ref) {
|
|
|
30
30
|
onChange: function onChange(value) {
|
|
31
31
|
fieldProps.onChange(value);
|
|
32
32
|
onFieldChange(name, true);
|
|
33
|
-
} //
|
|
34
|
-
,
|
|
35
|
-
enableAnimation: false // add type cast to avoid adding a "IsMulti" generic prop (TODO: ED-12072)
|
|
33
|
+
} // add type cast to avoid adding a "IsMulti" generic prop (TODO: ED-12072)
|
|
36
34
|
,
|
|
37
35
|
isMulti: field.isMultiple || false,
|
|
38
36
|
options: field.items || [],
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import { Dropdown as DropdownComponent } from '@atlaskit/editor-common/ui-menu';
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
|
+
import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
|
|
5
|
+
var Dropdown = /*#__PURE__*/React.memo(function (_ref) {
|
|
6
|
+
var props = _extends({}, _ref);
|
|
7
|
+
|
|
8
|
+
var keydownHandlerContext = useContext(KeyDownHandlerContext);
|
|
9
|
+
return (
|
|
10
|
+
/*#__PURE__*/
|
|
11
|
+
//This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
12
|
+
//Default context has the void callbacks for above key events
|
|
13
|
+
React.createElement(DropdownComponent, _extends({
|
|
14
|
+
keyDownHandlerContext: keydownHandlerContext
|
|
15
|
+
}, props))
|
|
16
|
+
);
|
|
17
|
+
});
|
|
2
18
|
export default Dropdown;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import { DropdownMenu as DropdownComponent } from '@atlaskit/editor-common/ui-menu';
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
|
+
import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
|
|
5
|
+
var DropdownMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
6
|
+
var props = _extends({}, _ref);
|
|
7
|
+
|
|
8
|
+
var keydownHandlerContext = useContext(KeyDownHandlerContext); //This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
9
|
+
//Default context has the void callbacks for above key events
|
|
10
|
+
|
|
11
|
+
return /*#__PURE__*/React.createElement(DropdownComponent, _extends({
|
|
12
|
+
keyDownHandlerContext: keydownHandlerContext
|
|
13
|
+
}, props));
|
|
14
|
+
});
|
|
2
15
|
export default DropdownMenu;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import React, { useLayoutEffect, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
** The context is used to handle the keydown events of submenus.
|
|
6
|
+
** Because the keyboard navigation is explicitly managed for main toolbar items
|
|
7
|
+
** Few key presses such as Tab,Arrow Right/Left need ot be handled here via context
|
|
8
|
+
*/
|
|
9
|
+
export var KeyDownHandlerContext = /*#__PURE__*/React.createContext({
|
|
10
|
+
handleArrowLeft: function handleArrowLeft() {},
|
|
11
|
+
handleArrowRight: function handleArrowRight() {},
|
|
12
|
+
handleTab: function handleTab() {}
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* This component is a wrapper of main toolbar which listens to keydown events of children
|
|
16
|
+
* and handles left/right arrow key navigation for all focusable elements
|
|
17
|
+
* @param
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvider(_ref) {
|
|
22
|
+
var children = _ref.children,
|
|
23
|
+
editorView = _ref.editorView;
|
|
24
|
+
var wrapperRef = useRef(null);
|
|
25
|
+
var currentSelectedItemIndex = useRef(0);
|
|
26
|
+
|
|
27
|
+
var incrementIndex = function incrementIndex(list) {
|
|
28
|
+
if (currentSelectedItemIndex.current === list.length - 1) {
|
|
29
|
+
currentSelectedItemIndex.current = 0;
|
|
30
|
+
} else {
|
|
31
|
+
currentSelectedItemIndex.current = currentSelectedItemIndex.current + 1;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var decrementIndex = function decrementIndex(list) {
|
|
36
|
+
if (currentSelectedItemIndex.current === 0) {
|
|
37
|
+
currentSelectedItemIndex.current = list.length - 1;
|
|
38
|
+
} else {
|
|
39
|
+
currentSelectedItemIndex.current = currentSelectedItemIndex.current - 1;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var handleArrowRight = function handleArrowRight() {
|
|
44
|
+
var _filteredFocusableEle;
|
|
45
|
+
|
|
46
|
+
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
47
|
+
incrementIndex(filteredFocusableElements);
|
|
48
|
+
(_filteredFocusableEle = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle === void 0 ? void 0 : _filteredFocusableEle.focus();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var handleArrowLeft = function handleArrowLeft() {
|
|
52
|
+
var _filteredFocusableEle2;
|
|
53
|
+
|
|
54
|
+
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
55
|
+
decrementIndex(filteredFocusableElements);
|
|
56
|
+
(_filteredFocusableEle2 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle2 === void 0 ? void 0 : _filteredFocusableEle2.focus();
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var handleTab = function handleTab() {
|
|
60
|
+
var _filteredFocusableEle3;
|
|
61
|
+
|
|
62
|
+
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
63
|
+
(_filteredFocusableEle3 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle3 === void 0 ? void 0 : _filteredFocusableEle3.focus();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var submenuKeydownHandleContext = {
|
|
67
|
+
handleArrowLeft: handleArrowLeft,
|
|
68
|
+
handleArrowRight: handleArrowRight,
|
|
69
|
+
handleTab: handleTab
|
|
70
|
+
};
|
|
71
|
+
useLayoutEffect(function () {
|
|
72
|
+
if (!wrapperRef.current) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
var element = wrapperRef.current;
|
|
77
|
+
/**
|
|
78
|
+
* To handle the key events on the list
|
|
79
|
+
* @param event
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
83
|
+
var _document$querySelect, _wrapperRef$current, _filteredFocusableEle4;
|
|
84
|
+
|
|
85
|
+
//To trap the focus inside the horizontal main toolbar for left and right arrow keys
|
|
86
|
+
var targetElement = event.target; //To filter out the events outside the main toolbar
|
|
87
|
+
|
|
88
|
+
if (!targetElement.closest("[data-testid='ak-editor-main-toolbar']")) {
|
|
89
|
+
return;
|
|
90
|
+
} //The key events are from child components such as dropdown menus / popups are ignored
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
if ((_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
98
|
+
|
|
99
|
+
if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
|
|
100
|
+
return;
|
|
101
|
+
} //This is kind of hack to reset the current focused toolbar item
|
|
102
|
+
//to handle some usecases such as Tab in/out of main toolbar
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
|
|
106
|
+
currentSelectedItemIndex.current = -1;
|
|
107
|
+
} else {
|
|
108
|
+
currentSelectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : currentSelectedItemIndex.current;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (event.key === 'ArrowRight') {
|
|
112
|
+
incrementIndex(filteredFocusableElements);
|
|
113
|
+
} else if (event.key === 'ArrowLeft') {
|
|
114
|
+
decrementIndex(filteredFocusableElements);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
(_filteredFocusableEle4 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle4 === void 0 ? void 0 : _filteredFocusableEle4.focus();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
|
|
121
|
+
return function () {
|
|
122
|
+
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
|
|
123
|
+
};
|
|
124
|
+
}, [currentSelectedItemIndex, wrapperRef, editorView]);
|
|
125
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: "custom-key-handler-wrapper",
|
|
127
|
+
ref: wrapperRef
|
|
128
|
+
}, /*#__PURE__*/React.createElement(KeyDownHandlerContext.Provider, {
|
|
129
|
+
value: submenuKeydownHandleContext
|
|
130
|
+
}, children));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
function getFocusableElements(rootNode) {
|
|
134
|
+
if (!rootNode) {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, div[tabindex="-1"], div[tabindex="0"]') || [];
|
|
139
|
+
return Array.from(focusableModalElements);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function getFilteredFocusableElements(rootNode) {
|
|
143
|
+
//The focusable elements from child components such as dropdown menus / popups are ignored
|
|
144
|
+
return getFocusableElements(rootNode).filter(function (elm) {
|
|
145
|
+
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]');
|
|
146
|
+
});
|
|
147
|
+
}
|
package/dist/esm/ui/styles.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { N30 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { token } from '@atlaskit/tokens';
|
|
8
8
|
export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
9
|
-
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
9
|
+
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
10
|
+
export var buttonGroupStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n & > div {\n display: flex;\n }\n"])));
|
|
11
|
+
export var separatorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), token('color.border', N30));
|
|
12
|
+
export var wrapperStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > div,\n > span {\n display: flex;\n }\n\n > div > div {\n display: flex;\n }\n\n margin-left: 0;\n min-width: auto;\n"])));
|
|
13
|
+
export var wrapperSmallStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 4px;\n min-width: 40px;\n"])));
|
|
14
|
+
export var expandIconWrapperStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
15
|
+
export var triggerWrapperStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
16
|
+
export var buttonContentStyle = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n min-width: 80px;\n align-items: center;\n overflow: hidden;\n justify-content: center;\n flex-direction: column;\n padding: 6px;\n"])));
|
|
17
|
+
export var buttonContentReducedSpacingStyle = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 8px;\n"]))); // Taken from the style of inline dialog components
|
|
10
18
|
|
|
11
|
-
export var
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export var buttonGroupStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n & > div {\n display: flex;\n }\n"])));
|
|
15
|
-
export var separatorStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), token('color.border', N30));
|
|
16
|
-
export var wrapperStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > div,\n > span {\n display: flex;\n }\n\n > div > div {\n display: flex;\n }\n\n margin-left: 0;\n min-width: auto;\n"])));
|
|
17
|
-
export var wrapperSmallStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: 4px;\n min-width: 40px;\n"])));
|
|
18
|
-
export var expandIconWrapperStyle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
19
|
-
export var triggerWrapperStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
20
|
-
export var buttonContentStyle = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n min-width: 80px;\n align-items: center;\n overflow: hidden;\n justify-content: center;\n flex-direction: column;\n padding: 6px;\n"])));
|
|
21
|
-
export var buttonContentReducedSpacingStyle = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n padding: 8px;\n"]))); // Taken from the style of inline dialog components
|
|
22
|
-
|
|
23
|
-
export var dropShadow = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n box-shadow: ", ";\n"])), token('elevation.shadow.overlay', "0 0 1px rgba(9, 30, 66, 0.31),\n 0 4px 8px -2px rgba(9, 30, 66, 0.25)"));
|
|
24
|
-
export var clickSelectWrapperStyle = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n user-select: all;\n"])));
|
|
19
|
+
export var dropShadow = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n box-shadow: ", ";\n"])), token('elevation.shadow.overlay', "0 0 1px rgba(9, 30, 66, 0.31),\n 0 4px 8px -2px rgba(9, 30, 66, 0.25)"));
|
|
20
|
+
export var clickSelectWrapperStyle = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n user-select: all;\n"])));
|
|
@@ -94,8 +94,8 @@ export var copyToClipboard = /*#__PURE__*/function () {
|
|
|
94
94
|
};
|
|
95
95
|
}();
|
|
96
96
|
export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
97
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(
|
|
98
|
-
var
|
|
97
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(elementToCopy, plainTextToCopy) {
|
|
98
|
+
var data, Clipboard, dt;
|
|
99
99
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
100
100
|
while (1) {
|
|
101
101
|
switch (_context2.prev = _context2.next) {
|
|
@@ -106,15 +106,19 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
_context2.prev = 1;
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
data = new ClipboardItem({
|
|
110
|
+
'text/plain': new Blob([plainTextToCopy || elementToCopy.innerText], {
|
|
111
|
+
type: 'text/plain'
|
|
112
|
+
}),
|
|
113
|
+
'text/html': new Blob([elementToCopy.innerHTML], {
|
|
114
|
+
type: 'text/html'
|
|
115
|
+
})
|
|
111
116
|
}); // @ts-ignore
|
|
112
117
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
})]; // @ts-ignore
|
|
118
|
+
_context2.next = 5;
|
|
119
|
+
return navigator.clipboard.write([data]);
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
case 5:
|
|
118
122
|
_context2.next = 10;
|
|
119
123
|
break;
|
|
120
124
|
|
|
@@ -124,7 +128,7 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
124
128
|
throw new Error('Clipboard api is not supported');
|
|
125
129
|
|
|
126
130
|
case 10:
|
|
127
|
-
_context2.next =
|
|
131
|
+
_context2.next = 17;
|
|
128
132
|
break;
|
|
129
133
|
|
|
130
134
|
case 12:
|
|
@@ -132,10 +136,11 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
132
136
|
// Hence of use of this polyfill
|
|
133
137
|
Clipboard = clipboard;
|
|
134
138
|
dt = new Clipboard.DT();
|
|
135
|
-
dt.setData('text/
|
|
139
|
+
dt.setData('text/plain', plainTextToCopy || elementToCopy.innerText);
|
|
140
|
+
dt.setData('text/html', elementToCopy.innerHTML);
|
|
136
141
|
Clipboard.write(dt);
|
|
137
142
|
|
|
138
|
-
case
|
|
143
|
+
case 17:
|
|
139
144
|
case "end":
|
|
140
145
|
return _context2.stop();
|
|
141
146
|
}
|
|
@@ -143,7 +148,7 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
143
148
|
}, _callee2, null, [[1, 7]]);
|
|
144
149
|
}));
|
|
145
150
|
|
|
146
|
-
return function copyHTMLToClipboard(_x2) {
|
|
151
|
+
return function copyHTMLToClipboard(_x2, _x3) {
|
|
147
152
|
return _ref3.apply(this, arguments);
|
|
148
153
|
};
|
|
149
154
|
}();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { Node } from 'prosemirror-model';
|
|
3
|
-
import { transformMediaLinkMarks, transformTextLinkCodeMarks, transformDedupeMarks, transformNodesMissingContent, transformIndentationMarks } from '@atlaskit/adf-utils/transforms';
|
|
3
|
+
import { transformMediaLinkMarks, transformTextLinkCodeMarks, transformDedupeMarks, transformNodesMissingContent, transformIndentationMarks, transformInvalidMediaContent } from '@atlaskit/adf-utils/transforms';
|
|
4
4
|
import { sanitizeNodeForPrivacy } from '../utils/filter/privacy-filter';
|
|
5
5
|
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { getBreakoutMode } from './node-width';
|
|
@@ -249,6 +249,19 @@ export function processRawValue(schema, value, providerFactory, sanitizePrivateC
|
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
var _transformInvalidMedi = transformInvalidMediaContent(transformedAdf);
|
|
253
|
+
|
|
254
|
+
transformedAdf = _transformInvalidMedi.transformedAdf;
|
|
255
|
+
isTransformed = _transformInvalidMedi.isTransformed;
|
|
256
|
+
|
|
257
|
+
if (isTransformed && dispatchAnalyticsEvent) {
|
|
258
|
+
dispatchAnalyticsEvent({
|
|
259
|
+
action: ACTION.INVALID_MEDIA_CONTENT_TRANSFORMED,
|
|
260
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
261
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
252
265
|
var entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent);
|
|
253
266
|
var newEntity = maySanitizePrivateContent(entity, providerFactory, sanitizePrivateContent);
|
|
254
267
|
var parsedDoc = Node.fromJSON(schema, newEntity); // throws an error if the document is invalid
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -361,13 +361,6 @@ export function stringRepeat(text, length) {
|
|
|
361
361
|
|
|
362
362
|
return result;
|
|
363
363
|
}
|
|
364
|
-
/**
|
|
365
|
-
* A replacement for `Array.from` until it becomes widely implemented.
|
|
366
|
-
*/
|
|
367
|
-
|
|
368
|
-
export function arrayFrom(obj) {
|
|
369
|
-
return Array.prototype.slice.call(obj);
|
|
370
|
-
}
|
|
371
364
|
/*
|
|
372
365
|
* From Modernizr
|
|
373
366
|
* Returns the kind of transitionevent available for the element
|
|
@@ -4,11 +4,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
|
-
import { canJoin, findWrapping } from 'prosemirror-transform';
|
|
8
7
|
import { closeHistory } from 'prosemirror-history';
|
|
9
8
|
import { TextSelection } from 'prosemirror-state';
|
|
10
|
-
import {
|
|
9
|
+
import { canJoin, findWrapping } from 'prosemirror-transform';
|
|
10
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
11
11
|
import { createInputRulePlugin } from '@atlaskit/prosemirror-input-rules';
|
|
12
|
+
import { addAnalytics } from '../plugins/analytics';
|
|
12
13
|
export var ruleWithAnalytics = function ruleWithAnalytics(getPayload) {
|
|
13
14
|
return function (originalRule) {
|
|
14
15
|
var onHandlerApply = function onHandlerApply(state, tr, matchResult) {
|
|
@@ -63,7 +64,7 @@ export var createPlugin = function createPlugin(pluginName, rules) {
|
|
|
63
64
|
var unsupportedMarks = isBlockNodeRule ? ['code', 'link', 'typeAheadQuery'] : ['code'];
|
|
64
65
|
var $from = state.selection.$from;
|
|
65
66
|
|
|
66
|
-
if ($from.parent.type.spec.code || !(state.selection instanceof TextSelection) || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
|
|
67
|
+
if ($from.parent.type.spec.code || !(state.selection instanceof TextSelection) && !(state.selection instanceof GapCursorSelection) || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
|
|
67
68
|
return false;
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
isPositionNearTableRow()
|
|
3
|
+
Returns true when a sibling node, or any of the parent's sibling
|
|
4
|
+
nodes are a tableRow
|
|
5
|
+
*/
|
|
6
|
+
export function isPositionNearTableRow(pos, schema, direction) {
|
|
7
|
+
if (!schema.nodes.tableRow) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var doc = pos.doc;
|
|
12
|
+
var resolved = pos;
|
|
13
|
+
var sibling = direction === 'before' ? 'nodeBefore' : 'nodeAfter';
|
|
14
|
+
|
|
15
|
+
while (resolved.depth > 0) {
|
|
16
|
+
var _resolved$sibling;
|
|
17
|
+
|
|
18
|
+
var siblingType = (_resolved$sibling = resolved[sibling]) === null || _resolved$sibling === void 0 ? void 0 : _resolved$sibling.type;
|
|
19
|
+
|
|
20
|
+
if (siblingType === schema.nodes.tableRow) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
resolved = doc.resolve(resolved[direction]());
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return false;
|
|
28
|
+
}
|
package/dist/esm/version.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { addAltText, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft,
|
|
1
|
+
export { addAltText, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP, } from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
export type { Keymap } from '@atlaskit/editor-common/keymaps';
|
|
@@ -17,12 +17,14 @@ export interface Props {
|
|
|
17
17
|
}
|
|
18
18
|
export declare class AlignmentToolbar extends React.Component<Props & WrappedComponentProps, State> {
|
|
19
19
|
static displayName: string;
|
|
20
|
+
private toolbarItemRef;
|
|
20
21
|
state: State;
|
|
21
22
|
render(): jsx.JSX.Element;
|
|
22
23
|
private changeAlignment;
|
|
23
24
|
private toggleOpen;
|
|
24
25
|
private handleOpenChange;
|
|
25
26
|
private hide;
|
|
27
|
+
private hideonEsc;
|
|
26
28
|
}
|
|
27
29
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
28
30
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResolvedPos, Mark, Node, Slice } from 'prosemirror-model';
|
|
1
|
+
import { ResolvedPos, Mark, Node, Slice, Schema } from 'prosemirror-model';
|
|
2
2
|
import { EditorState, Selection, PluginKey, TextSelection, AllSelection } from 'prosemirror-state';
|
|
3
3
|
import { Decoration } from 'prosemirror-view';
|
|
4
4
|
import { AnnotationInfo, AnnotationSelectionType } from './types';
|
|
@@ -50,7 +50,7 @@ export declare const hasInvalidNodes: (state: EditorState) => boolean;
|
|
|
50
50
|
* Checks if any of the nodes in a given selection are completely whitespace
|
|
51
51
|
* This is to conform to Confluence annotation specifications
|
|
52
52
|
*/
|
|
53
|
-
export declare function hasInvalidWhitespaceNode(selection: TextSelection | AllSelection): boolean;
|
|
53
|
+
export declare function hasInvalidWhitespaceNode(selection: TextSelection | AllSelection, schema: Schema): boolean;
|
|
54
54
|
export declare function hasAnnotationMark(node: Node, state: EditorState): boolean;
|
|
55
55
|
export declare function annotationExists(annotationId: string, state: EditorState): boolean;
|
|
56
56
|
export declare function containsAnyAnnotations(slice: Slice, state: EditorState): boolean;
|
|
@@ -4,6 +4,7 @@ import { WrappedComponentProps } from 'react-intl-next';
|
|
|
4
4
|
import { BlockTypeState } from '../../pm-plugins/main';
|
|
5
5
|
import { BlockType } from '../../types';
|
|
6
6
|
import { MenuItem } from '../../../../ui/DropdownMenu/types';
|
|
7
|
+
import { EditorView } from 'prosemirror-view';
|
|
7
8
|
export declare type DropdownItem = MenuItem & {
|
|
8
9
|
value: BlockType;
|
|
9
10
|
};
|
|
@@ -15,6 +16,7 @@ export interface Props {
|
|
|
15
16
|
popupsMountPoint?: HTMLElement;
|
|
16
17
|
popupsBoundariesElement?: HTMLElement;
|
|
17
18
|
popupsScrollableElement?: HTMLElement;
|
|
19
|
+
editorView?: EditorView;
|
|
18
20
|
setBlockType: (type: string) => void;
|
|
19
21
|
}
|
|
20
22
|
export interface State {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
declare const refreshBrowserSelection: () => void;
|
|
2
3
|
declare const refreshBrowserSelectionOnChange: (transaction: Transaction, editorState: EditorState) => void;
|
|
3
4
|
export default refreshBrowserSelectionOnChange;
|
|
5
|
+
export { refreshBrowserSelection };
|
|
@@ -5,7 +5,6 @@ interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
|
|
|
5
5
|
allowAutoSave?: boolean;
|
|
6
6
|
breakoutEnabled?: boolean;
|
|
7
7
|
extensionHandlers?: ExtensionHandlers;
|
|
8
|
-
stickToolbarToBottom?: boolean;
|
|
9
8
|
appearance?: EditorAppearance;
|
|
10
9
|
}
|
|
11
10
|
declare const extensionPlugin: (options?: ExtensionPluginOptions) => EditorPlugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ButtonItemProps } from '@atlaskit/menu';
|
|
2
3
|
import { DropdownOptionT } from './types';
|
|
3
4
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
5
|
export declare const menuItemDimensions: {
|
|
@@ -12,6 +13,11 @@ export interface Props {
|
|
|
12
13
|
items: Array<DropdownOptionT<Function>>;
|
|
13
14
|
showSelected?: boolean;
|
|
14
15
|
}
|
|
16
|
+
export interface DropdownButtonItemProps extends ButtonItemProps {
|
|
17
|
+
onMouseEnter?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
18
|
+
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
19
|
+
onMouseLeave?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
20
|
+
}
|
|
15
21
|
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
16
22
|
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
17
23
|
};
|
|
@@ -15,5 +15,6 @@ export interface Props {
|
|
|
15
15
|
width?: number;
|
|
16
16
|
filterOption?: ((option: SelectOption, rawInput: string) => boolean) | null;
|
|
17
17
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
18
|
+
ariaLabel?: string;
|
|
18
19
|
}
|
|
19
20
|
export default function Search(props: Props): JSX.Element;
|
package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { BlockMenuItem } from './create-items';
|
|
4
4
|
import { OnInsert } from '../../../../ui/ElementBrowser/types';
|
|
5
|
+
declare type SimpleEventHandler<T> = (event?: T) => void;
|
|
5
6
|
export interface BlockInsertElementBrowserProps {
|
|
6
7
|
disabled: boolean;
|
|
7
8
|
editorView: EditorView;
|
|
@@ -16,6 +17,7 @@ export interface BlockInsertElementBrowserProps {
|
|
|
16
17
|
onRef(el: HTMLElement): void;
|
|
17
18
|
onClick: React.MouseEventHandler;
|
|
18
19
|
onInsert: OnInsert;
|
|
19
|
-
togglePlusMenuVisibility
|
|
20
|
+
togglePlusMenuVisibility: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
20
21
|
}
|
|
21
22
|
export declare const BlockInsertElementBrowser: React.FC<BlockInsertElementBrowserProps>;
|
|
23
|
+
export {};
|
|
@@ -20,6 +20,7 @@ export declare class ToolbarInsertBlock extends React.PureComponent<Props & Wrap
|
|
|
20
20
|
private handlePlusButtonRef;
|
|
21
21
|
private handleDropDownButtonRef;
|
|
22
22
|
render(): jsx.JSX.Element | null;
|
|
23
|
+
private handleClick;
|
|
23
24
|
private toggleLinkPanel;
|
|
24
25
|
private insertMention;
|
|
25
26
|
private insertTable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { Component } from 'react';
|
|
3
|
+
import React, { Component, MouseEvent } from 'react';
|
|
4
4
|
import { Node as PMNode } from 'prosemirror-model';
|
|
5
5
|
import { EditorView, Decoration } from 'prosemirror-view';
|
|
6
6
|
import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
@@ -27,6 +27,8 @@ export default class MediaSingleNode extends Component<MediaSingleNodeProps, Med
|
|
|
27
27
|
static defaultProps: Partial<MediaSingleNodeProps>;
|
|
28
28
|
static displayName: string;
|
|
29
29
|
state: MediaSingleNodeState;
|
|
30
|
+
mediaSingleWrapperRef: React.RefObject<HTMLDivElement>;
|
|
31
|
+
captionPlaceHolderRef: React.RefObject<HTMLSpanElement>;
|
|
30
32
|
createMediaNodeUpdater: (props: MediaSingleNodeProps) => MediaNodeUpdater;
|
|
31
33
|
UNSAFE_componentWillReceiveProps(nextProps: MediaSingleNodeProps): void;
|
|
32
34
|
setViewMediaClientConfig: (props: MediaSingleNodeProps) => Promise<void>;
|
|
@@ -34,6 +36,7 @@ export default class MediaSingleNode extends Component<MediaSingleNodeProps, Med
|
|
|
34
36
|
componentDidMount(): Promise<void>;
|
|
35
37
|
selectMediaSingle: ({ event }: CardEvent) => void;
|
|
36
38
|
updateSize: (width: number | null, layout: MediaSingleLayout) => void;
|
|
39
|
+
onMediaSingleClicked: (event: MouseEvent) => void;
|
|
37
40
|
render(): jsx.JSX.Element;
|
|
38
41
|
private clickPlaceholder;
|
|
39
42
|
private getLineLength;
|
|
@@ -14,6 +14,7 @@ import { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
|
14
14
|
import { IntlShape } from 'react-intl-next';
|
|
15
15
|
export type { MediaState, MediaProvider, MediaStateStatus };
|
|
16
16
|
export { stateKey } from './plugin-key';
|
|
17
|
+
export declare const MEDIA_CONTENT_WRAP_CLASS_NAME = "media-content-wrap";
|
|
17
18
|
export declare class MediaPluginStateImplementation implements MediaPluginState {
|
|
18
19
|
allowsUploads: boolean;
|
|
19
20
|
mediaClientConfig?: MediaClientConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
export declare const CAPTION_PLACEHOLDER_ID = "caption-placeholder";
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<{
|
|
5
5
|
onClick: () => void;
|
|
6
|
-
}
|
|
6
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
7
7
|
export default _default;
|