@atlaskit/editor-plugin-mentions 23.0.3 → 23.0.4

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 CHANGED
@@ -1,5 +1,42 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 23.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a034f535638cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a034f535638cc) -
8
+ Add structured Quick Insert previews with localised title, description and attribution under
9
+ platform_editor_slash_command.
10
+
11
+ Exclude footer and category navigation actions from previews. Left-align attribution, use subtle
12
+ title and attribution text, and default description text.
13
+
14
+ Show text previews even without preview metadata, and reserve a fixed image area while images load
15
+ or when they fail. Keep previews within the viewport, flipping left when needed, with compact
16
+ panel dimensions and typography.
17
+
18
+ Replace baked panel screenshots with image-only assets. Remove image fields from text-only legacy
19
+ previews while preserving their attribution.
20
+
21
+ Let extension providers own their preview images and attribution. Pass preview metadata through
22
+ the Company Hub manifest factory and remove Editor's fallback preview registry.
23
+
24
+ Localize provider attribution names and display Confluence and Jira product icons instead of the
25
+ attribution prefix when an icon is present. Allow the Dropbox manifest to receive the host's
26
+ message formatter.
27
+
28
+ - [`f5ec508f7f5ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f5ec508f7f5ba) -
29
+ Add an optional `renderAgentMentionCard` render-prop to `ProfilecardProvider`, gated behind
30
+ `platform_editor_agent_profile_card_update`. This lets 1P products inject
31
+ `@atlassian/agent-profile-card` for agent mentions in the editor and renderer, while public editor
32
+ consumers and products that haven't wired the hook keep the existing `@atlaskit/profilecard` agent
33
+ card.
34
+
35
+ Widen `@atlassian/agent-profile-card`'s `onChatClick` to also receive the Studio agent ID, and add
36
+ an `isReadOnly` prop that suppresses the card's chat button, dropdown and favourite star.
37
+
38
+ - Updated dependencies
39
+
3
40
  ## 23.0.3
4
41
 
5
42
  ### Patch Changes
@@ -44,7 +44,7 @@ var ACTIONS = exports.ACTIONS = {
44
44
  CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
45
45
  };
46
46
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
47
- var PACKAGE_VERSION = "23.0.2";
47
+ var PACKAGE_VERSION = "23.0.3";
48
48
  var setProvider = function setProvider(provider) {
49
49
  return function (state, dispatch) {
50
50
  if (dispatch) {
@@ -298,6 +298,14 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref0) {
298
298
  onChatClick = _ref0.onChatClick,
299
299
  hideActions = _ref0.hideActions;
300
300
  var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
301
+ if (provider.renderAgentMentionCard) {
302
+ return provider.renderAgentMentionCard({
303
+ accountId: accountId,
304
+ cloudId: provider.cloudId,
305
+ isReadOnly: hideActions,
306
+ onChatClick: onChatClick
307
+ });
308
+ }
301
309
  return (0, _expVal.expVal)('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
302
310
  accountId: accountId,
303
311
  cloudId: provider.cloudId,
@@ -11,6 +11,7 @@ var _reactIntl = require("react-intl");
11
11
  var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _messages = require("@atlaskit/editor-common/messages");
13
13
  var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
14
+ var _messages2 = require("@atlaskit/editor-common/quick-insert/messages");
14
15
  var _mention = _interopRequireDefault(require("@atlaskit/icon/core/mention"));
15
16
  var _key = require("../../pm-plugins/key");
16
17
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -20,6 +21,14 @@ var MentionQuickInsertMenuItem = exports.MentionQuickInsertMenuItem = function M
20
21
  typeAhead = _ref.typeAhead;
21
22
  var _useIntl = (0, _reactIntl.useIntl)(),
22
23
  formatMessage = _useIntl.formatMessage;
24
+ var preview = (0, _react.useMemo)(function () {
25
+ return previewImageUrls ? {
26
+ image: previewImageUrls,
27
+ attribution: {
28
+ name: formatMessage(_messages2.messages.previewAttributionAtlassian)
29
+ }
30
+ } : undefined;
31
+ }, [formatMessage, previewImageUrls]);
23
32
  var onSelect = (0, _react.useCallback)(function (_ref2) {
24
33
  var _mentionPluginKey$get, _api$typeAhead;
25
34
  var editorView = _ref2.editorView,
@@ -38,11 +47,12 @@ var MentionQuickInsertMenuItem = exports.MentionQuickInsertMenuItem = function M
38
47
  return tr;
39
48
  }, [api, typeAhead]);
40
49
  return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
50
+ description: formatMessage(_messages.toolbarInsertBlockMessages.mentionDescription),
41
51
  iconBefore: /*#__PURE__*/_react.default.createElement(_mention.default, {
42
52
  label: ""
43
53
  }),
44
54
  onSelect: onSelect,
45
- previewImageUrls: previewImageUrls,
55
+ preview: preview,
46
56
  shortcut: "@",
47
57
  title: formatMessage(_messages.toolbarInsertBlockMessages.mention)
48
58
  });
@@ -12,8 +12,8 @@ var _keys = require("@atlaskit/editor-common/quick-insert/keys");
12
12
  var _rank = require("@atlaskit/editor-common/quick-insert/rank");
13
13
  var _MentionQuickInsertMenuItem = require("./MentionQuickInsertMenuItem");
14
14
  var previewImageUrls = {
15
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/02107p5maex03pfb4s04rw7i4hbk5jj0.png',
16
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/q3254137y85cxldh4osht5k5c7q88572.png'
15
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLB.png',
16
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHL.png'
17
17
  };
18
18
  var getMentionQuickInsertComponents = exports.getMentionQuickInsertComponents = function getMentionQuickInsertComponents(_ref) {
19
19
  var api = _ref.api,
@@ -33,7 +33,7 @@ export const ACTIONS = {
33
33
  CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
34
34
  };
35
35
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
36
- const PACKAGE_VERSION = "23.0.2";
36
+ const PACKAGE_VERSION = "23.0.3";
37
37
  const setProvider = provider => (state, dispatch) => {
38
38
  if (dispatch) {
39
39
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -223,6 +223,14 @@ const AgentProfileCardContent = ({
223
223
  hideActions
224
224
  }) => {
225
225
  const agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
226
+ if (provider.renderAgentMentionCard) {
227
+ return provider.renderAgentMentionCard({
228
+ accountId,
229
+ cloudId: provider.cloudId,
230
+ isReadOnly: hideActions,
231
+ onChatClick
232
+ });
233
+ }
226
234
  return expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
227
235
  accountId: accountId,
228
236
  cloudId: provider.cloudId,
@@ -1,8 +1,9 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useMemo } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
6
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
6
7
  import MentionIcon from '@atlaskit/icon/core/mention';
7
8
  import { mentionPluginKey } from '../../pm-plugins/key';
8
9
  export const MentionQuickInsertMenuItem = ({
@@ -13,6 +14,12 @@ export const MentionQuickInsertMenuItem = ({
13
14
  const {
14
15
  formatMessage
15
16
  } = useIntl();
17
+ const preview = useMemo(() => previewImageUrls ? {
18
+ image: previewImageUrls,
19
+ attribution: {
20
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
21
+ }
22
+ } : undefined, [formatMessage, previewImageUrls]);
16
23
  const onSelect = useCallback(({
17
24
  editorView,
18
25
  insert
@@ -32,11 +39,12 @@ export const MentionQuickInsertMenuItem = ({
32
39
  return tr;
33
40
  }, [api, typeAhead]);
34
41
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
42
+ description: formatMessage(messages.mentionDescription),
35
43
  iconBefore: /*#__PURE__*/React.createElement(MentionIcon, {
36
44
  label: ""
37
45
  }),
38
46
  onSelect: onSelect,
39
- previewImageUrls: previewImageUrls,
47
+ preview: preview,
40
48
  shortcut: "@",
41
49
  title: formatMessage(messages.mention)
42
50
  });
@@ -5,8 +5,8 @@ import { MENTION_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/qu
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { MentionQuickInsertMenuItem } from './MentionQuickInsertMenuItem';
7
7
  const previewImageUrls = {
8
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/02107p5maex03pfb4s04rw7i4hbk5jj0.png',
9
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/q3254137y85cxldh4osht5k5c7q88572.png'
8
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLB.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHL.png'
10
10
  };
11
11
  export const getMentionQuickInsertComponents = ({
12
12
  api,
@@ -36,7 +36,7 @@ export var ACTIONS = {
36
36
  CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
37
37
  };
38
38
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
39
- var PACKAGE_VERSION = "23.0.2";
39
+ var PACKAGE_VERSION = "23.0.3";
40
40
  var setProvider = function setProvider(provider) {
41
41
  return function (state, dispatch) {
42
42
  if (dispatch) {
@@ -286,6 +286,14 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref0) {
286
286
  onChatClick = _ref0.onChatClick,
287
287
  hideActions = _ref0.hideActions;
288
288
  var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
289
+ if (provider.renderAgentMentionCard) {
290
+ return provider.renderAgentMentionCard({
291
+ accountId: accountId,
292
+ cloudId: provider.cloudId,
293
+ isReadOnly: hideActions,
294
+ onChatClick: onChatClick
295
+ });
296
+ }
289
297
  return expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
290
298
  accountId: accountId,
291
299
  cloudId: provider.cloudId,
@@ -1,8 +1,9 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useMemo } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
6
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
6
7
  import MentionIcon from '@atlaskit/icon/core/mention';
7
8
  import { mentionPluginKey } from '../../pm-plugins/key';
8
9
  export var MentionQuickInsertMenuItem = function MentionQuickInsertMenuItem(_ref) {
@@ -11,6 +12,14 @@ export var MentionQuickInsertMenuItem = function MentionQuickInsertMenuItem(_ref
11
12
  typeAhead = _ref.typeAhead;
12
13
  var _useIntl = useIntl(),
13
14
  formatMessage = _useIntl.formatMessage;
15
+ var preview = useMemo(function () {
16
+ return previewImageUrls ? {
17
+ image: previewImageUrls,
18
+ attribution: {
19
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
20
+ }
21
+ } : undefined;
22
+ }, [formatMessage, previewImageUrls]);
14
23
  var onSelect = useCallback(function (_ref2) {
15
24
  var _mentionPluginKey$get, _api$typeAhead;
16
25
  var editorView = _ref2.editorView,
@@ -29,11 +38,12 @@ export var MentionQuickInsertMenuItem = function MentionQuickInsertMenuItem(_ref
29
38
  return tr;
30
39
  }, [api, typeAhead]);
31
40
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
41
+ description: formatMessage(messages.mentionDescription),
32
42
  iconBefore: /*#__PURE__*/React.createElement(MentionIcon, {
33
43
  label: ""
34
44
  }),
35
45
  onSelect: onSelect,
36
- previewImageUrls: previewImageUrls,
46
+ preview: preview,
37
47
  shortcut: "@",
38
48
  title: formatMessage(messages.mention)
39
49
  });
@@ -5,8 +5,8 @@ import { MENTION_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/qu
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { MentionQuickInsertMenuItem } from './MentionQuickInsertMenuItem';
7
7
  var previewImageUrls = {
8
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/02107p5maex03pfb4s04rw7i4hbk5jj0.png',
9
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/q3254137y85cxldh4osht5k5c7q88572.png'
8
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLB.png',
9
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHL.png'
10
10
  };
11
11
  export var getMentionQuickInsertComponents = function getMentionQuickInsertComponents(_ref) {
12
12
  var api = _ref.api,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "23.0.3",
3
+ "version": "23.0.4",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,7 +28,7 @@
28
28
  "@atlaskit/editor-plugin-base": "^22.0.0",
29
29
  "@atlaskit/editor-plugin-context-identifier": "^21.0.0",
30
30
  "@atlaskit/editor-plugin-selection": "^21.0.0",
31
- "@atlaskit/editor-plugin-type-ahead": "^22.0.0",
31
+ "@atlaskit/editor-plugin-type-ahead": "^22.1.0",
32
32
  "@atlaskit/editor-prosemirror": "^9.0.0",
33
33
  "@atlaskit/feature-gate-js-client": "^7.0.0",
34
34
  "@atlaskit/icon": "^38.0.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/section-message": "^10.2.0",
48
48
  "@atlaskit/teams-app-config": "^3.1.0",
49
49
  "@atlaskit/theme": "^28.2.0",
50
- "@atlaskit/tmp-editor-statsig": "^208.0.0",
50
+ "@atlaskit/tmp-editor-statsig": "^209.0.0",
51
51
  "@atlaskit/tokens": "^20.0.0",
52
52
  "@atlaskit/tooltip": "^24.3.0",
53
53
  "@atlaskit/user-picker": "^14.0.0",
@@ -60,7 +60,7 @@
60
60
  "uuid": "^11.1.1"
61
61
  },
62
62
  "peerDependencies": {
63
- "@atlaskit/editor-common": "^125.2.0",
63
+ "@atlaskit/editor-common": "^125.4.0",
64
64
  "react": "^18.2.0 || ^19.2.0",
65
65
  "react-dom": "^18.2.0 || ^19.2.0",
66
66
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"