laipower/wp-content/themes/generatepress/assets/dist/customizer.js

5 lines
239 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp_generatepress=window.webpackJsonp_generatepress||[]).push([[3],{21:function(e,a,t){},29:function(e,a,t){},30:function(e,a,t){},31:function(e,a,t){},35:function(e,a,t){},44:function(e,a,t){},47:function(e,a,t){},48:function(e,a,t){},49:function(e,a,t){},50:function(e,a,t){}}]),function(e){function a(a){for(var r,o,s=a[0],l=a[1],c=a[2],g=0,p=[];g<s.length;g++)o=s[g],Object.prototype.hasOwnProperty.call(i,o)&&i[o]&&p.push(i[o][0]),i[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(a);p.length;)p.shift()();return n.push.apply(n,c||[]),t()}function t(){for(var e,a=0;a<n.length;a++){for(var t=n[a],r=!0,s=1;s<t.length;s++){var l=t[s];0!==i[l]&&(r=!1)}r&&(n.splice(a--,1),e=o(o.s=t[0]))}return e}var r={},i={1:0},n=[];function o(a){if(r[a])return r[a].exports;var t=r[a]={i:a,l:!1,exports:{}};return e[a].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=e,o.c=r,o.d=function(e,a,t){o.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,a){if(1&a&&(e=o(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var r in e)o.d(t,r,function(a){return e[a]}.bind(null,r));return t},o.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(a,"a",a),a},o.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},o.p="";var s=window.webpackJsonp_generatepress=window.webpackJsonp_generatepress||[],l=s.push.bind(s);s.push=a,s=s.slice();for(var c=0;c<s.length;c++)a(s[c]);var u=l;n.push([55,3]),t()}([function(e,a){e.exports=window.wp.element},function(e,a){e.exports=window.wp.i18n},function(e,a){e.exports=window.wp.components},function(e,a){e.exports=window.React},function(e,a,t){var r=t(14),i=t(15),n=t(12),o=t(16);e.exports=function(e,a){return r(e)||i(e,a)||n(e,a)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,a,t){var r=t(32),i=t(33),n=t(12),o=t(34);e.exports=function(e){return r(e)||i(e)||n(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,a){function t(){return e.exports=t=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,t.apply(this,arguments)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,a){e.exports=function(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,a){function t(a){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(a)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,a){e.exports=window.wp.hooks},function(e){e.exports=JSON.parse('{"ABeeZee":{"variants":["regular","italic"],"category":"sans-serif"},"Abel":{"variants":["regular"],"category":"sans-serif"},"Abhaya Libre":{"variants":["regular","500","600","700","800"],"category":"serif"},"Abril Fatface":{"variants":["regular"],"category":"display"},"Aclonica":{"variants":["regular"],"category":"sans-serif"},"Acme":{"variants":["regular"],"category":"sans-serif"},"Actor":{"variants":["regular"],"category":"sans-serif"},"Adamina":{"variants":["regular"],"category":"serif"},"Advent Pro":{"variants":["100","200","300","regular","500","600","700"],"category":"sans-serif"},"Aguafina Script":{"variants":["regular"],"category":"handwriting"},"Akaya Kanadaka":{"variants":["regular"],"category":"displ
/* translators: Unit type (px, em, %) */,{text:Object(g.sprintf)(Object(g.__)("%s Preview","generatepress"),a),key:e},Object(n.createElement)(o.Button,{key:e,className:"components-generate-control-button__units--"+e,isSmall:!0
/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":a,onClick:function(){wp.customize.previewedDevice.set(e),r(e)}},u(e)))})))))}),Sr=t(22),wr=t.n(Sr),Cr=t(23),xr=t.n(Cr),jr=t(24),Mr=t.n(jr),Er=t(25),kr=t.n(Er),Nr=t(20),Pr=t.n(Nr);t(47);var _r=function(e){Mr()(i,e);var a,t,r=(a=i,t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Pr()(a);if(t){var i=Pr()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return kr()(this,e)});function i(){return wr()(this,i),r.apply(this,arguments)}return xr()(i,[{key:"render",value:function(){var e=this.props,a=e.label,t=e.value,r=e.onChange,i=e.rangeMin,s=void 0===i?0:i,l=e.rangeMax,c=void 0===l?100:l,u=e.inputMin,g=void 0===u?"":u,p=e.inputMax,f=void 0===p?"":p,d=e.step,y=void 0===d?1:d,v=e.help,m=void 0===v?"":v,h=e.beforeIcon,b=void 0===h?"":h,O=e.initialPosition,S=void 0===O?"":O,w=e.placeholder,C=void 0===w?"":w;return Object(n.createElement)("div",{className:"components-generate-range-control"},a&&Object(n.createElement)("div",{className:"components-generate-range-control--label"},a),Object(n.createElement)("div",{className:"components-generate-range-control--wrapper"},Object(n.createElement)("div",{className:"components-generate-range-control--range"},Object(n.createElement)(o.RangeControl,{className:"generate-range-control-range",beforeIcon:b,value:ir(t)?parseFloat(t):"",onChange:function(e){return r(e)},min:s,max:c,step:y,withInputField:!1,initialPosition:S})),Object(n.createElement)("div",{className:"components-generate-range-control-input"},Object(n.createElement)(o.TextControl,{type:"number",placeholder:""!==C?C:"",min:g,max:f,step:y,value:ir(t)?t:"",onChange:function(e){return r(e)}}))),m&&Object(n.createElement)("p",{className:"components-base-control__help"},m))}}]),i}(n.Component),Tr=(t(48),function(e){var a=e.value,t=e.onClick,r=e.units;return Object(n.createElement)("div",{className:"components-generate--control__units"},Object(n.createElement)(o.Dropdown,{className:"generate-component-control--unit-picker",contentClassName:"generate-component-control--unit-picker-area",position:"middle center",focusOnMount:"container",renderToggle:function(e){var t=e.isOpen,r=e.onToggle;return Object(n.createElement)(o.Button,{onClick:r,"aria-expanded":t},a||u("dash"))},renderContent:function(e){var i=e.onClose;return Object(n.createElement)(o.ButtonGroup,{className:"components-generate--control-buttons__units","aria-label":Object(g.__)("Select Units","generatepress")},r.map((function(e){var r=e,s=e||u("dash");return""===e&&(r=Object(g.__)("No Unit","generatepress")),"px"===e&&(r=Object(g._x)("Pixel","A size unit for CSS markup","generatepress")),"em"===e&&(r=Object(g._x)("Em","A size unit for CSS markup","generatepress")),"%"===e&&(r=Object(g._x)("Percentage","A size unit for CSS markup","generatepress")),"deg"===e&&(r=Object(g._x)("Degree","A size unit for CSS markup","generatepress")),Object(n.createElement)(o.Tooltip
/* translators: Unit type (px, em, %) */,{text:e?Object(g.sprintf)(Object(g.__)("%s Units","generatepress"),r):r,key:e},Object(n.createElement)(o.Button,{key:e,className:"components-generate--control-button__units--"+e,isSmall:!0,isPrimary:a===e,"aria-pressed":a===e
/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":e?Object(g.sprintf)(Object(g.__)("%s Units","generatepress"),r):r,onClick:function(){t(e),i()}},s))})))}}))}),Ir=function(e){var a=e.label,t=e.unitValue,r=e.units,i=e.onChangeUnit,s=e.step,l=e.rangeMin,c=e.rangeMax,u=e.inputMin,g=void 0===u?null:u,p=e.inputMax,f=void 0===p?null:p,d=e.desktopValue,y=e.desktopInitial,v=e.desktopOnChange,m=e.tabletValue,h=e.tabletInitial,b=e.tabletOnChange,O=e.mobileInitial,S=e.mobileValue,w=e.mobileOnChange;return Object(n.createElement)(o.BaseControl,null,Object(n.createElement)(Or,{label:a,value:t,devices:["desktop","tablet","mobile"]}),Object(n.createElement)("div",{className:"generate-component-input-with-unit"},Object(n.createElement)("div",{className:"generate-component-device-field","data-device":"desktop"},Object(n.createElement)(_r,{className:"generate-range-control-range",step:s,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:ir(d)?parseFloat(d):y,initialPosition:y,onChange:v,withInputField:!1})),Object(n.createElement)("div",{className:"generate-component-device-field","data-device":"tablet"},Object(n.createElement)(_r,{"data-generate-control-device":"tablet",className:"generate-range-control-range",step:s,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:ir(m)?parseFloat(m):h,initialPosition:h,onChange:b,withInputField:!1})),Object(n.createElement)("div",{className:"generate-component-device-field","data-device":"mobile"},Object(n.createElement)(_r,{"data-generate-control-device":"mobile",className:"generate-range-control-range",step:s,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:ir(S)?parseFloat(S):O,initialPosition:O,onChange:w,withInputField:!1})),Object(n.createElement)(Tr,{value:t,units:r,onClick:i})))},Ar=function(e){var a=e.font,t=e.onChange;return Object(n.createElement)(Ir,{label:Object(g.__)("Font size","generatepress"),unitValue:a.fontSizeUnit,units:["px","em","rem","%"],onChangeUnit:function(e){t("fontSizeUnit",e,a.index)},step:sr(a,"fontSize","step",1),rangeMin:sr(a,"fontSize","min",1),rangeMax:sr(a,"fontSize","max",100),inputMin:0,desktopValue:a.fontSize,desktopInitial:or(a,"fontSize"),desktopOnChange:function(e){t("fontSize",e,a.index)},tabletValue:a.fontSizeTablet,tabletInitial:or(a,"fontSizeTablet"),tabletOnChange:function(e){t("fontSizeTablet",e,a.index)},mobileValue:a.fontSizeMobile,mobileInitial:or(a,"fontSizeMobile"),mobileOnChange:function(e){t("fontSizeMobile",e,a.index)}})},Br=function(e){var a=e.font,t=e.onChange;return Object(n.createElement)(Ir,{label:Object(g.__)("Line Height","generatepress"),unitValue:a.lineHeightUnit,units:["","px","em","rem"],onChangeUnit:function(e){t("lineHeightUnit",e,a.index)},step:sr(a,"lineHeight","step",.1),rangeMin:sr(a,"lineHeight","min",1),rangeMax:sr(a,"lineHeight","max",5),inputMin:0,desktopValue:a.lineHeight,desktopInitial:or(a,"lineHeight"),desktopOnChange:function(e){t("lineHeight",e,a.index)},tabletValue:a.lineHeightTablet,tabletInitial:or(a,"lineHeightTablet"),tabletOnChange:function(e){t("lineHeightTablet",e,a.index)},mobileValue:a.lineHeightMobile,mobileInitial:or(a,"lineHeightMobile"),mobileOnChange:function(e){t("lineHeightMobile",e,a.index)}})},Lr=function(e){var a=e.font,t=e.onChange;return Object(n.createElement)(Ir,{label:Object(g.__)("Letter Spacing","generatepress"),unitValue:a.letterSpacingUnit,units:["px","em","rem"],onChangeUnit:function(e){t("letterSpacingUnit",e,a.index)},step:sr(a,"letterSpacing","step",.01),rangeMin:sr(a,"letterSpacing","min",-1),rangeMax:sr(a,"letterSpacing","max",10),desktopValue:a.letterSpacing,desktopInitial:or(a,"letterSpacing"),desktopOnChange:function(e){t("letterSpacing",e,a.index)},tabletValue:a.letterSpacingTablet,tabletInitial:or(a,"letterSpacingTablet"),tabletOnChange:function(e){t("letterSpacingTablet",e,a.index)},mobileValue:a.letterSpacingMobile,mobileInitial:or(a,"letterSpacingMobile"),mobileOnChange:function(e){t("letterSpacingMobile",e,a.index)}})},Fr=function(e){var a=e.font,t=e.onChange;return Object(n.createElement)(Ir,{label:"body"===a.selector?Object(g