@atlaskit/editor-plugin-code-block 1.2.2 → 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 +165 -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 +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,289 +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
|
+
|
|
3
14
|
## 1.2.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
6
17
|
|
|
7
|
-
-
|
|
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
|
|
8
21
|
|
|
9
22
|
## 1.2.1
|
|
10
23
|
|
|
11
24
|
### Patch Changes
|
|
12
25
|
|
|
13
|
-
-
|
|
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
|
|
14
29
|
|
|
15
30
|
## 1.2.0
|
|
16
31
|
|
|
17
32
|
### Minor Changes
|
|
18
33
|
|
|
19
|
-
-
|
|
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
|
|
20
37
|
|
|
21
38
|
### Patch Changes
|
|
22
39
|
|
|
23
|
-
-
|
|
40
|
+
- Updated dependencies
|
|
24
41
|
|
|
25
42
|
## 1.1.11
|
|
26
43
|
|
|
27
44
|
### Patch Changes
|
|
28
45
|
|
|
29
|
-
-
|
|
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
|
|
30
49
|
|
|
31
50
|
## 1.1.10
|
|
32
51
|
|
|
33
52
|
### Patch Changes
|
|
34
53
|
|
|
35
|
-
-
|
|
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
|
|
36
57
|
|
|
37
58
|
## 1.1.9
|
|
38
59
|
|
|
39
60
|
### Patch Changes
|
|
40
61
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
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
|
|
43
66
|
|
|
44
67
|
## 1.1.8
|
|
45
68
|
|
|
46
69
|
### Patch Changes
|
|
47
70
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
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
|
|
50
75
|
|
|
51
76
|
## 1.1.7
|
|
52
77
|
|
|
53
78
|
### Patch Changes
|
|
54
79
|
|
|
55
|
-
-
|
|
56
|
-
-
|
|
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
|
|
57
84
|
|
|
58
85
|
## 1.1.6
|
|
59
86
|
|
|
60
87
|
### Patch Changes
|
|
61
88
|
|
|
62
|
-
-
|
|
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
|
|
63
93
|
|
|
64
94
|
## 1.1.5
|
|
65
95
|
|
|
66
96
|
### Patch Changes
|
|
67
97
|
|
|
68
|
-
-
|
|
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
|
|
69
101
|
|
|
70
102
|
## 1.1.4
|
|
71
103
|
|
|
72
104
|
### Patch Changes
|
|
73
105
|
|
|
74
|
-
-
|
|
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`
|
|
75
109
|
|
|
76
110
|
## 1.1.3
|
|
77
111
|
|
|
78
112
|
### Patch Changes
|
|
79
113
|
|
|
80
|
-
-
|
|
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
|
|
81
117
|
|
|
82
118
|
## 1.1.2
|
|
83
119
|
|
|
84
120
|
### Patch Changes
|
|
85
121
|
|
|
86
|
-
-
|
|
87
|
-
-
|
|
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
|
|
88
126
|
|
|
89
127
|
## 1.1.1
|
|
90
128
|
|
|
91
129
|
### Patch Changes
|
|
92
130
|
|
|
93
|
-
-
|
|
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.
|
|
94
134
|
|
|
95
|
-
|
|
135
|
+
## WHY?
|
|
96
136
|
|
|
97
|
-
|
|
137
|
+
Removing editor-common dependencies from prosemirror-input-rules package.
|
|
98
138
|
|
|
99
|
-
|
|
139
|
+
This makes it easier for editor updates because it simplifies our dependency graph.
|
|
100
140
|
|
|
101
|
-
|
|
141
|
+
## WHAT and HOW?
|
|
102
142
|
|
|
103
|
-
|
|
143
|
+
These are no longer available via `@atlaskit/prosemirror-input-rules` but are available from
|
|
144
|
+
`@atlaskit/editor-common/types`:
|
|
104
145
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
146
|
+
- InputRuleWrapper
|
|
147
|
+
- InputRuleHandler
|
|
148
|
+
- OnHandlerApply
|
|
149
|
+
- createRule
|
|
109
150
|
|
|
110
|
-
|
|
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( ... ))`).
|
|
111
153
|
|
|
112
|
-
|
|
154
|
+
`SafePlugin` exists in `@atlaskit/editor-common/safe-plugin`.
|
|
113
155
|
|
|
114
|
-
|
|
115
|
-
|
|
156
|
+
- createPlugin
|
|
157
|
+
- createInputRulePlugin
|
|
116
158
|
|
|
117
|
-
-
|
|
159
|
+
- Updated dependencies
|
|
118
160
|
|
|
119
161
|
## 1.1.0
|
|
120
162
|
|
|
121
163
|
### Minor Changes
|
|
122
164
|
|
|
123
|
-
-
|
|
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.
|
|
124
168
|
|
|
125
169
|
## 1.0.2
|
|
126
170
|
|
|
127
171
|
### Patch Changes
|
|
128
172
|
|
|
129
|
-
-
|
|
173
|
+
- Updated dependencies
|
|
130
174
|
|
|
131
175
|
## 1.0.1
|
|
132
176
|
|
|
133
177
|
### Patch Changes
|
|
134
178
|
|
|
135
|
-
-
|
|
136
|
-
-
|
|
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
|
|
137
184
|
|
|
138
185
|
## 1.0.0
|
|
139
186
|
|
|
140
187
|
### Major Changes
|
|
141
188
|
|
|
142
|
-
-
|
|
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.
|
|
143
193
|
|
|
144
194
|
### Patch Changes
|
|
145
195
|
|
|
146
|
-
-
|
|
196
|
+
- Updated dependencies
|
|
147
197
|
|
|
148
198
|
## 0.1.20
|
|
149
199
|
|
|
150
200
|
### Patch Changes
|
|
151
201
|
|
|
152
|
-
-
|
|
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
|
|
153
205
|
|
|
154
206
|
## 0.1.19
|
|
155
207
|
|
|
156
208
|
### Patch Changes
|
|
157
209
|
|
|
158
|
-
-
|
|
159
|
-
-
|
|
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
|
|
160
214
|
|
|
161
215
|
## 0.1.18
|
|
162
216
|
|
|
163
217
|
### Patch Changes
|
|
164
218
|
|
|
165
|
-
-
|
|
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
|
|
166
222
|
|
|
167
223
|
## 0.1.17
|
|
168
224
|
|
|
169
225
|
### Patch Changes
|
|
170
226
|
|
|
171
|
-
-
|
|
227
|
+
- Updated dependencies
|
|
172
228
|
|
|
173
229
|
## 0.1.16
|
|
174
230
|
|
|
175
231
|
### Patch Changes
|
|
176
232
|
|
|
177
|
-
-
|
|
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
|
|
178
236
|
|
|
179
237
|
## 0.1.15
|
|
180
238
|
|
|
181
239
|
### Patch Changes
|
|
182
240
|
|
|
183
|
-
-
|
|
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
|
|
184
244
|
|
|
185
245
|
## 0.1.14
|
|
186
246
|
|
|
187
247
|
### Patch Changes
|
|
188
248
|
|
|
189
|
-
-
|
|
190
|
-
-
|
|
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
|
|
191
253
|
|
|
192
254
|
## 0.1.13
|
|
193
255
|
|
|
194
256
|
### Patch Changes
|
|
195
257
|
|
|
196
|
-
-
|
|
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
|
|
197
261
|
|
|
198
262
|
## 0.1.12
|
|
199
263
|
|
|
200
264
|
### Patch Changes
|
|
201
265
|
|
|
202
|
-
-
|
|
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
|
|
203
269
|
|
|
204
270
|
## 0.1.11
|
|
205
271
|
|
|
206
272
|
### Patch Changes
|
|
207
273
|
|
|
208
|
-
-
|
|
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
|
|
209
277
|
|
|
210
278
|
## 0.1.10
|
|
211
279
|
|
|
212
280
|
### Patch Changes
|
|
213
281
|
|
|
214
|
-
-
|
|
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
|
|
215
285
|
|
|
216
286
|
## 0.1.9
|
|
217
287
|
|
|
218
288
|
### Patch Changes
|
|
219
289
|
|
|
220
|
-
-
|
|
290
|
+
- Updated dependencies
|
|
221
291
|
|
|
222
292
|
## 0.1.8
|
|
223
293
|
|
|
224
294
|
### Patch Changes
|
|
225
295
|
|
|
226
|
-
-
|
|
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).
|
|
227
299
|
|
|
228
300
|
## 0.1.7
|
|
229
301
|
|
|
230
302
|
### Patch Changes
|
|
231
303
|
|
|
232
|
-
-
|
|
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
|
|
233
307
|
|
|
234
308
|
## 0.1.6
|
|
235
309
|
|
|
236
310
|
### Patch Changes
|
|
237
311
|
|
|
238
|
-
-
|
|
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
|
|
239
315
|
|
|
240
316
|
## 0.1.5
|
|
241
317
|
|
|
242
318
|
### Patch Changes
|
|
243
319
|
|
|
244
|
-
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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.
|
|
265
344
|
|
|
266
345
|
## 0.1.4
|
|
267
346
|
|
|
268
347
|
### Patch Changes
|
|
269
348
|
|
|
270
|
-
-
|
|
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
|
|
271
352
|
|
|
272
353
|
## 0.1.3
|
|
273
354
|
|
|
274
355
|
### Patch Changes
|
|
275
356
|
|
|
276
|
-
-
|
|
357
|
+
- Updated dependencies
|
|
277
358
|
|
|
278
359
|
## 0.1.2
|
|
279
360
|
|
|
280
361
|
### Patch Changes
|
|
281
362
|
|
|
282
|
-
-
|
|
363
|
+
- Updated dependencies
|
|
283
364
|
|
|
284
365
|
## 0.1.1
|
|
285
366
|
|
|
286
367
|
### Patch Changes
|
|
287
368
|
|
|
288
|
-
-
|
|
289
|
-
-
|
|
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$
|
|
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.3",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.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
|
}
|