@atlaskit/editor-core 180.1.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 +43 -0
- package/dist/cjs/actions/index.js +25 -10
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/cjs/create-editor/ReactEditorView.js +0 -5
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +73 -103
- package/dist/cjs/create-editor/create-plugins-list.js +30 -3
- package/dist/cjs/create-editor/preset-utils.js +27 -0
- package/dist/cjs/editor-next/editor-internal.js +2 -2
- package/dist/cjs/editor-next/editor-migration-component.js +18 -2
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/cjs/editor-next/index.js +13 -9
- package/dist/cjs/editor-next/utils/getProvidersFromEditorProps.js +41 -0
- package/dist/cjs/editor-next/utils/handleProviders.js +17 -22
- package/dist/cjs/editor.js +20 -13
- package/dist/cjs/keymaps/consts.js +1 -16
- 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 +330 -257
- package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
- package/dist/cjs/plugins/analytics/plugin.js +6 -0
- package/dist/cjs/plugins/annotation/utils.js +2 -36
- package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +2 -7
- package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
- package/dist/cjs/plugins/caption/index.js +0 -7
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -4
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/cjs/plugins/card/pm-plugins/main.js +6 -3
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
- 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/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/floating-toolbar/ui/Button.js +7 -3
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +24 -8
- package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
- package/dist/cjs/plugins/fragment/index.js +0 -8
- package/dist/cjs/plugins/help-dialog/commands.js +2 -6
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +50 -12
- 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/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/paste/index.js +1 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +123 -87
- package/dist/cjs/plugins/paste/util/index.js +0 -46
- 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/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 +7 -5
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/cjs/plugins/text-formatting/utils.js +1 -26
- package/dist/cjs/plugins/type-ahead/constants.js +1 -7
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -35
- 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/ColorPalette/index.js +18 -0
- package/dist/cjs/ui/ColorPickerButton/index.js +6 -2
- 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/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +1 -3
- package/dist/cjs/ui/Resizer/utils.js +1 -3
- package/dist/cjs/ui/styles.js +3 -7
- package/dist/cjs/utils/get-editor-plugins.js +1 -3
- package/dist/cjs/utils/index.js +9 -269
- package/dist/cjs/utils/input-rules.js +1 -15
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +23 -9
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +0 -5
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +67 -82
- package/dist/es2019/create-editor/create-plugins-list.js +25 -3
- package/dist/es2019/create-editor/preset-utils.js +15 -0
- package/dist/es2019/editor-next/editor-internal.js +2 -2
- package/dist/es2019/editor-next/editor-migration-component.js +19 -2
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/es2019/editor-next/index.js +13 -7
- package/dist/es2019/editor-next/utils/getProvidersFromEditorProps.js +36 -0
- package/dist/es2019/editor-next/utils/handleProviders.js +18 -24
- package/dist/es2019/editor.js +20 -11
- package/dist/es2019/keymaps/consts.js +7 -11
- 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 +338 -265
- package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
- package/dist/es2019/plugins/analytics/plugin.js +7 -0
- package/dist/es2019/plugins/annotation/utils.js +2 -30
- package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +1 -3
- package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/es2019/plugins/caption/index.js +0 -2
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -4
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/es2019/plugins/card/pm-plugins/main.js +6 -3
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
- 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/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/floating-toolbar/ui/Button.js +7 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +21 -4
- package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
- package/dist/es2019/plugins/fragment/index.js +0 -7
- package/dist/es2019/plugins/help-dialog/commands.js +1 -2
- package/dist/es2019/plugins/image-upload/pm-plugins/main.js +47 -5
- 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/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/paste/index.js +1 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +126 -94
- package/dist/es2019/plugins/paste/util/index.js +5 -45
- 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/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 +7 -5
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/es2019/plugins/text-formatting/utils.js +0 -19
- package/dist/es2019/plugins/type-ahead/constants.js +0 -5
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -35
- 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/ColorPalette/index.js +2 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +6 -2
- 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/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -1
- package/dist/es2019/ui/styles.js +0 -6
- package/dist/es2019/utils/get-editor-plugins.js +1 -3
- package/dist/es2019/utils/index.js +13 -199
- package/dist/es2019/utils/input-rules.js +0 -14
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +23 -9
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +0 -5
- package/dist/esm/create-editor/ReactEditorViewInternal.js +73 -102
- package/dist/esm/create-editor/create-plugins-list.js +29 -3
- package/dist/esm/create-editor/preset-utils.js +21 -0
- package/dist/esm/editor-next/editor-internal.js +2 -2
- package/dist/esm/editor-next/editor-migration-component.js +18 -2
- package/dist/esm/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/esm/editor-next/index.js +13 -9
- package/dist/esm/editor-next/utils/getProvidersFromEditorProps.js +35 -0
- package/dist/esm/editor-next/utils/handleProviders.js +17 -22
- package/dist/esm/editor.js +20 -13
- package/dist/esm/keymaps/consts.js +7 -11
- 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 +330 -257
- package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
- package/dist/esm/plugins/analytics/plugin.js +6 -0
- package/dist/esm/plugins/annotation/utils.js +2 -32
- package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +1 -5
- package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/esm/plugins/caption/index.js +0 -2
- package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -4
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/esm/plugins/card/pm-plugins/main.js +6 -3
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
- 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/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/floating-toolbar/ui/Button.js +7 -3
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +24 -8
- package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
- package/dist/esm/plugins/fragment/index.js +0 -7
- package/dist/esm/plugins/help-dialog/commands.js +0 -3
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +51 -12
- 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/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/paste/index.js +1 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +122 -86
- package/dist/esm/plugins/paste/util/index.js +5 -45
- 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/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 +7 -5
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/esm/plugins/text-formatting/utils.js +0 -21
- package/dist/esm/plugins/type-ahead/constants.js +0 -5
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -31
- 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/ColorPalette/index.js +2 -1
- package/dist/esm/ui/ColorPickerButton/index.js +6 -2
- 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/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/esm/ui/ElementBrowser/constants.js +0 -1
- package/dist/esm/ui/Resizer/utils.js +0 -1
- package/dist/esm/ui/styles.js +2 -5
- package/dist/esm/utils/get-editor-plugins.js +1 -3
- package/dist/esm/utils/index.js +13 -196
- package/dist/esm/utils/input-rules.js +0 -13
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +4 -4
- package/dist/types/create-editor/ReactEditorView.d.ts +0 -3
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +9 -7
- package/dist/types/create-editor/ReactEditorViewNext.d.ts +3 -4
- 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 +9 -9
- package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +2 -2
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +2 -2
- package/dist/types/editor-next/index.d.ts +6 -6
- package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -2
- package/dist/types/editor-next/utils/editorPropTypes.d.ts +1 -1
- package/dist/types/editor-next/utils/getProvidersFromEditorProps.d.ts +9 -0
- package/dist/types/editor-next/utils/handleProviders.d.ts +2 -2
- package/dist/types/editor-next/utils/onEditorCreated.d.ts +2 -2
- package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
- package/dist/types/editor.d.ts +7 -4
- package/dist/types/keymaps/consts.d.ts +0 -11
- 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/pm-plugins/types.d.ts +0 -11
- package/dist/types/plugins/annotation/utils.d.ts +0 -17
- package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +2 -3
- package/dist/types/plugins/block-type/pm-plugins/input-rule.d.ts +2 -6
- package/dist/types/plugins/caption/index.d.ts +0 -2
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/plugins/code-block/actions.d.ts +0 -4
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
- 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 +2 -3
- 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/extension/commands.d.ts +0 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
- package/dist/types/plugins/feedback-dialog/index.d.ts +0 -2
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +3 -1
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
- 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/help-dialog/commands.d.ts +0 -1
- package/dist/types/plugins/history/actions.d.ts +1 -2
- package/dist/types/plugins/layout/styles.d.ts +2 -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/media/utils/media-common.d.ts +0 -5
- 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/paste/index.d.ts +0 -1
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -3
- package/dist/types/plugins/paste/util/index.d.ts +0 -6
- package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -2
- package/dist/types/plugins/status/utils.d.ts +0 -3
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +0 -4
- package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
- 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/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 +3 -3
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
- 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 +4 -2
- 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/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/Resizer/utils.d.ts +0 -1
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types/utils/index.d.ts +6 -65
- package/dist/types/utils/input-rules.d.ts +1 -2
- package/dist/types/utils/table.d.ts +0 -1
- package/package.json +23 -24
- package/report.api.md +155 -146
- package/dist/cjs/labs/next/presets/preset.js +0 -101
- package/dist/cjs/plugins/analytics/types/type-ahead.js +0 -5
- 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 -68
- package/dist/es2019/plugins/analytics/types/type-ahead.js +0 -1
- 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/es2019/ui/WithPluginState/types.js +0 -1
- package/dist/esm/labs/next/presets/preset.js +0 -93
- 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/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/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,
|
|
@@ -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, processRawFragmentValue } 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
|
}
|
|
@@ -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
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import { ReactEditorView as BaseReactEditorView } from './ReactEditorViewInternal';
|
|
3
|
-
import getEditorPlugins from '../utils/get-editor-plugins';
|
|
4
2
|
import { injectIntl } from 'react-intl-next';
|
|
5
3
|
export class ReactEditorView extends BaseReactEditorView {}
|
|
6
|
-
_defineProperty(ReactEditorView, "defaultProps", {
|
|
7
|
-
getEditorPlugins
|
|
8
|
-
});
|
|
9
4
|
export default injectIntl(ReactEditorView);
|