@atlaskit/editor-plugin-synced-block 6.0.42 → 6.0.44
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 +17 -0
- package/dist/cjs/pm-plugins/main.js +11 -1
- package/dist/cjs/syncedBlockPlugin.js +3 -2
- package/dist/cjs/ui/DeleteConfirmationModal.js +26 -2
- package/dist/es2019/pm-plugins/main.js +11 -1
- package/dist/es2019/syncedBlockPlugin.js +3 -2
- package/dist/es2019/ui/DeleteConfirmationModal.js +26 -2
- package/dist/esm/pm-plugins/main.js +11 -1
- package/dist/esm/syncedBlockPlugin.js +3 -2
- package/dist/esm/ui/DeleteConfirmationModal.js +26 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 6.0.44
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`38e89dd6515da`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38e89dd6515da) -
|
|
8
|
+
Read viewMode from the editorViewMode plugin and pass it to SyncBlockStoreManager so that synced
|
|
9
|
+
block side effects are suppressed when the editor is in view mode (e.g. Version History).
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 6.0.43
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`c120ecfaba934`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c120ecfaba934) -
|
|
17
|
+
[ux] Update delete and unsync modal text for source with multiple references.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 6.0.42
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -472,7 +472,11 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
472
472
|
}
|
|
473
473
|
},
|
|
474
474
|
filterTransaction: function filterTransaction(tr, state) {
|
|
475
|
-
var _api$connectivity3;
|
|
475
|
+
var _api$editorViewMode2, _api$connectivity3;
|
|
476
|
+
var viewMode = api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode;
|
|
477
|
+
if (viewMode === 'view' && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_8')) {
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
476
480
|
var isOffline = (0, _editorPluginConnectivity.isOfflineMode)(api === null || api === void 0 || (_api$connectivity3 = api.connectivity) === null || _api$connectivity3 === void 0 || (_api$connectivity3 = _api$connectivity3.sharedState.currentState()) === null || _api$connectivity3 === void 0 ? void 0 : _api$connectivity3.mode);
|
|
477
481
|
var isConfirmedSyncBlockDeletion = Boolean(tr.getMeta('isConfirmedSyncBlockDeletion'));
|
|
478
482
|
|
|
@@ -514,6 +518,12 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
514
518
|
});
|
|
515
519
|
},
|
|
516
520
|
appendTransaction: function appendTransaction(trs, oldState, newState) {
|
|
521
|
+
var _api$editorViewMode3;
|
|
522
|
+
var viewMode = api === null || api === void 0 || (_api$editorViewMode3 = api.editorViewMode) === null || _api$editorViewMode3 === void 0 || (_api$editorViewMode3 = _api$editorViewMode3.sharedState.currentState()) === null || _api$editorViewMode3 === void 0 ? void 0 : _api$editorViewMode3.mode;
|
|
523
|
+
if (viewMode === 'view' && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_8')) {
|
|
524
|
+
return null;
|
|
525
|
+
}
|
|
526
|
+
|
|
517
527
|
// Update source sync block cache for user-initiated changes only
|
|
518
528
|
// When fg is ON, cache updates are handled here instead of in the nodeview update()
|
|
519
529
|
if ((0, _platformFeatureFlags.fg)('platform_synced_block_update_refactor')) {
|
|
@@ -22,11 +22,12 @@ var _quickInsert = require("./ui/quick-insert");
|
|
|
22
22
|
var _SyncBlockRefresher = require("./ui/SyncBlockRefresher");
|
|
23
23
|
var _toolbarComponents = require("./ui/toolbar-components");
|
|
24
24
|
var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_ref) {
|
|
25
|
-
var _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
|
|
25
|
+
var _api$editorViewMode, _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
|
|
26
26
|
var config = _ref.config,
|
|
27
27
|
api = _ref.api;
|
|
28
28
|
var refs = {};
|
|
29
|
-
var
|
|
29
|
+
var viewMode = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode;
|
|
30
|
+
var syncBlockStore = new _editorSyncedBlockProvider.SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider, viewMode);
|
|
30
31
|
syncBlockStore.setFireAnalyticsEvent(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
|
|
31
32
|
api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents((0, _blockMenuComponents.getBlockMenuComponents)(api, (_config$enableSourceC = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC !== void 0 ? _config$enableSourceC : false));
|
|
32
33
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api, (_config$enableSourceC2 = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC2 !== void 0 ? _config$enableSourceC2 : false));
|
|
@@ -19,11 +19,12 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
19
19
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
20
20
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
21
21
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
22
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
23
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
23
24
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
24
25
|
var _main = require("../pm-plugins/main");
|
|
25
26
|
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); }
|
|
26
|
-
var
|
|
27
|
+
var modalContentMapOld = {
|
|
27
28
|
'source-block-deleted': {
|
|
28
29
|
titleMultiple: _messages.syncBlockMessages.deleteConfirmationModalTitleMultiple,
|
|
29
30
|
titleSingle: _messages.syncBlockMessages.deletionConfirmationModalTitleSingle,
|
|
@@ -46,6 +47,29 @@ var modalContentMap = {
|
|
|
46
47
|
confirmButtonLabel: _messages.syncBlockMessages.deleteConfirmationModalUnsyncButton
|
|
47
48
|
}
|
|
48
49
|
};
|
|
50
|
+
var modalContentMap = {
|
|
51
|
+
'source-block-deleted': {
|
|
52
|
+
titleMultiple: _messages.syncBlockMessages.deleteConfirmationModalTitleMultiple,
|
|
53
|
+
titleSingle: _messages.syncBlockMessages.deletionConfirmationModalTitleSingle,
|
|
54
|
+
descriptionSingle: _messages.syncBlockMessages.deletionConfirmationModalDescriptionNoRef,
|
|
55
|
+
descriptionMultiple: _messages.syncBlockMessages.deletionConfirmationModalDescriptionNew,
|
|
56
|
+
confirmButtonLabel: _messages.syncBlockMessages.deleteConfirmationModalDeleteButton
|
|
57
|
+
},
|
|
58
|
+
'source-block-unpublished': {
|
|
59
|
+
titleMultiple: _messages.syncBlockMessages.deleteConfirmationModalTitleMultiple,
|
|
60
|
+
titleSingle: _messages.syncBlockMessages.deletionConfirmationModalTitleSingle,
|
|
61
|
+
descriptionSingle: _messages.syncBlockMessages.deletionConfirmationModalDescriptionNoRef,
|
|
62
|
+
descriptionMultiple: _messages.syncBlockMessages.deletionConfirmationModalDescriptionNew,
|
|
63
|
+
confirmButtonLabel: _messages.syncBlockMessages.deleteConfirmationModalDeleteButton
|
|
64
|
+
},
|
|
65
|
+
'source-block-unsynced': {
|
|
66
|
+
titleMultiple: _messages.syncBlockMessages.unsyncConfirmationModalTitle,
|
|
67
|
+
titleSingle: _messages.syncBlockMessages.unsyncConfirmationModalTitle,
|
|
68
|
+
descriptionSingle: _messages.syncBlockMessages.unsyncConfirmModalDescriptionSingle,
|
|
69
|
+
descriptionMultiple: _messages.syncBlockMessages.unsyncConfirmModalDescriptionMultipleNew,
|
|
70
|
+
confirmButtonLabel: _messages.syncBlockMessages.deleteConfirmationModalUnsyncButton
|
|
71
|
+
}
|
|
72
|
+
};
|
|
49
73
|
var styles = {
|
|
50
74
|
spinner: "_1mou1wug _195g1wug"
|
|
51
75
|
};
|
|
@@ -219,7 +243,7 @@ var DeleteConfirmationModal = exports.DeleteConfirmationModal = function DeleteC
|
|
|
219
243
|
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
220
244
|
size: "large"
|
|
221
245
|
})) : /*#__PURE__*/_react.default.createElement(ModalContent, {
|
|
222
|
-
content: modalContentMap[deleteReason],
|
|
246
|
+
content: (0, _platformFeatureFlags.fg)('platform_synced_block_patch_8') ? modalContentMap[deleteReason] : modalContentMapOld[deleteReason],
|
|
223
247
|
referenceCount: referenceCount,
|
|
224
248
|
handleClick: handleClick,
|
|
225
249
|
formatMessage: formatMessage,
|
|
@@ -436,7 +436,11 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
438
|
filterTransaction: (tr, state) => {
|
|
439
|
-
var _api$connectivity3, _api$connectivity3$sh;
|
|
439
|
+
var _api$editorViewMode2, _api$editorViewMode2$, _api$connectivity3, _api$connectivity3$sh;
|
|
440
|
+
const viewMode = api === null || api === void 0 ? void 0 : (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 ? void 0 : (_api$editorViewMode2$ = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2$ === void 0 ? void 0 : _api$editorViewMode2$.mode;
|
|
441
|
+
if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
|
|
442
|
+
return true;
|
|
443
|
+
}
|
|
440
444
|
const isOffline = isOfflineMode(api === null || api === void 0 ? void 0 : (_api$connectivity3 = api.connectivity) === null || _api$connectivity3 === void 0 ? void 0 : (_api$connectivity3$sh = _api$connectivity3.sharedState.currentState()) === null || _api$connectivity3$sh === void 0 ? void 0 : _api$connectivity3$sh.mode);
|
|
441
445
|
const isConfirmedSyncBlockDeletion = Boolean(tr.getMeta('isConfirmedSyncBlockDeletion'));
|
|
442
446
|
|
|
@@ -478,6 +482,12 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
478
482
|
});
|
|
479
483
|
},
|
|
480
484
|
appendTransaction: (trs, oldState, newState) => {
|
|
485
|
+
var _api$editorViewMode3, _api$editorViewMode3$;
|
|
486
|
+
const viewMode = api === null || api === void 0 ? void 0 : (_api$editorViewMode3 = api.editorViewMode) === null || _api$editorViewMode3 === void 0 ? void 0 : (_api$editorViewMode3$ = _api$editorViewMode3.sharedState.currentState()) === null || _api$editorViewMode3$ === void 0 ? void 0 : _api$editorViewMode3$.mode;
|
|
487
|
+
if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
|
|
481
491
|
// Update source sync block cache for user-initiated changes only
|
|
482
492
|
// When fg is ON, cache updates are handled here instead of in the nodeview update()
|
|
483
493
|
if (fg('platform_synced_block_update_refactor')) {
|
|
@@ -18,9 +18,10 @@ export const syncedBlockPlugin = ({
|
|
|
18
18
|
config,
|
|
19
19
|
api
|
|
20
20
|
}) => {
|
|
21
|
-
var _api$analytics, _api$analytics$action, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
|
|
21
|
+
var _api$editorViewMode, _api$editorViewMode$s, _api$analytics, _api$analytics$action, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
|
|
22
22
|
const refs = {};
|
|
23
|
-
const
|
|
23
|
+
const viewMode = api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : (_api$editorViewMode$s = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode$s === void 0 ? void 0 : _api$editorViewMode$s.mode;
|
|
24
|
+
const syncBlockStore = new SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider, viewMode);
|
|
24
25
|
syncBlockStore.setFireAnalyticsEvent(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent);
|
|
25
26
|
api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents(getBlockMenuComponents(api, (_config$enableSourceC = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC !== void 0 ? _config$enableSourceC : false));
|
|
26
27
|
api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api, (_config$enableSourceC2 = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC2 !== void 0 ? _config$enableSourceC2 : false));
|
|
@@ -8,10 +8,11 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
8
8
|
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
9
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
10
10
|
import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { Text, Box } from '@atlaskit/primitives/compiled';
|
|
12
13
|
import Spinner from '@atlaskit/spinner';
|
|
13
14
|
import { syncedBlockPluginKey } from '../pm-plugins/main';
|
|
14
|
-
const
|
|
15
|
+
const modalContentMapOld = {
|
|
15
16
|
'source-block-deleted': {
|
|
16
17
|
titleMultiple: messages.deleteConfirmationModalTitleMultiple,
|
|
17
18
|
titleSingle: messages.deletionConfirmationModalTitleSingle,
|
|
@@ -34,6 +35,29 @@ const modalContentMap = {
|
|
|
34
35
|
confirmButtonLabel: messages.deleteConfirmationModalUnsyncButton
|
|
35
36
|
}
|
|
36
37
|
};
|
|
38
|
+
const modalContentMap = {
|
|
39
|
+
'source-block-deleted': {
|
|
40
|
+
titleMultiple: messages.deleteConfirmationModalTitleMultiple,
|
|
41
|
+
titleSingle: messages.deletionConfirmationModalTitleSingle,
|
|
42
|
+
descriptionSingle: messages.deletionConfirmationModalDescriptionNoRef,
|
|
43
|
+
descriptionMultiple: messages.deletionConfirmationModalDescriptionNew,
|
|
44
|
+
confirmButtonLabel: messages.deleteConfirmationModalDeleteButton
|
|
45
|
+
},
|
|
46
|
+
'source-block-unpublished': {
|
|
47
|
+
titleMultiple: messages.deleteConfirmationModalTitleMultiple,
|
|
48
|
+
titleSingle: messages.deletionConfirmationModalTitleSingle,
|
|
49
|
+
descriptionSingle: messages.deletionConfirmationModalDescriptionNoRef,
|
|
50
|
+
descriptionMultiple: messages.deletionConfirmationModalDescriptionNew,
|
|
51
|
+
confirmButtonLabel: messages.deleteConfirmationModalDeleteButton
|
|
52
|
+
},
|
|
53
|
+
'source-block-unsynced': {
|
|
54
|
+
titleMultiple: messages.unsyncConfirmationModalTitle,
|
|
55
|
+
titleSingle: messages.unsyncConfirmationModalTitle,
|
|
56
|
+
descriptionSingle: messages.unsyncConfirmModalDescriptionSingle,
|
|
57
|
+
descriptionMultiple: messages.unsyncConfirmModalDescriptionMultipleNew,
|
|
58
|
+
confirmButtonLabel: messages.deleteConfirmationModalUnsyncButton
|
|
59
|
+
}
|
|
60
|
+
};
|
|
37
61
|
const styles = {
|
|
38
62
|
spinner: "_1mou1wug _195g1wug"
|
|
39
63
|
};
|
|
@@ -158,7 +182,7 @@ export const DeleteConfirmationModal = ({
|
|
|
158
182
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
159
183
|
size: "large"
|
|
160
184
|
})) : /*#__PURE__*/React.createElement(ModalContent, {
|
|
161
|
-
content: modalContentMap[deleteReason],
|
|
185
|
+
content: fg('platform_synced_block_patch_8') ? modalContentMap[deleteReason] : modalContentMapOld[deleteReason],
|
|
162
186
|
referenceCount: referenceCount,
|
|
163
187
|
handleClick: handleClick,
|
|
164
188
|
formatMessage: formatMessage,
|
|
@@ -465,7 +465,11 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
filterTransaction: function filterTransaction(tr, state) {
|
|
468
|
-
var _api$connectivity3;
|
|
468
|
+
var _api$editorViewMode2, _api$connectivity3;
|
|
469
|
+
var viewMode = api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode;
|
|
470
|
+
if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
469
473
|
var isOffline = isOfflineMode(api === null || api === void 0 || (_api$connectivity3 = api.connectivity) === null || _api$connectivity3 === void 0 || (_api$connectivity3 = _api$connectivity3.sharedState.currentState()) === null || _api$connectivity3 === void 0 ? void 0 : _api$connectivity3.mode);
|
|
470
474
|
var isConfirmedSyncBlockDeletion = Boolean(tr.getMeta('isConfirmedSyncBlockDeletion'));
|
|
471
475
|
|
|
@@ -507,6 +511,12 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
507
511
|
});
|
|
508
512
|
},
|
|
509
513
|
appendTransaction: function appendTransaction(trs, oldState, newState) {
|
|
514
|
+
var _api$editorViewMode3;
|
|
515
|
+
var viewMode = api === null || api === void 0 || (_api$editorViewMode3 = api.editorViewMode) === null || _api$editorViewMode3 === void 0 || (_api$editorViewMode3 = _api$editorViewMode3.sharedState.currentState()) === null || _api$editorViewMode3 === void 0 ? void 0 : _api$editorViewMode3.mode;
|
|
516
|
+
if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
|
|
510
520
|
// Update source sync block cache for user-initiated changes only
|
|
511
521
|
// When fg is ON, cache updates are handled here instead of in the nodeview update()
|
|
512
522
|
if (fg('platform_synced_block_update_refactor')) {
|
|
@@ -15,11 +15,12 @@ import { getQuickInsertConfig } from './ui/quick-insert';
|
|
|
15
15
|
import { SyncBlockRefresher } from './ui/SyncBlockRefresher';
|
|
16
16
|
import { getToolbarComponents } from './ui/toolbar-components';
|
|
17
17
|
export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
|
|
18
|
-
var _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
|
|
18
|
+
var _api$editorViewMode, _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
|
|
19
19
|
var config = _ref.config,
|
|
20
20
|
api = _ref.api;
|
|
21
21
|
var refs = {};
|
|
22
|
-
var
|
|
22
|
+
var viewMode = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode;
|
|
23
|
+
var syncBlockStore = new SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider, viewMode);
|
|
23
24
|
syncBlockStore.setFireAnalyticsEvent(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
|
|
24
25
|
api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents(getBlockMenuComponents(api, (_config$enableSourceC = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC !== void 0 ? _config$enableSourceC : false));
|
|
25
26
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api, (_config$enableSourceC2 = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC2 !== void 0 ? _config$enableSourceC2 : false));
|
|
@@ -11,10 +11,11 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
11
11
|
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
13
13
|
import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { Text, Box } from '@atlaskit/primitives/compiled';
|
|
15
16
|
import Spinner from '@atlaskit/spinner';
|
|
16
17
|
import { syncedBlockPluginKey } from '../pm-plugins/main';
|
|
17
|
-
var
|
|
18
|
+
var modalContentMapOld = {
|
|
18
19
|
'source-block-deleted': {
|
|
19
20
|
titleMultiple: messages.deleteConfirmationModalTitleMultiple,
|
|
20
21
|
titleSingle: messages.deletionConfirmationModalTitleSingle,
|
|
@@ -37,6 +38,29 @@ var modalContentMap = {
|
|
|
37
38
|
confirmButtonLabel: messages.deleteConfirmationModalUnsyncButton
|
|
38
39
|
}
|
|
39
40
|
};
|
|
41
|
+
var modalContentMap = {
|
|
42
|
+
'source-block-deleted': {
|
|
43
|
+
titleMultiple: messages.deleteConfirmationModalTitleMultiple,
|
|
44
|
+
titleSingle: messages.deletionConfirmationModalTitleSingle,
|
|
45
|
+
descriptionSingle: messages.deletionConfirmationModalDescriptionNoRef,
|
|
46
|
+
descriptionMultiple: messages.deletionConfirmationModalDescriptionNew,
|
|
47
|
+
confirmButtonLabel: messages.deleteConfirmationModalDeleteButton
|
|
48
|
+
},
|
|
49
|
+
'source-block-unpublished': {
|
|
50
|
+
titleMultiple: messages.deleteConfirmationModalTitleMultiple,
|
|
51
|
+
titleSingle: messages.deletionConfirmationModalTitleSingle,
|
|
52
|
+
descriptionSingle: messages.deletionConfirmationModalDescriptionNoRef,
|
|
53
|
+
descriptionMultiple: messages.deletionConfirmationModalDescriptionNew,
|
|
54
|
+
confirmButtonLabel: messages.deleteConfirmationModalDeleteButton
|
|
55
|
+
},
|
|
56
|
+
'source-block-unsynced': {
|
|
57
|
+
titleMultiple: messages.unsyncConfirmationModalTitle,
|
|
58
|
+
titleSingle: messages.unsyncConfirmationModalTitle,
|
|
59
|
+
descriptionSingle: messages.unsyncConfirmModalDescriptionSingle,
|
|
60
|
+
descriptionMultiple: messages.unsyncConfirmModalDescriptionMultipleNew,
|
|
61
|
+
confirmButtonLabel: messages.deleteConfirmationModalUnsyncButton
|
|
62
|
+
}
|
|
63
|
+
};
|
|
40
64
|
var styles = {
|
|
41
65
|
spinner: "_1mou1wug _195g1wug"
|
|
42
66
|
};
|
|
@@ -210,7 +234,7 @@ export var DeleteConfirmationModal = function DeleteConfirmationModal(_ref) {
|
|
|
210
234
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
211
235
|
size: "large"
|
|
212
236
|
})) : /*#__PURE__*/React.createElement(ModalContent, {
|
|
213
|
-
content: modalContentMap[deleteReason],
|
|
237
|
+
content: fg('platform_synced_block_patch_8') ? modalContentMap[deleteReason] : modalContentMapOld[deleteReason],
|
|
214
238
|
referenceCount: referenceCount,
|
|
215
239
|
handleClick: handleClick,
|
|
216
240
|
formatMessage: formatMessage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.44",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^52.4.0",
|
|
32
|
-
"@atlaskit/button": "23.10.
|
|
33
|
-
"@atlaskit/dropdown-menu": "16.8.
|
|
32
|
+
"@atlaskit/button": "23.10.9",
|
|
33
|
+
"@atlaskit/dropdown-menu": "16.8.5",
|
|
34
34
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^8.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-block-menu": "^7.0.0",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"@atlaskit/editor-synced-block-provider": "^4.3.0",
|
|
47
47
|
"@atlaskit/editor-toolbar": "^0.20.0",
|
|
48
48
|
"@atlaskit/flag": "^17.9.0",
|
|
49
|
-
"@atlaskit/icon": "34.0.
|
|
50
|
-
"@atlaskit/icon-lab": "^6.
|
|
49
|
+
"@atlaskit/icon": "34.0.1",
|
|
50
|
+
"@atlaskit/icon-lab": "^6.3.0",
|
|
51
51
|
"@atlaskit/logo": "^19.10.0",
|
|
52
52
|
"@atlaskit/lozenge": "^13.5.0",
|
|
53
53
|
"@atlaskit/modal-dialog": "^14.14.0",
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
55
|
"@atlaskit/primitives": "^18.1.0",
|
|
56
56
|
"@atlaskit/spinner": "19.0.13",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^54.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^54.1.0",
|
|
58
58
|
"@atlaskit/tokens": "11.4.2",
|
|
59
59
|
"@atlaskit/tooltip": "^21.1.0",
|
|
60
60
|
"@atlaskit/visually-hidden": "^3.0.0",
|