@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
|
@@ -99,11 +99,14 @@ export class BlockCard extends ReactNodeView {
|
|
|
99
99
|
return domRef;
|
|
100
100
|
}
|
|
101
101
|
render() {
|
|
102
|
+
const {
|
|
103
|
+
platform
|
|
104
|
+
} = this.reactComponentProps;
|
|
102
105
|
return /*#__PURE__*/React.createElement(WrappedBlockCard, {
|
|
103
106
|
node: this.node,
|
|
104
107
|
view: this.view,
|
|
105
108
|
getPos: this.getPos,
|
|
106
|
-
platform:
|
|
109
|
+
platform: platform
|
|
107
110
|
});
|
|
108
111
|
}
|
|
109
112
|
}
|
|
@@ -5,6 +5,9 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
6
6
|
import { titleUrlPairFromNode } from '../utils';
|
|
7
7
|
import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
|
|
8
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
9
|
+
import { getPluginState } from '../pm-plugins/util/state';
|
|
10
|
+
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
8
11
|
export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
9
12
|
var _class;
|
|
10
13
|
return _class = class extends React.Component {
|
|
@@ -15,6 +18,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
15
18
|
});
|
|
16
19
|
}
|
|
17
20
|
render() {
|
|
21
|
+
var _getPluginState;
|
|
18
22
|
const {
|
|
19
23
|
url
|
|
20
24
|
} = titleUrlPairFromNode(this.props.node);
|
|
@@ -34,10 +38,20 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
const cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
|
|
37
|
-
|
|
41
|
+
const editorAppearance = (_getPluginState = getPluginState(this.props.view.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.editorAppearance;
|
|
42
|
+
const analyticsEditorAppearance = getAnalyticsEditorAppearance(editorAppearance);
|
|
43
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
44
|
+
data: {
|
|
45
|
+
attributes: {
|
|
46
|
+
location: analyticsEditorAppearance
|
|
47
|
+
},
|
|
48
|
+
// Below is added for the future implementation of Linking Platform namespaced analytics context
|
|
49
|
+
location: analyticsEditorAppearance
|
|
50
|
+
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
38
52
|
key: url,
|
|
39
53
|
cardContext: cardContext
|
|
40
|
-
}, this.props));
|
|
54
|
+
}, this.props)));
|
|
41
55
|
}
|
|
42
56
|
componentDidCatch(error) {
|
|
43
57
|
const maybeAPIError = error;
|
|
@@ -11,6 +11,7 @@ import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './
|
|
|
11
11
|
export { pluginKey } from './plugin-key';
|
|
12
12
|
export const createPlugin = options => pmPluginFactoryParams => {
|
|
13
13
|
const {
|
|
14
|
+
editorAppearance,
|
|
14
15
|
platform,
|
|
15
16
|
allowResizing,
|
|
16
17
|
useAlternativePreloader,
|
|
@@ -26,7 +27,8 @@ export const createPlugin = options => pmPluginFactoryParams => {
|
|
|
26
27
|
cards: [],
|
|
27
28
|
showLinkingToolbar: false,
|
|
28
29
|
smartLinkEvents: undefined,
|
|
29
|
-
createAnalyticsEvent
|
|
30
|
+
createAnalyticsEvent,
|
|
31
|
+
editorAppearance
|
|
30
32
|
};
|
|
31
33
|
},
|
|
32
34
|
apply(tr, pluginState) {
|
|
@@ -73,8 +73,10 @@ export const createClipboardSerializer = (schema, getEditorView) => {
|
|
|
73
73
|
const parentTable = findParentNodeOfType(schema.nodes.table)(selection);
|
|
74
74
|
const attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
|
|
75
75
|
const newTable = schema.nodes.table;
|
|
76
|
+
// Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
|
|
76
77
|
const newTableNode = newTable.createChecked({
|
|
77
|
-
...attributes
|
|
78
|
+
...attributes,
|
|
79
|
+
localId: undefined
|
|
78
80
|
}, content);
|
|
79
81
|
const newContent = Fragment.from(newTableNode);
|
|
80
82
|
// Pass updated content into original ProseMirror serializeFragment function.
|
|
@@ -3,8 +3,7 @@ import { initialize } from './events/initialize';
|
|
|
3
3
|
import { PluginState } from './plugin-state';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
5
|
import { addSynchronyErrorAnalytics } from './analytics';
|
|
6
|
-
import { fireAnalyticsEvent } from '
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
6
|
+
import { fireAnalyticsEvent, ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
7
|
export { PluginState, pluginKey };
|
|
9
8
|
export const createPlugin = (dispatch, providerFactory, collabProviderCallback, options) => {
|
|
10
9
|
const fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
@@ -24,6 +24,11 @@ export const messages = defineMessages({
|
|
|
24
24
|
defaultMessage: 'Delete element',
|
|
25
25
|
description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
|
|
26
26
|
},
|
|
27
|
+
unnamedSource: {
|
|
28
|
+
id: 'fabric.editor.extension.sourceNoTitledName',
|
|
29
|
+
defaultMessage: 'this element',
|
|
30
|
+
description: 'The current element without preset name been selected'
|
|
31
|
+
},
|
|
27
32
|
confirmDeleteLinkedModalOKButton: {
|
|
28
33
|
id: 'fabric.editor.extension.confirmDeleteLinkedModalOKButton',
|
|
29
34
|
defaultMessage: 'Delete',
|
|
@@ -129,11 +134,12 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
|
|
|
129
134
|
let confirmDialog;
|
|
130
135
|
if (isReferencedSource(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)) {
|
|
131
136
|
confirmDialog = () => {
|
|
137
|
+
const localSourceName = formatMessage(messages.unnamedSource);
|
|
132
138
|
return {
|
|
133
139
|
title: formatMessage(messages.deleteElementTitle),
|
|
134
140
|
okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
|
|
135
141
|
message: formatMessage(messages.confirmDeleteLinkedModalMessage, {
|
|
136
|
-
nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
|
|
142
|
+
nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node) || localSourceName
|
|
137
143
|
}),
|
|
138
144
|
isReferentialityDialog: true,
|
|
139
145
|
getChildrenInfo: () => getChildrenInfo(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node),
|
|
@@ -12,6 +12,7 @@ import FindReplace from './FindReplace';
|
|
|
12
12
|
import { TRIGGER_METHOD } from '../../analytics/types';
|
|
13
13
|
import { ToolTipContent, findKeymapByDescription, tooltip } from '../../../keymaps';
|
|
14
14
|
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
15
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
15
16
|
const toolbarButtonWrapper = css`
|
|
16
17
|
display: flex;
|
|
17
18
|
flex: 1 1 auto;
|
|
@@ -86,7 +87,10 @@ class FindReplaceToolbarButton extends React.PureComponent {
|
|
|
86
87
|
},
|
|
87
88
|
fitWidth: 352,
|
|
88
89
|
zIndex: stackBelowOtherEditorFloatingPanels,
|
|
89
|
-
|
|
90
|
+
arrowKeyNavigationProviderOptions: {
|
|
91
|
+
type: ArrowKeyNavigationType.MENU,
|
|
92
|
+
disableArrowKeyNavigation: true
|
|
93
|
+
},
|
|
90
94
|
trigger: jsx(ToolbarButton, {
|
|
91
95
|
buttonId: TOOLBAR_BUTTON.FIND_REPLACE,
|
|
92
96
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -7,6 +7,7 @@ export default (({
|
|
|
7
7
|
icon,
|
|
8
8
|
iconAfter,
|
|
9
9
|
onClick,
|
|
10
|
+
onKeyDown,
|
|
10
11
|
onMouseEnter,
|
|
11
12
|
onMouseLeave,
|
|
12
13
|
onFocus,
|
|
@@ -64,6 +65,7 @@ export default (({
|
|
|
64
65
|
iconBefore: icon || undefined,
|
|
65
66
|
iconAfter: iconAfter,
|
|
66
67
|
onClick: onClick,
|
|
68
|
+
onKeyDown: onKeyDown,
|
|
67
69
|
isSelected: selected,
|
|
68
70
|
isDisabled: disabled,
|
|
69
71
|
testId: testId,
|
|
@@ -5,6 +5,7 @@ import { Checkbox } from '@atlaskit/checkbox';
|
|
|
5
5
|
import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
6
6
|
import messages from './messages';
|
|
7
7
|
export const CheckboxModal = props => {
|
|
8
|
+
var _options$getChildrenI;
|
|
8
9
|
const [isChecked, setCheckbox] = useState(false);
|
|
9
10
|
const {
|
|
10
11
|
onConfirm,
|
|
@@ -19,10 +20,11 @@ export const CheckboxModal = props => {
|
|
|
19
20
|
const okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
20
21
|
const cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
21
22
|
const checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
23
|
+
const childrenInfo = options === null || options === void 0 ? void 0 : (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
|
|
22
24
|
const ListComponent = ({
|
|
23
25
|
nodes
|
|
24
26
|
}) => {
|
|
25
|
-
if (
|
|
27
|
+
if (nodes.length === 0) {
|
|
26
28
|
return null;
|
|
27
29
|
}
|
|
28
30
|
return /*#__PURE__*/React.createElement("ul", null, nodes.map(node => /*#__PURE__*/React.createElement(ListItem, _extends({}, node, {
|
|
@@ -47,8 +49,8 @@ export const CheckboxModal = props => {
|
|
|
47
49
|
testId: testId
|
|
48
50
|
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
49
51
|
appearance: "warning"
|
|
50
|
-
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (
|
|
51
|
-
nodes:
|
|
52
|
+
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), !!(childrenInfo !== null && childrenInfo !== void 0 && childrenInfo.length) && /*#__PURE__*/React.createElement(ListComponent, {
|
|
53
|
+
nodes: childrenInfo
|
|
52
54
|
}), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
53
55
|
isChecked: isChecked,
|
|
54
56
|
onChange: () => setCheckbox(!isChecked),
|
|
@@ -25,8 +25,10 @@ export default class Dropdown extends Component {
|
|
|
25
25
|
constructor(...args) {
|
|
26
26
|
super(...args);
|
|
27
27
|
_defineProperty(this, "state", {
|
|
28
|
-
isOpen: false
|
|
28
|
+
isOpen: false,
|
|
29
|
+
isOpenedByKeyboard: false
|
|
29
30
|
});
|
|
31
|
+
_defineProperty(this, "triggerRef", /*#__PURE__*/React.createRef());
|
|
30
32
|
_defineProperty(this, "renderArrayOptions", options => {
|
|
31
33
|
const {
|
|
32
34
|
showSelected,
|
|
@@ -43,15 +45,26 @@ export default class Dropdown extends Component {
|
|
|
43
45
|
});
|
|
44
46
|
_defineProperty(this, "toggleOpen", () => {
|
|
45
47
|
this.setState({
|
|
46
|
-
isOpen: !this.state.isOpen
|
|
48
|
+
isOpen: !this.state.isOpen,
|
|
49
|
+
isOpenedByKeyboard: false
|
|
47
50
|
});
|
|
48
51
|
});
|
|
52
|
+
_defineProperty(this, "toggleOpenByKeyboard", event => {
|
|
53
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
this.setState({
|
|
56
|
+
isOpen: !this.state.isOpen,
|
|
57
|
+
isOpenedByKeyboard: true
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
49
61
|
_defineProperty(this, "hide", () => {
|
|
50
62
|
this.setState({
|
|
63
|
+
...this.state,
|
|
51
64
|
isOpen: false
|
|
52
65
|
});
|
|
53
66
|
});
|
|
54
|
-
_defineProperty(this, "
|
|
67
|
+
_defineProperty(this, "hideOnEsc", () => {
|
|
55
68
|
var _document$querySelect;
|
|
56
69
|
this.hide();
|
|
57
70
|
//Focus the trigger button only on Escape
|
|
@@ -60,7 +73,7 @@ export default class Dropdown extends Component {
|
|
|
60
73
|
_defineProperty(this, "onOpenChanged", openChangedEvent => {
|
|
61
74
|
if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
|
|
62
75
|
var _openChangedEvent$eve;
|
|
63
|
-
((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? this.
|
|
76
|
+
((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? this.hideOnEsc() : this.hide();
|
|
64
77
|
}
|
|
65
78
|
});
|
|
66
79
|
}
|
|
@@ -93,6 +106,7 @@ export default class Dropdown extends Component {
|
|
|
93
106
|
title: title,
|
|
94
107
|
icon: TriggerIcon,
|
|
95
108
|
onClick: this.toggleOpen,
|
|
109
|
+
onKeyDown: this.toggleOpenByKeyboard,
|
|
96
110
|
selected: isOpen,
|
|
97
111
|
disabled: disabled,
|
|
98
112
|
tooltipContent: tooltip
|
|
@@ -106,6 +120,7 @@ export default class Dropdown extends Component {
|
|
|
106
120
|
label: "Expand dropdown menu"
|
|
107
121
|
})),
|
|
108
122
|
onClick: this.toggleOpen,
|
|
123
|
+
onKeyDown: this.toggleOpenByKeyboard,
|
|
109
124
|
selected: isOpen,
|
|
110
125
|
disabled: disabled,
|
|
111
126
|
tooltipContent: tooltip
|
|
@@ -120,12 +135,13 @@ export default class Dropdown extends Component {
|
|
|
120
135
|
const fitWidth = Array.isArray(options) ? dropdownWidth || menuItemDimensions.width : options.width;
|
|
121
136
|
const fitHeight = Array.isArray(options) ? options.length * menuItemDimensions.height + itemSpacing * 2 : options.height;
|
|
122
137
|
return jsx(UiDropdown, {
|
|
138
|
+
ref: this.triggerRef,
|
|
123
139
|
mountTo: mountPoint,
|
|
124
140
|
boundariesElement: boundariesElement,
|
|
125
141
|
scrollableElement: scrollableElement,
|
|
126
142
|
isOpen: isOpen,
|
|
127
143
|
handleClickOutside: this.hide,
|
|
128
|
-
handleEscapeKeydown: this.
|
|
144
|
+
handleEscapeKeydown: this.hideOnEsc,
|
|
129
145
|
onOpenChange: this.onOpenChanged,
|
|
130
146
|
fitWidth: fitWidth + fitTolerance,
|
|
131
147
|
fitHeight: fitHeight + fitTolerance,
|
|
@@ -137,8 +153,20 @@ export default class Dropdown extends Component {
|
|
|
137
153
|
}));
|
|
138
154
|
}
|
|
139
155
|
componentDidUpdate(prevProps, prevState) {
|
|
140
|
-
if (
|
|
141
|
-
this.props.setDisableParentScroll
|
|
156
|
+
if (prevState.isOpen !== this.state.isOpen) {
|
|
157
|
+
if (this.props.setDisableParentScroll) {
|
|
158
|
+
this.props.setDisableParentScroll(this.state.isOpen);
|
|
159
|
+
}
|
|
160
|
+
if (this.state.isOpen && this.state.isOpenedByKeyboard) {
|
|
161
|
+
const dropList = document.querySelector('[data-role="droplistContent"]');
|
|
162
|
+
if (dropList) {
|
|
163
|
+
const keyboardEvent = new KeyboardEvent('keydown', {
|
|
164
|
+
bubbles: true,
|
|
165
|
+
key: 'ArrowDown'
|
|
166
|
+
});
|
|
167
|
+
dropList.dispatchEvent(keyboardEvent);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
142
170
|
}
|
|
143
171
|
}
|
|
144
172
|
}
|
|
@@ -23,10 +23,10 @@ const ExtensionButton = props => {
|
|
|
23
23
|
node,
|
|
24
24
|
editorView
|
|
25
25
|
} = props;
|
|
26
|
-
const ButtonIcon = item.icon ? Loadable({
|
|
26
|
+
const ButtonIcon = React.useMemo(() => item.icon ? Loadable({
|
|
27
27
|
loader: async () => resolveExtensionIcon(item.icon),
|
|
28
28
|
loading: noop
|
|
29
|
-
}) : undefined;
|
|
29
|
+
}) : undefined, [item.icon]);
|
|
30
30
|
const onClick = () => {
|
|
31
31
|
if (typeof item.action !== 'function') {
|
|
32
32
|
throw new Error(`'action' of context toolbar item '${item.key}' is not a function`);
|
|
@@ -83,19 +83,14 @@ export default (({
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
useEffect(() => {
|
|
86
|
-
const scrollContainerRefCurrent = scrollContainerRef.current;
|
|
87
86
|
onScroll();
|
|
87
|
+
const scrollContainerRefCurrent = scrollContainerRef.current;
|
|
88
88
|
if (scrollContainerRefCurrent) {
|
|
89
89
|
// enable/disable scroll buttons depending on scroll position
|
|
90
90
|
scrollContainerRefCurrent.addEventListener('scroll', onScroll);
|
|
91
91
|
|
|
92
92
|
// watch for toolbar resize and show/hide scroll buttons if needed
|
|
93
93
|
resizeObserver.observe(scrollContainerRefCurrent);
|
|
94
|
-
|
|
95
|
-
// reset scroll position when switching from one node with toolbar to another
|
|
96
|
-
scrollContainerRefCurrent.scrollTo({
|
|
97
|
-
left: 0
|
|
98
|
-
});
|
|
99
94
|
}
|
|
100
95
|
return () => {
|
|
101
96
|
if (scrollContainerRefCurrent) {
|
|
@@ -104,7 +99,17 @@ export default (({
|
|
|
104
99
|
}
|
|
105
100
|
};
|
|
106
101
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
-
}, [
|
|
102
|
+
}, []);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
const scrollContainerRefCurrent = scrollContainerRef.current;
|
|
105
|
+
if (scrollContainerRefCurrent) {
|
|
106
|
+
// reset scroll position when switching from one node with toolbar to another
|
|
107
|
+
scrollContainerRefCurrent.scrollTo({
|
|
108
|
+
left: 0
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
112
|
+
}, [node.type]);
|
|
108
113
|
return needScroll ? jsx("div", {
|
|
109
114
|
ref: buttonsContainerRef,
|
|
110
115
|
css: toolbarScrollButtons,
|
|
@@ -5,6 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { Component } from 'react';
|
|
7
7
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
8
|
+
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
8
9
|
import { themed } from '@atlaskit/theme/components';
|
|
9
10
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
10
11
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
@@ -149,6 +150,15 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
149
150
|
placement: "Panels",
|
|
150
151
|
mountPoint: emojiAndColourPickerMountPoint,
|
|
151
152
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined
|
|
153
|
+
// Currently in floating toolbar, color picker is only
|
|
154
|
+
// used in panel and table cell background color.
|
|
155
|
+
// Both uses same color palette.
|
|
156
|
+
// That's why hard-coding hexToEditorBackgroundPaletteColor.
|
|
157
|
+
// When we need to support different color palette
|
|
158
|
+
// in floating toolbar, we need to set hexToPaletteColor
|
|
159
|
+
// in item options.
|
|
160
|
+
,
|
|
161
|
+
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
152
162
|
});
|
|
153
163
|
}
|
|
154
164
|
if (item.selectType === 'emoji') {
|
|
@@ -418,6 +428,7 @@ class Toolbar extends Component {
|
|
|
418
428
|
text: intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
419
429
|
delay: 250
|
|
420
430
|
}), jsx("div", {
|
|
431
|
+
"data-testid": "floating-toolbar-items",
|
|
421
432
|
ref: this.scrollContainerRef,
|
|
422
433
|
css: toolbarOverflow(scrollable, this.state.scrollDisabled, firstElementIsSelect)
|
|
423
434
|
}, jsx(ToolbarItems, _extends({}, this.props, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics/types';
|
|
2
2
|
import { getLinkDomain, isFromCurrentDomain } from './utils';
|
|
3
3
|
export function getLinkCreationAnalyticsEvent(inputMethod, url) {
|
|
4
4
|
return {
|
|
@@ -26,7 +26,7 @@ const hyperlinkPlugin = options => ({
|
|
|
26
26
|
name: 'hyperlink',
|
|
27
27
|
plugin: ({
|
|
28
28
|
dispatch
|
|
29
|
-
}) => plugin(dispatch)
|
|
29
|
+
}) => plugin(dispatch, options === null || options === void 0 ? void 0 : options.editorAppearance)
|
|
30
30
|
}, {
|
|
31
31
|
name: 'fakeCursorToolbarPlugin',
|
|
32
32
|
plugin: () => fakeCursorToolbarPlugin
|
|
@@ -186,7 +186,7 @@ const getActiveText = selection => {
|
|
|
186
186
|
return;
|
|
187
187
|
};
|
|
188
188
|
export const stateKey = new PluginKey('hyperlinkPlugin');
|
|
189
|
-
export const plugin = dispatch => new SafePlugin({
|
|
189
|
+
export const plugin = (dispatch, editorAppearance) => new SafePlugin({
|
|
190
190
|
state: {
|
|
191
191
|
init(_, state) {
|
|
192
192
|
const canInsertLink = canLinkBeCreatedInRange(state.selection.from, state.selection.to)(state);
|
|
@@ -194,7 +194,8 @@ export const plugin = dispatch => new SafePlugin({
|
|
|
194
194
|
activeText: getActiveText(state.selection),
|
|
195
195
|
canInsertLink,
|
|
196
196
|
timesViewed: 0,
|
|
197
|
-
activeLinkMark: toState(undefined, LinkAction.SELECTION_CHANGE, state)
|
|
197
|
+
activeLinkMark: toState(undefined, LinkAction.SELECTION_CHANGE, state),
|
|
198
|
+
editorAppearance
|
|
198
199
|
};
|
|
199
200
|
},
|
|
200
201
|
apply(tr, pluginState, oldState, newState) {
|
|
@@ -207,7 +208,8 @@ export const plugin = dispatch => new SafePlugin({
|
|
|
207
208
|
canInsertLink: canLinkBeCreatedInRange(newState.selection.from, newState.selection.to)(newState),
|
|
208
209
|
timesViewed: state.timesViewed,
|
|
209
210
|
inputMethod,
|
|
210
|
-
activeLinkMark: mapTransactionToState(state.activeLinkMark, tr)
|
|
211
|
+
activeLinkMark: mapTransactionToState(state.activeLinkMark, tr),
|
|
212
|
+
editorAppearance
|
|
211
213
|
};
|
|
212
214
|
}
|
|
213
215
|
if (action) {
|
|
@@ -223,6 +225,7 @@ export const plugin = dispatch => new SafePlugin({
|
|
|
223
225
|
canInsertLink: state.canInsertLink,
|
|
224
226
|
inputMethod,
|
|
225
227
|
activeLinkMark: toState(state.activeLinkMark, action, newState),
|
|
228
|
+
editorAppearance,
|
|
226
229
|
...stateForAnalytics
|
|
227
230
|
};
|
|
228
231
|
}
|
|
@@ -234,7 +237,8 @@ export const plugin = dispatch => new SafePlugin({
|
|
|
234
237
|
activeLinkMark: toState(state.activeLinkMark, LinkAction.SELECTION_CHANGE, newState),
|
|
235
238
|
timesViewed: state.timesViewed,
|
|
236
239
|
searchSessionId: state.searchSessionId,
|
|
237
|
-
inputMethod
|
|
240
|
+
inputMethod,
|
|
241
|
+
editorAppearance
|
|
238
242
|
};
|
|
239
243
|
}
|
|
240
244
|
if (!shallowEqual(state, pluginState)) {
|
|
@@ -5,6 +5,7 @@ import { hideLinkToolbar as cardHideLinkToolbar } from '../../../card/pm-plugins
|
|
|
5
5
|
import { hideLinkToolbar } from '../../commands';
|
|
6
6
|
import { useEscapeClickaway } from './useEscapeClickaway';
|
|
7
7
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
8
|
+
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Returns a type that matches T but where keys (K) are now optional
|
|
@@ -14,6 +15,7 @@ export const EditorLinkPicker = ({
|
|
|
14
15
|
view,
|
|
15
16
|
onCancel,
|
|
16
17
|
invokeMethod = '_unknown',
|
|
18
|
+
editorAppearance,
|
|
17
19
|
...restProps
|
|
18
20
|
}) => {
|
|
19
21
|
const onEscape = useCallback(() => {
|
|
@@ -26,11 +28,15 @@ export const EditorLinkPicker = ({
|
|
|
26
28
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
27
29
|
}, [view, onCancel]);
|
|
28
30
|
const ref = useEscapeClickaway(onEscape, onClickAway);
|
|
31
|
+
const analyticsEditorAppearance = getAnalyticsEditorAppearance(editorAppearance);
|
|
29
32
|
const analyticsData = useMemo(() => ({
|
|
30
33
|
attributes: {
|
|
31
|
-
invokeMethod
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
invokeMethod,
|
|
35
|
+
location: analyticsEditorAppearance
|
|
36
|
+
},
|
|
37
|
+
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
38
|
+
location: analyticsEditorAppearance
|
|
39
|
+
}), [invokeMethod, analyticsEditorAppearance]);
|
|
34
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
41
|
ref: ref
|
|
36
42
|
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
@@ -16,7 +16,7 @@ import { linkToolbarMessages as linkToolbarCommonMessages } from '../../../../me
|
|
|
16
16
|
import PanelTextInput from '../../../../ui/PanelTextInput';
|
|
17
17
|
import LinkSearchList from '../../../../ui/LinkSearch/LinkSearchList';
|
|
18
18
|
import { container, containerWithProvider, inputWrapper } from '../../../../ui/LinkSearch/ToolbarComponents';
|
|
19
|
-
import { INPUT_METHOD, fireAnalyticsEvent, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '
|
|
19
|
+
import { INPUT_METHOD, fireAnalyticsEvent, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
20
20
|
import { normalizeUrl } from '../../utils';
|
|
21
21
|
import { filterUniqueItems } from '../../../../utils/array';
|
|
22
22
|
import debounce from 'lodash/debounce';
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import HyperlinkAddToolbarComp from './HyperlinkAddToolbar';
|
|
5
|
-
import { INPUT_METHOD } from '../../../analytics';
|
|
5
|
+
import { INPUT_METHOD } from '../../../analytics/types';
|
|
6
6
|
import { stateKey as pluginKey } from '../../pm-plugins/main';
|
|
7
7
|
import WithPluginState from '../../../../ui/WithPluginState';
|
|
8
8
|
import { getFeatureFlags } from '../../../feature-flags-context';
|
|
@@ -53,7 +53,8 @@ export default class HyperlinkAddToolbar extends React.PureComponent {
|
|
|
53
53
|
view: view,
|
|
54
54
|
invokeMethod: // Provide `invokeMethod` prop as preferred value (card plugin passes as prop) otherwise assume this
|
|
55
55
|
// is being used from inside the hyperlink plugin and use inputMethod from plugin state
|
|
56
|
-
invokeMethod !== null && invokeMethod !== void 0 ? invokeMethod : hyperlinkPluginState === null || hyperlinkPluginState === void 0 ? void 0 : hyperlinkPluginState.inputMethod
|
|
56
|
+
invokeMethod !== null && invokeMethod !== void 0 ? invokeMethod : hyperlinkPluginState === null || hyperlinkPluginState === void 0 ? void 0 : hyperlinkPluginState.inputMethod,
|
|
57
|
+
editorAppearance: hyperlinkPluginState === null || hyperlinkPluginState === void 0 ? void 0 : hyperlinkPluginState.editorAppearance
|
|
57
58
|
}, linkPickerOptions, {
|
|
58
59
|
url: displayUrl,
|
|
59
60
|
displayText: displayText,
|
|
@@ -14,6 +14,7 @@ export const BlockInsertMenu = props => {
|
|
|
14
14
|
selected: props.open,
|
|
15
15
|
disabled: props.disabled,
|
|
16
16
|
onClick: props.onClick,
|
|
17
|
+
onKeyDown: props.onKeyDown,
|
|
17
18
|
spacing: props.spacing,
|
|
18
19
|
label: props.label,
|
|
19
20
|
"aria-keyshortcuts": "/"
|
|
@@ -26,6 +27,7 @@ export const BlockInsertMenu = props => {
|
|
|
26
27
|
items: props.items,
|
|
27
28
|
label: props.label,
|
|
28
29
|
onClick: props.onClick,
|
|
30
|
+
onKeyDown: props.onKeyDown,
|
|
29
31
|
onInsert: props.onInsert,
|
|
30
32
|
onRef: props.onPlusButtonRef,
|
|
31
33
|
open: props.open,
|
|
@@ -43,6 +45,7 @@ export const BlockInsertMenu = props => {
|
|
|
43
45
|
items: props.items,
|
|
44
46
|
label: props.label,
|
|
45
47
|
onClick: props.onClick,
|
|
48
|
+
onKeyDown: props.onKeyDown,
|
|
46
49
|
onItemActivated: props.onItemActivated,
|
|
47
50
|
onOpenChange: props.onOpenChange,
|
|
48
51
|
onRef: props.onRef,
|
|
@@ -21,6 +21,7 @@ export const DropDownButton = /*#__PURE__*/React.memo(props => jsx(ToolbarButton
|
|
|
21
21
|
selected: props.selected,
|
|
22
22
|
disabled: props.disabled,
|
|
23
23
|
onClick: props.onClick,
|
|
24
|
+
onKeyDown: props.onKeyDown,
|
|
24
25
|
spacing: props.spacing,
|
|
25
26
|
"aria-expanded": props['aria-expanded'],
|
|
26
27
|
"aria-haspopup": props['aria-haspopup'],
|
|
@@ -37,6 +37,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
37
37
|
_defineProperty(this, "state", {
|
|
38
38
|
isPlusMenuOpen: false,
|
|
39
39
|
emojiPickerOpen: false,
|
|
40
|
+
isOpenedByKeyboard: false,
|
|
40
41
|
buttons: [],
|
|
41
42
|
dropdownItems: []
|
|
42
43
|
});
|
|
@@ -141,6 +142,16 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
141
142
|
_defineProperty(this, "handleClick", () => {
|
|
142
143
|
this.togglePlusMenuVisibility();
|
|
143
144
|
});
|
|
145
|
+
_defineProperty(this, "handleOpenByKeyboard", event => {
|
|
146
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
147
|
+
this.setState({
|
|
148
|
+
...this.state,
|
|
149
|
+
isOpenedByKeyboard: true
|
|
150
|
+
});
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
this.togglePlusMenuVisibility();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
144
155
|
_defineProperty(this, "toggleLinkPanel", inputMethod => {
|
|
145
156
|
const {
|
|
146
157
|
editorView
|
|
@@ -418,6 +429,18 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
418
429
|
emojiPickerOpen: false
|
|
419
430
|
});
|
|
420
431
|
}
|
|
432
|
+
if (this.state.isOpenedByKeyboard) {
|
|
433
|
+
var _this$dropdownButtonR;
|
|
434
|
+
const downArrowEvent = new KeyboardEvent('keydown', {
|
|
435
|
+
bubbles: true,
|
|
436
|
+
key: 'ArrowDown'
|
|
437
|
+
});
|
|
438
|
+
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 ? void 0 : _this$dropdownButtonR.dispatchEvent(downArrowEvent);
|
|
439
|
+
this.setState({
|
|
440
|
+
...this.state,
|
|
441
|
+
isOpenedByKeyboard: false
|
|
442
|
+
});
|
|
443
|
+
}
|
|
421
444
|
}
|
|
422
445
|
renderPopup() {
|
|
423
446
|
const {
|
|
@@ -501,6 +524,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
501
524
|
onRef: this.handleDropDownButtonRef,
|
|
502
525
|
onPlusButtonRef: this.handlePlusButtonRef,
|
|
503
526
|
onClick: this.handleClick,
|
|
527
|
+
onKeyDown: this.handleOpenByKeyboard,
|
|
504
528
|
onItemActivated: this.insertInsertMenuItem,
|
|
505
529
|
onInsert: this.insertInsertMenuItem,
|
|
506
530
|
onOpenChange: this.onOpenChange,
|