diff --git a/packages/builder-integrations/src/oxygen_builder.ts b/packages/builder-integrations/src/oxygen_builder.ts index 07a21ad..3b23913 100644 --- a/packages/builder-integrations/src/oxygen_builder.ts +++ b/packages/builder-integrations/src/oxygen_builder.ts @@ -1489,14 +1489,16 @@ interface Font { colorsWrapper.appendChild(main); const shades = - color.shades?.map((shade, index) => { - const darkColor = color.darkShades?.[index]?.value; - return this.createColorButton({ - variable: shade.name, - color: shade.value, - darkColor, - }); - }) ?? []; + color.isShades && color.shades + ? color.shades.map((shade, index) => { + const darkColor = color.darkShades?.[index]?.value; + return this.createColorButton({ + variable: shade.name, + color: shade.value, + darkColor, + }); + }) + : []; if (shades.length) { const title = document.createElement("div"); @@ -1514,14 +1516,16 @@ interface Font { } const tints = - color.tints?.map((tint, index) => { - const darkColor = color.darkTints?.[index]?.value; - return this.createColorButton({ - variable: tint.name, - color: tint.value, - darkColor, - }); - }) ?? []; + color.isTints && color.tints + ? color.tints.map((tint, index) => { + const darkColor = color.darkTints?.[index]?.value; + return this.createColorButton({ + variable: tint.name, + color: tint.value, + darkColor, + }); + }) + : []; if (tints.length) { const title = document.createElement("div"); diff --git a/packages/wp/Tests/HelperColorVariantsTest.php b/packages/wp/Tests/HelperColorVariantsTest.php new file mode 100644 index 0000000..6a28a3b --- /dev/null +++ b/packages/wp/Tests/HelperColorVariantsTest.php @@ -0,0 +1,169 @@ + json_encode( $GLOBALS['cf_test_preset'] ), + ); + } +} + +final class HelperColorVariantsTest extends TestCase { + protected function setUp(): void { + global $wpdb; + + $GLOBALS['cf_test_options'] = array( + 'core_framework_main' => array( + 'selected_id' => 'preset-id', + ), + ); + $GLOBALS['cf_test_preset'] = array( + 'styleSheetData' => array(), + 'modulesData' => array( + 'COLOR_SYSTEM' => array( + 'groups' => array( + array( + 'name' => 'Brand', + 'colors' => array( + array( + 'name' => 'secondary', + 'isShades' => false, + 'shades' => array( + array( + 'name' => 'secondary-d-4', + 'value' => '#000000', + ), + ), + 'isTints' => false, + 'tints' => array( + array( + 'name' => 'secondary-l-1', + 'value' => '#eeeeee', + ), + ), + 'gen' => array( 'bg', 'text', 'border' ), + ), + array( + 'name' => 'primary', + 'isShades' => true, + 'shades' => array( + array( + 'name' => 'primary-d-1', + 'value' => '#111111', + ), + ), + 'isTints' => true, + 'tints' => array( + array( + 'name' => 'primary-l-1', + 'value' => '#dddddd', + ), + ), + 'gen' => array( 'bg', 'text', 'border' ), + ), + array( + 'name' => 'neutral', + 'shades' => array( + array( + 'name' => 'neutral-d-1', + 'value' => '#222222', + ), + ), + 'tints' => array( + array( + 'name' => 'neutral-l-1', + 'value' => '#cccccc', + ), + ), + 'gen' => array( 'bg', 'text', 'border' ), + ), + ), + ), + ), + ), + ), + ); + $wpdb = new CoreFrameworkHelperColorVariantsTestDatabase(); + } + + public function testVariablesIncludeOnlyEnabledColorVariants(): void { + $variables = ( new Helper() )->getVariables( + array( + 'group_by_category' => false, + ) + ); + + $this->assertSame( + array( 'secondary', 'primary', 'primary-d-1', 'primary-l-1', 'neutral' ), + $variables + ); + } + + public function testGroupedVariablesIncludeOnlyEnabledColorVariants(): void { + $variables = ( new Helper() )->getVariablesGroupedByCategoriesAndGroups(); + + $this->assertSame( + array( 'secondary', 'primary', 'primary-d-1', 'primary-l-1', 'neutral' ), + $variables['colorStyles']['Brand'] + ); + } + + public function testClassNamesIncludeOnlyEnabledColorVariants(): void { + $class_names = ( new Helper() )->getClassNames( + array( + 'group_by_category' => false, + ) + ); + + $this->assertContains( 'bg-primary-d-1', $class_names ); + $this->assertContains( 'text-primary-l-1', $class_names ); + $this->assertNotContains( 'bg-secondary-d-4', $class_names ); + $this->assertNotContains( 'text-secondary-l-1', $class_names ); + $this->assertNotContains( 'border-neutral-d-1', $class_names ); + $this->assertNotContains( 'border-neutral-l-1', $class_names ); + } + + public function testGroupedClassNamesIncludeOnlyEnabledColorVariants(): void { + $class_names = ( new Helper() )->getClassNamesGroupedByCategoriesAndGroups(); + + $this->assertContains( 'bg-primary-d-1', $class_names['colorStyles']['Backgrounds'] ); + $this->assertContains( 'text-primary-l-1', $class_names['colorStyles']['Text Colors'] ); + $this->assertNotContains( 'bg-secondary-d-4', $class_names['colorStyles']['Backgrounds'] ); + $this->assertNotContains( 'text-secondary-l-1', $class_names['colorStyles']['Text Colors'] ); + $this->assertNotContains( 'border-neutral-d-1', $class_names['colorStyles']['Border Colors'] ); + $this->assertNotContains( 'border-neutral-l-1', $class_names['colorStyles']['Border Colors'] ); + } +} diff --git a/packages/wp/assets/public/js/oxygen_builder.js b/packages/wp/assets/public/js/oxygen_builder.js index 7e40516..68dd664 100644 --- a/packages/wp/assets/public/js/oxygen_builder.js +++ b/packages/wp/assets/public/js/oxygen_builder.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var ne=Object.defineProperty;var Q=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var Y=(A,I,M)=>I in A?ne(A,I,{enumerable:!0,configurable:!0,writable:!0,value:M}):A[I]=M,P=(A,I)=>{for(var M in I||(I={}))oe.call(I,M)&&Y(A,M,I[M]);if(Q)for(var M of Q(I))ie.call(I,M)&&Y(A,M,I[M]);return A};(()=>{const A=({selector:u,callback:e,options:t})=>{const n=new MutationObserver(e),s=document.querySelector(u);if(!s){S(`Target not found for selector: ${u}`);return}const o={childList:!0,subtree:!0};n.observe(s,P(P({},o),t))},I=u=>{const e={};for(const t in u){const n=u[t];if(!n)continue;const s=new Set;e[t]=Object.keys(n).reduce((o,i)=>{const r=n[i];return i==="Contextual variables"&&Array.isArray(r)?(o[i]=r,r.forEach(l=>s.add(l))):Array.isArray(r)&&(o[i]=r.filter(l=>!s.has(l)&&s.add(l))),o},{})}return e},M=(u,e=300)=>{let t,n,s;return function(){const o=arguments;if(!t){u.apply(this,o),s=Date.now(),t=!0;return}clearTimeout(n),n=setTimeout(()=>{Date.now()-s>=e&&(u.apply(this,o),s=Date.now())},Math.max(e-(Date.now()-s),0))}},Z=(u,e)=>u.find(t=>{var n;return(n=t.textContent)==null?void 0:n.trim().includes(e.family)}),_={theme_mode:"light",bricks_enable_dark_mode_preview:!0,bricks_enable_variable_dropdown:!0,bricks_variable_ui:!0,bricks_enable_variable_ui_auto_hide:!0,bricks_enable_variable_ui_hint:!0,bricks_apply_class_on_hover:!0,bricks_apply_variable_on_hover:!0,bricks_enable_variable_context_menu:!0,bricks_bem_generator:!0,oxygen_enable_variable_dropdown:!0,oxygen_enable_dark_mode_preview:!0,oxygen_enable_variable_ui_auto_hide:!0,oxygen_variable_ui:!0,oxygen_enable_variable_context_menu:!0,oxygen_enable_variable_ui_hint:!0,oxygen_apply_class_on_hover:!0,oxygen_enable_unit_and_value_preview:!0},z=["iframeScope.component.options[iframeScope.component.active.id]['model']['background-image']","iframeScope.component.options[iframeScope.component.active.id]['model']['icon-size']","iframeScope.fontsFilter","postsFilter","currentlyEditingFilter","iframeScope.iconFilter.title","iframeScope.component.options[iframeScope.component.active.id]['model']['z-index']","iframeScope.component.options[iframeScope.component.active.id]['model']['src']","iframeScope.component.options[iframeScope.component.active.id]['model']['rel']","iframeScope.component.options[iframeScope.component.active.id]['model']['url']","iframeScope.component.options[iframeScope.component.active.id]['model']['testimonial_photo']","iframeScope.component.options[iframeScope.component.active.id]['model']['pricing_box_price"],J=["iframeScope.component.options[iframeScope.component.active.id]['model']['title-*']","iframeScope.component.options[iframeScope.component.active.id]['model']['icon-*']","duration","url","speed","time","address","zoom"].map(u=>u.replace("*']","")),G=`.oxygen-control input[type="text"]:not(.ct-iris-colorpicker):not([ng-model*="shortcode"])${z.map(u=>`:not([ng-model="${u}"])`).join("")}${J.map(u=>`:not([ng-model*="${u}"])`).join("")}`,q=()=>{var u;return(u=window==null?void 0:window.core_framework_connector)!=null?u:_},y=u=>{var e,t;return(t=(e=q())==null?void 0:e[u])!=null?t:!1};let W;(t=>(t.DARK="cf-theme-dark",t.LIGHT="cf-theme-light"))(W||(W={}));const S=(u,...e)=>console.log(`[Core Framework] ${u}`,...e),F=()=>{var h,m,T;if(!y("oxygen_enable_dark_mode_preview"))return;const u=(m=(h=window==null?void 0:window.core_framework_connector)==null?void 0:h.theme_mode)!=null?m:"light",e="ct-artificial-viewport",t=document.querySelector(".oxygen-toolbar-panel"),n=document.createElement("div"),s="cf-theme-toggle-button",i=((T=window==null?void 0:window.localStorage)==null?void 0:T.getItem("cf-theme"))==="dark";if(!t){S("Left panel not found");return}n.classList.add("oxygen-toolbar-panel-toggle-button","cf-theme-toggle-button-builder");const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("fill","none"),r.setAttribute("stroke","currentColor"),r.setAttribute("stroke-width","1.5"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("viewBox","0 0 24 24"),r.style.display=i?"none":"block";const l=document.createElementNS("http://www.w3.org/2000/svg","path");l.setAttribute("d","M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"),r.appendChild(l),n.appendChild(r);const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("fill","none"),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","1.5"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("viewBox","0 0 24 24");const p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d","M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"),a.appendChild(p),a.style.display=i?"block":"none",n.appendChild(a),t.appendChild(n);const f=document.createElement("style");f.appendChild(document.createTextNode(` +"use strict";(()=>{var $=Object.defineProperty;var P=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var G=(A,I,M)=>I in A?$(A,I,{enumerable:!0,configurable:!0,writable:!0,value:M}):A[I]=M,K=(A,I)=>{for(var M in I||(I={}))ee.call(I,M)&&G(A,M,I[M]);if(P)for(var M of P(I))te.call(I,M)&&G(A,M,I[M]);return A};(()=>{const A=({selector:u,callback:e,options:t})=>{const n=new MutationObserver(e),i=document.querySelector(u);if(!i){S(`Target not found for selector: ${u}`);return}const o={childList:!0,subtree:!0};n.observe(i,K(K({},o),t))},I=u=>{const e={};for(const t in u){const n=u[t];if(!n)continue;const i=new Set;e[t]=Object.keys(n).reduce((o,s)=>{const r=n[s];return s==="Contextual variables"&&Array.isArray(r)?(o[s]=r,r.forEach(c=>i.add(c))):Array.isArray(r)&&(o[s]=r.filter(c=>!i.has(c)&&i.add(c))),o},{})}return e},M=(u,e=300)=>{let t,n,i;return function(){const o=arguments;if(!t){u.apply(this,o),i=Date.now(),t=!0;return}clearTimeout(n),n=setTimeout(()=>{Date.now()-i>=e&&(u.apply(this,o),i=Date.now())},Math.max(e-(Date.now()-i),0))}},W=(u,e)=>u.find(t=>{var n;return(n=t.textContent)==null?void 0:n.trim().includes(e.family)}),Q={theme_mode:"light",bricks_enable_dark_mode_preview:!0,bricks_enable_variable_dropdown:!0,bricks_variable_ui:!0,bricks_enable_variable_ui_auto_hide:!0,bricks_enable_variable_ui_hint:!0,bricks_apply_class_on_hover:!0,bricks_apply_variable_on_hover:!0,bricks_enable_variable_context_menu:!0,bricks_bem_generator:!0,oxygen_enable_variable_dropdown:!0,oxygen_enable_dark_mode_preview:!0,oxygen_enable_variable_ui_auto_hide:!0,oxygen_variable_ui:!0,oxygen_enable_variable_context_menu:!0,oxygen_enable_variable_ui_hint:!0,oxygen_apply_class_on_hover:!0,oxygen_enable_unit_and_value_preview:!0},Y=["iframeScope.component.options[iframeScope.component.active.id]['model']['background-image']","iframeScope.component.options[iframeScope.component.active.id]['model']['icon-size']","iframeScope.fontsFilter","postsFilter","currentlyEditingFilter","iframeScope.iconFilter.title","iframeScope.component.options[iframeScope.component.active.id]['model']['z-index']","iframeScope.component.options[iframeScope.component.active.id]['model']['src']","iframeScope.component.options[iframeScope.component.active.id]['model']['rel']","iframeScope.component.options[iframeScope.component.active.id]['model']['url']","iframeScope.component.options[iframeScope.component.active.id]['model']['testimonial_photo']","iframeScope.component.options[iframeScope.component.active.id]['model']['pricing_box_price"],Z=["iframeScope.component.options[iframeScope.component.active.id]['model']['title-*']","iframeScope.component.options[iframeScope.component.active.id]['model']['icon-*']","duration","url","speed","time","address","zoom"].map(u=>u.replace("*']","")),R=`.oxygen-control input[type="text"]:not(.ct-iris-colorpicker):not([ng-model*="shortcode"])${Y.map(u=>`:not([ng-model="${u}"])`).join("")}${Z.map(u=>`:not([ng-model*="${u}"])`).join("")}`,_=()=>{var u;return(u=window==null?void 0:window.core_framework_connector)!=null?u:Q},y=u=>{var e,t;return(t=(e=_())==null?void 0:e[u])!=null?t:!1};let N;(t=>(t.DARK="cf-theme-dark",t.LIGHT="cf-theme-light"))(N||(N={}));const S=(u,...e)=>console.log(`[Core Framework] ${u}`,...e),z=()=>{var h,m,T;if(!y("oxygen_enable_dark_mode_preview"))return;const u=(m=(h=window==null?void 0:window.core_framework_connector)==null?void 0:h.theme_mode)!=null?m:"light",e="ct-artificial-viewport",t=document.querySelector(".oxygen-toolbar-panel"),n=document.createElement("div"),i="cf-theme-toggle-button",s=((T=window==null?void 0:window.localStorage)==null?void 0:T.getItem("cf-theme"))==="dark";if(!t){S("Left panel not found");return}n.classList.add("oxygen-toolbar-panel-toggle-button","cf-theme-toggle-button-builder");const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("fill","none"),r.setAttribute("stroke","currentColor"),r.setAttribute("stroke-width","1.5"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("viewBox","0 0 24 24"),r.style.display=s?"none":"block";const c=document.createElementNS("http://www.w3.org/2000/svg","path");c.setAttribute("d","M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"),r.appendChild(c),n.appendChild(r);const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("fill","none"),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","1.5"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("viewBox","0 0 24 24");const p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d","M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"),a.appendChild(p),a.style.display=s?"block":"none",n.appendChild(a),t.appendChild(n);const f=document.createElement("style");f.appendChild(document.createTextNode(` .cf-theme-toggle-button-builder { background-color: var(--oxy-dark); cursor: pointer; @@ -15,7 +15,7 @@ fill: none; stroke: white; } - `)),t.appendChild(f);const C=L=>{var x;const b=(x=document.getElementById(e))==null?void 0:x.contentDocument;if(!b){S("Iframe document not found");return}[...b.querySelectorAll(`.${s}`)].forEach(E=>{E.classList.add(L==="dark"?"cf-theme-dark":"cf-theme-light"),E.classList.remove(L==="dark"?"cf-theme-light":"cf-theme-dark")})},d=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"cf-theme-dark":"cf-theme-light",c=document.getElementById(e);c==null||c.addEventListener("load",()=>setTimeout(()=>{var k,V;const L=(k=c==null?void 0:c.contentDocument)==null?void 0:k.querySelector("html"),b=document.querySelector("html");if(!L){S("Iframe html not found");return}L.classList.remove("cf-theme-dark","cf-theme-light");const x=(V=window==null?void 0:window.localStorage)==null?void 0:V.getItem("cf-theme"),E=String(u==="auto"?d:`cf-theme-${u}`);L.classList.add(x?`cf-theme-${x}`:E),b==null||b.classList.add(x?`cf-theme-${x}`:E)},5)),n.addEventListener("click",()=>{var K,v,w;const L=(K=document.getElementById(e))==null?void 0:K.contentDocument;if(!L){S("Iframe document not found");return}const b=L.querySelector("html");if(!b){S("Iframe html not found");return}const E=((v=window==null?void 0:window.localStorage)==null?void 0:v.getItem("cf-theme"))==="dark";E?(b.classList.remove("cf-theme-dark"),b.classList.add("cf-theme-light")):(b.classList.remove("cf-theme-light"),b.classList.add("cf-theme-dark"));const k=document.querySelector("html");k==null||k.classList.toggle("cf-theme-dark"),k==null||k.classList.toggle("cf-theme-light");const V=n.querySelector("svg:first-child"),B=n.querySelector("svg:last-child"),U=b.classList.contains("cf-theme-dark");V&&(V.style.display=E?"block":"none"),B&&(B.style.display=E?"none":"block"),C(E?"dark":"light"),(w=window==null?void 0:window.localStorage)==null||w.setItem("cf-theme",E?"light":"dark")})},H=(u,e)=>{const n=document.getElementById("ct-artificial-viewport"),s=n==null?void 0:n.contentDocument;if(!s){S("Iframe document not found");return}const i=s.querySelector(".ct-active");if(!i){S("Active element not found");return}e==="add"?i.classList.add(u):i.classList.remove(u)},D=(u,e)=>{const t=u==null?void 0:u.closest(".oxygen-color-picker"),n=t==null?void 0:t.querySelector(".button.wp-color-result");n&&(n.style.backgroundColor=e)},j=()=>{if(!y("oxygen_apply_class_on_hover"))return;const u=n=>{setTimeout(()=>{H(n,"add")},5)};A({selector:"#oxygen-sidebar",callback:M(()=>{document.querySelectorAll(".oxygen-classes-dropdown .oxygen-classes-suggestions li").forEach(s=>{var i;const o=(i=s.children[1])==null?void 0:i.textContent;if(!o){S("Second child text content not found");return}s.removeEventListener("click",()=>u(o)),s.addEventListener("click",()=>u(o)),s.removeEventListener("mouseenter",()=>H(o,"add")),s.addEventListener("mouseenter",()=>H(o,"add")),s.removeEventListener("mouseleave",()=>H(o,"remove")),s.addEventListener("mouseleave",()=>H(o,"remove"))})},100)})};class X{constructor(){this.variables=[];this.variablesGroups={};this.colorVariables=[];this.init()}async init(){if(!y("oxygen_enable_variable_dropdown")||!await this.getVariables())return;["#oxygen-sidebar-control-panel-basic-styles",".oxygen-select","#oxygen-sidebar",".oxygen-sidebar-advanced-home"].forEach(s=>{A({selector:s,callback:()=>{this.setVariableAutocomplete()},options:{subtree:!1,childList:!1,attributes:!0}})}),A({selector:".oxygen-active-element-name",callback:()=>{this.setVariableAutocomplete()},options:{subtree:!0,childList:!0,attributes:!1}}),this.setVariableAutocomplete()}filterVariables(e){return this.variables.filter(t=>t.toLocaleLowerCase().includes(e.toLocaleLowerCase())&&t!==e)}sortVariables(e){var r;const n=["padding","margin","gap","width","height"].some(l=>String(e.dataset.option).includes(l)),s=(r=e.parentElement)==null?void 0:r.classList.contains("oxygen-color-picker"),o=e.dataset.option==="font-size";let i=[];for(let[l,a]of Object.entries(this.variablesGroups)){if(a=typeof a=="object"?Object.values(a):a,s&&l==="colorStyles"){i=[...a];break}if(l!=="colorStyles"){if(o&&l==="typographyStyles"&&o){i.unshift(...a);continue}if(o&&l==="typographyStyles"&&!o){i.push(...a);continue}if(n&&l==="spacingStyles"&&n){i.unshift(...a);continue}if(n&&l==="spacingStyles"&&!n){i.push(...a);continue}i.push(...a)}}return i=i.map(l=>`var(--${l})`),this.variables=i,i}emitInputEvent(e,t){e.value=t,e.dispatchEvent(new Event("input"))}setUnitToNone(e){var t;try{const n=(t=e.previousElementSibling)!=null&&t.classList.contains("oxygen-color-picker-color")?"color":e.getAttribute("data-option");window==null||window.$scope.iframeScope.setOptionUnit(n," ")}catch(n){}}createDropdown({options:e,target:t}){var f,g,C;document.querySelectorAll(".cf-variable-dropdown").forEach(d=>{d==null||d.remove()}),t!=null&&t.parentElement&&(t.parentElement.style.position="relative");const n=document.createElement("div"),s=()=>{y("oxygen_enable_unit_and_value_preview")&&this.setUnitToNone(t)};n.addEventListener("mouseenter",s),["cf-variable-dropdown"].forEach(d=>n.classList.add(d));const o=document.createElement("ul");if(y("oxygen_enable_variable_ui_hint")&&y("oxygen_variable_ui")){const d=document.createElement("div");d.classList.add("cf-variable-dropdown-hint"),d.classList.add("variable-dropdown-item"),d.textContent=`${(f=navigator==null?void 0:navigator.platform)!=null&&f.toUpperCase().includes("MAC")?"\u2318":"Alt"} + Click to open variable UI`,d.style.padding="4px 10px",d.style.color="white",d.style.opacity="0.7",d.style.fontSize="12px",n.appendChild(d)}e.forEach(d=>{const c=document.createElement("li");c.textContent=d,c.setAttribute("tabindex","0"),c.setAttribute("role","option"),c.dataset.type="variable-dropdown-item",c.dataset.value=d;let h="";if(setTimeout(()=>{c.addEventListener("mouseenter",m=>{y("oxygen_enable_unit_and_value_preview")&&(h=t.value,this.emitInputEvent(t,d))}),c.addEventListener("mouseleave",m=>{y("oxygen_enable_unit_and_value_preview")&&(this.emitInputEvent(t,h),h="")})},5),this.colorVariables.includes(d)){const m=document.createElement("span");m.style.backgroundColor=d,c.prepend(m)}o.appendChild(c)}),n.appendChild(o),(g=t.parentElement)==null||g.appendChild(n);const r=n.querySelectorAll("li");(C=t==null?void 0:t.parentElement)==null||C.querySelectorAll("li").forEach(d=>{d.addEventListener("mouseEnter",()=>{y("oxygen_enable_unit_and_value_preview")&&(d.classList.add("selected"),t.value=d.dataset.value||l,t.dispatchEvent(new Event("input")))}),d.addEventListener("mouseLeave",()=>{y("oxygen_enable_unit_and_value_preview")&&(d.classList.remove("selected"),t.value=l,t.dispatchEvent(new Event("input")))})});const l=t.value;let a=-1;const p=d=>{a=d,r.forEach((c,h)=>{if(h===a){c.classList.add("selected");return}c.classList.remove("selected")})};t.addEventListener("keydown",d=>{switch(d.key){case"Escape":{if(!r[a])return;this.emitInputEvent(t,l||""),t.focus();break}case"ArrowDown":{if(d.preventDefault(),a===-1){p(0);return}if(a===r.length-1)return;p(a+1);const c=r[a];if(!c)return;n.scrollTop=c.offsetTop-n.clientHeight+c.clientHeight;const h=r[a];if(!h)return;const m=h.dataset.value;if(!m)return;this.setUnitToNone(t),this.emitInputEvent(t,m),t.focus();break}case"ArrowUp":{if(d.preventDefault(),a===-1){p(r.length-1);return}if(a===0)return;p(a-1);const c=r[a];if(!c)return;n.scrollTop=c.offsetTop-n.clientHeight+c.clientHeight;const h=r[a];if(!h)return;const m=h.dataset.value;if(!m)return;this.setUnitToNone(t),this.emitInputEvent(t,m),t.focus();break}case"Enter":{if(d.preventDefault(),a===-1)return;const c=r[a];if(!c)return;const h=c.dataset.value;if(!h)return;this.emitInputEvent(t,h),t.focus(),document.querySelectorAll(".cf-variable-dropdown").forEach(m=>{m==null||m.remove()}),this.setUnitToNone(t),D(t,h);break}}})}onClick(e){if(!e.isTrusted||e!=null&&e.metaKey||e!=null&&e.altKey)return;const t=e.target;this.sortVariables(t);const n=this.filterVariables(t.value);n.length&&this.createDropdown({options:n,target:t})}onType(e){if(!e.isTrusted||e!=null&&e.metaKey||e!=null&&e.altKey)return;const t=e.target,n=t.value,s=this.filterVariables(n);s.length&&this.createDropdown({options:s,target:t})}onInputBlur(e){var l;document.querySelectorAll(".cf-variable-dropdown").forEach(a=>{a==null||a.remove()}),document.querySelectorAll('.oxygen-control input[type="text"]').forEach(a=>{a.removeEventListener("click",this.onInputFocus),a.removeEventListener("blur",this.onInputBlur)});const n=e.relatedTarget;if(!n||!(n.dataset.type==="variable-dropdown-item"))return;const o=n.dataset.value,i=e==null?void 0:e.target;if(!i||!o)return;e.preventDefault(),e.stopPropagation(),i.value=o,i.dispatchEvent(new Event("input")),i.focus();const r=(l=i.previousElementSibling)!=null&&l.classList.contains("oxygen-color-picker-color")?"color":i.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(i,o)}setVariableAutocomplete(){document.querySelectorAll(".cf-variable-dropdown").forEach(n=>{n==null||n.remove()}),document.querySelectorAll(G).forEach(n=>{n.removeEventListener("click",this.onClick.bind(this)),n.removeEventListener("focusout",this.onInputBlur.bind(this)),n.removeEventListener("input",this.onType.bind(this)),n.addEventListener("click",this.onClick.bind(this)),n.addEventListener("focusout",this.onInputBlur.bind(this)),n.addEventListener("input",this.onType.bind(this))})}async getVariables(){var e;window.coreframework={nonce:window.wpApiSettings.nonce,rest_url:window.wpApiSettings.root,core_api_url:`${window.wpApiSettings.root}core-framework/v2/`};try{const t=await fetch(`${window.coreframework.core_api_url}get-variables?type=oxygen_dropdown`,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":window.coreframework.nonce}});if(t.status!==200)return S("Failed to load variables."),!1;const n=await t.json();return n!=null&&n.variables?(this.variablesGroups=n.variables,this.colorVariables=((e=this.variablesGroups.colorStyles)!=null?e:[]).map(s=>`var(--${s})`),!0):(S("No variables found. Please save changes again in the Core Framework plugin."),!1)}catch(t){return S("Failed to load variables."),console.error(t),!1}}}class ${constructor(){this.variables={};this.colorSystemData=null;this.variablePrefix="";this.fluid_typography_naming_convention=null;this.fluid_spacing_naming_convention=null;this.instance=null;this.focusedInput=null;this.tempInputValue=null;this.isOpen=!1;this.stylesGroupsLabelMap={colorStyles:"Colors",typographyStyles:"Typography",spacingStyles:"Spacing",layoutsStyles:"Layouts",designStyles:"Design",componentsStyles:"Components",otherStyles:"Other"};this.logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJUAAAB1CAYAAABH5qPNAAAACXBIWXMAAAhOAAAITgGMMQDsAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAChHSURBVHgB7V3tr2ZXVV9rP3daWkEHE+Mn7YXEDyQmjH9B76AkIBpK8IUYY6cJYCVohzdFY9Ki0WBiwhD9UNDQCyIS/QAaE78YGfSTiUmngICgzIW2lLaUTt+n997nLPfea/3WWvvc2zL0de69z27vPM9zXvbeZ+/f/q3fWnufc5gOcDp9i6xfsbs8Ma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GTFxcnaDZvDA9f8e7jrWaDDnkHj8GgGKV4WQCan2E0g2d0/ertYPCkwrZPiMJNaD79Rw1ZeDAzFwVS6tCYE+1FMl8Xy/Aauv7n1yhvWSF5RGWmzdseWhwz6wzsE0zv93Tjo+cY9k7Dk7gMvIUjKABQFE2qQXEMZiC0l2hEeM6QGPrtjmWk2LwiHIQHQyzmqwc/Ldjj9+o1PbCxKuX4S2ah9fw155wvFiywlReUVdRqxt5v1TG/p8udJzxe/r0/Y71uUXDQeK0Mo7KlrKa7p9Kef1D8qtb5m8y+vOktHLB0Iju4AWyzeOE3Tidp/G/P9fhEKmj7XiKe19ASFxi7u080/5LYtN4ZNegPGOovJ+K6AHJ9WE3qvA7nnWU4eRVAdCIbuT04mfX9Oe8zR7sWLJ9YKv7oKp43ac+u1B0+g4111wWdzEcUhsUyMi2RSGiAVwk7zknAviXw5DtlkwOAksoR0O5rp0KjJBjbavXii6p/jVXgdp7J2jT7BrN1qX2b9O9829TVa06TbSv09NR3Vjiuq40qXn217+066v0z6fl89qT97vh9l+6ZSNjfPXLVFq7RKq/Ts0v8D4+WejbzFd30AAAAASUVORK5CYII=";this.init(),this.boundOnClickCallback=this.onClickCallback.bind(this)}async init(){if(!y("oxygen_variable_ui")||!await this.getVariables())return;["#oxygen-sidebar-control-panel-basic-styles",".oxygen-select","#oxygen-sidebar",".oxygen-sidebar-advanced-home"].forEach(n=>{A({selector:n,callback:()=>{this.addTriggers()},options:{subtree:!1,childList:!1,attributes:!0}})}),A({selector:".oxygen-active-element-name",callback:()=>{this.addTriggers()},options:{subtree:!0,childList:!0,attributes:!1}}),this.createInstance()}createVarButton({variable:e,label:t,color:n,transparent:s}){const o=document.createElement("button");if(o.classList.add("cf-variable-ui-list-item"),o.dataset.cftooltip=`var(--${e})`,o.textContent=t!=null?t:e,n){const i=document.createElement("span");i.style.backgroundColor=n,s&&(i.style.opacity=(s/100).toString()),o.prepend(i)}return o.addEventListener("click",()=>{var l;if(!this.focusedInput)return;const i=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=i,this.tempInputValue=i,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(l=this.focusedInput.previousElementSibling)!=null&&l.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,i),y("oxygen_enable_variable_ui_auto_hide")&&this.close()}),o.addEventListener("mouseenter",()=>{var l;if(!this.focusedInput||!y("oxygen_enable_unit_and_value_preview"))return;const i=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=i,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(l=this.focusedInput.previousElementSibling)!=null&&l.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,i)}),o.addEventListener("mouseleave",()=>{var r;if(!this.focusedInput||this.tempInputValue===null||!y("oxygen_enable_unit_and_value_preview"))return;this.focusedInput.value=this.tempInputValue,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const i=(r=this.focusedInput.previousElementSibling)!=null&&r.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(i," ")}catch(l){}D(this.focusedInput,this.tempInputValue)}),o}getPrefixedVariableName(e){return e.startsWith(this.variablePrefix)?e:`${this.variablePrefix}${e}`}createColorButton({variable:e,color:t,darkColor:n,transparent:s}){e=this.getPrefixedVariableName(e);const o=document.createElement("button");if(o.dataset.cftooltip=`var(--${e})`,o.classList.add("cf-variable-ui-list-item-color"),t){if(s!==void 0){o.style.padding="0";const i=document.createElement("div");i.style.setProperty("--cf-variable-ui-color",t),i.style.setProperty("--cf-variable-ui-color-dark",n!=null?n:t),i.style.opacity=(s/100).toString(),i.style.width="100%",i.style.height="100%",o.appendChild(i)}s===void 0&&(o.style.setProperty("--cf-variable-ui-color",t),o.style.setProperty("--cf-variable-ui-color-dark",n!=null?n:t))}return o.addEventListener("click",()=>{var l;if(!this.focusedInput)return;const i=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=i,this.tempInputValue=i,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(l=this.focusedInput.previousElementSibling)!=null&&l.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,i),y("oxygen_enable_variable_ui_auto_hide")&&this.close()}),o.addEventListener("mouseenter",()=>{var l;if(!this.focusedInput||!y("oxygen_enable_unit_and_value_preview"))return;const i=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=i,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(l=this.focusedInput.previousElementSibling)!=null&&l.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,i)}),o.addEventListener("mouseleave",()=>{var r;if(!this.focusedInput||this.tempInputValue===null||!y("oxygen_enable_unit_and_value_preview"))return;this.focusedInput.value=this.tempInputValue,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const i=(r=this.focusedInput.previousElementSibling)!=null&&r.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(i," ")}catch(l){}D(this.focusedInput,this.tempInputValue)}),o}createCategoryTitle(e){const t=document.createElement("div");t.classList.add("cf-variable-ui-category-title");const n=document.createElement("b");n.textContent=e,t.appendChild(n);const s=document.createElement("button");return s.classList.add("cf-variable-ui-section-toggle"),t.appendChild(s),t}allowDrag(e){const t=e.querySelector("#cf-variable-ui-header");if(!t)return;let n=!1,s=0,o=0;const i=a=>{[...document.querySelectorAll("iframe")].forEach(f=>{f.style.pointerEvents="none",f.style.userSelect="none"}),n=!0;const p=t.getBoundingClientRect();s=a.clientX-p.left,o=a.clientY-p.top,t&&(t.style.transition="none")};t.addEventListener("mousedown",i);const r=a=>{if(!n)return;const p=t.getBoundingClientRect(),f=a.clientX,g=a.clientY,C=f-s,d=g-o,c=(C<0?0:C>window.innerWidth-p.width?window.innerWidth-p.width:C)+10,h=d<0?0:d>window.innerHeight-p.height?window.innerHeight-p.height:d;e.style.left=`${c}px`,e.style.top=`${h}px`};document.addEventListener("mousemove",r);const l=a=>{[...document.querySelectorAll("iframe")].forEach(p=>{p.style.pointerEvents="auto",p.style.userSelect="auto"}),n=!1};document.addEventListener("mouseup",l)}createExpandableWrapper({title:e}){const t="cf-variable-ui-wrapper",n=document.createElement("div");n.dataset.groupExpand="false",n.classList.add(t);const s=this.createCategoryTitle(e);return s.addEventListener("click",()=>{n.dataset.groupExpand=n.dataset.groupExpand==="true"?"false":"true"}),n.appendChild(s),n}createInstance(){var a,p;const e=document.createElement("cf-variable-ui");e.classList.add("cf-variable-ui"),e.classList.add("is-oxygen"),e.style.position="fixed",e.style.display="none",e.style.width="300px",e.style.height="500px",e.style.zIndex="1000",e.style.left=`${(window.innerWidth/2-200).toString()}px`,e.style.top=`${(window.innerHeight/2-300).toString()}px`;const t=document.createElement("div");t.id="cf-variable-ui-header",t.style.width="100%";const n=document.createElement("img");n.src=this.logoData,n.classList.add("cf-variable-ui-logo"),n.style.setProperty("width","30px");const s=document.createElement("a");s.href=`${new URL(window.location.href).origin}/wp-admin/admin.php?page=core-framework`,s.target="_blank",s.classList.add("cf-variable-ui-open-core-framework"),s.textContent="Open",s.dataset.cftooltip="Open Core Framework plugin";const o=document.createElement("button");o.innerHTML='',o.classList.add("cf-variable-ui-close-button"),o.dataset.cftooltip="Close",o.addEventListener("click",this.close.bind(this)),t.appendChild(n),t.appendChild(s),t.appendChild(o),e.appendChild(t);const i=(p=(a=this.colorSystemData)==null?void 0:a.groups)!=null?p:[],r=this.createExpandableWrapper({title:"Color System"});r.dataset.type="color-system",i.forEach(({colors:f,name:g,isDisabled:C})=>{if(C)return;const d=document.createElement("div");d.classList.add("cf-variable-ui-color-wrapper"),f.forEach(c=>{var E,k,V,B,U,K;const h=this.createColorButton({variable:c.name,color:c.value,darkColor:c.darkValue}),m=document.createElement("div"),T=document.createElement("div");T.classList.add("cf-variable-ui-color-title"),T.textContent=this.getPrefixedVariableName(c.name),T.style.setProperty("font-weight","bold"),m.classList.add("cf-variable-ui-color-wrapper-second"),m.appendChild(T),m.appendChild(h);const L=(k=(E=c.shades)==null?void 0:E.map((v,w)=>{var R,N;const O=(N=(R=c.darkShades)==null?void 0:R[w])==null?void 0:N.value;return this.createColorButton({variable:v.name,color:v.value,darkColor:O})}))!=null?k:[];if(L.length){const v=document.createElement("div");v.classList.add("cf-variable-ui-color-title"),v.textContent=`Shades of ${this.getPrefixedVariableName(c.name)}`;const w=document.createElement("div");w.classList.add("cf-variable-ui-shades-wrapper"),L.forEach(O=>{w.appendChild(O)}),m.appendChild(v),m.appendChild(w)}const b=(B=(V=c.tints)==null?void 0:V.map((v,w)=>{var R,N;const O=(N=(R=c.darkTints)==null?void 0:R[w])==null?void 0:N.value;return this.createColorButton({variable:v.name,color:v.value,darkColor:O})}))!=null?B:[];if(b.length){const v=document.createElement("div");v.classList.add("cf-variable-ui-color-title"),v.textContent=`Tints of ${this.getPrefixedVariableName(c.name)}`;const w=document.createElement("div");w.classList.add("cf-variable-ui-tints-wrapper"),b.forEach(O=>{w.appendChild(O)}),m.appendChild(v),m.appendChild(w)}const x=(K=(U=c.transparentVariables)==null?void 0:U.map(v=>this.createColorButton({variable:`${c.name}-${v}`,color:c.value,darkColor:c.darkValue,transparent:Number(v)})))!=null?K:[];if(x.length){const v=document.createElement("div");v.classList.add("cf-variable-ui-color-title"),v.textContent=`Transparent values of ${this.getPrefixedVariableName(c.name)}`;const w=document.createElement("div");w.classList.add("cf-variable-ui-transparent-wrapper"),x.forEach(O=>{w.appendChild(O)}),m.appendChild(v),m.appendChild(w)}d.appendChild(m)}),r.appendChild(d)});const l=document.createElement("div");l.classList.add("cf-variable-ui-scroll-container"),l.appendChild(r),Object.entries(this.variables).forEach(([f,g])=>{var c;if(Object.keys(g).length===0)return;const d=this.createExpandableWrapper({title:(c=this.stylesGroupsLabelMap[f])!=null?c:f});d.dataset.type=f,Object.entries(g).forEach(([h,m])=>{const T=E=>{if(h==="Fluid Typography"||h==="Fluid Spacing"){const k=this.variablePrefix+(h==="Fluid Typography"?this.fluid_typography_naming_convention:this.fluid_spacing_naming_convention)+"-";return E.replace(k,"")}return E},L=document.createElement("div"),b=document.createElement("b");b.textContent=h,b.classList.add("cf-variable-ui-row-title"),L.appendChild(b),L.classList.add("cf-variable-ui-group");const x=document.createElement("div");x.classList.add("cf-variable-ui-container"),m.forEach(E=>{const k=this.createVarButton({variable:E,label:T(E)});x.appendChild(k)}),L.appendChild(x),d.appendChild(L)}),l.appendChild(d)}),e.appendChild(l),document.body.appendChild(e),this.instance=e,this.allowDrag(e),setTimeout(()=>{this.reposition()},100)}open(){if(!this.instance)return;this.instance.style.setProperty("display","block"),this.isOpen=!0;const e=document.querySelector("html");e&&(e.dataset.cfVariableUiOpen="true")}close(){if(!this.instance)return;this.instance.style.setProperty("display","none"),this.isOpen=!1,this.tempInputValue=null;const e=document.querySelector("html");e&&(e.dataset.cfVariableUiOpen="false",[...document.querySelectorAll("iframe")].forEach(t=>{t.style.pointerEvents="auto",t.style.userSelect="auto"}))}async getVariables(){window.coreframework={nonce:window.wpApiSettings.nonce,rest_url:window.wpApiSettings.root,core_api_url:`${window.wpApiSettings.root}core-framework/v2/`};try{const e=await fetch(`${window.coreframework.core_api_url}builders-var-ui`,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":window.coreframework.nonce}});if(e.status!==200)return S("Failed to load variables."),!1;const t=await e.json();return t!=null&&t.variables?(this.variables=I(t.variables),t.color_system_data?(this.colorSystemData=t.color_system_data,this.variablePrefix=t.variable_prefix,this.fluid_typography_naming_convention=t.fluid_typography_naming_convention,this.fluid_spacing_naming_convention=t.fluid_spacing_naming_convention,!0):(S("No color system data found. Please save changes again in the Core Framework plugin."),!1)):(S("No variables found. Please save changes again in the Core Framework plugin."),!1)}catch(e){return S("Failed to load variables."),console.error(e),!1}}reposition(){this.instance&&(this.instance.style.top=`${(window.innerHeight/2-300).toString()}px`,this.instance.style.left="320px")}onClickCallback(e){var l;const t=e.type==="contextmenu"&&y("oxygen_enable_variable_context_menu");if(t&&(e.preventDefault(),e.stopPropagation()),!this.isOpen&&!(e!=null&&e.metaKey||e!=null&&e.altKey)&&!t)return;const n=e.target;if(!n)return;e.preventDefault(),e.stopPropagation(),this.focusedInput=n,this.tempInputValue=n.value;const s=(l=n.parentElement)==null?void 0:l.classList.contains("oxygen-color-picker"),o=n.dataset.option==="font-size",r=["padding","margin","gap","width","height"].some(a=>String(n.dataset.option).includes(a));if(this.instance){this.instance.dataset.enableColors=s?"true":"false";const a=this.instance.querySelector(".cf-variable-ui-wrapper[data-type='color-system']"),p=this.instance.querySelector(".cf-variable-ui-wrapper[data-type='typographyStyles']"),f=this.instance.querySelector(".cf-variable-ui-wrapper[data-type='spacingStyles']");for(const g of[a,p,f]){if(!g)return;g.dataset.groupExpand="false"}s&&a&&(a.dataset.groupExpand="true"),o&&p&&(p.dataset.groupExpand="true"),r&&f&&(f.dataset.groupExpand="true")}this.open(),document.querySelectorAll(".cf-variable-dropdown").forEach(a=>a==null?void 0:a.remove())}addTriggers(){document.querySelectorAll(".cf-variable-ui-trigger").forEach(n=>{n==null||n.remove()}),document.querySelectorAll(G).forEach(n=>{n.removeEventListener("click",this.boundOnClickCallback),n.addEventListener("click",this.boundOnClickCallback),y("oxygen_enable_variable_context_menu")&&(n==null||n.removeEventListener("contextmenu",this.boundOnClickCallback),n==null||n.addEventListener("contextmenu",this.boundOnClickCallback))});const e=n=>{var s;n.key==="Escape"&&((s=this.instance)==null?void 0:s.style.getPropertyValue("display"))==="block"&&this.close()};document.removeEventListener("keydown",e),document.addEventListener("keydown",e);const t=n=>{var s,o,i,r;this.isOpen&&!((s=this==null?void 0:this.instance)!=null&&s.contains(n.target))&&!((o=n.target)!=null&&o.classList.contains("cf-variable-ui-trigger"))&&!((r=(i=n.target)==null?void 0:i.parentElement)!=null&&r.classList.contains("cf-variable-ui-trigger"))&&this.close()};y("oxygen_enable_variable_ui_auto_hide")&&(document.removeEventListener("click",t),document.addEventListener("click",t))}}class ee{constructor(){this.fonts=[];this.init()}async init(){await this.setFonts();let e=new Map;A({selector:"#oxygen-sidebar",callback:t=>{if(!t.some(s=>[...s.addedNodes].some(o=>o.nodeType===Node.ELEMENT_NODE&&o.id==="core-subtitle"||o.id==="core-icon"))){const s=document.getElementById("oxygen-typography-font-family"),o=s==null?void 0:s.querySelector("input"),i=r=>{this.applyCoreOptionsView(r,!0)};s&&this.applyCoreOptionsView(s,!0),o&&!e.get(o)&&(o.addEventListener("input",()=>i(s)),e.set(o,()=>i(s)))}},options:{subtree:!0,childList:!0,attributes:!1}}),A({selector:"#oxygen-global-settings",callback:t=>{if(!t.some(s=>[...s.addedNodes].some(o=>o.nodeType===Node.ELEMENT_NODE&&o.id==="core-subtitle"||o.id==="core-icon"))){const s=document.querySelectorAll(".oxygen-control-global-font"),o=i=>{this.applyCoreOptionsView(i)};s.forEach(i=>{this.applyCoreOptionsView(i);const r=i.querySelector("input");r&&!e.get(r)&&(r.addEventListener("input",()=>o(i)),e.set(r,()=>o(i)))})}},options:{subtree:!0,childList:!0,attributes:!1}})}async setFonts(){window.coreframework={nonce:window.wpApiSettings.nonce,rest_url:window.wpApiSettings.root,core_api_url:`${window.wpApiSettings.root}core-framework/v2/`};try{const e=await fetch(`${window.coreframework.core_api_url}get-core-fonts`,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":window.coreframework.nonce}}),{fonts:t}=await e.json();this.fonts=t.filter(n=>n.enable)}catch(e){console.log(e)}}applyCoreOptionsView(e,t=!1){const n=Object.values(window.$scope.iframeScope.globalSettings.fonts)||[],s=window.core_yabe_fonts||[],o=e.querySelector(".oxygen-select-box-options"),i=e.querySelector("#core-subtitle");if(i==null||i.remove(),o&&this.fonts.length){const r=Array.from(o.children),l=document.createElement("div");let a=null,p=null;l.setAttribute("id","core-subtitle"),l.textContent="Core Framework",l.classList.add("oxygen-select-box-option"),Object.assign(l.style,{backgroundColor:"var(--oxy-dark)",fontWeight:700,letterSpacing:".2px",pointerEvents:"none",textTransform:"uppercase"}),this.fonts.forEach(f=>{var c,h;const g=Z(r,f),C=s.includes(f.family),d=o.querySelector("#core-subtitle");if(d&&d.remove(),g&&C&&(g.style.setProperty("border-bottom","none"),(c=g.querySelector("#core-icon"))==null||c.remove()),g&&!C){(!t||!n.includes(f.family))&&(a=g,!p&&(p=g)),g.style.setProperty("justify-content","space-between"),g.style.setProperty("border-bottom","none");const T=document.createElement("span");T.setAttribute("id","core-icon"),Object.assign(T.style,{width:"13px",height:"13px",padding:"0",background:"none"}),T.innerHTML=` + `)),t.appendChild(f);const C=L=>{var x;const b=(x=document.getElementById(e))==null?void 0:x.contentDocument;if(!b){S("Iframe document not found");return}[...b.querySelectorAll(`.${i}`)].forEach(E=>{E.classList.add(L==="dark"?"cf-theme-dark":"cf-theme-light"),E.classList.remove(L==="dark"?"cf-theme-light":"cf-theme-dark")})},d=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"cf-theme-dark":"cf-theme-light",l=document.getElementById(e);l==null||l.addEventListener("load",()=>setTimeout(()=>{var k,g;const L=(k=l==null?void 0:l.contentDocument)==null?void 0:k.querySelector("html"),b=document.querySelector("html");if(!L){S("Iframe html not found");return}L.classList.remove("cf-theme-dark","cf-theme-light");const x=(g=window==null?void 0:window.localStorage)==null?void 0:g.getItem("cf-theme"),E=String(u==="auto"?d:`cf-theme-${u}`);L.classList.add(x?`cf-theme-${x}`:E),b==null||b.classList.add(x?`cf-theme-${x}`:E)},5)),n.addEventListener("click",()=>{var V,H,U;const L=(V=document.getElementById(e))==null?void 0:V.contentDocument;if(!L){S("Iframe document not found");return}const b=L.querySelector("html");if(!b){S("Iframe html not found");return}const E=((H=window==null?void 0:window.localStorage)==null?void 0:H.getItem("cf-theme"))==="dark";E?(b.classList.remove("cf-theme-dark"),b.classList.add("cf-theme-light")):(b.classList.remove("cf-theme-light"),b.classList.add("cf-theme-dark"));const k=document.querySelector("html");k==null||k.classList.toggle("cf-theme-dark"),k==null||k.classList.toggle("cf-theme-light");const g=n.querySelector("svg:first-child"),w=n.querySelector("svg:last-child"),O=b.classList.contains("cf-theme-dark");g&&(g.style.display=E?"block":"none"),w&&(w.style.display=E?"none":"block"),C(E?"dark":"light"),(U=window==null?void 0:window.localStorage)==null||U.setItem("cf-theme",E?"light":"dark")})},B=(u,e)=>{const n=document.getElementById("ct-artificial-viewport"),i=n==null?void 0:n.contentDocument;if(!i){S("Iframe document not found");return}const s=i.querySelector(".ct-active");if(!s){S("Active element not found");return}e==="add"?s.classList.add(u):s.classList.remove(u)},D=(u,e)=>{const t=u==null?void 0:u.closest(".oxygen-color-picker"),n=t==null?void 0:t.querySelector(".button.wp-color-result");n&&(n.style.backgroundColor=e)},J=()=>{if(!y("oxygen_apply_class_on_hover"))return;const u=n=>{setTimeout(()=>{B(n,"add")},5)};A({selector:"#oxygen-sidebar",callback:M(()=>{document.querySelectorAll(".oxygen-classes-dropdown .oxygen-classes-suggestions li").forEach(i=>{var s;const o=(s=i.children[1])==null?void 0:s.textContent;if(!o){S("Second child text content not found");return}i.removeEventListener("click",()=>u(o)),i.addEventListener("click",()=>u(o)),i.removeEventListener("mouseenter",()=>B(o,"add")),i.addEventListener("mouseenter",()=>B(o,"add")),i.removeEventListener("mouseleave",()=>B(o,"remove")),i.addEventListener("mouseleave",()=>B(o,"remove"))})},100)})};class q{constructor(){this.variables=[];this.variablesGroups={};this.colorVariables=[];this.init()}async init(){if(!y("oxygen_enable_variable_dropdown")||!await this.getVariables())return;["#oxygen-sidebar-control-panel-basic-styles",".oxygen-select","#oxygen-sidebar",".oxygen-sidebar-advanced-home"].forEach(i=>{A({selector:i,callback:()=>{this.setVariableAutocomplete()},options:{subtree:!1,childList:!1,attributes:!0}})}),A({selector:".oxygen-active-element-name",callback:()=>{this.setVariableAutocomplete()},options:{subtree:!0,childList:!0,attributes:!1}}),this.setVariableAutocomplete()}filterVariables(e){return this.variables.filter(t=>t.toLocaleLowerCase().includes(e.toLocaleLowerCase())&&t!==e)}sortVariables(e){var r;const n=["padding","margin","gap","width","height"].some(c=>String(e.dataset.option).includes(c)),i=(r=e.parentElement)==null?void 0:r.classList.contains("oxygen-color-picker"),o=e.dataset.option==="font-size";let s=[];for(let[c,a]of Object.entries(this.variablesGroups)){if(a=typeof a=="object"?Object.values(a):a,i&&c==="colorStyles"){s=[...a];break}if(c!=="colorStyles"){if(o&&c==="typographyStyles"&&o){s.unshift(...a);continue}if(o&&c==="typographyStyles"&&!o){s.push(...a);continue}if(n&&c==="spacingStyles"&&n){s.unshift(...a);continue}if(n&&c==="spacingStyles"&&!n){s.push(...a);continue}s.push(...a)}}return s=s.map(c=>`var(--${c})`),this.variables=s,s}emitInputEvent(e,t){e.value=t,e.dispatchEvent(new Event("input"))}setUnitToNone(e){var t;try{const n=(t=e.previousElementSibling)!=null&&t.classList.contains("oxygen-color-picker-color")?"color":e.getAttribute("data-option");window==null||window.$scope.iframeScope.setOptionUnit(n," ")}catch(n){}}createDropdown({options:e,target:t}){var f,v,C;document.querySelectorAll(".cf-variable-dropdown").forEach(d=>{d==null||d.remove()}),t!=null&&t.parentElement&&(t.parentElement.style.position="relative");const n=document.createElement("div"),i=()=>{y("oxygen_enable_unit_and_value_preview")&&this.setUnitToNone(t)};n.addEventListener("mouseenter",i),["cf-variable-dropdown"].forEach(d=>n.classList.add(d));const o=document.createElement("ul");if(y("oxygen_enable_variable_ui_hint")&&y("oxygen_variable_ui")){const d=document.createElement("div");d.classList.add("cf-variable-dropdown-hint"),d.classList.add("variable-dropdown-item"),d.textContent=`${(f=navigator==null?void 0:navigator.platform)!=null&&f.toUpperCase().includes("MAC")?"\u2318":"Alt"} + Click to open variable UI`,d.style.padding="4px 10px",d.style.color="white",d.style.opacity="0.7",d.style.fontSize="12px",n.appendChild(d)}e.forEach(d=>{const l=document.createElement("li");l.textContent=d,l.setAttribute("tabindex","0"),l.setAttribute("role","option"),l.dataset.type="variable-dropdown-item",l.dataset.value=d;let h="";if(setTimeout(()=>{l.addEventListener("mouseenter",m=>{y("oxygen_enable_unit_and_value_preview")&&(h=t.value,this.emitInputEvent(t,d))}),l.addEventListener("mouseleave",m=>{y("oxygen_enable_unit_and_value_preview")&&(this.emitInputEvent(t,h),h="")})},5),this.colorVariables.includes(d)){const m=document.createElement("span");m.style.backgroundColor=d,l.prepend(m)}o.appendChild(l)}),n.appendChild(o),(v=t.parentElement)==null||v.appendChild(n);const r=n.querySelectorAll("li");(C=t==null?void 0:t.parentElement)==null||C.querySelectorAll("li").forEach(d=>{d.addEventListener("mouseEnter",()=>{y("oxygen_enable_unit_and_value_preview")&&(d.classList.add("selected"),t.value=d.dataset.value||c,t.dispatchEvent(new Event("input")))}),d.addEventListener("mouseLeave",()=>{y("oxygen_enable_unit_and_value_preview")&&(d.classList.remove("selected"),t.value=c,t.dispatchEvent(new Event("input")))})});const c=t.value;let a=-1;const p=d=>{a=d,r.forEach((l,h)=>{if(h===a){l.classList.add("selected");return}l.classList.remove("selected")})};t.addEventListener("keydown",d=>{switch(d.key){case"Escape":{if(!r[a])return;this.emitInputEvent(t,c||""),t.focus();break}case"ArrowDown":{if(d.preventDefault(),a===-1){p(0);return}if(a===r.length-1)return;p(a+1);const l=r[a];if(!l)return;n.scrollTop=l.offsetTop-n.clientHeight+l.clientHeight;const h=r[a];if(!h)return;const m=h.dataset.value;if(!m)return;this.setUnitToNone(t),this.emitInputEvent(t,m),t.focus();break}case"ArrowUp":{if(d.preventDefault(),a===-1){p(r.length-1);return}if(a===0)return;p(a-1);const l=r[a];if(!l)return;n.scrollTop=l.offsetTop-n.clientHeight+l.clientHeight;const h=r[a];if(!h)return;const m=h.dataset.value;if(!m)return;this.setUnitToNone(t),this.emitInputEvent(t,m),t.focus();break}case"Enter":{if(d.preventDefault(),a===-1)return;const l=r[a];if(!l)return;const h=l.dataset.value;if(!h)return;this.emitInputEvent(t,h),t.focus(),document.querySelectorAll(".cf-variable-dropdown").forEach(m=>{m==null||m.remove()}),this.setUnitToNone(t),D(t,h);break}}})}onClick(e){if(!e.isTrusted||e!=null&&e.metaKey||e!=null&&e.altKey)return;const t=e.target;this.sortVariables(t);const n=this.filterVariables(t.value);n.length&&this.createDropdown({options:n,target:t})}onType(e){if(!e.isTrusted||e!=null&&e.metaKey||e!=null&&e.altKey)return;const t=e.target,n=t.value,i=this.filterVariables(n);i.length&&this.createDropdown({options:i,target:t})}onInputBlur(e){var c;document.querySelectorAll(".cf-variable-dropdown").forEach(a=>{a==null||a.remove()}),document.querySelectorAll('.oxygen-control input[type="text"]').forEach(a=>{a.removeEventListener("click",this.onInputFocus),a.removeEventListener("blur",this.onInputBlur)});const n=e.relatedTarget;if(!n||!(n.dataset.type==="variable-dropdown-item"))return;const o=n.dataset.value,s=e==null?void 0:e.target;if(!s||!o)return;e.preventDefault(),e.stopPropagation(),s.value=o,s.dispatchEvent(new Event("input")),s.focus();const r=(c=s.previousElementSibling)!=null&&c.classList.contains("oxygen-color-picker-color")?"color":s.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(s,o)}setVariableAutocomplete(){document.querySelectorAll(".cf-variable-dropdown").forEach(n=>{n==null||n.remove()}),document.querySelectorAll(R).forEach(n=>{n.removeEventListener("click",this.onClick.bind(this)),n.removeEventListener("focusout",this.onInputBlur.bind(this)),n.removeEventListener("input",this.onType.bind(this)),n.addEventListener("click",this.onClick.bind(this)),n.addEventListener("focusout",this.onInputBlur.bind(this)),n.addEventListener("input",this.onType.bind(this))})}async getVariables(){var e;window.coreframework={nonce:window.wpApiSettings.nonce,rest_url:window.wpApiSettings.root,core_api_url:`${window.wpApiSettings.root}core-framework/v2/`};try{const t=await fetch(`${window.coreframework.core_api_url}get-variables?type=oxygen_dropdown`,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":window.coreframework.nonce}});if(t.status!==200)return S("Failed to load variables."),!1;const n=await t.json();return n!=null&&n.variables?(this.variablesGroups=n.variables,this.colorVariables=((e=this.variablesGroups.colorStyles)!=null?e:[]).map(i=>`var(--${i})`),!0):(S("No variables found. Please save changes again in the Core Framework plugin."),!1)}catch(t){return S("Failed to load variables."),console.error(t),!1}}}class F{constructor(){this.variables={};this.colorSystemData=null;this.variablePrefix="";this.fluid_typography_naming_convention=null;this.fluid_spacing_naming_convention=null;this.instance=null;this.focusedInput=null;this.tempInputValue=null;this.isOpen=!1;this.stylesGroupsLabelMap={colorStyles:"Colors",typographyStyles:"Typography",spacingStyles:"Spacing",layoutsStyles:"Layouts",designStyles:"Design",componentsStyles:"Components",otherStyles:"Other"};this.logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJUAAAB1CAYAAABH5qPNAAAACXBIWXMAAAhOAAAITgGMMQDsAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAChHSURBVHgB7V3tr2ZXVV9rP3daWkEHE+Mn7YXEDyQmjH9B76AkIBpK8IUYY6cJYCVohzdFY9Ki0WBiwhD9UNDQCyIS/QAaE78YGfSTiUmngICgzIW2lLaUTt+n997nLPfea/3WWvvc2zL0de69z27vPM9zXvbeZ+/f/q3fWnufc5gOcDp9i6xfsbs8Ma1N60UW1wjLcRFZL1zWiaQeIevELMztK3H9r22sH+1/S3Vb+808ZC12kG5tefTvQvhtGXLPUvPHdsbxfWfb3c+s1ajba+qfHOVrIe0Y0c3FTsRxlsVwPDJHpZj9KsnKsH1aHs2uWbMnVNwLQDbeDqgez3/rtcxa7fy731FeuUYHKL33D3c2JpYTtQmurRd1rUzL49OiXuRU6uVNvX+LN4o4GGSSjJqhIdCn4nixzQoP7IxeYf2tHSOkzcoGQuExTzR6O5wF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0/Y71uUXDQeK0Mo7KlrKa7p9Kef1D8qtb5m8y+vOktHLB0Iju4AWyzeOE3Tidp/G/P9fhEKmj7XiKe19ASFxi7u080/5LYtN4ZNegPGOovJ+K6AHJ9WE3qvA7nnWU4eRVAdCIbuT04mfX9Oe8zR7sWLJ9YKv7oKp43ac+u1B0+g4111wWdzEcUhsUyMi2RSGiAVwk7zknAviXw5DtlkwOAksoR0O5rp0KjJBjbavXii6p/jVXgdp7J2jT7BrN1qX2b9O9829TVa06TbSv09NR3Vjiuq40qXn217+066v0z6fl89qT97vh9l+6ZSNjfPXLVFq7RKq/Ts0v8D4+WejbzFd30AAAAASUVORK5CYII=";this.init(),this.boundOnClickCallback=this.onClickCallback.bind(this)}async init(){if(!y("oxygen_variable_ui")||!await this.getVariables())return;["#oxygen-sidebar-control-panel-basic-styles",".oxygen-select","#oxygen-sidebar",".oxygen-sidebar-advanced-home"].forEach(n=>{A({selector:n,callback:()=>{this.addTriggers()},options:{subtree:!1,childList:!1,attributes:!0}})}),A({selector:".oxygen-active-element-name",callback:()=>{this.addTriggers()},options:{subtree:!0,childList:!0,attributes:!1}}),this.createInstance()}createVarButton({variable:e,label:t,color:n,transparent:i}){const o=document.createElement("button");if(o.classList.add("cf-variable-ui-list-item"),o.dataset.cftooltip=`var(--${e})`,o.textContent=t!=null?t:e,n){const s=document.createElement("span");s.style.backgroundColor=n,i&&(s.style.opacity=(i/100).toString()),o.prepend(s)}return o.addEventListener("click",()=>{var c;if(!this.focusedInput)return;const s=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=s,this.tempInputValue=s,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(c=this.focusedInput.previousElementSibling)!=null&&c.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,s),y("oxygen_enable_variable_ui_auto_hide")&&this.close()}),o.addEventListener("mouseenter",()=>{var c;if(!this.focusedInput||!y("oxygen_enable_unit_and_value_preview"))return;const s=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=s,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(c=this.focusedInput.previousElementSibling)!=null&&c.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,s)}),o.addEventListener("mouseleave",()=>{var r;if(!this.focusedInput||this.tempInputValue===null||!y("oxygen_enable_unit_and_value_preview"))return;this.focusedInput.value=this.tempInputValue,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const s=(r=this.focusedInput.previousElementSibling)!=null&&r.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(s," ")}catch(c){}D(this.focusedInput,this.tempInputValue)}),o}getPrefixedVariableName(e){return e.startsWith(this.variablePrefix)?e:`${this.variablePrefix}${e}`}createColorButton({variable:e,color:t,darkColor:n,transparent:i}){e=this.getPrefixedVariableName(e);const o=document.createElement("button");if(o.dataset.cftooltip=`var(--${e})`,o.classList.add("cf-variable-ui-list-item-color"),t){if(i!==void 0){o.style.padding="0";const s=document.createElement("div");s.style.setProperty("--cf-variable-ui-color",t),s.style.setProperty("--cf-variable-ui-color-dark",n!=null?n:t),s.style.opacity=(i/100).toString(),s.style.width="100%",s.style.height="100%",o.appendChild(s)}i===void 0&&(o.style.setProperty("--cf-variable-ui-color",t),o.style.setProperty("--cf-variable-ui-color-dark",n!=null?n:t))}return o.addEventListener("click",()=>{var c;if(!this.focusedInput)return;const s=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=s,this.tempInputValue=s,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(c=this.focusedInput.previousElementSibling)!=null&&c.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,s),y("oxygen_enable_variable_ui_auto_hide")&&this.close()}),o.addEventListener("mouseenter",()=>{var c;if(!this.focusedInput||!y("oxygen_enable_unit_and_value_preview"))return;const s=e.startsWith("var(--")?e:`var(--${e})`;this.focusedInput.value=s,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const r=(c=this.focusedInput.previousElementSibling)!=null&&c.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(r," ")}catch(a){}D(this.focusedInput,s)}),o.addEventListener("mouseleave",()=>{var r;if(!this.focusedInput||this.tempInputValue===null||!y("oxygen_enable_unit_and_value_preview"))return;this.focusedInput.value=this.tempInputValue,this.focusedInput.dispatchEvent(new Event("input")),this.focusedInput.focus();const s=(r=this.focusedInput.previousElementSibling)!=null&&r.classList.contains("oxygen-color-picker-color")?"color":this.focusedInput.getAttribute("data-option");try{window==null||window.$scope.iframeScope.setOptionUnit(s," ")}catch(c){}D(this.focusedInput,this.tempInputValue)}),o}createCategoryTitle(e){const t=document.createElement("div");t.classList.add("cf-variable-ui-category-title");const n=document.createElement("b");n.textContent=e,t.appendChild(n);const i=document.createElement("button");return i.classList.add("cf-variable-ui-section-toggle"),t.appendChild(i),t}allowDrag(e){const t=e.querySelector("#cf-variable-ui-header");if(!t)return;let n=!1,i=0,o=0;const s=a=>{[...document.querySelectorAll("iframe")].forEach(f=>{f.style.pointerEvents="none",f.style.userSelect="none"}),n=!0;const p=t.getBoundingClientRect();i=a.clientX-p.left,o=a.clientY-p.top,t&&(t.style.transition="none")};t.addEventListener("mousedown",s);const r=a=>{if(!n)return;const p=t.getBoundingClientRect(),f=a.clientX,v=a.clientY,C=f-i,d=v-o,l=(C<0?0:C>window.innerWidth-p.width?window.innerWidth-p.width:C)+10,h=d<0?0:d>window.innerHeight-p.height?window.innerHeight-p.height:d;e.style.left=`${l}px`,e.style.top=`${h}px`};document.addEventListener("mousemove",r);const c=a=>{[...document.querySelectorAll("iframe")].forEach(p=>{p.style.pointerEvents="auto",p.style.userSelect="auto"}),n=!1};document.addEventListener("mouseup",c)}createExpandableWrapper({title:e}){const t="cf-variable-ui-wrapper",n=document.createElement("div");n.dataset.groupExpand="false",n.classList.add(t);const i=this.createCategoryTitle(e);return i.addEventListener("click",()=>{n.dataset.groupExpand=n.dataset.groupExpand==="true"?"false":"true"}),n.appendChild(i),n}createInstance(){var a,p;const e=document.createElement("cf-variable-ui");e.classList.add("cf-variable-ui"),e.classList.add("is-oxygen"),e.style.position="fixed",e.style.display="none",e.style.width="300px",e.style.height="500px",e.style.zIndex="1000",e.style.left=`${(window.innerWidth/2-200).toString()}px`,e.style.top=`${(window.innerHeight/2-300).toString()}px`;const t=document.createElement("div");t.id="cf-variable-ui-header",t.style.width="100%";const n=document.createElement("img");n.src=this.logoData,n.classList.add("cf-variable-ui-logo"),n.style.setProperty("width","30px");const i=document.createElement("a");i.href=`${new URL(window.location.href).origin}/wp-admin/admin.php?page=core-framework`,i.target="_blank",i.classList.add("cf-variable-ui-open-core-framework"),i.textContent="Open",i.dataset.cftooltip="Open Core Framework plugin";const o=document.createElement("button");o.innerHTML='',o.classList.add("cf-variable-ui-close-button"),o.dataset.cftooltip="Close",o.addEventListener("click",this.close.bind(this)),t.appendChild(n),t.appendChild(i),t.appendChild(o),e.appendChild(t);const s=(p=(a=this.colorSystemData)==null?void 0:a.groups)!=null?p:[],r=this.createExpandableWrapper({title:"Color System"});r.dataset.type="color-system",s.forEach(({colors:f,name:v,isDisabled:C})=>{if(C)return;const d=document.createElement("div");d.classList.add("cf-variable-ui-color-wrapper"),f.forEach(l=>{var E,k;const h=this.createColorButton({variable:l.name,color:l.value,darkColor:l.darkValue}),m=document.createElement("div"),T=document.createElement("div");T.classList.add("cf-variable-ui-color-title"),T.textContent=this.getPrefixedVariableName(l.name),T.style.setProperty("font-weight","bold"),m.classList.add("cf-variable-ui-color-wrapper-second"),m.appendChild(T),m.appendChild(h);const L=l.isShades&&l.shades?l.shades.map((g,w)=>{var V,H;const O=(H=(V=l.darkShades)==null?void 0:V[w])==null?void 0:H.value;return this.createColorButton({variable:g.name,color:g.value,darkColor:O})}):[];if(L.length){const g=document.createElement("div");g.classList.add("cf-variable-ui-color-title"),g.textContent=`Shades of ${this.getPrefixedVariableName(l.name)}`;const w=document.createElement("div");w.classList.add("cf-variable-ui-shades-wrapper"),L.forEach(O=>{w.appendChild(O)}),m.appendChild(g),m.appendChild(w)}const b=l.isTints&&l.tints?l.tints.map((g,w)=>{var V,H;const O=(H=(V=l.darkTints)==null?void 0:V[w])==null?void 0:H.value;return this.createColorButton({variable:g.name,color:g.value,darkColor:O})}):[];if(b.length){const g=document.createElement("div");g.classList.add("cf-variable-ui-color-title"),g.textContent=`Tints of ${this.getPrefixedVariableName(l.name)}`;const w=document.createElement("div");w.classList.add("cf-variable-ui-tints-wrapper"),b.forEach(O=>{w.appendChild(O)}),m.appendChild(g),m.appendChild(w)}const x=(k=(E=l.transparentVariables)==null?void 0:E.map(g=>this.createColorButton({variable:`${l.name}-${g}`,color:l.value,darkColor:l.darkValue,transparent:Number(g)})))!=null?k:[];if(x.length){const g=document.createElement("div");g.classList.add("cf-variable-ui-color-title"),g.textContent=`Transparent values of ${this.getPrefixedVariableName(l.name)}`;const w=document.createElement("div");w.classList.add("cf-variable-ui-transparent-wrapper"),x.forEach(O=>{w.appendChild(O)}),m.appendChild(g),m.appendChild(w)}d.appendChild(m)}),r.appendChild(d)});const c=document.createElement("div");c.classList.add("cf-variable-ui-scroll-container"),c.appendChild(r),Object.entries(this.variables).forEach(([f,v])=>{var l;if(Object.keys(v).length===0)return;const d=this.createExpandableWrapper({title:(l=this.stylesGroupsLabelMap[f])!=null?l:f});d.dataset.type=f,Object.entries(v).forEach(([h,m])=>{const T=E=>{if(h==="Fluid Typography"||h==="Fluid Spacing"){const k=this.variablePrefix+(h==="Fluid Typography"?this.fluid_typography_naming_convention:this.fluid_spacing_naming_convention)+"-";return E.replace(k,"")}return E},L=document.createElement("div"),b=document.createElement("b");b.textContent=h,b.classList.add("cf-variable-ui-row-title"),L.appendChild(b),L.classList.add("cf-variable-ui-group");const x=document.createElement("div");x.classList.add("cf-variable-ui-container"),m.forEach(E=>{const k=this.createVarButton({variable:E,label:T(E)});x.appendChild(k)}),L.appendChild(x),d.appendChild(L)}),c.appendChild(d)}),e.appendChild(c),document.body.appendChild(e),this.instance=e,this.allowDrag(e),setTimeout(()=>{this.reposition()},100)}open(){if(!this.instance)return;this.instance.style.setProperty("display","block"),this.isOpen=!0;const e=document.querySelector("html");e&&(e.dataset.cfVariableUiOpen="true")}close(){if(!this.instance)return;this.instance.style.setProperty("display","none"),this.isOpen=!1,this.tempInputValue=null;const e=document.querySelector("html");e&&(e.dataset.cfVariableUiOpen="false",[...document.querySelectorAll("iframe")].forEach(t=>{t.style.pointerEvents="auto",t.style.userSelect="auto"}))}async getVariables(){window.coreframework={nonce:window.wpApiSettings.nonce,rest_url:window.wpApiSettings.root,core_api_url:`${window.wpApiSettings.root}core-framework/v2/`};try{const e=await fetch(`${window.coreframework.core_api_url}builders-var-ui`,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":window.coreframework.nonce}});if(e.status!==200)return S("Failed to load variables."),!1;const t=await e.json();return t!=null&&t.variables?(this.variables=I(t.variables),t.color_system_data?(this.colorSystemData=t.color_system_data,this.variablePrefix=t.variable_prefix,this.fluid_typography_naming_convention=t.fluid_typography_naming_convention,this.fluid_spacing_naming_convention=t.fluid_spacing_naming_convention,!0):(S("No color system data found. Please save changes again in the Core Framework plugin."),!1)):(S("No variables found. Please save changes again in the Core Framework plugin."),!1)}catch(e){return S("Failed to load variables."),console.error(e),!1}}reposition(){this.instance&&(this.instance.style.top=`${(window.innerHeight/2-300).toString()}px`,this.instance.style.left="320px")}onClickCallback(e){var c;const t=e.type==="contextmenu"&&y("oxygen_enable_variable_context_menu");if(t&&(e.preventDefault(),e.stopPropagation()),!this.isOpen&&!(e!=null&&e.metaKey||e!=null&&e.altKey)&&!t)return;const n=e.target;if(!n)return;e.preventDefault(),e.stopPropagation(),this.focusedInput=n,this.tempInputValue=n.value;const i=(c=n.parentElement)==null?void 0:c.classList.contains("oxygen-color-picker"),o=n.dataset.option==="font-size",r=["padding","margin","gap","width","height"].some(a=>String(n.dataset.option).includes(a));if(this.instance){this.instance.dataset.enableColors=i?"true":"false";const a=this.instance.querySelector(".cf-variable-ui-wrapper[data-type='color-system']"),p=this.instance.querySelector(".cf-variable-ui-wrapper[data-type='typographyStyles']"),f=this.instance.querySelector(".cf-variable-ui-wrapper[data-type='spacingStyles']");for(const v of[a,p,f]){if(!v)return;v.dataset.groupExpand="false"}i&&a&&(a.dataset.groupExpand="true"),o&&p&&(p.dataset.groupExpand="true"),r&&f&&(f.dataset.groupExpand="true")}this.open(),document.querySelectorAll(".cf-variable-dropdown").forEach(a=>a==null?void 0:a.remove())}addTriggers(){document.querySelectorAll(".cf-variable-ui-trigger").forEach(n=>{n==null||n.remove()}),document.querySelectorAll(R).forEach(n=>{n.removeEventListener("click",this.boundOnClickCallback),n.addEventListener("click",this.boundOnClickCallback),y("oxygen_enable_variable_context_menu")&&(n==null||n.removeEventListener("contextmenu",this.boundOnClickCallback),n==null||n.addEventListener("contextmenu",this.boundOnClickCallback))});const e=n=>{var i;n.key==="Escape"&&((i=this.instance)==null?void 0:i.style.getPropertyValue("display"))==="block"&&this.close()};document.removeEventListener("keydown",e),document.addEventListener("keydown",e);const t=n=>{var i,o,s,r;this.isOpen&&!((i=this==null?void 0:this.instance)!=null&&i.contains(n.target))&&!((o=n.target)!=null&&o.classList.contains("cf-variable-ui-trigger"))&&!((r=(s=n.target)==null?void 0:s.parentElement)!=null&&r.classList.contains("cf-variable-ui-trigger"))&&this.close()};y("oxygen_enable_variable_ui_auto_hide")&&(document.removeEventListener("click",t),document.addEventListener("click",t))}}class j{constructor(){this.fonts=[];this.init()}async init(){await this.setFonts();let e=new Map;A({selector:"#oxygen-sidebar",callback:t=>{if(!t.some(i=>[...i.addedNodes].some(o=>o.nodeType===Node.ELEMENT_NODE&&o.id==="core-subtitle"||o.id==="core-icon"))){const i=document.getElementById("oxygen-typography-font-family"),o=i==null?void 0:i.querySelector("input"),s=r=>{this.applyCoreOptionsView(r,!0)};i&&this.applyCoreOptionsView(i,!0),o&&!e.get(o)&&(o.addEventListener("input",()=>s(i)),e.set(o,()=>s(i)))}},options:{subtree:!0,childList:!0,attributes:!1}}),A({selector:"#oxygen-global-settings",callback:t=>{if(!t.some(i=>[...i.addedNodes].some(o=>o.nodeType===Node.ELEMENT_NODE&&o.id==="core-subtitle"||o.id==="core-icon"))){const i=document.querySelectorAll(".oxygen-control-global-font"),o=s=>{this.applyCoreOptionsView(s)};i.forEach(s=>{this.applyCoreOptionsView(s);const r=s.querySelector("input");r&&!e.get(r)&&(r.addEventListener("input",()=>o(s)),e.set(r,()=>o(s)))})}},options:{subtree:!0,childList:!0,attributes:!1}})}async setFonts(){window.coreframework={nonce:window.wpApiSettings.nonce,rest_url:window.wpApiSettings.root,core_api_url:`${window.wpApiSettings.root}core-framework/v2/`};try{const e=await fetch(`${window.coreframework.core_api_url}get-core-fonts`,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":window.coreframework.nonce}}),{fonts:t}=await e.json();this.fonts=t.filter(n=>n.enable)}catch(e){console.log(e)}}applyCoreOptionsView(e,t=!1){const n=Object.values(window.$scope.iframeScope.globalSettings.fonts)||[],i=window.core_yabe_fonts||[],o=e.querySelector(".oxygen-select-box-options"),s=e.querySelector("#core-subtitle");if(s==null||s.remove(),o&&this.fonts.length){const r=Array.from(o.children),c=document.createElement("div");let a=null,p=null;c.setAttribute("id","core-subtitle"),c.textContent="Core Framework",c.classList.add("oxygen-select-box-option"),Object.assign(c.style,{backgroundColor:"var(--oxy-dark)",fontWeight:700,letterSpacing:".2px",pointerEvents:"none",textTransform:"uppercase"}),this.fonts.forEach(f=>{var l,h;const v=W(r,f),C=i.includes(f.family),d=o.querySelector("#core-subtitle");if(d&&d.remove(),v&&C&&(v.style.setProperty("border-bottom","none"),(l=v.querySelector("#core-icon"))==null||l.remove()),v&&!C){(!t||!n.includes(f.family))&&(a=v,!p&&(p=v)),v.style.setProperty("justify-content","space-between"),v.style.setProperty("border-bottom","none");const T=document.createElement("span");T.setAttribute("id","core-icon"),Object.assign(T.style,{width:"13px",height:"13px",padding:"0",background:"none"}),T.innerHTML=` - `,n.includes(f.family)&&t?(g.style.setProperty("border-bottom","none"),(h=g.querySelector("#core-icon"))==null||h.remove()):(g.textContent=`${f.title} (${f.family})`,g.appendChild(T))}}),a&&(a.style.borderBottom="2px solid var(--oxy-dark)"),p&&o.insertBefore(l,p),p=null}}}const te=()=>{F(),j(),new X,new $;const u=document.querySelector("#oxy-page-loader"),e=new MutationObserver(t=>{t.forEach(()=>{window.getComputedStyle(u).display==="none"&&(e.disconnect(),new ee)})});e.observe(u,{childList:!0,subtree:!0})};document.addEventListener("DOMContentLoaded",te)})();})(); + `,n.includes(f.family)&&t?(v.style.setProperty("border-bottom","none"),(h=v.querySelector("#core-icon"))==null||h.remove()):(v.textContent=`${f.title} (${f.family})`,v.appendChild(T))}}),a&&(a.style.borderBottom="2px solid var(--oxy-dark)"),p&&o.insertBefore(c,p),p=null}}}const X=()=>{z(),J(),new q,new F;const u=document.querySelector("#oxy-page-loader"),e=new MutationObserver(t=>{t.forEach(()=>{window.getComputedStyle(u).display==="none"&&(e.disconnect(),new j)})});e.observe(u,{childList:!0,subtree:!0})};document.addEventListener("DOMContentLoaded",X)})();})(); diff --git a/packages/wp/wp/Helper.php b/packages/wp/wp/Helper.php index f3cdf5e..52c39ee 100644 --- a/packages/wp/wp/Helper.php +++ b/packages/wp/wp/Helper.php @@ -574,12 +574,14 @@ public function getClassNames(array $options = array( $main_name = $color['name']; $local_color_names[] = $main_name; - $shades = isset( $color['shades'] ) ? $color['shades'] : array(); + $is_shades = isset( $color['isShades'] ) && $color['isShades'] === true; + $shades = $is_shades && isset( $color['shades'] ) ? $color['shades'] : array(); foreach ( $shades as $shade ) { $local_color_names[] = $shade['name']; } - $tints = isset( $color['tints'] ) ? $color['tints'] : array(); + $is_tints = isset( $color['isTints'] ) && $color['isTints'] === true; + $tints = $is_tints && isset( $color['tints'] ) ? $color['tints'] : array(); foreach ( $tints as $tint ) { $local_color_names[] = $tint['name']; } @@ -879,12 +881,14 @@ public function getClassNamesGroupedByCategoriesAndGroups(): array { $main_name = $color['name']; $local_color_names[] = $main_name; - $shades = isset( $color['shades'] ) ? $color['shades'] : array(); + $is_shades = isset( $color['isShades'] ) && $color['isShades'] === true; + $shades = $is_shades && isset( $color['shades'] ) ? $color['shades'] : array(); foreach ( $shades as $shade ) { $local_color_names[] = $shade['name']; } - $tints = isset( $color['tints'] ) ? $color['tints'] : array(); + $is_tints = isset( $color['isTints'] ) && $color['isTints'] === true; + $tints = $is_tints && isset( $color['tints'] ) ? $color['tints'] : array(); foreach ( $tints as $tint ) { $local_color_names[] = $tint['name']; } @@ -1167,12 +1171,14 @@ public function getVariables(array $options = array( $name = $color['name']; $grouped_variables['colorStyles'][] = $variable_prefix . $name; - $shades = isset( $color['shades'] ) ? $color['shades'] : array(); + $is_shades = isset( $color['isShades'] ) && $color['isShades'] === true; + $shades = $is_shades && isset( $color['shades'] ) ? $color['shades'] : array(); foreach ( $shades as $shade ) { $grouped_variables['colorStyles'][] = $variable_prefix . $shade['name']; } - $tints = isset( $color['tints'] ) ? $color['tints'] : array(); + $is_tints = isset( $color['isTints'] ) && $color['isTints'] === true; + $tints = $is_tints && isset( $color['tints'] ) ? $color['tints'] : array(); foreach ( $tints as $tint ) { $grouped_variables['colorStyles'][] = $variable_prefix . $tint['name']; } @@ -1432,12 +1438,14 @@ public function getVariablesGroupedByCategoriesAndGroups(array $options = array( $name = $color['name']; $grouped_variables['colorStyles'][ $group_name ][] = $variable_prefix . $name; - $shades = isset( $color['shades'] ) ? $color['shades'] : array(); + $is_shades = isset( $color['isShades'] ) && $color['isShades'] === true; + $shades = $is_shades && isset( $color['shades'] ) ? $color['shades'] : array(); foreach ( $shades as $shade ) { $grouped_variables['colorStyles'][ $group_name ][] = $variable_prefix . $shade['name']; } - $tints = isset( $color['tints'] ) ? $color['tints'] : array(); + $is_tints = isset( $color['isTints'] ) && $color['isTints'] === true; + $tints = $is_tints && isset( $color['tints'] ) ? $color['tints'] : array(); foreach ( $tints as $tint ) { $grouped_variables['colorStyles'][ $group_name ][] = $variable_prefix . $tint['name']; }