@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,6 @@ import HyperlinkAddToolbarComp from './HyperlinkAddToolbar';
|
|
|
5
5
|
import { INPUT_METHOD } from '../../../analytics/types';
|
|
6
6
|
import { stateKey as pluginKey } from '../../pm-plugins/main';
|
|
7
7
|
import WithPluginState from '../../../../ui/WithPluginState';
|
|
8
|
-
import { getFeatureFlags } from '../../../feature-flags-context';
|
|
9
8
|
import { EditorLinkPicker } from '../EditorLinkPicker';
|
|
10
9
|
/**
|
|
11
10
|
* Wraps around the editor's onSubmit handler so that the plugin can interface with the link picker
|
|
@@ -29,7 +28,8 @@ export default class HyperlinkAddToolbar extends React.PureComponent {
|
|
|
29
28
|
providerFactory,
|
|
30
29
|
view,
|
|
31
30
|
onCancel,
|
|
32
|
-
invokeMethod
|
|
31
|
+
invokeMethod,
|
|
32
|
+
featureFlags
|
|
33
33
|
} = this.props;
|
|
34
34
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
35
35
|
providers: ['activityProvider', 'searchProvider'],
|
|
@@ -47,7 +47,7 @@ export default class HyperlinkAddToolbar extends React.PureComponent {
|
|
|
47
47
|
}) => {
|
|
48
48
|
const {
|
|
49
49
|
lpLinkPicker
|
|
50
|
-
} =
|
|
50
|
+
} = featureFlags;
|
|
51
51
|
if (lpLinkPicker) {
|
|
52
52
|
return /*#__PURE__*/React.createElement(EditorLinkPicker, _extends({
|
|
53
53
|
view: view,
|
|
@@ -64,4 +64,5 @@ export { default as avatarGroupPlugin } from './avatar-group';
|
|
|
64
64
|
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
65
65
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
66
66
|
export { default as codeBidiWarningPlugin } from './code-bidi-warning';
|
|
67
|
-
export { default as copyButtonPlugin } from './copy-button';
|
|
67
|
+
export { default as copyButtonPlugin } from './copy-button';
|
|
68
|
+
export { default as borderPlugin } from './border';
|
|
@@ -470,7 +470,8 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
470
470
|
offset: [0, 3],
|
|
471
471
|
mountTo: popupsMountPoint,
|
|
472
472
|
boundariesElement: popupsBoundariesElement,
|
|
473
|
-
scrollableElement: popupsScrollableElement
|
|
473
|
+
scrollableElement: popupsScrollableElement,
|
|
474
|
+
focusTrap: true
|
|
474
475
|
}, jsx(EmojiPickerWithListeners, {
|
|
475
476
|
emojiProvider: emojiProvider,
|
|
476
477
|
onSelection: this.handleSelectedEmoji,
|
|
@@ -6,10 +6,9 @@ import { isListNode, isListItemNode, joinSiblingLists, JoinDirection } from '../
|
|
|
6
6
|
import { findFirstParentListItemNode, findRootParentListNode } from '../utils/find';
|
|
7
7
|
import { normalizeListItemsSelection, createListNodeRange } from '../utils/selection';
|
|
8
8
|
import { GapCursorSelection } from '../../selection/gap-cursor-selection';
|
|
9
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
10
9
|
import { storeRestartListsAttributes, getRestartListsAttributes } from '../utils/analytics';
|
|
11
10
|
import { OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
12
|
-
export const outdentListItemsSelected = (tr, state) => {
|
|
11
|
+
export const outdentListItemsSelected = (tr, state, featureFlags) => {
|
|
13
12
|
const originalSelection = tr.selection;
|
|
14
13
|
const normalizedSelection = normalizeListItemsSelection({
|
|
15
14
|
selection: tr.selection,
|
|
@@ -46,7 +45,8 @@ export const outdentListItemsSelected = (tr, state) => {
|
|
|
46
45
|
extractListItemsRangeFromList({
|
|
47
46
|
tr,
|
|
48
47
|
range: mappedRange,
|
|
49
|
-
state
|
|
48
|
+
state,
|
|
49
|
+
featureFlags
|
|
50
50
|
});
|
|
51
51
|
hasNormalizedToPositionLiftedOut = hasNormalizedToPositionLiftedOut || oldTo >= range.from && oldTo < range.to;
|
|
52
52
|
hasNormalizedFromPositionLiftedOut = hasNormalizedFromPositionLiftedOut || oldFrom >= range.from && oldFrom < range.to;
|
|
@@ -177,7 +177,8 @@ const outdentRangeToParentList = ({
|
|
|
177
177
|
const extractListItemsRangeFromList = ({
|
|
178
178
|
tr,
|
|
179
179
|
range,
|
|
180
|
-
state
|
|
180
|
+
state,
|
|
181
|
+
featureFlags
|
|
181
182
|
}) => {
|
|
182
183
|
const list = range.parent;
|
|
183
184
|
const $start = tr.doc.resolve(range.start);
|
|
@@ -200,7 +201,6 @@ const extractListItemsRangeFromList = ({
|
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
let nextList = list.copy(Fragment.empty);
|
|
203
|
-
const featureFlags = getFeatureFlags(state);
|
|
204
204
|
let nextListStartNumber;
|
|
205
205
|
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists) {
|
|
206
206
|
// if splitting a numbered list, keep the splitted item
|
|
@@ -18,7 +18,7 @@ import { outdentList } from './outdent-list';
|
|
|
18
18
|
import { indentList } from './indent-list';
|
|
19
19
|
import { moveTargetIntoList } from '../utils/replace-content';
|
|
20
20
|
export { outdentList, indentList };
|
|
21
|
-
export const enterKeyCommand = (state, dispatch) => {
|
|
21
|
+
export const enterKeyCommand = featureFlags => (state, dispatch) => {
|
|
22
22
|
const {
|
|
23
23
|
selection
|
|
24
24
|
} = state;
|
|
@@ -35,7 +35,7 @@ export const enterKeyCommand = (state, dispatch) => {
|
|
|
35
35
|
/** Check if the wrapper has any visible content */
|
|
36
36
|
const wrapperHasContent = hasVisibleContent(wrapper);
|
|
37
37
|
if (!wrapperHasContent) {
|
|
38
|
-
return outdentList(INPUT_METHOD.KEYBOARD)(state, dispatch);
|
|
38
|
+
return outdentList(INPUT_METHOD.KEYBOARD, featureFlags)(state, dispatch);
|
|
39
39
|
} else if (!hasParentNodeOfType(codeBlock)(selection)) {
|
|
40
40
|
return splitListItem(listItem)(state, dispatch);
|
|
41
41
|
}
|
|
@@ -43,13 +43,13 @@ export const enterKeyCommand = (state, dispatch) => {
|
|
|
43
43
|
}
|
|
44
44
|
return false;
|
|
45
45
|
};
|
|
46
|
-
export const backspaceKeyCommand = (state, dispatch) => {
|
|
46
|
+
export const backspaceKeyCommand = featureFlags => (state, dispatch) => {
|
|
47
47
|
return baseCommand.chainCommands(listBackspace,
|
|
48
48
|
// if we're at the start of a list item, we need to either backspace
|
|
49
49
|
// directly to an empty list item above, or outdent this node
|
|
50
50
|
filter([isEmptySelectionAtStart,
|
|
51
51
|
// list items might have multiple paragraphs; only do this at the first one
|
|
52
|
-
isFirstChildOfParent, isInsideListItem], baseCommand.chainCommands(deletePreviousEmptyListItem, outdentList(INPUT_METHOD.KEYBOARD))),
|
|
52
|
+
isFirstChildOfParent, isInsideListItem], baseCommand.chainCommands(deletePreviousEmptyListItem, outdentList(INPUT_METHOD.KEYBOARD, featureFlags))),
|
|
53
53
|
// if we're just inside a paragraph node (or gapcursor is shown) and backspace, then try to join
|
|
54
54
|
// the text to the previous list item, if one exists
|
|
55
55
|
filter([isEmptySelectionAtStart, canJoinToPreviousListItem], joinToPreviousListItem))(state, dispatch);
|
|
@@ -6,8 +6,7 @@ import { findFirstParentListNode } from '../utils/find';
|
|
|
6
6
|
import { getCommonListAnalyticsAttributes, getRestartListsAttributes } from '../utils/analytics';
|
|
7
7
|
import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
|
|
8
8
|
import { closeHistory } from 'prosemirror-history';
|
|
9
|
-
|
|
10
|
-
export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
9
|
+
export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD, featureFlags) {
|
|
11
10
|
return function (state, dispatch) {
|
|
12
11
|
if (!isInsideListItem(state)) {
|
|
13
12
|
return false;
|
|
@@ -25,13 +24,12 @@ export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
|
25
24
|
closeHistory(state.tr);
|
|
26
25
|
const actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
27
26
|
let customTr = state.tr;
|
|
28
|
-
outdentListAction(customTr, state);
|
|
27
|
+
outdentListAction(customTr, state, featureFlags);
|
|
29
28
|
if (!customTr || !customTr.docChanged) {
|
|
30
29
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
31
30
|
// If inside table cell and can't outdent list, then let it handle by table keymap
|
|
32
31
|
return !isInsideTableCell(state);
|
|
33
32
|
}
|
|
34
|
-
const featureFlags = getFeatureFlags(state);
|
|
35
33
|
const restartListsAttributes = {};
|
|
36
34
|
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists) {
|
|
37
35
|
const {
|
|
@@ -11,81 +11,84 @@ import { IconList, IconListNumber } from '../quick-insert/assets';
|
|
|
11
11
|
Toolbar buttons to bullet and ordered list can be found in
|
|
12
12
|
packages/editor/editor-core/src/plugins/toolbar-lists-indentation/ui/Toolbar.tsx
|
|
13
13
|
*/
|
|
14
|
-
const listPlugin = options =>
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
14
|
+
const listPlugin = (options, api) => {
|
|
15
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
|
|
16
|
+
return {
|
|
17
|
+
name: 'list',
|
|
18
|
+
nodes() {
|
|
19
|
+
return [{
|
|
20
|
+
name: 'bulletList',
|
|
21
|
+
node: bulletList
|
|
22
|
+
}, {
|
|
23
|
+
name: 'orderedList',
|
|
24
|
+
node: options !== null && options !== void 0 && options.restartNumberedLists ? orderedListWithOrder : orderedList
|
|
25
|
+
}, {
|
|
26
|
+
name: 'listItem',
|
|
27
|
+
node: listItem
|
|
28
|
+
}];
|
|
29
|
+
},
|
|
30
|
+
pmPlugins() {
|
|
31
|
+
return [{
|
|
32
|
+
name: 'list',
|
|
33
|
+
plugin: ({
|
|
34
|
+
dispatch
|
|
35
|
+
}) => createPlugin(dispatch, featureFlags)
|
|
36
|
+
}, {
|
|
37
|
+
name: 'listInputRule',
|
|
38
|
+
plugin: ({
|
|
39
|
+
schema,
|
|
40
|
+
featureFlags
|
|
41
|
+
}) => inputRulePlugin(schema, featureFlags)
|
|
42
|
+
}, {
|
|
43
|
+
name: 'listKeymap',
|
|
44
|
+
plugin: () => keymapPlugin(featureFlags)
|
|
45
|
+
}];
|
|
46
|
+
},
|
|
47
|
+
pluginsOptions: {
|
|
48
|
+
quickInsert: ({
|
|
49
|
+
formatMessage
|
|
50
|
+
}) => [{
|
|
51
|
+
id: 'unorderedList',
|
|
52
|
+
title: formatMessage(messages.unorderedList),
|
|
53
|
+
description: formatMessage(messages.unorderedListDescription),
|
|
54
|
+
keywords: ['ul', 'unordered'],
|
|
55
|
+
priority: 1100,
|
|
56
|
+
keyshortcut: tooltip(toggleBulletList),
|
|
57
|
+
icon: () => /*#__PURE__*/React.createElement(IconList, null),
|
|
58
|
+
action(insert, state) {
|
|
59
|
+
const tr = insert(state.schema.nodes.bulletList.createChecked({}, state.schema.nodes.listItem.createChecked({}, state.schema.nodes.paragraph.createChecked())));
|
|
60
|
+
return addAnalytics(state, tr, {
|
|
61
|
+
action: ACTION.INSERTED,
|
|
62
|
+
actionSubject: ACTION_SUBJECT.LIST,
|
|
63
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_LIST_BULLET,
|
|
64
|
+
eventType: EVENT_TYPE.TRACK,
|
|
65
|
+
attributes: {
|
|
66
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
id: 'orderedList',
|
|
72
|
+
title: formatMessage(messages.orderedList),
|
|
73
|
+
description: formatMessage(messages.orderedListDescription),
|
|
74
|
+
keywords: ['ol', 'ordered'],
|
|
75
|
+
priority: 1200,
|
|
76
|
+
keyshortcut: tooltip(toggleOrderedList),
|
|
77
|
+
icon: () => /*#__PURE__*/React.createElement(IconListNumber, null),
|
|
78
|
+
action(insert, state) {
|
|
79
|
+
const tr = insert(state.schema.nodes.orderedList.createChecked({}, state.schema.nodes.listItem.createChecked({}, state.schema.nodes.paragraph.createChecked())));
|
|
80
|
+
return addAnalytics(state, tr, {
|
|
81
|
+
action: ACTION.INSERTED,
|
|
82
|
+
actionSubject: ACTION_SUBJECT.LIST,
|
|
83
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER,
|
|
84
|
+
eventType: EVENT_TYPE.TRACK,
|
|
85
|
+
attributes: {
|
|
86
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}]
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
};
|
|
91
94
|
export default listPlugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ruleWithAnalytics
|
|
1
|
+
import { ruleWithAnalytics } from '../../../../utils/input-rules';
|
|
2
|
+
import { createWrappingJoinRule } from './wrapping-join-rule';
|
|
2
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '../../../analytics';
|
|
3
4
|
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
4
5
|
const getOrder = matchResult => Number(matchResult[1]);
|
|
@@ -44,6 +45,7 @@ export function createRuleForListType({
|
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
const inputRule = createWrappingJoinRule({
|
|
48
|
+
featureFlags,
|
|
47
49
|
match: expression,
|
|
48
50
|
nodeType: listType,
|
|
49
51
|
getAttrs,
|
|
@@ -14,7 +14,8 @@ export default function inputRulePlugin(schema, featureFlags) {
|
|
|
14
14
|
// because of issue where product converted the
|
|
15
15
|
// character into an escaped version.
|
|
16
16
|
expression: /^\s*([\*\-\u2022]) $/,
|
|
17
|
-
listType: bulletList
|
|
17
|
+
listType: bulletList,
|
|
18
|
+
featureFlags
|
|
18
19
|
}));
|
|
19
20
|
}
|
|
20
21
|
const expression = featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists ? /((^[1-9]{1}[0-9]{0,2})|^(0))[\.\)] $/ : /^(1)[\.\)] $/;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { canJoin, findWrapping } from 'prosemirror-transform';
|
|
2
|
+
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
3
|
+
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { createRule } from '../../../../utils/input-rules';
|
|
5
|
+
export const createWrappingJoinRule = ({
|
|
6
|
+
match,
|
|
7
|
+
nodeType,
|
|
8
|
+
getAttrs,
|
|
9
|
+
joinPredicate,
|
|
10
|
+
featureFlags
|
|
11
|
+
}) => {
|
|
12
|
+
const handler = (state, match, start, end) => {
|
|
13
|
+
const attrs = (getAttrs instanceof Function ? getAttrs(match) : getAttrs) || {};
|
|
14
|
+
const tr = state.tr;
|
|
15
|
+
const fixedStart = Math.max(start, 1);
|
|
16
|
+
tr.delete(fixedStart, end);
|
|
17
|
+
const $start = tr.doc.resolve(fixedStart);
|
|
18
|
+
const range = $start.blockRange();
|
|
19
|
+
const wrapping = range && findWrapping(range, nodeType, attrs);
|
|
20
|
+
if (!wrapping || !range) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const parentNodePosMapped = tr.mapping.map(range.start);
|
|
24
|
+
const parentNode = tr.doc.nodeAt(parentNodePosMapped);
|
|
25
|
+
const lastWrap = wrapping[wrapping.length - 1];
|
|
26
|
+
if (parentNode && lastWrap) {
|
|
27
|
+
const allowedMarks = lastWrap.type.allowedMarks(parentNode.marks) || [];
|
|
28
|
+
tr.setNodeMarkup(parentNodePosMapped, parentNode.type, parentNode.attrs, allowedMarks);
|
|
29
|
+
}
|
|
30
|
+
tr.wrap(range, wrapping);
|
|
31
|
+
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && nodeType === state.schema.nodes.orderedList) {
|
|
32
|
+
// if an orderedList node would be inserted by the input rule match, and
|
|
33
|
+
// that orderedList node is being added directly before another orderedList
|
|
34
|
+
// node, then join those nodes
|
|
35
|
+
const $end = tr.doc.resolve(tr.mapping.map(end));
|
|
36
|
+
const node = findParentNodeOfTypeClosestToPos($end, nodeType);
|
|
37
|
+
if (node) {
|
|
38
|
+
const nodeEnd = node.pos + node.node.nodeSize;
|
|
39
|
+
const after = tr.doc.resolve(nodeEnd).nodeAfter;
|
|
40
|
+
if (after && after.type === nodeType && canJoin(tr.doc, nodeEnd) && (!joinPredicate || joinPredicate(match, after, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_BELOW))) {
|
|
41
|
+
tr.join(nodeEnd);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const before = tr.doc.resolve(fixedStart - 1).nodeBefore;
|
|
46
|
+
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))) {
|
|
47
|
+
tr.join(fixedStart - 1);
|
|
48
|
+
}
|
|
49
|
+
return tr;
|
|
50
|
+
};
|
|
51
|
+
return createRule(match, handler);
|
|
52
|
+
};
|
|
@@ -3,14 +3,14 @@ import * as keymaps from '../../../keymaps';
|
|
|
3
3
|
import { indentList, enterKeyCommand, toggleList, backspaceKeyCommand, deleteKeyCommand } from '../commands';
|
|
4
4
|
import { outdentList } from '../commands/outdent-list';
|
|
5
5
|
import { INPUT_METHOD } from '../../analytics';
|
|
6
|
-
export function keymapPlugin() {
|
|
6
|
+
export function keymapPlugin(featureFlags) {
|
|
7
7
|
const list = {};
|
|
8
8
|
keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleOrderedList), toggleList(INPUT_METHOD.KEYBOARD, 'orderedList'), list);
|
|
9
9
|
keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleBulletList), toggleList(INPUT_METHOD.KEYBOARD, 'bulletList'), list);
|
|
10
10
|
keymaps.bindKeymapWithCommand(keymaps.indentList.common, indentList(INPUT_METHOD.KEYBOARD), list);
|
|
11
|
-
keymaps.bindKeymapWithCommand(keymaps.outdentList.common, outdentList(INPUT_METHOD.KEYBOARD), list);
|
|
12
|
-
keymaps.bindKeymapWithCommand(keymaps.enter.common, enterKeyCommand, list);
|
|
13
|
-
keymaps.bindKeymapWithCommand(keymaps.backspace.common, backspaceKeyCommand, list);
|
|
11
|
+
keymaps.bindKeymapWithCommand(keymaps.outdentList.common, outdentList(INPUT_METHOD.KEYBOARD, featureFlags), list);
|
|
12
|
+
keymaps.bindKeymapWithCommand(keymaps.enter.common, enterKeyCommand(featureFlags), list);
|
|
13
|
+
keymaps.bindKeymapWithCommand(keymaps.backspace.common, backspaceKeyCommand(featureFlags), list);
|
|
14
14
|
keymaps.bindKeymapWithCommand(keymaps.deleteKey.common, deleteKeyCommand, list);
|
|
15
15
|
|
|
16
16
|
// This shortcut is Mac only
|
|
@@ -9,7 +9,6 @@ import { setGapCursorSelection } from '../../../utils';
|
|
|
9
9
|
import { Side } from '../../selection/gap-cursor-selection';
|
|
10
10
|
import { listItemCounterPadding, CodeBlockSharedCssClassName, getOrderedListInlineStyles } from '@atlaskit/editor-common/styles';
|
|
11
11
|
import { getItemCounterDigitsSize } from '@atlaskit/editor-common/utils';
|
|
12
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
13
12
|
const listPluginKey = new PluginKey('listPlugin');
|
|
14
13
|
export const pluginKey = listPluginKey;
|
|
15
14
|
const initialState = {
|
|
@@ -19,9 +18,8 @@ const initialState = {
|
|
|
19
18
|
orderedListDisabled: false,
|
|
20
19
|
decorationSet: DecorationSet.empty
|
|
21
20
|
};
|
|
22
|
-
export const getDecorations = (doc, state) => {
|
|
21
|
+
export const getDecorations = (doc, state, featureFlags) => {
|
|
23
22
|
const decorations = [];
|
|
24
|
-
const featureFlags = getFeatureFlags(state);
|
|
25
23
|
|
|
26
24
|
// this stack keeps track of each (nested) list to calculate the indentation level
|
|
27
25
|
const processedListsStack = [];
|
|
@@ -74,9 +72,9 @@ export const getDecorations = (doc, state) => {
|
|
|
74
72
|
});
|
|
75
73
|
return DecorationSet.empty.add(doc, decorations);
|
|
76
74
|
};
|
|
77
|
-
const handleDocChanged = (tr, pluginState, editorState) => {
|
|
75
|
+
const handleDocChanged = featureFlags => (tr, pluginState, editorState) => {
|
|
78
76
|
const nextPluginState = handleSelectionChanged(tr, pluginState);
|
|
79
|
-
const decorationSet = getDecorations(tr.doc, editorState);
|
|
77
|
+
const decorationSet = getDecorations(tr.doc, editorState, featureFlags);
|
|
80
78
|
return {
|
|
81
79
|
...nextPluginState,
|
|
82
80
|
decorationSet
|
|
@@ -107,53 +105,55 @@ const handleSelectionChanged = (tr, pluginState) => {
|
|
|
107
105
|
const reducer = () => state => {
|
|
108
106
|
return state;
|
|
109
107
|
};
|
|
110
|
-
const {
|
|
111
|
-
getPluginState,
|
|
112
|
-
createPluginState
|
|
113
|
-
} = pluginFactory(listPluginKey, reducer(), {
|
|
114
|
-
onDocChanged: handleDocChanged,
|
|
115
|
-
onSelectionChanged: handleSelectionChanged
|
|
116
|
-
});
|
|
117
|
-
const createInitialState = state => {
|
|
108
|
+
const createInitialState = featureFlags => state => {
|
|
118
109
|
return {
|
|
119
110
|
...initialState,
|
|
120
|
-
decorationSet: getDecorations(state.doc, state)
|
|
111
|
+
decorationSet: getDecorations(state.doc, state, featureFlags)
|
|
121
112
|
};
|
|
122
113
|
};
|
|
123
|
-
export const createPlugin = eventDispatch =>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
114
|
+
export const createPlugin = (eventDispatch, featureFlags) => {
|
|
115
|
+
const {
|
|
116
|
+
getPluginState,
|
|
117
|
+
createPluginState
|
|
118
|
+
} = pluginFactory(listPluginKey, reducer(), {
|
|
119
|
+
onDocChanged: handleDocChanged(featureFlags),
|
|
120
|
+
onSelectionChanged: handleSelectionChanged
|
|
121
|
+
});
|
|
122
|
+
return new SafePlugin({
|
|
123
|
+
state: createPluginState(eventDispatch, createInitialState(featureFlags)),
|
|
124
|
+
key: listPluginKey,
|
|
125
|
+
props: {
|
|
126
|
+
decorations(state) {
|
|
127
|
+
const {
|
|
128
|
+
decorationSet
|
|
129
|
+
} = getPluginState(state);
|
|
130
|
+
return decorationSet;
|
|
131
|
+
},
|
|
132
|
+
handleClick: (view, pos, event) => {
|
|
140
133
|
const {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
134
|
+
state
|
|
135
|
+
} = view;
|
|
136
|
+
if (['LI', 'UL'].includes((event === null || event === void 0 ? void 0 : event.target).tagName)) {
|
|
137
|
+
var _nodeAtPos$firstChild;
|
|
138
|
+
const nodeAtPos = state.tr.doc.nodeAt(pos);
|
|
139
|
+
const {
|
|
140
|
+
listItem,
|
|
141
|
+
codeBlock
|
|
142
|
+
} = view.state.schema.nodes;
|
|
143
|
+
if ((nodeAtPos === null || nodeAtPos === void 0 ? void 0 : nodeAtPos.type) === listItem && (nodeAtPos === null || nodeAtPos === void 0 ? void 0 : (_nodeAtPos$firstChild = nodeAtPos.firstChild) === null || _nodeAtPos$firstChild === void 0 ? void 0 : _nodeAtPos$firstChild.type) === codeBlock) {
|
|
144
|
+
var _document, _document$elementFrom;
|
|
145
|
+
const bufferPx = 50;
|
|
146
|
+
const isCodeBlockNextToListMarker = Boolean((_document = document) === null || _document === void 0 ? void 0 : (_document$elementFrom = _document.elementFromPoint(event.clientX + (listItemCounterPadding + bufferPx), event.clientY)) === null || _document$elementFrom === void 0 ? void 0 : _document$elementFrom.closest(`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}`));
|
|
147
|
+
if (isCodeBlockNextToListMarker) {
|
|
148
|
+
// +1 needed to put cursor inside li
|
|
149
|
+
// otherwise gap cursor markup will be injected as immediate child of ul resulting in invalid html
|
|
150
|
+
setGapCursorSelection(view, pos + 1, Side.LEFT);
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
+
return false;
|
|
155
156
|
}
|
|
156
|
-
return false;
|
|
157
157
|
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
158
|
+
});
|
|
159
|
+
};
|
|
@@ -103,6 +103,7 @@ export class MediaNode extends Component {
|
|
|
103
103
|
maxDimensions,
|
|
104
104
|
mediaOptions
|
|
105
105
|
} = this.props;
|
|
106
|
+
const borderMark = node.marks.find(m => m.type.name === 'border');
|
|
106
107
|
const {
|
|
107
108
|
viewMediaClientConfig,
|
|
108
109
|
contextIdentifierProvider
|
|
@@ -138,7 +139,9 @@ export class MediaNode extends Component {
|
|
|
138
139
|
};
|
|
139
140
|
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
140
141
|
dimensions: originalDimensions,
|
|
141
|
-
onContextMenu: this.selectMediaSingle
|
|
142
|
+
onContextMenu: this.selectMediaSingle,
|
|
143
|
+
borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
144
|
+
selected: selected
|
|
142
145
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
143
146
|
mediaClientConfig: mediaClientConfig,
|
|
144
147
|
resizeMode: "stretchy-fit",
|
|
@@ -18,9 +18,20 @@ const forcedDimensions = css`
|
|
|
18
18
|
export const MediaCardWrapper = ({
|
|
19
19
|
dimensions,
|
|
20
20
|
children,
|
|
21
|
+
selected,
|
|
22
|
+
borderWidth = 0,
|
|
21
23
|
onContextMenu
|
|
22
24
|
}) => {
|
|
25
|
+
const calculatedBorderWidth = selected && borderWidth > 0 ? borderWidth + 1 : borderWidth;
|
|
23
26
|
return jsx("div", {
|
|
27
|
+
"data-testid": "media-card-wrapper",
|
|
28
|
+
style: {
|
|
29
|
+
borderColor: `var(--custom-palette-color)`,
|
|
30
|
+
borderWidth: `${calculatedBorderWidth}px`,
|
|
31
|
+
borderStyle: 'solid',
|
|
32
|
+
borderRadius: `${calculatedBorderWidth * 2}px`
|
|
33
|
+
}
|
|
34
|
+
}, jsx("div", {
|
|
24
35
|
css: forcedDimensions,
|
|
25
36
|
style: {
|
|
26
37
|
paddingBottom: `${dimensions.height / dimensions.width * 100}%`
|
|
@@ -28,5 +39,5 @@ export const MediaCardWrapper = ({
|
|
|
28
39
|
onContextMenuCapture: onContextMenu
|
|
29
40
|
}, jsx("div", {
|
|
30
41
|
css: absoluteDiv
|
|
31
|
-
}, children));
|
|
42
|
+
}, children)));
|
|
32
43
|
};
|