@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
|
@@ -32,9 +32,12 @@ function getSpellCheck(featureFlags) {
|
|
|
32
32
|
* which is used by both current and archv3 editors.
|
|
33
33
|
*/
|
|
34
34
|
function createFeatureFlagsFromProps(props) {
|
|
35
|
-
var _props$featureFlags, _props$
|
|
35
|
+
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;
|
|
36
36
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
37
37
|
var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
38
|
+
|
|
39
|
+
// duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
|
|
40
|
+
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;
|
|
38
41
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
39
42
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
40
43
|
interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
|
|
@@ -45,37 +48,39 @@ function createFeatureFlagsFromProps(props) {
|
|
|
45
48
|
singleLayout: (0, _typeof2.default)(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
46
49
|
undoRedoButtons: props.allowUndoRedoButtons,
|
|
47
50
|
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,
|
|
48
|
-
stickyHeadersOptimization: typeof ((_props$
|
|
49
|
-
initialRenderOptimization: typeof ((_props$
|
|
50
|
-
mouseMoveOptimization: typeof ((_props$
|
|
51
|
-
tableRenderOptimization: typeof ((_props$
|
|
52
|
-
tableOverflowShadowsOptimization: typeof ((_props$
|
|
51
|
+
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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
|
|
52
|
+
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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
|
|
53
|
+
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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
|
|
54
|
+
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) : (0, _typeof2.default)(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,
|
|
55
|
+
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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
|
|
53
56
|
extendFloatingToolbar: Boolean((0, _typeof2.default)(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
|
|
54
|
-
showAvatarGroupAsPlugin: Boolean(typeof ((_props$
|
|
55
|
-
errorBoundaryDocStructure: Boolean(typeof ((_props$
|
|
56
|
-
synchronyErrorDocStructure: Boolean(typeof ((_props$
|
|
57
|
-
enableViewUpdateSubscription: Boolean(typeof ((_props$
|
|
58
|
-
collabAvatarScroll: Boolean(typeof ((_props$
|
|
59
|
-
ufo: Boolean(typeof ((_props$
|
|
60
|
-
twoLineEditorToolbar: Boolean(typeof ((_props$
|
|
61
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$
|
|
62
|
-
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$
|
|
57
|
+
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),
|
|
58
|
+
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),
|
|
59
|
+
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),
|
|
60
|
+
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),
|
|
61
|
+
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),
|
|
62
|
+
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),
|
|
63
|
+
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),
|
|
64
|
+
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)),
|
|
65
|
+
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)),
|
|
63
66
|
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),
|
|
64
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
67
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
65
68
|
tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
|
|
66
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
67
|
-
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
68
|
-
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$
|
|
69
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
69
|
+
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),
|
|
70
|
+
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)),
|
|
71
|
+
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)),
|
|
72
|
+
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,
|
|
70
73
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
71
74
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
72
75
|
// are included (they are not kebab cased)
|
|
73
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
74
|
-
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$
|
|
75
|
-
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$
|
|
76
|
-
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$
|
|
76
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
|
|
77
|
+
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.listNumberContinuity) === true,
|
|
78
|
+
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags42 = props.featureFlags) === null || _props$featureFlags42 === void 0 ? void 0 : _props$featureFlags42.restartNumberedListsToolbar) === true,
|
|
79
|
+
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)),
|
|
77
80
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
78
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
79
|
-
useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$
|
|
81
|
+
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),
|
|
82
|
+
useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags47 = props.featureFlags) === null || _props$featureFlags47 === void 0 ? void 0 : _props$featureFlags47.useEditorNext) === true,
|
|
83
|
+
// duplicated logic from `create-plugins-list.ts` due to presets not being finalised
|
|
84
|
+
useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
|
|
80
85
|
});
|
|
81
86
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldRecreatePreset = shouldRecreatePreset;
|
|
7
|
+
var EMPTY = [];
|
|
8
|
+
function shouldRecreatePreset(props, nextProps) {
|
|
9
|
+
var _props$dangerouslyApp, _props$dangerouslyApp2, _nextProps$dangerousl, _nextProps$dangerousl2;
|
|
10
|
+
var prevPlugins = (_props$dangerouslyApp = (_props$dangerouslyApp2 = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp2 === void 0 ? void 0 : _props$dangerouslyApp2.__plugins) !== null && _props$dangerouslyApp !== void 0 ? _props$dangerouslyApp : EMPTY;
|
|
11
|
+
var nextPlugins = (_nextProps$dangerousl = (_nextProps$dangerousl2 = nextProps.dangerouslyAppendPlugins) === null || _nextProps$dangerousl2 === void 0 ? void 0 : _nextProps$dangerousl2.__plugins) !== null && _nextProps$dangerousl !== void 0 ? _nextProps$dangerousl : EMPTY;
|
|
12
|
+
if (nextPlugins.length !== prevPlugins.length || prevPlugins.some(function (p) {
|
|
13
|
+
return nextPlugins.some(function (n) {
|
|
14
|
+
return n.name === p.name && n !== p;
|
|
15
|
+
});
|
|
16
|
+
})) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return shouldReconfigureState(props, nextProps);
|
|
20
|
+
}
|
|
21
|
+
function shouldReconfigureState(props, nextProps) {
|
|
22
|
+
var mobileProperties = props.appearance === 'mobile' ? ['quickInsert', 'featureFlags'] : [];
|
|
23
|
+
var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'].concat(mobileProperties);
|
|
24
|
+
return properties.reduce(function (acc, curr) {
|
|
25
|
+
return acc || props[curr] !== nextProps[curr];
|
|
26
|
+
}, false);
|
|
27
|
+
}
|
|
@@ -55,7 +55,7 @@ function EditorInternalWithoutHooks(_ref) {
|
|
|
55
55
|
providerFactory = _ref.providerFactory,
|
|
56
56
|
onEditorCreated = _ref.onEditorCreated,
|
|
57
57
|
onEditorDestroyed = _ref.onEditorDestroyed,
|
|
58
|
-
|
|
58
|
+
preset = _ref.preset;
|
|
59
59
|
var Component = (0, _createEditor.getUiComponent)(props.appearance);
|
|
60
60
|
var overriddenEditorProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
61
61
|
onSave: props.onSave ? handleSave : undefined,
|
|
@@ -95,7 +95,7 @@ function EditorInternalWithoutHooks(_ref) {
|
|
|
95
95
|
onEditorDestroyed: onEditorDestroyed,
|
|
96
96
|
allowAnalyticsGASV3: props.allowAnalyticsGASV3,
|
|
97
97
|
disabled: props.disabled,
|
|
98
|
-
|
|
98
|
+
preset: preset,
|
|
99
99
|
render: function render(_ref2) {
|
|
100
100
|
var _props$featureFlags, _props$featureFlags2;
|
|
101
101
|
var editor = _ref2.editor,
|
|
@@ -10,12 +10,23 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
10
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
|
|
14
16
|
var _editor = _interopRequireDefault(require("../editor"));
|
|
15
17
|
var _index = _interopRequireDefault(require("./index"));
|
|
16
|
-
var
|
|
18
|
+
var _useUniversalPreset = _interopRequireDefault(require("../labs/next/presets/useUniversalPreset"));
|
|
17
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
20
|
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; } }
|
|
21
|
+
var EditorNextWrapper = function EditorNextWrapper(_ref) {
|
|
22
|
+
var props = _ref.props;
|
|
23
|
+
var preset = (0, _useUniversalPreset.default)({
|
|
24
|
+
props: props
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({
|
|
27
|
+
preset: preset
|
|
28
|
+
}, props));
|
|
29
|
+
};
|
|
19
30
|
var EditorMigrationComponent = /*#__PURE__*/function (_React$Component) {
|
|
20
31
|
(0, _inherits2.default)(EditorMigrationComponent, _React$Component);
|
|
21
32
|
var _super = _createSuper(EditorMigrationComponent);
|
|
@@ -27,7 +38,12 @@ var EditorMigrationComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
27
38
|
key: "render",
|
|
28
39
|
value: function render() {
|
|
29
40
|
var featureFlags = (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(this.props);
|
|
30
|
-
|
|
41
|
+
if (!featureFlags.useEditorNext) {
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_editor.default, this.props);
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(EditorNextWrapper, {
|
|
45
|
+
props: this.props
|
|
46
|
+
});
|
|
31
47
|
}
|
|
32
48
|
}]);
|
|
33
49
|
return EditorMigrationComponent;
|
|
@@ -12,6 +12,7 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
12
12
|
var _prepareQuickInsertProvider = _interopRequireDefault(require("../../utils/prepare-quick-insert-provider"));
|
|
13
13
|
var _prepareExtensionProvider = _interopRequireDefault(require("../../utils/prepare-extension-provider"));
|
|
14
14
|
var _handleProviders = _interopRequireDefault(require("../utils/handleProviders"));
|
|
15
|
+
var _getProvidersFromEditorProps = _interopRequireDefault(require("../utils/getProvidersFromEditorProps"));
|
|
15
16
|
function createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent) {
|
|
16
17
|
var extensionProvider = (0, _prepareExtensionProvider.default)(function () {
|
|
17
18
|
return editorActions;
|
|
@@ -53,11 +54,11 @@ function useProviderFactory(props, editorActions, createAnalyticsEvent) {
|
|
|
53
54
|
quickInsert && quickInsert !== (prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert)) {
|
|
54
55
|
var newState = createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent);
|
|
55
56
|
setProviderState(newState);
|
|
56
|
-
(0, _handleProviders.default)(providerFactory.current, props, newState.extensionProvider, newState.quickInsertProvider);
|
|
57
|
+
(0, _handleProviders.default)(providerFactory.current, (0, _getProvidersFromEditorProps.default)(props), newState.extensionProvider, newState.quickInsertProvider);
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
(0, _handleProviders.default)(providerFactory.current, props, providerState.extensionProvider, providerState.quickInsertProvider);
|
|
60
|
-
}, [props, prevProps, createAnalyticsEvent, editorActions, providerState.extensionProvider, providerState.quickInsertProvider, extensionProviders, quickInsert]);
|
|
60
|
+
(0, _handleProviders.default)(providerFactory.current, (0, _getProvidersFromEditorProps.default)(props), providerState.extensionProvider, providerState.quickInsertProvider);
|
|
61
|
+
}, [props, prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert, prevProps === null || prevProps === void 0 ? void 0 : prevProps.extensionProviders, createAnalyticsEvent, editorActions, providerState.extensionProvider, providerState.quickInsertProvider, extensionProviders, quickInsert]);
|
|
61
62
|
|
|
62
63
|
// componentWillUnmount equivalent
|
|
63
64
|
(0, _react.useEffect)(function () {
|
|
@@ -27,7 +27,9 @@ var _editorPropTypes = require("./utils/editorPropTypes");
|
|
|
27
27
|
var _trackEditorActions = _interopRequireDefault(require("./utils/trackEditorActions"));
|
|
28
28
|
var _onEditorCreated2 = _interopRequireDefault(require("./utils/onEditorCreated"));
|
|
29
29
|
var _deprecationWarnings = _interopRequireDefault(require("./utils/deprecationWarnings"));
|
|
30
|
-
var
|
|
30
|
+
var _plugins = require("../plugins");
|
|
31
|
+
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; }
|
|
32
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
31
33
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
32
34
|
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; } }
|
|
33
35
|
var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
@@ -60,7 +62,6 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
60
62
|
_this.onEditorCreated = _this.onEditorCreated.bind((0, _assertThisInitialized2.default)(_this));
|
|
61
63
|
_this.onEditorDestroyed = _this.onEditorDestroyed.bind((0, _assertThisInitialized2.default)(_this));
|
|
62
64
|
_this.getExperienceStore = _this.getExperienceStore.bind((0, _assertThisInitialized2.default)(_this));
|
|
63
|
-
_this.getEditorPlugins = _this.getEditorPlugins.bind((0, _assertThisInitialized2.default)(_this));
|
|
64
65
|
(0, _trackEditorActions.default)(_this.editorActions, props.performanceTracking, function (value) {
|
|
65
66
|
return _this.handleAnalyticsEvent(value);
|
|
66
67
|
});
|
|
@@ -113,7 +114,7 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
113
114
|
props: _this3.props,
|
|
114
115
|
handleAnalyticsEvent: _this3.handleAnalyticsEvent,
|
|
115
116
|
createAnalyticsEvent: _this3.createAnalyticsEvent,
|
|
116
|
-
|
|
117
|
+
preset: _this3.props.preset,
|
|
117
118
|
handleSave: _this3.handleSave,
|
|
118
119
|
editorActions: _this3.editorActions,
|
|
119
120
|
getExperienceStore: _this3.getExperienceStore,
|
|
@@ -123,11 +124,6 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
|
|
|
123
124
|
}
|
|
124
125
|
}));
|
|
125
126
|
}
|
|
126
|
-
}, {
|
|
127
|
-
key: "getEditorPlugins",
|
|
128
|
-
value: function getEditorPlugins(props) {
|
|
129
|
-
return (0, _getEditorPlugins2.default)(props);
|
|
130
|
-
}
|
|
131
127
|
}]);
|
|
132
128
|
return EditorNext;
|
|
133
129
|
}(_react2.default.Component);
|
|
@@ -136,4 +132,12 @@ exports.default = EditorNext;
|
|
|
136
132
|
(0, _defineProperty2.default)(EditorNext, "contextTypes", {
|
|
137
133
|
editorActions: _propTypes.default.object
|
|
138
134
|
});
|
|
139
|
-
(0, _defineProperty2.default)(EditorNext, "propTypes", (0, _editorPropTypes.propTypes)('minHeight only supports editor appearance chromeless and comment for EditorNext'))
|
|
135
|
+
(0, _defineProperty2.default)(EditorNext, "propTypes", _objectSpread(_objectSpread({}, (0, _editorPropTypes.propTypes)('minHeight only supports editor appearance chromeless and comment for EditorNext')), {}, {
|
|
136
|
+
preset: function preset(_ref) {
|
|
137
|
+
var _preset = _ref.preset;
|
|
138
|
+
if (!_preset.has(_plugins.basePlugin)) {
|
|
139
|
+
return new Error('Presets must contain the base plugin');
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getProvidersFromEditorProps;
|
|
7
|
+
function getProvidersFromEditorProps(_ref) {
|
|
8
|
+
var _linking$smartLinks;
|
|
9
|
+
var linking = _ref.linking,
|
|
10
|
+
smartLinks = _ref.smartLinks,
|
|
11
|
+
UNSAFE_cards = _ref.UNSAFE_cards,
|
|
12
|
+
autoformattingProvider = _ref.autoformattingProvider,
|
|
13
|
+
media = _ref.media,
|
|
14
|
+
emojiProvider = _ref.emojiProvider,
|
|
15
|
+
mentionProvider = _ref.mentionProvider,
|
|
16
|
+
legacyImageUploadProvider = _ref.legacyImageUploadProvider,
|
|
17
|
+
taskDecisionProvider = _ref.taskDecisionProvider,
|
|
18
|
+
contextIdentifierProvider = _ref.contextIdentifierProvider,
|
|
19
|
+
searchProvider = _ref.searchProvider,
|
|
20
|
+
macroProvider = _ref.macroProvider,
|
|
21
|
+
activityProvider = _ref.activityProvider,
|
|
22
|
+
collabEdit = _ref.collabEdit,
|
|
23
|
+
collabEditProvider = _ref.collabEditProvider,
|
|
24
|
+
presenceProvider = _ref.presenceProvider;
|
|
25
|
+
var cardProvider = (linking === null || linking === void 0 ? void 0 : (_linking$smartLinks = linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
|
|
26
|
+
return {
|
|
27
|
+
mediaProvider: media === null || media === void 0 ? void 0 : media.provider,
|
|
28
|
+
emojiProvider: emojiProvider,
|
|
29
|
+
mentionProvider: mentionProvider,
|
|
30
|
+
autoformattingProvider: autoformattingProvider,
|
|
31
|
+
cardProvider: cardProvider,
|
|
32
|
+
activityProvider: activityProvider,
|
|
33
|
+
imageUploadProvider: legacyImageUploadProvider,
|
|
34
|
+
taskDecisionProvider: taskDecisionProvider,
|
|
35
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
36
|
+
searchProvider: searchProvider,
|
|
37
|
+
presenceProvider: presenceProvider,
|
|
38
|
+
macroProvider: macroProvider,
|
|
39
|
+
collabEditProvider: collabEdit && collabEdit.provider ? collabEdit.provider : collabEditProvider
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -13,36 +13,31 @@ exports.default = handleProviders;
|
|
|
13
13
|
* @param extensionProvider
|
|
14
14
|
* @param quickInsertProvider
|
|
15
15
|
*/
|
|
16
|
-
function handleProviders(providerFactory,
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
searchProvider = props.searchProvider,
|
|
31
|
-
UNSAFE_cards = props.UNSAFE_cards,
|
|
32
|
-
smartLinks = props.smartLinks,
|
|
33
|
-
linking = props.linking;
|
|
16
|
+
function handleProviders(providerFactory, _ref, extensionProvider, quickInsertProvider) {
|
|
17
|
+
var emojiProvider = _ref.emojiProvider,
|
|
18
|
+
mentionProvider = _ref.mentionProvider,
|
|
19
|
+
taskDecisionProvider = _ref.taskDecisionProvider,
|
|
20
|
+
contextIdentifierProvider = _ref.contextIdentifierProvider,
|
|
21
|
+
collabEditProvider = _ref.collabEditProvider,
|
|
22
|
+
activityProvider = _ref.activityProvider,
|
|
23
|
+
presenceProvider = _ref.presenceProvider,
|
|
24
|
+
macroProvider = _ref.macroProvider,
|
|
25
|
+
imageUploadProvider = _ref.imageUploadProvider,
|
|
26
|
+
mediaProvider = _ref.mediaProvider,
|
|
27
|
+
autoformattingProvider = _ref.autoformattingProvider,
|
|
28
|
+
searchProvider = _ref.searchProvider,
|
|
29
|
+
cardProvider = _ref.cardProvider;
|
|
34
30
|
providerFactory.setProvider('emojiProvider', emojiProvider);
|
|
35
31
|
providerFactory.setProvider('mentionProvider', mentionProvider);
|
|
36
32
|
providerFactory.setProvider('taskDecisionProvider', taskDecisionProvider);
|
|
37
33
|
providerFactory.setProvider('contextIdentifierProvider', contextIdentifierProvider);
|
|
38
|
-
providerFactory.setProvider('mediaProvider',
|
|
39
|
-
providerFactory.setProvider('imageUploadProvider',
|
|
40
|
-
providerFactory.setProvider('collabEditProvider',
|
|
34
|
+
providerFactory.setProvider('mediaProvider', mediaProvider);
|
|
35
|
+
providerFactory.setProvider('imageUploadProvider', imageUploadProvider);
|
|
36
|
+
providerFactory.setProvider('collabEditProvider', collabEditProvider);
|
|
41
37
|
providerFactory.setProvider('activityProvider', activityProvider);
|
|
42
38
|
providerFactory.setProvider('searchProvider', searchProvider);
|
|
43
39
|
providerFactory.setProvider('presenceProvider', presenceProvider);
|
|
44
40
|
providerFactory.setProvider('macroProvider', macroProvider);
|
|
45
|
-
var cardProvider = (linking === null || linking === void 0 ? void 0 : (_linking$smartLinks = linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
|
|
46
41
|
if (cardProvider) {
|
|
47
42
|
providerFactory.setProvider('cardProvider', cardProvider);
|
|
48
43
|
}
|
package/dist/cjs/editor.js
CHANGED
|
@@ -31,10 +31,12 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
31
31
|
var _prepareQuickInsertProvider = _interopRequireDefault(require("./utils/prepare-quick-insert-provider"));
|
|
32
32
|
var _prepareExtensionProvider = _interopRequireDefault(require("./utils/prepare-extension-provider"));
|
|
33
33
|
var _handleProviders = _interopRequireDefault(require("./editor-next/utils/handleProviders"));
|
|
34
|
+
var _getProvidersFromEditorProps = _interopRequireDefault(require("./editor-next/utils/getProvidersFromEditorProps"));
|
|
34
35
|
var _measureEnum = _interopRequireDefault(require("./utils/performance/measure-enum"));
|
|
35
36
|
var _editorMeasureTTICallback = _interopRequireDefault(require("./editor-next/utils/editorMeasureTTICallback"));
|
|
36
37
|
var _sendDurationAnalytics = _interopRequireDefault(require("./editor-next/utils/sendDurationAnalytics"));
|
|
37
|
-
var
|
|
38
|
+
var _createPluginsList = require("./create-editor/create-plugins-list");
|
|
39
|
+
var _presetUtils = require("./create-editor/preset-utils");
|
|
38
40
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
39
41
|
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; } }
|
|
40
42
|
var Editor = /*#__PURE__*/function (_React$Component) {
|
|
@@ -74,7 +76,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
74
76
|
_this.startTime = performance.now();
|
|
75
77
|
_this.onEditorCreated = _this.onEditorCreated.bind((0, _assertThisInitialized2.default)(_this));
|
|
76
78
|
_this.onEditorDestroyed = _this.onEditorDestroyed.bind((0, _assertThisInitialized2.default)(_this));
|
|
77
|
-
_this.getEditorPlugins = _this.getEditorPlugins.bind((0, _assertThisInitialized2.default)(_this));
|
|
78
79
|
_this.getExperienceStore = _this.getExperienceStore.bind((0, _assertThisInitialized2.default)(_this));
|
|
79
80
|
_this.trackEditorActions(_this.editorActions, props);
|
|
80
81
|
|
|
@@ -96,9 +97,11 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
96
97
|
*/
|
|
97
98
|
var _extensionProvider = _this.prepareExtensionProvider(props.extensionProviders);
|
|
98
99
|
var quickInsertProvider = _this.prepareQuickInsertProvider(_extensionProvider, props.quickInsert);
|
|
100
|
+
var preset = (0, _createPluginsList.createPreset)(props, undefined, _this.createAnalyticsEvent);
|
|
99
101
|
_this.state = {
|
|
100
102
|
extensionProvider: _extensionProvider,
|
|
101
|
-
quickInsertProvider: quickInsertProvider
|
|
103
|
+
quickInsertProvider: quickInsertProvider,
|
|
104
|
+
preset: preset
|
|
102
105
|
};
|
|
103
106
|
return _this;
|
|
104
107
|
}
|
|
@@ -112,7 +115,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
112
115
|
key: "componentDidMount",
|
|
113
116
|
value: function componentDidMount() {
|
|
114
117
|
(0, _utils.stopMeasure)(_measureEnum.default.EDITOR_MOUNTED, (0, _sendDurationAnalytics.default)(_analytics.ACTION.EDITOR_MOUNTED, this.props, this.getExperienceStore, this.createAnalyticsEvent));
|
|
115
|
-
(0, _handleProviders.default)(this.providerFactory, this.props, this.state.extensionProvider, this.state.quickInsertProvider);
|
|
118
|
+
(0, _handleProviders.default)(this.providerFactory, (0, _getProvidersFromEditorProps.default)(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
/**
|
|
@@ -123,6 +126,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
123
126
|
key: "componentDidUpdate",
|
|
124
127
|
value: function componentDidUpdate(prevProps) {
|
|
125
128
|
var _this2 = this;
|
|
129
|
+
var needsANewPreset = (0, _presetUtils.shouldRecreatePreset)(prevProps, this.props);
|
|
130
|
+
var preset = needsANewPreset ? (0, _createPluginsList.createPreset)(this.props, prevProps, this.createAnalyticsEvent) : this.state.preset;
|
|
126
131
|
var _this$props2 = this.props,
|
|
127
132
|
extensionProviders = _this$props2.extensionProviders,
|
|
128
133
|
quickInsert = _this$props2.quickInsert;
|
|
@@ -135,13 +140,20 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
135
140
|
var quickInsertProvider = this.prepareQuickInsertProvider(extensionProvider, quickInsert);
|
|
136
141
|
this.setState({
|
|
137
142
|
extensionProvider: extensionProvider,
|
|
138
|
-
quickInsertProvider: quickInsertProvider
|
|
143
|
+
quickInsertProvider: quickInsertProvider,
|
|
144
|
+
preset: preset
|
|
139
145
|
}, function () {
|
|
140
|
-
return (0, _handleProviders.default)(_this2.providerFactory, _this2.props, _this2.state.extensionProvider, _this2.state.quickInsertProvider);
|
|
146
|
+
return (0, _handleProviders.default)(_this2.providerFactory, (0, _getProvidersFromEditorProps.default)(_this2.props), _this2.state.extensionProvider, _this2.state.quickInsertProvider);
|
|
141
147
|
});
|
|
142
148
|
return;
|
|
143
149
|
}
|
|
144
|
-
(
|
|
150
|
+
if (needsANewPreset) {
|
|
151
|
+
this.setState({
|
|
152
|
+
preset: preset
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
(0, _handleProviders.default)(this.providerFactory, (0, _getProvidersFromEditorProps.default)(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
|
|
145
157
|
}
|
|
146
158
|
|
|
147
159
|
/**
|
|
@@ -268,7 +280,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
268
280
|
props: _this5.props,
|
|
269
281
|
handleAnalyticsEvent: _this5.handleAnalyticsEvent,
|
|
270
282
|
createAnalyticsEvent: _this5.createAnalyticsEvent,
|
|
271
|
-
|
|
283
|
+
preset: _this5.state.preset,
|
|
272
284
|
handleSave: _this5.handleSave,
|
|
273
285
|
editorActions: _this5.editorActions,
|
|
274
286
|
providerFactory: _this5.providerFactory,
|
|
@@ -278,11 +290,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
278
290
|
}
|
|
279
291
|
}));
|
|
280
292
|
}
|
|
281
|
-
}, {
|
|
282
|
-
key: "getEditorPlugins",
|
|
283
|
-
value: function getEditorPlugins(props) {
|
|
284
|
-
return (0, _getEditorPlugins2.default)(props);
|
|
285
|
-
}
|
|
286
293
|
}]);
|
|
287
294
|
return Editor;
|
|
288
295
|
}(_react2.default.Component);
|
|
@@ -3,28 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var LEFT = 37;
|
|
8
|
-
exports.LEFT = LEFT;
|
|
9
|
-
var RIGHT = 39;
|
|
10
|
-
exports.RIGHT = RIGHT;
|
|
11
|
-
var UP = 38;
|
|
12
|
-
exports.UP = UP;
|
|
13
|
-
var DOWN = 40;
|
|
14
|
-
exports.DOWN = DOWN;
|
|
6
|
+
exports.HEADING_KEYS = void 0;
|
|
15
7
|
var KEY_0 = 48;
|
|
16
|
-
exports.KEY_0 = KEY_0;
|
|
17
8
|
var KEY_1 = 49;
|
|
18
|
-
exports.KEY_1 = KEY_1;
|
|
19
9
|
var KEY_2 = 50;
|
|
20
|
-
exports.KEY_2 = KEY_2;
|
|
21
10
|
var KEY_3 = 51;
|
|
22
|
-
exports.KEY_3 = KEY_3;
|
|
23
11
|
var KEY_4 = 52;
|
|
24
|
-
exports.KEY_4 = KEY_4;
|
|
25
12
|
var KEY_5 = 53;
|
|
26
|
-
exports.KEY_5 = KEY_5;
|
|
27
13
|
var KEY_6 = 54;
|
|
28
|
-
exports.KEY_6 = KEY_6;
|
|
29
14
|
var HEADING_KEYS = [KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6];
|
|
30
15
|
exports.HEADING_KEYS = HEADING_KEYS;
|