@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
|
@@ -12,8 +12,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
13
13
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
14
14
|
var _providerHelpers = require("@atlaskit/editor-common/provider-helpers");
|
|
15
|
-
var
|
|
16
|
-
var _analytics = require("../plugins/analytics");
|
|
15
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
16
|
/**
|
|
18
17
|
* Utils to send analytics event when a extension is inserted using quickInsert
|
|
19
18
|
*/
|
|
@@ -21,15 +20,15 @@ function sendExtensionQuickInsertAnalytics(item, createAnalyticsEvent) {
|
|
|
21
20
|
if (createAnalyticsEvent) {
|
|
22
21
|
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({
|
|
23
22
|
payload: {
|
|
24
|
-
action:
|
|
25
|
-
actionSubject:
|
|
26
|
-
actionSubjectId:
|
|
23
|
+
action: _analytics.ACTION.INSERTED,
|
|
24
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
25
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.EXTENSION,
|
|
27
26
|
attributes: {
|
|
28
27
|
extensionType: item.extensionType,
|
|
29
28
|
key: item.key,
|
|
30
|
-
inputMethod:
|
|
29
|
+
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
31
30
|
},
|
|
32
|
-
eventType:
|
|
31
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
34
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _createPluginsList = _interopRequireDefault(require("../create-editor/create-plugins-list"));
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Retrieve the editor props using createPluginList default behaviour.
|
|
13
|
+
*
|
|
14
|
+
* @param GetEditorPlugins props used to initialise the plugins
|
|
15
|
+
* @returns list of editor plugins
|
|
16
|
+
*/
|
|
17
|
+
var getEditorPlugins = function getEditorPlugins(_ref) {
|
|
18
|
+
var _props$dangerouslyApp, _props$dangerouslyApp2;
|
|
19
|
+
var props = _ref.props,
|
|
20
|
+
prevAppearance = _ref.prevAppearance,
|
|
21
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
22
|
+
insertNodeAPI = _ref.insertNodeAPI,
|
|
23
|
+
editorAnalyticsAPI = _ref.editorAnalyticsAPI;
|
|
24
|
+
var dangerouslyAppendedPlugins = (_props$dangerouslyApp = (_props$dangerouslyApp2 = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp2 === void 0 ? void 0 : _props$dangerouslyApp2.__plugins) !== null && _props$dangerouslyApp !== void 0 ? _props$dangerouslyApp : [];
|
|
25
|
+
return [].concat((0, _toConsumableArray2.default)((0, _createPluginsList.default)(props, {
|
|
26
|
+
appearance: prevAppearance
|
|
27
|
+
}, createAnalyticsEvent)), (0, _toConsumableArray2.default)(dangerouslyAppendedPlugins));
|
|
28
|
+
};
|
|
29
|
+
var _default = getEditorPlugins;
|
|
30
|
+
exports.default = _default;
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -11,28 +11,12 @@ Object.defineProperty(exports, "SetAttrsStep", {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
exports.areBlockTypesDisabled = areBlockTypesDisabled;
|
|
14
|
-
exports.canJoinDown = canJoinDown;
|
|
15
|
-
exports.canJoinUp = canJoinUp;
|
|
16
14
|
exports.canMoveDown = canMoveDown;
|
|
17
15
|
exports.canMoveUp = canMoveUp;
|
|
18
|
-
Object.defineProperty(exports, "cascadeCommands", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _action.cascadeCommands;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
16
|
exports.checkNodeDown = checkNodeDown;
|
|
25
17
|
exports.compose = compose;
|
|
26
|
-
Object.defineProperty(exports, "containsClassName", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return _dom.containsClassName;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
exports.createSliceWithContent = createSliceWithContent;
|
|
33
18
|
exports.dedupe = dedupe;
|
|
34
19
|
exports.filterChildrenBetween = filterChildrenBetween;
|
|
35
|
-
exports.findAncestorPosition = findAncestorPosition;
|
|
36
20
|
Object.defineProperty(exports, "findFarthestParentNode", {
|
|
37
21
|
enumerable: true,
|
|
38
22
|
get: function get() {
|
|
@@ -40,13 +24,6 @@ Object.defineProperty(exports, "findFarthestParentNode", {
|
|
|
40
24
|
}
|
|
41
25
|
});
|
|
42
26
|
exports.getCursor = getCursor;
|
|
43
|
-
Object.defineProperty(exports, "getEditorValueWithMedia", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function get() {
|
|
46
|
-
return _action.getEditorValueWithMedia;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
exports.getGroupsInRange = getGroupsInRange;
|
|
50
27
|
Object.defineProperty(exports, "getNodesCount", {
|
|
51
28
|
enumerable: true,
|
|
52
29
|
get: function get() {
|
|
@@ -59,7 +36,6 @@ Object.defineProperty(exports, "getStepRange", {
|
|
|
59
36
|
return _document.getStepRange;
|
|
60
37
|
}
|
|
61
38
|
});
|
|
62
|
-
exports.hasCommonAncestor = hasCommonAncestor;
|
|
63
39
|
exports.hasOpenEnd = void 0;
|
|
64
40
|
Object.defineProperty(exports, "hasVisibleContent", {
|
|
65
41
|
enumerable: true,
|
|
@@ -106,18 +82,6 @@ Object.defineProperty(exports, "isLinkMark", {
|
|
|
106
82
|
return _nodes.isLinkMark;
|
|
107
83
|
}
|
|
108
84
|
});
|
|
109
|
-
Object.defineProperty(exports, "isMarkAllowedInRange", {
|
|
110
|
-
enumerable: true,
|
|
111
|
-
get: function get() {
|
|
112
|
-
return _mark.isMarkAllowedInRange;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(exports, "isMarkExcluded", {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function get() {
|
|
118
|
-
return _mark.isMarkExcluded;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
85
|
exports.isMarkTypeAllowedInCurrentSelection = isMarkTypeAllowedInCurrentSelection;
|
|
122
86
|
Object.defineProperty(exports, "isNodeEmpty", {
|
|
123
87
|
enumerable: true,
|
|
@@ -151,15 +115,6 @@ Object.defineProperty(exports, "isTextSelection", {
|
|
|
151
115
|
return _utils.isTextSelection;
|
|
152
116
|
}
|
|
153
117
|
});
|
|
154
|
-
Object.defineProperty(exports, "isValidPosition", {
|
|
155
|
-
enumerable: true,
|
|
156
|
-
get: function get() {
|
|
157
|
-
return _selection.isValidPosition;
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
exports.liftAndSelectSiblingNodes = liftAndSelectSiblingNodes;
|
|
161
|
-
exports.liftSelection = liftSelection;
|
|
162
|
-
exports.liftSiblingNodes = liftSiblingNodes;
|
|
163
118
|
Object.defineProperty(exports, "measurements", {
|
|
164
119
|
enumerable: true,
|
|
165
120
|
get: function get() {
|
|
@@ -192,36 +147,12 @@ Object.defineProperty(exports, "processRawValue", {
|
|
|
192
147
|
return _document.processRawValue;
|
|
193
148
|
}
|
|
194
149
|
});
|
|
195
|
-
Object.defineProperty(exports, "removeBlockMarks", {
|
|
196
|
-
enumerable: true,
|
|
197
|
-
get: function get() {
|
|
198
|
-
return _mark.removeBlockMarks;
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
150
|
Object.defineProperty(exports, "sanitiseMarksInSelection", {
|
|
202
151
|
enumerable: true,
|
|
203
152
|
get: function get() {
|
|
204
153
|
return _mark.sanitiseMarksInSelection;
|
|
205
154
|
}
|
|
206
155
|
});
|
|
207
|
-
Object.defineProperty(exports, "sanitiseSelectionMarksForWrapping", {
|
|
208
|
-
enumerable: true,
|
|
209
|
-
get: function get() {
|
|
210
|
-
return _mark.sanitiseSelectionMarksForWrapping;
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
Object.defineProperty(exports, "setAllSelection", {
|
|
214
|
-
enumerable: true,
|
|
215
|
-
get: function get() {
|
|
216
|
-
return _selection.setAllSelection;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
Object.defineProperty(exports, "setCellSelection", {
|
|
220
|
-
enumerable: true,
|
|
221
|
-
get: function get() {
|
|
222
|
-
return _selection.setCellSelection;
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
156
|
Object.defineProperty(exports, "setGapCursorSelection", {
|
|
226
157
|
enumerable: true,
|
|
227
158
|
get: function get() {
|
|
@@ -244,35 +175,21 @@ exports.shallowEqual = shallowEqual;
|
|
|
244
175
|
exports.stringRepeat = stringRepeat;
|
|
245
176
|
exports.sum = sum;
|
|
246
177
|
exports.toJSON = toJSON;
|
|
247
|
-
Object.defineProperty(exports, "validateNodes", {
|
|
248
|
-
enumerable: true,
|
|
249
|
-
get: function get() {
|
|
250
|
-
return _nodes.validateNodes;
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
178
|
exports.whichTransitionEvent = whichTransitionEvent;
|
|
254
|
-
exports.wrapIn = wrapIn;
|
|
255
179
|
var _prosemirrorCommands = require("prosemirror-commands");
|
|
256
|
-
var _prosemirrorModel = require("prosemirror-model");
|
|
257
180
|
var _prosemirrorState = require("prosemirror-state");
|
|
258
|
-
var _prosemirrorTransform = require("prosemirror-transform");
|
|
259
181
|
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
260
182
|
var _cursor = require("../plugins/fake-text-cursor/cursor");
|
|
261
183
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
262
184
|
var _document = require("./document");
|
|
263
185
|
var _position = require("./prosemirror/position");
|
|
186
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
264
187
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
265
|
-
var _action = require("./action");
|
|
266
188
|
var _mark = require("./mark");
|
|
267
189
|
var _nodes = require("./nodes");
|
|
268
190
|
var _selection = require("./selection");
|
|
269
|
-
var _dom = require("./dom");
|
|
270
191
|
var _measureEnum = _interopRequireDefault(require("./performance/measure-enum"));
|
|
271
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
272
192
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
273
|
-
function validateNode(_node) {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
193
|
function isMarkTypeCompatibleWithMark(markType, mark) {
|
|
277
194
|
return !mark.type.excludes(markType) && !markType.excludes(mark.type);
|
|
278
195
|
}
|
|
@@ -280,23 +197,12 @@ function isMarkTypeAllowedInNode(markType, state) {
|
|
|
280
197
|
return (0, _prosemirrorCommands.toggleMark)(markType)(state);
|
|
281
198
|
}
|
|
282
199
|
function canMoveUp(state) {
|
|
283
|
-
var selection = state.selection
|
|
284
|
-
doc = state.doc;
|
|
285
|
-
|
|
200
|
+
var selection = state.selection;
|
|
286
201
|
/**
|
|
287
|
-
* If there's a media element on the selection
|
|
288
|
-
* add text blocks with arrow navigation.
|
|
289
|
-
* Also, the selection could be media | mediaGroup.
|
|
202
|
+
* If there's a media element on the selection it will use a gap cursor to move
|
|
290
203
|
*/
|
|
291
|
-
if (selection instanceof _prosemirrorState.NodeSelection) {
|
|
292
|
-
|
|
293
|
-
/** Weird way of checking if the previous element is a paragraph */
|
|
294
|
-
var mediaAncestorNode = doc.nodeAt(selection.anchor - 3);
|
|
295
|
-
return !!(mediaAncestorNode && mediaAncestorNode.type.name === 'paragraph');
|
|
296
|
-
} else if (selection.node.type.name === 'mediaGroup') {
|
|
297
|
-
var mediaGroupAncestorNode = selection.$anchor.nodeBefore;
|
|
298
|
-
return !!(mediaGroupAncestorNode && mediaGroupAncestorNode.type.name === 'paragraph');
|
|
299
|
-
}
|
|
204
|
+
if (selection instanceof _prosemirrorState.NodeSelection && (0, _utils.isMediaNode)(selection.node)) {
|
|
205
|
+
return true;
|
|
300
206
|
}
|
|
301
207
|
if (selection instanceof _prosemirrorState.TextSelection) {
|
|
302
208
|
if (!selection.empty) {
|
|
@@ -306,21 +212,13 @@ function canMoveUp(state) {
|
|
|
306
212
|
return !(0, _position.atTheBeginningOfDoc)(state);
|
|
307
213
|
}
|
|
308
214
|
function canMoveDown(state) {
|
|
309
|
-
var selection = state.selection
|
|
310
|
-
doc = state.doc;
|
|
215
|
+
var selection = state.selection;
|
|
311
216
|
|
|
312
217
|
/**
|
|
313
|
-
* If there's a media element on the selection
|
|
314
|
-
* add text blocks with arrow navigation.
|
|
315
|
-
* Also, the selection could be media | mediaGroup.
|
|
218
|
+
* If there's a media element on the selection it will use a gap cursor to move
|
|
316
219
|
*/
|
|
317
|
-
if (selection instanceof _prosemirrorState.NodeSelection) {
|
|
318
|
-
|
|
319
|
-
var nodeAfter = doc.nodeAt(selection.$head.after());
|
|
320
|
-
return !!(nodeAfter && nodeAfter.type.name === 'paragraph');
|
|
321
|
-
} else if (selection.node.type.name === 'mediaGroup') {
|
|
322
|
-
return !(selection.$head.parentOffset === selection.$anchor.parent.content.size);
|
|
323
|
-
}
|
|
220
|
+
if (selection instanceof _prosemirrorState.NodeSelection && (0, _utils.isMediaNode)(selection.node)) {
|
|
221
|
+
return true;
|
|
324
222
|
}
|
|
325
223
|
if (selection instanceof _prosemirrorState.TextSelection) {
|
|
326
224
|
if (!selection.empty) {
|
|
@@ -381,19 +279,6 @@ function isMarkTypeAllowedInCurrentSelection(markType, state) {
|
|
|
381
279
|
return allowedInActiveMarks;
|
|
382
280
|
});
|
|
383
281
|
}
|
|
384
|
-
function createSliceWithContent(content, state) {
|
|
385
|
-
return new _prosemirrorModel.Slice(_prosemirrorModel.Fragment.from(state.schema.text(content)), 0, 0);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Determines if content inside a selection can be joined with the next block.
|
|
390
|
-
* We need this check since the built-in method for "joinDown" will join a orderedList with bulletList.
|
|
391
|
-
*/
|
|
392
|
-
function canJoinDown(selection, doc, nodeType) {
|
|
393
|
-
return checkNodeDown(selection, doc, function (node) {
|
|
394
|
-
return node.type === nodeType;
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
282
|
function checkNodeDown(selection, doc, filter) {
|
|
398
283
|
var ancestorDepth = findAncestorPosition(doc, selection.$to).depth;
|
|
399
284
|
|
|
@@ -405,61 +290,6 @@ function checkNodeDown(selection, doc, filter) {
|
|
|
405
290
|
return res.nodeAfter ? filter(res.nodeAfter) : false;
|
|
406
291
|
}
|
|
407
292
|
|
|
408
|
-
/**
|
|
409
|
-
* Determines if content inside a selection can be joined with the previous block.
|
|
410
|
-
* We need this check since the built-in method for "joinUp" will join a orderedList with bulletList.
|
|
411
|
-
*/
|
|
412
|
-
function canJoinUp(selection, doc, nodeType) {
|
|
413
|
-
var res = doc.resolve(selection.$from.before(findAncestorPosition(doc, selection.$from).depth));
|
|
414
|
-
return res.nodeBefore && res.nodeBefore.type === nodeType;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Finds all "selection-groups" within a range. A selection group is based on ancestors.
|
|
419
|
-
*
|
|
420
|
-
* Example:
|
|
421
|
-
* Given the following document and selection ({<} = start of selection and {>} = end)
|
|
422
|
-
* doc
|
|
423
|
-
* blockquote
|
|
424
|
-
* ul
|
|
425
|
-
* li
|
|
426
|
-
* li{<}
|
|
427
|
-
* li
|
|
428
|
-
* p
|
|
429
|
-
* p{>}
|
|
430
|
-
*
|
|
431
|
-
* The output will be two selection-groups. One within the ul and one with the two paragraphs.
|
|
432
|
-
*/
|
|
433
|
-
function getGroupsInRange(doc, $from, $to) {
|
|
434
|
-
var isNodeValid = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : validateNode;
|
|
435
|
-
var groups = Array();
|
|
436
|
-
var commonAncestor = hasCommonAncestor(doc, $from, $to);
|
|
437
|
-
var fromAncestor = findAncestorPosition(doc, $from);
|
|
438
|
-
if (commonAncestor || fromAncestor.depth === 1 && isNodeValid($from.node(1))) {
|
|
439
|
-
groups.push({
|
|
440
|
-
$from: $from,
|
|
441
|
-
$to: $to
|
|
442
|
-
});
|
|
443
|
-
} else {
|
|
444
|
-
var current = $from;
|
|
445
|
-
while (current.pos < $to.pos) {
|
|
446
|
-
var ancestorPos = findAncestorPosition(doc, current);
|
|
447
|
-
while (ancestorPos.depth > 1) {
|
|
448
|
-
ancestorPos = findAncestorPosition(doc, ancestorPos);
|
|
449
|
-
}
|
|
450
|
-
var endPos = doc.resolve(Math.min(
|
|
451
|
-
// should not be smaller then start position in case of an empty paragraph for example.
|
|
452
|
-
Math.max(ancestorPos.start(ancestorPos.depth), ancestorPos.end(ancestorPos.depth) - 3), $to.pos));
|
|
453
|
-
groups.push({
|
|
454
|
-
$from: current,
|
|
455
|
-
$to: endPos
|
|
456
|
-
});
|
|
457
|
-
current = doc.resolve(Math.min(endPos.after(1) + 1, doc.nodeSize - 2));
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
return groups;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
293
|
/**
|
|
464
294
|
* Traverse the document until an "ancestor" is found. Any nestable block can be an ancestor.
|
|
465
295
|
*/
|
|
@@ -479,96 +309,6 @@ function findAncestorPosition(doc, pos) {
|
|
|
479
309
|
}
|
|
480
310
|
return newPos;
|
|
481
311
|
}
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Determine if two positions have a common ancestor.
|
|
485
|
-
*/
|
|
486
|
-
function hasCommonAncestor(doc, $from, $to) {
|
|
487
|
-
var current;
|
|
488
|
-
var target;
|
|
489
|
-
if ($from.depth > $to.depth) {
|
|
490
|
-
current = findAncestorPosition(doc, $from);
|
|
491
|
-
target = findAncestorPosition(doc, $to);
|
|
492
|
-
} else {
|
|
493
|
-
current = findAncestorPosition(doc, $to);
|
|
494
|
-
target = findAncestorPosition(doc, $from);
|
|
495
|
-
}
|
|
496
|
-
while (current.depth > target.depth && current.depth > 1) {
|
|
497
|
-
current = findAncestorPosition(doc, current);
|
|
498
|
-
}
|
|
499
|
-
return current.node(current.depth) === target.node(target.depth);
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Takes a selection $from and $to and lift all text nodes from their parents to document-level
|
|
504
|
-
*/
|
|
505
|
-
function liftSelection(tr, doc, $from, $to) {
|
|
506
|
-
var startPos = $from.start($from.depth);
|
|
507
|
-
var endPos = $to.end($to.depth);
|
|
508
|
-
var target = Math.max(0, findAncestorPosition(doc, $from).depth - 1);
|
|
509
|
-
tr.doc.nodesBetween(startPos, endPos, function (node, pos) {
|
|
510
|
-
if (node.isText ||
|
|
511
|
-
// Text node
|
|
512
|
-
node.isTextblock && !node.textContent // Empty paragraph
|
|
513
|
-
) {
|
|
514
|
-
var res = tr.doc.resolve(tr.mapping.map(pos));
|
|
515
|
-
var sel = new _prosemirrorState.NodeSelection(res);
|
|
516
|
-
var range = sel.$from.blockRange(sel.$to);
|
|
517
|
-
if ((0, _prosemirrorTransform.liftTarget)(range) !== undefined) {
|
|
518
|
-
tr.lift(range, target);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
});
|
|
522
|
-
startPos = tr.mapping.map(startPos);
|
|
523
|
-
endPos = tr.mapping.map(endPos);
|
|
524
|
-
endPos = tr.doc.resolve(endPos).end(tr.doc.resolve(endPos).depth); // We want to select the entire node
|
|
525
|
-
|
|
526
|
-
tr.setSelection(new _prosemirrorState.TextSelection(tr.doc.resolve(startPos), tr.doc.resolve(endPos)));
|
|
527
|
-
return {
|
|
528
|
-
tr: tr,
|
|
529
|
-
$from: tr.doc.resolve(startPos),
|
|
530
|
-
$to: tr.doc.resolve(endPos)
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Lift nodes in block to one level above.
|
|
536
|
-
*/
|
|
537
|
-
function liftSiblingNodes(view) {
|
|
538
|
-
var tr = view.state.tr;
|
|
539
|
-
var _view$state$selection = view.state.selection,
|
|
540
|
-
$from = _view$state$selection.$from,
|
|
541
|
-
$to = _view$state$selection.$to;
|
|
542
|
-
var blockStart = tr.doc.resolve($from.start($from.depth - 1));
|
|
543
|
-
var blockEnd = tr.doc.resolve($to.end($to.depth - 1));
|
|
544
|
-
var range = blockStart.blockRange(blockEnd);
|
|
545
|
-
view.dispatch(tr.lift(range, blockStart.depth - 1));
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Lift sibling nodes to document-level and select them.
|
|
550
|
-
*/
|
|
551
|
-
function liftAndSelectSiblingNodes(view) {
|
|
552
|
-
var tr = view.state.tr;
|
|
553
|
-
var _view$state$selection2 = view.state.selection,
|
|
554
|
-
$from = _view$state$selection2.$from,
|
|
555
|
-
$to = _view$state$selection2.$to;
|
|
556
|
-
var blockStart = tr.doc.resolve($from.start($from.depth - 1));
|
|
557
|
-
var blockEnd = tr.doc.resolve($to.end($to.depth - 1));
|
|
558
|
-
// TODO: [ts30] handle void and null properly
|
|
559
|
-
var range = blockStart.blockRange(blockEnd);
|
|
560
|
-
tr.setSelection(new _prosemirrorState.TextSelection(blockStart, blockEnd));
|
|
561
|
-
tr.lift(range, blockStart.depth - 1);
|
|
562
|
-
return tr;
|
|
563
|
-
}
|
|
564
|
-
function wrapIn(nodeType, tr, $from, $to) {
|
|
565
|
-
var range = $from.blockRange($to);
|
|
566
|
-
var wrapping = range && (0, _prosemirrorTransform.findWrapping)(range, nodeType);
|
|
567
|
-
if (wrapping) {
|
|
568
|
-
tr = tr.wrap(range, wrapping).scrollIntoView();
|
|
569
|
-
}
|
|
570
|
-
return tr;
|
|
571
|
-
}
|
|
572
312
|
var transformer = new _editorJsonTransformer.JSONTransformer();
|
|
573
313
|
function toJSON(node) {
|
|
574
314
|
return transformer.encode(node);
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.ruleWithAnalytics = exports.createWrappingTextBlockRule = exports.createWrappingJoinRule = exports.createRule = exports.createPlugin = exports.createJoinNodesRule = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _prosemirrorState = require("prosemirror-state");
|
|
10
10
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
@@ -32,20 +32,6 @@ var ruleWithAnalytics = function ruleWithAnalytics(getPayload) {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
exports.ruleWithAnalytics = ruleWithAnalytics;
|
|
35
|
-
var ruleWithTransform = function ruleWithTransform(transform) {
|
|
36
|
-
return function (originalRule) {
|
|
37
|
-
var onHandlerApply = function onHandlerApply(state, tr, matchResult) {
|
|
38
|
-
transform(state, tr);
|
|
39
|
-
if (originalRule.onHandlerApply) {
|
|
40
|
-
originalRule.onHandlerApply(state, tr, matchResult);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return _objectSpread(_objectSpread({}, originalRule), {}, {
|
|
44
|
-
onHandlerApply: onHandlerApply
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
exports.ruleWithTransform = ruleWithTransform;
|
|
49
35
|
var createRule = function createRule(match, handler) {
|
|
50
36
|
return {
|
|
51
37
|
match: match,
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.unlinkPayload = exports.buildVisitedLinkPayload = exports.buildOpenedSettingsPayload = exports.buildEditLinkPayload = void 0;
|
|
7
|
-
var _analytics = require("
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
8
|
var buildEditLinkPayload = function buildEditLinkPayload(type) {
|
|
9
9
|
return {
|
|
10
10
|
action: _analytics.ACTION.CLICKED,
|
|
@@ -8,7 +8,7 @@ exports.RenderTracking = RenderTracking;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
-
var _analytics = require("
|
|
11
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
12
|
function RenderTracking(props) {
|
|
13
13
|
var debouncedHandleAnalyticsEvent = (0, _react.useMemo)(function () {
|
|
14
14
|
return (0, _debounce.default)(props.handleAnalyticsEvent, 500);
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.freezeUnsafeTransactionProperties = exports.UNSAFE_PROPERTY_SET_ERROR = void 0;
|
|
7
|
-
var _analytics = require("
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
8
|
var UNSAFE_PROPERTY_SET_ERROR = 'Setting an unsafe property on transaction after dispatch!';
|
|
9
9
|
|
|
10
10
|
// since selection uses curSelection under the hood, we guard setSelection instead
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
9
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
10
|
+
function prepareExtensionProvidersInternal(editorActions, extensionProviders) {
|
|
11
|
+
if (!extensionProviders) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (typeof extensionProviders === 'function') {
|
|
15
|
+
return (0, _extensions.combineExtensionProviders)(extensionProviders(editorActions));
|
|
16
|
+
}
|
|
17
|
+
return (0, _extensions.combineExtensionProviders)(extensionProviders);
|
|
18
|
+
}
|
|
19
|
+
var prepareExtensionProvider = function prepareExtensionProvider(getEditorActions) {
|
|
20
|
+
return (0, _memoizeOne.default)(function (extensionProviders) {
|
|
21
|
+
return prepareExtensionProvidersInternal(getEditorActions(), extensionProviders);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var _default = prepareExtensionProvider;
|
|
25
|
+
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "
|
|
9
|
+
var version = "181.0.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { Node } from 'prosemirror-model';
|
|
3
|
-
import { TextSelection, NodeSelection } from 'prosemirror-state';
|
|
4
|
-
import { findParentNode } from 'prosemirror-utils';
|
|
5
|
-
import { toJSON } from '../utils';
|
|
6
|
-
import { processRawValue, isEmptyDocument } from '../utils/document';
|
|
7
|
-
import { getEditorValueWithMedia, __temporaryFixForConfigPanel } from '../utils/action';
|
|
8
|
-
import { createDispatch } from '../event-dispatcher';
|
|
9
|
-
import { safeInsert } from 'prosemirror-utils';
|
|
10
3
|
import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
5
|
+
import { findParentNode, safeInsert } from 'prosemirror-utils';
|
|
6
|
+
import { createDispatch } from '../event-dispatcher';
|
|
7
|
+
import { getCollabProvider } from '../plugins/collab-edit/native-collab-provider-plugin';
|
|
11
8
|
import { findNodePosWithLocalId } from '../plugins/extension/utils';
|
|
12
9
|
import { getFeatureFlags } from '../plugins/feature-flags-context/get-feature-flags';
|
|
13
|
-
import {
|
|
10
|
+
import { toJSON } from '../utils';
|
|
11
|
+
import { getEditorValueWithMedia, __temporaryFixForConfigPanel } from '../utils/action';
|
|
14
12
|
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
13
|
+
import { isEmptyDocument, processRawFragmentValue, processRawValue } from '../utils/document';
|
|
15
14
|
import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
|
|
16
15
|
export default class EditorActions {
|
|
17
16
|
constructor() {
|
|
@@ -100,7 +99,22 @@ export default class EditorActions {
|
|
|
100
99
|
if (!this.editorView || this.editorView.hasFocus()) {
|
|
101
100
|
return false;
|
|
102
101
|
}
|
|
103
|
-
|
|
102
|
+
|
|
103
|
+
// If we focus on componentDidMount the editor can crash due to a prosemirror error.
|
|
104
|
+
// This is fixed in prosemirror-view@1.23.7
|
|
105
|
+
// See: https:github.com/ProseMirror/prosemirror-view/commit/735b88107d1cbe7575a188edb85f05c22fb56e35
|
|
106
|
+
//
|
|
107
|
+
// We don't want this error to crash the editor in the case we can't
|
|
108
|
+
// focus correctly.
|
|
109
|
+
// Revert workaround in: https://product-fabric.atlassian.net/browse/ED-17172
|
|
110
|
+
try {
|
|
111
|
+
this.editorView.focus();
|
|
112
|
+
} catch (err) {
|
|
113
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
114
|
+
// eslint-disable-next-line no-console
|
|
115
|
+
console.error('EditorView focus failed with an error', err);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
104
118
|
this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
|
|
105
119
|
return true;
|
|
106
120
|
}
|
|
@@ -225,7 +239,7 @@ export default class EditorActions {
|
|
|
225
239
|
const {
|
|
226
240
|
schema
|
|
227
241
|
} = state;
|
|
228
|
-
const content = processRawValue(schema, rawValue);
|
|
242
|
+
const content = Array.isArray(rawValue) ? processRawFragmentValue(schema, rawValue) : processRawValue(schema, rawValue);
|
|
229
243
|
if (!content) {
|
|
230
244
|
return false;
|
|
231
245
|
}
|
|
@@ -17,7 +17,7 @@ export const attachPayloadIntoTransaction = ({
|
|
|
17
17
|
tr.step(new AnalyticsStep([{
|
|
18
18
|
payload,
|
|
19
19
|
channel
|
|
20
|
-
}], actionsToIgnore,
|
|
20
|
+
}], actionsToIgnore, editorState.selection.$from.pos) // We need to create the step based on a position, this prevent split history for relative changes.
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
// When you add a new step all the storedMarks are removed it
|