@atlaskit/editor-plugin-mentions 17.1.13 → 17.1.14

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,15 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 17.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f10c984a92b15`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f10c984a92b15) -
8
+ Add `platform_editor_agent_mentions_no_task_autofire`. It removes the special case where an agent
9
+ `@mention` in a task item auto-invokes Rovo on creation. When the gate is on, task-item mentions
10
+ are no longer exempt from the shared nudge-suppression guards, so they follow the same path as
11
+ every other block. With the gate off the current task-item behaviour is unchanged.
12
+
3
13
  ## 17.1.13
4
14
 
5
15
  ### Patch Changes
@@ -67,7 +67,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
67
67
  var AGENT_MENTION_INACTIVITY_MS = 3000;
68
68
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
69
69
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
70
- var PACKAGE_VERSION = "17.1.12";
70
+ var PACKAGE_VERSION = "17.1.13";
71
71
  var setProvider = function setProvider(provider) {
72
72
  return function (state, dispatch) {
73
73
  if (dispatch) {
@@ -724,7 +724,10 @@ function createMentionPlugin(_ref2) {
724
724
  var _options$getIsRovoPan;
725
725
  // Suppress the nudge for pasted/non-typed agent mentions when Rovo is already
726
726
  // open.
727
- var isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem';
727
+ // Task items are exempt only while
728
+ // platform_editor_agent_mentions_no_task_autofire is off (they auto-fire
729
+ // instead). With it on they are suppressed like every other block.
730
+ var isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem' && !(0, _platformFeatureFlags.fg)('platform_editor_agent_mentions_no_task_autofire');
728
731
  if (!isTaskItemMentionForPaste && isNewInsertion && options !== null && options !== void 0 && (_options$getIsRovoPan = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan !== void 0 && _options$getIsRovoPan.call(options)) {
729
732
  // Rovo is already open — skip setting lastInsertedAgentMention* so the
730
733
  // downstream nudge listener never fires.
@@ -789,8 +792,11 @@ function createMentionPlugin(_ref2) {
789
792
  var _options$getIsRovoPan2;
790
793
  // Suppress the nudge when Rovo chat is already open, mirroring the same
791
794
  // guard used in the inactivity-timer path. Task-item mentions are
792
- // exempt because they auto-fire the mini modal and never show a nudge.
793
- if (pendingMentionDetails.parentNodeType !== 'taskItem' && options !== null && options !== void 0 && (_options$getIsRovoPan2 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan2 !== void 0 && _options$getIsRovoPan2.call(options)) {
795
+ // exempt only while platform_editor_agent_mentions_no_task_autofire is off
796
+ // (they auto-fire the mini modal and never show a nudge). With it on they
797
+ // are suppressed like any block.
798
+ var isTaskItemMention = pendingMentionDetails.parentNodeType === 'taskItem' && !(0, _platformFeatureFlags.fg)('platform_editor_agent_mentions_no_task_autofire');
799
+ if (!isTaskItemMention && options !== null && options !== void 0 && (_options$getIsRovoPan2 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan2 !== void 0 && _options$getIsRovoPan2.call(options)) {
794
800
  // Discard without committing so lastInsertedAgentMention* fields are
795
801
  // never set and the downstream nudge listener never fires.
796
802
  newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
@@ -891,9 +897,11 @@ function createMentionPlugin(_ref2) {
891
897
  var _mentionPluginKey$get;
892
898
  {
893
899
  var _options$getIsRovoPan3;
894
- // Suppress the agent-mention nudge when the Rovo panel is already open,
895
- // but only for non-task-item mentions.
896
- var isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem';
900
+ // Suppress the agent-mention nudge when the Rovo panel is already open. Task
901
+ // items are exempt only while platform_editor_agent_mentions_no_task_autofire
902
+ // is off (they auto-fire instead). With it on they are suppressed like every
903
+ // other block.
904
+ var isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem' && !(0, _platformFeatureFlags.fg)('platform_editor_agent_mentions_no_task_autofire');
897
905
  if (!isTaskItemMention && options !== null && options !== void 0 && (_options$getIsRovoPan3 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan3 !== void 0 && _options$getIsRovoPan3.call(options)) {
898
906
  // Dispatch a discard so pendingTypedAgentMention is nulled out of plugin
899
907
  // state.
@@ -51,7 +51,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
51
51
  const AGENT_MENTION_INACTIVITY_MS = 3000;
52
52
  const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
53
53
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
54
- const PACKAGE_VERSION = "17.1.12";
54
+ const PACKAGE_VERSION = "17.1.13";
55
55
  const setProvider = provider => (state, dispatch) => {
56
56
  if (dispatch) {
57
57
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -683,7 +683,10 @@ export function createMentionPlugin({
683
683
  var _options$getIsRovoPan;
684
684
  // Suppress the nudge for pasted/non-typed agent mentions when Rovo is already
685
685
  // open.
686
- const isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem';
686
+ // Task items are exempt only while
687
+ // platform_editor_agent_mentions_no_task_autofire is off (they auto-fire
688
+ // instead). With it on they are suppressed like every other block.
689
+ const isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem' && !fg('platform_editor_agent_mentions_no_task_autofire');
687
690
  if (!isTaskItemMentionForPaste && isNewInsertion && options !== null && options !== void 0 && (_options$getIsRovoPan = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan !== void 0 && _options$getIsRovoPan.call(options)) {
688
691
  // Rovo is already open — skip setting lastInsertedAgentMention* so the
689
692
  // downstream nudge listener never fires.
@@ -752,8 +755,11 @@ export function createMentionPlugin({
752
755
  var _options$getIsRovoPan2;
753
756
  // Suppress the nudge when Rovo chat is already open, mirroring the same
754
757
  // guard used in the inactivity-timer path. Task-item mentions are
755
- // exempt because they auto-fire the mini modal and never show a nudge.
756
- if (pendingMentionDetails.parentNodeType !== 'taskItem' && options !== null && options !== void 0 && (_options$getIsRovoPan2 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan2 !== void 0 && _options$getIsRovoPan2.call(options)) {
758
+ // exempt only while platform_editor_agent_mentions_no_task_autofire is off
759
+ // (they auto-fire the mini modal and never show a nudge). With it on they
760
+ // are suppressed like any block.
761
+ const isTaskItemMention = pendingMentionDetails.parentNodeType === 'taskItem' && !fg('platform_editor_agent_mentions_no_task_autofire');
762
+ if (!isTaskItemMention && options !== null && options !== void 0 && (_options$getIsRovoPan2 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan2 !== void 0 && _options$getIsRovoPan2.call(options)) {
757
763
  // Discard without committing so lastInsertedAgentMention* fields are
758
764
  // never set and the downstream nudge listener never fires.
759
765
  newPluginState = {
@@ -851,9 +857,11 @@ export function createMentionPlugin({
851
857
  var _mentionPluginKey$get;
852
858
  {
853
859
  var _options$getIsRovoPan3;
854
- // Suppress the agent-mention nudge when the Rovo panel is already open,
855
- // but only for non-task-item mentions.
856
- const isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem';
860
+ // Suppress the agent-mention nudge when the Rovo panel is already open. Task
861
+ // items are exempt only while platform_editor_agent_mentions_no_task_autofire
862
+ // is off (they auto-fire instead). With it on they are suppressed like every
863
+ // other block.
864
+ const isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem' && !fg('platform_editor_agent_mentions_no_task_autofire');
857
865
  if (!isTaskItemMention && options !== null && options !== void 0 && (_options$getIsRovoPan3 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan3 !== void 0 && _options$getIsRovoPan3.call(options)) {
858
866
  // Dispatch a discard so pendingTypedAgentMention is nulled out of plugin
859
867
  // state.
@@ -58,7 +58,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
58
58
  var AGENT_MENTION_INACTIVITY_MS = 3000;
59
59
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
60
60
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
61
- var PACKAGE_VERSION = "17.1.12";
61
+ var PACKAGE_VERSION = "17.1.13";
62
62
  var setProvider = function setProvider(provider) {
63
63
  return function (state, dispatch) {
64
64
  if (dispatch) {
@@ -715,7 +715,10 @@ export function createMentionPlugin(_ref2) {
715
715
  var _options$getIsRovoPan;
716
716
  // Suppress the nudge for pasted/non-typed agent mentions when Rovo is already
717
717
  // open.
718
- var isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem';
718
+ // Task items are exempt only while
719
+ // platform_editor_agent_mentions_no_task_autofire is off (they auto-fire
720
+ // instead). With it on they are suppressed like every other block.
721
+ var isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem' && !fg('platform_editor_agent_mentions_no_task_autofire');
719
722
  if (!isTaskItemMentionForPaste && isNewInsertion && options !== null && options !== void 0 && (_options$getIsRovoPan = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan !== void 0 && _options$getIsRovoPan.call(options)) {
720
723
  // Rovo is already open — skip setting lastInsertedAgentMention* so the
721
724
  // downstream nudge listener never fires.
@@ -780,8 +783,11 @@ export function createMentionPlugin(_ref2) {
780
783
  var _options$getIsRovoPan2;
781
784
  // Suppress the nudge when Rovo chat is already open, mirroring the same
782
785
  // guard used in the inactivity-timer path. Task-item mentions are
783
- // exempt because they auto-fire the mini modal and never show a nudge.
784
- if (pendingMentionDetails.parentNodeType !== 'taskItem' && options !== null && options !== void 0 && (_options$getIsRovoPan2 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan2 !== void 0 && _options$getIsRovoPan2.call(options)) {
786
+ // exempt only while platform_editor_agent_mentions_no_task_autofire is off
787
+ // (they auto-fire the mini modal and never show a nudge). With it on they
788
+ // are suppressed like any block.
789
+ var isTaskItemMention = pendingMentionDetails.parentNodeType === 'taskItem' && !fg('platform_editor_agent_mentions_no_task_autofire');
790
+ if (!isTaskItemMention && options !== null && options !== void 0 && (_options$getIsRovoPan2 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan2 !== void 0 && _options$getIsRovoPan2.call(options)) {
785
791
  // Discard without committing so lastInsertedAgentMention* fields are
786
792
  // never set and the downstream nudge listener never fires.
787
793
  newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
@@ -882,9 +888,11 @@ export function createMentionPlugin(_ref2) {
882
888
  var _mentionPluginKey$get;
883
889
  {
884
890
  var _options$getIsRovoPan3;
885
- // Suppress the agent-mention nudge when the Rovo panel is already open,
886
- // but only for non-task-item mentions.
887
- var isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem';
891
+ // Suppress the agent-mention nudge when the Rovo panel is already open. Task
892
+ // items are exempt only while platform_editor_agent_mentions_no_task_autofire
893
+ // is off (they auto-fire instead). With it on they are suppressed like every
894
+ // other block.
895
+ var isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem' && !fg('platform_editor_agent_mentions_no_task_autofire');
888
896
  if (!isTaskItemMention && options !== null && options !== void 0 && (_options$getIsRovoPan3 = options.getIsRovoPanelOpen) !== null && _options$getIsRovoPan3 !== void 0 && _options$getIsRovoPan3.call(options)) {
889
897
  // Dispatch a discard so pendingTypedAgentMention is nulled out of plugin
890
898
  // state.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "17.1.13",
3
+ "version": "17.1.14",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -58,7 +58,7 @@
58
58
  "uuid": "^3.1.0"
59
59
  },
60
60
  "peerDependencies": {
61
- "@atlaskit/editor-common": "^119.13.0",
61
+ "@atlaskit/editor-common": "^119.14.0",
62
62
  "react": "^18.2.0 || ^19.2.0",
63
63
  "react-dom": "^18.2.0 || ^19.2.0",
64
64
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -133,6 +133,9 @@
133
133
  },
134
134
  "platform_editor_agent_mentions_invite_order": {
135
135
  "type": "boolean"
136
+ },
137
+ "platform_editor_agent_mentions_no_task_autofire": {
138
+ "type": "boolean"
136
139
  }
137
140
  },
138
141
  "platform-experiments": {