@atlaskit/editor-plugin-synced-block 12.0.8 → 12.0.9
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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 12.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0d9249f213c55`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d9249f213c55) -
|
|
8
|
+
Preserve source block content when unsyncing
|
|
9
|
+
|
|
3
10
|
## 12.0.8
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.handleBodiedSyncBlockRemoval = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _types = require("../../types");
|
|
12
11
|
var _main = require("../main");
|
|
13
12
|
var _recomputeDeleteTransaction = require("./recompute-delete-transaction");
|
|
@@ -59,8 +58,7 @@ var handleBodiedSyncBlockRemoval = exports.handleBodiedSyncBlockRemoval = functi
|
|
|
59
58
|
// the confirm path always recomputed a full delete, so unsyncing a source block
|
|
60
59
|
// silently deleted its content. When the deletion was actually triggered by
|
|
61
60
|
// unsync, recompute an unwrap (replaceWith content) instead of a delete.
|
|
62
|
-
var
|
|
63
|
-
var recomputedTr = isUnsync ? (0, _recomputeDeleteTransaction.recomputeUnsyncTransaction)(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(function (node) {
|
|
61
|
+
var recomputedTr = deletionReason === 'source-block-unsynced' ? (0, _recomputeDeleteTransaction.recomputeUnsyncTransaction)(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(function (node) {
|
|
64
62
|
return node.attrs;
|
|
65
63
|
})) : (0, _recomputeDeleteTransaction.recomputeDeleteTransaction)(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(function (node) {
|
|
66
64
|
return node.attrs;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { FLAG_ID } from '../../types';
|
|
4
3
|
import { syncedBlockPluginKey } from '../main';
|
|
5
4
|
import { recomputeDeleteTransaction, recomputeUnsyncTransaction } from './recompute-delete-transaction';
|
|
@@ -45,8 +44,7 @@ export const handleBodiedSyncBlockRemoval = (bodiedSyncBlockRemoved, syncBlockSt
|
|
|
45
44
|
// the confirm path always recomputed a full delete, so unsyncing a source block
|
|
46
45
|
// silently deleted its content. When the deletion was actually triggered by
|
|
47
46
|
// unsync, recompute an unwrap (replaceWith content) instead of a delete.
|
|
48
|
-
const
|
|
49
|
-
const recomputedTr = isUnsync ? recomputeUnsyncTransaction(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(node => node.attrs)) : recomputeDeleteTransaction(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(node => node.attrs));
|
|
47
|
+
const recomputedTr = deletionReason === 'source-block-unsynced' ? recomputeUnsyncTransaction(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(node => node.attrs)) : recomputeDeleteTransaction(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(node => node.attrs));
|
|
50
48
|
|
|
51
49
|
// The target node(s) no longer exist in the live document (e.g.
|
|
52
50
|
// a remote collaborator already removed them). There is nothing
|
|
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
4
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { FLAG_ID } from '../../types';
|
|
7
6
|
import { syncedBlockPluginKey } from '../main';
|
|
8
7
|
import { recomputeDeleteTransaction, recomputeUnsyncTransaction } from './recompute-delete-transaction';
|
|
@@ -52,8 +51,7 @@ export var handleBodiedSyncBlockRemoval = function handleBodiedSyncBlockRemoval(
|
|
|
52
51
|
// the confirm path always recomputed a full delete, so unsyncing a source block
|
|
53
52
|
// silently deleted its content. When the deletion was actually triggered by
|
|
54
53
|
// unsync, recompute an unwrap (replaceWith content) instead of a delete.
|
|
55
|
-
var
|
|
56
|
-
var recomputedTr = isUnsync ? recomputeUnsyncTransaction(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(function (node) {
|
|
54
|
+
var recomputedTr = deletionReason === 'source-block-unsynced' ? recomputeUnsyncTransaction(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(function (node) {
|
|
57
55
|
return node.attrs;
|
|
58
56
|
})) : recomputeDeleteTransaction(tr, syncBlockStore.sourceManager.isSourceBlock, bodiedSyncBlockRemoved.map(function (node) {
|
|
59
57
|
return node.attrs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.9",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"memoize-one": "^6.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@atlaskit/editor-common": "^118.
|
|
61
|
+
"@atlaskit/editor-common": "^118.7.0",
|
|
62
62
|
"react": "^18.2.0 || ^19.2.0",
|
|
63
63
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
64
64
|
},
|
|
@@ -107,9 +107,6 @@
|
|
|
107
107
|
"confluence_fronend_labels_categorization_migration": {
|
|
108
108
|
"type": "boolean"
|
|
109
109
|
},
|
|
110
|
-
"platform_editor_blocks_patch_6": {
|
|
111
|
-
"type": "boolean"
|
|
112
|
-
},
|
|
113
110
|
"platform_editor_blocks_patch_7": {
|
|
114
111
|
"type": "boolean"
|
|
115
112
|
}
|