| 1 |
!function(e,t,o){var u=window.wp.i18n.__,a=wp.hooks.addFilter,b=e.Fragment,d=t.InspectorControls,l=wp.compose.createHigherOrderComponent,f=o.TextControl,x=o.SelectControl,p=o.ToggleControl,m=o.PanelBody,h=["core/button","core/image"],g=[];g.push({value:"none",label:u("Select a box","firebox")}),g.push({value:"current",label:u("Current box","firebox")}),wp.apiFetch({path:"/fireplugins/firebox/boxes"}).then(function(e){var t;(t=[],e.map(function(e){t.push({label:e.title,value:e.id})}),t).forEach(function(e){g.push({value:e.value,label:e.label})})});var n=l(function(s){return function(e){var t=e.name,o=e.attributes,a=e.setAttributes,l=o.dataFBox,n=o.dataFBoxCmd,r=o.dataFBoxEnabled,c=o.dataFBoxPreventDefault,i=o.dataFBoxClass;return React.createElement(b,null,React.createElement(s,e),h.includes(t)&&React.createElement(d,null,React.createElement(m,{title:u("FireBox","firebox")},React.createElement(p,{label:u("Enable FireBox Settings","firebox"),checked:!!r,onChange:function(){return a({dataFBoxEnabled:!r})},help:u("Enable to trigger a FireBox or define custom CSS Classes.","firebox")}),r&&React.createElement("div",null,React.createElement(x,{label:u("Select a FireBox","firebox"),value:l,options:g,onChange:function(e){return a({dataFBox:e})},help:u("Select the box to trigger.","firebox")}),!l||"none"!=l&&React.createElement(b,null,React.createElement(x,{label:u("FireBox Action","firebox"),value:n,options:[{label:"Open",value:"open"},{label:"Close",value:"close"},{label:"Toggle",value:"toggle"}],onChange:function(e){return a({dataFBoxCmd:e})},help:u("Set the action of the box. Open, Close or Toggle.","firebox")}),React.createElement(p,{label:u("Prevent Default Action","firebox"),checked:!!c,onChange:function(){return a({dataFBoxPreventDefault:!c})},help:u("If enabled, stops the default action of the element from occuring. For example: Prevents a link from following the URL.","firebox")})),React.createElement(f,{label:u("CSS Classes","firebox"),value:i,onChange:function(e){return a({dataFBoxClass:e})},help:u("Set custom CSS Classes to this block. Separate multiple classes with spaces.","firebox")})))))}},"FBox_Block_Set_Advanced_Controls");a("blocks.registerBlockType","fbox/core-blocks-custom-attributes",function(e){return h.includes(e.name)&&void 0!==e.attributes&&(e.attributes=Object.assign(e.attributes,{dataFBox:{type:"string"},dataFBoxCmd:{type:"string",default:"close"},dataFBoxEnabled:{type:"boolean",default:!1},dataFBoxPreventDefault:{type:"boolean",default:!0},dataFBoxClass:{type:"string",default:""}})),e}),a("editor.BlockEdit","fbox/core-blocks-custom-controls",n)}((window.wp.blocks,window.wp.element),window.wp.blockEditor,window.wp.components); |