@atlaskit/editor-plugin-synced-block 14.0.19 → 14.0.21
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 +16 -0
- package/dist/cjs/pm-plugins/utils/handle-bodied-sync-block-removal.js +11 -0
- package/dist/cjs/syncedBlockPlugin.js +4 -3
- package/dist/es2019/pm-plugins/utils/handle-bodied-sync-block-removal.js +11 -0
- package/dist/es2019/syncedBlockPlugin.js +2 -1
- package/dist/esm/pm-plugins/utils/handle-bodied-sync-block-removal.js +11 -0
- package/dist/esm/syncedBlockPlugin.js +2 -1
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 14.0.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`83985c2dddc58`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/83985c2dddc58) -
|
|
8
|
+
Fix the block menu staying open after deleting a source synced block via its delete button. The
|
|
9
|
+
delete now closes the block menu once the confirmed deletion lands, behind the
|
|
10
|
+
platform_editor_blocks_patch_10 gate.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 14.0.20
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 14.0.19
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -7,6 +7,7 @@ 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 _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
10
11
|
var _types = require("../../types");
|
|
11
12
|
var _main = require("../main");
|
|
12
13
|
var _recomputeDeleteTransaction = require("./recompute-delete-transaction");
|
|
@@ -73,6 +74,16 @@ var handleBodiedSyncBlockRemoval = exports.handleBodiedSyncBlockRemoval = functi
|
|
|
73
74
|
if (!recomputedTr) {
|
|
74
75
|
return null;
|
|
75
76
|
}
|
|
77
|
+
if ((0, _fg.fg)('platform_editor_blocks_patch_10')) {
|
|
78
|
+
var _api$blockControls;
|
|
79
|
+
// The original transaction's closeMenu meta was rejected along with it above,
|
|
80
|
+
// so re-apply it here to close the block menu once the delete actually lands.
|
|
81
|
+
api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.commands) === null || _api$blockControls === void 0 || _api$blockControls.toggleBlockMenu({
|
|
82
|
+
closeMenu: true
|
|
83
|
+
})({
|
|
84
|
+
tr: recomputedTr
|
|
85
|
+
});
|
|
86
|
+
}
|
|
76
87
|
recomputedTr.setMeta('isConfirmedSyncBlockDeletion', true);
|
|
77
88
|
feedbackCallbacks === null || feedbackCallbacks === void 0 || feedbackCallbacks.onDeleteTransaction(recomputedTr);
|
|
78
89
|
if (!recomputedTr.getMeta(_utils.pmHistoryPluginKey)) {
|
|
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.syncedBlockPlugin = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var
|
|
10
|
+
var _syncBlock = require("@atlaskit/adf-schema/sync-block");
|
|
11
|
+
var _bodiedSyncBlock = require("@atlaskit/adf-schema/bodied-sync-block");
|
|
11
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
13
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
13
14
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
@@ -91,10 +92,10 @@ var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_
|
|
|
91
92
|
nodes: function nodes() {
|
|
92
93
|
return [{
|
|
93
94
|
name: 'syncBlock',
|
|
94
|
-
node:
|
|
95
|
+
node: _syncBlock.syncBlock
|
|
95
96
|
}, {
|
|
96
97
|
name: 'bodiedSyncBlock',
|
|
97
|
-
node:
|
|
98
|
+
node: _bodiedSyncBlock.bodiedSyncBlock
|
|
98
99
|
}];
|
|
99
100
|
},
|
|
100
101
|
pmPlugins: function pmPlugins() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
3
|
import { FLAG_ID } from '../../types';
|
|
3
4
|
import { syncedBlockPluginKey } from '../main';
|
|
4
5
|
import { recomputeDeleteTransaction, recomputeUnsyncTransaction } from './recompute-delete-transaction';
|
|
@@ -55,6 +56,16 @@ export const handleBodiedSyncBlockRemoval = (bodiedSyncBlockRemoved, syncBlockSt
|
|
|
55
56
|
if (!recomputedTr) {
|
|
56
57
|
return null;
|
|
57
58
|
}
|
|
59
|
+
if (fg('platform_editor_blocks_patch_10')) {
|
|
60
|
+
var _api$blockControls, _api$blockControls$co;
|
|
61
|
+
// The original transaction's closeMenu meta was rejected along with it above,
|
|
62
|
+
// so re-apply it here to close the block menu once the delete actually lands.
|
|
63
|
+
api === null || api === void 0 ? void 0 : (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : (_api$blockControls$co = _api$blockControls.commands) === null || _api$blockControls$co === void 0 ? void 0 : _api$blockControls$co.toggleBlockMenu({
|
|
64
|
+
closeMenu: true
|
|
65
|
+
})({
|
|
66
|
+
tr: recomputedTr
|
|
67
|
+
});
|
|
68
|
+
}
|
|
58
69
|
recomputedTr.setMeta('isConfirmedSyncBlockDeletion', true);
|
|
59
70
|
feedbackCallbacks === null || feedbackCallbacks === void 0 ? void 0 : feedbackCallbacks.onDeleteTransaction(recomputedTr);
|
|
60
71
|
if (!recomputedTr.getMeta(pmHistoryPluginKey)) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { syncBlock
|
|
2
|
+
import { syncBlock } from '@atlaskit/adf-schema/sync-block';
|
|
3
|
+
import { bodiedSyncBlock } from '@atlaskit/adf-schema/bodied-sync-block';
|
|
3
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
5
|
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
5
6
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -2,6 +2,7 @@ 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/fg';
|
|
5
6
|
import { FLAG_ID } from '../../types';
|
|
6
7
|
import { syncedBlockPluginKey } from '../main';
|
|
7
8
|
import { recomputeDeleteTransaction, recomputeUnsyncTransaction } from './recompute-delete-transaction';
|
|
@@ -66,6 +67,16 @@ export var handleBodiedSyncBlockRemoval = function handleBodiedSyncBlockRemoval(
|
|
|
66
67
|
if (!recomputedTr) {
|
|
67
68
|
return null;
|
|
68
69
|
}
|
|
70
|
+
if (fg('platform_editor_blocks_patch_10')) {
|
|
71
|
+
var _api$blockControls;
|
|
72
|
+
// The original transaction's closeMenu meta was rejected along with it above,
|
|
73
|
+
// so re-apply it here to close the block menu once the delete actually lands.
|
|
74
|
+
api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.commands) === null || _api$blockControls === void 0 || _api$blockControls.toggleBlockMenu({
|
|
75
|
+
closeMenu: true
|
|
76
|
+
})({
|
|
77
|
+
tr: recomputedTr
|
|
78
|
+
});
|
|
79
|
+
}
|
|
69
80
|
recomputedTr.setMeta('isConfirmedSyncBlockDeletion', true);
|
|
70
81
|
feedbackCallbacks === null || feedbackCallbacks === void 0 || feedbackCallbacks.onDeleteTransaction(recomputedTr);
|
|
71
82
|
if (!recomputedTr.getMeta(pmHistoryPluginKey)) {
|
|
@@ -2,7 +2,8 @@ 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 React from 'react';
|
|
5
|
-
import { syncBlock
|
|
5
|
+
import { syncBlock } from '@atlaskit/adf-schema/sync-block';
|
|
6
|
+
import { bodiedSyncBlock } from '@atlaskit/adf-schema/bodied-sync-block';
|
|
6
7
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
8
|
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
8
9
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.21",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"atlaskit:src": "src/index.ts",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@atlaskit/adf-schema": "^57.2.0",
|
|
24
|
-
"@atlaskit/button": "25.3.
|
|
24
|
+
"@atlaskit/button": "25.3.1",
|
|
25
25
|
"@atlaskit/dropdown-menu": "18.3.0",
|
|
26
26
|
"@atlaskit/editor-json-transformer": "^9.8.0",
|
|
27
27
|
"@atlaskit/editor-plugin-analytics": "^16.1.0",
|
|
28
28
|
"@atlaskit/editor-plugin-block-controls": "^17.3.0",
|
|
29
|
-
"@atlaskit/editor-plugin-block-menu": "^15.
|
|
29
|
+
"@atlaskit/editor-plugin-block-menu": "^15.1.0",
|
|
30
30
|
"@atlaskit/editor-plugin-connectivity": "16.0.0",
|
|
31
31
|
"@atlaskit/editor-plugin-content-format": "^10.0.0",
|
|
32
32
|
"@atlaskit/editor-plugin-decorations": "^16.1.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/editor-plugin-user-intent": "^14.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
42
42
|
"@atlaskit/editor-shared-styles": "^4.1.0",
|
|
43
|
-
"@atlaskit/editor-synced-block-provider": "^12.
|
|
43
|
+
"@atlaskit/editor-synced-block-provider": "^12.2.0",
|
|
44
44
|
"@atlaskit/editor-toolbar": "^2.6.0",
|
|
45
45
|
"@atlaskit/flag": "^18.5.0",
|
|
46
46
|
"@atlaskit/icon": "37.6.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
53
53
|
"@atlaskit/primitives": "^22.5.0",
|
|
54
54
|
"@atlaskit/spinner": "20.4.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^174.0.0",
|
|
56
56
|
"@atlaskit/tokens": "16.11.1",
|
|
57
57
|
"@atlaskit/tooltip": "^24.3.0",
|
|
58
58
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"memoize-one": "^6.0.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@atlaskit/editor-common": "^120.
|
|
67
|
+
"@atlaskit/editor-common": "^120.12.0",
|
|
68
68
|
"react": "^18.2.0 || ^19.2.0",
|
|
69
69
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
70
70
|
},
|
|
@@ -85,6 +85,9 @@
|
|
|
85
85
|
},
|
|
86
86
|
"platform_editor_blocks_patch_9": {
|
|
87
87
|
"type": "boolean"
|
|
88
|
+
},
|
|
89
|
+
"platform_editor_blocks_patch_10": {
|
|
90
|
+
"type": "boolean"
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
}
|