@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/esm/editor.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
3
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -6,139 +5,128 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
10
|
-
var _templateObject;
|
|
11
|
-
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; }
|
|
12
|
-
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; }
|
|
13
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
14
8
|
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); }; }
|
|
15
9
|
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; } }
|
|
16
10
|
/** @jsx jsx */
|
|
17
|
-
import
|
|
18
|
-
import { css, jsx } from '@emotion/react';
|
|
11
|
+
import { jsx } from '@emotion/react';
|
|
19
12
|
import PropTypes from 'prop-types';
|
|
20
|
-
import
|
|
21
|
-
import uuid from 'uuid/v4';
|
|
22
|
-
import { name, version } from './version-wrapper';
|
|
23
|
-
import { combineExtensionProviders } from '@atlaskit/editor-common/extensions';
|
|
13
|
+
import React from 'react';
|
|
24
14
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
25
|
-
import {
|
|
26
|
-
import { getAnalyticsAppearance
|
|
27
|
-
import {
|
|
28
|
-
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
15
|
+
import { WithCreateAnalyticsEvent } from '@atlaskit/editor-common/ui';
|
|
16
|
+
import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils';
|
|
17
|
+
import { name, version } from './version-wrapper';
|
|
29
18
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
30
|
-
import
|
|
19
|
+
import uuid from 'uuid/v4';
|
|
31
20
|
import EditorActions from './actions';
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
21
|
+
import { EditorInternalWithoutHooks as EditorInternal } from './editor-next/editor-internal';
|
|
22
|
+
import { defaultProps, propTypes } from './editor-next/utils/editorPropTypes';
|
|
23
|
+
import _trackEditorActions from './editor-next/utils/trackEditorActions';
|
|
24
|
+
import _onEditorCreated from './editor-next/utils/onEditorCreated';
|
|
25
|
+
import deprecationWarnings from './editor-next/utils/deprecationWarnings';
|
|
26
|
+
import { fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
38
27
|
import prepareQuickInsertProvider from './utils/prepare-quick-insert-provider';
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
|
|
28
|
+
import prepareExtensionProvider from './utils/prepare-extension-provider';
|
|
29
|
+
import handleProviders from './editor-next/utils/handleProviders';
|
|
30
|
+
import getProvidersFromEditorProps from './editor-next/utils/getProvidersFromEditorProps';
|
|
31
|
+
import { startMeasure, clearMeasure, stopMeasure, measureTTI } from '@atlaskit/editor-common/utils';
|
|
32
|
+
import measurements from './utils/performance/measure-enum';
|
|
33
|
+
import editorMeasureTTICallback from './editor-next/utils/editorMeasureTTICallback';
|
|
34
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
35
|
+
import sendDurationAnalytics from './editor-next/utils/sendDurationAnalytics';
|
|
36
|
+
import { createPreset } from './create-editor/create-plugins-list';
|
|
37
|
+
import { shouldRecreatePreset } from './create-editor/preset-utils';
|
|
44
38
|
var Editor = /*#__PURE__*/function (_React$Component) {
|
|
45
39
|
_inherits(Editor, _React$Component);
|
|
46
40
|
var _super = _createSuper(Editor);
|
|
41
|
+
/**
|
|
42
|
+
* WARNING: Code should be shared between Editor + EditorNext
|
|
43
|
+
* If you are making changes that affect both, consider making them
|
|
44
|
+
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
47
|
function Editor(props, context) {
|
|
48
48
|
var _props$performanceTra, _props$performanceTra2, _props$featureFlags;
|
|
49
49
|
var _this;
|
|
50
50
|
_classCallCheck(this, Editor);
|
|
51
51
|
_this = _super.call(this, props);
|
|
52
|
-
_defineProperty(_assertThisInitialized(_this), "prepareExtensionProvider",
|
|
53
|
-
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (typeof extensionProviders === 'function') {
|
|
57
|
-
return combineExtensionProviders(extensionProviders(_this.editorActions));
|
|
58
|
-
}
|
|
59
|
-
return combineExtensionProviders(extensionProviders);
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "prepareExtensionProvider", prepareExtensionProvider(function () {
|
|
53
|
+
return _this.editorActions;
|
|
60
54
|
}));
|
|
61
55
|
_defineProperty(_assertThisInitialized(_this), "prepareQuickInsertProvider", function (extensionProvider, quickInsert) {
|
|
62
56
|
return prepareQuickInsertProvider(_this.editorActions, extensionProvider, quickInsert, _this.createAnalyticsEvent);
|
|
63
57
|
});
|
|
64
58
|
_defineProperty(_assertThisInitialized(_this), "handleSave", function (view) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
return _this.props.onSave(view);
|
|
59
|
+
var _this$props$onSave, _this$props;
|
|
60
|
+
return (_this$props$onSave = (_this$props = _this.props).onSave) === null || _this$props$onSave === void 0 ? void 0 : _this$props$onSave.call(_this$props, view);
|
|
69
61
|
});
|
|
70
62
|
_defineProperty(_assertThisInitialized(_this), "handleAnalyticsEvent", function (data) {
|
|
71
63
|
return fireAnalyticsEvent(_this.createAnalyticsEvent)(data);
|
|
72
64
|
});
|
|
65
|
+
_defineProperty(_assertThisInitialized(_this), "getExperienceStore", function () {
|
|
66
|
+
return _this.experienceStore;
|
|
67
|
+
});
|
|
73
68
|
_this.providerFactory = new ProviderFactory();
|
|
74
|
-
|
|
75
|
-
_this.onEditorCreated = _this.onEditorCreated.bind(_assertThisInitialized(_this));
|
|
76
|
-
_this.onEditorDestroyed = _this.onEditorDestroyed.bind(_assertThisInitialized(_this));
|
|
69
|
+
deprecationWarnings(props);
|
|
77
70
|
_this.editorActions = (context || {}).editorActions || new EditorActions();
|
|
78
|
-
_this.trackEditorActions(_this.editorActions, props);
|
|
79
71
|
_this.editorSessionId = uuid();
|
|
80
72
|
_this.startTime = performance.now();
|
|
73
|
+
_this.onEditorCreated = _this.onEditorCreated.bind(_assertThisInitialized(_this));
|
|
74
|
+
_this.onEditorDestroyed = _this.onEditorDestroyed.bind(_assertThisInitialized(_this));
|
|
75
|
+
_this.getExperienceStore = _this.getExperienceStore.bind(_assertThisInitialized(_this));
|
|
76
|
+
_this.trackEditorActions(_this.editorActions, props);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
80
|
+
* `useEditorConstructor` (editor-next/hooks/useEditorMeasuresConstructor.ts)
|
|
81
|
+
*/
|
|
81
82
|
startMeasure(measurements.EDITOR_MOUNTED);
|
|
82
83
|
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) {
|
|
83
|
-
var _props$
|
|
84
|
+
var _props$performanceTra3, _props$performanceTra4, _props$performanceTra5, _props$performanceTra6;
|
|
84
85
|
measureTTI(function (tti, ttiFromInvocation, canceled) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var _ttiTracking;
|
|
88
|
-
var ttiEvent = {
|
|
89
|
-
payload: {
|
|
90
|
-
action: ACTION.EDITOR_TTI,
|
|
91
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
92
|
-
attributes: {
|
|
93
|
-
tti: tti,
|
|
94
|
-
ttiFromInvocation: ttiFromInvocation,
|
|
95
|
-
canceled: canceled
|
|
96
|
-
},
|
|
97
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
if ((_ttiTracking = props.performanceTracking.ttiTracking) !== null && _ttiTracking !== void 0 && _ttiTracking.trackSeverity) {
|
|
101
|
-
var _ttiTracking2 = props.performanceTracking.ttiTracking,
|
|
102
|
-
ttiSeverityNormalThreshold = _ttiTracking2.ttiSeverityNormalThreshold,
|
|
103
|
-
ttiSeverityDegradedThreshold = _ttiTracking2.ttiSeverityDegradedThreshold,
|
|
104
|
-
ttiFromInvocationSeverityNormalThreshold = _ttiTracking2.ttiFromInvocationSeverityNormalThreshold,
|
|
105
|
-
ttiFromInvocationSeverityDegradedThreshold = _ttiTracking2.ttiFromInvocationSeverityDegradedThreshold;
|
|
106
|
-
var _getTTISeverity = getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold),
|
|
107
|
-
ttiSeverity = _getTTISeverity.ttiSeverity,
|
|
108
|
-
ttiFromInvocationSeverity = _getTTISeverity.ttiFromInvocationSeverity;
|
|
109
|
-
ttiEvent.payload.attributes.ttiSeverity = ttiSeverity;
|
|
110
|
-
ttiEvent.payload.attributes.ttiFromInvocationSeverity = ttiFromInvocationSeverity;
|
|
111
|
-
}
|
|
112
|
-
fireAnalyticsEvent(_this.createAnalyticsEvent)(ttiEvent);
|
|
113
|
-
}
|
|
114
|
-
if ((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.ufo) {
|
|
115
|
-
var _this$experienceStore, _this$experienceStore2;
|
|
116
|
-
(_this$experienceStore = _this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.mark(EditorExperience.loadEditor, ACTION.EDITOR_TTI, tti);
|
|
117
|
-
(_this$experienceStore2 = _this.experienceStore) === null || _this$experienceStore2 === void 0 ? void 0 : _this$experienceStore2.success(EditorExperience.loadEditor);
|
|
118
|
-
}
|
|
119
|
-
}, (_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);
|
|
86
|
+
editorMeasureTTICallback(tti, ttiFromInvocation, canceled, _this.props.performanceTracking, _this.props.featureFlags, _this.createAnalyticsEvent, _this.experienceStore);
|
|
87
|
+
}, (_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);
|
|
120
88
|
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
92
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
93
|
+
*/
|
|
121
94
|
var _extensionProvider = _this.prepareExtensionProvider(props.extensionProviders);
|
|
122
95
|
var quickInsertProvider = _this.prepareQuickInsertProvider(_extensionProvider, props.quickInsert);
|
|
96
|
+
var preset = createPreset(props, undefined, _this.createAnalyticsEvent);
|
|
123
97
|
_this.state = {
|
|
124
98
|
extensionProvider: _extensionProvider,
|
|
125
|
-
quickInsertProvider: quickInsertProvider
|
|
99
|
+
quickInsertProvider: quickInsertProvider,
|
|
100
|
+
preset: preset
|
|
126
101
|
};
|
|
127
102
|
return _this;
|
|
128
103
|
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
107
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
108
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
109
|
+
*/
|
|
129
110
|
_createClass(Editor, [{
|
|
130
111
|
key: "componentDidMount",
|
|
131
112
|
value: function componentDidMount() {
|
|
132
|
-
stopMeasure(measurements.EDITOR_MOUNTED,
|
|
133
|
-
this.
|
|
113
|
+
stopMeasure(measurements.EDITOR_MOUNTED, sendDurationAnalytics(ACTION.EDITOR_MOUNTED, this.props, this.getExperienceStore, this.createAnalyticsEvent));
|
|
114
|
+
handleProviders(this.providerFactory, getProvidersFromEditorProps(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
134
115
|
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
119
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
120
|
+
*/
|
|
135
121
|
}, {
|
|
136
122
|
key: "componentDidUpdate",
|
|
137
123
|
value: function componentDidUpdate(prevProps) {
|
|
138
124
|
var _this2 = this;
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
125
|
+
var needsANewPreset = shouldRecreatePreset(prevProps, this.props);
|
|
126
|
+
var preset = needsANewPreset ? createPreset(this.props, prevProps, this.createAnalyticsEvent) : this.state.preset;
|
|
127
|
+
var _this$props2 = this.props,
|
|
128
|
+
extensionProviders = _this$props2.extensionProviders,
|
|
129
|
+
quickInsert = _this$props2.quickInsert;
|
|
142
130
|
if (extensionProviders && extensionProviders !== prevProps.extensionProviders ||
|
|
143
131
|
// Though this will introduce some performance regression related to quick insert
|
|
144
132
|
// loading but we can remove it soon when Forge will move to new API.
|
|
@@ -148,25 +136,38 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
148
136
|
var quickInsertProvider = this.prepareQuickInsertProvider(extensionProvider, quickInsert);
|
|
149
137
|
this.setState({
|
|
150
138
|
extensionProvider: extensionProvider,
|
|
151
|
-
quickInsertProvider: quickInsertProvider
|
|
139
|
+
quickInsertProvider: quickInsertProvider,
|
|
140
|
+
preset: preset
|
|
152
141
|
}, function () {
|
|
153
|
-
return _this2.
|
|
142
|
+
return handleProviders(_this2.providerFactory, getProvidersFromEditorProps(_this2.props), _this2.state.extensionProvider, _this2.state.quickInsertProvider);
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (needsANewPreset) {
|
|
147
|
+
this.setState({
|
|
148
|
+
preset: preset
|
|
154
149
|
});
|
|
155
150
|
return;
|
|
156
151
|
}
|
|
157
|
-
this.
|
|
152
|
+
handleProviders(this.providerFactory, getProvidersFromEditorProps(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
158
153
|
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
157
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
158
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
159
|
+
*/
|
|
159
160
|
}, {
|
|
160
161
|
key: "componentWillUnmount",
|
|
161
162
|
value: function componentWillUnmount() {
|
|
162
|
-
var _this$
|
|
163
|
+
var _this$props3, _this$props3$performa, _this$props3$performa2, _this$props$featureFl;
|
|
163
164
|
this.unregisterEditorFromActions();
|
|
164
165
|
this.providerFactory.destroy();
|
|
165
166
|
clearMeasure(measurements.EDITOR_MOUNTED);
|
|
166
|
-
((_this$
|
|
167
|
+
((_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) && clearMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
167
168
|
if ((_this$props$featureFl = this.props.featureFlags) !== null && _this$props$featureFl !== void 0 && _this$props$featureFl.ufo) {
|
|
168
|
-
var _this$
|
|
169
|
-
(_this$
|
|
169
|
+
var _this$experienceStore;
|
|
170
|
+
(_this$experienceStore = this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.abortAll({
|
|
170
171
|
reason: 'editor component unmounted'
|
|
171
172
|
});
|
|
172
173
|
}
|
|
@@ -181,88 +182,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
181
182
|
}, {
|
|
182
183
|
key: "trackEditorActions",
|
|
183
184
|
value: function trackEditorActions(editorActions, props) {
|
|
184
|
-
var
|
|
185
|
-
|
|
186
|
-
_this3
|
|
187
|
-
|
|
188
|
-
var DEFAULT_SAMPLING_RATE = 100;
|
|
189
|
-
var getValue = editorActions.getValue.bind(editorActions);
|
|
190
|
-
if (!editorActions._contentRetrievalTracking) {
|
|
191
|
-
editorActions._contentRetrievalTracking = {
|
|
192
|
-
samplingCounters: {
|
|
193
|
-
success: 1,
|
|
194
|
-
failure: 1
|
|
195
|
-
},
|
|
196
|
-
getValueTracked: false
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
var _editorActions$_conte = editorActions._contentRetrievalTracking,
|
|
200
|
-
samplingCounters = _editorActions$_conte.samplingCounters,
|
|
201
|
-
getValueTracked = _editorActions$_conte.getValueTracked;
|
|
202
|
-
if (!getValueTracked) {
|
|
203
|
-
var getValueWithTracking = /*#__PURE__*/function () {
|
|
204
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
205
|
-
var _props$performanceTra11, _props$performanceTra12, _props$performanceTra13, value, _props$performanceTra14, _props$performanceTra15, _props$performanceTra16, _props$performanceTra17, _props$performanceTra18;
|
|
206
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
207
|
-
while (1) {
|
|
208
|
-
switch (_context.prev = _context.next) {
|
|
209
|
-
case 0:
|
|
210
|
-
_context.prev = 0;
|
|
211
|
-
_context.next = 3;
|
|
212
|
-
return getValue();
|
|
213
|
-
case 3:
|
|
214
|
-
value = _context.sent;
|
|
215
|
-
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)) {
|
|
216
|
-
_this3.handleAnalyticsEvent({
|
|
217
|
-
payload: {
|
|
218
|
-
action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
219
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
220
|
-
attributes: {
|
|
221
|
-
success: true
|
|
222
|
-
},
|
|
223
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
samplingCounters.success = 0;
|
|
227
|
-
}
|
|
228
|
-
samplingCounters.success++;
|
|
229
|
-
return _context.abrupt("return", value);
|
|
230
|
-
case 9:
|
|
231
|
-
_context.prev = 9;
|
|
232
|
-
_context.t0 = _context["catch"](0);
|
|
233
|
-
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)) {
|
|
234
|
-
_this3.handleAnalyticsEvent({
|
|
235
|
-
payload: {
|
|
236
|
-
action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
237
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
238
|
-
attributes: {
|
|
239
|
-
success: false,
|
|
240
|
-
errorInfo: _context.t0.toString(),
|
|
241
|
-
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
|
|
242
|
-
},
|
|
243
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
samplingCounters.failure = 0;
|
|
247
|
-
}
|
|
248
|
-
samplingCounters.failure++;
|
|
249
|
-
throw _context.t0;
|
|
250
|
-
case 14:
|
|
251
|
-
case "end":
|
|
252
|
-
return _context.stop();
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}, _callee, null, [[0, 9]]);
|
|
256
|
-
}));
|
|
257
|
-
return function getValueWithTracking() {
|
|
258
|
-
return _ref.apply(this, arguments);
|
|
259
|
-
};
|
|
260
|
-
}();
|
|
261
|
-
editorActions.getValue = getValueWithTracking;
|
|
262
|
-
editorActions._contentRetrievalTracking.getValueTracked = true;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return editorActions;
|
|
185
|
+
var _this3 = this;
|
|
186
|
+
return _trackEditorActions(editorActions, props.performanceTracking, function (value) {
|
|
187
|
+
return _this3.handleAnalyticsEvent(value);
|
|
188
|
+
});
|
|
266
189
|
}
|
|
267
190
|
|
|
268
191
|
/**
|
|
@@ -281,108 +204,14 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
281
204
|
* and need to find a workaround.
|
|
282
205
|
*/
|
|
283
206
|
function onEditorCreated(instance) {
|
|
284
|
-
var _this$props$featureFl2;
|
|
285
|
-
this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
|
|
286
|
-
if ((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.ufo) {
|
|
287
|
-
this.experienceStore = ExperienceStore.getInstance(instance.view);
|
|
288
|
-
this.experienceStore.start(EditorExperience.loadEditor, this.startTime);
|
|
289
|
-
}
|
|
290
|
-
if (this.props.onEditorReady) {
|
|
291
|
-
var _this$props3, _this$props3$performa, _this$props3$performa2, _this$props$featureFl3;
|
|
292
|
-
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);
|
|
293
|
-
measureEditorReady && startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
294
|
-
this.props.onEditorReady(this.editorActions);
|
|
295
|
-
measureEditorReady && stopMeasure(measurements.ON_EDITOR_READY_CALLBACK, this.sendDurationAnalytics(ACTION.ON_EDITOR_READY_CALLBACK));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}, {
|
|
299
|
-
key: "sendDurationAnalytics",
|
|
300
|
-
value: function sendDurationAnalytics(action) {
|
|
301
207
|
var _this4 = this;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
switch (_context2.prev = _context2.next) {
|
|
309
|
-
case 0:
|
|
310
|
-
_context2.next = 2;
|
|
311
|
-
return _this4.props.contextIdentifierProvider;
|
|
312
|
-
case 2:
|
|
313
|
-
contextIdentifier = _context2.sent;
|
|
314
|
-
objectId = contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId;
|
|
315
|
-
if (_this4.createAnalyticsEvent) {
|
|
316
|
-
fireAnalyticsEvent(_this4.createAnalyticsEvent)({
|
|
317
|
-
payload: {
|
|
318
|
-
action: action,
|
|
319
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
320
|
-
attributes: {
|
|
321
|
-
duration: duration,
|
|
322
|
-
startTime: startTime,
|
|
323
|
-
objectId: objectId
|
|
324
|
-
},
|
|
325
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
if ((_this4$props$featureF = _this4.props.featureFlags) !== null && _this4$props$featureF !== void 0 && _this4$props$featureF.ufo) {
|
|
330
|
-
(_this4$experienceStor = _this4.experienceStore) === null || _this4$experienceStor === void 0 ? void 0 : _this4$experienceStor.mark(EditorExperience.loadEditor, action, startTime + duration);
|
|
331
|
-
(_this4$experienceStor2 = _this4.experienceStore) === null || _this4$experienceStor2 === void 0 ? void 0 : _this4$experienceStor2.addMetadata(EditorExperience.loadEditor, {
|
|
332
|
-
objectId: objectId
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
case 6:
|
|
336
|
-
case "end":
|
|
337
|
-
return _context2.stop();
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}, _callee2);
|
|
341
|
-
}));
|
|
342
|
-
return function (_x, _x2) {
|
|
343
|
-
return _ref2.apply(this, arguments);
|
|
344
|
-
};
|
|
345
|
-
}();
|
|
346
|
-
}
|
|
347
|
-
}, {
|
|
348
|
-
key: "deprecationWarnings",
|
|
349
|
-
value: function deprecationWarnings(props) {
|
|
350
|
-
var _props$allowTextColor;
|
|
351
|
-
if (process.env.NODE_ENV === 'production') {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
var nextVersion = nextMajorVersion();
|
|
355
|
-
var deprecatedProperties = {
|
|
356
|
-
allowTasksAndDecisions: {
|
|
357
|
-
message: 'To allow tasks and decisions use taskDecisionProvider – <Editor taskDecisionProvider={{ provider }} />',
|
|
358
|
-
type: 'removed'
|
|
359
|
-
},
|
|
360
|
-
allowConfluenceInlineComment: {
|
|
361
|
-
message: 'To integrate inline comments use experimental annotationProvider – <Editor annotationProviders={{ provider }} />',
|
|
362
|
-
type: 'removed'
|
|
363
|
-
},
|
|
364
|
-
smartLinks: {
|
|
365
|
-
message: 'To use smartLinks, pass the same object into the smartlinks key of linking - <Editor linking={{ smartLinks: {existing object} }}.',
|
|
366
|
-
type: 'removed'
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
Object.keys(deprecatedProperties).forEach(function (property) {
|
|
370
|
-
if (props.hasOwnProperty(property)) {
|
|
371
|
-
var meta = deprecatedProperties[property];
|
|
372
|
-
var type = meta.type || 'enabled by default';
|
|
373
|
-
|
|
374
|
-
// eslint-disable-next-line no-console
|
|
375
|
-
console.warn("".concat(property, " property is deprecated. ").concat(meta.message || '', " [Will be ").concat(type, " in editor-core@").concat(nextVersion, "]"));
|
|
376
|
-
}
|
|
208
|
+
_onEditorCreated(instance, this.props, function (experienceStore) {
|
|
209
|
+
return _this4.experienceStore = experienceStore;
|
|
210
|
+
}, this.getExperienceStore, function () {
|
|
211
|
+
return _this4.createAnalyticsEvent;
|
|
212
|
+
}, this.editorActions, this.startTime, function (view, dispatcher, transformerForActions) {
|
|
213
|
+
return _this4.registerEditorForActions(view, dispatcher, transformerForActions);
|
|
377
214
|
});
|
|
378
|
-
if (props.hasOwnProperty('allowTables') && typeof props.allowTables !== 'boolean' && (!props.allowTables || !props.allowTables.advanced)) {
|
|
379
|
-
// eslint-disable-next-line no-console
|
|
380
|
-
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, "]"));
|
|
381
|
-
}
|
|
382
|
-
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) {
|
|
383
|
-
// eslint-disable-next-line no-console
|
|
384
|
-
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."));
|
|
385
|
-
}
|
|
386
215
|
}
|
|
387
216
|
|
|
388
217
|
/**
|
|
@@ -394,74 +223,29 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
394
223
|
}, {
|
|
395
224
|
key: "onEditorDestroyed",
|
|
396
225
|
value: function onEditorDestroyed(_instance) {
|
|
226
|
+
var _this$props$onDestroy, _this$props4;
|
|
397
227
|
this.unregisterEditorFromActions();
|
|
398
|
-
|
|
399
|
-
this.props.onDestroy();
|
|
400
|
-
}
|
|
228
|
+
(_this$props$onDestroy = (_this$props4 = this.props).onDestroy) === null || _this$props$onDestroy === void 0 ? void 0 : _this$props$onDestroy.call(_this$props4);
|
|
401
229
|
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @private
|
|
233
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
234
|
+
* Please reach out to the Editor team if you were previously using this
|
|
235
|
+
* and need to find a workaround.
|
|
236
|
+
*/
|
|
402
237
|
}, {
|
|
403
238
|
key: "registerEditorForActions",
|
|
404
|
-
value:
|
|
239
|
+
value:
|
|
240
|
+
/**
|
|
241
|
+
* @private
|
|
242
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
243
|
+
* Please reach out to the Editor team if you were previously using this
|
|
244
|
+
* and need to find a workaround.
|
|
245
|
+
*/
|
|
246
|
+
function registerEditorForActions(editorView, eventDispatcher, contentTransformer) {
|
|
405
247
|
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer);
|
|
406
248
|
}
|
|
407
|
-
}, {
|
|
408
|
-
key: "unregisterEditorFromActions",
|
|
409
|
-
value: function unregisterEditorFromActions() {
|
|
410
|
-
if (this.editorActions) {
|
|
411
|
-
this.editorActions._privateUnregisterEditor();
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}, {
|
|
415
|
-
key: "handleProviders",
|
|
416
|
-
value: function handleProviders(props) {
|
|
417
|
-
var _linking$smartLinks;
|
|
418
|
-
var emojiProvider = props.emojiProvider,
|
|
419
|
-
mentionProvider = props.mentionProvider,
|
|
420
|
-
taskDecisionProvider = props.taskDecisionProvider,
|
|
421
|
-
contextIdentifierProvider = props.contextIdentifierProvider,
|
|
422
|
-
collabEditProvider = props.collabEditProvider,
|
|
423
|
-
activityProvider = props.activityProvider,
|
|
424
|
-
presenceProvider = props.presenceProvider,
|
|
425
|
-
macroProvider = props.macroProvider,
|
|
426
|
-
legacyImageUploadProvider = props.legacyImageUploadProvider,
|
|
427
|
-
media = props.media,
|
|
428
|
-
collabEdit = props.collabEdit,
|
|
429
|
-
autoformattingProvider = props.autoformattingProvider,
|
|
430
|
-
searchProvider = props.searchProvider,
|
|
431
|
-
UNSAFE_cards = props.UNSAFE_cards,
|
|
432
|
-
smartLinks = props.smartLinks,
|
|
433
|
-
linking = props.linking;
|
|
434
|
-
var _this$state = this.state,
|
|
435
|
-
extensionProvider = _this$state.extensionProvider,
|
|
436
|
-
quickInsertProvider = _this$state.quickInsertProvider;
|
|
437
|
-
this.providerFactory.setProvider('emojiProvider', emojiProvider);
|
|
438
|
-
this.providerFactory.setProvider('mentionProvider', mentionProvider);
|
|
439
|
-
this.providerFactory.setProvider('taskDecisionProvider', taskDecisionProvider);
|
|
440
|
-
this.providerFactory.setProvider('contextIdentifierProvider', contextIdentifierProvider);
|
|
441
|
-
this.providerFactory.setProvider('mediaProvider', media && media.provider);
|
|
442
|
-
this.providerFactory.setProvider('imageUploadProvider', legacyImageUploadProvider);
|
|
443
|
-
this.providerFactory.setProvider('collabEditProvider', collabEdit && collabEdit.provider ? collabEdit.provider : collabEditProvider);
|
|
444
|
-
this.providerFactory.setProvider('activityProvider', activityProvider);
|
|
445
|
-
this.providerFactory.setProvider('searchProvider', searchProvider);
|
|
446
|
-
this.providerFactory.setProvider('presenceProvider', presenceProvider);
|
|
447
|
-
this.providerFactory.setProvider('macroProvider', macroProvider);
|
|
448
|
-
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;
|
|
449
|
-
if (cardProvider) {
|
|
450
|
-
this.providerFactory.setProvider('cardProvider', cardProvider);
|
|
451
|
-
}
|
|
452
|
-
this.providerFactory.setProvider('autoformattingProvider', autoformattingProvider);
|
|
453
|
-
if (extensionProvider) {
|
|
454
|
-
this.providerFactory.setProvider('extensionProvider', Promise.resolve(extensionProvider));
|
|
455
|
-
}
|
|
456
|
-
if (quickInsertProvider) {
|
|
457
|
-
this.providerFactory.setProvider('quickInsertProvider', quickInsertProvider);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}, {
|
|
461
|
-
key: "getBaseFontSize",
|
|
462
|
-
value: function getBaseFontSize() {
|
|
463
|
-
return !['comment', 'chromeless', 'mobile'].includes(this.props.appearance) ? akEditorFullPageDefaultFontSize : undefined;
|
|
464
|
-
}
|
|
465
249
|
|
|
466
250
|
/**
|
|
467
251
|
* @private
|
|
@@ -469,22 +253,15 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
469
253
|
* Please reach out to the Editor team if you were previously using this
|
|
470
254
|
* and need to find a workaround.
|
|
471
255
|
*/
|
|
256
|
+
}, {
|
|
257
|
+
key: "unregisterEditorFromActions",
|
|
258
|
+
value: function unregisterEditorFromActions() {
|
|
259
|
+
this.editorActions._privateUnregisterEditor();
|
|
260
|
+
}
|
|
472
261
|
}, {
|
|
473
262
|
key: "render",
|
|
474
263
|
value: function render() {
|
|
475
|
-
var
|
|
476
|
-
_this$props$performan2,
|
|
477
|
-
_this5 = this;
|
|
478
|
-
var Component = getUiComponent(this.props.appearance);
|
|
479
|
-
var overriddenEditorProps = _objectSpread(_objectSpread({}, this.props), {}, {
|
|
480
|
-
onSave: this.props.onSave ? this.handleSave : undefined,
|
|
481
|
-
// noop all analytic events, even if a handler is still passed.
|
|
482
|
-
analyticsHandler: undefined
|
|
483
|
-
});
|
|
484
|
-
var featureFlags = createFeatureFlagsFromProps(this.props);
|
|
485
|
-
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;
|
|
486
|
-
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
487
|
-
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
264
|
+
var _this5 = this;
|
|
488
265
|
return jsx(FabricEditorAnalyticsContext, {
|
|
489
266
|
data: {
|
|
490
267
|
packageName: name,
|
|
@@ -495,106 +272,26 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
495
272
|
}
|
|
496
273
|
}, jsx(WithCreateAnalyticsEvent, {
|
|
497
274
|
render: function render(createAnalyticsEvent) {
|
|
498
|
-
return (_this5.createAnalyticsEvent = createAnalyticsEvent) && jsx(
|
|
499
|
-
|
|
500
|
-
action: ACTION.RE_RENDERED,
|
|
501
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
275
|
+
return (_this5.createAnalyticsEvent = createAnalyticsEvent) && jsx(EditorInternal, {
|
|
276
|
+
props: _this5.props,
|
|
502
277
|
handleAnalyticsEvent: _this5.handleAnalyticsEvent,
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
editorActions: _this5.editorActions
|
|
512
|
-
}, jsx(ContextAdapter, null, jsx(PortalProviderWithThemeProviders, {
|
|
513
|
-
onAnalyticsEvent: _this5.handleAnalyticsEvent,
|
|
514
|
-
useAnalyticsContext: _this5.props.UNSAFE_useAnalyticsContext,
|
|
515
|
-
render: function render(portalProviderAPI) {
|
|
516
|
-
return jsx(Fragment, null, jsx(ReactEditorView, {
|
|
517
|
-
editorProps: overriddenEditorProps,
|
|
518
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
519
|
-
portalProviderAPI: portalProviderAPI,
|
|
520
|
-
providerFactory: _this5.providerFactory,
|
|
521
|
-
onEditorCreated: _this5.onEditorCreated,
|
|
522
|
-
onEditorDestroyed: _this5.onEditorDestroyed,
|
|
523
|
-
allowAnalyticsGASV3: _this5.props.allowAnalyticsGASV3,
|
|
524
|
-
disabled: _this5.props.disabled,
|
|
525
|
-
render: function render(_ref3) {
|
|
526
|
-
var _this5$props$featureF, _this5$props$featureF2;
|
|
527
|
-
var editor = _ref3.editor,
|
|
528
|
-
view = _ref3.view,
|
|
529
|
-
eventDispatcher = _ref3.eventDispatcher,
|
|
530
|
-
config = _ref3.config,
|
|
531
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
532
|
-
editorRef = _ref3.editorRef;
|
|
533
|
-
return jsx(BaseTheme, {
|
|
534
|
-
baseFontSize: _this5.getBaseFontSize()
|
|
535
|
-
}, jsx(Component, {
|
|
536
|
-
innerRef: editorRef,
|
|
537
|
-
appearance: _this5.props.appearance,
|
|
538
|
-
disabled: _this5.props.disabled,
|
|
539
|
-
editorActions: _this5.editorActions,
|
|
540
|
-
editorDOMElement: editor,
|
|
541
|
-
editorView: view,
|
|
542
|
-
providerFactory: _this5.providerFactory,
|
|
543
|
-
eventDispatcher: eventDispatcher,
|
|
544
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
545
|
-
maxHeight: _this5.props.maxHeight,
|
|
546
|
-
minHeight: _this5.props.minHeight,
|
|
547
|
-
onSave: _this5.props.onSave ? _this5.handleSave : undefined,
|
|
548
|
-
onCancel: _this5.props.onCancel,
|
|
549
|
-
popupsMountPoint: _this5.props.popupsMountPoint,
|
|
550
|
-
popupsBoundariesElement: _this5.props.popupsBoundariesElement,
|
|
551
|
-
popupsScrollableElement: _this5.props.popupsScrollableElement,
|
|
552
|
-
contentComponents: config.contentComponents,
|
|
553
|
-
primaryToolbarComponents: config.primaryToolbarComponents,
|
|
554
|
-
primaryToolbarIconBefore: _this5.props.primaryToolbarIconBefore,
|
|
555
|
-
secondaryToolbarComponents: config.secondaryToolbarComponents,
|
|
556
|
-
insertMenuItems: _this5.props.insertMenuItems,
|
|
557
|
-
customContentComponents: _this5.props.contentComponents,
|
|
558
|
-
customPrimaryToolbarComponents: _this5.props.primaryToolbarComponents,
|
|
559
|
-
customSecondaryToolbarComponents: _this5.props.secondaryToolbarComponents,
|
|
560
|
-
contextPanel: _this5.props.contextPanel,
|
|
561
|
-
collabEdit: _this5.props.collabEdit,
|
|
562
|
-
persistScrollGutter: _this5.props.persistScrollGutter,
|
|
563
|
-
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,
|
|
564
|
-
useStickyToolbar: _this5.props.useStickyToolbar,
|
|
565
|
-
featureFlags: featureFlags
|
|
566
|
-
}));
|
|
567
|
-
}
|
|
568
|
-
}), jsx(PortalRenderer, {
|
|
569
|
-
portalProviderAPI: portalProviderAPI
|
|
570
|
-
}));
|
|
571
|
-
}
|
|
572
|
-
}))))));
|
|
278
|
+
createAnalyticsEvent: _this5.createAnalyticsEvent,
|
|
279
|
+
preset: _this5.state.preset,
|
|
280
|
+
handleSave: _this5.handleSave,
|
|
281
|
+
editorActions: _this5.editorActions,
|
|
282
|
+
providerFactory: _this5.providerFactory,
|
|
283
|
+
onEditorCreated: _this5.onEditorCreated,
|
|
284
|
+
onEditorDestroyed: _this5.onEditorDestroyed
|
|
285
|
+
});
|
|
573
286
|
}
|
|
574
287
|
}));
|
|
575
288
|
}
|
|
576
289
|
}]);
|
|
577
290
|
return Editor;
|
|
578
291
|
}(React.Component);
|
|
579
|
-
_defineProperty(Editor, "defaultProps",
|
|
580
|
-
appearance: 'comment',
|
|
581
|
-
disabled: false,
|
|
582
|
-
extensionHandlers: {},
|
|
583
|
-
allowHelpDialog: true,
|
|
584
|
-
allowNewInsertionBehaviour: true,
|
|
585
|
-
quickInsert: true
|
|
586
|
-
});
|
|
587
|
-
_defineProperty(Editor, "propTypes", {
|
|
588
|
-
minHeight: function minHeight(_ref4) {
|
|
589
|
-
var appearance = _ref4.appearance,
|
|
590
|
-
_minHeight = _ref4.minHeight;
|
|
591
|
-
if (_minHeight && appearance && !['comment', 'chromeless'].includes(appearance)) {
|
|
592
|
-
return new Error('minHeight only supports editor appearance chromeless and comment');
|
|
593
|
-
}
|
|
594
|
-
return null;
|
|
595
|
-
}
|
|
596
|
-
});
|
|
292
|
+
_defineProperty(Editor, "defaultProps", defaultProps);
|
|
597
293
|
_defineProperty(Editor, "contextTypes", {
|
|
598
294
|
editorActions: PropTypes.object
|
|
599
295
|
});
|
|
296
|
+
_defineProperty(Editor, "propTypes", propTypes('minHeight only supports editor appearance chromeless and comment for Editor'));
|
|
600
297
|
export { Editor as default };
|