@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
|
@@ -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(_ref) {
|
|
7
7
|
var buttonName = _ref.buttonName,
|
|
8
|
-
editorView = _ref.editorView
|
|
8
|
+
editorView = _ref.editorView,
|
|
9
|
+
featureFlags = _ref.featureFlags;
|
|
9
10
|
switch (buttonName) {
|
|
10
11
|
case 'bullet_list':
|
|
11
12
|
toggleBulletList(editorView, INPUT_METHOD.TOOLBAR);
|
|
@@ -34,7 +35,7 @@ export function onItemActivated(_ref) {
|
|
|
34
35
|
outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
35
36
|
}
|
|
36
37
|
if (_node === 'list') {
|
|
37
|
-
outdentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
38
|
+
outdentList(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
|
|
38
39
|
}
|
|
39
40
|
if (_node === 'taskList') {
|
|
40
41
|
outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
@@ -113,6 +113,8 @@ var TypeAheadMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
113
113
|
*
|
|
114
114
|
*/
|
|
115
115
|
var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
116
|
+
var _options$useBetterTyp;
|
|
117
|
+
var useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
|
|
116
118
|
var fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
117
119
|
var popupMountRef = {
|
|
118
120
|
current: null
|
|
@@ -139,7 +141,8 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
139
141
|
popupMountRef: popupMountRef,
|
|
140
142
|
reactDispatch: dispatch,
|
|
141
143
|
typeAheadHandlers: typeAhead,
|
|
142
|
-
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
|
|
144
|
+
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
|
|
145
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
143
146
|
});
|
|
144
147
|
}
|
|
145
148
|
}, {
|
|
@@ -15,7 +15,8 @@ import { closeTypeAhead } from '../transforms/close-type-ahead';
|
|
|
15
15
|
export var factoryDecorations = function factoryDecorations(_ref) {
|
|
16
16
|
var intl = _ref.intl,
|
|
17
17
|
popupMountRef = _ref.popupMountRef,
|
|
18
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent
|
|
18
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
19
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
19
20
|
var createDecorations = function createDecorations(tr, _ref2) {
|
|
20
21
|
var triggerHandler = _ref2.triggerHandler,
|
|
21
22
|
inputMethod = _ref2.inputMethod,
|
|
@@ -87,7 +88,8 @@ export var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
87
88
|
popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
|
|
88
89
|
popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
|
|
89
90
|
onUndoRedo: onUndoRedo,
|
|
90
|
-
reopenQuery: reopenQuery
|
|
91
|
+
reopenQuery: reopenQuery,
|
|
92
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
91
93
|
})), typeaheadComponent);
|
|
92
94
|
shouldFocusCursorInsideQuery = false;
|
|
93
95
|
return typeaheadComponent;
|
|
@@ -25,12 +25,14 @@ export function createPlugin(_ref) {
|
|
|
25
25
|
popupMountRef = _ref.popupMountRef,
|
|
26
26
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
27
27
|
typeAheadHandlers = _ref.typeAheadHandlers,
|
|
28
|
-
getIntl = _ref.getIntl
|
|
28
|
+
getIntl = _ref.getIntl,
|
|
29
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
29
30
|
var intl = getIntl();
|
|
30
31
|
var _factoryDecorations = factoryDecorations({
|
|
31
32
|
intl: intl,
|
|
32
33
|
popupMountRef: popupMountRef,
|
|
33
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
34
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
35
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
34
36
|
}),
|
|
35
37
|
createDecorations = _factoryDecorations.createDecorations,
|
|
36
38
|
removeDecorations = _factoryDecorations.removeDecorations;
|
|
@@ -66,7 +66,8 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
66
66
|
onQueryFocus = _ref.onQueryFocus,
|
|
67
67
|
onUndoRedo = _ref.onUndoRedo,
|
|
68
68
|
editorView = _ref.editorView,
|
|
69
|
-
items = _ref.items
|
|
69
|
+
items = _ref.items,
|
|
70
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
70
71
|
var ref = useRef(document.createElement('span'));
|
|
71
72
|
var inputRef = useRef(null);
|
|
72
73
|
var _useState = useState(null),
|
|
@@ -139,6 +140,19 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
139
140
|
// Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
|
|
140
141
|
if (!event.isComposing || event.which !== 229 && event.keyCode !== 229) {
|
|
141
142
|
if (selectedIndex === -1) {
|
|
143
|
+
if (useBetterTypeaheadNavigation) {
|
|
144
|
+
/**
|
|
145
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
146
|
+
* here, either
|
|
147
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
148
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
149
|
+
* focus changes,
|
|
150
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
151
|
+
*
|
|
152
|
+
* The focus behaviour still needs cleanup
|
|
153
|
+
*/
|
|
154
|
+
selectPreviousItem();
|
|
155
|
+
}
|
|
142
156
|
selectNextItem();
|
|
143
157
|
}
|
|
144
158
|
onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
|
|
@@ -146,18 +160,41 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
146
160
|
break;
|
|
147
161
|
case 'Tab':
|
|
148
162
|
if (selectedIndex === -1) {
|
|
163
|
+
if (useBetterTypeaheadNavigation) {
|
|
164
|
+
/**
|
|
165
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
166
|
+
* here, either
|
|
167
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
168
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
169
|
+
* focus changes,
|
|
170
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
171
|
+
*
|
|
172
|
+
*/
|
|
173
|
+
selectPreviousItem();
|
|
174
|
+
}
|
|
149
175
|
selectNextItem();
|
|
150
176
|
}
|
|
177
|
+
// TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
|
|
151
178
|
onItemSelect(SelectItemMode.TAB);
|
|
152
179
|
break;
|
|
153
180
|
case 'ArrowDown':
|
|
154
|
-
if (
|
|
181
|
+
if (useBetterTypeaheadNavigation) {
|
|
155
182
|
selectNextItem();
|
|
183
|
+
} else {
|
|
184
|
+
// TODO DTR-1401: why were we preventing selection?
|
|
185
|
+
if (selectedIndex === -1) {
|
|
186
|
+
selectNextItem();
|
|
187
|
+
}
|
|
156
188
|
}
|
|
157
189
|
break;
|
|
158
190
|
case 'ArrowUp':
|
|
159
|
-
if (
|
|
191
|
+
if (useBetterTypeaheadNavigation) {
|
|
160
192
|
selectPreviousItem();
|
|
193
|
+
} else {
|
|
194
|
+
// TODO DTR-1401: why were we preventing selection?
|
|
195
|
+
if (selectedIndex === -1) {
|
|
196
|
+
selectPreviousItem();
|
|
197
|
+
}
|
|
161
198
|
}
|
|
162
199
|
break;
|
|
163
200
|
}
|
|
@@ -170,7 +207,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
170
207
|
event.preventDefault();
|
|
171
208
|
return false;
|
|
172
209
|
}
|
|
173
|
-
}, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
210
|
+
}, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
174
211
|
var onClick = useCallback(function (event) {
|
|
175
212
|
var _inputRef$current;
|
|
176
213
|
event.stopPropagation();
|
|
@@ -176,6 +176,8 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
176
176
|
selectPreviousItem();
|
|
177
177
|
event.preventDefault();
|
|
178
178
|
break;
|
|
179
|
+
|
|
180
|
+
// TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
|
|
179
181
|
case 'Tab':
|
|
180
182
|
//Tab key quick inserts the selected item.
|
|
181
183
|
onItemClick(SelectItemMode.TAB, selectedIndex);
|
|
@@ -19,7 +19,8 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
19
19
|
inputMethod = _ref.inputMethod,
|
|
20
20
|
getDecorationPosition = _ref.getDecorationPosition,
|
|
21
21
|
reopenQuery = _ref.reopenQuery,
|
|
22
|
-
onUndoRedo = _ref.onUndoRedo
|
|
22
|
+
onUndoRedo = _ref.onUndoRedo,
|
|
23
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
23
24
|
var _useState = useState(false),
|
|
24
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
26
|
closed = _useState2[0],
|
|
@@ -41,15 +42,17 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
41
42
|
var selectNextItem = useMemo(function () {
|
|
42
43
|
return moveSelectedIndex({
|
|
43
44
|
editorView: editorView,
|
|
44
|
-
direction: 'next'
|
|
45
|
+
direction: 'next',
|
|
46
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
45
47
|
});
|
|
46
|
-
}, [editorView]);
|
|
48
|
+
}, [editorView, useBetterTypeaheadNavigation]);
|
|
47
49
|
var selectPreviousItem = useMemo(function () {
|
|
48
50
|
return moveSelectedIndex({
|
|
49
51
|
editorView: editorView,
|
|
50
|
-
direction: 'previous'
|
|
52
|
+
direction: 'previous',
|
|
53
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
51
54
|
});
|
|
52
|
-
}, [editorView]);
|
|
55
|
+
}, [editorView, useBetterTypeaheadNavigation]);
|
|
53
56
|
var cancel = useCallback(function (_ref2) {
|
|
54
57
|
var setSelectionAt = _ref2.setSelectionAt,
|
|
55
58
|
addPrefixTrigger = _ref2.addPrefixTrigger,
|
|
@@ -100,6 +103,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
100
103
|
return null;
|
|
101
104
|
}
|
|
102
105
|
return /*#__PURE__*/React.createElement(InputQuery, {
|
|
106
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
|
|
103
107
|
triggerQueryPrefix: triggerHandler.trigger,
|
|
104
108
|
onQueryChange: setQuery,
|
|
105
109
|
onItemSelect: insertSelectedItem,
|
|
@@ -51,7 +51,8 @@ export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
|
|
|
51
51
|
};
|
|
52
52
|
export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
53
53
|
var editorView = _ref2.editorView,
|
|
54
|
-
direction = _ref2.direction
|
|
54
|
+
direction = _ref2.direction,
|
|
55
|
+
useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
|
|
55
56
|
return function () {
|
|
56
57
|
var typeAheadState = getPluginState(editorView.state);
|
|
57
58
|
if (!typeAheadState) {
|
|
@@ -63,7 +64,26 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
|
63
64
|
var nextIndex;
|
|
64
65
|
if (direction === 'next') {
|
|
65
66
|
stats.increaseArrowDown();
|
|
66
|
-
|
|
67
|
+
if (useBetterTypeaheadNavigation) {
|
|
68
|
+
/**
|
|
69
|
+
* See: https://product-fabric.atlassian.net/browse/ED-17200
|
|
70
|
+
* `selectedIndex` is forced to -1 now to not immediately focus the typeahead
|
|
71
|
+
* and only do so when there is explicit logic to focus into the typeahead
|
|
72
|
+
* options.
|
|
73
|
+
*
|
|
74
|
+
* This check for "set index to 1 when -1"
|
|
75
|
+
* - is a temporary workaround to get back the previous behaviour without
|
|
76
|
+
* entirely reverting the a11y improvements
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
if (selectedIndex === -1 && items.length > 1) {
|
|
80
|
+
nextIndex = 1;
|
|
81
|
+
} else {
|
|
82
|
+
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
86
|
+
}
|
|
67
87
|
} else {
|
|
68
88
|
stats.increaseArrowUp();
|
|
69
89
|
nextIndex = selectedIndex <= 0 ? items.length - 1 : selectedIndex - 1;
|
package/dist/esm/test-utils.js
CHANGED
|
@@ -61,7 +61,9 @@ export var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
|
|
|
61
61
|
return function (pluginFactoryParams) {
|
|
62
62
|
var editorPlugins = [];
|
|
63
63
|
var preset = inputPreset.has(basePlugin) ? inputPreset : inputPreset.add(basePlugin);
|
|
64
|
-
editorPlugins = preset.build(
|
|
64
|
+
editorPlugins = preset.build({
|
|
65
|
+
pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
|
|
66
|
+
});
|
|
65
67
|
var editorConfig = lightProcessPluginsList(editorPlugins);
|
|
66
68
|
var schema = createSchema(editorConfig);
|
|
67
69
|
var plugins = editorConfig.plugins.sort(sortByOrder('plugins')).map(function (_ref) {
|
|
@@ -46,14 +46,16 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
46
46
|
eventDispatcher: props.eventDispatcher,
|
|
47
47
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
48
48
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
49
|
-
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
|
|
49
|
+
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
50
|
+
featureFlags: props.featureFlags || {}
|
|
50
51
|
}), (_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, {
|
|
51
52
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
52
53
|
popupsMountPoint: props.popupsMountPoint,
|
|
53
54
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
54
55
|
editorView: props.editorView,
|
|
55
56
|
containerElement: props.containerElement,
|
|
56
|
-
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
|
|
57
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
58
|
+
featureFlags: props.featureFlags
|
|
57
59
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
58
60
|
useEffect(function () {
|
|
59
61
|
var _props$featureFlags7;
|
package/dist/esm/ui/styles.js
CHANGED
|
@@ -5,7 +5,7 @@ import { N30 } from '@atlaskit/theme/colors';
|
|
|
5
5
|
export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
6
6
|
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
7
7
|
export var buttonGroupStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n & > div {\n display: flex;\n }\n"])));
|
|
8
|
-
export var separatorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), "var(--ds-border, ".concat(N30, ")"));
|
|
8
|
+
export var separatorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n user-select: none;\n"])), "var(--ds-border, ".concat(N30, ")"));
|
|
9
9
|
export var wrapperStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > div,\n > span {\n display: flex;\n }\n\n > div > div {\n display: flex;\n }\n\n margin-left: 0;\n min-width: auto;\n"])));
|
|
10
10
|
export var wrapperSmallStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 4px;\n min-width: 40px;\n"])));
|
|
11
11
|
export var expandIconWrapperStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
@@ -8,8 +8,6 @@ import { createInputRulePlugin } from '@atlaskit/prosemirror-input-rules';
|
|
|
8
8
|
import { addAnalytics } from '../plugins/analytics';
|
|
9
9
|
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { closeHistory } from 'prosemirror-history';
|
|
11
|
-
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
12
|
-
import { getFeatureFlags } from '../plugins/feature-flags-context';
|
|
13
11
|
export var ruleWithAnalytics = function ruleWithAnalytics(getPayload) {
|
|
14
12
|
return function (originalRule) {
|
|
15
13
|
var onHandlerApply = function onHandlerApply(state, tr, matchResult) {
|
|
@@ -98,21 +96,6 @@ export var createWrappingJoinRule = function createWrappingJoinRule(_ref3) {
|
|
|
98
96
|
tr.setNodeMarkup(parentNodePosMapped, parentNode.type, parentNode.attrs, allowedMarks);
|
|
99
97
|
}
|
|
100
98
|
tr.wrap(range, wrapping);
|
|
101
|
-
var 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
|
-
var $end = tr.doc.resolve(tr.mapping.map(end));
|
|
107
|
-
var _node = findParentNodeOfTypeClosestToPos($end, nodeType);
|
|
108
|
-
if (_node) {
|
|
109
|
-
var nodeEnd = _node.pos + _node.node.nodeSize;
|
|
110
|
-
var 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
|
var 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);
|
package/dist/esm/utils/insert.js
CHANGED
|
@@ -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 var LookDirection;
|
|
9
10
|
(function (LookDirection) {
|
|
10
11
|
LookDirection["Before"] = "before";
|
|
@@ -20,6 +21,18 @@ var nodeIsInsideAList = function nodeIsInsideAList(tr) {
|
|
|
20
21
|
var nodes = tr.doc.type.schema.nodes;
|
|
21
22
|
return hasParentNodeOfType([nodes.orderedList, nodes.bulletList])(tr.selection);
|
|
22
23
|
};
|
|
24
|
+
var selectionIsInsideAPanel = function selectionIsInsideAPanel(tr) {
|
|
25
|
+
var nodes = tr.doc.type.schema.nodes;
|
|
26
|
+
return hasParentNodeOfType(nodes.panel)(tr.selection);
|
|
27
|
+
};
|
|
28
|
+
var selectionIsInNestedList = function selectionIsInNestedList(tr) {
|
|
29
|
+
var nodes = tr.doc.type.schema.nodes;
|
|
30
|
+
var parentListNode = findParentNodeOfType([nodes.orderedList, nodes.bulletList])(tr.selection);
|
|
31
|
+
if (!parentListNode) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return isListItemNode(tr.doc.resolve(parentListNode.pos).parent);
|
|
35
|
+
};
|
|
23
36
|
var insertBeforeOrAfter = function insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content) {
|
|
24
37
|
/**
|
|
25
38
|
* This block caters for the first item in a parent with the cursor being at the very start
|
|
@@ -47,9 +60,7 @@ export var safeInsert = function safeInsert(content, position) {
|
|
|
47
60
|
var _tr$selection$$from$n;
|
|
48
61
|
var nodes = tr.doc.type.schema.nodes;
|
|
49
62
|
var whitelist = [nodes.rule, nodes.mediaSingle];
|
|
50
|
-
|
|
51
|
-
// fallback if the node to insert is not in the whitelist, or if the insertion should happen within a list.
|
|
52
|
-
if (content instanceof Fragment || !whitelist.includes(content.type) || nodeIsInsideAList(tr)) {
|
|
63
|
+
if (content instanceof Fragment || !whitelist.includes(content.type)) {
|
|
53
64
|
return null;
|
|
54
65
|
}
|
|
55
66
|
|
|
@@ -81,14 +92,28 @@ export var safeInsert = function safeInsert(content, position) {
|
|
|
81
92
|
}
|
|
82
93
|
var grandParentNodeType = (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type;
|
|
83
94
|
var parentNodeType = tr.selection.$from.parent.type;
|
|
84
|
-
|
|
95
|
+
|
|
96
|
+
// if there is no direction, and cannot split for this particular node
|
|
97
|
+
var noDirectionAndShouldNotSplit = !lookDirection && !shouldSplitSelectedNodeOnNodeInsertion({
|
|
85
98
|
parentNodeType: parentNodeType,
|
|
86
99
|
grandParentNodeType: grandParentNodeType,
|
|
87
100
|
content: content
|
|
88
|
-
})
|
|
101
|
+
});
|
|
102
|
+
var ruleNodeInANestedListNode = content.type === nodes.rule && selectionIsInNestedList(tr);
|
|
103
|
+
var nonRuleNodeInListNode = !(content.type === nodes.rule) && nodeIsInsideAList(tr);
|
|
104
|
+
if (ruleNodeInANestedListNode || noDirectionAndShouldNotSplit && nonRuleNodeInListNode || noDirectionAndShouldNotSplit && !nodeIsInsideAList(tr)) {
|
|
89
105
|
// node to be inserted is an invalid child of selection so insert below selected node
|
|
90
106
|
return pmSafeInsert(content, tr.selection.from)(tr);
|
|
91
107
|
}
|
|
108
|
+
|
|
109
|
+
// if node is a rule and that is a flat list splitting and not at the end of a list
|
|
110
|
+
var _tr$selection = tr.selection,
|
|
111
|
+
from = _tr$selection.from,
|
|
112
|
+
to = _tr$selection.to;
|
|
113
|
+
var ruleTypeInAList = content.type === nodes.rule && nodeIsInsideAList(tr);
|
|
114
|
+
if (ruleTypeInAList && !($insertPos.pos === insertPosEnd)) {
|
|
115
|
+
return tr.replaceRange(from, to, new Slice(Fragment.from(nodes.rule.createChecked()), 0, 0));
|
|
116
|
+
}
|
|
92
117
|
if (!lookDirection) {
|
|
93
118
|
// fallback to consumer for now
|
|
94
119
|
return null;
|
|
@@ -110,7 +135,14 @@ export var safeInsert = function safeInsert(content, position) {
|
|
|
110
135
|
|
|
111
136
|
// If we can't insert, and we think we should split, we fallback to consumer for now
|
|
112
137
|
if (shouldSplit(parentNode.type, tr.doc.type.schema.nodes)) {
|
|
113
|
-
|
|
138
|
+
var nextTr = finaliseInsert(insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content), content.nodeSize);
|
|
139
|
+
|
|
140
|
+
// Move selection to the closest text node, otherwise it defaults to the whatever the lookDirection is set to above
|
|
141
|
+
if ([nodes.orderedList, nodes.bulletList].includes(parentNode.type) && nextTr) {
|
|
142
|
+
return nextTr.setSelection(TextSelection.between(nextTr.selection.$from, nextTr.selection.$from));
|
|
143
|
+
} else {
|
|
144
|
+
return nextTr;
|
|
145
|
+
}
|
|
114
146
|
}
|
|
115
147
|
|
|
116
148
|
// Can not insert into current parent, step up one parent
|
|
@@ -157,7 +189,21 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
157
189
|
*
|
|
158
190
|
*/
|
|
159
191
|
} else if (node.isBlock) {
|
|
160
|
-
|
|
192
|
+
/**
|
|
193
|
+
*
|
|
194
|
+
* Rule has unique insertion behaviour
|
|
195
|
+
* so using this safeInsert function in order to handle specific cases in flat list vs nested list
|
|
196
|
+
* instead of a generic pmSafeInsert (i.e appending at the end)
|
|
197
|
+
*
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
var selectionInsideAPanel = selectionIsInsideAPanel(tr);
|
|
201
|
+
if (node.type.name === 'rule' && !selectionInsideAPanel) {
|
|
202
|
+
var _safeInsert;
|
|
203
|
+
tr = (_safeInsert = safeInsert(node, tr.selection.from)(tr)) !== null && _safeInsert !== void 0 ? _safeInsert : tr;
|
|
204
|
+
} else {
|
|
205
|
+
tr = pmSafeInsert(normaliseNestedLayout(state, node), undefined, true)(tr);
|
|
206
|
+
}
|
|
161
207
|
|
|
162
208
|
/**
|
|
163
209
|
*
|
package/dist/esm/version.json
CHANGED
|
@@ -3,3 +3,12 @@ export declare function sortByOrder(item: 'plugins' | 'nodes' | 'marks'): (a: {
|
|
|
3
3
|
}, b: {
|
|
4
4
|
name: string;
|
|
5
5
|
}) => number;
|
|
6
|
+
export declare function sortByOrderWithTypeName(item: 'plugins' | 'nodes' | 'marks'): (a: {
|
|
7
|
+
type: {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
}, b: {
|
|
11
|
+
type: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
}) => number;
|
|
@@ -20,11 +20,31 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
20
20
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
21
21
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlagsContext", {
|
|
22
22
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
23
|
-
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"floatingToolbar", {
|
|
23
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"floatingToolbar", {
|
|
24
|
+
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
25
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
26
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
27
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
|
|
28
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
29
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
30
|
+
}>];
|
|
31
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"floatingToolbar", {
|
|
32
|
+
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
33
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
34
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
35
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
|
|
36
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
37
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
38
|
+
}>];
|
|
39
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"fakeTextCursor", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"fakeTextCursor", {}>, (config?: ((editorView: import("prosemirror-view").EditorView<any>) => void) | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"submitEditor", {
|
|
24
40
|
pluginConfiguration: ((editorView: import("prosemirror-view").EditorView<any>) => void) | undefined;
|
|
25
41
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"submitEditor", {
|
|
26
42
|
pluginConfiguration: ((editorView: import("prosemirror-view").EditorView<any>) => void) | undefined;
|
|
27
|
-
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"editorDisabled", {
|
|
43
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"editorDisabled", {
|
|
44
|
+
sharedState: import("../../../plugins/editor-disabled").EditorDisabledPluginState;
|
|
45
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"editorDisabled", {
|
|
46
|
+
sharedState: import("../../../plugins/editor-disabled").EditorDisabledPluginState;
|
|
47
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"unsupportedContent", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"unsupportedContent", {}>, (config?: import("../../../plugins/type-ahead").TypeAheadPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"typeAhead", {
|
|
28
48
|
pluginConfiguration: import("../../../plugins/type-ahead").TypeAheadPluginOptions | undefined;
|
|
29
49
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"typeAhead", {
|
|
30
50
|
pluginConfiguration: import("../../../plugins/type-ahead").TypeAheadPluginOptions | undefined;
|
|
@@ -38,7 +58,21 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
38
58
|
pluginConfiguration: import("../../../plugins/text-formatting/types").TextFormattingOptions | undefined;
|
|
39
59
|
}>, (config?: import("../../../plugins/hyperlink/types").HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
40
60
|
pluginConfiguration: import("../../../plugins/hyperlink/types").HyperlinkPluginOptions | undefined;
|
|
61
|
+
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
62
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
63
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
64
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
|
|
65
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
66
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
67
|
+
}>];
|
|
41
68
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
42
69
|
pluginConfiguration: import("../../../plugins/hyperlink/types").HyperlinkPluginOptions | undefined;
|
|
70
|
+
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
71
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
72
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
73
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
|
|
74
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
75
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
76
|
+
}>];
|
|
43
77
|
}>, ...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]]>[];
|
|
44
78
|
export declare function EditorPresetCXHTML(props: EditorPresetCXHTMLProps): JSX.Element;
|