@atlaskit/editor-core 151.3.0 → 152.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 +90 -0
- package/dist/cjs/create-editor/ReactEditorView.js +22 -8
- package/dist/cjs/create-editor/create-plugins-list.js +25 -9
- package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
- package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
- package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/annotation/utils.js +19 -8
- package/dist/cjs/plugins/avatar-group/index.js +2 -1
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
- package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
- package/dist/cjs/plugins/extension/extension-api.js +10 -2
- package/dist/cjs/plugins/extension/ui/styles.js +1 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
- package/dist/cjs/plugins/find-replace/index.js +14 -137
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/cjs/plugins/fragment/index.js +34 -0
- package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/cjs/plugins/index.js +16 -0
- package/dist/cjs/plugins/list/actions/conversions.js +39 -71
- package/dist/cjs/plugins/list/transforms.js +7 -1
- package/dist/cjs/plugins/media/index.js +2 -3
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
- package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
- package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
- package/dist/cjs/plugins/media/toolbar/index.js +90 -3
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/cjs/plugins/media/utils/media-common.js +1 -1
- package/dist/cjs/plugins/media/utils/media-files.js +5 -1
- package/dist/cjs/plugins/panel/actions.js +2 -2
- package/dist/cjs/plugins/panel/index.js +3 -3
- package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/cjs/plugins/panel/toolbar.js +10 -5
- package/dist/cjs/plugins/panel/utils.js +15 -0
- package/dist/cjs/plugins/rank.js +3 -2
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
- package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
- package/dist/cjs/plugins/table/commands/insert.js +1 -0
- package/dist/cjs/plugins/table/index.js +3 -2
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
- package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +1 -1
- package/dist/cjs/plugins/table/ui/messages.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/cjs/plugins/text-formatting/index.js +2 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
- package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
- package/dist/cjs/ui/ColorPalette/index.js +7 -4
- package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
- package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
- package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
- package/dist/cjs/ui/DropdownMenu/index.js +3 -1
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
- package/dist/cjs/ui/Resizer/index.js +9 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +19 -8
- package/dist/es2019/create-editor/create-plugins-list.js +26 -10
- package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
- package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/annotation/utils.js +18 -7
- package/dist/es2019/plugins/avatar-group/index.js +2 -1
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
- package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/es2019/plugins/extension/extension-api.js +9 -2
- package/dist/es2019/plugins/extension/ui/styles.js +6 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
- package/dist/es2019/plugins/find-replace/index.js +15 -128
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/es2019/plugins/fragment/index.js +22 -0
- package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/es2019/plugins/index.js +2 -0
- package/dist/es2019/plugins/list/actions/conversions.js +38 -69
- package/dist/es2019/plugins/list/transforms.js +5 -1
- package/dist/es2019/plugins/media/index.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
- package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/es2019/plugins/media/toolbar/index.js +90 -3
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
- package/dist/es2019/plugins/media/utils/media-common.js +1 -1
- package/dist/es2019/plugins/media/utils/media-files.js +6 -1
- package/dist/es2019/plugins/panel/actions.js +2 -2
- package/dist/es2019/plugins/panel/index.js +5 -5
- package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/es2019/plugins/panel/toolbar.js +10 -5
- package/dist/es2019/plugins/panel/utils.js +8 -1
- package/dist/es2019/plugins/rank.js +3 -2
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
- package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
- package/dist/es2019/plugins/table/commands/insert.js +1 -2
- package/dist/es2019/plugins/table/index.js +2 -1
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
- package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/messages.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/es2019/plugins/text-formatting/index.js +3 -2
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
- package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
- package/dist/es2019/ui/ColorPalette/index.js +7 -4
- package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
- package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
- package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
- package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
- package/dist/es2019/ui/Dropdown/index.js +2 -1
- package/dist/es2019/ui/DropdownMenu/index.js +7 -3
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/es2019/ui/Resizer/index.js +9 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +22 -8
- package/dist/esm/create-editor/create-plugins-list.js +26 -10
- package/dist/esm/labs/next/presets/cxhtml.js +1 -2
- package/dist/esm/nodeviews/ReactNodeView.js +2 -2
- package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/annotation/utils.js +18 -7
- package/dist/esm/plugins/avatar-group/index.js +2 -1
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/esm/plugins/extension/extension-api.js +9 -2
- package/dist/esm/plugins/extension/ui/styles.js +1 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
- package/dist/esm/plugins/find-replace/index.js +14 -131
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/esm/plugins/fragment/index.js +22 -0
- package/dist/esm/plugins/fragment/plugin-key.js +2 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/esm/plugins/index.js +2 -0
- package/dist/esm/plugins/list/actions/conversions.js +38 -71
- package/dist/esm/plugins/list/transforms.js +7 -1
- package/dist/esm/plugins/media/index.js +2 -3
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
- package/dist/esm/plugins/media/toolbar/commands.js +45 -0
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/esm/plugins/media/toolbar/index.js +88 -3
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/esm/plugins/media/utils/media-common.js +1 -1
- package/dist/esm/plugins/media/utils/media-files.js +6 -1
- package/dist/esm/plugins/panel/actions.js +2 -2
- package/dist/esm/plugins/panel/index.js +5 -5
- package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/esm/plugins/panel/toolbar.js +9 -4
- package/dist/esm/plugins/panel/utils.js +13 -0
- package/dist/esm/plugins/rank.js +3 -2
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
- package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
- package/dist/esm/plugins/table/commands/insert.js +1 -2
- package/dist/esm/plugins/table/index.js +3 -2
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/esm/plugins/table/transforms/column-width.js +13 -3
- package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/messages.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/esm/plugins/text-formatting/index.js +3 -2
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
- package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
- package/dist/esm/ui/ColorPalette/index.js +7 -4
- package/dist/esm/ui/ColorPickerButton/index.js +1 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
- package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
- package/dist/esm/ui/ConfigPanel/utils.js +1 -6
- package/dist/esm/ui/Dropdown/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +7 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/esm/ui/Resizer/index.js +9 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/full-page.d.ts +1 -1
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
- package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +7 -1
- package/dist/types/plugins/annotation/utils.d.ts +1 -1
- package/dist/types/plugins/avatar-group/index.d.ts +1 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
- package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
- package/dist/types/plugins/find-replace/index.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
- package/dist/types/plugins/fragment/index.d.ts +5 -0
- package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
- package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
- package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
- package/dist/types/plugins/media/types.d.ts +0 -1
- package/dist/types/plugins/panel/actions.d.ts +1 -1
- package/dist/types/plugins/panel/types.d.ts +8 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -1
- package/dist/types/plugins/table/commands/insert.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
- package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
- package/dist/types/plugins/table/types.d.ts +8 -0
- package/dist/types/plugins/table/ui/consts.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +11 -1
- package/dist/types/types/feature-flags.d.ts +13 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
- package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
- package/dist/types/ui/ColorPalette/index.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
- package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
- package/dist/types/ui/Resizer/index.d.ts +1 -0
- package/package.json +32 -29
- package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
- package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createPlugin } from './plugin';
|
|
3
|
-
import { findReplacePluginKey } from './types';
|
|
4
3
|
import keymapPlugin from './keymap';
|
|
5
|
-
import
|
|
6
|
-
import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
|
|
7
|
-
import { blur, toggleMatchCase } from './commands';
|
|
8
|
-
import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
|
|
9
|
-
import { TRIGGER_METHOD } from '../analytics';
|
|
10
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
4
|
+
import FindReplaceToolbarButtonWithState from './FindReplaceToolbarButtonWithState';
|
|
11
5
|
export const findReplacePlugin = props => {
|
|
12
6
|
return {
|
|
13
7
|
name: 'findReplace',
|
|
@@ -33,127 +27,20 @@ export const findReplacePlugin = props => {
|
|
|
33
27
|
containerElement,
|
|
34
28
|
dispatchAnalyticsEvent
|
|
35
29
|
}) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} = editorView;
|
|
51
|
-
cmd(state, dispatch);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const handleActivate = () => {
|
|
55
|
-
runWithEditorFocused(() => dispatchCommand(activateWithAnalytics({
|
|
56
|
-
triggerMethod: TRIGGER_METHOD.TOOLBAR
|
|
57
|
-
})));
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const handleFind = keyword => {
|
|
61
|
-
runWithEditorFocused(() => dispatchCommand(findWithAnalytics({
|
|
62
|
-
editorView,
|
|
63
|
-
containerElement,
|
|
64
|
-
keyword
|
|
65
|
-
})));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const handleFindNext = ({
|
|
69
|
-
triggerMethod
|
|
70
|
-
}) => {
|
|
71
|
-
runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics({
|
|
72
|
-
triggerMethod
|
|
73
|
-
})));
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const handleFindPrev = ({
|
|
77
|
-
triggerMethod
|
|
78
|
-
}) => {
|
|
79
|
-
runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics({
|
|
80
|
-
triggerMethod
|
|
81
|
-
})));
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const handleReplace = ({
|
|
85
|
-
triggerMethod,
|
|
86
|
-
replaceText
|
|
87
|
-
}) => {
|
|
88
|
-
runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics({
|
|
89
|
-
triggerMethod,
|
|
90
|
-
replaceText
|
|
91
|
-
})));
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const handleReplaceAll = ({
|
|
95
|
-
replaceText
|
|
96
|
-
}) => {
|
|
97
|
-
runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics({
|
|
98
|
-
replaceText
|
|
99
|
-
})));
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const handleFindBlur = () => {
|
|
103
|
-
dispatchCommand(blur());
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const handleCancel = ({
|
|
107
|
-
triggerMethod
|
|
108
|
-
}) => {
|
|
109
|
-
dispatchCommand(cancelSearchWithAnalytics({
|
|
110
|
-
triggerMethod
|
|
111
|
-
}));
|
|
112
|
-
editorView.focus();
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const handleToggleMatchCase = () => {
|
|
116
|
-
dispatchCommand(toggleMatchCase());
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const {
|
|
120
|
-
findReplaceMatchCase
|
|
121
|
-
} = getFeatureFlags(editorView.state);
|
|
122
|
-
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
123
|
-
debounce: false,
|
|
124
|
-
plugins: {
|
|
125
|
-
findReplaceState: findReplacePluginKey
|
|
126
|
-
},
|
|
127
|
-
render: ({
|
|
128
|
-
findReplaceState
|
|
129
|
-
}) => {
|
|
130
|
-
return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
|
|
131
|
-
allowMatchCase: findReplaceMatchCase,
|
|
132
|
-
shouldMatchCase: findReplaceState.shouldMatchCase,
|
|
133
|
-
onToggleMatchCase: handleToggleMatchCase,
|
|
134
|
-
isActive: findReplaceState.isActive,
|
|
135
|
-
findText: findReplaceState.findText,
|
|
136
|
-
index: findReplaceState.index,
|
|
137
|
-
numMatches: findReplaceState.matches.length,
|
|
138
|
-
replaceText: findReplaceState.replaceText,
|
|
139
|
-
shouldFocus: findReplaceState.shouldFocus,
|
|
140
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
141
|
-
popupsMountPoint: popupsMountPoint,
|
|
142
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
143
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
144
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
145
|
-
onFindBlur: handleFindBlur,
|
|
146
|
-
onCancel: handleCancel,
|
|
147
|
-
onActivate: handleActivate,
|
|
148
|
-
onFind: handleFind,
|
|
149
|
-
onFindNext: handleFindNext,
|
|
150
|
-
onFindPrev: handleFindPrev,
|
|
151
|
-
onReplace: handleReplace,
|
|
152
|
-
onReplaceAll: handleReplaceAll,
|
|
153
|
-
takeFullWidth: props.takeFullWidth
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
});
|
|
30
|
+
if (props.twoLineEditorToolbar) {
|
|
31
|
+
return null;
|
|
32
|
+
} else {
|
|
33
|
+
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
34
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
35
|
+
popupsMountPoint: popupsMountPoint,
|
|
36
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
37
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
38
|
+
editorView: editorView,
|
|
39
|
+
containerElement: containerElement,
|
|
40
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
41
|
+
takeFullWidth: props.takeFullWidth
|
|
42
|
+
});
|
|
43
|
+
}
|
|
157
44
|
}
|
|
158
45
|
|
|
159
46
|
};
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import styled, { ThemeProvider } from 'styled-components';
|
|
4
4
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
import { B400 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { B400 } from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
6
|
+
|
|
6
7
|
import Item, { itemThemeNamespace } from '@atlaskit/item';
|
|
7
8
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
8
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -8,6 +8,13 @@ import EditorEmojiAddIcon from './EditorEmojiAddIcon'; // helps adjusts position
|
|
|
8
8
|
|
|
9
9
|
const EmojiPickerButtonWrapper = styled.div`
|
|
10
10
|
position: relative;
|
|
11
|
+
`; // helps to vertically align emoji picker
|
|
12
|
+
// both top and bottom margin should be 2px
|
|
13
|
+
// https://product-fabric.atlassian.net/browse/CETI-148
|
|
14
|
+
|
|
15
|
+
const EmojiPickerWrapper = styled.div`
|
|
16
|
+
margin-bottom: -12px;
|
|
17
|
+
margin-top: -4px;
|
|
11
18
|
`;
|
|
12
19
|
export const EmojiPickerButton = props => {
|
|
13
20
|
const buttonRef = React.useRef(null);
|
|
@@ -20,6 +27,7 @@ export const EmojiPickerButton = props => {
|
|
|
20
27
|
|
|
21
28
|
const updateEmoji = emoji => {
|
|
22
29
|
setIsPopupOpen(false);
|
|
30
|
+
props.editorView && props.editorView.focus();
|
|
23
31
|
props.onChange && props.onChange(emoji);
|
|
24
32
|
};
|
|
25
33
|
|
|
@@ -47,11 +55,11 @@ export const EmojiPickerButton = props => {
|
|
|
47
55
|
fitHeight: 350,
|
|
48
56
|
fitWidth: 350,
|
|
49
57
|
offset: [0, 10]
|
|
50
|
-
}, /*#__PURE__*/React.createElement(WithProviders, {
|
|
58
|
+
}, /*#__PURE__*/React.createElement(EmojiPickerWrapper, null, /*#__PURE__*/React.createElement(WithProviders, {
|
|
51
59
|
providers: ['emojiProvider'],
|
|
52
60
|
providerFactory: props.providerFactory,
|
|
53
61
|
renderNode: renderPicker
|
|
54
|
-
}));
|
|
62
|
+
})));
|
|
55
63
|
};
|
|
56
64
|
|
|
57
65
|
const title = props.title || '';
|
|
@@ -224,7 +224,7 @@ export default class Toolbar extends Component {
|
|
|
224
224
|
if (item.selectType === 'emoji') {
|
|
225
225
|
return /*#__PURE__*/React.createElement(EmojiPickerButton, {
|
|
226
226
|
key: idx,
|
|
227
|
-
|
|
227
|
+
editorView: editorView,
|
|
228
228
|
title: item.title,
|
|
229
229
|
providerFactory: providerFactory,
|
|
230
230
|
isSelected: item.selected,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { fragment } 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
|
+
|
|
10
|
+
const fragmentMarkPlugin = () => ({
|
|
11
|
+
name: 'fragmentPlugin',
|
|
12
|
+
|
|
13
|
+
marks() {
|
|
14
|
+
return [{
|
|
15
|
+
name: 'fragment',
|
|
16
|
+
mark: fragment
|
|
17
|
+
}];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default fragmentMarkPlugin;
|
|
@@ -4,7 +4,7 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
|
4
4
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
5
5
|
import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
|
|
6
6
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
|
-
import { N80, N30 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { N90, N80, N30 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
9
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
10
|
import { PureComponent } from 'react';
|
|
@@ -27,7 +27,7 @@ export const RECENT_SEARCH_LIST_SIZE = 5;
|
|
|
27
27
|
const ClearText = styled.span`
|
|
28
28
|
cursor: pointer;
|
|
29
29
|
padding-right: 8px;
|
|
30
|
-
color: ${
|
|
30
|
+
color: ${N90};
|
|
31
31
|
`;
|
|
32
32
|
const TextInputWrapper = styled.div`
|
|
33
33
|
${InputWrapper};
|
|
@@ -42,6 +42,7 @@ export { default as breakoutPlugin } from './breakout';
|
|
|
42
42
|
export { default as alignmentPlugin } from './alignment';
|
|
43
43
|
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
44
44
|
export { default as editorDisabledPlugin } from './editor-disabled';
|
|
45
|
+
export { default as fragmentMarkPlugin } from './fragment';
|
|
45
46
|
export { default as indentationPlugin } from './indentation';
|
|
46
47
|
export { default as annotationPlugin } from './annotation';
|
|
47
48
|
export { default as analyticsPlugin } from './analytics';
|
|
@@ -61,4 +62,5 @@ export { default as clipboardPlugin } from './clipboard';
|
|
|
61
62
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
62
63
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
63
64
|
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
65
|
+
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
64
66
|
export { default as codeBidiWarningPlugin } from './code-bidi-warning';
|
|
@@ -4,6 +4,7 @@ import { findWrapping } from 'prosemirror-transform';
|
|
|
4
4
|
import { findParentNodeClosestToPos } from 'prosemirror-utils';
|
|
5
5
|
import { isListNode, joinSiblingLists } from '../utils/node';
|
|
6
6
|
import { isEmptyParagraph } from '../../../utils';
|
|
7
|
+
import { findFirstParentListNode } from '../utils/find';
|
|
7
8
|
export function convertListType({
|
|
8
9
|
tr,
|
|
9
10
|
nextListNodeType
|
|
@@ -35,82 +36,50 @@ export function convertListType({
|
|
|
35
36
|
startIndex,
|
|
36
37
|
endIndex,
|
|
37
38
|
depth
|
|
38
|
-
} = nodeRangeAroundList;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
53
|
-
// @ts-ignore posAtIndex is a public API but has no type yet
|
|
54
|
-
const position = nodeRangeAroundList.$from.posAtIndex(i, depth);
|
|
55
|
-
const resolvedPosition = doc.resolve(position);
|
|
56
|
-
|
|
57
|
-
if (isEmptyParagraph(parentNode.child(i)) && !isListNodeFound) {
|
|
58
|
-
before.from = doc.resolve( // @ts-ignore posAtIndex is a public API but has no type yet
|
|
59
|
-
nodeRangeAroundList.$from.posAtIndex(i, depth) + 2);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (isEmptyParagraph(parentNode.child(i)) && isListNodeFound && !firstEmptyParagraphAfterListFound) {
|
|
63
|
-
after.to = resolvedPosition;
|
|
64
|
-
firstEmptyParagraphAfterListFound = true;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (!isListNode(parentNode.child(i)) && !isListNodeFound) {
|
|
68
|
-
before.to = doc.resolve(resolvedPosition.pos + 1);
|
|
69
|
-
} else if (!isListNodeFound) {
|
|
70
|
-
isListNodeFound = true;
|
|
71
|
-
const endNodePosition = doc.resolve(resolvedPosition.pos + 1).end() + 1;
|
|
72
|
-
|
|
73
|
-
if (doc.resolve(endNodePosition).nodeAfter) {
|
|
74
|
-
after.from = doc.resolve(endNodePosition + 1);
|
|
39
|
+
} = nodeRangeAroundList; // Checking for invalid nodes to prevent conversion
|
|
40
|
+
// eg. a panel cannot be wrapped in a list so return
|
|
41
|
+
// It will skip this check if the selection begins within a list
|
|
42
|
+
// This is to match the behaviour of the toolbar buttons being disabled
|
|
43
|
+
|
|
44
|
+
if (!findFirstParentListNode($from)) {
|
|
45
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
46
|
+
const position = nodeRangeAroundList.$from.posAtIndex(i, depth);
|
|
47
|
+
const resolvedPosition = doc.resolve(position);
|
|
48
|
+
const currentChild = parentNode.child(i);
|
|
49
|
+
const currentNodeRange = resolvedPosition.blockRange(tr.doc.resolve(position + currentChild.nodeSize));
|
|
50
|
+
|
|
51
|
+
if (currentNodeRange && !isListNode(currentChild) && !findWrapping(currentNodeRange, nextListNodeType)) {
|
|
52
|
+
return;
|
|
75
53
|
}
|
|
76
54
|
}
|
|
77
|
-
}
|
|
55
|
+
} // Checking for any non list nodes and wrapping them in a list
|
|
56
|
+
// so they can be converted
|
|
78
57
|
|
|
79
|
-
let beforeConversionArgs, beforeRange, afterConversionArgs, afterRange;
|
|
80
|
-
|
|
81
|
-
if (after.from && after.to) {
|
|
82
|
-
const mappedFrom = tr.mapping.map(after.from.pos);
|
|
83
|
-
const mappedTo = tr.mapping.map(after.to.pos);
|
|
84
|
-
afterRange = new NodeRange(tr.doc.resolve(mappedFrom), tr.doc.resolve(mappedTo), nodeRangeAroundList.depth);
|
|
85
|
-
afterConversionArgs = {
|
|
86
|
-
tr,
|
|
87
|
-
nextListNodeType,
|
|
88
|
-
nodeRange: afterRange
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
58
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
tr,
|
|
98
|
-
nextListNodeType,
|
|
99
|
-
nodeRange: beforeRange
|
|
100
|
-
};
|
|
101
|
-
}
|
|
59
|
+
tr.doc.nodesBetween(nodeRangeAroundList.start, nodeRangeAroundList.end, (node, pos) => {
|
|
60
|
+
// Skip over any nodes that are part of a list
|
|
61
|
+
if (findFirstParentListNode(tr.doc.resolve(tr.mapping.map(pos)))) {
|
|
62
|
+
return false;
|
|
63
|
+
} // The following applies to suitable nodes that are not within a list
|
|
102
64
|
|
|
103
|
-
if (!afterRange && !beforeRange || afterRange && !findWrapping(afterRange, nextListNodeType) || beforeRange && !findWrapping(beforeRange, nextListNodeType)) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
65
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
66
|
+
const currentNodeNotWrappedInList = node;
|
|
67
|
+
const isNotAnEmptyParagraphAndIsParagraphOrLeafNode = !isEmptyParagraph(currentNodeNotWrappedInList) && (!node.type.isBlock || node.type.name === 'paragraph');
|
|
110
68
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
69
|
+
if (isNotAnEmptyParagraphAndIsParagraphOrLeafNode) {
|
|
70
|
+
const remainingNodeRange = new NodeRange(tr.doc.resolve(tr.mapping.map(pos)), tr.doc.resolve(tr.mapping.map(pos) + currentNodeNotWrappedInList.nodeSize), nodeRangeAroundList.depth);
|
|
71
|
+
convertAroundList({
|
|
72
|
+
tr,
|
|
73
|
+
nextListNodeType,
|
|
74
|
+
nodeRange: remainingNodeRange
|
|
75
|
+
});
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
convertSelectedList({
|
|
80
|
+
tr,
|
|
81
|
+
nextListNodeType
|
|
82
|
+
});
|
|
114
83
|
|
|
115
84
|
if (tr.docChanged) {
|
|
116
85
|
joinSiblingLists({
|
|
@@ -195,9 +195,13 @@ const extractListFromParagraph = (node, parent, schema) => {
|
|
|
195
195
|
} // Return false to prevent replaceWith from wrapping the text node in a paragraph
|
|
196
196
|
// paragraph since that will be done later. If it's done here, it will fail
|
|
197
197
|
// the paragraph.validContent check.
|
|
198
|
+
// Dont return false if there are lists, as they arent validContent for paragraphs
|
|
199
|
+
// and will result in hanging textNodes
|
|
198
200
|
|
|
199
201
|
|
|
200
|
-
|
|
202
|
+
const containsList = listified.some(node => node.type === bulletList || node.type === orderedList);
|
|
203
|
+
|
|
204
|
+
if (listified.some(node => node.isText) && !containsList) {
|
|
201
205
|
return false;
|
|
202
206
|
}
|
|
203
207
|
|
|
@@ -31,10 +31,10 @@ const mediaPlugin = options => ({
|
|
|
31
31
|
const {
|
|
32
32
|
allowMediaGroup = true,
|
|
33
33
|
allowMediaSingle = false,
|
|
34
|
-
allowMediaInline = false,
|
|
35
34
|
featureFlags
|
|
36
35
|
} = options || {};
|
|
37
36
|
const captions = getMediaFeatureFlag('captions', featureFlags);
|
|
37
|
+
const allowMediaInline = getMediaFeatureFlag('mediaInline', featureFlags);
|
|
38
38
|
const mediaSingleNode = captions ? mediaSingleWithCaption : mediaSingle;
|
|
39
39
|
return [{
|
|
40
40
|
name: 'mediaGroup',
|
|
@@ -221,7 +221,7 @@ const mediaPlugin = options => ({
|
|
|
221
221
|
}],
|
|
222
222
|
floatingToolbar: (state, intl, providerFactory) => floatingToolbar(state, intl, {
|
|
223
223
|
providerFactory,
|
|
224
|
-
allowMediaInline: options && options.
|
|
224
|
+
allowMediaInline: options && getMediaFeatureFlag('mediaInline', options.featureFlags),
|
|
225
225
|
allowResizing: options && options.allowResizing,
|
|
226
226
|
allowResizingInTables: options && options.allowResizingInTables,
|
|
227
227
|
allowAnnotation: options && options.allowAnnotation,
|
|
@@ -11,6 +11,7 @@ import { isNodeSelectedOrInRange, SelectedState } from '../../../utils/nodes';
|
|
|
11
11
|
import { pluginKey as editorDisabledPluginKey } from '../../editor-disabled';
|
|
12
12
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
13
13
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
14
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
14
15
|
|
|
15
16
|
const isMediaGroupSelectedFromProps = props => {
|
|
16
17
|
return isNodeSelectedOrInRange(props.anchorPos, props.headPos, props.getPos(), props.node.nodeSize);
|
|
@@ -135,7 +136,7 @@ export default class MediaGroup extends React.Component {
|
|
|
135
136
|
onClick: () => {
|
|
136
137
|
setNodeSelection(this.props.view, getNodePos());
|
|
137
138
|
},
|
|
138
|
-
...mediaInlineOptions(mediaOptions.
|
|
139
|
+
...mediaInlineOptions(getMediaFeatureFlag('mediaInline', mediaOptions.featureFlags))
|
|
139
140
|
};
|
|
140
141
|
});
|
|
141
142
|
return /*#__PURE__*/React.createElement(Filmstrip, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectionBasedNodeView } from '../../../nodeviews/';
|
|
3
3
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
4
4
|
import { WithProviders } from '@atlaskit/editor-common';
|
|
5
|
+
import { MediaInlineNodeSelector } from './styles';
|
|
5
6
|
export const MediaInline = props => {
|
|
6
7
|
const [viewMediaClientConfig, setViewMediaClientConfig] = useState({});
|
|
7
8
|
useEffect(() => {
|
|
@@ -27,14 +28,16 @@ export const MediaInline = props => {
|
|
|
27
28
|
collectionName: collection
|
|
28
29
|
};
|
|
29
30
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
31
|
+
isSelected: props.isSelected,
|
|
30
32
|
identifier: identifier,
|
|
31
33
|
mediaClientConfig: viewMediaClientConfig
|
|
32
34
|
});
|
|
33
35
|
};
|
|
34
|
-
export class MediaInlineNodeView extends
|
|
36
|
+
export class MediaInlineNodeView extends SelectionBasedNodeView {
|
|
35
37
|
createDomRef() {
|
|
36
38
|
const domRef = document.createElement('span');
|
|
37
39
|
domRef.contentEditable = 'false';
|
|
40
|
+
domRef.classList.add(MediaInlineNodeSelector);
|
|
38
41
|
return domRef;
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -54,7 +57,7 @@ export class MediaInlineNodeView extends ReactNodeView {
|
|
|
54
57
|
return true;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
return
|
|
60
|
+
return super.viewShouldUpdate(nextNode);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
render(props) {
|
|
@@ -74,7 +77,8 @@ export class MediaInlineNodeView extends ReactNodeView {
|
|
|
74
77
|
return /*#__PURE__*/React.createElement(MediaInline, {
|
|
75
78
|
identifier: this.node.attrs.id,
|
|
76
79
|
mediaProvider: mediaProvider,
|
|
77
|
-
node: this.node
|
|
80
|
+
node: this.node,
|
|
81
|
+
isSelected: this.nodeInsideSelection()
|
|
78
82
|
});
|
|
79
83
|
}
|
|
80
84
|
});
|
|
@@ -13,7 +13,7 @@ import { stateKey as mediaPluginKey } from '../pm-plugins/main';
|
|
|
13
13
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
14
14
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
15
15
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
16
|
-
import { FigureWrapper } from './styles';
|
|
16
|
+
import { FigureWrapper, MediaSingleNodeSelector } from './styles';
|
|
17
17
|
import { floatingLayouts, isRichMediaInsideOfBlockNode } from '../../../utils/rich-media-utils';
|
|
18
18
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
19
19
|
import { isMediaBlobUrlFromAttrs } from '../utils/media-common';
|
|
@@ -289,7 +289,9 @@ export default class MediaSingleNode extends Component {
|
|
|
289
289
|
const lineLength = this.getLineLength(view, getPos()) || this.props.lineLength;
|
|
290
290
|
const isSelected = selected();
|
|
291
291
|
const shouldShowPlaceholder = getMediaFeatureFlag('captions', mediaOptions.featureFlags) && node.childCount !== 2 && isSelected && state.selection instanceof NodeSelection;
|
|
292
|
-
const MediaChildren = /*#__PURE__*/React.createElement(FigureWrapper,
|
|
292
|
+
const MediaChildren = /*#__PURE__*/React.createElement(FigureWrapper, {
|
|
293
|
+
className: MediaSingleNodeSelector
|
|
294
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
293
295
|
ref: this.props.forwardRef
|
|
294
296
|
}), shouldShowPlaceholder && /*#__PURE__*/React.createElement(CaptionPlaceholder, {
|
|
295
297
|
onClick: this.clickPlaceholder
|
|
@@ -391,12 +393,12 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
391
393
|
return undefined;
|
|
392
394
|
}
|
|
393
395
|
|
|
394
|
-
update(node, decorations, isValidUpdate) {
|
|
396
|
+
update(node, decorations, _innerDecorations, isValidUpdate) {
|
|
395
397
|
if (!isValidUpdate) {
|
|
396
398
|
isValidUpdate = (currentNode, newNode) => this.getNodeMediaId(currentNode) === this.getNodeMediaId(newNode);
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
return super.update(node, decorations, isValidUpdate);
|
|
401
|
+
return super.update(node, decorations, _innerDecorations, isValidUpdate);
|
|
400
402
|
}
|
|
401
403
|
|
|
402
404
|
render(props, forwardRef) {
|
|
@@ -456,7 +458,7 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
456
458
|
if (offsetLeft !== this.lastOffsetLeft) {
|
|
457
459
|
this.lastOffsetLeft = offsetLeft;
|
|
458
460
|
this.forceViewUpdate = true;
|
|
459
|
-
this.update(this.node, [], () => true);
|
|
461
|
+
this.update(this.node, [], [], () => true);
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
464
|
|
|
@@ -186,6 +186,8 @@ export class AltTextEditComponent extends React.Component {
|
|
|
186
186
|
onClick: this.closeMediaAltTextMenu
|
|
187
187
|
})), /*#__PURE__*/React.createElement(PanelTextInput, {
|
|
188
188
|
testId: "alt-text-input",
|
|
189
|
+
ariaLabel: formatMessage(messages.placeholder),
|
|
190
|
+
describedById: "support-text",
|
|
189
191
|
placeholder: formatMessage(messages.placeholder),
|
|
190
192
|
defaultValue: this.state.lastValue,
|
|
191
193
|
onCancel: this.dispatchCancelEvent,
|
|
@@ -202,7 +204,9 @@ export class AltTextEditComponent extends React.Component {
|
|
|
202
204
|
})),
|
|
203
205
|
tooltipContent: formatMessage(messages.clear),
|
|
204
206
|
onClick: this.handleClearText
|
|
205
|
-
}))), !!errorsList.length && /*#__PURE__*/React.createElement(ValidationWrapper, null, errorsList), /*#__PURE__*/React.createElement(SupportText,
|
|
207
|
+
}))), !!errorsList.length && /*#__PURE__*/React.createElement(ValidationWrapper, null, errorsList), /*#__PURE__*/React.createElement(SupportText, {
|
|
208
|
+
id: "support-text"
|
|
209
|
+
}, formatMessage(messages.supportText)));
|
|
206
210
|
}
|
|
207
211
|
|
|
208
212
|
fireAnalytics(actionType) {
|