@atlaskit/editor-core 162.0.1 → 163.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/CHANGELOG.md +42 -0
- package/dist/cjs/create-editor/ErrorBoundary.js +1 -1
- package/dist/cjs/create-editor/ReactEditorView.js +2 -2
- package/dist/cjs/editor.js +3 -7
- package/dist/cjs/keymaps/index.js +14 -9
- package/dist/cjs/labs/next/full-page.js +34 -46
- package/dist/cjs/labs/next/presets/cxhtml.js +0 -1
- package/dist/cjs/nodeviews/ReactNodeView.js +16 -41
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +227 -0
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +21 -0
- package/dist/cjs/nodeviews/getPerformanceOptions.js +64 -0
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +16 -6
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +10 -17
- package/dist/cjs/plugins/analytics/types/enums.js +2 -0
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +9 -16
- package/dist/cjs/plugins/base/index.js +26 -7
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +141 -76
- package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +5 -8
- package/dist/cjs/plugins/block-type/commands/block-type.js +21 -9
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +9 -9
- package/dist/cjs/plugins/card/nodeviews/genericCard.js +4 -4
- package/dist/cjs/plugins/card/pm-plugins/doc.js +53 -6
- package/dist/cjs/plugins/card/pm-plugins/main.js +16 -1
- package/dist/cjs/plugins/card/styles.js +2 -2
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +6 -6
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +7 -8
- package/dist/cjs/plugins/code-block/styles.js +2 -2
- package/dist/cjs/plugins/collab-edit/styles.js +2 -2
- package/dist/cjs/plugins/collab-edit/ui/avatars.js +6 -1
- package/dist/cjs/plugins/collab-edit/ui/colored-avatar-item.js +4 -5
- package/dist/cjs/plugins/collab-edit/ui/invite-to-edit.js +15 -4
- package/dist/cjs/plugins/collab-edit/ui/styles.js +10 -14
- package/dist/cjs/plugins/date/nodeviews/date.js +30 -75
- package/dist/cjs/plugins/date/pm-plugins/main.js +8 -11
- package/dist/cjs/plugins/date/styles.js +2 -2
- package/dist/cjs/plugins/date/ui/DatePicker/date-picker-input.js +7 -6
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +8 -7
- package/dist/cjs/plugins/emoji/styles.js +3 -3
- package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +13 -16
- package/dist/cjs/plugins/expand/ui/styles.js +26 -12
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +16 -9
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +9 -6
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/index.js +7 -3
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +7 -4
- package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +14 -13
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +20 -26
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +14 -17
- package/dist/cjs/plugins/extension/ui/styles.js +2 -2
- package/dist/cjs/plugins/fake-text-cursor/styles.js +2 -2
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +1 -1
- package/dist/cjs/plugins/find-replace/styles.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +6 -7
- package/dist/cjs/plugins/floating-toolbar/ui/styles.js +7 -1
- package/dist/cjs/plugins/grid/styles.js +2 -2
- package/dist/cjs/plugins/help-dialog/ui/index.js +134 -40
- package/dist/cjs/plugins/help-dialog/ui/styles.js +26 -49
- package/dist/cjs/plugins/hyperlink/styles.js +6 -16
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +23 -20
- package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +13 -10
- package/dist/cjs/plugins/list/commands/index.js +8 -0
- package/dist/cjs/plugins/list/pm-plugins/main.js +6 -0
- package/dist/cjs/plugins/list/styles.js +2 -2
- package/dist/cjs/plugins/list/utils/node.js +4 -3
- package/dist/cjs/plugins/media/index.js +9 -40
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +28 -23
- package/dist/cjs/plugins/media/pm-plugins/main.js +1 -8
- package/dist/cjs/plugins/media/pm-plugins/media-editor-plugin-factory.js +2 -67
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/index.js +0 -13
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +12 -8
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/styled.js +7 -6
- package/dist/cjs/plugins/media/utils/media-single.js +8 -4
- package/dist/cjs/plugins/mentions/styles.js +2 -2
- package/dist/cjs/plugins/panel/styles.js +5 -2
- package/dist/cjs/plugins/placeholder/styles.js +2 -2
- package/dist/cjs/plugins/placeholder-text/styles.js +2 -2
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +2 -1
- package/dist/cjs/plugins/rule/styles.js +5 -2
- package/dist/cjs/plugins/selection/gap-cursor/styles.js +4 -4
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +13 -30
- package/dist/cjs/plugins/status/index.js +9 -12
- package/dist/cjs/plugins/status/nodeviews/status.js +43 -126
- package/dist/cjs/plugins/status/plugin.js +14 -6
- package/dist/cjs/plugins/status/styles.js +2 -2
- package/dist/cjs/plugins/table/index.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +10 -16
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +7 -12
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +2 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/styles.js +2 -2
- package/dist/cjs/plugins/type-ahead/constants.js +3 -1
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +8 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +15 -56
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +48 -3
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +4 -1
- package/dist/cjs/plugins/unsupported-content/styles.js +2 -2
- package/dist/cjs/profiler/render-count.js +1 -3
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +0 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +0 -1
- package/dist/cjs/ui/Appearance/FullPage/messages.js +2 -2
- package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +18 -16
- package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +16 -14
- package/dist/cjs/ui/ConfigPanel/Fields/TabGroup.js +13 -10
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +15 -4
- package/dist/cjs/ui/ConfigPanel/Header.js +30 -30
- package/dist/cjs/ui/ContentStyles/index.js +13 -20
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +5 -6
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +30 -23
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +51 -47
- package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +17 -14
- package/dist/cjs/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +18 -18
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +55 -68
- package/dist/cjs/ui/ElementBrowser/hooks/use-container-width.js +10 -11
- package/dist/cjs/ui/FloatingToolbar/styles.js +1 -1
- package/dist/cjs/ui/LinkSearch/LinkSearchList.js +18 -22
- package/dist/cjs/ui/PortalProvider/index.js +3 -3
- package/dist/cjs/ui/Resizer/styled.js +7 -5
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +5 -3
- package/dist/cjs/ui/WithFlash/index.js +9 -17
- package/dist/cjs/utils/insert.js +25 -2
- package/dist/cjs/utils/performance/components/RenderTracking.js +52 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +2 -2
- package/dist/es2019/create-editor/ReactEditorView.js +1 -1
- package/dist/es2019/editor.js +3 -5
- package/dist/es2019/keymaps/index.js +10 -4
- package/dist/es2019/labs/next/full-page.js +44 -43
- package/dist/es2019/labs/next/presets/cxhtml.js +0 -1
- package/dist/es2019/nodeviews/ReactNodeView.js +13 -35
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +216 -0
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +15 -0
- package/dist/es2019/nodeviews/getPerformanceOptions.js +47 -0
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +18 -7
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +5 -5
- package/dist/es2019/plugins/analytics/types/enums.js +2 -0
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +12 -7
- package/dist/es2019/plugins/base/index.js +24 -5
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +135 -77
- package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +5 -4
- package/dist/es2019/plugins/block-type/commands/block-type.js +18 -11
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +10 -6
- package/dist/es2019/plugins/card/nodeviews/genericCard.js +5 -5
- package/dist/es2019/plugins/card/pm-plugins/doc.js +44 -4
- package/dist/es2019/plugins/card/pm-plugins/main.js +17 -1
- package/dist/es2019/plugins/card/styles.js +1 -1
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +6 -6
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +8 -7
- package/dist/es2019/plugins/code-block/styles.js +4 -0
- package/dist/es2019/plugins/collab-edit/styles.js +1 -1
- package/dist/es2019/plugins/collab-edit/ui/avatars.js +6 -2
- package/dist/es2019/plugins/collab-edit/ui/colored-avatar-item.js +5 -4
- package/dist/es2019/plugins/collab-edit/ui/invite-to-edit.js +9 -5
- package/dist/es2019/plugins/collab-edit/ui/styles.js +5 -7
- package/dist/es2019/plugins/date/nodeviews/date.js +37 -48
- package/dist/es2019/plugins/date/pm-plugins/main.js +8 -10
- package/dist/es2019/plugins/date/styles.js +1 -1
- package/dist/es2019/plugins/date/ui/DatePicker/date-picker-input.js +8 -4
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +9 -5
- package/dist/es2019/plugins/emoji/styles.js +1 -2
- package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +13 -14
- package/dist/es2019/plugins/expand/ui/styles.js +32 -22
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +17 -11
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +7 -6
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/index.js +9 -5
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +5 -3
- package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +14 -7
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +14 -8
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +15 -9
- package/dist/es2019/plugins/extension/ui/styles.js +2 -1
- package/dist/es2019/plugins/fake-text-cursor/styles.js +1 -1
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +1 -1
- package/dist/es2019/plugins/find-replace/styles.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +12 -8
- package/dist/es2019/plugins/floating-toolbar/ui/styles.js +7 -1
- package/dist/es2019/plugins/grid/styles.js +1 -1
- package/dist/es2019/plugins/help-dialog/ui/index.js +132 -37
- package/dist/es2019/plugins/help-dialog/ui/styles.js +13 -13
- package/dist/es2019/plugins/hyperlink/styles.js +1 -5
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +25 -20
- package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +14 -7
- package/dist/es2019/plugins/list/commands/index.js +7 -0
- package/dist/es2019/plugins/list/pm-plugins/main.js +6 -0
- package/dist/es2019/plugins/list/styles.js +1 -1
- package/dist/es2019/plugins/list/utils/node.js +4 -3
- package/dist/es2019/plugins/media/index.js +1 -28
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +30 -16
- package/dist/es2019/plugins/media/pm-plugins/main.js +1 -7
- package/dist/es2019/plugins/media/pm-plugins/media-editor-plugin-factory.js +1 -49
- package/dist/es2019/plugins/media/styles.js +1 -2
- package/dist/es2019/plugins/media/toolbar/index.js +0 -12
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +0 -1
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +14 -9
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/styled.js +4 -5
- package/dist/es2019/plugins/media/utils/media-single.js +9 -5
- package/dist/es2019/plugins/mentions/styles.js +1 -1
- package/dist/es2019/plugins/panel/styles.js +3 -3
- package/dist/es2019/plugins/placeholder/styles.js +1 -1
- package/dist/es2019/plugins/placeholder-text/styles.js +1 -1
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +4 -1
- package/dist/es2019/plugins/rule/styles.js +3 -3
- package/dist/es2019/plugins/selection/gap-cursor/styles.js +2 -2
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +4 -20
- package/dist/es2019/plugins/status/index.js +1 -5
- package/dist/es2019/plugins/status/nodeviews/status.js +45 -82
- package/dist/es2019/plugins/status/plugin.js +13 -6
- package/dist/es2019/plugins/status/styles.js +1 -7
- package/dist/es2019/plugins/table/index.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +11 -10
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +7 -8
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
- package/dist/es2019/plugins/tasks-and-decisions/styles.js +1 -1
- package/dist/es2019/plugins/type-ahead/constants.js +1 -0
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +11 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +19 -51
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +41 -3
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +3 -1
- package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
- package/dist/es2019/profiler/render-count.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +0 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +0 -1
- package/dist/es2019/ui/Appearance/FullPage/messages.js +1 -1
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +19 -16
- package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +18 -13
- package/dist/es2019/ui/ConfigPanel/Fields/TabGroup.js +14 -8
- package/dist/es2019/ui/ConfigPanel/Fields/UserSelect.js +12 -3
- package/dist/es2019/ui/ConfigPanel/Header.js +30 -19
- package/dist/es2019/ui/ContentStyles/index.js +33 -38
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +5 -6
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +49 -38
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +54 -33
- package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +18 -10
- package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +19 -17
- package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +132 -119
- package/dist/es2019/ui/ElementBrowser/hooks/use-container-width.js +10 -9
- package/dist/es2019/ui/FloatingToolbar/styles.js +2 -1
- package/dist/es2019/ui/LinkSearch/LinkSearchList.js +14 -9
- package/dist/es2019/ui/PortalProvider/index.js +3 -3
- package/dist/es2019/ui/Resizer/styled.js +3 -3
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +6 -3
- package/dist/es2019/ui/WithFlash/index.js +15 -6
- package/dist/es2019/utils/insert.js +20 -0
- package/dist/es2019/utils/performance/components/RenderTracking.js +37 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ErrorBoundary.js +2 -2
- package/dist/esm/create-editor/ReactEditorView.js +1 -1
- package/dist/esm/editor.js +3 -5
- package/dist/esm/keymaps/index.js +7 -4
- package/dist/esm/labs/next/full-page.js +38 -36
- package/dist/esm/labs/next/presets/cxhtml.js +0 -1
- package/dist/esm/nodeviews/ReactNodeView.js +17 -38
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +212 -0
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
- package/dist/esm/nodeviews/getPerformanceOptions.js +45 -0
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +17 -7
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +5 -5
- package/dist/esm/plugins/analytics/types/enums.js +2 -0
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +9 -9
- package/dist/esm/plugins/base/index.js +26 -7
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +134 -69
- package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +5 -4
- package/dist/esm/plugins/block-type/commands/block-type.js +19 -9
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +9 -6
- package/dist/esm/plugins/card/nodeviews/genericCard.js +5 -5
- package/dist/esm/plugins/card/pm-plugins/doc.js +47 -4
- package/dist/esm/plugins/card/pm-plugins/main.js +15 -1
- package/dist/esm/plugins/card/styles.js +1 -1
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +6 -6
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +8 -9
- package/dist/esm/plugins/code-block/styles.js +2 -2
- package/dist/esm/plugins/collab-edit/styles.js +1 -1
- package/dist/esm/plugins/collab-edit/ui/avatars.js +6 -2
- package/dist/esm/plugins/collab-edit/ui/colored-avatar-item.js +5 -4
- package/dist/esm/plugins/collab-edit/ui/invite-to-edit.js +9 -5
- package/dist/esm/plugins/collab-edit/ui/styles.js +6 -7
- package/dist/esm/plugins/date/nodeviews/date.js +30 -71
- package/dist/esm/plugins/date/pm-plugins/main.js +8 -9
- package/dist/esm/plugins/date/styles.js +1 -1
- package/dist/esm/plugins/date/ui/DatePicker/date-picker-input.js +7 -4
- package/dist/esm/plugins/date/ui/DatePicker/index.js +8 -5
- package/dist/esm/plugins/emoji/styles.js +2 -2
- package/dist/esm/plugins/expand/ui/ExpandIconButton.js +13 -15
- package/dist/esm/plugins/expand/ui/styles.js +24 -12
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +18 -11
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -5
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/index.js +9 -5
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +5 -3
- package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +13 -7
- package/dist/esm/plugins/extension/ui/Extension/styles.js +13 -11
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +15 -9
- package/dist/esm/plugins/extension/ui/styles.js +2 -2
- package/dist/esm/plugins/fake-text-cursor/styles.js +1 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +1 -1
- package/dist/esm/plugins/find-replace/styles.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +6 -7
- package/dist/esm/plugins/floating-toolbar/ui/styles.js +7 -1
- package/dist/esm/plugins/grid/styles.js +1 -1
- package/dist/esm/plugins/help-dialog/ui/index.js +135 -41
- package/dist/esm/plugins/help-dialog/ui/styles.js +13 -13
- package/dist/esm/plugins/hyperlink/styles.js +3 -5
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +24 -20
- package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +14 -7
- package/dist/esm/plugins/list/commands/index.js +7 -0
- package/dist/esm/plugins/list/pm-plugins/main.js +6 -0
- package/dist/esm/plugins/list/styles.js +1 -1
- package/dist/esm/plugins/list/utils/node.js +4 -3
- package/dist/esm/plugins/media/index.js +9 -37
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +29 -15
- package/dist/esm/plugins/media/pm-plugins/main.js +1 -9
- package/dist/esm/plugins/media/pm-plugins/media-editor-plugin-factory.js +1 -58
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/toolbar/index.js +0 -12
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +13 -9
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/styled.js +4 -3
- package/dist/esm/plugins/media/utils/media-single.js +9 -5
- package/dist/esm/plugins/mentions/styles.js +1 -1
- package/dist/esm/plugins/panel/styles.js +4 -2
- package/dist/esm/plugins/placeholder/styles.js +1 -1
- package/dist/esm/plugins/placeholder-text/styles.js +1 -1
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +2 -1
- package/dist/esm/plugins/rule/styles.js +4 -2
- package/dist/esm/plugins/selection/gap-cursor/styles.js +3 -3
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +5 -21
- package/dist/esm/plugins/status/index.js +9 -12
- package/dist/esm/plugins/status/nodeviews/status.js +37 -115
- package/dist/esm/plugins/status/plugin.js +13 -6
- package/dist/esm/plugins/status/styles.js +2 -2
- package/dist/esm/plugins/table/index.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +10 -11
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +7 -10
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/styles.js +1 -1
- package/dist/esm/plugins/type-ahead/constants.js +1 -0
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +9 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +18 -56
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +44 -3
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +3 -1
- package/dist/esm/plugins/unsupported-content/styles.js +1 -1
- package/dist/esm/profiler/render-count.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +0 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +0 -1
- package/dist/esm/ui/Appearance/FullPage/messages.js +1 -1
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +19 -16
- package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +17 -13
- package/dist/esm/ui/ConfigPanel/Fields/TabGroup.js +13 -8
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +14 -3
- package/dist/esm/ui/ConfigPanel/Header.js +30 -19
- package/dist/esm/ui/ContentStyles/index.js +12 -17
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -6
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +29 -18
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +50 -35
- package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +18 -10
- package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +19 -17
- package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +53 -52
- package/dist/esm/ui/ElementBrowser/hooks/use-container-width.js +9 -8
- package/dist/esm/ui/FloatingToolbar/styles.js +1 -1
- package/dist/esm/ui/LinkSearch/LinkSearchList.js +14 -9
- package/dist/esm/ui/PortalProvider/index.js +3 -3
- package/dist/esm/ui/Resizer/styled.js +4 -2
- package/dist/esm/ui/Toolbar/ToolbarInner.js +6 -3
- package/dist/esm/ui/WithFlash/index.js +8 -8
- package/dist/esm/utils/insert.js +20 -0
- package/dist/esm/utils/performance/components/RenderTracking.js +39 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/editor.d.ts +1 -1
- package/dist/types/keymaps/index.d.ts +3 -2
- package/dist/types/labs/next/full-page.d.ts +1 -1
- package/dist/types/labs/next/mobile.d.ts +1 -1
- package/dist/types/nodeviews/ReactNodeView.d.ts +0 -5
- package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +23 -0
- package/dist/types/nodeviews/getInlineNodeViewProducer.styles.d.ts +1 -0
- package/dist/types/nodeviews/getPerformanceOptions.d.ts +19 -0
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +3 -1
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +4 -5
- package/dist/types/plugins/analytics/types/enums.d.ts +2 -0
- package/dist/types/plugins/analytics/types/events.d.ts +11 -3
- package/dist/types/plugins/analytics/types/general-events.d.ts +1 -1
- package/dist/types/plugins/analytics/types/utils.d.ts +4 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -2
- package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +12 -6
- package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +3 -3
- package/dist/types/plugins/breakout/ui/LayoutButton.d.ts +1 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -0
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/styles.d.ts +1 -1
- package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +1 -1
- package/dist/types/plugins/collab-edit/styles.d.ts +1 -1
- package/dist/types/plugins/collab-edit/ui/avatars.d.ts +1 -0
- package/dist/types/plugins/collab-edit/ui/colored-avatar-item.d.ts +3 -2
- package/dist/types/plugins/collab-edit/ui/invite-to-edit.d.ts +1 -0
- package/dist/types/plugins/collab-edit/ui/styles.d.ts +3 -8
- package/dist/types/plugins/date/nodeviews/date.d.ts +3 -15
- package/dist/types/plugins/date/styles.d.ts +1 -1
- package/dist/types/plugins/date/ui/DatePicker/date-picker-input.d.ts +1 -0
- package/dist/types/plugins/date/ui/DatePicker/index.d.ts +1 -0
- package/dist/types/plugins/emoji/styles.d.ts +2 -2
- package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +5 -3
- package/dist/types/plugins/expand/ui/styles.d.ts +2 -1
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +1 -0
- package/dist/types/plugins/extension/ui/Extension/Extension/styles.d.ts +3 -8
- package/dist/types/plugins/extension/ui/Extension/InlineExtension/index.d.ts +3 -1
- package/dist/types/plugins/extension/ui/Extension/InlineExtension/styles.d.ts +2 -2
- package/dist/types/plugins/extension/ui/Extension/Lozenge.d.ts +3 -1
- package/dist/types/plugins/extension/ui/Extension/styles.d.ts +6 -6
- package/dist/types/plugins/extension/ui/SaveIndicator/SaveIndicator.d.ts +1 -0
- package/dist/types/plugins/extension/ui/styles.d.ts +1 -1
- package/dist/types/plugins/fake-text-cursor/styles.d.ts +1 -1
- package/dist/types/plugins/find-replace/styles.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/ui/styles.d.ts +6 -1
- package/dist/types/plugins/grid/styles.d.ts +1 -1
- package/dist/types/plugins/help-dialog/ui/index.d.ts +3 -1
- package/dist/types/plugins/help-dialog/ui/styles.d.ts +12 -13
- package/dist/types/plugins/hyperlink/styles.d.ts +2 -4
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +4 -2
- package/dist/types/plugins/jira-issue/nodeviews/jira-issue.d.ts +3 -2
- package/dist/types/plugins/list/styles.d.ts +1 -1
- package/dist/types/plugins/list/utils/node.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.d.ts +3 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/media-editor-plugin-factory.d.ts +1 -3
- package/dist/types/plugins/media/types.d.ts +0 -19
- package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +3 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/styled.d.ts +2 -2
- package/dist/types/plugins/mentions/styles.d.ts +1 -1
- package/dist/types/plugins/panel/styles.d.ts +2 -1
- package/dist/types/plugins/placeholder/styles.d.ts +1 -1
- package/dist/types/plugins/placeholder-text/styles.d.ts +1 -1
- package/dist/types/plugins/rule/styles.d.ts +2 -1
- package/dist/types/plugins/selection/gap-cursor/styles.d.ts +1 -1
- package/dist/types/plugins/status/nodeviews/status.d.ts +6 -13
- package/dist/types/plugins/status/plugin.d.ts +2 -3
- package/dist/types/plugins/status/styles.d.ts +1 -1
- package/dist/types/plugins/status/ui/statusPicker.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +4 -2
- package/dist/types/plugins/table/ui/FloatingContextualButton/styles.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +3 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/styles.d.ts +1 -1
- package/dist/types/plugins/tasks-and-decisions/styles.d.ts +1 -1
- package/dist/types/plugins/type-ahead/constants.d.ts +1 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +1 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +26 -0
- package/dist/types/plugins/unsupported-content/styles.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +0 -1
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +0 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -9
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/ErrorMessage/ErrorImage.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/Fields/Boolean.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/Fields/TabGroup.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/Header.d.ts +3 -3
- package/dist/types/ui/ContentStyles/index.d.ts +1 -4
- package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +1 -0
- package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +1 -0
- package/dist/types/ui/ElementBrowser/components/ElementSearch.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +2 -1
- package/dist/types/ui/ElementBrowser/hooks/use-container-width.d.ts +1 -0
- package/dist/types/ui/LinkSearch/LinkSearchList.d.ts +4 -3
- package/dist/types/ui/Resizer/styled.d.ts +1 -2
- package/dist/types/ui/Toolbar/ToolbarInner.d.ts +3 -1
- package/dist/types/ui/ToolbarButton/index.d.ts +3 -3
- package/dist/types/ui/ToolbarButton/styles.d.ts +2 -2
- package/dist/types/ui/WithFlash/index.d.ts +3 -1
- package/dist/types/utils/insert.d.ts +2 -1
- package/dist/types/utils/performance/components/RenderTracking.d.ts +13 -0
- package/package.json +27 -29
- package/dist/cjs/plugins/media/commands/media-editor.js +0 -80
- package/dist/cjs/plugins/media/pm-plugins/media-editor.js +0 -106
- package/dist/cjs/plugins/media/toolbar/annotation.js +0 -244
- package/dist/cjs/plugins/media/ui/MediaEditor.js +0 -88
- package/dist/cjs/utils/compare.js +0 -136
- package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +0 -83
- package/dist/es2019/plugins/media/commands/media-editor.js +0 -46
- package/dist/es2019/plugins/media/pm-plugins/media-editor.js +0 -43
- package/dist/es2019/plugins/media/toolbar/annotation.js +0 -136
- package/dist/es2019/plugins/media/ui/MediaEditor.js +0 -51
- package/dist/es2019/utils/compare.js +0 -99
- package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +0 -66
- package/dist/esm/plugins/media/commands/media-editor.js +0 -59
- package/dist/esm/plugins/media/pm-plugins/media-editor.js +0 -90
- package/dist/esm/plugins/media/toolbar/annotation.js +0 -218
- package/dist/esm/plugins/media/ui/MediaEditor.js +0 -76
- package/dist/esm/utils/compare.js +0 -115
- package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +0 -68
- package/dist/types/plugins/media/commands/media-editor.d.ts +0 -7
- package/dist/types/plugins/media/pm-plugins/media-editor.d.ts +0 -3
- package/dist/types/plugins/media/toolbar/annotation.d.ts +0 -24
- package/dist/types/plugins/media/ui/MediaEditor.d.ts +0 -14
- package/dist/types/utils/compare.d.ts +0 -32
- package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +0 -30
|
@@ -9,9 +9,7 @@ exports.default = JIRAIssueNode;
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _react =
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _react = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
var _jiraIcon = require("@atlaskit/logo/jira-icon");
|
|
17
15
|
|
|
@@ -23,15 +21,20 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
23
21
|
|
|
24
22
|
var _templateObject, _templateObject2, _templateObject3;
|
|
25
23
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var SvgChildNode = _styledComponents.default.span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n height: 24px;\n vertical-align: top;\n width: 24px;\n\n & > div {\n height: 24px;\n width: 24px;\n }\n"])));
|
|
24
|
+
var wrapperNode = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 2px;\n min-height: 24px;\n padding: 0 4px;\n user-select: none;\n vertical-align: middle;\n white-space: nowrap;\n\n .ProseMirror-selectednode & {\n background: ", ";\n outline: none;\n }\n"])), _colors.N30, _colors.N50, (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)(13), _colors.N50);
|
|
25
|
+
var jiraChildNode = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n color: #707070;\n line-height: 24px;\n vertical-align: top;\n\n &::before {\n color: black;\n content: 'JIRA | ';\n }\n"])));
|
|
26
|
+
var svgChildNode = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n height: 24px;\n vertical-align: top;\n width: 24px;\n\n & > div {\n height: 24px;\n width: 24px;\n }\n"])));
|
|
31
27
|
|
|
32
28
|
function JIRAIssueNode(props) {
|
|
33
29
|
var issueKey = props.node.attrs.issueKey;
|
|
34
|
-
return
|
|
30
|
+
return (0, _react.jsx)("span", {
|
|
31
|
+
css: wrapperNode,
|
|
32
|
+
"data-testid": "jira-issue-node"
|
|
33
|
+
}, (0, _react.jsx)("span", {
|
|
34
|
+
css: svgChildNode
|
|
35
|
+
}, (0, _react.jsx)(_jiraIcon.JiraIcon, {
|
|
35
36
|
size: "small"
|
|
36
|
-
})),
|
|
37
|
+
})), (0, _react.jsx)("span", {
|
|
38
|
+
css: jiraChildNode
|
|
39
|
+
}, issueKey));
|
|
37
40
|
}
|
|
@@ -29,6 +29,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
29
29
|
|
|
30
30
|
var _prosemirrorModel = require("prosemirror-model");
|
|
31
31
|
|
|
32
|
+
var _prosemirrorState = require("prosemirror-state");
|
|
33
|
+
|
|
32
34
|
var baseCommand = _interopRequireWildcard(require("prosemirror-commands"));
|
|
33
35
|
|
|
34
36
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
@@ -387,6 +389,12 @@ var joinToPreviousListItem = function joinToPreviousListItem(state, dispatch) {
|
|
|
387
389
|
}
|
|
388
390
|
|
|
389
391
|
if (dispatch) {
|
|
392
|
+
var _tr$doc$resolve$nodeB;
|
|
393
|
+
|
|
394
|
+
if (!((_tr$doc$resolve$nodeB = tr.doc.resolve($lastNode.pos).nodeBefore) !== null && _tr$doc$resolve$nodeB !== void 0 && _tr$doc$resolve$nodeB.isBlock) || tr.doc.resolve($lastNode.pos).nodeBefore === null) {
|
|
395
|
+
tr = tr.setSelection(_prosemirrorState.TextSelection.near(tr.doc.resolve(tr.mapping.map($cut.pos)), -1));
|
|
396
|
+
}
|
|
397
|
+
|
|
390
398
|
dispatch(tr.scrollIntoView());
|
|
391
399
|
}
|
|
392
400
|
|
|
@@ -69,6 +69,12 @@ var getDecorations = function getDecorations(doc) {
|
|
|
69
69
|
decorations.push(_prosemirrorView.Decoration.node(from, to, {
|
|
70
70
|
'data-indent-level': "".concat(depth)
|
|
71
71
|
}));
|
|
72
|
+
|
|
73
|
+
if (node.childCount >= 100) {
|
|
74
|
+
decorations.push(_prosemirrorView.Decoration.node(from, to, {
|
|
75
|
+
'data-child-count': '100+'
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
72
78
|
}
|
|
73
79
|
});
|
|
74
80
|
return _prosemirrorView.DecorationSet.empty.add(doc, decorations);
|
|
@@ -9,9 +9,9 @@ exports.listsStyles = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var listsStyles = (0,
|
|
16
|
+
var listsStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror li {\n position: relative;\n\n > p:not(:first-child) {\n margin: 4px 0 0 0;\n }\n }\n"])));
|
|
17
17
|
exports.listsStyles = listsStyles;
|
|
@@ -129,10 +129,11 @@ var joinSiblingLists = function joinSiblingLists(_ref) {
|
|
|
129
129
|
|
|
130
130
|
for (var i = joins.length - 1; i >= 0; i--) {
|
|
131
131
|
var listNode = tr.doc.nodeAt(joins[i]);
|
|
132
|
+
var listName = listNode === null || listNode === void 0 ? void 0 : listNode.type.name;
|
|
132
133
|
|
|
133
|
-
if (
|
|
134
|
-
var amount = result[
|
|
135
|
-
result[
|
|
134
|
+
if (listName && (listName === 'orderedList' || listName === 'bulletList')) {
|
|
135
|
+
var amount = result[listName] || 0;
|
|
136
|
+
result[listName] = amount + 1;
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
tr.join(joins[i]);
|
|
@@ -21,10 +21,6 @@ var _main = require("./pm-plugins/main");
|
|
|
21
21
|
|
|
22
22
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
23
23
|
|
|
24
|
-
var _mediaEditor = require("./pm-plugins/media-editor");
|
|
25
|
-
|
|
26
|
-
var _mediaEditorPluginFactory = require("./pm-plugins/media-editor-plugin-factory");
|
|
27
|
-
|
|
28
24
|
var _altText = require("./pm-plugins/alt-text");
|
|
29
25
|
|
|
30
26
|
var _keymap = _interopRequireDefault(require("./pm-plugins/alt-text/keymap"));
|
|
@@ -51,8 +47,6 @@ var _assets = require("../quick-insert/assets");
|
|
|
51
47
|
|
|
52
48
|
var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
|
|
53
49
|
|
|
54
|
-
var _MediaEditor = _interopRequireDefault(require("./ui/MediaEditor"));
|
|
55
|
-
|
|
56
50
|
var _MediaPicker = require("./ui/MediaPicker");
|
|
57
51
|
|
|
58
52
|
var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
@@ -151,13 +145,6 @@ var mediaPlugin = function mediaPlugin(options) {
|
|
|
151
145
|
});
|
|
152
146
|
}
|
|
153
147
|
|
|
154
|
-
if (options && options.allowAnnotation) {
|
|
155
|
-
pmPlugins.push({
|
|
156
|
-
name: 'mediaEditor',
|
|
157
|
-
plugin: _mediaEditor.createPlugin
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
148
|
if (options && options.allowAltTextOnImages) {
|
|
162
149
|
pmPlugins.push({
|
|
163
150
|
name: 'mediaAltText',
|
|
@@ -193,43 +180,26 @@ var mediaPlugin = function mediaPlugin(options) {
|
|
|
193
180
|
},
|
|
194
181
|
contentComponent: function contentComponent(_ref7) {
|
|
195
182
|
var editorView = _ref7.editorView,
|
|
196
|
-
eventDispatcher = _ref7.eventDispatcher,
|
|
197
183
|
appearance = _ref7.appearance;
|
|
198
|
-
// render MediaEditor separately because it doesn't depend on media plugin state
|
|
199
|
-
// so we can utilise EventDispatcher-based rerendering
|
|
200
|
-
var mediaEditor = options && options.allowAnnotation ? /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
201
|
-
editorView: editorView,
|
|
202
|
-
plugins: {
|
|
203
|
-
mediaEditorState: _mediaEditorPluginFactory.pluginKey
|
|
204
|
-
},
|
|
205
|
-
eventDispatcher: eventDispatcher,
|
|
206
|
-
render: function render(_ref8) {
|
|
207
|
-
var mediaEditorState = _ref8.mediaEditorState;
|
|
208
|
-
return /*#__PURE__*/_react.default.createElement(_MediaEditor.default, {
|
|
209
|
-
mediaEditorState: mediaEditorState,
|
|
210
|
-
view: editorView
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}) : null;
|
|
214
184
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
215
185
|
editorView: editorView,
|
|
216
186
|
plugins: {
|
|
217
187
|
mediaState: _main.stateKey
|
|
218
188
|
},
|
|
219
|
-
render: function render(
|
|
220
|
-
var mediaState =
|
|
189
|
+
render: function render(_ref8) {
|
|
190
|
+
var mediaState = _ref8.mediaState;
|
|
221
191
|
return /*#__PURE__*/_react.default.createElement(_MediaPicker.MediaPickerComponents, {
|
|
222
192
|
editorDomElement: editorView.dom,
|
|
223
193
|
mediaState: mediaState,
|
|
224
194
|
appearance: appearance
|
|
225
195
|
});
|
|
226
196
|
}
|
|
227
|
-
})
|
|
197
|
+
}));
|
|
228
198
|
},
|
|
229
|
-
secondaryToolbarComponent: function secondaryToolbarComponent(
|
|
230
|
-
var editorView =
|
|
231
|
-
eventDispatcher =
|
|
232
|
-
disabled =
|
|
199
|
+
secondaryToolbarComponent: function secondaryToolbarComponent(_ref9) {
|
|
200
|
+
var editorView = _ref9.editorView,
|
|
201
|
+
eventDispatcher = _ref9.eventDispatcher,
|
|
202
|
+
disabled = _ref9.disabled;
|
|
233
203
|
return /*#__PURE__*/_react.default.createElement(_ToolbarMedia.default, {
|
|
234
204
|
editorView: editorView,
|
|
235
205
|
eventDispatcher: eventDispatcher,
|
|
@@ -239,8 +209,8 @@ var mediaPlugin = function mediaPlugin(options) {
|
|
|
239
209
|
});
|
|
240
210
|
},
|
|
241
211
|
pluginsOptions: {
|
|
242
|
-
quickInsert: function quickInsert(
|
|
243
|
-
var formatMessage =
|
|
212
|
+
quickInsert: function quickInsert(_ref10) {
|
|
213
|
+
var formatMessage = _ref10.formatMessage;
|
|
244
214
|
return [{
|
|
245
215
|
id: 'media',
|
|
246
216
|
title: formatMessage(_messages.messages.filesAndImages),
|
|
@@ -272,7 +242,6 @@ var mediaPlugin = function mediaPlugin(options) {
|
|
|
272
242
|
allowMediaInline: options && (0, _mediaCommon.getMediaFeatureFlag)('mediaInline', options.featureFlags),
|
|
273
243
|
allowResizing: options && options.allowResizing,
|
|
274
244
|
allowResizingInTables: options && options.allowResizingInTables,
|
|
275
|
-
allowAnnotation: options && options.allowAnnotation,
|
|
276
245
|
allowLinking: options && options.allowLinking,
|
|
277
246
|
allowAdvancedToolBarOptions: options && options.allowAdvancedToolBarOptions,
|
|
278
247
|
allowAltTextOnImages: options && options.allowAltTextOnImages,
|
|
@@ -27,7 +27,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
27
27
|
|
|
28
28
|
var _react = _interopRequireDefault(require("react"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
32
|
var _colors = require("@atlaskit/theme/colors");
|
|
33
33
|
|
|
@@ -72,18 +72,12 @@ exports.CONTAINER_WIDTH_IN_PX = CONTAINER_WIDTH_IN_PX;
|
|
|
72
72
|
var MAX_ALT_TEXT_LENGTH = 510; // double tweet length
|
|
73
73
|
|
|
74
74
|
exports.MAX_ALT_TEXT_LENGTH = MAX_ALT_TEXT_LENGTH;
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
var ValidationWrapper = _styledComponents.default.section(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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 display: flex;\n flex-direction: column;\n"])), _colors.R400);
|
|
83
|
-
|
|
84
|
-
var ButtonWrapper = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n padding: 4px 8px;\n"])));
|
|
85
|
-
|
|
86
|
-
var ClearText = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _colors.N80);
|
|
75
|
+
var supportText = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: ", ";\n padding: 12px 40px;\n line-height: 20px;\n border-top: 1px solid ", ";\n margin: 0;\n"])), _colors.N100, (0, _editorSharedStyles.relativeFontSizeToBase16)(12), _colors.N30);
|
|
76
|
+
var container = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n display: flex;\n flex-direction: column;\n overflow: auto;\n line-height: 2;\n"])), CONTAINER_WIDTH_IN_PX);
|
|
77
|
+
var inputWrapper = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n line-height: 0;\n padding: 5px 0;\n align-items: center;\n"])));
|
|
78
|
+
var validationWrapper = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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"])), _colors.R400);
|
|
79
|
+
var buttonWrapper = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n padding: 4px 8px;\n"])));
|
|
80
|
+
var clearText = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _colors.N80);
|
|
87
81
|
|
|
88
82
|
var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
89
83
|
(0, _inherits2.default)(AltTextEditComponent, _React$Component);
|
|
@@ -186,26 +180,30 @@ var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
186
180
|
var formatMessage = this.props.intl.formatMessage;
|
|
187
181
|
var showClearTextButton = this.state.showClearTextButton;
|
|
188
182
|
var backButtonMessage = formatMessage(_messages.messages.back);
|
|
189
|
-
|
|
190
|
-
var backButtonMessageComponent = /*#__PURE__*/_react.default.createElement(keymaps.ToolTipContent, {
|
|
183
|
+
var backButtonMessageComponent = (0, _react2.jsx)(keymaps.ToolTipContent, {
|
|
191
184
|
description: backButtonMessage,
|
|
192
185
|
keymap: keymaps.escape,
|
|
193
186
|
shortcutOverride: "Esc"
|
|
194
187
|
});
|
|
195
|
-
|
|
196
188
|
var errorsList = (this.state.validationErrors || []).map(function (error, index) {
|
|
197
|
-
return
|
|
189
|
+
return (0, _react2.jsx)(_ui.ErrorMessage, {
|
|
198
190
|
key: index
|
|
199
191
|
}, error);
|
|
200
192
|
});
|
|
201
|
-
return
|
|
193
|
+
return (0, _react2.jsx)("div", {
|
|
194
|
+
css: container
|
|
195
|
+
}, (0, _react2.jsx)("section", {
|
|
196
|
+
css: inputWrapper
|
|
197
|
+
}, (0, _react2.jsx)("div", {
|
|
198
|
+
css: buttonWrapper
|
|
199
|
+
}, (0, _react2.jsx)(_Button.default, {
|
|
202
200
|
title: formatMessage(_messages.messages.back),
|
|
203
|
-
icon:
|
|
201
|
+
icon: (0, _react2.jsx)(_chevronLeftLarge.default, {
|
|
204
202
|
label: formatMessage(_messages.messages.back)
|
|
205
203
|
}),
|
|
206
204
|
tooltipContent: backButtonMessageComponent,
|
|
207
205
|
onClick: this.closeMediaAltTextMenu
|
|
208
|
-
})),
|
|
206
|
+
})), (0, _react2.jsx)(_PanelTextInput.default, {
|
|
209
207
|
testId: "alt-text-input",
|
|
210
208
|
ariaLabel: formatMessage(_messages.messages.placeholder),
|
|
211
209
|
describedById: "support-text",
|
|
@@ -217,15 +215,22 @@ var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
217
215
|
onSubmit: this.closeMediaAltTextMenu,
|
|
218
216
|
maxLength: MAX_ALT_TEXT_LENGTH,
|
|
219
217
|
autoFocus: true
|
|
220
|
-
}), showClearTextButton &&
|
|
218
|
+
}), showClearTextButton && (0, _react2.jsx)("div", {
|
|
219
|
+
css: buttonWrapper
|
|
220
|
+
}, (0, _react2.jsx)(_Button.default, {
|
|
221
221
|
testId: "alt-text-clear-button",
|
|
222
222
|
title: formatMessage(_messages.messages.clear),
|
|
223
|
-
icon:
|
|
223
|
+
icon: (0, _react2.jsx)("span", {
|
|
224
|
+
css: clearText
|
|
225
|
+
}, (0, _react2.jsx)(_crossCircle.default, {
|
|
224
226
|
label: formatMessage(_messages.messages.clear)
|
|
225
227
|
})),
|
|
226
228
|
tooltipContent: formatMessage(_messages.messages.clear),
|
|
227
229
|
onClick: this.handleClearText
|
|
228
|
-
}))), !!errorsList.length &&
|
|
230
|
+
}))), !!errorsList.length && (0, _react2.jsx)("section", {
|
|
231
|
+
css: validationWrapper
|
|
232
|
+
}, errorsList), (0, _react2.jsx)("p", {
|
|
233
|
+
css: supportText,
|
|
229
234
|
id: "support-text"
|
|
230
235
|
}, formatMessage(_messages.messages.supportText)));
|
|
231
236
|
}
|
|
@@ -292,9 +292,6 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
292
292
|
|
|
293
293
|
return type === mediaSingle;
|
|
294
294
|
});
|
|
295
|
-
(0, _defineProperty2.default)(this, "hasUserAuthProvider", function () {
|
|
296
|
-
return !!_this.uploadMediaClientConfig && !!_this.uploadMediaClientConfig.userAuthProvider;
|
|
297
|
-
});
|
|
298
295
|
(0, _defineProperty2.default)(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType) {
|
|
299
296
|
var _this$mediaOptions2;
|
|
300
297
|
|
|
@@ -377,11 +374,7 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
377
374
|
_this.onPopupToggleCallback(false);
|
|
378
375
|
});
|
|
379
376
|
(0, _defineProperty2.default)(this, "shouldUseMediaPickerPopup", function () {
|
|
380
|
-
|
|
381
|
-
return _this.hasUserAuthProvider();
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
return !!_this.mediaOptions.useMediaPickerPopup;
|
|
377
|
+
return false;
|
|
385
378
|
});
|
|
386
379
|
(0, _defineProperty2.default)(this, "showMediaPicker", function () {
|
|
387
380
|
if (_this.openMediaPickerBrowser && !_this.shouldUseMediaPickerPopup()) {
|
|
@@ -1,76 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
6
|
+
exports.pluginKey = void 0;
|
|
11
7
|
|
|
12
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
13
9
|
|
|
14
|
-
var _pluginStateFactory = require("../../../utils/plugin-state-factory");
|
|
15
|
-
|
|
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; }
|
|
17
|
-
|
|
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) { (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; }
|
|
19
|
-
|
|
20
10
|
var pluginKey = new _prosemirrorState.PluginKey('mediaEditorPlugin');
|
|
21
|
-
exports.pluginKey = pluginKey;
|
|
22
|
-
|
|
23
|
-
var reducer = function reducer(state, action) {
|
|
24
|
-
switch (action.type) {
|
|
25
|
-
case 'open':
|
|
26
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
27
|
-
editor: {
|
|
28
|
-
identifier: action.identifier,
|
|
29
|
-
pos: action.pos
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
case 'close':
|
|
34
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
35
|
-
editor: undefined
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
case 'upload':
|
|
39
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
40
|
-
editor: undefined
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
case 'setMediaClientConfig':
|
|
44
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
45
|
-
mediaClientConfig: action.mediaClientConfig
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
default:
|
|
49
|
-
return state;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
exports.reducer = reducer;
|
|
54
|
-
|
|
55
|
-
var _pluginFactory = (0, _pluginStateFactory.pluginFactory)(pluginKey, reducer, {
|
|
56
|
-
mapping: function mapping(tr, state) {
|
|
57
|
-
if (!state.editor) {
|
|
58
|
-
return state;
|
|
59
|
-
} // remap the position of the editing media inside the state
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// remap the position of the editing media inside the state
|
|
63
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
64
|
-
editor: _objectSpread(_objectSpread({}, state.editor), {}, {
|
|
65
|
-
pos: tr.mapping.map(state.editor.pos)
|
|
66
|
-
})
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
createPluginState = _pluginFactory.createPluginState,
|
|
71
|
-
createCommand = _pluginFactory.createCommand,
|
|
72
|
-
getPluginState = _pluginFactory.getPluginState;
|
|
73
|
-
|
|
74
|
-
exports.getPluginState = getPluginState;
|
|
75
|
-
exports.createCommand = createCommand;
|
|
76
|
-
exports.createPluginState = createPluginState;
|
|
11
|
+
exports.pluginKey = pluginKey;
|
|
@@ -21,7 +21,7 @@ var _mediaCard = require("@atlaskit/media-card");
|
|
|
21
21
|
|
|
22
22
|
var _templateObject;
|
|
23
23
|
|
|
24
|
-
var mediaStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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
|
|
24
|
+
var mediaStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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 ", " !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: rgb(255, 189, 173, 0.5); /* 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"])), _styles.mediaSingleSharedStyle, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide, _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide, _editorSharedStyles.akEditorMediaResizeHandlerPadding, _editorSharedStyles.akEditorMediaResizeHandlerPadding, _styles.richMediaClassName, _styles.richMediaClassName, _colors.N60, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedNodeClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _colors.B200, _editorSharedStyles.akEditorDeleteBackground, _editorSharedStyles.akEditorSelectedBorderBoldSize, _editorSharedStyles.akEditorDeleteBorder, _mediaCard.fileCardImageViewSelectedSelector, _editorSharedStyles.akEditorDeleteIconColor, _styles.richMediaClassName, _mediaCard.fileCardImageViewSelector, _editorSharedStyles.akEditorDeleteIconColor, _styles.richMediaClassName, _mediaCard.inlinePlayerClassName, _editorSharedStyles.akEditorDeleteIconColor, _styles.richMediaClassName, _mediaCard.newFileExperienceClassName, _editorSharedStyles.akEditorDeleteIconColor, _editorSharedStyles.akEditorDeleteIconColor);
|
|
25
25
|
/* `left: unset` above is to work around Chrome bug where rendering a div with
|
|
26
26
|
* that style applied inside a container that has a scroll, causes any svgs on
|
|
27
27
|
* the page, without a border, that are inside a flexbox, to no longer align to
|
|
@@ -29,8 +29,6 @@ var _pluginKey = require("../pm-plugins/plugin-key");
|
|
|
29
29
|
|
|
30
30
|
var _decoration = require("../../base/pm-plugins/decoration");
|
|
31
31
|
|
|
32
|
-
var _annotation = require("./annotation");
|
|
33
|
-
|
|
34
32
|
var _linking = require("./linking");
|
|
35
33
|
|
|
36
34
|
var _MediaAndEmbedsToolbar = _interopRequireDefault(require("../../../ui/MediaAndEmbedsToolbar"));
|
|
@@ -212,7 +210,6 @@ var generateMediaInlineFloatingToolbar = function generateMediaInlineFloatingToo
|
|
|
212
210
|
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState) {
|
|
213
211
|
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
214
212
|
var allowResizing = options.allowResizing,
|
|
215
|
-
allowAnnotation = options.allowAnnotation,
|
|
216
213
|
allowLinking = options.allowLinking,
|
|
217
214
|
allowAdvancedToolBarOptions = options.allowAdvancedToolBarOptions,
|
|
218
215
|
allowResizingInTables = options.allowResizingInTables,
|
|
@@ -222,16 +219,6 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
222
219
|
if (allowAdvancedToolBarOptions) {
|
|
223
220
|
toolbarButtons = (0, _MediaAndEmbedsToolbar.default)(state, intl, state.schema.nodes.mediaSingle, allowResizing, allowResizingInTables);
|
|
224
221
|
|
|
225
|
-
if (toolbarButtons.length) {
|
|
226
|
-
if (allowAnnotation) {
|
|
227
|
-
toolbarButtons.push({
|
|
228
|
-
type: 'custom',
|
|
229
|
-
fallback: [],
|
|
230
|
-
render: (0, _annotation.renderAnnotationButton)(pluginState, intl)
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
222
|
if (toolbarButtons.length) {
|
|
236
223
|
toolbarButtons.push({
|
|
237
224
|
type: 'separator'
|
|
@@ -59,7 +59,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
59
59
|
|
|
60
60
|
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; } }
|
|
61
61
|
|
|
62
|
-
var ValidationWrapper = _styledComponents.default.section(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
62
|
+
var ValidationWrapper = _styledComponents.default.section(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), _colors.R400);
|
|
63
63
|
|
|
64
64
|
var ButtonWrapper = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: 4px 8px 4px 0px;\n"])));
|
|
65
65
|
|
|
@@ -30,6 +30,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
30
30
|
|
|
31
31
|
var _react = _interopRequireDefault(require("react"));
|
|
32
32
|
|
|
33
|
+
var _react2 = require("@emotion/react");
|
|
34
|
+
|
|
33
35
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
34
36
|
|
|
35
37
|
var _mediaClient = require("@atlaskit/media-client");
|
|
@@ -430,13 +432,15 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
|
430
432
|
offsetLeft: this.state.offsetLeft,
|
|
431
433
|
wrappedLayout: this.wrappedLayout
|
|
432
434
|
};
|
|
433
|
-
return
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
435
|
+
return (0, _react2.jsx)("div", {
|
|
436
|
+
ref: this.saveWrapper,
|
|
437
|
+
css: (0, _styled.wrapperStyle)({
|
|
438
|
+
layout: layout,
|
|
439
|
+
isResized: !!pctWidth,
|
|
440
|
+
containerWidth: containerWidth || origWidth,
|
|
441
|
+
fullWidthMode: fullWidthMode
|
|
442
|
+
})
|
|
443
|
+
}, (0, _react2.jsx)(_Resizer.default, (0, _extends2.default)({}, this.props, {
|
|
440
444
|
ratio: ratio,
|
|
441
445
|
width: initialWidth,
|
|
442
446
|
selected: selected,
|
|
@@ -455,7 +459,7 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
|
455
459
|
// This workaround adds an empty div inside the resize handler to prevent the issue.
|
|
456
460
|
,
|
|
457
461
|
handleComponentFunc: function handleComponentFunc() {
|
|
458
|
-
return
|
|
462
|
+
return (0, _react2.jsx)("div", {
|
|
459
463
|
contentEditable: false
|
|
460
464
|
});
|
|
461
465
|
}
|
|
@@ -5,17 +5,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.wrapperStyle = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var wrapperStyle = function wrapperStyle(props) {
|
|
19
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & > div {\n ", ";\n position: relative;\n clear: both;\n }\n"])), (0, _ui.MediaSingleDimensionHelper)(props));
|
|
20
|
+
};
|
|
19
21
|
|
|
20
|
-
exports.
|
|
21
|
-
Wrapper.displayName = 'ResizerWrapper';
|
|
22
|
+
exports.wrapperStyle = wrapperStyle;
|
|
@@ -121,23 +121,27 @@ var insertMediaAsMediaSingle = function insertMediaAsMediaSingle(view, node, inp
|
|
|
121
121
|
exports.insertMediaAsMediaSingle = insertMediaAsMediaSingle;
|
|
122
122
|
|
|
123
123
|
var insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert) {
|
|
124
|
+
var _state$selection$$fro;
|
|
125
|
+
|
|
124
126
|
if (collection === undefined) {
|
|
125
127
|
return false;
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
var state = view.state,
|
|
129
131
|
dispatch = view.dispatch;
|
|
130
|
-
var
|
|
132
|
+
var grandParentType = (_state$selection$$fro = state.selection.$from.node(-1)) === null || _state$selection$$fro === void 0 ? void 0 : _state$selection$$fro.type;
|
|
133
|
+
var parentType = state.selection.$from.parent.type;
|
|
131
134
|
var node = createMediaSingleNode(state.schema, collection, alignLeftOnInsert)(mediaState);
|
|
132
|
-
var shouldSplit = grandParent && grandParent.type.validContent(_prosemirrorModel.Fragment.from(node));
|
|
133
135
|
var fileExtension;
|
|
134
136
|
|
|
135
137
|
if (mediaState.fileName) {
|
|
136
138
|
var extensionIdx = mediaState.fileName.lastIndexOf('.');
|
|
137
139
|
fileExtension = extensionIdx >= 0 ? mediaState.fileName.substring(extensionIdx + 1) : undefined;
|
|
138
|
-
}
|
|
140
|
+
} // should split if media is valid content for the grandparent of the selected node
|
|
141
|
+
// and the parent node is a paragraph
|
|
142
|
+
|
|
139
143
|
|
|
140
|
-
if (
|
|
144
|
+
if ((0, _insert.shouldSplitSelectedNodeOnNodeInsertion)(parentType, grandParentType, node)) {
|
|
141
145
|
insertNodesWithOptionalParagraph([node], {
|
|
142
146
|
fileExtension: fileExtension,
|
|
143
147
|
inputMethod: inputMethod
|
|
@@ -9,7 +9,7 @@ exports.mentionsStyles = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _mention = require("@atlaskit/editor-common/mention");
|
|
15
15
|
|
|
@@ -19,5 +19,5 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
19
19
|
|
|
20
20
|
var _templateObject;
|
|
21
21
|
|
|
22
|
-
var mentionsStyles = (0,
|
|
22
|
+
var mentionsStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Background]), _colors.N500, _mention.MentionSharedCssClassName.MENTION_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _editorSharedStyles.akEditorDeleteBackgroundWithOpacity, _mention.MentionSharedCssClassName.MENTION_CONTAINER, _colors.N30A, _colors.N500);
|
|
23
23
|
exports.mentionsStyles = mentionsStyles;
|