@fynd-design-engineering/fynd-one-v2 3.1.24 → 3.1.26
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{function t(e){return e instanceof HTMLElement}var n=document.getElementById("clear-button"),l=document.getElementById("fs-clear");t(n)&&t(l)&&n.addEventListener("click",e=>{l.click()});})();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../bin/live-reload.js", "../../src/cms-listing/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "function isHTMLElement(element: Element | null): element is HTMLElement {\n return element instanceof HTMLElement;\n}\n\nconst clearButton = document.getElementById('clear-button');\nconst fsClearButton = document.getElementById('fs-clear');\n\nif (isHTMLElement(clearButton) && isHTMLElement(fsClearButton)) {\n clearButton.addEventListener('click', (event: MouseEvent): void => {\n fsClearButton.click();\n });\n}\n\nexport {};"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACVA,WAAS,cAAc,SAAiD;AACpE,WAAO,mBAAmB;AAAA,EAC9B;AAEA,MAAM,cAAc,SAAS,eAAe,cAAc;AAC1D,MAAM,gBAAgB,SAAS,eAAe,UAAU;AAExD,MAAI,cAAc,WAAW,KAAK,cAAc,aAAa,GAAG;AAC5D,gBAAY,iBAAiB,SAAS,CAAC,UAA4B;AAC/D,oBAAc,MAAM;AAAA,IACxB,CAAC;AAAA,EACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var o=class{constructor(t={}){this.triggerAttribute=t.triggerAttribute||"fynd-scroll-trigger",this.targetAttribute=t.targetAttribute||"fynd-scroll-target",this.scrollDelay=t.scrollDelay||500,this.init()}init(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.setupTriggers(),this.handlePageLoad(),this.handleBrowserNavigation()}):(this.setupTriggers(),this.handlePageLoad(),this.handleBrowserNavigation())}scrollToSection(t){let e=document.querySelector(`[${this.targetAttribute}="${t}"]`);e?(this.updateURL(t),e.scrollIntoView({behavior:"auto",block:"start"})):console.warn(`ScrollNavigation: Target element with ${this.targetAttribute}="${t}" not found`)}updateURL(t){try{let e=new URL(window.location.href);e.searchParams.set("section",t),window.history.pushState({section:t},"",e.toString())}catch(e){console.error("ScrollNavigation: Failed to update URL",e)}}handlePageLoad(){let e=new URLSearchParams(window.location.search).get("section");e&&setTimeout(()=>{this.scrollToSection(e)},this.scrollDelay)}setupTriggers(){let t=document.querySelectorAll(`[${this.triggerAttribute}]`);t.forEach(e=>{e.addEventListener("click",i=>{i.preventDefault();let r=e.getAttribute(this.triggerAttribute);r?this.scrollToSection(r):console.warn(`ScrollNavigation: Trigger element missing ${this.triggerAttribute} attribute value`)})}),console.log(`ScrollNavigation: Initialized ${t.length} scroll triggers`)}handleBrowserNavigation(){window.addEventListener("popstate",t=>{let i=new URLSearchParams(window.location.search).get("section");if(i){let r=document.querySelector(`[${this.targetAttribute}="${i}"]`);r&&r.scrollIntoView({behavior:"auto",block:"start"})}})}goToSection(t){this.scrollToSection(t)}getCurrentSection(){return new URLSearchParams(window.location.search).get("section")}getAvailableSections(){let t=document.querySelectorAll(`[${this.targetAttribute}]`),e=[];return t.forEach(i=>{let r=i.getAttribute(this.targetAttribute);r&&e.push(r)}),e}},n=new o;typeof window<"u"&&(window.ScrollNavigation=o);})();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../bin/live-reload.js", "../../src/global/anchor-scroll.ts"],
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// TypeScript Scroll Navigation\ninterface ScrollNavigationOptions {\n triggerAttribute?: string;\n targetAttribute?: string;\n scrollDelay?: number;\n }\n \n class ScrollNavigation {\n private readonly triggerAttribute: string;\n private readonly targetAttribute: string;\n private readonly scrollDelay: number;\n \n constructor(options: ScrollNavigationOptions = {}) {\n this.triggerAttribute = options.triggerAttribute || 'fynd-scroll-trigger';\n this.targetAttribute = options.targetAttribute || 'fynd-scroll-target';\n this.scrollDelay = options.scrollDelay || 500;\n \n this.init();\n }\n \n private init(): void {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n });\n } else {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n }\n }\n \n private scrollToSection(sectionValue: string): void {\n const target = document.querySelector(`[${this.targetAttribute}=\"${sectionValue}\"]`) as HTMLElement;\n \n if (target) {\n this.updateURL(sectionValue);\n \n target.scrollIntoView({\n behavior: 'auto',\n block: 'start'\n });\n } else {\n console.warn(`ScrollNavigation: Target element with ${this.targetAttribute}=\"${sectionValue}\" not found`);\n }\n }\n \n private updateURL(sectionValue: string): void {\n try {\n const url = new URL(window.location.href);\n url.searchParams.set('section', sectionValue);\n window.history.pushState({ section: sectionValue }, '', url.toString());\n } catch (error) {\n console.error('ScrollNavigation: Failed to update URL', error);\n }\n }\n \n private handlePageLoad(): void {\n const urlParams = new URLSearchParams(window.location.search);\n const sectionParam = urlParams.get('section');\n \n if (sectionParam) {\n setTimeout(() => {\n this.scrollToSection(sectionParam);\n }, this.scrollDelay);\n }\n }\n \n private setupTriggers(): void {\n const triggers = document.querySelectorAll(`[${this.triggerAttribute}]`) as NodeListOf<HTMLElement>;\n \n triggers.forEach((trigger: HTMLElement) => {\n trigger.addEventListener('click', (event: Event) => {\n event.preventDefault();\n const sectionValue = trigger.getAttribute(this.triggerAttribute);\n \n if (sectionValue) {\n this.scrollToSection(sectionValue);\n } else {\n console.warn(`ScrollNavigation: Trigger element missing ${this.triggerAttribute} attribute value`);\n }\n });\n });\n \n console.log(`ScrollNavigation: Initialized ${triggers.length} scroll triggers`);\n }\n \n private handleBrowserNavigation(): void {\n window.addEventListener('popstate', (event: PopStateEvent) => {\n const urlParams = new URLSearchParams(window.location.search);\n const sectionParam = urlParams.get('section');\n \n if (sectionParam) {\n const target = document.querySelector(`[${this.targetAttribute}=\"${sectionParam}\"]`) as HTMLElement;\n if (target) {\n target.scrollIntoView({\n behavior: 'auto',\n block: 'start'\n });\n }\n }\n });\n }\n \n // Public method to programmatically scroll to section\n public goToSection(sectionValue: string): void {\n this.scrollToSection(sectionValue);\n }\n \n // Public method to get current section from URL\n public getCurrentSection(): string | null {\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get('section');\n }\n \n // Public method to get all available sections\n public getAvailableSections(): string[] {\n const targets = document.querySelectorAll(`[${this.targetAttribute}]`) as NodeListOf<HTMLElement>;\n const sections: string[] = [];\n \n targets.forEach((target: HTMLElement) => {\n const sectionValue = target.getAttribute(this.targetAttribute);\n if (sectionValue) {\n sections.push(sectionValue);\n }\n });\n \n return sections;\n }\n }\n \n // Initialize with default options\n const scrollNavigation = new ScrollNavigation();\n \n // Alternative initialization with custom options\n // const scrollNavigation = new ScrollNavigation({\n // triggerAttribute: 'my-scroll-trigger',\n // targetAttribute: 'my-scroll-target',\n // scrollDelay: 200\n // });\n \n // Export for module usage\n export { ScrollNavigation };\n \n // Also make it available globally for non-module usage\n declare global {\n interface Window {\n ScrollNavigation: typeof ScrollNavigation;\n }\n }\n \n if (typeof window !== 'undefined') {\n window.ScrollNavigation = ScrollNavigation;\n }"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACHE,MAAM,mBAAN,MAAuB;AAAA,IAKrB,YAAY,UAAmC,CAAC,GAAG;AACjD,WAAK,mBAAmB,QAAQ,oBAAoB;AACpD,WAAK,kBAAkB,QAAQ,mBAAmB;AAClD,WAAK,cAAc,QAAQ,eAAe;AAE1C,WAAK,KAAK;AAAA,IACZ;AAAA,IAEQ,OAAa;AACnB,UAAI,SAAS,eAAe,WAAW;AACrC,iBAAS,iBAAiB,oBAAoB,MAAM;AAClD,eAAK,cAAc;AACnB,eAAK,eAAe;AACpB,eAAK,wBAAwB;AAAA,QAC/B,CAAC;AAAA,MACH,OAAO;AACL,aAAK,cAAc;AACnB,aAAK,eAAe;AACpB,aAAK,wBAAwB;AAAA,MAC/B;AAAA,IACF;AAAA,IAEQ,gBAAgB,cAA4B;AAClD,YAAM,SAAS,SAAS,cAAc,IAAI,KAAK,eAAe,KAAK,YAAY,IAAI;AAEnF,UAAI,QAAQ;AACV,aAAK,UAAU,YAAY;AAE3B,eAAO,eAAe;AAAA,UACpB,UAAU;AAAA,UACV,OAAO;AAAA,QACT,CAAC;AAAA,MACH,OAAO;AACL,gBAAQ,KAAK,yCAAyC,KAAK,eAAe,KAAK,YAAY,aAAa;AAAA,MAC1G;AAAA,IACF;AAAA,IAEQ,UAAU,cAA4B;AAC5C,UAAI;AACF,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