@atlaskit/editor-common 111.21.0 → 111.21.2
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 +18 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/block-menu/key.js +2 -1
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +5 -3
- package/dist/cjs/element-browser/components/ElementSearch.js +2 -1
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +4 -2
- package/dist/cjs/experiences/ExperienceCheckPopupMutation.js +19 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/block-menu/key.js +2 -1
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +4 -3
- package/dist/es2019/element-browser/components/ElementSearch.js +2 -1
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +4 -2
- package/dist/es2019/experiences/ExperienceCheckPopupMutation.js +16 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/block-menu/key.js +2 -1
- package/dist/esm/element-browser/components/ElementList/ElementList.js +5 -3
- package/dist/esm/element-browser/components/ElementSearch.js +2 -1
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +4 -2
- package/dist/esm/experiences/ExperienceCheckPopupMutation.js +18 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/block-menu/key.d.ts +1 -0
- package/dist/types/element-browser/components/ElementList/ElementList.d.ts +1 -0
- package/dist/types/experiences/ExperienceCheckPopupMutation.d.ts +12 -2
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/block-menu/key.d.ts +1 -0
- package/dist/types-ts4.5/element-browser/components/ElementList/ElementList.d.ts +1 -0
- package/dist/types-ts4.5/experiences/ExperienceCheckPopupMutation.d.ts +12 -2
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.21.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`796722e0def07`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/796722e0def07) -
|
|
8
|
+
[ux] Set tabpanel role only when tablist it defined in the element broser.
|
|
9
|
+
- [`f623524e57d49`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f623524e57d49) -
|
|
10
|
+
Add portalRoot type to ExperienceCheckPopupMutation
|
|
11
|
+
|
|
12
|
+
## 111.21.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`baa2904c84a79`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/baa2904c84a79) -
|
|
17
|
+
[ux] Replaced aria-labelledby attribute with aria-describedby for search input field in the insert
|
|
18
|
+
menu.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 111.21.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -172,6 +172,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
172
172
|
*/
|
|
173
173
|
ACTION["ON_CHANGE_CALLBACK"] = "onChangeCalled";
|
|
174
174
|
ACTION["NESTED_TABLE_TRANSFORMED"] = "nestedTableTransformed";
|
|
175
|
+
ACTION["NATIVE_EMBEDS_TRANSFORMED"] = "nativeEmbedsTransformed";
|
|
175
176
|
ACTION["NEW_COLLAB_SYNC_UP_ERROR_NO_STEPS"] = "newCollabSyncUpErrorNoSteps";
|
|
176
177
|
ACTION["REMOVE_ICON"] = "removedIcon";
|
|
177
178
|
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
@@ -128,5 +128,6 @@ var BLOCK_MENU_TEST_ID = exports.BLOCK_MENU_TEST_ID = 'editor-block-menu';
|
|
|
128
128
|
var BLOCK_MENU_ACTION_TEST_ID = exports.BLOCK_MENU_ACTION_TEST_ID = {
|
|
129
129
|
MOVE_UP: 'block-menu-move-up',
|
|
130
130
|
MOVE_DOWN: 'block-menu-move-down',
|
|
131
|
-
DELETE: 'block-menu-delete'
|
|
131
|
+
DELETE: 'block-menu-delete',
|
|
132
|
+
COPY_LINK: 'block-menu-copy-link'
|
|
132
133
|
};
|
|
@@ -76,7 +76,9 @@ function ElementList(_ref) {
|
|
|
76
76
|
setFocusedCategoryIndex = _ref.setFocusedCategoryIndex,
|
|
77
77
|
setFocusedItemIndex = _ref.setFocusedItemIndex,
|
|
78
78
|
cache = _ref.cache,
|
|
79
|
-
onInsertItem = _ref.onInsertItem
|
|
79
|
+
onInsertItem = _ref.onInsertItem,
|
|
80
|
+
_ref$hasTabListContex = _ref.hasTabListContext,
|
|
81
|
+
hasTabListContext = _ref$hasTabListContex === void 0 ? false : _ref$hasTabListContex;
|
|
80
82
|
var _useContainerWidth = (0, _useContainerWidth2.default)(),
|
|
81
83
|
containerWidth = _useContainerWidth.containerWidth,
|
|
82
84
|
ContainerWidthMonitor = _useContainerWidth.ContainerWidthMonitor;
|
|
@@ -128,8 +130,8 @@ function ElementList(_ref) {
|
|
|
128
130
|
css: elementItemsWrapper,
|
|
129
131
|
"data-testid": "element-items",
|
|
130
132
|
id: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab',
|
|
131
|
-
"aria-labelledby": selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button',
|
|
132
|
-
role:
|
|
133
|
+
"aria-labelledby": !hasTabListContext && (0, _platformFeatureFlags.fg)('platform_editor_ally_remove_role_tabpanel') ? undefined : selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button',
|
|
134
|
+
role: !hasTabListContext && (0, _platformFeatureFlags.fg)('platform_editor_ally_remove_role_tabpanel') ? undefined : 'tabpanel',
|
|
133
135
|
tabIndex: items.length === 0 ? 0 : undefined
|
|
134
136
|
}, !items.length ? emptyStateHandler ? emptyStateHandler({
|
|
135
137
|
mode: mode,
|
|
@@ -116,7 +116,8 @@ function ElementSearch(_ref) {
|
|
|
116
116
|
}, "\u23CE ", formatMessage(_messages.default.elementAfterInputMessage))),
|
|
117
117
|
placeholder: formatMessage(_messages.default.placeHolderMessage),
|
|
118
118
|
"aria-label": (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? formatMessage(_messages.default.searchAriaLabel) : 'search',
|
|
119
|
-
"aria-labelledby":
|
|
119
|
+
"aria-labelledby": (0, _platformFeatureFlags.fg)('platform_editor_ally_remove_role_tabpanel') ? undefined : 'search-assistive',
|
|
120
|
+
"aria-describedby": (0, _platformFeatureFlags.fg)('platform_editor_ally_remove_role_tabpanel') ? 'search-assistive' : undefined
|
|
120
121
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
121
122
|
,
|
|
122
123
|
className: "js-search-input",
|
|
@@ -369,7 +369,8 @@ function MobileBrowser(_ref) {
|
|
|
369
369
|
emptyStateHandler: emptyStateHandler,
|
|
370
370
|
selectedCategory: selectedCategory,
|
|
371
371
|
searchTerm: searchTerm,
|
|
372
|
-
cache: cache
|
|
372
|
+
cache: cache,
|
|
373
|
+
hasTabListContext: false
|
|
373
374
|
})), onViewMore && (0, _react2.jsx)(_ViewMore.ViewMore, {
|
|
374
375
|
onViewMore: onViewMore,
|
|
375
376
|
focus: focusOnViewMore
|
|
@@ -464,7 +465,8 @@ function DesktopBrowser(_ref2) {
|
|
|
464
465
|
selectedCategoryIndex: selectedCategoryIndex,
|
|
465
466
|
searchTerm: searchTerm,
|
|
466
467
|
setFocusedCategoryIndex: showCategories ? setFocusedCategoryIndex : undefined,
|
|
467
|
-
cache: cache
|
|
468
|
+
cache: cache,
|
|
469
|
+
hasTabListContext: showCategories
|
|
468
470
|
})));
|
|
469
471
|
}
|
|
470
472
|
var MemoizedElementBrowser = /*#__PURE__*/(0, _react.memo)((0, _withAnalyticsContext.default)({
|
|
@@ -15,11 +15,14 @@ var _experienceUtils = require("./experience-utils");
|
|
|
15
15
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
16
16
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
17
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
18
|
+
var PORTAL_CONTAINER_SELECTOR = 'body > .atlaskit-portal-container';
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
21
|
* Popup check type determines how popups are observed based on their DOM location:
|
|
20
22
|
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
21
23
|
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
22
24
|
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
25
|
+
* - 'portalRoot': Popups in body > .atlaskit-portal-container (e.g., flags, modals)
|
|
23
26
|
*/
|
|
24
27
|
var ExperienceCheckPopupMutation = exports.ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
25
28
|
function ExperienceCheckPopupMutation(config) {
|
|
@@ -42,9 +45,23 @@ var ExperienceCheckPopupMutation = exports.ExperienceCheckPopupMutation = /*#__P
|
|
|
42
45
|
return this.getEditorRootTargets(config);
|
|
43
46
|
case 'editorContent':
|
|
44
47
|
return this.getEditorContentTargets(config);
|
|
48
|
+
case 'portalRoot':
|
|
49
|
+
return this.getPortalRootTargets();
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
|
|
53
|
+
/**
|
|
54
|
+
* For 'portalRoot' type: observe .atlaskit-portal-container.
|
|
55
|
+
* Popups like flags and modals render in body > .atlaskit-portal-container.
|
|
56
|
+
*/
|
|
57
|
+
}, {
|
|
58
|
+
key: "getPortalRootTargets",
|
|
59
|
+
value: function getPortalRootTargets() {
|
|
60
|
+
var _getDocument;
|
|
61
|
+
var portalContainer = (_getDocument = (0, _browserApis.getDocument)()) === null || _getDocument === void 0 ? void 0 : _getDocument.querySelector(PORTAL_CONTAINER_SELECTOR);
|
|
62
|
+
return portalContainer ? [portalContainer] : [];
|
|
63
|
+
}
|
|
64
|
+
|
|
48
65
|
/**
|
|
49
66
|
* For 'editorContent' type: observe the target (mount point) and any existing
|
|
50
67
|
* [data-editor-popup] wrappers within it. Content-level popups and modals
|
|
@@ -111,16 +128,15 @@ var ExperienceCheckPopupMutation = exports.ExperienceCheckPopupMutation = /*#__P
|
|
|
111
128
|
key: "start",
|
|
112
129
|
value: function start(callback) {
|
|
113
130
|
var _this = this;
|
|
114
|
-
var target = this.config.type === 'editorRoot' ? this.config.getEditorDom() : this.config.getTarget();
|
|
115
131
|
var doc = (0, _browserApis.getDocument)();
|
|
116
|
-
|
|
132
|
+
var observeTargets = this.getObserveTargets();
|
|
133
|
+
if (!doc || !observeTargets.length) {
|
|
117
134
|
callback({
|
|
118
135
|
status: 'failure',
|
|
119
136
|
reason: _consts.EXPERIENCE_FAILURE_REASON.DOM_MUTATION_TARGET_NOT_FOUND
|
|
120
137
|
});
|
|
121
138
|
return;
|
|
122
139
|
}
|
|
123
|
-
var observeTargets = this.getObserveTargets();
|
|
124
140
|
var query = this.config.nestedElementQuery;
|
|
125
141
|
var subtree = this.config.type === 'inline' && this.config.subtree === true;
|
|
126
142
|
var observe = function observe(el) {
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
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); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "0.0.0-development";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// 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 = "0.0.0-development";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -166,6 +166,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
166
166
|
*/
|
|
167
167
|
ACTION["ON_CHANGE_CALLBACK"] = "onChangeCalled";
|
|
168
168
|
ACTION["NESTED_TABLE_TRANSFORMED"] = "nestedTableTransformed";
|
|
169
|
+
ACTION["NATIVE_EMBEDS_TRANSFORMED"] = "nativeEmbedsTransformed";
|
|
169
170
|
ACTION["NEW_COLLAB_SYNC_UP_ERROR_NO_STEPS"] = "newCollabSyncUpErrorNoSteps";
|
|
170
171
|
ACTION["REMOVE_ICON"] = "removedIcon";
|
|
171
172
|
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
@@ -122,5 +122,6 @@ export const BLOCK_MENU_TEST_ID = 'editor-block-menu';
|
|
|
122
122
|
export const BLOCK_MENU_ACTION_TEST_ID = {
|
|
123
123
|
MOVE_UP: 'block-menu-move-up',
|
|
124
124
|
MOVE_DOWN: 'block-menu-move-down',
|
|
125
|
-
DELETE: 'block-menu-delete'
|
|
125
|
+
DELETE: 'block-menu-delete',
|
|
126
|
+
COPY_LINK: 'block-menu-copy-link'
|
|
126
127
|
};
|
|
@@ -64,7 +64,8 @@ function ElementList({
|
|
|
64
64
|
setFocusedCategoryIndex,
|
|
65
65
|
setFocusedItemIndex,
|
|
66
66
|
cache,
|
|
67
|
-
onInsertItem
|
|
67
|
+
onInsertItem,
|
|
68
|
+
hasTabListContext = false
|
|
68
69
|
}) {
|
|
69
70
|
const {
|
|
70
71
|
containerWidth,
|
|
@@ -116,8 +117,8 @@ function ElementList({
|
|
|
116
117
|
css: elementItemsWrapper,
|
|
117
118
|
"data-testid": "element-items",
|
|
118
119
|
id: selectedCategory ? `browse-category-${selectedCategory}-tab` : 'browse-category-tab',
|
|
119
|
-
"aria-labelledby": selectedCategory ? `browse-category--${selectedCategory}-button` : 'browse-category-button',
|
|
120
|
-
role:
|
|
120
|
+
"aria-labelledby": !hasTabListContext && fg('platform_editor_ally_remove_role_tabpanel') ? undefined : selectedCategory ? `browse-category--${selectedCategory}-button` : 'browse-category-button',
|
|
121
|
+
role: !hasTabListContext && fg('platform_editor_ally_remove_role_tabpanel') ? undefined : 'tabpanel',
|
|
121
122
|
tabIndex: items.length === 0 ? 0 : undefined
|
|
122
123
|
}, !items.length ? emptyStateHandler ? emptyStateHandler({
|
|
123
124
|
mode,
|
|
@@ -108,7 +108,8 @@ function ElementSearch({
|
|
|
108
108
|
}, "\u23CE ", formatMessage(commonMessages.elementAfterInputMessage))),
|
|
109
109
|
placeholder: formatMessage(commonMessages.placeHolderMessage),
|
|
110
110
|
"aria-label": fg('platform_editor_dec_a11y_fixes') ? formatMessage(commonMessages.searchAriaLabel) : 'search',
|
|
111
|
-
"aria-labelledby":
|
|
111
|
+
"aria-labelledby": fg('platform_editor_ally_remove_role_tabpanel') ? undefined : 'search-assistive',
|
|
112
|
+
"aria-describedby": fg('platform_editor_ally_remove_role_tabpanel') ? 'search-assistive' : undefined
|
|
112
113
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
113
114
|
,
|
|
114
115
|
className: "js-search-input",
|
|
@@ -355,7 +355,8 @@ function MobileBrowser({
|
|
|
355
355
|
emptyStateHandler: emptyStateHandler,
|
|
356
356
|
selectedCategory: selectedCategory,
|
|
357
357
|
searchTerm: searchTerm,
|
|
358
|
-
cache: cache
|
|
358
|
+
cache: cache,
|
|
359
|
+
hasTabListContext: false
|
|
359
360
|
})), onViewMore && jsx(ViewMore, {
|
|
360
361
|
onViewMore: onViewMore,
|
|
361
362
|
focus: focusOnViewMore
|
|
@@ -450,7 +451,8 @@ function DesktopBrowser({
|
|
|
450
451
|
selectedCategoryIndex: selectedCategoryIndex,
|
|
451
452
|
searchTerm: searchTerm,
|
|
452
453
|
setFocusedCategoryIndex: showCategories ? setFocusedCategoryIndex : undefined,
|
|
453
|
-
cache: cache
|
|
454
|
+
cache: cache,
|
|
455
|
+
hasTabListContext: showCategories
|
|
454
456
|
})));
|
|
455
457
|
}
|
|
456
458
|
const MemoizedElementBrowser = /*#__PURE__*/memo(withAnalyticsContext({
|
|
@@ -2,12 +2,14 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { getDocument } from '@atlaskit/browser-apis';
|
|
3
3
|
import { EXPERIENCE_FAILURE_REASON } from './consts';
|
|
4
4
|
import { popupWithNestedElement } from './experience-utils';
|
|
5
|
+
const PORTAL_CONTAINER_SELECTOR = 'body > .atlaskit-portal-container';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Popup check type determines how popups are observed based on their DOM location:
|
|
8
9
|
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
9
10
|
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
10
11
|
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
12
|
+
* - 'portalRoot': Popups in body > .atlaskit-portal-container (e.g., flags, modals)
|
|
11
13
|
*/
|
|
12
14
|
|
|
13
15
|
export class ExperienceCheckPopupMutation {
|
|
@@ -30,9 +32,21 @@ export class ExperienceCheckPopupMutation {
|
|
|
30
32
|
return this.getEditorRootTargets(config);
|
|
31
33
|
case 'editorContent':
|
|
32
34
|
return this.getEditorContentTargets(config);
|
|
35
|
+
case 'portalRoot':
|
|
36
|
+
return this.getPortalRootTargets();
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
|
|
40
|
+
/**
|
|
41
|
+
* For 'portalRoot' type: observe .atlaskit-portal-container.
|
|
42
|
+
* Popups like flags and modals render in body > .atlaskit-portal-container.
|
|
43
|
+
*/
|
|
44
|
+
getPortalRootTargets() {
|
|
45
|
+
var _getDocument;
|
|
46
|
+
const portalContainer = (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : _getDocument.querySelector(PORTAL_CONTAINER_SELECTOR);
|
|
47
|
+
return portalContainer ? [portalContainer] : [];
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
/**
|
|
37
51
|
* For 'editorContent' type: observe the target (mount point) and any existing
|
|
38
52
|
* [data-editor-popup] wrappers within it. Content-level popups and modals
|
|
@@ -81,16 +95,15 @@ export class ExperienceCheckPopupMutation {
|
|
|
81
95
|
return targets;
|
|
82
96
|
}
|
|
83
97
|
start(callback) {
|
|
84
|
-
const target = this.config.type === 'editorRoot' ? this.config.getEditorDom() : this.config.getTarget();
|
|
85
98
|
const doc = getDocument();
|
|
86
|
-
|
|
99
|
+
const observeTargets = this.getObserveTargets();
|
|
100
|
+
if (!doc || !observeTargets.length) {
|
|
87
101
|
callback({
|
|
88
102
|
status: 'failure',
|
|
89
103
|
reason: EXPERIENCE_FAILURE_REASON.DOM_MUTATION_TARGET_NOT_FOUND
|
|
90
104
|
});
|
|
91
105
|
return;
|
|
92
106
|
}
|
|
93
|
-
const observeTargets = this.getObserveTargets();
|
|
94
107
|
const query = this.config.nestedElementQuery;
|
|
95
108
|
const subtree = this.config.type === 'inline' && this.config.subtree === true;
|
|
96
109
|
const observe = el => {
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "0.0.0-development";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// 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 = "0.0.0-development";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -166,6 +166,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
166
166
|
*/
|
|
167
167
|
ACTION["ON_CHANGE_CALLBACK"] = "onChangeCalled";
|
|
168
168
|
ACTION["NESTED_TABLE_TRANSFORMED"] = "nestedTableTransformed";
|
|
169
|
+
ACTION["NATIVE_EMBEDS_TRANSFORMED"] = "nativeEmbedsTransformed";
|
|
169
170
|
ACTION["NEW_COLLAB_SYNC_UP_ERROR_NO_STEPS"] = "newCollabSyncUpErrorNoSteps";
|
|
170
171
|
ACTION["REMOVE_ICON"] = "removedIcon";
|
|
171
172
|
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
@@ -122,5 +122,6 @@ export var BLOCK_MENU_TEST_ID = 'editor-block-menu';
|
|
|
122
122
|
export var BLOCK_MENU_ACTION_TEST_ID = {
|
|
123
123
|
MOVE_UP: 'block-menu-move-up',
|
|
124
124
|
MOVE_DOWN: 'block-menu-move-down',
|
|
125
|
-
DELETE: 'block-menu-delete'
|
|
125
|
+
DELETE: 'block-menu-delete',
|
|
126
|
+
COPY_LINK: 'block-menu-copy-link'
|
|
126
127
|
};
|
|
@@ -65,7 +65,9 @@ function ElementList(_ref) {
|
|
|
65
65
|
setFocusedCategoryIndex = _ref.setFocusedCategoryIndex,
|
|
66
66
|
setFocusedItemIndex = _ref.setFocusedItemIndex,
|
|
67
67
|
cache = _ref.cache,
|
|
68
|
-
onInsertItem = _ref.onInsertItem
|
|
68
|
+
onInsertItem = _ref.onInsertItem,
|
|
69
|
+
_ref$hasTabListContex = _ref.hasTabListContext,
|
|
70
|
+
hasTabListContext = _ref$hasTabListContex === void 0 ? false : _ref$hasTabListContex;
|
|
69
71
|
var _useContainerWidth = useContainerWidth(),
|
|
70
72
|
containerWidth = _useContainerWidth.containerWidth,
|
|
71
73
|
ContainerWidthMonitor = _useContainerWidth.ContainerWidthMonitor;
|
|
@@ -117,8 +119,8 @@ function ElementList(_ref) {
|
|
|
117
119
|
css: elementItemsWrapper,
|
|
118
120
|
"data-testid": "element-items",
|
|
119
121
|
id: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab',
|
|
120
|
-
"aria-labelledby": selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button',
|
|
121
|
-
role:
|
|
122
|
+
"aria-labelledby": !hasTabListContext && fg('platform_editor_ally_remove_role_tabpanel') ? undefined : selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button',
|
|
123
|
+
role: !hasTabListContext && fg('platform_editor_ally_remove_role_tabpanel') ? undefined : 'tabpanel',
|
|
122
124
|
tabIndex: items.length === 0 ? 0 : undefined
|
|
123
125
|
}, !items.length ? emptyStateHandler ? emptyStateHandler({
|
|
124
126
|
mode: mode,
|
|
@@ -106,7 +106,8 @@ function ElementSearch(_ref) {
|
|
|
106
106
|
}, "\u23CE ", formatMessage(commonMessages.elementAfterInputMessage))),
|
|
107
107
|
placeholder: formatMessage(commonMessages.placeHolderMessage),
|
|
108
108
|
"aria-label": fg('platform_editor_dec_a11y_fixes') ? formatMessage(commonMessages.searchAriaLabel) : 'search',
|
|
109
|
-
"aria-labelledby":
|
|
109
|
+
"aria-labelledby": fg('platform_editor_ally_remove_role_tabpanel') ? undefined : 'search-assistive',
|
|
110
|
+
"aria-describedby": fg('platform_editor_ally_remove_role_tabpanel') ? 'search-assistive' : undefined
|
|
110
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
111
112
|
,
|
|
112
113
|
className: "js-search-input",
|
|
@@ -359,7 +359,8 @@ function MobileBrowser(_ref) {
|
|
|
359
359
|
emptyStateHandler: emptyStateHandler,
|
|
360
360
|
selectedCategory: selectedCategory,
|
|
361
361
|
searchTerm: searchTerm,
|
|
362
|
-
cache: cache
|
|
362
|
+
cache: cache,
|
|
363
|
+
hasTabListContext: false
|
|
363
364
|
})), onViewMore && jsx(ViewMore, {
|
|
364
365
|
onViewMore: onViewMore,
|
|
365
366
|
focus: focusOnViewMore
|
|
@@ -454,7 +455,8 @@ function DesktopBrowser(_ref2) {
|
|
|
454
455
|
selectedCategoryIndex: selectedCategoryIndex,
|
|
455
456
|
searchTerm: searchTerm,
|
|
456
457
|
setFocusedCategoryIndex: showCategories ? setFocusedCategoryIndex : undefined,
|
|
457
|
-
cache: cache
|
|
458
|
+
cache: cache,
|
|
459
|
+
hasTabListContext: showCategories
|
|
458
460
|
})));
|
|
459
461
|
}
|
|
460
462
|
var MemoizedElementBrowser = /*#__PURE__*/memo(withAnalyticsContext({
|
|
@@ -8,12 +8,14 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
8
8
|
import { getDocument } from '@atlaskit/browser-apis';
|
|
9
9
|
import { EXPERIENCE_FAILURE_REASON } from './consts';
|
|
10
10
|
import { popupWithNestedElement } from './experience-utils';
|
|
11
|
+
var PORTAL_CONTAINER_SELECTOR = 'body > .atlaskit-portal-container';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Popup check type determines how popups are observed based on their DOM location:
|
|
14
15
|
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
15
16
|
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
16
17
|
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
18
|
+
* - 'portalRoot': Popups in body > .atlaskit-portal-container (e.g., flags, modals)
|
|
17
19
|
*/
|
|
18
20
|
|
|
19
21
|
export var ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
@@ -37,9 +39,23 @@ export var ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
|
37
39
|
return this.getEditorRootTargets(config);
|
|
38
40
|
case 'editorContent':
|
|
39
41
|
return this.getEditorContentTargets(config);
|
|
42
|
+
case 'portalRoot':
|
|
43
|
+
return this.getPortalRootTargets();
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
/**
|
|
48
|
+
* For 'portalRoot' type: observe .atlaskit-portal-container.
|
|
49
|
+
* Popups like flags and modals render in body > .atlaskit-portal-container.
|
|
50
|
+
*/
|
|
51
|
+
}, {
|
|
52
|
+
key: "getPortalRootTargets",
|
|
53
|
+
value: function getPortalRootTargets() {
|
|
54
|
+
var _getDocument;
|
|
55
|
+
var portalContainer = (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : _getDocument.querySelector(PORTAL_CONTAINER_SELECTOR);
|
|
56
|
+
return portalContainer ? [portalContainer] : [];
|
|
57
|
+
}
|
|
58
|
+
|
|
43
59
|
/**
|
|
44
60
|
* For 'editorContent' type: observe the target (mount point) and any existing
|
|
45
61
|
* [data-editor-popup] wrappers within it. Content-level popups and modals
|
|
@@ -106,16 +122,15 @@ export var ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
|
106
122
|
key: "start",
|
|
107
123
|
value: function start(callback) {
|
|
108
124
|
var _this = this;
|
|
109
|
-
var target = this.config.type === 'editorRoot' ? this.config.getEditorDom() : this.config.getTarget();
|
|
110
125
|
var doc = getDocument();
|
|
111
|
-
|
|
126
|
+
var observeTargets = this.getObserveTargets();
|
|
127
|
+
if (!doc || !observeTargets.length) {
|
|
112
128
|
callback({
|
|
113
129
|
status: 'failure',
|
|
114
130
|
reason: EXPERIENCE_FAILURE_REASON.DOM_MUTATION_TARGET_NOT_FOUND
|
|
115
131
|
});
|
|
116
132
|
return;
|
|
117
133
|
}
|
|
118
|
-
var observeTargets = this.getObserveTargets();
|
|
119
134
|
var query = this.config.nestedElementQuery;
|
|
120
135
|
var subtree = this.config.type === 'inline' && this.config.subtree === true;
|
|
121
136
|
var observe = function observe(el) {
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "0.0.0-development";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// 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 = "0.0.0-development";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -165,6 +165,7 @@ export declare enum ACTION {
|
|
|
165
165
|
*/
|
|
166
166
|
ON_CHANGE_CALLBACK = "onChangeCalled",
|
|
167
167
|
NESTED_TABLE_TRANSFORMED = "nestedTableTransformed",
|
|
168
|
+
NATIVE_EMBEDS_TRANSFORMED = "nativeEmbedsTransformed",
|
|
168
169
|
NEW_COLLAB_SYNC_UP_ERROR_NO_STEPS = "newCollabSyncUpErrorNoSteps",
|
|
169
170
|
REMOVE_ICON = "removedIcon",
|
|
170
171
|
INVALID_PROSEMIRROR_DOCUMENT = "invalidProsemirrorDocument",
|
|
@@ -18,6 +18,7 @@ export interface Props {
|
|
|
18
18
|
columnCount: number;
|
|
19
19
|
emptyStateHandler?: EmptyStateHandler;
|
|
20
20
|
focusOnEmptyStateButton?: boolean;
|
|
21
|
+
hasTabListContext?: boolean;
|
|
21
22
|
items: QuickInsertItem[];
|
|
22
23
|
mode: keyof typeof Modes;
|
|
23
24
|
onInsertItem: (item: QuickInsertItem) => void;
|
|
@@ -4,8 +4,9 @@ import type { ExperienceCheck, ExperienceCheckCallback } from './ExperienceCheck
|
|
|
4
4
|
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
5
5
|
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
6
6
|
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
7
|
+
* - 'portalRoot': Popups in body > .atlaskit-portal-container (e.g., flags, modals)
|
|
7
8
|
*/
|
|
8
|
-
export type PopupCheckType = 'inline' | 'editorRoot' | 'editorContent';
|
|
9
|
+
export type PopupCheckType = 'inline' | 'editorRoot' | 'editorContent' | 'portalRoot';
|
|
9
10
|
type InlineConfig = {
|
|
10
11
|
getTarget: () => HTMLElement | undefined | null;
|
|
11
12
|
nestedElementQuery: string;
|
|
@@ -27,7 +28,11 @@ type EditorContentConfig = {
|
|
|
27
28
|
nestedElementQuery: string;
|
|
28
29
|
type: 'editorContent';
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
type PortalRootConfig = {
|
|
32
|
+
nestedElementQuery: string;
|
|
33
|
+
type: 'portalRoot';
|
|
34
|
+
};
|
|
35
|
+
export type ExperienceCheckPopupMutationConfig = InlineConfig | EditorRootConfig | EditorContentConfig | PortalRootConfig;
|
|
31
36
|
export declare class ExperienceCheckPopupMutation implements ExperienceCheck {
|
|
32
37
|
private config;
|
|
33
38
|
private observers;
|
|
@@ -36,6 +41,11 @@ export declare class ExperienceCheckPopupMutation implements ExperienceCheck {
|
|
|
36
41
|
* Returns the list of DOM elements to observe based on popup type.
|
|
37
42
|
*/
|
|
38
43
|
private getObserveTargets;
|
|
44
|
+
/**
|
|
45
|
+
* For 'portalRoot' type: observe .atlaskit-portal-container.
|
|
46
|
+
* Popups like flags and modals render in body > .atlaskit-portal-container.
|
|
47
|
+
*/
|
|
48
|
+
private getPortalRootTargets;
|
|
39
49
|
/**
|
|
40
50
|
* For 'editorContent' type: observe the target (mount point) and any existing
|
|
41
51
|
* [data-editor-popup] wrappers within it. Content-level popups and modals
|
|
@@ -165,6 +165,7 @@ export declare enum ACTION {
|
|
|
165
165
|
*/
|
|
166
166
|
ON_CHANGE_CALLBACK = "onChangeCalled",
|
|
167
167
|
NESTED_TABLE_TRANSFORMED = "nestedTableTransformed",
|
|
168
|
+
NATIVE_EMBEDS_TRANSFORMED = "nativeEmbedsTransformed",
|
|
168
169
|
NEW_COLLAB_SYNC_UP_ERROR_NO_STEPS = "newCollabSyncUpErrorNoSteps",
|
|
169
170
|
REMOVE_ICON = "removedIcon",
|
|
170
171
|
INVALID_PROSEMIRROR_DOCUMENT = "invalidProsemirrorDocument",
|
|
@@ -18,6 +18,7 @@ export interface Props {
|
|
|
18
18
|
columnCount: number;
|
|
19
19
|
emptyStateHandler?: EmptyStateHandler;
|
|
20
20
|
focusOnEmptyStateButton?: boolean;
|
|
21
|
+
hasTabListContext?: boolean;
|
|
21
22
|
items: QuickInsertItem[];
|
|
22
23
|
mode: keyof typeof Modes;
|
|
23
24
|
onInsertItem: (item: QuickInsertItem) => void;
|
|
@@ -4,8 +4,9 @@ import type { ExperienceCheck, ExperienceCheckCallback } from './ExperienceCheck
|
|
|
4
4
|
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
5
5
|
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
6
6
|
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
7
|
+
* - 'portalRoot': Popups in body > .atlaskit-portal-container (e.g., flags, modals)
|
|
7
8
|
*/
|
|
8
|
-
export type PopupCheckType = 'inline' | 'editorRoot' | 'editorContent';
|
|
9
|
+
export type PopupCheckType = 'inline' | 'editorRoot' | 'editorContent' | 'portalRoot';
|
|
9
10
|
type InlineConfig = {
|
|
10
11
|
getTarget: () => HTMLElement | undefined | null;
|
|
11
12
|
nestedElementQuery: string;
|
|
@@ -27,7 +28,11 @@ type EditorContentConfig = {
|
|
|
27
28
|
nestedElementQuery: string;
|
|
28
29
|
type: 'editorContent';
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
type PortalRootConfig = {
|
|
32
|
+
nestedElementQuery: string;
|
|
33
|
+
type: 'portalRoot';
|
|
34
|
+
};
|
|
35
|
+
export type ExperienceCheckPopupMutationConfig = InlineConfig | EditorRootConfig | EditorContentConfig | PortalRootConfig;
|
|
31
36
|
export declare class ExperienceCheckPopupMutation implements ExperienceCheck {
|
|
32
37
|
private config;
|
|
33
38
|
private observers;
|
|
@@ -36,6 +41,11 @@ export declare class ExperienceCheckPopupMutation implements ExperienceCheck {
|
|
|
36
41
|
* Returns the list of DOM elements to observe based on popup type.
|
|
37
42
|
*/
|
|
38
43
|
private getObserveTargets;
|
|
44
|
+
/**
|
|
45
|
+
* For 'portalRoot' type: observe .atlaskit-portal-container.
|
|
46
|
+
* Popups like flags and modals render in body > .atlaskit-portal-container.
|
|
47
|
+
*/
|
|
48
|
+
private getPortalRootTargets;
|
|
39
49
|
/**
|
|
40
50
|
* For 'editorContent' type: observe the target (mount point) and any existing
|
|
41
51
|
* [data-editor-popup] wrappers within it. Content-level popups and modals
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.21.
|
|
3
|
+
"version": "111.21.2",
|
|
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/"
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@atlaskit/react-ufo": "^5.4.0",
|
|
77
77
|
"@atlaskit/section-message": "^8.12.0",
|
|
78
78
|
"@atlaskit/smart-card": "^43.25.0",
|
|
79
|
-
"@atlaskit/smart-user-picker": "^9.
|
|
79
|
+
"@atlaskit/smart-user-picker": "^9.1.0",
|
|
80
80
|
"@atlaskit/spinner": "^19.0.0",
|
|
81
81
|
"@atlaskit/status": "^3.1.0",
|
|
82
82
|
"@atlaskit/task-decision": "^19.3.0",
|
|
@@ -265,6 +265,9 @@
|
|
|
265
265
|
"platform_editor_dec_a11y_fixes": {
|
|
266
266
|
"type": "boolean"
|
|
267
267
|
},
|
|
268
|
+
"platform_editor_ally_remove_role_tabpanel": {
|
|
269
|
+
"type": "boolean"
|
|
270
|
+
},
|
|
268
271
|
"platform_editor_native_anchor_patch_2": {
|
|
269
272
|
"type": "boolean"
|
|
270
273
|
},
|