@atlaskit/editor-synced-block-provider 3.10.0 → 3.11.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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 3.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7b4cb91fc67a6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7b4cb91fc67a6) -
|
|
8
|
+
Do not immediately show error state on initial load of blocks
|
|
9
|
+
|
|
3
10
|
## 3.10.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -115,11 +115,21 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
115
115
|
case 10:
|
|
116
116
|
_context.prev = 10;
|
|
117
117
|
_context.t0 = _context["catch"](4);
|
|
118
|
-
return _context.abrupt("return", blockIdentifiers.map(function (blockIdentifier) {
|
|
119
|
-
return {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
return _context.abrupt("return", Promise.allSettled(blockIdentifiers.map(function (blockIdentifier) {
|
|
119
|
+
return _this2.fetchProvider.fetchData(blockIdentifier.resourceId).then(function (data) {
|
|
120
|
+
return data;
|
|
121
|
+
}, function () {
|
|
122
|
+
return {
|
|
123
|
+
error: _types.SyncBlockError.Errored,
|
|
124
|
+
resourceId: blockIdentifier.resourceId
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
})).then(function (results) {
|
|
128
|
+
return results.filter(function (result) {
|
|
129
|
+
return result.status === 'fulfilled';
|
|
130
|
+
}).map(function (result) {
|
|
131
|
+
return result.value;
|
|
132
|
+
});
|
|
123
133
|
}));
|
|
124
134
|
case 13:
|
|
125
135
|
_context.next = 16;
|
|
@@ -66,11 +66,22 @@ export class SyncBlockProvider extends SyncBlockDataProvider {
|
|
|
66
66
|
try {
|
|
67
67
|
return await this.fetchProvider.batchFetchData(blockIdentifiers);
|
|
68
68
|
} catch {
|
|
69
|
-
// If batch fetch fails,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
// If batch fetch fails, fall back to individual fetch behavior
|
|
70
|
+
// This allows loading states to be shown before errors, matching non-batch behavior
|
|
71
|
+
return Promise.allSettled(blockIdentifiers.map(blockIdentifier => {
|
|
72
|
+
return this.fetchProvider.fetchData(blockIdentifier.resourceId).then(data => {
|
|
73
|
+
return data;
|
|
74
|
+
}, () => {
|
|
75
|
+
return {
|
|
76
|
+
error: SyncBlockError.Errored,
|
|
77
|
+
resourceId: blockIdentifier.resourceId
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
})).then(results => {
|
|
81
|
+
return results.filter(result => {
|
|
82
|
+
return result.status === 'fulfilled';
|
|
83
|
+
}).map(result => result.value);
|
|
84
|
+
});
|
|
74
85
|
}
|
|
75
86
|
} else {
|
|
76
87
|
return Promise.allSettled(blockIdentifiers.map(blockIdentifier => {
|
|
@@ -108,11 +108,21 @@ export var SyncBlockProvider = /*#__PURE__*/function (_SyncBlockDataProvide) {
|
|
|
108
108
|
case 10:
|
|
109
109
|
_context.prev = 10;
|
|
110
110
|
_context.t0 = _context["catch"](4);
|
|
111
|
-
return _context.abrupt("return", blockIdentifiers.map(function (blockIdentifier) {
|
|
112
|
-
return {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
return _context.abrupt("return", Promise.allSettled(blockIdentifiers.map(function (blockIdentifier) {
|
|
112
|
+
return _this2.fetchProvider.fetchData(blockIdentifier.resourceId).then(function (data) {
|
|
113
|
+
return data;
|
|
114
|
+
}, function () {
|
|
115
|
+
return {
|
|
116
|
+
error: SyncBlockError.Errored,
|
|
117
|
+
resourceId: blockIdentifier.resourceId
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
})).then(function (results) {
|
|
121
|
+
return results.filter(function (result) {
|
|
122
|
+
return result.status === 'fulfilled';
|
|
123
|
+
}).map(function (result) {
|
|
124
|
+
return result.value;
|
|
125
|
+
});
|
|
116
126
|
}));
|
|
117
127
|
case 13:
|
|
118
128
|
_context.next = 16;
|
package/package.json
CHANGED