@atlaskit/editor-synced-block-provider 2.11.1 → 2.11.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 +8 -0
- package/dist/cjs/providers/block-service/blockServiceAPI.js +3 -1
- package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +16 -14
- package/dist/es2019/providers/block-service/blockServiceAPI.js +3 -1
- package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +22 -20
- package/dist/es2019/utils/errorHandling.js +1 -1
- package/dist/esm/providers/block-service/blockServiceAPI.js +3 -1
- package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +16 -14
- package/dist/esm/utils/errorHandling.js +1 -1
- package/dist/types/utils/errorHandling.d.ts +1 -1
- package/dist/types-ts4.5/utils/errorHandling.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 2.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1511d9ee0c2e3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1511d9ee0c2e3) -
|
|
8
|
+
[ux] EDITOR-3643 populate source url and title for sync block with block service by returning
|
|
9
|
+
source ari and product from fetchData
|
|
10
|
+
|
|
3
11
|
## 2.11.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -65,7 +65,9 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
65
65
|
data: {
|
|
66
66
|
content: syncedBlockData,
|
|
67
67
|
resourceId: resourceId,
|
|
68
|
-
blockInstanceId: localId
|
|
68
|
+
blockInstanceId: localId,
|
|
69
|
+
sourceAri: blockContentResponse.sourceAri,
|
|
70
|
+
product: blockContentResponse.product
|
|
69
71
|
},
|
|
70
72
|
resourceId: resourceId
|
|
71
73
|
});
|
|
@@ -144,7 +144,6 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
|
|
|
144
144
|
if (this.syncBlockURLRequests.get(resourceId)) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
this.syncBlockURLRequests.set(resourceId, true);
|
|
148
147
|
var existingSyncBlock = this.getFromCache(resourceId);
|
|
149
148
|
if (!existingSyncBlock) {
|
|
150
149
|
throw new Error('No existing sync block to fetch source info for');
|
|
@@ -159,8 +158,11 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
|
|
|
159
158
|
product = _ref.product,
|
|
160
159
|
blockInstanceId = _ref.blockInstanceId;
|
|
161
160
|
if (!sourceAri || !product || !blockInstanceId) {
|
|
162
|
-
|
|
161
|
+
var _this$fireAnalyticsEv2;
|
|
162
|
+
(_this$fireAnalyticsEv2 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv2 === void 0 || _this$fireAnalyticsEv2.call(this, (0, _errorHandling.getSourceInfoErrorPayload)('SourceAri, product or blockInstanceId missing'));
|
|
163
|
+
return;
|
|
163
164
|
}
|
|
165
|
+
this.syncBlockURLRequests.set(resourceId, true);
|
|
164
166
|
this.dataProvider.fetchSyncBlockSourceInfo(blockInstanceId, sourceAri, product, this.fireAnalyticsEvent).then(function (sourceInfo) {
|
|
165
167
|
if (!sourceInfo) {
|
|
166
168
|
return;
|
|
@@ -170,17 +172,17 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
|
|
|
170
172
|
_this.updateSourceTitleSubscriptions(resourceId, sourceInfo.title);
|
|
171
173
|
}
|
|
172
174
|
}).catch(function (error) {
|
|
173
|
-
var _this$
|
|
174
|
-
(_this$
|
|
175
|
+
var _this$fireAnalyticsEv3;
|
|
176
|
+
(_this$fireAnalyticsEv3 = _this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 || _this$fireAnalyticsEv3.call(_this, (0, _errorHandling.getSourceInfoErrorPayload)(error.message));
|
|
175
177
|
}).finally(function () {
|
|
176
178
|
_this.syncBlockURLRequests.delete(resourceId);
|
|
177
179
|
});
|
|
178
180
|
} catch (error) {
|
|
179
|
-
var _this$
|
|
181
|
+
var _this$fireAnalyticsEv4;
|
|
180
182
|
(0, _monitoring.logException)(error, {
|
|
181
183
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
182
184
|
});
|
|
183
|
-
(_this$
|
|
185
|
+
(_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, (0, _errorHandling.getSourceInfoErrorPayload)(error.message));
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
188
|
|
|
@@ -389,11 +391,11 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
|
|
|
389
391
|
}
|
|
390
392
|
return this.subscribeToSyncBlock(resourceId, localId, callback);
|
|
391
393
|
} catch (error) {
|
|
392
|
-
var _this$
|
|
394
|
+
var _this$fireAnalyticsEv5;
|
|
393
395
|
(0, _monitoring.logException)(error, {
|
|
394
396
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
395
397
|
});
|
|
396
|
-
(_this$
|
|
398
|
+
(_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 || _this$fireAnalyticsEv5.call(this, (0, _errorHandling.fetchErrorPayload)(error.message));
|
|
397
399
|
return function () {};
|
|
398
400
|
}
|
|
399
401
|
}
|
|
@@ -417,12 +419,12 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
|
|
|
417
419
|
key: "getProviderFactory",
|
|
418
420
|
value: function getProviderFactory(resourceId) {
|
|
419
421
|
if (!this.dataProvider) {
|
|
420
|
-
var _this$
|
|
422
|
+
var _this$fireAnalyticsEv6;
|
|
421
423
|
var error = new Error('Data provider not set');
|
|
422
424
|
(0, _monitoring.logException)(error, {
|
|
423
425
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
424
426
|
});
|
|
425
|
-
(_this$
|
|
427
|
+
(_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 || _this$fireAnalyticsEv6.call(this, (0, _errorHandling.fetchErrorPayload)(error.message));
|
|
426
428
|
return undefined;
|
|
427
429
|
}
|
|
428
430
|
var _this$dataProvider$ge = this.dataProvider.getSyncedBlockRendererProviderOptions(),
|
|
@@ -441,11 +443,11 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
|
|
|
441
443
|
try {
|
|
442
444
|
this.retrieveDynamicProviders(resourceId, providerFactory, providerCreator);
|
|
443
445
|
} catch (error) {
|
|
444
|
-
var _this$
|
|
446
|
+
var _this$fireAnalyticsEv7;
|
|
445
447
|
(0, _monitoring.logException)(error, {
|
|
446
448
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
447
449
|
});
|
|
448
|
-
(_this$
|
|
450
|
+
(_this$fireAnalyticsEv7 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv7 === void 0 || _this$fireAnalyticsEv7.call(this, (0, _errorHandling.fetchErrorPayload)(error.message));
|
|
449
451
|
}
|
|
450
452
|
}
|
|
451
453
|
return providerFactory;
|
|
@@ -464,8 +466,8 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
|
|
|
464
466
|
}
|
|
465
467
|
var syncBlock = this.getFromCache(resourceId);
|
|
466
468
|
if (!syncBlock || !((_syncBlock$data2 = syncBlock.data) !== null && _syncBlock$data2 !== void 0 && _syncBlock$data2.sourceAri) || !((_syncBlock$data3 = syncBlock.data) !== null && _syncBlock$data3 !== void 0 && _syncBlock$data3.product)) {
|
|
467
|
-
var _this$
|
|
468
|
-
(_this$
|
|
469
|
+
var _this$fireAnalyticsEv8;
|
|
470
|
+
(_this$fireAnalyticsEv8 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv8 === void 0 || _this$fireAnalyticsEv8.call(this, (0, _errorHandling.fetchErrorPayload)('Sync block or source ari or product not found'));
|
|
469
471
|
return;
|
|
470
472
|
}
|
|
471
473
|
var parentInfo = this.dataProvider.retrieveSyncBlockParentInfo((_syncBlock$data4 = syncBlock.data) === null || _syncBlock$data4 === void 0 ? void 0 : _syncBlock$data4.sourceAri, (_syncBlock$data5 = syncBlock.data) === null || _syncBlock$data5 === void 0 ? void 0 : _syncBlock$data5.product);
|
|
@@ -39,7 +39,9 @@ class BlockServiceADFFetchProvider {
|
|
|
39
39
|
data: {
|
|
40
40
|
content: syncedBlockData,
|
|
41
41
|
resourceId,
|
|
42
|
-
blockInstanceId: localId
|
|
42
|
+
blockInstanceId: localId,
|
|
43
|
+
sourceAri: blockContentResponse.sourceAri,
|
|
44
|
+
product: blockContentResponse.product
|
|
43
45
|
},
|
|
44
46
|
resourceId
|
|
45
47
|
};
|
|
@@ -64,7 +64,6 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
64
64
|
if (this.syncBlockURLRequests.get(resourceId)) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
this.syncBlockURLRequests.set(resourceId, true);
|
|
68
67
|
const existingSyncBlock = this.getFromCache(resourceId);
|
|
69
68
|
if (!existingSyncBlock) {
|
|
70
69
|
throw new Error('No existing sync block to fetch source info for');
|
|
@@ -80,8 +79,11 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
80
79
|
blockInstanceId
|
|
81
80
|
} = existingSyncBlock.data || {};
|
|
82
81
|
if (!sourceAri || !product || !blockInstanceId) {
|
|
83
|
-
|
|
82
|
+
var _this$fireAnalyticsEv2;
|
|
83
|
+
(_this$fireAnalyticsEv2 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv2 === void 0 ? void 0 : _this$fireAnalyticsEv2.call(this, getSourceInfoErrorPayload('SourceAri, product or blockInstanceId missing'));
|
|
84
|
+
return;
|
|
84
85
|
}
|
|
86
|
+
this.syncBlockURLRequests.set(resourceId, true);
|
|
85
87
|
this.dataProvider.fetchSyncBlockSourceInfo(blockInstanceId, sourceAri, product, this.fireAnalyticsEvent).then(sourceInfo => {
|
|
86
88
|
if (!sourceInfo) {
|
|
87
89
|
return;
|
|
@@ -91,17 +93,17 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
91
93
|
this.updateSourceTitleSubscriptions(resourceId, sourceInfo.title);
|
|
92
94
|
}
|
|
93
95
|
}).catch(error => {
|
|
94
|
-
var _this$
|
|
95
|
-
(_this$
|
|
96
|
+
var _this$fireAnalyticsEv3;
|
|
97
|
+
(_this$fireAnalyticsEv3 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 ? void 0 : _this$fireAnalyticsEv3.call(this, getSourceInfoErrorPayload(error.message));
|
|
96
98
|
}).finally(() => {
|
|
97
99
|
this.syncBlockURLRequests.delete(resourceId);
|
|
98
100
|
});
|
|
99
101
|
} catch (error) {
|
|
100
|
-
var _this$
|
|
102
|
+
var _this$fireAnalyticsEv4;
|
|
101
103
|
logException(error, {
|
|
102
104
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
103
105
|
});
|
|
104
|
-
(_this$
|
|
106
|
+
(_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 ? void 0 : _this$fireAnalyticsEv4.call(this, getSourceInfoErrorPayload(error.message));
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
|
|
@@ -133,13 +135,13 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
133
135
|
const resolvedData = [];
|
|
134
136
|
data.forEach(syncBlockInstance => {
|
|
135
137
|
if (!syncBlockInstance.resourceId) {
|
|
136
|
-
var _this$
|
|
137
|
-
(_this$
|
|
138
|
+
var _this$fireAnalyticsEv5;
|
|
139
|
+
(_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 ? void 0 : _this$fireAnalyticsEv5.call(this, fetchErrorPayload(syncBlockInstance.error || 'Returned sync block instance does not have resource id'));
|
|
138
140
|
return;
|
|
139
141
|
}
|
|
140
142
|
if (syncBlockInstance.error) {
|
|
141
|
-
var _this$
|
|
142
|
-
(_this$
|
|
143
|
+
var _this$fireAnalyticsEv6;
|
|
144
|
+
(_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 ? void 0 : _this$fireAnalyticsEv6.call(this, fetchErrorPayload(syncBlockInstance.error));
|
|
143
145
|
this.updateCache(syncBlockInstance);
|
|
144
146
|
resolvedData.push(syncBlockInstance);
|
|
145
147
|
return;
|
|
@@ -207,11 +209,11 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
207
209
|
callback(cachedData);
|
|
208
210
|
} else {
|
|
209
211
|
this.fetchSyncBlocksData([createSyncBlockNode(localId, resourceId)]).catch(error => {
|
|
210
|
-
var _this$
|
|
212
|
+
var _this$fireAnalyticsEv7;
|
|
211
213
|
logException(error, {
|
|
212
214
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
213
215
|
});
|
|
214
|
-
(_this$
|
|
216
|
+
(_this$fireAnalyticsEv7 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv7 === void 0 ? void 0 : _this$fireAnalyticsEv7.call(this, fetchErrorPayload(error.message));
|
|
215
217
|
});
|
|
216
218
|
}
|
|
217
219
|
return () => {
|
|
@@ -278,11 +280,11 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
278
280
|
}
|
|
279
281
|
return this.subscribeToSyncBlock(resourceId, localId, callback);
|
|
280
282
|
} catch (error) {
|
|
281
|
-
var _this$
|
|
283
|
+
var _this$fireAnalyticsEv8;
|
|
282
284
|
logException(error, {
|
|
283
285
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
284
286
|
});
|
|
285
|
-
(_this$
|
|
287
|
+
(_this$fireAnalyticsEv8 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv8 === void 0 ? void 0 : _this$fireAnalyticsEv8.call(this, fetchErrorPayload(error.message));
|
|
286
288
|
return () => {};
|
|
287
289
|
}
|
|
288
290
|
}
|
|
@@ -302,12 +304,12 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
302
304
|
}
|
|
303
305
|
getProviderFactory(resourceId) {
|
|
304
306
|
if (!this.dataProvider) {
|
|
305
|
-
var _this$
|
|
307
|
+
var _this$fireAnalyticsEv9;
|
|
306
308
|
const error = new Error('Data provider not set');
|
|
307
309
|
logException(error, {
|
|
308
310
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
309
311
|
});
|
|
310
|
-
(_this$
|
|
312
|
+
(_this$fireAnalyticsEv9 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv9 === void 0 ? void 0 : _this$fireAnalyticsEv9.call(this, fetchErrorPayload(error.message));
|
|
311
313
|
return undefined;
|
|
312
314
|
}
|
|
313
315
|
const {
|
|
@@ -327,11 +329,11 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
327
329
|
try {
|
|
328
330
|
this.retrieveDynamicProviders(resourceId, providerFactory, providerCreator);
|
|
329
331
|
} catch (error) {
|
|
330
|
-
var _this$
|
|
332
|
+
var _this$fireAnalyticsEv0;
|
|
331
333
|
logException(error, {
|
|
332
334
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
333
335
|
});
|
|
334
|
-
(_this$
|
|
336
|
+
(_this$fireAnalyticsEv0 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv0 === void 0 ? void 0 : _this$fireAnalyticsEv0.call(this, fetchErrorPayload(error.message));
|
|
335
337
|
}
|
|
336
338
|
}
|
|
337
339
|
return providerFactory;
|
|
@@ -348,8 +350,8 @@ export class ReferenceSyncBlockStoreManager {
|
|
|
348
350
|
}
|
|
349
351
|
const syncBlock = this.getFromCache(resourceId);
|
|
350
352
|
if (!syncBlock || !((_syncBlock$data2 = syncBlock.data) !== null && _syncBlock$data2 !== void 0 && _syncBlock$data2.sourceAri) || !((_syncBlock$data3 = syncBlock.data) !== null && _syncBlock$data3 !== void 0 && _syncBlock$data3.product)) {
|
|
351
|
-
var _this$
|
|
352
|
-
(_this$
|
|
353
|
+
var _this$fireAnalyticsEv1;
|
|
354
|
+
(_this$fireAnalyticsEv1 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv1 === void 0 ? void 0 : _this$fireAnalyticsEv1.call(this, fetchErrorPayload('Sync block or source ari or product not found'));
|
|
353
355
|
return;
|
|
354
356
|
}
|
|
355
357
|
const parentInfo = this.dataProvider.retrieveSyncBlockParentInfo((_syncBlock$data4 = syncBlock.data) === null || _syncBlock$data4 === void 0 ? void 0 : _syncBlock$data4.sourceAri, (_syncBlock$data5 = syncBlock.data) === null || _syncBlock$data5 === void 0 ? void 0 : _syncBlock$data5.product);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
export const stringifyError = error => {
|
|
3
3
|
try {
|
|
4
4
|
return JSON.stringify(error);
|
|
@@ -58,7 +58,9 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
58
58
|
data: {
|
|
59
59
|
content: syncedBlockData,
|
|
60
60
|
resourceId: resourceId,
|
|
61
|
-
blockInstanceId: localId
|
|
61
|
+
blockInstanceId: localId,
|
|
62
|
+
sourceAri: blockContentResponse.sourceAri,
|
|
63
|
+
product: blockContentResponse.product
|
|
62
64
|
},
|
|
63
65
|
resourceId: resourceId
|
|
64
66
|
});
|
|
@@ -138,7 +138,6 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
138
138
|
if (this.syncBlockURLRequests.get(resourceId)) {
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
|
-
this.syncBlockURLRequests.set(resourceId, true);
|
|
142
141
|
var existingSyncBlock = this.getFromCache(resourceId);
|
|
143
142
|
if (!existingSyncBlock) {
|
|
144
143
|
throw new Error('No existing sync block to fetch source info for');
|
|
@@ -153,8 +152,11 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
153
152
|
product = _ref.product,
|
|
154
153
|
blockInstanceId = _ref.blockInstanceId;
|
|
155
154
|
if (!sourceAri || !product || !blockInstanceId) {
|
|
156
|
-
|
|
155
|
+
var _this$fireAnalyticsEv2;
|
|
156
|
+
(_this$fireAnalyticsEv2 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv2 === void 0 || _this$fireAnalyticsEv2.call(this, getSourceInfoErrorPayload('SourceAri, product or blockInstanceId missing'));
|
|
157
|
+
return;
|
|
157
158
|
}
|
|
159
|
+
this.syncBlockURLRequests.set(resourceId, true);
|
|
158
160
|
this.dataProvider.fetchSyncBlockSourceInfo(blockInstanceId, sourceAri, product, this.fireAnalyticsEvent).then(function (sourceInfo) {
|
|
159
161
|
if (!sourceInfo) {
|
|
160
162
|
return;
|
|
@@ -164,17 +166,17 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
164
166
|
_this.updateSourceTitleSubscriptions(resourceId, sourceInfo.title);
|
|
165
167
|
}
|
|
166
168
|
}).catch(function (error) {
|
|
167
|
-
var _this$
|
|
168
|
-
(_this$
|
|
169
|
+
var _this$fireAnalyticsEv3;
|
|
170
|
+
(_this$fireAnalyticsEv3 = _this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 || _this$fireAnalyticsEv3.call(_this, getSourceInfoErrorPayload(error.message));
|
|
169
171
|
}).finally(function () {
|
|
170
172
|
_this.syncBlockURLRequests.delete(resourceId);
|
|
171
173
|
});
|
|
172
174
|
} catch (error) {
|
|
173
|
-
var _this$
|
|
175
|
+
var _this$fireAnalyticsEv4;
|
|
174
176
|
logException(error, {
|
|
175
177
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
176
178
|
});
|
|
177
|
-
(_this$
|
|
179
|
+
(_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 || _this$fireAnalyticsEv4.call(this, getSourceInfoErrorPayload(error.message));
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
|
|
@@ -383,11 +385,11 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
383
385
|
}
|
|
384
386
|
return this.subscribeToSyncBlock(resourceId, localId, callback);
|
|
385
387
|
} catch (error) {
|
|
386
|
-
var _this$
|
|
388
|
+
var _this$fireAnalyticsEv5;
|
|
387
389
|
logException(error, {
|
|
388
390
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
389
391
|
});
|
|
390
|
-
(_this$
|
|
392
|
+
(_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 || _this$fireAnalyticsEv5.call(this, fetchErrorPayload(error.message));
|
|
391
393
|
return function () {};
|
|
392
394
|
}
|
|
393
395
|
}
|
|
@@ -411,12 +413,12 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
411
413
|
key: "getProviderFactory",
|
|
412
414
|
value: function getProviderFactory(resourceId) {
|
|
413
415
|
if (!this.dataProvider) {
|
|
414
|
-
var _this$
|
|
416
|
+
var _this$fireAnalyticsEv6;
|
|
415
417
|
var error = new Error('Data provider not set');
|
|
416
418
|
logException(error, {
|
|
417
419
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
418
420
|
});
|
|
419
|
-
(_this$
|
|
421
|
+
(_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 || _this$fireAnalyticsEv6.call(this, fetchErrorPayload(error.message));
|
|
420
422
|
return undefined;
|
|
421
423
|
}
|
|
422
424
|
var _this$dataProvider$ge = this.dataProvider.getSyncedBlockRendererProviderOptions(),
|
|
@@ -435,11 +437,11 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
435
437
|
try {
|
|
436
438
|
this.retrieveDynamicProviders(resourceId, providerFactory, providerCreator);
|
|
437
439
|
} catch (error) {
|
|
438
|
-
var _this$
|
|
440
|
+
var _this$fireAnalyticsEv7;
|
|
439
441
|
logException(error, {
|
|
440
442
|
location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
|
|
441
443
|
});
|
|
442
|
-
(_this$
|
|
444
|
+
(_this$fireAnalyticsEv7 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv7 === void 0 || _this$fireAnalyticsEv7.call(this, fetchErrorPayload(error.message));
|
|
443
445
|
}
|
|
444
446
|
}
|
|
445
447
|
return providerFactory;
|
|
@@ -458,8 +460,8 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
458
460
|
}
|
|
459
461
|
var syncBlock = this.getFromCache(resourceId);
|
|
460
462
|
if (!syncBlock || !((_syncBlock$data2 = syncBlock.data) !== null && _syncBlock$data2 !== void 0 && _syncBlock$data2.sourceAri) || !((_syncBlock$data3 = syncBlock.data) !== null && _syncBlock$data3 !== void 0 && _syncBlock$data3.product)) {
|
|
461
|
-
var _this$
|
|
462
|
-
(_this$
|
|
463
|
+
var _this$fireAnalyticsEv8;
|
|
464
|
+
(_this$fireAnalyticsEv8 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv8 === void 0 || _this$fireAnalyticsEv8.call(this, fetchErrorPayload('Sync block or source ari or product not found'));
|
|
463
465
|
return;
|
|
464
466
|
}
|
|
465
467
|
var parentInfo = this.dataProvider.retrieveSyncBlockParentInfo((_syncBlock$data4 = syncBlock.data) === null || _syncBlock$data4 === void 0 ? void 0 : _syncBlock$data4.sourceAri, (_syncBlock$data5 = syncBlock.data) === null || _syncBlock$data5 === void 0 ? void 0 : _syncBlock$data5.product);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
export var stringifyError = function stringifyError(error) {
|
|
3
3
|
try {
|
|
4
4
|
return JSON.stringify(error);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, type RendererSyncBlockEventPayload, type OperationalAEP, type SyncBlockEventPayload } from
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, type RendererSyncBlockEventPayload, type OperationalAEP, type SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
export declare const stringifyError: (error: unknown) => string | undefined;
|
|
3
3
|
export declare const getErrorPayload: <T extends ACTION_SUBJECT_ID>(actionSubjectId: T, error: string) => OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, T, {
|
|
4
4
|
error: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, type RendererSyncBlockEventPayload, type OperationalAEP, type SyncBlockEventPayload } from
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, type RendererSyncBlockEventPayload, type OperationalAEP, type SyncBlockEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
export declare const stringifyError: (error: unknown) => string | undefined;
|
|
3
3
|
export declare const getErrorPayload: <T extends ACTION_SUBJECT_ID>(actionSubjectId: T, error: string) => OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, T, {
|
|
4
4
|
error: string;
|
package/package.json
CHANGED