@repobit/dex-system-design 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.1.2](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@3.1.1...@repobit/dex-system-design@3.1.2) (2026-11-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **DEX-29411:** anchor-nav no longer counts hidden sections as reached
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
## [3.1.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@3.1.0...@repobit/dex-system-design@3.1.1) (2026-11-05)
|
|
7
14
|
|
|
8
15
|
### Bug Fixes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{matchesBelow as t}from"../shared/token-scales.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{ensembleCSS as r}from"../shared/ensemble.css.js";import"../icons/arrow-down-icon.js";import"../button/button.js";import{anchorNavStyles as i}from"./anchor-nav.css.js";import{ObserverController as a}from"../shared/controller.observer.js";import"../link/link.js";import{LitElement as o,html as s,nothing as c}from"lit";import{property as l,state as u}from"lit/decorators.js";function d(e){let t=(e||``).trim();if(!t)return 0;if(t.endsWith(`px`))return parseFloat(t);if(t.endsWith(`rem`)){let e=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return parseFloat(t)*e}return parseFloat(t)||0}var f=(e,t)=>(e||``).replace(/^#/,``)||`anchor-${t}-section`,p=`10000%`,m=`popover`in HTMLElement.prototype&&CSS.supports(`anchor-name: --a`),h=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:`open`})}connectedCallback(){this.render()}render(){this.shadowRoot.innerHTML=`<slot></slot>`}};h=n([e(`bd-anchor-nav-item`)],h);var g=class extends o{static{this.styles=[r,i]}constructor(){super(),this.activeId=``,this.navLabel=`Section navigation`,this._dropdownOpen=!1,this._mobileCtaRevealed=!1,this.ctaLabel=`Buy now`,this.ctaHref=``,this.items=null,this.maxWidth=``,this.stickyTop=`0px`,this._indicatorSize=new a(this,()=>new ResizeObserver(()=>this._updateIndicator(`ResizeObserver`)),e=>{let t=this.renderRoot.querySelector(`.anchor-links--desktop`);t&&(e.observe(t),e.observe(this))}),this._panelId=`bd-anchor-nav-panel-${Math.random().toString(36).slice(2,11)}`,this._onDocumentPointerDown=this._onDocumentPointerDown.bind(this),this._onKeydown=this._onKeydown.bind(this),this._onSectionsCrossLine=this._onSectionsCrossLine.bind(this),this._onFirstSectionCross=this._onFirstSectionCross.bind(this),this._scheduleSpy=this._scheduleSpy.bind(this),this._spyFrame=0,this._spyObserver=null,this._ctaObserver=null,this._layoutObserver=null,this._sections=[],this._spyLine=0,this._spyViewport=0,this._passed=/* @__PURE__ */ new Map,this._firstSectionBehind=!1,this._programmaticScrollTargetId=null,this._unlockScrollSpyTimer=null,this._scrollEndUnlockHandler=null,this._onStickyScroll=null,this._restoreScrollBehavior=null,this._handleResize=this._handleResize.bind(this),this._indicatorReady=!1}connectedCallback(){super.connectedCallback(),window.addEventListener(`resize`,this._handleResize),m||(document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.addEventListener(`keydown`,this._onKeydown,!0)),this._initSticky(),this._layoutObserver=new ResizeObserver(this._scheduleSpy),this._layoutObserver.observe(this),this._layoutObserver.observe(document.documentElement)}disconnectedCallback(){super.disconnectedCallback(),this._cancelScrollSpyUnlock(),this._restoreScrollBehavior?.(),window.removeEventListener(`resize`,this._handleResize),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.removeEventListener(`keydown`,this._onKeydown,!0),this._destroySticky(),this._unobserveSections()}willUpdate(e){super.willUpdate(e),!this.hasUpdated&&!this.activeId&&this._resolvedItems().length&&(this.activeId=`anchor-1`)}updated(e){if(super.updated(e),e.has(`stickyTop`)&&this.style.setProperty(`--sticky-top`,this.stickyTop||`0px`),(e.has(`stickyTop`)||e.has(`items`))&&this._scheduleSpy(),(e.has(`activeId`)||e.has(`items`))&&requestAnimationFrame(()=>this._updateIndicator(`updated`)),!e.has(`activeId`))return;let t=e.get(`activeId`);t!==void 0&&t!==``&&t!==this.activeId&&queueMicrotask(()=>this._playMobileDropdownLabelSwap())}firstUpdated(){requestAnimationFrame(()=>this._updateIndicator(`firstUpdated`))}_updateIndicator(e){let t=this.renderRoot?.querySelector(`.anchor-indicator`),n=this.renderRoot?.querySelector(`.anchor-links--desktop .anchor-link[current]`);if(!t||!n)return;let r=t.offsetWidth,i=r?n.offsetWidth/r:0,a=this.renderRoot.querySelector(`.bd-anchor-nav__inner`),o=a&&parseFloat(getComputedStyle(a).paddingBottom)||0,s=n.offsetTop+n.offsetHeight+o,c=()=>{t.style.translate=`${n.offsetLeft}px ${s}px`,t.style.scale=`${i} 1`};this._indicatorReady?c():(t.style.transition=`none`,c(),t.offsetWidth,t.style.transition=``,this._indicatorReady=!0)}_handleResize(){this._updateIndicator(`windowResize`),this._scheduleSpy()}_initSticky(){this.style.setProperty(`--sticky-top`,this.stickyTop||`0px`),!CSS.supports(`container-type: scroll-state`)&&(this._onStickyScroll=()=>{let e=parseFloat(getComputedStyle(this).top)||0,t=Math.abs(this.getBoundingClientRect().top-e)<1;this.classList.toggle(`is-sticky`,t&&window.scrollY>0)},window.addEventListener(`scroll`,this._onStickyScroll,{passive:!0}),window.addEventListener(`resize`,this._onStickyScroll,{passive:!0}),requestAnimationFrame(()=>this._onStickyScroll?.()))}_destroySticky(){this._onStickyScroll&&=(window.removeEventListener(`scroll`,this._onStickyScroll),window.removeEventListener(`resize`,this._onStickyScroll),null),this.classList.remove(`is-sticky`)}_cancelScrollSpyUnlock(){this._unlockScrollSpyTimer!=null&&(clearTimeout(this._unlockScrollSpyTimer),this._unlockScrollSpyTimer=null),this._scrollEndUnlockHandler&&=(window.removeEventListener(`scrollend`,this._scrollEndUnlockHandler),null)}_scheduleScrollSpyUnlock(){this._cancelScrollSpyUnlock();let e=()=>{this._cancelScrollSpyUnlock(),this._restoreScrollBehavior?.(),this._programmaticScrollTargetId=null,this._runScrollSpy()};this._scrollEndUnlockHandler=e,window.addEventListener(`scrollend`,e,{passive:!0});let t=window.scrollY,n=()=>{if(window.scrollY===t)return e();t=window.scrollY,this._unlockScrollSpyTimer=window.setTimeout(n,250)};this._unlockScrollSpyTimer=window.setTimeout(n,250)}_onKeydown(e){e.key===`Escape`&&this._dropdownOpen&&(this._dropdownOpen=!1,this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot?.querySelector(`.bd-anchor-nav__dropdown-toggle`)?.focus()))}_onDocumentPointerDown(e){this._dropdownOpen&&(e.composedPath().includes(this)||(this._dropdownOpen=!1,this.requestUpdate()))}_scheduleSpy(){this._spyFrame||=requestAnimationFrame(()=>{this._spyFrame=0,this._observeSections()})}_observeSections(){let e=this._resolvedItems().map(({href:e},t)=>document.getElementById(f(e,t+1))),t=this._stickyOffsetPx(),n=t+2,r=document.documentElement.clientHeight;if(n===this._spyLine&&r===this._spyViewport&&e.length===this._sections.length&&e.every((e,t)=>e===this._sections[t]))return;for(let t of this._sections)t&&!e.includes(t)&&t.style.removeProperty(`scroll-margin-top`);for(let n of e)n?.style.setProperty(`scroll-margin-top`,`${t}px`);this._spyObserver?.disconnect(),this._ctaObserver?.disconnect(),this._spyObserver=this._ctaObserver=null,e[0]!==this._sections[0]&&(this._firstSectionBehind=!1),this._passed=new Map(e.filter(e=>this._passed.has(e)).map(e=>[e,this._passed.get(e)])),this._sections=e,this._spyLine=n,this._spyViewport=r;let i=e.filter(Boolean);i.length&&(this._spyObserver=new IntersectionObserver(this._onSectionsCrossLine,{root:document,rootMargin:`${p} 0px ${n-r}px 0px`}),i.forEach(e=>this._spyObserver.observe(e))),e[0]&&(this._ctaObserver=new IntersectionObserver(this._onFirstSectionCross,{root:document,rootMargin:`0px 0px ${p} 0px`}),this._ctaObserver.observe(e[0])),this._runScrollSpy()}_unobserveSections(){cancelAnimationFrame(this._spyFrame),this._spyFrame=0,this._layoutObserver?.disconnect(),this._spyObserver?.disconnect(),this._ctaObserver?.disconnect(),this._layoutObserver=this._spyObserver=this._ctaObserver=null;for(let e of this._sections)e?.style.removeProperty(`scroll-margin-top`);this._sections=[],this._passed=/* @__PURE__ */ new Map}_onSectionsCrossLine(e){for(let{target:t,boundingClientRect:n,rootBounds:r}of e)this._passed.set(t,n.top<=r.bottom);this._runScrollSpy()}_onFirstSectionCross(e){let{boundingClientRect:t,rootBounds:n}=e[e.length-1];this._firstSectionBehind=t.bottom<=n.top,this._runScrollSpy()}_resolvedItems(){return this.items&&this.items.length?this.items.map((e,t)=>({title:e.title,href:e.href||`#anchor-${t+1}-section`,id:`anchor-${t+1}`})):Array.from(this.children).filter(e=>e.tagName===`BD-ANCHOR-NAV-ITEM`).map((e,t)=>({title:e.getAttribute(`title`),href:e.getAttribute(`href`)||`#anchor-${t+1}-section`,id:`anchor-${t+1}`}))}_runScrollSpy(){let e=this.activeId;this._sections.length&&!this._programmaticScrollTargetId&&(e=`anchor-1`,this._sections.forEach((t,n)=>{t&&this._passed.get(t)&&(e=`anchor-${n+1}`)})),this.activeId=e,this._mobileCtaRevealed=!this._sections[0]||this._firstSectionBehind}_playMobileDropdownLabelSwap(){if(typeof window>`u`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||!t(`md`))return;let e=this.renderRoot?.querySelector(`.bd-anchor-nav__dropdown-label`);e&&(e.classList.remove(`bd-anchor-nav__dropdown-label--swap`),e.offsetWidth,e.classList.add(`bd-anchor-nav__dropdown-label--swap`),e.addEventListener(`animationend`,()=>e.classList.remove(`bd-anchor-nav__dropdown-label--swap`),{once:!0}))}_stickyOffsetPx(){let e=this.offsetHeight,t=parseFloat(getComputedStyle(this).top)||0,n=d(getComputedStyle(this).getPropertyValue(`--spacing-8`).trim())||8;return e>0?e+n+t:d(getComputedStyle(this).getPropertyValue(`--spacing-128`).trim())||128}handleClick(e,t,n){if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;this._cancelScrollSpyUnlock(),this._programmaticScrollTargetId=null,this.activeId=t;let r=f(n,t.replace(/^anchor-/,``));document.getElementById(r)&&(this._programmaticScrollTargetId=t,this._smoothFragmentScroll(),this._scheduleScrollSpyUnlock())}_smoothFragmentScroll(){if(this._restoreScrollBehavior||!window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches)return;let e=document.documentElement,t=e.style.scrollBehavior;e.style.scrollBehavior=`smooth`,this._restoreScrollBehavior=()=>{e.style.scrollBehavior=t,this._restoreScrollBehavior=null}}_toggleDropdown(e){m||(e.preventDefault(),e.stopPropagation(),this._dropdownOpen=!this._dropdownOpen)}_onPanelToggle(e){this._dropdownOpen=e.newState===`open`}_selectFromDropdown(e,t,n){if(m){let e=this.renderRoot.querySelector(`.bd-anchor-nav__dropdown-panel`);e?.matches(`:popover-open`)&&e.hidePopover()}else this._dropdownOpen=!1;this.handleClick(e,t,n)}_activeLabel(e){let t=/^anchor-(\d+)$/.exec(this.activeId||``),n=t?parseInt(t[1],10):1;return e[Math.min(Math.max(n-1,0),Math.max(0,e.length-1))]?.title||e[0]?.title||`Section`}render(){let e=this._resolvedItems(),t=this._activeLabel(e),n=t=>s`
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{matchesBelow as t}from"../shared/token-scales.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{ensembleCSS as r}from"../shared/ensemble.css.js";import"../icons/arrow-down-icon.js";import"../button/button.js";import{anchorNavStyles as i}from"./anchor-nav.css.js";import{ObserverController as a}from"../shared/controller.observer.js";import"../link/link.js";import{LitElement as o,html as s,nothing as c}from"lit";import{property as l,state as u}from"lit/decorators.js";function d(e){let t=(e||``).trim();if(!t)return 0;if(t.endsWith(`px`))return parseFloat(t);if(t.endsWith(`rem`)){let e=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return parseFloat(t)*e}return parseFloat(t)||0}var f=(e,t)=>(e||``).replace(/^#/,``)||`anchor-${t}-section`,p=`10000%`,m=`popover`in HTMLElement.prototype&&CSS.supports(`anchor-name: --a`),h=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:`open`})}connectedCallback(){this.render()}render(){this.shadowRoot.innerHTML=`<slot></slot>`}};h=n([e(`bd-anchor-nav-item`)],h);var g=class extends o{static{this.styles=[r,i]}constructor(){super(),this.activeId=``,this.navLabel=`Section navigation`,this._dropdownOpen=!1,this._mobileCtaRevealed=!1,this.ctaLabel=`Buy now`,this.ctaHref=``,this.items=null,this.maxWidth=``,this.stickyTop=`0px`,this._indicatorSize=new a(this,()=>new ResizeObserver(()=>this._updateIndicator(`ResizeObserver`)),e=>{let t=this.renderRoot.querySelector(`.anchor-links--desktop`);t&&(e.observe(t),e.observe(this))}),this._panelId=`bd-anchor-nav-panel-${Math.random().toString(36).slice(2,11)}`,this._onDocumentPointerDown=this._onDocumentPointerDown.bind(this),this._onKeydown=this._onKeydown.bind(this),this._onSectionsCrossLine=this._onSectionsCrossLine.bind(this),this._onFirstSectionCross=this._onFirstSectionCross.bind(this),this._scheduleSpy=this._scheduleSpy.bind(this),this._spyFrame=0,this._spyObserver=null,this._ctaObserver=null,this._layoutObserver=null,this._sections=[],this._spyLine=0,this._spyViewport=0,this._passed=/* @__PURE__ */ new Map,this._firstSectionBehind=!1,this._programmaticScrollTargetId=null,this._unlockScrollSpyTimer=null,this._scrollEndUnlockHandler=null,this._onStickyScroll=null,this._restoreScrollBehavior=null,this._handleResize=this._handleResize.bind(this),this._indicatorReady=!1}connectedCallback(){super.connectedCallback(),window.addEventListener(`resize`,this._handleResize),m||(document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.addEventListener(`keydown`,this._onKeydown,!0)),this._initSticky(),this._layoutObserver=new ResizeObserver(this._scheduleSpy),this._layoutObserver.observe(this),this._layoutObserver.observe(document.documentElement)}disconnectedCallback(){super.disconnectedCallback(),this._cancelScrollSpyUnlock(),this._restoreScrollBehavior?.(),window.removeEventListener(`resize`,this._handleResize),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.removeEventListener(`keydown`,this._onKeydown,!0),this._destroySticky(),this._unobserveSections()}willUpdate(e){super.willUpdate(e),!this.hasUpdated&&!this.activeId&&this._resolvedItems().length&&(this.activeId=`anchor-1`)}updated(e){if(super.updated(e),e.has(`stickyTop`)&&this.style.setProperty(`--sticky-top`,this.stickyTop||`0px`),(e.has(`stickyTop`)||e.has(`items`))&&this._scheduleSpy(),(e.has(`activeId`)||e.has(`items`))&&requestAnimationFrame(()=>this._updateIndicator(`updated`)),!e.has(`activeId`))return;let t=e.get(`activeId`);t!==void 0&&t!==``&&t!==this.activeId&&queueMicrotask(()=>this._playMobileDropdownLabelSwap())}firstUpdated(){requestAnimationFrame(()=>this._updateIndicator(`firstUpdated`))}_updateIndicator(e){let t=this.renderRoot?.querySelector(`.anchor-indicator`),n=this.renderRoot?.querySelector(`.anchor-links--desktop .anchor-link[current]`);if(!t||!n)return;let r=t.offsetWidth,i=r?n.offsetWidth/r:0,a=this.renderRoot.querySelector(`.bd-anchor-nav__inner`),o=a&&parseFloat(getComputedStyle(a).paddingBottom)||0,s=n.offsetTop+n.offsetHeight+o,c=()=>{t.style.translate=`${n.offsetLeft}px ${s}px`,t.style.scale=`${i} 1`};this._indicatorReady?c():(t.style.transition=`none`,c(),t.offsetWidth,t.style.transition=``,this._indicatorReady=!0)}_handleResize(){this._updateIndicator(`windowResize`),this._scheduleSpy()}_initSticky(){this.style.setProperty(`--sticky-top`,this.stickyTop||`0px`),!CSS.supports(`container-type: scroll-state`)&&(this._onStickyScroll=()=>{let e=parseFloat(getComputedStyle(this).top)||0,t=Math.abs(this.getBoundingClientRect().top-e)<1;this.classList.toggle(`is-sticky`,t&&window.scrollY>0)},window.addEventListener(`scroll`,this._onStickyScroll,{passive:!0}),window.addEventListener(`resize`,this._onStickyScroll,{passive:!0}),requestAnimationFrame(()=>this._onStickyScroll?.()))}_destroySticky(){this._onStickyScroll&&=(window.removeEventListener(`scroll`,this._onStickyScroll),window.removeEventListener(`resize`,this._onStickyScroll),null),this.classList.remove(`is-sticky`)}_cancelScrollSpyUnlock(){this._unlockScrollSpyTimer!=null&&(clearTimeout(this._unlockScrollSpyTimer),this._unlockScrollSpyTimer=null),this._scrollEndUnlockHandler&&=(window.removeEventListener(`scrollend`,this._scrollEndUnlockHandler),null)}_scheduleScrollSpyUnlock(){this._cancelScrollSpyUnlock();let e=()=>{this._cancelScrollSpyUnlock(),this._restoreScrollBehavior?.(),this._programmaticScrollTargetId=null,this._runScrollSpy()};this._scrollEndUnlockHandler=e,window.addEventListener(`scrollend`,e,{passive:!0});let t=window.scrollY,n=()=>{if(window.scrollY===t)return e();t=window.scrollY,this._unlockScrollSpyTimer=window.setTimeout(n,250)};this._unlockScrollSpyTimer=window.setTimeout(n,250)}_onKeydown(e){e.key===`Escape`&&this._dropdownOpen&&(this._dropdownOpen=!1,this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot?.querySelector(`.bd-anchor-nav__dropdown-toggle`)?.focus()))}_onDocumentPointerDown(e){this._dropdownOpen&&(e.composedPath().includes(this)||(this._dropdownOpen=!1,this.requestUpdate()))}_scheduleSpy(){this._spyFrame||=requestAnimationFrame(()=>{this._spyFrame=0,this._observeSections()})}_observeSections(){let e=this._resolvedItems().map(({href:e},t)=>document.getElementById(f(e,t+1))),t=this._stickyOffsetPx(),n=t+2,r=document.documentElement.clientHeight;if(n===this._spyLine&&r===this._spyViewport&&e.length===this._sections.length&&e.every((e,t)=>e===this._sections[t]))return;for(let t of this._sections)t&&!e.includes(t)&&t.style.removeProperty(`scroll-margin-top`);for(let n of e)n?.style.setProperty(`scroll-margin-top`,`${t}px`);this._spyObserver?.disconnect(),this._ctaObserver?.disconnect(),this._spyObserver=this._ctaObserver=null,e[0]!==this._sections[0]&&(this._firstSectionBehind=!1),this._passed=new Map(e.filter(e=>this._passed.has(e)).map(e=>[e,this._passed.get(e)])),this._sections=e,this._spyLine=n,this._spyViewport=r;let i=e.filter(Boolean);i.length&&(this._spyObserver=new IntersectionObserver(this._onSectionsCrossLine,{root:document,rootMargin:`${p} 0px ${n-r}px 0px`}),i.forEach(e=>this._spyObserver.observe(e))),e[0]&&(this._ctaObserver=new IntersectionObserver(this._onFirstSectionCross,{root:document,rootMargin:`0px 0px ${p} 0px`}),this._ctaObserver.observe(e[0])),this._runScrollSpy()}_unobserveSections(){cancelAnimationFrame(this._spyFrame),this._spyFrame=0,this._layoutObserver?.disconnect(),this._spyObserver?.disconnect(),this._ctaObserver?.disconnect(),this._layoutObserver=this._spyObserver=this._ctaObserver=null;for(let e of this._sections)e?.style.removeProperty(`scroll-margin-top`);this._sections=[],this._passed=/* @__PURE__ */ new Map}_onSectionsCrossLine(e){for(let{target:t,isIntersecting:n,boundingClientRect:r,rootBounds:i}of e)this._passed.set(t,n||r.bottom<i.top);this._runScrollSpy()}_onFirstSectionCross(e){let{boundingClientRect:t,rootBounds:n}=e[e.length-1];this._firstSectionBehind=t.bottom<=n.top,this._runScrollSpy()}_resolvedItems(){return this.items&&this.items.length?this.items.map((e,t)=>({title:e.title,href:e.href||`#anchor-${t+1}-section`,id:`anchor-${t+1}`})):Array.from(this.children).filter(e=>e.tagName===`BD-ANCHOR-NAV-ITEM`).map((e,t)=>({title:e.getAttribute(`title`),href:e.getAttribute(`href`)||`#anchor-${t+1}-section`,id:`anchor-${t+1}`}))}_runScrollSpy(){let e=this.activeId;this._sections.length&&!this._programmaticScrollTargetId&&(e=`anchor-1`,this._sections.forEach((t,n)=>{t&&this._passed.get(t)&&(e=`anchor-${n+1}`)})),this.activeId=e,this._mobileCtaRevealed=!this._sections[0]||this._firstSectionBehind}_playMobileDropdownLabelSwap(){if(typeof window>`u`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||!t(`md`))return;let e=this.renderRoot?.querySelector(`.bd-anchor-nav__dropdown-label`);e&&(e.classList.remove(`bd-anchor-nav__dropdown-label--swap`),e.offsetWidth,e.classList.add(`bd-anchor-nav__dropdown-label--swap`),e.addEventListener(`animationend`,()=>e.classList.remove(`bd-anchor-nav__dropdown-label--swap`),{once:!0}))}_stickyOffsetPx(){let e=this.offsetHeight,t=parseFloat(getComputedStyle(this).top)||0,n=d(getComputedStyle(this).getPropertyValue(`--spacing-8`).trim())||8;return e>0?e+n+t:d(getComputedStyle(this).getPropertyValue(`--spacing-128`).trim())||128}handleClick(e,t,n){if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;this._cancelScrollSpyUnlock(),this._programmaticScrollTargetId=null,this.activeId=t;let r=f(n,t.replace(/^anchor-/,``));document.getElementById(r)&&(this._programmaticScrollTargetId=t,this._smoothFragmentScroll(),this._scheduleScrollSpyUnlock())}_smoothFragmentScroll(){if(this._restoreScrollBehavior||!window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches)return;let e=document.documentElement,t=e.style.scrollBehavior;e.style.scrollBehavior=`smooth`,this._restoreScrollBehavior=()=>{e.style.scrollBehavior=t,this._restoreScrollBehavior=null}}_toggleDropdown(e){m||(e.preventDefault(),e.stopPropagation(),this._dropdownOpen=!this._dropdownOpen)}_onPanelToggle(e){this._dropdownOpen=e.newState===`open`}_selectFromDropdown(e,t,n){if(m){let e=this.renderRoot.querySelector(`.bd-anchor-nav__dropdown-panel`);e?.matches(`:popover-open`)&&e.hidePopover()}else this._dropdownOpen=!1;this.handleClick(e,t,n)}_activeLabel(e){let t=/^anchor-(\d+)$/.exec(this.activeId||``),n=t?parseInt(t[1],10):1;return e[Math.min(Math.max(n-1,0),Math.max(0,e.length-1))]?.title||e[0]?.title||`Section`}render(){let e=this._resolvedItems(),t=this._activeLabel(e),n=t=>s`
|
|
2
2
|
<div class="${t}">
|
|
3
3
|
${e.map(({id:e,title:t,href:n})=>{let r=this.activeId===e;return s`
|
|
4
4
|
<bd-link
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-nav.js","names":["_decorate","__decorate","parseLengthToPx","s","value","root","sectionIdOf","href","n","FAR","NATIVE_POPOVER","BdAnchorNavItem","defineElement","BdAnchorNav","LitElement","ensembleCSS","anchorNavStyles","ObserverController","links","observer","changedProperties","prev","indicator","activeLink","row","scale","inner","gap","top","place","atTop","unlock","lastY","unlockOnceStill","sections","i","offset","line","viewport","el","found","entries","target","boundingClientRect","rootBounds","item","next","matchesBelow","barPx","stickyTopPx","insetPx","event","id","sectionId","before","panel","m","resolved","dropdownLabel","linkRow","cls","isActive","nothing","e","title","innerStyle","state","property"],"sources":["../../../../src/components/anchor/anchor-nav.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { ObserverController } from \"#shared/controller.observer.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport \"#components/icons/arrow-down-icon.ts\";\nimport \"#components/button/button.ts\";\nimport \"#components/link/link.ts\";\nimport { anchorNavStyles } from \"./anchor-nav.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport { matchesBelow } from \"#shared/token-scales.ts\";\n\nfunction parseLengthToPx(value: string) {\n const s = (value || \"\").trim();\n if (!s) return 0;\n if (s.endsWith(\"px\")) return parseFloat(s);\n if (s.endsWith(\"rem\")) {\n const root = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n return parseFloat(s) * root;\n }\n return parseFloat(s) || 0;\n}\n\nconst sectionIdOf = (href: string, n: number | string) => (href || \"\").replace(/^#/, \"\") || `anchor-${n}-section`;\n\n/* \"The rest of the page\" as a root margin: a hundred viewports. Each observer\n below watches one edge, and a jump only registers if it carries a section\n across that edge while still inside the root -- so the root reaches this far\n past the edge, beyond any jump a real page makes. */\nconst FAR = \"10000%\";\n\n/* The dropdown panel is a popover only where it can also be anchored to its\n toggle: in the top layer it leaves the toggle's box, and without anchor\n positioning it would sit in the middle of the viewport. Both are newer than\n the Widely available target, so elsewhere the panel keeps its z-index and\n the document listeners close it. */\nconst NATIVE_POPOVER = \"popover\" in HTMLElement.prototype && CSS.supports(\"anchor-name: --a\");\n\ninterface AnchorNavItem {\n title: string;\n href?: string;\n}\n\ninterface ResolvedItem {\n title: string | null;\n href : string;\n id : string;\n}\n\n@defineElement(\"bd-anchor-nav-item\")\nclass BdAnchorNavItem extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: \"open\" });\n }\n connectedCallback() { this.render(); }\n render() { this.shadowRoot!.innerHTML = `<slot></slot>`; }\n}\n\n@defineElement(\"bd-anchor-nav\")\nclass BdAnchorNav extends LitElement {\n static styles = [ensembleCSS, anchorNavStyles];\n\n @state()\n activeId = \"\";\n @property({ type: String, attribute: \"aria-label\" })\n navLabel = \"Section navigation\";\n @state()\n _dropdownOpen = false;\n @state()\n _mobileCtaRevealed = false;\n @property({ type: String, attribute: \"cta-label\" })\n ctaLabel = \"Buy now\";\n @property({ type: String, attribute: \"cta-href\" })\n ctaHref = \"\";\n @property({ type: Array })\n items: AnchorNavItem[] | null = null;\n @property({ type: String, attribute: \"max-width\" })\n maxWidth = \"\";\n @property({ type: String, attribute: \"sticky-top\" })\n stickyTop = \"0px\";\n\n _panelId : string;\n _spyFrame : number;\n _spyObserver : IntersectionObserver | null;\n _ctaObserver : IntersectionObserver | null;\n _layoutObserver : ResizeObserver | null;\n _sections : (HTMLElement | null)[];\n _spyLine : number;\n _spyViewport : number;\n _passed : Map<Element | null, boolean | undefined>;\n _firstSectionBehind : boolean;\n _programmaticScrollTargetId: string | null;\n _unlockScrollSpyTimer : number | null;\n _scrollEndUnlockHandler : (() => void) | null;\n _onStickyScroll : (() => void) | null;\n _restoreScrollBehavior : (() => void) | null;\n _indicatorReady : boolean;\n\n /* The indicator follows the link row's size and the bar's for as long as\n the nav is connected. It used to start in firstUpdated and stop on\n disconnect, so a nav moved in the page left its indicator where it was. */\n _indicatorSize = new ObserverController(this,\n () => new ResizeObserver(() => this._updateIndicator(\"ResizeObserver\")),\n observer => {\n const links = this.renderRoot.querySelector(\".anchor-links--desktop\");\n if (!links) return;\n observer.observe(links);\n observer.observe(this);\n });\n\n constructor() {\n super();\n this._panelId = `bd-anchor-nav-panel-${Math.random().toString(36)\n .slice(2, 11)}`;\n this._onDocumentPointerDown = this._onDocumentPointerDown.bind(this);\n this._onKeydown = this._onKeydown.bind(this);\n this._onSectionsCrossLine = this._onSectionsCrossLine.bind(this);\n this._onFirstSectionCross = this._onFirstSectionCross.bind(this);\n this._scheduleSpy = this._scheduleSpy.bind(this);\n this._spyFrame = 0;\n this._spyObserver = null;\n this._ctaObserver = null;\n this._layoutObserver = null;\n this._sections = [];\n this._spyLine = 0;\n this._spyViewport = 0;\n this._passed = new Map();\n this._firstSectionBehind = false;\n this._programmaticScrollTargetId = null;\n this._unlockScrollSpyTimer = null;\n this._scrollEndUnlockHandler = null;\n this._onStickyScroll = null;\n this._restoreScrollBehavior = null;\n this._handleResize = this._handleResize.bind(this);\n this._indicatorReady = false;\n }\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this._handleResize);\n if (!NATIVE_POPOVER) {\n document.addEventListener(\"pointerdown\", this._onDocumentPointerDown, true);\n document.addEventListener(\"keydown\", this._onKeydown, true);\n }\n this._initSticky();\n /* The bar's height moves the line the sections are read against, and the\n page growing may bring a section that was not there yet. */\n this._layoutObserver = new ResizeObserver(this._scheduleSpy);\n this._layoutObserver.observe(this);\n this._layoutObserver.observe(document.documentElement);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._cancelScrollSpyUnlock();\n this._restoreScrollBehavior?.();\n window.removeEventListener(\"resize\", this._handleResize);\n document.removeEventListener(\"pointerdown\", this._onDocumentPointerDown, true);\n document.removeEventListener(\"keydown\", this._onKeydown, true);\n this._destroySticky();\n this._unobserveSections();\n }\n\n /* The first item is active before the first render, not after it: state set\n in firstUpdated or updated starts a second render, the one Lit warns about\n as change-in-update. */\n willUpdate(changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties);\n if (!this.hasUpdated && !this.activeId && this._resolvedItems().length) this.activeId = \"anchor-1\";\n }\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (changedProperties.has(\"stickyTop\")) {\n this.style.setProperty(\"--sticky-top\", this.stickyTop || \"0px\");\n }\n\n if (changedProperties.has(\"stickyTop\") || changedProperties.has(\"items\")) {\n this._scheduleSpy();\n }\n\n if (changedProperties.has(\"activeId\") || changedProperties.has(\"items\")) {\n requestAnimationFrame(() => this._updateIndicator(\"updated\"));\n }\n\n if (!changedProperties.has(\"activeId\")) return;\n const prev = changedProperties.get(\"activeId\");\n if (prev === undefined || prev === \"\") return;\n if (prev === this.activeId) return;\n queueMicrotask(() => this._playMobileDropdownLabelSwap());\n }\n\n firstUpdated() {\n requestAnimationFrame(() => this._updateIndicator(\"firstUpdated\"));\n }\n\n /* The indicator spans the link row and is moved and sized on the\n compositor: translate to the current link's corner, scale to its width.\n It used to animate top and width, which laid the bar out again on every\n frame of the slide. The offsets are physical -- offsetLeft is -- so the\n indicator is anchored at the row's physical left, on a right-to-left\n page too. */\n _updateIndicator(_caller?: string) {\n const indicator = this.renderRoot?.querySelector<HTMLElement>(\".anchor-indicator\");\n const activeLink = this.renderRoot?.querySelector<HTMLElement>(\n \".anchor-links--desktop .anchor-link[current]\"\n );\n if (!indicator || !activeLink) return;\n\n const row = indicator.offsetWidth;\n const scale = row ? activeLink.offsetWidth / row : 0;\n // The bar's bottom edge is the inner's padding-bottom below the link.\n const inner = this.renderRoot.querySelector(\".bd-anchor-nav__inner\");\n const gap = inner ? parseFloat(getComputedStyle(inner).paddingBottom) || 0 : 0;\n const top = activeLink.offsetTop + activeLink.offsetHeight + gap;\n\n const place = () => {\n indicator.style.translate = `${activeLink.offsetLeft}px ${top}px`;\n indicator.style.scale = `${scale} 1`;\n };\n\n if (!this._indicatorReady) {\n indicator.style.transition = \"none\";\n place();\n void indicator.offsetWidth;\n indicator.style.transition = \"\";\n this._indicatorReady = true;\n return;\n }\n\n place();\n }\n\n _handleResize() {\n this._updateIndicator(\"windowResize\");\n // The viewport's height places the spy's line inside its root.\n this._scheduleSpy();\n }\n\n /* The bar sticks with position: sticky, which keeps its own place in the\n flow and lets go at the end of its parent, so nothing here positions it.\n It used to: past its top it switched to position: fixed at the\n viewport's width, measured its parent to know when to let go, and left a\n placeholder behind to hold its space.\n\n While stuck it draws a shadow. A scroll-state container query says when\n that is, and it is newer than the Widely available target; where it is\n missing, this tells instead: the bar sits at its sticky top -- read as\n the browser resolved it, as _stickyOffsetPx() reads it, so calc(), em\n and custom properties count -- and the page has scrolled. A bar that\n merely rests at that line on an unscrolled page is not stuck, as the\n query would not call it. */\n _initSticky() {\n this.style.setProperty(\"--sticky-top\", this.stickyTop || \"0px\");\n if (CSS.supports(\"container-type: scroll-state\")) return;\n\n this._onStickyScroll = () => {\n const top = parseFloat(getComputedStyle(this).top) || 0;\n const atTop = Math.abs(this.getBoundingClientRect().top - top) < 1;\n this.classList.toggle(\"is-sticky\", atTop && window.scrollY > 0);\n };\n window.addEventListener(\"scroll\", this._onStickyScroll, { passive: true });\n window.addEventListener(\"resize\", this._onStickyScroll, { passive: true });\n /* Removed within a frame of connecting, the bar has torn this down. */\n requestAnimationFrame(() => this._onStickyScroll?.());\n }\n\n _destroySticky() {\n if (this._onStickyScroll) {\n window.removeEventListener(\"scroll\", this._onStickyScroll);\n window.removeEventListener(\"resize\", this._onStickyScroll);\n this._onStickyScroll = null;\n }\n this.classList.remove(\"is-sticky\");\n }\n\n _cancelScrollSpyUnlock() {\n if (this._unlockScrollSpyTimer != null) {\n clearTimeout(this._unlockScrollSpyTimer);\n this._unlockScrollSpyTimer = null;\n }\n if (this._scrollEndUnlockHandler) {\n window.removeEventListener(\"scrollend\", this._scrollEndUnlockHandler);\n this._scrollEndUnlockHandler = null;\n }\n }\n\n /* The click's item stays active until the scroll is over. scrollend says so\n where the browser has it. The timer is for a click that scrolls nothing,\n which no scrollend follows, and for browsers without the event: it ends\n the lock once the page has stopped moving. It used to end it after a\n fixed second, and a long smooth scroll outlasts that -- measured 1.3s\n from the first section to the third on the playground at 1280, with the\n second item lit for the last 250ms of it. */\n _scheduleScrollSpyUnlock() {\n this._cancelScrollSpyUnlock();\n const unlock = () => {\n this._cancelScrollSpyUnlock();\n this._restoreScrollBehavior?.();\n this._programmaticScrollTargetId = null;\n this._runScrollSpy();\n };\n this._scrollEndUnlockHandler = unlock;\n window.addEventListener(\"scrollend\", unlock, { passive: true });\n let lastY = window.scrollY;\n const unlockOnceStill = () => {\n if (window.scrollY === lastY) return unlock();\n lastY = window.scrollY;\n this._unlockScrollSpyTimer = window.setTimeout(unlockOnceStill, 250);\n };\n this._unlockScrollSpyTimer = window.setTimeout(unlockOnceStill, 250);\n }\n\n _onKeydown(e: KeyboardEvent) {\n if (e.key === \"Escape\" && this._dropdownOpen) {\n this._dropdownOpen = false;\n this.requestUpdate();\n this.updateComplete.then(() =>\n this.renderRoot?.querySelector<HTMLButtonElement>(\".bd-anchor-nav__dropdown-toggle\")?.focus());\n }\n }\n\n _onDocumentPointerDown(e: PointerEvent) {\n if (!this._dropdownOpen) return;\n const path = e.composedPath();\n if (path.includes(this)) return;\n this._dropdownOpen = false;\n this.requestUpdate();\n }\n\n _scheduleSpy() {\n if (this._spyFrame) return;\n this._spyFrame = requestAnimationFrame(() => {\n this._spyFrame = 0;\n this._observeSections();\n });\n }\n\n /* Scroll-spy, without reading the page on every scroll. The active item is\n the last section whose top has reached a line just under the stuck bar,\n and two IntersectionObservers say when an edge crosses:\n\n - the spy's root ends at that line and reaches FAR above it, so a section\n is inside it exactly while its top is past the line;\n - the CTA's root starts at the top of the viewport and reaches FAR below,\n so the first section leaves it exactly when its bottom scrolls off.\n\n Each entry carries the target's box, so the callbacks read nothing. The\n line depends on the bar's height, the sticky top and the viewport, and a\n root margin cannot change, so the observers are rebuilt when one moves. */\n _observeSections() {\n const sections = this._resolvedItems()\n .map(({ href }, i) => document.getElementById(sectionIdOf(href, i + 1)));\n const offset = this._stickyOffsetPx();\n // 2px under where a click leaves the section, so a section the bar has just\n // scrolled to counts as reached.\n const line = offset + 2;\n const viewport = document.documentElement.clientHeight;\n\n if (line === this._spyLine && viewport === this._spyViewport &&\n sections.length === this._sections.length &&\n sections.every((el, i) => el === this._sections[i])) return;\n\n /* A section a click scrolls to stops under the bar, not behind it, and so\n does one the URL's hash or the back button brings into view. */\n for (const el of this._sections) {\n if (el && !sections.includes(el)) el.style.removeProperty(\"scroll-margin-top\");\n }\n for (const el of sections) el?.style.setProperty(\"scroll-margin-top\", `${offset}px`);\n\n this._spyObserver?.disconnect();\n this._ctaObserver?.disconnect();\n this._spyObserver = this._ctaObserver = null;\n if (sections[0] !== this._sections[0]) this._firstSectionBehind = false;\n this._passed = new Map(sections.filter((el) => this._passed.has(el))\n .map((el) => [el, this._passed.get(el)]));\n this._sections = sections;\n this._spyLine = line;\n this._spyViewport = viewport;\n\n const found = sections.filter(Boolean) as HTMLElement[];\n if (found.length) {\n this._spyObserver = new IntersectionObserver(this._onSectionsCrossLine, {\n root : document,\n rootMargin: `${FAR} 0px ${line - viewport}px 0px`\n });\n found.forEach((el) => this._spyObserver!.observe(el));\n }\n if (sections[0]) {\n this._ctaObserver = new IntersectionObserver(this._onFirstSectionCross, {\n root : document,\n rootMargin: `0px 0px ${FAR} 0px`\n });\n this._ctaObserver.observe(sections[0]);\n }\n this._runScrollSpy();\n }\n\n _unobserveSections() {\n cancelAnimationFrame(this._spyFrame);\n this._spyFrame = 0;\n this._layoutObserver?.disconnect();\n this._spyObserver?.disconnect();\n this._ctaObserver?.disconnect();\n this._layoutObserver = this._spyObserver = this._ctaObserver = null;\n for (const el of this._sections) el?.style.removeProperty(\"scroll-margin-top\");\n this._sections = [];\n this._passed = new Map();\n }\n\n _onSectionsCrossLine(entries: IntersectionObserverEntry[]) {\n for (const { target, boundingClientRect, rootBounds } of entries) {\n this._passed.set(target, boundingClientRect.top <= rootBounds!.bottom);\n }\n this._runScrollSpy();\n }\n\n _onFirstSectionCross(entries: IntersectionObserverEntry[]) {\n const { boundingClientRect, rootBounds } = entries[entries.length - 1];\n this._firstSectionBehind = boundingClientRect.bottom <= rootBounds!.top;\n this._runScrollSpy();\n }\n\n _resolvedItems(): ResolvedItem[] {\n if (this.items && this.items.length) {\n return this.items.map((item, i) => ({\n title: item.title,\n href : item.href || `#anchor-${i + 1}-section`,\n id : `anchor-${i + 1}`\n }));\n }\n return Array.from(this.children)\n .filter((el) => el.tagName === \"BD-ANCHOR-NAV-ITEM\")\n .map((el, i) => ({\n title: el.getAttribute(\"title\"),\n href : el.getAttribute(\"href\") || `#anchor-${i + 1}-section`,\n id : `anchor-${i + 1}`\n }));\n }\n\n /* Read off what the observers last reported; while a click's scroll runs,\n the item it chose stays active. The CTA flag is set at every width, since\n only the stylesheet below md hides the CTA until the first section is\n behind the reader. */\n _runScrollSpy() {\n let next = this.activeId;\n\n if (this._sections.length && !this._programmaticScrollTargetId) {\n next = \"anchor-1\";\n this._sections.forEach((el, i) => {\n if (el && this._passed.get(el)) next = `anchor-${i + 1}`;\n });\n }\n\n this.activeId = next;\n this._mobileCtaRevealed = !this._sections[0] || this._firstSectionBehind;\n }\n\n _playMobileDropdownLabelSwap() {\n if (typeof window === \"undefined\") return;\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n if (!matchesBelow('md')) return;\n const el = this.renderRoot?.querySelector<HTMLElement>(\".bd-anchor-nav__dropdown-label\");\n if (!el) return;\n el.classList.remove(\"bd-anchor-nav__dropdown-label--swap\");\n void el.offsetWidth;\n el.classList.add(\"bd-anchor-nav__dropdown-label--swap\");\n el.addEventListener(\n \"animationend\",\n () => el.classList.remove(\"bd-anchor-nav__dropdown-label--swap\"),\n { once: true }\n );\n }\n\n /* Where a section stops under the bar: the sticky top, the bar, and a gap.\n The sticky top is read as the browser resolved it, so any length\n sticky-top accepts -- rem, calc(), a custom property -- counts. */\n _stickyOffsetPx() {\n const barPx = this.offsetHeight;\n const stickyTopPx = parseFloat(getComputedStyle(this).top) || 0;\n const insetRaw = getComputedStyle(this).getPropertyValue(\"--spacing-8\")\n .trim();\n const insetPx = parseLengthToPx(insetRaw) || 8;\n if (barPx > 0) return barPx + insetPx + stickyTopPx;\n const fallback = getComputedStyle(this).getPropertyValue(\"--spacing-128\")\n .trim();\n return parseLengthToPx(fallback) || 128;\n }\n\n /* A section link is an ordinary fragment link, and the browser follows it:\n the hash goes into the URL as a history entry, :target moves to the\n section, and the next Tab starts from there. This used to stop the\n click and scroll by hand -- pushState and scrollIntoView -- which kept\n the URL but left :target and the Tab position behind, so a keyboard\n reader who chose \"Pricing\" tabbed on through the nav. The section's own\n scroll-margin-top keeps it clear of the bar.\n\n The click's item stays current until the scroll is over, so the spy\n does not light the sections it passes on the way. A click with a\n modifier, or on an item whose section is not on this page, is left to\n the browser as an ordinary link. */\n handleClick(event: MouseEvent, id: string, href: string) {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n this._cancelScrollSpyUnlock();\n this._programmaticScrollTargetId = null;\n this.activeId = id;\n const sectionId = sectionIdOf(href, id.replace(/^anchor-/, \"\"));\n if (!document.getElementById(sectionId)) return;\n\n this._programmaticScrollTargetId = id;\n this._smoothFragmentScroll();\n this._scheduleScrollSpyUnlock();\n }\n\n /* Fragment navigation scrolls with the root's scroll-behavior, and the\n page's <html> is not this component's to style. So for a reader who has\n not asked for less motion, the click sets it to smooth for the length of\n this one scroll -- before the navigation runs, which is after the click\n listeners -- and gives back whatever the page had when the scroll ends. */\n _smoothFragmentScroll() {\n if (this._restoreScrollBehavior) return;\n if (!window.matchMedia(\"(prefers-reduced-motion: no-preference)\").matches) return;\n const root = document.documentElement;\n const before = root.style.scrollBehavior;\n root.style.scrollBehavior = \"smooth\";\n this._restoreScrollBehavior = () => {\n root.style.scrollBehavior = before;\n this._restoreScrollBehavior = null;\n };\n }\n\n /* With a native popover, popovertarget opens and closes the panel and the\n toggle event reports it; this handler is the fallback's. */\n _toggleDropdown(e: Event) {\n if (NATIVE_POPOVER) return;\n e.preventDefault();\n e.stopPropagation();\n this._dropdownOpen = !this._dropdownOpen;\n }\n\n _onPanelToggle(e: ToggleEvent) {\n this._dropdownOpen = e.newState === \"open\";\n }\n\n _selectFromDropdown(e: MouseEvent, id: string, href: string) {\n if (NATIVE_POPOVER) {\n const panel = this.renderRoot.querySelector<HTMLElement>(\".bd-anchor-nav__dropdown-panel\");\n if (panel?.matches(\":popover-open\")) panel.hidePopover();\n } else {\n this._dropdownOpen = false;\n }\n this.handleClick(e, id, href);\n }\n\n _activeLabel(resolved: ResolvedItem[]) {\n const m = /^anchor-(\\d+)$/.exec(this.activeId || \"\");\n const n = m ? parseInt(m[1], 10) : 1;\n const idx = Math.min(Math.max(n - 1, 0), Math.max(0, resolved.length - 1));\n return resolved[idx]?.title || resolved[0]?.title || \"Section\";\n }\n\n render() {\n const resolved = this._resolvedItems();\n const dropdownLabel = this._activeLabel(resolved);\n\n const linkRow = (cls: string) => html`\n <div class=\"${cls}\">\n ${resolved.map(({ id, title, href }) => {\n const isActive = this.activeId === id;\n return html`\n <bd-link\n href=\"${href}\"\n variant=\"primary\"\n no-underline\n class=\"anchor-link\"\n current=${isActive ? \"location\" : nothing}\n @click=${(e: MouseEvent) => this.handleClick(e, id, href)}\n >${title}</bd-link>\n `;\n })}\n <span class=\"anchor-indicator\" aria-hidden=\"true\"></span>\n </div>\n `;\n\n const innerStyle = this.maxWidth ? `max-width: ${this.maxWidth};` : '';\n\n return html`\n <nav aria-label=${this.navLabel}>\n <div\n class=\"bd-ensemble bd-anchor-nav__inner\"\n part=\"inner\"\n style=\"${innerStyle}\"\n ?data-mobile-cta-visible=${this._mobileCtaRevealed}\n >\n ${linkRow(\"anchor-links anchor-links--desktop\")}\n\n <div class=\"bd-anchor-nav__dropdown\" part=\"dropdown\">\n <button\n type=\"button\"\n class=\"bd-anchor-nav__dropdown-toggle\"\n aria-expanded=${this._dropdownOpen ? \"true\" : \"false\"}\n aria-controls=${this._panelId}\n popovertarget=${NATIVE_POPOVER ? this._panelId : nothing}\n @click=${this._toggleDropdown}\n >\n <span class=\"bd-anchor-nav__dropdown-label\">${dropdownLabel}</span>\n <span class=\"bd-anchor-nav__dropdown-chevron\" aria-hidden=\"true\">\n <bd-arrow-down-icon size=\"md\"></bd-arrow-down-icon>\n </span>\n </button>\n <div\n class=\"bd-anchor-nav__dropdown-panel\"\n id=${this._panelId}\n popover=${NATIVE_POPOVER ? \"auto\" : nothing}\n ?hidden=${!NATIVE_POPOVER && !this._dropdownOpen}\n @toggle=${this._onPanelToggle}\n >\n <ul class=\"bd-anchor-nav__dropdown-list\">\n ${resolved.map(({ id, title, href }) => {\n const isActive = this.activeId === id;\n return html`\n <li>\n <a\n href=\"${href}\"\n class=\"bd-anchor-nav__dropdown-option\"\n aria-current=${isActive ? \"location\" : nothing}\n @click=${(e: MouseEvent) => this._selectFromDropdown(e, id, href)}\n >${title}</a>\n </li>\n `;\n })}\n </ul>\n </div>\n </div>\n\n <div class=\"bd-cta\">\n <div class=\"bd-cta__inner\"><slot name=\"cta\"></slot></div>\n </div>\n </div>\n </nav>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-anchor-nav-item\": BdAnchorNavItem;\n \"bd-anchor-nav\" : BdAnchorNav;\n }\n}\n"],"mappings":"A,0lBAaA,SAASE,EAAgB,EAAe,CACtC,IAAMC,GAAKC,GAAS,GAAA,CAAI,KAAK,EAC7B,GAAI,CAACD,EAAG,MAAO,GACf,GAAIA,EAAE,SAAS,IAAI,EAAG,OAAO,WAAWA,CAAC,EACzC,GAAIA,EAAE,SAAS,KAAK,EAAG,CACrB,IAAME,EAAO,WAAW,iBAAiB,SAAS,eAAe,CAAC,CAAC,QAAQ,GAA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AAQ,UAAW,WAAY,CAAC,CAAA,EAAAtD,EAAA,UAAA,WAAA,IAAA,EAAA,EAEjDb,EAAA,CAAAmE,EAAS,CAAE,KAAM,OAAQ,UAAW,UAAW,CAAC,CAAA,EAAAtD,EAAA,UAAA,UAAA,IAAA,EAAA,EAEhDb,EAAA,CAAAmE,EAAS,CAAE,KAAM,KAAM,CAAC,CAAA,EAAAtD,EAAA,UAAA,QAAA,IAAA,EAAA,EAExBb,EAAA,CAAAmE,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,CAAA,EAAAtD,EAAA,UAAA,WAAA,IAAA,EAAA,EAEjDb,EAAA,CAAAmE,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,CAAC,CAAA,EAAAtD,EAAA,UAAA,YAAA,IAAA,EAAA,EApBpD,EAAAb,EAAA,CAAAY,EAAc,eAAe,CAAA,EAAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"anchor-nav.js","names":["_decorate","__decorate","parseLengthToPx","s","value","root","sectionIdOf","href","n","FAR","NATIVE_POPOVER","BdAnchorNavItem","defineElement","BdAnchorNav","LitElement","ensembleCSS","anchorNavStyles","ObserverController","links","observer","changedProperties","prev","indicator","activeLink","row","scale","inner","gap","top","place","atTop","unlock","lastY","unlockOnceStill","sections","i","offset","line","viewport","el","found","entries","target","isIntersecting","boundingClientRect","rootBounds","item","next","matchesBelow","barPx","stickyTopPx","insetPx","event","id","sectionId","before","panel","m","resolved","dropdownLabel","linkRow","cls","isActive","nothing","e","title","innerStyle","state","property"],"sources":["../../../../src/components/anchor/anchor-nav.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { ObserverController } from \"#shared/controller.observer.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport \"#components/icons/arrow-down-icon.ts\";\nimport \"#components/button/button.ts\";\nimport \"#components/link/link.ts\";\nimport { anchorNavStyles } from \"./anchor-nav.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport { matchesBelow } from \"#shared/token-scales.ts\";\n\nfunction parseLengthToPx(value: string) {\n const s = (value || \"\").trim();\n if (!s) return 0;\n if (s.endsWith(\"px\")) return parseFloat(s);\n if (s.endsWith(\"rem\")) {\n const root = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n return parseFloat(s) * root;\n }\n return parseFloat(s) || 0;\n}\n\nconst sectionIdOf = (href: string, n: number | string) => (href || \"\").replace(/^#/, \"\") || `anchor-${n}-section`;\n\n/* \"The rest of the page\" as a root margin: a hundred viewports. Each observer\n below watches one edge, and a jump only registers if it carries a section\n across that edge while still inside the root -- so the root reaches this far\n past the edge, beyond any jump a real page makes. */\nconst FAR = \"10000%\";\n\n/* The dropdown panel is a popover only where it can also be anchored to its\n toggle: in the top layer it leaves the toggle's box, and without anchor\n positioning it would sit in the middle of the viewport. Both are newer than\n the Widely available target, so elsewhere the panel keeps its z-index and\n the document listeners close it. */\nconst NATIVE_POPOVER = \"popover\" in HTMLElement.prototype && CSS.supports(\"anchor-name: --a\");\n\ninterface AnchorNavItem {\n title: string;\n href?: string;\n}\n\ninterface ResolvedItem {\n title: string | null;\n href : string;\n id : string;\n}\n\n@defineElement(\"bd-anchor-nav-item\")\nclass BdAnchorNavItem extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: \"open\" });\n }\n connectedCallback() { this.render(); }\n render() { this.shadowRoot!.innerHTML = `<slot></slot>`; }\n}\n\n@defineElement(\"bd-anchor-nav\")\nclass BdAnchorNav extends LitElement {\n static styles = [ensembleCSS, anchorNavStyles];\n\n @state()\n activeId = \"\";\n @property({ type: String, attribute: \"aria-label\" })\n navLabel = \"Section navigation\";\n @state()\n _dropdownOpen = false;\n @state()\n _mobileCtaRevealed = false;\n @property({ type: String, attribute: \"cta-label\" })\n ctaLabel = \"Buy now\";\n @property({ type: String, attribute: \"cta-href\" })\n ctaHref = \"\";\n @property({ type: Array })\n items: AnchorNavItem[] | null = null;\n @property({ type: String, attribute: \"max-width\" })\n maxWidth = \"\";\n @property({ type: String, attribute: \"sticky-top\" })\n stickyTop = \"0px\";\n\n _panelId : string;\n _spyFrame : number;\n _spyObserver : IntersectionObserver | null;\n _ctaObserver : IntersectionObserver | null;\n _layoutObserver : ResizeObserver | null;\n _sections : (HTMLElement | null)[];\n _spyLine : number;\n _spyViewport : number;\n _passed : Map<Element | null, boolean | undefined>;\n _firstSectionBehind : boolean;\n _programmaticScrollTargetId: string | null;\n _unlockScrollSpyTimer : number | null;\n _scrollEndUnlockHandler : (() => void) | null;\n _onStickyScroll : (() => void) | null;\n _restoreScrollBehavior : (() => void) | null;\n _indicatorReady : boolean;\n\n /* The indicator follows the link row's size and the bar's for as long as\n the nav is connected. It used to start in firstUpdated and stop on\n disconnect, so a nav moved in the page left its indicator where it was. */\n _indicatorSize = new ObserverController(this,\n () => new ResizeObserver(() => this._updateIndicator(\"ResizeObserver\")),\n observer => {\n const links = this.renderRoot.querySelector(\".anchor-links--desktop\");\n if (!links) return;\n observer.observe(links);\n observer.observe(this);\n });\n\n constructor() {\n super();\n this._panelId = `bd-anchor-nav-panel-${Math.random().toString(36)\n .slice(2, 11)}`;\n this._onDocumentPointerDown = this._onDocumentPointerDown.bind(this);\n this._onKeydown = this._onKeydown.bind(this);\n this._onSectionsCrossLine = this._onSectionsCrossLine.bind(this);\n this._onFirstSectionCross = this._onFirstSectionCross.bind(this);\n this._scheduleSpy = this._scheduleSpy.bind(this);\n this._spyFrame = 0;\n this._spyObserver = null;\n this._ctaObserver = null;\n this._layoutObserver = null;\n this._sections = [];\n this._spyLine = 0;\n this._spyViewport = 0;\n this._passed = new Map();\n this._firstSectionBehind = false;\n this._programmaticScrollTargetId = null;\n this._unlockScrollSpyTimer = null;\n this._scrollEndUnlockHandler = null;\n this._onStickyScroll = null;\n this._restoreScrollBehavior = null;\n this._handleResize = this._handleResize.bind(this);\n this._indicatorReady = false;\n }\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this._handleResize);\n if (!NATIVE_POPOVER) {\n document.addEventListener(\"pointerdown\", this._onDocumentPointerDown, true);\n document.addEventListener(\"keydown\", this._onKeydown, true);\n }\n this._initSticky();\n /* The bar's height moves the line the sections are read against, and the\n page growing may bring a section that was not there yet. */\n this._layoutObserver = new ResizeObserver(this._scheduleSpy);\n this._layoutObserver.observe(this);\n this._layoutObserver.observe(document.documentElement);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._cancelScrollSpyUnlock();\n this._restoreScrollBehavior?.();\n window.removeEventListener(\"resize\", this._handleResize);\n document.removeEventListener(\"pointerdown\", this._onDocumentPointerDown, true);\n document.removeEventListener(\"keydown\", this._onKeydown, true);\n this._destroySticky();\n this._unobserveSections();\n }\n\n /* The first item is active before the first render, not after it: state set\n in firstUpdated or updated starts a second render, the one Lit warns about\n as change-in-update. */\n willUpdate(changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties);\n if (!this.hasUpdated && !this.activeId && this._resolvedItems().length) this.activeId = \"anchor-1\";\n }\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (changedProperties.has(\"stickyTop\")) {\n this.style.setProperty(\"--sticky-top\", this.stickyTop || \"0px\");\n }\n\n if (changedProperties.has(\"stickyTop\") || changedProperties.has(\"items\")) {\n this._scheduleSpy();\n }\n\n if (changedProperties.has(\"activeId\") || changedProperties.has(\"items\")) {\n requestAnimationFrame(() => this._updateIndicator(\"updated\"));\n }\n\n if (!changedProperties.has(\"activeId\")) return;\n const prev = changedProperties.get(\"activeId\");\n if (prev === undefined || prev === \"\") return;\n if (prev === this.activeId) return;\n queueMicrotask(() => this._playMobileDropdownLabelSwap());\n }\n\n firstUpdated() {\n requestAnimationFrame(() => this._updateIndicator(\"firstUpdated\"));\n }\n\n /* The indicator spans the link row and is moved and sized on the\n compositor: translate to the current link's corner, scale to its width.\n It used to animate top and width, which laid the bar out again on every\n frame of the slide. The offsets are physical -- offsetLeft is -- so the\n indicator is anchored at the row's physical left, on a right-to-left\n page too. */\n _updateIndicator(_caller?: string) {\n const indicator = this.renderRoot?.querySelector<HTMLElement>(\".anchor-indicator\");\n const activeLink = this.renderRoot?.querySelector<HTMLElement>(\n \".anchor-links--desktop .anchor-link[current]\"\n );\n if (!indicator || !activeLink) return;\n\n const row = indicator.offsetWidth;\n const scale = row ? activeLink.offsetWidth / row : 0;\n // The bar's bottom edge is the inner's padding-bottom below the link.\n const inner = this.renderRoot.querySelector(\".bd-anchor-nav__inner\");\n const gap = inner ? parseFloat(getComputedStyle(inner).paddingBottom) || 0 : 0;\n const top = activeLink.offsetTop + activeLink.offsetHeight + gap;\n\n const place = () => {\n indicator.style.translate = `${activeLink.offsetLeft}px ${top}px`;\n indicator.style.scale = `${scale} 1`;\n };\n\n if (!this._indicatorReady) {\n indicator.style.transition = \"none\";\n place();\n void indicator.offsetWidth;\n indicator.style.transition = \"\";\n this._indicatorReady = true;\n return;\n }\n\n place();\n }\n\n _handleResize() {\n this._updateIndicator(\"windowResize\");\n // The viewport's height places the spy's line inside its root.\n this._scheduleSpy();\n }\n\n /* The bar sticks with position: sticky, which keeps its own place in the\n flow and lets go at the end of its parent, so nothing here positions it.\n It used to: past its top it switched to position: fixed at the\n viewport's width, measured its parent to know when to let go, and left a\n placeholder behind to hold its space.\n\n While stuck it draws a shadow. A scroll-state container query says when\n that is, and it is newer than the Widely available target; where it is\n missing, this tells instead: the bar sits at its sticky top -- read as\n the browser resolved it, as _stickyOffsetPx() reads it, so calc(), em\n and custom properties count -- and the page has scrolled. A bar that\n merely rests at that line on an unscrolled page is not stuck, as the\n query would not call it. */\n _initSticky() {\n this.style.setProperty(\"--sticky-top\", this.stickyTop || \"0px\");\n if (CSS.supports(\"container-type: scroll-state\")) return;\n\n this._onStickyScroll = () => {\n const top = parseFloat(getComputedStyle(this).top) || 0;\n const atTop = Math.abs(this.getBoundingClientRect().top - top) < 1;\n this.classList.toggle(\"is-sticky\", atTop && window.scrollY > 0);\n };\n window.addEventListener(\"scroll\", this._onStickyScroll, { passive: true });\n window.addEventListener(\"resize\", this._onStickyScroll, { passive: true });\n /* Removed within a frame of connecting, the bar has torn this down. */\n requestAnimationFrame(() => this._onStickyScroll?.());\n }\n\n _destroySticky() {\n if (this._onStickyScroll) {\n window.removeEventListener(\"scroll\", this._onStickyScroll);\n window.removeEventListener(\"resize\", this._onStickyScroll);\n this._onStickyScroll = null;\n }\n this.classList.remove(\"is-sticky\");\n }\n\n _cancelScrollSpyUnlock() {\n if (this._unlockScrollSpyTimer != null) {\n clearTimeout(this._unlockScrollSpyTimer);\n this._unlockScrollSpyTimer = null;\n }\n if (this._scrollEndUnlockHandler) {\n window.removeEventListener(\"scrollend\", this._scrollEndUnlockHandler);\n this._scrollEndUnlockHandler = null;\n }\n }\n\n /* The click's item stays active until the scroll is over. scrollend says so\n where the browser has it. The timer is for a click that scrolls nothing,\n which no scrollend follows, and for browsers without the event: it ends\n the lock once the page has stopped moving. It used to end it after a\n fixed second, and a long smooth scroll outlasts that -- measured 1.3s\n from the first section to the third on the playground at 1280, with the\n second item lit for the last 250ms of it. */\n _scheduleScrollSpyUnlock() {\n this._cancelScrollSpyUnlock();\n const unlock = () => {\n this._cancelScrollSpyUnlock();\n this._restoreScrollBehavior?.();\n this._programmaticScrollTargetId = null;\n this._runScrollSpy();\n };\n this._scrollEndUnlockHandler = unlock;\n window.addEventListener(\"scrollend\", unlock, { passive: true });\n let lastY = window.scrollY;\n const unlockOnceStill = () => {\n if (window.scrollY === lastY) return unlock();\n lastY = window.scrollY;\n this._unlockScrollSpyTimer = window.setTimeout(unlockOnceStill, 250);\n };\n this._unlockScrollSpyTimer = window.setTimeout(unlockOnceStill, 250);\n }\n\n _onKeydown(e: KeyboardEvent) {\n if (e.key === \"Escape\" && this._dropdownOpen) {\n this._dropdownOpen = false;\n this.requestUpdate();\n this.updateComplete.then(() =>\n this.renderRoot?.querySelector<HTMLButtonElement>(\".bd-anchor-nav__dropdown-toggle\")?.focus());\n }\n }\n\n _onDocumentPointerDown(e: PointerEvent) {\n if (!this._dropdownOpen) return;\n const path = e.composedPath();\n if (path.includes(this)) return;\n this._dropdownOpen = false;\n this.requestUpdate();\n }\n\n _scheduleSpy() {\n if (this._spyFrame) return;\n this._spyFrame = requestAnimationFrame(() => {\n this._spyFrame = 0;\n this._observeSections();\n });\n }\n\n /* Scroll-spy, without reading the page on every scroll. The active item is\n the last section whose top has reached a line just under the stuck bar,\n and two IntersectionObservers say when an edge crosses:\n\n - the spy's root ends at that line and reaches FAR above it, so a section\n is inside it exactly while its top is past the line;\n - the CTA's root starts at the top of the viewport and reaches FAR below,\n so the first section leaves it exactly when its bottom scrolls off.\n\n Each entry carries the target's box, so the callbacks read nothing. The\n line depends on the bar's height, the sticky top and the viewport, and a\n root margin cannot change, so the observers are rebuilt when one moves. */\n _observeSections() {\n const sections = this._resolvedItems()\n .map(({ href }, i) => document.getElementById(sectionIdOf(href, i + 1)));\n const offset = this._stickyOffsetPx();\n // 2px under where a click leaves the section, so a section the bar has just\n // scrolled to counts as reached.\n const line = offset + 2;\n const viewport = document.documentElement.clientHeight;\n\n if (line === this._spyLine && viewport === this._spyViewport &&\n sections.length === this._sections.length &&\n sections.every((el, i) => el === this._sections[i])) return;\n\n /* A section a click scrolls to stops under the bar, not behind it, and so\n does one the URL's hash or the back button brings into view. */\n for (const el of this._sections) {\n if (el && !sections.includes(el)) el.style.removeProperty(\"scroll-margin-top\");\n }\n for (const el of sections) el?.style.setProperty(\"scroll-margin-top\", `${offset}px`);\n\n this._spyObserver?.disconnect();\n this._ctaObserver?.disconnect();\n this._spyObserver = this._ctaObserver = null;\n if (sections[0] !== this._sections[0]) this._firstSectionBehind = false;\n this._passed = new Map(sections.filter((el) => this._passed.has(el))\n .map((el) => [el, this._passed.get(el)]));\n this._sections = sections;\n this._spyLine = line;\n this._spyViewport = viewport;\n\n const found = sections.filter(Boolean) as HTMLElement[];\n if (found.length) {\n this._spyObserver = new IntersectionObserver(this._onSectionsCrossLine, {\n root : document,\n rootMargin: `${FAR} 0px ${line - viewport}px 0px`\n });\n found.forEach((el) => this._spyObserver!.observe(el));\n }\n if (sections[0]) {\n this._ctaObserver = new IntersectionObserver(this._onFirstSectionCross, {\n root : document,\n rootMargin: `0px 0px ${FAR} 0px`\n });\n this._ctaObserver.observe(sections[0]);\n }\n this._runScrollSpy();\n }\n\n _unobserveSections() {\n cancelAnimationFrame(this._spyFrame);\n this._spyFrame = 0;\n this._layoutObserver?.disconnect();\n this._spyObserver?.disconnect();\n this._ctaObserver?.disconnect();\n this._layoutObserver = this._spyObserver = this._ctaObserver = null;\n for (const el of this._sections) el?.style.removeProperty(\"scroll-margin-top\");\n this._sections = [];\n this._passed = new Map();\n }\n\n /* A section is past the line while it is inside the root, or once it has\n left the root's far top. Not its top against the line: a section the page\n still hides (display: none until its blocks load) reports an empty box at\n 0, above the line, and when it shows up below the line it is still\n outside the root, so no entry comes to take that back -- the last such\n section stayed active on load and after every click. */\n _onSectionsCrossLine(entries: IntersectionObserverEntry[]) {\n for (const { target, isIntersecting, boundingClientRect, rootBounds } of entries) {\n this._passed.set(target, isIntersecting || boundingClientRect.bottom < rootBounds!.top);\n }\n this._runScrollSpy();\n }\n\n _onFirstSectionCross(entries: IntersectionObserverEntry[]) {\n const { boundingClientRect, rootBounds } = entries[entries.length - 1];\n this._firstSectionBehind = boundingClientRect.bottom <= rootBounds!.top;\n this._runScrollSpy();\n }\n\n _resolvedItems(): ResolvedItem[] {\n if (this.items && this.items.length) {\n return this.items.map((item, i) => ({\n title: item.title,\n href : item.href || `#anchor-${i + 1}-section`,\n id : `anchor-${i + 1}`\n }));\n }\n return Array.from(this.children)\n .filter((el) => el.tagName === \"BD-ANCHOR-NAV-ITEM\")\n .map((el, i) => ({\n title: el.getAttribute(\"title\"),\n href : el.getAttribute(\"href\") || `#anchor-${i + 1}-section`,\n id : `anchor-${i + 1}`\n }));\n }\n\n /* Read off what the observers last reported; while a click's scroll runs,\n the item it chose stays active. The CTA flag is set at every width, since\n only the stylesheet below md hides the CTA until the first section is\n behind the reader. */\n _runScrollSpy() {\n let next = this.activeId;\n\n if (this._sections.length && !this._programmaticScrollTargetId) {\n next = \"anchor-1\";\n this._sections.forEach((el, i) => {\n if (el && this._passed.get(el)) next = `anchor-${i + 1}`;\n });\n }\n\n this.activeId = next;\n this._mobileCtaRevealed = !this._sections[0] || this._firstSectionBehind;\n }\n\n _playMobileDropdownLabelSwap() {\n if (typeof window === \"undefined\") return;\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n if (!matchesBelow('md')) return;\n const el = this.renderRoot?.querySelector<HTMLElement>(\".bd-anchor-nav__dropdown-label\");\n if (!el) return;\n el.classList.remove(\"bd-anchor-nav__dropdown-label--swap\");\n void el.offsetWidth;\n el.classList.add(\"bd-anchor-nav__dropdown-label--swap\");\n el.addEventListener(\n \"animationend\",\n () => el.classList.remove(\"bd-anchor-nav__dropdown-label--swap\"),\n { once: true }\n );\n }\n\n /* Where a section stops under the bar: the sticky top, the bar, and a gap.\n The sticky top is read as the browser resolved it, so any length\n sticky-top accepts -- rem, calc(), a custom property -- counts. */\n _stickyOffsetPx() {\n const barPx = this.offsetHeight;\n const stickyTopPx = parseFloat(getComputedStyle(this).top) || 0;\n const insetRaw = getComputedStyle(this).getPropertyValue(\"--spacing-8\")\n .trim();\n const insetPx = parseLengthToPx(insetRaw) || 8;\n if (barPx > 0) return barPx + insetPx + stickyTopPx;\n const fallback = getComputedStyle(this).getPropertyValue(\"--spacing-128\")\n .trim();\n return parseLengthToPx(fallback) || 128;\n }\n\n /* A section link is an ordinary fragment link, and the browser follows it:\n the hash goes into the URL as a history entry, :target moves to the\n section, and the next Tab starts from there. This used to stop the\n click and scroll by hand -- pushState and scrollIntoView -- which kept\n the URL but left :target and the Tab position behind, so a keyboard\n reader who chose \"Pricing\" tabbed on through the nav. The section's own\n scroll-margin-top keeps it clear of the bar.\n\n The click's item stays current until the scroll is over, so the spy\n does not light the sections it passes on the way. A click with a\n modifier, or on an item whose section is not on this page, is left to\n the browser as an ordinary link. */\n handleClick(event: MouseEvent, id: string, href: string) {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n this._cancelScrollSpyUnlock();\n this._programmaticScrollTargetId = null;\n this.activeId = id;\n const sectionId = sectionIdOf(href, id.replace(/^anchor-/, \"\"));\n if (!document.getElementById(sectionId)) return;\n\n this._programmaticScrollTargetId = id;\n this._smoothFragmentScroll();\n this._scheduleScrollSpyUnlock();\n }\n\n /* Fragment navigation scrolls with the root's scroll-behavior, and the\n page's <html> is not this component's to style. So for a reader who has\n not asked for less motion, the click sets it to smooth for the length of\n this one scroll -- before the navigation runs, which is after the click\n listeners -- and gives back whatever the page had when the scroll ends. */\n _smoothFragmentScroll() {\n if (this._restoreScrollBehavior) return;\n if (!window.matchMedia(\"(prefers-reduced-motion: no-preference)\").matches) return;\n const root = document.documentElement;\n const before = root.style.scrollBehavior;\n root.style.scrollBehavior = \"smooth\";\n this._restoreScrollBehavior = () => {\n root.style.scrollBehavior = before;\n this._restoreScrollBehavior = null;\n };\n }\n\n /* With a native popover, popovertarget opens and closes the panel and the\n toggle event reports it; this handler is the fallback's. */\n _toggleDropdown(e: Event) {\n if (NATIVE_POPOVER) return;\n e.preventDefault();\n e.stopPropagation();\n this._dropdownOpen = !this._dropdownOpen;\n }\n\n _onPanelToggle(e: ToggleEvent) {\n this._dropdownOpen = e.newState === \"open\";\n }\n\n _selectFromDropdown(e: MouseEvent, id: string, href: string) {\n if (NATIVE_POPOVER) {\n const panel = this.renderRoot.querySelector<HTMLElement>(\".bd-anchor-nav__dropdown-panel\");\n if (panel?.matches(\":popover-open\")) panel.hidePopover();\n } else {\n this._dropdownOpen = false;\n }\n this.handleClick(e, id, href);\n }\n\n _activeLabel(resolved: ResolvedItem[]) {\n const m = /^anchor-(\\d+)$/.exec(this.activeId || \"\");\n const n = m ? parseInt(m[1], 10) : 1;\n const idx = Math.min(Math.max(n - 1, 0), Math.max(0, resolved.length - 1));\n return resolved[idx]?.title || resolved[0]?.title || \"Section\";\n }\n\n render() {\n const resolved = this._resolvedItems();\n const dropdownLabel = this._activeLabel(resolved);\n\n const linkRow = (cls: string) => html`\n <div class=\"${cls}\">\n ${resolved.map(({ id, title, href }) => {\n const isActive = this.activeId === id;\n return html`\n <bd-link\n href=\"${href}\"\n variant=\"primary\"\n no-underline\n class=\"anchor-link\"\n current=${isActive ? \"location\" : nothing}\n @click=${(e: MouseEvent) => this.handleClick(e, id, href)}\n >${title}</bd-link>\n `;\n })}\n <span class=\"anchor-indicator\" aria-hidden=\"true\"></span>\n </div>\n `;\n\n const innerStyle = this.maxWidth ? `max-width: ${this.maxWidth};` : '';\n\n return html`\n <nav aria-label=${this.navLabel}>\n <div\n class=\"bd-ensemble bd-anchor-nav__inner\"\n part=\"inner\"\n style=\"${innerStyle}\"\n ?data-mobile-cta-visible=${this._mobileCtaRevealed}\n >\n ${linkRow(\"anchor-links anchor-links--desktop\")}\n\n <div class=\"bd-anchor-nav__dropdown\" part=\"dropdown\">\n <button\n type=\"button\"\n class=\"bd-anchor-nav__dropdown-toggle\"\n aria-expanded=${this._dropdownOpen ? \"true\" : \"false\"}\n aria-controls=${this._panelId}\n popovertarget=${NATIVE_POPOVER ? this._panelId : nothing}\n @click=${this._toggleDropdown}\n >\n <span class=\"bd-anchor-nav__dropdown-label\">${dropdownLabel}</span>\n <span class=\"bd-anchor-nav__dropdown-chevron\" aria-hidden=\"true\">\n <bd-arrow-down-icon size=\"md\"></bd-arrow-down-icon>\n </span>\n </button>\n <div\n class=\"bd-anchor-nav__dropdown-panel\"\n id=${this._panelId}\n popover=${NATIVE_POPOVER ? \"auto\" : nothing}\n ?hidden=${!NATIVE_POPOVER && !this._dropdownOpen}\n @toggle=${this._onPanelToggle}\n >\n <ul class=\"bd-anchor-nav__dropdown-list\">\n ${resolved.map(({ id, title, href }) => {\n const isActive = this.activeId === id;\n return html`\n <li>\n <a\n href=\"${href}\"\n class=\"bd-anchor-nav__dropdown-option\"\n aria-current=${isActive ? \"location\" : nothing}\n @click=${(e: MouseEvent) => this._selectFromDropdown(e, id, href)}\n >${title}</a>\n </li>\n `;\n })}\n </ul>\n </div>\n </div>\n\n <div class=\"bd-cta\">\n <div class=\"bd-cta__inner\"><slot name=\"cta\"></slot></div>\n </div>\n </div>\n </nav>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-anchor-nav-item\": BdAnchorNavItem;\n \"bd-anchor-nav\" : BdAnchorNav;\n }\n}\n"],"mappings":"A,0lBAaA,SAASE,EAAgB,EAAe,CACtC,IAAMC,GAAKC,GAAS,GAAA,CAAI,KAAK,EAC7B,GAAI,CAACD,EAAG,MAAO,GACf,GAAIA,EAAE,SAAS,IAAI,EAAG,OAAO,WAAWA,CAAC,EACzC,GAAIA,EAAE,SAAS,KAAK,EAAG,CACrB,IAAME,EAAO,WAAW,iBAAiB,SAAS,eAAe,CAAC,CAAC,QAAQ,GAAK,GAChF,OAAO,WAAWF,CAAC,EAAIE,CACzB,CACA,OAAO,WAAWF,CAAC,GAAK,CAC1B,CAEA,IAAMG,GAAe,EAAc,KAAwBC,GAAQ,GAAA,CAAI,QAAQ,KAAM,EAAE,GAAK,UAAUC,EAAE,UAMlGC,EAAM,SAONC,EAAiB,YAAa,YAAY,WAAa,IAAI,SAAS,kBAAkB,EActFC,EADN,cAC8B,WAAY,CACxC,aAAc,CACZ,MAAM,EACN,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,CACpC,CACA,mBAAoB,CAAE,KAAK,OAAO,CAAG,CACrC,QAAS,CAAE,KAAK,WAAY,UAAY,eAAiB,CAC3D,EARC,EAAAX,EAAA,CAAAY,EAAc,oBAAoB,CAAA,EAAAD,CAAA,EAUnC,IACME,EADN,cAC0BC,CAAW,C,OACnB,KAAA,OAAA,CAACC,EAAaC,CAAe,C,CAkD7C,aAA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,EAAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobit/dex-system-design",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Design system based on Web Components.",
|
|
5
5
|
"author": "Iordache Matei Cezar <miordache@bitdefender.com>",
|
|
6
6
|
"homepage": "https://github.com/bitdefender/dex-core#readme",
|
|
@@ -432,5 +432,5 @@
|
|
|
432
432
|
"volta": {
|
|
433
433
|
"node": "24.22.1"
|
|
434
434
|
},
|
|
435
|
-
"gitHead": "
|
|
435
|
+
"gitHead": "6fe52a958d54dc791410b52c4dd51a88240f9a18"
|
|
436
436
|
}
|