@atlaskit/editor-synced-block-provider 4.1.6 → 4.2.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 +19 -0
- package/dist/cjs/providers/block-service/blockServiceAPI.js +16 -6
- package/dist/cjs/store-manager/sourceSyncBlockStoreManager.js +21 -2
- package/dist/es2019/providers/block-service/blockServiceAPI.js +16 -6
- package/dist/es2019/store-manager/sourceSyncBlockStoreManager.js +16 -0
- package/dist/esm/providers/block-service/blockServiceAPI.js +16 -6
- package/dist/esm/store-manager/sourceSyncBlockStoreManager.js +21 -2
- package/dist/types/store-manager/sourceSyncBlockStoreManager.d.ts +7 -0
- package/dist/types-ts4.5/store-manager/sourceSyncBlockStoreManager.d.ts +7 -0
- package/package.json +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a9d6a5531d4ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a9d6a5531d4ba) -
|
|
8
|
+
[ux] Ensures hasUnsavedBodiedSyncBlockChanges state is updated when page is being published.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 4.1.7
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`612d18a57aabd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/612d18a57aabd) -
|
|
19
|
+
404s on updating a source synced block should be ignored
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 4.1.6
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
14
|
var _react = require("react");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
17
|
var _ari = require("../../clients/block-service/ari");
|
|
17
18
|
var _blockService = require("../../clients/block-service/blockService");
|
|
@@ -49,6 +50,8 @@ var mapErrorResponseCode = function mapErrorResponseCode(errorCode) {
|
|
|
49
50
|
switch (errorCode) {
|
|
50
51
|
case 'FORBIDDEN':
|
|
51
52
|
return _types.SyncBlockError.Forbidden;
|
|
53
|
+
case 'RESOURCE_NOT_FOUND':
|
|
54
|
+
return (0, _platformFeatureFlags.fg)('block_service_source_repair') ? _types.SyncBlockError.NotFound : _types.SyncBlockError.Errored;
|
|
52
55
|
case 'NOT_FOUND':
|
|
53
56
|
return _types.SyncBlockError.NotFound;
|
|
54
57
|
case 'INVALID_REQUEST':
|
|
@@ -832,8 +835,6 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
832
835
|
this.product = product;
|
|
833
836
|
this.getVersion = getVersion;
|
|
834
837
|
}
|
|
835
|
-
|
|
836
|
-
// it will first try to update and if it can't (404) then it will try to create
|
|
837
838
|
return (0, _createClass2.default)(BlockServiceADFWriteProvider, [{
|
|
838
839
|
key: "writeData",
|
|
839
840
|
value: function () {
|
|
@@ -1241,10 +1242,19 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1241
1242
|
block = _step7.value;
|
|
1242
1243
|
error = errorResourceIds.get(block.resourceId);
|
|
1243
1244
|
if (error) {
|
|
1244
|
-
|
|
1245
|
-
error
|
|
1246
|
-
|
|
1247
|
-
|
|
1245
|
+
if ((0, _platformFeatureFlags.fg)('block_service_source_repair')) {
|
|
1246
|
+
if (error !== _types.SyncBlockError.NotFound) {
|
|
1247
|
+
results.push({
|
|
1248
|
+
error: error,
|
|
1249
|
+
resourceId: block.resourceId
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
} else {
|
|
1253
|
+
results.push({
|
|
1254
|
+
error: error,
|
|
1255
|
+
resourceId: block.resourceId
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1248
1258
|
} else if (!results.some(function (r) {
|
|
1249
1259
|
return r.resourceId === block.resourceId;
|
|
1250
1260
|
})) {
|
|
@@ -12,6 +12,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
14
14
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
17
|
var _types = require("../common/types");
|
|
17
18
|
var _errorHandling = require("../utils/errorHandling");
|
|
@@ -39,7 +40,18 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
|
|
|
39
40
|
this.syncBlockCache = new Map();
|
|
40
41
|
this.creationCompletionCallbacks = new Map();
|
|
41
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Register a callback to be invoked after flush() completes.
|
|
46
|
+
* Used by the pm-plugin to dispatch a transaction so that
|
|
47
|
+
* hasUnsavedBodiedSyncBlockChanges is recalculated in plugin state.
|
|
48
|
+
*/
|
|
42
49
|
return (0, _createClass2.default)(SourceSyncBlockStoreManager, [{
|
|
50
|
+
key: "registerFlushCompletionCallback",
|
|
51
|
+
value: function registerFlushCompletionCallback(callback) {
|
|
52
|
+
this.flushCompletionCallback = callback;
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
43
55
|
key: "setFireAnalyticsEvent",
|
|
44
56
|
value: function setFireAnalyticsEvent(fireAnalyticsEvent) {
|
|
45
57
|
this.fireAnalyticsEvent = fireAnalyticsEvent;
|
|
@@ -100,7 +112,7 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
|
|
|
100
112
|
value: (function () {
|
|
101
113
|
var _flush = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
102
114
|
var _this2 = this;
|
|
103
|
-
var _this$saveExperience, bodiedSyncBlockNodes, bodiedSyncBlockData, writeResults, _this$saveExperience2, _this$saveExperience3, _this$fireAnalyticsEv2;
|
|
115
|
+
var _this$saveExperience, bodiedSyncBlockNodes, bodiedSyncBlockData, writeResults, _this$saveExperience2, _this$saveExperience3, _this$fireAnalyticsEv2, _this$flushCompletion;
|
|
104
116
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
105
117
|
while (1) switch (_context.prev = _context.next) {
|
|
106
118
|
case 0:
|
|
@@ -194,10 +206,16 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
|
|
|
194
206
|
(_this$fireAnalyticsEv2 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv2 === void 0 || _this$fireAnalyticsEv2.call(this, (0, _errorHandling.updateErrorPayload)(_context.t0.message));
|
|
195
207
|
return _context.abrupt("return", false);
|
|
196
208
|
case 29:
|
|
209
|
+
_context.prev = 29;
|
|
210
|
+
if ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_7')) {
|
|
211
|
+
(_this$flushCompletion = this.flushCompletionCallback) === null || _this$flushCompletion === void 0 || _this$flushCompletion.call(this);
|
|
212
|
+
}
|
|
213
|
+
return _context.finish(29);
|
|
214
|
+
case 32:
|
|
197
215
|
case "end":
|
|
198
216
|
return _context.stop();
|
|
199
217
|
}
|
|
200
|
-
}, _callee, this, [[0, 24]]);
|
|
218
|
+
}, _callee, this, [[0, 24, 29, 32]]);
|
|
201
219
|
}));
|
|
202
220
|
function flush() {
|
|
203
221
|
return _flush.apply(this, arguments);
|
|
@@ -581,6 +599,7 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
|
|
|
581
599
|
this.syncBlockCache.clear();
|
|
582
600
|
this.confirmationCallback = undefined;
|
|
583
601
|
this.creationCompletionCallbacks.clear();
|
|
602
|
+
this.flushCompletionCallback = undefined;
|
|
584
603
|
this.dataProvider = undefined;
|
|
585
604
|
(_this$saveExperience4 = this.saveExperience) === null || _this$saveExperience4 === void 0 || _this$saveExperience4.abort({
|
|
586
605
|
reason: 'editorDestroyed'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable require-unicode-regexp */
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
import { generateBlockAri, generateBlockAriFromReference } from '../../clients/block-service/ari';
|
|
5
6
|
import { batchRetrieveSyncedBlocks, BlockError, BlockTimeoutError, createSyncedBlock, deleteSyncedBlock, getReferenceSyncedBlocks, getReferenceSyncedBlocksByBlockAri, getSyncedBlockContent, updateReferenceSyncedBlockOnDocument, updateSyncedBlock, updateSyncedBlocks } from '../../clients/block-service/blockService';
|
|
@@ -32,6 +33,8 @@ const mapErrorResponseCode = errorCode => {
|
|
|
32
33
|
switch (errorCode) {
|
|
33
34
|
case 'FORBIDDEN':
|
|
34
35
|
return SyncBlockError.Forbidden;
|
|
36
|
+
case 'RESOURCE_NOT_FOUND':
|
|
37
|
+
return fg('block_service_source_repair') ? SyncBlockError.NotFound : SyncBlockError.Errored;
|
|
35
38
|
case 'NOT_FOUND':
|
|
36
39
|
return SyncBlockError.NotFound;
|
|
37
40
|
case 'INVALID_REQUEST':
|
|
@@ -573,8 +576,6 @@ class BlockServiceADFWriteProvider {
|
|
|
573
576
|
this.product = product;
|
|
574
577
|
this.getVersion = getVersion;
|
|
575
578
|
}
|
|
576
|
-
|
|
577
|
-
// it will first try to update and if it can't (404) then it will try to create
|
|
578
579
|
async writeData(data) {
|
|
579
580
|
if (!this.parentAri || !this.parentId) {
|
|
580
581
|
return {
|
|
@@ -802,10 +803,19 @@ class BlockServiceADFWriteProvider {
|
|
|
802
803
|
for (const block of data) {
|
|
803
804
|
const error = errorResourceIds.get(block.resourceId);
|
|
804
805
|
if (error) {
|
|
805
|
-
|
|
806
|
-
error
|
|
807
|
-
|
|
808
|
-
|
|
806
|
+
if (fg('block_service_source_repair')) {
|
|
807
|
+
if (error !== SyncBlockError.NotFound) {
|
|
808
|
+
results.push({
|
|
809
|
+
error,
|
|
810
|
+
resourceId: block.resourceId
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
} else {
|
|
814
|
+
results.push({
|
|
815
|
+
error,
|
|
816
|
+
resourceId: block.resourceId
|
|
817
|
+
});
|
|
818
|
+
}
|
|
809
819
|
} else if (!results.some(r => r.resourceId === block.resourceId)) {
|
|
810
820
|
// If not in success or error lists, mark as errored
|
|
811
821
|
results.push({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import isEqual from 'lodash/isEqual';
|
|
3
3
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
6
|
import { SyncBlockError } from '../common/types';
|
|
6
7
|
import { updateErrorPayload, createErrorPayload, deleteErrorPayload, updateCacheErrorPayload, getSourceInfoErrorPayload, updateSuccessPayload, createSuccessPayload, deleteSuccessPayload, fetchReferencesErrorPayload } from '../utils/errorHandling';
|
|
@@ -24,6 +25,15 @@ export class SourceSyncBlockStoreManager {
|
|
|
24
25
|
this.syncBlockCache = new Map();
|
|
25
26
|
this.creationCompletionCallbacks = new Map();
|
|
26
27
|
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Register a callback to be invoked after flush() completes.
|
|
31
|
+
* Used by the pm-plugin to dispatch a transaction so that
|
|
32
|
+
* hasUnsavedBodiedSyncBlockChanges is recalculated in plugin state.
|
|
33
|
+
*/
|
|
34
|
+
registerFlushCompletionCallback(callback) {
|
|
35
|
+
this.flushCompletionCallback = callback;
|
|
36
|
+
}
|
|
27
37
|
setFireAnalyticsEvent(fireAnalyticsEvent) {
|
|
28
38
|
this.fireAnalyticsEvent = fireAnalyticsEvent;
|
|
29
39
|
this.createExperience = getCreateSourceExperience(fireAnalyticsEvent);
|
|
@@ -151,6 +161,11 @@ export class SourceSyncBlockStoreManager {
|
|
|
151
161
|
});
|
|
152
162
|
(_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 ? void 0 : _this$fireAnalyticsEv4.call(this, updateErrorPayload(error.message));
|
|
153
163
|
return false;
|
|
164
|
+
} finally {
|
|
165
|
+
if (fg('platform_synced_block_patch_7')) {
|
|
166
|
+
var _this$flushCompletion;
|
|
167
|
+
(_this$flushCompletion = this.flushCompletionCallback) === null || _this$flushCompletion === void 0 ? void 0 : _this$flushCompletion.call(this);
|
|
168
|
+
}
|
|
154
169
|
}
|
|
155
170
|
}
|
|
156
171
|
hasUnsavedChanges() {
|
|
@@ -430,6 +445,7 @@ export class SourceSyncBlockStoreManager {
|
|
|
430
445
|
this.syncBlockCache.clear();
|
|
431
446
|
this.confirmationCallback = undefined;
|
|
432
447
|
this.creationCompletionCallbacks.clear();
|
|
448
|
+
this.flushCompletionCallback = undefined;
|
|
433
449
|
this.dataProvider = undefined;
|
|
434
450
|
(_this$saveExperience4 = this.saveExperience) === null || _this$saveExperience4 === void 0 ? void 0 : _this$saveExperience4.abort({
|
|
435
451
|
reason: 'editorDestroyed'
|
|
@@ -11,6 +11,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
11
11
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
12
|
/* eslint-disable require-unicode-regexp */
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
16
|
import { generateBlockAri as _generateBlockAri, generateBlockAriFromReference } from '../../clients/block-service/ari';
|
|
16
17
|
import { batchRetrieveSyncedBlocks, BlockError, BlockTimeoutError, createSyncedBlock, deleteSyncedBlock, getReferenceSyncedBlocks, getReferenceSyncedBlocksByBlockAri, getSyncedBlockContent, updateReferenceSyncedBlockOnDocument, updateSyncedBlock, updateSyncedBlocks } from '../../clients/block-service/blockService';
|
|
@@ -43,6 +44,8 @@ var mapErrorResponseCode = function mapErrorResponseCode(errorCode) {
|
|
|
43
44
|
switch (errorCode) {
|
|
44
45
|
case 'FORBIDDEN':
|
|
45
46
|
return SyncBlockError.Forbidden;
|
|
47
|
+
case 'RESOURCE_NOT_FOUND':
|
|
48
|
+
return fg('block_service_source_repair') ? SyncBlockError.NotFound : SyncBlockError.Errored;
|
|
46
49
|
case 'NOT_FOUND':
|
|
47
50
|
return SyncBlockError.NotFound;
|
|
48
51
|
case 'INVALID_REQUEST':
|
|
@@ -827,8 +830,6 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
827
830
|
this.product = product;
|
|
828
831
|
this.getVersion = getVersion;
|
|
829
832
|
}
|
|
830
|
-
|
|
831
|
-
// it will first try to update and if it can't (404) then it will try to create
|
|
832
833
|
return _createClass(BlockServiceADFWriteProvider, [{
|
|
833
834
|
key: "writeData",
|
|
834
835
|
value: function () {
|
|
@@ -1236,10 +1237,19 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1236
1237
|
block = _step7.value;
|
|
1237
1238
|
error = errorResourceIds.get(block.resourceId);
|
|
1238
1239
|
if (error) {
|
|
1239
|
-
|
|
1240
|
-
error
|
|
1241
|
-
|
|
1242
|
-
|
|
1240
|
+
if (fg('block_service_source_repair')) {
|
|
1241
|
+
if (error !== SyncBlockError.NotFound) {
|
|
1242
|
+
results.push({
|
|
1243
|
+
error: error,
|
|
1244
|
+
resourceId: block.resourceId
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
} else {
|
|
1248
|
+
results.push({
|
|
1249
|
+
error: error,
|
|
1250
|
+
resourceId: block.resourceId
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1243
1253
|
} else if (!results.some(function (r) {
|
|
1244
1254
|
return r.resourceId === block.resourceId;
|
|
1245
1255
|
})) {
|
|
@@ -7,6 +7,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import isEqual from 'lodash/isEqual';
|
|
9
9
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
12
|
import { SyncBlockError } from '../common/types';
|
|
12
13
|
import { updateErrorPayload, createErrorPayload, deleteErrorPayload, updateCacheErrorPayload, getSourceInfoErrorPayload, updateSuccessPayload, createSuccessPayload, deleteSuccessPayload, fetchReferencesErrorPayload } from '../utils/errorHandling';
|
|
@@ -32,7 +33,18 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
32
33
|
this.syncBlockCache = new Map();
|
|
33
34
|
this.creationCompletionCallbacks = new Map();
|
|
34
35
|
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Register a callback to be invoked after flush() completes.
|
|
39
|
+
* Used by the pm-plugin to dispatch a transaction so that
|
|
40
|
+
* hasUnsavedBodiedSyncBlockChanges is recalculated in plugin state.
|
|
41
|
+
*/
|
|
35
42
|
return _createClass(SourceSyncBlockStoreManager, [{
|
|
43
|
+
key: "registerFlushCompletionCallback",
|
|
44
|
+
value: function registerFlushCompletionCallback(callback) {
|
|
45
|
+
this.flushCompletionCallback = callback;
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
36
48
|
key: "setFireAnalyticsEvent",
|
|
37
49
|
value: function setFireAnalyticsEvent(fireAnalyticsEvent) {
|
|
38
50
|
this.fireAnalyticsEvent = fireAnalyticsEvent;
|
|
@@ -93,7 +105,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
93
105
|
value: (function () {
|
|
94
106
|
var _flush = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
95
107
|
var _this2 = this;
|
|
96
|
-
var _this$saveExperience, bodiedSyncBlockNodes, bodiedSyncBlockData, writeResults, _this$saveExperience2, _this$saveExperience3, _this$fireAnalyticsEv2;
|
|
108
|
+
var _this$saveExperience, bodiedSyncBlockNodes, bodiedSyncBlockData, writeResults, _this$saveExperience2, _this$saveExperience3, _this$fireAnalyticsEv2, _this$flushCompletion;
|
|
97
109
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
98
110
|
while (1) switch (_context.prev = _context.next) {
|
|
99
111
|
case 0:
|
|
@@ -187,10 +199,16 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
187
199
|
(_this$fireAnalyticsEv2 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv2 === void 0 || _this$fireAnalyticsEv2.call(this, updateErrorPayload(_context.t0.message));
|
|
188
200
|
return _context.abrupt("return", false);
|
|
189
201
|
case 29:
|
|
202
|
+
_context.prev = 29;
|
|
203
|
+
if (fg('platform_synced_block_patch_7')) {
|
|
204
|
+
(_this$flushCompletion = this.flushCompletionCallback) === null || _this$flushCompletion === void 0 || _this$flushCompletion.call(this);
|
|
205
|
+
}
|
|
206
|
+
return _context.finish(29);
|
|
207
|
+
case 32:
|
|
190
208
|
case "end":
|
|
191
209
|
return _context.stop();
|
|
192
210
|
}
|
|
193
|
-
}, _callee, this, [[0, 24]]);
|
|
211
|
+
}, _callee, this, [[0, 24, 29, 32]]);
|
|
194
212
|
}));
|
|
195
213
|
function flush() {
|
|
196
214
|
return _flush.apply(this, arguments);
|
|
@@ -574,6 +592,7 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
|
|
|
574
592
|
this.syncBlockCache.clear();
|
|
575
593
|
this.confirmationCallback = undefined;
|
|
576
594
|
this.creationCompletionCallbacks.clear();
|
|
595
|
+
this.flushCompletionCallback = undefined;
|
|
577
596
|
this.dataProvider = undefined;
|
|
578
597
|
(_this$saveExperience4 = this.saveExperience) === null || _this$saveExperience4 === void 0 || _this$saveExperience4.abort({
|
|
579
598
|
reason: 'editorDestroyed'
|
|
@@ -14,11 +14,18 @@ export declare class SourceSyncBlockStoreManager {
|
|
|
14
14
|
private confirmationCallback?;
|
|
15
15
|
private deletionRetryInfo?;
|
|
16
16
|
private creationCompletionCallbacks;
|
|
17
|
+
private flushCompletionCallback?;
|
|
17
18
|
private createExperience;
|
|
18
19
|
private saveExperience;
|
|
19
20
|
private deleteExperience;
|
|
20
21
|
private fetchSourceInfoExperience;
|
|
21
22
|
constructor(dataProvider?: SyncBlockDataProviderInterface);
|
|
23
|
+
/**
|
|
24
|
+
* Register a callback to be invoked after flush() completes.
|
|
25
|
+
* Used by the pm-plugin to dispatch a transaction so that
|
|
26
|
+
* hasUnsavedBodiedSyncBlockChanges is recalculated in plugin state.
|
|
27
|
+
*/
|
|
28
|
+
registerFlushCompletionCallback(callback: () => void): void;
|
|
22
29
|
setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void): void;
|
|
23
30
|
isSourceBlock(node: PMNode): boolean;
|
|
24
31
|
/**
|
|
@@ -14,11 +14,18 @@ export declare class SourceSyncBlockStoreManager {
|
|
|
14
14
|
private confirmationCallback?;
|
|
15
15
|
private deletionRetryInfo?;
|
|
16
16
|
private creationCompletionCallbacks;
|
|
17
|
+
private flushCompletionCallback?;
|
|
17
18
|
private createExperience;
|
|
18
19
|
private saveExperience;
|
|
19
20
|
private deleteExperience;
|
|
20
21
|
private fetchSourceInfoExperience;
|
|
21
22
|
constructor(dataProvider?: SyncBlockDataProviderInterface);
|
|
23
|
+
/**
|
|
24
|
+
* Register a callback to be invoked after flush() completes.
|
|
25
|
+
* Used by the pm-plugin to dispatch a transaction so that
|
|
26
|
+
* hasUnsavedBodiedSyncBlockChanges is recalculated in plugin state.
|
|
27
|
+
*/
|
|
28
|
+
registerFlushCompletionCallback(callback: () => void): void;
|
|
22
29
|
setFireAnalyticsEvent(fireAnalyticsEvent?: (payload: SyncBlockEventPayload) => void): void;
|
|
23
30
|
isSourceBlock(node: PMNode): boolean;
|
|
24
31
|
/**
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
30
30
|
"@atlaskit/node-data-provider": "^9.0.0",
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^45.
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^45.1.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0",
|
|
34
34
|
"@compiled/react": "^0.20.0",
|
|
35
35
|
"graphql-ws": "^5.14.2",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"uuid": "^3.1.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@atlaskit/editor-common": "^112.
|
|
41
|
+
"@atlaskit/editor-common": "^112.9.0",
|
|
42
42
|
"react": "^18.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -81,12 +81,19 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"name": "@atlaskit/editor-synced-block-provider",
|
|
84
|
-
"version": "4.
|
|
84
|
+
"version": "4.2.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",
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"registry": "https://registry.npmjs.org/"
|
|
90
90
|
},
|
|
91
|
-
"platform-feature-flags": {
|
|
91
|
+
"platform-feature-flags": {
|
|
92
|
+
"block_service_source_repair": {
|
|
93
|
+
"type": "boolean"
|
|
94
|
+
},
|
|
95
|
+
"platform_synced_block_patch_7": {
|
|
96
|
+
"type": "boolean"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
92
99
|
}
|