@atlaskit/editor-common 94.15.0 → 94.16.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 (36) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/element-browser/ElementBrowser.js +4 -2
  3. package/dist/cjs/element-browser/components/ElementList/ElementList.js +366 -21
  4. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +14 -7
  5. package/dist/cjs/element-browser/constants.js +1 -1
  6. package/dist/cjs/monitoring/error.js +1 -1
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/es2019/element-browser/ElementBrowser.js +4 -2
  9. package/dist/es2019/element-browser/components/ElementList/ElementList.js +351 -5
  10. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +14 -7
  11. package/dist/es2019/element-browser/constants.js +1 -1
  12. package/dist/es2019/monitoring/error.js +1 -1
  13. package/dist/es2019/ui/DropList/index.js +1 -1
  14. package/dist/esm/element-browser/ElementBrowser.js +4 -2
  15. package/dist/esm/element-browser/components/ElementList/ElementList.js +365 -20
  16. package/dist/esm/element-browser/components/StatelessElementBrowser.js +14 -7
  17. package/dist/esm/element-browser/constants.js +1 -1
  18. package/dist/esm/monitoring/error.js +1 -1
  19. package/dist/esm/ui/DropList/index.js +1 -1
  20. package/dist/types/analytics/index.d.ts +1 -0
  21. package/dist/types/element-browser/ElementBrowser.d.ts +2 -0
  22. package/dist/types/element-browser/components/ElementList/ElementList.d.ts +2 -0
  23. package/dist/types/element-browser/components/StatelessElementBrowser.d.ts +4 -1
  24. package/dist/types/element-browser/constants.d.ts +1 -1
  25. package/dist/types/extensibility/index.d.ts +1 -0
  26. package/dist/types/provider-factory.d.ts +1 -0
  27. package/dist/types/types/index.d.ts +1 -1
  28. package/dist/types-ts4.5/analytics/index.d.ts +1 -0
  29. package/dist/types-ts4.5/element-browser/ElementBrowser.d.ts +2 -0
  30. package/dist/types-ts4.5/element-browser/components/ElementList/ElementList.d.ts +2 -0
  31. package/dist/types-ts4.5/element-browser/components/StatelessElementBrowser.d.ts +4 -1
  32. package/dist/types-ts4.5/element-browser/constants.d.ts +1 -1
  33. package/dist/types-ts4.5/extensibility/index.d.ts +1 -0
  34. package/dist/types-ts4.5/provider-factory.d.ts +1 -0
  35. package/dist/types-ts4.5/types/index.d.ts +1 -1
  36. package/package.json +8 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 94.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#162455](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/162455)
8
+ [`37db7ee7998bb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/37db7ee7998bb) -
9
+ [ux] ED-25030: Reduce padding between insert menu items and remove padding from the right hand
10
+ side of the insert menu when a scrollbar is not present
11
+
3
12
  ## 94.15.0
4
13
 
5
14
  ### Minor Changes
@@ -120,7 +120,8 @@ var ElementBrowser = exports.default = /*#__PURE__*/function (_PureComponent) {
120
120
  showCategories = _this$props.showCategories,
121
121
  mode = _this$props.mode,
122
122
  emptyStateHandler = _this$props.emptyStateHandler,
123
- viewMoreItem = _this$props.viewMoreItem;
123
+ viewMoreItem = _this$props.viewMoreItem,
124
+ cache = _this$props.cache;
124
125
  var _this$state2 = this.state,
125
126
  categories = _this$state2.categories,
126
127
  searchTerm = _this$state2.searchTerm,
@@ -139,7 +140,8 @@ var ElementBrowser = exports.default = /*#__PURE__*/function (_PureComponent) {
139
140
  mode: mode,
140
141
  searchTerm: searchTerm,
141
142
  emptyStateHandler: emptyStateHandler,
142
- viewMoreItem: viewMoreItem
143
+ viewMoreItem: viewMoreItem,
144
+ cache: cache
143
145
  });
144
146
  }
145
147
  }]);
@@ -25,12 +25,13 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
25
25
  var _analytics = require("../../../analytics");
26
26
  var _quickInsert = require("../../../quick-insert");
27
27
  var _constants = require("../../constants");
28
- var _useContainerWidth2 = _interopRequireDefault(require("../../hooks/use-container-width"));
28
+ var _useContainerWidth3 = _interopRequireDefault(require("../../hooks/use-container-width"));
29
29
  var _useFocus = _interopRequireDefault(require("../../hooks/use-focus"));
30
30
  var _types = require("../../types");
31
31
  var _EmptyState = _interopRequireDefault(require("./EmptyState"));
32
32
  var _utils = require("./utils");
33
- var _excluded = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "columnCount", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "selectedCategoryIndex", "searchTerm", "setFocusedCategoryIndex", "setFocusedItemIndex"];
33
+ var _excluded = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "columnCount", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "selectedCategoryIndex", "searchTerm", "setFocusedCategoryIndex", "setFocusedItemIndex"],
34
+ _excluded2 = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "columnCount", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "selectedCategoryIndex", "searchTerm", "setFocusedCategoryIndex", "setFocusedItemIndex"];
34
35
  /**
35
36
  * @jsxRuntime classic
36
37
  * @jsx jsx
@@ -59,7 +60,7 @@ var itemIcon = exports.itemIcon = (0, _react2.css)({
59
60
  height: "".concat(ICON_HEIGHT, "px")
60
61
  }
61
62
  });
62
- function ElementList(_ref) {
63
+ function ElementListOld(_ref) {
63
64
  var items = _ref.items,
64
65
  mode = _ref.mode,
65
66
  selectedItemIndex = _ref.selectedItemIndex,
@@ -74,7 +75,7 @@ function ElementList(_ref) {
74
75
  setFocusedCategoryIndex = _ref.setFocusedCategoryIndex,
75
76
  setFocusedItemIndex = _ref.setFocusedItemIndex,
76
77
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
77
- var _useContainerWidth = (0, _useContainerWidth2.default)(),
78
+ var _useContainerWidth = (0, _useContainerWidth3.default)(),
78
79
  containerWidth = _useContainerWidth.containerWidth,
79
80
  ContainerWidthMonitor = _useContainerWidth.ContainerWidthMonitor;
80
81
  var _useState = (0, _react.useState)(_constants.SCROLLBAR_WIDTH),
@@ -108,8 +109,8 @@ function ElementList(_ref) {
108
109
  // eslint-disable-next-line react-hooks/exhaustive-deps
109
110
  var cache = new _CellMeasurer.CellMeasurerCache({
110
111
  fixedWidth: true,
111
- defaultHeight: _constants.ELEMENT_ITEM_HEIGHT,
112
- minHeight: _constants.ELEMENT_ITEM_HEIGHT
112
+ defaultHeight: 75,
113
+ minHeight: 75
113
114
  });
114
115
  var columnWidth = (containerWidth - _constants.ELEMENT_ITEM_PADDING * 2) / columnCount;
115
116
  var rowCount = Math.ceil(items.length / columnCount);
@@ -117,7 +118,7 @@ function ElementList(_ref) {
117
118
  var index = _ref2.index;
118
119
  return cache.rowHeight({
119
120
  index: index
120
- }) <= _constants.ELEMENT_ITEM_HEIGHT ? _constants.ELEMENT_ITEM_HEIGHT : cache.rowHeight({
121
+ }) <= 75 ? 75 : cache.rowHeight({
121
122
  index: index
122
123
  }) + _constants.ELEMENT_ITEM_PADDING * 2;
123
124
  };
@@ -217,16 +218,301 @@ function ElementList(_ref) {
217
218
  }));
218
219
  }))));
219
220
  }
221
+ function ElementListNew(_ref5) {
222
+ var items = _ref5.items,
223
+ mode = _ref5.mode,
224
+ selectedItemIndex = _ref5.selectedItemIndex,
225
+ focusedItemIndex = _ref5.focusedItemIndex,
226
+ columnCount = _ref5.columnCount,
227
+ setColumnCount = _ref5.setColumnCount,
228
+ createAnalyticsEvent = _ref5.createAnalyticsEvent,
229
+ emptyStateHandler = _ref5.emptyStateHandler,
230
+ selectedCategory = _ref5.selectedCategory,
231
+ selectedCategoryIndex = _ref5.selectedCategoryIndex,
232
+ searchTerm = _ref5.searchTerm,
233
+ setFocusedCategoryIndex = _ref5.setFocusedCategoryIndex,
234
+ setFocusedItemIndex = _ref5.setFocusedItemIndex,
235
+ cache = _ref5.cache,
236
+ onInsertItem = _ref5.onInsertItem;
237
+ var _useContainerWidth2 = (0, _useContainerWidth3.default)(),
238
+ containerWidth = _useContainerWidth2.containerWidth,
239
+ ContainerWidthMonitor = _useContainerWidth2.ContainerWidthMonitor;
240
+ var _useState3 = (0, _react.useState)(_constants.SCROLLBAR_WIDTH),
241
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
242
+ scrollbarWidth = _useState4[0],
243
+ setScrollbarWidth = _useState4[1];
244
+ var fullMode = mode === _types.Modes.full;
245
+ (0, _react.useEffect)(function () {
246
+ /**
247
+ * More of an optimization condition.
248
+ * Initially the containerWidths are reported 0 twice.
249
+ **/
250
+ if (fullMode && containerWidth > 0) {
251
+ setColumnCount((0, _utils.getColumnCount)(containerWidth));
252
+ var updatedScrollbarWidth = (0, _utils.getScrollbarWidth)();
253
+ if (updatedScrollbarWidth > 0) {
254
+ setScrollbarWidth(updatedScrollbarWidth);
255
+ }
256
+ }
257
+ }, [fullMode, containerWidth, setColumnCount, scrollbarWidth]);
258
+ var onExternalLinkClick = (0, _react.useCallback)(function () {
259
+ (0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({
260
+ payload: {
261
+ action: _analytics.ACTION.VISITED,
262
+ actionSubject: _analytics.ACTION_SUBJECT.SMART_LINK,
263
+ eventType: _analytics.EVENT_TYPE.TRACK
264
+ }
265
+ });
266
+ }, [createAnalyticsEvent]);
267
+
268
+ // eslint-disable-next-line react-hooks/exhaustive-deps
269
+ var listCache = cache !== null && cache !== void 0 ? cache : new _CellMeasurer.CellMeasurerCache({
270
+ fixedWidth: true,
271
+ defaultHeight: _constants.ELEMENT_ITEM_HEIGHT,
272
+ minHeight: _constants.ELEMENT_ITEM_HEIGHT
273
+ });
274
+ (0, _react.useEffect)(function () {
275
+ // need to recalculate values if we have the same items, but they're reordered
276
+ listCache.clearAll();
277
+ }, [listCache, searchTerm]);
278
+ var rowHeight = function rowHeight(_ref6) {
279
+ var index = _ref6.index;
280
+ return listCache.rowHeight({
281
+ index: index
282
+ });
283
+ };
284
+ return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(ContainerWidthMonitor, null), (0, _react2.jsx)("div", {
285
+ css: elementItemsWrapper,
286
+ "data-testid": "element-items",
287
+ id: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab',
288
+ "aria-labelledby": selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button',
289
+ role: "tabpanel",
290
+ tabIndex: items.length === 0 ? 0 : undefined
291
+ }, !items.length ? emptyStateHandler ? emptyStateHandler({
292
+ mode: mode,
293
+ selectedCategory: selectedCategory,
294
+ searchTerm: searchTerm
295
+ }) : (0, _react2.jsx)(_EmptyState.default, {
296
+ onExternalLinkClick: onExternalLinkClick
297
+ }) : (0, _react2.jsx)(_react.Fragment, null, containerWidth > 0 && (0, _react2.jsx)(_AutoSizer.AutoSizer, {
298
+ disableWidth: true
299
+ }, function (_ref7) {
300
+ var height = _ref7.height;
301
+ return columnCount === 1 ? (0, _react2.jsx)(ElementListSingleColumn, {
302
+ cache: listCache,
303
+ setFocusedCategoryIndex: setFocusedCategoryIndex,
304
+ selectedCategoryIndex: selectedCategoryIndex,
305
+ items: items,
306
+ setFocusedItemIndex: setFocusedItemIndex,
307
+ fullMode: fullMode,
308
+ selectedItemIndex: selectedItemIndex,
309
+ focusedItemIndex: focusedItemIndex,
310
+ rowHeight: rowHeight,
311
+ containerWidth: containerWidth,
312
+ height: height,
313
+ onInsertItem: onInsertItem
314
+ }) : (0, _react2.jsx)(ElementListMultipleColumns, {
315
+ columnCount: columnCount,
316
+ cache: listCache,
317
+ setFocusedCategoryIndex: setFocusedCategoryIndex,
318
+ selectedCategoryIndex: selectedCategoryIndex,
319
+ items: items,
320
+ setFocusedItemIndex: setFocusedItemIndex,
321
+ fullMode: fullMode,
322
+ selectedItemIndex: selectedItemIndex,
323
+ focusedItemIndex: focusedItemIndex,
324
+ rowHeight: rowHeight,
325
+ containerWidth: containerWidth,
326
+ height: height,
327
+ onInsertItem: onInsertItem
328
+ });
329
+ }))));
330
+ }
331
+ var ElementListSingleColumn = function ElementListSingleColumn(props) {
332
+ var items = props.items,
333
+ fullMode = props.fullMode,
334
+ setFocusedItemIndex = props.setFocusedItemIndex,
335
+ rowHeight = props.rowHeight,
336
+ containerWidth = props.containerWidth,
337
+ height = props.height,
338
+ onInsertItem = props.onInsertItem,
339
+ cache = props.cache,
340
+ focusedItemIndex = props.focusedItemIndex,
341
+ setFocusedCategoryIndex = props.setFocusedCategoryIndex,
342
+ selectedCategoryIndex = props.selectedCategoryIndex,
343
+ selectedItemIndex = props.selectedItemIndex;
344
+ var rowRenderer = (0, _react.useMemo)(function () {
345
+ return function (_ref8) {
346
+ var index = _ref8.index,
347
+ key = _ref8.key,
348
+ style = _ref8.style,
349
+ parent = _ref8.parent;
350
+ return (0, _react2.jsx)(_CellMeasurer.CellMeasurer, {
351
+ key: key,
352
+ cache: cache,
353
+ parent: parent,
354
+ columnIndex: 0,
355
+ rowIndex: index
356
+ }, (0, _react2.jsx)("div", {
357
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
358
+ style: style,
359
+ key: key
360
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 -- Ignored via go/DSP-18766
361
+ ,
362
+ className: "element-item-wrapper",
363
+ css: elementItemWrapperSingle,
364
+ onKeyDown: function onKeyDown(e) {
365
+ if (e.key === 'Tab') {
366
+ if (e.shiftKey && index === 0) {
367
+ if (setFocusedCategoryIndex) {
368
+ if (!!selectedCategoryIndex) {
369
+ setFocusedCategoryIndex(selectedCategoryIndex);
370
+ } else {
371
+ setFocusedCategoryIndex(0);
372
+ }
373
+ e.preventDefault();
374
+ }
375
+ }
376
+ // before focus jumps from elements list we need to rerender react-virtualized grid.
377
+ // Otherwise on the next render 'scrollToCell' will have same cached value
378
+ // and grid will not be scrolled to top.
379
+ // So Tab press on category will not work anymore due to invisible 1-t element.
380
+ else if (index === items.length - 2) {
381
+ setFocusedItemIndex(items.length - 1);
382
+ }
383
+ }
384
+ }
385
+ }, (0, _react2.jsx)(MemoizedElementItem, {
386
+ inlineMode: !fullMode,
387
+ index: index,
388
+ item: items[index],
389
+ selected: selectedItemIndex === index,
390
+ focus: focusedItemIndex === index,
391
+ setFocusedItemIndex: setFocusedItemIndex,
392
+ onInsertItem: onInsertItem
393
+ })));
394
+ };
395
+ },
396
+ // eslint-disable-next-line react-hooks/exhaustive-deps
397
+ [cache, items, fullMode, selectedItemIndex, focusedItemIndex, selectedCategoryIndex, setFocusedCategoryIndex, setFocusedItemIndex, props]);
398
+ return (0, _react2.jsx)(_reactVirtualized.List, (0, _extends2.default)({
399
+ rowRenderer: rowRenderer,
400
+ rowCount: items.length,
401
+ rowHeight: rowHeight,
402
+ width: containerWidth - _constants.ELEMENT_LIST_PADDING * 2,
403
+ height: height,
404
+ overscanRowCount: 3,
405
+ containerRole: "presentation",
406
+ role: "listbox"
407
+ }, selectedItemIndex !== undefined && {
408
+ scrollToIndex: selectedItemIndex
409
+ }));
410
+ };
411
+ var ElementListMultipleColumns = function ElementListMultipleColumns(props) {
412
+ var columnCount = props.columnCount,
413
+ items = props.items,
414
+ fullMode = props.fullMode,
415
+ setFocusedItemIndex = props.setFocusedItemIndex,
416
+ rowHeight = props.rowHeight,
417
+ containerWidth = props.containerWidth,
418
+ height = props.height,
419
+ onInsertItem = props.onInsertItem,
420
+ cache = props.cache,
421
+ focusedItemIndex = props.focusedItemIndex,
422
+ setFocusedCategoryIndex = props.setFocusedCategoryIndex,
423
+ selectedCategoryIndex = props.selectedCategoryIndex,
424
+ selectedItemIndex = props.selectedItemIndex;
425
+ var columnWidth = (containerWidth - _constants.ELEMENT_ITEM_PADDING * 2) / columnCount;
426
+ var rowCount = Math.ceil(items.length / columnCount);
427
+ var cellRenderer = (0, _react.useMemo)(function () {
428
+ return function (_ref9) {
429
+ var columnIndex = _ref9.columnIndex,
430
+ key = _ref9.key,
431
+ parent = _ref9.parent,
432
+ rowIndex = _ref9.rowIndex,
433
+ style = _ref9.style;
434
+ var index = rowIndex * columnCount + columnIndex;
435
+ if (items[index] == null) {
436
+ return;
437
+ }
438
+ return index > items.length - 1 ? null : (0, _react2.jsx)(_CellMeasurer.CellMeasurer, {
439
+ cache: cache,
440
+ key: key,
441
+ rowIndex: rowIndex,
442
+ columnIndex: columnIndex,
443
+ parent: parent
444
+ }, (0, _react2.jsx)("div", {
445
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
446
+ style: style,
447
+ key: key
448
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 -- Ignored via go/DSP-18766
449
+ ,
450
+ className: "element-item-wrapper",
451
+ css: elementItemWrapper,
452
+ onKeyDown: function onKeyDown(e) {
453
+ if (e.key === 'Tab') {
454
+ if (e.shiftKey && index === 0) {
455
+ if (setFocusedCategoryIndex) {
456
+ if (!!selectedCategoryIndex) {
457
+ setFocusedCategoryIndex(selectedCategoryIndex);
458
+ } else {
459
+ setFocusedCategoryIndex(0);
460
+ }
461
+ e.preventDefault();
462
+ }
463
+ }
464
+ // before focus jumps from elements list we need to rerender react-virtualized grid.
465
+ // Otherwise on the next render 'scrollToCell' will have same cached value
466
+ // and grid will not be scrolled to top.
467
+ // So Tab press on category will not work anymore due to invisible 1-t element.
468
+ else if (index === items.length - 2) {
469
+ setFocusedItemIndex(items.length - 1);
470
+ }
471
+ }
472
+ }
473
+ }, (0, _react2.jsx)(MemoizedElementItem, {
474
+ inlineMode: !fullMode,
475
+ index: index,
476
+ item: items[index],
477
+ selected: selectedItemIndex === index,
478
+ focus: focusedItemIndex === index,
479
+ setFocusedItemIndex: setFocusedItemIndex,
480
+ onInsertItem: onInsertItem
481
+ })));
482
+ };
483
+ },
484
+ // eslint-disable-next-line react-hooks/exhaustive-deps
485
+ [cache, items, fullMode, selectedItemIndex, columnCount, focusedItemIndex, selectedCategoryIndex, setFocusedCategoryIndex, setFocusedItemIndex, props]);
486
+ return (0, _react2.jsx)(_reactVirtualized.Grid, (0, _extends2.default)({
487
+ cellRenderer: cellRenderer,
488
+ height: height,
489
+ width: containerWidth - _constants.ELEMENT_LIST_PADDING * 2 // containerWidth - padding on Left/Right (for focus outline)
490
+ /**
491
+ * Refresh Grid on WidthObserver value change.
492
+ * Length of the items used to force re-render to solve Firefox bug with react-virtualized retaining
493
+ * scroll position after updating the data. If new data has different number of cells, a re-render
494
+ * is forced to prevent the scroll position render bug.
495
+ */,
496
+ key: containerWidth + items.length,
497
+ rowHeight: rowHeight,
498
+ rowCount: rowCount,
499
+ columnCount: columnCount,
500
+ columnWidth: columnWidth,
501
+ deferredMeasurementCache: cache
502
+ }, selectedItemIndex !== undefined && {
503
+ scrollToRow: Math.floor(selectedItemIndex / columnCount)
504
+ }));
505
+ };
220
506
  var MemoizedElementItem = /*#__PURE__*/(0, _react.memo)(ElementItem);
221
507
  MemoizedElementItem.displayName = 'MemoizedElementItem';
222
- function ElementItem(_ref5) {
223
- var inlineMode = _ref5.inlineMode,
224
- selected = _ref5.selected,
225
- item = _ref5.item,
226
- index = _ref5.index,
227
- onInsertItem = _ref5.onInsertItem,
228
- focus = _ref5.focus,
229
- setFocusedItemIndex = _ref5.setFocusedItemIndex;
508
+ function ElementItem(_ref10) {
509
+ var inlineMode = _ref10.inlineMode,
510
+ selected = _ref10.selected,
511
+ item = _ref10.item,
512
+ index = _ref10.index,
513
+ onInsertItem = _ref10.onInsertItem,
514
+ focus = _ref10.focus,
515
+ setFocusedItemIndex = _ref10.setFocusedItemIndex;
230
516
  var ref = (0, _useFocus.default)(focus);
231
517
 
232
518
  /**
@@ -291,16 +577,16 @@ function ElementItem(_ref5) {
291
577
  var itemStyleOverrides = {
292
578
  alignItems: 'flex-start'
293
579
  };
294
- var ElementBefore = /*#__PURE__*/(0, _react.memo)(function (_ref6) {
295
- var icon = _ref6.icon;
580
+ var ElementBefore = /*#__PURE__*/(0, _react.memo)(function (_ref11) {
581
+ var icon = _ref11.icon;
296
582
  return (0, _react2.jsx)("div", {
297
583
  css: [itemIcon, itemIconStyle]
298
584
  }, icon ? icon() : (0, _react2.jsx)(_quickInsert.IconFallback, null));
299
585
  });
300
- var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref7) {
301
- var title = _ref7.title,
302
- description = _ref7.description,
303
- keyshortcut = _ref7.keyshortcut;
586
+ var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref12) {
587
+ var title = _ref12.title,
588
+ description = _ref12.description,
589
+ keyshortcut = _ref12.keyshortcut;
304
590
  if ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc')) {
305
591
  return (
306
592
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -372,6 +658,17 @@ var elementItemsWrapper = (0, _react2.css)({
372
658
  }
373
659
  }
374
660
  });
661
+ var elementItemWrapperSingle = (0, _react2.css)({
662
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
663
+ div: {
664
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
665
+ button: {
666
+ minHeight: '60px',
667
+ alignItems: 'flex-start',
668
+ padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 11px")
669
+ }
670
+ }
671
+ });
375
672
  var elementItemWrapper = (0, _react2.css)({
376
673
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
377
674
  div: {
@@ -438,6 +735,54 @@ var itemIconStyle = (0, _react2.css)({
438
735
  objectFit: 'cover'
439
736
  }
440
737
  });
738
+ function ElementList(_ref13) {
739
+ var items = _ref13.items,
740
+ mode = _ref13.mode,
741
+ selectedItemIndex = _ref13.selectedItemIndex,
742
+ focusedItemIndex = _ref13.focusedItemIndex,
743
+ columnCount = _ref13.columnCount,
744
+ setColumnCount = _ref13.setColumnCount,
745
+ createAnalyticsEvent = _ref13.createAnalyticsEvent,
746
+ emptyStateHandler = _ref13.emptyStateHandler,
747
+ selectedCategory = _ref13.selectedCategory,
748
+ selectedCategoryIndex = _ref13.selectedCategoryIndex,
749
+ searchTerm = _ref13.searchTerm,
750
+ setFocusedCategoryIndex = _ref13.setFocusedCategoryIndex,
751
+ setFocusedItemIndex = _ref13.setFocusedItemIndex,
752
+ props = (0, _objectWithoutProperties2.default)(_ref13, _excluded2);
753
+ if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_element_browser_padding')) {
754
+ return (0, _react2.jsx)(ElementListNew, (0, _extends2.default)({
755
+ items: items,
756
+ mode: mode,
757
+ selectedItemIndex: selectedItemIndex,
758
+ focusedItemIndex: focusedItemIndex,
759
+ columnCount: columnCount,
760
+ setColumnCount: setColumnCount,
761
+ createAnalyticsEvent: createAnalyticsEvent,
762
+ emptyStateHandler: emptyStateHandler,
763
+ selectedCategory: selectedCategory,
764
+ selectedCategoryIndex: selectedCategoryIndex,
765
+ searchTerm: searchTerm,
766
+ setFocusedCategoryIndex: setFocusedCategoryIndex,
767
+ setFocusedItemIndex: setFocusedItemIndex
768
+ }, props));
769
+ }
770
+ return (0, _react2.jsx)(ElementListOld, (0, _extends2.default)({
771
+ items: items,
772
+ mode: mode,
773
+ selectedItemIndex: selectedItemIndex,
774
+ focusedItemIndex: focusedItemIndex,
775
+ columnCount: columnCount,
776
+ setColumnCount: setColumnCount,
777
+ createAnalyticsEvent: createAnalyticsEvent,
778
+ emptyStateHandler: emptyStateHandler,
779
+ selectedCategory: selectedCategory,
780
+ selectedCategoryIndex: selectedCategoryIndex,
781
+ searchTerm: searchTerm,
782
+ setFocusedCategoryIndex: setFocusedCategoryIndex,
783
+ setFocusedItemIndex: setFocusedItemIndex
784
+ }, props));
785
+ }
441
786
  var MemoizedElementListWithAnalytics = /*#__PURE__*/(0, _react.memo)((0, _withAnalyticsContext.default)({
442
787
  component: 'ElementList'
443
788
  })(ElementList));
@@ -132,7 +132,8 @@ function StatelessElementBrowser(props) {
132
132
  selectedCategory = props.selectedCategory,
133
133
  onSelectCategory = props.onSelectCategory,
134
134
  searchTerm = props.searchTerm,
135
- showCategories = props.showCategories;
135
+ showCategories = props.showCategories,
136
+ cache = props.cache;
136
137
  var _useContainerWidth = (0, _useContainerWidth2.default)(),
137
138
  containerWidth = _useContainerWidth.containerWidth,
138
139
  ContainerWidthMonitor = _useContainerWidth.ContainerWidthMonitor;
@@ -241,7 +242,8 @@ function StatelessElementBrowser(props) {
241
242
  onKeyPress: onItemsEnterTabKeyPress,
242
243
  onKeyDown: onKeyDown,
243
244
  viewMoreItem: viewMoreItem,
244
- focusOnViewMore: focusOnViewMore
245
+ focusOnViewMore: focusOnViewMore,
246
+ cache: cache
245
247
  })) : (0, _react2.jsx)(DesktopBrowser, (0, _extends2.default)({}, props, {
246
248
  selectedItemIndex: selectedItemIndex,
247
249
  focusedItemIndex: focusedItemIndex,
@@ -255,7 +257,8 @@ function StatelessElementBrowser(props) {
255
257
  focusedCategoryIndex: focusedCategoryIndex,
256
258
  setFocusedCategoryIndex: setFocusedCategoryIndex,
257
259
  selectedCategoryIndex: selectedCategoryIndex,
258
- onSelectCategory: onSelectCategoryCB
260
+ onSelectCategory: onSelectCategoryCB,
261
+ cache: cache
259
262
  })));
260
263
  }
261
264
  function MobileBrowser(_ref) {
@@ -283,7 +286,8 @@ function MobileBrowser(_ref) {
283
286
  searchTerm = _ref.searchTerm,
284
287
  createAnalyticsEvent = _ref.createAnalyticsEvent,
285
288
  emptyStateHandler = _ref.emptyStateHandler,
286
- viewMoreItem = _ref.viewMoreItem;
289
+ viewMoreItem = _ref.viewMoreItem,
290
+ cache = _ref.cache;
287
291
  return (
288
292
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
289
293
  (0, _react2.jsx)("div", {
@@ -326,7 +330,8 @@ function MobileBrowser(_ref) {
326
330
  createAnalyticsEvent: createAnalyticsEvent,
327
331
  emptyStateHandler: emptyStateHandler,
328
332
  selectedCategory: selectedCategory,
329
- searchTerm: searchTerm
333
+ searchTerm: searchTerm,
334
+ cache: cache
330
335
  })), viewMoreItem && (0, _react2.jsx)(_ViewMore.ViewMore, {
331
336
  item: viewMoreItem,
332
337
  focus: focusOnViewMore
@@ -357,7 +362,8 @@ function DesktopBrowser(_ref2) {
357
362
  onKeyDown = _ref2.onKeyDown,
358
363
  searchTerm = _ref2.searchTerm,
359
364
  createAnalyticsEvent = _ref2.createAnalyticsEvent,
360
- emptyStateHandler = _ref2.emptyStateHandler;
365
+ emptyStateHandler = _ref2.emptyStateHandler,
366
+ cache = _ref2.cache;
361
367
  return (0, _react2.jsx)("div", {
362
368
  css: elementBrowserContainer,
363
369
  "data-testid": "desktop__element-browser"
@@ -415,7 +421,8 @@ function DesktopBrowser(_ref2) {
415
421
  selectedCategory: selectedCategory,
416
422
  selectedCategoryIndex: selectedCategoryIndex,
417
423
  searchTerm: searchTerm,
418
- setFocusedCategoryIndex: showCategories ? setFocusedCategoryIndex : undefined
424
+ setFocusedCategoryIndex: showCategories ? setFocusedCategoryIndex : undefined,
425
+ cache: cache
419
426
  })));
420
427
  }
421
428
  var MemoizedElementBrowser = /*#__PURE__*/(0, _react.memo)((0, _withAnalyticsContext.default)({
@@ -22,6 +22,6 @@ var INLINE_SIDEBAR_HEIGHT = exports.INLINE_SIDEBAR_HEIGHT = '54px';
22
22
  var SEARCH_ITEM_HEIGHT_WIDTH = exports.SEARCH_ITEM_HEIGHT_WIDTH = '20px';
23
23
  var SCROLLBAR_WIDTH = exports.SCROLLBAR_WIDTH = 15;
24
24
  var ELEMENT_LIST_PADDING = exports.ELEMENT_LIST_PADDING = 2;
25
- var ELEMENT_ITEM_HEIGHT = exports.ELEMENT_ITEM_HEIGHT = 75;
25
+ var ELEMENT_ITEM_HEIGHT = exports.ELEMENT_ITEM_HEIGHT = 60;
26
26
  var ELEMENT_ITEM_PADDING = exports.ELEMENT_ITEM_PADDING = 10;
27
27
  var ELEMENT_BROWSER_ID = exports.ELEMENT_BROWSER_ID = 'editor-element-browser';
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  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 && {}.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; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "94.15.0";
20
+ var packageVersion = "94.16.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -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 = "94.15.0";
27
+ var packageVersion = "94.16.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -86,7 +86,8 @@ export default class ElementBrowser extends PureComponent {
86
86
  showCategories,
87
87
  mode,
88
88
  emptyStateHandler,
89
- viewMoreItem
89
+ viewMoreItem,
90
+ cache
90
91
  } = this.props;
91
92
  const {
92
93
  categories,
@@ -107,7 +108,8 @@ export default class ElementBrowser extends PureComponent {
107
108
  mode: mode,
108
109
  searchTerm: searchTerm,
109
110
  emptyStateHandler: emptyStateHandler,
110
- viewMoreItem: viewMoreItem
111
+ viewMoreItem: viewMoreItem,
112
+ cache: cache
111
113
  });
112
114
  }
113
115
  }