@atlaskit/editor-core 181.0.0 → 182.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/codemods/140.0.0-rc-kraken-fix-type-errors.ts +0 -2
- package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +0 -17
- package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +0 -4
- package/dist/cjs/create-editor/create-plugins-list.js +7 -2
- package/dist/cjs/create-editor/feature-flags-from-props.js +31 -26
- package/dist/cjs/create-editor/sort-by-order.js +12 -0
- package/dist/cjs/editor-next/editor-migration-component.js +4 -1
- package/dist/cjs/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/cjs/labs/next/full-page.js +2 -1
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/labs/next/presets/universal.js +7 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +2 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +4 -7
- package/dist/cjs/plugins/analytics/plugin.js +6 -6
- package/dist/cjs/plugins/avatar-group/index.js +5 -2
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/cjs/plugins/base/index.js +4 -2
- package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
- package/dist/cjs/plugins/border/index.js +20 -0
- package/dist/cjs/plugins/card/index.js +4 -2
- package/dist/cjs/plugins/card/toolbar.js +12 -15
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/cjs/plugins/code-block/toolbar.js +1 -1
- package/dist/cjs/plugins/collab-edit/analytics.js +2 -3
- package/dist/cjs/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/cjs/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/cjs/plugins/collab-edit/index.js +5 -3
- package/dist/cjs/plugins/collab-edit/plugin.js +4 -3
- package/dist/cjs/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/cjs/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/cjs/plugins/date/index.js +90 -64
- package/dist/cjs/plugins/editor-disabled/index.js +8 -0
- package/dist/cjs/plugins/expand/index.js +4 -1
- package/dist/cjs/plugins/expand/nodeviews/index.js +6 -7
- package/dist/cjs/plugins/expand/pm-plugins/main.js +5 -2
- package/dist/cjs/plugins/extension/extension-api.js +27 -14
- package/dist/cjs/plugins/extension/pm-plugins/main.js +117 -177
- package/dist/cjs/plugins/extension/pm-plugins/utils.js +80 -0
- package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +7 -11
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +15 -7
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/cjs/plugins/hyperlink/Toolbar.js +9 -12
- package/dist/cjs/plugins/hyperlink/index.js +6 -2
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
- package/dist/cjs/plugins/index.js +7 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/cjs/plugins/list/commands/index.js +31 -27
- package/dist/cjs/plugins/list/commands/outdent-list.js +2 -3
- package/dist/cjs/plugins/list/index.js +4 -3
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +58 -0
- package/dist/cjs/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/cjs/plugins/list/pm-plugins/main.js +23 -21
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
- package/dist/cjs/plugins/media/nodeviews/styles.js +13 -1
- package/dist/cjs/plugins/media/toolbar/commands.js +105 -2
- package/dist/cjs/plugins/media/toolbar/imageBorder.js +20 -0
- package/dist/cjs/plugins/media/toolbar/index.js +33 -4
- package/dist/cjs/plugins/media/ui/ImageBorder/index.js +219 -0
- package/dist/cjs/plugins/media/ui/ImageBorder/messages.js +50 -0
- package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +54 -0
- package/dist/cjs/plugins/media/utils/current-media-node.js +28 -5
- package/dist/cjs/plugins/paste/util/index.js +2 -0
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +5 -0
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +3 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/cjs/plugins/type-ahead/index.js +4 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +4 -2
- package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +4 -2
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +41 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +2 -0
- package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
- package/dist/cjs/plugins/type-ahead/utils.js +22 -2
- package/dist/cjs/test-utils.js +3 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/cjs/ui/styles.js +1 -1
- package/dist/cjs/utils/input-rules.js +0 -17
- package/dist/cjs/utils/insert.js +53 -7
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +7 -2
- package/dist/es2019/create-editor/feature-flags-from-props.js +31 -26
- package/dist/es2019/create-editor/sort-by-order.js +11 -0
- package/dist/es2019/editor-next/editor-migration-component.js +4 -1
- package/dist/es2019/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/es2019/labs/next/full-page.js +2 -1
- package/dist/es2019/labs/next/presets/default.js +2 -1
- package/dist/es2019/labs/next/presets/universal.js +8 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -8
- package/dist/es2019/plugins/analytics/plugin.js +45 -43
- package/dist/es2019/plugins/avatar-group/index.js +26 -21
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/es2019/plugins/base/index.js +101 -97
- package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +2 -7
- package/dist/es2019/plugins/border/index.js +11 -0
- package/dist/es2019/plugins/card/index.js +4 -2
- package/dist/es2019/plugins/card/toolbar.js +10 -11
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/es2019/plugins/code-block/toolbar.js +2 -2
- package/dist/es2019/plugins/collab-edit/analytics.js +2 -3
- package/dist/es2019/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/es2019/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/es2019/plugins/collab-edit/index.js +5 -3
- package/dist/es2019/plugins/collab-edit/plugin.js +4 -3
- package/dist/es2019/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/es2019/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/es2019/plugins/date/index.js +92 -64
- package/dist/es2019/plugins/editor-disabled/index.js +8 -0
- package/dist/es2019/plugins/expand/index.js +57 -53
- package/dist/es2019/plugins/expand/nodeviews/index.js +6 -9
- package/dist/es2019/plugins/expand/pm-plugins/main.js +5 -3
- package/dist/es2019/plugins/extension/extension-api.js +31 -13
- package/dist/es2019/plugins/extension/pm-plugins/main.js +77 -96
- package/dist/es2019/plugins/extension/pm-plugins/utils.js +30 -0
- package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -8
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -3
- package/dist/es2019/plugins/find-replace/index.js +5 -2
- package/dist/es2019/plugins/floating-toolbar/index.js +159 -149
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +4 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +4 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/es2019/plugins/hyperlink/Toolbar.js +7 -9
- package/dist/es2019/plugins/hyperlink/index.js +66 -62
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -3
- package/dist/es2019/plugins/index.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/es2019/plugins/list/commands/index.js +4 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +2 -4
- package/dist/es2019/plugins/list/index.js +80 -77
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +52 -0
- package/dist/es2019/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/list/pm-plugins/main.js +46 -46
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +4 -1
- package/dist/es2019/plugins/media/nodeviews/styles.js +12 -1
- package/dist/es2019/plugins/media/toolbar/commands.js +93 -0
- package/dist/es2019/plugins/media/toolbar/imageBorder.js +15 -0
- package/dist/es2019/plugins/media/toolbar/index.js +36 -5
- package/dist/es2019/plugins/media/ui/ImageBorder/index.js +206 -0
- package/dist/es2019/plugins/media/ui/ImageBorder/messages.js +43 -0
- package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +124 -0
- package/dist/es2019/plugins/media/utils/current-media-node.js +22 -3
- package/dist/es2019/plugins/paste/util/index.js +2 -0
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +7 -0
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +59 -55
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/es2019/plugins/type-ahead/index.js +4 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +4 -2
- package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +4 -2
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +41 -4
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -0
- package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
- package/dist/es2019/plugins/type-ahead/utils.js +22 -2
- package/dist/es2019/test-utils.js +3 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/es2019/ui/styles.js +1 -0
- package/dist/es2019/utils/input-rules.js +0 -17
- package/dist/es2019/utils/insert.js +61 -10
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +7 -2
- package/dist/esm/create-editor/feature-flags-from-props.js +31 -26
- package/dist/esm/create-editor/sort-by-order.js +11 -0
- package/dist/esm/editor-next/editor-migration-component.js +3 -0
- package/dist/esm/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/esm/labs/next/full-page.js +2 -1
- package/dist/esm/labs/next/presets/default.js +2 -1
- package/dist/esm/labs/next/presets/universal.js +8 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -5
- package/dist/esm/plugins/analytics/plugin.js +6 -6
- package/dist/esm/plugins/avatar-group/index.js +5 -2
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/esm/plugins/base/index.js +4 -2
- package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
- package/dist/esm/plugins/border/index.js +13 -0
- package/dist/esm/plugins/card/index.js +4 -2
- package/dist/esm/plugins/card/toolbar.js +12 -15
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/esm/plugins/code-block/toolbar.js +2 -2
- package/dist/esm/plugins/collab-edit/analytics.js +2 -3
- package/dist/esm/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/esm/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/esm/plugins/collab-edit/index.js +5 -3
- package/dist/esm/plugins/collab-edit/plugin.js +4 -3
- package/dist/esm/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/esm/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/esm/plugins/date/index.js +90 -64
- package/dist/esm/plugins/editor-disabled/index.js +8 -0
- package/dist/esm/plugins/expand/index.js +4 -1
- package/dist/esm/plugins/expand/nodeviews/index.js +6 -7
- package/dist/esm/plugins/expand/pm-plugins/main.js +5 -2
- package/dist/esm/plugins/extension/extension-api.js +24 -12
- package/dist/esm/plugins/extension/pm-plugins/main.js +113 -173
- package/dist/esm/plugins/extension/pm-plugins/utils.js +72 -0
- package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -10
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/floating-toolbar/index.js +15 -7
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/esm/plugins/hyperlink/Toolbar.js +9 -13
- package/dist/esm/plugins/hyperlink/index.js +6 -2
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
- package/dist/esm/plugins/index.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/esm/plugins/list/commands/index.js +31 -27
- package/dist/esm/plugins/list/commands/outdent-list.js +2 -3
- package/dist/esm/plugins/list/index.js +4 -3
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +51 -0
- package/dist/esm/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/list/pm-plugins/main.js +23 -21
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
- package/dist/esm/plugins/media/nodeviews/styles.js +13 -1
- package/dist/esm/plugins/media/toolbar/commands.js +99 -0
- package/dist/esm/plugins/media/toolbar/imageBorder.js +14 -0
- package/dist/esm/plugins/media/toolbar/index.js +34 -5
- package/dist/esm/plugins/media/ui/ImageBorder/index.js +211 -0
- package/dist/esm/plugins/media/ui/ImageBorder/messages.js +43 -0
- package/dist/esm/plugins/media/ui/ImageBorder/styles.js +37 -0
- package/dist/esm/plugins/media/utils/current-media-node.js +24 -3
- package/dist/esm/plugins/paste/util/index.js +2 -0
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +5 -0
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +3 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/esm/plugins/type-ahead/index.js +4 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +4 -2
- package/dist/esm/plugins/type-ahead/pm-plugins/main.js +4 -2
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +41 -4
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -0
- package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
- package/dist/esm/plugins/type-ahead/utils.js +22 -2
- package/dist/esm/test-utils.js +3 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/esm/ui/styles.js +1 -1
- package/dist/esm/utils/input-rules.js +0 -17
- package/dist/esm/utils/insert.js +56 -10
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/sort-by-order.d.ts +9 -0
- package/dist/types/editor-next/editor-migration-component.d.ts +1 -0
- package/dist/types/labs/next/presets/cxhtml.d.ts +36 -2
- package/dist/types/labs/next/presets/default.d.ts +72 -4
- package/dist/types/labs/next/presets/mobile.d.ts +36 -2
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -1
- package/dist/types/plugins/analytics/plugin.d.ts +2 -0
- package/dist/types/plugins/avatar-group/index.d.ts +2 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -0
- package/dist/types/plugins/base/index.d.ts +2 -0
- package/dist/types/plugins/base/pm-plugins/disable-spell-checking.d.ts +2 -1
- package/dist/types/plugins/border/index.d.ts +3 -0
- package/dist/types/plugins/card/index.d.ts +2 -0
- package/dist/types/plugins/card/toolbar.d.ts +2 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +5 -2
- package/dist/types/plugins/collab-edit/analytics.d.ts +2 -1
- package/dist/types/plugins/collab-edit/events/handlers.d.ts +2 -1
- package/dist/types/plugins/collab-edit/events/initialize.d.ts +3 -1
- package/dist/types/plugins/collab-edit/index.d.ts +2 -0
- package/dist/types/plugins/collab-edit/plugin.d.ts +2 -1
- package/dist/types/plugins/collab-edit/ui/avatars-with-plugin-state.d.ts +4 -0
- package/dist/types/plugins/collab-edit/ui/avatars.d.ts +2 -0
- package/dist/types/plugins/date/index.d.ts +9 -1
- package/dist/types/plugins/editor-disabled/index.d.ts +3 -1
- package/dist/types/plugins/expand/index.d.ts +2 -0
- package/dist/types/plugins/expand/nodeviews/index.d.ts +5 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +8 -2
- package/dist/types/plugins/extension/pm-plugins/utils.d.ts +3 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -7
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +2 -0
- package/dist/types/plugins/find-replace/index.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/index.d.ts +4 -1
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +2 -0
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types/plugins/hyperlink/index.d.ts +2 -0
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +1 -0
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -1
- package/dist/types/plugins/list/commands/index.d.ts +3 -2
- package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types/plugins/list/index.d.ts +2 -0
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +1 -1
- package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +13 -0
- package/dist/types/plugins/list/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/list/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugins/media/nodeviews/styles.d.ts +3 -1
- package/dist/types/plugins/media/toolbar/commands.d.ts +5 -0
- package/dist/types/plugins/media/toolbar/imageBorder.d.ts +2 -0
- package/dist/types/plugins/media/types.d.ts +3 -0
- package/dist/types/plugins/media/ui/ImageBorder/index.d.ts +13 -0
- package/dist/types/plugins/media/ui/ImageBorder/messages.d.ts +42 -0
- package/dist/types/plugins/media/ui/ImageBorder/styles.d.ts +15 -0
- package/dist/types/plugins/media/utils/current-media-node.d.ts +6 -0
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -1
- package/dist/types/plugins/type-ahead/index.d.ts +1 -0
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +2 -1
- package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +1 -0
- package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +2 -1
- package/dist/types/test-utils.d.ts +4 -2
- package/dist/types/types/editor-props.d.ts +5 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +13 -12
- package/report.api.md +12 -4
- package/codemods/__tests__/rename-experimental-text-color-prop.ts +0 -204
- package/codemods/migrates/rename-experimental-text-color-prop.ts +0 -6
|
@@ -19,7 +19,6 @@ import { ConfirmationModal } from './ui/ConfirmationModal';
|
|
|
19
19
|
import { ToolbarLoader } from './ui/ToolbarLoader';
|
|
20
20
|
import { findNode } from './utils';
|
|
21
21
|
import { ErrorBoundary } from '../../ui/ErrorBoundary';
|
|
22
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
23
22
|
import { processCopyButtonItems } from '../copy-button/toolbar';
|
|
24
23
|
import forceFocusPlugin from './pm-plugins/force-focus';
|
|
25
24
|
export const getRelevantConfig = (selection, configs) => {
|
|
@@ -113,156 +112,167 @@ const getDomRefFromSelection = (view, dispatchAnalyticsEvent) => {
|
|
|
113
112
|
function filterUndefined(x) {
|
|
114
113
|
return !!x;
|
|
115
114
|
}
|
|
116
|
-
const floatingToolbarPlugin = () =>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
customPositionCalculation
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
115
|
+
const floatingToolbarPlugin = (_, api) => {
|
|
116
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
117
|
+
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()) || {};
|
|
118
|
+
return {
|
|
119
|
+
name: 'floatingToolbar',
|
|
120
|
+
pmPlugins(floatingToolbarHandlers = []) {
|
|
121
|
+
return [{
|
|
122
|
+
// Should be after all toolbar plugins
|
|
123
|
+
name: 'floatingToolbar',
|
|
124
|
+
plugin: ({
|
|
125
|
+
dispatch,
|
|
126
|
+
providerFactory,
|
|
127
|
+
getIntl
|
|
128
|
+
}) => floatingToolbarPluginFactory({
|
|
129
|
+
floatingToolbarHandlers,
|
|
130
|
+
dispatch,
|
|
131
|
+
providerFactory,
|
|
132
|
+
getIntl
|
|
133
|
+
})
|
|
134
|
+
}, {
|
|
135
|
+
name: 'floatingToolbarData',
|
|
136
|
+
plugin: ({
|
|
137
|
+
dispatch
|
|
138
|
+
}) => floatingToolbarDataPluginFactory(dispatch)
|
|
139
|
+
}, {
|
|
140
|
+
name: 'forceFocus',
|
|
141
|
+
plugin: () => forceFocusPlugin()
|
|
142
|
+
}];
|
|
143
|
+
},
|
|
144
|
+
contentComponent({
|
|
145
|
+
popupsMountPoint,
|
|
146
|
+
popupsBoundariesElement,
|
|
147
|
+
popupsScrollableElement,
|
|
148
|
+
editorView,
|
|
149
|
+
providerFactory,
|
|
150
|
+
dispatchAnalyticsEvent
|
|
151
|
+
}) {
|
|
152
|
+
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
153
|
+
plugins: {
|
|
154
|
+
floatingToolbarState: pluginKey,
|
|
155
|
+
floatingToolbarData: dataPluginKey,
|
|
156
|
+
editorDisabledPlugin: editorDisabledPluginKey,
|
|
157
|
+
extensionsState: extensionsPluginKey
|
|
158
|
+
},
|
|
159
|
+
render: ({
|
|
160
|
+
editorDisabledPlugin,
|
|
161
|
+
floatingToolbarState,
|
|
162
|
+
floatingToolbarData,
|
|
163
|
+
extensionsState
|
|
164
|
+
}) => {
|
|
165
|
+
var _configWithNodeInfo$c, _configWithNodeInfo$c2;
|
|
166
|
+
const configWithNodeInfo = floatingToolbarState === null || floatingToolbarState === void 0 ? void 0 : floatingToolbarState.getConfigWithNodeInfo(editorView.state);
|
|
167
|
+
if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
const {
|
|
171
|
+
config,
|
|
172
|
+
node
|
|
173
|
+
} = configWithNodeInfo;
|
|
174
|
+
const {
|
|
175
|
+
title,
|
|
176
|
+
getDomRef = getDomRefFromSelection,
|
|
177
|
+
items,
|
|
178
|
+
align = 'center',
|
|
179
|
+
className = '',
|
|
180
|
+
height,
|
|
181
|
+
width,
|
|
182
|
+
zIndex,
|
|
183
|
+
offset = [0, 12],
|
|
184
|
+
forcePlacement,
|
|
185
|
+
preventPopupOverflow,
|
|
186
|
+
onPositionCalculated,
|
|
187
|
+
focusTrap
|
|
188
|
+
} = config;
|
|
189
|
+
const targetRef = getDomRef(editorView, dispatchAnalyticsEvent);
|
|
190
|
+
if (!targetRef || editorDisabledPlugin && editorDisabledPlugin.editorDisabled) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
let customPositionCalculation;
|
|
194
|
+
const toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node));
|
|
195
|
+
if (onPositionCalculated) {
|
|
196
|
+
customPositionCalculation = nextPos => {
|
|
197
|
+
return onPositionCalculated(editorView, nextPos);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
const dispatchCommand = fn => fn && fn(editorView.state, editorView.dispatch, editorView);
|
|
199
201
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
202
|
+
// Confirm dialog
|
|
203
|
+
const {
|
|
204
|
+
confirmDialogForItem
|
|
205
|
+
} = floatingToolbarData || {};
|
|
206
|
+
const confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
207
|
+
const scrollable = featureFlags.floatingToolbarCopyButton && config.scrollable;
|
|
208
|
+
const confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
|
|
209
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
210
|
+
component: ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
211
|
+
componentId: camelCase(title),
|
|
212
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
213
|
+
fallbackComponent: null
|
|
214
|
+
}, /*#__PURE__*/React.createElement(Popup, {
|
|
215
|
+
ariaLabel: title,
|
|
216
|
+
offset: offset,
|
|
217
|
+
target: targetRef,
|
|
218
|
+
alignY: "bottom",
|
|
219
|
+
forcePlacement: forcePlacement,
|
|
220
|
+
fitHeight: height,
|
|
221
|
+
fitWidth: width,
|
|
222
|
+
alignX: align,
|
|
223
|
+
stick: true,
|
|
224
|
+
zIndex: zIndex,
|
|
225
|
+
mountTo: popupsMountPoint,
|
|
226
|
+
boundariesElement: popupsBoundariesElement,
|
|
227
|
+
scrollableElement: popupsScrollableElement,
|
|
228
|
+
onPositionCalculated: customPositionCalculation,
|
|
229
|
+
style: scrollable ? {
|
|
230
|
+
maxWidth: '100%'
|
|
231
|
+
} : {},
|
|
232
|
+
focusTrap: focusTrap,
|
|
233
|
+
preventOverflow: preventPopupOverflow
|
|
234
|
+
}, /*#__PURE__*/React.createElement(ToolbarLoader, {
|
|
235
|
+
target: targetRef,
|
|
236
|
+
items: toolbarItems,
|
|
237
|
+
node: node,
|
|
238
|
+
dispatchCommand: dispatchCommand,
|
|
239
|
+
editorView: editorView,
|
|
240
|
+
className: className,
|
|
241
|
+
focusEditor: () => editorView.focus(),
|
|
242
|
+
providerFactory: providerFactory,
|
|
243
|
+
popupsMountPoint: popupsMountPoint,
|
|
244
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
245
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
246
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
247
|
+
extensionsProvider: extensionsState === null || extensionsState === void 0 ? void 0 : extensionsState.extensionProvider,
|
|
248
|
+
scrollable: scrollable,
|
|
249
|
+
featureFlags: featureFlags
|
|
250
|
+
})), /*#__PURE__*/React.createElement(ConfirmationModal, {
|
|
251
|
+
testId: "ak-floating-toolbar-confirmation-modal",
|
|
252
|
+
options: confirmDialogOptions,
|
|
253
|
+
onConfirm: (isChecked = false) => {
|
|
254
|
+
if (!!confirmDialogOptions.onConfirm) {
|
|
255
|
+
dispatchCommand(confirmDialogOptions.onConfirm(isChecked));
|
|
256
|
+
} else {
|
|
257
|
+
dispatchCommand(confirmButtonItem.onClick);
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
onClose: () => {
|
|
261
|
+
dispatchCommand(hideConfirmDialog());
|
|
262
|
+
// Need to set focus to Editor here,
|
|
263
|
+
// As when the Confirmation dialog pop up, and user interacts with the dialog, Editor loses focus.
|
|
264
|
+
// So when Confirmation dialog is closed, Editor does not have the focus, then cursor goes to the position 1 of the doc,
|
|
265
|
+
// instead of the cursor position before the dialog pop up.
|
|
266
|
+
if (!editorView.hasFocus()) {
|
|
267
|
+
editorView.focus();
|
|
268
|
+
}
|
|
254
269
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}));
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
});
|
|
270
|
+
}));
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
};
|
|
266
276
|
export default floatingToolbarPlugin;
|
|
267
277
|
|
|
268
278
|
/**
|
|
@@ -62,7 +62,10 @@ export const CheckboxModal = props => {
|
|
|
62
62
|
testId: testId ? `${testId}-cancel-button` : undefined
|
|
63
63
|
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
64
64
|
appearance: "warning",
|
|
65
|
-
onClick: () =>
|
|
65
|
+
onClick: () => {
|
|
66
|
+
onConfirm(isChecked);
|
|
67
|
+
onClose();
|
|
68
|
+
},
|
|
66
69
|
testId: testId ? `${testId}-confirm-button` : undefined
|
|
67
70
|
}, okButtonLabel)));
|
|
68
71
|
};
|
|
@@ -28,8 +28,11 @@ export const EmojiPickerButton = props => {
|
|
|
28
28
|
};
|
|
29
29
|
const updateEmoji = emoji => {
|
|
30
30
|
setIsPopupOpen(false);
|
|
31
|
-
props.editorView && props.editorView.focus();
|
|
32
31
|
props.onChange && props.onChange(emoji);
|
|
32
|
+
requestAnimationFrame(() => {
|
|
33
|
+
var _props$editorView;
|
|
34
|
+
(_props$editorView = props.editorView) === null || _props$editorView === void 0 ? void 0 : _props$editorView.focus();
|
|
35
|
+
});
|
|
33
36
|
};
|
|
34
37
|
const isDetachedElement = el => !document.body.contains(el);
|
|
35
38
|
const handleEmojiClickOutside = e => {
|
|
@@ -41,6 +44,11 @@ export const EmojiPickerButton = props => {
|
|
|
41
44
|
togglePopup();
|
|
42
45
|
}
|
|
43
46
|
};
|
|
47
|
+
const handleEmojiPressEscape = () => {
|
|
48
|
+
var _buttonRef$current;
|
|
49
|
+
setIsPopupOpen(false);
|
|
50
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
51
|
+
};
|
|
44
52
|
const renderPicker = providers => {
|
|
45
53
|
if (!providers.emojiProvider) {
|
|
46
54
|
return null;
|
|
@@ -49,7 +57,8 @@ export const EmojiPickerButton = props => {
|
|
|
49
57
|
emojiProvider: providers.emojiProvider,
|
|
50
58
|
onSelection: updateEmoji,
|
|
51
59
|
onPickerRef: () => {},
|
|
52
|
-
handleClickOutside: handleEmojiClickOutside
|
|
60
|
+
handleClickOutside: handleEmojiClickOutside,
|
|
61
|
+
handleEscapeKeydown: handleEmojiPressEscape
|
|
53
62
|
});
|
|
54
63
|
};
|
|
55
64
|
const renderPopup = () => {
|
|
@@ -66,7 +75,8 @@ export const EmojiPickerButton = props => {
|
|
|
66
75
|
// if the toolbar is scrollable, this will be mounted in the root editor
|
|
67
76
|
// we need an index of > 500 to display over it
|
|
68
77
|
,
|
|
69
|
-
zIndex: props.setDisableParentScroll ? 600 : undefined
|
|
78
|
+
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
79
|
+
focusTrap: true
|
|
70
80
|
}, jsx(WithProviders, {
|
|
71
81
|
providers: ['emojiProvider'],
|
|
72
82
|
providerFactory: props.providerFactory,
|
|
@@ -26,7 +26,10 @@ export const SimpleModal = props => {
|
|
|
26
26
|
testId: testId ? `${testId}-cancel-button` : undefined
|
|
27
27
|
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
28
28
|
appearance: "warning",
|
|
29
|
-
onClick: () =>
|
|
29
|
+
onClick: () => {
|
|
30
|
+
onConfirm();
|
|
31
|
+
onClose();
|
|
32
|
+
},
|
|
30
33
|
testId: testId ? `${testId}-confirm-button` : undefined
|
|
31
34
|
}, okButtonLabel)));
|
|
32
35
|
};
|
|
@@ -9,7 +9,6 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
|
9
9
|
import { themed } from '@atlaskit/theme/components';
|
|
10
10
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
11
11
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
12
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
13
12
|
import { compareArrays, shallowEqual } from '../utils';
|
|
14
13
|
import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
15
14
|
import Button from './Button';
|
|
@@ -43,12 +42,13 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
43
42
|
extensionsProvider,
|
|
44
43
|
node,
|
|
45
44
|
setDisableScroll,
|
|
46
|
-
mountRef
|
|
45
|
+
mountRef,
|
|
46
|
+
featureFlags
|
|
47
47
|
}) => {
|
|
48
48
|
const 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;
|
|
49
49
|
const {
|
|
50
50
|
useSomewhatSemanticTextColorNames
|
|
51
|
-
} =
|
|
51
|
+
} = featureFlags || {
|
|
52
52
|
useSomewhatSemanticTextColorNames: false
|
|
53
53
|
};
|
|
54
54
|
return jsx(ButtonGroup, null, items.filter(item => !item.hidden).map((item, idx) => {
|
|
@@ -197,7 +197,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
197
197
|
}
|
|
198
198
|
const {
|
|
199
199
|
extendFloatingToolbar
|
|
200
|
-
} =
|
|
200
|
+
} = featureFlags || {};
|
|
201
201
|
if (!extendFloatingToolbar) {
|
|
202
202
|
return null;
|
|
203
203
|
}
|
|
@@ -451,7 +451,8 @@ class Toolbar extends Component {
|
|
|
451
451
|
}, jsx(ToolbarItems, _extends({}, this.props, {
|
|
452
452
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
453
453
|
mountRef: this.mountRef,
|
|
454
|
-
mounted: this.state.mounted
|
|
454
|
+
mounted: this.state.mounted,
|
|
455
|
+
featureFlags: this.props.featureFlags
|
|
455
456
|
}))), scrollable && jsx(ScrollButtons, {
|
|
456
457
|
intl: intl,
|
|
457
458
|
scrollContainerRef: this.scrollContainerRef,
|
|
@@ -12,8 +12,6 @@ import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDT
|
|
|
12
12
|
import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
13
13
|
import { addAnalytics, ACTION_SUBJECT_ID } from '../analytics';
|
|
14
14
|
import { buildVisitedLinkPayload, buildOpenedSettingsPayload } from '../../utils/linking-utils';
|
|
15
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
16
|
-
|
|
17
15
|
/* type guard for edit links */
|
|
18
16
|
function isEditLink(linkMark) {
|
|
19
17
|
return linkMark.pos !== undefined;
|
|
@@ -43,10 +41,10 @@ function getLinkText(activeLinkMark, state) {
|
|
|
43
41
|
}
|
|
44
42
|
return activeLinkMark.node.text;
|
|
45
43
|
}
|
|
46
|
-
const getSettingsButtonGroup = (state, intl) => {
|
|
44
|
+
const getSettingsButtonGroup = (state, intl, featureFlags) => {
|
|
47
45
|
const {
|
|
48
46
|
floatingToolbarLinkSettingsButton
|
|
49
|
-
} =
|
|
47
|
+
} = featureFlags;
|
|
50
48
|
return floatingToolbarLinkSettingsButton === 'true' ? [{
|
|
51
49
|
type: 'separator'
|
|
52
50
|
}, {
|
|
@@ -59,7 +57,7 @@ const getSettingsButtonGroup = (state, intl) => {
|
|
|
59
57
|
target: '_blank'
|
|
60
58
|
}] : [];
|
|
61
59
|
};
|
|
62
|
-
export const getToolbarConfig = options => (state, intl, providerFactory) => {
|
|
60
|
+
export const getToolbarConfig = (options, featureFlags) => (state, intl, providerFactory) => {
|
|
63
61
|
const {
|
|
64
62
|
formatMessage
|
|
65
63
|
} = intl;
|
|
@@ -72,7 +70,7 @@ export const getToolbarConfig = options => (state, intl, providerFactory) => {
|
|
|
72
70
|
lpLinkPicker,
|
|
73
71
|
lpLinkPickerFocusTrap,
|
|
74
72
|
preventPopupOverflow
|
|
75
|
-
} =
|
|
73
|
+
} = featureFlags;
|
|
76
74
|
const shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
77
75
|
if (linkState && linkState.activeLinkMark) {
|
|
78
76
|
const {
|
|
@@ -167,21 +165,20 @@ export const getToolbarConfig = options => (state, intl, providerFactory) => {
|
|
|
167
165
|
formatMessage: formatMessage,
|
|
168
166
|
markType: state.schema.marks.link
|
|
169
167
|
}]
|
|
170
|
-
}, ...getSettingsButtonGroup(state, intl)],
|
|
168
|
+
}, ...getSettingsButtonGroup(state, intl, featureFlags)],
|
|
171
169
|
scrollable: true
|
|
172
170
|
};
|
|
173
171
|
}
|
|
174
172
|
case 'EDIT_INSERTED':
|
|
175
173
|
case 'INSERT':
|
|
176
174
|
{
|
|
177
|
-
var _options$linkPicker, _options$linkPicker$p;
|
|
178
175
|
let link;
|
|
179
176
|
if (isEditLink(activeLinkMark) && activeLinkMark.node) {
|
|
180
177
|
const linkMark = activeLinkMark.node.marks.filter(mark => mark.type === state.schema.marks.link);
|
|
181
178
|
link = linkMark[0] && linkMark[0].attrs.href;
|
|
182
179
|
}
|
|
183
180
|
const displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
|
|
184
|
-
const popupHeight = lpLinkPicker
|
|
181
|
+
const popupHeight = lpLinkPicker ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX;
|
|
185
182
|
return {
|
|
186
183
|
...hyperLinkToolbar,
|
|
187
184
|
preventPopupOverflow,
|
|
@@ -200,6 +197,7 @@ export const getToolbarConfig = options => (state, intl, providerFactory) => {
|
|
|
200
197
|
view: view,
|
|
201
198
|
key: idx,
|
|
202
199
|
linkPickerOptions: options === null || options === void 0 ? void 0 : options.linkPicker,
|
|
200
|
+
featureFlags: featureFlags,
|
|
203
201
|
displayUrl: link,
|
|
204
202
|
displayText: displayText || '',
|
|
205
203
|
providerFactory: providerFactory,
|
|
@@ -9,67 +9,71 @@ 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
|
-
const hyperlinkPlugin = options =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
action: ACTION.INVOKED,
|
|
63
|
-
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
64
|
-
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_LINK,
|
|
65
|
-
attributes: {
|
|
12
|
+
const hyperlinkPlugin = (options = {}, api) => {
|
|
13
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
14
|
+
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()) || {};
|
|
15
|
+
return {
|
|
16
|
+
name: 'hyperlink',
|
|
17
|
+
marks() {
|
|
18
|
+
return [{
|
|
19
|
+
name: 'link',
|
|
20
|
+
mark: link
|
|
21
|
+
}];
|
|
22
|
+
},
|
|
23
|
+
pmPlugins() {
|
|
24
|
+
var _options$cardOptions;
|
|
25
|
+
// Skip analytics if card provider is available, as they will be
|
|
26
|
+
// sent on handleRejected upon attempting to resolve smart link.
|
|
27
|
+
const skipAnalytics = !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider);
|
|
28
|
+
return [{
|
|
29
|
+
name: 'hyperlink',
|
|
30
|
+
plugin: ({
|
|
31
|
+
dispatch
|
|
32
|
+
}) => plugin(dispatch, options === null || options === void 0 ? void 0 : options.editorAppearance)
|
|
33
|
+
}, {
|
|
34
|
+
name: 'fakeCursorToolbarPlugin',
|
|
35
|
+
plugin: () => fakeCursorToolbarPlugin
|
|
36
|
+
}, {
|
|
37
|
+
name: 'hyperlinkInputRule',
|
|
38
|
+
plugin: ({
|
|
39
|
+
schema,
|
|
40
|
+
featureFlags
|
|
41
|
+
}) => createInputRulePlugin(schema, skipAnalytics, featureFlags)
|
|
42
|
+
}, {
|
|
43
|
+
name: 'hyperlinkKeymap',
|
|
44
|
+
plugin: () => createKeymapPlugin(skipAnalytics)
|
|
45
|
+
}];
|
|
46
|
+
},
|
|
47
|
+
pluginsOptions: {
|
|
48
|
+
quickInsert: ({
|
|
49
|
+
formatMessage
|
|
50
|
+
}) => [{
|
|
51
|
+
id: 'hyperlink',
|
|
52
|
+
title: formatMessage(messages.link),
|
|
53
|
+
description: formatMessage(messages.linkDescription),
|
|
54
|
+
keywords: ['hyperlink', 'url'],
|
|
55
|
+
priority: 1200,
|
|
56
|
+
keyshortcut: tooltip(addLink),
|
|
57
|
+
icon: () => /*#__PURE__*/React.createElement(IconLink, null),
|
|
58
|
+
action(insert, state) {
|
|
59
|
+
const tr = insert(undefined);
|
|
60
|
+
tr.setMeta(stateKey, {
|
|
61
|
+
type: LinkAction.SHOW_INSERT_TOOLBAR,
|
|
66
62
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
63
|
+
});
|
|
64
|
+
return addAnalytics(state, tr, {
|
|
65
|
+
action: ACTION.INVOKED,
|
|
66
|
+
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
67
|
+
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_LINK,
|
|
68
|
+
attributes: {
|
|
69
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
70
|
+
},
|
|
71
|
+
eventType: EVENT_TYPE.UI
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}],
|
|
75
|
+
floatingToolbar: getToolbarConfig(options, featureFlags)
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
};
|
|
75
79
|
export default hyperlinkPlugin;
|