@atlaskit/editor-plugin-type-ahead 2.2.0 → 2.2.1

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,13 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#130684](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130684)
8
+ [`0656a8915e18f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0656a8915e18f) -
9
+ updated existing fix for focusOut typeahead trigger duplication to also include IE/Edge
10
+
3
11
  ## 2.2.0
4
12
 
5
13
  ### Minor Changes
@@ -284,15 +284,12 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
284
284
  return;
285
285
  }
286
286
 
287
- // See ED-14909: Chrome may emit focusout events where an input
288
- // device was not directly responsible. (This rears in react v17+ consumers
289
- // where react-managed node removal now appears to propagate focusout events to
290
- // our event listener). As this path is strictly for click or other typeahead
291
- // dismissals that don't involve typeahead item selection, we carve out an
292
- // exception for Chrome-specific events where an input device was not the initiator.
293
- if (_browser.browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
287
+ // Chrome and Edge may emit focusout events without direct input.
288
+ // This path handles dismissals that don't involve item selection, so we ignore these events.
289
+ // In Edge this also lead to duplication in the trigger character (@, /, :) as `cancel` would be called twice
290
+ if ((_browser.browser.ie || _browser.browser.chrome) && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
294
291
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
295
- !('sourceCapabilities' in event && event.sourceCapabilities)) {
292
+ !event.sourceCapabilities) {
296
293
  return;
297
294
  }
298
295
  cancel({
@@ -269,15 +269,12 @@ export const InputQuery = /*#__PURE__*/React.memo(({
269
269
  return;
270
270
  }
271
271
 
272
- // See ED-14909: Chrome may emit focusout events where an input
273
- // device was not directly responsible. (This rears in react v17+ consumers
274
- // where react-managed node removal now appears to propagate focusout events to
275
- // our event listener). As this path is strictly for click or other typeahead
276
- // dismissals that don't involve typeahead item selection, we carve out an
277
- // exception for Chrome-specific events where an input device was not the initiator.
278
- if (browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
272
+ // Chrome and Edge may emit focusout events without direct input.
273
+ // This path handles dismissals that don't involve item selection, so we ignore these events.
274
+ // In Edge this also lead to duplication in the trigger character (@, /, :) as `cancel` would be called twice
275
+ if ((browser.ie || browser.chrome) && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
279
276
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
280
- !('sourceCapabilities' in event && event.sourceCapabilities)) {
277
+ !event.sourceCapabilities) {
281
278
  return;
282
279
  }
283
280
  cancel({
@@ -273,15 +273,12 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
273
273
  return;
274
274
  }
275
275
 
276
- // See ED-14909: Chrome may emit focusout events where an input
277
- // device was not directly responsible. (This rears in react v17+ consumers
278
- // where react-managed node removal now appears to propagate focusout events to
279
- // our event listener). As this path is strictly for click or other typeahead
280
- // dismissals that don't involve typeahead item selection, we carve out an
281
- // exception for Chrome-specific events where an input device was not the initiator.
282
- if (browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
276
+ // Chrome and Edge may emit focusout events without direct input.
277
+ // This path handles dismissals that don't involve item selection, so we ignore these events.
278
+ // In Edge this also lead to duplication in the trigger character (@, /, :) as `cancel` would be called twice
279
+ if ((browser.ie || browser.chrome) && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
283
280
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
284
- !('sourceCapabilities' in event && event.sourceCapabilities)) {
281
+ !event.sourceCapabilities) {
285
282
  return;
286
283
  }
287
284
  cancel({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/primitives": "^14.2.0",
49
49
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
50
50
  "@atlaskit/theme": "^18.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^4.2.0",
51
+ "@atlaskit/tmp-editor-statsig": "^4.4.0",
52
52
  "@atlaskit/tokens": "^4.5.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "@emotion/react": "^11.7.1",