@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
|
@@ -4,14 +4,51 @@ import { isDroppedFile } from '../../../utils/drag-drop';
|
|
|
4
4
|
import { canInsertMedia, isMediaSelected } from '../utils';
|
|
5
5
|
import { insertExternalImage, startImageUpload } from './commands';
|
|
6
6
|
import { stateKey } from './plugin-key';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Microsoft Office includes a screenshot image when copying text content.
|
|
10
|
+
*
|
|
11
|
+
* This function determines whether or not we can ignore the image if it
|
|
12
|
+
* came from MS Office. We do this by checking for
|
|
13
|
+
*
|
|
14
|
+
* - plain text
|
|
15
|
+
* - HTML text which includes the MS Office namespace
|
|
16
|
+
* - the number of files and the file name/type
|
|
17
|
+
*
|
|
18
|
+
* It is easy to manually verify this using by using Office on Mac
|
|
19
|
+
* (or Excel if on Windows) and pasting into
|
|
20
|
+
* https://evercoder.github.io/clipboard-inspector/
|
|
21
|
+
*
|
|
22
|
+
* Note: image content in Word is stored in the `text/html` portion
|
|
23
|
+
* of the clipboard, not under `files` attachment like the screenshot.
|
|
24
|
+
*
|
|
25
|
+
* @returns boolean True if the paste event contains a screenshot from MS Office
|
|
26
|
+
*/
|
|
27
|
+
const hasScreenshotImageFromMSOffice = ev => {
|
|
28
|
+
const {
|
|
29
|
+
clipboardData
|
|
30
|
+
} = ev;
|
|
31
|
+
if (!clipboardData || clipboardData.files.length !== 1) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const textPlain = !!clipboardData.getData('text/plain');
|
|
35
|
+
const textHtml = clipboardData.getData('text/html');
|
|
36
|
+
const isOfficeXMLNamespace = textHtml.includes('urn:schemas-microsoft-com:office:office');
|
|
37
|
+
const file = clipboardData.files[0];
|
|
38
|
+
const isImagePNG = file.type === 'image/png' && file.name === 'image.png';
|
|
39
|
+
return isImagePNG && textPlain && isOfficeXMLNamespace;
|
|
40
|
+
};
|
|
7
41
|
const createDOMHandler = (pred, eventName) => (view, event) => {
|
|
8
42
|
if (!pred(event)) {
|
|
9
43
|
return false;
|
|
10
44
|
}
|
|
11
|
-
event
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
45
|
+
const shouldUpload = !hasScreenshotImageFromMSOffice(event);
|
|
46
|
+
if (shouldUpload) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
event.stopPropagation();
|
|
49
|
+
startImageUpload(event)(view.state, view.dispatch);
|
|
50
|
+
}
|
|
51
|
+
return shouldUpload;
|
|
15
52
|
};
|
|
16
53
|
const getNewActiveUpload = (tr, pluginState) => {
|
|
17
54
|
const meta = tr.getMeta(stateKey);
|
|
@@ -76,7 +113,12 @@ export const createPlugin = ({
|
|
|
76
113
|
// if we've add a new upload to the state, execute the uploadHandler
|
|
77
114
|
const oldState = stateKey.getState(prevState);
|
|
78
115
|
if (currentState.activeUpload !== oldState.activeUpload && currentState.activeUpload && uploadHandler) {
|
|
79
|
-
|
|
116
|
+
const {
|
|
117
|
+
event
|
|
118
|
+
} = currentState.activeUpload;
|
|
119
|
+
if (!event || !hasScreenshotImageFromMSOffice(event)) {
|
|
120
|
+
uploadHandler(event, options => insertExternalImage(options)(view.state, view.dispatch));
|
|
121
|
+
}
|
|
80
122
|
}
|
|
81
123
|
},
|
|
82
124
|
destroy() {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
-
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
3
|
+
import { N40A, N50A, DN70, DN80 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { themed } from '@atlaskit/theme/components';
|
|
4
5
|
import { columnLayoutSharedStyle, LAYOUT_SECTION_MARGIN, LAYOUT_COLUMN_PADDING } from '@atlaskit/editor-common/styles';
|
|
5
6
|
import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
import { TableCssClassName } from '@atlaskit/editor-plugin-table/types';
|
|
7
8
|
import { tableMarginFullWidthMode } from '@atlaskit/editor-plugin-table/ui/consts';
|
|
8
9
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
9
|
-
export const layoutStyles = css`
|
|
10
|
+
export const layoutStyles = props => css`
|
|
10
11
|
.ProseMirror {
|
|
11
12
|
${columnLayoutSharedStyle} [data-layout-section] {
|
|
12
13
|
margin: ${gridSize() - 1}px -${akLayoutGutterOffset}px 0;
|
|
@@ -18,7 +19,10 @@ export const layoutStyles = css`
|
|
|
18
19
|
flex: 1;
|
|
19
20
|
min-width: 0;
|
|
20
21
|
border: ${akEditorSelectedBorderSize}px solid
|
|
21
|
-
${
|
|
22
|
+
${themed({
|
|
23
|
+
light: `var(--ds-border, ${N40A})`,
|
|
24
|
+
dark: `var(--ds-border, ${DN70})`
|
|
25
|
+
})(props)};
|
|
22
26
|
border-radius: 4px;
|
|
23
27
|
padding: ${LAYOUT_COLUMN_PADDING}px;
|
|
24
28
|
box-sizing: border-box;
|
|
@@ -105,7 +109,11 @@ export const layoutStyles = css`
|
|
|
105
109
|
/* Shows the border when cursor is inside a layout */
|
|
106
110
|
&.selected [data-layout-column],
|
|
107
111
|
&:hover [data-layout-column] {
|
|
108
|
-
border
|
|
112
|
+
border: ${akEditorSelectedBorderSize}px solid
|
|
113
|
+
${themed({
|
|
114
|
+
light: `var(--ds-border, ${N50A})`,
|
|
115
|
+
dark: `var(--ds-border, ${DN80})`
|
|
116
|
+
})(props)};
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
&.selected.danger > [data-layout-column] {
|
|
@@ -1,32 +1,5 @@
|
|
|
1
1
|
import { findParentNodeClosestToPos } from 'prosemirror-utils';
|
|
2
2
|
import { isListNode, isListItemNode } from './node';
|
|
3
|
-
export function findFirstNestedList($pos) {
|
|
4
|
-
const currentNode = $pos.doc.nodeAt($pos.pos);
|
|
5
|
-
let currentListItemPos = null;
|
|
6
|
-
if (isListItemNode(currentNode)) {
|
|
7
|
-
currentListItemPos = $pos.pos;
|
|
8
|
-
} else {
|
|
9
|
-
const result = findParentNodeClosestToPos($pos, isListItemNode);
|
|
10
|
-
currentListItemPos = (result === null || result === void 0 ? void 0 : result.pos) || null;
|
|
11
|
-
}
|
|
12
|
-
if (!currentListItemPos) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
const currentListItemNode = $pos.doc.nodeAt(currentListItemPos);
|
|
16
|
-
if (!currentListItemNode) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
const lastListItemChild = currentListItemNode.child(currentListItemNode.childCount - 1);
|
|
20
|
-
if (!isListNode(lastListItemChild)) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const firstNestedListPosition = currentListItemNode.nodeSize - lastListItemChild.nodeSize;
|
|
24
|
-
const firstNestedListNode = $pos.doc.nodeAt(firstNestedListPosition);
|
|
25
|
-
if (!isListNode(firstNestedListNode)) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return $pos.doc.resolve(firstNestedListPosition);
|
|
29
|
-
}
|
|
30
3
|
export function findFirstParentListNode($pos) {
|
|
31
4
|
const currentNode = $pos.doc.nodeAt($pos.pos);
|
|
32
5
|
let listNodePosition = null;
|
|
@@ -15,29 +15,6 @@ export const getListLiftTarget = resPos => {
|
|
|
15
15
|
}
|
|
16
16
|
return target - 1;
|
|
17
17
|
};
|
|
18
|
-
export const getNextSiblingListItemPosition = $pos => {
|
|
19
|
-
var _$pos$doc$nodeAt;
|
|
20
|
-
let target = $pos.depth;
|
|
21
|
-
let found = false;
|
|
22
|
-
for (let i = $pos.depth; i > 0; i--) {
|
|
23
|
-
const node = $pos.node(i);
|
|
24
|
-
if (isListItemNode(node)) {
|
|
25
|
-
target = i;
|
|
26
|
-
found = true;
|
|
27
|
-
}
|
|
28
|
-
if (found) {
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const listItemPosition = target - 1;
|
|
33
|
-
const listItemNodePosition = ((_$pos$doc$nodeAt = $pos.doc.nodeAt(listItemPosition)) === null || _$pos$doc$nodeAt === void 0 ? void 0 : _$pos$doc$nodeAt.nodeSize) || 0;
|
|
34
|
-
const nextListItemPosition = listItemPosition + listItemNodePosition;
|
|
35
|
-
const nextListItemNode = $pos.doc.nodeAt(nextListItemPosition);
|
|
36
|
-
if (nextListItemNode) {
|
|
37
|
-
return $pos.doc.resolve(nextListItemPosition);
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
};
|
|
41
18
|
export const hasValidListIndentationLevel = ({
|
|
42
19
|
tr,
|
|
43
20
|
maxIndentation
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Fragment } from 'prosemirror-model';
|
|
2
|
-
export function isDocumentNode(node) {
|
|
3
|
-
return Boolean(node && node.type && node.type.name === 'doc');
|
|
4
|
-
}
|
|
5
2
|
export function isListNode(node) {
|
|
6
3
|
return Boolean(node && node.type && ['orderedList', 'bulletList'].includes(node.type.name));
|
|
7
4
|
}
|
|
@@ -14,7 +11,7 @@ export function isListItemNode(node) {
|
|
|
14
11
|
export function isBulletList(node) {
|
|
15
12
|
return Boolean(node && node.type && 'bulletList' === node.type.name);
|
|
16
13
|
}
|
|
17
|
-
|
|
14
|
+
function isListNodeValidContent(node) {
|
|
18
15
|
const {
|
|
19
16
|
bulletList
|
|
20
17
|
} = node.type.schema.nodes;
|
|
@@ -122,12 +122,12 @@ export const normalizeListItemsSelection = ({
|
|
|
122
122
|
const anchor = resolvePositionToEndOfListItem($to);
|
|
123
123
|
return new TextSelection(anchor, head);
|
|
124
124
|
};
|
|
125
|
-
|
|
125
|
+
const resolvePositionToStartOfListItem = $pos => {
|
|
126
126
|
const fromRange = $pos.blockRange($pos, isListItemNode);
|
|
127
127
|
const fromPosition = fromRange && $pos.textOffset === 0 && fromRange.end - 1 === $pos.pos ? Selection.near($pos.doc.resolve(fromRange.end + 1), 1).$from : $pos;
|
|
128
128
|
return fromPosition;
|
|
129
129
|
};
|
|
130
|
-
|
|
130
|
+
const resolvePositionToEndOfListItem = $pos => {
|
|
131
131
|
const toRange = $pos.blockRange($pos, isListItemNode);
|
|
132
132
|
const toPosition = toRange && $pos.textOffset === 0 && toRange.start + 1 === $pos.pos ? Selection.near($pos.doc.resolve(toRange.start - 1), -1).$to : $pos;
|
|
133
133
|
return toPosition;
|
|
@@ -144,17 +144,4 @@ export const createListNodeRange = ({
|
|
|
144
144
|
return null;
|
|
145
145
|
}
|
|
146
146
|
return range;
|
|
147
|
-
};
|
|
148
|
-
export const createListItemNodeRange = ({
|
|
149
|
-
selection
|
|
150
|
-
}) => {
|
|
151
|
-
const {
|
|
152
|
-
$from,
|
|
153
|
-
$to
|
|
154
|
-
} = selection;
|
|
155
|
-
const range = $from.blockRange($to, isListItemNode);
|
|
156
|
-
if (!range) {
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
return range;
|
|
160
147
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { deleteSelection, splitBlock } from 'prosemirror-commands';
|
|
2
|
-
import { Fragment } from 'prosemirror-model';
|
|
3
2
|
import { NodeSelection } from 'prosemirror-state';
|
|
4
3
|
import { findPositionOfNodeBefore } from 'prosemirror-utils';
|
|
5
4
|
import { createParagraphNear, createNewParagraphBelow } from '../../../commands';
|
|
@@ -86,7 +85,7 @@ export const isInsidePotentialEmptyParagraph = state => {
|
|
|
86
85
|
} = state.selection;
|
|
87
86
|
return $from.parent.type === state.schema.nodes.paragraph && atTheBeginningOfBlock(state) && atTheEndOfBlock(state);
|
|
88
87
|
};
|
|
89
|
-
|
|
88
|
+
const posOfMediaGroupBelow = (state, $pos, prepend = true) => {
|
|
90
89
|
let adjacentPos;
|
|
91
90
|
let adjacentNode;
|
|
92
91
|
if (isSelectionNonMediaBlockNode(state)) {
|
|
@@ -111,23 +110,6 @@ export const posOfParentMediaGroup = (state, $pos, prepend = false) => {
|
|
|
111
110
|
}
|
|
112
111
|
return;
|
|
113
112
|
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The function will return the position after current selection where mediaGroup can be inserted.
|
|
117
|
-
*/
|
|
118
|
-
export function endPositionForMedia(state, resolvedPos) {
|
|
119
|
-
const {
|
|
120
|
-
mediaGroup
|
|
121
|
-
} = state.schema.nodes;
|
|
122
|
-
let i = resolvedPos.depth;
|
|
123
|
-
for (; i > 1; i--) {
|
|
124
|
-
const nodeType = resolvedPos.node(i).type;
|
|
125
|
-
if (nodeType.validContent(Fragment.from(mediaGroup.create()))) {
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return resolvedPos.end(i) + 1;
|
|
130
|
-
}
|
|
131
113
|
export const removeMediaNode = (view, node, getPos) => {
|
|
132
114
|
const {
|
|
133
115
|
id
|
|
@@ -1,15 +1,56 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
2
3
|
import Mention from '../ui/Mention';
|
|
3
4
|
import { useIntl } from 'react-intl-next';
|
|
4
5
|
import { messages } from '../messages';
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import { isResolvingMentionProvider, MentionNameStatus } from '@atlaskit/mention';
|
|
7
|
+
import { isPromise } from '@atlaskit/mention/types';
|
|
8
|
+
const UNKNOWN_USER_ID = '_|unknown|_';
|
|
9
|
+
const MentionAssistiveTextComponent = ({
|
|
10
|
+
id,
|
|
11
|
+
text,
|
|
12
|
+
providers,
|
|
13
|
+
accessLevel,
|
|
14
|
+
mentionProvider
|
|
7
15
|
}) => {
|
|
16
|
+
const [resolvedName, setResolvedName] = useState(text);
|
|
8
17
|
const intl = useIntl();
|
|
9
|
-
|
|
18
|
+
const processName = name => {
|
|
19
|
+
if (name.status === MentionNameStatus.OK) {
|
|
20
|
+
return `@${name.name || ''}`;
|
|
21
|
+
} else {
|
|
22
|
+
return `@${UNKNOWN_USER_ID}`;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (mentionProvider) {
|
|
27
|
+
mentionProvider.then(async provider => {
|
|
28
|
+
if (!text && isResolvingMentionProvider(provider)) {
|
|
29
|
+
const nameDetail = provider.resolveMentionName(id);
|
|
30
|
+
if (isPromise(nameDetail)) {
|
|
31
|
+
return processName(await nameDetail);
|
|
32
|
+
} else {
|
|
33
|
+
return processName(nameDetail);
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
return text;
|
|
37
|
+
}
|
|
38
|
+
}).then(resolvedName => {
|
|
39
|
+
setResolvedName(resolvedName);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}, [id, text, mentionProvider]);
|
|
43
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
10
44
|
className: 'assistive'
|
|
11
|
-
}, `${intl.formatMessage(messages.mentionsNodeLabel)} ${
|
|
12
|
-
|
|
45
|
+
}, `${intl.formatMessage(messages.mentionsNodeLabel)} ${resolvedName}`), /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
"aria-hidden": "true"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Mention, {
|
|
48
|
+
id: id,
|
|
49
|
+
text: resolvedName,
|
|
50
|
+
accessLevel: accessLevel,
|
|
51
|
+
providers: providers
|
|
52
|
+
})));
|
|
53
|
+
};
|
|
13
54
|
export const MentionNodeView = props => {
|
|
14
55
|
const {
|
|
15
56
|
providerFactory
|
|
@@ -19,14 +60,21 @@ export const MentionNodeView = props => {
|
|
|
19
60
|
text,
|
|
20
61
|
accessLevel
|
|
21
62
|
} = props.node.attrs;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
const renderAssistiveTextWithProviders = providers => {
|
|
64
|
+
const {
|
|
65
|
+
mentionProvider
|
|
66
|
+
} = providers;
|
|
67
|
+
return /*#__PURE__*/React.createElement(MentionAssistiveTextComponent, {
|
|
68
|
+
mentionProvider: mentionProvider,
|
|
69
|
+
id: id,
|
|
70
|
+
text: text,
|
|
71
|
+
providers: providerFactory,
|
|
72
|
+
accessLevel: accessLevel
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
76
|
+
providers: ['mentionProvider', 'profilecardProvider'],
|
|
77
|
+
providerFactory: providerFactory,
|
|
78
|
+
renderNode: renderAssistiveTextWithProviders
|
|
79
|
+
});
|
|
32
80
|
};
|
|
@@ -4,7 +4,6 @@ import { Fragment } from 'prosemirror-model';
|
|
|
4
4
|
import { isResolvingMentionProvider } from '@atlaskit/mention/resource';
|
|
5
5
|
import { MENTION_ITEM_HEIGHT, MentionItem } from '@atlaskit/mention/item';
|
|
6
6
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
7
|
-
import { TeamMentionHighlight, TeamMentionHighlightController } from '@atlaskit/mention/spotlight';
|
|
8
7
|
import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAheadInviteExposurePayload, buildTypeAheadInviteItemClickedPayload, buildTypeAheadInviteItemViewedPayload, buildTypeAheadRenderedPayload } from '../analytics';
|
|
9
8
|
import InviteItem, { INVITE_ITEM_DESCRIPTION } from '../ui/InviteItem';
|
|
10
9
|
import { isInviteItem, isTeamType, isTeamStats, shouldKeepInviteItem } from '../utils';
|
|
@@ -112,7 +111,7 @@ const buildAndSendElementsTypeAheadAnalytics = fireEvent => ({
|
|
|
112
111
|
const payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams);
|
|
113
112
|
fireEvent(payload);
|
|
114
113
|
};
|
|
115
|
-
|
|
114
|
+
|
|
116
115
|
/**
|
|
117
116
|
* When a team mention is selected, we render a team link and list of member/user mentions
|
|
118
117
|
* in editor content
|
|
@@ -185,17 +184,6 @@ export const createTypeAheadConfig = ({
|
|
|
185
184
|
if (CustomHighlightComponent) {
|
|
186
185
|
return /*#__PURE__*/React.createElement(CustomHighlightComponent, null);
|
|
187
186
|
}
|
|
188
|
-
const pluginState = getMentionPluginState(state);
|
|
189
|
-
const provider = pluginState.mentionProvider;
|
|
190
|
-
if (provider) {
|
|
191
|
-
const teamMentionProvider = provider;
|
|
192
|
-
if (isTeamMentionProvider(teamMentionProvider) && teamMentionProvider.mentionTypeaheadHighlightEnabled()) {
|
|
193
|
-
return /*#__PURE__*/React.createElement(TeamMentionHighlight, {
|
|
194
|
-
createTeamLink: teamMentionProvider.mentionTypeaheadCreateTeamPath(),
|
|
195
|
-
onClose: () => TeamMentionHighlightController.registerClosed()
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
187
|
return null;
|
|
200
188
|
},
|
|
201
189
|
getItems({
|
|
@@ -304,7 +292,6 @@ export const createTypeAheadConfig = ({
|
|
|
304
292
|
fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, sourceListItem.map(x => x.mention), query, pluginState.contextIdentifierProvider));
|
|
305
293
|
sessionId = uuid();
|
|
306
294
|
if (mentionProvider && isTeamType(userType)) {
|
|
307
|
-
TeamMentionHighlightController.registerTeamMention();
|
|
308
295
|
return insert(buildNodesForTeamMention(schema, item.mention, mentionProvider, sanitizePrivateContent));
|
|
309
296
|
}
|
|
310
297
|
|
|
@@ -5,9 +5,8 @@ import AddIcon from '@atlaskit/icon/glyph/add';
|
|
|
5
5
|
import { N300 } from '@atlaskit/theme/colors';
|
|
6
6
|
import React, { useCallback, useEffect } from 'react';
|
|
7
7
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
8
|
-
import { avatarStyle, capitalizedStyle, mentionItemStyle, nameSectionStyle, rowStyle,
|
|
8
|
+
import { avatarStyle, capitalizedStyle, mentionItemStyle, nameSectionStyle, rowStyle, mentionItemSelectedStyle } from './styles';
|
|
9
9
|
import { messages } from '../../messages';
|
|
10
|
-
export const INVITE_ITEM_MIN_HEIGHT = AVATAR_HEIGHT + ROW_SIDE_PADDING * 2;
|
|
11
10
|
export const INVITE_ITEM_DESCRIPTION = {
|
|
12
11
|
id: 'invite-teammate'
|
|
13
12
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { setWindowHeight } from './commands';
|
|
3
3
|
import { createPluginState, mobileDimensionsPluginKey } from './plugin-factory';
|
|
4
|
-
|
|
5
|
-
// 44 pixels squared is the minimum size for a tap target as per Apple's UX design guidelines
|
|
6
|
-
export const MIN_TAP_SIZE_PX = 44;
|
|
7
4
|
const getInitialState = () => ({
|
|
8
5
|
keyboardHeight: -1,
|
|
9
6
|
mobilePaddingTop: 0,
|