@atlaskit/editor-common 110.16.2 → 110.16.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,13 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 110.16.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4821b70c5e660`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4821b70c5e660) -
8
+ ED-29531 Arrow key navigation on primary toolbar cannot go pass format text dropdown button
9
+ - Updated dependencies
10
+
3
11
  ## 110.16.2
4
12
 
5
13
  ### Patch Changes
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "110.16.1";
19
+ var packageVersion = "110.16.2";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "110.16.1";
27
+ var packageVersion = "110.16.2";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ToolbarArrowKeyNavigationProvider = exports.KeyDownHandlerContext = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _react2 = require("@emotion/react");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var _elementBrowser = require("../../element-browser");
11
12
  var _messages = require("../../messages");
12
13
  var _mediaInsert = require("../../messages/media-insert");
@@ -248,12 +249,38 @@ function getFocusableElements(rootNode) {
248
249
  var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, div[tabindex="-1"], div[tabindex="0"]') || [];
249
250
  return Array.from(focusableModalElements);
250
251
  }
252
+ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
253
+ var currentElement = element;
254
+ while (currentElement && currentElement !== rootNode && currentElement !== document.body) {
255
+ var style = window.getComputedStyle(currentElement);
256
+
257
+ // Check if current element is hidden
258
+ if (style.visibility === 'hidden' || style.display === 'none') {
259
+ return true;
260
+ }
261
+
262
+ // Check if current element is disabled
263
+ if (currentElement.hasAttribute('disabled') || currentElement.getAttribute('aria-disabled') === 'true' || currentElement.disabled === true) {
264
+ return true;
265
+ }
266
+
267
+ // Move to parent element
268
+ currentElement = currentElement.parentElement;
269
+ }
270
+ return false;
271
+ }
251
272
  function getFilteredFocusableElements(rootNode) {
252
273
  // The focusable elements from child components such as dropdown menus / popups are ignored
253
274
  return getFocusableElements(rootNode).filter(function (elm) {
254
275
  var style = window.getComputedStyle(elm);
255
276
  // ignore invisible element to avoid losing focus
256
277
  var isVisible = style.visibility !== 'hidden' && style.display !== 'none';
278
+
279
+ // Check if element or any ancestor is hidden or disabled
280
+ var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
281
+ if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_patch_7')) {
282
+ return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
283
+ }
257
284
  return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && isVisible;
258
285
  });
259
286
  }
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "110.16.1";
4
+ const packageVersion = "110.16.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "110.16.1";
17
+ const packageVersion = "110.16.2";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -7,6 +7,7 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { ELEMENT_BROWSER_ID } from '../../element-browser';
11
12
  import { fullPageMessages } from '../../messages';
12
13
  import { mediaInsertMessages } from '../../messages/media-insert';
@@ -240,12 +241,38 @@ function getFocusableElements(rootNode) {
240
241
  const focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, div[tabindex="-1"], div[tabindex="0"]') || [];
241
242
  return Array.from(focusableModalElements);
242
243
  }
244
+ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
245
+ let currentElement = element;
246
+ while (currentElement && currentElement !== rootNode && currentElement !== document.body) {
247
+ const style = window.getComputedStyle(currentElement);
248
+
249
+ // Check if current element is hidden
250
+ if (style.visibility === 'hidden' || style.display === 'none') {
251
+ return true;
252
+ }
253
+
254
+ // Check if current element is disabled
255
+ if (currentElement.hasAttribute('disabled') || currentElement.getAttribute('aria-disabled') === 'true' || currentElement.disabled === true) {
256
+ return true;
257
+ }
258
+
259
+ // Move to parent element
260
+ currentElement = currentElement.parentElement;
261
+ }
262
+ return false;
263
+ }
243
264
  function getFilteredFocusableElements(rootNode) {
244
265
  // The focusable elements from child components such as dropdown menus / popups are ignored
245
266
  return getFocusableElements(rootNode).filter(elm => {
246
267
  const style = window.getComputedStyle(elm);
247
268
  // ignore invisible element to avoid losing focus
248
269
  const isVisible = style.visibility !== 'hidden' && style.display !== 'none';
270
+
271
+ // Check if element or any ancestor is hidden or disabled
272
+ const isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
273
+ if (fg('platform_editor_toolbar_aifc_patch_7')) {
274
+ return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
275
+ }
249
276
  return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && isVisible;
250
277
  });
251
278
  }
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "110.16.1";
10
+ var packageVersion = "110.16.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "110.16.1";
24
+ var packageVersion = "110.16.2";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -7,6 +7,7 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { ELEMENT_BROWSER_ID } from '../../element-browser';
11
12
  import { fullPageMessages } from '../../messages';
12
13
  import { mediaInsertMessages } from '../../messages/media-insert';
@@ -240,12 +241,38 @@ function getFocusableElements(rootNode) {
240
241
  var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, div[tabindex="-1"], div[tabindex="0"]') || [];
241
242
  return Array.from(focusableModalElements);
242
243
  }
244
+ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
245
+ var currentElement = element;
246
+ while (currentElement && currentElement !== rootNode && currentElement !== document.body) {
247
+ var style = window.getComputedStyle(currentElement);
248
+
249
+ // Check if current element is hidden
250
+ if (style.visibility === 'hidden' || style.display === 'none') {
251
+ return true;
252
+ }
253
+
254
+ // Check if current element is disabled
255
+ if (currentElement.hasAttribute('disabled') || currentElement.getAttribute('aria-disabled') === 'true' || currentElement.disabled === true) {
256
+ return true;
257
+ }
258
+
259
+ // Move to parent element
260
+ currentElement = currentElement.parentElement;
261
+ }
262
+ return false;
263
+ }
243
264
  function getFilteredFocusableElements(rootNode) {
244
265
  // The focusable elements from child components such as dropdown menus / popups are ignored
245
266
  return getFocusableElements(rootNode).filter(function (elm) {
246
267
  var style = window.getComputedStyle(elm);
247
268
  // ignore invisible element to avoid losing focus
248
269
  var isVisible = style.visibility !== 'hidden' && style.display !== 'none';
270
+
271
+ // Check if element or any ancestor is hidden or disabled
272
+ var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
273
+ if (fg('platform_editor_toolbar_aifc_patch_7')) {
274
+ return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
275
+ }
249
276
  return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && isVisible;
250
277
  });
251
278
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "110.16.2",
3
+ "version": "110.16.3",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -267,6 +267,9 @@
267
267
  "platform_editor_a11y_insert_link_item_focus": {
268
268
  "type": "boolean"
269
269
  },
270
+ "platform_editor_toolbar_aifc_patch_7": {
271
+ "type": "boolean"
272
+ },
270
273
  "platform_editor_block_menu_format_rank_revised": {
271
274
  "type": "boolean"
272
275
  },