@atlaskit/editor-synced-block-provider 6.6.1 → 6.6.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/clients/jira/sourceInfo.js +18 -40
  3. package/dist/cjs/entry-points/utils.js +0 -6
  4. package/dist/cjs/hooks/useFetchSyncBlockData.js +1 -1
  5. package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +4 -7
  6. package/dist/cjs/store-manager/sourceSyncBlockStoreManager.js +14 -14
  7. package/dist/cjs/store-manager/syncBlockBatchFetcher.js +1 -1
  8. package/dist/cjs/store-manager/syncBlockProviderFactoryManager.js +3 -3
  9. package/dist/cjs/store-manager/syncBlockStoreManager.js +1 -1
  10. package/dist/cjs/store-manager/syncBlockSubscriptionManager.js +3 -6
  11. package/dist/cjs/utils/utils.js +1 -13
  12. package/dist/es2019/clients/jira/sourceInfo.js +27 -48
  13. package/dist/es2019/entry-points/utils.js +1 -1
  14. package/dist/es2019/hooks/useFetchSyncBlockData.js +2 -2
  15. package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +5 -8
  16. package/dist/es2019/store-manager/sourceSyncBlockStoreManager.js +15 -15
  17. package/dist/es2019/store-manager/syncBlockBatchFetcher.js +2 -2
  18. package/dist/es2019/store-manager/syncBlockProviderFactoryManager.js +4 -4
  19. package/dist/es2019/store-manager/syncBlockStoreManager.js +2 -2
  20. package/dist/es2019/store-manager/syncBlockSubscriptionManager.js +4 -7
  21. package/dist/es2019/utils/utils.js +0 -10
  22. package/dist/esm/clients/jira/sourceInfo.js +19 -40
  23. package/dist/esm/entry-points/utils.js +1 -1
  24. package/dist/esm/hooks/useFetchSyncBlockData.js +2 -2
  25. package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +5 -8
  26. package/dist/esm/store-manager/sourceSyncBlockStoreManager.js +15 -15
  27. package/dist/esm/store-manager/syncBlockBatchFetcher.js +2 -2
  28. package/dist/esm/store-manager/syncBlockProviderFactoryManager.js +4 -4
  29. package/dist/esm/store-manager/syncBlockStoreManager.js +2 -2
  30. package/dist/esm/store-manager/syncBlockSubscriptionManager.js +4 -7
  31. package/dist/esm/utils/utils.js +0 -12
  32. package/dist/types/entry-points/utils.d.ts +1 -1
  33. package/dist/types/utils/utils.d.ts +0 -1
  34. package/dist/types-ts4.5/entry-points/utils.d.ts +1 -1
  35. package/dist/types-ts4.5/utils/utils.d.ts +0 -1
  36. package/package.json +3 -8
@@ -13,7 +13,7 @@ import { logException } from '@atlaskit/editor-common/monitoring';
13
13
  import { SyncBlockError } from '../common/types';
14
14
  import { updateErrorPayload, createErrorPayload, deleteErrorPayload, updateCacheErrorPayload, getSourceInfoErrorPayload, updateSuccessPayload, createSuccessPayload, deleteSuccessPayload, fetchReferencesErrorPayload } from '../utils/errorHandling';
15
15
  import { getCreateSourceExperience, getDeleteSourceExperience, getSaveSourceExperience, getFetchSourceInfoExperience } from '../utils/experienceTracking';
16
- import { convertSyncBlockPMNodeToSyncBlockData, productAttrIfGateOn } from '../utils/utils';
16
+ import { convertSyncBlockPMNodeToSyncBlockData, getSourceProductFromResourceIdSafe } from '../utils/utils';
17
17
  // A store manager responsible for the lifecycle and state management of source sync blocks in an editor instance.
18
18
  // Designed to manage local in-memory state and synchronize with an external data provider.
19
19
  // Supports create, flush, and delete operations for source sync blocks.
@@ -112,7 +112,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
112
112
  });
113
113
  // We can derive the product from `syncBlockNode.attrs.resourceId` even though
114
114
  // the variable wasn't destructured (the destructuring step itself may have thrown).
115
- (_this$fireAnalyticsEv = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv === void 0 || _this$fireAnalyticsEv.call(this, updateCacheErrorPayload(error.message, syncBlockNode === null || syncBlockNode === void 0 || (_syncBlockNode$attrs2 = syncBlockNode.attrs) === null || _syncBlockNode$attrs2 === void 0 ? void 0 : _syncBlockNode$attrs2.resourceId, productAttrIfGateOn(syncBlockNode === null || syncBlockNode === void 0 || (_syncBlockNode$attrs3 = syncBlockNode.attrs) === null || _syncBlockNode$attrs3 === void 0 ? void 0 : _syncBlockNode$attrs3.resourceId)));
115
+ (_this$fireAnalyticsEv = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv === void 0 || _this$fireAnalyticsEv.call(this, updateCacheErrorPayload(error.message, syncBlockNode === null || syncBlockNode === void 0 || (_syncBlockNode$attrs2 = syncBlockNode.attrs) === null || _syncBlockNode$attrs2 === void 0 ? void 0 : _syncBlockNode$attrs2.resourceId, getSourceProductFromResourceIdSafe(syncBlockNode === null || syncBlockNode === void 0 || (_syncBlockNode$attrs3 = syncBlockNode.attrs) === null || _syncBlockNode$attrs3 === void 0 ? void 0 : _syncBlockNode$attrs3.resourceId)));
116
116
  return false;
117
117
  }
118
118
  }
@@ -207,7 +207,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
207
207
  if (cachedData && result.status) {
208
208
  cachedData.status = result.status;
209
209
  }
210
- (_this2$fireAnalyticsE = _this2.fireAnalyticsEvent) === null || _this2$fireAnalyticsE === void 0 || _this2$fireAnalyticsE.call(_this2, updateSuccessPayload(result.resourceId, false, productAttrIfGateOn(result.resourceId)));
210
+ (_this2$fireAnalyticsE = _this2.fireAnalyticsEvent) === null || _this2$fireAnalyticsE === void 0 || _this2$fireAnalyticsE.call(_this2, updateSuccessPayload(result.resourceId, false, getSourceProductFromResourceIdSafe(result.resourceId)));
211
211
  }
212
212
  });
213
213
  return _context.abrupt("return", true);
@@ -217,7 +217,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
217
217
  return !result.resourceId || result.error;
218
218
  }).forEach(function (result) {
219
219
  var _this2$fireAnalyticsE2;
220
- (_this2$fireAnalyticsE2 = _this2.fireAnalyticsEvent) === null || _this2$fireAnalyticsE2 === void 0 || _this2$fireAnalyticsE2.call(_this2, updateErrorPayload(result.error || 'Failed to write data', result.resourceId, productAttrIfGateOn(result.resourceId)));
220
+ (_this2$fireAnalyticsE2 = _this2.fireAnalyticsEvent) === null || _this2$fireAnalyticsE2 === void 0 || _this2$fireAnalyticsE2.call(_this2, updateErrorPayload(result.error || 'Failed to write data', result.resourceId, getSourceProductFromResourceIdSafe(result.resourceId)));
221
221
  });
222
222
  return _context.abrupt("return", false);
223
223
  case 24:
@@ -303,16 +303,16 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
303
303
  }
304
304
  } else {
305
305
  var _this$fireAnalyticsEv3;
306
- (_this$fireAnalyticsEv3 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 || _this$fireAnalyticsEv3.call(this, createErrorPayload('creation complete callback missing', resourceId, productAttrIfGateOn(resourceId)));
306
+ (_this$fireAnalyticsEv3 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 || _this$fireAnalyticsEv3.call(this, createErrorPayload('creation complete callback missing', resourceId, getSourceProductFromResourceIdSafe(resourceId)));
307
307
  }
308
308
  if (success) {
309
309
  var _this$fireAnalyticsEv4;
310
- (_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, createSuccessPayload(resourceId || '', productAttrIfGateOn(resourceId)));
310
+ (_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, createSuccessPayload(resourceId || '', getSourceProductFromResourceIdSafe(resourceId)));
311
311
  } else {
312
312
  var _this$fireAnalyticsEv5;
313
313
  // Delete the node from cache if fail to create so it's not flushed to BE
314
314
  this.syncBlockCache.delete(resourceId || '');
315
- (_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 || _this$fireAnalyticsEv5.call(this, createErrorPayload('Fail to create bodied sync block', resourceId, productAttrIfGateOn(resourceId)));
315
+ (_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 || _this$fireAnalyticsEv5.call(this, createErrorPayload('Fail to create bodied sync block', resourceId, getSourceProductFromResourceIdSafe(resourceId)));
316
316
  }
317
317
  }
318
318
  }, {
@@ -395,7 +395,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
395
395
  (_this4$createExperien2 = _this4.createExperience) === null || _this4$createExperien2 === void 0 || _this4$createExperien2.failure({
396
396
  reason: result.error || 'Failed to create bodied sync block'
397
397
  });
398
- (_this4$fireAnalyticsE = _this4.fireAnalyticsEvent) === null || _this4$fireAnalyticsE === void 0 || _this4$fireAnalyticsE.call(_this4, createErrorPayload(result.error || 'Failed to create bodied sync block', resourceId, productAttrIfGateOn(resourceId)));
398
+ (_this4$fireAnalyticsE = _this4.fireAnalyticsEvent) === null || _this4$fireAnalyticsE === void 0 || _this4$fireAnalyticsE.call(_this4, createErrorPayload(result.error || 'Failed to create bodied sync block', resourceId, getSourceProductFromResourceIdSafe(resourceId)));
399
399
  }
400
400
  }).catch(function (error) {
401
401
  var _this4$createExperien3, _this4$fireAnalyticsE2;
@@ -406,7 +406,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
406
406
  (_this4$createExperien3 = _this4.createExperience) === null || _this4$createExperien3 === void 0 || _this4$createExperien3.failure({
407
407
  reason: error.message
408
408
  });
409
- (_this4$fireAnalyticsE2 = _this4.fireAnalyticsEvent) === null || _this4$fireAnalyticsE2 === void 0 || _this4$fireAnalyticsE2.call(_this4, createErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
409
+ (_this4$fireAnalyticsE2 = _this4.fireAnalyticsEvent) === null || _this4$fireAnalyticsE2 === void 0 || _this4$fireAnalyticsE2.call(_this4, createErrorPayload(error.message, resourceId, getSourceProductFromResourceIdSafe(resourceId)));
410
410
  });
411
411
  } catch (error) {
412
412
  var _this$fireAnalyticsEv6;
@@ -416,7 +416,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
416
416
  logException(error, {
417
417
  location: 'editor-synced-block-provider/sourceSyncBlockStoreManager'
418
418
  });
419
- (_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 || _this$fireAnalyticsEv6.call(this, createErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
419
+ (_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 || _this$fireAnalyticsEv6.call(this, createErrorPayload(error.message, resourceId, getSourceProductFromResourceIdSafe(resourceId)));
420
420
  }
421
421
  }
422
422
  }, {
@@ -464,7 +464,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
464
464
  (_this$deleteExperienc2 = this.deleteExperience) === null || _this$deleteExperienc2 === void 0 || _this$deleteExperienc2.success();
465
465
  results.forEach(function (result) {
466
466
  var _this5$fireAnalyticsE;
467
- (_this5$fireAnalyticsE = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE === void 0 || _this5$fireAnalyticsE.call(_this5, deleteSuccessPayload(result.resourceId, productAttrIfGateOn(result.resourceId)));
467
+ (_this5$fireAnalyticsE = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE === void 0 || _this5$fireAnalyticsE.call(_this5, deleteSuccessPayload(result.resourceId, getSourceProductFromResourceIdSafe(result.resourceId)));
468
468
  });
469
469
  } else {
470
470
  callback = function callback(Ids) {
@@ -474,10 +474,10 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
474
474
  results.forEach(function (result) {
475
475
  if (result.success) {
476
476
  var _this5$fireAnalyticsE2;
477
- (_this5$fireAnalyticsE2 = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE2 === void 0 || _this5$fireAnalyticsE2.call(_this5, deleteSuccessPayload(result.resourceId, productAttrIfGateOn(result.resourceId)));
477
+ (_this5$fireAnalyticsE2 = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE2 === void 0 || _this5$fireAnalyticsE2.call(_this5, deleteSuccessPayload(result.resourceId, getSourceProductFromResourceIdSafe(result.resourceId)));
478
478
  } else {
479
479
  var _this5$fireAnalyticsE3;
480
- (_this5$fireAnalyticsE3 = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE3 === void 0 || _this5$fireAnalyticsE3.call(_this5, deleteErrorPayload(result.error || 'Failed to delete synced block', result.resourceId, productAttrIfGateOn(result.resourceId)));
480
+ (_this5$fireAnalyticsE3 = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE3 === void 0 || _this5$fireAnalyticsE3.call(_this5, deleteErrorPayload(result.error || 'Failed to delete synced block', result.resourceId, getSourceProductFromResourceIdSafe(result.resourceId)));
481
481
  }
482
482
  });
483
483
  }
@@ -489,7 +489,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
489
489
  syncBlockIds.forEach(function (Ids) {
490
490
  var _this5$fireAnalyticsE4;
491
491
  _this5.setPendingDeletion(Ids, false);
492
- (_this5$fireAnalyticsE4 = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE4 === void 0 || _this5$fireAnalyticsE4.call(_this5, deleteErrorPayload(_context2.t0.message, Ids.resourceId, productAttrIfGateOn(Ids.resourceId)));
492
+ (_this5$fireAnalyticsE4 = _this5.fireAnalyticsEvent) === null || _this5$fireAnalyticsE4 === void 0 || _this5$fireAnalyticsE4.call(_this5, deleteErrorPayload(_context2.t0.message, Ids.resourceId, getSourceProductFromResourceIdSafe(Ids.resourceId)));
493
493
  });
494
494
  logException(_context2.t0, {
495
495
  location: 'editor-synced-block-provider/sourceSyncBlockStoreManager'
@@ -780,7 +780,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
780
780
  logException(error, {
781
781
  location: 'editor-synced-block-provider/sourceSyncBlockStoreManager'
782
782
  });
783
- (_this$fireAnalyticsEv8 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv8 === void 0 || _this$fireAnalyticsEv8.call(this, fetchReferencesErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
783
+ (_this$fireAnalyticsEv8 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv8 === void 0 || _this$fireAnalyticsEv8.call(this, fetchReferencesErrorPayload(error.message, resourceId, getSourceProductFromResourceIdSafe(resourceId)));
784
784
  return Promise.resolve({
785
785
  error: SyncBlockError.Errored
786
786
  });
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import rafSchedule from 'raf-schd';
5
5
  import { logException } from '@atlaskit/editor-common/monitoring';
6
6
  import { fetchErrorPayload } from '../utils/errorHandling';
7
- import { createSyncBlockNode, productAttrIfGateOn } from '../utils/utils';
7
+ import { createSyncBlockNode, getSourceProductFromResourceIdSafe } from '../utils/utils';
8
8
  /**
9
9
  * Handles debounced batch-fetching of sync block data via `raf-schd`.
10
10
  * Accumulates resource IDs and flushes them in a single fetch per
@@ -33,7 +33,7 @@ export var SyncBlockBatchFetcher = /*#__PURE__*/function () {
33
33
  });
34
34
  resourceIds.forEach(function (resId) {
35
35
  var _this$deps$getFireAna;
36
- (_this$deps$getFireAna = _this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna === void 0 || _this$deps$getFireAna(fetchErrorPayload(error.message, resId, productAttrIfGateOn(resId)));
36
+ (_this$deps$getFireAna = _this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna === void 0 || _this$deps$getFireAna(fetchErrorPayload(error.message, resId, getSourceProductFromResourceIdSafe(resId)));
37
37
  });
38
38
  });
39
39
  });
@@ -5,7 +5,7 @@ import { logException } from '@atlaskit/editor-common/monitoring';
5
5
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  import { fetchErrorPayload } from '../utils/errorHandling';
7
7
  import { parseResourceId } from '../utils/resourceId';
8
- import { productAttrIfGateOn } from '../utils/utils';
8
+ import { getSourceProductFromResourceIdSafe } from '../utils/utils';
9
9
  /**
10
10
  * Manages creation and caching of ProviderFactory instances used to
11
11
  * render synced block content (media, emoji, smart links, etc.).
@@ -26,7 +26,7 @@ export var SyncBlockProviderFactoryManager = /*#__PURE__*/function () {
26
26
  logException(error, {
27
27
  location: 'editor-synced-block-provider/syncBlockProviderFactoryManager'
28
28
  });
29
- (_this$deps$getFireAna = this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna === void 0 || _this$deps$getFireAna(fetchErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
29
+ (_this$deps$getFireAna = this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna === void 0 || _this$deps$getFireAna(fetchErrorPayload(error.message, resourceId, getSourceProductFromResourceIdSafe(resourceId)));
30
30
  return undefined;
31
31
  }
32
32
  var _dataProvider$getSync = dataProvider.getSyncedBlockRendererProviderOptions(),
@@ -59,7 +59,7 @@ export var SyncBlockProviderFactoryManager = /*#__PURE__*/function () {
59
59
  logException(error, {
60
60
  location: 'editor-synced-block-provider/syncBlockProviderFactoryManager'
61
61
  });
62
- (_this$deps$getFireAna2 = this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna2 === void 0 || _this$deps$getFireAna2(fetchErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
62
+ (_this$deps$getFireAna2 = this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna2 === void 0 || _this$deps$getFireAna2(fetchErrorPayload(error.message, resourceId, getSourceProductFromResourceIdSafe(resourceId)));
63
63
  }
64
64
  }
65
65
  return providerFactory;
@@ -144,7 +144,7 @@ export var SyncBlockProviderFactoryManager = /*#__PURE__*/function () {
144
144
  if (!syncBlock.data.sourceAri || !syncBlock.data.product) {
145
145
  var _this$deps$getFireAna3, _syncBlock$data$produ;
146
146
  (_this$deps$getFireAna3 = this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna3 === void 0 || _this$deps$getFireAna3(fetchErrorPayload('Sync block source ari or product not found', resourceId, // Prefer cached product when available; fall back to parsing resourceId.
147
- (_syncBlock$data$produ = syncBlock.data.product) !== null && _syncBlock$data$produ !== void 0 ? _syncBlock$data$produ : productAttrIfGateOn(resourceId)));
147
+ (_syncBlock$data$produ = syncBlock.data.product) !== null && _syncBlock$data$produ !== void 0 ? _syncBlock$data$produ : getSourceProductFromResourceIdSafe(resourceId)));
148
148
  return;
149
149
  }
150
150
  var parentInfo = dataProvider.retrieveSyncBlockParentInfo(syncBlock.data.sourceAri, syncBlock.data.product);
@@ -11,7 +11,7 @@ import { getProductFromSourceAri } from '../clients/block-service/ari';
11
11
  import { SyncBlockError } from '../common/types';
12
12
  import { fetchReferencesErrorPayload } from '../utils/errorHandling';
13
13
  import { getFetchReferencesExperience, getFetchSourceInfoExperience } from '../utils/experienceTracking';
14
- import { productAttrIfGateOn } from '../utils/utils';
14
+ import { getSourceProductFromResourceIdSafe } from '../utils/utils';
15
15
  import { ReferenceSyncBlockStoreManager } from './referenceSyncBlockStoreManager';
16
16
  import { SourceSyncBlockStoreManager } from './sourceSyncBlockStoreManager';
17
17
 
@@ -136,7 +136,7 @@ export var SyncBlockStoreManager = /*#__PURE__*/function () {
136
136
  logException(_context2.t0, {
137
137
  location: 'editor-synced-block-provider/syncBlockStoreManager'
138
138
  });
139
- (_this$fireAnalyticsEv = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv === void 0 || _this$fireAnalyticsEv.call(this, fetchReferencesErrorPayload(_context2.t0.message, resourceId, productAttrIfGateOn(resourceId)));
139
+ (_this$fireAnalyticsEv = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv === void 0 || _this$fireAnalyticsEv.call(this, fetchReferencesErrorPayload(_context2.t0.message, resourceId, getSourceProductFromResourceIdSafe(resourceId)));
140
140
  return _context2.abrupt("return", {
141
141
  error: SyncBlockError.Errored
142
142
  });
@@ -7,10 +7,9 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
9
  import { logException } from '@atlaskit/editor-common/monitoring';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { fetchErrorPayload, fetchSuccessPayload } from '../utils/errorHandling';
12
11
  import { resolveSyncBlockInstance } from '../utils/resolveSyncBlockInstance';
13
- import { getSourceProductFromResourceIdSafe, productAttrIfGateOn } from '../utils/utils';
12
+ import { getSourceProductFromResourceIdSafe } from '../utils/utils';
14
13
  /**
15
14
  * Manages the lifecycle of GraphQL WebSocket subscriptions for sync block
16
15
  * real-time updates, owns the subscriptions and titleSubscriptions maps,
@@ -251,7 +250,7 @@ export var SyncBlockSubscriptionManager = /*#__PURE__*/function () {
251
250
  logException(error, {
252
251
  location: 'editor-synced-block-provider/syncBlockSubscriptionManager/graphql-subscription'
253
252
  });
254
- (_this5$deps$getFireAn = _this5.deps.getFireAnalyticsEvent()) === null || _this5$deps$getFireAn === void 0 || _this5$deps$getFireAn(fetchErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
253
+ (_this5$deps$getFireAn = _this5.deps.getFireAnalyticsEvent()) === null || _this5$deps$getFireAn === void 0 || _this5$deps$getFireAn(fetchErrorPayload(error.message, resourceId, getSourceProductFromResourceIdSafe(resourceId)));
255
254
  });
256
255
  if (unsubscribe) {
257
256
  this.graphqlSubscriptions.set(resourceId, unsubscribe);
@@ -343,15 +342,13 @@ export var SyncBlockSubscriptionManager = /*#__PURE__*/function () {
343
342
  var localIds = callbacks ? Object.keys(callbacks) : [];
344
343
  localIds.forEach(function (localId) {
345
344
  var _this6$deps$getFireAn, _syncBlockInstance$da, _syncBlockInstance$da2;
346
- (_this6$deps$getFireAn = _this6.deps.getFireAnalyticsEvent()) === null || _this6$deps$getFireAn === void 0 || _this6$deps$getFireAn(fetchSuccessPayload(syncBlockInstance.resourceId, localId,
347
- // Prefer cached product when available; fall back to parsing the resourceId.
348
- fg('platform_synced_block_patch_11') ? (_syncBlockInstance$da = (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.product) !== null && _syncBlockInstance$da !== void 0 ? _syncBlockInstance$da : getSourceProductFromResourceIdSafe(syncBlockInstance.resourceId) : undefined));
345
+ (_this6$deps$getFireAn = _this6.deps.getFireAnalyticsEvent()) === null || _this6$deps$getFireAn === void 0 || _this6$deps$getFireAn(fetchSuccessPayload(syncBlockInstance.resourceId, localId, (_syncBlockInstance$da = (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.product) !== null && _syncBlockInstance$da !== void 0 ? _syncBlockInstance$da : getSourceProductFromResourceIdSafe(syncBlockInstance.resourceId)));
349
346
  });
350
347
  this.deps.fetchSyncBlockSourceInfo(resolved.resourceId);
351
348
  } else {
352
349
  var _syncBlockInstance$er, _syncBlockInstance$er2, _this$deps$getFireAna, _syncBlockInstance$da3, _syncBlockInstance$da4;
353
350
  var errorMessage = ((_syncBlockInstance$er = syncBlockInstance.error) === null || _syncBlockInstance$er === void 0 ? void 0 : _syncBlockInstance$er.reason) || ((_syncBlockInstance$er2 = syncBlockInstance.error) === null || _syncBlockInstance$er2 === void 0 ? void 0 : _syncBlockInstance$er2.type);
354
- (_this$deps$getFireAna = this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna === void 0 || _this$deps$getFireAna(fetchErrorPayload(errorMessage, syncBlockInstance.resourceId, fg('platform_synced_block_patch_11') ? (_syncBlockInstance$da3 = (_syncBlockInstance$da4 = syncBlockInstance.data) === null || _syncBlockInstance$da4 === void 0 ? void 0 : _syncBlockInstance$da4.product) !== null && _syncBlockInstance$da3 !== void 0 ? _syncBlockInstance$da3 : getSourceProductFromResourceIdSafe(syncBlockInstance.resourceId) : undefined));
351
+ (_this$deps$getFireAna = this.deps.getFireAnalyticsEvent()) === null || _this$deps$getFireAna === void 0 || _this$deps$getFireAna(fetchErrorPayload(errorMessage, syncBlockInstance.resourceId, (_syncBlockInstance$da3 = (_syncBlockInstance$da4 = syncBlockInstance.data) === null || _syncBlockInstance$da4 === void 0 ? void 0 : _syncBlockInstance$da4.product) !== null && _syncBlockInstance$da3 !== void 0 ? _syncBlockInstance$da3 : getSourceProductFromResourceIdSafe(syncBlockInstance.resourceId)));
355
352
  }
356
353
  }
357
354
  }]);
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable require-unicode-regexp */
2
2
 
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  export var convertSyncBlockPMNodeToSyncBlockData = function convertSyncBlockPMNodeToSyncBlockData(node) {
5
4
  return {
6
5
  blockInstanceId: node.attrs.localId,
@@ -69,17 +68,6 @@ export var getSourceProductFromResourceIdSafe = function getSourceProductFromRes
69
68
  return undefined;
70
69
  }
71
70
  };
72
-
73
- /*
74
- * Convenience wrapper around `getSourceProductFromResourceIdSafe` that returns
75
- * `undefined` whenever the `platform_synced_block_patch_11` rollout flag is off.
76
- * Centralised so that the flag name lives in exactly one place — when the flag is
77
- * cleaned up, this function should be deleted in its entirety and call-sites should
78
- * fall back to calling `getSourceProductFromResourceIdSafe` directly.
79
- */
80
- export var productAttrIfGateOn = function productAttrIfGateOn(resourceId) {
81
- return fg('platform_synced_block_patch_11') ? getSourceProductFromResourceIdSafe(resourceId) : undefined;
82
- };
83
71
  export var convertContentUpdatedAt = function convertContentUpdatedAt(contentUpdatedAt) {
84
72
  if (typeof contentUpdatedAt === 'number') {
85
73
  try {
@@ -1 +1 @@
1
- export { createSyncBlockNode, convertSyncBlockPMNodeToSyncBlockData, convertSyncBlockJSONNodeToSyncBlockNode, convertPMNodesToSyncBlockNodes, convertPMNodeToSyncBlockNode, convertContentUpdatedAt, getContentIdAndProductFromResourceId, getSourceProductFromResourceIdSafe, productAttrIfGateOn, } from '../utils/utils';
1
+ export { createSyncBlockNode, convertSyncBlockPMNodeToSyncBlockData, convertSyncBlockJSONNodeToSyncBlockNode, convertPMNodesToSyncBlockNodes, convertPMNodeToSyncBlockNode, convertContentUpdatedAt, getContentIdAndProductFromResourceId, getSourceProductFromResourceIdSafe, } from '../utils/utils';
@@ -11,5 +11,4 @@ export declare const getContentIdAndProductFromResourceId: (resourceId: string)
11
11
  sourceProduct: SyncBlockProduct;
12
12
  };
13
13
  export declare const getSourceProductFromResourceIdSafe: (resourceId?: string) => SyncBlockProduct | undefined;
14
- export declare const productAttrIfGateOn: (resourceId?: string) => SyncBlockProduct | undefined;
15
14
  export declare const convertContentUpdatedAt: (contentUpdatedAt: number | undefined) => string | undefined;
@@ -1 +1 @@
1
- export { createSyncBlockNode, convertSyncBlockPMNodeToSyncBlockData, convertSyncBlockJSONNodeToSyncBlockNode, convertPMNodesToSyncBlockNodes, convertPMNodeToSyncBlockNode, convertContentUpdatedAt, getContentIdAndProductFromResourceId, getSourceProductFromResourceIdSafe, productAttrIfGateOn, } from '../utils/utils';
1
+ export { createSyncBlockNode, convertSyncBlockPMNodeToSyncBlockData, convertSyncBlockJSONNodeToSyncBlockNode, convertPMNodesToSyncBlockNodes, convertPMNodeToSyncBlockNode, convertContentUpdatedAt, getContentIdAndProductFromResourceId, getSourceProductFromResourceIdSafe, } from '../utils/utils';
@@ -11,5 +11,4 @@ export declare const getContentIdAndProductFromResourceId: (resourceId: string)
11
11
  sourceProduct: SyncBlockProduct;
12
12
  };
13
13
  export declare const getSourceProductFromResourceIdSafe: (resourceId?: string) => SyncBlockProduct | undefined;
14
- export declare const productAttrIfGateOn: (resourceId?: string) => SyncBlockProduct | undefined;
15
14
  export declare const convertContentUpdatedAt: (contentUpdatedAt: number | undefined) => string | undefined;
package/package.json CHANGED
@@ -25,11 +25,11 @@
25
25
  "atlaskit:src": "src/index.ts",
26
26
  "dependencies": {
27
27
  "@atlaskit/adf-utils": "^19.29.0",
28
- "@atlaskit/editor-json-transformer": "^8.31.0",
28
+ "@atlaskit/editor-json-transformer": "^8.32.0",
29
29
  "@atlaskit/editor-prosemirror": "^7.3.0",
30
30
  "@atlaskit/node-data-provider": "^11.1.0",
31
31
  "@atlaskit/platform-feature-flags": "^1.1.0",
32
- "@atlaskit/tmp-editor-statsig": "^80.3.0",
32
+ "@atlaskit/tmp-editor-statsig": "^81.0.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@compiled/react": "^0.20.0",
35
35
  "graphql-ws": "^5.14.2",
@@ -81,16 +81,11 @@
81
81
  }
82
82
  },
83
83
  "name": "@atlaskit/editor-synced-block-provider",
84
- "version": "6.6.1",
84
+ "version": "6.6.3",
85
85
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
86
86
  "author": "Atlassian Pty Ltd",
87
87
  "license": "Apache-2.0",
88
88
  "publishConfig": {
89
89
  "registry": "https://registry.npmjs.org/"
90
- },
91
- "platform-feature-flags": {
92
- "platform_synced_block_patch_11": {
93
- "type": "boolean"
94
- }
95
90
  }
96
91
  }