@atlaskit/editor-plugin-collab-edit 1.3.1 → 1.3.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
CHANGED
|
@@ -1,231 +1,309 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 1.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#95356](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95356)
|
|
8
|
+
[`33e92aec7cbb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/33e92aec7cbb) -
|
|
9
|
+
MODES-4413: Recursively check for remote transaction due to auto steps added through wrapping
|
|
10
|
+
transaction with appendTransaction
|
|
11
|
+
|
|
3
12
|
## 1.3.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
6
15
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
16
|
+
- [#94901](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94901)
|
|
17
|
+
[`da964fcdc828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da964fcdc828) -
|
|
18
|
+
[ED-23097] Bump ADF schema to version 35.12.1
|
|
19
|
+
- Updated dependencies
|
|
9
20
|
|
|
10
21
|
## 1.3.0
|
|
11
22
|
|
|
12
23
|
### Minor Changes
|
|
13
24
|
|
|
14
|
-
-
|
|
25
|
+
- [#86433](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86433)
|
|
26
|
+
[`88ca3b199a49`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/88ca3b199a49) -
|
|
27
|
+
[ux] EDF-412 Collaborators avatars and telepointer colors are tokenised.
|
|
15
28
|
|
|
16
29
|
### Patch Changes
|
|
17
30
|
|
|
18
|
-
-
|
|
31
|
+
- Updated dependencies
|
|
19
32
|
|
|
20
33
|
## 1.2.1
|
|
21
34
|
|
|
22
35
|
### Patch Changes
|
|
23
36
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
37
|
+
- [#93689](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93689)
|
|
38
|
+
[`5ba5d2b4a9ac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ba5d2b4a9ac) -
|
|
39
|
+
Updating adf-schema version to 35.10.0
|
|
40
|
+
- Updated dependencies
|
|
26
41
|
|
|
27
42
|
## 1.2.0
|
|
28
43
|
|
|
29
44
|
### Minor Changes
|
|
30
45
|
|
|
31
|
-
-
|
|
46
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934)
|
|
47
|
+
[`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) -
|
|
48
|
+
bumped editor-prosemirror version to 4.0.0
|
|
32
49
|
|
|
33
50
|
### Patch Changes
|
|
34
51
|
|
|
35
|
-
-
|
|
52
|
+
- Updated dependencies
|
|
36
53
|
|
|
37
54
|
## 1.1.14
|
|
38
55
|
|
|
39
56
|
### Patch Changes
|
|
40
57
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
58
|
+
- [#92426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92426)
|
|
59
|
+
[`32c76c7c225c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c76c7c225c) -
|
|
60
|
+
Bump adf-schema to 35.9.2 to support table alignment options
|
|
61
|
+
- Updated dependencies
|
|
43
62
|
|
|
44
63
|
## 1.1.13
|
|
45
64
|
|
|
46
65
|
### Patch Changes
|
|
47
66
|
|
|
48
|
-
-
|
|
67
|
+
- Updated dependencies
|
|
49
68
|
|
|
50
69
|
## 1.1.12
|
|
51
70
|
|
|
52
71
|
### Patch Changes
|
|
53
72
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
73
|
+
- [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106)
|
|
74
|
+
[`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) -
|
|
75
|
+
Bump ADF-schema package to version 35.0.0
|
|
76
|
+
- Updated dependencies
|
|
56
77
|
|
|
57
78
|
## 1.1.11
|
|
58
79
|
|
|
59
80
|
### Patch Changes
|
|
60
81
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
82
|
+
- [#86724](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86724)
|
|
83
|
+
[`718a9aa2424d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/718a9aa2424d) -
|
|
84
|
+
[ED-22607] Remove references to maxFrames for multi bodied extensions and bump adf-schema from
|
|
85
|
+
35.7.0 to 35.8.0
|
|
86
|
+
- Updated dependencies
|
|
63
87
|
|
|
64
88
|
## 1.1.10
|
|
65
89
|
|
|
66
90
|
### Patch Changes
|
|
67
91
|
|
|
68
|
-
-
|
|
92
|
+
- [#84283](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84283)
|
|
93
|
+
[`fcc12bc22e37`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fcc12bc22e37) -
|
|
94
|
+
Clean up platform.editor.enable-map-selection-backward FE FF
|
|
69
95
|
|
|
70
96
|
## 1.1.9
|
|
71
97
|
|
|
72
98
|
### Patch Changes
|
|
73
99
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
100
|
+
- [#81777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81777)
|
|
101
|
+
[`c6d7a5378751`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d7a5378751) -
|
|
102
|
+
Bump adf-schema to 35.7.0
|
|
103
|
+
- Updated dependencies
|
|
76
104
|
|
|
77
105
|
## 1.1.8
|
|
78
106
|
|
|
79
107
|
### Patch Changes
|
|
80
108
|
|
|
81
|
-
-
|
|
109
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
|
|
110
|
+
[`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
|
|
111
|
+
Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
82
112
|
|
|
83
113
|
## 1.1.7
|
|
84
114
|
|
|
85
115
|
### Patch Changes
|
|
86
116
|
|
|
87
|
-
-
|
|
117
|
+
- [#82658](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/82658)
|
|
118
|
+
[`9302baf5248c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9302baf5248c) -
|
|
119
|
+
Improve Custom Step registration
|
|
88
120
|
|
|
89
121
|
## 1.1.6
|
|
90
122
|
|
|
91
123
|
### Patch Changes
|
|
92
124
|
|
|
93
|
-
-
|
|
125
|
+
- [#82308](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/82308)
|
|
126
|
+
[`26970b6663ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/26970b6663ae) -
|
|
127
|
+
Register the custom prosemirror within the collab PM plugin
|
|
94
128
|
|
|
95
129
|
## 1.1.5
|
|
96
130
|
|
|
97
131
|
### Patch Changes
|
|
98
132
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
133
|
+
- [#80679](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80679)
|
|
134
|
+
[`104eb9443b7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104eb9443b7e) -
|
|
135
|
+
ED-22553 Updating adf-schema version to 35.6.0
|
|
136
|
+
- Updated dependencies
|
|
101
137
|
|
|
102
138
|
## 1.1.4
|
|
103
139
|
|
|
104
140
|
### Patch Changes
|
|
105
141
|
|
|
106
|
-
-
|
|
142
|
+
- [#75947](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75947)
|
|
143
|
+
[`43549c3789b1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/43549c3789b1) -
|
|
144
|
+
Migrate @atlaskit/editor-core to use declarative entry points
|
|
107
145
|
|
|
108
146
|
## 1.1.3
|
|
109
147
|
|
|
110
148
|
### Patch Changes
|
|
111
149
|
|
|
112
|
-
-
|
|
150
|
+
- [#79350](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/79350)
|
|
151
|
+
[`ba4e64dca012`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ba4e64dca012) -
|
|
152
|
+
Add FF to enable mapSelectionBackward to fix the cursor position
|
|
113
153
|
|
|
114
154
|
## 1.1.2
|
|
115
155
|
|
|
116
156
|
### Patch Changes
|
|
117
157
|
|
|
118
|
-
-
|
|
119
|
-
-
|
|
158
|
+
- [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224)
|
|
159
|
+
[`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) -
|
|
160
|
+
ED-22219: adf-schema updated to 35.5.2
|
|
161
|
+
- Updated dependencies
|
|
120
162
|
|
|
121
163
|
## 1.1.1
|
|
122
164
|
|
|
123
165
|
### Patch Changes
|
|
124
166
|
|
|
125
|
-
-
|
|
167
|
+
- [#74185](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74185)
|
|
168
|
+
[`bdf01577a3b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bdf01577a3b3) -
|
|
169
|
+
Exclude remote changes from firstContentBodyChange field
|
|
126
170
|
|
|
127
171
|
## 1.1.0
|
|
128
172
|
|
|
129
173
|
### Minor Changes
|
|
130
174
|
|
|
131
|
-
-
|
|
175
|
+
- [#72920](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72920)
|
|
176
|
+
[`8fafb6fc0bc6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8fafb6fc0bc6) -
|
|
177
|
+
Add extra field to collabTrackNCSInitializationPlugin which indicates if the document was
|
|
178
|
+
changed excluding inline comments
|
|
132
179
|
|
|
133
180
|
## 1.0.2
|
|
134
181
|
|
|
135
182
|
### Patch Changes
|
|
136
183
|
|
|
137
|
-
-
|
|
184
|
+
- Updated dependencies
|
|
138
185
|
|
|
139
186
|
## 1.0.1
|
|
140
187
|
|
|
141
188
|
### Patch Changes
|
|
142
189
|
|
|
143
|
-
-
|
|
190
|
+
- Updated dependencies
|
|
144
191
|
|
|
145
192
|
## 1.0.0
|
|
146
193
|
|
|
147
194
|
### Major Changes
|
|
148
195
|
|
|
149
|
-
-
|
|
196
|
+
- [#72386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72386)
|
|
197
|
+
[`0c52b0be40c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c52b0be40c1) -
|
|
198
|
+
This changeset exists to bump all editor plugins that currently don't have a major version. This
|
|
199
|
+
is to address an issue with Jira plugin consumption.
|
|
150
200
|
|
|
151
201
|
### Patch Changes
|
|
152
202
|
|
|
153
|
-
-
|
|
203
|
+
- Updated dependencies
|
|
154
204
|
|
|
155
205
|
## 0.1.12
|
|
156
206
|
|
|
157
207
|
### Patch Changes
|
|
158
208
|
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
209
|
+
- [#69825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69825)
|
|
210
|
+
[`e2363da4f6a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2363da4f6a1) -
|
|
211
|
+
[No Issue] Replace View Mode API for annotations
|
|
212
|
+
- [#69825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69825)
|
|
213
|
+
[`e2363da4f6a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2363da4f6a1) -
|
|
214
|
+
[No Issue] Replace View Mode API for annotations
|
|
215
|
+
- [#69825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69825)
|
|
216
|
+
[`e2363da4f6a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2363da4f6a1) -
|
|
217
|
+
[No Issue] Replace View Mode API for annotations
|
|
162
218
|
|
|
163
219
|
## 0.1.11
|
|
164
220
|
|
|
165
221
|
### Patch Changes
|
|
166
222
|
|
|
167
|
-
-
|
|
223
|
+
- [#72026](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72026)
|
|
224
|
+
[`0a0cc061a8a7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0a0cc061a8a7) -
|
|
225
|
+
[No Issue] Improve Confluence Integration tests precision with data-has-collab-initialised
|
|
168
226
|
|
|
169
227
|
## 0.1.10
|
|
170
228
|
|
|
171
229
|
### Patch Changes
|
|
172
230
|
|
|
173
|
-
-
|
|
231
|
+
- [#71133](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71133)
|
|
232
|
+
[`22d7f6ed1f02`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/22d7f6ed1f02) -
|
|
233
|
+
revert prosemirror-collab unfork
|
|
174
234
|
|
|
175
235
|
## 0.1.9
|
|
176
236
|
|
|
177
237
|
### Patch Changes
|
|
178
238
|
|
|
179
|
-
-
|
|
180
|
-
-
|
|
239
|
+
- [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572)
|
|
240
|
+
[`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) -
|
|
241
|
+
Upgrading @atlaskit/editor-prosemirror dependency
|
|
242
|
+
- Updated dependencies
|
|
181
243
|
|
|
182
244
|
## 0.1.8
|
|
183
245
|
|
|
184
246
|
### Patch Changes
|
|
185
247
|
|
|
186
|
-
-
|
|
187
|
-
-
|
|
248
|
+
- [#70152](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70152)
|
|
249
|
+
[`53ed3673df28`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/53ed3673df28) -
|
|
250
|
+
Updating adf-schema version to 35.5.1
|
|
251
|
+
- Updated dependencies
|
|
188
252
|
|
|
189
253
|
## 0.1.7
|
|
190
254
|
|
|
191
255
|
### Patch Changes
|
|
192
256
|
|
|
193
|
-
-
|
|
194
|
-
-
|
|
257
|
+
- [#70084](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70084)
|
|
258
|
+
[`4d651eb93ab5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d651eb93ab5) -
|
|
259
|
+
Add editor-plugin-annotation pr and create shared utils for it in editor-test-helpers
|
|
260
|
+
- Updated dependencies
|
|
195
261
|
|
|
196
262
|
## 0.1.6
|
|
197
263
|
|
|
198
264
|
### Patch Changes
|
|
199
265
|
|
|
200
|
-
-
|
|
266
|
+
- Updated dependencies
|
|
201
267
|
|
|
202
268
|
## 0.1.5
|
|
203
269
|
|
|
204
270
|
### Patch Changes
|
|
205
271
|
|
|
206
|
-
-
|
|
272
|
+
- [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238)
|
|
273
|
+
[`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) -
|
|
274
|
+
[ED-21835] Change EditorAPI type to always union with undefined
|
|
207
275
|
|
|
208
276
|
## 0.1.4
|
|
209
277
|
|
|
210
278
|
### Patch Changes
|
|
211
279
|
|
|
212
|
-
-
|
|
213
|
-
|
|
280
|
+
- [#65788](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65788)
|
|
281
|
+
[`be744e423e9f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/be744e423e9f) -
|
|
282
|
+
ED-21700 Extraction of avatar group plugin
|
|
283
|
+
- [#67194](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67194)
|
|
284
|
+
[`37379761475c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/37379761475c) -
|
|
285
|
+
[ED-21806] Skip changes from NCS and tinted transactions.
|
|
214
286
|
|
|
215
287
|
## 0.1.3
|
|
216
288
|
|
|
217
289
|
### Patch Changes
|
|
218
290
|
|
|
219
|
-
-
|
|
291
|
+
- [#66406](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66406)
|
|
292
|
+
[`10b691d11788`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10b691d11788) -
|
|
293
|
+
[ED-21806] Add collab initialization metadata into shared state
|
|
220
294
|
|
|
221
295
|
## 0.1.2
|
|
222
296
|
|
|
223
297
|
### Patch Changes
|
|
224
298
|
|
|
225
|
-
-
|
|
299
|
+
- [#66119](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66119)
|
|
300
|
+
[`3f87176f284d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f87176f284d) -
|
|
301
|
+
[ED-21806] Refactoring plugin to match NextEditorPlugin standard
|
|
226
302
|
|
|
227
303
|
## 0.1.1
|
|
228
304
|
|
|
229
305
|
### Patch Changes
|
|
230
306
|
|
|
231
|
-
-
|
|
307
|
+
- [#65802](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65802)
|
|
308
|
+
[`438ead060875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/438ead060875) -
|
|
309
|
+
Ensure all editor plugins are marked as singletons
|
|
@@ -11,6 +11,17 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
12
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
13
13
|
var trackNCSInitializationPluginKey = exports.trackNCSInitializationPluginKey = new _state.PluginKey('collabTrackNCSInitializationPlugin');
|
|
14
|
+
var originalTransactionHasMeta = function originalTransactionHasMeta(transaction, metaTag) {
|
|
15
|
+
var hasMetaTag = Boolean(transaction.getMeta(metaTag));
|
|
16
|
+
if (hasMetaTag) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
var appendedTransaction = transaction.getMeta('appendedTransaction');
|
|
20
|
+
if (appendedTransaction instanceof _state.Transaction) {
|
|
21
|
+
return originalTransactionHasMeta(appendedTransaction, metaTag);
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
14
25
|
var createPlugin = exports.createPlugin = function createPlugin() {
|
|
15
26
|
return new _safePlugin.SafePlugin({
|
|
16
27
|
key: trackNCSInitializationPluginKey,
|
|
@@ -34,8 +45,8 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
34
45
|
if (!shouldCheckDocument) {
|
|
35
46
|
return prevPluginState;
|
|
36
47
|
}
|
|
37
|
-
var isRemote =
|
|
38
|
-
var isDocumentReplaceFromRemote = isRemote &&
|
|
48
|
+
var isRemote = originalTransactionHasMeta(transaction, 'isRemote');
|
|
49
|
+
var isDocumentReplaceFromRemote = isRemote && originalTransactionHasMeta(transaction, 'replaceDocument');
|
|
39
50
|
if (isDocumentReplaceFromRemote) {
|
|
40
51
|
return prevPluginState;
|
|
41
52
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { isDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { PluginKey, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
5
|
export const trackNCSInitializationPluginKey = new PluginKey('collabTrackNCSInitializationPlugin');
|
|
6
|
+
const originalTransactionHasMeta = (transaction, metaTag) => {
|
|
7
|
+
const hasMetaTag = Boolean(transaction.getMeta(metaTag));
|
|
8
|
+
if (hasMetaTag) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
const appendedTransaction = transaction.getMeta('appendedTransaction');
|
|
12
|
+
if (appendedTransaction instanceof Transaction) {
|
|
13
|
+
return originalTransactionHasMeta(appendedTransaction, metaTag);
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
};
|
|
6
17
|
export const createPlugin = () => {
|
|
7
18
|
return new SafePlugin({
|
|
8
19
|
key: trackNCSInitializationPluginKey,
|
|
@@ -26,8 +37,8 @@ export const createPlugin = () => {
|
|
|
26
37
|
if (!shouldCheckDocument) {
|
|
27
38
|
return prevPluginState;
|
|
28
39
|
}
|
|
29
|
-
const isRemote =
|
|
30
|
-
const isDocumentReplaceFromRemote = isRemote &&
|
|
40
|
+
const isRemote = originalTransactionHasMeta(transaction, 'isRemote');
|
|
41
|
+
const isDocumentReplaceFromRemote = isRemote && originalTransactionHasMeta(transaction, 'replaceDocument');
|
|
31
42
|
if (isDocumentReplaceFromRemote) {
|
|
32
43
|
return prevPluginState;
|
|
33
44
|
}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { isDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { PluginKey, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
6
6
|
export var trackNCSInitializationPluginKey = new PluginKey('collabTrackNCSInitializationPlugin');
|
|
7
|
+
var originalTransactionHasMeta = function originalTransactionHasMeta(transaction, metaTag) {
|
|
8
|
+
var hasMetaTag = Boolean(transaction.getMeta(metaTag));
|
|
9
|
+
if (hasMetaTag) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
var appendedTransaction = transaction.getMeta('appendedTransaction');
|
|
13
|
+
if (appendedTransaction instanceof Transaction) {
|
|
14
|
+
return originalTransactionHasMeta(appendedTransaction, metaTag);
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
7
18
|
export var createPlugin = function createPlugin() {
|
|
8
19
|
return new SafePlugin({
|
|
9
20
|
key: trackNCSInitializationPluginKey,
|
|
@@ -27,8 +38,8 @@ export var createPlugin = function createPlugin() {
|
|
|
27
38
|
if (!shouldCheckDocument) {
|
|
28
39
|
return prevPluginState;
|
|
29
40
|
}
|
|
30
|
-
var isRemote =
|
|
31
|
-
var isDocumentReplaceFromRemote = isRemote &&
|
|
41
|
+
var isRemote = originalTransactionHasMeta(transaction, 'isRemote');
|
|
42
|
+
var isDocumentReplaceFromRemote = isRemote && originalTransactionHasMeta(transaction, 'replaceDocument');
|
|
32
43
|
if (isDocumentReplaceFromRemote) {
|
|
33
44
|
return prevPluginState;
|
|
34
45
|
}
|