@atlaskit/editor-common 125.3.0 → 125.4.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 (71) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/cjs/extensions/buildMenuItem.js +6 -3
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
  5. package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +22 -28
  6. package/dist/cjs/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
  7. package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +147 -68
  8. package/dist/cjs/quick-insert/QuickInsertMenuItem.js +4 -0
  9. package/dist/cjs/quick-insert/QuickInsertMenuSection.js +11 -4
  10. package/dist/cjs/quick-insert/confluence-attribution-icon.js +18 -0
  11. package/dist/cjs/quick-insert/jira-attribution-icon.js +18 -0
  12. package/dist/cjs/quick-insert/messages.js +30 -0
  13. package/dist/cjs/quick-insert/preview.js +5 -0
  14. package/dist/cjs/quick-insert/snippetPreviewImageUrls.js +43 -43
  15. package/dist/cjs/quick-insert/use-menu-list-height.js +58 -0
  16. package/dist/cjs/quick-insert/use-menu-popup-sizing.js +60 -0
  17. package/dist/cjs/ui/DropList/index.js +1 -1
  18. package/dist/cjs/ui/Mention/mention-with-profilecard.js +8 -0
  19. package/dist/es2019/extensions/buildMenuItem.js +5 -1
  20. package/dist/es2019/monitoring/error.js +1 -1
  21. package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
  22. package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +20 -29
  23. package/dist/es2019/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
  24. package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +130 -55
  25. package/dist/es2019/quick-insert/QuickInsertMenuItem.js +4 -0
  26. package/dist/es2019/quick-insert/QuickInsertMenuSection.js +11 -4
  27. package/dist/es2019/quick-insert/confluence-attribution-icon.js +10 -0
  28. package/dist/es2019/quick-insert/jira-attribution-icon.js +10 -0
  29. package/dist/es2019/quick-insert/messages.js +30 -0
  30. package/dist/es2019/quick-insert/preview.js +1 -0
  31. package/dist/es2019/quick-insert/snippetPreviewImageUrls.js +43 -43
  32. package/dist/es2019/quick-insert/use-menu-list-height.js +37 -0
  33. package/dist/es2019/quick-insert/use-menu-popup-sizing.js +49 -0
  34. package/dist/es2019/ui/DropList/index.js +1 -1
  35. package/dist/es2019/ui/Mention/mention-with-profilecard.js +8 -0
  36. package/dist/esm/extensions/buildMenuItem.js +6 -3
  37. package/dist/esm/monitoring/error.js +1 -1
  38. package/dist/esm/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
  39. package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +23 -29
  40. package/dist/esm/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
  41. package/dist/esm/quick-insert/QuickInsertHoverPreview.js +150 -68
  42. package/dist/esm/quick-insert/QuickInsertMenuItem.js +4 -0
  43. package/dist/esm/quick-insert/QuickInsertMenuSection.js +11 -4
  44. package/dist/esm/quick-insert/confluence-attribution-icon.js +12 -0
  45. package/dist/esm/quick-insert/jira-attribution-icon.js +12 -0
  46. package/dist/esm/quick-insert/messages.js +30 -0
  47. package/dist/esm/quick-insert/preview.js +1 -0
  48. package/dist/esm/quick-insert/snippetPreviewImageUrls.js +43 -43
  49. package/dist/esm/quick-insert/use-menu-list-height.js +51 -0
  50. package/dist/esm/quick-insert/use-menu-popup-sizing.js +53 -0
  51. package/dist/esm/ui/DropList/index.js +1 -1
  52. package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -0
  53. package/dist/types/extensions/types/extension-manifest.d.ts +5 -0
  54. package/dist/types/extensions/types/utils.d.ts +2 -0
  55. package/dist/types/provider-factory/profile-card-provider.d.ts +14 -1
  56. package/dist/types/provider-factory/quick-insert-provider.d.ts +3 -0
  57. package/dist/types/quick-insert/CompactQuickInsertMenuItem.d.ts +1 -1
  58. package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +7 -6
  59. package/dist/types/quick-insert/QuickInsertMenuItem.d.ts +7 -2
  60. package/dist/types/quick-insert/confluence-attribution-icon.d.ts +3 -0
  61. package/dist/types/quick-insert/jira-attribution-icon.d.ts +3 -0
  62. package/dist/types/quick-insert/messages.d.ts +5 -2
  63. package/dist/types/quick-insert/preview.d.ts +16 -0
  64. package/dist/types/quick-insert/use-menu-list-height.d.ts +6 -0
  65. package/dist/types/quick-insert/use-menu-popup-sizing.d.ts +11 -0
  66. package/package.json +4 -3
  67. package/quick-insert/confluence-attribution-icon/package.json +10 -0
  68. package/quick-insert/jira-attribution-icon/package.json +10 -0
  69. package/quick-insert/preview/package.json +10 -0
  70. package/quick-insert/use-menu-list-height/package.json +10 -0
  71. package/quick-insert/use-menu-popup-sizing/package.json +10 -0
@@ -1,109 +1,109 @@
1
- var DAM_ASSET_LINK = 'https://dam-cdn.atl.orangelogic.com/AssetLink';
1
+ var DAM_CDN_LINK = 'https://dam-cdn.atl.orangelogic.com/CDNLink';
2
2
  var snippetPreviewImageUrlsByKey = {
3
3
  // Action items
4
4
  '019e5cd9-5ca1-7258-befd-4f50d491bb42': {
5
- light: "".concat(DAM_ASSET_LINK, "/qq0503l11x2ub0506p2s046o2ep5gw1w.png"),
6
- dark: "".concat(DAM_ASSET_LINK, "/i77e8128ir0e34t8w11mar77ngq53o00.png")
5
+ light: "".concat(DAM_CDN_LINK, "/AT12OVLE.png"),
6
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJI.png")
7
7
  },
8
8
  // Bug report
9
9
  '019e5cd9-5ca1-7258-befd-1c3c59b0aa00': {
10
- light: "".concat(DAM_ASSET_LINK, "/221f56s64c186314ka8a7uaj7m4di32l.png"),
11
- dark: "".concat(DAM_ASSET_LINK, "/1c86e0v3ygh5ct5600luum0w67unpa23.png")
10
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMN.png"),
11
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ6.png")
12
12
  },
13
13
  // Campaign brief
14
14
  '019e5cd9-5ca1-7258-befd-398bb4e40f15': {
15
- light: "".concat(DAM_ASSET_LINK, "/55j1ie55ad1nal6t3awxxui52rp47wn1.png"),
16
- dark: "".concat(DAM_ASSET_LINK, "/36h5jgou0pw7v532411mbl501b8de4hm.png")
15
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMY.png"),
16
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJE.png")
17
17
  },
18
18
  // Colorful layout
19
19
  '019e5cd9-5ca1-7258-befd-53b6eec19427': {
20
- light: "".concat(DAM_ASSET_LINK, "/53j8kth40pkysk4rqs64038r4cw2i867.png"),
21
- dark: "".concat(DAM_ASSET_LINK, "/k7ofa1q6r10dydey04780514v75j3fvx.png")
20
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN6.png"),
21
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVIG.png")
22
22
  },
23
23
  // Colorful numbered table
24
24
  '019e5cd9-5ca1-7258-befd-70a282facf16': {
25
- light: "".concat(DAM_ASSET_LINK, "/f02n6041opl0rqvbygs2hv162mt6jq3u.png"),
26
- dark: "".concat(DAM_ASSET_LINK, "/s63mw28263h0oi8we3x052m7rsw2o1k8.png")
25
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN7.png"),
26
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJL.png")
27
27
  },
28
28
  // Colorful summary
29
29
  '019e5cd9-5ca1-7258-befd-7e200502de8e': {
30
- light: "".concat(DAM_ASSET_LINK, "/242qv11f2p7y1u461v71glq85x76b5gp.png"),
31
- dark: "".concat(DAM_ASSET_LINK, "/jeaj3a8g7x61syy45d73c2223647b14j.png")
30
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN4.png"),
31
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVIE.png")
32
32
  },
33
33
  // Colorful table
34
34
  '019e5cd9-5ca1-7258-befd-5524d394ba0a': {
35
- light: "".concat(DAM_ASSET_LINK, "/8w8571k707dlx556rxr3hs72gs5q4m42.png"),
36
- dark: "".concat(DAM_ASSET_LINK, "/wkt55v21i5q520pqxjh31x5g2j8upth4.png")
35
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMJ.png"),
36
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJM.png")
37
37
  },
38
38
  // Competitive snapshot
39
39
  '019e5cd9-5ca1-7258-befd-40d1947b7b84': {
40
- light: "".concat(DAM_ASSET_LINK, "/k5cm81s2h7i41d4d6832n67c2m767h6t.png"),
41
- dark: "".concat(DAM_ASSET_LINK, "/ks38nc26451n7384d52413lck2qhq4e6.png")
40
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMR.png"),
41
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJC.png")
42
42
  },
43
43
  // Criteria rubric
44
44
  '019e5cd9-5ca1-7258-befd-84723a493931': {
45
- light: "".concat(DAM_ASSET_LINK, "/n00f5ur678kbqdqjj5e13xpij6u3kkuq.png"),
46
- dark: "".concat(DAM_ASSET_LINK, "/54k2y2f7n2tpg2n12is326376102c3b5.png")
45
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMA.png"),
46
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ1.png")
47
47
  },
48
48
  // Customer quote
49
49
  '019e5cd9-5ca1-7258-befd-5fcf6165870f': {
50
- light: "".concat(DAM_ASSET_LINK, "/k8q5l4htp63652mhw572ed6chren37mv.png"),
51
- dark: "".concat(DAM_ASSET_LINK, "/y0leijw14xp7mdpi3265xn0d5ymo5lfm.png")
50
+ light: "".concat(DAM_CDN_LINK, "/AT12OVLF.png"),
51
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJK.png")
52
52
  },
53
53
  // Decision log
54
54
  '019e5cd9-5ca1-7258-befd-30c6e8712ba4': {
55
- light: "".concat(DAM_ASSET_LINK, "/4vuxracm3c33555h1u4ug65q55267574.png"),
56
- dark: "".concat(DAM_ASSET_LINK, "/5445044f626dcb58dbc7s6axr32e4ywl.png")
55
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMT.png"),
56
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ9.png")
57
57
  },
58
58
  // Launch checklist
59
59
  '019e5cd9-5ca1-7258-befd-3ce1c551015e': {
60
- light: "".concat(DAM_ASSET_LINK, "/1o0gj47oprg341fe6iip8fdx8561t54n.png"),
61
- dark: "".concat(DAM_ASSET_LINK, "/lay6kpn21b264q2q8144h3s18uwjud0f.png")
60
+ light: "".concat(DAM_CDN_LINK, "/AT12OVKW.png"),
61
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVHN.png")
62
62
  },
63
63
  // Meeting agenda
64
64
  '019e5cd9-5ca1-7258-befd-47559a8d7cfc': {
65
- light: "".concat(DAM_ASSET_LINK, "/2hn6q5dt118vwyqi438725l141u70fb8.png"),
66
- dark: "".concat(DAM_ASSET_LINK, "/r4l0ydb7ujg4lms6n0wrrnsmsd1x65kw.png")
65
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMU.png"),
66
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJD.png")
67
67
  },
68
68
  // Project status snapshot
69
69
  '019e5cd9-5ca1-7258-befd-2943939d1b79': {
70
- light: "".concat(DAM_ASSET_LINK, "/qk6emfe0oa2260ldt11748672gs65y1l.png"),
71
- dark: "".concat(DAM_ASSET_LINK, "/tt36rsll4cmq4607ik7g2d10fxmysyt4.png")
70
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMO.png"),
71
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJU.png")
72
72
  },
73
73
  // Pros and cons
74
74
  '019e5cd9-5ca1-7258-befd-6db9658d75f4': {
75
- light: "".concat(DAM_ASSET_LINK, "/22078yl6viws8rc3au187m76x07xcu61.png"),
76
- dark: "".concat(DAM_ASSET_LINK, "/4tfd6w50y4yxfh4ks75w5ql04u17n7ub.png")
75
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN5.png"),
76
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVHY.png")
77
77
  },
78
78
  // Quick project update
79
79
  '019e5cd9-5ca1-7258-befd-820ce1acd7a0': {
80
- light: "".concat(DAM_ASSET_LINK, "/i8cfkp8v6716121f0w054g85mkw15wgu.png"),
81
- dark: "".concat(DAM_ASSET_LINK, "/x7a25y5f33ok60871t31e1my5c7880cr.png")
80
+ light: "".concat(DAM_CDN_LINK, "/AT12OVNA.png"),
81
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVI5.png")
82
82
  },
83
83
  // Risks and assumptions
84
84
  '019e5cd9-5ca1-7258-befd-2da95ce98772': {
85
- light: "".concat(DAM_ASSET_LINK, "/yl7w10ms70ptlodhc703f6byo3wf7xty.png"),
86
- dark: "".concat(DAM_ASSET_LINK, "/mn14wqw150cu05w3s358w3f2f1vfgv7r.png")
85
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMQ.png"),
86
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ7.png")
87
87
  },
88
88
  // Roles and responsibilities matrix
89
89
  '019e5cd9-5ca1-7258-befd-37cd3a06776d': {
90
- light: "".concat(DAM_ASSET_LINK, "/67hs5t8u4t63c4fepm6ho1c4d5u12bed.png"),
91
- dark: "".concat(DAM_ASSET_LINK, "/wj5s3dy5nvb810t87f7x45cie88783h6.png")
90
+ light: "".concat(DAM_CDN_LINK, "/AT12OVM8.png"),
91
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVHG.png")
92
92
  },
93
93
  // Run sheet
94
94
  '019e5cd9-5ca1-7258-befd-4a9979f87235': {
95
- light: "".concat(DAM_ASSET_LINK, "/tt0n285m6jl5lxb46c5v4fn856540351.png"),
96
- dark: "".concat(DAM_ASSET_LINK, "/qcrcqcs14753208xqw1j8r38mgs57w2f.png")
95
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMZ.png"),
96
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJB.png")
97
97
  },
98
98
  // Started → Now
99
99
  '019e5cd9-5ca1-7258-befd-74fb1585da6f': {
100
- light: "".concat(DAM_ASSET_LINK, "/5ggat8yryusxvaqj3o800t8v6hcyh22v.png"),
101
- dark: "".concat(DAM_ASSET_LINK, "/287u8yil1jb1j5p1fih0141h07k2f64w.png")
100
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN8.png"),
101
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJQ.png")
102
102
  },
103
103
  // Weekly calendar
104
104
  '019e5cd9-5ca1-7258-befd-580c2c95a0a0': {
105
- light: "".concat(DAM_ASSET_LINK, "/na153u604p852n54aji7aj1gf14431o7.png"),
106
- dark: "".concat(DAM_ASSET_LINK, "/sw7m5s5ay718h025c6ed3gaq63orv4gu.png")
105
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN2.png"),
106
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVIJ.png")
107
107
  }
108
108
  };
109
109
  export var getSnippetPreviewImageUrls = function getSnippetPreviewImageUrls(snippetKey) {
@@ -0,0 +1,51 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import { useCallback, useLayoutEffect, useRef, useState } from 'react';
3
+ /** Keep the list viewport in sync with measured rows, including short search results. */
4
+ export function useMenuListHeight(cache, rowCount, rowKeySignature) {
5
+ var _useState = useState(function () {
6
+ return Array.from({
7
+ length: rowCount
8
+ }, function (_, index) {
9
+ return cache.rowHeight({
10
+ index: index
11
+ });
12
+ }).reduce(function (sum, value) {
13
+ return sum + value;
14
+ }, 0);
15
+ }),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ height = _useState2[0],
18
+ setHeight = _useState2[1];
19
+ var frame = useRef();
20
+ var updateHeight = useCallback(function () {
21
+ if (frame.current !== undefined) {
22
+ cancelAnimationFrame(frame.current);
23
+ }
24
+ // CellMeasurer updates its cache during commit. Read it after all rows have measured.
25
+ frame.current = requestAnimationFrame(function () {
26
+ frame.current = undefined;
27
+ var total = Array.from({
28
+ length: rowCount
29
+ }, function (_, index) {
30
+ return cache.rowHeight({
31
+ index: index
32
+ });
33
+ }).reduce(function (sum, height) {
34
+ return sum + height;
35
+ }, 0);
36
+ setHeight(total);
37
+ });
38
+ }, [cache, rowCount]);
39
+ useLayoutEffect(function () {
40
+ updateHeight();
41
+ return function () {
42
+ if (frame.current !== undefined) {
43
+ cancelAnimationFrame(frame.current);
44
+ }
45
+ };
46
+ }, [rowKeySignature, updateHeight]);
47
+ return {
48
+ height: height,
49
+ updateHeight: updateHeight
50
+ };
51
+ }
@@ -0,0 +1,53 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import { useLayoutEffect, useState } from 'react';
3
+ import { bind } from 'bind-event-listener';
4
+ import rafSchedule from 'raf-schd';
5
+ import { findOverflowScrollParent } from '../ui/Popup/utils';
6
+ /** Constrain menu height to the available space; Popup chooses placement. */
7
+ export function useMenuPopupSizing(_ref) {
8
+ var target = _ref.target,
9
+ boundariesElement = _ref.boundariesElement,
10
+ scrollableElement = _ref.scrollableElement,
11
+ maxHeight = _ref.maxHeight,
12
+ offset = _ref.offset,
13
+ _ref$isOpen = _ref.isOpen,
14
+ isOpen = _ref$isOpen === void 0 ? true : _ref$isOpen;
15
+ var _useState = useState(maxHeight),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ height = _useState2[0],
18
+ setHeight = _useState2[1];
19
+ useLayoutEffect(function () {
20
+ var view = target === null || target === void 0 ? void 0 : target.ownerDocument.defaultView;
21
+ if (!target || !view || !isOpen) {
22
+ return;
23
+ }
24
+ var boundary = boundariesElement || target.ownerDocument.body;
25
+ var scrollParent = scrollableElement || findOverflowScrollParent(target);
26
+ var update = function update() {
27
+ var rect = target.getBoundingClientRect();
28
+ var bounds = boundary.getBoundingClientRect();
29
+ var above = Math.max(0, rect.top - (bounds.top - boundary.scrollTop) - offset);
30
+ var below = Math.max(0, bounds.bottom - rect.bottom - offset);
31
+ var space = below >= maxHeight ? below : Math.max(above, below);
32
+ // Popup rounds its position up to a CSS pixel. Reserve that pixel at the edge.
33
+ var available = Math.max(0, Math.floor(space) - 1);
34
+ setHeight(Math.min(maxHeight, available));
35
+ };
36
+ var schedule = rafSchedule(update);
37
+ update();
38
+ var unbindResize = bind(view, {
39
+ type: 'resize',
40
+ listener: schedule
41
+ });
42
+ var unbindScroll = scrollParent ? bind(scrollParent, {
43
+ type: 'scroll',
44
+ listener: schedule
45
+ }) : undefined;
46
+ return function () {
47
+ unbindResize();
48
+ unbindScroll === null || unbindScroll === void 0 || unbindScroll();
49
+ schedule.cancel();
50
+ };
51
+ }, [target, boundariesElement, scrollableElement, maxHeight, offset, isOpen]);
52
+ return height;
53
+ }
@@ -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 = "125.2.1";
24
+ var packageVersion = "125.3.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -51,6 +51,7 @@ export default function MentionWithProfileCard(_ref) {
51
51
  ssrPlaceholderId = _ref.ssrPlaceholderId,
52
52
  userType = _ref.userType;
53
53
  var cloudId = profilecardProvider.cloudId,
54
+ renderAgentMentionCard = profilecardProvider.renderAgentMentionCard,
54
55
  renderUserMentionCard = profilecardProvider.renderUserMentionCard,
55
56
  resourceClient = profilecardProvider.resourceClient;
56
57
  var actions = useMemo(function () {
@@ -75,6 +76,13 @@ export default function MentionWithProfileCard(_ref) {
75
76
 
76
77
  // Agent mentions (userType 'APP') open the Rovo agent profile card on click.
77
78
  if (userType === 'APP' && cloudId && isExperimentEnabled('rovo_chat_mention_agents')) {
79
+ if (renderAgentMentionCard) {
80
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderAgentMentionCard({
81
+ accountId: id,
82
+ children: mention,
83
+ cloudId: cloudId
84
+ }));
85
+ }
78
86
  return /*#__PURE__*/React.createElement(AgentProfileCardTrigger, {
79
87
  agentId: id,
80
88
  agentIdType: isExperimentEnabled('platform_editor_comment_mention_card_fixes') ? 'identity' : undefined,
@@ -1,6 +1,7 @@
1
1
  import type { ComponentType, ReactNode } from 'react';
2
2
  import type { ADFEntity } from '@atlaskit/adf-utils/types';
3
3
  import type { BlockTransformExtension } from '../../block-menu/block-transform-extension';
4
+ import type { QuickInsertPreview } from '../../quick-insert/preview';
4
5
  import type { ExtensionAPI, ExtensionParams, MultiBodiedExtensionActions, UpdateExtension } from './extension-handler';
5
6
  import type { ExtensionIconModule, MaybeESModule } from './extension-manifest-common';
6
7
  import type { ContextualToolbar } from './extension-manifest-toolbar-item';
@@ -49,6 +50,8 @@ export type ExtensionModule<T extends Parameters = Parameters> = {
49
50
  keywords?: string[];
50
51
  lozenge?: ReactNode;
51
52
  parameters?: T;
53
+ /** Module-specific preview, which takes precedence over the manifest preview. */
54
+ preview?: QuickInsertPreview;
52
55
  priority?: number;
53
56
  title?: string;
54
57
  };
@@ -136,6 +139,8 @@ export type ExtensionManifest<T extends Parameters = Parameters> = {
136
139
  key: ExtensionKey;
137
140
  keywords?: string[];
138
141
  modules: ExtensionModules<T>;
142
+ /** Default preview content for quick insert modules that do not override it. */
143
+ preview?: QuickInsertPreview;
139
144
  summary?: string;
140
145
  title: string;
141
146
  type: ExtensionType;
@@ -1,5 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ADFEntity } from '@atlaskit/adf-utils/types';
3
+ import type { QuickInsertPreview } from '../../quick-insert/preview';
3
4
  import type { ExtensionApp, ExtensionKey, ExtensionModuleActionHandler, ExtensionType, Icon } from './extension-manifest';
4
5
  export type MenuItem = {
5
6
  app?: ExtensionApp;
@@ -15,6 +16,7 @@ export type MenuItem = {
15
16
  keywords: string[];
16
17
  lozenge?: ReactNode;
17
18
  node: ADFEntity | ExtensionModuleActionHandler;
19
+ preview?: QuickInsertPreview;
18
20
  priority?: number;
19
21
  summary?: string;
20
22
  title: string;
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import type { MouseEvent, ReactNode } from 'react';
2
2
  import type { Placement } from '@atlaskit/popper/main';
3
3
  import type ProfileClient from '@atlaskit/profilecard/profile-card-client';
4
4
  import type { ProfileCardAction } from '@atlaskit/profilecard/types';
@@ -31,9 +31,22 @@ export type RenderUserMentionCard = (props: {
31
31
  referenceElement?: HTMLElement;
32
32
  userId: string;
33
33
  }) => ReactNode;
34
+ /**
35
+ * Render-prop for injecting a custom agent profile card around a mention. `children` present
36
+ * means the renderer path (wrap it with your own trigger/popup); absent means the editor path
37
+ * (render a bare card).
38
+ */
39
+ export type RenderAgentMentionCard = (props: {
40
+ accountId: string;
41
+ children?: ReactNode;
42
+ cloudId: string;
43
+ isReadOnly?: boolean;
44
+ onChatClick?: (event: MouseEvent, agentStudioId?: string) => void;
45
+ }) => ReactNode;
34
46
  export interface ProfilecardProvider {
35
47
  cloudId: string;
36
48
  getActions: (id: string, text: string, accessLevel?: string) => ProfileCardAction[];
49
+ renderAgentMentionCard?: RenderAgentMentionCard;
37
50
  /**
38
51
  * Optional render-prop that wraps a user mention with a consumer-supplied profile card UI.
39
52
  * Only used when the `people-teams_migrate-user-profile-card` feature gate is on. Lets 1P
@@ -3,6 +3,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
3
3
  import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
4
4
  import type { INPUT_METHOD } from '../analytics/types/enums';
5
5
  import type { ExtensionApp } from '../extensions/types/extension-manifest';
6
+ import type { QuickInsertPreview } from '../quick-insert/preview';
6
7
  import type { TypeAheadItem } from '../types/type-ahead';
7
8
  export type QuickInsertActionInsert = (node?: Node | Record<string, any> | string, opts?: {
8
9
  selectInlineNode?: boolean;
@@ -34,6 +35,8 @@ export type QuickInsertItem = TypeAheadItem & {
34
35
  isHidden?: () => boolean;
35
36
  /** other names used to find the item */
36
37
  keywords?: Array<string>;
38
+ /** Optional visual and attribution content shown while this item is selected. */
39
+ preview?: QuickInsertPreview;
37
40
  };
38
41
  export type QuickInsertProvider = {
39
42
  /** Registered leaf items for the Quick Insert browse menu. */
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { QuickInsertMenuItemProps } from './QuickInsertMenuItem';
3
- export declare const CompactQuickInsertMenuItem: ({ ariaLabel, iconBefore, isDisabled, onSelect, previewImageUrls, shortcut, shouldWrapIcon, title, }: QuickInsertMenuItemProps) => React.JSX.Element;
3
+ export declare const CompactQuickInsertMenuItem: ({ ariaLabel, description, iconBefore, isDisabled, onSelect, preview, previewImageUrls, shortcut, shouldShowPreview, shouldWrapIcon, title, }: QuickInsertMenuItemProps) => React.JSX.Element;
@@ -1,8 +1,9 @@
1
- /** A non-interactive visual preview: keep focus and keyboard handling in the editor. */
2
- export declare const QuickInsertHoverPreview: ({ previewImageUrls, referenceElement, }: {
3
- previewImageUrls: {
4
- dark?: string;
5
- light: string;
6
- };
1
+ import type { QuickInsertPreview } from './preview';
2
+ /** The selected item's description and attribution are announced through its aria-describedby. */
3
+ export declare const QuickInsertHoverPreview: ({ description, id, preview, referenceElement, title, }: {
4
+ description?: string;
5
+ id: string;
6
+ preview: QuickInsertPreview;
7
7
  referenceElement: HTMLElement;
8
+ title: string;
8
9
  }) => React.JSX.Element;
@@ -3,6 +3,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { INPUT_METHOD } from '../analytics';
5
5
  import type { TypeAheadInsert } from '../types';
6
+ import type { QuickInsertPreview } from './preview';
6
7
  export type OnSelectContext = {
7
8
  editorView: EditorView;
8
9
  insert: TypeAheadInsert;
@@ -14,13 +15,17 @@ export type QuickInsertMenuItemProps = {
14
15
  iconBefore?: React.ReactNode;
15
16
  isDisabled?: boolean;
16
17
  onSelect: (context: OnSelectContext) => Transaction | false | void;
17
- /** Approved preview images, loaded only while this slash-command item is selected. */
18
+ /** Structured preview content for the selected item. */
19
+ preview?: QuickInsertPreview;
20
+ /** Retained for existing callers; new callers should pass `preview.image`. */
18
21
  previewImageUrls?: {
19
22
  dark?: string;
20
23
  light: string;
21
24
  } | null;
22
25
  shortcut?: string;
26
+ /** Disable previews for navigation actions rather than insertable items. */
27
+ shouldShowPreview?: boolean;
23
28
  shouldWrapIcon?: boolean;
24
29
  title: string;
25
30
  };
26
- export declare const QuickInsertMenuItem: ({ ariaLabel, description, iconBefore, isDisabled, onSelect, previewImageUrls, shortcut, shouldWrapIcon, title, }: QuickInsertMenuItemProps) => React.JSX.Element;
31
+ export declare const QuickInsertMenuItem: ({ ariaLabel, description, iconBefore, isDisabled, onSelect, preview, previewImageUrls, shortcut, shouldShowPreview, shouldWrapIcon, title, }: QuickInsertMenuItemProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ /** Decorative product icon accompanying the localized Confluence attribution name. */
3
+ export declare const ConfluenceAttributionIcon: () => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ /** Decorative product icon accompanying the localized Jira attribution name. */
3
+ export declare const JiraAttributionIcon: () => React.JSX.Element;
@@ -1,4 +1,7 @@
1
1
  import { type MessageDescriptor } from 'react-intl';
2
- type Messages<Keys extends string> = Record<Keys, MessageDescriptor>;
3
- export declare const messages: Messages<'admin' | 'AI' | 'all' | 'browse' | 'categoryBlockTemplates' | 'categoryDataAndCharts' | 'categoryEmbed' | 'categoryMedia' | 'categoryOther' | 'categoryRecommended' | 'categoryRovo' | 'categoryStructure' | 'categoryTextFormatting' | 'close' | 'communication' | 'confluence-content' | 'development' | 'external-content' | 'featuredWhiteboardDescription' | 'formatting' | 'help' | 'insert' | 'media' | 'navigation' | 'reporting' | 'visuals'>;
2
+ type Messages<Keys extends string> = Record<Keys, MessageDescriptor & {
3
+ defaultMessage: string;
4
+ id: string;
5
+ }>;
6
+ export declare const messages: Messages<'admin' | 'AI' | 'all' | 'browse' | 'categoryBlockTemplates' | 'categoryDataAndCharts' | 'categoryEmbed' | 'categoryMedia' | 'categoryOther' | 'categoryRecommended' | 'categoryRovo' | 'categoryStructure' | 'categoryTextFormatting' | 'previewAttributionBy' | 'previewAttributionAtlassian' | 'previewAttributionAssets' | 'previewAttributionConfluence' | 'previewAttributionJira' | 'previewAttributionMicrosoft' | 'close' | 'communication' | 'confluence-content' | 'development' | 'external-content' | 'featuredWhiteboardDescription' | 'formatting' | 'help' | 'insert' | 'media' | 'navigation' | 'reporting' | 'visuals'>;
4
7
  export {};
@@ -0,0 +1,16 @@
1
+ import type { ComponentType } from 'react';
2
+ /** An image asset with a light default and an optional dark theme variant. */
3
+ export type PreviewImage = {
4
+ dark?: string;
5
+ light: string;
6
+ };
7
+ export type QuickInsertPreview = {
8
+ attribution?: {
9
+ /** Decorative icon shown at a fixed 16px size beside the attribution. */
10
+ icon?: ComponentType;
11
+ /** Localized display name; Editor adds a localized prefix when no icon is supplied. */
12
+ name: string;
13
+ };
14
+ /** Optional image; text and attribution still render when an image is omitted or fails to load. */
15
+ image?: PreviewImage;
16
+ };
@@ -0,0 +1,6 @@
1
+ import type { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
2
+ /** Keep the list viewport in sync with measured rows, including short search results. */
3
+ export declare function useMenuListHeight(cache: CellMeasurerCache, rowCount: number, rowKeySignature: string): {
4
+ height: number;
5
+ updateHeight: () => void;
6
+ };
@@ -0,0 +1,11 @@
1
+ type Options = {
2
+ boundariesElement?: HTMLElement;
3
+ isOpen?: boolean;
4
+ maxHeight: number;
5
+ offset: number;
6
+ scrollableElement?: HTMLElement;
7
+ target?: HTMLElement | null;
8
+ };
9
+ /** Constrain menu height to the available space; Popup chooses placement. */
10
+ export declare function useMenuPopupSizing({ target, boundariesElement, scrollableElement, maxHeight, offset, isOpen, }: Options): number;
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "125.3.0",
3
+ "version": "125.4.0",
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/"
@@ -56,6 +56,7 @@
56
56
  "@atlaskit/link": "^5.1.0",
57
57
  "@atlaskit/link-datasource": "^7.0.0",
58
58
  "@atlaskit/link-picker": "^6.9.0",
59
+ "@atlaskit/logo": "^23.3.0",
59
60
  "@atlaskit/media-card": "^82.1.0",
60
61
  "@atlaskit/media-client": "^39.0.0",
61
62
  "@atlaskit/media-client-react": "^7.0.0",
@@ -81,10 +82,10 @@
81
82
  "@atlaskit/smart-card": "^46.1.0",
82
83
  "@atlaskit/smart-user-picker": "^12.0.0",
83
84
  "@atlaskit/spinner": "^20.4.0",
84
- "@atlaskit/task-decision": "^21.10.0",
85
+ "@atlaskit/task-decision": "^21.11.0",
85
86
  "@atlaskit/teams-app-config": "^3.1.0",
86
87
  "@atlaskit/textfield": "^10.2.0",
87
- "@atlaskit/tmp-editor-statsig": "^208.0.0",
88
+ "@atlaskit/tmp-editor-statsig": "^209.0.0",
88
89
  "@atlaskit/tokens": "^20.0.0",
89
90
  "@atlaskit/tooltip": "^24.3.0",
90
91
  "@atlaskit/width-detector": "^7.2.0",
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/quick-insert/confluence-attribution-icon",
3
+ "main": "../../dist/cjs/quick-insert/confluence-attribution-icon.js",
4
+ "module": "../../dist/esm/quick-insert/confluence-attribution-icon.js",
5
+ "module:es2019": "../../dist/es2019/quick-insert/confluence-attribution-icon.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/quick-insert/confluence-attribution-icon.d.ts"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/quick-insert/jira-attribution-icon",
3
+ "main": "../../dist/cjs/quick-insert/jira-attribution-icon.js",
4
+ "module": "../../dist/esm/quick-insert/jira-attribution-icon.js",
5
+ "module:es2019": "../../dist/es2019/quick-insert/jira-attribution-icon.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/quick-insert/jira-attribution-icon.d.ts"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/quick-insert/preview",
3
+ "main": "../../dist/cjs/quick-insert/preview.js",
4
+ "module": "../../dist/esm/quick-insert/preview.js",
5
+ "module:es2019": "../../dist/es2019/quick-insert/preview.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/quick-insert/preview.d.ts"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/quick-insert/use-menu-list-height",
3
+ "main": "../../dist/cjs/quick-insert/use-menu-list-height.js",
4
+ "module": "../../dist/esm/quick-insert/use-menu-list-height.js",
5
+ "module:es2019": "../../dist/es2019/quick-insert/use-menu-list-height.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/quick-insert/use-menu-list-height.d.ts"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/quick-insert/use-menu-popup-sizing",
3
+ "main": "../../dist/cjs/quick-insert/use-menu-popup-sizing.js",
4
+ "module": "../../dist/esm/quick-insert/use-menu-popup-sizing.js",
5
+ "module:es2019": "../../dist/es2019/quick-insert/use-menu-popup-sizing.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/quick-insert/use-menu-popup-sizing.d.ts"
10
+ }