@atlaskit/editor-plugin-mentions 13.3.4 → 13.3.6

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,23 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 13.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 13.3.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f7b906dfd7043`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f7b906dfd7043) -
14
+ Persist Rovo agent mentions as APP mentions and preserve mention userType in copied HTML behind
15
+ platform_editor_agent_mentions so pasted agent mentions can trigger agent mention nudges.
16
+ - [`5dd8cc218e393`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5dd8cc218e393) -
17
+ Release packages affected by an issue blocking you from installing <@compiled>/react due to a yarn
18
+ patch.
19
+ - Updated dependencies
20
+
3
21
  ## 13.3.4
4
22
 
5
23
  ### Patch Changes
@@ -8,6 +8,7 @@ exports.mentionNodeSpec = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
10
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
11
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
11
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
13
  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) { (0, _defineProperty2.default)(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; }
13
14
  var isSSR = Boolean(process.env.REACT_SSR);
@@ -33,6 +34,7 @@ var mentionNodeSpec = exports.mentionNodeSpec = function mentionNodeSpec() {
33
34
  'data-prosemirror-content-type': 'node',
34
35
  'data-prosemirror-node-inline': 'true',
35
36
  'data-prosemirror-node-name': 'mention',
37
+ 'data-user-type': (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) && node.attrs.userType ? node.attrs.userType : undefined,
36
38
  style: (0, _lazyNodeView.convertToInlineCss)({
37
39
  display: 'inline',
38
40
  border: "1px solid transparent",
@@ -17,6 +17,7 @@ var _resource = require("@atlaskit/mention/resource");
17
17
  var _types = require("@atlaskit/mention/types");
18
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
19
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
20
21
  var _disabledTooltipRenderer = require("./disabledTooltipRenderer");
21
22
  var _profileCardRenderer2 = require("./profileCardRenderer");
22
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -43,6 +44,11 @@ var toDOM = function toDOM(node) {
43
44
  'data-local-id': node.attrs.localId
44
45
  });
45
46
  }
47
+ if ((0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) && node.attrs.userType) {
48
+ mentionAttrs = _objectSpread(_objectSpread({}, mentionAttrs), {}, {
49
+ 'data-user-type': node.attrs.userType
50
+ });
51
+ }
46
52
  var browser = (0, _browser.getBrowserInfo)();
47
53
  return ['span', mentionAttrs, ['span', {
48
54
  class: 'zeroWidthSpaceContainer'
@@ -32,7 +32,7 @@ var ACTIONS = exports.ACTIONS = {
32
32
  var AGENT_USER_TYPES = new Set(['APP', 'AGENT']);
33
33
  var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
34
34
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
35
- var PACKAGE_VERSION = "13.3.3";
35
+ var PACKAGE_VERSION = "13.3.5";
36
36
  var setProvider = function setProvider(provider) {
37
37
  return function (state, dispatch) {
38
38
  if (dispatch) {
@@ -368,7 +368,11 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
368
368
  var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
369
369
  sessionId: sessionId
370
370
  });
371
- var shouldSuppressInviteForAgentMention = (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) && isAgentMention(item.mention);
371
+ var isAgentMentionsExperimentEnabled = (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false);
372
+ var shouldSuppressInviteForAgentMention = isAgentMentionsExperimentEnabled && isAgentMention(item.mention);
373
+ // userType can be missing for provider-only agent mentions. Copy/paste cannot
374
+ // see appType, so persist APP only when there is no explicit userType.
375
+ var persistedUserType = isAgentMentionsExperimentEnabled && isAgentMention(item.mention) && userType == null ? 'APP' : userType;
372
376
  if (mentionProvider && !(0, _utils3.isInviteItem)(item.mention)) {
373
377
  mentionProvider.recordMentionSelection(item.mention, mentionContext);
374
378
  }
@@ -457,7 +461,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
457
461
  })({
458
462
  name: name,
459
463
  id: id,
460
- userType: userType,
464
+ userType: persistedUserType,
461
465
  nickname: nickname,
462
466
  localId: mentionLocalId,
463
467
  accessLevel: accessLevel,
@@ -1,5 +1,6 @@
1
1
  import { mention } from '@atlaskit/adf-schema';
2
2
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
3
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
3
4
  const isSSR = Boolean(process.env.REACT_SSR);
4
5
 
5
6
  /**
@@ -24,6 +25,7 @@ export const mentionNodeSpec = () => {
24
25
  'data-prosemirror-content-type': 'node',
25
26
  'data-prosemirror-node-inline': 'true',
26
27
  'data-prosemirror-node-name': 'mention',
28
+ 'data-user-type': expVal('platform_editor_agent_mentions', 'isEnabled', false) && node.attrs.userType ? node.attrs.userType : undefined,
27
29
  style: convertToInlineCss({
28
30
  display: 'inline',
29
31
  border: `1px solid transparent`,
@@ -5,6 +5,7 @@ import { isResolvingMentionProvider, MentionNameStatus } from '@atlaskit/mention
5
5
  import { isRestricted } from '@atlaskit/mention/types';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
8
9
  import { disabledTooltipRenderer } from './disabledTooltipRenderer';
9
10
  import { profileCardRenderer } from './profileCardRenderer';
10
11
  const primitiveClassName = 'editor-mention-primitive';
@@ -28,6 +29,12 @@ const toDOM = node => {
28
29
  'data-local-id': node.attrs.localId
29
30
  };
30
31
  }
32
+ if (expVal('platform_editor_agent_mentions', 'isEnabled', false) && node.attrs.userType) {
33
+ mentionAttrs = {
34
+ ...mentionAttrs,
35
+ 'data-user-type': node.attrs.userType
36
+ };
37
+ }
31
38
  const browser = getBrowserInfo();
32
39
  return ['span', mentionAttrs, ['span', {
33
40
  class: 'zeroWidthSpaceContainer'
@@ -17,7 +17,7 @@ export const ACTIONS = {
17
17
  const AGENT_USER_TYPES = new Set(['APP', 'AGENT']);
18
18
  const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
19
19
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
20
- const PACKAGE_VERSION = "13.3.3";
20
+ const PACKAGE_VERSION = "13.3.5";
21
21
  const setProvider = provider => (state, dispatch) => {
22
22
  if (dispatch) {
23
23
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -354,7 +354,11 @@ export const createTypeAheadConfig = ({
354
354
  ...contextIdentifierProvider,
355
355
  sessionId
356
356
  };
357
- const shouldSuppressInviteForAgentMention = expVal('platform_editor_agent_mentions', 'isEnabled', false) && isAgentMention(item.mention);
357
+ const isAgentMentionsExperimentEnabled = expVal('platform_editor_agent_mentions', 'isEnabled', false);
358
+ const shouldSuppressInviteForAgentMention = isAgentMentionsExperimentEnabled && isAgentMention(item.mention);
359
+ // userType can be missing for provider-only agent mentions. Copy/paste cannot
360
+ // see appType, so persist APP only when there is no explicit userType.
361
+ const persistedUserType = isAgentMentionsExperimentEnabled && isAgentMention(item.mention) && userType == null ? 'APP' : userType;
358
362
  if (mentionProvider && !isInviteItem(item.mention)) {
359
363
  mentionProvider.recordMentionSelection(item.mention, mentionContext);
360
364
  }
@@ -445,7 +449,7 @@ export const createTypeAheadConfig = ({
445
449
  })({
446
450
  name,
447
451
  id,
448
- userType,
452
+ userType: persistedUserType,
449
453
  nickname,
450
454
  localId: mentionLocalId,
451
455
  accessLevel,
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import { mention } from '@atlaskit/adf-schema';
5
5
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
6
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
6
7
  var isSSR = Boolean(process.env.REACT_SSR);
7
8
 
8
9
  /**
@@ -26,6 +27,7 @@ export var mentionNodeSpec = function mentionNodeSpec() {
26
27
  'data-prosemirror-content-type': 'node',
27
28
  'data-prosemirror-node-inline': 'true',
28
29
  'data-prosemirror-node-name': 'mention',
30
+ 'data-user-type': expVal('platform_editor_agent_mentions', 'isEnabled', false) && node.attrs.userType ? node.attrs.userType : undefined,
29
31
  style: convertToInlineCss({
30
32
  display: 'inline',
31
33
  border: "1px solid transparent",
@@ -12,6 +12,7 @@ import { isResolvingMentionProvider, MentionNameStatus } from '@atlaskit/mention
12
12
  import { isRestricted } from '@atlaskit/mention/types';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
14
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
15
16
  import { disabledTooltipRenderer } from './disabledTooltipRenderer';
16
17
  import { profileCardRenderer } from './profileCardRenderer';
17
18
  var primitiveClassName = 'editor-mention-primitive';
@@ -36,6 +37,11 @@ var toDOM = function toDOM(node) {
36
37
  'data-local-id': node.attrs.localId
37
38
  });
38
39
  }
40
+ if (expVal('platform_editor_agent_mentions', 'isEnabled', false) && node.attrs.userType) {
41
+ mentionAttrs = _objectSpread(_objectSpread({}, mentionAttrs), {}, {
42
+ 'data-user-type': node.attrs.userType
43
+ });
44
+ }
39
45
  var browser = getBrowserInfo();
40
46
  return ['span', mentionAttrs, ['span', {
41
47
  class: 'zeroWidthSpaceContainer'
@@ -24,7 +24,7 @@ export var ACTIONS = {
24
24
  var AGENT_USER_TYPES = new Set(['APP', 'AGENT']);
25
25
  var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
26
26
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
27
- var PACKAGE_VERSION = "13.3.3";
27
+ var PACKAGE_VERSION = "13.3.5";
28
28
  var setProvider = function setProvider(provider) {
29
29
  return function (state, dispatch) {
30
30
  if (dispatch) {
@@ -359,7 +359,11 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
359
359
  var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
360
360
  sessionId: sessionId
361
361
  });
362
- var shouldSuppressInviteForAgentMention = expVal('platform_editor_agent_mentions', 'isEnabled', false) && isAgentMention(item.mention);
362
+ var isAgentMentionsExperimentEnabled = expVal('platform_editor_agent_mentions', 'isEnabled', false);
363
+ var shouldSuppressInviteForAgentMention = isAgentMentionsExperimentEnabled && isAgentMention(item.mention);
364
+ // userType can be missing for provider-only agent mentions. Copy/paste cannot
365
+ // see appType, so persist APP only when there is no explicit userType.
366
+ var persistedUserType = isAgentMentionsExperimentEnabled && isAgentMention(item.mention) && userType == null ? 'APP' : userType;
363
367
  if (mentionProvider && !isInviteItem(item.mention)) {
364
368
  mentionProvider.recordMentionSelection(item.mention, mentionContext);
365
369
  }
@@ -448,7 +452,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
448
452
  })({
449
453
  name: name,
450
454
  id: id,
451
- userType: userType,
455
+ userType: persistedUserType,
452
456
  nickname: nickname,
453
457
  localId: mentionLocalId,
454
458
  accessLevel: accessLevel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "13.3.4",
3
+ "version": "13.3.6",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,13 +29,13 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^52.16.0",
32
+ "@atlaskit/adf-schema": "^53.0.0",
33
33
  "@atlaskit/css": "^0.19.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^11.0.0",
35
35
  "@atlaskit/editor-plugin-base": "^12.1.0",
36
36
  "@atlaskit/editor-plugin-context-identifier": "^11.0.0",
37
37
  "@atlaskit/editor-plugin-selection": "^11.0.0",
38
- "@atlaskit/editor-plugin-type-ahead": "^11.1.0",
38
+ "@atlaskit/editor-plugin-type-ahead": "^11.2.0",
39
39
  "@atlaskit/editor-prosemirror": "^7.3.0",
40
40
  "@atlaskit/icon": "^35.4.0",
41
41
  "@atlaskit/insm": "^0.4.0",
@@ -45,22 +45,22 @@
45
45
  "@atlaskit/popper": "^7.2.0",
46
46
  "@atlaskit/portal": "^5.5.0",
47
47
  "@atlaskit/primitives": "^19.0.0",
48
- "@atlaskit/profilecard": "^25.8.0",
48
+ "@atlaskit/profilecard": "^25.9.0",
49
49
  "@atlaskit/teams-app-config": "^1.12.0",
50
50
  "@atlaskit/theme": "^25.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^93.0.0",
51
+ "@atlaskit/tmp-editor-statsig": "^94.0.0",
52
52
  "@atlaskit/tokens": "^13.3.0",
53
53
  "@atlaskit/tooltip": "^22.6.0",
54
54
  "@atlaskit/user-picker": "^12.1.0",
55
55
  "@babel/runtime": "^7.0.0",
56
- "@compiled/react": "patch:@compiled/react@npm%3A0.20.0#~/.yarn/patches/@compiled-react-npm-0.20.0-a771aa67a6.patch",
56
+ "@compiled/react": "^0.20.0",
57
57
  "bind-event-listener": "^3.0.0",
58
58
  "focus-trap": "^2.4.5",
59
59
  "react-loadable": "^5.1.0",
60
60
  "uuid": "^3.1.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@atlaskit/editor-common": "^115.7.0",
63
+ "@atlaskit/editor-common": "^115.10.0",
64
64
  "react": "^18.2.0",
65
65
  "react-dom": "^18.2.0",
66
66
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -124,6 +124,9 @@
124
124
  },
125
125
  "people-teams_migrate-user-profile-card": {
126
126
  "type": "boolean"
127
+ },
128
+ "platform_editor_agent_mentions": {
129
+ "type": "boolean"
127
130
  }
128
131
  }
129
132
  }