@atlaskit/editor-core 180.0.0 → 181.0.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 +117 -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 +26 -11
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/cjs/create-editor/ReactEditorView.js +9 -764
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +753 -0
- package/dist/cjs/create-editor/ReactEditorViewNext.js +16 -0
- package/dist/cjs/create-editor/create-plugins-list.js +31 -3
- package/dist/cjs/create-editor/feature-flags-from-props.js +3 -2
- package/dist/cjs/create-editor/preset-utils.js +27 -0
- package/dist/cjs/editor-next/editor-internal.js +147 -0
- package/dist/cjs/editor-next/editor-migration-component.js +51 -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 +73 -0
- package/dist/cjs/editor-next/index.js +143 -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/getProvidersFromEditorProps.js +41 -0
- package/dist/cjs/editor-next/utils/handleProviders.js +51 -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 +139 -445
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/keymaps/consts.js +1 -16
- 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/cxhtml.js +56 -55
- package/dist/cjs/labs/next/presets/default.js +15 -42
- package/dist/cjs/labs/next/presets/mobile.js +76 -89
- package/dist/cjs/labs/next/presets/universal.js +337 -255
- package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
- 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 +11 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -11
- package/dist/cjs/plugins/annotation/utils.js +2 -36
- 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/pm-plugins/react-nodeview.js +2 -7
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +24 -25
- package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
- 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/caption/index.js +0 -7
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -3
- package/dist/cjs/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/cjs/plugins/card/pm-plugins/main.js +10 -5
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -1
- package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
- package/dist/cjs/plugins/collab-edit/plugin.js +2 -3
- package/dist/cjs/plugins/collab-edit/provider/index.js +1 -8
- package/dist/cjs/plugins/collab-edit/provider/types.js +1 -12
- package/dist/cjs/plugins/context-panel/index.js +1 -6
- package/dist/cjs/plugins/data-consumer/index.js +0 -8
- package/dist/cjs/plugins/date/utils/internal.js +0 -4
- package/dist/cjs/plugins/extension/commands.js +1 -8
- package/dist/cjs/plugins/extension/toolbar.js +7 -1
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/cjs/plugins/feedback-dialog/index.js +1 -4
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Button.js +9 -3
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +48 -14
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +24 -21
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +32 -5
- package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
- package/dist/cjs/plugins/fragment/index.js +0 -8
- package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/cjs/plugins/help-dialog/commands.js +2 -6
- 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/image-upload/pm-plugins/main.js +50 -12
- 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/layout/styles.js +10 -1
- package/dist/cjs/plugins/list/utils/find.js +0 -28
- package/dist/cjs/plugins/list/utils/indentation.js +1 -25
- package/dist/cjs/plugins/list/utils/node.js +0 -5
- package/dist/cjs/plugins/list/utils/selection.js +2 -15
- 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/media/utils/media-common.js +1 -20
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +100 -16
- package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +1 -3
- package/dist/cjs/plugins/mobile-dimensions/index.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/index.js +1 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +133 -88
- package/dist/cjs/plugins/paste/pm-plugins/main.js +12 -3
- package/dist/cjs/plugins/paste/util/index.js +0 -46
- package/dist/cjs/plugins/placeholder-text/index.js +2 -2
- package/dist/cjs/plugins/quick-insert/assets/index.js +1 -27
- package/dist/cjs/plugins/selection/gap-cursor/actions.js +49 -44
- package/dist/cjs/plugins/status/index.js +9 -3
- package/dist/cjs/plugins/status/ui/statusPicker.js +8 -2
- package/dist/cjs/plugins/status/utils.js +1 -15
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +48 -12
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- 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 -35
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
- package/dist/cjs/plugins/type-ahead/constants.js +1 -7
- package/dist/cjs/plugins/type-ahead/index.js +1 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -35
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +79 -106
- package/dist/cjs/plugins/type-ahead/utils.js +3 -22
- package/dist/cjs/test-utils.js +4 -12
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +43 -8
- package/dist/cjs/ui/ChromeCollapsed/index.js +1 -0
- package/dist/cjs/ui/CollapsedEditor/index.js +7 -13
- package/dist/cjs/ui/ColorPalette/index.js +18 -0
- package/dist/cjs/ui/ColorPickerButton/index.js +73 -7
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/cjs/ui/ConfigPanel/utils.js +4 -17
- package/dist/cjs/ui/ContentStyles/index.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/ModalElementBrowser.js +1 -1
- 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/ElementBrowser/constants.js +1 -3
- package/dist/cjs/ui/PanelTextInput/index.js +4 -4
- package/dist/cjs/ui/PortalProvider/index.js +5 -5
- package/dist/cjs/ui/Resizer/utils.js +1 -3
- package/dist/cjs/ui/WidthEmitter/index.js +29 -35
- package/dist/cjs/ui/styles.js +3 -7
- package/dist/cjs/utils/document.js +15 -0
- package/dist/cjs/utils/extensions.js +6 -7
- package/dist/cjs/utils/get-editor-plugins.js +30 -0
- package/dist/cjs/utils/index.js +9 -269
- package/dist/cjs/utils/input-rules.js +1 -15
- 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 +24 -10
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +3 -710
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +697 -0
- package/dist/es2019/create-editor/ReactEditorViewNext.js +7 -0
- package/dist/es2019/create-editor/create-plugins-list.js +26 -3
- package/dist/es2019/create-editor/feature-flags-from-props.js +3 -2
- package/dist/es2019/create-editor/preset-utils.js +15 -0
- package/dist/es2019/editor-next/editor-internal.js +142 -0
- package/dist/es2019/editor-next/editor-migration-component.js +27 -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 +62 -0
- package/dist/es2019/editor-next/index.js +96 -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/getProvidersFromEditorProps.js +36 -0
- package/dist/es2019/editor-next/utils/handleProviders.js +46 -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 +122 -398
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/keymaps/consts.js +7 -11
- 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/cxhtml.js +56 -53
- package/dist/es2019/labs/next/presets/default.js +18 -38
- package/dist/es2019/labs/next/presets/mobile.js +88 -88
- package/dist/es2019/labs/next/presets/universal.js +347 -263
- package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
- 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 +8 -2
- package/dist/es2019/plugins/analytics/utils.js +0 -4
- package/dist/es2019/plugins/annotation/utils.js +2 -30
- 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/pm-plugins/react-nodeview.js +1 -3
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +23 -23
- package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
- 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/caption/index.js +0 -2
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +10 -3
- package/dist/es2019/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/es2019/plugins/card/pm-plugins/main.js +9 -4
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +3 -1
- package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
- package/dist/es2019/plugins/collab-edit/plugin.js +1 -2
- package/dist/es2019/plugins/collab-edit/provider/index.js +1 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +1 -10
- package/dist/es2019/plugins/context-panel/index.js +0 -3
- package/dist/es2019/plugins/data-consumer/index.js +0 -7
- package/dist/es2019/plugins/date/utils/internal.js +0 -3
- package/dist/es2019/plugins/extension/commands.js +0 -6
- package/dist/es2019/plugins/extension/toolbar.js +7 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +12 -2
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +3 -0
- package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/es2019/plugins/feedback-dialog/index.js +0 -2
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Button.js +9 -3
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +45 -12
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +29 -1
- package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
- package/dist/es2019/plugins/fragment/index.js +0 -7
- package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/es2019/plugins/help-dialog/commands.js +1 -2
- 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/image-upload/pm-plugins/main.js +47 -5
- 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/layout/styles.js +12 -4
- package/dist/es2019/plugins/list/utils/find.js +0 -27
- package/dist/es2019/plugins/list/utils/indentation.js +0 -23
- package/dist/es2019/plugins/list/utils/node.js +1 -4
- package/dist/es2019/plugins/list/utils/selection.js +2 -15
- 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/media/utils/media-common.js +1 -19
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +64 -16
- package/dist/es2019/plugins/mentions/type-ahead/index.js +1 -14
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/es2019/plugins/mobile-dimensions/index.js +0 -3
- package/dist/es2019/plugins/panel/utils.js +4 -1
- package/dist/es2019/plugins/paste/handlers.js +127 -5
- package/dist/es2019/plugins/paste/index.js +1 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +131 -93
- package/dist/es2019/plugins/paste/pm-plugins/main.js +13 -4
- package/dist/es2019/plugins/paste/util/index.js +5 -45
- package/dist/es2019/plugins/placeholder-text/index.js +1 -1
- package/dist/es2019/plugins/quick-insert/assets/index.js +0 -8
- package/dist/es2019/plugins/selection/gap-cursor/actions.js +56 -56
- package/dist/es2019/plugins/status/index.js +8 -2
- package/dist/es2019/plugins/status/ui/statusPicker.js +8 -2
- package/dist/es2019/plugins/status/utils.js +1 -11
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +48 -12
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- 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 -27
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +16 -1
- package/dist/es2019/plugins/type-ahead/constants.js +0 -5
- package/dist/es2019/plugins/type-ahead/index.js +1 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -35
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +73 -92
- package/dist/es2019/plugins/type-ahead/utils.js +0 -23
- package/dist/es2019/test-utils.js +4 -7
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -6
- package/dist/es2019/ui/ChromeCollapsed/index.js +1 -0
- package/dist/es2019/ui/CollapsedEditor/index.js +7 -11
- package/dist/es2019/ui/ColorPalette/index.js +2 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +66 -9
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/es2019/ui/ConfigPanel/utils.js +0 -6
- package/dist/es2019/ui/ContentStyles/index.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/ModalElementBrowser.js +1 -1
- 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/ElementBrowser/constants.js +0 -1
- package/dist/es2019/ui/PanelTextInput/index.js +3 -3
- package/dist/es2019/ui/PortalProvider/index.js +1 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -1
- package/dist/es2019/ui/WidthEmitter/index.js +25 -29
- package/dist/es2019/ui/styles.js +0 -6
- package/dist/es2019/utils/document.js +11 -1
- package/dist/es2019/utils/extensions.js +1 -3
- package/dist/es2019/utils/get-editor-plugins.js +23 -0
- package/dist/es2019/utils/index.js +13 -199
- package/dist/es2019/utils/input-rules.js +0 -14
- 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 +24 -10
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +9 -765
- package/dist/esm/create-editor/ReactEditorViewInternal.js +747 -0
- package/dist/esm/create-editor/ReactEditorViewNext.js +7 -0
- package/dist/esm/create-editor/create-plugins-list.js +30 -3
- package/dist/esm/create-editor/feature-flags-from-props.js +3 -2
- package/dist/esm/create-editor/preset-utils.js +21 -0
- package/dist/esm/editor-next/editor-internal.js +141 -0
- package/dist/esm/editor-next/editor-migration-component.js +44 -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 +66 -0
- package/dist/esm/editor-next/index.js +138 -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/getProvidersFromEditorProps.js +35 -0
- package/dist/esm/editor-next/utils/handleProviders.js +45 -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 +139 -442
- package/dist/esm/index.js +2 -1
- package/dist/esm/keymaps/consts.js +7 -11
- 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/cxhtml.js +56 -55
- package/dist/esm/labs/next/presets/default.js +18 -41
- package/dist/esm/labs/next/presets/mobile.js +88 -90
- package/dist/esm/labs/next/presets/universal.js +337 -255
- package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
- 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 +7 -2
- package/dist/esm/plugins/analytics/utils.js +0 -9
- package/dist/esm/plugins/annotation/utils.js +2 -32
- 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/pm-plugins/react-nodeview.js +1 -5
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +24 -25
- package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
- 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/caption/index.js +0 -2
- package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -3
- package/dist/esm/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/esm/plugins/card/pm-plugins/main.js +10 -5
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +4 -1
- package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
- package/dist/esm/plugins/collab-edit/plugin.js +1 -2
- package/dist/esm/plugins/collab-edit/provider/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +1 -10
- package/dist/esm/plugins/context-panel/index.js +0 -3
- package/dist/esm/plugins/data-consumer/index.js +0 -7
- package/dist/esm/plugins/date/utils/internal.js +0 -3
- package/dist/esm/plugins/extension/commands.js +0 -6
- package/dist/esm/plugins/extension/toolbar.js +7 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/esm/plugins/feedback-dialog/index.js +0 -2
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/esm/plugins/floating-toolbar/ui/Button.js +9 -3
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +48 -14
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +24 -21
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +32 -5
- package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
- package/dist/esm/plugins/fragment/index.js +0 -7
- package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/esm/plugins/help-dialog/commands.js +0 -3
- 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/image-upload/pm-plugins/main.js +51 -12
- 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/layout/styles.js +11 -2
- package/dist/esm/plugins/list/utils/find.js +0 -27
- package/dist/esm/plugins/list/utils/indentation.js +0 -23
- package/dist/esm/plugins/list/utils/node.js +1 -4
- package/dist/esm/plugins/list/utils/selection.js +2 -12
- 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/media/utils/media-common.js +1 -17
- package/dist/esm/plugins/mentions/nodeviews/mention.js +97 -16
- package/dist/esm/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/esm/plugins/mobile-dimensions/index.js +0 -3
- package/dist/esm/plugins/panel/utils.js +4 -1
- package/dist/esm/plugins/paste/handlers.js +127 -13
- package/dist/esm/plugins/paste/index.js +1 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +130 -86
- package/dist/esm/plugins/paste/pm-plugins/main.js +13 -4
- package/dist/esm/plugins/paste/util/index.js +5 -45
- package/dist/esm/plugins/placeholder-text/index.js +2 -2
- package/dist/esm/plugins/quick-insert/assets/index.js +0 -20
- package/dist/esm/plugins/selection/gap-cursor/actions.js +52 -45
- package/dist/esm/plugins/status/index.js +9 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +8 -2
- package/dist/esm/plugins/status/utils.js +1 -13
- package/dist/esm/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +48 -12
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- 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 -29
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
- package/dist/esm/plugins/type-ahead/constants.js +0 -5
- package/dist/esm/plugins/type-ahead/index.js +1 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -31
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +79 -106
- package/dist/esm/plugins/type-ahead/utils.js +2 -20
- package/dist/esm/test-utils.js +4 -7
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +41 -6
- package/dist/esm/ui/ChromeCollapsed/index.js +1 -0
- package/dist/esm/ui/CollapsedEditor/index.js +7 -13
- package/dist/esm/ui/ColorPalette/index.js +2 -1
- package/dist/esm/ui/ColorPickerButton/index.js +74 -8
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/esm/ui/ConfigPanel/utils.js +3 -14
- package/dist/esm/ui/ContentStyles/index.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/ModalElementBrowser.js +1 -1
- 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/ElementBrowser/constants.js +0 -1
- package/dist/esm/ui/PanelTextInput/index.js +4 -4
- package/dist/esm/ui/PortalProvider/index.js +1 -1
- package/dist/esm/ui/Resizer/utils.js +0 -1
- package/dist/esm/ui/WidthEmitter/index.js +28 -37
- package/dist/esm/ui/styles.js +2 -5
- package/dist/esm/utils/document.js +15 -1
- package/dist/esm/utils/extensions.js +1 -3
- package/dist/esm/utils/get-editor-plugins.js +23 -0
- package/dist/esm/utils/index.js +13 -196
- package/dist/esm/utils/input-rules.js +0 -13
- 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 +5 -5
- package/dist/types/create-editor/ReactEditorView.d.ts +5 -110
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +114 -0
- package/dist/types/create-editor/ReactEditorViewNext.d.ts +8 -0
- package/dist/types/create-editor/create-plugins-list.d.ts +3 -5
- package/dist/types/create-editor/preset-utils.d.ts +2 -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/getProvidersFromEditorProps.d.ts +9 -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 +50 -25
- package/dist/types/index.d.ts +1 -0
- package/dist/types/keymaps/consts.d.ts +0 -11
- 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/cxhtml.d.ts +33 -1
- package/dist/types/labs/next/presets/default.d.ts +67 -10
- package/dist/types/labs/next/presets/mobile.d.ts +33 -1
- package/dist/types/labs/next/presets/universal.d.ts +5 -13
- package/dist/types/labs/next/presets/useUniversalPreset.d.ts +7 -0
- package/dist/types/nodeviews/context-adapter.d.ts +0 -1
- package/dist/types/nodeviews/index.d.ts +0 -1
- package/dist/types/plugins/alignment/index.d.ts +1 -1
- package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -11
- 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/annotation/utils.d.ts +0 -17
- 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/pm-plugins/react-nodeview.d.ts +2 -3
- 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/pm-plugins/input-rule.d.ts +2 -6
- 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/caption/index.d.ts +0 -2
- package/dist/types/plugins/card/index.d.ts +3 -1
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +2 -1
- package/dist/types/plugins/card/nodeviews/inlineCard.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/actions.d.ts +0 -4
- package/dist/types/plugins/code-block/index.d.ts +3 -1
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
- package/dist/types/plugins/collab-edit/index.d.ts +3 -1
- package/dist/types/plugins/collab-edit/provider/index.d.ts +1 -2
- package/dist/types/plugins/collab-edit/provider/types.d.ts +1 -36
- package/dist/types/plugins/context-panel/index.d.ts +3 -4
- package/dist/types/plugins/data-consumer/index.d.ts +0 -2
- package/dist/types/plugins/date/utils/internal.d.ts +0 -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/commands.d.ts +0 -1
- package/dist/types/plugins/extension/index.d.ts +3 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
- 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 -3
- package/dist/types/plugins/find-replace/index.d.ts +3 -1
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +4 -1
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +6 -2
- package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
- package/dist/types/plugins/fragment/index.d.ts +0 -2
- package/dist/types/plugins/grid/index.d.ts +3 -1
- package/dist/types/plugins/help-dialog/commands.d.ts +0 -1
- package/dist/types/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types/plugins/history/actions.d.ts +1 -2
- 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/layout/styles.d.ts +2 -1
- package/dist/types/plugins/list/index.d.ts +3 -1
- package/dist/types/plugins/list/utils/find.d.ts +0 -1
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -1
- package/dist/types/plugins/list/utils/node.d.ts +0 -2
- package/dist/types/plugins/list/utils/selection.d.ts +0 -3
- 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/media/utils/media-common.d.ts +0 -5
- package/dist/types/plugins/mentions/index.d.ts +3 -1
- package/dist/types/plugins/mentions/types.d.ts +1 -2
- package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +2 -3
- package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -6
- package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +1 -4
- package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -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 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +10 -4
- package/dist/types/plugins/paste/util/index.d.ts +0 -6
- 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/assets/index.d.ts +0 -2
- 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/status/utils.d.ts +0 -3
- 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/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/text-color/index.d.ts +3 -1
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
- 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/pm-plugins/clear-formatting.d.ts +0 -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 -5
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +3 -1
- package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
- package/dist/types/plugins/type-ahead/index.d.ts +3 -1
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +0 -10
- package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
- package/dist/types/test-utils.d.ts +4 -5
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +55 -42
- 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/Chromeless.d.ts +0 -5
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +0 -7
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -4
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +29 -29
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
- package/dist/types/ui/CollapsedEditor/index.d.ts +4 -3
- package/dist/types/ui/ColorPalette/Palettes/index.d.ts +1 -1
- package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -1
- package/dist/types/ui/ColorPalette/index.d.ts +2 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +5 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/types.d.ts +0 -3
- package/dist/types/ui/ConfigPanel/utils.d.ts +2 -3
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ContextPanel/context.d.ts +2 -1
- package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +0 -3
- package/dist/types/ui/ElementBrowser/constants.d.ts +0 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +0 -5
- package/dist/types/ui/PanelTextInput/index.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +1 -1
- package/dist/types/ui/Resizer/utils.d.ts +0 -1
- package/dist/types/ui/styles.d.ts +0 -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/index.d.ts +6 -65
- package/dist/types/utils/input-rules.d.ts +1 -2
- 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/dist/types/utils/table.d.ts +0 -1
- package/docs/0-intro.tsx +0 -1
- package/package.json +37 -37
- package/report.api.md +307 -244
- package/dist/cjs/labs/next/presets/preset.js +0 -106
- package/dist/cjs/plugins/analytics/analytics-queue.js +0 -79
- package/dist/cjs/plugins/analytics/fire-analytics-event.js +0 -35
- package/dist/cjs/plugins/collab-edit/provider/channel.js +0 -313
- package/dist/cjs/plugins/collab-edit/provider/logger.js +0 -17
- package/dist/cjs/plugins/collab-edit/provider/mock-users.js +0 -19
- package/dist/cjs/plugins/data-consumer/plugin-key.js +0 -9
- package/dist/cjs/plugins/media/toolbar/toolbar-messages.js +0 -15
- package/dist/cjs/profiler/render-count.js +0 -60
- package/dist/cjs/ui/ColorPalette/Color/index.js +0 -9
- package/dist/cjs/ui/ConfigPanel/FieldDescription.js +0 -19
- package/dist/cjs/ui/WithPluginState/types.js +0 -5
- package/dist/es2019/labs/next/presets/preset.js +0 -71
- package/dist/es2019/plugins/analytics/analytics-queue.js +0 -53
- package/dist/es2019/plugins/analytics/fire-analytics-event.js +0 -26
- package/dist/es2019/plugins/collab-edit/provider/channel.js +0 -179
- package/dist/es2019/plugins/collab-edit/provider/logger.js +0 -8
- package/dist/es2019/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/es2019/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/es2019/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/es2019/profiler/render-count.js +0 -53
- package/dist/es2019/ui/ColorPalette/Color/index.js +0 -2
- package/dist/es2019/ui/ConfigPanel/FieldDescription.js +0 -12
- package/dist/esm/labs/next/presets/preset.js +0 -98
- package/dist/esm/plugins/analytics/analytics-queue.js +0 -71
- package/dist/esm/plugins/analytics/fire-analytics-event.js +0 -28
- package/dist/esm/plugins/analytics/types/type-ahead.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +0 -305
- package/dist/esm/plugins/collab-edit/provider/logger.js +0 -10
- package/dist/esm/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/esm/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/esm/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/esm/profiler/render-count.js +0 -49
- package/dist/esm/ui/ColorPalette/Color/index.js +0 -2
- package/dist/esm/ui/ConfigPanel/FieldDescription.js +0 -11
- package/dist/esm/ui/WithPluginState/types.js +0 -1
- package/dist/types/labs/next/presets/preset.d.ts +0 -46
- package/dist/types/plugins/analytics/analytics-queue.d.ts +0 -10
- package/dist/types/plugins/analytics/fire-analytics-event.d.ts +0 -9
- package/dist/types/plugins/analytics/types/type-ahead.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/channel.d.ts +0 -48
- package/dist/types/plugins/collab-edit/provider/logger.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/mock-users.d.ts +0 -6
- package/dist/types/plugins/data-consumer/plugin-key.d.ts +0 -2
- package/dist/types/plugins/media/toolbar/toolbar-messages.d.ts +0 -7
- package/dist/types/profiler/render-count.d.ts +0 -14
- package/dist/types/ui/ColorPalette/Color/index.d.ts +0 -2
- package/dist/types/ui/ConfigPanel/FieldDescription.d.ts +0 -6
- package/dist/types/ui/WithPluginState/types.d.ts +0 -10
- /package/dist/cjs/{plugins/analytics/types/type-ahead.js → types/get-editor-props.js} +0 -0
- /package/dist/es2019/{plugins/analytics/types/type-ahead.js → types/get-editor-props.js} +0 -0
- /package/dist/{es2019/ui/WithPluginState/types.js → esm/types/get-editor-props.js} +0 -0
package/dist/cjs/editor.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
10
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -15,137 +12,125 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
15
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
var
|
|
19
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
-
var _react2 = require("@emotion/react");
|
|
15
|
+
var _react = require("@emotion/react");
|
|
21
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
|
-
var
|
|
23
|
-
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
24
|
-
var _versionWrapper = require("./version-wrapper");
|
|
25
|
-
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
17
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
26
18
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
27
19
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
28
20
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
29
|
-
var
|
|
30
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
21
|
+
var _versionWrapper = require("./version-wrapper");
|
|
31
22
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
32
|
-
var
|
|
23
|
+
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
33
24
|
var _actions = _interopRequireDefault(require("./actions"));
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
25
|
+
var _editorInternal = require("./editor-next/editor-internal");
|
|
26
|
+
var _editorPropTypes = require("./editor-next/utils/editorPropTypes");
|
|
27
|
+
var _trackEditorActions2 = _interopRequireDefault(require("./editor-next/utils/trackEditorActions"));
|
|
28
|
+
var _onEditorCreated2 = _interopRequireDefault(require("./editor-next/utils/onEditorCreated"));
|
|
29
|
+
var _deprecationWarnings = _interopRequireDefault(require("./editor-next/utils/deprecationWarnings"));
|
|
30
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
38
31
|
var _prepareQuickInsertProvider = _interopRequireDefault(require("./utils/prepare-quick-insert-provider"));
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
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; }
|
|
32
|
+
var _prepareExtensionProvider = _interopRequireDefault(require("./utils/prepare-extension-provider"));
|
|
33
|
+
var _handleProviders = _interopRequireDefault(require("./editor-next/utils/handleProviders"));
|
|
34
|
+
var _getProvidersFromEditorProps = _interopRequireDefault(require("./editor-next/utils/getProvidersFromEditorProps"));
|
|
35
|
+
var _measureEnum = _interopRequireDefault(require("./utils/performance/measure-enum"));
|
|
36
|
+
var _editorMeasureTTICallback = _interopRequireDefault(require("./editor-next/utils/editorMeasureTTICallback"));
|
|
37
|
+
var _sendDurationAnalytics = _interopRequireDefault(require("./editor-next/utils/sendDurationAnalytics"));
|
|
38
|
+
var _createPluginsList = require("./create-editor/create-plugins-list");
|
|
39
|
+
var _presetUtils = require("./create-editor/preset-utils");
|
|
48
40
|
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); }; }
|
|
49
41
|
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; } }
|
|
50
|
-
var fullHeight = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n"])));
|
|
51
42
|
var Editor = /*#__PURE__*/function (_React$Component) {
|
|
52
43
|
(0, _inherits2.default)(Editor, _React$Component);
|
|
53
44
|
var _super = _createSuper(Editor);
|
|
45
|
+
/**
|
|
46
|
+
* WARNING: Code should be shared between Editor + EditorNext
|
|
47
|
+
* If you are making changes that affect both, consider making them
|
|
48
|
+
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
49
|
+
*/
|
|
50
|
+
|
|
54
51
|
function Editor(props, context) {
|
|
55
52
|
var _props$performanceTra, _props$performanceTra2, _props$featureFlags;
|
|
56
53
|
var _this;
|
|
57
54
|
(0, _classCallCheck2.default)(this, Editor);
|
|
58
55
|
_this = _super.call(this, props);
|
|
59
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "prepareExtensionProvider", (0,
|
|
60
|
-
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (typeof extensionProviders === 'function') {
|
|
64
|
-
return (0, _extensions.combineExtensionProviders)(extensionProviders(_this.editorActions));
|
|
65
|
-
}
|
|
66
|
-
return (0, _extensions.combineExtensionProviders)(extensionProviders);
|
|
56
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "prepareExtensionProvider", (0, _prepareExtensionProvider.default)(function () {
|
|
57
|
+
return _this.editorActions;
|
|
67
58
|
}));
|
|
68
59
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "prepareQuickInsertProvider", function (extensionProvider, quickInsert) {
|
|
69
60
|
return (0, _prepareQuickInsertProvider.default)(_this.editorActions, extensionProvider, quickInsert, _this.createAnalyticsEvent);
|
|
70
61
|
});
|
|
71
62
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSave", function (view) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
return _this.props.onSave(view);
|
|
63
|
+
var _this$props$onSave, _this$props;
|
|
64
|
+
return (_this$props$onSave = (_this$props = _this.props).onSave) === null || _this$props$onSave === void 0 ? void 0 : _this$props$onSave.call(_this$props, view);
|
|
76
65
|
});
|
|
77
66
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleAnalyticsEvent", function (data) {
|
|
78
67
|
return (0, _analytics.fireAnalyticsEvent)(_this.createAnalyticsEvent)(data);
|
|
79
68
|
});
|
|
69
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getExperienceStore", function () {
|
|
70
|
+
return _this.experienceStore;
|
|
71
|
+
});
|
|
80
72
|
_this.providerFactory = new _providerFactory.ProviderFactory();
|
|
81
|
-
|
|
82
|
-
_this.onEditorCreated = _this.onEditorCreated.bind((0, _assertThisInitialized2.default)(_this));
|
|
83
|
-
_this.onEditorDestroyed = _this.onEditorDestroyed.bind((0, _assertThisInitialized2.default)(_this));
|
|
73
|
+
(0, _deprecationWarnings.default)(props);
|
|
84
74
|
_this.editorActions = (context || {}).editorActions || new _actions.default();
|
|
85
|
-
_this.trackEditorActions(_this.editorActions, props);
|
|
86
75
|
_this.editorSessionId = (0, _v.default)();
|
|
87
76
|
_this.startTime = performance.now();
|
|
77
|
+
_this.onEditorCreated = _this.onEditorCreated.bind((0, _assertThisInitialized2.default)(_this));
|
|
78
|
+
_this.onEditorDestroyed = _this.onEditorDestroyed.bind((0, _assertThisInitialized2.default)(_this));
|
|
79
|
+
_this.getExperienceStore = _this.getExperienceStore.bind((0, _assertThisInitialized2.default)(_this));
|
|
80
|
+
_this.trackEditorActions(_this.editorActions, props);
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
84
|
+
* `useEditorConstructor` (editor-next/hooks/useEditorMeasuresConstructor.ts)
|
|
85
|
+
*/
|
|
88
86
|
(0, _utils.startMeasure)(_measureEnum.default.EDITOR_MOUNTED);
|
|
89
87
|
if ((_props$performanceTra = props.performanceTracking) !== null && _props$performanceTra !== void 0 && (_props$performanceTra2 = _props$performanceTra.ttiTracking) !== null && _props$performanceTra2 !== void 0 && _props$performanceTra2.enabled || (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.ufo) {
|
|
90
|
-
var _props$
|
|
88
|
+
var _props$performanceTra3, _props$performanceTra4, _props$performanceTra5, _props$performanceTra6;
|
|
91
89
|
(0, _utils.measureTTI)(function (tti, ttiFromInvocation, canceled) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var _ttiTracking;
|
|
95
|
-
var ttiEvent = {
|
|
96
|
-
payload: {
|
|
97
|
-
action: _analytics.ACTION.EDITOR_TTI,
|
|
98
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
99
|
-
attributes: {
|
|
100
|
-
tti: tti,
|
|
101
|
-
ttiFromInvocation: ttiFromInvocation,
|
|
102
|
-
canceled: canceled
|
|
103
|
-
},
|
|
104
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
if ((_ttiTracking = props.performanceTracking.ttiTracking) !== null && _ttiTracking !== void 0 && _ttiTracking.trackSeverity) {
|
|
108
|
-
var _ttiTracking2 = props.performanceTracking.ttiTracking,
|
|
109
|
-
ttiSeverityNormalThreshold = _ttiTracking2.ttiSeverityNormalThreshold,
|
|
110
|
-
ttiSeverityDegradedThreshold = _ttiTracking2.ttiSeverityDegradedThreshold,
|
|
111
|
-
ttiFromInvocationSeverityNormalThreshold = _ttiTracking2.ttiFromInvocationSeverityNormalThreshold,
|
|
112
|
-
ttiFromInvocationSeverityDegradedThreshold = _ttiTracking2.ttiFromInvocationSeverityDegradedThreshold;
|
|
113
|
-
var _getTTISeverity = (0, _utils.getTTISeverity)(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold),
|
|
114
|
-
ttiSeverity = _getTTISeverity.ttiSeverity,
|
|
115
|
-
ttiFromInvocationSeverity = _getTTISeverity.ttiFromInvocationSeverity;
|
|
116
|
-
ttiEvent.payload.attributes.ttiSeverity = ttiSeverity;
|
|
117
|
-
ttiEvent.payload.attributes.ttiFromInvocationSeverity = ttiFromInvocationSeverity;
|
|
118
|
-
}
|
|
119
|
-
(0, _analytics.fireAnalyticsEvent)(_this.createAnalyticsEvent)(ttiEvent);
|
|
120
|
-
}
|
|
121
|
-
if ((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.ufo) {
|
|
122
|
-
var _this$experienceStore, _this$experienceStore2;
|
|
123
|
-
(_this$experienceStore = _this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.mark(_ufo.EditorExperience.loadEditor, _analytics.ACTION.EDITOR_TTI, tti);
|
|
124
|
-
(_this$experienceStore2 = _this.experienceStore) === null || _this$experienceStore2 === void 0 ? void 0 : _this$experienceStore2.success(_ufo.EditorExperience.loadEditor);
|
|
125
|
-
}
|
|
126
|
-
}, (_props$performanceTra5 = props.performanceTracking) === null || _props$performanceTra5 === void 0 ? void 0 : (_props$performanceTra6 = _props$performanceTra5.ttiTracking) === null || _props$performanceTra6 === void 0 ? void 0 : _props$performanceTra6.ttiIdleThreshold, (_props$performanceTra7 = props.performanceTracking) === null || _props$performanceTra7 === void 0 ? void 0 : (_props$performanceTra8 = _props$performanceTra7.ttiTracking) === null || _props$performanceTra8 === void 0 ? void 0 : _props$performanceTra8.ttiCancelTimeout);
|
|
90
|
+
(0, _editorMeasureTTICallback.default)(tti, ttiFromInvocation, canceled, _this.props.performanceTracking, _this.props.featureFlags, _this.createAnalyticsEvent, _this.experienceStore);
|
|
91
|
+
}, (_props$performanceTra3 = props.performanceTracking) === null || _props$performanceTra3 === void 0 ? void 0 : (_props$performanceTra4 = _props$performanceTra3.ttiTracking) === null || _props$performanceTra4 === void 0 ? void 0 : _props$performanceTra4.ttiIdleThreshold, (_props$performanceTra5 = props.performanceTracking) === null || _props$performanceTra5 === void 0 ? void 0 : (_props$performanceTra6 = _props$performanceTra5.ttiTracking) === null || _props$performanceTra6 === void 0 ? void 0 : _props$performanceTra6.ttiCancelTimeout);
|
|
127
92
|
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
96
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
97
|
+
*/
|
|
128
98
|
var _extensionProvider = _this.prepareExtensionProvider(props.extensionProviders);
|
|
129
99
|
var quickInsertProvider = _this.prepareQuickInsertProvider(_extensionProvider, props.quickInsert);
|
|
100
|
+
var preset = (0, _createPluginsList.createPreset)(props, undefined, _this.createAnalyticsEvent);
|
|
130
101
|
_this.state = {
|
|
131
102
|
extensionProvider: _extensionProvider,
|
|
132
|
-
quickInsertProvider: quickInsertProvider
|
|
103
|
+
quickInsertProvider: quickInsertProvider,
|
|
104
|
+
preset: preset
|
|
133
105
|
};
|
|
134
106
|
return _this;
|
|
135
107
|
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
111
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
112
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
113
|
+
*/
|
|
136
114
|
(0, _createClass2.default)(Editor, [{
|
|
137
115
|
key: "componentDidMount",
|
|
138
116
|
value: function componentDidMount() {
|
|
139
|
-
(0, _utils.stopMeasure)(_measureEnum.default.EDITOR_MOUNTED,
|
|
140
|
-
this.
|
|
117
|
+
(0, _utils.stopMeasure)(_measureEnum.default.EDITOR_MOUNTED, (0, _sendDurationAnalytics.default)(_analytics.ACTION.EDITOR_MOUNTED, this.props, this.getExperienceStore, this.createAnalyticsEvent));
|
|
118
|
+
(0, _handleProviders.default)(this.providerFactory, (0, _getProvidersFromEditorProps.default)(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
141
119
|
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
123
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
124
|
+
*/
|
|
142
125
|
}, {
|
|
143
126
|
key: "componentDidUpdate",
|
|
144
127
|
value: function componentDidUpdate(prevProps) {
|
|
145
128
|
var _this2 = this;
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
|
|
129
|
+
var needsANewPreset = (0, _presetUtils.shouldRecreatePreset)(prevProps, this.props);
|
|
130
|
+
var preset = needsANewPreset ? (0, _createPluginsList.createPreset)(this.props, prevProps, this.createAnalyticsEvent) : this.state.preset;
|
|
131
|
+
var _this$props2 = this.props,
|
|
132
|
+
extensionProviders = _this$props2.extensionProviders,
|
|
133
|
+
quickInsert = _this$props2.quickInsert;
|
|
149
134
|
if (extensionProviders && extensionProviders !== prevProps.extensionProviders ||
|
|
150
135
|
// Though this will introduce some performance regression related to quick insert
|
|
151
136
|
// loading but we can remove it soon when Forge will move to new API.
|
|
@@ -155,25 +140,38 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
155
140
|
var quickInsertProvider = this.prepareQuickInsertProvider(extensionProvider, quickInsert);
|
|
156
141
|
this.setState({
|
|
157
142
|
extensionProvider: extensionProvider,
|
|
158
|
-
quickInsertProvider: quickInsertProvider
|
|
143
|
+
quickInsertProvider: quickInsertProvider,
|
|
144
|
+
preset: preset
|
|
159
145
|
}, function () {
|
|
160
|
-
return _this2.
|
|
146
|
+
return (0, _handleProviders.default)(_this2.providerFactory, (0, _getProvidersFromEditorProps.default)(_this2.props), _this2.state.extensionProvider, _this2.state.quickInsertProvider);
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (needsANewPreset) {
|
|
151
|
+
this.setState({
|
|
152
|
+
preset: preset
|
|
161
153
|
});
|
|
162
154
|
return;
|
|
163
155
|
}
|
|
164
|
-
this.
|
|
156
|
+
(0, _handleProviders.default)(this.providerFactory, (0, _getProvidersFromEditorProps.default)(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
165
157
|
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
161
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
162
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
163
|
+
*/
|
|
166
164
|
}, {
|
|
167
165
|
key: "componentWillUnmount",
|
|
168
166
|
value: function componentWillUnmount() {
|
|
169
|
-
var _this$
|
|
167
|
+
var _this$props3, _this$props3$performa, _this$props3$performa2, _this$props$featureFl;
|
|
170
168
|
this.unregisterEditorFromActions();
|
|
171
169
|
this.providerFactory.destroy();
|
|
172
170
|
(0, _utils.clearMeasure)(_measureEnum.default.EDITOR_MOUNTED);
|
|
173
|
-
((_this$
|
|
171
|
+
((_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$performa = _this$props3.performanceTracking) === null || _this$props3$performa === void 0 ? void 0 : (_this$props3$performa2 = _this$props3$performa.onEditorReadyCallbackTracking) === null || _this$props3$performa2 === void 0 ? void 0 : _this$props3$performa2.enabled) && (0, _utils.clearMeasure)(_measureEnum.default.ON_EDITOR_READY_CALLBACK);
|
|
174
172
|
if ((_this$props$featureFl = this.props.featureFlags) !== null && _this$props$featureFl !== void 0 && _this$props$featureFl.ufo) {
|
|
175
|
-
var _this$
|
|
176
|
-
(_this$
|
|
173
|
+
var _this$experienceStore;
|
|
174
|
+
(_this$experienceStore = this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.abortAll({
|
|
177
175
|
reason: 'editor component unmounted'
|
|
178
176
|
});
|
|
179
177
|
}
|
|
@@ -188,88 +186,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
188
186
|
}, {
|
|
189
187
|
key: "trackEditorActions",
|
|
190
188
|
value: function trackEditorActions(editorActions, props) {
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
_this3
|
|
194
|
-
|
|
195
|
-
var DEFAULT_SAMPLING_RATE = 100;
|
|
196
|
-
var getValue = editorActions.getValue.bind(editorActions);
|
|
197
|
-
if (!editorActions._contentRetrievalTracking) {
|
|
198
|
-
editorActions._contentRetrievalTracking = {
|
|
199
|
-
samplingCounters: {
|
|
200
|
-
success: 1,
|
|
201
|
-
failure: 1
|
|
202
|
-
},
|
|
203
|
-
getValueTracked: false
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
var _editorActions$_conte = editorActions._contentRetrievalTracking,
|
|
207
|
-
samplingCounters = _editorActions$_conte.samplingCounters,
|
|
208
|
-
getValueTracked = _editorActions$_conte.getValueTracked;
|
|
209
|
-
if (!getValueTracked) {
|
|
210
|
-
var getValueWithTracking = /*#__PURE__*/function () {
|
|
211
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
212
|
-
var _props$performanceTra11, _props$performanceTra12, _props$performanceTra13, value, _props$performanceTra14, _props$performanceTra15, _props$performanceTra16, _props$performanceTra17, _props$performanceTra18;
|
|
213
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
214
|
-
while (1) {
|
|
215
|
-
switch (_context.prev = _context.next) {
|
|
216
|
-
case 0:
|
|
217
|
-
_context.prev = 0;
|
|
218
|
-
_context.next = 3;
|
|
219
|
-
return getValue();
|
|
220
|
-
case 3:
|
|
221
|
-
value = _context.sent;
|
|
222
|
-
if (samplingCounters.success === ((_props$performanceTra11 = props === null || props === void 0 ? void 0 : (_props$performanceTra12 = props.performanceTracking) === null || _props$performanceTra12 === void 0 ? void 0 : (_props$performanceTra13 = _props$performanceTra12.contentRetrievalTracking) === null || _props$performanceTra13 === void 0 ? void 0 : _props$performanceTra13.successSamplingRate) !== null && _props$performanceTra11 !== void 0 ? _props$performanceTra11 : DEFAULT_SAMPLING_RATE)) {
|
|
223
|
-
_this3.handleAnalyticsEvent({
|
|
224
|
-
payload: {
|
|
225
|
-
action: _analytics.ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
226
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
227
|
-
attributes: {
|
|
228
|
-
success: true
|
|
229
|
-
},
|
|
230
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
samplingCounters.success = 0;
|
|
234
|
-
}
|
|
235
|
-
samplingCounters.success++;
|
|
236
|
-
return _context.abrupt("return", value);
|
|
237
|
-
case 9:
|
|
238
|
-
_context.prev = 9;
|
|
239
|
-
_context.t0 = _context["catch"](0);
|
|
240
|
-
if (samplingCounters.failure === ((_props$performanceTra14 = props === null || props === void 0 ? void 0 : (_props$performanceTra15 = props.performanceTracking) === null || _props$performanceTra15 === void 0 ? void 0 : (_props$performanceTra16 = _props$performanceTra15.contentRetrievalTracking) === null || _props$performanceTra16 === void 0 ? void 0 : _props$performanceTra16.failureSamplingRate) !== null && _props$performanceTra14 !== void 0 ? _props$performanceTra14 : DEFAULT_SAMPLING_RATE)) {
|
|
241
|
-
_this3.handleAnalyticsEvent({
|
|
242
|
-
payload: {
|
|
243
|
-
action: _analytics.ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
244
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
245
|
-
attributes: {
|
|
246
|
-
success: false,
|
|
247
|
-
errorInfo: _context.t0.toString(),
|
|
248
|
-
errorStack: props !== null && props !== void 0 && (_props$performanceTra17 = props.performanceTracking) !== null && _props$performanceTra17 !== void 0 && (_props$performanceTra18 = _props$performanceTra17.contentRetrievalTracking) !== null && _props$performanceTra18 !== void 0 && _props$performanceTra18.reportErrorStack ? _context.t0.stack : undefined
|
|
249
|
-
},
|
|
250
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
samplingCounters.failure = 0;
|
|
254
|
-
}
|
|
255
|
-
samplingCounters.failure++;
|
|
256
|
-
throw _context.t0;
|
|
257
|
-
case 14:
|
|
258
|
-
case "end":
|
|
259
|
-
return _context.stop();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}, _callee, null, [[0, 9]]);
|
|
263
|
-
}));
|
|
264
|
-
return function getValueWithTracking() {
|
|
265
|
-
return _ref.apply(this, arguments);
|
|
266
|
-
};
|
|
267
|
-
}();
|
|
268
|
-
editorActions.getValue = getValueWithTracking;
|
|
269
|
-
editorActions._contentRetrievalTracking.getValueTracked = true;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return editorActions;
|
|
189
|
+
var _this3 = this;
|
|
190
|
+
return (0, _trackEditorActions2.default)(editorActions, props.performanceTracking, function (value) {
|
|
191
|
+
return _this3.handleAnalyticsEvent(value);
|
|
192
|
+
});
|
|
273
193
|
}
|
|
274
194
|
|
|
275
195
|
/**
|
|
@@ -288,108 +208,14 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
288
208
|
* and need to find a workaround.
|
|
289
209
|
*/
|
|
290
210
|
function onEditorCreated(instance) {
|
|
291
|
-
var _this$props$featureFl2;
|
|
292
|
-
this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
|
|
293
|
-
if ((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.ufo) {
|
|
294
|
-
this.experienceStore = _ufo.ExperienceStore.getInstance(instance.view);
|
|
295
|
-
this.experienceStore.start(_ufo.EditorExperience.loadEditor, this.startTime);
|
|
296
|
-
}
|
|
297
|
-
if (this.props.onEditorReady) {
|
|
298
|
-
var _this$props3, _this$props3$performa, _this$props3$performa2, _this$props$featureFl3;
|
|
299
|
-
var measureEditorReady = ((_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$performa = _this$props3.performanceTracking) === null || _this$props3$performa === void 0 ? void 0 : (_this$props3$performa2 = _this$props3$performa.onEditorReadyCallbackTracking) === null || _this$props3$performa2 === void 0 ? void 0 : _this$props3$performa2.enabled) || ((_this$props$featureFl3 = this.props.featureFlags) === null || _this$props$featureFl3 === void 0 ? void 0 : _this$props$featureFl3.ufo);
|
|
300
|
-
measureEditorReady && (0, _utils.startMeasure)(_measureEnum.default.ON_EDITOR_READY_CALLBACK);
|
|
301
|
-
this.props.onEditorReady(this.editorActions);
|
|
302
|
-
measureEditorReady && (0, _utils.stopMeasure)(_measureEnum.default.ON_EDITOR_READY_CALLBACK, this.sendDurationAnalytics(_analytics.ACTION.ON_EDITOR_READY_CALLBACK));
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}, {
|
|
306
|
-
key: "sendDurationAnalytics",
|
|
307
|
-
value: function sendDurationAnalytics(action) {
|
|
308
211
|
var _this4 = this;
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
switch (_context2.prev = _context2.next) {
|
|
316
|
-
case 0:
|
|
317
|
-
_context2.next = 2;
|
|
318
|
-
return _this4.props.contextIdentifierProvider;
|
|
319
|
-
case 2:
|
|
320
|
-
contextIdentifier = _context2.sent;
|
|
321
|
-
objectId = contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId;
|
|
322
|
-
if (_this4.createAnalyticsEvent) {
|
|
323
|
-
(0, _analytics.fireAnalyticsEvent)(_this4.createAnalyticsEvent)({
|
|
324
|
-
payload: {
|
|
325
|
-
action: action,
|
|
326
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
327
|
-
attributes: {
|
|
328
|
-
duration: duration,
|
|
329
|
-
startTime: startTime,
|
|
330
|
-
objectId: objectId
|
|
331
|
-
},
|
|
332
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
if ((_this4$props$featureF = _this4.props.featureFlags) !== null && _this4$props$featureF !== void 0 && _this4$props$featureF.ufo) {
|
|
337
|
-
(_this4$experienceStor = _this4.experienceStore) === null || _this4$experienceStor === void 0 ? void 0 : _this4$experienceStor.mark(_ufo.EditorExperience.loadEditor, action, startTime + duration);
|
|
338
|
-
(_this4$experienceStor2 = _this4.experienceStore) === null || _this4$experienceStor2 === void 0 ? void 0 : _this4$experienceStor2.addMetadata(_ufo.EditorExperience.loadEditor, {
|
|
339
|
-
objectId: objectId
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
case 6:
|
|
343
|
-
case "end":
|
|
344
|
-
return _context2.stop();
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}, _callee2);
|
|
348
|
-
}));
|
|
349
|
-
return function (_x, _x2) {
|
|
350
|
-
return _ref2.apply(this, arguments);
|
|
351
|
-
};
|
|
352
|
-
}();
|
|
353
|
-
}
|
|
354
|
-
}, {
|
|
355
|
-
key: "deprecationWarnings",
|
|
356
|
-
value: function deprecationWarnings(props) {
|
|
357
|
-
var _props$allowTextColor;
|
|
358
|
-
if (process.env.NODE_ENV === 'production') {
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
var nextVersion = (0, _versionWrapper.nextMajorVersion)();
|
|
362
|
-
var deprecatedProperties = {
|
|
363
|
-
allowTasksAndDecisions: {
|
|
364
|
-
message: 'To allow tasks and decisions use taskDecisionProvider – <Editor taskDecisionProvider={{ provider }} />',
|
|
365
|
-
type: 'removed'
|
|
366
|
-
},
|
|
367
|
-
allowConfluenceInlineComment: {
|
|
368
|
-
message: 'To integrate inline comments use experimental annotationProvider – <Editor annotationProviders={{ provider }} />',
|
|
369
|
-
type: 'removed'
|
|
370
|
-
},
|
|
371
|
-
smartLinks: {
|
|
372
|
-
message: 'To use smartLinks, pass the same object into the smartlinks key of linking - <Editor linking={{ smartLinks: {existing object} }}.',
|
|
373
|
-
type: 'removed'
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
Object.keys(deprecatedProperties).forEach(function (property) {
|
|
377
|
-
if (props.hasOwnProperty(property)) {
|
|
378
|
-
var meta = deprecatedProperties[property];
|
|
379
|
-
var type = meta.type || 'enabled by default';
|
|
380
|
-
|
|
381
|
-
// eslint-disable-next-line no-console
|
|
382
|
-
console.warn("".concat(property, " property is deprecated. ").concat(meta.message || '', " [Will be ").concat(type, " in editor-core@").concat(nextVersion, "]"));
|
|
383
|
-
}
|
|
212
|
+
(0, _onEditorCreated2.default)(instance, this.props, function (experienceStore) {
|
|
213
|
+
return _this4.experienceStore = experienceStore;
|
|
214
|
+
}, this.getExperienceStore, function () {
|
|
215
|
+
return _this4.createAnalyticsEvent;
|
|
216
|
+
}, this.editorActions, this.startTime, function (view, dispatcher, transformerForActions) {
|
|
217
|
+
return _this4.registerEditorForActions(view, dispatcher, transformerForActions);
|
|
384
218
|
});
|
|
385
|
-
if (props.hasOwnProperty('allowTables') && typeof props.allowTables !== 'boolean' && (!props.allowTables || !props.allowTables.advanced)) {
|
|
386
|
-
// eslint-disable-next-line no-console
|
|
387
|
-
console.warn("Advanced table options are deprecated (except isHeaderRowRequired) to continue using advanced table features use - <Editor allowTables={{ advanced: true }} /> [Will be changed in editor-core@".concat(nextVersion, "]"));
|
|
388
|
-
}
|
|
389
|
-
if (props.hasOwnProperty('allowTextColor') && typeof props.allowTextColor !== 'boolean' && (props === null || props === void 0 ? void 0 : (_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) !== undefined) {
|
|
390
|
-
// eslint-disable-next-line no-console
|
|
391
|
-
console.warn("\"allowMoreTextColors\" field of \"allowTextColor\" property is deprecated. It will be removedin editor-core@".concat(nextVersion, ". The color palette now shows more colors by default."));
|
|
392
|
-
}
|
|
393
219
|
}
|
|
394
220
|
|
|
395
221
|
/**
|
|
@@ -401,74 +227,29 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
401
227
|
}, {
|
|
402
228
|
key: "onEditorDestroyed",
|
|
403
229
|
value: function onEditorDestroyed(_instance) {
|
|
230
|
+
var _this$props$onDestroy, _this$props4;
|
|
404
231
|
this.unregisterEditorFromActions();
|
|
405
|
-
|
|
406
|
-
this.props.onDestroy();
|
|
407
|
-
}
|
|
232
|
+
(_this$props$onDestroy = (_this$props4 = this.props).onDestroy) === null || _this$props$onDestroy === void 0 ? void 0 : _this$props$onDestroy.call(_this$props4);
|
|
408
233
|
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @private
|
|
237
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
238
|
+
* Please reach out to the Editor team if you were previously using this
|
|
239
|
+
* and need to find a workaround.
|
|
240
|
+
*/
|
|
409
241
|
}, {
|
|
410
242
|
key: "registerEditorForActions",
|
|
411
|
-
value:
|
|
243
|
+
value:
|
|
244
|
+
/**
|
|
245
|
+
* @private
|
|
246
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
247
|
+
* Please reach out to the Editor team if you were previously using this
|
|
248
|
+
* and need to find a workaround.
|
|
249
|
+
*/
|
|
250
|
+
function registerEditorForActions(editorView, eventDispatcher, contentTransformer) {
|
|
412
251
|
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer);
|
|
413
252
|
}
|
|
414
|
-
}, {
|
|
415
|
-
key: "unregisterEditorFromActions",
|
|
416
|
-
value: function unregisterEditorFromActions() {
|
|
417
|
-
if (this.editorActions) {
|
|
418
|
-
this.editorActions._privateUnregisterEditor();
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}, {
|
|
422
|
-
key: "handleProviders",
|
|
423
|
-
value: function handleProviders(props) {
|
|
424
|
-
var _linking$smartLinks;
|
|
425
|
-
var emojiProvider = props.emojiProvider,
|
|
426
|
-
mentionProvider = props.mentionProvider,
|
|
427
|
-
taskDecisionProvider = props.taskDecisionProvider,
|
|
428
|
-
contextIdentifierProvider = props.contextIdentifierProvider,
|
|
429
|
-
collabEditProvider = props.collabEditProvider,
|
|
430
|
-
activityProvider = props.activityProvider,
|
|
431
|
-
presenceProvider = props.presenceProvider,
|
|
432
|
-
macroProvider = props.macroProvider,
|
|
433
|
-
legacyImageUploadProvider = props.legacyImageUploadProvider,
|
|
434
|
-
media = props.media,
|
|
435
|
-
collabEdit = props.collabEdit,
|
|
436
|
-
autoformattingProvider = props.autoformattingProvider,
|
|
437
|
-
searchProvider = props.searchProvider,
|
|
438
|
-
UNSAFE_cards = props.UNSAFE_cards,
|
|
439
|
-
smartLinks = props.smartLinks,
|
|
440
|
-
linking = props.linking;
|
|
441
|
-
var _this$state = this.state,
|
|
442
|
-
extensionProvider = _this$state.extensionProvider,
|
|
443
|
-
quickInsertProvider = _this$state.quickInsertProvider;
|
|
444
|
-
this.providerFactory.setProvider('emojiProvider', emojiProvider);
|
|
445
|
-
this.providerFactory.setProvider('mentionProvider', mentionProvider);
|
|
446
|
-
this.providerFactory.setProvider('taskDecisionProvider', taskDecisionProvider);
|
|
447
|
-
this.providerFactory.setProvider('contextIdentifierProvider', contextIdentifierProvider);
|
|
448
|
-
this.providerFactory.setProvider('mediaProvider', media && media.provider);
|
|
449
|
-
this.providerFactory.setProvider('imageUploadProvider', legacyImageUploadProvider);
|
|
450
|
-
this.providerFactory.setProvider('collabEditProvider', collabEdit && collabEdit.provider ? collabEdit.provider : collabEditProvider);
|
|
451
|
-
this.providerFactory.setProvider('activityProvider', activityProvider);
|
|
452
|
-
this.providerFactory.setProvider('searchProvider', searchProvider);
|
|
453
|
-
this.providerFactory.setProvider('presenceProvider', presenceProvider);
|
|
454
|
-
this.providerFactory.setProvider('macroProvider', macroProvider);
|
|
455
|
-
var cardProvider = (linking === null || linking === void 0 ? void 0 : (_linking$smartLinks = linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
|
|
456
|
-
if (cardProvider) {
|
|
457
|
-
this.providerFactory.setProvider('cardProvider', cardProvider);
|
|
458
|
-
}
|
|
459
|
-
this.providerFactory.setProvider('autoformattingProvider', autoformattingProvider);
|
|
460
|
-
if (extensionProvider) {
|
|
461
|
-
this.providerFactory.setProvider('extensionProvider', Promise.resolve(extensionProvider));
|
|
462
|
-
}
|
|
463
|
-
if (quickInsertProvider) {
|
|
464
|
-
this.providerFactory.setProvider('quickInsertProvider', quickInsertProvider);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}, {
|
|
468
|
-
key: "getBaseFontSize",
|
|
469
|
-
value: function getBaseFontSize() {
|
|
470
|
-
return !['comment', 'chromeless', 'mobile'].includes(this.props.appearance) ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined;
|
|
471
|
-
}
|
|
472
253
|
|
|
473
254
|
/**
|
|
474
255
|
* @private
|
|
@@ -476,23 +257,16 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
476
257
|
* Please reach out to the Editor team if you were previously using this
|
|
477
258
|
* and need to find a workaround.
|
|
478
259
|
*/
|
|
260
|
+
}, {
|
|
261
|
+
key: "unregisterEditorFromActions",
|
|
262
|
+
value: function unregisterEditorFromActions() {
|
|
263
|
+
this.editorActions._privateUnregisterEditor();
|
|
264
|
+
}
|
|
479
265
|
}, {
|
|
480
266
|
key: "render",
|
|
481
267
|
value: function render() {
|
|
482
|
-
var
|
|
483
|
-
|
|
484
|
-
_this5 = this;
|
|
485
|
-
var Component = (0, _createEditor.getUiComponent)(this.props.appearance);
|
|
486
|
-
var overriddenEditorProps = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
487
|
-
onSave: this.props.onSave ? this.handleSave : undefined,
|
|
488
|
-
// noop all analytic events, even if a handler is still passed.
|
|
489
|
-
analyticsHandler: undefined
|
|
490
|
-
});
|
|
491
|
-
var featureFlags = (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(this.props);
|
|
492
|
-
var renderTracking = (_this$props$performan = this.props.performanceTracking) === null || _this$props$performan === void 0 ? void 0 : (_this$props$performan2 = _this$props$performan.renderTracking) === null || _this$props$performan2 === void 0 ? void 0 : _this$props$performan2.editor;
|
|
493
|
-
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
494
|
-
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
495
|
-
return (0, _react2.jsx)(_analyticsNamespacedContext.FabricEditorAnalyticsContext, {
|
|
268
|
+
var _this5 = this;
|
|
269
|
+
return (0, _react.jsx)(_analyticsNamespacedContext.FabricEditorAnalyticsContext, {
|
|
496
270
|
data: {
|
|
497
271
|
packageName: _versionWrapper.name,
|
|
498
272
|
packageVersion: _versionWrapper.version,
|
|
@@ -500,108 +274,28 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
500
274
|
appearance: (0, _utils.getAnalyticsAppearance)(this.props.appearance),
|
|
501
275
|
editorSessionId: this.editorSessionId
|
|
502
276
|
}
|
|
503
|
-
}, (0,
|
|
277
|
+
}, (0, _react.jsx)(_ui.WithCreateAnalyticsEvent, {
|
|
504
278
|
render: function render(createAnalyticsEvent) {
|
|
505
|
-
return (_this5.createAnalyticsEvent = createAnalyticsEvent) && (0,
|
|
506
|
-
|
|
507
|
-
action: _analytics.ACTION.RE_RENDERED,
|
|
508
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
279
|
+
return (_this5.createAnalyticsEvent = createAnalyticsEvent) && (0, _react.jsx)(_editorInternal.EditorInternalWithoutHooks, {
|
|
280
|
+
props: _this5.props,
|
|
509
281
|
handleAnalyticsEvent: _this5.handleAnalyticsEvent,
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
editorActions: _this5.editorActions
|
|
519
|
-
}, (0, _react2.jsx)(_contextAdapter.ContextAdapter, null, (0, _react2.jsx)(_PortalProvider.PortalProviderWithThemeProviders, {
|
|
520
|
-
onAnalyticsEvent: _this5.handleAnalyticsEvent,
|
|
521
|
-
useAnalyticsContext: _this5.props.UNSAFE_useAnalyticsContext,
|
|
522
|
-
render: function render(portalProviderAPI) {
|
|
523
|
-
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_createEditor.ReactEditorView, {
|
|
524
|
-
editorProps: overriddenEditorProps,
|
|
525
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
526
|
-
portalProviderAPI: portalProviderAPI,
|
|
527
|
-
providerFactory: _this5.providerFactory,
|
|
528
|
-
onEditorCreated: _this5.onEditorCreated,
|
|
529
|
-
onEditorDestroyed: _this5.onEditorDestroyed,
|
|
530
|
-
allowAnalyticsGASV3: _this5.props.allowAnalyticsGASV3,
|
|
531
|
-
disabled: _this5.props.disabled,
|
|
532
|
-
render: function render(_ref3) {
|
|
533
|
-
var _this5$props$featureF, _this5$props$featureF2;
|
|
534
|
-
var editor = _ref3.editor,
|
|
535
|
-
view = _ref3.view,
|
|
536
|
-
eventDispatcher = _ref3.eventDispatcher,
|
|
537
|
-
config = _ref3.config,
|
|
538
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
539
|
-
editorRef = _ref3.editorRef;
|
|
540
|
-
return (0, _react2.jsx)(_ui.BaseTheme, {
|
|
541
|
-
baseFontSize: _this5.getBaseFontSize()
|
|
542
|
-
}, (0, _react2.jsx)(Component, {
|
|
543
|
-
innerRef: editorRef,
|
|
544
|
-
appearance: _this5.props.appearance,
|
|
545
|
-
disabled: _this5.props.disabled,
|
|
546
|
-
editorActions: _this5.editorActions,
|
|
547
|
-
editorDOMElement: editor,
|
|
548
|
-
editorView: view,
|
|
549
|
-
providerFactory: _this5.providerFactory,
|
|
550
|
-
eventDispatcher: eventDispatcher,
|
|
551
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
552
|
-
maxHeight: _this5.props.maxHeight,
|
|
553
|
-
minHeight: _this5.props.minHeight,
|
|
554
|
-
onSave: _this5.props.onSave ? _this5.handleSave : undefined,
|
|
555
|
-
onCancel: _this5.props.onCancel,
|
|
556
|
-
popupsMountPoint: _this5.props.popupsMountPoint,
|
|
557
|
-
popupsBoundariesElement: _this5.props.popupsBoundariesElement,
|
|
558
|
-
popupsScrollableElement: _this5.props.popupsScrollableElement,
|
|
559
|
-
contentComponents: config.contentComponents,
|
|
560
|
-
primaryToolbarComponents: config.primaryToolbarComponents,
|
|
561
|
-
primaryToolbarIconBefore: _this5.props.primaryToolbarIconBefore,
|
|
562
|
-
secondaryToolbarComponents: config.secondaryToolbarComponents,
|
|
563
|
-
insertMenuItems: _this5.props.insertMenuItems,
|
|
564
|
-
customContentComponents: _this5.props.contentComponents,
|
|
565
|
-
customPrimaryToolbarComponents: _this5.props.primaryToolbarComponents,
|
|
566
|
-
customSecondaryToolbarComponents: _this5.props.secondaryToolbarComponents,
|
|
567
|
-
contextPanel: _this5.props.contextPanel,
|
|
568
|
-
collabEdit: _this5.props.collabEdit,
|
|
569
|
-
persistScrollGutter: _this5.props.persistScrollGutter,
|
|
570
|
-
enableToolbarMinWidth: ((_this5$props$featureF = _this5.props.featureFlags) === null || _this5$props$featureF === void 0 ? void 0 : _this5$props$featureF.toolbarMinWidthOverflow) != null ? !!((_this5$props$featureF2 = _this5.props.featureFlags) !== null && _this5$props$featureF2 !== void 0 && _this5$props$featureF2.toolbarMinWidthOverflow) : _this5.props.allowUndoRedoButtons,
|
|
571
|
-
useStickyToolbar: _this5.props.useStickyToolbar,
|
|
572
|
-
featureFlags: featureFlags
|
|
573
|
-
}));
|
|
574
|
-
}
|
|
575
|
-
}), (0, _react2.jsx)(_PortalProvider.PortalRenderer, {
|
|
576
|
-
portalProviderAPI: portalProviderAPI
|
|
577
|
-
}));
|
|
578
|
-
}
|
|
579
|
-
}))))));
|
|
282
|
+
createAnalyticsEvent: _this5.createAnalyticsEvent,
|
|
283
|
+
preset: _this5.state.preset,
|
|
284
|
+
handleSave: _this5.handleSave,
|
|
285
|
+
editorActions: _this5.editorActions,
|
|
286
|
+
providerFactory: _this5.providerFactory,
|
|
287
|
+
onEditorCreated: _this5.onEditorCreated,
|
|
288
|
+
onEditorDestroyed: _this5.onEditorDestroyed
|
|
289
|
+
});
|
|
580
290
|
}
|
|
581
291
|
}));
|
|
582
292
|
}
|
|
583
293
|
}]);
|
|
584
294
|
return Editor;
|
|
585
|
-
}(
|
|
295
|
+
}(_react2.default.Component);
|
|
586
296
|
exports.default = Editor;
|
|
587
|
-
(0, _defineProperty2.default)(Editor, "defaultProps",
|
|
588
|
-
appearance: 'comment',
|
|
589
|
-
disabled: false,
|
|
590
|
-
extensionHandlers: {},
|
|
591
|
-
allowHelpDialog: true,
|
|
592
|
-
allowNewInsertionBehaviour: true,
|
|
593
|
-
quickInsert: true
|
|
594
|
-
});
|
|
595
|
-
(0, _defineProperty2.default)(Editor, "propTypes", {
|
|
596
|
-
minHeight: function minHeight(_ref4) {
|
|
597
|
-
var appearance = _ref4.appearance,
|
|
598
|
-
_minHeight = _ref4.minHeight;
|
|
599
|
-
if (_minHeight && appearance && !['comment', 'chromeless'].includes(appearance)) {
|
|
600
|
-
return new Error('minHeight only supports editor appearance chromeless and comment');
|
|
601
|
-
}
|
|
602
|
-
return null;
|
|
603
|
-
}
|
|
604
|
-
});
|
|
297
|
+
(0, _defineProperty2.default)(Editor, "defaultProps", _editorPropTypes.defaultProps);
|
|
605
298
|
(0, _defineProperty2.default)(Editor, "contextTypes", {
|
|
606
299
|
editorActions: _propTypes.default.object
|
|
607
|
-
});
|
|
300
|
+
});
|
|
301
|
+
(0, _defineProperty2.default)(Editor, "propTypes", (0, _editorPropTypes.propTypes)('minHeight only supports editor appearance chromeless and comment for Editor'));
|