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