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