@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
|
@@ -1,81 +1,14 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import { getExtensionModuleNode } from '@atlaskit/editor-common/extensions';
|
|
6
5
|
import { createSelectionClickHandler } from '../../selection/utils';
|
|
7
6
|
import ExtensionNodeView from '../nodeviews/extension';
|
|
8
7
|
import { updateState, clearEditingContext } from '../commands';
|
|
9
8
|
import { getSelectedExtension, getSelectedDomElement } from '../utils';
|
|
10
9
|
import { createPluginState, getPluginState, createCommand } from '../plugin-factory';
|
|
11
10
|
import { pluginKey } from '../plugin-key';
|
|
12
|
-
|
|
13
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(view, extensionProvider) {
|
|
14
|
-
var nodeWithPos, _nodeWithPos$node$att, extensionType, extensionKey, extensionModuleNode, newNodeWithPos;
|
|
15
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
switch (_context.prev = _context.next) {
|
|
18
|
-
case 0:
|
|
19
|
-
nodeWithPos = getSelectedExtension(view.state, true);
|
|
20
|
-
if (nodeWithPos) {
|
|
21
|
-
_context.next = 3;
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
throw new Error('There is no selection');
|
|
25
|
-
case 3:
|
|
26
|
-
_nodeWithPos$node$att = nodeWithPos.node.attrs, extensionType = _nodeWithPos$node$att.extensionType, extensionKey = _nodeWithPos$node$att.extensionKey;
|
|
27
|
-
_context.next = 6;
|
|
28
|
-
return getExtensionModuleNode(extensionProvider, extensionType, extensionKey);
|
|
29
|
-
case 6:
|
|
30
|
-
extensionModuleNode = _context.sent;
|
|
31
|
-
newNodeWithPos = getSelectedExtension(view.state, true);
|
|
32
|
-
if (!(newNodeWithPos && newNodeWithPos.node.attrs.extensionType === extensionType && newNodeWithPos.node.attrs.extensionKey === extensionKey && newNodeWithPos.pos === nodeWithPos.pos && extensionModuleNode)) {
|
|
33
|
-
_context.next = 10;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
return _context.abrupt("return", extensionModuleNode.update);
|
|
37
|
-
case 10:
|
|
38
|
-
case "end":
|
|
39
|
-
return _context.stop();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}, _callee);
|
|
43
|
-
}));
|
|
44
|
-
return function maybeGetUpdateMethodFromExtensionProvider(_x, _x2) {
|
|
45
|
-
return _ref.apply(this, arguments);
|
|
46
|
-
};
|
|
47
|
-
}();
|
|
48
|
-
export var updateEditButton = /*#__PURE__*/function () {
|
|
49
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(view, extensionProvider) {
|
|
50
|
-
var updateMethod;
|
|
51
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
52
|
-
while (1) {
|
|
53
|
-
switch (_context2.prev = _context2.next) {
|
|
54
|
-
case 0:
|
|
55
|
-
_context2.prev = 0;
|
|
56
|
-
_context2.next = 3;
|
|
57
|
-
return maybeGetUpdateMethodFromExtensionProvider(view, extensionProvider);
|
|
58
|
-
case 3:
|
|
59
|
-
updateMethod = _context2.sent;
|
|
60
|
-
updateState({
|
|
61
|
-
showEditButton: !!updateMethod,
|
|
62
|
-
updateExtension: updateMethod && Promise.resolve(updateMethod) || undefined
|
|
63
|
-
})(view.state, view.dispatch);
|
|
64
|
-
return _context2.abrupt("return", updateMethod);
|
|
65
|
-
case 8:
|
|
66
|
-
_context2.prev = 8;
|
|
67
|
-
_context2.t0 = _context2["catch"](0);
|
|
68
|
-
case 10:
|
|
69
|
-
case "end":
|
|
70
|
-
return _context2.stop();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}, _callee2, null, [[0, 8]]);
|
|
74
|
-
}));
|
|
75
|
-
return function updateEditButton(_x3, _x4) {
|
|
76
|
-
return _ref2.apply(this, arguments);
|
|
77
|
-
};
|
|
78
|
-
}();
|
|
11
|
+
import { updateEditButton } from './utils';
|
|
79
12
|
var shouldShowEditButton = function shouldShowEditButton(extensionHandler, extensionProvider) {
|
|
80
13
|
var usesLegacyMacroBrowser = !extensionHandler && !extensionProvider || typeof extensionHandler === 'function';
|
|
81
14
|
var usesModernUpdateMethod = _typeof(extensionHandler) === 'object' && typeof extensionHandler.update === 'function';
|
|
@@ -85,127 +18,188 @@ var shouldShowEditButton = function shouldShowEditButton(extensionHandler, exten
|
|
|
85
18
|
return false;
|
|
86
19
|
};
|
|
87
20
|
var getUpdateExtensionPromise = /*#__PURE__*/function () {
|
|
88
|
-
var
|
|
21
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(view, extensionHandler, extensionProvider) {
|
|
89
22
|
var updateMethod;
|
|
90
|
-
return _regeneratorRuntime.wrap(function
|
|
23
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
91
24
|
while (1) {
|
|
92
|
-
switch (
|
|
25
|
+
switch (_context.prev = _context.next) {
|
|
93
26
|
case 0:
|
|
94
27
|
if (!(extensionHandler && _typeof(extensionHandler) === 'object')) {
|
|
95
|
-
|
|
28
|
+
_context.next = 4;
|
|
96
29
|
break;
|
|
97
30
|
}
|
|
98
|
-
return
|
|
31
|
+
return _context.abrupt("return", extensionHandler.update);
|
|
99
32
|
case 4:
|
|
100
33
|
if (!extensionProvider) {
|
|
101
|
-
|
|
34
|
+
_context.next = 10;
|
|
102
35
|
break;
|
|
103
36
|
}
|
|
104
|
-
|
|
37
|
+
_context.next = 7;
|
|
105
38
|
return updateEditButton(view, extensionProvider);
|
|
106
39
|
case 7:
|
|
107
|
-
updateMethod =
|
|
40
|
+
updateMethod = _context.sent;
|
|
108
41
|
if (!updateMethod) {
|
|
109
|
-
|
|
42
|
+
_context.next = 10;
|
|
110
43
|
break;
|
|
111
44
|
}
|
|
112
|
-
return
|
|
45
|
+
return _context.abrupt("return", updateMethod);
|
|
113
46
|
case 10:
|
|
114
47
|
throw new Error('No update method available');
|
|
115
48
|
case 11:
|
|
116
49
|
case "end":
|
|
117
|
-
return
|
|
50
|
+
return _context.stop();
|
|
118
51
|
}
|
|
119
52
|
}
|
|
120
|
-
},
|
|
53
|
+
}, _callee);
|
|
121
54
|
}));
|
|
122
|
-
return function getUpdateExtensionPromise(
|
|
123
|
-
return
|
|
55
|
+
return function getUpdateExtensionPromise(_x, _x2, _x3) {
|
|
56
|
+
return _ref.apply(this, arguments);
|
|
124
57
|
};
|
|
125
58
|
}();
|
|
126
59
|
export var createExtensionProviderHandler = function createExtensionProviderHandler(view) {
|
|
127
60
|
return /*#__PURE__*/function () {
|
|
128
|
-
var
|
|
61
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(name, provider) {
|
|
129
62
|
var extensionProvider;
|
|
130
|
-
return _regeneratorRuntime.wrap(function
|
|
63
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
131
64
|
while (1) {
|
|
132
|
-
switch (
|
|
65
|
+
switch (_context2.prev = _context2.next) {
|
|
133
66
|
case 0:
|
|
134
67
|
if (!(name === 'extensionProvider' && provider)) {
|
|
135
|
-
|
|
68
|
+
_context2.next = 13;
|
|
136
69
|
break;
|
|
137
70
|
}
|
|
138
|
-
|
|
139
|
-
|
|
71
|
+
_context2.prev = 1;
|
|
72
|
+
_context2.next = 4;
|
|
140
73
|
return provider;
|
|
141
74
|
case 4:
|
|
142
|
-
extensionProvider =
|
|
75
|
+
extensionProvider = _context2.sent;
|
|
143
76
|
updateState({
|
|
144
77
|
extensionProvider: extensionProvider
|
|
145
78
|
})(view.state, view.dispatch);
|
|
146
|
-
|
|
79
|
+
_context2.next = 8;
|
|
147
80
|
return updateEditButton(view, extensionProvider);
|
|
148
81
|
case 8:
|
|
149
|
-
|
|
82
|
+
_context2.next = 13;
|
|
150
83
|
break;
|
|
151
84
|
case 10:
|
|
152
|
-
|
|
153
|
-
|
|
85
|
+
_context2.prev = 10;
|
|
86
|
+
_context2.t0 = _context2["catch"](1);
|
|
154
87
|
updateState({
|
|
155
88
|
extensionProvider: undefined
|
|
156
89
|
})(view.state, view.dispatch);
|
|
157
90
|
case 13:
|
|
158
91
|
case "end":
|
|
159
|
-
return
|
|
92
|
+
return _context2.stop();
|
|
160
93
|
}
|
|
161
94
|
}
|
|
162
|
-
},
|
|
95
|
+
}, _callee2, null, [[1, 10]]);
|
|
163
96
|
}));
|
|
164
|
-
return function (
|
|
165
|
-
return
|
|
97
|
+
return function (_x4, _x5) {
|
|
98
|
+
return _ref2.apply(this, arguments);
|
|
166
99
|
};
|
|
167
100
|
}();
|
|
168
101
|
};
|
|
169
102
|
export var createContextIdentifierProviderHandler = function createContextIdentifierProviderHandler(view) {
|
|
170
103
|
return /*#__PURE__*/function () {
|
|
171
|
-
var
|
|
104
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(name, provider) {
|
|
172
105
|
var contextIdentifierProvider;
|
|
173
|
-
return _regeneratorRuntime.wrap(function
|
|
106
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
174
107
|
while (1) {
|
|
175
|
-
switch (
|
|
108
|
+
switch (_context3.prev = _context3.next) {
|
|
176
109
|
case 0:
|
|
177
110
|
if (!(name === 'contextIdentifierProvider' && provider)) {
|
|
178
|
-
|
|
111
|
+
_context3.next = 11;
|
|
179
112
|
break;
|
|
180
113
|
}
|
|
181
|
-
|
|
182
|
-
|
|
114
|
+
_context3.prev = 1;
|
|
115
|
+
_context3.next = 4;
|
|
183
116
|
return provider;
|
|
184
117
|
case 4:
|
|
185
|
-
contextIdentifierProvider =
|
|
118
|
+
contextIdentifierProvider = _context3.sent;
|
|
186
119
|
updateState({
|
|
187
120
|
contextIdentifierProvider: contextIdentifierProvider
|
|
188
121
|
})(view.state, view.dispatch);
|
|
189
|
-
|
|
122
|
+
_context3.next = 11;
|
|
190
123
|
break;
|
|
191
124
|
case 8:
|
|
192
|
-
|
|
193
|
-
|
|
125
|
+
_context3.prev = 8;
|
|
126
|
+
_context3.t0 = _context3["catch"](1);
|
|
194
127
|
updateState({
|
|
195
128
|
contextIdentifierProvider: undefined
|
|
196
129
|
})(view.state, view.dispatch);
|
|
197
130
|
case 11:
|
|
198
131
|
case "end":
|
|
199
|
-
return
|
|
132
|
+
return _context3.stop();
|
|
200
133
|
}
|
|
201
134
|
}
|
|
202
|
-
},
|
|
135
|
+
}, _callee3, null, [[1, 8]]);
|
|
203
136
|
}));
|
|
204
|
-
return function (
|
|
205
|
-
return
|
|
137
|
+
return function (_x6, _x7) {
|
|
138
|
+
return _ref3.apply(this, arguments);
|
|
206
139
|
};
|
|
207
140
|
}();
|
|
208
141
|
};
|
|
142
|
+
export var handleUpdate = function handleUpdate(_ref4) {
|
|
143
|
+
var view = _ref4.view,
|
|
144
|
+
prevState = _ref4.prevState,
|
|
145
|
+
domAtPos = _ref4.domAtPos,
|
|
146
|
+
extensionHandlers = _ref4.extensionHandlers;
|
|
147
|
+
var state = view.state,
|
|
148
|
+
dispatch = view.dispatch;
|
|
149
|
+
var _getPluginState = getPluginState(state),
|
|
150
|
+
element = _getPluginState.element,
|
|
151
|
+
localId = _getPluginState.localId,
|
|
152
|
+
extensionProvider = _getPluginState.extensionProvider,
|
|
153
|
+
showContextPanel = _getPluginState.showContextPanel,
|
|
154
|
+
showEditButton = _getPluginState.showEditButton;
|
|
155
|
+
|
|
156
|
+
// This fetches the selected extension node, either by keyboard selection or click for all types of extensions
|
|
157
|
+
var selectedExtension = getSelectedExtension(state, true);
|
|
158
|
+
if (!selectedExtension) {
|
|
159
|
+
if (showContextPanel) {
|
|
160
|
+
clearEditingContext(state, dispatch);
|
|
161
|
+
}
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
var node = selectedExtension.node;
|
|
165
|
+
var newElement = getSelectedDomElement(state.schema, domAtPos, selectedExtension);
|
|
166
|
+
|
|
167
|
+
// In some cases, showEditButton can be stale and the edit button doesn't show - @see ED-15285
|
|
168
|
+
// To be safe, we update the showEditButton state here
|
|
169
|
+
var shouldUpdateEditButton = !showEditButton && extensionProvider && element === newElement && !getSelectedExtension(prevState, true);
|
|
170
|
+
var isNewNodeSelected = node.attrs.localId ? localId !== node.attrs.localId :
|
|
171
|
+
// This is the current assumption and it's wrong but we are keeping it
|
|
172
|
+
// as fallback in case we need to turn off `allowLocalIdGeneration`
|
|
173
|
+
element !== newElement;
|
|
174
|
+
if (isNewNodeSelected || shouldUpdateEditButton) {
|
|
175
|
+
if (showContextPanel) {
|
|
176
|
+
clearEditingContext(state, dispatch);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
var extensionType = node.attrs.extensionType;
|
|
180
|
+
var extensionHandler = extensionHandlers[extensionType];
|
|
181
|
+
|
|
182
|
+
// showEditButton might change async based on results from extension providers
|
|
183
|
+
var _showEditButton = shouldShowEditButton(extensionHandler, extensionProvider);
|
|
184
|
+
var updateExtension = getUpdateExtensionPromise(view, extensionHandler, extensionProvider).catch(function () {
|
|
185
|
+
// do nothing;
|
|
186
|
+
});
|
|
187
|
+
updateState({
|
|
188
|
+
localId: node.attrs.localId,
|
|
189
|
+
showContextPanel: false,
|
|
190
|
+
element: newElement,
|
|
191
|
+
showEditButton: _showEditButton,
|
|
192
|
+
updateExtension: updateExtension
|
|
193
|
+
})(state, dispatch);
|
|
194
|
+
}
|
|
195
|
+
// New DOM element doesn't necessarily mean it's a new Node
|
|
196
|
+
else if (element !== newElement) {
|
|
197
|
+
updateState({
|
|
198
|
+
element: newElement
|
|
199
|
+
})(state, dispatch);
|
|
200
|
+
}
|
|
201
|
+
return true;
|
|
202
|
+
};
|
|
209
203
|
var createPlugin = function createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher) {
|
|
210
204
|
var useLongPressSelection = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
211
205
|
var options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
|
|
@@ -225,67 +219,13 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
|
|
|
225
219
|
providerFactory.subscribe('extensionProvider', extensionProviderHandler);
|
|
226
220
|
providerFactory.subscribe('contextIdentificationProvider', contextIdentificationProviderHandler);
|
|
227
221
|
return {
|
|
228
|
-
update: function update(view) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
showContextPanel = _getPluginState.showContextPanel;
|
|
236
|
-
|
|
237
|
-
// This fetches the selected extension node, either by keyboard selection or click for all types of extensions
|
|
238
|
-
var selectedExtension = getSelectedExtension(state, true);
|
|
239
|
-
if (!selectedExtension) {
|
|
240
|
-
if (showContextPanel) {
|
|
241
|
-
clearEditingContext(state, dispatch);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// if an extension is no longer selected, but the plugin has cached the previous selected extension id/ref
|
|
245
|
-
// then this should clear those values so that if an exention is selected again, then this sees it as a change
|
|
246
|
-
// and updates the state correctly.
|
|
247
|
-
if (!!localId || !!element) {
|
|
248
|
-
updateState({
|
|
249
|
-
localId: undefined,
|
|
250
|
-
element: undefined
|
|
251
|
-
})(state, dispatch);
|
|
252
|
-
}
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
var node = selectedExtension.node;
|
|
256
|
-
var newElement = getSelectedDomElement(state.schema, domAtPos, selectedExtension);
|
|
257
|
-
|
|
258
|
-
// New node is selection
|
|
259
|
-
if (node.attrs.localId ? localId !== node.attrs.localId :
|
|
260
|
-
// This is the current assumption and it's wrong but we are keeping it
|
|
261
|
-
// as fallback in case we need to turn off `allowLocalIdGeneration`
|
|
262
|
-
element !== newElement) {
|
|
263
|
-
if (showContextPanel) {
|
|
264
|
-
clearEditingContext(state, dispatch);
|
|
265
|
-
}
|
|
266
|
-
var extensionType = node.attrs.extensionType;
|
|
267
|
-
var extensionHandler = extensionHandlers[extensionType];
|
|
268
|
-
|
|
269
|
-
// showEditButton might change async based on results from extension providers
|
|
270
|
-
var showEditButton = shouldShowEditButton(extensionHandler, extensionProvider);
|
|
271
|
-
var updateExtension = getUpdateExtensionPromise(view, extensionHandler, extensionProvider).catch(function () {
|
|
272
|
-
// do nothing;
|
|
273
|
-
});
|
|
274
|
-
updateState({
|
|
275
|
-
localId: node.attrs.localId,
|
|
276
|
-
showContextPanel: false,
|
|
277
|
-
element: newElement,
|
|
278
|
-
showEditButton: showEditButton,
|
|
279
|
-
updateExtension: updateExtension
|
|
280
|
-
})(state, dispatch);
|
|
281
|
-
}
|
|
282
|
-
// New DOM element doesn't necessarily mean it's a new Node
|
|
283
|
-
else if (element !== newElement) {
|
|
284
|
-
updateState({
|
|
285
|
-
element: newElement
|
|
286
|
-
})(state, dispatch);
|
|
287
|
-
}
|
|
288
|
-
return true;
|
|
222
|
+
update: function update(view, prevState) {
|
|
223
|
+
handleUpdate({
|
|
224
|
+
view: view,
|
|
225
|
+
prevState: prevState,
|
|
226
|
+
domAtPos: domAtPos,
|
|
227
|
+
extensionHandlers: extensionHandlers
|
|
228
|
+
});
|
|
289
229
|
},
|
|
290
230
|
destroy: function destroy() {
|
|
291
231
|
providerFactory.unsubscribe('extensionProvider', extensionProviderHandler);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { getExtensionModuleNode } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import { updateState } from '../commands';
|
|
5
|
+
import { getSelectedExtension } from '../utils';
|
|
6
|
+
var maybeGetUpdateMethodFromExtensionProvider = /*#__PURE__*/function () {
|
|
7
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(view, extensionProvider) {
|
|
8
|
+
var nodeWithPos, _nodeWithPos$node$att, extensionType, extensionKey, extensionModuleNode, newNodeWithPos;
|
|
9
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
10
|
+
while (1) {
|
|
11
|
+
switch (_context.prev = _context.next) {
|
|
12
|
+
case 0:
|
|
13
|
+
nodeWithPos = getSelectedExtension(view.state, true);
|
|
14
|
+
if (nodeWithPos) {
|
|
15
|
+
_context.next = 3;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
throw new Error('There is no selection');
|
|
19
|
+
case 3:
|
|
20
|
+
_nodeWithPos$node$att = nodeWithPos.node.attrs, extensionType = _nodeWithPos$node$att.extensionType, extensionKey = _nodeWithPos$node$att.extensionKey;
|
|
21
|
+
_context.next = 6;
|
|
22
|
+
return getExtensionModuleNode(extensionProvider, extensionType, extensionKey);
|
|
23
|
+
case 6:
|
|
24
|
+
extensionModuleNode = _context.sent;
|
|
25
|
+
newNodeWithPos = getSelectedExtension(view.state, true);
|
|
26
|
+
if (!(newNodeWithPos && newNodeWithPos.node.attrs.extensionType === extensionType && newNodeWithPos.node.attrs.extensionKey === extensionKey && newNodeWithPos.pos === nodeWithPos.pos && extensionModuleNode)) {
|
|
27
|
+
_context.next = 10;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
return _context.abrupt("return", extensionModuleNode.update);
|
|
31
|
+
case 10:
|
|
32
|
+
case "end":
|
|
33
|
+
return _context.stop();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, _callee);
|
|
37
|
+
}));
|
|
38
|
+
return function maybeGetUpdateMethodFromExtensionProvider(_x, _x2) {
|
|
39
|
+
return _ref.apply(this, arguments);
|
|
40
|
+
};
|
|
41
|
+
}();
|
|
42
|
+
export var updateEditButton = /*#__PURE__*/function () {
|
|
43
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(view, extensionProvider) {
|
|
44
|
+
var updateMethod;
|
|
45
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
46
|
+
while (1) {
|
|
47
|
+
switch (_context2.prev = _context2.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
_context2.prev = 0;
|
|
50
|
+
_context2.next = 3;
|
|
51
|
+
return maybeGetUpdateMethodFromExtensionProvider(view, extensionProvider);
|
|
52
|
+
case 3:
|
|
53
|
+
updateMethod = _context2.sent;
|
|
54
|
+
updateState({
|
|
55
|
+
showEditButton: !!updateMethod,
|
|
56
|
+
updateExtension: updateMethod && Promise.resolve(updateMethod) || undefined
|
|
57
|
+
})(view.state, view.dispatch);
|
|
58
|
+
return _context2.abrupt("return", updateMethod);
|
|
59
|
+
case 8:
|
|
60
|
+
_context2.prev = 8;
|
|
61
|
+
_context2.t0 = _context2["catch"](0);
|
|
62
|
+
case 10:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context2.stop();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, _callee2, null, [[0, 8]]);
|
|
68
|
+
}));
|
|
69
|
+
return function updateEditButton(_x3, _x4) {
|
|
70
|
+
return _ref2.apply(this, arguments);
|
|
71
|
+
};
|
|
72
|
+
}();
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Transforms FeatureFlags to a type safe string array of the enabled feature flags.
|
|
3
|
-
*
|
|
4
|
-
* Useful for analytics and analysis purposes.
|
|
5
|
-
*/
|
|
6
|
-
export function getEnabledFeatureFlagKeys(featureFlags) {
|
|
7
|
-
return Object.keys(featureFlags).filter(function (key) {
|
|
8
|
-
return featureFlags[key] === true;
|
|
9
|
-
});
|
|
10
|
-
}
|
|
1
|
+
export { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
@@ -5,7 +5,6 @@ import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytic
|
|
|
5
5
|
import { blur, toggleMatchCase } from './commands';
|
|
6
6
|
import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
|
|
7
7
|
import { TRIGGER_METHOD } from '../analytics';
|
|
8
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
9
8
|
var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithState(props) {
|
|
10
9
|
var popupsBoundariesElement = props.popupsBoundariesElement,
|
|
11
10
|
popupsMountPoint = props.popupsMountPoint,
|
|
@@ -13,7 +12,8 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
|
|
|
13
12
|
isToolbarReducedSpacing = props.isToolbarReducedSpacing,
|
|
14
13
|
editorView = props.editorView,
|
|
15
14
|
containerElement = props.containerElement,
|
|
16
|
-
dispatchAnalyticsEvent = props.dispatchAnalyticsEvent
|
|
15
|
+
dispatchAnalyticsEvent = props.dispatchAnalyticsEvent,
|
|
16
|
+
featureFlags = props.featureFlags;
|
|
17
17
|
if (!editorView) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
@@ -95,8 +95,7 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
|
|
|
95
95
|
var handleToggleMatchCase = function handleToggleMatchCase() {
|
|
96
96
|
dispatchCommand(toggleMatchCase());
|
|
97
97
|
};
|
|
98
|
-
var
|
|
99
|
-
findReplaceMatchCase = _getFeatureFlags.findReplaceMatchCase;
|
|
98
|
+
var findReplaceMatchCase = featureFlags.findReplaceMatchCase;
|
|
100
99
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
101
100
|
debounce: false,
|
|
102
101
|
plugins: {
|
|
@@ -2,7 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { createPlugin } from './plugin';
|
|
3
3
|
import keymapPlugin from './keymap';
|
|
4
4
|
import FindReplaceToolbarButtonWithState from './FindReplaceToolbarButtonWithState';
|
|
5
|
-
export var findReplacePlugin = function findReplacePlugin(props) {
|
|
5
|
+
export var findReplacePlugin = function findReplacePlugin(props, api) {
|
|
6
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
7
|
+
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()) || {};
|
|
6
8
|
return {
|
|
7
9
|
name: 'findReplace',
|
|
8
10
|
pmPlugins: function pmPlugins() {
|
|
@@ -38,7 +40,8 @@ export var findReplacePlugin = function findReplacePlugin(props) {
|
|
|
38
40
|
editorView: editorView,
|
|
39
41
|
containerElement: containerElement,
|
|
40
42
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
41
|
-
takeFullWidth: props.takeFullWidth
|
|
43
|
+
takeFullWidth: props.takeFullWidth,
|
|
44
|
+
featureFlags: featureFlags
|
|
42
45
|
});
|
|
43
46
|
}
|
|
44
47
|
}
|
|
@@ -22,7 +22,6 @@ import { ConfirmationModal } from './ui/ConfirmationModal';
|
|
|
22
22
|
import { ToolbarLoader } from './ui/ToolbarLoader';
|
|
23
23
|
import { findNode } from './utils';
|
|
24
24
|
import { ErrorBoundary } from '../../ui/ErrorBoundary';
|
|
25
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
26
25
|
import { processCopyButtonItems } from '../copy-button/toolbar';
|
|
27
26
|
import forceFocusPlugin from './pm-plugins/force-focus';
|
|
28
27
|
export var getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
@@ -114,7 +113,9 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
|
|
|
114
113
|
function filterUndefined(x) {
|
|
115
114
|
return !!x;
|
|
116
115
|
}
|
|
117
|
-
var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
116
|
+
var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
117
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
118
|
+
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()) || {};
|
|
118
119
|
return {
|
|
119
120
|
name: 'floatingToolbar',
|
|
120
121
|
pmPlugins: function pmPlugins() {
|
|
@@ -208,7 +209,7 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
|
208
209
|
var _ref5 = floatingToolbarData || {},
|
|
209
210
|
confirmDialogForItem = _ref5.confirmDialogForItem;
|
|
210
211
|
var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
211
|
-
var scrollable =
|
|
212
|
+
var scrollable = featureFlags.floatingToolbarCopyButton && config.scrollable;
|
|
212
213
|
var 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;
|
|
213
214
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
214
215
|
component: ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
@@ -251,8 +252,10 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
|
251
252
|
popupsScrollableElement: popupsScrollableElement,
|
|
252
253
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
253
254
|
extensionsProvider: extensionsState === null || extensionsState === void 0 ? void 0 : extensionsState.extensionProvider,
|
|
254
|
-
scrollable: scrollable
|
|
255
|
+
scrollable: scrollable,
|
|
256
|
+
featureFlags: featureFlags
|
|
255
257
|
})), /*#__PURE__*/React.createElement(ConfirmationModal, {
|
|
258
|
+
testId: "ak-floating-toolbar-confirmation-modal",
|
|
256
259
|
options: confirmDialogOptions,
|
|
257
260
|
onConfirm: function onConfirm() {
|
|
258
261
|
var isChecked = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -261,11 +264,16 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
|
|
|
261
264
|
} else {
|
|
262
265
|
dispatchCommand(confirmButtonItem.onClick);
|
|
263
266
|
}
|
|
264
|
-
|
|
265
|
-
} // When closed without clicking OK or cancel buttons
|
|
266
|
-
,
|
|
267
|
+
},
|
|
267
268
|
onClose: function onClose() {
|
|
268
269
|
dispatchCommand(hideConfirmDialog());
|
|
270
|
+
// Need to set focus to Editor here,
|
|
271
|
+
// As when the Confirmation dialog pop up, and user interacts with the dialog, Editor loses focus.
|
|
272
|
+
// So when Confirmation dialog is closed, Editor does not have the focus, then cursor goes to the position 1 of the doc,
|
|
273
|
+
// instead of the cursor position before the dialog pop up.
|
|
274
|
+
if (!editorView.hasFocus()) {
|
|
275
|
+
editorView.focus();
|
|
276
|
+
}
|
|
269
277
|
}
|
|
270
278
|
}));
|
|
271
279
|
}
|
|
@@ -64,7 +64,8 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
64
64
|
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
65
65
|
appearance: "warning",
|
|
66
66
|
onClick: function onClick() {
|
|
67
|
-
|
|
67
|
+
onConfirm(isChecked);
|
|
68
|
+
onClose();
|
|
68
69
|
},
|
|
69
70
|
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
70
71
|
}, okButtonLabel)));
|
|
@@ -32,8 +32,11 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
32
32
|
};
|
|
33
33
|
var updateEmoji = function updateEmoji(emoji) {
|
|
34
34
|
setIsPopupOpen(false);
|
|
35
|
-
props.editorView && props.editorView.focus();
|
|
36
35
|
props.onChange && props.onChange(emoji);
|
|
36
|
+
requestAnimationFrame(function () {
|
|
37
|
+
var _props$editorView;
|
|
38
|
+
(_props$editorView = props.editorView) === null || _props$editorView === void 0 ? void 0 : _props$editorView.focus();
|
|
39
|
+
});
|
|
37
40
|
};
|
|
38
41
|
var isDetachedElement = function isDetachedElement(el) {
|
|
39
42
|
return !document.body.contains(el);
|
|
@@ -47,6 +50,11 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
47
50
|
togglePopup();
|
|
48
51
|
}
|
|
49
52
|
};
|
|
53
|
+
var handleEmojiPressEscape = function handleEmojiPressEscape() {
|
|
54
|
+
var _buttonRef$current;
|
|
55
|
+
setIsPopupOpen(false);
|
|
56
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
57
|
+
};
|
|
50
58
|
var renderPicker = function renderPicker(providers) {
|
|
51
59
|
if (!providers.emojiProvider) {
|
|
52
60
|
return null;
|
|
@@ -55,7 +63,8 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
55
63
|
emojiProvider: providers.emojiProvider,
|
|
56
64
|
onSelection: updateEmoji,
|
|
57
65
|
onPickerRef: function onPickerRef() {},
|
|
58
|
-
handleClickOutside: handleEmojiClickOutside
|
|
66
|
+
handleClickOutside: handleEmojiClickOutside,
|
|
67
|
+
handleEscapeKeydown: handleEmojiPressEscape
|
|
59
68
|
});
|
|
60
69
|
};
|
|
61
70
|
var renderPopup = function renderPopup() {
|
|
@@ -72,7 +81,8 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
72
81
|
// if the toolbar is scrollable, this will be mounted in the root editor
|
|
73
82
|
// we need an index of > 500 to display over it
|
|
74
83
|
,
|
|
75
|
-
zIndex: props.setDisableParentScroll ? 600 : undefined
|
|
84
|
+
zIndex: props.setDisableParentScroll ? 600 : undefined,
|
|
85
|
+
focusTrap: true
|
|
76
86
|
}, jsx(WithProviders, {
|
|
77
87
|
providers: ['emojiProvider'],
|
|
78
88
|
providerFactory: props.providerFactory,
|
|
@@ -23,7 +23,8 @@ export var SimpleModal = function SimpleModal(props) {
|
|
|
23
23
|
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
24
24
|
appearance: "warning",
|
|
25
25
|
onClick: function onClick() {
|
|
26
|
-
|
|
26
|
+
onConfirm();
|
|
27
|
+
onClose();
|
|
27
28
|
},
|
|
28
29
|
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
29
30
|
}, okButtonLabel)));
|