@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
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.selectQuickInsertCategoryItems = void 0;
7
+ var _getQuickInsertProviderMenuItemKey = require("./getQuickInsertProviderMenuItemKey");
8
+ var DEFAULT_ITEM_LIMIT = 30;
9
+ var ECOSYSTEM_ITEM_LIMIT = 10;
10
+ var isEcosystemQuickInsertItem = function isEcosystemQuickInsertItem(item) {
11
+ return _getQuickInsertProviderMenuItemKey.quickInsertProviderMenuItemKey.isEcosystem(item.key);
12
+ };
13
+
14
+ /**
15
+ * Keeps the initial native and ecosystem results while ensuring ecosystem registrations
16
+ * remain discoverable beyond the default category item limit.
17
+ */
18
+ var selectQuickInsertCategoryItems = exports.selectQuickInsertCategoryItems = function selectQuickInsertCategoryItems(items) {
19
+ var ecosystemItemCount = 0;
20
+ return items.filter(function (item, index) {
21
+ var isEcosystemItem = isEcosystemQuickInsertItem(item);
22
+ if (isEcosystemItem) {
23
+ ecosystemItemCount++;
24
+ }
25
+ return index < DEFAULT_ITEM_LIMIT || isEcosystemItem && ecosystemItemCount <= ECOSYSTEM_ITEM_LIMIT;
26
+ });
27
+ };
@@ -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 = "122.11.0";
27
+ var packageVersion = "122.12.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -116,13 +116,13 @@ export const aiSuggestionsMessages = defineMessages({
116
116
  description: 'Label for the suggestions section in the AI suggestions staging area'
117
117
  },
118
118
  cardCloseButtonLabel: {
119
- id: 'fabric.editor.ai.suggestions.card.closeButtonLabel.non-final',
119
+ id: 'fabric.editor.ai.suggestions.card.closeSuggestionButtonLabel.non-final',
120
120
  defaultMessage: 'Close suggestion',
121
121
  description: 'Label and tooltip for the close button on the AI suggestions card'
122
122
  },
123
123
  cardShowSidebarButtonLabel: {
124
- id: 'fabric.editor.ai.suggestions.card.showSidebarButtonLabel.non-final',
125
- defaultMessage: 'Show all suggestions',
124
+ id: 'fabric.editor.ai.suggestions.card.showSuggestionsButtonLabel.non-final',
125
+ defaultMessage: 'Show suggestions',
126
126
  description: 'Label and tooltip for the button on the AI suggestions card that opens the suggestions sidebar'
127
127
  },
128
128
  cardPreviousSuggestionButtonLabel: {
@@ -190,18 +190,23 @@ export const aiSuggestionsMessages = defineMessages({
190
190
  defaultMessage: 'Source apps',
191
191
  description: 'Accessible name for the stack of app logos showing which apps an AI suggestion drew on'
192
192
  },
193
+ cardSourceAppsTooltip: {
194
+ id: 'fabric.editor.ai.suggestions.card.sourceAppsTooltip.non-final',
195
+ defaultMessage: 'Sources from {apps}',
196
+ description: 'Tooltip and accessible name for the stack of product logos showing which apps an AI suggestion drew on. {apps} is a localized list of product names, such as “Confluence and Jira”.'
197
+ },
193
198
  cardSourcesButtonLabel: {
194
199
  id: 'fabric.editor.ai.suggestions.card.sourcesButtonLabel.non-final',
195
200
  defaultMessage: 'Sources',
196
201
  description: 'Label for the sources toggle button on the AI suggestions card'
197
202
  },
198
203
  cardSourcesHideButtonLabel: {
199
- id: 'fabric.editor.ai.suggestions.card.sourcesHideButtonLabel.non-final',
204
+ id: 'fabric.editor.ai.suggestions.card.hideReasoningButtonLabel.non-final',
200
205
  defaultMessage: 'Hide reasoning',
201
206
  description: 'Label for the sources toggle button when sources are expanded'
202
207
  },
203
208
  cardSourcesShowButtonLabel: {
204
- id: 'fabric.editor.ai.suggestions.card.sourcesShowButtonLabel.non-final',
209
+ id: 'fabric.editor.ai.suggestions.card.showReasoningButtonLabel.non-final',
205
210
  defaultMessage: 'Show reasoning',
206
211
  description: 'Label for the sources toggle button when sources are collapsed'
207
212
  },
@@ -241,7 +246,7 @@ export const aiSuggestionsMessages = defineMessages({
241
246
  description: 'Label for the dismiss button on the AI suggestions card'
242
247
  },
243
248
  cardMoreOptionsButtonLabel: {
244
- id: 'fabric.editor.ai.suggestions.card.moreOptionsButtonLabel.non-final',
249
+ id: 'fabric.editor.ai.suggestions.card.moreActionsButtonLabel.non-final',
245
250
  defaultMessage: 'More actions',
246
251
  description: 'Label and tooltip for the overflow actions button on the AI suggestions card'
247
252
  },
@@ -291,12 +296,12 @@ export const aiSuggestionsMessages = defineMessages({
291
296
  description: 'Accessible label for the stop button displayed while the AI is thinking. When clicked, it cancels the ongoing action.'
292
297
  },
293
298
  thinkingReviewingContent: {
294
- id: 'fabric.editor.ai.suggestions.thinking.reviewingContent.non-final',
299
+ id: 'fabric.editor.ai.suggestions.thinking.rovoReviewingPage.non-final',
295
300
  defaultMessage: 'Rovo is reviewing your page',
296
301
  description: 'First loading message on the AI suggestions thinking bar, shown when the name of the reviewing agent is unknown'
297
302
  },
298
303
  thinkingReviewingContentWithAgent: {
299
- id: 'fabric.editor.ai.suggestions.thinking.reviewingContentWithAgent.non-final',
304
+ id: 'fabric.editor.ai.suggestions.thinking.agentAnalyzing.non-final',
300
305
  defaultMessage: '{agentName} is analyzing',
301
306
  description: 'First loading message on the AI suggestions thinking bar. The {agentName} placeholder is replaced with the reviewing agent name (for example "Content Reviewer"). Shown for a few seconds before the remaining rotating statuses.'
302
307
  },
@@ -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
- ._j7hq1k3l{animation-name:k1legk7d}
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 k1legk7d{0%{max-height:0}to{max-height:var(--extension-reveal-height)}}
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}}
@@ -11,8 +11,7 @@ import { useNativeEmbedSettled } from './useNativeEmbedSettled';
11
11
  * 1. `collapsed` — clipped to zero height and `inert`. The embed loads behind it, full size but
12
12
  * unseen, with its own loading overlay hidden.
13
13
  * 2. `useNativeEmbedSettled` calls back once the embed has finished loading.
14
- * 3. `revealing` — the measured height goes into `--extension-reveal-height` and the node animates
15
- * open (400ms).
14
+ * 3. `revealing` — the node animates open to its content height (400ms).
16
15
  * 4. The embed fades in (200ms), delayed so it follows the opening instead of overlapping it.
17
16
  * 5. `open` — on `animationend`, when the content first becomes visible, `inert` is dropped.
18
17
  *
@@ -30,22 +29,13 @@ const READY_TIMEOUT_MS = 30_000;
30
29
 
31
30
  /** For when no `animationend` arrives. Must exceed the reveal. */
32
31
  const REVEAL_TIMEOUT_MS = 1000;
33
-
34
- /** Set inline from the measured content height just before the animation runs. */
35
- const REVEAL_HEIGHT_VARIABLE = '--extension-reveal-height';
36
32
  const relativeStyles = null;
37
33
 
38
34
  // Mirrors the default span's hover chrome in `ExtensionNodeWrapper`; keep the two in step.
39
35
  const hoverStyles = null;
40
-
41
- /**
42
- * Animates `max-height`, so the rendered height is `min(content, max-height)` and overshooting is
43
- * harmless — the measurement is taken before the embed has settled on its size. A measurement is
44
- * needed because the embed writes a definite inline `height` onto `.extension-container`.
45
- */
46
36
  const openHeight = null;
47
37
 
48
- // `display: block` because `overflow` and `max-height` do not apply to an inline span.
38
+ // `display: block` because `overflow` and `height` do not apply to an inline span.
49
39
  const clippedStyles = null;
50
40
 
51
41
  /**
@@ -73,17 +63,15 @@ export const GeneratedContentReveal = ({
73
63
  const [state, setState] = useState('collapsed');
74
64
 
75
65
  // Only a collapsed node opens, so whichever of the readiness signal and the fail-safe timer
76
- // comes second changes nothing. The measurement is repeated harmlessly in that case.
66
+ // comes second changes nothing.
77
67
  const startRevealing = useCallback(() => {
78
- // The clipped wrapper's `scrollHeight` is the height its content wants.
79
- wrapperElement === null || wrapperElement === void 0 ? void 0 : wrapperElement.style.setProperty(REVEAL_HEIGHT_VARIABLE, `${wrapperElement.scrollHeight}px`);
80
68
  setState(current => current === 'collapsed' ? 'revealing' : current);
81
- }, [wrapperElement]);
69
+ }, []);
82
70
 
83
71
  // Step 2 → 3.
84
72
  useNativeEmbedSettled(wrapperElement, startRevealing);
85
73
 
86
- // Set once the span exists; `startRevealing` only changes with it.
74
+ // One timer, set on mount, so the deadline never moves.
87
75
  useEffect(() => {
88
76
  const timer = setTimeout(startRevealing, READY_TIMEOUT_MS);
89
77
  return () => clearTimeout(timer);
@@ -115,7 +103,7 @@ export const GeneratedContentReveal = ({
115
103
  ref: setWrapperElement
116
104
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- the block controls and the SSR cleanup find the wrapper by `span.relative`
117
105
  ,
118
- 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' && "_j7hq1k3l _5sag15uc _1pglindk _2hwzru3m", state !== 'collapsed' && "_10i01bym _9sz11bym _147ai9qs _lwlpi9qs _lbjpindk _17w9indk _1p7l15uc _1jbo15uc _pjh31hrf _gp9p1hrf _dxfxru3m _log5ru3m _1pz3ru3m _9hrrru3m", showMacroInteractionDesignUpdates ? 'relative' : undefined]),
106
+ 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]),
119
107
  onAnimationEnd: onAnimationEnd
120
108
  }, children));
121
109
  };
@@ -10,7 +10,7 @@ export function buildMenuItem(manifest, extensionModule) {
10
10
  throw new Error(`Couldn't find any action for ${title} (${key})`);
11
11
  }
12
12
  return {
13
- ...(isExperimentEnabled('platform_editor_slash_app_category_analytics') ? {
13
+ ...(isExperimentEnabled('platform_editor_slash_app_category_analytics') || isExperimentEnabled('platform_editor_slash_command') ? {
14
14
  app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
15
15
  key: manifest.key
16
16
  }
@@ -1,76 +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
- const {
19
- doc,
20
- rootListStart,
21
- rootListEnd,
22
- selectionFrom,
23
- selectionTo,
24
- indentDelta,
25
- maxDepth
26
- } = options;
27
- const {
28
- isContentNode,
29
- getSelectionBounds,
30
- getDepth
31
- } = predicates;
32
- const items = [];
33
- let startIndex = -1;
34
- let endIndex = -1;
35
- let exceedsMaxDepth = false;
36
- const rootDepth = doc.resolve(rootListStart).depth;
37
- doc.nodesBetween(rootListStart, rootListEnd, (node, pos, parent) => {
38
- if (!isContentNode(node, parent) || parent == null) {
39
- return true;
40
- }
41
- const {
42
- start,
43
- end
44
- } = getSelectionBounds(node, pos);
45
- const isSelected = selectionFrom === selectionTo ? selectionFrom >= start && selectionFrom <= end : start < selectionTo && end > selectionFrom;
46
- const resolvedDepth = doc.resolve(pos).depth;
47
- const depth = getDepth(resolvedDepth, rootDepth) + (isSelected ? indentDelta : 0);
48
- items.push({
49
- node,
50
- pos,
51
- depth,
52
- isSelected,
53
- listType: parent.type.name,
54
- parentListAttrs: parent.attrs
55
- });
56
- if (isSelected) {
57
- const index = items.length - 1;
58
- if (startIndex === -1) {
59
- startIndex = index;
60
- }
61
- endIndex = index;
62
- if (maxDepth != null && depth >= maxDepth) {
63
- exceedsMaxDepth = true;
64
- }
65
- }
66
- return true;
67
- });
68
- if (items.length === 0 || startIndex === -1 || exceedsMaxDepth) {
69
- return null;
70
- }
71
- return {
72
- items,
73
- startIndex,
74
- endIndex
75
- };
76
- }
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 const joinSiblingLists = ({
6
5
  tr,
7
6
  direction,
@@ -83,82 +82,6 @@ export const joinSiblingLists = ({
83
82
  return result;
84
83
  };
85
84
 
86
- /**
87
- * Returns the prosemirror position for the child at give index inside the parent node.
88
- * Example: Considering doc structure as below using the function
89
- * passing parent resolved position for li and index 2
90
- * would return starting position of taskList
91
- * DOC STRUCTURE:
92
- * ol()
93
- * ( li(
94
- * p('text'),
95
- * ul(content),
96
- * taskList(),
97
- * )
98
- * )
99
- * @param $from Starting resolved position for the parent node of the child we are looking for.
100
- * @param index Index of the child node we want the position for.
101
- * @returns
102
- */
103
- const findStartPositionOfChildWithIndex = ($from, index) => {
104
- const parent = $from.node();
105
- let currentPos = $from.pos + 1;
106
- for (let i = 0; i < index; i++) {
107
- currentPos += parent.child(i).nodeSize;
108
- }
109
- return currentPos;
110
- };
111
- const findGrandParentResolvedPos = (tr, $from) => {
112
- return $from.depth > 2 ? tr.doc.resolve($from.start($from.depth - 2)) : null;
113
- };
114
- const findNestedTaskListsIndexAtSameLevel = (tr, $from) => {
115
- /*
116
- Currently our cursor would be inside a pargraph of a list of type numbered/bullet list,
117
- we need to find the grandparent of the cursor which is the list at same level of taskList.
118
- We can get the root list item(inside which various lists are being resolved before outdenting) by going one depth above that list.
119
- */
120
- const nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
121
- const rootListItem = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.node(nestedListResolvedPos.depth - 1);
122
- const nestedTaskListsIndexes = [];
123
- const rootListItemChildCount = (rootListItem === null || rootListItem === void 0 ? void 0 : rootListItem.childCount) || 0;
124
- // first child of list item is always paragraph (i = 0) so we start from 1
125
- for (let i = 1; i < rootListItemChildCount; i++) {
126
- if ((rootListItem === null || rootListItem === void 0 ? void 0 : rootListItem.child(i).type.name) === 'taskList') {
127
- nestedTaskListsIndexes.push(i);
128
- }
129
- }
130
- return nestedTaskListsIndexes;
131
- };
132
-
133
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
134
- export const processNestedTaskListsInSameLevel = tr => {
135
- const {
136
- $from
137
- } = tr.selection;
138
- const nestedTaskListIndexes = findNestedTaskListsIndexAtSameLevel(tr, $from);
139
- if (nestedTaskListIndexes.length === 0) {
140
- return;
141
- }
142
- const nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
143
- const rootListItemStart = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.start(nestedListResolvedPos.depth - 1);
144
-
145
- /* We need not wrap the taskList present above other lists since it doesn't affect the flow. */
146
- const nestedTaskListIndexesToWrap = nestedTaskListIndexes.filter(index => index > 1);
147
-
148
- /*
149
- Wraps the taskLists present at each index mentioned in the nestedTaskListIndexesToWrap to the list above it.
150
- After each wrap the indexes changes since two lists are being merged into one,
151
- so we keep track of it and use it to access actual calculated taskList indexes.
152
- */
153
- if (rootListItemStart) {
154
- let taskListsFixedNested = 0;
155
- nestedTaskListIndexesToWrap.forEach(index => {
156
- wrapTaskListIntoListAbove(tr, findStartPositionOfChildWithIndex(tr.doc.resolve(rootListItemStart), index - taskListsFixedNested), findStartPositionOfChildWithIndex(tr.doc.resolve(rootListItemStart), index - 1 - taskListsFixedNested));
157
- taskListsFixedNested++;
158
- });
159
- }
160
- return;
161
- };
162
85
  // eslint-disable-next-line @atlaskit/editor/no-re-export
163
86
  export { isListNodeValidContent } from './isListNodeValidContent';
164
87
  // eslint-disable-next-line @atlaskit/editor/no-re-export
@@ -15,6 +15,4 @@ export const moveTargetIntoList = ({
15
15
  }
16
16
  const step = new ReplaceAroundStep(from, to, gapFrom, gapTo, $target.doc.slice(insertPosition, $target.pos), 0, true);
17
17
  return step;
18
- };
19
- // eslint-disable-next-line @atlaskit/editor/no-re-export
20
- export { wrapTaskListIntoListAbove } from './wrapTaskListIntoListAbove';
18
+ };
@@ -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,35 +13,6 @@ export const getListItemAttributes = $pos => {
14
13
  itemIndex
15
14
  };
16
15
  };
17
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
18
- export const normalizeListItemsSelection = ({
19
- selection,
20
- doc
21
- }) => {
22
- if (selection.empty) {
23
- return selection;
24
- }
25
- const {
26
- $from,
27
- $to
28
- } = selection;
29
- if (selection instanceof NodeSelection) {
30
- const head = resolvePositionToStartOfListItem($from);
31
- return new TextSelection(head, head);
32
- }
33
- const head = resolvePositionToStartOfListItem($from);
34
- const anchor = resolvePositionToEndOfListItem($to);
35
- return new TextSelection(anchor, head);
36
- };
37
- const resolvePositionToStartOfListItem = $pos => {
38
- const fromRange = $pos.blockRange($pos, isListItemNode);
39
- const fromPosition = fromRange && $pos.textOffset === 0 && fromRange.end - 1 === $pos.pos ? Selection.near($pos.doc.resolve(fromRange.end + 1), 1).$from : $pos;
40
- return fromPosition;
41
- };
42
- const resolvePositionToEndOfListItem = $pos => {
43
- const toRange = $pos.blockRange($pos, isListItemNode);
44
- const toPosition = toRange && $pos.textOffset === 0 && toRange.start + 1 === $pos.pos ? Selection.near($pos.doc.resolve(toRange.start - 1), -1).$to : $pos;
45
- return toPosition;
46
- };
16
+
47
17
  // eslint-disable-next-line @atlaskit/editor/no-re-export
48
18
  export { numberNestedLists } from './numberNestedLists';
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "122.11.0";
16
+ const packageVersion = "122.12.0";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -1,8 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
2
  import { isEmptyDocument } from '../utils';
4
3
  import { DynamicBitArray } from './dynamic-bit-array';
5
- import { shouldEnableLimitedModeForDocument } from './should-enable-limited-mode';
6
4
 
7
5
  // The slice of `@atlaskit/editor-plugin-limited-mode`'s state read below. Declared
8
6
  // structurally because `editor-common` must not depend on a plugin package.
@@ -97,7 +95,7 @@ const nodeIdProviderMap = new WeakMap();
97
95
  */
98
96
  const isLimitedModeEnabled = editorView => {
99
97
  var _limitedModePluginKey, _limitedModePluginKey2;
100
- 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);
98
+ return (_limitedModePluginKey = (_limitedModePluginKey2 = limitedModePluginKey.getState(editorView.state)) === null || _limitedModePluginKey2 === void 0 ? void 0 : _limitedModePluginKey2.documentSizeBreachesThreshold) !== null && _limitedModePluginKey !== void 0 ? _limitedModePluginKey : false;
101
99
  };
102
100
 
103
101
  // Get the NodeIdProvider for a specific EditorView instance.
@@ -1,7 +1,7 @@
1
1
  import { isMenuFooterSectionKey } from '../type-ahead/isMenuFooterSectionKey';
2
2
  import { isSectionOverflowItemKey } from '../type-ahead/isSectionOverflowItemKey';
3
3
  import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
4
- export const buildQuickInsertMenuModel = (components, rootComponent, sectionOverflowLimit, surfaceContext) => {
4
+ export const buildQuickInsertMenuModel = (components, rootComponent, selectCategoryItems, surfaceContext) => {
5
5
  const {
6
6
  root,
7
7
  childrenMap,
@@ -38,11 +38,12 @@ export const buildQuickInsertMenuModel = (components, rootComponent, sectionOver
38
38
  if (items.length === 0) {
39
39
  continue;
40
40
  }
41
- if (sectionOverflowLimit !== undefined && viewMoreItem !== undefined && items.length > sectionOverflowLimit) {
42
- sections.push([section, ...items.slice(0, sectionOverflowLimit), viewMoreItem]);
43
- continue;
41
+ const selectedItems = viewMoreItem !== undefined && selectCategoryItems !== undefined ? selectCategoryItems(items) : items;
42
+ if (selectedItems.length < items.length && viewMoreItem !== undefined) {
43
+ sections.push([section, ...selectedItems, viewMoreItem]);
44
+ } else {
45
+ sections.push([section, ...selectedItems]);
44
46
  }
45
- sections.push([section, ...items]);
46
47
  }
47
48
  return {
48
49
  footer,
@@ -1 +1,10 @@
1
- export const getQuickInsertProviderMenuItemKey = key => `quick-insert-provider-${key}`;
1
+ const QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX = 'quick-insert-provider-';
2
+ const ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX = 'quick-insert-ecosystem';
3
+ export const getQuickInsertProviderMenuItemKey = (key, app) => (app === null || app === void 0 ? void 0 : app.source) === 'ecosystem' ? `${ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX}-${key}` : `${QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX}${key}`;
4
+ const isEcosystemQuickInsertProviderMenuItemKey = key => key.startsWith(ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX);
5
+ const normalizeQuickInsertProviderMenuItemKey = key => isEcosystemQuickInsertProviderMenuItemKey(key) ? `${QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX}${key.slice(`${ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX}-`.length)}` : key;
6
+ export const quickInsertProviderMenuItemKey = {
7
+ get: getQuickInsertProviderMenuItemKey,
8
+ isEcosystem: isEcosystemQuickInsertProviderMenuItemKey,
9
+ normalize: normalizeQuickInsertProviderMenuItemKey
10
+ };
@@ -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,19 @@
1
+ import { quickInsertProviderMenuItemKey } from './getQuickInsertProviderMenuItemKey';
2
+ const DEFAULT_ITEM_LIMIT = 30;
3
+ const ECOSYSTEM_ITEM_LIMIT = 10;
4
+ const isEcosystemQuickInsertItem = item => quickInsertProviderMenuItemKey.isEcosystem(item.key);
5
+
6
+ /**
7
+ * Keeps the initial native and ecosystem results while ensuring ecosystem registrations
8
+ * remain discoverable beyond the default category item limit.
9
+ */
10
+ export const selectQuickInsertCategoryItems = items => {
11
+ let ecosystemItemCount = 0;
12
+ return items.filter((item, index) => {
13
+ const isEcosystemItem = isEcosystemQuickInsertItem(item);
14
+ if (isEcosystemItem) {
15
+ ecosystemItemCount++;
16
+ }
17
+ return index < DEFAULT_ITEM_LIMIT || isEcosystemItem && ecosystemItemCount <= ECOSYSTEM_ITEM_LIMIT;
18
+ });
19
+ };
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags/fg';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "122.11.0";
17
+ const packageVersion = "122.12.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -116,13 +116,13 @@ export var aiSuggestionsMessages = defineMessages({
116
116
  description: 'Label for the suggestions section in the AI suggestions staging area'
117
117
  },
118
118
  cardCloseButtonLabel: {
119
- id: 'fabric.editor.ai.suggestions.card.closeButtonLabel.non-final',
119
+ id: 'fabric.editor.ai.suggestions.card.closeSuggestionButtonLabel.non-final',
120
120
  defaultMessage: 'Close suggestion',
121
121
  description: 'Label and tooltip for the close button on the AI suggestions card'
122
122
  },
123
123
  cardShowSidebarButtonLabel: {
124
- id: 'fabric.editor.ai.suggestions.card.showSidebarButtonLabel.non-final',
125
- defaultMessage: 'Show all suggestions',
124
+ id: 'fabric.editor.ai.suggestions.card.showSuggestionsButtonLabel.non-final',
125
+ defaultMessage: 'Show suggestions',
126
126
  description: 'Label and tooltip for the button on the AI suggestions card that opens the suggestions sidebar'
127
127
  },
128
128
  cardPreviousSuggestionButtonLabel: {
@@ -190,18 +190,23 @@ export var aiSuggestionsMessages = defineMessages({
190
190
  defaultMessage: 'Source apps',
191
191
  description: 'Accessible name for the stack of app logos showing which apps an AI suggestion drew on'
192
192
  },
193
+ cardSourceAppsTooltip: {
194
+ id: 'fabric.editor.ai.suggestions.card.sourceAppsTooltip.non-final',
195
+ defaultMessage: 'Sources from {apps}',
196
+ description: 'Tooltip and accessible name for the stack of product logos showing which apps an AI suggestion drew on. {apps} is a localized list of product names, such as “Confluence and Jira”.'
197
+ },
193
198
  cardSourcesButtonLabel: {
194
199
  id: 'fabric.editor.ai.suggestions.card.sourcesButtonLabel.non-final',
195
200
  defaultMessage: 'Sources',
196
201
  description: 'Label for the sources toggle button on the AI suggestions card'
197
202
  },
198
203
  cardSourcesHideButtonLabel: {
199
- id: 'fabric.editor.ai.suggestions.card.sourcesHideButtonLabel.non-final',
204
+ id: 'fabric.editor.ai.suggestions.card.hideReasoningButtonLabel.non-final',
200
205
  defaultMessage: 'Hide reasoning',
201
206
  description: 'Label for the sources toggle button when sources are expanded'
202
207
  },
203
208
  cardSourcesShowButtonLabel: {
204
- id: 'fabric.editor.ai.suggestions.card.sourcesShowButtonLabel.non-final',
209
+ id: 'fabric.editor.ai.suggestions.card.showReasoningButtonLabel.non-final',
205
210
  defaultMessage: 'Show reasoning',
206
211
  description: 'Label for the sources toggle button when sources are collapsed'
207
212
  },
@@ -241,7 +246,7 @@ export var aiSuggestionsMessages = defineMessages({
241
246
  description: 'Label for the dismiss button on the AI suggestions card'
242
247
  },
243
248
  cardMoreOptionsButtonLabel: {
244
- id: 'fabric.editor.ai.suggestions.card.moreOptionsButtonLabel.non-final',
249
+ id: 'fabric.editor.ai.suggestions.card.moreActionsButtonLabel.non-final',
245
250
  defaultMessage: 'More actions',
246
251
  description: 'Label and tooltip for the overflow actions button on the AI suggestions card'
247
252
  },
@@ -291,12 +296,12 @@ export var aiSuggestionsMessages = defineMessages({
291
296
  description: 'Accessible label for the stop button displayed while the AI is thinking. When clicked, it cancels the ongoing action.'
292
297
  },
293
298
  thinkingReviewingContent: {
294
- id: 'fabric.editor.ai.suggestions.thinking.reviewingContent.non-final',
299
+ id: 'fabric.editor.ai.suggestions.thinking.rovoReviewingPage.non-final',
295
300
  defaultMessage: 'Rovo is reviewing your page',
296
301
  description: 'First loading message on the AI suggestions thinking bar, shown when the name of the reviewing agent is unknown'
297
302
  },
298
303
  thinkingReviewingContentWithAgent: {
299
- id: 'fabric.editor.ai.suggestions.thinking.reviewingContentWithAgent.non-final',
304
+ id: 'fabric.editor.ai.suggestions.thinking.agentAnalyzing.non-final',
300
305
  defaultMessage: '{agentName} is analyzing',
301
306
  description: 'First loading message on the AI suggestions thinking bar. The {agentName} placeholder is replaced with the reviewing agent name (for example "Content Reviewer"). Shown for a few seconds before the remaining rotating statuses.'
302
307
  },