@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
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.INVITE_ITEM_DESCRIPTION = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = require("@emotion/react");
|
|
11
11
|
var _add = _interopRequireDefault(require("@atlaskit/icon/glyph/add"));
|
|
@@ -18,8 +18,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
/** @jsx jsx */
|
|
20
20
|
|
|
21
|
-
var INVITE_ITEM_MIN_HEIGHT = _styles.AVATAR_HEIGHT + _styles.ROW_SIDE_PADDING * 2;
|
|
22
|
-
exports.INVITE_ITEM_MIN_HEIGHT = INVITE_ITEM_MIN_HEIGHT;
|
|
23
21
|
var INVITE_ITEM_DESCRIPTION = {
|
|
24
22
|
id: 'invite-teammate'
|
|
25
23
|
};
|
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _commands = require("./commands");
|
|
9
9
|
var _pluginFactory = require("./plugin-factory");
|
|
10
|
-
// 44 pixels squared is the minimum size for a tap target as per Apple's UX design guidelines
|
|
11
|
-
var MIN_TAP_SIZE_PX = 44;
|
|
12
|
-
exports.MIN_TAP_SIZE_PX = MIN_TAP_SIZE_PX;
|
|
13
10
|
var getInitialState = function getInitialState() {
|
|
14
11
|
return {
|
|
15
12
|
keyboardHeight: -1,
|
|
@@ -7,8 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _main = require("./pm-plugins/main");
|
|
8
8
|
var pastePlugin = function pastePlugin(_ref) {
|
|
9
9
|
var cardOptions = _ref.cardOptions,
|
|
10
|
-
sanitizePrivateContent = _ref.sanitizePrivateContent
|
|
11
|
-
plainTextPasteLinkification = _ref.plainTextPasteLinkification;
|
|
10
|
+
sanitizePrivateContent = _ref.sanitizePrivateContent;
|
|
12
11
|
return {
|
|
13
12
|
name: 'paste',
|
|
14
13
|
pmPlugins: function pmPlugins() {
|
|
@@ -17,10 +17,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
17
17
|
var _analytics = require("../../analytics");
|
|
18
18
|
var _util = require("../util");
|
|
19
19
|
var _handlers = require("../handlers");
|
|
20
|
-
var _utils = require("../../../utils");
|
|
21
20
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
22
21
|
var _slice = require("../../../utils/slice");
|
|
23
|
-
var
|
|
22
|
+
var _utils = require("../../hyperlink/utils");
|
|
24
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
24
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
25
|
var contentToPasteContent = {
|
|
@@ -68,10 +67,11 @@ var nodeToActionSubjectId = {
|
|
|
68
67
|
tableRow: _analytics.ACTION_SUBJECT_ID.PASTE_TABLE_ROW,
|
|
69
68
|
taskList: _analytics.ACTION_SUBJECT_ID.PASTE_TASK_LIST
|
|
70
69
|
};
|
|
71
|
-
function getContent(
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
function getContent(_ref) {
|
|
71
|
+
var schema = _ref.schema,
|
|
72
|
+
slice = _ref.slice;
|
|
73
|
+
var paragraph = schema.nodes.paragraph,
|
|
74
|
+
link = schema.marks.link;
|
|
75
75
|
var nodeOrMarkName = new Set();
|
|
76
76
|
slice.content.forEach(function (node) {
|
|
77
77
|
if (node.type === paragraph && node.content.size === 0) {
|
|
@@ -110,14 +110,14 @@ function getMediaTraceId(slice) {
|
|
|
110
110
|
});
|
|
111
111
|
return traceId;
|
|
112
112
|
}
|
|
113
|
-
function getActionSubjectId(
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
paragraph =
|
|
118
|
-
listItem =
|
|
119
|
-
taskItem =
|
|
120
|
-
decisionItem =
|
|
113
|
+
function getActionSubjectId(_ref2) {
|
|
114
|
+
var selection = _ref2.selection,
|
|
115
|
+
schema = _ref2.schema;
|
|
116
|
+
var _schema$nodes = schema.nodes,
|
|
117
|
+
paragraph = _schema$nodes.paragraph,
|
|
118
|
+
listItem = _schema$nodes.listItem,
|
|
119
|
+
taskItem = _schema$nodes.taskItem,
|
|
120
|
+
decisionItem = _schema$nodes.decisionItem;
|
|
121
121
|
var parent = (0, _prosemirrorUtils.findParentNode)(function (node) {
|
|
122
122
|
if (node.type !== paragraph && node.type !== listItem && node.type !== taskItem && node.type !== decisionItem) {
|
|
123
123
|
return true;
|
|
@@ -159,53 +159,64 @@ function createPastePayload(actionSubjectId, attributes, linkDomain) {
|
|
|
159
159
|
}
|
|
160
160
|
} : {});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
function createPasteAnalyticsPayloadBySelection(event, slice, pasteContext) {
|
|
163
|
+
return function (selection) {
|
|
164
|
+
var text = event.clipboardData ? event.clipboardData.getData('text/plain') || event.clipboardData.getData('text/uri-list') : '';
|
|
165
|
+
var actionSubjectId = getActionSubjectId({
|
|
166
|
+
selection: selection,
|
|
167
|
+
schema: selection.$from.doc.type.schema
|
|
168
|
+
});
|
|
169
|
+
var pasteSize = slice.size;
|
|
170
|
+
var content = getContent({
|
|
171
|
+
schema: selection.$from.doc.type.schema,
|
|
172
|
+
slice: slice
|
|
173
|
+
});
|
|
174
|
+
var linkUrls = [];
|
|
175
|
+
var mediaTraceId = getMediaTraceId(slice);
|
|
169
176
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
// If we have a link among the pasted content, grab the
|
|
178
|
+
// domain and send it up with the analytics event
|
|
179
|
+
if (content === _analytics.PasteContents.url || content === _analytics.PasteContents.mixed) {
|
|
180
|
+
(0, _slice.mapSlice)(slice, function (node) {
|
|
181
|
+
var linkMark = node.marks.find(function (mark) {
|
|
182
|
+
return mark.type.name === 'link';
|
|
183
|
+
});
|
|
184
|
+
if (linkMark) {
|
|
185
|
+
linkUrls.push(linkMark.attrs.href);
|
|
186
|
+
}
|
|
187
|
+
return node;
|
|
176
188
|
});
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
189
|
+
}
|
|
190
|
+
if (pasteContext.asPlain) {
|
|
191
|
+
return createPasteAsPlainPayload(actionSubjectId, text, linkUrls.length);
|
|
192
|
+
}
|
|
193
|
+
var source = (0, _util.getPasteSource)(event);
|
|
194
|
+
if (pasteContext.type === _analytics.PasteTypes.plain) {
|
|
195
|
+
return createPastePayload(actionSubjectId, {
|
|
196
|
+
pasteSize: text.length,
|
|
197
|
+
type: pasteContext.type,
|
|
198
|
+
content: _analytics.PasteContents.text,
|
|
199
|
+
source: source,
|
|
200
|
+
hyperlinkPasteOnText: false,
|
|
201
|
+
linksInPasteCount: linkUrls.length,
|
|
202
|
+
pasteSplitList: pasteContext.pasteSplitList
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
var linkDomains = linkUrls.map(_utils.getLinkDomain);
|
|
188
206
|
return createPastePayload(actionSubjectId, {
|
|
189
|
-
pasteSize: text.length,
|
|
190
207
|
type: pasteContext.type,
|
|
191
|
-
|
|
208
|
+
pasteSize: pasteSize,
|
|
209
|
+
content: content,
|
|
192
210
|
source: source,
|
|
193
|
-
hyperlinkPasteOnText:
|
|
211
|
+
hyperlinkPasteOnText: !!pasteContext.hyperlinkPasteOnText,
|
|
194
212
|
linksInPasteCount: linkUrls.length,
|
|
213
|
+
mediaTraceId: mediaTraceId,
|
|
195
214
|
pasteSplitList: pasteContext.pasteSplitList
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
pasteSize: pasteSize,
|
|
202
|
-
content: content,
|
|
203
|
-
source: source,
|
|
204
|
-
hyperlinkPasteOnText: !!pasteContext.hyperlinkPasteOnText,
|
|
205
|
-
linksInPasteCount: linkUrls.length,
|
|
206
|
-
mediaTraceId: mediaTraceId,
|
|
207
|
-
pasteSplitList: pasteContext.pasteSplitList
|
|
208
|
-
}, linkDomains);
|
|
215
|
+
}, linkDomains);
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function createPasteAnalyticsPayload(view, event, slice, pasteContext) {
|
|
219
|
+
return createPasteAnalyticsPayloadBySelection(event, slice, pasteContext)(view.state.selection);
|
|
209
220
|
}
|
|
210
221
|
|
|
211
222
|
// TODO: ED-6612 We should not dispatch only analytics, it's preferred to wrap each command with his own analytics.
|
|
@@ -221,92 +232,117 @@ function pasteCommandWithAnalytics(view, event, slice, pasteContext) {
|
|
|
221
232
|
});
|
|
222
233
|
}
|
|
223
234
|
var handlePasteAsPlainTextWithAnalytics = function handlePasteAsPlainTextWithAnalytics(view, event, slice) {
|
|
224
|
-
return (
|
|
235
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
225
236
|
type: _analytics.PasteTypes.plain,
|
|
226
237
|
asPlain: true
|
|
227
|
-
}))(slice, event);
|
|
238
|
+
}))((0, _handlers.handlePasteAsPlainText)(slice, event));
|
|
228
239
|
};
|
|
229
240
|
exports.handlePasteAsPlainTextWithAnalytics = handlePasteAsPlainTextWithAnalytics;
|
|
230
241
|
var handlePasteIntoTaskAndDecisionWithAnalytics = function handlePasteIntoTaskAndDecisionWithAnalytics(view, event, slice, type) {
|
|
231
|
-
return (
|
|
242
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
232
243
|
type: type
|
|
233
|
-
}))(slice);
|
|
244
|
+
}))((0, _handlers.handlePasteIntoTaskOrDecisionOrPanel)(slice));
|
|
234
245
|
};
|
|
235
246
|
exports.handlePasteIntoTaskAndDecisionWithAnalytics = handlePasteIntoTaskAndDecisionWithAnalytics;
|
|
236
247
|
var handlePasteIntoCaptionWithAnalytics = function handlePasteIntoCaptionWithAnalytics(view, event, slice, type) {
|
|
237
|
-
return (
|
|
248
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
238
249
|
type: type
|
|
239
|
-
}))(slice);
|
|
250
|
+
}))((0, _handlers.handlePasteIntoCaption)(slice));
|
|
240
251
|
};
|
|
241
252
|
exports.handlePasteIntoCaptionWithAnalytics = handlePasteIntoCaptionWithAnalytics;
|
|
242
253
|
var handleCodeBlockWithAnalytics = function handleCodeBlockWithAnalytics(view, event, slice, text) {
|
|
243
|
-
return (
|
|
254
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
244
255
|
type: _analytics.PasteTypes.plain
|
|
245
|
-
}))(text);
|
|
256
|
+
}))((0, _handlers.handleCodeBlock)(text));
|
|
246
257
|
};
|
|
247
258
|
exports.handleCodeBlockWithAnalytics = handleCodeBlockWithAnalytics;
|
|
248
259
|
var handleMediaSingleWithAnalytics = function handleMediaSingleWithAnalytics(view, event, slice, type) {
|
|
249
|
-
return (
|
|
260
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
250
261
|
type: type
|
|
251
|
-
}))(slice);
|
|
262
|
+
}))((0, _handlers.handleMediaSingle)(_analytics.INPUT_METHOD.CLIPBOARD)(slice));
|
|
252
263
|
};
|
|
253
264
|
exports.handleMediaSingleWithAnalytics = handleMediaSingleWithAnalytics;
|
|
254
265
|
var handlePastePreservingMarksWithAnalytics = function handlePastePreservingMarksWithAnalytics(view, event, slice, type) {
|
|
255
|
-
return (
|
|
266
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
256
267
|
type: type
|
|
257
|
-
}))(slice);
|
|
268
|
+
}))((0, _handlers.handlePastePreservingMarks)(slice));
|
|
258
269
|
};
|
|
259
270
|
exports.handlePastePreservingMarksWithAnalytics = handlePastePreservingMarksWithAnalytics;
|
|
260
271
|
var handleMarkdownWithAnalytics = function handleMarkdownWithAnalytics(view, event, slice) {
|
|
261
|
-
return (
|
|
272
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
262
273
|
type: _analytics.PasteTypes.markdown
|
|
263
|
-
}))(slice);
|
|
274
|
+
}))((0, _handlers.handleMarkdown)(slice));
|
|
264
275
|
};
|
|
265
276
|
exports.handleMarkdownWithAnalytics = handleMarkdownWithAnalytics;
|
|
266
277
|
var handleRichTextWithAnalytics = function handleRichTextWithAnalytics(view, event, slice) {
|
|
267
|
-
return (
|
|
278
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
268
279
|
type: _analytics.PasteTypes.richText
|
|
269
|
-
}))(slice);
|
|
280
|
+
}))((0, _handlers.handleRichText)(slice));
|
|
270
281
|
};
|
|
271
282
|
exports.handleRichTextWithAnalytics = handleRichTextWithAnalytics;
|
|
283
|
+
function injectAnalyticsPayloadBeforeCommand(createPayloadByTransaction) {
|
|
284
|
+
return function (mainCommand) {
|
|
285
|
+
return function (state, dispatch, view) {
|
|
286
|
+
var originalTransaction = state.tr;
|
|
287
|
+
var fakeDispatch = function fakeDispatch(tr) {
|
|
288
|
+
originalTransaction = tr;
|
|
289
|
+
};
|
|
290
|
+
var result = mainCommand(state, fakeDispatch, view);
|
|
291
|
+
if (!result) {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
if (dispatch && originalTransaction.docChanged) {
|
|
295
|
+
// it needs to know the selection before the changes
|
|
296
|
+
var payload = createPayloadByTransaction(state.selection);
|
|
297
|
+
(0, _analytics.addAnalytics)(state, originalTransaction, payload);
|
|
298
|
+
dispatch(originalTransaction);
|
|
299
|
+
}
|
|
300
|
+
return true;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
}
|
|
272
304
|
var handlePastePanelOrDecisionIntoListWithAnalytics = function handlePastePanelOrDecisionIntoListWithAnalytics(view, event, slice) {
|
|
273
|
-
return (
|
|
305
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
274
306
|
type: _analytics.PasteTypes.richText
|
|
275
|
-
}))(slice);
|
|
307
|
+
}))((0, _handlers.handlePastePanelOrDecisionContentIntoList)(slice));
|
|
276
308
|
};
|
|
277
309
|
exports.handlePastePanelOrDecisionIntoListWithAnalytics = handlePastePanelOrDecisionIntoListWithAnalytics;
|
|
278
310
|
var handlePasteNonNestableBlockNodesIntoListWithAnalytics = function handlePasteNonNestableBlockNodesIntoListWithAnalytics(view, event, slice) {
|
|
279
|
-
return (
|
|
311
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
280
312
|
type: _analytics.PasteTypes.richText,
|
|
281
313
|
pasteSplitList: true
|
|
282
|
-
}))(slice);
|
|
314
|
+
}))((0, _handlers.handlePasteNonNestableBlockNodesIntoList)(slice));
|
|
283
315
|
};
|
|
284
316
|
exports.handlePasteNonNestableBlockNodesIntoListWithAnalytics = handlePasteNonNestableBlockNodesIntoListWithAnalytics;
|
|
285
317
|
var handleExpandWithAnalytics = function handleExpandWithAnalytics(view, event, slice) {
|
|
286
|
-
return (
|
|
287
|
-
type: _analytics.PasteTypes.richText
|
|
288
|
-
|
|
318
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
319
|
+
type: _analytics.PasteTypes.richText,
|
|
320
|
+
pasteSplitList: true
|
|
321
|
+
}))((0, _handlers.handleExpandPasteInTable)(slice));
|
|
289
322
|
};
|
|
290
323
|
exports.handleExpandWithAnalytics = handleExpandWithAnalytics;
|
|
291
324
|
var handleSelectedTableWithAnalytics = function handleSelectedTableWithAnalytics(view, event, slice) {
|
|
292
|
-
return (
|
|
325
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
293
326
|
type: _analytics.PasteTypes.richText
|
|
294
|
-
}))(slice);
|
|
327
|
+
}))((0, _handlers.handleSelectedTable)(slice));
|
|
295
328
|
};
|
|
296
329
|
exports.handleSelectedTableWithAnalytics = handleSelectedTableWithAnalytics;
|
|
297
330
|
var handlePasteLinkOnSelectedTextWithAnalytics = function handlePasteLinkOnSelectedTextWithAnalytics(view, event, slice, type) {
|
|
298
|
-
return (
|
|
331
|
+
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
299
332
|
type: type,
|
|
300
333
|
hyperlinkPasteOnText: true
|
|
301
|
-
}))(slice);
|
|
334
|
+
}))((0, _handlers.handlePasteLinkOnSelectedText)(slice));
|
|
302
335
|
};
|
|
303
336
|
exports.handlePasteLinkOnSelectedTextWithAnalytics = handlePasteLinkOnSelectedTextWithAnalytics;
|
|
304
|
-
var createPasteMeasurePayload = function createPasteMeasurePayload(
|
|
305
|
-
var view =
|
|
306
|
-
duration =
|
|
307
|
-
content =
|
|
308
|
-
distortedDuration =
|
|
309
|
-
var pasteIntoNode = getActionSubjectId(
|
|
337
|
+
var createPasteMeasurePayload = function createPasteMeasurePayload(_ref3) {
|
|
338
|
+
var view = _ref3.view,
|
|
339
|
+
duration = _ref3.duration,
|
|
340
|
+
content = _ref3.content,
|
|
341
|
+
distortedDuration = _ref3.distortedDuration;
|
|
342
|
+
var pasteIntoNode = getActionSubjectId({
|
|
343
|
+
selection: view.state.selection,
|
|
344
|
+
schema: view.state.schema
|
|
345
|
+
});
|
|
310
346
|
return {
|
|
311
347
|
action: _analytics.ACTION.PASTED_TIMED,
|
|
312
348
|
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
@@ -11,16 +11,10 @@ exports.getPasteSource = getPasteSource;
|
|
|
11
11
|
exports.hasOnlyNodesOfType = hasOnlyNodesOfType;
|
|
12
12
|
exports.htmlContainsSingleFile = htmlContainsSingleFile;
|
|
13
13
|
exports.htmlHasInvalidLinkTags = void 0;
|
|
14
|
-
exports.isCode = isCode;
|
|
15
14
|
exports.isCursorSelectionAtTextStartOrEnd = isCursorSelectionAtTextStartOrEnd;
|
|
16
15
|
exports.isEmptyNode = isEmptyNode;
|
|
17
16
|
exports.isPanelNode = isPanelNode;
|
|
18
|
-
exports.isPastedFromDropboxPaper = isPastedFromDropboxPaper;
|
|
19
17
|
exports.isPastedFromExcel = isPastedFromExcel;
|
|
20
|
-
exports.isPastedFromFabricEditor = isPastedFromFabricEditor;
|
|
21
|
-
exports.isPastedFromGoogleDocs = isPastedFromGoogleDocs;
|
|
22
|
-
exports.isPastedFromGoogleSpreadSheets = isPastedFromGoogleSpreadSheets;
|
|
23
|
-
exports.isPastedFromPages = isPastedFromPages;
|
|
24
18
|
exports.isPastedFromWord = isPastedFromWord;
|
|
25
19
|
exports.isSelectionInsidePanel = isSelectionInsidePanel;
|
|
26
20
|
exports.removeDuplicateInvalidLinks = exports.isSingleLine = void 0;
|
|
@@ -79,46 +73,6 @@ function getPasteSource(event) {
|
|
|
79
73
|
return 'uncategorized';
|
|
80
74
|
}
|
|
81
75
|
|
|
82
|
-
// TODO: Write JEST tests for this part
|
|
83
|
-
function isCode(str) {
|
|
84
|
-
var lines = str.split(/\r?\n|\r/);
|
|
85
|
-
if (3 > lines.length) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
var weight = 0;
|
|
89
|
-
lines.forEach(function (line) {
|
|
90
|
-
// Ends with : or ;
|
|
91
|
-
if (/[:;]$/.test(line)) {
|
|
92
|
-
weight++;
|
|
93
|
-
}
|
|
94
|
-
// Contains second and third braces
|
|
95
|
-
if (/[{}\[\]]/.test(line)) {
|
|
96
|
-
weight++;
|
|
97
|
-
}
|
|
98
|
-
// Contains <tag> or </
|
|
99
|
-
if (/<\w+>/.test(line) || /<\//.test(line)) {
|
|
100
|
-
weight++;
|
|
101
|
-
}
|
|
102
|
-
// Contains () <- function calls
|
|
103
|
-
if (/\(\)/.test(line)) {
|
|
104
|
-
weight++;
|
|
105
|
-
}
|
|
106
|
-
// Contains a link
|
|
107
|
-
if (/(^|[^!])\[(.*?)\]\((\S+)\)$/.test(line)) {
|
|
108
|
-
weight--;
|
|
109
|
-
}
|
|
110
|
-
// New line starts with less than two chars. e.g- if, {, <, etc
|
|
111
|
-
var token = /^(\s+)[a-zA-Z<{]{2,}/.exec(line);
|
|
112
|
-
if (token && 2 <= token[1].length) {
|
|
113
|
-
weight++;
|
|
114
|
-
}
|
|
115
|
-
if (/&&/.test(line)) {
|
|
116
|
-
weight++;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
return 4 <= weight && weight >= 0.5 * lines.length;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
76
|
// @see https://product-fabric.atlassian.net/browse/ED-3159
|
|
123
77
|
// @see https://github.com/markdown-it/markdown-it/issues/38
|
|
124
78
|
function escapeLinks(text) {
|
|
@@ -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.IconStatus = exports.IconQuote = exports.IconPanelWarning = exports.IconPanelSuccess = exports.IconPanelNote = exports.IconPanelError = exports.IconPanel = exports.IconMention = exports.IconListNumber = exports.IconList = exports.IconLink = exports.IconLayout = exports.IconImages = exports.IconHeading = exports.IconFeedback = exports.
|
|
7
|
+
exports.IconStatus = exports.IconQuote = exports.IconPanelWarning = exports.IconPanelSuccess = exports.IconPanelNote = exports.IconPanelError = exports.IconPanel = exports.IconMention = exports.IconListNumber = exports.IconList = exports.IconLink = exports.IconLayout = exports.IconImages = exports.IconHeading = exports.IconFeedback = exports.IconExpand = exports.IconEmoji = exports.IconDivider = exports.IconDecision = exports.IconDate = exports.IconCode = exports.IconAction = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -233,19 +233,6 @@ var IconPanel = (0, _reactLoadable.default)({
|
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
exports.IconPanel = IconPanel;
|
|
236
|
-
var IconCustomPanel = (0, _reactLoadable.default)({
|
|
237
|
-
loader: function loader() {
|
|
238
|
-
return Promise.resolve().then(function () {
|
|
239
|
-
return _interopRequireWildcard(require('./custom-panel'));
|
|
240
|
-
}).then(function (module) {
|
|
241
|
-
return module.default;
|
|
242
|
-
});
|
|
243
|
-
},
|
|
244
|
-
loading: function loading() {
|
|
245
|
-
return null;
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
exports.IconCustomPanel = IconCustomPanel;
|
|
249
236
|
var IconQuote = (0, _reactLoadable.default)({
|
|
250
237
|
loader: function loader() {
|
|
251
238
|
return Promise.resolve().then(function () {
|
|
@@ -272,19 +259,6 @@ var IconStatus = (0, _reactLoadable.default)({
|
|
|
272
259
|
}
|
|
273
260
|
});
|
|
274
261
|
exports.IconStatus = IconStatus;
|
|
275
|
-
var IconFallback = (0, _reactLoadable.default)({
|
|
276
|
-
loader: function loader() {
|
|
277
|
-
return Promise.resolve().then(function () {
|
|
278
|
-
return _interopRequireWildcard(require('./fallback'));
|
|
279
|
-
}).then(function (module) {
|
|
280
|
-
return module.default;
|
|
281
|
-
});
|
|
282
|
-
},
|
|
283
|
-
loading: function loading() {
|
|
284
|
-
return null;
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
exports.IconFallback = IconFallback;
|
|
288
262
|
function importHeading(level) {
|
|
289
263
|
switch (level) {
|
|
290
264
|
case 1:
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.shouldSkipGapCursor = exports.setSelectionTopLevelBlocks = exports.setGapCursorAtPos = exports.setCursorForTopLevelBlocks = exports.hasGapCursorPlugin = exports.deleteNode = exports.arrow = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
10
8
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
11
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -16,44 +14,8 @@ var _isValidTargetNode = require("./utils/is-valid-target-node");
|
|
|
16
14
|
var _position = require("../../../utils/prosemirror/position");
|
|
17
15
|
var _gapCursorPluginKey = require("../pm-plugins/gap-cursor-plugin-key");
|
|
18
16
|
var _table = require("../../../utils/table");
|
|
19
|
-
var _mapDirection;
|
|
20
|
-
var mapDirection = (_mapDirection = {}, (0, _defineProperty2.default)(_mapDirection, _direction.Direction.LEFT, -1), (0, _defineProperty2.default)(_mapDirection, _direction.Direction.RIGHT, 1), (0, _defineProperty2.default)(_mapDirection, _direction.Direction.UP, -1), (0, _defineProperty2.default)(_mapDirection, _direction.Direction.DOWN, 1), (0, _defineProperty2.default)(_mapDirection, _direction.Direction.BACKWARD, -1), (0, _defineProperty2.default)(_mapDirection, _direction.Direction.FORWARD, 1), _mapDirection);
|
|
21
|
-
function shouldHandleMediaGapCursor(dir, state) {
|
|
22
|
-
var doc = state.doc,
|
|
23
|
-
schema = state.schema,
|
|
24
|
-
selection = state.selection;
|
|
25
|
-
var $pos = (0, _direction.isBackward)(dir) ? selection.$from : selection.$to;
|
|
26
|
-
if (selection instanceof _prosemirrorState.TextSelection) {
|
|
27
|
-
// Should not use gap cursor if I am moving from a text selection into a media node
|
|
28
|
-
if (dir === _direction.Direction.UP && !(0, _position.atTheBeginningOfDoc)(state) || dir === _direction.Direction.DOWN && !(0, _position.atTheEndOfDoc)(state)) {
|
|
29
|
-
var media = (0, _utils2.getMediaNearPos)(doc, $pos, schema, mapDirection[dir]);
|
|
30
|
-
if (media) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Should not use gap cursor if I am moving from a text selection into a media node with layout wrap-right or wrap-left
|
|
36
|
-
if (dir === _direction.Direction.LEFT || dir === _direction.Direction.RIGHT) {
|
|
37
|
-
var _media = (0, _utils2.getMediaNearPos)(doc, $pos, schema, mapDirection[dir]);
|
|
38
|
-
var mediaSingle = schema.nodes.mediaSingle;
|
|
39
|
-
if (_media && _media.type === mediaSingle && (_media.attrs.layout === 'wrap-right' || _media.attrs.layout === 'wrap-left')) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (selection instanceof _prosemirrorState.NodeSelection) {
|
|
45
|
-
// Should not use gap cursor if I am moving left/right from media node with layout wrap right or wrap-left
|
|
46
|
-
if (dir === _direction.Direction.LEFT || dir === _direction.Direction.RIGHT) {
|
|
47
|
-
var maybeMedia = doc.nodeAt(selection.$from.pos);
|
|
48
|
-
var _mediaSingle = schema.nodes.mediaSingle;
|
|
49
|
-
if (maybeMedia && maybeMedia.type === _mediaSingle && (maybeMedia.attrs.layout === 'wrap-right' || maybeMedia.attrs.layout === 'wrap-left')) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
17
|
var shouldSkipGapCursor = function shouldSkipGapCursor(direction, state, $pos) {
|
|
18
|
+
var _$pos$nodeBefore;
|
|
57
19
|
var doc = state.doc,
|
|
58
20
|
schema = state.schema;
|
|
59
21
|
switch (direction) {
|
|
@@ -61,14 +23,49 @@ var shouldSkipGapCursor = function shouldSkipGapCursor(direction, state, $pos) {
|
|
|
61
23
|
if ((0, _position.atTheBeginningOfDoc)(state)) {
|
|
62
24
|
return false;
|
|
63
25
|
}
|
|
64
|
-
return (0, _table.isPositionNearTableRow)($pos, schema, 'before') || (0, _utils2.isTextBlockNearPos)(doc, schema, $pos, -1);
|
|
26
|
+
return (0, _table.isPositionNearTableRow)($pos, schema, 'before') || (0, _utils2.isTextBlockNearPos)(doc, schema, $pos, -1) || (0, _utils.isNodeBeforeMediaNode)($pos, state);
|
|
65
27
|
case _direction.Direction.DOWN:
|
|
66
|
-
return (0, _position.atTheEndOfDoc)(state) || (0, _utils2.isTextBlockNearPos)(doc, schema, $pos, 1) || (0, _table.isPositionNearTableRow)($pos, schema, 'after')
|
|
28
|
+
return (0, _position.atTheEndOfDoc)(state) || (0, _utils2.isTextBlockNearPos)(doc, schema, $pos, 1) || (0, _table.isPositionNearTableRow)($pos, schema, 'after') || ((_$pos$nodeBefore = $pos.nodeBefore) === null || _$pos$nodeBefore === void 0 ? void 0 : _$pos$nodeBefore.type.name) === 'text' && !$pos.nodeAfter // end of a paragraph
|
|
29
|
+
;
|
|
30
|
+
|
|
67
31
|
default:
|
|
68
32
|
return false;
|
|
69
33
|
}
|
|
70
34
|
};
|
|
35
|
+
|
|
36
|
+
// These cases should be handled using the handleMediaGapCursor function
|
|
71
37
|
exports.shouldSkipGapCursor = shouldSkipGapCursor;
|
|
38
|
+
function shouldHandleMediaGapCursor(dir, state) {
|
|
39
|
+
var _selection$$from$node;
|
|
40
|
+
var selection = state.selection;
|
|
41
|
+
var upArrowFromGapCursorIntoMedia = selection instanceof _selection.GapCursorSelection && dir === _direction.Direction.UP && selection.$from.nodeBefore && (0, _utils.isMediaNode)(selection.$from.nodeBefore);
|
|
42
|
+
var downArrowFromGapCursorIntoMediaGroup = selection instanceof _selection.GapCursorSelection && dir === _direction.Direction.DOWN && ((_selection$$from$node = selection.$from.nodeAfter) === null || _selection$$from$node === void 0 ? void 0 : _selection$$from$node.type.name) === 'mediaGroup';
|
|
43
|
+
return upArrowFromGapCursorIntoMedia || downArrowFromGapCursorIntoMediaGroup;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Handle media gap cursor for up/down arrow into media nodes
|
|
47
|
+
// Should check this case by using shouldHandleMediaGapCursor first
|
|
48
|
+
function handleMediaGapCursor(dir, state) {
|
|
49
|
+
var selection = state.selection,
|
|
50
|
+
tr = state.tr;
|
|
51
|
+
var $pos = (0, _direction.isBackward)(dir) ? selection.$from : selection.$to;
|
|
52
|
+
if (dir === _direction.Direction.UP && selection.$from.nodeBefore && (0, _utils.isMediaNode)(selection.$from.nodeBefore)) {
|
|
53
|
+
var _tr$doc$nodeAt;
|
|
54
|
+
var nodeBeforePos = (0, _prosemirrorUtils.findPositionOfNodeBefore)(tr.selection);
|
|
55
|
+
if (nodeBeforePos && selection.side === 'right' && ((_tr$doc$nodeAt = tr.doc.nodeAt(nodeBeforePos)) === null || _tr$doc$nodeAt === void 0 ? void 0 : _tr$doc$nodeAt.type.name) === 'mediaSingle') {
|
|
56
|
+
tr.setSelection(new _prosemirrorState.NodeSelection(tr.doc.resolve(nodeBeforePos))).scrollIntoView();
|
|
57
|
+
} else if (nodeBeforePos || nodeBeforePos === 0) {
|
|
58
|
+
tr.setSelection(new _selection.GapCursorSelection(tr.doc.resolve(nodeBeforePos), _selection.Side.LEFT)).scrollIntoView();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (dir === _direction.Direction.DOWN && selection.$from.nodeAfter) {
|
|
62
|
+
var nodeAfterPos = selection.side === 'right' ? $pos.pos : $pos.pos + selection.$from.nodeAfter.nodeSize;
|
|
63
|
+
if (nodeAfterPos) {
|
|
64
|
+
tr.setSelection(new _selection.GapCursorSelection(tr.doc.resolve(nodeAfterPos), _selection.Side.LEFT)).scrollIntoView();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return tr;
|
|
68
|
+
}
|
|
72
69
|
var arrow = function arrow(dir, endOfTextblock) {
|
|
73
70
|
return function (state, dispatch, view) {
|
|
74
71
|
var doc = state.doc,
|
|
@@ -97,13 +94,21 @@ var arrow = function arrow(dir, endOfTextblock) {
|
|
|
97
94
|
if (selection.node.isInline) {
|
|
98
95
|
return false;
|
|
99
96
|
}
|
|
100
|
-
if (dir === _direction.Direction.UP || dir === _direction.Direction.DOWN) {
|
|
97
|
+
if (dir === _direction.Direction.UP && !(0, _position.atTheBeginningOfDoc)(state) && !(0, _utils.isNodeBeforeMediaNode)($pos, state) || dir === _direction.Direction.DOWN) {
|
|
101
98
|
// We dont add gap cursor on node selections going up and down
|
|
99
|
+
// Except we do if we're going up for a block node which is the
|
|
100
|
+
// first node in the document OR the node before is a media node
|
|
102
101
|
return false;
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
|
|
105
|
+
// Handle media gap cursor for up/down arrow into media nodes
|
|
106
|
+
if (shouldHandleMediaGapCursor(dir, state)) {
|
|
107
|
+
var updatedTr = handleMediaGapCursor(dir, state);
|
|
108
|
+
if (dispatch) {
|
|
109
|
+
dispatch(updatedTr);
|
|
110
|
+
}
|
|
111
|
+
return true;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
// when jumping between block nodes at the same depth, we need to reverse cursor without changing ProseMirror position
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.setNodeSelectionNearPos = exports.mayGetStatusAtSelection = exports.isEmptyStatus = void 0;
|
|
7
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
8
8
|
var mayGetStatusAtSelection = function mayGetStatusAtSelection(selection) {
|
|
9
9
|
if (selection && selection instanceof _prosemirrorState.NodeSelection) {
|
|
@@ -15,24 +15,10 @@ var mayGetStatusAtSelection = function mayGetStatusAtSelection(selection) {
|
|
|
15
15
|
return null;
|
|
16
16
|
};
|
|
17
17
|
exports.mayGetStatusAtSelection = mayGetStatusAtSelection;
|
|
18
|
-
var mayGetStatusAtPos = function mayGetStatusAtPos(pos, doc) {
|
|
19
|
-
if (pos) {
|
|
20
|
-
var node = doc.nodeAt(pos);
|
|
21
|
-
if (node && node.type.name === 'status') {
|
|
22
|
-
return node.attrs;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
};
|
|
27
|
-
exports.mayGetStatusAtPos = mayGetStatusAtPos;
|
|
28
18
|
var isEmptyStatus = function isEmptyStatus(node) {
|
|
29
19
|
return node && (node.text && node.text.trim().length === 0 || node.text === '');
|
|
30
20
|
};
|
|
31
21
|
exports.isEmptyStatus = isEmptyStatus;
|
|
32
|
-
var setSelectionNearPos = function setSelectionNearPos(tr, pos) {
|
|
33
|
-
return tr.setSelection(_prosemirrorState.Selection.near(tr.doc.resolve(tr.mapping.map(pos))));
|
|
34
|
-
};
|
|
35
|
-
exports.setSelectionNearPos = setSelectionNearPos;
|
|
36
22
|
var setNodeSelectionNearPos = function setNodeSelectionNearPos(tr, pos) {
|
|
37
23
|
return tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, tr.mapping.map(pos)));
|
|
38
24
|
};
|
|
@@ -11,7 +11,6 @@ Object.defineProperty(exports, "DEFAULT_COLOR", {
|
|
|
11
11
|
return _color.DEFAULT_COLOR;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
exports.createInitialPluginState = createInitialPluginState;
|
|
15
14
|
exports.createPlugin = createPlugin;
|
|
16
15
|
exports.pluginKey = void 0;
|
|
17
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|