@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
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { EditorState } from 'prosemirror-state';
|
|
4
|
+
import { DirectEditorProps, EditorView } from 'prosemirror-view';
|
|
5
|
+
import { Node as PMNode } from 'prosemirror-model';
|
|
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 '@atlaskit/editor-common/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 type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
19
|
+
import { GetEditorPlugins } from '../types/get-editor-props';
|
|
20
|
+
export interface EditorViewProps {
|
|
21
|
+
editorProps: EditorProps;
|
|
22
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
23
|
+
providerFactory: ProviderFactory;
|
|
24
|
+
portalProviderAPI: PortalProviderAPI;
|
|
25
|
+
getEditorPlugins?: GetEditorPlugins;
|
|
26
|
+
allowAnalyticsGASV3?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
experienceStore?: ExperienceStore;
|
|
29
|
+
render?: (props: {
|
|
30
|
+
editor: JSX.Element;
|
|
31
|
+
view?: EditorView;
|
|
32
|
+
config: EditorConfig;
|
|
33
|
+
eventDispatcher: EventDispatcher;
|
|
34
|
+
transformer?: Transformer<string>;
|
|
35
|
+
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
36
|
+
editorRef: React.RefObject<HTMLDivElement>;
|
|
37
|
+
}) => JSX.Element;
|
|
38
|
+
onEditorCreated: (instance: {
|
|
39
|
+
view: EditorView;
|
|
40
|
+
config: EditorConfig;
|
|
41
|
+
eventDispatcher: EventDispatcher;
|
|
42
|
+
transformer?: Transformer<string>;
|
|
43
|
+
}) => void;
|
|
44
|
+
onEditorDestroyed: (instance: {
|
|
45
|
+
view: EditorView;
|
|
46
|
+
config: EditorConfig;
|
|
47
|
+
eventDispatcher: EventDispatcher;
|
|
48
|
+
transformer?: Transformer<string>;
|
|
49
|
+
}) => void;
|
|
50
|
+
}
|
|
51
|
+
export declare function shouldReconfigureState(props: EditorProps, nextProps: EditorProps): boolean;
|
|
52
|
+
interface CreateEditorStateOptions {
|
|
53
|
+
props: EditorViewProps;
|
|
54
|
+
context: EditorReactContext;
|
|
55
|
+
doc?: string | Object | PMNode;
|
|
56
|
+
resetting?: boolean;
|
|
57
|
+
selectionAtStart?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare class ReactEditorView<T = {}> extends React.Component<EditorViewProps & WrappedComponentProps & T, {}, EditorReactContext> {
|
|
60
|
+
view?: EditorView;
|
|
61
|
+
eventDispatcher: EventDispatcher;
|
|
62
|
+
contentTransformer?: Transformer<string>;
|
|
63
|
+
config: EditorConfig;
|
|
64
|
+
editorState: EditorState;
|
|
65
|
+
errorReporter: ErrorReporter;
|
|
66
|
+
dispatch: Dispatch;
|
|
67
|
+
proseMirrorRenderedSeverity?: SEVERITY;
|
|
68
|
+
transactionTracker: TransactionTracker;
|
|
69
|
+
validTransactionCount: number;
|
|
70
|
+
experienceStore?: ExperienceStore;
|
|
71
|
+
editorRef: React.RefObject<HTMLDivElement>;
|
|
72
|
+
static contextTypes: {
|
|
73
|
+
getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
|
+
};
|
|
75
|
+
private canDispatchTransactions;
|
|
76
|
+
private focusTimeoutId?;
|
|
77
|
+
private reliabilityInterval?;
|
|
78
|
+
private pluginPerformanceObserver;
|
|
79
|
+
private featureFlags;
|
|
80
|
+
private onPluginObservation;
|
|
81
|
+
get transactionTracking(): import("../types/performance-tracking").TransactionTracking;
|
|
82
|
+
private getPluginNames;
|
|
83
|
+
private countNodes;
|
|
84
|
+
constructor(props: EditorViewProps & WrappedComponentProps & T, context: EditorReactContext);
|
|
85
|
+
UNSAFE_componentWillReceiveProps(nextProps: EditorViewProps): void;
|
|
86
|
+
formatFullWidthAppearance: (appearance: EditorAppearance | undefined) => FULL_WIDTH_MODE;
|
|
87
|
+
resetEditorState: ({ doc, shouldScrollToBottom, }: {
|
|
88
|
+
doc: string;
|
|
89
|
+
shouldScrollToBottom: boolean;
|
|
90
|
+
}) => void;
|
|
91
|
+
blur: () => void;
|
|
92
|
+
reconfigureState: (props: EditorViewProps) => void;
|
|
93
|
+
handleAnalyticsEvent: FireAnalyticsCallback;
|
|
94
|
+
componentDidMount(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Clean up any non-PM resources when the editor is unmounted
|
|
97
|
+
*/
|
|
98
|
+
componentWillUnmount(): void;
|
|
99
|
+
private editorPlugins;
|
|
100
|
+
getPlugins(editorProps: EditorProps, prevEditorProps?: EditorProps, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPlugin[];
|
|
101
|
+
createEditorState: (options: CreateEditorStateOptions) => EditorState<any>;
|
|
102
|
+
private onEditorViewStateUpdated;
|
|
103
|
+
private trackValidTransactions;
|
|
104
|
+
private dispatchTransaction;
|
|
105
|
+
getDirectEditorProps: (state?: EditorState<any> | undefined) => DirectEditorProps;
|
|
106
|
+
private createEditorView;
|
|
107
|
+
handleEditorViewRef: (node: HTMLDivElement) => void;
|
|
108
|
+
dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void;
|
|
109
|
+
private editor;
|
|
110
|
+
render(): JSX.Element;
|
|
111
|
+
}
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorViewProps } from './ReactEditorViewInternal';
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
declare type AddRequiredProp<Type, Key extends keyof Type> = Type & Required<Pick<Type, Key>>;
|
|
5
|
+
export declare function ReactEditorViewEditor<T = {}>(props: AddRequiredProp<EditorViewProps & WrappedComponentProps & T, 'getEditorPlugins'>): JSX.Element;
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<EditorViewProps & WrappedComponentProps<"intl"> & Required<Pick<EditorViewProps & WrappedComponentProps<"intl">, "getEditorPlugins">>>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<EditorViewProps & WrappedComponentProps<"intl"> & Required<Pick<EditorViewProps & WrappedComponentProps<"intl">, "getEditorPlugins">>>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Transformer } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { EditorView } from 'prosemirror-view';
|
|
5
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
6
|
+
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
7
|
+
import EditorActions from '../actions';
|
|
8
|
+
import { EventDispatcher } from '../event-dispatcher';
|
|
9
|
+
import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
10
|
+
import { EditorProps } from '../types/editor-props';
|
|
11
|
+
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
12
|
+
import { GetEditorPlugins } from '../types/get-editor-props';
|
|
13
|
+
interface Props {
|
|
14
|
+
props: EditorProps;
|
|
15
|
+
handleAnalyticsEvent: FireAnalyticsCallback;
|
|
16
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
17
|
+
handleSave: (view: EditorView) => void;
|
|
18
|
+
editorActions: EditorActions;
|
|
19
|
+
getExperienceStore: () => ExperienceStore | undefined;
|
|
20
|
+
onEditorCreated: (instance: {
|
|
21
|
+
view: EditorView;
|
|
22
|
+
eventDispatcher: EventDispatcher;
|
|
23
|
+
transformer?: Transformer<string>;
|
|
24
|
+
}) => void;
|
|
25
|
+
onEditorDestroyed: (_instance: {
|
|
26
|
+
view: EditorView;
|
|
27
|
+
transformer?: Transformer<string>;
|
|
28
|
+
}) => void;
|
|
29
|
+
getEditorPlugins: GetEditorPlugins;
|
|
30
|
+
}
|
|
31
|
+
interface InternalProps extends Omit<Props, 'getExperienceStore'> {
|
|
32
|
+
providerFactory: ProviderFactory;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* EditorInternal is used for the internal editor react component
|
|
36
|
+
* with the lifecycle methods extracted into hooks.
|
|
37
|
+
*/
|
|
38
|
+
export default function EditorInternal(props: Props): jsx.JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* EditorInternalComponent is used to capture the common component
|
|
41
|
+
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function EditorInternalWithoutHooks({ props, handleAnalyticsEvent, createAnalyticsEvent, handleSave, editorActions, providerFactory, onEditorCreated, onEditorDestroyed, getEditorPlugins, }: InternalProps): jsx.JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
4
|
+
import { EditorProps } from '../../types/editor-props';
|
|
5
|
+
import { PerformanceTracking } from '../../types/performance-tracking';
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* Hook to be used for running analytics on mounting the editor.
|
|
9
|
+
* Should run once.
|
|
10
|
+
* WARNING: Consider any changes to also make to `src/editor.tsx`
|
|
11
|
+
*
|
|
12
|
+
* @param performanceTracking
|
|
13
|
+
* @param featureFlags
|
|
14
|
+
* @param getExperienceStore function to retrieve the Editor's current ExperienceStore
|
|
15
|
+
* @param createAnalyticsEvent
|
|
16
|
+
*/
|
|
17
|
+
export default function useEditorConstructor(performanceTracking: PerformanceTracking | undefined, featureFlags: EditorProps['featureFlags'], getExperienceStore: () => ExperienceStore | undefined, createAnalyticsEvent: CreateUIAnalyticsEvent): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
+
import { EditorProps } from '../../types/editor-props';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Hook to run the analytics for the Editor component.
|
|
7
|
+
* WARNING: Consider any changes to also make to `src/editor.tsx`
|
|
8
|
+
*
|
|
9
|
+
* @param props EditorProps
|
|
10
|
+
* @param getExperienceStore function to retrieve the Editor's current ExperienceStore
|
|
11
|
+
* @param createAnalyticsEvent
|
|
12
|
+
*/
|
|
13
|
+
export default function useMeasureEditorMountTime(props: EditorProps, getExperienceStore: () => ExperienceStore | undefined, createAnalyticsEvent: CreateUIAnalyticsEvent): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import { EditorProps } from '../../types/editor-props';
|
|
3
|
+
import EditorActions from '../../actions';
|
|
4
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
+
import { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
6
|
+
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
7
|
+
export declare type ProviderFactoryState = {
|
|
8
|
+
extensionProvider?: ExtensionProvider;
|
|
9
|
+
quickInsertProvider?: Promise<QuickInsertProvider>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* This hook is used to create the provider factory object.
|
|
14
|
+
* WARNING: Consider any changes to also make to `src/editor.tsx`
|
|
15
|
+
*
|
|
16
|
+
* @param props
|
|
17
|
+
* @param editorActions
|
|
18
|
+
* @param createAnalyticsEvent
|
|
19
|
+
* @returns ProviderFactory for Editor
|
|
20
|
+
*/
|
|
21
|
+
export default function useProviderFactory(props: EditorProps, editorActions: EditorActions, createAnalyticsEvent: CreateUIAnalyticsEvent): ProviderFactory;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { EditorProps } from '../types/editor-props';
|
|
5
|
+
import { Context } from './utils/editorPropTypes';
|
|
6
|
+
export default class EditorNext extends React.Component<EditorProps> {
|
|
7
|
+
/**
|
|
8
|
+
* WARNING: Code should be shared between Editor + EditorNext
|
|
9
|
+
* If you are making changes that affect both, consider making them
|
|
10
|
+
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
11
|
+
*/
|
|
12
|
+
static defaultProps: EditorProps;
|
|
13
|
+
static contextTypes: {
|
|
14
|
+
editorActions: PropTypes.Requireable<object>;
|
|
15
|
+
};
|
|
16
|
+
static propTypes: {
|
|
17
|
+
minHeight: ({ appearance, minHeight }: EditorProps) => Error | null;
|
|
18
|
+
};
|
|
19
|
+
private editorActions;
|
|
20
|
+
private createAnalyticsEvent?;
|
|
21
|
+
private editorSessionId;
|
|
22
|
+
private experienceStore?;
|
|
23
|
+
private startTime?;
|
|
24
|
+
constructor(props: EditorProps, context: Context);
|
|
25
|
+
private onEditorCreated;
|
|
26
|
+
private onEditorDestroyed;
|
|
27
|
+
private handleSave;
|
|
28
|
+
private handleAnalyticsEvent;
|
|
29
|
+
private registerEditorForActions;
|
|
30
|
+
private unregisterEditorFromActions;
|
|
31
|
+
private getExperienceStore;
|
|
32
|
+
render(): jsx.JSX.Element;
|
|
33
|
+
private getEditorPlugins;
|
|
34
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
+
import { EditorProps } from '../../types/editor-props';
|
|
4
|
+
import { PerformanceTracking } from '../../types/performance-tracking';
|
|
5
|
+
export default function editorMeasureTTICallback(tti: number, ttiFromInvocation: number, canceled: boolean, performanceTracking: PerformanceTracking | undefined, featureFlags: EditorProps['featureFlags'], createAnalyticsEvent?: CreateUIAnalyticsEvent, experienceStore?: ExperienceStore): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import EditorActions from '../../actions';
|
|
3
|
+
import { EditorProps } from '../../types/editor-props';
|
|
4
|
+
export declare type Context = {
|
|
5
|
+
editorActions?: EditorActions;
|
|
6
|
+
intl: IntlShape;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* Logic for Editor prop types (ie. `static propTypes = propTypes(message)`)
|
|
11
|
+
* for use with 'prop-types' library
|
|
12
|
+
*
|
|
13
|
+
* @param errorMessage
|
|
14
|
+
* @returns Editor prop-types
|
|
15
|
+
*/
|
|
16
|
+
export declare function propTypes(errorMessage: string): {
|
|
17
|
+
minHeight: ({ appearance, minHeight }: EditorProps) => Error | null;
|
|
18
|
+
};
|
|
19
|
+
export declare const defaultProps: EditorProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
2
|
+
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import { QuickInsertProvider } from '../../plugins/quick-insert/types';
|
|
4
|
+
import { EditorProps } from '../../types/editor-props';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Utility to set all the providers on a provider factory
|
|
8
|
+
*
|
|
9
|
+
* @param providerFactory
|
|
10
|
+
* @param props
|
|
11
|
+
* @param extensionProvider
|
|
12
|
+
* @param quickInsertProvider
|
|
13
|
+
*/
|
|
14
|
+
export default function handleProviders(providerFactory: ProviderFactory, props: EditorProps, extensionProvider?: ExtensionProvider, quickInsertProvider?: Promise<QuickInsertProvider>): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
+
import { Transformer } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { EditorView } from 'prosemirror-view';
|
|
5
|
+
import EditorActions from '../../actions';
|
|
6
|
+
import { EventDispatcher } from '../../event-dispatcher';
|
|
7
|
+
import { EditorProps } from '../../types/editor-props';
|
|
8
|
+
export default function onEditorCreated(instance: {
|
|
9
|
+
view: EditorView;
|
|
10
|
+
eventDispatcher: EventDispatcher;
|
|
11
|
+
transformer?: Transformer<string>;
|
|
12
|
+
}, props: EditorProps, setExperienceStore: (experienceStore: ExperienceStore) => void, getExperienceStore: () => ExperienceStore | undefined, getCreateAnalyticsEvent: () => CreateUIAnalyticsEvent | undefined, editorActions: EditorActions, startTime: number | undefined, registerEditorForActions: (editorView: EditorView, eventDispatcher: EventDispatcher, contentTransformer?: Transformer<string>) => void): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { EditorProps } from '../../types/editor-props';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Util function to be used with the Editor component to send duration analytics
|
|
8
|
+
*
|
|
9
|
+
* @param action
|
|
10
|
+
* @param props
|
|
11
|
+
* @param getExperienceStore return the ExperienceStore of the Editor
|
|
12
|
+
* @param getCreateAnalyticsEvent return the CreateUIAnalyticsEvent of the Editor
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export default function sendDurationAnalytics(action: ACTION.EDITOR_MOUNTED | ACTION.ON_EDITOR_READY_CALLBACK, props: EditorProps, getExperienceStore: () => ExperienceStore | undefined, createAnalyticsEvent: CreateUIAnalyticsEvent | undefined): (duration: number, startTime: number) => Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import EditorActions from '../../actions';
|
|
2
|
+
import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { PerformanceTracking } from '../../types/performance-tracking';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Util function to be used with the Editor to track the EditorActions prop
|
|
7
|
+
*
|
|
8
|
+
* @param editorActions
|
|
9
|
+
* @param performanceTracking
|
|
10
|
+
* @param handleAnalyticsEvent
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export default function trackEditorActions(editorActions: EditorActions & {
|
|
14
|
+
_contentRetrievalTracking?: {
|
|
15
|
+
getValueTracked: boolean;
|
|
16
|
+
samplingCounters: {
|
|
17
|
+
success: number;
|
|
18
|
+
failure: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}, performanceTracking: PerformanceTracking | undefined, handleAnalyticsEvent: FireAnalyticsCallback): EditorActions<any> & {
|
|
22
|
+
_contentRetrievalTracking?: {
|
|
23
|
+
getValueTracked: boolean;
|
|
24
|
+
samplingCounters: {
|
|
25
|
+
success: number;
|
|
26
|
+
failure: number;
|
|
27
|
+
};
|
|
28
|
+
} | undefined;
|
|
29
|
+
};
|
package/dist/types/editor.d.ts
CHANGED
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { EditorView } from 'prosemirror-view';
|
|
6
|
-
import
|
|
5
|
+
import React from 'react';
|
|
7
6
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
8
7
|
import { Transformer } from '@atlaskit/editor-common/types';
|
|
9
8
|
import EditorActions from './actions';
|
|
10
|
-
import {
|
|
9
|
+
import { Context } from './editor-next/utils/editorPropTypes';
|
|
11
10
|
import { EventDispatcher } from './event-dispatcher';
|
|
12
|
-
import { FireAnalyticsCallback } from '
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export default class Editor extends React.Component<EditorProps, State> {
|
|
11
|
+
import { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import { QuickInsertOptions, QuickInsertProvider } from './plugins/quick-insert/types';
|
|
13
|
+
import { EditorProps } from './types/editor-props';
|
|
14
|
+
import { ProviderFactoryState } from './editor-next/hooks/useProviderFactory';
|
|
15
|
+
export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, FeedbackInfo, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
|
|
16
|
+
export default class Editor extends React.Component<EditorProps, ProviderFactoryState> {
|
|
17
|
+
/**
|
|
18
|
+
* WARNING: Code should be shared between Editor + EditorNext
|
|
19
|
+
* If you are making changes that affect both, consider making them
|
|
20
|
+
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
21
|
+
*/
|
|
24
22
|
static defaultProps: EditorProps;
|
|
25
|
-
static propTypes: {
|
|
26
|
-
minHeight: ({ appearance, minHeight }: EditorProps) => Error | null;
|
|
27
|
-
};
|
|
28
23
|
static contextTypes: {
|
|
29
24
|
editorActions: PropTypes.Requireable<object>;
|
|
30
25
|
};
|
|
26
|
+
static propTypes: {
|
|
27
|
+
minHeight: ({ appearance, minHeight }: EditorProps) => Error | null;
|
|
28
|
+
};
|
|
31
29
|
private providerFactory;
|
|
32
30
|
private editorActions;
|
|
33
31
|
private createAnalyticsEvent?;
|
|
@@ -35,8 +33,22 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
35
33
|
private experienceStore?;
|
|
36
34
|
private startTime?;
|
|
37
35
|
constructor(props: EditorProps, context: Context);
|
|
36
|
+
/**
|
|
37
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
38
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
39
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
40
|
+
*/
|
|
38
41
|
componentDidMount(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
44
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
45
|
+
*/
|
|
39
46
|
componentDidUpdate(prevProps: EditorProps): void;
|
|
47
|
+
/**
|
|
48
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
49
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
50
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
51
|
+
*/
|
|
40
52
|
componentWillUnmount(): void;
|
|
41
53
|
/**
|
|
42
54
|
* @private
|
|
@@ -67,7 +79,7 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
67
79
|
* Please reach out to the Editor team if you were previously using this
|
|
68
80
|
* and need to find a workaround.
|
|
69
81
|
*/
|
|
70
|
-
prepareExtensionProvider: import("
|
|
82
|
+
prepareExtensionProvider: (extensionProviders?: import("./types").ExtensionProvidersProp | undefined) => ExtensionProvider<any> | undefined;
|
|
71
83
|
/**
|
|
72
84
|
* @private
|
|
73
85
|
* @deprecated - Do not override this at all, this is an antipattern.
|
|
@@ -86,8 +98,6 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
86
98
|
eventDispatcher: EventDispatcher;
|
|
87
99
|
transformer?: Transformer<string>;
|
|
88
100
|
}): void;
|
|
89
|
-
private sendDurationAnalytics;
|
|
90
|
-
private deprecationWarnings;
|
|
91
101
|
/**
|
|
92
102
|
* @private
|
|
93
103
|
* @deprecated - Do not override this at all, this is an antipattern.
|
|
@@ -98,10 +108,6 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
98
108
|
view: EditorView;
|
|
99
109
|
transformer?: Transformer<string>;
|
|
100
110
|
}): void;
|
|
101
|
-
private registerEditorForActions;
|
|
102
|
-
private unregisterEditorFromActions;
|
|
103
|
-
private handleProviders;
|
|
104
|
-
private getBaseFontSize;
|
|
105
111
|
/**
|
|
106
112
|
* @private
|
|
107
113
|
* @deprecated - Do not override this at all, this is an antipattern.
|
|
@@ -116,5 +122,21 @@ export default class Editor extends React.Component<EditorProps, State> {
|
|
|
116
122
|
* and need to find a workaround.
|
|
117
123
|
*/
|
|
118
124
|
handleAnalyticsEvent: FireAnalyticsCallback;
|
|
125
|
+
/**
|
|
126
|
+
* @private
|
|
127
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
128
|
+
* Please reach out to the Editor team if you were previously using this
|
|
129
|
+
* and need to find a workaround.
|
|
130
|
+
*/
|
|
131
|
+
registerEditorForActions(editorView: EditorView, eventDispatcher: EventDispatcher, contentTransformer?: Transformer<string>): void;
|
|
132
|
+
/**
|
|
133
|
+
* @private
|
|
134
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
135
|
+
* Please reach out to the Editor team if you were previously using this
|
|
136
|
+
* and need to find a workaround.
|
|
137
|
+
*/
|
|
138
|
+
unregisterEditorFromActions(): void;
|
|
139
|
+
private getExperienceStore;
|
|
119
140
|
render(): jsx.JSX.Element;
|
|
141
|
+
private getEditorPlugins;
|
|
120
142
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -90,3 +90,4 @@ export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
|
90
90
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
91
91
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
92
92
|
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
93
|
+
export { default as EditorMigrationComponent } from './editor-next/editor-migration-component';
|
|
@@ -5,4 +5,4 @@ import { EditorSharedConfig } from '../../../internal/context/shared-config';
|
|
|
5
5
|
* and passes them through to `fireAnalyticsEvent`.
|
|
6
6
|
*/
|
|
7
7
|
export declare function useAnalyticsHandler(editorSharedConfig: EditorSharedConfig | null): void;
|
|
8
|
-
export declare function useCreateAnalyticsHandler(createAnalyticsEvent?: CreateUIAnalyticsEvent): import("
|
|
8
|
+
export declare function useCreateAnalyticsHandler(createAnalyticsEvent?: CreateUIAnalyticsEvent): import("@atlaskit/editor-common/analytics").FireAnalyticsCallback;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
5
|
+
/**
|
|
6
|
+
* DO NOT USE THIS FUNCTION
|
|
7
|
+
*
|
|
8
|
+
* IT IS A TEMPORARY PLACEHOLDER UNTIL THOSE TICKETS XX-11111 XX-22222 are done
|
|
9
|
+
**/
|
|
10
|
+
export declare const createStubInternalApis: () => {
|
|
11
|
+
editorSelectionAPI: EditorSelectionAPI;
|
|
12
|
+
insertNodeAPI: import("../../../insert-api/types").InsertNodeAPI;
|
|
13
|
+
editorAnalyticsAPI: EditorAnalyticsAPI;
|
|
14
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
15
|
+
stubInternalApisPlugin: () => EditorPlugin;
|
|
16
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AllBuilderPlugins,
|
|
1
|
+
import type { AllBuilderPlugins, NextEditorPlugin, SafePresetCheck } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { Builder } from '@atlaskit/editor-common/utils';
|
|
3
3
|
export declare class Preset<T extends {
|
|
4
4
|
name: string;
|
|
@@ -7,7 +7,7 @@ export declare class Preset<T extends {
|
|
|
7
7
|
constructor(...more: [...StackPlugins]);
|
|
8
8
|
add<NewPlugin extends AllBuilderPlugins>(nextOrTuple: SafePresetCheck<NewPlugin, StackPlugins>): Preset<T, [...[NewPlugin], ...StackPlugins]>;
|
|
9
9
|
has(plugin: AllBuilderPlugins): boolean;
|
|
10
|
-
getEditorPlugins(excludes?: Set<string>):
|
|
10
|
+
getEditorPlugins(excludes?: Set<string>): NextEditorPlugin<any, any>[];
|
|
11
11
|
private processEditorPlugins;
|
|
12
12
|
private removeExcludedPlugins;
|
|
13
13
|
}
|
|
@@ -16,10 +16,10 @@ export declare type PluginsPreset = Array<PluginConfig<any, any>>;
|
|
|
16
16
|
* Type for Editor Preset's plugin configuration.
|
|
17
17
|
*
|
|
18
18
|
* Possible configurations:
|
|
19
|
-
* – () => EditorPlugin
|
|
20
|
-
* – (options: any) => EditorPlugin
|
|
21
|
-
* – (options?: any) => EditorPlugin
|
|
22
|
-
* (In the future, a preset may contain
|
|
19
|
+
* – () => () => EditorPlugin
|
|
20
|
+
* – () => (options: any) => EditorPlugin
|
|
21
|
+
* – () => (options?: any) => EditorPlugin
|
|
22
|
+
* (In the future, a preset may contain externalPlugins)
|
|
23
23
|
* – (props.externalPlugins) => (options?: any) => EditorPlugin
|
|
24
24
|
*
|
|
25
25
|
* Usage:
|
|
@@ -26,5 +26,5 @@ declare type UniversalPresetProps = EditorPresetProps & DefaultPresetPluginOptio
|
|
|
26
26
|
* @param getEditorContainerWidth
|
|
27
27
|
* @returns a full featured preset configured according to the provided props - basis for create-plugins-list
|
|
28
28
|
*/
|
|
29
|
-
export default function createUniversalPreset(appearance: EditorAppearance | undefined, props: UniversalPresetProps, featureFlags: FeatureFlags, prevAppearance?: EditorAppearance,
|
|
29
|
+
export default function createUniversalPreset(appearance: EditorAppearance | undefined, props: UniversalPresetProps, featureFlags: FeatureFlags, prevAppearance?: EditorAppearance, maybeCreateAnalyticsEvent?: CreateUIAnalyticsEvent, _insertNodeAPI?: InsertNodeAPI, _editorAnalyticsAPI?: EditorAnalyticsAPI, _editorSelectionAPI?: EditorSelectionAPI, _getEditorContainerWidth?: GetEditorContainerWidth): Preset<EditorPlugin, []>;
|
|
30
30
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { AlignmentPluginState } from './pm-plugins/types';
|
|
3
3
|
export declare const defaultConfig: AlignmentPluginState;
|
|
4
|
-
declare const alignmentPlugin: NextEditorPlugin<'alignment'
|
|
4
|
+
declare const alignmentPlugin: NextEditorPlugin<'alignment'>;
|
|
5
5
|
export default alignmentPlugin;
|
|
@@ -5,6 +5,7 @@ import { WrappedComponentProps } from 'react-intl-next';
|
|
|
5
5
|
import { AlignmentPluginState, AlignmentState } from '../../pm-plugins/types';
|
|
6
6
|
export interface State {
|
|
7
7
|
isOpen: boolean;
|
|
8
|
+
isOpenedByKeyboard: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface Props {
|
|
10
11
|
pluginState: AlignmentPluginState;
|
|
@@ -20,9 +21,10 @@ export declare class AlignmentToolbar extends React.Component<Props & WrappedCom
|
|
|
20
21
|
private toolbarItemRef;
|
|
21
22
|
state: State;
|
|
22
23
|
render(): jsx.JSX.Element;
|
|
24
|
+
componentDidUpdate(prevProps: Props): void;
|
|
23
25
|
private changeAlignment;
|
|
24
26
|
private toggleOpen;
|
|
25
|
-
private
|
|
27
|
+
private toggleOpenByKeyboard;
|
|
26
28
|
private hide;
|
|
27
29
|
private hideOnEscape;
|
|
28
30
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import analyticsPlugin from './plugin';
|
|
2
|
-
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, LIST_TEXT_SCENARIOS, } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
export { withAnalytics, addAnalytics, findInsertLocation,
|
|
2
|
+
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, LIST_TEXT_SCENARIOS, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, FireAnalyticsCallback, FireAnalyticsEvent, } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
export { withAnalytics, addAnalytics, findInsertLocation, getSelectionType, getStateContext, mapActionSubjectIdToAttributes, } from './utils';
|
|
5
5
|
export declare const analyticsPluginKey: import("prosemirror-state").PluginKey<any, any>;
|
|
6
6
|
export default analyticsPlugin;
|
|
7
|
-
export { fireAnalyticsEvent } from './fire-analytics-event';
|
|
8
|
-
export type { FireAnalyticsEvent } from './fire-analytics-event';
|
|
9
|
-
export type { FireAnalyticsCallback } from './fire-analytics-event';
|
|
10
7
|
export type { HigherOrderCommand } from '../../types/command';
|
|
11
8
|
export type { DispatchAnalyticsEvent } from './types/dispatch-analytics-event';
|
|
@@ -6,7 +6,9 @@ interface AnalyticsPluginOptions {
|
|
|
6
6
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
7
7
|
performanceTracking?: PerformanceTracking;
|
|
8
8
|
}
|
|
9
|
-
declare const analyticsPlugin: NextEditorPlugin<'analytics',
|
|
9
|
+
declare const analyticsPlugin: NextEditorPlugin<'analytics', {
|
|
10
|
+
pluginConfiguration: AnalyticsPluginOptions;
|
|
11
|
+
}>;
|
|
10
12
|
export declare function extendPayload({ payload, duration, distortedDuration, }: {
|
|
11
13
|
payload: AnalyticsEventPayload;
|
|
12
14
|
duration: number;
|