@atlaskit/editor-common 96.0.2 → 96.1.1

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 (72) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/commands/index.js +1 -0
  3. package/dist/cjs/element-browser/components/ElementList/ElementList.js +31 -8
  4. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +7 -2
  5. package/dist/cjs/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +102 -19
  6. package/dist/cjs/insert/index.js +19 -0
  7. package/dist/cjs/lazy-node-view/index.js +1 -0
  8. package/dist/cjs/messages/insert-block.js +5 -0
  9. package/dist/cjs/messages/layout.js +13 -3
  10. package/dist/cjs/monitoring/error.js +1 -1
  11. package/dist/cjs/preset/builder.js +1 -0
  12. package/dist/cjs/preset/core-plugin/index.js +1 -1
  13. package/dist/cjs/rank.js +3 -0
  14. package/dist/cjs/types/index.js +2 -1
  15. package/dist/cjs/types/toolbar.js +2 -2
  16. package/dist/cjs/ui/DropList/index.js +1 -1
  17. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +3 -1
  18. package/dist/cjs/utils/dom.js +1 -0
  19. package/dist/cjs/utils/index.js +1 -0
  20. package/dist/cjs/utils/performance/measure.js +3 -0
  21. package/dist/cjs/utils/scroll-gutter.js +1 -0
  22. package/dist/es2019/commands/index.js +1 -0
  23. package/dist/es2019/element-browser/components/ElementList/ElementList.js +31 -8
  24. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +7 -2
  25. package/dist/es2019/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +97 -14
  26. package/dist/es2019/insert/index.js +18 -0
  27. package/dist/es2019/lazy-node-view/index.js +1 -0
  28. package/dist/es2019/messages/insert-block.js +5 -0
  29. package/dist/es2019/messages/layout.js +13 -3
  30. package/dist/es2019/monitoring/error.js +1 -1
  31. package/dist/es2019/preset/builder.js +1 -0
  32. package/dist/es2019/preset/core-plugin/index.js +1 -1
  33. package/dist/es2019/rank.js +3 -0
  34. package/dist/es2019/types/index.js +2 -0
  35. package/dist/es2019/types/toolbar.js +2 -0
  36. package/dist/es2019/ui/DropList/index.js +1 -1
  37. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +3 -1
  38. package/dist/es2019/utils/dom.js +1 -0
  39. package/dist/es2019/utils/index.js +1 -0
  40. package/dist/es2019/utils/performance/measure.js +3 -0
  41. package/dist/es2019/utils/scroll-gutter.js +1 -0
  42. package/dist/esm/commands/index.js +1 -0
  43. package/dist/esm/element-browser/components/ElementList/ElementList.js +31 -8
  44. package/dist/esm/element-browser/components/StatelessElementBrowser.js +7 -2
  45. package/dist/esm/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +102 -20
  46. package/dist/esm/insert/index.js +18 -0
  47. package/dist/esm/lazy-node-view/index.js +1 -0
  48. package/dist/esm/messages/insert-block.js +5 -0
  49. package/dist/esm/messages/layout.js +13 -3
  50. package/dist/esm/monitoring/error.js +1 -1
  51. package/dist/esm/preset/builder.js +1 -0
  52. package/dist/esm/preset/core-plugin/index.js +1 -1
  53. package/dist/esm/rank.js +3 -0
  54. package/dist/esm/types/index.js +2 -0
  55. package/dist/esm/types/toolbar.js +2 -0
  56. package/dist/esm/ui/DropList/index.js +1 -1
  57. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +3 -1
  58. package/dist/esm/utils/dom.js +1 -0
  59. package/dist/esm/utils/index.js +1 -0
  60. package/dist/esm/utils/performance/measure.js +3 -0
  61. package/dist/esm/utils/scroll-gutter.js +1 -0
  62. package/dist/types/element-browser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +1 -1
  63. package/dist/types/insert/index.d.ts +6 -0
  64. package/dist/types/messages/insert-block.d.ts +5 -0
  65. package/dist/types/messages/layout.d.ts +10 -0
  66. package/dist/types/types/selection-toolbar.d.ts +1 -0
  67. package/dist/types-ts4.5/element-browser/hooks/use-select-and-focus-on-arrow-navigation.d.ts +1 -1
  68. package/dist/types-ts4.5/insert/index.d.ts +6 -0
  69. package/dist/types-ts4.5/messages/insert-block.d.ts +5 -0
  70. package/dist/types-ts4.5/messages/layout.d.ts +10 -0
  71. package/dist/types-ts4.5/types/selection-toolbar.d.ts +1 -0
  72. package/package.json +6 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 96.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#173737](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/173737)
8
+ [`965f739a481f5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/965f739a481f5) -
9
+ [ux] Items are disabled in the plus menu while offline. This affects arrow navigation in the plus
10
+ menu and element browser
11
+ - [#173404](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/173404)
12
+ [`e5dc6a590c2e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e5dc6a590c2e9) -
13
+ fixed import path to resolve build error
14
+ - [#170241](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170241)
15
+ [`05530abbeb871`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/05530abbeb871) -
16
+ [ux] [ED-25804] [ED-25147] Make sure that Editor AI cannot insert tables nested more than two
17
+ times into the Editor
18
+ - Updated dependencies
19
+
20
+ ## 96.1.0
21
+
22
+ ### Minor Changes
23
+
24
+ - [#172933](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172933)
25
+ [`8323af2381d00`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8323af2381d00) -
26
+ Adds optional pluginName to the Selection group
27
+
28
+ ### Patch Changes
29
+
30
+ - [#171783](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171783)
31
+ [`ec56ec65d9dae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ec56ec65d9dae) -
32
+ [ux] ED-25929: Layout option quick insert improvements
33
+
3
34
  ## 96.0.2
4
35
 
5
36
  ### Patch Changes
@@ -179,6 +179,7 @@ function findCutBefore($pos) {
179
179
  return null;
180
180
  }
181
181
 
182
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
182
183
  /**
183
184
  * @deprecated
184
185
  *
@@ -545,7 +545,8 @@ function ElementItem(_ref10) {
545
545
  var icon = item.icon,
546
546
  title = item.title,
547
547
  description = item.description,
548
- keyshortcut = item.keyshortcut;
548
+ keyshortcut = item.keyshortcut,
549
+ isDisabled = item.isDisabled;
549
550
  return (0, _react2.jsx)(_tooltip.default, {
550
551
  content: description,
551
552
  testId: "element-item-tooltip-".concat(index)
@@ -559,7 +560,8 @@ function ElementItem(_ref10) {
559
560
  "aria-describedby": title,
560
561
  ref: ref,
561
562
  testId: "element-item-".concat(index),
562
- id: "searched-item-".concat(index)
563
+ id: "searched-item-".concat(index),
564
+ isDisabled: isDisabled
563
565
  }, (0, _react2.jsx)(ItemContent
564
566
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
565
567
  , {
@@ -567,7 +569,8 @@ function ElementItem(_ref10) {
567
569
  tabIndex: 0,
568
570
  title: title,
569
571
  description: description,
570
- keyshortcut: keyshortcut
572
+ keyshortcut: keyshortcut,
573
+ isDisabled: isDisabled
571
574
  })));
572
575
  }
573
576
 
@@ -586,7 +589,8 @@ var ElementBefore = /*#__PURE__*/(0, _react.memo)(function (_ref11) {
586
589
  var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref12) {
587
590
  var title = _ref12.title,
588
591
  description = _ref12.description,
589
- keyshortcut = _ref12.keyshortcut;
592
+ keyshortcut = _ref12.keyshortcut,
593
+ isDisabled = _ref12.isDisabled;
590
594
  if ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc')) {
591
595
  return (
592
596
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -600,13 +604,14 @@ var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref12) {
600
604
  }, (0, _react2.jsx)("div", {
601
605
  css: itemTitleWrapper
602
606
  }, (0, _react2.jsx)(_primitives.Text, {
607
+ color: isDisabled ? 'color.text.disabled' : undefined,
603
608
  maxLines: 1
604
609
  }, title), (0, _react2.jsx)("div", {
605
610
  css: itemAfter
606
611
  }, keyshortcut && (0, _react2.jsx)("div", {
607
612
  css: _shortcut.shortcutStyle
608
613
  }, keyshortcut))), description && (0, _react2.jsx)(_primitives.Text, {
609
- color: "color.text.subtle",
614
+ color: isDisabled ? 'color.text.disabled' : 'color.text.subtle',
610
615
  size: "small",
611
616
  maxLines: 2
612
617
  }, description))))
@@ -622,13 +627,15 @@ var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref12) {
622
627
  }, (0, _react2.jsx)("div", {
623
628
  css: itemTitleWrapper
624
629
  }, (0, _react2.jsx)("p", {
625
- css: itemTitle
630
+ css: isDisabled ? itemTitleDisabled : itemTitle
626
631
  }, title), (0, _react2.jsx)("div", {
627
632
  css: itemAfter
628
633
  }, keyshortcut && (0, _react2.jsx)("div", {
629
634
  css: _shortcut.shortcutStyle
630
- }, keyshortcut))), description && (0, _react2.jsx)("p", {
631
- css: itemDescription
635
+ }, keyshortcut))), description &&
636
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
637
+ (0, _react2.jsx)("p", {
638
+ css: isDisabled ? itemDescriptionDisabled : itemDescription
632
639
  }, description)))
633
640
  );
634
641
  }
@@ -708,6 +715,15 @@ var itemDescription = (0, _react2.css)(multilineStyle, {
708
715
  color: "var(--ds-text-subtle, #44546F)",
709
716
  marginTop: "var(--ds-space-025, 2px)"
710
717
  });
718
+
719
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
720
+ var itemDescriptionDisabled = (0, _react2.css)(multilineStyle, {
721
+ overflow: 'hidden',
722
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
723
+ fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67),
724
+ color: "var(--ds-text-disabled, #091E424F)",
725
+ marginTop: "var(--ds-space-025, 2px)"
726
+ });
711
727
  var itemText = (0, _react2.css)({
712
728
  width: 'inherit',
713
729
  whiteSpace: 'initial'
@@ -722,6 +738,13 @@ var itemTitle = (0, _react2.css)({
722
738
  whiteSpace: 'nowrap',
723
739
  textOverflow: 'ellipsis'
724
740
  });
741
+ var itemTitleDisabled = (0, _react2.css)({
742
+ width: '100%',
743
+ overflow: 'hidden',
744
+ whiteSpace: 'nowrap',
745
+ textOverflow: 'ellipsis',
746
+ color: "var(--ds-text-disabled, #091E424F)"
747
+ });
725
748
  var itemAfter = (0, _react2.css)({
726
749
  flex: '0 0 auto',
727
750
  paddingTop: "var(--ds-space-025, 2px)",
@@ -157,7 +157,11 @@ function StatelessElementBrowser(props) {
157
157
  // After user pick some category the category should stay focused.
158
158
  isFocusSearch = !categoryBeenChosen.current || !isEmptySearchTerm;
159
159
  }
160
- var _useSelectAndFocusOnA = (0, _useSelectAndFocusOnArrowNavigation.default)(items.length - 1, columnCount, !!viewMoreItem, isFocusSearch),
160
+ var itemIsDisabled = (0, _react.useCallback)(function (index) {
161
+ var _items$index$isDisabl, _items$index;
162
+ return (_items$index$isDisabl = (_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.isDisabled) !== null && _items$index$isDisabl !== void 0 ? _items$index$isDisabl : false;
163
+ }, [items]);
164
+ var _useSelectAndFocusOnA = (0, _useSelectAndFocusOnArrowNavigation.default)(items.length - 1, columnCount, !!viewMoreItem, itemIsDisabled, isFocusSearch),
161
165
  selectedItemIndex = _useSelectAndFocusOnA.selectedItemIndex,
162
166
  focusedItemIndex = _useSelectAndFocusOnA.focusedItemIndex,
163
167
  setFocusedItemIndex = _useSelectAndFocusOnA.setFocusedItemIndex,
@@ -197,6 +201,7 @@ function StatelessElementBrowser(props) {
197
201
  */
198
202
  var selectedItem = selectedItemIndex !== undefined ? items[selectedItemIndex] : null;
199
203
  var onItemsEnterTabKeyPress = (0, _react.useCallback)(function (e) {
204
+ var _selectedItem$isDisab;
200
205
  if (e.key !== 'Enter' && (e.key !== 'Tab' || !showCategories)) {
201
206
  return;
202
207
  }
@@ -206,7 +211,7 @@ function StatelessElementBrowser(props) {
206
211
  e.preventDefault();
207
212
  return;
208
213
  }
209
- if (onInsertItem && selectedItem != null) {
214
+ if (onInsertItem && selectedItem != null && !((_selectedItem$isDisab = selectedItem.isDisabled) !== null && _selectedItem$isDisab !== void 0 ? _selectedItem$isDisab : false)) {
210
215
  onInsertItem(selectedItem);
211
216
  }
212
217
  e.preventDefault();
@@ -8,6 +8,7 @@ exports.ensureSafeIndex = exports.default = exports.ACTIONS = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _react = require("react");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
14
  /**
@@ -83,12 +84,27 @@ var moveReducer = function moveReducer(state, action) {
83
84
  selectedItemIndex: canFocusViewMore ? undefined : listSize
84
85
  });
85
86
  } else {
86
- return _objectSpread(_objectSpread({}, state), {}, {
87
- focusOnSearch: false,
88
- focusOnViewMore: false,
89
- focusedItemIndex: 0,
90
- selectedItemIndex: 0
91
- });
87
+ if ((0, _platformFeatureFlags.fg)('platform_editor_is_disabled_state_element_browser')) {
88
+ var _action$payload$step;
89
+ var _newIndex = action.payload.positions ? action.payload.positions - ((_action$payload$step = action.payload.step) !== null && _action$payload$step !== void 0 ? _action$payload$step : 1) : 0;
90
+ var _safeIndex = ensureSafeIndex(_newIndex, state.listSize);
91
+ var isLastItemFocused = _newIndex > listSize;
92
+ var focusOnSearch = isLastItemFocused && !canFocusViewMore;
93
+ var focusOnViewMore = isLastItemFocused && !!canFocusViewMore;
94
+ return _objectSpread(_objectSpread({}, state), {}, {
95
+ focusOnSearch: focusOnSearch,
96
+ focusOnViewMore: focusOnViewMore,
97
+ focusedItemIndex: _safeIndex,
98
+ selectedItemIndex: _safeIndex
99
+ });
100
+ } else {
101
+ return _objectSpread(_objectSpread({}, state), {}, {
102
+ focusOnSearch: false,
103
+ focusOnViewMore: false,
104
+ focusedItemIndex: 0,
105
+ selectedItemIndex: 0
106
+ });
107
+ }
92
108
  }
93
109
  }
94
110
  if (state.focusOnViewMore) {
@@ -118,17 +134,17 @@ var moveReducer = function moveReducer(state, action) {
118
134
  // row then newIndex will be greater than listSize when
119
135
  // down arrow key is pressed.
120
136
  // Or when last item is focused and down or right arrow key is pressed.
121
- var isLastItemFocused = newIndex > listSize;
122
- var focusOnSearch = isLastItemFocused && !canFocusViewMore;
123
- var focusOnViewMore = isLastItemFocused && !!canFocusViewMore;
137
+ var _isLastItemFocused = newIndex > listSize;
138
+ var _focusOnSearch = _isLastItemFocused && !canFocusViewMore;
139
+ var _focusOnViewMore = _isLastItemFocused && !!canFocusViewMore;
124
140
  // if search is focused, then select first item.
125
141
  // otherwise if view more is focused then select item should be undefined.
126
- var selectedItemIndex = focusOnSearch ? 0 : focusOnViewMore ? undefined : safeIndex;
142
+ var selectedItemIndex = _focusOnSearch ? 0 : _focusOnViewMore ? undefined : safeIndex;
127
143
  return _objectSpread(_objectSpread({}, state), {}, {
128
- focusOnSearch: focusOnSearch,
129
- focusOnViewMore: focusOnViewMore,
144
+ focusOnSearch: _focusOnSearch,
145
+ focusOnViewMore: _focusOnViewMore,
130
146
  selectedItemIndex: selectedItemIndex,
131
- focusedItemIndex: isLastItemFocused ? undefined : safeIndex
147
+ focusedItemIndex: _isLastItemFocused ? undefined : safeIndex
132
148
  });
133
149
  }
134
150
 
@@ -171,7 +187,40 @@ var getInitialState = function getInitialState(listSize, canFocusViewMore) {
171
187
  });
172
188
  };
173
189
  };
174
- function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, isFocusSearch) {
190
+
191
+ // Get the offset forwards - skip items that are disabled
192
+ var skipForwardOffsetToSafeItem = function skipForwardOffsetToSafeItem(currentIndex, listSize, stepSize, itemIsDisabled) {
193
+ if (currentIndex === undefined) {
194
+ return undefined;
195
+ }
196
+ // Iterate through the list starting from the next item
197
+ for (var offset = 1; currentIndex + offset * stepSize <= listSize; offset++) {
198
+ if (!itemIsDisabled(currentIndex + offset * stepSize)) {
199
+ return offset * stepSize;
200
+ }
201
+ }
202
+
203
+ // Move to the last place if possible
204
+ return listSize - currentIndex + 1;
205
+ };
206
+
207
+ // Get the offset backwards - skip items that are disabled
208
+ var skipBackwardOffsetToSafeItem = function skipBackwardOffsetToSafeItem(currentIndex, stepSize, itemIsDisabled) {
209
+ if (currentIndex === undefined) {
210
+ return undefined;
211
+ }
212
+
213
+ // Iterate backwards starting from the previous item
214
+ for (var offset = 1; currentIndex - offset * stepSize >= -1; offset++) {
215
+ if (!itemIsDisabled(currentIndex - offset * stepSize) || currentIndex - offset * stepSize === -1) {
216
+ return offset * stepSize;
217
+ }
218
+ }
219
+
220
+ // Move to search if no available index
221
+ return currentIndex + 1;
222
+ };
223
+ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, itemIsDisabled, isFocusSearch) {
175
224
  var _useReducer = (0, _react.useReducer)(reducer, initialState, getInitialState(listSize, canFocusViewMore)),
176
225
  _useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),
177
226
  state = _useReducer2[0],
@@ -271,15 +320,49 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, is
271
320
  e.stopPropagation();
272
321
  return setFocusOnSearch();
273
322
  case 'ArrowRight':
274
- return move(e, +1);
323
+ {
324
+ if ((0, _platformFeatureFlags.fg)('platform_editor_is_disabled_state_element_browser')) {
325
+ var _skipForwardOffsetToS;
326
+ var itemIndex = focusOnSearch ? -1 : selectedItemIndex;
327
+ var nextItem = (_skipForwardOffsetToS = skipForwardOffsetToSafeItem(itemIndex, listSize, 1, itemIsDisabled)) !== null && _skipForwardOffsetToS !== void 0 ? _skipForwardOffsetToS : 1;
328
+ return move(e, nextItem);
329
+ } else {
330
+ return move(e, +1);
331
+ }
332
+ }
275
333
  case 'ArrowLeft':
276
- return move(e, -1);
334
+ {
335
+ if ((0, _platformFeatureFlags.fg)('platform_editor_is_disabled_state_element_browser')) {
336
+ var _skipBackwardOffsetTo;
337
+ var _nextItem = (_skipBackwardOffsetTo = skipBackwardOffsetToSafeItem(selectedItemIndex, 1, itemIsDisabled)) !== null && _skipBackwardOffsetTo !== void 0 ? _skipBackwardOffsetTo : 1;
338
+ return move(e, -_nextItem);
339
+ } else {
340
+ return move(e, -1);
341
+ }
342
+ }
277
343
  case 'ArrowDown':
278
- return move(e, +step);
344
+ {
345
+ if ((0, _platformFeatureFlags.fg)('platform_editor_is_disabled_state_element_browser')) {
346
+ var _skipForwardOffsetToS2;
347
+ var _itemIndex = focusOnSearch ? -step : selectedItemIndex;
348
+ var _nextItem2 = (_skipForwardOffsetToS2 = skipForwardOffsetToSafeItem(_itemIndex, listSize, step, itemIsDisabled)) !== null && _skipForwardOffsetToS2 !== void 0 ? _skipForwardOffsetToS2 : step;
349
+ return move(e, +_nextItem2, step);
350
+ } else {
351
+ return move(e, +step);
352
+ }
353
+ }
279
354
  case 'ArrowUp':
280
- return move(e, -step, step);
355
+ {
356
+ if ((0, _platformFeatureFlags.fg)('platform_editor_is_disabled_state_element_browser')) {
357
+ var _skipBackwardOffsetTo2;
358
+ var _nextItem3 = (_skipBackwardOffsetTo2 = skipBackwardOffsetToSafeItem(selectedItemIndex, step, itemIsDisabled)) !== null && _skipBackwardOffsetTo2 !== void 0 ? _skipBackwardOffsetTo2 : step;
359
+ return move(e, Math.min(-_nextItem3, -step), step);
360
+ } else {
361
+ return move(e, -step, step);
362
+ }
363
+ }
281
364
  }
282
- }, [focusOnSearch, setFocusOnSearch, move, step]);
365
+ }, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step]);
283
366
  (0, _react.useEffect)(function () {
284
367
  // To reset selection when user filters
285
368
  reset(listSize);
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.LookDirection = void 0;
8
8
  exports.contentAllowedInCodeBlock = contentAllowedInCodeBlock;
9
+ exports.fragmentContainsNodeType = fragmentContainsNodeType;
9
10
  exports.shouldSplitSelectedNodeOnNodeInsertion = exports.safeInsert = exports.normaliseNestedLayout = exports.insertSelectedItem = void 0;
10
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
12
  var _model = require("@atlaskit/editor-prosemirror/model");
@@ -311,6 +312,24 @@ function contentAllowedInCodeBlock(state) {
311
312
  return isAllowedChild;
312
313
  }
313
314
 
315
+ /**
316
+ * Check if a fragment contains a particular node by iterating through all the nodes in the fragment.
317
+ * If the node type is found will stop looking and return true.
318
+ * If the node type is not found, it will return false.
319
+ */
320
+ function fragmentContainsNodeType(fragment, nodeType) {
321
+ var doesContainNodeType = false;
322
+ fragment.descendants(function (node) {
323
+ if (node.type === nodeType) {
324
+ doesContainNodeType = true;
325
+ // Stop looking
326
+ return false;
327
+ }
328
+ return true;
329
+ });
330
+ return doesContainNodeType;
331
+ }
332
+
314
333
  // For platform_editor_element_level_templates experiment only
315
334
  // clean up ticket ED-24873
316
335
  var insertTemplateFragment = function insertTemplateFragment(_ref3) {
@@ -68,6 +68,7 @@ var resolvedNodesPerEditorView = new WeakMap();
68
68
  */
69
69
  var debounceToEditorViewMap = new WeakMap();
70
70
  var testOnlyIgnoreLazyNodeViewSet = new WeakSet();
71
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
71
72
  /**
72
73
  * 🧱 Internal: Editor FE Platform
73
74
  *
@@ -176,6 +176,11 @@ var toolbarInsertBlockMessages = exports.toolbarInsertBlockMessages = (0, _react
176
176
  defaultMessage: 'Structure your page using sections',
177
177
  description: 'Create a multi column section or layout'
178
178
  },
179
+ columnsDescriptionAdvancedLayout: {
180
+ id: 'fabric.editor.columns.advanced.layout.description',
181
+ defaultMessage: 'Insert {numberOfColumns} equal columns',
182
+ description: 'Create a multi column section or layout'
183
+ },
179
184
  status: {
180
185
  id: 'fabric.editor.status',
181
186
  defaultMessage: 'Status',
@@ -16,19 +16,29 @@ var toolbarMessages = exports.toolbarMessages = (0, _reactIntlNext.defineMessage
16
16
  defaultMessage: 'Two columns layout',
17
17
  description: 'Layout with two columns of equal width'
18
18
  },
19
+ twoColumnsAdvancedLayout: {
20
+ id: 'fabric.editor.twoColumns',
21
+ defaultMessage: '2 Column layout',
22
+ description: 'Layout with two columns of equal width'
23
+ },
19
24
  threeColumns: {
20
25
  id: 'fabric.editor.threeColumns',
21
26
  defaultMessage: 'Three columns layout',
22
27
  description: 'Layout with three columns of equal width'
23
28
  },
29
+ threeColumnsAdvancedLayout: {
30
+ id: 'fabric.editor.threeColumns',
31
+ defaultMessage: '3 Column layout',
32
+ description: 'Layout with three columns of equal width'
33
+ },
24
34
  fourColumns: {
25
35
  id: 'fabric.editor.fourColumns',
26
- defaultMessage: 'Four columns layout',
36
+ defaultMessage: '4 Column layout',
27
37
  description: 'Layout with four columns of equal width'
28
38
  },
29
39
  fiveColumns: {
30
40
  id: 'fabric.editor.fiveColumns',
31
- defaultMessage: 'Five columns layout',
41
+ defaultMessage: '5 Column layout',
32
42
  description: 'Layout with five columns of equal width'
33
43
  },
34
44
  rightSidebar: {
@@ -68,7 +78,7 @@ var toolbarMessages = exports.toolbarMessages = (0, _reactIntlNext.defineMessage
68
78
  },
69
79
  columnOption: {
70
80
  id: 'fabric.editor.layout.columnOption',
71
- defaultMessage: '{count, plural, one {-column} other {{count}-columns}}',
81
+ defaultMessage: '{count, plural, one { Column} other {{count} Columns}}',
72
82
  description: 'column option text for layout'
73
83
  }
74
84
  });
@@ -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 = "96.0.2";
20
+ var packageVersion = "96.1.1";
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
@@ -504,6 +504,7 @@ var EditorPresetBuilder = exports.EditorPresetBuilder = /*#__PURE__*/function ()
504
504
  function EditorPresetBuilder() {
505
505
  var _this = this;
506
506
  (0, _classCallCheck2.default)(this, EditorPresetBuilder);
507
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
507
508
  /**
508
509
  * @deprecated Use `apiResolver` instead
509
510
  */
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.corePlugin = void 0;
7
- var _processRawValue = require("../../../src/utils/processRawValue");
7
+ var _processRawValue = require("../../utils/processRawValue");
8
8
  var _editorCommands = require("../editor-commands");
9
9
  var _requestDocument = require("./requestDocument");
10
10
  /**
package/dist/cjs/rank.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.rankEditorPlugins = void 0;
7
7
  exports.sortByOrder = sortByOrder;
8
8
  exports.sortByOrderWithTypeName = sortByOrderWithTypeName;
9
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
9
10
  // @deprecated
10
11
  // @private This rank is not stable and should not be trusted. If you need to change this file, please let the Editor lego team know about it
11
12
  var rankEditorPlugins = exports.rankEditorPlugins = {
@@ -36,6 +37,7 @@ var rankEditorPlugins = exports.rankEditorPlugins = {
36
37
  'unsupportedMark', 'unsupportedNodeAttribute']
37
38
  };
38
39
 
40
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
39
41
  // @deprecated
40
42
  // @private This rank is not stable and should not be trusted. If you need to change this file, please let the Editor lego team know about it
41
43
  function sortByOrder(item) {
@@ -49,6 +51,7 @@ function sortByOrder(item) {
49
51
  // function avoided that whole mess. If someone can think of a better way to implement
50
52
  // the above and below into a single function please do so
51
53
 
54
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
52
55
  // @deprecated
53
56
  // @private This rank is not stable and should not be trusted. If you need to change this file, please let the Editor lego team know about it
54
57
  function sortByOrderWithTypeName(item) {
@@ -55,10 +55,11 @@ var SortOrder = exports.SortOrder = /*#__PURE__*/function (SortOrder) {
55
55
  SortOrder["DESC"] = "desc";
56
56
  SortOrder["NO_ORDER"] = "no_order";
57
57
  return SortOrder;
58
- }({});
58
+ }({}); // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
59
59
  /**
60
60
  * @deprecated
61
61
  */
62
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
62
63
  /**
63
64
  * @deprecated
64
65
  *
@@ -12,7 +12,7 @@ var ToolbarSize = exports.ToolbarSize = /*#__PURE__*/function (ToolbarSize) {
12
12
  ToolbarSize[ToolbarSize["S"] = 2] = "S";
13
13
  ToolbarSize[ToolbarSize["XXXS"] = 1] = "XXXS";
14
14
  return ToolbarSize;
15
- }({});
15
+ }({}); // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
16
16
  /** @deprecated
17
17
  * To be removed as part of ED-25129 in favour of ToolbarWidthsNext along with references
18
18
  * to platform_editor_toolbar_responsive_fixes feature gate
@@ -32,7 +32,7 @@ var ToolbarWidthsNext = exports.ToolbarWidthsNext = /*#__PURE__*/function (Toolb
32
32
  ToolbarWidthsNext[ToolbarWidthsNext["M"] = 450] = "M";
33
33
  ToolbarWidthsNext[ToolbarWidthsNext["S"] = 410] = "S";
34
34
  return ToolbarWidthsNext;
35
- }({});
35
+ }({}); // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
36
36
  /** @deprecated
37
37
  * To be removed as part of ED-25129 in favour of ToolbarWidthsFullPageNext along with references
38
38
  * to platform_editor_toolbar_responsive_fixes feature gate
@@ -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 = "96.0.2";
27
+ var packageVersion = "96.1.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -45,7 +45,9 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
45
45
  if (!_this.props.isActiveComponent || !_this.props.handleClickOutside) {
46
46
  return;
47
47
  }
48
- var domNode = (0, _platformFeatureFlags.fg)('platform_editor_replace_finddomnode_in_common') ? (_this$props$outsideCl = _this.props.outsideClickTargetRef.current) === null || _this$props$outsideCl === void 0 ? void 0 : _this$props$outsideCl.deref() : _reactDom.default.findDOMNode((0, _assertThisInitialized2.default)(_this));
48
+ var domNode = (0, _platformFeatureFlags.fg)('platform_editor_replace_finddomnode_in_common') ? (_this$props$outsideCl = _this.props.outsideClickTargetRef.current) === null || _this$props$outsideCl === void 0 ? void 0 : _this$props$outsideCl.deref() :
49
+ // eslint-disable-next-line react/no-find-dom-node -- Ignored via go/ED-25883
50
+ _reactDom.default.findDOMNode((0, _assertThisInitialized2.default)(_this));
49
51
  if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
50
52
  var _this$props$editorVie;
51
53
  _this.props.handleClickOutside(evt);
@@ -86,6 +86,7 @@ function closest(node, s) {
86
86
  return null;
87
87
  }
88
88
 
89
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
89
90
  /*
90
91
  * @deprecated - Use HTMLElement.protoype.closest instead
91
92
  */
@@ -1234,6 +1234,7 @@ var _withFeatureFlaggedComponent = require("./withFeatureFlaggedComponent");
1234
1234
  * Private API - should not be used. Use `@atlaskit/editor-common/performance/navigation` if required.
1235
1235
  */
1236
1236
 
1237
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
1237
1238
  /**
1238
1239
  * @deprecated - [ED-23844] moving to own entry point @atlaskit/editor-common/whitespace
1239
1240
  */
@@ -9,6 +9,7 @@ exports.stopMeasure = stopMeasure;
9
9
  var _isPerformanceApiAvailable = require("./is-performance-api-available");
10
10
  var measureMap = new Map();
11
11
 
12
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
12
13
  /**
13
14
  * @deprecated use 'startMeasure' from '@atlaskit/editor-common/performance-measures'
14
15
  */
@@ -20,6 +21,7 @@ function startMeasure(measureName) {
20
21
  measureMap.set(measureName, performance.now());
21
22
  }
22
23
 
24
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
23
25
  /**
24
26
  * @deprecated use 'stopMeasure' from '@atlaskit/editor-common/performance-measures'
25
27
  */
@@ -44,6 +46,7 @@ function stopMeasure(measureName, onMeasureComplete) {
44
46
  }
45
47
  }
46
48
 
49
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
47
50
  /**
48
51
  * @deprecated use 'clearMeasure' from '@atlaskit/editor-common/performance-measures'
49
52
  */
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.GUTTER_SIZE_MOBILE_IN_PX = exports.GUTTER_SIZE_IN_PX = exports.GUTTER_SELECTOR = void 0;
7
7
  var GUTTER_SIZE_IN_PX = exports.GUTTER_SIZE_IN_PX = 120; // Default gutter size
8
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
8
9
  /**
9
10
  * @deprecated - [ED-23844] only used in Editor Core
10
11
  */
@@ -155,6 +155,7 @@ export function findCutBefore($pos) {
155
155
  return null;
156
156
  }
157
157
 
158
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
158
159
  /**
159
160
  * @deprecated
160
161
  *