@atlaskit/editor-card-provider 3.3.2 → 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 +132 -47
- 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 +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,227 +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
|
+
|
|
11
|
+
## 3.3.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
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
|
|
19
|
+
|
|
3
20
|
## 3.3.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
6
23
|
|
|
7
|
-
-
|
|
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`
|
|
8
27
|
|
|
9
28
|
## 3.3.1
|
|
10
29
|
|
|
11
30
|
### Patch Changes
|
|
12
31
|
|
|
13
|
-
-
|
|
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
|
|
14
35
|
|
|
15
36
|
## 3.3.0
|
|
16
37
|
|
|
17
38
|
### Minor Changes
|
|
18
39
|
|
|
19
|
-
-
|
|
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.
|
|
20
44
|
|
|
21
45
|
## 3.2.0
|
|
22
46
|
|
|
23
47
|
### Minor Changes
|
|
24
48
|
|
|
25
|
-
-
|
|
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
|
|
26
52
|
|
|
27
53
|
## 3.1.17
|
|
28
54
|
|
|
29
55
|
### Patch Changes
|
|
30
56
|
|
|
31
|
-
-
|
|
32
|
-
|
|
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
|
|
33
63
|
|
|
34
64
|
## 3.1.16
|
|
35
65
|
|
|
36
66
|
### Patch Changes
|
|
37
67
|
|
|
38
|
-
-
|
|
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
|
|
39
71
|
|
|
40
72
|
## 3.1.15
|
|
41
73
|
|
|
42
74
|
### Patch Changes
|
|
43
75
|
|
|
44
|
-
-
|
|
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
|
|
45
79
|
|
|
46
80
|
## 3.1.14
|
|
47
81
|
|
|
48
82
|
### Patch Changes
|
|
49
83
|
|
|
50
|
-
-
|
|
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
|
|
51
88
|
|
|
52
89
|
## 3.1.13
|
|
53
90
|
|
|
54
91
|
### Patch Changes
|
|
55
92
|
|
|
56
|
-
-
|
|
93
|
+
- Updated dependencies
|
|
57
94
|
|
|
58
95
|
## 3.1.12
|
|
59
96
|
|
|
60
97
|
### Patch Changes
|
|
61
98
|
|
|
62
|
-
-
|
|
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
|
|
63
102
|
|
|
64
103
|
## 3.1.11
|
|
65
104
|
|
|
66
105
|
### Patch Changes
|
|
67
106
|
|
|
68
|
-
-
|
|
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
|
|
69
111
|
|
|
70
112
|
## 3.1.10
|
|
71
113
|
|
|
72
114
|
### Patch Changes
|
|
73
115
|
|
|
74
|
-
-
|
|
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
|
|
75
120
|
|
|
76
121
|
## 3.1.9
|
|
77
122
|
|
|
78
123
|
### Patch Changes
|
|
79
124
|
|
|
80
|
-
-
|
|
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.
|
|
81
128
|
|
|
82
129
|
## 3.1.8
|
|
83
130
|
|
|
84
131
|
### Patch Changes
|
|
85
132
|
|
|
86
|
-
-
|
|
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
|
|
87
136
|
|
|
88
137
|
## 3.1.7
|
|
89
138
|
|
|
90
139
|
### Patch Changes
|
|
91
140
|
|
|
92
|
-
-
|
|
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
|
|
93
144
|
|
|
94
145
|
## 3.1.6
|
|
95
146
|
|
|
96
147
|
### Patch Changes
|
|
97
148
|
|
|
98
|
-
-
|
|
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
|
|
99
152
|
|
|
100
153
|
## 3.1.5
|
|
101
154
|
|
|
102
155
|
### Patch Changes
|
|
103
156
|
|
|
104
|
-
-
|
|
105
|
-
-
|
|
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
|
|
106
161
|
|
|
107
162
|
## 3.1.4
|
|
108
163
|
|
|
109
164
|
### Patch Changes
|
|
110
165
|
|
|
111
|
-
-
|
|
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
|
|
112
169
|
|
|
113
170
|
## 3.1.3
|
|
114
171
|
|
|
115
172
|
### Patch Changes
|
|
116
173
|
|
|
117
|
-
-
|
|
174
|
+
- Updated dependencies
|
|
118
175
|
|
|
119
176
|
## 3.1.2
|
|
120
177
|
|
|
121
178
|
### Patch Changes
|
|
122
179
|
|
|
123
|
-
-
|
|
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
|
|
124
183
|
|
|
125
184
|
## 3.1.1
|
|
126
185
|
|
|
127
186
|
### Patch Changes
|
|
128
187
|
|
|
129
|
-
-
|
|
130
|
-
-
|
|
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
|
|
131
192
|
|
|
132
193
|
## 3.1.0
|
|
133
194
|
|
|
134
195
|
### Minor Changes
|
|
135
196
|
|
|
136
|
-
-
|
|
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
|
|
137
201
|
|
|
138
202
|
### Patch Changes
|
|
139
203
|
|
|
140
|
-
-
|
|
204
|
+
- Updated dependencies
|
|
141
205
|
|
|
142
206
|
## 3.0.5
|
|
143
207
|
|
|
144
208
|
### Patch Changes
|
|
145
209
|
|
|
146
|
-
-
|
|
210
|
+
- Updated dependencies
|
|
147
211
|
|
|
148
212
|
## 3.0.4
|
|
149
213
|
|
|
150
214
|
### Patch Changes
|
|
151
215
|
|
|
152
|
-
-
|
|
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
|
|
153
219
|
|
|
154
220
|
## 3.0.3
|
|
155
221
|
|
|
156
222
|
### Patch Changes
|
|
157
223
|
|
|
158
|
-
-
|
|
159
|
-
-
|
|
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
|
|
160
229
|
|
|
161
230
|
## 3.0.2
|
|
162
231
|
|
|
163
232
|
### Patch Changes
|
|
164
233
|
|
|
165
|
-
-
|
|
166
|
-
-
|
|
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
|
|
167
238
|
|
|
168
239
|
## 3.0.1
|
|
169
240
|
|
|
170
241
|
### Patch Changes
|
|
171
242
|
|
|
172
|
-
-
|
|
173
|
-
-
|
|
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
|
|
174
247
|
|
|
175
248
|
## 3.0.0
|
|
176
249
|
|
|
177
250
|
### Minor Changes
|
|
178
251
|
|
|
179
|
-
-
|
|
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
|
|
180
255
|
|
|
181
256
|
### Patch Changes
|
|
182
257
|
|
|
183
|
-
-
|
|
258
|
+
- Updated dependencies
|
|
184
259
|
|
|
185
260
|
## 2.0.4
|
|
186
261
|
|
|
187
262
|
### Patch Changes
|
|
188
263
|
|
|
189
|
-
-
|
|
190
|
-
-
|
|
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
|
|
191
268
|
|
|
192
269
|
## 2.0.3
|
|
193
270
|
|
|
194
271
|
### Patch Changes
|
|
195
272
|
|
|
196
|
-
-
|
|
197
|
-
-
|
|
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
|
|
198
277
|
|
|
199
278
|
## 2.0.2
|
|
200
279
|
|
|
201
280
|
### Patch Changes
|
|
202
281
|
|
|
203
|
-
-
|
|
204
|
-
-
|
|
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
|
|
205
286
|
|
|
206
287
|
## 2.0.1
|
|
207
288
|
|
|
208
289
|
### Patch Changes
|
|
209
290
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
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
|
|
212
295
|
|
|
213
296
|
## 2.0.0
|
|
214
297
|
|
|
215
298
|
### Patch Changes
|
|
216
299
|
|
|
217
|
-
-
|
|
300
|
+
- Updated dependencies
|
|
218
301
|
|
|
219
302
|
## 1.0.0
|
|
220
303
|
|
|
221
304
|
### Major Changes
|
|
222
305
|
|
|
223
|
-
-
|
|
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
|
|
224
309
|
|
|
225
310
|
### Patch Changes
|
|
226
311
|
|
|
227
|
-
-
|
|
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,17 +34,18 @@
|
|
|
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/linking-common": "^5.
|
|
39
|
+
"@atlaskit/link-extractors": "^1.5.0",
|
|
40
|
+
"@atlaskit/linking-common": "^5.6.0",
|
|
40
41
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
41
42
|
"@babel/runtime": "^7.0.0",
|
|
42
43
|
"dataloader": "^2.0.0",
|
|
43
|
-
"json-ld-types": "^
|
|
44
|
+
"json-ld-types": "^4.1.0",
|
|
44
45
|
"setimmediate": "^1.0.5"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/link-provider": "^1.
|
|
48
|
+
"@atlaskit/link-provider": "^1.9.0",
|
|
48
49
|
"react": "^16.8.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
@@ -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"
|