@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
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  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; }
4
4
  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) { _defineProperty(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; }
5
5
  import { useCallback, useEffect, useReducer, useRef } from 'react';
6
-
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
7
  /**
8
8
  * a custom hook that handles keyboard navigation for Arrow keys based on a
9
9
  * given listSize, and a step (for up and down arrows).
@@ -78,12 +78,27 @@ var moveReducer = function moveReducer(state, action) {
78
78
  selectedItemIndex: canFocusViewMore ? undefined : listSize
79
79
  });
80
80
  } else {
81
- return _objectSpread(_objectSpread({}, state), {}, {
82
- focusOnSearch: false,
83
- focusOnViewMore: false,
84
- focusedItemIndex: 0,
85
- selectedItemIndex: 0
86
- });
81
+ if (fg('platform_editor_is_disabled_state_element_browser')) {
82
+ var _action$payload$step;
83
+ 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;
84
+ var _safeIndex = ensureSafeIndex(_newIndex, state.listSize);
85
+ var isLastItemFocused = _newIndex > listSize;
86
+ var focusOnSearch = isLastItemFocused && !canFocusViewMore;
87
+ var focusOnViewMore = isLastItemFocused && !!canFocusViewMore;
88
+ return _objectSpread(_objectSpread({}, state), {}, {
89
+ focusOnSearch: focusOnSearch,
90
+ focusOnViewMore: focusOnViewMore,
91
+ focusedItemIndex: _safeIndex,
92
+ selectedItemIndex: _safeIndex
93
+ });
94
+ } else {
95
+ return _objectSpread(_objectSpread({}, state), {}, {
96
+ focusOnSearch: false,
97
+ focusOnViewMore: false,
98
+ focusedItemIndex: 0,
99
+ selectedItemIndex: 0
100
+ });
101
+ }
87
102
  }
88
103
  }
89
104
  if (state.focusOnViewMore) {
@@ -113,17 +128,17 @@ var moveReducer = function moveReducer(state, action) {
113
128
  // row then newIndex will be greater than listSize when
114
129
  // down arrow key is pressed.
115
130
  // Or when last item is focused and down or right arrow key is pressed.
116
- var isLastItemFocused = newIndex > listSize;
117
- var focusOnSearch = isLastItemFocused && !canFocusViewMore;
118
- var focusOnViewMore = isLastItemFocused && !!canFocusViewMore;
131
+ var _isLastItemFocused = newIndex > listSize;
132
+ var _focusOnSearch = _isLastItemFocused && !canFocusViewMore;
133
+ var _focusOnViewMore = _isLastItemFocused && !!canFocusViewMore;
119
134
  // if search is focused, then select first item.
120
135
  // otherwise if view more is focused then select item should be undefined.
121
- var selectedItemIndex = focusOnSearch ? 0 : focusOnViewMore ? undefined : safeIndex;
136
+ var selectedItemIndex = _focusOnSearch ? 0 : _focusOnViewMore ? undefined : safeIndex;
122
137
  return _objectSpread(_objectSpread({}, state), {}, {
123
- focusOnSearch: focusOnSearch,
124
- focusOnViewMore: focusOnViewMore,
138
+ focusOnSearch: _focusOnSearch,
139
+ focusOnViewMore: _focusOnViewMore,
125
140
  selectedItemIndex: selectedItemIndex,
126
- focusedItemIndex: isLastItemFocused ? undefined : safeIndex
141
+ focusedItemIndex: _isLastItemFocused ? undefined : safeIndex
127
142
  });
128
143
  }
129
144
 
@@ -166,7 +181,40 @@ var getInitialState = function getInitialState(listSize, canFocusViewMore) {
166
181
  });
167
182
  };
168
183
  };
169
- function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, isFocusSearch) {
184
+
185
+ // Get the offset forwards - skip items that are disabled
186
+ var skipForwardOffsetToSafeItem = function skipForwardOffsetToSafeItem(currentIndex, listSize, stepSize, itemIsDisabled) {
187
+ if (currentIndex === undefined) {
188
+ return undefined;
189
+ }
190
+ // Iterate through the list starting from the next item
191
+ for (var offset = 1; currentIndex + offset * stepSize <= listSize; offset++) {
192
+ if (!itemIsDisabled(currentIndex + offset * stepSize)) {
193
+ return offset * stepSize;
194
+ }
195
+ }
196
+
197
+ // Move to the last place if possible
198
+ return listSize - currentIndex + 1;
199
+ };
200
+
201
+ // Get the offset backwards - skip items that are disabled
202
+ var skipBackwardOffsetToSafeItem = function skipBackwardOffsetToSafeItem(currentIndex, stepSize, itemIsDisabled) {
203
+ if (currentIndex === undefined) {
204
+ return undefined;
205
+ }
206
+
207
+ // Iterate backwards starting from the previous item
208
+ for (var offset = 1; currentIndex - offset * stepSize >= -1; offset++) {
209
+ if (!itemIsDisabled(currentIndex - offset * stepSize) || currentIndex - offset * stepSize === -1) {
210
+ return offset * stepSize;
211
+ }
212
+ }
213
+
214
+ // Move to search if no available index
215
+ return currentIndex + 1;
216
+ };
217
+ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, itemIsDisabled, isFocusSearch) {
170
218
  var _useReducer = useReducer(reducer, initialState, getInitialState(listSize, canFocusViewMore)),
171
219
  _useReducer2 = _slicedToArray(_useReducer, 2),
172
220
  state = _useReducer2[0],
@@ -266,15 +314,49 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, is
266
314
  e.stopPropagation();
267
315
  return setFocusOnSearch();
268
316
  case 'ArrowRight':
269
- return move(e, +1);
317
+ {
318
+ if (fg('platform_editor_is_disabled_state_element_browser')) {
319
+ var _skipForwardOffsetToS;
320
+ var itemIndex = focusOnSearch ? -1 : selectedItemIndex;
321
+ var nextItem = (_skipForwardOffsetToS = skipForwardOffsetToSafeItem(itemIndex, listSize, 1, itemIsDisabled)) !== null && _skipForwardOffsetToS !== void 0 ? _skipForwardOffsetToS : 1;
322
+ return move(e, nextItem);
323
+ } else {
324
+ return move(e, +1);
325
+ }
326
+ }
270
327
  case 'ArrowLeft':
271
- return move(e, -1);
328
+ {
329
+ if (fg('platform_editor_is_disabled_state_element_browser')) {
330
+ var _skipBackwardOffsetTo;
331
+ var _nextItem = (_skipBackwardOffsetTo = skipBackwardOffsetToSafeItem(selectedItemIndex, 1, itemIsDisabled)) !== null && _skipBackwardOffsetTo !== void 0 ? _skipBackwardOffsetTo : 1;
332
+ return move(e, -_nextItem);
333
+ } else {
334
+ return move(e, -1);
335
+ }
336
+ }
272
337
  case 'ArrowDown':
273
- return move(e, +step);
338
+ {
339
+ if (fg('platform_editor_is_disabled_state_element_browser')) {
340
+ var _skipForwardOffsetToS2;
341
+ var _itemIndex = focusOnSearch ? -step : selectedItemIndex;
342
+ var _nextItem2 = (_skipForwardOffsetToS2 = skipForwardOffsetToSafeItem(_itemIndex, listSize, step, itemIsDisabled)) !== null && _skipForwardOffsetToS2 !== void 0 ? _skipForwardOffsetToS2 : step;
343
+ return move(e, +_nextItem2, step);
344
+ } else {
345
+ return move(e, +step);
346
+ }
347
+ }
274
348
  case 'ArrowUp':
275
- return move(e, -step, step);
349
+ {
350
+ if (fg('platform_editor_is_disabled_state_element_browser')) {
351
+ var _skipBackwardOffsetTo2;
352
+ var _nextItem3 = (_skipBackwardOffsetTo2 = skipBackwardOffsetToSafeItem(selectedItemIndex, step, itemIsDisabled)) !== null && _skipBackwardOffsetTo2 !== void 0 ? _skipBackwardOffsetTo2 : step;
353
+ return move(e, Math.min(-_nextItem3, -step), step);
354
+ } else {
355
+ return move(e, -step, step);
356
+ }
357
+ }
276
358
  }
277
- }, [focusOnSearch, setFocusOnSearch, move, step]);
359
+ }, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step]);
278
360
  useEffect(function () {
279
361
  // To reset selection when user filters
280
362
  reset(listSize);
@@ -302,6 +302,24 @@ export function contentAllowedInCodeBlock(state) {
302
302
  return isAllowedChild;
303
303
  }
304
304
 
305
+ /**
306
+ * Check if a fragment contains a particular node by iterating through all the nodes in the fragment.
307
+ * If the node type is found will stop looking and return true.
308
+ * If the node type is not found, it will return false.
309
+ */
310
+ export function fragmentContainsNodeType(fragment, nodeType) {
311
+ var doesContainNodeType = false;
312
+ fragment.descendants(function (node) {
313
+ if (node.type === nodeType) {
314
+ doesContainNodeType = true;
315
+ // Stop looking
316
+ return false;
317
+ }
318
+ return true;
319
+ });
320
+ return doesContainNodeType;
321
+ }
322
+
305
323
  // For platform_editor_element_level_templates experiment only
306
324
  // clean up ticket ED-24873
307
325
  var insertTemplateFragment = function insertTemplateFragment(_ref3) {
@@ -53,6 +53,7 @@ var resolvedNodesPerEditorView = new WeakMap();
53
53
  */
54
54
  var debounceToEditorViewMap = new WeakMap();
55
55
  var testOnlyIgnoreLazyNodeViewSet = new WeakSet();
56
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
56
57
  /**
57
58
  * 🧱 Internal: Editor FE Platform
58
59
  *
@@ -170,6 +170,11 @@ export var toolbarInsertBlockMessages = defineMessages({
170
170
  defaultMessage: 'Structure your page using sections',
171
171
  description: 'Create a multi column section or layout'
172
172
  },
173
+ columnsDescriptionAdvancedLayout: {
174
+ id: 'fabric.editor.columns.advanced.layout.description',
175
+ defaultMessage: 'Insert {numberOfColumns} equal columns',
176
+ description: 'Create a multi column section or layout'
177
+ },
173
178
  status: {
174
179
  id: 'fabric.editor.status',
175
180
  defaultMessage: 'Status',
@@ -10,19 +10,29 @@ export var toolbarMessages = defineMessages({
10
10
  defaultMessage: 'Two columns layout',
11
11
  description: 'Layout with two columns of equal width'
12
12
  },
13
+ twoColumnsAdvancedLayout: {
14
+ id: 'fabric.editor.twoColumns',
15
+ defaultMessage: '2 Column layout',
16
+ description: 'Layout with two columns of equal width'
17
+ },
13
18
  threeColumns: {
14
19
  id: 'fabric.editor.threeColumns',
15
20
  defaultMessage: 'Three columns layout',
16
21
  description: 'Layout with three columns of equal width'
17
22
  },
23
+ threeColumnsAdvancedLayout: {
24
+ id: 'fabric.editor.threeColumns',
25
+ defaultMessage: '3 Column layout',
26
+ description: 'Layout with three columns of equal width'
27
+ },
18
28
  fourColumns: {
19
29
  id: 'fabric.editor.fourColumns',
20
- defaultMessage: 'Four columns layout',
30
+ defaultMessage: '4 Column layout',
21
31
  description: 'Layout with four columns of equal width'
22
32
  },
23
33
  fiveColumns: {
24
34
  id: 'fabric.editor.fiveColumns',
25
- defaultMessage: 'Five columns layout',
35
+ defaultMessage: '5 Column layout',
26
36
  description: 'Layout with five columns of equal width'
27
37
  },
28
38
  rightSidebar: {
@@ -62,7 +72,7 @@ export var toolbarMessages = defineMessages({
62
72
  },
63
73
  columnOption: {
64
74
  id: 'fabric.editor.layout.columnOption',
65
- defaultMessage: '{count, plural, one {-column} other {{count}-columns}}',
75
+ defaultMessage: '{count, plural, one { Column} other {{count} Columns}}',
66
76
  description: 'column option text for layout'
67
77
  }
68
78
  });
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "96.0.2";
10
+ var packageVersion = "96.1.1";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -535,6 +535,7 @@ export var EditorPresetBuilder = /*#__PURE__*/function () {
535
535
  function EditorPresetBuilder() {
536
536
  var _this = this;
537
537
  _classCallCheck(this, EditorPresetBuilder);
538
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
538
539
  /**
539
540
  * @deprecated Use `apiResolver` instead
540
541
  */
@@ -1,4 +1,4 @@
1
- import { processRawFragmentValue, processRawValue } from '../../../src/utils/processRawValue';
1
+ import { processRawFragmentValue, processRawValue } from '../../utils/processRawValue';
2
2
  import { editorCommandToPMCommand } from '../editor-commands';
3
3
  import { scheduleDocumentRequest } from './requestDocument';
4
4
 
package/dist/esm/rank.js CHANGED
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
1
2
  // @deprecated
2
3
  // @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
3
4
  export var rankEditorPlugins = {
@@ -28,6 +29,7 @@ export var rankEditorPlugins = {
28
29
  'unsupportedMark', 'unsupportedNodeAttribute']
29
30
  };
30
31
 
32
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
31
33
  // @deprecated
32
34
  // @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
33
35
  export function sortByOrder(item) {
@@ -41,6 +43,7 @@ export function sortByOrder(item) {
41
43
  // function avoided that whole mess. If someone can think of a better way to implement
42
44
  // the above and below into a single function please do so
43
45
 
46
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
44
47
  // @deprecated
45
48
  // @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
46
49
  export function sortByOrderWithTypeName(item) {
@@ -10,10 +10,12 @@ export var SortOrder = /*#__PURE__*/function (SortOrder) {
10
10
  export { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './annotation/emitter';
11
11
  export { ToolbarSize, ToolbarWidths, ToolbarWidthsNext, ToolbarWidthsFullPage, ToolbarWidthsFullPageNext } from './toolbar';
12
12
 
13
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
13
14
  /**
14
15
  * @deprecated
15
16
  */
16
17
 
18
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
17
19
  /**
18
20
  * @deprecated
19
21
  *
@@ -8,6 +8,7 @@ export var ToolbarSize = /*#__PURE__*/function (ToolbarSize) {
8
8
  return ToolbarSize;
9
9
  }({});
10
10
 
11
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
11
12
  /** @deprecated
12
13
  * To be removed as part of ED-25129 in favour of ToolbarWidthsNext along with references
13
14
  * to platform_editor_toolbar_responsive_fixes feature gate
@@ -29,6 +30,7 @@ export var ToolbarWidthsNext = /*#__PURE__*/function (ToolbarWidthsNext) {
29
30
  return ToolbarWidthsNext;
30
31
  }({});
31
32
 
33
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
32
34
  /** @deprecated
33
35
  * To be removed as part of ED-25129 in favour of ToolbarWidthsFullPageNext along with references
34
36
  * to platform_editor_toolbar_responsive_fixes feature gate
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
21
21
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "96.0.2";
24
+ var packageVersion = "96.1.1";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var DropList = /*#__PURE__*/function (_Component) {
@@ -34,7 +34,9 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
34
34
  if (!_this.props.isActiveComponent || !_this.props.handleClickOutside) {
35
35
  return;
36
36
  }
37
- var domNode = 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.findDOMNode(_assertThisInitialized(_this));
37
+ var domNode = 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() :
38
+ // eslint-disable-next-line react/no-find-dom-node -- Ignored via go/ED-25883
39
+ ReactDOM.findDOMNode(_assertThisInitialized(_this));
38
40
  if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
39
41
  var _this$props$editorVie;
40
42
  _this.props.handleClickOutside(evt);
@@ -72,6 +72,7 @@ export function closest(node, s) {
72
72
  return null;
73
73
  }
74
74
 
75
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
75
76
  /*
76
77
  * @deprecated - Use HTMLElement.protoype.closest instead
77
78
  */
@@ -126,6 +126,7 @@ export { hasMergedCell, calcTableColumnWidths, convertProsemirrorTableNodeToArra
126
126
  export { createCompareNodes } from './compareNodes';
127
127
  export { compose } from './compose';
128
128
  export { isTextInput } from './is-text-input';
129
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
129
130
  /**
130
131
  * @deprecated - [ED-23844] moving to own entry point @atlaskit/editor-common/whitespace
131
132
  */
@@ -1,6 +1,7 @@
1
1
  import { isPerformanceAPIAvailable } from './is-performance-api-available';
2
2
  var measureMap = new Map();
3
3
 
4
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
4
5
  /**
5
6
  * @deprecated use 'startMeasure' from '@atlaskit/editor-common/performance-measures'
6
7
  */
@@ -12,6 +13,7 @@ export function startMeasure(measureName) {
12
13
  measureMap.set(measureName, performance.now());
13
14
  }
14
15
 
16
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
15
17
  /**
16
18
  * @deprecated use 'stopMeasure' from '@atlaskit/editor-common/performance-measures'
17
19
  */
@@ -36,6 +38,7 @@ export function stopMeasure(measureName, onMeasureComplete) {
36
38
  }
37
39
  }
38
40
 
41
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
39
42
  /**
40
43
  * @deprecated use 'clearMeasure' from '@atlaskit/editor-common/performance-measures'
41
44
  */
@@ -1,4 +1,5 @@
1
1
  export var GUTTER_SIZE_IN_PX = 120; // Default gutter size
2
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
2
3
  /**
3
4
  * @deprecated - [ED-23844] only used in Editor Core
4
5
  */
@@ -70,6 +70,6 @@ export type useSelectAndFocusReturnType = {
70
70
  setFocusedCategoryIndex: (index?: number) => void;
71
71
  setFocusOnSearch: () => void;
72
72
  };
73
- declare function useSelectAndFocusOnArrowNavigation(listSize: number, step: number, canFocusViewMore: boolean, isFocusSearch?: boolean): useSelectAndFocusReturnType;
73
+ declare function useSelectAndFocusOnArrowNavigation(listSize: number, step: number, canFocusViewMore: boolean, itemIsDisabled: (index: number) => boolean, isFocusSearch?: boolean): useSelectAndFocusReturnType;
74
74
  export declare const ensureSafeIndex: (index: number, listSize: number) => number;
75
75
  export default useSelectAndFocusOnArrowNavigation;
@@ -30,3 +30,9 @@ export declare const shouldSplitSelectedNodeOnNodeInsertion: ({ parentNodeType,
30
30
  * as we extract their text content.
31
31
  */
32
32
  export declare function contentAllowedInCodeBlock(state: EditorState): boolean;
33
+ /**
34
+ * Check if a fragment contains a particular node by iterating through all the nodes in the fragment.
35
+ * If the node type is found will stop looking and return true.
36
+ * If the node type is not found, it will return false.
37
+ */
38
+ export declare function fragmentContainsNodeType(fragment: Fragment, nodeType: NodeType): boolean;
@@ -169,6 +169,11 @@ export declare const toolbarInsertBlockMessages: {
169
169
  defaultMessage: string;
170
170
  description: string;
171
171
  };
172
+ columnsDescriptionAdvancedLayout: {
173
+ id: string;
174
+ defaultMessage: string;
175
+ description: string;
176
+ };
172
177
  status: {
173
178
  id: string;
174
179
  defaultMessage: string;
@@ -9,11 +9,21 @@ export declare const toolbarMessages: {
9
9
  defaultMessage: string;
10
10
  description: string;
11
11
  };
12
+ twoColumnsAdvancedLayout: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
12
17
  threeColumns: {
13
18
  id: string;
14
19
  defaultMessage: string;
15
20
  description: string;
16
21
  };
22
+ threeColumnsAdvancedLayout: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
17
27
  fourColumns: {
18
28
  id: string;
19
29
  defaultMessage: string;
@@ -10,6 +10,7 @@ export type SelectionToolbarGroup = {
10
10
  */
11
11
  rank?: number;
12
12
  items: Array<FloatingToolbarItem<Command>>;
13
+ pluginName?: string;
13
14
  };
14
15
  /**
15
16
  * The selection toolbar is a floating toolbar that is displayed for
@@ -70,6 +70,6 @@ export type useSelectAndFocusReturnType = {
70
70
  setFocusedCategoryIndex: (index?: number) => void;
71
71
  setFocusOnSearch: () => void;
72
72
  };
73
- declare function useSelectAndFocusOnArrowNavigation(listSize: number, step: number, canFocusViewMore: boolean, isFocusSearch?: boolean): useSelectAndFocusReturnType;
73
+ declare function useSelectAndFocusOnArrowNavigation(listSize: number, step: number, canFocusViewMore: boolean, itemIsDisabled: (index: number) => boolean, isFocusSearch?: boolean): useSelectAndFocusReturnType;
74
74
  export declare const ensureSafeIndex: (index: number, listSize: number) => number;
75
75
  export default useSelectAndFocusOnArrowNavigation;
@@ -30,3 +30,9 @@ export declare const shouldSplitSelectedNodeOnNodeInsertion: ({ parentNodeType,
30
30
  * as we extract their text content.
31
31
  */
32
32
  export declare function contentAllowedInCodeBlock(state: EditorState): boolean;
33
+ /**
34
+ * Check if a fragment contains a particular node by iterating through all the nodes in the fragment.
35
+ * If the node type is found will stop looking and return true.
36
+ * If the node type is not found, it will return false.
37
+ */
38
+ export declare function fragmentContainsNodeType(fragment: Fragment, nodeType: NodeType): boolean;
@@ -169,6 +169,11 @@ export declare const toolbarInsertBlockMessages: {
169
169
  defaultMessage: string;
170
170
  description: string;
171
171
  };
172
+ columnsDescriptionAdvancedLayout: {
173
+ id: string;
174
+ defaultMessage: string;
175
+ description: string;
176
+ };
172
177
  status: {
173
178
  id: string;
174
179
  defaultMessage: string;
@@ -9,11 +9,21 @@ export declare const toolbarMessages: {
9
9
  defaultMessage: string;
10
10
  description: string;
11
11
  };
12
+ twoColumnsAdvancedLayout: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
12
17
  threeColumns: {
13
18
  id: string;
14
19
  defaultMessage: string;
15
20
  description: string;
16
21
  };
22
+ threeColumnsAdvancedLayout: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
17
27
  fourColumns: {
18
28
  id: string;
19
29
  defaultMessage: string;
@@ -10,6 +10,7 @@ export type SelectionToolbarGroup = {
10
10
  */
11
11
  rank?: number;
12
12
  items: Array<FloatingToolbarItem<Command>>;
13
+ pluginName?: string;
13
14
  };
14
15
  /**
15
16
  * The selection toolbar is a floating toolbar that is displayed for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "96.0.2",
3
+ "version": "96.1.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -152,8 +152,8 @@
152
152
  "@atlaskit/smart-user-picker": "^6.11.0",
153
153
  "@atlaskit/spinner": "^16.3.0",
154
154
  "@atlaskit/task-decision": "^17.11.0",
155
- "@atlaskit/textfield": "^6.6.0",
156
- "@atlaskit/tmp-editor-statsig": "^2.22.0",
155
+ "@atlaskit/textfield": "^6.7.0",
156
+ "@atlaskit/tmp-editor-statsig": "^2.23.0",
157
157
  "@atlaskit/tokens": "^2.4.0",
158
158
  "@atlaskit/tooltip": "^18.9.0",
159
159
  "@atlaskit/width-detector": "^4.3.0",
@@ -261,6 +261,9 @@
261
261
  "platform_editor_react18_extension_component_v2": {
262
262
  "type": "boolean"
263
263
  },
264
+ "platform_editor_is_disabled_state_element_browser": {
265
+ "type": "boolean"
266
+ },
264
267
  "platform-datasources-enable-two-way-sync": {
265
268
  "type": "boolean"
266
269
  },