@atlaskit/editor-core 180.1.0 → 181.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -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 +30 -3
- 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/pm-plugins/decorations.js +2 -35
- package/dist/cjs/plugins/type-ahead/utils.js +3 -22
- 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 +25 -3
- 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/pm-plugins/decorations.js +0 -35
- package/dist/es2019/plugins/type-ahead/utils.js +0 -23
- 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 +29 -3
- 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/pm-plugins/decorations.js +0 -31
- package/dist/esm/plugins/type-ahead/utils.js +2 -20
- 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/pm-plugins/decorations.d.ts +0 -10
- package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
- 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,25 @@
|
|
|
1
|
+
import { useLayoutEffect, useState } from 'react';
|
|
2
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
|
+
import { usePreviousState } from '@atlaskit/editor-common/hooks';
|
|
4
|
+
import { createPreset } from '../../../create-editor/create-plugins-list';
|
|
5
|
+
import { shouldRecreatePreset } from '../../../create-editor/preset-utils';
|
|
6
|
+
export default function useUniversalPreset({
|
|
7
|
+
props
|
|
8
|
+
}) {
|
|
9
|
+
const {
|
|
10
|
+
createAnalyticsEvent
|
|
11
|
+
} = useAnalyticsEvents();
|
|
12
|
+
const previousEditorProps = usePreviousState(props);
|
|
13
|
+
const [preset, setPreset] = useState(() => createPreset(props, previousEditorProps));
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
if (!previousEditorProps) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const recreate = shouldRecreatePreset(previousEditorProps, props);
|
|
19
|
+
if (!recreate) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
setPreset(createPreset(props, previousEditorProps, createAnalyticsEvent));
|
|
23
|
+
}, [props, previousEditorProps, createAnalyticsEvent]);
|
|
24
|
+
return preset;
|
|
25
|
+
}
|
|
@@ -22,6 +22,13 @@ function createPlugin(options) {
|
|
|
22
22
|
},
|
|
23
23
|
apply: (tr, pluginState, _, state) => {
|
|
24
24
|
var _getFeatureFlags;
|
|
25
|
+
if (pluginState.createAnalyticsEvent !== options.createAnalyticsEvent) {
|
|
26
|
+
// When the plugin state is reconfigured, the init function isn't called again
|
|
27
|
+
return {
|
|
28
|
+
...pluginState,
|
|
29
|
+
createAnalyticsEvent: options.createAnalyticsEvent
|
|
30
|
+
};
|
|
31
|
+
}
|
|
25
32
|
if ((_getFeatureFlags = getFeatureFlags(state)) !== null && _getFeatureFlags !== void 0 && _getFeatureFlags.catchAllTracking) {
|
|
26
33
|
const analyticsEventWithChannel = getAnalyticsEventsFromTransaction(tr);
|
|
27
34
|
if (analyticsEventWithChannel.length > 0) {
|
|
@@ -24,7 +24,7 @@ export const surroundingMarks = $pos => {
|
|
|
24
24
|
* Finds annotation marks, and returns their IDs.
|
|
25
25
|
* @param marks Array of marks to search in
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
const filterAnnotationIds = marks => {
|
|
28
28
|
if (!marks.length) {
|
|
29
29
|
return [];
|
|
30
30
|
}
|
|
@@ -44,7 +44,7 @@ export const filterAnnotationIds = marks => {
|
|
|
44
44
|
* @param annotations annotation metadata
|
|
45
45
|
* @param $from location to look around (usually the selection)
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
const reorderAnnotations = (annotations, $from) => {
|
|
48
48
|
const idSet = surroundingMarks($from).map(filterAnnotationIds);
|
|
49
49
|
annotations.sort((a, b) => sum(idSet, ids => ids.indexOf(a.id)) - sum(idSet, ids => ids.indexOf(b.id)));
|
|
50
50
|
};
|
|
@@ -84,34 +84,6 @@ const validateAnnotationMark = annotationMark => {
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
// helper function: return the first selection range for the window
|
|
88
|
-
const getSelectionRange = function () {
|
|
89
|
-
const selection = window.getSelection();
|
|
90
|
-
|
|
91
|
-
// no selection made in browser
|
|
92
|
-
if (!selection || selection.isCollapsed) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
const selectionRange = selection.getRangeAt(0);
|
|
96
|
-
return selectionRange;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// helper function: find the bounds of first part within selected content
|
|
100
|
-
export const getSelectionStartRect = () => {
|
|
101
|
-
const range = getSelectionRange();
|
|
102
|
-
if (!range) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
const rects = range.getClientRects();
|
|
106
|
-
if (!rects.length) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
// Find first selection area that width is not 0
|
|
110
|
-
// Sometimes there is a chance that user is selecting an empty DOM node.
|
|
111
|
-
const firstRect = Array.from(rects).find(rect => rect.width !== 0 && rect.height !== 0);
|
|
112
|
-
return firstRect || null;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
87
|
/*
|
|
116
88
|
* add decoration for the comment selection in draft state
|
|
117
89
|
* (when creating new comment)
|
|
@@ -10,22 +10,16 @@ function getHeadingLevel(match) {
|
|
|
10
10
|
level: match[1].length
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
function headingRule(nodeType, maxLevel) {
|
|
14
14
|
return createWrappingTextBlockRule({
|
|
15
15
|
match: new RegExp('^(#{1,' + maxLevel + '})\\s$'),
|
|
16
16
|
nodeType,
|
|
17
17
|
getAttrs: getHeadingLevel
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
function blockQuoteRule(nodeType) {
|
|
21
21
|
return createJoinNodesRule(/^\s*>\s$/, nodeType);
|
|
22
22
|
}
|
|
23
|
-
export function codeBlockRule(nodeType) {
|
|
24
|
-
return createWrappingTextBlockRule({
|
|
25
|
-
match: /^```$/,
|
|
26
|
-
nodeType
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
23
|
|
|
30
24
|
/**
|
|
31
25
|
* Get heading rules
|
|
@@ -130,7 +124,7 @@ function getCodeBlockRules(schema) {
|
|
|
130
124
|
});
|
|
131
125
|
return [ruleAnalytics(threeTildeRule), ruleAnalytics(leftNodeReplacementThreeTildeRule)];
|
|
132
126
|
}
|
|
133
|
-
|
|
127
|
+
function inputRulePlugin(schema, featureFlags) {
|
|
134
128
|
const rules = [];
|
|
135
129
|
if (schema.nodes.heading) {
|
|
136
130
|
rules.push(...getHeadingRules(schema));
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { caption } from '@atlaskit/adf-schema';
|
|
2
2
|
import { default as createCaptionPlugin } from './pm-plugins/main';
|
|
3
|
-
import { pluginKey } from './pm-plugins/plugin-key';
|
|
4
3
|
import { captionKeymap } from './pm-plugins/keymap';
|
|
5
|
-
export { pluginKey };
|
|
6
4
|
const captionPlugin = () => {
|
|
7
5
|
return {
|
|
8
6
|
name: 'caption',
|
|
@@ -59,7 +59,8 @@ export class BlockCardComponent extends React.PureComponent {
|
|
|
59
59
|
const {
|
|
60
60
|
node,
|
|
61
61
|
cardContext,
|
|
62
|
-
platform
|
|
62
|
+
platform,
|
|
63
|
+
showServerActions
|
|
63
64
|
} = this.props;
|
|
64
65
|
const {
|
|
65
66
|
url,
|
|
@@ -74,7 +75,8 @@ export class BlockCardComponent extends React.PureComponent {
|
|
|
74
75
|
onClick: this.onClick,
|
|
75
76
|
onResolve: this.onResolve,
|
|
76
77
|
showActions: platform === 'web',
|
|
77
|
-
platform: platform
|
|
78
|
+
platform: platform,
|
|
79
|
+
showServerActions: showServerActions
|
|
78
80
|
}), this.gapCursorSpan());
|
|
79
81
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
80
82
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -100,13 +102,15 @@ export class BlockCard extends ReactNodeView {
|
|
|
100
102
|
}
|
|
101
103
|
render() {
|
|
102
104
|
const {
|
|
103
|
-
platform
|
|
105
|
+
platform,
|
|
106
|
+
showServerActions
|
|
104
107
|
} = this.reactComponentProps;
|
|
105
108
|
return /*#__PURE__*/React.createElement(WrappedBlockCard, {
|
|
106
109
|
node: this.node,
|
|
107
110
|
view: this.view,
|
|
108
111
|
getPos: this.getPos,
|
|
109
|
-
platform: platform
|
|
112
|
+
platform: platform,
|
|
113
|
+
showServerActions: showServerActions
|
|
110
114
|
});
|
|
111
115
|
}
|
|
112
116
|
}
|
|
@@ -51,6 +51,7 @@ export class InlineCardComponent extends React.PureComponent {
|
|
|
51
51
|
const {
|
|
52
52
|
node,
|
|
53
53
|
cardContext,
|
|
54
|
+
showServerActions,
|
|
54
55
|
useAlternativePreloader
|
|
55
56
|
} = this.props;
|
|
56
57
|
const {
|
|
@@ -68,7 +69,8 @@ export class InlineCardComponent extends React.PureComponent {
|
|
|
68
69
|
container: this.scrollContainer,
|
|
69
70
|
onResolve: this.onResolve,
|
|
70
71
|
onError: this.onError,
|
|
71
|
-
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined
|
|
72
|
+
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
73
|
+
showServerActions: showServerActions
|
|
72
74
|
}));
|
|
73
75
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
74
76
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -86,12 +88,14 @@ export function InlineCardNodeView(props) {
|
|
|
86
88
|
useAlternativePreloader,
|
|
87
89
|
node,
|
|
88
90
|
view,
|
|
89
|
-
getPos
|
|
91
|
+
getPos,
|
|
92
|
+
showServerActions
|
|
90
93
|
} = props;
|
|
91
94
|
return /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
92
95
|
node: node,
|
|
93
96
|
view: view,
|
|
94
97
|
getPos: getPos,
|
|
98
|
+
showServerActions: showServerActions,
|
|
95
99
|
useAlternativePreloader: useAlternativePreloader
|
|
96
100
|
});
|
|
97
101
|
}
|
|
@@ -16,7 +16,8 @@ export const createPlugin = options => pmPluginFactoryParams => {
|
|
|
16
16
|
allowResizing,
|
|
17
17
|
useAlternativePreloader,
|
|
18
18
|
fullWidthMode,
|
|
19
|
-
createAnalyticsEvent
|
|
19
|
+
createAnalyticsEvent,
|
|
20
|
+
showServerActions
|
|
20
21
|
} = options;
|
|
21
22
|
return new SafePlugin({
|
|
22
23
|
state: {
|
|
@@ -92,7 +93,8 @@ export const createPlugin = options => pmPluginFactoryParams => {
|
|
|
92
93
|
pmPluginFactoryParams,
|
|
93
94
|
Component: InlineCardNodeView,
|
|
94
95
|
extraComponentProps: {
|
|
95
|
-
useAlternativePreloader
|
|
96
|
+
useAlternativePreloader,
|
|
97
|
+
showServerActions
|
|
96
98
|
}
|
|
97
99
|
}),
|
|
98
100
|
blockCard: (node, view, getPos) => {
|
|
@@ -101,7 +103,8 @@ export const createPlugin = options => pmPluginFactoryParams => {
|
|
|
101
103
|
eventDispatcher
|
|
102
104
|
} = pmPluginFactoryParams;
|
|
103
105
|
const reactComponentProps = {
|
|
104
|
-
platform
|
|
106
|
+
platform,
|
|
107
|
+
showServerActions
|
|
105
108
|
};
|
|
106
109
|
const hasIntlContext = true;
|
|
107
110
|
return new BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
|
|
@@ -21,6 +21,10 @@ export const resolveWithProvider = (view, outstandingRequests, provider, request
|
|
|
21
21
|
};
|
|
22
22
|
const updateCardType = (resolvedCard, options) => {
|
|
23
23
|
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) {
|
|
24
|
+
// clean out the 'layout' attr from an embedCard type that should be transformed into the inlineCard type.
|
|
25
|
+
if (resolvedCard.type === 'embedCard') {
|
|
26
|
+
delete resolvedCard.attrs.layout;
|
|
27
|
+
}
|
|
24
28
|
resolvedCard.type = 'inlineCard';
|
|
25
29
|
}
|
|
26
30
|
};
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { pluginKey } from '../plugin-key';
|
|
2
|
-
export const getPluginState = state => pluginKey.getState(state);
|
|
3
|
-
export const setPluginState = stateProps => (state, dispatch) => {
|
|
4
|
-
const pluginState = getPluginState(state);
|
|
5
|
-
dispatch(state.tr.setMeta(pluginKey, {
|
|
6
|
-
...pluginState,
|
|
7
|
-
...stateProps
|
|
8
|
-
}));
|
|
9
|
-
return true;
|
|
10
|
-
};
|
|
2
|
+
export const getPluginState = state => pluginKey.getState(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Same as PubSub client types (don't want a direct dep though)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export let PubSubSpecialEventType;
|
|
6
|
-
(function (PubSubSpecialEventType) {
|
|
7
|
-
PubSubSpecialEventType["ERROR"] = "ERROR";
|
|
8
|
-
PubSubSpecialEventType["CONNECTED"] = "CONNECTED";
|
|
9
|
-
PubSubSpecialEventType["RECONNECT"] = "RECONNECT";
|
|
10
|
-
})(PubSubSpecialEventType || (PubSubSpecialEventType = {}));
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
3
|
export const pluginKey = new PluginKey('contextPanelPluginKey');
|
|
4
|
-
export function getPluginState(state) {
|
|
5
|
-
return pluginKey.getState(state);
|
|
6
|
-
}
|
|
7
4
|
function contextPanelPluginFactory(contextPanels, dispatch) {
|
|
8
5
|
return new SafePlugin({
|
|
9
6
|
key: pluginKey,
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { dataConsumer } from '@atlaskit/adf-schema';
|
|
2
|
-
import { Plugin } from 'prosemirror-state';
|
|
3
|
-
import { pluginKey } from './plugin-key';
|
|
4
|
-
export function createPlugin() {
|
|
5
|
-
return new Plugin({
|
|
6
|
-
key: pluginKey
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
2
|
const dataConsumerMarkPlugin = () => ({
|
|
10
3
|
name: 'dataConsumerPlugin',
|
|
11
4
|
marks() {
|
|
@@ -2,9 +2,6 @@ import { formatDateType, dateTypeToDate, dateToDateType } from './formatParse';
|
|
|
2
2
|
import addDays from 'date-fns/addDays';
|
|
3
3
|
import addMonths from 'date-fns/addMonths';
|
|
4
4
|
import addYears from 'date-fns/addYears';
|
|
5
|
-
export function padToTwo(number) {
|
|
6
|
-
return number <= 99 ? `0${number}`.slice(-2) : `${number}`;
|
|
7
|
-
}
|
|
8
5
|
function isDigit(c) {
|
|
9
6
|
if (c === undefined) {
|
|
10
7
|
return false;
|
|
@@ -37,12 +37,6 @@ export const forceAutoSave = (resolve, reject) => createCommand({
|
|
|
37
37
|
autoSaveReject: reject
|
|
38
38
|
}
|
|
39
39
|
}, applyChange);
|
|
40
|
-
export const showContextPanel = createCommand({
|
|
41
|
-
type: 'UPDATE_STATE',
|
|
42
|
-
data: {
|
|
43
|
-
showContextPanel: true
|
|
44
|
-
}
|
|
45
|
-
}, applyChange);
|
|
46
40
|
export const updateExtensionLayout = layout => createCommand({
|
|
47
41
|
type: 'UPDATE_STATE',
|
|
48
42
|
data: {
|
|
@@ -44,7 +44,10 @@ function ExtensionWithPluginState(props) {
|
|
|
44
44
|
'with-children': hasChildren,
|
|
45
45
|
'without-frame': removeBorder
|
|
46
46
|
});
|
|
47
|
-
let customContainerStyles = {
|
|
47
|
+
let customContainerStyles = {
|
|
48
|
+
width: '100%'
|
|
49
|
+
};
|
|
50
|
+
let newContentStyles = {};
|
|
48
51
|
if (shouldBreakout) {
|
|
49
52
|
const {
|
|
50
53
|
type,
|
|
@@ -54,8 +57,15 @@ function ExtensionWithPluginState(props) {
|
|
|
54
57
|
widthStateWidth: widthState.width,
|
|
55
58
|
widthStateLineLength: widthState.lineLength
|
|
56
59
|
});
|
|
60
|
+
newContentStyles = {
|
|
61
|
+
...breakoutStyles
|
|
62
|
+
};
|
|
57
63
|
customContainerStyles = breakoutStyles;
|
|
58
64
|
}
|
|
65
|
+
newContentStyles = {
|
|
66
|
+
...newContentStyles,
|
|
67
|
+
...contentWrapper
|
|
68
|
+
};
|
|
59
69
|
return jsx("div", {
|
|
60
70
|
ref: handleRef,
|
|
61
71
|
"data-layout": node.attrs.layout,
|
|
@@ -74,7 +84,7 @@ function ExtensionWithPluginState(props) {
|
|
|
74
84
|
}, !removeBorder && jsx(ExtensionLozenge, {
|
|
75
85
|
node: node
|
|
76
86
|
}), children), hasBody && jsx("div", {
|
|
77
|
-
css:
|
|
87
|
+
css: newContentStyles
|
|
78
88
|
}, jsx("div", {
|
|
79
89
|
css: content,
|
|
80
90
|
ref: handleContentDOMRef,
|
|
@@ -40,7 +40,10 @@ export const content = theme => css`
|
|
|
40
40
|
border: 1px solid ${`var(--ds-border, ${N30})`};
|
|
41
41
|
border-radius: ${borderRadius()}px;
|
|
42
42
|
cursor: initial;
|
|
43
|
+
width: 100%;
|
|
43
44
|
`;
|
|
44
45
|
export const contentWrapper = css`
|
|
45
46
|
padding: 0 ${padding}px ${padding}px;
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
46
49
|
`;
|
|
@@ -54,6 +54,7 @@ export default class ExtensionLozenge extends Component {
|
|
|
54
54
|
const title = parameters && parameters.extensionTitle || parameters && parameters.macroMetadata && parameters.macroMetadata.title || extensionKey;
|
|
55
55
|
const isBlockExtension = name === 'extension';
|
|
56
56
|
return jsx("div", {
|
|
57
|
+
"data-testid": "lozenge-fallback",
|
|
57
58
|
css: placeholderFallback
|
|
58
59
|
}, lozengeData && !isBlockExtension ? this.renderImage({
|
|
59
60
|
height: ICON_SIZE,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PluginKey } from 'prosemirror-state';
|
|
3
2
|
import { IconFeedback } from '../quick-insert/assets';
|
|
4
3
|
import { version as coreVersion } from '../../version-wrapper';
|
|
5
4
|
import { addAnalytics, ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '../analytics';
|
|
6
5
|
import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
|
|
7
6
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
8
|
-
export const pluginKey = new PluginKey('feedbackDialogPlugin');
|
|
9
7
|
let showJiraCollectorDialog;
|
|
10
8
|
let feedbackInfoHash;
|
|
11
9
|
let defaultFeedbackInfo;
|
|
@@ -23,7 +23,9 @@ export default (({
|
|
|
23
23
|
testId,
|
|
24
24
|
hideTooltipOnClick = true,
|
|
25
25
|
ariaHasPopup,
|
|
26
|
-
tabIndex
|
|
26
|
+
tabIndex,
|
|
27
|
+
areaControls,
|
|
28
|
+
ariaLabel
|
|
27
29
|
}) => {
|
|
28
30
|
// Check if there's only an icon and add additional styles
|
|
29
31
|
const iconOnly = (icon || iconAfter) && !children;
|
|
@@ -55,8 +57,10 @@ export default (({
|
|
|
55
57
|
...rest
|
|
56
58
|
};
|
|
57
59
|
},
|
|
58
|
-
"aria-label": title,
|
|
59
|
-
"aria-pressed": selected,
|
|
60
|
+
"aria-label": ariaLabel || title,
|
|
61
|
+
"aria-pressed": !ariaHasPopup ? selected : undefined,
|
|
62
|
+
"aria-expanded": ariaHasPopup ? selected : undefined,
|
|
63
|
+
"aria-controls": ariaHasPopup ? areaControls : undefined,
|
|
60
64
|
spacing: 'compact',
|
|
61
65
|
href: href,
|
|
62
66
|
target: target,
|
|
@@ -66,9 +66,10 @@ export default class Dropdown extends Component {
|
|
|
66
66
|
});
|
|
67
67
|
_defineProperty(this, "hideOnEsc", () => {
|
|
68
68
|
var _document$querySelect;
|
|
69
|
-
|
|
70
|
-
//Focus
|
|
69
|
+
// Focus the trigger button only on Escape
|
|
70
|
+
// Focus is done before hiding to ensure onBlur is called
|
|
71
71
|
(_document$querySelect = document.querySelector(`[data-testid=${this.props.buttonTestId}]`)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
|
|
72
|
+
this.hide();
|
|
72
73
|
});
|
|
73
74
|
_defineProperty(this, "onOpenChanged", openChangedEvent => {
|
|
74
75
|
if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
|
|
@@ -94,7 +95,8 @@ export default class Dropdown extends Component {
|
|
|
94
95
|
tooltip,
|
|
95
96
|
buttonTestId,
|
|
96
97
|
dropdownWidth,
|
|
97
|
-
editorView
|
|
98
|
+
editorView,
|
|
99
|
+
dropdownListId
|
|
98
100
|
} = this.props;
|
|
99
101
|
let trigger;
|
|
100
102
|
if (icon) {
|
|
@@ -123,7 +125,9 @@ export default class Dropdown extends Component {
|
|
|
123
125
|
onKeyDown: this.toggleOpenByKeyboard,
|
|
124
126
|
selected: isOpen,
|
|
125
127
|
disabled: disabled,
|
|
126
|
-
tooltipContent: tooltip
|
|
128
|
+
tooltipContent: tooltip,
|
|
129
|
+
ariaHasPopup: true,
|
|
130
|
+
areaControls: dropdownListId
|
|
127
131
|
}, title);
|
|
128
132
|
}
|
|
129
133
|
|
|
@@ -146,7 +150,8 @@ export default class Dropdown extends Component {
|
|
|
146
150
|
fitWidth: fitWidth + fitTolerance,
|
|
147
151
|
fitHeight: fitHeight + fitTolerance,
|
|
148
152
|
trigger: trigger,
|
|
149
|
-
editorView: editorView
|
|
153
|
+
editorView: editorView,
|
|
154
|
+
dropdownListId: dropdownListId
|
|
150
155
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
|
|
151
156
|
hide: this.hide,
|
|
152
157
|
dispatchCommand
|
|
@@ -13,14 +13,6 @@ import withOuterListeners from '../../../ui/with-outer-listeners';
|
|
|
13
13
|
const emojiPickerButtonWrapper = css`
|
|
14
14
|
position: relative;
|
|
15
15
|
`;
|
|
16
|
-
|
|
17
|
-
// helps to vertically align emoji picker
|
|
18
|
-
// both top and bottom margin should be 2px
|
|
19
|
-
// https://product-fabric.atlassian.net/browse/CETI-148
|
|
20
|
-
const emojiPickerWrapper = css`
|
|
21
|
-
margin-bottom: -12px;
|
|
22
|
-
margin-top: -4px;
|
|
23
|
-
`;
|
|
24
16
|
const EmojiPickerWithListener = withOuterListeners(EmojiPicker);
|
|
25
17
|
export const EmojiPickerButton = props => {
|
|
26
18
|
const buttonRef = React.useRef(null);
|
|
@@ -75,13 +67,11 @@ export const EmojiPickerButton = props => {
|
|
|
75
67
|
// we need an index of > 500 to display over it
|
|
76
68
|
,
|
|
77
69
|
zIndex: props.setDisableParentScroll ? 600 : undefined
|
|
78
|
-
}, jsx("div", {
|
|
79
|
-
css: emojiPickerWrapper
|
|
80
70
|
}, jsx(WithProviders, {
|
|
81
71
|
providers: ['emojiProvider'],
|
|
82
72
|
providerFactory: props.providerFactory,
|
|
83
73
|
renderNode: renderPicker
|
|
84
|
-
}))
|
|
74
|
+
}));
|
|
85
75
|
};
|
|
86
76
|
const title = props.title || '';
|
|
87
77
|
return jsx("div", {
|
|
@@ -19,6 +19,7 @@ import Separator from './Separator';
|
|
|
19
19
|
import Input from './Input';
|
|
20
20
|
import { ExtensionsPlaceholder } from './ExtensionsPlaceholder';
|
|
21
21
|
import ColorPickerButton from '../../../ui/ColorPickerButton';
|
|
22
|
+
import { backgroundPaletteTooltipMessages } from '../../../ui/ColorPalette';
|
|
22
23
|
import { EmojiPickerButton } from './EmojiPickerButton';
|
|
23
24
|
import Announcer from '../../../utils/announcer/announcer';
|
|
24
25
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -45,6 +46,11 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
45
46
|
mountRef
|
|
46
47
|
}) => {
|
|
47
48
|
const emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
|
|
49
|
+
const {
|
|
50
|
+
useSomewhatSemanticTextColorNames
|
|
51
|
+
} = editorView ? getFeatureFlags(editorView.state) : {
|
|
52
|
+
useSomewhatSemanticTextColorNames: false
|
|
53
|
+
};
|
|
48
54
|
return jsx(ButtonGroup, null, items.filter(item => !item.hidden).map((item, idx) => {
|
|
49
55
|
switch (item.type) {
|
|
50
56
|
case 'button':
|
|
@@ -116,7 +122,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
116
122
|
showSelected: item.showSelected,
|
|
117
123
|
buttonTestId: item.testId,
|
|
118
124
|
editorView: editorView,
|
|
119
|
-
setDisableParentScroll: scrollable ? setDisableScroll : undefined
|
|
125
|
+
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
126
|
+
dropdownListId: (item === null || item === void 0 ? void 0 : item.id) && `${item.id}-dropdownList`
|
|
120
127
|
});
|
|
121
128
|
case 'select':
|
|
122
129
|
if (item.selectType === 'list') {
|
|
@@ -153,12 +160,22 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
153
160
|
// Currently in floating toolbar, color picker is only
|
|
154
161
|
// used in panel and table cell background color.
|
|
155
162
|
// Both uses same color palette.
|
|
156
|
-
// That's why hard-coding hexToEditorBackgroundPaletteColor
|
|
163
|
+
// That's why hard-coding hexToEditorBackgroundPaletteColor
|
|
164
|
+
// and paletteColorTooltipMessages.
|
|
157
165
|
// When we need to support different color palette
|
|
158
166
|
// in floating toolbar, we need to set hexToPaletteColor
|
|
159
|
-
// in item options.
|
|
167
|
+
// and paletteColorTooltipMessages in item options.
|
|
160
168
|
,
|
|
161
|
-
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
169
|
+
hexToPaletteColor: hexToEditorBackgroundPaletteColor,
|
|
170
|
+
paletteColorTooltipMessages: backgroundPaletteTooltipMessages
|
|
171
|
+
// We did not want to create new FF or update
|
|
172
|
+
// useSomewhatSemanticTextColorNames name
|
|
173
|
+
// because it is temporary and require extra work.
|
|
174
|
+
// So even though it says text color names,
|
|
175
|
+
// we are going to use for all color pickers
|
|
176
|
+
// such as text, background and table charts.
|
|
177
|
+
,
|
|
178
|
+
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames
|
|
162
179
|
});
|
|
163
180
|
}
|
|
164
181
|
if (item.selectType === 'emoji') {
|
|
@@ -49,14 +49,4 @@ export function findNode(parent, predicate) {
|
|
|
49
49
|
return true;
|
|
50
50
|
});
|
|
51
51
|
return matchedNode;
|
|
52
|
-
}
|
|
53
|
-
export function getFocusableElements(rootNode) {
|
|
54
|
-
if (!rootNode) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
const focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
|
|
58
|
-
return Array.from(focusableModalElements) || [];
|
|
59
|
-
}
|
|
60
|
-
export function getFirstFocusableElement(rootNode) {
|
|
61
|
-
return getFocusableElements(rootNode)[0];
|
|
62
52
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { fragment } from '@atlaskit/adf-schema';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import { pluginKey } from './plugin-key';
|
|
4
2
|
import { createPlugin as createFragmentMarkConsistencyPlugin } from './pm-plugins/fragment-consistency';
|
|
5
|
-
export function createPlugin() {
|
|
6
|
-
return new SafePlugin({
|
|
7
|
-
key: pluginKey
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
3
|
const fragmentMarkPlugin = () => ({
|
|
11
4
|
name: 'fragmentPlugin',
|
|
12
5
|
marks() {
|