@atlaskit/editor-plugin-annotation 29.0.1 → 29.0.3

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-annotation
2
2
 
3
+ ## 29.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`53facf8e5239c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/53facf8e5239c) -
8
+ Add comment target attribution to editor thread opens and toolbar screen events behind
9
+ cc_maui_annotations_on_extensions.
10
+
11
+ Add a shared analytics payload type for the inline comment toolbar screen event.
12
+
13
+ - Updated dependencies
14
+
15
+ ## 29.0.2
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 29.0.1
4
22
 
5
23
  ### Patch Changes
@@ -187,12 +187,21 @@ function InlineCommentView(_ref) {
187
187
  return null;
188
188
  }
189
189
  var onAnnotationViewed = function onAnnotationViewed() {
190
- var _editorView$state$doc;
191
190
  if (!dispatchAnalyticsEvent) {
192
191
  return;
193
192
  }
194
193
 
195
194
  // fire analytics
195
+ var targetNode = editorView.state.doc.nodeAt(position);
196
+ var targetNodeType = targetNode === null || targetNode === void 0 ? void 0 : targetNode.type.name;
197
+ var commentTargetType = targetNode ? 'other' : 'unknown';
198
+ if (targetNodeType === 'extension') {
199
+ commentTargetType = (targetNode === null || targetNode === void 0 ? void 0 : targetNode.attrs.extensionKey) === 'native-embed:maui' ? 'remixEmbed' : 'other';
200
+ } else if (['media', 'mediaSingle', 'mediaInline'].includes(targetNodeType !== null && targetNodeType !== void 0 ? targetNodeType : '')) {
201
+ commentTargetType = 'media';
202
+ } else if (targetNode !== null && targetNode !== void 0 && targetNode.isText) {
203
+ commentTargetType = 'text';
204
+ }
196
205
  var payload = {
197
206
  action: _enums.ACTION.VIEWED,
198
207
  actionSubject: _enums.ACTION_SUBJECT.ANNOTATION,
@@ -200,7 +209,8 @@ function InlineCommentView(_ref) {
200
209
  eventType: _enums.EVENT_TYPE.TRACK,
201
210
  attributes: {
202
211
  overlap: activeAnnotations.length ? activeAnnotations.length - 1 : 0,
203
- targetNodeType: (_editorView$state$doc = editorView.state.doc.nodeAt(position)) === null || _editorView$state$doc === void 0 ? void 0 : _editorView$state$doc.type.name,
212
+ targetNodeType: targetNodeType,
213
+ commentTargetType: commentTargetType,
204
214
  method: selectAnnotationMethod
205
215
  }
206
216
  };
@@ -182,12 +182,21 @@ export function InlineCommentView({
182
182
  return null;
183
183
  }
184
184
  const onAnnotationViewed = () => {
185
- var _editorView$state$doc;
186
185
  if (!dispatchAnalyticsEvent) {
187
186
  return;
188
187
  }
189
188
 
190
189
  // fire analytics
190
+ const targetNode = editorView.state.doc.nodeAt(position);
191
+ const targetNodeType = targetNode === null || targetNode === void 0 ? void 0 : targetNode.type.name;
192
+ let commentTargetType = targetNode ? 'other' : 'unknown';
193
+ if (targetNodeType === 'extension') {
194
+ commentTargetType = (targetNode === null || targetNode === void 0 ? void 0 : targetNode.attrs.extensionKey) === 'native-embed:maui' ? 'remixEmbed' : 'other';
195
+ } else if (['media', 'mediaSingle', 'mediaInline'].includes(targetNodeType !== null && targetNodeType !== void 0 ? targetNodeType : '')) {
196
+ commentTargetType = 'media';
197
+ } else if (targetNode !== null && targetNode !== void 0 && targetNode.isText) {
198
+ commentTargetType = 'text';
199
+ }
191
200
  const payload = {
192
201
  action: ACTION.VIEWED,
193
202
  actionSubject: ACTION_SUBJECT.ANNOTATION,
@@ -195,7 +204,8 @@ export function InlineCommentView({
195
204
  eventType: EVENT_TYPE.TRACK,
196
205
  attributes: {
197
206
  overlap: activeAnnotations.length ? activeAnnotations.length - 1 : 0,
198
- targetNodeType: (_editorView$state$doc = editorView.state.doc.nodeAt(position)) === null || _editorView$state$doc === void 0 ? void 0 : _editorView$state$doc.type.name,
207
+ targetNodeType,
208
+ commentTargetType,
199
209
  method: selectAnnotationMethod
200
210
  }
201
211
  };
@@ -180,12 +180,21 @@ export function InlineCommentView(_ref) {
180
180
  return null;
181
181
  }
182
182
  var onAnnotationViewed = function onAnnotationViewed() {
183
- var _editorView$state$doc;
184
183
  if (!dispatchAnalyticsEvent) {
185
184
  return;
186
185
  }
187
186
 
188
187
  // fire analytics
188
+ var targetNode = editorView.state.doc.nodeAt(position);
189
+ var targetNodeType = targetNode === null || targetNode === void 0 ? void 0 : targetNode.type.name;
190
+ var commentTargetType = targetNode ? 'other' : 'unknown';
191
+ if (targetNodeType === 'extension') {
192
+ commentTargetType = (targetNode === null || targetNode === void 0 ? void 0 : targetNode.attrs.extensionKey) === 'native-embed:maui' ? 'remixEmbed' : 'other';
193
+ } else if (['media', 'mediaSingle', 'mediaInline'].includes(targetNodeType !== null && targetNodeType !== void 0 ? targetNodeType : '')) {
194
+ commentTargetType = 'media';
195
+ } else if (targetNode !== null && targetNode !== void 0 && targetNode.isText) {
196
+ commentTargetType = 'text';
197
+ }
189
198
  var payload = {
190
199
  action: ACTION.VIEWED,
191
200
  actionSubject: ACTION_SUBJECT.ANNOTATION,
@@ -193,7 +202,8 @@ export function InlineCommentView(_ref) {
193
202
  eventType: EVENT_TYPE.TRACK,
194
203
  attributes: {
195
204
  overlap: activeAnnotations.length ? activeAnnotations.length - 1 : 0,
196
- targetNodeType: (_editorView$state$doc = editorView.state.doc.nodeAt(position)) === null || _editorView$state$doc === void 0 ? void 0 : _editorView$state$doc.type.name,
205
+ targetNodeType: targetNodeType,
206
+ commentTargetType: commentTargetType,
197
207
  method: selectAnnotationMethod
198
208
  }
199
209
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "29.0.1",
3
+ "version": "29.0.3",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,11 +31,11 @@
31
31
  "@atlaskit/editor-toolbar-model": "^1.2.0",
32
32
  "@atlaskit/icon": "^38.0.0",
33
33
  "@atlaskit/platform-feature-flags": "^2.2.0",
34
- "@atlaskit/tmp-editor-statsig": "^243.0.0",
34
+ "@atlaskit/tmp-editor-statsig": "^244.0.0",
35
35
  "@babel/runtime": "^7.0.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@atlaskit/editor-common": "^133.1.0",
38
+ "@atlaskit/editor-common": "^133.3.0",
39
39
  "react": "^18.2.0 || ^19.2.0",
40
40
  "react-dom": "^18.2.0 || ^19.2.0",
41
41
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"