@atlaskit/editor-plugin-expand 1.6.3 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +231 -86
- package/dist/cjs/singlePlayerExpand/node-views/index.js +50 -23
- package/dist/cjs/singlePlayerExpand/ui/NodeView.js +8 -6
- package/dist/es2019/singlePlayerExpand/node-views/index.js +49 -24
- package/dist/es2019/singlePlayerExpand/ui/NodeView.js +8 -6
- package/dist/esm/singlePlayerExpand/node-views/index.js +51 -24
- package/dist/esm/singlePlayerExpand/ui/NodeView.js +8 -6
- package/dist/types/singlePlayerExpand/node-views/index.d.ts +3 -1
- package/dist/types/singlePlayerExpand/ui/NodeView.d.ts +1 -1
- package/dist/types-ts4.5/singlePlayerExpand/node-views/index.d.ts +3 -1
- package/dist/types-ts4.5/singlePlayerExpand/ui/NodeView.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,360 +1,505 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 1.6.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#95610](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95610)
|
|
8
|
+
[`1520db696653`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1520db696653) -
|
|
9
|
+
[ED-23108] Follow up to refactor the logic in the single player expands update function. Single
|
|
10
|
+
player expands are only used when `platform.editor.single-player-expand` FF AND live page are
|
|
11
|
+
both enabled.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 1.6.4
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#94988](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94988)
|
|
19
|
+
[`8e5daa7c846d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8e5daa7c846d) -
|
|
20
|
+
[ux] [ED-22983] disable editing in singlePlayer expand nodes when editorDisabled state is true.
|
|
21
|
+
these changes are only applied when the
|
|
22
|
+
platform.editor.live-view.disable-editing-in-view-mode_fi1rx FF is on, and the singlePlayer
|
|
23
|
+
expand is used when live view is enabled and the platform.editor.single-player-expand FF is
|
|
24
|
+
enabled.
|
|
25
|
+
|
|
3
26
|
## 1.6.3
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
6
29
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
30
|
+
- [#95226](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95226)
|
|
31
|
+
[`35450b170a19`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35450b170a19) -
|
|
32
|
+
[ux] [ED-23152] Expands no longer change state (open/closed) when the page width is toggled by a
|
|
33
|
+
user (live pages/ single player expands)
|
|
34
|
+
- [#94901](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94901)
|
|
35
|
+
[`da964fcdc828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da964fcdc828) -
|
|
36
|
+
[ED-23097] Bump ADF schema to version 35.12.1
|
|
37
|
+
- [#94398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94398)
|
|
38
|
+
[`4df808e35fda`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4df808e35fda) -
|
|
39
|
+
[ux] [ED-23108] Solve bug where single player expands would lose their expanded state when
|
|
40
|
+
adding breakout marks. Single player expands are only used when
|
|
41
|
+
`platform.editor.single-player-expand` FF AND live page are both enabled.
|
|
10
42
|
|
|
11
43
|
## 1.6.2
|
|
12
44
|
|
|
13
45
|
### Patch Changes
|
|
14
46
|
|
|
15
|
-
-
|
|
47
|
+
- [#93962](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93962)
|
|
48
|
+
[`797e12a40048`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/797e12a40048) -
|
|
49
|
+
[ED-23107] fix functionality for moving down from the title of an expand with the arrow key
|
|
50
|
+
down - you can be anywhere inside the single player expand title and move down now. the single
|
|
51
|
+
player expand is only used when live view is enabled and the
|
|
52
|
+
platform.editor.single-player-expand FF is enabled.
|
|
16
53
|
|
|
17
54
|
## 1.6.1
|
|
18
55
|
|
|
19
56
|
### Patch Changes
|
|
20
57
|
|
|
21
|
-
-
|
|
58
|
+
- [#93689](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93689)
|
|
59
|
+
[`5ba5d2b4a9ac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ba5d2b4a9ac) -
|
|
60
|
+
Updating adf-schema version to 35.10.0
|
|
22
61
|
|
|
23
62
|
## 1.6.0
|
|
24
63
|
|
|
25
64
|
### Minor Changes
|
|
26
65
|
|
|
27
|
-
-
|
|
66
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934)
|
|
67
|
+
[`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) -
|
|
68
|
+
bumped editor-prosemirror version to 4.0.0
|
|
28
69
|
|
|
29
70
|
### Patch Changes
|
|
30
71
|
|
|
31
|
-
-
|
|
72
|
+
- Updated dependencies
|
|
32
73
|
|
|
33
74
|
## 1.5.2
|
|
34
75
|
|
|
35
76
|
### Patch Changes
|
|
36
77
|
|
|
37
|
-
-
|
|
78
|
+
- [#91461](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91461)
|
|
79
|
+
[`1b353cb06cc8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1b353cb06cc8) -
|
|
80
|
+
[ED-23042] Disable editing in code blocks and expand nodes when editorDisabled state is true
|
|
38
81
|
|
|
39
82
|
## 1.5.1
|
|
40
83
|
|
|
41
84
|
### Patch Changes
|
|
42
85
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
86
|
+
- [#92426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92426)
|
|
87
|
+
[`32c76c7c225c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c76c7c225c) -
|
|
88
|
+
Bump adf-schema to 35.9.2 to support table alignment options
|
|
89
|
+
- Updated dependencies
|
|
45
90
|
|
|
46
91
|
## 1.5.0
|
|
47
92
|
|
|
48
93
|
### Minor Changes
|
|
49
94
|
|
|
50
|
-
-
|
|
95
|
+
- [#92831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92831)
|
|
96
|
+
[`c8652f78a9ce`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c8652f78a9ce) -
|
|
97
|
+
[ED-22991] add functionality for moving left and moving right with the single player expands.
|
|
98
|
+
the single player expand is only used when live view is enabled and the
|
|
99
|
+
platform.editor.single-player-expand FF is enabled.
|
|
51
100
|
|
|
52
101
|
### Patch Changes
|
|
53
102
|
|
|
54
|
-
-
|
|
103
|
+
- [#92956](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92956)
|
|
104
|
+
[`33ba4a1b556d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/33ba4a1b556d) -
|
|
105
|
+
[ux] [ED-23085] Fix contenteditable being not set to false when expand closed for single player
|
|
106
|
+
expand. This single player expand is only used when live view is enabled and the
|
|
107
|
+
platform.editor.single-player-expand FF is enabled.
|
|
55
108
|
|
|
56
109
|
## 1.4.3
|
|
57
110
|
|
|
58
111
|
### Patch Changes
|
|
59
112
|
|
|
60
|
-
-
|
|
113
|
+
- [#92468](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92468)
|
|
114
|
+
[`515df766c29c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/515df766c29c) -
|
|
115
|
+
[ux] [ED-23066] Re-render expand toggle icon when the class name is updated so that the
|
|
116
|
+
aria-expanded attribute gets updated to match.
|
|
61
117
|
|
|
62
118
|
## 1.4.2
|
|
63
119
|
|
|
64
120
|
### Patch Changes
|
|
65
121
|
|
|
66
|
-
-
|
|
122
|
+
- [#91886](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91886)
|
|
123
|
+
[`5c0443e007d9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c0443e007d9) -
|
|
124
|
+
[ux] Fix bug where selection marker shows when focussing on the expand title with the keyboard.
|
|
67
125
|
|
|
68
126
|
## 1.4.1
|
|
69
127
|
|
|
70
128
|
### Patch Changes
|
|
71
129
|
|
|
72
|
-
-
|
|
130
|
+
- [#90897](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90897)
|
|
131
|
+
[`6a1d609df65e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6a1d609df65e) -
|
|
132
|
+
[ux] [ED-22841] Implement new state management for the single player expand and handle the
|
|
133
|
+
expanding behaviour based on this. Single player expand will only be used if
|
|
134
|
+
`platform.editor.single-player-expand` is true and livePage is enabled.
|
|
73
135
|
|
|
74
136
|
## 1.4.0
|
|
75
137
|
|
|
76
138
|
### Minor Changes
|
|
77
139
|
|
|
78
|
-
-
|
|
140
|
+
- [#90925](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90925)
|
|
141
|
+
[`431c0d17e3e3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/431c0d17e3e3) -
|
|
142
|
+
[ux] Improve the selection marker by hiding it when in an expand and improving styling by making
|
|
143
|
+
it more subtle.
|
|
79
144
|
|
|
80
145
|
## 1.3.5
|
|
81
146
|
|
|
82
147
|
### Patch Changes
|
|
83
148
|
|
|
84
|
-
-
|
|
85
|
-
-
|
|
149
|
+
- [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106)
|
|
150
|
+
[`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) -
|
|
151
|
+
Bump ADF-schema package to version 35.0.0
|
|
152
|
+
- Updated dependencies
|
|
86
153
|
|
|
87
154
|
## 1.3.4
|
|
88
155
|
|
|
89
156
|
### Patch Changes
|
|
90
157
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
158
|
+
- [#91146](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91146)
|
|
159
|
+
[`c982f92adfee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c982f92adfee) -
|
|
160
|
+
[ux] Revert changes from ED-22666 as expand is not editable when not selected initially
|
|
161
|
+
- Updated dependencies
|
|
93
162
|
|
|
94
163
|
## 1.3.3
|
|
95
164
|
|
|
96
165
|
### Patch Changes
|
|
97
166
|
|
|
98
|
-
-
|
|
167
|
+
- [#90914](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90914)
|
|
168
|
+
[`a4a9d317e5b8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a4a9d317e5b8) -
|
|
169
|
+
[ux] [ED-23013] Fix bug in single player expand where backspace in the title would delete entire
|
|
170
|
+
expand even if the title had content.
|
|
99
171
|
|
|
100
172
|
## 1.3.2
|
|
101
173
|
|
|
102
174
|
### Patch Changes
|
|
103
175
|
|
|
104
|
-
-
|
|
176
|
+
- [#89345](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89345)
|
|
177
|
+
[`80a9a5da9ce4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/80a9a5da9ce4) -
|
|
178
|
+
[ED-22840] Build the base functionality of the new single player expand which will be used for
|
|
179
|
+
live view pages. Single player expand will only be used if
|
|
180
|
+
`platform.editor.single-player-expand` is true and livePage is enabled.
|
|
105
181
|
|
|
106
182
|
## 1.3.1
|
|
107
183
|
|
|
108
184
|
### Patch Changes
|
|
109
185
|
|
|
110
|
-
-
|
|
186
|
+
- [#89499](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89499)
|
|
187
|
+
[`1a3ac47ce689`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1a3ac47ce689) -
|
|
188
|
+
ED-22666 Disable editing when editor in view mode or edtable is false
|
|
111
189
|
|
|
112
190
|
## 1.3.0
|
|
113
191
|
|
|
114
192
|
### Minor Changes
|
|
115
193
|
|
|
116
|
-
-
|
|
194
|
+
- [#87870](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87870)
|
|
195
|
+
[`76711a3e7edd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/76711a3e7edd) -
|
|
196
|
+
[ED-22839] Refactor expand plugin to use either legacy (current) expand or single player expand
|
|
197
|
+
(coming soon). Single player expand will only be used if `platform.editor.single-player-expand`
|
|
198
|
+
is true and livePage is enabled.
|
|
117
199
|
|
|
118
200
|
## 1.2.6
|
|
119
201
|
|
|
120
202
|
### Patch Changes
|
|
121
203
|
|
|
122
|
-
-
|
|
123
|
-
-
|
|
204
|
+
- [#88038](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88038)
|
|
205
|
+
[`19ac4de34153`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/19ac4de34153) -
|
|
206
|
+
update 'w3c-keyname' dependency to 2.1.8
|
|
207
|
+
- Updated dependencies
|
|
124
208
|
|
|
125
209
|
## 1.2.5
|
|
126
210
|
|
|
127
211
|
### Patch Changes
|
|
128
212
|
|
|
129
|
-
-
|
|
213
|
+
- [#86724](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86724)
|
|
214
|
+
[`718a9aa2424d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/718a9aa2424d) -
|
|
215
|
+
[ED-22607] Remove references to maxFrames for multi bodied extensions and bump adf-schema from
|
|
216
|
+
35.7.0 to 35.8.0
|
|
130
217
|
|
|
131
218
|
## 1.2.4
|
|
132
219
|
|
|
133
220
|
### Patch Changes
|
|
134
221
|
|
|
135
|
-
-
|
|
222
|
+
- [#81777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81777)
|
|
223
|
+
[`c6d7a5378751`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d7a5378751) -
|
|
224
|
+
Bump adf-schema to 35.7.0
|
|
136
225
|
|
|
137
226
|
## 1.2.3
|
|
138
227
|
|
|
139
228
|
### Patch Changes
|
|
140
229
|
|
|
141
|
-
-
|
|
230
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
|
|
231
|
+
[`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
|
|
232
|
+
Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
142
233
|
|
|
143
234
|
## 1.2.2
|
|
144
235
|
|
|
145
236
|
### Patch Changes
|
|
146
237
|
|
|
147
|
-
-
|
|
238
|
+
- [#80679](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80679)
|
|
239
|
+
[`104eb9443b7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104eb9443b7e) -
|
|
240
|
+
ED-22553 Updating adf-schema version to 35.6.0
|
|
148
241
|
|
|
149
242
|
## 1.2.1
|
|
150
243
|
|
|
151
244
|
### Patch Changes
|
|
152
245
|
|
|
153
|
-
-
|
|
154
|
-
-
|
|
246
|
+
- [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224)
|
|
247
|
+
[`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) -
|
|
248
|
+
ED-22219: adf-schema updated to 35.5.2
|
|
249
|
+
- Updated dependencies
|
|
155
250
|
|
|
156
251
|
## 1.2.0
|
|
157
252
|
|
|
158
253
|
### Minor Changes
|
|
159
254
|
|
|
160
|
-
-
|
|
255
|
+
- [#76115](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/76115)
|
|
256
|
+
[`3e3eb7cf04e1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e3eb7cf04e1) -
|
|
257
|
+
ED-21718 Transform slice to remove nestedExpand from slice before pasting
|
|
161
258
|
|
|
162
259
|
### Patch Changes
|
|
163
260
|
|
|
164
|
-
-
|
|
261
|
+
- Updated dependencies
|
|
165
262
|
|
|
166
263
|
## 1.1.0
|
|
167
264
|
|
|
168
265
|
### Minor Changes
|
|
169
266
|
|
|
170
|
-
-
|
|
267
|
+
- [#75042](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75042)
|
|
268
|
+
[`ce823f018248`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ce823f018248) -
|
|
269
|
+
[ux] ED-21987 Diverge expands in live pages so that they are not multiplayer, and are closed by
|
|
270
|
+
default.
|
|
171
271
|
|
|
172
272
|
### Patch Changes
|
|
173
273
|
|
|
174
|
-
-
|
|
274
|
+
- Updated dependencies
|
|
175
275
|
|
|
176
276
|
## 1.0.1
|
|
177
277
|
|
|
178
278
|
### Patch Changes
|
|
179
279
|
|
|
180
|
-
-
|
|
280
|
+
- Updated dependencies
|
|
181
281
|
|
|
182
282
|
## 1.0.0
|
|
183
283
|
|
|
184
284
|
### Major Changes
|
|
185
285
|
|
|
186
|
-
-
|
|
286
|
+
- [#72386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72386)
|
|
287
|
+
[`0c52b0be40c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c52b0be40c1) -
|
|
288
|
+
This changeset exists to bump all editor plugins that currently don't have a major version. This
|
|
289
|
+
is to address an issue with Jira plugin consumption.
|
|
187
290
|
|
|
188
291
|
### Patch Changes
|
|
189
292
|
|
|
190
|
-
-
|
|
293
|
+
- Updated dependencies
|
|
191
294
|
|
|
192
295
|
## 0.4.8
|
|
193
296
|
|
|
194
297
|
### Patch Changes
|
|
195
298
|
|
|
196
|
-
-
|
|
299
|
+
- [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572)
|
|
300
|
+
[`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) -
|
|
301
|
+
Upgrading @atlaskit/editor-prosemirror dependency
|
|
197
302
|
|
|
198
303
|
## 0.4.7
|
|
199
304
|
|
|
200
305
|
### Patch Changes
|
|
201
306
|
|
|
202
|
-
-
|
|
307
|
+
- [#71186](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71186)
|
|
308
|
+
[`d76c62a2d98a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d76c62a2d98a) -
|
|
309
|
+
[ux] ED-22029 Use extendedNestedExpand node when 'platform.editor.allow-extended-nested-panel'
|
|
310
|
+
FF is enabled
|
|
203
311
|
|
|
204
312
|
## 0.4.6
|
|
205
313
|
|
|
206
314
|
### Patch Changes
|
|
207
315
|
|
|
208
|
-
-
|
|
316
|
+
- [#70152](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70152)
|
|
317
|
+
[`53ed3673df28`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/53ed3673df28) -
|
|
318
|
+
Updating adf-schema version to 35.5.1
|
|
209
319
|
|
|
210
320
|
## 0.4.5
|
|
211
321
|
|
|
212
322
|
### Patch Changes
|
|
213
323
|
|
|
214
|
-
-
|
|
324
|
+
- Updated dependencies
|
|
215
325
|
|
|
216
326
|
## 0.4.4
|
|
217
327
|
|
|
218
328
|
### Patch Changes
|
|
219
329
|
|
|
220
|
-
-
|
|
330
|
+
- [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238)
|
|
331
|
+
[`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) -
|
|
332
|
+
[ED-21835] Change EditorAPI type to always union with undefined
|
|
221
333
|
|
|
222
334
|
## 0.4.3
|
|
223
335
|
|
|
224
336
|
### Patch Changes
|
|
225
337
|
|
|
226
|
-
-
|
|
338
|
+
- Updated dependencies
|
|
227
339
|
|
|
228
340
|
## 0.4.2
|
|
229
341
|
|
|
230
342
|
### Patch Changes
|
|
231
343
|
|
|
232
|
-
-
|
|
344
|
+
- [#65802](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65802)
|
|
345
|
+
[`438ead060875`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/438ead060875) -
|
|
346
|
+
Ensure all editor plugins are marked as singletons
|
|
233
347
|
|
|
234
348
|
## 0.4.1
|
|
235
349
|
|
|
236
350
|
### Patch Changes
|
|
237
351
|
|
|
238
|
-
-
|
|
239
|
-
-
|
|
352
|
+
- [#65031](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65031)
|
|
353
|
+
[`a00094111b5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a00094111b5a) -
|
|
354
|
+
ED-21609 Update adf-schema to 35.3.0
|
|
355
|
+
- Updated dependencies
|
|
240
356
|
|
|
241
357
|
## 0.4.0
|
|
242
358
|
|
|
243
359
|
### Minor Changes
|
|
244
360
|
|
|
245
|
-
-
|
|
361
|
+
- [#64335](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64335)
|
|
362
|
+
[`efc8826c907f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/efc8826c907f) -
|
|
363
|
+
[ux] [ED-16509] Restart numbered list inserting nodes via QUICK INSERT, nodes including :
|
|
364
|
+
panels, expands, decisions, tables, layout, quotes, actions, dividers, headings. Changes are
|
|
365
|
+
being guarded behind feature flag platform.editor.ordered-list-inserting-nodes_bh0vo
|
|
246
366
|
|
|
247
367
|
### Patch Changes
|
|
248
368
|
|
|
249
|
-
-
|
|
369
|
+
- Updated dependencies
|
|
250
370
|
|
|
251
371
|
## 0.3.0
|
|
252
372
|
|
|
253
373
|
### Minor Changes
|
|
254
374
|
|
|
255
|
-
-
|
|
375
|
+
- [#62737](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62737)
|
|
376
|
+
[`2a6280e4e570`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2a6280e4e570) -
|
|
377
|
+
Add new configuration option to expand plugin (`allowInteractiveExpand`) to configure the
|
|
378
|
+
plugin. Previously the consumer would have to set the `interactiveExpand` feature flag in the
|
|
379
|
+
expand plugin to configure this behaviour. It is also now set by default.
|
|
256
380
|
|
|
257
381
|
## 0.2.1
|
|
258
382
|
|
|
259
383
|
### Patch Changes
|
|
260
384
|
|
|
261
|
-
-
|
|
385
|
+
- [#62165](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62165)
|
|
386
|
+
[`b44ac0968d79`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b44ac0968d79) -
|
|
387
|
+
[ED-21562] Bump @atlaskit/adf-schema to 35.2.0 for border mark update
|
|
262
388
|
|
|
263
389
|
## 0.2.0
|
|
264
390
|
|
|
265
391
|
### Minor Changes
|
|
266
392
|
|
|
267
|
-
-
|
|
393
|
+
- [#61501](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/61501)
|
|
394
|
+
[`943c6cbeb965`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/943c6cbeb965) -
|
|
395
|
+
Aria-expanded attribute for Expand/Collapse button.
|
|
268
396
|
|
|
269
397
|
## 0.1.12
|
|
270
398
|
|
|
271
399
|
### Patch Changes
|
|
272
400
|
|
|
273
|
-
-
|
|
401
|
+
- Updated dependencies
|
|
274
402
|
|
|
275
403
|
## 0.1.11
|
|
276
404
|
|
|
277
405
|
### Patch Changes
|
|
278
406
|
|
|
279
|
-
-
|
|
407
|
+
- [#60808](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60808)
|
|
408
|
+
[`f509a21be124`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f509a21be124) -
|
|
409
|
+
ED-21506: @atlaskit/adf-schema upgraded to 35.1.1 to support renderer for MBE
|
|
280
410
|
|
|
281
411
|
## 0.1.10
|
|
282
412
|
|
|
283
413
|
### Patch Changes
|
|
284
414
|
|
|
285
|
-
-
|
|
415
|
+
- [#58246](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58246)
|
|
416
|
+
[`a381b2599716`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a381b2599716) -
|
|
417
|
+
ED-21371 Update adf-schema to 35.1.0
|
|
286
418
|
|
|
287
419
|
## 0.1.9
|
|
288
420
|
|
|
289
421
|
### Patch Changes
|
|
290
422
|
|
|
291
|
-
-
|
|
423
|
+
- Updated dependencies
|
|
292
424
|
|
|
293
425
|
## 0.1.8
|
|
294
426
|
|
|
295
427
|
### Patch Changes
|
|
296
428
|
|
|
297
|
-
-
|
|
429
|
+
- [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147)
|
|
430
|
+
[`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) -
|
|
431
|
+
Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
|
|
298
432
|
|
|
299
433
|
## 0.1.7
|
|
300
434
|
|
|
301
435
|
### Patch Changes
|
|
302
436
|
|
|
303
|
-
-
|
|
437
|
+
- [#58763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58763)
|
|
438
|
+
[`0fdbd64522bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fdbd64522bf) -
|
|
439
|
+
update ADF schema
|
|
304
440
|
|
|
305
441
|
## 0.1.6
|
|
306
442
|
|
|
307
443
|
### Patch Changes
|
|
308
444
|
|
|
309
|
-
-
|
|
445
|
+
- [#56790](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56790)
|
|
446
|
+
[`ff577a7969d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff577a7969d4) -
|
|
447
|
+
ED-21266: Updated @atlaskit/adf-schema to 34.0.1
|
|
310
448
|
|
|
311
449
|
## 0.1.5
|
|
312
450
|
|
|
313
451
|
### Patch Changes
|
|
314
452
|
|
|
315
|
-
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
453
|
+
- [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646)
|
|
454
|
+
[`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make
|
|
455
|
+
feature flags plugin optional in all plugins including:
|
|
456
|
+
|
|
457
|
+
- analytics
|
|
458
|
+
- base
|
|
459
|
+
- card
|
|
460
|
+
- code-block
|
|
461
|
+
- expand
|
|
462
|
+
- extension
|
|
463
|
+
- floating-toolbar
|
|
464
|
+
- hyperlink
|
|
465
|
+
- insert-block
|
|
466
|
+
- layout
|
|
467
|
+
- layout
|
|
468
|
+
- list
|
|
469
|
+
- media
|
|
470
|
+
- paste
|
|
471
|
+
- rule
|
|
472
|
+
- table
|
|
473
|
+
- tasks-and-decisions
|
|
474
|
+
|
|
475
|
+
We already treat it as optional in the plugins, so this is just ensuring that the plugin is not
|
|
476
|
+
mandatory to be added to the preset.
|
|
336
477
|
|
|
337
478
|
## 0.1.4
|
|
338
479
|
|
|
339
480
|
### Patch Changes
|
|
340
481
|
|
|
341
|
-
-
|
|
482
|
+
- [#43417](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43417)
|
|
483
|
+
[`3f3c17f0273`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f3c17f0273) -
|
|
484
|
+
ED-20971 Upgrade adf-schema package to ^34.0.0
|
|
342
485
|
|
|
343
486
|
## 0.1.3
|
|
344
487
|
|
|
345
488
|
### Patch Changes
|
|
346
489
|
|
|
347
|
-
-
|
|
490
|
+
- Updated dependencies
|
|
348
491
|
|
|
349
492
|
## 0.1.2
|
|
350
493
|
|
|
351
494
|
### Patch Changes
|
|
352
495
|
|
|
353
|
-
-
|
|
354
|
-
-
|
|
496
|
+
- [#43379](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43379)
|
|
497
|
+
[`482c025520d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/482c025520d) -
|
|
498
|
+
ED-20763 Upgrade ADF schema version to 33.2.3 for MBE nodes.
|
|
499
|
+
- Updated dependencies
|
|
355
500
|
|
|
356
501
|
## 0.1.1
|
|
357
502
|
|
|
358
503
|
### Patch Changes
|
|
359
504
|
|
|
360
|
-
-
|
|
505
|
+
- Updated dependencies
|
|
@@ -17,14 +17,17 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
17
17
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
18
18
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
19
19
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var _commands = require("../commands");
|
|
21
22
|
var _NodeView = require("../ui/NodeView");
|
|
22
23
|
var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
23
|
-
function ExpandNodeView(
|
|
24
|
+
function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api) {
|
|
24
25
|
var _this = this,
|
|
25
|
-
|
|
26
|
+
_api$editorDisabled,
|
|
27
|
+
_this$api6;
|
|
26
28
|
var allowInteractiveExpand = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
27
29
|
var __livePage = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
30
|
+
var cleanUpEditorDisabledOnChange = arguments.length > 9 ? arguments[9] : undefined;
|
|
28
31
|
(0, _classCallCheck2.default)(this, ExpandNodeView);
|
|
29
32
|
(0, _defineProperty2.default)(this, "allowInteractiveExpand", true);
|
|
30
33
|
(0, _defineProperty2.default)(this, "isMobile", false);
|
|
@@ -322,14 +325,23 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
322
325
|
}
|
|
323
326
|
}
|
|
324
327
|
});
|
|
328
|
+
(0, _defineProperty2.default)(this, "getContentEditable", function (node) {
|
|
329
|
+
var contentEditable = !(0, _expand.isExpandCollapsed)(node);
|
|
330
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && _this.api && _this.api.editorDisabled) {
|
|
331
|
+
var _this$api$editorDisab;
|
|
332
|
+
return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
333
|
+
}
|
|
334
|
+
return contentEditable;
|
|
335
|
+
});
|
|
325
336
|
this.selectNearNode = selectNearNode;
|
|
326
337
|
this.__livePage = __livePage;
|
|
338
|
+
this.cleanUpEditorDisabledOnChange = cleanUpEditorDisabledOnChange;
|
|
327
339
|
this.intl = getIntl();
|
|
328
340
|
this.allowInteractiveExpand = allowInteractiveExpand;
|
|
329
341
|
this.getPos = getPos;
|
|
330
342
|
this.view = view;
|
|
331
|
-
this.node =
|
|
332
|
-
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, (0, _NodeView.toDOM)(
|
|
343
|
+
this.node = _node;
|
|
344
|
+
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, (0, _NodeView.toDOM)(_node, this.__livePage, this.intl, api === null || api === void 0 || (_api$editorDisabled = api.editorDisabled) === null || _api$editorDisabled === void 0 || (_api$editorDisabled = _api$editorDisabled.sharedState.currentState()) === null || _api$editorDisabled === void 0 ? void 0 : _api$editorDisabled.editorDisabled)),
|
|
333
345
|
dom = _DOMSerializer$render.dom,
|
|
334
346
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
335
347
|
this.dom = dom;
|
|
@@ -343,8 +355,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
343
355
|
if (!_expand.expandedState.has(this.node)) {
|
|
344
356
|
_expand.expandedState.set(this.node, false);
|
|
345
357
|
}
|
|
346
|
-
this.
|
|
347
|
-
(0, _NodeView.renderIcon)(this.icon, this.allowInteractiveExpand, (_expandedState$get = _expand.expandedState.get(this.node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false, this.intl);
|
|
358
|
+
(0, _NodeView.renderIcon)(this.icon, this.allowInteractiveExpand, !(0, _expand.isExpandCollapsed)(this.node), this.intl);
|
|
348
359
|
if (!this.input || !this.titleContainer || !this.icon) {
|
|
349
360
|
return;
|
|
350
361
|
}
|
|
@@ -360,6 +371,21 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
360
371
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
361
372
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
362
373
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
374
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
375
|
+
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
376
|
+
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
377
|
+
if (_this.input) {
|
|
378
|
+
if (editorDisabled) {
|
|
379
|
+
_this.input.setAttribute('readonly', 'true');
|
|
380
|
+
} else {
|
|
381
|
+
_this.input.removeAttribute('readonly');
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (_this.content) {
|
|
385
|
+
_this.content.setAttribute('contenteditable', _this.getContentEditable(_this.node) ? 'true' : 'false');
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
363
389
|
}
|
|
364
390
|
(0, _createClass2.default)(ExpandNodeView, [{
|
|
365
391
|
key: "stopEvent",
|
|
@@ -394,24 +420,22 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
394
420
|
}
|
|
395
421
|
});
|
|
396
422
|
|
|
397
|
-
// This
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
} else if (this.node !== node) {
|
|
406
|
-
// This checks if the node has been replaced with a different version
|
|
407
|
-
// and updates the state of the new node to match the old one
|
|
408
|
-
var previousExpandedState = _expand.expandedState.get(this.node);
|
|
409
|
-
if (previousExpandedState === undefined) {
|
|
410
|
-
previousExpandedState = true;
|
|
423
|
+
// This checks if the node has been replaced with a different version
|
|
424
|
+
// and updates the state of the new node to match the old one
|
|
425
|
+
// Eg. typing in a node changes it to a new node so it must be updated
|
|
426
|
+
// in the expandedState weak map
|
|
427
|
+
if (this.node !== node) {
|
|
428
|
+
var wasExpanded = _expand.expandedState.get(this.node);
|
|
429
|
+
if (wasExpanded) {
|
|
430
|
+
_expand.expandedState.set(node, wasExpanded);
|
|
411
431
|
}
|
|
412
|
-
|
|
432
|
+
}
|
|
433
|
+
if (this.content) {
|
|
434
|
+
// Disallow interaction/selection inside when collapsed.
|
|
435
|
+
this.content.setAttribute('contenteditable', this.getContentEditable(node) ? 'true' : 'false');
|
|
413
436
|
}
|
|
414
437
|
this.node = node;
|
|
438
|
+
this.updateExpandToggleIcon(this.node);
|
|
415
439
|
return true;
|
|
416
440
|
}
|
|
417
441
|
return false;
|
|
@@ -421,10 +445,10 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
421
445
|
value: function updateExpandToggleIcon(node) {
|
|
422
446
|
var expanded = _expand.expandedState.get(node) ? _expand.expandedState.get(node) : false;
|
|
423
447
|
if (this.dom && expanded !== undefined) {
|
|
424
|
-
var _expandedState$
|
|
448
|
+
var _expandedState$get;
|
|
425
449
|
this.dom.className = (0, _NodeView.buildExpandClassName)(node.type.name, expanded);
|
|
426
450
|
// Re-render the icon to update the aria-expanded attribute
|
|
427
|
-
(0, _NodeView.renderIcon)(this.icon ? this.icon : null, this.allowInteractiveExpand, (_expandedState$
|
|
451
|
+
(0, _NodeView.renderIcon)(this.icon ? this.icon : null, this.allowInteractiveExpand, (_expandedState$get = _expand.expandedState.get(node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false, this.intl);
|
|
428
452
|
}
|
|
429
453
|
this.updateExpandBodyContentEditable();
|
|
430
454
|
}
|
|
@@ -451,6 +475,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
451
475
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
452
476
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
453
477
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
|
|
478
|
+
if (this.cleanUpEditorDisabledOnChange) {
|
|
479
|
+
this.cleanUpEditorDisabledOnChange();
|
|
480
|
+
}
|
|
454
481
|
_reactDom.default.unmountComponentAtNode(this.icon);
|
|
455
482
|
}
|
|
456
483
|
}]);
|
|
@@ -10,11 +10,12 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
10
10
|
var _expand = require("@atlaskit/editor-common/expand");
|
|
11
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _ExpandButton = require("../ui/ExpandButton");
|
|
14
15
|
var buildExpandClassName = exports.buildExpandClassName = function buildExpandClassName(type, expanded) {
|
|
15
16
|
return "".concat(_styles.expandClassNames.prefix, " ").concat(_styles.expandClassNames.type(type), " ").concat(expanded ? _styles.expandClassNames.expanded : '');
|
|
16
17
|
};
|
|
17
|
-
var toDOM = exports.toDOM = function toDOM(node, __livePage, intl) {
|
|
18
|
+
var toDOM = exports.toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditable) {
|
|
18
19
|
var _expandedState$get;
|
|
19
20
|
return ['div', {
|
|
20
21
|
// prettier-ignore
|
|
@@ -41,11 +42,12 @@ var toDOM = exports.toDOM = function toDOM(node, __livePage, intl) {
|
|
|
41
42
|
'class': _styles.expandClassNames.titleInput,
|
|
42
43
|
value: node.attrs.title,
|
|
43
44
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(_ui.expandMessages.expandPlaceholderText) || _ui.expandMessages.expandPlaceholderText.defaultMessage,
|
|
44
|
-
type: 'text'
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
type: 'text',
|
|
46
|
+
readonly: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && titleReadOnly ? 'true' : undefined
|
|
47
|
+
}]]], ['div', {
|
|
48
|
+
// prettier-ignore
|
|
49
|
+
class: _styles.expandClassNames.content,
|
|
50
|
+
contenteditable: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && contentEditable ? contentEditable ? 'true' : 'false' : undefined
|
|
49
51
|
}, 0]];
|
|
50
52
|
};
|
|
51
53
|
var renderIcon = exports.renderIcon = function renderIcon(icon, allowInteractiveExpand, expanded, intl) {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import { keyName } from 'w3c-keyname';
|
|
4
|
-
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
4
|
+
import { expandedState, isExpandCollapsed } from '@atlaskit/editor-common/expand';
|
|
5
5
|
import { GapCursorSelection, RelativeSelectionPos, Side } from '@atlaskit/editor-common/selection';
|
|
6
6
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
7
7
|
import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
9
9
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
|
|
11
12
|
import { buildExpandClassName, renderIcon, toDOM } from '../ui/NodeView';
|
|
12
13
|
export class ExpandNodeView {
|
|
13
|
-
constructor(
|
|
14
|
-
var
|
|
14
|
+
constructor(_node, view, getPos, getIntl, isMobile, selectNearNode, api, allowInteractiveExpand = true, __livePage = false, cleanUpEditorDisabledOnChange) {
|
|
15
|
+
var _api$editorDisabled, _api$editorDisabled$s, _this$api6;
|
|
15
16
|
_defineProperty(this, "allowInteractiveExpand", true);
|
|
16
17
|
_defineProperty(this, "isMobile", false);
|
|
17
18
|
_defineProperty(this, "focusTitle", () => {
|
|
@@ -323,17 +324,26 @@ export class ExpandNodeView {
|
|
|
323
324
|
}
|
|
324
325
|
}
|
|
325
326
|
});
|
|
327
|
+
_defineProperty(this, "getContentEditable", node => {
|
|
328
|
+
const contentEditable = !isExpandCollapsed(node);
|
|
329
|
+
if (getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && this.api && this.api.editorDisabled) {
|
|
330
|
+
var _this$api$editorDisab;
|
|
331
|
+
return !((_this$api$editorDisab = this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
332
|
+
}
|
|
333
|
+
return contentEditable;
|
|
334
|
+
});
|
|
326
335
|
this.selectNearNode = selectNearNode;
|
|
327
336
|
this.__livePage = __livePage;
|
|
337
|
+
this.cleanUpEditorDisabledOnChange = cleanUpEditorDisabledOnChange;
|
|
328
338
|
this.intl = getIntl();
|
|
329
339
|
this.allowInteractiveExpand = allowInteractiveExpand;
|
|
330
340
|
this.getPos = getPos;
|
|
331
341
|
this.view = view;
|
|
332
|
-
this.node =
|
|
342
|
+
this.node = _node;
|
|
333
343
|
const {
|
|
334
344
|
dom,
|
|
335
345
|
contentDOM
|
|
336
|
-
} = DOMSerializer.renderSpec(document, toDOM(
|
|
346
|
+
} = DOMSerializer.renderSpec(document, toDOM(_node, this.__livePage, this.intl, api === null || api === void 0 ? void 0 : (_api$editorDisabled = api.editorDisabled) === null || _api$editorDisabled === void 0 ? void 0 : (_api$editorDisabled$s = _api$editorDisabled.sharedState.currentState()) === null || _api$editorDisabled$s === void 0 ? void 0 : _api$editorDisabled$s.editorDisabled));
|
|
337
347
|
this.dom = dom;
|
|
338
348
|
this.contentDOM = contentDOM;
|
|
339
349
|
this.isMobile = isMobile;
|
|
@@ -345,8 +355,7 @@ export class ExpandNodeView {
|
|
|
345
355
|
if (!expandedState.has(this.node)) {
|
|
346
356
|
expandedState.set(this.node, false);
|
|
347
357
|
}
|
|
348
|
-
this.
|
|
349
|
-
renderIcon(this.icon, this.allowInteractiveExpand, (_expandedState$get = expandedState.get(this.node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false, this.intl);
|
|
358
|
+
renderIcon(this.icon, this.allowInteractiveExpand, !isExpandCollapsed(this.node), this.intl);
|
|
350
359
|
if (!this.input || !this.titleContainer || !this.icon) {
|
|
351
360
|
return;
|
|
352
361
|
}
|
|
@@ -362,6 +371,21 @@ export class ExpandNodeView {
|
|
|
362
371
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
363
372
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
364
373
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
374
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled && getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
375
|
+
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(sharedState => {
|
|
376
|
+
const editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
377
|
+
if (this.input) {
|
|
378
|
+
if (editorDisabled) {
|
|
379
|
+
this.input.setAttribute('readonly', 'true');
|
|
380
|
+
} else {
|
|
381
|
+
this.input.removeAttribute('readonly');
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (this.content) {
|
|
385
|
+
this.content.setAttribute('contenteditable', this.getContentEditable(this.node) ? 'true' : 'false');
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
365
389
|
}
|
|
366
390
|
stopEvent(event) {
|
|
367
391
|
const target = event.target;
|
|
@@ -389,24 +413,22 @@ export class ExpandNodeView {
|
|
|
389
413
|
}
|
|
390
414
|
});
|
|
391
415
|
|
|
392
|
-
// This
|
|
393
|
-
//
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
} else if (this.node !== node) {
|
|
401
|
-
// This checks if the node has been replaced with a different version
|
|
402
|
-
// and updates the state of the new node to match the old one
|
|
403
|
-
let previousExpandedState = expandedState.get(this.node);
|
|
404
|
-
if (previousExpandedState === undefined) {
|
|
405
|
-
previousExpandedState = true;
|
|
416
|
+
// This checks if the node has been replaced with a different version
|
|
417
|
+
// and updates the state of the new node to match the old one
|
|
418
|
+
// Eg. typing in a node changes it to a new node so it must be updated
|
|
419
|
+
// in the expandedState weak map
|
|
420
|
+
if (this.node !== node) {
|
|
421
|
+
const wasExpanded = expandedState.get(this.node);
|
|
422
|
+
if (wasExpanded) {
|
|
423
|
+
expandedState.set(node, wasExpanded);
|
|
406
424
|
}
|
|
407
|
-
|
|
425
|
+
}
|
|
426
|
+
if (this.content) {
|
|
427
|
+
// Disallow interaction/selection inside when collapsed.
|
|
428
|
+
this.content.setAttribute('contenteditable', this.getContentEditable(node) ? 'true' : 'false');
|
|
408
429
|
}
|
|
409
430
|
this.node = node;
|
|
431
|
+
this.updateExpandToggleIcon(this.node);
|
|
410
432
|
return true;
|
|
411
433
|
}
|
|
412
434
|
return false;
|
|
@@ -414,10 +436,10 @@ export class ExpandNodeView {
|
|
|
414
436
|
updateExpandToggleIcon(node) {
|
|
415
437
|
const expanded = expandedState.get(node) ? expandedState.get(node) : false;
|
|
416
438
|
if (this.dom && expanded !== undefined) {
|
|
417
|
-
var _expandedState$
|
|
439
|
+
var _expandedState$get;
|
|
418
440
|
this.dom.className = buildExpandClassName(node.type.name, expanded);
|
|
419
441
|
// Re-render the icon to update the aria-expanded attribute
|
|
420
|
-
renderIcon(this.icon ? this.icon : null, this.allowInteractiveExpand, (_expandedState$
|
|
442
|
+
renderIcon(this.icon ? this.icon : null, this.allowInteractiveExpand, (_expandedState$get = expandedState.get(node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false, this.intl);
|
|
421
443
|
}
|
|
422
444
|
this.updateExpandBodyContentEditable();
|
|
423
445
|
}
|
|
@@ -440,6 +462,9 @@ export class ExpandNodeView {
|
|
|
440
462
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
441
463
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
442
464
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 ? void 0 : _this$decorationClean2.call(this);
|
|
465
|
+
if (this.cleanUpEditorDisabledOnChange) {
|
|
466
|
+
this.cleanUpEditorDisabledOnChange();
|
|
467
|
+
}
|
|
443
468
|
ReactDOM.unmountComponentAtNode(this.icon);
|
|
444
469
|
}
|
|
445
470
|
}
|
|
@@ -3,11 +3,12 @@ import ReactDOM from 'react-dom';
|
|
|
3
3
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
4
4
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { expandMessages } from '@atlaskit/editor-common/ui';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { ExpandButton } from '../ui/ExpandButton';
|
|
7
8
|
export const buildExpandClassName = (type, expanded) => {
|
|
8
9
|
return `${expandClassNames.prefix} ${expandClassNames.type(type)} ${expanded ? expandClassNames.expanded : ''}`;
|
|
9
10
|
};
|
|
10
|
-
export const toDOM = (node, __livePage, intl) => {
|
|
11
|
+
export const toDOM = (node, __livePage, intl, titleReadOnly, contentEditable) => {
|
|
11
12
|
var _expandedState$get;
|
|
12
13
|
return ['div', {
|
|
13
14
|
// prettier-ignore
|
|
@@ -34,11 +35,12 @@ export const toDOM = (node, __livePage, intl) => {
|
|
|
34
35
|
'class': expandClassNames.titleInput,
|
|
35
36
|
value: node.attrs.title,
|
|
36
37
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
37
|
-
type: 'text'
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
type: 'text',
|
|
39
|
+
readonly: getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && titleReadOnly ? 'true' : undefined
|
|
40
|
+
}]]], ['div', {
|
|
41
|
+
// prettier-ignore
|
|
42
|
+
class: expandClassNames.content,
|
|
43
|
+
contenteditable: getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && contentEditable ? contentEditable ? 'true' : 'false' : undefined
|
|
42
44
|
}, 0]];
|
|
43
45
|
};
|
|
44
46
|
export const renderIcon = (icon, allowInteractiveExpand, expanded, intl) => {
|
|
@@ -3,20 +3,23 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
5
|
import { keyName } from 'w3c-keyname';
|
|
6
|
-
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
6
|
+
import { expandedState, isExpandCollapsed } from '@atlaskit/editor-common/expand';
|
|
7
7
|
import { GapCursorSelection, RelativeSelectionPos, Side } from '@atlaskit/editor-common/selection';
|
|
8
8
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
11
11
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
|
|
13
14
|
import { buildExpandClassName, renderIcon, toDOM } from '../ui/NodeView';
|
|
14
15
|
export var ExpandNodeView = /*#__PURE__*/function () {
|
|
15
|
-
function ExpandNodeView(
|
|
16
|
+
function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api) {
|
|
16
17
|
var _this = this,
|
|
17
|
-
|
|
18
|
+
_api$editorDisabled,
|
|
19
|
+
_this$api6;
|
|
18
20
|
var allowInteractiveExpand = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
19
21
|
var __livePage = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
22
|
+
var cleanUpEditorDisabledOnChange = arguments.length > 9 ? arguments[9] : undefined;
|
|
20
23
|
_classCallCheck(this, ExpandNodeView);
|
|
21
24
|
_defineProperty(this, "allowInteractiveExpand", true);
|
|
22
25
|
_defineProperty(this, "isMobile", false);
|
|
@@ -314,14 +317,23 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
314
317
|
}
|
|
315
318
|
}
|
|
316
319
|
});
|
|
320
|
+
_defineProperty(this, "getContentEditable", function (node) {
|
|
321
|
+
var contentEditable = !isExpandCollapsed(node);
|
|
322
|
+
if (getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && _this.api && _this.api.editorDisabled) {
|
|
323
|
+
var _this$api$editorDisab;
|
|
324
|
+
return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
325
|
+
}
|
|
326
|
+
return contentEditable;
|
|
327
|
+
});
|
|
317
328
|
this.selectNearNode = selectNearNode;
|
|
318
329
|
this.__livePage = __livePage;
|
|
330
|
+
this.cleanUpEditorDisabledOnChange = cleanUpEditorDisabledOnChange;
|
|
319
331
|
this.intl = getIntl();
|
|
320
332
|
this.allowInteractiveExpand = allowInteractiveExpand;
|
|
321
333
|
this.getPos = getPos;
|
|
322
334
|
this.view = view;
|
|
323
|
-
this.node =
|
|
324
|
-
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(
|
|
335
|
+
this.node = _node;
|
|
336
|
+
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(_node, this.__livePage, this.intl, api === null || api === void 0 || (_api$editorDisabled = api.editorDisabled) === null || _api$editorDisabled === void 0 || (_api$editorDisabled = _api$editorDisabled.sharedState.currentState()) === null || _api$editorDisabled === void 0 ? void 0 : _api$editorDisabled.editorDisabled)),
|
|
325
337
|
dom = _DOMSerializer$render.dom,
|
|
326
338
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
327
339
|
this.dom = dom;
|
|
@@ -335,8 +347,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
335
347
|
if (!expandedState.has(this.node)) {
|
|
336
348
|
expandedState.set(this.node, false);
|
|
337
349
|
}
|
|
338
|
-
this.
|
|
339
|
-
renderIcon(this.icon, this.allowInteractiveExpand, (_expandedState$get = expandedState.get(this.node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false, this.intl);
|
|
350
|
+
renderIcon(this.icon, this.allowInteractiveExpand, !isExpandCollapsed(this.node), this.intl);
|
|
340
351
|
if (!this.input || !this.titleContainer || !this.icon) {
|
|
341
352
|
return;
|
|
342
353
|
}
|
|
@@ -352,6 +363,21 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
352
363
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
353
364
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
354
365
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
366
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled && getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx')) {
|
|
367
|
+
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
368
|
+
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
369
|
+
if (_this.input) {
|
|
370
|
+
if (editorDisabled) {
|
|
371
|
+
_this.input.setAttribute('readonly', 'true');
|
|
372
|
+
} else {
|
|
373
|
+
_this.input.removeAttribute('readonly');
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (_this.content) {
|
|
377
|
+
_this.content.setAttribute('contenteditable', _this.getContentEditable(_this.node) ? 'true' : 'false');
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
}
|
|
355
381
|
}
|
|
356
382
|
_createClass(ExpandNodeView, [{
|
|
357
383
|
key: "stopEvent",
|
|
@@ -386,24 +412,22 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
386
412
|
}
|
|
387
413
|
});
|
|
388
414
|
|
|
389
|
-
// This
|
|
390
|
-
//
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
} else if (this.node !== node) {
|
|
398
|
-
// This checks if the node has been replaced with a different version
|
|
399
|
-
// and updates the state of the new node to match the old one
|
|
400
|
-
var previousExpandedState = expandedState.get(this.node);
|
|
401
|
-
if (previousExpandedState === undefined) {
|
|
402
|
-
previousExpandedState = true;
|
|
415
|
+
// This checks if the node has been replaced with a different version
|
|
416
|
+
// and updates the state of the new node to match the old one
|
|
417
|
+
// Eg. typing in a node changes it to a new node so it must be updated
|
|
418
|
+
// in the expandedState weak map
|
|
419
|
+
if (this.node !== node) {
|
|
420
|
+
var wasExpanded = expandedState.get(this.node);
|
|
421
|
+
if (wasExpanded) {
|
|
422
|
+
expandedState.set(node, wasExpanded);
|
|
403
423
|
}
|
|
404
|
-
|
|
424
|
+
}
|
|
425
|
+
if (this.content) {
|
|
426
|
+
// Disallow interaction/selection inside when collapsed.
|
|
427
|
+
this.content.setAttribute('contenteditable', this.getContentEditable(node) ? 'true' : 'false');
|
|
405
428
|
}
|
|
406
429
|
this.node = node;
|
|
430
|
+
this.updateExpandToggleIcon(this.node);
|
|
407
431
|
return true;
|
|
408
432
|
}
|
|
409
433
|
return false;
|
|
@@ -413,10 +437,10 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
413
437
|
value: function updateExpandToggleIcon(node) {
|
|
414
438
|
var expanded = expandedState.get(node) ? expandedState.get(node) : false;
|
|
415
439
|
if (this.dom && expanded !== undefined) {
|
|
416
|
-
var _expandedState$
|
|
440
|
+
var _expandedState$get;
|
|
417
441
|
this.dom.className = buildExpandClassName(node.type.name, expanded);
|
|
418
442
|
// Re-render the icon to update the aria-expanded attribute
|
|
419
|
-
renderIcon(this.icon ? this.icon : null, this.allowInteractiveExpand, (_expandedState$
|
|
443
|
+
renderIcon(this.icon ? this.icon : null, this.allowInteractiveExpand, (_expandedState$get = expandedState.get(node)) !== null && _expandedState$get !== void 0 ? _expandedState$get : false, this.intl);
|
|
420
444
|
}
|
|
421
445
|
this.updateExpandBodyContentEditable();
|
|
422
446
|
}
|
|
@@ -443,6 +467,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
443
467
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
444
468
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
445
469
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
|
|
470
|
+
if (this.cleanUpEditorDisabledOnChange) {
|
|
471
|
+
this.cleanUpEditorDisabledOnChange();
|
|
472
|
+
}
|
|
446
473
|
ReactDOM.unmountComponentAtNode(this.icon);
|
|
447
474
|
}
|
|
448
475
|
}]);
|
|
@@ -3,11 +3,12 @@ import ReactDOM from 'react-dom';
|
|
|
3
3
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
4
4
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { expandMessages } from '@atlaskit/editor-common/ui';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { ExpandButton } from '../ui/ExpandButton';
|
|
7
8
|
export var buildExpandClassName = function buildExpandClassName(type, expanded) {
|
|
8
9
|
return "".concat(expandClassNames.prefix, " ").concat(expandClassNames.type(type), " ").concat(expanded ? expandClassNames.expanded : '');
|
|
9
10
|
};
|
|
10
|
-
export var toDOM = function toDOM(node, __livePage, intl) {
|
|
11
|
+
export var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditable) {
|
|
11
12
|
var _expandedState$get;
|
|
12
13
|
return ['div', {
|
|
13
14
|
// prettier-ignore
|
|
@@ -34,11 +35,12 @@ export var toDOM = function toDOM(node, __livePage, intl) {
|
|
|
34
35
|
'class': expandClassNames.titleInput,
|
|
35
36
|
value: node.attrs.title,
|
|
36
37
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
37
|
-
type: 'text'
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
type: 'text',
|
|
39
|
+
readonly: getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && titleReadOnly ? 'true' : undefined
|
|
40
|
+
}]]], ['div', {
|
|
41
|
+
// prettier-ignore
|
|
42
|
+
class: expandClassNames.content,
|
|
43
|
+
contenteditable: getBooleanFF('platform.editor.live-view.disable-editing-in-view-mode_fi1rx') && contentEditable ? contentEditable ? 'true' : 'false' : undefined
|
|
42
44
|
}, 0]];
|
|
43
45
|
};
|
|
44
46
|
export var renderIcon = function renderIcon(icon, allowInteractiveExpand, expanded, intl) {
|
|
@@ -7,6 +7,7 @@ import type { ExpandPlugin } from '../../types';
|
|
|
7
7
|
export declare class ExpandNodeView implements NodeView {
|
|
8
8
|
private selectNearNode;
|
|
9
9
|
private __livePage;
|
|
10
|
+
private cleanUpEditorDisabledOnChange?;
|
|
10
11
|
node: PmNode;
|
|
11
12
|
view: EditorView;
|
|
12
13
|
dom: HTMLElement;
|
|
@@ -21,7 +22,7 @@ export declare class ExpandNodeView implements NodeView {
|
|
|
21
22
|
isMobile: boolean;
|
|
22
23
|
api: ExtractInjectionAPI<ExpandPlugin> | undefined;
|
|
23
24
|
decorationCleanup?: () => boolean | undefined;
|
|
24
|
-
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean);
|
|
25
|
+
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean, cleanUpEditorDisabledOnChange?: (() => void) | undefined);
|
|
25
26
|
private focusTitle;
|
|
26
27
|
private handleIconKeyDown;
|
|
27
28
|
private handleClick;
|
|
@@ -38,6 +39,7 @@ export declare class ExpandNodeView implements NodeView {
|
|
|
38
39
|
private setLeftGapCursor;
|
|
39
40
|
private handleArrowRightFromTitle;
|
|
40
41
|
private handleArrowLeftFromTitle;
|
|
42
|
+
private getContentEditable;
|
|
41
43
|
stopEvent(event: Event): boolean;
|
|
42
44
|
ignoreMutation(mutationRecord: MutationRecord | {
|
|
43
45
|
type: 'selection';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { DOMOutputSpec, Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
export declare const buildExpandClassName: (type: string, expanded: boolean) => string;
|
|
4
|
-
export declare const toDOM: (node: PmNode, __livePage: boolean, intl?: IntlShape) => DOMOutputSpec;
|
|
4
|
+
export declare const toDOM: (node: PmNode, __livePage: boolean, intl?: IntlShape, titleReadOnly?: boolean, contentEditable?: boolean) => DOMOutputSpec;
|
|
5
5
|
export declare const renderIcon: (icon: HTMLElement | null, allowInteractiveExpand: boolean, expanded: boolean, intl?: IntlShape) => void;
|
|
@@ -7,6 +7,7 @@ import type { ExpandPlugin } from '../../types';
|
|
|
7
7
|
export declare class ExpandNodeView implements NodeView {
|
|
8
8
|
private selectNearNode;
|
|
9
9
|
private __livePage;
|
|
10
|
+
private cleanUpEditorDisabledOnChange?;
|
|
10
11
|
node: PmNode;
|
|
11
12
|
view: EditorView;
|
|
12
13
|
dom: HTMLElement;
|
|
@@ -21,7 +22,7 @@ export declare class ExpandNodeView implements NodeView {
|
|
|
21
22
|
isMobile: boolean;
|
|
22
23
|
api: ExtractInjectionAPI<ExpandPlugin> | undefined;
|
|
23
24
|
decorationCleanup?: () => boolean | undefined;
|
|
24
|
-
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean);
|
|
25
|
+
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean, cleanUpEditorDisabledOnChange?: (() => void) | undefined);
|
|
25
26
|
private focusTitle;
|
|
26
27
|
private handleIconKeyDown;
|
|
27
28
|
private handleClick;
|
|
@@ -38,6 +39,7 @@ export declare class ExpandNodeView implements NodeView {
|
|
|
38
39
|
private setLeftGapCursor;
|
|
39
40
|
private handleArrowRightFromTitle;
|
|
40
41
|
private handleArrowLeftFromTitle;
|
|
42
|
+
private getContentEditable;
|
|
41
43
|
stopEvent(event: Event): boolean;
|
|
42
44
|
ignoreMutation(mutationRecord: MutationRecord | {
|
|
43
45
|
type: 'selection';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { DOMOutputSpec, Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
export declare const buildExpandClassName: (type: string, expanded: boolean) => string;
|
|
4
|
-
export declare const toDOM: (node: PmNode, __livePage: boolean, intl?: IntlShape) => DOMOutputSpec;
|
|
4
|
+
export declare const toDOM: (node: PmNode, __livePage: boolean, intl?: IntlShape, titleReadOnly?: boolean, contentEditable?: boolean) => DOMOutputSpec;
|
|
5
5
|
export declare const renderIcon: (icon: HTMLElement | null, allowInteractiveExpand: boolean, expanded: boolean, intl?: IntlShape) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-tables": "^2.7.0",
|
|
47
47
|
"@atlaskit/icon": "^22.1.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
49
|
-
"@atlaskit/tooltip": "^18.
|
|
49
|
+
"@atlaskit/tooltip": "^18.3.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1",
|
|
52
52
|
"w3c-keyname": "^2.1.8"
|