@atlaskit/editor-plugin-annotation 1.9.3 → 1.9.5

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