@atlaskit/editor-plugin-panel 2.3.4 → 2.3.5

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 2.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#139335](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139335)
8
+ [`ac5e66fc71394`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ac5e66fc71394) -
9
+ ED-24798 bug-fix: pressing Backspace before media that is nested in a quote should move your
10
+ selection to the media
11
+
3
12
  ## 2.3.4
4
13
 
5
14
  ### Patch Changes
@@ -34,7 +34,9 @@ function keymapPlugin() {
34
34
  var panel = nodes.panel,
35
35
  blockquote = nodes.blockquote,
36
36
  orderedList = nodes.orderedList,
37
- bulletList = nodes.bulletList;
37
+ bulletList = nodes.bulletList,
38
+ mediaSingle = nodes.mediaSingle,
39
+ mediaGroup = nodes.mediaGroup;
38
40
  var $from = selection.$from,
39
41
  $to = selection.$to;
40
42
  // Don't do anything if selection is a range
@@ -52,12 +54,13 @@ function keymapPlugin() {
52
54
  var isPreviousNodeAPanel = previousNodeType === panel;
53
55
  var isParentNodeAPanel = parentNodeType === panel;
54
56
  var nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
55
- var hasParentNodeofTypeList = (0, _utils2.hasParentNodeOfType)([bulletList, orderedList])(selection);
57
+ var isPreviousNodeMedia = previousNodeType === mediaSingle || previousNodeType === mediaGroup;
58
+ var isPreviousNodeAList = previousNodeType === bulletList || previousNodeType === orderedList;
56
59
 
57
60
  // Stops merging panels when deleting empty paragraph in between
58
61
  // Stops merging blockquotes with panels when deleting from start of blockquote
59
62
 
60
- if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || (0, _utils2.hasParentNodeOfType)(blockquote)(selection) && !hasParentNodeofTypeList ||
63
+ if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || (0, _utils2.hasParentNodeOfType)(blockquote)(selection) && !isPreviousNodeAList && !isPreviousNodeMedia ||
61
64
  // Lift line of panel content up and out of the panel, when backspacing
62
65
  // at the start of a panel, if the node before the panel is an 'isolating' node
63
66
  // (for e.g. a table, or an expand), otherwise the default prosemirror backspace
@@ -32,7 +32,9 @@ export function keymapPlugin() {
32
32
  panel,
33
33
  blockquote,
34
34
  orderedList,
35
- bulletList
35
+ bulletList,
36
+ mediaSingle,
37
+ mediaGroup
36
38
  } = nodes;
37
39
  const {
38
40
  $from,
@@ -53,12 +55,13 @@ export function keymapPlugin() {
53
55
  const isPreviousNodeAPanel = previousNodeType === panel;
54
56
  const isParentNodeAPanel = parentNodeType === panel;
55
57
  const nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
56
- const hasParentNodeofTypeList = hasParentNodeOfType([bulletList, orderedList])(selection);
58
+ const isPreviousNodeMedia = previousNodeType === mediaSingle || previousNodeType === mediaGroup;
59
+ const isPreviousNodeAList = previousNodeType === bulletList || previousNodeType === orderedList;
57
60
 
58
61
  // Stops merging panels when deleting empty paragraph in between
59
62
  // Stops merging blockquotes with panels when deleting from start of blockquote
60
63
 
61
- if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !hasParentNodeofTypeList ||
64
+ if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !isPreviousNodeAList && !isPreviousNodeMedia ||
62
65
  // Lift line of panel content up and out of the panel, when backspacing
63
66
  // at the start of a panel, if the node before the panel is an 'isolating' node
64
67
  // (for e.g. a table, or an expand), otherwise the default prosemirror backspace
@@ -27,7 +27,9 @@ export function keymapPlugin() {
27
27
  var panel = nodes.panel,
28
28
  blockquote = nodes.blockquote,
29
29
  orderedList = nodes.orderedList,
30
- bulletList = nodes.bulletList;
30
+ bulletList = nodes.bulletList,
31
+ mediaSingle = nodes.mediaSingle,
32
+ mediaGroup = nodes.mediaGroup;
31
33
  var $from = selection.$from,
32
34
  $to = selection.$to;
33
35
  // Don't do anything if selection is a range
@@ -45,12 +47,13 @@ export function keymapPlugin() {
45
47
  var isPreviousNodeAPanel = previousNodeType === panel;
46
48
  var isParentNodeAPanel = parentNodeType === panel;
47
49
  var nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
48
- var hasParentNodeofTypeList = hasParentNodeOfType([bulletList, orderedList])(selection);
50
+ var isPreviousNodeMedia = previousNodeType === mediaSingle || previousNodeType === mediaGroup;
51
+ var isPreviousNodeAList = previousNodeType === bulletList || previousNodeType === orderedList;
49
52
 
50
53
  // Stops merging panels when deleting empty paragraph in between
51
54
  // Stops merging blockquotes with panels when deleting from start of blockquote
52
55
 
53
- if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !hasParentNodeofTypeList ||
56
+ if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) && !isPreviousNodeAList && !isPreviousNodeMedia ||
54
57
  // Lift line of panel content up and out of the panel, when backspacing
55
58
  // at the start of a panel, if the node before the panel is an 'isolating' node
56
59
  // (for e.g. a table, or an expand), otherwise the default prosemirror backspace
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^40.9.0",
35
- "@atlaskit/editor-common": "^88.12.0",
35
+ "@atlaskit/editor-common": "^88.13.0",
36
36
  "@atlaskit/editor-palette": "1.6.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
38
38
  "@atlaskit/editor-plugin-decorations": "^1.3.0",