@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
|
@@ -135,5 +135,35 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
135
135
|
id: 'editor-common.quick-insert.categoryOther',
|
|
136
136
|
defaultMessage: 'Other',
|
|
137
137
|
description: 'Other items in the Quick Insert menu.'
|
|
138
|
+
},
|
|
139
|
+
previewAttributionBy: {
|
|
140
|
+
id: 'editor-common.quick-insert.previewAttributionBy',
|
|
141
|
+
defaultMessage: 'By {name}',
|
|
142
|
+
description: 'Attribution shown in a Quick Insert item preview.'
|
|
143
|
+
},
|
|
144
|
+
previewAttributionAtlassian: {
|
|
145
|
+
id: 'editor-common.quick-insert.previewAttributionAtlassian.ai-non-final',
|
|
146
|
+
defaultMessage: 'Atlassian',
|
|
147
|
+
description: 'Atlassian company name shown as the creator in a slash-command preview attribution.'
|
|
148
|
+
},
|
|
149
|
+
previewAttributionAssets: {
|
|
150
|
+
id: 'editor-common.quick-insert.previewAttributionAssets.ai-non-final',
|
|
151
|
+
defaultMessage: 'Assets',
|
|
152
|
+
description: 'Assets product name shown as the creator in a slash-command preview attribution.'
|
|
153
|
+
},
|
|
154
|
+
previewAttributionConfluence: {
|
|
155
|
+
id: 'editor-common.quick-insert.previewAttributionConfluence.ai-non-final',
|
|
156
|
+
defaultMessage: 'Confluence',
|
|
157
|
+
description: 'Confluence product name shown as the creator in a slash-command preview attribution.'
|
|
158
|
+
},
|
|
159
|
+
previewAttributionJira: {
|
|
160
|
+
id: 'editor-common.quick-insert.previewAttributionJira.ai-non-final',
|
|
161
|
+
defaultMessage: 'Jira',
|
|
162
|
+
description: 'Jira product name shown as the creator in a slash-command preview attribution.'
|
|
163
|
+
},
|
|
164
|
+
previewAttributionMicrosoft: {
|
|
165
|
+
id: 'editor-common.quick-insert.previewAttributionMicrosoft.ai-non-final',
|
|
166
|
+
defaultMessage: 'Microsoft',
|
|
167
|
+
description: 'Microsoft company name shown as the creator in a slash-command preview attribution.'
|
|
138
168
|
}
|
|
139
169
|
});
|
|
@@ -4,112 +4,112 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getSnippetPreviewImageUrls = void 0;
|
|
7
|
-
var
|
|
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(
|
|
12
|
-
dark: "".concat(
|
|
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(
|
|
17
|
-
dark: "".concat(
|
|
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(
|
|
22
|
-
dark: "".concat(
|
|
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(
|
|
27
|
-
dark: "".concat(
|
|
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(
|
|
32
|
-
dark: "".concat(
|
|
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(
|
|
37
|
-
dark: "".concat(
|
|
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(
|
|
42
|
-
dark: "".concat(
|
|
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(
|
|
47
|
-
dark: "".concat(
|
|
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(
|
|
52
|
-
dark: "".concat(
|
|
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(
|
|
57
|
-
dark: "".concat(
|
|
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(
|
|
62
|
-
dark: "".concat(
|
|
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(
|
|
67
|
-
dark: "".concat(
|
|
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(
|
|
72
|
-
dark: "".concat(
|
|
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(
|
|
77
|
-
dark: "".concat(
|
|
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(
|
|
82
|
-
dark: "".concat(
|
|
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(
|
|
87
|
-
dark: "".concat(
|
|
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(
|
|
92
|
-
dark: "".concat(
|
|
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(
|
|
97
|
-
dark: "".concat(
|
|
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(
|
|
102
|
-
dark: "".concat(
|
|
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(
|
|
107
|
-
dark: "".concat(
|
|
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(
|
|
112
|
-
dark: "".concat(
|
|
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.
|
|
27
|
+
var packageVersion = "125.4.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,
|
|
@@ -19,6 +19,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
21
21
|
|
|
22
|
+
// oxlint-disable-next-line eslint/no-redeclare
|
|
23
|
+
|
|
22
24
|
/*
|
|
23
25
|
** The context is used to handle the keydown events of submenus.
|
|
24
26
|
** Because the keyboard navigation is explicitly managed for main toolbar items
|
|
@@ -39,6 +39,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
39
39
|
ACTION["DEACTIVATED"] = "deactivated";
|
|
40
40
|
ACTION["DECREMENTED"] = "decremented";
|
|
41
41
|
ACTION["DELETED"] = "deleted";
|
|
42
|
+
ACTION["DISCARD_ALL"] = "discardAll";
|
|
42
43
|
ACTION["DISCARDED_INVALID_STEPS_FROM_TRANSACTION"] = "discardedInvalidStepsFromTransaction";
|
|
43
44
|
ACTION["DISCARDED"] = "discarded";
|
|
44
45
|
/** used in @atlassian/editor-referentiality */
|
|
@@ -62,6 +63,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
62
63
|
ACTION["ENTERED"] = "entered";
|
|
63
64
|
ACTION["ERROR"] = "error";
|
|
64
65
|
ACTION["ERRORED"] = "errored";
|
|
66
|
+
ACTION["EMPTY_STATE_EXPOSED"] = "emptyStateExposed";
|
|
65
67
|
ACTION["EXPERIENCE_MEASURED"] = "experienceMeasured";
|
|
66
68
|
ACTION["EXPERIENCE_SAMPLED"] = "experienceSampled";
|
|
67
69
|
ACTION["EXPOSED"] = "exposed";
|
|
@@ -118,6 +120,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
118
120
|
ACTION["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
|
|
119
121
|
ACTION["REFERENCE_SYNCED_BLOCK_UNSYNC"] = "referenceSyncedBlockUnsync";
|
|
120
122
|
ACTION["REFERENCE_SYNCED_BLOCK_COPY"] = "referenceSyncedBlockCopy";
|
|
123
|
+
ACTION["RIGHT_RAIL_CLOSED"] = "rightRailClosed";
|
|
121
124
|
ACTION["RIGHT_RAIL_VIEWED"] = "rightRailViewed";
|
|
122
125
|
ACTION["REPLACED_ALL"] = "replacedAll";
|
|
123
126
|
ACTION["REPLACED_ONE"] = "replacedOne";
|
|
@@ -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.
|
|
16
|
+
const packageVersion = "125.4.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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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))),
|
|
138
|
-
key:
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
.
|
|
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}
|