@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
package/dist/cjs/version.json
CHANGED
|
@@ -4,7 +4,7 @@ import uuid from 'uuid';
|
|
|
4
4
|
import memoizeOne from 'memoize-one';
|
|
5
5
|
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
7
|
-
import {
|
|
7
|
+
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../plugins/analytics';
|
|
9
9
|
import { editorAnalyticsChannel } from '../plugins/analytics/consts';
|
|
10
10
|
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
@@ -151,7 +151,7 @@ export class ErrorBoundaryWithEditorView extends React.Component {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
render() {
|
|
154
|
-
return /*#__PURE__*/React.createElement(
|
|
154
|
+
return /*#__PURE__*/React.createElement(IntlErrorBoundary, null, this.props.children);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
}
|
|
@@ -9,7 +9,7 @@ import { ExperienceStore, EditorExperience, RELIABILITY_INTERVAL } from '@atlask
|
|
|
9
9
|
import { createDispatch, EventDispatcher } from '../event-dispatcher';
|
|
10
10
|
import { processRawValue } from '../utils';
|
|
11
11
|
import { freezeUnsafeTransactionProperties } from '../utils/performance/safer-transactions';
|
|
12
|
-
import { RenderTracking } from '../utils/
|
|
12
|
+
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
13
13
|
import { findChangedNodesFromTransaction, validateNodes, validNode } from '../utils/nodes';
|
|
14
14
|
import createPluginList from './create-plugins-list';
|
|
15
15
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent, FULL_WIDTH_MODE, getAnalyticsEventsFromTransaction, PLATFORMS } from '../plugins/analytics';
|
package/dist/es2019/editor.js
CHANGED
|
@@ -7,7 +7,7 @@ import uuid from 'uuid/v4';
|
|
|
7
7
|
import { name, version } from './version-wrapper';
|
|
8
8
|
import { combineExtensionProviders } from '@atlaskit/editor-common/extensions';
|
|
9
9
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
10
|
-
import { BaseTheme, WithCreateAnalyticsEvent, WidthProvider
|
|
10
|
+
import { BaseTheme, WithCreateAnalyticsEvent, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
11
11
|
import { getAnalyticsAppearance, startMeasure, stopMeasure, clearMeasure, measureTTI, getTTISeverity } from '@atlaskit/editor-common/utils';
|
|
12
12
|
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
13
13
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
@@ -24,7 +24,7 @@ import { combineQuickInsertProviders, extensionProviderToQuickInsertProvider } f
|
|
|
24
24
|
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from './plugins/analytics';
|
|
25
25
|
import ErrorBoundary from './create-editor/ErrorBoundary';
|
|
26
26
|
import { createFeatureFlagsFromProps } from './plugins/feature-flags-context/feature-flags-from-props';
|
|
27
|
-
import { RenderTracking } from './utils/
|
|
27
|
+
import { RenderTracking } from './utils/performance/components/RenderTracking';
|
|
28
28
|
const WidthProviderFullHeight = styled(WidthProvider)`
|
|
29
29
|
height: 100%;
|
|
30
30
|
`;
|
|
@@ -421,7 +421,7 @@ export default class Editor extends React.Component {
|
|
|
421
421
|
const renderTracking = (_this$props$performan3 = this.props.performanceTracking) === null || _this$props$performan3 === void 0 ? void 0 : (_this$props$performan4 = _this$props$performan3.renderTracking) === null || _this$props$performan4 === void 0 ? void 0 : _this$props$performan4.editor;
|
|
422
422
|
const renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
423
423
|
const useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
424
|
-
|
|
424
|
+
return /*#__PURE__*/React.createElement(FabricEditorAnalyticsContext, {
|
|
425
425
|
data: {
|
|
426
426
|
packageName: name,
|
|
427
427
|
packageVersion: version,
|
|
@@ -491,7 +491,6 @@ export default class Editor extends React.Component {
|
|
|
491
491
|
customSecondaryToolbarComponents: this.props.secondaryToolbarComponents,
|
|
492
492
|
contextPanel: this.props.contextPanel,
|
|
493
493
|
collabEdit: this.props.collabEdit,
|
|
494
|
-
allowAnnotation: !!this.props.annotationProviders,
|
|
495
494
|
persistScrollGutter: this.props.persistScrollGutter,
|
|
496
495
|
enableToolbarMinWidth: ((_this$props$featureFl5 = this.props.featureFlags) === null || _this$props$featureFl5 === void 0 ? void 0 : _this$props$featureFl5.toolbarMinWidthOverflow) != null ? !!((_this$props$featureFl6 = this.props.featureFlags) !== null && _this$props$featureFl6 !== void 0 && _this$props$featureFl6.toolbarMinWidthOverflow) : this.props.UNSAFE_allowUndoRedoButtons,
|
|
497
496
|
useStickyToolbar: this.props.useStickyToolbar,
|
|
@@ -503,7 +502,6 @@ export default class Editor extends React.Component {
|
|
|
503
502
|
}))
|
|
504
503
|
}))))))
|
|
505
504
|
}));
|
|
506
|
-
return /*#__PURE__*/React.createElement(LegacyToNextIntlProvider, null, /*#__PURE__*/React.createElement(IntlLegacyFallbackProvider, null, editor));
|
|
507
505
|
}
|
|
508
506
|
|
|
509
507
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React, { Fragment } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
2
4
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
5
|
import { N400 } from '@atlaskit/theme/colors';
|
|
5
6
|
export const addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
6
7
|
export const toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
|
|
@@ -72,10 +73,13 @@ const arrowKeysMap = {
|
|
|
72
73
|
ARROWUP: '\u2191',
|
|
73
74
|
ARROWDOWN: '\u2193'
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
const tooltipShortcutStyle = css`
|
|
76
77
|
border-radius: 2px;
|
|
77
78
|
background-color: ${N400};
|
|
78
79
|
padding: 0 2px;
|
|
80
|
+
/* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */
|
|
81
|
+
/* stylelint-disable-next-line */
|
|
82
|
+
label: tooltip-shortcut;
|
|
79
83
|
`;
|
|
80
84
|
|
|
81
85
|
function formatShortcut(keymap) {
|
|
@@ -114,7 +118,9 @@ export const ToolTipContent = /*#__PURE__*/React.memo(({
|
|
|
114
118
|
keymap
|
|
115
119
|
}) => {
|
|
116
120
|
const shortcut = shortcutOverride || keymap && formatShortcut(keymap);
|
|
117
|
-
return shortcut || description ?
|
|
121
|
+
return shortcut || description ? jsx(Fragment, null, description, shortcut && description && '\u00A0', shortcut && jsx("span", {
|
|
122
|
+
css: tooltipShortcutStyle
|
|
123
|
+
}, shortcut)) : null;
|
|
118
124
|
});
|
|
119
125
|
export function findKeymapByDescription(description) {
|
|
120
126
|
const matches = ALL.filter(keymap => keymap.description.toUpperCase() === description.toUpperCase());
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import rafSchedule from 'raf-schd';
|
|
3
5
|
import React from 'react';
|
|
4
|
-
import
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
5
7
|
import { N30 } from '@atlaskit/theme/colors';
|
|
6
8
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
9
|
import { BaseTheme } from '@atlaskit/editor-common/ui';
|
|
@@ -10,22 +12,21 @@ import ContentStyles from '../../ui/ContentStyles';
|
|
|
10
12
|
import WidthEmitter from '../../ui/WidthEmitter';
|
|
11
13
|
import { ClickAreaBlock } from '../../ui/Addon';
|
|
12
14
|
import { scrollbarStyles } from '../../ui/styles';
|
|
13
|
-
import {
|
|
15
|
+
import { tableFullPageEditorStyles } from '../../plugins/table/ui/common-styles';
|
|
14
16
|
import AvatarsWithPluginState from '../../plugins/collab-edit/ui';
|
|
15
17
|
import { Editor, EditorContent, useEditorSharedConfig } from './Editor';
|
|
16
18
|
import { Toolbar } from './Toolbar';
|
|
17
19
|
import { ContentComponents } from './ContentComponents';
|
|
18
20
|
import { useCreateAnalyticsHandler } from './internal/hooks/use-analytics';
|
|
19
21
|
import { ContextPanelWidthProvider } from '../../ui/ContextPanel/context';
|
|
20
|
-
const
|
|
22
|
+
const fullPageEditorWrapper = css`
|
|
21
23
|
min-width: 340px;
|
|
22
24
|
height: 100%;
|
|
23
25
|
display: flex;
|
|
24
26
|
flex-direction: column;
|
|
25
27
|
box-sizing: border-box;
|
|
26
28
|
`;
|
|
27
|
-
|
|
28
|
-
const ScrollContainer = styled(ContentStyles)`
|
|
29
|
+
const scrollContainer = css`
|
|
29
30
|
flex-grow: 1;
|
|
30
31
|
overflow-y: scroll;
|
|
31
32
|
position: relative;
|
|
@@ -34,25 +35,22 @@ const ScrollContainer = styled(ContentStyles)`
|
|
|
34
35
|
scroll-behavior: smooth;
|
|
35
36
|
${scrollbarStyles};
|
|
36
37
|
`;
|
|
37
|
-
ScrollContainer.displayName = 'ScrollContainer';
|
|
38
38
|
const GUTTER_PADDING = 32;
|
|
39
39
|
const GUTTER_STYLE = {
|
|
40
40
|
padding: `0 ${GUTTER_PADDING}px`
|
|
41
41
|
};
|
|
42
|
-
const
|
|
42
|
+
const contentArea = css`
|
|
43
43
|
display: flex;
|
|
44
44
|
flex-direction: row;
|
|
45
45
|
height: 100%;
|
|
46
46
|
box-sizing: border-box;
|
|
47
47
|
`;
|
|
48
|
-
|
|
49
|
-
const
|
|
48
|
+
|
|
49
|
+
const editorContentArea = theme => css`
|
|
50
50
|
line-height: 24px;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
53
|
-
max-width: ${
|
|
54
|
-
theme
|
|
55
|
-
}) => theme.layoutMaxWidth + GUTTER_PADDING * 2}px;
|
|
53
|
+
max-width: ${theme.layoutMaxWidth + GUTTER_PADDING * 2}px;
|
|
56
54
|
padding-top: 50px;
|
|
57
55
|
margin: 0 auto;
|
|
58
56
|
display: flex;
|
|
@@ -81,13 +79,14 @@ const EditorContentArea = styled.div`
|
|
|
81
79
|
clear: none;
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
|
-
${
|
|
82
|
+
${tableFullPageEditorStyles};
|
|
85
83
|
`;
|
|
86
|
-
|
|
87
|
-
const
|
|
84
|
+
|
|
85
|
+
const mainToolbar = css`
|
|
88
86
|
position: relative;
|
|
89
87
|
align-items: center;
|
|
90
|
-
box-shadow:
|
|
88
|
+
box-shadow: 'none';
|
|
89
|
+
|
|
91
90
|
transition: box-shadow 200ms;
|
|
92
91
|
z-index: ${akEditorMenuZIndex};
|
|
93
92
|
display: flex;
|
|
@@ -99,27 +98,19 @@ const MainToolbar = styled.div`
|
|
|
99
98
|
height: 0 !important;
|
|
100
99
|
}
|
|
101
100
|
`;
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
const mainToolbarWithKeyline = css`
|
|
102
|
+
${mainToolbar}
|
|
103
|
+
box-shadow: 0 ${akEditorToolbarKeylineHeight}px 0 0 ${N30}
|
|
104
|
+
`;
|
|
105
|
+
const mainToolbarCustomComponentsSlot = css`
|
|
104
106
|
display: flex;
|
|
105
107
|
justify-content: flex-end;
|
|
106
108
|
flex-grow: 1;
|
|
107
109
|
`;
|
|
108
|
-
|
|
109
|
-
const SecondaryToolbar = styled.div`
|
|
110
|
-
box-sizing: border-box;
|
|
111
|
-
justify-content: flex-end;
|
|
112
|
-
align-items: center;
|
|
113
|
-
flex-shrink: 0;
|
|
114
|
-
display: flex;
|
|
115
|
-
padding: 24px 0;
|
|
116
|
-
`;
|
|
117
|
-
SecondaryToolbar.displayName = 'SecondaryToolbar';
|
|
118
|
-
const SidebarArea = styled.div`
|
|
110
|
+
const sidebarArea = css`
|
|
119
111
|
height: 100%;
|
|
120
112
|
box-sizing: border-box;
|
|
121
113
|
`;
|
|
122
|
-
SidebarArea.displayName = 'SidebarArea';
|
|
123
114
|
|
|
124
115
|
function useKeyline() {
|
|
125
116
|
const [showKeyline, setShowKeyline] = React.useState(false);
|
|
@@ -167,31 +158,41 @@ function FullPage(props) {
|
|
|
167
158
|
const handleAnalyticsEvent = useCreateAnalyticsHandler(createAnalyticsEvent);
|
|
168
159
|
const [showKeyline, scrollContainerRef] = useKeyline();
|
|
169
160
|
const config = useEditorSharedConfig();
|
|
170
|
-
return
|
|
161
|
+
return jsx(ContextPanelWidthProvider, null, jsx(Editor, _extends({}, props, {
|
|
171
162
|
onAnalyticsEvent: handleAnalyticsEvent
|
|
172
|
-
}),
|
|
163
|
+
}), jsx(BaseTheme, {
|
|
173
164
|
dynamicTextSizing: allowDynamicTextSizing
|
|
174
|
-
},
|
|
165
|
+
}, jsx("div", {
|
|
166
|
+
css: fullPageEditorWrapper,
|
|
175
167
|
className: "akEditor"
|
|
176
|
-
},
|
|
168
|
+
}, jsx("div", {
|
|
177
169
|
"data-testid": "ak-editor-main-toolbar",
|
|
178
|
-
showKeyline:
|
|
179
|
-
},
|
|
170
|
+
css: showKeyline ? mainToolbarWithKeyline : mainToolbar
|
|
171
|
+
}, jsx(Toolbar, {
|
|
180
172
|
containerElement: scrollContainerRef.current
|
|
181
|
-
}),
|
|
173
|
+
}), jsx("div", {
|
|
174
|
+
css: mainToolbarCustomComponentsSlot
|
|
175
|
+
}, !config ? null : jsx(AvatarsWithPluginState, {
|
|
182
176
|
editorView: config.editorView,
|
|
183
177
|
eventDispatcher: config.eventDispatcher,
|
|
184
178
|
inviteToEditHandler: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.inviteToEditHandler,
|
|
185
179
|
isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected
|
|
186
|
-
}), primaryToolbarComponents)),
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
180
|
+
}), primaryToolbarComponents)), jsx("div", {
|
|
181
|
+
css: contentArea
|
|
182
|
+
}, jsx(ContentStyles, {
|
|
183
|
+
ref: scrollContainerRef,
|
|
184
|
+
className: "fabric-editor-popup-scroll-parent",
|
|
185
|
+
css: scrollContainer
|
|
186
|
+
}, jsx(ClickAreaBlock, {
|
|
190
187
|
editorView: config === null || config === void 0 ? void 0 : config.editorView
|
|
191
|
-
},
|
|
188
|
+
}, jsx("div", {
|
|
189
|
+
css: editorContentArea
|
|
190
|
+
}, jsx("div", {
|
|
192
191
|
style: GUTTER_STYLE,
|
|
193
192
|
className: "ak-editor-content-area"
|
|
194
|
-
}, contentComponents,
|
|
193
|
+
}, contentComponents, jsx(EditorContent, null), jsx(ContentComponents, null))))), contextPanel && jsx("div", {
|
|
194
|
+
css: sidebarArea
|
|
195
|
+
}, contextPanel), jsx(WidthEmitter, {
|
|
195
196
|
editorView: config === null || config === void 0 ? void 0 : config.editorView
|
|
196
197
|
}))))));
|
|
197
198
|
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { analyticsPluginKey } from '../plugins/analytics/plugin-key';
|
|
6
4
|
import { createDispatch } from '../event-dispatcher';
|
|
7
|
-
import {
|
|
5
|
+
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
|
|
8
6
|
import { analyticsEventKey } from '../plugins/analytics/consts';
|
|
9
|
-
import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
|
|
10
7
|
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
11
8
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
12
|
-
|
|
13
|
-
const DEFAULT_SLOW_THRESHOLD = 7;
|
|
14
|
-
let nodeViewEventsCounter = 0;
|
|
9
|
+
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from './getPerformanceOptions';
|
|
15
10
|
export default class ReactNodeView {
|
|
16
11
|
constructor(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasAnalyticsContext = false, viewShouldUpdate, hasIntlContext = false) {
|
|
17
12
|
_defineProperty(this, "handleRef", node => this._handleRef(node));
|
|
@@ -72,23 +67,18 @@ export default class ReactNodeView {
|
|
|
72
67
|
const {
|
|
73
68
|
samplingRate,
|
|
74
69
|
slowThreshold,
|
|
75
|
-
|
|
76
|
-
} = this.
|
|
77
|
-
trackingEnabled &&
|
|
70
|
+
trackingEnabled
|
|
71
|
+
} = getPerformanceOptions(this.view);
|
|
72
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
73
|
+
nodeTypeName: this.node.type.name
|
|
74
|
+
});
|
|
78
75
|
this.renderReactComponent(() => this.render(this.reactComponentProps, this.handleRef));
|
|
79
|
-
trackingEnabled &&
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
attributes: {
|
|
86
|
-
node: this.node.type.name,
|
|
87
|
-
duration,
|
|
88
|
-
participants: getParticipantsCount(this.view.state)
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
76
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
77
|
+
nodeTypeName: this.node.type.name,
|
|
78
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
79
|
+
editorState: this.view.state,
|
|
80
|
+
samplingRate,
|
|
81
|
+
slowThreshold
|
|
92
82
|
});
|
|
93
83
|
return this;
|
|
94
84
|
}
|
|
@@ -206,18 +196,6 @@ export default class ReactNodeView {
|
|
|
206
196
|
this.contentDOM = undefined;
|
|
207
197
|
}
|
|
208
198
|
|
|
209
|
-
get performanceOptions() {
|
|
210
|
-
const pluginState = analyticsPluginKey.getState(this.view.state);
|
|
211
|
-
const nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
|
|
212
|
-
const samplingRate = nodeViewTracking.samplingRate || DEFAULT_SAMPLING_RATE;
|
|
213
|
-
const slowThreshold = nodeViewTracking.slowThreshold || DEFAULT_SLOW_THRESHOLD;
|
|
214
|
-
return {
|
|
215
|
-
enabled: !!nodeViewTracking.enabled,
|
|
216
|
-
samplingRate,
|
|
217
|
-
slowThreshold
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
199
|
static fromComponent(component, portalProviderAPI, eventDispatcher, props, viewShouldUpdate, hasIntlContext = false) {
|
|
222
200
|
return (node, view, getPos) => new ReactNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, props, component, false, viewShouldUpdate, hasIntlContext).init();
|
|
223
201
|
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
|
|
5
|
+
import { analyticsEventKey } from '../plugins/analytics/consts';
|
|
6
|
+
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
7
|
+
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from './getPerformanceOptions';
|
|
8
|
+
|
|
9
|
+
function createNodeView({
|
|
10
|
+
nodeViewParams,
|
|
11
|
+
pmPluginFactoryParams,
|
|
12
|
+
Component,
|
|
13
|
+
extraComponentProps
|
|
14
|
+
}) {
|
|
15
|
+
// We set a variable for the current node which is
|
|
16
|
+
// used for comparisions when doing updates, before being
|
|
17
|
+
// overwritten to the updated node.
|
|
18
|
+
let currentNode = nodeViewParams.node; // First we setup the dom element which will be rendered and "tracked" by prosemirror
|
|
19
|
+
// and also used as a "editor portal" (not react portal) target by the editor
|
|
20
|
+
// portal provider api, for rendering the Component passed.
|
|
21
|
+
|
|
22
|
+
let domRef = document.createElement('span');
|
|
23
|
+
domRef.contentEditable = 'false';
|
|
24
|
+
setDomAttrs(nodeViewParams.node, domRef); // @see ED-3790
|
|
25
|
+
// something gets messed up during mutation processing inside of a
|
|
26
|
+
// nodeView if DOM structure has nested plain "div"s, it doesn't see the
|
|
27
|
+
// difference between them and it kills the nodeView
|
|
28
|
+
|
|
29
|
+
domRef.classList.add(`${nodeViewParams.node.type.name}View-content-wrap`, `inlineNodeViewOuterContainer`); // This util is shared for tracking rendering, and the ErrorBoundary that
|
|
30
|
+
// is setup to wrap the Component when rendering
|
|
31
|
+
// NOTE: This is not a prosemirror dispatch
|
|
32
|
+
|
|
33
|
+
function dispatchAnalyticsEvent(payload) {
|
|
34
|
+
pmPluginFactoryParams.eventDispatcher.emit(analyticsEventKey, {
|
|
35
|
+
payload
|
|
36
|
+
});
|
|
37
|
+
} // This is called to render the Component into domRef which is inside the
|
|
38
|
+
// prosemirror View.
|
|
39
|
+
// Internally it uses the unstable_renderSubtreeIntoContainer api to render,
|
|
40
|
+
// to the passed dom element (domRef) which means it is automatically
|
|
41
|
+
// "cleaned up" when you do a "re render".
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
function renderComponent() {
|
|
45
|
+
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
46
|
+
dispatchAnalyticsEvent,
|
|
47
|
+
currentNode,
|
|
48
|
+
nodeViewParams,
|
|
49
|
+
Component,
|
|
50
|
+
extraComponentProps
|
|
51
|
+
}), domRef, false, // node views should be rendered with intl context
|
|
52
|
+
true);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const {
|
|
56
|
+
samplingRate,
|
|
57
|
+
slowThreshold,
|
|
58
|
+
trackingEnabled
|
|
59
|
+
} = getPerformanceOptions(nodeViewParams.view);
|
|
60
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
61
|
+
nodeTypeName: currentNode.type.name
|
|
62
|
+
}); // We render the component while creating the node view
|
|
63
|
+
|
|
64
|
+
renderComponent();
|
|
65
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
66
|
+
nodeTypeName: currentNode.type.name,
|
|
67
|
+
dispatchAnalyticsEvent,
|
|
68
|
+
editorState: nodeViewParams.view.state,
|
|
69
|
+
samplingRate,
|
|
70
|
+
slowThreshold
|
|
71
|
+
}); // https://prosemirror.net/docs/ref/#view.NodeView
|
|
72
|
+
|
|
73
|
+
const nodeView = {
|
|
74
|
+
get dom() {
|
|
75
|
+
return domRef;
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
update(nextNode, _decorations) {
|
|
79
|
+
// Let ProseMirror handle the update if node types are different.
|
|
80
|
+
// This prevents an issue where it was not possible to select the
|
|
81
|
+
// inline node view then replace it by entering text - the node
|
|
82
|
+
// view contents would be deleted but the node view itself would
|
|
83
|
+
// stay in the view and become uneditable.
|
|
84
|
+
if (currentNode.type !== nextNode.type) {
|
|
85
|
+
return false;
|
|
86
|
+
} // On updates, we only set the new attributes if the type, attributes, and marks
|
|
87
|
+
// have changed on the node.
|
|
88
|
+
// NOTE: this could mean attrs changes aren't reflected in the dom,
|
|
89
|
+
// when an attribute key which was previously present is no longer
|
|
90
|
+
// present.
|
|
91
|
+
// ie.
|
|
92
|
+
// -> Original attributes { text: "hello world", color: "red" }
|
|
93
|
+
// -> Updated attributes { color: "blue" }
|
|
94
|
+
// in this case, the dom text attribute will not be cleared.
|
|
95
|
+
//
|
|
96
|
+
// This may not be an issue with any of our current node schemas.
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if (!currentNode.sameMarkup(nextNode)) {
|
|
100
|
+
setDomAttrs(nextNode, domRef);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
currentNode = nextNode;
|
|
104
|
+
renderComponent();
|
|
105
|
+
return true;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
destroy() {
|
|
109
|
+
// When prosemirror destroys the node view, we need to clean up
|
|
110
|
+
// what we have previously rendered using the editor portal
|
|
111
|
+
// provider api.
|
|
112
|
+
pmPluginFactoryParams.portalProviderAPI.remove(domRef); // @ts-expect-error Expect an error as domRef is expected to be
|
|
113
|
+
// of HTMLSpanElement type however once the node view has
|
|
114
|
+
// been destroyed no other consumers should still be using it.
|
|
115
|
+
|
|
116
|
+
domRef = undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
};
|
|
120
|
+
return nodeView;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Copies the attributes from a ProseMirror Node to a DOM node.
|
|
124
|
+
* @param node The Prosemirror Node from which to source the attributes
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
function setDomAttrs(node, element) {
|
|
129
|
+
Object.keys(node.attrs || {}).forEach(attr => {
|
|
130
|
+
element.setAttribute(attr, node.attrs[attr]);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function getPortalChildren({
|
|
135
|
+
dispatchAnalyticsEvent,
|
|
136
|
+
currentNode,
|
|
137
|
+
nodeViewParams,
|
|
138
|
+
Component,
|
|
139
|
+
extraComponentProps
|
|
140
|
+
}) {
|
|
141
|
+
return function portalChildren() {
|
|
142
|
+
var _currentNode$type$nam, _currentNode$type;
|
|
143
|
+
|
|
144
|
+
// All inline nodes use `display: inline` to allow for multi-line
|
|
145
|
+
// wrapping. This does produce an issue in Chrome where it is not
|
|
146
|
+
// possible to click select the position after the node,
|
|
147
|
+
// see: https://product-fabric.atlassian.net/browse/ED-12003
|
|
148
|
+
// however this is only a problem for node views that use
|
|
149
|
+
// `display: inline-block` somewhere within the Component.
|
|
150
|
+
// Looking at the below structure, spans with className
|
|
151
|
+
// `inlineNodeViewAddZeroWidthSpace` have pseudo elements that
|
|
152
|
+
// add a zero width space which fixes the problem.
|
|
153
|
+
// Without the additional zero width space before the Component,
|
|
154
|
+
// it is not possible to use the keyboard to range select in Safari.
|
|
155
|
+
//
|
|
156
|
+
// Zero width spaces on either side of the Component also prevent
|
|
157
|
+
// the cursor from appearing inside the node view on all browsers.
|
|
158
|
+
//
|
|
159
|
+
// Note:
|
|
160
|
+
// In future it is worth considering prohibiting the use of `display: inline-block`
|
|
161
|
+
// within inline node view Components however would require a sizable
|
|
162
|
+
// refactor. A test suite to catch any instances of this is ideal however
|
|
163
|
+
// the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
|
|
164
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
165
|
+
component: ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
166
|
+
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
167
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
168
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
169
|
+
className: "inlineNodeViewAddZeroWidthSpace"
|
|
170
|
+
}), ZERO_WIDTH_SPACE, /*#__PURE__*/React.createElement(Component, _extends({
|
|
171
|
+
view: nodeViewParams.view,
|
|
172
|
+
getPos: nodeViewParams.getPos,
|
|
173
|
+
node: currentNode
|
|
174
|
+
}, extraComponentProps)), /*#__PURE__*/React.createElement("span", {
|
|
175
|
+
className: "inlineNodeViewAddZeroWidthSpace"
|
|
176
|
+
}));
|
|
177
|
+
};
|
|
178
|
+
} // https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
|
|
179
|
+
// The prosemirror EditorProps has a nodeViews key which has the rough shape:
|
|
180
|
+
// type nodeViews: {
|
|
181
|
+
// [nodeViewName: string]: (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
182
|
+
// }
|
|
183
|
+
// So the value of the keys on the nodeViews object, are a function which should return a NodeView.
|
|
184
|
+
// The following type NodeViewProducer, refers to these functions which return a NodeView.
|
|
185
|
+
//
|
|
186
|
+
// So the above type could also be described as
|
|
187
|
+
// type NodeViewProducer = (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
188
|
+
// nodeViews: {
|
|
189
|
+
// [nodeViewName: string]: NodeViewProducer
|
|
190
|
+
// }
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
// This return of this function is intended to be the value of a key
|
|
194
|
+
// in a ProseMirror nodeViews object.
|
|
195
|
+
export function getInlineNodeViewProducer({
|
|
196
|
+
pmPluginFactoryParams,
|
|
197
|
+
Component,
|
|
198
|
+
extraComponentProps
|
|
199
|
+
}) {
|
|
200
|
+
function nodeViewProducer(...nodeViewProducerParameters) {
|
|
201
|
+
const nodeView = createNodeView({
|
|
202
|
+
nodeViewParams: {
|
|
203
|
+
node: nodeViewProducerParameters[0],
|
|
204
|
+
view: nodeViewProducerParameters[1],
|
|
205
|
+
getPos: nodeViewProducerParameters[2],
|
|
206
|
+
decorations: nodeViewProducerParameters[3]
|
|
207
|
+
},
|
|
208
|
+
pmPluginFactoryParams,
|
|
209
|
+
Component,
|
|
210
|
+
extraComponentProps
|
|
211
|
+
});
|
|
212
|
+
return nodeView;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return nodeViewProducer;
|
|
216
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils'; // For reasoning behind styles, see comments in:
|
|
3
|
+
// ./getInlineNodeViewProducer -> portalChildren()
|
|
4
|
+
|
|
5
|
+
export const InlineNodeViewSharedStyles = css`
|
|
6
|
+
.inlineNodeViewOuterContainer {
|
|
7
|
+
display: inline;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.inlineNodeViewAddZeroWidthSpace {
|
|
11
|
+
::after {
|
|
12
|
+
content: '${ZERO_WIDTH_SPACE}';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
|
|
3
|
+
import { analyticsPluginKey } from '../plugins/analytics/plugin-key';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../plugins/analytics'; // This was existing logic when converting from ReactNodeView
|
|
5
|
+
// our current sampling for this event is not bound by node.type
|
|
6
|
+
|
|
7
|
+
export let nodeViewRenderedEventsCounter = 0;
|
|
8
|
+
const DEFAULT_SAMPLING_RATE = 100;
|
|
9
|
+
const DEFAULT_SLOW_THRESHOLD = 7;
|
|
10
|
+
export function getPerformanceOptions(view) {
|
|
11
|
+
const pluginState = analyticsPluginKey.getState(view.state);
|
|
12
|
+
const nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
|
|
13
|
+
const samplingRate = nodeViewTracking.samplingRate || DEFAULT_SAMPLING_RATE;
|
|
14
|
+
const slowThreshold = nodeViewTracking.slowThreshold || DEFAULT_SLOW_THRESHOLD;
|
|
15
|
+
return {
|
|
16
|
+
trackingEnabled: !!nodeViewTracking.enabled,
|
|
17
|
+
samplingRate,
|
|
18
|
+
slowThreshold
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function startMeasureReactNodeViewRendered({
|
|
22
|
+
nodeTypeName
|
|
23
|
+
}) {
|
|
24
|
+
startMeasure(`🦉${nodeTypeName}::ReactNodeView`);
|
|
25
|
+
}
|
|
26
|
+
export function stopMeasureReactNodeViewRendered({
|
|
27
|
+
nodeTypeName,
|
|
28
|
+
dispatchAnalyticsEvent,
|
|
29
|
+
editorState,
|
|
30
|
+
samplingRate,
|
|
31
|
+
slowThreshold
|
|
32
|
+
}) {
|
|
33
|
+
stopMeasure(`🦉${nodeTypeName}::ReactNodeView`, duration => {
|
|
34
|
+
if (++nodeViewRenderedEventsCounter % samplingRate === 0 && duration > slowThreshold) {
|
|
35
|
+
dispatchAnalyticsEvent({
|
|
36
|
+
action: ACTION.REACT_NODEVIEW_RENDERED,
|
|
37
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
38
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
39
|
+
attributes: {
|
|
40
|
+
node: nodeTypeName,
|
|
41
|
+
duration,
|
|
42
|
+
participants: getParticipantsCount(editorState)
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|