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.9 to 1.5.0

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.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));})();
"use strict";(()=>{var K=Object.defineProperty;var $=(e,t,r)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var y=(e,t,r)=>($(e,typeof t!="symbol"?t+"":t,r),r);var _="@finsweet/attributes-cmscore";var d=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,r){if(this.alertsActivated&&window.alert(t),r==="error")throw new Error(t)}};y(d,"alertsActivated",!1);var C={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 A=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?A(r):void 0};var j=`https://cdn.jsdelivr.net/npm/${_}@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(j);return t.coreImport=r,r.then(i=>{i&&(t.coreVersion||(t.coreVersion=i.version))}),r}catch(r){d.alert(`${r}`,"error");return}};var f="fs-attributes";var R="cmsattribute";var h="cmsload";var m="cmsselect";var H=`${f}-support`,q="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",L=async()=>{let{fsAttributes:e,location:t}=window,{host:r,searchParams:i}=new URL(t.href);if(!r.includes("webflow.io")||!i.has(H))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((s,o)=>{let n=document.createElement("script");n.src=q,n.onload=()=>s(!0),n.onerror=o,document.head.append(n)})}catch(s){return!1}return e.supportImport};var M=e=>t=>`${e}${t?`-${t}`:""}`,b=e=>{let t=(i,s,o)=>{let n=e[i],{key:c,values:a}=n,p;if(!s)return`[${c}]`;let l=a==null?void 0:a[s];typeof l=="string"?p=l:p=l(o&&"instanceIndex"in o?o.instanceIndex:void 0);let u=o&&"caseInsensitive"in o&&o.caseInsensitive?"i":"";if(!(o!=null&&o.operator))return`[${c}="${p}"${u}]`;switch(o.operator){case"prefixed":return`[${c}^="${p}"${u}]`;case"suffixed":return`[${c}$="${p}"${u}]`;case"contains":return`[${c}*="${p}"${u}]`}};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 T={preventLoad:{key:`${f}-preventload`},debugMode:{key:`${f}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${f}-dev`}},[w,Lt]=b(T);var v=e=>{let{currentScript:t}=document,r={};if(!t)return{attributes:r,preventsLoad:!1};let s={preventsLoad:typeof t.getAttribute(T.preventLoad.key)=="string",attributes:r};for(let o in e){let n=t.getAttribute(e[o]);s.attributes[o]=n}return s};var U=()=>{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)}};G(e),X(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,L()},G=e=>{let t=w("src","finsweet",{operator:"contains"}),r=w("dev"),s=[...document.querySelectorAll(`script${t}, script${r}`)].reduce((o,n)=>{var a;let c=n.getAttribute(T.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}})}},X=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var B="1.5.0";var Y=`fs-${m}`,Q="text-value",z="select",x={element:{key:`${Y}-element`,values:{textValue:M(Q),select:z}}},[E,jt]=b(x);var P=(e,t)=>{var n;let r=g(e,x.element.key),i=k(r),s=new Set,o=new Set;for(let c of i){O(e,c,o);let a=c.closest(`.${C.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 l=k(r,p);for(let u of l)O(e,u,o)}});return[...s]},k=(e,t=document)=>[...t.querySelectorAll(E("element","textValue",{instanceIndex:e}))],O=(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,c;let e=await S();if(!e)return[];await((s=window.fsAttributes[R])==null?void 0:s.loading);let t=[...document.querySelectorAll(E("element","select",{operator:"prefixed"}))],r=new Set;for(let a of t){if(!(a instanceof HTMLSelectElement))continue;let p=P(a,e);for(let l of p)r.add(l)}let i=[...r];return await((o=window.fsAttributes[h])==null?void 0:o.loading),(c=(n=window.fsAttributes[m]).resolve)==null||c.call(n,i),i};U();S();var V,N;(V=window.fsAttributes)[N=m]||(V[N]={});var{preventsLoad:J}=v(),D=window.fsAttributes[m];D.version=B;J?D.init=I:(window.Webflow||(window.Webflow=[]),window.Webflow.push(I));})();
{
"name": "@finsweet/attributes-cmsselect",
"version": "1.4.9",
"version": "1.5.0",
"description": "Populate Select elements based on a CMS source.",

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

"dependencies": {
"@finsweet/attributes-cmscore": "1.7.1",
"@global/constants": "1.0.2",
"@global/factory": "1.1.3",
"@finsweet/attributes-cmscore": "1.7.2",
"@global/constants": "1.1.0",
"@global/factory": "1.1.4",
"@global/helpers": "1.0.0",

@@ -42,0 +42,0 @@ "@finsweet/ts-utils": "^0.33.1"

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