@atlaskit/editor-plugin-synced-block 6.0.22 → 6.0.23
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 +8 -0
- package/dist/cjs/pm-plugins/main.js +17 -4
- package/dist/es2019/pm-plugins/main.js +12 -0
- package/dist/esm/pm-plugins/main.js +17 -4
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 6.0.23
|
|
4
|
+
|
|
5
|
+
### Patch 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
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 6.0.22
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -18,6 +18,7 @@ var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
|
18
18
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
19
19
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
20
20
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
22
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
23
|
var _bodiedSyncedBlock = require("../nodeviews/bodiedSyncedBlock");
|
|
23
24
|
var _syncedBlock = require("../nodeviews/syncedBlock");
|
|
@@ -246,14 +247,26 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
246
247
|
var unpublishedFlagShown = ctx.unpublishedFlagShown;
|
|
247
248
|
var extensionFlagShown = ctx.extensionFlagShown;
|
|
248
249
|
|
|
250
|
+
// Update plugin state post-flush to sync hasUnsavedBodiedSyncBlockChanges.
|
|
251
|
+
// It prevents false "Changes may not be saved" warnings when publishing
|
|
252
|
+
// Classic pages with sync blocks.
|
|
253
|
+
(0, _platformFeatureFlags.fg)('platform_synced_block_patch_7') && syncBlockStore.sourceManager.registerFlushCompletionCallback(function () {
|
|
254
|
+
(0, _utils2.deferDispatch)(function () {
|
|
255
|
+
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
|
256
|
+
var tr = _ref7.tr;
|
|
257
|
+
return tr;
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
249
262
|
// Set up callback to detect unpublished sync blocks when they're fetched
|
|
250
263
|
syncBlockStore.referenceManager.setOnUnpublishedSyncBlockDetected(function (resourceId) {
|
|
251
264
|
// Only show the flag once per sync block
|
|
252
265
|
if (!unpublishedFlagShown.has(resourceId)) {
|
|
253
266
|
unpublishedFlagShown.add(resourceId);
|
|
254
267
|
(0, _utils2.deferDispatch)(function () {
|
|
255
|
-
api === null || api === void 0 || api.core.actions.execute(function (
|
|
256
|
-
var tr =
|
|
268
|
+
api === null || api === void 0 || api.core.actions.execute(function (_ref8) {
|
|
269
|
+
var tr = _ref8.tr;
|
|
257
270
|
return tr.setMeta(syncedBlockPluginKey, {
|
|
258
271
|
activeFlag: {
|
|
259
272
|
id: _types.FLAG_ID.UNPUBLISHED_SYNC_BLOCK_PASTED
|
|
@@ -410,8 +423,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
410
423
|
return false;
|
|
411
424
|
}
|
|
412
425
|
},
|
|
413
|
-
transformCopied: function transformCopied(slice,
|
|
414
|
-
var state =
|
|
426
|
+
transformCopied: function transformCopied(slice, _ref9) {
|
|
427
|
+
var state = _ref9.state;
|
|
415
428
|
var pluginState = syncedBlockPluginKey.getState(state);
|
|
416
429
|
var syncBlockStore = pluginState === null || pluginState === void 0 ? void 0 : pluginState.syncBlockStore;
|
|
417
430
|
var schema = state.schema;
|
|
@@ -8,6 +8,7 @@ import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
|
8
8
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
10
10
|
import { convertPMNodesToSyncBlockNodes, rebaseTransaction } from '@atlaskit/editor-synced-block-provider';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
13
|
import { bodiedSyncBlockNodeView, bodiedSyncBlockNodeViewOld } from '../nodeviews/bodiedSyncedBlock';
|
|
13
14
|
import { SyncBlock as SyncBlockView } from '../nodeviews/syncedBlock';
|
|
@@ -211,6 +212,17 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
211
212
|
const unpublishedFlagShown = ctx.unpublishedFlagShown;
|
|
212
213
|
const extensionFlagShown = ctx.extensionFlagShown;
|
|
213
214
|
|
|
215
|
+
// Update plugin state post-flush to sync hasUnsavedBodiedSyncBlockChanges.
|
|
216
|
+
// It prevents false "Changes may not be saved" warnings when publishing
|
|
217
|
+
// Classic pages with sync blocks.
|
|
218
|
+
fg('platform_synced_block_patch_7') && syncBlockStore.sourceManager.registerFlushCompletionCallback(() => {
|
|
219
|
+
deferDispatch(() => {
|
|
220
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(({
|
|
221
|
+
tr
|
|
222
|
+
}) => tr);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
214
226
|
// Set up callback to detect unpublished sync blocks when they're fetched
|
|
215
227
|
syncBlockStore.referenceManager.setOnUnpublishedSyncBlockDetected(resourceId => {
|
|
216
228
|
// Only show the flag once per sync block
|
|
@@ -16,6 +16,7 @@ import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
|
16
16
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
17
17
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
18
18
|
import { convertPMNodesToSyncBlockNodes, rebaseTransaction } from '@atlaskit/editor-synced-block-provider';
|
|
19
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
21
|
import { bodiedSyncBlockNodeView, bodiedSyncBlockNodeViewOld } from '../nodeviews/bodiedSyncedBlock';
|
|
21
22
|
import { SyncBlock as SyncBlockView } from '../nodeviews/syncedBlock';
|
|
@@ -239,14 +240,26 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
239
240
|
var unpublishedFlagShown = ctx.unpublishedFlagShown;
|
|
240
241
|
var extensionFlagShown = ctx.extensionFlagShown;
|
|
241
242
|
|
|
243
|
+
// Update plugin state post-flush to sync hasUnsavedBodiedSyncBlockChanges.
|
|
244
|
+
// It prevents false "Changes may not be saved" warnings when publishing
|
|
245
|
+
// Classic pages with sync blocks.
|
|
246
|
+
fg('platform_synced_block_patch_7') && syncBlockStore.sourceManager.registerFlushCompletionCallback(function () {
|
|
247
|
+
deferDispatch(function () {
|
|
248
|
+
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
|
249
|
+
var tr = _ref7.tr;
|
|
250
|
+
return tr;
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
|
|
242
255
|
// Set up callback to detect unpublished sync blocks when they're fetched
|
|
243
256
|
syncBlockStore.referenceManager.setOnUnpublishedSyncBlockDetected(function (resourceId) {
|
|
244
257
|
// Only show the flag once per sync block
|
|
245
258
|
if (!unpublishedFlagShown.has(resourceId)) {
|
|
246
259
|
unpublishedFlagShown.add(resourceId);
|
|
247
260
|
deferDispatch(function () {
|
|
248
|
-
api === null || api === void 0 || api.core.actions.execute(function (
|
|
249
|
-
var tr =
|
|
261
|
+
api === null || api === void 0 || api.core.actions.execute(function (_ref8) {
|
|
262
|
+
var tr = _ref8.tr;
|
|
250
263
|
return tr.setMeta(syncedBlockPluginKey, {
|
|
251
264
|
activeFlag: {
|
|
252
265
|
id: FLAG_ID.UNPUBLISHED_SYNC_BLOCK_PASTED
|
|
@@ -403,8 +416,8 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
403
416
|
return false;
|
|
404
417
|
}
|
|
405
418
|
},
|
|
406
|
-
transformCopied: function transformCopied(slice,
|
|
407
|
-
var state =
|
|
419
|
+
transformCopied: function transformCopied(slice, _ref9) {
|
|
420
|
+
var state = _ref9.state;
|
|
408
421
|
var pluginState = syncedBlockPluginKey.getState(state);
|
|
409
422
|
var syncBlockStore = pluginState === null || pluginState === void 0 ? void 0 : pluginState.syncBlockStore;
|
|
410
423
|
var schema = state.schema;
|
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.23",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^52.4.0",
|
|
32
32
|
"@atlaskit/button": "23.10.4",
|
|
33
|
-
"@atlaskit/dropdown-menu": "16.
|
|
33
|
+
"@atlaskit/dropdown-menu": "16.8.0",
|
|
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",
|
|
@@ -43,18 +43,18 @@
|
|
|
43
43
|
"@atlaskit/editor-plugin-user-intent": "^6.0.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
46
|
-
"@atlaskit/editor-synced-block-provider": "^4.
|
|
46
|
+
"@atlaskit/editor-synced-block-provider": "^4.2.0",
|
|
47
47
|
"@atlaskit/editor-toolbar": "^0.20.0",
|
|
48
48
|
"@atlaskit/flag": "^17.8.0",
|
|
49
|
-
"@atlaskit/icon": "33.0.
|
|
50
|
-
"@atlaskit/icon-lab": "^6.
|
|
49
|
+
"@atlaskit/icon": "33.0.2",
|
|
50
|
+
"@atlaskit/icon-lab": "^6.1.0",
|
|
51
51
|
"@atlaskit/logo": "^19.10.0",
|
|
52
52
|
"@atlaskit/lozenge": "^13.5.0",
|
|
53
|
-
"@atlaskit/modal-dialog": "^14.
|
|
53
|
+
"@atlaskit/modal-dialog": "^14.12.0",
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
55
|
"@atlaskit/primitives": "^18.0.0",
|
|
56
56
|
"@atlaskit/spinner": "19.0.11",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^45.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^45.1.0",
|
|
58
58
|
"@atlaskit/tokens": "11.2.0",
|
|
59
59
|
"@atlaskit/tooltip": "^21.0.0",
|
|
60
60
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@atlaskit/editor-common": "^112.
|
|
68
|
+
"@atlaskit/editor-common": "^112.9.0",
|
|
69
69
|
"react": "^18.2.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
@@ -119,6 +119,9 @@
|
|
|
119
119
|
},
|
|
120
120
|
"platform_editor_block_menu_divider_patch": {
|
|
121
121
|
"type": "boolean"
|
|
122
|
+
},
|
|
123
|
+
"platform_synced_block_patch_7": {
|
|
124
|
+
"type": "boolean"
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
}
|