@atlaskit/editor-plugin-code-block 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,283 +1,372 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 1.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#95492](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95492)
8
+ [`c88ed307708a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c88ed307708a) -
9
+ [ux] [ED-22897] Replace newlines with hard breaks when codeblock is converted to a paragraph
10
+ when the user presses backspace at the start of the paragraph. (only applies if codeblock is the
11
+ first Node of the document or first node of a list item) Enabled with feature flag
12
+ "platform.editor.codeblock-preserve-newlines_54r3m"
13
+
14
+ ## 1.2.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [#94901](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94901)
19
+ [`da964fcdc828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da964fcdc828) -
20
+ [ED-23097] Bump ADF schema to version 35.12.1
21
+
3
22
  ## 1.2.1
4
23
 
5
24
  ### Patch Changes
6
25
 
7
- - [#93689](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93689) [`5ba5d2b4a9ac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ba5d2b4a9ac) - Updating adf-schema version to 35.10.0
26
+ - [#93689](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93689)
27
+ [`5ba5d2b4a9ac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ba5d2b4a9ac) -
28
+ Updating adf-schema version to 35.10.0
8
29
 
9
30
  ## 1.2.0
10
31
 
11
32
  ### Minor Changes
12
33
 
13
- - [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934) [`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) - bumped editor-prosemirror version to 4.0.0
34
+ - [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934)
35
+ [`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) -
36
+ bumped editor-prosemirror version to 4.0.0
14
37
 
15
38
  ### Patch Changes
16
39
 
17
- - Updated dependencies
40
+ - Updated dependencies
18
41
 
19
42
  ## 1.1.11
20
43
 
21
44
  ### Patch Changes
22
45
 
23
- - [#91461](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91461) [`1b353cb06cc8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1b353cb06cc8) - [ED-23042] Disable editing in code blocks and expand nodes when editorDisabled state is true
46
+ - [#91461](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91461)
47
+ [`1b353cb06cc8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1b353cb06cc8) -
48
+ [ED-23042] Disable editing in code blocks and expand nodes when editorDisabled state is true
24
49
 
25
50
  ## 1.1.10
26
51
 
27
52
  ### Patch Changes
28
53
 
29
- - [#92426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92426) [`32c76c7c225c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c76c7c225c) - Bump adf-schema to 35.9.2 to support table alignment options
54
+ - [#92426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92426)
55
+ [`32c76c7c225c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c76c7c225c) -
56
+ Bump adf-schema to 35.9.2 to support table alignment options
30
57
 
31
58
  ## 1.1.9
32
59
 
33
60
  ### Patch Changes
34
61
 
35
- - [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106) [`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) - Bump ADF-schema package to version 35.0.0
36
- - Updated dependencies
62
+ - [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106)
63
+ [`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) -
64
+ Bump ADF-schema package to version 35.0.0
65
+ - Updated dependencies
37
66
 
38
67
  ## 1.1.8
39
68
 
40
69
  ### Patch Changes
41
70
 
42
- - [#91080](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91080) [`ef9f3c4ad482`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef9f3c4ad482) - Revert change for disable code block in live view
43
- - Updated dependencies
71
+ - [#91080](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91080)
72
+ [`ef9f3c4ad482`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef9f3c4ad482) -
73
+ Revert change for disable code block in live view
74
+ - Updated dependencies
44
75
 
45
76
  ## 1.1.7
46
77
 
47
78
  ### Patch Changes
48
79
 
49
- - [#89138](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89138) [`f70dc8331119`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f70dc8331119) - Disable code block content editing in live view mode
50
- - Updated dependencies
80
+ - [#89138](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89138)
81
+ [`f70dc8331119`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f70dc8331119) -
82
+ Disable code block content editing in live view mode
83
+ - Updated dependencies
51
84
 
52
85
  ## 1.1.6
53
86
 
54
87
  ### Patch Changes
55
88
 
56
- - [#86724](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86724) [`718a9aa2424d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/718a9aa2424d) - [ED-22607] Remove references to maxFrames for multi bodied extensions and bump adf-schema from 35.7.0 to 35.8.0
89
+ - [#86724](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86724)
90
+ [`718a9aa2424d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/718a9aa2424d) -
91
+ [ED-22607] Remove references to maxFrames for multi bodied extensions and bump adf-schema from
92
+ 35.7.0 to 35.8.0
57
93
 
58
94
  ## 1.1.5
59
95
 
60
96
  ### Patch Changes
61
97
 
62
- - [#81777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81777) [`c6d7a5378751`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d7a5378751) - Bump adf-schema to 35.7.0
98
+ - [#81777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81777)
99
+ [`c6d7a5378751`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d7a5378751) -
100
+ Bump adf-schema to 35.7.0
63
101
 
64
102
  ## 1.1.4
65
103
 
66
104
  ### Patch Changes
67
105
 
68
- - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
106
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
107
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
108
+ Upgrade Typescript from `4.9.5` to `5.4.2`
69
109
 
70
110
  ## 1.1.3
71
111
 
72
112
  ### Patch Changes
73
113
 
74
- - [#80679](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80679) [`104eb9443b7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104eb9443b7e) - ED-22553 Updating adf-schema version to 35.6.0
114
+ - [#80679](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80679)
115
+ [`104eb9443b7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104eb9443b7e) -
116
+ ED-22553 Updating adf-schema version to 35.6.0
75
117
 
76
118
  ## 1.1.2
77
119
 
78
120
  ### Patch Changes
79
121
 
80
- - [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224) [`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) - ED-22219: adf-schema updated to 35.5.2
81
- - Updated dependencies
122
+ - [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224)
123
+ [`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) -
124
+ ED-22219: adf-schema updated to 35.5.2
125
+ - Updated dependencies
82
126
 
83
127
  ## 1.1.1
84
128
 
85
129
  ### Patch Changes
86
130
 
87
- - [#75482](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75482) [`18b5a6fb910a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18b5a6fb910a) - # MAJOR CHANGE to `@atlaskit/prosemirror-input-rules` package.
131
+ - [#75482](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75482)
132
+ [`18b5a6fb910a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18b5a6fb910a) - #
133
+ MAJOR CHANGE to `@atlaskit/prosemirror-input-rules` package.
88
134
 
89
- ## WHY?
135
+ ## WHY?
90
136
 
91
- Removing editor-common dependencies from prosemirror-input-rules package.
137
+ Removing editor-common dependencies from prosemirror-input-rules package.
92
138
 
93
- This makes it easier for editor updates because it simplifies our dependency graph.
139
+ This makes it easier for editor updates because it simplifies our dependency graph.
94
140
 
95
- ## WHAT and HOW?
141
+ ## WHAT and HOW?
96
142
 
97
- These are no longer available via `@atlaskit/prosemirror-input-rules` but are available from `@atlaskit/editor-common/types`:
143
+ These are no longer available via `@atlaskit/prosemirror-input-rules` but are available from
144
+ `@atlaskit/editor-common/types`:
98
145
 
99
- - InputRuleWrapper
100
- - InputRuleHandler
101
- - OnHandlerApply
102
- - createRule
146
+ - InputRuleWrapper
147
+ - InputRuleHandler
148
+ - OnHandlerApply
149
+ - createRule
103
150
 
104
- These have changed from a `SafePlugin` to a `SafePluginSpec`. In order to update your code you need to instantiate a `SafePlugin` (ie. `new SafePlugin(createPlugin( ... ))`).
151
+ These have changed from a `SafePlugin` to a `SafePluginSpec`. In order to update your code you
152
+ need to instantiate a `SafePlugin` (ie. `new SafePlugin(createPlugin( ... ))`).
105
153
 
106
- `SafePlugin` exists in `@atlaskit/editor-common/safe-plugin`.
154
+ `SafePlugin` exists in `@atlaskit/editor-common/safe-plugin`.
107
155
 
108
- - createPlugin
109
- - createInputRulePlugin
156
+ - createPlugin
157
+ - createInputRulePlugin
110
158
 
111
- - Updated dependencies
159
+ - Updated dependencies
112
160
 
113
161
  ## 1.1.0
114
162
 
115
163
  ### Minor Changes
116
164
 
117
- - [#75114](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75114) [`393ee487af1e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/393ee487af1e) - Plugin configuration for code-block plugin is now optional.
165
+ - [#75114](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75114)
166
+ [`393ee487af1e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/393ee487af1e) -
167
+ Plugin configuration for code-block plugin is now optional.
118
168
 
119
169
  ## 1.0.2
120
170
 
121
171
  ### Patch Changes
122
172
 
123
- - Updated dependencies
173
+ - Updated dependencies
124
174
 
125
175
  ## 1.0.1
126
176
 
127
177
  ### Patch Changes
128
178
 
129
- - [#73044](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73044) [`0fff4efc0417`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fff4efc0417) - [ux] ED-22131 Fixed selection placement when codeblock inserted through quick-insert inside panel
130
- - Updated dependencies
179
+ - [#73044](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73044)
180
+ [`0fff4efc0417`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fff4efc0417) -
181
+ [ux] ED-22131 Fixed selection placement when codeblock inserted through quick-insert inside
182
+ panel
183
+ - Updated dependencies
131
184
 
132
185
  ## 1.0.0
133
186
 
134
187
  ### Major Changes
135
188
 
136
- - [#72386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72386) [`0c52b0be40c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c52b0be40c1) - This changeset exists to bump all editor plugins that currently don't have a major version. This is to address an issue with Jira plugin consumption.
189
+ - [#72386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72386)
190
+ [`0c52b0be40c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c52b0be40c1) -
191
+ This changeset exists to bump all editor plugins that currently don't have a major version. This
192
+ is to address an issue with Jira plugin consumption.
137
193
 
138
194
  ### Patch Changes
139
195
 
140
- - Updated dependencies
196
+ - Updated dependencies
141
197
 
142
198
  ## 0.1.20
143
199
 
144
200
  ### Patch Changes
145
201
 
146
- - [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572) [`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) - Upgrading @atlaskit/editor-prosemirror dependency
202
+ - [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572)
203
+ [`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) -
204
+ Upgrading @atlaskit/editor-prosemirror dependency
147
205
 
148
206
  ## 0.1.19
149
207
 
150
208
  ### Patch Changes
151
209
 
152
- - [#71136](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71136) [`c803fea1e6a4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c803fea1e6a4) - Move all plugin translations to editor-common
153
- - Updated dependencies
210
+ - [#71136](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71136)
211
+ [`c803fea1e6a4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c803fea1e6a4) -
212
+ Move all plugin translations to editor-common
213
+ - Updated dependencies
154
214
 
155
215
  ## 0.1.18
156
216
 
157
217
  ### Patch Changes
158
218
 
159
- - [#70152](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70152) [`53ed3673df28`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/53ed3673df28) - Updating adf-schema version to 35.5.1
219
+ - [#70152](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70152)
220
+ [`53ed3673df28`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/53ed3673df28) -
221
+ Updating adf-schema version to 35.5.1
160
222
 
161
223
  ## 0.1.17
162
224
 
163
225
  ### Patch Changes
164
226
 
165
- - Updated dependencies
227
+ - Updated dependencies
166
228
 
167
229
  ## 0.1.16
168
230
 
169
231
  ### Patch Changes
170
232
 
171
- - [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238) [`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) - [ED-21835] Change EditorAPI type to always union with undefined
233
+ - [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238)
234
+ [`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) -
235
+ [ED-21835] Change EditorAPI type to always union with undefined
172
236
 
173
237
  ## 0.1.15
174
238
 
175
239
  ### Patch Changes
176
240
 
177
- - [#65802](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65802) [`438ead060875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/438ead060875) - Ensure all editor plugins are marked as singletons
241
+ - [#65802](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65802)
242
+ [`438ead060875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/438ead060875) -
243
+ Ensure all editor plugins are marked as singletons
178
244
 
179
245
  ## 0.1.14
180
246
 
181
247
  ### Patch Changes
182
248
 
183
- - [#65031](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65031) [`a00094111b5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a00094111b5a) - ED-21609 Update adf-schema to 35.3.0
184
- - Updated dependencies
249
+ - [#65031](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65031)
250
+ [`a00094111b5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a00094111b5a) -
251
+ ED-21609 Update adf-schema to 35.3.0
252
+ - Updated dependencies
185
253
 
186
254
  ## 0.1.13
187
255
 
188
256
  ### Patch Changes
189
257
 
190
- - [#62880](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62880) [`a23ec26652ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a23ec26652ea) - Extracting breakout plugin from editor-core into new package @atlaskit/editor-plugin-breakout
258
+ - [#62880](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62880)
259
+ [`a23ec26652ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a23ec26652ea) -
260
+ Extracting breakout plugin from editor-core into new package @atlaskit/editor-plugin-breakout
191
261
 
192
262
  ## 0.1.12
193
263
 
194
264
  ### Patch Changes
195
265
 
196
- - [#62165](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62165) [`b44ac0968d79`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b44ac0968d79) - [ED-21562] Bump @atlaskit/adf-schema to 35.2.0 for border mark update
266
+ - [#62165](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62165)
267
+ [`b44ac0968d79`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b44ac0968d79) -
268
+ [ED-21562] Bump @atlaskit/adf-schema to 35.2.0 for border mark update
197
269
 
198
270
  ## 0.1.11
199
271
 
200
272
  ### Patch Changes
201
273
 
202
- - [#60808](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60808) [`f509a21be124`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f509a21be124) - ED-21506: @atlaskit/adf-schema upgraded to 35.1.1 to support renderer for MBE
274
+ - [#60808](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60808)
275
+ [`f509a21be124`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f509a21be124) -
276
+ ED-21506: @atlaskit/adf-schema upgraded to 35.1.1 to support renderer for MBE
203
277
 
204
278
  ## 0.1.10
205
279
 
206
280
  ### Patch Changes
207
281
 
208
- - [#58246](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58246) [`a381b2599716`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a381b2599716) - ED-21371 Update adf-schema to 35.1.0
282
+ - [#58246](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58246)
283
+ [`a381b2599716`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a381b2599716) -
284
+ ED-21371 Update adf-schema to 35.1.0
209
285
 
210
286
  ## 0.1.9
211
287
 
212
288
  ### Patch Changes
213
289
 
214
- - Updated dependencies
290
+ - Updated dependencies
215
291
 
216
292
  ## 0.1.8
217
293
 
218
294
  ### Patch Changes
219
295
 
220
- - [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
296
+ - [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147)
297
+ [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) -
298
+ Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
221
299
 
222
300
  ## 0.1.7
223
301
 
224
302
  ### Patch Changes
225
303
 
226
- - [#58763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58763) [`0fdbd64522bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fdbd64522bf) - update ADF schema
304
+ - [#58763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58763)
305
+ [`0fdbd64522bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fdbd64522bf) -
306
+ update ADF schema
227
307
 
228
308
  ## 0.1.6
229
309
 
230
310
  ### Patch Changes
231
311
 
232
- - [#56790](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56790) [`ff577a7969d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff577a7969d4) - ED-21266: Updated @atlaskit/adf-schema to 34.0.1
312
+ - [#56790](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56790)
313
+ [`ff577a7969d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff577a7969d4) -
314
+ ED-21266: Updated @atlaskit/adf-schema to 34.0.1
233
315
 
234
316
  ## 0.1.5
235
317
 
236
318
  ### Patch Changes
237
319
 
238
- - [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646) [`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make feature flags plugin optional in all plugins including:
239
-
240
- - analytics
241
- - base
242
- - card
243
- - code-block
244
- - expand
245
- - extension
246
- - floating-toolbar
247
- - hyperlink
248
- - insert-block
249
- - layout
250
- - layout
251
- - list
252
- - media
253
- - paste
254
- - rule
255
- - table
256
- - tasks-and-decisions
257
-
258
- We already treat it as optional in the plugins, so this is just ensuring that the plugin is not mandatory to be added to the preset.
320
+ - [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646)
321
+ [`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make
322
+ feature flags plugin optional in all plugins including:
323
+
324
+ - analytics
325
+ - base
326
+ - card
327
+ - code-block
328
+ - expand
329
+ - extension
330
+ - floating-toolbar
331
+ - hyperlink
332
+ - insert-block
333
+ - layout
334
+ - layout
335
+ - list
336
+ - media
337
+ - paste
338
+ - rule
339
+ - table
340
+ - tasks-and-decisions
341
+
342
+ We already treat it as optional in the plugins, so this is just ensuring that the plugin is not
343
+ mandatory to be added to the preset.
259
344
 
260
345
  ## 0.1.4
261
346
 
262
347
  ### Patch Changes
263
348
 
264
- - [#43417](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43417) [`3f3c17f0273`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f3c17f0273) - ED-20971 Upgrade adf-schema package to ^34.0.0
349
+ - [#43417](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43417)
350
+ [`3f3c17f0273`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f3c17f0273) -
351
+ ED-20971 Upgrade adf-schema package to ^34.0.0
265
352
 
266
353
  ## 0.1.3
267
354
 
268
355
  ### Patch Changes
269
356
 
270
- - Updated dependencies
357
+ - Updated dependencies
271
358
 
272
359
  ## 0.1.2
273
360
 
274
361
  ### Patch Changes
275
362
 
276
- - Updated dependencies
363
+ - Updated dependencies
277
364
 
278
365
  ## 0.1.1
279
366
 
280
367
  ### Patch Changes
281
368
 
282
- - [#43379](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43379) [`482c025520d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/482c025520d) - ED-20763 Upgrade ADF schema version to 33.2.3 for MBE nodes.
283
- - Updated dependencies
369
+ - [#43379](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43379)
370
+ [`482c025520d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/482c025520d) -
371
+ ED-20763 Upgrade ADF schema version to 33.2.3 for MBE nodes.
372
+ - Updated dependencies
@@ -9,6 +9,7 @@ var _utils = require("@atlaskit/editor-common/utils");
9
9
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _utils3 = require("../utils");
13
14
  var deleteCurrentItem = function deleteCurrentItem($from) {
14
15
  return function (tr) {
@@ -24,16 +25,42 @@ var setTextSelection = function setTextSelection(pos) {
24
25
  return tr;
25
26
  };
26
27
  };
28
+
29
+ // This method converts the code block with a Paragraph, while replacing it's
30
+ // newline `\n` characters with `hardBreak`s to ensure that they are retained in the
31
+ // rendered output. `prosemirror-transform` v1.74 introduced new behaviour for
32
+ // `setBlockType` which means we can't use it here without losing whitespace
33
+ // https://github.com/ProseMirror/prosemirror-transform/blob/master/CHANGELOG.md#174-2023-07-28
34
+ var replaceWithParagraph = function replaceWithParagraph(node, nodePos, $cursor, state, dispatch) {
35
+ var _state$schema$nodes = state.schema.nodes,
36
+ paragraph = _state$schema$nodes.paragraph,
37
+ hardBreak = _state$schema$nodes.hardBreak;
38
+ var nodeLines = node.textContent.split('\n');
39
+ var tr = state.tr;
40
+ var newNodes = [];
41
+ nodeLines.forEach(function (line, index) {
42
+ if (index > 0) {
43
+ newNodes.push(hardBreak.create());
44
+ }
45
+ if (line) {
46
+ newNodes.push(state.schema.text(line));
47
+ }
48
+ });
49
+ var newParagraph = paragraph.createChecked([], newNodes);
50
+ tr.replaceWith(nodePos, nodePos + node.nodeSize, newParagraph);
51
+ setTextSelection($cursor.pos)(tr);
52
+ dispatch(tr);
53
+ };
27
54
  function keymapPlugin(schema) {
28
55
  return (0, _keymap.keymap)({
29
56
  Backspace: function Backspace(state, dispatch) {
30
57
  var $cursor = (0, _utils3.getCursor)(state.selection);
31
- var _state$schema$nodes = state.schema.nodes,
32
- paragraph = _state$schema$nodes.paragraph,
33
- codeBlock = _state$schema$nodes.codeBlock,
34
- listItem = _state$schema$nodes.listItem,
35
- table = _state$schema$nodes.table,
36
- layoutColumn = _state$schema$nodes.layoutColumn;
58
+ var _state$schema$nodes2 = state.schema.nodes,
59
+ codeBlock = _state$schema$nodes2.codeBlock,
60
+ listItem = _state$schema$nodes2.listItem,
61
+ paragraph = _state$schema$nodes2.paragraph,
62
+ table = _state$schema$nodes2.table,
63
+ layoutColumn = _state$schema$nodes2.layoutColumn;
37
64
  if (!$cursor || $cursor.parent.type !== codeBlock || !dispatch) {
38
65
  return false;
39
66
  }
@@ -42,7 +69,11 @@ function keymapPlugin(schema) {
42
69
  if (!node) {
43
70
  return false;
44
71
  }
45
- dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
72
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.codeblock-preserve-newlines_54r3m')) {
73
+ replaceWithParagraph(node.node, node.pos, $cursor, state, dispatch);
74
+ } else {
75
+ dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
76
+ }
46
77
  return true;
47
78
  }
48
79
  if ($cursor.node && (0, _utils.isEmptyNode)(schema)($cursor.node()) && ((0, _utils2.hasParentNodeOfType)(layoutColumn)(state.selection) || (0, _utils2.hasParentNodeOfType)(table)(state.selection))) {
@@ -2,6 +2,7 @@ import { isEmptyNode } from '@atlaskit/editor-common/utils';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
3
  import { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
5
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
6
  import { getCursor } from '../utils';
6
7
  const deleteCurrentItem = $from => tr => {
7
8
  return tr.delete($from.before($from.depth), $from.after($from.depth));
@@ -13,14 +14,43 @@ const setTextSelection = pos => tr => {
13
14
  }
14
15
  return tr;
15
16
  };
17
+
18
+ // This method converts the code block with a Paragraph, while replacing it's
19
+ // newline `\n` characters with `hardBreak`s to ensure that they are retained in the
20
+ // rendered output. `prosemirror-transform` v1.74 introduced new behaviour for
21
+ // `setBlockType` which means we can't use it here without losing whitespace
22
+ // https://github.com/ProseMirror/prosemirror-transform/blob/master/CHANGELOG.md#174-2023-07-28
23
+ const replaceWithParagraph = (node, nodePos, $cursor, state, dispatch) => {
24
+ const {
25
+ paragraph,
26
+ hardBreak
27
+ } = state.schema.nodes;
28
+ const nodeLines = node.textContent.split('\n');
29
+ const {
30
+ tr
31
+ } = state;
32
+ const newNodes = [];
33
+ nodeLines.forEach((line, index) => {
34
+ if (index > 0) {
35
+ newNodes.push(hardBreak.create());
36
+ }
37
+ if (line) {
38
+ newNodes.push(state.schema.text(line));
39
+ }
40
+ });
41
+ const newParagraph = paragraph.createChecked([], newNodes);
42
+ tr.replaceWith(nodePos, nodePos + node.nodeSize, newParagraph);
43
+ setTextSelection($cursor.pos)(tr);
44
+ dispatch(tr);
45
+ };
16
46
  export function keymapPlugin(schema) {
17
47
  return keymap({
18
48
  Backspace: (state, dispatch) => {
19
49
  const $cursor = getCursor(state.selection);
20
50
  const {
21
- paragraph,
22
51
  codeBlock,
23
52
  listItem,
53
+ paragraph,
24
54
  table,
25
55
  layoutColumn
26
56
  } = state.schema.nodes;
@@ -32,7 +62,11 @@ export function keymapPlugin(schema) {
32
62
  if (!node) {
33
63
  return false;
34
64
  }
35
- dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
65
+ if (getBooleanFF('platform.editor.codeblock-preserve-newlines_54r3m')) {
66
+ replaceWithParagraph(node.node, node.pos, $cursor, state, dispatch);
67
+ } else {
68
+ dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
69
+ }
36
70
  return true;
37
71
  }
38
72
  if ($cursor.node && isEmptyNode(schema)($cursor.node()) && (hasParentNodeOfType(layoutColumn)(state.selection) || hasParentNodeOfType(table)(state.selection))) {
@@ -2,6 +2,7 @@ import { isEmptyNode } from '@atlaskit/editor-common/utils';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
3
  import { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
5
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
6
  import { getCursor } from '../utils';
6
7
  var deleteCurrentItem = function deleteCurrentItem($from) {
7
8
  return function (tr) {
@@ -17,16 +18,42 @@ var setTextSelection = function setTextSelection(pos) {
17
18
  return tr;
18
19
  };
19
20
  };
21
+
22
+ // This method converts the code block with a Paragraph, while replacing it's
23
+ // newline `\n` characters with `hardBreak`s to ensure that they are retained in the
24
+ // rendered output. `prosemirror-transform` v1.74 introduced new behaviour for
25
+ // `setBlockType` which means we can't use it here without losing whitespace
26
+ // https://github.com/ProseMirror/prosemirror-transform/blob/master/CHANGELOG.md#174-2023-07-28
27
+ var replaceWithParagraph = function replaceWithParagraph(node, nodePos, $cursor, state, dispatch) {
28
+ var _state$schema$nodes = state.schema.nodes,
29
+ paragraph = _state$schema$nodes.paragraph,
30
+ hardBreak = _state$schema$nodes.hardBreak;
31
+ var nodeLines = node.textContent.split('\n');
32
+ var tr = state.tr;
33
+ var newNodes = [];
34
+ nodeLines.forEach(function (line, index) {
35
+ if (index > 0) {
36
+ newNodes.push(hardBreak.create());
37
+ }
38
+ if (line) {
39
+ newNodes.push(state.schema.text(line));
40
+ }
41
+ });
42
+ var newParagraph = paragraph.createChecked([], newNodes);
43
+ tr.replaceWith(nodePos, nodePos + node.nodeSize, newParagraph);
44
+ setTextSelection($cursor.pos)(tr);
45
+ dispatch(tr);
46
+ };
20
47
  export function keymapPlugin(schema) {
21
48
  return keymap({
22
49
  Backspace: function Backspace(state, dispatch) {
23
50
  var $cursor = getCursor(state.selection);
24
- var _state$schema$nodes = state.schema.nodes,
25
- paragraph = _state$schema$nodes.paragraph,
26
- codeBlock = _state$schema$nodes.codeBlock,
27
- listItem = _state$schema$nodes.listItem,
28
- table = _state$schema$nodes.table,
29
- layoutColumn = _state$schema$nodes.layoutColumn;
51
+ var _state$schema$nodes2 = state.schema.nodes,
52
+ codeBlock = _state$schema$nodes2.codeBlock,
53
+ listItem = _state$schema$nodes2.listItem,
54
+ paragraph = _state$schema$nodes2.paragraph,
55
+ table = _state$schema$nodes2.table,
56
+ layoutColumn = _state$schema$nodes2.layoutColumn;
30
57
  if (!$cursor || $cursor.parent.type !== codeBlock || !dispatch) {
31
58
  return false;
32
59
  }
@@ -35,7 +62,11 @@ export function keymapPlugin(schema) {
35
62
  if (!node) {
36
63
  return false;
37
64
  }
38
- dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
65
+ if (getBooleanFF('platform.editor.codeblock-preserve-newlines_54r3m')) {
66
+ replaceWithParagraph(node.node, node.pos, $cursor, state, dispatch);
67
+ } else {
68
+ dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
69
+ }
39
70
  return true;
40
71
  }
41
72
  if ($cursor.node && isEmptyNode(schema)($cursor.node()) && (hasParentNodeOfType(layoutColumn)(state.selection) || hasParentNodeOfType(table)(state.selection))) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,9 +33,9 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/adf-schema": "^35.10.0",
36
+ "@atlaskit/adf-schema": "^35.12.1",
37
37
  "@atlaskit/code": "^15.1.0",
38
- "@atlaskit/editor-common": "^78.31.0",
38
+ "@atlaskit/editor-common": "^78.36.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.1.0",
40
40
  "@atlaskit/editor-plugin-composition": "^1.1.0",
41
41
  "@atlaskit/editor-plugin-decorations": "^1.1.0",
@@ -97,6 +97,9 @@
97
97
  "platform-feature-flags": {
98
98
  "platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
99
99
  "type": "boolean"
100
+ },
101
+ "platform.editor.codeblock-preserve-newlines_54r3m": {
102
+ "type": "boolean"
100
103
  }
101
104
  }
102
105
  }