PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / trunk
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels vtrunk
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / block / build / index.js

index.js in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels trunk, at block/build/index.js

1 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{var e={942(e,t){var a;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=l(e,r(a)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)n.call(e,a)&&e[a]&&(t=l(t,a));return t}function l(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(a=function(){return o}.apply(t,[]))||(e.exports=a)}()}};const t={};function a(n){const o=t[n];if(void 0!==o)return o.exports;const r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var o=t[n++],r=t[n++];a.o(e,o)?0===r&&n++:0===r?Object.defineProperty(e,o,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:r})}else for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.hasOwn(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.wp.serverSideRender;var n=a.n(t),o=a(942),r=a.n(o);const l=window.wp.compose,s=window.wp.blockEditor,i=window.wp.components,c=window.wp.element,u=window.wp.hooks,p=window.ReactJSXRuntime,d=JSON.parse('{"UU":"automatic-youtube-gallery/block"}');function b(e){var t="string";return"number"==e?t="number":"checkbox"==e&&(t="boolean"),t}(0,e.registerBlockType)(d.UU,{attributes:function(){var e={is_admin:{type:"boolean",default:!1},uid:{type:"string",default:""}};for(var t in ayg_block.options){var a=ayg_block.options[t].fields;for(var n in a)e[a[n].name]={type:b(a[n].type),default:a[n].value}}return e}(),edit:function({attributes:e,setAttributes:t,className:a,clientId:o}){e.uid=o;const[d,b]=(0,c.useState)(!1),[y,m]=(0,c.useState)(e),g=(0,c.useCallback)(()=>(0,p.jsx)(n(),{block:"automatic-youtube-gallery/block",attributes:Object.assign({},y,{is_admin:!0})}),[y]),h=(0,l.debounce)(()=>{b(!1),m({...e})},1e3),f=e=>a=>{t({[e]:a})};(0,c.useEffect)(()=>{b(!0),h()},[e]);const x=(0,c.useRef)();(0,c.useEffect)(()=>{x.current?(0,u.applyFilters)("ayg_block_init",e):x.current=!0});const v=r()(a,{"is-loading":d}),_=(0,s.useBlockProps)({className:v});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s.InspectorControls,{children:Object.keys(ayg_block.options).map((a,n)=>(t=>{let a=!0;switch(t){case"gallery":"video"!=e.type&&"livestream"!=e.type||(a=!1);break;case"search":"video"!=e.type&&"livestream"!=e.type||(a=!1),"slider"!=e.theme&&"slider-popup"!=e.theme&&"slider-inline"!=e.theme&&"playlister"!=e.theme||(a=!1)}return(0,u.applyFilters)("ayg_block_toggle_panels",a,t,e)})(a)&&(0,p.jsx)(i.PanelBody,{title:ayg_block.options[a].label,initialOpen:0==n,className:"automatic-youtube-gallery-block-panel",children:Object.keys(ayg_block.options[a].fields).map((n,o)=>((a,n)=>{if(!(t=>{let a=!0;switch(t){case"playlist":case"username":case"search":case"video":case"videos":t!=e.type&&(a=!1);break;case"channel":"channel"!=e.type&&"livestream"!=e.type&&(a=!1);break;case"order":case"limit":"search"!=e.type&&(a=!1);break;case"cache":case"player_title":case"player_description":case"loop":"livestream"==e.type&&(a=!1);break;case"autoadvance":"video"!=e.type&&"livestream"!=e.type||(a=!1)}return(0,u.applyFilters)("ayg_block_toggle_controls",a,t,e)})(a.name))return"";const o=a.placeholder?a.placeholder:"",r=a.description?a.description:"";switch(a.type){case"number":return(0,p.jsx)(i.PanelRow,{children:(0,p.jsx)(i.RangeControl,{label:a.label,help:r,placeholder:o,value:e[a.name],min:a.min,max:a.max,onChange:f(a.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},n);case"textarea":return(0,p.jsx)(i.PanelRow,{children:(0,p.jsx)(i.TextareaControl,{label:a.label,help:r,placeholder:o,value:e[a.name],onChange:f(a.name),__nextHasNoMarginBottom:!0})},n);case"select":case"radio":let c=[];for(let e in a.options)c.push({label:a.options[e],value:e});return(0,p.jsx)(i.PanelRow,{children:(0,p.jsx)(i.SelectControl,{label:a.label,help:r,options:c,value:e[a.name],onChange:f(a.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},n);case"checkbox":return(0,p.jsx)(i.PanelRow,{children:(0,p.jsx)(i.ToggleControl,{label:a.label,help:r,checked:e[a.name],onChange:(l=a.name,e=>{t({[l]:e})}),__nextHasNoMarginBottom:!0})},n);case"color":return(0,p.jsx)(i.PanelRow,{children:(0,p.jsx)(s.PanelColorSettings,{title:a.label,colorSettings:[{label:ayg_block.i18n.selected_color,value:e[a.name],onChange:f(a.name)}]})},n);default:return(0,p.jsx)(i.PanelRow,{children:(0,p.jsx)(i.TextControl,{label:a.label,help:r,placeholder:o,value:e[a.name],onChange:f(a.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},n)}var l})(ayg_block.options[a].fields[n],"automatic-youtube-gallery-block-control-"+o))},"automatic-youtube-gallery-block-panel-"+n))}),(0,p.jsx)("div",{..._,children:(0,p.jsx)(i.Disabled,{children:(0,p.jsx)(g,{})})})]})}})})()})();