Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@finsweet/attributes-cmscss

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@finsweet/attributes-cmscss - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

cmscss.js

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

(()=>{var p=(t,e,o)=>new Promise((i,s)=>{var m=r=>{try{n(o.next(r))}catch(c){s(c)}},a=r=>{try{n(o.throw(r))}catch(c){s(c)}},n=r=>r.done?i(r.value):Promise.resolve(r.value).then(m,a);n((o=o.apply(t,e)).next())});var u=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,o){if(this.alertsActivated&&window.alert(e),o==="error")throw new Error(e)}};u.alertsActivated=!1;var A="fs-attributes",g={preventLoad:{key:`${A}-preventload`},debugMode:{key:`${A}-debug`}};var x=()=>{window.fsAttributes||(window.fsAttributes={cms:{}})},C=t=>{let{preventLoad:e,debugMode:o}=g,i=typeof(t==null?void 0:t.getAttribute(e.key))=="string";return typeof(t==null?void 0:t.getAttribute(o.key))=="string"&&u.activateAlerts(),{preventsLoad:i}},$=t=>e=>`${t}${e?`-${e}`:""}`,I=t=>(o,i,s)=>{let m=t[o],{key:a,values:n}=m,r;if(!i)return`[${a}]`;let c=n==null?void 0:n[i];if(typeof c=="string"?r=c:r=c(s&&"instanceIndex"in s?s.instanceIndex:void 0),!(s==null?void 0:s.operator))return`[${a}="${r}"]`;switch(s.operator){case"prefixed":return`[${a}^="${r}"]`;case"suffixed":return`[${a}$="${r}"]`;case"contains":return`[${a}*="${r}"]`}};var V="https://cdn.jsdelivr.net/npm/@finsweet/attributes-cmscore@1.1.1/cmscore.js";var l=()=>p(void 0,null,function*(){let{fsAttributes:t}=window;if(t.cms||(t.cms={}),t.cms.coreImport)return t.cms.coreImport;try{let e=import(V);return t.cms.coreImport=e,e}catch(e){u.alert(`${e}`,"error");return}});var f="fs-cmscss",d={element:{key:`${f}-element`,values:{list:$("list")}},pseudo:{key:`${f}-pseudo`},class:{key:`${f}-class`}},w=I(d);var{pseudo:{key:b},class:{key:M}}=d,y=t=>{for(let{element:e}of t){let{attributes:o}=e;for(let{name:i}of o){if(!i.startsWith(b))continue;let s=i.split(`${b}-`)[1],m=`${b}${s?`-${s}`:""}`,a=`${M}${s?`-${s}`:""}`,n=e.getAttribute(m),r=e.getAttribute(a);if(!n||!r)continue;let c=n.replace(/^\:/,""),T=r.replace(/^\./,""),v=e.matches(`[${m}]:${c}`);e.classList[v?"add":"remove"](T)}}};var S=()=>p(void 0,null,function*(){let t=yield l();if(!t)return[];let e=t.createCMSListInstances([w("element","list",{operator:"prefixed"})]);return yield Promise.all(e.map(k)),e}),k=t=>p(void 0,null,function*(){let{items:e}=t;y(e),t.on("renderitems",o=>y(o))});x();var{currentScript:E}=document,{preventsLoad:h}=C(E);l();h?window.fsAttributes.cmscss={init:S}:(window.Webflow||(window.Webflow=[]),window.Webflow.push(S));})();
(()=>{var p=(t,e,o)=>new Promise((i,s)=>{var m=r=>{try{n(o.next(r))}catch(c){s(c)}},a=r=>{try{n(o.throw(r))}catch(c){s(c)}},n=r=>r.done?i(r.value):Promise.resolve(r.value).then(m,a);n((o=o.apply(t,e)).next())});var u=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,o){if(this.alertsActivated&&window.alert(e),o==="error")throw new Error(e)}};u.alertsActivated=!1;var A="fs-attributes",g={preventLoad:{key:`${A}-preventload`},debugMode:{key:`${A}-debug`}};var x=()=>{window.fsAttributes||(window.fsAttributes={cms:{}})},C=t=>{let{preventLoad:e,debugMode:o}=g,i=typeof(t==null?void 0:t.getAttribute(e.key))=="string";return typeof(t==null?void 0:t.getAttribute(o.key))=="string"&&u.activateAlerts(),{preventsLoad:i}},$=t=>e=>`${t}${e?`-${e}`:""}`,I=t=>(o,i,s)=>{let m=t[o],{key:a,values:n}=m,r;if(!i)return`[${a}]`;let c=n==null?void 0:n[i];if(typeof c=="string"?r=c:r=c(s&&"instanceIndex"in s?s.instanceIndex:void 0),!(s==null?void 0:s.operator))return`[${a}="${r}"]`;switch(s.operator){case"prefixed":return`[${a}^="${r}"]`;case"suffixed":return`[${a}$="${r}"]`;case"contains":return`[${a}*="${r}"]`}};var V="https://cdn.jsdelivr.net/npm/@finsweet/attributes-cmscore@1.1.2/cmscore.js";var l=()=>p(void 0,null,function*(){let{fsAttributes:t}=window;if(t.cms||(t.cms={}),t.cms.coreImport)return t.cms.coreImport;try{let e=import(V);return t.cms.coreImport=e,e}catch(e){u.alert(`${e}`,"error");return}});var f="fs-cmscss",d={element:{key:`${f}-element`,values:{list:$("list")}},pseudo:{key:`${f}-pseudo`},class:{key:`${f}-class`}},w=I(d);var{pseudo:{key:b},class:{key:M}}=d,y=t=>{for(let{element:e}of t){let{attributes:o}=e;for(let{name:i}of o){if(!i.startsWith(b))continue;let s=i.split(`${b}-`)[1],m=`${b}${s?`-${s}`:""}`,a=`${M}${s?`-${s}`:""}`,n=e.getAttribute(m),r=e.getAttribute(a);if(!n||!r)continue;let c=n.replace(/^\:/,""),T=r.replace(/^\./,""),v=e.matches(`[${m}]:${c}`);e.classList[v?"add":"remove"](T)}}};var S=()=>p(void 0,null,function*(){let t=yield l();if(!t)return[];let e=t.createCMSListInstances([w("element","list",{operator:"prefixed"})]);return yield Promise.all(e.map(k)),e}),k=t=>p(void 0,null,function*(){let{items:e}=t;y(e),t.on("renderitems",o=>y(o))});x();var{currentScript:E}=document,{preventsLoad:h}=C(E);l();h?window.fsAttributes.cmscss={init:S}:(window.Webflow||(window.Webflow=[]),window.Webflow.push(S));})();
{
"name": "@finsweet/attributes-cmscss",
"version": "1.0.0",
"version": "1.0.1",
"description": "Add CSS classes to Collection Item elements based on a media query.",

@@ -5,0 +5,0 @@ "main": "cmscss.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc