@atlaskit/editor-core 180.0.0 → 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 +74 -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 +23 -22
- 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
|
@@ -5,9 +5,12 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
8
|
+
import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
9
|
+
import { getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
|
|
8
10
|
import Button from '@atlaskit/button';
|
|
9
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
-
import { N60A } from '@atlaskit/theme/colors';
|
|
12
|
+
import { DN50, N0, N60A } from '@atlaskit/theme/colors';
|
|
13
|
+
import { themed } from '@atlaskit/theme/components';
|
|
11
14
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
12
15
|
import ColorPalette from '../ColorPalette';
|
|
13
16
|
import { DEFAULT_BORDER_COLOR } from '../ColorPalette/Palettes/common';
|
|
@@ -20,7 +23,12 @@ var colorPickerButtonWrapper = css(_templateObject || (_templateObject = _tagged
|
|
|
20
23
|
// Control the size of color picker buttons and preview
|
|
21
24
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4134
|
|
22
25
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
23
|
-
var colorPickerWrapper =
|
|
26
|
+
var colorPickerWrapper = function colorPickerWrapper(theme) {
|
|
27
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n background-color: ", ";\n box-shadow: 0 4px 8px -2px ", ", 0 0 1px ", ";\n padding: 8px 0px;\n"])), borderRadius(), themed({
|
|
28
|
+
light: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
29
|
+
dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
|
|
30
|
+
})(theme), N60A, N60A);
|
|
31
|
+
};
|
|
24
32
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
25
33
|
|
|
26
34
|
var ColorPickerButton = function ColorPickerButton(props) {
|
|
@@ -30,8 +38,20 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
30
38
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
31
39
|
isPopupOpen = _React$useState2[0],
|
|
32
40
|
setIsPopupOpen = _React$useState2[1];
|
|
41
|
+
var _React$useState3 = React.useState(false),
|
|
42
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
43
|
+
isPopupPositioned = _React$useState4[0],
|
|
44
|
+
setIsPopupPositioned = _React$useState4[1];
|
|
45
|
+
var _React$useState5 = React.useState(false),
|
|
46
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
47
|
+
isOpenedByKeyboard = _React$useState6[0],
|
|
48
|
+
setIsOpenedByKeyboard = _React$useState6[1];
|
|
33
49
|
var togglePopup = function togglePopup() {
|
|
34
50
|
setIsPopupOpen(!isPopupOpen);
|
|
51
|
+
if (!isPopupOpen) {
|
|
52
|
+
setIsOpenedByKeyboard(false);
|
|
53
|
+
setIsPopupPositioned(false);
|
|
54
|
+
}
|
|
35
55
|
};
|
|
36
56
|
React.useEffect(function () {
|
|
37
57
|
if (props.setDisableParentScroll) {
|
|
@@ -39,9 +59,25 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
39
59
|
}
|
|
40
60
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
61
|
}, [isPopupOpen]);
|
|
62
|
+
var focusButton = function focusButton() {
|
|
63
|
+
var _buttonRef$current;
|
|
64
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
65
|
+
};
|
|
66
|
+
var handleEsc = React.useCallback(function () {
|
|
67
|
+
setIsOpenedByKeyboard(false);
|
|
68
|
+
setIsPopupPositioned(false);
|
|
69
|
+
setIsPopupOpen(false);
|
|
70
|
+
focusButton();
|
|
71
|
+
}, []);
|
|
72
|
+
var onPositionCalculated = React.useCallback(function (position) {
|
|
73
|
+
setIsPopupPositioned(true);
|
|
74
|
+
return position;
|
|
75
|
+
}, []);
|
|
42
76
|
var ColorPaletteWithListeners = withOuterListeners(ColorPalette);
|
|
43
77
|
var onColorSelected = function onColorSelected(color, label) {
|
|
78
|
+
setIsOpenedByKeyboard(false);
|
|
44
79
|
setIsPopupOpen(false);
|
|
80
|
+
setIsPopupPositioned(false);
|
|
45
81
|
if (props.onChange) {
|
|
46
82
|
if (props.createAnalyticsEvent) {
|
|
47
83
|
// fire analytics
|
|
@@ -63,11 +99,16 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
63
99
|
});
|
|
64
100
|
newPalette && props.onChange(newPalette);
|
|
65
101
|
}
|
|
102
|
+
focusButton();
|
|
66
103
|
};
|
|
67
104
|
var renderPopup = function renderPopup() {
|
|
68
105
|
if (!isPopupOpen || !buttonRef.current) {
|
|
69
106
|
return;
|
|
70
107
|
}
|
|
108
|
+
var selectedColor = props.currentColor || null;
|
|
109
|
+
var _getSelectedRowAndCol = getSelectedRowAndColumnFromPalette(props.colorPalette, selectedColor, props.cols),
|
|
110
|
+
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
111
|
+
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
71
112
|
return jsx(Popup, {
|
|
72
113
|
target: buttonRef.current,
|
|
73
114
|
fitHeight: 350,
|
|
@@ -80,20 +121,34 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
80
121
|
// we need an index of > 500 to display over it
|
|
81
122
|
,
|
|
82
123
|
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
83
|
-
ariaLabel: "Color picker popup"
|
|
124
|
+
ariaLabel: "Color picker popup",
|
|
125
|
+
onPositionCalculated: onPositionCalculated
|
|
84
126
|
}, jsx("div", {
|
|
85
127
|
css: colorPickerWrapper,
|
|
86
128
|
"data-test-id": "color-picker-menu"
|
|
129
|
+
}, jsx(ArrowKeyNavigationProvider, {
|
|
130
|
+
type: ArrowKeyNavigationType.COLOR,
|
|
131
|
+
selectedRowIndex: selectedRowIndex,
|
|
132
|
+
selectedColumnIndex: selectedColumnIndex,
|
|
133
|
+
closeOnTab: true,
|
|
134
|
+
handleClose: function handleClose() {
|
|
135
|
+
return setIsPopupOpen(false);
|
|
136
|
+
},
|
|
137
|
+
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
138
|
+
isPopupPositioned: isPopupPositioned
|
|
87
139
|
}, jsx(ColorPaletteWithListeners, {
|
|
88
140
|
palette: props.colorPalette,
|
|
89
141
|
cols: props.cols,
|
|
90
|
-
selectedColor:
|
|
142
|
+
selectedColor: selectedColor,
|
|
91
143
|
onClick: onColorSelected,
|
|
92
|
-
handleClickOutside: togglePopup
|
|
93
|
-
|
|
144
|
+
handleClickOutside: togglePopup,
|
|
145
|
+
handleEscapeKeydown: handleEsc,
|
|
146
|
+
hexToPaletteColor: props.hexToPaletteColor
|
|
147
|
+
}))));
|
|
94
148
|
};
|
|
95
149
|
var title = props.title || '';
|
|
96
|
-
var
|
|
150
|
+
var currentColor = props.currentColor && props.hexToPaletteColor ? props.hexToPaletteColor(props.currentColor) : props.currentColor;
|
|
151
|
+
var buttonStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 6px;\n background-color: ", ";\n &:before {\n display: flex;\n justify-content: center;\n align-items: center;\n align-self: center;\n content: '';\n border: 1px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n padding: 0;\n }\n "])), "var(--ds-background-neutral, transparent)", DEFAULT_BORDER_COLOR, borderRadius(), currentColor || 'transparent', ((_props$size = props.size) === null || _props$size === void 0 ? void 0 : _props$size.width) || 14, ((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.height) || 14);
|
|
97
152
|
return jsx("div", {
|
|
98
153
|
css: colorPickerButtonWrapper
|
|
99
154
|
}, jsx(Tooltip, {
|
|
@@ -104,6 +159,13 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
104
159
|
"aria-label": title,
|
|
105
160
|
spacing: "compact",
|
|
106
161
|
onClick: togglePopup,
|
|
162
|
+
onKeyDown: function onKeyDown(event) {
|
|
163
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
togglePopup();
|
|
166
|
+
setIsOpenedByKeyboard(true);
|
|
167
|
+
}
|
|
168
|
+
},
|
|
107
169
|
css: buttonStyle
|
|
108
170
|
})), renderPopup());
|
|
109
171
|
};
|
|
@@ -17,7 +17,7 @@ import Form from '@atlaskit/form';
|
|
|
17
17
|
import { isTabGroup } from '@atlaskit/editor-common/extensions';
|
|
18
18
|
import _isEqual from 'lodash/isEqual';
|
|
19
19
|
import _mergeRecursive from 'lodash/merge';
|
|
20
|
-
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from '
|
|
20
|
+
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from '@atlaskit/editor-common/analytics';
|
|
21
21
|
import LoadingState from './LoadingState';
|
|
22
22
|
import Header from './Header';
|
|
23
23
|
import ErrorMessage from './ErrorMessage';
|
|
@@ -24,14 +24,12 @@ import React from 'react';
|
|
|
24
24
|
// able to position and add margins to handle certain elements like inline comment dialogues overlapping the context
|
|
25
25
|
// panel
|
|
26
26
|
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Provider = _React$createContext.Provider,
|
|
34
|
-
Consumer = _React$createContext.Consumer;
|
|
27
|
+
export var ContextPanel = /*#__PURE__*/React.createContext({
|
|
28
|
+
width: 0,
|
|
29
|
+
positionedOverEditor: false,
|
|
30
|
+
broadcastWidth: function broadcastWidth() {},
|
|
31
|
+
broadcastPosition: function broadcastPosition() {}
|
|
32
|
+
});
|
|
35
33
|
export var ContextPanelWidthProvider = /*#__PURE__*/function (_React$Component) {
|
|
36
34
|
_inherits(ContextPanelWidthProvider, _React$Component);
|
|
37
35
|
var _super = _createSuper(ContextPanelWidthProvider);
|
|
@@ -77,4 +75,6 @@ export var ContextPanelWidthProvider = /*#__PURE__*/function (_React$Component)
|
|
|
77
75
|
}]);
|
|
78
76
|
return ContextPanelWidthProvider;
|
|
79
77
|
}(React.Component);
|
|
78
|
+
var Provider = ContextPanel.Provider,
|
|
79
|
+
Consumer = ContextPanel.Consumer;
|
|
80
80
|
export { Provider as ContextPanelProvider, Consumer as ContextPanelConsumer };
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2
5
|
import { Dropdown as DropdownComponent } from '@atlaskit/editor-common/ui-menu';
|
|
3
6
|
import React, { useContext } from 'react';
|
|
4
7
|
import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
|
|
5
8
|
var Dropdown = /*#__PURE__*/React.memo(function (_ref) {
|
|
6
9
|
var props = _extends({}, _ref);
|
|
7
|
-
var
|
|
10
|
+
var keyDownHandlerContext = useContext(KeyDownHandlerContext);
|
|
8
11
|
return (
|
|
9
12
|
/*#__PURE__*/
|
|
10
13
|
//This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
11
14
|
//Default context has the void callbacks for above key events
|
|
12
15
|
React.createElement(DropdownComponent, _extends({
|
|
13
|
-
|
|
16
|
+
arrowKeyNavigationProviderOptions: _objectSpread(_objectSpread({}, props.arrowKeyNavigationProviderOptions), {}, {
|
|
17
|
+
keyDownHandlerContext: keyDownHandlerContext
|
|
18
|
+
})
|
|
14
19
|
}, props))
|
|
15
20
|
);
|
|
16
21
|
});
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2
5
|
import { DropdownMenu as DropdownComponent } from '@atlaskit/editor-common/ui-menu';
|
|
3
6
|
import React, { useContext } from 'react';
|
|
4
7
|
import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
|
|
5
8
|
var DropdownMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
6
9
|
var props = _extends({}, _ref);
|
|
7
|
-
var
|
|
10
|
+
var keyDownHandlerContext = useContext(KeyDownHandlerContext);
|
|
8
11
|
//This context is to handle the tab, Arrow Right/Left key events for dropdown.
|
|
9
12
|
//Default context has the void callbacks for above key events
|
|
10
13
|
return /*#__PURE__*/React.createElement(DropdownComponent, _extends({
|
|
11
|
-
|
|
14
|
+
arrowKeyNavigationProviderOptions: _objectSpread(_objectSpread({}, props.arrowKeyNavigationProviderOptions), {}, {
|
|
15
|
+
keyDownHandlerContext: keyDownHandlerContext
|
|
16
|
+
})
|
|
12
17
|
}, props));
|
|
13
18
|
});
|
|
14
19
|
export default DropdownMenu;
|
|
@@ -16,7 +16,7 @@ import Button from '@atlaskit/button/custom-theme-button';
|
|
|
16
16
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
17
17
|
import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE } from '../constants';
|
|
18
18
|
import useFocus from '../hooks/use-focus';
|
|
19
|
-
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, ACTION } from '
|
|
19
|
+
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, ACTION } from '@atlaskit/editor-common/analytics';
|
|
20
20
|
function CategoryList(_ref) {
|
|
21
21
|
var _ref$categories = _ref.categories,
|
|
22
22
|
categories = _ref$categories === void 0 ? [] : _ref$categories,
|
|
@@ -14,7 +14,7 @@ import { B100, N200 } from '@atlaskit/theme/colors';
|
|
|
14
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
15
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
17
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '
|
|
17
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
18
18
|
import IconFallback from '../../../../plugins/quick-insert/assets/fallback';
|
|
19
19
|
import { itemIcon } from '../../../../plugins/type-ahead/ui/TypeAheadListItem';
|
|
20
20
|
import { shortcutStyle } from '../../../styles';
|
|
@@ -7,7 +7,7 @@ import React, { memo, useState, useCallback, useEffect } from 'react';
|
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
9
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
|
-
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from '
|
|
10
|
+
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import ElementList from './ElementList/ElementList';
|
|
12
12
|
import CategoryList from './CategoryList';
|
|
13
13
|
import ElementSearch from './ElementSearch';
|
|
@@ -86,11 +86,11 @@ var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
86
86
|
return _this;
|
|
87
87
|
}
|
|
88
88
|
_createClass(PanelTextInput, [{
|
|
89
|
-
key: "
|
|
90
|
-
value: function
|
|
91
|
-
if (
|
|
89
|
+
key: "componentDidUpdate",
|
|
90
|
+
value: function componentDidUpdate(prevProps) {
|
|
91
|
+
if (prevProps.defaultValue !== this.props.defaultValue) {
|
|
92
92
|
this.setState({
|
|
93
|
-
value:
|
|
93
|
+
value: this.props.defaultValue
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -14,7 +14,7 @@ import { createPortal, unstable_renderSubtreeIntoContainer, unmountComponentAtNo
|
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
15
|
import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
|
|
16
16
|
import { EventDispatcher } from '../../event-dispatcher';
|
|
17
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '
|
|
17
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
18
18
|
import { useIntl, RawIntlProvider, injectIntl } from 'react-intl-next';
|
|
19
19
|
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
20
20
|
import { PortalProviderThemeProviders } from './PortalProviderThemesProvider';
|
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useEffect, useContext, useState } from 'react';
|
|
3
3
|
import { pluginKey as widthPluginKey } from '../../plugins/width';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
var WidthEmitter = function WidthEmitter(
|
|
22
|
-
var editorView =
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setContainerWidth = _React$useState4[1];
|
|
31
|
-
var _useCreateWidthCallba = useCreateWidthCallbacks({
|
|
32
|
-
setContextPanelWidth: setContextPanelWidth,
|
|
33
|
-
setContainerWidth: setContainerWidth
|
|
34
|
-
}),
|
|
35
|
-
_useCreateWidthCallba2 = _slicedToArray(_useCreateWidthCallba, 2),
|
|
36
|
-
contextPanelWidthCallback = _useCreateWidthCallba2[0],
|
|
37
|
-
containerWidthCallback = _useCreateWidthCallba2[1];
|
|
38
|
-
React.useEffect(function () {
|
|
4
|
+
import { WidthContext } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import { ContextPanel } from '../ContextPanel/context';
|
|
6
|
+
// Why do we need this? Why not just use the width from the context directly rather than this?
|
|
7
|
+
// Well my friend - some of the VR tests break, seemingly due to the fact that existing behaviour
|
|
8
|
+
// assumes the initial value is 0, the width from context may not start from 0 however.
|
|
9
|
+
// We should investigate further if we can remove this entirely but for now we'll do this
|
|
10
|
+
// awkward workaround to keep the behaviour consistent.
|
|
11
|
+
var useListener = function useListener(contextValue) {
|
|
12
|
+
var _useState = useState(0),
|
|
13
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14
|
+
value = _useState2[0],
|
|
15
|
+
setValue = _useState2[1];
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
setValue(contextValue);
|
|
18
|
+
}, [contextValue]);
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
var WidthEmitter = function WidthEmitter(_ref) {
|
|
22
|
+
var editorView = _ref.editorView;
|
|
23
|
+
var _useContext = useContext(ContextPanel),
|
|
24
|
+
contextPanelWidthContext = _useContext.width;
|
|
25
|
+
var _useContext2 = useContext(WidthContext),
|
|
26
|
+
containerWidthContext = _useContext2.width;
|
|
27
|
+
var containerWidth = useListener(containerWidthContext);
|
|
28
|
+
var contextPanelWidth = useListener(contextPanelWidthContext);
|
|
29
|
+
useEffect(function () {
|
|
39
30
|
var width = containerWidth - contextPanelWidth;
|
|
40
31
|
if (width <= 0 || isNaN(width) || !editorView) {
|
|
41
32
|
return;
|
|
@@ -51,6 +42,6 @@ var WidthEmitter = function WidthEmitter(_ref4) {
|
|
|
51
42
|
dispatch(tr);
|
|
52
43
|
return function () {};
|
|
53
44
|
}, [editorView, contextPanelWidth, containerWidth]);
|
|
54
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null
|
|
45
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
55
46
|
};
|
|
56
47
|
export default WidthEmitter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { Node } from 'prosemirror-model';
|
|
2
|
+
import { Node, Fragment } from 'prosemirror-model';
|
|
3
3
|
import { transformMediaLinkMarks, transformTextLinkCodeMarks, transformDedupeMarks, transformNodesMissingContent, transformIndentationMarks, transformInvalidMediaContent } from '@atlaskit/adf-utils/transforms';
|
|
4
4
|
import { sanitizeNodeForPrivacy } from '../utils/filter/privacy-filter';
|
|
5
5
|
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
@@ -107,6 +107,20 @@ export function bracketTyped(state) {
|
|
|
107
107
|
}
|
|
108
108
|
return false;
|
|
109
109
|
}
|
|
110
|
+
export function processRawFragmentValue(schema, value, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent) {
|
|
111
|
+
if (!value) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
var adfEntities = value.map(function (item) {
|
|
115
|
+
return processRawValue(schema, item, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent);
|
|
116
|
+
}).filter(function (item) {
|
|
117
|
+
return Boolean(item);
|
|
118
|
+
});
|
|
119
|
+
if (adfEntities.length === 0) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
return Fragment.from(adfEntities);
|
|
123
|
+
}
|
|
110
124
|
export function processRawValue(schema, value, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent) {
|
|
111
125
|
if (!value) {
|
|
112
126
|
return;
|
|
@@ -4,9 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import Loadable from 'react-loadable';
|
|
5
5
|
import { getQuickInsertItemsFromModule, resolveImport } from '@atlaskit/editor-common/extensions';
|
|
6
6
|
import { combineProviders } from '@atlaskit/editor-common/provider-helpers';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '
|
|
8
|
-
import { fireAnalyticsEvent } from '../plugins/analytics';
|
|
9
|
-
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
10
8
|
/**
|
|
11
9
|
* Utils to send analytics event when a extension is inserted using quickInsert
|
|
12
10
|
*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { createEditorSelectionAPI } from '../selection-api/api';
|
|
3
|
+
import createPluginsList from '../create-editor/create-plugins-list';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Retrieve the editor props using createPluginList default behaviour.
|
|
8
|
+
*
|
|
9
|
+
* @param GetEditorPlugins props used to initialise the plugins
|
|
10
|
+
* @returns list of editor plugins
|
|
11
|
+
*/
|
|
12
|
+
var getEditorPlugins = function getEditorPlugins(_ref) {
|
|
13
|
+
var _props$dangerouslyApp, _props$dangerouslyApp2;
|
|
14
|
+
var props = _ref.props,
|
|
15
|
+
prevAppearance = _ref.prevAppearance,
|
|
16
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
17
|
+
insertNodeAPI = _ref.insertNodeAPI,
|
|
18
|
+
editorAnalyticsAPI = _ref.editorAnalyticsAPI;
|
|
19
|
+
var dangerouslyAppendedPlugins = (_props$dangerouslyApp = (_props$dangerouslyApp2 = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp2 === void 0 ? void 0 : _props$dangerouslyApp2.__plugins) !== null && _props$dangerouslyApp !== void 0 ? _props$dangerouslyApp : [];
|
|
20
|
+
var selectionAPI = createEditorSelectionAPI();
|
|
21
|
+
return [].concat(_toConsumableArray(createPluginsList(props, {
|
|
22
|
+
appearance: prevAppearance
|
|
23
|
+
}, createAnalyticsEvent, insertNodeAPI, editorAnalyticsAPI, selectionAPI)), _toConsumableArray(dangerouslyAppendedPlugins));
|
|
24
|
+
};
|
|
25
|
+
export default getEditorPlugins;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID, INPUT_METHOD } from '
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
export var buildEditLinkPayload = function buildEditLinkPayload(type) {
|
|
3
3
|
return {
|
|
4
4
|
action: ACTION.CLICKED,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
3
|
import { useComponentRenderTracking } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import { EVENT_TYPE } from '
|
|
4
|
+
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
export function RenderTracking(props) {
|
|
6
6
|
var debouncedHandleAnalyticsEvent = useMemo(function () {
|
|
7
7
|
return debounce(props.handleAnalyticsEvent, 500);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
export var UNSAFE_PROPERTY_SET_ERROR = 'Setting an unsafe property on transaction after dispatch!';
|
|
3
3
|
|
|
4
4
|
// since selection uses curSelection under the hood, we guard setSelection instead
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { combineExtensionProviders } from '@atlaskit/editor-common/extensions';
|
|
2
|
+
import memoizeOne from 'memoize-one';
|
|
3
|
+
function prepareExtensionProvidersInternal(editorActions, extensionProviders) {
|
|
4
|
+
if (!extensionProviders) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
if (typeof extensionProviders === 'function') {
|
|
8
|
+
return combineExtensionProviders(extensionProviders(editorActions));
|
|
9
|
+
}
|
|
10
|
+
return combineExtensionProviders(extensionProviders);
|
|
11
|
+
}
|
|
12
|
+
var prepareExtensionProvider = function prepareExtensionProvider(getEditorActions) {
|
|
13
|
+
return memoizeOne(function (extensionProviders) {
|
|
14
|
+
return prepareExtensionProvidersInternal(getEditorActions(), extensionProviders);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export default prepareExtensionProvider;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node } from 'prosemirror-model';
|
|
2
|
-
import { EditorActionsOptions, ContextUpdateHandler } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { EditorActionsOptions, ContextUpdateHandler, ReplaceRawValue } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import { EventDispatcher } from '../event-dispatcher';
|
|
5
5
|
import { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
|
|
@@ -34,7 +34,7 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
34
34
|
replaceDocument(rawValue: any, shouldScrollToBottom?: boolean,
|
|
35
35
|
/** @deprecated [ED-14158] shouldAddToHistory is not being used in this function */
|
|
36
36
|
shouldAddToHistory?: boolean): boolean;
|
|
37
|
-
replaceSelection(rawValue:
|
|
37
|
+
replaceSelection(rawValue: ReplaceRawValue | Array<ReplaceRawValue>, tryToReplace?: boolean): boolean;
|
|
38
38
|
appendText(text: string): boolean;
|
|
39
39
|
dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void;
|
|
40
40
|
/**
|
|
@@ -1,113 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
7
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
8
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
|
-
import { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
10
|
-
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
11
|
-
import { Transformer } from '@atlaskit/editor-common/types';
|
|
12
|
-
import { Dispatch, EventDispatcher } from '../event-dispatcher';
|
|
13
|
-
import { AnalyticsEventPayload, DispatchAnalyticsEvent, FULL_WIDTH_MODE } from '../plugins/analytics';
|
|
14
|
-
import { EditorAppearance, EditorConfig, EditorReactContext, EditorPlugin, EditorProps } from '../types';
|
|
15
|
-
import { PortalProviderAPI } from '../ui/PortalProvider';
|
|
16
|
-
import { SEVERITY } from '@atlaskit/editor-common/utils';
|
|
17
|
-
import { TransactionTracker } from '../utils/performance/track-transactions';
|
|
18
|
-
import { FireAnalyticsCallback } from '../plugins/analytics/fire-analytics-event';
|
|
19
|
-
export interface EditorViewProps {
|
|
20
|
-
editorProps: EditorProps;
|
|
21
|
-
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
22
|
-
providerFactory: ProviderFactory;
|
|
23
|
-
portalProviderAPI: PortalProviderAPI;
|
|
24
|
-
allowAnalyticsGASV3?: boolean;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
experienceStore?: ExperienceStore;
|
|
27
|
-
render?: (props: {
|
|
28
|
-
editor: JSX.Element;
|
|
29
|
-
view?: EditorView;
|
|
30
|
-
config: EditorConfig;
|
|
31
|
-
eventDispatcher: EventDispatcher;
|
|
32
|
-
transformer?: Transformer<string>;
|
|
33
|
-
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
34
|
-
editorRef: React.RefObject<HTMLDivElement>;
|
|
35
|
-
}) => JSX.Element;
|
|
36
|
-
onEditorCreated: (instance: {
|
|
37
|
-
view: EditorView;
|
|
38
|
-
config: EditorConfig;
|
|
39
|
-
eventDispatcher: EventDispatcher;
|
|
40
|
-
transformer?: Transformer<string>;
|
|
41
|
-
}) => void;
|
|
42
|
-
onEditorDestroyed: (instance: {
|
|
43
|
-
view: EditorView;
|
|
44
|
-
config: EditorConfig;
|
|
45
|
-
eventDispatcher: EventDispatcher;
|
|
46
|
-
transformer?: Transformer<string>;
|
|
47
|
-
}) => void;
|
|
48
|
-
}
|
|
49
|
-
export declare function shouldReconfigureState(props: EditorProps, nextProps: EditorProps): boolean;
|
|
50
|
-
interface CreateEditorStateOptions {
|
|
51
|
-
props: EditorViewProps;
|
|
52
|
-
context: EditorReactContext;
|
|
53
|
-
doc?: string | Object | PMNode;
|
|
54
|
-
resetting?: boolean;
|
|
55
|
-
selectionAtStart?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export declare class ReactEditorView<T = {}> extends React.Component<EditorViewProps & WrappedComponentProps & T, {}, EditorReactContext> {
|
|
58
|
-
view?: EditorView;
|
|
59
|
-
eventDispatcher: EventDispatcher;
|
|
60
|
-
contentTransformer?: Transformer<string>;
|
|
61
|
-
config: EditorConfig;
|
|
62
|
-
editorState: EditorState;
|
|
63
|
-
errorReporter: ErrorReporter;
|
|
64
|
-
dispatch: Dispatch;
|
|
65
|
-
proseMirrorRenderedSeverity?: SEVERITY;
|
|
66
|
-
transactionTracker: TransactionTracker;
|
|
67
|
-
validTransactionCount: number;
|
|
68
|
-
experienceStore?: ExperienceStore;
|
|
69
|
-
editorRef: React.RefObject<HTMLDivElement>;
|
|
70
|
-
static contextTypes: {
|
|
71
|
-
getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactEditorView as BaseReactEditorView } from './ReactEditorViewInternal';
|
|
3
|
+
export declare class ReactEditorView<T = {}> extends BaseReactEditorView<T> {
|
|
4
|
+
static defaultProps: {
|
|
5
|
+
getEditorPlugins: import("../types/get-editor-props").GetEditorPlugins;
|
|
72
6
|
};
|
|
73
|
-
private canDispatchTransactions;
|
|
74
|
-
private focusTimeoutId?;
|
|
75
|
-
private reliabilityInterval?;
|
|
76
|
-
private pluginPerformanceObserver;
|
|
77
|
-
private featureFlags;
|
|
78
|
-
private onPluginObservation;
|
|
79
|
-
get transactionTracking(): import("../types/performance-tracking").TransactionTracking;
|
|
80
|
-
private getPluginNames;
|
|
81
|
-
private countNodes;
|
|
82
|
-
constructor(props: EditorViewProps & WrappedComponentProps & T, context: EditorReactContext);
|
|
83
|
-
UNSAFE_componentWillReceiveProps(nextProps: EditorViewProps): void;
|
|
84
|
-
formatFullWidthAppearance: (appearance: EditorAppearance | undefined) => FULL_WIDTH_MODE;
|
|
85
|
-
resetEditorState: ({ doc, shouldScrollToBottom, }: {
|
|
86
|
-
doc: string;
|
|
87
|
-
shouldScrollToBottom: boolean;
|
|
88
|
-
}) => void;
|
|
89
|
-
blur: () => void;
|
|
90
|
-
reconfigureState: (props: EditorViewProps) => void;
|
|
91
|
-
handleAnalyticsEvent: FireAnalyticsCallback;
|
|
92
|
-
componentDidMount(): void;
|
|
93
|
-
/**
|
|
94
|
-
* Clean up any non-PM resources when the editor is unmounted
|
|
95
|
-
*/
|
|
96
|
-
componentWillUnmount(): void;
|
|
97
|
-
private editorPlugins;
|
|
98
|
-
getPlugins(editorProps: EditorProps, prevEditorProps?: EditorProps, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPlugin[];
|
|
99
|
-
createEditorState: (options: CreateEditorStateOptions) => EditorState<any>;
|
|
100
|
-
private onEditorViewStateUpdated;
|
|
101
|
-
private trackValidTransactions;
|
|
102
|
-
private dispatchTransaction;
|
|
103
|
-
getDirectEditorProps: (state?: EditorState<any> | undefined) => DirectEditorProps;
|
|
104
|
-
private createEditorView;
|
|
105
|
-
handleEditorViewRef: (node: HTMLDivElement) => void;
|
|
106
|
-
dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void;
|
|
107
|
-
private editor;
|
|
108
|
-
render(): JSX.Element;
|
|
109
7
|
}
|
|
110
|
-
declare const _default:
|
|
111
|
-
WrappedComponent:
|
|
8
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<import("./ReactEditorViewInternal").EditorViewProps & import("react-intl-next").WrappedComponentProps<"intl">>> & {
|
|
9
|
+
WrappedComponent: import("react").ComponentType<import("./ReactEditorViewInternal").EditorViewProps & import("react-intl-next").WrappedComponentProps<"intl">>;
|
|
112
10
|
};
|
|
113
11
|
export default _default;
|