@atlaskit/editor-synced-block-provider 13.2.1 → 13.2.2

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,14 @@
1
1
  # @atlaskit/editor-synced-block-provider
2
2
 
3
+ ## 13.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b12eed2cd2633`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b12eed2cd2633) -
8
+ Add node type analytics for non-empty synced block conversions behind the
9
+ platform_editor_sync_block_node_types experiment.
10
+ - Updated dependencies
11
+
3
12
  ## 13.2.1
4
13
 
5
14
  ### Patch Changes
@@ -503,7 +503,7 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
503
503
  var documentInsertedResourceId = (0, _fg.fg)('platform_editor_blocks_patch_7') ? (_this$dataProvider$ge = (_this$dataProvider = this.dataProvider) === null || _this$dataProvider === void 0 ? void 0 : _this$dataProvider.generateResourceIdForReference(resourceId)) !== null && _this$dataProvider$ge !== void 0 ? _this$dataProvider$ge : resourceId : resourceId;
504
504
  (_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, (0, _errorHandling.createSuccessPayload)(documentInsertedResourceId || '', sourceProduct));
505
505
  // Operational create-success event with the join key + creation-type
506
- // signals (inputMethod / createdEmpty) captured at the command layer.
506
+ // signals (inputMethod / createdEmpty / nodeTypes) captured at the command layer.
507
507
  (_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 || _this$fireAnalyticsEv5.call(this, (0, _errorHandling.createSuccessOperationalPayload)(resourceId || '', (_this$syncBlockCache$2 = this.syncBlockCache.get(resourceId)) === null || _this$syncBlockCache$2 === void 0 ? void 0 : _this$syncBlockCache$2.blockInstanceId, sourceProduct, this.creationEnrichment.get(resourceId)));
508
508
  } else {
509
509
  var _this$fireAnalyticsEv6;
@@ -578,7 +578,7 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
578
578
  * @param attrs attributes Ids of the node
579
579
  * @param node the ProseMirror node to cache
580
580
  * @param onCompletion callback invoked when creation completes
581
- * @param enrichment optional creation-type signals stashed and attached to the
581
+ * @param enrichment optional creation analytics signals stashed and attached to the
582
582
  * `syncedBlockCreate` event when the async create resolves. When
583
583
  * `createdEmpty` is true the block is also registered for the
584
584
  * first-content-added event.
@@ -592,7 +592,7 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
592
592
  }
593
593
  var resourceId = attrs.resourceId,
594
594
  blockInstanceId = attrs.localId;
595
- // Stash creation-type signals for commitPendingCreation to read.
595
+ // Stash creation analytics signals for commitPendingCreation to read.
596
596
  if (enrichment) {
597
597
  this.creationEnrichment.set(resourceId, enrichment);
598
598
  // Only empty-created blocks can produce an empty→content transition.
@@ -349,20 +349,22 @@ var createSuccessPayload = exports.createSuccessPayload = function createSuccess
349
349
  * Optional enrichment for the `syncedBlockCreate` success event. All fields
350
350
  * optional so legacy payloads are unchanged. `inputMethod`: creating
351
351
  * surface (enum, PII-safe). `createdEmpty`: true from an empty selection, false
352
- * when content was converted.
352
+ * when content was converted. `nodeTypes`: sorted types of top-level nodes
353
+ * converted from a non-empty selection.
353
354
  */
354
355
 
355
356
  /**
356
357
  * Operational `syncedBlockCreate` success event with the `blockInstanceId` join key and,
357
- * when available, the `inputMethod` + `createdEmpty` creation-type signals.
358
+ * when available, the `inputMethod`, `createdEmpty`, and `nodeTypes` creation signals.
358
359
  */
359
360
  var createSuccessOperationalPayload = exports.createSuccessOperationalPayload = function createSuccessOperationalPayload(resourceId, blockInstanceId, sourceProduct, enrichment) {
361
+ var _enrichment$nodeTypes;
360
362
  return {
361
363
  action: _analytics.ACTION.INSERTED,
362
364
  actionSubject: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
363
365
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
364
366
  eventType: _analytics.EVENT_TYPE.OPERATIONAL,
365
- attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread({
367
+ attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
366
368
  resourceId: resourceId
367
369
  }, blockInstanceId && {
368
370
  blockInstanceId: blockInstanceId
@@ -372,6 +374,8 @@ var createSuccessOperationalPayload = exports.createSuccessOperationalPayload =
372
374
  inputMethod: enrichment.inputMethod
373
375
  }), (enrichment === null || enrichment === void 0 ? void 0 : enrichment.createdEmpty) !== undefined && {
374
376
  createdEmpty: enrichment.createdEmpty
377
+ }), (enrichment === null || enrichment === void 0 || (_enrichment$nodeTypes = enrichment.nodeTypes) === null || _enrichment$nodeTypes === void 0 ? void 0 : _enrichment$nodeTypes.length) && {
378
+ nodeTypes: enrichment.nodeTypes
375
379
  })
376
380
  };
377
381
  };
@@ -415,7 +415,7 @@ export class SourceSyncBlockStoreManager {
415
415
  const documentInsertedResourceId = fg('platform_editor_blocks_patch_7') ? (_this$dataProvider$ge = (_this$dataProvider = this.dataProvider) === null || _this$dataProvider === void 0 ? void 0 : _this$dataProvider.generateResourceIdForReference(resourceId)) !== null && _this$dataProvider$ge !== void 0 ? _this$dataProvider$ge : resourceId : resourceId;
416
416
  (_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 ? void 0 : _this$fireAnalyticsEv6.call(this, createSuccessPayload(documentInsertedResourceId || '', sourceProduct));
417
417
  // Operational create-success event with the join key + creation-type
418
- // signals (inputMethod / createdEmpty) captured at the command layer.
418
+ // signals (inputMethod / createdEmpty / nodeTypes) captured at the command layer.
419
419
  (_this$fireAnalyticsEv7 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv7 === void 0 ? void 0 : _this$fireAnalyticsEv7.call(this, createSuccessOperationalPayload(resourceId || '', (_this$syncBlockCache$2 = this.syncBlockCache.get(resourceId)) === null || _this$syncBlockCache$2 === void 0 ? void 0 : _this$syncBlockCache$2.blockInstanceId, sourceProduct, this.creationEnrichment.get(resourceId)));
420
420
  } else {
421
421
  var _this$fireAnalyticsEv8;
@@ -482,7 +482,7 @@ export class SourceSyncBlockStoreManager {
482
482
  * @param attrs attributes Ids of the node
483
483
  * @param node the ProseMirror node to cache
484
484
  * @param onCompletion callback invoked when creation completes
485
- * @param enrichment optional creation-type signals stashed and attached to the
485
+ * @param enrichment optional creation analytics signals stashed and attached to the
486
486
  * `syncedBlockCreate` event when the async create resolves. When
487
487
  * `createdEmpty` is true the block is also registered for the
488
488
  * first-content-added event.
@@ -495,7 +495,7 @@ export class SourceSyncBlockStoreManager {
495
495
  resourceId,
496
496
  localId: blockInstanceId
497
497
  } = attrs;
498
- // Stash creation-type signals for commitPendingCreation to read.
498
+ // Stash creation analytics signals for commitPendingCreation to read.
499
499
  if (enrichment) {
500
500
  this.creationEnrichment.set(resourceId, enrichment);
501
501
  // Only empty-created blocks can produce an empty→content transition.
@@ -335,34 +335,41 @@ export const createSuccessPayload = (resourceId, sourceProduct) => {
335
335
  * Optional enrichment for the `syncedBlockCreate` success event. All fields
336
336
  * optional so legacy payloads are unchanged. `inputMethod`: creating
337
337
  * surface (enum, PII-safe). `createdEmpty`: true from an empty selection, false
338
- * when content was converted.
338
+ * when content was converted. `nodeTypes`: sorted types of top-level nodes
339
+ * converted from a non-empty selection.
339
340
  */
340
341
 
341
342
  /**
342
343
  * Operational `syncedBlockCreate` success event with the `blockInstanceId` join key and,
343
- * when available, the `inputMethod` + `createdEmpty` creation-type signals.
344
+ * when available, the `inputMethod`, `createdEmpty`, and `nodeTypes` creation signals.
344
345
  */
345
- export const createSuccessOperationalPayload = (resourceId, blockInstanceId, sourceProduct, enrichment) => ({
346
- action: ACTION.INSERTED,
347
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
348
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
349
- eventType: EVENT_TYPE.OPERATIONAL,
350
- attributes: {
351
- resourceId,
352
- ...(blockInstanceId && {
353
- blockInstanceId
354
- }),
355
- ...(sourceProduct && {
356
- sourceProduct
357
- }),
358
- ...((enrichment === null || enrichment === void 0 ? void 0 : enrichment.inputMethod) && {
359
- inputMethod: enrichment.inputMethod
360
- }),
361
- ...((enrichment === null || enrichment === void 0 ? void 0 : enrichment.createdEmpty) !== undefined && {
362
- createdEmpty: enrichment.createdEmpty
363
- })
364
- }
365
- });
346
+ export const createSuccessOperationalPayload = (resourceId, blockInstanceId, sourceProduct, enrichment) => {
347
+ var _enrichment$nodeTypes;
348
+ return {
349
+ action: ACTION.INSERTED,
350
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
351
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
352
+ eventType: EVENT_TYPE.OPERATIONAL,
353
+ attributes: {
354
+ resourceId,
355
+ ...(blockInstanceId && {
356
+ blockInstanceId
357
+ }),
358
+ ...(sourceProduct && {
359
+ sourceProduct
360
+ }),
361
+ ...((enrichment === null || enrichment === void 0 ? void 0 : enrichment.inputMethod) && {
362
+ inputMethod: enrichment.inputMethod
363
+ }),
364
+ ...((enrichment === null || enrichment === void 0 ? void 0 : enrichment.createdEmpty) !== undefined && {
365
+ createdEmpty: enrichment.createdEmpty
366
+ }),
367
+ ...((enrichment === null || enrichment === void 0 ? void 0 : (_enrichment$nodeTypes = enrichment.nodeTypes) === null || _enrichment$nodeTypes === void 0 ? void 0 : _enrichment$nodeTypes.length) && {
368
+ nodeTypes: enrichment.nodeTypes
369
+ })
370
+ }
371
+ };
372
+ };
366
373
 
367
374
  /**
368
375
  * Operational first-content-added event. Fired once when a block created empty first
@@ -496,7 +496,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
496
496
  var documentInsertedResourceId = fg('platform_editor_blocks_patch_7') ? (_this$dataProvider$ge = (_this$dataProvider = this.dataProvider) === null || _this$dataProvider === void 0 ? void 0 : _this$dataProvider.generateResourceIdForReference(resourceId)) !== null && _this$dataProvider$ge !== void 0 ? _this$dataProvider$ge : resourceId : resourceId;
497
497
  (_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, createSuccessPayload(documentInsertedResourceId || '', sourceProduct));
498
498
  // Operational create-success event with the join key + creation-type
499
- // signals (inputMethod / createdEmpty) captured at the command layer.
499
+ // signals (inputMethod / createdEmpty / nodeTypes) captured at the command layer.
500
500
  (_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 || _this$fireAnalyticsEv5.call(this, createSuccessOperationalPayload(resourceId || '', (_this$syncBlockCache$2 = this.syncBlockCache.get(resourceId)) === null || _this$syncBlockCache$2 === void 0 ? void 0 : _this$syncBlockCache$2.blockInstanceId, sourceProduct, this.creationEnrichment.get(resourceId)));
501
501
  } else {
502
502
  var _this$fireAnalyticsEv6;
@@ -571,7 +571,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
571
571
  * @param attrs attributes Ids of the node
572
572
  * @param node the ProseMirror node to cache
573
573
  * @param onCompletion callback invoked when creation completes
574
- * @param enrichment optional creation-type signals stashed and attached to the
574
+ * @param enrichment optional creation analytics signals stashed and attached to the
575
575
  * `syncedBlockCreate` event when the async create resolves. When
576
576
  * `createdEmpty` is true the block is also registered for the
577
577
  * first-content-added event.
@@ -585,7 +585,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
585
585
  }
586
586
  var resourceId = attrs.resourceId,
587
587
  blockInstanceId = attrs.localId;
588
- // Stash creation-type signals for commitPendingCreation to read.
588
+ // Stash creation analytics signals for commitPendingCreation to read.
589
589
  if (enrichment) {
590
590
  this.creationEnrichment.set(resourceId, enrichment);
591
591
  // Only empty-created blocks can produce an empty→content transition.
@@ -340,20 +340,22 @@ export var createSuccessPayload = function createSuccessPayload(resourceId, sour
340
340
  * Optional enrichment for the `syncedBlockCreate` success event. All fields
341
341
  * optional so legacy payloads are unchanged. `inputMethod`: creating
342
342
  * surface (enum, PII-safe). `createdEmpty`: true from an empty selection, false
343
- * when content was converted.
343
+ * when content was converted. `nodeTypes`: sorted types of top-level nodes
344
+ * converted from a non-empty selection.
344
345
  */
345
346
 
346
347
  /**
347
348
  * Operational `syncedBlockCreate` success event with the `blockInstanceId` join key and,
348
- * when available, the `inputMethod` + `createdEmpty` creation-type signals.
349
+ * when available, the `inputMethod`, `createdEmpty`, and `nodeTypes` creation signals.
349
350
  */
350
351
  export var createSuccessOperationalPayload = function createSuccessOperationalPayload(resourceId, blockInstanceId, sourceProduct, enrichment) {
352
+ var _enrichment$nodeTypes;
351
353
  return {
352
354
  action: ACTION.INSERTED,
353
355
  actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
354
356
  actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
355
357
  eventType: EVENT_TYPE.OPERATIONAL,
356
- attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread({
358
+ attributes: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
357
359
  resourceId: resourceId
358
360
  }, blockInstanceId && {
359
361
  blockInstanceId: blockInstanceId
@@ -363,6 +365,8 @@ export var createSuccessOperationalPayload = function createSuccessOperationalPa
363
365
  inputMethod: enrichment.inputMethod
364
366
  }), (enrichment === null || enrichment === void 0 ? void 0 : enrichment.createdEmpty) !== undefined && {
365
367
  createdEmpty: enrichment.createdEmpty
368
+ }), (enrichment === null || enrichment === void 0 || (_enrichment$nodeTypes = enrichment.nodeTypes) === null || _enrichment$nodeTypes === void 0 ? void 0 : _enrichment$nodeTypes.length) && {
369
+ nodeTypes: enrichment.nodeTypes
366
370
  })
367
371
  };
368
372
  };
@@ -138,7 +138,7 @@ export declare class SourceSyncBlockStoreManager {
138
138
  * @param attrs attributes Ids of the node
139
139
  * @param node the ProseMirror node to cache
140
140
  * @param onCompletion callback invoked when creation completes
141
- * @param enrichment optional creation-type signals stashed and attached to the
141
+ * @param enrichment optional creation analytics signals stashed and attached to the
142
142
  * `syncedBlockCreate` event when the async create resolves. When
143
143
  * `createdEmpty` is true the block is also registered for the
144
144
  * first-content-added event.
@@ -176,15 +176,17 @@ export declare const createSuccessPayload: (resourceId: string, sourceProduct?:
176
176
  * Optional enrichment for the `syncedBlockCreate` success event. All fields
177
177
  * optional so legacy payloads are unchanged. `inputMethod`: creating
178
178
  * surface (enum, PII-safe). `createdEmpty`: true from an empty selection, false
179
- * when content was converted.
179
+ * when content was converted. `nodeTypes`: sorted types of top-level nodes
180
+ * converted from a non-empty selection.
180
181
  */
181
182
  export type CreateSuccessEnrichment = {
182
183
  createdEmpty?: boolean;
183
184
  inputMethod?: INPUT_METHOD;
185
+ nodeTypes?: string[];
184
186
  };
185
187
  /**
186
188
  * Operational `syncedBlockCreate` success event with the `blockInstanceId` join key and,
187
- * when available, the `inputMethod` + `createdEmpty` creation-type signals.
189
+ * when available, the `inputMethod`, `createdEmpty`, and `nodeTypes` creation signals.
188
190
  */
189
191
  export declare const createSuccessOperationalPayload: (resourceId: string, blockInstanceId?: string, sourceProduct?: string, enrichment?: CreateSuccessEnrichment) => SyncBlockEventPayload;
190
192
  /**
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "@atlaskit/node-data-provider": "^18.0.0",
24
24
  "@atlaskit/platform-feature-experiments": "^0.3.0",
25
25
  "@atlaskit/platform-feature-flags": "^2.2.0",
26
- "@atlaskit/tmp-editor-statsig": "^187.0.0",
26
+ "@atlaskit/tmp-editor-statsig": "^188.0.0",
27
27
  "@babel/runtime": "^7.0.0",
28
28
  "@compiled/react": "^1.0.2",
29
29
  "bind-event-listener": "^3.0.0",
@@ -33,7 +33,7 @@
33
33
  "uuid": "^11.1.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@atlaskit/editor-common": "^121.4.0",
36
+ "@atlaskit/editor-common": "^121.5.0",
37
37
  "react": "^18.2.0 || ^19.2.0"
38
38
  },
39
39
  "devDependencies": {
@@ -42,7 +42,7 @@
42
42
  "react-dom": "^19.2.0"
43
43
  },
44
44
  "name": "@atlaskit/editor-synced-block-provider",
45
- "version": "13.2.1",
45
+ "version": "13.2.2",
46
46
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
47
47
  "author": "Atlassian Pty Ltd",
48
48
  "license": "Apache-2.0",