@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
|
@@ -21,7 +21,7 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
21
21
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
22
22
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
23
23
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
24
|
-
var _ColorPalette =
|
|
24
|
+
var _ColorPalette = _interopRequireWildcard(require("../../../../ui/ColorPalette"));
|
|
25
25
|
var _Dropdown = _interopRequireDefault(require("../../../../ui/Dropdown"));
|
|
26
26
|
var _styles = require("../../../../ui/styles");
|
|
27
27
|
var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
|
|
@@ -232,14 +232,16 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
232
232
|
}, (0, _react2.jsx)("div", {
|
|
233
233
|
"data-testid": "text-color-palette"
|
|
234
234
|
}, (0, _react2.jsx)(_ColorPalette.default, {
|
|
235
|
-
palette: palette,
|
|
236
235
|
onClick: function onClick(color) {
|
|
237
236
|
return _this2.changeTextColor(color, pluginState.disabled);
|
|
238
237
|
},
|
|
239
238
|
selectedColor: pluginState.color,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
paletteOptions: {
|
|
240
|
+
palette: palette,
|
|
241
|
+
hexToPaletteColor: _editorPalette.hexToEditorTextPaletteColor,
|
|
242
|
+
paletteColorTooltipMessages: _ColorPalette.textPaletteTooltipMessages,
|
|
243
|
+
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames
|
|
244
|
+
}
|
|
243
245
|
}))), (0, _react2.jsx)("span", {
|
|
244
246
|
css: _styles.separatorStyles
|
|
245
247
|
}));
|
|
@@ -23,10 +23,15 @@ function replaceTextUsingCaptureGroup(text) {
|
|
|
23
23
|
var _match = (0, _slicedToArray2.default)(match, 4),
|
|
24
24
|
prefix = _match[1],
|
|
25
25
|
suffix = _match[3];
|
|
26
|
-
var replacement =
|
|
26
|
+
var replacement = text + (suffix || '');
|
|
27
27
|
var tr = state.tr,
|
|
28
28
|
$to = state.selection.$to;
|
|
29
|
-
|
|
29
|
+
var startPos = start + (prefix || '').length;
|
|
30
|
+
var safePos = Math.min(
|
|
31
|
+
// I know it is almost impossible to have a negative value at this point.
|
|
32
|
+
// But, this is JS #trustnoone
|
|
33
|
+
Math.max(startPos, 0), end);
|
|
34
|
+
tr.replaceWith(safePos, end, state.schema.text(replacement, $to.marks()));
|
|
30
35
|
tr.setSelection(_prosemirrorState.Selection.near(tr.doc.resolve(tr.selection.to)));
|
|
31
36
|
return tr;
|
|
32
37
|
};
|
|
@@ -76,6 +81,7 @@ function createSingleQuotesRules() {
|
|
|
76
81
|
// apostrophe
|
|
77
82
|
createReplacementRule('’', /(\w+)(')(\w+)$/)];
|
|
78
83
|
}
|
|
84
|
+
|
|
79
85
|
/**
|
|
80
86
|
* Get replacement rules related to product
|
|
81
87
|
*/
|
|
@@ -3,34 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.markActive = exports.isArrayContainsContent = exports.hasCode = exports.compareItemsArrays = exports.checkFormattingIsPresent = exports.anyMarkActive = void 0;
|
|
7
7
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
8
8
|
var _clearFormatting = require("./commands/clear-formatting");
|
|
9
|
-
var nodeLen = function nodeLen(node) {
|
|
10
|
-
return node.nodeType === 3 && node.nodeValue ? node.nodeValue.length : node.childNodes.length;
|
|
11
|
-
};
|
|
12
|
-
exports.nodeLen = nodeLen;
|
|
13
|
-
var isIgnorable = function isIgnorable(dom) {
|
|
14
|
-
return dom.pmViewDesc && dom.pmViewDesc.size === 0;
|
|
15
|
-
};
|
|
16
|
-
exports.isIgnorable = isIgnorable;
|
|
17
|
-
var isBlockNode = function isBlockNode(dom) {
|
|
18
|
-
var desc = dom.pmViewDesc;
|
|
19
|
-
return desc && desc.node && desc.node.isBlock;
|
|
20
|
-
};
|
|
21
|
-
exports.isBlockNode = isBlockNode;
|
|
22
|
-
var domIndex = function domIndex(node) {
|
|
23
|
-
if (node) {
|
|
24
|
-
for (var index = 0;; index++) {
|
|
25
|
-
node = node.previousSibling;
|
|
26
|
-
if (!node) {
|
|
27
|
-
return index;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return;
|
|
32
|
-
};
|
|
33
|
-
exports.domIndex = domIndex;
|
|
34
9
|
var hasCode = function hasCode(state, pos) {
|
|
35
10
|
var code = state.schema.marks.code;
|
|
36
11
|
var node = pos >= 0 && state.doc.nodeAt(pos);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TYPE_AHEAD_POPUP_CONTENT_CLASS = exports.TYPE_AHEAD_DECORATION_KEY = exports.TYPE_AHEAD_DECORATION_ELEMENT_ID = exports.TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = exports.
|
|
6
|
+
exports.TYPE_AHEAD_POPUP_CONTENT_CLASS = exports.TYPE_AHEAD_DECORATION_KEY = exports.TYPE_AHEAD_DECORATION_ELEMENT_ID = exports.TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = exports.CloseSelectionOptions = void 0;
|
|
7
7
|
var TYPE_AHEAD_DECORATION_KEY = 'typeahead_decoration_key';
|
|
8
8
|
exports.TYPE_AHEAD_DECORATION_KEY = TYPE_AHEAD_DECORATION_KEY;
|
|
9
9
|
var TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = 'typeaheadDecoration';
|
|
@@ -12,12 +12,6 @@ var TYPE_AHEAD_POPUP_CONTENT_CLASS = 'fabric-editor-typeahead';
|
|
|
12
12
|
exports.TYPE_AHEAD_POPUP_CONTENT_CLASS = TYPE_AHEAD_POPUP_CONTENT_CLASS;
|
|
13
13
|
var TYPE_AHEAD_DECORATION_ELEMENT_ID = 'typeahaed_decoration_element_id';
|
|
14
14
|
exports.TYPE_AHEAD_DECORATION_ELEMENT_ID = TYPE_AHEAD_DECORATION_ELEMENT_ID;
|
|
15
|
-
var NavigationDirection;
|
|
16
|
-
exports.NavigationDirection = NavigationDirection;
|
|
17
|
-
(function (NavigationDirection) {
|
|
18
|
-
NavigationDirection[NavigationDirection["LEFT"] = -1] = "LEFT";
|
|
19
|
-
NavigationDirection[NavigationDirection["RIGHT"] = 1] = "RIGHT";
|
|
20
|
-
})(NavigationDirection || (exports.NavigationDirection = NavigationDirection = {}));
|
|
21
15
|
var CloseSelectionOptions;
|
|
22
16
|
exports.CloseSelectionOptions = CloseSelectionOptions;
|
|
23
17
|
(function (CloseSelectionOptions) {
|
|
@@ -127,6 +127,8 @@ var TypeAheadMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
127
127
|
*
|
|
128
128
|
*/
|
|
129
129
|
var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
130
|
+
var _options$useBetterTyp;
|
|
131
|
+
var useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
|
|
130
132
|
var fireAnalyticsCallback = (0, _analytics.fireAnalyticsEvent)(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
131
133
|
var popupMountRef = {
|
|
132
134
|
current: null
|
|
@@ -153,7 +155,8 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
153
155
|
popupMountRef: popupMountRef,
|
|
154
156
|
reactDispatch: dispatch,
|
|
155
157
|
typeAheadHandlers: typeAhead,
|
|
156
|
-
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
|
|
158
|
+
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
|
|
159
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
157
160
|
});
|
|
158
161
|
}
|
|
159
162
|
}, {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.factoryDecorations = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
10
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
@@ -22,7 +22,8 @@ var _closeTypeAhead = require("../transforms/close-type-ahead");
|
|
|
22
22
|
var factoryDecorations = function factoryDecorations(_ref) {
|
|
23
23
|
var intl = _ref.intl,
|
|
24
24
|
popupMountRef = _ref.popupMountRef,
|
|
25
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent
|
|
25
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
26
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
26
27
|
var createDecorations = function createDecorations(tr, _ref2) {
|
|
27
28
|
var triggerHandler = _ref2.triggerHandler,
|
|
28
29
|
inputMethod = _ref2.inputMethod,
|
|
@@ -94,7 +95,8 @@ var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
94
95
|
popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
|
|
95
96
|
popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
|
|
96
97
|
onUndoRedo: onUndoRedo,
|
|
97
|
-
reopenQuery: reopenQuery
|
|
98
|
+
reopenQuery: reopenQuery,
|
|
99
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
98
100
|
})), typeaheadComponent);
|
|
99
101
|
shouldFocusCursorInsideQuery = false;
|
|
100
102
|
return typeaheadComponent;
|
|
@@ -146,37 +148,4 @@ var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
146
148
|
removeDecorations: removeDecorations
|
|
147
149
|
};
|
|
148
150
|
};
|
|
149
|
-
exports.factoryDecorations = factoryDecorations;
|
|
150
|
-
var isSelectionInsideTypeAhead = function isSelectionInsideTypeAhead(_ref4) {
|
|
151
|
-
var decorationSet = _ref4.decorationSet,
|
|
152
|
-
selection = _ref4.selection;
|
|
153
|
-
if (!decorationSet || decorationSet === _prosemirrorView.DecorationSet.empty) {
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
var typeAheadDecorations = decorationSet.find(undefined, undefined, function (spec) {
|
|
157
|
-
return spec.isTypeAheadDecoration;
|
|
158
|
-
});
|
|
159
|
-
if (!typeAheadDecorations || typeAheadDecorations.length === 0) {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
return typeAheadDecorations.some(function (dec) {
|
|
163
|
-
return dec.from === selection.from && dec.to === selection.to;
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
exports.isSelectionInsideTypeAhead = isSelectionInsideTypeAhead;
|
|
167
|
-
var findDecorationElement = function findDecorationElement(_ref5) {
|
|
168
|
-
var selection = _ref5.selection,
|
|
169
|
-
decorationSet = _ref5.decorationSet;
|
|
170
|
-
if (!decorationSet || decorationSet === _prosemirrorView.DecorationSet.empty || !(selection instanceof _prosemirrorState.TextSelection) || !selection.$cursor) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
var pos = selection.$cursor.pos;
|
|
174
|
-
var decoration = decorationSet.find(pos, pos, function (spec) {
|
|
175
|
-
return spec === null || spec === void 0 ? void 0 : spec.isTypeAheadDecoration;
|
|
176
|
-
});
|
|
177
|
-
if (!decoration || decoration.length !== 1) {
|
|
178
|
-
return null;
|
|
179
|
-
}
|
|
180
|
-
return document.querySelector("#".concat(decoration[0].spec.key));
|
|
181
|
-
};
|
|
182
|
-
exports.findDecorationElement = findDecorationElement;
|
|
151
|
+
exports.factoryDecorations = factoryDecorations;
|
|
@@ -31,12 +31,14 @@ function createPlugin(_ref) {
|
|
|
31
31
|
popupMountRef = _ref.popupMountRef,
|
|
32
32
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
33
33
|
typeAheadHandlers = _ref.typeAheadHandlers,
|
|
34
|
-
getIntl = _ref.getIntl
|
|
34
|
+
getIntl = _ref.getIntl,
|
|
35
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
35
36
|
var intl = getIntl();
|
|
36
37
|
var _factoryDecorations = (0, _decorations.factoryDecorations)({
|
|
37
38
|
intl: intl,
|
|
38
39
|
popupMountRef: popupMountRef,
|
|
39
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
40
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
41
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
40
42
|
}),
|
|
41
43
|
createDecorations = _factoryDecorations.createDecorations,
|
|
42
44
|
removeDecorations = _factoryDecorations.removeDecorations;
|
|
@@ -76,7 +76,8 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
76
76
|
onQueryFocus = _ref.onQueryFocus,
|
|
77
77
|
onUndoRedo = _ref.onUndoRedo,
|
|
78
78
|
editorView = _ref.editorView,
|
|
79
|
-
items = _ref.items
|
|
79
|
+
items = _ref.items,
|
|
80
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
80
81
|
var ref = (0, _react.useRef)(document.createElement('span'));
|
|
81
82
|
var inputRef = (0, _react.useRef)(null);
|
|
82
83
|
var _useState = (0, _react.useState)(null),
|
|
@@ -149,6 +150,19 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
149
150
|
// Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
|
|
150
151
|
if (!event.isComposing || event.which !== 229 && event.keyCode !== 229) {
|
|
151
152
|
if (selectedIndex === -1) {
|
|
153
|
+
if (useBetterTypeaheadNavigation) {
|
|
154
|
+
/**
|
|
155
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
156
|
+
* here, either
|
|
157
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
158
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
159
|
+
* focus changes,
|
|
160
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
161
|
+
*
|
|
162
|
+
* The focus behaviour still needs cleanup
|
|
163
|
+
*/
|
|
164
|
+
selectPreviousItem();
|
|
165
|
+
}
|
|
152
166
|
selectNextItem();
|
|
153
167
|
}
|
|
154
168
|
onItemSelect(event.shiftKey ? _typeAhead.SelectItemMode.SHIFT_ENTER : _typeAhead.SelectItemMode.ENTER);
|
|
@@ -156,18 +170,41 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
156
170
|
break;
|
|
157
171
|
case 'Tab':
|
|
158
172
|
if (selectedIndex === -1) {
|
|
173
|
+
if (useBetterTypeaheadNavigation) {
|
|
174
|
+
/**
|
|
175
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
176
|
+
* here, either
|
|
177
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
178
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
179
|
+
* focus changes,
|
|
180
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
181
|
+
*
|
|
182
|
+
*/
|
|
183
|
+
selectPreviousItem();
|
|
184
|
+
}
|
|
159
185
|
selectNextItem();
|
|
160
186
|
}
|
|
187
|
+
// TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
|
|
161
188
|
onItemSelect(_typeAhead.SelectItemMode.TAB);
|
|
162
189
|
break;
|
|
163
190
|
case 'ArrowDown':
|
|
164
|
-
if (
|
|
191
|
+
if (useBetterTypeaheadNavigation) {
|
|
165
192
|
selectNextItem();
|
|
193
|
+
} else {
|
|
194
|
+
// TODO DTR-1401: why were we preventing selection?
|
|
195
|
+
if (selectedIndex === -1) {
|
|
196
|
+
selectNextItem();
|
|
197
|
+
}
|
|
166
198
|
}
|
|
167
199
|
break;
|
|
168
200
|
case 'ArrowUp':
|
|
169
|
-
if (
|
|
201
|
+
if (useBetterTypeaheadNavigation) {
|
|
170
202
|
selectPreviousItem();
|
|
203
|
+
} else {
|
|
204
|
+
// TODO DTR-1401: why were we preventing selection?
|
|
205
|
+
if (selectedIndex === -1) {
|
|
206
|
+
selectPreviousItem();
|
|
207
|
+
}
|
|
171
208
|
}
|
|
172
209
|
break;
|
|
173
210
|
}
|
|
@@ -180,7 +217,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
180
217
|
event.preventDefault();
|
|
181
218
|
return false;
|
|
182
219
|
}
|
|
183
|
-
}, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
220
|
+
}, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
184
221
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
185
222
|
var _inputRef$current;
|
|
186
223
|
event.stopPropagation();
|
|
@@ -185,6 +185,8 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
|
|
|
185
185
|
selectPreviousItem();
|
|
186
186
|
event.preventDefault();
|
|
187
187
|
break;
|
|
188
|
+
|
|
189
|
+
// TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
|
|
188
190
|
case 'Tab':
|
|
189
191
|
//Tab key quick inserts the selected item.
|
|
190
192
|
onItemClick(_typeAhead.SelectItemMode.TAB, selectedIndex);
|
|
@@ -29,7 +29,8 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
29
29
|
inputMethod = _ref.inputMethod,
|
|
30
30
|
getDecorationPosition = _ref.getDecorationPosition,
|
|
31
31
|
reopenQuery = _ref.reopenQuery,
|
|
32
|
-
onUndoRedo = _ref.onUndoRedo
|
|
32
|
+
onUndoRedo = _ref.onUndoRedo,
|
|
33
|
+
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
33
34
|
var _useState = (0, _react.useState)(false),
|
|
34
35
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
36
|
closed = _useState2[0],
|
|
@@ -51,15 +52,17 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
51
52
|
var selectNextItem = (0, _react.useMemo)(function () {
|
|
52
53
|
return (0, _utils.moveSelectedIndex)({
|
|
53
54
|
editorView: editorView,
|
|
54
|
-
direction: 'next'
|
|
55
|
+
direction: 'next',
|
|
56
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
55
57
|
});
|
|
56
|
-
}, [editorView]);
|
|
58
|
+
}, [editorView, useBetterTypeaheadNavigation]);
|
|
57
59
|
var selectPreviousItem = (0, _react.useMemo)(function () {
|
|
58
60
|
return (0, _utils.moveSelectedIndex)({
|
|
59
61
|
editorView: editorView,
|
|
60
|
-
direction: 'previous'
|
|
62
|
+
direction: 'previous',
|
|
63
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
61
64
|
});
|
|
62
|
-
}, [editorView]);
|
|
65
|
+
}, [editorView, useBetterTypeaheadNavigation]);
|
|
63
66
|
var cancel = (0, _react.useCallback)(function (_ref2) {
|
|
64
67
|
var setSelectionAt = _ref2.setSelectionAt,
|
|
65
68
|
addPrefixTrigger = _ref2.addPrefixTrigger,
|
|
@@ -110,6 +113,7 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
110
113
|
return null;
|
|
111
114
|
}
|
|
112
115
|
return /*#__PURE__*/_react.default.createElement(_InputQuery.InputQuery, {
|
|
116
|
+
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
|
|
113
117
|
triggerQueryPrefix: triggerHandler.trigger,
|
|
114
118
|
onQueryChange: setQuery,
|
|
115
119
|
onItemSelect: insertSelectedItem,
|
|
@@ -3,31 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadListAriaLabels = exports.getTypeAheadHandler = exports.getPluginState = exports.
|
|
7
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
8
|
-
var _prosemirrorView = require("prosemirror-view");
|
|
6
|
+
exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadListAriaLabels = exports.getTypeAheadHandler = exports.getPluginState = exports.findHandlerByTrigger = exports.findHandler = void 0;
|
|
9
7
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
10
8
|
var _key = require("./pm-plugins/key");
|
|
11
9
|
var _updateSelectedIndex = require("./commands/update-selected-index");
|
|
12
10
|
var _statsModifier = require("./stats-modifier");
|
|
13
11
|
var _messages = require("./messages");
|
|
14
|
-
var findTypeAheadDecorations = function findTypeAheadDecorations(state) {
|
|
15
|
-
var selection = state.selection;
|
|
16
|
-
var _typeAheadPluginKey$g = _key.pluginKey.getState(state),
|
|
17
|
-
decorationSet = _typeAheadPluginKey$g.decorationSet;
|
|
18
|
-
if (!decorationSet || decorationSet === _prosemirrorView.DecorationSet.empty || !(selection instanceof _prosemirrorState.TextSelection) || !selection.$cursor) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
var pos = selection.$cursor.pos;
|
|
22
|
-
var decoration = decorationSet.find(pos, pos, function (spec) {
|
|
23
|
-
return spec === null || spec === void 0 ? void 0 : spec.isTypeAheadDecoration;
|
|
24
|
-
});
|
|
25
|
-
if (!decoration || decoration.length !== 1) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return decoration[0];
|
|
29
|
-
};
|
|
30
|
-
exports.findTypeAheadDecorations = findTypeAheadDecorations;
|
|
31
12
|
var isTypeAheadHandler = function isTypeAheadHandler(handler) {
|
|
32
13
|
return handler && Object.values(_typeAhead.TypeAheadAvailableNodes).includes(handler.id) && typeof handler.trigger === 'string' && typeof handler.selectItem === 'function' && typeof handler.getItems === 'function';
|
|
33
14
|
};
|
|
@@ -35,8 +16,8 @@ var isTypeAheadHandler = function isTypeAheadHandler(handler) {
|
|
|
35
16
|
/** Is a typeahead plugin open? */
|
|
36
17
|
exports.isTypeAheadHandler = isTypeAheadHandler;
|
|
37
18
|
var isTypeAheadOpen = function isTypeAheadOpen(editorState) {
|
|
38
|
-
var _typeAheadPluginKey$
|
|
39
|
-
return (_key.pluginKey === null || _key.pluginKey === void 0 ? void 0 : (_typeAheadPluginKey$
|
|
19
|
+
var _typeAheadPluginKey$g, _typeAheadPluginKey$g2;
|
|
20
|
+
return (_key.pluginKey === null || _key.pluginKey === void 0 ? void 0 : (_typeAheadPluginKey$g = _key.pluginKey.getState(editorState)) === null || _typeAheadPluginKey$g === void 0 ? void 0 : (_typeAheadPluginKey$g2 = _typeAheadPluginKey$g.decorationSet) === null || _typeAheadPluginKey$g2 === void 0 ? void 0 : _typeAheadPluginKey$g2.find().length) > 0;
|
|
40
21
|
};
|
|
41
22
|
exports.isTypeAheadOpen = isTypeAheadOpen;
|
|
42
23
|
var getPluginState = function getPluginState(editorState) {
|
|
@@ -84,7 +65,8 @@ var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
|
|
|
84
65
|
exports.findHandlerByTrigger = findHandlerByTrigger;
|
|
85
66
|
var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
86
67
|
var editorView = _ref2.editorView,
|
|
87
|
-
direction = _ref2.direction
|
|
68
|
+
direction = _ref2.direction,
|
|
69
|
+
useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
|
|
88
70
|
return function () {
|
|
89
71
|
var typeAheadState = getPluginState(editorView.state);
|
|
90
72
|
if (!typeAheadState) {
|
|
@@ -96,7 +78,26 @@ var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
|
96
78
|
var nextIndex;
|
|
97
79
|
if (direction === 'next') {
|
|
98
80
|
stats.increaseArrowDown();
|
|
99
|
-
|
|
81
|
+
if (useBetterTypeaheadNavigation) {
|
|
82
|
+
/**
|
|
83
|
+
* See: https://product-fabric.atlassian.net/browse/ED-17200
|
|
84
|
+
* `selectedIndex` is forced to -1 now to not immediately focus the typeahead
|
|
85
|
+
* and only do so when there is explicit logic to focus into the typeahead
|
|
86
|
+
* options.
|
|
87
|
+
*
|
|
88
|
+
* This check for "set index to 1 when -1"
|
|
89
|
+
* - is a temporary workaround to get back the previous behaviour without
|
|
90
|
+
* entirely reverting the a11y improvements
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
if (selectedIndex === -1 && items.length > 1) {
|
|
94
|
+
nextIndex = 1;
|
|
95
|
+
} else {
|
|
96
|
+
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
100
|
+
}
|
|
100
101
|
} else {
|
|
101
102
|
stats.increaseArrowUp();
|
|
102
103
|
nextIndex = selectedIndex <= 0 ? items.length - 1 : selectedIndex - 1;
|
package/dist/cjs/test-utils.js
CHANGED
|
@@ -28,12 +28,6 @@ Object.defineProperty(exports, "PortalProviderAPI", {
|
|
|
28
28
|
return _PortalProvider.PortalProviderAPI;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
Object.defineProperty(exports, "Preset", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function get() {
|
|
34
|
-
return _preset.Preset;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
31
|
exports.createPMSchemaAndPlugins = void 0;
|
|
38
32
|
Object.defineProperty(exports, "createTypeAheadTools", {
|
|
39
33
|
enumerable: true,
|
|
@@ -48,11 +42,11 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
48
42
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
49
43
|
var _prosemirrorState = require("prosemirror-state");
|
|
50
44
|
var _sortByOrder = require("./create-editor/sort-by-order");
|
|
51
|
-
var _preset = require("./labs/next/presets/preset");
|
|
52
45
|
var _createSchema = require("./create-editor/create-schema");
|
|
53
46
|
var _base = _interopRequireDefault(require("./plugins/base"));
|
|
54
47
|
var _pluginKey = require("./plugins/analytics/plugin-key");
|
|
55
48
|
var _api = require("./plugins/type-ahead/api");
|
|
49
|
+
var _preset = require("@atlaskit/editor-common/preset");
|
|
56
50
|
var _PortalProvider = require("./ui/PortalProvider");
|
|
57
51
|
var _eventDispatcher = require("./event-dispatcher");
|
|
58
52
|
var _selection = require("./plugins/selection/gap-cursor/selection");
|
|
@@ -106,13 +100,11 @@ function lightProcessPluginsList(editorPlugins) {
|
|
|
106
100
|
});
|
|
107
101
|
}
|
|
108
102
|
var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
|
|
109
|
-
var
|
|
103
|
+
var inputPreset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _preset.EditorPresetBuilder();
|
|
110
104
|
return function (pluginFactoryParams) {
|
|
111
105
|
var editorPlugins = [];
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
editorPlugins = preset.getEditorPlugins();
|
|
106
|
+
var preset = inputPreset.has(_base.default) ? inputPreset : inputPreset.add(_base.default);
|
|
107
|
+
editorPlugins = preset.build();
|
|
116
108
|
var editorConfig = lightProcessPluginsList(editorPlugins);
|
|
117
109
|
var schema = (0, _createSchema.createSchema)(editorConfig);
|
|
118
110
|
var plugins = editorConfig.plugins.sort((0, _sortByOrder.sortByOrder)('plugins')).map(function (_ref) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.mainToolbarCustomComponentsSlotStyle = exports.TableControlsPadding = exports.MainToolbar = void 0;
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
11
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -15,7 +16,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
15
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
17
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
17
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
20
|
var TableControlsPadding = 20;
|
|
20
21
|
exports.TableControlsPadding = TableControlsPadding;
|
|
21
22
|
var mainToolbarWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n padding: ", "px ", "px 0;\n display: flex;\n height: auto;\n background-color: ", ";\n box-shadow: none;\n padding-left: ", "px;\n\n & > div {\n > :first-child:not(style),\n > style:first-child + * {\n margin-left: 0;\n }\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), (0, _constants.gridSize)(), (0, _constants.gridSize)(), "var(--ds-surface, white)", TableControlsPadding);
|
|
@@ -25,10 +26,18 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
25
26
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
27
|
top = _useState2[0],
|
|
27
28
|
setTop = _useState2[1];
|
|
29
|
+
|
|
30
|
+
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
31
|
+
// else if offsetTop is a number set top to offsetTop
|
|
32
|
+
// otherwise top is 0 as initial state
|
|
28
33
|
(0, _react.useEffect)(function () {
|
|
29
34
|
var _props$externalToolba, _props$externalToolba2;
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
|
|
36
|
+
setTop(props.externalToolbarRef.current.clientHeight);
|
|
37
|
+
} else {
|
|
38
|
+
setTop(props.offsetTop || 0);
|
|
39
|
+
}
|
|
40
|
+
}, [props.externalToolbarRef, props.offsetTop]);
|
|
32
41
|
return (0, _react2.jsx)("div", {
|
|
33
42
|
css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n top: ", "px;\n "])), top)],
|
|
34
43
|
"data-testid": "ak-editor-main-toolbar",
|
|
@@ -41,13 +50,39 @@ var FixedToolbar = function FixedToolbar(props) {
|
|
|
41
50
|
"data-testid": "ak-editor-main-toolbar"
|
|
42
51
|
}, props.children);
|
|
43
52
|
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* ED-15802: Scenarios when a sticky bar is used:
|
|
56
|
+
* 1. useStickyToolbar is true
|
|
57
|
+
* 2. useStickyToolbar is a DOM element
|
|
58
|
+
* 3. useStickyToolbar is an object and has offsetTop key;
|
|
59
|
+
*/
|
|
60
|
+
var getStickyParameters = function getStickyParameters(configuration) {
|
|
61
|
+
// const isUsingStickyOffset, isHTMLElement is used so TS can properly infer types.
|
|
62
|
+
var isHTMLElement = (0, _typeof2.default)(configuration) === 'object' && !('offsetTop' in configuration);
|
|
63
|
+
var isUsingStickyOffset = (0, _typeof2.default)(configuration) === 'object' && 'offsetTop' in configuration;
|
|
64
|
+
if ((0, _typeof2.default)(configuration) !== 'object') {
|
|
65
|
+
return {
|
|
66
|
+
externalToolbarRef: undefined,
|
|
67
|
+
offsetTop: undefined
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (isUsingStickyOffset) {
|
|
71
|
+
return {
|
|
72
|
+
offsetTop: configuration.offsetTop
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (isHTMLElement) {
|
|
76
|
+
return {
|
|
77
|
+
externalToolbarRef: configuration
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
};
|
|
44
81
|
var MainToolbar = function MainToolbar(_ref) {
|
|
45
82
|
var useStickyToolbar = _ref.useStickyToolbar,
|
|
46
83
|
children = _ref.children;
|
|
47
|
-
if (
|
|
48
|
-
return (0, _react2.jsx)(StickyToolbar,
|
|
49
|
-
externalToolbarRef: typeof useStickyToolbar === 'boolean' ? undefined : useStickyToolbar
|
|
50
|
-
}, children);
|
|
84
|
+
if (useStickyToolbar) {
|
|
85
|
+
return (0, _react2.jsx)(StickyToolbar, getStickyParameters(useStickyToolbar), children);
|
|
51
86
|
}
|
|
52
87
|
return (0, _react2.jsx)(FixedToolbar, null, children);
|
|
53
88
|
};
|
|
@@ -3,7 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "ColorPalette", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _uiColor.ColorPalette;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "backgroundPaletteTooltipMessages", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _uiColor.backgroundPaletteTooltipMessages;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
6
18
|
exports.default = void 0;
|
|
19
|
+
Object.defineProperty(exports, "textPaletteTooltipMessages", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _uiColor.textPaletteTooltipMessages;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
7
25
|
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
8
26
|
var _default = _uiColor.ColorPalette;
|
|
9
27
|
exports.default = _default;
|
|
@@ -143,13 +143,17 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
143
143
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
144
144
|
isPopupPositioned: isPopupPositioned
|
|
145
145
|
}, (0, _react2.jsx)(ColorPaletteWithListeners, {
|
|
146
|
-
palette: props.colorPalette,
|
|
147
146
|
cols: props.cols,
|
|
148
147
|
selectedColor: selectedColor,
|
|
149
148
|
onClick: onColorSelected,
|
|
150
149
|
handleClickOutside: togglePopup,
|
|
151
150
|
handleEscapeKeydown: handleEsc,
|
|
152
|
-
|
|
151
|
+
paletteOptions: {
|
|
152
|
+
palette: props.colorPalette,
|
|
153
|
+
hexToPaletteColor: props.hexToPaletteColor,
|
|
154
|
+
showSomewhatSemanticTooltips: props.showSomewhatSemanticTooltips,
|
|
155
|
+
paletteColorTooltipMessages: props.paletteColorTooltipMessages
|
|
156
|
+
}
|
|
153
157
|
}))));
|
|
154
158
|
};
|
|
155
159
|
var title = props.title || '';
|