@atlaskit/editor-common 120.12.0 → 120.13.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 (31) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/cjs/extensibility/MultiBodiedExtension/action-api.js +16 -9
  3. package/dist/cjs/messages/block-controls.js +10 -0
  4. package/dist/cjs/monitoring/error.js +1 -1
  5. package/dist/cjs/quick-insert/ElementBrowserQuickInsertMenuItem.js +26 -17
  6. package/dist/cjs/quick-insert/createQuickInsertMatcher.js +16 -4
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/ui/Mention/mention-with-profilecard.js +6 -1
  9. package/dist/cjs/vanilla-tooltip/index.js +3 -1
  10. package/dist/es2019/extensibility/MultiBodiedExtension/action-api.js +16 -9
  11. package/dist/es2019/messages/block-controls.js +10 -0
  12. package/dist/es2019/monitoring/error.js +1 -1
  13. package/dist/es2019/quick-insert/ElementBrowserQuickInsertMenuItem.js +26 -17
  14. package/dist/es2019/quick-insert/createQuickInsertMatcher.js +13 -1
  15. package/dist/es2019/ui/DropList/index.js +1 -1
  16. package/dist/es2019/ui/Mention/mention-with-profilecard.js +6 -1
  17. package/dist/es2019/vanilla-tooltip/index.js +10 -2
  18. package/dist/esm/extensibility/MultiBodiedExtension/action-api.js +16 -9
  19. package/dist/esm/messages/block-controls.js +10 -0
  20. package/dist/esm/monitoring/error.js +1 -1
  21. package/dist/esm/quick-insert/ElementBrowserQuickInsertMenuItem.js +26 -17
  22. package/dist/esm/quick-insert/createQuickInsertMatcher.js +18 -5
  23. package/dist/esm/ui/DropList/index.js +1 -1
  24. package/dist/esm/ui/Mention/mention-with-profilecard.js +6 -1
  25. package/dist/esm/vanilla-tooltip/index.js +3 -1
  26. package/dist/types/messages/block-controls.d.ts +25 -15
  27. package/dist/types/provider-factory/profile-card-provider.d.ts +5 -0
  28. package/dist/types/quick-insert/QuickInsertContext.d.ts +1 -0
  29. package/dist/types/quick-insert/createQuickInsertMatcher.d.ts +12 -3
  30. package/dist/types/vanilla-tooltip/index.d.ts +16 -1
  31. package/package.json +11 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 120.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`5d007e10ca06f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d007e10ca06f) -
8
+ Add collapsible heading behavior, tooltip messaging, and controls behind the
9
+ `platform_editor_collapsible_headings` experiment.
10
+ - [`7a5578f056f2b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7a5578f056f2b) -
11
+ Under `platform_editor_slash_command`, enhance the registry element browser with a responsive
12
+ 968px modal, a clearable search field, category navigation, and responsive item grids. Unselected
13
+ element cards have no border, while selected cards retain their selected border. Item descriptions
14
+ appear below titles when registration metadata supplies one.
15
+ - [`4b796b0158182`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b796b0158182) -
16
+ EDITOR-8561 Render the breakout resize handle tooltip with `VanillaTooltip` behind the
17
+ `platform_editor_use_vanilla_components` experiment, replacing a React tree per resize handle.
18
+ When the experiment is off the tooltip is still rendered with React through the node view portal
19
+ provider.
20
+
21
+ The tooltip is anchored to a zero-height element parked where the pointer entered the rail, rather
22
+ than to the rail itself, which spans the node's full height. This matches the ADS tooltip's
23
+ `position="mouse"`, which latches the cursor position as the tooltip opens and does not move it
24
+ afterwards. The anchor is positioned by `.pm-breakout-resize-tooltip-anchor` in the editor's
25
+ resizer styles, which reads the pointer's offset from a custom property; the rule is inert while
26
+ the experiment is off, because nothing carries the class.
27
+
28
+ On the experiment the tooltip always mounts on the first hover, whatever
29
+ `platform_editor_reduce_event_listener_count` is set to: there is no portal to defer, and the
30
+ handles are built before ProseMirror populates `contentDOM`, so mounting any earlier would label
31
+ the tooltip with a generic "node" rather than the node being resized.
32
+
33
+ `VanillaTooltip` accepts an optional `placement`, forwarded to Popper when the tooltip is
34
+ positioned. Defaults to `top`, so existing callers are unaffected.
35
+
36
+ ## 120.12.1
37
+
38
+ ### Patch Changes
39
+
40
+ - [`43445b6289c3f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/43445b6289c3f) -
41
+ Fix stale ProseMirror selection persisting across MultiBodiedExtension tab switches. Gated behind
42
+ confluence_native_tabs_m15.
43
+ - [`d9b0aa59b7c39`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d9b0aa59b7c39) -
44
+ Fix mention accessibility: the profile-card trigger wrapping an @mention is now prefilled with the
45
+ mention's known identity (display name + account id), so screen readers announce the concrete name
46
+ (e.g. "More information about Jane Smith") instead of the generic "More information about this
47
+ user". Threaded via a new optional prefilledProfileData on RenderUserMentionCard /
48
+ UserProfileCardForMention. Behind the platform_mention_profilecard_accessible_name_exp experiment
49
+ (JRACLOUD-99229).
50
+ - Updated dependencies
51
+
3
52
  ## 120.12.0
4
53
 
5
54
  ### Minor Changes
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _state = require("@atlaskit/editor-prosemirror/state");
12
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
12
13
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
14
  var _analytics = require("../../analytics");
14
15
  var _utils = require("./utils");
@@ -33,7 +34,7 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
33
34
  (0, _utils.sendMBEAnalyticsEvent)(_analytics.ACTION.CHANGE_ACTIVE, node, eventDispatcher);
34
35
  }
35
36
  var selection = (_options$selection = options === null || options === void 0 ? void 0 : options.selection) !== null && _options$selection !== void 0 ? _options$selection : 'none';
36
- if (selection === 'none') {
37
+ if (selection === 'none' && !(0, _isExperimentEnabled.isExperimentEnabled)('confluence_native_tabs_m15')) {
37
38
  return updateActiveChildResult;
38
39
  }
39
40
  var pos = getPos();
@@ -53,16 +54,22 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
53
54
  desiredPos += (possiblyMbeNode === null || possiblyMbeNode === void 0 || (_possiblyMbeNode$cont4 = possiblyMbeNode.content) === null || _possiblyMbeNode$cont4 === void 0 || (_possiblyMbeNode$cont4 = _possiblyMbeNode$cont4.child(i)) === null || _possiblyMbeNode$cont4 === void 0 ? void 0 : _possiblyMbeNode$cont4.nodeSize) || 0;
54
55
  }
55
56
  var targetFrame = possiblyMbeNode.content.child(index);
56
- if (selection === 'start') {
57
- // +1 moves past the extensionFrame opening token; TextSelection.near() finds
58
- // the nearest valid text cursor position from there.
59
- dispatch(state.tr.setSelection(_state.TextSelection.near(state.doc.resolve(desiredPos + 1))));
60
- } else {
61
- // Place cursor at the end of the target frame's content.
62
- // -1 bias searches backward from the frame's closing token.
57
+ if (selection === 'end') {
63
58
  dispatch(state.tr.setSelection(_state.TextSelection.near(state.doc.resolve(desiredPos + targetFrame.nodeSize), -1)));
59
+ editorView.focus();
60
+ } else {
61
+ // for 'start' and 'none' selection place a
62
+ // collapsed cursor at the start of the target frame so the ProseMirror
63
+ // selection always points into the active tab. This prevents stale
64
+ // selections from persisting across tab switches (which causes paste to
65
+ // land in the wrong tab).
66
+ // 'none' intentionally skips editorView.focus() so DOM focus can
67
+ // remain on the tab button for keyboard navigation.
68
+ dispatch(state.tr.setSelection(_state.TextSelection.near(state.doc.resolve(desiredPos + 1))));
69
+ if (selection === 'start') {
70
+ editorView.focus();
71
+ }
64
72
  }
65
- editorView.focus();
66
73
  }
67
74
  return updateActiveChildResult;
68
75
  },
@@ -26,6 +26,16 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
26
26
  defaultMessage: 'Insert',
27
27
  description: 'Label on button to insert content at the current cursor position'
28
28
  },
29
+ collapseSection: {
30
+ id: 'editor-common.messages.block-controls.collapseSection',
31
+ defaultMessage: 'Collapse section',
32
+ description: 'Accessible label for the button that collapses a heading section.'
33
+ },
34
+ expandSection: {
35
+ id: 'editor-common.messages.block-controls.expandSection',
36
+ defaultMessage: 'Expand section',
37
+ description: 'Accessible label for the button that expands a heading section.'
38
+ },
29
39
  moveUp: {
30
40
  id: 'fabric.editor.blockControlMoveUp',
31
41
  defaultMessage: 'Move up',
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
28
28
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
29
29
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
30
30
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
31
- var packageVersion = "120.11.3";
31
+ var packageVersion = "120.12.1";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -11,47 +11,52 @@ var _quickInsertMenuItemUtils = require("./quickInsertMenuItemUtils");
11
11
  var _useQuickInsertContext = require("./useQuickInsertContext");
12
12
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- Compiled primitives do not provide Pressable.
13
13
 
14
- var itemStyles = (0, _primitives.xcss)({
14
+ var borderlessItemStyles = (0, _primitives.xcss)({
15
15
  alignItems: 'start',
16
16
  backgroundColor: 'color.background.neutral.subtle',
17
- borderColor: 'color.border',
18
17
  borderRadius: 'radius.medium',
19
- borderStyle: 'solid',
20
- borderWidth: 'border.width',
21
18
  color: 'color.text',
22
19
  cursor: 'pointer',
23
20
  display: 'flex',
24
21
  gap: 'space.150',
22
+ height: '88px',
25
23
  padding: 'space.150',
26
24
  textAlign: 'start',
27
25
  width: '100%'
28
26
  });
29
- var selectedItemStyles = (0, _primitives.xcss)({
27
+ var borderlessSelectedItemStyles = (0, _primitives.xcss)({
30
28
  alignItems: 'start',
31
29
  backgroundColor: 'color.background.selected',
32
- borderColor: 'color.border.selected',
33
- borderRadius: 'radius.medium',
34
- borderStyle: 'solid',
35
- borderWidth: 'border.width',
30
+ borderRadius: 0,
36
31
  color: 'color.text',
37
32
  cursor: 'pointer',
38
33
  display: 'flex',
39
34
  gap: 'space.150',
35
+ height: '88px',
40
36
  padding: 'space.150',
37
+ position: 'relative',
41
38
  textAlign: 'start',
42
- width: '100%'
39
+ width: '100%',
40
+ '::before': {
41
+ borderInlineStartColor: 'color.border.selected',
42
+ borderInlineStartStyle: 'solid',
43
+ borderInlineStartWidth: 'border.width.selected',
44
+ content: "''",
45
+ insetBlock: 'space.0',
46
+ insetInlineStart: 'space.0',
47
+ pointerEvents: 'none',
48
+ position: 'absolute'
49
+ }
43
50
  });
44
- var disabledItemStyles = (0, _primitives.xcss)({
51
+ var borderlessDisabledItemStyles = (0, _primitives.xcss)({
45
52
  alignItems: 'start',
46
53
  backgroundColor: 'color.background.neutral.subtle',
47
- borderColor: 'color.border',
48
54
  borderRadius: 'radius.medium',
49
- borderStyle: 'solid',
50
- borderWidth: 'border.width',
51
55
  color: 'color.text.disabled',
52
56
  cursor: 'not-allowed',
53
57
  display: 'flex',
54
58
  gap: 'space.150',
59
+ height: '88px',
55
60
  padding: 'space.150',
56
61
  textAlign: 'start',
57
62
  width: '100%'
@@ -99,6 +104,7 @@ var ElementBrowserQuickInsertMenuItem = exports.ElementBrowserQuickInsertMenuIte
99
104
  },
100
105
  id = _ref2.id,
101
106
  isSelected = _ref2.isSelected;
107
+ var itemDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
102
108
  var handleClick = (0, _quickInsertMenuItemUtils.useQuickInsertMenuItemSelection)(onSelect);
103
109
  return /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
104
110
  "aria-label": ariaLabel,
@@ -107,7 +113,7 @@ var ElementBrowserQuickInsertMenuItem = exports.ElementBrowserQuickInsertMenuIte
107
113
  isDisabled: isDisabled,
108
114
  onClick: handleClick,
109
115
  role: "option",
110
- xcss: isDisabled ? disabledItemStyles : isSelected ? selectedItemStyles : itemStyles
116
+ xcss: isDisabled ? borderlessDisabledItemStyles : isSelected ? borderlessSelectedItemStyles : borderlessItemStyles
111
117
  }, iconBefore && shouldWrapIcon ? /*#__PURE__*/_react.default.createElement(_primitives.Box, {
112
118
  xcss: iconStyles
113
119
  }, iconBefore) : iconBefore, /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
@@ -118,11 +124,14 @@ var ElementBrowserQuickInsertMenuItem = exports.ElementBrowserQuickInsertMenuIte
118
124
  spread: "space-between",
119
125
  space: "space.100"
120
126
  }, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
127
+ maxLines: 1,
121
128
  weight: "medium"
122
129
  }, title), shortcut && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
123
130
  as: "span",
124
131
  xcss: shortcutStyles
125
- }, shortcut)), description && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
132
+ }, shortcut)), itemDescription && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
126
133
  xcss: descriptionStyles
127
- }, /*#__PURE__*/_react.default.createElement(_primitives.Text, null, description))));
134
+ }, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
135
+ maxLines: 2
136
+ }, itemDescription))));
128
137
  };
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.createQuickInsertMatcher = void 0;
8
8
  var _fuse = _interopRequireDefault(require("fuse.js"));
9
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
9
10
  var options = {
10
11
  includeScore: true,
11
12
  keys: [{
@@ -26,14 +27,20 @@ var options = {
26
27
  var normalizeScore = function normalizeScore(score) {
27
28
  return Math.min(1, Math.max(0, score !== null && score !== void 0 ? score : 1));
28
29
  };
30
+ var getDescription = function getDescription(matcher, formatMessage) {
31
+ var _getSearchData, _ref;
32
+ return matcher === null || matcher === void 0 || (_getSearchData = (_ref = matcher).getSearchData) === null || _getSearchData === void 0 ? void 0 : _getSearchData.call(_ref, {
33
+ formatMessage: formatMessage
34
+ }).description;
35
+ };
29
36
 
30
37
  /** Creates a cached matcher using consumer-formatted Quick Insert search data. */
31
- var createQuickInsertMatcher = exports.createQuickInsertMatcher = function createQuickInsertMatcher(getSearchData) {
38
+ var _createQuickInsertMatcher = exports.createQuickInsertMatcher = function createQuickInsertMatcher(getSearchData) {
32
39
  var cachedFormatMessage;
33
40
  var fuse;
34
- return function (_ref) {
35
- var formatMessage = _ref.formatMessage,
36
- query = _ref.query;
41
+ var matcher = function matcher(_ref2) {
42
+ var formatMessage = _ref2.formatMessage,
43
+ query = _ref2.query;
37
44
  var normalizedQuery = query.trim();
38
45
  if (!normalizedQuery) {
39
46
  return {
@@ -51,4 +58,9 @@ var createQuickInsertMatcher = exports.createQuickInsertMatcher = function creat
51
58
  score: normalizeScore(result.score)
52
59
  } : null;
53
60
  };
61
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command')) {
62
+ matcher.getSearchData = getSearchData;
63
+ _createQuickInsertMatcher.getDescription = getDescription;
64
+ }
65
+ return matcher;
54
66
  };
@@ -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 = "120.11.3";
27
+ var packageVersion = "120.12.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -92,10 +92,15 @@ function MentionWithProfileCard(_ref) {
92
92
  }
93
93
  if ((0, _fg.fg)('people-teams_migrate-user-profile-card') || (0, _isExperimentEnabled.isExperimentEnabled)('pt_user_profile_card_migration_exp')) {
94
94
  if (renderUserMentionCard) {
95
+ var prefilledProfileData = (0, _isExperimentEnabled.isExperimentEnabled)('platform_mention_profilecard_accessible_name_exp') ? {
96
+ accountId: id,
97
+ name: text.replace(AT_PREFIX_REGEX, '')
98
+ } : undefined;
95
99
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderUserMentionCard({
96
100
  userId: id,
97
101
  cloudId: cloudId,
98
- children: mention
102
+ children: mention,
103
+ prefilledProfileData: prefilledProfileData
99
104
  }));
100
105
  }
101
106
  var _navigateToTeamsApp = (0, _navigation.navigateToTeamsApp)({
@@ -108,6 +108,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
108
108
  * the `onShow` semantics of "@atlaskit/tooltip".
109
109
  */
110
110
  onShow = arguments.length > 6 ? arguments[6] : undefined;
111
+ var placement = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'top';
111
112
  (0, _classCallCheck2.default)(this, VanillaTooltip);
112
113
  (0, _defineProperty2.default)(this, "listeners", []);
113
114
  (0, _defineProperty2.default)(this, "shouldHidePopover", false);
@@ -115,6 +116,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
115
116
  this.trigger = trigger;
116
117
  this.timeout = timeout;
117
118
  this.onShow = onShow;
119
+ this.placement = placement;
118
120
  // Created in the trigger's own document rather than the global one, so nothing depends on
119
121
  // the parent realm when the editor renders inside an iframe. Gated alongside the Escape
120
122
  // listener's window so the whole iframe fix moves as a single unit.
@@ -198,7 +200,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
198
200
  key: "createPopperInstance",
199
201
  value: function createPopperInstance() {
200
202
  this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
201
- placement: 'top',
203
+ placement: this.placement,
202
204
  modifiers: [startingOffset]
203
205
  });
204
206
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
3
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { ACTION } from '../../analytics';
5
6
  import { sendMBEAnalyticsEvent } from './utils';
@@ -25,7 +26,7 @@ export const useMultiBodiedExtensionActions = ({
25
26
  sendMBEAnalyticsEvent(ACTION.CHANGE_ACTIVE, node, eventDispatcher);
26
27
  }
27
28
  const selection = (_options$selection = options === null || options === void 0 ? void 0 : options.selection) !== null && _options$selection !== void 0 ? _options$selection : 'none';
28
- if (selection === 'none') {
29
+ if (selection === 'none' && !isExperimentEnabled('confluence_native_tabs_m15')) {
29
30
  return updateActiveChildResult;
30
31
  }
31
32
  const pos = getPos();
@@ -45,16 +46,22 @@ export const useMultiBodiedExtensionActions = ({
45
46
  desiredPos += (possiblyMbeNode === null || possiblyMbeNode === void 0 ? void 0 : (_possiblyMbeNode$cont4 = possiblyMbeNode.content) === null || _possiblyMbeNode$cont4 === void 0 ? void 0 : (_possiblyMbeNode$cont5 = _possiblyMbeNode$cont4.child(i)) === null || _possiblyMbeNode$cont5 === void 0 ? void 0 : _possiblyMbeNode$cont5.nodeSize) || 0;
46
47
  }
47
48
  const targetFrame = possiblyMbeNode.content.child(index);
48
- if (selection === 'start') {
49
- // +1 moves past the extensionFrame opening token; TextSelection.near() finds
50
- // the nearest valid text cursor position from there.
51
- dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(desiredPos + 1))));
52
- } else {
53
- // Place cursor at the end of the target frame's content.
54
- // -1 bias searches backward from the frame's closing token.
49
+ if (selection === 'end') {
55
50
  dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(desiredPos + targetFrame.nodeSize), -1)));
51
+ editorView.focus();
52
+ } else {
53
+ // for 'start' and 'none' selection place a
54
+ // collapsed cursor at the start of the target frame so the ProseMirror
55
+ // selection always points into the active tab. This prevents stale
56
+ // selections from persisting across tab switches (which causes paste to
57
+ // land in the wrong tab).
58
+ // 'none' intentionally skips editorView.focus() so DOM focus can
59
+ // remain on the tab button for keyboard navigation.
60
+ dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(desiredPos + 1))));
61
+ if (selection === 'start') {
62
+ editorView.focus();
63
+ }
56
64
  }
57
- editorView.focus();
58
65
  }
59
66
  return updateActiveChildResult;
60
67
  },
@@ -20,6 +20,16 @@ export const messages = defineMessages({
20
20
  defaultMessage: 'Insert',
21
21
  description: 'Label on button to insert content at the current cursor position'
22
22
  },
23
+ collapseSection: {
24
+ id: 'editor-common.messages.block-controls.collapseSection',
25
+ defaultMessage: 'Collapse section',
26
+ description: 'Accessible label for the button that collapses a heading section.'
27
+ },
28
+ expandSection: {
29
+ id: 'editor-common.messages.block-controls.expandSection',
30
+ defaultMessage: 'Expand section',
31
+ description: 'Accessible label for the button that expands a heading section.'
32
+ },
23
33
  moveUp: {
24
34
  id: 'fabric.editor.blockControlMoveUp',
25
35
  defaultMessage: 'Move up',
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
14
14
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
15
15
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
16
16
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
17
- const packageVersion = "120.11.3";
17
+ const packageVersion = "120.12.1";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -4,47 +4,52 @@ import React from 'react';
4
4
  import { Box, Inline, Pressable, Stack, Text, xcss } from '@atlaskit/primitives';
5
5
  import { useQuickInsertMenuItemSelection } from './quickInsertMenuItemUtils';
6
6
  import { useQuickInsertContext } from './useQuickInsertContext';
7
- const itemStyles = xcss({
7
+ const borderlessItemStyles = xcss({
8
8
  alignItems: 'start',
9
9
  backgroundColor: 'color.background.neutral.subtle',
10
- borderColor: 'color.border',
11
10
  borderRadius: 'radius.medium',
12
- borderStyle: 'solid',
13
- borderWidth: 'border.width',
14
11
  color: 'color.text',
15
12
  cursor: 'pointer',
16
13
  display: 'flex',
17
14
  gap: 'space.150',
15
+ height: '88px',
18
16
  padding: 'space.150',
19
17
  textAlign: 'start',
20
18
  width: '100%'
21
19
  });
22
- const selectedItemStyles = xcss({
20
+ const borderlessSelectedItemStyles = xcss({
23
21
  alignItems: 'start',
24
22
  backgroundColor: 'color.background.selected',
25
- borderColor: 'color.border.selected',
26
- borderRadius: 'radius.medium',
27
- borderStyle: 'solid',
28
- borderWidth: 'border.width',
23
+ borderRadius: 0,
29
24
  color: 'color.text',
30
25
  cursor: 'pointer',
31
26
  display: 'flex',
32
27
  gap: 'space.150',
28
+ height: '88px',
33
29
  padding: 'space.150',
30
+ position: 'relative',
34
31
  textAlign: 'start',
35
- width: '100%'
32
+ width: '100%',
33
+ '::before': {
34
+ borderInlineStartColor: 'color.border.selected',
35
+ borderInlineStartStyle: 'solid',
36
+ borderInlineStartWidth: 'border.width.selected',
37
+ content: "''",
38
+ insetBlock: 'space.0',
39
+ insetInlineStart: 'space.0',
40
+ pointerEvents: 'none',
41
+ position: 'absolute'
42
+ }
36
43
  });
37
- const disabledItemStyles = xcss({
44
+ const borderlessDisabledItemStyles = xcss({
38
45
  alignItems: 'start',
39
46
  backgroundColor: 'color.background.neutral.subtle',
40
- borderColor: 'color.border',
41
47
  borderRadius: 'radius.medium',
42
- borderStyle: 'solid',
43
- borderWidth: 'border.width',
44
48
  color: 'color.text.disabled',
45
49
  cursor: 'not-allowed',
46
50
  display: 'flex',
47
51
  gap: 'space.150',
52
+ height: '88px',
48
53
  padding: 'space.150',
49
54
  textAlign: 'start',
50
55
  width: '100%'
@@ -94,6 +99,7 @@ export const ElementBrowserQuickInsertMenuItem = ({
94
99
  id: undefined,
95
100
  isSelected: false
96
101
  };
102
+ const itemDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
97
103
  const handleClick = useQuickInsertMenuItemSelection(onSelect);
98
104
  return /*#__PURE__*/React.createElement(Pressable, {
99
105
  "aria-label": ariaLabel,
@@ -102,7 +108,7 @@ export const ElementBrowserQuickInsertMenuItem = ({
102
108
  isDisabled: isDisabled,
103
109
  onClick: handleClick,
104
110
  role: "option",
105
- xcss: isDisabled ? disabledItemStyles : isSelected ? selectedItemStyles : itemStyles
111
+ xcss: isDisabled ? borderlessDisabledItemStyles : isSelected ? borderlessSelectedItemStyles : borderlessItemStyles
106
112
  }, iconBefore && shouldWrapIcon ? /*#__PURE__*/React.createElement(Box, {
107
113
  xcss: iconStyles
108
114
  }, iconBefore) : iconBefore, /*#__PURE__*/React.createElement(Stack, {
@@ -113,11 +119,14 @@ export const ElementBrowserQuickInsertMenuItem = ({
113
119
  spread: "space-between",
114
120
  space: "space.100"
115
121
  }, /*#__PURE__*/React.createElement(Text, {
122
+ maxLines: 1,
116
123
  weight: "medium"
117
124
  }, title), shortcut && /*#__PURE__*/React.createElement(Box, {
118
125
  as: "span",
119
126
  xcss: shortcutStyles
120
- }, shortcut)), description && /*#__PURE__*/React.createElement(Box, {
127
+ }, shortcut)), itemDescription && /*#__PURE__*/React.createElement(Box, {
121
128
  xcss: descriptionStyles
122
- }, /*#__PURE__*/React.createElement(Text, null, description))));
129
+ }, /*#__PURE__*/React.createElement(Text, {
130
+ maxLines: 2
131
+ }, itemDescription))));
123
132
  };
@@ -1,4 +1,5 @@
1
1
  import Fuse from 'fuse.js';
2
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
3
  const options = {
3
4
  includeScore: true,
4
5
  keys: [{
@@ -17,12 +18,18 @@ const options = {
17
18
  threshold: 0.3
18
19
  };
19
20
  const normalizeScore = score => Math.min(1, Math.max(0, score !== null && score !== void 0 ? score : 1));
21
+ const getDescription = (matcher, formatMessage) => {
22
+ var _getSearchData, _ref;
23
+ return matcher === null || matcher === void 0 ? void 0 : (_getSearchData = (_ref = matcher).getSearchData) === null || _getSearchData === void 0 ? void 0 : _getSearchData.call(_ref, {
24
+ formatMessage
25
+ }).description;
26
+ };
20
27
 
21
28
  /** Creates a cached matcher using consumer-formatted Quick Insert search data. */
22
29
  export const createQuickInsertMatcher = getSearchData => {
23
30
  let cachedFormatMessage;
24
31
  let fuse;
25
- return ({
32
+ const matcher = ({
26
33
  formatMessage,
27
34
  query
28
35
  }) => {
@@ -43,4 +50,9 @@ export const createQuickInsertMatcher = getSearchData => {
43
50
  score: normalizeScore(result.score)
44
51
  } : null;
45
52
  };
53
+ if (isExperimentEnabled('platform_editor_slash_command')) {
54
+ matcher.getSearchData = getSearchData;
55
+ createQuickInsertMatcher.getDescription = getDescription;
56
+ }
57
+ return matcher;
46
58
  };
@@ -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 = "120.11.3";
17
+ const packageVersion = "120.12.1";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -77,10 +77,15 @@ export default function MentionWithProfileCard({
77
77
  }
78
78
  if (fg('people-teams_migrate-user-profile-card') || isExperimentEnabled('pt_user_profile_card_migration_exp')) {
79
79
  if (renderUserMentionCard) {
80
+ const prefilledProfileData = isExperimentEnabled('platform_mention_profilecard_accessible_name_exp') ? {
81
+ accountId: id,
82
+ name: text.replace(AT_PREFIX_REGEX, '')
83
+ } : undefined;
80
84
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderUserMentionCard({
81
85
  userId: id,
82
86
  cloudId,
83
- children: mention
87
+ children: mention,
88
+ prefilledProfileData
84
89
  }));
85
90
  }
86
91
  const {
@@ -90,13 +90,21 @@ export class VanillaTooltip {
90
90
  * Not called when the pointer leaves before the tooltip is shown, matching
91
91
  * the `onShow` semantics of "@atlaskit/tooltip".
92
92
  */
93
- onShow) {
93
+ onShow,
94
+ /**
95
+ * Where the tooltip sits relative to the trigger.
96
+ *
97
+ * Defaults to `'top'`, matching the default `position` of "@atlaskit/tooltip". Use
98
+ * `'bottom'` to match its `position="mouse"`, which places the tooltip below the cursor.
99
+ */
100
+ placement = 'top') {
94
101
  _defineProperty(this, "listeners", []);
95
102
  _defineProperty(this, "shouldHidePopover", false);
96
103
  _defineProperty(this, "isDisplayed", false);
97
104
  this.trigger = trigger;
98
105
  this.timeout = timeout;
99
106
  this.onShow = onShow;
107
+ this.placement = placement;
100
108
  // Created in the trigger's own document rather than the global one, so nothing depends on
101
109
  // the parent realm when the editor renders inside an iframe. Gated alongside the Escape
102
110
  // listener's window so the whole iframe fix moves as a single unit.
@@ -172,7 +180,7 @@ export class VanillaTooltip {
172
180
  }
173
181
  createPopperInstance() {
174
182
  this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
175
- placement: 'top',
183
+ placement: this.placement,
176
184
  modifiers: [startingOffset]
177
185
  });
178
186
  }
@@ -4,6 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  import React from 'react';
6
6
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
7
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
7
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  import { ACTION } from '../../analytics';
9
10
  import { sendMBEAnalyticsEvent } from './utils';
@@ -26,7 +27,7 @@ export var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActi
26
27
  sendMBEAnalyticsEvent(ACTION.CHANGE_ACTIVE, node, eventDispatcher);
27
28
  }
28
29
  var selection = (_options$selection = options === null || options === void 0 ? void 0 : options.selection) !== null && _options$selection !== void 0 ? _options$selection : 'none';
29
- if (selection === 'none') {
30
+ if (selection === 'none' && !isExperimentEnabled('confluence_native_tabs_m15')) {
30
31
  return updateActiveChildResult;
31
32
  }
32
33
  var pos = getPos();
@@ -46,16 +47,22 @@ export var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActi
46
47
  desiredPos += (possiblyMbeNode === null || possiblyMbeNode === void 0 || (_possiblyMbeNode$cont4 = possiblyMbeNode.content) === null || _possiblyMbeNode$cont4 === void 0 || (_possiblyMbeNode$cont4 = _possiblyMbeNode$cont4.child(i)) === null || _possiblyMbeNode$cont4 === void 0 ? void 0 : _possiblyMbeNode$cont4.nodeSize) || 0;
47
48
  }
48
49
  var targetFrame = possiblyMbeNode.content.child(index);
49
- if (selection === 'start') {
50
- // +1 moves past the extensionFrame opening token; TextSelection.near() finds
51
- // the nearest valid text cursor position from there.
52
- dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(desiredPos + 1))));
53
- } else {
54
- // Place cursor at the end of the target frame's content.
55
- // -1 bias searches backward from the frame's closing token.
50
+ if (selection === 'end') {
56
51
  dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(desiredPos + targetFrame.nodeSize), -1)));
52
+ editorView.focus();
53
+ } else {
54
+ // for 'start' and 'none' selection place a
55
+ // collapsed cursor at the start of the target frame so the ProseMirror
56
+ // selection always points into the active tab. This prevents stale
57
+ // selections from persisting across tab switches (which causes paste to
58
+ // land in the wrong tab).
59
+ // 'none' intentionally skips editorView.focus() so DOM focus can
60
+ // remain on the tab button for keyboard navigation.
61
+ dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(desiredPos + 1))));
62
+ if (selection === 'start') {
63
+ editorView.focus();
64
+ }
57
65
  }
58
- editorView.focus();
59
66
  }
60
67
  return updateActiveChildResult;
61
68
  },
@@ -20,6 +20,16 @@ export var messages = defineMessages({
20
20
  defaultMessage: 'Insert',
21
21
  description: 'Label on button to insert content at the current cursor position'
22
22
  },
23
+ collapseSection: {
24
+ id: 'editor-common.messages.block-controls.collapseSection',
25
+ defaultMessage: 'Collapse section',
26
+ description: 'Accessible label for the button that collapses a heading section.'
27
+ },
28
+ expandSection: {
29
+ id: 'editor-common.messages.block-controls.expandSection',
30
+ defaultMessage: 'Expand section',
31
+ description: 'Accessible label for the button that expands a heading section.'
32
+ },
23
33
  moveUp: {
24
34
  id: 'fabric.editor.blockControlMoveUp',
25
35
  defaultMessage: 'Move up',
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
20
20
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
21
21
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
22
22
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
23
- var packageVersion = "120.11.3";
23
+ var packageVersion = "120.12.1";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -4,47 +4,52 @@ import React from 'react';
4
4
  import { Box, Inline, Pressable, Stack, Text, xcss } from '@atlaskit/primitives';
5
5
  import { useQuickInsertMenuItemSelection } from './quickInsertMenuItemUtils';
6
6
  import { useQuickInsertContext } from './useQuickInsertContext';
7
- var itemStyles = xcss({
7
+ var borderlessItemStyles = xcss({
8
8
  alignItems: 'start',
9
9
  backgroundColor: 'color.background.neutral.subtle',
10
- borderColor: 'color.border',
11
10
  borderRadius: 'radius.medium',
12
- borderStyle: 'solid',
13
- borderWidth: 'border.width',
14
11
  color: 'color.text',
15
12
  cursor: 'pointer',
16
13
  display: 'flex',
17
14
  gap: 'space.150',
15
+ height: '88px',
18
16
  padding: 'space.150',
19
17
  textAlign: 'start',
20
18
  width: '100%'
21
19
  });
22
- var selectedItemStyles = xcss({
20
+ var borderlessSelectedItemStyles = xcss({
23
21
  alignItems: 'start',
24
22
  backgroundColor: 'color.background.selected',
25
- borderColor: 'color.border.selected',
26
- borderRadius: 'radius.medium',
27
- borderStyle: 'solid',
28
- borderWidth: 'border.width',
23
+ borderRadius: 0,
29
24
  color: 'color.text',
30
25
  cursor: 'pointer',
31
26
  display: 'flex',
32
27
  gap: 'space.150',
28
+ height: '88px',
33
29
  padding: 'space.150',
30
+ position: 'relative',
34
31
  textAlign: 'start',
35
- width: '100%'
32
+ width: '100%',
33
+ '::before': {
34
+ borderInlineStartColor: 'color.border.selected',
35
+ borderInlineStartStyle: 'solid',
36
+ borderInlineStartWidth: 'border.width.selected',
37
+ content: "''",
38
+ insetBlock: 'space.0',
39
+ insetInlineStart: 'space.0',
40
+ pointerEvents: 'none',
41
+ position: 'absolute'
42
+ }
36
43
  });
37
- var disabledItemStyles = xcss({
44
+ var borderlessDisabledItemStyles = xcss({
38
45
  alignItems: 'start',
39
46
  backgroundColor: 'color.background.neutral.subtle',
40
- borderColor: 'color.border',
41
47
  borderRadius: 'radius.medium',
42
- borderStyle: 'solid',
43
- borderWidth: 'border.width',
44
48
  color: 'color.text.disabled',
45
49
  cursor: 'not-allowed',
46
50
  display: 'flex',
47
51
  gap: 'space.150',
52
+ height: '88px',
48
53
  padding: 'space.150',
49
54
  textAlign: 'start',
50
55
  width: '100%'
@@ -92,6 +97,7 @@ export var ElementBrowserQuickInsertMenuItem = function ElementBrowserQuickInser
92
97
  },
93
98
  id = _ref2.id,
94
99
  isSelected = _ref2.isSelected;
100
+ var itemDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
95
101
  var handleClick = useQuickInsertMenuItemSelection(onSelect);
96
102
  return /*#__PURE__*/React.createElement(Pressable, {
97
103
  "aria-label": ariaLabel,
@@ -100,7 +106,7 @@ export var ElementBrowserQuickInsertMenuItem = function ElementBrowserQuickInser
100
106
  isDisabled: isDisabled,
101
107
  onClick: handleClick,
102
108
  role: "option",
103
- xcss: isDisabled ? disabledItemStyles : isSelected ? selectedItemStyles : itemStyles
109
+ xcss: isDisabled ? borderlessDisabledItemStyles : isSelected ? borderlessSelectedItemStyles : borderlessItemStyles
104
110
  }, iconBefore && shouldWrapIcon ? /*#__PURE__*/React.createElement(Box, {
105
111
  xcss: iconStyles
106
112
  }, iconBefore) : iconBefore, /*#__PURE__*/React.createElement(Stack, {
@@ -111,11 +117,14 @@ export var ElementBrowserQuickInsertMenuItem = function ElementBrowserQuickInser
111
117
  spread: "space-between",
112
118
  space: "space.100"
113
119
  }, /*#__PURE__*/React.createElement(Text, {
120
+ maxLines: 1,
114
121
  weight: "medium"
115
122
  }, title), shortcut && /*#__PURE__*/React.createElement(Box, {
116
123
  as: "span",
117
124
  xcss: shortcutStyles
118
- }, shortcut)), description && /*#__PURE__*/React.createElement(Box, {
125
+ }, shortcut)), itemDescription && /*#__PURE__*/React.createElement(Box, {
119
126
  xcss: descriptionStyles
120
- }, /*#__PURE__*/React.createElement(Text, null, description))));
127
+ }, /*#__PURE__*/React.createElement(Text, {
128
+ maxLines: 2
129
+ }, itemDescription))));
121
130
  };
@@ -1,4 +1,5 @@
1
1
  import Fuse from 'fuse.js';
2
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
3
  var options = {
3
4
  includeScore: true,
4
5
  keys: [{
@@ -19,14 +20,20 @@ var options = {
19
20
  var normalizeScore = function normalizeScore(score) {
20
21
  return Math.min(1, Math.max(0, score !== null && score !== void 0 ? score : 1));
21
22
  };
23
+ var getDescription = function getDescription(matcher, formatMessage) {
24
+ var _getSearchData, _ref;
25
+ return matcher === null || matcher === void 0 || (_getSearchData = (_ref = matcher).getSearchData) === null || _getSearchData === void 0 ? void 0 : _getSearchData.call(_ref, {
26
+ formatMessage: formatMessage
27
+ }).description;
28
+ };
22
29
 
23
30
  /** Creates a cached matcher using consumer-formatted Quick Insert search data. */
24
- export var createQuickInsertMatcher = function createQuickInsertMatcher(getSearchData) {
31
+ var _createQuickInsertMatcher = function createQuickInsertMatcher(getSearchData) {
25
32
  var cachedFormatMessage;
26
33
  var fuse;
27
- return function (_ref) {
28
- var formatMessage = _ref.formatMessage,
29
- query = _ref.query;
34
+ var matcher = function matcher(_ref2) {
35
+ var formatMessage = _ref2.formatMessage,
36
+ query = _ref2.query;
30
37
  var normalizedQuery = query.trim();
31
38
  if (!normalizedQuery) {
32
39
  return {
@@ -44,4 +51,10 @@ export var createQuickInsertMatcher = function createQuickInsertMatcher(getSearc
44
51
  score: normalizeScore(result.score)
45
52
  } : null;
46
53
  };
47
- };
54
+ if (isExperimentEnabled('platform_editor_slash_command')) {
55
+ matcher.getSearchData = getSearchData;
56
+ _createQuickInsertMatcher.getDescription = getDescription;
57
+ }
58
+ return matcher;
59
+ };
60
+ export { _createQuickInsertMatcher as createQuickInsertMatcher };
@@ -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 = "120.11.3";
24
+ var packageVersion = "120.12.1";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -82,10 +82,15 @@ export default function MentionWithProfileCard(_ref) {
82
82
  }
83
83
  if (fg('people-teams_migrate-user-profile-card') || isExperimentEnabled('pt_user_profile_card_migration_exp')) {
84
84
  if (renderUserMentionCard) {
85
+ var prefilledProfileData = isExperimentEnabled('platform_mention_profilecard_accessible_name_exp') ? {
86
+ accountId: id,
87
+ name: text.replace(AT_PREFIX_REGEX, '')
88
+ } : undefined;
85
89
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderUserMentionCard({
86
90
  userId: id,
87
91
  cloudId: cloudId,
88
- children: mention
92
+ children: mention,
93
+ prefilledProfileData: prefilledProfileData
89
94
  }));
90
95
  }
91
96
  var _navigateToTeamsApp = navigateToTeamsApp({
@@ -101,6 +101,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
101
101
  * the `onShow` semantics of "@atlaskit/tooltip".
102
102
  */
103
103
  onShow = arguments.length > 6 ? arguments[6] : undefined;
104
+ var placement = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'top';
104
105
  _classCallCheck(this, VanillaTooltip);
105
106
  _defineProperty(this, "listeners", []);
106
107
  _defineProperty(this, "shouldHidePopover", false);
@@ -108,6 +109,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
108
109
  this.trigger = trigger;
109
110
  this.timeout = timeout;
110
111
  this.onShow = onShow;
112
+ this.placement = placement;
111
113
  // Created in the trigger's own document rather than the global one, so nothing depends on
112
114
  // the parent realm when the editor renders inside an iframe. Gated alongside the Escape
113
115
  // listener's window so the whole iframe fix moves as a single unit.
@@ -191,7 +193,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
191
193
  key: "createPopperInstance",
192
194
  value: function createPopperInstance() {
193
195
  this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
194
- placement: 'top',
196
+ placement: this.placement,
195
197
  modifiers: [startingOffset]
196
198
  });
197
199
  }
@@ -1,57 +1,67 @@
1
1
  export declare const messages: {
2
- dragToMove: {
2
+ collapseSection: {
3
+ defaultMessage: string;
4
+ description: string;
3
5
  id: string;
6
+ };
7
+ delete: {
4
8
  defaultMessage: string;
5
9
  description: string;
10
+ id: string;
6
11
  };
7
- dragToMoveClickToOpen: {
12
+ dragToMove: {
13
+ defaultMessage: string;
14
+ description: string;
8
15
  id: string;
16
+ };
17
+ dragToMoveClickToOpen: {
9
18
  defaultMessage: string;
10
19
  description: string;
20
+ id: string;
11
21
  };
12
22
  dragToRearrange: {
23
+ defaultMessage: string;
24
+ description: string;
13
25
  id: string;
26
+ };
27
+ expandSection: {
14
28
  defaultMessage: string;
15
29
  description: string;
30
+ id: string;
16
31
  };
17
32
  insert: {
18
- id: string;
19
33
  defaultMessage: string;
20
34
  description: string;
21
- };
22
- moveUp: {
23
35
  id: string;
36
+ };
37
+ movedDown: {
24
38
  defaultMessage: string;
25
39
  description: string;
40
+ id: string;
26
41
  };
27
42
  moveDown: {
28
- id: string;
29
43
  defaultMessage: string;
30
44
  description: string;
45
+ id: string;
31
46
  };
32
47
  movedup: {
33
- id: string;
34
48
  defaultMessage: string;
35
49
  description: string;
36
- };
37
- movedDown: {
38
50
  id: string;
39
- defaultMessage: string;
40
- description: string;
41
51
  };
42
52
  moveLeft: {
43
- id: string;
44
53
  defaultMessage: string;
45
54
  description: string;
55
+ id: string;
46
56
  };
47
57
  moveRight: {
48
- id: string;
49
58
  defaultMessage: string;
50
59
  description: string;
51
- };
52
- delete: {
53
60
  id: string;
61
+ };
62
+ moveUp: {
54
63
  defaultMessage: string;
55
64
  description: string;
65
+ id: string;
56
66
  };
57
67
  };
@@ -16,6 +16,11 @@ import type ProfileClient from '@atlaskit/profilecard/profile-card-client';
16
16
  export type RenderUserMentionCard = (props: {
17
17
  children: ReactNode;
18
18
  cloudId: string;
19
+ /** Known identity to prefill the card with, giving its trigger a concrete accessible name. */
20
+ prefilledProfileData?: {
21
+ accountId: string;
22
+ name: string;
23
+ };
19
24
  referenceElement?: HTMLElement;
20
25
  userId: string;
21
26
  }) => ReactNode;
@@ -12,6 +12,7 @@ export type QuickInsertContextValue = {
12
12
  editorView: EditorView;
13
13
  isOffline: boolean;
14
14
  item?: {
15
+ description?: string;
15
16
  id: string;
16
17
  isSelected: boolean;
17
18
  };
@@ -6,8 +6,17 @@ type QuickInsertSearchData = {
6
6
  title: string;
7
7
  };
8
8
  type FormatMessage = Parameters<RegisterMenuItemMatch>[0]['formatMessage'];
9
+ type QuickInsertMatcher = RegisterMenuItemMatch & {
10
+ getSearchData?: (context: {
11
+ formatMessage: FormatMessage;
12
+ }) => QuickInsertSearchData;
13
+ };
14
+ type QuickInsertMatcherFactory = {
15
+ (getSearchData: (context: {
16
+ formatMessage: FormatMessage;
17
+ }) => QuickInsertSearchData): QuickInsertMatcher;
18
+ getDescription?: (matcher: RegisterMenuItemMatch | undefined, formatMessage: FormatMessage) => string | undefined;
19
+ };
9
20
  /** Creates a cached matcher using consumer-formatted Quick Insert search data. */
10
- export declare const createQuickInsertMatcher: (getSearchData: (context: {
11
- formatMessage: FormatMessage;
12
- }) => QuickInsertSearchData) => RegisterMenuItemMatch;
21
+ export declare const createQuickInsertMatcher: QuickInsertMatcherFactory;
13
22
  export {};
@@ -1,3 +1,4 @@
1
+ import { type Placement } from '@popperjs/core';
1
2
  /**
2
3
  * A tooltip component similar to "@atlaskit/tooltip" but built for vanilla scenarios
3
4
  *
@@ -27,6 +28,13 @@ export declare class VanillaTooltip {
27
28
  * the `onShow` semantics of "@atlaskit/tooltip".
28
29
  */
29
30
  private onShow?;
31
+ /**
32
+ * Where the tooltip sits relative to the trigger.
33
+ *
34
+ * Defaults to `'top'`, matching the default `position` of "@atlaskit/tooltip". Use
35
+ * `'bottom'` to match its `position="mouse"`, which places the tooltip below the cursor.
36
+ */
37
+ private placement;
30
38
  private popperInstance;
31
39
  private listeners;
32
40
  private currentTimeoutId;
@@ -75,7 +83,14 @@ export declare class VanillaTooltip {
75
83
  * Not called when the pointer leaves before the tooltip is shown, matching
76
84
  * the `onShow` semantics of "@atlaskit/tooltip".
77
85
  */
78
- onShow?: (() => void) | undefined);
86
+ onShow?: (() => void) | undefined,
87
+ /**
88
+ * Where the tooltip sits relative to the trigger.
89
+ *
90
+ * Defaults to `'top'`, matching the default `position` of "@atlaskit/tooltip". Use
91
+ * `'bottom'` to match its `position="mouse"`, which places the tooltip below the cursor.
92
+ */
93
+ placement?: Placement);
79
94
  /**
80
95
  * Closes the popover, tolerating it already being closed.
81
96
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "120.12.0",
3
+ "version": "120.13.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/activity-provider": "^3.1.0",
32
- "@atlaskit/adf-schema": "^57.2.0",
33
- "@atlaskit/adf-utils": "^20.8.0",
32
+ "@atlaskit/adf-schema": "^57.3.0",
33
+ "@atlaskit/adf-utils": "^20.9.0",
34
34
  "@atlaskit/afm-i18n-platform-editor-editor-common": "2.200.0",
35
35
  "@atlaskit/analytics-listeners": "^11.3.0",
36
36
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
@@ -54,8 +54,8 @@
54
54
  "@atlaskit/feature-gate-js-client": "^6.0.0",
55
55
  "@atlaskit/icon": "^37.6.0",
56
56
  "@atlaskit/link": "^5.1.0",
57
- "@atlaskit/link-datasource": "^6.10.0",
58
- "@atlaskit/link-picker": "^6.6.0",
57
+ "@atlaskit/link-datasource": "^6.11.0",
58
+ "@atlaskit/link-picker": "^6.7.0",
59
59
  "@atlaskit/media-card": "^81.9.0",
60
60
  "@atlaskit/media-client": "^37.6.0",
61
61
  "@atlaskit/media-client-react": "^6.4.0",
@@ -78,8 +78,8 @@
78
78
  "@atlaskit/react-compiler-gating": "^0.2.0",
79
79
  "@atlaskit/react-ufo": "^7.8.0",
80
80
  "@atlaskit/section-message": "^10.2.0",
81
- "@atlaskit/smart-card": "^45.19.0",
82
- "@atlaskit/smart-user-picker": "^11.6.0",
81
+ "@atlaskit/smart-card": "^45.20.0",
82
+ "@atlaskit/smart-user-picker": "^11.7.0",
83
83
  "@atlaskit/spinner": "^20.4.0",
84
84
  "@atlaskit/task-decision": "^21.9.0",
85
85
  "@atlaskit/teams-app-config": "^3.1.0",
@@ -268,6 +268,10 @@
268
268
  "platform_editor_mention_node_avatar": {
269
269
  "param": "isEnabled",
270
270
  "defaultValue": false
271
+ },
272
+ "platform_mention_profilecard_accessible_name_exp": {
273
+ "param": "isEnabled",
274
+ "defaultValue": false
271
275
  }
272
276
  }
273
277
  }