@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
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
4
|
|
|
5
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
|
|
6
6
|
|
|
7
|
+
/** @jsx jsx */
|
|
7
8
|
import React, { memo, useState, useCallback, useEffect } from 'react';
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
8
10
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
|
-
import styled, { css } from 'styled-components';
|
|
10
11
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
11
12
|
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from '../../../plugins/analytics';
|
|
12
13
|
import ElementList from './ElementList/ElementList';
|
|
@@ -15,6 +16,21 @@ import ElementSearch from './ElementSearch';
|
|
|
15
16
|
import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_PADDING_LEFT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
|
|
16
17
|
import useContainerWidth from '../hooks/use-container-width';
|
|
17
18
|
import useSelectAndFocusOnArrowNavigation from '../hooks/use-select-and-focus-on-arrow-navigation';
|
|
19
|
+
var wrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n max-height: inherit;\n overflow: hidden;\n"])));
|
|
20
|
+
var baseBrowserContainerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n height: 100%;\n /** Needed for Safari to work with current css.\n * 100% heights wont work and\n * will default to auto if one of the containers doesn't have a specified height in pixels.\n * Setting the min-height to fill available fits safari's needs and the above 100% height works on the rest of the browsers.\n */\n\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n\n /* stylelint-disable-next-line */\n min-height: -webkit-fill-available;\n"])));
|
|
21
|
+
var mobileElementBrowserContainer = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n flex-direction: column;\n"])), baseBrowserContainerStyles);
|
|
22
|
+
var elementBrowserContainer = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n flex-direction: row;\n"])), baseBrowserContainerStyles);
|
|
23
|
+
var baseSidebarStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n overflow-x: auto;\n overflow-y: hidden;\n"])));
|
|
24
|
+
var mobileSideBar = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", ";\n flex: 0 0 ", ";\n padding: 12px 12px 0 12px;\n"])), baseSidebarStyles, INLINE_SIDEBAR_HEIGHT);
|
|
25
|
+
var mobileSideBarShowCategories = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n"])));
|
|
26
|
+
var sideBar = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", ";\n flex: 0 0 'auto';\n"])), baseSidebarStyles);
|
|
27
|
+
var sideBarShowCategories = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ", ";\n flex: 0 0 ", ";\n"])), baseSidebarStyles, SIDEBAR_WIDTH);
|
|
28
|
+
var sidebarHeading = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n flex: 0 0 ", ";\n display: inline-flex;\n align-items: center;\n padding-left: ", ";\n font-weight: 700;\n"])), SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_HEADING_PADDING_LEFT);
|
|
29
|
+
var mobileMainContent = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n\n display: flex;\n flex-direction: column;\n\n overflow-y: auto;\n height: 100%;\n"])));
|
|
30
|
+
var mainContent = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n ", "\n margin-left: ", "px;\n // Needed for safari\n height: auto;\n"])), mobileMainContent, GRID_SIZE * 2);
|
|
31
|
+
var searchContainer = css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n padding-bottom: ", "px;\n"])), GRID_SIZE * 2);
|
|
32
|
+
var mobileCategoryListWrapper = css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n display: flex;\n overflow-x: auto;\n\n padding: ", "px 0 ", "px 0;\n min-height: ", "px;\n\n overflow: -moz-scrollbars-none;\n ::-webkit-scrollbar {\n display: none;\n }\n scrollbar-width: none;\n -ms-overflow-style: none;\n"])), GRID_SIZE, GRID_SIZE * 2, GRID_SIZE * 4);
|
|
33
|
+
var categoryListWrapper = css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n margin-top: ", "px;\n flex-direction: column;\n"])), mobileCategoryListWrapper, GRID_SIZE * 3);
|
|
18
34
|
|
|
19
35
|
function StatelessElementBrowser(props) {
|
|
20
36
|
var items = props.items,
|
|
@@ -83,9 +99,10 @@ function StatelessElementBrowser(props) {
|
|
|
83
99
|
onSelectItem(selectedItem);
|
|
84
100
|
}
|
|
85
101
|
}, [onSelectItem, selectedItem]);
|
|
86
|
-
return
|
|
102
|
+
return jsx("div", {
|
|
103
|
+
css: wrapper,
|
|
87
104
|
"data-testid": "element-browser"
|
|
88
|
-
},
|
|
105
|
+
}, jsx(ContainerWidthMonitor, null), containerWidth < DEVICE_BREAKPOINT_NUMBERS.medium ? jsx(MobileBrowser, _extends({}, props, {
|
|
89
106
|
selectedItemIndex: selectedItemIndex,
|
|
90
107
|
focusedItemIndex: focusedItemIndex,
|
|
91
108
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
@@ -94,7 +111,7 @@ function StatelessElementBrowser(props) {
|
|
|
94
111
|
setFocusOnSearch: setFocusOnSearch,
|
|
95
112
|
onKeyPress: onItemsEnterKeyPress,
|
|
96
113
|
onKeyDown: onKeyDown
|
|
97
|
-
})) :
|
|
114
|
+
})) : jsx(DesktopBrowser, _extends({}, props, {
|
|
98
115
|
selectedItemIndex: selectedItemIndex,
|
|
99
116
|
focusedItemIndex: focusedItemIndex,
|
|
100
117
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
@@ -106,9 +123,6 @@ function StatelessElementBrowser(props) {
|
|
|
106
123
|
})));
|
|
107
124
|
}
|
|
108
125
|
|
|
109
|
-
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n max-height: inherit;\n overflow: hidden;\n"])));
|
|
110
|
-
Wrapper.displayName = 'Wrapper';
|
|
111
|
-
|
|
112
126
|
function MobileBrowser(_ref) {
|
|
113
127
|
var showCategories = _ref.showCategories,
|
|
114
128
|
showSearch = _ref.showSearch,
|
|
@@ -130,25 +144,29 @@ function MobileBrowser(_ref) {
|
|
|
130
144
|
searchTerm = _ref.searchTerm,
|
|
131
145
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
132
146
|
emptyStateHandler = _ref.emptyStateHandler;
|
|
133
|
-
return
|
|
147
|
+
return jsx("div", {
|
|
148
|
+
css: mobileElementBrowserContainer,
|
|
134
149
|
onKeyPress: onKeyPress,
|
|
135
150
|
onKeyDown: onKeyDown,
|
|
136
151
|
"data-testid": "mobile__element-browser"
|
|
137
|
-
},
|
|
138
|
-
showCategories:
|
|
139
|
-
}, showSearch &&
|
|
152
|
+
}, jsx("div", {
|
|
153
|
+
css: showCategories ? [mobileSideBar, mobileSideBarShowCategories] : mobileSideBar
|
|
154
|
+
}, showSearch && jsx(ElementSearch, {
|
|
140
155
|
onSearch: onSearch,
|
|
141
156
|
mode: mode,
|
|
142
157
|
focus: focusOnSearch,
|
|
143
158
|
onClick: setFocusOnSearch,
|
|
144
159
|
searchTerm: searchTerm
|
|
145
|
-
}), showCategories &&
|
|
160
|
+
}), showCategories && jsx("nav", {
|
|
161
|
+
css: mobileCategoryListWrapper,
|
|
146
162
|
tabIndex: -1
|
|
147
|
-
},
|
|
163
|
+
}, jsx(CategoryList, {
|
|
148
164
|
categories: categories,
|
|
149
165
|
onSelectCategory: onSelectCategory,
|
|
150
166
|
selectedCategory: selectedCategory
|
|
151
|
-
}))),
|
|
167
|
+
}))), jsx("div", {
|
|
168
|
+
css: mobileMainContent
|
|
169
|
+
}, jsx(ElementList, {
|
|
152
170
|
items: items,
|
|
153
171
|
mode: mode,
|
|
154
172
|
onInsertItem: onInsertItem,
|
|
@@ -184,29 +202,39 @@ function DesktopBrowser(_ref2) {
|
|
|
184
202
|
searchTerm = _ref2.searchTerm,
|
|
185
203
|
createAnalyticsEvent = _ref2.createAnalyticsEvent,
|
|
186
204
|
emptyStateHandler = _ref2.emptyStateHandler;
|
|
187
|
-
return
|
|
205
|
+
return jsx("div", {
|
|
206
|
+
css: elementBrowserContainer,
|
|
188
207
|
"data-testid": "desktop__element-browser"
|
|
189
|
-
}, showCategories &&
|
|
190
|
-
showCategories:
|
|
191
|
-
},
|
|
208
|
+
}, showCategories && jsx("div", {
|
|
209
|
+
css: showCategories ? sideBarShowCategories : sideBar
|
|
210
|
+
}, jsx("h2", {
|
|
211
|
+
css: sidebarHeading,
|
|
212
|
+
"data-testid": "sidebar-heading"
|
|
213
|
+
}, jsx(FormattedMessage, {
|
|
192
214
|
id: "fabric.editor.elementbrowser.sidebar.heading",
|
|
193
215
|
defaultMessage: "Browse",
|
|
194
216
|
description: "Sidebar heading"
|
|
195
|
-
})),
|
|
217
|
+
})), jsx("nav", {
|
|
218
|
+
css: categoryListWrapper
|
|
219
|
+
}, jsx(CategoryList, {
|
|
196
220
|
categories: categories,
|
|
197
221
|
onSelectCategory: onSelectCategory,
|
|
198
222
|
selectedCategory: selectedCategory,
|
|
199
223
|
createAnalyticsEvent: createAnalyticsEvent
|
|
200
|
-
}))),
|
|
224
|
+
}))), jsx("div", {
|
|
225
|
+
css: mainContent,
|
|
201
226
|
onKeyPress: onKeyPress,
|
|
202
|
-
onKeyDown: onKeyDown
|
|
203
|
-
|
|
227
|
+
onKeyDown: onKeyDown,
|
|
228
|
+
"data-testid": "main-content"
|
|
229
|
+
}, showSearch && jsx("div", {
|
|
230
|
+
css: searchContainer
|
|
231
|
+
}, jsx(ElementSearch, {
|
|
204
232
|
onSearch: onSearch,
|
|
205
233
|
mode: mode,
|
|
206
234
|
focus: focusOnSearch,
|
|
207
235
|
onClick: setFocusOnSearch,
|
|
208
236
|
searchTerm: searchTerm
|
|
209
|
-
})),
|
|
237
|
+
})), jsx(ElementList, {
|
|
210
238
|
items: items,
|
|
211
239
|
mode: mode,
|
|
212
240
|
onInsertItem: onInsertItem,
|
|
@@ -221,33 +249,6 @@ function DesktopBrowser(_ref2) {
|
|
|
221
249
|
})));
|
|
222
250
|
}
|
|
223
251
|
|
|
224
|
-
var baseBrowserContainerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n height: 100%;\n /** Needed for Safari to work with current css.\n * 100% heights wont work and\n * will default to auto if one of the containers doesn't have a specified height in pixels.\n * Setting the min-height to fill available fits safari's needs and the above 100% height works on the rest of the browsers.\n */\n min-height: -webkit-fill-available;\n"])));
|
|
225
|
-
var MobileElementBrowserContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n flex-direction: column;\n"])), baseBrowserContainerStyles);
|
|
226
|
-
MobileElementBrowserContainer.displayName = 'MobileElementBrowserContainer';
|
|
227
|
-
var ElementBrowserContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n flex-direction: row;\n"])), baseBrowserContainerStyles);
|
|
228
|
-
var baseSidebarStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n overflow-x: auto;\n overflow-y: hidden;\n"])));
|
|
229
|
-
var MobileSideBar = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", ";\n flex: 0 0\n ", ";\n padding: 12px 12px 0 12px;\n"])), baseSidebarStyles, function (_ref3) {
|
|
230
|
-
var showCategories = _ref3.showCategories;
|
|
231
|
-
return showCategories ? 'auto' : INLINE_SIDEBAR_HEIGHT;
|
|
232
|
-
});
|
|
233
|
-
var SideBar = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", ";\n flex: 0 0\n ", ";\n"])), baseSidebarStyles, function (_ref4) {
|
|
234
|
-
var showCategories = _ref4.showCategories;
|
|
235
|
-
return showCategories ? SIDEBAR_WIDTH : 'auto';
|
|
236
|
-
});
|
|
237
|
-
var SidebarHeading = styled.h2(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n flex: 0 0 ", ";\n display: inline-flex;\n align-items: center;\n padding-left: ", ";\n font-weight: 700;\n"])), SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_HEADING_PADDING_LEFT);
|
|
238
|
-
/**
|
|
239
|
-
* In enzyme styled components show up as styled.element
|
|
240
|
-
* and if we don't wanna export SidebarHeading just for testing.
|
|
241
|
-
* https://github.com/styled-components/styled-components/issues/896
|
|
242
|
-
*/
|
|
243
|
-
|
|
244
|
-
SidebarHeading.displayName = 'SidebarHeading';
|
|
245
|
-
var MobileMainContent = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n\n display: flex;\n flex-direction: column;\n\n overflow-y: auto;\n height: 100%;\n"])));
|
|
246
|
-
var MainContent = styled(MobileMainContent)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-left: ", "px;\n // Needed for safari\n height: auto;\n"])), GRID_SIZE * 2);
|
|
247
|
-
MainContent.displayName = 'MainContent';
|
|
248
|
-
var SearchContainer = styled.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n padding-bottom: ", "px;\n"])), GRID_SIZE * 2);
|
|
249
|
-
var MobileCategoryListWrapper = styled.nav(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: flex;\n overflow-x: auto;\n\n padding: ", "px 0 ", "px 0;\n min-height: ", "px;\n\n overflow: -moz-scrollbars-none;\n ::-webkit-scrollbar {\n display: none;\n }\n scrollbar-width: none;\n -ms-overflow-style: none;\n"])), GRID_SIZE, GRID_SIZE * 2, GRID_SIZE * 4);
|
|
250
|
-
var CategoryListWrapper = styled(MobileCategoryListWrapper)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n padding: 0;\n margin-top: ", "px;\n flex-direction: column;\n"])), GRID_SIZE * 3);
|
|
251
252
|
var MemoizedElementBrowser = /*#__PURE__*/memo(withAnalyticsContext({
|
|
252
253
|
source: 'ElementBrowser'
|
|
253
254
|
})(withAnalyticsEvents()(StatelessElementBrowser)));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
|
|
4
4
|
var _templateObject;
|
|
5
5
|
|
|
6
|
+
/** @jsx jsx */
|
|
6
7
|
import React, { memo, useEffect, useRef, useState } from 'react';
|
|
7
|
-
import
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
8
9
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
9
10
|
/**
|
|
10
11
|
*
|
|
@@ -32,6 +33,7 @@ import { WidthObserver } from '@atlaskit/width-detector';
|
|
|
32
33
|
*
|
|
33
34
|
*/
|
|
34
35
|
|
|
36
|
+
var widthObserverWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
35
37
|
export default function useContainerWidth() {
|
|
36
38
|
var _useState = useState(0),
|
|
37
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -47,10 +49,11 @@ export default function useContainerWidth() {
|
|
|
47
49
|
}
|
|
48
50
|
}, [ref]);
|
|
49
51
|
var ContainerWidthMonitor = /*#__PURE__*/memo(function () {
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
+
return jsx("div", {
|
|
53
|
+
css: widthObserverWrapper,
|
|
54
|
+
ref: ref,
|
|
52
55
|
tabIndex: -1
|
|
53
|
-
},
|
|
56
|
+
}, jsx(WidthObserver, {
|
|
54
57
|
setWidth: setContainerWidth
|
|
55
58
|
}));
|
|
56
59
|
});
|
|
@@ -58,6 +61,4 @@ export default function useContainerWidth() {
|
|
|
58
61
|
containerWidth: containerWidth,
|
|
59
62
|
ContainerWidthMonitor: ContainerWidthMonitor
|
|
60
63
|
};
|
|
61
|
-
}
|
|
62
|
-
var WidthObserverWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
63
|
-
WidthObserverWrapper.displayName = 'WidthObserverWrapper';
|
|
64
|
+
}
|
|
@@ -6,7 +6,7 @@ import styled, { css } from 'styled-components';
|
|
|
6
6
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
7
7
|
import { N0 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { dropShadow } from '../styles';
|
|
9
|
-
export var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n ", "
|
|
9
|
+
export var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n ", "\n display: flex;\n align-items: center;\n box-sizing: border-box;\n padding: 4px 8px;\n background-color: ", ";\n ", ";\n"])), borderRadius(), dropShadow, N0, function (_ref) {
|
|
10
10
|
var height = _ref.height;
|
|
11
11
|
return height ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", "px;\n "])), height) : '';
|
|
12
12
|
});
|
|
@@ -11,14 +11,14 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
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; } }
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/** @jsx jsx */
|
|
15
|
+
import { css, jsx } from '@emotion/react';
|
|
15
16
|
import { PureComponent } from 'react';
|
|
16
17
|
import Spinner from '@atlaskit/spinner';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
18
|
import LinkSearchListItem from './LinkSearchListItem';
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
export var
|
|
19
|
+
var listContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 0;\n"])));
|
|
20
|
+
var spinnerContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-align: center;\n min-height: 80px;\n margin-top: 30px;\n"])));
|
|
21
|
+
export var linkSearchList = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0;\n list-style: none;\n"])));
|
|
22
22
|
|
|
23
23
|
var LinkSearchList = /*#__PURE__*/function (_PureComponent) {
|
|
24
24
|
_inherits(LinkSearchList, _PureComponent);
|
|
@@ -49,12 +49,13 @@ var LinkSearchList = /*#__PURE__*/function (_PureComponent) {
|
|
|
49
49
|
var loadingContent;
|
|
50
50
|
|
|
51
51
|
if (items && items.length > 0) {
|
|
52
|
-
itemsContent =
|
|
52
|
+
itemsContent = jsx("ul", {
|
|
53
|
+
css: linkSearchList,
|
|
53
54
|
id: id,
|
|
54
55
|
role: role,
|
|
55
56
|
"aria-controls": ariaControls
|
|
56
57
|
}, items.map(function (item, index) {
|
|
57
|
-
return
|
|
58
|
+
return jsx(LinkSearchListItem, {
|
|
58
59
|
id: "link-search-list-item-".concat(index),
|
|
59
60
|
role: role && 'option',
|
|
60
61
|
item: item,
|
|
@@ -69,12 +70,16 @@ var LinkSearchList = /*#__PURE__*/function (_PureComponent) {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
if (isLoading) {
|
|
72
|
-
loadingContent =
|
|
73
|
+
loadingContent = jsx("div", {
|
|
74
|
+
css: spinnerContainer
|
|
75
|
+
}, jsx(Spinner, {
|
|
73
76
|
size: "medium"
|
|
74
77
|
}));
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
return
|
|
80
|
+
return jsx("div", {
|
|
81
|
+
css: listContainer
|
|
82
|
+
}, itemsContent, loadingContent);
|
|
78
83
|
}
|
|
79
84
|
}]);
|
|
80
85
|
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
|
|
10
|
-
var _class
|
|
10
|
+
var _class;
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -216,7 +216,7 @@ var dummyAnalyticsContext = {
|
|
|
216
216
|
getAtlaskitAnalyticsContext: function getAtlaskitAnalyticsContext() {},
|
|
217
217
|
getAtlaskitAnalyticsEventHandlers: function getAtlaskitAnalyticsEventHandlers() {}
|
|
218
218
|
};
|
|
219
|
-
var AnalyticsContextWrapper = (
|
|
219
|
+
var AnalyticsContextWrapper = (_class = /*#__PURE__*/function (_React$Component3) {
|
|
220
220
|
_inherits(AnalyticsContextWrapper, _React$Component3);
|
|
221
221
|
|
|
222
222
|
var _super4 = _createSuper(AnalyticsContextWrapper);
|
|
@@ -244,4 +244,4 @@ var AnalyticsContextWrapper = (_temp = _class = /*#__PURE__*/function (_React$Co
|
|
|
244
244
|
return AnalyticsContextWrapper;
|
|
245
245
|
}(React.Component), _defineProperty(_class, "contextTypes", {
|
|
246
246
|
contextAdapter: PropTypes.object
|
|
247
|
-
}),
|
|
247
|
+
}), _class);
|
|
@@ -2,6 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
+
import { css } from '@emotion/react';
|
|
5
6
|
import { MediaSingleDimensionHelper } from '@atlaskit/editor-common/ui';
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
export var wrapperStyle = function wrapperStyle(props) {
|
|
8
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & > div {\n ", ";\n position: relative;\n clear: both;\n\n > div {\n position: absolute;\n height: 100%;\n width: 100%;\n }\n }\n"])), MediaSingleDimensionHelper(props));
|
|
9
|
+
};
|
|
@@ -11,10 +11,11 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
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; } }
|
|
13
13
|
|
|
14
|
+
/** @jsx jsx */
|
|
14
15
|
import React from 'react';
|
|
15
|
-
import
|
|
16
|
+
import { css, jsx } from '@emotion/react';
|
|
16
17
|
import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
17
|
-
var
|
|
18
|
+
var toolbarComponentsWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n\n @media (max-width: ", "px) {\n justify-content: space-between;\n }\n"])), akEditorMobileMaxWidth);
|
|
18
19
|
export var ToolbarInner = /*#__PURE__*/function (_React$Component) {
|
|
19
20
|
_inherits(ToolbarInner, _React$Component);
|
|
20
21
|
|
|
@@ -54,7 +55,9 @@ export var ToolbarInner = /*#__PURE__*/function (_React$Component) {
|
|
|
54
55
|
return null;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
return
|
|
58
|
+
return jsx("div", {
|
|
59
|
+
css: toolbarComponentsWrapper
|
|
60
|
+
}, items.map(function (component, key) {
|
|
58
61
|
var props = {
|
|
59
62
|
key: key
|
|
60
63
|
};
|
|
@@ -7,20 +7,20 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
9
|
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
14
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
15
|
|
|
16
|
+
/** @jsx jsx */
|
|
16
17
|
import React from 'react';
|
|
17
|
-
import
|
|
18
|
+
import { css, jsx, keyframes } from '@emotion/react';
|
|
18
19
|
import { R100 } from '@atlaskit/theme/colors';
|
|
19
20
|
var pulseBackground = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 50% {\n background-color: ", ";\n }\n"])), R100);
|
|
20
21
|
var pulseBackgroundReverse = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n background-color: ", ";\n }\n 50% {\n background-color: auto;\n }\n 100% {\n background-color: ", ";\n }\n"])), R100, R100);
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
});
|
|
22
|
+
var flashWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &.-flash > div {\n animation: 0.25s ease-in-out ", ";\n }\n\n & > div {\n animation: 'none';\n }\n"])), pulseBackgroundReverse);
|
|
23
|
+
var flashWrapperAnimated = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n\n & > div {\n animation: 0.25s ease-in-out ", ";\n }\n"])), flashWrapper, pulseBackground);
|
|
24
24
|
|
|
25
25
|
var WithFlash = /*#__PURE__*/function (_React$Component) {
|
|
26
26
|
_inherits(WithFlash, _React$Component);
|
|
@@ -50,9 +50,9 @@ var WithFlash = /*#__PURE__*/function (_React$Component) {
|
|
|
50
50
|
animate = _this$props.animate,
|
|
51
51
|
children = _this$props.children;
|
|
52
52
|
this.toggle = animate && !this.toggle;
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
return jsx("div", {
|
|
54
|
+
css: animate ? flashWrapperAnimated : flashWrapper,
|
|
55
|
+
className: this.toggle ? '-flash' : ''
|
|
56
56
|
}, children);
|
|
57
57
|
}
|
|
58
58
|
}]);
|
package/dist/esm/utils/insert.js
CHANGED
|
@@ -50,6 +50,8 @@ var shouldSplit = function shouldSplit(nodeType, schemaNodes) {
|
|
|
50
50
|
|
|
51
51
|
export var safeInsert = function safeInsert(content, position) {
|
|
52
52
|
return function (tr) {
|
|
53
|
+
var _tr$selection$$from$n;
|
|
54
|
+
|
|
53
55
|
var nodes = tr.doc.type.schema.nodes;
|
|
54
56
|
var whitelist = [nodes.rule, nodes.mediaSingle]; // fallback if the node to insert is not in the whitelist, or if the insertion should happen within a list.
|
|
55
57
|
|
|
@@ -84,6 +86,14 @@ export var safeInsert = function safeInsert(content, position) {
|
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
var grandParentType = (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type;
|
|
90
|
+
var parentType = tr.selection.$from.parent.type;
|
|
91
|
+
|
|
92
|
+
if (!lookDirection && !shouldSplitSelectedNodeOnNodeInsertion(parentType, grandParentType, content)) {
|
|
93
|
+
// node to be inserted is an invalid child of selection so insert below selected node
|
|
94
|
+
return pmSafeInsert(content, tr.selection.from)(tr);
|
|
95
|
+
}
|
|
96
|
+
|
|
87
97
|
if (!lookDirection) {
|
|
88
98
|
// fallback to consumer for now
|
|
89
99
|
return null;
|
|
@@ -180,4 +190,14 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
180
190
|
|
|
181
191
|
return tr;
|
|
182
192
|
};
|
|
193
|
+
}; // ED-14584: Util to check if the current node is a paragraph & the content being
|
|
194
|
+
// inserted is a valid child of the grandparent node
|
|
195
|
+
// In this case, the node being inserted to should split
|
|
196
|
+
|
|
197
|
+
export var shouldSplitSelectedNodeOnNodeInsertion = function shouldSplitSelectedNodeOnNodeInsertion(parentNodeType, grandParentNodeType, content) {
|
|
198
|
+
if (parentNodeType.name === 'paragraph' && grandParentNodeType.validContent(Fragment.from(content))) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return false;
|
|
183
203
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
3
|
+
import { useComponentRenderTracking } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { EVENT_TYPE } from '../../../plugins/analytics';
|
|
5
|
+
export function RenderTracking(props) {
|
|
6
|
+
var debouncedHandleAnalyticsEvent = useMemo(function () {
|
|
7
|
+
return debounce(props.handleAnalyticsEvent, 500);
|
|
8
|
+
}, [props.handleAnalyticsEvent]);
|
|
9
|
+
useComponentRenderTracking({
|
|
10
|
+
onRender: function onRender(_ref) {
|
|
11
|
+
var renderCount = _ref.renderCount,
|
|
12
|
+
propsDifference = _ref.propsDifference;
|
|
13
|
+
|
|
14
|
+
if (!renderCount) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
debouncedHandleAnalyticsEvent({
|
|
19
|
+
payload: {
|
|
20
|
+
action: props.action,
|
|
21
|
+
actionSubject: props.actionSubject,
|
|
22
|
+
attributes: {
|
|
23
|
+
count: renderCount,
|
|
24
|
+
propsDifference: propsDifference
|
|
25
|
+
},
|
|
26
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
propsDiffingOptions: {
|
|
31
|
+
enabled: true,
|
|
32
|
+
props: props.componentProps,
|
|
33
|
+
propsToIgnore: props.propsToIgnore,
|
|
34
|
+
useShallow: props.useShallow
|
|
35
|
+
},
|
|
36
|
+
zeroBasedCount: true
|
|
37
|
+
});
|
|
38
|
+
return null;
|
|
39
|
+
}
|
package/dist/esm/version.json
CHANGED
package/dist/types/editor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import { IntlShape } from 'react-intl';
|
|
4
|
+
import type { IntlShape } from 'react-intl-next';
|
|
5
5
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
6
6
|
import { Transformer } from '@atlaskit/editor-common/types';
|
|
7
7
|
import EditorActions from './actions';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { Command } from '../types/command';
|
|
3
5
|
export declare const addAltText: Keymap;
|
|
4
6
|
export declare const toggleBold: Keymap;
|
|
@@ -63,13 +65,12 @@ export declare const altPaste: Keymap;
|
|
|
63
65
|
export declare const find: Keymap;
|
|
64
66
|
export declare const alignLeft: Keymap;
|
|
65
67
|
export declare const alignRight: Keymap;
|
|
66
|
-
export declare const TooltipShortcut: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
67
68
|
export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
|
|
68
69
|
export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
|
|
69
70
|
description?: string | React.ReactNode;
|
|
70
71
|
keymap?: Keymap | undefined;
|
|
71
72
|
shortcutOverride?: string | undefined;
|
|
72
|
-
}) => JSX.Element | null>;
|
|
73
|
+
}) => jsx.JSX.Element | null>;
|
|
73
74
|
export declare function findKeymapByDescription(description: string): Keymap | undefined;
|
|
74
75
|
export declare function findShortcutByDescription(description: string): string | undefined;
|
|
75
76
|
export declare function findShortcutByKeymap(keymap: Keymap): string | undefined;
|
|
@@ -5,5 +5,5 @@ import EditorActions from '../../actions';
|
|
|
5
5
|
export declare type FullPageProps = EditorProps & {
|
|
6
6
|
onMount?: (actions: EditorActions) => void;
|
|
7
7
|
} & WithAnalyticsEventsProps;
|
|
8
|
-
declare const FullPageWithAnalytics: React.ForwardRefExoticComponent<Pick<FullPageProps, "mentionProvider" | "emojiProvider" | "autoformattingProvider" | "taskDecisionProvider" | "contextIdentifierProvider" | "collabEditProvider" | "macroProvider" | "searchProvider" | "activityProvider" | "presenceProvider" | "placeholderBracketHint" | "placeholderHints" | "codeBlock" | "media" | "allowBlockType" | "
|
|
8
|
+
declare const FullPageWithAnalytics: React.ForwardRefExoticComponent<Pick<FullPageProps, "mentionProvider" | "emojiProvider" | "autoformattingProvider" | "taskDecisionProvider" | "contextIdentifierProvider" | "collabEditProvider" | "macroProvider" | "searchProvider" | "activityProvider" | "presenceProvider" | "placeholderBracketHint" | "placeholderHints" | "codeBlock" | "media" | "allowBlockType" | "contextPanel" | "defaultValue" | "onChange" | "appearance" | "placeholder" | "quickInsert" | "disabled" | "waitForMediaUpload" | "maxHeight" | "popupsMountPoint" | "popupsBoundariesElement" | "popupsScrollableElement" | "editorActions" | "mention" | "insertMenuItems" | "primaryToolbarComponents" | "contentComponents" | "onDestroy" | "onMount" | "saveOnEnter" | "textFormatting" | "maxContentSize" | "performanceTracking" | "featureFlags" | "onSave" | "onCancel" | "extensionHandlers" | "collabEdit" | "allowBreakout" | "uploadErrorHandler" | "sanitizePrivateContent" | "mentionInsertDisplayName" | "allowNestedTasks" | "allowExpand" | "shouldFocus" | "persistScrollGutter" | "primaryToolbarIconBefore" | "secondaryToolbarComponents" | "allowAnalyticsGASV3" | "allowTasksAndDecisions" | "allowRule" | "allowTextColor" | "allowTables" | "allowHelpDialog" | "feedbackInfo" | "allowJiraIssue" | "allowPanel" | "allowExtension" | "allowConfluenceInlineComment" | "allowTemplatePlaceholders" | "allowDate" | "allowLayouts" | "allowStatus" | "allowDynamicTextSizing" | "allowTextAlignment" | "allowIndentation" | "allowNewInsertionBehaviour" | "autoScrollIntoView" | "allowFindReplace" | "UNSAFE_cards" | "smartLinks" | "errorReporterHandler" | "annotationProviders" | "legacyImageUploadProvider" | "contentTransformerProvider" | "allowKeyboardAccessibleDatepicker" | "onEditorReady" | "inputSamplingLimit" | "extensionProviders" | "UNSAFE_useAnalyticsContext" | "elementBrowser" | "UNSAFE_allowUndoRedoButtons" | "trackValidTransactions" | "useStickyToolbar" | "allowFragmentMark" | "dangerouslyAppendPlugins"> & React.RefAttributes<any>>;
|
|
9
9
|
export { FullPageWithAnalytics as FullPage };
|
|
@@ -9,4 +9,4 @@ export declare function MobileEditor(props: MobileEditorProps & WithAnalyticsEve
|
|
|
9
9
|
export declare namespace MobileEditor {
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const Mobile: React.ForwardRefExoticComponent<Pick<MobileEditorProps & WithAnalyticsEventsProps, "onAnalyticsEvent" | "children" | "
|
|
12
|
+
export declare const Mobile: React.ForwardRefExoticComponent<Pick<MobileEditorProps & WithAnalyticsEventsProps, "onAnalyticsEvent" | "children" | "plugins" | "defaultValue" | "onChange" | "placeholder" | "disabled" | "maxHeight" | "popupsMountPoint" | "popupsBoundariesElement" | "popupsScrollableElement" | "onDestroy" | "onMount" | "transformer" | "onSave" | "onCancel" | "isMaxContentSizeReached"> & React.RefAttributes<any>>;
|
|
@@ -50,11 +50,6 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
50
50
|
setDomAttrs(node: PMNode, element: HTMLElement): void;
|
|
51
51
|
get dom(): HTMLElement | undefined;
|
|
52
52
|
destroy(): void;
|
|
53
|
-
get performanceOptions(): {
|
|
54
|
-
enabled: boolean;
|
|
55
|
-
samplingRate: number;
|
|
56
|
-
slowThreshold: number;
|
|
57
|
-
};
|
|
58
53
|
private dispatchAnalyticsEvent;
|
|
59
54
|
static fromComponent(component: React.ComponentType<any>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, props?: ReactComponentProps, viewShouldUpdate?: (nextNode: PMNode) => boolean, hasIntlContext?: boolean): (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<ReactComponentProps>;
|
|
60
55
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorProps, EditorView } from 'prosemirror-view';
|
|
3
|
+
import { Node as PMNode } from 'prosemirror-model';
|
|
4
|
+
import type { PMPluginFactoryParams } from '../types';
|
|
5
|
+
export declare type InlineNodeViewComponentProps = {
|
|
6
|
+
view: EditorView;
|
|
7
|
+
getPos: NodeViewParams['getPos'];
|
|
8
|
+
node: PMNode;
|
|
9
|
+
};
|
|
10
|
+
declare type InlineNodeViewComponent<ExtraComponentProps> = React.ComponentType<InlineNodeViewComponentProps & ExtraComponentProps>;
|
|
11
|
+
declare type NodeViewProducer = NonNullable<EditorProps['nodeViews']>[string];
|
|
12
|
+
declare type NodeViewParams = {
|
|
13
|
+
node: Parameters<NodeViewProducer>[0];
|
|
14
|
+
view: Parameters<NodeViewProducer>[1];
|
|
15
|
+
getPos: Parameters<NodeViewProducer>[2];
|
|
16
|
+
decorations: Parameters<NodeViewProducer>[3];
|
|
17
|
+
};
|
|
18
|
+
export declare function getInlineNodeViewProducer<ExtraComponentProps>({ pmPluginFactoryParams, Component, extraComponentProps, }: {
|
|
19
|
+
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
20
|
+
Component: InlineNodeViewComponent<ExtraComponentProps>;
|
|
21
|
+
extraComponentProps?: ExtraComponentProps;
|
|
22
|
+
}): NodeViewProducer;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InlineNodeViewSharedStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { EditorState } from 'prosemirror-state';
|
|
3
|
+
import { AnalyticsEventPayload } from '../plugins/analytics';
|
|
4
|
+
export declare let nodeViewRenderedEventsCounter: number;
|
|
5
|
+
export declare function getPerformanceOptions(view: EditorView): {
|
|
6
|
+
trackingEnabled: boolean;
|
|
7
|
+
samplingRate: number;
|
|
8
|
+
slowThreshold: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function startMeasureReactNodeViewRendered({ nodeTypeName, }: {
|
|
11
|
+
nodeTypeName: string;
|
|
12
|
+
}): void;
|
|
13
|
+
export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, editorState, samplingRate, slowThreshold, }: {
|
|
14
|
+
nodeTypeName: string;
|
|
15
|
+
dispatchAnalyticsEvent(payload: AnalyticsEventPayload): void;
|
|
16
|
+
editorState: EditorState;
|
|
17
|
+
samplingRate: number;
|
|
18
|
+
slowThreshold: number;
|
|
19
|
+
}): void;
|