@atlaskit/editor-core 189.4.4 → 189.4.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,11 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 189.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43282](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43282) [`ea6aae16859`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea6aae16859) - Fixed extra paragraph added on pasting codeblock and modified relevant testcases
8
+
3
9
  ## 189.4.4
4
10
 
5
11
  ### Patch Changes
@@ -866,7 +866,7 @@ function handleRichText(slice, queueCardsFromChangedTr) {
866
866
  // when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
867
867
  // need to make sure the cursor position is is right after the panel, expand, or decisionList
868
868
  // still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
869
- var shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 || (_slice$content$lastCh = _slice$content$lastCh.type) === null || _slice$content$lastCh === void 0 ? void 0 : _slice$content$lastCh.name) || '');
869
+ var shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList', 'codeBlock'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 || (_slice$content$lastCh = _slice$content$lastCh.type) === null || _slice$content$lastCh === void 0 ? void 0 : _slice$content$lastCh.name) || '');
870
870
  if ((0, _utils3.insideTableCell)(state) && shouldUpdateCursorPosAfterPaste) {
871
871
  var nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
872
872
  tr.setSelection(new _selection.GapCursorSelection(nextPos, _selection.Side.RIGHT));
@@ -437,7 +437,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
437
437
  slice = (0, _commands.splitParagraphs)(slice, schema);
438
438
  slice = (0, _commands.upgradeTextToLists)(slice, schema);
439
439
  if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
440
- slice = new _model.Slice(slice.content.append(_model.Fragment.from(schema.nodes.paragraph.createAndFill())), slice.openStart, 1);
440
+ slice = new _model.Slice(slice.content, 0, 0);
441
441
  }
442
442
  return slice;
443
443
  },
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "189.4.4";
8
+ var version = exports.version = "189.4.5";
@@ -848,7 +848,7 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
848
848
  // when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
849
849
  // need to make sure the cursor position is is right after the panel, expand, or decisionList
850
850
  // still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
851
- const shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 ? void 0 : (_slice$content$lastCh2 = _slice$content$lastCh.type) === null || _slice$content$lastCh2 === void 0 ? void 0 : _slice$content$lastCh2.name) || '');
851
+ const shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList', 'codeBlock'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 ? void 0 : (_slice$content$lastCh2 = _slice$content$lastCh.type) === null || _slice$content$lastCh2 === void 0 ? void 0 : _slice$content$lastCh2.name) || '');
852
852
  if (insideTableCell(state) && shouldUpdateCursorPosAfterPaste) {
853
853
  const nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
854
854
  tr.setSelection(new GapCursorSelection(nextPos, Side.RIGHT));
@@ -404,7 +404,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
404
404
  slice = splitParagraphs(slice, schema);
405
405
  slice = upgradeTextToLists(slice, schema);
406
406
  if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
407
- slice = new Slice(slice.content.append(Fragment.from(schema.nodes.paragraph.createAndFill())), slice.openStart, 1);
407
+ slice = new Slice(slice.content, 0, 0);
408
408
  }
409
409
  return slice;
410
410
  },
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "189.4.4";
2
+ export const version = "189.4.5";
@@ -845,7 +845,7 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
845
845
  // when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
846
846
  // need to make sure the cursor position is is right after the panel, expand, or decisionList
847
847
  // still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
848
- var shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 || (_slice$content$lastCh = _slice$content$lastCh.type) === null || _slice$content$lastCh === void 0 ? void 0 : _slice$content$lastCh.name) || '');
848
+ var shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList', 'codeBlock'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 || (_slice$content$lastCh = _slice$content$lastCh.type) === null || _slice$content$lastCh === void 0 ? void 0 : _slice$content$lastCh.name) || '');
849
849
  if (insideTableCell(state) && shouldUpdateCursorPosAfterPaste) {
850
850
  var nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
851
851
  tr.setSelection(new GapCursorSelection(nextPos, Side.RIGHT));
@@ -424,7 +424,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
424
424
  slice = splitParagraphs(slice, schema);
425
425
  slice = upgradeTextToLists(slice, schema);
426
426
  if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
427
- slice = new Slice(slice.content.append(Fragment.from(schema.nodes.paragraph.createAndFill())), slice.openStart, 1);
427
+ slice = new Slice(slice.content, 0, 0);
428
428
  }
429
429
  return slice;
430
430
  },
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "189.4.4";
2
+ export var version = "189.4.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "189.4.4",
3
+ "version": "189.4.5",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -190,7 +190,7 @@
190
190
  "@atlaskit/webdriver-runner": "*",
191
191
  "@atlassian/adf-schema-json": "^1.0.7",
192
192
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
193
- "@atlassian/editor-extension-link-create": "^0.8.0",
193
+ "@atlassian/editor-extension-link-create": "^0.9.0",
194
194
  "@atlassian/feature-flags-test-utils": "^0.1.1",
195
195
  "@atlassian/link-picker-plugins": "^24.0.0",
196
196
  "@atlassian/search-provider": "2.4.8",