@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/es2019/editor.js
CHANGED
|
@@ -1,119 +1,105 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import
|
|
4
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
7
|
-
import uuid from 'uuid/v4';
|
|
8
|
-
import { name, version } from './version-wrapper';
|
|
9
|
-
import { combineExtensionProviders } from '@atlaskit/editor-common/extensions';
|
|
5
|
+
import React from 'react';
|
|
10
6
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
11
|
-
import {
|
|
12
|
-
import { getAnalyticsAppearance
|
|
13
|
-
import {
|
|
14
|
-
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { WithCreateAnalyticsEvent } from '@atlaskit/editor-common/ui';
|
|
8
|
+
import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { name, version } from './version-wrapper';
|
|
15
10
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
16
|
-
import
|
|
11
|
+
import uuid from 'uuid/v4';
|
|
17
12
|
import EditorActions from './actions';
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
13
|
+
import { EditorInternalWithoutHooks as EditorInternal } from './editor-next/editor-internal';
|
|
14
|
+
import { defaultProps, propTypes } from './editor-next/utils/editorPropTypes';
|
|
15
|
+
import trackEditorActions from './editor-next/utils/trackEditorActions';
|
|
16
|
+
import onEditorCreated from './editor-next/utils/onEditorCreated';
|
|
17
|
+
import deprecationWarnings from './editor-next/utils/deprecationWarnings';
|
|
18
|
+
import { fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
24
19
|
import prepareQuickInsertProvider from './utils/prepare-quick-insert-provider';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
import prepareExtensionProvider from './utils/prepare-extension-provider';
|
|
21
|
+
import handleProviders from './editor-next/utils/handleProviders';
|
|
22
|
+
import getProvidersFromEditorProps from './editor-next/utils/getProvidersFromEditorProps';
|
|
23
|
+
import { startMeasure, clearMeasure, stopMeasure, measureTTI } from '@atlaskit/editor-common/utils';
|
|
24
|
+
import measurements from './utils/performance/measure-enum';
|
|
25
|
+
import editorMeasureTTICallback from './editor-next/utils/editorMeasureTTICallback';
|
|
26
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
27
|
+
import sendDurationAnalytics from './editor-next/utils/sendDurationAnalytics';
|
|
28
|
+
import { createPreset } from './create-editor/create-plugins-list';
|
|
29
|
+
import { shouldRecreatePreset } from './create-editor/preset-utils';
|
|
32
30
|
export default class Editor extends React.Component {
|
|
31
|
+
/**
|
|
32
|
+
* WARNING: Code should be shared between Editor + EditorNext
|
|
33
|
+
* If you are making changes that affect both, consider making them
|
|
34
|
+
* in editor-next/editor-internal.tsx or editor-next/editor-utils.ts
|
|
35
|
+
*/
|
|
36
|
+
|
|
33
37
|
constructor(props, context) {
|
|
34
38
|
var _props$performanceTra, _props$performanceTra2, _props$featureFlags;
|
|
35
39
|
super(props);
|
|
36
|
-
_defineProperty(this, "prepareExtensionProvider",
|
|
37
|
-
if (!extensionProviders) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (typeof extensionProviders === 'function') {
|
|
41
|
-
return combineExtensionProviders(extensionProviders(this.editorActions));
|
|
42
|
-
}
|
|
43
|
-
return combineExtensionProviders(extensionProviders);
|
|
44
|
-
}));
|
|
40
|
+
_defineProperty(this, "prepareExtensionProvider", prepareExtensionProvider(() => this.editorActions));
|
|
45
41
|
_defineProperty(this, "prepareQuickInsertProvider", (extensionProvider, quickInsert) => {
|
|
46
42
|
return prepareQuickInsertProvider(this.editorActions, extensionProvider, quickInsert, this.createAnalyticsEvent);
|
|
47
43
|
});
|
|
48
44
|
_defineProperty(this, "handleSave", view => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
return this.props.onSave(view);
|
|
45
|
+
var _this$props$onSave, _this$props;
|
|
46
|
+
return (_this$props$onSave = (_this$props = this.props).onSave) === null || _this$props$onSave === void 0 ? void 0 : _this$props$onSave.call(_this$props, view);
|
|
53
47
|
});
|
|
54
48
|
_defineProperty(this, "handleAnalyticsEvent", data => fireAnalyticsEvent(this.createAnalyticsEvent)(data));
|
|
49
|
+
_defineProperty(this, "getExperienceStore", () => this.experienceStore);
|
|
55
50
|
this.providerFactory = new ProviderFactory();
|
|
56
|
-
|
|
57
|
-
this.onEditorCreated = this.onEditorCreated.bind(this);
|
|
58
|
-
this.onEditorDestroyed = this.onEditorDestroyed.bind(this);
|
|
51
|
+
deprecationWarnings(props);
|
|
59
52
|
this.editorActions = (context || {}).editorActions || new EditorActions();
|
|
60
|
-
this.trackEditorActions(this.editorActions, props);
|
|
61
53
|
this.editorSessionId = uuid();
|
|
62
54
|
this.startTime = performance.now();
|
|
55
|
+
this.onEditorCreated = this.onEditorCreated.bind(this);
|
|
56
|
+
this.onEditorDestroyed = this.onEditorDestroyed.bind(this);
|
|
57
|
+
this.getExperienceStore = this.getExperienceStore.bind(this);
|
|
58
|
+
this.trackEditorActions(this.editorActions, props);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
62
|
+
* `useEditorConstructor` (editor-next/hooks/useEditorMeasuresConstructor.ts)
|
|
63
|
+
*/
|
|
63
64
|
startMeasure(measurements.EDITOR_MOUNTED);
|
|
64
65
|
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) {
|
|
65
|
-
var _props$
|
|
66
|
+
var _props$performanceTra3, _props$performanceTra4, _props$performanceTra5, _props$performanceTra6;
|
|
66
67
|
measureTTI((tti, ttiFromInvocation, canceled) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var _ttiTracking;
|
|
70
|
-
const ttiEvent = {
|
|
71
|
-
payload: {
|
|
72
|
-
action: ACTION.EDITOR_TTI,
|
|
73
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
74
|
-
attributes: {
|
|
75
|
-
tti,
|
|
76
|
-
ttiFromInvocation,
|
|
77
|
-
canceled
|
|
78
|
-
},
|
|
79
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
if ((_ttiTracking = props.performanceTracking.ttiTracking) !== null && _ttiTracking !== void 0 && _ttiTracking.trackSeverity) {
|
|
83
|
-
const {
|
|
84
|
-
ttiSeverityNormalThreshold,
|
|
85
|
-
ttiSeverityDegradedThreshold,
|
|
86
|
-
ttiFromInvocationSeverityNormalThreshold,
|
|
87
|
-
ttiFromInvocationSeverityDegradedThreshold
|
|
88
|
-
} = props.performanceTracking.ttiTracking;
|
|
89
|
-
const {
|
|
90
|
-
ttiSeverity,
|
|
91
|
-
ttiFromInvocationSeverity
|
|
92
|
-
} = getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold);
|
|
93
|
-
ttiEvent.payload.attributes.ttiSeverity = ttiSeverity;
|
|
94
|
-
ttiEvent.payload.attributes.ttiFromInvocationSeverity = ttiFromInvocationSeverity;
|
|
95
|
-
}
|
|
96
|
-
fireAnalyticsEvent(this.createAnalyticsEvent)(ttiEvent);
|
|
97
|
-
}
|
|
98
|
-
if ((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.ufo) {
|
|
99
|
-
var _this$experienceStore, _this$experienceStore2;
|
|
100
|
-
(_this$experienceStore = this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.mark(EditorExperience.loadEditor, ACTION.EDITOR_TTI, tti);
|
|
101
|
-
(_this$experienceStore2 = this.experienceStore) === null || _this$experienceStore2 === void 0 ? void 0 : _this$experienceStore2.success(EditorExperience.loadEditor);
|
|
102
|
-
}
|
|
103
|
-
}, (_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);
|
|
68
|
+
editorMeasureTTICallback(tti, ttiFromInvocation, canceled, this.props.performanceTracking, this.props.featureFlags, this.createAnalyticsEvent, this.experienceStore);
|
|
69
|
+
}, (_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);
|
|
104
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
74
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
75
|
+
*/
|
|
105
76
|
const _extensionProvider = this.prepareExtensionProvider(props.extensionProviders);
|
|
106
77
|
const quickInsertProvider = this.prepareQuickInsertProvider(_extensionProvider, props.quickInsert);
|
|
78
|
+
const preset = createPreset(props, undefined, this.createAnalyticsEvent);
|
|
107
79
|
this.state = {
|
|
108
80
|
extensionProvider: _extensionProvider,
|
|
109
|
-
quickInsertProvider
|
|
81
|
+
quickInsertProvider,
|
|
82
|
+
preset
|
|
110
83
|
};
|
|
111
84
|
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
88
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
89
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
90
|
+
*/
|
|
112
91
|
componentDidMount() {
|
|
113
|
-
stopMeasure(measurements.EDITOR_MOUNTED,
|
|
114
|
-
this.
|
|
92
|
+
stopMeasure(measurements.EDITOR_MOUNTED, sendDurationAnalytics(ACTION.EDITOR_MOUNTED, this.props, this.getExperienceStore, this.createAnalyticsEvent));
|
|
93
|
+
handleProviders(this.providerFactory, getProvidersFromEditorProps(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
115
94
|
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
98
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts)
|
|
99
|
+
*/
|
|
116
100
|
componentDidUpdate(prevProps) {
|
|
101
|
+
const needsANewPreset = shouldRecreatePreset(prevProps, this.props);
|
|
102
|
+
const preset = needsANewPreset ? createPreset(this.props, prevProps, this.createAnalyticsEvent) : this.state.preset;
|
|
117
103
|
const {
|
|
118
104
|
extensionProviders,
|
|
119
105
|
quickInsert
|
|
@@ -127,21 +113,34 @@ export default class Editor extends React.Component {
|
|
|
127
113
|
const quickInsertProvider = this.prepareQuickInsertProvider(extensionProvider, quickInsert);
|
|
128
114
|
this.setState({
|
|
129
115
|
extensionProvider,
|
|
130
|
-
quickInsertProvider
|
|
131
|
-
|
|
116
|
+
quickInsertProvider,
|
|
117
|
+
preset
|
|
118
|
+
}, () => handleProviders(this.providerFactory, getProvidersFromEditorProps(this.props), this.state.extensionProvider, this.state.quickInsertProvider));
|
|
132
119
|
return;
|
|
133
120
|
}
|
|
134
|
-
|
|
121
|
+
if (needsANewPreset) {
|
|
122
|
+
this.setState({
|
|
123
|
+
preset
|
|
124
|
+
});
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
handleProviders(this.providerFactory, getProvidersFromEditorProps(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
135
128
|
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Consider any changes here to corresponding file for `EditorNext` in
|
|
132
|
+
* `useProviderFactory` (editor-next/hooks/useProviderFactory.ts) and
|
|
133
|
+
* `useMeasureEditorMountTime` (editor-next/hooks/useMeasureEditorMountTime.ts)
|
|
134
|
+
*/
|
|
136
135
|
componentWillUnmount() {
|
|
137
|
-
var _this$
|
|
136
|
+
var _this$props2, _this$props2$performa, _this$props2$performa2, _this$props$featureFl;
|
|
138
137
|
this.unregisterEditorFromActions();
|
|
139
138
|
this.providerFactory.destroy();
|
|
140
139
|
clearMeasure(measurements.EDITOR_MOUNTED);
|
|
141
|
-
((_this$
|
|
140
|
+
((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$performa = _this$props2.performanceTracking) === null || _this$props2$performa === void 0 ? void 0 : (_this$props2$performa2 = _this$props2$performa.onEditorReadyCallbackTracking) === null || _this$props2$performa2 === void 0 ? void 0 : _this$props2$performa2.enabled) && clearMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
142
141
|
if ((_this$props$featureFl = this.props.featureFlags) !== null && _this$props$featureFl !== void 0 && _this$props$featureFl.ufo) {
|
|
143
|
-
var _this$
|
|
144
|
-
(_this$
|
|
142
|
+
var _this$experienceStore;
|
|
143
|
+
(_this$experienceStore = this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.abortAll({
|
|
145
144
|
reason: 'editor component unmounted'
|
|
146
145
|
});
|
|
147
146
|
}
|
|
@@ -154,72 +153,7 @@ export default class Editor extends React.Component {
|
|
|
154
153
|
* and need to find a workaround.
|
|
155
154
|
*/
|
|
156
155
|
trackEditorActions(editorActions, props) {
|
|
157
|
-
|
|
158
|
-
if (props !== null && props !== void 0 && (_props$performanceTra9 = props.performanceTracking) !== null && _props$performanceTra9 !== void 0 && (_props$performanceTra10 = _props$performanceTra9.contentRetrievalTracking) !== null && _props$performanceTra10 !== void 0 && _props$performanceTra10.enabled) {
|
|
159
|
-
const DEFAULT_SAMPLING_RATE = 100;
|
|
160
|
-
const getValue = editorActions.getValue.bind(editorActions);
|
|
161
|
-
if (!editorActions._contentRetrievalTracking) {
|
|
162
|
-
editorActions._contentRetrievalTracking = {
|
|
163
|
-
samplingCounters: {
|
|
164
|
-
success: 1,
|
|
165
|
-
failure: 1
|
|
166
|
-
},
|
|
167
|
-
getValueTracked: false
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
const {
|
|
171
|
-
_contentRetrievalTracking: {
|
|
172
|
-
samplingCounters,
|
|
173
|
-
getValueTracked
|
|
174
|
-
}
|
|
175
|
-
} = editorActions;
|
|
176
|
-
if (!getValueTracked) {
|
|
177
|
-
const getValueWithTracking = async () => {
|
|
178
|
-
try {
|
|
179
|
-
var _props$performanceTra11, _props$performanceTra12, _props$performanceTra13;
|
|
180
|
-
const value = await getValue();
|
|
181
|
-
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)) {
|
|
182
|
-
this.handleAnalyticsEvent({
|
|
183
|
-
payload: {
|
|
184
|
-
action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
185
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
186
|
-
attributes: {
|
|
187
|
-
success: true
|
|
188
|
-
},
|
|
189
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
samplingCounters.success = 0;
|
|
193
|
-
}
|
|
194
|
-
samplingCounters.success++;
|
|
195
|
-
return value;
|
|
196
|
-
} catch (err) {
|
|
197
|
-
var _props$performanceTra14, _props$performanceTra15, _props$performanceTra16;
|
|
198
|
-
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)) {
|
|
199
|
-
var _props$performanceTra17, _props$performanceTra18;
|
|
200
|
-
this.handleAnalyticsEvent({
|
|
201
|
-
payload: {
|
|
202
|
-
action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
|
|
203
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
204
|
-
attributes: {
|
|
205
|
-
success: false,
|
|
206
|
-
errorInfo: err.toString(),
|
|
207
|
-
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 ? err.stack : undefined
|
|
208
|
-
},
|
|
209
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
samplingCounters.failure = 0;
|
|
213
|
-
}
|
|
214
|
-
samplingCounters.failure++;
|
|
215
|
-
throw err;
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
editorActions.getValue = getValueWithTracking;
|
|
219
|
-
editorActions._contentRetrievalTracking.getValueTracked = true;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return editorActions;
|
|
156
|
+
return trackEditorActions(editorActions, props.performanceTracking, value => this.handleAnalyticsEvent(value));
|
|
223
157
|
}
|
|
224
158
|
|
|
225
159
|
/**
|
|
@@ -236,85 +170,7 @@ export default class Editor extends React.Component {
|
|
|
236
170
|
* and need to find a workaround.
|
|
237
171
|
*/
|
|
238
172
|
onEditorCreated(instance) {
|
|
239
|
-
|
|
240
|
-
this.registerEditorForActions(instance.view, instance.eventDispatcher, instance.transformer);
|
|
241
|
-
if ((_this$props$featureFl2 = this.props.featureFlags) !== null && _this$props$featureFl2 !== void 0 && _this$props$featureFl2.ufo) {
|
|
242
|
-
this.experienceStore = ExperienceStore.getInstance(instance.view);
|
|
243
|
-
this.experienceStore.start(EditorExperience.loadEditor, this.startTime);
|
|
244
|
-
}
|
|
245
|
-
if (this.props.onEditorReady) {
|
|
246
|
-
var _this$props2, _this$props2$performa, _this$props2$performa2, _this$props$featureFl3;
|
|
247
|
-
const measureEditorReady = ((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$performa = _this$props2.performanceTracking) === null || _this$props2$performa === void 0 ? void 0 : (_this$props2$performa2 = _this$props2$performa.onEditorReadyCallbackTracking) === null || _this$props2$performa2 === void 0 ? void 0 : _this$props2$performa2.enabled) || ((_this$props$featureFl3 = this.props.featureFlags) === null || _this$props$featureFl3 === void 0 ? void 0 : _this$props$featureFl3.ufo);
|
|
248
|
-
measureEditorReady && startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
249
|
-
this.props.onEditorReady(this.editorActions);
|
|
250
|
-
measureEditorReady && stopMeasure(measurements.ON_EDITOR_READY_CALLBACK, this.sendDurationAnalytics(ACTION.ON_EDITOR_READY_CALLBACK));
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
sendDurationAnalytics(action) {
|
|
254
|
-
return async (duration, startTime) => {
|
|
255
|
-
var _this$props$featureFl4;
|
|
256
|
-
const contextIdentifier = await this.props.contextIdentifierProvider;
|
|
257
|
-
const objectId = contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId;
|
|
258
|
-
if (this.createAnalyticsEvent) {
|
|
259
|
-
fireAnalyticsEvent(this.createAnalyticsEvent)({
|
|
260
|
-
payload: {
|
|
261
|
-
action,
|
|
262
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
263
|
-
attributes: {
|
|
264
|
-
duration,
|
|
265
|
-
startTime,
|
|
266
|
-
objectId
|
|
267
|
-
},
|
|
268
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
if ((_this$props$featureFl4 = this.props.featureFlags) !== null && _this$props$featureFl4 !== void 0 && _this$props$featureFl4.ufo) {
|
|
273
|
-
var _this$experienceStore4, _this$experienceStore5;
|
|
274
|
-
(_this$experienceStore4 = this.experienceStore) === null || _this$experienceStore4 === void 0 ? void 0 : _this$experienceStore4.mark(EditorExperience.loadEditor, action, startTime + duration);
|
|
275
|
-
(_this$experienceStore5 = this.experienceStore) === null || _this$experienceStore5 === void 0 ? void 0 : _this$experienceStore5.addMetadata(EditorExperience.loadEditor, {
|
|
276
|
-
objectId
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
deprecationWarnings(props) {
|
|
282
|
-
var _props$allowTextColor;
|
|
283
|
-
if (process.env.NODE_ENV === 'production') {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
const nextVersion = nextMajorVersion();
|
|
287
|
-
const deprecatedProperties = {
|
|
288
|
-
allowTasksAndDecisions: {
|
|
289
|
-
message: 'To allow tasks and decisions use taskDecisionProvider – <Editor taskDecisionProvider={{ provider }} />',
|
|
290
|
-
type: 'removed'
|
|
291
|
-
},
|
|
292
|
-
allowConfluenceInlineComment: {
|
|
293
|
-
message: 'To integrate inline comments use experimental annotationProvider – <Editor annotationProviders={{ provider }} />',
|
|
294
|
-
type: 'removed'
|
|
295
|
-
},
|
|
296
|
-
smartLinks: {
|
|
297
|
-
message: 'To use smartLinks, pass the same object into the smartlinks key of linking - <Editor linking={{ smartLinks: {existing object} }}.',
|
|
298
|
-
type: 'removed'
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
Object.keys(deprecatedProperties).forEach(property => {
|
|
302
|
-
if (props.hasOwnProperty(property)) {
|
|
303
|
-
const meta = deprecatedProperties[property];
|
|
304
|
-
const type = meta.type || 'enabled by default';
|
|
305
|
-
|
|
306
|
-
// eslint-disable-next-line no-console
|
|
307
|
-
console.warn(`${property} property is deprecated. ${meta.message || ''} [Will be ${type} in editor-core@${nextVersion}]`);
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
if (props.hasOwnProperty('allowTables') && typeof props.allowTables !== 'boolean' && (!props.allowTables || !props.allowTables.advanced)) {
|
|
311
|
-
// eslint-disable-next-line no-console
|
|
312
|
-
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@${nextVersion}]`);
|
|
313
|
-
}
|
|
314
|
-
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) {
|
|
315
|
-
// eslint-disable-next-line no-console
|
|
316
|
-
console.warn(`"allowMoreTextColors" field of "allowTextColor" property is deprecated. It will be removedin editor-core@${nextVersion}. The color palette now shows more colors by default.`);
|
|
317
|
-
}
|
|
173
|
+
onEditorCreated(instance, this.props, experienceStore => this.experienceStore = experienceStore, this.getExperienceStore, () => this.createAnalyticsEvent, this.editorActions, this.startTime, (view, dispatcher, transformerForActions) => this.registerEditorForActions(view, dispatcher, transformerForActions));
|
|
318
174
|
}
|
|
319
175
|
|
|
320
176
|
/**
|
|
@@ -324,69 +180,27 @@ export default class Editor extends React.Component {
|
|
|
324
180
|
* and need to find a workaround.
|
|
325
181
|
*/
|
|
326
182
|
onEditorDestroyed(_instance) {
|
|
183
|
+
var _this$props$onDestroy, _this$props3;
|
|
327
184
|
this.unregisterEditorFromActions();
|
|
328
|
-
|
|
329
|
-
this.props.onDestroy();
|
|
330
|
-
}
|
|
185
|
+
(_this$props$onDestroy = (_this$props3 = this.props).onDestroy) === null || _this$props$onDestroy === void 0 ? void 0 : _this$props$onDestroy.call(_this$props3);
|
|
331
186
|
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @private
|
|
190
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
191
|
+
* Please reach out to the Editor team if you were previously using this
|
|
192
|
+
* and need to find a workaround.
|
|
193
|
+
*/
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @private
|
|
197
|
+
* @deprecated - Do not override this at all, this is an antipattern.
|
|
198
|
+
* Please reach out to the Editor team if you were previously using this
|
|
199
|
+
* and need to find a workaround.
|
|
200
|
+
*/
|
|
332
201
|
registerEditorForActions(editorView, eventDispatcher, contentTransformer) {
|
|
333
202
|
this.editorActions._privateRegisterEditor(editorView, eventDispatcher, contentTransformer);
|
|
334
203
|
}
|
|
335
|
-
unregisterEditorFromActions() {
|
|
336
|
-
if (this.editorActions) {
|
|
337
|
-
this.editorActions._privateUnregisterEditor();
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
handleProviders(props) {
|
|
341
|
-
var _linking$smartLinks;
|
|
342
|
-
const {
|
|
343
|
-
emojiProvider,
|
|
344
|
-
mentionProvider,
|
|
345
|
-
taskDecisionProvider,
|
|
346
|
-
contextIdentifierProvider,
|
|
347
|
-
collabEditProvider,
|
|
348
|
-
activityProvider,
|
|
349
|
-
presenceProvider,
|
|
350
|
-
macroProvider,
|
|
351
|
-
legacyImageUploadProvider,
|
|
352
|
-
media,
|
|
353
|
-
collabEdit,
|
|
354
|
-
autoformattingProvider,
|
|
355
|
-
searchProvider,
|
|
356
|
-
UNSAFE_cards,
|
|
357
|
-
smartLinks,
|
|
358
|
-
linking
|
|
359
|
-
} = props;
|
|
360
|
-
const {
|
|
361
|
-
extensionProvider,
|
|
362
|
-
quickInsertProvider
|
|
363
|
-
} = this.state;
|
|
364
|
-
this.providerFactory.setProvider('emojiProvider', emojiProvider);
|
|
365
|
-
this.providerFactory.setProvider('mentionProvider', mentionProvider);
|
|
366
|
-
this.providerFactory.setProvider('taskDecisionProvider', taskDecisionProvider);
|
|
367
|
-
this.providerFactory.setProvider('contextIdentifierProvider', contextIdentifierProvider);
|
|
368
|
-
this.providerFactory.setProvider('mediaProvider', media && media.provider);
|
|
369
|
-
this.providerFactory.setProvider('imageUploadProvider', legacyImageUploadProvider);
|
|
370
|
-
this.providerFactory.setProvider('collabEditProvider', collabEdit && collabEdit.provider ? collabEdit.provider : collabEditProvider);
|
|
371
|
-
this.providerFactory.setProvider('activityProvider', activityProvider);
|
|
372
|
-
this.providerFactory.setProvider('searchProvider', searchProvider);
|
|
373
|
-
this.providerFactory.setProvider('presenceProvider', presenceProvider);
|
|
374
|
-
this.providerFactory.setProvider('macroProvider', macroProvider);
|
|
375
|
-
const 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;
|
|
376
|
-
if (cardProvider) {
|
|
377
|
-
this.providerFactory.setProvider('cardProvider', cardProvider);
|
|
378
|
-
}
|
|
379
|
-
this.providerFactory.setProvider('autoformattingProvider', autoformattingProvider);
|
|
380
|
-
if (extensionProvider) {
|
|
381
|
-
this.providerFactory.setProvider('extensionProvider', Promise.resolve(extensionProvider));
|
|
382
|
-
}
|
|
383
|
-
if (quickInsertProvider) {
|
|
384
|
-
this.providerFactory.setProvider('quickInsertProvider', quickInsertProvider);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
getBaseFontSize() {
|
|
388
|
-
return !['comment', 'chromeless', 'mobile'].includes(this.props.appearance) ? akEditorFullPageDefaultFontSize : undefined;
|
|
389
|
-
}
|
|
390
204
|
|
|
391
205
|
/**
|
|
392
206
|
* @private
|
|
@@ -394,20 +208,10 @@ export default class Editor extends React.Component {
|
|
|
394
208
|
* Please reach out to the Editor team if you were previously using this
|
|
395
209
|
* and need to find a workaround.
|
|
396
210
|
*/
|
|
397
|
-
|
|
211
|
+
unregisterEditorFromActions() {
|
|
212
|
+
this.editorActions._privateUnregisterEditor();
|
|
213
|
+
}
|
|
398
214
|
render() {
|
|
399
|
-
var _this$props$performan3, _this$props$performan4;
|
|
400
|
-
const Component = getUiComponent(this.props.appearance);
|
|
401
|
-
const overriddenEditorProps = {
|
|
402
|
-
...this.props,
|
|
403
|
-
onSave: this.props.onSave ? this.handleSave : undefined,
|
|
404
|
-
// noop all analytic events, even if a handler is still passed.
|
|
405
|
-
analyticsHandler: undefined
|
|
406
|
-
};
|
|
407
|
-
const featureFlags = createFeatureFlagsFromProps(this.props);
|
|
408
|
-
const renderTracking = (_this$props$performan3 = this.props.performanceTracking) === null || _this$props$performan3 === void 0 ? void 0 : (_this$props$performan4 = _this$props$performan3.renderTracking) === null || _this$props$performan4 === void 0 ? void 0 : _this$props$performan4.editor;
|
|
409
|
-
const renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
410
|
-
const useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
411
215
|
return jsx(FabricEditorAnalyticsContext, {
|
|
412
216
|
data: {
|
|
413
217
|
packageName: name,
|
|
@@ -417,102 +221,22 @@ export default class Editor extends React.Component {
|
|
|
417
221
|
editorSessionId: this.editorSessionId
|
|
418
222
|
}
|
|
419
223
|
}, jsx(WithCreateAnalyticsEvent, {
|
|
420
|
-
render: createAnalyticsEvent => (this.createAnalyticsEvent = createAnalyticsEvent) && jsx(
|
|
421
|
-
|
|
422
|
-
action: ACTION.RE_RENDERED,
|
|
423
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
224
|
+
render: createAnalyticsEvent => (this.createAnalyticsEvent = createAnalyticsEvent) && jsx(EditorInternal, {
|
|
225
|
+
props: this.props,
|
|
424
226
|
handleAnalyticsEvent: this.handleAnalyticsEvent,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
editorActions: this.editorActions
|
|
434
|
-
}, jsx(ContextAdapter, null, jsx(PortalProviderWithThemeProviders, {
|
|
435
|
-
onAnalyticsEvent: this.handleAnalyticsEvent,
|
|
436
|
-
useAnalyticsContext: this.props.UNSAFE_useAnalyticsContext,
|
|
437
|
-
render: portalProviderAPI => jsx(Fragment, null, jsx(ReactEditorView, {
|
|
438
|
-
editorProps: overriddenEditorProps,
|
|
439
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
440
|
-
portalProviderAPI: portalProviderAPI,
|
|
441
|
-
providerFactory: this.providerFactory,
|
|
442
|
-
onEditorCreated: this.onEditorCreated,
|
|
443
|
-
onEditorDestroyed: this.onEditorDestroyed,
|
|
444
|
-
allowAnalyticsGASV3: this.props.allowAnalyticsGASV3,
|
|
445
|
-
disabled: this.props.disabled,
|
|
446
|
-
render: ({
|
|
447
|
-
editor,
|
|
448
|
-
view,
|
|
449
|
-
eventDispatcher,
|
|
450
|
-
config,
|
|
451
|
-
dispatchAnalyticsEvent,
|
|
452
|
-
editorRef
|
|
453
|
-
}) => {
|
|
454
|
-
var _this$props$featureFl5, _this$props$featureFl6;
|
|
455
|
-
return jsx(BaseTheme, {
|
|
456
|
-
baseFontSize: this.getBaseFontSize()
|
|
457
|
-
}, jsx(Component, {
|
|
458
|
-
innerRef: editorRef,
|
|
459
|
-
appearance: this.props.appearance,
|
|
460
|
-
disabled: this.props.disabled,
|
|
461
|
-
editorActions: this.editorActions,
|
|
462
|
-
editorDOMElement: editor,
|
|
463
|
-
editorView: view,
|
|
464
|
-
providerFactory: this.providerFactory,
|
|
465
|
-
eventDispatcher: eventDispatcher,
|
|
466
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
467
|
-
maxHeight: this.props.maxHeight,
|
|
468
|
-
minHeight: this.props.minHeight,
|
|
469
|
-
onSave: this.props.onSave ? this.handleSave : undefined,
|
|
470
|
-
onCancel: this.props.onCancel,
|
|
471
|
-
popupsMountPoint: this.props.popupsMountPoint,
|
|
472
|
-
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
473
|
-
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
474
|
-
contentComponents: config.contentComponents,
|
|
475
|
-
primaryToolbarComponents: config.primaryToolbarComponents,
|
|
476
|
-
primaryToolbarIconBefore: this.props.primaryToolbarIconBefore,
|
|
477
|
-
secondaryToolbarComponents: config.secondaryToolbarComponents,
|
|
478
|
-
insertMenuItems: this.props.insertMenuItems,
|
|
479
|
-
customContentComponents: this.props.contentComponents,
|
|
480
|
-
customPrimaryToolbarComponents: this.props.primaryToolbarComponents,
|
|
481
|
-
customSecondaryToolbarComponents: this.props.secondaryToolbarComponents,
|
|
482
|
-
contextPanel: this.props.contextPanel,
|
|
483
|
-
collabEdit: this.props.collabEdit,
|
|
484
|
-
persistScrollGutter: this.props.persistScrollGutter,
|
|
485
|
-
enableToolbarMinWidth: ((_this$props$featureFl5 = this.props.featureFlags) === null || _this$props$featureFl5 === void 0 ? void 0 : _this$props$featureFl5.toolbarMinWidthOverflow) != null ? !!((_this$props$featureFl6 = this.props.featureFlags) !== null && _this$props$featureFl6 !== void 0 && _this$props$featureFl6.toolbarMinWidthOverflow) : this.props.allowUndoRedoButtons,
|
|
486
|
-
useStickyToolbar: this.props.useStickyToolbar,
|
|
487
|
-
featureFlags: featureFlags
|
|
488
|
-
}));
|
|
489
|
-
}
|
|
490
|
-
}), jsx(PortalRenderer, {
|
|
491
|
-
portalProviderAPI: portalProviderAPI
|
|
492
|
-
}))
|
|
493
|
-
}))))))
|
|
227
|
+
createAnalyticsEvent: this.createAnalyticsEvent,
|
|
228
|
+
preset: this.state.preset,
|
|
229
|
+
handleSave: this.handleSave,
|
|
230
|
+
editorActions: this.editorActions,
|
|
231
|
+
providerFactory: this.providerFactory,
|
|
232
|
+
onEditorCreated: this.onEditorCreated,
|
|
233
|
+
onEditorDestroyed: this.onEditorDestroyed
|
|
234
|
+
})
|
|
494
235
|
}));
|
|
495
236
|
}
|
|
496
237
|
}
|
|
497
|
-
_defineProperty(Editor, "defaultProps",
|
|
498
|
-
appearance: 'comment',
|
|
499
|
-
disabled: false,
|
|
500
|
-
extensionHandlers: {},
|
|
501
|
-
allowHelpDialog: true,
|
|
502
|
-
allowNewInsertionBehaviour: true,
|
|
503
|
-
quickInsert: true
|
|
504
|
-
});
|
|
505
|
-
_defineProperty(Editor, "propTypes", {
|
|
506
|
-
minHeight: ({
|
|
507
|
-
appearance,
|
|
508
|
-
minHeight
|
|
509
|
-
}) => {
|
|
510
|
-
if (minHeight && appearance && !['comment', 'chromeless'].includes(appearance)) {
|
|
511
|
-
return new Error('minHeight only supports editor appearance chromeless and comment');
|
|
512
|
-
}
|
|
513
|
-
return null;
|
|
514
|
-
}
|
|
515
|
-
});
|
|
238
|
+
_defineProperty(Editor, "defaultProps", defaultProps);
|
|
516
239
|
_defineProperty(Editor, "contextTypes", {
|
|
517
240
|
editorActions: PropTypes.object
|
|
518
|
-
});
|
|
241
|
+
});
|
|
242
|
+
_defineProperty(Editor, "propTypes", propTypes('minHeight only supports editor appearance chromeless and comment for Editor'));
|
package/dist/es2019/index.js
CHANGED
|
@@ -61,4 +61,5 @@ export { lightModeStatusColorPalette, darkModeStatusColorPalette } from './ui/Co
|
|
|
61
61
|
export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
62
62
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
63
63
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
64
|
-
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
64
|
+
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
65
|
+
export { default as EditorMigrationComponent } from './editor-next/editor-migration-component';
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const KEY_3 = 51;
|
|
9
|
-
export const KEY_4 = 52;
|
|
10
|
-
export const KEY_5 = 53;
|
|
11
|
-
export const KEY_6 = 54;
|
|
1
|
+
const KEY_0 = 48;
|
|
2
|
+
const KEY_1 = 49;
|
|
3
|
+
const KEY_2 = 50;
|
|
4
|
+
const KEY_3 = 51;
|
|
5
|
+
const KEY_4 = 52;
|
|
6
|
+
const KEY_5 = 53;
|
|
7
|
+
const KEY_6 = 54;
|
|
12
8
|
export const HEADING_KEYS = [KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { fireAnalyticsEvent } from '
|
|
3
|
-
import { analyticsEventKey } from '
|
|
2
|
+
import { fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Subscribes to analytics events fired from editor components
|