@atlaskit/editor-synced-block-provider 11.0.0 → 11.0.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,19 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 11.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 11.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`d54d23973a171`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d54d23973a171) -
|
|
14
|
+
Emit reference-format resource IDs for bodied sync block document-inserted analytics behind
|
|
15
|
+
`platform_editor_blocks_patch_7`.
|
|
16
|
+
|
|
3
17
|
## 11.0.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
15
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
16
|
var _types = require("../common/types");
|
|
16
17
|
var _errorHandling = require("../utils/errorHandling");
|
|
17
18
|
var _experienceTracking = require("../utils/experienceTracking");
|
|
@@ -441,9 +442,10 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
|
|
|
441
442
|
(_this$fireAnalyticsEv3 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 || _this$fireAnalyticsEv3.call(this, (0, _errorHandling.createErrorPayload)('creation complete callback missing', resourceId, (0, _utils.getSourceProductFromResourceIdSafe)(resourceId)));
|
|
442
443
|
}
|
|
443
444
|
if (success) {
|
|
444
|
-
var _this$fireAnalyticsEv4, _this$fireAnalyticsEv5, _this$syncBlockCache$2;
|
|
445
|
+
var _this$dataProvider$ge, _this$dataProvider, _this$fireAnalyticsEv4, _this$fireAnalyticsEv5, _this$syncBlockCache$2;
|
|
445
446
|
var sourceProduct = (0, _utils.getSourceProductFromResourceIdSafe)(resourceId);
|
|
446
|
-
(_this$
|
|
447
|
+
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;
|
|
448
|
+
(_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, (0, _errorHandling.createSuccessPayload)(documentInsertedResourceId || '', sourceProduct));
|
|
447
449
|
// Operational create-success event with the join key + creation-type
|
|
448
450
|
// signals (inputMethod / createdEmpty) captured at the command layer.
|
|
449
451
|
(_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)));
|
|
@@ -505,9 +507,9 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
|
|
|
505
507
|
if (!this.dataProvider) {
|
|
506
508
|
throw new Error('Data provider not set or source id not set');
|
|
507
509
|
}
|
|
508
|
-
var _this$dataProvider$
|
|
509
|
-
resourceId = _this$dataProvider$
|
|
510
|
-
localId = _this$dataProvider$
|
|
510
|
+
var _this$dataProvider$ge2 = this.dataProvider.generateResourceId(),
|
|
511
|
+
resourceId = _this$dataProvider$ge2.resourceId,
|
|
512
|
+
localId = _this$dataProvider$ge2.localId;
|
|
511
513
|
return {
|
|
512
514
|
resourceId: resourceId,
|
|
513
515
|
localId: localId
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
4
|
import { SyncBlockError } from '../common/types';
|
|
4
5
|
import { updateErrorPayload, createErrorPayload, deleteErrorPayload, updateCacheErrorPayload, getSourceInfoErrorPayload, updateSuccessPayload, createSuccessPayload, createSuccessOperationalPayload, addContentSuccessPayload, deleteSuccessPayload, fetchReferencesErrorPayload, buildErrorAttribution } from '../utils/errorHandling';
|
|
5
6
|
import { getCreateSourceExperience, getDeleteSourceExperience, getSaveSourceExperience, getFetchSourceInfoExperience } from '../utils/experienceTracking';
|
|
@@ -362,9 +363,10 @@ export class SourceSyncBlockStoreManager {
|
|
|
362
363
|
(_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 ? void 0 : _this$fireAnalyticsEv5.call(this, createErrorPayload('creation complete callback missing', resourceId, getSourceProductFromResourceIdSafe(resourceId)));
|
|
363
364
|
}
|
|
364
365
|
if (success) {
|
|
365
|
-
var _this$fireAnalyticsEv6, _this$fireAnalyticsEv7, _this$syncBlockCache$2;
|
|
366
|
+
var _this$dataProvider$ge, _this$dataProvider, _this$fireAnalyticsEv6, _this$fireAnalyticsEv7, _this$syncBlockCache$2;
|
|
366
367
|
const sourceProduct = getSourceProductFromResourceIdSafe(resourceId);
|
|
367
|
-
(_this$
|
|
368
|
+
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;
|
|
369
|
+
(_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 ? void 0 : _this$fireAnalyticsEv6.call(this, createSuccessPayload(documentInsertedResourceId || '', sourceProduct));
|
|
368
370
|
// Operational create-success event with the join key + creation-type
|
|
369
371
|
// signals (inputMethod / createdEmpty) captured at the command layer.
|
|
370
372
|
(_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)));
|
|
@@ -656,8 +658,8 @@ export class SourceSyncBlockStoreManager {
|
|
|
656
658
|
// so we can update the correct cache entries.
|
|
657
659
|
const sourceToReferenceMap = new Map();
|
|
658
660
|
const syncBlockNodes = Array.from(this.syncBlockCache.entries()).map(([resourceId, data]) => {
|
|
659
|
-
var _this$dataProvider$
|
|
660
|
-
const referenceResourceId = (_this$dataProvider$
|
|
661
|
+
var _this$dataProvider$ge2, _this$dataProvider2;
|
|
662
|
+
const referenceResourceId = (_this$dataProvider$ge2 = (_this$dataProvider2 = this.dataProvider) === null || _this$dataProvider2 === void 0 ? void 0 : _this$dataProvider2.generateResourceIdForReference(resourceId)) !== null && _this$dataProvider$ge2 !== void 0 ? _this$dataProvider$ge2 : resourceId;
|
|
661
663
|
sourceToReferenceMap.set(referenceResourceId, resourceId);
|
|
662
664
|
return {
|
|
663
665
|
type: 'bodiedSyncBlock',
|
|
@@ -10,6 +10,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
10
10
|
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; }
|
|
11
11
|
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; }
|
|
12
12
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
13
14
|
import { SyncBlockError } from '../common/types';
|
|
14
15
|
import { updateErrorPayload, createErrorPayload, deleteErrorPayload, updateCacheErrorPayload, getSourceInfoErrorPayload, updateSuccessPayload, createSuccessPayload, createSuccessOperationalPayload, addContentSuccessPayload, deleteSuccessPayload, fetchReferencesErrorPayload, buildErrorAttribution } from '../utils/errorHandling';
|
|
15
16
|
import { getCreateSourceExperience, getDeleteSourceExperience, getSaveSourceExperience, getFetchSourceInfoExperience } from '../utils/experienceTracking';
|
|
@@ -434,9 +435,10 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
434
435
|
(_this$fireAnalyticsEv3 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 || _this$fireAnalyticsEv3.call(this, createErrorPayload('creation complete callback missing', resourceId, getSourceProductFromResourceIdSafe(resourceId)));
|
|
435
436
|
}
|
|
436
437
|
if (success) {
|
|
437
|
-
var _this$fireAnalyticsEv4, _this$fireAnalyticsEv5, _this$syncBlockCache$2;
|
|
438
|
+
var _this$dataProvider$ge, _this$dataProvider, _this$fireAnalyticsEv4, _this$fireAnalyticsEv5, _this$syncBlockCache$2;
|
|
438
439
|
var sourceProduct = getSourceProductFromResourceIdSafe(resourceId);
|
|
439
|
-
(_this$
|
|
440
|
+
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;
|
|
441
|
+
(_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, createSuccessPayload(documentInsertedResourceId || '', sourceProduct));
|
|
440
442
|
// Operational create-success event with the join key + creation-type
|
|
441
443
|
// signals (inputMethod / createdEmpty) captured at the command layer.
|
|
442
444
|
(_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)));
|
|
@@ -498,9 +500,9 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
498
500
|
if (!this.dataProvider) {
|
|
499
501
|
throw new Error('Data provider not set or source id not set');
|
|
500
502
|
}
|
|
501
|
-
var _this$dataProvider$
|
|
502
|
-
resourceId = _this$dataProvider$
|
|
503
|
-
localId = _this$dataProvider$
|
|
503
|
+
var _this$dataProvider$ge2 = this.dataProvider.generateResourceId(),
|
|
504
|
+
resourceId = _this$dataProvider$ge2.resourceId,
|
|
505
|
+
localId = _this$dataProvider$ge2.localId;
|
|
504
506
|
return {
|
|
505
507
|
resourceId: resourceId,
|
|
506
508
|
localId: localId
|
package/package.json
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
],
|
|
17
17
|
"atlaskit:src": "src/index.ts",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atlaskit/adf-utils": "^20.
|
|
19
|
+
"@atlaskit/adf-utils": "^20.6.0",
|
|
20
20
|
"@atlaskit/browser-apis": "^1.2.0",
|
|
21
|
-
"@atlaskit/editor-json-transformer": "^9.
|
|
21
|
+
"@atlaskit/editor-json-transformer": "^9.4.0",
|
|
22
22
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
23
23
|
"@atlaskit/node-data-provider": "^16.0.0",
|
|
24
24
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
25
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
25
|
+
"@atlaskit/tmp-editor-statsig": "^148.0.0",
|
|
26
26
|
"@babel/runtime": "^7.0.0",
|
|
27
27
|
"@compiled/react": "^1.0.2",
|
|
28
28
|
"bind-event-listener": "^3.0.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"uuid": "^3.1.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@atlaskit/editor-common": "^119.
|
|
35
|
+
"@atlaskit/editor-common": "^119.5.0",
|
|
36
36
|
"react": "^18.2.0 || ^19.2.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"name": "@atlaskit/editor-synced-block-provider",
|
|
79
|
-
"version": "11.0.
|
|
79
|
+
"version": "11.0.2",
|
|
80
80
|
"description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
|
|
81
81
|
"author": "Atlassian Pty Ltd",
|
|
82
82
|
"license": "Apache-2.0",
|