@atlaskit/editor-core 180.1.0 → 181.0.1
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 +50 -0
- package/dist/cjs/actions/index.js +25 -10
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/cjs/create-editor/ReactEditorView.js +0 -5
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +73 -103
- package/dist/cjs/create-editor/create-plugins-list.js +37 -5
- package/dist/cjs/create-editor/feature-flags-from-props.js +31 -26
- package/dist/cjs/create-editor/preset-utils.js +27 -0
- package/dist/cjs/editor-next/editor-internal.js +2 -2
- package/dist/cjs/editor-next/editor-migration-component.js +18 -2
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/cjs/editor-next/index.js +13 -9
- package/dist/cjs/editor-next/utils/getProvidersFromEditorProps.js +41 -0
- package/dist/cjs/editor-next/utils/handleProviders.js +17 -22
- package/dist/cjs/editor.js +20 -13
- package/dist/cjs/keymaps/consts.js +1 -16
- package/dist/cjs/labs/next/presets/cxhtml.js +56 -55
- package/dist/cjs/labs/next/presets/default.js +15 -42
- package/dist/cjs/labs/next/presets/mobile.js +76 -89
- package/dist/cjs/labs/next/presets/universal.js +330 -257
- package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
- package/dist/cjs/plugins/analytics/plugin.js +6 -0
- package/dist/cjs/plugins/annotation/utils.js +2 -36
- package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +2 -7
- package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
- package/dist/cjs/plugins/caption/index.js +0 -7
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -4
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/cjs/plugins/card/pm-plugins/main.js +6 -3
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
- package/dist/cjs/plugins/collab-edit/provider/index.js +1 -8
- package/dist/cjs/plugins/collab-edit/provider/types.js +1 -12
- package/dist/cjs/plugins/context-panel/index.js +1 -6
- package/dist/cjs/plugins/data-consumer/index.js +0 -8
- package/dist/cjs/plugins/date/utils/internal.js +0 -4
- package/dist/cjs/plugins/extension/commands.js +1 -8
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/cjs/plugins/feedback-dialog/index.js +1 -4
- package/dist/cjs/plugins/floating-toolbar/ui/Button.js +7 -3
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +24 -8
- package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
- package/dist/cjs/plugins/fragment/index.js +0 -8
- package/dist/cjs/plugins/help-dialog/commands.js +2 -6
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +50 -12
- package/dist/cjs/plugins/layout/styles.js +10 -1
- package/dist/cjs/plugins/list/utils/find.js +0 -28
- package/dist/cjs/plugins/list/utils/indentation.js +1 -25
- package/dist/cjs/plugins/list/utils/node.js +0 -5
- package/dist/cjs/plugins/list/utils/selection.js +2 -15
- package/dist/cjs/plugins/media/utils/media-common.js +1 -20
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +100 -16
- package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +1 -3
- package/dist/cjs/plugins/mobile-dimensions/index.js +1 -4
- package/dist/cjs/plugins/paste/index.js +1 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +123 -87
- package/dist/cjs/plugins/paste/util/index.js +0 -46
- package/dist/cjs/plugins/quick-insert/assets/index.js +1 -27
- package/dist/cjs/plugins/selection/gap-cursor/actions.js +49 -44
- package/dist/cjs/plugins/status/utils.js +1 -15
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/cjs/plugins/text-formatting/utils.js +1 -26
- package/dist/cjs/plugins/type-ahead/constants.js +1 -7
- package/dist/cjs/plugins/type-ahead/index.js +4 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +6 -37
- 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 +25 -24
- package/dist/cjs/test-utils.js +4 -12
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +43 -8
- package/dist/cjs/ui/ColorPalette/index.js +18 -0
- package/dist/cjs/ui/ColorPickerButton/index.js +6 -2
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/cjs/ui/ConfigPanel/utils.js +4 -17
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +1 -3
- package/dist/cjs/ui/Resizer/utils.js +1 -3
- package/dist/cjs/ui/styles.js +3 -7
- package/dist/cjs/utils/get-editor-plugins.js +1 -3
- package/dist/cjs/utils/index.js +9 -269
- package/dist/cjs/utils/input-rules.js +1 -15
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +23 -9
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +0 -5
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +67 -82
- package/dist/es2019/create-editor/create-plugins-list.js +32 -5
- package/dist/es2019/create-editor/feature-flags-from-props.js +31 -26
- package/dist/es2019/create-editor/preset-utils.js +15 -0
- package/dist/es2019/editor-next/editor-internal.js +2 -2
- package/dist/es2019/editor-next/editor-migration-component.js +19 -2
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/es2019/editor-next/index.js +13 -7
- package/dist/es2019/editor-next/utils/getProvidersFromEditorProps.js +36 -0
- package/dist/es2019/editor-next/utils/handleProviders.js +18 -24
- package/dist/es2019/editor.js +20 -11
- package/dist/es2019/keymaps/consts.js +7 -11
- package/dist/es2019/labs/next/presets/cxhtml.js +56 -53
- package/dist/es2019/labs/next/presets/default.js +18 -38
- package/dist/es2019/labs/next/presets/mobile.js +88 -88
- package/dist/es2019/labs/next/presets/universal.js +338 -265
- package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
- package/dist/es2019/plugins/analytics/plugin.js +7 -0
- package/dist/es2019/plugins/annotation/utils.js +2 -30
- package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +1 -3
- package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/es2019/plugins/caption/index.js +0 -2
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -4
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/es2019/plugins/card/pm-plugins/main.js +6 -3
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
- package/dist/es2019/plugins/collab-edit/provider/index.js +1 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +1 -10
- package/dist/es2019/plugins/context-panel/index.js +0 -3
- package/dist/es2019/plugins/data-consumer/index.js +0 -7
- package/dist/es2019/plugins/date/utils/internal.js +0 -3
- package/dist/es2019/plugins/extension/commands.js +0 -6
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +12 -2
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +3 -0
- package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/es2019/plugins/feedback-dialog/index.js +0 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Button.js +7 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +21 -4
- package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
- package/dist/es2019/plugins/fragment/index.js +0 -7
- package/dist/es2019/plugins/help-dialog/commands.js +1 -2
- package/dist/es2019/plugins/image-upload/pm-plugins/main.js +47 -5
- package/dist/es2019/plugins/layout/styles.js +12 -4
- package/dist/es2019/plugins/list/utils/find.js +0 -27
- package/dist/es2019/plugins/list/utils/indentation.js +0 -23
- package/dist/es2019/plugins/list/utils/node.js +1 -4
- package/dist/es2019/plugins/list/utils/selection.js +2 -15
- package/dist/es2019/plugins/media/utils/media-common.js +1 -19
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +64 -16
- package/dist/es2019/plugins/mentions/type-ahead/index.js +1 -14
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/es2019/plugins/mobile-dimensions/index.js +0 -3
- package/dist/es2019/plugins/paste/index.js +1 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +126 -94
- package/dist/es2019/plugins/paste/util/index.js +5 -45
- package/dist/es2019/plugins/quick-insert/assets/index.js +0 -8
- package/dist/es2019/plugins/selection/gap-cursor/actions.js +56 -56
- package/dist/es2019/plugins/status/utils.js +1 -11
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/es2019/plugins/text-formatting/utils.js +0 -19
- package/dist/es2019/plugins/type-ahead/constants.js +0 -5
- package/dist/es2019/plugins/type-ahead/index.js +4 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +4 -37
- 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 -25
- package/dist/es2019/test-utils.js +4 -7
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -6
- package/dist/es2019/ui/ColorPalette/index.js +2 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +6 -2
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/es2019/ui/ConfigPanel/utils.js +0 -6
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -1
- package/dist/es2019/ui/styles.js +0 -6
- package/dist/es2019/utils/get-editor-plugins.js +1 -3
- package/dist/es2019/utils/index.js +13 -199
- package/dist/es2019/utils/input-rules.js +0 -14
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +23 -9
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +0 -5
- package/dist/esm/create-editor/ReactEditorViewInternal.js +73 -102
- package/dist/esm/create-editor/create-plugins-list.js +36 -5
- package/dist/esm/create-editor/feature-flags-from-props.js +31 -26
- package/dist/esm/create-editor/preset-utils.js +21 -0
- package/dist/esm/editor-next/editor-internal.js +2 -2
- package/dist/esm/editor-next/editor-migration-component.js +18 -2
- package/dist/esm/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/esm/editor-next/index.js +13 -9
- package/dist/esm/editor-next/utils/getProvidersFromEditorProps.js +35 -0
- package/dist/esm/editor-next/utils/handleProviders.js +17 -22
- package/dist/esm/editor.js +20 -13
- package/dist/esm/keymaps/consts.js +7 -11
- package/dist/esm/labs/next/presets/cxhtml.js +56 -55
- package/dist/esm/labs/next/presets/default.js +18 -41
- package/dist/esm/labs/next/presets/mobile.js +88 -90
- package/dist/esm/labs/next/presets/universal.js +330 -257
- package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
- package/dist/esm/plugins/analytics/plugin.js +6 -0
- package/dist/esm/plugins/annotation/utils.js +2 -32
- package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +1 -5
- package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/esm/plugins/caption/index.js +0 -2
- package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -4
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/esm/plugins/card/pm-plugins/main.js +6 -3
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
- package/dist/esm/plugins/collab-edit/provider/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +1 -10
- package/dist/esm/plugins/context-panel/index.js +0 -3
- package/dist/esm/plugins/data-consumer/index.js +0 -7
- package/dist/esm/plugins/date/utils/internal.js +0 -3
- package/dist/esm/plugins/extension/commands.js +0 -6
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/esm/plugins/feedback-dialog/index.js +0 -2
- package/dist/esm/plugins/floating-toolbar/ui/Button.js +7 -3
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +24 -8
- package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
- package/dist/esm/plugins/fragment/index.js +0 -7
- package/dist/esm/plugins/help-dialog/commands.js +0 -3
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +51 -12
- package/dist/esm/plugins/layout/styles.js +11 -2
- package/dist/esm/plugins/list/utils/find.js +0 -27
- package/dist/esm/plugins/list/utils/indentation.js +0 -23
- package/dist/esm/plugins/list/utils/node.js +1 -4
- package/dist/esm/plugins/list/utils/selection.js +2 -12
- package/dist/esm/plugins/media/utils/media-common.js +1 -17
- package/dist/esm/plugins/mentions/nodeviews/mention.js +97 -16
- package/dist/esm/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/esm/plugins/mobile-dimensions/index.js +0 -3
- package/dist/esm/plugins/paste/index.js +1 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +122 -86
- package/dist/esm/plugins/paste/util/index.js +5 -45
- package/dist/esm/plugins/quick-insert/assets/index.js +0 -20
- package/dist/esm/plugins/selection/gap-cursor/actions.js +52 -45
- package/dist/esm/plugins/status/utils.js +1 -13
- package/dist/esm/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/esm/plugins/text-formatting/utils.js +0 -21
- package/dist/esm/plugins/type-ahead/constants.js +0 -5
- package/dist/esm/plugins/type-ahead/index.js +4 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +4 -33
- 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 +24 -22
- package/dist/esm/test-utils.js +4 -7
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +41 -6
- package/dist/esm/ui/ColorPalette/index.js +2 -1
- package/dist/esm/ui/ColorPickerButton/index.js +6 -2
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/esm/ui/ConfigPanel/utils.js +3 -14
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/esm/ui/ElementBrowser/constants.js +0 -1
- package/dist/esm/ui/Resizer/utils.js +0 -1
- package/dist/esm/ui/styles.js +2 -5
- package/dist/esm/utils/get-editor-plugins.js +1 -3
- package/dist/esm/utils/index.js +13 -196
- package/dist/esm/utils/input-rules.js +0 -13
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +4 -4
- package/dist/types/create-editor/ReactEditorView.d.ts +0 -3
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +9 -7
- package/dist/types/create-editor/ReactEditorViewNext.d.ts +3 -4
- package/dist/types/create-editor/create-plugins-list.d.ts +3 -5
- package/dist/types/create-editor/preset-utils.d.ts +2 -0
- package/dist/types/editor-next/editor-internal.d.ts +9 -9
- package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +2 -2
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +2 -2
- package/dist/types/editor-next/index.d.ts +6 -6
- package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -2
- package/dist/types/editor-next/utils/editorPropTypes.d.ts +1 -1
- package/dist/types/editor-next/utils/getProvidersFromEditorProps.d.ts +9 -0
- package/dist/types/editor-next/utils/handleProviders.d.ts +2 -2
- package/dist/types/editor-next/utils/onEditorCreated.d.ts +2 -2
- package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
- package/dist/types/editor.d.ts +7 -4
- package/dist/types/keymaps/consts.d.ts +0 -11
- package/dist/types/labs/next/presets/cxhtml.d.ts +33 -1
- package/dist/types/labs/next/presets/default.d.ts +67 -10
- package/dist/types/labs/next/presets/mobile.d.ts +33 -1
- package/dist/types/labs/next/presets/universal.d.ts +5 -13
- package/dist/types/labs/next/presets/useUniversalPreset.d.ts +7 -0
- package/dist/types/nodeviews/context-adapter.d.ts +0 -1
- package/dist/types/nodeviews/index.d.ts +0 -1
- package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -11
- package/dist/types/plugins/annotation/utils.d.ts +0 -17
- package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +2 -3
- package/dist/types/plugins/block-type/pm-plugins/input-rule.d.ts +2 -6
- package/dist/types/plugins/caption/index.d.ts +0 -2
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/plugins/code-block/actions.d.ts +0 -4
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
- package/dist/types/plugins/collab-edit/provider/index.d.ts +1 -2
- package/dist/types/plugins/collab-edit/provider/types.d.ts +1 -36
- package/dist/types/plugins/context-panel/index.d.ts +2 -3
- package/dist/types/plugins/data-consumer/index.d.ts +0 -2
- package/dist/types/plugins/date/utils/internal.d.ts +0 -1
- package/dist/types/plugins/extension/commands.d.ts +0 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
- package/dist/types/plugins/feedback-dialog/index.d.ts +0 -2
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +3 -1
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
- package/dist/types/plugins/fragment/index.d.ts +0 -2
- package/dist/types/plugins/help-dialog/commands.d.ts +0 -1
- package/dist/types/plugins/history/actions.d.ts +1 -2
- package/dist/types/plugins/layout/styles.d.ts +2 -1
- package/dist/types/plugins/list/utils/find.d.ts +0 -1
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -1
- package/dist/types/plugins/list/utils/node.d.ts +0 -2
- package/dist/types/plugins/list/utils/selection.d.ts +0 -3
- package/dist/types/plugins/media/utils/media-common.d.ts +0 -5
- package/dist/types/plugins/mentions/types.d.ts +1 -2
- package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +2 -3
- package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -6
- package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +1 -4
- package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -1
- package/dist/types/plugins/paste/index.d.ts +0 -1
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -3
- package/dist/types/plugins/paste/util/index.d.ts +0 -6
- package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -2
- package/dist/types/plugins/status/utils.d.ts +0 -3
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +0 -4
- package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
- package/dist/types/plugins/type-ahead/index.d.ts +1 -0
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +2 -11
- 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 +3 -3
- package/dist/types/test-utils.d.ts +4 -5
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +55 -42
- package/dist/types/ui/Appearance/Chromeless.d.ts +0 -5
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +0 -7
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -4
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
- package/dist/types/ui/ColorPalette/Palettes/index.d.ts +1 -1
- package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -1
- package/dist/types/ui/ColorPalette/index.d.ts +2 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +4 -2
- package/dist/types/ui/ConfigPanel/types.d.ts +0 -3
- package/dist/types/ui/ConfigPanel/utils.d.ts +2 -3
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +0 -3
- package/dist/types/ui/ElementBrowser/constants.d.ts +0 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +0 -5
- package/dist/types/ui/Resizer/utils.d.ts +0 -1
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types/utils/index.d.ts +6 -65
- package/dist/types/utils/input-rules.d.ts +1 -2
- package/dist/types/utils/table.d.ts +0 -1
- package/package.json +23 -24
- package/report.api.md +155 -146
- package/dist/cjs/labs/next/presets/preset.js +0 -101
- package/dist/cjs/plugins/analytics/types/type-ahead.js +0 -5
- package/dist/cjs/plugins/collab-edit/provider/channel.js +0 -313
- package/dist/cjs/plugins/collab-edit/provider/logger.js +0 -17
- package/dist/cjs/plugins/collab-edit/provider/mock-users.js +0 -19
- package/dist/cjs/plugins/data-consumer/plugin-key.js +0 -9
- package/dist/cjs/plugins/media/toolbar/toolbar-messages.js +0 -15
- package/dist/cjs/profiler/render-count.js +0 -60
- package/dist/cjs/ui/ColorPalette/Color/index.js +0 -9
- package/dist/cjs/ui/ConfigPanel/FieldDescription.js +0 -19
- package/dist/cjs/ui/WithPluginState/types.js +0 -5
- package/dist/es2019/labs/next/presets/preset.js +0 -68
- package/dist/es2019/plugins/analytics/types/type-ahead.js +0 -1
- package/dist/es2019/plugins/collab-edit/provider/channel.js +0 -179
- package/dist/es2019/plugins/collab-edit/provider/logger.js +0 -8
- package/dist/es2019/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/es2019/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/es2019/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/es2019/profiler/render-count.js +0 -53
- package/dist/es2019/ui/ColorPalette/Color/index.js +0 -2
- package/dist/es2019/ui/ConfigPanel/FieldDescription.js +0 -12
- package/dist/es2019/ui/WithPluginState/types.js +0 -1
- package/dist/esm/labs/next/presets/preset.js +0 -93
- package/dist/esm/plugins/analytics/types/type-ahead.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +0 -305
- package/dist/esm/plugins/collab-edit/provider/logger.js +0 -10
- package/dist/esm/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/esm/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/esm/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/esm/profiler/render-count.js +0 -49
- package/dist/esm/ui/ColorPalette/Color/index.js +0 -2
- package/dist/esm/ui/ConfigPanel/FieldDescription.js +0 -11
- package/dist/esm/ui/WithPluginState/types.js +0 -1
- package/dist/types/labs/next/presets/preset.d.ts +0 -46
- package/dist/types/plugins/analytics/types/type-ahead.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/channel.d.ts +0 -48
- package/dist/types/plugins/collab-edit/provider/logger.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/mock-users.d.ts +0 -6
- package/dist/types/plugins/data-consumer/plugin-key.d.ts +0 -2
- package/dist/types/plugins/media/toolbar/toolbar-messages.d.ts +0 -7
- package/dist/types/profiler/render-count.d.ts +0 -14
- package/dist/types/ui/ColorPalette/Color/index.d.ts +0 -2
- package/dist/types/ui/ConfigPanel/FieldDescription.d.ts +0 -6
- package/dist/types/ui/WithPluginState/types.d.ts +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
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';
|
|
@@ -18,19 +18,13 @@ import { createStubInternalApis } from './create-stub-internal-apis';
|
|
|
18
18
|
* @param props A subset of full EditorProps for the full feature preset
|
|
19
19
|
* @param featureFlags
|
|
20
20
|
* @param prevAppearance The appearance of the editor in the previous render
|
|
21
|
-
* @param createAnalyticsEvent
|
|
22
|
-
* @param insertNodeAPI
|
|
23
|
-
* @param editorAnalyticsAPI
|
|
24
|
-
* @param editorSelectionAPI
|
|
25
|
-
* @param getEditorContainerWidth
|
|
26
21
|
* @returns a full featured preset configured according to the provided props - basis for create-plugins-list
|
|
27
22
|
*/
|
|
28
|
-
export default function createUniversalPreset(appearance, props, featureFlags, prevAppearance, maybeCreateAnalyticsEvent
|
|
29
|
-
var _props$linking;
|
|
23
|
+
export default function createUniversalPreset(appearance, props, featureFlags, prevAppearance, maybeCreateAnalyticsEvent) {
|
|
30
24
|
var isMobile = appearance === 'mobile';
|
|
31
25
|
var isComment = appearance === 'comment';
|
|
32
26
|
var isFullPage = fullPageCheck(appearance);
|
|
33
|
-
var
|
|
27
|
+
var defaultPreset = createDefaultPreset(props);
|
|
34
28
|
var getEditorFeatureFlags = function getEditorFeatureFlags() {
|
|
35
29
|
return featureFlags;
|
|
36
30
|
};
|
|
@@ -40,120 +34,159 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
40
34
|
editorAnalyticsAPI = stubs.editorAnalyticsAPI,
|
|
41
35
|
stubInternalApisPlugin = stubs.stubInternalApisPlugin;
|
|
42
36
|
var createAnalyticsEvent = maybeCreateAnalyticsEvent ? maybeCreateAnalyticsEvent : stubs.createAnalyticsEvent;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
37
|
+
var statusMenuDisabled = !props.allowStatus ? true : _typeof(props.allowStatus) === 'object' ? Boolean(props.allowStatus.menuDisabled) : false;
|
|
38
|
+
var hasBeforePrimaryToolbar = function hasBeforePrimaryToolbar(components) {
|
|
39
|
+
if (components && 'before' in components) {
|
|
40
|
+
return !!components.before;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
};
|
|
44
|
+
var finalPreset = defaultPreset.add(stubInternalApisPlugin).add(dataConsumerMarkPlugin).maybeAdd(analyticsPlugin, function (plugin, builder) {
|
|
45
|
+
if (props.allowAnalyticsGASV3) {
|
|
46
|
+
var performanceTracking = props.performanceTracking;
|
|
47
|
+
return builder.add([plugin, {
|
|
48
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
49
|
+
performanceTracking: performanceTracking
|
|
50
|
+
}]);
|
|
51
|
+
}
|
|
52
|
+
return builder;
|
|
53
|
+
}).maybeAdd(breakoutPlugin, function (plugin, builder) {
|
|
54
|
+
if (props.allowBreakout && isFullPage) {
|
|
55
|
+
return builder.add([plugin, {
|
|
56
|
+
allowBreakoutButton: appearance === 'full-page'
|
|
57
|
+
}]);
|
|
58
|
+
}
|
|
59
|
+
return builder;
|
|
60
|
+
}).maybeAdd(alignmentPlugin, function (plugin, builder) {
|
|
61
|
+
if (props.allowTextAlignment) {
|
|
62
|
+
return builder.add(plugin);
|
|
63
|
+
}
|
|
64
|
+
return builder;
|
|
65
|
+
}).maybeAdd(textColorPlugin, function (plugin, builder) {
|
|
66
|
+
if (props.allowTextColor) {
|
|
67
|
+
return builder.add([plugin, props.allowTextColor]);
|
|
68
|
+
}
|
|
69
|
+
return builder;
|
|
70
|
+
}).add([listPlugin, {
|
|
66
71
|
restartNumberedLists: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.restartNumberedLists,
|
|
67
72
|
restartNumberedListsToolbar: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.restartNumberedListsToolbar,
|
|
68
73
|
listNumberContinuity: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.listNumberContinuity
|
|
69
|
-
}])
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
74
|
+
}]).maybeAdd(rulePlugin, function (plugin, builder) {
|
|
75
|
+
if (props.allowRule) {
|
|
76
|
+
return builder.add(plugin);
|
|
77
|
+
}
|
|
78
|
+
return builder;
|
|
79
|
+
}).maybeAdd(expandPlugin, function (plugin, builder) {
|
|
80
|
+
if (props.allowExpand) {
|
|
81
|
+
return builder.add([plugin, {
|
|
82
|
+
allowInsertion: isExpandInsertionEnabled(props),
|
|
83
|
+
useLongPressSelection: false,
|
|
84
|
+
appearance: appearance
|
|
85
|
+
}]);
|
|
86
|
+
}
|
|
87
|
+
return builder;
|
|
88
|
+
}).maybeAdd(gridPlugin, function (plugin, builder) {
|
|
89
|
+
if (props.media) {
|
|
90
|
+
return builder.add([plugin, {
|
|
91
|
+
shouldCalcBreakoutGridLines: isFullPage
|
|
92
|
+
}]);
|
|
93
|
+
}
|
|
94
|
+
return builder;
|
|
95
|
+
}).maybeAdd(mediaPlugin, function (plugin, builder) {
|
|
96
|
+
if (props.media) {
|
|
97
|
+
var alignLeftOnInsert = typeof props.media.alignLeftOnInsert !== 'undefined' ? props.media.alignLeftOnInsert : isComment;
|
|
98
|
+
var showMediaLayoutOptions = typeof props.media.allowAdvancedToolBarOptions !== 'undefined' ? props.media.allowAdvancedToolBarOptions : isFullPage || isComment;
|
|
99
|
+
return builder.add([plugin, _objectSpread(_objectSpread({}, props.media), {}, {
|
|
100
|
+
allowLazyLoading: !isMobile,
|
|
101
|
+
allowBreakoutSnapPoints: isFullPage,
|
|
102
|
+
allowAdvancedToolBarOptions: showMediaLayoutOptions,
|
|
103
|
+
allowDropzoneDropLine: isFullPage,
|
|
104
|
+
allowMediaSingleEditable: !isMobile,
|
|
105
|
+
allowRemoteDimensionsFetch: !isMobile,
|
|
106
|
+
editorSelectionAPI: editorSelectionAPI,
|
|
107
|
+
// This is a wild one. I didnt quite understand what the code was doing
|
|
108
|
+
// so a bit of guess for now.
|
|
109
|
+
allowMarkingUploadsAsIncomplete: isMobile,
|
|
110
|
+
fullWidthEnabled: appearance === 'full-width',
|
|
111
|
+
uploadErrorHandler: props.uploadErrorHandler,
|
|
112
|
+
waitForMediaUpload: props.waitForMediaUpload,
|
|
113
|
+
isCopyPasteEnabled: !isMobile,
|
|
114
|
+
alignLeftOnInsert: alignLeftOnInsert
|
|
115
|
+
})]);
|
|
116
|
+
}
|
|
117
|
+
return builder;
|
|
118
|
+
}).maybeAdd(captionPlugin, function (plugin, builder) {
|
|
104
119
|
// EDM-799: inside caption plugin we do the feature flag in enabling the plugin
|
|
105
|
-
if (getMediaFeatureFlag('captions', props.media.featureFlags)) {
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
120
|
+
if (props.media && getMediaFeatureFlag('captions', props.media.featureFlags)) {
|
|
121
|
+
return builder.add(plugin);
|
|
122
|
+
}
|
|
123
|
+
return builder;
|
|
124
|
+
}).maybeAdd(mentionsPlugin, function (plugin, builder) {
|
|
125
|
+
if (props.mentionProvider) {
|
|
126
|
+
var _props$mention$insert, _props$mention, _props$mention2;
|
|
127
|
+
return builder.add([plugin, {
|
|
128
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
129
|
+
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
130
|
+
insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
|
|
131
|
+
allowZeroWidthSpaceAfter: !isMobile,
|
|
132
|
+
HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent
|
|
133
|
+
}]);
|
|
134
|
+
}
|
|
135
|
+
return builder;
|
|
136
|
+
}).maybeAdd(emojiPlugin, function (plugin, builder) {
|
|
137
|
+
if (props.emojiProvider) {
|
|
138
|
+
return builder.add([plugin, {
|
|
139
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
140
|
+
}]);
|
|
141
|
+
}
|
|
142
|
+
return builder;
|
|
143
|
+
}).maybeAdd(tablesPlugin, function (plugin, builder) {
|
|
144
|
+
if (props.allowTables) {
|
|
145
|
+
var tableOptions = !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables;
|
|
146
|
+
return builder.add([plugin, {
|
|
147
|
+
tableOptions: tableOptions,
|
|
148
|
+
breakoutEnabled: appearance === 'full-page',
|
|
149
|
+
allowContextualMenu: !isMobile,
|
|
150
|
+
fullWidthEnabled: appearance === 'full-width',
|
|
151
|
+
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
152
|
+
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
153
|
+
editorSelectionAPI: editorSelectionAPI,
|
|
154
|
+
getEditorFeatureFlags: getEditorFeatureFlags
|
|
155
|
+
}]);
|
|
156
|
+
}
|
|
157
|
+
return builder;
|
|
158
|
+
}).maybeAdd(tasksAndDecisionsPlugin, function (plugin, builder) {
|
|
159
|
+
if (props.allowTasksAndDecisions || props.taskDecisionProvider) {
|
|
160
|
+
return builder.add([plugin, {
|
|
161
|
+
allowNestedTasks: props.allowNestedTasks,
|
|
162
|
+
consumeTabs: isFullPage,
|
|
163
|
+
useLongPressSelection: false
|
|
164
|
+
}]);
|
|
165
|
+
}
|
|
166
|
+
return builder;
|
|
167
|
+
}).maybeAdd(feedbackDialogPlugin, function (plugin, builder) {
|
|
168
|
+
if (props.feedbackInfo) {
|
|
169
|
+
return builder.add([plugin, props.feedbackInfo]);
|
|
170
|
+
}
|
|
171
|
+
return builder;
|
|
172
|
+
}).maybeAdd(helpDialogPlugin, function (plugin, builder) {
|
|
173
|
+
if (props.allowHelpDialog) {
|
|
174
|
+
return builder.add([plugin, !!props.legacyImageUploadProvider]);
|
|
175
|
+
}
|
|
176
|
+
return builder;
|
|
177
|
+
}).maybeAdd(saveOnEnterPlugin, function (plugin, builder) {
|
|
178
|
+
if (props.saveOnEnter && props.onSave) {
|
|
179
|
+
return builder.add([plugin, props.onSave]);
|
|
180
|
+
}
|
|
181
|
+
return builder;
|
|
182
|
+
}).maybeAdd(imageUploadPlugin, function (plugin, builder) {
|
|
183
|
+
if (props.legacyImageUploadProvider) {
|
|
184
|
+
return builder.add(plugin);
|
|
185
|
+
}
|
|
186
|
+
return builder;
|
|
187
|
+
}).maybeAdd(mediaPlugin, function (plugin, builder) {
|
|
188
|
+
if (props.legacyImageUploadProvider && !props.media) {
|
|
189
|
+
return builder.add([plugin, {
|
|
157
190
|
allowMediaSingle: {
|
|
158
191
|
disableLayout: true
|
|
159
192
|
},
|
|
@@ -162,111 +195,146 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
162
195
|
editorSelectionAPI: editorSelectionAPI
|
|
163
196
|
}]);
|
|
164
197
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
198
|
+
return builder;
|
|
199
|
+
}).maybeAdd(collabEditPlugin, function (plugin, builder) {
|
|
200
|
+
if (props.collabEdit || props.collabEditProvider) {
|
|
201
|
+
var _collabEditOptions$EX;
|
|
202
|
+
var collabEditOptions = {
|
|
203
|
+
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
204
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
205
|
+
};
|
|
206
|
+
if (props.collabEdit) {
|
|
207
|
+
collabEditOptions = _objectSpread(_objectSpread({}, props.collabEdit), collabEditOptions);
|
|
208
|
+
}
|
|
209
|
+
return builder.add([plugin, _objectSpread(_objectSpread({}, collabEditOptions), {}, {
|
|
210
|
+
EXPERIMENTAL_allowInternalErrorAnalytics: (_collabEditOptions$EX = collabEditOptions.EXPERIMENTAL_allowInternalErrorAnalytics) !== null && _collabEditOptions$EX !== void 0 ? _collabEditOptions$EX : shouldForceTracking()
|
|
211
|
+
})]);
|
|
212
|
+
}
|
|
213
|
+
return builder;
|
|
214
|
+
}).maybeAdd(maxContentSizePlugin, function (plugin, builder) {
|
|
215
|
+
if (props.maxContentSize) {
|
|
216
|
+
return builder.add([plugin, props.maxContentSize]);
|
|
217
|
+
}
|
|
218
|
+
return builder;
|
|
219
|
+
}).maybeAdd(jiraIssuePlugin, function (plugin, builder) {
|
|
220
|
+
if (props.allowJiraIssue) {
|
|
221
|
+
return builder.add(plugin);
|
|
222
|
+
}
|
|
223
|
+
return builder;
|
|
224
|
+
}).maybeAdd(panelPlugin, function (plugin, builder) {
|
|
225
|
+
if (props.allowPanel) {
|
|
226
|
+
var allowPanel = _typeof(props.allowPanel) === 'object' ? props.allowPanel : {};
|
|
227
|
+
return builder.add([plugin, {
|
|
228
|
+
useLongPressSelection: false,
|
|
229
|
+
allowCustomPanel: allowPanel.allowCustomPanel,
|
|
230
|
+
allowCustomPanelEdit: allowPanel.allowCustomPanelEdit
|
|
231
|
+
}]);
|
|
232
|
+
}
|
|
233
|
+
return builder;
|
|
234
|
+
}).maybeAdd(extensionPlugin, function (plugin, builder) {
|
|
235
|
+
if (props.allowExtension) {
|
|
236
|
+
var extensionConfig = _typeof(props.allowExtension) === 'object' ? props.allowExtension : {};
|
|
237
|
+
return builder.add([plugin, {
|
|
238
|
+
breakoutEnabled: appearance === 'full-page' && extensionConfig.allowBreakout !== false,
|
|
239
|
+
allowAutoSave: extensionConfig.allowAutoSave,
|
|
240
|
+
extensionHandlers: props.extensionHandlers,
|
|
241
|
+
useLongPressSelection: false,
|
|
242
|
+
appearance: appearance
|
|
243
|
+
}]);
|
|
244
|
+
}
|
|
245
|
+
return builder;
|
|
246
|
+
}).maybeAdd(macroPlugin, function (plugin, builder) {
|
|
247
|
+
if (props.macroProvider) {
|
|
248
|
+
return builder.add(plugin);
|
|
249
|
+
}
|
|
250
|
+
return builder;
|
|
251
|
+
}).maybeAdd(annotationPlugin, function (plugin, builder) {
|
|
252
|
+
// See default list for when adding annotations with a provider
|
|
253
|
+
if (!props.annotationProviders && props.allowConfluenceInlineComment) {
|
|
254
|
+
return builder.add([plugin, undefined]);
|
|
255
|
+
}
|
|
256
|
+
return builder;
|
|
257
|
+
}).maybeAdd(datePlugin, function (plugin, builder) {
|
|
258
|
+
if (props.allowDate) {
|
|
259
|
+
return builder.add(plugin);
|
|
260
|
+
}
|
|
261
|
+
return builder;
|
|
262
|
+
}).maybeAdd(placeholderTextPlugin, function (plugin, builder) {
|
|
263
|
+
if (props.allowTemplatePlaceholders) {
|
|
264
|
+
var options = props.allowTemplatePlaceholders !== true ? props.allowTemplatePlaceholders : {};
|
|
265
|
+
return builder.add([plugin, options]);
|
|
266
|
+
}
|
|
267
|
+
return builder;
|
|
268
|
+
}).maybeAdd(layoutPlugin, function (plugin, builder) {
|
|
269
|
+
if (props.allowLayouts) {
|
|
270
|
+
var layoutOptions = _typeof(props.allowLayouts) === 'object' ? props.allowLayouts : {};
|
|
271
|
+
return builder.add([plugin, _objectSpread(_objectSpread({}, layoutOptions), {}, {
|
|
272
|
+
useLongPressSelection: false,
|
|
273
|
+
UNSAFE_allowSingleColumnLayout: layoutOptions.UNSAFE_allowSingleColumnLayout
|
|
274
|
+
})]);
|
|
275
|
+
}
|
|
276
|
+
return builder;
|
|
277
|
+
}).maybeAdd(cardPlugin, function (plugin, builder) {
|
|
278
|
+
var _props$linking;
|
|
279
|
+
if ((_props$linking = props.linking) !== null && _props$linking !== void 0 && _props$linking.smartLinks || props.smartLinks || props.UNSAFE_cards) {
|
|
280
|
+
var _props$linking2, _props$linking3;
|
|
281
|
+
var fullWidthMode = appearance === 'full-width';
|
|
282
|
+
return builder.add([plugin, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.UNSAFE_cards), props.smartLinks), (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.smartLinks), {}, {
|
|
283
|
+
platform: isMobile ? 'mobile' : 'web',
|
|
284
|
+
fullWidthMode: fullWidthMode,
|
|
285
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
286
|
+
linkPicker: (_props$linking3 = props.linking) === null || _props$linking3 === void 0 ? void 0 : _props$linking3.linkPicker,
|
|
287
|
+
editorAppearance: appearance
|
|
288
|
+
})]);
|
|
289
|
+
}
|
|
290
|
+
return builder;
|
|
291
|
+
}).maybeAdd(customAutoformatPlugin, function (plugin, builder) {
|
|
292
|
+
if (props.autoformattingProvider) {
|
|
293
|
+
return builder.add(plugin);
|
|
294
|
+
}
|
|
295
|
+
return builder;
|
|
296
|
+
}).maybeAdd(statusPlugin, function (plugin, builder) {
|
|
297
|
+
if (props.allowStatus) {
|
|
298
|
+
return builder.add([plugin, {
|
|
299
|
+
menuDisabled: statusMenuDisabled,
|
|
300
|
+
allowZeroWidthSpaceAfter: !isMobile
|
|
301
|
+
}]);
|
|
302
|
+
}
|
|
303
|
+
return builder;
|
|
304
|
+
}).maybeAdd(indentationPlugin, function (plugin, builder) {
|
|
305
|
+
if (props.allowIndentation) {
|
|
306
|
+
return builder.add(plugin);
|
|
307
|
+
}
|
|
308
|
+
return builder;
|
|
309
|
+
}).maybeAdd(contextPanelPlugin, function (plugin, builder) {
|
|
310
|
+
if (isFullPage) {
|
|
311
|
+
return builder.add(contextPanelPlugin);
|
|
312
|
+
}
|
|
313
|
+
return builder;
|
|
314
|
+
}).maybeAdd(scrollIntoViewPlugin, function (plugin, builder) {
|
|
315
|
+
if (props.autoScrollIntoView !== false) {
|
|
316
|
+
return builder.add(scrollIntoViewPlugin);
|
|
317
|
+
}
|
|
318
|
+
return builder;
|
|
319
|
+
}).maybeAdd(historyPlugin, function (plugin, builder) {
|
|
320
|
+
if (isMobile || props.allowUndoRedoButtons) {
|
|
321
|
+
return builder.add(historyPlugin);
|
|
322
|
+
}
|
|
323
|
+
return builder;
|
|
324
|
+
}).maybeAdd(mobileDimensionsPlugin, function (plugin, builder) {
|
|
325
|
+
if (isMobile) {
|
|
326
|
+
return builder.add(plugin);
|
|
327
|
+
}
|
|
328
|
+
return builder;
|
|
329
|
+
}).maybeAdd(mobileSelectionPlugin, function (plugin, builder) {
|
|
330
|
+
if (isMobile) {
|
|
331
|
+
return builder.add(plugin);
|
|
332
|
+
}
|
|
333
|
+
return builder;
|
|
334
|
+
}).add([toolbarListsIndentationPlugin, {
|
|
266
335
|
showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar,
|
|
267
336
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
268
|
-
}])
|
|
269
|
-
preset.add([insertBlockPlugin, {
|
|
337
|
+
}]).add([insertBlockPlugin, {
|
|
270
338
|
allowTables: !!props.allowTables,
|
|
271
339
|
allowExpand: isExpandInsertionEnabled(props),
|
|
272
340
|
insertMenuItems: props.insertMenuItems,
|
|
@@ -275,41 +343,46 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
275
343
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
276
344
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false,
|
|
277
345
|
insertNodeAPI: insertNodeAPI
|
|
278
|
-
}])
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
346
|
+
}]).maybeAdd(beforePrimaryToolbarPlugin, function (plugin, builder) {
|
|
347
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
348
|
+
return builder.add([plugin, {
|
|
349
|
+
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
350
|
+
}]);
|
|
282
351
|
}
|
|
283
|
-
return
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
352
|
+
return builder;
|
|
353
|
+
}).maybeAdd(avatarGroupPlugin, function (plugin, builder) {
|
|
354
|
+
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
355
|
+
return builder.add([plugin, {
|
|
356
|
+
collabEdit: props.collabEdit,
|
|
357
|
+
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
358
|
+
}]);
|
|
359
|
+
}
|
|
360
|
+
return builder;
|
|
361
|
+
}).maybeAdd(findReplacePlugin, function (plugin, builder) {
|
|
362
|
+
if (props.allowFindReplace) {
|
|
363
|
+
return builder.add([plugin, {
|
|
364
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
365
|
+
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
366
|
+
}]);
|
|
367
|
+
}
|
|
368
|
+
return builder;
|
|
369
|
+
}).maybeAdd(fragmentMarkPlugin, function (plugin, builder) {
|
|
370
|
+
if (props.allowFragmentMark) {
|
|
371
|
+
return builder.add(plugin);
|
|
372
|
+
}
|
|
373
|
+
return builder;
|
|
374
|
+
}).maybeAdd(viewUpdateSubscriptionPlugin, function (plugin, builder) {
|
|
375
|
+
if (featureFlags.enableViewUpdateSubscription) {
|
|
376
|
+
return builder.add(plugin);
|
|
377
|
+
}
|
|
378
|
+
return builder;
|
|
379
|
+
}).add([codeBidiWarningPlugin, {
|
|
309
380
|
appearance: appearance
|
|
310
|
-
}])
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
381
|
+
}]).maybeAdd(copyButtonPlugin, function (plugin, builder) {
|
|
382
|
+
if (featureFlags.floatingToolbarCopyButton) {
|
|
383
|
+
return builder.add(plugin);
|
|
384
|
+
}
|
|
385
|
+
return builder;
|
|
386
|
+
});
|
|
387
|
+
return finalPreset;
|
|
315
388
|
}
|