@atlaskit/editor-slack-transformer 3.4.1 → 3.6.0
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 +141 -124
- package/LICENSE.md +6 -8
- package/dist/cjs/serializer.js +4 -0
- package/dist/es2019/serializer.js +4 -0
- package/dist/esm/serializer.js +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/serializer.d.ts +4 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/serializer.d.ts +4 -0
- package/example-helpers/ToolsDrawer.tsx +81 -86
- package/example-helpers/styles.ts +26 -19
- package/package.json +54 -56
- package/report.api.md +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,307 +1,324 @@
|
|
|
1
1
|
# @atlaskit/editor-slack-transformer
|
|
2
2
|
|
|
3
|
+
## 3.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#124209](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124209)
|
|
8
|
+
[`8aa1792f12ed3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8aa1792f12ed3) -
|
|
9
|
+
bump @atlaskit/editor-prosemirror to 5.0.0, bump @atlaskit/adf-schema to 40.1.0
|
|
10
|
+
|
|
11
|
+
## 3.5.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#98129](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98129)
|
|
16
|
+
[`78612a7edba4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/78612a7edba4) -
|
|
17
|
+
[ux] [ED-23101] Updated Editor JSON, Slack, Confluence and Email transformers to support the new
|
|
18
|
+
`backgroundColor` mark
|
|
19
|
+
|
|
3
20
|
## 3.4.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
6
23
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
24
|
+
- [#97698](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97698)
|
|
25
|
+
[`1c7b378c0d3b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1c7b378c0d3b) -
|
|
26
|
+
[HOT-108999] We had an incident where the cursor jumps back a character in table headers for any
|
|
27
|
+
language triggering composition on an empty line.This was fixed in a patch bump of
|
|
28
|
+
prosemirror-view. https://github.com/ProseMirror/prosemirror-view/compare/1.33.4...1.33.5
|
|
12
29
|
|
|
13
30
|
## 3.4.0
|
|
14
31
|
|
|
15
32
|
### Minor Changes
|
|
16
33
|
|
|
17
|
-
-
|
|
18
|
-
|
|
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
|
## 3.3.5
|
|
22
39
|
|
|
23
40
|
### Patch Changes
|
|
24
41
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
|
|
43
|
+
[`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
|
|
44
|
+
Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
28
45
|
|
|
29
46
|
## 3.3.4
|
|
30
47
|
|
|
31
48
|
### Patch Changes
|
|
32
49
|
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
- [#75947](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75947)
|
|
51
|
+
[`43549c3789b1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/43549c3789b1) -
|
|
52
|
+
Migrate @atlaskit/editor-core to use declarative entry points
|
|
36
53
|
|
|
37
54
|
## 3.3.3
|
|
38
55
|
|
|
39
56
|
### Patch Changes
|
|
40
57
|
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
- [#77984](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77984)
|
|
59
|
+
[`eb7139b3ec21`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eb7139b3ec21) -
|
|
60
|
+
Replace hardcoded values with spacing tokens
|
|
44
61
|
|
|
45
62
|
## 3.3.2
|
|
46
63
|
|
|
47
64
|
### Patch Changes
|
|
48
65
|
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
- [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572)
|
|
67
|
+
[`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) -
|
|
68
|
+
Upgrading @atlaskit/editor-prosemirror dependency
|
|
52
69
|
|
|
53
70
|
## 3.3.1
|
|
54
71
|
|
|
55
72
|
### Patch Changes
|
|
56
73
|
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
- [#70084](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70084)
|
|
75
|
+
[`4d651eb93ab5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d651eb93ab5) -
|
|
76
|
+
Add editor-plugin-annotation pr and create shared utils for it in editor-test-helpers
|
|
60
77
|
|
|
61
78
|
## 3.3.0
|
|
62
79
|
|
|
63
80
|
### Minor Changes
|
|
64
81
|
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
82
|
+
- [#70008](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70008)
|
|
83
|
+
[`0aa6be50ddd3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0aa6be50ddd3) -
|
|
84
|
+
Added support for inline image
|
|
68
85
|
|
|
69
86
|
## 3.2.9
|
|
70
87
|
|
|
71
88
|
### Patch Changes
|
|
72
89
|
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
- [#42761](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42761)
|
|
91
|
+
[`5d1881c7ed0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5d1881c7ed0) - Adds
|
|
92
|
+
@ak/tokens as a dependency
|
|
76
93
|
|
|
77
94
|
## 3.2.8
|
|
78
95
|
|
|
79
96
|
### Patch Changes
|
|
80
97
|
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
98
|
+
- [#39320](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39320)
|
|
99
|
+
[`ec4867e1376`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ec4867e1376) - Removed
|
|
100
|
+
captions flag and replaced with a new media prop `allowCaptions`. `allowCaptions` is set to
|
|
101
|
+
`false` by default and products will need to opt in to be able to use captions from now on.
|
|
85
102
|
|
|
86
103
|
## 3.2.7
|
|
87
104
|
|
|
88
105
|
### Patch Changes
|
|
89
106
|
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
- [#38162](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38162)
|
|
108
|
+
[`fd6bb9c9184`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd6bb9c9184) - Delete
|
|
109
|
+
version.json
|
|
93
110
|
|
|
94
111
|
## 3.2.6
|
|
95
112
|
|
|
96
113
|
### Patch Changes
|
|
97
114
|
|
|
98
|
-
-
|
|
115
|
+
- Updated dependencies
|
|
99
116
|
|
|
100
117
|
## 3.2.5
|
|
101
118
|
|
|
102
119
|
### Patch Changes
|
|
103
120
|
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
121
|
+
- [#37785](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37785)
|
|
122
|
+
[`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) -
|
|
123
|
+
[ED-19233] Import prosemirror libraries from internal facade package
|
|
107
124
|
|
|
108
125
|
## 3.2.4
|
|
109
126
|
|
|
110
127
|
### Patch Changes
|
|
111
128
|
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
|
|
129
|
+
- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)
|
|
130
|
+
[`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing
|
|
131
|
+
unused dependencies and dev dependencies
|
|
115
132
|
|
|
116
133
|
## 3.2.3
|
|
117
134
|
|
|
118
135
|
### Patch Changes
|
|
119
136
|
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
137
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
|
|
138
|
+
[`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
|
|
139
|
+
legacy types are published for TS 4.5-4.8
|
|
123
140
|
|
|
124
141
|
## 3.2.2
|
|
125
142
|
|
|
126
143
|
### Patch Changes
|
|
127
144
|
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
145
|
+
- [#33771](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33771)
|
|
146
|
+
[`a142ba1aa28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a142ba1aa28) -
|
|
147
|
+
[ED17172] Bump prosemirror-model to 1.16.0 and prosemirror-view to 1.23.7 and removed work-arounds
|
|
148
|
+
for fixed issues
|
|
132
149
|
|
|
133
150
|
## 3.2.1
|
|
134
151
|
|
|
135
152
|
### Patch Changes
|
|
136
153
|
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
|
|
155
|
+
[`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade
|
|
156
|
+
Typescript from `4.5.5` to `4.9.5`
|
|
140
157
|
|
|
141
158
|
## 3.2.0
|
|
142
159
|
|
|
143
160
|
### Minor Changes
|
|
144
161
|
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
|
|
162
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
|
|
163
|
+
[`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
|
|
164
|
+
minor dependency bump
|
|
148
165
|
|
|
149
166
|
## 3.1.7
|
|
150
167
|
|
|
151
168
|
### Patch Changes
|
|
152
169
|
|
|
153
|
-
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
170
|
+
- [#33004](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33004)
|
|
171
|
+
[`0ffb55018c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ffb55018c9) - Revert
|
|
172
|
+
"[ED-17172] Bumped prosemirror-view from 1.23.2 to 1.23.7 and removed work-around for fixed
|
|
173
|
+
issues"
|
|
157
174
|
|
|
158
175
|
## 3.1.6
|
|
159
176
|
|
|
160
177
|
### Patch Changes
|
|
161
178
|
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
179
|
+
- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)
|
|
180
|
+
[`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY
|
|
181
|
+
remove before merging to master; dupe adf-schema via adf-utils
|
|
165
182
|
|
|
166
183
|
## 3.1.5
|
|
167
184
|
|
|
168
185
|
### Patch Changes
|
|
169
186
|
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
|
|
187
|
+
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)
|
|
188
|
+
[`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade
|
|
189
|
+
Typescript from `4.3.5` to `4.5.5`
|
|
173
190
|
|
|
174
191
|
## 3.1.4
|
|
175
192
|
|
|
176
193
|
### Patch Changes
|
|
177
194
|
|
|
178
|
-
-
|
|
179
|
-
|
|
180
|
-
|
|
195
|
+
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)
|
|
196
|
+
[`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade
|
|
197
|
+
Typescript from `4.2.4` to `4.3.5`.
|
|
181
198
|
|
|
182
199
|
## 3.1.3
|
|
183
200
|
|
|
184
201
|
### Patch Changes
|
|
185
202
|
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
203
|
+
- [#21570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21570)
|
|
204
|
+
[`4db684dafa6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4db684dafa6) - ED-13895
|
|
205
|
+
update editor slack transformer to emotion
|
|
189
206
|
|
|
190
207
|
## 3.1.2
|
|
191
208
|
|
|
192
209
|
### Patch Changes
|
|
193
210
|
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
|
|
211
|
+
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650)
|
|
212
|
+
[`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade
|
|
213
|
+
to TypeScript 4.2.4
|
|
197
214
|
|
|
198
215
|
## 3.1.1
|
|
199
216
|
|
|
200
217
|
### Patch Changes
|
|
201
218
|
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
|
|
219
|
+
- [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752)
|
|
220
|
+
[`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - ED-13025
|
|
221
|
+
Bump prosemirror-view 1.23.1 -> 1.23.2
|
|
205
222
|
|
|
206
223
|
## 3.1.0
|
|
207
224
|
|
|
208
225
|
### Minor Changes
|
|
209
226
|
|
|
210
|
-
-
|
|
211
|
-
|
|
212
|
-
|
|
227
|
+
- [#17424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/17424)
|
|
228
|
+
[`95c8a998ef1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/95c8a998ef1) - Inline
|
|
229
|
+
cards with url type attributes are sent as links. Adding a new row after embedded card
|
|
213
230
|
|
|
214
231
|
## 3.0.0
|
|
215
232
|
|
|
216
233
|
### Major Changes
|
|
217
234
|
|
|
218
|
-
-
|
|
219
|
-
|
|
220
|
-
|
|
235
|
+
- [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998)
|
|
236
|
+
[`8f0577e0eb1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f0577e0eb1) - [ux]
|
|
237
|
+
Promoted captions to full schema and better support of wikimarkup, email and slack renderer
|
|
221
238
|
|
|
222
239
|
### Minor Changes
|
|
223
240
|
|
|
224
|
-
-
|
|
225
|
-
|
|
241
|
+
- [`b230f366971`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b230f366971) -
|
|
242
|
+
[ED-14008] Bump prosemirror-view from 1.20.2 to 1.23.1
|
|
226
243
|
|
|
227
244
|
### Patch Changes
|
|
228
245
|
|
|
229
|
-
-
|
|
230
|
-
|
|
246
|
+
- [`c6feed82071`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c6feed82071) -
|
|
247
|
+
ED-11632: Bump prosemirror packages;
|
|
231
248
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
249
|
+
- prosmirror-commands 1.1.4 -> 1.1.11,
|
|
250
|
+
- prosemirror-model 1.11.0 -> 1.14.3,
|
|
251
|
+
- prosemirror-state 1.3.3 -> 1.3.4,
|
|
252
|
+
- prosemirror-transform 1.2.8 -> 1.3.2,
|
|
253
|
+
- prosemirror-view 1.15.4 + 1.18.8 -> 1.20.2.
|
|
237
254
|
|
|
238
255
|
## 2.0.0
|
|
239
256
|
|
|
240
257
|
### Major Changes
|
|
241
258
|
|
|
242
|
-
-
|
|
243
|
-
|
|
244
|
-
|
|
259
|
+
- [#14777](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14777)
|
|
260
|
+
[`ad7872a08ed`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad7872a08ed) - Add
|
|
261
|
+
media inline component to wikimarkup, slack markdown, email renderer transformers
|
|
245
262
|
|
|
246
263
|
## 1.0.6
|
|
247
264
|
|
|
248
265
|
### Patch Changes
|
|
249
266
|
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
|
|
267
|
+
- [#14969](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14969)
|
|
268
|
+
[`4855cb64aab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4855cb64aab) - Fixed
|
|
269
|
+
typo in the embedded node name
|
|
253
270
|
|
|
254
271
|
## 1.0.5
|
|
255
272
|
|
|
256
273
|
### Patch Changes
|
|
257
274
|
|
|
258
|
-
-
|
|
259
|
-
|
|
260
|
-
|
|
275
|
+
- [#12300](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12300)
|
|
276
|
+
[`5eb1f5c3eb6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5eb1f5c3eb6) - Moved
|
|
277
|
+
@atlaskit/editor-common to devDependencies. Extracted Transformer interface from it.
|
|
261
278
|
|
|
262
279
|
## 1.0.4
|
|
263
280
|
|
|
264
281
|
### Patch Changes
|
|
265
282
|
|
|
266
|
-
-
|
|
283
|
+
- Updated dependencies
|
|
267
284
|
|
|
268
285
|
## 1.0.3
|
|
269
286
|
|
|
270
287
|
### Patch Changes
|
|
271
288
|
|
|
272
|
-
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
289
|
+
- [#12237](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12237)
|
|
290
|
+
[`b7d23a07930`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b7d23a07930) -
|
|
291
|
+
Added/updated unsupported nodes/marks stubs. Added support for decisions, layouts, status, panel.
|
|
292
|
+
Emojis return text (an emoji itself) instead of a short name.
|
|
276
293
|
|
|
277
294
|
## 1.0.2
|
|
278
295
|
|
|
279
296
|
### Patch Changes
|
|
280
297
|
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
298
|
+
- [#11502](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/11502)
|
|
299
|
+
[`a17337cd389`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a17337cd389) - Added
|
|
300
|
+
stubs for unsupported nodes in Slack markdown such as table, panel, inline card, task, decision as
|
|
301
|
+
["node type" attached]
|
|
285
302
|
|
|
286
303
|
## 1.0.1
|
|
287
304
|
|
|
288
305
|
### Patch Changes
|
|
289
306
|
|
|
290
|
-
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
307
|
+
- [#11387](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/11387)
|
|
308
|
+
[`93a63117404`](https://bitbucket.org/atlassian/atlassian-frontend/commits/93a63117404) - Replaced
|
|
309
|
+
a [media attached] link (when some file is attached) just with a text [media attached]. Added a
|
|
310
|
+
rule node (serialized to an empty line) and a text color mark (serialized to a pure text). Slack
|
|
311
|
+
doesn’t have syntax for it. Added a missed description in package.json. Removed unused
|
|
312
|
+
devDependencies.
|
|
296
313
|
|
|
297
314
|
## 1.0.0
|
|
298
315
|
|
|
299
316
|
### Major Changes
|
|
300
317
|
|
|
301
|
-
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
318
|
+
- [#11002](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/11002)
|
|
319
|
+
[`944b9d04d22`](https://bitbucket.org/atlassian/atlassian-frontend/commits/944b9d04d22) - [ux]
|
|
320
|
+
TI-210 Implemented a converter to support ADF to Slack markdown transformation. Supported bold,
|
|
321
|
+
italic and strikethrough text, links, quotes, inline code blocks, code blocks, emojis. Mentions
|
|
322
|
+
are serialised as @id. There’s no specific list syntax in app-published text, but we can mimic
|
|
323
|
+
list (bullet, numbered) formatting. Also there’s no specific syntax for headers, images/files
|
|
324
|
+
(will be converted to [image attached] or [media attached] as a link).
|
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Copyright 2020 Atlassian Pty Ltd
|
|
2
2
|
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
You may obtain a copy of the License at
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
6
5
|
|
|
7
6
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
7
|
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
limitations under the License.
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
package/dist/cjs/serializer.js
CHANGED
package/dist/esm/serializer.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
2
5
|
import React, { useState } from 'react';
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
7
|
import { jsx } from '@emotion/react';
|
|
4
8
|
|
|
5
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
10
|
|
|
7
11
|
import type { ActivityProvider } from '@atlaskit/activity';
|
|
12
|
+
// eslint-disable-next-line no-restricted-imports -- Legacy package outside of AFM lacks entry points
|
|
8
13
|
import { MockActivityResource } from '@atlaskit/activity/dist/es5/support';
|
|
9
14
|
import type { MentionProvider } from '@atlaskit/editor-core';
|
|
10
15
|
import { MentionResource } from '@atlaskit/editor-core';
|
|
@@ -17,105 +22,95 @@ import { SlackTransformer } from '../src';
|
|
|
17
22
|
|
|
18
23
|
import { content } from './styles';
|
|
19
24
|
|
|
20
|
-
const rejectedPromise = Promise.reject(
|
|
21
|
-
new Error('Simulated provider rejection'),
|
|
22
|
-
);
|
|
25
|
+
const rejectedPromise = Promise.reject(new Error('Simulated provider rejection'));
|
|
23
26
|
const pendingPromise = new Promise<any>(() => {});
|
|
24
27
|
|
|
25
28
|
const providers = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
mentionProvider: {
|
|
30
|
+
resolved: Promise.resolve(mentionResourceProvider),
|
|
31
|
+
'resolved 2': Promise.resolve(
|
|
32
|
+
new MentionResource({
|
|
33
|
+
url: 'https://pf-mentions-service.staging.atlassian.io/mentions/f7ebe2c0-0309-4687-b913-41d422f2110b',
|
|
34
|
+
containerId: 'b0d035bd-9b98-4386-863b-07286c34dc14',
|
|
35
|
+
productId: 'hipchat',
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
pending: pendingPromise,
|
|
39
|
+
rejected: rejectedPromise,
|
|
40
|
+
undefined: undefined,
|
|
41
|
+
},
|
|
42
|
+
emojiProvider: {
|
|
43
|
+
resolved: getEmojiResource({ uploadSupported: true }),
|
|
44
|
+
pending: pendingPromise,
|
|
45
|
+
rejected: rejectedPromise,
|
|
46
|
+
undefined: undefined,
|
|
47
|
+
},
|
|
48
|
+
activityProvider: {
|
|
49
|
+
resolved: new MockActivityResource(),
|
|
50
|
+
pending: pendingPromise,
|
|
51
|
+
rejected: rejectedPromise,
|
|
52
|
+
undefined: undefined,
|
|
53
|
+
},
|
|
51
54
|
};
|
|
52
55
|
rejectedPromise.catch(() => {});
|
|
53
56
|
|
|
54
57
|
export interface State {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
reloadEditor: boolean;
|
|
59
|
+
editorEnabled: boolean;
|
|
60
|
+
mentionProvider: 'resolved' | 'pending' | 'rejected' | 'undefined';
|
|
61
|
+
emojiProvider: 'resolved' | 'pending' | 'rejected' | 'undefined';
|
|
62
|
+
activityProvider: 'resolved' | 'pending' | 'rejected' | 'undefined';
|
|
63
|
+
document?: string;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
export type Props = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
renderEditor: (props: {
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
mentionProvider?: Promise<MentionProvider>;
|
|
70
|
+
emojiProvider?: Promise<EmojiProvider>;
|
|
71
|
+
activityProvider?: Promise<ActivityProvider> | MockActivityResource;
|
|
72
|
+
onChange: (view: EditorView) => void;
|
|
73
|
+
}) => React.ReactChild;
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
export default function ToolsDrawer({ renderEditor }: Props) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
reloadEditor: false,
|
|
86
|
-
editorEnabled: true,
|
|
87
|
-
mentionProvider: 'resolved',
|
|
88
|
-
emojiProvider: 'resolved',
|
|
89
|
-
activityProvider: 'resolved',
|
|
90
|
-
document: '',
|
|
91
|
-
});
|
|
77
|
+
const [
|
|
78
|
+
{ mentionProvider, emojiProvider, activityProvider, document, reloadEditor, editorEnabled },
|
|
79
|
+
setState,
|
|
80
|
+
] = useState<State>({
|
|
81
|
+
reloadEditor: false,
|
|
82
|
+
editorEnabled: true,
|
|
83
|
+
mentionProvider: 'resolved',
|
|
84
|
+
emojiProvider: 'resolved',
|
|
85
|
+
activityProvider: 'resolved',
|
|
86
|
+
document: '',
|
|
87
|
+
});
|
|
92
88
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
const handleChange = (editorView: EditorView) => {
|
|
90
|
+
const { doc } = editorView.state;
|
|
91
|
+
const document = new SlackTransformer().encode(doc);
|
|
96
92
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
setState((prevState) => ({
|
|
94
|
+
...prevState,
|
|
95
|
+
document,
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
102
98
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
);
|
|
99
|
+
return (
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
101
|
+
<div css={content}>
|
|
102
|
+
<div style={{ padding: `${token('space.075', '6px')} 0` }}>️️️Slack Editor</div>
|
|
103
|
+
{reloadEditor
|
|
104
|
+
? ''
|
|
105
|
+
: renderEditor({
|
|
106
|
+
disabled: !editorEnabled,
|
|
107
|
+
mentionProvider: providers.mentionProvider[mentionProvider],
|
|
108
|
+
emojiProvider: providers.emojiProvider[emojiProvider],
|
|
109
|
+
activityProvider: providers.activityProvider[activityProvider],
|
|
110
|
+
onChange: handleChange,
|
|
111
|
+
})}
|
|
112
|
+
<legend>Markdown output:</legend>
|
|
113
|
+
<pre>{document}</pre>
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
121
116
|
}
|
|
@@ -1,25 +1,32 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { token } from '@atlaskit/tokens';
|
|
3
4
|
import { N800 } from '@atlaskit/theme/colors';
|
|
4
5
|
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
5
7
|
export const content = css({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
9
|
+
'& div.toolsDrawer': {
|
|
10
|
+
padding: `${token('space.100', '8px')} ${token('space.200', '16px')}`,
|
|
11
|
+
background: token('color.background.neutral.bold', N800),
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
13
|
+
'& label': {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
color: token('color.text.inverse', 'white'),
|
|
16
|
+
alignSelf: 'center',
|
|
17
|
+
paddingRight: token('space.100', '8px'),
|
|
18
|
+
},
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
20
|
+
'& button': {
|
|
21
|
+
margin: `${token('space.050', '4px')} 0`,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
25
|
+
'& legend': {
|
|
26
|
+
margin: `${token('space.100', '8px')} 0`,
|
|
27
|
+
},
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
29
|
+
'& input': {
|
|
30
|
+
fontSize: '13px',
|
|
31
|
+
},
|
|
25
32
|
});
|
package/package.json
CHANGED
|
@@ -1,57 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
}
|
|
2
|
+
"name": "@atlaskit/editor-slack-transformer",
|
|
3
|
+
"version": "3.6.0",
|
|
4
|
+
"description": "Editor Slack transformer",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"atlaskit:src": "src/index.ts",
|
|
25
|
+
"atlassian": {
|
|
26
|
+
"team": "Editor: ADF",
|
|
27
|
+
"inPublicMirror": true,
|
|
28
|
+
"releaseModel": "continuous",
|
|
29
|
+
"website": {
|
|
30
|
+
"name": "Editor Slack Transformer"
|
|
31
|
+
},
|
|
32
|
+
"runReact18": false
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
36
|
+
"@babel/runtime": "^7.0.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "^16.8.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@atlaskit/activity": "^1.0.1",
|
|
43
|
+
"@atlaskit/editor-core": "^194.5.0",
|
|
44
|
+
"@atlaskit/editor-test-helpers": "^18.28.0",
|
|
45
|
+
"@atlaskit/emoji": "^67.6.0",
|
|
46
|
+
"@atlaskit/theme": "^12.11.0",
|
|
47
|
+
"@atlaskit/tokens": "^1.56.0",
|
|
48
|
+
"@atlaskit/util-data-test": "^17.9.0",
|
|
49
|
+
"@emotion/react": "^11.7.1",
|
|
50
|
+
"typescript": "~5.4.2"
|
|
51
|
+
},
|
|
52
|
+
"af:exports": {
|
|
53
|
+
".": "./src/index.ts"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/editor-slack-transformer"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -19,18 +20,18 @@ import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|
|
|
19
20
|
|
|
20
21
|
// @public (undocumented)
|
|
21
22
|
export class SlackTransformer implements Transformer_2<string> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// (undocumented)
|
|
24
|
+
encode(node: Node_2): string;
|
|
25
|
+
// (undocumented)
|
|
26
|
+
parse(_slackMarkdown: string): Node_2;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
// @public (undocumented)
|
|
29
30
|
interface Transformer_2<T> {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
// (undocumented)
|
|
32
|
+
encode(node: Node_2): T;
|
|
33
|
+
// (undocumented)
|
|
34
|
+
parse(content: T): Node_2;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
// (No @packageDocumentation comment for this package)
|
|
@@ -44,7 +45,7 @@ interface Transformer_2<T> {
|
|
|
44
45
|
|
|
45
46
|
```json
|
|
46
47
|
{
|
|
47
|
-
|
|
48
|
+
"react": "^16.8.0"
|
|
48
49
|
}
|
|
49
50
|
```
|
|
50
51
|
|