@atlaskit/editor-core 181.0.1 → 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 +40 -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/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/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/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/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/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/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/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 +12 -11
- 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
|
@@ -19,7 +19,6 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
|
19
19
|
import { themed } from '@atlaskit/theme/components';
|
|
20
20
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
21
21
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
22
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
23
22
|
import { compareArrays, shallowEqual } from '../utils';
|
|
24
23
|
import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
25
24
|
import Button from './Button';
|
|
@@ -53,9 +52,10 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
53
52
|
extensionsProvider = _ref.extensionsProvider,
|
|
54
53
|
node = _ref.node,
|
|
55
54
|
setDisableScroll = _ref.setDisableScroll,
|
|
56
|
-
mountRef = _ref.mountRef
|
|
55
|
+
mountRef = _ref.mountRef,
|
|
56
|
+
featureFlags = _ref.featureFlags;
|
|
57
57
|
var emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
|
|
58
|
-
var _ref2 =
|
|
58
|
+
var _ref2 = featureFlags || {
|
|
59
59
|
useSomewhatSemanticTextColorNames: false
|
|
60
60
|
},
|
|
61
61
|
useSomewhatSemanticTextColorNames = _ref2.useSomewhatSemanticTextColorNames;
|
|
@@ -221,7 +221,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
221
221
|
if (!editorView || !extensionsProvider) {
|
|
222
222
|
return null;
|
|
223
223
|
}
|
|
224
|
-
var _ref3 =
|
|
224
|
+
var _ref3 = featureFlags || {},
|
|
225
225
|
extendFloatingToolbar = _ref3.extendFloatingToolbar;
|
|
226
226
|
if (!extendFloatingToolbar) {
|
|
227
227
|
return null;
|
|
@@ -465,7 +465,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
465
465
|
}, jsx(ToolbarItems, _extends({}, this.props, {
|
|
466
466
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
467
467
|
mountRef: this.mountRef,
|
|
468
|
-
mounted: this.state.mounted
|
|
468
|
+
mounted: this.state.mounted,
|
|
469
|
+
featureFlags: this.props.featureFlags
|
|
469
470
|
}))), scrollable && jsx(ScrollButtons, {
|
|
470
471
|
intl: intl,
|
|
471
472
|
scrollContainerRef: this.scrollContainerRef,
|
|
@@ -16,8 +16,6 @@ import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDT
|
|
|
16
16
|
import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
17
17
|
import { addAnalytics, ACTION_SUBJECT_ID } from '../analytics';
|
|
18
18
|
import { buildVisitedLinkPayload, buildOpenedSettingsPayload } from '../../utils/linking-utils';
|
|
19
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
20
|
-
|
|
21
19
|
/* type guard for edit links */
|
|
22
20
|
function isEditLink(linkMark) {
|
|
23
21
|
return linkMark.pos !== undefined;
|
|
@@ -53,9 +51,8 @@ function getLinkText(activeLinkMark, state) {
|
|
|
53
51
|
}
|
|
54
52
|
return activeLinkMark.node.text;
|
|
55
53
|
}
|
|
56
|
-
var getSettingsButtonGroup = function getSettingsButtonGroup(state, intl) {
|
|
57
|
-
var
|
|
58
|
-
floatingToolbarLinkSettingsButton = _getFeatureFlags.floatingToolbarLinkSettingsButton;
|
|
54
|
+
var getSettingsButtonGroup = function getSettingsButtonGroup(state, intl, featureFlags) {
|
|
55
|
+
var floatingToolbarLinkSettingsButton = featureFlags.floatingToolbarLinkSettingsButton;
|
|
59
56
|
return floatingToolbarLinkSettingsButton === 'true' ? [{
|
|
60
57
|
type: 'separator'
|
|
61
58
|
}, {
|
|
@@ -68,7 +65,7 @@ var getSettingsButtonGroup = function getSettingsButtonGroup(state, intl) {
|
|
|
68
65
|
target: '_blank'
|
|
69
66
|
}] : [];
|
|
70
67
|
};
|
|
71
|
-
export var getToolbarConfig = function getToolbarConfig(options) {
|
|
68
|
+
export var getToolbarConfig = function getToolbarConfig(options, featureFlags) {
|
|
72
69
|
return function (state, intl, providerFactory) {
|
|
73
70
|
var formatMessage = intl.formatMessage;
|
|
74
71
|
var linkState = stateKey.getState(state);
|
|
@@ -76,10 +73,9 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
76
73
|
/**
|
|
77
74
|
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
|
78
75
|
*/
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
preventPopupOverflow = _getFeatureFlags2.preventPopupOverflow;
|
|
76
|
+
var lpLinkPicker = featureFlags.lpLinkPicker,
|
|
77
|
+
lpLinkPickerFocusTrap = featureFlags.lpLinkPickerFocusTrap,
|
|
78
|
+
preventPopupOverflow = featureFlags.preventPopupOverflow;
|
|
83
79
|
var shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
84
80
|
if (linkState && linkState.activeLinkMark) {
|
|
85
81
|
var activeLinkMark = linkState.activeLinkMark;
|
|
@@ -173,14 +169,13 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
173
169
|
formatMessage: formatMessage,
|
|
174
170
|
markType: state.schema.marks.link
|
|
175
171
|
}]
|
|
176
|
-
}].concat(_toConsumableArray(getSettingsButtonGroup(state, intl))),
|
|
172
|
+
}].concat(_toConsumableArray(getSettingsButtonGroup(state, intl, featureFlags))),
|
|
177
173
|
scrollable: true
|
|
178
174
|
});
|
|
179
175
|
}
|
|
180
176
|
case 'EDIT_INSERTED':
|
|
181
177
|
case 'INSERT':
|
|
182
178
|
{
|
|
183
|
-
var _options$linkPicker, _options$linkPicker$p;
|
|
184
179
|
var _link;
|
|
185
180
|
if (isEditLink(activeLinkMark) && activeLinkMark.node) {
|
|
186
181
|
var _linkMark = activeLinkMark.node.marks.filter(function (mark) {
|
|
@@ -189,7 +184,7 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
189
184
|
_link = _linkMark[0] && _linkMark[0].attrs.href;
|
|
190
185
|
}
|
|
191
186
|
var displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
|
|
192
|
-
var popupHeight = lpLinkPicker
|
|
187
|
+
var popupHeight = lpLinkPicker ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX;
|
|
193
188
|
return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
|
|
194
189
|
preventPopupOverflow: preventPopupOverflow,
|
|
195
190
|
height: popupHeight,
|
|
@@ -207,6 +202,7 @@ export var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
207
202
|
view: view,
|
|
208
203
|
key: idx,
|
|
209
204
|
linkPickerOptions: options === null || options === void 0 ? void 0 : options.linkPicker,
|
|
205
|
+
featureFlags: featureFlags,
|
|
210
206
|
displayUrl: _link,
|
|
211
207
|
displayText: displayText || '',
|
|
212
208
|
providerFactory: providerFactory,
|
|
@@ -9,7 +9,11 @@ import { getToolbarConfig } from './Toolbar';
|
|
|
9
9
|
import { tooltip, addLink } from '../../keymaps';
|
|
10
10
|
import { IconLink } from '../quick-insert/assets';
|
|
11
11
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
12
|
-
var hyperlinkPlugin = function hyperlinkPlugin(
|
|
12
|
+
var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
13
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
14
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
var api = arguments.length > 1 ? arguments[1] : undefined;
|
|
16
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
13
17
|
return {
|
|
14
18
|
name: 'hyperlink',
|
|
15
19
|
marks: function marks() {
|
|
@@ -79,7 +83,7 @@ var hyperlinkPlugin = function hyperlinkPlugin(options) {
|
|
|
79
83
|
}
|
|
80
84
|
}];
|
|
81
85
|
},
|
|
82
|
-
floatingToolbar: getToolbarConfig(options)
|
|
86
|
+
floatingToolbar: getToolbarConfig(options, featureFlags)
|
|
83
87
|
}
|
|
84
88
|
};
|
|
85
89
|
};
|
|
@@ -12,7 +12,6 @@ import HyperlinkAddToolbarComp from './HyperlinkAddToolbar';
|
|
|
12
12
|
import { INPUT_METHOD } from '../../../analytics/types';
|
|
13
13
|
import { stateKey as pluginKey } from '../../pm-plugins/main';
|
|
14
14
|
import WithPluginState from '../../../../ui/WithPluginState';
|
|
15
|
-
import { getFeatureFlags } from '../../../feature-flags-context';
|
|
16
15
|
import { EditorLinkPicker } from '../EditorLinkPicker';
|
|
17
16
|
/**
|
|
18
17
|
* Wraps around the editor's onSubmit handler so that the plugin can interface with the link picker
|
|
@@ -46,7 +45,8 @@ var HyperlinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
46
45
|
providerFactory = _this$props.providerFactory,
|
|
47
46
|
view = _this$props.view,
|
|
48
47
|
onCancel = _this$props.onCancel,
|
|
49
|
-
invokeMethod = _this$props.invokeMethod
|
|
48
|
+
invokeMethod = _this$props.invokeMethod,
|
|
49
|
+
featureFlags = _this$props.featureFlags;
|
|
50
50
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
51
51
|
providers: ['activityProvider', 'searchProvider'],
|
|
52
52
|
providerFactory: providerFactory,
|
|
@@ -60,8 +60,7 @@ var HyperlinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
60
60
|
},
|
|
61
61
|
render: function render(_ref3) {
|
|
62
62
|
var hyperlinkPluginState = _ref3.hyperlinkPluginState;
|
|
63
|
-
var
|
|
64
|
-
lpLinkPicker = _getFeatureFlags.lpLinkPicker;
|
|
63
|
+
var lpLinkPicker = featureFlags.lpLinkPicker;
|
|
65
64
|
if (lpLinkPicker) {
|
|
66
65
|
return /*#__PURE__*/React.createElement(EditorLinkPicker, _extends({
|
|
67
66
|
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';
|
|
@@ -426,7 +426,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
426
426
|
offset: [0, 3],
|
|
427
427
|
mountTo: popupsMountPoint,
|
|
428
428
|
boundariesElement: popupsBoundariesElement,
|
|
429
|
-
scrollableElement: popupsScrollableElement
|
|
429
|
+
scrollableElement: popupsScrollableElement,
|
|
430
|
+
focusTrap: true
|
|
430
431
|
}, jsx(EmojiPickerWithListeners, {
|
|
431
432
|
emojiProvider: emojiProvider,
|
|
432
433
|
onSelection: this.handleSelectedEmoji,
|
|
@@ -9,10 +9,9 @@ import { isListNode, isListItemNode, joinSiblingLists, JoinDirection } from '../
|
|
|
9
9
|
import { findFirstParentListItemNode, findRootParentListNode } from '../utils/find';
|
|
10
10
|
import { normalizeListItemsSelection, createListNodeRange } from '../utils/selection';
|
|
11
11
|
import { GapCursorSelection } from '../../selection/gap-cursor-selection';
|
|
12
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
13
12
|
import { storeRestartListsAttributes, getRestartListsAttributes } from '../utils/analytics';
|
|
14
13
|
import { OUTDENT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
15
|
-
export var outdentListItemsSelected = function outdentListItemsSelected(tr, state) {
|
|
14
|
+
export var outdentListItemsSelected = function outdentListItemsSelected(tr, state, featureFlags) {
|
|
16
15
|
var originalSelection = tr.selection;
|
|
17
16
|
var normalizedSelection = normalizeListItemsSelection({
|
|
18
17
|
selection: tr.selection,
|
|
@@ -47,7 +46,8 @@ export var outdentListItemsSelected = function outdentListItemsSelected(tr, stat
|
|
|
47
46
|
extractListItemsRangeFromList({
|
|
48
47
|
tr: tr,
|
|
49
48
|
range: mappedRange,
|
|
50
|
-
state: state
|
|
49
|
+
state: state,
|
|
50
|
+
featureFlags: featureFlags
|
|
51
51
|
});
|
|
52
52
|
hasNormalizedToPositionLiftedOut = hasNormalizedToPositionLiftedOut || oldTo >= range.from && oldTo < range.to;
|
|
53
53
|
hasNormalizedFromPositionLiftedOut = hasNormalizedFromPositionLiftedOut || oldFrom >= range.from && oldFrom < range.to;
|
|
@@ -168,7 +168,8 @@ var outdentRangeToParentList = function outdentRangeToParentList(_ref2) {
|
|
|
168
168
|
var extractListItemsRangeFromList = function extractListItemsRangeFromList(_ref3) {
|
|
169
169
|
var tr = _ref3.tr,
|
|
170
170
|
range = _ref3.range,
|
|
171
|
-
state = _ref3.state
|
|
171
|
+
state = _ref3.state,
|
|
172
|
+
featureFlags = _ref3.featureFlags;
|
|
172
173
|
var list = range.parent;
|
|
173
174
|
var $start = tr.doc.resolve(range.start);
|
|
174
175
|
var listStart = $start.start(range.depth);
|
|
@@ -190,7 +191,6 @@ var extractListItemsRangeFromList = function extractListItemsRangeFromList(_ref3
|
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
193
|
var nextList = list.copy(Fragment.empty);
|
|
193
|
-
var featureFlags = getFeatureFlags(state);
|
|
194
194
|
var nextListStartNumber;
|
|
195
195
|
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists) {
|
|
196
196
|
// if splitting a numbered list, keep the splitted item
|
|
@@ -21,36 +21,40 @@ import { outdentList } from './outdent-list';
|
|
|
21
21
|
import { indentList } from './indent-list';
|
|
22
22
|
import { moveTargetIntoList } from '../utils/replace-content';
|
|
23
23
|
export { outdentList, indentList };
|
|
24
|
-
export var enterKeyCommand = function enterKeyCommand(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
export var enterKeyCommand = function enterKeyCommand(featureFlags) {
|
|
25
|
+
return function (state, dispatch) {
|
|
26
|
+
var selection = state.selection;
|
|
27
|
+
if (selection.empty) {
|
|
28
|
+
var $from = selection.$from;
|
|
29
|
+
var _state$schema$nodes = state.schema.nodes,
|
|
30
|
+
listItem = _state$schema$nodes.listItem,
|
|
31
|
+
codeBlock = _state$schema$nodes.codeBlock;
|
|
32
|
+
var wrapper = $from.node($from.depth - 1);
|
|
33
|
+
if (wrapper && wrapper.type === listItem) {
|
|
34
|
+
/** Check if the wrapper has any visible content */
|
|
35
|
+
var wrapperHasContent = hasVisibleContent(wrapper);
|
|
36
|
+
if (!wrapperHasContent) {
|
|
37
|
+
return outdentList(INPUT_METHOD.KEYBOARD, featureFlags)(state, dispatch);
|
|
38
|
+
} else if (!hasParentNodeOfType(codeBlock)(selection)) {
|
|
39
|
+
return splitListItem(listItem)(state, dispatch);
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
return false;
|
|
44
|
+
};
|
|
43
45
|
};
|
|
44
|
-
export var backspaceKeyCommand = function backspaceKeyCommand(
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
export var backspaceKeyCommand = function backspaceKeyCommand(featureFlags) {
|
|
47
|
+
return function (state, dispatch) {
|
|
48
|
+
return baseCommand.chainCommands(listBackspace,
|
|
49
|
+
// if we're at the start of a list item, we need to either backspace
|
|
50
|
+
// directly to an empty list item above, or outdent this node
|
|
51
|
+
filter([isEmptySelectionAtStart,
|
|
52
|
+
// list items might have multiple paragraphs; only do this at the first one
|
|
53
|
+
isFirstChildOfParent, isInsideListItem], baseCommand.chainCommands(deletePreviousEmptyListItem, outdentList(INPUT_METHOD.KEYBOARD, featureFlags))),
|
|
54
|
+
// if we're just inside a paragraph node (or gapcursor is shown) and backspace, then try to join
|
|
55
|
+
// the text to the previous list item, if one exists
|
|
56
|
+
filter([isEmptySelectionAtStart, canJoinToPreviousListItem], joinToPreviousListItem))(state, dispatch);
|
|
57
|
+
};
|
|
54
58
|
};
|
|
55
59
|
export var deleteKeyCommand = joinListItemForward;
|
|
56
60
|
|
|
@@ -9,9 +9,9 @@ import { findFirstParentListNode } from '../utils/find';
|
|
|
9
9
|
import { getCommonListAnalyticsAttributes, getRestartListsAttributes } from '../utils/analytics';
|
|
10
10
|
import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
|
|
11
11
|
import { closeHistory } from 'prosemirror-history';
|
|
12
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
13
12
|
export function outdentList() {
|
|
14
13
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
14
|
+
var featureFlags = arguments.length > 1 ? arguments[1] : undefined;
|
|
15
15
|
return function (state, dispatch) {
|
|
16
16
|
if (!isInsideListItem(state)) {
|
|
17
17
|
return false;
|
|
@@ -27,13 +27,12 @@ export function outdentList() {
|
|
|
27
27
|
closeHistory(state.tr);
|
|
28
28
|
var actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
29
29
|
var customTr = state.tr;
|
|
30
|
-
outdentListAction(customTr, state);
|
|
30
|
+
outdentListAction(customTr, state, featureFlags);
|
|
31
31
|
if (!customTr || !customTr.docChanged) {
|
|
32
32
|
// 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
|
|
33
33
|
// If inside table cell and can't outdent list, then let it handle by table keymap
|
|
34
34
|
return !isInsideTableCell(state);
|
|
35
35
|
}
|
|
36
|
-
var featureFlags = getFeatureFlags(state);
|
|
37
36
|
var restartListsAttributes = {};
|
|
38
37
|
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists) {
|
|
39
38
|
var _getRestartListsAttri = getRestartListsAttributes(customTr),
|
|
@@ -11,7 +11,8 @@ 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
|
-
var listPlugin = function listPlugin(options) {
|
|
14
|
+
var listPlugin = function listPlugin(options, api) {
|
|
15
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
|
|
15
16
|
return {
|
|
16
17
|
name: 'list',
|
|
17
18
|
nodes: function nodes() {
|
|
@@ -31,7 +32,7 @@ var listPlugin = function listPlugin(options) {
|
|
|
31
32
|
name: 'list',
|
|
32
33
|
plugin: function plugin(_ref) {
|
|
33
34
|
var dispatch = _ref.dispatch;
|
|
34
|
-
return createPlugin(dispatch);
|
|
35
|
+
return createPlugin(dispatch, featureFlags);
|
|
35
36
|
}
|
|
36
37
|
}, {
|
|
37
38
|
name: 'listInputRule',
|
|
@@ -43,7 +44,7 @@ var listPlugin = function listPlugin(options) {
|
|
|
43
44
|
}, {
|
|
44
45
|
name: 'listKeymap',
|
|
45
46
|
plugin: function plugin() {
|
|
46
|
-
return keymapPlugin();
|
|
47
|
+
return keymapPlugin(featureFlags);
|
|
47
48
|
}
|
|
48
49
|
}];
|
|
49
50
|
},
|
|
@@ -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
|
var getOrder = function getOrder(matchResult) {
|
|
@@ -45,6 +46,7 @@ export function createRuleForListType(_ref) {
|
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
48
|
var inputRule = createWrappingJoinRule({
|
|
49
|
+
featureFlags: featureFlags,
|
|
48
50
|
match: expression,
|
|
49
51
|
nodeType: listType,
|
|
50
52
|
getAttrs: getAttrs,
|
|
@@ -11,7 +11,8 @@ export default function inputRulePlugin(schema, featureFlags) {
|
|
|
11
11
|
// because of issue where product converted the
|
|
12
12
|
// character into an escaped version.
|
|
13
13
|
expression: /^\s*([\*\-\u2022]) $/,
|
|
14
|
-
listType: bulletList
|
|
14
|
+
listType: bulletList,
|
|
15
|
+
featureFlags: featureFlags
|
|
15
16
|
}));
|
|
16
17
|
}
|
|
17
18
|
var expression = featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists ? /((^[1-9]{1}[0-9]{0,2})|^(0))[\.\)] $/ : /^(1)[\.\)] $/;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 var createWrappingJoinRule = function createWrappingJoinRule(_ref) {
|
|
6
|
+
var match = _ref.match,
|
|
7
|
+
nodeType = _ref.nodeType,
|
|
8
|
+
getAttrs = _ref.getAttrs,
|
|
9
|
+
joinPredicate = _ref.joinPredicate,
|
|
10
|
+
featureFlags = _ref.featureFlags;
|
|
11
|
+
var handler = function handler(state, match, start, end) {
|
|
12
|
+
var attrs = (getAttrs instanceof Function ? getAttrs(match) : getAttrs) || {};
|
|
13
|
+
var tr = state.tr;
|
|
14
|
+
var fixedStart = Math.max(start, 1);
|
|
15
|
+
tr.delete(fixedStart, end);
|
|
16
|
+
var $start = tr.doc.resolve(fixedStart);
|
|
17
|
+
var range = $start.blockRange();
|
|
18
|
+
var wrapping = range && findWrapping(range, nodeType, attrs);
|
|
19
|
+
if (!wrapping || !range) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
var parentNodePosMapped = tr.mapping.map(range.start);
|
|
23
|
+
var parentNode = tr.doc.nodeAt(parentNodePosMapped);
|
|
24
|
+
var lastWrap = wrapping[wrapping.length - 1];
|
|
25
|
+
if (parentNode && lastWrap) {
|
|
26
|
+
var allowedMarks = lastWrap.type.allowedMarks(parentNode.marks) || [];
|
|
27
|
+
tr.setNodeMarkup(parentNodePosMapped, parentNode.type, parentNode.attrs, allowedMarks);
|
|
28
|
+
}
|
|
29
|
+
tr.wrap(range, wrapping);
|
|
30
|
+
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && nodeType === state.schema.nodes.orderedList) {
|
|
31
|
+
// if an orderedList node would be inserted by the input rule match, and
|
|
32
|
+
// that orderedList node is being added directly before another orderedList
|
|
33
|
+
// node, then join those nodes
|
|
34
|
+
var $end = tr.doc.resolve(tr.mapping.map(end));
|
|
35
|
+
var _node = findParentNodeOfTypeClosestToPos($end, nodeType);
|
|
36
|
+
if (_node) {
|
|
37
|
+
var nodeEnd = _node.pos + _node.node.nodeSize;
|
|
38
|
+
var after = tr.doc.resolve(nodeEnd).nodeAfter;
|
|
39
|
+
if (after && after.type === nodeType && canJoin(tr.doc, nodeEnd) && (!joinPredicate || joinPredicate(match, after, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_BELOW))) {
|
|
40
|
+
tr.join(nodeEnd);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var before = tr.doc.resolve(fixedStart - 1).nodeBefore;
|
|
45
|
+
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))) {
|
|
46
|
+
tr.join(fixedStart - 1);
|
|
47
|
+
}
|
|
48
|
+
return tr;
|
|
49
|
+
};
|
|
50
|
+
return createRule(match, handler);
|
|
51
|
+
};
|
|
@@ -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
|
var 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
|
|
@@ -12,7 +12,6 @@ import { setGapCursorSelection } from '../../../utils';
|
|
|
12
12
|
import { Side } from '../../selection/gap-cursor-selection';
|
|
13
13
|
import { listItemCounterPadding, CodeBlockSharedCssClassName, getOrderedListInlineStyles } from '@atlaskit/editor-common/styles';
|
|
14
14
|
import { getItemCounterDigitsSize } from '@atlaskit/editor-common/utils';
|
|
15
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
16
15
|
var listPluginKey = new PluginKey('listPlugin');
|
|
17
16
|
export var pluginKey = listPluginKey;
|
|
18
17
|
var initialState = {
|
|
@@ -22,9 +21,8 @@ var initialState = {
|
|
|
22
21
|
orderedListDisabled: false,
|
|
23
22
|
decorationSet: DecorationSet.empty
|
|
24
23
|
};
|
|
25
|
-
export var getDecorations = function getDecorations(doc, state) {
|
|
24
|
+
export var getDecorations = function getDecorations(doc, state, featureFlags) {
|
|
26
25
|
var decorations = [];
|
|
27
|
-
var featureFlags = getFeatureFlags(state);
|
|
28
26
|
|
|
29
27
|
// this stack keeps track of each (nested) list to calculate the indentation level
|
|
30
28
|
var processedListsStack = [];
|
|
@@ -77,12 +75,14 @@ export var getDecorations = function getDecorations(doc, state) {
|
|
|
77
75
|
});
|
|
78
76
|
return DecorationSet.empty.add(doc, decorations);
|
|
79
77
|
};
|
|
80
|
-
var handleDocChanged = function handleDocChanged(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
var handleDocChanged = function handleDocChanged(featureFlags) {
|
|
79
|
+
return function (tr, pluginState, editorState) {
|
|
80
|
+
var nextPluginState = handleSelectionChanged(tr, pluginState);
|
|
81
|
+
var decorationSet = getDecorations(tr.doc, editorState, featureFlags);
|
|
82
|
+
return _objectSpread(_objectSpread({}, nextPluginState), {}, {
|
|
83
|
+
decorationSet: decorationSet
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
86
|
};
|
|
87
87
|
var handleSelectionChanged = function handleSelectionChanged(tr, pluginState) {
|
|
88
88
|
var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
|
|
@@ -109,20 +109,22 @@ var reducer = function reducer() {
|
|
|
109
109
|
return state;
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var createInitialState = function createInitialState(state) {
|
|
119
|
-
return _objectSpread(_objectSpread({}, initialState), {}, {
|
|
120
|
-
decorationSet: getDecorations(state.doc, state)
|
|
121
|
-
});
|
|
112
|
+
var createInitialState = function createInitialState(featureFlags) {
|
|
113
|
+
return function (state) {
|
|
114
|
+
return _objectSpread(_objectSpread({}, initialState), {}, {
|
|
115
|
+
decorationSet: getDecorations(state.doc, state, featureFlags)
|
|
116
|
+
});
|
|
117
|
+
};
|
|
122
118
|
};
|
|
123
|
-
export var createPlugin = function createPlugin(eventDispatch) {
|
|
119
|
+
export var createPlugin = function createPlugin(eventDispatch, featureFlags) {
|
|
120
|
+
var _pluginFactory = pluginFactory(listPluginKey, reducer(), {
|
|
121
|
+
onDocChanged: handleDocChanged(featureFlags),
|
|
122
|
+
onSelectionChanged: handleSelectionChanged
|
|
123
|
+
}),
|
|
124
|
+
getPluginState = _pluginFactory.getPluginState,
|
|
125
|
+
createPluginState = _pluginFactory.createPluginState;
|
|
124
126
|
return new SafePlugin({
|
|
125
|
-
state: createPluginState(eventDispatch, createInitialState),
|
|
127
|
+
state: createPluginState(eventDispatch, createInitialState(featureFlags)),
|
|
126
128
|
key: listPluginKey,
|
|
127
129
|
props: {
|
|
128
130
|
decorations: function decorations(state) {
|
|
@@ -156,6 +156,9 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
156
156
|
isLoading = _this$props.isLoading,
|
|
157
157
|
maxDimensions = _this$props.maxDimensions,
|
|
158
158
|
mediaOptions = _this$props.mediaOptions;
|
|
159
|
+
var borderMark = node.marks.find(function (m) {
|
|
160
|
+
return m.type.name === 'border';
|
|
161
|
+
});
|
|
159
162
|
var _this$state = this.state,
|
|
160
163
|
viewMediaClientConfig = _this$state.viewMediaClientConfig,
|
|
161
164
|
contextIdentifierProvider = _this$state.contextIdentifierProvider;
|
|
@@ -191,7 +194,9 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
191
194
|
};
|
|
192
195
|
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
193
196
|
dimensions: originalDimensions,
|
|
194
|
-
onContextMenu: this.selectMediaSingle
|
|
197
|
+
onContextMenu: this.selectMediaSingle,
|
|
198
|
+
borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
199
|
+
selected: selected
|
|
195
200
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
196
201
|
mediaClientConfig: mediaClientConfig,
|
|
197
202
|
resizeMode: "stretchy-fit",
|
|
@@ -11,8 +11,20 @@ var forcedDimensions = css(_templateObject3 || (_templateObject3 = _taggedTempla
|
|
|
11
11
|
export var MediaCardWrapper = function MediaCardWrapper(_ref) {
|
|
12
12
|
var dimensions = _ref.dimensions,
|
|
13
13
|
children = _ref.children,
|
|
14
|
+
selected = _ref.selected,
|
|
15
|
+
_ref$borderWidth = _ref.borderWidth,
|
|
16
|
+
borderWidth = _ref$borderWidth === void 0 ? 0 : _ref$borderWidth,
|
|
14
17
|
onContextMenu = _ref.onContextMenu;
|
|
18
|
+
var calculatedBorderWidth = selected && borderWidth > 0 ? borderWidth + 1 : borderWidth;
|
|
15
19
|
return jsx("div", {
|
|
20
|
+
"data-testid": "media-card-wrapper",
|
|
21
|
+
style: {
|
|
22
|
+
borderColor: "var(--custom-palette-color)",
|
|
23
|
+
borderWidth: "".concat(calculatedBorderWidth, "px"),
|
|
24
|
+
borderStyle: 'solid',
|
|
25
|
+
borderRadius: "".concat(calculatedBorderWidth * 2, "px")
|
|
26
|
+
}
|
|
27
|
+
}, jsx("div", {
|
|
16
28
|
css: forcedDimensions,
|
|
17
29
|
style: {
|
|
18
30
|
paddingBottom: "".concat(dimensions.height / dimensions.width * 100, "%")
|
|
@@ -20,5 +32,5 @@ export var MediaCardWrapper = function MediaCardWrapper(_ref) {
|
|
|
20
32
|
onContextMenuCapture: onContextMenu
|
|
21
33
|
}, jsx("div", {
|
|
22
34
|
css: absoluteDiv
|
|
23
|
-
}, children));
|
|
35
|
+
}, children)));
|
|
24
36
|
};
|