EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor - Version 2.5.4

Version Description

Download this release

Release Info

Developer Asif2BD
Plugin Icon wp plugin EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

EmbedPress/Ends/Back/Settings.php CHANGED
@@ -198,6 +198,13 @@ class Settings {
198
  EmbedPress
199
  </a>
200
  </h1>
 
 
 
 
 
 
 
201
  </header>
202
 
203
  <?php settings_errors(); ?>
@@ -207,16 +214,21 @@ class Settings {
207
  class="nav-tab<?php echo $activeTab === 'embedpress' || empty( $activeTab ) ? ' nav-tab-active' : ''; ?> ">
208
  General settings
209
  </a>
 
 
 
 
 
 
210
  <?php do_action( 'embedpress:settings:render:tab', $activeTab ); ?>
211
  <?php do_action( 'embedpress_license_tab', $activeTab ); ?>
212
-
213
  </h2>
214
 
215
  <?php if ( $activeTab !== 'addons' ) : ?>
216
  <form action="options.php" method="POST" style="padding-bottom: 20px;">
217
  <?php settings_fields( $settingsFieldsIdentifier ); ?>
218
  <?php do_settings_sections( $settingsSectionsIdentifier ); ?>
219
- <?php if ( $activeTab !== 'embedpress_license' ) : ?>
220
  <button type="submit" class="button button-primary embedpress-setting-save">Save changes
221
  </button>
222
  <?php endif; ?>
@@ -225,11 +237,32 @@ class Settings {
225
  <?php if ( $activeTab == 'embedpress_license' ) : ?>
226
  <?php echo do_action( 'embedpress_license' ); ?>
227
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  </div>
229
 
230
  <footer>
231
  <p>
232
- <a href="//wordpress.org/support/plugin/embedpress/reviews/#new-post" target="_blank"
233
  rel="noopener noreferrer">If you like <strong>EmbedPress</strong> please leave us a <span
234
  class="dashicons dashicons-star-filled"></span><span
235
  class="dashicons dashicons-star-filled"></span><span
@@ -245,28 +278,28 @@ class Settings {
245
  title="About EmbedPress">About</a>
246
  </li>
247
  <li>
248
- <a href="//embedpress.com/docs/sources-support" target="_blank" rel="noopener noreferrer"
249
  title="List of supported sources by EmbedPress">Supported sources</a>
250
  </li>
251
  <li>
252
- <a href="//embedpress.com/docs" target="_blank" rel="noopener noreferrer"
253
  title="EmbedPress Documentation">Documentation</a>
254
  </li>
255
  <li>
256
- <a href="//embedpress.com/addons/" target="_blank" rel="noopener noreferrer"
257
- title="EmbedPress Add-Ons">Add-Ons</a>
258
  </li>
259
  <li>
260
- <a href="//embedpress.com/contact" target="_blank" rel="noopener noreferrer"
261
  title="Contact the EmbedPress team">Contact</a>
262
  </li>
263
  <li>
264
- <a href="//twitter.com/embedpress" target="_blank" rel="noopener noreferrer">
265
  <span class="dashicons dashicons-twitter"></span>
266
  </a>
267
  </li>
268
  <li>
269
- <a href="//facebook.com/embedpress" target="_blank" rel="noopener noreferrer">
270
  <span class="dashicons dashicons-facebook"></span>
271
  </a>
272
  </li>
@@ -274,7 +307,7 @@ class Settings {
274
  </nav>
275
  <p>
276
  <a href="//embedpress.com" target="_blank" rel="noopener noreferrer">
277
- <img width="100" src="//embedpress.com/wp-content/uploads/2018/01/ep-logo-2.png">
278
  </a>
279
  </p>
280
  </footer>
198
  EmbedPress
199
  </a>
200
  </h1>
201
+ <div class="embedpress-version-name">
202
+ <span class="free">Core Version: <?php echo EMBEDPRESS_VERSION; ?></span>
203
+
204
+ <?php if ( defined('EMBEDPRESS_PRO_PLUGIN_VERSION')) { ?>
205
+ <span class="pro"> Pro Version: <?php echo EMBEDPRESS_PRO_PLUGIN_VERSION; ?></span>
206
+ <?php } ?>
207
+ </div>
208
  </header>
209
 
210
  <?php settings_errors(); ?>
214
  class="nav-tab<?php echo $activeTab === 'embedpress' || empty( $activeTab ) ? ' nav-tab-active' : ''; ?> ">
215
  General settings
216
  </a>
217
+ <?php if(!defined('EMBEDPRESS_PRO_PLUGIN_VERSION')): ?>
218
+ <a href="?page=embedpress&tab=embedpress_get_pro"
219
+ class="nav-tab<?php echo $activeTab === 'embedpress_get_pro' ? ' nav-tab-active' : ''; ?> ">
220
+ Go Premium
221
+ </a>
222
+ <?php endif; ?>
223
  <?php do_action( 'embedpress:settings:render:tab', $activeTab ); ?>
224
  <?php do_action( 'embedpress_license_tab', $activeTab ); ?>
 
225
  </h2>
226
 
227
  <?php if ( $activeTab !== 'addons' ) : ?>
228
  <form action="options.php" method="POST" style="padding-bottom: 20px;">
229
  <?php settings_fields( $settingsFieldsIdentifier ); ?>
230
  <?php do_settings_sections( $settingsSectionsIdentifier ); ?>
231
+ <?php if ( $activeTab !== 'embedpress_license' && $activeTab !== 'embedpress_get_pro' ) : ?>
232
  <button type="submit" class="button button-primary embedpress-setting-save">Save changes
233
  </button>
234
  <?php endif; ?>
237
  <?php if ( $activeTab == 'embedpress_license' ) : ?>
238
  <?php echo do_action( 'embedpress_license' ); ?>
239
  <?php endif; ?>
240
+ <?php if ( $activeTab == 'embedpress_get_pro' && !defined('EMBEDPRESS_PRO_PLUGIN_VERSION') ) : ?>
241
+ <div class=" embedpress-go-premium">
242
+ <div class="embedpress-col-half">
243
+ <div class="embedpress-admin-block-wrapper">
244
+ <div class="embedpress-admin-block embedpress-admin-block-docs">
245
+ <header class="embedpress-admin-block-header">
246
+ <div class="embedpress-admin-block-header-icon">
247
+ <img src="<?php echo plugins_url( 'assets/images/icon-why-premium.svg', EMBEDPRESS_PLUGIN_BASENAME ); ?>" alt="embedpress-go-pro">
248
+ </div>
249
+ <h4 class="embedpress-admin-title">Why upgrade to Premium Version?</h4>
250
+ </header>
251
+ <div class="embedpress-admin-block-content">
252
+ <p>The premium version helps us to continue development of the product incorporating even more features and enhancements.</p>
253
+ <p>You will also get world class support from our dedicated team, 24/7.</p>
254
+ <a href="https://wpdeveloper.net/plugins/embedpress#pricing" target="_blank" class="button embedpress-btn">Get Pro Version</a>
255
+ </div>
256
+ </div>
257
+ </div><!--admin block-wrapper end-->
258
+ </div>
259
+ </div>
260
+ <?php endif; ?>
261
  </div>
262
 
263
  <footer>
264
  <p>
265
+ <a href="//embedpress.com/go/review-ep" target="_blank"
266
  rel="noopener noreferrer">If you like <strong>EmbedPress</strong> please leave us a <span
267
  class="dashicons dashicons-star-filled"></span><span
268
  class="dashicons dashicons-star-filled"></span><span
278
  title="About EmbedPress">About</a>
279
  </li>
280
  <li>
281
+ <a href="//embedpress.com/sources/" target="_blank" rel="noopener noreferrer"
282
  title="List of supported sources by EmbedPress">Supported sources</a>
283
  </li>
284
  <li>
285
+ <a href="//embedpress.com/documentation/" target="_blank" rel="noopener noreferrer"
286
  title="EmbedPress Documentation">Documentation</a>
287
  </li>
288
  <li>
289
+ <a href="//embedpress.com/#pricing" target="_blank" rel="noopener noreferrer"
290
+ title="Get EmbedPress Pro">Get EmbedPress Pro</a>
291
  </li>
292
  <li>
293
+ <a href="//embedpress.com/support/" target="_blank" rel="noopener noreferrer"
294
  title="Contact the EmbedPress team">Contact</a>
295
  </li>
296
  <li>
297
+ <a href="//twitter.com/wpdevteam" target="_blank" rel="noopener noreferrer">
298
  <span class="dashicons dashicons-twitter"></span>
299
  </a>
300
  </li>
301
  <li>
302
+ <a href="//www.facebook.com/WPDeveloperNet/" target="_blank" rel="noopener noreferrer">
303
  <span class="dashicons dashicons-facebook"></span>
304
  </a>
305
  </li>
307
  </nav>
308
  <p>
309
  <a href="//embedpress.com" target="_blank" rel="noopener noreferrer">
310
+ <img width="100" src="<?php echo plugins_url( 'assets/images/embedpress.png', EMBEDPRESS_PLUGIN_BASENAME ); ?>">
311
  </a>
312
  </p>
313
  </footer>
Gutenberg/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(r){if(n[r])return n[r].exports;var l=n[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";var r=wp.i18n.__,l=wp.element.Fragment,i=wp.components,o=i.IconButton,a=i.Toolbar,s=wp.editor.BlockControls,c=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(l,null,wp.element.createElement(s,null,wp.element.createElement(a,null,t&&wp.element.createElement(o,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=c},function(e,t,n){"use strict";var r=wp.i18n.__,l=wp.components.Spinner,i=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(l,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=i},function(e,t,n){"use strict";var r=wp.i18n,l=r.__,i=r._x,o=wp.components,a=o.Button,s=o.Placeholder,c=wp.blockEditor.BlockIcon,u=function(e){var t=e.icon,n=e.label,r=e.value,o=e.onSubmit,u=e.onChange,p=e.cannotEmbed;return wp.element.createElement(s,{icon:wp.element.createElement(c,{icon:t,showColors:!0}),label:n,className:"wp-block-embed"},wp.element.createElement("form",{onSubmit:o},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:l("Enter URL to embed here\u2026"),onChange:u}),wp.element.createElement(a,{isLarge:!0,type:"submit"},i("Embed","button label")),p&&wp.element.createElement("p",{className:"components-placeholder__error"},l("Sorry, we could not embed that content."),wp.element.createElement("br",null))))};t.a=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(10),a=n.n(o),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),c(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",s({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"f",function(){return s}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"g",function(){return f}),n.d(t,"h",function(){return d});var r=wp.components,l=r.G,i=r.Path,o=(r.Polygon,r.SVG),a=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(l,null,wp.element.createElement(i,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(i,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(i,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),s=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(l,null,wp.element.createElement(i,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(i,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(i,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(i,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(i,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(i,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(i,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(i,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null),wp.element.createElement(l,null)),c=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(l,null,wp.element.createElement(i,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(i,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(i,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(l,null,wp.element.createElement(i,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(i,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(i,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(l,null,wp.element.createElement(i,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(i,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(i,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(l,null,wp.element.createElement(i,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(i,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(i,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(i,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(i,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(i,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(i,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),f=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(l,null,wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(i,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(i,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(i,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),d=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(l,null,wp.element.createElement(i,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(i,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"})))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(11),n(15),n(19),n(23),n(27),n(31),n(35)},function(e,t,n){"use strict";var r=n(7),l=(n.n(r),n(8)),i=(n.n(l),n(9)),o=n(4),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:o.a,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{class:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=n(3),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),l=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=l.exec(r),o=i[1];o&&"document"==o?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Docs URL");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(d,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:u,onLoad:this.onLoad,style:{display:l?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),wp.element.createElement(o.a,{url:this.state.url,showEditButton:i,hasEmbed:this.props.preview,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(12),l=(n.n(r),n(13)),i=(n.n(l),n(14)),o=n(4),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:o.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=n(3),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),l=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=l.exec(r),o=i[1];o&&"presentation"==o?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Slides URL");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(d,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:u,onLoad:this.onLoad,style:{display:l?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),wp.element.createElement(o.a,{showEditButton:u&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(16),l=(n.n(r),n(17)),i=(n.n(l),n(18)),o=n(4),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:o.e,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=n(3),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),l=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=l.exec(r),o=i[1];if(o&&"spreadsheets"==o){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var s=!1,c=!1;a.map(function(e){e.indexOf("widget=")?c=!0:e.indexOf("headers=")&&(s=!0)}),c||(r+="&widget=true"),s||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Sheets URL");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(d,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:u,onLoad:this.onLoad,style:{display:l?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),wp.element.createElement(o.a,{showEditButton:u&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(20),l=(n.n(r),n(21)),i=(n.n(l),n(22)),o=n(4),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:o.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=n(3),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),l=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=l.exec(r),o=i[1];o&&"forms"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Forms URL");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(d,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:u,onLoad:this.onLoad,style:{display:l?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),wp.element.createElement(o.a,{showEditButton:u&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(24),l=(n.n(r),n(25)),i=(n.n(l),n(26)),o=n(4),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:o.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=(n(3),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()),u=wp.i18n.__,p=wp.element,m=p.Component,f=p.Fragment,d=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),c(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),l=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=l.exec(r),o=i[1];o&&"drawings"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,c=this.props.attributes.iframeSrc,p=u("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!c||r?wp.element.createElement(s.a,{label:p,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(f,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:c,onLoad:this.onLoad,style:{display:l?"none":""},width:"960",height:"720"}),wp.element.createElement(o.a,{showEditButton:c&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(m);t.a=d},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=n(28),i=(n.n(l),n(29)),o=(n.n(i),n(30)),a=n(4),s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:s("Google Maps"),icon:a.d,category:"embedpress",keywords:[s("embedpress"),s("google"),s("maps")],attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=n(3),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var l=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,i=l.exec(r);i&&i.length>1&&i[1]&&i[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+i[1]+"&spn="+i[1]+"&t=m&z="+Math.round(parseInt(i[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Maps URL");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(d,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:u,onLoad:this.onLoad,style:{display:l?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),wp.element.createElement(o.a,{showEditButton:u&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(32),l=(n.n(r),n(33)),i=(n.n(l),n(34)),o=n(4),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:s("Twitch"),icon:o.g,category:"embedpress",keywords:[s("embedpress"),s("twitch")],attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs;return wp.element.createElement("div",{class:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:n},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=n(3),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var l=this.decodeHTMLEntities(t),i=r.exec(l),o=i[1];console.log(o);var a,s="channel";switch(t.indexOf("clips.twitch.tv")>-1?s="clip":t.indexOf("/videos/")>-1?s="video":t.indexOf("#/chat$#")>-1&&(s="chat"),console.log(s),s){case"channel":l="https://player.twitch.tv/?channel="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":l="https://clips.twitch.tv/embed?clip="+o+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":o=i[2],l="https://player.twitch.tv/?video="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":l="http://www.twitch.tv/embed/"+o+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+o+"'"}}console.log(l),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:l,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,p=this.props.attributes,f=p.iframeSrc,d=p.attrs,h=m("Twitch URL");return!f||r?wp.element.createElement(s.a,{label:h,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(w,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,u({src:f},d,{onLoad:this.onLoad,style:{display:l?"none":""},width:"600",height:"450"})),wp.element.createElement(o.a,{showEditButton:f&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(36),l=(n.n(r),n(37)),i=(n.n(l),n(38)),o=n(4),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:o.h,category:"embedpress",keywords:[a("embedpress"),a("wistia")],edit:i.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),a=n(1),s=n(2),c=n(3),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,mediaId:null},e.setUrl(),e}return i(t,e),u(t,[{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),console.log(embedpressObj),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),l=r[1],i="//fast.wistia.net/embed/iframe/"+l;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:l}),n({iframeSrc:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,l=t.fetching,i=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Wistia URL");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})}}):wp.element.createElement(d,null,l?wp.element.createElement(a.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(c.a,{src:u,onLoad:this.onLoad,style:{display:l?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(o.a,{showEditButton:u&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w}]);
1
+ !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"f",function(){return s}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"g",function(){return f}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return w});var r=wp.components,o=r.G,l=r.Path,i=(r.Polygon,r.SVG),a=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),s=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(o,null,wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(l,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(l,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(l,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(l,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null)),c=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(l,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(l,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(l,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(l,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(l,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(l,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),f=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),d=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(l,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),w=wp.element.createElement(i,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(l,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"}))},function(e,t,n){"use strict";var r=wp.i18n.__,o=wp.element.Fragment,l=wp.components,i=l.IconButton,a=l.Toolbar,s=wp.editor.BlockControls,c=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(o,null,wp.element.createElement(s,null,wp.element.createElement(a,null,t&&wp.element.createElement(i,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=c},function(e,t,n){"use strict";var r=wp.i18n.__,o=wp.components.Spinner,l=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(o,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=l},function(e,t,n){"use strict";var r=n(10),o=n.n(r),l=wp.i18n,i=l.__,a=l._x,s=wp.components,c=s.Button,u=s.Placeholder,p=s.ExternalLink,m=wp.blockEditor.BlockIcon,f=function(e){var t=e.icon,n=e.label,r=e.value,l=e.onSubmit,s=e.onChange,f=e.cannotEmbed,d=e.docLink,w=e.DocTitle,h=o()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(u,{icon:wp.element.createElement(m,{icon:t,showColors:!0}),label:n,className:h},wp.element.createElement("form",{onSubmit:l},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:i("Enter URL to embed here\u2026"),onChange:s}),wp.element.createElement(c,{isLarge:!0,type:"submit"},a("Embed","button label")),f&&wp.element.createElement("p",{className:"components-placeholder__error"},i("Sorry, we could not embed that content."),wp.element.createElement("br",null))),d&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(p,{href:d},w))))};t.a=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(11),a=n.n(i),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),c(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",s({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(12),n(16),n(20),n(24),n(28),n(32),n(36),n(40)},function(e,t,n){"use strict";var r=n(7),o=(n.n(r),n(8)),l=(n.n(o),n(9)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:i.a,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element.Component,d=wp.components.Disabled,w=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"document"==i?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes,f=p.iframeSrc,w=(p.align,m("Google Docs URL"));return!f||r?wp.element.createElement("div",null,wp.element.createElement(s.a,{label:w,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.a,DocTitle:m("Learn more about Google doc"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(d,null,wp.element.createElement(c.a,{src:f,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:f&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){var r,o;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var i=n.apply(null,r);i&&e.push(i)}else if("object"===o)for(var a in r)l.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(13),o=(n.n(r),n(14)),l=(n.n(o),n(15)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:i.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"presentation"==i?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Slides URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.f,DocTitle:m("Learn more about Google slides"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(17),o=(n.n(r),n(18)),l=(n.n(o),n(19)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:i.e,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];if(i&&"spreadsheets"==i){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var s=!1,c=!1;a.map(function(e){e.indexOf("widget=")?c=!0:e.indexOf("headers=")&&(s=!0)}),c||(r+="&widget=true"),s||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Sheets URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:m("Learn more about Google sheet"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(21),o=(n.n(r),n(22)),l=(n.n(o),n(23)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:i.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"forms"==i?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Forms URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.c,DocTitle:m("Learn more about Google forms"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(25),o=(n.n(r),n(26)),l=(n.n(o),n(27)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:i.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"drawings"==i?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:c.b,DocTitle:p("Learn more about Google drawing"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(d,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:o?"none":""},width:"960",height:"720"}),wp.element.createElement(i.a,{showEditButton:u&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(29),l=(n.n(o),n(30)),i=(n.n(l),n(31)),a=n(0),s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:s("Google Maps"),icon:a.d,category:"embedpress",keywords:[s("embedpress"),s("google"),s("maps")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var o=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,l=o.exec(r);l&&l.length>1&&l[1]&&l[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+l[1]+"&spn="+l[1]+"&t=m&z="+Math.round(parseInt(l[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Maps URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.d,DocTitle:m("Learn more about Google map"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(33),o=(n.n(r),n(34)),l=(n.n(o),n(35)),i=n(0),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:s("Twitch"),icon:i.g,category:"embedpress",keywords:[s("embedpress"),s("twitch")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:n},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=wp.i18n.__,d=wp.element,w=d.Component,h=d.Fragment,b=wp.components.Disabled,g=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),m(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var o=this.decodeHTMLEntities(t),l=r.exec(o),i=l[1];console.log(i);var a,s="channel";switch(t.indexOf("clips.twitch.tv")>-1?s="clip":t.indexOf("/videos/")>-1?s="video":t.indexOf("#/chat$#")>-1&&(s="chat"),console.log(s),s){case"channel":o="https://player.twitch.tv/?channel="+i,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":o="https://clips.twitch.tv/embed?clip="+i+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":i=l[2],o="https://player.twitch.tv/?video="+i,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":o="http://www.twitch.tv/embed/"+i+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+i+"'"}}console.log(o),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,m=this.props.attributes,d=m.iframeSrc,w=m.attrs,g=f("Twitch URL");return!d||r?wp.element.createElement(s.a,{label:g,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:f("Learn more about twitch"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"}):wp.element.createElement(h,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(b,null,wp.element.createElement(c.a,p({src:d},w,{onLoad:this.onLoad,style:{display:o?"none":""},width:"600",height:"450"}))),wp.element.createElement(i.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(w);t.a=g},function(e,t,n){"use strict";var r=n(37),o=(n.n(r),n(38)),l=(n.n(o),n(39)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:i.h,category:"embedpress",keywords:[a("embedpress"),a("wistia")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,mediaId:null},e.setUrl(),e}return l(t,e),p(t,[{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),console.log(embedpressObj),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),o=r[1],l="//fast.wistia.net/embed/iframe/"+o;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:o}),n({iframeSrc:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Wistia URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:m("Learn more about Wistia"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(41),o=(n.n(r),n(42)),l=(n.n(o),n(43)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/youtube-block",{title:a("Youtube"),icon:i.i,category:"embedpress",keywords:[a("embedpress"),a("youtube")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=wp.i18n.__,d=wp.element,w=d.Component,h=d.Fragment,b=wp.components.Disabled,g=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),m(t,[{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var o=r[1],l="https://www.youtube.com/embed/"+o,i=new URL(l);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)i.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i.href,mediaId:o})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,m=this.props.attributes,d=m.iframeSrc,w=m.attrs;console.log(d);var g=f("Youtube URL");return!d||r?wp.element.createElement(s.a,{label:g,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:f("Learn more about Youtube"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(h,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(b,null,wp.element.createElement(c.a,p({src:d},w,{onLoad:this.onLoad,style:{display:o?"none":""},width:"640",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))),wp.element.createElement(i.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(w);t.a=g}]);
Gutenberg/package-lock.json CHANGED
@@ -1690,6 +1690,11 @@
1690
  }
1691
  }
1692
  },
 
 
 
 
 
1693
  "cli-boxes": {
1694
  "version": "1.0.0",
1695
  "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz",
@@ -2931,8 +2936,7 @@
2931
  },
2932
  "ansi-regex": {
2933
  "version": "2.1.1",
2934
- "bundled": true,
2935
- "optional": true
2936
  },
2937
  "aproba": {
2938
  "version": "1.2.0",
@@ -2950,13 +2954,11 @@
2950
  },
2951
  "balanced-match": {
2952
  "version": "1.0.0",
2953
- "bundled": true,
2954
- "optional": true
2955
  },
2956
  "brace-expansion": {
2957
  "version": "1.1.11",
2958
  "bundled": true,
2959
- "optional": true,
2960
  "requires": {
2961
  "balanced-match": "^1.0.0",
2962
  "concat-map": "0.0.1"
@@ -2969,18 +2971,15 @@
2969
  },
2970
  "code-point-at": {
2971
  "version": "1.1.0",
2972
- "bundled": true,
2973
- "optional": true
2974
  },
2975
  "concat-map": {
2976
  "version": "0.0.1",
2977
- "bundled": true,
2978
- "optional": true
2979
  },
2980
  "console-control-strings": {
2981
  "version": "1.1.0",
2982
- "bundled": true,
2983
- "optional": true
2984
  },
2985
  "core-util-is": {
2986
  "version": "1.0.2",
@@ -3083,8 +3082,7 @@
3083
  },
3084
  "inherits": {
3085
  "version": "2.0.4",
3086
- "bundled": true,
3087
- "optional": true
3088
  },
3089
  "ini": {
3090
  "version": "1.3.5",
@@ -3094,7 +3092,6 @@
3094
  "is-fullwidth-code-point": {
3095
  "version": "1.0.0",
3096
  "bundled": true,
3097
- "optional": true,
3098
  "requires": {
3099
  "number-is-nan": "^1.0.0"
3100
  }
@@ -3107,20 +3104,17 @@
3107
  "minimatch": {
3108
  "version": "3.0.4",
3109
  "bundled": true,
3110
- "optional": true,
3111
  "requires": {
3112
  "brace-expansion": "^1.1.7"
3113
  }
3114
  },
3115
  "minimist": {
3116
  "version": "1.2.5",
3117
- "bundled": true,
3118
- "optional": true
3119
  },
3120
  "minipass": {
3121
  "version": "2.9.0",
3122
  "bundled": true,
3123
- "optional": true,
3124
  "requires": {
3125
  "safe-buffer": "^5.1.2",
3126
  "yallist": "^3.0.0"
@@ -3137,7 +3131,6 @@
3137
  "mkdirp": {
3138
  "version": "0.5.3",
3139
  "bundled": true,
3140
- "optional": true,
3141
  "requires": {
3142
  "minimist": "^1.2.5"
3143
  }
@@ -3193,8 +3186,7 @@
3193
  },
3194
  "npm-normalize-package-bin": {
3195
  "version": "1.0.1",
3196
- "bundled": true,
3197
- "optional": true
3198
  },
3199
  "npm-packlist": {
3200
  "version": "1.4.8",
@@ -3219,8 +3211,7 @@
3219
  },
3220
  "number-is-nan": {
3221
  "version": "1.0.1",
3222
- "bundled": true,
3223
- "optional": true
3224
  },
3225
  "object-assign": {
3226
  "version": "4.1.1",
@@ -3230,7 +3221,6 @@
3230
  "once": {
3231
  "version": "1.4.0",
3232
  "bundled": true,
3233
- "optional": true,
3234
  "requires": {
3235
  "wrappy": "1"
3236
  }
@@ -3299,8 +3289,7 @@
3299
  },
3300
  "safe-buffer": {
3301
  "version": "5.1.2",
3302
- "bundled": true,
3303
- "optional": true
3304
  },
3305
  "safer-buffer": {
3306
  "version": "2.1.2",
@@ -3330,7 +3319,6 @@
3330
  "string-width": {
3331
  "version": "1.0.2",
3332
  "bundled": true,
3333
- "optional": true,
3334
  "requires": {
3335
  "code-point-at": "^1.0.0",
3336
  "is-fullwidth-code-point": "^1.0.0",
@@ -3348,7 +3336,6 @@
3348
  "strip-ansi": {
3349
  "version": "3.0.1",
3350
  "bundled": true,
3351
- "optional": true,
3352
  "requires": {
3353
  "ansi-regex": "^2.0.0"
3354
  }
@@ -3387,13 +3374,11 @@
3387
  },
3388
  "wrappy": {
3389
  "version": "1.0.2",
3390
- "bundled": true,
3391
- "optional": true
3392
  },
3393
  "yallist": {
3394
  "version": "3.1.1",
3395
- "bundled": true,
3396
- "optional": true
3397
  }
3398
  }
3399
  },
1690
  }
1691
  }
1692
  },
1693
+ "classnames": {
1694
+ "version": "2.2.6",
1695
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
1696
+ "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
1697
+ },
1698
  "cli-boxes": {
1699
  "version": "1.0.0",
1700
  "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz",
2936
  },
2937
  "ansi-regex": {
2938
  "version": "2.1.1",
2939
+ "bundled": true
 
2940
  },
2941
  "aproba": {
2942
  "version": "1.2.0",
2954
  },
2955
  "balanced-match": {
2956
  "version": "1.0.0",
2957
+ "bundled": true
 
2958
  },
2959
  "brace-expansion": {
2960
  "version": "1.1.11",
2961
  "bundled": true,
 
2962
  "requires": {
2963
  "balanced-match": "^1.0.0",
2964
  "concat-map": "0.0.1"
2971
  },
2972
  "code-point-at": {
2973
  "version": "1.1.0",
2974
+ "bundled": true
 
2975
  },
2976
  "concat-map": {
2977
  "version": "0.0.1",
2978
+ "bundled": true
 
2979
  },
2980
  "console-control-strings": {
2981
  "version": "1.1.0",
2982
+ "bundled": true
 
2983
  },
2984
  "core-util-is": {
2985
  "version": "1.0.2",
3082
  },
3083
  "inherits": {
3084
  "version": "2.0.4",
3085
+ "bundled": true
 
3086
  },
3087
  "ini": {
3088
  "version": "1.3.5",
3092
  "is-fullwidth-code-point": {
3093
  "version": "1.0.0",
3094
  "bundled": true,
 
3095
  "requires": {
3096
  "number-is-nan": "^1.0.0"
3097
  }
3104
  "minimatch": {
3105
  "version": "3.0.4",
3106
  "bundled": true,
 
3107
  "requires": {
3108
  "brace-expansion": "^1.1.7"
3109
  }
3110
  },
3111
  "minimist": {
3112
  "version": "1.2.5",
3113
+ "bundled": true
 
3114
  },
3115
  "minipass": {
3116
  "version": "2.9.0",
3117
  "bundled": true,
 
3118
  "requires": {
3119
  "safe-buffer": "^5.1.2",
3120
  "yallist": "^3.0.0"
3131
  "mkdirp": {
3132
  "version": "0.5.3",
3133
  "bundled": true,
 
3134
  "requires": {
3135
  "minimist": "^1.2.5"
3136
  }
3186
  },
3187
  "npm-normalize-package-bin": {
3188
  "version": "1.0.1",
3189
+ "bundled": true
 
3190
  },
3191
  "npm-packlist": {
3192
  "version": "1.4.8",
3211
  },
3212
  "number-is-nan": {
3213
  "version": "1.0.1",
3214
+ "bundled": true
 
3215
  },
3216
  "object-assign": {
3217
  "version": "4.1.1",
3221
  "once": {
3222
  "version": "1.4.0",
3223
  "bundled": true,
 
3224
  "requires": {
3225
  "wrappy": "1"
3226
  }
3289
  },
3290
  "safe-buffer": {
3291
  "version": "5.1.2",
3292
+ "bundled": true
 
3293
  },
3294
  "safer-buffer": {
3295
  "version": "2.1.2",
3319
  "string-width": {
3320
  "version": "1.0.2",
3321
  "bundled": true,
 
3322
  "requires": {
3323
  "code-point-at": "^1.0.0",
3324
  "is-fullwidth-code-point": "^1.0.0",
3336
  "strip-ansi": {
3337
  "version": "3.0.1",
3338
  "bundled": true,
 
3339
  "requires": {
3340
  "ansi-regex": "^2.0.0"
3341
  }
3374
  },
3375
  "wrappy": {
3376
  "version": "1.0.2",
3377
+ "bundled": true
 
3378
  },
3379
  "yallist": {
3380
  "version": "3.1.1",
3381
+ "bundled": true
 
3382
  }
3383
  }
3384
  },
Gutenberg/package.json CHANGED
@@ -8,6 +8,7 @@
8
  "eject": "cgb-scripts eject"
9
  },
10
  "dependencies": {
 
11
  "cgb-scripts": "1.15.0"
12
  }
13
  }
8
  "eject": "cgb-scripts eject"
9
  },
10
  "dependencies": {
11
+ "classnames": "^2.2.5",
12
  "cgb-scripts": "1.15.0"
13
  }
14
  }
Gutenberg/src/blocks.js CHANGED
@@ -17,3 +17,4 @@ import './google-drawings/index.js';
17
  import './google-maps/index.js';
18
  import './twitch/index.js';
19
  import './wistia/index.js';
 
17
  import './google-maps/index.js';
18
  import './twitch/index.js';
19
  import './wistia/index.js';
20
+ import './youtube/index.js';
Gutenberg/src/common/embed-controls.js CHANGED
@@ -9,7 +9,7 @@ const { BlockControls } = wp.editor;
9
  const EmbedControls = ( props ) => {
10
  const {
11
  showEditButton,
12
- switchBackToURLInput,
13
  } = props;
14
  return (
15
  <Fragment>
9
  const EmbedControls = ( props ) => {
10
  const {
11
  showEditButton,
12
+ switchBackToURLInput
13
  } = props;
14
  return (
15
  <Fragment>
Gutenberg/src/common/embed-placeholder.js CHANGED
@@ -1,34 +1,48 @@
1
  /**
2
  * WordPress dependencies
3
  */
4
- const { __, _x } = wp.i18n;
5
- const { Button, Placeholder } = wp.components;
6
- const { BlockIcon } = wp.blockEditor;
 
7
 
8
- const EmbedPlaceholder = ( props ) => {
9
- const { icon, label, value, onSubmit, onChange, cannotEmbed } = props;
 
10
  return (
11
- <Placeholder icon={ <BlockIcon icon={ icon } showColors /> } label={ label } className="wp-block-embed">
12
- <form onSubmit={ onSubmit }>
13
- <input
14
- type="url"
15
- value={ value || '' }
16
- className="components-placeholder__input"
17
- aria-label={ label }
18
- placeholder={ __( 'Enter URL to embed here…' ) }
19
- onChange={ onChange } />
20
- <Button
21
- isLarge
22
- type="submit">
23
- { _x( 'Embed', 'button label' ) }
24
- </Button>
25
- { cannotEmbed &&
 
 
 
26
  <p className="components-placeholder__error">
27
- { __( 'Sorry, we could not embed that content.' ) }<br />
28
  </p>
 
 
 
 
 
 
 
29
  }
30
- </form>
31
- </Placeholder>
 
 
32
  );
33
  };
34
 
1
  /**
2
  * WordPress dependencies
3
  */
4
+ const {__, _x} = wp.i18n;
5
+ import classnames from 'classnames';
6
+ const {Button, Placeholder, ExternalLink} = wp.components;
7
+ const {BlockIcon} = wp.blockEditor;
8
 
9
+ const EmbedPlaceholder = (props) => {
10
+ const {icon, label, value, onSubmit, onChange, cannotEmbed, docLink, DocTitle} = props;
11
+ const classes = classnames( 'wp-block-embed', {} );
12
  return (
13
+ <div>
14
+ <Placeholder icon={<BlockIcon icon={icon} showColors/>} label={label} className={classes}>
15
+
16
+ <form onSubmit={onSubmit}>
17
+ <input
18
+ type="url"
19
+ value={value || ''}
20
+ className="components-placeholder__input"
21
+ aria-label={label}
22
+ placeholder={__('Enter URL to embed here…')}
23
+ onChange={onChange}/>
24
+ <Button
25
+ isLarge
26
+ type="submit">
27
+ {_x('Embed', 'button label')}
28
+ </Button>
29
+
30
+ {cannotEmbed &&
31
  <p className="components-placeholder__error">
32
+ {__('Sorry, we could not embed that content.')}<br/>
33
  </p>
34
+ }
35
+
36
+ </form>
37
+ {docLink &&
38
+ <div className="components-placeholder__learn-more">
39
+ <ExternalLink href={docLink}>{DocTitle}</ExternalLink>
40
+ </div>
41
  }
42
+
43
+ </Placeholder>
44
+ </div>
45
+
46
  );
47
  };
48
 
Gutenberg/src/common/icons.js CHANGED
@@ -7,9 +7,9 @@ const {
7
  Polygon,
8
  SVG,
9
  } = wp.components;
10
- export const googleDocsIcon =
11
  <SVG xmlns="http://www.w3.org/1999/xlink"
12
- viewBox="0 0 48 48"
13
  >
14
  <G>
15
  <Path style= {{ fill: '#2196F3' }} d="M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "/>
@@ -21,35 +21,35 @@ export const googleDocsIcon =
21
  <Path style= {{ fill: '#E3F2FD' }} d="M 15 35 L 25 35 L 25 37 L 15 37 Z "/>
22
  </G>
23
  </SVG>
24
- export const googleSlidesIcon =
25
- <SVG
26
  xmlns="http://www.w3.org/1999/xlink"
27
- enable-background="new 0 0 24 24" id="Layer_2"
28
- version="1.1"
29
  viewBox="0 0 24 24">
30
  <G>
31
- <Path d="M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z"
32
  style={{ fill: "#FFC720" }}/>
33
-
34
- <Path d="M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z"
35
  style={{ fill: "url(#SVGID_1_)" }} />
36
- <Path d="M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z"
37
  style={{ opacity: "0.1" }} />
38
  <Path d="M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z" style= {{ fill: "#FFE083" }} />
39
  <Path d="M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z" style={{ opacity:"0.1" }} />
40
  <Path d="M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10" style={{ fill: "#FFFFFF", opacity: "0.2" }} />
41
- <Path d="M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z"
42
  style={{ fill: "#FFFFFF" }} />
43
-
44
  <Path d="M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z" style={{ fill: "url(#SVGID_2_)" }} />
45
  </G>
46
  <G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/>
47
  </SVG>
48
 
49
- export const googleSheetsIcon =
50
- <SVG
51
- xmlns="http://www.w3.org/1999/xlink"
52
- viewBox="0 0 48 48"
53
  version="1.1">
54
  <G>
55
  <Path style={{ fill: '#43A047' }} d="M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "/>
@@ -59,9 +59,9 @@ export const googleSheetsIcon =
59
  </G>
60
  </SVG>
61
 
62
- export const googleFormsIcon =
63
  <SVG
64
- xmlns="http://www.w3.org/1999/xlink"
65
  viewBox="0 0 48 48"
66
  version="1.1"
67
  >
@@ -78,9 +78,9 @@ export const googleFormsIcon =
78
  </G>
79
  </SVG>
80
 
81
- export const googleDrawingsIcon=
82
  <SVG
83
- xmlns="http://www.w3.org/1999/xlink"
84
  viewBox="0 0 48 48"
85
  version="1.1"
86
  >
@@ -95,7 +95,7 @@ export const googleDrawingsIcon=
95
 
96
  export const googleMapsIcon=
97
  <SVG
98
- xmlns="http://www.w3.org/1999/xlink"
99
  viewBox="0 0 48 48"
100
  version="1.1"
101
  >
@@ -111,12 +111,12 @@ export const googleMapsIcon=
111
  </G>
112
  </SVG>
113
 
114
- export const twitchIcon =
115
  <SVG
116
- xmlns="http://www.w3.org/1999/xlink"
117
  viewBox="0 0 48 48"
118
  version="1.1"
119
- >
120
  <G>
121
  <Path style={{ fill: '#FFFFFF' }} d="M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "/>
122
  <Path style={{ fill: '#8E24AA' }} d="M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "/>
@@ -125,9 +125,9 @@ export const twitchIcon =
125
  </G>
126
  </SVG>
127
 
128
- export const wistiaIcon =
129
  <SVG
130
- xmlns="http://www.w3.org/1999/xlink"
131
  viewBox="0 0 769 598"
132
  version="1.1"
133
  >
@@ -135,4 +135,18 @@ export const wistiaIcon =
135
  <Path style={{ fill: '#148ee0' }} d="M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z" />
136
  <Path style={{ fill: '#54bbff' }} d="M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z" />
137
  </G>
138
- </SVG>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  Polygon,
8
  SVG,
9
  } = wp.components;
10
+ export const googleDocsIcon =
11
  <SVG xmlns="http://www.w3.org/1999/xlink"
12
+ viewBox="0 0 48 48"
13
  >
14
  <G>
15
  <Path style= {{ fill: '#2196F3' }} d="M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "/>
21
  <Path style= {{ fill: '#E3F2FD' }} d="M 15 35 L 25 35 L 25 37 L 15 37 Z "/>
22
  </G>
23
  </SVG>
24
+ export const googleSlidesIcon =
25
+ <SVG
26
  xmlns="http://www.w3.org/1999/xlink"
27
+ enable-background="new 0 0 24 24" id="Layer_2"
28
+ version="1.1"
29
  viewBox="0 0 24 24">
30
  <G>
31
+ <Path d="M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z"
32
  style={{ fill: "#FFC720" }}/>
33
+
34
+ <Path d="M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z"
35
  style={{ fill: "url(#SVGID_1_)" }} />
36
+ <Path d="M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z"
37
  style={{ opacity: "0.1" }} />
38
  <Path d="M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z" style= {{ fill: "#FFE083" }} />
39
  <Path d="M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z" style={{ opacity:"0.1" }} />
40
  <Path d="M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10" style={{ fill: "#FFFFFF", opacity: "0.2" }} />
41
+ <Path d="M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z"
42
  style={{ fill: "#FFFFFF" }} />
43
+
44
  <Path d="M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z" style={{ fill: "url(#SVGID_2_)" }} />
45
  </G>
46
  <G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/><G/>
47
  </SVG>
48
 
49
+ export const googleSheetsIcon =
50
+ <SVG
51
+ xmlns="http://www.w3.org/1999/xlink"
52
+ viewBox="0 0 48 48"
53
  version="1.1">
54
  <G>
55
  <Path style={{ fill: '#43A047' }} d="M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "/>
59
  </G>
60
  </SVG>
61
 
62
+ export const googleFormsIcon =
63
  <SVG
64
+ xmlns="http://www.w3.org/1999/xlink"
65
  viewBox="0 0 48 48"
66
  version="1.1"
67
  >
78
  </G>
79
  </SVG>
80
 
81
+ export const googleDrawingsIcon=
82
  <SVG
83
+ xmlns="http://www.w3.org/1999/xlink"
84
  viewBox="0 0 48 48"
85
  version="1.1"
86
  >
95
 
96
  export const googleMapsIcon=
97
  <SVG
98
+ xmlns="http://www.w3.org/1999/xlink"
99
  viewBox="0 0 48 48"
100
  version="1.1"
101
  >
111
  </G>
112
  </SVG>
113
 
114
+ export const twitchIcon =
115
  <SVG
116
+ xmlns="http://www.w3.org/1999/xlink"
117
  viewBox="0 0 48 48"
118
  version="1.1"
119
+ >
120
  <G>
121
  <Path style={{ fill: '#FFFFFF' }} d="M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "/>
122
  <Path style={{ fill: '#8E24AA' }} d="M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "/>
125
  </G>
126
  </SVG>
127
 
128
+ export const wistiaIcon =
129
  <SVG
130
+ xmlns="http://www.w3.org/1999/xlink"
131
  viewBox="0 0 769 598"
132
  version="1.1"
133
  >
135
  <Path style={{ fill: '#148ee0' }} d="M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z" />
136
  <Path style={{ fill: '#54bbff' }} d="M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z" />
137
  </G>
138
+ </SVG>
139
+
140
+ export const youtubeIcon = (
141
+ <SVG
142
+ xmlns="http://www.w3.org/2000/svg"
143
+ width="24"
144
+ height="24"
145
+ viewBox="0 0 24 24"
146
+ role="img"
147
+ aria-hidden="true"
148
+ focusable="false"
149
+ >
150
+ <Path d="M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" />
151
+ </SVG>
152
+ );
Gutenberg/src/google-docs/edit.js CHANGED
@@ -10,13 +10,15 @@ import Iframe from '../common/Iframe';
10
  * WordPress dependencies
11
  */
12
  const { __ } = wp.i18n;
13
- const { Component, Fragment } = wp.element;
14
-
 
15
  class GoogleDocsEdit extends Component {
16
  constructor() {
17
  super( ...arguments );
18
  this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
19
  this.setUrl = this.setUrl.bind( this );
 
20
  this.onLoad = this.onLoad.bind( this );
21
  this.state = {
22
  editingURL: false,
@@ -41,6 +43,18 @@ class GoogleDocsEdit extends Component {
41
  return str;
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  setUrl( event ) {
46
  if ( event ) {
@@ -87,35 +101,38 @@ class GoogleDocsEdit extends Component {
87
 
88
  render() {
89
  const { url, editingURL, fetching, cannotEmbed } = this.state;
90
- const { iframeSrc } = this.props.attributes;
91
-
92
- const label = __( 'Google Docs URL');
93
 
94
  // No preview, or we can't embed the current URL, or we've clicked the edit button.
95
  if ( !iframeSrc || editingURL ) {
96
  return (
97
- <EmbedPlaceholder
98
- label={ label }
99
- onSubmit={ this.setUrl }
100
- value={ url }
101
- cannotEmbed={ cannotEmbed }
102
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
103
- />
104
- );
105
- }
106
- else {
 
 
107
 
 
 
108
  return (
109
- <Fragment>
110
  {fetching ? <EmbedLoading /> : null}
111
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
 
 
112
  <EmbedControls
113
- url={ this.state.url }
114
- showEditButton={ cannotEmbed }
115
- hasEmbed={ this.props.preview }
116
- switchBackToURLInput={ this.switchBackToURLInput }
117
  />
118
- </Fragment>
119
  )
120
  }
121
 
10
  * WordPress dependencies
11
  */
12
  const { __ } = wp.i18n;
13
+ const { Component } = wp.element;
14
+ const {Disabled} = wp.components;
15
+ import { googleDocsIcon } from '../common/icons';
16
  class GoogleDocsEdit extends Component {
17
  constructor() {
18
  super( ...arguments );
19
  this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
20
  this.setUrl = this.setUrl.bind( this );
21
+ this.updateAlignment = this.updateAlignment.bind( this );
22
  this.onLoad = this.onLoad.bind( this );
23
  this.state = {
24
  editingURL: false,
43
  return str;
44
  }
45
 
46
+ updateAlignment( nextAlign ) {
47
+ const { setAttributes } = this.props;
48
+ const extraUpdatedAttributes =
49
+ [ 'wide', 'full' ].indexOf( nextAlign ) !== -1
50
+ ? { width: undefined, height: undefined }
51
+ : {};
52
+ setAttributes( {
53
+ ...extraUpdatedAttributes,
54
+ align: nextAlign,
55
+ } );
56
+ }
57
+
58
 
59
  setUrl( event ) {
60
  if ( event ) {
101
 
102
  render() {
103
  const { url, editingURL, fetching, cannotEmbed } = this.state;
104
+ const { iframeSrc,align } = this.props.attributes;
105
+ const label = __('Google Docs URL');
 
106
 
107
  // No preview, or we can't embed the current URL, or we've clicked the edit button.
108
  if ( !iframeSrc || editingURL ) {
109
  return (
110
+ <div>
111
+ <EmbedPlaceholder
112
+ label={label}
113
+ onSubmit={ this.setUrl }
114
+ value={ url }
115
+ cannotEmbed={ cannotEmbed }
116
+ onChange={ ( event ) => this.setState( { url: event.target.value } ) }
117
+ icon={googleDocsIcon}
118
+ DocTitle={__('Learn more about Google doc')}
119
+ docLink={'https://embedpress.com/docs/embed-google-docs-wordpress/'}
120
+ />
121
+ </div>
122
 
123
+ );
124
+ } else {
125
  return (
126
+ <div>
127
  {fetching ? <EmbedLoading /> : null}
128
+ <Disabled>
129
+ <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
130
+ </Disabled>
131
  <EmbedControls
132
+ showEditButton={ iframeSrc && ! cannotEmbed }
133
+ switchBackToURLInput={ this.switchBackToURLInput }
 
 
134
  />
135
+ </div>
136
  )
137
  }
138
 
Gutenberg/src/google-docs/index.js CHANGED
@@ -9,9 +9,10 @@
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
- import { googleDocsIcon } from '../common/icons';
13
- const { __ } = wp.i18n; // Import __() from wp.i18n
14
- const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
 
15
 
16
  /**
17
  * Register: aa Gutenberg Block.
@@ -26,16 +27,20 @@ const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.b
26
  * @return {?WPBlock} The block, if it has been successfully
27
  * registered; otherwise `undefined`.
28
  */
29
- registerBlockType( 'embedpress/google-docs-block', {
30
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
- title: __( 'Google Docs' ), // Block title.
32
  icon: googleDocsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
33
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
34
  keywords: [
35
- __( 'embedpress' ),
36
- __( 'google' ),
37
- __( 'docs' ),
38
  ],
 
 
 
 
39
  attributes: {
40
  url: {
41
  type: 'string',
@@ -64,14 +69,45 @@ registerBlockType( 'embedpress/google-docs-block', {
64
  *
65
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
66
  */
67
- save: function( props ) {
68
- const { iframeSrc } = props.attributes
69
- if(iframeSrc){
 
70
  return (
71
- <div class="ose-google-docs-document">
72
- <iframe src={iframeSrc} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
73
- </div>
 
 
 
 
74
  );
75
  }
76
  },
77
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
+ import {googleDocsIcon} from '../common/icons';
13
+
14
+ const {__} = wp.i18n; // Import __() from wp.i18n
15
+ const {registerBlockType} = wp.blocks; // Import registerBlockType() from wp.blocks
16
 
17
  /**
18
  * Register: aa Gutenberg Block.
27
  * @return {?WPBlock} The block, if it has been successfully
28
  * registered; otherwise `undefined`.
29
  */
30
+ registerBlockType('embedpress/google-docs-block', {
31
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
32
+ title: __('Google Docs'), // Block title.
33
  icon: googleDocsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
34
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
35
  keywords: [
36
+ __('embedpress'),
37
+ __('google'),
38
+ __('docs'),
39
  ],
40
+ supports: {
41
+ align: true,
42
+ lightBlockWrapper: true,
43
+ },
44
  attributes: {
45
  url: {
46
  type: 'string',
69
  *
70
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
71
  */
72
+ save: function (props) {
73
+ const {iframeSrc} = props.attributes
74
+ const defaultClass = 'ose-google-docs-document'
75
+ if (iframeSrc) {
76
  return (
77
+ <figure className={defaultClass}>
78
+
79
+ <iframe src={iframeSrc} frameBorder="0" width="600" height="450" allowFullScreen="true"
80
+ mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
81
+
82
+ </figure>
83
+
84
  );
85
  }
86
  },
87
+ deprecated: [
88
+ {
89
+ attributes: {
90
+ align: {
91
+ type: "string",
92
+ enum: ["left", "center", "right", "wide", "full"]
93
+ },
94
+ },
95
+
96
+ save: function (props) {
97
+ const {iframeSrc} = props.attributes
98
+ if (iframeSrc) {
99
+ return (
100
+ <div className="ose-google-docs-document">
101
+
102
+ <iframe src={iframeSrc} frameBorder="0" width="600" height="450" allowFullScreen="true"
103
+ mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
104
+
105
+ </div>
106
+
107
+ );
108
+ }
109
+ },
110
+ }
111
+ ]
112
+
113
+ });
Gutenberg/src/google-drawings/edit.js CHANGED
@@ -4,111 +4,113 @@
4
  import EmbedControls from '../common/embed-controls';
5
  import EmbedLoading from '../common/embed-loading';
6
  import EmbedPlaceholder from '../common/embed-placeholder';
7
- import Iframe from '../common/Iframe';
8
 
9
  /**
10
  * WordPress dependencies
11
  */
12
- const { __ } = wp.i18n;
13
- const { Component, Fragment } = wp.element;
 
14
 
15
- class GoogleFormsEdit extends Component {
16
- constructor() {
17
- super( ...arguments );
18
- this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
19
- this.setUrl = this.setUrl.bind( this );
20
- this.onLoad = this.onLoad.bind( this );
21
- this.state = {
22
- editingURL: false,
23
- url: this.props.attributes.url,
24
- fetching: true,
25
- cannotEmbed: false
26
- };
27
- }
28
 
29
- onLoad() {
30
- this.setState({
31
- fetching: false
32
- })
33
- }
34
- decodeHTMLEntities (str) {
35
- if(str && typeof str === 'string') {
36
- // strip script/html tags
37
- str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
38
- str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
39
 
40
- }
41
- return str;
42
- }
 
 
43
 
 
 
 
44
 
45
- setUrl( event ) {
46
- if ( event ) {
47
- event.preventDefault();
48
- }
49
- const { url } = this.state;
50
- const { setAttributes } = this.props;
51
- setAttributes( { url } );
52
- if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
53
- var iframeSrc = this.decodeHTMLEntities(url);
54
- var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
55
- var match = regEx.exec(iframeSrc);
56
- var type = match[1];
57
- if(type && type == 'drawings') {
58
- this.setState( { editingURL: false, cannotEmbed: false } );
59
- setAttributes( {iframeSrc: iframeSrc })
60
- }
61
- else {
62
- this.setState({
63
- cannotEmbed: true,
64
- editingURL: true
65
- })
66
- }
67
- }
68
- else {
69
- this.setState({
70
- cannotEmbed: true,
71
- editingURL: true
72
- })
73
- }
74
- }
75
 
76
- switchBackToURLInput() {
77
- this.setState( { editingURL: true } );
78
- }
79
-
80
- render() {
81
- const { url, editingURL, fetching, cannotEmbed } = this.state;
82
- const { iframeSrc } = this.props.attributes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
- const label = __( 'Google Drawings URL (Get your link from File -> Publish to the web -> Link)');
 
 
85
 
86
- // No preview, or we can't embed the current URL, or we've clicked the edit button.
87
- if ( !iframeSrc || editingURL ) {
88
- return (
89
- <EmbedPlaceholder
90
- label={ label }
91
- onSubmit={ this.setUrl }
92
- value={ url }
93
- cannotEmbed={ cannotEmbed }
94
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
95
- />
96
- );
97
- }
98
- else {
99
-
100
- return (
101
- <Fragment>
102
- {fetching ? <EmbedLoading /> : null}
103
- <img src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} width="960" height="720"/>
104
- <EmbedControls
105
- showEditButton={ iframeSrc && ! cannotEmbed }
106
- switchBackToURLInput={ this.switchBackToURLInput }
107
- />
108
- </Fragment>
109
 
110
- )
111
- }
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  };
114
- export default GoogleFormsEdit;
4
  import EmbedControls from '../common/embed-controls';
5
  import EmbedLoading from '../common/embed-loading';
6
  import EmbedPlaceholder from '../common/embed-placeholder';
 
7
 
8
  /**
9
  * WordPress dependencies
10
  */
11
+ const {__} = wp.i18n;
12
+ const {Component, Fragment} = wp.element;
13
+ import {googleDrawingsIcon} from '../common/icons';
14
 
15
+ class GoogleDrawingEdit extends Component {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
19
+ this.setUrl = this.setUrl.bind(this);
20
+ this.onLoad = this.onLoad.bind(this);
21
+ this.state = {
22
+ editingURL: false,
23
+ url: this.props.attributes.url,
24
+ fetching: true,
25
+ cannotEmbed: false
26
+ };
27
+ }
28
 
29
+ onLoad() {
30
+ this.setState({
31
+ fetching: false
32
+ })
33
+ }
 
 
 
 
 
34
 
35
+ decodeHTMLEntities(str) {
36
+ if (str && typeof str === 'string') {
37
+ // strip script/html tags
38
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
39
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
40
 
41
+ }
42
+ return str;
43
+ }
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
+ setUrl(event) {
47
+ if (event) {
48
+ event.preventDefault();
49
+ }
50
+ const {url} = this.state;
51
+ const {setAttributes} = this.props;
52
+ setAttributes({url});
53
+ if (url && url.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)) {
54
+ var iframeSrc = this.decodeHTMLEntities(url);
55
+ var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
56
+ var match = regEx.exec(iframeSrc);
57
+ var type = match[1];
58
+ if (type && type == 'drawings') {
59
+ this.setState({editingURL: false, cannotEmbed: false});
60
+ setAttributes({iframeSrc: iframeSrc})
61
+ } else {
62
+ this.setState({
63
+ cannotEmbed: true,
64
+ editingURL: true
65
+ })
66
+ }
67
+ } else {
68
+ this.setState({
69
+ cannotEmbed: true,
70
+ editingURL: true
71
+ })
72
+ }
73
+ }
74
 
75
+ switchBackToURLInput() {
76
+ this.setState({editingURL: true});
77
+ }
78
 
79
+ render() {
80
+ const {url, editingURL, fetching, cannotEmbed} = this.state;
81
+ const {iframeSrc} = this.props.attributes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
+ const label = __('Google Drawings URL (Get your link from File -> Publish to the web -> Link)');
84
+
85
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
86
+ if (!iframeSrc || editingURL) {
87
+ return (
88
+ <EmbedPlaceholder
89
+ label={label}
90
+ onSubmit={this.setUrl}
91
+ value={url}
92
+ cannotEmbed={cannotEmbed}
93
+ onChange={(event) => this.setState({url: event.target.value})}
94
+ icon={googleDrawingsIcon}
95
+ DocTitle={__('Learn more about Google drawing')}
96
+ docLink={'https://embedpress.com/docs/embed-google-drawings-wordpress/'}
97
+ />
98
+ );
99
+ } else {
100
+
101
+ return (
102
+ <Fragment>
103
+ {fetching ? <EmbedLoading/> : null}
104
+ <img src={iframeSrc} onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}} width="960"
105
+ height="720"/>
106
+ <EmbedControls
107
+ showEditButton={iframeSrc && !cannotEmbed}
108
+ switchBackToURLInput={this.switchBackToURLInput}
109
+ />
110
+ </Fragment>
111
+
112
+ )
113
+ }
114
+ }
115
  };
116
+ export default GoogleDrawingEdit;
Gutenberg/src/google-drawings/index.js CHANGED
@@ -9,9 +9,10 @@
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
- import { googleDrawingsIcon } from '../common/icons';
13
- const { __ } = wp.i18n; // Import __() from wp.i18n
14
- const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
 
15
 
16
  /**
17
  * Register: aa Gutenberg Block.
@@ -26,16 +27,20 @@ const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.b
26
  * @return {?WPBlock} The block, if it has been successfully
27
  * registered; otherwise `undefined`.
28
  */
29
- registerBlockType( 'embedpress/google-drawings-block', {
30
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
- title: __( 'Google Drawings' ), // Block title.
32
  icon: googleDrawingsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
33
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
34
  keywords: [
35
- __( 'embedpress' ),
36
- __( 'google' ),
37
- __( 'drawings' ),
38
  ],
 
 
 
 
39
  attributes: {
40
  url: {
41
  type: 'string',
@@ -64,12 +69,13 @@ registerBlockType( 'embedpress/google-drawings-block', {
64
  *
65
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
66
  */
67
- save: function( props ) {
68
- const { iframeSrc } = props.attributes
 
69
  return (
70
- <div class="ose-google-docs-drawings">
71
- <img src={iframeSrc} width="960" height="720"/>
72
- </div>
73
  );
74
  },
75
- } );
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
+ import {googleDrawingsIcon} from '../common/icons';
13
+
14
+ const {__} = wp.i18n; // Import __() from wp.i18n
15
+ const {registerBlockType} = wp.blocks; // Import registerBlockType() from wp.blocks
16
 
17
  /**
18
  * Register: aa Gutenberg Block.
27
  * @return {?WPBlock} The block, if it has been successfully
28
  * registered; otherwise `undefined`.
29
  */
30
+ registerBlockType('embedpress/google-drawings-block', {
31
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
32
+ title: __('Google Drawings'), // Block title.
33
  icon: googleDrawingsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
34
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
35
  keywords: [
36
+ __('embedpress'),
37
+ __('google'),
38
+ __('drawings'),
39
  ],
40
+ supports: {
41
+ align: true,
42
+ lightBlockWrapper: true,
43
+ },
44
  attributes: {
45
  url: {
46
  type: 'string',
69
  *
70
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
71
  */
72
+ save: function (props) {
73
+ const {iframeSrc} = props.attributes
74
+ const defaultClass = 'ose-google-docs-drawings'
75
  return (
76
+ <figure className={defaultClass}>
77
+ <img src={iframeSrc} width="960" height="720"/>
78
+ </figure>
79
  );
80
  },
81
+ });
Gutenberg/src/google-forms/edit.js CHANGED
@@ -5,110 +5,119 @@ import EmbedControls from '../common/embed-controls';
5
  import EmbedLoading from '../common/embed-loading';
6
  import EmbedPlaceholder from '../common/embed-placeholder';
7
  import Iframe from '../common/Iframe';
 
8
 
9
  /**
10
  * WordPress dependencies
11
  */
12
- const { __ } = wp.i18n;
13
- const { Component, Fragment } = wp.element;
 
 
 
14
 
15
  class GoogleFormsEdit extends Component {
16
- constructor() {
17
- super( ...arguments );
18
- this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
19
- this.setUrl = this.setUrl.bind( this );
20
- this.onLoad = this.onLoad.bind( this );
21
- this.state = {
22
- editingURL: false,
23
- url: this.props.attributes.url,
24
- fetching: true,
25
- cannotEmbed: false
26
- };
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- onLoad() {
30
- this.setState({
31
- fetching: false
32
- })
33
- }
34
- decodeHTMLEntities (str) {
35
- if(str && typeof str === 'string') {
36
- // strip script/html tags
37
- str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
38
- str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
39
 
40
- }
41
- return str;
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
 
 
 
44
 
45
- setUrl( event ) {
46
- if ( event ) {
47
- event.preventDefault();
48
- }
49
- const { url } = this.state;
50
- const { setAttributes } = this.props;
51
- setAttributes( { url } );
52
- if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
53
- var iframeSrc = this.decodeHTMLEntities(url);
54
- var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
55
- var match = regEx.exec(iframeSrc);
56
- var type = match[1];
57
- if(type && type == 'forms') {
58
- this.setState( { editingURL: false, cannotEmbed: false } );
59
- setAttributes( {iframeSrc: iframeSrc })
60
- }
61
- else {
62
- this.setState({
63
- cannotEmbed: true,
64
- editingURL: true
65
- })
66
- }
67
- }
68
- else {
69
- this.setState({
70
- cannotEmbed: true,
71
- editingURL: true
72
- })
73
- }
74
- }
75
 
76
- switchBackToURLInput() {
77
- this.setState( { editingURL: true } );
78
- }
79
-
80
- render() {
81
- const { url, editingURL, fetching, cannotEmbed } = this.state;
82
- const { iframeSrc } = this.props.attributes;
83
 
84
- const label = __( 'Google Forms URL');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
- // No preview, or we can't embed the current URL, or we've clicked the edit button.
87
- if ( !iframeSrc || editingURL ) {
88
- return (
89
- <EmbedPlaceholder
90
- label={ label }
91
- onSubmit={ this.setUrl }
92
- value={ url }
93
- cannotEmbed={ cannotEmbed }
94
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
95
- />
96
- );
97
- }
98
- else {
99
-
100
- return (
101
- <Fragment>
102
- {fetching ? <EmbedLoading /> : null}
103
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
104
- <EmbedControls
105
- showEditButton={ iframeSrc && ! cannotEmbed }
106
- switchBackToURLInput={ this.switchBackToURLInput }
107
- />
108
- </Fragment>
109
 
110
- )
111
- }
112
- }
113
  };
114
  export default GoogleFormsEdit;
5
  import EmbedLoading from '../common/embed-loading';
6
  import EmbedPlaceholder from '../common/embed-placeholder';
7
  import Iframe from '../common/Iframe';
8
+ import {googleDrawingsIcon} from "../common/icons";
9
 
10
  /**
11
  * WordPress dependencies
12
  */
13
+ const {__} = wp.i18n;
14
+ const {Component, Fragment} = wp.element;
15
+ import {googleFormsIcon} from '../common/icons';
16
+
17
+ const {Disabled} = wp.components;
18
 
19
  class GoogleFormsEdit extends Component {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
23
+ this.setUrl = this.setUrl.bind(this);
24
+ this.onLoad = this.onLoad.bind(this);
25
+ this.state = {
26
+ editingURL: false,
27
+ url: this.props.attributes.url,
28
+ fetching: true,
29
+ cannotEmbed: false
30
+ };
31
+ }
32
+
33
+ onLoad() {
34
+ this.setState({
35
+ fetching: false
36
+ })
37
+ }
38
+
39
+ decodeHTMLEntities(str) {
40
+ if (str && typeof str === 'string') {
41
+ // strip script/html tags
42
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
43
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
44
+
45
+ }
46
+ return str;
47
+ }
48
 
 
 
 
 
 
 
 
 
 
 
49
 
50
+ setUrl(event) {
51
+ if (event) {
52
+ event.preventDefault();
53
+ }
54
+ const {url} = this.state;
55
+ const {setAttributes} = this.props;
56
+ setAttributes({url});
57
+ if (url && url.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)) {
58
+ var iframeSrc = this.decodeHTMLEntities(url);
59
+ var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
60
+ var match = regEx.exec(iframeSrc);
61
+ var type = match[1];
62
+ if (type && type == 'forms') {
63
+ this.setState({editingURL: false, cannotEmbed: false});
64
+ setAttributes({iframeSrc: iframeSrc})
65
+ } else {
66
+ this.setState({
67
+ cannotEmbed: true,
68
+ editingURL: true
69
+ })
70
+ }
71
+ } else {
72
+ this.setState({
73
+ cannotEmbed: true,
74
+ editingURL: true
75
+ })
76
+ }
77
+ }
78
 
79
+ switchBackToURLInput() {
80
+ this.setState({editingURL: true});
81
+ }
82
 
83
+ render() {
84
+ const {url, editingURL, fetching, cannotEmbed} = this.state;
85
+ const {iframeSrc} = this.props.attributes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
+ const label = __('Google Forms URL');
 
 
 
 
 
 
88
 
89
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
90
+ if (!iframeSrc || editingURL) {
91
+ return (
92
+ <EmbedPlaceholder
93
+ label={label}
94
+ onSubmit={this.setUrl}
95
+ value={url}
96
+ cannotEmbed={cannotEmbed}
97
+ onChange={(event) => this.setState({url: event.target.value})}
98
+ icon={googleFormsIcon}
99
+ DocTitle={__('Learn more about Google forms')}
100
+ docLink={'https://embedpress.com/docs/embed-google-forms-wordpress/'}
101
+ />
102
+ );
103
+ } else {
104
 
105
+ return (
106
+ <Fragment>
107
+ {fetching ? <EmbedLoading/> : null}
108
+ <Disabled>
109
+ <Iframe src={iframeSrc} onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
110
+ frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true"
111
+ webkitallowfullscreen="true"/>
112
+ </Disabled>
113
+ <EmbedControls
114
+ showEditButton={iframeSrc && !cannotEmbed}
115
+ switchBackToURLInput={this.switchBackToURLInput}
116
+ />
117
+ </Fragment>
 
 
 
 
 
 
 
 
 
 
118
 
119
+ )
120
+ }
121
+ }
122
  };
123
  export default GoogleFormsEdit;
Gutenberg/src/google-forms/index.js CHANGED
@@ -9,9 +9,10 @@
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
- import { googleFormsIcon } from '../common/icons';
13
- const { __ } = wp.i18n; // Import __() from wp.i18n
14
- const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
 
15
 
16
  /**
17
  * Register: aa Gutenberg Block.
@@ -26,16 +27,20 @@ const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.b
26
  * @return {?WPBlock} The block, if it has been successfully
27
  * registered; otherwise `undefined`.
28
  */
29
- registerBlockType( 'embedpress/google-forms-block', {
30
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
- title: __( 'Google Forms' ), // Block title.
32
  icon: googleFormsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
33
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
34
  keywords: [
35
- __( 'embedpress' ),
36
- __( 'google' ),
37
- __( 'forms' ),
38
  ],
 
 
 
 
39
  attributes: {
40
  url: {
41
  type: 'string',
@@ -64,12 +69,14 @@ registerBlockType( 'embedpress/google-forms-block', {
64
  *
65
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
66
  */
67
- save: function( props ) {
68
- const { iframeSrc } = props.attributes
 
69
  return (
70
- <div class="ose-google-docs-forms">
71
- <iframe src={iframeSrc} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
72
- </div>
 
73
  );
74
  },
75
- } );
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
+ import {googleFormsIcon} from '../common/icons';
13
+
14
+ const {__} = wp.i18n; // Import __() from wp.i18n
15
+ const {registerBlockType} = wp.blocks; // Import registerBlockType() from wp.blocks
16
 
17
  /**
18
  * Register: aa Gutenberg Block.
27
  * @return {?WPBlock} The block, if it has been successfully
28
  * registered; otherwise `undefined`.
29
  */
30
+ registerBlockType('embedpress/google-forms-block', {
31
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
32
+ title: __('Google Forms'), // Block title.
33
  icon: googleFormsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
34
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
35
  keywords: [
36
+ __('embedpress'),
37
+ __('google'),
38
+ __('forms'),
39
  ],
40
+ supports: {
41
+ align: true,
42
+ lightBlockWrapper: true,
43
+ },
44
  attributes: {
45
  url: {
46
  type: 'string',
69
  *
70
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
71
  */
72
+ save: function (props) {
73
+ const {iframeSrc} = props.attributes
74
+ const defaultClass = 'ose-google-docs-forms'
75
  return (
76
+ <figure className={defaultClass}>
77
+ <iframe src={iframeSrc} frameborder="0" width="600" height="450" allowfullscreen="true"
78
+ mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
79
+ </figure>
80
  );
81
  },
82
+ });
Gutenberg/src/google-maps/edit.js CHANGED
@@ -9,113 +9,121 @@ import Iframe from '../common/Iframe';
9
  /**
10
  * WordPress dependencies
11
  */
12
- const { __ } = wp.i18n;
13
- const { Component, Fragment } = wp.element;
14
-
15
- class GoogleSlidesEdit extends Component {
16
- constructor() {
17
- super( ...arguments );
18
- this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
19
- this.setUrl = this.setUrl.bind( this );
20
- this.onLoad = this.onLoad.bind( this );
21
- this.state = {
22
- editingURL: false,
23
- url: this.props.attributes.url,
24
- fetching: true,
25
- cannotEmbed: false
26
- };
27
- }
28
-
29
- onLoad() {
30
- this.setState({
31
- fetching: false
32
- })
33
- }
34
- decodeHTMLEntities (str) {
35
- if(str && typeof str === 'string') {
36
- // strip script/html tags
37
- str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
38
- str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
39
-
40
- }
41
- return str;
42
- }
43
-
44
-
45
- setUrl( event ) {
46
- if ( event ) {
47
- event.preventDefault();
48
- }
49
- const { url } = this.state;
50
- const { setAttributes } = this.props;
51
- setAttributes( { url } );
52
- if(url && url.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i) ) {
53
- var iframeSrc = this.decodeHTMLEntities(url);
54
- /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
55
- if(url.match('~(maps/embed|output=embed)~i')) {
56
- //do something
57
- }
58
- else {
59
- var regEx = /@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i;
60
- var match = regEx.exec(iframeSrc);
61
- if(match && match.length > 1 && match[1] && match[2]) {
62
- iframeSrc = 'https://maps.google.com/maps?hl=en&ie=UTF8&ll=' + match[1] + '&spn=' + match[1] + '&t=m&z=' + Math.round(parseInt(match[2])) + '&output=embed';
63
- }
64
- else {
65
- this.setState({
66
- cannotEmbed: true,
67
- editingURL: true
68
- })
69
- }
70
-
71
- }
72
- this.setState( { editingURL: false, cannotEmbed: false } );
73
- setAttributes( {iframeSrc: iframeSrc })
74
- }
75
- else {
76
- this.setState({
77
- cannotEmbed: true,
78
- editingURL: true
79
- })
80
- }
81
- }
82
-
83
- switchBackToURLInput() {
84
- this.setState( { editingURL: true } );
85
- }
86
-
87
- render() {
88
- const { url, editingURL, fetching, cannotEmbed } = this.state;
89
- const { iframeSrc } = this.props.attributes;
90
-
91
- const label = __( 'Google Maps URL');
92
-
93
- // No preview, or we can't embed the current URL, or we've clicked the edit button.
94
- if ( !iframeSrc || editingURL ) {
95
- return (
96
- <EmbedPlaceholder
97
- label={ label }
98
- onSubmit={ this.setUrl }
99
- value={ url }
100
- cannotEmbed={ cannotEmbed }
101
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
102
- />
103
- );
104
- }
105
- else {
106
-
107
- return (
108
- <Fragment>
109
- {fetching ? <EmbedLoading /> : null}
110
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
111
- <EmbedControls
112
- showEditButton={ iframeSrc && ! cannotEmbed }
113
- switchBackToURLInput={ this.switchBackToURLInput }
114
- />
115
- </Fragment>
116
-
117
- )
118
- }
119
- }
 
 
 
 
 
 
 
 
120
  };
121
- export default GoogleSlidesEdit;
9
  /**
10
  * WordPress dependencies
11
  */
12
+ const {__} = wp.i18n;
13
+ const {Component, Fragment} = wp.element;
14
+ import {googleMapsIcon} from '../common/icons'
15
+
16
+ const {Disabled} = wp.components;
17
+
18
+ class GoogleMapsEdit extends Component {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
22
+ this.setUrl = this.setUrl.bind(this);
23
+ this.onLoad = this.onLoad.bind(this);
24
+ this.state = {
25
+ editingURL: false,
26
+ url: this.props.attributes.url,
27
+ fetching: true,
28
+ cannotEmbed: false
29
+ };
30
+ }
31
+
32
+ onLoad() {
33
+ this.setState({
34
+ fetching: false
35
+ })
36
+ }
37
+
38
+ decodeHTMLEntities(str) {
39
+ if (str && typeof str === 'string') {
40
+ // strip script/html tags
41
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
42
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
43
+
44
+ }
45
+ return str;
46
+ }
47
+
48
+
49
+ setUrl(event) {
50
+ if (event) {
51
+ event.preventDefault();
52
+ }
53
+ const {url} = this.state;
54
+ const {setAttributes} = this.props;
55
+ setAttributes({url});
56
+ if (url && url.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)) {
57
+ var iframeSrc = this.decodeHTMLEntities(url);
58
+ /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
59
+ if (url.match('~(maps/embed|output=embed)~i')) {
60
+ //do something
61
+ } else {
62
+ var regEx = /@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i;
63
+ var match = regEx.exec(iframeSrc);
64
+ if (match && match.length > 1 && match[1] && match[2]) {
65
+ iframeSrc = 'https://maps.google.com/maps?hl=en&ie=UTF8&ll=' + match[1] + '&spn=' + match[1] + '&t=m&z=' + Math.round(parseInt(match[2])) + '&output=embed';
66
+ } else {
67
+ this.setState({
68
+ cannotEmbed: true,
69
+ editingURL: true
70
+ })
71
+ }
72
+
73
+ }
74
+ this.setState({editingURL: false, cannotEmbed: false});
75
+ setAttributes({iframeSrc: iframeSrc})
76
+ } else {
77
+ this.setState({
78
+ cannotEmbed: true,
79
+ editingURL: true
80
+ })
81
+ }
82
+ }
83
+
84
+ switchBackToURLInput() {
85
+ this.setState({editingURL: true});
86
+ }
87
+
88
+ render() {
89
+ const {url, editingURL, fetching, cannotEmbed} = this.state;
90
+ const {iframeSrc} = this.props.attributes;
91
+
92
+ const label = __('Google Maps URL');
93
+
94
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
95
+ if (!iframeSrc || editingURL) {
96
+ return (
97
+ <EmbedPlaceholder
98
+ label={label}
99
+ onSubmit={this.setUrl}
100
+ value={url}
101
+ cannotEmbed={cannotEmbed}
102
+ onChange={(event) => this.setState({url: event.target.value})}
103
+ icon={googleMapsIcon}
104
+ DocTitle={__('Learn more about Google map')}
105
+ docLink={'https://embedpress.com/docs/embed-google-maps-wordpress/'}
106
+ />
107
+ );
108
+ } else {
109
+
110
+ return (
111
+ <Fragment>
112
+ {fetching ? <EmbedLoading/> : null}
113
+ <Disabled>
114
+ <Iframe src={iframeSrc} onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
115
+ frameborder="0" width="600" height="450" allowfullscreen="true"
116
+ mozallowfullscreen="true" webkitallowfullscreen="true"/>
117
+ </Disabled>
118
+
119
+ <EmbedControls
120
+ showEditButton={iframeSrc && !cannotEmbed}
121
+ switchBackToURLInput={this.switchBackToURLInput}
122
+ />
123
+ </Fragment>
124
+
125
+ )
126
+ }
127
+ }
128
  };
129
+ export default GoogleMapsEdit;
Gutenberg/src/google-maps/index.js CHANGED
@@ -9,9 +9,10 @@
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
- import { googleMapsIcon } from '../common/icons';
13
- const { __ } = wp.i18n; // Import __() from wp.i18n
14
- const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
 
15
 
16
  /**
17
  * Register: aa Gutenberg Block.
@@ -26,16 +27,20 @@ const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.b
26
  * @return {?WPBlock} The block, if it has been successfully
27
  * registered; otherwise `undefined`.
28
  */
29
- registerBlockType( 'embedpress/google-maps-block', {
30
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
- title: __( 'Google Maps' ), // Block title.
32
  icon: googleMapsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
33
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
34
  keywords: [
35
- __( 'embedpress' ),
36
- __( 'google' ),
37
- __( 'maps' ),
38
  ],
 
 
 
 
39
  attributes: {
40
  url: {
41
  type: 'string',
@@ -64,12 +69,13 @@ registerBlockType( 'embedpress/google-maps-block', {
64
  *
65
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
66
  */
67
- save: function( props ) {
68
- const { iframeSrc } = props.attributes
 
69
  return (
70
- <div class="ose-google-maps">
71
  <iframe src={iframeSrc} frameborder="0" width="600" height="450" frameborder="0"></iframe>
72
- </div>
73
  );
74
  },
75
- } );
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
+ import {googleMapsIcon} from '../common/icons';
13
+
14
+ const {__} = wp.i18n; // Import __() from wp.i18n
15
+ const {registerBlockType} = wp.blocks; // Import registerBlockType() from wp.blocks
16
 
17
  /**
18
  * Register: aa Gutenberg Block.
27
  * @return {?WPBlock} The block, if it has been successfully
28
  * registered; otherwise `undefined`.
29
  */
30
+ registerBlockType('embedpress/google-maps-block', {
31
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
32
+ title: __('Google Maps'), // Block title.
33
  icon: googleMapsIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
34
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
35
  keywords: [
36
+ __('embedpress'),
37
+ __('google'),
38
+ __('maps'),
39
  ],
40
+ supports: {
41
+ align: true,
42
+ lightBlockWrapper: true,
43
+ },
44
  attributes: {
45
  url: {
46
  type: 'string',
69
  *
70
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
71
  */
72
+ save: function (props) {
73
+ const {iframeSrc} = props.attributes
74
+ const defaultClass = 'ose-google-maps'
75
  return (
76
+ <figure className={defaultClass}>
77
  <iframe src={iframeSrc} frameborder="0" width="600" height="450" frameborder="0"></iframe>
78
+ </figure>
79
  );
80
  },
81
+ });
Gutenberg/src/google-sheets/edit.js CHANGED
@@ -11,7 +11,8 @@ import Iframe from '../common/Iframe';
11
  */
12
  const { __ } = wp.i18n;
13
  const { Component, Fragment } = wp.element;
14
-
 
15
  class GoogleSheetsEdit extends Component {
16
  constructor() {
17
  super( ...arguments );
@@ -51,7 +52,7 @@ class GoogleSheetsEdit extends Component {
51
  setAttributes( { url } );
52
  if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
53
  var iframeSrc = this.decodeHTMLEntities(url);
54
- var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
55
  var match = regEx.exec(iframeSrc);
56
  var type = match[1];
57
  if(type && type == 'spreadsheets') {
@@ -84,9 +85,9 @@ class GoogleSheetsEdit extends Component {
84
  iframeSrc += '?widget=true&headers=false';
85
  }
86
  this.setState( { editingURL: false, cannotEmbed: false } );
87
- setAttributes( {iframeSrc: iframeSrc })
88
  }
89
- else {
90
  this.setState({
91
  cannotEmbed: true,
92
  editingURL: true
@@ -104,7 +105,7 @@ class GoogleSheetsEdit extends Component {
104
  switchBackToURLInput() {
105
  this.setState( { editingURL: true } );
106
  }
107
-
108
  render() {
109
  const { url, editingURL, fetching, cannotEmbed } = this.state;
110
  const { iframeSrc } = this.props.attributes;
@@ -120,19 +121,24 @@ class GoogleSheetsEdit extends Component {
120
  value={ url }
121
  cannotEmbed={ cannotEmbed }
122
  onChange={ ( event ) => this.setState( { url: event.target.value } ) }
 
 
 
123
  />
124
  );
125
  }
126
  else {
127
-
128
  return (
129
  <Fragment>
130
  {fetching ? <EmbedLoading /> : null}
131
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
 
 
132
  <EmbedControls
133
  showEditButton={ iframeSrc && ! cannotEmbed }
134
  switchBackToURLInput={ this.switchBackToURLInput }
135
- />
136
  </Fragment>
137
 
138
  )
11
  */
12
  const { __ } = wp.i18n;
13
  const { Component, Fragment } = wp.element;
14
+ const {Disabled} = wp.components;
15
+ import {googleMapsIcon, googleSheetsIcon} from '../common/icons'
16
  class GoogleSheetsEdit extends Component {
17
  constructor() {
18
  super( ...arguments );
52
  setAttributes( { url } );
53
  if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
54
  var iframeSrc = this.decodeHTMLEntities(url);
55
+ var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
56
  var match = regEx.exec(iframeSrc);
57
  var type = match[1];
58
  if(type && type == 'spreadsheets') {
85
  iframeSrc += '?widget=true&headers=false';
86
  }
87
  this.setState( { editingURL: false, cannotEmbed: false } );
88
+ setAttributes( {iframeSrc: iframeSrc })
89
  }
90
+ else {
91
  this.setState({
92
  cannotEmbed: true,
93
  editingURL: true
105
  switchBackToURLInput() {
106
  this.setState( { editingURL: true } );
107
  }
108
+
109
  render() {
110
  const { url, editingURL, fetching, cannotEmbed } = this.state;
111
  const { iframeSrc } = this.props.attributes;
121
  value={ url }
122
  cannotEmbed={ cannotEmbed }
123
  onChange={ ( event ) => this.setState( { url: event.target.value } ) }
124
+ icon={googleSheetsIcon}
125
+ DocTitle={__('Learn more about Google sheet')}
126
+ docLink={'https://embedpress.com/docs/embed-google-sheets-wordpress/'}
127
  />
128
  );
129
  }
130
  else {
131
+
132
  return (
133
  <Fragment>
134
  {fetching ? <EmbedLoading /> : null}
135
+ <Disabled>
136
+ <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
137
+ </Disabled>
138
  <EmbedControls
139
  showEditButton={ iframeSrc && ! cannotEmbed }
140
  switchBackToURLInput={ this.switchBackToURLInput }
141
+ />
142
  </Fragment>
143
 
144
  )
Gutenberg/src/google-sheets/index.js CHANGED
@@ -36,6 +36,10 @@ registerBlockType( 'embedpress/google-sheets-block', {
36
  __( 'google' ),
37
  __( 'sheets' ),
38
  ],
 
 
 
 
39
  attributes: {
40
  url: {
41
  type: 'string',
@@ -66,10 +70,36 @@ registerBlockType( 'embedpress/google-sheets-block', {
66
  */
67
  save: function( props ) {
68
  const { iframeSrc } = props.attributes
 
69
  return (
70
- <div class="ose-google-docs-spreadsheets">
71
  <iframe src={iframeSrc} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
72
- </div>
73
  );
74
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  } );
36
  __( 'google' ),
37
  __( 'sheets' ),
38
  ],
39
+ supports: {
40
+ align: true,
41
+ lightBlockWrapper: true,
42
+ },
43
  attributes: {
44
  url: {
45
  type: 'string',
70
  */
71
  save: function( props ) {
72
  const { iframeSrc } = props.attributes
73
+ const defaultClass = 'ose-google-docs-spreadsheets'
74
  return (
75
+ <figure className={defaultClass}>
76
  <iframe src={iframeSrc} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
77
+ </figure>
78
  );
79
  },
80
+ deprecated: [
81
+ {
82
+ attributes: {
83
+ align: {
84
+ type: "string",
85
+ enum: ["left", "center", "right", "wide", "full"]
86
+ },
87
+ },
88
+
89
+ save: function (props) {
90
+ const {iframeSrc} = props.attributes
91
+ if (iframeSrc) {
92
+ return (
93
+ <div className="ose-google-docs-spreadsheets">
94
+
95
+ <iframe src={iframeSrc} frameBorder="0" width="600" height="450" allowFullScreen="true"
96
+ mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
97
+
98
+ </div>
99
+
100
+ );
101
+ }
102
+ },
103
+ }
104
+ ]
105
  } );
Gutenberg/src/google-slides/edit.js CHANGED
@@ -11,7 +11,8 @@ import Iframe from '../common/Iframe';
11
  */
12
  const { __ } = wp.i18n;
13
  const { Component, Fragment } = wp.element;
14
-
 
15
  class GoogleSlidesEdit extends Component {
16
  constructor() {
17
  super( ...arguments );
@@ -51,7 +52,7 @@ class GoogleSlidesEdit extends Component {
51
  setAttributes( { url } );
52
  if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
53
  var iframeSrc = this.decodeHTMLEntities(url);
54
- var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
55
  var match = regEx.exec(iframeSrc);
56
  var type = match[1];
57
  if(type && type == 'presentation') {
@@ -59,7 +60,7 @@ class GoogleSlidesEdit extends Component {
59
  iframeSrc = iframeSrc.replace('/pub?', '/embed?');
60
  }
61
  this.setState( { editingURL: false, cannotEmbed: false } );
62
- setAttributes( {iframeSrc: iframeSrc })
63
  }
64
  else {
65
  this.setState({
@@ -79,7 +80,7 @@ class GoogleSlidesEdit extends Component {
79
  switchBackToURLInput() {
80
  this.setState( { editingURL: true } );
81
  }
82
-
83
  render() {
84
  const { url, editingURL, fetching, cannotEmbed } = this.state;
85
  const { iframeSrc } = this.props.attributes;
@@ -95,19 +96,25 @@ class GoogleSlidesEdit extends Component {
95
  value={ url }
96
  cannotEmbed={ cannotEmbed }
97
  onChange={ ( event ) => this.setState( { url: event.target.value } ) }
 
 
 
98
  />
99
  );
100
  }
101
  else {
102
-
103
  return (
104
  <Fragment>
105
  {fetching ? <EmbedLoading /> : null}
106
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
 
 
 
107
  <EmbedControls
108
  showEditButton={ iframeSrc && ! cannotEmbed }
109
  switchBackToURLInput={ this.switchBackToURLInput }
110
- />
111
  </Fragment>
112
 
113
  )
11
  */
12
  const { __ } = wp.i18n;
13
  const { Component, Fragment } = wp.element;
14
+ const {Disabled} = wp.components;
15
+ import { googleSlidesIcon} from '../common/icons'
16
  class GoogleSlidesEdit extends Component {
17
  constructor() {
18
  super( ...arguments );
52
  setAttributes( { url } );
53
  if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
54
  var iframeSrc = this.decodeHTMLEntities(url);
55
+ var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
56
  var match = regEx.exec(iframeSrc);
57
  var type = match[1];
58
  if(type && type == 'presentation') {
60
  iframeSrc = iframeSrc.replace('/pub?', '/embed?');
61
  }
62
  this.setState( { editingURL: false, cannotEmbed: false } );
63
+ setAttributes( {iframeSrc: iframeSrc })
64
  }
65
  else {
66
  this.setState({
80
  switchBackToURLInput() {
81
  this.setState( { editingURL: true } );
82
  }
83
+
84
  render() {
85
  const { url, editingURL, fetching, cannotEmbed } = this.state;
86
  const { iframeSrc } = this.props.attributes;
96
  value={ url }
97
  cannotEmbed={ cannotEmbed }
98
  onChange={ ( event ) => this.setState( { url: event.target.value } ) }
99
+ icon={googleSlidesIcon}
100
+ DocTitle={__('Learn more about Google slides')}
101
+ docLink={'https://embedpress.com/docs/embed-google-slides-wordpress/'}
102
  />
103
  );
104
  }
105
  else {
106
+
107
  return (
108
  <Fragment>
109
  {fetching ? <EmbedLoading /> : null}
110
+ <Disabled>
111
+ <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
112
+ </Disabled>
113
+
114
  <EmbedControls
115
  showEditButton={ iframeSrc && ! cannotEmbed }
116
  switchBackToURLInput={ this.switchBackToURLInput }
117
+ />
118
  </Fragment>
119
 
120
  )
Gutenberg/src/google-slides/index.js CHANGED
@@ -36,6 +36,10 @@ registerBlockType( 'embedpress/google-slides-block', {
36
  __( 'google' ),
37
  __( 'slides' ),
38
  ],
 
 
 
 
39
  attributes: {
40
  url: {
41
  type: 'string',
@@ -66,10 +70,11 @@ registerBlockType( 'embedpress/google-slides-block', {
66
  */
67
  save: function( props ) {
68
  const { iframeSrc } = props.attributes
 
69
  return (
70
- <div class="ose-google-docs-presentation">
71
  <iframe src={iframeSrc} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
72
- </div>
73
  );
74
  },
75
  } );
36
  __( 'google' ),
37
  __( 'slides' ),
38
  ],
39
+ supports: {
40
+ align: true,
41
+ lightBlockWrapper: true,
42
+ },
43
  attributes: {
44
  url: {
45
  type: 'string',
70
  */
71
  save: function( props ) {
72
  const { iframeSrc } = props.attributes
73
+ const defaultClass = "ose-google-docs-presentation"
74
  return (
75
+ <figure className={defaultClass}>
76
  <iframe src={iframeSrc} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
77
+ </figure>
78
  );
79
  },
80
  } );
Gutenberg/src/twitch/edit.js CHANGED
@@ -9,150 +9,156 @@ import Iframe from '../common/Iframe';
9
  /**
10
  * WordPress dependencies
11
  */
12
- const { __ } = wp.i18n;
13
- const { Component, Fragment } = wp.element;
 
 
14
 
15
  class TwitchEdit extends Component {
16
- constructor() {
17
- super( ...arguments );
18
- this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
19
- this.setUrl = this.setUrl.bind( this );
20
- this.onLoad = this.onLoad.bind( this );
21
- this.state = {
22
- editingURL: false,
23
- url: this.props.attributes.url,
24
- fetching: true,
25
- cannotEmbed: false
26
- };
27
- }
28
-
29
- onLoad() {
30
- this.setState({
31
- fetching: false
32
- })
33
- }
34
- decodeHTMLEntities (str) {
35
- if(str && typeof str === 'string') {
36
- // strip script/html tags
37
- str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
38
- str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
39
-
40
- }
41
- return str;
42
- }
43
-
44
-
45
- setUrl( event ) {
46
- if ( event ) {
47
- event.preventDefault();
48
- }
49
- const { url } = this.state;
50
- const { setAttributes } = this.props;
51
- setAttributes( { url } );
52
- var regEx= /http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/
53
- if(url && url.match( regEx )){
54
- var iframeSrc = this.decodeHTMLEntities(url);
55
- var match = regEx.exec(iframeSrc);
56
- var channelName = match[1];
57
- console.log(channelName);
58
- var type = "channel";
59
- var attrs;
60
- if(url.indexOf('clips.twitch.tv') > -1 ) {
61
- type = 'clip';
62
- }
63
- else if(url.indexOf('/videos/') > -1) {
64
- type= 'video';
65
- }
66
- else if(url.indexOf('#/chat$#') > -1) {
67
- type= 'chat';
68
- }
69
- console.log(type)
70
- switch(type) {
71
- case 'channel':
72
- iframeSrc= 'https://player.twitch.tv/?channel=' + channelName;
73
- attrs = {
74
- scrolling: "no",
75
- frameborder: "0",
76
- allowfullscreen: "true"
77
- };
78
- break;
79
-
80
- case 'clip':
81
- iframeSrc = 'https://clips.twitch.tv/embed?clip=' + channelName + '&autoplay=false';
82
- attrs = {
83
- scrolling: "no",
84
- frameborder: "0",
85
- allowfullscreen: "true"
86
- };
87
- break;
88
-
89
- case 'video':
90
- channelName = match[2];
91
- iframeSrc = 'https://player.twitch.tv/?video=' + channelName;
92
- attrs = {
93
- scrolling: "no",
94
- frameborder: "0",
95
- allowfullscreen: "true"
96
- };
97
- break;
98
-
99
- case 'chat':
100
- iframeSrc = 'http://www.twitch.tv/embed/' + channelName + '/chat';
101
- attrs = {
102
- scrolling: "yes",
103
- frameborder: "0",
104
- allowfullscreen: "true",
105
- id: "'" + channelName + "'"
106
-
107
- }
108
- break;
109
- }
110
- console.log(iframeSrc);
111
- this.setState( { editingURL: false, cannotEmbed: false } );
112
- setAttributes( {iframeSrc, attrs })
113
- }
114
- else {
115
- this.setState({
116
- cannotEmbed: true,
117
- editingURL: true
118
- })
119
- }
120
- }
121
-
122
- switchBackToURLInput() {
123
- this.setState( { editingURL: true } );
124
- }
125
-
126
- render() {
127
- const { url, editingURL, fetching, cannotEmbed } = this.state;
128
- const { iframeSrc, attrs } = this.props.attributes;
129
-
130
- const label = __( 'Twitch URL');
131
- // No preview, or we can't embed the current URL, or we've clicked the edit button.
132
- if ( !iframeSrc || editingURL ) {
133
- return (
134
- <EmbedPlaceholder
135
- label={ label }
136
- onSubmit={ this.setUrl }
137
- value={ url }
138
- cannotEmbed={ cannotEmbed }
139
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
140
- />
141
- );
142
- }
143
- else {
144
- return (
145
- <Fragment>
146
- {fetching ? <EmbedLoading /> : null}
147
- <Iframe src={iframeSrc} { ...attrs } onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} width="600" height="450" />
148
- <EmbedControls
149
- showEditButton={ iframeSrc && ! cannotEmbed }
150
- switchBackToURLInput={ this.switchBackToURLInput }
151
- />
152
- </Fragment>
153
-
154
- )
155
- }
156
- }
 
 
 
 
157
  };
158
  export default TwitchEdit;
9
  /**
10
  * WordPress dependencies
11
  */
12
+ const {__} = wp.i18n;
13
+ const {Component, Fragment} = wp.element;
14
+ const {Disabled} = wp.components;
15
+ import {twitchIcon} from '../common/icons'
16
 
17
  class TwitchEdit extends Component {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
21
+ this.setUrl = this.setUrl.bind(this);
22
+ this.onLoad = this.onLoad.bind(this);
23
+ this.state = {
24
+ editingURL: false,
25
+ url: this.props.attributes.url,
26
+ fetching: true,
27
+ cannotEmbed: false
28
+ };
29
+ }
30
+
31
+ onLoad() {
32
+ this.setState({
33
+ fetching: false
34
+ })
35
+ }
36
+
37
+ decodeHTMLEntities(str) {
38
+ if (str && typeof str === 'string') {
39
+ // strip script/html tags
40
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
41
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
42
+
43
+ }
44
+ return str;
45
+ }
46
+
47
+
48
+ setUrl(event) {
49
+ if (event) {
50
+ event.preventDefault();
51
+ }
52
+ const {url} = this.state;
53
+ const {setAttributes} = this.props;
54
+ setAttributes({url});
55
+ var regEx = /http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/
56
+ if (url && url.match(regEx)) {
57
+ var iframeSrc = this.decodeHTMLEntities(url);
58
+ var match = regEx.exec(iframeSrc);
59
+ var channelName = match[1];
60
+ console.log(channelName);
61
+ var type = "channel";
62
+ var attrs;
63
+ if (url.indexOf('clips.twitch.tv') > -1) {
64
+ type = 'clip';
65
+ } else if (url.indexOf('/videos/') > -1) {
66
+ type = 'video';
67
+ } else if (url.indexOf('#/chat$#') > -1) {
68
+ type = 'chat';
69
+ }
70
+ console.log(type)
71
+ switch (type) {
72
+ case 'channel':
73
+ iframeSrc = 'https://player.twitch.tv/?channel=' + channelName;
74
+ attrs = {
75
+ scrolling: "no",
76
+ frameborder: "0",
77
+ allowfullscreen: "true"
78
+ };
79
+ break;
80
+
81
+ case 'clip':
82
+ iframeSrc = 'https://clips.twitch.tv/embed?clip=' + channelName + '&autoplay=false';
83
+ attrs = {
84
+ scrolling: "no",
85
+ frameborder: "0",
86
+ allowfullscreen: "true"
87
+ };
88
+ break;
89
+
90
+ case 'video':
91
+ channelName = match[2];
92
+ iframeSrc = 'https://player.twitch.tv/?video=' + channelName;
93
+ attrs = {
94
+ scrolling: "no",
95
+ frameborder: "0",
96
+ allowfullscreen: "true"
97
+ };
98
+ break;
99
+
100
+ case 'chat':
101
+ iframeSrc = 'http://www.twitch.tv/embed/' + channelName + '/chat';
102
+ attrs = {
103
+ scrolling: "yes",
104
+ frameborder: "0",
105
+ allowfullscreen: "true",
106
+ id: "'" + channelName + "'"
107
+
108
+ }
109
+ break;
110
+ }
111
+ console.log(iframeSrc);
112
+ this.setState({editingURL: false, cannotEmbed: false});
113
+ setAttributes({iframeSrc, attrs})
114
+ } else {
115
+ this.setState({
116
+ cannotEmbed: true,
117
+ editingURL: true
118
+ })
119
+ }
120
+ }
121
+
122
+ switchBackToURLInput() {
123
+ this.setState({editingURL: true});
124
+ }
125
+
126
+ render() {
127
+ const {url, editingURL, fetching, cannotEmbed} = this.state;
128
+ const {iframeSrc, attrs} = this.props.attributes;
129
+
130
+ const label = __('Twitch URL');
131
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
132
+ if (!iframeSrc || editingURL) {
133
+ return (
134
+ <EmbedPlaceholder
135
+ label={label}
136
+ onSubmit={this.setUrl}
137
+ value={url}
138
+ cannotEmbed={cannotEmbed}
139
+ onChange={(event) => this.setState({url: event.target.value})}
140
+ icon={twitchIcon}
141
+ DocTitle={__('Learn more about twitch')}
142
+ docLink={'https://embedpress.com/docs/embed-twitch-streams-chat/'}
143
+ />
144
+ );
145
+ } else {
146
+ return (
147
+ <Fragment>
148
+ {fetching ? <EmbedLoading/> : null}
149
+ <Disabled>
150
+ <Iframe src={iframeSrc} {...attrs} onLoad={this.onLoad}
151
+ style={{display: fetching ? 'none' : ''}} width="600" height="450"/>
152
+ </Disabled>
153
+
154
+ <EmbedControls
155
+ showEditButton={iframeSrc && !cannotEmbed}
156
+ switchBackToURLInput={this.switchBackToURLInput}
157
+ />
158
+ </Fragment>
159
+
160
+ )
161
+ }
162
+ }
163
  };
164
  export default TwitchEdit;
Gutenberg/src/twitch/index.js CHANGED
@@ -9,9 +9,10 @@
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
- import { twitchIcon } from '../common/icons';
13
- const { __ } = wp.i18n; // Import __() from wp.i18n
14
- const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
 
15
 
16
  /**
17
  * Register: aa Gutenberg Block.
@@ -26,15 +27,19 @@ const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.b
26
  * @return {?WPBlock} The block, if it has been successfully
27
  * registered; otherwise `undefined`.
28
  */
29
- registerBlockType( 'embedpress/twitch-block', {
30
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
- title: __( 'Twitch' ), // Block title.
32
  icon: twitchIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
33
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
34
  keywords: [
35
- __( 'embedpress' ),
36
- __( 'twitch' ),
37
  ],
 
 
 
 
38
  attributes: {
39
  url: {
40
  type: 'string',
@@ -67,12 +72,13 @@ registerBlockType( 'embedpress/twitch-block', {
67
  *
68
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
69
  */
70
- save: function( props ) {
71
- const { iframeSrc, attrs } = props.attributes
 
72
  return (
73
- <div class="ose-twitch-presentation">
74
- <iframe src={iframeSrc} { ...attrs } frameborder="0" width="600" height="450"></iframe>
75
- </div>
76
  );
77
  },
78
- } );
9
  import './style.scss';
10
  import './editor.scss';
11
  import edit from './edit';
12
+ import {twitchIcon} from '../common/icons';
13
+
14
+ const {__} = wp.i18n; // Import __() from wp.i18n
15
+ const {registerBlockType} = wp.blocks; // Import registerBlockType() from wp.blocks
16
 
17
  /**
18
  * Register: aa Gutenberg Block.
27
  * @return {?WPBlock} The block, if it has been successfully
28
  * registered; otherwise `undefined`.
29
  */
30
+ registerBlockType('embedpress/twitch-block', {
31
  // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
32
+ title: __('Twitch'), // Block title.
33
  icon: twitchIcon, // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
34
  category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
35
  keywords: [
36
+ __('embedpress'),
37
+ __('twitch'),
38
  ],
39
+ supports: {
40
+ align: true,
41
+ lightBlockWrapper: true,
42
+ },
43
  attributes: {
44
  url: {
45
  type: 'string',
72
  *
73
  * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
74
  */
75
+ save: function (props) {
76
+ const {iframeSrc, attrs} = props.attributes
77
+ const defaultClass = "ose-twitch-presentation"
78
  return (
79
+ <figure className={defaultClass}>
80
+ <iframe src={iframeSrc} {...attrs} frameborder="0" width="600" height="450"></iframe>
81
+ </figure>
82
  );
83
  },
84
+ });
Gutenberg/src/wistia/edit.js CHANGED
@@ -9,135 +9,143 @@ import Iframe from '../common/Iframe';
9
  /**
10
  * WordPress dependencies
11
  */
12
- const { __ } = wp.i18n;
13
- const { Component, Fragment } = wp.element;
14
-
 
15
  class WistiaEdit extends Component {
16
- constructor() {
17
- super( ...arguments );
18
- this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
19
- this.setUrl = this.setUrl.bind( this );
20
- this.onLoad = this.onLoad.bind( this );
21
- this.state = {
22
- editingURL: false,
23
- url: this.props.attributes.url,
24
- fetching: true,
25
- cannotEmbed: false,
26
- mediaId: null
27
- };
28
- this.setUrl();
29
- }
30
-
31
-
32
- componentDidMount () {
33
- if(this.props.attributes.url) {
34
- let mediaIdMatches = this.props.attributes.url.match(/medias\/(.*)/);
35
- let mediaId = mediaIdMatches[1];
36
- this.setState({
37
- ...this.state,
38
- mediaId
39
- });
40
- }
41
- }
42
-
43
- onLoad() {
44
- this.setState({
45
- fetching: false
46
- });
47
- console.log(embedpressObj);
48
- if(embedpressObj['wisita_options']) {
49
- let $state = { ...this.state }
50
- setTimeout(function() {
51
- let script = document.createElement("script");
52
- script.src = "https://fast.wistia.com/assets/external/E-v1.js";
53
- script.charset="ISO-8859-1"
54
- document.body.appendChild(script);
55
- }, 100);
56
-
57
- setTimeout(function() {
58
- let script = document.createElement("script");
59
- script.type = 'text/javascript';
60
- script.innerHTML = 'window.pp_embed_wistia_labels = ' + embedpressObj['wistia_labels'];
61
- document.body.appendChild(script);
62
-
63
- script = document.createElement("script");
64
- script.type = 'text/javascript';
65
- script.innerHTML = 'wistiaEmbed = Wistia.embed( \"'+ $state.mediaId + '\", ' + embedpressObj.wisita_options + ' );';
66
- document.body.appendChild(script);
67
- }, 400);
68
- }
69
-
70
- }
71
- decodeHTMLEntities (str) {
72
- if(str && typeof str === 'string') {
73
- // strip script/html tags
74
- str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
75
- str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
76
-
77
- }
78
- return str;
79
- }
80
-
81
-
82
- setUrl( event ) {
83
- if ( event ) {
84
- event.preventDefault();
85
- }
86
- const { url } = this.state;
87
- const { setAttributes } = this.props;
88
- setAttributes( { url } );
89
- if(url && ( url.match( /^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i ) || url.match( /^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp) ) ) {
90
- let mediaIdMatches = url.match(/medias\/(.*)/);
91
- let mediaId = mediaIdMatches[1];
92
- let iframeSrc = '//fast.wistia.net/embed/iframe/' + mediaId;
93
-
94
- this.setState( { editingURL: false, cannotEmbed: false, mediaId } );
95
- setAttributes( {iframeSrc });
96
- }
97
- else {
98
- this.setState({
99
- cannotEmbed: true,
100
- editingURL: true
101
- })
102
- }
103
- }
104
-
105
- switchBackToURLInput() {
106
- this.setState( { editingURL: true } );
107
- }
108
-
109
- render() {
110
- const { url, editingURL, fetching, cannotEmbed } = this.state;
111
- const { iframeSrc } = this.props.attributes;
112
-
113
- const label = __( 'Wistia URL');
114
-
115
- // No preview, or we can't embed the current URL, or we've clicked the edit button.
116
- if ( !iframeSrc || editingURL ) {
117
- return (
118
- <EmbedPlaceholder
119
- label={ label }
120
- onSubmit={ this.setUrl }
121
- value={ url }
122
- cannotEmbed={ cannotEmbed }
123
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
124
- />
125
- );
126
- }
127
- else {
128
- return (
129
- <Fragment>
130
- {fetching ? <EmbedLoading /> : null}
131
- <div className="ose-wistia" id={"wistia_" + this.state.mediaId }>
132
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="330" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
133
- </div>
134
- <EmbedControls
135
- showEditButton={ iframeSrc && ! cannotEmbed }
136
- switchBackToURLInput={ this.switchBackToURLInput }
137
- />
138
- </Fragment>
139
- );
140
- }
141
- }
 
 
 
 
 
 
 
142
  };
143
  export default WistiaEdit;
9
  /**
10
  * WordPress dependencies
11
  */
12
+ const {__} = wp.i18n;
13
+ const {Component, Fragment} = wp.element;
14
+ import {wistiaIcon} from '../common/icons'
15
+ const {Disabled} = wp.components;
16
  class WistiaEdit extends Component {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
20
+ this.setUrl = this.setUrl.bind(this);
21
+ this.onLoad = this.onLoad.bind(this);
22
+ this.state = {
23
+ editingURL: false,
24
+ url: this.props.attributes.url,
25
+ fetching: true,
26
+ cannotEmbed: false,
27
+ mediaId: null
28
+ };
29
+ this.setUrl();
30
+ }
31
+
32
+
33
+ componentDidMount() {
34
+ if (this.props.attributes.url) {
35
+ let mediaIdMatches = this.props.attributes.url.match(/medias\/(.*)/);
36
+ let mediaId = mediaIdMatches[1];
37
+ this.setState({
38
+ ...this.state,
39
+ mediaId
40
+ });
41
+ }
42
+ }
43
+
44
+ onLoad() {
45
+ this.setState({
46
+ fetching: false
47
+ });
48
+ console.log(embedpressObj);
49
+ if (embedpressObj['wisita_options']) {
50
+ let $state = {...this.state}
51
+ setTimeout(function () {
52
+ let script = document.createElement("script");
53
+ script.src = "https://fast.wistia.com/assets/external/E-v1.js";
54
+ script.charset = "ISO-8859-1"
55
+ document.body.appendChild(script);
56
+ }, 100);
57
+
58
+ setTimeout(function () {
59
+ let script = document.createElement("script");
60
+ script.type = 'text/javascript';
61
+ script.innerHTML = 'window.pp_embed_wistia_labels = ' + embedpressObj['wistia_labels'];
62
+ document.body.appendChild(script);
63
+
64
+ script = document.createElement("script");
65
+ script.type = 'text/javascript';
66
+ script.innerHTML = 'wistiaEmbed = Wistia.embed( \"' + $state.mediaId + '\", ' + embedpressObj.wisita_options + ' );';
67
+ document.body.appendChild(script);
68
+ }, 400);
69
+ }
70
+
71
+ }
72
+
73
+ decodeHTMLEntities(str) {
74
+ if (str && typeof str === 'string') {
75
+ // strip script/html tags
76
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
77
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
78
+
79
+ }
80
+ return str;
81
+ }
82
+
83
+
84
+ setUrl(event) {
85
+ if (event) {
86
+ event.preventDefault();
87
+ }
88
+ const {url} = this.state;
89
+ const {setAttributes} = this.props;
90
+ setAttributes({url});
91
+ if (url && (url.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i) || url.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))) {
92
+ let mediaIdMatches = url.match(/medias\/(.*)/);
93
+ let mediaId = mediaIdMatches[1];
94
+ let iframeSrc = '//fast.wistia.net/embed/iframe/' + mediaId;
95
+
96
+ this.setState({editingURL: false, cannotEmbed: false, mediaId});
97
+ setAttributes({iframeSrc});
98
+ } else {
99
+ this.setState({
100
+ cannotEmbed: true,
101
+ editingURL: true
102
+ })
103
+ }
104
+ }
105
+
106
+ switchBackToURLInput() {
107
+ this.setState({editingURL: true});
108
+ }
109
+
110
+ render() {
111
+ const {url, editingURL, fetching, cannotEmbed} = this.state;
112
+ const {iframeSrc} = this.props.attributes;
113
+
114
+ const label = __('Wistia URL');
115
+
116
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
117
+ if (!iframeSrc || editingURL) {
118
+ return (
119
+ <EmbedPlaceholder
120
+ label={label}
121
+ onSubmit={this.setUrl}
122
+ value={url}
123
+ cannotEmbed={cannotEmbed}
124
+ onChange={(event) => this.setState({url: event.target.value})}
125
+ icon={wistiaIcon}
126
+ DocTitle={__('Learn more about Wistia')}
127
+ docLink={'https://embedpress.com/docs/embed-wistia-videos-wordpress/'}
128
+ />
129
+ );
130
+ } else {
131
+ return (
132
+ <Fragment>
133
+ {fetching ? <EmbedLoading/> : null}
134
+ <Disabled>
135
+ <div className="ose-wistia" id={"wistia_" + this.state.mediaId}>
136
+ <Iframe src={iframeSrc} onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
137
+ frameborder="0" width="600" height="330" allowfullscreen="true"
138
+ mozallowfullscreen="true" webkitallowfullscreen="true"/>
139
+ </div>
140
+ </Disabled>
141
+
142
+ <EmbedControls
143
+ showEditButton={iframeSrc && !cannotEmbed}
144
+ switchBackToURLInput={this.switchBackToURLInput}
145
+ />
146
+ </Fragment>
147
+ );
148
+ }
149
+ }
150
  };
151
  export default WistiaEdit;
Gutenberg/src/wistia/index.js CHANGED
@@ -35,6 +35,10 @@ registerBlockType('embedpress/wistia-block', {
35
  __('embedpress'),
36
  __('wistia'),
37
  ],
 
 
 
 
38
  edit,
39
  save: function(props) {
40
  return null;
35
  __('embedpress'),
36
  __('wistia'),
37
  ],
38
+ supports: {
39
+ align: true,
40
+ lightBlockWrapper: true,
41
+ },
42
  edit,
43
  save: function(props) {
44
  return null;
Gutenberg/src/wistia/index.php CHANGED
@@ -7,23 +7,25 @@
7
  *
8
  * @return string Returns the post slider.
9
  */
10
- function embedpress_gutenberg_render_block_wistia($attributes)
11
  {
12
  ob_start();
13
- if (!empty($attributes) && !empty($attributes['url'])) :
14
- preg_match('~medias/(.*)~i', $attributes['url'], $matches);
15
  $id = false;
16
- if (isset($matches[1])) {
17
- $id = $matches[1];
18
  }
19
- if (!empty($id)) :
 
20
  ?>
21
- <div class="ose-wistia" id="wistia_<?php echo $id; ?>">
22
- <iframe src="<?php echo $attributes['iframeSrc']; ?>" allowtransparency="true" frameborder="0" class="wistia_embed" name="wistia_embed" width="600" height="330"></iframe>
 
23
  <?php
24
- do_action('embedpress_gutenberg_wistia_block_after_embed', $attributes); ?>
25
  </div>
26
- <?php
27
  endif;
28
  endif;
29
  return ob_get_clean();
@@ -34,19 +36,19 @@ function embedpress_gutenberg_render_block_wistia($attributes)
34
  */
35
  function embedpress_gutenberg_register_block_wistia()
36
  {
37
- if (function_exists('register_block_type')) :
38
- register_block_type('embedpress/wistia-block', array(
39
- 'attributes' => array(
40
- 'url' => array(
41
  'type' => 'string',
42
- ),
43
- 'iframeSrc' => array(
44
  'type' => 'string',
45
- ),
46
- ),
47
  'render_callback' => 'embedpress_gutenberg_render_block_wistia',
48
- ));
49
  endif;
50
  }
51
 
52
- add_action('init', 'embedpress_gutenberg_register_block_wistia');
7
  *
8
  * @return string Returns the post slider.
9
  */
10
+ function embedpress_gutenberg_render_block_wistia( $attributes )
11
  {
12
  ob_start();
13
+ if ( !empty( $attributes ) && !empty( $attributes[ 'url' ] ) ) :
14
+ preg_match( '~medias/(.*)~i', $attributes[ 'url' ], $matches );
15
  $id = false;
16
+ if ( isset( $matches[ 1 ] ) ) {
17
+ $id = $matches[ 1 ];
18
  }
19
+ $align = 'align' . ( isset( $attributes[ 'align' ] ) ? $attributes[ 'align' ] : 'center' );
20
+ if ( !empty( $id ) ) :
21
  ?>
22
+ <div class="ose-wistia wp-block-embed-youtube <?php echo $align; ?>" id="wistia_<?php echo $id; ?>">
23
+ <iframe src="<?php echo $attributes[ 'iframeSrc' ]; ?>" allowtransparency="true" frameborder="0"
24
+ class="wistia_embed" name="wistia_embed" width="600" height="330"></iframe>
25
  <?php
26
+ do_action( 'embedpress_gutenberg_wistia_block_after_embed', $attributes ); ?>
27
  </div>
28
+ <?php
29
  endif;
30
  endif;
31
  return ob_get_clean();
36
  */
37
  function embedpress_gutenberg_register_block_wistia()
38
  {
39
+ if ( function_exists( 'register_block_type' ) ) :
40
+ register_block_type( 'embedpress/wistia-block', [
41
+ 'attributes' => [
42
+ 'url' => [
43
  'type' => 'string',
44
+ ],
45
+ 'iframeSrc' => [
46
  'type' => 'string',
47
+ ],
48
+ ],
49
  'render_callback' => 'embedpress_gutenberg_render_block_wistia',
50
+ ] );
51
  endif;
52
  }
53
 
54
+ add_action( 'init', 'embedpress_gutenberg_register_block_wistia' );
Gutenberg/src/youtube/edit.js ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import EmbedControls from "../common/embed-controls";
5
+ import EmbedLoading from "../common/embed-loading";
6
+ import EmbedPlaceholder from "../common/embed-placeholder";
7
+ import Iframe from "../common/Iframe";
8
+ import {youtubeIcon} from "../common/icons";
9
+
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+ const {__} = wp.i18n;
14
+ const {Component, Fragment} = wp.element;
15
+ const {Disabled} = wp.components;
16
+
17
+ class YoutubeEdit extends Component {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
21
+ this.setUrl = this.setUrl.bind(this);
22
+ this.onLoad = this.onLoad.bind(this);
23
+ this.state = {
24
+ editingURL: false,
25
+ url: this.props.attributes.url,
26
+ fetching: true,
27
+ cannotEmbed: false
28
+ };
29
+ }
30
+
31
+ componentWillMount() {
32
+ if (this.state.url) {
33
+ this.setUrl();
34
+ }
35
+ }
36
+
37
+ onLoad() {
38
+ this.setState({
39
+ fetching: false
40
+ });
41
+ }
42
+
43
+ decodeHTMLEntities(str) {
44
+ if (str && typeof str === "string") {
45
+ // strip script/html tags
46
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim, "");
47
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim, "");
48
+ }
49
+ return str;
50
+ }
51
+
52
+ setUrl(event) {
53
+ if (event) {
54
+ event.preventDefault();
55
+ }
56
+ const {url} = this.state;
57
+ const {setAttributes} = this.props;
58
+ setAttributes({url});
59
+ const matches = url.match(
60
+ /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
61
+ );
62
+ if (url && matches) {
63
+ let mediaId = matches[1];
64
+ let iframeSrc = "https://www.youtube.com/embed/" + mediaId;
65
+ let iframeUrl = new URL(iframeSrc);
66
+
67
+ // // If your expected result is "http://foo.bar/?x=42&y=2"
68
+ if (typeof embedpressProObj !== 'undefined') {
69
+ for (var key in embedpressProObj.youtubeParams) {
70
+ iframeUrl.searchParams.set(
71
+ key,
72
+ embedpressProObj.youtubeParams[key]
73
+ );
74
+ }
75
+ }
76
+
77
+ this.setState({editingURL: false, cannotEmbed: false});
78
+ setAttributes({iframeSrc: iframeUrl.href, mediaId});
79
+ } else {
80
+ this.setState({
81
+ cannotEmbed: true,
82
+ editingURL: true
83
+ });
84
+ }
85
+ }
86
+
87
+ switchBackToURLInput() {
88
+ this.setState({editingURL: true});
89
+ }
90
+
91
+ render() {
92
+ const {url, editingURL, fetching, cannotEmbed} = this.state;
93
+ const {iframeSrc, attrs} = this.props.attributes;
94
+ console.log(iframeSrc);
95
+ const label = __("Youtube URL");
96
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
97
+ if (!iframeSrc || editingURL) {
98
+ return (
99
+ <EmbedPlaceholder
100
+ label={label}
101
+ onSubmit={this.setUrl}
102
+ value={url}
103
+ cannotEmbed={cannotEmbed}
104
+ onChange={event => this.setState({url: event.target.value})}
105
+ icon={youtubeIcon}
106
+ DocTitle={__('Learn more about Youtube')}
107
+ docLink={'https://embedpress.com/docs/embed-youtube-wordpress/'}
108
+
109
+ />
110
+ );
111
+ } else {
112
+ return (
113
+ <Fragment>
114
+ {fetching ? <EmbedLoading/> : null}
115
+ <Disabled>
116
+ <Iframe
117
+ src={iframeSrc}
118
+ {...attrs}
119
+ onLoad={this.onLoad}
120
+ style={{display: fetching ? "none" : ""}}
121
+ width="640"
122
+ height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"
123
+ />
124
+ </Disabled>
125
+
126
+ <EmbedControls
127
+ showEditButton={iframeSrc && !cannotEmbed}
128
+ switchBackToURLInput={this.switchBackToURLInput}
129
+ />
130
+ </Fragment>
131
+ );
132
+ }
133
+ }
134
+ }
135
+
136
+ export default YoutubeEdit;
Gutenberg/src/youtube/editor.scss ADDED
File without changes
Gutenberg/src/youtube/index.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * BLOCK: embedpress-blocks
3
+ *
4
+ * Registering a basic block with Gutenberg.
5
+ * Simple block, renders and saves the same content without any interactivity.
6
+ */
7
+
8
+ // Import CSS.
9
+ import './style.scss';
10
+ import './editor.scss';
11
+ import edit from './edit';
12
+ import { youtubeIcon } from '../common/icons';
13
+ const { __ } = wp.i18n; // Import __() from wp.i18n
14
+ const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
15
+
16
+ /**
17
+ * Register: aa Gutenberg Block.
18
+ *
19
+ * Registers a new block provided a unique name and an object defining its
20
+ * behavior. Once registered, the block is made editor as an option to any
21
+ * editor interface where blocks are implemented.
22
+ *
23
+ * @link https://wordpress.org/gutenberg/handbook/block-api/
24
+ * @param {string} name Block name.
25
+ * @param {Object} settings Block settings.
26
+ * @return {?WPBlock} The block, if it has been successfully
27
+ * registered; otherwise `undefined`.
28
+ */
29
+ registerBlockType( 'embedpress/youtube-block', {
30
+ // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
31
+ title: __( 'Youtube' ), // Block title.
32
+ icon: youtubeIcon,
33
+ category: 'embedpress', // Block category — Group blocks together based on common traits E.g. common, formatting, layout Widgets, embed.
34
+ keywords: [
35
+ __( 'embedpress' ),
36
+ __( 'youtube' ),
37
+ ],
38
+ supports: {
39
+ align: true,
40
+ lightBlockWrapper: true,
41
+ },
42
+ /**
43
+ * The edit function describes the structure of your block in the context of the editor.
44
+ * This represents what the editor will render when the block is used.
45
+ *
46
+ * The "edit" property must be a valid function.
47
+ *
48
+ * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
49
+ */
50
+ edit,
51
+
52
+ /**
53
+ * The save function defines the way in which the different attributes should be combined
54
+ * into the final markup, which is then serialized by Gutenberg into post_content.
55
+ *
56
+ * The "save" property must be specified and must be a valid function.
57
+ *
58
+ * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
59
+ */
60
+ save: () => {
61
+ return null
62
+ }
63
+ } );
Gutenberg/src/youtube/index.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Renders the `embedpress/youtube` block on server.
6
+ *
7
+ * @param array $attributes The block attributes.
8
+ *
9
+ * @return false|string
10
+ */
11
+ function embedpress_gutenberg_render_block_youtube( $attributes )
12
+ {
13
+ ob_start();
14
+ $align = 'align' . ( isset( $attributes[ 'align' ] ) ? $attributes[ 'align' ] : 'center' );
15
+ $youtube_params = apply_filters( 'embedpress_gutenberg_youtube_params', [] );
16
+ $iframeUrl = $attributes[ 'iframeSrc' ];
17
+ foreach ( $youtube_params as $param => $value ) {
18
+ $iframeUrl = add_query_arg( $param, $value, $iframeUrl );
19
+ }
20
+
21
+ ?>
22
+ <div class="ose-youtube wp-block-embed-youtube <?php echo $align; ?>">
23
+ <iframe src="<?php echo $iframeUrl; ?>"
24
+ allowtransparency="true"
25
+ allowfullscreen="true"
26
+ frameborder="0"
27
+ width="640" height="360">
28
+ </iframe>
29
+ </div>
30
+ <?php
31
+ return ob_get_clean();
32
+ }
33
+
34
+ /**
35
+ * Registers the `embedpress/youtube-block` block on server.
36
+ */
37
+ function embedpress_gutenberg_register_block_youtube()
38
+ {
39
+ if ( function_exists( 'register_block_type' ) ) :
40
+ register_block_type( 'embedpress/youtube-block', [
41
+ 'style' => 'embedpress_youtube-cgb-style-css',
42
+ // Enqueue blocks.build.js in the editor only.
43
+ 'editor_script' => 'embedpress_youtube-cgb-block-js',
44
+ // Enqueue blocks.editor.build.css in the editor only.
45
+ 'editor_style' => 'embedpress_youtube-cgb-block-editor-css',
46
+
47
+ 'attributes' => [
48
+ 'url' => [
49
+ 'type' => 'string',
50
+ 'default' => ''
51
+ ],
52
+ 'iframeSrc' => [
53
+ 'type' => 'string',
54
+ 'default' => ''
55
+ ],
56
+ 'mediaId' => [
57
+ 'type' => 'string',
58
+ 'default' => ''
59
+ ]
60
+ ],
61
+ 'render_callback' => 'embedpress_gutenberg_render_block_youtube',
62
+ ] );
63
+ endif;
64
+ }
65
+
66
+ add_action( 'init', 'embedpress_gutenberg_register_block_youtube' );
Gutenberg/src/youtube/style.scss ADDED
File without changes
assets/css/admin.css CHANGED
@@ -65,6 +65,11 @@
65
  margin-top: 15px;
66
  }
67
 
 
 
 
 
 
68
  #embedpress-settings-wrapper > header .pressshack-title {
69
  display: inline-block;
70
  padding: 10px 0 10px 55px;
@@ -264,10 +269,113 @@
264
  color: #655997;
265
  }
266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  .modal-dialog .row {
268
  width: 100%;
269
  }
270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
 
272
  /**
273
  * Fremius tweaks
65
  margin-top: 15px;
66
  }
67
 
68
+ #embedpress-settings-wrapper > header {
69
+ display: flex;
70
+ justify-content: space-between;
71
+ }
72
+
73
  #embedpress-settings-wrapper > header .pressshack-title {
74
  display: inline-block;
75
  padding: 10px 0 10px 55px;
269
  color: #655997;
270
  }
271
 
272
+ .embedpress-col-half {
273
+ width: 49%;
274
+ height: auto;
275
+ }
276
+
277
+ .embedpress-admin-block-wrapper {
278
+ display: flex;
279
+ flex-flow: row wrap;
280
+ justify-content: space-between;
281
+ margin: -10px;
282
+ }
283
+
284
+ .embedpress-admin-block-wrapper .embedpress-admin-block {
285
+ background-color: #fff;
286
+ flex: 1 1 auto;
287
+ min-width: 250px;
288
+ width: 300px;
289
+ margin: 10px 10px 25px 10px;
290
+ box-shadow: 0px 8px 38px 0px rgba(16, 16, 16, 0.07);
291
+ border-radius: 5px;
292
+ display: flex;
293
+ flex-direction: column;
294
+ justify-content: center;
295
+ }
296
+
297
+ .embedpress-admin-block-header {
298
+ display: flex;
299
+ align-content: center;
300
+ align-items: center;
301
+ padding: 30px 0 0 25px;
302
+ }
303
+
304
+ .embedpress-admin-block-header-icon {
305
+ height: 40px;
306
+ width: 40px;
307
+ background: #f3edff;
308
+ padding: 10px;
309
+ box-sizing: border-box;
310
+ border-radius: 50%;
311
+ }
312
+
313
+ .embedpress-go-premium img {
314
+ width: 100%;
315
+ max-width: 400px;
316
+ display: block;
317
+ float: right;
318
+ }
319
+
320
+ .embedpress-admin-block-header .embedpress-admin-title {
321
+ margin: 0.7em 0 1em;
322
+ padding: 0 1.26582em;
323
+ font-size: 15px;
324
+ font-weight: 600;
325
+ text-overflow: ellipsis;
326
+ white-space: nowrap;
327
+ color: #333333;
328
+ }
329
+
330
+ .embedpress-go-premium .embedpress-admin-block-content {
331
+ overflow: hidden;
332
+ position: relative;
333
+ padding: 1em 1.5em 1.5em;
334
+ background-color: #fff;
335
+ padding-left: 85px;
336
+ padding-bottom: 30px;
337
+ padding-top: 0px;
338
+ }
339
+
340
+ .embedpress-admin-block-content p {
341
+ font-size: 13px;
342
+ color: #707070;
343
+ margin: 0px 0 20px 0;
344
+ line-height: 21px;
345
+ }
346
+
347
+ .embedpress-go-premium .embedpress-btn:hover,
348
+ .embedpress-go-premium .embedpress-btn {
349
+ background-color: #0099cc;
350
+ color: #fff !important;
351
+ padding: 6px 20px;
352
+ border: none;
353
+ box-shadow: none;
354
+ font-size: 14px;
355
+ height: auto;
356
+ text-transform: uppercase;
357
+ text-shadow: none;
358
+ letter-spacing: 0.05em;
359
+ }
360
+
361
  .modal-dialog .row {
362
  width: 100%;
363
  }
364
 
365
+ .embedpress-version-name {
366
+ vertical-align: middle;
367
+ margin-top: 20px;
368
+ margin-right: 20px;
369
+ }
370
+ .embedpress-version-name span{
371
+ color: #687b95;
372
+ font-size: 14px;
373
+ font-weight: 700;
374
+ text-align: right;
375
+ display: block;
376
+ padding-bottom: 5px;
377
+ }
378
+
379
 
380
  /**
381
  * Fremius tweaks
assets/images/embedpress.png ADDED
Binary file
assets/images/icon-why-premium.svg ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:url(#SVGID_1_);}
7
+ .st1{fill:url(#SVGID_2_);}
8
+ .st2{fill:url(#SVGID_3_);}
9
+ .st3{fill:url(#SVGID_4_);}
10
+ .st4{fill:url(#SVGID_5_);}
11
+ .st5{fill:url(#SVGID_6_);}
12
+ .st6{fill:url(#SVGID_7_);}
13
+ .st7{fill:url(#SVGID_8_);}
14
+ .st8{fill:url(#SVGID_9_);}
15
+ .st9{fill:url(#SVGID_10_);}
16
+ </style>
17
+ <g>
18
+ <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="250.782" x2="497.9953" y2="250.782">
19
+ <stop offset="0" style="stop-color:#5725FF"/>
20
+ <stop offset="1" style="stop-color:#9271FF"/>
21
+ </linearGradient>
22
+ <path class="st0" d="M428.9,76.4C382.2,28.3,319.4,1.4,252,0.6c-1,0-2,0-3,0c-65.7,0-127.8,25.5-175,71.8
23
+ C26.5,119.2-0.1,182-0.8,249.1c-0.4,66,24.8,128.6,71,176.1c46.6,48,109.3,74.9,176.5,75.8c1.1,0,2.1,0,3.2,0c0,0,0,0,0,0
24
+ c65.7,0,127.8-25.5,174.9-71.7c47.7-46.8,74.3-109.5,74.9-176.6C500.3,186.6,475.2,124,428.9,76.4z M249.8,481.4l-0.8,0
25
+ C121.8,481,18.5,377.4,18.8,250.4c0.3-127,103.7-230.3,230.5-230.3l0.4,0c127.2,0.2,230.5,103.7,230.4,230.8
26
+ C480.1,378,376.7,481.4,249.8,481.4z"/>
27
+ <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="237.9246" x2="498.4112" y2="237.9246">
28
+ <stop offset="0" style="stop-color:#5725FF"/>
29
+ <stop offset="1" style="stop-color:#9271FF"/>
30
+ </linearGradient>
31
+ <path class="st1" d="M258.1,108.1c-3.1-3.1-5.8-4.5-8.6-4.5c-2.8,0-5.5,1.4-8.5,4.5c-33.2,33.2-66.5,66.4-99.7,99.7
32
+ c-6,6-6.1,11.2-0.2,17.1c10.1,10.3,20.6,20.7,31.1,31.1c3.2,3.1,5.9,4.6,8.6,4.6c2.7,0,5.4-1.4,8.5-4.5c5-4.9,10-9.9,14.8-14.7
33
+ c2.5-2.5,5-5,7.5-7.5c0.7-0.7,1.4-1.4,2.4-2.3c0,0,0,0,0.1,0l0,126.5c0,11.5,2.7,14.2,14.4,14.2l25.4,0l17.6,0
34
+ c10.6,0,13.5-2.9,13.5-13.7c0-31.8,0-127.4,0-127.4c2.3,2.3,4.6,4.7,7,7c5.8,5.9,11.8,11.9,17.8,17.8c3.1,3.1,5.9,4.5,8.5,4.5
35
+ c0,0,0,0,0,0c2.7,0,5.4-1.4,8.6-4.6c10.1-10,20.6-20.5,31.1-31.1c5.9-6,5.9-11.1-0.1-17.1C324.5,174.5,291.3,141.3,258.1,108.1z
36
+ M317.5,236.4l-6.4-6.4c-7-7-14-14.1-21.1-21.2c-0.7-0.7-1.4-1.5-2.1-2.2c-1.7-1.9-3.5-3.9-5.7-5.2c-2.7-1.5-5.9-2.5-8.5-2.5
37
+ c-0.6,0-1.3,0.1-1.8,0.2c-4,0.7-6.4,4.4-6.5,9.7c0,2.7,0,5.4,0,8.1l0,39.2c0,30.2,0,60.5,0,90.7c0,0.6,0,1.2,0,1.7c0,2,0,3.6-0.3,4
38
+ c-0.2,0.2-1.7,0.2-2.2,0.2c-0.4,0-0.8,0-1.2,0c-0.6,0-1.2,0-1.9,0l-1.9,0c-2,0-4,0-6,0c-2,0-4,0-6.1,0c-3.3,0-6.1,0.1-8.6,0.2
39
+ c-0.2,0-0.4,0-0.6,0c-1.2,0-1.9-0.2-2.4-0.6c-0.6-0.6-0.7-2.1-0.7-3.9c0.1-35.8,0.1-72.2,0.1-107.4l0-29.2c0-0.8,0-1.6,0-2.4
40
+ c0-5.3-2.1-8.8-6.2-10.4c-1.2-0.5-2.5-0.7-3.7-0.7c-2.8,0-5.5,1.3-8,3.8c-9.7,9.8-19.7,19.7-29.3,29.3l-4.3,4.3
41
+ c-0.2,0.2-0.3,0.3-0.5,0.5L162,216.5l87.7-87.7l87.3,87.4L317.5,236.4z"/>
42
+ <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="223.0584" x2="498.4112" y2="223.0584">
43
+ <stop offset="0" style="stop-color:#5725FF"/>
44
+ <stop offset="1" style="stop-color:#9271FF"/>
45
+ </linearGradient>
46
+ <path class="st2" d="M71.6,228.6c6.4-47.4,28.3-86.7,64.9-116.7c24.7-20.3,53.7-33.1,86-38.1c9-1.4,18.2-2.1,27.2-2.1
47
+ c8.8,0,17.8,0.7,26.7,2c0.9,0.1,1.7,0.2,2.6,0.2c5.5,0,9.2-3.1,10.1-8.2c0.4-2.5-0.1-4.9-1.5-6.8c-1.7-2.3-4.5-3.9-8.2-4.5
48
+ c-9.7-1.6-19.7-2.4-29.5-2.4c-12.3,0-24.9,1.3-37.4,3.7C160,66,118.4,92.5,88.7,134.3c-40.8,57.5-49,120.9-24.4,188.5
49
+ c8.8,24.2,23.4,46.7,43.3,67.1c1.9,1.9,4.6,4.2,8.1,4.2c1.1,0,2.2-0.2,3.4-0.6c3.3-1.2,5.5-3.6,6.2-6.5c0.8-3.6-0.7-7.6-4.1-11.2
50
+ c-32-33.2-49.1-73.7-50.7-120.5c0-1.4,0-2.7,0-4.1c0-3.1-0.1-6.2,0.1-9.3C70.8,236.5,71.1,232.4,71.6,228.6z"/>
51
+ <linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="242.9939" x2="498.4112" y2="242.9939">
52
+ <stop offset="0" style="stop-color:#5725FF"/>
53
+ <stop offset="1" style="stop-color:#9271FF"/>
54
+ </linearGradient>
55
+ <path class="st3" d="M396.5,117.2c-6.4-6.9-13.6-13.2-20.5-19.3c-1.1-1-2.2-1.9-3.3-2.9c-2-1.8-4.4-2.8-6.9-2.8
56
+ c-2.8,0-5.4,1.2-7.3,3.4c-3.6,4.3-3,9.6,1.6,14c0.9,0.9,1.8,1.7,2.8,2.4c0.4,0.3,0.7,0.6,1.1,0.9c44.2,37.9,65.9,86.3,64.5,143.7
57
+ c-1,40.4-14.9,77-41.3,108.7c-1.4,1.7-2.9,3.3-4.4,4.8c-2.4,2.5-4.9,5.1-6.8,8c-1.8,2.7-2.4,7.2-1.3,10.2c0.9,2.6,5,5.4,7.8,5.4
58
+ l0.1,0c3.4-0.1,7.1-2.4,9.3-4.6c35.3-36.5,55.3-82.5,56.3-129.6C448.9,204.2,430.5,153.7,396.5,117.2z"/>
59
+ <linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="77.7156" x2="498.4112" y2="77.7156">
60
+ <stop offset="0" style="stop-color:#5725FF"/>
61
+ <stop offset="1" style="stop-color:#9271FF"/>
62
+ </linearGradient>
63
+ <path class="st4" d="M311.6,82.5c5.7,2.7,12,5.4,19.2,8.3c1.2,0.5,2.5,0.8,3.8,0.8c3.7,0,7.1-2.1,8.7-5.5c2.4-5,0.4-10.4-4.7-12.9
64
+ c-4.7-2.3-9.5-4.3-14.2-6.3c-1.4-0.6-2.7-1.2-4.1-1.7c-1-0.4-2.1-0.7-3-1c-0.3-0.1-0.6-0.2-0.9-0.3l-0.2-0.1l-0.3,0
65
+ c-5.4,0.6-8.7,3.3-9.7,7.9C305.1,76.4,307.1,80.4,311.6,82.5z"/>
66
+ <linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="431.2239" x2="498.4112" y2="431.2239">
67
+ <stop offset="0" style="stop-color:#5725FF"/>
68
+ <stop offset="1" style="stop-color:#9271FF"/>
69
+ </linearGradient>
70
+ <path class="st5" d="M249.7,412.9l-0.2,0c-5.3,0-9.3,3.8-9.7,9.5c-0.2,2-0.1,4-0.1,5.9c0,0.9,0,1.8,0,2.7c0,0.8,0,1.7,0,2.5
71
+ c0,2-0.1,4,0.1,6c0.4,5.7,4.5,9.9,9.6,10l0.2,0c5.1,0,9.4-4.2,9.7-9.7c0.3-5.6,0.3-11.5,0-17.6C258.9,416.9,255,413,249.7,412.9z"
72
+ />
73
+ <linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="407.6321" x2="498.4112" y2="407.6321">
74
+ <stop offset="0" style="stop-color:#5725FF"/>
75
+ <stop offset="1" style="stop-color:#9271FF"/>
76
+ </linearGradient>
77
+ <path class="st6" d="M164.4,390.4l-0.4,0l-0.3,0.2c-0.2,0.2-0.6,0.4-1.1,0.6c-1.5,0.8-3.5,1.8-4.7,3.5c-3.7,5.3-6.8,11.1-9.4,16
78
+ c-2.4,4.5-0.9,9.6,3.5,12.4c1.7,1,3.5,1.6,5.4,1.6c3,0,5.7-1.5,7.4-4c4.1-6.1,7.3-11.7,9.8-17c1.3-2.8,1.2-5.9-0.4-8.5
79
+ C172.2,392.3,168.7,390.5,164.4,390.4z"/>
80
+ <linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="407.1936" x2="498.4112" y2="407.1936">
81
+ <stop offset="0" style="stop-color:#5725FF"/>
82
+ <stop offset="1" style="stop-color:#9271FF"/>
83
+ </linearGradient>
84
+ <path class="st7" d="M351.5,414.6c0-0.6,0-1.3-0.3-1.9c-1-1.7-1.9-3.4-2.8-5.1c-2.6-4.8-5.3-9.7-8.5-14.3c-1.4-2-3.6-3.1-6.1-3.1
85
+ c-1.8,0-3.7,0.6-5.5,1.7c-4.5,2.8-6,7.1-3.9,11.4c2.9,5.9,6.1,12.2,10.4,17.8c1.6,2.1,5.5,3.1,8.4,3.1c0.5,0,1,0,1.4-0.1
86
+ c4-0.5,6.7-3.9,7-8.7l0-0.1l0-0.1C351.5,415,351.5,414.8,351.5,414.6z"/>
87
+ <linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="425.1868" x2="498.4112" y2="425.1868">
88
+ <stop offset="0" style="stop-color:#5725FF"/>
89
+ <stop offset="1" style="stop-color:#9271FF"/>
90
+ </linearGradient>
91
+ <path class="st8" d="M208.8,407.6c-0.9-0.3-1.8-0.4-2.8-0.4c-3.9,0-7.4,2.3-8.6,5.7c-1.6,4.6-2.9,9.4-4,13.6
92
+ c-0.4,1.6-0.8,3.2-1.3,4.6l0,0.1l0,0.1c-0.2,5.9,2.4,10.2,7,11.4c0.9,0.2,1.9,0.4,2.8,0.4c0,0,0,0,0,0c4.2,0,7.5-2.4,8.8-6.2
93
+ c2.1-6.5,3.8-12.8,5-18.9C216.5,413.2,214,409.3,208.8,407.6z"/>
94
+ <linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="-2.5273" y1="425.1707" x2="498.4112" y2="425.1707">
95
+ <stop offset="0" style="stop-color:#5725FF"/>
96
+ <stop offset="1" style="stop-color:#9271FF"/>
97
+ </linearGradient>
98
+ <path class="st9" d="M305.6,426.7c-1.1-4.3-2.4-9.3-4.2-14c-1.3-3.5-4.3-5.5-8.1-5.5c-0.9,0-1.9,0.1-2.9,0.4
99
+ c-5.2,1.4-8,5.4-7.1,10.3c1.2,6.6,3,13.3,5.4,19.8c1.2,3.5,4.2,5.5,8.1,5.5c0.9,0,1.9-0.1,2.9-0.4c4.8-1.2,7.2-4.7,7.4-10.9l0-0.2
100
+ l-0.1-0.2C306.5,430.1,306.1,428.4,305.6,426.7z"/>
101
+ </g>
102
+ </svg>
embedpress.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
- * Version: 2.5.3
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
+ * Version: 2.5.4
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
includes.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
- define('EMBEDPRESS_VERSION', "2.5.3");
26
  /**
27
  * @deprecated 2.2.0
28
  */
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
+ define('EMBEDPRESS_VERSION', "2.5.4");
26
  /**
27
  * @deprecated 2.2.0
28
  */
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: embed, embed youtube, gutenberg embed, elementor embed, video embed, Googl
6
  Requires at least: 4.6
7
  Tested up to: 5.4
8
  Requires PHP: 5.6
9
- Stable tag: 2.5.3
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
@@ -63,6 +63,8 @@ Google Drive is an enormously popular service that has replaced Microsoft Office
63
 
64
  - [How to use Google Slides in WordPress](https://embedpress.com/docs/embed-google-slides-wordpress/)
65
 
 
 
66
 
67
  #### 👍FACEBOOK POSTS AND VIDEOS
68
 
@@ -207,7 +209,7 @@ We’ve seen that EmbedPress supports YouTube, Wistia and Vimeo, but EmbedPress
207
  - [SpeakerDeck embeds](https://embedpress.com/docs/embed-speakerdeck-presentations-wordpress/) (Presentations)
208
 
209
 
210
- 🙌After reading this feature list, you can probably imagine EmbedPress is the best plugin in the market. So, do you want to unlock the advanced features? [Upgrade to our Pro version.](https://embedpress.com/everything-club/)
211
 
212
  ## 🚀BACKED BY A TRUSTED TEAM
213
 
@@ -270,6 +272,15 @@ Not at all. You can set up everything your team needs without any coding knowled
270
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
271
  and this project adheres to [Semantic Versioning](http://semver.org/).
272
 
 
 
 
 
 
 
 
 
 
273
  = [2.5.3] - 2020-04-22 =
274
  * Fixed minor issue related to Google Sheets in Elementor without Classic Editor
275
  * License update to GPLv3 from GPLv2
6
  Requires at least: 4.6
7
  Tested up to: 5.4
8
  Requires PHP: 5.6
9
+ Stable tag: 2.5.4
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
63
 
64
  - [How to use Google Slides in WordPress](https://embedpress.com/docs/embed-google-slides-wordpress/)
65
 
66
+ https://www.youtube.com/watch?v=3CWysKDRoG4
67
+
68
 
69
  #### 👍FACEBOOK POSTS AND VIDEOS
70
 
209
  - [SpeakerDeck embeds](https://embedpress.com/docs/embed-speakerdeck-presentations-wordpress/) (Presentations)
210
 
211
 
212
+ 🙌After reading this feature list, you can probably imagine EmbedPress is the best plugin in the market. So, do you want to unlock the advanced features? [Upgrade to our Pro version.](https://embedpress.com/#pricing)
213
 
214
  ## 🚀BACKED BY A TRUSTED TEAM
215
 
272
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
273
  and this project adheres to [Semantic Versioning](http://semver.org/).
274
 
275
+ = [2.5.4] - 2020-05-10 =
276
+ * Enhanched Alighment Control for all Gutenberg Blocks
277
+ * Added a simple YouTube Blocks for Gutenberg
278
+ * Added Docs Link for all Gutenberg Blocks
279
+ * Added present version number in Option Screen for clarity
280
+ * Fixed Links in Option Screen
281
+ * Fixed Content Error in Blocks
282
+
283
+
284
  = [2.5.3] - 2020-04-22 =
285
  * Fixed minor issue related to Google Sheets in Elementor without Classic Editor
286
  * License update to GPLv3 from GPLv2