@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
|
@@ -25,9 +25,12 @@ function getSpellCheck(featureFlags) {
|
|
|
25
25
|
* which is used by both current and archv3 editors.
|
|
26
26
|
*/
|
|
27
27
|
export function createFeatureFlagsFromProps(props) {
|
|
28
|
-
var _props$featureFlags, _props$
|
|
28
|
+
var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45, _props$featureFlags46, _props$featureFlags47;
|
|
29
29
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
30
30
|
var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
31
|
+
|
|
32
|
+
// duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
|
|
33
|
+
var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
|
|
31
34
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
32
35
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
33
36
|
interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
|
|
@@ -38,37 +41,39 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
38
41
|
singleLayout: _typeof(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
39
42
|
undoRedoButtons: props.allowUndoRedoButtons,
|
|
40
43
|
catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
|
|
41
|
-
stickyHeadersOptimization: typeof ((_props$
|
|
42
|
-
initialRenderOptimization: typeof ((_props$
|
|
43
|
-
mouseMoveOptimization: typeof ((_props$
|
|
44
|
-
tableRenderOptimization: typeof ((_props$
|
|
45
|
-
tableOverflowShadowsOptimization: typeof ((_props$
|
|
44
|
+
stickyHeadersOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.stickyHeadersOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
|
|
45
|
+
initialRenderOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.initialRenderOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
|
|
46
|
+
mouseMoveOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.mouseMoveOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
|
|
47
|
+
tableRenderOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableRenderOptimization) : _typeof(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
|
|
48
|
+
tableOverflowShadowsOptimization: typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.tableOverflowShadowsOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
|
|
46
49
|
extendFloatingToolbar: Boolean(_typeof(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
|
|
47
|
-
showAvatarGroupAsPlugin: Boolean(typeof ((_props$
|
|
48
|
-
errorBoundaryDocStructure: Boolean(typeof ((_props$
|
|
49
|
-
synchronyErrorDocStructure: Boolean(typeof ((_props$
|
|
50
|
-
enableViewUpdateSubscription: Boolean(typeof ((_props$
|
|
51
|
-
collabAvatarScroll: Boolean(typeof ((_props$
|
|
52
|
-
ufo: Boolean(typeof ((_props$
|
|
53
|
-
twoLineEditorToolbar: Boolean(typeof ((_props$
|
|
54
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$
|
|
55
|
-
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$
|
|
50
|
+
showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.showAvatarGroupAsPlugin) : false),
|
|
51
|
+
errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.useErrorBoundaryDocStructure) : false),
|
|
52
|
+
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.synchronyErrorDocStructure) : false),
|
|
53
|
+
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.enableViewUpdateSubscription) : false),
|
|
54
|
+
collabAvatarScroll: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.collabAvatarScroll) : false),
|
|
55
|
+
ufo: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.ufo) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.ufo) : false),
|
|
56
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.twoLineEditorToolbar) : false),
|
|
57
|
+
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactions) : false)),
|
|
58
|
+
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.saferDispatchedTransactionsAnalyticsOnly) : false)),
|
|
56
59
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
57
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
60
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
58
61
|
tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
|
|
59
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
60
|
-
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
61
|
-
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$
|
|
62
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
62
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
|
|
63
|
+
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
|
|
64
|
+
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
|
|
65
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
63
66
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
64
67
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
65
68
|
// are included (they are not kebab cased)
|
|
66
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
67
|
-
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$
|
|
68
|
-
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$
|
|
69
|
-
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$
|
|
69
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
|
|
70
|
+
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.listNumberContinuity) === true,
|
|
71
|
+
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags42 = props.featureFlags) === null || _props$featureFlags42 === void 0 ? void 0 : _props$featureFlags42.restartNumberedListsToolbar) === true,
|
|
72
|
+
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44.useSomewhatSemanticTextColorNames) : false)),
|
|
70
73
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
71
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
72
|
-
useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$
|
|
74
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags46 = props.featureFlags) !== null && _props$featureFlags46 !== void 0 && _props$featureFlags46['prevent-popup-overflow']) : false),
|
|
75
|
+
useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags47 = props.featureFlags) === null || _props$featureFlags47 === void 0 ? void 0 : _props$featureFlags47.useEditorNext) === true,
|
|
76
|
+
// duplicated logic from `create-plugins-list.ts` due to presets not being finalised
|
|
77
|
+
useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
|
|
73
78
|
});
|
|
74
79
|
}
|
|
@@ -3,4 +3,15 @@ export function sortByOrder(item) {
|
|
|
3
3
|
return function (a, b) {
|
|
4
4
|
return Ranks[item].indexOf(a.name) - Ranks[item].indexOf(b.name);
|
|
5
5
|
};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// while functionally the same, in order to avoid potentially rewriting the ~10
|
|
9
|
+
// existing implementations of the above function I decided creating a separate
|
|
10
|
+
// function avoided that whole mess. If someone can think of a better way to implement
|
|
11
|
+
// the above and below into a single function please do so
|
|
12
|
+
|
|
13
|
+
export function sortByOrderWithTypeName(item) {
|
|
14
|
+
return function (a, b) {
|
|
15
|
+
return Ranks[item].indexOf(a.type.name) - Ranks[item].indexOf(b.type.name);
|
|
16
|
+
};
|
|
6
17
|
}
|
|
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
7
|
import _extends from "@babel/runtime/helpers/extends";
|
|
7
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -10,6 +11,7 @@ import React from 'react';
|
|
|
10
11
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
11
12
|
import Editor from '../editor';
|
|
12
13
|
import EditorNext from './index';
|
|
14
|
+
import { defaultProps } from './utils/editorPropTypes';
|
|
13
15
|
import useUniversalPreset from '../labs/next/presets/useUniversalPreset';
|
|
14
16
|
var EditorNextWrapper = function EditorNextWrapper(_ref) {
|
|
15
17
|
var props = _ref.props;
|
|
@@ -41,4 +43,5 @@ var EditorMigrationComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
41
43
|
}]);
|
|
42
44
|
return EditorMigrationComponent;
|
|
43
45
|
}(React.Component);
|
|
46
|
+
_defineProperty(EditorMigrationComponent, "defaultProps", defaultProps);
|
|
44
47
|
export { EditorMigrationComponent as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { nextMajorVersion } from '../../version-wrapper';
|
|
2
2
|
export default function deprecationWarnings(props) {
|
|
3
|
-
var _props$allowTextColor;
|
|
4
3
|
if (process.env.NODE_ENV === 'production') {
|
|
5
4
|
return;
|
|
6
5
|
}
|
|
@@ -32,8 +31,4 @@ export default function deprecationWarnings(props) {
|
|
|
32
31
|
// eslint-disable-next-line no-console
|
|
33
32
|
console.warn("Advanced table options are deprecated (except isHeaderRowRequired) to continue using advanced table features use - <Editor allowTables={{ advanced: true }} /> [Will be changed in editor-core@".concat(nextVersion, "]"));
|
|
34
33
|
}
|
|
35
|
-
if (props.hasOwnProperty('allowTextColor') && typeof props.allowTextColor !== 'boolean' && (props === null || props === void 0 ? void 0 : (_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) !== undefined) {
|
|
36
|
-
// eslint-disable-next-line no-console
|
|
37
|
-
console.warn("\"allowMoreTextColors\" field of \"allowTextColor\" property is deprecated. It will be removedin editor-core@".concat(nextVersion, ". The color palette now shows more colors by default."));
|
|
38
|
-
}
|
|
39
34
|
}
|
|
@@ -95,7 +95,8 @@ function FullPage(props) {
|
|
|
95
95
|
editorView: config.editorView,
|
|
96
96
|
eventDispatcher: config.eventDispatcher,
|
|
97
97
|
inviteToEditHandler: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.inviteToEditHandler,
|
|
98
|
-
isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected
|
|
98
|
+
isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected,
|
|
99
|
+
featureFlags: {}
|
|
99
100
|
}), primaryToolbarComponents)), jsx("div", {
|
|
100
101
|
css: contentArea
|
|
101
102
|
}, jsx(ContentStyles, {
|
|
@@ -13,6 +13,7 @@ import typeAheadPlugin from '../../../plugins/type-ahead';
|
|
|
13
13
|
import submitEditorPlugin from '../../../plugins/submit-editor';
|
|
14
14
|
import fakeTextCursorPlugin from '../../../plugins/fake-text-cursor';
|
|
15
15
|
import featureFlagsContextPlugin from '../../../plugins/feature-flags-context';
|
|
16
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
16
17
|
import floatingToolbarPlugin from '../../../plugins/floating-toolbar';
|
|
17
18
|
import clipboardPlugin from '../../../plugins/clipboard';
|
|
18
19
|
import placeholderPlugin from '../../../plugins/placeholder';
|
|
@@ -29,7 +30,7 @@ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
|
29
30
|
* their placement in the editor toolbar
|
|
30
31
|
*/
|
|
31
32
|
export function createDefaultPreset(options) {
|
|
32
|
-
var preset = new EditorPresetBuilder().add([pastePlugin, options.paste]).add(clipboardPlugin).add([basePlugin, options.base]).maybeAdd(undoRedoPlugin, function (p, builder) {
|
|
33
|
+
var preset = new EditorPresetBuilder().add([featureFlagsPlugin, options.featureFlags || {}]).add([pastePlugin, options.paste]).add(clipboardPlugin).add([basePlugin, options.base]).maybeAdd(undoRedoPlugin, function (p, builder) {
|
|
33
34
|
var _options$featureFlags;
|
|
34
35
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
35
36
|
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin } from '../../../plugins';
|
|
5
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
|
|
6
6
|
import { tablesPlugin } from '@atlaskit/editor-plugin-table';
|
|
7
7
|
import { isFullPage as fullPageCheck } from '../../../utils/is-full-page';
|
|
8
8
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
@@ -111,7 +111,8 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
111
111
|
uploadErrorHandler: props.uploadErrorHandler,
|
|
112
112
|
waitForMediaUpload: props.waitForMediaUpload,
|
|
113
113
|
isCopyPasteEnabled: !isMobile,
|
|
114
|
-
alignLeftOnInsert: alignLeftOnInsert
|
|
114
|
+
alignLeftOnInsert: alignLeftOnInsert,
|
|
115
|
+
getEditorFeatureFlags: getEditorFeatureFlags
|
|
115
116
|
})]);
|
|
116
117
|
}
|
|
117
118
|
return builder;
|
|
@@ -366,6 +367,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
366
367
|
}]);
|
|
367
368
|
}
|
|
368
369
|
return builder;
|
|
370
|
+
}).maybeAdd(borderPlugin, function (plugin, builder) {
|
|
371
|
+
if (props.UNSAFE_allowBorderMark) {
|
|
372
|
+
return builder.add(plugin);
|
|
373
|
+
}
|
|
374
|
+
return builder;
|
|
369
375
|
}).maybeAdd(fragmentMarkPlugin, function (plugin, builder) {
|
|
370
376
|
if (props.allowFragmentMark) {
|
|
371
377
|
return builder.add(plugin);
|
|
@@ -17,7 +17,8 @@ import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
|
17
17
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
18
18
|
import Dropdown from '../../../../ui/Dropdown';
|
|
19
19
|
import Alignment from '../../../../ui/Alignment';
|
|
20
|
-
import { expandIconWrapper,
|
|
20
|
+
import { expandIconWrapper, triggerWrapper, wrapper } from './styles';
|
|
21
|
+
import { separatorStyles } from '../../../../ui/styles';
|
|
21
22
|
import { IconMap } from './icon-map';
|
|
22
23
|
import { messages } from './messages';
|
|
23
24
|
export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
@@ -151,7 +152,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
151
152
|
},
|
|
152
153
|
selectedAlignment: pluginState.align
|
|
153
154
|
})), jsx("span", {
|
|
154
|
-
css:
|
|
155
|
+
css: separatorStyles
|
|
155
156
|
}));
|
|
156
157
|
}
|
|
157
158
|
}, {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { N30 } from '@atlaskit/theme/colors';
|
|
5
4
|
export var triggerWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
6
|
-
export var
|
|
7
|
-
export var
|
|
8
|
-
export var expandIconWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
5
|
+
export var wrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n div {\n display: flex;\n }\n"])));
|
|
6
|
+
export var expandIconWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
@@ -10,10 +10,9 @@ import { isPerformanceAPIAvailable, measureRender } from '@atlaskit/editor-commo
|
|
|
10
10
|
import { ACTION, EVENT_TYPE } from './types';
|
|
11
11
|
import { analyticsPluginKey } from './plugin-key';
|
|
12
12
|
import { fireAnalyticsEvent, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
|
|
13
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
14
13
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
15
14
|
import { generateUndoRedoInputSoucePayload } from '../undo-redo/undo-redo-input-source';
|
|
16
|
-
function createPlugin(options) {
|
|
15
|
+
function createPlugin(options, featureFlags) {
|
|
17
16
|
if (!options || !options.createAnalyticsEvent) {
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
@@ -27,14 +26,13 @@ function createPlugin(options) {
|
|
|
27
26
|
});
|
|
28
27
|
},
|
|
29
28
|
apply: function apply(tr, pluginState, _, state) {
|
|
30
|
-
var _getFeatureFlags;
|
|
31
29
|
if (pluginState.createAnalyticsEvent !== options.createAnalyticsEvent) {
|
|
32
30
|
// When the plugin state is reconfigured, the init function isn't called again
|
|
33
31
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
34
32
|
createAnalyticsEvent: options.createAnalyticsEvent
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
|
-
if (
|
|
35
|
+
if (featureFlags.catchAllTracking) {
|
|
38
36
|
var analyticsEventWithChannel = getAnalyticsEventsFromTransaction(tr);
|
|
39
37
|
if (analyticsEventWithChannel.length > 0) {
|
|
40
38
|
var _iterator = _createForOfIteratorHelper(analyticsEventWithChannel),
|
|
@@ -81,14 +79,16 @@ function createPlugin(options) {
|
|
|
81
79
|
}
|
|
82
80
|
});
|
|
83
81
|
}
|
|
84
|
-
var analyticsPlugin = function analyticsPlugin(options) {
|
|
82
|
+
var analyticsPlugin = function analyticsPlugin(options, api) {
|
|
83
|
+
var _api$dependencies$fea;
|
|
84
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies$fea = api.dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
85
85
|
return {
|
|
86
86
|
name: 'analytics',
|
|
87
87
|
pmPlugins: function pmPlugins() {
|
|
88
88
|
return [{
|
|
89
89
|
name: 'analyticsPlugin',
|
|
90
90
|
plugin: function plugin() {
|
|
91
|
-
return createPlugin(options);
|
|
91
|
+
return createPlugin(options, featureFlags);
|
|
92
92
|
}
|
|
93
93
|
}];
|
|
94
94
|
},
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import AvatarGroupPluginWrapper from './ui/AvatarGroupPluginWrapper';
|
|
3
|
-
var avatarGroup = function avatarGroup(props) {
|
|
3
|
+
var avatarGroup = function avatarGroup(props, api) {
|
|
4
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
5
|
+
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()) || {};
|
|
4
6
|
return {
|
|
5
7
|
name: 'avatarGroup',
|
|
6
8
|
primaryToolbarComponent: function primaryToolbarComponent(_ref) {
|
|
@@ -17,7 +19,8 @@ var avatarGroup = function avatarGroup(props) {
|
|
|
17
19
|
editorView: editorView,
|
|
18
20
|
eventDispatcher: eventDispatcher,
|
|
19
21
|
collabEdit: props.collabEdit,
|
|
20
|
-
takeFullWidth: props.takeFullWidth
|
|
22
|
+
takeFullWidth: props.takeFullWidth,
|
|
23
|
+
featureFlags: featureFlags
|
|
21
24
|
});
|
|
22
25
|
}
|
|
23
26
|
};
|
|
@@ -10,7 +10,8 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../ana
|
|
|
10
10
|
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 0;\n align-items: center;\n & > div {\n margin-right: 0;\n }\n"])));
|
|
11
11
|
var toolbarButtonWrapperFullWidth = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n flex-grow: 1;\n"])), toolbarButtonWrapper);
|
|
12
12
|
var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
13
|
-
var dispatchAnalyticsEvent = props.dispatchAnalyticsEvent
|
|
13
|
+
var dispatchAnalyticsEvent = props.dispatchAnalyticsEvent,
|
|
14
|
+
featureFlags = props.featureFlags;
|
|
14
15
|
var intl = useIntl();
|
|
15
16
|
useEffect(function () {
|
|
16
17
|
if (!dispatchAnalyticsEvent) {
|
|
@@ -32,7 +33,8 @@ var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
|
32
33
|
eventDispatcher: props.eventDispatcher,
|
|
33
34
|
inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
|
|
34
35
|
inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
|
|
35
|
-
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected
|
|
36
|
+
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected,
|
|
37
|
+
featureFlags: featureFlags
|
|
36
38
|
}));
|
|
37
39
|
};
|
|
38
40
|
export default AvatarGroupPluginWrapper;
|
|
@@ -21,7 +21,9 @@ import frozenEditor from './pm-plugins/frozen-editor';
|
|
|
21
21
|
import compositionPlugin from './pm-plugins/composition';
|
|
22
22
|
// Chrome >= 88
|
|
23
23
|
export var isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
|
|
24
|
-
var basePlugin = function basePlugin(options) {
|
|
24
|
+
var basePlugin = function basePlugin(options, api) {
|
|
25
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
26
|
+
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()) || {};
|
|
25
27
|
return {
|
|
26
28
|
name: 'base',
|
|
27
29
|
pmPlugins: function pmPlugins() {
|
|
@@ -126,7 +128,7 @@ var basePlugin = function basePlugin(options) {
|
|
|
126
128
|
plugins.push({
|
|
127
129
|
name: 'disableSpellcheckingPlugin',
|
|
128
130
|
plugin: function plugin() {
|
|
129
|
-
return disableSpellcheckingPlugin();
|
|
131
|
+
return disableSpellcheckingPlugin(featureFlags);
|
|
130
132
|
}
|
|
131
133
|
});
|
|
132
134
|
plugins.push({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
4
3
|
import { browser as browserEnv } from '@atlaskit/editor-common/utils';
|
|
5
4
|
function getCurrentBrowserAndVersion() {
|
|
6
5
|
switch (true) {
|
|
@@ -27,12 +26,11 @@ function getCurrentBrowserAndVersion() {
|
|
|
27
26
|
}
|
|
28
27
|
return undefined;
|
|
29
28
|
}
|
|
30
|
-
export default (function () {
|
|
29
|
+
export default (function (featureFlags) {
|
|
31
30
|
return new SafePlugin({
|
|
32
31
|
key: new PluginKey('disableSpellchecking'),
|
|
33
32
|
props: {
|
|
34
33
|
attributes: function attributes(editorState) {
|
|
35
|
-
var featureFlags = getFeatureFlags(editorState) || undefined;
|
|
36
34
|
if (!featureFlags) {
|
|
37
35
|
return;
|
|
38
36
|
}
|
|
@@ -38,10 +38,5 @@ export var BlockTypeButton = function BlockTypeButton(props) {
|
|
|
38
38
|
})))
|
|
39
39
|
}, !props.isSmall && jsx("span", {
|
|
40
40
|
css: [buttonContentStyle, props.isReducedSpacing && buttonContentReducedSpacingStyle]
|
|
41
|
-
}, jsx(FormattedMessage, props.title || NORMAL_TEXT.title)
|
|
42
|
-
style: {
|
|
43
|
-
overflow: 'hidden',
|
|
44
|
-
height: 0
|
|
45
|
-
}
|
|
46
|
-
}, props.children)));
|
|
41
|
+
}, jsx(FormattedMessage, props.title || NORMAL_TEXT.title)));
|
|
47
42
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
3
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -17,7 +16,6 @@ import { injectIntl } from 'react-intl-next';
|
|
|
17
16
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
18
17
|
import DropdownMenu from '../../../../ui/DropdownMenu';
|
|
19
18
|
import { separatorStyles, wrapperStyle } from '../../../../ui/styles';
|
|
20
|
-
import { NORMAL_TEXT } from '../../types';
|
|
21
19
|
import { blockTypeMenuItemStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
|
|
22
20
|
import { tooltip, findKeymapByDescription } from '../../../../keymaps';
|
|
23
21
|
import { BlockTypeButton } from './blocktype-button';
|
|
@@ -129,10 +127,6 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
129
127
|
}).map(function (blockType) {
|
|
130
128
|
return blockType.title;
|
|
131
129
|
});
|
|
132
|
-
var longestDropdownMenuItem = [NORMAL_TEXT].concat(_toConsumableArray(availableBlockTypes)).reduce(function (longest, item) {
|
|
133
|
-
var itemTitle = formatMessage(item.title);
|
|
134
|
-
return itemTitle.length >= longest.length ? itemTitle : longest;
|
|
135
|
-
}, '');
|
|
136
130
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
|
137
131
|
var items = this.createItems();
|
|
138
132
|
return jsx("span", {
|
|
@@ -167,7 +161,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
167
161
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
168
162
|
formatMessage: formatMessage,
|
|
169
163
|
"aria-expanded": active
|
|
170
|
-
}
|
|
164
|
+
})), jsx("span", {
|
|
171
165
|
css: separatorStyles
|
|
172
166
|
}));
|
|
173
167
|
}
|
|
@@ -183,7 +177,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
183
177
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
184
178
|
formatMessage: formatMessage,
|
|
185
179
|
"aria-expanded": active
|
|
186
|
-
}
|
|
180
|
+
}), jsx("span", {
|
|
187
181
|
css: separatorStyles
|
|
188
182
|
}));
|
|
189
183
|
}
|
|
@@ -7,7 +7,9 @@ import { createPlugin } from './pm-plugins/main';
|
|
|
7
7
|
import { floatingToolbar } from './toolbar';
|
|
8
8
|
import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
|
|
9
9
|
import { cardKeymap } from './pm-plugins/keymap';
|
|
10
|
-
var cardPlugin = function cardPlugin(options) {
|
|
10
|
+
var cardPlugin = function cardPlugin(options, api) {
|
|
11
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
12
|
+
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()) || {};
|
|
11
13
|
return {
|
|
12
14
|
name: 'card',
|
|
13
15
|
nodes: function nodes() {
|
|
@@ -55,7 +57,7 @@ var cardPlugin = function cardPlugin(options) {
|
|
|
55
57
|
});
|
|
56
58
|
},
|
|
57
59
|
pluginsOptions: {
|
|
58
|
-
floatingToolbar: floatingToolbar(options, options.platform, options.linkPicker)
|
|
60
|
+
floatingToolbar: floatingToolbar(options, featureFlags, options.platform, options.linkPicker)
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
};
|
|
@@ -24,7 +24,6 @@ import { messages } from './messages';
|
|
|
24
24
|
import buildLayoutButtons from '../../ui/MediaAndEmbedsToolbar';
|
|
25
25
|
import { buildOpenedSettingsPayload, buildVisitedLinkPayload } from '../../utils/linking-utils';
|
|
26
26
|
import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME } from './styles';
|
|
27
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
28
27
|
export var removeCard = function removeCard(state, dispatch) {
|
|
29
28
|
if (!(state.selection instanceof NodeSelection)) {
|
|
30
29
|
return false;
|
|
@@ -72,9 +71,8 @@ export var openLinkSettings = function openLinkSettings(state, dispatch) {
|
|
|
72
71
|
}
|
|
73
72
|
return true;
|
|
74
73
|
};
|
|
75
|
-
export var floatingToolbar = function floatingToolbar(cardOptions, platform, linkPickerOptions) {
|
|
74
|
+
export var floatingToolbar = function floatingToolbar(cardOptions, featureFlags, platform, linkPickerOptions) {
|
|
76
75
|
return function (state, intl, providerFactory) {
|
|
77
|
-
var _linkPickerOptions$pl;
|
|
78
76
|
var _state$schema$nodes = state.schema.nodes,
|
|
79
77
|
inlineCard = _state$schema$nodes.inlineCard,
|
|
80
78
|
blockCard = _state$schema$nodes.blockCard,
|
|
@@ -101,12 +99,11 @@ export var floatingToolbar = function floatingToolbar(cardOptions, platform, lin
|
|
|
101
99
|
/**
|
|
102
100
|
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
|
103
101
|
*/
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
preventPopupOverflow = _getFeatureFlags.preventPopupOverflow;
|
|
102
|
+
var lpLinkPicker = featureFlags.lpLinkPicker,
|
|
103
|
+
lpLinkPickerFocusTrap = featureFlags.lpLinkPickerFocusTrap,
|
|
104
|
+
preventPopupOverflow = featureFlags.preventPopupOverflow;
|
|
108
105
|
var shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
109
|
-
var isLinkPickerEnabled = !!lpLinkPicker
|
|
106
|
+
var isLinkPickerEnabled = !!lpLinkPicker;
|
|
110
107
|
return _objectSpread(_objectSpread({
|
|
111
108
|
title: intl.formatMessage(messages.card),
|
|
112
109
|
className: className,
|
|
@@ -123,7 +120,7 @@ export var floatingToolbar = function floatingToolbar(cardOptions, platform, lin
|
|
|
123
120
|
}
|
|
124
121
|
return element;
|
|
125
122
|
},
|
|
126
|
-
items: generateToolbarItems(state, intl, providerFactory, cardOptions, platform, linkPickerOptions),
|
|
123
|
+
items: generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPickerOptions),
|
|
127
124
|
scrollable: pluginState.showLinkingToolbar ? false : true,
|
|
128
125
|
focusTrap: shouldEnableFocusTrap && pluginState.showLinkingToolbar
|
|
129
126
|
}, editLinkToolbarConfig(pluginState.showLinkingToolbar, isLinkPickerEnabled));
|
|
@@ -142,7 +139,7 @@ var unlinkCard = function unlinkCard(node, state) {
|
|
|
142
139
|
var buildAlignmentOptions = function buildAlignmentOptions(state, intl) {
|
|
143
140
|
return buildLayoutButtons(state, intl, state.schema.nodes.embedCard, true, true);
|
|
144
141
|
};
|
|
145
|
-
var generateToolbarItems = function generateToolbarItems(state, intl, providerFactory, cardOptions, platform, linkPicker) {
|
|
142
|
+
var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker) {
|
|
146
143
|
return function (node) {
|
|
147
144
|
var _titleUrlPairFromNode2 = titleUrlPairFromNode(node),
|
|
148
145
|
url = _titleUrlPairFromNode2.url;
|
|
@@ -165,7 +162,8 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
165
162
|
return [buildEditLinkToolbar({
|
|
166
163
|
providerFactory: providerFactory,
|
|
167
164
|
linkPicker: linkPicker,
|
|
168
|
-
node: node
|
|
165
|
+
node: node,
|
|
166
|
+
featureFlags: featureFlags
|
|
169
167
|
})];
|
|
170
168
|
} else {
|
|
171
169
|
var inlineCard = state.schema.nodes.inlineCard;
|
|
@@ -199,7 +197,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
199
197
|
}, {
|
|
200
198
|
type: 'separator'
|
|
201
199
|
}]
|
|
202
|
-
}], _toConsumableArray(getSettingsButtonGroup(state, intl)), [{
|
|
200
|
+
}], _toConsumableArray(getSettingsButtonGroup(state, featureFlags, intl)), [{
|
|
203
201
|
id: 'editor.link.delete',
|
|
204
202
|
focusEditoronEnter: true,
|
|
205
203
|
type: 'button',
|
|
@@ -263,9 +261,8 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
263
261
|
type: 'separator'
|
|
264
262
|
}] : [];
|
|
265
263
|
};
|
|
266
|
-
var getSettingsButtonGroup = function getSettingsButtonGroup(state, intl) {
|
|
267
|
-
var
|
|
268
|
-
floatingToolbarLinkSettingsButton = _getFeatureFlags2.floatingToolbarLinkSettingsButton;
|
|
264
|
+
var getSettingsButtonGroup = function getSettingsButtonGroup(state, featureFlags, intl) {
|
|
265
|
+
var floatingToolbarLinkSettingsButton = featureFlags.floatingToolbarLinkSettingsButton;
|
|
269
266
|
return floatingToolbarLinkSettingsButton === 'true' ? [{
|
|
270
267
|
id: 'editor.link.settings',
|
|
271
268
|
type: 'button',
|