@atlaskit/editor-core 151.3.0 → 151.3.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/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/mediaNodeUpdater.js +3 -3
- 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/mediaNodeUpdater.js +3 -3
- 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/mediaNodeUpdater.js +3 -3
- 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/mediaNodeUpdater.d.ts +2 -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 +10 -7
- 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
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.isValidHex = exports.getNameFromDuplicateField = exports.isDuplicateField = exports.getSafeParentedName = exports.getOptionFromValue = exports.validateRequired = exports.
|
|
8
|
+
exports.isValidHex = exports.getNameFromDuplicateField = exports.isDuplicateField = exports.getSafeParentedName = exports.getOptionFromValue = exports.validateRequired = exports.fromEntries = exports.validate = void 0;
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
@@ -32,14 +32,6 @@ var fromEntries = function fromEntries(iterable) {
|
|
|
32
32
|
|
|
33
33
|
exports.fromEntries = fromEntries;
|
|
34
34
|
|
|
35
|
-
var toEntries = function toEntries(parameters) {
|
|
36
|
-
return Array.isArray(parameters) ? parameters.reduce(function (prev, curr) {
|
|
37
|
-
return [].concat((0, _toConsumableArray2.default)(prev), (0, _toConsumableArray2.default)(Object.entries(curr)));
|
|
38
|
-
}, []) : Object.entries(parameters);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.toEntries = toEntries;
|
|
42
|
-
|
|
43
35
|
var isEmptyString = function isEmptyString(value) {
|
|
44
36
|
return typeof value === 'string' && value === '';
|
|
45
37
|
};
|
|
@@ -104,7 +96,7 @@ exports.isDuplicateField = isDuplicateField;
|
|
|
104
96
|
var getNameFromDuplicateField = function getNameFromDuplicateField(key) {
|
|
105
97
|
return key.replace(duplicateFieldRegex, '');
|
|
106
98
|
};
|
|
107
|
-
/*
|
|
99
|
+
/*
|
|
108
100
|
ColorPickerButton only accepts 8 digit hex alpha values, for example:
|
|
109
101
|
#123fffaa (8 digits, hex alpha)
|
|
110
102
|
*/
|
|
@@ -134,6 +134,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
134
134
|
key: item.key || item.content,
|
|
135
135
|
isSelected: item.isActive
|
|
136
136
|
}, /*#__PURE__*/_react.default.createElement(_item.default, {
|
|
137
|
+
role: "menuitem",
|
|
137
138
|
elemBefore: item.elemBefore,
|
|
138
139
|
elemAfter: item.elemAfter,
|
|
139
140
|
isDisabled: item.isDisabled,
|
|
@@ -212,7 +213,8 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
212
213
|
}
|
|
213
214
|
}), items.map(function (group, index) {
|
|
214
215
|
return /*#__PURE__*/_react.default.createElement(_item.ItemGroup, {
|
|
215
|
-
key: index
|
|
216
|
+
key: index,
|
|
217
|
+
role: "menu"
|
|
216
218
|
}, group.items.map(function (item) {
|
|
217
219
|
return _this2.renderItem(item);
|
|
218
220
|
}));
|
|
@@ -63,7 +63,7 @@ var Name = _styledComponents.default.div(_templateObject3 || (_templateObject3 =
|
|
|
63
63
|
|
|
64
64
|
exports.Name = Name;
|
|
65
65
|
|
|
66
|
-
var ContainerName = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n line-height: 14px;\n font-size: ", ";\n"])), _colors.
|
|
66
|
+
var ContainerName = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n line-height: 14px;\n font-size: ", ";\n"])), _colors.N300, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _theme.fontSizeSmall)()));
|
|
67
67
|
|
|
68
68
|
exports.ContainerName = ContainerName;
|
|
69
69
|
|
|
@@ -185,6 +185,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
185
185
|
value: function render() {
|
|
186
186
|
var handleStyles = {};
|
|
187
187
|
var handles = {};
|
|
188
|
+
var handleComponent = {};
|
|
188
189
|
var _this$props4 = this.props,
|
|
189
190
|
_this$props4$innerPad = _this$props4.innerPadding,
|
|
190
191
|
innerPadding = _this$props4$innerPad === void 0 ? 0 : _this$props4$innerPad,
|
|
@@ -194,7 +195,8 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
194
195
|
layout = _this$props4.layout,
|
|
195
196
|
enable = _this$props4.enable,
|
|
196
197
|
children = _this$props4.children,
|
|
197
|
-
ratio = _this$props4.ratio
|
|
198
|
+
ratio = _this$props4.ratio,
|
|
199
|
+
handleComponentFunc = _this$props4.handleComponentFunc;
|
|
198
200
|
var isResizing = this.state.isResizing;
|
|
199
201
|
|
|
200
202
|
_utils.handleSides.forEach(function (side) {
|
|
@@ -204,6 +206,11 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
204
206
|
handleStyles[side] = (_handleStyles$side = {
|
|
205
207
|
width: '24px'
|
|
206
208
|
}, (0, _defineProperty2.default)(_handleStyles$side, side, "".concat(-13 - innerPadding, "px")), (0, _defineProperty2.default)(_handleStyles$side, "zIndex", _editorSharedStyles.akRichMediaResizeZIndex), (0, _defineProperty2.default)(_handleStyles$side, "pointerEvents", 'auto'), _handleStyles$side);
|
|
209
|
+
var sideHandleComponent = handleComponentFunc && handleComponentFunc(side);
|
|
210
|
+
|
|
211
|
+
if (sideHandleComponent) {
|
|
212
|
+
handleComponent[side] = sideHandleComponent;
|
|
213
|
+
}
|
|
207
214
|
});
|
|
208
215
|
|
|
209
216
|
var className = (0, _classnames.default)(_editorCommon.richMediaClassName, "image-".concat(layout), this.props.className, {
|
|
@@ -237,6 +244,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
237
244
|
handleClasses: handles,
|
|
238
245
|
handleStyles: handleStyles,
|
|
239
246
|
handleWrapperStyle: handleWrapperStyle,
|
|
247
|
+
handleComponent: handleComponent,
|
|
240
248
|
enable: enable,
|
|
241
249
|
onResize: this.handleResize,
|
|
242
250
|
onResizeStop: this.handleResizeStop,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.nextMajorVersion = exports.version = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "151.3.
|
|
9
|
+
var version = "151.3.1";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -471,8 +471,27 @@ export default class ReactEditorView extends React.Component {
|
|
|
471
471
|
transformer: this.contentTransformer
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
+
if (this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
475
|
+
this.focusTimeoutId = handleEditorFocus(view);
|
|
476
|
+
}
|
|
477
|
+
|
|
474
478
|
if (this.featureFlags.ufo) {
|
|
479
|
+
this.experienceStore = ExperienceStore.getInstance(view);
|
|
480
|
+
this.experienceStore.start(EditorExperience.editSession);
|
|
481
|
+
this.experienceStore.addMetadata(EditorExperience.editSession, {
|
|
482
|
+
reliabilityInterval: RELIABILITY_INTERVAL
|
|
483
|
+
});
|
|
475
484
|
this.reliabilityInterval = window.setInterval(() => {
|
|
485
|
+
var _this$experienceStore11, _this$experienceStore12;
|
|
486
|
+
|
|
487
|
+
(_this$experienceStore11 = this.experienceStore) === null || _this$experienceStore11 === void 0 ? void 0 : (_this$experienceStore12 = _this$experienceStore11.success(EditorExperience.editSession)) === null || _this$experienceStore12 === void 0 ? void 0 : _this$experienceStore12.finally(() => {
|
|
488
|
+
var _this$experienceStore13, _this$experienceStore14;
|
|
489
|
+
|
|
490
|
+
(_this$experienceStore13 = this.experienceStore) === null || _this$experienceStore13 === void 0 ? void 0 : _this$experienceStore13.start(EditorExperience.editSession);
|
|
491
|
+
(_this$experienceStore14 = this.experienceStore) === null || _this$experienceStore14 === void 0 ? void 0 : _this$experienceStore14.addMetadata(EditorExperience.editSession, {
|
|
492
|
+
reliabilityInterval: RELIABILITY_INTERVAL
|
|
493
|
+
});
|
|
494
|
+
});
|
|
476
495
|
const reliabilityEvent = {
|
|
477
496
|
action: ACTION.UFO_SESSION_COMPLETE,
|
|
478
497
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -483,14 +502,6 @@ export default class ReactEditorView extends React.Component {
|
|
|
483
502
|
};
|
|
484
503
|
this.dispatchAnalyticsEvent(reliabilityEvent);
|
|
485
504
|
}, RELIABILITY_INTERVAL);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
489
|
-
this.focusTimeoutId = handleEditorFocus(view);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
if (this.featureFlags.ufo) {
|
|
493
|
-
this.experienceStore = ExperienceStore.getInstance(view);
|
|
494
505
|
} // Force React to re-render so consumers get a reference to the editor view
|
|
495
506
|
|
|
496
507
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
2
2
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
3
3
|
import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
4
4
|
import { createFeatureFlagsFromProps } from '../plugins/feature-flags-context/feature-flags-from-props';
|
|
@@ -100,8 +100,6 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
100
100
|
*/
|
|
101
101
|
|
|
102
102
|
export default function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
103
|
-
var _props$featureFlags;
|
|
104
|
-
|
|
105
103
|
const appearance = props.appearance;
|
|
106
104
|
const isMobile = appearance === 'mobile';
|
|
107
105
|
const isComment = appearance === 'comment';
|
|
@@ -273,8 +271,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
273
271
|
if (props.allowPanel) {
|
|
274
272
|
preset.add([panelPlugin, {
|
|
275
273
|
useLongPressSelection: false,
|
|
276
|
-
|
|
277
|
-
|
|
274
|
+
allowCustomPanel: props.allowPanel.allowCustomPanel,
|
|
275
|
+
allowCustomPanelEdit: props.allowPanel.allowCustomPanelEdit
|
|
278
276
|
}]);
|
|
279
277
|
}
|
|
280
278
|
|
|
@@ -372,20 +370,38 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
372
370
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
373
371
|
}]);
|
|
374
372
|
|
|
375
|
-
|
|
373
|
+
const hasBeforePrimaryToolbar = components => {
|
|
374
|
+
if (components && 'before' in components) {
|
|
375
|
+
return !!components.before;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return false;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
382
|
+
preset.add([beforePrimaryToolbarPlugin, {
|
|
383
|
+
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
384
|
+
}]);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
376
388
|
preset.add([avatarGroupPlugin, {
|
|
377
|
-
collabEdit: props.collabEdit
|
|
389
|
+
collabEdit: props.collabEdit,
|
|
390
|
+
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
378
391
|
}]);
|
|
379
392
|
}
|
|
380
393
|
|
|
381
394
|
if (props.allowFindReplace) {
|
|
382
|
-
var _props$featureFlags2;
|
|
383
|
-
|
|
384
395
|
preset.add([findReplacePlugin, {
|
|
385
|
-
takeFullWidth: !!
|
|
396
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
397
|
+
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
386
398
|
}]);
|
|
387
399
|
}
|
|
388
400
|
|
|
401
|
+
if (props.UNSAFE_allowFragmentMark) {
|
|
402
|
+
preset.add(fragmentMarkPlugin);
|
|
403
|
+
}
|
|
404
|
+
|
|
389
405
|
if (featureFlags.enableViewUpdateSubscription) {
|
|
390
406
|
preset.add([viewUpdateSubscriptionPlugin]);
|
|
391
407
|
}
|
|
@@ -148,7 +148,7 @@ export default class ReactNodeView {
|
|
|
148
148
|
}, props)) : null;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
update(node, _decorations, validUpdate = () => true) {
|
|
151
|
+
update(node, _decorations, _innerDecorations, validUpdate = () => true) {
|
|
152
152
|
// @see https://github.com/ProseMirror/prosemirror/issues/648
|
|
153
153
|
const isValidUpdate = this.node.type === node.type && validUpdate(this.node, node);
|
|
154
154
|
|
|
@@ -80,6 +80,17 @@ export class SelectionBasedNodeView extends ReactNodeView {
|
|
|
80
80
|
return this.isSelectedNode(this.view.state.selection) || this.isSelectionInsideNode(from, to);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
+
_defineProperty(this, "nodeInsideSelection", () => {
|
|
84
|
+
const {
|
|
85
|
+
selection
|
|
86
|
+
} = this.view.state;
|
|
87
|
+
const {
|
|
88
|
+
from,
|
|
89
|
+
to
|
|
90
|
+
} = selection;
|
|
91
|
+
return this.isSelectedNode(selection) || this.isNodeInsideSelection(from, to);
|
|
92
|
+
});
|
|
93
|
+
|
|
83
94
|
_defineProperty(this, "onSelectionChange", () => {
|
|
84
95
|
this.update(this.node, []);
|
|
85
96
|
});
|
|
@@ -55,6 +55,7 @@ export let ACTION;
|
|
|
55
55
|
ACTION["INITIALISED"] = "initialised";
|
|
56
56
|
ACTION["INPUT_PERF_SAMPLING"] = "inputPerfSampling";
|
|
57
57
|
ACTION["INSERTED"] = "inserted";
|
|
58
|
+
ACTION["INVALID_DOCUMENT_ENCOUNTERED"] = "invalidDocumentEncountered";
|
|
58
59
|
ACTION["INVOKED"] = "invoked";
|
|
59
60
|
ACTION["LANGUAGE_SELECTED"] = "languageSelected";
|
|
60
61
|
ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
|
|
@@ -254,7 +254,7 @@ export const isSelectionValid = state => {
|
|
|
254
254
|
return AnnotationSelectionType.DISABLED;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
if (disallowOnWhitespace &&
|
|
257
|
+
if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection)) {
|
|
258
258
|
return AnnotationSelectionType.INVALID;
|
|
259
259
|
}
|
|
260
260
|
|
|
@@ -307,16 +307,27 @@ function isEmptyTextSelection(selection, schema) {
|
|
|
307
307
|
*/
|
|
308
308
|
|
|
309
309
|
|
|
310
|
-
export function
|
|
311
|
-
let
|
|
312
|
-
selection.content().content
|
|
310
|
+
export function hasInvalidWhitespaceNode(selection) {
|
|
311
|
+
let foundInvalidWhitespace = false;
|
|
312
|
+
const content = selection.content().content;
|
|
313
|
+
content.descendants(node => {
|
|
313
314
|
if (node.textContent.trim() === '') {
|
|
314
|
-
|
|
315
|
+
// Trailing new lines do not result in the annotation spanning into
|
|
316
|
+
// the trailing new line so can be ignored when looking for invalid
|
|
317
|
+
// whitespace nodes.
|
|
318
|
+
const nodeIsTrailingNewLine = // it is the final node
|
|
319
|
+
node.eq(content.lastChild) && // and there are multiple nodes
|
|
320
|
+
!node.eq(content.firstChild) && // and it is a paragraph node
|
|
321
|
+
node.type.name === 'paragraph';
|
|
322
|
+
|
|
323
|
+
if (!nodeIsTrailingNewLine) {
|
|
324
|
+
foundInvalidWhitespace = true;
|
|
325
|
+
}
|
|
315
326
|
}
|
|
316
327
|
|
|
317
|
-
return !
|
|
328
|
+
return !foundInvalidWhitespace;
|
|
318
329
|
});
|
|
319
|
-
return
|
|
330
|
+
return foundInvalidWhitespace;
|
|
320
331
|
}
|
|
321
332
|
/*
|
|
322
333
|
* verifies if node contains annotation mark
|
|
@@ -18,7 +18,8 @@ const avatarGroup = props => ({
|
|
|
18
18
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
19
19
|
editorView: editorView,
|
|
20
20
|
eventDispatcher: eventDispatcher,
|
|
21
|
-
collabEdit: props.collabEdit
|
|
21
|
+
collabEdit: props.collabEdit,
|
|
22
|
+
takeFullWidth: props.takeFullWidth
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -4,7 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../analytics';
|
|
5
5
|
const ToolbarButtonWrapper = styled.div`
|
|
6
6
|
display: flex;
|
|
7
|
-
flex-grow: 1;
|
|
7
|
+
flex-grow: ${props => props.takeFullWidth ? 1 : 0};
|
|
8
8
|
justify-content: flex-end;
|
|
9
9
|
align-items: center;
|
|
10
10
|
& > div {
|
|
@@ -29,7 +29,8 @@ export const AvatarGroupPluginWrapper = props => {
|
|
|
29
29
|
}, [dispatchAnalyticsEvent]);
|
|
30
30
|
return /*#__PURE__*/React.createElement(ToolbarButtonWrapper, {
|
|
31
31
|
"aria-label": "Editors",
|
|
32
|
-
"data-testid": 'avatar-group-in-plugin'
|
|
32
|
+
"data-testid": 'avatar-group-in-plugin',
|
|
33
|
+
takeFullWidth: props.takeFullWidth
|
|
33
34
|
}, /*#__PURE__*/React.createElement(AvatarsWithPluginState, {
|
|
34
35
|
editorView: props.editorView,
|
|
35
36
|
eventDispatcher: props.eventDispatcher,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BeforePrimaryToolbarWrapper } from './ui/BeforePrimaryToolbarWrapper';
|
|
3
|
+
|
|
4
|
+
const beforePrimaryToolbar = props => ({
|
|
5
|
+
name: 'beforePrimaryToolbar',
|
|
6
|
+
|
|
7
|
+
primaryToolbarComponent() {
|
|
8
|
+
return /*#__PURE__*/React.createElement(BeforePrimaryToolbarWrapper, {
|
|
9
|
+
beforePrimaryToolbarComponents: props.beforePrimaryToolbarComponents
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default beforePrimaryToolbar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const BeforePrimaryToolbarPluginWrapper = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
margin-right: 8px;
|
|
6
|
+
flex-grow: 1;
|
|
7
|
+
justify-content: flex-end;
|
|
8
|
+
align-items: center;
|
|
9
|
+
`;
|
|
10
|
+
export const BeforePrimaryToolbarWrapper = props => /*#__PURE__*/React.createElement(BeforePrimaryToolbarPluginWrapper, {
|
|
11
|
+
"data-testid": 'before-primary-toolbar-components-plugin'
|
|
12
|
+
}, props.beforePrimaryToolbarComponents);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fragment, Mark } from 'prosemirror-model';
|
|
2
|
+
import { NodeSelection } from 'prosemirror-state';
|
|
2
3
|
import { insertMacroFromMacroBrowser } from '../macro';
|
|
3
4
|
import { pluginKey as macroPluginKey } from '../macro/plugin-key';
|
|
4
5
|
import { setEditingContextToContextPanel } from './commands';
|
|
@@ -41,7 +42,7 @@ const extensionAPICallPayload = functionName => ({
|
|
|
41
42
|
|
|
42
43
|
export const createExtensionAPI = options => {
|
|
43
44
|
const doc = {
|
|
44
|
-
insertAfter: (localId, adf) => {
|
|
45
|
+
insertAfter: (localId, adf, opt) => {
|
|
45
46
|
const {
|
|
46
47
|
editorView
|
|
47
48
|
} = options;
|
|
@@ -86,7 +87,8 @@ export const createExtensionAPI = options => {
|
|
|
86
87
|
throw new Error('insertAfter(): Could not create a node for given ADFEntity.');
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
const insertPosition = nodePos.pos + nodePos.node.nodeSize;
|
|
91
|
+
tr.insert(insertPosition, newNode); // Validate if the document is valid at this point
|
|
90
92
|
|
|
91
93
|
try {
|
|
92
94
|
tr.doc.check();
|
|
@@ -129,6 +131,11 @@ export const createExtensionAPI = options => {
|
|
|
129
131
|
};
|
|
130
132
|
addAnalytics(state, tr, payload);
|
|
131
133
|
});
|
|
134
|
+
|
|
135
|
+
if (opt && opt.allowSelectionToNewNode) {
|
|
136
|
+
tr.setSelection(new NodeSelection(tr.doc.resolve(insertPosition)));
|
|
137
|
+
}
|
|
138
|
+
|
|
132
139
|
dispatch(tr);
|
|
133
140
|
},
|
|
134
141
|
scrollTo: localId => {
|
|
@@ -6,7 +6,7 @@ import { browser } from '@atlaskit/editor-common';
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export function createFeatureFlagsFromProps(props) {
|
|
9
|
-
var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
|
|
9
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31;
|
|
10
10
|
|
|
11
11
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
12
12
|
return { ...normalizedFeatureFlags,
|
|
@@ -19,6 +19,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
19
19
|
findReplaceMatchCase: typeof props.allowFindReplace === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
|
|
20
20
|
keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
|
|
21
21
|
addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
|
|
22
|
+
singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
22
23
|
undoRedoButtons: props.UNSAFE_allowUndoRedoButtons,
|
|
23
24
|
catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
|
|
24
25
|
nextEmojiNodeView: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.nextEmojiNodeView) === true,
|
|
@@ -37,6 +38,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
37
38
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.collabAvatarScroll) : false),
|
|
38
39
|
ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
|
|
39
40
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
|
|
40
|
-
|
|
41
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.twoLineEditorToolbar) : false),
|
|
42
|
+
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true)
|
|
41
43
|
};
|
|
42
44
|
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { findReplacePluginKey } from './types';
|
|
3
|
+
import WithPluginState from '../../ui/WithPluginState';
|
|
4
|
+
import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
|
|
5
|
+
import { blur, toggleMatchCase } from './commands';
|
|
6
|
+
import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
|
|
7
|
+
import { TRIGGER_METHOD } from '../analytics';
|
|
8
|
+
import { getFeatureFlags } from '../feature-flags-context';
|
|
9
|
+
|
|
10
|
+
const FindReplaceToolbarButtonWithState = props => {
|
|
11
|
+
const {
|
|
12
|
+
popupsBoundariesElement,
|
|
13
|
+
popupsMountPoint,
|
|
14
|
+
popupsScrollableElement,
|
|
15
|
+
isToolbarReducedSpacing,
|
|
16
|
+
editorView,
|
|
17
|
+
containerElement,
|
|
18
|
+
dispatchAnalyticsEvent
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
if (!editorView) {
|
|
22
|
+
return null;
|
|
23
|
+
} // we need the editor to be in focus for scrollIntoView() to work
|
|
24
|
+
// so we focus it while we run the command, then put focus back into
|
|
25
|
+
// whatever element was previously focused in find replace component
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const runWithEditorFocused = fn => {
|
|
29
|
+
const activeElement = document.activeElement;
|
|
30
|
+
editorView.focus();
|
|
31
|
+
fn();
|
|
32
|
+
activeElement === null || activeElement === void 0 ? void 0 : activeElement.focus();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const dispatchCommand = cmd => {
|
|
36
|
+
const {
|
|
37
|
+
state,
|
|
38
|
+
dispatch
|
|
39
|
+
} = editorView;
|
|
40
|
+
cmd(state, dispatch);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const handleActivate = () => {
|
|
44
|
+
runWithEditorFocused(() => dispatchCommand(activateWithAnalytics({
|
|
45
|
+
triggerMethod: TRIGGER_METHOD.TOOLBAR
|
|
46
|
+
})));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleFind = keyword => {
|
|
50
|
+
runWithEditorFocused(() => dispatchCommand(findWithAnalytics({
|
|
51
|
+
editorView,
|
|
52
|
+
containerElement,
|
|
53
|
+
keyword
|
|
54
|
+
})));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleFindNext = ({
|
|
58
|
+
triggerMethod
|
|
59
|
+
}) => {
|
|
60
|
+
runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics({
|
|
61
|
+
triggerMethod
|
|
62
|
+
})));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleFindPrev = ({
|
|
66
|
+
triggerMethod
|
|
67
|
+
}) => {
|
|
68
|
+
runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics({
|
|
69
|
+
triggerMethod
|
|
70
|
+
})));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const handleReplace = ({
|
|
74
|
+
triggerMethod,
|
|
75
|
+
replaceText
|
|
76
|
+
}) => {
|
|
77
|
+
runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics({
|
|
78
|
+
triggerMethod,
|
|
79
|
+
replaceText
|
|
80
|
+
})));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleReplaceAll = ({
|
|
84
|
+
replaceText
|
|
85
|
+
}) => {
|
|
86
|
+
runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics({
|
|
87
|
+
replaceText
|
|
88
|
+
})));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const handleFindBlur = () => {
|
|
92
|
+
dispatchCommand(blur());
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const handleCancel = ({
|
|
96
|
+
triggerMethod
|
|
97
|
+
}) => {
|
|
98
|
+
dispatchCommand(cancelSearchWithAnalytics({
|
|
99
|
+
triggerMethod
|
|
100
|
+
}));
|
|
101
|
+
editorView.focus();
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const handleToggleMatchCase = () => {
|
|
105
|
+
dispatchCommand(toggleMatchCase());
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const {
|
|
109
|
+
findReplaceMatchCase
|
|
110
|
+
} = getFeatureFlags(editorView.state);
|
|
111
|
+
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
112
|
+
debounce: false,
|
|
113
|
+
plugins: {
|
|
114
|
+
findReplaceState: findReplacePluginKey
|
|
115
|
+
},
|
|
116
|
+
render: ({
|
|
117
|
+
findReplaceState
|
|
118
|
+
}) => {
|
|
119
|
+
if (!findReplaceState) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
|
|
124
|
+
allowMatchCase: findReplaceMatchCase,
|
|
125
|
+
shouldMatchCase: findReplaceState.shouldMatchCase,
|
|
126
|
+
onToggleMatchCase: handleToggleMatchCase,
|
|
127
|
+
isActive: findReplaceState.isActive,
|
|
128
|
+
findText: findReplaceState.findText,
|
|
129
|
+
index: findReplaceState.index,
|
|
130
|
+
numMatches: findReplaceState.matches.length,
|
|
131
|
+
replaceText: findReplaceState.replaceText,
|
|
132
|
+
shouldFocus: findReplaceState.shouldFocus,
|
|
133
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
134
|
+
popupsMountPoint: popupsMountPoint,
|
|
135
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
136
|
+
isReducedSpacing: !!isToolbarReducedSpacing,
|
|
137
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
138
|
+
onFindBlur: handleFindBlur,
|
|
139
|
+
onCancel: handleCancel,
|
|
140
|
+
onActivate: handleActivate,
|
|
141
|
+
onFind: handleFind,
|
|
142
|
+
onFindNext: handleFindNext,
|
|
143
|
+
onFindPrev: handleFindPrev,
|
|
144
|
+
onReplace: handleReplace,
|
|
145
|
+
onReplaceAll: handleReplaceAll,
|
|
146
|
+
takeFullWidth: !!props.takeFullWidth
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export default FindReplaceToolbarButtonWithState;
|