@atlaskit/editor-core 179.1.2 → 180.1.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 +80 -0
- package/codemods/180.1.0-update-to-editor-migration-component.ts +8 -0
- package/codemods/__tests__/rename-editor-to-editor-migration-component.ts +156 -0
- package/codemods/migrates/rename-editor-to-editor-migration-component.ts +34 -0
- package/dist/cjs/actions/index.js +1 -1
- package/dist/cjs/create-editor/ReactEditorView.js +12 -762
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +783 -0
- package/dist/cjs/create-editor/ReactEditorViewNext.js +16 -0
- package/dist/cjs/create-editor/create-plugins-list.js +1 -0
- package/dist/cjs/create-editor/feature-flags-from-props.js +3 -2
- package/dist/cjs/editor-next/editor-internal.js +147 -0
- package/dist/cjs/editor-next/editor-migration-component.js +35 -0
- package/dist/cjs/editor-next/hooks/useEditorMeasuresConstructor.js +36 -0
- package/dist/cjs/editor-next/hooks/useMeasureEditorMountTime.js +42 -0
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +72 -0
- package/dist/cjs/editor-next/index.js +139 -0
- package/dist/cjs/editor-next/utils/deprecationWarnings.js +45 -0
- package/dist/cjs/editor-next/utils/editorMeasureTTICallback.js +44 -0
- package/dist/cjs/editor-next/utils/editorPropTypes.js +36 -0
- package/dist/cjs/editor-next/utils/getBaseFontSize.js +17 -0
- package/dist/cjs/editor-next/utils/handleProviders.js +56 -0
- package/dist/cjs/editor-next/utils/onEditorCreated.js +28 -0
- package/dist/cjs/editor-next/utils/sendDurationAnalytics.js +68 -0
- package/dist/cjs/editor-next/utils/trackEditorActions.js +101 -0
- package/dist/cjs/editor.js +130 -443
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/labs/next/internal/hooks/use-analytics/index.js +4 -4
- package/dist/cjs/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +6 -6
- package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +117 -0
- package/dist/cjs/labs/next/presets/preset.js +0 -5
- package/dist/cjs/labs/next/presets/universal.js +11 -2
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +48 -13
- package/dist/cjs/plugins/analytics/index.js +2 -3
- package/dist/cjs/plugins/analytics/plugin.js +5 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -11
- package/dist/cjs/plugins/base/pm-plugins/filter-steps.js +1 -1
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +98 -56
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +24 -25
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +36 -9
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +2 -1
- package/dist/cjs/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/cjs/plugins/card/pm-plugins/main.js +4 -2
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -1
- package/dist/cjs/plugins/collab-edit/plugin.js +2 -3
- package/dist/cjs/plugins/extension/toolbar.js +7 -1
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Button.js +2 -0
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +38 -9
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +23 -21
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +11 -0
- package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/cjs/plugins/hyperlink/analytics.js +5 -5
- package/dist/cjs/plugins/hyperlink/index.js +1 -1
- package/dist/cjs/plugins/hyperlink/pm-plugins/main.js +9 -5
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -4
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +4 -3
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -0
- package/dist/cjs/plugins/media/commands/helpers.js +12 -40
- package/dist/cjs/plugins/media/commands/index.js +4 -4
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +14 -12
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +310 -205
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +2 -27
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +1 -4
- package/dist/cjs/plugins/panel/utils.js +4 -1
- package/dist/cjs/plugins/paste/handlers.js +128 -13
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +15 -6
- package/dist/cjs/plugins/paste/pm-plugins/main.js +12 -3
- package/dist/cjs/plugins/placeholder-text/index.js +2 -2
- package/dist/cjs/plugins/status/index.js +9 -3
- package/dist/cjs/plugins/status/ui/statusPicker.js +8 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +42 -8
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +22 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +3 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
- package/dist/cjs/plugins/text-formatting/utils.js +1 -10
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
- package/dist/cjs/plugins/type-ahead/index.js +1 -1
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +79 -106
- package/dist/cjs/types/get-editor-props.js +5 -0
- package/dist/cjs/ui/ChromeCollapsed/index.js +1 -0
- package/dist/cjs/ui/CollapsedEditor/index.js +7 -13
- package/dist/cjs/ui/ColorPickerButton/index.js +68 -6
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/cjs/ui/ContextPanel/context.js +13 -12
- package/dist/cjs/ui/Dropdown/index.js +7 -2
- package/dist/cjs/ui/DropdownMenu/index.js +7 -2
- package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +1 -1
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
- package/dist/cjs/ui/PanelTextInput/index.js +4 -4
- package/dist/cjs/ui/PortalProvider/index.js +5 -5
- package/dist/cjs/ui/WidthEmitter/index.js +29 -35
- package/dist/cjs/utils/document.js +15 -0
- package/dist/cjs/utils/extensions.js +6 -7
- package/dist/cjs/utils/get-editor-plugins.js +32 -0
- package/dist/cjs/utils/linking-utils.js +1 -1
- package/dist/cjs/utils/performance/components/RenderTracking.js +1 -1
- package/dist/cjs/utils/performance/safer-transactions.js +1 -1
- package/dist/cjs/utils/prepare-extension-provider.js +25 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +2 -2
- package/dist/es2019/create-editor/ReactEditorView.js +6 -708
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +712 -0
- package/dist/es2019/create-editor/ReactEditorViewNext.js +7 -0
- package/dist/es2019/create-editor/create-plugins-list.js +1 -0
- package/dist/es2019/create-editor/feature-flags-from-props.js +3 -2
- package/dist/es2019/editor-next/editor-internal.js +142 -0
- package/dist/es2019/editor-next/editor-migration-component.js +10 -0
- package/dist/es2019/editor-next/hooks/useEditorMeasuresConstructor.js +30 -0
- package/dist/es2019/editor-next/hooks/useMeasureEditorMountTime.js +35 -0
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +61 -0
- package/dist/es2019/editor-next/index.js +90 -0
- package/dist/es2019/editor-next/utils/deprecationWarnings.js +39 -0
- package/dist/es2019/editor-next/utils/editorMeasureTTICallback.js +40 -0
- package/dist/es2019/editor-next/utils/editorPropTypes.js +29 -0
- package/dist/es2019/editor-next/utils/getBaseFontSize.js +11 -0
- package/dist/es2019/editor-next/utils/handleProviders.js +52 -0
- package/dist/es2019/editor-next/utils/onEditorCreated.js +21 -0
- package/dist/es2019/editor-next/utils/sendDurationAnalytics.js +40 -0
- package/dist/es2019/editor-next/utils/trackEditorActions.js +78 -0
- package/dist/es2019/editor.js +111 -396
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/labs/next/internal/hooks/use-analytics/index.js +2 -2
- package/dist/es2019/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +2 -3
- package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +105 -0
- package/dist/es2019/labs/next/presets/preset.js +0 -3
- package/dist/es2019/labs/next/presets/universal.js +13 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +41 -12
- package/dist/es2019/plugins/analytics/index.js +3 -4
- package/dist/es2019/plugins/analytics/plugin.js +1 -2
- package/dist/es2019/plugins/analytics/utils.js +0 -4
- package/dist/es2019/plugins/base/pm-plugins/filter-steps.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +96 -58
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +23 -23
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +31 -5
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +4 -1
- package/dist/es2019/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/es2019/plugins/card/pm-plugins/main.js +3 -1
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +3 -1
- package/dist/es2019/plugins/collab-edit/plugin.js +1 -2
- package/dist/es2019/plugins/extension/toolbar.js +7 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Button.js +2 -0
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +35 -7
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +11 -0
- package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/es2019/plugins/hyperlink/analytics.js +1 -1
- package/dist/es2019/plugins/hyperlink/index.js +1 -1
- package/dist/es2019/plugins/hyperlink/pm-plugins/main.js +8 -4
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -3
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +24 -0
- package/dist/es2019/plugins/media/commands/helpers.js +9 -35
- package/dist/es2019/plugins/media/commands/index.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +3 -3
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +70 -37
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +3 -30
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +1 -4
- package/dist/es2019/plugins/panel/utils.js +4 -1
- package/dist/es2019/plugins/paste/handlers.js +127 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +10 -4
- package/dist/es2019/plugins/paste/pm-plugins/main.js +13 -4
- package/dist/es2019/plugins/placeholder-text/index.js +1 -1
- package/dist/es2019/plugins/status/index.js +8 -2
- package/dist/es2019/plugins/status/ui/statusPicker.js +8 -2
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +42 -8
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +20 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +4 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
- package/dist/es2019/plugins/text-formatting/utils.js +0 -8
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +16 -1
- package/dist/es2019/plugins/type-ahead/index.js +1 -1
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +73 -92
- package/dist/es2019/types/get-editor-props.js +1 -0
- package/dist/es2019/ui/ChromeCollapsed/index.js +1 -0
- package/dist/es2019/ui/CollapsedEditor/index.js +7 -11
- package/dist/es2019/ui/ColorPickerButton/index.js +61 -8
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/es2019/ui/ContextPanel/context.js +5 -4
- package/dist/es2019/ui/Dropdown/index.js +5 -2
- package/dist/es2019/ui/DropdownMenu/index.js +5 -2
- package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +1 -1
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
- package/dist/es2019/ui/PanelTextInput/index.js +3 -3
- package/dist/es2019/ui/PortalProvider/index.js +1 -1
- package/dist/es2019/ui/WidthEmitter/index.js +25 -29
- package/dist/es2019/utils/document.js +11 -1
- package/dist/es2019/utils/extensions.js +1 -3
- package/dist/es2019/utils/get-editor-plugins.js +25 -0
- package/dist/es2019/utils/linking-utils.js +1 -1
- package/dist/es2019/utils/performance/components/RenderTracking.js +1 -1
- package/dist/es2019/utils/performance/safer-transactions.js +1 -1
- package/dist/es2019/utils/prepare-extension-provider.js +13 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +2 -2
- package/dist/esm/create-editor/ReactEditorView.js +12 -763
- package/dist/esm/create-editor/ReactEditorViewInternal.js +776 -0
- package/dist/esm/create-editor/ReactEditorViewNext.js +7 -0
- package/dist/esm/create-editor/create-plugins-list.js +1 -0
- package/dist/esm/create-editor/feature-flags-from-props.js +3 -2
- package/dist/esm/editor-next/editor-internal.js +141 -0
- package/dist/esm/editor-next/editor-migration-component.js +28 -0
- package/dist/esm/editor-next/hooks/useEditorMeasuresConstructor.js +30 -0
- package/dist/esm/editor-next/hooks/useMeasureEditorMountTime.js +35 -0
- package/dist/esm/editor-next/hooks/useProviderFactory.js +65 -0
- package/dist/esm/editor-next/index.js +134 -0
- package/dist/esm/editor-next/utils/deprecationWarnings.js +39 -0
- package/dist/esm/editor-next/utils/editorMeasureTTICallback.js +38 -0
- package/dist/esm/editor-next/utils/editorPropTypes.js +28 -0
- package/dist/esm/editor-next/utils/getBaseFontSize.js +11 -0
- package/dist/esm/editor-next/utils/handleProviders.js +50 -0
- package/dist/esm/editor-next/utils/onEditorCreated.js +21 -0
- package/dist/esm/editor-next/utils/sendDurationAnalytics.js +61 -0
- package/dist/esm/editor-next/utils/trackEditorActions.js +94 -0
- package/dist/esm/editor.js +130 -440
- package/dist/esm/index.js +2 -1
- package/dist/esm/labs/next/internal/hooks/use-analytics/index.js +2 -2
- package/dist/esm/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +2 -3
- package/dist/esm/labs/next/presets/create-stub-internal-apis.js +110 -0
- package/dist/esm/labs/next/presets/preset.js +0 -5
- package/dist/esm/labs/next/presets/universal.js +11 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +48 -13
- package/dist/esm/plugins/analytics/index.js +3 -4
- package/dist/esm/plugins/analytics/plugin.js +1 -2
- package/dist/esm/plugins/analytics/utils.js +0 -9
- package/dist/esm/plugins/base/pm-plugins/filter-steps.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +98 -56
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +24 -25
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +36 -9
- package/dist/esm/plugins/card/nodeviews/blockCard.js +2 -1
- package/dist/esm/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/esm/plugins/card/pm-plugins/main.js +4 -2
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +4 -1
- package/dist/esm/plugins/collab-edit/plugin.js +1 -2
- package/dist/esm/plugins/extension/toolbar.js +7 -1
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/esm/plugins/floating-toolbar/ui/Button.js +2 -0
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +38 -9
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +23 -21
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +11 -0
- package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/esm/plugins/hyperlink/analytics.js +1 -1
- package/dist/esm/plugins/hyperlink/index.js +1 -1
- package/dist/esm/plugins/hyperlink/pm-plugins/main.js +9 -5
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -4
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -2
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -0
- package/dist/esm/plugins/media/commands/helpers.js +9 -35
- package/dist/esm/plugins/media/commands/index.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +14 -12
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +311 -206
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +3 -28
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +1 -4
- package/dist/esm/plugins/panel/utils.js +4 -1
- package/dist/esm/plugins/paste/handlers.js +127 -13
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +13 -5
- package/dist/esm/plugins/paste/pm-plugins/main.js +13 -4
- package/dist/esm/plugins/placeholder-text/index.js +2 -2
- package/dist/esm/plugins/status/index.js +9 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +8 -2
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +42 -8
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +23 -3
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +4 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
- package/dist/esm/plugins/text-formatting/utils.js +0 -8
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
- package/dist/esm/plugins/type-ahead/index.js +1 -1
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +79 -106
- package/dist/esm/types/get-editor-props.js +1 -0
- package/dist/esm/ui/ChromeCollapsed/index.js +1 -0
- package/dist/esm/ui/CollapsedEditor/index.js +7 -13
- package/dist/esm/ui/ColorPickerButton/index.js +69 -7
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/esm/ui/ContextPanel/context.js +8 -8
- package/dist/esm/ui/Dropdown/index.js +7 -2
- package/dist/esm/ui/DropdownMenu/index.js +7 -2
- package/dist/esm/ui/ElementBrowser/components/CategoryList.js +1 -1
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
- package/dist/esm/ui/PanelTextInput/index.js +4 -4
- package/dist/esm/ui/PortalProvider/index.js +1 -1
- package/dist/esm/ui/WidthEmitter/index.js +28 -37
- package/dist/esm/utils/document.js +15 -1
- package/dist/esm/utils/extensions.js +1 -3
- package/dist/esm/utils/get-editor-plugins.js +25 -0
- package/dist/esm/utils/linking-utils.js +1 -1
- package/dist/esm/utils/performance/components/RenderTracking.js +1 -1
- package/dist/esm/utils/performance/safer-transactions.js +1 -1
- package/dist/esm/utils/prepare-extension-provider.js +17 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/create-editor/ReactEditorView.d.ts +7 -109
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +112 -0
- package/dist/types/create-editor/ReactEditorViewNext.d.ts +9 -0
- package/dist/types/editor-next/editor-internal.d.ts +44 -0
- package/dist/types/editor-next/editor-migration-component.d.ts +5 -0
- package/dist/types/editor-next/hooks/useEditorMeasuresConstructor.d.ts +17 -0
- package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +13 -0
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +21 -0
- package/dist/types/editor-next/index.d.ts +34 -0
- package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -0
- package/dist/types/editor-next/utils/editorMeasureTTICallback.d.ts +5 -0
- package/dist/types/editor-next/utils/editorPropTypes.d.ts +19 -0
- package/dist/types/editor-next/utils/getBaseFontSize.d.ts +6 -0
- package/dist/types/editor-next/utils/handleProviders.d.ts +14 -0
- package/dist/types/editor-next/utils/onEditorCreated.d.ts +12 -0
- package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +15 -0
- package/dist/types/editor-next/utils/trackEditorActions.d.ts +29 -0
- package/dist/types/editor.d.ts +47 -25
- package/dist/types/index.d.ts +1 -0
- package/dist/types/labs/next/internal/hooks/use-analytics/index.d.ts +1 -1
- package/dist/types/labs/next/presets/create-stub-internal-apis.d.ts +16 -0
- package/dist/types/labs/next/presets/preset.d.ts +6 -6
- package/dist/types/labs/next/presets/universal.d.ts +1 -1
- package/dist/types/plugins/alignment/index.d.ts +1 -1
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +3 -1
- package/dist/types/plugins/analytics/index.d.ts +3 -6
- package/dist/types/plugins/analytics/plugin.d.ts +3 -1
- package/dist/types/plugins/analytics/utils.d.ts +2 -3
- package/dist/types/plugins/annotation/index.d.ts +3 -1
- package/dist/types/plugins/avatar-group/index.d.ts +3 -1
- package/dist/types/plugins/base/index.d.ts +3 -1
- package/dist/types/plugins/base/pm-plugins/filter-steps.d.ts +1 -1
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +1 -3
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +3 -1
- package/dist/types/plugins/block-type/index.d.ts +3 -1
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/blocktype-button.d.ts +1 -0
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
- package/dist/types/plugins/breakout/index.d.ts +3 -1
- package/dist/types/plugins/card/index.d.ts +3 -1
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +1 -0
- package/dist/types/plugins/card/types.d.ts +3 -0
- package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -1
- package/dist/types/plugins/code-block/index.d.ts +3 -1
- package/dist/types/plugins/collab-edit/index.d.ts +3 -1
- package/dist/types/plugins/context-panel/index.d.ts +1 -1
- package/dist/types/plugins/emoji/index.d.ts +3 -1
- package/dist/types/plugins/expand/index.d.ts +3 -1
- package/dist/types/plugins/extension/index.d.ts +3 -1
- package/dist/types/plugins/extension/toolbar.d.ts +5 -0
- package/dist/types/plugins/feature-flags-context/index.d.ts +3 -1
- package/dist/types/plugins/feedback-dialog/index.d.ts +3 -1
- package/dist/types/plugins/find-replace/index.d.ts +3 -1
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +2 -1
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +5 -2
- package/dist/types/plugins/grid/index.d.ts +3 -1
- package/dist/types/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types/plugins/hyperlink/analytics.d.ts +1 -1
- package/dist/types/plugins/hyperlink/index.d.ts +3 -1
- package/dist/types/plugins/hyperlink/pm-plugins/main.d.ts +4 -2
- package/dist/types/plugins/hyperlink/types.d.ts +3 -1
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +3 -1
- package/dist/types/plugins/insert-block/index.d.ts +3 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -0
- package/dist/types/plugins/layout/index.d.ts +3 -1
- package/dist/types/plugins/list/index.d.ts +3 -1
- package/dist/types/plugins/max-content-size/index.d.ts +3 -1
- package/dist/types/plugins/media/commands/helpers.d.ts +5 -12
- package/dist/types/plugins/media/commands/index.d.ts +1 -1
- package/dist/types/plugins/media/index.d.ts +3 -1
- package/dist/types/plugins/media/nodeviews/__mocks__/mediaNodeUpdater.d.ts +3 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +4 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -4
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -4
- package/dist/types/plugins/mentions/index.d.ts +3 -1
- package/dist/types/plugins/panel/index.d.ts +3 -1
- package/dist/types/plugins/paste/handlers.d.ts +2 -1
- package/dist/types/plugins/paste/index.d.ts +3 -1
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +4 -1
- package/dist/types/plugins/placeholder/index.d.ts +3 -1
- package/dist/types/plugins/placeholder-text/index.d.ts +3 -1
- package/dist/types/plugins/quick-insert/index.d.ts +3 -1
- package/dist/types/plugins/save-on-enter/index.d.ts +3 -1
- package/dist/types/plugins/selection/index.d.ts +3 -1
- package/dist/types/plugins/status/index.d.ts +3 -1
- package/dist/types/plugins/status/ui/statusPicker.d.ts +3 -0
- package/dist/types/plugins/submit-editor/index.d.ts +3 -1
- package/dist/types/plugins/tasks-and-decisions/index.d.ts +3 -1
- package/dist/types/plugins/text-color/index.d.ts +3 -1
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +2 -0
- package/dist/types/plugins/text-formatting/index.d.ts +3 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/more-button.d.ts +2 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +0 -1
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +3 -1
- package/dist/types/plugins/type-ahead/index.d.ts +3 -1
- package/dist/types/types/get-editor-props.d.ts +12 -0
- package/dist/types/types/performance-tracking.d.ts +10 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +29 -29
- package/dist/types/ui/CollapsedEditor/index.d.ts +4 -3
- package/dist/types/ui/ColorPickerButton/index.d.ts +2 -1
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ContextPanel/context.d.ts +2 -1
- package/dist/types/ui/PanelTextInput/index.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +1 -1
- package/dist/types/utils/document.d.ts +4 -3
- package/dist/types/utils/get-editor-plugins.d.ts +10 -0
- package/dist/types/utils/linking-utils.d.ts +1 -1
- package/dist/types/utils/performance/components/RenderTracking.d.ts +1 -1
- package/dist/types/utils/performance/instrumented-plugin.d.ts +1 -1
- package/dist/types/utils/performance/safer-transactions.d.ts +1 -1
- package/dist/types/utils/prepare-extension-provider.d.ts +5 -0
- package/docs/0-intro.tsx +0 -1
- package/package.json +27 -26
- package/report.api.md +193 -139
- package/dist/cjs/plugins/analytics/analytics-queue.js +0 -79
- package/dist/cjs/plugins/analytics/fire-analytics-event.js +0 -35
- package/dist/es2019/plugins/analytics/analytics-queue.js +0 -53
- package/dist/es2019/plugins/analytics/fire-analytics-event.js +0 -26
- package/dist/esm/plugins/analytics/analytics-queue.js +0 -71
- package/dist/esm/plugins/analytics/fire-analytics-event.js +0 -28
- package/dist/types/plugins/analytics/analytics-queue.d.ts +0 -10
- package/dist/types/plugins/analytics/fire-analytics-event.d.ts +0 -9
|
@@ -28,6 +28,10 @@ var FormattingTextDropdownMenu = /*#__PURE__*/_react.default.memo(function (_ref
|
|
|
28
28
|
isMenuOpen = _useMenuState2[0],
|
|
29
29
|
toggleMenu = _useMenuState2[1],
|
|
30
30
|
closeMenu = _useMenuState2[2];
|
|
31
|
+
var _useState = (0, _react.useState)(false),
|
|
32
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
+
isOpenedByKeyboard = _useState2[0],
|
|
34
|
+
setIsOpenedByKeyboard = _useState2[1];
|
|
31
35
|
var group = (0, _react.useMemo)(function () {
|
|
32
36
|
return [{
|
|
33
37
|
items: items
|
|
@@ -53,13 +57,29 @@ var FormattingTextDropdownMenu = /*#__PURE__*/_react.default.memo(function (_ref
|
|
|
53
57
|
zIndex: _editorSharedStyles.akEditorMenuZIndex,
|
|
54
58
|
fitHeight: 188,
|
|
55
59
|
fitWidth: 136,
|
|
56
|
-
shouldUseDefaultRole: true
|
|
60
|
+
shouldUseDefaultRole: true,
|
|
61
|
+
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
62
|
+
if (isOpenedByKeyboard) {
|
|
63
|
+
setIsOpenedByKeyboard(false);
|
|
64
|
+
}
|
|
65
|
+
return isOpenedByKeyboard;
|
|
66
|
+
}
|
|
57
67
|
}, /*#__PURE__*/_react.default.createElement(_moreButton.MoreButton, {
|
|
58
68
|
isSelected: isMenuOpen || hasFormattingActive,
|
|
59
69
|
label: moreButtonLabel,
|
|
60
70
|
isReducedSpacing: isReducedSpacing,
|
|
61
71
|
isDisabled: false,
|
|
62
|
-
onClick:
|
|
72
|
+
onClick: function onClick() {
|
|
73
|
+
toggleMenu();
|
|
74
|
+
setIsOpenedByKeyboard(false);
|
|
75
|
+
},
|
|
76
|
+
onKeyDown: function onKeyDown(event) {
|
|
77
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
toggleMenu();
|
|
80
|
+
setIsOpenedByKeyboard(true);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
63
83
|
"aria-expanded": isMenuOpen
|
|
64
84
|
}));
|
|
65
85
|
});
|
|
@@ -26,11 +26,13 @@ var _dropdownMenu = require("./dropdown-menu");
|
|
|
26
26
|
var _toolbarMessages = require("./toolbar-messages");
|
|
27
27
|
var _utils = require("../../utils");
|
|
28
28
|
var _announcer = _interopRequireDefault(require("../../../../utils/announcer/announcer"));
|
|
29
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
29
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
31
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
32
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
32
33
|
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; } }
|
|
33
34
|
var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
35
|
+
var _usePreviousState;
|
|
34
36
|
var shouldUseResponsiveToolbar = _ref.shouldUseResponsiveToolbar,
|
|
35
37
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
36
38
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
@@ -77,7 +79,7 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
77
79
|
var activeItems = [].concat((0, _toConsumableArray2.default)(dropdownItems), (0, _toConsumableArray2.default)(singleItems)).filter(function (item) {
|
|
78
80
|
return item.isActive;
|
|
79
81
|
});
|
|
80
|
-
var prevActiveItems = (0,
|
|
82
|
+
var prevActiveItems = (_usePreviousState = (0, _hooks.usePreviousState)(activeItems)) !== null && _usePreviousState !== void 0 ? _usePreviousState : [];
|
|
81
83
|
var fromSuperscriptToSubscript = (0, _utils.isArrayContainsContent)(activeItems, 'Subscript') && (0, _utils.isArrayContainsContent)(prevActiveItems, 'Superscript');
|
|
82
84
|
var fromSubscriptToSuperscript = (0, _utils.isArrayContainsContent)(activeItems, 'Superscript') && (0, _utils.isArrayContainsContent)(prevActiveItems, 'Subscript');
|
|
83
85
|
var comparedItems;
|
|
@@ -18,11 +18,13 @@ var MoreButton = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
18
18
|
isReducedSpacing = _ref.isReducedSpacing,
|
|
19
19
|
isSelected = _ref.isSelected,
|
|
20
20
|
isDisabled = _ref.isDisabled,
|
|
21
|
-
onClick = _ref.onClick
|
|
21
|
+
onClick = _ref.onClick,
|
|
22
|
+
onKeyDown = _ref.onKeyDown;
|
|
22
23
|
return (0, _react2.jsx)(_ToolbarButton.default, {
|
|
23
24
|
disabled: isDisabled,
|
|
24
25
|
selected: isSelected,
|
|
25
26
|
onClick: onClick,
|
|
27
|
+
onKeyDown: onKeyDown,
|
|
26
28
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
27
29
|
title: label,
|
|
28
30
|
iconBefore: (0, _react2.jsx)("div", {
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var _react = require("react");
|
|
6
|
+
exports.nodeLen = exports.markActive = exports.isIgnorable = exports.isBlockNode = exports.isArrayContainsContent = exports.hasCode = exports.domIndex = exports.compareItemsArrays = exports.checkFormattingIsPresent = exports.anyMarkActive = void 0;
|
|
8
7
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
9
8
|
var _clearFormatting = require("./commands/clear-formatting");
|
|
10
9
|
var nodeLen = function nodeLen(node) {
|
|
@@ -126,14 +125,6 @@ var checkFormattingIsPresent = function checkFormattingIsPresent(state) {
|
|
|
126
125
|
return marksArePresent(state) || blockStylingIsPresent(state);
|
|
127
126
|
};
|
|
128
127
|
exports.checkFormattingIsPresent = checkFormattingIsPresent;
|
|
129
|
-
var usePreviousObjectState = function usePreviousObjectState(value) {
|
|
130
|
-
var ref = (0, _react.useRef)([]);
|
|
131
|
-
(0, _react.useEffect)(function () {
|
|
132
|
-
ref.current = value;
|
|
133
|
-
});
|
|
134
|
-
return ref.current;
|
|
135
|
-
};
|
|
136
|
-
exports.usePreviousObjectState = usePreviousObjectState;
|
|
137
128
|
var compareItemsArrays = function compareItemsArrays(items, prevItems) {
|
|
138
129
|
return items && items.filter(function (item) {
|
|
139
130
|
return !prevItems.includes(item);
|
|
@@ -34,6 +34,10 @@ function ToolbarDropdown(props) {
|
|
|
34
34
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
35
35
|
isDropdownOpen = _React$useState2[0],
|
|
36
36
|
setIsDropdownOpen = _React$useState2[1];
|
|
37
|
+
var _React$useState3 = _react2.default.useState(false),
|
|
38
|
+
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
39
|
+
isOpenedByKeyboard = _React$useState4[0],
|
|
40
|
+
setOpenedByKeyboard = _React$useState4[1];
|
|
37
41
|
var labelLists = formatMessage(_messages.messages.lists);
|
|
38
42
|
var onOpenChange = function onOpenChange(attrs) {
|
|
39
43
|
setIsDropdownOpen(attrs.isDropdownOpen);
|
|
@@ -43,6 +47,13 @@ function ToolbarDropdown(props) {
|
|
|
43
47
|
isDropdownOpen: !isDropdownOpen
|
|
44
48
|
});
|
|
45
49
|
};
|
|
50
|
+
var handleOnKeyDown = function handleOnKeyDown(event) {
|
|
51
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
setIsDropdownOpen(!isDropdownOpen);
|
|
54
|
+
setOpenedByKeyboard(true);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
46
57
|
var items = useItems(props);
|
|
47
58
|
var handleOnItemActivated = function handleOnItemActivated(_ref) {
|
|
48
59
|
var item = _ref.item,
|
|
@@ -66,7 +77,13 @@ function ToolbarDropdown(props) {
|
|
|
66
77
|
onOpenChange: onOpenChange,
|
|
67
78
|
fitHeight: 188,
|
|
68
79
|
fitWidth: 175,
|
|
69
|
-
shouldUseDefaultRole: true
|
|
80
|
+
shouldUseDefaultRole: true,
|
|
81
|
+
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
82
|
+
if (isOpenedByKeyboard) {
|
|
83
|
+
setOpenedByKeyboard(false);
|
|
84
|
+
}
|
|
85
|
+
return isOpenedByKeyboard;
|
|
86
|
+
}
|
|
70
87
|
}, (0, _react.jsx)(_ToolbarButton.default, {
|
|
71
88
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
72
89
|
selected: bulletListActive || orderedListActive,
|
|
@@ -75,6 +92,7 @@ function ToolbarDropdown(props) {
|
|
|
75
92
|
"aria-label": labelLists,
|
|
76
93
|
disabled: disabled,
|
|
77
94
|
onClick: handleTriggerClick,
|
|
95
|
+
onKeyDown: handleOnKeyDown,
|
|
78
96
|
title: labelLists,
|
|
79
97
|
iconBefore: (0, _react.jsx)("span", {
|
|
80
98
|
css: _styles.wrapperStyle
|
|
@@ -25,7 +25,7 @@ var _utils = require("./utils");
|
|
|
25
25
|
var _useItemInsert3 = require("./ui/hooks/use-item-insert");
|
|
26
26
|
var _updateSelectedIndex = require("./commands/update-selected-index");
|
|
27
27
|
var _statsModifier = require("./stats-modifier");
|
|
28
|
-
var _analytics = require("
|
|
28
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
29
29
|
/**
|
|
30
30
|
*
|
|
31
31
|
* Revamped typeahead using decorations instead of the `typeAheadQuery` mark
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.InputQuery = void 0;
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _react2 = require("@emotion/react");
|
|
@@ -18,11 +17,25 @@ var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
|
18
17
|
var _AssistiveText = require("./AssistiveText");
|
|
19
18
|
var _messages = require("../messages");
|
|
20
19
|
var _reactIntlNext = require("react-intl-next");
|
|
21
|
-
var
|
|
20
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
23
|
/** @jsx jsx */
|
|
25
24
|
|
|
25
|
+
var querySpan = (0, _react2.css)({
|
|
26
|
+
outline: 'none',
|
|
27
|
+
'& input': {
|
|
28
|
+
width: '5px',
|
|
29
|
+
border: 'none',
|
|
30
|
+
background: 'transparent',
|
|
31
|
+
padding: 0,
|
|
32
|
+
margin: 0,
|
|
33
|
+
// ED-17022 Fixes firefox caret position
|
|
34
|
+
fontSize: '1em',
|
|
35
|
+
height: _editorSharedStyles.blockNodesVerticalMargin,
|
|
36
|
+
caretColor: "var(--ds-text-accent-blue, #0052CC)"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
26
39
|
var isNavigationKey = function isNavigationKey(event) {
|
|
27
40
|
return ['Enter', 'Tab', 'ArrowDown', 'ArrowUp'].includes(event.key);
|
|
28
41
|
};
|
|
@@ -39,10 +52,6 @@ var isUndoRedoShortcut = function isUndoRedoShortcut(event) {
|
|
|
39
52
|
}
|
|
40
53
|
return false;
|
|
41
54
|
};
|
|
42
|
-
var isSelectAllShortcut = function isSelectAllShortcut(event) {
|
|
43
|
-
var key = (0, _w3cKeyname.keyName)(event);
|
|
44
|
-
return (event.ctrlKey || event.metaKey) && key === 'a';
|
|
45
|
-
};
|
|
46
55
|
var getAriaLabel = function getAriaLabel(triggerPrefix, intl) {
|
|
47
56
|
switch (triggerPrefix) {
|
|
48
57
|
case '@':
|
|
@@ -68,29 +77,31 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
68
77
|
onUndoRedo = _ref.onUndoRedo,
|
|
69
78
|
editorView = _ref.editorView,
|
|
70
79
|
items = _ref.items;
|
|
71
|
-
var ref = (0, _react.useRef)(document.createElement('
|
|
72
|
-
var
|
|
73
|
-
var _useState = (0, _react.useState)(
|
|
80
|
+
var ref = (0, _react.useRef)(document.createElement('span'));
|
|
81
|
+
var inputRef = (0, _react.useRef)(null);
|
|
82
|
+
var _useState = (0, _react.useState)(null),
|
|
74
83
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
setQuery(text);
|
|
84
|
+
query = _useState2[0],
|
|
85
|
+
setQuery = _useState2[1];
|
|
86
|
+
var cleanedInputContent = (0, _react.useCallback)(function () {
|
|
87
|
+
var _ref$current;
|
|
88
|
+
var raw = ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.textContent) || '';
|
|
89
|
+
return raw;
|
|
90
|
+
}, []);
|
|
91
|
+
var onKeyUp = (0, _react.useCallback)(function (event) {
|
|
92
|
+
var text = cleanedInputContent();
|
|
85
93
|
onQueryChange(text);
|
|
86
|
-
}, [onQueryChange]);
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
isInFocus =
|
|
90
|
-
setInFocus =
|
|
94
|
+
}, [onQueryChange, cleanedInputContent]);
|
|
95
|
+
var _useState3 = (0, _react.useState)(false),
|
|
96
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
97
|
+
isInFocus = _useState4[0],
|
|
98
|
+
setInFocus = _useState4[1];
|
|
91
99
|
var checkKeyEvent = (0, _react.useCallback)(function (event) {
|
|
100
|
+
var _ref$current2;
|
|
92
101
|
var key = (0, _w3cKeyname.keyName)(event);
|
|
93
|
-
var
|
|
102
|
+
var sel = document.getSelection();
|
|
103
|
+
var raw = ((_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.textContent) || '';
|
|
104
|
+
var text = cleanedInputContent();
|
|
94
105
|
var stopDefault = false;
|
|
95
106
|
var _getPluginState = (0, _utils2.getPluginState)(editorView.state),
|
|
96
107
|
selectedIndex = _getPluginState.selectedIndex;
|
|
@@ -121,7 +132,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
121
132
|
stopDefault = true;
|
|
122
133
|
break;
|
|
123
134
|
case 'Backspace':
|
|
124
|
-
if (
|
|
135
|
+
if (raw.length === 0 || (sel === null || sel === void 0 ? void 0 : sel.anchorOffset) === 0) {
|
|
125
136
|
event.stopPropagation();
|
|
126
137
|
event.preventDefault();
|
|
127
138
|
cancel({
|
|
@@ -160,70 +171,24 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
160
171
|
}
|
|
161
172
|
break;
|
|
162
173
|
}
|
|
163
|
-
if (isSelectAllShortcut(event)) {
|
|
164
|
-
cancel({
|
|
165
|
-
forceFocusOnEditor: true,
|
|
166
|
-
addPrefixTrigger: true,
|
|
167
|
-
text: ref.current.value,
|
|
168
|
-
setSelectionAt: _constants.CloseSelectionOptions.BEFORE_TEXT_INSERTED
|
|
169
|
-
});
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
174
|
var undoRedoType = isUndoRedoShortcut(event);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (!hasReopenQuery && undoRedoType === 'historyUndo' && text.length > 0) {
|
|
176
|
-
setRedoBuffer(function (buffer) {
|
|
177
|
-
return [ref.current.value].concat((0, _toConsumableArray2.default)(buffer));
|
|
178
|
-
});
|
|
179
|
-
var undoValue = text.substring(0, text.length - 1);
|
|
180
|
-
ref.current.value = undoValue;
|
|
181
|
-
sizeSpanRef.current.textContent = undoValue;
|
|
182
|
-
stopDefault = true;
|
|
183
|
-
} else if (undoRedoType === 'historyRedo' && redoBuffer.length > 0) {
|
|
184
|
-
var redoValue = redoBuffer[0];
|
|
185
|
-
ref.current.value = redoValue;
|
|
186
|
-
sizeSpanRef.current.textContent = redoValue;
|
|
187
|
-
setRedoBuffer(function (buffer) {
|
|
188
|
-
return buffer.slice(1);
|
|
189
|
-
});
|
|
190
|
-
stopDefault = true;
|
|
191
|
-
} else {
|
|
192
|
-
stopDefault = onUndoRedo(undoRedoType);
|
|
193
|
-
}
|
|
175
|
+
if (onUndoRedo && undoRedoType && onUndoRedo(undoRedoType)) {
|
|
176
|
+
stopDefault = true;
|
|
194
177
|
}
|
|
195
178
|
if (isNavigationKey(event) || stopDefault) {
|
|
196
179
|
event.stopPropagation();
|
|
197
180
|
event.preventDefault();
|
|
198
181
|
return false;
|
|
199
182
|
}
|
|
200
|
-
}, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, editorView.state
|
|
183
|
+
}, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
201
184
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
202
|
-
var
|
|
185
|
+
var _inputRef$current;
|
|
203
186
|
event.stopPropagation();
|
|
204
187
|
event.preventDefault();
|
|
205
188
|
onQueryFocus();
|
|
206
|
-
(
|
|
189
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
207
190
|
return false;
|
|
208
191
|
}, [onQueryFocus]);
|
|
209
|
-
var queryStyle = (0, _react2.css)({
|
|
210
|
-
'&&': {
|
|
211
|
-
outline: 'none',
|
|
212
|
-
position: 'absolute',
|
|
213
|
-
fontFamily: 'inherit',
|
|
214
|
-
fontSize: 'inherit',
|
|
215
|
-
fontWeight: 'inherit',
|
|
216
|
-
letterSpacing: 'inherit',
|
|
217
|
-
padding: 0,
|
|
218
|
-
height: '100%',
|
|
219
|
-
width: '100%',
|
|
220
|
-
top: 0,
|
|
221
|
-
left: 0,
|
|
222
|
-
background: 'transparent',
|
|
223
|
-
border: 'none',
|
|
224
|
-
color: "".concat("var(--ds-link, ".concat(colors.B400, ")"))
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
192
|
(0, _react.useLayoutEffect)(function () {
|
|
228
193
|
if (!ref.current) {
|
|
229
194
|
return;
|
|
@@ -235,18 +200,18 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
235
200
|
var keyDown = function keyDown(event) {
|
|
236
201
|
var key = (0, _w3cKeyname.keyName)(event);
|
|
237
202
|
if (['ArrowLeft', 'ArrowRight'].includes(key) && document.getSelection && document.getSelection()) {
|
|
238
|
-
var _ref$
|
|
239
|
-
var q = ((_ref$
|
|
240
|
-
var
|
|
241
|
-
var isMovingRight = 'ArrowRight' === key && anchorOffset === q.length;
|
|
242
|
-
var isMovingLeft = 'ArrowLeft' === key && (anchorOffset === 0 || event.metaKey);
|
|
203
|
+
var _ref$current3;
|
|
204
|
+
var q = ((_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.textContent) || '';
|
|
205
|
+
var sel = document.getSelection();
|
|
206
|
+
var isMovingRight = sel && 'ArrowRight' === key && sel.anchorOffset === q.length;
|
|
207
|
+
var isMovingLeft = sel && 'ArrowLeft' === key && (sel.anchorOffset === 0 || event.metaKey);
|
|
243
208
|
if (!isMovingRight && !isMovingLeft) {
|
|
244
209
|
return;
|
|
245
210
|
}
|
|
246
211
|
cancel({
|
|
247
212
|
forceFocusOnEditor: true,
|
|
248
213
|
addPrefixTrigger: true,
|
|
249
|
-
text:
|
|
214
|
+
text: cleanedInputContent(),
|
|
250
215
|
setSelectionAt: isMovingRight ? _constants.CloseSelectionOptions.AFTER_TEXT_INSERTED : _constants.CloseSelectionOptions.BEFORE_TEXT_INSERTED
|
|
251
216
|
});
|
|
252
217
|
event.preventDefault();
|
|
@@ -277,8 +242,8 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
277
242
|
}
|
|
278
243
|
cancel({
|
|
279
244
|
addPrefixTrigger: true,
|
|
280
|
-
text:
|
|
281
|
-
setSelectionAt: _constants.CloseSelectionOptions.
|
|
245
|
+
text: cleanedInputContent(),
|
|
246
|
+
setSelectionAt: _constants.CloseSelectionOptions.BEFORE_TEXT_INSERTED,
|
|
282
247
|
forceFocusOnEditor: false
|
|
283
248
|
});
|
|
284
249
|
};
|
|
@@ -294,7 +259,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
294
259
|
var _target$textContent;
|
|
295
260
|
setInFocus(false);
|
|
296
261
|
var target = e.target;
|
|
297
|
-
if (e.isComposing || !(target instanceof
|
|
262
|
+
if (e.isComposing || !(target instanceof HTMLElement)) {
|
|
298
263
|
return;
|
|
299
264
|
}
|
|
300
265
|
if (e.inputType === 'historyUndo' && ((_target$textContent = target.textContent) === null || _target$textContent === void 0 ? void 0 : _target$textContent.length) === 0) {
|
|
@@ -303,6 +268,23 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
303
268
|
close();
|
|
304
269
|
return;
|
|
305
270
|
}
|
|
271
|
+
if (e.data != null && inputRef.current === null) {
|
|
272
|
+
setQuery('');
|
|
273
|
+
|
|
274
|
+
// We need to change the content on Safari
|
|
275
|
+
// and set the cursor at the right place
|
|
276
|
+
if (_utils.browser.safari) {
|
|
277
|
+
e.preventDefault();
|
|
278
|
+
var dataElement = document.createTextNode(e.data);
|
|
279
|
+
element.appendChild(dataElement);
|
|
280
|
+
var sel = window.getSelection();
|
|
281
|
+
var range = document.createRange();
|
|
282
|
+
range.setStart(dataElement, dataElement.length);
|
|
283
|
+
range.collapse(true);
|
|
284
|
+
sel === null || sel === void 0 ? void 0 : sel.removeAllRanges();
|
|
285
|
+
sel === null || sel === void 0 ? void 0 : sel.addRange(range);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
306
288
|
};
|
|
307
289
|
var onInput = null;
|
|
308
290
|
if (_utils.browser.safari) {
|
|
@@ -312,7 +294,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
312
294
|
var _onInput = function _onInput(e) {
|
|
313
295
|
var _target$textContent2;
|
|
314
296
|
var target = e.target;
|
|
315
|
-
if (e.isComposing || !(target instanceof
|
|
297
|
+
if (e.isComposing || !(target instanceof HTMLElement)) {
|
|
316
298
|
return;
|
|
317
299
|
}
|
|
318
300
|
if (e.inputType === 'historyUndo' && ((_target$textContent2 = target.textContent) === null || _target$textContent2 === void 0 ? void 0 : _target$textContent2.length) === 1) {
|
|
@@ -337,12 +319,11 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
337
319
|
element.removeEventListener('input', onInput);
|
|
338
320
|
}
|
|
339
321
|
};
|
|
340
|
-
}, [triggerQueryPrefix,
|
|
322
|
+
}, [triggerQueryPrefix, cleanedInputContent, onQueryFocus, cancel, checkKeyEvent, editorView.state]);
|
|
341
323
|
(0, _react.useLayoutEffect)(function () {
|
|
342
324
|
var hasReopenQuery = typeof reopenQuery === 'string' && reopenQuery.trim().length > 0;
|
|
343
325
|
if (ref.current && forceFocus) {
|
|
344
|
-
|
|
345
|
-
sizeSpanRef.current.textContent = hasReopenQuery ? reopenQuery : '';
|
|
326
|
+
setQuery(hasReopenQuery ? reopenQuery : null);
|
|
346
327
|
requestAnimationFrame(function () {
|
|
347
328
|
if (!(ref !== null && ref !== void 0 && ref.current)) {
|
|
348
329
|
return;
|
|
@@ -370,20 +351,10 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
370
351
|
Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
|
|
371
352
|
*/
|
|
372
353
|
return (0, _react2.jsx)(_react.Fragment, null, triggerQueryPrefix, (0, _react2.jsx)("span", {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
}, (0, _react2.jsx)("span", {
|
|
377
|
-
ref: sizeSpanRef,
|
|
378
|
-
"aria-hidden": true,
|
|
379
|
-
style: {
|
|
380
|
-
marginLeft: '1px',
|
|
381
|
-
visibility: 'hidden'
|
|
382
|
-
}
|
|
383
|
-
}), (0, _react2.jsx)("input", {
|
|
384
|
-
css: queryStyle,
|
|
354
|
+
css: querySpan,
|
|
355
|
+
contentEditable: true,
|
|
385
356
|
ref: ref,
|
|
386
|
-
|
|
357
|
+
onKeyUp: onKeyUp,
|
|
387
358
|
onClick: onClick,
|
|
388
359
|
role: "combobox",
|
|
389
360
|
"aria-controls": _constants.TYPE_AHEAD_DECORATION_ELEMENT_ID,
|
|
@@ -391,9 +362,11 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
391
362
|
"aria-expanded": items.length !== 0,
|
|
392
363
|
"aria-labelledby": assistiveHintID,
|
|
393
364
|
suppressContentEditableWarning: true,
|
|
394
|
-
"data-query-prefix": triggerQueryPrefix
|
|
395
|
-
|
|
396
|
-
|
|
365
|
+
"data-query-prefix": triggerQueryPrefix
|
|
366
|
+
}, query === null ? (0, _react2.jsx)("input", {
|
|
367
|
+
ref: inputRef,
|
|
368
|
+
type: "text"
|
|
369
|
+
}) : query), (0, _react2.jsx)("span", {
|
|
397
370
|
id: assistiveHintID,
|
|
398
371
|
style: {
|
|
399
372
|
display: 'none'
|
|
@@ -56,6 +56,7 @@ var ChromeCollapsed = /*#__PURE__*/function (_PureComponent) {
|
|
|
56
56
|
value: function render() {
|
|
57
57
|
var placeholder = this.props.text || this.props.intl.formatMessage(_messages.messages.chromeCollapsedPlaceholder);
|
|
58
58
|
return (0, _react2.jsx)("input", {
|
|
59
|
+
"data-testid": "chrome-collapsed",
|
|
59
60
|
css: _styles.inputStyle,
|
|
60
61
|
ref: this.handleInputRef,
|
|
61
62
|
onFocus: this.focusHandler,
|
|
@@ -15,6 +15,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _editor = _interopRequireDefault(require("../../editor"));
|
|
18
|
+
var _editorNext = _interopRequireDefault(require("../../editor-next"));
|
|
19
|
+
var _editorMigrationComponent = _interopRequireDefault(require("../../editor-next/editor-migration-component"));
|
|
18
20
|
var _EditorWithActions = _interopRequireDefault(require("../../labs/EditorWithActions"));
|
|
19
21
|
var _ChromeCollapsed = _interopRequireDefault(require("../ChromeCollapsed"));
|
|
20
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -38,28 +40,20 @@ var CollapsedEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
38
40
|
return _this;
|
|
39
41
|
}
|
|
40
42
|
(0, _createClass2.default)(CollapsedEditor, [{
|
|
41
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
42
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
43
|
-
if (!this.props.isExpanded && nextProps.isExpanded) {
|
|
44
|
-
this.shouldTriggerExpandEvent = true;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
43
|
key: "componentDidUpdate",
|
|
49
44
|
value: function componentDidUpdate() {
|
|
50
|
-
if (this.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.props.onExpand();
|
|
54
|
-
}
|
|
45
|
+
if (this.props.isExpanded && this.editorComponent && (!this.previouslyExpanded || this.previouslyExpanded === undefined)) {
|
|
46
|
+
var _this$props$onExpand, _this$props;
|
|
47
|
+
(_this$props$onExpand = (_this$props = this.props).onExpand) === null || _this$props$onExpand === void 0 ? void 0 : _this$props$onExpand.call(_this$props);
|
|
55
48
|
}
|
|
49
|
+
this.previouslyExpanded = this.props.isExpanded;
|
|
56
50
|
}
|
|
57
51
|
}, {
|
|
58
52
|
key: "render",
|
|
59
53
|
value: function render() {
|
|
60
54
|
var _this2 = this;
|
|
61
55
|
var child = _react.default.Children.only(this.props.children);
|
|
62
|
-
if (child.type !== _editor.default && child.type !== _EditorWithActions.default) {
|
|
56
|
+
if (child.type !== _editor.default && child.type !== _EditorWithActions.default && child.type !== _editorNext.default && child.type !== _editorMigrationComponent.default) {
|
|
63
57
|
throw new Error('Expected child to be of type `Editor`');
|
|
64
58
|
}
|
|
65
59
|
if (!this.props.isExpanded) {
|