embeds-block.min.js
1 month ago
popup-trigger-block.min.js
1 month ago
slidein-trigger-block.min.js
1 month ago
social-share-block.min.js
1 month ago
unsubscribe-block.min.js
1 month ago
slidein-trigger-block.min.js
1 lines
| 1 | !function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var s=wp.blocks,l=s.registerBlockType,a=s.createBlock,c=wp.element,u=c.createElement,d=c.Component,_=(c.RawHTML,wp.shortcode),p=_.string,h=_.next,g=u("svg",{className:"dashicon",viewBox:"0 0 24 24",width:20,height:20,xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet","aria-hidden":"true",role:"img"},u("path",{d:"M24 6H10.5a1.45 1.45 0 0 0-1.066.434A1.45 1.45 0 0 0 9 7.5v9c0 .422.145.777.434 1.066.289.29.644.434 1.066.434H24v4.5c0 .422-.145.777-.434 1.066A1.45 1.45 0 0 1 22.5 24h-21a1.45 1.45 0 0 1-1.066-.434A1.45 1.45 0 0 1 0 22.5v-21C0 1.078.145.723.434.434A1.45 1.45 0 0 1 1.5 0h21c.422 0 .777.145 1.066.434.29.289.434.644.434 1.066V6z"}),u("path",{d:"M21.5 7c.422 0 .777.145 1.066.434.29.289.434.644.434 1.066 0 .422-.145.777-.434 1.066A1.45 1.45 0 0 1 21.5 10a1.45 1.45 0 0 1-1.066-.434A1.45 1.45 0 0 1 20 8.5c0-.422.145-.777.434-1.066A1.45 1.45 0 0 1 21.5 7z"})),f=function(n){function s(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=function(e,n,r){return n=i(n),function(e,n){if(n&&("object"==t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}(e,o()?Reflect.construct(n,r||[],i(e).constructor):n.apply(e,r))}(this,s,arguments)).update_id=e.update_id.bind(e),e.update_css_class=e.update_css_class.bind(e),e.update_content=e.update_content.bind(e),e.state={loading:!1},e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}(s,n),l=s,a=[{key:"update_module_id",value:function(t){this.props.setAttributes({module_id:t})}},{key:"update_id",value:function(t){this.props.setAttributes({id:t})}},{key:"update_content",value:function(t){this.props.setAttributes({content:t})}},{key:"update_css_class",value:function(t){this.props.setAttributes({css_class:t})}},{key:"set_module_id_from_shortcode_id",value:function(t){var e=this;if(!this.state.loading){this.setState({loading:!0});var n=ajaxurl+"?action=hustle_get_module_id_by_shortcode&_wpnonce="+hustle_slidein_trigger_data.nonce+"&shortcode_id="+t;window.fetch(n).then(function(t){return t.json()}).then(function(t){t.success&&t.data.module_id&&e.update_module_id(t.data.module_id),e.setState({loading:!1})})}}},{key:"componentDidUpdate",value:function(t){var e=this.props.attributes.id;t.attributes.id!==e&&e&&this.set_module_id_from_shortcode_id(e)}},{key:"componentDidMount",value:function(){var t=this.props.attributes,e=t.module_id,n=t.id;n&&!e&&this.set_module_id_from_shortcode_id(n)}},{key:"open_settings",value:function(t){var e=hustle_slidein_trigger_data.admin_url+"?page="+hustle_slidein_trigger_data.wizard_page+"&id="+t;window.open(e)}},{key:"render",value:function(){var t=this,e=this.state.loading,n=this.props,o=n.attributes,i=n.isSelected,r=o.module_id,s=o.id,l=o.content,a=o.css_class,c=hustle_slidein_trigger_data.modules,d=[i&&u(wp.blockEditor.InspectorControls,{key:"inspector"},u(wp.components.PanelBody,{title:hustle_slidein_trigger_data.l10n.module,initialOpen:!0},u(wp.components.PanelRow,null,u(wp.components.SelectControl,{label:hustle_slidein_trigger_data.l10n.name,value:s,options:c,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:this.update_id}))),u(wp.components.PanelBody,{title:hustle_slidein_trigger_data.l10n.advanced,initialOpen:!0},u(wp.components.PanelRow,null,u(wp.components.TextControl,{label:hustle_slidein_trigger_data.l10n.trigger_content,value:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:this.update_content})),u(wp.components.PanelRow,null,u(wp.components.TextControl,{label:hustle_slidein_trigger_data.l10n.additional_css_classes,value:a,__next40pxDefaultSize:!0,onChange:this.update_css_class,__nextHasNoMarginBottom:!0})))),u(wp.blockEditor.BlockControls,{key:"block-controls"},!!s&&u(wp.components.Toolbar,{label:hustle_slidein_trigger_data.l10n.customize_module},u(wp.components.ToolbarButton,{className:"components-toolbar__control",label:hustle_slidein_trigger_data.l10n.customize_module,icon:"edit",onClick:function(e){return t.open_settings(r)}})))];return e?[d,u("div",{key:"loading",className:"wp-block-embed is-loading"},u(wp.components.Spinner,null),u("span",null,hustle_slidein_trigger_data.l10n.rendering))]:s?[d,u(wp.blockEditor.RichText,{key:"richtext",tagName:"a",multiline:!1,withoutInteractiveFormatting:!0,value:l,onChange:this.update_content,placeholder:hustle_popup_trigger_data.l10n.content_here})]:[d,u(wp.components.Placeholder,{key:"placeholder",className:"wp-block-embed",instructions:hustle_slidein_trigger_data.l10n.block_description,icon:g,label:hustle_slidein_trigger_data.l10n.block_name},u("form",null,u("select",{value:s,onChange:function(e){return t.update_id(e.target.value)}},c.map(function(t){return u("option",{key:t.value,value:t.value},t.label)}))),u("div",{className:"components-placeholder__instructions"},hustle_slidein_trigger_data.l10n.block_more_description))]}}],a&&e(l.prototype,a),Object.defineProperty(l,"prototype",{writable:!1}),l;var l,a}(d);l("hustle/slidein-trigger",{apiVersion:3,title:hustle_slidein_trigger_data.l10n.block_name,description:hustle_slidein_trigger_data.l10n.block_description,icon:g,category:"hustle",keywords:["Hustle",hustle_slidein_trigger_data.l10n.block_name],attributes:{module_id:{type:"string"},id:{type:"string"},type:{type:"string"},content:{type:"string",default:hustle_slidein_trigger_data.l10n.click_here},css_class:{type:"string"}},supports:{customClassName:!1,className:!1,html:!1},transforms:{to:[{type:"block",blocks:["core/shortcode"],transform:function(t){var e=t.id,n=t.content,o=t.css_class,i={tag:hustle_slidein_trigger_data.shortcode_tag,attrs:{id:e||"",css_class:o||"",type:"slidein"},content:n,type:"closed"},r=p(i);return a("core/shortcode",{text:r})}}],from:[{type:"block",blocks:["core/shortcode"],isMatch:function(t){var e=t.text,n=h("wd_hustle",e);return void 0!==n&&"slidein"===n.shortcode.attrs.named.type},transform:function(t){var e=t.text,n=h("wd_hustle",e).shortcode,o=n.content,i=n.attrs.named,r=i.id,s=i.type,l=i.css_class;return a("hustle/slidein-trigger",{id:r,type:s,css_class:l,content:o})}}]},edit:f,save:function(){return null}})}(); |