@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.
Files changed (81) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/afm-products/tsconfig.json +3 -0
  3. package/dist/cjs/analytics/types/enums.js +3 -0
  4. package/dist/cjs/extensions/buildMenuItem.js +6 -3
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
  7. package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +22 -28
  8. package/dist/cjs/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
  9. package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +147 -68
  10. package/dist/cjs/quick-insert/QuickInsertMenuItem.js +4 -0
  11. package/dist/cjs/quick-insert/QuickInsertMenuSection.js +11 -4
  12. package/dist/cjs/quick-insert/confluence-attribution-icon.js +18 -0
  13. package/dist/cjs/quick-insert/jira-attribution-icon.js +18 -0
  14. package/dist/cjs/quick-insert/messages.js +30 -0
  15. package/dist/cjs/quick-insert/preview.js +5 -0
  16. package/dist/cjs/quick-insert/snippetPreviewImageUrls.js +43 -43
  17. package/dist/cjs/quick-insert/use-menu-list-height.js +58 -0
  18. package/dist/cjs/quick-insert/use-menu-popup-sizing.js +60 -0
  19. package/dist/cjs/ui/DropList/index.js +1 -1
  20. package/dist/cjs/ui/Mention/mention-with-profilecard.js +8 -0
  21. package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +2 -0
  22. package/dist/es2019/analytics/types/enums.js +3 -0
  23. package/dist/es2019/extensions/buildMenuItem.js +5 -1
  24. package/dist/es2019/monitoring/error.js +1 -1
  25. package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
  26. package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +20 -29
  27. package/dist/es2019/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
  28. package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +130 -55
  29. package/dist/es2019/quick-insert/QuickInsertMenuItem.js +4 -0
  30. package/dist/es2019/quick-insert/QuickInsertMenuSection.js +11 -4
  31. package/dist/es2019/quick-insert/confluence-attribution-icon.js +10 -0
  32. package/dist/es2019/quick-insert/jira-attribution-icon.js +10 -0
  33. package/dist/es2019/quick-insert/messages.js +30 -0
  34. package/dist/es2019/quick-insert/preview.js +1 -0
  35. package/dist/es2019/quick-insert/snippetPreviewImageUrls.js +43 -43
  36. package/dist/es2019/quick-insert/use-menu-list-height.js +37 -0
  37. package/dist/es2019/quick-insert/use-menu-popup-sizing.js +49 -0
  38. package/dist/es2019/ui/DropList/index.js +1 -1
  39. package/dist/es2019/ui/Mention/mention-with-profilecard.js +8 -0
  40. package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -0
  41. package/dist/esm/analytics/types/enums.js +3 -0
  42. package/dist/esm/extensions/buildMenuItem.js +6 -3
  43. package/dist/esm/monitoring/error.js +1 -1
  44. package/dist/esm/quick-insert/CompactQuickInsertMenuItem.compiled.css +0 -1
  45. package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +23 -29
  46. package/dist/esm/quick-insert/QuickInsertHoverPreview.compiled.css +42 -1
  47. package/dist/esm/quick-insert/QuickInsertHoverPreview.js +150 -68
  48. package/dist/esm/quick-insert/QuickInsertMenuItem.js +4 -0
  49. package/dist/esm/quick-insert/QuickInsertMenuSection.js +11 -4
  50. package/dist/esm/quick-insert/confluence-attribution-icon.js +12 -0
  51. package/dist/esm/quick-insert/jira-attribution-icon.js +12 -0
  52. package/dist/esm/quick-insert/messages.js +30 -0
  53. package/dist/esm/quick-insert/preview.js +1 -0
  54. package/dist/esm/quick-insert/snippetPreviewImageUrls.js +43 -43
  55. package/dist/esm/quick-insert/use-menu-list-height.js +51 -0
  56. package/dist/esm/quick-insert/use-menu-popup-sizing.js +53 -0
  57. package/dist/esm/ui/DropList/index.js +1 -1
  58. package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -0
  59. package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -0
  60. package/dist/types/analytics/index.d.ts +1 -1
  61. package/dist/types/analytics/types/ai-suggestions-events.d.ts +28 -2
  62. package/dist/types/analytics/types/enums.d.ts +3 -0
  63. package/dist/types/extensions/types/extension-manifest.d.ts +5 -0
  64. package/dist/types/extensions/types/utils.d.ts +2 -0
  65. package/dist/types/provider-factory/profile-card-provider.d.ts +14 -1
  66. package/dist/types/provider-factory/quick-insert-provider.d.ts +3 -0
  67. package/dist/types/quick-insert/CompactQuickInsertMenuItem.d.ts +1 -1
  68. package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +7 -6
  69. package/dist/types/quick-insert/QuickInsertMenuItem.d.ts +7 -2
  70. package/dist/types/quick-insert/confluence-attribution-icon.d.ts +3 -0
  71. package/dist/types/quick-insert/jira-attribution-icon.d.ts +3 -0
  72. package/dist/types/quick-insert/messages.d.ts +5 -2
  73. package/dist/types/quick-insert/preview.d.ts +16 -0
  74. package/dist/types/quick-insert/use-menu-list-height.d.ts +6 -0
  75. package/dist/types/quick-insert/use-menu-popup-sizing.d.ts +11 -0
  76. package/package.json +4 -3
  77. package/quick-insert/confluence-attribution-icon/package.json +10 -0
  78. package/quick-insert/jira-attribution-icon/package.json +10 -0
  79. package/quick-insert/preview/package.json +10 -0
  80. package/quick-insert/use-menu-list-height/package.json +10 -0
  81. package/quick-insert/use-menu-popup-sizing/package.json +10 -0
@@ -2,86 +2,161 @@
2
2
  import "./QuickInsertHoverPreview.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { useState } from 'react';
5
+ import { useLayoutEffect, useState } from 'react';
6
6
  import { createPortal } from 'react-dom';
7
- import { Popper } from '@atlaskit/popper/main';
7
+
8
+ // Viewport calculations and multiline clamping require styles outside @atlaskit/css's schema.
9
+
10
+ import { useIntl } from 'react-intl';
11
+
12
+ // Viewport clamping requires modifiers, which the top-layer adapter does not support.
13
+ import { Popper } from '@atlaskit/popper/react-popper';
14
+ import { Text } from '@atlaskit/primitives/compiled/text';
8
15
  import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
9
- const PREVIEW_WIDTH = 294;
10
- const PREVIEW_OFFSET = [-4, 4];
16
+ import { messages } from './messages';
11
17
  const PREVIEW_MODIFIERS = [{
18
+ name: 'offset',
19
+ options: {
20
+ offset: [0, 4]
21
+ }
22
+ }, {
23
+ name: 'flip',
24
+ options: {
25
+ fallbackPlacements: ['left-start'],
26
+ // Choose the side by horizontal space; vertical overflow is shifted into view.
27
+ altAxis: false,
28
+ padding: 8,
29
+ rootBoundary: 'viewport'
30
+ }
31
+ }, {
12
32
  name: 'preventOverflow',
13
33
  options: {
14
- mainAxis: false
34
+ mainAxis: true,
35
+ altAxis: true,
36
+ tether: false,
37
+ padding: 8,
38
+ rootBoundary: 'viewport'
15
39
  }
16
40
  }];
17
41
  const styles = {
18
- image: "_1e0c1ule _1pby16oo",
19
- hidden: "_3um015vq",
20
- visible: "_3um0ewfl"
42
+ positioner: "_c71lk6is _p12f1oec _1pby16oo",
43
+ panel: "_2rko1qi0 _1reo15vq _18m915vq _1rjcutpp _18zrutpp _vchhusvi _bfhk1bhr _16qs130s _c71l1kw7 _p12f1osq _1bsbncxg",
44
+ content: "_zulpu2gc _1e0c1txw _2lx21bp4",
45
+ title: "_11c81qyo _1reo15vq _18m915vq _syazazsu _1i4qfg65 _1e0ccj1k _sudp1e54 _1yyjcs5v",
46
+ description: "_11c8fhey _1reo15vq _18m915vq _syazi7uo _1e0ccj1k _1i4qfg65 _sudp1e54 _1yyjegat",
47
+ imageArea: "_2rko12b0 _1reo15vq _18m915vq _bfhkhfxm _4t3i68cl _6rthu2gc _p12f1osq _1bsbp3fh",
48
+ image: "_1e0c1ule _4t3i1osq _5ral1f51 _1bsb1osq",
49
+ imageHidden: "_3um015vq",
50
+ attribution: "_11c8wadc _zulp1b66 _4cvr1h6o _syazazsu _1e0c1txw _1i4qfg65",
51
+ attributionIcon: "_16jlidpf _1o9zidpf _i0dlexct _4cvr1h6o _1e0c1txw _4t3i7vkz _1bah1h6o _1bsb7vkz"
21
52
  };
22
53
 
23
- /** A non-interactive visual preview: keep focus and keyboard handling in the editor. */
54
+ /** The selected item's description and attribution are announced through its aria-describedby. */
24
55
  export const QuickInsertHoverPreview = ({
25
- previewImageUrls,
26
- referenceElement
56
+ description,
57
+ id,
58
+ preview,
59
+ referenceElement,
60
+ title
27
61
  }) => {
28
62
  const {
29
63
  colorMode
30
64
  } = useThemeObserver();
31
- const previewImageUrl = colorMode === 'dark' && previewImageUrls.dark ? previewImageUrls.dark : previewImageUrls.light;
32
- return /*#__PURE__*/React.createElement(QuickInsertHoverPreviewImage, {
33
- key: previewImageUrl,
34
- previewImageUrl: previewImageUrl,
35
- referenceElement: referenceElement
36
- });
37
- };
38
- const QuickInsertHoverPreviewImage = ({
39
- previewImageUrl,
40
- referenceElement
41
- }) => {
42
- const [hasFailed, setHasFailed] = useState(false);
43
- const [dimensions, setDimensions] = useState();
44
- if (hasFailed) {
45
- return null;
46
- }
47
-
48
- // Unlike a dialog popup, this decorative preview must not introduce focus or ARIA ownership.
65
+ const imageUrl = preview.image ? colorMode === 'dark' && preview.image.dark ? preview.image.dark : preview.image.light : undefined;
66
+ const hasAccessibleContent = Boolean(description || preview.attribution);
49
67
  return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Popper, {
50
- offset: PREVIEW_OFFSET,
51
68
  placement: "right-start",
52
69
  referenceElement: referenceElement,
53
70
  strategy: "fixed",
54
- shouldFitViewport: true,
55
71
  modifiers: PREVIEW_MODIFIERS
56
72
  }, ({
57
73
  ref,
58
- style
59
- }) => /*#__PURE__*/React.createElement("img", {
74
+ style,
75
+ update
76
+ }) => /*#__PURE__*/React.createElement("div", {
60
77
  ref: ref,
61
- style: {
62
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Popper positioning and intrinsic image dimensions are runtime values.
63
- ...style,
64
- height: dimensions === null || dimensions === void 0 ? void 0 : dimensions.height,
65
- width: dimensions === null || dimensions === void 0 ? void 0 : dimensions.width
66
- },
78
+ style: style,
79
+ className: ax([styles.positioner])
80
+ }, /*#__PURE__*/React.createElement(QuickInsertPreviewPanel, {
81
+ description: description,
82
+ id: hasAccessibleContent ? id : undefined,
83
+ imageUrl: imageUrl,
84
+ preview: preview,
85
+ referenceElement: referenceElement,
86
+ title: title,
87
+ update: update
88
+ }))), referenceElement.ownerDocument.body);
89
+ };
90
+ const QuickInsertPreviewPanel = ({
91
+ description,
92
+ id,
93
+ imageUrl,
94
+ preview,
95
+ referenceElement,
96
+ title,
97
+ update
98
+ }) => {
99
+ var _preview$attribution;
100
+ const {
101
+ formatMessage
102
+ } = useIntl();
103
+ const [panelElement, setPanelElement] = useState(null);
104
+ const AttributionIcon = (_preview$attribution = preview.attribution) === null || _preview$attribution === void 0 ? void 0 : _preview$attribution.icon;
105
+ useLayoutEffect(() => {
106
+ var _referenceElement$own;
107
+ void update();
108
+ const ResizeObserverConstructor = (_referenceElement$own = referenceElement.ownerDocument.defaultView) === null || _referenceElement$own === void 0 ? void 0 : _referenceElement$own.ResizeObserver;
109
+ if (!panelElement || !ResizeObserverConstructor) {
110
+ return;
111
+ }
112
+ const observer = new ResizeObserverConstructor(() => void update());
113
+ observer.observe(panelElement);
114
+ return () => observer.disconnect();
115
+ }, [panelElement, referenceElement, update]);
116
+ return /*#__PURE__*/React.createElement("div", {
117
+ ref: setPanelElement,
118
+ id: id,
119
+ role: id ? 'tooltip' : undefined,
120
+ "data-testid": "quick-insert-preview-panel",
121
+ className: ax([styles.panel])
122
+ }, imageUrl && /*#__PURE__*/React.createElement(PreviewImage, {
123
+ key: imageUrl,
124
+ imageUrl: imageUrl
125
+ }), /*#__PURE__*/React.createElement("div", {
126
+ className: ax([styles.content])
127
+ }, /*#__PURE__*/React.createElement("div", {
128
+ "aria-hidden": "true",
129
+ className: ax([styles.title])
130
+ }, title), description && /*#__PURE__*/React.createElement("div", {
131
+ className: ax([styles.description])
132
+ }, description), preview.attribution && /*#__PURE__*/React.createElement("div", {
133
+ className: ax([styles.attribution])
134
+ }, AttributionIcon && /*#__PURE__*/React.createElement("span", {
135
+ "aria-hidden": "true",
136
+ className: ax([styles.attributionIcon])
137
+ }, /*#__PURE__*/React.createElement(AttributionIcon, null)), /*#__PURE__*/React.createElement(Text, {
138
+ size: "small",
139
+ color: "color.text.subtle"
140
+ }, AttributionIcon ? preview.attribution.name : formatMessage(messages.previewAttributionBy, {
141
+ name: preview.attribution.name
142
+ })))));
143
+ };
144
+ const PreviewImage = ({
145
+ imageUrl
146
+ }) => {
147
+ const [hasFailed, setHasFailed] = useState(false);
148
+ const [hasLoaded, setHasLoaded] = useState(false);
149
+ return /*#__PURE__*/React.createElement("div", {
150
+ "aria-hidden": "true",
151
+ "data-testid": "quick-insert-preview-image-area",
152
+ className: ax([styles.imageArea])
153
+ }, !hasFailed && /*#__PURE__*/React.createElement("img", {
67
154
  "aria-hidden": "true",
68
155
  "data-testid": "quick-insert-hover-preview",
69
- src: previewImageUrl,
156
+ src: imageUrl,
70
157
  alt: "",
71
- onLoad: event => {
72
- const {
73
- naturalHeight,
74
- naturalWidth
75
- } = event.currentTarget;
76
- if (naturalWidth === 0) {
77
- return;
78
- }
79
- setDimensions({
80
- height: naturalHeight / naturalWidth * PREVIEW_WIDTH,
81
- width: PREVIEW_WIDTH
82
- });
83
- },
158
+ onLoad: () => setHasLoaded(true),
84
159
  onError: () => setHasFailed(true),
85
- className: ax([styles.image, dimensions ? styles.visible : styles.hidden])
86
- })), referenceElement.ownerDocument.body);
160
+ className: ax([styles.image, !hasLoaded && styles.imageHidden])
161
+ }));
87
162
  };
@@ -8,8 +8,10 @@ export const QuickInsertMenuItem = ({
8
8
  iconBefore,
9
9
  isDisabled,
10
10
  onSelect,
11
+ preview,
11
12
  previewImageUrls,
12
13
  shortcut,
14
+ shouldShowPreview,
13
15
  shouldWrapIcon,
14
16
  title
15
17
  }) => {
@@ -31,8 +33,10 @@ export const QuickInsertMenuItem = ({
31
33
  iconBefore: iconBefore,
32
34
  isDisabled: isDisabled,
33
35
  onSelect: onSelect,
36
+ preview: preview,
34
37
  previewImageUrls: previewImageUrls,
35
38
  shortcut: shortcut,
39
+ shouldShowPreview: shouldShowPreview,
36
40
  shouldWrapIcon: shouldWrapIcon,
37
41
  title: title
38
42
  });
@@ -1,8 +1,15 @@
1
1
  import React from 'react';
2
- import Section from '@atlaskit/menu/section';
2
+ import HeadingItem from '@atlaskit/menu/heading-item';
3
+ import { Box } from '@atlaskit/primitives/compiled/box';
3
4
  export const QuickInsertMenuSection = ({
4
5
  children,
5
6
  title
6
- }) => /*#__PURE__*/React.createElement(Section, {
7
- title: title
8
- }, children);
7
+ }) => /*#__PURE__*/React.createElement(Box, {
8
+ role: "group",
9
+ "aria-label": title
10
+ }, /*#__PURE__*/React.createElement(Box, {
11
+ paddingBlockStart: "space.150",
12
+ paddingBlockEnd: "space.050"
13
+ }, /*#__PURE__*/React.createElement(HeadingItem, {
14
+ "aria-hidden": true
15
+ }, title)), children);
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { confluenceIcon } from '@atlaskit/logo/raw-icons';
3
+
4
+ /** Decorative product icon accompanying the localized Confluence attribution name. */
5
+ export const ConfluenceAttributionIcon = () => /*#__PURE__*/React.createElement("img", {
6
+ src: confluenceIcon,
7
+ alt: "",
8
+ width: 16,
9
+ height: 16
10
+ });
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { jiraIcon } from '@atlaskit/logo/raw-icons';
3
+
4
+ /** Decorative product icon accompanying the localized Jira attribution name. */
5
+ export const JiraAttributionIcon = () => /*#__PURE__*/React.createElement("img", {
6
+ src: jiraIcon,
7
+ alt: "",
8
+ width: 16,
9
+ height: 16
10
+ });
@@ -129,5 +129,35 @@ export const messages = defineMessages({
129
129
  id: 'editor-common.quick-insert.categoryOther',
130
130
  defaultMessage: 'Other',
131
131
  description: 'Other items in the Quick Insert menu.'
132
+ },
133
+ previewAttributionBy: {
134
+ id: 'editor-common.quick-insert.previewAttributionBy',
135
+ defaultMessage: 'By {name}',
136
+ description: 'Attribution shown in a Quick Insert item preview.'
137
+ },
138
+ previewAttributionAtlassian: {
139
+ id: 'editor-common.quick-insert.previewAttributionAtlassian.ai-non-final',
140
+ defaultMessage: 'Atlassian',
141
+ description: 'Atlassian company name shown as the creator in a slash-command preview attribution.'
142
+ },
143
+ previewAttributionAssets: {
144
+ id: 'editor-common.quick-insert.previewAttributionAssets.ai-non-final',
145
+ defaultMessage: 'Assets',
146
+ description: 'Assets product name shown as the creator in a slash-command preview attribution.'
147
+ },
148
+ previewAttributionConfluence: {
149
+ id: 'editor-common.quick-insert.previewAttributionConfluence.ai-non-final',
150
+ defaultMessage: 'Confluence',
151
+ description: 'Confluence product name shown as the creator in a slash-command preview attribution.'
152
+ },
153
+ previewAttributionJira: {
154
+ id: 'editor-common.quick-insert.previewAttributionJira.ai-non-final',
155
+ defaultMessage: 'Jira',
156
+ description: 'Jira product name shown as the creator in a slash-command preview attribution.'
157
+ },
158
+ previewAttributionMicrosoft: {
159
+ id: 'editor-common.quick-insert.previewAttributionMicrosoft.ai-non-final',
160
+ defaultMessage: 'Microsoft',
161
+ description: 'Microsoft company name shown as the creator in a slash-command preview attribution.'
132
162
  }
133
163
  });
@@ -0,0 +1 @@
1
+ export {};
@@ -1,109 +1,109 @@
1
- const DAM_ASSET_LINK = 'https://dam-cdn.atl.orangelogic.com/AssetLink';
1
+ const DAM_CDN_LINK = 'https://dam-cdn.atl.orangelogic.com/CDNLink';
2
2
  const snippetPreviewImageUrlsByKey = {
3
3
  // Action items
4
4
  '019e5cd9-5ca1-7258-befd-4f50d491bb42': {
5
- light: `${DAM_ASSET_LINK}/qq0503l11x2ub0506p2s046o2ep5gw1w.png`,
6
- dark: `${DAM_ASSET_LINK}/i77e8128ir0e34t8w11mar77ngq53o00.png`
5
+ light: `${DAM_CDN_LINK}/AT12OVLE.png`,
6
+ dark: `${DAM_CDN_LINK}/AT12OVJI.png`
7
7
  },
8
8
  // Bug report
9
9
  '019e5cd9-5ca1-7258-befd-1c3c59b0aa00': {
10
- light: `${DAM_ASSET_LINK}/221f56s64c186314ka8a7uaj7m4di32l.png`,
11
- dark: `${DAM_ASSET_LINK}/1c86e0v3ygh5ct5600luum0w67unpa23.png`
10
+ light: `${DAM_CDN_LINK}/AT12OVMN.png`,
11
+ dark: `${DAM_CDN_LINK}/AT12OVJ6.png`
12
12
  },
13
13
  // Campaign brief
14
14
  '019e5cd9-5ca1-7258-befd-398bb4e40f15': {
15
- light: `${DAM_ASSET_LINK}/55j1ie55ad1nal6t3awxxui52rp47wn1.png`,
16
- dark: `${DAM_ASSET_LINK}/36h5jgou0pw7v532411mbl501b8de4hm.png`
15
+ light: `${DAM_CDN_LINK}/AT12OVMY.png`,
16
+ dark: `${DAM_CDN_LINK}/AT12OVJE.png`
17
17
  },
18
18
  // Colorful layout
19
19
  '019e5cd9-5ca1-7258-befd-53b6eec19427': {
20
- light: `${DAM_ASSET_LINK}/53j8kth40pkysk4rqs64038r4cw2i867.png`,
21
- dark: `${DAM_ASSET_LINK}/k7ofa1q6r10dydey04780514v75j3fvx.png`
20
+ light: `${DAM_CDN_LINK}/AT12OVN6.png`,
21
+ dark: `${DAM_CDN_LINK}/AT12OVIG.png`
22
22
  },
23
23
  // Colorful numbered table
24
24
  '019e5cd9-5ca1-7258-befd-70a282facf16': {
25
- light: `${DAM_ASSET_LINK}/f02n6041opl0rqvbygs2hv162mt6jq3u.png`,
26
- dark: `${DAM_ASSET_LINK}/s63mw28263h0oi8we3x052m7rsw2o1k8.png`
25
+ light: `${DAM_CDN_LINK}/AT12OVN7.png`,
26
+ dark: `${DAM_CDN_LINK}/AT12OVJL.png`
27
27
  },
28
28
  // Colorful summary
29
29
  '019e5cd9-5ca1-7258-befd-7e200502de8e': {
30
- light: `${DAM_ASSET_LINK}/242qv11f2p7y1u461v71glq85x76b5gp.png`,
31
- dark: `${DAM_ASSET_LINK}/jeaj3a8g7x61syy45d73c2223647b14j.png`
30
+ light: `${DAM_CDN_LINK}/AT12OVN4.png`,
31
+ dark: `${DAM_CDN_LINK}/AT12OVIE.png`
32
32
  },
33
33
  // Colorful table
34
34
  '019e5cd9-5ca1-7258-befd-5524d394ba0a': {
35
- light: `${DAM_ASSET_LINK}/8w8571k707dlx556rxr3hs72gs5q4m42.png`,
36
- dark: `${DAM_ASSET_LINK}/wkt55v21i5q520pqxjh31x5g2j8upth4.png`
35
+ light: `${DAM_CDN_LINK}/AT12OVMJ.png`,
36
+ dark: `${DAM_CDN_LINK}/AT12OVJM.png`
37
37
  },
38
38
  // Competitive snapshot
39
39
  '019e5cd9-5ca1-7258-befd-40d1947b7b84': {
40
- light: `${DAM_ASSET_LINK}/k5cm81s2h7i41d4d6832n67c2m767h6t.png`,
41
- dark: `${DAM_ASSET_LINK}/ks38nc26451n7384d52413lck2qhq4e6.png`
40
+ light: `${DAM_CDN_LINK}/AT12OVMR.png`,
41
+ dark: `${DAM_CDN_LINK}/AT12OVJC.png`
42
42
  },
43
43
  // Criteria rubric
44
44
  '019e5cd9-5ca1-7258-befd-84723a493931': {
45
- light: `${DAM_ASSET_LINK}/n00f5ur678kbqdqjj5e13xpij6u3kkuq.png`,
46
- dark: `${DAM_ASSET_LINK}/54k2y2f7n2tpg2n12is326376102c3b5.png`
45
+ light: `${DAM_CDN_LINK}/AT12OVMA.png`,
46
+ dark: `${DAM_CDN_LINK}/AT12OVJ1.png`
47
47
  },
48
48
  // Customer quote
49
49
  '019e5cd9-5ca1-7258-befd-5fcf6165870f': {
50
- light: `${DAM_ASSET_LINK}/k8q5l4htp63652mhw572ed6chren37mv.png`,
51
- dark: `${DAM_ASSET_LINK}/y0leijw14xp7mdpi3265xn0d5ymo5lfm.png`
50
+ light: `${DAM_CDN_LINK}/AT12OVLF.png`,
51
+ dark: `${DAM_CDN_LINK}/AT12OVJK.png`
52
52
  },
53
53
  // Decision log
54
54
  '019e5cd9-5ca1-7258-befd-30c6e8712ba4': {
55
- light: `${DAM_ASSET_LINK}/4vuxracm3c33555h1u4ug65q55267574.png`,
56
- dark: `${DAM_ASSET_LINK}/5445044f626dcb58dbc7s6axr32e4ywl.png`
55
+ light: `${DAM_CDN_LINK}/AT12OVMT.png`,
56
+ dark: `${DAM_CDN_LINK}/AT12OVJ9.png`
57
57
  },
58
58
  // Launch checklist
59
59
  '019e5cd9-5ca1-7258-befd-3ce1c551015e': {
60
- light: `${DAM_ASSET_LINK}/1o0gj47oprg341fe6iip8fdx8561t54n.png`,
61
- dark: `${DAM_ASSET_LINK}/lay6kpn21b264q2q8144h3s18uwjud0f.png`
60
+ light: `${DAM_CDN_LINK}/AT12OVKW.png`,
61
+ dark: `${DAM_CDN_LINK}/AT12OVHN.png`
62
62
  },
63
63
  // Meeting agenda
64
64
  '019e5cd9-5ca1-7258-befd-47559a8d7cfc': {
65
- light: `${DAM_ASSET_LINK}/2hn6q5dt118vwyqi438725l141u70fb8.png`,
66
- dark: `${DAM_ASSET_LINK}/r4l0ydb7ujg4lms6n0wrrnsmsd1x65kw.png`
65
+ light: `${DAM_CDN_LINK}/AT12OVMU.png`,
66
+ dark: `${DAM_CDN_LINK}/AT12OVJD.png`
67
67
  },
68
68
  // Project status snapshot
69
69
  '019e5cd9-5ca1-7258-befd-2943939d1b79': {
70
- light: `${DAM_ASSET_LINK}/qk6emfe0oa2260ldt11748672gs65y1l.png`,
71
- dark: `${DAM_ASSET_LINK}/tt36rsll4cmq4607ik7g2d10fxmysyt4.png`
70
+ light: `${DAM_CDN_LINK}/AT12OVMO.png`,
71
+ dark: `${DAM_CDN_LINK}/AT12OVJU.png`
72
72
  },
73
73
  // Pros and cons
74
74
  '019e5cd9-5ca1-7258-befd-6db9658d75f4': {
75
- light: `${DAM_ASSET_LINK}/22078yl6viws8rc3au187m76x07xcu61.png`,
76
- dark: `${DAM_ASSET_LINK}/4tfd6w50y4yxfh4ks75w5ql04u17n7ub.png`
75
+ light: `${DAM_CDN_LINK}/AT12OVN5.png`,
76
+ dark: `${DAM_CDN_LINK}/AT12OVHY.png`
77
77
  },
78
78
  // Quick project update
79
79
  '019e5cd9-5ca1-7258-befd-820ce1acd7a0': {
80
- light: `${DAM_ASSET_LINK}/i8cfkp8v6716121f0w054g85mkw15wgu.png`,
81
- dark: `${DAM_ASSET_LINK}/x7a25y5f33ok60871t31e1my5c7880cr.png`
80
+ light: `${DAM_CDN_LINK}/AT12OVNA.png`,
81
+ dark: `${DAM_CDN_LINK}/AT12OVI5.png`
82
82
  },
83
83
  // Risks and assumptions
84
84
  '019e5cd9-5ca1-7258-befd-2da95ce98772': {
85
- light: `${DAM_ASSET_LINK}/yl7w10ms70ptlodhc703f6byo3wf7xty.png`,
86
- dark: `${DAM_ASSET_LINK}/mn14wqw150cu05w3s358w3f2f1vfgv7r.png`
85
+ light: `${DAM_CDN_LINK}/AT12OVMQ.png`,
86
+ dark: `${DAM_CDN_LINK}/AT12OVJ7.png`
87
87
  },
88
88
  // Roles and responsibilities matrix
89
89
  '019e5cd9-5ca1-7258-befd-37cd3a06776d': {
90
- light: `${DAM_ASSET_LINK}/67hs5t8u4t63c4fepm6ho1c4d5u12bed.png`,
91
- dark: `${DAM_ASSET_LINK}/wj5s3dy5nvb810t87f7x45cie88783h6.png`
90
+ light: `${DAM_CDN_LINK}/AT12OVM8.png`,
91
+ dark: `${DAM_CDN_LINK}/AT12OVHG.png`
92
92
  },
93
93
  // Run sheet
94
94
  '019e5cd9-5ca1-7258-befd-4a9979f87235': {
95
- light: `${DAM_ASSET_LINK}/tt0n285m6jl5lxb46c5v4fn856540351.png`,
96
- dark: `${DAM_ASSET_LINK}/qcrcqcs14753208xqw1j8r38mgs57w2f.png`
95
+ light: `${DAM_CDN_LINK}/AT12OVMZ.png`,
96
+ dark: `${DAM_CDN_LINK}/AT12OVJB.png`
97
97
  },
98
98
  // Started → Now
99
99
  '019e5cd9-5ca1-7258-befd-74fb1585da6f': {
100
- light: `${DAM_ASSET_LINK}/5ggat8yryusxvaqj3o800t8v6hcyh22v.png`,
101
- dark: `${DAM_ASSET_LINK}/287u8yil1jb1j5p1fih0141h07k2f64w.png`
100
+ light: `${DAM_CDN_LINK}/AT12OVN8.png`,
101
+ dark: `${DAM_CDN_LINK}/AT12OVJQ.png`
102
102
  },
103
103
  // Weekly calendar
104
104
  '019e5cd9-5ca1-7258-befd-580c2c95a0a0': {
105
- light: `${DAM_ASSET_LINK}/na153u604p852n54aji7aj1gf14431o7.png`,
106
- dark: `${DAM_ASSET_LINK}/sw7m5s5ay718h025c6ed3gaq63orv4gu.png`
105
+ light: `${DAM_CDN_LINK}/AT12OVN2.png`,
106
+ dark: `${DAM_CDN_LINK}/AT12OVIJ.png`
107
107
  }
108
108
  };
109
109
  export const getSnippetPreviewImageUrls = snippetKey => Object.prototype.hasOwnProperty.call(snippetPreviewImageUrlsByKey, snippetKey) ? snippetPreviewImageUrlsByKey[snippetKey] : undefined;
@@ -0,0 +1,37 @@
1
+ import { useCallback, useLayoutEffect, useRef, useState } from 'react';
2
+ /** Keep the list viewport in sync with measured rows, including short search results. */
3
+ export function useMenuListHeight(cache, rowCount, rowKeySignature) {
4
+ const [height, setHeight] = useState(() => Array.from({
5
+ length: rowCount
6
+ }, (_, index) => cache.rowHeight({
7
+ index
8
+ })).reduce((sum, value) => sum + value, 0));
9
+ const frame = useRef();
10
+ const updateHeight = useCallback(() => {
11
+ if (frame.current !== undefined) {
12
+ cancelAnimationFrame(frame.current);
13
+ }
14
+ // CellMeasurer updates its cache during commit. Read it after all rows have measured.
15
+ frame.current = requestAnimationFrame(() => {
16
+ frame.current = undefined;
17
+ const total = Array.from({
18
+ length: rowCount
19
+ }, (_, index) => cache.rowHeight({
20
+ index
21
+ })).reduce((sum, height) => sum + height, 0);
22
+ setHeight(total);
23
+ });
24
+ }, [cache, rowCount]);
25
+ useLayoutEffect(() => {
26
+ updateHeight();
27
+ return () => {
28
+ if (frame.current !== undefined) {
29
+ cancelAnimationFrame(frame.current);
30
+ }
31
+ };
32
+ }, [rowKeySignature, updateHeight]);
33
+ return {
34
+ height,
35
+ updateHeight
36
+ };
37
+ }
@@ -0,0 +1,49 @@
1
+ import { useLayoutEffect, useState } from 'react';
2
+ import { bind } from 'bind-event-listener';
3
+ import rafSchedule from 'raf-schd';
4
+ import { findOverflowScrollParent } from '../ui/Popup/utils';
5
+ /** Constrain menu height to the available space; Popup chooses placement. */
6
+ export function useMenuPopupSizing({
7
+ target,
8
+ boundariesElement,
9
+ scrollableElement,
10
+ maxHeight,
11
+ offset,
12
+ isOpen = true
13
+ }) {
14
+ const [height, setHeight] = useState(maxHeight);
15
+ useLayoutEffect(() => {
16
+ const view = target === null || target === void 0 ? void 0 : target.ownerDocument.defaultView;
17
+ if (!target || !view || !isOpen) {
18
+ return;
19
+ }
20
+ const boundary = boundariesElement || target.ownerDocument.body;
21
+ const scrollParent = scrollableElement || findOverflowScrollParent(target);
22
+ const update = () => {
23
+ const rect = target.getBoundingClientRect();
24
+ const bounds = boundary.getBoundingClientRect();
25
+ const above = Math.max(0, rect.top - (bounds.top - boundary.scrollTop) - offset);
26
+ const below = Math.max(0, bounds.bottom - rect.bottom - offset);
27
+ const space = below >= maxHeight ? below : Math.max(above, below);
28
+ // Popup rounds its position up to a CSS pixel. Reserve that pixel at the edge.
29
+ const available = Math.max(0, Math.floor(space) - 1);
30
+ setHeight(Math.min(maxHeight, available));
31
+ };
32
+ const schedule = rafSchedule(update);
33
+ update();
34
+ const unbindResize = bind(view, {
35
+ type: 'resize',
36
+ listener: schedule
37
+ });
38
+ const unbindScroll = scrollParent ? bind(scrollParent, {
39
+ type: 'scroll',
40
+ listener: schedule
41
+ }) : undefined;
42
+ return () => {
43
+ unbindResize();
44
+ unbindScroll === null || unbindScroll === void 0 ? void 0 : unbindScroll();
45
+ schedule.cancel();
46
+ };
47
+ }, [target, boundariesElement, scrollableElement, maxHeight, offset, isOpen]);
48
+ return height;
49
+ }
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags/fg';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "125.2.1";
17
+ const packageVersion = "125.4.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -47,6 +47,7 @@ export default function MentionWithProfileCard({
47
47
  }) {
48
48
  const {
49
49
  cloudId,
50
+ renderAgentMentionCard,
50
51
  renderUserMentionCard,
51
52
  resourceClient
52
53
  } = profilecardProvider;
@@ -70,6 +71,13 @@ export default function MentionWithProfileCard({
70
71
 
71
72
  // Agent mentions (userType 'APP') open the Rovo agent profile card on click.
72
73
  if (userType === 'APP' && cloudId && isExperimentEnabled('rovo_chat_mention_agents')) {
74
+ if (renderAgentMentionCard) {
75
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderAgentMentionCard({
76
+ accountId: id,
77
+ children: mention,
78
+ cloudId
79
+ }));
80
+ }
73
81
  return /*#__PURE__*/React.createElement(AgentProfileCardTrigger, {
74
82
  agentId: id,
75
83
  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
@@ -39,6 +39,7 @@ export var 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 var 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 var 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";