Rocky_Mountain_Vending/.pnpm-store/v10/files/40/e963d7f9da8a536190d499938012b8763ffde5e9cc1498b2017315c14a936ead48bbf22520afe6edd7d104158d6b94b3f580dabf0dce7aa046aef449364dd3
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
3.4 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["../../src/client/route-announcer.tsx"],"sourcesContent":["import React from 'react'\nimport { useRouter } from './router'\n\nconst nextjsRouteAnnouncerStyles: React.CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n top: 0,\n width: '1px',\n\n // https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n}\n\nexport const RouteAnnouncer = () => {\n const { asPath } = useRouter()\n const [routeAnnouncement, setRouteAnnouncement] = React.useState('')\n\n // Only announce the path change, but not for the first load because screen\n // reader will do that automatically.\n const previouslyLoadedPath = React.useRef(asPath)\n\n // Every time the path changes, announce the new pages title following this\n // priority: first the document title (from head), otherwise the first h1, or\n // if none of these exist, then the pathname from the URL. This methodology is\n // inspired by Marcy Suttons accessible client routing user testing. More\n // information can be found here:\n // https://www.gatsbyjs.com/blog/2019-07-11-user-testing-accessible-client-routing/\n React.useEffect(\n () => {\n // If the path hasn't change, we do nothing.\n if (previouslyLoadedPath.current === asPath) return\n previouslyLoadedPath.current = asPath\n\n if (document.title) {\n setRouteAnnouncement(document.title)\n } else {\n const pageHeader = document.querySelector('h1')\n const content = pageHeader?.innerText ?? pageHeader?.textContent\n\n setRouteAnnouncement(content || asPath)\n }\n },\n // TODO: switch to pathname + query object of dynamic route requirements\n [asPath]\n )\n\n return (\n <p\n aria-live=\"assertive\" // Make the announcement immediately.\n id=\"__next-route-announcer__\"\n role=\"alert\"\n style={nextjsRouteAnnouncerStyles}\n >\n {routeAnnouncement}\n </p>\n )\n}\n\nexport default RouteAnnouncer\n"],"names":["RouteAnnouncer","nextjsRouteAnnouncerStyles","border","clip","height","margin","overflow","padding","position","top","width","whiteSpace","wordWrap","asPath","useRouter","routeAnnouncement","setRouteAnnouncement","React","useState","previouslyLoadedPath","useRef","useEffect","current","document","title","pageHeader","querySelector","content","innerText","textContent","p","aria-live","id","role","style"],"mappings":";;;;;;;;;;;;;;;IAmBaA,cAAc;eAAdA;;IA6Cb,OAA6B;eAA7B;;;;;gEAhEkB;wBACQ;AAE1B,MAAMC,6BAAkD;IACtDC,QAAQ;IACRC,MAAM;IACNC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,KAAK;IACLC,OAAO;IAEP,wFAAwF;IACxFC,YAAY;IACZC,UAAU;AACZ;AAEO,MAAMZ,iBAAiB;IAC5B,MAAM,EAAEa,MAAM,EAAE,GAAGC,IAAAA,iBAAS;IAC5B,MAAM,CAACC,mBAAmBC,qBAAqB,GAAGC,cAAK,CAACC,QAAQ,CAAC;IAEjE,2EAA2E;IAC3E,qCAAqC;IACrC,MAAMC,uBAAuBF,cAAK,CAACG,MAAM,CAACP;IAE1C,4EAA4E;IAC5E,6EAA6E;IAC7E,8EAA8E;IAC9E,0EAA0E;IAC1E,iCAAiC;IACjC,mFAAmF;IACnFI,cAAK,CAACI,SAAS,CACb;QACE,4CAA4C;QAC5C,IAAIF,qBAAqBG,OAAO,KAAKT,QAAQ;QAC7CM,qBAAqBG,OAAO,GAAGT;QAE/B,IAAIU,SAASC,KAAK,EAAE;YAClBR,qBAAqBO,SAASC,KAAK;QACrC,OAAO;YACL,MAAMC,aAAaF,SAASG,aAAa,CAAC;YAC1C,MAAMC,UAAUF,YAAYG,aAAaH,YAAYI;YAErDb,qBAAqBW,WAAWd;QAClC;IACF,GACA,wEAAwE;IACxE;QAACA;KAAO;IAGV,qBACE,qBAACiB;QACCC,aAAU,YAAY,qCAAqC;;QAC3DC,IAAG;QACHC,MAAK;QACLC,OAAOjC;kBAENc;;AAGP;MAEA,WAAef","ignoreList":[0]}