@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
|
@@ -43,6 +43,7 @@ export var ACTION;
|
|
|
43
43
|
ACTION["RE_RENDERED"] = "reRendered";
|
|
44
44
|
ACTION["ENTERED"] = "entered";
|
|
45
45
|
ACTION["ERRORED"] = "errored";
|
|
46
|
+
ACTION["EXPOSED"] = "exposed";
|
|
46
47
|
ACTION["FAILED_TO_UNMOUNT"] = "failedToUnmount";
|
|
47
48
|
ACTION["FIND_NEXT_PERFORMED"] = "findNextPerformed";
|
|
48
49
|
ACTION["FIND_PERFORMED"] = "findPerformed";
|
|
@@ -158,6 +159,7 @@ export var ACTION_SUBJECT;
|
|
|
158
159
|
ACTION_SUBJECT["EMBEDS"] = "embeds";
|
|
159
160
|
ACTION_SUBJECT["EXPAND"] = "expand";
|
|
160
161
|
ACTION_SUBJECT["EXTENSION"] = "extension";
|
|
162
|
+
ACTION_SUBJECT["FEATURE"] = "feature";
|
|
161
163
|
ACTION_SUBJECT["FEEDBACK_DIALOG"] = "feedbackDialog";
|
|
162
164
|
ACTION_SUBJECT["FIND_REPLACE_DIALOG"] = "findReplaceDialog";
|
|
163
165
|
ACTION_SUBJECT["FLOATING_CONTEXTUAL_BUTTON"] = "floatingContextualButton";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject;
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import AvatarsWithPluginState from '../../collab-edit/ui/avatars-with-plugin-state';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
9
|
import { useIntl } from 'react-intl-next';
|
|
9
10
|
import { avatarGroupMessages } from '../messages';
|
|
10
11
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../analytics';
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
});
|
|
12
|
+
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 0;\n align-items: center;\n & > div {\n margin-right: 0;\n }\n"])));
|
|
13
|
+
var toolbarButtonWrapperFullWidth = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n flex-grow: 1;\n"])), toolbarButtonWrapper);
|
|
14
14
|
|
|
15
15
|
var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
16
16
|
var dispatchAnalyticsEvent = props.dispatchAnalyticsEvent;
|
|
@@ -27,11 +27,11 @@ var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
|
27
27
|
eventType: EVENT_TYPE.UI
|
|
28
28
|
});
|
|
29
29
|
}, [dispatchAnalyticsEvent]);
|
|
30
|
-
return
|
|
30
|
+
return jsx("div", {
|
|
31
31
|
"aria-label": intl.formatMessage(avatarGroupMessages.editors),
|
|
32
32
|
"data-testid": 'avatar-group-in-plugin',
|
|
33
|
-
|
|
34
|
-
},
|
|
33
|
+
css: props.takeFullWidth ? toolbarButtonWrapperFullWidth : toolbarButtonWrapper
|
|
34
|
+
}, jsx(AvatarsWithPluginState, {
|
|
35
35
|
editorView: props.editorView,
|
|
36
36
|
eventDispatcher: props.eventDispatcher,
|
|
37
37
|
inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
|
|
@@ -34,12 +34,31 @@ var basePlugin = function basePlugin(options) {
|
|
|
34
34
|
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
35
35
|
return filterStepsPlugin(dispatchAnalyticsEvent);
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
}]; // In Chrome, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
38
|
+
// the cursor appears at the right most point of the parent container.
|
|
39
|
+
// In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
40
|
+
// no cursor is presented to users.
|
|
41
|
+
// In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
42
|
+
// the cursor appears inside the adjacent nodes.
|
|
43
|
+
// This plugin workarounds the issues with chrome and firefox by inserting decorations between
|
|
44
|
+
// inline nodes which are set as contenteditable, and have a zero width space.
|
|
45
|
+
// At time of development, using this workaround in Safari caused additional issues;
|
|
46
|
+
// - visual artifacts when moving across inline nodes (ie. using the arrow key to traverse a
|
|
47
|
+
// series of inline nodes)
|
|
48
|
+
// - blocking the right arrow key when at the start of a line from moving to the end of the
|
|
49
|
+
// previous line.
|
|
50
|
+
// As such we only apply the workaround for firefox and chrome.
|
|
51
|
+
|
|
52
|
+
if (browser.chrome || browser.gecko) {
|
|
53
|
+
plugins.push({
|
|
54
|
+
name: 'inlineCursorTargetPlugin',
|
|
55
|
+
plugin: function plugin() {
|
|
56
|
+
return options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
plugins.push({
|
|
43
62
|
name: 'focusHandlerPlugin',
|
|
44
63
|
plugin: function plugin(_ref2) {
|
|
45
64
|
var dispatch = _ref2.dispatch;
|
|
@@ -98,7 +117,7 @@ var basePlugin = function basePlugin(options) {
|
|
|
98
117
|
providerFactory = _ref5.providerFactory;
|
|
99
118
|
return betterTypeHistoryPlugin();
|
|
100
119
|
}
|
|
101
|
-
}
|
|
120
|
+
});
|
|
102
121
|
|
|
103
122
|
if (options && options.allowScrollGutter) {
|
|
104
123
|
plugins.push({
|
|
@@ -2,52 +2,18 @@ import { DecorationSet, Decoration } from 'prosemirror-view';
|
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from 'prosemirror-state';
|
|
4
4
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { isTextSelection } from '../../../utils';
|
|
5
6
|
export var inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
|
|
6
|
-
export var
|
|
7
|
-
|
|
8
|
-
return node && SPECIAL_NODES.indexOf(node.type.name) !== -1;
|
|
7
|
+
export var isInlineNodeView = function isInlineNodeView(node) {
|
|
8
|
+
return node && node.type.isInline && !node.type.isText;
|
|
9
9
|
};
|
|
10
|
-
export var
|
|
11
|
-
|
|
12
|
-
return $pos.pos + 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
var parentOffset = $pos.parentOffset,
|
|
16
|
-
parent = $pos.parent;
|
|
17
|
-
var docSize = tr.doc.nodeSize - 2;
|
|
18
|
-
|
|
19
|
-
if (parentOffset === parent.content.size && $pos.pos + 1 < docSize - 2) {
|
|
20
|
-
var _tr$doc$resolve = tr.doc.resolve($pos.pos + 1),
|
|
21
|
-
nodeAfter = _tr$doc$resolve.nodeAfter;
|
|
22
|
-
|
|
23
|
-
if (nodeAfter && isSpecial(nodeAfter.firstChild)) {
|
|
24
|
-
return $pos.pos + 2;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return;
|
|
10
|
+
export var findInlineNodeViewAfter = function findInlineNodeViewAfter($pos) {
|
|
11
|
+
return isInlineNodeView($pos.nodeAfter);
|
|
29
12
|
};
|
|
30
|
-
export var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if ($pos.pos === 0) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var parentOffset = $pos.parentOffset;
|
|
40
|
-
|
|
41
|
-
if (parentOffset === 0) {
|
|
42
|
-
var _tr$doc$resolve2 = tr.doc.resolve($pos.pos - 1),
|
|
43
|
-
nodeBefore = _tr$doc$resolve2.nodeBefore;
|
|
44
|
-
|
|
45
|
-
if (nodeBefore && isSpecial(nodeBefore.firstChild)) {
|
|
46
|
-
return $pos.pos - 2;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return;
|
|
13
|
+
export var findInlineNodeViewBefore = function findInlineNodeViewBefore($pos) {
|
|
14
|
+
return isInlineNodeView($pos.nodeBefore) || // This prevents the cursor from disappearing when at the beginning
|
|
15
|
+
// of a paragraph and next to an inline node view.
|
|
16
|
+
$pos.parentOffset === 0 && isInlineNodeView($pos.nodeAfter);
|
|
51
17
|
};
|
|
52
18
|
export default (function () {
|
|
53
19
|
return new SafePlugin({
|
|
@@ -55,26 +21,49 @@ export default (function () {
|
|
|
55
21
|
state: {
|
|
56
22
|
init: function init() {
|
|
57
23
|
return {
|
|
58
|
-
|
|
24
|
+
cursorTarget: undefined
|
|
59
25
|
};
|
|
60
26
|
},
|
|
61
27
|
apply: function apply(tr) {
|
|
62
28
|
var selection = tr.selection;
|
|
63
|
-
var $from = selection.$from
|
|
64
|
-
|
|
65
|
-
var posAfter = findSpecialNodeAfter($from, tr);
|
|
66
|
-
var posBefore = findSpecialNodeBefore($from, tr);
|
|
29
|
+
var $from = selection.$from,
|
|
30
|
+
$to = selection.$to;
|
|
67
31
|
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
32
|
+
if (selection && isTextSelection(selection)) {
|
|
33
|
+
var hasInlineNodeViewAfter = findInlineNodeViewAfter($from);
|
|
34
|
+
var hasInlineNodeViewBefore = findInlineNodeViewBefore($from); // Create editable widgets either side of the cursor to allow
|
|
35
|
+
// text input. This prevents issues with the cursor disappearing
|
|
36
|
+
// or apperaing in the wrong place when positioned between
|
|
37
|
+
// non contenteditable nodes.
|
|
38
|
+
// We check beforeInput events below to prevent content
|
|
39
|
+
// being added to the decorations.
|
|
40
|
+
|
|
41
|
+
if (hasInlineNodeViewAfter && hasInlineNodeViewBefore) {
|
|
42
|
+
var createWidget = function createWidget(side) {
|
|
43
|
+
var node = document.createElement('span');
|
|
44
|
+
node.contentEditable = 'true';
|
|
45
|
+
node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE));
|
|
46
|
+
return Decoration.widget(selection.from, node, {
|
|
47
|
+
raw: true,
|
|
48
|
+
side: side === 'left' ? -1 : 1,
|
|
49
|
+
key: 'inlineCursor'
|
|
50
|
+
});
|
|
51
|
+
};
|
|
71
52
|
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
return {
|
|
54
|
+
cursorTarget: {
|
|
55
|
+
decorations: [createWidget('left'), createWidget('right')],
|
|
56
|
+
positions: {
|
|
57
|
+
from: $from.pos,
|
|
58
|
+
to: $to.pos
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
74
63
|
}
|
|
75
64
|
|
|
76
65
|
return {
|
|
77
|
-
|
|
66
|
+
cursorTarget: undefined
|
|
78
67
|
};
|
|
79
68
|
}
|
|
80
69
|
},
|
|
@@ -82,24 +71,100 @@ export default (function () {
|
|
|
82
71
|
decorations: function decorations(state) {
|
|
83
72
|
var doc = state.doc;
|
|
84
73
|
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
var node = document.createElement('span');
|
|
91
|
-
node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE));
|
|
92
|
-
return Decoration.widget(position, node, {
|
|
93
|
-
raw: true,
|
|
94
|
-
side: -1,
|
|
95
|
-
key: 'inlineCursor'
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
return DecorationSet.create(doc, decorations);
|
|
74
|
+
var _ref = inlineCursorTargetStateKey.getState(state),
|
|
75
|
+
cursorTarget = _ref.cursorTarget;
|
|
76
|
+
|
|
77
|
+
if (cursorTargetHasValidDecorations(cursorTarget)) {
|
|
78
|
+
return DecorationSet.create(doc, cursorTarget.decorations);
|
|
99
79
|
}
|
|
100
80
|
|
|
101
81
|
return null;
|
|
82
|
+
},
|
|
83
|
+
handleDOMEvents: {
|
|
84
|
+
// Check the DOM to see if there are inline cursor targets
|
|
85
|
+
// after a composition event ends. If so, manually insert the
|
|
86
|
+
// event data in order to prevent contents ending up inside
|
|
87
|
+
// of the cursor target decorations.
|
|
88
|
+
compositionend: function compositionend(view, incorrectlyTypedEvent) {
|
|
89
|
+
// This is typed by the prosemirror definitions as Event,
|
|
90
|
+
// this type is incorrect, and it is actually an InputEvent
|
|
91
|
+
var event = incorrectlyTypedEvent;
|
|
92
|
+
var state = view.state;
|
|
93
|
+
|
|
94
|
+
var _ref2 = inlineCursorTargetStateKey.getState(state),
|
|
95
|
+
cursorTarget = _ref2.cursorTarget;
|
|
96
|
+
|
|
97
|
+
if (cursorTarget !== undefined) {
|
|
98
|
+
handleTextInputInsideCursorTargetDecoration({
|
|
99
|
+
event: event,
|
|
100
|
+
cursorTarget: cursorTarget,
|
|
101
|
+
view: view
|
|
102
|
+
});
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return false;
|
|
107
|
+
},
|
|
108
|
+
// Check the DOM to see if there are inline cursor targets
|
|
109
|
+
// before any input event. If so, manually insert the
|
|
110
|
+
// event data in order to prevent contents ending up inside
|
|
111
|
+
// of the cursor target decorations.
|
|
112
|
+
beforeinput: function beforeinput(view, incorrectlyTypedEvent) {
|
|
113
|
+
// This is typed by the prosemirror definitions as Event,
|
|
114
|
+
// this type is incorrect, and it is actually an InputEvent
|
|
115
|
+
var event = incorrectlyTypedEvent;
|
|
116
|
+
var state = view.state;
|
|
117
|
+
|
|
118
|
+
var _ref3 = inlineCursorTargetStateKey.getState(state),
|
|
119
|
+
cursorTarget = _ref3.cursorTarget;
|
|
120
|
+
|
|
121
|
+
if (!event.isComposing && cursorTarget !== undefined) {
|
|
122
|
+
handleTextInputInsideCursorTargetDecoration({
|
|
123
|
+
event: event,
|
|
124
|
+
cursorTarget: cursorTarget,
|
|
125
|
+
view: view
|
|
126
|
+
});
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
102
132
|
}
|
|
103
133
|
}
|
|
104
134
|
});
|
|
105
|
-
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
function cursorTargetHasValidDecorations(cursorTarget) {
|
|
138
|
+
if (!cursorTarget || // Decorations can end up as null when the decorations prop is
|
|
139
|
+
// called after the decorations have been removed from the dom.
|
|
140
|
+
// https://github.com/ProseMirror/prosemirror-view/blob/8f0d313a6389b86a335274fba36534ba1cb21f12/src/decoration.js#L30
|
|
141
|
+
cursorTarget.decorations.includes(null)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function handleTextInputInsideCursorTargetDecoration(_ref4) {
|
|
149
|
+
var event = _ref4.event,
|
|
150
|
+
view = _ref4.view,
|
|
151
|
+
cursorTarget = _ref4.cursorTarget;
|
|
152
|
+
event.stopPropagation();
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
var content = event.data || '';
|
|
155
|
+
var tr = view.state.tr; // ensure any custom handleTextInput handlers are called for the input event
|
|
156
|
+
// ie. type ahead, emoji shortcuts.
|
|
157
|
+
|
|
158
|
+
var potentiallyHandleByHandleTextInput = view.someProp('handleTextInput', function (f) {
|
|
159
|
+
return f(view, cursorTarget.positions.from, cursorTarget.positions.to, content);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
if (potentiallyHandleByHandleTextInput) {
|
|
163
|
+
// if a handleTextInput handler has handled the event, we don't want to
|
|
164
|
+
// manually update the document.
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
tr.insertText(content);
|
|
169
|
+
view.dispatch(tr);
|
|
170
|
+
}
|
|
@@ -2,11 +2,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
|
+
var beforePrimaryToolbarPluginWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-right: 8px;\n flex-grow: 1;\n justify-content: flex-end;\n align-items: center;\n"])));
|
|
8
8
|
export var BeforePrimaryToolbarWrapper = function BeforePrimaryToolbarWrapper(props) {
|
|
9
|
-
return
|
|
9
|
+
return jsx("div", {
|
|
10
|
+
css: beforePrimaryToolbarPluginWrapper,
|
|
10
11
|
"data-testid": 'before-primary-toolbar-components-plugin'
|
|
11
12
|
}, props.beforePrimaryToolbarComponents);
|
|
12
13
|
};
|
|
@@ -6,8 +6,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6
6
|
|
|
7
7
|
import { Selection } from 'prosemirror-state';
|
|
8
8
|
import { findWrapping } from 'prosemirror-transform';
|
|
9
|
+
import { safeInsert } from 'prosemirror-utils';
|
|
9
10
|
import { CODE_BLOCK, BLOCK_QUOTE, PANEL, HEADINGS_BY_NAME, NORMAL_TEXT } from '../types';
|
|
10
11
|
import { removeBlockMarks } from '../../../utils/mark';
|
|
12
|
+
import { shouldSplitSelectedNodeOnNodeInsertion } from '../../../utils/insert';
|
|
11
13
|
import { withAnalytics, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
|
|
12
14
|
import { filterChildrenBetween } from '../../../utils';
|
|
13
15
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
@@ -230,7 +232,6 @@ function wrapSelectionIn(type) {
|
|
|
230
232
|
var _state$selection3 = state.selection,
|
|
231
233
|
$from = _state$selection3.$from,
|
|
232
234
|
$to = _state$selection3.$to;
|
|
233
|
-
var paragraph = state.schema.nodes.paragraph;
|
|
234
235
|
var _state$schema$marks = state.schema.marks,
|
|
235
236
|
alignment = _state$schema$marks.alignment,
|
|
236
237
|
indentation = _state$schema$marks.indentation;
|
|
@@ -245,8 +246,7 @@ function wrapSelectionIn(type) {
|
|
|
245
246
|
tr.wrap(range, wrapping).scrollIntoView();
|
|
246
247
|
} else {
|
|
247
248
|
/** We always want to append a block type */
|
|
248
|
-
|
|
249
|
-
tr.setSelection(Selection.near(tr.doc.resolve(state.selection.to + 1)));
|
|
249
|
+
safeInsert(type.createAndFill())(tr).scrollIntoView();
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
if (dispatch) {
|
|
@@ -263,15 +263,25 @@ function wrapSelectionIn(type) {
|
|
|
263
263
|
|
|
264
264
|
function insertCodeBlock() {
|
|
265
265
|
return function (state, dispatch) {
|
|
266
|
+
var _state$selection$$fro;
|
|
267
|
+
|
|
266
268
|
var tr = state.tr;
|
|
267
|
-
var $
|
|
269
|
+
var _state$selection4 = state.selection,
|
|
270
|
+
$to = _state$selection4.$to,
|
|
271
|
+
$from = _state$selection4.$from;
|
|
268
272
|
var codeBlock = state.schema.nodes.codeBlock;
|
|
269
|
-
var
|
|
270
|
-
var
|
|
271
|
-
/** We always want to append a block type
|
|
273
|
+
var grandParentType = (_state$selection$$fro = state.selection.$from.node(-1)) === null || _state$selection$$fro === void 0 ? void 0 : _state$selection$$fro.type;
|
|
274
|
+
var parentType = state.selection.$from.parent.type;
|
|
275
|
+
/** We always want to append a block type unless we're inserting into a paragraph
|
|
276
|
+
* AND it's a valid child of the grandparent node
|
|
277
|
+
*/
|
|
272
278
|
|
|
273
|
-
|
|
274
|
-
|
|
279
|
+
if (shouldSplitSelectedNodeOnNodeInsertion(parentType, grandParentType, codeBlock.createAndFill())) {
|
|
280
|
+
tr.replaceRangeWith($from.pos, $to.pos, codeBlock.createAndFill());
|
|
281
|
+
tr.setSelection(Selection.near(tr.doc.resolve(state.selection.to)));
|
|
282
|
+
} else {
|
|
283
|
+
safeInsert(codeBlock.createAndFill())(tr).scrollIntoView();
|
|
284
|
+
}
|
|
275
285
|
|
|
276
286
|
if (dispatch) {
|
|
277
287
|
dispatch(tr);
|
|
@@ -13,7 +13,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
13
|
|
|
14
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; } }
|
|
15
15
|
|
|
16
|
+
/** @jsx jsx */
|
|
16
17
|
import React from 'react';
|
|
18
|
+
import { css, jsx } from '@emotion/react';
|
|
17
19
|
import * as colors from '@atlaskit/theme/colors';
|
|
18
20
|
import { injectIntl } from 'react-intl-next';
|
|
19
21
|
import { findParentDomRefOfType, findDomRefAtPos } from 'prosemirror-utils';
|
|
@@ -21,7 +23,6 @@ import { Popup } from '@atlaskit/editor-common/ui';
|
|
|
21
23
|
import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
|
|
22
24
|
import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
|
|
23
25
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
24
|
-
import styled from 'styled-components';
|
|
25
26
|
import { getBreakoutMode } from '../utils/get-breakout-mode';
|
|
26
27
|
import { setBreakoutMode } from '../commands/set-breakout-mode';
|
|
27
28
|
import { removeBreakout } from '../commands/remove-breakout';
|
|
@@ -34,7 +35,7 @@ import { isSupportedNodeForBreakout } from '../utils/is-supported-node';
|
|
|
34
35
|
var B300 = colors.B300,
|
|
35
36
|
N300 = colors.N300,
|
|
36
37
|
N20A = colors.N20A;
|
|
37
|
-
var
|
|
38
|
+
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && button {\n background: ", ";\n color: ", ";\n :hover {\n background: ", ";\n color: white !important;\n }\n }\n"])), N20A, N300, B300);
|
|
38
39
|
var BREAKOUT_MODE = {
|
|
39
40
|
FULL_WIDTH: 'full-width',
|
|
40
41
|
CENTER: 'center',
|
|
@@ -138,7 +139,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
138
139
|
element = closestEl.firstChild;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
|
-
return
|
|
142
|
+
return jsx(Popup, {
|
|
142
143
|
ariaLabel: title,
|
|
143
144
|
target: element,
|
|
144
145
|
offset: [5, 0],
|
|
@@ -149,13 +150,15 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
149
150
|
scrollableElement: scrollableElement,
|
|
150
151
|
stick: true,
|
|
151
152
|
forcePlacement: true
|
|
152
|
-
},
|
|
153
|
+
}, jsx("div", {
|
|
154
|
+
css: toolbarButtonWrapper
|
|
155
|
+
}, jsx(ToolbarButton, {
|
|
153
156
|
title: title,
|
|
154
157
|
testId: titleMessage.id,
|
|
155
158
|
onClick: this.handleClick(nextBreakoutMode),
|
|
156
|
-
iconBefore: breakoutMode === BREAKOUT_MODE.FULL_WIDTH ?
|
|
159
|
+
iconBefore: breakoutMode === BREAKOUT_MODE.FULL_WIDTH ? jsx(CollapseIcon, {
|
|
157
160
|
label: title
|
|
158
|
-
}) :
|
|
161
|
+
}) : jsx(ExpandIcon, {
|
|
159
162
|
label: title
|
|
160
163
|
})
|
|
161
164
|
})));
|
|
@@ -15,11 +15,11 @@ import React from 'react';
|
|
|
15
15
|
import PropTypes from 'prop-types';
|
|
16
16
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
17
17
|
import { titleUrlPairFromNode } from '../utils';
|
|
18
|
-
import {
|
|
18
|
+
import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
|
|
19
19
|
export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
20
|
-
var _class
|
|
20
|
+
var _class;
|
|
21
21
|
|
|
22
|
-
return
|
|
22
|
+
return _class = /*#__PURE__*/function (_React$Component) {
|
|
23
23
|
_inherits(_class, _React$Component);
|
|
24
24
|
|
|
25
25
|
var _super = _createSuper(_class);
|
|
@@ -95,7 +95,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
changeSelectedCardToLinkFallback(undefined, url, true, node, getPos())(view.state, view.dispatch);
|
|
99
99
|
return null;
|
|
100
100
|
} else {
|
|
101
101
|
// Otherwise, render a blue link as fallback (above in render()).
|
|
@@ -109,5 +109,5 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
109
109
|
return _class;
|
|
110
110
|
}(React.Component), _defineProperty(_class, "contextTypes", {
|
|
111
111
|
contextAdapter: PropTypes.object
|
|
112
|
-
}),
|
|
112
|
+
}), _class;
|
|
113
113
|
}
|
|
@@ -19,6 +19,7 @@ import { shouldReplaceLink } from './shouldReplaceLink';
|
|
|
19
19
|
import { SMART_LINK_TYPE } from '../../../plugins/analytics/types/node-events';
|
|
20
20
|
import { getLinkCreationAnalyticsEvent } from '../../../plugins/hyperlink/analytics';
|
|
21
21
|
import { unlinkPayload } from '../../../utils/linking-utils';
|
|
22
|
+
import { getFeatureFlags } from '../../feature-flags-context';
|
|
22
23
|
export function insertCard(tr, cardAdf, schema) {
|
|
23
24
|
var inlineCard = schema.nodes.inlineCard; // ED-5638: add an extra space after inline cards to avoid re-rendering them
|
|
24
25
|
|
|
@@ -213,6 +214,43 @@ export var convertHyperlinkToSmartCard = function convertHyperlinkToSmartCard(st
|
|
|
213
214
|
return queueCards(requests)(state.tr);
|
|
214
215
|
};
|
|
215
216
|
export var changeSelectedCardToLink = function changeSelectedCardToLink(text, href, sendAnalytics, node, pos) {
|
|
217
|
+
return function (state, dispatch) {
|
|
218
|
+
var tr;
|
|
219
|
+
|
|
220
|
+
if (node && pos) {
|
|
221
|
+
tr = cardNodeToLinkWithTransaction(state, text, href, node, pos);
|
|
222
|
+
} else {
|
|
223
|
+
tr = cardToLinkWithTransaction(state, text, href);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
var selectedNode = state.selection instanceof NodeSelection && state.selection.node;
|
|
227
|
+
|
|
228
|
+
if (sendAnalytics) {
|
|
229
|
+
if (selectedNode) {
|
|
230
|
+
var _getFeatureFlags = getFeatureFlags(state),
|
|
231
|
+
viewChangingExperimentToolbarStyle = _getFeatureFlags.viewChangingExperimentToolbarStyle;
|
|
232
|
+
|
|
233
|
+
addAnalytics(state, tr, {
|
|
234
|
+
action: ACTION.CHANGED_TYPE,
|
|
235
|
+
actionSubject: ACTION_SUBJECT.SMART_LINK,
|
|
236
|
+
eventType: EVENT_TYPE.TRACK,
|
|
237
|
+
attributes: {
|
|
238
|
+
newType: SMART_LINK_TYPE.URL,
|
|
239
|
+
previousType: appearanceForNodeType(selectedNode.type),
|
|
240
|
+
featureFlag: viewChangingExperimentToolbarStyle || 'noChange'
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (dispatch) {
|
|
247
|
+
dispatch(tr.scrollIntoView());
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return true;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
export var changeSelectedCardToLinkFallback = function changeSelectedCardToLinkFallback(text, href, sendAnalytics, node, pos) {
|
|
216
254
|
return function (state, dispatch) {
|
|
217
255
|
var tr;
|
|
218
256
|
|
|
@@ -224,11 +262,11 @@ export var changeSelectedCardToLink = function changeSelectedCardToLink(text, hr
|
|
|
224
262
|
|
|
225
263
|
if (sendAnalytics) {
|
|
226
264
|
addAnalytics(state, tr, {
|
|
227
|
-
action: ACTION.
|
|
265
|
+
action: ACTION.ERRORED,
|
|
228
266
|
actionSubject: ACTION_SUBJECT.SMART_LINK,
|
|
229
|
-
eventType: EVENT_TYPE.
|
|
267
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
230
268
|
attributes: {
|
|
231
|
-
|
|
269
|
+
error: 'Smart card falling back to link.'
|
|
232
270
|
}
|
|
233
271
|
});
|
|
234
272
|
}
|
|
@@ -326,13 +364,18 @@ export var setSelectedCardAppearance = function setSelectedCardAppearance(appear
|
|
|
326
364
|
var from = state.selection.from;
|
|
327
365
|
var nodeType = getLinkNodeType(appearance, state.schema.nodes);
|
|
328
366
|
var tr = state.tr.setNodeMarkup(from, nodeType, attrs, selectedNode.marks);
|
|
367
|
+
|
|
368
|
+
var _getFeatureFlags2 = getFeatureFlags(state),
|
|
369
|
+
viewChangingExperimentToolbarStyle = _getFeatureFlags2.viewChangingExperimentToolbarStyle;
|
|
370
|
+
|
|
329
371
|
addAnalytics(state, tr, {
|
|
330
372
|
action: ACTION.CHANGED_TYPE,
|
|
331
373
|
actionSubject: ACTION_SUBJECT.SMART_LINK,
|
|
332
374
|
eventType: EVENT_TYPE.TRACK,
|
|
333
375
|
attributes: {
|
|
334
376
|
newType: appearance,
|
|
335
|
-
previousType: appearanceForNodeType(selectedNode.type)
|
|
377
|
+
previousType: appearanceForNodeType(selectedNode.type),
|
|
378
|
+
featureFlag: viewChangingExperimentToolbarStyle || 'noChange'
|
|
336
379
|
}
|
|
337
380
|
});
|
|
338
381
|
|
|
@@ -7,13 +7,15 @@ import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './
|
|
|
7
7
|
import { EmbedCard } from '../nodeviews/embedCard';
|
|
8
8
|
import { BlockCard } from '../nodeviews/blockCard';
|
|
9
9
|
import { InlineCard } from '../nodeviews/inlineCard';
|
|
10
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../../plugins/analytics';
|
|
10
11
|
export { pluginKey } from './plugin-key';
|
|
11
12
|
export var createPlugin = function createPlugin(options) {
|
|
12
13
|
return function (_ref) {
|
|
13
14
|
var portalProviderAPI = _ref.portalProviderAPI,
|
|
14
15
|
eventDispatcher = _ref.eventDispatcher,
|
|
15
16
|
providerFactory = _ref.providerFactory,
|
|
16
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent
|
|
17
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
18
|
+
featureFlags = _ref.featureFlags;
|
|
17
19
|
var platform = options.platform,
|
|
18
20
|
allowResizing = options.allowResizing,
|
|
19
21
|
useAlternativePreloader = options.useAlternativePreloader,
|
|
@@ -22,6 +24,18 @@ export var createPlugin = function createPlugin(options) {
|
|
|
22
24
|
return new SafePlugin({
|
|
23
25
|
state: {
|
|
24
26
|
init: function init() {
|
|
27
|
+
var viewChangingExperimentToolbarStyle = featureFlags.viewChangingExperimentToolbarStyle;
|
|
28
|
+
dispatchAnalyticsEvent({
|
|
29
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
30
|
+
action: ACTION.EXPOSED,
|
|
31
|
+
actionSubject: ACTION_SUBJECT.FEATURE,
|
|
32
|
+
attributes: {
|
|
33
|
+
flagKey: 'confluence.frontend.fabric.editor.view-changing-experiment-toolbar-style',
|
|
34
|
+
value: viewChangingExperimentToolbarStyle || 'noChange'
|
|
35
|
+
},
|
|
36
|
+
source: '@atlaskit/feature-flag-client',
|
|
37
|
+
tags: ['measurement']
|
|
38
|
+
});
|
|
25
39
|
return {
|
|
26
40
|
requests: [],
|
|
27
41
|
provider: null,
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import { css } from '
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { SelectionStyle, getSelectionStyles, akEditorDeleteBorder, akEditorDeleteBackground } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { N20 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|