@atlaskit/editor-common 116.20.1 → 116.21.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/messages/breakout.js +10 -0
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/ui/DropList/index.js +1 -1
  5. package/dist/cjs/ui/Mention/index.js +3 -1
  6. package/dist/cjs/ui/Mention/mention-with-profilecard.js +50 -25
  7. package/dist/cjs/ui/Mention/mention-with-providers.js +3 -1
  8. package/dist/cjs/utils/getBreakoutResizableNodeTypes.js +9 -2
  9. package/dist/cjs/utils/getLinkDomain.js +13 -10
  10. package/dist/es2019/messages/breakout.js +10 -0
  11. package/dist/es2019/monitoring/error.js +1 -1
  12. package/dist/es2019/ui/DropList/index.js +1 -1
  13. package/dist/es2019/ui/Mention/index.js +3 -1
  14. package/dist/es2019/ui/Mention/mention-with-profilecard.js +40 -23
  15. package/dist/es2019/ui/Mention/mention-with-providers.js +3 -1
  16. package/dist/es2019/utils/getBreakoutResizableNodeTypes.js +9 -3
  17. package/dist/es2019/utils/getLinkDomain.js +13 -10
  18. package/dist/esm/messages/breakout.js +10 -0
  19. package/dist/esm/monitoring/error.js +1 -1
  20. package/dist/esm/ui/DropList/index.js +1 -1
  21. package/dist/esm/ui/Mention/index.js +3 -1
  22. package/dist/esm/ui/Mention/mention-with-profilecard.js +46 -23
  23. package/dist/esm/ui/Mention/mention-with-providers.js +3 -1
  24. package/dist/esm/utils/getBreakoutResizableNodeTypes.js +9 -2
  25. package/dist/esm/utils/getLinkDomain.js +13 -10
  26. package/dist/types/messages/breakout.d.ts +22 -12
  27. package/dist/types/ui/Mention/index.d.ts +2 -0
  28. package/dist/types/ui/Mention/mention-with-profilecard.d.ts +8 -1
  29. package/dist/types/ui/Mention/mention-with-providers.d.ts +2 -0
  30. package/dist/types/utils/getBreakoutResizableNodeTypes.d.ts +1 -1
  31. package/package.json +7 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 116.21.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c2986ab2c7a01`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c2986ab2c7a01) -
8
+ Cleans up prefer static regex violations and enables e18e rule
9
+ - Updated dependencies
10
+
11
+ ## 116.21.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`663afd59ab193`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/663afd59ab193) -
16
+ Agent mentions in Rovo chat history now open the agent profile card on click (behind the
17
+ rovo_chat_agent_selection gate). The renderer and editor-common Mention now thread the mention
18
+ userType so an 'APP' (agent) mention renders an AgentProfileCardTrigger; AgentProfileCardTrigger
19
+ now honors a passed trigger prop.
20
+
21
+ ### Patch Changes
22
+
23
+ - [`92638385edd0e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/92638385edd0e) -
24
+ [ux] [EDITOR-7888] add breakout resizing support for panel and rule nodes behind experiment
25
+ `platform_editor_lovability_resize_dividers_panels`.
26
+ - Updated dependencies
27
+
3
28
  ## 116.20.1
4
29
 
5
30
  ### Patch Changes
@@ -45,5 +45,15 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
45
45
  id: 'fabric.editor.breakout.resizeElement',
46
46
  defaultMessage: 'Resize element',
47
47
  description: 'Tooltip displayed on custom element (node) width resize handle'
48
+ },
49
+ resizeRule: {
50
+ id: 'fabric.editor.breakout.resizeRule',
51
+ defaultMessage: 'Resize divider',
52
+ description: 'Tooltip displayed on custom divider width resize handle'
53
+ },
54
+ resizePanel: {
55
+ id: 'fabric.editor.breakout.resizePanel',
56
+ defaultMessage: 'Resize panel',
57
+ description: 'Tooltip displayed on custom panel width resize handle'
48
58
  }
49
59
  });
@@ -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 = "116.20.0";
31
+ var packageVersion = "116.21.0";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -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 = "116.20.0";
27
+ var packageVersion = "116.21.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -31,7 +31,8 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
31
31
  eventHandlers = _this$props.eventHandlers,
32
32
  id = _this$props.id,
33
33
  text = _this$props.text,
34
- localId = _this$props.localId;
34
+ localId = _this$props.localId,
35
+ userType = _this$props.userType;
35
36
  var mentionProvider = providers.mentionProvider,
36
37
  profilecardProvider = providers.profilecardProvider;
37
38
  return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProviders, {
@@ -39,6 +40,7 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
39
40
  text: text,
40
41
  accessLevel: accessLevel,
41
42
  localId: localId,
43
+ userType: userType,
42
44
  eventHandlers: eventHandlers,
43
45
  mentionProvider: mentionProvider,
44
46
  profilecardProvider: profilecardProvider
@@ -1,22 +1,46 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = MentionWithProfileCard;
8
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _react = _interopRequireWildcard(require("react"));
10
+ var _reactLoadable = _interopRequireDefault(require("react-loadable"));
10
11
  var _mention = require("@atlaskit/mention");
11
12
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
13
14
  var _user = _interopRequireDefault(require("@atlaskit/profilecard/user"));
14
15
  var _navigation = require("@atlaskit/teams-app-config/navigation");
15
16
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
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
+ 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" != (0, _typeof2.default)(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); }
18
+ // Lazy-loaded so the agent profile card chunk (and its `@atlaskit/rovo-agent-components`
19
+ // dependency) stays off the critical path — it is only fetched when an agent mention
20
+ // (`userType === 'APP'`) actually renders, never for person mentions.
21
+ // Uses react-loadable to match editor-common's code-splitting factory (see src/icons/index.ts).
22
+ var AgentProfileCardTrigger = (0, _reactLoadable.default)({
23
+ loader: function loader() {
24
+ return Promise.resolve().then(function () {
25
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
26
+ '@atlaskit/profilecard/agent-profile-card-trigger'));
27
+ }).then(function (mod) {
28
+ return mod.AgentProfileCardTrigger;
29
+ });
30
+ },
31
+ loading: function loading() {
32
+ return null;
33
+ }
34
+ });
35
+
17
36
  // Ignored via go/ees005
18
37
  // eslint-disable-next-line require-unicode-regexp
19
38
  var AT_PREFIX_REGEX = /^@/;
39
+ /**
40
+ * Renders a mention chip wrapped in the appropriate profile card trigger.
41
+ * 1. Agent mentions (`userType === 'APP'`, behind `rovo_chat_agent_selection`) open the Rovo agent profile card on click.
42
+ * 2. Otherwise renders the person profile card (either via the provider's `renderUserMentionCard`/link fallback or the default user `ProfileCardTrigger`).
43
+ */
20
44
  function MentionWithProfileCard(_ref) {
21
45
  var autoFocus = _ref.autoFocus,
22
46
  id = _ref.id,
@@ -28,25 +52,36 @@ function MentionWithProfileCard(_ref) {
28
52
  onMouseEnter = _ref.onMouseEnter,
29
53
  onMouseLeave = _ref.onMouseLeave,
30
54
  localId = _ref.localId,
31
- ssrPlaceholderId = _ref.ssrPlaceholderId;
55
+ ssrPlaceholderId = _ref.ssrPlaceholderId,
56
+ userType = _ref.userType;
32
57
  var cloudId = profilecardProvider.cloudId,
33
58
  renderUserMentionCard = profilecardProvider.renderUserMentionCard,
34
59
  resourceClient = profilecardProvider.resourceClient;
35
60
  var actions = (0, _react.useMemo)(function () {
36
61
  return profilecardProvider.getActions(id, text, accessLevel);
37
62
  }, [accessLevel, id, profilecardProvider, text]);
63
+ var mention = /*#__PURE__*/_react.default.createElement(_mention.ResourcedMention, {
64
+ id: id,
65
+ text: text,
66
+ accessLevel: accessLevel,
67
+ localId: localId,
68
+ mentionProvider: mentionProvider,
69
+ onClick: onClick,
70
+ onMouseEnter: onMouseEnter,
71
+ onMouseLeave: onMouseLeave,
72
+ ssrPlaceholderId: ssrPlaceholderId
73
+ });
74
+
75
+ // Agent mentions (userType 'APP') open the Rovo agent profile card on click.
76
+ if (userType === 'APP' && cloudId && (0, _platformFeatureFlags.fg)('rovo_chat_agent_selection')) {
77
+ return /*#__PURE__*/_react.default.createElement(AgentProfileCardTrigger, {
78
+ agentId: id,
79
+ cloudId: cloudId,
80
+ resourceClient: resourceClient,
81
+ trigger: "click"
82
+ }, mention);
83
+ }
38
84
  if ((0, _platformFeatureFlags.fg)('people-teams_migrate-user-profile-card')) {
39
- var mention = /*#__PURE__*/_react.default.createElement(_mention.ResourcedMention, {
40
- id: id,
41
- text: text,
42
- accessLevel: accessLevel,
43
- localId: localId,
44
- mentionProvider: mentionProvider,
45
- onClick: onClick,
46
- onMouseEnter: onMouseEnter,
47
- onMouseLeave: onMouseLeave,
48
- ssrPlaceholderId: ssrPlaceholderId
49
- });
50
85
  if (renderUserMentionCard) {
51
86
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderUserMentionCard({
52
87
  userId: id,
@@ -82,15 +117,5 @@ function MentionWithProfileCard(_ref) {
82
117
  ariaLabel: text.replace(AT_PREFIX_REGEX, ''),
83
118
  ssrPlaceholderId: ssrPlaceholderId,
84
119
  isRenderedInPortal: (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
85
- }, /*#__PURE__*/_react.default.createElement(_mention.ResourcedMention, {
86
- id: id,
87
- text: text,
88
- accessLevel: accessLevel,
89
- localId: localId,
90
- mentionProvider: mentionProvider,
91
- onClick: onClick,
92
- onMouseEnter: onMouseEnter,
93
- onMouseLeave: onMouseLeave,
94
- ssrPlaceholderId: ssrPlaceholderId
95
- }));
120
+ }, mention);
96
121
  }
@@ -19,7 +19,8 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
19
19
  mentionProvider = _ref.mentionProvider,
20
20
  profilecardProviderResolver = _ref.profilecardProvider,
21
21
  text = _ref.text,
22
- localId = _ref.localId;
22
+ localId = _ref.localId,
23
+ userType = _ref.userType;
23
24
  var _useState = (0, _react.useState)(null),
24
25
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
25
26
  profilecardProvider = _useState2[0],
@@ -53,6 +54,7 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
53
54
  text: text,
54
55
  accessLevel: accessLevel,
55
56
  localId: localId,
57
+ userType: userType,
56
58
  mentionProvider: mentionProvider
57
59
  // Ignored via go/ees005
58
60
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -5,11 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getBreakoutResizableNodeTypes = void 0;
7
7
  var getBreakoutResizableNodeTypes = exports.getBreakoutResizableNodeTypes = function getBreakoutResizableNodeTypes(schema) {
8
+ var isRuleAndPanelResizingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
8
9
  var _schema$nodes = schema.nodes,
9
10
  expand = _schema$nodes.expand,
10
11
  codeBlock = _schema$nodes.codeBlock,
11
12
  layoutSection = _schema$nodes.layoutSection,
12
13
  syncBlock = _schema$nodes.syncBlock,
13
- bodiedSyncBlock = _schema$nodes.bodiedSyncBlock;
14
- return new Set([expand, codeBlock, layoutSection, syncBlock, bodiedSyncBlock]);
14
+ bodiedSyncBlock = _schema$nodes.bodiedSyncBlock,
15
+ rule = _schema$nodes.rule,
16
+ panel = _schema$nodes.panel;
17
+ var breakoutResizableNodeTypes = [expand, codeBlock, layoutSection, syncBlock, bodiedSyncBlock];
18
+ if (isRuleAndPanelResizingEnabled) {
19
+ breakoutResizableNodeTypes.push(rule, panel);
20
+ }
21
+ return new Set(breakoutResizableNodeTypes);
15
22
  };
@@ -4,18 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getLinkDomain = getLinkDomain;
7
+ // Ignored via go/ees005
8
+ // eslint-disable-next-line require-unicode-regexp
9
+ var PROTOCOL_REGEX = /^(.*):\/\//;
10
+ // Ignored via go/ees005
11
+ // eslint-disable-next-line require-unicode-regexp
12
+ var WWW_PREFIX_REGEX = /^(www\.)/;
13
+ // Ignored via go/ees005
14
+ // eslint-disable-next-line require-unicode-regexp
15
+ var URL_SUFFIX_REGEX = /[:\/?#](.*)$/;
16
+
7
17
  // eslint-disable-next-line jsdoc/require-jsdoc
8
18
  function getLinkDomain(url) {
9
19
  // Remove protocol and www., if either exists
10
- // Ignored via go/ees005
11
- // eslint-disable-next-line require-unicode-regexp
12
- var withoutProtocol = url.toLowerCase().replace(/^(.*):\/\//, '');
13
- // Ignored via go/ees005
14
- // eslint-disable-next-line require-unicode-regexp
15
- var withoutWWW = withoutProtocol.replace(/^(www\.)/, '');
16
-
20
+ var withoutProtocol = url.toLowerCase().replace(PROTOCOL_REGEX, '');
21
+ var withoutWWW = withoutProtocol.replace(WWW_PREFIX_REGEX, '');
17
22
  // Remove port, fragment, path, query string
18
- // Ignored via go/ees005
19
- // eslint-disable-next-line require-unicode-regexp
20
- return withoutWWW.replace(/[:\/?#](.*)$/, '');
23
+ return withoutWWW.replace(URL_SUFFIX_REGEX, '');
21
24
  }
@@ -39,5 +39,15 @@ export const messages = defineMessages({
39
39
  id: 'fabric.editor.breakout.resizeElement',
40
40
  defaultMessage: 'Resize element',
41
41
  description: 'Tooltip displayed on custom element (node) width resize handle'
42
+ },
43
+ resizeRule: {
44
+ id: 'fabric.editor.breakout.resizeRule',
45
+ defaultMessage: 'Resize divider',
46
+ description: 'Tooltip displayed on custom divider width resize handle'
47
+ },
48
+ resizePanel: {
49
+ id: 'fabric.editor.breakout.resizePanel',
50
+ defaultMessage: 'Resize panel',
51
+ description: 'Tooltip displayed on custom panel width resize handle'
42
52
  }
43
53
  });
@@ -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 = "116.20.0";
17
+ const packageVersion = "116.21.0";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "116.20.0";
17
+ const packageVersion = "116.21.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -14,7 +14,8 @@ export default class Mention extends PureComponent {
14
14
  eventHandlers,
15
15
  id,
16
16
  text,
17
- localId
17
+ localId,
18
+ userType
18
19
  } = this.props;
19
20
  const {
20
21
  mentionProvider,
@@ -25,6 +26,7 @@ export default class Mention extends PureComponent {
25
26
  text: text,
26
27
  accessLevel: accessLevel,
27
28
  localId: localId,
29
+ userType: userType,
28
30
  eventHandlers: eventHandlers,
29
31
  mentionProvider: mentionProvider,
30
32
  profilecardProvider: profilecardProvider
@@ -1,13 +1,29 @@
1
1
  import React, { useMemo } from 'react';
2
+ import Loadable from 'react-loadable';
2
3
  import { ResourcedMention } from '@atlaskit/mention';
3
4
  import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import Anchor from '@atlaskit/primitives/anchor';
5
6
  import ProfileCardTrigger from '@atlaskit/profilecard/user';
6
7
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
7
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
+ // Lazy-loaded so the agent profile card chunk (and its `@atlaskit/rovo-agent-components`
10
+ // dependency) stays off the critical path — it is only fetched when an agent mention
11
+ // (`userType === 'APP'`) actually renders, never for person mentions.
12
+ // Uses react-loadable to match editor-common's code-splitting factory (see src/icons/index.ts).
13
+ const AgentProfileCardTrigger = Loadable({
14
+ loader: () => import( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
15
+ '@atlaskit/profilecard/agent-profile-card-trigger').then(mod => mod.AgentProfileCardTrigger),
16
+ loading: () => null
17
+ });
18
+
8
19
  // Ignored via go/ees005
9
20
  // eslint-disable-next-line require-unicode-regexp
10
21
  const AT_PREFIX_REGEX = /^@/;
22
+ /**
23
+ * Renders a mention chip wrapped in the appropriate profile card trigger.
24
+ * 1. Agent mentions (`userType === 'APP'`, behind `rovo_chat_agent_selection`) open the Rovo agent profile card on click.
25
+ * 2. Otherwise renders the person profile card (either via the provider's `renderUserMentionCard`/link fallback or the default user `ProfileCardTrigger`).
26
+ */
11
27
  export default function MentionWithProfileCard({
12
28
  autoFocus,
13
29
  id,
@@ -19,7 +35,8 @@ export default function MentionWithProfileCard({
19
35
  onMouseEnter,
20
36
  onMouseLeave,
21
37
  localId,
22
- ssrPlaceholderId
38
+ ssrPlaceholderId,
39
+ userType
23
40
  }) {
24
41
  const {
25
42
  cloudId,
@@ -27,18 +44,28 @@ export default function MentionWithProfileCard({
27
44
  resourceClient
28
45
  } = profilecardProvider;
29
46
  const actions = useMemo(() => profilecardProvider.getActions(id, text, accessLevel), [accessLevel, id, profilecardProvider, text]);
47
+ const mention = /*#__PURE__*/React.createElement(ResourcedMention, {
48
+ id: id,
49
+ text: text,
50
+ accessLevel: accessLevel,
51
+ localId: localId,
52
+ mentionProvider: mentionProvider,
53
+ onClick: onClick,
54
+ onMouseEnter: onMouseEnter,
55
+ onMouseLeave: onMouseLeave,
56
+ ssrPlaceholderId: ssrPlaceholderId
57
+ });
58
+
59
+ // Agent mentions (userType 'APP') open the Rovo agent profile card on click.
60
+ if (userType === 'APP' && cloudId && fg('rovo_chat_agent_selection')) {
61
+ return /*#__PURE__*/React.createElement(AgentProfileCardTrigger, {
62
+ agentId: id,
63
+ cloudId: cloudId,
64
+ resourceClient: resourceClient,
65
+ trigger: "click"
66
+ }, mention);
67
+ }
30
68
  if (fg('people-teams_migrate-user-profile-card')) {
31
- const mention = /*#__PURE__*/React.createElement(ResourcedMention, {
32
- id: id,
33
- text: text,
34
- accessLevel: accessLevel,
35
- localId: localId,
36
- mentionProvider: mentionProvider,
37
- onClick: onClick,
38
- onMouseEnter: onMouseEnter,
39
- onMouseLeave: onMouseLeave,
40
- ssrPlaceholderId: ssrPlaceholderId
41
- });
42
69
  if (renderUserMentionCard) {
43
70
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderUserMentionCard({
44
71
  userId: id,
@@ -75,15 +102,5 @@ export default function MentionWithProfileCard({
75
102
  ariaLabel: text.replace(AT_PREFIX_REGEX, ''),
76
103
  ssrPlaceholderId: ssrPlaceholderId,
77
104
  isRenderedInPortal: expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
78
- }, /*#__PURE__*/React.createElement(ResourcedMention, {
79
- id: id,
80
- text: text,
81
- accessLevel: accessLevel,
82
- localId: localId,
83
- mentionProvider: mentionProvider,
84
- onClick: onClick,
85
- onMouseEnter: onMouseEnter,
86
- onMouseLeave: onMouseLeave,
87
- ssrPlaceholderId: ssrPlaceholderId
88
- }));
105
+ }, mention);
89
106
  }
@@ -9,7 +9,8 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
9
9
  mentionProvider,
10
10
  profilecardProvider: profilecardProviderResolver,
11
11
  text,
12
- localId
12
+ localId,
13
+ userType
13
14
  }) => {
14
15
  const [profilecardProvider, setProfilecardProvider] = useState(null);
15
16
  const mountedRef = useRef(true);
@@ -41,6 +42,7 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
41
42
  text: text,
42
43
  accessLevel: accessLevel,
43
44
  localId: localId,
45
+ userType: userType,
44
46
  mentionProvider: mentionProvider
45
47
  // Ignored via go/ees005
46
48
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -1,10 +1,16 @@
1
- export const getBreakoutResizableNodeTypes = schema => {
1
+ export const getBreakoutResizableNodeTypes = (schema, isRuleAndPanelResizingEnabled = false) => {
2
2
  const {
3
3
  expand,
4
4
  codeBlock,
5
5
  layoutSection,
6
6
  syncBlock,
7
- bodiedSyncBlock
7
+ bodiedSyncBlock,
8
+ rule,
9
+ panel
8
10
  } = schema.nodes;
9
- return new Set([expand, codeBlock, layoutSection, syncBlock, bodiedSyncBlock]);
11
+ const breakoutResizableNodeTypes = [expand, codeBlock, layoutSection, syncBlock, bodiedSyncBlock];
12
+ if (isRuleAndPanelResizingEnabled) {
13
+ breakoutResizableNodeTypes.push(rule, panel);
14
+ }
15
+ return new Set(breakoutResizableNodeTypes);
10
16
  };
@@ -1,15 +1,18 @@
1
+ // Ignored via go/ees005
2
+ // eslint-disable-next-line require-unicode-regexp
3
+ const PROTOCOL_REGEX = /^(.*):\/\//;
4
+ // Ignored via go/ees005
5
+ // eslint-disable-next-line require-unicode-regexp
6
+ const WWW_PREFIX_REGEX = /^(www\.)/;
7
+ // Ignored via go/ees005
8
+ // eslint-disable-next-line require-unicode-regexp
9
+ const URL_SUFFIX_REGEX = /[:\/?#](.*)$/;
10
+
1
11
  // eslint-disable-next-line jsdoc/require-jsdoc
2
12
  export function getLinkDomain(url) {
3
13
  // Remove protocol and www., if either exists
4
- // Ignored via go/ees005
5
- // eslint-disable-next-line require-unicode-regexp
6
- const withoutProtocol = url.toLowerCase().replace(/^(.*):\/\//, '');
7
- // Ignored via go/ees005
8
- // eslint-disable-next-line require-unicode-regexp
9
- const withoutWWW = withoutProtocol.replace(/^(www\.)/, '');
10
-
14
+ const withoutProtocol = url.toLowerCase().replace(PROTOCOL_REGEX, '');
15
+ const withoutWWW = withoutProtocol.replace(WWW_PREFIX_REGEX, '');
11
16
  // Remove port, fragment, path, query string
12
- // Ignored via go/ees005
13
- // eslint-disable-next-line require-unicode-regexp
14
- return withoutWWW.replace(/[:\/?#](.*)$/, '');
17
+ return withoutWWW.replace(URL_SUFFIX_REGEX, '');
15
18
  }
@@ -39,5 +39,15 @@ export var messages = defineMessages({
39
39
  id: 'fabric.editor.breakout.resizeElement',
40
40
  defaultMessage: 'Resize element',
41
41
  description: 'Tooltip displayed on custom element (node) width resize handle'
42
+ },
43
+ resizeRule: {
44
+ id: 'fabric.editor.breakout.resizeRule',
45
+ defaultMessage: 'Resize divider',
46
+ description: 'Tooltip displayed on custom divider width resize handle'
47
+ },
48
+ resizePanel: {
49
+ id: 'fabric.editor.breakout.resizePanel',
50
+ defaultMessage: 'Resize panel',
51
+ description: 'Tooltip displayed on custom panel width resize handle'
42
52
  }
43
53
  });
@@ -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 = "116.20.0";
23
+ var packageVersion = "116.21.0";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "116.20.0";
24
+ var packageVersion = "116.21.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -23,7 +23,8 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
23
23
  eventHandlers = _this$props.eventHandlers,
24
24
  id = _this$props.id,
25
25
  text = _this$props.text,
26
- localId = _this$props.localId;
26
+ localId = _this$props.localId,
27
+ userType = _this$props.userType;
27
28
  var mentionProvider = providers.mentionProvider,
28
29
  profilecardProvider = providers.profilecardProvider;
29
30
  return /*#__PURE__*/React.createElement(MentionWithProviders, {
@@ -31,6 +32,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
31
32
  text: text,
32
33
  accessLevel: accessLevel,
33
34
  localId: localId,
35
+ userType: userType,
34
36
  eventHandlers: eventHandlers,
35
37
  mentionProvider: mentionProvider,
36
38
  profilecardProvider: profilecardProvider
@@ -1,13 +1,35 @@
1
1
  import React, { useMemo } from 'react';
2
+ import Loadable from 'react-loadable';
2
3
  import { ResourcedMention } from '@atlaskit/mention';
3
4
  import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import Anchor from '@atlaskit/primitives/anchor';
5
6
  import ProfileCardTrigger from '@atlaskit/profilecard/user';
6
7
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
7
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
+ // Lazy-loaded so the agent profile card chunk (and its `@atlaskit/rovo-agent-components`
10
+ // dependency) stays off the critical path — it is only fetched when an agent mention
11
+ // (`userType === 'APP'`) actually renders, never for person mentions.
12
+ // Uses react-loadable to match editor-common's code-splitting factory (see src/icons/index.ts).
13
+ var AgentProfileCardTrigger = Loadable({
14
+ loader: function loader() {
15
+ return import( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
16
+ '@atlaskit/profilecard/agent-profile-card-trigger').then(function (mod) {
17
+ return mod.AgentProfileCardTrigger;
18
+ });
19
+ },
20
+ loading: function loading() {
21
+ return null;
22
+ }
23
+ });
24
+
8
25
  // Ignored via go/ees005
9
26
  // eslint-disable-next-line require-unicode-regexp
10
27
  var AT_PREFIX_REGEX = /^@/;
28
+ /**
29
+ * Renders a mention chip wrapped in the appropriate profile card trigger.
30
+ * 1. Agent mentions (`userType === 'APP'`, behind `rovo_chat_agent_selection`) open the Rovo agent profile card on click.
31
+ * 2. Otherwise renders the person profile card (either via the provider's `renderUserMentionCard`/link fallback or the default user `ProfileCardTrigger`).
32
+ */
11
33
  export default function MentionWithProfileCard(_ref) {
12
34
  var autoFocus = _ref.autoFocus,
13
35
  id = _ref.id,
@@ -19,25 +41,36 @@ export default function MentionWithProfileCard(_ref) {
19
41
  onMouseEnter = _ref.onMouseEnter,
20
42
  onMouseLeave = _ref.onMouseLeave,
21
43
  localId = _ref.localId,
22
- ssrPlaceholderId = _ref.ssrPlaceholderId;
44
+ ssrPlaceholderId = _ref.ssrPlaceholderId,
45
+ userType = _ref.userType;
23
46
  var cloudId = profilecardProvider.cloudId,
24
47
  renderUserMentionCard = profilecardProvider.renderUserMentionCard,
25
48
  resourceClient = profilecardProvider.resourceClient;
26
49
  var actions = useMemo(function () {
27
50
  return profilecardProvider.getActions(id, text, accessLevel);
28
51
  }, [accessLevel, id, profilecardProvider, text]);
52
+ var mention = /*#__PURE__*/React.createElement(ResourcedMention, {
53
+ id: id,
54
+ text: text,
55
+ accessLevel: accessLevel,
56
+ localId: localId,
57
+ mentionProvider: mentionProvider,
58
+ onClick: onClick,
59
+ onMouseEnter: onMouseEnter,
60
+ onMouseLeave: onMouseLeave,
61
+ ssrPlaceholderId: ssrPlaceholderId
62
+ });
63
+
64
+ // Agent mentions (userType 'APP') open the Rovo agent profile card on click.
65
+ if (userType === 'APP' && cloudId && fg('rovo_chat_agent_selection')) {
66
+ return /*#__PURE__*/React.createElement(AgentProfileCardTrigger, {
67
+ agentId: id,
68
+ cloudId: cloudId,
69
+ resourceClient: resourceClient,
70
+ trigger: "click"
71
+ }, mention);
72
+ }
29
73
  if (fg('people-teams_migrate-user-profile-card')) {
30
- var mention = /*#__PURE__*/React.createElement(ResourcedMention, {
31
- id: id,
32
- text: text,
33
- accessLevel: accessLevel,
34
- localId: localId,
35
- mentionProvider: mentionProvider,
36
- onClick: onClick,
37
- onMouseEnter: onMouseEnter,
38
- onMouseLeave: onMouseLeave,
39
- ssrPlaceholderId: ssrPlaceholderId
40
- });
41
74
  if (renderUserMentionCard) {
42
75
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderUserMentionCard({
43
76
  userId: id,
@@ -73,15 +106,5 @@ export default function MentionWithProfileCard(_ref) {
73
106
  ariaLabel: text.replace(AT_PREFIX_REGEX, ''),
74
107
  ssrPlaceholderId: ssrPlaceholderId,
75
108
  isRenderedInPortal: expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
76
- }, /*#__PURE__*/React.createElement(ResourcedMention, {
77
- id: id,
78
- text: text,
79
- accessLevel: accessLevel,
80
- localId: localId,
81
- mentionProvider: mentionProvider,
82
- onClick: onClick,
83
- onMouseEnter: onMouseEnter,
84
- onMouseLeave: onMouseLeave,
85
- ssrPlaceholderId: ssrPlaceholderId
86
- }));
109
+ }, mention);
87
110
  }
@@ -10,7 +10,8 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref) {
10
10
  mentionProvider = _ref.mentionProvider,
11
11
  profilecardProviderResolver = _ref.profilecardProvider,
12
12
  text = _ref.text,
13
- localId = _ref.localId;
13
+ localId = _ref.localId,
14
+ userType = _ref.userType;
14
15
  var _useState = useState(null),
15
16
  _useState2 = _slicedToArray(_useState, 2),
16
17
  profilecardProvider = _useState2[0],
@@ -44,6 +45,7 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref) {
44
45
  text: text,
45
46
  accessLevel: accessLevel,
46
47
  localId: localId,
48
+ userType: userType,
47
49
  mentionProvider: mentionProvider
48
50
  // Ignored via go/ees005
49
51
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -1,9 +1,16 @@
1
1
  export var getBreakoutResizableNodeTypes = function getBreakoutResizableNodeTypes(schema) {
2
+ var isRuleAndPanelResizingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2
3
  var _schema$nodes = schema.nodes,
3
4
  expand = _schema$nodes.expand,
4
5
  codeBlock = _schema$nodes.codeBlock,
5
6
  layoutSection = _schema$nodes.layoutSection,
6
7
  syncBlock = _schema$nodes.syncBlock,
7
- bodiedSyncBlock = _schema$nodes.bodiedSyncBlock;
8
- return new Set([expand, codeBlock, layoutSection, syncBlock, bodiedSyncBlock]);
8
+ bodiedSyncBlock = _schema$nodes.bodiedSyncBlock,
9
+ rule = _schema$nodes.rule,
10
+ panel = _schema$nodes.panel;
11
+ var breakoutResizableNodeTypes = [expand, codeBlock, layoutSection, syncBlock, bodiedSyncBlock];
12
+ if (isRuleAndPanelResizingEnabled) {
13
+ breakoutResizableNodeTypes.push(rule, panel);
14
+ }
15
+ return new Set(breakoutResizableNodeTypes);
9
16
  };
@@ -1,15 +1,18 @@
1
+ // Ignored via go/ees005
2
+ // eslint-disable-next-line require-unicode-regexp
3
+ var PROTOCOL_REGEX = /^(.*):\/\//;
4
+ // Ignored via go/ees005
5
+ // eslint-disable-next-line require-unicode-regexp
6
+ var WWW_PREFIX_REGEX = /^(www\.)/;
7
+ // Ignored via go/ees005
8
+ // eslint-disable-next-line require-unicode-regexp
9
+ var URL_SUFFIX_REGEX = /[:\/?#](.*)$/;
10
+
1
11
  // eslint-disable-next-line jsdoc/require-jsdoc
2
12
  export function getLinkDomain(url) {
3
13
  // Remove protocol and www., if either exists
4
- // Ignored via go/ees005
5
- // eslint-disable-next-line require-unicode-regexp
6
- var withoutProtocol = url.toLowerCase().replace(/^(.*):\/\//, '');
7
- // Ignored via go/ees005
8
- // eslint-disable-next-line require-unicode-regexp
9
- var withoutWWW = withoutProtocol.replace(/^(www\.)/, '');
10
-
14
+ var withoutProtocol = url.toLowerCase().replace(PROTOCOL_REGEX, '');
15
+ var withoutWWW = withoutProtocol.replace(WWW_PREFIX_REGEX, '');
11
16
  // Remove port, fragment, path, query string
12
- // Ignored via go/ees005
13
- // eslint-disable-next-line require-unicode-regexp
14
- return withoutWWW.replace(/[:\/?#](.*)$/, '');
17
+ return withoutWWW.replace(URL_SUFFIX_REGEX, '');
15
18
  }
@@ -1,42 +1,52 @@
1
1
  export declare const messages: {
2
- maxWidthLabel: {
3
- id: string;
2
+ fullWidthLabel: {
4
3
  defaultMessage: string;
5
4
  description: string;
6
- };
7
- fullWidthLabel: {
8
5
  id: string;
6
+ };
7
+ maxWidthLabel: {
9
8
  defaultMessage: string;
10
9
  description: string;
11
- };
12
- wideWidthLabel: {
13
10
  id: string;
11
+ };
12
+ resizeCodeBlock: {
14
13
  defaultMessage: string;
15
14
  description: string;
16
- };
17
- resizeHandle: {
18
15
  id: string;
16
+ };
17
+ resizeElement: {
19
18
  defaultMessage: string;
20
19
  description: string;
20
+ id: string;
21
21
  };
22
22
  resizeExpand: {
23
- id: string;
24
23
  defaultMessage: string;
25
24
  description: string;
26
- };
27
- resizeCodeBlock: {
28
25
  id: string;
26
+ };
27
+ resizeHandle: {
29
28
  defaultMessage: string;
30
29
  description: string;
30
+ id: string;
31
31
  };
32
32
  resizeLayout: {
33
+ defaultMessage: string;
34
+ description: string;
33
35
  id: string;
36
+ };
37
+ resizePanel: {
34
38
  defaultMessage: string;
35
39
  description: string;
40
+ id: string;
36
41
  };
37
- resizeElement: {
42
+ resizeRule: {
43
+ defaultMessage: string;
44
+ description: string;
38
45
  id: string;
46
+ };
47
+ wideWidthLabel: {
39
48
  defaultMessage: string;
40
49
  description: string;
50
+ id: string;
41
51
  };
42
52
  };
@@ -1,4 +1,5 @@
1
1
  import React, { PureComponent } from 'react';
2
+ import type { MentionUserType } from '@atlaskit/adf-schema';
2
3
  import { ProviderFactory } from '../../provider-factory';
3
4
  import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
5
  import type { MentionEventHandlers } from '../EventHandlers';
@@ -9,6 +10,7 @@ export interface MentionProps {
9
10
  localId?: string;
10
11
  providers?: ProviderFactory;
11
12
  text: string;
13
+ userType?: MentionUserType;
12
14
  }
13
15
  export interface MentionState {
14
16
  profilecardProvider: ProfilecardProvider | null;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { MentionUserType } from '@atlaskit/adf-schema';
2
3
  import type { MentionProvider } from '@atlaskit/mention';
3
4
  import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
5
  import type { MentionEventHandler } from '../EventHandlers';
@@ -14,5 +15,11 @@ export interface Props {
14
15
  profilecardProvider: ProfilecardProvider;
15
16
  ssrPlaceholderId?: string;
16
17
  text: string;
18
+ userType?: MentionUserType;
17
19
  }
18
- export default function MentionWithProfileCard({ autoFocus, id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, ssrPlaceholderId, }: Props): React.JSX.Element;
20
+ /**
21
+ * Renders a mention chip wrapped in the appropriate profile card trigger.
22
+ * 1. Agent mentions (`userType === 'APP'`, behind `rovo_chat_agent_selection`) open the Rovo agent profile card on click.
23
+ * 2. Otherwise renders the person profile card (either via the provider's `renderUserMentionCard`/link fallback or the default user `ProfileCardTrigger`).
24
+ */
25
+ export default function MentionWithProfileCard({ autoFocus, id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, ssrPlaceholderId, userType, }: Props): React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { MentionUserType } from '@atlaskit/adf-schema';
2
3
  import type { MentionProvider } from '@atlaskit/mention/resource';
3
4
  import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
5
  import type { MentionEventHandlers } from '../EventHandlers';
@@ -10,6 +11,7 @@ export interface Props {
10
11
  mentionProvider?: Promise<MentionProvider>;
11
12
  profilecardProvider?: Promise<ProfilecardProvider>;
12
13
  text: string;
14
+ userType?: MentionUserType;
13
15
  }
14
16
  export interface State {
15
17
  profilecardProvider: ProfilecardProvider | null;
@@ -1,2 +1,2 @@
1
1
  import type { NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
2
- export declare const getBreakoutResizableNodeTypes: (schema: Schema) => Set<NodeType>;
2
+ export declare const getBreakoutResizableNodeTypes: (schema: Schema, isRuleAndPanelResizingEnabled?: boolean) => Set<NodeType>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "116.20.1",
3
+ "version": "116.21.1",
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/"
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/platform-feature-flags": "^2.0.0",
70
70
  "@atlaskit/platform-feature-flags-react": "^1.1.0",
71
71
  "@atlaskit/primitives": "^20.3.0",
72
- "@atlaskit/profilecard": "^26.7.0",
72
+ "@atlaskit/profilecard": "^26.8.0",
73
73
  "@atlaskit/prosemirror-history": "^1.0.0",
74
74
  "@atlaskit/react-compiler-gating": "^0.2.0",
75
75
  "@atlaskit/react-ufo": "^7.3.0",
@@ -122,6 +122,8 @@
122
122
  "devDependencies": {
123
123
  "@atlaskit/media-core": "^38.0.0",
124
124
  "@atlassian/a11y-jest-testing": "^0.13.0",
125
+ "@atlassian/feature-flags-test-utils": "^1.1.0",
126
+ "@atlassian/testing-library": "^0.7.0",
125
127
  "@testing-library/dom": "^10.1.0",
126
128
  "@testing-library/jest-dom": "^6.4.5",
127
129
  "@testing-library/react": "^16.3.0",
@@ -157,6 +159,9 @@
157
159
  }
158
160
  },
159
161
  "platform-feature-flags": {
162
+ "rovo_chat_agent_selection": {
163
+ "type": "boolean"
164
+ },
160
165
  "confluence_frontend_native_tabs_extension": {
161
166
  "type": "boolean"
162
167
  },