@atlaskit/editor-plugin-media 1.13.2 → 1.13.4

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,19 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 1.13.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#83266](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83266) [`2ccef5c67079`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ccef5c67079) - fix editor comment disabled state regression issue
8
+ - Updated dependencies
9
+
10
+ ## 1.13.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [#86920](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86920) [`b06aff2f43c8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b06aff2f43c8) - ECA11Y-72: fix borken changeInlineToMediaCard function
15
+ - Updated dependencies
16
+
3
17
  ## 1.13.2
4
18
 
5
19
  ### Patch Changes
@@ -54,10 +54,11 @@ var changeInlineToMediaCard = exports.changeInlineToMediaCard = function changeI
54
54
  return node.type === paragraph || node.type === heading;
55
55
  })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
56
56
  var tr = state.tr;
57
+ var insertPos;
57
58
  if (!!parent && parent.content.size === 2 && ((_parent$content$first = parent.content.firstChild) === null || _parent$content$first === void 0 ? void 0 : _parent$content$first.type.name) === 'mediaInline' && ((_parent$content$lastC = parent.content.lastChild) === null || _parent$content$lastC === void 0 ? void 0 : _parent$content$lastC.type.name) === 'text' && ((_parent$content$lastC2 = parent.content.lastChild) === null || _parent$content$lastC2 === void 0 || (_parent$content$lastC2 = _parent$content$lastC2.text) === null || _parent$content$lastC2 === void 0 ? void 0 : _parent$content$lastC2.trim()) === '') {
58
59
  /// Empty paragraph or empty heading
59
60
  /// Drop the corresponding card on the current line
60
- var insertPos = state.tr.doc.resolve(state.selection.from).start() - 1;
61
+ insertPos = state.tr.doc.resolve(state.selection.from).start() - 1;
61
62
  if (insertPos < 0) {
62
63
  return false;
63
64
  }
@@ -66,9 +67,9 @@ var changeInlineToMediaCard = exports.changeInlineToMediaCard = function changeI
66
67
  } else {
67
68
  /// Non-empty paragraph, non-empty heading, or other nodes (e.g., action, list)
68
69
  /// Drop the corresponding card underneath the current line
69
- var _insertPos = state.tr.doc.resolve(state.selection.from).end();
70
+ insertPos = state.tr.doc.resolve(state.selection.from).end();
70
71
  tr = (0, _utils.removeSelectedNode)(tr);
71
- tr = (0, _utils.safeInsert)(group, _insertPos, false)(tr);
72
+ tr = (0, _utils.safeInsert)(group, insertPos, false)(tr);
72
73
  }
73
74
  if (dispatch) {
74
75
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
@@ -80,9 +81,8 @@ var changeInlineToMediaCard = exports.changeInlineToMediaCard = function changeI
80
81
  previousType: _analytics.ACTION_SUBJECT_ID.MEDIA_INLINE
81
82
  }
82
83
  })(tr);
83
- var nodePos = state.tr.doc.resolve(state.selection.from).end();
84
84
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.ally-media-file-dropdown_1kxo8')) {
85
- var $endOfNode = tr.doc.resolve(nodePos + 1);
85
+ var $endOfNode = tr.doc.resolve(insertPos + 1);
86
86
  var newSelection = new _state.NodeSelection($endOfNode);
87
87
  tr.setSelection(newSelection);
88
88
  forceFocusSelector === null || forceFocusSelector === void 0 || forceFocusSelector(".thumbnail-appearance")(tr);
@@ -46,10 +46,11 @@ export const changeInlineToMediaCard = (editorAnalyticsAPI, forceFocusSelector)
46
46
  return node.type === paragraph || node.type === heading;
47
47
  })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
48
48
  let tr = state.tr;
49
+ let insertPos;
49
50
  if (!!parent && parent.content.size === 2 && ((_parent$content$first = parent.content.firstChild) === null || _parent$content$first === void 0 ? void 0 : _parent$content$first.type.name) === 'mediaInline' && ((_parent$content$lastC = parent.content.lastChild) === null || _parent$content$lastC === void 0 ? void 0 : _parent$content$lastC.type.name) === 'text' && ((_parent$content$lastC2 = parent.content.lastChild) === null || _parent$content$lastC2 === void 0 ? void 0 : (_parent$content$lastC3 = _parent$content$lastC2.text) === null || _parent$content$lastC3 === void 0 ? void 0 : _parent$content$lastC3.trim()) === '') {
50
51
  /// Empty paragraph or empty heading
51
52
  /// Drop the corresponding card on the current line
52
- const insertPos = state.tr.doc.resolve(state.selection.from).start() - 1;
53
+ insertPos = state.tr.doc.resolve(state.selection.from).start() - 1;
53
54
  if (insertPos < 0) {
54
55
  return false;
55
56
  }
@@ -58,7 +59,7 @@ export const changeInlineToMediaCard = (editorAnalyticsAPI, forceFocusSelector)
58
59
  } else {
59
60
  /// Non-empty paragraph, non-empty heading, or other nodes (e.g., action, list)
60
61
  /// Drop the corresponding card underneath the current line
61
- const insertPos = state.tr.doc.resolve(state.selection.from).end();
62
+ insertPos = state.tr.doc.resolve(state.selection.from).end();
62
63
  tr = removeSelectedNode(tr);
63
64
  tr = safeInsert(group, insertPos, false)(tr);
64
65
  }
@@ -72,9 +73,8 @@ export const changeInlineToMediaCard = (editorAnalyticsAPI, forceFocusSelector)
72
73
  previousType: ACTION_SUBJECT_ID.MEDIA_INLINE
73
74
  }
74
75
  })(tr);
75
- const nodePos = state.tr.doc.resolve(state.selection.from).end();
76
76
  if (getBooleanFF('platform.editor.ally-media-file-dropdown_1kxo8')) {
77
- const $endOfNode = tr.doc.resolve(nodePos + 1);
77
+ const $endOfNode = tr.doc.resolve(insertPos + 1);
78
78
  const newSelection = new NodeSelection($endOfNode);
79
79
  tr.setSelection(newSelection);
80
80
  forceFocusSelector === null || forceFocusSelector === void 0 ? void 0 : forceFocusSelector(`.thumbnail-appearance`)(tr);
@@ -47,10 +47,11 @@ export var changeInlineToMediaCard = function changeInlineToMediaCard(editorAnal
47
47
  return node.type === paragraph || node.type === heading;
48
48
  })) === null || _findParentNodeCloses === void 0 ? void 0 : _findParentNodeCloses.node;
49
49
  var tr = state.tr;
50
+ var insertPos;
50
51
  if (!!parent && parent.content.size === 2 && ((_parent$content$first = parent.content.firstChild) === null || _parent$content$first === void 0 ? void 0 : _parent$content$first.type.name) === 'mediaInline' && ((_parent$content$lastC = parent.content.lastChild) === null || _parent$content$lastC === void 0 ? void 0 : _parent$content$lastC.type.name) === 'text' && ((_parent$content$lastC2 = parent.content.lastChild) === null || _parent$content$lastC2 === void 0 || (_parent$content$lastC2 = _parent$content$lastC2.text) === null || _parent$content$lastC2 === void 0 ? void 0 : _parent$content$lastC2.trim()) === '') {
51
52
  /// Empty paragraph or empty heading
52
53
  /// Drop the corresponding card on the current line
53
- var insertPos = state.tr.doc.resolve(state.selection.from).start() - 1;
54
+ insertPos = state.tr.doc.resolve(state.selection.from).start() - 1;
54
55
  if (insertPos < 0) {
55
56
  return false;
56
57
  }
@@ -59,9 +60,9 @@ export var changeInlineToMediaCard = function changeInlineToMediaCard(editorAnal
59
60
  } else {
60
61
  /// Non-empty paragraph, non-empty heading, or other nodes (e.g., action, list)
61
62
  /// Drop the corresponding card underneath the current line
62
- var _insertPos = state.tr.doc.resolve(state.selection.from).end();
63
+ insertPos = state.tr.doc.resolve(state.selection.from).end();
63
64
  tr = removeSelectedNode(tr);
64
- tr = safeInsert(group, _insertPos, false)(tr);
65
+ tr = safeInsert(group, insertPos, false)(tr);
65
66
  }
66
67
  if (dispatch) {
67
68
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
@@ -73,9 +74,8 @@ export var changeInlineToMediaCard = function changeInlineToMediaCard(editorAnal
73
74
  previousType: ACTION_SUBJECT_ID.MEDIA_INLINE
74
75
  }
75
76
  })(tr);
76
- var nodePos = state.tr.doc.resolve(state.selection.from).end();
77
77
  if (getBooleanFF('platform.editor.ally-media-file-dropdown_1kxo8')) {
78
- var $endOfNode = tr.doc.resolve(nodePos + 1);
78
+ var $endOfNode = tr.doc.resolve(insertPos + 1);
79
79
  var newSelection = new NodeSelection($endOfNode);
80
80
  tr.setSelection(newSelection);
81
81
  forceFocusSelector === null || forceFocusSelector === void 0 || forceFocusSelector(".thumbnail-appearance")(tr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,11 +36,11 @@
36
36
  "@atlaskit/adf-schema": "^35.8.0",
37
37
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
38
38
  "@atlaskit/analytics-next": "^9.2.0",
39
- "@atlaskit/button": "^17.8.0",
39
+ "@atlaskit/button": "^17.10.0",
40
40
  "@atlaskit/editor-common": "^78.23.0",
41
41
  "@atlaskit/editor-palette": "1.5.3",
42
42
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
43
- "@atlaskit/editor-plugin-annotation": "1.5.5",
43
+ "@atlaskit/editor-plugin-annotation": "1.5.6",
44
44
  "@atlaskit/editor-plugin-decorations": "^1.0.0",
45
45
  "@atlaskit/editor-plugin-editor-disabled": "^1.0.0",
46
46
  "@atlaskit/editor-plugin-editor-viewmode": "^1.0.0",
@@ -61,13 +61,13 @@
61
61
  "@atlaskit/media-common": "^11.1.0",
62
62
  "@atlaskit/media-filmstrip": "^47.0.0",
63
63
  "@atlaskit/media-picker": "^66.4.0",
64
- "@atlaskit/media-ui": "^25.4.0",
64
+ "@atlaskit/media-ui": "^25.5.0",
65
65
  "@atlaskit/media-viewer": "^48.4.0",
66
66
  "@atlaskit/platform-feature-flags": "^0.2.0",
67
- "@atlaskit/primitives": "^5.3.0",
67
+ "@atlaskit/primitives": "^5.5.0",
68
68
  "@atlaskit/textfield": "^6.1.0",
69
69
  "@atlaskit/theme": "^12.7.0",
70
- "@atlaskit/tokens": "^1.42.0",
70
+ "@atlaskit/tokens": "^1.43.0",
71
71
  "@atlaskit/tooltip": "^18.1.0",
72
72
  "@babel/runtime": "^7.0.0",
73
73
  "@emotion/react": "^11.7.1",