@atlaskit/editor-common 110.16.1 → 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 +15 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/HoverLinkOverlay/index.js +10 -2
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +27 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/HoverLinkOverlay/index.js +10 -2
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +27 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/HoverLinkOverlay/index.js +10 -2
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +27 -0
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
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
|
+
|
|
11
|
+
## 110.16.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`c219d22cf0788`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c219d22cf0788) -
|
|
16
|
+
[ux] Card hover link overlay in compact mode
|
|
17
|
+
|
|
3
18
|
## 110.16.1
|
|
4
19
|
|
|
5
20
|
### 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 = "
|
|
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 = "
|
|
27
|
+
var packageVersion = "110.16.2";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -11,9 +11,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
15
|
var _growDiagonal = _interopRequireDefault(require("@atlaskit/icon/core/grow-diagonal"));
|
|
15
16
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
16
17
|
var _panelRight = _interopRequireDefault(require("@atlaskit/icon/core/panel-right"));
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
19
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
18
20
|
var _primitives = require("@atlaskit/primitives");
|
|
19
21
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -34,6 +36,12 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
34
36
|
|
|
35
37
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
36
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Dynamic padding value that adjusts based on the editor's base font size.
|
|
41
|
+
* When base font size is <= akEditorFullPageDenseFontSize (13px), uses 1px padding.
|
|
42
|
+
* Otherwise, uses default value with token('space.025').
|
|
43
|
+
*/
|
|
44
|
+
var DYNAMIC_PADDING_BLOCK = "clamp(1px, calc((var(--ak-editor-base-font-size, ".concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, "px) - ").concat(_editorSharedStyles.akEditorFullPageDenseFontSize, "px) * 999), ", "var(--ds-space-025, 2px)", ")");
|
|
37
45
|
var containerStylesOld = (0, _react2.css)({
|
|
38
46
|
position: 'relative'
|
|
39
47
|
});
|
|
@@ -246,7 +254,7 @@ var HoverLinkOverlayOriginal = function HoverLinkOverlayOriginal(_ref) {
|
|
|
246
254
|
href: url,
|
|
247
255
|
target: "_blank",
|
|
248
256
|
style: {
|
|
249
|
-
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
257
|
+
paddingBlock: compactPadding ? '1px' : (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ? DYNAMIC_PADDING_BLOCK : "var(--ds-space-025, 2px)"
|
|
250
258
|
},
|
|
251
259
|
onClick: handleClick,
|
|
252
260
|
testId: "inline-card-hoverlink-overlay"
|
|
@@ -386,7 +394,7 @@ var HoverLinkOverlayNew = function HoverLinkOverlayNew(_ref2) {
|
|
|
386
394
|
href: url,
|
|
387
395
|
target: "_blank",
|
|
388
396
|
style: {
|
|
389
|
-
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
397
|
+
paddingBlock: compactPadding ? '1px' : (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ? DYNAMIC_PADDING_BLOCK : "var(--ds-space-025, 2px)"
|
|
390
398
|
},
|
|
391
399
|
onClick: handleClick,
|
|
392
400
|
testId: "inline-card-hoverlink-overlay"
|
|
@@ -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 = "
|
|
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 = "
|
|
17
|
+
const packageVersion = "110.16.2";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -8,10 +8,12 @@ import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
9
9
|
import { useIntl } from 'react-intl-next';
|
|
10
10
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
11
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
13
|
import GrowDiagonalIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
13
14
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
14
15
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
17
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
16
18
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
17
19
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
@@ -19,6 +21,12 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
19
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
22
|
import { buildVisitedNonHyperLinkPayload, INPUT_METHOD } from '../../analytics';
|
|
21
23
|
import { cardMessages } from '../../messages';
|
|
24
|
+
/**
|
|
25
|
+
* Dynamic padding value that adjusts based on the editor's base font size.
|
|
26
|
+
* When base font size is <= akEditorFullPageDenseFontSize (13px), uses 1px padding.
|
|
27
|
+
* Otherwise, uses default value with token('space.025').
|
|
28
|
+
*/
|
|
29
|
+
const DYNAMIC_PADDING_BLOCK = `clamp(1px, calc((var(--ak-editor-base-font-size, ${akEditorFullPageDefaultFontSize}px) - ${akEditorFullPageDenseFontSize}px) * 999), ${"var(--ds-space-025, 2px)"})`;
|
|
22
30
|
const containerStylesOld = css({
|
|
23
31
|
position: 'relative'
|
|
24
32
|
});
|
|
@@ -222,7 +230,7 @@ const HoverLinkOverlayOriginal = ({
|
|
|
222
230
|
href: url,
|
|
223
231
|
target: "_blank",
|
|
224
232
|
style: {
|
|
225
|
-
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
233
|
+
paddingBlock: compactPadding ? '1px' : expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? DYNAMIC_PADDING_BLOCK : "var(--ds-space-025, 2px)"
|
|
226
234
|
},
|
|
227
235
|
onClick: handleClick,
|
|
228
236
|
testId: "inline-card-hoverlink-overlay"
|
|
@@ -348,7 +356,7 @@ const HoverLinkOverlayNew = ({
|
|
|
348
356
|
href: url,
|
|
349
357
|
target: "_blank",
|
|
350
358
|
style: {
|
|
351
|
-
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
359
|
+
paddingBlock: compactPadding ? '1px' : expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? DYNAMIC_PADDING_BLOCK : "var(--ds-space-025, 2px)"
|
|
352
360
|
},
|
|
353
361
|
onClick: handleClick,
|
|
354
362
|
testId: "inline-card-hoverlink-overlay"
|
|
@@ -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 = "
|
|
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 = "
|
|
24
|
+
var packageVersion = "110.16.2";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -9,10 +9,12 @@ import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
10
10
|
import { useIntl } from 'react-intl-next';
|
|
11
11
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
+
import { akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
12
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
14
|
import GrowDiagonalIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
14
15
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
15
16
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
18
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
17
19
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
18
20
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
@@ -20,6 +22,12 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
20
22
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
21
23
|
import { buildVisitedNonHyperLinkPayload, INPUT_METHOD } from '../../analytics';
|
|
22
24
|
import { cardMessages } from '../../messages';
|
|
25
|
+
/**
|
|
26
|
+
* Dynamic padding value that adjusts based on the editor's base font size.
|
|
27
|
+
* When base font size is <= akEditorFullPageDenseFontSize (13px), uses 1px padding.
|
|
28
|
+
* Otherwise, uses default value with token('space.025').
|
|
29
|
+
*/
|
|
30
|
+
var DYNAMIC_PADDING_BLOCK = "clamp(1px, calc((var(--ak-editor-base-font-size, ".concat(akEditorFullPageDefaultFontSize, "px) - ").concat(akEditorFullPageDenseFontSize, "px) * 999), ", "var(--ds-space-025, 2px)", ")");
|
|
23
31
|
var containerStylesOld = css({
|
|
24
32
|
position: 'relative'
|
|
25
33
|
});
|
|
@@ -232,7 +240,7 @@ var HoverLinkOverlayOriginal = function HoverLinkOverlayOriginal(_ref) {
|
|
|
232
240
|
href: url,
|
|
233
241
|
target: "_blank",
|
|
234
242
|
style: {
|
|
235
|
-
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
243
|
+
paddingBlock: compactPadding ? '1px' : expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? DYNAMIC_PADDING_BLOCK : "var(--ds-space-025, 2px)"
|
|
236
244
|
},
|
|
237
245
|
onClick: handleClick,
|
|
238
246
|
testId: "inline-card-hoverlink-overlay"
|
|
@@ -372,7 +380,7 @@ var HoverLinkOverlayNew = function HoverLinkOverlayNew(_ref2) {
|
|
|
372
380
|
href: url,
|
|
373
381
|
target: "_blank",
|
|
374
382
|
style: {
|
|
375
|
-
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
383
|
+
paddingBlock: compactPadding ? '1px' : expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? DYNAMIC_PADDING_BLOCK : "var(--ds-space-025, 2px)"
|
|
376
384
|
},
|
|
377
385
|
onClick: handleClick,
|
|
378
386
|
testId: "inline-card-hoverlink-overlay"
|
|
@@ -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.
|
|
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,12 +267,18 @@
|
|
|
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
|
},
|
|
273
276
|
"platform_editor_update_modal_close_button": {
|
|
274
277
|
"type": "boolean"
|
|
275
278
|
},
|
|
279
|
+
"platform_editor_content_mode_button_mvp": {
|
|
280
|
+
"type": "boolean"
|
|
281
|
+
},
|
|
276
282
|
"platform_editor_fix_mixed_types_column_sort": {
|
|
277
283
|
"type": "boolean"
|
|
278
284
|
}
|