@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
|
@@ -55,6 +55,8 @@ var dispatchLongTaskEvent = function dispatchLongTaskEvent(dispatchAnalyticsEven
|
|
|
55
55
|
var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserFreezeTracking, ufo) {
|
|
56
56
|
var interactionType;
|
|
57
57
|
var inputLatencyTracker = null;
|
|
58
|
+
var inputLatencySingleKeyTracker = null;
|
|
59
|
+
var inputLatencyRenderedTracker = null;
|
|
58
60
|
if (browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType) {
|
|
59
61
|
interactionType = (0, _frozenEditor.setInteractionType)(_analytics.BROWSER_FREEZE_INTERACTION_TYPE.LOADING);
|
|
60
62
|
}
|
|
@@ -78,19 +80,80 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
|
|
|
78
80
|
var shouldTrackSeverity = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.trackSeverity) || DEFAULT_TRACK_SEVERITY_ENABLED;
|
|
79
81
|
var severityThresholdNormal = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityNormalThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_NORMAL;
|
|
80
82
|
var severityThresholdDegraded = (inputTracking === null || inputTracking === void 0 ? void 0 : inputTracking.severityDegradedThreshold) || DEFAULT_TRACK_SEVERITY_THRESHOLD_DEGRADED;
|
|
83
|
+
var createDispatchSample = function createDispatchSample(action, view) {
|
|
84
|
+
return function (time, severity) {
|
|
85
|
+
var _getContextIdentifier2;
|
|
86
|
+
var state = view.state;
|
|
87
|
+
var nodesCount = getNodeCount(state);
|
|
88
|
+
var samplePayload = {
|
|
89
|
+
action: action,
|
|
90
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
91
|
+
attributes: _objectSpread(_objectSpread({
|
|
92
|
+
time: time,
|
|
93
|
+
nodeSize: state.doc.nodeSize
|
|
94
|
+
}, nodesCount), {}, {
|
|
95
|
+
participants: (0, _getParticipantsCount.getParticipantsCount)(state),
|
|
96
|
+
objectId: (_getContextIdentifier2 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier2 === void 0 ? void 0 : _getContextIdentifier2.objectId,
|
|
97
|
+
severity: shouldTrackSeverity ? severity : undefined
|
|
98
|
+
}),
|
|
99
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
100
|
+
};
|
|
101
|
+
dispatchAnalyticsEvent(samplePayload);
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
var createDispatchAverage = function createDispatchAverage(action, view) {
|
|
105
|
+
return function (_ref, severity) {
|
|
106
|
+
var _getContextIdentifier3;
|
|
107
|
+
var mean = _ref.mean,
|
|
108
|
+
median = _ref.median,
|
|
109
|
+
sampleSize = _ref.sampleSize;
|
|
110
|
+
var state = view.state;
|
|
111
|
+
var nodeCount = getNodeCount(state);
|
|
112
|
+
var averagePayload = {
|
|
113
|
+
action: action,
|
|
114
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
115
|
+
attributes: _objectSpread(_objectSpread({
|
|
116
|
+
mean: mean,
|
|
117
|
+
median: median,
|
|
118
|
+
sampleSize: sampleSize
|
|
119
|
+
}, nodeCount), {}, {
|
|
120
|
+
nodeSize: state.doc.nodeSize,
|
|
121
|
+
severity: shouldTrackSeverity ? severity : undefined,
|
|
122
|
+
participants: (0, _getParticipantsCount.getParticipantsCount)(state),
|
|
123
|
+
objectId: (_getContextIdentifier3 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId
|
|
124
|
+
}),
|
|
125
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
126
|
+
};
|
|
127
|
+
dispatchAnalyticsEvent(averagePayload);
|
|
128
|
+
};
|
|
129
|
+
};
|
|
81
130
|
return new _safePlugin.SafePlugin({
|
|
82
131
|
key: frozenEditorPluginKey,
|
|
83
132
|
props: (0, _utils.isPerformanceAPIAvailable)() ? {
|
|
84
133
|
handleTextInput: function handleTextInput(view) {
|
|
85
|
-
var _inputLatencyTracker;
|
|
86
|
-
(_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 ? void 0 : _inputLatencyTracker.start();
|
|
87
134
|
if (browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType) {
|
|
88
135
|
interactionType = _analytics.BROWSER_FREEZE_INTERACTION_TYPE.TYPING;
|
|
89
136
|
}
|
|
90
|
-
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
137
|
+
if (inputLatencyTracker) {
|
|
138
|
+
var end = inputLatencyTracker.start();
|
|
139
|
+
|
|
140
|
+
// This is called after all handleTextInput events are executed which means first handleTextInput time incorporates following handleTextInput processing time
|
|
141
|
+
// Also this is called before browser rendering so it doesn't count it.
|
|
142
|
+
requestAnimationFrame(end);
|
|
143
|
+
}
|
|
144
|
+
if (inputLatencySingleKeyTracker) {
|
|
145
|
+
var _end = inputLatencySingleKeyTracker.start();
|
|
146
|
+
|
|
147
|
+
// This is executed before next handleTextInput when multiple keypress events are in one animation frame
|
|
148
|
+
// so it tracks individual keypress processing time
|
|
149
|
+
Promise.resolve().then(_end);
|
|
150
|
+
}
|
|
151
|
+
if (inputLatencyRenderedTracker) {
|
|
152
|
+
var _end2 = inputLatencyRenderedTracker.start();
|
|
153
|
+
|
|
154
|
+
// This is called at the next event loop so it counts browser rendering time.
|
|
155
|
+
setTimeout(_end2);
|
|
156
|
+
}
|
|
94
157
|
return false;
|
|
95
158
|
},
|
|
96
159
|
handleDOMEvents: browserFreezeTracking !== null && browserFreezeTracking !== void 0 && browserFreezeTracking.trackInteractionType ? {
|
|
@@ -118,10 +181,10 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
|
|
|
118
181
|
onSampleStart: function onSampleStart() {
|
|
119
182
|
experienceStore === null || experienceStore === void 0 ? void 0 : experienceStore.start(_ufo.EditorExperience.typing);
|
|
120
183
|
},
|
|
121
|
-
onSampleEnd: function onSampleEnd(time,
|
|
122
|
-
var
|
|
123
|
-
var isSlow =
|
|
124
|
-
severity =
|
|
184
|
+
onSampleEnd: function onSampleEnd(time, _ref2) {
|
|
185
|
+
var _getContextIdentifier4;
|
|
186
|
+
var isSlow = _ref2.isSlow,
|
|
187
|
+
severity = _ref2.severity;
|
|
125
188
|
var state = _view.state;
|
|
126
189
|
var nodesCount = getNodeCount(state);
|
|
127
190
|
if (isSlow) {
|
|
@@ -133,54 +196,13 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
|
|
|
133
196
|
nodeSize: state.doc.nodeSize
|
|
134
197
|
}, nodesCount), {}, {
|
|
135
198
|
participants: (0, _getParticipantsCount.getParticipantsCount)(state),
|
|
136
|
-
objectId: (
|
|
199
|
+
objectId: (_getContextIdentifier4 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId,
|
|
137
200
|
time: time,
|
|
138
201
|
severity: shouldTrackSeverity ? severity : undefined
|
|
139
202
|
}));
|
|
140
203
|
},
|
|
141
|
-
dispatchSample:
|
|
142
|
-
|
|
143
|
-
var state = _view.state;
|
|
144
|
-
var nodesCount = getNodeCount(state);
|
|
145
|
-
var samplePayload = {
|
|
146
|
-
action: _analytics.ACTION.INPUT_PERF_SAMPLING,
|
|
147
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
148
|
-
attributes: _objectSpread(_objectSpread({
|
|
149
|
-
time: time,
|
|
150
|
-
nodeSize: state.doc.nodeSize
|
|
151
|
-
}, nodesCount), {}, {
|
|
152
|
-
participants: (0, _getParticipantsCount.getParticipantsCount)(state),
|
|
153
|
-
objectId: (_getContextIdentifier3 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier3 === void 0 ? void 0 : _getContextIdentifier3.objectId,
|
|
154
|
-
severity: shouldTrackSeverity ? severity : undefined
|
|
155
|
-
}),
|
|
156
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
157
|
-
};
|
|
158
|
-
dispatchAnalyticsEvent(samplePayload);
|
|
159
|
-
},
|
|
160
|
-
dispatchAverage: function dispatchAverage(_ref2, severity) {
|
|
161
|
-
var _getContextIdentifier4;
|
|
162
|
-
var mean = _ref2.mean,
|
|
163
|
-
median = _ref2.median,
|
|
164
|
-
sampleSize = _ref2.sampleSize;
|
|
165
|
-
var state = _view.state;
|
|
166
|
-
var nodeCount = getNodeCount(state);
|
|
167
|
-
var averagePayload = {
|
|
168
|
-
action: _analytics.ACTION.INPUT_PERF_SAMPLING_AVG,
|
|
169
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
170
|
-
attributes: _objectSpread(_objectSpread({
|
|
171
|
-
mean: mean,
|
|
172
|
-
median: median,
|
|
173
|
-
sampleSize: sampleSize
|
|
174
|
-
}, nodeCount), {}, {
|
|
175
|
-
nodeSize: state.doc.nodeSize,
|
|
176
|
-
severity: shouldTrackSeverity ? severity : undefined,
|
|
177
|
-
participants: (0, _getParticipantsCount.getParticipantsCount)(state),
|
|
178
|
-
objectId: (_getContextIdentifier4 = (0, _contextIdentifier.getContextIdentifier)(state)) === null || _getContextIdentifier4 === void 0 ? void 0 : _getContextIdentifier4.objectId
|
|
179
|
-
}),
|
|
180
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
181
|
-
};
|
|
182
|
-
dispatchAnalyticsEvent(averagePayload);
|
|
183
|
-
},
|
|
204
|
+
dispatchSample: createDispatchSample(_analytics.ACTION.INPUT_PERF_SAMPLING, _view),
|
|
205
|
+
dispatchAverage: createDispatchAverage(_analytics.ACTION.INPUT_PERF_SAMPLING_AVG, _view),
|
|
184
206
|
onSlowInput: function onSlowInput(time) {
|
|
185
207
|
var _getContextIdentifier5;
|
|
186
208
|
var state = _view.state;
|
|
@@ -200,6 +222,26 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
|
|
|
200
222
|
}
|
|
201
223
|
});
|
|
202
224
|
}
|
|
225
|
+
if (inputTracking !== null && inputTracking !== void 0 && inputTracking.trackSingleKeypress) {
|
|
226
|
+
inputLatencySingleKeyTracker = new _inputLatencyTracking.default({
|
|
227
|
+
samplingRate: samplingRate,
|
|
228
|
+
slowThreshold: slowThreshold,
|
|
229
|
+
normalThreshold: severityThresholdNormal,
|
|
230
|
+
degradedThreshold: severityThresholdDegraded,
|
|
231
|
+
dispatchSample: createDispatchSample(_analytics.ACTION.INPUT_PERF_SAMPLING_SINGLE_KEYPRESS, _view),
|
|
232
|
+
dispatchAverage: createDispatchAverage(_analytics.ACTION.INPUT_PERF_SAMPLING_SINGLE_KEYPRESS_AVG, _view)
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (inputTracking !== null && inputTracking !== void 0 && inputTracking.trackRenderingTime) {
|
|
236
|
+
inputLatencyRenderedTracker = new _inputLatencyTracking.default({
|
|
237
|
+
samplingRate: samplingRate,
|
|
238
|
+
slowThreshold: slowThreshold,
|
|
239
|
+
normalThreshold: severityThresholdNormal,
|
|
240
|
+
degradedThreshold: severityThresholdDegraded,
|
|
241
|
+
dispatchSample: createDispatchSample(_analytics.ACTION.INPUT_PERF_SAMPLING_RENDERED, _view),
|
|
242
|
+
dispatchAverage: createDispatchAverage(_analytics.ACTION.INPUT_PERF_SAMPLING_RENDERED_AVG, _view)
|
|
243
|
+
});
|
|
244
|
+
}
|
|
203
245
|
var observer;
|
|
204
246
|
try {
|
|
205
247
|
var _observer = new PerformanceObserver(function (list) {
|
|
@@ -219,8 +261,8 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
|
|
|
219
261
|
} catch (e) {}
|
|
220
262
|
return {
|
|
221
263
|
destroy: function destroy() {
|
|
222
|
-
var
|
|
223
|
-
(
|
|
264
|
+
var _inputLatencyTracker;
|
|
265
|
+
(_inputLatencyTracker = inputLatencyTracker) === null || _inputLatencyTracker === void 0 ? void 0 : _inputLatencyTracker.flush();
|
|
224
266
|
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
225
267
|
}
|
|
226
268
|
};
|
|
@@ -24,7 +24,6 @@ var InputLatencyTracker = /*#__PURE__*/function () {
|
|
|
24
24
|
(0, _classCallCheck2.default)(this, InputLatencyTracker);
|
|
25
25
|
(0, _defineProperty2.default)(this, "samples", []);
|
|
26
26
|
(0, _defineProperty2.default)(this, "total", 0);
|
|
27
|
-
this.currentStart = null;
|
|
28
27
|
this.samplingRate = samplingRate;
|
|
29
28
|
this.slowThreshold = slowThreshold;
|
|
30
29
|
this.normalThreshold = normalThreshold;
|
|
@@ -38,34 +37,34 @@ var InputLatencyTracker = /*#__PURE__*/function () {
|
|
|
38
37
|
(0, _createClass2.default)(InputLatencyTracker, [{
|
|
39
38
|
key: "start",
|
|
40
39
|
value: function start() {
|
|
41
|
-
|
|
40
|
+
var _this = this;
|
|
41
|
+
var currentStart = performance.now();
|
|
42
42
|
if (this.samples.length + 1 === this.samplingRate) {
|
|
43
43
|
var _this$onSampleStart;
|
|
44
44
|
(_this$onSampleStart = this.onSampleStart) === null || _this$onSampleStart === void 0 ? void 0 : _this$onSampleStart.call(this);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
(_this
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
46
|
+
var end = function end() {
|
|
47
|
+
if (currentStart === null) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
var isSlow = false;
|
|
51
|
+
var time = (0, _getPerformanceTiming.getTimeSince)(currentStart);
|
|
52
|
+
_this.push(time);
|
|
53
|
+
if (time > _this.slowThreshold) {
|
|
54
|
+
var _this$onSlowInput;
|
|
55
|
+
(_this$onSlowInput = _this.onSlowInput) === null || _this$onSlowInput === void 0 ? void 0 : _this$onSlowInput.call(_this, time);
|
|
56
|
+
isSlow = true;
|
|
57
|
+
}
|
|
58
|
+
if (_this.samples.length === _this.samplingRate) {
|
|
59
|
+
var _this$onSampleEnd;
|
|
60
|
+
_this.flush();
|
|
61
|
+
(_this$onSampleEnd = _this.onSampleEnd) === null || _this$onSampleEnd === void 0 ? void 0 : _this$onSampleEnd.call(_this, time, {
|
|
62
|
+
isSlow: isSlow,
|
|
63
|
+
severity: _this.severity(time)
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return end;
|
|
69
68
|
}
|
|
70
69
|
}, {
|
|
71
70
|
key: "flush",
|
|
@@ -24,6 +24,8 @@ var _styled = require("./styled");
|
|
|
24
24
|
var _keymaps = require("../../../../keymaps");
|
|
25
25
|
var _blocktypeButton = require("./blocktype-button");
|
|
26
26
|
var _keymaps2 = require("@atlaskit/editor-common/keymaps");
|
|
27
|
+
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; }
|
|
28
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
27
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
28
30
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
31
|
var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -37,18 +39,30 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
37
39
|
}
|
|
38
40
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
39
41
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
40
|
-
active: false
|
|
42
|
+
active: false,
|
|
43
|
+
isOpenedByKeyboard: false
|
|
41
44
|
});
|
|
42
45
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function (attrs) {
|
|
43
|
-
_this.setState({
|
|
44
|
-
active: attrs.isOpen
|
|
45
|
-
|
|
46
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
47
|
+
active: attrs.isOpen,
|
|
48
|
+
isOpenedByKeyboard: attrs.isOpenedByKeyboard
|
|
49
|
+
}));
|
|
46
50
|
});
|
|
47
51
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTriggerClick", function () {
|
|
48
52
|
_this.onOpenChange({
|
|
49
|
-
isOpen: !_this.state.active
|
|
53
|
+
isOpen: !_this.state.active,
|
|
54
|
+
isOpenedByKeyboard: false
|
|
50
55
|
});
|
|
51
56
|
});
|
|
57
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTriggerByKeyboard", function (event) {
|
|
58
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
_this.onOpenChange({
|
|
61
|
+
isOpen: !_this.state.active,
|
|
62
|
+
isOpenedByKeyboard: true
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
52
66
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createItems", function () {
|
|
53
67
|
var formatMessage = _this.props.intl.formatMessage;
|
|
54
68
|
var _this$props$pluginSta = _this.props.pluginState,
|
|
@@ -85,9 +99,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
85
99
|
var blockType = item.value;
|
|
86
100
|
_this.props.setBlockType(blockType.name);
|
|
87
101
|
if (shouldCloseMenu) {
|
|
88
|
-
_this.setState({
|
|
102
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
89
103
|
active: false
|
|
90
|
-
});
|
|
104
|
+
}));
|
|
91
105
|
}
|
|
92
106
|
});
|
|
93
107
|
return _this;
|
|
@@ -95,7 +109,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
95
109
|
(0, _createClass2.default)(ToolbarBlockType, [{
|
|
96
110
|
key: "render",
|
|
97
111
|
value: function render() {
|
|
98
|
-
var
|
|
112
|
+
var _this2 = this;
|
|
113
|
+
var _this$state = this.state,
|
|
114
|
+
active = _this$state.active,
|
|
115
|
+
isOpenedByKeyboard = _this$state.isOpenedByKeyboard;
|
|
99
116
|
var _this$props = this.props,
|
|
100
117
|
popupsMountPoint = _this$props.popupsMountPoint,
|
|
101
118
|
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
@@ -137,7 +154,15 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
154
|
zIndex: _editorSharedStyles.akEditorMenuZIndex,
|
|
138
155
|
fitHeight: 360,
|
|
139
156
|
fitWidth: 106,
|
|
140
|
-
shouldUseDefaultRole: true
|
|
157
|
+
shouldUseDefaultRole: true,
|
|
158
|
+
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
159
|
+
if (isOpenedByKeyboard) {
|
|
160
|
+
_this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {
|
|
161
|
+
isOpenedByKeyboard: false
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
return isOpenedByKeyboard;
|
|
165
|
+
}
|
|
141
166
|
}, (0, _react2.jsx)(_blocktypeButton.BlockTypeButton, {
|
|
142
167
|
isSmall: isSmall,
|
|
143
168
|
isReducedSpacing: isReducedSpacing,
|
|
@@ -145,6 +170,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
145
170
|
disabled: false,
|
|
146
171
|
title: blockTypeTitles[0],
|
|
147
172
|
onClick: this.handleTriggerClick,
|
|
173
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
|
148
174
|
formatMessage: formatMessage,
|
|
149
175
|
"aria-expanded": active
|
|
150
176
|
}, longestDropdownMenuItem)), (0, _react2.jsx)("span", {
|
|
@@ -160,6 +186,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
160
186
|
disabled: true,
|
|
161
187
|
title: blockTypeTitles[0],
|
|
162
188
|
onClick: this.handleTriggerClick,
|
|
189
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
|
163
190
|
formatMessage: formatMessage,
|
|
164
191
|
"aria-expanded": active
|
|
165
192
|
}, longestDropdownMenuItem), (0, _react2.jsx)("span", {
|
|
@@ -133,11 +133,12 @@ var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
133
133
|
}, {
|
|
134
134
|
key: "render",
|
|
135
135
|
value: function render() {
|
|
136
|
+
var platform = this.reactComponentProps.platform;
|
|
136
137
|
return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
|
|
137
138
|
node: this.node,
|
|
138
139
|
view: this.view,
|
|
139
140
|
getPos: this.getPos,
|
|
140
|
-
platform:
|
|
141
|
+
platform: platform
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
144
|
}]);
|
|
@@ -18,6 +18,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
18
18
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
19
19
|
var _utils = require("../utils");
|
|
20
20
|
var _doc = require("../pm-plugins/doc");
|
|
21
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
22
|
+
var _state = require("../pm-plugins/util/state");
|
|
23
|
+
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
21
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
23
26
|
function Card(SmartCardComponent, UnsupportedComponent) {
|
|
@@ -40,6 +43,7 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
40
43
|
(0, _createClass2.default)(_class, [{
|
|
41
44
|
key: "render",
|
|
42
45
|
value: function render() {
|
|
46
|
+
var _getPluginState;
|
|
43
47
|
var _titleUrlPairFromNode = (0, _utils.titleUrlPairFromNode)(this.props.node),
|
|
44
48
|
url = _titleUrlPairFromNode.url;
|
|
45
49
|
if (url && !(0, _adfSchema.isSafeUrl)(url)) {
|
|
@@ -58,10 +62,20 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
64
|
var cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
|
|
61
|
-
|
|
65
|
+
var editorAppearance = (_getPluginState = (0, _state.getPluginState)(this.props.view.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.editorAppearance;
|
|
66
|
+
var analyticsEditorAppearance = (0, _utils2.getAnalyticsEditorAppearance)(editorAppearance);
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
68
|
+
data: {
|
|
69
|
+
attributes: {
|
|
70
|
+
location: analyticsEditorAppearance
|
|
71
|
+
},
|
|
72
|
+
// Below is added for the future implementation of Linking Platform namespaced analytics context
|
|
73
|
+
location: analyticsEditorAppearance
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(SmartCardComponent, (0, _extends2.default)({
|
|
62
76
|
key: url,
|
|
63
77
|
cardContext: cardContext
|
|
64
|
-
}, this.props));
|
|
78
|
+
}, this.props)));
|
|
65
79
|
}
|
|
66
80
|
}, {
|
|
67
81
|
key: "componentDidCatch",
|
|
@@ -23,7 +23,8 @@ var _resolve = require("./util/resolve");
|
|
|
23
23
|
var _state = require("./util/state");
|
|
24
24
|
var createPlugin = function createPlugin(options) {
|
|
25
25
|
return function (pmPluginFactoryParams) {
|
|
26
|
-
var
|
|
26
|
+
var editorAppearance = options.editorAppearance,
|
|
27
|
+
platform = options.platform,
|
|
27
28
|
allowResizing = options.allowResizing,
|
|
28
29
|
useAlternativePreloader = options.useAlternativePreloader,
|
|
29
30
|
fullWidthMode = options.fullWidthMode,
|
|
@@ -37,7 +38,8 @@ var createPlugin = function createPlugin(options) {
|
|
|
37
38
|
cards: [],
|
|
38
39
|
showLinkingToolbar: false,
|
|
39
40
|
smartLinkEvents: undefined,
|
|
40
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
41
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
42
|
+
editorAppearance: editorAppearance
|
|
41
43
|
};
|
|
42
44
|
},
|
|
43
45
|
apply: function apply(tr, pluginState) {
|
|
@@ -91,7 +91,10 @@ var createClipboardSerializer = function createClipboardSerializer(schema, getEd
|
|
|
91
91
|
var parentTable = (0, _prosemirrorUtils.findParentNodeOfType)(schema.nodes.table)(selection);
|
|
92
92
|
var attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
|
|
93
93
|
var newTable = schema.nodes.table;
|
|
94
|
-
|
|
94
|
+
// Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
|
|
95
|
+
var newTableNode = newTable.createChecked(_objectSpread(_objectSpread({}, attributes), {}, {
|
|
96
|
+
localId: undefined
|
|
97
|
+
}), content);
|
|
95
98
|
var newContent = _prosemirrorModel.Fragment.from(newTableNode);
|
|
96
99
|
// Pass updated content into original ProseMirror serializeFragment function.
|
|
97
100
|
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
@@ -21,10 +21,9 @@ var _initialize = require("./events/initialize");
|
|
|
21
21
|
var _pluginState = require("./plugin-state");
|
|
22
22
|
var _pluginKey = require("./plugin-key");
|
|
23
23
|
var _analytics = require("./analytics");
|
|
24
|
-
var
|
|
25
|
-
var _analytics2 = require("../analytics");
|
|
24
|
+
var _analytics2 = require("@atlaskit/editor-common/analytics");
|
|
26
25
|
var createPlugin = function createPlugin(dispatch, providerFactory, collabProviderCallback, options) {
|
|
27
|
-
var fireAnalyticsCallback = (0,
|
|
26
|
+
var fireAnalyticsCallback = (0, _analytics2.fireAnalyticsEvent)(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
28
27
|
return new _safePlugin.SafePlugin({
|
|
29
28
|
key: _pluginKey.pluginKey,
|
|
30
29
|
state: {
|
|
@@ -32,6 +32,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
32
32
|
defaultMessage: 'Delete element',
|
|
33
33
|
description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
|
|
34
34
|
},
|
|
35
|
+
unnamedSource: {
|
|
36
|
+
id: 'fabric.editor.extension.sourceNoTitledName',
|
|
37
|
+
defaultMessage: 'this element',
|
|
38
|
+
description: 'The current element without preset name been selected'
|
|
39
|
+
},
|
|
35
40
|
confirmDeleteLinkedModalOKButton: {
|
|
36
41
|
id: 'fabric.editor.extension.confirmDeleteLinkedModalOKButton',
|
|
37
42
|
defaultMessage: 'Delete',
|
|
@@ -130,11 +135,12 @@ var getToolbarConfig = function getToolbarConfig() {
|
|
|
130
135
|
var confirmDialog;
|
|
131
136
|
if ((0, _utils2.isReferencedSource)(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)) {
|
|
132
137
|
confirmDialog = function confirmDialog() {
|
|
138
|
+
var localSourceName = formatMessage(messages.unnamedSource);
|
|
133
139
|
return {
|
|
134
140
|
title: formatMessage(messages.deleteElementTitle),
|
|
135
141
|
okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
|
|
136
142
|
message: formatMessage(messages.confirmDeleteLinkedModalMessage, {
|
|
137
|
-
nodeName: (0, _utils2.getNodeName)(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
|
|
143
|
+
nodeName: (0, _utils2.getNodeName)(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node) || localSourceName
|
|
138
144
|
}),
|
|
139
145
|
isReferentialityDialog: true,
|
|
140
146
|
getChildrenInfo: function getChildrenInfo() {
|
|
@@ -26,6 +26,7 @@ var _FindReplace = _interopRequireDefault(require("./FindReplace"));
|
|
|
26
26
|
var _types = require("../../analytics/types");
|
|
27
27
|
var _keymaps = require("../../../keymaps");
|
|
28
28
|
var _keymaps2 = require("@atlaskit/editor-common/keymaps");
|
|
29
|
+
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
29
30
|
var _templateObject, _templateObject2, _templateObject3;
|
|
30
31
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -97,7 +98,10 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
97
98
|
},
|
|
98
99
|
fitWidth: 352,
|
|
99
100
|
zIndex: stackBelowOtherEditorFloatingPanels,
|
|
100
|
-
|
|
101
|
+
arrowKeyNavigationProviderOptions: {
|
|
102
|
+
type: _uiMenu.ArrowKeyNavigationType.MENU,
|
|
103
|
+
disableArrowKeyNavigation: true
|
|
104
|
+
},
|
|
101
105
|
trigger: (0, _react2.jsx)(_ToolbarButton.default, {
|
|
102
106
|
buttonId: _ToolbarButton.TOOLBAR_BUTTON.FIND_REPLACE,
|
|
103
107
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -19,6 +19,7 @@ var _default = function _default(_ref) {
|
|
|
19
19
|
icon = _ref.icon,
|
|
20
20
|
iconAfter = _ref.iconAfter,
|
|
21
21
|
onClick = _ref.onClick,
|
|
22
|
+
onKeyDown = _ref.onKeyDown,
|
|
22
23
|
onMouseEnter = _ref.onMouseEnter,
|
|
23
24
|
onMouseLeave = _ref.onMouseLeave,
|
|
24
25
|
onFocus = _ref.onFocus,
|
|
@@ -71,6 +72,7 @@ var _default = function _default(_ref) {
|
|
|
71
72
|
iconBefore: icon || undefined,
|
|
72
73
|
iconAfter: iconAfter,
|
|
73
74
|
onClick: onClick,
|
|
75
|
+
onKeyDown: onKeyDown,
|
|
74
76
|
isSelected: selected,
|
|
75
77
|
isDisabled: disabled,
|
|
76
78
|
testId: testId,
|
|
@@ -16,6 +16,7 @@ var _messages = _interopRequireDefault(require("./messages"));
|
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
18
|
var CheckboxModal = function CheckboxModal(props) {
|
|
19
|
+
var _options$getChildrenI;
|
|
19
20
|
var _useState = (0, _react.useState)(false),
|
|
20
21
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
21
22
|
isChecked = _useState2[0],
|
|
@@ -29,9 +30,10 @@ var CheckboxModal = function CheckboxModal(props) {
|
|
|
29
30
|
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
|
|
30
31
|
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
|
|
31
32
|
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
33
|
+
var childrenInfo = options === null || options === void 0 ? void 0 : (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
|
|
32
34
|
var ListComponent = function ListComponent(_ref) {
|
|
33
35
|
var nodes = _ref.nodes;
|
|
34
|
-
if (
|
|
36
|
+
if (nodes.length === 0) {
|
|
35
37
|
return null;
|
|
36
38
|
}
|
|
37
39
|
return /*#__PURE__*/_react.default.createElement("ul", null, nodes.map(function (node) {
|
|
@@ -56,8 +58,8 @@ var CheckboxModal = function CheckboxModal(props) {
|
|
|
56
58
|
testId: testId
|
|
57
59
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
58
60
|
appearance: "warning"
|
|
59
|
-
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (
|
|
60
|
-
nodes:
|
|
61
|
+
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), !!(childrenInfo !== null && childrenInfo !== void 0 && childrenInfo.length) && /*#__PURE__*/_react.default.createElement(ListComponent, {
|
|
62
|
+
nodes: childrenInfo
|
|
61
63
|
}), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
|
|
62
64
|
isChecked: isChecked,
|
|
63
65
|
onChange: function onChange() {
|