@fynd-design-engineering/fynd-one-v2 3.1.3 → 3.1.4
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 e(){document.querySelectorAll('a[href="#footer-form"]').forEach(o=>{let t=o;t.href="/contact-us"})}document.addEventListener("DOMContentLoaded",e);document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e();})();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../bin/live-reload.js", "../../src/global/miscellaneous.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", "// Replace footer form hash links\nfunction replaceFooterFormLinks(): void {\n const footerLinks = document.querySelectorAll('a[href=\"#footer-form\"]');\n \n footerLinks.forEach((link: Element) => {\n const anchorElement = link as HTMLAnchorElement;\n anchorElement.href = '/contact-us';\n });\n }\n \n document.addEventListener('DOMContentLoaded', replaceFooterFormLinks);\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', replaceFooterFormLinks);\n } else {\n replaceFooterFormLinks();\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;;;ACTA,WAAS,yBAA+B;AACpC,UAAM,cAAc,SAAS,iBAAiB,wBAAwB;AAEtE,gBAAY,QAAQ,CAAC,SAAkB;AACrC,YAAM,gBAAgB;AACtB,oBAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAEA,WAAS,iBAAiB,oBAAoB,sBAAsB;AAEpE,MAAI,SAAS,eAAe,WAAW;AACrC,aAAS,iBAAiB,oBAAoB,sBAAsB;AAAA,EACtE,OAAO;AACL,2BAAuB;AAAA,EACzB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var o=[{attribute:"data-ph",attributeValue:"book-a-demo",condition:"href",conditionValue:"/contact-us"},{attribute:"data-ph",attributeValue:"sign-in",condition:"href",conditionValue:"https://console.fynd.com/auth/sign-in"},{attribute:"data-ph",attributeValue:"sign-up",condition:"href",conditionValue:"https://console.fynd.com/auth/sign-up"}];function s(n,e,t){switch(e.toLowerCase()){case"href":return u(n,t);case"text":return d(n,t);case"class":return n.classList.contains(t);case"id":return n.id===t;default:return!1}}function u(n,e){let t=n.getAttribute("href")||"";if(!t)return!1;try{let i;if(t.startsWith("http://")||t.startsWith("https://")?i=new URL(t):t.startsWith("/")?i=new URL(t,window.location.origin):i=new URL(t,window.location.href),e.startsWith("http://")||e.startsWith("https://"))try{let a=new URL(e);return i.origin===a.origin&&i.pathname===a.pathname}catch{return t.includes(e)}return i.pathname.includes(e)}catch{return t.includes(e)}}function d(n,e){let i=(n.textContent?.trim().toLowerCase()||"").replace(/\s+/g," "),a=e.toLowerCase().replace(/\s+/g," ");return i.includes(a)}function b(n=o){document.querySelectorAll("a").forEach(t=>{n.forEach(i=>{t.hasAttribute(i.attribute)&&t.getAttribute(i.attribute)===i.attributeValue||s(t,i.condition,i.conditionValue)&&t.setAttribute(i.attribute,i.attributeValue)})})}function c(n=o){document.querySelectorAll("a").forEach(t=>{n.forEach(i=>{t.hasAttribute(i.attribute)&&t.getAttribute(i.attribute)===i.attributeValue||s(t,i.condition,i.conditionValue)&&t.setAttribute(i.attribute,i.attributeValue)})})}var r=class{constructor(e=o){this.observer=null;this.config=e}updateConfig(e){this.config=e}tagExistingLinks(){document.querySelectorAll("a").forEach(t=>{this.config.forEach(i=>{this.shouldTagLink(t,i)&&this.tagLink(t,i)})})}startObserving(){this.observer=new MutationObserver(e=>{e.forEach(t=>{t.addedNodes.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){let a=i;a.tagName==="A"&&this.processAnchor(a),a.querySelectorAll("a").forEach(g=>{this.processAnchor(g)})}})})}),this.observer.observe(document.body,{childList:!0,subtree:!0})}stopObserving(){this.observer&&(this.observer.disconnect(),this.observer=null)}processAnchor(e){this.config.forEach(t=>{this.shouldTagLink(e,t)&&this.tagLink(e,t)})}shouldTagLink(e,t){return e.hasAttribute(t.attribute)&&e.getAttribute(t.attribute)===t.attributeValue?!1:s(e,t.condition,t.conditionValue)}tagLink(e,t){e.setAttribute(t.attribute,t.attributeValue)}};function f(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{c(n)}):c(n)}function h(n){let e=()=>{let t=new r(n);t.tagExistingLinks(),t.startObserving()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}h();})();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../bin/live-reload.js", "../../src/posthog/attributes.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", "interface LinkTaggingRule {\n attribute: string;\n attributeValue: string;\n condition: string;\n conditionValue: string;\n }\n \n const DEFAULT_TAGGING_CONFIG: LinkTaggingRule[] = [\n {\n attribute: \"data-ph\",\n attributeValue: \"book-a-demo\",\n condition: \"href\",\n conditionValue: \"/contact-us\"\n },\n {\n attribute: \"data-ph\",\n attributeValue: \"sign-in\",\n condition: \"href\",\n conditionValue: \"https://console.fynd.com/auth/sign-in\"\n },\n {\n attribute: \"data-ph\",\n attributeValue: \"sign-up\",\n condition: \"href\",\n conditionValue: \"https://console.fynd.com/auth/sign-up\"\n }\n ];\n \n function matchesCondition(anchor: HTMLAnchorElement, condition: string, conditionValue: string): boolean {\n switch (condition.toLowerCase()) {\n case 'href':\n return matchesHref(anchor, conditionValue);\n case 'text':\n return matchesText(anchor, conditionValue);\n case 'class':\n return anchor.classList.contains(conditionValue);\n case 'id':\n return anchor.id === conditionValue;\n default:\n return false;\n }\n }\n \n function matchesHref(anchor: HTMLAnchorElement, conditionValue: string): boolean {\n const href = anchor.getAttribute('href') || '';\n if (!href) return false;\n \n try {\n let url: URL;\n \n if (href.startsWith('http://') || href.startsWith('https://')) {\n url = new URL(href);\n } else if (href.startsWith('/')) {\n url = new URL(href, window.location.origin);\n } else {\n url = new URL(href, window.location.href);\n }\n \n if (conditionValue.startsWith('http://') || conditionValue.startsWith('https://')) {\n try {\n const conditionUrl = new URL(conditionValue);\n return url.origin === conditionUrl.origin && url.pathname === conditionUrl.pathname;\n } catch {\n return href.includes(conditionValue);\n }\n }\n \n return url.pathname.includes(conditionValue);\n } catch (error) {\n return href.includes(conditionValue);\n }\n }\n \n function matchesText(anchor: HTMLAnchorElement, conditionValue: string): boolean {\n const textContent = anchor.textContent?.trim().toLowerCase() || '';\n const normalizedText = textContent.replace(/\\s+/g, ' ');\n const normalizedCondition = conditionValue.toLowerCase().replace(/\\s+/g, ' ');\n \n return normalizedText.includes(normalizedCondition);\n }\n \n function tagLinks(config: LinkTaggingRule[] = DEFAULT_TAGGING_CONFIG): void {\n const anchorTags = document.querySelectorAll('a');\n \n anchorTags.forEach((anchor) => {\n config.forEach((rule) => {\n if (anchor.hasAttribute(rule.attribute) && \n anchor.getAttribute(rule.attribute) === rule.attributeValue) {\n return;\n }\n \n if (matchesCondition(anchor, rule.condition, rule.conditionValue)) {\n anchor.setAttribute(rule.attribute, rule.attributeValue);\n }\n });\n });\n }\n \n function tagLinksAdvanced(config: LinkTaggingRule[] = DEFAULT_TAGGING_CONFIG): void {\n const anchorTags = document.querySelectorAll('a');\n \n anchorTags.forEach((anchor) => {\n config.forEach((rule) => {\n if (anchor.hasAttribute(rule.attribute) && \n anchor.getAttribute(rule.attribute) === rule.attributeValue) {\n return;\n }\n \n if (matchesCondition(anchor, rule.condition, rule.conditionValue)) {\n anchor.setAttribute(rule.attribute, rule.attributeValue);\n }\n });\n });\n }\n \n class GenericLinkTagger {\n private config: LinkTaggingRule[];\n private observer: MutationObserver | null = null;\n \n constructor(config: LinkTaggingRule[] = DEFAULT_TAGGING_CONFIG) {\n this.config = config;\n }\n \n updateConfig(config: LinkTaggingRule[]): void {\n this.config = config;\n }\n \n tagExistingLinks(): void {\n const anchorTags = document.querySelectorAll('a');\n \n anchorTags.forEach((anchor) => {\n this.config.forEach((rule) => {\n if (this.shouldTagLink(anchor, rule)) {\n this.tagLink(anchor, rule);\n }\n });\n });\n }\n \n startObserving(): void {\n this.observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as Element;\n \n if (element.tagName === 'A') {\n this.processAnchor(element as HTMLAnchorElement);\n }\n \n const anchorTags = element.querySelectorAll('a');\n anchorTags.forEach((anchor) => {\n this.processAnchor(anchor);\n });\n }\n });\n });\n });\n \n this.observer.observe(document.body, {\n childList: true,\n subtree: true\n });\n }\n \n stopObserving(): void {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n }\n \n private processAnchor(anchor: HTMLAnchorElement): void {\n this.config.forEach((rule) => {\n if (this.shouldTagLink(anchor, rule)) {\n this.tagLink(anchor, rule);\n }\n });\n }\n \n private shouldTagLink(anchor: HTMLAnchorElement, rule: LinkTaggingRule): boolean {\n if (anchor.hasAttribute(rule.attribute) && \n anchor.getAttribute(rule.attribute) === rule.attributeValue) {\n return false;\n }\n \n return matchesCondition(anchor, rule.condition, rule.conditionValue);\n }\n \n private tagLink(anchor: HTMLAnchorElement, rule: LinkTaggingRule): void {\n anchor.setAttribute(rule.attribute, rule.attributeValue);\n }\n }\n \n function initGenericLinkTagger(config?: LinkTaggingRule[]): void {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n tagLinksAdvanced(config);\n });\n } else {\n tagLinksAdvanced(config);\n }\n }\n \n function initGenericLinkTaggerWithObserver(config?: LinkTaggingRule[]): void {\n const runTagger = () => {\n const tagger = new GenericLinkTagger(config);\n tagger.tagExistingLinks();\n tagger.startObserving();\n };\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', runTagger);\n } else {\n runTagger();\n }\n }\n \n initGenericLinkTaggerWithObserver();\n \n export { \n GenericLinkTagger, \n tagLinks, \n tagLinksAdvanced, \n initGenericLinkTagger, \n initGenericLinkTaggerWithObserver,\n DEFAULT_TAGGING_CONFIG,\n type LinkTaggingRule\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,yBAA4C;AAAA,IAChD;AAAA,MACE,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,gBAAgB;AAAA,IAClB;AAAA,IACA;AAAA,MACE,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,gBAAgB;AAAA,IAClB;AAAA,IACA;AAAA,MACE,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,gBAAgB;AAAA,IAClB;AAAA,EACF;AAEA,WAAS,iBAAiB,QAA2B,WAAmB,gBAAiC;AAC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