@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
@@ -4,112 +4,112 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getSnippetPreviewImageUrls = void 0;
7
- var DAM_ASSET_LINK = 'https://dam-cdn.atl.orangelogic.com/AssetLink';
7
+ var DAM_CDN_LINK = 'https://dam-cdn.atl.orangelogic.com/CDNLink';
8
8
  var snippetPreviewImageUrlsByKey = {
9
9
  // Action items
10
10
  '019e5cd9-5ca1-7258-befd-4f50d491bb42': {
11
- light: "".concat(DAM_ASSET_LINK, "/qq0503l11x2ub0506p2s046o2ep5gw1w.png"),
12
- dark: "".concat(DAM_ASSET_LINK, "/i77e8128ir0e34t8w11mar77ngq53o00.png")
11
+ light: "".concat(DAM_CDN_LINK, "/AT12OVLE.png"),
12
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJI.png")
13
13
  },
14
14
  // Bug report
15
15
  '019e5cd9-5ca1-7258-befd-1c3c59b0aa00': {
16
- light: "".concat(DAM_ASSET_LINK, "/221f56s64c186314ka8a7uaj7m4di32l.png"),
17
- dark: "".concat(DAM_ASSET_LINK, "/1c86e0v3ygh5ct5600luum0w67unpa23.png")
16
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMN.png"),
17
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ6.png")
18
18
  },
19
19
  // Campaign brief
20
20
  '019e5cd9-5ca1-7258-befd-398bb4e40f15': {
21
- light: "".concat(DAM_ASSET_LINK, "/55j1ie55ad1nal6t3awxxui52rp47wn1.png"),
22
- dark: "".concat(DAM_ASSET_LINK, "/36h5jgou0pw7v532411mbl501b8de4hm.png")
21
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMY.png"),
22
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJE.png")
23
23
  },
24
24
  // Colorful layout
25
25
  '019e5cd9-5ca1-7258-befd-53b6eec19427': {
26
- light: "".concat(DAM_ASSET_LINK, "/53j8kth40pkysk4rqs64038r4cw2i867.png"),
27
- dark: "".concat(DAM_ASSET_LINK, "/k7ofa1q6r10dydey04780514v75j3fvx.png")
26
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN6.png"),
27
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVIG.png")
28
28
  },
29
29
  // Colorful numbered table
30
30
  '019e5cd9-5ca1-7258-befd-70a282facf16': {
31
- light: "".concat(DAM_ASSET_LINK, "/f02n6041opl0rqvbygs2hv162mt6jq3u.png"),
32
- dark: "".concat(DAM_ASSET_LINK, "/s63mw28263h0oi8we3x052m7rsw2o1k8.png")
31
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN7.png"),
32
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJL.png")
33
33
  },
34
34
  // Colorful summary
35
35
  '019e5cd9-5ca1-7258-befd-7e200502de8e': {
36
- light: "".concat(DAM_ASSET_LINK, "/242qv11f2p7y1u461v71glq85x76b5gp.png"),
37
- dark: "".concat(DAM_ASSET_LINK, "/jeaj3a8g7x61syy45d73c2223647b14j.png")
36
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN4.png"),
37
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVIE.png")
38
38
  },
39
39
  // Colorful table
40
40
  '019e5cd9-5ca1-7258-befd-5524d394ba0a': {
41
- light: "".concat(DAM_ASSET_LINK, "/8w8571k707dlx556rxr3hs72gs5q4m42.png"),
42
- dark: "".concat(DAM_ASSET_LINK, "/wkt55v21i5q520pqxjh31x5g2j8upth4.png")
41
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMJ.png"),
42
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJM.png")
43
43
  },
44
44
  // Competitive snapshot
45
45
  '019e5cd9-5ca1-7258-befd-40d1947b7b84': {
46
- light: "".concat(DAM_ASSET_LINK, "/k5cm81s2h7i41d4d6832n67c2m767h6t.png"),
47
- dark: "".concat(DAM_ASSET_LINK, "/ks38nc26451n7384d52413lck2qhq4e6.png")
46
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMR.png"),
47
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJC.png")
48
48
  },
49
49
  // Criteria rubric
50
50
  '019e5cd9-5ca1-7258-befd-84723a493931': {
51
- light: "".concat(DAM_ASSET_LINK, "/n00f5ur678kbqdqjj5e13xpij6u3kkuq.png"),
52
- dark: "".concat(DAM_ASSET_LINK, "/54k2y2f7n2tpg2n12is326376102c3b5.png")
51
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMA.png"),
52
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ1.png")
53
53
  },
54
54
  // Customer quote
55
55
  '019e5cd9-5ca1-7258-befd-5fcf6165870f': {
56
- light: "".concat(DAM_ASSET_LINK, "/k8q5l4htp63652mhw572ed6chren37mv.png"),
57
- dark: "".concat(DAM_ASSET_LINK, "/y0leijw14xp7mdpi3265xn0d5ymo5lfm.png")
56
+ light: "".concat(DAM_CDN_LINK, "/AT12OVLF.png"),
57
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJK.png")
58
58
  },
59
59
  // Decision log
60
60
  '019e5cd9-5ca1-7258-befd-30c6e8712ba4': {
61
- light: "".concat(DAM_ASSET_LINK, "/4vuxracm3c33555h1u4ug65q55267574.png"),
62
- dark: "".concat(DAM_ASSET_LINK, "/5445044f626dcb58dbc7s6axr32e4ywl.png")
61
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMT.png"),
62
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ9.png")
63
63
  },
64
64
  // Launch checklist
65
65
  '019e5cd9-5ca1-7258-befd-3ce1c551015e': {
66
- light: "".concat(DAM_ASSET_LINK, "/1o0gj47oprg341fe6iip8fdx8561t54n.png"),
67
- dark: "".concat(DAM_ASSET_LINK, "/lay6kpn21b264q2q8144h3s18uwjud0f.png")
66
+ light: "".concat(DAM_CDN_LINK, "/AT12OVKW.png"),
67
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVHN.png")
68
68
  },
69
69
  // Meeting agenda
70
70
  '019e5cd9-5ca1-7258-befd-47559a8d7cfc': {
71
- light: "".concat(DAM_ASSET_LINK, "/2hn6q5dt118vwyqi438725l141u70fb8.png"),
72
- dark: "".concat(DAM_ASSET_LINK, "/r4l0ydb7ujg4lms6n0wrrnsmsd1x65kw.png")
71
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMU.png"),
72
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJD.png")
73
73
  },
74
74
  // Project status snapshot
75
75
  '019e5cd9-5ca1-7258-befd-2943939d1b79': {
76
- light: "".concat(DAM_ASSET_LINK, "/qk6emfe0oa2260ldt11748672gs65y1l.png"),
77
- dark: "".concat(DAM_ASSET_LINK, "/tt36rsll4cmq4607ik7g2d10fxmysyt4.png")
76
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMO.png"),
77
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJU.png")
78
78
  },
79
79
  // Pros and cons
80
80
  '019e5cd9-5ca1-7258-befd-6db9658d75f4': {
81
- light: "".concat(DAM_ASSET_LINK, "/22078yl6viws8rc3au187m76x07xcu61.png"),
82
- dark: "".concat(DAM_ASSET_LINK, "/4tfd6w50y4yxfh4ks75w5ql04u17n7ub.png")
81
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN5.png"),
82
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVHY.png")
83
83
  },
84
84
  // Quick project update
85
85
  '019e5cd9-5ca1-7258-befd-820ce1acd7a0': {
86
- light: "".concat(DAM_ASSET_LINK, "/i8cfkp8v6716121f0w054g85mkw15wgu.png"),
87
- dark: "".concat(DAM_ASSET_LINK, "/x7a25y5f33ok60871t31e1my5c7880cr.png")
86
+ light: "".concat(DAM_CDN_LINK, "/AT12OVNA.png"),
87
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVI5.png")
88
88
  },
89
89
  // Risks and assumptions
90
90
  '019e5cd9-5ca1-7258-befd-2da95ce98772': {
91
- light: "".concat(DAM_ASSET_LINK, "/yl7w10ms70ptlodhc703f6byo3wf7xty.png"),
92
- dark: "".concat(DAM_ASSET_LINK, "/mn14wqw150cu05w3s358w3f2f1vfgv7r.png")
91
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMQ.png"),
92
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJ7.png")
93
93
  },
94
94
  // Roles and responsibilities matrix
95
95
  '019e5cd9-5ca1-7258-befd-37cd3a06776d': {
96
- light: "".concat(DAM_ASSET_LINK, "/67hs5t8u4t63c4fepm6ho1c4d5u12bed.png"),
97
- dark: "".concat(DAM_ASSET_LINK, "/wj5s3dy5nvb810t87f7x45cie88783h6.png")
96
+ light: "".concat(DAM_CDN_LINK, "/AT12OVM8.png"),
97
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVHG.png")
98
98
  },
99
99
  // Run sheet
100
100
  '019e5cd9-5ca1-7258-befd-4a9979f87235': {
101
- light: "".concat(DAM_ASSET_LINK, "/tt0n285m6jl5lxb46c5v4fn856540351.png"),
102
- dark: "".concat(DAM_ASSET_LINK, "/qcrcqcs14753208xqw1j8r38mgs57w2f.png")
101
+ light: "".concat(DAM_CDN_LINK, "/AT12OVMZ.png"),
102
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJB.png")
103
103
  },
104
104
  // Started → Now
105
105
  '019e5cd9-5ca1-7258-befd-74fb1585da6f': {
106
- light: "".concat(DAM_ASSET_LINK, "/5ggat8yryusxvaqj3o800t8v6hcyh22v.png"),
107
- dark: "".concat(DAM_ASSET_LINK, "/287u8yil1jb1j5p1fih0141h07k2f64w.png")
106
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN8.png"),
107
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVJQ.png")
108
108
  },
109
109
  // Weekly calendar
110
110
  '019e5cd9-5ca1-7258-befd-580c2c95a0a0': {
111
- light: "".concat(DAM_ASSET_LINK, "/na153u604p852n54aji7aj1gf14431o7.png"),
112
- dark: "".concat(DAM_ASSET_LINK, "/sw7m5s5ay718h025c6ed3gaq63orv4gu.png")
111
+ light: "".concat(DAM_CDN_LINK, "/AT12OVN2.png"),
112
+ dark: "".concat(DAM_CDN_LINK, "/AT12OVIJ.png")
113
113
  }
114
114
  };
115
115
  var getSnippetPreviewImageUrls = exports.getSnippetPreviewImageUrls = function getSnippetPreviewImageUrls(snippetKey) {
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useMenuListHeight = useMenuListHeight;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _react = require("react");
10
+ /** Keep the list viewport in sync with measured rows, including short search results. */
11
+ function useMenuListHeight(cache, rowCount, rowKeySignature) {
12
+ var _useState = (0, _react.useState)(function () {
13
+ return Array.from({
14
+ length: rowCount
15
+ }, function (_, index) {
16
+ return cache.rowHeight({
17
+ index: index
18
+ });
19
+ }).reduce(function (sum, value) {
20
+ return sum + value;
21
+ }, 0);
22
+ }),
23
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
24
+ height = _useState2[0],
25
+ setHeight = _useState2[1];
26
+ var frame = (0, _react.useRef)();
27
+ var updateHeight = (0, _react.useCallback)(function () {
28
+ if (frame.current !== undefined) {
29
+ cancelAnimationFrame(frame.current);
30
+ }
31
+ // CellMeasurer updates its cache during commit. Read it after all rows have measured.
32
+ frame.current = requestAnimationFrame(function () {
33
+ frame.current = undefined;
34
+ var total = Array.from({
35
+ length: rowCount
36
+ }, function (_, index) {
37
+ return cache.rowHeight({
38
+ index: index
39
+ });
40
+ }).reduce(function (sum, height) {
41
+ return sum + height;
42
+ }, 0);
43
+ setHeight(total);
44
+ });
45
+ }, [cache, rowCount]);
46
+ (0, _react.useLayoutEffect)(function () {
47
+ updateHeight();
48
+ return function () {
49
+ if (frame.current !== undefined) {
50
+ cancelAnimationFrame(frame.current);
51
+ }
52
+ };
53
+ }, [rowKeySignature, updateHeight]);
54
+ return {
55
+ height: height,
56
+ updateHeight: updateHeight
57
+ };
58
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useMenuPopupSizing = useMenuPopupSizing;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _react = require("react");
10
+ var _bindEventListener = require("bind-event-listener");
11
+ var _rafSchd = _interopRequireDefault(require("raf-schd"));
12
+ var _utils = require("../ui/Popup/utils");
13
+ /** Constrain menu height to the available space; Popup chooses placement. */
14
+ function useMenuPopupSizing(_ref) {
15
+ var target = _ref.target,
16
+ boundariesElement = _ref.boundariesElement,
17
+ scrollableElement = _ref.scrollableElement,
18
+ maxHeight = _ref.maxHeight,
19
+ offset = _ref.offset,
20
+ _ref$isOpen = _ref.isOpen,
21
+ isOpen = _ref$isOpen === void 0 ? true : _ref$isOpen;
22
+ var _useState = (0, _react.useState)(maxHeight),
23
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
24
+ height = _useState2[0],
25
+ setHeight = _useState2[1];
26
+ (0, _react.useLayoutEffect)(function () {
27
+ var view = target === null || target === void 0 ? void 0 : target.ownerDocument.defaultView;
28
+ if (!target || !view || !isOpen) {
29
+ return;
30
+ }
31
+ var boundary = boundariesElement || target.ownerDocument.body;
32
+ var scrollParent = scrollableElement || (0, _utils.findOverflowScrollParent)(target);
33
+ var update = function update() {
34
+ var rect = target.getBoundingClientRect();
35
+ var bounds = boundary.getBoundingClientRect();
36
+ var above = Math.max(0, rect.top - (bounds.top - boundary.scrollTop) - offset);
37
+ var below = Math.max(0, bounds.bottom - rect.bottom - offset);
38
+ var space = below >= maxHeight ? below : Math.max(above, below);
39
+ // Popup rounds its position up to a CSS pixel. Reserve that pixel at the edge.
40
+ var available = Math.max(0, Math.floor(space) - 1);
41
+ setHeight(Math.min(maxHeight, available));
42
+ };
43
+ var schedule = (0, _rafSchd.default)(update);
44
+ update();
45
+ var unbindResize = (0, _bindEventListener.bind)(view, {
46
+ type: 'resize',
47
+ listener: schedule
48
+ });
49
+ var unbindScroll = scrollParent ? (0, _bindEventListener.bind)(scrollParent, {
50
+ type: 'scroll',
51
+ listener: schedule
52
+ }) : undefined;
53
+ return function () {
54
+ unbindResize();
55
+ unbindScroll === null || unbindScroll === void 0 || unbindScroll();
56
+ schedule.cancel();
57
+ };
58
+ }, [target, boundariesElement, scrollableElement, maxHeight, offset, isOpen]);
59
+ return height;
60
+ }
@@ -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 = "125.2.1";
27
+ var packageVersion = "125.3.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -61,6 +61,7 @@ function MentionWithProfileCard(_ref) {
61
61
  ssrPlaceholderId = _ref.ssrPlaceholderId,
62
62
  userType = _ref.userType;
63
63
  var cloudId = profilecardProvider.cloudId,
64
+ renderAgentMentionCard = profilecardProvider.renderAgentMentionCard,
64
65
  renderUserMentionCard = profilecardProvider.renderUserMentionCard,
65
66
  resourceClient = profilecardProvider.resourceClient;
66
67
  var actions = (0, _react.useMemo)(function () {
@@ -85,6 +86,13 @@ function MentionWithProfileCard(_ref) {
85
86
 
86
87
  // Agent mentions (userType 'APP') open the Rovo agent profile card on click.
87
88
  if (userType === 'APP' && cloudId && (0, _isExperimentEnabled.isExperimentEnabled)('rovo_chat_mention_agents')) {
89
+ if (renderAgentMentionCard) {
90
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderAgentMentionCard({
91
+ accountId: id,
92
+ children: mention,
93
+ cloudId: cloudId
94
+ }));
95
+ }
88
96
  return /*#__PURE__*/_react.default.createElement(AgentProfileCardTrigger, {
89
97
  agentId: id,
90
98
  agentIdType: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_comment_mention_card_fixes') ? 'identity' : undefined,
@@ -1,10 +1,11 @@
1
1
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
2
  import { buildAction } from './manifest-helpers';
3
3
  export function buildMenuItem(manifest, extensionModule) {
4
- var _extensionModule$cate, _ref, _extensionModule$app;
4
+ var _extensionModule$prev, _extensionModule$cate, _ref, _extensionModule$app;
5
5
  const title = extensionModule.title || manifest.title;
6
6
  const key = `${manifest.key}:${extensionModule.key}`;
7
7
  const node = buildAction(extensionModule.action, manifest);
8
+ const preview = (_extensionModule$prev = extensionModule.preview) !== null && _extensionModule$prev !== void 0 ? _extensionModule$prev : manifest.preview;
8
9
  const category = isExperimentEnabled('platform_editor_slash_command') ? (_extensionModule$cate = extensionModule.category) !== null && _extensionModule$cate !== void 0 ? _extensionModule$cate : manifest.category : undefined;
9
10
  if (!node) {
10
11
  throw new Error(`Couldn't find any action for ${title} (${key})`);
@@ -31,6 +32,9 @@ export function buildMenuItem(manifest, extensionModule) {
31
32
  summary: manifest.summary,
32
33
  documentationUrl: manifest.documentationUrl,
33
34
  priority: extensionModule.priority,
35
+ ...(preview != null && {
36
+ preview
37
+ }),
34
38
  ...(extensionModule.lozenge != null && {
35
39
  lozenge: extensionModule.lozenge
36
40
  }),
@@ -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 = "125.2.1";
16
+ const packageVersion = "125.3.0";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -1,7 +1,6 @@
1
1
  ._11c8wadc{font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
2
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
3
  ._2rko1mok{border-radius:var(--ds-radius-large,8px)}
4
- ._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
5
4
  ._189ee4h9{border-width:var(--ds-border-width,1px)}
6
5
  ._18zr1b66{padding-inline:var(--ds-space-050,4px)}
7
6
  ._1dqonqa1{border-style:solid}
@@ -1,9 +1,7 @@
1
1
  /* CompactQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  import "./CompactQuickInsertMenuItem.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
- import React, { useState } from 'react';
5
- import ButtonItem from '@atlaskit/menu/button-item';
6
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
4
+ import React, { useId, useMemo, useState } from 'react';
7
5
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- Compiled primitives do not provide Pressable.
8
6
  import { Pressable, xcss } from '@atlaskit/primitives';
9
7
  import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
@@ -13,7 +11,6 @@ import { useQuickInsertContext } from './useQuickInsertContext';
13
11
  const styles = {
14
12
  iconContainer: "_4cvr1h6o _1e0c1txw _1o9zidpf _1bah1h6o _1tke1tcg _1ul91tcg",
15
13
  content: "_16jlkb7n _1o9zkb7n _i0dlidpf _1ul9idpf",
16
- icon: "_2rko1qi0 _1reo15vq _18m915vq _1h6d1l7x _1dqonqa1 _189ee4h9 _4cvr1h6o _bfhk1bhr _1e0c1txw _4t3izwfg _1bah1h6o _1bsbzwfg",
17
14
  iconLarge: "_2rko1mok _1reo15vq _18m915vq _1h6d1l7x _1dqonqa1 _189ee4h9 _4cvr1h6o _bfhk1bhr _1e0c1txw _4t3izwfg _1bah1h6o _1bsbzwfg",
18
15
  shortcut: "_2rko12b0 _11c8wadc _1rjcv77o _18zr1b66 _bfhki8nm _syazazsu"
19
16
  };
@@ -72,14 +69,18 @@ const disabledItemStyles = xcss({
72
69
  });
73
70
  export const CompactQuickInsertMenuItem = ({
74
71
  ariaLabel,
72
+ description,
75
73
  iconBefore,
76
74
  isDisabled,
77
75
  onSelect,
76
+ preview,
78
77
  previewImageUrls,
79
78
  shortcut,
79
+ shouldShowPreview = true,
80
80
  shouldWrapIcon = true,
81
81
  title
82
82
  }) => {
83
+ var _ref, _resolvedPreview$imag, _resolvedPreview$imag2, _resolvedPreview$attr;
83
84
  const {
84
85
  item
85
86
  } = useQuickInsertContext();
@@ -90,35 +91,22 @@ export const CompactQuickInsertMenuItem = ({
90
91
  id: undefined,
91
92
  isSelected: false
92
93
  };
94
+ const resolvedDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
95
+ const previewId = useId();
93
96
  const handleClick = useQuickInsertMenuItemSelection(onSelect);
94
97
  const [referenceElement, setReferenceElement] = useState(null);
95
- if (!isExperimentEnabled('platform_editor_slash_command')) {
96
- const wrappedIcon = iconBefore && shouldWrapIcon ? /*#__PURE__*/React.createElement(Box, {
97
- xcss: styles.icon
98
- }, iconBefore) : iconBefore;
99
- return /*#__PURE__*/React.createElement(ButtonItem, {
100
- "aria-label": ariaLabel,
101
- "aria-selected": isSelected,
102
- iconBefore: wrappedIcon,
103
- id: id,
104
- isDisabled: isDisabled,
105
- isSelected: isSelected,
106
- onClick: handleClick,
107
- role: "option"
108
- }, /*#__PURE__*/React.createElement(Inline, {
109
- alignBlock: "center",
110
- spread: "space-between"
111
- }, /*#__PURE__*/React.createElement(Text, null, title), shortcut && /*#__PURE__*/React.createElement(Box, {
112
- as: "span",
113
- xcss: styles.shortcut
114
- }, shortcut)));
115
- }
98
+ const resolvedPreview = useMemo(() => preview !== null && preview !== void 0 ? preview : previewImageUrls ? {
99
+ image: previewImageUrls
100
+ } : {}, [preview, previewImageUrls]);
101
+ const shouldRenderPreview = shouldShowPreview && isSelected && !isDisabled;
102
+ const hasAccessiblePreview = Boolean(resolvedDescription || (resolvedPreview === null || resolvedPreview === void 0 ? void 0 : resolvedPreview.attribution));
116
103
  const wrappedIcon = iconBefore && shouldWrapIcon ? /*#__PURE__*/React.createElement(Box, {
117
104
  xcss: styles.iconLarge
118
105
  }, iconBefore) : iconBefore;
119
106
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pressable, {
120
107
  ref: setReferenceElement,
121
108
  "aria-label": ariaLabel,
109
+ "aria-describedby": shouldRenderPreview && hasAccessiblePreview ? previewId : undefined,
122
110
  "aria-selected": isSelected,
123
111
  id: id,
124
112
  isDisabled: isDisabled,
@@ -134,9 +122,12 @@ export const CompactQuickInsertMenuItem = ({
134
122
  }, /*#__PURE__*/React.createElement(Text, null, title), shortcut && /*#__PURE__*/React.createElement(Box, {
135
123
  as: "span",
136
124
  xcss: styles.shortcut
137
- }, shortcut))), isSelected && !isDisabled && (previewImageUrls === null || previewImageUrls === void 0 ? void 0 : previewImageUrls.light) && referenceElement && /*#__PURE__*/React.createElement(QuickInsertHoverPreview, {
138
- key: previewImageUrls.light,
139
- previewImageUrls: previewImageUrls,
140
- referenceElement: referenceElement
125
+ }, shortcut))), shouldRenderPreview && referenceElement && /*#__PURE__*/React.createElement(QuickInsertHoverPreview, {
126
+ key: (_ref = (_resolvedPreview$imag = (_resolvedPreview$imag2 = resolvedPreview.image) === null || _resolvedPreview$imag2 === void 0 ? void 0 : _resolvedPreview$imag2.light) !== null && _resolvedPreview$imag !== void 0 ? _resolvedPreview$imag : (_resolvedPreview$attr = resolvedPreview.attribution) === null || _resolvedPreview$attr === void 0 ? void 0 : _resolvedPreview$attr.name) !== null && _ref !== void 0 ? _ref : title,
127
+ id: previewId,
128
+ description: resolvedDescription,
129
+ preview: resolvedPreview,
130
+ referenceElement: referenceElement,
131
+ title: title
141
132
  }));
142
133
  };
@@ -1,4 +1,45 @@
1
+ ._11c81qyo{font:var(--ds-font-heading-xsmall,normal 653 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
+ ._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
3
+ ._11c8wadc{font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
4
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
5
+ ._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
6
+ ._zulp1b66{gap:var(--ds-space-050,4px)}
7
+ ._zulpu2gc{gap:var(--ds-space-100,8px)}
8
+ ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
9
+ ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}
10
+ ._16jlidpf{flex-grow:0}
11
+ ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
12
+ ._18m915vq{overflow-y:hidden}
13
+ ._1bah1h6o{justify-content:center}
14
+ ._1bsb1osq{width:100%}
15
+ ._1bsb7vkz{width:1pc}
16
+ ._1bsbncxg{width:264px}
17
+ ._1bsbp3fh{width:15pc}
18
+ ._1e0c1txw{display:flex}
1
19
  ._1e0c1ule{display:block}
20
+ ._1e0ccj1k{display:-webkit-box}
21
+ ._1i4qfg65{overflow-wrap:anywhere}
22
+ ._1o9zidpf{flex-shrink:0}
2
23
  ._1pby16oo{z-index:510}
24
+ ._1reo15vq{overflow-x:hidden}
25
+ ._1yyjcs5v{-webkit-line-clamp:2}
26
+ ._1yyjegat{-webkit-line-clamp:4}
27
+ ._2lx21bp4{flex-direction:column}
3
28
  ._3um015vq{visibility:hidden}
4
- ._3um0ewfl{visibility:visible}
29
+ ._4cvr1h6o{align-items:center}
30
+ ._4t3i1osq{height:100%}
31
+ ._4t3i68cl{height:90pt}
32
+ ._4t3i7vkz{height:1pc}
33
+ ._5ral1f51{object-fit:contain}
34
+ ._6rthu2gc{margin-block-end:var(--ds-space-100,8px)}
35
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
36
+ ._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
37
+ ._c71l1kw7{max-height:inherit}
38
+ ._c71lk6is{max-height:calc(100vh - 1pc)}
39
+ ._i0dlexct{flex-basis:16px}
40
+ ._p12f1oec{max-width:calc(100vw - 1pc)}
41
+ ._p12f1osq{max-width:100%}
42
+ ._sudp1e54{-webkit-box-orient:vertical}
43
+ ._syazazsu{color:var(--ds-text-subtle,#505258)}
44
+ ._syazi7uo{color:var(--ds-text,#292a2e)}
45
+ ._vchhusvi{box-sizing:border-box}