@atlaskit/editor-common 122.11.1 → 123.0.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 (70) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/cjs/ai-messages/ai-suggestions.js +13 -8
  3. package/dist/cjs/extensibility/GeneratedContentReveal.compiled.css +4 -3
  4. package/dist/cjs/extensibility/GeneratedContentReveal.js +7 -22
  5. package/dist/cjs/extensions/buildMenuItem.js +1 -1
  6. package/dist/cjs/lists/flatten-list.js +1 -73
  7. package/dist/cjs/lists/index.js +0 -26
  8. package/dist/cjs/lists/node.js +1 -78
  9. package/dist/cjs/lists/replace-content.js +1 -9
  10. package/dist/cjs/lists/selection.js +2 -29
  11. package/dist/cjs/monitoring/error.js +1 -1
  12. package/dist/cjs/node-anchor/node-anchor-provider.js +1 -3
  13. package/dist/cjs/quick-insert/build-quick-insert-menu-model.js +6 -5
  14. package/dist/cjs/quick-insert/getQuickInsertProviderMenuItemKey.js +16 -3
  15. package/dist/cjs/quick-insert/registered-menu-model.js +14 -0
  16. package/dist/cjs/quick-insert/selectQuickInsertCategoryItems.js +27 -0
  17. package/dist/cjs/ui/DropList/index.js +1 -1
  18. package/dist/es2019/ai-messages/ai-suggestions.js +13 -8
  19. package/dist/es2019/extensibility/GeneratedContentReveal.compiled.css +4 -3
  20. package/dist/es2019/extensibility/GeneratedContentReveal.js +6 -18
  21. package/dist/es2019/extensions/buildMenuItem.js +1 -1
  22. package/dist/es2019/lists/flatten-list.js +1 -76
  23. package/dist/es2019/lists/index.js +2 -4
  24. package/dist/es2019/lists/node.js +0 -77
  25. package/dist/es2019/lists/replace-content.js +1 -3
  26. package/dist/es2019/lists/selection.js +1 -31
  27. package/dist/es2019/monitoring/error.js +1 -1
  28. package/dist/es2019/node-anchor/node-anchor-provider.js +1 -3
  29. package/dist/es2019/quick-insert/build-quick-insert-menu-model.js +6 -5
  30. package/dist/es2019/quick-insert/getQuickInsertProviderMenuItemKey.js +10 -1
  31. package/dist/es2019/quick-insert/registered-menu-model.js +2 -0
  32. package/dist/es2019/quick-insert/selectQuickInsertCategoryItems.js +19 -0
  33. package/dist/es2019/ui/DropList/index.js +1 -1
  34. package/dist/esm/ai-messages/ai-suggestions.js +13 -8
  35. package/dist/esm/extensibility/GeneratedContentReveal.compiled.css +4 -3
  36. package/dist/esm/extensibility/GeneratedContentReveal.js +7 -22
  37. package/dist/esm/extensions/buildMenuItem.js +1 -1
  38. package/dist/esm/lists/flatten-list.js +1 -71
  39. package/dist/esm/lists/index.js +2 -4
  40. package/dist/esm/lists/node.js +0 -77
  41. package/dist/esm/lists/replace-content.js +1 -3
  42. package/dist/esm/lists/selection.js +1 -28
  43. package/dist/esm/monitoring/error.js +1 -1
  44. package/dist/esm/node-anchor/node-anchor-provider.js +1 -3
  45. package/dist/esm/quick-insert/build-quick-insert-menu-model.js +6 -5
  46. package/dist/esm/quick-insert/getQuickInsertProviderMenuItemKey.js +15 -2
  47. package/dist/esm/quick-insert/registered-menu-model.js +2 -0
  48. package/dist/esm/quick-insert/selectQuickInsertCategoryItems.js +21 -0
  49. package/dist/esm/ui/DropList/index.js +1 -1
  50. package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
  51. package/dist/types/collab/agent-edit-chrome.d.ts +1 -0
  52. package/dist/types/lists/flatten-list.d.ts +0 -28
  53. package/dist/types/lists/index.d.ts +2 -4
  54. package/dist/types/lists/node.d.ts +0 -1
  55. package/dist/types/lists/replace-content.d.ts +1 -1
  56. package/dist/types/lists/selection.d.ts +1 -7
  57. package/dist/types/quick-insert/build-quick-insert-menu-model.d.ts +2 -1
  58. package/dist/types/quick-insert/getQuickInsertProviderMenuItemKey.d.ts +10 -1
  59. package/dist/types/quick-insert/registered-menu-model.d.ts +3 -0
  60. package/dist/types/quick-insert/selectQuickInsertCategoryItems.d.ts +7 -0
  61. package/package.json +5 -5
  62. package/dist/cjs/lists/indentation.js +0 -23
  63. package/dist/cjs/lists/wrapTaskListIntoListAbove.js +0 -30
  64. package/dist/es2019/lists/indentation.js +0 -18
  65. package/dist/es2019/lists/wrapTaskListIntoListAbove.js +0 -24
  66. package/dist/esm/lists/indentation.js +0 -17
  67. package/dist/esm/lists/wrapTaskListIntoListAbove.js +0 -24
  68. package/dist/types/lists/indentation.d.ts +0 -5
  69. package/dist/types/lists/wrapTaskListIntoListAbove.d.ts +0 -2
  70. package/lists/indentation/package.json +0 -10
@@ -24,15 +24,15 @@
24
24
  ._1vs61nu9:has(.extension-label:hover) .extension-icon{display:inline}
25
25
  ._26lx1tsb .extension-label:hover.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
26
26
  ._2z44kb7n:has(.extension-edit-toggle-container:hover) .extension-label{opacity:1}
27
+ ._4t3iidpf{height:0}
27
28
  ._54r11nu9:has(.extension-edit-toggle-container:hover) .extension-icon{display:inline}
28
29
  ._5sag15uc{animation-duration:var(--ds-duration-xlong,.4s)}
29
30
  ._9sz11bym iframe:not([data-native-embed-card-wrapper=true] iframe){animation-name:var(--ds-keyframe-fade-in,FadeIn0to100)}
30
31
  ._bcikkb7n:has(.extension-container:hover) .extension-label{opacity:1}
31
- ._c71lidpf{max-height:0}
32
32
  ._d1oeglyw:has(.extension-container:hover) .extension-label{box-shadow:none}
33
33
  ._decvtlke:has(.extension-edit-toggle-container:hover) .extension-label{cursor:pointer}
34
34
  ._gp9p1hrf iframe:not([data-native-embed-card-wrapper=true] iframe){animation-fill-mode:both}
35
- ._j7hq1umn{animation-name:ke4lc1x}
35
+ ._j7hq180b{animation-name:k1gqx0zb}
36
36
  ._jl0d1tsb:has(.extension-edit-toggle-container:hover) .extension-label.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
37
37
  ._kqswh2mm{position:relative}
38
38
  ._ks721tsb:has(.extension-container:hover) .extension-label.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
@@ -41,6 +41,7 @@
41
41
  ._mi5m1wug .extension-label:hover.always-hide-label{cursor:auto}
42
42
  ._okd3ysee:has(.extension-edit-toggle-container:hover) .extension-label{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
43
43
  ._pjh31hrf [data-native-embed-card-wrapper=true]{animation-fill-mode:both}
44
+ ._tw1z1t97{interpolate-size:allow-keywords}
44
45
  ._x3ro1j9a .extension-label:hover.with-bodied-macro-live-page-styles{background-color:var(--ds-background-input,#fff)}
45
46
  ._xajsynbm:has(.extension-label:hover) .extension-container{box-shadow:0 0 0 1px var(--ds-border-input,#8c8f97)}
46
47
  ._y7o7idpf:has(.extension-edit-toggle-container:hover) .extension-label.always-hide-label{opacity:0}
@@ -49,5 +50,5 @@
49
50
  ._1ql7tlke .extension-label:hover{cursor:pointer}
50
51
  ._1tmrkb7n .extension-label:hover{opacity:1}
51
52
  ._dmn9ysee .extension-label:hover{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
52
- @keyframes ke4lc1x{0%{max-height:0}to{max-height:var(--_1wl3sa9)}}
53
+ @keyframes k1gqx0zb{0%{height:0}to{height:auto}}
53
54
  @media (prefers-reduced-motion:reduce){._2hwzru3m{animation-duration:0s}._dxfxru3m [data-native-embed-card-wrapper=true]{animation-duration:0s}._log5ru3m iframe:not([data-native-embed-card-wrapper=true] iframe){animation-duration:0s}._1pz3ru3m [data-native-embed-card-wrapper=true]{animation-delay:0s}._9hrrru3m iframe:not([data-native-embed-card-wrapper=true] iframe){animation-delay:0s}}
@@ -12,8 +12,7 @@ import { useNativeEmbedSettled } from './useNativeEmbedSettled';
12
12
  * 1. `collapsed` — clipped to zero height and `inert`. The embed loads behind it, full size but
13
13
  * unseen, with its own loading overlay hidden.
14
14
  * 2. `useNativeEmbedSettled` calls back once the embed has finished loading.
15
- * 3. `revealing` — the measured height goes into `--extension-reveal-height` and the node animates
16
- * open (400ms).
15
+ * 3. `revealing` — the node animates open to its content height (400ms).
17
16
  * 4. The embed fades in (200ms), delayed so it follows the opening instead of overlapping it.
18
17
  * 5. `open` — on `animationend`, when the content first becomes visible, `inert` is dropped.
19
18
  *
@@ -31,22 +30,13 @@ var READY_TIMEOUT_MS = 30000;
31
30
 
32
31
  /** For when no `animationend` arrives. Must exceed the reveal. */
33
32
  var REVEAL_TIMEOUT_MS = 1000;
34
-
35
- /** Set inline from the measured content height just before the animation runs. */
36
- var REVEAL_HEIGHT_VARIABLE = '--extension-reveal-height';
37
33
  var relativeStyles = null;
38
34
 
39
35
  // Mirrors the default span's hover chrome in `ExtensionNodeWrapper`; keep the two in step.
40
36
  var hoverStyles = null;
41
-
42
- /**
43
- * Animates `max-height`, so the rendered height is `min(content, max-height)` and overshooting is
44
- * harmless — the measurement is taken before the embed has settled on its size. A measurement is
45
- * needed because the embed writes a definite inline `height` onto `.extension-container`.
46
- */
47
37
  var openHeight = null;
48
38
 
49
- // `display: block` because `overflow` and `max-height` do not apply to an inline span.
39
+ // `display: block` because `overflow` and `height` do not apply to an inline span.
50
40
  var clippedStyles = null;
51
41
 
52
42
  /**
@@ -79,19 +69,17 @@ export var GeneratedContentReveal = function GeneratedContentReveal(_ref) {
79
69
  setState = _useState4[1];
80
70
 
81
71
  // Only a collapsed node opens, so whichever of the readiness signal and the fail-safe timer
82
- // comes second changes nothing. The measurement is repeated harmlessly in that case.
72
+ // comes second changes nothing.
83
73
  var startRevealing = useCallback(function () {
84
- // The clipped wrapper's `scrollHeight` is the height its content wants.
85
- wrapperElement === null || wrapperElement === void 0 || wrapperElement.style.setProperty(REVEAL_HEIGHT_VARIABLE, "".concat(wrapperElement.scrollHeight, "px"));
86
74
  setState(function (current) {
87
75
  return current === 'collapsed' ? 'revealing' : current;
88
76
  });
89
- }, [wrapperElement]);
77
+ }, []);
90
78
 
91
79
  // Step 2 → 3.
92
80
  useNativeEmbedSettled(wrapperElement, startRevealing);
93
81
 
94
- // Set once the span exists; `startRevealing` only changes with it.
82
+ // One timer, set on mount, so the deadline never moves.
95
83
  useEffect(function () {
96
84
  var timer = setTimeout(startRevealing, READY_TIMEOUT_MS);
97
85
  return function () {
@@ -129,10 +117,7 @@ export var GeneratedContentReveal = function GeneratedContentReveal(_ref) {
129
117
  ref: setWrapperElement
130
118
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- the block controls and the SSR cleanup find the wrapper by `span.relative`
131
119
  ,
132
- className: ax(["_1tr2ynbm _xajsynbm _1tmrkb7n _bcikkb7n _2z44kb7n _dmn9ysee _1ghxysee _okd3ysee _1er3glyw _d1oeglyw _15k3glyw _1ql7tlke _1nuetlke _decvtlke _1fdfidpf _1pfgidpf _y7o7idpf _mi5m1wug _1si41wug _17sh1wug _x3ro1j9a _1i8c1j9a _1a2e1j9a _26lx1tsb _ks721tsb _jl0d1tsb _1qac1nu9 _54r11nu9 _1vs61nu9 _10pdkb7n _1kr5kb7n _10t9kb7n", showMacroInteractionDesignUpdates && "_kqswh2mm", state !== 'open' && "_1reo15vq _18m915vq _1e0c1ule", state === 'collapsed' && "_c71lidpf _114yglyw", state === 'revealing' && "", state === 'revealing' && "_j7hq1umn _5sag15uc _1pglindk _2hwzru3m", state !== 'collapsed' && "_10i01bym _9sz11bym _147ai9qs _lwlpi9qs _lbjpindk _17w9indk _1p7l15uc _1jbo15uc _pjh31hrf _gp9p1hrf _dxfxru3m _log5ru3m _1pz3ru3m _9hrrru3m", showMacroInteractionDesignUpdates ? 'relative' : undefined]),
133
- onAnimationEnd: onAnimationEnd,
134
- style: {
135
- "--_1wl3sa9": ix("var(".concat(REVEAL_HEIGHT_VARIABLE, ")"))
136
- }
120
+ className: ax(["_1tr2ynbm _xajsynbm _1tmrkb7n _bcikkb7n _2z44kb7n _dmn9ysee _1ghxysee _okd3ysee _1er3glyw _d1oeglyw _15k3glyw _1ql7tlke _1nuetlke _decvtlke _1fdfidpf _1pfgidpf _y7o7idpf _mi5m1wug _1si41wug _17sh1wug _x3ro1j9a _1i8c1j9a _1a2e1j9a _26lx1tsb _ks721tsb _jl0d1tsb _1qac1nu9 _54r11nu9 _1vs61nu9 _10pdkb7n _1kr5kb7n _10t9kb7n", showMacroInteractionDesignUpdates && "_kqswh2mm", state !== 'open' && "_1reo15vq _18m915vq _1e0c1ule", state === 'collapsed' && "_4t3iidpf _114yglyw", state === 'revealing' && "", state === 'revealing' && "_tw1z1t97 _j7hq180b _5sag15uc _1pglindk _2hwzru3m", state !== 'collapsed' && "_10i01bym _9sz11bym _147ai9qs _lwlpi9qs _lbjpindk _17w9indk _1p7l15uc _1jbo15uc _pjh31hrf _gp9p1hrf _dxfxru3m _log5ru3m _1pz3ru3m _9hrrru3m", showMacroInteractionDesignUpdates ? 'relative' : undefined]),
121
+ onAnimationEnd: onAnimationEnd
137
122
  }, children));
138
123
  };
@@ -12,7 +12,7 @@ export function buildMenuItem(manifest, extensionModule) {
12
12
  if (!node) {
13
13
  throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
14
14
  }
15
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, isExperimentEnabled('platform_editor_slash_app_category_analytics') ? {
15
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, isExperimentEnabled('platform_editor_slash_app_category_analytics') || isExperimentEnabled('platform_editor_slash_command') ? {
16
16
  app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
17
17
  key: manifest.key
18
18
  }
@@ -1,71 +1 @@
1
- /**
2
- * Type-specific predicates that vary between regular lists and task lists.
3
- */
4
-
5
- /**
6
- * Flattens a list-like PM structure (regular list or task list) into an
7
- * array of content-bearing items with computed depths.
8
- *
9
- * Uses `doc.nodesBetween` to walk the tree and delegates type-specific
10
- * decisions to the provided predicates. The core algorithm — selection
11
- * intersection, depth adjustment, index tracking — is shared.
12
- *
13
- * @private
14
- * @deprecated Cannot represent content placed between an item's sub-lists
15
- * (e.g. `li(p, ul, p, ul)`). Callers provide their own flatten that handles this.
16
- */
17
- export function flattenList(options, predicates) {
18
- var doc = options.doc,
19
- rootListStart = options.rootListStart,
20
- rootListEnd = options.rootListEnd,
21
- selectionFrom = options.selectionFrom,
22
- selectionTo = options.selectionTo,
23
- indentDelta = options.indentDelta,
24
- maxDepth = options.maxDepth;
25
- var isContentNode = predicates.isContentNode,
26
- getSelectionBounds = predicates.getSelectionBounds,
27
- getDepth = predicates.getDepth;
28
- var items = [];
29
- var startIndex = -1;
30
- var endIndex = -1;
31
- var exceedsMaxDepth = false;
32
- var rootDepth = doc.resolve(rootListStart).depth;
33
- doc.nodesBetween(rootListStart, rootListEnd, function (node, pos, parent) {
34
- if (!isContentNode(node, parent) || parent == null) {
35
- return true;
36
- }
37
- var _getSelectionBounds = getSelectionBounds(node, pos),
38
- start = _getSelectionBounds.start,
39
- end = _getSelectionBounds.end;
40
- var isSelected = selectionFrom === selectionTo ? selectionFrom >= start && selectionFrom <= end : start < selectionTo && end > selectionFrom;
41
- var resolvedDepth = doc.resolve(pos).depth;
42
- var depth = getDepth(resolvedDepth, rootDepth) + (isSelected ? indentDelta : 0);
43
- items.push({
44
- node: node,
45
- pos: pos,
46
- depth: depth,
47
- isSelected: isSelected,
48
- listType: parent.type.name,
49
- parentListAttrs: parent.attrs
50
- });
51
- if (isSelected) {
52
- var index = items.length - 1;
53
- if (startIndex === -1) {
54
- startIndex = index;
55
- }
56
- endIndex = index;
57
- if (maxDepth != null && depth >= maxDepth) {
58
- exceedsMaxDepth = true;
59
- }
60
- }
61
- return true;
62
- });
63
- if (items.length === 0 || startIndex === -1 || exceedsMaxDepth) {
64
- return null;
65
- }
66
- return {
67
- items: items,
68
- startIndex: startIndex,
69
- endIndex: endIndex
70
- };
71
- }
1
+ export {};
@@ -1,18 +1,16 @@
1
1
  // Disable no-re-export rule for entry point files
2
2
  /* eslint-disable @atlaskit/editor/no-re-export */
3
3
 
4
- export { getListItemAttributes, normalizeListItemsSelection } from './selection';
4
+ export { getListItemAttributes } from './selection';
5
5
  export { moveTargetIntoList } from './replace-content';
6
6
  export { JoinDirection } from './JoinDirection';
7
7
  export { isListNodeValidContent } from './isListNodeValidContent';
8
- export { joinSiblingLists, processNestedTaskListsInSameLevel } from './node';
8
+ export { joinSiblingLists } from './node';
9
9
  export { getCommonListAnalyticsAttributes } from './analytics';
10
10
  export { countListItemsInSelection } from './countListItemsInSelection';
11
- export { hasValidListIndentationLevel } from './indentation';
12
11
  export { restoreSelection, computeSelectionOffsets } from './restore-selection';
13
12
  export { buildReplacementFragment } from './build-replacement-fragment';
14
13
  export { narrowReplacementRange } from './narrow-replacement-range';
15
- export { flattenList } from './flatten-list';
16
14
  export { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForContainerAtPos, reconcileBlockMarkForParagraphAtPos, reconcileBlockMarkInRange } from './block-mark';
17
15
  export { isListNode, isListItemNode, isBulletList, isParagraphNode } from '../utils';
18
16
  export { messages } from './messages';
@@ -1,7 +1,6 @@
1
1
  import { isListItemNode, isListNode } from '../utils';
2
2
  import { isListNodeValidContent } from './isListNodeValidContent';
3
3
  import { JoinDirection } from './JoinDirection';
4
- import { wrapTaskListIntoListAbove } from './wrapTaskListIntoListAbove';
5
4
  export var joinSiblingLists = function joinSiblingLists(_ref) {
6
5
  var tr = _ref.tr,
7
6
  direction = _ref.direction,
@@ -75,82 +74,6 @@ export var joinSiblingLists = function joinSiblingLists(_ref) {
75
74
  return result;
76
75
  };
77
76
 
78
- /**
79
- * Returns the prosemirror position for the child at give index inside the parent node.
80
- * Example: Considering doc structure as below using the function
81
- * passing parent resolved position for li and index 2
82
- * would return starting position of taskList
83
- * DOC STRUCTURE:
84
- * ol()
85
- * ( li(
86
- * p('text'),
87
- * ul(content),
88
- * taskList(),
89
- * )
90
- * )
91
- * @param $from Starting resolved position for the parent node of the child we are looking for.
92
- * @param index Index of the child node we want the position for.
93
- * @returns
94
- */
95
- var findStartPositionOfChildWithIndex = function findStartPositionOfChildWithIndex($from, index) {
96
- var parent = $from.node();
97
- var currentPos = $from.pos + 1;
98
- for (var i = 0; i < index; i++) {
99
- currentPos += parent.child(i).nodeSize;
100
- }
101
- return currentPos;
102
- };
103
- var findGrandParentResolvedPos = function findGrandParentResolvedPos(tr, $from) {
104
- return $from.depth > 2 ? tr.doc.resolve($from.start($from.depth - 2)) : null;
105
- };
106
- var findNestedTaskListsIndexAtSameLevel = function findNestedTaskListsIndexAtSameLevel(tr, $from) {
107
- /*
108
- Currently our cursor would be inside a pargraph of a list of type numbered/bullet list,
109
- we need to find the grandparent of the cursor which is the list at same level of taskList.
110
- We can get the root list item(inside which various lists are being resolved before outdenting) by going one depth above that list.
111
- */
112
- var nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
113
- var rootListItem = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.node(nestedListResolvedPos.depth - 1);
114
- var nestedTaskListsIndexes = [];
115
- var rootListItemChildCount = (rootListItem === null || rootListItem === void 0 ? void 0 : rootListItem.childCount) || 0;
116
- // first child of list item is always paragraph (i = 0) so we start from 1
117
- for (var i = 1; i < rootListItemChildCount; i++) {
118
- if ((rootListItem === null || rootListItem === void 0 ? void 0 : rootListItem.child(i).type.name) === 'taskList') {
119
- nestedTaskListsIndexes.push(i);
120
- }
121
- }
122
- return nestedTaskListsIndexes;
123
- };
124
-
125
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
126
- export var processNestedTaskListsInSameLevel = function processNestedTaskListsInSameLevel(tr) {
127
- var $from = tr.selection.$from;
128
- var nestedTaskListIndexes = findNestedTaskListsIndexAtSameLevel(tr, $from);
129
- if (nestedTaskListIndexes.length === 0) {
130
- return;
131
- }
132
- var nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
133
- var rootListItemStart = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.start(nestedListResolvedPos.depth - 1);
134
-
135
- /* We need not wrap the taskList present above other lists since it doesn't affect the flow. */
136
- var nestedTaskListIndexesToWrap = nestedTaskListIndexes.filter(function (index) {
137
- return index > 1;
138
- });
139
-
140
- /*
141
- Wraps the taskLists present at each index mentioned in the nestedTaskListIndexesToWrap to the list above it.
142
- After each wrap the indexes changes since two lists are being merged into one,
143
- so we keep track of it and use it to access actual calculated taskList indexes.
144
- */
145
- if (rootListItemStart) {
146
- var taskListsFixedNested = 0;
147
- nestedTaskListIndexesToWrap.forEach(function (index) {
148
- wrapTaskListIntoListAbove(tr, findStartPositionOfChildWithIndex(tr.doc.resolve(rootListItemStart), index - taskListsFixedNested), findStartPositionOfChildWithIndex(tr.doc.resolve(rootListItemStart), index - 1 - taskListsFixedNested));
149
- taskListsFixedNested++;
150
- });
151
- }
152
- return;
153
- };
154
77
  // eslint-disable-next-line @atlaskit/editor/no-re-export
155
78
  export { isListNodeValidContent } from './isListNodeValidContent';
156
79
  // eslint-disable-next-line @atlaskit/editor/no-re-export
@@ -14,6 +14,4 @@ export var moveTargetIntoList = function moveTargetIntoList(_ref) {
14
14
  }
15
15
  var step = new ReplaceAroundStep(from, to, gapFrom, gapTo, $target.doc.slice(insertPosition, $target.pos), 0, true);
16
16
  return step;
17
- };
18
- // eslint-disable-next-line @atlaskit/editor/no-re-export
19
- export { wrapTaskListIntoListAbove } from './wrapTaskListIntoListAbove';
17
+ };
@@ -1,4 +1,3 @@
1
- import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
1
  import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
3
2
  import { isListItemNode } from '../utils';
4
3
  import { numberNestedLists } from './numberNestedLists';
@@ -14,32 +13,6 @@ export var getListItemAttributes = function getListItemAttributes($pos) {
14
13
  itemIndex: itemIndex
15
14
  };
16
15
  };
17
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
18
- export var normalizeListItemsSelection = function normalizeListItemsSelection(_ref) {
19
- var selection = _ref.selection,
20
- doc = _ref.doc;
21
- if (selection.empty) {
22
- return selection;
23
- }
24
- var $from = selection.$from,
25
- $to = selection.$to;
26
- if (selection instanceof NodeSelection) {
27
- var _head = resolvePositionToStartOfListItem($from);
28
- return new TextSelection(_head, _head);
29
- }
30
- var head = resolvePositionToStartOfListItem($from);
31
- var anchor = resolvePositionToEndOfListItem($to);
32
- return new TextSelection(anchor, head);
33
- };
34
- var resolvePositionToStartOfListItem = function resolvePositionToStartOfListItem($pos) {
35
- var fromRange = $pos.blockRange($pos, isListItemNode);
36
- var fromPosition = fromRange && $pos.textOffset === 0 && fromRange.end - 1 === $pos.pos ? Selection.near($pos.doc.resolve(fromRange.end + 1), 1).$from : $pos;
37
- return fromPosition;
38
- };
39
- var resolvePositionToEndOfListItem = function resolvePositionToEndOfListItem($pos) {
40
- var toRange = $pos.blockRange($pos, isListItemNode);
41
- var toPosition = toRange && $pos.textOffset === 0 && toRange.start + 1 === $pos.pos ? Selection.near($pos.doc.resolve(toRange.start - 1), -1).$to : $pos;
42
- return toPosition;
43
- };
16
+
44
17
  // eslint-disable-next-line @atlaskit/editor/no-re-export
45
18
  export { numberNestedLists } from './numberNestedLists';
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "122.11.0";
22
+ var packageVersion = "122.12.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -1,10 +1,8 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import { fg } from '@atlaskit/platform-feature-flags/fg';
5
4
  import { isEmptyDocument } from '../utils';
6
5
  import { DynamicBitArray } from './dynamic-bit-array';
7
- import { shouldEnableLimitedModeForDocument } from './should-enable-limited-mode';
8
6
 
9
7
  // The slice of `@atlaskit/editor-plugin-limited-mode`'s state read below. Declared
10
8
  // structurally because `editor-common` must not depend on a plugin package.
@@ -117,7 +115,7 @@ var nodeIdProviderMap = new WeakMap();
117
115
  */
118
116
  var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
119
117
  var _limitedModePluginKey, _limitedModePluginKey2;
120
- return fg('platform_editor_fix_limited_mode_leaking') ? (_limitedModePluginKey = (_limitedModePluginKey2 = limitedModePluginKey.getState(editorView.state)) === null || _limitedModePluginKey2 === void 0 ? void 0 : _limitedModePluginKey2.documentSizeBreachesThreshold) !== null && _limitedModePluginKey !== void 0 ? _limitedModePluginKey : false : shouldEnableLimitedModeForDocument(editorView.state.doc);
118
+ return (_limitedModePluginKey = (_limitedModePluginKey2 = limitedModePluginKey.getState(editorView.state)) === null || _limitedModePluginKey2 === void 0 ? void 0 : _limitedModePluginKey2.documentSizeBreachesThreshold) !== null && _limitedModePluginKey !== void 0 ? _limitedModePluginKey : false;
121
119
  };
122
120
 
123
121
  // Get the NodeIdProvider for a specific EditorView instance.
@@ -5,7 +5,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
5
5
  import { isMenuFooterSectionKey } from '../type-ahead/isMenuFooterSectionKey';
6
6
  import { isSectionOverflowItemKey } from '../type-ahead/isSectionOverflowItemKey';
7
7
  import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
8
- export var buildQuickInsertMenuModel = function buildQuickInsertMenuModel(components, rootComponent, sectionOverflowLimit, surfaceContext) {
8
+ export var buildQuickInsertMenuModel = function buildQuickInsertMenuModel(components, rootComponent, selectCategoryItems, surfaceContext) {
9
9
  var _resolveSurface = resolveSurface(components, rootComponent),
10
10
  root = _resolveSurface.root,
11
11
  childrenMap = _resolveSurface.childrenMap,
@@ -49,11 +49,12 @@ export var buildQuickInsertMenuModel = function buildQuickInsertMenuModel(compon
49
49
  if (items.length === 0) {
50
50
  continue;
51
51
  }
52
- if (sectionOverflowLimit !== undefined && viewMoreItem !== undefined && items.length > sectionOverflowLimit) {
53
- sections.push([section].concat(_toConsumableArray(items.slice(0, sectionOverflowLimit)), [viewMoreItem]));
54
- continue;
52
+ var selectedItems = viewMoreItem !== undefined && selectCategoryItems !== undefined ? selectCategoryItems(items) : items;
53
+ if (selectedItems.length < items.length && viewMoreItem !== undefined) {
54
+ sections.push([section].concat(_toConsumableArray(selectedItems), [viewMoreItem]));
55
+ } else {
56
+ sections.push([section].concat(_toConsumableArray(selectedItems)));
55
57
  }
56
- sections.push([section].concat(_toConsumableArray(items)));
57
58
  }
58
59
  } catch (err) {
59
60
  _iterator.e(err);
@@ -1,3 +1,16 @@
1
- export var getQuickInsertProviderMenuItemKey = function getQuickInsertProviderMenuItemKey(key) {
2
- return "quick-insert-provider-".concat(key);
1
+ var QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX = 'quick-insert-provider-';
2
+ var ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX = 'quick-insert-ecosystem';
3
+ export var getQuickInsertProviderMenuItemKey = function getQuickInsertProviderMenuItemKey(key, app) {
4
+ return (app === null || app === void 0 ? void 0 : app.source) === 'ecosystem' ? "".concat(ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX, "-").concat(key) : "".concat(QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX).concat(key);
5
+ };
6
+ var isEcosystemQuickInsertProviderMenuItemKey = function isEcosystemQuickInsertProviderMenuItemKey(key) {
7
+ return key.startsWith(ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX);
8
+ };
9
+ var normalizeQuickInsertProviderMenuItemKey = function normalizeQuickInsertProviderMenuItemKey(key) {
10
+ return isEcosystemQuickInsertProviderMenuItemKey(key) ? "".concat(QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX).concat(key.slice("".concat(ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX, "-").length)) : key;
11
+ };
12
+ export var quickInsertProviderMenuItemKey = {
13
+ get: getQuickInsertProviderMenuItemKey,
14
+ isEcosystem: isEcosystemQuickInsertProviderMenuItemKey,
15
+ normalize: normalizeQuickInsertProviderMenuItemKey
3
16
  };
@@ -1,3 +1,5 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
2
  export { buildQuickInsertMenuModel } from './build-quick-insert-menu-model';
3
+ export { quickInsertProviderMenuItemKey } from './getQuickInsertProviderMenuItemKey';
4
+ export { selectQuickInsertCategoryItems } from './selectQuickInsertCategoryItems';
3
5
  export { getMatchingQuickInsertComponents } from './get-matching-quick-insert-components';
@@ -0,0 +1,21 @@
1
+ import { quickInsertProviderMenuItemKey } from './getQuickInsertProviderMenuItemKey';
2
+ var DEFAULT_ITEM_LIMIT = 30;
3
+ var ECOSYSTEM_ITEM_LIMIT = 10;
4
+ var isEcosystemQuickInsertItem = function isEcosystemQuickInsertItem(item) {
5
+ return quickInsertProviderMenuItemKey.isEcosystem(item.key);
6
+ };
7
+
8
+ /**
9
+ * Keeps the initial native and ecosystem results while ensuring ecosystem registrations
10
+ * remain discoverable beyond the default category item limit.
11
+ */
12
+ export var selectQuickInsertCategoryItems = function selectQuickInsertCategoryItems(items) {
13
+ var ecosystemItemCount = 0;
14
+ return items.filter(function (item, index) {
15
+ var isEcosystemItem = isEcosystemQuickInsertItem(item);
16
+ if (isEcosystemItem) {
17
+ ecosystemItemCount++;
18
+ }
19
+ return index < DEFAULT_ITEM_LIMIT || isEcosystemItem && ecosystemItemCount <= ECOSYSTEM_ITEM_LIMIT;
20
+ });
21
+ };
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags/fg';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "122.11.0";
24
+ var packageVersion = "122.12.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -148,6 +148,11 @@ export declare const aiSuggestionsMessages: {
148
148
  description: string;
149
149
  id: string;
150
150
  };
151
+ cardSourceAppsTooltip: {
152
+ defaultMessage: string;
153
+ description: string;
154
+ id: string;
155
+ };
151
156
  cardSourcesButtonLabel: {
152
157
  defaultMessage: string;
153
158
  description: string;
@@ -30,6 +30,7 @@ export type AgentEditChromeData = {
30
30
  highlightBackgroundColor?: string;
31
31
  /** Runtime CSS color value. Consumers should pass an ADS token value. */
32
32
  highlightBorderColor?: string;
33
+ highlightTextColor?: string;
33
34
  ranges: AgentEditChromeRange[];
34
35
  /**
35
36
  * Which badge treatment the telepointer renders. Mirrors `TelepointerAgentKind` from
@@ -16,36 +16,8 @@ export interface FlattenListOptions {
16
16
  selectionFrom: number;
17
17
  selectionTo: number;
18
18
  }
19
- /**
20
- * Type-specific predicates that vary between regular lists and task lists.
21
- */
22
- interface FlattenListPredicates {
23
- /** Computes the nesting depth for a node given its resolved depth and the root's depth. */
24
- getDepth: (resolvedDepth: number, rootDepth: number) => number;
25
- /** Returns the selection bounds for an item, used to check selection intersection. */
26
- getSelectionBounds: (node: PMNode, pos: number) => {
27
- end: number;
28
- start: number;
29
- };
30
- /** Returns true if `node` is a content-bearing item to include in the flattened output. */
31
- isContentNode: (node: PMNode, parent: PMNode | null) => boolean;
32
- }
33
19
  export interface FlattenListResult {
34
20
  endIndex: number;
35
21
  items: FlattenedItem[];
36
22
  startIndex: number;
37
23
  }
38
- /**
39
- * Flattens a list-like PM structure (regular list or task list) into an
40
- * array of content-bearing items with computed depths.
41
- *
42
- * Uses `doc.nodesBetween` to walk the tree and delegates type-specific
43
- * decisions to the provided predicates. The core algorithm — selection
44
- * intersection, depth adjustment, index tracking — is shared.
45
- *
46
- * @private
47
- * @deprecated Cannot represent content placed between an item's sub-lists
48
- * (e.g. `li(p, ul, p, ul)`). Callers provide their own flatten that handles this.
49
- */
50
- export declare function flattenList(options: FlattenListOptions, predicates: FlattenListPredicates): FlattenListResult | null;
51
- export {};
@@ -1,18 +1,16 @@
1
- export { getListItemAttributes, normalizeListItemsSelection } from './selection';
1
+ export { getListItemAttributes } from './selection';
2
2
  export { moveTargetIntoList } from './replace-content';
3
3
  export { JoinDirection } from './JoinDirection';
4
4
  export { isListNodeValidContent } from './isListNodeValidContent';
5
- export { joinSiblingLists, processNestedTaskListsInSameLevel } from './node';
5
+ export { joinSiblingLists } from './node';
6
6
  export { getCommonListAnalyticsAttributes } from './analytics';
7
7
  export { countListItemsInSelection } from './countListItemsInSelection';
8
- export { hasValidListIndentationLevel } from './indentation';
9
8
  export { restoreSelection, computeSelectionOffsets } from './restore-selection';
10
9
  export { buildReplacementFragment } from './build-replacement-fragment';
11
10
  export type { BuildResult } from './build-replacement-fragment';
12
11
  export { narrowReplacementRange } from './narrow-replacement-range';
13
12
  export type { NarrowedReplacement } from './narrow-replacement-range';
14
13
  export type { FlattenedItem } from './flatten-list';
15
- export { flattenList } from './flatten-list';
16
14
  export type { FlattenListOptions, FlattenListResult } from './flatten-list';
17
15
  export { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs, reconcileBlockMarkForContainerAtPos, reconcileBlockMarkForParagraphAtPos, reconcileBlockMarkInRange, } from './block-mark';
18
16
  export { isListNode, isListItemNode, isBulletList, isParagraphNode } from '../utils';
@@ -11,6 +11,5 @@ type ListsJoined = {
11
11
  orderedList: number;
12
12
  };
13
13
  export declare const joinSiblingLists: ({ tr, direction, forceListType, }: JoinSiblingListsProps) => ListsJoined;
14
- export declare const processNestedTaskListsInSameLevel: (tr: Transaction) => void;
15
14
  export { isListNodeValidContent } from './isListNodeValidContent';
16
15
  export { JoinDirection } from './JoinDirection';
@@ -5,4 +5,4 @@ type Params = {
5
5
  insertPosition: number;
6
6
  };
7
7
  export declare const moveTargetIntoList: ({ insertPosition, $target }: Params) => Step;
8
- export { wrapTaskListIntoListAbove } from './wrapTaskListIntoListAbove';
8
+ export {};
@@ -1,12 +1,6 @@
1
- import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import { Selection } from '@atlaskit/editor-prosemirror/state';
1
+ import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
2
  export declare const getListItemAttributes: ($pos: ResolvedPos) => {
4
3
  indentLevel: number;
5
4
  itemIndex: number;
6
5
  };
7
- type NormalizeListItemsSelection = (props: {
8
- doc: PMNode;
9
- selection: Selection;
10
- }) => Selection;
11
- export declare const normalizeListItemsSelection: NormalizeListItemsSelection;
12
6
  export { numberNestedLists } from './numberNestedLists';
@@ -1,9 +1,10 @@
1
1
  import type { SurfaceIdentifier } from '@atlaskit/editor-ui-control-model/surface-renderer/types';
2
2
  import type { RegisterComponent, RegisterMenuItem, RegisterMenuSection, SurfaceContext } from '@atlaskit/editor-ui-control-model/types';
3
+ import type { QuickInsertCategoryItemSelectionPolicy } from './selectQuickInsertCategoryItems';
3
4
  export type QuickInsertMenuSection = [RegisterMenuSection, ...RegisterMenuItem[]];
4
5
  export type QuickInsertMenuModel = {
5
6
  footer: RegisterMenuItem | undefined;
6
7
  root: RegisterComponent | undefined;
7
8
  sections: QuickInsertMenuSection[];
8
9
  };
9
- export declare const buildQuickInsertMenuModel: (components: RegisterComponent[], rootComponent: SurfaceIdentifier, sectionOverflowLimit?: number, surfaceContext?: SurfaceContext) => QuickInsertMenuModel;
10
+ export declare const buildQuickInsertMenuModel: (components: RegisterComponent[], rootComponent: SurfaceIdentifier, selectCategoryItems?: QuickInsertCategoryItemSelectionPolicy, surfaceContext?: SurfaceContext) => QuickInsertMenuModel;
@@ -1 +1,10 @@
1
- export declare const getQuickInsertProviderMenuItemKey: (key: string) => string;
1
+ type AppProvenance = {
2
+ source?: string;
3
+ } | undefined;
4
+ export declare const getQuickInsertProviderMenuItemKey: (key: string, app?: AppProvenance) => string;
5
+ export declare const quickInsertProviderMenuItemKey: {
6
+ get: (key: string, app?: AppProvenance) => string;
7
+ isEcosystem: (key: string) => boolean;
8
+ normalize: (key: string) => string;
9
+ };
10
+ export {};
@@ -1,3 +1,6 @@
1
1
  export { buildQuickInsertMenuModel } from './build-quick-insert-menu-model';
2
+ export { quickInsertProviderMenuItemKey } from './getQuickInsertProviderMenuItemKey';
3
+ export { selectQuickInsertCategoryItems } from './selectQuickInsertCategoryItems';
2
4
  export { getMatchingQuickInsertComponents } from './get-matching-quick-insert-components';
3
5
  export type { QuickInsertMenuModel, QuickInsertMenuSection } from './build-quick-insert-menu-model';
6
+ export type { QuickInsertCategoryItemSelectionPolicy } from './selectQuickInsertCategoryItems';
@@ -0,0 +1,7 @@
1
+ import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
2
+ export type QuickInsertCategoryItemSelectionPolicy = (items: RegisterMenuItem[]) => RegisterMenuItem[];
3
+ /**
4
+ * Keeps the initial native and ecosystem results while ensuring ecosystem registrations
5
+ * remain discoverable beyond the default category item limit.
6
+ */
7
+ export declare const selectQuickInsertCategoryItems: QuickInsertCategoryItemSelectionPolicy;