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

@finsweet/attributes-cmsselect

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@finsweet/attributes-cmsselect - npm Package Compare versions

Comparing version 1.4.8 to 1.4.9

2

cmsselect.js

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

(()=>{var D=Object.defineProperty;var K=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var y=(e,t,r)=>(K(e,typeof t!="symbol"?t+"":t,r),r);var C="@finsweet/attributes-cmscore";var u=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,r){if(this.alertsActivated&&window.alert(t),r==="error")throw new Error(t)}};y(u,"alertsActivated",!1);var _={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var w=e=>{let t=e.split("-"),r=parseInt(t[t.length-1]);if(!isNaN(r))return r};var g=(e,t)=>{let r=e.getAttribute(t);return r?w(r):void 0};var F=`https://cdn.jsdelivr.net/npm/${C}@1/cmscore.js`,S=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let r=import(F);return t.coreImport=r,r.then(i=>{i&&(t.coreVersion||(t.coreVersion=i.version))}),r}catch(r){u.alert(`${r}`,"error");return}};var d="fs-attributes";var R="cmsload";var l="cmsselect";var j=`${d}-support`,H="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",h=async()=>{let{fsAttributes:e,location:t}=window,{host:r,searchParams:i}=new URL(t.href);if(!r.includes("webflow.io")||!i.has(j))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((s,o)=>{let n=document.createElement("script");n.src=H,n.onload=()=>s(!0),n.onerror=o,document.head.append(n)})}catch(s){return!1}return e.supportImport};var L=e=>t=>`${e}${t?`-${t}`:""}`,T=e=>{let t=(i,s,o)=>{let n=e[i],{key:c,values:a}=n,p;if(!s)return`[${c}]`;let f=a==null?void 0:a[s];typeof f=="string"?p=f:p=f(o&&"instanceIndex"in o?o.instanceIndex:void 0);let m=o&&"caseInsensitive"in o&&o.caseInsensitive?"i":"";if(!(o!=null&&o.operator))return`[${c}="${p}"${m}]`;switch(o.operator){case"prefixed":return`[${c}^="${p}"${m}]`;case"suffixed":return`[${c}$="${p}"${m}]`;case"contains":return`[${c}*="${p}"${m}]`}};function r(i,s){let o=t("element",i,s),n=(s==null?void 0:s.scope)||document;return s!=null&&s.all?n.querySelectorAll(o):n.querySelector(o)}return[t,r]};var b={preventLoad:{key:`${d}-preventload`},debugMode:{key:`${d}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${d}-dev`}},[A,ht]=T(b);var M=e=>{let{currentScript:t}=document,r={};if(!t)return{attributes:r,preventsLoad:!1};let s={preventsLoad:typeof t.getAttribute(b.preventLoad.key)=="string",attributes:r};for(let o in e){let n=t.getAttribute(e[o]);s.attributes[o]=n}return s};var v=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var r,i;for(let[s,o]of t)(i=(r=this[s])==null?void 0:r.loading)==null||i.then(o)}};q(e),G(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,h()},q=e=>{let t=A("src","finsweet",{operator:"contains"}),r=A("dev"),s=[...document.querySelectorAll(`script${t}, script${r}`)].reduce((o,n)=>{var a;let c=n.getAttribute(b.dev.key)||((a=n.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return c&&!o.includes(c)&&o.push(c),o},[]);for(let o of s){e[o]={};let n=e[o];n.loading=new Promise(c=>{n.resolve=a=>{c(a),delete n.resolve}})}},G=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var U="1.4.8";var W=`fs-${l}`,Y="text-value",Q="select",x={element:{key:`${W}-element`,values:{textValue:L(Y),select:Q}}},[E,Ft]=T(x);var O=(e,t)=>{var n;let r=g(e,x.element.key),i=B(r),s=new Set,o=new Set;for(let c of i){k(e,c,o);let a=c.closest(`.${_.wrapper}`);if(!a)continue;let p=(n=t.createCMSListInstance)==null?void 0:n.call(t,a);!p||s.add(p)}for(let c of s)c.on("additems",a=>{for(let{element:p}of a){let f=B(r,p);for(let m of f)k(e,m,o)}});return[...s]},B=(e,t=document)=>[...t.querySelectorAll(E("element","textValue",{instanceIndex:e}))],k=(e,{innerText:t},r)=>{if(!t||r.has(t))return;let i=new Option(t,t);e.options.add(i),r.add(t)};var I=async()=>{var s,o,n;let e=await S();if(!e)return[];let t=[...document.querySelectorAll(E("element","select",{operator:"prefixed"}))],r=new Set;for(let c of t){if(!(c instanceof HTMLSelectElement))continue;let a=O(c,e);for(let p of a)r.add(p)}let i=[...r];return await((s=window.fsAttributes[R])==null?void 0:s.loading),(n=(o=window.fsAttributes[l]).resolve)==null||n.call(o,i),i};v();S();var P,V;(P=window.fsAttributes)[V=l]||(P[V]={});var{preventsLoad:z}=M(),N=window.fsAttributes[l];N.version=U;z?N.init=I:(window.Webflow||(window.Webflow=[]),window.Webflow.push(I));})();
(()=>{var D=Object.defineProperty;var K=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var y=(e,t,r)=>(K(e,typeof t!="symbol"?t+"":t,r),r);var C="@finsweet/attributes-cmscore";var u=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,r){if(this.alertsActivated&&window.alert(t),r==="error")throw new Error(t)}};y(u,"alertsActivated",!1);var _={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var w=e=>{let t=e.split("-"),r=parseInt(t[t.length-1]);if(!isNaN(r))return r};var g=(e,t)=>{let r=e.getAttribute(t);return r?w(r):void 0};var F=`https://cdn.jsdelivr.net/npm/${C}@1/cmscore.js`,S=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let r=import(F);return t.coreImport=r,r.then(i=>{i&&(t.coreVersion||(t.coreVersion=i.version))}),r}catch(r){u.alert(`${r}`,"error");return}};var d="fs-attributes";var R="cmsload";var l="cmsselect";var j=`${d}-support`,H="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",h=async()=>{let{fsAttributes:e,location:t}=window,{host:r,searchParams:i}=new URL(t.href);if(!r.includes("webflow.io")||!i.has(j))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((s,o)=>{let n=document.createElement("script");n.src=H,n.onload=()=>s(!0),n.onerror=o,document.head.append(n)})}catch(s){return!1}return e.supportImport};var L=e=>t=>`${e}${t?`-${t}`:""}`,T=e=>{let t=(i,s,o)=>{let n=e[i],{key:c,values:a}=n,p;if(!s)return`[${c}]`;let f=a==null?void 0:a[s];typeof f=="string"?p=f:p=f(o&&"instanceIndex"in o?o.instanceIndex:void 0);let m=o&&"caseInsensitive"in o&&o.caseInsensitive?"i":"";if(!(o!=null&&o.operator))return`[${c}="${p}"${m}]`;switch(o.operator){case"prefixed":return`[${c}^="${p}"${m}]`;case"suffixed":return`[${c}$="${p}"${m}]`;case"contains":return`[${c}*="${p}"${m}]`}};function r(i,s){let o=t("element",i,s),n=(s==null?void 0:s.scope)||document;return s!=null&&s.all?n.querySelectorAll(o):n.querySelector(o)}return[t,r]};var b={preventLoad:{key:`${d}-preventload`},debugMode:{key:`${d}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${d}-dev`}},[A,ht]=T(b);var M=e=>{let{currentScript:t}=document,r={};if(!t)return{attributes:r,preventsLoad:!1};let s={preventsLoad:typeof t.getAttribute(b.preventLoad.key)=="string",attributes:r};for(let o in e){let n=t.getAttribute(e[o]);s.attributes[o]=n}return s};var v=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var r,i;for(let[s,o]of t)(i=(r=this[s])==null?void 0:r.loading)==null||i.then(o)}};q(e),G(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,h()},q=e=>{let t=A("src","finsweet",{operator:"contains"}),r=A("dev"),s=[...document.querySelectorAll(`script${t}, script${r}`)].reduce((o,n)=>{var a;let c=n.getAttribute(b.dev.key)||((a=n.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return c&&!o.includes(c)&&o.push(c),o},[]);for(let o of s){e[o]={};let n=e[o];n.loading=new Promise(c=>{n.resolve=a=>{c(a),delete n.resolve}})}},G=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var U="1.4.9";var W=`fs-${l}`,Y="text-value",Q="select",x={element:{key:`${W}-element`,values:{textValue:L(Y),select:Q}}},[E,Ft]=T(x);var O=(e,t)=>{var n;let r=g(e,x.element.key),i=B(r),s=new Set,o=new Set;for(let c of i){k(e,c,o);let a=c.closest(`.${_.wrapper}`);if(!a)continue;let p=(n=t.createCMSListInstance)==null?void 0:n.call(t,a);!p||s.add(p)}for(let c of s)c.on("additems",a=>{for(let{element:p}of a){let f=B(r,p);for(let m of f)k(e,m,o)}});return[...s]},B=(e,t=document)=>[...t.querySelectorAll(E("element","textValue",{instanceIndex:e}))],k=(e,{innerText:t},r)=>{if(!t||r.has(t))return;let i=new Option(t,t);e.options.add(i),r.add(t)};var I=async()=>{var s,o,n;let e=await S();if(!e)return[];let t=[...document.querySelectorAll(E("element","select",{operator:"prefixed"}))],r=new Set;for(let c of t){if(!(c instanceof HTMLSelectElement))continue;let a=O(c,e);for(let p of a)r.add(p)}let i=[...r];return await((s=window.fsAttributes[R])==null?void 0:s.loading),(n=(o=window.fsAttributes[l]).resolve)==null||n.call(o,i),i};v();S();var P,V;(P=window.fsAttributes)[V=l]||(P[V]={});var{preventsLoad:z}=M(),N=window.fsAttributes[l];N.version=U;z?N.init=I:(window.Webflow||(window.Webflow=[]),window.Webflow.push(I));})();
{
"name": "@finsweet/attributes-cmsselect",
"version": "1.4.8",
"version": "1.4.9",
"description": "Populate Select elements based on a CMS source.",

@@ -37,3 +37,3 @@ "homepage": "https://www.finsweet.com/attributes",

"dependencies": {
"@finsweet/attributes-cmscore": "1.7.0",
"@finsweet/attributes-cmscore": "1.7.1",
"@global/constants": "1.0.2",

@@ -40,0 +40,0 @@ "@global/factory": "1.1.3",

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