@atlaskit/editor-plugin-annotation 1.9.3 → 1.9.4
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/.eslintrc.js +16 -16
- package/CHANGELOG.md +194 -187
- package/LICENSE.md +6 -8
- package/dist/cjs/pm-plugins/plugin-factory.js +42 -2
- package/dist/es2019/pm-plugins/plugin-factory.js +41 -1
- package/dist/esm/pm-plugins/plugin-factory.js +41 -1
- package/dist/types/pm-plugins/plugin-factory.d.ts +8 -1
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +8 -1
- package/package.json +5 -4
package/.eslintrc.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
rules: {
|
|
3
|
+
'@typescript-eslint/no-duplicate-imports': 'error',
|
|
4
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
5
|
+
'@typescript-eslint/ban-types': [
|
|
6
|
+
'error',
|
|
7
|
+
{
|
|
8
|
+
types: {
|
|
9
|
+
'React.FC':
|
|
10
|
+
'Please use types directly on props instead, and explicitly define children if required',
|
|
11
|
+
'React.FunctionalComponent':
|
|
12
|
+
'Please use types directly on props instead, and explicitly define children if required',
|
|
13
|
+
},
|
|
14
|
+
extendDefaults: false,
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
18
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,451 +1,458 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 1.9.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#103164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103164)
|
|
8
|
+
[`2ee6f9d11093`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ee6f9d11093) -
|
|
9
|
+
ED-22554 preserve draft comment when node updated
|
|
10
|
+
|
|
3
11
|
## 1.9.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
6
14
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
15
|
+
- [#102478](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102478)
|
|
16
|
+
[`3378951608b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3378951608b0) -
|
|
17
|
+
[ED-23332] Update adf-schema package to 36.10.1
|
|
18
|
+
- Updated dependencies
|
|
11
19
|
|
|
12
20
|
## 1.9.2
|
|
13
21
|
|
|
14
22
|
### Patch Changes
|
|
15
23
|
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
- [#101524](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101524)
|
|
25
|
+
[`4821570088e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4821570088e6) -
|
|
26
|
+
ED-23362 Bump ADF schema to version 36.8.1 and add support for adf validation and transformation
|
|
19
27
|
|
|
20
28
|
## 1.9.1
|
|
21
29
|
|
|
22
30
|
### Patch Changes
|
|
23
31
|
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
- [#97803](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97803)
|
|
33
|
+
[`4c1023ffb3d8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4c1023ffb3d8) -
|
|
34
|
+
[ED-23094] Ignore annotations on mediaInline node, including highlight styling,
|
|
35
|
+
event(onMouseEnter, onClick) listeners, update active annotations when the node is selected or the
|
|
36
|
+
cursor is right after the node
|
|
29
37
|
|
|
30
38
|
## 1.9.0
|
|
31
39
|
|
|
32
40
|
### Minor Changes
|
|
33
41
|
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
- [#100662](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100662)
|
|
43
|
+
[`3d61cd8f2afe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3d61cd8f2afe) -
|
|
44
|
+
[ED-23355] Update annotation viewed event to with attributes nodeType and method to capture usage
|
|
45
|
+
for comments on media
|
|
38
46
|
|
|
39
47
|
### Patch Changes
|
|
40
48
|
|
|
41
|
-
-
|
|
49
|
+
- Updated dependencies
|
|
42
50
|
|
|
43
51
|
## 1.8.0
|
|
44
52
|
|
|
45
53
|
### Minor Changes
|
|
46
54
|
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
- [#99579](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99579)
|
|
56
|
+
[`f222af5687e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f222af5687e9) -
|
|
57
|
+
Bump adf-schema to 36.3.0 and adf-schema-json to 1.14.0
|
|
50
58
|
|
|
51
59
|
### Patch Changes
|
|
52
60
|
|
|
53
|
-
-
|
|
61
|
+
- Updated dependencies
|
|
54
62
|
|
|
55
63
|
## 1.7.4
|
|
56
64
|
|
|
57
65
|
### Patch Changes
|
|
58
66
|
|
|
59
|
-
-
|
|
67
|
+
- Updated dependencies
|
|
60
68
|
|
|
61
69
|
## 1.7.3
|
|
62
70
|
|
|
63
71
|
### Patch Changes
|
|
64
72
|
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
- [#97599](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97599)
|
|
74
|
+
[`32c3130b08fe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c3130b08fe) -
|
|
75
|
+
[ED-22282] Bump adf-schema to 36.1.0
|
|
68
76
|
|
|
69
77
|
## 1.7.2
|
|
70
78
|
|
|
71
79
|
### Patch Changes
|
|
72
80
|
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- Updated dependencies
|
|
81
|
+
- [#98086](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98086)
|
|
82
|
+
[`c0151fc09063`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c0151fc09063) -
|
|
83
|
+
[ux] Disabled the scroll into view effect which occurs when an annotation is resolved, due to an
|
|
84
|
+
issue which occurs when a collab user resolves a comment. There's currently (due to how
|
|
85
|
+
annotations are built) no way to detect if the resolve action can from a remote or local user. So
|
|
86
|
+
this is a quick fix to unblock live pages from scrolling when a collab users resolves a comment.
|
|
87
|
+
- Updated dependencies
|
|
81
88
|
|
|
82
89
|
## 1.7.1
|
|
83
90
|
|
|
84
91
|
### Patch Changes
|
|
85
92
|
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
- [#97698](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97698)
|
|
94
|
+
[`1c7b378c0d3b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1c7b378c0d3b) -
|
|
95
|
+
[HOT-108999] We had an incident where the cursor jumps back a character in table headers for any
|
|
96
|
+
language triggering composition on an empty line.This was fixed in a patch bump of
|
|
97
|
+
prosemirror-view. https://github.com/ProseMirror/prosemirror-view/compare/1.33.4...1.33.5
|
|
91
98
|
|
|
92
99
|
## 1.7.0
|
|
93
100
|
|
|
94
101
|
### Minor Changes
|
|
95
102
|
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
- [#95168](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95168)
|
|
104
|
+
[`2091e194a817`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2091e194a817) -
|
|
105
|
+
Introduced new PortalProviderAPI behind a FF
|
|
99
106
|
|
|
100
107
|
### Patch Changes
|
|
101
108
|
|
|
102
|
-
-
|
|
109
|
+
- Updated dependencies
|
|
103
110
|
|
|
104
111
|
## 1.6.3
|
|
105
112
|
|
|
106
113
|
### Patch Changes
|
|
107
114
|
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
- [#96237](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96237)
|
|
116
|
+
[`0401e7b5a88e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0401e7b5a88e) -
|
|
117
|
+
[ED-23102] Bump ADF schema to version 35.12.2
|
|
111
118
|
|
|
112
119
|
## 1.6.2
|
|
113
120
|
|
|
114
121
|
### Patch Changes
|
|
115
122
|
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
- [#94901](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94901)
|
|
124
|
+
[`da964fcdc828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da964fcdc828) -
|
|
125
|
+
[ED-23097] Bump ADF schema to version 35.12.1
|
|
119
126
|
|
|
120
127
|
## 1.6.1
|
|
121
128
|
|
|
122
129
|
### Patch Changes
|
|
123
130
|
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
- [#93689](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93689)
|
|
132
|
+
[`5ba5d2b4a9ac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ba5d2b4a9ac) -
|
|
133
|
+
Updating adf-schema version to 35.10.0
|
|
127
134
|
|
|
128
135
|
## 1.6.0
|
|
129
136
|
|
|
130
137
|
### Minor Changes
|
|
131
138
|
|
|
132
|
-
-
|
|
133
|
-
|
|
134
|
-
|
|
139
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934)
|
|
140
|
+
[`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) -
|
|
141
|
+
bumped editor-prosemirror version to 4.0.0
|
|
135
142
|
|
|
136
143
|
### Patch Changes
|
|
137
144
|
|
|
138
|
-
-
|
|
145
|
+
- Updated dependencies
|
|
139
146
|
|
|
140
147
|
## 1.5.11
|
|
141
148
|
|
|
142
149
|
### Patch Changes
|
|
143
150
|
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
- [#92426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92426)
|
|
152
|
+
[`32c76c7c225c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c76c7c225c) -
|
|
153
|
+
Bump adf-schema to 35.9.2 to support table alignment options
|
|
147
154
|
|
|
148
155
|
## 1.5.10
|
|
149
156
|
|
|
150
157
|
### Patch Changes
|
|
151
158
|
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
- [#91909](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91909)
|
|
160
|
+
[`188a4ee3607f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/188a4ee3607f) -
|
|
161
|
+
Add decoration to annotation marks for block elements to help confluence edit mode identify
|
|
162
|
+
comments
|
|
156
163
|
|
|
157
164
|
## 1.5.9
|
|
158
165
|
|
|
159
166
|
### Patch Changes
|
|
160
167
|
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
168
|
+
- [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106)
|
|
169
|
+
[`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) -
|
|
170
|
+
Bump ADF-schema package to version 35.0.0
|
|
171
|
+
- Updated dependencies
|
|
165
172
|
|
|
166
173
|
## 1.5.8
|
|
167
174
|
|
|
168
175
|
### Patch Changes
|
|
169
176
|
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
177
|
+
- [#88763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88763)
|
|
178
|
+
[`9fcd30347b0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9fcd30347b0c) -
|
|
179
|
+
[ux] Removed annotation styling for media in editor and renderer
|
|
180
|
+
- Updated dependencies
|
|
174
181
|
|
|
175
182
|
## 1.5.7
|
|
176
183
|
|
|
177
184
|
### Patch Changes
|
|
178
185
|
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
|
|
186
|
+
- [#87596](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87596)
|
|
187
|
+
[`e0b95c3a4fba`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e0b95c3a4fba) -
|
|
188
|
+
Add new UI badge for media node to trigger comments
|
|
182
189
|
|
|
183
190
|
## 1.5.6
|
|
184
191
|
|
|
185
192
|
### Patch Changes
|
|
186
193
|
|
|
187
|
-
-
|
|
188
|
-
|
|
189
|
-
|
|
194
|
+
- [#87089](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87089)
|
|
195
|
+
[`5d130cbb8277`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5d130cbb8277) -
|
|
196
|
+
Change statsig gates to LD FFs
|
|
190
197
|
|
|
191
198
|
## 1.5.5
|
|
192
199
|
|
|
193
200
|
### Patch Changes
|
|
194
201
|
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
202
|
+
- [#87191](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87191)
|
|
203
|
+
[`f24bc58a479e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f24bc58a479e) -
|
|
204
|
+
Exporting getAllAnnotations function to be used outside the package
|
|
198
205
|
|
|
199
206
|
## 1.5.4
|
|
200
207
|
|
|
201
208
|
### Patch Changes
|
|
202
209
|
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
210
|
+
- [#86724](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86724)
|
|
211
|
+
[`718a9aa2424d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/718a9aa2424d) -
|
|
212
|
+
[ED-22607] Remove references to maxFrames for multi bodied extensions and bump adf-schema from
|
|
213
|
+
35.7.0 to 35.8.0
|
|
207
214
|
|
|
208
215
|
## 1.5.3
|
|
209
216
|
|
|
210
217
|
### Patch Changes
|
|
211
218
|
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
219
|
+
- [#84432](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84432)
|
|
220
|
+
[`19324d1894bb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/19324d1894bb) -
|
|
221
|
+
[ED-22643] Update showInlineCommentForBlockNode so that it can dispatch action to show comment
|
|
222
|
+
view component when there are no active comments associated with the give node
|
|
216
223
|
|
|
217
224
|
## 1.5.2
|
|
218
225
|
|
|
219
226
|
### Patch Changes
|
|
220
227
|
|
|
221
|
-
-
|
|
222
|
-
|
|
223
|
-
|
|
228
|
+
- [#84685](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84685)
|
|
229
|
+
[`8884904b3f36`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8884904b3f36) -
|
|
230
|
+
fix insert annotation analytics to include selectionType and nodeLocation
|
|
224
231
|
|
|
225
232
|
## 1.5.1
|
|
226
233
|
|
|
227
234
|
### Patch Changes
|
|
228
235
|
|
|
229
|
-
-
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
- [#83942](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83942)
|
|
237
|
+
[`210a84148721`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/210a84148721) -
|
|
238
|
+
[ED-22547] Publish draft comment for media node when saving
|
|
232
239
|
|
|
233
240
|
## 1.5.0
|
|
234
241
|
|
|
235
242
|
### Minor Changes
|
|
236
243
|
|
|
237
|
-
-
|
|
238
|
-
|
|
239
|
-
|
|
244
|
+
- [#82581](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/82581)
|
|
245
|
+
[`c1be75ae15b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1be75ae15b6) -
|
|
246
|
+
ED-22606 add toggle inline comment action
|
|
240
247
|
|
|
241
248
|
### Patch Changes
|
|
242
249
|
|
|
243
|
-
-
|
|
244
|
-
|
|
245
|
-
|
|
250
|
+
- [#81777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81777)
|
|
251
|
+
[`c6d7a5378751`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d7a5378751) -
|
|
252
|
+
Bump adf-schema to 35.7.0
|
|
246
253
|
|
|
247
254
|
## 1.4.1
|
|
248
255
|
|
|
249
256
|
### Patch Changes
|
|
250
257
|
|
|
251
|
-
-
|
|
252
|
-
|
|
253
|
-
|
|
258
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
|
|
259
|
+
[`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
|
|
260
|
+
Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
254
261
|
|
|
255
262
|
## 1.4.0
|
|
256
263
|
|
|
257
264
|
### Minor Changes
|
|
258
265
|
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
|
|
266
|
+
- [#81394](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81394)
|
|
267
|
+
[`2798f5546fb7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2798f5546fb7) -
|
|
268
|
+
[ux] ED-22118 implemented annotation style for block node (media)
|
|
262
269
|
|
|
263
270
|
## 1.3.2
|
|
264
271
|
|
|
265
272
|
### Patch Changes
|
|
266
273
|
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
+
- [#79543](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/79543)
|
|
275
|
+
[`8b578f7427a2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b578f7427a2) -
|
|
276
|
+
ED-22502: updated range selection check to exempt inline card, to allow them to have annotation
|
|
277
|
+
marks
|
|
278
|
+
- [#80883](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80883)
|
|
279
|
+
[`5ecfa883d4ba`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ecfa883d4ba) -
|
|
280
|
+
React 18 types for alignment, annotation, avatar-group and blocktype plugins.
|
|
274
281
|
|
|
275
282
|
## 1.3.1
|
|
276
283
|
|
|
277
284
|
### Patch Changes
|
|
278
285
|
|
|
279
|
-
-
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
- [#80679](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80679)
|
|
287
|
+
[`104eb9443b7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104eb9443b7e) -
|
|
288
|
+
ED-22553 Updating adf-schema version to 35.6.0
|
|
282
289
|
|
|
283
290
|
## 1.3.0
|
|
284
291
|
|
|
285
292
|
### Minor Changes
|
|
286
293
|
|
|
287
|
-
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
294
|
+
- [#80123](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80123)
|
|
295
|
+
[`8bb18b4d686c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8bb18b4d686c) -
|
|
296
|
+
[ux] - Add decoration to media node when there is active draft comment associated, update plugin
|
|
297
|
+
state mapping so that create view component is removed when there's node changes invalidating the
|
|
298
|
+
decoration
|
|
292
299
|
|
|
293
|
-
|
|
300
|
+
- Save featureFlags plugin state as one of the annotation plugin state
|
|
294
301
|
|
|
295
302
|
## 1.2.2
|
|
296
303
|
|
|
297
304
|
### Patch Changes
|
|
298
305
|
|
|
299
|
-
-
|
|
300
|
-
|
|
301
|
-
|
|
306
|
+
- [#79658](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/79658)
|
|
307
|
+
[`4b195011d7c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4b195011d7c1) -
|
|
308
|
+
ED-22112 support remove annotation from supported nodes
|
|
302
309
|
|
|
303
310
|
## 1.2.1
|
|
304
311
|
|
|
305
312
|
### Patch Changes
|
|
306
313
|
|
|
307
|
-
-
|
|
308
|
-
|
|
309
|
-
|
|
314
|
+
- [#78577](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78577)
|
|
315
|
+
[`207fbd3685dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/207fbd3685dc) -
|
|
316
|
+
ED-22111 add supported nodes option to annotation plugin
|
|
310
317
|
|
|
311
318
|
## 1.2.0
|
|
312
319
|
|
|
313
320
|
### Minor Changes
|
|
314
321
|
|
|
315
|
-
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
322
|
+
- [#78508](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78508)
|
|
323
|
+
[`1d2b9d7a0542`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1d2b9d7a0542) -
|
|
324
|
+
Expose setInlineCommentDraftState as one of the annotation plugin actions, extend the action with
|
|
325
|
+
the ability to apply comment highlight to node, and add optional plugin dependency,
|
|
326
|
+
FeatureFlagsPlugin
|
|
320
327
|
|
|
321
328
|
## 1.1.0
|
|
322
329
|
|
|
323
330
|
### Minor Changes
|
|
324
331
|
|
|
325
|
-
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
- [#78363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78363)
|
|
333
|
+
[`3a8e207fbf7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3a8e207fbf7c) -
|
|
334
|
+
EDF-27 Cleaned up platform.editor.annotation.decouple-inline-comment-closed_flmox FF. This
|
|
335
|
+
decouples selected annotation logic from logic to close the inline comment view by default. This
|
|
336
|
+
fixed a bug where the inline comment view can be unexpectedly opened from doc changes (through
|
|
337
|
+
remote editors or non-selection altering changes such as expanding / collapsing expand blocks)
|
|
331
338
|
|
|
332
339
|
## 1.0.2
|
|
333
340
|
|
|
334
341
|
### Patch Changes
|
|
335
342
|
|
|
336
|
-
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
-
|
|
343
|
+
- [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224)
|
|
344
|
+
[`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) -
|
|
345
|
+
ED-22219: adf-schema updated to 35.5.2
|
|
346
|
+
- Updated dependencies
|
|
340
347
|
|
|
341
348
|
## 1.0.1
|
|
342
349
|
|
|
343
350
|
### Patch Changes
|
|
344
351
|
|
|
345
|
-
-
|
|
352
|
+
- Updated dependencies
|
|
346
353
|
|
|
347
354
|
## 1.0.0
|
|
348
355
|
|
|
349
356
|
### Major Changes
|
|
350
357
|
|
|
351
|
-
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
358
|
+
- [#72386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72386)
|
|
359
|
+
[`0c52b0be40c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c52b0be40c1) -
|
|
360
|
+
This changeset exists to bump all editor plugins that currently don't have a major version. This
|
|
361
|
+
is to address an issue with Jira plugin consumption.
|
|
355
362
|
|
|
356
363
|
### Patch Changes
|
|
357
364
|
|
|
358
|
-
-
|
|
365
|
+
- Updated dependencies
|
|
359
366
|
|
|
360
367
|
## 0.3.5
|
|
361
368
|
|
|
362
369
|
### Patch Changes
|
|
363
370
|
|
|
364
|
-
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
-
|
|
371
|
-
|
|
372
|
-
|
|
371
|
+
- [#69825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69825)
|
|
372
|
+
[`e2363da4f6a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2363da4f6a1) -
|
|
373
|
+
[No Issue] Replace View Mode API for annotations
|
|
374
|
+
- [#69825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69825)
|
|
375
|
+
[`e2363da4f6a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2363da4f6a1) -
|
|
376
|
+
[No Issue] Replace View Mode API for annotations
|
|
377
|
+
- [#69825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69825)
|
|
378
|
+
[`e2363da4f6a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2363da4f6a1) -
|
|
379
|
+
[No Issue] Replace View Mode API for annotations
|
|
373
380
|
|
|
374
381
|
## 0.3.4
|
|
375
382
|
|
|
376
383
|
### Patch Changes
|
|
377
384
|
|
|
378
|
-
-
|
|
379
|
-
|
|
380
|
-
|
|
385
|
+
- [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572)
|
|
386
|
+
[`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) -
|
|
387
|
+
Upgrading @atlaskit/editor-prosemirror dependency
|
|
381
388
|
|
|
382
389
|
## 0.3.3
|
|
383
390
|
|
|
384
391
|
### Patch Changes
|
|
385
392
|
|
|
386
|
-
-
|
|
387
|
-
|
|
388
|
-
|
|
393
|
+
- [#65713](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65713)
|
|
394
|
+
[`7a7d83f8e361`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7a7d83f8e361) -
|
|
395
|
+
Analytics for create inline comment button in highlight actions menu
|
|
389
396
|
|
|
390
397
|
## 0.3.2
|
|
391
398
|
|
|
392
399
|
### Patch Changes
|
|
393
400
|
|
|
394
|
-
-
|
|
395
|
-
|
|
396
|
-
|
|
401
|
+
- [#70152](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70152)
|
|
402
|
+
[`53ed3673df28`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/53ed3673df28) -
|
|
403
|
+
Updating adf-schema version to 35.5.1
|
|
397
404
|
|
|
398
405
|
## 0.3.1
|
|
399
406
|
|
|
400
407
|
### Patch Changes
|
|
401
408
|
|
|
402
|
-
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
-
|
|
409
|
+
- [#70084](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70084)
|
|
410
|
+
[`4d651eb93ab5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d651eb93ab5) -
|
|
411
|
+
Add editor-plugin-annotation pr and create shared utils for it in editor-test-helpers
|
|
412
|
+
- Updated dependencies
|
|
406
413
|
|
|
407
414
|
## 0.3.0
|
|
408
415
|
|
|
409
416
|
### Minor Changes
|
|
410
417
|
|
|
411
|
-
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
418
|
+
- [#69617](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69617)
|
|
419
|
+
[`93f297b73c6f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/93f297b73c6f) -
|
|
420
|
+
[ux] When in editor view mode, creating new comment with annotations plugin will send step to NCS
|
|
421
|
+
provider
|
|
415
422
|
|
|
416
423
|
## 0.2.0
|
|
417
424
|
|
|
418
425
|
### Minor Changes
|
|
419
426
|
|
|
420
|
-
-
|
|
421
|
-
|
|
422
|
-
|
|
427
|
+
- [#68790](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68790)
|
|
428
|
+
[`c6d8affc52d1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d8affc52d1) -
|
|
429
|
+
Support maybeAdd plugins in usePreset. Add typing support for universal preset.
|
|
423
430
|
|
|
424
|
-
|
|
431
|
+
Now when using the editor API with the universal preset
|
|
425
432
|
|
|
426
433
|
### Patch Changes
|
|
427
434
|
|
|
428
|
-
-
|
|
435
|
+
- Updated dependencies
|
|
429
436
|
|
|
430
437
|
## 0.1.3
|
|
431
438
|
|
|
432
439
|
### Patch Changes
|
|
433
440
|
|
|
434
|
-
-
|
|
441
|
+
- Updated dependencies
|
|
435
442
|
|
|
436
443
|
## 0.1.2
|
|
437
444
|
|
|
438
445
|
### Patch Changes
|
|
439
446
|
|
|
440
|
-
-
|
|
441
|
-
|
|
442
|
-
|
|
447
|
+
- [#65802](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65802)
|
|
448
|
+
[`438ead060875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/438ead060875) -
|
|
449
|
+
Ensure all editor plugins are marked as singletons
|
|
443
450
|
|
|
444
451
|
## 0.1.1
|
|
445
452
|
|
|
446
453
|
### Patch Changes
|
|
447
454
|
|
|
448
|
-
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
-
|
|
455
|
+
- [#65031](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65031)
|
|
456
|
+
[`a00094111b5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a00094111b5a) -
|
|
457
|
+
ED-21609 Update adf-schema to 35.3.0
|
|
458
|
+
- Updated dependencies
|
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Copyright 2023 Atlassian Pty Ltd
|
|
2
2
|
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
You may obtain a copy of the License at
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
6
5
|
|
|
7
6
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
7
|
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
limitations under the License.
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
|
@@ -4,10 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.createPluginState = exports.createCommand = void 0;
|
|
7
|
+
exports.shouldClearBookMarkCheck = exports.createPluginState = exports.createCommand = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
11
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
13
|
var _utils2 = require("../utils");
|
|
12
14
|
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
13
15
|
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; }
|
|
@@ -20,6 +22,43 @@ var handleDocChanged = function handleDocChanged(tr, prevPluginState) {
|
|
|
20
22
|
dirtyAnnotations: true
|
|
21
23
|
});
|
|
22
24
|
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* We clear bookmark on the following conditions:
|
|
28
|
+
* 1. if current selection is an empty selection, or
|
|
29
|
+
* 2. if the current selection and bookmark selection are different
|
|
30
|
+
*/
|
|
31
|
+
var shouldClearBookMarkCheck = exports.shouldClearBookMarkCheck = function shouldClearBookMarkCheck(tr, editorState, bookmark) {
|
|
32
|
+
// https://switcheroo.atlassian.com/changes/confluence/platform.editor.comments-on-media.bug.preserve-draft_i3vqb
|
|
33
|
+
// the existing log will always clear bookmark
|
|
34
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.comments-on-media.bug.preserve-draft_i3vqb')) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
if (editorState.selection.empty || !bookmark) {
|
|
38
|
+
return true;
|
|
39
|
+
} else if (editorState.selection instanceof _state.NodeSelection) {
|
|
40
|
+
var bookmarkSelection = bookmark === null || bookmark === void 0 ? void 0 : bookmark.resolve(tr.doc);
|
|
41
|
+
if (bookmarkSelection instanceof _state.NodeSelection) {
|
|
42
|
+
var selectionNode = editorState.selection.node;
|
|
43
|
+
var bookmarkNode = bookmarkSelection.node;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Currently, after updating the alt text of a mediaSingle node,
|
|
47
|
+
* the selection moves to the media node.
|
|
48
|
+
* (then will append a transaction to its parent node)
|
|
49
|
+
*/
|
|
50
|
+
if (selectionNode.type.name === 'media' && bookmarkNode.type.name === 'mediaSingle') {
|
|
51
|
+
var _bookmarkNode$firstCh;
|
|
52
|
+
return !((_bookmarkNode$firstCh = bookmarkNode.firstChild) !== null && _bookmarkNode$firstCh !== void 0 && _bookmarkNode$firstCh.eq(selectionNode));
|
|
53
|
+
} else {
|
|
54
|
+
return !bookmarkNode.eq(selectionNode);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// by default we discard bookmark
|
|
60
|
+
return true;
|
|
61
|
+
};
|
|
23
62
|
var getSelectionChangedHandler = function getSelectionChangedHandler(reopenCommentView) {
|
|
24
63
|
return function (tr, pluginState) {
|
|
25
64
|
var _pluginState$featureF, _pluginState$featureF2;
|
|
@@ -81,7 +120,8 @@ var _pluginFactory = (0, _utils.pluginFactory)(_utils2.inlineCommentPluginKey, _
|
|
|
81
120
|
|
|
82
121
|
// When changes to decoration target make decoration invalid (e.g. delete text, add mark to node),
|
|
83
122
|
// we need to reset bookmark to hide create component and to avoid invalid draft being published
|
|
84
|
-
|
|
123
|
+
// We only perform this change when document selection has changed.
|
|
124
|
+
if (!hasMappedDecorations && shouldClearBookMarkCheck(tr, editorState, bookmark)) {
|
|
85
125
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
86
126
|
draftDecorationSet: mappedDecorationSet,
|
|
87
127
|
bookmark: undefined
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
5
|
import { decorationKey, findAnnotationsInSelection, inlineCommentPluginKey, isBlockNodeAnnotationsSelected, isSelectedAnnotationsChanged } from '../utils';
|
|
4
6
|
import reducer from './reducer';
|
|
5
7
|
const handleDocChanged = (tr, prevPluginState) => {
|
|
@@ -11,6 +13,43 @@ const handleDocChanged = (tr, prevPluginState) => {
|
|
|
11
13
|
dirtyAnnotations: true
|
|
12
14
|
};
|
|
13
15
|
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* We clear bookmark on the following conditions:
|
|
19
|
+
* 1. if current selection is an empty selection, or
|
|
20
|
+
* 2. if the current selection and bookmark selection are different
|
|
21
|
+
*/
|
|
22
|
+
export const shouldClearBookMarkCheck = (tr, editorState, bookmark) => {
|
|
23
|
+
// https://switcheroo.atlassian.com/changes/confluence/platform.editor.comments-on-media.bug.preserve-draft_i3vqb
|
|
24
|
+
// the existing log will always clear bookmark
|
|
25
|
+
if (!getBooleanFF('platform.editor.comments-on-media.bug.preserve-draft_i3vqb')) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
if (editorState.selection.empty || !bookmark) {
|
|
29
|
+
return true;
|
|
30
|
+
} else if (editorState.selection instanceof NodeSelection) {
|
|
31
|
+
const bookmarkSelection = bookmark === null || bookmark === void 0 ? void 0 : bookmark.resolve(tr.doc);
|
|
32
|
+
if (bookmarkSelection instanceof NodeSelection) {
|
|
33
|
+
const selectionNode = editorState.selection.node;
|
|
34
|
+
const bookmarkNode = bookmarkSelection.node;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Currently, after updating the alt text of a mediaSingle node,
|
|
38
|
+
* the selection moves to the media node.
|
|
39
|
+
* (then will append a transaction to its parent node)
|
|
40
|
+
*/
|
|
41
|
+
if (selectionNode.type.name === 'media' && bookmarkNode.type.name === 'mediaSingle') {
|
|
42
|
+
var _bookmarkNode$firstCh;
|
|
43
|
+
return !((_bookmarkNode$firstCh = bookmarkNode.firstChild) !== null && _bookmarkNode$firstCh !== void 0 && _bookmarkNode$firstCh.eq(selectionNode));
|
|
44
|
+
} else {
|
|
45
|
+
return !bookmarkNode.eq(selectionNode);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// by default we discard bookmark
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
14
53
|
const getSelectionChangedHandler = reopenCommentView => (tr, pluginState) => {
|
|
15
54
|
var _pluginState$featureF, _pluginState$featureF2;
|
|
16
55
|
if (pluginState.skipSelectionHandling) {
|
|
@@ -83,7 +122,8 @@ export const {
|
|
|
83
122
|
|
|
84
123
|
// When changes to decoration target make decoration invalid (e.g. delete text, add mark to node),
|
|
85
124
|
// we need to reset bookmark to hide create component and to avoid invalid draft being published
|
|
86
|
-
|
|
125
|
+
// We only perform this change when document selection has changed.
|
|
126
|
+
if (!hasMappedDecorations && shouldClearBookMarkCheck(tr, editorState, bookmark)) {
|
|
87
127
|
return {
|
|
88
128
|
...pluginState,
|
|
89
129
|
draftDecorationSet: mappedDecorationSet,
|
|
@@ -2,7 +2,9 @@ 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 { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
8
|
import { decorationKey, findAnnotationsInSelection, inlineCommentPluginKey, isBlockNodeAnnotationsSelected, isSelectedAnnotationsChanged } from '../utils';
|
|
7
9
|
import reducer from './reducer';
|
|
8
10
|
var handleDocChanged = function handleDocChanged(tr, prevPluginState) {
|
|
@@ -13,6 +15,43 @@ var handleDocChanged = function handleDocChanged(tr, prevPluginState) {
|
|
|
13
15
|
dirtyAnnotations: true
|
|
14
16
|
});
|
|
15
17
|
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* We clear bookmark on the following conditions:
|
|
21
|
+
* 1. if current selection is an empty selection, or
|
|
22
|
+
* 2. if the current selection and bookmark selection are different
|
|
23
|
+
*/
|
|
24
|
+
export var shouldClearBookMarkCheck = function shouldClearBookMarkCheck(tr, editorState, bookmark) {
|
|
25
|
+
// https://switcheroo.atlassian.com/changes/confluence/platform.editor.comments-on-media.bug.preserve-draft_i3vqb
|
|
26
|
+
// the existing log will always clear bookmark
|
|
27
|
+
if (!getBooleanFF('platform.editor.comments-on-media.bug.preserve-draft_i3vqb')) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (editorState.selection.empty || !bookmark) {
|
|
31
|
+
return true;
|
|
32
|
+
} else if (editorState.selection instanceof NodeSelection) {
|
|
33
|
+
var bookmarkSelection = bookmark === null || bookmark === void 0 ? void 0 : bookmark.resolve(tr.doc);
|
|
34
|
+
if (bookmarkSelection instanceof NodeSelection) {
|
|
35
|
+
var selectionNode = editorState.selection.node;
|
|
36
|
+
var bookmarkNode = bookmarkSelection.node;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Currently, after updating the alt text of a mediaSingle node,
|
|
40
|
+
* the selection moves to the media node.
|
|
41
|
+
* (then will append a transaction to its parent node)
|
|
42
|
+
*/
|
|
43
|
+
if (selectionNode.type.name === 'media' && bookmarkNode.type.name === 'mediaSingle') {
|
|
44
|
+
var _bookmarkNode$firstCh;
|
|
45
|
+
return !((_bookmarkNode$firstCh = bookmarkNode.firstChild) !== null && _bookmarkNode$firstCh !== void 0 && _bookmarkNode$firstCh.eq(selectionNode));
|
|
46
|
+
} else {
|
|
47
|
+
return !bookmarkNode.eq(selectionNode);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// by default we discard bookmark
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
16
55
|
var getSelectionChangedHandler = function getSelectionChangedHandler(reopenCommentView) {
|
|
17
56
|
return function (tr, pluginState) {
|
|
18
57
|
var _pluginState$featureF, _pluginState$featureF2;
|
|
@@ -74,7 +113,8 @@ var _pluginFactory = pluginFactory(inlineCommentPluginKey, reducer, {
|
|
|
74
113
|
|
|
75
114
|
// When changes to decoration target make decoration invalid (e.g. delete text, add mark to node),
|
|
76
115
|
// we need to reset bookmark to hide create component and to avoid invalid draft being published
|
|
77
|
-
|
|
116
|
+
// We only perform this change when document selection has changed.
|
|
117
|
+
if (!hasMappedDecorations && shouldClearBookMarkCheck(tr, editorState, bookmark)) {
|
|
78
118
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
79
119
|
draftDecorationSet: mappedDecorationSet,
|
|
80
120
|
bookmark: undefined
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import { type EditorState, type ReadonlyTransaction, type SelectionBookmark, type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { InlineCommentPluginState } from './types';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* We clear bookmark on the following conditions:
|
|
5
|
+
* 1. if current selection is an empty selection, or
|
|
6
|
+
* 2. if the current selection and bookmark selection are different
|
|
7
|
+
*/
|
|
8
|
+
export declare const shouldClearBookMarkCheck: (tr: ReadonlyTransaction | Transaction, editorState: EditorState, bookmark?: SelectionBookmark) => boolean;
|
|
9
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: InlineCommentPluginState | ((state: EditorState) => InlineCommentPluginState)) => import("prosemirror-state").SafeStateField<InlineCommentPluginState>, createCommand: <A = import("./types").InlineCommentAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: ((tr: Transaction, state: EditorState) => Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import { type EditorState, type ReadonlyTransaction, type SelectionBookmark, type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { InlineCommentPluginState } from './types';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* We clear bookmark on the following conditions:
|
|
5
|
+
* 1. if current selection is an empty selection, or
|
|
6
|
+
* 2. if the current selection and bookmark selection are different
|
|
7
|
+
*/
|
|
8
|
+
export declare const shouldClearBookMarkCheck: (tr: ReadonlyTransaction | Transaction, editorState: EditorState, bookmark?: SelectionBookmark) => boolean;
|
|
9
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: InlineCommentPluginState | ((state: EditorState) => InlineCommentPluginState)) => import("prosemirror-state").SafeStateField<InlineCommentPluginState>, createCommand: <A = import("./types").InlineCommentAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: ((tr: Transaction, state: EditorState) => Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^36.10.7",
|
|
36
|
-
"@atlaskit/editor-common": "^81.
|
|
36
|
+
"@atlaskit/editor-common": "^81.2.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"@af/visual-regression": "*",
|
|
51
51
|
"@atlaskit/ssr": "*",
|
|
52
52
|
"@atlaskit/visual-regression": "*",
|
|
53
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
54
53
|
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
|
55
54
|
"@testing-library/react": "^12.1.5",
|
|
56
55
|
"react-dom": "^16.8.0",
|
|
@@ -90,13 +89,15 @@
|
|
|
90
89
|
]
|
|
91
90
|
}
|
|
92
91
|
},
|
|
93
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
|
94
92
|
"platform-feature-flags": {
|
|
95
93
|
"platform.editor.enable-selection-toolbar_ucdwd": {
|
|
96
94
|
"type": "boolean"
|
|
97
95
|
},
|
|
98
96
|
"platform.editor.allow-inline-comments-for-inline-nodes": {
|
|
99
97
|
"type": "boolean"
|
|
98
|
+
},
|
|
99
|
+
"platform.editor.comments-on-media.bug.preserve-draft_i3vqb": {
|
|
100
|
+
"type": "boolean"
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
}
|