@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = useUniversalPreset;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
|
+
var _createPluginsList = require("../../../create-editor/create-plugins-list");
|
|
13
|
+
var _presetUtils = require("../../../create-editor/preset-utils");
|
|
14
|
+
function useUniversalPreset(_ref) {
|
|
15
|
+
var props = _ref.props;
|
|
16
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
17
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
18
|
+
var previousEditorProps = (0, _hooks.usePreviousState)(props);
|
|
19
|
+
var _useState = (0, _react.useState)(function () {
|
|
20
|
+
return (0, _createPluginsList.createPreset)(props, previousEditorProps);
|
|
21
|
+
}),
|
|
22
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
23
|
+
preset = _useState2[0],
|
|
24
|
+
setPreset = _useState2[1];
|
|
25
|
+
(0, _react.useLayoutEffect)(function () {
|
|
26
|
+
if (!previousEditorProps) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
var recreate = (0, _presetUtils.shouldRecreatePreset)(previousEditorProps, props);
|
|
30
|
+
if (!recreate) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
setPreset((0, _createPluginsList.createPreset)(props, previousEditorProps, createAnalyticsEvent));
|
|
34
|
+
}, [props, previousEditorProps, createAnalyticsEvent]);
|
|
35
|
+
return preset;
|
|
36
|
+
}
|
|
@@ -36,6 +36,12 @@ function createPlugin(options) {
|
|
|
36
36
|
},
|
|
37
37
|
apply: function apply(tr, pluginState, _, state) {
|
|
38
38
|
var _getFeatureFlags;
|
|
39
|
+
if (pluginState.createAnalyticsEvent !== options.createAnalyticsEvent) {
|
|
40
|
+
// When the plugin state is reconfigured, the init function isn't called again
|
|
41
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
42
|
+
createAnalyticsEvent: options.createAnalyticsEvent
|
|
43
|
+
});
|
|
44
|
+
}
|
|
39
45
|
if ((_getFeatureFlags = (0, _featureFlagsContext.getFeatureFlags)(state)) !== null && _getFeatureFlags !== void 0 && _getFeatureFlags.catchAllTracking) {
|
|
40
46
|
var analyticsEventWithChannel = (0, _analytics.getAnalyticsEventsFromTransaction)(tr);
|
|
41
47
|
if (analyticsEventWithChannel.length > 0) {
|
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.addDraftDecoration = void 0;
|
|
7
7
|
exports.annotationExists = annotationExists;
|
|
8
8
|
exports.containsAnyAnnotations = containsAnyAnnotations;
|
|
9
|
-
exports.getPluginState = exports.getDraftCommandAnalyticsPayload = exports.getAnnotationViewKey = exports.getAllAnnotations = exports.findAnnotationsInSelection =
|
|
9
|
+
exports.getPluginState = exports.getDraftCommandAnalyticsPayload = exports.getAnnotationViewKey = exports.getAllAnnotations = exports.findAnnotationsInSelection = void 0;
|
|
10
10
|
exports.getSelectionPositions = getSelectionPositions;
|
|
11
|
-
exports.getSelectionStartRect = void 0;
|
|
12
11
|
exports.hasAnnotationMark = hasAnnotationMark;
|
|
13
12
|
exports.hasInvalidNodes = void 0;
|
|
14
13
|
exports.hasInvalidWhitespaceNode = hasInvalidWhitespaceNode;
|
|
15
|
-
exports.
|
|
14
|
+
exports.isSelectionValid = exports.inlineCommentPluginKey = void 0;
|
|
16
15
|
exports.stripNonExistingAnnotations = stripNonExistingAnnotations;
|
|
17
16
|
exports.surroundingMarks = void 0;
|
|
18
17
|
var _prosemirrorState = require("prosemirror-state");
|
|
@@ -62,7 +61,6 @@ var filterAnnotationIds = function filterAnnotationIds(marks) {
|
|
|
62
61
|
* @param annotations annotation metadata
|
|
63
62
|
* @param $from location to look around (usually the selection)
|
|
64
63
|
*/
|
|
65
|
-
exports.filterAnnotationIds = filterAnnotationIds;
|
|
66
64
|
var reorderAnnotations = function reorderAnnotations(annotations, $from) {
|
|
67
65
|
var idSet = surroundingMarks($from).map(filterAnnotationIds);
|
|
68
66
|
annotations.sort(function (a, b) {
|
|
@@ -73,7 +71,6 @@ var reorderAnnotations = function reorderAnnotations(annotations, $from) {
|
|
|
73
71
|
});
|
|
74
72
|
});
|
|
75
73
|
};
|
|
76
|
-
exports.reorderAnnotations = reorderAnnotations;
|
|
77
74
|
var getAllAnnotations = function getAllAnnotations(doc) {
|
|
78
75
|
var allAnnotationIds = new Set();
|
|
79
76
|
doc.descendants(function (node) {
|
|
@@ -114,41 +111,10 @@ var validateAnnotationMark = function validateAnnotationMark(annotationMark) {
|
|
|
114
111
|
}
|
|
115
112
|
};
|
|
116
113
|
|
|
117
|
-
// helper function: return the first selection range for the window
|
|
118
|
-
var getSelectionRange = function getSelectionRange() {
|
|
119
|
-
var selection = window.getSelection();
|
|
120
|
-
|
|
121
|
-
// no selection made in browser
|
|
122
|
-
if (!selection || selection.isCollapsed) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
var selectionRange = selection.getRangeAt(0);
|
|
126
|
-
return selectionRange;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// helper function: find the bounds of first part within selected content
|
|
130
|
-
var getSelectionStartRect = function getSelectionStartRect() {
|
|
131
|
-
var range = getSelectionRange();
|
|
132
|
-
if (!range) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
var rects = range.getClientRects();
|
|
136
|
-
if (!rects.length) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
// Find first selection area that width is not 0
|
|
140
|
-
// Sometimes there is a chance that user is selecting an empty DOM node.
|
|
141
|
-
var firstRect = Array.from(rects).find(function (rect) {
|
|
142
|
-
return rect.width !== 0 && rect.height !== 0;
|
|
143
|
-
});
|
|
144
|
-
return firstRect || null;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
114
|
/*
|
|
148
115
|
* add decoration for the comment selection in draft state
|
|
149
116
|
* (when creating new comment)
|
|
150
117
|
*/
|
|
151
|
-
exports.getSelectionStartRect = getSelectionStartRect;
|
|
152
118
|
var addDraftDecoration = function addDraftDecoration(start, end) {
|
|
153
119
|
return _prosemirrorView.Decoration.inline(start, end, {
|
|
154
120
|
class: "".concat(_styles.AnnotationSharedClassNames.draft)
|
|
@@ -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.stateKey = exports.plugin = exports.
|
|
7
|
+
exports.stateKey = exports.plugin = exports.ReactNodeViewState = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -69,9 +69,4 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
exports.plugin = plugin;
|
|
73
|
-
var plugins = function plugins() {
|
|
74
|
-
return [plugin];
|
|
75
|
-
};
|
|
76
|
-
var _default = plugins;
|
|
77
|
-
exports.default = _default;
|
|
72
|
+
exports.plugin = plugin;
|
|
@@ -4,11 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.blockQuoteRule = blockQuoteRule;
|
|
8
|
-
exports.codeBlockRule = codeBlockRule;
|
|
9
7
|
exports.default = void 0;
|
|
10
|
-
exports.headingRule = headingRule;
|
|
11
|
-
exports.inputRulePlugin = inputRulePlugin;
|
|
12
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
9
|
var _inputRules = require("../../../utils/input-rules");
|
|
14
10
|
var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
@@ -32,12 +28,6 @@ function headingRule(nodeType, maxLevel) {
|
|
|
32
28
|
function blockQuoteRule(nodeType) {
|
|
33
29
|
return (0, _inputRules.createJoinNodesRule)(/^\s*>\s$/, nodeType);
|
|
34
30
|
}
|
|
35
|
-
function codeBlockRule(nodeType) {
|
|
36
|
-
return (0, _inputRules.createWrappingTextBlockRule)({
|
|
37
|
-
match: /^```$/,
|
|
38
|
-
nodeType: nodeType
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
31
|
|
|
42
32
|
/**
|
|
43
33
|
* Get heading rules
|
|
@@ -5,15 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
Object.defineProperty(exports, "pluginKey", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _pluginKey.pluginKey;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
8
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
15
9
|
var _main = _interopRequireDefault(require("./pm-plugins/main"));
|
|
16
|
-
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
17
10
|
var _keymap = require("./pm-plugins/keymap");
|
|
18
11
|
var captionPlugin = function captionPlugin() {
|
|
19
12
|
return {
|
|
@@ -82,7 +82,8 @@ var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
82
82
|
var _this$props2 = this.props,
|
|
83
83
|
node = _this$props2.node,
|
|
84
84
|
cardContext = _this$props2.cardContext,
|
|
85
|
-
platform = _this$props2.platform
|
|
85
|
+
platform = _this$props2.platform,
|
|
86
|
+
showServerActions = _this$props2.showServerActions;
|
|
86
87
|
var _node$attrs = node.attrs,
|
|
87
88
|
url = _node$attrs.url,
|
|
88
89
|
data = _node$attrs.data;
|
|
@@ -95,7 +96,8 @@ var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
95
96
|
onClick: this.onClick,
|
|
96
97
|
onResolve: this.onResolve,
|
|
97
98
|
showActions: platform === 'web',
|
|
98
|
-
platform: platform
|
|
99
|
+
platform: platform,
|
|
100
|
+
showServerActions: showServerActions
|
|
99
101
|
}), this.gapCursorSpan());
|
|
100
102
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
101
103
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -133,12 +135,15 @@ var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
133
135
|
}, {
|
|
134
136
|
key: "render",
|
|
135
137
|
value: function render() {
|
|
136
|
-
var
|
|
138
|
+
var _this$reactComponentP = this.reactComponentProps,
|
|
139
|
+
platform = _this$reactComponentP.platform,
|
|
140
|
+
showServerActions = _this$reactComponentP.showServerActions;
|
|
137
141
|
return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
|
|
138
142
|
node: this.node,
|
|
139
143
|
view: this.view,
|
|
140
144
|
getPos: this.getPos,
|
|
141
|
-
platform: platform
|
|
145
|
+
platform: platform,
|
|
146
|
+
showServerActions: showServerActions
|
|
142
147
|
});
|
|
143
148
|
}
|
|
144
149
|
}]);
|
|
@@ -73,6 +73,7 @@ var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
73
73
|
var _this$props2 = this.props,
|
|
74
74
|
node = _this$props2.node,
|
|
75
75
|
cardContext = _this$props2.cardContext,
|
|
76
|
+
showServerActions = _this$props2.showServerActions,
|
|
76
77
|
useAlternativePreloader = _this$props2.useAlternativePreloader;
|
|
77
78
|
var _node$attrs = node.attrs,
|
|
78
79
|
url = _node$attrs.url,
|
|
@@ -88,7 +89,8 @@ var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
88
89
|
container: this.scrollContainer,
|
|
89
90
|
onResolve: this.onResolve,
|
|
90
91
|
onError: this.onError,
|
|
91
|
-
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined
|
|
92
|
+
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
93
|
+
showServerActions: showServerActions
|
|
92
94
|
}));
|
|
93
95
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
94
96
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -108,11 +110,13 @@ function InlineCardNodeView(props) {
|
|
|
108
110
|
var useAlternativePreloader = props.useAlternativePreloader,
|
|
109
111
|
node = props.node,
|
|
110
112
|
view = props.view,
|
|
111
|
-
getPos = props.getPos
|
|
113
|
+
getPos = props.getPos,
|
|
114
|
+
showServerActions = props.showServerActions;
|
|
112
115
|
return /*#__PURE__*/_react.default.createElement(WrappedInlineCard, {
|
|
113
116
|
node: node,
|
|
114
117
|
view: view,
|
|
115
118
|
getPos: getPos,
|
|
119
|
+
showServerActions: showServerActions,
|
|
116
120
|
useAlternativePreloader: useAlternativePreloader
|
|
117
121
|
});
|
|
118
122
|
}
|
|
@@ -28,7 +28,8 @@ var createPlugin = function createPlugin(options) {
|
|
|
28
28
|
allowResizing = options.allowResizing,
|
|
29
29
|
useAlternativePreloader = options.useAlternativePreloader,
|
|
30
30
|
fullWidthMode = options.fullWidthMode,
|
|
31
|
-
createAnalyticsEvent = options.createAnalyticsEvent
|
|
31
|
+
createAnalyticsEvent = options.createAnalyticsEvent,
|
|
32
|
+
showServerActions = options.showServerActions;
|
|
32
33
|
return new _safePlugin.SafePlugin({
|
|
33
34
|
state: {
|
|
34
35
|
init: function init() {
|
|
@@ -109,14 +110,16 @@ var createPlugin = function createPlugin(options) {
|
|
|
109
110
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
110
111
|
Component: _inlineCard.InlineCardNodeView,
|
|
111
112
|
extraComponentProps: {
|
|
112
|
-
useAlternativePreloader: useAlternativePreloader
|
|
113
|
+
useAlternativePreloader: useAlternativePreloader,
|
|
114
|
+
showServerActions: showServerActions
|
|
113
115
|
}
|
|
114
116
|
}),
|
|
115
117
|
blockCard: function blockCard(node, view, getPos) {
|
|
116
118
|
var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
|
|
117
119
|
eventDispatcher = pmPluginFactoryParams.eventDispatcher;
|
|
118
120
|
var reactComponentProps = {
|
|
119
|
-
platform: platform
|
|
121
|
+
platform: platform,
|
|
122
|
+
showServerActions: showServerActions
|
|
120
123
|
};
|
|
121
124
|
var hasIntlContext = true;
|
|
122
125
|
return new _blockCard.BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
|
|
@@ -28,6 +28,10 @@ var resolveWithProvider = function resolveWithProvider(view, outstandingRequests
|
|
|
28
28
|
exports.resolveWithProvider = resolveWithProvider;
|
|
29
29
|
var updateCardType = function updateCardType(resolvedCard, options) {
|
|
30
30
|
if ((resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'blockCard' && !options.allowBlockCards || (resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'embedCard' && !options.allowEmbeds) {
|
|
31
|
+
// clean out the 'layout' attr from an embedCard type that should be transformed into the inlineCard type.
|
|
32
|
+
if (resolvedCard.type === 'embedCard') {
|
|
33
|
+
delete resolvedCard.attrs.layout;
|
|
34
|
+
}
|
|
31
35
|
resolvedCard.type = 'inlineCard';
|
|
32
36
|
}
|
|
33
37
|
};
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
6
|
+
exports.getPluginState = void 0;
|
|
9
7
|
var _pluginKey = require("../plugin-key");
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
8
|
var getPluginState = function getPluginState(state) {
|
|
13
9
|
return _pluginKey.pluginKey.getState(state);
|
|
14
10
|
};
|
|
15
|
-
exports.getPluginState = getPluginState;
|
|
16
|
-
var setPluginState = function setPluginState(stateProps) {
|
|
17
|
-
return function (state, dispatch) {
|
|
18
|
-
var pluginState = getPluginState(state);
|
|
19
|
-
dispatch(state.tr.setMeta(_pluginKey.pluginKey, _objectSpread(_objectSpread({}, pluginState), stateProps)));
|
|
20
|
-
return true;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
exports.setPluginState = setPluginState;
|
|
11
|
+
exports.getPluginState = getPluginState;
|
|
@@ -2,11 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "PubSubSpecialEventType", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _types.PubSubSpecialEventType;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _types = require("./types");
|
|
5
|
+
});
|
|
@@ -2,15 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PubSubSpecialEventType = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Same as PubSub client types (don't want a direct dep though)
|
|
9
|
-
*/
|
|
10
|
-
var PubSubSpecialEventType;
|
|
11
|
-
exports.PubSubSpecialEventType = PubSubSpecialEventType;
|
|
12
|
-
(function (PubSubSpecialEventType) {
|
|
13
|
-
PubSubSpecialEventType["ERROR"] = "ERROR";
|
|
14
|
-
PubSubSpecialEventType["CONNECTED"] = "CONNECTED";
|
|
15
|
-
PubSubSpecialEventType["RECONNECT"] = "RECONNECT";
|
|
16
|
-
})(PubSubSpecialEventType || (exports.PubSubSpecialEventType = PubSubSpecialEventType = {}));
|
|
5
|
+
});
|
|
@@ -4,9 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
exports.getPluginState = getPluginState;
|
|
9
|
-
exports.pluginKey = void 0;
|
|
7
|
+
exports.pluginKey = exports.default = void 0;
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
10
|
var _prosemirrorState = require("prosemirror-state");
|
|
@@ -14,9 +12,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
14
12
|
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; }
|
|
15
13
|
var pluginKey = new _prosemirrorState.PluginKey('contextPanelPluginKey');
|
|
16
14
|
exports.pluginKey = pluginKey;
|
|
17
|
-
function getPluginState(state) {
|
|
18
|
-
return pluginKey.getState(state);
|
|
19
|
-
}
|
|
20
15
|
function contextPanelPluginFactory(contextPanels, dispatch) {
|
|
21
16
|
return new _safePlugin.SafePlugin({
|
|
22
17
|
key: pluginKey,
|
|
@@ -3,16 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.createPlugin = createPlugin;
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
9
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
10
|
-
var _pluginKey = require("./plugin-key");
|
|
11
|
-
function createPlugin() {
|
|
12
|
-
return new _prosemirrorState.Plugin({
|
|
13
|
-
key: _pluginKey.pluginKey
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
8
|
var dataConsumerMarkPlugin = function dataConsumerMarkPlugin() {
|
|
17
9
|
return {
|
|
18
10
|
name: 'dataConsumerPlugin',
|
|
@@ -9,7 +9,6 @@ exports.findDateSegmentByPosition = findDateSegmentByPosition;
|
|
|
9
9
|
exports.getLocaleDatePlaceholder = getLocaleDatePlaceholder;
|
|
10
10
|
exports.isDatePossiblyValid = isDatePossiblyValid;
|
|
11
11
|
exports.isToday = isToday;
|
|
12
|
-
exports.padToTwo = padToTwo;
|
|
13
12
|
var _formatParse = require("./formatParse");
|
|
14
13
|
var _addDays = _interopRequireDefault(require("date-fns/addDays"));
|
|
15
14
|
var _addMonths = _interopRequireDefault(require("date-fns/addMonths"));
|
|
@@ -17,9 +16,6 @@ var _addYears = _interopRequireDefault(require("date-fns/addYears"));
|
|
|
17
16
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
18
17
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
18
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
20
|
-
function padToTwo(number) {
|
|
21
|
-
return number <= 99 ? "0".concat(number).slice(-2) : "".concat(number);
|
|
22
|
-
}
|
|
23
19
|
function isDigit(c) {
|
|
24
20
|
if (c === undefined) {
|
|
25
21
|
return false;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.removeExtension = exports.removeDescendantNodes = exports.forceAutoSave = exports.clearEditingContext = void 0;
|
|
8
8
|
exports.setEditingContextToContextPanel = setEditingContextToContextPanel;
|
|
9
|
-
exports.updateExtensionLayout =
|
|
9
|
+
exports.updateExtensionLayout = void 0;
|
|
10
10
|
exports.updateState = updateState;
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
@@ -51,13 +51,6 @@ var forceAutoSave = function forceAutoSave(resolve, reject) {
|
|
|
51
51
|
}, _transforms.applyChange);
|
|
52
52
|
};
|
|
53
53
|
exports.forceAutoSave = forceAutoSave;
|
|
54
|
-
var showContextPanel = (0, _pluginFactory.createCommand)({
|
|
55
|
-
type: 'UPDATE_STATE',
|
|
56
|
-
data: {
|
|
57
|
-
showContextPanel: true
|
|
58
|
-
}
|
|
59
|
-
}, _transforms.applyChange);
|
|
60
|
-
exports.showContextPanel = showContextPanel;
|
|
61
54
|
var updateExtensionLayout = function updateExtensionLayout(layout) {
|
|
62
55
|
return (0, _pluginFactory.createCommand)({
|
|
63
56
|
type: 'UPDATE_STATE',
|
|
@@ -19,6 +19,8 @@ var _width = require("../../../../width");
|
|
|
19
19
|
var _WithPluginState = _interopRequireDefault(require("../../../../../ui/WithPluginState"));
|
|
20
20
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
21
21
|
var _excluded = ["type"];
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
22
24
|
function ExtensionWithPluginState(props) {
|
|
23
25
|
var node = props.node,
|
|
24
26
|
handleContentDOMRef = props.handleContentDOMRef,
|
|
@@ -51,7 +53,10 @@ function ExtensionWithPluginState(props) {
|
|
|
51
53
|
'with-children': hasChildren,
|
|
52
54
|
'without-frame': removeBorder
|
|
53
55
|
});
|
|
54
|
-
var customContainerStyles = {
|
|
56
|
+
var customContainerStyles = {
|
|
57
|
+
width: '100%'
|
|
58
|
+
};
|
|
59
|
+
var newContentStyles = {};
|
|
55
60
|
if (shouldBreakout) {
|
|
56
61
|
var _calculateBreakoutSty = (0, _utils.calculateBreakoutStyles)({
|
|
57
62
|
mode: node.attrs.layout,
|
|
@@ -60,8 +65,10 @@ function ExtensionWithPluginState(props) {
|
|
|
60
65
|
}),
|
|
61
66
|
type = _calculateBreakoutSty.type,
|
|
62
67
|
breakoutStyles = (0, _objectWithoutProperties2.default)(_calculateBreakoutSty, _excluded);
|
|
68
|
+
newContentStyles = _objectSpread({}, breakoutStyles);
|
|
63
69
|
customContainerStyles = breakoutStyles;
|
|
64
70
|
}
|
|
71
|
+
newContentStyles = _objectSpread(_objectSpread({}, newContentStyles), _styles.contentWrapper);
|
|
65
72
|
return (0, _react2.jsx)("div", {
|
|
66
73
|
ref: handleRef,
|
|
67
74
|
"data-layout": node.attrs.layout,
|
|
@@ -80,7 +87,7 @@ function ExtensionWithPluginState(props) {
|
|
|
80
87
|
}, !removeBorder && (0, _react2.jsx)(_Lozenge.default, {
|
|
81
88
|
node: node
|
|
82
89
|
}), children), hasBody && (0, _react2.jsx)("div", {
|
|
83
|
-
css:
|
|
90
|
+
css: newContentStyles
|
|
84
91
|
}, (0, _react2.jsx)("div", {
|
|
85
92
|
css: _styles.content,
|
|
86
93
|
ref: handleContentDOMRef,
|
|
@@ -21,7 +21,7 @@ exports.wrapperStyle = wrapperStyle;
|
|
|
21
21
|
var header = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px 0px;\n vertical-align: middle;\n\n &.with-children:not(.without-frame) {\n padding: 4px 8px 8px;\n }\n &.without-frame {\n padding: 0;\n }\n"])), _styles.padding / 2, _styles.padding / 2);
|
|
22
22
|
exports.header = header;
|
|
23
23
|
var content = function content(theme) {
|
|
24
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n"])), _styles.padding, (0, _components.themed)({
|
|
24
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n width: 100%;\n"])), _styles.padding, (0, _components.themed)({
|
|
25
25
|
light: "var(--ds-surface, white)",
|
|
26
26
|
dark: "var(--ds-surface, ".concat(_colors.DN30, ")")
|
|
27
27
|
})(theme), (0, _components.themed)({
|
|
@@ -29,5 +29,5 @@ var content = function content(theme) {
|
|
|
29
29
|
})(theme), "var(--ds-border, ".concat(_colors.N30, ")"), (0, _constants.borderRadius)());
|
|
30
30
|
};
|
|
31
31
|
exports.content = content;
|
|
32
|
-
var contentWrapper = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 ", "px ", "px;\n"])), _styles.padding, _styles.padding);
|
|
32
|
+
var contentWrapper = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 ", "px ", "px;\n display: flex;\n justify-content: center;\n"])), _styles.padding, _styles.padding);
|
|
33
33
|
exports.contentWrapper = contentWrapper;
|
|
@@ -77,6 +77,7 @@ var ExtensionLozenge = /*#__PURE__*/function (_Component) {
|
|
|
77
77
|
var title = parameters && parameters.extensionTitle || parameters && parameters.macroMetadata && parameters.macroMetadata.title || extensionKey;
|
|
78
78
|
var isBlockExtension = name === 'extension';
|
|
79
79
|
return (0, _react.jsx)("div", {
|
|
80
|
+
"data-testid": "lozenge-fallback",
|
|
80
81
|
css: _styles.placeholderFallback
|
|
81
82
|
}, lozengeData && !isBlockExtension ? this.renderImage(_objectSpread({
|
|
82
83
|
height: ICON_SIZE,
|
|
@@ -4,13 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.openFeedbackDialog = exports.default = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
14
13
|
var _assets = require("../quick-insert/assets");
|
|
15
14
|
var _versionWrapper = require("../../version-wrapper");
|
|
16
15
|
var _analytics = require("../analytics");
|
|
@@ -18,8 +17,6 @@ var _loadJiraCollectorDialogScript = _interopRequireDefault(require("./loadJiraC
|
|
|
18
17
|
var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
19
18
|
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; }
|
|
20
19
|
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; }
|
|
21
|
-
var pluginKey = new _prosemirrorState.PluginKey('feedbackDialogPlugin');
|
|
22
|
-
exports.pluginKey = pluginKey;
|
|
23
20
|
var showJiraCollectorDialog;
|
|
24
21
|
var feedbackInfoHash;
|
|
25
22
|
var defaultFeedbackInfo;
|
|
@@ -37,7 +37,9 @@ var _default = function _default(_ref) {
|
|
|
37
37
|
_ref$hideTooltipOnCli = _ref.hideTooltipOnClick,
|
|
38
38
|
hideTooltipOnClick = _ref$hideTooltipOnCli === void 0 ? true : _ref$hideTooltipOnCli,
|
|
39
39
|
ariaHasPopup = _ref.ariaHasPopup,
|
|
40
|
-
tabIndex = _ref.tabIndex
|
|
40
|
+
tabIndex = _ref.tabIndex,
|
|
41
|
+
areaControls = _ref.areaControls,
|
|
42
|
+
ariaLabel = _ref.ariaLabel;
|
|
41
43
|
// Check if there's only an icon and add additional styles
|
|
42
44
|
var iconOnly = (icon || iconAfter) && !children;
|
|
43
45
|
var customSpacing = iconOnly ? _styles.iconOnlySpacing : {};
|
|
@@ -62,8 +64,10 @@ var _default = function _default(_ref) {
|
|
|
62
64
|
}))
|
|
63
65
|
}, rest);
|
|
64
66
|
},
|
|
65
|
-
"aria-label": title,
|
|
66
|
-
"aria-pressed": selected,
|
|
67
|
+
"aria-label": ariaLabel || title,
|
|
68
|
+
"aria-pressed": !ariaHasPopup ? selected : undefined,
|
|
69
|
+
"aria-expanded": ariaHasPopup ? selected : undefined,
|
|
70
|
+
"aria-controls": ariaHasPopup ? areaControls : undefined,
|
|
67
71
|
spacing: 'compact',
|
|
68
72
|
href: href,
|
|
69
73
|
target: target,
|
|
@@ -89,9 +89,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
89
89
|
});
|
|
90
90
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideOnEsc", function () {
|
|
91
91
|
var _document$querySelect;
|
|
92
|
-
|
|
93
|
-
//Focus
|
|
92
|
+
// Focus the trigger button only on Escape
|
|
93
|
+
// Focus is done before hiding to ensure onBlur is called
|
|
94
94
|
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
|
|
95
|
+
_this.hide();
|
|
95
96
|
});
|
|
96
97
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChanged", function (openChangedEvent) {
|
|
97
98
|
if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
|
|
@@ -118,7 +119,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
118
119
|
tooltip = _this$props2.tooltip,
|
|
119
120
|
buttonTestId = _this$props2.buttonTestId,
|
|
120
121
|
dropdownWidth = _this$props2.dropdownWidth,
|
|
121
|
-
editorView = _this$props2.editorView
|
|
122
|
+
editorView = _this$props2.editorView,
|
|
123
|
+
dropdownListId = _this$props2.dropdownListId;
|
|
122
124
|
var trigger;
|
|
123
125
|
if (icon) {
|
|
124
126
|
var TriggerIcon = hideExpandIcon ? icon : (0, _react2.jsx)(CompositeIcon, {
|
|
@@ -146,7 +148,9 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
146
148
|
onKeyDown: this.toggleOpenByKeyboard,
|
|
147
149
|
selected: isOpen,
|
|
148
150
|
disabled: disabled,
|
|
149
|
-
tooltipContent: tooltip
|
|
151
|
+
tooltipContent: tooltip,
|
|
152
|
+
ariaHasPopup: true,
|
|
153
|
+
areaControls: dropdownListId
|
|
150
154
|
}, title);
|
|
151
155
|
}
|
|
152
156
|
|
|
@@ -169,7 +173,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
169
173
|
fitWidth: fitWidth + fitTolerance,
|
|
170
174
|
fitHeight: fitHeight + fitTolerance,
|
|
171
175
|
trigger: trigger,
|
|
172
|
-
editorView: editorView
|
|
176
|
+
editorView: editorView,
|
|
177
|
+
dropdownListId: dropdownListId
|
|
173
178
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
|
|
174
179
|
hide: this.hide,
|
|
175
180
|
dispatchCommand: dispatchCommand
|
|
@@ -16,14 +16,9 @@ var _emoji = require("@atlaskit/emoji");
|
|
|
16
16
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
17
|
var _EditorEmojiAddIcon = _interopRequireDefault(require("./EditorEmojiAddIcon"));
|
|
18
18
|
var _withOuterListeners = _interopRequireDefault(require("../../../ui/with-outer-listeners"));
|
|
19
|
-
var _templateObject
|
|
19
|
+
var _templateObject;
|
|
20
20
|
// helps adjusts position of popup
|
|
21
21
|
var emojiPickerButtonWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
22
|
-
|
|
23
|
-
// helps to vertically align emoji picker
|
|
24
|
-
// both top and bottom margin should be 2px
|
|
25
|
-
// https://product-fabric.atlassian.net/browse/CETI-148
|
|
26
|
-
var emojiPickerWrapper = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: -12px;\n margin-top: -4px;\n"])));
|
|
27
22
|
var EmojiPickerWithListener = (0, _withOuterListeners.default)(_emoji.EmojiPicker);
|
|
28
23
|
var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
29
24
|
var buttonRef = _react2.default.useRef(null);
|
|
@@ -83,13 +78,11 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
83
78
|
// we need an index of > 500 to display over it
|
|
84
79
|
,
|
|
85
80
|
zIndex: props.setDisableParentScroll ? 600 : undefined
|
|
86
|
-
}, (0, _react.jsx)("div", {
|
|
87
|
-
css: emojiPickerWrapper
|
|
88
81
|
}, (0, _react.jsx)(_providerFactory.WithProviders, {
|
|
89
82
|
providers: ['emojiProvider'],
|
|
90
83
|
providerFactory: props.providerFactory,
|
|
91
84
|
renderNode: renderPicker
|
|
92
|
-
}))
|
|
85
|
+
}));
|
|
93
86
|
};
|
|
94
87
|
var title = props.title || '';
|
|
95
88
|
return (0, _react.jsx)("div", {
|
|
@@ -94,6 +94,7 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
94
94
|
};
|
|
95
95
|
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
96
96
|
title: item.label,
|
|
97
|
+
ariaLabel: item.tooltip,
|
|
97
98
|
icon: ButtonIcon ? /*#__PURE__*/_react.default.createElement(ButtonIcon, {
|
|
98
99
|
label: item.label || ''
|
|
99
100
|
}) : undefined,
|