@atlaskit/editor-core 178.0.1 → 178.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/cjs/create-editor/create-plugins-list.js +3 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +26 -13
- package/dist/cjs/plugins/annotation/index.js +4 -2
- package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +6 -2
- package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +8 -1
- package/dist/cjs/plugins/block-type/commands/delete-block-content.js +53 -0
- package/dist/cjs/plugins/block-type/commands/index.js +9 -1
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +8 -4
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -3
- package/dist/cjs/plugins/card/pm-plugins/doc.js +21 -4
- package/dist/cjs/plugins/card/toolbar.js +4 -2
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +4 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +16 -9
- package/dist/cjs/plugins/collab-edit/actions.js +1 -1
- package/dist/cjs/plugins/collab-edit/index.js +1 -1
- package/dist/cjs/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +5 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Select.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +18 -9
- package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -0
- package/dist/cjs/plugins/hyperlink/index.js +2 -1
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +15 -2
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +27 -22
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +6 -2
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/cjs/plugins/list/styles.js +1 -1
- package/dist/cjs/plugins/media/commands/helpers.js +24 -2
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +14 -16
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +232 -183
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +1 -3
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/keymap.js +46 -0
- package/dist/cjs/plugins/rank.js +3 -2
- package/dist/cjs/plugins/selection/pm-plugins/events/create-selection-between.js +86 -0
- package/dist/cjs/plugins/selection/pm-plugins/events/keydown.js +84 -0
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +6 -56
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +7 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +4 -2
- package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +22 -61
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +22 -56
- package/dist/cjs/ui/Addon/click-area-helper.js +28 -6
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +2 -1
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +22 -9
- package/dist/cjs/utils/document.js +11 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +3 -1
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +28 -13
- package/dist/es2019/plugins/annotation/index.js +4 -2
- package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +6 -2
- package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +8 -1
- package/dist/es2019/plugins/block-type/commands/delete-block-content.js +49 -0
- package/dist/es2019/plugins/block-type/commands/index.js +2 -1
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +3 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +8 -4
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/es2019/plugins/card/pm-plugins/doc.js +19 -3
- package/dist/es2019/plugins/card/toolbar.js +4 -2
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +5 -2
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +15 -9
- package/dist/es2019/plugins/collab-edit/actions.js +1 -1
- package/dist/es2019/plugins/collab-edit/index.js +1 -1
- package/dist/es2019/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +5 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Select.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +18 -9
- package/dist/es2019/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -0
- package/dist/es2019/plugins/hyperlink/index.js +2 -1
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +11 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -5
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +6 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/es2019/plugins/list/styles.js +15 -11
- package/dist/es2019/plugins/media/commands/helpers.js +18 -1
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +14 -16
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +37 -13
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +1 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/keymap.js +45 -0
- package/dist/es2019/plugins/rank.js +3 -2
- package/dist/es2019/plugins/selection/pm-plugins/events/create-selection-between.js +79 -0
- package/dist/es2019/plugins/selection/pm-plugins/events/keydown.js +77 -0
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +5 -55
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +6 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +3 -2
- package/dist/es2019/ui/Addon/ClickAreaBlock/index.js +20 -31
- package/dist/es2019/ui/Addon/ClickAreaInline/index.js +20 -27
- package/dist/es2019/ui/Addon/click-area-helper.js +28 -6
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +2 -1
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +22 -9
- package/dist/es2019/utils/document.js +9 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +3 -1
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +26 -13
- package/dist/esm/plugins/annotation/index.js +4 -2
- package/dist/esm/plugins/annotation/ui/InlineCommentView.js +6 -2
- package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +8 -1
- package/dist/esm/plugins/block-type/commands/delete-block-content.js +46 -0
- package/dist/esm/plugins/block-type/commands/index.js +2 -1
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +3 -3
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +8 -4
- package/dist/esm/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/esm/plugins/card/pm-plugins/doc.js +20 -3
- package/dist/esm/plugins/card/toolbar.js +4 -2
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +5 -2
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +16 -9
- package/dist/esm/plugins/collab-edit/actions.js +1 -1
- package/dist/esm/plugins/collab-edit/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +5 -0
- package/dist/esm/plugins/floating-toolbar/ui/Select.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +18 -9
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -0
- package/dist/esm/plugins/hyperlink/index.js +2 -1
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +15 -3
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +27 -22
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +6 -2
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/esm/plugins/list/styles.js +1 -1
- package/dist/esm/plugins/media/commands/helpers.js +20 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +14 -16
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +235 -184
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +1 -2
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/keymap.js +45 -0
- package/dist/esm/plugins/rank.js +3 -2
- package/dist/esm/plugins/selection/pm-plugins/events/create-selection-between.js +76 -0
- package/dist/esm/plugins/selection/pm-plugins/events/keydown.js +74 -0
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +4 -57
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +7 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +4 -2
- package/dist/esm/ui/Addon/ClickAreaBlock/index.js +17 -58
- package/dist/esm/ui/Addon/ClickAreaInline/index.js +17 -53
- package/dist/esm/ui/Addon/click-area-helper.js +28 -6
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +2 -1
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +22 -9
- package/dist/esm/utils/document.js +11 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +1 -1
- package/dist/types/plugins/block-type/commands/delete-block-content.d.ts +10 -0
- package/dist/types/plugins/block-type/commands/index.d.ts +1 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +6 -1
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +1 -0
- package/dist/types/plugins/media/nodeviews/__mocks__/mediaNodeUpdater.d.ts +1 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +3 -1
- package/dist/types/plugins/media/types.d.ts +2 -0
- package/dist/types/plugins/selection/pm-plugins/events/create-selection-between.d.ts +4 -0
- package/dist/types/plugins/selection/pm-plugins/events/keydown.d.ts +2 -0
- package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +2 -5
- package/dist/types/ui/Addon/ClickAreaInline/index.d.ts +2 -5
- package/dist/types/ui/Addon/click-area-helper.d.ts +1 -1
- package/dist/types/ui/Alignment/AlignmentButton/index.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +1 -0
- package/docs/0-intro.tsx +9 -0
- package/package.json +17 -19
- package/report.api.md +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 178.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`59e998e408f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/59e998e408f) - [ESS-2914] Switch to the forked prosemirror-collab library (based on version 1.3.0) to filter out analytics steps
|
|
8
|
+
- [`a0a35fe7fb1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a0a35fe7fb1) - Renaming contentComponent event subject to contentComponentv2. Move errorStack attribute to nonPrivacySafeAttributes
|
|
9
|
+
- [`4f6a895f1d5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4f6a895f1d5) - [ux] Editor Node Block selection stabilization
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`513cb2010b7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/513cb2010b7) - Users are able to select dropdown menu item using keyboard via the Enter key
|
|
14
|
+
- [`f1a780414ae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1a780414ae) - prevent ReactNodeViewState to trigger selection updates when selection hasn't changed
|
|
15
|
+
- [`2f5a0f96c6d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2f5a0f96c6d) - Adds invokeMethod analytics context for link picker.
|
|
16
|
+
- [`aaa6509f036`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aaa6509f036) - ED-16198 Update & restore dedupeMarksTransformed analytics event. Also addresses
|
|
17
|
+
a bug when `discardedMarks` would only return the latest discarded mark
|
|
18
|
+
- [`36d661f9252`](https://bitbucket.org/atlassian/atlassian-frontend/commits/36d661f9252) - [WS-4504] Fix Editor hijacking click events inside Annotation components
|
|
19
|
+
- [`af4ab0d3e60`](https://bitbucket.org/atlassian/atlassian-frontend/commits/af4ab0d3e60) - [ux] Fix for a regression issue where a link is the last node in the ADF and a user is trying to switch from 'block' to 'embed' view or vice versa.
|
|
20
|
+
- [`9a36555eac5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a36555eac5) - [ux] ED-15773 InsertMenu in Toolbar should not display "View More" option when editorProp `showModal` is set to false. Although this is happening, currently the "View More" button is replaced with "Status" option and retaining the same look and feel.
|
|
21
|
+
This ticket is to remove the look and feel of "View More" option when `showModal` is set to false.
|
|
22
|
+
- [`fd12b01c877`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd12b01c877) - Clear text button should still work without activity provider
|
|
23
|
+
- [`8da99a328df`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8da99a328df) - [ux] This changes the behaviour of changing the appearance of a Smart Link or Smart Card.
|
|
24
|
+
|
|
25
|
+
1. Previously, upon changing the appearance of a Smart Link, the cursor would move to _before_ the Smart Link. Now, the cursor will be placed after the Smart Link. In the case of Block Card and Embed, the cursor will be placed one paragraph after the Block or Embed card (due to Block and Embed being a "block" node).
|
|
26
|
+
2. When changing an inline or hyperlink into a Block or Embed card (i.e. a block node) there will no longer be a new paragraph inserted before the Block or Embed card.
|
|
27
|
+
|
|
28
|
+
- [`a6f514af105`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a6f514af105) - [ux] ED-16077 fix deleteRange deleting parent node when it shouldn't. Use tr.delete instead of tr.deleteRange because deleteRange would grow the selection to include the parent.
|
|
29
|
+
- [`db7602d84c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/db7602d84c9) - [ux] ED-16527 - Fixed issue where pressing 'Esc' while a Floating Toolbar Select menu was open would focus editor instead of the Floating Toolbar
|
|
30
|
+
- [`8d798b78505`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d798b78505) - Media Group no longer tries to update all Media nodes, but only the ones that belong to it.
|
|
31
|
+
- [`7cc0f5b5dad`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cc0f5b5dad) - Remove unused @atlaskit/activity dependency
|
|
32
|
+
- [`a5dcaef4136`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a5dcaef4136) - [ux] Fixed keyboard navigation issues relating to the main editor toolbar and floating toolbars.
|
|
33
|
+
- [`70ec535a1c6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/70ec535a1c6) - [ux] A fix for the usage of editor props 'allowBlockCards' & 'allowEmbeds'. Previously even if the prop 'allowBlockCards' was passed to editor as false, the toolbar would still allow switching to a block card option.
|
|
34
|
+
- [`5ac1c18bd04`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5ac1c18bd04) - [ux] Fix selection blocking issue where user cannot left/right arrow key past a mediaSingle
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
37
|
+
## 178.0.2
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [`2ff1c66a6ab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ff1c66a6ab) - [ux] ED-16490 fixed bug so big margin will not occur before a Decision node in Renderer on iOS
|
|
42
|
+
|
|
3
43
|
## 178.0.1
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
|
@@ -206,6 +206,7 @@ function createPluginsList(props, prevProps, createAnalyticsEvent, insertNodeAPI
|
|
|
206
206
|
allowDropzoneDropLine: isFullPage,
|
|
207
207
|
allowMediaSingleEditable: !isMobile,
|
|
208
208
|
allowRemoteDimensionsFetch: !isMobile,
|
|
209
|
+
editorSelectionAPI: editorSelectionAPI,
|
|
209
210
|
// This is a wild one. I didnt quite understand what the code was doing
|
|
210
211
|
// so a bit of guess for now.
|
|
211
212
|
allowMarkingUploadsAsIncomplete: isMobile,
|
|
@@ -282,7 +283,8 @@ function createPluginsList(props, prevProps, createAnalyticsEvent, insertNodeAPI
|
|
|
282
283
|
disableLayout: true
|
|
283
284
|
},
|
|
284
285
|
allowMediaGroup: false,
|
|
285
|
-
isCopyPasteEnabled: true
|
|
286
|
+
isCopyPasteEnabled: true,
|
|
287
|
+
editorSelectionAPI: editorSelectionAPI
|
|
286
288
|
}]);
|
|
287
289
|
}
|
|
288
290
|
}
|
|
@@ -64,8 +64,10 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
64
64
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
65
65
|
isOpen: false
|
|
66
66
|
});
|
|
67
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeAlignment", function (align) {
|
|
68
|
-
|
|
67
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeAlignment", function (align, togglePopup) {
|
|
68
|
+
if (togglePopup) {
|
|
69
|
+
_this.toggleOpen();
|
|
70
|
+
}
|
|
69
71
|
|
|
70
72
|
return _this.props.changeAlignment(align);
|
|
71
73
|
});
|
|
@@ -94,11 +96,10 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
});
|
|
97
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
99
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideOnEscape", function () {
|
|
98
100
|
var _this$toolbarItemRef2, _this$toolbarItemRef3;
|
|
99
101
|
|
|
100
|
-
_this.hide();
|
|
101
|
-
|
|
102
|
+
_this.hide();
|
|
102
103
|
|
|
103
104
|
(_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 ? void 0 : (_this$toolbarItemRef3 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef3 === void 0 ? void 0 : _this$toolbarItemRef3.focus();
|
|
104
105
|
});
|
|
@@ -127,17 +128,29 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
127
128
|
boundariesElement: popupsBoundariesElement,
|
|
128
129
|
scrollableElement: popupsScrollableElement,
|
|
129
130
|
isOpen: isOpen,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
onOpenChange: function onOpenChange(_ref2) {
|
|
132
|
+
var _this2$toolbarItemRef, _this2$toolbarItemRef2;
|
|
133
|
+
|
|
134
|
+
var isOpen = _ref2.isOpen;
|
|
135
|
+
|
|
136
|
+
_this2.setState({
|
|
137
|
+
isOpen: isOpen
|
|
134
138
|
});
|
|
139
|
+
|
|
140
|
+
(_this2$toolbarItemRef = _this2.toolbarItemRef) === null || _this2$toolbarItemRef === void 0 ? void 0 : (_this2$toolbarItemRef2 = _this2$toolbarItemRef.current) === null || _this2$toolbarItemRef2 === void 0 ? void 0 : _this2$toolbarItemRef2.focus();
|
|
141
|
+
},
|
|
142
|
+
handleClickOutside: function handleClickOutside(event) {
|
|
143
|
+
if (event instanceof MouseEvent) {
|
|
144
|
+
_this2.hide({
|
|
145
|
+
isOpen: false,
|
|
146
|
+
event: event
|
|
147
|
+
});
|
|
148
|
+
}
|
|
135
149
|
},
|
|
136
|
-
handleEscapeKeydown: this.
|
|
137
|
-
onOpenChange: this.hide,
|
|
150
|
+
handleEscapeKeydown: this.hideOnEscape,
|
|
138
151
|
fitWidth: 112,
|
|
139
152
|
fitHeight: 80,
|
|
140
|
-
|
|
153
|
+
closeOnTab: true,
|
|
141
154
|
trigger: (0, _react2.jsx)(_ToolbarButton.default, {
|
|
142
155
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
143
156
|
disabled: disabled,
|
|
@@ -161,7 +174,7 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
161
174
|
})
|
|
162
175
|
}, (0, _react2.jsx)(_Alignment.default, {
|
|
163
176
|
onClick: function onClick(align) {
|
|
164
|
-
return _this2.changeAlignment(align);
|
|
177
|
+
return _this2.changeAlignment(align, false);
|
|
165
178
|
},
|
|
166
179
|
selectedAlignment: pluginState.align
|
|
167
180
|
})), (0, _react2.jsx)("span", {
|
|
@@ -106,11 +106,13 @@ var annotationPlugin = function annotationPlugin(annotationProviders) {
|
|
|
106
106
|
return null;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
109
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
"data-editor-popup": "true"
|
|
111
|
+
}, /*#__PURE__*/_react.default.createElement(_InlineCommentView.InlineCommentView, {
|
|
110
112
|
providers: annotationProviders,
|
|
111
113
|
editorView: editorView,
|
|
112
114
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
113
|
-
});
|
|
115
|
+
}));
|
|
114
116
|
}
|
|
115
117
|
});
|
|
116
118
|
}
|
|
@@ -77,7 +77,9 @@ function InlineCommentView(_ref) {
|
|
|
77
77
|
selection: selection.toJSON(),
|
|
78
78
|
position: position,
|
|
79
79
|
docSize: editorView.state.doc.nodeSize,
|
|
80
|
-
error: error.toString()
|
|
80
|
+
error: error.toString()
|
|
81
|
+
},
|
|
82
|
+
nonPrivacySafeAttributes: {
|
|
81
83
|
errorStack: error.stack || undefined
|
|
82
84
|
}
|
|
83
85
|
};
|
|
@@ -98,7 +100,8 @@ function InlineCommentView(_ref) {
|
|
|
98
100
|
|
|
99
101
|
var textSelection = state.doc.textBetween(selection.from, selection.to);
|
|
100
102
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
"data-testid": _types.AnnotationTestIds.floatingComponent
|
|
103
|
+
"data-testid": _types.AnnotationTestIds.floatingComponent,
|
|
104
|
+
"data-editor-popup": "true"
|
|
102
105
|
}, /*#__PURE__*/_react.default.createElement(CreateComponent, {
|
|
103
106
|
dom: dom,
|
|
104
107
|
textSelection: textSelection,
|
|
@@ -145,6 +148,7 @@ function InlineCommentView(_ref) {
|
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
return /*#__PURE__*/_react.default.createElement(_AnnotationViewWrapper.AnnotationViewWrapper, {
|
|
151
|
+
"data-editor-popup": "true",
|
|
148
152
|
"data-testid": _types.AnnotationTestIds.floatingComponent,
|
|
149
153
|
key: (0, _utils.getAnnotationViewKey)(activeAnnotations),
|
|
150
154
|
onViewed: onAnnotationViewed
|
|
@@ -62,12 +62,19 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
62
62
|
key: stateKey,
|
|
63
63
|
view: function view(_view) {
|
|
64
64
|
var pluginState = stateKey.getState(_view.state);
|
|
65
|
+
var prevFrom = -1;
|
|
66
|
+
var prevTo = -1;
|
|
65
67
|
return {
|
|
66
68
|
update: function update(view) {
|
|
67
69
|
var _view$state$selection = view.state.selection,
|
|
68
70
|
from = _view$state$selection.from,
|
|
69
71
|
to = _view$state$selection.to;
|
|
70
|
-
|
|
72
|
+
|
|
73
|
+
if (from !== prevFrom || to !== prevTo) {
|
|
74
|
+
pluginState.notifyNewSelection(from, to);
|
|
75
|
+
prevFrom = from;
|
|
76
|
+
prevTo = to;
|
|
77
|
+
}
|
|
71
78
|
}
|
|
72
79
|
};
|
|
73
80
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.deleteBlockContent = deleteBlockContent;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Prevent removing the block when deleting block content
|
|
10
|
+
*
|
|
11
|
+
* @param state EditorState<any>
|
|
12
|
+
* @param dispatch CommandDispatch
|
|
13
|
+
* @returns boolean
|
|
14
|
+
*/
|
|
15
|
+
function deleteBlockContent(isNodeAWrappingBlockNode) {
|
|
16
|
+
return function (state, dispatch) {
|
|
17
|
+
var tr = state.tr,
|
|
18
|
+
_state$selection = state.selection,
|
|
19
|
+
$from = _state$selection.$from,
|
|
20
|
+
$to = _state$selection.$to,
|
|
21
|
+
doc = state.doc;
|
|
22
|
+
|
|
23
|
+
if ($from.pos === $to.pos) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var selectionCrossesWrappingBlockNode = false;
|
|
28
|
+
doc.nodesBetween($from.pos, $to.pos, function (node, pos) {
|
|
29
|
+
// Optimisation. If selection crosses wrapping block node
|
|
30
|
+
// short circuit the loop by returning false
|
|
31
|
+
if (selectionCrossesWrappingBlockNode) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (isNodeAWrappingBlockNode(node)) {
|
|
36
|
+
selectionCrossesWrappingBlockNode = true;
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (!selectionCrossesWrappingBlockNode) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
tr.delete($from.pos, $to.pos);
|
|
46
|
+
|
|
47
|
+
if (dispatch) {
|
|
48
|
+
dispatch(tr);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "deleteAndMoveCursor", {
|
|
|
15
15
|
return _deleteAndMoveCursor.deleteAndMoveCursor;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "deleteBlockContent", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _deleteBlockContent.deleteBlockContent;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "insertBlock", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
@@ -88,4 +94,6 @@ var _insertBlock = require("./insert-block");
|
|
|
88
94
|
|
|
89
95
|
var _transformToCodeBlock = require("./transform-to-code-block");
|
|
90
96
|
|
|
91
|
-
var _deleteAndMoveCursor = require("./delete-and-move-cursor");
|
|
97
|
+
var _deleteAndMoveCursor = require("./delete-and-move-cursor");
|
|
98
|
+
|
|
99
|
+
var _deleteBlockContent = require("./delete-block-content");
|
|
@@ -31,8 +31,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
31
31
|
|
|
32
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
33
|
|
|
34
|
-
var backspace = (0, _prosemirrorCommands.chainCommands)(_commands2.cleanUpAtTheStartOfDocument, _commands2.deleteAndMoveCursor);
|
|
35
|
-
var del = (0, _prosemirrorCommands.chainCommands)((0, _commands3.deleteEmptyParagraphAndMoveBlockUp)(_utils.isNodeAWrappingBlockNode), _commands2.deleteAndMoveCursor);
|
|
34
|
+
var backspace = (0, _prosemirrorCommands.chainCommands)(_commands2.cleanUpAtTheStartOfDocument, (0, _commands2.deleteBlockContent)(_utils.isNodeAWrappingBlockNode), _commands2.deleteAndMoveCursor);
|
|
35
|
+
var del = (0, _prosemirrorCommands.chainCommands)((0, _commands3.deleteEmptyParagraphAndMoveBlockUp)(_utils.isNodeAWrappingBlockNode), (0, _commands2.deleteBlockContent)(_utils.isNodeAWrappingBlockNode), _commands2.deleteAndMoveCursor);
|
|
36
36
|
|
|
37
37
|
function keymapPlugin(schema, featureFlags) {
|
|
38
38
|
var list = {};
|
|
@@ -107,14 +107,18 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
107
107
|
}];
|
|
108
108
|
});
|
|
109
109
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSelectBlockType", function (_ref) {
|
|
110
|
-
var item = _ref.item
|
|
110
|
+
var item = _ref.item,
|
|
111
|
+
_ref$shouldCloseMenu = _ref.shouldCloseMenu,
|
|
112
|
+
shouldCloseMenu = _ref$shouldCloseMenu === void 0 ? true : _ref$shouldCloseMenu;
|
|
111
113
|
var blockType = item.value;
|
|
112
114
|
|
|
113
115
|
_this.props.setBlockType(blockType.name);
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
if (shouldCloseMenu) {
|
|
118
|
+
_this.setState({
|
|
119
|
+
active: false
|
|
120
|
+
});
|
|
121
|
+
}
|
|
118
122
|
});
|
|
119
123
|
return _this;
|
|
120
124
|
}
|
|
@@ -157,7 +157,7 @@ var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
157
157
|
value: function createDomRef() {
|
|
158
158
|
var domRef = document.createElement('div');
|
|
159
159
|
|
|
160
|
-
if (
|
|
160
|
+
if (this.reactComponentProps.platform !== 'mobile') {
|
|
161
161
|
// workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
|
|
162
162
|
// see also: https://github.com/ProseMirror/prosemirror/issues/884
|
|
163
163
|
domRef.contentEditable = 'true';
|
|
@@ -37,8 +37,6 @@ var _genericCard = require("./genericCard");
|
|
|
37
37
|
|
|
38
38
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
39
39
|
|
|
40
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
41
|
-
|
|
42
40
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
43
41
|
|
|
44
42
|
var _nodeviews = require("../../../nodeviews/");
|
|
@@ -384,7 +382,7 @@ var EmbedCard = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
384
382
|
value: function createDomRef() {
|
|
385
383
|
var domRef = document.createElement('div');
|
|
386
384
|
|
|
387
|
-
if (
|
|
385
|
+
if (this.reactComponentProps.platform !== 'mobile') {
|
|
388
386
|
// workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
|
|
389
387
|
// see also: https://github.com/ProseMirror/prosemirror/issues/884
|
|
390
388
|
domRef.contentEditable = 'true';
|
|
@@ -11,10 +11,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
|
|
14
|
-
var _prosemirrorHistory = require("prosemirror-history");
|
|
15
|
-
|
|
16
14
|
var _prosemirrorState = require("prosemirror-state");
|
|
17
15
|
|
|
16
|
+
var _prosemirrorHistory = require("prosemirror-history");
|
|
17
|
+
|
|
18
18
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
19
19
|
|
|
20
20
|
var _analytics = require("../../../plugins/analytics");
|
|
@@ -367,6 +367,8 @@ exports.changeSelectedCardToText = changeSelectedCardToText;
|
|
|
367
367
|
|
|
368
368
|
var setSelectedCardAppearance = function setSelectedCardAppearance(appearance) {
|
|
369
369
|
return function (state, dispatch) {
|
|
370
|
+
var _previousNode$type;
|
|
371
|
+
|
|
370
372
|
var selectedNode = state.selection instanceof _prosemirrorState.NodeSelection && state.selection.node;
|
|
371
373
|
|
|
372
374
|
if (!selectedNode) {
|
|
@@ -389,9 +391,24 @@ var setSelectedCardAppearance = function setSelectedCardAppearance(appearance) {
|
|
|
389
391
|
var attrs = isEmbed ? _objectSpread(_objectSpread({}, selectedNode.attrs), {}, {
|
|
390
392
|
layout: 'center'
|
|
391
393
|
}) : selectedNode.attrs;
|
|
392
|
-
var
|
|
394
|
+
var _state$selection = state.selection,
|
|
395
|
+
from = _state$selection.from,
|
|
396
|
+
to = _state$selection.to;
|
|
393
397
|
var nodeType = getLinkNodeType(appearance, state.schema.nodes);
|
|
394
|
-
var tr = state.tr.setNodeMarkup(from, nodeType, attrs, selectedNode.marks);
|
|
398
|
+
var tr = state.tr.setNodeMarkup(from, nodeType, attrs, selectedNode.marks); // When the selected card is the last element in the doc we add a new paragraph after it for consistent replacement
|
|
399
|
+
|
|
400
|
+
if (tr.doc.nodeSize - 2 === to) {
|
|
401
|
+
tr.insertText(' ', to);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
tr.setSelection(_prosemirrorState.TextSelection.create(tr.doc, to + 1));
|
|
405
|
+
var previousNodePos = from - 1 > 0 ? from - 1 : 0;
|
|
406
|
+
var previousNode = tr.doc.nodeAt(previousNodePos);
|
|
407
|
+
|
|
408
|
+
if ((previousNode === null || previousNode === void 0 ? void 0 : (_previousNode$type = previousNode.type) === null || _previousNode$type === void 0 ? void 0 : _previousNode$type.name) === 'paragraph') {
|
|
409
|
+
tr.delete(previousNodePos, from);
|
|
410
|
+
}
|
|
411
|
+
|
|
395
412
|
(0, _analytics.addAnalytics)(state, tr, {
|
|
396
413
|
action: _analytics.ACTION.CHANGED_TYPE,
|
|
397
414
|
actionSubject: _analytics.ACTION_SUBJECT.SMART_LINK,
|
|
@@ -306,9 +306,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
var allowBlockCards = cardOptions.allowBlockCards,
|
|
309
|
-
allowEmbeds = cardOptions.allowEmbeds;
|
|
309
|
+
allowEmbeds = cardOptions.allowEmbeds; // This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
310
|
+
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
310
311
|
|
|
311
|
-
if (
|
|
312
|
+
if (currentAppearance) {
|
|
312
313
|
toolbarItems.unshift({
|
|
313
314
|
type: 'custom',
|
|
314
315
|
fallback: [],
|
|
@@ -321,6 +322,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
321
322
|
editorView: editorView,
|
|
322
323
|
editorState: state,
|
|
323
324
|
allowEmbeds: allowEmbeds,
|
|
325
|
+
allowBlockCards: allowBlockCards,
|
|
324
326
|
platform: platform
|
|
325
327
|
});
|
|
326
328
|
}
|
|
@@ -84,7 +84,10 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
84
84
|
linkPickerOptions: linkPickerOptions,
|
|
85
85
|
providerFactory: providerFactory,
|
|
86
86
|
displayUrl: url,
|
|
87
|
-
displayText: text
|
|
87
|
+
displayText: text // Assumes that the smart card link picker can only ever be invoked by clicking "edit"
|
|
88
|
+
// via the floating toolbar
|
|
89
|
+
,
|
|
90
|
+
invokeMethod: _analytics.INPUT_METHOD.FLOATING_TB,
|
|
88
91
|
onSubmit: function onSubmit(href, title, displayText) {
|
|
89
92
|
_this.hideLinkToolbar();
|
|
90
93
|
|
|
@@ -65,6 +65,8 @@ var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
65
65
|
currentAppearance = _this$props.currentAppearance,
|
|
66
66
|
editorState = _this$props.editorState,
|
|
67
67
|
allowEmbeds = _this$props.allowEmbeds,
|
|
68
|
+
_this$props$allowBloc = _this$props.allowBlockCards,
|
|
69
|
+
allowBlockCards = _this$props$allowBloc === void 0 ? true : _this$props$allowBloc,
|
|
68
70
|
platform = _this$props.platform;
|
|
69
71
|
var preview = allowEmbeds && cardContext && url && cardContext.extractors.getPreview(url, platform);
|
|
70
72
|
|
|
@@ -78,7 +80,7 @@ var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
|
|
81
|
-
var isBlockCardLinkSupportedInParent = (0, _nodes.isSupportedInParent)(editorState, _prosemirrorModel.Fragment.from(editorState.schema.nodes.blockCard.createChecked({})), currentAppearance);
|
|
83
|
+
var isBlockCardLinkSupportedInParent = allowBlockCards ? (0, _nodes.isSupportedInParent)(editorState, _prosemirrorModel.Fragment.from(editorState.schema.nodes.blockCard.createChecked({})), currentAppearance) : false;
|
|
82
84
|
var isEmbedCardLinkSupportedInParent = allowEmbeds ? (0, _nodes.isSupportedInParent)(editorState, _prosemirrorModel.Fragment.from(editorState.schema.nodes.embedCard.createChecked({})), currentAppearance) : false;
|
|
83
85
|
var embedOption = allowEmbeds && preview && {
|
|
84
86
|
appearance: 'embed',
|
|
@@ -90,6 +92,15 @@ var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
90
92
|
disabled: !isEmbedCardLinkSupportedInParent,
|
|
91
93
|
tooltip: isEmbedCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl)
|
|
92
94
|
};
|
|
95
|
+
var blockCardOption = allowBlockCards && {
|
|
96
|
+
appearance: 'block',
|
|
97
|
+
title: intl.formatMessage(_messages2.messages.block),
|
|
98
|
+
onClick: (0, _doc.setSelectedCardAppearance)('block'),
|
|
99
|
+
selected: currentAppearance === 'block',
|
|
100
|
+
testId: 'block-appearance',
|
|
101
|
+
disabled: !isBlockCardLinkSupportedInParent,
|
|
102
|
+
tooltip: isBlockCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl)
|
|
103
|
+
};
|
|
93
104
|
var options = [{
|
|
94
105
|
title: intl.formatMessage(_messages2.messages.url),
|
|
95
106
|
onClick: function onClick() {
|
|
@@ -103,14 +114,6 @@ var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
103
114
|
onClick: (0, _doc.setSelectedCardAppearance)('inline'),
|
|
104
115
|
selected: currentAppearance === 'inline',
|
|
105
116
|
testId: 'inline-appearance'
|
|
106
|
-
}, {
|
|
107
|
-
appearance: 'block',
|
|
108
|
-
title: intl.formatMessage(_messages2.messages.block),
|
|
109
|
-
onClick: (0, _doc.setSelectedCardAppearance)('block'),
|
|
110
|
-
selected: currentAppearance === 'block',
|
|
111
|
-
testId: 'block-appearance',
|
|
112
|
-
disabled: !isBlockCardLinkSupportedInParent,
|
|
113
|
-
tooltip: isBlockCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl)
|
|
114
117
|
}];
|
|
115
118
|
|
|
116
119
|
var dispatchCommand = function dispatchCommand(fn) {
|
|
@@ -121,6 +124,10 @@ var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
121
124
|
}
|
|
122
125
|
};
|
|
123
126
|
|
|
127
|
+
if (blockCardOption) {
|
|
128
|
+
options.push(blockCardOption);
|
|
129
|
+
}
|
|
130
|
+
|
|
124
131
|
if (embedOption) {
|
|
125
132
|
options.push(embedOption);
|
|
126
133
|
}
|
|
@@ -9,7 +9,7 @@ exports.handleTelePointer = exports.handlePresence = exports.handleInit = export
|
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
12
|
-
var _prosemirrorCollab = require("prosemirror-collab");
|
|
12
|
+
var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
|
|
13
13
|
|
|
14
14
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
19
19
|
|
|
20
20
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
21
21
|
|
|
22
|
-
var _prosemirrorCollab = require("prosemirror-collab");
|
|
22
|
+
var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
|
|
23
23
|
|
|
24
24
|
var _plugin = require("./plugin");
|
|
25
25
|
|
|
@@ -23,7 +23,7 @@ var _utilServiceSupport = require("@atlaskit/util-service-support");
|
|
|
23
23
|
|
|
24
24
|
var _eventemitter = require("eventemitter2");
|
|
25
25
|
|
|
26
|
-
var _prosemirrorCollab = require("prosemirror-collab");
|
|
26
|
+
var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
|
|
27
27
|
|
|
28
28
|
var _logger = require("./logger");
|
|
29
29
|
|
|
@@ -173,6 +173,11 @@ function expandKeymap() {
|
|
|
173
173
|
|
|
174
174
|
if (editorView.endOfTextblock('down')) {
|
|
175
175
|
var _$from2 = state.selection.$from;
|
|
176
|
+
|
|
177
|
+
if (_$from2.depth === 0) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
|
|
176
181
|
var $after = state.doc.resolve(_$from2.after());
|
|
177
182
|
|
|
178
183
|
if ($after.nodeAfter && ($after.nodeAfter.type === expand || $after.nodeAfter.type === nestedExpand)) {
|
|
@@ -196,6 +196,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
196
196
|
|
|
197
197
|
case 'select':
|
|
198
198
|
if (item.selectType === 'list') {
|
|
199
|
+
var ariaLabel = item.title || item.placeholder;
|
|
199
200
|
return (0, _react2.jsx)(_Select.default, {
|
|
200
201
|
key: idx,
|
|
201
202
|
dispatchCommand: dispatchCommand,
|
|
@@ -209,8 +210,10 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
209
210
|
onChange: function onChange(selected) {
|
|
210
211
|
return dispatchCommand(item.onChange(selected));
|
|
211
212
|
},
|
|
213
|
+
ariaLabel: ariaLabel,
|
|
212
214
|
filterOption: item.filterOption,
|
|
213
|
-
setDisableParentScroll: scrollable ? setDisableScroll : undefined
|
|
215
|
+
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
216
|
+
classNamePrefix: 'floating-toolbar-select'
|
|
214
217
|
});
|
|
215
218
|
}
|
|
216
219
|
|
|
@@ -394,15 +397,21 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
394
397
|
}));
|
|
395
398
|
});
|
|
396
399
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEscape", function (event) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
400
|
+
var _this$props$editorVie;
|
|
401
|
+
|
|
402
|
+
// If any menu is open inside the floating toolbar 'Esc' key should not
|
|
403
|
+
// focus the editorview.
|
|
404
|
+
// Event can't be stopped as they are not childnodes of floating toolbar
|
|
405
|
+
var isDropdownOpen = !!document.querySelector('[data-role="droplistContent"]');
|
|
406
|
+
var isSelectMenuOpen = !!document.querySelector('.floating-toolbar-select__menu');
|
|
407
|
+
|
|
408
|
+
if (isDropdownOpen || isSelectMenuOpen) {
|
|
409
|
+
return;
|
|
405
410
|
}
|
|
411
|
+
|
|
412
|
+
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
|
|
413
|
+
event.preventDefault();
|
|
414
|
+
event.stopPropagation();
|
|
406
415
|
});
|
|
407
416
|
_this.scrollContainerRef = /*#__PURE__*/_react.default.createRef();
|
|
408
417
|
_this.mountRef = /*#__PURE__*/_react.default.createRef();
|
|
@@ -208,6 +208,7 @@ var HyperlinkToolbarAppearance = /*#__PURE__*/function (_Component) {
|
|
|
208
208
|
editorView: editorView,
|
|
209
209
|
editorState: editorState,
|
|
210
210
|
allowEmbeds: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowEmbeds,
|
|
211
|
+
allowBlockCards: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowBlockCards,
|
|
211
212
|
platform: platform
|
|
212
213
|
});
|
|
213
214
|
}
|
|
@@ -85,7 +85,8 @@ var hyperlinkPlugin = function hyperlinkPlugin(options) {
|
|
|
85
85
|
action: function action(insert, state) {
|
|
86
86
|
var tr = insert(undefined);
|
|
87
87
|
tr.setMeta(_main.stateKey, {
|
|
88
|
-
type: _main.LinkAction.SHOW_INSERT_TOOLBAR
|
|
88
|
+
type: _main.LinkAction.SHOW_INSERT_TOOLBAR,
|
|
89
|
+
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
89
90
|
});
|
|
90
91
|
return (0, _analytics.addAnalytics)(state, tr, {
|
|
91
92
|
action: _analytics.ACTION.INVOKED,
|