@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/esm/editor.js
CHANGED
|
@@ -27,7 +27,7 @@ import uuid from 'uuid/v4';
|
|
|
27
27
|
import { name, version } from './version-wrapper';
|
|
28
28
|
import { combineExtensionProviders } from '@atlaskit/editor-common/extensions';
|
|
29
29
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
30
|
-
import { BaseTheme, WithCreateAnalyticsEvent, WidthProvider
|
|
30
|
+
import { BaseTheme, WithCreateAnalyticsEvent, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
31
31
|
import { getAnalyticsAppearance, startMeasure, stopMeasure, clearMeasure, measureTTI, getTTISeverity } from '@atlaskit/editor-common/utils';
|
|
32
32
|
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
33
33
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
@@ -44,7 +44,7 @@ import { combineQuickInsertProviders, extensionProviderToQuickInsertProvider } f
|
|
|
44
44
|
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from './plugins/analytics';
|
|
45
45
|
import ErrorBoundary from './create-editor/ErrorBoundary';
|
|
46
46
|
import { createFeatureFlagsFromProps } from './plugins/feature-flags-context/feature-flags-from-props';
|
|
47
|
-
import { RenderTracking } from './utils/
|
|
47
|
+
import { RenderTracking } from './utils/performance/components/RenderTracking';
|
|
48
48
|
var WidthProviderFullHeight = styled(WidthProvider)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n"])));
|
|
49
49
|
|
|
50
50
|
var Editor = /*#__PURE__*/function (_React$Component) {
|
|
@@ -517,7 +517,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
517
517
|
var renderTracking = (_this$props$performan = this.props.performanceTracking) === null || _this$props$performan === void 0 ? void 0 : (_this$props$performan2 = _this$props$performan.renderTracking) === null || _this$props$performan2 === void 0 ? void 0 : _this$props$performan2.editor;
|
|
518
518
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
519
519
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
520
|
-
|
|
520
|
+
return /*#__PURE__*/React.createElement(FabricEditorAnalyticsContext, {
|
|
521
521
|
data: {
|
|
522
522
|
packageName: name,
|
|
523
523
|
packageVersion: version,
|
|
@@ -588,7 +588,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
588
588
|
customSecondaryToolbarComponents: _this5.props.secondaryToolbarComponents,
|
|
589
589
|
contextPanel: _this5.props.contextPanel,
|
|
590
590
|
collabEdit: _this5.props.collabEdit,
|
|
591
|
-
allowAnnotation: !!_this5.props.annotationProviders,
|
|
592
591
|
persistScrollGutter: _this5.props.persistScrollGutter,
|
|
593
592
|
enableToolbarMinWidth: ((_this5$props$featureF = _this5.props.featureFlags) === null || _this5$props$featureF === void 0 ? void 0 : _this5$props$featureF.toolbarMinWidthOverflow) != null ? !!((_this5$props$featureF2 = _this5.props.featureFlags) !== null && _this5$props$featureF2 !== void 0 && _this5$props$featureF2.toolbarMinWidthOverflow) : _this5.props.UNSAFE_allowUndoRedoButtons,
|
|
594
593
|
useStickyToolbar: _this5.props.useStickyToolbar,
|
|
@@ -602,7 +601,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
602
601
|
}))))));
|
|
603
602
|
}
|
|
604
603
|
}));
|
|
605
|
-
return /*#__PURE__*/React.createElement(LegacyToNextIntlProvider, null, /*#__PURE__*/React.createElement(IntlLegacyFallbackProvider, null, editor));
|
|
606
604
|
}
|
|
607
605
|
}]);
|
|
608
606
|
|
|
@@ -2,9 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import React, { Fragment } from 'react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
9
|
import { N400 } from '@atlaskit/theme/colors';
|
|
9
10
|
export var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
10
11
|
export var toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
|
|
@@ -76,7 +77,7 @@ var arrowKeysMap = {
|
|
|
76
77
|
ARROWUP: "\u2191",
|
|
77
78
|
ARROWDOWN: "\u2193"
|
|
78
79
|
};
|
|
79
|
-
|
|
80
|
+
var tooltipShortcutStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: tooltip-shortcut;\n"])), N400);
|
|
80
81
|
|
|
81
82
|
function formatShortcut(keymap) {
|
|
82
83
|
var shortcut;
|
|
@@ -113,7 +114,9 @@ export var ToolTipContent = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
113
114
|
shortcutOverride = _ref.shortcutOverride,
|
|
114
115
|
keymap = _ref.keymap;
|
|
115
116
|
var shortcut = shortcutOverride || keymap && formatShortcut(keymap);
|
|
116
|
-
return shortcut || description ?
|
|
117
|
+
return shortcut || description ? jsx(Fragment, null, description, shortcut && description && "\xA0", shortcut && jsx("span", {
|
|
118
|
+
css: tooltipShortcutStyle
|
|
119
|
+
}, shortcut)) : null;
|
|
117
120
|
});
|
|
118
121
|
export function findKeymapByDescription(description) {
|
|
119
122
|
var matches = ALL.filter(function (keymap) {
|
|
@@ -4,9 +4,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
6
6
|
|
|
7
|
+
/** @jsx jsx */
|
|
7
8
|
import rafSchedule from 'raf-schd';
|
|
8
9
|
import React from 'react';
|
|
9
|
-
import
|
|
10
|
+
import { css, jsx } from '@emotion/react';
|
|
10
11
|
import { N30 } from '@atlaskit/theme/colors';
|
|
11
12
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
13
|
import { BaseTheme } from '@atlaskit/editor-common/ui';
|
|
@@ -15,38 +16,29 @@ import ContentStyles from '../../ui/ContentStyles';
|
|
|
15
16
|
import WidthEmitter from '../../ui/WidthEmitter';
|
|
16
17
|
import { ClickAreaBlock } from '../../ui/Addon';
|
|
17
18
|
import { scrollbarStyles } from '../../ui/styles';
|
|
18
|
-
import {
|
|
19
|
+
import { tableFullPageEditorStyles } from '../../plugins/table/ui/common-styles';
|
|
19
20
|
import AvatarsWithPluginState from '../../plugins/collab-edit/ui';
|
|
20
21
|
import { Editor, EditorContent, useEditorSharedConfig } from './Editor';
|
|
21
22
|
import { Toolbar } from './Toolbar';
|
|
22
23
|
import { ContentComponents } from './ContentComponents';
|
|
23
24
|
import { useCreateAnalyticsHandler } from './internal/hooks/use-analytics';
|
|
24
25
|
import { ContextPanelWidthProvider } from '../../ui/ContextPanel/context';
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
var ScrollContainer = styled(ContentStyles)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-y: scroll;\n position: relative;\n display: flex;\n flex-direction: column;\n scroll-behavior: smooth;\n ", ";\n"])), scrollbarStyles);
|
|
28
|
-
ScrollContainer.displayName = 'ScrollContainer';
|
|
26
|
+
var fullPageEditorWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-width: 340px;\n height: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n"])));
|
|
27
|
+
var scrollContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-y: scroll;\n position: relative;\n display: flex;\n flex-direction: column;\n scroll-behavior: smooth;\n ", ";\n"])), scrollbarStyles);
|
|
29
28
|
var GUTTER_PADDING = 32;
|
|
30
29
|
var GUTTER_STYLE = {
|
|
31
30
|
padding: "0 ".concat(GUTTER_PADDING, "px")
|
|
32
31
|
};
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
MainToolbar.displayName = 'MainToolbar';
|
|
44
|
-
var MainToolbarCustomComponentsSlot = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n"])));
|
|
45
|
-
MainToolbarCustomComponentsSlot.displayName = 'MainToolbar';
|
|
46
|
-
var SecondaryToolbar = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n flex-shrink: 0;\n display: flex;\n padding: 24px 0;\n"])));
|
|
47
|
-
SecondaryToolbar.displayName = 'SecondaryToolbar';
|
|
48
|
-
var SidebarArea = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 100%;\n box-sizing: border-box;\n"])));
|
|
49
|
-
SidebarArea.displayName = 'SidebarArea';
|
|
32
|
+
var contentArea = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n height: 100%;\n box-sizing: border-box;\n"])));
|
|
33
|
+
|
|
34
|
+
var editorContentArea = function editorContentArea(theme) {
|
|
35
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n line-height: 24px;\n height: 100%;\n width: 100%;\n max-width: ", "px;\n padding-top: 50px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n padding-bottom: 55px;\n\n & .ProseMirror {\n flex-grow: 1;\n box-sizing: border-box;\n }\n\n && .ProseMirror {\n & > * {\n clear: both;\n }\n > p,\n > ul,\n > ol,\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n clear: none;\n }\n }\n ", ";\n"])), theme.layoutMaxWidth + GUTTER_PADDING * 2, tableFullPageEditorStyles);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var mainToolbar = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n align-items: center;\n box-shadow: 'none';\n\n transition: box-shadow 200ms;\n z-index: ", ";\n display: flex;\n height: 80px;\n flex-shrink: 0;\n background-color: white;\n\n & object {\n height: 0 !important;\n }\n"])), akEditorMenuZIndex);
|
|
39
|
+
var mainToolbarWithKeyline = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n box-shadow: 0 ", "px 0 0 ", "\n"])), mainToolbar, akEditorToolbarKeylineHeight, N30);
|
|
40
|
+
var mainToolbarCustomComponentsSlot = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n"])));
|
|
41
|
+
var sidebarArea = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 100%;\n box-sizing: border-box;\n"])));
|
|
50
42
|
|
|
51
43
|
function useKeyline() {
|
|
52
44
|
var _React$useState = React.useState(false),
|
|
@@ -99,31 +91,41 @@ function FullPage(props) {
|
|
|
99
91
|
scrollContainerRef = _useKeyline2[1];
|
|
100
92
|
|
|
101
93
|
var config = useEditorSharedConfig();
|
|
102
|
-
return
|
|
94
|
+
return jsx(ContextPanelWidthProvider, null, jsx(Editor, _extends({}, props, {
|
|
103
95
|
onAnalyticsEvent: handleAnalyticsEvent
|
|
104
|
-
}),
|
|
96
|
+
}), jsx(BaseTheme, {
|
|
105
97
|
dynamicTextSizing: allowDynamicTextSizing
|
|
106
|
-
},
|
|
98
|
+
}, jsx("div", {
|
|
99
|
+
css: fullPageEditorWrapper,
|
|
107
100
|
className: "akEditor"
|
|
108
|
-
},
|
|
101
|
+
}, jsx("div", {
|
|
109
102
|
"data-testid": "ak-editor-main-toolbar",
|
|
110
|
-
showKeyline:
|
|
111
|
-
},
|
|
103
|
+
css: showKeyline ? mainToolbarWithKeyline : mainToolbar
|
|
104
|
+
}, jsx(Toolbar, {
|
|
112
105
|
containerElement: scrollContainerRef.current
|
|
113
|
-
}),
|
|
106
|
+
}), jsx("div", {
|
|
107
|
+
css: mainToolbarCustomComponentsSlot
|
|
108
|
+
}, !config ? null : jsx(AvatarsWithPluginState, {
|
|
114
109
|
editorView: config.editorView,
|
|
115
110
|
eventDispatcher: config.eventDispatcher,
|
|
116
111
|
inviteToEditHandler: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.inviteToEditHandler,
|
|
117
112
|
isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected
|
|
118
|
-
}), primaryToolbarComponents)),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
}), primaryToolbarComponents)), jsx("div", {
|
|
114
|
+
css: contentArea
|
|
115
|
+
}, jsx(ContentStyles, {
|
|
116
|
+
ref: scrollContainerRef,
|
|
117
|
+
className: "fabric-editor-popup-scroll-parent",
|
|
118
|
+
css: scrollContainer
|
|
119
|
+
}, jsx(ClickAreaBlock, {
|
|
122
120
|
editorView: config === null || config === void 0 ? void 0 : config.editorView
|
|
123
|
-
},
|
|
121
|
+
}, jsx("div", {
|
|
122
|
+
css: editorContentArea
|
|
123
|
+
}, jsx("div", {
|
|
124
124
|
style: GUTTER_STYLE,
|
|
125
125
|
className: "ak-editor-content-area"
|
|
126
|
-
}, contentComponents,
|
|
126
|
+
}, contentComponents, jsx(EditorContent, null), jsx(ContentComponents, null))))), contextPanel && jsx("div", {
|
|
127
|
+
css: sidebarArea
|
|
128
|
+
}, contextPanel), jsx(WidthEmitter, {
|
|
127
129
|
editorView: config === null || config === void 0 ? void 0 : config.editorView
|
|
128
130
|
}))))));
|
|
129
131
|
}
|
|
@@ -3,17 +3,12 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import { analyticsPluginKey } from '../plugins/analytics/plugin-key';
|
|
8
6
|
import { createDispatch } from '../event-dispatcher';
|
|
9
|
-
import {
|
|
7
|
+
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
|
|
10
8
|
import { analyticsEventKey } from '../plugins/analytics/consts';
|
|
11
|
-
import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
|
|
12
9
|
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
13
10
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
14
|
-
|
|
15
|
-
var DEFAULT_SLOW_THRESHOLD = 7;
|
|
16
|
-
var nodeViewEventsCounter = 0;
|
|
11
|
+
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from './getPerformanceOptions';
|
|
17
12
|
|
|
18
13
|
var ReactNodeView = /*#__PURE__*/function () {
|
|
19
14
|
function ReactNodeView(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
|
|
@@ -86,27 +81,24 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
86
81
|
|
|
87
82
|
|
|
88
83
|
this.domRef.classList.add("".concat(this.node.type.name, "View-content-wrap"));
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
|
|
85
|
+
var _getPerformanceOption = getPerformanceOptions(this.view),
|
|
86
|
+
samplingRate = _getPerformanceOption.samplingRate,
|
|
87
|
+
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
88
|
+
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
89
|
+
|
|
90
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
91
|
+
nodeTypeName: this.node.type.name
|
|
92
|
+
});
|
|
94
93
|
this.renderReactComponent(function () {
|
|
95
94
|
return _this2.render(_this2.reactComponentProps, _this2.handleRef);
|
|
96
95
|
});
|
|
97
|
-
trackingEnabled &&
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
attributes: {
|
|
104
|
-
node: _this2.node.type.name,
|
|
105
|
-
duration: duration,
|
|
106
|
-
participants: getParticipantsCount(_this2.view.state)
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
96
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
97
|
+
nodeTypeName: this.node.type.name,
|
|
98
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
99
|
+
editorState: this.view.state,
|
|
100
|
+
samplingRate: samplingRate,
|
|
101
|
+
slowThreshold: slowThreshold
|
|
110
102
|
});
|
|
111
103
|
return this;
|
|
112
104
|
}
|
|
@@ -242,19 +234,6 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
242
234
|
this.domRef = undefined;
|
|
243
235
|
this.contentDOM = undefined;
|
|
244
236
|
}
|
|
245
|
-
}, {
|
|
246
|
-
key: "performanceOptions",
|
|
247
|
-
get: function get() {
|
|
248
|
-
var pluginState = analyticsPluginKey.getState(this.view.state);
|
|
249
|
-
var nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
|
|
250
|
-
var samplingRate = nodeViewTracking.samplingRate || DEFAULT_SAMPLING_RATE;
|
|
251
|
-
var slowThreshold = nodeViewTracking.slowThreshold || DEFAULT_SLOW_THRESHOLD;
|
|
252
|
-
return {
|
|
253
|
-
enabled: !!nodeViewTracking.enabled,
|
|
254
|
-
samplingRate: samplingRate,
|
|
255
|
-
slowThreshold: slowThreshold
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
237
|
}], [{
|
|
259
238
|
key: "fromComponent",
|
|
260
239
|
value: function fromComponent(component, portalProviderAPI, eventDispatcher, props, viewShouldUpdate) {
|
|
@@ -0,0 +1,212 @@
|
|
|
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(_ref) {
|
|
10
|
+
var nodeViewParams = _ref.nodeViewParams,
|
|
11
|
+
pmPluginFactoryParams = _ref.pmPluginFactoryParams,
|
|
12
|
+
Component = _ref.Component,
|
|
13
|
+
extraComponentProps = _ref.extraComponentProps;
|
|
14
|
+
// We set a variable for the current node which is
|
|
15
|
+
// used for comparisions when doing updates, before being
|
|
16
|
+
// overwritten to the updated node.
|
|
17
|
+
var currentNode = nodeViewParams.node; // First we setup the dom element which will be rendered and "tracked" by prosemirror
|
|
18
|
+
// and also used as a "editor portal" (not react portal) target by the editor
|
|
19
|
+
// portal provider api, for rendering the Component passed.
|
|
20
|
+
|
|
21
|
+
var domRef = document.createElement('span');
|
|
22
|
+
domRef.contentEditable = 'false';
|
|
23
|
+
setDomAttrs(nodeViewParams.node, domRef); // @see ED-3790
|
|
24
|
+
// something gets messed up during mutation processing inside of a
|
|
25
|
+
// nodeView if DOM structure has nested plain "div"s, it doesn't see the
|
|
26
|
+
// difference between them and it kills the nodeView
|
|
27
|
+
|
|
28
|
+
domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "inlineNodeViewOuterContainer"); // This util is shared for tracking rendering, and the ErrorBoundary that
|
|
29
|
+
// is setup to wrap the Component when rendering
|
|
30
|
+
// NOTE: This is not a prosemirror dispatch
|
|
31
|
+
|
|
32
|
+
function dispatchAnalyticsEvent(payload) {
|
|
33
|
+
pmPluginFactoryParams.eventDispatcher.emit(analyticsEventKey, {
|
|
34
|
+
payload: payload
|
|
35
|
+
});
|
|
36
|
+
} // This is called to render the Component into domRef which is inside the
|
|
37
|
+
// prosemirror View.
|
|
38
|
+
// Internally it uses the unstable_renderSubtreeIntoContainer api to render,
|
|
39
|
+
// to the passed dom element (domRef) which means it is automatically
|
|
40
|
+
// "cleaned up" when you do a "re render".
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
function renderComponent() {
|
|
44
|
+
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
45
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
46
|
+
currentNode: currentNode,
|
|
47
|
+
nodeViewParams: nodeViewParams,
|
|
48
|
+
Component: Component,
|
|
49
|
+
extraComponentProps: extraComponentProps
|
|
50
|
+
}), domRef, false, // node views should be rendered with intl context
|
|
51
|
+
true);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var _getPerformanceOption = getPerformanceOptions(nodeViewParams.view),
|
|
55
|
+
samplingRate = _getPerformanceOption.samplingRate,
|
|
56
|
+
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
57
|
+
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
58
|
+
|
|
59
|
+
trackingEnabled && startMeasureReactNodeViewRendered({
|
|
60
|
+
nodeTypeName: currentNode.type.name
|
|
61
|
+
}); // We render the component while creating the node view
|
|
62
|
+
|
|
63
|
+
renderComponent();
|
|
64
|
+
trackingEnabled && stopMeasureReactNodeViewRendered({
|
|
65
|
+
nodeTypeName: currentNode.type.name,
|
|
66
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
67
|
+
editorState: nodeViewParams.view.state,
|
|
68
|
+
samplingRate: samplingRate,
|
|
69
|
+
slowThreshold: slowThreshold
|
|
70
|
+
}); // https://prosemirror.net/docs/ref/#view.NodeView
|
|
71
|
+
|
|
72
|
+
var nodeView = {
|
|
73
|
+
get dom() {
|
|
74
|
+
return domRef;
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
update: function update(nextNode, _decorations) {
|
|
78
|
+
// Let ProseMirror handle the update if node types are different.
|
|
79
|
+
// This prevents an issue where it was not possible to select the
|
|
80
|
+
// inline node view then replace it by entering text - the node
|
|
81
|
+
// view contents would be deleted but the node view itself would
|
|
82
|
+
// stay in the view and become uneditable.
|
|
83
|
+
if (currentNode.type !== nextNode.type) {
|
|
84
|
+
return false;
|
|
85
|
+
} // On updates, we only set the new attributes if the type, attributes, and marks
|
|
86
|
+
// have changed on the node.
|
|
87
|
+
// NOTE: this could mean attrs changes aren't reflected in the dom,
|
|
88
|
+
// when an attribute key which was previously present is no longer
|
|
89
|
+
// present.
|
|
90
|
+
// ie.
|
|
91
|
+
// -> Original attributes { text: "hello world", color: "red" }
|
|
92
|
+
// -> Updated attributes { color: "blue" }
|
|
93
|
+
// in this case, the dom text attribute will not be cleared.
|
|
94
|
+
//
|
|
95
|
+
// This may not be an issue with any of our current node schemas.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
if (!currentNode.sameMarkup(nextNode)) {
|
|
99
|
+
setDomAttrs(nextNode, domRef);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
currentNode = nextNode;
|
|
103
|
+
renderComponent();
|
|
104
|
+
return true;
|
|
105
|
+
},
|
|
106
|
+
destroy: function destroy() {
|
|
107
|
+
// When prosemirror destroys the node view, we need to clean up
|
|
108
|
+
// what we have previously rendered using the editor portal
|
|
109
|
+
// provider api.
|
|
110
|
+
pmPluginFactoryParams.portalProviderAPI.remove(domRef); // @ts-expect-error Expect an error as domRef is expected to be
|
|
111
|
+
// of HTMLSpanElement type however once the node view has
|
|
112
|
+
// been destroyed no other consumers should still be using it.
|
|
113
|
+
|
|
114
|
+
domRef = undefined;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
return nodeView;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Copies the attributes from a ProseMirror Node to a DOM node.
|
|
121
|
+
* @param node The Prosemirror Node from which to source the attributes
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
function setDomAttrs(node, element) {
|
|
126
|
+
Object.keys(node.attrs || {}).forEach(function (attr) {
|
|
127
|
+
element.setAttribute(attr, node.attrs[attr]);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function getPortalChildren(_ref2) {
|
|
132
|
+
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
133
|
+
currentNode = _ref2.currentNode,
|
|
134
|
+
nodeViewParams = _ref2.nodeViewParams,
|
|
135
|
+
Component = _ref2.Component,
|
|
136
|
+
extraComponentProps = _ref2.extraComponentProps;
|
|
137
|
+
return function portalChildren() {
|
|
138
|
+
var _currentNode$type$nam, _currentNode$type;
|
|
139
|
+
|
|
140
|
+
// All inline nodes use `display: inline` to allow for multi-line
|
|
141
|
+
// wrapping. This does produce an issue in Chrome where it is not
|
|
142
|
+
// possible to click select the position after the node,
|
|
143
|
+
// see: https://product-fabric.atlassian.net/browse/ED-12003
|
|
144
|
+
// however this is only a problem for node views that use
|
|
145
|
+
// `display: inline-block` somewhere within the Component.
|
|
146
|
+
// Looking at the below structure, spans with className
|
|
147
|
+
// `inlineNodeViewAddZeroWidthSpace` have pseudo elements that
|
|
148
|
+
// add a zero width space which fixes the problem.
|
|
149
|
+
// Without the additional zero width space before the Component,
|
|
150
|
+
// it is not possible to use the keyboard to range select in Safari.
|
|
151
|
+
//
|
|
152
|
+
// Zero width spaces on either side of the Component also prevent
|
|
153
|
+
// the cursor from appearing inside the node view on all browsers.
|
|
154
|
+
//
|
|
155
|
+
// Note:
|
|
156
|
+
// In future it is worth considering prohibiting the use of `display: inline-block`
|
|
157
|
+
// within inline node view Components however would require a sizable
|
|
158
|
+
// refactor. A test suite to catch any instances of this is ideal however
|
|
159
|
+
// the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
|
|
160
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
161
|
+
component: ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
162
|
+
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,
|
|
163
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
164
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
165
|
+
className: "inlineNodeViewAddZeroWidthSpace"
|
|
166
|
+
}), ZERO_WIDTH_SPACE, /*#__PURE__*/React.createElement(Component, _extends({
|
|
167
|
+
view: nodeViewParams.view,
|
|
168
|
+
getPos: nodeViewParams.getPos,
|
|
169
|
+
node: currentNode
|
|
170
|
+
}, extraComponentProps)), /*#__PURE__*/React.createElement("span", {
|
|
171
|
+
className: "inlineNodeViewAddZeroWidthSpace"
|
|
172
|
+
}));
|
|
173
|
+
};
|
|
174
|
+
} // https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
|
|
175
|
+
// The prosemirror EditorProps has a nodeViews key which has the rough shape:
|
|
176
|
+
// type nodeViews: {
|
|
177
|
+
// [nodeViewName: string]: (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
178
|
+
// }
|
|
179
|
+
// So the value of the keys on the nodeViews object, are a function which should return a NodeView.
|
|
180
|
+
// The following type NodeViewProducer, refers to these functions which return a NodeView.
|
|
181
|
+
//
|
|
182
|
+
// So the above type could also be described as
|
|
183
|
+
// type NodeViewProducer = (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
184
|
+
// nodeViews: {
|
|
185
|
+
// [nodeViewName: string]: NodeViewProducer
|
|
186
|
+
// }
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
// This return of this function is intended to be the value of a key
|
|
190
|
+
// in a ProseMirror nodeViews object.
|
|
191
|
+
export function getInlineNodeViewProducer(_ref3) {
|
|
192
|
+
var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
|
|
193
|
+
Component = _ref3.Component,
|
|
194
|
+
extraComponentProps = _ref3.extraComponentProps;
|
|
195
|
+
|
|
196
|
+
function nodeViewProducer() {
|
|
197
|
+
var nodeView = createNodeView({
|
|
198
|
+
nodeViewParams: {
|
|
199
|
+
node: arguments.length <= 0 ? undefined : arguments[0],
|
|
200
|
+
view: arguments.length <= 1 ? undefined : arguments[1],
|
|
201
|
+
getPos: arguments.length <= 2 ? undefined : arguments[2],
|
|
202
|
+
decorations: arguments.length <= 3 ? undefined : arguments[3]
|
|
203
|
+
},
|
|
204
|
+
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
205
|
+
Component: Component,
|
|
206
|
+
extraComponentProps: extraComponentProps
|
|
207
|
+
});
|
|
208
|
+
return nodeView;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return nodeViewProducer;
|
|
212
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
4
|
+
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
|
+
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils'; // For reasoning behind styles, see comments in:
|
|
7
|
+
// ./getInlineNodeViewProducer -> portalChildren()
|
|
8
|
+
|
|
9
|
+
export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .inlineNodeViewOuterContainer {\n display: inline;\n }\n\n .inlineNodeViewAddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), ZERO_WIDTH_SPACE);
|
|
@@ -0,0 +1,45 @@
|
|
|
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 var nodeViewRenderedEventsCounter = 0;
|
|
8
|
+
var DEFAULT_SAMPLING_RATE = 100;
|
|
9
|
+
var DEFAULT_SLOW_THRESHOLD = 7;
|
|
10
|
+
export function getPerformanceOptions(view) {
|
|
11
|
+
var pluginState = analyticsPluginKey.getState(view.state);
|
|
12
|
+
var nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
|
|
13
|
+
var samplingRate = nodeViewTracking.samplingRate || DEFAULT_SAMPLING_RATE;
|
|
14
|
+
var slowThreshold = nodeViewTracking.slowThreshold || DEFAULT_SLOW_THRESHOLD;
|
|
15
|
+
return {
|
|
16
|
+
trackingEnabled: !!nodeViewTracking.enabled,
|
|
17
|
+
samplingRate: samplingRate,
|
|
18
|
+
slowThreshold: slowThreshold
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function startMeasureReactNodeViewRendered(_ref) {
|
|
22
|
+
var nodeTypeName = _ref.nodeTypeName;
|
|
23
|
+
startMeasure("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"));
|
|
24
|
+
}
|
|
25
|
+
export function stopMeasureReactNodeViewRendered(_ref2) {
|
|
26
|
+
var nodeTypeName = _ref2.nodeTypeName,
|
|
27
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
28
|
+
editorState = _ref2.editorState,
|
|
29
|
+
samplingRate = _ref2.samplingRate,
|
|
30
|
+
slowThreshold = _ref2.slowThreshold;
|
|
31
|
+
stopMeasure("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"), function (duration) {
|
|
32
|
+
if (++nodeViewRenderedEventsCounter % samplingRate === 0 && duration > slowThreshold) {
|
|
33
|
+
dispatchAnalyticsEvent({
|
|
34
|
+
action: ACTION.REACT_NODEVIEW_RENDERED,
|
|
35
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
36
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
37
|
+
attributes: {
|
|
38
|
+
node: nodeTypeName,
|
|
39
|
+
duration: duration,
|
|
40
|
+
participants: getParticipantsCount(editorState)
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -10,13 +10,15 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
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; } }
|
|
12
12
|
|
|
13
|
+
/** @jsx jsx */
|
|
13
14
|
import React from 'react';
|
|
15
|
+
import { jsx } from '@emotion/react';
|
|
14
16
|
import { injectIntl } from 'react-intl-next';
|
|
15
17
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
16
18
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
17
19
|
import Dropdown from '../../../../ui/Dropdown';
|
|
18
20
|
import Alignment from '../../../../ui/Alignment';
|
|
19
|
-
import {
|
|
21
|
+
import { expandIconWrapper, separator, triggerWrapper, wrapper } from './styles';
|
|
20
22
|
import { IconMap } from './icon-map';
|
|
21
23
|
import { messages } from './messages';
|
|
22
24
|
export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
@@ -85,7 +87,9 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
85
87
|
disabled = _this$props.disabled,
|
|
86
88
|
intl = _this$props.intl;
|
|
87
89
|
var title = intl.formatMessage(messages.alignment);
|
|
88
|
-
return
|
|
90
|
+
return jsx("span", {
|
|
91
|
+
css: wrapper
|
|
92
|
+
}, jsx(Dropdown, {
|
|
89
93
|
mountTo: popupsMountPoint,
|
|
90
94
|
boundariesElement: popupsBoundariesElement,
|
|
91
95
|
scrollableElement: popupsScrollableElement,
|
|
@@ -94,7 +98,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
94
98
|
handleEscapeKeydown: this.hide,
|
|
95
99
|
fitWidth: 112,
|
|
96
100
|
fitHeight: 80,
|
|
97
|
-
trigger:
|
|
101
|
+
trigger: jsx(ToolbarButton, {
|
|
98
102
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
99
103
|
disabled: disabled,
|
|
100
104
|
selected: isOpen,
|
|
@@ -104,18 +108,24 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
104
108
|
"aria-expanded": isOpen,
|
|
105
109
|
"aria-haspopup": true,
|
|
106
110
|
onClick: this.toggleOpen,
|
|
107
|
-
iconBefore:
|
|
111
|
+
iconBefore: jsx("div", {
|
|
112
|
+
css: triggerWrapper
|
|
113
|
+
}, jsx(IconMap, {
|
|
108
114
|
alignment: pluginState.align
|
|
109
|
-
}),
|
|
115
|
+
}), jsx("span", {
|
|
116
|
+
css: expandIconWrapper
|
|
117
|
+
}, jsx(ExpandIcon, {
|
|
110
118
|
label: ""
|
|
111
119
|
})))
|
|
112
120
|
})
|
|
113
|
-
},
|
|
121
|
+
}, jsx(Alignment, {
|
|
114
122
|
onClick: function onClick(align) {
|
|
115
123
|
return _this2.changeAlignment(align);
|
|
116
124
|
},
|
|
117
125
|
selectedAlignment: pluginState.align
|
|
118
|
-
})),
|
|
126
|
+
})), jsx("span", {
|
|
127
|
+
css: separator
|
|
128
|
+
}));
|
|
119
129
|
}
|
|
120
130
|
}]);
|
|
121
131
|
|
|
@@ -2,9 +2,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
6
|
import { N30 } from '@atlaskit/theme/colors';
|
|
7
|
-
export var
|
|
8
|
-
export var
|
|
9
|
-
export var
|
|
10
|
-
export var
|
|
7
|
+
export var triggerWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
8
|
+
export var separator = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), N30);
|
|
9
|
+
export var wrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n div {\n display: flex;\n }\n"])));
|
|
10
|
+
export var expandIconWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|