@atlaskit/editor-core 188.10.1 → 188.10.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,18 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 188.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#40640](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40640) [`42b4beab30c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42b4beab30c) - ux [ED-18034] Inconsistent copy/paste behaviour of inline nodes in nested code blocks
8
+
9
+ ## 188.10.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#40384](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40384) [`1ed4227201a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1ed4227201a) - [ux] ED-19206 Fixing the issue of color Selection from toolbar doesn't refocus to editor
14
+ - Updated dependencies
15
+
3
16
  ## 188.10.1
4
17
 
5
18
  ### Patch Changes
@@ -855,18 +855,14 @@ function handleRichText(slice, queueCardsFromChangedTr) {
855
855
  }
856
856
  } else {
857
857
  // need to scan the slice if there's a block node or list items inside it
858
- var doesBlockNodeExist = false;
859
858
  var sliceHasList = false;
860
859
  slice.content.nodesBetween(0, slice.content.size, function (node, start) {
861
860
  if (node.type === state.schema.nodes.listItem) {
862
861
  sliceHasList = true;
863
- }
864
- if (start >= slice.openStart && start <= slice.content.size - slice.openEnd && node.isBlock) {
865
- doesBlockNodeExist = true;
866
862
  return false;
867
863
  }
868
864
  });
869
- if ((0, _utils3.insideTableCell)(state) && (!doesBlockNodeExist || (0, _utils3.isInListItem)(state) && (0, _utils.canInsert)(selection.$from, slice.content) && (0, _utils.canInsert)(selection.$to, slice.content)) || sliceHasList) {
865
+ if ((0, _utils3.insideTableCell)(state) && (0, _utils3.isInListItem)(state) && (0, _utils.canInsert)(selection.$from, slice.content) && (0, _utils.canInsert)(selection.$to, slice.content) || sliceHasList) {
870
866
  tr.replaceSelection(slice);
871
867
  } else {
872
868
  // need safeInsert rather than replaceSelection, so that nodes aren't split in half
@@ -64,7 +64,6 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
64
64
  });
65
65
  });
66
66
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTextColor", function (color, editorAnalyticsApi, disabled) {
67
- var _this$toolbarItemRef;
68
67
  if (!disabled) {
69
68
  var _this$props$editorVie;
70
69
  var palette = _this.props.pluginState.palette;
@@ -84,7 +83,6 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
84
83
  //To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
85
84
  (_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
86
85
  }
87
- (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
88
86
  return false;
89
87
  });
90
88
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
@@ -120,8 +118,8 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
120
118
  }));
121
119
  }
122
120
  if (!isOpen && event instanceof KeyboardEvent && (event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
123
- var _this$toolbarItemRef2;
124
- (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
121
+ var _this$toolbarItemRef;
122
+ (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
125
123
  }
126
124
  });
127
125
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hide", function (e) {
@@ -134,15 +132,15 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
134
132
  isOpen: false
135
133
  });
136
134
  if (e instanceof KeyboardEvent && e.key === 'Escape') {
137
- var _this$toolbarItemRef3;
138
- (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
135
+ var _this$toolbarItemRef2;
136
+ (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
139
137
  }
140
138
  }
141
139
  });
142
140
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideonEsc", function (e) {
143
- var _this$toolbarItemRef4;
141
+ var _this$toolbarItemRef3;
144
142
  _this.hide(e);
145
- (_this$toolbarItemRef4 = _this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 || (_this$toolbarItemRef4 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef4 === void 0 || _this$toolbarItemRef4.focus();
143
+ (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
146
144
  });
147
145
  return _this;
148
146
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "188.10.1";
8
+ var version = exports.version = "188.10.4";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -839,18 +839,14 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
839
839
  }
840
840
  } else {
841
841
  // need to scan the slice if there's a block node or list items inside it
842
- let doesBlockNodeExist = false;
843
842
  let sliceHasList = false;
844
843
  slice.content.nodesBetween(0, slice.content.size, (node, start) => {
845
844
  if (node.type === state.schema.nodes.listItem) {
846
845
  sliceHasList = true;
847
- }
848
- if (start >= slice.openStart && start <= slice.content.size - slice.openEnd && node.isBlock) {
849
- doesBlockNodeExist = true;
850
846
  return false;
851
847
  }
852
848
  });
853
- if (insideTableCell(state) && (!doesBlockNodeExist || isInListItem(state) && canInsert(selection.$from, slice.content) && canInsert(selection.$to, slice.content)) || sliceHasList) {
849
+ if (insideTableCell(state) && isInListItem(state) && canInsert(selection.$from, slice.content) && canInsert(selection.$to, slice.content) || sliceHasList) {
854
850
  tr.replaceSelection(slice);
855
851
  } else {
856
852
  // need safeInsert rather than replaceSelection, so that nodes aren't split in half
@@ -42,7 +42,6 @@ export class ToolbarTextColor extends React.Component {
42
42
  });
43
43
  });
44
44
  _defineProperty(this, "changeTextColor", (color, editorAnalyticsApi, disabled) => {
45
- var _this$toolbarItemRef, _this$toolbarItemRef$;
46
45
  if (!disabled) {
47
46
  var _this$props$editorVie;
48
47
  const {
@@ -64,7 +63,6 @@ export class ToolbarTextColor extends React.Component {
64
63
  //To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
65
64
  (_this$props$editorVie = this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
66
65
  }
67
- (_this$toolbarItemRef = this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 ? void 0 : (_this$toolbarItemRef$ = _this$toolbarItemRef.current) === null || _this$toolbarItemRef$ === void 0 ? void 0 : _this$toolbarItemRef$.focus();
68
66
  return false;
69
67
  });
70
68
  _defineProperty(this, "toggleOpen", () => {
@@ -101,8 +99,8 @@ export class ToolbarTextColor extends React.Component {
101
99
  }));
102
100
  }
103
101
  if (!isOpen && event instanceof KeyboardEvent && (event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
104
- var _this$toolbarItemRef2, _this$toolbarItemRef3;
105
- (_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();
102
+ var _this$toolbarItemRef, _this$toolbarItemRef$;
103
+ (_this$toolbarItemRef = this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 ? void 0 : (_this$toolbarItemRef$ = _this$toolbarItemRef.current) === null || _this$toolbarItemRef$ === void 0 ? void 0 : _this$toolbarItemRef$.focus();
106
104
  }
107
105
  });
108
106
  _defineProperty(this, "hide", e => {
@@ -117,15 +115,15 @@ export class ToolbarTextColor extends React.Component {
117
115
  isOpen: false
118
116
  });
119
117
  if (e instanceof KeyboardEvent && e.key === 'Escape') {
120
- var _this$toolbarItemRef4, _this$toolbarItemRef5;
121
- (_this$toolbarItemRef4 = this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 ? void 0 : (_this$toolbarItemRef5 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef5 === void 0 ? void 0 : _this$toolbarItemRef5.focus();
118
+ var _this$toolbarItemRef2, _this$toolbarItemRef3;
119
+ (_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();
122
120
  }
123
121
  }
124
122
  });
125
123
  _defineProperty(this, "hideonEsc", e => {
126
- var _this$toolbarItemRef6, _this$toolbarItemRef7;
124
+ var _this$toolbarItemRef4, _this$toolbarItemRef5;
127
125
  this.hide(e);
128
- (_this$toolbarItemRef6 = this.toolbarItemRef) === null || _this$toolbarItemRef6 === void 0 ? void 0 : (_this$toolbarItemRef7 = _this$toolbarItemRef6.current) === null || _this$toolbarItemRef7 === void 0 ? void 0 : _this$toolbarItemRef7.focus();
126
+ (_this$toolbarItemRef4 = this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 ? void 0 : (_this$toolbarItemRef5 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef5 === void 0 ? void 0 : _this$toolbarItemRef5.focus();
129
127
  });
130
128
  }
131
129
  render() {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "188.10.1";
2
+ export const version = "188.10.4";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -831,18 +831,14 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
831
831
  }
832
832
  } else {
833
833
  // need to scan the slice if there's a block node or list items inside it
834
- var doesBlockNodeExist = false;
835
834
  var sliceHasList = false;
836
835
  slice.content.nodesBetween(0, slice.content.size, function (node, start) {
837
836
  if (node.type === state.schema.nodes.listItem) {
838
837
  sliceHasList = true;
839
- }
840
- if (start >= slice.openStart && start <= slice.content.size - slice.openEnd && node.isBlock) {
841
- doesBlockNodeExist = true;
842
838
  return false;
843
839
  }
844
840
  });
845
- if (insideTableCell(state) && (!doesBlockNodeExist || isInListItem(state) && canInsert(selection.$from, slice.content) && canInsert(selection.$to, slice.content)) || sliceHasList) {
841
+ if (insideTableCell(state) && isInListItem(state) && canInsert(selection.$from, slice.content) && canInsert(selection.$to, slice.content) || sliceHasList) {
846
842
  tr.replaceSelection(slice);
847
843
  } else {
848
844
  // need safeInsert rather than replaceSelection, so that nodes aren't split in half
@@ -61,7 +61,6 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
61
61
  });
62
62
  });
63
63
  _defineProperty(_assertThisInitialized(_this), "changeTextColor", function (color, editorAnalyticsApi, disabled) {
64
- var _this$toolbarItemRef;
65
64
  if (!disabled) {
66
65
  var _this$props$editorVie;
67
66
  var palette = _this.props.pluginState.palette;
@@ -81,7 +80,6 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
81
80
  //To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
82
81
  (_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
83
82
  }
84
- (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
85
83
  return false;
86
84
  });
87
85
  _defineProperty(_assertThisInitialized(_this), "toggleOpen", function () {
@@ -117,8 +115,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
117
115
  }));
118
116
  }
119
117
  if (!isOpen && event instanceof KeyboardEvent && (event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
120
- var _this$toolbarItemRef2;
121
- (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
118
+ var _this$toolbarItemRef;
119
+ (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
122
120
  }
123
121
  });
124
122
  _defineProperty(_assertThisInitialized(_this), "hide", function (e) {
@@ -131,15 +129,15 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
131
129
  isOpen: false
132
130
  });
133
131
  if (e instanceof KeyboardEvent && e.key === 'Escape') {
134
- var _this$toolbarItemRef3;
135
- (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
132
+ var _this$toolbarItemRef2;
133
+ (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
136
134
  }
137
135
  }
138
136
  });
139
137
  _defineProperty(_assertThisInitialized(_this), "hideonEsc", function (e) {
140
- var _this$toolbarItemRef4;
138
+ var _this$toolbarItemRef3;
141
139
  _this.hide(e);
142
- (_this$toolbarItemRef4 = _this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 || (_this$toolbarItemRef4 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef4 === void 0 || _this$toolbarItemRef4.focus();
140
+ (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
143
141
  });
144
142
  return _this;
145
143
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "188.10.1";
2
+ export var version = "188.10.4";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "188.10.1",
3
+ "version": "188.10.4",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -92,7 +92,7 @@
92
92
  "@atlaskit/editor-plugin-scroll-into-view": "^0.1.0",
93
93
  "@atlaskit/editor-plugin-selection": "^0.1.0",
94
94
  "@atlaskit/editor-plugin-status": "^0.1.0",
95
- "@atlaskit/editor-plugin-table": "^5.2.0",
95
+ "@atlaskit/editor-plugin-table": "^5.3.0",
96
96
  "@atlaskit/editor-plugin-text-formatting": "^0.4.0",
97
97
  "@atlaskit/editor-plugin-type-ahead": "^0.7.0",
98
98
  "@atlaskit/editor-plugin-unsupported-content": "^0.2.0",