1 |
|
2 |
|
3 |
|
4 | import { embedContentIcon, embedAudioIcon, embedPhotoIcon, embedVideoIcon, embedTwitterIcon, embedYouTubeIcon, embedFacebookIcon, embedInstagramIcon, embedWordPressIcon, embedSpotifyIcon, embedFlickrIcon, embedVimeoIcon, embedRedditIcon, embedTumbrIcon, embedAmazonIcon } from './icons';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import { __ } from '@wordpress/i18n';
|
10 | import { createBlock } from '@wordpress/blocks';
|
11 | export var common = [{
|
12 | name: 'core-embed/twitter',
|
13 | settings: {
|
14 | title: 'Twitter',
|
15 | icon: embedTwitterIcon,
|
16 | keywords: ['tweet'],
|
17 | description: __('Embed a tweet.')
|
18 | },
|
19 | patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i]
|
20 | }, {
|
21 | name: 'core-embed/youtube',
|
22 | settings: {
|
23 | title: 'YouTube',
|
24 | icon: embedYouTubeIcon,
|
25 | keywords: [__('music'), __('video')],
|
26 | description: __('Embed a YouTube video.')
|
27 | },
|
28 | patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i]
|
29 | }, {
|
30 | name: 'core-embed/facebook',
|
31 | settings: {
|
32 | title: 'Facebook',
|
33 | icon: embedFacebookIcon,
|
34 | description: __('Embed a Facebook post.')
|
35 | },
|
36 | patterns: [/^https?:\/\/www\.facebook.com\/.+/i]
|
37 | }, {
|
38 | name: 'core-embed/instagram',
|
39 | settings: {
|
40 | title: 'Instagram',
|
41 | icon: embedInstagramIcon,
|
42 | keywords: [__('image')],
|
43 | description: __('Embed an Instagram post.')
|
44 | },
|
45 | patterns: [/^https?:\/\/(www\.)?instagr(\.am|am\.com)\/.+/i]
|
46 | }, {
|
47 | name: 'core-embed/wordpress',
|
48 | settings: {
|
49 | title: 'WordPress',
|
50 | icon: embedWordPressIcon,
|
51 | keywords: [__('post'), __('blog')],
|
52 | responsive: false,
|
53 | description: __('Embed a WordPress post.')
|
54 | }
|
55 | }, {
|
56 | name: 'core-embed/soundcloud',
|
57 | settings: {
|
58 | title: 'SoundCloud',
|
59 | icon: embedAudioIcon,
|
60 | keywords: [__('music'), __('audio')],
|
61 | description: __('Embed SoundCloud content.')
|
62 | },
|
63 | patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i]
|
64 | }, {
|
65 | name: 'core-embed/spotify',
|
66 | settings: {
|
67 | title: 'Spotify',
|
68 | icon: embedSpotifyIcon,
|
69 | keywords: [__('music'), __('audio')],
|
70 | description: __('Embed Spotify content.')
|
71 | },
|
72 | patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i]
|
73 | }, {
|
74 | name: 'core-embed/flickr',
|
75 | settings: {
|
76 | title: 'Flickr',
|
77 | icon: embedFlickrIcon,
|
78 | keywords: [__('image')],
|
79 | description: __('Embed Flickr content.')
|
80 | },
|
81 | patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i]
|
82 | }, {
|
83 | name: 'core-embed/vimeo',
|
84 | settings: {
|
85 | title: 'Vimeo',
|
86 | icon: embedVimeoIcon,
|
87 | keywords: [__('video')],
|
88 | description: __('Embed a Vimeo video.')
|
89 | },
|
90 | patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i]
|
91 | }];
|
92 | export var others = [{
|
93 | name: 'core-embed/animoto',
|
94 | settings: {
|
95 | title: 'Animoto',
|
96 | icon: embedVideoIcon,
|
97 | description: __('Embed an Animoto video.')
|
98 | },
|
99 | patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i]
|
100 | }, {
|
101 | name: 'core-embed/cloudup',
|
102 | settings: {
|
103 | title: 'Cloudup',
|
104 | icon: embedContentIcon,
|
105 | description: __('Embed Cloudup content.')
|
106 | },
|
107 | patterns: [/^https?:\/\/cloudup\.com\/.+/i]
|
108 | }, {
|
109 | name: 'core-embed/collegehumor',
|
110 | settings: {
|
111 | title: 'CollegeHumor',
|
112 | icon: embedVideoIcon,
|
113 | description: __('Embed CollegeHumor content.')
|
114 | },
|
115 | patterns: [/^https?:\/\/(www\.)?collegehumor\.com\/.+/i]
|
116 | }, {
|
117 | name: 'core-embed/crowdsignal',
|
118 | settings: {
|
119 | title: 'Crowdsignal',
|
120 | icon: embedContentIcon,
|
121 | keywords: ['polldaddy'],
|
122 | transform: [{
|
123 | type: 'block',
|
124 | blocks: ['core-embed/polldaddy'],
|
125 | transform: function transform(content) {
|
126 | return createBlock('core-embed/crowdsignal', {
|
127 | content: content
|
128 | });
|
129 | }
|
130 | }],
|
131 | description: __('Embed Crowdsignal (formerly Polldaddy) content.')
|
132 | },
|
133 | patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i]
|
134 | }, {
|
135 | name: 'core-embed/dailymotion',
|
136 | settings: {
|
137 | title: 'Dailymotion',
|
138 | icon: embedVideoIcon,
|
139 | description: __('Embed a Dailymotion video.')
|
140 | },
|
141 | patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i]
|
142 | }, {
|
143 | name: 'core-embed/hulu',
|
144 | settings: {
|
145 | title: 'Hulu',
|
146 | icon: embedVideoIcon,
|
147 | description: __('Embed Hulu content.')
|
148 | },
|
149 | patterns: [/^https?:\/\/(www\.)?hulu\.com\/.+/i]
|
150 | }, {
|
151 | name: 'core-embed/imgur',
|
152 | settings: {
|
153 | title: 'Imgur',
|
154 | icon: embedPhotoIcon,
|
155 | description: __('Embed Imgur content.')
|
156 | },
|
157 | patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i]
|
158 | }, {
|
159 | name: 'core-embed/issuu',
|
160 | settings: {
|
161 | title: 'Issuu',
|
162 | icon: embedContentIcon,
|
163 | description: __('Embed Issuu content.')
|
164 | },
|
165 | patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i]
|
166 | }, {
|
167 | name: 'core-embed/kickstarter',
|
168 | settings: {
|
169 | title: 'Kickstarter',
|
170 | icon: embedContentIcon,
|
171 | description: __('Embed Kickstarter content.')
|
172 | },
|
173 | patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i]
|
174 | }, {
|
175 | name: 'core-embed/meetup-com',
|
176 | settings: {
|
177 | title: 'Meetup.com',
|
178 | icon: embedContentIcon,
|
179 | description: __('Embed Meetup.com content.')
|
180 | },
|
181 | patterns: [/^https?:\/\/(www\.)?meetu(\.ps|p\.com)\/.+/i]
|
182 | }, {
|
183 | name: 'core-embed/mixcloud',
|
184 | settings: {
|
185 | title: 'Mixcloud',
|
186 | icon: embedAudioIcon,
|
187 | keywords: [__('music'), __('audio')],
|
188 | description: __('Embed Mixcloud content.')
|
189 | },
|
190 | patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i]
|
191 | }, {
|
192 |
|
193 | name: 'core-embed/polldaddy',
|
194 | settings: {
|
195 | title: 'Polldaddy',
|
196 | icon: embedContentIcon,
|
197 | description: __('Embed Polldaddy content.'),
|
198 | supports: {
|
199 | inserter: false
|
200 | }
|
201 | },
|
202 | patterns: []
|
203 | }, {
|
204 | name: 'core-embed/reddit',
|
205 | settings: {
|
206 | title: 'Reddit',
|
207 | icon: embedRedditIcon,
|
208 | description: __('Embed a Reddit thread.')
|
209 | },
|
210 | patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i]
|
211 | }, {
|
212 | name: 'core-embed/reverbnation',
|
213 | settings: {
|
214 | title: 'ReverbNation',
|
215 | icon: embedAudioIcon,
|
216 | description: __('Embed ReverbNation content.')
|
217 | },
|
218 | patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i]
|
219 | }, {
|
220 | name: 'core-embed/screencast',
|
221 | settings: {
|
222 | title: 'Screencast',
|
223 | icon: embedVideoIcon,
|
224 | description: __('Embed Screencast content.')
|
225 | },
|
226 | patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i]
|
227 | }, {
|
228 | name: 'core-embed/scribd',
|
229 | settings: {
|
230 | title: 'Scribd',
|
231 | icon: embedContentIcon,
|
232 | description: __('Embed Scribd content.')
|
233 | },
|
234 | patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i]
|
235 | }, {
|
236 | name: 'core-embed/slideshare',
|
237 | settings: {
|
238 | title: 'Slideshare',
|
239 | icon: embedContentIcon,
|
240 | description: __('Embed Slideshare content.')
|
241 | },
|
242 | patterns: [/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i]
|
243 | }, {
|
244 | name: 'core-embed/smugmug',
|
245 | settings: {
|
246 | title: 'SmugMug',
|
247 | icon: embedPhotoIcon,
|
248 | description: __('Embed SmugMug content.')
|
249 | },
|
250 | patterns: [/^https?:\/\/(www\.)?smugmug\.com\/.+/i]
|
251 | }, {
|
252 |
|
253 | name: 'core-embed/speaker',
|
254 | settings: {
|
255 | title: 'Speaker',
|
256 | icon: embedAudioIcon,
|
257 | supports: {
|
258 | inserter: false
|
259 | }
|
260 | },
|
261 | patterns: []
|
262 | }, {
|
263 | name: 'core-embed/speaker-deck',
|
264 | settings: {
|
265 | title: 'Speaker Deck',
|
266 | icon: embedContentIcon,
|
267 | transform: [{
|
268 | type: 'block',
|
269 | blocks: ['core-embed/speaker'],
|
270 | transform: function transform(content) {
|
271 | return createBlock('core-embed/speaker-deck', {
|
272 | content: content
|
273 | });
|
274 | }
|
275 | }],
|
276 | description: __('Embed Speaker Deck content.')
|
277 | },
|
278 | patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i]
|
279 | }, {
|
280 | name: 'core-embed/ted',
|
281 | settings: {
|
282 | title: 'TED',
|
283 | icon: embedVideoIcon,
|
284 | description: __('Embed a TED video.')
|
285 | },
|
286 | patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i]
|
287 | }, {
|
288 | name: 'core-embed/tumblr',
|
289 | settings: {
|
290 | title: 'Tumblr',
|
291 | icon: embedTumbrIcon,
|
292 | description: __('Embed a Tumblr post.')
|
293 | },
|
294 | patterns: [/^https?:\/\/(www\.)?tumblr\.com\/.+/i]
|
295 | }, {
|
296 | name: 'core-embed/videopress',
|
297 | settings: {
|
298 | title: 'VideoPress',
|
299 | icon: embedVideoIcon,
|
300 | keywords: [__('video')],
|
301 | description: __('Embed a VideoPress video.')
|
302 | },
|
303 | patterns: [/^https?:\/\/videopress\.com\/.+/i]
|
304 | }, {
|
305 | name: 'core-embed/wordpress-tv',
|
306 | settings: {
|
307 | title: 'WordPress.tv',
|
308 | icon: embedVideoIcon,
|
309 | description: __('Embed a WordPress.tv video.')
|
310 | },
|
311 | patterns: [/^https?:\/\/wordpress\.tv\/.+/i]
|
312 | }, {
|
313 | name: 'core-embed/amazon-kindle',
|
314 | settings: {
|
315 | title: 'Amazon Kindle',
|
316 | icon: embedAmazonIcon,
|
317 | keywords: [__('ebook')],
|
318 | responsive: false,
|
319 | description: __('Embed Amazon Kindle content.')
|
320 | },
|
321 | patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i]
|
322 | }];
|
323 |
|
\ | No newline at end of file |