@atlaskit/editor-core 166.0.2 → 167.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 +46 -1
- package/CHANGELOG.md +99 -0
- package/dist/cjs/actions/index.js +26 -2
- package/dist/cjs/create-editor/ReactEditorView.js +2 -0
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +5 -2
- package/dist/cjs/keymaps/index.js +5 -1
- package/dist/cjs/labs/next/ContentComponents.js +8 -4
- package/dist/cjs/labs/next/full-page.js +14 -8
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +7 -3
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +3 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -1
- package/dist/cjs/plugins/analytics/types/enums.js +3 -0
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
- package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +0 -1
- package/dist/cjs/plugins/base/index.js +8 -17
- package/dist/cjs/plugins/base/pm-plugins/better-type-history.js +3 -12
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +71 -16
- package/dist/cjs/plugins/block-type/commands/block-type.js +32 -22
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +4 -2
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -11
- package/dist/cjs/plugins/card/styles.js +1 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/cjs/plugins/code-block/actions.js +36 -2
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +70 -1
- package/dist/cjs/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +46 -8
- package/dist/cjs/plugins/code-block/styles.js +28 -24
- package/dist/cjs/plugins/collab-edit/index.js +2 -2
- package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
- package/dist/cjs/plugins/collab-edit/styles.js +4 -2
- package/dist/cjs/plugins/collab-edit/ui/styles.js +4 -2
- package/dist/cjs/plugins/collab-edit/utils.js +1 -0
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -1
- package/dist/cjs/plugins/expand/ui/styles.js +16 -14
- package/dist/cjs/plugins/extension/commands.js +3 -2
- package/dist/cjs/plugins/extension/context-panel.js +23 -9
- package/dist/cjs/plugins/extension/plugin-factory.js +1 -4
- package/dist/cjs/plugins/extension/pm-plugins/main.js +13 -36
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +6 -4
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -1
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +7 -5
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -2
- package/dist/cjs/plugins/extension/utils.js +12 -57
- package/dist/cjs/plugins/fake-text-cursor/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/cjs/plugins/feedback-dialog/index.js +0 -1
- package/dist/cjs/plugins/find-replace/styles.js +2 -6
- package/dist/cjs/plugins/find-replace/ui/styles.js +4 -2
- package/dist/cjs/plugins/find-replace/utils/batch-decorations.js +0 -1
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -4
- package/dist/cjs/plugins/floating-toolbar/ui/styles.js +12 -10
- package/dist/cjs/plugins/grid/styles.js +3 -1
- package/dist/cjs/plugins/help-dialog/ui/styles.js +9 -7
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +23 -1
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +10 -1
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -5
- package/dist/cjs/plugins/hyperlink/utils.js +53 -2
- package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +4 -2
- package/dist/cjs/plugins/layout/styles.js +1 -1
- package/dist/cjs/plugins/macro/actions.js +2 -2
- package/dist/cjs/plugins/media/commands/helpers.js +10 -9
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +25 -6
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -0
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -3
- package/dist/cjs/plugins/media/pm-plugins/main.js +1 -0
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
- package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +4 -2
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/mentions/styles.js +3 -1
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
- package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +4 -2
- package/dist/cjs/plugins/panel/index.js +1 -0
- package/dist/cjs/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +21 -3
- package/dist/cjs/plugins/paste/handlers.js +44 -6
- package/dist/cjs/plugins/paste/linkify-md-plugin.js +7 -0
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +9 -1
- package/dist/cjs/plugins/paste/pm-plugins/main.js +27 -1
- package/dist/cjs/plugins/placeholder/index.js +15 -3
- package/dist/cjs/plugins/placeholder/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/cjs/plugins/status/ui/statusPicker.js +3 -3
- package/dist/cjs/plugins/table/index.js +14 -4
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/cjs/plugins/table/nodeviews/table.js +9 -4
- package/dist/cjs/plugins/table/pm-plugins/main.js +1 -4
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +118 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/cjs/plugins/table/transforms/column-width.js +1 -2
- package/dist/cjs/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +4 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +3 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +4 -2
- package/dist/cjs/plugins/table/ui/consts.js +14 -11
- package/dist/cjs/plugins/table/ui/ui-styles.js +17 -10
- package/dist/cjs/plugins/table/utils/decoration.js +3 -4
- package/dist/cjs/plugins/table/utils/paste.js +9 -9
- package/dist/cjs/plugins/type-ahead/index.js +4 -3
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +3 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +11 -9
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +73 -3
- package/dist/cjs/plugins/unsupported-content/styles.js +1 -1
- package/dist/cjs/ui/Addon/Dropdown/styles.js +3 -1
- package/dist/cjs/ui/Addon/DropdownItem/styles.js +3 -1
- package/dist/cjs/ui/Appearance/Chromeless.js +2 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -3
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +4 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +5 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +6 -3
- package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +23 -16
- package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Header.js +4 -2
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +4 -8
- package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +4 -2
- package/dist/cjs/ui/ContextPanel/index.js +3 -1
- package/dist/cjs/ui/DropdownMenu/index.js +5 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +6 -4
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +4 -2
- package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +4 -2
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
- package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +3 -1
- package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +3 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +3 -1
- package/dist/cjs/ui/FloatingToolbar/styles.js +2 -2
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +5 -3
- package/dist/cjs/ui/PanelTextInput/styles.js +3 -1
- package/dist/cjs/ui/PluginSlot/index.js +7 -4
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -2
- package/dist/cjs/ui/ToolbarFeedback/styles.js +5 -3
- package/dist/cjs/ui/WithFlash/index.js +4 -2
- package/dist/cjs/ui/styles.js +6 -4
- package/dist/cjs/utils/document.js +62 -6
- package/dist/cjs/utils/filter/privacy-filter.js +2 -2
- package/dist/cjs/utils/step.js +17 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +25 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -0
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +5 -2
- package/dist/es2019/keymaps/index.js +5 -1
- package/dist/es2019/labs/next/ContentComponents.js +7 -2
- package/dist/es2019/labs/next/full-page.js +11 -8
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +4 -3
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +16 -4
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
- package/dist/es2019/plugins/analytics/types/enums.js +3 -0
- package/dist/es2019/plugins/base/index.js +6 -15
- package/dist/es2019/plugins/base/pm-plugins/better-type-history.js +1 -11
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
- package/dist/es2019/plugins/block-type/commands/block-type.js +25 -16
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +6 -10
- package/dist/es2019/plugins/card/styles.js +1 -1
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/es2019/plugins/code-block/actions.js +32 -0
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +61 -1
- package/dist/es2019/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +37 -3
- package/dist/es2019/plugins/code-block/styles.js +30 -27
- package/dist/es2019/plugins/collab-edit/styles.js +3 -2
- package/dist/es2019/plugins/collab-edit/ui/styles.js +4 -3
- package/dist/es2019/plugins/collab-edit/utils.js +1 -0
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
- package/dist/es2019/plugins/expand/ui/styles.js +15 -14
- package/dist/es2019/plugins/extension/commands.js +3 -2
- package/dist/es2019/plugins/extension/context-panel.js +11 -3
- package/dist/es2019/plugins/extension/plugin-factory.js +1 -3
- package/dist/es2019/plugins/extension/pm-plugins/main.js +12 -38
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +5 -4
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +7 -6
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -4
- package/dist/es2019/plugins/extension/utils.js +2 -37
- package/dist/es2019/plugins/fake-text-cursor/styles.js +3 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/es2019/plugins/find-replace/styles.js +4 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Separator.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
- package/dist/es2019/plugins/floating-toolbar/ui/styles.js +11 -10
- package/dist/es2019/plugins/grid/styles.js +4 -2
- package/dist/es2019/plugins/help-dialog/ui/styles.js +10 -9
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +9 -1
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -4
- package/dist/es2019/plugins/hyperlink/utils.js +43 -2
- package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
- package/dist/es2019/plugins/layout/styles.js +10 -7
- package/dist/es2019/plugins/media/commands/helpers.js +6 -8
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +21 -5
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -4
- package/dist/es2019/plugins/media/pm-plugins/main.js +2 -0
- package/dist/es2019/plugins/media/styles.js +3 -3
- package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
- package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +4 -3
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -1
- package/dist/es2019/plugins/mentions/styles.js +5 -4
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +3 -2
- package/dist/es2019/plugins/panel/index.js +1 -0
- package/dist/es2019/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +22 -4
- package/dist/es2019/plugins/paste/handlers.js +45 -7
- package/dist/es2019/plugins/paste/linkify-md-plugin.js +7 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +4 -1
- package/dist/es2019/plugins/paste/pm-plugins/main.js +27 -2
- package/dist/es2019/plugins/placeholder/index.js +12 -1
- package/dist/es2019/plugins/placeholder/styles.js +3 -1
- package/dist/es2019/plugins/placeholder-text/styles.js +5 -4
- package/dist/es2019/plugins/selection/gap-cursor/styles.js +9 -9
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/es2019/plugins/status/ui/statusPicker.js +3 -3
- package/dist/es2019/plugins/table/index.js +13 -4
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/es2019/plugins/table/nodeviews/table.js +6 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +1 -4
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +106 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +3 -7
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/es2019/plugins/table/transforms/column-width.js +1 -2
- package/dist/es2019/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +4 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +4 -3
- package/dist/es2019/plugins/table/ui/common-styles.js +29 -27
- package/dist/es2019/plugins/table/ui/consts.js +15 -12
- package/dist/es2019/plugins/table/ui/ui-styles.js +28 -23
- package/dist/es2019/plugins/table/utils/decoration.js +1 -4
- package/dist/es2019/plugins/table/utils/paste.js +9 -9
- package/dist/es2019/plugins/type-ahead/index.js +4 -3
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +64 -6
- package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
- package/dist/es2019/ui/Addon/Dropdown/styles.js +3 -2
- package/dist/es2019/ui/Addon/DropdownItem/styles.js +3 -2
- package/dist/es2019/ui/Appearance/Chromeless.js +2 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +9 -4
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +4 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +6 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -3
- package/dist/es2019/ui/ChromeCollapsed/styles.js +4 -3
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +10 -2
- package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
- package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Header.js +3 -2
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +4 -3
- package/dist/es2019/ui/ContentStyles/index.js +3 -2
- package/dist/es2019/ui/ContextPanel/index.js +2 -1
- package/dist/es2019/ui/DropdownMenu/index.js +5 -0
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +6 -3
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +3 -2
- package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +3 -2
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
- package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
- package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
- package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +2 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +3 -1
- package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +4 -3
- package/dist/es2019/ui/PanelTextInput/styles.js +5 -5
- package/dist/es2019/ui/PluginSlot/index.js +7 -4
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
- package/dist/es2019/ui/ToolbarFeedback/styles.js +5 -4
- package/dist/es2019/ui/WithFlash/index.js +4 -3
- package/dist/es2019/ui/styles.js +10 -9
- package/dist/es2019/utils/document.js +58 -5
- package/dist/es2019/utils/filter/privacy-filter.js +1 -1
- package/dist/es2019/utils/step.js +12 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +27 -2
- package/dist/esm/create-editor/ErrorBoundary.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -0
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +6 -4
- package/dist/esm/keymaps/index.js +5 -1
- package/dist/esm/labs/next/ContentComponents.js +8 -4
- package/dist/esm/labs/next/full-page.js +11 -8
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +4 -3
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +3 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
- package/dist/esm/plugins/analytics/types/enums.js +3 -0
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
- package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +0 -1
- package/dist/esm/plugins/base/index.js +8 -17
- package/dist/esm/plugins/base/pm-plugins/better-type-history.js +1 -11
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
- package/dist/esm/plugins/block-type/commands/block-type.js +31 -22
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -5
- package/dist/esm/plugins/card/styles.js +1 -1
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/esm/plugins/code-block/actions.js +28 -0
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +67 -1
- package/dist/esm/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/esm/plugins/code-block/pm-plugins/main.js +39 -3
- package/dist/esm/plugins/code-block/styles.js +27 -23
- package/dist/esm/plugins/collab-edit/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/esm/plugins/collab-edit/styles.js +3 -2
- package/dist/esm/plugins/collab-edit/ui/styles.js +3 -2
- package/dist/esm/plugins/collab-edit/utils.js +2 -0
- package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
- package/dist/esm/plugins/custom-autoformat/index.js +1 -1
- package/dist/esm/plugins/date/ui/DatePicker/index.js +2 -1
- package/dist/esm/plugins/expand/ui/styles.js +15 -14
- package/dist/esm/plugins/extension/actions.js +1 -1
- package/dist/esm/plugins/extension/commands.js +3 -2
- package/dist/esm/plugins/extension/context-panel.js +22 -8
- package/dist/esm/plugins/extension/plugin-factory.js +1 -3
- package/dist/esm/plugins/extension/pm-plugins/main.js +12 -35
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -4
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
- package/dist/esm/plugins/extension/ui/Extension/styles.js +6 -5
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +3 -2
- package/dist/esm/plugins/extension/utils.js +9 -51
- package/dist/esm/plugins/fake-text-cursor/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/esm/plugins/feedback-dialog/index.js +1 -2
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
- package/dist/esm/plugins/find-replace/styles.js +3 -3
- package/dist/esm/plugins/find-replace/ui/styles.js +3 -2
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -2
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/Separator.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -4
- package/dist/esm/plugins/floating-toolbar/ui/styles.js +11 -10
- package/dist/esm/plugins/grid/styles.js +2 -1
- package/dist/esm/plugins/help-dialog/ui/styles.js +8 -7
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +9 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -5
- package/dist/esm/plugins/hyperlink/utils.js +44 -2
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +3 -2
- package/dist/esm/plugins/layout/styles.js +1 -1
- package/dist/esm/plugins/macro/actions.js +1 -1
- package/dist/esm/plugins/media/commands/helpers.js +6 -8
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +23 -6
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +8 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/picker-facade.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -3
- package/dist/esm/plugins/media/pm-plugins/main.js +3 -1
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/toolbar/utils.js +1 -1
- package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
- package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +3 -2
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -1
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
- package/dist/esm/plugins/mentions/styles.js +2 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +3 -2
- package/dist/esm/plugins/panel/index.js +1 -0
- package/dist/esm/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +22 -4
- package/dist/esm/plugins/paste/handlers.js +44 -8
- package/dist/esm/plugins/paste/linkify-md-plugin.js +7 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +28 -3
- package/dist/esm/plugins/placeholder/index.js +12 -1
- package/dist/esm/plugins/placeholder/styles.js +2 -1
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/quick-insert/index.js +1 -1
- package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
- package/dist/esm/plugins/table/index.js +13 -4
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/esm/plugins/table/nodeviews/table.js +6 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +1 -4
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +102 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/esm/plugins/table/transforms/column-width.js +1 -2
- package/dist/esm/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +3 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +2 -1
- package/dist/esm/plugins/table/ui/common-styles.js +4 -2
- package/dist/esm/plugins/table/ui/consts.js +15 -12
- package/dist/esm/plugins/table/ui/ui-styles.js +15 -10
- package/dist/esm/plugins/table/utils/decoration.js +3 -4
- package/dist/esm/plugins/table/utils/paste.js +9 -9
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
- package/dist/esm/plugins/type-ahead/index.js +4 -3
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +71 -5
- package/dist/esm/plugins/unsupported-content/styles.js +1 -1
- package/dist/esm/ui/Addon/Dropdown/styles.js +2 -1
- package/dist/esm/ui/Addon/DropdownItem/styles.js +2 -1
- package/dist/esm/ui/Appearance/Chromeless.js +2 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +10 -3
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +6 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +5 -3
- package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +22 -15
- package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
- package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
- package/dist/esm/ui/ConfigPanel/Header.js +3 -2
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -2
- package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +3 -2
- package/dist/esm/ui/ContextPanel/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +5 -0
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -4
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +3 -2
- package/dist/esm/ui/ElementBrowser/components/CategoryList.js +3 -2
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +11 -5
- package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
- package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
- package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +2 -1
- package/dist/esm/ui/ElementBrowser/constants.js +3 -1
- package/dist/esm/ui/FloatingToolbar/styles.js +3 -3
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +4 -3
- package/dist/esm/ui/LinkSearch/index.js +1 -1
- package/dist/esm/ui/PanelTextInput/styles.js +4 -3
- package/dist/esm/ui/PluginSlot/index.js +7 -4
- package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/styles.js +4 -3
- package/dist/esm/ui/WithFlash/index.js +3 -2
- package/dist/esm/ui/styles.js +5 -4
- package/dist/esm/utils/action.js +1 -1
- package/dist/esm/utils/clipboard.js +1 -1
- package/dist/esm/utils/document.js +59 -5
- package/dist/esm/utils/extensions.js +1 -1
- package/dist/esm/utils/filter/privacy-filter.js +1 -1
- package/dist/esm/utils/step.js +12 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +6 -0
- package/dist/types/labs/next/ContentComponents.d.ts +7 -1
- package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +1 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +3 -0
- package/dist/types/plugins/analytics/types/general-events.d.ts +7 -1
- package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +1 -1
- package/dist/types/plugins/code-block/actions.d.ts +2 -0
- package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +2 -0
- package/dist/types/plugins/code-block/pm-plugins/actions.d.ts +1 -0
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +1 -0
- package/dist/types/plugins/extension/commands.d.ts +1 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +1 -2
- package/dist/types/plugins/extension/types.d.ts +1 -1
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types/plugins/extension/utils.d.ts +1 -3
- package/dist/types/plugins/find-replace/styles.d.ts +0 -2
- package/dist/types/plugins/hyperlink/utils.d.ts +8 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/media/pm-plugins/types.d.ts +2 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -0
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/index.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
- package/dist/types/plugins/table/types.d.ts +0 -1
- package/dist/types/plugins/table/ui/consts.d.ts +9 -9
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +2 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +4 -4
- package/dist/types/types/editor-appearance-component.d.ts +0 -1
- package/dist/types/types/editor-props.d.ts +4 -0
- package/dist/types/types/feature-flags.d.ts +8 -0
- package/dist/types/types/ui-components.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -2
- package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -2
- package/dist/types/ui/PluginSlot/index.d.ts +1 -0
- package/dist/types/ui/Toolbar/toolbar-types.d.ts +1 -0
- package/dist/types/utils/document.d.ts +1 -0
- package/dist/types/utils/step.d.ts +1 -0
- package/docs/0-intro.tsx +12 -4
- package/package.json +22 -22
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.createPasteAnalyticsPayload = createPasteAnalyticsPayload;
|
|
9
9
|
exports.createPasteMeasurePayload = void 0;
|
|
10
10
|
exports.getContent = getContent;
|
|
11
|
-
exports.handleSelectedTableWithAnalytics = exports.handleRichTextWithAnalytics = exports.handlePastePreservingMarksWithAnalytics = exports.handlePasteLinkOnSelectedTextWithAnalytics = exports.handlePasteIntoTaskAndDecisionWithAnalytics = exports.handlePasteAsPlainTextWithAnalytics = exports.handleMediaSingleWithAnalytics = exports.handleMarkdownWithAnalytics = exports.handleExpandWithAnalytics = exports.handleCodeBlockWithAnalytics = exports.getContentNodeTypes = void 0;
|
|
11
|
+
exports.handleSelectedTableWithAnalytics = exports.handleRichTextWithAnalytics = exports.handlePastePreservingMarksWithAnalytics = exports.handlePasteLinkOnSelectedTextWithAnalytics = exports.handlePasteIntoTaskAndDecisionWithAnalytics = exports.handlePasteIntoCaptionWithAnalytics = exports.handlePasteAsPlainTextWithAnalytics = exports.handleMediaSingleWithAnalytics = exports.handleMarkdownWithAnalytics = exports.handleExpandWithAnalytics = exports.handleCodeBlockWithAnalytics = exports.getContentNodeTypes = void 0;
|
|
12
12
|
exports.pasteCommandWithAnalytics = pasteCommandWithAnalytics;
|
|
13
13
|
exports.sendPasteAnalyticsEvent = sendPasteAnalyticsEvent;
|
|
14
14
|
|
|
@@ -254,6 +254,14 @@ var handlePasteIntoTaskAndDecisionWithAnalytics = function handlePasteIntoTaskAn
|
|
|
254
254
|
|
|
255
255
|
exports.handlePasteIntoTaskAndDecisionWithAnalytics = handlePasteIntoTaskAndDecisionWithAnalytics;
|
|
256
256
|
|
|
257
|
+
var handlePasteIntoCaptionWithAnalytics = function handlePasteIntoCaptionWithAnalytics(view, event, slice, type) {
|
|
258
|
+
return (0, _utils.pipe)(_handlers.handlePasteIntoCaption, pasteCommandWithAnalytics(view, event, slice, {
|
|
259
|
+
type: type
|
|
260
|
+
}))(slice);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
exports.handlePasteIntoCaptionWithAnalytics = handlePasteIntoCaptionWithAnalytics;
|
|
264
|
+
|
|
257
265
|
var handleCodeBlockWithAnalytics = function handleCodeBlockWithAnalytics(view, event, slice, text) {
|
|
258
266
|
return (0, _utils.pipe)(_handlers.handleCodeBlock, pasteCommandWithAnalytics(view, event, slice, {
|
|
259
267
|
type: _analytics.PasteTypes.plain
|
|
@@ -74,6 +74,8 @@ var _tinyMCE = require("../util/tinyMCE");
|
|
|
74
74
|
|
|
75
75
|
var _utils9 = require("@atlaskit/editor-tables/utils");
|
|
76
76
|
|
|
77
|
+
var _step = require("../../../utils/step");
|
|
78
|
+
|
|
77
79
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
78
80
|
|
|
79
81
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -238,8 +240,25 @@ function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinkificatio
|
|
|
238
240
|
// don't add closeHistory call if we're pasting a text inside placeholder text as we want the whole action
|
|
239
241
|
// to be atomic
|
|
240
242
|
var placeholder = state.schema.nodes.placeholder;
|
|
243
|
+
var isPastingTextInsidePlaceholderText = ((_state$doc$resolve$no = state.doc.resolve(state.selection.$anchor.pos).nodeAfter) === null || _state$doc$resolve$no === void 0 ? void 0 : _state$doc$resolve$no.type) === placeholder; // don't add closeHistory call if we're pasting a table, as some tables may involve additional
|
|
244
|
+
// appendedTransactions to repair them (if they're partial or incomplete) and we don't want
|
|
245
|
+
// to split those repairing transactions in prosemirror-history when they're being added to the
|
|
246
|
+
// "done" stack
|
|
247
|
+
|
|
248
|
+
var isPastingTable = tr.steps.some(function (step) {
|
|
249
|
+
var _slice$content;
|
|
250
|
+
|
|
251
|
+
var slice = (0, _step.extractSliceFromStep)(step);
|
|
252
|
+
var tableExists = false;
|
|
253
|
+
slice === null || slice === void 0 ? void 0 : (_slice$content = slice.content) === null || _slice$content === void 0 ? void 0 : _slice$content.forEach(function (node) {
|
|
254
|
+
if (node.type === state.schema.nodes.table) {
|
|
255
|
+
tableExists = true;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
return tableExists;
|
|
259
|
+
});
|
|
241
260
|
|
|
242
|
-
if (
|
|
261
|
+
if (!isPastingTextInsidePlaceholderText && !isPastingTable) {
|
|
243
262
|
tr.setMeta(_betterTypeHistory.pluginKey, true);
|
|
244
263
|
}
|
|
245
264
|
|
|
@@ -362,6 +381,13 @@ function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinkificatio
|
|
|
362
381
|
|
|
363
382
|
if (!(0, _utils4.insideTable)(state)) {
|
|
364
383
|
slice = (0, _utils2.transformSliceNestedExpandToExpand)(slice, state.schema);
|
|
384
|
+
} // Create a custom handler to avoid handling with handleRichText method
|
|
385
|
+
// As SafeInsert is used inside handleRichText which caused some bad UX like this:
|
|
386
|
+
// https://product-fabric.atlassian.net/browse/MEX-1520
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
if ((0, _analytics.handlePasteIntoCaptionWithAnalytics)(view, event, slice, _analytics2.PasteTypes.richText)(state, dispatch)) {
|
|
390
|
+
return true;
|
|
365
391
|
}
|
|
366
392
|
|
|
367
393
|
return (0, _analytics.handleRichTextWithAnalytics)(view, event, slice)(state, dispatch);
|
|
@@ -9,6 +9,8 @@ exports.pluginKey = exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
11
|
|
|
12
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
+
|
|
12
14
|
var _prosemirrorState = require("prosemirror-state");
|
|
13
15
|
|
|
14
16
|
var _prosemirrorView = require("prosemirror-view");
|
|
@@ -21,7 +23,7 @@ var _styles = require("./styles");
|
|
|
21
23
|
|
|
22
24
|
var _focusHandler = require("../base/pm-plugins/focus-handler");
|
|
23
25
|
|
|
24
|
-
var
|
|
26
|
+
var _utils2 = require("../type-ahead/utils");
|
|
25
27
|
|
|
26
28
|
var pluginKey = new _prosemirrorState.PluginKey('placeholderPlugin');
|
|
27
29
|
exports.pluginKey = pluginKey;
|
|
@@ -46,7 +48,17 @@ function createPlaceholderDecoration(editorState, placeholderText) {
|
|
|
46
48
|
placeholderDecoration.className = placeHolderClass;
|
|
47
49
|
var placeholderNode = document.createElement('span');
|
|
48
50
|
placeholderNode.textContent = placeholderText;
|
|
49
|
-
placeholderDecoration.appendChild(placeholderNode);
|
|
51
|
+
placeholderDecoration.appendChild(placeholderNode); // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
|
|
52
|
+
// Add a editable buff node as the cursor moving forward is inevitable
|
|
53
|
+
// when backspace in GBoard composition
|
|
54
|
+
|
|
55
|
+
if (_utils.browser.android && _utils.browser.chrome) {
|
|
56
|
+
var buffNode = document.createElement('span');
|
|
57
|
+
buffNode.setAttribute('contenteditable', 'true');
|
|
58
|
+
buffNode.textContent = ' ';
|
|
59
|
+
placeholderDecoration.appendChild(buffNode);
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
return _prosemirrorView.DecorationSet.create(editorState.doc, [_prosemirrorView.Decoration.widget(pos, placeholderDecoration, {
|
|
51
63
|
side: -1,
|
|
52
64
|
key: 'placeholder'
|
|
@@ -68,7 +80,7 @@ var emptyPlaceholder = {
|
|
|
68
80
|
function createPlaceHolderStateFrom(editorState, getPlaceholderHintMessage, defaultPlaceholderText, bracketPlaceholderText) {
|
|
69
81
|
var isEditorFocused = _focusHandler.focusStateKey.getState(editorState);
|
|
70
82
|
|
|
71
|
-
if ((0,
|
|
83
|
+
if ((0, _utils2.isTypeAheadOpen)(editorState)) {
|
|
72
84
|
return emptyPlaceholder;
|
|
73
85
|
}
|
|
74
86
|
|
|
@@ -13,9 +13,11 @@ var _react = require("@emotion/react");
|
|
|
13
13
|
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
|
|
16
|
+
var _tokens = require("@atlaskit/tokens");
|
|
17
|
+
|
|
16
18
|
var _templateObject;
|
|
17
19
|
|
|
18
20
|
var placeHolderClassName = 'placeholder-decoration';
|
|
19
21
|
exports.placeHolderClassName = placeHolderClassName;
|
|
20
|
-
var placeholderStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .", " {\n position: relative;\n color: ", ";\n width: 100%;\n\n pointer-events: none;\n display: block;\n user-select: none;\n\n > span {\n position: absolute;\n pointer-events: none;\n }\n\n &.align-end > span {\n right: 0;\n }\n\n &.align-center > span {\n left: 0;\n }\n }\n"])), placeHolderClassName, _colors.N200);
|
|
22
|
+
var placeholderStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .", " {\n position: relative;\n color: ", ";\n width: 100%;\n\n pointer-events: none;\n display: block;\n user-select: none;\n\n > span {\n position: absolute;\n pointer-events: none;\n outline: none;\n }\n\n &.align-end > span {\n right: 0;\n }\n\n &.align-center > span {\n left: 0;\n }\n }\n"])), placeHolderClassName, (0, _tokens.token)('color.text.subtlest', _colors.N200));
|
|
21
23
|
exports.placeholderStyles = placeholderStyles;
|
|
@@ -15,7 +15,9 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
15
15
|
|
|
16
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
17
|
|
|
18
|
+
var _tokens = require("@atlaskit/tokens");
|
|
19
|
+
|
|
18
20
|
var _templateObject;
|
|
19
21
|
|
|
20
|
-
var placeholderTextStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror span[data-placeholder] {\n color: ", ";\n display: inline;\n }\n\n .ProseMirror span.pm-placeholder {\n display: inline;\n color: ", ";\n }\n .ProseMirror span.pm-placeholder__text {\n display: inline;\n color: ", ";\n }\n\n .ProseMirror span.pm-placeholder.", " {\n ", "\n }\n\n .ProseMirror span.pm-placeholder__text[data-placeholder]::after {\n color: ", ";\n cursor: text;\n content: attr(data-placeholder);\n display: inline;\n }\n"])), _colors.N300, _colors.N300, _colors.N300, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Background]), _colors.N300);
|
|
22
|
+
var placeholderTextStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror span[data-placeholder] {\n color: ", ";\n display: inline;\n }\n\n .ProseMirror span.pm-placeholder {\n display: inline;\n color: ", ";\n }\n .ProseMirror span.pm-placeholder__text {\n display: inline;\n color: ", ";\n }\n\n .ProseMirror span.pm-placeholder.", " {\n ", "\n }\n\n .ProseMirror span.pm-placeholder__text[data-placeholder]::after {\n color: ", ";\n cursor: text;\n content: attr(data-placeholder);\n display: inline;\n }\n"])), (0, _tokens.token)('color.text.subtlest', _colors.N300), (0, _tokens.token)('color.text.subtlest', _colors.N300), (0, _tokens.token)('color.text.subtlest', _colors.N300), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Background]), (0, _tokens.token)('color.text.subtlest', _colors.N300));
|
|
21
23
|
exports.placeholderTextStyles = placeholderTextStyles;
|
|
@@ -20,5 +20,5 @@ var gapCursor = '.ProseMirror-gapcursor';
|
|
|
20
20
|
var prosemirrorwidget = '.ProseMirror-widget';
|
|
21
21
|
var wrapLeft = '[layout="wrap-left"]';
|
|
22
22
|
var wrapRight = '[layout="wrap-right"]';
|
|
23
|
-
var gapCursorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* =============== GAP CURSOR ================== */\n .ProseMirror {\n &.", " {\n caret-color: transparent;\n }\n\n ", " {\n display: none;\n pointer-events: none;\n position: relative;\n\n & span {\n caret-color: transparent;\n position: absolute;\n height: 100%;\n width: 100%;\n display: block;\n }\n\n & span::after {\n animation: 1s ", " step-end infinite;\n border-left: 1px solid;\n content: '';\n display: block;\n position: absolute;\n top: 0;\n height: 100%;\n }\n &.-left span::after {\n left: -3px;\n }\n &.-right span::after {\n right: -3px;\n }\n & span[layout='full-width'],\n & span[layout='wide'] {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n &", " {\n float: right;\n }\n\n /* fix vertical
|
|
23
|
+
var gapCursorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* =============== GAP CURSOR ================== */\n .ProseMirror {\n &.", " {\n caret-color: transparent;\n }\n\n ", " {\n display: none;\n pointer-events: none;\n position: relative;\n\n & span {\n caret-color: transparent;\n position: absolute;\n height: 100%;\n width: 100%;\n display: block;\n }\n\n & span::after {\n animation: 1s ", " step-end infinite;\n border-left: 1px solid;\n content: '';\n display: block;\n position: absolute;\n top: 0;\n height: 100%;\n }\n &.-left span::after {\n left: -3px;\n }\n &.-right span::after {\n right: -3px;\n }\n & span[layout='full-width'],\n & span[layout='wide'] {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n &", " {\n float: right;\n }\n\n /* fix vertical alignment of gap cursor */\n &:first-of-type + ul,\n &:first-of-type + span + ul,\n &:first-of-type + ol,\n &:first-of-type + span + ol,\n &:first-of-type + pre,\n &:first-of-type + span + pre,\n &:first-of-type + blockquote,\n &:first-of-type + span + blockquote {\n margin-top: 0;\n }\n }\n &.ProseMirror-focused ", " {\n display: block;\n border-color: transparent;\n }\n }\n\n /* This hack below is for two images aligned side by side */\n ", "", " + span + ", ",\n ", "", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " {\n clear: none;\n }\n\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div {\n margin-right: 0;\n margin-left: 0;\n margin-bottom: 0;\n }\n\n ", " + ", ",\n ", " + ", " {\n float: left;\n }\n\n ", " + ", " + span + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after {\n visibility: hidden;\n display: block;\n font-size: 0;\n content: ' ';\n clear: both;\n height: 0;\n }\n\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + *,\n ", " + ", " + span + * {\n margin-top: 0;\n }\n"])), hideCaretModifier, gapCursor, gapCursorBlink, wrapRight, gapCursor, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, wrapLeft, gapCursor, wrapRight, gapCursor, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, prosemirrorwidget, gapCursor, prosemirrorwidget, gapCursor);
|
|
24
24
|
exports.gapCursorStyles = gapCursorStyles;
|
|
@@ -53,8 +53,8 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
return {
|
|
56
|
-
update: function update(view
|
|
57
|
-
var pluginState = _gapCursorPluginKey.gapCursorPluginKey.getState(state);
|
|
56
|
+
update: function update(view) {
|
|
57
|
+
var pluginState = _gapCursorPluginKey.gapCursorPluginKey.getState(view.state);
|
|
58
58
|
/**
|
|
59
59
|
* Starting with prosemirror-view 1.19.4, cursor wrapper that previousely was hiding cursor doesn't exist:
|
|
60
60
|
* https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
|
|
@@ -39,14 +39,14 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
39
39
|
|
|
40
40
|
var _colors = require("@atlaskit/theme/colors");
|
|
41
41
|
|
|
42
|
-
var _styles = require("../../../ui/styles");
|
|
43
|
-
|
|
44
42
|
var _withOuterListeners = _interopRequireDefault(require("../../../ui/with-outer-listeners"));
|
|
45
43
|
|
|
46
44
|
var _actions = require("../actions");
|
|
47
45
|
|
|
48
46
|
var _analytics = require("../analytics");
|
|
49
47
|
|
|
48
|
+
var _tokens = require("@atlaskit/tokens");
|
|
49
|
+
|
|
50
50
|
var _templateObject;
|
|
51
51
|
|
|
52
52
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -63,7 +63,7 @@ exports.InputMethod = InputMethod;
|
|
|
63
63
|
InputMethod["enterKey"] = "enterKey";
|
|
64
64
|
})(InputMethod || (exports.InputMethod = InputMethod = {}));
|
|
65
65
|
|
|
66
|
-
var pickerContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n padding: ", "px 0;\n border-radius: ", "px;\n ", ";\n input {\n text-transform: uppercase;\n }\n"])), _colors.N0, (0, _constants.gridSize)(), (0, _constants.borderRadius)(),
|
|
66
|
+
var pickerContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n padding: ", "px 0;\n border-radius: ", "px;\n box-shadow: ", ";\n input {\n text-transform: uppercase;\n }\n"])), (0, _tokens.token)('elevation.surface.overlay', _colors.N0), (0, _constants.gridSize)(), (0, _constants.borderRadius)(), (0, _tokens.token)('elevation.shadow.overlay', '0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25)'));
|
|
67
67
|
|
|
68
68
|
var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
69
69
|
(0, _inherits2.default)(StatusPickerWithoutAnalytcs, _React$Component);
|
|
@@ -33,6 +33,8 @@ var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
|
33
33
|
|
|
34
34
|
var _safariDelayedDomSelectionSyncingWorkaround = require("./pm-plugins/safari-delayed-dom-selection-syncing-workaround");
|
|
35
35
|
|
|
36
|
+
var _safariDeleteCompositionTextIssueWorkaround = require("./pm-plugins/safari-delete-composition-text-issue-workaround");
|
|
37
|
+
|
|
36
38
|
var _plugin = require("./pm-plugins/decorations/plugin");
|
|
37
39
|
|
|
38
40
|
var _keymap = require("./pm-plugins/keymap");
|
|
@@ -91,13 +93,12 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
91
93
|
eventDispatcher = _ref.eventDispatcher;
|
|
92
94
|
|
|
93
95
|
var _ref2 = options || {},
|
|
94
|
-
dynamicSizingEnabled = _ref2.dynamicSizingEnabled,
|
|
95
96
|
fullWidthEnabled = _ref2.fullWidthEnabled,
|
|
96
97
|
wasFullWidthEnabled = _ref2.wasFullWidthEnabled,
|
|
97
98
|
breakoutEnabled = _ref2.breakoutEnabled,
|
|
98
99
|
tableOptions = _ref2.tableOptions;
|
|
99
100
|
|
|
100
|
-
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), breakoutEnabled
|
|
101
|
+
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled);
|
|
101
102
|
}
|
|
102
103
|
}, {
|
|
103
104
|
name: 'tablePMColResizing',
|
|
@@ -105,7 +106,6 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
105
106
|
var dispatch = _ref3.dispatch;
|
|
106
107
|
|
|
107
108
|
var _ref4 = options || {},
|
|
108
|
-
dynamicSizingEnabled = _ref4.dynamicSizingEnabled,
|
|
109
109
|
fullWidthEnabled = _ref4.fullWidthEnabled,
|
|
110
110
|
tableOptions = _ref4.tableOptions;
|
|
111
111
|
|
|
@@ -113,7 +113,6 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
113
113
|
allowColumnResizing = _pluginConfig.allowColumnResizing;
|
|
114
114
|
|
|
115
115
|
return allowColumnResizing ? (0, _tableResizing.createPlugin)(dispatch, {
|
|
116
|
-
dynamicTextSizing: dynamicSizingEnabled && !fullWidthEnabled,
|
|
117
116
|
lastColumnResizable: !fullWidthEnabled
|
|
118
117
|
}) : undefined;
|
|
119
118
|
}
|
|
@@ -165,6 +164,17 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
165
164
|
return (0, _safariDelayedDomSelectionSyncingWorkaround.createPlugin)();
|
|
166
165
|
}
|
|
167
166
|
});
|
|
167
|
+
} // Workaround for table element breaking issue caused by composition event with an inputType of deleteCompositionText.
|
|
168
|
+
// https://github.com/ProseMirror/prosemirror/issues/934
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
if (_utils.browser.safari) {
|
|
172
|
+
plugins.push({
|
|
173
|
+
name: 'tableSafariDeleteCompositionTextIssueWorkaround',
|
|
174
|
+
plugin: function plugin() {
|
|
175
|
+
return (0, _safariDeleteCompositionTextIssueWorkaround.createPlugin)();
|
|
176
|
+
}
|
|
177
|
+
});
|
|
168
178
|
}
|
|
169
179
|
|
|
170
180
|
return plugins;
|
|
@@ -251,7 +251,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
251
251
|
view = _this$props3.view,
|
|
252
252
|
getNode = _this$props3.getNode,
|
|
253
253
|
getPos = _this$props3.getPos,
|
|
254
|
-
options = _this$props3.options,
|
|
255
254
|
containerWidth = _this$props3.containerWidth;
|
|
256
255
|
var node = getNode();
|
|
257
256
|
var pos = getPos();
|
|
@@ -261,7 +260,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
261
260
|
}
|
|
262
261
|
|
|
263
262
|
(0, _commands.autoSizeTable)(view, node, _this.table, pos, {
|
|
264
|
-
dynamicTextSizing: options && options.dynamicTextSizing || false,
|
|
265
263
|
containerWidth: containerWidth.width
|
|
266
264
|
});
|
|
267
265
|
}
|
|
@@ -344,10 +342,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
344
342
|
_this.node = _getNode();
|
|
345
343
|
_this.containerWidth = _containerWidth; // store table size using previous full-width mode so can detect if it has changed
|
|
346
344
|
|
|
347
|
-
var dynamicTextSizing = _options ? _options.dynamicTextSizing : false;
|
|
348
345
|
var isFullWidthModeEnabled = _options ? _options.wasFullWidthModeEnabled : false;
|
|
349
346
|
_this.layoutSize = _this.tableNodeLayoutSize(_this.node, _containerWidth.width, {
|
|
350
|
-
dynamicTextSizing: dynamicTextSizing,
|
|
351
347
|
isFullWidthModeEnabled: isFullWidthModeEnabled
|
|
352
348
|
}); // Disable inline table editing and resizing controls in Firefox
|
|
353
349
|
// https://github.com/ProseMirror/prosemirror/issues/432
|
|
@@ -432,7 +428,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
432
428
|
value: function componentDidUpdate(prevProps) {
|
|
433
429
|
var _this$props8 = this.props,
|
|
434
430
|
view = _this$props8.view,
|
|
435
|
-
getNode = _this$props8.getNode
|
|
431
|
+
getNode = _this$props8.getNode,
|
|
432
|
+
isMediaFullscreen = _this$props8.isMediaFullscreen,
|
|
433
|
+
allowColumnResizing = _this$props8.allowColumnResizing;
|
|
436
434
|
|
|
437
435
|
var _ref4 = (0, _featureFlagsContext.getFeatureFlags)(view.state) || {},
|
|
438
436
|
tableOverflowShadowsOptimization = _ref4.tableOverflowShadowsOptimization;
|
|
@@ -458,7 +456,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
458
456
|
if (currentTable.attrs.__autoSize) {
|
|
459
457
|
// Wait for next tick to handle auto sizing, gives the browser time to do layout calc etc.
|
|
460
458
|
this.handleAutoSizeDebounced();
|
|
461
|
-
}
|
|
459
|
+
} // re-drawing will cause media component get unmounted that will exit fullscreen mode if media is in fullscreen mode
|
|
460
|
+
// see https://product-fabric.atlassian.net/browse/MEX-1290
|
|
461
|
+
else if (allowColumnResizing && this.table && !isMediaFullscreen) {
|
|
462
462
|
// If col widths (e.g. via collab) or number of columns (e.g. delete a column) have changed,
|
|
463
463
|
// re-draw colgroup.
|
|
464
464
|
var previousTable = this.node;
|
|
@@ -31,6 +31,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
31
31
|
|
|
32
32
|
var _prosemirrorModel = require("prosemirror-model");
|
|
33
33
|
|
|
34
|
+
var _pluginKey = require("../../../plugins/media/pm-plugins/plugin-key");
|
|
35
|
+
|
|
34
36
|
var _ReactNodeView2 = _interopRequireDefault(require("../../../nodeviews/ReactNodeView"));
|
|
35
37
|
|
|
36
38
|
var _WithPluginState = _interopRequireDefault(require("../../../ui/WithPluginState"));
|
|
@@ -41,7 +43,7 @@ var _createPluginConfig = require("../create-plugin-config");
|
|
|
41
43
|
|
|
42
44
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
43
45
|
|
|
44
|
-
var
|
|
46
|
+
var _pluginKey2 = require("../pm-plugins/plugin-key");
|
|
45
47
|
|
|
46
48
|
var _tableResizing = require("../pm-plugins/table-resizing");
|
|
47
49
|
|
|
@@ -131,20 +133,23 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
131
133
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
132
134
|
plugins: {
|
|
133
135
|
containerWidth: _width.pluginKey,
|
|
134
|
-
pluginState:
|
|
135
|
-
tableResizingPluginState: _tableResizing.pluginKey
|
|
136
|
+
pluginState: _pluginKey2.pluginKey,
|
|
137
|
+
tableResizingPluginState: _tableResizing.pluginKey,
|
|
138
|
+
mediaState: _pluginKey.stateKey
|
|
136
139
|
},
|
|
137
140
|
editorView: props.view,
|
|
138
141
|
render: function render(pluginStates) {
|
|
139
142
|
var tableResizingPluginState = pluginStates.tableResizingPluginState,
|
|
140
143
|
pluginState = pluginStates.pluginState,
|
|
141
|
-
containerWidth = pluginStates.containerWidth
|
|
144
|
+
containerWidth = pluginStates.containerWidth,
|
|
145
|
+
mediaState = pluginStates.mediaState;
|
|
142
146
|
var tableActive = props.getPos() === pluginState.tablePos;
|
|
143
147
|
return /*#__PURE__*/_react.default.createElement(_TableComponent.default, {
|
|
144
148
|
view: props.view,
|
|
145
149
|
allowColumnResizing: props.allowColumnResizing,
|
|
146
150
|
eventDispatcher: props.eventDispatcher,
|
|
147
151
|
getPos: props.getPos,
|
|
152
|
+
isMediaFullscreen: mediaState === null || mediaState === void 0 ? void 0 : mediaState.isFullscreen,
|
|
148
153
|
options: props.options,
|
|
149
154
|
allowControls: pluginState.pluginConfig.allowControls,
|
|
150
155
|
isHeaderRowEnabled: pluginState.isHeaderRowEnabled,
|
|
@@ -60,15 +60,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
60
60
|
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) { (0, _defineProperty2.default)(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; }
|
|
61
61
|
|
|
62
62
|
var isBreakoutEnabled;
|
|
63
|
-
var isDynamicTextSizingEnabled;
|
|
64
63
|
var isFullWidthModeEnabled;
|
|
65
64
|
var wasFullWidthModeEnabled;
|
|
66
65
|
|
|
67
|
-
var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig,
|
|
66
|
+
var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled) {
|
|
68
67
|
var _window;
|
|
69
68
|
|
|
70
69
|
isBreakoutEnabled = breakoutEnabled;
|
|
71
|
-
isDynamicTextSizingEnabled = dynamicTextSizing;
|
|
72
70
|
isFullWidthModeEnabled = fullWidthModeEnabled;
|
|
73
71
|
wasFullWidthModeEnabled = previousFullWidthModeEnabled;
|
|
74
72
|
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread({
|
|
@@ -293,7 +291,6 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
293
291
|
table: function table(node, view, getPos) {
|
|
294
292
|
return (0, _table.createTableView)(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
295
293
|
isBreakoutEnabled: isBreakoutEnabled,
|
|
296
|
-
dynamicTextSizing: isDynamicTextSizingEnabled,
|
|
297
294
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
298
295
|
wasFullWidthModeEnabled: wasFullWidthModeEnabled
|
|
299
296
|
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.tableSafariDeleteCompositionTextIssueWorkaroundKey = exports.createPlugin = void 0;
|
|
7
|
+
|
|
8
|
+
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
|
+
|
|
10
|
+
var _prosemirrorState = require("prosemirror-state");
|
|
11
|
+
|
|
12
|
+
var _prosemirrorView = require("prosemirror-view");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Fix an issue that composition text replacement in Safari removes empty nodes during text composition text deletion.
|
|
16
|
+
* https://github.com/ProseMirror/prosemirror/issues/934
|
|
17
|
+
* We will remove this plugin when Webkit fix the problem itself.
|
|
18
|
+
*/
|
|
19
|
+
var tableSafariDeleteCompositionTextIssueWorkaroundKey = new _prosemirrorState.PluginKey('tableSafariDeleteCompositionTextIssueWorkaround');
|
|
20
|
+
exports.tableSafariDeleteCompositionTextIssueWorkaroundKey = tableSafariDeleteCompositionTextIssueWorkaroundKey;
|
|
21
|
+
|
|
22
|
+
var createPlugin = function createPlugin() {
|
|
23
|
+
return new _safePlugin.SafePlugin({
|
|
24
|
+
key: tableSafariDeleteCompositionTextIssueWorkaroundKey,
|
|
25
|
+
state: {
|
|
26
|
+
init: function init() {
|
|
27
|
+
return {
|
|
28
|
+
renderSpan: false,
|
|
29
|
+
decorations: _prosemirrorView.DecorationSet.empty
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
apply: function apply(tr, value) {
|
|
33
|
+
var renderSpan = tr.getMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey);
|
|
34
|
+
|
|
35
|
+
if (typeof renderSpan === 'undefined') {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var decorations;
|
|
40
|
+
|
|
41
|
+
if (renderSpan) {
|
|
42
|
+
// Find position of the first text node in case it has multiple text nodes created by Japanese IME
|
|
43
|
+
var $from = tr.selection.$from;
|
|
44
|
+
var pos = $from.before($from.depth);
|
|
45
|
+
|
|
46
|
+
var spanDecoration = _prosemirrorView.Decoration.widget(pos, function () {
|
|
47
|
+
var spanElement = document.createElement('span');
|
|
48
|
+
return spanElement;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
decorations = _prosemirrorView.DecorationSet.create(tr.doc, [spanDecoration]);
|
|
52
|
+
} else {
|
|
53
|
+
decorations = _prosemirrorView.DecorationSet.empty;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
renderSpan: renderSpan,
|
|
58
|
+
decorations: decorations
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
props: {
|
|
63
|
+
decorations: function decorations(state) {
|
|
64
|
+
return tableSafariDeleteCompositionTextIssueWorkaroundKey.getState(state).decorations;
|
|
65
|
+
},
|
|
66
|
+
handleDOMEvents: {
|
|
67
|
+
beforeinput: function beforeinput(view, event) {
|
|
68
|
+
if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var selection = window.getSelection();
|
|
73
|
+
|
|
74
|
+
if (!selection || selection.rangeCount <= 0 || selection.type !== 'Range') {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var range = selection.getRangeAt(0);
|
|
79
|
+
var startContainer = range.startContainer,
|
|
80
|
+
endContainer = range.endContainer,
|
|
81
|
+
endOffset = range.endOffset,
|
|
82
|
+
startOffset = range.startOffset;
|
|
83
|
+
/**
|
|
84
|
+
* On Safari when composition text is deleted, it deletes any empty elements it finds up the dom tree. Prosemirror can sometimes be confused by this
|
|
85
|
+
* and will think that we meant to delete those elements. This fix forces the resulting node to not be empty.
|
|
86
|
+
* The condition here checks to see if the entire text node is about to be swapped inside of an element
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
if (startContainer.nodeType === Node.TEXT_NODE && startContainer === endContainer && startOffset === 0 && endOffset === startContainer.length) {
|
|
90
|
+
var tr = view.state.tr;
|
|
91
|
+
tr.setMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey, true);
|
|
92
|
+
view.dispatch(tr);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return false;
|
|
96
|
+
},
|
|
97
|
+
input: function input(view, event) {
|
|
98
|
+
if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var selection = window.getSelection();
|
|
103
|
+
|
|
104
|
+
if (!selection) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var tr = view.state.tr;
|
|
109
|
+
tr.setMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey, false);
|
|
110
|
+
view.dispatch(tr);
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.createPlugin = createPlugin;
|
|
@@ -31,7 +31,7 @@ var _utils3 = require("./utils");
|
|
|
31
31
|
|
|
32
32
|
var _analytics = require("../../../analytics");
|
|
33
33
|
|
|
34
|
-
var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos
|
|
34
|
+
var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos) {
|
|
35
35
|
var state = view.state,
|
|
36
36
|
dispatch = view.dispatch;
|
|
37
37
|
|
|
@@ -59,9 +59,7 @@ var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos
|
|
|
59
59
|
var containerWidth = _width.pluginKey.getState(state);
|
|
60
60
|
|
|
61
61
|
var parentWidth = (0, _nodeWidth.getParentNodeWidth)(start, state, containerWidth);
|
|
62
|
-
var maxSize = parentWidth || (0, _utils3.getLayoutSize)(dom.getAttribute('data-layout'), containerWidth.width, {
|
|
63
|
-
dynamicTextSizing: dynamicTextSizing
|
|
64
|
-
});
|
|
62
|
+
var maxSize = parentWidth || (0, _utils3.getLayoutSize)(dom.getAttribute('data-layout'), containerWidth.width, {});
|
|
65
63
|
|
|
66
64
|
if (originalTable.attrs.isNumberColumnEnabled) {
|
|
67
65
|
maxSize -= _editorSharedStyles.akEditorTableNumberColumnWidth;
|
|
@@ -27,14 +27,11 @@ var _utils = require("./utils");
|
|
|
27
27
|
|
|
28
28
|
function createPlugin(dispatch, _ref) {
|
|
29
29
|
var _ref$lastColumnResiza = _ref.lastColumnResizable,
|
|
30
|
-
lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza
|
|
31
|
-
_ref$dynamicTextSizin = _ref.dynamicTextSizing,
|
|
32
|
-
dynamicTextSizing = _ref$dynamicTextSizin === void 0 ? false : _ref$dynamicTextSizin;
|
|
30
|
+
lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
|
|
33
31
|
return new _safePlugin.SafePlugin({
|
|
34
32
|
key: _pluginKey.pluginKey,
|
|
35
33
|
state: (0, _pluginFactory.createPluginState)(dispatch, {
|
|
36
34
|
lastColumnResizable: lastColumnResizable,
|
|
37
|
-
dynamicTextSizing: dynamicTextSizing,
|
|
38
35
|
resizeHandlePos: null,
|
|
39
36
|
dragging: null,
|
|
40
37
|
lastClick: null
|
|
@@ -58,7 +55,7 @@ function createPlugin(dispatch, _ref) {
|
|
|
58
55
|
dragging = _getPluginState.dragging;
|
|
59
56
|
|
|
60
57
|
if (resizeHandlePos !== null && !dragging) {
|
|
61
|
-
if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos
|
|
58
|
+
if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos)) {
|
|
62
59
|
var _state = view.state,
|
|
63
60
|
_dispatch = view.dispatch;
|
|
64
61
|
return (0, _commands.setResizeHandlePos)(resizeHandlePos)(_state, _dispatch);
|
|
@@ -34,8 +34,7 @@ exports.tableLayoutToSize = tableLayoutToSize;
|
|
|
34
34
|
function getLayoutSize(tableLayout) {
|
|
35
35
|
var containerWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
36
36
|
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
37
|
-
var
|
|
38
|
-
isFullWidthModeEnabled = options.isFullWidthModeEnabled;
|
|
37
|
+
var isFullWidthModeEnabled = options.isFullWidthModeEnabled;
|
|
39
38
|
|
|
40
39
|
if (isFullWidthModeEnabled) {
|
|
41
40
|
return containerWidth ? Math.min(containerWidth - _editorSharedStyles.akEditorGutterPadding * 2, _editorSharedStyles.akEditorFullWidthLayoutWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
@@ -47,7 +46,7 @@ function getLayoutSize(tableLayout) {
|
|
|
47
46
|
return parseInt(calculatedTableWidth, 10);
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
if (
|
|
49
|
+
if (tableLayout === 'default') {
|
|
51
50
|
return getDefaultLayoutMaxWidth(containerWidth);
|
|
52
51
|
}
|
|
53
52
|
|
|
@@ -102,15 +101,12 @@ var getTableMaxWidth = function getTableMaxWidth(_ref2) {
|
|
|
102
101
|
var table = _ref2.table,
|
|
103
102
|
tableStart = _ref2.tableStart,
|
|
104
103
|
state = _ref2.state,
|
|
105
|
-
layout = _ref2.layout
|
|
106
|
-
dynamicTextSizing = _ref2.dynamicTextSizing;
|
|
104
|
+
layout = _ref2.layout;
|
|
107
105
|
|
|
108
106
|
var containerWidth = _width.pluginKey.getState(state);
|
|
109
107
|
|
|
110
108
|
var parentWidth = (0, _nodeWidth.getParentNodeWidth)(tableStart, state, containerWidth);
|
|
111
|
-
var maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {
|
|
112
|
-
dynamicTextSizing: dynamicTextSizing
|
|
113
|
-
});
|
|
109
|
+
var maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
|
|
114
110
|
|
|
115
111
|
if (table.attrs.isNumberColumnEnabled) {
|
|
116
112
|
maxWidth -= _editorSharedStyles.akEditorTableNumberColumnWidth;
|
|
@@ -307,7 +307,7 @@ var normaliseTableLayout = function normaliseTableLayout(input) {
|
|
|
307
307
|
|
|
308
308
|
exports.normaliseTableLayout = normaliseTableLayout;
|
|
309
309
|
|
|
310
|
-
var getNewResizeStateFromSelectedColumns = function getNewResizeStateFromSelectedColumns(rect, state, domAtPos
|
|
310
|
+
var getNewResizeStateFromSelectedColumns = function getNewResizeStateFromSelectedColumns(rect, state, domAtPos) {
|
|
311
311
|
var _getSelectedTableInfo = (0, _utils2.getSelectedTableInfo)(state.selection),
|
|
312
312
|
totalRowCount = _getSelectedTableInfo.totalRowCount,
|
|
313
313
|
totalColumnCount = _getSelectedTableInfo.totalColumnCount,
|
|
@@ -329,8 +329,7 @@ var getNewResizeStateFromSelectedColumns = function getNewResizeStateFromSelecte
|
|
|
329
329
|
table: table.node,
|
|
330
330
|
tableStart: table.start,
|
|
331
331
|
state: state,
|
|
332
|
-
layout: layout
|
|
333
|
-
dynamicTextSizing: dynamicTextSizing
|
|
332
|
+
layout: layout
|
|
334
333
|
});
|
|
335
334
|
var resizeState = getResizeState({
|
|
336
335
|
minWidth: _styles.tableCellMinWidth,
|