@atlaskit/editor-core 181.0.0 → 182.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 +47 -0
- package/codemods/140.0.0-rc-kraken-fix-type-errors.ts +0 -2
- package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +0 -17
- package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +0 -4
- package/dist/cjs/create-editor/create-plugins-list.js +7 -2
- package/dist/cjs/create-editor/feature-flags-from-props.js +31 -26
- package/dist/cjs/create-editor/sort-by-order.js +12 -0
- package/dist/cjs/editor-next/editor-migration-component.js +4 -1
- package/dist/cjs/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/cjs/labs/next/full-page.js +2 -1
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/labs/next/presets/universal.js +7 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +2 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +4 -7
- package/dist/cjs/plugins/analytics/plugin.js +6 -6
- package/dist/cjs/plugins/avatar-group/index.js +5 -2
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/cjs/plugins/base/index.js +4 -2
- package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
- package/dist/cjs/plugins/border/index.js +20 -0
- package/dist/cjs/plugins/card/index.js +4 -2
- package/dist/cjs/plugins/card/toolbar.js +12 -15
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/cjs/plugins/code-block/toolbar.js +1 -1
- package/dist/cjs/plugins/collab-edit/analytics.js +2 -3
- package/dist/cjs/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/cjs/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/cjs/plugins/collab-edit/index.js +5 -3
- package/dist/cjs/plugins/collab-edit/plugin.js +4 -3
- package/dist/cjs/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/cjs/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/cjs/plugins/date/index.js +90 -64
- package/dist/cjs/plugins/editor-disabled/index.js +8 -0
- package/dist/cjs/plugins/expand/index.js +4 -1
- package/dist/cjs/plugins/expand/nodeviews/index.js +6 -7
- package/dist/cjs/plugins/expand/pm-plugins/main.js +5 -2
- package/dist/cjs/plugins/extension/extension-api.js +27 -14
- package/dist/cjs/plugins/extension/pm-plugins/main.js +117 -177
- package/dist/cjs/plugins/extension/pm-plugins/utils.js +80 -0
- package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +7 -11
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +15 -7
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/cjs/plugins/hyperlink/Toolbar.js +9 -12
- package/dist/cjs/plugins/hyperlink/index.js +6 -2
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
- package/dist/cjs/plugins/index.js +7 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/cjs/plugins/list/commands/index.js +31 -27
- package/dist/cjs/plugins/list/commands/outdent-list.js +2 -3
- package/dist/cjs/plugins/list/index.js +4 -3
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +58 -0
- package/dist/cjs/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/cjs/plugins/list/pm-plugins/main.js +23 -21
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
- package/dist/cjs/plugins/media/nodeviews/styles.js +13 -1
- package/dist/cjs/plugins/media/toolbar/commands.js +105 -2
- package/dist/cjs/plugins/media/toolbar/imageBorder.js +20 -0
- package/dist/cjs/plugins/media/toolbar/index.js +33 -4
- package/dist/cjs/plugins/media/ui/ImageBorder/index.js +219 -0
- package/dist/cjs/plugins/media/ui/ImageBorder/messages.js +50 -0
- package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +54 -0
- package/dist/cjs/plugins/media/utils/current-media-node.js +28 -5
- package/dist/cjs/plugins/paste/util/index.js +2 -0
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +5 -0
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +3 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/cjs/plugins/type-ahead/index.js +4 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +4 -2
- package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +4 -2
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +41 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +2 -0
- package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
- package/dist/cjs/plugins/type-ahead/utils.js +22 -2
- package/dist/cjs/test-utils.js +3 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/cjs/ui/styles.js +1 -1
- package/dist/cjs/utils/input-rules.js +0 -17
- package/dist/cjs/utils/insert.js +53 -7
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +7 -2
- package/dist/es2019/create-editor/feature-flags-from-props.js +31 -26
- package/dist/es2019/create-editor/sort-by-order.js +11 -0
- package/dist/es2019/editor-next/editor-migration-component.js +4 -1
- package/dist/es2019/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/es2019/labs/next/full-page.js +2 -1
- package/dist/es2019/labs/next/presets/default.js +2 -1
- package/dist/es2019/labs/next/presets/universal.js +8 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -8
- package/dist/es2019/plugins/analytics/plugin.js +45 -43
- package/dist/es2019/plugins/avatar-group/index.js +26 -21
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/es2019/plugins/base/index.js +101 -97
- package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +2 -7
- package/dist/es2019/plugins/border/index.js +11 -0
- package/dist/es2019/plugins/card/index.js +4 -2
- package/dist/es2019/plugins/card/toolbar.js +10 -11
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/es2019/plugins/code-block/toolbar.js +2 -2
- package/dist/es2019/plugins/collab-edit/analytics.js +2 -3
- package/dist/es2019/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/es2019/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/es2019/plugins/collab-edit/index.js +5 -3
- package/dist/es2019/plugins/collab-edit/plugin.js +4 -3
- package/dist/es2019/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/es2019/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/es2019/plugins/date/index.js +92 -64
- package/dist/es2019/plugins/editor-disabled/index.js +8 -0
- package/dist/es2019/plugins/expand/index.js +57 -53
- package/dist/es2019/plugins/expand/nodeviews/index.js +6 -9
- package/dist/es2019/plugins/expand/pm-plugins/main.js +5 -3
- package/dist/es2019/plugins/extension/extension-api.js +31 -13
- package/dist/es2019/plugins/extension/pm-plugins/main.js +77 -96
- package/dist/es2019/plugins/extension/pm-plugins/utils.js +30 -0
- package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -8
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -3
- package/dist/es2019/plugins/find-replace/index.js +5 -2
- package/dist/es2019/plugins/floating-toolbar/index.js +159 -149
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +4 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +4 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/es2019/plugins/hyperlink/Toolbar.js +7 -9
- package/dist/es2019/plugins/hyperlink/index.js +66 -62
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -3
- package/dist/es2019/plugins/index.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/es2019/plugins/list/commands/index.js +4 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +2 -4
- package/dist/es2019/plugins/list/index.js +80 -77
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +52 -0
- package/dist/es2019/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/list/pm-plugins/main.js +46 -46
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +4 -1
- package/dist/es2019/plugins/media/nodeviews/styles.js +12 -1
- package/dist/es2019/plugins/media/toolbar/commands.js +93 -0
- package/dist/es2019/plugins/media/toolbar/imageBorder.js +15 -0
- package/dist/es2019/plugins/media/toolbar/index.js +36 -5
- package/dist/es2019/plugins/media/ui/ImageBorder/index.js +206 -0
- package/dist/es2019/plugins/media/ui/ImageBorder/messages.js +43 -0
- package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +124 -0
- package/dist/es2019/plugins/media/utils/current-media-node.js +22 -3
- package/dist/es2019/plugins/paste/util/index.js +2 -0
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +7 -0
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +59 -55
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/es2019/plugins/type-ahead/index.js +4 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +4 -2
- package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +4 -2
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +41 -4
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -0
- package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
- package/dist/es2019/plugins/type-ahead/utils.js +22 -2
- package/dist/es2019/test-utils.js +3 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/es2019/ui/styles.js +1 -0
- package/dist/es2019/utils/input-rules.js +0 -17
- package/dist/es2019/utils/insert.js +61 -10
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +7 -2
- package/dist/esm/create-editor/feature-flags-from-props.js +31 -26
- package/dist/esm/create-editor/sort-by-order.js +11 -0
- package/dist/esm/editor-next/editor-migration-component.js +3 -0
- package/dist/esm/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/esm/labs/next/full-page.js +2 -1
- package/dist/esm/labs/next/presets/default.js +2 -1
- package/dist/esm/labs/next/presets/universal.js +8 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -5
- package/dist/esm/plugins/analytics/plugin.js +6 -6
- package/dist/esm/plugins/avatar-group/index.js +5 -2
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/esm/plugins/base/index.js +4 -2
- package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
- package/dist/esm/plugins/border/index.js +13 -0
- package/dist/esm/plugins/card/index.js +4 -2
- package/dist/esm/plugins/card/toolbar.js +12 -15
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/esm/plugins/code-block/toolbar.js +2 -2
- package/dist/esm/plugins/collab-edit/analytics.js +2 -3
- package/dist/esm/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/esm/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/esm/plugins/collab-edit/index.js +5 -3
- package/dist/esm/plugins/collab-edit/plugin.js +4 -3
- package/dist/esm/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/esm/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/esm/plugins/date/index.js +90 -64
- package/dist/esm/plugins/editor-disabled/index.js +8 -0
- package/dist/esm/plugins/expand/index.js +4 -1
- package/dist/esm/plugins/expand/nodeviews/index.js +6 -7
- package/dist/esm/plugins/expand/pm-plugins/main.js +5 -2
- package/dist/esm/plugins/extension/extension-api.js +24 -12
- package/dist/esm/plugins/extension/pm-plugins/main.js +113 -173
- package/dist/esm/plugins/extension/pm-plugins/utils.js +72 -0
- package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -10
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/floating-toolbar/index.js +15 -7
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/esm/plugins/hyperlink/Toolbar.js +9 -13
- package/dist/esm/plugins/hyperlink/index.js +6 -2
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
- package/dist/esm/plugins/index.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/esm/plugins/list/commands/index.js +31 -27
- package/dist/esm/plugins/list/commands/outdent-list.js +2 -3
- package/dist/esm/plugins/list/index.js +4 -3
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +51 -0
- package/dist/esm/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/list/pm-plugins/main.js +23 -21
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
- package/dist/esm/plugins/media/nodeviews/styles.js +13 -1
- package/dist/esm/plugins/media/toolbar/commands.js +99 -0
- package/dist/esm/plugins/media/toolbar/imageBorder.js +14 -0
- package/dist/esm/plugins/media/toolbar/index.js +34 -5
- package/dist/esm/plugins/media/ui/ImageBorder/index.js +211 -0
- package/dist/esm/plugins/media/ui/ImageBorder/messages.js +43 -0
- package/dist/esm/plugins/media/ui/ImageBorder/styles.js +37 -0
- package/dist/esm/plugins/media/utils/current-media-node.js +24 -3
- package/dist/esm/plugins/paste/util/index.js +2 -0
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +5 -0
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +3 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/esm/plugins/type-ahead/index.js +4 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +4 -2
- package/dist/esm/plugins/type-ahead/pm-plugins/main.js +4 -2
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +41 -4
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -0
- package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
- package/dist/esm/plugins/type-ahead/utils.js +22 -2
- package/dist/esm/test-utils.js +3 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/esm/ui/styles.js +1 -1
- package/dist/esm/utils/input-rules.js +0 -17
- package/dist/esm/utils/insert.js +56 -10
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/sort-by-order.d.ts +9 -0
- package/dist/types/editor-next/editor-migration-component.d.ts +1 -0
- package/dist/types/labs/next/presets/cxhtml.d.ts +36 -2
- package/dist/types/labs/next/presets/default.d.ts +72 -4
- package/dist/types/labs/next/presets/mobile.d.ts +36 -2
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -1
- package/dist/types/plugins/analytics/plugin.d.ts +2 -0
- package/dist/types/plugins/avatar-group/index.d.ts +2 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -0
- package/dist/types/plugins/base/index.d.ts +2 -0
- package/dist/types/plugins/base/pm-plugins/disable-spell-checking.d.ts +2 -1
- package/dist/types/plugins/border/index.d.ts +3 -0
- package/dist/types/plugins/card/index.d.ts +2 -0
- package/dist/types/plugins/card/toolbar.d.ts +2 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +5 -2
- package/dist/types/plugins/collab-edit/analytics.d.ts +2 -1
- package/dist/types/plugins/collab-edit/events/handlers.d.ts +2 -1
- package/dist/types/plugins/collab-edit/events/initialize.d.ts +3 -1
- package/dist/types/plugins/collab-edit/index.d.ts +2 -0
- package/dist/types/plugins/collab-edit/plugin.d.ts +2 -1
- package/dist/types/plugins/collab-edit/ui/avatars-with-plugin-state.d.ts +4 -0
- package/dist/types/plugins/collab-edit/ui/avatars.d.ts +2 -0
- package/dist/types/plugins/date/index.d.ts +9 -1
- package/dist/types/plugins/editor-disabled/index.d.ts +3 -1
- package/dist/types/plugins/expand/index.d.ts +2 -0
- package/dist/types/plugins/expand/nodeviews/index.d.ts +5 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +8 -2
- package/dist/types/plugins/extension/pm-plugins/utils.d.ts +3 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -7
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +2 -0
- package/dist/types/plugins/find-replace/index.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/index.d.ts +4 -1
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +2 -0
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types/plugins/hyperlink/index.d.ts +2 -0
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +1 -0
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -1
- package/dist/types/plugins/list/commands/index.d.ts +3 -2
- package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types/plugins/list/index.d.ts +2 -0
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +1 -1
- package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +13 -0
- package/dist/types/plugins/list/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/list/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugins/media/nodeviews/styles.d.ts +3 -1
- package/dist/types/plugins/media/toolbar/commands.d.ts +5 -0
- package/dist/types/plugins/media/toolbar/imageBorder.d.ts +2 -0
- package/dist/types/plugins/media/types.d.ts +3 -0
- package/dist/types/plugins/media/ui/ImageBorder/index.d.ts +13 -0
- package/dist/types/plugins/media/ui/ImageBorder/messages.d.ts +42 -0
- package/dist/types/plugins/media/ui/ImageBorder/styles.d.ts +15 -0
- package/dist/types/plugins/media/utils/current-media-node.d.ts +6 -0
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -1
- package/dist/types/plugins/type-ahead/index.d.ts +1 -0
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +2 -1
- package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +1 -0
- package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +2 -1
- package/dist/types/test-utils.d.ts +4 -2
- package/dist/types/types/editor-props.d.ts +5 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +13 -12
- package/report.api.md +12 -4
- package/codemods/__tests__/rename-experimental-text-color-prop.ts +0 -204
- package/codemods/migrates/rename-experimental-text-color-prop.ts +0 -6
|
@@ -7,60 +7,64 @@ import { pluginKey as indentationButtonsPluginKey, createPlugin as indentationBu
|
|
|
7
7
|
const toolbarListsIndentationPlugin = ({
|
|
8
8
|
showIndentationButtons,
|
|
9
9
|
allowHeadingAndParagraphIndentation
|
|
10
|
-
}) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
10
|
+
}, api) => {
|
|
11
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
|
|
12
|
+
return {
|
|
13
|
+
name: 'toolbarListsIndentation',
|
|
14
|
+
pmPlugins() {
|
|
15
|
+
return [{
|
|
16
|
+
name: 'indentationButtons',
|
|
17
|
+
plugin: ({
|
|
18
|
+
dispatch
|
|
19
|
+
}) => indentationButtonsPlugin({
|
|
20
|
+
dispatch,
|
|
21
|
+
showIndentationButtons,
|
|
22
|
+
allowHeadingAndParagraphIndentation
|
|
23
|
+
})
|
|
24
|
+
}];
|
|
25
|
+
},
|
|
26
|
+
primaryToolbarComponent({
|
|
27
|
+
editorView,
|
|
28
|
+
popupsMountPoint,
|
|
29
|
+
popupsBoundariesElement,
|
|
30
|
+
popupsScrollableElement,
|
|
31
|
+
toolbarSize,
|
|
32
|
+
disabled,
|
|
33
|
+
isToolbarReducedSpacing
|
|
34
|
+
}) {
|
|
35
|
+
const isSmall = toolbarSize < ToolbarSize.L;
|
|
36
|
+
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
37
|
+
plugins: {
|
|
38
|
+
listState: listPluginKey,
|
|
39
|
+
indentationState: indentationButtonsPluginKey
|
|
40
|
+
},
|
|
41
|
+
render: ({
|
|
42
|
+
listState,
|
|
43
|
+
indentationState
|
|
44
|
+
}) => {
|
|
45
|
+
if (!listState) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return /*#__PURE__*/React.createElement(ToolbarListsIndentation, {
|
|
49
|
+
featureFlags: featureFlags,
|
|
50
|
+
isSmall: isSmall,
|
|
51
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
editorView: editorView,
|
|
54
|
+
popupsMountPoint: popupsMountPoint,
|
|
55
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
56
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
57
|
+
bulletListActive: listState.bulletListActive,
|
|
58
|
+
bulletListDisabled: listState.bulletListDisabled,
|
|
59
|
+
orderedListActive: listState.orderedListActive,
|
|
60
|
+
orderedListDisabled: listState.orderedListDisabled,
|
|
61
|
+
showIndentationButtons: !!showIndentationButtons,
|
|
62
|
+
indentDisabled: indentationState.indentDisabled,
|
|
63
|
+
outdentDisabled: indentationState.outdentDisabled
|
|
64
|
+
});
|
|
45
65
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
editorView: editorView,
|
|
51
|
-
popupsMountPoint: popupsMountPoint,
|
|
52
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
53
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
54
|
-
bulletListActive: listState.bulletListActive,
|
|
55
|
-
bulletListDisabled: listState.bulletListDisabled,
|
|
56
|
-
orderedListActive: listState.orderedListActive,
|
|
57
|
-
orderedListDisabled: listState.orderedListDisabled,
|
|
58
|
-
showIndentationButtons: !!showIndentationButtons,
|
|
59
|
-
indentDisabled: indentationState.indentDisabled,
|
|
60
|
-
outdentDisabled: indentationState.outdentDisabled
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
66
70
|
export default toolbarListsIndentationPlugin;
|
|
@@ -38,7 +38,8 @@ export function Toolbar(props) {
|
|
|
38
38
|
const isOutdentButtonFocused = document.activeElement === outdentButtonRef.current;
|
|
39
39
|
const handleOnItemActivated = buttonName => event => onItemActivated({
|
|
40
40
|
editorView: props.editorView,
|
|
41
|
-
buttonName
|
|
41
|
+
buttonName,
|
|
42
|
+
featureFlags: props.featureFlags
|
|
42
43
|
});
|
|
43
44
|
useEffect(() => {
|
|
44
45
|
if (isIndentButtonFocused && indentDisabled && outdentButtonRef.current) {
|
|
@@ -50,7 +50,8 @@ export function ToolbarDropdown(props) {
|
|
|
50
50
|
setIsDropdownOpen(!shouldCloseMenu);
|
|
51
51
|
return onItemActivated({
|
|
52
52
|
editorView: props.editorView,
|
|
53
|
-
buttonName: item.value.name
|
|
53
|
+
buttonName: item.value.name,
|
|
54
|
+
featureFlags: props.featureFlags
|
|
54
55
|
});
|
|
55
56
|
};
|
|
56
57
|
return jsx("span", {
|
|
@@ -17,7 +17,8 @@ export default function ToolbarListsIndentation(props) {
|
|
|
17
17
|
popupsBoundariesElement,
|
|
18
18
|
popupsScrollableElement,
|
|
19
19
|
indentDisabled,
|
|
20
|
-
outdentDisabled
|
|
20
|
+
outdentDisabled,
|
|
21
|
+
featureFlags
|
|
21
22
|
} = props;
|
|
22
23
|
if (isSmall) {
|
|
23
24
|
return jsx(ToolbarDropdown, {
|
|
@@ -34,7 +35,8 @@ export default function ToolbarListsIndentation(props) {
|
|
|
34
35
|
indentDisabled: indentDisabled,
|
|
35
36
|
outdentDisabled: outdentDisabled,
|
|
36
37
|
disabled: disabled,
|
|
37
|
-
onItemActivated: onItemActivated
|
|
38
|
+
onItemActivated: onItemActivated,
|
|
39
|
+
featureFlags: featureFlags
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
42
|
return jsx(Toolbar, {
|
|
@@ -48,6 +50,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
48
50
|
indentDisabled: indentDisabled,
|
|
49
51
|
outdentDisabled: outdentDisabled,
|
|
50
52
|
disabled: disabled,
|
|
51
|
-
onItemActivated: onItemActivated
|
|
53
|
+
onItemActivated: onItemActivated,
|
|
54
|
+
featureFlags: featureFlags
|
|
52
55
|
});
|
|
53
56
|
}
|
|
@@ -5,7 +5,8 @@ import { INPUT_METHOD } from '../../analytics';
|
|
|
5
5
|
import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentation-buttons';
|
|
6
6
|
export function onItemActivated({
|
|
7
7
|
buttonName,
|
|
8
|
-
editorView
|
|
8
|
+
editorView,
|
|
9
|
+
featureFlags
|
|
9
10
|
}) {
|
|
10
11
|
switch (buttonName) {
|
|
11
12
|
case 'bullet_list':
|
|
@@ -35,7 +36,7 @@ export function onItemActivated({
|
|
|
35
36
|
outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
36
37
|
}
|
|
37
38
|
if (node === 'list') {
|
|
38
|
-
outdentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
39
|
+
outdentList(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
|
|
39
40
|
}
|
|
40
41
|
if (node === 'taskList') {
|
|
41
42
|
outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
@@ -111,6 +111,8 @@ const TypeAheadMenu = /*#__PURE__*/React.memo(({
|
|
|
111
111
|
*
|
|
112
112
|
*/
|
|
113
113
|
const typeAheadPlugin = options => {
|
|
114
|
+
var _options$useBetterTyp;
|
|
115
|
+
const useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
|
|
114
116
|
const fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
115
117
|
const popupMountRef = {
|
|
116
118
|
current: null
|
|
@@ -136,7 +138,8 @@ const typeAheadPlugin = options => {
|
|
|
136
138
|
popupMountRef,
|
|
137
139
|
reactDispatch: dispatch,
|
|
138
140
|
typeAheadHandlers: typeAhead,
|
|
139
|
-
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
|
|
141
|
+
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
|
|
142
|
+
useBetterTypeaheadNavigation
|
|
140
143
|
})
|
|
141
144
|
}, {
|
|
142
145
|
name: 'typeAheadInsertItem',
|
|
@@ -15,7 +15,8 @@ import { closeTypeAhead } from '../transforms/close-type-ahead';
|
|
|
15
15
|
export const factoryDecorations = ({
|
|
16
16
|
intl,
|
|
17
17
|
popupMountRef,
|
|
18
|
-
createAnalyticsEvent
|
|
18
|
+
createAnalyticsEvent,
|
|
19
|
+
useBetterTypeaheadNavigation
|
|
19
20
|
}) => {
|
|
20
21
|
const createDecorations = (tr, {
|
|
21
22
|
triggerHandler,
|
|
@@ -93,7 +94,8 @@ export const factoryDecorations = ({
|
|
|
93
94
|
popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
|
|
94
95
|
popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
|
|
95
96
|
onUndoRedo: onUndoRedo,
|
|
96
|
-
reopenQuery: reopenQuery
|
|
97
|
+
reopenQuery: reopenQuery,
|
|
98
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
97
99
|
})), typeaheadComponent);
|
|
98
100
|
shouldFocusCursorInsideQuery = false;
|
|
99
101
|
return typeaheadComponent;
|
|
@@ -23,7 +23,8 @@ export function createPlugin({
|
|
|
23
23
|
popupMountRef,
|
|
24
24
|
createAnalyticsEvent,
|
|
25
25
|
typeAheadHandlers,
|
|
26
|
-
getIntl
|
|
26
|
+
getIntl,
|
|
27
|
+
useBetterTypeaheadNavigation
|
|
27
28
|
}) {
|
|
28
29
|
const intl = getIntl();
|
|
29
30
|
const {
|
|
@@ -32,7 +33,8 @@ export function createPlugin({
|
|
|
32
33
|
} = factoryDecorations({
|
|
33
34
|
intl,
|
|
34
35
|
popupMountRef,
|
|
35
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
36
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
37
|
+
useBetterTypeaheadNavigation
|
|
36
38
|
});
|
|
37
39
|
const reducer = createReducer({
|
|
38
40
|
createDecorations,
|
|
@@ -65,7 +65,8 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
65
65
|
onQueryFocus,
|
|
66
66
|
onUndoRedo,
|
|
67
67
|
editorView,
|
|
68
|
-
items
|
|
68
|
+
items,
|
|
69
|
+
useBetterTypeaheadNavigation
|
|
69
70
|
}) => {
|
|
70
71
|
const ref = useRef(document.createElement('span'));
|
|
71
72
|
const inputRef = useRef(null);
|
|
@@ -134,6 +135,19 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
134
135
|
// Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
|
|
135
136
|
if (!event.isComposing || event.which !== 229 && event.keyCode !== 229) {
|
|
136
137
|
if (selectedIndex === -1) {
|
|
138
|
+
if (useBetterTypeaheadNavigation) {
|
|
139
|
+
/**
|
|
140
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
141
|
+
* here, either
|
|
142
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
143
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
144
|
+
* focus changes,
|
|
145
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
146
|
+
*
|
|
147
|
+
* The focus behaviour still needs cleanup
|
|
148
|
+
*/
|
|
149
|
+
selectPreviousItem();
|
|
150
|
+
}
|
|
137
151
|
selectNextItem();
|
|
138
152
|
}
|
|
139
153
|
onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
|
|
@@ -141,18 +155,41 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
141
155
|
break;
|
|
142
156
|
case 'Tab':
|
|
143
157
|
if (selectedIndex === -1) {
|
|
158
|
+
if (useBetterTypeaheadNavigation) {
|
|
159
|
+
/**
|
|
160
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
161
|
+
* here, either
|
|
162
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
163
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
164
|
+
* focus changes,
|
|
165
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
166
|
+
*
|
|
167
|
+
*/
|
|
168
|
+
selectPreviousItem();
|
|
169
|
+
}
|
|
144
170
|
selectNextItem();
|
|
145
171
|
}
|
|
172
|
+
// TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
|
|
146
173
|
onItemSelect(SelectItemMode.TAB);
|
|
147
174
|
break;
|
|
148
175
|
case 'ArrowDown':
|
|
149
|
-
if (
|
|
176
|
+
if (useBetterTypeaheadNavigation) {
|
|
150
177
|
selectNextItem();
|
|
178
|
+
} else {
|
|
179
|
+
// TODO DTR-1401: why were we preventing selection?
|
|
180
|
+
if (selectedIndex === -1) {
|
|
181
|
+
selectNextItem();
|
|
182
|
+
}
|
|
151
183
|
}
|
|
152
184
|
break;
|
|
153
185
|
case 'ArrowUp':
|
|
154
|
-
if (
|
|
186
|
+
if (useBetterTypeaheadNavigation) {
|
|
155
187
|
selectPreviousItem();
|
|
188
|
+
} else {
|
|
189
|
+
// TODO DTR-1401: why were we preventing selection?
|
|
190
|
+
if (selectedIndex === -1) {
|
|
191
|
+
selectPreviousItem();
|
|
192
|
+
}
|
|
156
193
|
}
|
|
157
194
|
break;
|
|
158
195
|
}
|
|
@@ -165,7 +202,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
165
202
|
event.preventDefault();
|
|
166
203
|
return false;
|
|
167
204
|
}
|
|
168
|
-
}, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
205
|
+
}, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
169
206
|
const onClick = useCallback(event => {
|
|
170
207
|
var _inputRef$current;
|
|
171
208
|
event.stopPropagation();
|
|
@@ -166,6 +166,8 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
166
166
|
selectPreviousItem();
|
|
167
167
|
event.preventDefault();
|
|
168
168
|
break;
|
|
169
|
+
|
|
170
|
+
// TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
|
|
169
171
|
case 'Tab':
|
|
170
172
|
//Tab key quick inserts the selected item.
|
|
171
173
|
onItemClick(SelectItemMode.TAB, selectedIndex);
|
|
@@ -18,7 +18,8 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
|
|
|
18
18
|
inputMethod,
|
|
19
19
|
getDecorationPosition,
|
|
20
20
|
reopenQuery,
|
|
21
|
-
onUndoRedo
|
|
21
|
+
onUndoRedo,
|
|
22
|
+
useBetterTypeaheadNavigation
|
|
22
23
|
}) => {
|
|
23
24
|
const [closed, setClosed] = useState(false);
|
|
24
25
|
const [query, setQuery] = useState(reopenQuery || '');
|
|
@@ -31,12 +32,14 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
|
|
|
31
32
|
const [onItemInsert, onTextInsert] = useItemInsert(triggerHandler, editorView, items);
|
|
32
33
|
const selectNextItem = useMemo(() => moveSelectedIndex({
|
|
33
34
|
editorView,
|
|
34
|
-
direction: 'next'
|
|
35
|
-
|
|
35
|
+
direction: 'next',
|
|
36
|
+
useBetterTypeaheadNavigation
|
|
37
|
+
}), [editorView, useBetterTypeaheadNavigation]);
|
|
36
38
|
const selectPreviousItem = useMemo(() => moveSelectedIndex({
|
|
37
39
|
editorView,
|
|
38
|
-
direction: 'previous'
|
|
39
|
-
|
|
40
|
+
direction: 'previous',
|
|
41
|
+
useBetterTypeaheadNavigation
|
|
42
|
+
}), [editorView, useBetterTypeaheadNavigation]);
|
|
40
43
|
const cancel = useCallback(({
|
|
41
44
|
setSelectionAt,
|
|
42
45
|
addPrefixTrigger,
|
|
@@ -92,6 +95,7 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
|
|
|
92
95
|
return null;
|
|
93
96
|
}
|
|
94
97
|
return /*#__PURE__*/React.createElement(InputQuery, {
|
|
98
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
|
|
95
99
|
triggerQueryPrefix: triggerHandler.trigger,
|
|
96
100
|
onQueryChange: setQuery,
|
|
97
101
|
onItemSelect: insertSelectedItem,
|
|
@@ -52,7 +52,8 @@ export const findHandlerByTrigger = ({
|
|
|
52
52
|
};
|
|
53
53
|
export const moveSelectedIndex = ({
|
|
54
54
|
editorView,
|
|
55
|
-
direction
|
|
55
|
+
direction,
|
|
56
|
+
useBetterTypeaheadNavigation
|
|
56
57
|
}) => () => {
|
|
57
58
|
const typeAheadState = getPluginState(editorView.state);
|
|
58
59
|
if (!typeAheadState) {
|
|
@@ -66,7 +67,26 @@ export const moveSelectedIndex = ({
|
|
|
66
67
|
let nextIndex;
|
|
67
68
|
if (direction === 'next') {
|
|
68
69
|
stats.increaseArrowDown();
|
|
69
|
-
|
|
70
|
+
if (useBetterTypeaheadNavigation) {
|
|
71
|
+
/**
|
|
72
|
+
* See: https://product-fabric.atlassian.net/browse/ED-17200
|
|
73
|
+
* `selectedIndex` is forced to -1 now to not immediately focus the typeahead
|
|
74
|
+
* and only do so when there is explicit logic to focus into the typeahead
|
|
75
|
+
* options.
|
|
76
|
+
*
|
|
77
|
+
* This check for "set index to 1 when -1"
|
|
78
|
+
* - is a temporary workaround to get back the previous behaviour without
|
|
79
|
+
* entirely reverting the a11y improvements
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
if (selectedIndex === -1 && items.length > 1) {
|
|
83
|
+
nextIndex = 1;
|
|
84
|
+
} else {
|
|
85
|
+
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
89
|
+
}
|
|
70
90
|
} else {
|
|
71
91
|
stats.increaseArrowUp();
|
|
72
92
|
nextIndex = selectedIndex <= 0 ? items.length - 1 : selectedIndex - 1;
|
|
@@ -52,7 +52,9 @@ function lightProcessPluginsList(editorPlugins) {
|
|
|
52
52
|
export const createPMSchemaAndPlugins = (inputPreset = new EditorPresetBuilder()) => pluginFactoryParams => {
|
|
53
53
|
let editorPlugins = [];
|
|
54
54
|
const preset = inputPreset.has(basePlugin) ? inputPreset : inputPreset.add(basePlugin);
|
|
55
|
-
editorPlugins = preset.build(
|
|
55
|
+
editorPlugins = preset.build({
|
|
56
|
+
pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
|
|
57
|
+
});
|
|
56
58
|
const editorConfig = lightProcessPluginsList(editorPlugins);
|
|
57
59
|
const schema = createSchema(editorConfig);
|
|
58
60
|
const plugins = editorConfig.plugins.sort(sortByOrder('plugins')).map(({
|
|
@@ -42,14 +42,16 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
42
42
|
eventDispatcher: props.eventDispatcher,
|
|
43
43
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
44
44
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
45
|
-
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
|
|
45
|
+
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
46
|
+
featureFlags: props.featureFlags || {}
|
|
46
47
|
}), (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.findReplace && (_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar ? jsx(FindReplaceToolbarButtonWithState, {
|
|
47
48
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
48
49
|
popupsMountPoint: props.popupsMountPoint,
|
|
49
50
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
50
51
|
editorView: props.editorView,
|
|
51
52
|
containerElement: props.containerElement,
|
|
52
|
-
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
|
|
53
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
54
|
+
featureFlags: props.featureFlags
|
|
53
55
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
54
56
|
useEffect(() => {
|
|
55
57
|
var _props$featureFlags7;
|
package/dist/es2019/ui/styles.js
CHANGED
|
@@ -5,8 +5,6 @@ import { createInputRulePlugin } from '@atlaskit/prosemirror-input-rules';
|
|
|
5
5
|
import { addAnalytics } from '../plugins/analytics';
|
|
6
6
|
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import { closeHistory } from 'prosemirror-history';
|
|
8
|
-
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
9
|
-
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
10
8
|
export const ruleWithAnalytics = getPayload => {
|
|
11
9
|
return originalRule => {
|
|
12
10
|
const onHandlerApply = (state, tr, matchResult) => {
|
|
@@ -98,21 +96,6 @@ export const createWrappingJoinRule = ({
|
|
|
98
96
|
tr.setNodeMarkup(parentNodePosMapped, parentNode.type, parentNode.attrs, allowedMarks);
|
|
99
97
|
}
|
|
100
98
|
tr.wrap(range, wrapping);
|
|
101
|
-
const featureFlags = getFeatureFlags(state);
|
|
102
|
-
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && nodeType === state.schema.nodes.orderedList) {
|
|
103
|
-
// if an orderedList node would be inserted by the input rule match, and
|
|
104
|
-
// that orderedList node is being added directly before another orderedList
|
|
105
|
-
// node, then join those nodes
|
|
106
|
-
const $end = tr.doc.resolve(tr.mapping.map(end));
|
|
107
|
-
const node = findParentNodeOfTypeClosestToPos($end, nodeType);
|
|
108
|
-
if (node) {
|
|
109
|
-
const nodeEnd = node.pos + node.node.nodeSize;
|
|
110
|
-
const after = tr.doc.resolve(nodeEnd).nodeAfter;
|
|
111
|
-
if (after && after.type === nodeType && canJoin(tr.doc, nodeEnd) && (!joinPredicate || joinPredicate(match, after, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_BELOW))) {
|
|
112
|
-
tr.join(nodeEnd);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
99
|
const before = tr.doc.resolve(fixedStart - 1).nodeBefore;
|
|
117
100
|
if (before && before.type === nodeType && canJoin(tr.doc, fixedStart - 1) && (!joinPredicate || joinPredicate(match, before, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_ABOVE))) {
|
|
118
101
|
tr.join(fixedStart - 1);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { isNodeSelection, canInsert,
|
|
2
|
-
import { Node, Fragment } from 'prosemirror-model';
|
|
3
|
-
import { NodeSelection, Selection } from 'prosemirror-state';
|
|
1
|
+
import { isNodeSelection, canInsert, safeInsert as pmSafeInsert, hasParentNodeOfType, findParentNodeOfType } from 'prosemirror-utils';
|
|
2
|
+
import { Node, Fragment, Slice } from 'prosemirror-model';
|
|
3
|
+
import { NodeSelection, Selection, TextSelection } from 'prosemirror-state';
|
|
4
4
|
import { ReplaceStep, ReplaceAroundStep } from 'prosemirror-transform';
|
|
5
5
|
import { isEmptyParagraph } from './document';
|
|
6
6
|
import { GapCursorSelection, Side } from '../plugins/selection/gap-cursor-selection';
|
|
7
7
|
import { normaliseNestedLayout } from './selection';
|
|
8
|
+
import { isListItemNode } from '../plugins/list/utils/node';
|
|
8
9
|
export let LookDirection;
|
|
9
10
|
(function (LookDirection) {
|
|
10
11
|
LookDirection["Before"] = "before";
|
|
@@ -18,6 +19,22 @@ const nodeIsInsideAList = tr => {
|
|
|
18
19
|
} = tr.doc.type.schema;
|
|
19
20
|
return hasParentNodeOfType([nodes.orderedList, nodes.bulletList])(tr.selection);
|
|
20
21
|
};
|
|
22
|
+
const selectionIsInsideAPanel = tr => {
|
|
23
|
+
const {
|
|
24
|
+
nodes
|
|
25
|
+
} = tr.doc.type.schema;
|
|
26
|
+
return hasParentNodeOfType(nodes.panel)(tr.selection);
|
|
27
|
+
};
|
|
28
|
+
const selectionIsInNestedList = tr => {
|
|
29
|
+
const {
|
|
30
|
+
nodes
|
|
31
|
+
} = tr.doc.type.schema;
|
|
32
|
+
const parentListNode = findParentNodeOfType([nodes.orderedList, nodes.bulletList])(tr.selection);
|
|
33
|
+
if (!parentListNode) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return isListItemNode(tr.doc.resolve(parentListNode.pos).parent);
|
|
37
|
+
};
|
|
21
38
|
const insertBeforeOrAfter = (tr, lookDirection, $parentPos, $proposedPosition, content) => {
|
|
22
39
|
/**
|
|
23
40
|
* This block caters for the first item in a parent with the cursor being at the very start
|
|
@@ -46,9 +63,7 @@ export const safeInsert = (content, position) => tr => {
|
|
|
46
63
|
nodes
|
|
47
64
|
} = tr.doc.type.schema;
|
|
48
65
|
const whitelist = [nodes.rule, nodes.mediaSingle];
|
|
49
|
-
|
|
50
|
-
// fallback if the node to insert is not in the whitelist, or if the insertion should happen within a list.
|
|
51
|
-
if (content instanceof Fragment || !whitelist.includes(content.type) || nodeIsInsideAList(tr)) {
|
|
66
|
+
if (content instanceof Fragment || !whitelist.includes(content.type)) {
|
|
52
67
|
return null;
|
|
53
68
|
}
|
|
54
69
|
|
|
@@ -82,14 +97,29 @@ export const safeInsert = (content, position) => tr => {
|
|
|
82
97
|
}
|
|
83
98
|
const grandParentNodeType = (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type;
|
|
84
99
|
const parentNodeType = tr.selection.$from.parent.type;
|
|
85
|
-
|
|
100
|
+
|
|
101
|
+
// if there is no direction, and cannot split for this particular node
|
|
102
|
+
const noDirectionAndShouldNotSplit = !lookDirection && !shouldSplitSelectedNodeOnNodeInsertion({
|
|
86
103
|
parentNodeType,
|
|
87
104
|
grandParentNodeType,
|
|
88
105
|
content
|
|
89
|
-
})
|
|
106
|
+
});
|
|
107
|
+
const ruleNodeInANestedListNode = content.type === nodes.rule && selectionIsInNestedList(tr);
|
|
108
|
+
const nonRuleNodeInListNode = !(content.type === nodes.rule) && nodeIsInsideAList(tr);
|
|
109
|
+
if (ruleNodeInANestedListNode || noDirectionAndShouldNotSplit && nonRuleNodeInListNode || noDirectionAndShouldNotSplit && !nodeIsInsideAList(tr)) {
|
|
90
110
|
// node to be inserted is an invalid child of selection so insert below selected node
|
|
91
111
|
return pmSafeInsert(content, tr.selection.from)(tr);
|
|
92
112
|
}
|
|
113
|
+
|
|
114
|
+
// if node is a rule and that is a flat list splitting and not at the end of a list
|
|
115
|
+
const {
|
|
116
|
+
from,
|
|
117
|
+
to
|
|
118
|
+
} = tr.selection;
|
|
119
|
+
const ruleTypeInAList = content.type === nodes.rule && nodeIsInsideAList(tr);
|
|
120
|
+
if (ruleTypeInAList && !($insertPos.pos === insertPosEnd)) {
|
|
121
|
+
return tr.replaceRange(from, to, new Slice(Fragment.from(nodes.rule.createChecked()), 0, 0));
|
|
122
|
+
}
|
|
93
123
|
if (!lookDirection) {
|
|
94
124
|
// fallback to consumer for now
|
|
95
125
|
return null;
|
|
@@ -111,7 +141,14 @@ export const safeInsert = (content, position) => tr => {
|
|
|
111
141
|
|
|
112
142
|
// If we can't insert, and we think we should split, we fallback to consumer for now
|
|
113
143
|
if (shouldSplit(parentNode.type, tr.doc.type.schema.nodes)) {
|
|
114
|
-
|
|
144
|
+
const nextTr = finaliseInsert(insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content), content.nodeSize);
|
|
145
|
+
|
|
146
|
+
// Move selection to the closest text node, otherwise it defaults to the whatever the lookDirection is set to above
|
|
147
|
+
if ([nodes.orderedList, nodes.bulletList].includes(parentNode.type) && nextTr) {
|
|
148
|
+
return nextTr.setSelection(TextSelection.between(nextTr.selection.$from, nextTr.selection.$from));
|
|
149
|
+
} else {
|
|
150
|
+
return nextTr;
|
|
151
|
+
}
|
|
115
152
|
}
|
|
116
153
|
|
|
117
154
|
// Can not insert into current parent, step up one parent
|
|
@@ -155,7 +192,21 @@ export const insertSelectedItem = (maybeNode, opts = {}) => (state, tr, start) =
|
|
|
155
192
|
*
|
|
156
193
|
*/
|
|
157
194
|
} else if (node.isBlock) {
|
|
158
|
-
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
* Rule has unique insertion behaviour
|
|
198
|
+
* so using this safeInsert function in order to handle specific cases in flat list vs nested list
|
|
199
|
+
* instead of a generic pmSafeInsert (i.e appending at the end)
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
const selectionInsideAPanel = selectionIsInsideAPanel(tr);
|
|
204
|
+
if (node.type.name === 'rule' && !selectionInsideAPanel) {
|
|
205
|
+
var _safeInsert;
|
|
206
|
+
tr = (_safeInsert = safeInsert(node, tr.selection.from)(tr)) !== null && _safeInsert !== void 0 ? _safeInsert : tr;
|
|
207
|
+
} else {
|
|
208
|
+
tr = pmSafeInsert(normaliseNestedLayout(state, node), undefined, true)(tr);
|
|
209
|
+
}
|
|
159
210
|
|
|
160
211
|
/**
|
|
161
212
|
*
|
package/dist/es2019/version.json
CHANGED
|
@@ -34,16 +34,21 @@ export function getScrollGutterOptions(props) {
|
|
|
34
34
|
return undefined;
|
|
35
35
|
}
|
|
36
36
|
export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
37
|
-
var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
|
|
37
|
+
var _props$performanceTra, _props$linking, _ref, _props$featureFlags$u, _props$featureFlags, _props$featureFlags2, _props$performanceTra2, _props$textFormatting, _props$linking2;
|
|
38
38
|
var appearance = props.appearance;
|
|
39
39
|
var isMobile = appearance === 'mobile';
|
|
40
40
|
var inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
|
|
41
41
|
var cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
|
|
42
|
+
|
|
43
|
+
// duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
|
|
44
|
+
var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
|
|
45
|
+
var useBetterTypeaheadNavigation = Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true);
|
|
42
46
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
43
47
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
44
48
|
typeAhead: {
|
|
45
49
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
46
|
-
isMobile: isMobile
|
|
50
|
+
isMobile: isMobile,
|
|
51
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
47
52
|
},
|
|
48
53
|
featureFlags: createFeatureFlagsFromProps(props),
|
|
49
54
|
paste: {
|