@atlaskit/editor-plugin-synced-block 4.7.1 → 4.8.1
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,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 4.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`36f3146f35457`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36f3146f35457) -
|
|
8
|
+
Early return on transformCopied when action is not copy
|
|
9
|
+
|
|
10
|
+
## 4.8.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`f68624ad1f930`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f68624ad1f930) -
|
|
15
|
+
Do not show copied flag on drag and drop
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 4.7.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -48,6 +48,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
48
48
|
var confirmationTransactionRef = {
|
|
49
49
|
current: undefined
|
|
50
50
|
};
|
|
51
|
+
// Track if a copy event occurred to distinguish copy from drag and drop
|
|
52
|
+
var isCopyEvent = false;
|
|
51
53
|
return new _safePlugin.SafePlugin({
|
|
52
54
|
key: syncedBlockPluginKey,
|
|
53
55
|
state: {
|
|
@@ -126,6 +128,10 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
126
128
|
},
|
|
127
129
|
mousedown: function mousedown(view, event) {
|
|
128
130
|
return (0, _ignoreDomEvent.shouldIgnoreDomEvent)(view, event, api);
|
|
131
|
+
},
|
|
132
|
+
copy: function copy() {
|
|
133
|
+
isCopyEvent = true;
|
|
134
|
+
return false;
|
|
129
135
|
}
|
|
130
136
|
},
|
|
131
137
|
transformCopied: function transformCopied(slice, _ref3) {
|
|
@@ -133,7 +139,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
|
|
|
133
139
|
var pluginState = syncedBlockPluginKey.getState(state);
|
|
134
140
|
var syncBlockStore = pluginState === null || pluginState === void 0 ? void 0 : pluginState.syncBlockStore;
|
|
135
141
|
var schema = state.schema;
|
|
136
|
-
|
|
142
|
+
var isCopy = isCopyEvent;
|
|
143
|
+
isCopyEvent = false;
|
|
144
|
+
if (!syncBlockStore || !isCopy) {
|
|
137
145
|
return slice;
|
|
138
146
|
}
|
|
139
147
|
return (0, _utils.mapSlice)(slice, function (node) {
|
|
@@ -36,6 +36,8 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
36
36
|
const confirmationTransactionRef = {
|
|
37
37
|
current: undefined
|
|
38
38
|
};
|
|
39
|
+
// Track if a copy event occurred to distinguish copy from drag and drop
|
|
40
|
+
let isCopyEvent = false;
|
|
39
41
|
return new SafePlugin({
|
|
40
42
|
key: syncedBlockPluginKey,
|
|
41
43
|
state: {
|
|
@@ -114,6 +116,10 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
114
116
|
},
|
|
115
117
|
mousedown(view, event) {
|
|
116
118
|
return shouldIgnoreDomEvent(view, event, api);
|
|
119
|
+
},
|
|
120
|
+
copy: () => {
|
|
121
|
+
isCopyEvent = true;
|
|
122
|
+
return false;
|
|
117
123
|
}
|
|
118
124
|
},
|
|
119
125
|
transformCopied: (slice, {
|
|
@@ -124,7 +130,9 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
|
|
|
124
130
|
const {
|
|
125
131
|
schema
|
|
126
132
|
} = state;
|
|
127
|
-
|
|
133
|
+
const isCopy = isCopyEvent;
|
|
134
|
+
isCopyEvent = false;
|
|
135
|
+
if (!syncBlockStore || !isCopy) {
|
|
128
136
|
return slice;
|
|
129
137
|
}
|
|
130
138
|
return mapSlice(slice, node => {
|
|
@@ -41,6 +41,8 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
41
41
|
var confirmationTransactionRef = {
|
|
42
42
|
current: undefined
|
|
43
43
|
};
|
|
44
|
+
// Track if a copy event occurred to distinguish copy from drag and drop
|
|
45
|
+
var isCopyEvent = false;
|
|
44
46
|
return new SafePlugin({
|
|
45
47
|
key: syncedBlockPluginKey,
|
|
46
48
|
state: {
|
|
@@ -119,6 +121,10 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
119
121
|
},
|
|
120
122
|
mousedown: function mousedown(view, event) {
|
|
121
123
|
return shouldIgnoreDomEvent(view, event, api);
|
|
124
|
+
},
|
|
125
|
+
copy: function copy() {
|
|
126
|
+
isCopyEvent = true;
|
|
127
|
+
return false;
|
|
122
128
|
}
|
|
123
129
|
},
|
|
124
130
|
transformCopied: function transformCopied(slice, _ref3) {
|
|
@@ -126,7 +132,9 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
126
132
|
var pluginState = syncedBlockPluginKey.getState(state);
|
|
127
133
|
var syncBlockStore = pluginState === null || pluginState === void 0 ? void 0 : pluginState.syncBlockStore;
|
|
128
134
|
var schema = state.schema;
|
|
129
|
-
|
|
135
|
+
var isCopy = isCopyEvent;
|
|
136
|
+
isCopyEvent = false;
|
|
137
|
+
if (!syncBlockStore || !isCopy) {
|
|
130
138
|
return slice;
|
|
131
139
|
}
|
|
132
140
|
return mapSlice(slice, function (node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.1",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-selection": "^6.1.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
42
|
-
"@atlaskit/editor-synced-block-provider": "^2.
|
|
42
|
+
"@atlaskit/editor-synced-block-provider": "^2.16.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
44
44
|
"@atlaskit/editor-toolbar": "^0.18.0",
|
|
45
45
|
"@atlaskit/flag": "^17.7.0",
|
|
46
46
|
"@atlaskit/icon": "29.3.1",
|
|
47
47
|
"@atlaskit/icon-lab": "^5.13.0",
|
|
48
|
-
"@atlaskit/lozenge": "^13.
|
|
48
|
+
"@atlaskit/lozenge": "^13.3.0",
|
|
49
49
|
"@atlaskit/modal-dialog": "^14.9.0",
|
|
50
50
|
"@atlaskit/primitives": "^17.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^16.2.0",
|
|
52
52
|
"@atlaskit/tokens": "9.0.0",
|
|
53
53
|
"@atlaskit/tooltip": "^20.11.0",
|
|
54
54
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/editor-common": "^110.
|
|
59
|
+
"@atlaskit/editor-common": "^110.49.0",
|
|
60
60
|
"react": "^18.2.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|