@atlaskit/editor-common 125.3.0 → 126.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.
- package/CHANGELOG.md +55 -0
- package/afm-products/tsconfig.json +3 -0
- package/dist/cjs/analytics/types/enums.js +3 -0
- package/dist/cjs/extensions/buildMenuItem.js +6 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +22 -28
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +147 -68
- package/dist/cjs/quick-insert/QuickInsertMenuItem.js +4 -0
- package/dist/cjs/quick-insert/QuickInsertMenuSection.js +11 -4
- package/dist/cjs/quick-insert/confluence-attribution-icon.js +18 -0
- package/dist/cjs/quick-insert/jira-attribution-icon.js +18 -0
- package/dist/cjs/quick-insert/messages.js +30 -0
- package/dist/cjs/quick-insert/preview.js +5 -0
- package/dist/cjs/quick-insert/snippetPreviewImageUrls.js +43 -43
- package/dist/cjs/quick-insert/use-menu-list-height.js +58 -0
- package/dist/cjs/quick-insert/use-menu-popup-sizing.js +60 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +8 -0
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +2 -0
- package/dist/es2019/analytics/types/enums.js +3 -0
- package/dist/es2019/extensions/buildMenuItem.js +5 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +20 -29
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +130 -55
- package/dist/es2019/quick-insert/QuickInsertMenuItem.js +4 -0
- package/dist/es2019/quick-insert/QuickInsertMenuSection.js +11 -4
- package/dist/es2019/quick-insert/confluence-attribution-icon.js +10 -0
- package/dist/es2019/quick-insert/jira-attribution-icon.js +10 -0
- package/dist/es2019/quick-insert/messages.js +30 -0
- package/dist/es2019/quick-insert/preview.js +1 -0
- package/dist/es2019/quick-insert/snippetPreviewImageUrls.js +43 -43
- package/dist/es2019/quick-insert/use-menu-list-height.js +37 -0
- package/dist/es2019/quick-insert/use-menu-popup-sizing.js +49 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +8 -0
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -0
- package/dist/esm/analytics/types/enums.js +3 -0
- package/dist/esm/extensions/buildMenuItem.js +6 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +23 -29
- package/dist/esm/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
- package/dist/esm/quick-insert/QuickInsertHoverPreview.js +150 -68
- package/dist/esm/quick-insert/QuickInsertMenuItem.js +4 -0
- package/dist/esm/quick-insert/QuickInsertMenuSection.js +11 -4
- package/dist/esm/quick-insert/confluence-attribution-icon.js +12 -0
- package/dist/esm/quick-insert/jira-attribution-icon.js +12 -0
- package/dist/esm/quick-insert/messages.js +30 -0
- package/dist/esm/quick-insert/preview.js +1 -0
- package/dist/esm/quick-insert/snippetPreviewImageUrls.js +43 -43
- package/dist/esm/quick-insert/use-menu-list-height.js +51 -0
- package/dist/esm/quick-insert/use-menu-popup-sizing.js +53 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -0
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -0
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/types/ai-suggestions-events.d.ts +28 -2
- package/dist/types/analytics/types/enums.d.ts +3 -0
- package/dist/types/extensions/types/extension-manifest.d.ts +5 -0
- package/dist/types/extensions/types/utils.d.ts +2 -0
- package/dist/types/provider-factory/profile-card-provider.d.ts +14 -1
- package/dist/types/provider-factory/quick-insert-provider.d.ts +3 -0
- package/dist/types/quick-insert/CompactQuickInsertMenuItem.d.ts +1 -1
- package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +7 -6
- package/dist/types/quick-insert/QuickInsertMenuItem.d.ts +7 -2
- package/dist/types/quick-insert/confluence-attribution-icon.d.ts +3 -0
- package/dist/types/quick-insert/jira-attribution-icon.d.ts +3 -0
- package/dist/types/quick-insert/messages.d.ts +5 -2
- package/dist/types/quick-insert/preview.d.ts +16 -0
- package/dist/types/quick-insert/use-menu-list-height.d.ts +6 -0
- package/dist/types/quick-insert/use-menu-popup-sizing.d.ts +11 -0
- package/package.json +4 -3
- package/quick-insert/confluence-attribution-icon/package.json +10 -0
- package/quick-insert/jira-attribution-icon/package.json +10 -0
- package/quick-insert/preview/package.json +10 -0
- package/quick-insert/use-menu-list-height/package.json +10 -0
- package/quick-insert/use-menu-popup-sizing/package.json +10 -0
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
var
|
|
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(
|
|
6
|
-
dark: "".concat(
|
|
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(
|
|
11
|
-
dark: "".concat(
|
|
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(
|
|
16
|
-
dark: "".concat(
|
|
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(
|
|
21
|
-
dark: "".concat(
|
|
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(
|
|
26
|
-
dark: "".concat(
|
|
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(
|
|
31
|
-
dark: "".concat(
|
|
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(
|
|
36
|
-
dark: "".concat(
|
|
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(
|
|
41
|
-
dark: "".concat(
|
|
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(
|
|
46
|
-
dark: "".concat(
|
|
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(
|
|
51
|
-
dark: "".concat(
|
|
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(
|
|
56
|
-
dark: "".concat(
|
|
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(
|
|
61
|
-
dark: "".concat(
|
|
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(
|
|
66
|
-
dark: "".concat(
|
|
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(
|
|
71
|
-
dark: "".concat(
|
|
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(
|
|
76
|
-
dark: "".concat(
|
|
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(
|
|
81
|
-
dark: "".concat(
|
|
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(
|
|
86
|
-
dark: "".concat(
|
|
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(
|
|
91
|
-
dark: "".concat(
|
|
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(
|
|
96
|
-
dark: "".concat(
|
|
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(
|
|
101
|
-
dark: "".concat(
|
|
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(
|
|
106
|
-
dark: "".concat(
|
|
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.
|
|
24
|
+
var packageVersion = "125.4.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,
|
|
@@ -11,6 +11,9 @@ import { ELEMENT_BROWSER_ID } from '../../element-browser';
|
|
|
11
11
|
import { fullPageMessages } from '../../messages';
|
|
12
12
|
import { mediaInsertMessages } from '../../messages/media-insert';
|
|
13
13
|
import { EDIT_AREA_ID } from '../../ui';
|
|
14
|
+
|
|
15
|
+
// oxlint-disable-next-line eslint/no-redeclare
|
|
16
|
+
|
|
14
17
|
/*
|
|
15
18
|
** The context is used to handle the keydown events of submenus.
|
|
16
19
|
** Because the keyboard navigation is explicitly managed for main toolbar items
|
|
@@ -59,4 +59,4 @@ export { type NcsSessionStepEventAEP, type NcsSessionStepMetrics, } from './type
|
|
|
59
59
|
export type { BlockMenuEventPayload } from './types/block-menu-events';
|
|
60
60
|
export type { BreakoutEventPayload, BreakoutSupportedNodes } from './types/breakout-events';
|
|
61
61
|
export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, SyncedBlockSSRErrorAEP, } from './types/sync-block-events';
|
|
62
|
-
export type { AiSuggestionsConversationErrorReason, AiSuggestionInteractionPoint, AiSuggestionsEntryPoint, AiSuggestionsEventPayload, AiSuggestionsRightRailEntryPoint, } from './types/ai-suggestions-events';
|
|
62
|
+
export type { AiSuggestionsConversationErrorReason, AiSuggestionInteractionPoint, AiSuggestionsEntryPoint, AiSuggestionsEventPayload, AiSuggestionsEmptyStateType, AiSuggestionsRightRailEntryPoint, } from './types/ai-suggestions-events';
|
|
@@ -19,6 +19,7 @@ export type AiSuggestionsEntryPoint = 'primaryToolbar'
|
|
|
19
19
|
| 'followUpCard';
|
|
20
20
|
export type AiSuggestionInteractionPoint = 'sidebar' | 'card' | 'statusBar';
|
|
21
21
|
export type AiSuggestionsRightRailEntryPoint = 'suggestionsPanel' | 'suggestionsTab' | 'suggestionCard';
|
|
22
|
+
export type AiSuggestionsEmptyStateType = 'initial' | 'noSuggestionsFound' | 'suggestionsResolved';
|
|
22
23
|
export type AiSuggestionsConversationErrorReason = 'agentDeactivated' | 'agentProvisioning' | 'agentExternalConfigReference' | 'conversationSetup' | 'streamError';
|
|
23
24
|
type NoDiffSuggestionAEP = OperationalAEP<ACTION.NO_DIFF_FOUND, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
24
25
|
suggestionType: string;
|
|
@@ -53,30 +54,50 @@ type EntryPointExposureAEP = TrackAEP<ACTION.EXPOSED, ACTION_SUBJECT.AI_SUGGESTI
|
|
|
53
54
|
}, undefined>;
|
|
54
55
|
type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
55
56
|
affectedBlocks: number;
|
|
57
|
+
agentId?: string;
|
|
56
58
|
charactersAdded?: number;
|
|
57
59
|
charactersRemoved?: number;
|
|
60
|
+
hasSources: boolean;
|
|
58
61
|
interactionPoint: AiSuggestionInteractionPoint;
|
|
62
|
+
isDiffHidden: boolean;
|
|
63
|
+
suggestionId: string;
|
|
59
64
|
suggestionType: string;
|
|
60
65
|
}, undefined>;
|
|
61
|
-
type
|
|
66
|
+
type DiscardedSuggestionAttributes = {
|
|
62
67
|
actionKind: string;
|
|
63
68
|
affectedBlocks: number;
|
|
69
|
+
agentId?: string;
|
|
70
|
+
hasSources: boolean;
|
|
64
71
|
interactionPoint: AiSuggestionInteractionPoint;
|
|
72
|
+
suggestionId: string;
|
|
65
73
|
suggestionType: string;
|
|
74
|
+
};
|
|
75
|
+
type CancelSuggestionsAEP = TrackAEP<ACTION.CANCELLED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
76
|
+
interactionPoint: AiSuggestionInteractionPoint;
|
|
77
|
+
}, undefined>;
|
|
78
|
+
type DiscardSuggestionAEP = TrackAEP<ACTION.DISCARDED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, DiscardedSuggestionAttributes, undefined>;
|
|
79
|
+
type DiscardAllSuggestionsAEP = TrackAEP<ACTION.DISCARD_ALL, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
80
|
+
numberOfSuggestions: number;
|
|
81
|
+
suggestionDetails: DiscardedSuggestionAttributes[];
|
|
66
82
|
}, undefined>;
|
|
67
83
|
type DismissSuggestionAEP = TrackAEP<ACTION.DISMISSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
68
84
|
affectedBlocks: number;
|
|
85
|
+
hasSources: boolean;
|
|
69
86
|
interactionPoint: AiSuggestionInteractionPoint;
|
|
87
|
+
suggestionId: string;
|
|
70
88
|
suggestionType: string;
|
|
71
89
|
}, undefined>;
|
|
72
90
|
type ViewSuggestionAEP = TrackAEP<ACTION.VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
73
91
|
actionKind: string;
|
|
74
92
|
affectedBlocks: number;
|
|
93
|
+
agentId?: string;
|
|
75
94
|
blockTypes: string[];
|
|
76
95
|
charactersToAdd?: number;
|
|
77
96
|
charactersToRemove?: number;
|
|
97
|
+
hasSources: boolean;
|
|
78
98
|
interactionPoint: AiSuggestionInteractionPoint;
|
|
79
99
|
suggestionCardCharacterCount: number;
|
|
100
|
+
suggestionId: string;
|
|
80
101
|
suggestionType: string;
|
|
81
102
|
}, undefined>;
|
|
82
103
|
type RightRailViewedAEP = TrackAEP<ACTION.RIGHT_RAIL_VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
@@ -88,11 +109,16 @@ type RightRailViewedAEP = TrackAEP<ACTION.RIGHT_RAIL_VIEWED, ACTION_SUBJECT.AI_S
|
|
|
88
109
|
suggestionType: string;
|
|
89
110
|
}>;
|
|
90
111
|
}, undefined>;
|
|
112
|
+
type RightRailClosedAEP = TrackAEP<ACTION.RIGHT_RAIL_CLOSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, undefined, undefined>;
|
|
91
113
|
type ViewSuggestionReasoningAEP = TrackAEP<ACTION.REASONING_VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
92
114
|
affectedBlocks: number;
|
|
115
|
+
hasSources: boolean;
|
|
93
116
|
interactionPoint: AiSuggestionInteractionPoint;
|
|
94
117
|
reasoningCharacterCount: number;
|
|
95
118
|
suggestionType: string;
|
|
96
119
|
}, undefined>;
|
|
97
|
-
|
|
120
|
+
type EmptyStateExposedAEP = TrackAEP<ACTION.EMPTY_STATE_EXPOSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
|
|
121
|
+
emptyStateType: AiSuggestionsEmptyStateType;
|
|
122
|
+
}, undefined>;
|
|
123
|
+
export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | ConversationErrorAEP | RegenerateSuggestionsErrorAEP | EntryPointClickedAEP | SuggestionsErrorRetryClickedAEP | EntryPointExposureAEP | CancelSuggestionsAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | DiscardAllSuggestionsAEP | DismissSuggestionAEP | ViewSuggestionAEP | RightRailViewedAEP | RightRailClosedAEP | ViewSuggestionReasoningAEP | EmptyStateExposedAEP;
|
|
98
124
|
export {};
|
|
@@ -36,6 +36,7 @@ export declare enum ACTION {
|
|
|
36
36
|
DEACTIVATED = "deactivated",
|
|
37
37
|
DECREMENTED = "decremented",
|
|
38
38
|
DELETED = "deleted",
|
|
39
|
+
DISCARD_ALL = "discardAll",
|
|
39
40
|
DISCARDED_INVALID_STEPS_FROM_TRANSACTION = "discardedInvalidStepsFromTransaction",
|
|
40
41
|
DISCARDED = "discarded",
|
|
41
42
|
/** used in @atlassian/editor-referentiality */
|
|
@@ -59,6 +60,7 @@ export declare enum ACTION {
|
|
|
59
60
|
ENTERED = "entered",
|
|
60
61
|
ERROR = "error",
|
|
61
62
|
ERRORED = "errored",
|
|
63
|
+
EMPTY_STATE_EXPOSED = "emptyStateExposed",
|
|
62
64
|
EXPERIENCE_MEASURED = "experienceMeasured",
|
|
63
65
|
EXPERIENCE_SAMPLED = "experienceSampled",
|
|
64
66
|
EXPOSED = "exposed",
|
|
@@ -115,6 +117,7 @@ export declare enum ACTION {
|
|
|
115
117
|
REFERENCE_SYNCED_BLOCK_UPDATE = "referenceSyncedBlockUpdate",
|
|
116
118
|
REFERENCE_SYNCED_BLOCK_UNSYNC = "referenceSyncedBlockUnsync",
|
|
117
119
|
REFERENCE_SYNCED_BLOCK_COPY = "referenceSyncedBlockCopy",
|
|
120
|
+
RIGHT_RAIL_CLOSED = "rightRailClosed",
|
|
118
121
|
RIGHT_RAIL_VIEWED = "rightRailViewed",
|
|
119
122
|
REPLACED_ALL = "replacedAll",
|
|
120
123
|
REPLACED_ONE = "replacedOne",
|
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
/**
|
|
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;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type MessageDescriptor } from 'react-intl';
|
|
2
|
-
type Messages<Keys extends string> = Record<Keys, MessageDescriptor
|
|
3
|
-
|
|
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 {};
|