@atlaskit/editor-plugin-synced-block 4.4.0 → 4.5.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 +22 -0
- package/afm-cc/tsconfig.json +2 -1
- package/afm-jira/tsconfig.json +2 -1
- package/afm-products/tsconfig.json +2 -1
- package/dist/cjs/nodeviews/syncedBlock.js +2 -1
- package/dist/cjs/pm-plugins/main.js +57 -36
- package/dist/cjs/pm-plugins/utils/handle-bodied-sync-block-removal.js +87 -0
- package/dist/cjs/syncedBlockPlugin.js +6 -4
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/ui/DeleteConfirmationModal.js +53 -12
- package/dist/cjs/ui/Flag.js +44 -17
- package/dist/cjs/ui/SyncBlockRendererWrapper.js +4 -2
- package/dist/es2019/nodeviews/syncedBlock.js +2 -1
- package/dist/es2019/pm-plugins/main.js +56 -33
- package/dist/es2019/pm-plugins/utils/handle-bodied-sync-block-removal.js +74 -0
- package/dist/es2019/syncedBlockPlugin.js +6 -4
- package/dist/es2019/types/index.js +1 -0
- package/dist/es2019/ui/DeleteConfirmationModal.js +56 -12
- package/dist/es2019/ui/Flag.js +43 -13
- package/dist/es2019/ui/SyncBlockRendererWrapper.js +4 -2
- package/dist/esm/nodeviews/syncedBlock.js +2 -1
- package/dist/esm/pm-plugins/main.js +57 -37
- package/dist/esm/pm-plugins/utils/handle-bodied-sync-block-removal.js +80 -0
- package/dist/esm/syncedBlockPlugin.js +6 -4
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/ui/DeleteConfirmationModal.js +53 -12
- package/dist/esm/ui/Flag.js +44 -17
- package/dist/esm/ui/SyncBlockRendererWrapper.js +4 -2
- package/dist/types/pm-plugins/main.d.ts +3 -2
- package/dist/types/pm-plugins/utils/handle-bodied-sync-block-removal.d.ts +9 -0
- package/dist/types/pm-plugins/utils/track-sync-blocks.d.ts +2 -11
- package/dist/types/syncedBlockPluginType.d.ts +2 -5
- package/dist/types/types/index.d.ts +28 -2
- package/dist/types/ui/CreateSyncedBlockButton.d.ts +1 -1
- package/dist/types/ui/OverflowMenuSection.d.ts +1 -1
- package/dist/types/ui/SyncBlockRendererWrapper.d.ts +5 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/utils/handle-bodied-sync-block-removal.d.ts +9 -0
- package/dist/types-ts4.5/pm-plugins/utils/track-sync-blocks.d.ts +2 -11
- package/dist/types-ts4.5/syncedBlockPluginType.d.ts +2 -5
- package/dist/types-ts4.5/types/index.d.ts +28 -2
- package/dist/types-ts4.5/ui/CreateSyncedBlockButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/OverflowMenuSection.d.ts +1 -1
- package/dist/types-ts4.5/ui/SyncBlockRendererWrapper.d.ts +5 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 4.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`4daaa6358e6fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4daaa6358e6fb) -
|
|
8
|
+
Update resourceId generation for create reference from browser copy + pasting source block
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`dcc6a3e73f414`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dcc6a3e73f414) -
|
|
13
|
+
[ux] EDITOR-3304 add offline error state for sync blocks and update other error UI to match new
|
|
14
|
+
designs
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## 4.4.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`433b512284284`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/433b512284284) -
|
|
22
|
+
[EDITOR-2558] Update bodiedSyncBlock deletion failure flow
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 4.4.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -67,7 +67,8 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
67
67
|
useFetchSyncBlockData: function useFetchSyncBlockData() {
|
|
68
68
|
var _this2$api;
|
|
69
69
|
return (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(syncBlockStore, resourceId, localId, (_this2$api = _this2.api) === null || _this2$api === void 0 || (_this2$api = _this2$api.analytics) === null || _this2$api === void 0 || (_this2$api = _this2$api.actions) === null || _this2$api === void 0 ? void 0 : _this2$api.fireAnalyticsEvent);
|
|
70
|
-
}
|
|
70
|
+
},
|
|
71
|
+
api: this.api
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
}, {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.syncedBlockPluginKey = exports.createPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
10
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
9
11
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
@@ -14,18 +16,23 @@ var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider
|
|
|
14
16
|
var _bodiedLazySyncedBlock = require("../nodeviews/bodiedLazySyncedBlock");
|
|
15
17
|
var _lazySyncedBlock = require("../nodeviews/lazySyncedBlock");
|
|
16
18
|
var _types = require("../types");
|
|
19
|
+
var _handleBodiedSyncBlockRemoval = require("./utils/handle-bodied-sync-block-removal");
|
|
17
20
|
var _ignoreDomEvent = require("./utils/ignore-dom-event");
|
|
18
21
|
var _selectionDecorations = require("./utils/selection-decorations");
|
|
19
22
|
var _trackSyncBlocks4 = require("./utils/track-sync-blocks");
|
|
20
23
|
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; } } }; }
|
|
21
24
|
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; } }
|
|
22
25
|
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; }
|
|
26
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
23
28
|
var syncedBlockPluginKey = exports.syncedBlockPluginKey = new _state.PluginKey('syncedBlockPlugin');
|
|
24
29
|
var createPlugin = exports.createPlugin = function createPlugin(options, pmPluginFactoryParams, syncBlockStore, api) {
|
|
25
30
|
var _ref = options || {},
|
|
26
31
|
_ref$useLongPressSele = _ref.useLongPressSelection,
|
|
27
32
|
useLongPressSelection = _ref$useLongPressSele === void 0 ? false : _ref$useLongPressSele;
|
|
28
|
-
var
|
|
33
|
+
var confirmationTransactionRef = {
|
|
34
|
+
current: undefined
|
|
35
|
+
};
|
|
29
36
|
return new _safePlugin.SafePlugin({
|
|
30
37
|
key: syncedBlockPluginKey,
|
|
31
38
|
state: {
|
|
@@ -36,23 +43,25 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
36
43
|
syncBlockStore.referenceManager.fetchSyncBlocksData((0, _editorSyncedBlockProvider.convertPMNodesToSyncBlockNodes)(syncBlockNodes));
|
|
37
44
|
return {
|
|
38
45
|
selectionDecorationSet: (0, _selectionDecorations.calculateDecorations)(instance.doc, instance.selection, instance.schema),
|
|
39
|
-
|
|
46
|
+
activeFlag: false,
|
|
40
47
|
syncBlockStore: syncBlockStore
|
|
41
48
|
};
|
|
42
49
|
},
|
|
43
50
|
apply: function apply(tr, currentPluginState, oldEditorState) {
|
|
44
|
-
var _meta$
|
|
51
|
+
var _meta$activeFlag, _meta$bodiedSyncBlock;
|
|
45
52
|
var meta = tr.getMeta(syncedBlockPluginKey);
|
|
46
|
-
var
|
|
47
|
-
selectionDecorationSet = currentPluginState.selectionDecorationSet
|
|
53
|
+
var activeFlag = currentPluginState.activeFlag,
|
|
54
|
+
selectionDecorationSet = currentPluginState.selectionDecorationSet,
|
|
55
|
+
bodiedSyncBlockDeletionStatus = currentPluginState.bodiedSyncBlockDeletionStatus;
|
|
48
56
|
var newDecorationSet = selectionDecorationSet.map(tr.mapping, tr.doc);
|
|
49
57
|
if (!tr.selection.eq(oldEditorState.selection)) {
|
|
50
58
|
newDecorationSet = (0, _selectionDecorations.calculateDecorations)(tr.doc, tr.selection, tr.doc.type.schema);
|
|
51
59
|
}
|
|
52
60
|
return {
|
|
53
|
-
|
|
61
|
+
activeFlag: (_meta$activeFlag = meta === null || meta === void 0 ? void 0 : meta.activeFlag) !== null && _meta$activeFlag !== void 0 ? _meta$activeFlag : activeFlag,
|
|
54
62
|
selectionDecorationSet: newDecorationSet,
|
|
55
|
-
syncBlockStore: syncBlockStore
|
|
63
|
+
syncBlockStore: syncBlockStore,
|
|
64
|
+
bodiedSyncBlockDeletionStatus: (_meta$bodiedSyncBlock = meta === null || meta === void 0 ? void 0 : meta.bodiedSyncBlockDeletionStatus) !== null && _meta$bodiedSyncBlock !== void 0 ? _meta$bodiedSyncBlock : bodiedSyncBlockDeletionStatus
|
|
56
65
|
};
|
|
57
66
|
}
|
|
58
67
|
},
|
|
@@ -103,6 +112,36 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
103
112
|
mousedown: function mousedown(view, event) {
|
|
104
113
|
return (0, _ignoreDomEvent.shouldIgnoreDomEvent)(view, event, api);
|
|
105
114
|
}
|
|
115
|
+
},
|
|
116
|
+
transformCopied: function transformCopied(slice, _ref2) {
|
|
117
|
+
var state = _ref2.state;
|
|
118
|
+
var pluginState = syncedBlockPluginKey.getState(state);
|
|
119
|
+
var syncBlockStore = pluginState === null || pluginState === void 0 ? void 0 : pluginState.syncBlockStore;
|
|
120
|
+
var schema = state.schema;
|
|
121
|
+
if (!syncBlockStore) {
|
|
122
|
+
return slice;
|
|
123
|
+
}
|
|
124
|
+
return (0, _utils.mapSlice)(slice, function (node) {
|
|
125
|
+
if (node.type.name === 'bodiedSyncBlock' && node.attrs.resourceId) {
|
|
126
|
+
try {
|
|
127
|
+
var newResourceId = syncBlockStore.referenceManager.generateResourceIdForReference(node.attrs.resourceId);
|
|
128
|
+
// Convert bodiedSyncBlock to syncBlock
|
|
129
|
+
// The paste transformation will regenrate the localId
|
|
130
|
+
var newAttrs = _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
131
|
+
resourceId: newResourceId
|
|
132
|
+
});
|
|
133
|
+
var newMarks = schema.nodes.syncBlock.markSet ? node.marks.filter(function (mark) {
|
|
134
|
+
var _schema$nodes$syncBlo;
|
|
135
|
+
return (_schema$nodes$syncBlo = schema.nodes.syncBlock.markSet) === null || _schema$nodes$syncBlo === void 0 ? void 0 : _schema$nodes$syncBlo.includes(mark.type);
|
|
136
|
+
}) : node.marks;
|
|
137
|
+
return schema.nodes.syncBlock.create(newAttrs, null, newMarks);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
// If generateResourceIdForReference died, return the original node
|
|
140
|
+
return node;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return node;
|
|
144
|
+
});
|
|
106
145
|
}
|
|
107
146
|
},
|
|
108
147
|
filterTransaction: function filterTransaction(tr, state) {
|
|
@@ -121,28 +160,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
121
160
|
bodiedSyncBlockAdded = _trackSyncBlocks.added;
|
|
122
161
|
if (!isOffline) {
|
|
123
162
|
if (bodiedSyncBlockRemoved.length > 0) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// See editor-common/src/sync-block/sync-block-store-manager.ts for how we handle user confirmation and
|
|
127
|
-
// proceed with deletion.
|
|
128
|
-
confirmationTransaction = tr;
|
|
129
|
-
syncBlockStore.sourceManager.deleteSyncBlocksWithConfirmation(bodiedSyncBlockRemoved.map(function (node) {
|
|
130
|
-
return node.attrs;
|
|
131
|
-
}), function () {
|
|
132
|
-
var _api$core;
|
|
133
|
-
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function () {
|
|
134
|
-
var trToDispatch = tr.setMeta('isConfirmedSyncBlockDeletion', true);
|
|
135
|
-
if (!trToDispatch.getMeta(_utils.pmHistoryPluginKey)) {
|
|
136
|
-
// bodiedSyncBlock deletion is expected to be permanent (cannot undo)
|
|
137
|
-
// For a normal deletion (not triggered by undo), remove it from history so that it cannot be undone
|
|
138
|
-
trToDispatch.setMeta('addToHistory', false);
|
|
139
|
-
}
|
|
140
|
-
return trToDispatch;
|
|
141
|
-
});
|
|
142
|
-
}).finally(function () {
|
|
143
|
-
confirmationTransaction = undefined;
|
|
144
|
-
});
|
|
145
|
-
return false;
|
|
163
|
+
confirmationTransactionRef.current = tr;
|
|
164
|
+
return (0, _handleBodiedSyncBlockRemoval.handleBodiedSyncBlockRemoval)(tr, bodiedSyncBlockRemoved, syncBlockStore, api, confirmationTransactionRef);
|
|
146
165
|
}
|
|
147
166
|
if (bodiedSyncBlockAdded.length > 0) {
|
|
148
167
|
if (Boolean(tr.getMeta(_utils.pmHistoryPluginKey))) {
|
|
@@ -156,8 +175,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
156
175
|
// we need to intercept the transaction and save it in insert callback so that we only insert it to the document when backend call if backend call is successful
|
|
157
176
|
// The callback will be evoked by in SourceSyncBlockStoreManager.commitPendingCreation
|
|
158
177
|
syncBlockStore.sourceManager.registerCreationCallback(function () {
|
|
159
|
-
var _api$
|
|
160
|
-
api === null || api === void 0 || (_api$
|
|
178
|
+
var _api$core;
|
|
179
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function () {
|
|
161
180
|
return tr.setMeta('isCommitSyncBlockCreation', true);
|
|
162
181
|
});
|
|
163
182
|
api === null || api === void 0 || api.core.actions.focus();
|
|
@@ -183,10 +202,12 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
183
202
|
if (errorFlag) {
|
|
184
203
|
// Use setTimeout to dispatch transaction in next tick and avoid re-entrant dispatch
|
|
185
204
|
setTimeout(function () {
|
|
186
|
-
api === null || api === void 0 || api.core.actions.execute(function (
|
|
187
|
-
var tr =
|
|
205
|
+
api === null || api === void 0 || api.core.actions.execute(function (_ref3) {
|
|
206
|
+
var tr = _ref3.tr;
|
|
188
207
|
return tr.setMeta(syncedBlockPluginKey, {
|
|
189
|
-
|
|
208
|
+
activeFlag: {
|
|
209
|
+
id: errorFlag
|
|
210
|
+
}
|
|
190
211
|
});
|
|
191
212
|
});
|
|
192
213
|
}, 0);
|
|
@@ -199,8 +220,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
199
220
|
trs.filter(function (tr) {
|
|
200
221
|
return tr.docChanged;
|
|
201
222
|
}).forEach(function (tr) {
|
|
202
|
-
if (
|
|
203
|
-
|
|
223
|
+
if (confirmationTransactionRef.current) {
|
|
224
|
+
confirmationTransactionRef.current = (0, _editorSyncedBlockProvider.rebaseTransaction)(confirmationTransactionRef.current, tr, newState);
|
|
204
225
|
}
|
|
205
226
|
});
|
|
206
227
|
var _iterator = _createForOfIteratorHelper(trs),
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.handleBodiedSyncBlockRemoval = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
+
var _types = require("../../types");
|
|
11
|
+
var _main = require("../main");
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
14
|
+
var onRetry = function onRetry(api, syncBlockStore) {
|
|
15
|
+
return function () {
|
|
16
|
+
var _api$core;
|
|
17
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref) {
|
|
18
|
+
var tr = _ref.tr;
|
|
19
|
+
return tr.setMeta(_main.syncedBlockPluginKey, {
|
|
20
|
+
bodiedSyncBlockDeletionStatus: 'processing',
|
|
21
|
+
activeFlag: false
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
syncBlockStore.sourceManager.retryDeletion();
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
var onDismissed = function onDismissed(syncBlockStore) {
|
|
28
|
+
return function (tr) {
|
|
29
|
+
syncBlockStore.sourceManager.clearPendingDeletion();
|
|
30
|
+
return tr.setMeta(_main.syncedBlockPluginKey, {
|
|
31
|
+
bodiedSyncBlockDeletionStatus: 'none'
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
var handleBodiedSyncBlockRemoval = exports.handleBodiedSyncBlockRemoval = function handleBodiedSyncBlockRemoval(tr, bodiedSyncBlockRemoved, syncBlockStore, api, confirmationTransactionRef) {
|
|
36
|
+
// Clear potential old pending deletion to retreat the deletion as first attempt
|
|
37
|
+
syncBlockStore.sourceManager.clearPendingDeletion();
|
|
38
|
+
|
|
39
|
+
// If there are source sync blocks being removed, and we need to confirm with user before deleting,
|
|
40
|
+
// we block the transaction here, and wait for user confirmation to proceed with deletion.
|
|
41
|
+
// See editor-common/src/sync-block/sync-block-store-manager.ts for how we handle user confirmation and
|
|
42
|
+
// proceed with deletion.
|
|
43
|
+
syncBlockStore.sourceManager.deleteSyncBlocksWithConfirmation(bodiedSyncBlockRemoved.map(function (node) {
|
|
44
|
+
return node.attrs;
|
|
45
|
+
}), function () {
|
|
46
|
+
var _api$core2;
|
|
47
|
+
var confirmationTransaction = confirmationTransactionRef.current;
|
|
48
|
+
if (!confirmationTransaction) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function () {
|
|
52
|
+
var trToDispatch = confirmationTransaction.setMeta('isConfirmedSyncBlockDeletion', true);
|
|
53
|
+
if (!trToDispatch.getMeta(_utils.pmHistoryPluginKey)) {
|
|
54
|
+
// bodiedSyncBlock deletion is expected to be permanent (cannot undo)
|
|
55
|
+
// For a normal deletion (not triggered by undo), remove it from history so that it cannot be undone
|
|
56
|
+
trToDispatch.setMeta('addToHistory', false);
|
|
57
|
+
}
|
|
58
|
+
return trToDispatch;
|
|
59
|
+
});
|
|
60
|
+
}, function (success) {
|
|
61
|
+
var _api$core3;
|
|
62
|
+
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(function (_ref2) {
|
|
63
|
+
var tr = _ref2.tr;
|
|
64
|
+
var newState;
|
|
65
|
+
if (!success) {
|
|
66
|
+
newState = {
|
|
67
|
+
activeFlag: {
|
|
68
|
+
id: _types.FLAG_ID.FAIL_TO_DELETE,
|
|
69
|
+
onRetry: onRetry(api, syncBlockStore),
|
|
70
|
+
onDismissed: onDismissed(syncBlockStore)
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
newState = _objectSpread(_objectSpread({}, newState), {}, {
|
|
75
|
+
bodiedSyncBlockDeletionStatus: syncBlockStore.sourceManager.isRetryingDeletion() ?
|
|
76
|
+
// For retry, reset to none directly to clean up the status
|
|
77
|
+
'none' :
|
|
78
|
+
// For the first attempt, set to completed for deletion modal can close the modal
|
|
79
|
+
'completed'
|
|
80
|
+
});
|
|
81
|
+
return tr.setMeta(_main.syncedBlockPluginKey, newState);
|
|
82
|
+
});
|
|
83
|
+
}, function () {
|
|
84
|
+
confirmationTransactionRef.current = undefined;
|
|
85
|
+
});
|
|
86
|
+
return false;
|
|
87
|
+
};
|
|
@@ -113,11 +113,13 @@ var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_
|
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
var _syncedBlockPluginKey = _main.syncedBlockPluginKey.getState(editorState),
|
|
116
|
-
|
|
117
|
-
currentSyncBlockStore = _syncedBlockPluginKey.syncBlockStore
|
|
116
|
+
activeFlag = _syncedBlockPluginKey.activeFlag,
|
|
117
|
+
currentSyncBlockStore = _syncedBlockPluginKey.syncBlockStore,
|
|
118
|
+
bodiedSyncBlockDeletionStatus = _syncedBlockPluginKey.bodiedSyncBlockDeletionStatus;
|
|
118
119
|
return {
|
|
119
|
-
|
|
120
|
-
syncBlockStore: currentSyncBlockStore
|
|
120
|
+
activeFlag: activeFlag,
|
|
121
|
+
syncBlockStore: currentSyncBlockStore,
|
|
122
|
+
bodiedSyncBlockDeletionStatus: bodiedSyncBlockDeletionStatus
|
|
121
123
|
};
|
|
122
124
|
}
|
|
123
125
|
};
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -8,5 +8,6 @@ var FLAG_ID = exports.FLAG_ID = /*#__PURE__*/function (FLAG_ID) {
|
|
|
8
8
|
FLAG_ID["CANNOT_DELETE_WHEN_OFFLINE"] = "cannot-delete-when-offline";
|
|
9
9
|
FLAG_ID["CANNOT_EDIT_WHEN_OFFLINE"] = "cannot-edit-when-offline";
|
|
10
10
|
FLAG_ID["CANNOT_CREATE_WHEN_OFFLINE"] = "cannot-create-when-offline";
|
|
11
|
+
FLAG_ID["FAIL_TO_DELETE"] = "fail-to-delete";
|
|
11
12
|
return FLAG_ID;
|
|
12
13
|
}({});
|
|
@@ -14,8 +14,10 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
14
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
15
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
16
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
|
+
var _main = require("../pm-plugins/main");
|
|
17
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
19
|
var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteConfirmationModal(_ref) {
|
|
20
|
+
var _api$core2, _api$core4, _api$core6;
|
|
19
21
|
var syncBlockStoreManager = _ref.syncBlockStoreManager,
|
|
20
22
|
api = _ref.api;
|
|
21
23
|
var _useState = (0, _react.useState)(false),
|
|
@@ -26,41 +28,79 @@ var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteC
|
|
|
26
28
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
27
29
|
syncBlockCount = _useState4[0],
|
|
28
30
|
setSyncBlockCount = _useState4[1];
|
|
29
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity'], function (states) {
|
|
30
|
-
var _states$connectivityS;
|
|
31
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity', 'syncedBlock'], function (states) {
|
|
32
|
+
var _states$connectivityS, _states$syncedBlockSt, _states$syncedBlockSt2;
|
|
31
33
|
return {
|
|
32
|
-
mode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
34
|
+
mode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode,
|
|
35
|
+
bodiedSyncBlockDeletionStatus: (_states$syncedBlockSt = states.syncedBlockState) === null || _states$syncedBlockSt === void 0 ? void 0 : _states$syncedBlockSt.bodiedSyncBlockDeletionStatus,
|
|
36
|
+
activeFlag: (_states$syncedBlockSt2 = states.syncedBlockState) === null || _states$syncedBlockSt2 === void 0 ? void 0 : _states$syncedBlockSt2.activeFlag
|
|
33
37
|
};
|
|
34
38
|
}),
|
|
35
|
-
mode = _useSharedPluginState.mode
|
|
39
|
+
mode = _useSharedPluginState.mode,
|
|
40
|
+
bodiedSyncBlockDeletionStatus = _useSharedPluginState.bodiedSyncBlockDeletionStatus,
|
|
41
|
+
activeFlag = _useSharedPluginState.activeFlag;
|
|
36
42
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
37
43
|
formatMessage = _useIntl.formatMessage;
|
|
38
44
|
var resolverRef = _react.default.useRef(undefined);
|
|
39
|
-
var
|
|
45
|
+
var handleClick = (0, _react.useCallback)(function (confirm) {
|
|
40
46
|
return function () {
|
|
47
|
+
var _api$core;
|
|
41
48
|
if (resolverRef.current) {
|
|
42
49
|
resolverRef.current(confirm);
|
|
43
50
|
resolverRef.current = undefined;
|
|
44
51
|
}
|
|
45
|
-
|
|
52
|
+
if (!confirm) {
|
|
53
|
+
setIsOpen(false);
|
|
54
|
+
}
|
|
55
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref2) {
|
|
56
|
+
var tr = _ref2.tr;
|
|
57
|
+
return tr.setMeta(_main.syncedBlockPluginKey, {
|
|
58
|
+
bodiedSyncBlockDeletionStatus: confirm ? 'processing' : 'none',
|
|
59
|
+
activeFlag: false
|
|
60
|
+
});
|
|
61
|
+
});
|
|
46
62
|
};
|
|
47
|
-
}, []);
|
|
63
|
+
}, [api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions]);
|
|
48
64
|
var confirmationCallback = (0, _react.useCallback)(function (syncBlockCount) {
|
|
49
65
|
setIsOpen(true);
|
|
50
66
|
setSyncBlockCount(syncBlockCount);
|
|
51
67
|
var confirmedPromise = new Promise(function (resolve) {
|
|
52
68
|
resolverRef.current = resolve;
|
|
53
69
|
});
|
|
70
|
+
if (activeFlag) {
|
|
71
|
+
var _api$core3;
|
|
72
|
+
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(function (_ref3) {
|
|
73
|
+
var tr = _ref3.tr;
|
|
74
|
+
return tr.setMeta(_main.syncedBlockPluginKey, {
|
|
75
|
+
// Clear flag to avoid potential retry deletion of different blocks
|
|
76
|
+
activeFlag: false
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
54
80
|
return confirmedPromise;
|
|
55
|
-
}, []);
|
|
81
|
+
}, [activeFlag, api === null || api === void 0 || (_api$core4 = api.core) === null || _api$core4 === void 0 ? void 0 : _api$core4.actions]);
|
|
56
82
|
(0, _react.useEffect)(function () {
|
|
57
83
|
var unregister = syncBlockStoreManager.sourceManager.registerConfirmationCallback(confirmationCallback);
|
|
58
84
|
return function () {
|
|
59
85
|
unregister();
|
|
60
86
|
};
|
|
61
87
|
}, [syncBlockStoreManager, confirmationCallback]);
|
|
88
|
+
(0, _react.useEffect)(function () {
|
|
89
|
+
if (bodiedSyncBlockDeletionStatus === 'completed' && isOpen) {
|
|
90
|
+
var _api$core5;
|
|
91
|
+
// auto close modal once deletion is successful
|
|
92
|
+
setIsOpen(false);
|
|
93
|
+
api === null || api === void 0 || (_api$core5 = api.core) === null || _api$core5 === void 0 || _api$core5.actions.execute(function (_ref4) {
|
|
94
|
+
var tr = _ref4.tr;
|
|
95
|
+
return tr.setMeta(_main.syncedBlockPluginKey, {
|
|
96
|
+
// Reset deletion status to have a clean state for next deletion
|
|
97
|
+
bodiedSyncBlockDeletionStatus: 'none'
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, [api === null || api === void 0 || (_api$core6 = api.core) === null || _api$core6 === void 0 ? void 0 : _api$core6.actions, bodiedSyncBlockDeletionStatus, isOpen]);
|
|
62
102
|
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
63
|
-
onClose:
|
|
103
|
+
onClose: handleClick(false),
|
|
64
104
|
testId: "sync-block-delete-confirmation"
|
|
65
105
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, {
|
|
66
106
|
hasCloseButton: true
|
|
@@ -70,11 +110,12 @@ var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteC
|
|
|
70
110
|
syncBlockCount: syncBlockCount
|
|
71
111
|
}))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
72
112
|
appearance: "subtle",
|
|
73
|
-
onClick:
|
|
113
|
+
onClick: handleClick(false)
|
|
74
114
|
}, formatMessage(_messages.syncBlockMessages.deleteConfirmationModalCancelButton)), /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
75
115
|
appearance: "warning",
|
|
76
|
-
onClick:
|
|
116
|
+
onClick: handleClick(true),
|
|
77
117
|
autoFocus: true,
|
|
78
|
-
isDisabled: mode === 'offline'
|
|
118
|
+
isDisabled: mode === 'offline',
|
|
119
|
+
isLoading: bodiedSyncBlockDeletionStatus === 'processing'
|
|
79
120
|
}, formatMessage(_messages.syncBlockMessages.deleteConfirmationModalDeleteButton)))));
|
|
80
121
|
};
|
package/dist/cjs/ui/Flag.js
CHANGED
|
@@ -12,11 +12,13 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
12
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _flag = _interopRequireWildcard(require("@atlaskit/flag"));
|
|
15
|
-
var
|
|
15
|
+
var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
|
|
16
16
|
var _main = require("../pm-plugins/main");
|
|
17
17
|
var _types = require("../types");
|
|
18
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
-
var
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
21
|
+
var flagMap = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.FLAG_ID.CANNOT_DELETE_WHEN_OFFLINE, {
|
|
20
22
|
title: _messages.syncBlockMessages.failToDeleteTitle,
|
|
21
23
|
description: _messages.syncBlockMessages.failToDeleteWhenOfflineDescription
|
|
22
24
|
}), _types.FLAG_ID.CANNOT_EDIT_WHEN_OFFLINE, {
|
|
@@ -25,43 +27,68 @@ var flagMap = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _d
|
|
|
25
27
|
}), _types.FLAG_ID.CANNOT_CREATE_WHEN_OFFLINE, {
|
|
26
28
|
title: _messages.syncBlockMessages.failToCreateTitle,
|
|
27
29
|
description: _messages.syncBlockMessages.failToCreateWhenOfflineDescription
|
|
30
|
+
}), _types.FLAG_ID.FAIL_TO_DELETE, {
|
|
31
|
+
title: _messages.syncBlockMessages.cannotDeleteTitle,
|
|
32
|
+
description: _messages.syncBlockMessages.cannotDeleteDescription
|
|
28
33
|
});
|
|
29
34
|
var Flag = exports.Flag = function Flag(_ref) {
|
|
30
35
|
var api = _ref.api;
|
|
31
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['syncedBlock'], function (states) {
|
|
32
|
-
var _states$syncedBlockSt;
|
|
36
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['syncedBlock', 'connectivity'], function (states) {
|
|
37
|
+
var _states$syncedBlockSt, _states$connectivityS;
|
|
33
38
|
return {
|
|
34
|
-
|
|
39
|
+
activeFlag: (_states$syncedBlockSt = states.syncedBlockState) === null || _states$syncedBlockSt === void 0 ? void 0 : _states$syncedBlockSt.activeFlag,
|
|
40
|
+
mode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
|
|
35
41
|
};
|
|
36
42
|
}),
|
|
37
|
-
|
|
43
|
+
activeFlag = _useSharedPluginState.activeFlag,
|
|
44
|
+
mode = _useSharedPluginState.mode;
|
|
38
45
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
39
46
|
formatMessage = _useIntl.formatMessage;
|
|
40
|
-
if (!
|
|
47
|
+
if (!activeFlag) {
|
|
41
48
|
return;
|
|
42
49
|
}
|
|
43
|
-
var _flagMap$
|
|
44
|
-
title = _flagMap$
|
|
45
|
-
description = _flagMap$
|
|
46
|
-
var
|
|
50
|
+
var _flagMap$activeFlag$i = flagMap[activeFlag.id],
|
|
51
|
+
title = _flagMap$activeFlag$i.title,
|
|
52
|
+
description = _flagMap$activeFlag$i.description;
|
|
53
|
+
var onRetry = activeFlag.onRetry,
|
|
54
|
+
onDismissedCallback = activeFlag.onDismissed;
|
|
55
|
+
|
|
56
|
+
// Retry button often involves network request, hence we dismiss the flag in offline mode to avoid retry
|
|
57
|
+
if (mode === 'offline' && !!onRetry) {
|
|
47
58
|
api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
|
|
48
59
|
var tr = _ref2.tr;
|
|
49
60
|
tr.setMeta(_main.syncedBlockPluginKey, {
|
|
50
|
-
|
|
61
|
+
activeFlag: false
|
|
51
62
|
});
|
|
52
63
|
return tr;
|
|
53
64
|
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
var onDismissed = function onDismissed() {
|
|
68
|
+
api === null || api === void 0 || api.core.actions.execute(function (_ref3) {
|
|
69
|
+
var tr = _ref3.tr;
|
|
70
|
+
onDismissedCallback === null || onDismissedCallback === void 0 || onDismissedCallback(tr);
|
|
71
|
+
var oldMeta = tr.getMeta(_main.syncedBlockPluginKey);
|
|
72
|
+
tr.setMeta(_main.syncedBlockPluginKey, _objectSpread(_objectSpread({}, oldMeta), {}, {
|
|
73
|
+
activeFlag: false
|
|
74
|
+
}));
|
|
75
|
+
return tr;
|
|
76
|
+
});
|
|
54
77
|
api === null || api === void 0 || api.core.actions.focus();
|
|
55
78
|
};
|
|
56
79
|
return /*#__PURE__*/_react.default.createElement(_flag.FlagGroup, null, /*#__PURE__*/_react.default.createElement(_flag.default, {
|
|
57
80
|
onDismissed: onDismissed,
|
|
58
81
|
title: formatMessage(title),
|
|
59
82
|
description: formatMessage(description),
|
|
60
|
-
id:
|
|
61
|
-
testId:
|
|
62
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
83
|
+
id: activeFlag.id,
|
|
84
|
+
testId: activeFlag.id,
|
|
85
|
+
icon: /*#__PURE__*/_react.default.createElement(_statusWarning.default, {
|
|
63
86
|
label: "",
|
|
64
|
-
color: "var(--ds-icon-
|
|
65
|
-
})
|
|
87
|
+
color: "var(--ds-icon-warning, #E06C00)"
|
|
88
|
+
}),
|
|
89
|
+
actions: onRetry ? [{
|
|
90
|
+
content: formatMessage(_messages.syncBlockMessages.deleteRetryButton),
|
|
91
|
+
onClick: onRetry
|
|
92
|
+
}] : undefined
|
|
66
93
|
}));
|
|
67
94
|
};
|
|
@@ -13,14 +13,16 @@ var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperCompone
|
|
|
13
13
|
var syncedBlockRenderer = _ref.syncedBlockRenderer,
|
|
14
14
|
useFetchSyncBlockData = _ref.useFetchSyncBlockData,
|
|
15
15
|
localId = _ref.localId,
|
|
16
|
-
useFetchSyncBlockTitle = _ref.useFetchSyncBlockTitle
|
|
16
|
+
useFetchSyncBlockTitle = _ref.useFetchSyncBlockTitle,
|
|
17
|
+
api = _ref.api;
|
|
17
18
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
18
19
|
"data-testid": SyncBlockRendererWrapperDataId
|
|
19
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
20
21
|
,
|
|
21
22
|
className: _syncBlock.SyncBlockSharedCssClassName.renderer
|
|
22
23
|
}, syncedBlockRenderer({
|
|
23
|
-
useFetchSyncBlockData: useFetchSyncBlockData
|
|
24
|
+
useFetchSyncBlockData: useFetchSyncBlockData,
|
|
25
|
+
api: api
|
|
24
26
|
})), /*#__PURE__*/_react.default.createElement(_SyncBlockLabel.SyncBlockLabel, {
|
|
25
27
|
isSource: false,
|
|
26
28
|
useFetchSyncBlockTitle: useFetchSyncBlockTitle,
|
|
@@ -39,7 +39,8 @@ class SyncBlock extends ReactNodeView {
|
|
|
39
39
|
useFetchSyncBlockData: () => {
|
|
40
40
|
var _this$api2, _this$api2$analytics, _this$api2$analytics$;
|
|
41
41
|
return useFetchSyncBlockData(syncBlockStore, resourceId, localId, (_this$api2 = this.api) === null || _this$api2 === void 0 ? void 0 : (_this$api2$analytics = _this$api2.analytics) === null || _this$api2$analytics === void 0 ? void 0 : (_this$api2$analytics$ = _this$api2$analytics.actions) === null || _this$api2$analytics$ === void 0 ? void 0 : _this$api2$analytics$.fireAnalyticsEvent);
|
|
42
|
-
}
|
|
42
|
+
},
|
|
43
|
+
api: this.api
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
destroy() {
|