@atlaskit/editor-plugin-synced-block 8.1.0 → 8.1.2
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 +12 -0
- package/dist/cjs/editor-actions/index.js +1 -4
- package/dist/cjs/pm-plugins/main.js +0 -11
- package/dist/cjs/syncedBlockPlugin.js +0 -3
- package/dist/es2019/editor-actions/index.js +0 -3
- package/dist/es2019/pm-plugins/main.js +0 -11
- package/dist/es2019/syncedBlockPlugin.js +1 -4
- package/dist/esm/editor-actions/index.js +0 -3
- package/dist/esm/pm-plugins/main.js +0 -11
- package/dist/esm/syncedBlockPlugin.js +1 -4
- package/dist/types/editor-actions/index.d.ts +0 -1
- package/dist/types/syncedBlockPluginType.d.ts +0 -8
- package/dist/types-ts4.5/editor-actions/index.d.ts +0 -1
- package/dist/types-ts4.5/syncedBlockPluginType.d.ts +0 -8
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.flushSyncBlocks = exports.flushBodiedSyncBlocks =
|
|
6
|
+
exports.flushSyncBlocks = exports.flushBodiedSyncBlocks = void 0;
|
|
7
7
|
var flushBodiedSyncBlocks = exports.flushBodiedSyncBlocks = function flushBodiedSyncBlocks(syncBlockStore) {
|
|
8
8
|
return syncBlockStore.sourceManager.flush();
|
|
9
9
|
};
|
|
10
10
|
var flushSyncBlocks = exports.flushSyncBlocks = function flushSyncBlocks(syncBlockStore) {
|
|
11
11
|
return syncBlockStore.referenceManager.flush();
|
|
12
|
-
};
|
|
13
|
-
var discardUnpublishedSyncBlocks = exports.discardUnpublishedSyncBlocks = function discardUnpublishedSyncBlocks(syncBlockStore) {
|
|
14
|
-
return syncBlockStore.sourceManager.discardUnpublishedBlocks();
|
|
15
12
|
};
|
|
@@ -290,11 +290,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
290
290
|
syncBlockStore.sourceManager.updateSyncBlockData(node, false);
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
|
-
|
|
294
|
-
// Fetch statuses from the backend so we can identify unpublished blocks on cancel
|
|
295
|
-
if ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_10')) {
|
|
296
|
-
syncBlockStore.sourceManager.fetchAndCacheStatuses();
|
|
297
|
-
}
|
|
298
293
|
}
|
|
299
294
|
return {
|
|
300
295
|
selectionDecorationSet: (0, _selectionDecorations.calculateDecorations)(instance.doc, instance.selection, instance.schema),
|
|
@@ -513,12 +508,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
513
508
|
syncBlockStore.sourceManager.updateSyncBlockData(nodeInfo.node, tr.getMeta('isRemote'));
|
|
514
509
|
}
|
|
515
510
|
});
|
|
516
|
-
|
|
517
|
-
// Fetch statuses for remotely-added source sync blocks
|
|
518
|
-
// so we can identify unpublished blocks on cancel
|
|
519
|
-
if (sourceSyncBlockNodes.length > 0 && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_10')) {
|
|
520
|
-
syncBlockStore.sourceManager.fetchAndCacheStatuses();
|
|
521
|
-
}
|
|
522
511
|
var syncBlockNodes = referenceSyncBlockNodes.map(function (nodeInfo) {
|
|
523
512
|
return nodeInfo.node;
|
|
524
513
|
}).filter(function (node) {
|
|
@@ -90,9 +90,6 @@ var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_
|
|
|
90
90
|
},
|
|
91
91
|
flushSyncedBlocks: function flushSyncedBlocks() {
|
|
92
92
|
return (0, _editorActions.flushSyncBlocks)(syncBlockStore);
|
|
93
|
-
},
|
|
94
|
-
discardUnpublishedSyncBlocks: function discardUnpublishedSyncBlocks() {
|
|
95
|
-
return (0, _editorActions.discardUnpublishedSyncBlocks)(syncBlockStore);
|
|
96
93
|
}
|
|
97
94
|
},
|
|
98
95
|
pluginsOptions: {
|
|
@@ -3,7 +3,4 @@ export const flushBodiedSyncBlocks = syncBlockStore => {
|
|
|
3
3
|
};
|
|
4
4
|
export const flushSyncBlocks = syncBlockStore => {
|
|
5
5
|
return syncBlockStore.referenceManager.flush();
|
|
6
|
-
};
|
|
7
|
-
export const discardUnpublishedSyncBlocks = syncBlockStore => {
|
|
8
|
-
return syncBlockStore.sourceManager.discardUnpublishedBlocks();
|
|
9
6
|
};
|
|
@@ -257,11 +257,6 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
257
257
|
syncBlockStore.sourceManager.updateSyncBlockData(node, false);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
-
|
|
261
|
-
// Fetch statuses from the backend so we can identify unpublished blocks on cancel
|
|
262
|
-
if (fg('platform_synced_block_patch_10')) {
|
|
263
|
-
syncBlockStore.sourceManager.fetchAndCacheStatuses();
|
|
264
|
-
}
|
|
265
260
|
}
|
|
266
261
|
return {
|
|
267
262
|
selectionDecorationSet: calculateDecorations(instance.doc, instance.selection, instance.schema),
|
|
@@ -479,12 +474,6 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
479
474
|
syncBlockStore.sourceManager.updateSyncBlockData(nodeInfo.node, tr.getMeta('isRemote'));
|
|
480
475
|
}
|
|
481
476
|
});
|
|
482
|
-
|
|
483
|
-
// Fetch statuses for remotely-added source sync blocks
|
|
484
|
-
// so we can identify unpublished blocks on cancel
|
|
485
|
-
if (sourceSyncBlockNodes.length > 0 && fg('platform_synced_block_patch_10')) {
|
|
486
|
-
syncBlockStore.sourceManager.fetchAndCacheStatuses();
|
|
487
|
-
}
|
|
488
477
|
const syncBlockNodes = referenceSyncBlockNodes.map(nodeInfo => nodeInfo.node).filter(node => node !== undefined);
|
|
489
478
|
syncBlockStore.referenceManager.fetchSyncBlocksData(convertPMNodesToSyncBlockNodes(syncBlockNodes));
|
|
490
479
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { syncBlock, bodiedSyncBlock } from '@atlaskit/adf-schema';
|
|
3
3
|
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import { flushBodiedSyncBlocks, flushSyncBlocks
|
|
5
|
+
import { flushBodiedSyncBlocks, flushSyncBlocks } from './editor-actions';
|
|
6
6
|
import { copySyncedBlockReferenceToClipboardEditorCommand, createSyncedBlock } from './editor-commands';
|
|
7
7
|
import { bodiedSyncBlockNodeWithToDOMFixed } from './nodeviews/bodiedSyncBlockNodeWithToDOMFixed';
|
|
8
8
|
import { createPlugin, syncedBlockPluginKey } from './pm-plugins/main';
|
|
@@ -77,9 +77,6 @@ export const syncedBlockPlugin = ({
|
|
|
77
77
|
},
|
|
78
78
|
flushSyncedBlocks: () => {
|
|
79
79
|
return flushSyncBlocks(syncBlockStore);
|
|
80
|
-
},
|
|
81
|
-
discardUnpublishedSyncBlocks: () => {
|
|
82
|
-
return discardUnpublishedSyncBlocks(syncBlockStore);
|
|
83
80
|
}
|
|
84
81
|
},
|
|
85
82
|
pluginsOptions: {
|
|
@@ -3,7 +3,4 @@ export var flushBodiedSyncBlocks = function flushBodiedSyncBlocks(syncBlockStore
|
|
|
3
3
|
};
|
|
4
4
|
export var flushSyncBlocks = function flushSyncBlocks(syncBlockStore) {
|
|
5
5
|
return syncBlockStore.referenceManager.flush();
|
|
6
|
-
};
|
|
7
|
-
export var discardUnpublishedSyncBlocks = function discardUnpublishedSyncBlocks(syncBlockStore) {
|
|
8
|
-
return syncBlockStore.sourceManager.discardUnpublishedBlocks();
|
|
9
6
|
};
|
|
@@ -283,11 +283,6 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
283
283
|
syncBlockStore.sourceManager.updateSyncBlockData(node, false);
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
|
-
|
|
287
|
-
// Fetch statuses from the backend so we can identify unpublished blocks on cancel
|
|
288
|
-
if (fg('platform_synced_block_patch_10')) {
|
|
289
|
-
syncBlockStore.sourceManager.fetchAndCacheStatuses();
|
|
290
|
-
}
|
|
291
286
|
}
|
|
292
287
|
return {
|
|
293
288
|
selectionDecorationSet: calculateDecorations(instance.doc, instance.selection, instance.schema),
|
|
@@ -506,12 +501,6 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
506
501
|
syncBlockStore.sourceManager.updateSyncBlockData(nodeInfo.node, tr.getMeta('isRemote'));
|
|
507
502
|
}
|
|
508
503
|
});
|
|
509
|
-
|
|
510
|
-
// Fetch statuses for remotely-added source sync blocks
|
|
511
|
-
// so we can identify unpublished blocks on cancel
|
|
512
|
-
if (sourceSyncBlockNodes.length > 0 && fg('platform_synced_block_patch_10')) {
|
|
513
|
-
syncBlockStore.sourceManager.fetchAndCacheStatuses();
|
|
514
|
-
}
|
|
515
504
|
var syncBlockNodes = referenceSyncBlockNodes.map(function (nodeInfo) {
|
|
516
505
|
return nodeInfo.node;
|
|
517
506
|
}).filter(function (node) {
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { syncBlock, bodiedSyncBlock } from '@atlaskit/adf-schema';
|
|
3
3
|
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import { flushBodiedSyncBlocks as _flushBodiedSyncBlocks, flushSyncBlocks
|
|
5
|
+
import { flushBodiedSyncBlocks as _flushBodiedSyncBlocks, flushSyncBlocks } from './editor-actions';
|
|
6
6
|
import { copySyncedBlockReferenceToClipboardEditorCommand, createSyncedBlock } from './editor-commands';
|
|
7
7
|
import { bodiedSyncBlockNodeWithToDOMFixed } from './nodeviews/bodiedSyncBlockNodeWithToDOMFixed';
|
|
8
8
|
import { createPlugin, syncedBlockPluginKey } from './pm-plugins/main';
|
|
@@ -83,9 +83,6 @@ export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
|
|
|
83
83
|
},
|
|
84
84
|
flushSyncedBlocks: function flushSyncedBlocks() {
|
|
85
85
|
return flushSyncBlocks(syncBlockStore);
|
|
86
|
-
},
|
|
87
|
-
discardUnpublishedSyncBlocks: function discardUnpublishedSyncBlocks() {
|
|
88
|
-
return _discardUnpublishedSyncBlocks(syncBlockStore);
|
|
89
86
|
}
|
|
90
87
|
},
|
|
91
88
|
pluginsOptions: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
2
2
|
export declare const flushBodiedSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
|
|
3
3
|
export declare const flushSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
|
|
4
|
-
export declare const discardUnpublishedSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
|
|
@@ -74,14 +74,6 @@ export type SyncedBlockPlugin = NextEditorPlugin<'syncedBlock', {
|
|
|
74
74
|
* @returns true if flushing all syncBlocks successfully, false otherwise
|
|
75
75
|
*/
|
|
76
76
|
flushSyncedBlocks: () => Promise<boolean>;
|
|
77
|
-
/**
|
|
78
|
-
* Delete all source sync blocks with 'unpublished' status.
|
|
79
|
-
* Used to clean up orphaned blocks when a user cancels editing
|
|
80
|
-
* without saving.
|
|
81
|
-
*
|
|
82
|
-
* @returns true if all deletions succeeded, false otherwise
|
|
83
|
-
*/
|
|
84
|
-
discardUnpublishedSyncBlocks: () => Promise<boolean>;
|
|
85
77
|
};
|
|
86
78
|
commands: {
|
|
87
79
|
copySyncedBlockReferenceToClipboard: (inputMethod: INPUT_METHOD) => EditorCommand;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
2
2
|
export declare const flushBodiedSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
|
|
3
3
|
export declare const flushSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
|
|
4
|
-
export declare const discardUnpublishedSyncBlocks: (syncBlockStore: SyncBlockStoreManager) => Promise<boolean>;
|
|
@@ -74,14 +74,6 @@ export type SyncedBlockPlugin = NextEditorPlugin<'syncedBlock', {
|
|
|
74
74
|
* @returns true if flushing all syncBlocks successfully, false otherwise
|
|
75
75
|
*/
|
|
76
76
|
flushSyncedBlocks: () => Promise<boolean>;
|
|
77
|
-
/**
|
|
78
|
-
* Delete all source sync blocks with 'unpublished' status.
|
|
79
|
-
* Used to clean up orphaned blocks when a user cancels editing
|
|
80
|
-
* without saving.
|
|
81
|
-
*
|
|
82
|
-
* @returns true if all deletions succeeded, false otherwise
|
|
83
|
-
*/
|
|
84
|
-
discardUnpublishedSyncBlocks: () => Promise<boolean>;
|
|
85
77
|
};
|
|
86
78
|
commands: {
|
|
87
79
|
copySyncedBlockReferenceToClipboard: (inputMethod: INPUT_METHOD) => EditorCommand;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^52.
|
|
31
|
+
"@atlaskit/adf-schema": "^52.7.0",
|
|
32
32
|
"@atlaskit/button": "23.11.3",
|
|
33
33
|
"@atlaskit/dropdown-menu": "16.8.9",
|
|
34
34
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
55
|
"@atlaskit/primitives": "^19.0.0",
|
|
56
56
|
"@atlaskit/spinner": "19.1.2",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^74.0.0",
|
|
58
58
|
"@atlaskit/tokens": "13.0.2",
|
|
59
59
|
"@atlaskit/tooltip": "^21.2.0",
|
|
60
60
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"date-fns": "^2.17.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@atlaskit/editor-common": "^114.
|
|
67
|
+
"@atlaskit/editor-common": "^114.15.0",
|
|
68
68
|
"react": "^18.2.0",
|
|
69
69
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
70
70
|
},
|