@atlaskit/editor-plugin-mentions 20.2.0 → 20.2.1

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,14 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 20.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`88fb7a8d4013a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88fb7a8d4013a) -
8
+ [ux] Add optional light and dark preview URLs to slash-command menu items and pass theme-aware
9
+ previews to supported commands when the `platform_editor_slash_command` experiment is enabled.
10
+ - Updated dependencies
11
+
3
12
  ## 20.2.0
4
13
 
5
14
  ### Minor 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 = "20.1.5";
47
+ var PACKAGE_VERSION = "20.2.0";
48
48
  var setProvider = function setProvider(provider) {
49
49
  return function (state, dispatch) {
50
50
  if (dispatch) {
@@ -16,6 +16,7 @@ var _key = require("../../pm-plugins/key");
16
16
  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); }
17
17
  var MentionQuickInsertMenuItem = exports.MentionQuickInsertMenuItem = function MentionQuickInsertMenuItem(_ref) {
18
18
  var api = _ref.api,
19
+ previewImageUrls = _ref.previewImageUrls,
19
20
  typeAhead = _ref.typeAhead;
20
21
  var _useIntl = (0, _reactIntl.useIntl)(),
21
22
  formatMessage = _useIntl.formatMessage;
@@ -41,6 +42,7 @@ var MentionQuickInsertMenuItem = exports.MentionQuickInsertMenuItem = function M
41
42
  label: ""
42
43
  }),
43
44
  onSelect: onSelect,
45
+ previewImageUrls: previewImageUrls,
44
46
  shortcut: "@",
45
47
  title: formatMessage(_messages.toolbarInsertBlockMessages.mention)
46
48
  });
@@ -11,6 +11,10 @@ var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/cr
11
11
  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
+ var previewImageUrls = {
15
+ light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/02107p5maex03pfb4s04rw7i4hbk5jj0.png',
16
+ dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/q3254137y85cxldh4osht5k5c7q88572.png'
17
+ };
14
18
  var getMentionQuickInsertComponents = exports.getMentionQuickInsertComponents = function getMentionQuickInsertComponents(_ref) {
15
19
  var api = _ref.api,
16
20
  canOpenMentionTypeAhead = _ref.canOpenMentionTypeAhead,
@@ -39,6 +43,7 @@ var getMentionQuickInsertComponents = exports.getMentionQuickInsertComponents =
39
43
  component: function component() {
40
44
  return /*#__PURE__*/_react.default.createElement(_MentionQuickInsertMenuItem.MentionQuickInsertMenuItem, {
41
45
  api: api,
46
+ previewImageUrls: previewImageUrls,
42
47
  typeAhead: typeAhead
43
48
  });
44
49
  }
@@ -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 = "20.1.5";
36
+ const PACKAGE_VERSION = "20.2.0";
37
37
  const setProvider = provider => (state, dispatch) => {
38
38
  if (dispatch) {
39
39
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -7,6 +7,7 @@ import MentionIcon from '@atlaskit/icon/core/mention';
7
7
  import { mentionPluginKey } from '../../pm-plugins/key';
8
8
  export const MentionQuickInsertMenuItem = ({
9
9
  api,
10
+ previewImageUrls,
10
11
  typeAhead
11
12
  }) => {
12
13
  const {
@@ -35,6 +36,7 @@ export const MentionQuickInsertMenuItem = ({
35
36
  label: ""
36
37
  }),
37
38
  onSelect: onSelect,
39
+ previewImageUrls: previewImageUrls,
38
40
  shortcut: "@",
39
41
  title: formatMessage(messages.mention)
40
42
  });
@@ -4,6 +4,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
4
4
  import { MENTION_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { MentionQuickInsertMenuItem } from './MentionQuickInsertMenuItem';
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'
10
+ };
7
11
  export const getMentionQuickInsertComponents = ({
8
12
  api,
9
13
  canOpenMentionTypeAhead,
@@ -30,6 +34,7 @@ export const getMentionQuickInsertComponents = ({
30
34
  })),
31
35
  component: () => /*#__PURE__*/React.createElement(MentionQuickInsertMenuItem, {
32
36
  api: api,
37
+ previewImageUrls: previewImageUrls,
33
38
  typeAhead: typeAhead
34
39
  })
35
40
  }];
@@ -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 = "20.1.5";
39
+ var PACKAGE_VERSION = "20.2.0";
40
40
  var setProvider = function setProvider(provider) {
41
41
  return function (state, dispatch) {
42
42
  if (dispatch) {
@@ -7,6 +7,7 @@ import MentionIcon from '@atlaskit/icon/core/mention';
7
7
  import { mentionPluginKey } from '../../pm-plugins/key';
8
8
  export var MentionQuickInsertMenuItem = function MentionQuickInsertMenuItem(_ref) {
9
9
  var api = _ref.api,
10
+ previewImageUrls = _ref.previewImageUrls,
10
11
  typeAhead = _ref.typeAhead;
11
12
  var _useIntl = useIntl(),
12
13
  formatMessage = _useIntl.formatMessage;
@@ -32,6 +33,7 @@ export var MentionQuickInsertMenuItem = function MentionQuickInsertMenuItem(_ref
32
33
  label: ""
33
34
  }),
34
35
  onSelect: onSelect,
36
+ previewImageUrls: previewImageUrls,
35
37
  shortcut: "@",
36
38
  title: formatMessage(messages.mention)
37
39
  });
@@ -4,6 +4,10 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
4
4
  import { MENTION_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
5
5
  import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { MentionQuickInsertMenuItem } from './MentionQuickInsertMenuItem';
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'
10
+ };
7
11
  export var getMentionQuickInsertComponents = function getMentionQuickInsertComponents(_ref) {
8
12
  var api = _ref.api,
9
13
  canOpenMentionTypeAhead = _ref.canOpenMentionTypeAhead,
@@ -32,6 +36,7 @@ export var getMentionQuickInsertComponents = function getMentionQuickInsertCompo
32
36
  component: function component() {
33
37
  return /*#__PURE__*/React.createElement(MentionQuickInsertMenuItem, {
34
38
  api: api,
39
+ previewImageUrls: previewImageUrls,
35
40
  typeAhead: typeAhead
36
41
  });
37
42
  }
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
+ import { type QuickInsertMenuItemProps } from '@atlaskit/editor-common/quick-insert/menu-item';
2
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
4
  import type { TypeAheadHandler } from '@atlaskit/editor-plugin-type-ahead';
4
5
  import type { MentionsPlugin } from '../../mentionsPluginType';
5
6
  type Props = {
6
7
  api: ExtractInjectionAPI<MentionsPlugin> | undefined;
8
+ previewImageUrls?: QuickInsertMenuItemProps['previewImageUrls'];
7
9
  typeAhead: TypeAheadHandler;
8
10
  };
9
- export declare const MentionQuickInsertMenuItem: ({ api, typeAhead }: Props) => React.JSX.Element;
11
+ export declare const MentionQuickInsertMenuItem: ({ api, previewImageUrls, typeAhead, }: Props) => React.JSX.Element;
10
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "20.2.0",
3
+ "version": "20.2.1",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,8 +47,8 @@
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": "^198.0.0",
51
- "@atlaskit/tokens": "^17.0.0",
50
+ "@atlaskit/tmp-editor-statsig": "^199.0.0",
51
+ "@atlaskit/tokens": "^18.0.0",
52
52
  "@atlaskit/tooltip": "^24.3.0",
53
53
  "@atlaskit/user-picker": "^13.13.0",
54
54
  "@babel/runtime": "^7.0.0",