@atlaskit/editor-card-provider 3.3.3 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -49
- package/dist/cjs/provider.js +15 -1
- package/dist/es2019/provider.js +13 -1
- package/dist/esm/provider.js +15 -1
- package/dist/types/provider.d.ts +3 -3
- package/dist/types-ts4.5/provider.d.ts +3 -3
- package/package.json +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,234 +1,312 @@
|
|
|
1
1
|
# @atlaskit/editor-card-provider
|
|
2
2
|
|
|
3
|
+
## 3.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#98840](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98840)
|
|
8
|
+
[`cff3be4e0774`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cff3be4e0774) -
|
|
9
|
+
Default Jira dashboard to embed appearance
|
|
10
|
+
|
|
3
11
|
## 3.3.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
6
14
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
15
|
+
- [#86596](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86596)
|
|
16
|
+
[`37621cb1f1b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/37621cb1f1b9) -
|
|
17
|
+
Update dependency json-ld-types
|
|
18
|
+
- Updated dependencies
|
|
9
19
|
|
|
10
20
|
## 3.3.2
|
|
11
21
|
|
|
12
22
|
### Patch Changes
|
|
13
23
|
|
|
14
|
-
-
|
|
24
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
|
|
25
|
+
[`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
|
|
26
|
+
Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
15
27
|
|
|
16
28
|
## 3.3.1
|
|
17
29
|
|
|
18
30
|
### Patch Changes
|
|
19
31
|
|
|
20
|
-
-
|
|
32
|
+
- [#81050](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81050)
|
|
33
|
+
[`c15d7331e8b8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c15d7331e8b8) -
|
|
34
|
+
We are updating the Jira List URL pattern as we recently update the urls
|
|
21
35
|
|
|
22
36
|
## 3.3.0
|
|
23
37
|
|
|
24
38
|
### Minor Changes
|
|
25
39
|
|
|
26
|
-
-
|
|
40
|
+
- [#75659](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75659)
|
|
41
|
+
[`28d133564298`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/28d133564298) -
|
|
42
|
+
Removed duplicated version of environment.ts in editor-card-provider package and all usages were
|
|
43
|
+
replaced with the corresponding type/function from linking-common.
|
|
27
44
|
|
|
28
45
|
## 3.2.0
|
|
29
46
|
|
|
30
47
|
### Minor Changes
|
|
31
48
|
|
|
32
|
-
-
|
|
49
|
+
- [#74458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74458)
|
|
50
|
+
[`c40e977de5da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c40e977de5da) -
|
|
51
|
+
[ux] List view links will be converted into smart link embed by default
|
|
33
52
|
|
|
34
53
|
## 3.1.17
|
|
35
54
|
|
|
36
55
|
### Patch Changes
|
|
37
56
|
|
|
38
|
-
-
|
|
39
|
-
|
|
57
|
+
- [#72315](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72315)
|
|
58
|
+
[`818ff8704f34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/818ff8704f34) -
|
|
59
|
+
Updated default smart card view for Confluence Databases to include default for savedViewId
|
|
60
|
+
- [#71047](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71047)
|
|
61
|
+
[`931a7edba41e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/931a7edba41e) -
|
|
62
|
+
update window.location usage to be compatible with SSR
|
|
40
63
|
|
|
41
64
|
## 3.1.16
|
|
42
65
|
|
|
43
66
|
### Patch Changes
|
|
44
67
|
|
|
45
|
-
-
|
|
68
|
+
- [#68764](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68764)
|
|
69
|
+
[`59b851a5d621`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/59b851a5d621) -
|
|
70
|
+
[ux] Render Polaris (Jira Product Discovery) published view as an embed by default
|
|
46
71
|
|
|
47
72
|
## 3.1.15
|
|
48
73
|
|
|
49
74
|
### Patch Changes
|
|
50
75
|
|
|
51
|
-
-
|
|
76
|
+
- [#68194](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68194)
|
|
77
|
+
[`c1d4a8fecc4e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1d4a8fecc4e) -
|
|
78
|
+
bump json-ld-types to version 3.11.0
|
|
52
79
|
|
|
53
80
|
## 3.1.14
|
|
54
81
|
|
|
55
82
|
### Patch Changes
|
|
56
83
|
|
|
57
|
-
-
|
|
84
|
+
- [#66881](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66881)
|
|
85
|
+
[`d940eeab50d9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d940eeab50d9) -
|
|
86
|
+
[ux] Updated default smart card view for Confluence Databases to include all-entries for
|
|
87
|
+
savedViewId and only uuid for unsavedView
|
|
58
88
|
|
|
59
89
|
## 3.1.13
|
|
60
90
|
|
|
61
91
|
### Patch Changes
|
|
62
92
|
|
|
63
|
-
-
|
|
93
|
+
- Updated dependencies
|
|
64
94
|
|
|
65
95
|
## 3.1.12
|
|
66
96
|
|
|
67
97
|
### Patch Changes
|
|
68
98
|
|
|
69
|
-
-
|
|
99
|
+
- [#63428](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63428)
|
|
100
|
+
[`441be131933f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/441be131933f) -
|
|
101
|
+
[ux] make youtube videos embed by default
|
|
70
102
|
|
|
71
103
|
## 3.1.11
|
|
72
104
|
|
|
73
105
|
### Patch Changes
|
|
74
106
|
|
|
75
|
-
-
|
|
107
|
+
- [#62385](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62385)
|
|
108
|
+
[`f3e422857a54`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f3e422857a54) -
|
|
109
|
+
[ux] Updated default smart card view for Confluence Databases to include check for unsavedView
|
|
110
|
+
parameter
|
|
76
111
|
|
|
77
112
|
## 3.1.10
|
|
78
113
|
|
|
79
114
|
### Patch Changes
|
|
80
115
|
|
|
81
|
-
-
|
|
116
|
+
- [#42239](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42239)
|
|
117
|
+
[`3ebc0b4f999`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3ebc0b4f999) - [ux]
|
|
118
|
+
Updated default smart card view for Confluence Databases to include check for entryId and
|
|
119
|
+
savedViewId parameters
|
|
82
120
|
|
|
83
121
|
## 3.1.9
|
|
84
122
|
|
|
85
123
|
### Patch Changes
|
|
86
124
|
|
|
87
|
-
-
|
|
125
|
+
- [#40406](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40406)
|
|
126
|
+
[`542d0dd0b1d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/542d0dd0b1d) - [ux]
|
|
127
|
+
Changed default smart card view for Confluence Databases route from inline to embed.
|
|
88
128
|
|
|
89
129
|
## 3.1.8
|
|
90
130
|
|
|
91
131
|
### Patch Changes
|
|
92
132
|
|
|
93
|
-
-
|
|
133
|
+
- [#40491](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40491)
|
|
134
|
+
[`1fedffbd64b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1fedffbd64b) - Update
|
|
135
|
+
json-ld-types dependencies to be compatible with version
|
|
94
136
|
|
|
95
137
|
## 3.1.7
|
|
96
138
|
|
|
97
139
|
### Patch Changes
|
|
98
140
|
|
|
99
|
-
-
|
|
141
|
+
- [#40127](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40127)
|
|
142
|
+
[`2cd7af71b63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2cd7af71b63) - Bump
|
|
143
|
+
json-ld-types 3.8.0 -> 3.9.1
|
|
100
144
|
|
|
101
145
|
## 3.1.6
|
|
102
146
|
|
|
103
147
|
### Patch Changes
|
|
104
148
|
|
|
105
|
-
-
|
|
149
|
+
- [#37720](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37720)
|
|
150
|
+
[`e74ae7f06d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e74ae7f06d4) - Update
|
|
151
|
+
dependency json-ld-types@3.8.0
|
|
106
152
|
|
|
107
153
|
## 3.1.5
|
|
108
154
|
|
|
109
155
|
### Patch Changes
|
|
110
156
|
|
|
111
|
-
-
|
|
112
|
-
-
|
|
157
|
+
- [#37136](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37136)
|
|
158
|
+
[`83f06b6e7f6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/83f06b6e7f6) - Update
|
|
159
|
+
to use 'getStatus' from '@atlaskit/linking-common'
|
|
160
|
+
- Updated dependencies
|
|
113
161
|
|
|
114
162
|
## 3.1.4
|
|
115
163
|
|
|
116
164
|
### Patch Changes
|
|
117
165
|
|
|
118
|
-
-
|
|
166
|
+
- [#37340](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37340)
|
|
167
|
+
[`b9355830504`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9355830504) - Opt
|
|
168
|
+
out of peer dependency enforcement
|
|
119
169
|
|
|
120
170
|
## 3.1.3
|
|
121
171
|
|
|
122
172
|
### Patch Changes
|
|
123
173
|
|
|
124
|
-
-
|
|
174
|
+
- Updated dependencies
|
|
125
175
|
|
|
126
176
|
## 3.1.2
|
|
127
177
|
|
|
128
178
|
### Patch Changes
|
|
129
179
|
|
|
130
|
-
-
|
|
180
|
+
- [#36757](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36757)
|
|
181
|
+
[`3fb20c4aeba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fb20c4aeba) - Add
|
|
182
|
+
postinstall check to enforce internal peer dependencies
|
|
131
183
|
|
|
132
184
|
## 3.1.1
|
|
133
185
|
|
|
134
186
|
### Patch Changes
|
|
135
187
|
|
|
136
|
-
-
|
|
137
|
-
-
|
|
188
|
+
- [#36089](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36089)
|
|
189
|
+
[`1e7190077d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1e7190077d4) - Move
|
|
190
|
+
off deprecated @atlaskit/linking-common/extractors to @atlaskit/link-extractors
|
|
191
|
+
- Updated dependencies
|
|
138
192
|
|
|
139
193
|
## 3.1.0
|
|
140
194
|
|
|
141
195
|
### Minor Changes
|
|
142
196
|
|
|
143
|
-
-
|
|
197
|
+
- [#35032](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35032)
|
|
198
|
+
[`04295e9d5bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04295e9d5bc) - [ux]
|
|
199
|
+
Updating ORS response to include datasources and facilitating pasting JQL links turning into
|
|
200
|
+
datasource tables
|
|
144
201
|
|
|
145
202
|
### Patch Changes
|
|
146
203
|
|
|
147
|
-
-
|
|
204
|
+
- Updated dependencies
|
|
148
205
|
|
|
149
206
|
## 3.0.5
|
|
150
207
|
|
|
151
208
|
### Patch Changes
|
|
152
209
|
|
|
153
|
-
-
|
|
210
|
+
- Updated dependencies
|
|
154
211
|
|
|
155
212
|
## 3.0.4
|
|
156
213
|
|
|
157
214
|
### Patch Changes
|
|
158
215
|
|
|
159
|
-
-
|
|
216
|
+
- [#35428](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35428)
|
|
217
|
+
[`1674b5907b4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1674b5907b4) - [ux]
|
|
218
|
+
Make confluence whiteboard urls default to embed view
|
|
160
219
|
|
|
161
220
|
## 3.0.3
|
|
162
221
|
|
|
163
222
|
### Patch Changes
|
|
164
223
|
|
|
165
|
-
-
|
|
166
|
-
-
|
|
224
|
+
- [#33699](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33699)
|
|
225
|
+
[`f10ed88032c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f10ed88032c) - With
|
|
226
|
+
the renaming of Jira Roadmaps to Timeline, we are updating the regex rules to match timeline in
|
|
227
|
+
conjunction to roadmaps
|
|
228
|
+
- Updated dependencies
|
|
167
229
|
|
|
168
230
|
## 3.0.2
|
|
169
231
|
|
|
170
232
|
### Patch Changes
|
|
171
233
|
|
|
172
|
-
-
|
|
173
|
-
-
|
|
234
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
|
|
235
|
+
[`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
|
|
236
|
+
legacy types are published for TS 4.5-4.8
|
|
237
|
+
- Updated dependencies
|
|
174
238
|
|
|
175
239
|
## 3.0.1
|
|
176
240
|
|
|
177
241
|
### Patch Changes
|
|
178
242
|
|
|
179
|
-
-
|
|
180
|
-
-
|
|
243
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
|
|
244
|
+
[`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) -
|
|
245
|
+
Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
246
|
+
- Updated dependencies
|
|
181
247
|
|
|
182
248
|
## 3.0.0
|
|
183
249
|
|
|
184
250
|
### Minor Changes
|
|
185
251
|
|
|
186
|
-
-
|
|
252
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
|
|
253
|
+
[`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
|
|
254
|
+
minor dependency bump
|
|
187
255
|
|
|
188
256
|
### Patch Changes
|
|
189
257
|
|
|
190
|
-
-
|
|
258
|
+
- Updated dependencies
|
|
191
259
|
|
|
192
260
|
## 2.0.4
|
|
193
261
|
|
|
194
262
|
### Patch Changes
|
|
195
263
|
|
|
196
|
-
-
|
|
197
|
-
-
|
|
264
|
+
- [#32541](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32541)
|
|
265
|
+
[`0624df1ffe1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0624df1ffe1) - Bump
|
|
266
|
+
json-ld-types dependency
|
|
267
|
+
- Updated dependencies
|
|
198
268
|
|
|
199
269
|
## 2.0.3
|
|
200
270
|
|
|
201
271
|
### Patch Changes
|
|
202
272
|
|
|
203
|
-
-
|
|
204
|
-
-
|
|
273
|
+
- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)
|
|
274
|
+
[`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY
|
|
275
|
+
remove before merging to master; dupe adf-schema via adf-utils
|
|
276
|
+
- Updated dependencies
|
|
205
277
|
|
|
206
278
|
## 2.0.2
|
|
207
279
|
|
|
208
280
|
### Patch Changes
|
|
209
281
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
282
|
+
- [#32360](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32360)
|
|
283
|
+
[`0ee9370595a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ee9370595a) - Update
|
|
284
|
+
json-ld-types
|
|
285
|
+
- Updated dependencies
|
|
212
286
|
|
|
213
287
|
## 2.0.1
|
|
214
288
|
|
|
215
289
|
### Patch Changes
|
|
216
290
|
|
|
217
|
-
-
|
|
218
|
-
-
|
|
291
|
+
- [#31388](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31388)
|
|
292
|
+
[`0af4a6b6426`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0af4a6b6426) -
|
|
293
|
+
Dependency update json-ld-types@3.4.0
|
|
294
|
+
- Updated dependencies
|
|
219
295
|
|
|
220
296
|
## 2.0.0
|
|
221
297
|
|
|
222
298
|
### Patch Changes
|
|
223
299
|
|
|
224
|
-
-
|
|
300
|
+
- Updated dependencies
|
|
225
301
|
|
|
226
302
|
## 1.0.0
|
|
227
303
|
|
|
228
304
|
### Major Changes
|
|
229
305
|
|
|
230
|
-
-
|
|
306
|
+
- [#30266](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30266)
|
|
307
|
+
[`12223b3ee04`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12223b3ee04) - Move
|
|
308
|
+
EditorCardProvider to new package instead of using imports from Link Provider and Smart Card
|
|
231
309
|
|
|
232
310
|
### Patch Changes
|
|
233
311
|
|
|
234
|
-
-
|
|
312
|
+
- Updated dependencies
|
package/dist/cjs/provider.js
CHANGED
|
@@ -60,6 +60,20 @@ var isConfluenceDatabase = function isConfluenceDatabase(url) {
|
|
|
60
60
|
var isYoutubeVideo = function isYoutubeVideo(url) {
|
|
61
61
|
return url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
|
|
62
62
|
};
|
|
63
|
+
var isLoomUrl = function isLoomUrl(url) {
|
|
64
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.embed-loom-by-default')) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return url.match( /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*\x2D)?([a-f0-9]{32})/, {
|
|
68
|
+
videoId: 5
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
var isJiraDashboard = function isJiraDashboard(url) {
|
|
72
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.jira-dashboard-embed_ycjcj')) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
|
|
76
|
+
};
|
|
63
77
|
var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
|
|
64
78
|
function EditorCardProvider(envKey, baseUrlOverride) {
|
|
65
79
|
var _this = this;
|
|
@@ -329,7 +343,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
|
|
|
329
343
|
}, {
|
|
330
344
|
key: "getHardCodedAppearance",
|
|
331
345
|
value: function getHardCodedAppearance(url) {
|
|
332
|
-
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.embed-youtube-by-default') && isYoutubeVideo(url)) {
|
|
346
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.embed-youtube-by-default') && isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url)) {
|
|
333
347
|
return 'embed';
|
|
334
348
|
}
|
|
335
349
|
}
|
package/dist/es2019/provider.js
CHANGED
|
@@ -22,6 +22,18 @@ const isProformaView = url => url.match(/^https:\/\/[^/]+\/jira\/(core|software(
|
|
|
22
22
|
const isConfluenceWhiteboard = url => url.match(/\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>\d+)(\?\/)?/) || url.match(/\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/);
|
|
23
23
|
const isConfluenceDatabase = url => url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*(savedViewId=([0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}|all-entries|default)|entryId=[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}|unsavedView=[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}).*)?$/);
|
|
24
24
|
const isYoutubeVideo = url => url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
|
|
25
|
+
const isLoomUrl = url => {
|
|
26
|
+
if (!getBooleanFF('platform.linking-platform.embed-loom-by-default')) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return url.match(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?(?<videoId>[a-f0-9]{32})/);
|
|
30
|
+
};
|
|
31
|
+
const isJiraDashboard = url => {
|
|
32
|
+
if (!getBooleanFF('platform.linking-platform.jira-dashboard-embed_ycjcj')) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
|
|
36
|
+
};
|
|
25
37
|
export class EditorCardProvider {
|
|
26
38
|
constructor(envKey, baseUrlOverride) {
|
|
27
39
|
this.baseUrl = baseUrlOverride || getBaseUrl(envKey);
|
|
@@ -113,7 +125,7 @@ export class EditorCardProvider {
|
|
|
113
125
|
return (_this$providersData2 = this.providersData) === null || _this$providersData2 === void 0 ? void 0 : _this$providersData2.patterns.find(pattern => url.match(pattern.source));
|
|
114
126
|
}
|
|
115
127
|
getHardCodedAppearance(url) {
|
|
116
|
-
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || getBooleanFF('platform.linking-platform.embed-youtube-by-default') && isYoutubeVideo(url)) {
|
|
128
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || getBooleanFF('platform.linking-platform.embed-youtube-by-default') && isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url)) {
|
|
117
129
|
return 'embed';
|
|
118
130
|
}
|
|
119
131
|
}
|
package/dist/esm/provider.js
CHANGED
|
@@ -53,6 +53,20 @@ var isConfluenceDatabase = function isConfluenceDatabase(url) {
|
|
|
53
53
|
var isYoutubeVideo = function isYoutubeVideo(url) {
|
|
54
54
|
return url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
|
|
55
55
|
};
|
|
56
|
+
var isLoomUrl = function isLoomUrl(url) {
|
|
57
|
+
if (!getBooleanFF('platform.linking-platform.embed-loom-by-default')) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return url.match( /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*\x2D)?([a-f0-9]{32})/, {
|
|
61
|
+
videoId: 5
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
var isJiraDashboard = function isJiraDashboard(url) {
|
|
65
|
+
if (!getBooleanFF('platform.linking-platform.jira-dashboard-embed_ycjcj')) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
|
|
69
|
+
};
|
|
56
70
|
export var EditorCardProvider = /*#__PURE__*/function () {
|
|
57
71
|
function EditorCardProvider(envKey, baseUrlOverride) {
|
|
58
72
|
var _this = this;
|
|
@@ -322,7 +336,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
|
|
|
322
336
|
}, {
|
|
323
337
|
key: "getHardCodedAppearance",
|
|
324
338
|
value: function getHardCodedAppearance(url) {
|
|
325
|
-
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || getBooleanFF('platform.linking-platform.embed-youtube-by-default') && isYoutubeVideo(url)) {
|
|
339
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || getBooleanFF('platform.linking-platform.embed-youtube-by-default') && isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url)) {
|
|
326
340
|
return 'embed';
|
|
327
341
|
}
|
|
328
342
|
}
|
package/dist/types/provider.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'setimmediate';
|
|
2
|
-
import { CardAdf, CardAppearance, DatasourceAdf } from '@atlaskit/linking-common';
|
|
3
|
-
import { CardProvider } from './types';
|
|
4
|
-
import { EnvironmentsKeys } from '@atlaskit/linking-common';
|
|
2
|
+
import { type CardAdf, type CardAppearance, type DatasourceAdf } from '@atlaskit/linking-common';
|
|
3
|
+
import { type CardProvider } from './types';
|
|
4
|
+
import { type EnvironmentsKeys } from '@atlaskit/linking-common';
|
|
5
5
|
export declare class EditorCardProvider implements CardProvider {
|
|
6
6
|
private baseUrl;
|
|
7
7
|
private resolverUrl;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'setimmediate';
|
|
2
|
-
import { CardAdf, CardAppearance, DatasourceAdf } from '@atlaskit/linking-common';
|
|
3
|
-
import { CardProvider } from './types';
|
|
4
|
-
import { EnvironmentsKeys } from '@atlaskit/linking-common';
|
|
2
|
+
import { type CardAdf, type CardAppearance, type DatasourceAdf } from '@atlaskit/linking-common';
|
|
3
|
+
import { type CardProvider } from './types';
|
|
4
|
+
import { type EnvironmentsKeys } from '@atlaskit/linking-common';
|
|
5
5
|
export declare class EditorCardProvider implements CardProvider {
|
|
6
6
|
private baseUrl;
|
|
7
7
|
private resolverUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-card-provider",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "Contains the EditorCardProvider, for determining smart card behaviour in the editor.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
".": "./src/index.ts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@atlaskit/eslint-plugin-platform": "0.6.1",
|
|
37
38
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
38
|
-
"@atlaskit/link-extractors": "^1.
|
|
39
|
+
"@atlaskit/link-extractors": "^1.5.0",
|
|
39
40
|
"@atlaskit/linking-common": "^5.6.0",
|
|
40
41
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
41
42
|
"@babel/runtime": "^7.0.0",
|
|
@@ -55,6 +56,12 @@
|
|
|
55
56
|
"platform-feature-flags": {
|
|
56
57
|
"platform.linking-platform.embed-youtube-by-default": {
|
|
57
58
|
"type": "boolean"
|
|
59
|
+
},
|
|
60
|
+
"platform.linking-platform.embed-loom-by-default": {
|
|
61
|
+
"type": "boolean"
|
|
62
|
+
},
|
|
63
|
+
"platform.linking-platform.jira-dashboard-embed_ycjcj": {
|
|
64
|
+
"type": "boolean"
|
|
58
65
|
}
|
|
59
66
|
},
|
|
60
67
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|