File manager - Edit - /home/palg2351/public_html/wp-content/plugins/jetformbuilder/modules/jet-style/assets/build/editor.js
Back
(()=>{"use strict";const{useBlockEditContext:e}=wp.blockEditor,{useSelect:t}=wp.data,o=function(){const{clientId:o,name:n}=e();return t((e=>{const{supports:t}=e("core/blocks").getBlockType(n);return t.hasOwnProperty("jetStyle")?t.jetStyle:{}}),[o])},{get:n}=window._;function l(){this.cssVar="",this.path=[]}l.prototype={isSupported:e=>!0,compileDeclarations(e,t,o){const l=n(e,this.path);l&&(t[this.cssVar]=l)},compileClassNames(e,t){if(!this.hasHoverPath()||!n(t,this.path))return;const o=this.path.slice(1);e.push("has-hover-"+o.join("-"))},hasHoverPath(){return this.path[0].includes(":hover")},setCssVar(e){return this.cssVar=e,this},setPath(e){return this.path=e,this}};const s=l,{get:r}=window._,{isEmpty:a}=JetFBActions,i=["top","right","bottom","left"];function c(){s.call(this),this.isSupported=function(e){return"border"===e.at(-1)},this.compileDeclarations=function(e,t,o){const n=r(e,this.path);if(a(n))return;const l=this.hasHoverPath();["style","width","color"].forEach((e=>{const s=this.getSideValue(n,"top",e);s&&(t[this.getTopVar(e)]=s);const r=this.getSideValue(n,"right",e);r&&(t[this.getRightVar(e)]=r);const a=this.getSideValue(n,"bottom",e);a&&(t[this.getBottomVar(e)]=a);const i=this.getSideValue(n,"left",e);i&&(t[this.getLeftVar(e)]=i),l&&[s,r,a,i].filter(Boolean).length&&o.push(`has-hover-border-${e}`)}))},this.compileClassNames=()=>{}}c.prototype=Object.create(s.prototype),c.prototype.getTopVar=function(e){return`${this.cssVar}-top-${e}`},c.prototype.getRightVar=function(e){return`${this.cssVar}-right-${e}`},c.prototype.getBottomVar=function(e){return`${this.cssVar}-bottom-${e}`},c.prototype.getLeftVar=function(e){return`${this.cssVar}-left-${e}`},c.prototype.isLinked=function(e){const[t]=Object.keys(e);return i.includes(t)},c.prototype.getSideValue=function(e,t,o){if(!i.includes(t))return"";let n="";var l,s;return n=this.isLinked(e)?null!==(l=e[t]?.[o])&&void 0!==l?l:"":null!==(s=e[o])&&void 0!==s?s:"",n.trim()};const u=c,{get:p}=window._,{isEmpty:d}=JetFBActions;function h(){s.call(this),this.isSupported=function(e){return"border"===e.at(1)&&"radius"===e.at(-1)},this.compileDeclarations=function(e,t,o){const n=p(e,this.path);if(d(n))return;const l=this.getTopLeft(n);l&&(t[`${this.cssVar}-top-left`]=l);const s=this.getTopRight(n);s&&(t[`${this.cssVar}-top-right`]=s);const r=this.getBottomRight(n);r&&(t[`${this.cssVar}-bottom-right`]=r);const a=this.getBottomLeft(n);a&&(t[`${this.cssVar}-bottom-left`]=a)}}h.prototype=Object.create(s.prototype),h.prototype.isLinked=function(e){const[t]=Object.keys(e);return["topLeft","topRight","bottomLeft","bottomRight"].includes(t)},h.prototype.getTopLeft=function(e){return this.isLinked(e)?e?.topLeft:e},h.prototype.getTopRight=function(e){return this.isLinked(e)?e?.topRight:e},h.prototype.getBottomLeft=function(e){return this.isLinked(e)?e?.bottomLeft:e},h.prototype.getBottomRight=function(e){return this.isLinked(e)?e?.bottomRight:e};const m=h,{get:f}=window._,{isEmpty:b}=JetFBActions,y=["top","right","bottom","left"];function g(){s.call(this),this.isSupported=function(e){return["padding","margin"].includes(e.at(-1))},this.compileDeclarations=function(e,t){const o=f(e,this.path);if(!b(o))for(const e of y)t[`${this.cssVar}-${e}`]=this.getSideValue(e,o).trim()},this.compileClassNames=()=>{}}g.prototype=Object.create(s.prototype),g.prototype.getSideValue=function(e,t){var o;return"string"==typeof t?t:null!==(o=t[e])&&void 0!==o?o:""};const V=[new g,new m,new u,new s];function w(e){for(const t of V)if(t.isSupported(e))return t;throw new Error("Something went wrong")}const{useMemo:C}=wp.element,{useBlockAttributes:S}=JetFBHooks,{set:B}=JetFBActions,E=function(e,t){var o;const n=null!==(o=e?.style)&&void 0!==o?o:{},{get:l}=window._;return[l(n,t),e=>B(JSON.parse(JSON.stringify(n)),t,e)]},{useBlockAttributes:k}=JetFBHooks,_=window.React,{createContext:F}=wp.element,I=F({setCssVars:null}),{useBlockEditContext:x}=wp.blockEditor,{__:v}=wp.i18n;let{__experimentalToolsPanel:A,ToolsPanel:P}=wp.components;const{useCallback:j}=wp.element,{useInstanceId:O}=wp.compose;P=P||A;const{useBlockAttributes:J}=JetFBHooks,{createContext:T}=wp.element,D=T({panelId:null,resetAllFilter:null,onDeselect:null,hasValue:null,cssValue:null,updateCss:null,path:null}),{useContext:L,useMemo:R,useCallback:$}=wp.element,{useBlockAttributes:N}=JetFBHooks,H=function({cssVar:e,defaultValue:t,children:n}){const{panelId:l}=L(I),s=(d=e,null!==(h=o()[d])&&void 0!==h?h:[]),[r,a]=N(),[i,c]=R((()=>E(r,s)),[r]),u=$((e=>{const t=c(e);a({...r,style:t})}),[r]),p=(e,o)=>{const[,n]=E(e,s);return{...e,style:n(null!=o?o:t)}};var d,h;return(0,_.createElement)(D.Provider,{value:{panelId:l,onDeselect:function(e){a(p(r,e))},hasValue:function(){const[e]=E(r,s);return e!==t},cssValue:i,updateCss:u,resetAllFilter:p,path:s}},n)};let{__experimentalToolsPanelItem:G,ToolsPanelItem:M}=wp.components;M=M||G;const{useContext:U}=wp.element;function z(e){const{panelId:t,resetAllFilter:o,onDeselect:n,hasValue:l}=U(D);return(0,_.createElement)(M,{panelId:t,resetAllFilter:o,onDeselect:n,hasValue:l,...e})}const W=function({cssVar:e,defaultValue:t,...o}){return(0,_.createElement)(H,{cssVar:e,defaultValue:t},(0,_.createElement)(z,{...o}))};let{__experimentalColorGradientSettingsDropdown:q,ColorGradientSettingsDropdown:K,__experimentalUseMultipleOriginColorsAndGradients:Q,useMultipleOriginColorsAndGradients:X}=wp.blockEditor;const{useContext:Y}=wp.element,{__:Z}=wp.i18n;function ee({label:e}){const{panelId:t,resetAllFilter:o,cssValue:n,updateCss:l}=Y(D),s=X(),r=[{colorValue:n,onColorChange:l,label:null!=e?e:Z("Color","jet-form-builder"),resetAllFilter:o}];return(0,_.createElement)(K,{__experimentalIsRenderedInSidebar:!0,settings:r,panelId:t,...s,gradients:[],disableCustomGradients:!0})}K=K||q,X=X||Q;const{useContext:te}=wp.element;let{__experimentalBorderBoxControl:oe,BorderBoxControl:ne,__experimentalToolsPanelItem:le,ToolsPanelItem:se}=wp.components;se=se||le,ne=ne||oe;let{__experimentalUseMultipleOriginColorsAndGradients:re,useMultipleOriginColorsAndGradients:ae}=wp.blockEditor;function ie({enableAlpha:e=!1,enableStyle:t=!0,label:o="",labelForControl:n=""}){const{cssValue:l,updateCss:s,onDeselect:r,hasValue:a,...i}=te(D),{colors:c}=ae();return(0,_.createElement)(se,{label:o,onDeselect:function(){const e=l?.hasOwnProperty?.("radius")?{radius:l.radius}:{};r(e)},hasValue:function(){if("object"!=typeof l)return!1;const[e]=Object.keys(l);return["top","left","right","bottom","color","width","style"].includes(e)},...i},(0,_.createElement)(ne,{label:n,colors:c,onChange:e=>{const t=l?.hasOwnProperty?.("radius")?{...e,radius:l.radius}:e;s(t)},enableAlpha:e,enableStyle:t,popoverOffset:40,popoverPlacement:"left-start",value:l,__experimentalIsRenderedInSidebar:!0}))}ae=ae||re;const{useContext:ce}=wp.element;let{__experimentalBorderRadiusControl:ue,BorderRadiusControl:pe}=wp.blockEditor;function de(){const{cssValue:e,updateCss:t}=ce(D);return(0,_.createElement)(pe,{values:e,onChange:t})}pe=pe||ue;const{useContext:he}=wp.element;let{__experimentalBoxControl:me,BoxControl:fe,__experimentalToolsPanelItem:be,ToolsPanelItem:ye}=wp.components;function ge({label:e="",labelForControl:t,sides:o=y}){const{cssValue:n,updateCss:l,onDeselect:s,hasValue:r,...a}=he(D);return(0,_.createElement)(ye,{label:e,onDeselect:s,hasValue:function(){if("object"!=typeof n)return!1;const[e]=Object.keys(n);return y.includes(e)},...a},(0,_.createElement)(fe,{label:null!=t?t:e,onChange:l,sides:o,value:n}))}ye=ye||be,fe=fe||me;const{getSupport:Ve}=JetFBActions,{useContext:we}=wp.element;let{__experimentalToolsPanelItem:Ce,ToolsPanelItem:Se}=wp.components;Se=Se||Ce;const{HeightControl:Be}=wp.blockEditor,{isEmpty:Ee}=JetFBActions;function ke({label:e="",labelForControl:t}){const{cssValue:o,updateCss:n,onDeselect:l,hasValue:s,...r}=we(D);return(0,_.createElement)(Se,{label:e,onDeselect:l,hasValue:()=>!Ee(o),...r},(0,_.createElement)(Be,{label:null!=t?t:e,onChange:n,value:o}))}const{addFilter:_e}=wp.hooks;_e("blocks.registerBlockType","jet-form-builder/jet-style-support",(function(e,t){return!Ve(e,"jetStyle")||e.attributes.hasOwnProperty("style")||(e.attributes={...e.attributes,style:{type:"object",default:{}}}),e})),window.JetFBComponents={...window.JetFBComponents,StylePanel:function e({label:t,children:o,...n}){const{clientId:l}=x(),s=O(e),[r,a]=J(),i=j((e=>{let t=JSON.parse(JSON.stringify(r));e.forEach((e=>{t=e(t)})),a(t)}),[l,r]);return(0,_.createElement)(P,{label:null!=t?t:v("Style panel","jet-form-builder"),resetAll:i,panelId:s+l,...n},(0,_.createElement)(I.Provider,{value:{panelId:s+l}},o))},StylePanelItem:W,StyleColorItem:function({cssVar:e,...t}){return(0,_.createElement)(H,{cssVar:e},(0,_.createElement)(ee,{...t}))},StyleColorItemsWrapper:function({children:e}){return(0,_.createElement)("div",{className:"color-block-support-panel__inner-wrapper"},e)},StyleBorderItem:function({cssVar:e,enableAlpha:t=!1,enableStyle:o=!0,label:n="Border",labelForControl:l=!1,defaultValue:s,...r}){return(0,_.createElement)(H,{cssVar:e,defaultValue:s},(0,_.createElement)(ie,{enableAlpha:t,enableStyle:o,label:n,labelForControl:l?n:"",...r}))},StyleBorderRadiusItem:function({cssVar:e,...t}){return(0,_.createElement)(W,{cssVar:e,...t},(0,_.createElement)(de,null))},StyleBox:function({cssVar:e,label:t="",labelForControl:o,sides:n=y,...l}){return(0,_.createElement)(H,{cssVar:e,defaultValue:{}},(0,_.createElement)(ge,{label:t,labelForControl:o,sides:n,...l}))},StyleSize:function({cssVar:e,label:t="",labelForControl:o,...n}){return(0,_.createElement)(H,{cssVar:e,defaultValue:""},(0,_.createElement)(ke,{label:t,labelForControl:o,...n}))}},window.JetFBHooks={...window.JetFBHooks,useJetStyle:function({style:e,className:t,...n}={}){const l=o(),[s]=S(),r=C((()=>function(e,t){const o={},n=[];for(const[l,s]of Object.entries(t)){const t=w(s).setCssVar(l).setPath(s);t.compileDeclarations(e,o,n),t.compileClassNames(n,e)}return{style:o,className:n.join(" ")}}(s?.style,l)),[s?.style,l]);return{style:{...r.style,...null!=e?e:{}},className:[t,r.className].filter(Boolean).join(" "),...n}},useJetStyleSupports:o,useStyle:function(e){var t;const[n,l]=k(),s=null!==(t=o()[e])&&void 0!==t?t:[];if(!s.length)return["",()=>{}];const[r,a]=E(n,s);return[r,e=>l({style:a(e)})]}}})();
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0.3 |
proxy
|
phpinfo
|
Settings