@atlaskit/editor-slack-transformer 3.5.0 → 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 +136 -128
- package/LICENSE.md +6 -8
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- 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,316 +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
|
+
|
|
3
11
|
## 3.5.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
6
14
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
11
19
|
|
|
12
20
|
## 3.4.1
|
|
13
21
|
|
|
14
22
|
### Patch Changes
|
|
15
23
|
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
21
29
|
|
|
22
30
|
## 3.4.0
|
|
23
31
|
|
|
24
32
|
### Minor Changes
|
|
25
33
|
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
29
37
|
|
|
30
38
|
## 3.3.5
|
|
31
39
|
|
|
32
40
|
### Patch Changes
|
|
33
41
|
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
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`
|
|
37
45
|
|
|
38
46
|
## 3.3.4
|
|
39
47
|
|
|
40
48
|
### Patch Changes
|
|
41
49
|
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
45
53
|
|
|
46
54
|
## 3.3.3
|
|
47
55
|
|
|
48
56
|
### Patch Changes
|
|
49
57
|
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
53
61
|
|
|
54
62
|
## 3.3.2
|
|
55
63
|
|
|
56
64
|
### Patch Changes
|
|
57
65
|
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
61
69
|
|
|
62
70
|
## 3.3.1
|
|
63
71
|
|
|
64
72
|
### Patch Changes
|
|
65
73
|
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
69
77
|
|
|
70
78
|
## 3.3.0
|
|
71
79
|
|
|
72
80
|
### Minor Changes
|
|
73
81
|
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
77
85
|
|
|
78
86
|
## 3.2.9
|
|
79
87
|
|
|
80
88
|
### Patch Changes
|
|
81
89
|
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
|
85
93
|
|
|
86
94
|
## 3.2.8
|
|
87
95
|
|
|
88
96
|
### Patch Changes
|
|
89
97
|
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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.
|
|
94
102
|
|
|
95
103
|
## 3.2.7
|
|
96
104
|
|
|
97
105
|
### Patch Changes
|
|
98
106
|
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
|
102
110
|
|
|
103
111
|
## 3.2.6
|
|
104
112
|
|
|
105
113
|
### Patch Changes
|
|
106
114
|
|
|
107
|
-
-
|
|
115
|
+
- Updated dependencies
|
|
108
116
|
|
|
109
117
|
## 3.2.5
|
|
110
118
|
|
|
111
119
|
### Patch Changes
|
|
112
120
|
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
|
116
124
|
|
|
117
125
|
## 3.2.4
|
|
118
126
|
|
|
119
127
|
### Patch Changes
|
|
120
128
|
|
|
121
|
-
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
|
124
132
|
|
|
125
133
|
## 3.2.3
|
|
126
134
|
|
|
127
135
|
### Patch Changes
|
|
128
136
|
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
|
132
140
|
|
|
133
141
|
## 3.2.2
|
|
134
142
|
|
|
135
143
|
### Patch Changes
|
|
136
144
|
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
|
141
149
|
|
|
142
150
|
## 3.2.1
|
|
143
151
|
|
|
144
152
|
### Patch Changes
|
|
145
153
|
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
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`
|
|
149
157
|
|
|
150
158
|
## 3.2.0
|
|
151
159
|
|
|
152
160
|
### Minor Changes
|
|
153
161
|
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
|
157
165
|
|
|
158
166
|
## 3.1.7
|
|
159
167
|
|
|
160
168
|
### Patch Changes
|
|
161
169
|
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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"
|
|
166
174
|
|
|
167
175
|
## 3.1.6
|
|
168
176
|
|
|
169
177
|
### Patch Changes
|
|
170
178
|
|
|
171
|
-
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
|
174
182
|
|
|
175
183
|
## 3.1.5
|
|
176
184
|
|
|
177
185
|
### Patch Changes
|
|
178
186
|
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
|
|
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`
|
|
182
190
|
|
|
183
191
|
## 3.1.4
|
|
184
192
|
|
|
185
193
|
### Patch Changes
|
|
186
194
|
|
|
187
|
-
-
|
|
188
|
-
|
|
189
|
-
|
|
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`.
|
|
190
198
|
|
|
191
199
|
## 3.1.3
|
|
192
200
|
|
|
193
201
|
### Patch Changes
|
|
194
202
|
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
|
198
206
|
|
|
199
207
|
## 3.1.2
|
|
200
208
|
|
|
201
209
|
### Patch Changes
|
|
202
210
|
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
|
206
214
|
|
|
207
215
|
## 3.1.1
|
|
208
216
|
|
|
209
217
|
### Patch Changes
|
|
210
218
|
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
|
214
222
|
|
|
215
223
|
## 3.1.0
|
|
216
224
|
|
|
217
225
|
### Minor Changes
|
|
218
226
|
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
|
222
230
|
|
|
223
231
|
## 3.0.0
|
|
224
232
|
|
|
225
233
|
### Major Changes
|
|
226
234
|
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
|
230
238
|
|
|
231
239
|
### Minor Changes
|
|
232
240
|
|
|
233
|
-
-
|
|
234
|
-
|
|
241
|
+
- [`b230f366971`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b230f366971) -
|
|
242
|
+
[ED-14008] Bump prosemirror-view from 1.20.2 to 1.23.1
|
|
235
243
|
|
|
236
244
|
### Patch Changes
|
|
237
245
|
|
|
238
|
-
-
|
|
239
|
-
|
|
246
|
+
- [`c6feed82071`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c6feed82071) -
|
|
247
|
+
ED-11632: Bump prosemirror packages;
|
|
240
248
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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.
|
|
246
254
|
|
|
247
255
|
## 2.0.0
|
|
248
256
|
|
|
249
257
|
### Major Changes
|
|
250
258
|
|
|
251
|
-
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
|
254
262
|
|
|
255
263
|
## 1.0.6
|
|
256
264
|
|
|
257
265
|
### Patch Changes
|
|
258
266
|
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
|
262
270
|
|
|
263
271
|
## 1.0.5
|
|
264
272
|
|
|
265
273
|
### Patch Changes
|
|
266
274
|
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
|
|
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.
|
|
270
278
|
|
|
271
279
|
## 1.0.4
|
|
272
280
|
|
|
273
281
|
### Patch Changes
|
|
274
282
|
|
|
275
|
-
-
|
|
283
|
+
- Updated dependencies
|
|
276
284
|
|
|
277
285
|
## 1.0.3
|
|
278
286
|
|
|
279
287
|
### Patch Changes
|
|
280
288
|
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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.
|
|
285
293
|
|
|
286
294
|
## 1.0.2
|
|
287
295
|
|
|
288
296
|
### Patch Changes
|
|
289
297
|
|
|
290
|
-
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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]
|
|
294
302
|
|
|
295
303
|
## 1.0.1
|
|
296
304
|
|
|
297
305
|
### Patch Changes
|
|
298
306
|
|
|
299
|
-
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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.
|
|
305
313
|
|
|
306
314
|
## 1.0.0
|
|
307
315
|
|
|
308
316
|
### Major Changes
|
|
309
317
|
|
|
310
|
-
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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/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
|
|