@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
|
@@ -3,10 +3,9 @@ import { isPerformanceAPIAvailable, measureRender } from '@atlaskit/editor-commo
|
|
|
3
3
|
import { ACTION, EVENT_TYPE } from './types';
|
|
4
4
|
import { analyticsPluginKey } from './plugin-key';
|
|
5
5
|
import { fireAnalyticsEvent, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
7
6
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
8
7
|
import { generateUndoRedoInputSoucePayload } from '../undo-redo/undo-redo-input-source';
|
|
9
|
-
function createPlugin(options) {
|
|
8
|
+
function createPlugin(options, featureFlags) {
|
|
10
9
|
if (!options || !options.createAnalyticsEvent) {
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
@@ -21,7 +20,6 @@ function createPlugin(options) {
|
|
|
21
20
|
};
|
|
22
21
|
},
|
|
23
22
|
apply: (tr, pluginState, _, state) => {
|
|
24
|
-
var _getFeatureFlags;
|
|
25
23
|
if (pluginState.createAnalyticsEvent !== options.createAnalyticsEvent) {
|
|
26
24
|
// When the plugin state is reconfigured, the init function isn't called again
|
|
27
25
|
return {
|
|
@@ -29,7 +27,7 @@ function createPlugin(options) {
|
|
|
29
27
|
createAnalyticsEvent: options.createAnalyticsEvent
|
|
30
28
|
};
|
|
31
29
|
}
|
|
32
|
-
if (
|
|
30
|
+
if (featureFlags.catchAllTracking) {
|
|
33
31
|
const analyticsEventWithChannel = getAnalyticsEventsFromTransaction(tr);
|
|
34
32
|
if (analyticsEventWithChannel.length > 0) {
|
|
35
33
|
for (const {
|
|
@@ -66,47 +64,51 @@ function createPlugin(options) {
|
|
|
66
64
|
}
|
|
67
65
|
});
|
|
68
66
|
}
|
|
69
|
-
const analyticsPlugin = options =>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
fireAnalyticsEvent(createAnalyticsEvent)({
|
|
104
|
-
payload: nextPayload,
|
|
67
|
+
const analyticsPlugin = (options, api) => {
|
|
68
|
+
var _api$dependencies$fea;
|
|
69
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies$fea = api.dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
70
|
+
return {
|
|
71
|
+
name: 'analytics',
|
|
72
|
+
pmPlugins() {
|
|
73
|
+
return [{
|
|
74
|
+
name: 'analyticsPlugin',
|
|
75
|
+
plugin: () => createPlugin(options, featureFlags)
|
|
76
|
+
}];
|
|
77
|
+
},
|
|
78
|
+
onEditorViewStateUpdated({
|
|
79
|
+
originalTransaction,
|
|
80
|
+
transactions,
|
|
81
|
+
newEditorState
|
|
82
|
+
}) {
|
|
83
|
+
const pluginState = analyticsPluginKey.getState(newEditorState);
|
|
84
|
+
if (!pluginState || !pluginState.createAnalyticsEvent) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const steps = transactions.reduce((acc, tr) => {
|
|
88
|
+
const payloads = tr.steps.filter(step => step instanceof AnalyticsStep).map(x => x.analyticsEvents).reduce((acc, val) => acc.concat(val), []);
|
|
89
|
+
acc.push(...payloads);
|
|
90
|
+
return acc;
|
|
91
|
+
}, []);
|
|
92
|
+
if (steps.length === 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const {
|
|
96
|
+
createAnalyticsEvent
|
|
97
|
+
} = pluginState;
|
|
98
|
+
const undoAnaltyicsEventTransformer = generateUndoRedoInputSoucePayload(originalTransaction);
|
|
99
|
+
steps.forEach(({
|
|
100
|
+
payload,
|
|
105
101
|
channel
|
|
102
|
+
}) => {
|
|
103
|
+
const nextPayload = undoAnaltyicsEventTransformer(payload);
|
|
104
|
+
fireAnalyticsEvent(createAnalyticsEvent)({
|
|
105
|
+
payload: nextPayload,
|
|
106
|
+
channel
|
|
107
|
+
});
|
|
106
108
|
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
};
|
|
110
112
|
export function extendPayload({
|
|
111
113
|
payload,
|
|
112
114
|
duration,
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import AvatarGroupPluginWrapper from './ui/AvatarGroupPluginWrapper';
|
|
3
|
-
const avatarGroup = props =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
dispatchAnalyticsEvent
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
const avatarGroup = (props, api) => {
|
|
4
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
5
|
+
const 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()) || {};
|
|
6
|
+
return {
|
|
7
|
+
name: 'avatarGroup',
|
|
8
|
+
primaryToolbarComponent({
|
|
9
|
+
editorView,
|
|
10
|
+
popupsMountPoint,
|
|
11
|
+
popupsBoundariesElement,
|
|
12
|
+
popupsScrollableElement,
|
|
13
|
+
disabled,
|
|
14
|
+
isToolbarReducedSpacing,
|
|
15
|
+
eventDispatcher,
|
|
16
|
+
dispatchAnalyticsEvent
|
|
17
|
+
}) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(AvatarGroupPluginWrapper, {
|
|
19
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
20
|
+
editorView: editorView,
|
|
21
|
+
eventDispatcher: eventDispatcher,
|
|
22
|
+
collabEdit: props.collabEdit,
|
|
23
|
+
takeFullWidth: props.takeFullWidth,
|
|
24
|
+
featureFlags: featureFlags
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
24
29
|
export default avatarGroup;
|
|
@@ -20,7 +20,8 @@ const toolbarButtonWrapperFullWidth = css`
|
|
|
20
20
|
`;
|
|
21
21
|
const AvatarGroupPluginWrapper = props => {
|
|
22
22
|
const {
|
|
23
|
-
dispatchAnalyticsEvent
|
|
23
|
+
dispatchAnalyticsEvent,
|
|
24
|
+
featureFlags
|
|
24
25
|
} = props;
|
|
25
26
|
const intl = useIntl();
|
|
26
27
|
useEffect(() => {
|
|
@@ -43,7 +44,8 @@ const AvatarGroupPluginWrapper = props => {
|
|
|
43
44
|
eventDispatcher: props.eventDispatcher,
|
|
44
45
|
inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
|
|
45
46
|
inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
|
|
46
|
-
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected
|
|
47
|
+
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected,
|
|
48
|
+
featureFlags: featureFlags
|
|
47
49
|
}));
|
|
48
50
|
};
|
|
49
51
|
export default AvatarGroupPluginWrapper;
|
|
@@ -18,108 +18,112 @@ import frozenEditor from './pm-plugins/frozen-editor';
|
|
|
18
18
|
import compositionPlugin from './pm-plugins/composition';
|
|
19
19
|
// Chrome >= 88
|
|
20
20
|
export const isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
|
|
21
|
-
const basePlugin = options =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
const basePlugin = (options, api) => {
|
|
22
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
23
|
+
const 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()) || {};
|
|
24
|
+
return {
|
|
25
|
+
name: 'base',
|
|
26
|
+
pmPlugins() {
|
|
27
|
+
const plugins = [{
|
|
28
|
+
name: 'filterStepsPlugin',
|
|
29
|
+
plugin: ({
|
|
30
|
+
dispatchAnalyticsEvent
|
|
31
|
+
}) => filterStepsPlugin(dispatchAnalyticsEvent)
|
|
32
|
+
}];
|
|
30
33
|
|
|
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
|
-
|
|
34
|
+
// In Chrome, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
35
|
+
// the cursor appears at the right most point of the parent container.
|
|
36
|
+
// In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
37
|
+
// no cursor is presented to users.
|
|
38
|
+
// In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
39
|
+
// it is not possible to navigate with arrow keys.
|
|
40
|
+
// This plugin works around the issues by inserting decorations between
|
|
41
|
+
// inline nodes which are set as contenteditable, and have a zero width space.
|
|
42
|
+
plugins.push({
|
|
43
|
+
name: 'inlineCursorTargetPlugin',
|
|
44
|
+
plugin: () => options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined
|
|
45
|
+
});
|
|
46
|
+
plugins.push({
|
|
47
|
+
name: 'focusHandlerPlugin',
|
|
48
|
+
plugin: ({
|
|
49
|
+
dispatch
|
|
50
|
+
}) => focusHandlerPlugin(dispatch)
|
|
51
|
+
}, {
|
|
52
|
+
name: 'newlinePreserveMarksPlugin',
|
|
53
|
+
plugin: newlinePreserveMarksPlugin
|
|
54
|
+
}, {
|
|
55
|
+
name: 'reactNodeView',
|
|
56
|
+
plugin: () => reactNodeView
|
|
57
|
+
}, {
|
|
58
|
+
name: 'frozenEditor',
|
|
59
|
+
plugin: ({
|
|
60
|
+
dispatchAnalyticsEvent
|
|
61
|
+
}) => {
|
|
62
|
+
var _options$inputTrackin;
|
|
63
|
+
return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
name: 'decorationPlugin',
|
|
67
|
+
plugin: () => decorationPlugin()
|
|
68
|
+
}, {
|
|
69
|
+
name: 'history',
|
|
70
|
+
plugin: () => history()
|
|
71
|
+
},
|
|
72
|
+
// should be last :(
|
|
73
|
+
{
|
|
74
|
+
name: 'codeBlockIndent',
|
|
75
|
+
plugin: () => keymap({
|
|
76
|
+
...baseKeymap,
|
|
77
|
+
'Mod-[': () => true,
|
|
78
|
+
'Mod-]': () => true
|
|
79
|
+
})
|
|
80
|
+
}, {
|
|
81
|
+
name: 'contextIdentifier',
|
|
82
|
+
plugin: ({
|
|
83
|
+
dispatch,
|
|
84
|
+
providerFactory
|
|
85
|
+
}) => contextIdentifierPlugin(dispatch, providerFactory)
|
|
86
|
+
}, {
|
|
87
|
+
name: 'betterTypeHistory',
|
|
88
|
+
plugin: ({
|
|
89
|
+
dispatch,
|
|
90
|
+
providerFactory
|
|
91
|
+
}) => betterTypeHistoryPlugin()
|
|
92
|
+
});
|
|
93
|
+
if (options && options.allowScrollGutter) {
|
|
94
|
+
plugins.push({
|
|
95
|
+
name: 'scrollGutterPlugin',
|
|
96
|
+
plugin: () => scrollGutter(options.allowScrollGutter)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (isChromeWithSelectionBug) {
|
|
100
|
+
plugins.push({
|
|
101
|
+
name: 'fixChrome88SelectionPlugin',
|
|
102
|
+
plugin: () => fixChrome88SelectionPlugin()
|
|
103
|
+
});
|
|
61
104
|
}
|
|
62
|
-
}, {
|
|
63
|
-
name: 'decorationPlugin',
|
|
64
|
-
plugin: () => decorationPlugin()
|
|
65
|
-
}, {
|
|
66
|
-
name: 'history',
|
|
67
|
-
plugin: () => history()
|
|
68
|
-
},
|
|
69
|
-
// should be last :(
|
|
70
|
-
{
|
|
71
|
-
name: 'codeBlockIndent',
|
|
72
|
-
plugin: () => keymap({
|
|
73
|
-
...baseKeymap,
|
|
74
|
-
'Mod-[': () => true,
|
|
75
|
-
'Mod-]': () => true
|
|
76
|
-
})
|
|
77
|
-
}, {
|
|
78
|
-
name: 'contextIdentifier',
|
|
79
|
-
plugin: ({
|
|
80
|
-
dispatch,
|
|
81
|
-
providerFactory
|
|
82
|
-
}) => contextIdentifierPlugin(dispatch, providerFactory)
|
|
83
|
-
}, {
|
|
84
|
-
name: 'betterTypeHistory',
|
|
85
|
-
plugin: ({
|
|
86
|
-
dispatch,
|
|
87
|
-
providerFactory
|
|
88
|
-
}) => betterTypeHistoryPlugin()
|
|
89
|
-
});
|
|
90
|
-
if (options && options.allowScrollGutter) {
|
|
91
105
|
plugins.push({
|
|
92
|
-
name: '
|
|
93
|
-
plugin: () =>
|
|
106
|
+
name: 'disableSpellcheckingPlugin',
|
|
107
|
+
plugin: () => disableSpellcheckingPlugin(featureFlags)
|
|
94
108
|
});
|
|
95
|
-
}
|
|
96
|
-
if (isChromeWithSelectionBug) {
|
|
97
109
|
plugins.push({
|
|
98
|
-
name: '
|
|
99
|
-
plugin: () =>
|
|
110
|
+
name: 'compositionPlugin',
|
|
111
|
+
plugin: () => compositionPlugin()
|
|
100
112
|
});
|
|
113
|
+
return plugins;
|
|
114
|
+
},
|
|
115
|
+
nodes() {
|
|
116
|
+
return [{
|
|
117
|
+
name: 'doc',
|
|
118
|
+
node: doc
|
|
119
|
+
}, {
|
|
120
|
+
name: 'paragraph',
|
|
121
|
+
node: paragraph
|
|
122
|
+
}, {
|
|
123
|
+
name: 'text',
|
|
124
|
+
node: text
|
|
125
|
+
}];
|
|
101
126
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
plugin: () => disableSpellcheckingPlugin()
|
|
105
|
-
});
|
|
106
|
-
plugins.push({
|
|
107
|
-
name: 'compositionPlugin',
|
|
108
|
-
plugin: () => compositionPlugin()
|
|
109
|
-
});
|
|
110
|
-
return plugins;
|
|
111
|
-
},
|
|
112
|
-
nodes() {
|
|
113
|
-
return [{
|
|
114
|
-
name: 'doc',
|
|
115
|
-
node: doc
|
|
116
|
-
}, {
|
|
117
|
-
name: 'paragraph',
|
|
118
|
-
node: paragraph
|
|
119
|
-
}, {
|
|
120
|
-
name: 'text',
|
|
121
|
-
node: text
|
|
122
|
-
}];
|
|
123
|
-
}
|
|
124
|
-
});
|
|
127
|
+
};
|
|
128
|
+
};
|
|
125
129
|
export default basePlugin;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
4
3
|
import { browser as browserEnv } from '@atlaskit/editor-common/utils';
|
|
5
4
|
function getCurrentBrowserAndVersion() {
|
|
6
5
|
switch (true) {
|
|
@@ -27,11 +26,10 @@ function getCurrentBrowserAndVersion() {
|
|
|
27
26
|
}
|
|
28
27
|
return undefined;
|
|
29
28
|
}
|
|
30
|
-
export default (
|
|
29
|
+
export default (featureFlags => new SafePlugin({
|
|
31
30
|
key: new PluginKey('disableSpellchecking'),
|
|
32
31
|
props: {
|
|
33
32
|
attributes: editorState => {
|
|
34
|
-
const featureFlags = getFeatureFlags(editorState) || undefined;
|
|
35
33
|
if (!featureFlags) {
|
|
36
34
|
return;
|
|
37
35
|
}
|
|
@@ -38,10 +38,5 @@ export const BlockTypeButton = props => {
|
|
|
38
38
|
})))
|
|
39
39
|
}, !props.isSmall && jsx("span", {
|
|
40
40
|
css: [buttonContentStyle, props.isReducedSpacing && buttonContentReducedSpacingStyle]
|
|
41
|
-
}, jsx(FormattedMessage, props.title || NORMAL_TEXT.title)
|
|
42
|
-
style: {
|
|
43
|
-
overflow: 'hidden',
|
|
44
|
-
height: 0
|
|
45
|
-
}
|
|
46
|
-
}, props.children)));
|
|
41
|
+
}, jsx(FormattedMessage, props.title || NORMAL_TEXT.title)));
|
|
47
42
|
};
|
|
@@ -6,7 +6,6 @@ import { injectIntl } from 'react-intl-next';
|
|
|
6
6
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import DropdownMenu from '../../../../ui/DropdownMenu';
|
|
8
8
|
import { separatorStyles, wrapperStyle } from '../../../../ui/styles';
|
|
9
|
-
import { NORMAL_TEXT } from '../../types';
|
|
10
9
|
import { blockTypeMenuItemStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
|
|
11
10
|
import { tooltip, findKeymapByDescription } from '../../../../keymaps';
|
|
12
11
|
import { BlockTypeButton } from './blocktype-button';
|
|
@@ -113,10 +112,6 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
113
112
|
return null;
|
|
114
113
|
}
|
|
115
114
|
const blockTypeTitles = availableBlockTypes.filter(blockType => blockType.name === currentBlockType.name).map(blockType => blockType.title);
|
|
116
|
-
const longestDropdownMenuItem = [NORMAL_TEXT, ...availableBlockTypes].reduce((longest, item) => {
|
|
117
|
-
const itemTitle = formatMessage(item.title);
|
|
118
|
-
return itemTitle.length >= longest.length ? itemTitle : longest;
|
|
119
|
-
}, '');
|
|
120
115
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
|
121
116
|
const items = this.createItems();
|
|
122
117
|
return jsx("span", {
|
|
@@ -152,7 +147,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
152
147
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
153
148
|
formatMessage: formatMessage,
|
|
154
149
|
"aria-expanded": active
|
|
155
|
-
}
|
|
150
|
+
})), jsx("span", {
|
|
156
151
|
css: separatorStyles
|
|
157
152
|
}));
|
|
158
153
|
}
|
|
@@ -168,7 +163,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
168
163
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
169
164
|
formatMessage: formatMessage,
|
|
170
165
|
"aria-expanded": active
|
|
171
|
-
}
|
|
166
|
+
}), jsx("span", {
|
|
172
167
|
css: separatorStyles
|
|
173
168
|
}));
|
|
174
169
|
}
|
|
@@ -4,7 +4,9 @@ import { createPlugin } from './pm-plugins/main';
|
|
|
4
4
|
import { floatingToolbar } from './toolbar';
|
|
5
5
|
import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
|
|
6
6
|
import { cardKeymap } from './pm-plugins/keymap';
|
|
7
|
-
const cardPlugin = options => {
|
|
7
|
+
const cardPlugin = (options, api) => {
|
|
8
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
9
|
+
const 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()) || {};
|
|
8
10
|
return {
|
|
9
11
|
name: 'card',
|
|
10
12
|
nodes() {
|
|
@@ -55,7 +57,7 @@ const cardPlugin = options => {
|
|
|
55
57
|
});
|
|
56
58
|
},
|
|
57
59
|
pluginsOptions: {
|
|
58
|
-
floatingToolbar: floatingToolbar(options, options.platform, options.linkPicker)
|
|
60
|
+
floatingToolbar: floatingToolbar(options, featureFlags, options.platform, options.linkPicker)
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
};
|
|
@@ -20,7 +20,6 @@ import { messages } from './messages';
|
|
|
20
20
|
import buildLayoutButtons from '../../ui/MediaAndEmbedsToolbar';
|
|
21
21
|
import { buildOpenedSettingsPayload, buildVisitedLinkPayload } from '../../utils/linking-utils';
|
|
22
22
|
import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME } from './styles';
|
|
23
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
24
23
|
export const removeCard = (state, dispatch) => {
|
|
25
24
|
if (!(state.selection instanceof NodeSelection)) {
|
|
26
25
|
return false;
|
|
@@ -73,9 +72,8 @@ export const openLinkSettings = (state, dispatch) => {
|
|
|
73
72
|
}
|
|
74
73
|
return true;
|
|
75
74
|
};
|
|
76
|
-
export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
|
|
75
|
+
export const floatingToolbar = (cardOptions, featureFlags, platform, linkPickerOptions) => {
|
|
77
76
|
return (state, intl, providerFactory) => {
|
|
78
|
-
var _linkPickerOptions$pl;
|
|
79
77
|
const {
|
|
80
78
|
inlineCard,
|
|
81
79
|
blockCard,
|
|
@@ -107,9 +105,9 @@ export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
|
|
|
107
105
|
lpLinkPicker,
|
|
108
106
|
lpLinkPickerFocusTrap,
|
|
109
107
|
preventPopupOverflow
|
|
110
|
-
} =
|
|
108
|
+
} = featureFlags;
|
|
111
109
|
const shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
112
|
-
const isLinkPickerEnabled = !!lpLinkPicker
|
|
110
|
+
const isLinkPickerEnabled = !!lpLinkPicker;
|
|
113
111
|
return {
|
|
114
112
|
title: intl.formatMessage(messages.card),
|
|
115
113
|
className,
|
|
@@ -126,7 +124,7 @@ export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
|
|
|
126
124
|
}
|
|
127
125
|
return element;
|
|
128
126
|
},
|
|
129
|
-
items: generateToolbarItems(state, intl, providerFactory, cardOptions, platform, linkPickerOptions),
|
|
127
|
+
items: generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPickerOptions),
|
|
130
128
|
scrollable: pluginState.showLinkingToolbar ? false : true,
|
|
131
129
|
focusTrap: shouldEnableFocusTrap && pluginState.showLinkingToolbar,
|
|
132
130
|
...editLinkToolbarConfig(pluginState.showLinkingToolbar, isLinkPickerEnabled)
|
|
@@ -144,7 +142,7 @@ const unlinkCard = (node, state) => {
|
|
|
144
142
|
const buildAlignmentOptions = (state, intl) => {
|
|
145
143
|
return buildLayoutButtons(state, intl, state.schema.nodes.embedCard, true, true);
|
|
146
144
|
};
|
|
147
|
-
const generateToolbarItems = (state, intl, providerFactory, cardOptions, platform, linkPicker) => node => {
|
|
145
|
+
const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker) => node => {
|
|
148
146
|
const {
|
|
149
147
|
url
|
|
150
148
|
} = titleUrlPairFromNode(node);
|
|
@@ -168,7 +166,8 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, platfor
|
|
|
168
166
|
return [buildEditLinkToolbar({
|
|
169
167
|
providerFactory,
|
|
170
168
|
linkPicker,
|
|
171
|
-
node
|
|
169
|
+
node,
|
|
170
|
+
featureFlags
|
|
172
171
|
})];
|
|
173
172
|
} else {
|
|
174
173
|
const {
|
|
@@ -204,7 +203,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, platfor
|
|
|
204
203
|
}, {
|
|
205
204
|
type: 'separator'
|
|
206
205
|
}]
|
|
207
|
-
}, ...getSettingsButtonGroup(state, intl), {
|
|
206
|
+
}, ...getSettingsButtonGroup(state, featureFlags, intl), {
|
|
208
207
|
id: 'editor.link.delete',
|
|
209
208
|
focusEditoronEnter: true,
|
|
210
209
|
type: 'button',
|
|
@@ -267,10 +266,10 @@ const getUnlinkButtonGroup = (state, intl, node, inlineCard) => {
|
|
|
267
266
|
type: 'separator'
|
|
268
267
|
}] : [];
|
|
269
268
|
};
|
|
270
|
-
const getSettingsButtonGroup = (state, intl) => {
|
|
269
|
+
const getSettingsButtonGroup = (state, featureFlags, intl) => {
|
|
271
270
|
const {
|
|
272
271
|
floatingToolbarLinkSettingsButton
|
|
273
|
-
} =
|
|
272
|
+
} = featureFlags;
|
|
274
273
|
return floatingToolbarLinkSettingsButton === 'true' ? [{
|
|
275
274
|
id: 'editor.link.settings',
|
|
276
275
|
type: 'button',
|
|
@@ -45,6 +45,7 @@ export class EditLinkToolbar extends React.Component {
|
|
|
45
45
|
url,
|
|
46
46
|
text,
|
|
47
47
|
view,
|
|
48
|
+
featureFlags,
|
|
48
49
|
onSubmit
|
|
49
50
|
} = this.props;
|
|
50
51
|
return /*#__PURE__*/React.createElement(HyperLinkToolbarWithListeners, {
|
|
@@ -58,6 +59,7 @@ export class EditLinkToolbar extends React.Component {
|
|
|
58
59
|
// via the floating toolbar
|
|
59
60
|
,
|
|
60
61
|
invokeMethod: INPUT_METHOD.FLOATING_TB,
|
|
62
|
+
featureFlags: featureFlags,
|
|
61
63
|
onSubmit: (href, title, displayText) => {
|
|
62
64
|
this.hideLinkToolbar();
|
|
63
65
|
if (onSubmit) {
|
|
@@ -81,7 +83,8 @@ export const editLink = (state, dispatch) => {
|
|
|
81
83
|
export const buildEditLinkToolbar = ({
|
|
82
84
|
providerFactory,
|
|
83
85
|
node,
|
|
84
|
-
linkPicker
|
|
86
|
+
linkPicker,
|
|
87
|
+
featureFlags
|
|
85
88
|
}) => {
|
|
86
89
|
return {
|
|
87
90
|
type: 'custom',
|
|
@@ -100,6 +103,7 @@ export const buildEditLinkToolbar = ({
|
|
|
100
103
|
url: displayInfo.url,
|
|
101
104
|
text: displayInfo.title || '',
|
|
102
105
|
node: node,
|
|
106
|
+
featureFlags: featureFlags,
|
|
103
107
|
onSubmit: (newHref, newText) => {
|
|
104
108
|
const urlChanged = newHref !== displayInfo.url;
|
|
105
109
|
const titleChanged = newText !== displayInfo.title;
|
|
@@ -118,9 +122,9 @@ export const buildEditLinkToolbar = ({
|
|
|
118
122
|
}
|
|
119
123
|
};
|
|
120
124
|
};
|
|
121
|
-
export const editLinkToolbarConfig = (showLinkingToolbar,
|
|
125
|
+
export const editLinkToolbarConfig = (showLinkingToolbar, lpLinkPicker) => {
|
|
122
126
|
return showLinkingToolbar ? {
|
|
123
|
-
height:
|
|
127
|
+
height: lpLinkPicker ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX,
|
|
124
128
|
width: RECENT_SEARCH_WIDTH_IN_PX,
|
|
125
129
|
forcePlacement: true
|
|
126
130
|
} : {};
|
|
@@ -4,7 +4,7 @@ import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
|
4
4
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
5
5
|
import { removeCodeBlock, changeLanguage, copyContentToClipboard, resetCopiedState } from './actions';
|
|
6
6
|
import commonMessages from '../../messages';
|
|
7
|
-
import {
|
|
7
|
+
import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
9
9
|
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
10
10
|
import { pluginKey } from './plugin-key';
|
|
@@ -61,7 +61,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false) => (state, {
|
|
|
61
61
|
// note: copyContentToClipboard contains logic that also removes the
|
|
62
62
|
// visual feedback for the copy button
|
|
63
63
|
onClick: copyContentToClipboard,
|
|
64
|
-
title: formatMessage(codeBlockState.contentCopied ?
|
|
64
|
+
title: formatMessage(codeBlockState.contentCopied ? codeBlockButtonMessages.copiedCodeToClipboard : codeBlockButtonMessages.copyCodeToClipboard),
|
|
65
65
|
onMouseEnter: provideVisualFeedbackForCopyButton,
|
|
66
66
|
// note: resetCopiedState contains logic that also removes the
|
|
67
67
|
// visual feedback for the copy button
|