@atlaskit/editor-core 164.0.2 → 164.0.3

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
+ ## 164.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1f18014c3c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1f18014c3c3) - [ux] ED-14909: Fix Chrome bug where typeahead would write duplicate slash prefix triggers on multiple focusout events
8
+
3
9
  ## 164.0.2
4
10
 
5
11
  ### Patch Changes
@@ -201,12 +201,24 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
201
201
  };
202
202
 
203
203
  var onFocusOut = function onFocusOut(event) {
204
+ var _window$getSelection;
205
+
204
206
  var relatedTarget = event.relatedTarget; // Given the user is changing the focus
205
207
  // When the target is inside the TypeAhead Popup
206
208
  // Then the popup should stay open
207
209
 
208
210
  if (relatedTarget instanceof HTMLElement && relatedTarget.closest && relatedTarget.closest(".".concat(_constants.TYPE_AHEAD_POPUP_CONTENT_CLASS))) {
209
211
  return;
212
+ } // See ED-14909: Chrome may emit focusout events where an input
213
+ // device was not directly responsible. (This rears in react v17+ consumers
214
+ // where react-managed node removal now appears to propagate focusout events to
215
+ // our event listener). As this path is strictly for click or other typeahead
216
+ // dismissals that don't involve typeahead item selection, we carve out an
217
+ // exception for Chrome-specific events where an input device was not the initiator.
218
+
219
+
220
+ if (_utils.browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') && !('sourceCapabilities' in event && event.sourceCapabilities)) {
221
+ return;
210
222
  }
211
223
 
212
224
  cancel({
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "164.0.2";
9
+ var version = "164.0.3";
10
10
  exports.version = version;
11
11
 
12
12
  var nextMajorVersion = function nextMajorVersion() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "164.0.2",
3
+ "version": "164.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -182,6 +182,8 @@ export const InputQuery = /*#__PURE__*/React.memo(({
182
182
  };
183
183
 
184
184
  const onFocusOut = event => {
185
+ var _window$getSelection;
186
+
185
187
  const {
186
188
  relatedTarget
187
189
  } = event; // Given the user is changing the focus
@@ -190,6 +192,16 @@ export const InputQuery = /*#__PURE__*/React.memo(({
190
192
 
191
193
  if (relatedTarget instanceof HTMLElement && relatedTarget.closest && relatedTarget.closest(`.${TYPE_AHEAD_POPUP_CONTENT_CLASS}`)) {
192
194
  return;
195
+ } // See ED-14909: Chrome may emit focusout events where an input
196
+ // device was not directly responsible. (This rears in react v17+ consumers
197
+ // where react-managed node removal now appears to propagate focusout events to
198
+ // our event listener). As this path is strictly for click or other typeahead
199
+ // dismissals that don't involve typeahead item selection, we carve out an
200
+ // exception for Chrome-specific events where an input device was not the initiator.
201
+
202
+
203
+ if (browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') && !('sourceCapabilities' in event && event.sourceCapabilities)) {
204
+ return;
193
205
  }
194
206
 
195
207
  cancel({
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "164.0.2";
2
+ export const version = "164.0.3";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "164.0.2",
3
+ "version": "164.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -181,12 +181,24 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
181
181
  };
182
182
 
183
183
  var onFocusOut = function onFocusOut(event) {
184
+ var _window$getSelection;
185
+
184
186
  var relatedTarget = event.relatedTarget; // Given the user is changing the focus
185
187
  // When the target is inside the TypeAhead Popup
186
188
  // Then the popup should stay open
187
189
 
188
190
  if (relatedTarget instanceof HTMLElement && relatedTarget.closest && relatedTarget.closest(".".concat(TYPE_AHEAD_POPUP_CONTENT_CLASS))) {
189
191
  return;
192
+ } // See ED-14909: Chrome may emit focusout events where an input
193
+ // device was not directly responsible. (This rears in react v17+ consumers
194
+ // where react-managed node removal now appears to propagate focusout events to
195
+ // our event listener). As this path is strictly for click or other typeahead
196
+ // dismissals that don't involve typeahead item selection, we carve out an
197
+ // exception for Chrome-specific events where an input device was not the initiator.
198
+
199
+
200
+ if (browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') && !('sourceCapabilities' in event && event.sourceCapabilities)) {
201
+ return;
190
202
  }
191
203
 
192
204
  cancel({
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "164.0.2";
2
+ export var version = "164.0.3";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "164.0.2",
3
+ "version": "164.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/editor.js",
4
4
  "module": "../dist/esm/editor.js",
5
5
  "module:es2019": "../dist/es2019/editor.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/editor.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/element-browser.js",
4
4
  "module": "../dist/esm/element-browser.js",
5
5
  "module:es2019": "../dist/es2019/element-browser.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/element-browser.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/extensibility.js",
4
4
  "module": "../dist/esm/extensibility.js",
5
5
  "module:es2019": "../dist/es2019/extensibility.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/extensibility.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/extensions.js",
4
4
  "module": "../dist/esm/extensions.js",
5
5
  "module:es2019": "../dist/es2019/extensions.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/extensions.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/labs-next.js",
4
4
  "module": "../dist/esm/labs-next.js",
5
5
  "module:es2019": "../dist/es2019/labs-next.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/labs-next.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/messages.js",
4
4
  "module": "../dist/esm/messages.js",
5
5
  "module:es2019": "../dist/es2019/messages.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/messages.d.ts"
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "164.0.2",
3
+ "version": "164.0.3",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/test-utils.js",
4
4
  "module": "../dist/esm/test-utils.js",
5
5
  "module:es2019": "../dist/es2019/test-utils.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/test-utils.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/version-wrapper.js",
4
4
  "module": "../dist/esm/version-wrapper.js",
5
5
  "module:es2019": "../dist/es2019/version-wrapper.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/version-wrapper.d.ts"
7
8
  }