@atlaskit/editor-synced-block-provider 3.8.1 → 3.9.0
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/clients/block-service/blockService.js +9 -5
- package/dist/cjs/hooks/useFetchSyncBlockTitle.js +13 -1
- package/dist/cjs/providers/block-service/blockServiceAPI.js +80 -63
- package/dist/cjs/providers/syncBlockProvider.js +28 -27
- package/dist/es2019/clients/block-service/blockService.js +7 -4
- package/dist/es2019/hooks/useFetchSyncBlockTitle.js +15 -1
- package/dist/es2019/providers/block-service/blockServiceAPI.js +22 -12
- package/dist/es2019/providers/syncBlockProvider.js +11 -9
- package/dist/esm/clients/block-service/blockService.js +9 -5
- package/dist/esm/hooks/useFetchSyncBlockTitle.js +13 -1
- package/dist/esm/providers/block-service/blockServiceAPI.js +78 -61
- package/dist/esm/providers/syncBlockProvider.js +28 -27
- package/dist/types/clients/block-service/blockService.d.ts +8 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/providers/block-service/blockServiceAPI.d.ts +3 -3
- package/dist/types/providers/types.d.ts +6 -2
- package/dist/types-ts4.5/clients/block-service/blockService.d.ts +8 -3
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +3 -3
- package/dist/types-ts4.5/providers/types.d.ts +6 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 3.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`fe0f9c8de91c3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe0f9c8de91c3) -
|
|
8
|
+
The batch retrieve of the blocks must also send document ARI and also the local instance ID of the
|
|
9
|
+
reference blocks
|
|
10
|
+
|
|
3
11
|
## 3.8.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -137,11 +137,11 @@ var BlockError = exports.BlockError = /*#__PURE__*/function (_Error) {
|
|
|
137
137
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
138
138
|
var getSyncedBlockContent = exports.getSyncedBlockContent = /*#__PURE__*/function () {
|
|
139
139
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref2) {
|
|
140
|
-
var blockAri,
|
|
140
|
+
var blockAri, queryParams, response;
|
|
141
141
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
142
142
|
while (1) switch (_context2.prev = _context2.next) {
|
|
143
143
|
case 0:
|
|
144
|
-
blockAri = _ref2.blockAri
|
|
144
|
+
blockAri = _ref2.blockAri;
|
|
145
145
|
// Disable sending documentAri for now. We'll add it back if we find a way to update references that follows the save & refresh principle.
|
|
146
146
|
// Slack discussion here: https://atlassian.slack.com/archives/C09DZT1TBNW/p1767836775552099?thread_ts=1767836754.024889&cid=C09DZT1TBNW
|
|
147
147
|
// const queryParams = documentAri ? `?documentAri=${encodeURIComponent(documentAri)}` : '';
|
|
@@ -184,17 +184,21 @@ var getSyncedBlockContent = exports.getSyncedBlockContent = /*#__PURE__*/functio
|
|
|
184
184
|
*/
|
|
185
185
|
var batchRetrieveSyncedBlocks = exports.batchRetrieveSyncedBlocks = /*#__PURE__*/function () {
|
|
186
186
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref4) {
|
|
187
|
-
var
|
|
187
|
+
var blockIdentifiers, documentAri, response;
|
|
188
188
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
189
189
|
while (1) switch (_context3.prev = _context3.next) {
|
|
190
190
|
case 0:
|
|
191
|
-
|
|
191
|
+
blockIdentifiers = _ref4.blockIdentifiers, documentAri = _ref4.documentAri;
|
|
192
192
|
_context3.next = 3;
|
|
193
193
|
return (0, _retry.fetchWithRetry)("".concat(BLOCK_SERVICE_API_URL, "/block/batch-retrieve"), {
|
|
194
194
|
method: 'POST',
|
|
195
195
|
headers: COMMON_HEADERS,
|
|
196
196
|
body: JSON.stringify({
|
|
197
|
-
|
|
197
|
+
documentAri: documentAri,
|
|
198
|
+
blockIdentifiers: blockIdentifiers,
|
|
199
|
+
blockAris: blockIdentifiers.map(function (blockIdentifier) {
|
|
200
|
+
return blockIdentifier.blockAri;
|
|
201
|
+
})
|
|
198
202
|
})
|
|
199
203
|
});
|
|
200
204
|
case 3:
|
|
@@ -8,7 +8,19 @@ exports.useFetchSyncBlockTitle = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var useFetchSyncBlockTitle = exports.useFetchSyncBlockTitle = function useFetchSyncBlockTitle(manager, syncBlockNode) {
|
|
11
|
-
|
|
11
|
+
// Initialize state from cache to prevent flickering during re-renders
|
|
12
|
+
var _useState = (0, _react.useState)(function () {
|
|
13
|
+
var _cachedData$data;
|
|
14
|
+
if (syncBlockNode.type.name !== 'syncBlock') {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
var resourceId = syncBlockNode.attrs.resourceId;
|
|
18
|
+
if (!resourceId) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
var cachedData = manager.referenceManager.getFromCache(resourceId);
|
|
22
|
+
return cachedData === null || cachedData === void 0 || (_cachedData$data = cachedData.data) === null || _cachedData$data === void 0 ? void 0 : _cachedData$data.sourceTitle;
|
|
23
|
+
}),
|
|
12
24
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
13
25
|
sourceTitle = _useState2[0],
|
|
14
26
|
setSourceTitle = _useState2[1];
|
|
@@ -17,7 +17,7 @@ var _ari = require("../../clients/block-service/ari");
|
|
|
17
17
|
var _blockService = require("../../clients/block-service/blockService");
|
|
18
18
|
var _types = require("../../common/types");
|
|
19
19
|
var _errorHandling = require("../../utils/errorHandling");
|
|
20
|
-
var
|
|
20
|
+
var _resourceId2 = require("../../utils/resourceId");
|
|
21
21
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
22
22
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
23
23
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -326,67 +326,84 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
326
326
|
|
|
327
327
|
/**
|
|
328
328
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
329
|
-
* @param
|
|
329
|
+
* @param blockNodeIdentifiers - Array of block node identifiers, containing block instance (local) ID + resource IDs to fetch
|
|
330
330
|
* @returns Array of SyncBlockInstance results
|
|
331
331
|
*/
|
|
332
332
|
}, {
|
|
333
333
|
key: "batchFetchData",
|
|
334
334
|
value: (function () {
|
|
335
|
-
var _batchFetchData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(
|
|
335
|
+
var _batchFetchData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(blockNodeIdentifiers) {
|
|
336
336
|
var _this2 = this;
|
|
337
|
-
var
|
|
337
|
+
var blockIdentifiers, validResourceIds, processedResourceIds, response, results, _iterator, _step, blockContentResponse, resourceId, value, syncedBlockData, _iterator2, _step2, errorResponse, _resourceId, _iterator3, _step3, blockNodeIdentifier;
|
|
338
338
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
339
339
|
while (1) switch (_context4.prev = _context4.next) {
|
|
340
340
|
case 0:
|
|
341
|
-
|
|
342
|
-
return
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
341
|
+
blockIdentifiers = blockNodeIdentifiers.map(function (blockIdentifier) {
|
|
342
|
+
return {
|
|
343
|
+
blockAri: (0, _ari.generateBlockAriFromReference)({
|
|
344
|
+
cloudId: _this2.cloudId,
|
|
345
|
+
resourceId: blockIdentifier.resourceId
|
|
346
|
+
}),
|
|
347
|
+
blockInstanceId: blockIdentifier.blockInstanceId
|
|
348
|
+
};
|
|
346
349
|
}); // Create a set of valid resourceIds for validation
|
|
347
|
-
validResourceIds = new Set(
|
|
350
|
+
validResourceIds = new Set(blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
351
|
+
return blockNodeIdentifier.resourceId;
|
|
352
|
+
})); // Track which resourceIds have been processed
|
|
348
353
|
processedResourceIds = new Set();
|
|
349
|
-
|
|
350
|
-
|
|
354
|
+
if (this.parentAri) {
|
|
355
|
+
_context4.next = 5;
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
return _context4.abrupt("return", blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
359
|
+
return {
|
|
360
|
+
error: _types.SyncBlockError.Errored,
|
|
361
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
362
|
+
};
|
|
363
|
+
}));
|
|
364
|
+
case 5:
|
|
365
|
+
_context4.prev = 5;
|
|
366
|
+
_context4.next = 8;
|
|
351
367
|
return (0, _blockService.batchRetrieveSyncedBlocks)({
|
|
352
|
-
|
|
368
|
+
documentAri: this.parentAri,
|
|
369
|
+
blockIdentifiers: blockIdentifiers
|
|
353
370
|
});
|
|
354
|
-
case
|
|
371
|
+
case 8:
|
|
355
372
|
response = _context4.sent;
|
|
356
373
|
results = []; // Process successful blocks
|
|
357
374
|
if (!response.success) {
|
|
358
|
-
_context4.next =
|
|
375
|
+
_context4.next = 35;
|
|
359
376
|
break;
|
|
360
377
|
}
|
|
361
378
|
_iterator = _createForOfIteratorHelper(response.success);
|
|
362
|
-
_context4.prev =
|
|
379
|
+
_context4.prev = 12;
|
|
363
380
|
_iterator.s();
|
|
364
|
-
case
|
|
381
|
+
case 14:
|
|
365
382
|
if ((_step = _iterator.n()).done) {
|
|
366
|
-
_context4.next =
|
|
383
|
+
_context4.next = 27;
|
|
367
384
|
break;
|
|
368
385
|
}
|
|
369
386
|
blockContentResponse = _step.value;
|
|
370
387
|
// Extract resourceId from the returned blockAri
|
|
371
388
|
resourceId = this.extractResourceIdFromBlockAri(blockContentResponse.blockAri);
|
|
372
389
|
if (!(!resourceId || !validResourceIds.has(resourceId))) {
|
|
373
|
-
_context4.next =
|
|
390
|
+
_context4.next = 19;
|
|
374
391
|
break;
|
|
375
392
|
}
|
|
376
|
-
return _context4.abrupt("continue",
|
|
377
|
-
case
|
|
393
|
+
return _context4.abrupt("continue", 25);
|
|
394
|
+
case 19:
|
|
378
395
|
processedResourceIds.add(resourceId);
|
|
379
396
|
value = blockContentResponse.content;
|
|
380
397
|
if (value) {
|
|
381
|
-
_context4.next =
|
|
398
|
+
_context4.next = 24;
|
|
382
399
|
break;
|
|
383
400
|
}
|
|
384
401
|
results.push({
|
|
385
402
|
error: _types.SyncBlockError.NotFound,
|
|
386
403
|
resourceId: resourceId
|
|
387
404
|
});
|
|
388
|
-
return _context4.abrupt("continue",
|
|
389
|
-
case
|
|
405
|
+
return _context4.abrupt("continue", 25);
|
|
406
|
+
case 24:
|
|
390
407
|
try {
|
|
391
408
|
syncedBlockData = JSON.parse(value);
|
|
392
409
|
results.push({
|
|
@@ -405,71 +422,71 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
405
422
|
resourceId: resourceId
|
|
406
423
|
});
|
|
407
424
|
}
|
|
408
|
-
case 23:
|
|
409
|
-
_context4.next = 12;
|
|
410
|
-
break;
|
|
411
425
|
case 25:
|
|
412
|
-
_context4.next =
|
|
426
|
+
_context4.next = 14;
|
|
413
427
|
break;
|
|
414
428
|
case 27:
|
|
415
|
-
_context4.
|
|
416
|
-
|
|
429
|
+
_context4.next = 32;
|
|
430
|
+
break;
|
|
431
|
+
case 29:
|
|
432
|
+
_context4.prev = 29;
|
|
433
|
+
_context4.t0 = _context4["catch"](12);
|
|
417
434
|
_iterator.e(_context4.t0);
|
|
418
|
-
case
|
|
419
|
-
_context4.prev =
|
|
435
|
+
case 32:
|
|
436
|
+
_context4.prev = 32;
|
|
420
437
|
_iterator.f();
|
|
421
|
-
return _context4.finish(
|
|
422
|
-
case
|
|
438
|
+
return _context4.finish(32);
|
|
439
|
+
case 35:
|
|
423
440
|
if (!response.error) {
|
|
424
|
-
_context4.next =
|
|
441
|
+
_context4.next = 56;
|
|
425
442
|
break;
|
|
426
443
|
}
|
|
427
444
|
_iterator2 = _createForOfIteratorHelper(response.error);
|
|
428
|
-
_context4.prev =
|
|
445
|
+
_context4.prev = 37;
|
|
429
446
|
_iterator2.s();
|
|
430
|
-
case
|
|
447
|
+
case 39:
|
|
431
448
|
if ((_step2 = _iterator2.n()).done) {
|
|
432
|
-
_context4.next =
|
|
449
|
+
_context4.next = 48;
|
|
433
450
|
break;
|
|
434
451
|
}
|
|
435
452
|
errorResponse = _step2.value;
|
|
436
453
|
// Extract resourceId from the returned blockAri
|
|
437
454
|
_resourceId = this.extractResourceIdFromBlockAri(errorResponse.blockAri);
|
|
438
455
|
if (!(!_resourceId || !validResourceIds.has(_resourceId))) {
|
|
439
|
-
_context4.next =
|
|
456
|
+
_context4.next = 44;
|
|
440
457
|
break;
|
|
441
458
|
}
|
|
442
|
-
return _context4.abrupt("continue",
|
|
443
|
-
case
|
|
459
|
+
return _context4.abrupt("continue", 46);
|
|
460
|
+
case 44:
|
|
444
461
|
processedResourceIds.add(_resourceId);
|
|
445
462
|
results.push({
|
|
446
463
|
error: _types.SyncBlockError.Errored,
|
|
447
464
|
resourceId: _resourceId
|
|
448
465
|
});
|
|
449
|
-
case 44:
|
|
450
|
-
_context4.next = 37;
|
|
451
|
-
break;
|
|
452
466
|
case 46:
|
|
453
|
-
_context4.next =
|
|
467
|
+
_context4.next = 39;
|
|
454
468
|
break;
|
|
455
469
|
case 48:
|
|
456
|
-
_context4.
|
|
457
|
-
|
|
470
|
+
_context4.next = 53;
|
|
471
|
+
break;
|
|
472
|
+
case 50:
|
|
473
|
+
_context4.prev = 50;
|
|
474
|
+
_context4.t1 = _context4["catch"](37);
|
|
458
475
|
_iterator2.e(_context4.t1);
|
|
459
|
-
case
|
|
460
|
-
_context4.prev =
|
|
476
|
+
case 53:
|
|
477
|
+
_context4.prev = 53;
|
|
461
478
|
_iterator2.f();
|
|
462
|
-
return _context4.finish(
|
|
463
|
-
case
|
|
479
|
+
return _context4.finish(53);
|
|
480
|
+
case 56:
|
|
464
481
|
// Ensure all resourceIds have a result - return NotFound for any missing ones
|
|
465
|
-
_iterator3 = _createForOfIteratorHelper(
|
|
482
|
+
_iterator3 = _createForOfIteratorHelper(blockNodeIdentifiers);
|
|
466
483
|
try {
|
|
467
484
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
468
|
-
|
|
469
|
-
if (!processedResourceIds.has(
|
|
485
|
+
blockNodeIdentifier = _step3.value;
|
|
486
|
+
if (!processedResourceIds.has(blockNodeIdentifier.resourceId)) {
|
|
470
487
|
results.push({
|
|
471
488
|
error: _types.SyncBlockError.NotFound,
|
|
472
|
-
resourceId:
|
|
489
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
473
490
|
});
|
|
474
491
|
}
|
|
475
492
|
}
|
|
@@ -479,20 +496,20 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
479
496
|
_iterator3.f();
|
|
480
497
|
}
|
|
481
498
|
return _context4.abrupt("return", results);
|
|
482
|
-
case
|
|
483
|
-
_context4.prev =
|
|
484
|
-
_context4.t2 = _context4["catch"](
|
|
485
|
-
return _context4.abrupt("return",
|
|
499
|
+
case 61:
|
|
500
|
+
_context4.prev = 61;
|
|
501
|
+
_context4.t2 = _context4["catch"](5);
|
|
502
|
+
return _context4.abrupt("return", blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
486
503
|
return {
|
|
487
504
|
error: _context4.t2 instanceof _blockService.BlockError ? mapBlockError(_context4.t2) : _types.SyncBlockError.Errored,
|
|
488
|
-
resourceId: resourceId
|
|
505
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
489
506
|
};
|
|
490
507
|
}));
|
|
491
|
-
case
|
|
508
|
+
case 64:
|
|
492
509
|
case "end":
|
|
493
510
|
return _context4.stop();
|
|
494
511
|
}
|
|
495
|
-
}, _callee4, this, [[
|
|
512
|
+
}, _callee4, this, [[5, 61], [12, 29, 32, 35], [37, 50, 53, 56]]);
|
|
496
513
|
}));
|
|
497
514
|
function batchFetchData(_x4) {
|
|
498
515
|
return _batchFetchData.apply(this, arguments);
|
|
@@ -723,7 +740,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
723
740
|
}, {
|
|
724
741
|
key: "generateResourceIdForReference",
|
|
725
742
|
value: function generateResourceIdForReference(sourceId) {
|
|
726
|
-
return (0,
|
|
743
|
+
return (0, _resourceId2.createResourceIdForReference)(this.product, this.parentId || '', sourceId);
|
|
727
744
|
}
|
|
728
745
|
}, {
|
|
729
746
|
key: "generateResourceId",
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useMemoizedSyncedBlockProvider = exports.SyncBlockProvider = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -88,49 +87,51 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
88
87
|
value: (function () {
|
|
89
88
|
var _fetchNodesData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(nodes) {
|
|
90
89
|
var _this2 = this;
|
|
91
|
-
var
|
|
90
|
+
var blockIdentifiers;
|
|
92
91
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
93
92
|
while (1) switch (_context.prev = _context.next) {
|
|
94
93
|
case 0:
|
|
95
|
-
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
blockIdentifiers = nodes.map(function (node) {
|
|
95
|
+
return {
|
|
96
|
+
resourceId: node.attrs.resourceId,
|
|
97
|
+
blockInstanceId: node.attrs.localId
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
if (!(blockIdentifiers.length === 0)) {
|
|
101
|
+
_context.next = 3;
|
|
101
102
|
break;
|
|
102
103
|
}
|
|
103
104
|
return _context.abrupt("return", []);
|
|
104
|
-
case
|
|
105
|
+
case 3:
|
|
105
106
|
if (!(0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding')) {
|
|
106
|
-
_context.next =
|
|
107
|
+
_context.next = 15;
|
|
107
108
|
break;
|
|
108
109
|
}
|
|
109
|
-
_context.prev =
|
|
110
|
-
_context.next =
|
|
111
|
-
return this.fetchProvider.batchFetchData(
|
|
112
|
-
case
|
|
110
|
+
_context.prev = 4;
|
|
111
|
+
_context.next = 7;
|
|
112
|
+
return this.fetchProvider.batchFetchData(blockIdentifiers);
|
|
113
|
+
case 7:
|
|
113
114
|
return _context.abrupt("return", _context.sent);
|
|
114
|
-
case
|
|
115
|
-
_context.prev =
|
|
116
|
-
_context.t0 = _context["catch"](
|
|
117
|
-
return _context.abrupt("return",
|
|
115
|
+
case 10:
|
|
116
|
+
_context.prev = 10;
|
|
117
|
+
_context.t0 = _context["catch"](4);
|
|
118
|
+
return _context.abrupt("return", blockIdentifiers.map(function (blockIdentifier) {
|
|
118
119
|
return {
|
|
119
120
|
error: _types.SyncBlockError.Errored,
|
|
120
|
-
resourceId: resourceId
|
|
121
|
+
resourceId: blockIdentifier.resourceId
|
|
121
122
|
};
|
|
122
123
|
}));
|
|
123
|
-
case
|
|
124
|
-
_context.next =
|
|
124
|
+
case 13:
|
|
125
|
+
_context.next = 16;
|
|
125
126
|
break;
|
|
126
|
-
case
|
|
127
|
-
return _context.abrupt("return", Promise.allSettled(
|
|
128
|
-
return _this2.fetchProvider.fetchData(resourceId).then(function (data) {
|
|
127
|
+
case 15:
|
|
128
|
+
return _context.abrupt("return", Promise.allSettled(blockIdentifiers.map(function (blockIdentifier) {
|
|
129
|
+
return _this2.fetchProvider.fetchData(blockIdentifier.resourceId).then(function (data) {
|
|
129
130
|
return data;
|
|
130
131
|
}, function () {
|
|
131
132
|
return {
|
|
132
133
|
error: _types.SyncBlockError.Errored,
|
|
133
|
-
resourceId: resourceId
|
|
134
|
+
resourceId: blockIdentifier.resourceId
|
|
134
135
|
};
|
|
135
136
|
});
|
|
136
137
|
})).then(function (results) {
|
|
@@ -140,11 +141,11 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
140
141
|
return result.value;
|
|
141
142
|
});
|
|
142
143
|
}));
|
|
143
|
-
case
|
|
144
|
+
case 16:
|
|
144
145
|
case "end":
|
|
145
146
|
return _context.stop();
|
|
146
147
|
}
|
|
147
|
-
}, _callee, this, [[
|
|
148
|
+
}, _callee, this, [[4, 10]]);
|
|
148
149
|
}));
|
|
149
150
|
function fetchNodesData(_x) {
|
|
150
151
|
return _fetchNodesData.apply(this, arguments);
|
|
@@ -100,8 +100,8 @@ export class BlockError extends Error {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
export const getSyncedBlockContent = async ({
|
|
103
|
-
blockAri
|
|
104
|
-
documentAri
|
|
103
|
+
blockAri
|
|
104
|
+
// documentAri,
|
|
105
105
|
}) => {
|
|
106
106
|
// Disable sending documentAri for now. We'll add it back if we find a way to update references that follows the save & refresh principle.
|
|
107
107
|
// Slack discussion here: https://atlassian.slack.com/archives/C09DZT1TBNW/p1767836775552099?thread_ts=1767836754.024889&cid=C09DZT1TBNW
|
|
@@ -126,13 +126,16 @@ export const getSyncedBlockContent = async ({
|
|
|
126
126
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
127
127
|
*/
|
|
128
128
|
export const batchRetrieveSyncedBlocks = async ({
|
|
129
|
-
|
|
129
|
+
blockIdentifiers,
|
|
130
|
+
documentAri
|
|
130
131
|
}) => {
|
|
131
132
|
const response = await fetchWithRetry(`${BLOCK_SERVICE_API_URL}/block/batch-retrieve`, {
|
|
132
133
|
method: 'POST',
|
|
133
134
|
headers: COMMON_HEADERS,
|
|
134
135
|
body: JSON.stringify({
|
|
135
|
-
|
|
136
|
+
documentAri,
|
|
137
|
+
blockIdentifiers,
|
|
138
|
+
blockAris: blockIdentifiers.map(blockIdentifier => blockIdentifier.blockAri)
|
|
136
139
|
})
|
|
137
140
|
});
|
|
138
141
|
if (!response.ok) {
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
export const useFetchSyncBlockTitle = (manager, syncBlockNode) => {
|
|
3
|
-
|
|
3
|
+
// Initialize state from cache to prevent flickering during re-renders
|
|
4
|
+
const [sourceTitle, setSourceTitle] = useState(() => {
|
|
5
|
+
var _cachedData$data;
|
|
6
|
+
if (syncBlockNode.type.name !== 'syncBlock') {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const {
|
|
10
|
+
resourceId
|
|
11
|
+
} = syncBlockNode.attrs;
|
|
12
|
+
if (!resourceId) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const cachedData = manager.referenceManager.getFromCache(resourceId);
|
|
16
|
+
return cachedData === null || cachedData === void 0 ? void 0 : (_cachedData$data = cachedData.data) === null || _cachedData$data === void 0 ? void 0 : _cachedData$data.sourceTitle;
|
|
17
|
+
});
|
|
4
18
|
useEffect(() => {
|
|
5
19
|
const unsubscribe = manager.referenceManager.subscribeToSourceTitle(syncBlockNode, title => {
|
|
6
20
|
setSourceTitle(title);
|
|
@@ -236,23 +236,33 @@ class BlockServiceADFFetchProvider {
|
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
238
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
239
|
-
* @param
|
|
239
|
+
* @param blockNodeIdentifiers - Array of block node identifiers, containing block instance (local) ID + resource IDs to fetch
|
|
240
240
|
* @returns Array of SyncBlockInstance results
|
|
241
241
|
*/
|
|
242
|
-
async batchFetchData(
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
async batchFetchData(blockNodeIdentifiers) {
|
|
243
|
+
const blockIdentifiers = blockNodeIdentifiers.map(blockIdentifier => ({
|
|
244
|
+
blockAri: generateBlockAriFromReference({
|
|
245
|
+
cloudId: this.cloudId,
|
|
246
|
+
resourceId: blockIdentifier.resourceId
|
|
247
|
+
}),
|
|
248
|
+
blockInstanceId: blockIdentifier.blockInstanceId
|
|
246
249
|
}));
|
|
247
250
|
|
|
248
251
|
// Create a set of valid resourceIds for validation
|
|
249
|
-
const validResourceIds = new Set(
|
|
252
|
+
const validResourceIds = new Set(blockNodeIdentifiers.map(blockNodeIdentifier => blockNodeIdentifier.resourceId));
|
|
250
253
|
|
|
251
254
|
// Track which resourceIds have been processed
|
|
252
255
|
const processedResourceIds = new Set();
|
|
256
|
+
if (!this.parentAri) {
|
|
257
|
+
return blockNodeIdentifiers.map(blockNodeIdentifier => ({
|
|
258
|
+
error: SyncBlockError.Errored,
|
|
259
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
253
262
|
try {
|
|
254
263
|
const response = await batchRetrieveSyncedBlocks({
|
|
255
|
-
|
|
264
|
+
documentAri: this.parentAri,
|
|
265
|
+
blockIdentifiers
|
|
256
266
|
});
|
|
257
267
|
const results = [];
|
|
258
268
|
|
|
@@ -311,20 +321,20 @@ class BlockServiceADFFetchProvider {
|
|
|
311
321
|
}
|
|
312
322
|
|
|
313
323
|
// Ensure all resourceIds have a result - return NotFound for any missing ones
|
|
314
|
-
for (const
|
|
315
|
-
if (!processedResourceIds.has(resourceId)) {
|
|
324
|
+
for (const blockNodeIdentifier of blockNodeIdentifiers) {
|
|
325
|
+
if (!processedResourceIds.has(blockNodeIdentifier.resourceId)) {
|
|
316
326
|
results.push({
|
|
317
327
|
error: SyncBlockError.NotFound,
|
|
318
|
-
resourceId
|
|
328
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
319
329
|
});
|
|
320
330
|
}
|
|
321
331
|
}
|
|
322
332
|
return results;
|
|
323
333
|
} catch (error) {
|
|
324
334
|
// If batch request fails, return error for all resourceIds
|
|
325
|
-
return
|
|
335
|
+
return blockNodeIdentifiers.map(blockNodeIdentifier => ({
|
|
326
336
|
error: error instanceof BlockError ? mapBlockError(error) : SyncBlockError.Errored,
|
|
327
|
-
resourceId
|
|
337
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
328
338
|
}));
|
|
329
339
|
}
|
|
330
340
|
}
|
|
@@ -55,29 +55,31 @@ export class SyncBlockProvider extends SyncBlockDataProvider {
|
|
|
55
55
|
* @returns Array of {resourceId?: string, error?: string}.
|
|
56
56
|
*/
|
|
57
57
|
async fetchNodesData(nodes) {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const blockIdentifiers = nodes.map(node => ({
|
|
59
|
+
resourceId: node.attrs.resourceId,
|
|
60
|
+
blockInstanceId: node.attrs.localId
|
|
61
|
+
}));
|
|
62
|
+
if (blockIdentifiers.length === 0) {
|
|
61
63
|
return [];
|
|
62
64
|
}
|
|
63
65
|
if (fg('platform_synced_block_dogfooding')) {
|
|
64
66
|
try {
|
|
65
|
-
return await this.fetchProvider.batchFetchData(
|
|
67
|
+
return await this.fetchProvider.batchFetchData(blockIdentifiers);
|
|
66
68
|
} catch {
|
|
67
69
|
// If batch fetch fails, return error for all resourceIds
|
|
68
|
-
return
|
|
70
|
+
return blockIdentifiers.map(blockIdentifier => ({
|
|
69
71
|
error: SyncBlockError.Errored,
|
|
70
|
-
resourceId
|
|
72
|
+
resourceId: blockIdentifier.resourceId
|
|
71
73
|
}));
|
|
72
74
|
}
|
|
73
75
|
} else {
|
|
74
|
-
return Promise.allSettled(
|
|
75
|
-
return this.fetchProvider.fetchData(resourceId).then(data => {
|
|
76
|
+
return Promise.allSettled(blockIdentifiers.map(blockIdentifier => {
|
|
77
|
+
return this.fetchProvider.fetchData(blockIdentifier.resourceId).then(data => {
|
|
76
78
|
return data;
|
|
77
79
|
}, () => {
|
|
78
80
|
return {
|
|
79
81
|
error: SyncBlockError.Errored,
|
|
80
|
-
resourceId
|
|
82
|
+
resourceId: blockIdentifier.resourceId
|
|
81
83
|
};
|
|
82
84
|
});
|
|
83
85
|
})).then(results => {
|
|
@@ -130,11 +130,11 @@ export var BlockError = /*#__PURE__*/function (_Error) {
|
|
|
130
130
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
131
131
|
export var getSyncedBlockContent = /*#__PURE__*/function () {
|
|
132
132
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
133
|
-
var blockAri,
|
|
133
|
+
var blockAri, queryParams, response;
|
|
134
134
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
135
135
|
while (1) switch (_context2.prev = _context2.next) {
|
|
136
136
|
case 0:
|
|
137
|
-
blockAri = _ref2.blockAri
|
|
137
|
+
blockAri = _ref2.blockAri;
|
|
138
138
|
// Disable sending documentAri for now. We'll add it back if we find a way to update references that follows the save & refresh principle.
|
|
139
139
|
// Slack discussion here: https://atlassian.slack.com/archives/C09DZT1TBNW/p1767836775552099?thread_ts=1767836754.024889&cid=C09DZT1TBNW
|
|
140
140
|
// const queryParams = documentAri ? `?documentAri=${encodeURIComponent(documentAri)}` : '';
|
|
@@ -177,17 +177,21 @@ export var getSyncedBlockContent = /*#__PURE__*/function () {
|
|
|
177
177
|
*/
|
|
178
178
|
export var batchRetrieveSyncedBlocks = /*#__PURE__*/function () {
|
|
179
179
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
180
|
-
var
|
|
180
|
+
var blockIdentifiers, documentAri, response;
|
|
181
181
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
182
182
|
while (1) switch (_context3.prev = _context3.next) {
|
|
183
183
|
case 0:
|
|
184
|
-
|
|
184
|
+
blockIdentifiers = _ref4.blockIdentifiers, documentAri = _ref4.documentAri;
|
|
185
185
|
_context3.next = 3;
|
|
186
186
|
return fetchWithRetry("".concat(BLOCK_SERVICE_API_URL, "/block/batch-retrieve"), {
|
|
187
187
|
method: 'POST',
|
|
188
188
|
headers: COMMON_HEADERS,
|
|
189
189
|
body: JSON.stringify({
|
|
190
|
-
|
|
190
|
+
documentAri: documentAri,
|
|
191
|
+
blockIdentifiers: blockIdentifiers,
|
|
192
|
+
blockAris: blockIdentifiers.map(function (blockIdentifier) {
|
|
193
|
+
return blockIdentifier.blockAri;
|
|
194
|
+
})
|
|
191
195
|
})
|
|
192
196
|
});
|
|
193
197
|
case 3:
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
export var useFetchSyncBlockTitle = function useFetchSyncBlockTitle(manager, syncBlockNode) {
|
|
4
|
-
|
|
4
|
+
// Initialize state from cache to prevent flickering during re-renders
|
|
5
|
+
var _useState = useState(function () {
|
|
6
|
+
var _cachedData$data;
|
|
7
|
+
if (syncBlockNode.type.name !== 'syncBlock') {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
var resourceId = syncBlockNode.attrs.resourceId;
|
|
11
|
+
if (!resourceId) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
var cachedData = manager.referenceManager.getFromCache(resourceId);
|
|
15
|
+
return cachedData === null || cachedData === void 0 || (_cachedData$data = cachedData.data) === null || _cachedData$data === void 0 ? void 0 : _cachedData$data.sourceTitle;
|
|
16
|
+
}),
|
|
5
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
6
18
|
sourceTitle = _useState2[0],
|
|
7
19
|
setSourceTitle = _useState2[1];
|
|
@@ -320,67 +320,84 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
322
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
323
|
-
* @param
|
|
323
|
+
* @param blockNodeIdentifiers - Array of block node identifiers, containing block instance (local) ID + resource IDs to fetch
|
|
324
324
|
* @returns Array of SyncBlockInstance results
|
|
325
325
|
*/
|
|
326
326
|
}, {
|
|
327
327
|
key: "batchFetchData",
|
|
328
328
|
value: (function () {
|
|
329
|
-
var _batchFetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(
|
|
329
|
+
var _batchFetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(blockNodeIdentifiers) {
|
|
330
330
|
var _this2 = this;
|
|
331
|
-
var
|
|
331
|
+
var blockIdentifiers, validResourceIds, processedResourceIds, response, results, _iterator, _step, blockContentResponse, resourceId, value, syncedBlockData, _iterator2, _step2, errorResponse, _resourceId, _iterator3, _step3, blockNodeIdentifier;
|
|
332
332
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
333
333
|
while (1) switch (_context4.prev = _context4.next) {
|
|
334
334
|
case 0:
|
|
335
|
-
|
|
336
|
-
return
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
335
|
+
blockIdentifiers = blockNodeIdentifiers.map(function (blockIdentifier) {
|
|
336
|
+
return {
|
|
337
|
+
blockAri: generateBlockAriFromReference({
|
|
338
|
+
cloudId: _this2.cloudId,
|
|
339
|
+
resourceId: blockIdentifier.resourceId
|
|
340
|
+
}),
|
|
341
|
+
blockInstanceId: blockIdentifier.blockInstanceId
|
|
342
|
+
};
|
|
340
343
|
}); // Create a set of valid resourceIds for validation
|
|
341
|
-
validResourceIds = new Set(
|
|
344
|
+
validResourceIds = new Set(blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
345
|
+
return blockNodeIdentifier.resourceId;
|
|
346
|
+
})); // Track which resourceIds have been processed
|
|
342
347
|
processedResourceIds = new Set();
|
|
343
|
-
|
|
344
|
-
|
|
348
|
+
if (this.parentAri) {
|
|
349
|
+
_context4.next = 5;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
return _context4.abrupt("return", blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
353
|
+
return {
|
|
354
|
+
error: SyncBlockError.Errored,
|
|
355
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
356
|
+
};
|
|
357
|
+
}));
|
|
358
|
+
case 5:
|
|
359
|
+
_context4.prev = 5;
|
|
360
|
+
_context4.next = 8;
|
|
345
361
|
return batchRetrieveSyncedBlocks({
|
|
346
|
-
|
|
362
|
+
documentAri: this.parentAri,
|
|
363
|
+
blockIdentifiers: blockIdentifiers
|
|
347
364
|
});
|
|
348
|
-
case
|
|
365
|
+
case 8:
|
|
349
366
|
response = _context4.sent;
|
|
350
367
|
results = []; // Process successful blocks
|
|
351
368
|
if (!response.success) {
|
|
352
|
-
_context4.next =
|
|
369
|
+
_context4.next = 35;
|
|
353
370
|
break;
|
|
354
371
|
}
|
|
355
372
|
_iterator = _createForOfIteratorHelper(response.success);
|
|
356
|
-
_context4.prev =
|
|
373
|
+
_context4.prev = 12;
|
|
357
374
|
_iterator.s();
|
|
358
|
-
case
|
|
375
|
+
case 14:
|
|
359
376
|
if ((_step = _iterator.n()).done) {
|
|
360
|
-
_context4.next =
|
|
377
|
+
_context4.next = 27;
|
|
361
378
|
break;
|
|
362
379
|
}
|
|
363
380
|
blockContentResponse = _step.value;
|
|
364
381
|
// Extract resourceId from the returned blockAri
|
|
365
382
|
resourceId = this.extractResourceIdFromBlockAri(blockContentResponse.blockAri);
|
|
366
383
|
if (!(!resourceId || !validResourceIds.has(resourceId))) {
|
|
367
|
-
_context4.next =
|
|
384
|
+
_context4.next = 19;
|
|
368
385
|
break;
|
|
369
386
|
}
|
|
370
|
-
return _context4.abrupt("continue",
|
|
371
|
-
case
|
|
387
|
+
return _context4.abrupt("continue", 25);
|
|
388
|
+
case 19:
|
|
372
389
|
processedResourceIds.add(resourceId);
|
|
373
390
|
value = blockContentResponse.content;
|
|
374
391
|
if (value) {
|
|
375
|
-
_context4.next =
|
|
392
|
+
_context4.next = 24;
|
|
376
393
|
break;
|
|
377
394
|
}
|
|
378
395
|
results.push({
|
|
379
396
|
error: SyncBlockError.NotFound,
|
|
380
397
|
resourceId: resourceId
|
|
381
398
|
});
|
|
382
|
-
return _context4.abrupt("continue",
|
|
383
|
-
case
|
|
399
|
+
return _context4.abrupt("continue", 25);
|
|
400
|
+
case 24:
|
|
384
401
|
try {
|
|
385
402
|
syncedBlockData = JSON.parse(value);
|
|
386
403
|
results.push({
|
|
@@ -399,71 +416,71 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
399
416
|
resourceId: resourceId
|
|
400
417
|
});
|
|
401
418
|
}
|
|
402
|
-
case 23:
|
|
403
|
-
_context4.next = 12;
|
|
404
|
-
break;
|
|
405
419
|
case 25:
|
|
406
|
-
_context4.next =
|
|
420
|
+
_context4.next = 14;
|
|
407
421
|
break;
|
|
408
422
|
case 27:
|
|
409
|
-
_context4.
|
|
410
|
-
|
|
423
|
+
_context4.next = 32;
|
|
424
|
+
break;
|
|
425
|
+
case 29:
|
|
426
|
+
_context4.prev = 29;
|
|
427
|
+
_context4.t0 = _context4["catch"](12);
|
|
411
428
|
_iterator.e(_context4.t0);
|
|
412
|
-
case
|
|
413
|
-
_context4.prev =
|
|
429
|
+
case 32:
|
|
430
|
+
_context4.prev = 32;
|
|
414
431
|
_iterator.f();
|
|
415
|
-
return _context4.finish(
|
|
416
|
-
case
|
|
432
|
+
return _context4.finish(32);
|
|
433
|
+
case 35:
|
|
417
434
|
if (!response.error) {
|
|
418
|
-
_context4.next =
|
|
435
|
+
_context4.next = 56;
|
|
419
436
|
break;
|
|
420
437
|
}
|
|
421
438
|
_iterator2 = _createForOfIteratorHelper(response.error);
|
|
422
|
-
_context4.prev =
|
|
439
|
+
_context4.prev = 37;
|
|
423
440
|
_iterator2.s();
|
|
424
|
-
case
|
|
441
|
+
case 39:
|
|
425
442
|
if ((_step2 = _iterator2.n()).done) {
|
|
426
|
-
_context4.next =
|
|
443
|
+
_context4.next = 48;
|
|
427
444
|
break;
|
|
428
445
|
}
|
|
429
446
|
errorResponse = _step2.value;
|
|
430
447
|
// Extract resourceId from the returned blockAri
|
|
431
448
|
_resourceId = this.extractResourceIdFromBlockAri(errorResponse.blockAri);
|
|
432
449
|
if (!(!_resourceId || !validResourceIds.has(_resourceId))) {
|
|
433
|
-
_context4.next =
|
|
450
|
+
_context4.next = 44;
|
|
434
451
|
break;
|
|
435
452
|
}
|
|
436
|
-
return _context4.abrupt("continue",
|
|
437
|
-
case
|
|
453
|
+
return _context4.abrupt("continue", 46);
|
|
454
|
+
case 44:
|
|
438
455
|
processedResourceIds.add(_resourceId);
|
|
439
456
|
results.push({
|
|
440
457
|
error: SyncBlockError.Errored,
|
|
441
458
|
resourceId: _resourceId
|
|
442
459
|
});
|
|
443
|
-
case 44:
|
|
444
|
-
_context4.next = 37;
|
|
445
|
-
break;
|
|
446
460
|
case 46:
|
|
447
|
-
_context4.next =
|
|
461
|
+
_context4.next = 39;
|
|
448
462
|
break;
|
|
449
463
|
case 48:
|
|
450
|
-
_context4.
|
|
451
|
-
|
|
464
|
+
_context4.next = 53;
|
|
465
|
+
break;
|
|
466
|
+
case 50:
|
|
467
|
+
_context4.prev = 50;
|
|
468
|
+
_context4.t1 = _context4["catch"](37);
|
|
452
469
|
_iterator2.e(_context4.t1);
|
|
453
|
-
case
|
|
454
|
-
_context4.prev =
|
|
470
|
+
case 53:
|
|
471
|
+
_context4.prev = 53;
|
|
455
472
|
_iterator2.f();
|
|
456
|
-
return _context4.finish(
|
|
457
|
-
case
|
|
473
|
+
return _context4.finish(53);
|
|
474
|
+
case 56:
|
|
458
475
|
// Ensure all resourceIds have a result - return NotFound for any missing ones
|
|
459
|
-
_iterator3 = _createForOfIteratorHelper(
|
|
476
|
+
_iterator3 = _createForOfIteratorHelper(blockNodeIdentifiers);
|
|
460
477
|
try {
|
|
461
478
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
462
|
-
|
|
463
|
-
if (!processedResourceIds.has(
|
|
479
|
+
blockNodeIdentifier = _step3.value;
|
|
480
|
+
if (!processedResourceIds.has(blockNodeIdentifier.resourceId)) {
|
|
464
481
|
results.push({
|
|
465
482
|
error: SyncBlockError.NotFound,
|
|
466
|
-
resourceId:
|
|
483
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
467
484
|
});
|
|
468
485
|
}
|
|
469
486
|
}
|
|
@@ -473,20 +490,20 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
473
490
|
_iterator3.f();
|
|
474
491
|
}
|
|
475
492
|
return _context4.abrupt("return", results);
|
|
476
|
-
case
|
|
477
|
-
_context4.prev =
|
|
478
|
-
_context4.t2 = _context4["catch"](
|
|
479
|
-
return _context4.abrupt("return",
|
|
493
|
+
case 61:
|
|
494
|
+
_context4.prev = 61;
|
|
495
|
+
_context4.t2 = _context4["catch"](5);
|
|
496
|
+
return _context4.abrupt("return", blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
480
497
|
return {
|
|
481
498
|
error: _context4.t2 instanceof BlockError ? mapBlockError(_context4.t2) : SyncBlockError.Errored,
|
|
482
|
-
resourceId: resourceId
|
|
499
|
+
resourceId: blockNodeIdentifier.resourceId
|
|
483
500
|
};
|
|
484
501
|
}));
|
|
485
|
-
case
|
|
502
|
+
case 64:
|
|
486
503
|
case "end":
|
|
487
504
|
return _context4.stop();
|
|
488
505
|
}
|
|
489
|
-
}, _callee4, this, [[
|
|
506
|
+
}, _callee4, this, [[5, 61], [12, 29, 32, 35], [37, 50, 53, 56]]);
|
|
490
507
|
}));
|
|
491
508
|
function batchFetchData(_x4) {
|
|
492
509
|
return _batchFetchData.apply(this, arguments);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -81,49 +80,51 @@ export var SyncBlockProvider = /*#__PURE__*/function (_SyncBlockDataProvide) {
|
|
|
81
80
|
value: (function () {
|
|
82
81
|
var _fetchNodesData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(nodes) {
|
|
83
82
|
var _this2 = this;
|
|
84
|
-
var
|
|
83
|
+
var blockIdentifiers;
|
|
85
84
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
86
85
|
while (1) switch (_context.prev = _context.next) {
|
|
87
86
|
case 0:
|
|
88
|
-
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
blockIdentifiers = nodes.map(function (node) {
|
|
88
|
+
return {
|
|
89
|
+
resourceId: node.attrs.resourceId,
|
|
90
|
+
blockInstanceId: node.attrs.localId
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
if (!(blockIdentifiers.length === 0)) {
|
|
94
|
+
_context.next = 3;
|
|
94
95
|
break;
|
|
95
96
|
}
|
|
96
97
|
return _context.abrupt("return", []);
|
|
97
|
-
case
|
|
98
|
+
case 3:
|
|
98
99
|
if (!fg('platform_synced_block_dogfooding')) {
|
|
99
|
-
_context.next =
|
|
100
|
+
_context.next = 15;
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
102
|
-
_context.prev =
|
|
103
|
-
_context.next =
|
|
104
|
-
return this.fetchProvider.batchFetchData(
|
|
105
|
-
case
|
|
103
|
+
_context.prev = 4;
|
|
104
|
+
_context.next = 7;
|
|
105
|
+
return this.fetchProvider.batchFetchData(blockIdentifiers);
|
|
106
|
+
case 7:
|
|
106
107
|
return _context.abrupt("return", _context.sent);
|
|
107
|
-
case
|
|
108
|
-
_context.prev =
|
|
109
|
-
_context.t0 = _context["catch"](
|
|
110
|
-
return _context.abrupt("return",
|
|
108
|
+
case 10:
|
|
109
|
+
_context.prev = 10;
|
|
110
|
+
_context.t0 = _context["catch"](4);
|
|
111
|
+
return _context.abrupt("return", blockIdentifiers.map(function (blockIdentifier) {
|
|
111
112
|
return {
|
|
112
113
|
error: SyncBlockError.Errored,
|
|
113
|
-
resourceId: resourceId
|
|
114
|
+
resourceId: blockIdentifier.resourceId
|
|
114
115
|
};
|
|
115
116
|
}));
|
|
116
|
-
case
|
|
117
|
-
_context.next =
|
|
117
|
+
case 13:
|
|
118
|
+
_context.next = 16;
|
|
118
119
|
break;
|
|
119
|
-
case
|
|
120
|
-
return _context.abrupt("return", Promise.allSettled(
|
|
121
|
-
return _this2.fetchProvider.fetchData(resourceId).then(function (data) {
|
|
120
|
+
case 15:
|
|
121
|
+
return _context.abrupt("return", Promise.allSettled(blockIdentifiers.map(function (blockIdentifier) {
|
|
122
|
+
return _this2.fetchProvider.fetchData(blockIdentifier.resourceId).then(function (data) {
|
|
122
123
|
return data;
|
|
123
124
|
}, function () {
|
|
124
125
|
return {
|
|
125
126
|
error: SyncBlockError.Errored,
|
|
126
|
-
resourceId: resourceId
|
|
127
|
+
resourceId: blockIdentifier.resourceId
|
|
127
128
|
};
|
|
128
129
|
});
|
|
129
130
|
})).then(function (results) {
|
|
@@ -133,11 +134,11 @@ export var SyncBlockProvider = /*#__PURE__*/function (_SyncBlockDataProvide) {
|
|
|
133
134
|
return result.value;
|
|
134
135
|
});
|
|
135
136
|
}));
|
|
136
|
-
case
|
|
137
|
+
case 16:
|
|
137
138
|
case "end":
|
|
138
139
|
return _context.stop();
|
|
139
140
|
}
|
|
140
|
-
}, _callee, this, [[
|
|
141
|
+
}, _callee, this, [[4, 10]]);
|
|
141
142
|
}));
|
|
142
143
|
function fetchNodesData(_x) {
|
|
143
144
|
return _fetchNodesData.apply(this, arguments);
|
|
@@ -92,8 +92,13 @@ type UpdateReferenceSyncedBlockOnDocumentRequest = {
|
|
|
92
92
|
documentAri: string;
|
|
93
93
|
noContent?: boolean;
|
|
94
94
|
};
|
|
95
|
+
type BlockIdentifier = {
|
|
96
|
+
blockAri: string;
|
|
97
|
+
blockInstanceId: string;
|
|
98
|
+
};
|
|
95
99
|
export type BatchRetrieveSyncedBlocksRequest = {
|
|
96
|
-
|
|
100
|
+
blockIdentifiers: BlockIdentifier[];
|
|
101
|
+
documentAri: string;
|
|
97
102
|
};
|
|
98
103
|
export type BatchRetrieveSyncedBlocksResponse = {
|
|
99
104
|
error?: Array<ErrorResponse>;
|
|
@@ -111,7 +116,7 @@ export declare class BlockError extends Error {
|
|
|
111
116
|
readonly status: number;
|
|
112
117
|
constructor(status: number);
|
|
113
118
|
}
|
|
114
|
-
export declare const getSyncedBlockContent: ({ blockAri,
|
|
119
|
+
export declare const getSyncedBlockContent: ({ blockAri, }: GetSyncedBlockContentRequest) => Promise<BlockContentResponse>;
|
|
115
120
|
/**
|
|
116
121
|
* Batch retrieves multiple synced blocks by their ARIs.
|
|
117
122
|
*
|
|
@@ -120,7 +125,7 @@ export declare const getSyncedBlockContent: ({ blockAri, documentAri, }: GetSync
|
|
|
120
125
|
* @param blockAris - Array of block ARIs to retrieve
|
|
121
126
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
122
127
|
*/
|
|
123
|
-
export declare const batchRetrieveSyncedBlocks: ({
|
|
128
|
+
export declare const batchRetrieveSyncedBlocks: ({ blockIdentifiers, documentAri, }: BatchRetrieveSyncedBlocksRequest) => Promise<BatchRetrieveSyncedBlocksResponse>;
|
|
124
129
|
export declare const deleteSyncedBlock: ({ blockAri }: DeleteSyncedBlockRequest) => Promise<void>;
|
|
125
130
|
export declare const updateSyncedBlock: ({ blockAri, content, stepVersion, }: UpdateSyncedBlockRequest) => Promise<void>;
|
|
126
131
|
export declare const createSyncedBlock: ({ blockAri, blockInstanceId, sourceAri, product, content, stepVersion, }: CreateSyncedBlockRequest) => Promise<BlockContentResponse>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from './clients/jira/ari
|
|
|
11
11
|
export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, } from './providers/block-service/blockServiceAPI';
|
|
12
12
|
export { fetchConfluencePageInfo } from './clients/confluence/sourceInfo';
|
|
13
13
|
export { SyncBlockProvider as SyncedBlockProvider, useMemoizedSyncedBlockProvider, } from './providers/syncBlockProvider';
|
|
14
|
-
export type { ADFFetchProvider, ADFWriteProvider, SyncBlockDataProvider, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
14
|
+
export type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, SyncBlockDataProvider, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
15
15
|
export { type ReferenceSyncBlockStoreManager } from './store-manager/referenceSyncBlockStoreManager';
|
|
16
16
|
export { SyncBlockStoreManager, useMemoizedSyncBlockStoreManager, } from './store-manager/syncBlockStoreManager';
|
|
17
17
|
export { resolveSyncBlockInstance } from './utils/resolveSyncBlockInstance';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BlockContentResponse } from '../../clients/block-service/blockService';
|
|
2
2
|
import { SyncBlockError, type ReferenceSyncBlockData, type ResourceId, type SyncBlockAttrs, type SyncBlockData, type SyncBlockProduct } from '../../common/types';
|
|
3
|
-
import type { ADFFetchProvider, ADFWriteProvider, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
3
|
+
import type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Extracts the ResourceId from a block ARI by returning the full path after synced-block/.
|
|
6
6
|
*
|
|
@@ -40,10 +40,10 @@ declare class BlockServiceADFFetchProvider implements ADFFetchProvider {
|
|
|
40
40
|
private extractResourceIdFromBlockAri;
|
|
41
41
|
/**
|
|
42
42
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
43
|
-
* @param
|
|
43
|
+
* @param blockNodeIdentifiers - Array of block node identifiers, containing block instance (local) ID + resource IDs to fetch
|
|
44
44
|
* @returns Array of SyncBlockInstance results
|
|
45
45
|
*/
|
|
46
|
-
batchFetchData(
|
|
46
|
+
batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[]): Promise<SyncBlockInstance[]>;
|
|
47
47
|
}
|
|
48
48
|
interface BlockServiceADFWriteProviderProps {
|
|
49
49
|
cloudId: string;
|
|
@@ -52,8 +52,12 @@ export type UpdateReferenceSyncBlockResult = {
|
|
|
52
52
|
error?: string;
|
|
53
53
|
success: boolean;
|
|
54
54
|
};
|
|
55
|
+
export type BlockNodeIdentifiers = {
|
|
56
|
+
blockInstanceId: string;
|
|
57
|
+
resourceId: string;
|
|
58
|
+
};
|
|
55
59
|
export interface ADFFetchProvider {
|
|
56
|
-
batchFetchData: (
|
|
60
|
+
batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
|
|
57
61
|
fetchData: (resourceId: ResourceId) => Promise<SyncBlockInstance>;
|
|
58
62
|
fetchReferences: (referenceResourceId: string) => Promise<ReferenceSyncBlockData>;
|
|
59
63
|
}
|
|
@@ -84,8 +88,8 @@ export type SyncedBlockRendererDataProviders = {
|
|
|
84
88
|
export type SyncBlockRendererProviderCreator = {
|
|
85
89
|
createEmojiProvider: ((options: MediaEmojiProviderOptions) => Promise<EmojiProvider> | undefined) | undefined;
|
|
86
90
|
createMediaProvider: ((options: MediaEmojiProviderOptions) => Promise<MediaProvider> | undefined) | undefined;
|
|
87
|
-
createSSRMediaProvider?: ((options: MediaEmojiProviderOptions) => MediaProvider | undefined) | undefined;
|
|
88
91
|
createSmartLinkProvider: (() => Promise<CardProvider>) | undefined;
|
|
92
|
+
createSSRMediaProvider?: ((options: MediaEmojiProviderOptions) => MediaProvider | undefined) | undefined;
|
|
89
93
|
};
|
|
90
94
|
export type SyncedBlockRendererProviderOptions = {
|
|
91
95
|
parentDataProviders?: SyncedBlockRendererDataProviders;
|
|
@@ -92,8 +92,13 @@ type UpdateReferenceSyncedBlockOnDocumentRequest = {
|
|
|
92
92
|
documentAri: string;
|
|
93
93
|
noContent?: boolean;
|
|
94
94
|
};
|
|
95
|
+
type BlockIdentifier = {
|
|
96
|
+
blockAri: string;
|
|
97
|
+
blockInstanceId: string;
|
|
98
|
+
};
|
|
95
99
|
export type BatchRetrieveSyncedBlocksRequest = {
|
|
96
|
-
|
|
100
|
+
blockIdentifiers: BlockIdentifier[];
|
|
101
|
+
documentAri: string;
|
|
97
102
|
};
|
|
98
103
|
export type BatchRetrieveSyncedBlocksResponse = {
|
|
99
104
|
error?: Array<ErrorResponse>;
|
|
@@ -111,7 +116,7 @@ export declare class BlockError extends Error {
|
|
|
111
116
|
readonly status: number;
|
|
112
117
|
constructor(status: number);
|
|
113
118
|
}
|
|
114
|
-
export declare const getSyncedBlockContent: ({ blockAri,
|
|
119
|
+
export declare const getSyncedBlockContent: ({ blockAri, }: GetSyncedBlockContentRequest) => Promise<BlockContentResponse>;
|
|
115
120
|
/**
|
|
116
121
|
* Batch retrieves multiple synced blocks by their ARIs.
|
|
117
122
|
*
|
|
@@ -120,7 +125,7 @@ export declare const getSyncedBlockContent: ({ blockAri, documentAri, }: GetSync
|
|
|
120
125
|
* @param blockAris - Array of block ARIs to retrieve
|
|
121
126
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
122
127
|
*/
|
|
123
|
-
export declare const batchRetrieveSyncedBlocks: ({
|
|
128
|
+
export declare const batchRetrieveSyncedBlocks: ({ blockIdentifiers, documentAri, }: BatchRetrieveSyncedBlocksRequest) => Promise<BatchRetrieveSyncedBlocksResponse>;
|
|
124
129
|
export declare const deleteSyncedBlock: ({ blockAri }: DeleteSyncedBlockRequest) => Promise<void>;
|
|
125
130
|
export declare const updateSyncedBlock: ({ blockAri, content, stepVersion, }: UpdateSyncedBlockRequest) => Promise<void>;
|
|
126
131
|
export declare const createSyncedBlock: ({ blockAri, blockInstanceId, sourceAri, product, content, stepVersion, }: CreateSyncedBlockRequest) => Promise<BlockContentResponse>;
|
|
@@ -11,7 +11,7 @@ export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from './clients/jira/ari
|
|
|
11
11
|
export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, } from './providers/block-service/blockServiceAPI';
|
|
12
12
|
export { fetchConfluencePageInfo } from './clients/confluence/sourceInfo';
|
|
13
13
|
export { SyncBlockProvider as SyncedBlockProvider, useMemoizedSyncedBlockProvider, } from './providers/syncBlockProvider';
|
|
14
|
-
export type { ADFFetchProvider, ADFWriteProvider, SyncBlockDataProvider, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
14
|
+
export type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, SyncBlockDataProvider, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
15
15
|
export { type ReferenceSyncBlockStoreManager } from './store-manager/referenceSyncBlockStoreManager';
|
|
16
16
|
export { SyncBlockStoreManager, useMemoizedSyncBlockStoreManager, } from './store-manager/syncBlockStoreManager';
|
|
17
17
|
export { resolveSyncBlockInstance } from './utils/resolveSyncBlockInstance';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BlockContentResponse } from '../../clients/block-service/blockService';
|
|
2
2
|
import { SyncBlockError, type ReferenceSyncBlockData, type ResourceId, type SyncBlockAttrs, type SyncBlockData, type SyncBlockProduct } from '../../common/types';
|
|
3
|
-
import type { ADFFetchProvider, ADFWriteProvider, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
3
|
+
import type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Extracts the ResourceId from a block ARI by returning the full path after synced-block/.
|
|
6
6
|
*
|
|
@@ -40,10 +40,10 @@ declare class BlockServiceADFFetchProvider implements ADFFetchProvider {
|
|
|
40
40
|
private extractResourceIdFromBlockAri;
|
|
41
41
|
/**
|
|
42
42
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
43
|
-
* @param
|
|
43
|
+
* @param blockNodeIdentifiers - Array of block node identifiers, containing block instance (local) ID + resource IDs to fetch
|
|
44
44
|
* @returns Array of SyncBlockInstance results
|
|
45
45
|
*/
|
|
46
|
-
batchFetchData(
|
|
46
|
+
batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[]): Promise<SyncBlockInstance[]>;
|
|
47
47
|
}
|
|
48
48
|
interface BlockServiceADFWriteProviderProps {
|
|
49
49
|
cloudId: string;
|
|
@@ -52,8 +52,12 @@ export type UpdateReferenceSyncBlockResult = {
|
|
|
52
52
|
error?: string;
|
|
53
53
|
success: boolean;
|
|
54
54
|
};
|
|
55
|
+
export type BlockNodeIdentifiers = {
|
|
56
|
+
blockInstanceId: string;
|
|
57
|
+
resourceId: string;
|
|
58
|
+
};
|
|
55
59
|
export interface ADFFetchProvider {
|
|
56
|
-
batchFetchData: (
|
|
60
|
+
batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
|
|
57
61
|
fetchData: (resourceId: ResourceId) => Promise<SyncBlockInstance>;
|
|
58
62
|
fetchReferences: (referenceResourceId: string) => Promise<ReferenceSyncBlockData>;
|
|
59
63
|
}
|
|
@@ -84,8 +88,8 @@ export type SyncedBlockRendererDataProviders = {
|
|
|
84
88
|
export type SyncBlockRendererProviderCreator = {
|
|
85
89
|
createEmojiProvider: ((options: MediaEmojiProviderOptions) => Promise<EmojiProvider> | undefined) | undefined;
|
|
86
90
|
createMediaProvider: ((options: MediaEmojiProviderOptions) => Promise<MediaProvider> | undefined) | undefined;
|
|
87
|
-
createSSRMediaProvider?: ((options: MediaEmojiProviderOptions) => MediaProvider | undefined) | undefined;
|
|
88
91
|
createSmartLinkProvider: (() => Promise<CardProvider>) | undefined;
|
|
92
|
+
createSSRMediaProvider?: ((options: MediaEmojiProviderOptions) => MediaProvider | undefined) | undefined;
|
|
89
93
|
};
|
|
90
94
|
export type SyncedBlockRendererProviderOptions = {
|
|
91
95
|
parentDataProviders?: SyncedBlockRendererDataProviders;
|
package/package.json
CHANGED