@atlaskit/editor-synced-block-provider 5.0.0 → 6.1.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 +18 -0
- package/dist/cjs/common/types.js +2 -0
- package/dist/cjs/providers/block-service/blockServiceAPI.js +3 -9
- package/dist/es2019/common/types.js +2 -0
- package/dist/es2019/providers/block-service/blockServiceAPI.js +3 -9
- package/dist/esm/common/types.js +2 -0
- package/dist/esm/providers/block-service/blockServiceAPI.js +3 -9
- package/dist/types/common/types.d.ts +2 -1
- package/dist/types-ts4.5/common/types.d.ts +2 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 6.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`fe5309f20a834`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe5309f20a834) -
|
|
8
|
+
Map EntityNotFound error code to dedicated SyncBlockError.EntityNotFound enum value and add a
|
|
9
|
+
specific error screen for synced blocks not available on the current site
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 6.0.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 5.0.0
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/common/types.js
CHANGED
|
@@ -19,5 +19,7 @@ var SyncBlockError = exports.SyncBlockError = /*#__PURE__*/function (SyncBlockEr
|
|
|
19
19
|
SyncBlockError["Unpublished"] = "unpublished";
|
|
20
20
|
// request was aborted, typically due to client timeout
|
|
21
21
|
SyncBlockError["Aborted"] = "aborted";
|
|
22
|
+
// block does not exist on this site (e.g. cross-site reference or hard deleted)
|
|
23
|
+
SyncBlockError["EntityNotFound"] = "entity_not_found";
|
|
22
24
|
return SyncBlockError;
|
|
23
25
|
}({});
|
|
@@ -51,9 +51,10 @@ var mapErrorResponseCode = function mapErrorResponseCode(errorCode) {
|
|
|
51
51
|
case 'FORBIDDEN':
|
|
52
52
|
return _types.SyncBlockError.Forbidden;
|
|
53
53
|
case 'RESOURCE_NOT_FOUND':
|
|
54
|
-
return (0, _platformFeatureFlags.fg)('block_service_source_repair') ? _types.SyncBlockError.NotFound : _types.SyncBlockError.Errored;
|
|
55
54
|
case 'NOT_FOUND':
|
|
56
55
|
return _types.SyncBlockError.NotFound;
|
|
56
|
+
case 'EntityNotFound':
|
|
57
|
+
return (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') ? _types.SyncBlockError.EntityNotFound : _types.SyncBlockError.Errored;
|
|
57
58
|
case 'INVALID_REQUEST':
|
|
58
59
|
return _types.SyncBlockError.InvalidRequest;
|
|
59
60
|
case 'CONFLICT':
|
|
@@ -1358,14 +1359,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1358
1359
|
block = _step7.value;
|
|
1359
1360
|
error = errorResourceIds.get(block.resourceId);
|
|
1360
1361
|
if (error) {
|
|
1361
|
-
if (
|
|
1362
|
-
if (error !== _types.SyncBlockError.NotFound) {
|
|
1363
|
-
results.push({
|
|
1364
|
-
error: error,
|
|
1365
|
-
resourceId: block.resourceId
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
} else {
|
|
1362
|
+
if (error !== _types.SyncBlockError.NotFound) {
|
|
1369
1363
|
results.push({
|
|
1370
1364
|
error: error,
|
|
1371
1365
|
resourceId: block.resourceId
|
|
@@ -13,5 +13,7 @@ export let SyncBlockError = /*#__PURE__*/function (SyncBlockError) {
|
|
|
13
13
|
SyncBlockError["Unpublished"] = "unpublished";
|
|
14
14
|
// request was aborted, typically due to client timeout
|
|
15
15
|
SyncBlockError["Aborted"] = "aborted";
|
|
16
|
+
// block does not exist on this site (e.g. cross-site reference or hard deleted)
|
|
17
|
+
SyncBlockError["EntityNotFound"] = "entity_not_found";
|
|
16
18
|
return SyncBlockError;
|
|
17
19
|
}({});
|
|
@@ -34,9 +34,10 @@ const mapErrorResponseCode = errorCode => {
|
|
|
34
34
|
case 'FORBIDDEN':
|
|
35
35
|
return SyncBlockError.Forbidden;
|
|
36
36
|
case 'RESOURCE_NOT_FOUND':
|
|
37
|
-
return fg('block_service_source_repair') ? SyncBlockError.NotFound : SyncBlockError.Errored;
|
|
38
37
|
case 'NOT_FOUND':
|
|
39
38
|
return SyncBlockError.NotFound;
|
|
39
|
+
case 'EntityNotFound':
|
|
40
|
+
return fg('platform_synced_block_patch_9') ? SyncBlockError.EntityNotFound : SyncBlockError.Errored;
|
|
40
41
|
case 'INVALID_REQUEST':
|
|
41
42
|
return SyncBlockError.InvalidRequest;
|
|
42
43
|
case 'CONFLICT':
|
|
@@ -876,14 +877,7 @@ class BlockServiceADFWriteProvider {
|
|
|
876
877
|
for (const block of data) {
|
|
877
878
|
const error = errorResourceIds.get(block.resourceId);
|
|
878
879
|
if (error) {
|
|
879
|
-
if (
|
|
880
|
-
if (error !== SyncBlockError.NotFound) {
|
|
881
|
-
results.push({
|
|
882
|
-
error,
|
|
883
|
-
resourceId: block.resourceId
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
} else {
|
|
880
|
+
if (error !== SyncBlockError.NotFound) {
|
|
887
881
|
results.push({
|
|
888
882
|
error,
|
|
889
883
|
resourceId: block.resourceId
|
package/dist/esm/common/types.js
CHANGED
|
@@ -13,5 +13,7 @@ export var SyncBlockError = /*#__PURE__*/function (SyncBlockError) {
|
|
|
13
13
|
SyncBlockError["Unpublished"] = "unpublished";
|
|
14
14
|
// request was aborted, typically due to client timeout
|
|
15
15
|
SyncBlockError["Aborted"] = "aborted";
|
|
16
|
+
// block does not exist on this site (e.g. cross-site reference or hard deleted)
|
|
17
|
+
SyncBlockError["EntityNotFound"] = "entity_not_found";
|
|
16
18
|
return SyncBlockError;
|
|
17
19
|
}({});
|
|
@@ -45,9 +45,10 @@ var mapErrorResponseCode = function mapErrorResponseCode(errorCode) {
|
|
|
45
45
|
case 'FORBIDDEN':
|
|
46
46
|
return SyncBlockError.Forbidden;
|
|
47
47
|
case 'RESOURCE_NOT_FOUND':
|
|
48
|
-
return fg('block_service_source_repair') ? SyncBlockError.NotFound : SyncBlockError.Errored;
|
|
49
48
|
case 'NOT_FOUND':
|
|
50
49
|
return SyncBlockError.NotFound;
|
|
50
|
+
case 'EntityNotFound':
|
|
51
|
+
return fg('platform_synced_block_patch_9') ? SyncBlockError.EntityNotFound : SyncBlockError.Errored;
|
|
51
52
|
case 'INVALID_REQUEST':
|
|
52
53
|
return SyncBlockError.InvalidRequest;
|
|
53
54
|
case 'CONFLICT':
|
|
@@ -1353,14 +1354,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1353
1354
|
block = _step7.value;
|
|
1354
1355
|
error = errorResourceIds.get(block.resourceId);
|
|
1355
1356
|
if (error) {
|
|
1356
|
-
if (
|
|
1357
|
-
if (error !== SyncBlockError.NotFound) {
|
|
1358
|
-
results.push({
|
|
1359
|
-
error: error,
|
|
1360
|
-
resourceId: block.resourceId
|
|
1361
|
-
});
|
|
1362
|
-
}
|
|
1363
|
-
} else {
|
|
1357
|
+
if (error !== SyncBlockError.NotFound) {
|
|
1364
1358
|
results.push({
|
|
1365
1359
|
error: error,
|
|
1366
1360
|
resourceId: block.resourceId
|
|
@@ -26,7 +26,8 @@ export declare enum SyncBlockError {
|
|
|
26
26
|
InvalidContent = "invalid_content",// content is not a valid JSON
|
|
27
27
|
Offline = "offline",
|
|
28
28
|
Unpublished = "unpublished",
|
|
29
|
-
Aborted = "aborted"
|
|
29
|
+
Aborted = "aborted",
|
|
30
|
+
EntityNotFound = "entity_not_found"
|
|
30
31
|
}
|
|
31
32
|
export interface SyncBlockData {
|
|
32
33
|
blockInstanceId: BlockInstanceId;
|
|
@@ -26,7 +26,8 @@ export declare enum SyncBlockError {
|
|
|
26
26
|
InvalidContent = "invalid_content",// content is not a valid JSON
|
|
27
27
|
Offline = "offline",
|
|
28
28
|
Unpublished = "unpublished",
|
|
29
|
-
Aborted = "aborted"
|
|
29
|
+
Aborted = "aborted",
|
|
30
|
+
EntityNotFound = "entity_not_found"
|
|
30
31
|
}
|
|
31
32
|
export interface SyncBlockData {
|
|
32
33
|
blockInstanceId: BlockInstanceId;
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@atlaskit/adf-utils": "^19.27.0",
|
|
28
28
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
29
29
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
30
|
-
"@atlaskit/node-data-provider": "^
|
|
30
|
+
"@atlaskit/node-data-provider": "^11.0.0",
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
32
32
|
"@atlaskit/tmp-editor-statsig": "^62.4.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"uuid": "^3.1.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@atlaskit/editor-common": "^
|
|
41
|
+
"@atlaskit/editor-common": "^114.1.0",
|
|
42
42
|
"react": "^18.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"name": "@atlaskit/editor-synced-block-provider",
|
|
84
|
-
"version": "
|
|
84
|
+
"version": "6.1.0",
|
|
85
85
|
"description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
|
|
86
86
|
"author": "Atlassian Pty Ltd",
|
|
87
87
|
"license": "Apache-2.0",
|
|
@@ -89,15 +89,15 @@
|
|
|
89
89
|
"registry": "https://registry.npmjs.org/"
|
|
90
90
|
},
|
|
91
91
|
"platform-feature-flags": {
|
|
92
|
-
"block_service_source_repair": {
|
|
93
|
-
"type": "boolean"
|
|
94
|
-
},
|
|
95
92
|
"platform_synced_block_update_refactor": {
|
|
96
93
|
"type": "boolean"
|
|
97
94
|
},
|
|
98
95
|
"platform_synced_block_patch_8": {
|
|
99
96
|
"type": "boolean"
|
|
100
97
|
},
|
|
98
|
+
"platform_synced_block_patch_9": {
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
},
|
|
101
101
|
"platform_synced_block_add_info_web_socket_error": {
|
|
102
102
|
"type": "boolean"
|
|
103
103
|
}
|