@atlaskit/editor-core 151.2.0 → 152.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -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/find-replace/ui/Find.js +16 -9
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +9 -2
- package/dist/cjs/plugins/find-replace/ui/Replace.js +11 -3
- package/dist/cjs/plugins/find-replace/ui/styles.js +44 -35
- 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/find-replace/ui/Find.js +18 -10
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
- package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
- 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/find-replace/ui/Find.js +17 -10
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
- package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
- package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
- 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/code-block/types.d.ts +1 -1
- 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/find-replace/ui/Find.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
- 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 +33 -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
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/core';
|
|
3
6
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
4
7
|
import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
|
|
5
8
|
import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
|
|
6
9
|
import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
7
10
|
import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
|
|
8
11
|
import Textfield from '@atlaskit/textfield';
|
|
9
|
-
import {
|
|
12
|
+
import { countStyles, sectionWrapperStyles } from './styles';
|
|
10
13
|
import { TRIGGER_METHOD } from '../../analytics/types';
|
|
11
14
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
12
15
|
const messages = defineMessages({
|
|
@@ -147,16 +150,16 @@ class Find extends React.Component {
|
|
|
147
150
|
this.findNext = formatMessage(messages.findNext);
|
|
148
151
|
this.findPrevious = formatMessage(messages.findPrevious);
|
|
149
152
|
this.matchCase = formatMessage(messages.matchCase);
|
|
150
|
-
this.matchCaseIcon =
|
|
153
|
+
this.matchCaseIcon = jsx(MatchCaseIcon, {
|
|
151
154
|
label: this.matchCase
|
|
152
155
|
});
|
|
153
|
-
this.findNextIcon =
|
|
156
|
+
this.findNextIcon = jsx(ChevronDownIcon, {
|
|
154
157
|
label: this.findNext
|
|
155
158
|
});
|
|
156
|
-
this.findPrevIcon =
|
|
159
|
+
this.findPrevIcon = jsx(ChevronUpIcon, {
|
|
157
160
|
label: this.findPrevious
|
|
158
161
|
});
|
|
159
|
-
this.closeIcon =
|
|
162
|
+
this.closeIcon = jsx(EditorCloseIcon, {
|
|
160
163
|
label: this.closeFindReplaceDialog
|
|
161
164
|
}); // We locally manage the value of the input inside this component in order to support compositions.
|
|
162
165
|
// This requires some additional work inside componentDidUpdate to ensure we support changes that
|
|
@@ -200,7 +203,9 @@ class Find extends React.Component {
|
|
|
200
203
|
selectedMatchPosition: count.index + 1,
|
|
201
204
|
totalResultsCount: count.total
|
|
202
205
|
});
|
|
203
|
-
return
|
|
206
|
+
return jsx("div", {
|
|
207
|
+
css: sectionWrapperStyles
|
|
208
|
+
}, jsx(Textfield, {
|
|
204
209
|
name: "find",
|
|
205
210
|
appearance: "none",
|
|
206
211
|
placeholder: this.find,
|
|
@@ -212,24 +217,27 @@ class Find extends React.Component {
|
|
|
212
217
|
onBlur: this.props.onFindBlur,
|
|
213
218
|
onCompositionStart: this.handleCompositionStart,
|
|
214
219
|
onCompositionEnd: this.handleCompositionEnd
|
|
215
|
-
}), findText &&
|
|
220
|
+
}), findText && jsx("span", {
|
|
221
|
+
"data-testid": "textfield-count",
|
|
222
|
+
css: countStyles
|
|
223
|
+
}, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && jsx(FindReplaceTooltipButton, {
|
|
216
224
|
title: this.matchCase,
|
|
217
225
|
icon: this.matchCaseIcon,
|
|
218
226
|
onClick: this.handleMatchCaseClick,
|
|
219
227
|
isPressed: shouldMatchCase
|
|
220
|
-
}),
|
|
228
|
+
}), jsx(FindReplaceTooltipButton, {
|
|
221
229
|
title: this.findNext,
|
|
222
230
|
icon: this.findNextIcon,
|
|
223
231
|
keymapDescription: 'Enter',
|
|
224
232
|
onClick: this.handleFindNextClick,
|
|
225
233
|
disabled: count.total <= 1
|
|
226
|
-
}),
|
|
234
|
+
}), jsx(FindReplaceTooltipButton, {
|
|
227
235
|
title: this.findPrevious,
|
|
228
236
|
icon: this.findPrevIcon,
|
|
229
237
|
keymapDescription: 'Shift Enter',
|
|
230
238
|
onClick: this.handleFindPrevClick,
|
|
231
239
|
disabled: count.total <= 1
|
|
232
|
-
}),
|
|
240
|
+
}), jsx(FindReplaceTooltipButton, {
|
|
233
241
|
title: this.closeFindReplaceDialog,
|
|
234
242
|
icon: this.closeIcon,
|
|
235
243
|
keymapDescription: 'Escape',
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/core';
|
|
3
6
|
import Find from './Find';
|
|
4
7
|
import Replace from './Replace';
|
|
5
|
-
import {
|
|
8
|
+
import { ruleStyles, wrapperStyles } from './styles';
|
|
6
9
|
|
|
7
10
|
class FindReplace extends React.PureComponent {
|
|
8
11
|
constructor(...args) {
|
|
@@ -51,7 +54,9 @@ class FindReplace extends React.PureComponent {
|
|
|
51
54
|
shouldMatchCase,
|
|
52
55
|
onToggleMatchCase
|
|
53
56
|
} = this.props;
|
|
54
|
-
return
|
|
57
|
+
return jsx("div", {
|
|
58
|
+
css: wrapperStyles
|
|
59
|
+
}, jsx(Find, {
|
|
55
60
|
allowMatchCase: allowMatchCase,
|
|
56
61
|
shouldMatchCase: shouldMatchCase,
|
|
57
62
|
onToggleMatchCase: onToggleMatchCase,
|
|
@@ -65,7 +70,10 @@ class FindReplace extends React.PureComponent {
|
|
|
65
70
|
onFindTextfieldRefSet: this.setFindTextfieldRef,
|
|
66
71
|
onCancel: onCancel,
|
|
67
72
|
onArrowDown: this.setFocusToReplace
|
|
68
|
-
}),
|
|
73
|
+
}), jsx("hr", {
|
|
74
|
+
css: ruleStyles,
|
|
75
|
+
id: "replace-hr-element"
|
|
76
|
+
}), jsx(Replace, {
|
|
69
77
|
canReplace: count.total > 0,
|
|
70
78
|
replaceText: replaceText,
|
|
71
79
|
onReplace: onReplace,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/core';
|
|
6
|
+
import Button from '@atlaskit/button/standard-button';
|
|
3
7
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
4
8
|
import Textfield from '@atlaskit/textfield';
|
|
5
|
-
import {
|
|
9
|
+
import { sectionWrapperStyles, replaceSectionButtonStyles } from './styles';
|
|
6
10
|
import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '../../analytics/types';
|
|
7
11
|
const messages = defineMessages({
|
|
8
12
|
replaceWith: {
|
|
@@ -138,7 +142,9 @@ class Replace extends React.PureComponent {
|
|
|
138
142
|
const {
|
|
139
143
|
canReplace
|
|
140
144
|
} = this.props;
|
|
141
|
-
return
|
|
145
|
+
return jsx("div", {
|
|
146
|
+
css: sectionWrapperStyles
|
|
147
|
+
}, jsx(Textfield, {
|
|
142
148
|
name: "replace",
|
|
143
149
|
appearance: "none",
|
|
144
150
|
placeholder: this.replaceWith,
|
|
@@ -149,11 +155,13 @@ class Replace extends React.PureComponent {
|
|
|
149
155
|
onKeyDown: this.handleReplaceKeyDown,
|
|
150
156
|
onCompositionStart: this.handleCompositionStart,
|
|
151
157
|
onCompositionEnd: this.handleCompositionEnd
|
|
152
|
-
}),
|
|
158
|
+
}), jsx(Button, {
|
|
159
|
+
css: replaceSectionButtonStyles,
|
|
153
160
|
testId: this.replace,
|
|
154
161
|
onClick: this.handleReplaceClick,
|
|
155
162
|
isDisabled: !canReplace
|
|
156
|
-
}, this.replace),
|
|
163
|
+
}, this.replace), jsx(Button, {
|
|
164
|
+
css: replaceSectionButtonStyles,
|
|
157
165
|
testId: this.replaceAll,
|
|
158
166
|
onClick: this.handleReplaceAllClick,
|
|
159
167
|
isDisabled: !canReplace
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css } from '@emotion/core';
|
|
3
3
|
import { N60, N30A } from '@atlaskit/theme/colors';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
export const replaceSectionButtonStyles = css({
|
|
6
|
+
marginLeft: '4px'
|
|
7
|
+
});
|
|
8
|
+
export const ruleStyles = css({
|
|
9
|
+
width: '100%',
|
|
10
|
+
border: 'none',
|
|
11
|
+
backgroundColor: `${N30A}`,
|
|
12
|
+
margin: '4px 0px',
|
|
13
|
+
height: '1px',
|
|
14
|
+
borderRadius: '1px'
|
|
15
|
+
});
|
|
16
|
+
export const wrapperStyles = css({
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
'> *:not(#replace-hr-element)': {
|
|
20
|
+
margin: '0px 4px'
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`;
|
|
25
|
-
export const Wrapper = styled.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
> *:not(${Rule}) {
|
|
29
|
-
margin: 0px 4px;
|
|
22
|
+
});
|
|
23
|
+
export const sectionWrapperStyles = css({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'column',
|
|
26
|
+
'> *': {
|
|
27
|
+
display: 'inline-flex',
|
|
28
|
+
height: '32px',
|
|
29
|
+
flex: '0 0 auto'
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
`;
|
|
42
|
-
export const Count = styled.span`
|
|
43
|
-
color: ${N60};
|
|
44
|
-
font-size: ${relativeFontSizeToBase16(12)};
|
|
45
|
-
flex: 0 0 auto;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
align-items: center;
|
|
48
|
-
margin-left: 4px;
|
|
49
|
-
margin-right: 8px;
|
|
50
|
-
`;
|
|
31
|
+
});
|
|
32
|
+
export const countStyles = css({
|
|
33
|
+
color: `${N60}`,
|
|
34
|
+
fontSize: `${relativeFontSizeToBase16(12)}`,
|
|
35
|
+
flex: '0 0 auto',
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
marginLeft: '4px',
|
|
39
|
+
marginRight: '8px'
|
|
40
|
+
});
|
|
@@ -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
|
|