@atlaskit/editor-core 166.0.3 → 167.0.1
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/insert-block/index.js +1 -1
- 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 +23 -0
- 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/text-formatting/pm-plugins/input-rule.js +1 -1
- 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/insert-block/index.js +1 -1
- 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 +23 -0
- 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/text-formatting/pm-plugins/input-rule.js +1 -1
- 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/insert-block/index.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 +22 -1
- 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/text-formatting/pm-plugins/input-rule.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
|
@@ -5,6 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
8
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
9
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
9
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
11
|
|
|
@@ -12,8 +13,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
13
|
|
|
13
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
15
|
|
|
15
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
16
|
-
|
|
17
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
17
|
|
|
19
18
|
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; }
|
|
@@ -26,12 +25,14 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
26
25
|
import { MediaInlineNodeSelector } from './styles';
|
|
27
26
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
28
27
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
28
|
+
import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
29
29
|
export var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
|
|
30
|
-
var node = props.node
|
|
30
|
+
var node = props.node;
|
|
31
31
|
return new MediaNodeUpdater(_objectSpread(_objectSpread({}, props), {}, {
|
|
32
32
|
isMediaSingle: true,
|
|
33
33
|
node: node ? node : props.node,
|
|
34
|
-
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
|
|
34
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
35
|
+
contextIdentifierProvider: props.contextIdentifierProvider
|
|
35
36
|
}));
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
@@ -98,6 +99,10 @@ export var updateMediaNodeAttributes = /*#__PURE__*/function () {
|
|
|
98
99
|
return _context.abrupt("return");
|
|
99
100
|
|
|
100
101
|
case 23:
|
|
102
|
+
_context.next = 25;
|
|
103
|
+
return mediaNodeUpdater.updateFileAttrs();
|
|
104
|
+
|
|
105
|
+
case 25:
|
|
101
106
|
case "end":
|
|
102
107
|
return _context.stop();
|
|
103
108
|
}
|
|
@@ -118,7 +123,7 @@ export var handleNewNode = function handleNewNode(props) {
|
|
|
118
123
|
});
|
|
119
124
|
};
|
|
120
125
|
export var MediaInline = function MediaInline(props) {
|
|
121
|
-
var _useState = useState(
|
|
126
|
+
var _useState = useState(),
|
|
122
127
|
_useState2 = _slicedToArray(_useState, 2),
|
|
123
128
|
viewMediaClientConfig = _useState2[0],
|
|
124
129
|
setViewMediaClientConfig = _useState2[1];
|
|
@@ -173,6 +178,18 @@ export var MediaInline = function MediaInline(props) {
|
|
|
173
178
|
mediaItemType: 'file',
|
|
174
179
|
collectionName: collection
|
|
175
180
|
};
|
|
181
|
+
/*
|
|
182
|
+
* Only show the loading view if the media provider is not ready
|
|
183
|
+
* prevents calling the media API before the provider is ready
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
if (!viewMediaClientConfig) {
|
|
187
|
+
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
188
|
+
message: "",
|
|
189
|
+
isSelected: false
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
176
193
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
177
194
|
isSelected: props.isSelected,
|
|
178
195
|
identifier: identifier,
|
|
@@ -195,13 +212,13 @@ export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
195
212
|
value: function createDomRef() {
|
|
196
213
|
var domRef = document.createElement('span');
|
|
197
214
|
domRef.contentEditable = 'false';
|
|
198
|
-
domRef.classList.add(MediaInlineNodeSelector);
|
|
199
215
|
return domRef;
|
|
200
216
|
}
|
|
201
217
|
}, {
|
|
202
218
|
key: "getContentDOM",
|
|
203
219
|
value: function getContentDOM() {
|
|
204
220
|
var dom = document.createElement('span');
|
|
221
|
+
dom.classList.add(MediaInlineNodeSelector);
|
|
205
222
|
return {
|
|
206
223
|
dom: dom
|
|
207
224
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import uuidV4 from 'uuid/v4';
|
|
7
7
|
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { getMediaClient, isMediaBlobUrl as _isMediaBlobUrl, getAttrsFromUrl, isImageRepresentationReady } from '@atlaskit/media-client';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -6,7 +7,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
|
|
@@ -92,6 +92,12 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "onFullscreenChange", function (fullscreen) {
|
|
96
|
+
_this.mediaPluginState.updateAndDispatch({
|
|
97
|
+
isFullscreen: fullscreen
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
95
101
|
_defineProperty(_assertThisInitialized(_this), "handleNewNode", function (props) {
|
|
96
102
|
var node = props.node;
|
|
97
103
|
|
|
@@ -230,6 +236,7 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
230
236
|
selectable: true,
|
|
231
237
|
selected: selected,
|
|
232
238
|
disableOverlay: true,
|
|
239
|
+
onFullscreenChange: this.onFullscreenChange,
|
|
233
240
|
onClick: this.selectMediaSingleFromCard,
|
|
234
241
|
useInlinePlayer: mediaOptions && mediaOptions.allowLazyLoading,
|
|
235
242
|
isLazy: mediaOptions && mediaOptions.allowLazyLoading,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _get from "@babel/runtime/helpers/get";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
5
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
6
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -8,7 +9,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
9
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
10
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
11
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
12
|
|
|
13
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import { isImagePreview } from '@atlaskit/media-picker';
|
|
7
7
|
|
|
8
8
|
var PickerFacade = /*#__PURE__*/function () {
|
|
@@ -31,15 +31,16 @@ import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, ACTI
|
|
|
31
31
|
import { RECENT_SEARCH_WIDTH_IN_PX } from '../../../../../ui/LinkSearch/ToolbarComponents';
|
|
32
32
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
33
33
|
import { ErrorMessage } from '@atlaskit/editor-common/ui';
|
|
34
|
+
import { token } from '@atlaskit/tokens';
|
|
34
35
|
export var CONTAINER_WIDTH_IN_PX = RECENT_SEARCH_WIDTH_IN_PX;
|
|
35
36
|
export var MAX_ALT_TEXT_LENGTH = 510; // double tweet length
|
|
36
37
|
|
|
37
|
-
var supportText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n padding: 12px 40px;\n line-height: 20px;\n border-top: 1px solid ", ";\n margin: 0;\n"])), N100, relativeFontSizeToBase16(12), N30);
|
|
38
|
+
var supportText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n padding: 12px 40px;\n line-height: 20px;\n border-top: 1px solid ", ";\n margin: 0;\n"])), token('color.text.subtlest', N100), relativeFontSizeToBase16(12), token('color.border', N30));
|
|
38
39
|
var container = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n display: flex;\n flex-direction: column;\n overflow: auto;\n line-height: 2;\n"])), CONTAINER_WIDTH_IN_PX);
|
|
39
40
|
var inputWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 5px 0;\n align-items: center;\n"])));
|
|
40
|
-
var validationWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 12px 0 40px;\n border-top: 1px solid ", ";\n align-items: start;\n flex-direction: column;\n"])), R400);
|
|
41
|
+
var validationWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 12px 0 40px;\n border-top: 1px solid ", ";\n align-items: start;\n flex-direction: column;\n"])), token('color.border.danger', R400));
|
|
41
42
|
var buttonWrapper = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n padding: 4px 8px;\n"])));
|
|
42
|
-
var clearText = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), N80);
|
|
43
|
+
var clearText = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), token('color.icon.subtle', N80));
|
|
43
44
|
export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
44
45
|
_inherits(AltTextEditComponent, _React$Component);
|
|
45
46
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -13,7 +14,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
13
14
|
|
|
14
15
|
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; }
|
|
15
16
|
|
|
16
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import ReactDOM from 'react-dom';
|
|
19
19
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -76,6 +76,8 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
76
76
|
|
|
77
77
|
_defineProperty(this, "showDropzone", false);
|
|
78
78
|
|
|
79
|
+
_defineProperty(this, "isFullscreen", false);
|
|
80
|
+
|
|
79
81
|
_defineProperty(this, "layout", 'center');
|
|
80
82
|
|
|
81
83
|
_defineProperty(this, "mediaNodes", []);
|
|
@@ -8,7 +8,7 @@ import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderB
|
|
|
8
8
|
import { N60, B200 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { fileCardImageViewSelector, fileCardImageViewSelectedSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
10
10
|
import { token } from '@atlaskit/tokens';
|
|
11
|
-
export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n .mediaGroupView-content-wrap.danger {\n /* Media inline */\n .", "::after {\n border: 1px solid ", ";\n }\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color:
|
|
11
|
+
export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n .mediaGroupView-content-wrap.danger {\n /* Media inline */\n .", "::after {\n border: 1px solid ", ";\n }\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: ", "; /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n"])), mediaSingleSharedStyle, richMediaClassName, richMediaClassName, richMediaClassName, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPadding, richMediaClassName, richMediaClassName, token('color.border', N60), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, token('color.border.focused', B200), token('color.background.danger', akEditorDeleteBackground), akEditorSelectedBorderBoldSize, token('color.border.danger', akEditorDeleteBorder), fileCardImageViewSelectedSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, fileCardImageViewSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, inlinePlayerClassName, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, newFileExperienceClassName, token('color.border.danger', akEditorDeleteIconColor), token('color.icon.danger', akEditorDeleteIconColor), token('color.blanket.danger', 'rgb(255, 189, 173, 0.5)'));
|
|
12
12
|
/* `left: unset` above is to work around Chrome bug where rendering a div with
|
|
13
13
|
* that style applied inside a container that has a scroll, causes any svgs on
|
|
14
14
|
* the page, without a border, that are inside a flexbox, to no longer align to
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
1
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
4
4
|
import { findParentNodeOfType, removeParentNodeOfType, removeSelectedNode } from 'prosemirror-utils';
|
|
5
5
|
export var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
@@ -6,8 +6,9 @@ var _templateObject;
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { N200 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
9
10
|
import { messages } from './messages';
|
|
10
|
-
var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n width: 100%;\n text-align: center;\n margin-top: 8px !important;\n display: block;\n"])), N200);
|
|
11
|
+
var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n width: 100%;\n text-align: center;\n margin-top: 8px !important;\n display: block;\n"])), token('color.text.subtlest', N200));
|
|
11
12
|
export var CAPTION_PLACEHOLDER_ID = 'caption-placeholder';
|
|
12
13
|
export default (function (_ref) {
|
|
13
14
|
var onClick = _ref.onClick;
|
|
@@ -10,9 +10,10 @@ import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
|
|
|
10
10
|
import { hexToRgba } from '@atlaskit/adf-schema';
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { dropPlaceholderMessages } from './drop-placeholder-messages';
|
|
13
|
+
import { token } from '@atlaskit/tokens';
|
|
13
14
|
import { MEDIA_HEIGHT, FILE_WIDTH } from '../../nodeviews/mediaNodeView/media';
|
|
14
|
-
var iconWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n background: ", ";\n border-radius: ", "px;\n margin: 5px 3px 25px;\n width: ", "px;\n min-height: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), hexToRgba(B400, 0.4) || B400, hexToRgba(B300, 0.6) || B300, borderRadius(), FILE_WIDTH, MEDIA_HEIGHT);
|
|
15
|
-
var dropLine = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n margin: 2px 0;\n width: 100%;\n height: 2px;\n"])), B200, borderRadius());
|
|
15
|
+
var iconWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n background: ", ";\n border-radius: ", "px;\n margin: 5px 3px 25px;\n width: ", "px;\n min-height: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), token('color.icon.accent.blue', hexToRgba(B400, 0.4) || B400), token('color.background.accent.blue.subtle', hexToRgba(B300, 0.6) || B300), borderRadius(), FILE_WIDTH, MEDIA_HEIGHT);
|
|
16
|
+
var dropLine = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n margin: 2px 0;\n width: 100%;\n height: 2px;\n"])), token('color.border.focused', B200), borderRadius());
|
|
16
17
|
|
|
17
18
|
var IconWrapperComponent = function IconWrapperComponent(props) {
|
|
18
19
|
var intl = props.intl;
|
|
@@ -30,7 +30,8 @@ import { normalizeUrl } from '../../hyperlink/utils';
|
|
|
30
30
|
import { R400 } from '@atlaskit/theme/colors';
|
|
31
31
|
import { INPUT_METHOD } from '../../analytics/types/enums';
|
|
32
32
|
import { mediaLinkToolbarMessages } from './media-linking-toolbar-messages';
|
|
33
|
-
|
|
33
|
+
import { token } from '@atlaskit/tokens';
|
|
34
|
+
var validationWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 4px 0 32px;\n border-top: 1px solid ", ";\n align-items: start;\n display: flex;\n flex-direction: column;\n"])), token('color.border.danger', R400));
|
|
34
35
|
var buttonWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 4px 8px 4px 0px;\n"])));
|
|
35
36
|
export var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
36
37
|
_inherits(LinkAddToolbar, _React$PureComponent);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -6,7 +7,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,7 +8,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
8
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
1
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
4
4
|
export var checkMediaType = /*#__PURE__*/function () {
|
|
5
5
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mediaNode, mediaClientConfig) {
|
|
@@ -6,4 +6,5 @@ import { css } from '@emotion/react';
|
|
|
6
6
|
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
7
7
|
import { SelectionStyle, getSelectionStyles, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { N500, N30A } from '@atlaskit/theme/colors';
|
|
9
|
-
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
10
|
+
export var mentionsStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n &.", " [data-mention-id] > span {\n ", "\n\n /* need to specify dark text colour because personal mentions\n (in dark blue) have white text by default */\n color: ", ";\n }\n }\n\n .danger {\n .", ".", "\n > span\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n .", " > span > span {\n background-color: ", ";\n color: ", ";\n }\n }\n"])), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background]), token('color.text.subtle', N500), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, akEditorDeleteBorder, token('color.background.danger', akEditorDeleteBackgroundWithOpacity), MentionSharedCssClassName.MENTION_CONTAINER, token('color.background.neutral', N30A), token('color.text.subtle', N500));
|
|
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import AddIcon from '@atlaskit/icon/glyph/add';
|
|
6
6
|
import { N300 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
7
8
|
import React, { useCallback, useEffect } from 'react';
|
|
8
9
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
9
10
|
import { avatarStyle, capitalizedStyle, mentionItemStyle, nameSectionStyle, rowStyle, ROW_SIDE_PADDING, AVATAR_HEIGHT, mentionItemSelectedStyle } from './styles';
|
|
@@ -52,7 +53,7 @@ var InviteItem = function InviteItem(_ref) {
|
|
|
52
53
|
css: avatarStyle
|
|
53
54
|
}, jsx(AddIcon, {
|
|
54
55
|
label: intl.formatMessage(messages.mentionsAddLabel),
|
|
55
|
-
primaryColor: N300
|
|
56
|
+
primaryColor: token('color.icon.subtle', N300)
|
|
56
57
|
})), jsx("div", {
|
|
57
58
|
css: nameSectionStyle,
|
|
58
59
|
"data-testid": "name-section"
|
|
@@ -4,11 +4,12 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { N30, N300 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
7
8
|
export var ROW_SIDE_PADDING = 14;
|
|
8
9
|
export var rowStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n overflow: hidden;\n padding: 6px ", "px;\n text-overflow: ellipsis;\n vertical-align: middle;\n"])), ROW_SIDE_PADDING);
|
|
9
10
|
export var AVATAR_HEIGHT = 36;
|
|
10
11
|
export var avatarStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n flex: initial;\n opacity: inherit;\n width: 36px;\n height: ", "px;\n\n > span {\n width: 24px;\n height: 24px;\n padding: 6px;\n }\n"])), AVATAR_HEIGHT);
|
|
11
|
-
export var nameSectionStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n margin-left: 14px;\n color: ", ";\n opacity: inherit;\n"])), N300);
|
|
12
|
+
export var nameSectionStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n margin-left: 14px;\n color: ", ";\n opacity: inherit;\n"])), token('color.text.subtle', N300));
|
|
12
13
|
export var mentionItemStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: transparent;\n display: block;\n overflow: hidden;\n list-style-type: none;\n cursor: pointer;\n"])));
|
|
13
|
-
export var mentionItemSelectedStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), N30);
|
|
14
|
+
export var mentionItemSelectedStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), token('color.background.neutral.subtle.hovered', N30));
|
|
14
15
|
export var capitalizedStyle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n text-transform: capitalize;\n"])));
|
|
@@ -81,7 +81,10 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
81
81
|
key: "ignoreMutation",
|
|
82
82
|
value: function ignoreMutation(mutation) {
|
|
83
83
|
// ignore mutation if it caused by the icon.
|
|
84
|
-
|
|
84
|
+
var isIcon = mutation.target === this.icon || mutation.target.parentNode === this.icon; // ignore mutation if it caused by the lazy load emoji inside icon.
|
|
85
|
+
|
|
86
|
+
var isInsideIcon = this.icon.contains(mutation.target);
|
|
87
|
+
return isIcon || isInsideIcon;
|
|
85
88
|
}
|
|
86
89
|
}]);
|
|
87
90
|
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { keymap } from 'prosemirror-keymap';
|
|
2
|
-
import { setTextSelection } from 'prosemirror-utils';
|
|
3
|
-
|
|
2
|
+
import { setTextSelection, findParentNodeOfType } from 'prosemirror-utils';
|
|
3
|
+
import { isEmptyNode } from '../../../utils';
|
|
4
|
+
|
|
5
|
+
function findParentNode(selection, nodeType) {
|
|
6
|
+
var parentPosition = findParentNodeOfType(nodeType)(selection);
|
|
7
|
+
|
|
8
|
+
if (parentPosition) {
|
|
9
|
+
return parentPosition.node;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function isInsideAnEmptyNode(selection, nodeType, schema) {
|
|
16
|
+
var parentNode = findParentNode(selection, nodeType);
|
|
17
|
+
return parentNode && isEmptyNode(schema)(parentNode);
|
|
18
|
+
} // Somewhat broken and subverted: https://product-fabric.atlassian.net/browse/ED-6504
|
|
19
|
+
|
|
20
|
+
|
|
4
21
|
export function keymapPlugin() {
|
|
5
22
|
var deleteCurrentItem = function deleteCurrentItem($from, tr) {
|
|
6
23
|
return tr.delete($from.before($from.depth) - 1, $from.end($from.depth) + 1);
|
|
@@ -11,7 +28,8 @@ export function keymapPlugin() {
|
|
|
11
28
|
var selection = state.selection,
|
|
12
29
|
nodes = state.schema.nodes,
|
|
13
30
|
tr = state.tr;
|
|
14
|
-
var panel = nodes.panel
|
|
31
|
+
var panel = nodes.panel,
|
|
32
|
+
blockquote = nodes.blockquote;
|
|
15
33
|
var $from = selection.$from,
|
|
16
34
|
$to = selection.$to; // Don't do anything if selection is a range
|
|
17
35
|
|
|
@@ -30,7 +48,7 @@ export function keymapPlugin() {
|
|
|
30
48
|
var isPreviousNodeAPanel = previousNodeType === panel;
|
|
31
49
|
var isParentNodeAPanel = parentNodeType === panel; // Stops merging panels when deleting empty paragraph in between
|
|
32
50
|
|
|
33
|
-
if (isPreviousNodeAPanel && !isParentNodeAPanel) {
|
|
51
|
+
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || isInsideAnEmptyNode(selection, blockquote, state.schema)) {
|
|
34
52
|
var content = $from.node($from.depth).content;
|
|
35
53
|
var insertPos = previousPos.pos - 1;
|
|
36
54
|
deleteCurrentItem($from, tr).insert(insertPos, content);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
|
|
5
5
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
6
|
|
|
@@ -721,6 +721,27 @@ export function handleRichText(slice) {
|
|
|
721
721
|
return true;
|
|
722
722
|
};
|
|
723
723
|
}
|
|
724
|
+
export function handlePasteIntoCaption(slice) {
|
|
725
|
+
return function (state, dispatch) {
|
|
726
|
+
var caption = state.schema.nodes.caption;
|
|
727
|
+
var tr = state.tr;
|
|
728
|
+
|
|
729
|
+
if (hasParentNodeOfType(caption)(state.selection)) {
|
|
730
|
+
// We let PM replace the selection and it will insert as text where it can't place the node
|
|
731
|
+
// This is totally fine as caption is just a simple block that only contains inline contents
|
|
732
|
+
// And it is more in line with WYSIWYG expectations
|
|
733
|
+
tr.replaceSelection(slice).scrollIntoView();
|
|
734
|
+
|
|
735
|
+
if (dispatch) {
|
|
736
|
+
dispatch(tr);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
return true;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return false;
|
|
743
|
+
};
|
|
744
|
+
}
|
|
724
745
|
export var handleSelectedTable = function handleSelectedTable(slice) {
|
|
725
746
|
return function (state, dispatch) {
|
|
726
747
|
var tr = replaceSelectedTable(state, slice, INPUT_METHOD.CLIPBOARD);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { linkifyMatch } from '@atlaskit/adf-schema';
|
|
2
|
-
import LinkifyIt from 'linkify-it';
|
|
2
|
+
import LinkifyIt from 'linkify-it';
|
|
3
|
+
import { findFilepaths, isLinkInMatches } from '../hyperlink/utils'; // modified version of the original Linkify plugin
|
|
3
4
|
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js
|
|
4
5
|
|
|
5
6
|
var arrayReplaceAt = function arrayReplaceAt(src, pos, newElements) {
|
|
@@ -67,8 +68,13 @@ var linkify = function linkify(state) {
|
|
|
67
68
|
var nodes = [];
|
|
68
69
|
var level = currentToken.level;
|
|
69
70
|
var lastPos = 0;
|
|
71
|
+
var filepaths = findFilepaths(text);
|
|
70
72
|
|
|
71
73
|
for (var ln = 0; ln < links.length; ln++) {
|
|
74
|
+
if (isLinkInMatches(links[ln].index, filepaths)) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
var url = links[ln].url;
|
|
73
79
|
var fullUrl = state.md.normalizeLink(url);
|
|
74
80
|
|
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents, withAnalytics } from '../../analytics';
|
|
9
9
|
import { getPasteSource } from '../util';
|
|
10
|
-
import { handlePasteAsPlainText, handlePasteIntoTaskAndDecision, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText } from '../handlers';
|
|
10
|
+
import { handlePasteAsPlainText, handlePasteIntoTaskAndDecision, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption } from '../handlers';
|
|
11
11
|
import { pipe } from '../../../utils';
|
|
12
12
|
import { findParentNode } from 'prosemirror-utils';
|
|
13
13
|
import { mapSlice } from '../../../utils/slice';
|
|
@@ -222,6 +222,11 @@ export var handlePasteIntoTaskAndDecisionWithAnalytics = function handlePasteInt
|
|
|
222
222
|
type: type
|
|
223
223
|
}))(slice);
|
|
224
224
|
};
|
|
225
|
+
export var handlePasteIntoCaptionWithAnalytics = function handlePasteIntoCaptionWithAnalytics(view, event, slice, type) {
|
|
226
|
+
return pipe(handlePasteIntoCaption, pasteCommandWithAnalytics(view, event, slice, {
|
|
227
|
+
type: type
|
|
228
|
+
}))(slice);
|
|
229
|
+
};
|
|
225
230
|
export var handleCodeBlockWithAnalytics = function handleCodeBlockWithAnalytics(view, event, slice, text) {
|
|
226
231
|
return pipe(handleCodeBlock, pasteCommandWithAnalytics(view, event, slice, {
|
|
227
232
|
type: PasteTypes.plain
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
1
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import { Slice, Fragment } from 'prosemirror-model';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { PluginKey } from 'prosemirror-state';
|
|
@@ -14,7 +14,7 @@ import { linkifyContent } from '../../hyperlink/utils';
|
|
|
14
14
|
import { transformSliceNestedExpandToExpand } from '../../expand/utils';
|
|
15
15
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
|
|
16
16
|
import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
|
|
17
|
-
import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent } from './analytics';
|
|
17
|
+
import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics } from './analytics';
|
|
18
18
|
import { analyticsPluginKey, PasteTypes } from '../../analytics';
|
|
19
19
|
import { insideTable, measurements } from '../../../utils';
|
|
20
20
|
import { measureRender } from '@atlaskit/editor-common/utils';
|
|
@@ -28,6 +28,7 @@ import { pluginKey as betterTypePluginKey } from '../../base/pm-plugins/better-t
|
|
|
28
28
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
29
29
|
import { htmlHasIncompleteTable, tryRebuildCompleteTableHtml, isPastedFromTinyMCEConfluence } from '../util/tinyMCE';
|
|
30
30
|
import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
31
|
+
import { extractSliceFromStep } from '../../../utils/step';
|
|
31
32
|
export var stateKey = new PluginKey('pastePlugin');
|
|
32
33
|
export { md } from '../md';
|
|
33
34
|
export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinkification, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
@@ -184,8 +185,25 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
|
|
|
184
185
|
// don't add closeHistory call if we're pasting a text inside placeholder text as we want the whole action
|
|
185
186
|
// to be atomic
|
|
186
187
|
var placeholder = state.schema.nodes.placeholder;
|
|
188
|
+
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
|
|
189
|
+
// appendedTransactions to repair them (if they're partial or incomplete) and we don't want
|
|
190
|
+
// to split those repairing transactions in prosemirror-history when they're being added to the
|
|
191
|
+
// "done" stack
|
|
192
|
+
|
|
193
|
+
var isPastingTable = tr.steps.some(function (step) {
|
|
194
|
+
var _slice$content;
|
|
195
|
+
|
|
196
|
+
var slice = extractSliceFromStep(step);
|
|
197
|
+
var tableExists = false;
|
|
198
|
+
slice === null || slice === void 0 ? void 0 : (_slice$content = slice.content) === null || _slice$content === void 0 ? void 0 : _slice$content.forEach(function (node) {
|
|
199
|
+
if (node.type === state.schema.nodes.table) {
|
|
200
|
+
tableExists = true;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
return tableExists;
|
|
204
|
+
});
|
|
187
205
|
|
|
188
|
-
if (
|
|
206
|
+
if (!isPastingTextInsidePlaceholderText && !isPastingTable) {
|
|
189
207
|
tr.setMeta(betterTypePluginKey, true);
|
|
190
208
|
}
|
|
191
209
|
|
|
@@ -308,6 +326,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
|
|
|
308
326
|
|
|
309
327
|
if (!insideTable(state)) {
|
|
310
328
|
slice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
329
|
+
} // Create a custom handler to avoid handling with handleRichText method
|
|
330
|
+
// As SafeInsert is used inside handleRichText which caused some bad UX like this:
|
|
331
|
+
// https://product-fabric.atlassian.net/browse/MEX-1520
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
if (handlePasteIntoCaptionWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
|
|
335
|
+
return true;
|
|
311
336
|
}
|
|
312
337
|
|
|
313
338
|
return handleRichTextWithAnalytics(view, event, slice)(state, dispatch);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
2
3
|
import { PluginKey } from 'prosemirror-state';
|
|
3
4
|
import { DecorationSet, Decoration } from 'prosemirror-view';
|
|
4
5
|
import { isInEmptyLine, isEmptyDocument, bracketTyped } from '../../utils/document';
|
|
@@ -27,7 +28,17 @@ export function createPlaceholderDecoration(editorState, placeholderText) {
|
|
|
27
28
|
placeholderDecoration.className = placeHolderClass;
|
|
28
29
|
var placeholderNode = document.createElement('span');
|
|
29
30
|
placeholderNode.textContent = placeholderText;
|
|
30
|
-
placeholderDecoration.appendChild(placeholderNode);
|
|
31
|
+
placeholderDecoration.appendChild(placeholderNode); // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
|
|
32
|
+
// Add a editable buff node as the cursor moving forward is inevitable
|
|
33
|
+
// when backspace in GBoard composition
|
|
34
|
+
|
|
35
|
+
if (browser.android && browser.chrome) {
|
|
36
|
+
var buffNode = document.createElement('span');
|
|
37
|
+
buffNode.setAttribute('contenteditable', 'true');
|
|
38
|
+
buffNode.textContent = ' ';
|
|
39
|
+
placeholderDecoration.appendChild(buffNode);
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
return DecorationSet.create(editorState.doc, [Decoration.widget(pos, placeholderDecoration, {
|
|
32
43
|
side: -1,
|
|
33
44
|
key: 'placeholder'
|