diff --git a/src/components/DeferredLoadTrigger.astro b/src/components/DeferredLoadTrigger.astro index 150d66179a..b7de2ebd8b 100644 --- a/src/components/DeferredLoadTrigger.astro +++ b/src/components/DeferredLoadTrigger.astro @@ -25,6 +25,9 @@ runCallback(cb); }; + // Default API: if the user already interacted earlier in the session, + // run immediately; otherwise wait for interaction on this page or the + // fallback timer. window.__deferOnInteraction = function (cb, fallbackMs) { if (fired) return runCallback(cb); const ms = typeof fallbackMs === 'number' ? fallbackMs : 2500; diff --git a/src/components/Pricing/CalculatorModal.astro b/src/components/Pricing/CalculatorModal.astro index 440af8fc1e..302e983f1d 100644 --- a/src/components/Pricing/CalculatorModal.astro +++ b/src/components/Pricing/CalculatorModal.astro @@ -1379,12 +1379,31 @@ const { id } = Astro.props as Props; // ─── Shared slider utilities (global) ─── + // Cache the two theme-dependent CSS custom properties on `window` so + // continuous slider `input` events don't force a fresh style recalc per call. + // State lives on `window` because this `is:inline` script is inlined once per + // instance on the page — a block-scoped `let` would throw + // "already declared" on the 2nd/3rd inlining. Bust the cache when Starlight + // flips `data-theme` on . + function _readSliderColors() { + const cs = getComputedStyle(document.documentElement); + window._sliderColors = { + primary: cs.getPropertyValue('--sl-color-text-accent').trim() || '#3D50F5', + track: cs.getPropertyValue('--sl-color-gray-5').trim() || '#E0E1E2', + }; + return window._sliderColors; + } + if (!window._sliderColorsObserved) { + window._sliderColorsObserved = true; + new MutationObserver(function() { window._sliderColors = null; }) + .observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] }); + } + /** Update slider track fill via background linear-gradient */ window.sliderProgress = function(slider) { const progress = ((parseFloat(slider.value) - parseFloat(slider.min)) / (parseFloat(slider.max) - parseFloat(slider.min))) * 100; - const primary = getComputedStyle(document.documentElement).getPropertyValue('--sl-color-text-accent').trim() || '#3D50F5'; - const track = getComputedStyle(document.documentElement).getPropertyValue('--sl-color-gray-5').trim() || '#E0E1E2'; - slider.style.background = 'linear-gradient(to right, ' + primary + ' ' + progress + '%, ' + track + ' ' + progress + '%)'; + const c = window._sliderColors || _readSliderColors(); + slider.style.background = 'linear-gradient(to right, ' + c.primary + ' ' + progress + '%, ' + c.track + ' ' + progress + '%)'; }; /** Position tick marks using JS (compensates for thumb width) */ diff --git a/src/components/Pricing/CommunityEditionCard.astro b/src/components/Pricing/CommunityEditionCard.astro index 1798903ae4..14db4c0d88 100644 --- a/src/components/Pricing/CommunityEditionCard.astro +++ b/src/components/Pricing/CommunityEditionCard.astro @@ -25,7 +25,13 @@ const { data } = Astro.props; ))}
- + {data.ctaText} {data.secondaryCtaText && ( @@ -34,7 +40,13 @@ const { data } = Astro.props; variant="outlined" size="sm" class="gtm_button" - onclick={data.secondaryCtaHref ? undefined : data.secondaryCtaOnclick} + onclick={ + data.secondaryCtaHref + ? undefined + : data.secondaryCtaOnclick + ? `event.preventDefault();${data.secondaryCtaOnclick}` + : undefined + } target={data.secondaryCtaHref ? '_blank' : undefined} rel={data.secondaryCtaHref ? 'noopener noreferrer' : undefined} > diff --git a/src/components/Pricing/ProductSubTabs.astro b/src/components/Pricing/ProductSubTabs.astro index 9ce3f57b84..9a08274bdb 100644 --- a/src/components/Pricing/ProductSubTabs.astro +++ b/src/components/Pricing/ProductSubTabs.astro @@ -22,7 +22,6 @@ const { product, tabs } = Astro.props; ---
-
{tabs.map((tab) => (