@atlaskit/editor-common 78.17.1 → 78.18.0

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.
Files changed (117) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/analytics/package.json +1 -1
  3. package/annotation/package.json +1 -1
  4. package/card/package.json +1 -1
  5. package/clipboard/package.json +1 -1
  6. package/collab/package.json +1 -1
  7. package/commands/package.json +1 -1
  8. package/constants/package.json +1 -1
  9. package/copy-button/package.json +1 -1
  10. package/core-utils/package.json +1 -1
  11. package/dist/cjs/element-browser/components/CategoryList.js +6 -2
  12. package/dist/cjs/element-browser/components/ElementList/ElementList.js +10 -6
  13. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +82 -20
  14. package/dist/cjs/extensibility/Extension/Extension/index.js +17 -12
  15. package/dist/cjs/extensibility/MultiBodiedExtension/index.js +16 -12
  16. package/dist/cjs/hooks/useSharedPluginState.js +3 -0
  17. package/dist/cjs/monitoring/error.js +1 -1
  18. package/dist/cjs/ui/DropList/index.js +1 -1
  19. package/dist/es2019/element-browser/components/CategoryList.js +6 -2
  20. package/dist/es2019/element-browser/components/ElementList/ElementList.js +10 -6
  21. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +81 -99
  22. package/dist/es2019/extensibility/Extension/Extension/index.js +16 -11
  23. package/dist/es2019/extensibility/MultiBodiedExtension/index.js +15 -11
  24. package/dist/es2019/hooks/useSharedPluginState.js +5 -0
  25. package/dist/es2019/monitoring/error.js +1 -1
  26. package/dist/es2019/ui/DropList/index.js +1 -1
  27. package/dist/esm/element-browser/components/CategoryList.js +6 -2
  28. package/dist/esm/element-browser/components/ElementList/ElementList.js +10 -6
  29. package/dist/esm/element-browser/components/StatelessElementBrowser.js +81 -20
  30. package/dist/esm/extensibility/Extension/Extension/index.js +17 -12
  31. package/dist/esm/extensibility/MultiBodiedExtension/index.js +16 -12
  32. package/dist/esm/hooks/useSharedPluginState.js +3 -0
  33. package/dist/esm/monitoring/error.js +1 -1
  34. package/dist/esm/ui/DropList/index.js +1 -1
  35. package/dist/types/analytics/types/enums.d.ts +2 -2
  36. package/dist/types/annotation/index.d.ts +2 -0
  37. package/dist/types/commands/index.d.ts +3 -3
  38. package/dist/types/element-browser/components/ElementSearch.d.ts +1 -1
  39. package/dist/types/floating-toolbar/index.d.ts +1 -1
  40. package/dist/types/link/LinkSearch/LinkSearchListItem.d.ts +2 -2
  41. package/dist/types/preset/plugin-injection-api.d.ts +1 -1
  42. package/dist/types/provider-helpers/promise-helpers.d.ts +2 -2
  43. package/dist/types/styles/shared/resizer.d.ts +3 -3
  44. package/dist/types/ui/Caption/index.d.ts +2 -2
  45. package/dist/types/ui/UnsupportedBlock/index.d.ts +2 -2
  46. package/dist/types/ui/UnsupportedInline/index.d.ts +2 -2
  47. package/dist/types/ui-color/ColorPalette/index.d.ts +2 -2
  48. package/dist/types/utils/compare-props.d.ts +2 -2
  49. package/dist/types/utils/imageLoader.d.ts +1 -1
  50. package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -2
  51. package/dist/types-ts4.5/annotation/index.d.ts +2 -0
  52. package/dist/types-ts4.5/commands/index.d.ts +3 -3
  53. package/dist/types-ts4.5/element-browser/components/ElementSearch.d.ts +1 -1
  54. package/dist/types-ts4.5/floating-toolbar/index.d.ts +1 -1
  55. package/dist/types-ts4.5/link/LinkSearch/LinkSearchListItem.d.ts +2 -2
  56. package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +2 -2
  57. package/dist/types-ts4.5/provider-helpers/promise-helpers.d.ts +2 -2
  58. package/dist/types-ts4.5/styles/shared/resizer.d.ts +3 -3
  59. package/dist/types-ts4.5/ui/Caption/index.d.ts +2 -2
  60. package/dist/types-ts4.5/ui/UnsupportedBlock/index.d.ts +2 -2
  61. package/dist/types-ts4.5/ui/UnsupportedInline/index.d.ts +2 -2
  62. package/dist/types-ts4.5/ui-color/ColorPalette/index.d.ts +2 -2
  63. package/dist/types-ts4.5/utils/compare-props.d.ts +2 -2
  64. package/dist/types-ts4.5/utils/imageLoader.d.ts +1 -1
  65. package/doc-utils/package.json +1 -1
  66. package/editor-analytics/package.json +1 -1
  67. package/element-browser/package.json +1 -1
  68. package/emoji/package.json +1 -1
  69. package/error-boundary/package.json +1 -1
  70. package/event-dispatcher/package.json +1 -1
  71. package/extensibility/package.json +1 -1
  72. package/extensions/package.json +1 -1
  73. package/floating-toolbar/package.json +1 -1
  74. package/guideline/package.json +1 -1
  75. package/hooks/package.json +1 -1
  76. package/icons/package.json +1 -1
  77. package/in-product/package.json +1 -1
  78. package/indentation/package.json +1 -1
  79. package/insert/package.json +1 -1
  80. package/keymaps/package.json +1 -1
  81. package/legacy-rank-plugins/package.json +1 -1
  82. package/link/package.json +1 -1
  83. package/lists/package.json +1 -1
  84. package/mark/package.json +1 -1
  85. package/media/package.json +1 -1
  86. package/media-inline/package.json +1 -1
  87. package/media-single/package.json +1 -1
  88. package/mention/package.json +1 -1
  89. package/messages/package.json +1 -1
  90. package/monitoring/package.json +1 -1
  91. package/node-width/package.json +1 -1
  92. package/normalize-feature-flags/package.json +1 -1
  93. package/package.json +4 -4
  94. package/panel/package.json +1 -1
  95. package/paste/package.json +1 -1
  96. package/portal-provider/package.json +1 -1
  97. package/preset/package.json +1 -1
  98. package/provider-factory/package.json +1 -1
  99. package/provider-helpers/package.json +1 -1
  100. package/quick-insert/package.json +1 -1
  101. package/react-node-view/package.json +1 -1
  102. package/resizer/package.json +1 -1
  103. package/safe-plugin/package.json +1 -1
  104. package/selection/package.json +1 -1
  105. package/selection-based-node-view/package.json +1 -1
  106. package/styles/package.json +1 -1
  107. package/transforms/package.json +1 -1
  108. package/type-ahead/package.json +1 -1
  109. package/types/package.json +1 -1
  110. package/ufo/package.json +1 -1
  111. package/ui/package.json +1 -1
  112. package/ui-color/package.json +1 -1
  113. package/ui-menu/package.json +1 -1
  114. package/ui-react/package.json +1 -1
  115. package/utils/package.json +1 -1
  116. package/validator/package.json +1 -1
  117. package/with-plugin-state/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#71857](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71857) [`bd0fdd102253`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bd0fdd102253) - Added correct role for Browse tablist, added aria-selected toggle, added functionality for aria-controls, added tabpanel and functionality for that
8
+
9
+ ## 78.17.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
14
+ - Updated dependencies
15
+
3
16
  ## 78.17.1
4
17
 
5
18
  ### Patch Changes
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/analytics/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/analytics/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/annotation/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/annotation/index.d.ts"
12
12
  ]
package/card/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/card/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/card/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/clipboard/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/clipboard/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/collab/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/collab/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/commands/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/commands/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/link/constants.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/link/constants.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/copy-button/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/copy-button/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/core-utils/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/core-utils/index.d.ts"
12
12
  ]
@@ -54,7 +54,6 @@ function CategoryListItem(_ref2) {
54
54
  var ref = (0, _useFocus.default)(focus);
55
55
  var onClick = (0, _react.useCallback)(function () {
56
56
  onSelectCategory(category);
57
-
58
57
  /**
59
58
  * When user double clicks on same category, focus on first item.
60
59
  */
@@ -94,13 +93,18 @@ function CategoryListItem(_ref2) {
94
93
  }, rest);
95
94
  }, [category.name, selectedCategory]);
96
95
  return (0, _react2.jsx)("div", {
97
- css: buttonWrapper
96
+ css: buttonWrapper,
97
+ role: "presentation"
98
98
  }, (0, _react2.jsx)(_customThemeButton.default, {
99
99
  appearance: "subtle",
100
100
  isSelected: selectedCategory === category.name,
101
101
  onClick: onClick,
102
102
  onFocus: onFocus,
103
103
  theme: getTheme,
104
+ role: "tab",
105
+ "aria-selected": selectedCategory === category.name ? 'true' : 'false',
106
+ "aria-controls": "browse-category-".concat(category.name, "-tab"),
107
+ id: "browse-category--".concat(category.name, "-button"),
104
108
  ref: ref,
105
109
  testId: "element-browser-category-item"
106
110
  }, category.title));
@@ -114,16 +114,20 @@ function ElementList(_ref) {
114
114
  }, props)));
115
115
  };
116
116
  }, [items, fullMode, selectedItemIndex, focusedItemIndex, props]);
117
- return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(ContainerWidthMonitor, null), !items.length ? emptyStateHandler ? emptyStateHandler({
117
+ return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(ContainerWidthMonitor, null), (0, _react2.jsx)("div", {
118
+ css: elementItemsWrapper,
119
+ "data-testid": "element-items",
120
+ id: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab',
121
+ "aria-labelledby": selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button',
122
+ role: "tabpanel",
123
+ tabIndex: items.length === 0 ? 0 : undefined
124
+ }, !items.length ? emptyStateHandler ? emptyStateHandler({
118
125
  mode: mode,
119
126
  selectedCategory: selectedCategory,
120
127
  searchTerm: searchTerm
121
128
  }) : (0, _react2.jsx)(_EmptyState.default, {
122
129
  onExternalLinkClick: onExternalLinkClick
123
- }) : (0, _react2.jsx)("div", {
124
- css: elementItemsWrapper,
125
- "data-testid": "element-items"
126
- }, (0, _react2.jsx)(_react.Fragment, null, containerWidth > 0 && (0, _react2.jsx)(_AutoSizer.AutoSizer, {
130
+ }) : (0, _react2.jsx)(_react.Fragment, null, containerWidth > 0 && (0, _react2.jsx)(_AutoSizer.AutoSizer, {
127
131
  disableWidth: true
128
132
  }, function (_ref3) {
129
133
  var height = _ref3.height;
@@ -269,7 +273,7 @@ var elementItemWrapper = (0, _react2.css)({
269
273
  button: {
270
274
  height: '75px',
271
275
  alignItems: 'flex-start',
272
- padding: "var(--ds-space-150, 12px)"
276
+ padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 11px")
273
277
  }
274
278
  }
275
279
  });
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
12
11
  var _react = _interopRequireWildcard(require("react"));
13
12
  var _react2 = require("@emotion/react");
14
13
  var _reactIntlNext = require("react-intl-next");
@@ -21,25 +20,83 @@ var _ViewMore = require("../ViewMore");
21
20
  var _CategoryList = _interopRequireDefault(require("./CategoryList"));
22
21
  var _ElementList = _interopRequireDefault(require("./ElementList/ElementList"));
23
22
  var _ElementSearch = _interopRequireDefault(require("./ElementSearch"));
24
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
25
- /** @jsx jsx */
26
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
- var wrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n max-height: inherit;\n overflow: hidden;\n"])));
29
- var baseBrowserContainerStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n height: 100%;\n /** Needed for Safari to work with current css.\n * 100% heights wont work and\n * will default to auto if one of the containers doesn't have a specified height in pixels.\n * Setting the min-height to fill available fits safari's needs and the above 100% height works on the rest of the browsers.\n */\n\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n\n /* stylelint-disable-next-line */\n min-height: -webkit-fill-available;\n"])));
30
- var mobileElementBrowserContainer = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n flex-direction: column;\n"])), baseBrowserContainerStyles);
31
- var elementBrowserContainer = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n flex-direction: row;\n"])), baseBrowserContainerStyles);
32
- var baseSidebarStyles = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n\n overflow-x: auto;\n overflow-y: hidden;\n"])));
33
- var mobileSideBar = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n flex: 0 0 ", ";\n padding: ", " ", " 0\n ", ";\n"])), baseSidebarStyles, _constants.INLINE_SIDEBAR_HEIGHT, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)");
34
- var mobileSideBarShowCategories = (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n flex: 0 0 auto;\n"])));
35
- var sideBar = (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n flex: 0 0 'auto';\n"])), baseSidebarStyles);
36
- var sideBarShowCategories = (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n flex: 0 0 ", ";\n"])), baseSidebarStyles, _constants.SIDEBAR_WIDTH);
37
- var sidebarHeading = (0, _react2.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n flex: 0 0 ", ";\n display: inline-flex;\n align-items: center;\n padding-left: ", ";\n font-weight: 700;\n"])), _constants.SIDEBAR_HEADING_WRAPPER_HEIGHT, _constants.SIDEBAR_HEADING_PADDING_LEFT);
38
- var mobileMainContent = (0, _react2.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1 1 auto;\n\n display: flex;\n flex-direction: column;\n\n overflow-y: auto;\n height: 100%;\n"])));
39
- var mainContent = (0, _react2.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n margin-left: ", "px;\n // Needed for safari\n height: auto;\n"])), mobileMainContent, _constants.GRID_SIZE * 2);
40
- var searchContainer = (0, _react2.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n padding-bottom: ", "px;\n"])), _constants.GRID_SIZE * 2);
41
- var mobileCategoryListWrapper = (0, _react2.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n overflow-x: auto;\n\n padding: ", "px 0 ", "px 0;\n min-height: ", "px;\n\n overflow: -moz-scrollbars-none;\n ::-webkit-scrollbar {\n display: none;\n }\n scrollbar-width: none;\n -ms-overflow-style: none;\n"])), _constants.GRID_SIZE, _constants.GRID_SIZE * 2, _constants.GRID_SIZE * 4);
42
- var categoryListWrapper = (0, _react2.css)(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n padding: 0;\n margin-top: ", "px;\n flex-direction: column;\n"])), mobileCategoryListWrapper, _constants.GRID_SIZE * 3);
25
+ /** @jsx jsx */
26
+
27
+ var wrapper = (0, _react2.css)({
28
+ width: '100%',
29
+ maxHeight: 'inherit',
30
+ overflow: 'hidden'
31
+ });
32
+ var baseBrowserContainerStyles = (0, _react2.css)({
33
+ display: 'flex',
34
+ height: '100%',
35
+ minHeight: '-webkit-fill-available'
36
+ });
37
+ var mobileElementBrowserContainer = (0, _react2.css)(baseBrowserContainerStyles, {
38
+ flexDirection: 'column'
39
+ });
40
+ var elementBrowserContainer = (0, _react2.css)(baseBrowserContainerStyles, {
41
+ flexDirection: 'row'
42
+ });
43
+ var baseSidebarStyles = (0, _react2.css)({
44
+ display: 'flex',
45
+ flexDirection: 'column',
46
+ overflowX: 'auto',
47
+ overflowY: 'hidden'
48
+ });
49
+ var mobileSideBar = (0, _react2.css)(baseSidebarStyles, {
50
+ flex: "0 0 ".concat(_constants.INLINE_SIDEBAR_HEIGHT),
51
+ padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 0 ", "var(--ds-space-150, 12px)")
52
+ });
53
+ var mobileSideBarShowCategories = (0, _react2.css)({
54
+ flex: '0 0 auto'
55
+ });
56
+ var sideBar = (0, _react2.css)(baseSidebarStyles, {
57
+ flex: "0 0 'auto'"
58
+ });
59
+ var sideBarShowCategories = (0, _react2.css)(baseSidebarStyles, {
60
+ flex: "0 0 ".concat(_constants.SIDEBAR_WIDTH)
61
+ });
62
+ var sidebarHeading = (0, _react2.css)({
63
+ flex: "0 0 ".concat(_constants.SIDEBAR_HEADING_WRAPPER_HEIGHT),
64
+ display: 'inline-flex',
65
+ alignItems: 'center',
66
+ paddingLeft: "var(--ds-space-150, 12px)",
67
+ fontWeight: 700
68
+ });
69
+ var mobileMainContent = (0, _react2.css)({
70
+ flex: '1 1 auto',
71
+ display: 'flex',
72
+ flexDirection: 'column',
73
+ overflowY: 'auto',
74
+ height: '100%'
75
+ });
76
+ var mainContent = (0, _react2.css)(mobileMainContent, {
77
+ marginLeft: "var(--ds-space-200, 16px)",
78
+ height: 'auto'
79
+ });
80
+ var searchContainer = (0, _react2.css)({
81
+ paddingBottom: "var(--ds-space-200, 16px)"
82
+ });
83
+ var mobileCategoryListWrapper = (0, _react2.css)({
84
+ display: 'flex',
85
+ overflowX: 'auto',
86
+ padding: "var(--ds-space-200, 8px)".concat(" 0 ", "var(--ds-space-200, 16px)", " 0"),
87
+ minHeight: "".concat(_constants.GRID_SIZE * 4, "px"),
88
+ overflow: '-moz-scrollbars-none',
89
+ '::-webkit-scrollbar': {
90
+ display: 'none'
91
+ },
92
+ scrollbarWidth: 'none',
93
+ MsOverflowStyle: 'none'
94
+ });
95
+ var categoryListWrapper = (0, _react2.css)(mobileCategoryListWrapper, {
96
+ padding: 0,
97
+ marginTop: "var(--ds-space-200, 24px)",
98
+ flexDirection: 'column'
99
+ });
43
100
  function StatelessElementBrowser(props) {
44
101
  var items = props.items,
45
102
  onSelectItem = props.onSelectItem,
@@ -225,12 +282,15 @@ function DesktopBrowser(_ref2) {
225
282
  css: showCategories ? sideBarShowCategories : sideBar
226
283
  }, (0, _react2.jsx)("h2", {
227
284
  css: sidebarHeading,
228
- "data-testid": "sidebar-heading"
285
+ "data-testid": "sidebar-heading",
286
+ id: "sidebar-heading"
229
287
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, {
230
288
  id: "fabric.editor.elementbrowser.sidebar.heading",
231
289
  defaultMessage: "Browse",
232
290
  description: "Sidebar heading"
233
291
  })), (0, _react2.jsx)("nav", {
292
+ role: "tablist",
293
+ "aria-labelledby": "sidebar-heading",
234
294
  css: categoryListWrapper
235
295
  }, (0, _react2.jsx)(_CategoryList.default, {
236
296
  categories: categories,
@@ -241,7 +301,9 @@ function DesktopBrowser(_ref2) {
241
301
  css: mainContent,
242
302
  onKeyDown: onKeyDown,
243
303
  "data-testid": "main-content"
244
- }, showSearch && (0, _react2.jsx)("div", {
304
+ }, showSearch &&
305
+ // eslint-disable-next-line
306
+ (0, _react2.jsx)("div", {
245
307
  css: searchContainer
246
308
  }, (0, _react2.jsx)(_ElementSearch.default, {
247
309
  onSearch: onSearch,
@@ -165,19 +165,24 @@ var widthPluginKey = {
165
165
  }
166
166
  };
167
167
  var ExtensionDeprecated = function ExtensionDeprecated(props) {
168
- return (0, _react2.jsx)(_withPluginState.WithPluginState, {
169
- editorView: props.view,
170
- plugins: {
171
- widthState: widthPluginKey
172
- },
173
- render: function render(_ref) {
174
- var widthState = _ref.widthState;
175
- return (0, _react2.jsx)(ExtensionWithPluginState, (0, _extends2.default)({
176
- widthState: widthState
177
- }, props));
178
- }
179
- });
168
+ return (
169
+ // @ts-ignore - 'WithPluginState' cannot be used as a JSX component.
170
+ // This error was introduced after upgrading to TypeScript 5
171
+ (0, _react2.jsx)(_withPluginState.WithPluginState, {
172
+ editorView: props.view,
173
+ plugins: {
174
+ widthState: widthPluginKey
175
+ },
176
+ render: function render(_ref) {
177
+ var widthState = _ref.widthState;
178
+ return (0, _react2.jsx)(ExtensionWithPluginState, (0, _extends2.default)({
179
+ widthState: widthState
180
+ }, props));
181
+ }
182
+ })
183
+ );
180
184
  };
185
+
181
186
  /**
182
187
  * End workaround
183
188
  */
@@ -197,18 +197,22 @@ var widthPluginKey = {
197
197
  }
198
198
  };
199
199
  var MultiBodiedExtensionDeprecated = function MultiBodiedExtensionDeprecated(props) {
200
- return (0, _react2.jsx)(_withPluginState.WithPluginState, {
201
- editorView: props.editorView,
202
- plugins: {
203
- widthState: widthPluginKey
204
- },
205
- render: function render(_ref2) {
206
- var widthState = _ref2.widthState;
207
- return (0, _react2.jsx)(MultiBodiedExtensionWithWidth, (0, _extends2.default)({
208
- widthState: widthState
209
- }, props));
210
- }
211
- });
200
+ return (
201
+ // @ts-ignore - 'WithPluginState' cannot be used as a JSX component.
202
+ // This error was introduced after upgrading to TypeScript 5
203
+ (0, _react2.jsx)(_withPluginState.WithPluginState, {
204
+ editorView: props.editorView,
205
+ plugins: {
206
+ widthState: widthPluginKey
207
+ },
208
+ render: function render(_ref2) {
209
+ var widthState = _ref2.widthState;
210
+ return (0, _react2.jsx)(MultiBodiedExtensionWithWidth, (0, _extends2.default)({
211
+ widthState: widthState
212
+ }, props));
213
+ }
214
+ })
215
+ );
212
216
  };
213
217
  /**
214
218
  * End workaround
@@ -109,6 +109,9 @@ function useSharedPluginState(injectionApi, plugins) {
109
109
  return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, "".concat(pluginName, "State"), injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi[pluginName]));
110
110
  }, {});
111
111
  }, [injectionApi, pluginNames]);
112
+
113
+ // @ts-expect-error - Type '`${K}State`' is not assignable to type '`${K}State`'. Two different types with this name exist, but they are unrelated.
114
+ // This error was introduced after upgrading to TypeScript 5
112
115
  return useSharedPluginStateInternal(namedExternalPlugins);
113
116
  }
114
117
  function useSharedPluginStateInternal(externalPlugins) {
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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 = "78.17.1";
19
+ var packageVersion = "78.18.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
22
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
23
23
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "78.17.1";
25
+ var packageVersion = "78.18.0";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -34,7 +34,6 @@ function CategoryListItem({
34
34
  const ref = useFocus(focus);
35
35
  const onClick = useCallback(() => {
36
36
  onSelectCategory(category);
37
-
38
37
  /**
39
38
  * When user double clicks on same category, focus on first item.
40
39
  */
@@ -78,13 +77,18 @@ function CategoryListItem({
78
77
  };
79
78
  }, [category.name, selectedCategory]);
80
79
  return jsx("div", {
81
- css: buttonWrapper
80
+ css: buttonWrapper,
81
+ role: "presentation"
82
82
  }, jsx(Button, {
83
83
  appearance: "subtle",
84
84
  isSelected: selectedCategory === category.name,
85
85
  onClick: onClick,
86
86
  onFocus: onFocus,
87
87
  theme: getTheme,
88
+ role: "tab",
89
+ "aria-selected": selectedCategory === category.name ? 'true' : 'false',
90
+ "aria-controls": `browse-category-${category.name}-tab`,
91
+ id: `browse-category--${category.name}-button`,
88
92
  ref: ref,
89
93
  testId: "element-browser-category-item"
90
94
  }, category.title));
@@ -98,16 +98,20 @@ function ElementList({
98
98
  focus: focusedItemIndex === index
99
99
  }, props)));
100
100
  }, [items, fullMode, selectedItemIndex, focusedItemIndex, props]);
101
- return jsx(Fragment, null, jsx(ContainerWidthMonitor, null), !items.length ? emptyStateHandler ? emptyStateHandler({
101
+ return jsx(Fragment, null, jsx(ContainerWidthMonitor, null), jsx("div", {
102
+ css: elementItemsWrapper,
103
+ "data-testid": "element-items",
104
+ id: selectedCategory ? `browse-category-${selectedCategory}-tab` : 'browse-category-tab',
105
+ "aria-labelledby": selectedCategory ? `browse-category--${selectedCategory}-button` : 'browse-category-button',
106
+ role: "tabpanel",
107
+ tabIndex: items.length === 0 ? 0 : undefined
108
+ }, !items.length ? emptyStateHandler ? emptyStateHandler({
102
109
  mode,
103
110
  selectedCategory,
104
111
  searchTerm
105
112
  }) : jsx(EmptyState, {
106
113
  onExternalLinkClick: onExternalLinkClick
107
- }) : jsx("div", {
108
- css: elementItemsWrapper,
109
- "data-testid": "element-items"
110
- }, jsx(Fragment, null, containerWidth > 0 && jsx(AutoSizer, {
114
+ }) : jsx(Fragment, null, containerWidth > 0 && jsx(AutoSizer, {
111
115
  disableWidth: true
112
116
  }, ({
113
117
  height
@@ -253,7 +257,7 @@ const elementItemWrapper = css({
253
257
  button: {
254
258
  height: '75px',
255
259
  alignItems: 'flex-start',
256
- padding: "var(--ds-space-150, 12px)"
260
+ padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-150, 12px)"} 11px`
257
261
  }
258
262
  }
259
263
  });