@atlaskit/editor-common 126.2.1 → 126.3.0

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-common
2
2
 
3
+ ## 126.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cba52821a44c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cba52821a44c9) -
8
+ Add suggestion generation, lifecycle timing, remix-type, and stale-regeneration analytics for
9
+ suggested edits.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 126.2.2
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 126.2.1
4
22
 
5
23
  ### Patch Changes
@@ -80,6 +80,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
80
80
  ACTION["UNDO_PERFORMED"] = "undo";
81
81
  ACTION["REDO_PERFORMED"] = "redo";
82
82
  ACTION["FORMATTED"] = "formatted";
83
+ ACTION["GENERATED"] = "generated";
83
84
  ACTION["HELP_OPENED"] = "helpOpened";
84
85
  ACTION["HIGHLIGHTED"] = "highlighted";
85
86
  ACTION["INCREMENTED"] = "incremented";
@@ -124,6 +125,8 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
124
125
  ACTION["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
125
126
  ACTION["REFERENCE_SYNCED_BLOCK_UNSYNC"] = "referenceSyncedBlockUnsync";
126
127
  ACTION["REFERENCE_SYNCED_BLOCK_COPY"] = "referenceSyncedBlockCopy";
128
+ ACTION["REGENERATION_COMPLETED"] = "regenerationCompleted";
129
+ ACTION["REGENERATION_STARTED"] = "regenerationStarted";
127
130
  ACTION["RIGHT_RAIL_CLOSED"] = "rightRailClosed";
128
131
  ACTION["RIGHT_RAIL_VIEWED"] = "rightRailViewed";
129
132
  ACTION["REPLACED_ALL"] = "replacedAll";
@@ -448,6 +451,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
448
451
  ACTION_SUBJECT_ID["CODEBLOCK_COPY"] = "codeBlockCopy";
449
452
  ACTION_SUBJECT_ID["CODEBLOCK_WRAP"] = "codeBlockWrap";
450
453
  ACTION_SUBJECT_ID["CONVERSATION_ERROR"] = "conversationError";
454
+ ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION"] = "suggestionsRegeneration";
451
455
  ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION_ERROR"] = "suggestionsRegenerationError";
452
456
  ACTION_SUBJECT_ID["SUGGESTIONS_ERROR_RETRY"] = "suggestionsErrorRetry";
453
457
  ACTION_SUBJECT_ID["COPY_BUTTON"] = "copyButton";
@@ -45,11 +45,11 @@ function createParagraphAtEnd() {
45
45
  };
46
46
  }
47
47
 
48
- // Remove this when cleaning up platform_editor_toolbar_aifc
49
48
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
50
49
  /**
50
+ * Command-based image alignment retained for legacy alignment call sites.
51
51
  *
52
- * @deprecated use changeImageAlignmentTr instead
52
+ * @deprecated use changeImageAlignmentNext instead
53
53
  */
54
54
  var changeImageAlignment = exports.changeImageAlignment = function changeImageAlignment(align) {
55
55
  return function (state, dispatch) {
@@ -96,9 +96,9 @@ var changeImageAlignmentNext = exports.changeImageAlignmentNext = function chang
96
96
  };
97
97
  };
98
98
 
99
- // Remove this when cleaning up platform_editor_toolbar_aifc
100
99
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
101
100
  /**
101
+ * Command-based block-mark updates retained for media linking and toggleBlockMark.
102
102
  *
103
103
  * @deprecated use createToggleBlockMarkOnRangeNext instead, which does not require passing editorState
104
104
  */
@@ -181,15 +181,16 @@ var createToggleInlineMarkOnRange = exports.createToggleInlineMarkOnRange = func
181
181
  };
182
182
  };
183
183
 
184
- // Remove this when cleaning up platform_editor_toolbar_aifc
185
184
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
186
185
  /**
187
- * @deprecated use toggleBlockMarkTr instead
188
186
  * Toggles block mark based on the return type of `getAttrs`.
189
187
  * This is similar to ProseMirror's `getAttrs` from `AttributeSpec`
190
188
  * return `false` to remove the mark.
191
- * return `undefined for no-op.
189
+ * return `undefined` for no-op.
192
190
  * return an `object` to update the mark.
191
+ * Retained for Command-based alignment and indentation paths.
192
+ *
193
+ * @deprecated use toggleBlockMarkNext instead
193
194
  */
194
195
  var toggleBlockMark = exports.toggleBlockMark = function toggleBlockMark(markType, getAttrs, allowedBlocks) {
195
196
  return function (state, dispatch) {
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
27
27
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
28
28
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
29
29
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
30
- var packageVersion = "126.2.0";
30
+ var packageVersion = "126.2.2";
31
31
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
32
32
  // Remove URL as it has UGC
33
33
  // 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 = "126.2.0";
27
+ var packageVersion = "126.2.2";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -76,6 +76,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
76
76
  ACTION["UNDO_PERFORMED"] = "undo";
77
77
  ACTION["REDO_PERFORMED"] = "redo";
78
78
  ACTION["FORMATTED"] = "formatted";
79
+ ACTION["GENERATED"] = "generated";
79
80
  ACTION["HELP_OPENED"] = "helpOpened";
80
81
  ACTION["HIGHLIGHTED"] = "highlighted";
81
82
  ACTION["INCREMENTED"] = "incremented";
@@ -120,6 +121,8 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
120
121
  ACTION["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
121
122
  ACTION["REFERENCE_SYNCED_BLOCK_UNSYNC"] = "referenceSyncedBlockUnsync";
122
123
  ACTION["REFERENCE_SYNCED_BLOCK_COPY"] = "referenceSyncedBlockCopy";
124
+ ACTION["REGENERATION_COMPLETED"] = "regenerationCompleted";
125
+ ACTION["REGENERATION_STARTED"] = "regenerationStarted";
123
126
  ACTION["RIGHT_RAIL_CLOSED"] = "rightRailClosed";
124
127
  ACTION["RIGHT_RAIL_VIEWED"] = "rightRailViewed";
125
128
  ACTION["REPLACED_ALL"] = "replacedAll";
@@ -456,6 +459,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
456
459
  ACTION_SUBJECT_ID["CODEBLOCK_COPY"] = "codeBlockCopy";
457
460
  ACTION_SUBJECT_ID["CODEBLOCK_WRAP"] = "codeBlockWrap";
458
461
  ACTION_SUBJECT_ID["CONVERSATION_ERROR"] = "conversationError";
462
+ ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION"] = "suggestionsRegeneration";
459
463
  ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION_ERROR"] = "suggestionsRegenerationError";
460
464
  ACTION_SUBJECT_ID["SUGGESTIONS_ERROR_RETRY"] = "suggestionsErrorRetry";
461
465
  ACTION_SUBJECT_ID["COPY_BUTTON"] = "copyButton";
@@ -36,11 +36,11 @@ export function createParagraphAtEnd() {
36
36
  };
37
37
  }
38
38
 
39
- // Remove this when cleaning up platform_editor_toolbar_aifc
40
39
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
41
40
  /**
41
+ * Command-based image alignment retained for legacy alignment call sites.
42
42
  *
43
- * @deprecated use changeImageAlignmentTr instead
43
+ * @deprecated use changeImageAlignmentNext instead
44
44
  */
45
45
  export const changeImageAlignment = align => (state, dispatch) => {
46
46
  const {
@@ -87,9 +87,9 @@ export const changeImageAlignmentNext = align => tr => {
87
87
  return false;
88
88
  };
89
89
 
90
- // Remove this when cleaning up platform_editor_toolbar_aifc
91
90
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
92
91
  /**
92
+ * Command-based block-mark updates retained for media linking and toggleBlockMark.
93
93
  *
94
94
  * @deprecated use createToggleBlockMarkOnRangeNext instead, which does not require passing editorState
95
95
  */
@@ -154,15 +154,16 @@ export const createToggleInlineMarkOnRange = (markType, getAttrs) => (from, to,
154
154
  return markApplied;
155
155
  };
156
156
 
157
- // Remove this when cleaning up platform_editor_toolbar_aifc
158
157
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
159
158
  /**
160
- * @deprecated use toggleBlockMarkTr instead
161
159
  * Toggles block mark based on the return type of `getAttrs`.
162
160
  * This is similar to ProseMirror's `getAttrs` from `AttributeSpec`
163
161
  * return `false` to remove the mark.
164
- * return `undefined for no-op.
162
+ * return `undefined` for no-op.
165
163
  * return an `object` to update the mark.
164
+ * Retained for Command-based alignment and indentation paths.
165
+ *
166
+ * @deprecated use toggleBlockMarkNext instead
166
167
  */
167
168
  export const toggleBlockMark = (markType, getAttrs, allowedBlocks) => (state, dispatch) => {
168
169
  let markApplied = false;
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "126.2.0";
16
+ const packageVersion = "126.2.2";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags/fg';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "126.2.0";
17
+ const packageVersion = "126.2.2";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -76,6 +76,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
76
76
  ACTION["UNDO_PERFORMED"] = "undo";
77
77
  ACTION["REDO_PERFORMED"] = "redo";
78
78
  ACTION["FORMATTED"] = "formatted";
79
+ ACTION["GENERATED"] = "generated";
79
80
  ACTION["HELP_OPENED"] = "helpOpened";
80
81
  ACTION["HIGHLIGHTED"] = "highlighted";
81
82
  ACTION["INCREMENTED"] = "incremented";
@@ -120,6 +121,8 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
120
121
  ACTION["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
121
122
  ACTION["REFERENCE_SYNCED_BLOCK_UNSYNC"] = "referenceSyncedBlockUnsync";
122
123
  ACTION["REFERENCE_SYNCED_BLOCK_COPY"] = "referenceSyncedBlockCopy";
124
+ ACTION["REGENERATION_COMPLETED"] = "regenerationCompleted";
125
+ ACTION["REGENERATION_STARTED"] = "regenerationStarted";
123
126
  ACTION["RIGHT_RAIL_CLOSED"] = "rightRailClosed";
124
127
  ACTION["RIGHT_RAIL_VIEWED"] = "rightRailViewed";
125
128
  ACTION["REPLACED_ALL"] = "replacedAll";
@@ -456,6 +459,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
456
459
  ACTION_SUBJECT_ID["CODEBLOCK_COPY"] = "codeBlockCopy";
457
460
  ACTION_SUBJECT_ID["CODEBLOCK_WRAP"] = "codeBlockWrap";
458
461
  ACTION_SUBJECT_ID["CONVERSATION_ERROR"] = "conversationError";
462
+ ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION"] = "suggestionsRegeneration";
459
463
  ACTION_SUBJECT_ID["SUGGESTIONS_REGENERATION_ERROR"] = "suggestionsRegenerationError";
460
464
  ACTION_SUBJECT_ID["SUGGESTIONS_ERROR_RETRY"] = "suggestionsErrorRetry";
461
465
  ACTION_SUBJECT_ID["COPY_BUTTON"] = "copyButton";
@@ -27,11 +27,11 @@ export function createParagraphAtEnd() {
27
27
  };
28
28
  }
29
29
 
30
- // Remove this when cleaning up platform_editor_toolbar_aifc
31
30
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
32
31
  /**
32
+ * Command-based image alignment retained for legacy alignment call sites.
33
33
  *
34
- * @deprecated use changeImageAlignmentTr instead
34
+ * @deprecated use changeImageAlignmentNext instead
35
35
  */
36
36
  export var changeImageAlignment = function changeImageAlignment(align) {
37
37
  return function (state, dispatch) {
@@ -78,9 +78,9 @@ export var changeImageAlignmentNext = function changeImageAlignmentNext(align) {
78
78
  };
79
79
  };
80
80
 
81
- // Remove this when cleaning up platform_editor_toolbar_aifc
82
81
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
83
82
  /**
83
+ * Command-based block-mark updates retained for media linking and toggleBlockMark.
84
84
  *
85
85
  * @deprecated use createToggleBlockMarkOnRangeNext instead, which does not require passing editorState
86
86
  */
@@ -163,15 +163,16 @@ export var createToggleInlineMarkOnRange = function createToggleInlineMarkOnRang
163
163
  };
164
164
  };
165
165
 
166
- // Remove this when cleaning up platform_editor_toolbar_aifc
167
166
  // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
168
167
  /**
169
- * @deprecated use toggleBlockMarkTr instead
170
168
  * Toggles block mark based on the return type of `getAttrs`.
171
169
  * This is similar to ProseMirror's `getAttrs` from `AttributeSpec`
172
170
  * return `false` to remove the mark.
173
- * return `undefined for no-op.
171
+ * return `undefined` for no-op.
174
172
  * return an `object` to update the mark.
173
+ * Retained for Command-based alignment and indentation paths.
174
+ *
175
+ * @deprecated use toggleBlockMarkNext instead
175
176
  */
176
177
  export var toggleBlockMark = function toggleBlockMark(markType, getAttrs, allowedBlocks) {
177
178
  return function (state, dispatch) {
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "126.2.0";
22
+ var packageVersion = "126.2.2";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags/fg';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "126.2.0";
24
+ var packageVersion = "126.2.2";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -58,4 +58,4 @@ export { type TelepointerClickPayload } from './types/telepointer-events';
58
58
  export type { BlockMenuEventPayload } from './types/block-menu-events';
59
59
  export type { BreakoutEventPayload, BreakoutSupportedNodes } from './types/breakout-events';
60
60
  export type { RendererSyncBlockEventPayload, SyncBlockEventPayload, SyncedBlockSSRErrorAEP, } from './types/sync-block-events';
61
- export type { AiSuggestionsConversationErrorReason, AiSuggestionInteractionPoint, AiSuggestionsEntryPoint, AiSuggestionsEventPayload, AiSuggestionsEmptyStateType, AiSuggestionsRightRailEntryPoint, } from './types/ai-suggestions-events';
61
+ export type { AiSuggestionsConversationErrorReason, AiSuggestionInteractionPoint, AiSuggestionsEntryPoint, AiSuggestionsEventPayload, AiSuggestionsEmptyStateType, AiSuggestionsRegenerationOutcome, AiSuggestionsRegenerationTrigger, AiSuggestionsRightRailEntryPoint, } from './types/ai-suggestions-events';
@@ -21,6 +21,27 @@ export type AiSuggestionInteractionPoint = 'sidebar' | 'card' | 'statusBar';
21
21
  export type AiSuggestionsRightRailEntryPoint = 'suggestionsPanel' | 'suggestionsTab' | 'suggestionCard';
22
22
  export type AiSuggestionsEmptyStateType = 'initial' | 'noSuggestionsFound' | 'suggestionsResolved';
23
23
  export type AiSuggestionsConversationErrorReason = 'agentDeactivated' | 'agentProvisioning' | 'agentExternalConfigReference' | 'conversationSetup' | 'streamError';
24
+ export type AiSuggestionsRegenerationTrigger = 'panelOpen' | 'reviewCompleted' | 'suggestionSelected' | 'suggestionsUpdated';
25
+ export type AiSuggestionsRegenerationOutcome = 'removed' | 'stillStale' | 'updated';
26
+ type SuggestionRemixAttributes = {
27
+ remixSubtype?: string;
28
+ remixType?: string;
29
+ };
30
+ type SuggestionAgeAttribute = {
31
+ suggestionAgeMs?: number;
32
+ };
33
+ type RegenerationSuggestionDetails = SuggestionRemixAttributes & SuggestionAgeAttribute & {
34
+ actionKind: string;
35
+ outcome?: AiSuggestionsRegenerationOutcome;
36
+ suggestionId: string;
37
+ suggestionType: string;
38
+ };
39
+ type RegenerationCommonAttributes = {
40
+ currentNodeCount: number;
41
+ staleSuggestionCount: number;
42
+ suggestionDetails: RegenerationSuggestionDetails[];
43
+ trigger: AiSuggestionsRegenerationTrigger;
44
+ };
24
45
  type NoDiffSuggestionAEP = OperationalAEP<ACTION.NO_DIFF_FOUND, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
25
46
  suggestionType: string;
26
47
  toolCalls: {
@@ -34,12 +55,18 @@ type ConversationErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.AI_SUG
34
55
  reason: AiSuggestionsConversationErrorReason;
35
56
  statusCode?: number;
36
57
  }>;
37
- type RegenerateSuggestionsErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.AI_SUGGESTIONS, ACTION_SUBJECT_ID.SUGGESTIONS_REGENERATION_ERROR, {
38
- currentNodeCount: number;
58
+ type RegenerateSuggestionsErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.AI_SUGGESTIONS, ACTION_SUBJECT_ID.SUGGESTIONS_REGENERATION_ERROR, RegenerationCommonAttributes & {
39
59
  errorCode?: string;
40
- staleSuggestionCount: number;
60
+ regenerationDurationMs: number;
41
61
  statusCode?: number;
42
62
  }>;
63
+ type RegenerateSuggestionsStartedAEP = OperationalAEP<ACTION.REGENERATION_STARTED, ACTION_SUBJECT.AI_SUGGESTIONS, ACTION_SUBJECT_ID.SUGGESTIONS_REGENERATION, RegenerationCommonAttributes>;
64
+ type RegenerateSuggestionsCompletedAEP = OperationalAEP<ACTION.REGENERATION_COMPLETED, ACTION_SUBJECT.AI_SUGGESTIONS, ACTION_SUBJECT_ID.SUGGESTIONS_REGENERATION, RegenerationCommonAttributes & {
65
+ regenerationDurationMs: number;
66
+ removedSuggestionCount: number;
67
+ stillStaleSuggestionCount: number;
68
+ updatedSuggestionCount: number;
69
+ }>;
43
70
  type EntryPointClickedAEP = TrackAEP<ACTION.CLICKED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
44
71
  entryPoint: AiSuggestionsEntryPoint;
45
72
  }, undefined>;
@@ -52,18 +79,7 @@ type SuggestionsErrorRetryClickedAEP = TrackAEP<ACTION.CLICKED, ACTION_SUBJECT.A
52
79
  type EntryPointExposureAEP = TrackAEP<ACTION.EXPOSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
53
80
  entryPoint: AiSuggestionsEntryPoint;
54
81
  }, undefined>;
55
- type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
56
- affectedBlocks: number;
57
- agentId?: string;
58
- charactersAdded?: number;
59
- charactersRemoved?: number;
60
- hasSources: boolean;
61
- interactionPoint: AiSuggestionInteractionPoint;
62
- isDiffHidden: boolean;
63
- suggestionId: string;
64
- suggestionType: string;
65
- }, undefined>;
66
- type DiscardedSuggestionAttributes = {
82
+ type SuggestionLifecycleAttributes = SuggestionRemixAttributes & SuggestionAgeAttribute & {
67
83
  actionKind: string;
68
84
  affectedBlocks: number;
69
85
  agentId?: string;
@@ -72,6 +88,12 @@ type DiscardedSuggestionAttributes = {
72
88
  suggestionId: string;
73
89
  suggestionType: string;
74
90
  };
91
+ type AcceptSuggestionAEP = TrackAEP<ACTION.ACCEPTED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, SuggestionLifecycleAttributes & {
92
+ charactersAdded?: number;
93
+ charactersRemoved?: number;
94
+ isDiffHidden: boolean;
95
+ }, undefined>;
96
+ type DiscardedSuggestionAttributes = SuggestionLifecycleAttributes;
75
97
  type CancelSuggestionsAEP = TrackAEP<ACTION.CANCELLED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
76
98
  interactionPoint: AiSuggestionInteractionPoint;
77
99
  }, undefined>;
@@ -80,45 +102,48 @@ type DiscardAllSuggestionsAEP = TrackAEP<ACTION.DISCARD_ALL, ACTION_SUBJECT.AI_S
80
102
  numberOfSuggestions: number;
81
103
  suggestionDetails: DiscardedSuggestionAttributes[];
82
104
  }, undefined>;
83
- type DismissSuggestionAEP = TrackAEP<ACTION.DISMISSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
84
- affectedBlocks: number;
85
- hasSources: boolean;
86
- interactionPoint: AiSuggestionInteractionPoint;
87
- suggestionId: string;
88
- suggestionType: string;
89
- }, undefined>;
90
- type ViewSuggestionAEP = TrackAEP<ACTION.VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
91
- actionKind: string;
92
- affectedBlocks: number;
93
- agentId?: string;
105
+ type DismissSuggestionAEP = TrackAEP<ACTION.DISMISSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, SuggestionLifecycleAttributes, undefined>;
106
+ type ViewSuggestionAEP = TrackAEP<ACTION.VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, SuggestionLifecycleAttributes & {
94
107
  blockTypes: string[];
95
108
  charactersToAdd?: number;
96
109
  charactersToRemove?: number;
97
- hasSources: boolean;
98
- interactionPoint: AiSuggestionInteractionPoint;
99
110
  suggestionCardCharacterCount: number;
100
- suggestionId: string;
101
- suggestionType: string;
102
111
  }, undefined>;
103
112
  type RightRailViewedAEP = TrackAEP<ACTION.RIGHT_RAIL_VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
104
113
  entryPoint: AiSuggestionsRightRailEntryPoint;
105
114
  numberOfSuggestions: number;
106
- suggestionDetails: Array<{
115
+ suggestionDetails: Array<SuggestionRemixAttributes & SuggestionAgeAttribute & {
107
116
  actionKind: string;
108
117
  affectedBlocks: number;
109
118
  suggestionType: string;
110
119
  }>;
111
120
  }, undefined>;
112
121
  type RightRailClosedAEP = TrackAEP<ACTION.RIGHT_RAIL_CLOSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, undefined, undefined>;
113
- type ViewSuggestionReasoningAEP = TrackAEP<ACTION.REASONING_VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
122
+ type ViewSuggestionReasoningAEP = TrackAEP<ACTION.REASONING_VIEWED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, SuggestionRemixAttributes & SuggestionAgeAttribute & {
123
+ actionKind: string;
114
124
  affectedBlocks: number;
125
+ agentId?: string;
115
126
  hasSources: boolean;
116
127
  interactionPoint: AiSuggestionInteractionPoint;
117
128
  reasoningCharacterCount: number;
129
+ suggestionId: string;
118
130
  suggestionType: string;
119
131
  }, undefined>;
132
+ type SuggestionsGeneratedAEP = TrackAEP<ACTION.GENERATED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
133
+ generationDurationMs: number;
134
+ hadExistingSuggestions: boolean;
135
+ numberOfSuggestions: number;
136
+ suggestionDetails: Array<SuggestionRemixAttributes & {
137
+ actionKind: string;
138
+ affectedBlocks: number;
139
+ agentId?: string;
140
+ hasSources: boolean;
141
+ suggestionId: string;
142
+ suggestionType: string;
143
+ }>;
144
+ }, undefined>;
120
145
  type EmptyStateExposedAEP = TrackAEP<ACTION.EMPTY_STATE_EXPOSED, ACTION_SUBJECT.AI_SUGGESTIONS, undefined, {
121
146
  emptyStateType: AiSuggestionsEmptyStateType;
122
147
  }, undefined>;
123
- export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | ConversationErrorAEP | RegenerateSuggestionsErrorAEP | EntryPointClickedAEP | SuggestionsErrorRetryClickedAEP | EntryPointExposureAEP | CancelSuggestionsAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | DiscardAllSuggestionsAEP | DismissSuggestionAEP | ViewSuggestionAEP | RightRailViewedAEP | RightRailClosedAEP | ViewSuggestionReasoningAEP | EmptyStateExposedAEP;
148
+ export type AiSuggestionsEventPayload = NoDiffSuggestionAEP | ConversationErrorAEP | RegenerateSuggestionsErrorAEP | RegenerateSuggestionsStartedAEP | RegenerateSuggestionsCompletedAEP | EntryPointClickedAEP | SuggestionsErrorRetryClickedAEP | EntryPointExposureAEP | CancelSuggestionsAEP | AcceptSuggestionAEP | DiscardSuggestionAEP | DiscardAllSuggestionsAEP | DismissSuggestionAEP | ViewSuggestionAEP | RightRailViewedAEP | RightRailClosedAEP | ViewSuggestionReasoningAEP | SuggestionsGeneratedAEP | EmptyStateExposedAEP;
124
149
  export {};
@@ -73,6 +73,7 @@ export declare enum ACTION {
73
73
  UNDO_PERFORMED = "undo",
74
74
  REDO_PERFORMED = "redo",
75
75
  FORMATTED = "formatted",
76
+ GENERATED = "generated",
76
77
  HELP_OPENED = "helpOpened",
77
78
  HIGHLIGHTED = "highlighted",
78
79
  INCREMENTED = "incremented",
@@ -117,6 +118,8 @@ export declare enum ACTION {
117
118
  REFERENCE_SYNCED_BLOCK_UPDATE = "referenceSyncedBlockUpdate",
118
119
  REFERENCE_SYNCED_BLOCK_UNSYNC = "referenceSyncedBlockUnsync",
119
120
  REFERENCE_SYNCED_BLOCK_COPY = "referenceSyncedBlockCopy",
121
+ REGENERATION_COMPLETED = "regenerationCompleted",
122
+ REGENERATION_STARTED = "regenerationStarted",
120
123
  RIGHT_RAIL_CLOSED = "rightRailClosed",
121
124
  RIGHT_RAIL_VIEWED = "rightRailViewed",
122
125
  REPLACED_ALL = "replacedAll",
@@ -431,6 +434,7 @@ export declare enum ACTION_SUBJECT_ID {
431
434
  CODEBLOCK_COPY = "codeBlockCopy",
432
435
  CODEBLOCK_WRAP = "codeBlockWrap",
433
436
  CONVERSATION_ERROR = "conversationError",
437
+ SUGGESTIONS_REGENERATION = "suggestionsRegeneration",
434
438
  SUGGESTIONS_REGENERATION_ERROR = "suggestionsRegenerationError",
435
439
  SUGGESTIONS_ERROR_RETRY = "suggestionsErrorRetry",
436
440
  COPY_BUTTON = "copyButton",
@@ -6,32 +6,36 @@ type AlignmentState = 'start' | 'end' | 'center';
6
6
  export declare function addParagraphAtEnd(tr: Transaction): void;
7
7
  export declare function createParagraphAtEnd(): Command;
8
8
  /**
9
+ * Command-based image alignment retained for legacy alignment call sites.
9
10
  *
10
- * @deprecated use changeImageAlignmentTr instead
11
+ * @deprecated use changeImageAlignmentNext instead
11
12
  */
12
13
  export declare const changeImageAlignment: (align?: AlignmentState) => Command;
13
14
  export declare const changeImageAlignmentNext: (align?: AlignmentState) => (tr: Transaction) => boolean;
14
15
  /**
16
+ * Command-based block-mark updates retained for media linking and toggleBlockMark.
15
17
  *
16
18
  * @deprecated use createToggleBlockMarkOnRangeNext instead, which does not require passing editorState
17
19
  */
18
- export declare const createToggleBlockMarkOnRange: <T extends Object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
19
- export declare const createToggleBlockMarkOnRangeNext: <T extends Object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => (from: number, to: number, tr: Transaction) => boolean;
20
- export declare const createToggleInlineMarkOnRange: <T extends Object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
20
+ export declare const createToggleBlockMarkOnRange: <T extends object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
21
+ export declare const createToggleBlockMarkOnRangeNext: <T extends object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => (from: number, to: number, tr: Transaction) => boolean;
22
+ export declare const createToggleInlineMarkOnRange: <T extends object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
21
23
  /**
22
- * @deprecated use toggleBlockMarkTr instead
23
24
  * Toggles block mark based on the return type of `getAttrs`.
24
25
  * This is similar to ProseMirror's `getAttrs` from `AttributeSpec`
25
26
  * return `false` to remove the mark.
26
- * return `undefined for no-op.
27
+ * return `undefined` for no-op.
27
28
  * return an `object` to update the mark.
29
+ * Retained for Command-based alignment and indentation paths.
30
+ *
31
+ * @deprecated use toggleBlockMarkNext instead
28
32
  */
29
- export declare const toggleBlockMark: <T extends Object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => Command;
33
+ export declare const toggleBlockMark: <T extends object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => Command;
30
34
  /**
31
35
  * Toggles block mark based on the return type of `getAttrs`.
32
36
  * @returns true if the mark is applied, false otherwise.
33
37
  */
34
- export declare const toggleBlockMarkNext: <T extends Object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => (tr: Transaction) => boolean;
38
+ export declare const toggleBlockMarkNext: <T extends object = object>(markType: MarkType, getAttrs: (prevAttrs?: T, node?: PMNode) => T | undefined | false, allowedBlocks?: Array<NodeType> | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean)) => (tr: Transaction) => boolean;
35
39
  export declare const clearEditorContent: Command;
36
40
  export declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
37
41
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "126.2.1",
3
+ "version": "126.3.0",
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/"
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/codemod-utils": "^5.1.0",
42
42
  "@atlaskit/css": "^1.1.0",
43
43
  "@atlaskit/custom-steps": "^1.1.0",
44
- "@atlaskit/dropdown-menu": "^18.3.0",
44
+ "@atlaskit/dropdown-menu": "^19.0.0",
45
45
  "@atlaskit/editor-json-transformer": "^10.0.0",
46
46
  "@atlaskit/editor-palette": "^3.5.0",
47
47
  "@atlaskit/editor-prosemirror": "^9.0.0",
@@ -85,7 +85,7 @@
85
85
  "@atlaskit/task-decision": "^21.11.0",
86
86
  "@atlaskit/teams-app-config": "^3.1.0",
87
87
  "@atlaskit/textfield": "^10.2.0",
88
- "@atlaskit/tmp-editor-statsig": "^213.0.0",
88
+ "@atlaskit/tmp-editor-statsig": "^215.0.0",
89
89
  "@atlaskit/tokens": "^20.1.0",
90
90
  "@atlaskit/tooltip": "^24.3.0",
91
91
  "@atlaskit/width-detector": "^7.2.0",