@atlaskit/editor-plugin-type-ahead 6.5.3 → 6.5.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,12 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 6.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`14bcefe1ca8ed`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/14bcefe1ca8ed) -
8
+ upgrade use of browser util
9
+
3
10
  ## 6.5.3
4
11
 
5
12
  ### Patch Changes
@@ -259,6 +259,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
259
259
  if (!ref.current) {
260
260
  return;
261
261
  }
262
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
262
263
  var element = ref.current;
263
264
  var _ref3 = (0, _utils2.getPluginState)(editorView.state) || {},
264
265
  removePrefixTriggerOnCancel = _ref3.removePrefixTriggerOnCancel;
@@ -321,7 +322,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
321
322
  // Chrome and Edge may emit focusout events without direct input.
322
323
  // This path handles dismissals that don't involve item selection, so we ignore these events.
323
324
  // In Edge this also lead to duplication in the trigger character (@, /, :) as `cancel` would be called twice
324
- if ((_browser.browser.ie || _browser.browser.chrome) && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
325
+ if ((browser.ie || browser.chrome) && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') &&
325
326
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
326
327
  !event.sourceCapabilities) {
327
328
  return;
@@ -359,7 +360,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
359
360
 
360
361
  // We need to change the content on Safari
361
362
  // and set the cursor at the right place
362
- if (_browser.browser.safari) {
363
+ if (browser.safari) {
363
364
  e.preventDefault();
364
365
  var dataElement = document.createTextNode(e.data);
365
366
  element.appendChild(dataElement);
@@ -373,7 +374,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
373
374
  }
374
375
  };
375
376
  var onInput = function onInput() {};
376
- if (_browser.browser.safari) {
377
+ if (browser.safari) {
377
378
  // On Safari, for reasons beyond my understanding,
378
379
  // The undo behavior is totally different from other browsers
379
380
  // That why we need to have an specific branch only for Safari.
@@ -431,7 +432,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
431
432
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
432
433
  element.removeEventListener('paste', onPaste);
433
434
  }
434
- if (_browser.browser.safari) {
435
+ if (browser.safari) {
435
436
  // Ignored via go/ees005
436
437
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
437
438
  element.removeEventListener('input', onInput);
@@ -8,7 +8,7 @@ import React, { Fragment, useCallback, useLayoutEffect, useMemo, useRef, useStat
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { useIntl } from 'react-intl-next';
10
10
  import { keyName as keyNameNormalized } from 'w3c-keyname';
11
- import { browser } from '@atlaskit/editor-common/browser';
11
+ import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
12
12
  import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
13
13
  import { AssistiveText } from '@atlaskit/editor-common/ui';
14
14
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
@@ -243,6 +243,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
243
243
  if (!ref.current) {
244
244
  return;
245
245
  }
246
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
246
247
  const {
247
248
  current: element
248
249
  } = ref;
@@ -9,7 +9,7 @@ import React, { Fragment, useCallback, useLayoutEffect, useMemo, useRef, useStat
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { useIntl } from 'react-intl-next';
11
11
  import { keyName as keyNameNormalized } from 'w3c-keyname';
12
- import { browser } from '@atlaskit/editor-common/browser';
12
+ import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
13
13
  import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
14
14
  import { AssistiveText } from '@atlaskit/editor-common/ui';
15
15
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
@@ -249,6 +249,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
249
249
  if (!ref.current) {
250
250
  return;
251
251
  }
252
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
252
253
  var element = ref.current;
253
254
  var _ref3 = getPluginState(editorView.state) || {},
254
255
  removePrefixTriggerOnCancel = _ref3.removePrefixTriggerOnCancel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "6.5.3",
3
+ "version": "6.5.4",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",