@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
|
@@ -6,6 +6,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
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; }
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
12
|
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; } }
|
|
11
13
|
/** @jsx jsx */
|
|
@@ -31,18 +33,30 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
31
33
|
}
|
|
32
34
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
33
35
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
34
|
-
active: false
|
|
36
|
+
active: false,
|
|
37
|
+
isOpenedByKeyboard: false
|
|
35
38
|
});
|
|
36
39
|
_defineProperty(_assertThisInitialized(_this), "onOpenChange", function (attrs) {
|
|
37
|
-
_this.setState({
|
|
38
|
-
active: attrs.isOpen
|
|
39
|
-
|
|
40
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
41
|
+
active: attrs.isOpen,
|
|
42
|
+
isOpenedByKeyboard: attrs.isOpenedByKeyboard
|
|
43
|
+
}));
|
|
40
44
|
});
|
|
41
45
|
_defineProperty(_assertThisInitialized(_this), "handleTriggerClick", function () {
|
|
42
46
|
_this.onOpenChange({
|
|
43
|
-
isOpen: !_this.state.active
|
|
47
|
+
isOpen: !_this.state.active,
|
|
48
|
+
isOpenedByKeyboard: false
|
|
44
49
|
});
|
|
45
50
|
});
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "handleTriggerByKeyboard", function (event) {
|
|
52
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
_this.onOpenChange({
|
|
55
|
+
isOpen: !_this.state.active,
|
|
56
|
+
isOpenedByKeyboard: true
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
46
60
|
_defineProperty(_assertThisInitialized(_this), "createItems", function () {
|
|
47
61
|
var formatMessage = _this.props.intl.formatMessage;
|
|
48
62
|
var _this$props$pluginSta = _this.props.pluginState,
|
|
@@ -79,9 +93,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
79
93
|
var blockType = item.value;
|
|
80
94
|
_this.props.setBlockType(blockType.name);
|
|
81
95
|
if (shouldCloseMenu) {
|
|
82
|
-
_this.setState({
|
|
96
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
83
97
|
active: false
|
|
84
|
-
});
|
|
98
|
+
}));
|
|
85
99
|
}
|
|
86
100
|
});
|
|
87
101
|
return _this;
|
|
@@ -89,7 +103,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
89
103
|
_createClass(ToolbarBlockType, [{
|
|
90
104
|
key: "render",
|
|
91
105
|
value: function render() {
|
|
92
|
-
var
|
|
106
|
+
var _this2 = this;
|
|
107
|
+
var _this$state = this.state,
|
|
108
|
+
active = _this$state.active,
|
|
109
|
+
isOpenedByKeyboard = _this$state.isOpenedByKeyboard;
|
|
93
110
|
var _this$props = this.props,
|
|
94
111
|
popupsMountPoint = _this$props.popupsMountPoint,
|
|
95
112
|
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
@@ -131,7 +148,15 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
131
148
|
zIndex: akEditorMenuZIndex,
|
|
132
149
|
fitHeight: 360,
|
|
133
150
|
fitWidth: 106,
|
|
134
|
-
shouldUseDefaultRole: true
|
|
151
|
+
shouldUseDefaultRole: true,
|
|
152
|
+
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
153
|
+
if (isOpenedByKeyboard) {
|
|
154
|
+
_this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {
|
|
155
|
+
isOpenedByKeyboard: false
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
return isOpenedByKeyboard;
|
|
159
|
+
}
|
|
135
160
|
}, jsx(BlockTypeButton, {
|
|
136
161
|
isSmall: isSmall,
|
|
137
162
|
isReducedSpacing: isReducedSpacing,
|
|
@@ -139,6 +164,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
139
164
|
disabled: false,
|
|
140
165
|
title: blockTypeTitles[0],
|
|
141
166
|
onClick: this.handleTriggerClick,
|
|
167
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
|
142
168
|
formatMessage: formatMessage,
|
|
143
169
|
"aria-expanded": active
|
|
144
170
|
}, longestDropdownMenuItem)), jsx("span", {
|
|
@@ -154,6 +180,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
154
180
|
disabled: true,
|
|
155
181
|
title: blockTypeTitles[0],
|
|
156
182
|
onClick: this.handleTriggerClick,
|
|
183
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
|
157
184
|
formatMessage: formatMessage,
|
|
158
185
|
"aria-expanded": active
|
|
159
186
|
}, longestDropdownMenuItem), jsx("span", {
|
|
@@ -126,11 +126,12 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
126
126
|
}, {
|
|
127
127
|
key: "render",
|
|
128
128
|
value: function render() {
|
|
129
|
+
var platform = this.reactComponentProps.platform;
|
|
129
130
|
return /*#__PURE__*/React.createElement(WrappedBlockCard, {
|
|
130
131
|
node: this.node,
|
|
131
132
|
view: this.view,
|
|
132
133
|
getPos: this.getPos,
|
|
133
|
-
platform:
|
|
134
|
+
platform: platform
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
}]);
|
|
@@ -13,6 +13,9 @@ import PropTypes from 'prop-types';
|
|
|
13
13
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
14
14
|
import { titleUrlPairFromNode } from '../utils';
|
|
15
15
|
import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
|
|
16
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
17
|
+
import { getPluginState } from '../pm-plugins/util/state';
|
|
18
|
+
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
16
19
|
export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
17
20
|
var _class;
|
|
18
21
|
return _class = /*#__PURE__*/function (_React$Component) {
|
|
@@ -33,6 +36,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
33
36
|
_createClass(_class, [{
|
|
34
37
|
key: "render",
|
|
35
38
|
value: function render() {
|
|
39
|
+
var _getPluginState;
|
|
36
40
|
var _titleUrlPairFromNode = titleUrlPairFromNode(this.props.node),
|
|
37
41
|
url = _titleUrlPairFromNode.url;
|
|
38
42
|
if (url && !isSafeUrl(url)) {
|
|
@@ -51,10 +55,20 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
var cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
|
|
54
|
-
|
|
58
|
+
var editorAppearance = (_getPluginState = getPluginState(this.props.view.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.editorAppearance;
|
|
59
|
+
var analyticsEditorAppearance = getAnalyticsEditorAppearance(editorAppearance);
|
|
60
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
61
|
+
data: {
|
|
62
|
+
attributes: {
|
|
63
|
+
location: analyticsEditorAppearance
|
|
64
|
+
},
|
|
65
|
+
// Below is added for the future implementation of Linking Platform namespaced analytics context
|
|
66
|
+
location: analyticsEditorAppearance
|
|
67
|
+
}
|
|
68
|
+
}, /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
55
69
|
key: url,
|
|
56
70
|
cardContext: cardContext
|
|
57
|
-
}, this.props));
|
|
71
|
+
}, this.props)));
|
|
58
72
|
}
|
|
59
73
|
}, {
|
|
60
74
|
key: "componentDidCatch",
|
|
@@ -11,7 +11,8 @@ import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './
|
|
|
11
11
|
export { pluginKey } from './plugin-key';
|
|
12
12
|
export var createPlugin = function createPlugin(options) {
|
|
13
13
|
return function (pmPluginFactoryParams) {
|
|
14
|
-
var
|
|
14
|
+
var editorAppearance = options.editorAppearance,
|
|
15
|
+
platform = options.platform,
|
|
15
16
|
allowResizing = options.allowResizing,
|
|
16
17
|
useAlternativePreloader = options.useAlternativePreloader,
|
|
17
18
|
fullWidthMode = options.fullWidthMode,
|
|
@@ -25,7 +26,8 @@ export var createPlugin = function createPlugin(options) {
|
|
|
25
26
|
cards: [],
|
|
26
27
|
showLinkingToolbar: false,
|
|
27
28
|
smartLinkEvents: undefined,
|
|
28
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
29
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
30
|
+
editorAppearance: editorAppearance
|
|
29
31
|
};
|
|
30
32
|
},
|
|
31
33
|
apply: function apply(tr, pluginState) {
|
|
@@ -84,7 +84,10 @@ export var createClipboardSerializer = function createClipboardSerializer(schema
|
|
|
84
84
|
var parentTable = findParentNodeOfType(schema.nodes.table)(selection);
|
|
85
85
|
var attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
|
|
86
86
|
var newTable = schema.nodes.table;
|
|
87
|
-
|
|
87
|
+
// Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
|
|
88
|
+
var newTableNode = newTable.createChecked(_objectSpread(_objectSpread({}, attributes), {}, {
|
|
89
|
+
localId: undefined
|
|
90
|
+
}), content);
|
|
88
91
|
var newContent = Fragment.from(newTableNode);
|
|
89
92
|
// Pass updated content into original ProseMirror serializeFragment function.
|
|
90
93
|
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
@@ -3,8 +3,7 @@ import { initialize } from './events/initialize';
|
|
|
3
3
|
import { PluginState } from './plugin-state';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
5
|
import { addSynchronyErrorAnalytics } from './analytics';
|
|
6
|
-
import { fireAnalyticsEvent } from '
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
6
|
+
import { fireAnalyticsEvent, ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
7
|
export { PluginState, pluginKey };
|
|
9
8
|
export var createPlugin = function createPlugin(dispatch, providerFactory, collabProviderCallback, options) {
|
|
10
9
|
var fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
@@ -25,6 +25,11 @@ export var messages = defineMessages({
|
|
|
25
25
|
defaultMessage: 'Delete element',
|
|
26
26
|
description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
|
|
27
27
|
},
|
|
28
|
+
unnamedSource: {
|
|
29
|
+
id: 'fabric.editor.extension.sourceNoTitledName',
|
|
30
|
+
defaultMessage: 'this element',
|
|
31
|
+
description: 'The current element without preset name been selected'
|
|
32
|
+
},
|
|
28
33
|
confirmDeleteLinkedModalOKButton: {
|
|
29
34
|
id: 'fabric.editor.extension.confirmDeleteLinkedModalOKButton',
|
|
30
35
|
defaultMessage: 'Delete',
|
|
@@ -122,11 +127,12 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
122
127
|
var confirmDialog;
|
|
123
128
|
if (isReferencedSource(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)) {
|
|
124
129
|
confirmDialog = function confirmDialog() {
|
|
130
|
+
var localSourceName = formatMessage(messages.unnamedSource);
|
|
125
131
|
return {
|
|
126
132
|
title: formatMessage(messages.deleteElementTitle),
|
|
127
133
|
okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
|
|
128
134
|
message: formatMessage(messages.confirmDeleteLinkedModalMessage, {
|
|
129
|
-
nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
|
|
135
|
+
nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node) || localSourceName
|
|
130
136
|
}),
|
|
131
137
|
isReferentialityDialog: true,
|
|
132
138
|
getChildrenInfo: function getChildrenInfo() {
|
|
@@ -22,6 +22,7 @@ import FindReplace from './FindReplace';
|
|
|
22
22
|
import { TRIGGER_METHOD } from '../../analytics/types';
|
|
23
23
|
import { ToolTipContent, findKeymapByDescription, tooltip } from '../../../keymaps';
|
|
24
24
|
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
25
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
25
26
|
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1 1 auto;\n flex-grow: 0;\n justify-content: flex-end;\n align-items: center;\n padding: 0 8px;\n @media (max-width: ", "px) {\n justify-content: center;\n padding: 0;\n }\n"])), akEditorMobileMaxWidth);
|
|
26
27
|
var toolbarButtonWrapperFullWith = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n"])));
|
|
27
28
|
var wrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
@@ -88,7 +89,10 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
88
89
|
},
|
|
89
90
|
fitWidth: 352,
|
|
90
91
|
zIndex: stackBelowOtherEditorFloatingPanels,
|
|
91
|
-
|
|
92
|
+
arrowKeyNavigationProviderOptions: {
|
|
93
|
+
type: ArrowKeyNavigationType.MENU,
|
|
94
|
+
disableArrowKeyNavigation: true
|
|
95
|
+
},
|
|
92
96
|
trigger: jsx(ToolbarButton, {
|
|
93
97
|
buttonId: TOOLBAR_BUTTON.FIND_REPLACE,
|
|
94
98
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -12,6 +12,7 @@ export default (function (_ref) {
|
|
|
12
12
|
icon = _ref.icon,
|
|
13
13
|
iconAfter = _ref.iconAfter,
|
|
14
14
|
onClick = _ref.onClick,
|
|
15
|
+
onKeyDown = _ref.onKeyDown,
|
|
15
16
|
onMouseEnter = _ref.onMouseEnter,
|
|
16
17
|
onMouseLeave = _ref.onMouseLeave,
|
|
17
18
|
onFocus = _ref.onFocus,
|
|
@@ -64,6 +65,7 @@ export default (function (_ref) {
|
|
|
64
65
|
iconBefore: icon || undefined,
|
|
65
66
|
iconAfter: iconAfter,
|
|
66
67
|
onClick: onClick,
|
|
68
|
+
onKeyDown: onKeyDown,
|
|
67
69
|
isSelected: selected,
|
|
68
70
|
isDisabled: disabled,
|
|
69
71
|
testId: testId,
|
|
@@ -6,6 +6,7 @@ import { Checkbox } from '@atlaskit/checkbox';
|
|
|
6
6
|
import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
7
7
|
import messages from './messages';
|
|
8
8
|
export var CheckboxModal = function CheckboxModal(props) {
|
|
9
|
+
var _options$getChildrenI;
|
|
9
10
|
var _useState = useState(false),
|
|
10
11
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11
12
|
isChecked = _useState2[0],
|
|
@@ -19,9 +20,10 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
19
20
|
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
20
21
|
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
21
22
|
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
23
|
+
var childrenInfo = options === null || options === void 0 ? void 0 : (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
|
|
22
24
|
var ListComponent = function ListComponent(_ref) {
|
|
23
25
|
var nodes = _ref.nodes;
|
|
24
|
-
if (
|
|
26
|
+
if (nodes.length === 0) {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
27
29
|
return /*#__PURE__*/React.createElement("ul", null, nodes.map(function (node) {
|
|
@@ -46,8 +48,8 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
46
48
|
testId: testId
|
|
47
49
|
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
48
50
|
appearance: "warning"
|
|
49
|
-
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (
|
|
50
|
-
nodes:
|
|
51
|
+
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), !!(childrenInfo !== null && childrenInfo !== void 0 && childrenInfo.length) && /*#__PURE__*/React.createElement(ListComponent, {
|
|
52
|
+
nodes: childrenInfo
|
|
51
53
|
}), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
52
54
|
isChecked: isChecked,
|
|
53
55
|
onChange: function onChange() {
|
|
@@ -7,6 +7,8 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
9
|
var _templateObject, _templateObject2;
|
|
10
|
+
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; }
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
13
|
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; } }
|
|
12
14
|
/** @jsx jsx */
|
|
@@ -39,8 +41,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
39
41
|
}
|
|
40
42
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
43
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
42
|
-
isOpen: false
|
|
44
|
+
isOpen: false,
|
|
45
|
+
isOpenedByKeyboard: false
|
|
43
46
|
});
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "triggerRef", /*#__PURE__*/React.createRef());
|
|
44
48
|
_defineProperty(_assertThisInitialized(_this), "renderArrayOptions", function (options) {
|
|
45
49
|
var _this$props = _this.props,
|
|
46
50
|
showSelected = _this$props.showSelected,
|
|
@@ -56,15 +60,25 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
56
60
|
});
|
|
57
61
|
_defineProperty(_assertThisInitialized(_this), "toggleOpen", function () {
|
|
58
62
|
_this.setState({
|
|
59
|
-
isOpen: !_this.state.isOpen
|
|
63
|
+
isOpen: !_this.state.isOpen,
|
|
64
|
+
isOpenedByKeyboard: false
|
|
60
65
|
});
|
|
61
66
|
});
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "toggleOpenByKeyboard", function (event) {
|
|
68
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
_this.setState({
|
|
71
|
+
isOpen: !_this.state.isOpen,
|
|
72
|
+
isOpenedByKeyboard: true
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
62
76
|
_defineProperty(_assertThisInitialized(_this), "hide", function () {
|
|
63
|
-
_this.setState({
|
|
77
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
64
78
|
isOpen: false
|
|
65
|
-
});
|
|
79
|
+
}));
|
|
66
80
|
});
|
|
67
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "hideOnEsc", function () {
|
|
68
82
|
var _document$querySelect;
|
|
69
83
|
_this.hide();
|
|
70
84
|
//Focus the trigger button only on Escape
|
|
@@ -73,7 +87,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
73
87
|
_defineProperty(_assertThisInitialized(_this), "onOpenChanged", function (openChangedEvent) {
|
|
74
88
|
if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
|
|
75
89
|
var _openChangedEvent$eve;
|
|
76
|
-
((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? _this.
|
|
90
|
+
((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? _this.hideOnEsc() : _this.hide();
|
|
77
91
|
}
|
|
78
92
|
});
|
|
79
93
|
return _this;
|
|
@@ -106,6 +120,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
106
120
|
title: title,
|
|
107
121
|
icon: TriggerIcon,
|
|
108
122
|
onClick: this.toggleOpen,
|
|
123
|
+
onKeyDown: this.toggleOpenByKeyboard,
|
|
109
124
|
selected: isOpen,
|
|
110
125
|
disabled: disabled,
|
|
111
126
|
tooltipContent: tooltip
|
|
@@ -119,6 +134,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
119
134
|
label: "Expand dropdown menu"
|
|
120
135
|
})),
|
|
121
136
|
onClick: this.toggleOpen,
|
|
137
|
+
onKeyDown: this.toggleOpenByKeyboard,
|
|
122
138
|
selected: isOpen,
|
|
123
139
|
disabled: disabled,
|
|
124
140
|
tooltipContent: tooltip
|
|
@@ -133,12 +149,13 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
133
149
|
var fitWidth = Array.isArray(options) ? dropdownWidth || menuItemDimensions.width : options.width;
|
|
134
150
|
var fitHeight = Array.isArray(options) ? options.length * menuItemDimensions.height + itemSpacing * 2 : options.height;
|
|
135
151
|
return jsx(UiDropdown, {
|
|
152
|
+
ref: this.triggerRef,
|
|
136
153
|
mountTo: mountPoint,
|
|
137
154
|
boundariesElement: boundariesElement,
|
|
138
155
|
scrollableElement: scrollableElement,
|
|
139
156
|
isOpen: isOpen,
|
|
140
157
|
handleClickOutside: this.hide,
|
|
141
|
-
handleEscapeKeydown: this.
|
|
158
|
+
handleEscapeKeydown: this.hideOnEsc,
|
|
142
159
|
onOpenChange: this.onOpenChanged,
|
|
143
160
|
fitWidth: fitWidth + fitTolerance,
|
|
144
161
|
fitHeight: fitHeight + fitTolerance,
|
|
@@ -152,8 +169,20 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
152
169
|
}, {
|
|
153
170
|
key: "componentDidUpdate",
|
|
154
171
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
155
|
-
if (
|
|
156
|
-
this.props.setDisableParentScroll
|
|
172
|
+
if (prevState.isOpen !== this.state.isOpen) {
|
|
173
|
+
if (this.props.setDisableParentScroll) {
|
|
174
|
+
this.props.setDisableParentScroll(this.state.isOpen);
|
|
175
|
+
}
|
|
176
|
+
if (this.state.isOpen && this.state.isOpenedByKeyboard) {
|
|
177
|
+
var dropList = document.querySelector('[data-role="droplistContent"]');
|
|
178
|
+
if (dropList) {
|
|
179
|
+
var keyboardEvent = new KeyboardEvent('keydown', {
|
|
180
|
+
bubbles: true,
|
|
181
|
+
key: 'ArrowDown'
|
|
182
|
+
});
|
|
183
|
+
dropList.dispatchEvent(keyboardEvent);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
157
186
|
}
|
|
158
187
|
}
|
|
159
188
|
}]);
|
|
@@ -48,28 +48,30 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
48
48
|
var item = props.item,
|
|
49
49
|
node = props.node,
|
|
50
50
|
editorView = props.editorView;
|
|
51
|
-
var ButtonIcon =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
var ButtonIcon = React.useMemo(function () {
|
|
52
|
+
return item.icon ? Loadable({
|
|
53
|
+
loader: function () {
|
|
54
|
+
var _loader = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
55
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
56
|
+
while (1) {
|
|
57
|
+
switch (_context2.prev = _context2.next) {
|
|
58
|
+
case 0:
|
|
59
|
+
return _context2.abrupt("return", resolveExtensionIcon(item.icon));
|
|
60
|
+
case 1:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context2.stop();
|
|
63
|
+
}
|
|
62
64
|
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})
|
|
65
|
+
}, _callee2);
|
|
66
|
+
}));
|
|
67
|
+
function loader() {
|
|
68
|
+
return _loader.apply(this, arguments);
|
|
69
|
+
}
|
|
70
|
+
return loader;
|
|
71
|
+
}(),
|
|
72
|
+
loading: noop
|
|
73
|
+
}) : undefined;
|
|
74
|
+
}, [item.icon]);
|
|
73
75
|
var onClick = function onClick() {
|
|
74
76
|
if (typeof item.action !== 'function') {
|
|
75
77
|
throw new Error("'action' of context toolbar item '".concat(item.key, "' is not a function"));
|
|
@@ -87,19 +87,14 @@ export default (function (_ref) {
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
useEffect(function () {
|
|
90
|
-
var scrollContainerRefCurrent = scrollContainerRef.current;
|
|
91
90
|
onScroll();
|
|
91
|
+
var scrollContainerRefCurrent = scrollContainerRef.current;
|
|
92
92
|
if (scrollContainerRefCurrent) {
|
|
93
93
|
// enable/disable scroll buttons depending on scroll position
|
|
94
94
|
scrollContainerRefCurrent.addEventListener('scroll', onScroll);
|
|
95
95
|
|
|
96
96
|
// watch for toolbar resize and show/hide scroll buttons if needed
|
|
97
97
|
resizeObserver.observe(scrollContainerRefCurrent);
|
|
98
|
-
|
|
99
|
-
// reset scroll position when switching from one node with toolbar to another
|
|
100
|
-
scrollContainerRefCurrent.scrollTo({
|
|
101
|
-
left: 0
|
|
102
|
-
});
|
|
103
98
|
}
|
|
104
99
|
return function () {
|
|
105
100
|
if (scrollContainerRefCurrent) {
|
|
@@ -108,7 +103,17 @@ export default (function (_ref) {
|
|
|
108
103
|
}
|
|
109
104
|
};
|
|
110
105
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
-
}, [
|
|
106
|
+
}, []);
|
|
107
|
+
useEffect(function () {
|
|
108
|
+
var scrollContainerRefCurrent = scrollContainerRef.current;
|
|
109
|
+
if (scrollContainerRefCurrent) {
|
|
110
|
+
// reset scroll position when switching from one node with toolbar to another
|
|
111
|
+
scrollContainerRefCurrent.scrollTo({
|
|
112
|
+
left: 0
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
116
|
+
}, [node.type]);
|
|
112
117
|
return needScroll ? jsx("div", {
|
|
113
118
|
ref: buttonsContainerRef,
|
|
114
119
|
css: toolbarScrollButtons,
|
|
@@ -15,6 +15,7 @@ import React from 'react';
|
|
|
15
15
|
import { css, jsx } from '@emotion/react';
|
|
16
16
|
import { Component } from 'react';
|
|
17
17
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
18
|
+
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
18
19
|
import { themed } from '@atlaskit/theme/components';
|
|
19
20
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
20
21
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
@@ -174,6 +175,15 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
174
175
|
placement: "Panels",
|
|
175
176
|
mountPoint: emojiAndColourPickerMountPoint,
|
|
176
177
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined
|
|
178
|
+
// Currently in floating toolbar, color picker is only
|
|
179
|
+
// used in panel and table cell background color.
|
|
180
|
+
// Both uses same color palette.
|
|
181
|
+
// That's why hard-coding hexToEditorBackgroundPaletteColor.
|
|
182
|
+
// When we need to support different color palette
|
|
183
|
+
// in floating toolbar, we need to set hexToPaletteColor
|
|
184
|
+
// in item options.
|
|
185
|
+
,
|
|
186
|
+
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
177
187
|
});
|
|
178
188
|
}
|
|
179
189
|
if (item.selectType === 'emoji') {
|
|
@@ -433,6 +443,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
433
443
|
text: intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
434
444
|
delay: 250
|
|
435
445
|
}), jsx("div", {
|
|
446
|
+
"data-testid": "floating-toolbar-items",
|
|
436
447
|
ref: this.scrollContainerRef,
|
|
437
448
|
css: toolbarOverflow(scrollable, this.state.scrollDisabled, firstElementIsSelect)
|
|
438
449
|
}, jsx(ToolbarItems, _extends({}, this.props, {
|
|
@@ -60,6 +60,7 @@ var regenerateFragmentIdIfNeeded = function regenerateFragmentIdIfNeeded(_ref) {
|
|
|
60
60
|
transaction.setNodeMarkup(pos, undefined, node.attrs, node.marks.map(function (mark) {
|
|
61
61
|
if (mark.type === fragment) {
|
|
62
62
|
mark.attrs.localId = uuid.generate();
|
|
63
|
+
mark.attrs.name = null;
|
|
63
64
|
}
|
|
64
65
|
return mark;
|
|
65
66
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics/types';
|
|
2
2
|
import { getLinkDomain, isFromCurrentDomain } from './utils';
|
|
3
3
|
export function getLinkCreationAnalyticsEvent(inputMethod, url) {
|
|
4
4
|
return {
|
|
@@ -27,7 +27,7 @@ var hyperlinkPlugin = function hyperlinkPlugin(options) {
|
|
|
27
27
|
name: 'hyperlink',
|
|
28
28
|
plugin: function plugin(_ref) {
|
|
29
29
|
var dispatch = _ref.dispatch;
|
|
30
|
-
return _plugin(dispatch);
|
|
30
|
+
return _plugin(dispatch, options === null || options === void 0 ? void 0 : options.editorAppearance);
|
|
31
31
|
}
|
|
32
32
|
}, {
|
|
33
33
|
name: 'fakeCursorToolbarPlugin',
|
|
@@ -182,7 +182,7 @@ var getActiveText = function getActiveText(selection) {
|
|
|
182
182
|
return;
|
|
183
183
|
};
|
|
184
184
|
export var stateKey = new PluginKey('hyperlinkPlugin');
|
|
185
|
-
export var plugin = function plugin(dispatch) {
|
|
185
|
+
export var plugin = function plugin(dispatch, editorAppearance) {
|
|
186
186
|
return new SafePlugin({
|
|
187
187
|
state: {
|
|
188
188
|
init: function init(_, state) {
|
|
@@ -191,7 +191,8 @@ export var plugin = function plugin(dispatch) {
|
|
|
191
191
|
activeText: getActiveText(state.selection),
|
|
192
192
|
canInsertLink: canInsertLink,
|
|
193
193
|
timesViewed: 0,
|
|
194
|
-
activeLinkMark: toState(undefined, LinkAction.SELECTION_CHANGE, state)
|
|
194
|
+
activeLinkMark: toState(undefined, LinkAction.SELECTION_CHANGE, state),
|
|
195
|
+
editorAppearance: editorAppearance
|
|
195
196
|
};
|
|
196
197
|
},
|
|
197
198
|
apply: function apply(tr, pluginState, oldState, newState) {
|
|
@@ -204,7 +205,8 @@ export var plugin = function plugin(dispatch) {
|
|
|
204
205
|
canInsertLink: canLinkBeCreatedInRange(newState.selection.from, newState.selection.to)(newState),
|
|
205
206
|
timesViewed: state.timesViewed,
|
|
206
207
|
inputMethod: inputMethod,
|
|
207
|
-
activeLinkMark: mapTransactionToState(state.activeLinkMark, tr)
|
|
208
|
+
activeLinkMark: mapTransactionToState(state.activeLinkMark, tr),
|
|
209
|
+
editorAppearance: editorAppearance
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
212
|
if (action) {
|
|
@@ -219,7 +221,8 @@ export var plugin = function plugin(dispatch) {
|
|
|
219
221
|
activeText: state.activeText,
|
|
220
222
|
canInsertLink: state.canInsertLink,
|
|
221
223
|
inputMethod: inputMethod,
|
|
222
|
-
activeLinkMark: toState(state.activeLinkMark, action, newState)
|
|
224
|
+
activeLinkMark: toState(state.activeLinkMark, action, newState),
|
|
225
|
+
editorAppearance: editorAppearance
|
|
223
226
|
}, stateForAnalytics);
|
|
224
227
|
}
|
|
225
228
|
var hasPositionChanged = oldState.selection.from !== newState.selection.from || oldState.selection.to !== newState.selection.to;
|
|
@@ -230,7 +233,8 @@ export var plugin = function plugin(dispatch) {
|
|
|
230
233
|
activeLinkMark: toState(state.activeLinkMark, LinkAction.SELECTION_CHANGE, newState),
|
|
231
234
|
timesViewed: state.timesViewed,
|
|
232
235
|
searchSessionId: state.searchSessionId,
|
|
233
|
-
inputMethod: inputMethod
|
|
236
|
+
inputMethod: inputMethod,
|
|
237
|
+
editorAppearance: editorAppearance
|
|
234
238
|
};
|
|
235
239
|
}
|
|
236
240
|
if (!shallowEqual(state, pluginState)) {
|