Socket
Socket
Sign inDemoInstall

@finsweet/attributes-a11y

Package Overview
Dependencies
2
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

2

a11y.js

@@ -1,1 +0,1 @@

(()=>{var D=Object.create;var d=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var j=(t,e,o)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var H=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var q=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $(e))!Y.call(t,r)&&r!==o&&d(t,r,{get:()=>e[r],enumerable:!(n=M(e,r))||n.enumerable});return t};var X=(t,e,o)=>(o=t!=null?D(F(t)):{},q(e||!t||!t.__esModule?d(o,"default",{value:t,enumerable:!0}):o,t));var R=(t,e,o)=>(j(t,typeof e!="symbol"?e+"":e,o),o);var C=H((kt,h)=>{h.exports=Z;function Z(t,e,o,n){var r,s,i;return function(){if(i=this,s=Array.prototype.slice.call(arguments),r&&(o||n))return;if(!o)return c(),r=setTimeout(l,e),r;r=setTimeout(c,e),t.apply(i,s);function l(){c(),t.apply(i,s)}function c(){clearTimeout(r),r=null}}}});var p=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,o){if(this.alertsActivated&&window.alert(e),o==="error")throw new Error(e)}};R(p,"alertsActivated",!1);var x=(t,e)=>(Array.isArray(e)||(e=[e]),e.map(n=>t.dispatchEvent(new Event(n,{bubbles:!0}))).every(n=>n));var I=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length);var m="fs-attributes",u="a11y";var T=t=>{let e=(n,r,s)=>{let i=t[n],{key:a,values:l}=i,c;if(!r)return`[${a}]`;let b=l==null?void 0:l[r];typeof b=="string"?c=b:c=b(s&&"instanceIndex"in s?s.instanceIndex:void 0);let E=s&&"caseInsensitive"in s&&s.caseInsensitive?"i":"";if(!(s!=null&&s.operator))return`[${a}="${c}"${E}]`;switch(s.operator){case"prefixed":return`[${a}^="${c}"${E}]`;case"suffixed":return`[${a}$="${c}"${E}]`;case"contains":return`[${a}*="${c}"${E}]`}};function o(n,r){let s=e("element",n,r),i=(r==null?void 0:r.scope)||document;return r!=null&&r.all?i.querySelectorAll(s):i.querySelector(s)}return[e,o]};var A={preventLoad:{key:`${m}-preventload`},debugMode:{key:`${m}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${m}-dev`}},[_,dt]=T(A);var S=()=>{let{currentScript:t}=document,{preventLoad:e,debugMode:o}=A,n=typeof(t==null?void 0:t.getAttribute(e.key))=="string";return typeof(t==null?void 0:t.getAttribute(o.key))=="string"&&p.activateAlerts(),{preventsLoad:n}};var G=`${m}-support`,W="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",w=async()=>{let{fsAttributes:t,location:e}=window,{host:o,searchParams:n}=new URL(e.href);if(!o.includes("webflow.io")||!n.has(G))return!1;if(t.supportImport)return t.supportImport;try{t.supportImport=new Promise((r,s)=>{let i=document.createElement("script");i.src=W,i.onload=()=>r(!0),i.onerror=s,document.head.append(i)})}catch(r){return!1}return t.supportImport};var v=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let t={cms:{},push(...e){var o,n;for(let[r,s]of e)(n=(o=this[r])==null?void 0:o.loading)==null||n.then(s)}};J(t),Q(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,w()},J=t=>{let e=_("src","finsweet",{operator:"contains"}),o=_("dev"),r=[...document.querySelectorAll(`script${e}, script${o}`)].reduce((s,i)=>{var l;let a=i.getAttribute(A.dev.key)||((l=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:l[0]);return a&&!s.includes(a)&&s.push(a),s},[]);for(let s of r){t[s]={};let i=t[s];i.loading=new Promise(a=>{i.resolve=l=>{a(l),delete i.resolve}})}},Q=t=>{let e=Array.isArray(window.fsAttributes)?window.fsAttributes:[];t.push(...e)};var g="0.1.0";var U="tabindex";var B="aria-expanded";var f="aria-controls";var O=X(C(),1);var tt=`fs-${u}`,et="autofocus",rt={element:{key:`${tt}-element`,values:{autoFocus:et}}},[$t,L]=T(rt);var K=()=>{let t=document.querySelectorAll(`[${f}]`);for(let e of t)ot(e)},ot=t=>{let e=!1,o=t.getAttribute(f);if(!o)return;let n=document.getElementById(o);if(!n){t.removeAttribute(f);return}let r=L("autoFocus",{operator:"prefixed",scope:n}),i=(0,O.default)(l=>{l.forEach(()=>{let c=I(n);t.setAttribute(B,`${c}`),r&&!e&&c&&r.focus(),e=c})},100);new MutationObserver(i).observe(n,{attributes:!0,attributeFilter:["style","class"]})};var P=()=>{window.addEventListener("keydown",({target:t,key:e})=>{e!=="Enter"&&e!==" "||(t instanceof HTMLDivElement||t instanceof HTMLLIElement)&&(!t.getAttribute(U)||x(t,"click"))})};var y=()=>{var t,e;P(),K(),(e=(t=window.fsAttributes[u]).resolve)==null||e.call(t,void 0)};v();var V,N;(V=window.fsAttributes)[N=u]||(V[N]={});var{preventsLoad:st}=S(),k=window.fsAttributes[u];k.version=g;st?k.init=y:(window.Webflow||(window.Webflow=[]),window.Webflow.push(y));})();
(()=>{var M=Object.create;var x=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var H=(t,e,r)=>e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var X=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of F(e))!j.call(t,o)&&o!==r&&x(t,o,{get:()=>e[o],enumerable:!(n=$(e,o))||n.enumerable});return t};var G=(t,e,r)=>(r=t!=null?M(Y(t)):{},X(e||!t||!t.__esModule?x(r,"default",{value:t,enumerable:!0}):r,t));var R=(t,e,r)=>(H(t,typeof e!="symbol"?e+"":e,r),r);var C=q((Dt,h)=>{h.exports=tt;function tt(t,e,r,n){var o,s,i;return function(){if(i=this,s=Array.prototype.slice.call(arguments),o&&(r||n))return;if(!r)return c(),o=setTimeout(l,e),o;o=setTimeout(c,e),t.apply(i,s);function l(){c(),t.apply(i,s)}function c(){clearTimeout(o),o=null}}}});var p=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,r){if(this.alertsActivated&&window.alert(e),r==="error")throw new Error(e)}};R(p,"alertsActivated",!1);var I=(t,e)=>(Array.isArray(e)||(e=[e]),e.map(n=>t.dispatchEvent(new Event(n,{bubbles:!0}))).every(n=>n));var T=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length);var m="fs-attributes",u="a11y";var b=t=>{let e=(n,o,s)=>{let i=t[n],{key:a,values:l}=i,c;if(!o)return`[${a}]`;let d=l==null?void 0:l[o];typeof d=="string"?c=d:c=d(s&&"instanceIndex"in s?s.instanceIndex:void 0);let E=s&&"caseInsensitive"in s&&s.caseInsensitive?"i":"";if(!(s!=null&&s.operator))return`[${a}="${c}"${E}]`;switch(s.operator){case"prefixed":return`[${a}^="${c}"${E}]`;case"suffixed":return`[${a}$="${c}"${E}]`;case"contains":return`[${a}*="${c}"${E}]`}};function r(n,o){let s=e("element",n,o),i=(o==null?void 0:o.scope)||document;return o!=null&&o.all?i.querySelectorAll(s):i.querySelector(s)}return[e,r]};var A={preventLoad:{key:`${m}-preventload`},debugMode:{key:`${m}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${m}-dev`}},[_,xt]=b(A);var S=()=>{let{currentScript:t}=document,{preventLoad:e,debugMode:r}=A,n=typeof(t==null?void 0:t.getAttribute(e.key))=="string";return typeof(t==null?void 0:t.getAttribute(r.key))=="string"&&p.activateAlerts(),{preventsLoad:n}};var W=`${m}-support`,J="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",w=async()=>{let{fsAttributes:t,location:e}=window,{host:r,searchParams:n}=new URL(e.href);if(!r.includes("webflow.io")||!n.has(W))return!1;if(t.supportImport)return t.supportImport;try{t.supportImport=new Promise((o,s)=>{let i=document.createElement("script");i.src=J,i.onload=()=>o(!0),i.onerror=s,document.head.append(i)})}catch(o){return!1}return t.supportImport};var v=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let t={cms:{},push(...e){var r,n;for(let[o,s]of e)(n=(r=this[o])==null?void 0:r.loading)==null||n.then(s)}};Q(t),z(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,w()},Q=t=>{let e=_("src","finsweet",{operator:"contains"}),r=_("dev"),o=[...document.querySelectorAll(`script${e}, script${r}`)].reduce((s,i)=>{var l;let a=i.getAttribute(A.dev.key)||((l=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:l[0]);return a&&!s.includes(a)&&s.push(a),s},[]);for(let s of o){t[s]={};let i=t[s];i.loading=new Promise(a=>{i.resolve=l=>{a(l),delete i.resolve}})}},z=t=>{let e=Array.isArray(window.fsAttributes)?window.fsAttributes:[];t.push(...e)};var g="0.1.1";var U="tabindex";var B="aria-expanded";var f="aria-controls";var K=G(C(),1);var et=`fs-${u}`,rt="autofocus",ot={element:{key:`${et}-element`,values:{autoFocus:rt}}},[Ft,L]=b(ot);var P=()=>{let t=document.querySelectorAll(`[${f}]`);for(let e of t)st(e)},st=t=>{let e=t.getAttribute(f);if(!e)return;let r=document.getElementById(e);if(!r){t.removeAttribute(f);return}let n=L("autoFocus",{operator:"prefixed",scope:r}),o=T(r);O(t,o);let i=(0,K.default)(l=>{l.forEach(()=>{let c=T(r);O(t,c),n&&!o&&c&&n.focus(),o=c})},100);new MutationObserver(i).observe(r,{attributes:!0,attributeFilter:["style","class"]})},O=(t,e)=>{t.setAttribute(B,`${e}`)};var V=()=>{window.addEventListener("keydown",({target:t,key:e})=>{e!=="Enter"&&e!==" "||(t instanceof HTMLDivElement||t instanceof HTMLLIElement)&&(!t.getAttribute(U)||I(t,"click"))})};var y=()=>{var t,e;V(),P(),(e=(t=window.fsAttributes[u]).resolve)==null||e.call(t,void 0)};v();var N,k;(N=window.fsAttributes)[k=u]||(N[k]={});var{preventsLoad:nt}=S(),D=window.fsAttributes[u];D.version=g;nt?D.init=y:(window.Webflow||(window.Webflow=[]),window.Webflow.push(y));})();
{
"name": "@finsweet/attributes-a11y",
"version": "0.1.0",
"version": "0.1.1",
"description": "Accessibility JS solutions for Webflow.",

@@ -5,0 +5,0 @@ "homepage": "https://www.finsweet.com/attributes",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc