Socket
Socket
Sign inDemoInstall

@finsweet/attributes-cmsprevnext

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@finsweet/attributes-cmsprevnext - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

2

cmsprevnext.js

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

(()=>{var O=Object.defineProperty;var D=(e,t,r)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var V=(e,t,r)=>(D(e,typeof t!="symbol"?t+"":t,r),r);var k="@finsweet/attributes-cmscore";var p=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,r){if(this.alertsActivated&&window.alert(t),r==="error")throw new Error(t)}};V(p,"alertsActivated",!1);var A=e=>e.replace(/\/+$/,"");var q=`https://cdn.jsdelivr.net/npm/${k}@1/cmscore.js`,x=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let r=import(q);return t.coreImport=r,r.then(s=>{s&&(t.coreVersion||(t.coreVersion=s.version))}),r}catch(r){p.alert(`${r}`,"error");return}};var f="fs-attributes";var H=`${f}-support`,Y="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",N=async()=>{let{fsAttributes:e,location:t}=window,{host:r,searchParams:s}=new URL(t.href);if(!r.includes("webflow.io")||!s.has(H))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((i,o)=>{let n=document.createElement("script");n.src=Y,n.onload=()=>i(!0),n.onerror=o,document.head.append(n)})}catch(i){return!1}return e.supportImport};var h=e=>{let t=(s,i,o)=>{let n=e[s],{key:a,values:l}=n,c;if(!i)return`[${a}]`;let b=l==null?void 0:l[i];typeof b=="string"?c=b:c=b(o&&"instanceIndex"in o?o.instanceIndex:void 0);let u=o&&"caseInsensitive"in o&&o.caseInsensitive?"i":"";if(!(o!=null&&o.operator))return`[${a}="${c}"${u}]`;switch(o.operator){case"prefixed":return`[${a}^="${c}"${u}]`;case"suffixed":return`[${a}$="${c}"${u}]`;case"contains":return`[${a}*="${c}"${u}]`}};function r(s,i){let o=t("element",s,i),n=(i==null?void 0:i.scope)||document;return i!=null&&i.all?n.querySelectorAll(o):n.querySelector(o)}return[t,r]};var E={preventLoad:{key:`${f}-preventload`},debugMode:{key:`${f}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${f}-dev`}},[T,Pe]=h(E);var L=()=>{let{currentScript:e}=document,{preventLoad:t,debugMode:r}=E,s=typeof(e==null?void 0:e.getAttribute(t.key))=="string";return typeof(e==null?void 0:e.getAttribute(r.key))=="string"&&p.activateAlerts(),{preventsLoad:s}};var $=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var r,s;for(let[i,o]of t)(s=(r=this[i])==null?void 0:r.loading)==null||s.then(o)}};X(e),W(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,N()},X=e=>{let t=T("src","finsweet",{operator:"contains"}),r=T("dev"),i=[...document.querySelectorAll(`script${t}, script${r}`)].reduce((o,n)=>{var l;let a=n.getAttribute(E.dev.key)||((l=n.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:l[0]);return a&&!o.includes(a)&&o.push(a),o},[]);for(let o of i){e[o]={};let n=e[o];n.loading=new Promise(a=>{n.resolve=l=>{a(l),delete n.resolve}})}},W=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var K="1.4.3";var d="cmsprevnext",z=`fs-${d}`,J="list",Q="previous",Z="previous-empty",ee="next",te="next-empty",re={element:{key:`${z}-element`,values:{list:J,previous:Q,previousEmpty:Z,next:ee,nextEmpty:te}}},[R,y]=h(re);var _=()=>{let e=y("previous",{operator:"prefixed"}),t=y("next",{operator:"prefixed"});if(!e&&!t)return;let r=y("previousEmpty",{operator:"prefixed"});r==null||r.remove();let s=y("nextEmpty",{operator:"prefixed"});return s==null||s.remove(),{previousPlaceholder:e,nextPlaceholder:t,previousEmptyElement:r,nextEmptyElement:s}};var I=async()=>{var C,M;let e=await x();if(!e)return[];let t=!1,r=!1,s=e.createCMSListInstances([R("element","list",{operator:"prefixed"})]);if(!s.length)return[];let i=_();if(!i)return[];let{previousPlaceholder:o,nextPlaceholder:n,previousEmptyElement:a,nextEmptyElement:l}=i,{origin:c,pathname:b}=window.location,u=c+b,P=()=>(!o||o&&t)&&(!n||n&&r);for(let w of s){if(P())break;let v=g=>{if(P()){w.off("additems",v),w.wrapper.remove();return}let S=g.findIndex(({href:m})=>m&&A(m)===A(u));if(!(S<0)){if(o){let m=g[S-1];m&&!t?(a==null||a.remove(),o.appendChild(m.element),t=!0):a&&o.appendChild(a)}if(n){let m=g[S+1];m&&!r?(l==null||l.remove(),n.appendChild(m.element),r=!0):l&&n.appendChild(l)}}};w.on("additems",v),v(w.items),w.wrapper.style.display="none"}return(M=(C=window.fsAttributes[d]).resolve)==null||M.call(C,s),s};$();x();var U,j;(U=window.fsAttributes)[j=d]||(U[j]={});var{preventsLoad:oe}=L(),F=window.fsAttributes[d];F.version=K;oe?F.init=I:(window.Webflow||(window.Webflow=[]),window.Webflow.push(I));})();
(()=>{var D=Object.defineProperty;var F=(t,e,r)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var M=(t,e,r)=>(F(t,typeof e!="symbol"?e+"":e,r),r);var P="@finsweet/attributes-cmscore";var m=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,r){if(this.alertsActivated&&window.alert(e),r==="error")throw new Error(e)}};M(m,"alertsActivated",!1);var w=t=>t.replace(/\/+$/,"");var H=`https://cdn.jsdelivr.net/npm/${P}@1/cmscore.js`,b=async()=>{let{fsAttributes:t}=window;t.cms||(t.cms={});let{cms:e}=t;if(e.coreImport)return e.coreImport;try{let r=import(H);return e.coreImport=r,r.then(s=>{s&&(e.coreVersion||(e.coreVersion=s.version))}),r}catch(r){m.alert(`${r}`,"error");return}};var d="fs-attributes";var u="cmsprevnex";var X=`${d}-support`,q="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",U=async()=>{let{fsAttributes:t,location:e}=window,{host:r,searchParams:s}=new URL(e.href);if(!r.includes("webflow.io")||!s.has(X))return!1;if(t.supportImport)return t.supportImport;try{t.supportImport=new Promise((i,o)=>{let n=document.createElement("script");n.src=q,n.onload=()=>i(!0),n.onerror=o,document.head.append(n)})}catch(i){return!1}return t.supportImport};var I=t=>{let e=(s,i,o)=>{let n=t[s],{key:c,values:a}=n,p;if(!i)return`[${c}]`;let T=a==null?void 0:a[i];typeof T=="string"?p=T:p=T(o&&"instanceIndex"in o?o.instanceIndex:void 0);let f=o&&"caseInsensitive"in o&&o.caseInsensitive?"i":"";if(!(o!=null&&o.operator))return`[${c}="${p}"${f}]`;switch(o.operator){case"prefixed":return`[${c}^="${p}"${f}]`;case"suffixed":return`[${c}$="${p}"${f}]`;case"contains":return`[${c}*="${p}"${f}]`}};function r(s,i){let o=e("element",s,i),n=(i==null?void 0:i.scope)||document;return i!=null&&i.all?n.querySelectorAll(o):n.querySelector(o)}return[e,r]};var x={preventLoad:{key:`${d}-preventload`},debugMode:{key:`${d}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${d}-dev`}},[h,gt]=I(x);var B=()=>{let{currentScript:t}=document,{preventLoad:e,debugMode:r}=x,s=typeof(t==null?void 0:t.getAttribute(e.key))=="string";return typeof(t==null?void 0:t.getAttribute(r.key))=="string"&&m.activateAlerts(),{preventsLoad:s}};var L=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let t={cms:{},push(...e){var r,s;for(let[i,o]of e)(s=(r=this[i])==null?void 0:r.loading)==null||s.then(o)}};Y(t),G(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,U()},Y=t=>{let e=h("src","finsweet",{operator:"contains"}),r=h("dev"),i=[...document.querySelectorAll(`script${e}, script${r}`)].reduce((o,n)=>{var a;let c=n.getAttribute(x.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 i){t[o]={};let n=t[o];n.loading=new Promise(c=>{n.resolve=a=>{c(a),delete n.resolve}})}},G=t=>{let e=Array.isArray(window.fsAttributes)?window.fsAttributes:[];t.push(...e)};var N="1.4.4";var Q=`fs-${u}`,z="list",J="previous",Z="previous-empty",tt="next",et="next-empty",rt={element:{key:`${Q}-element`,values:{list:z,previous:J,previousEmpty:Z,next:tt,nextEmpty:et}}},[V,A]=I(rt);var O=()=>{let t=A("previous",{operator:"prefixed"}),e=A("next",{operator:"prefixed"});if(!t&&!e)return;let r=A("previousEmpty",{operator:"prefixed"});r==null||r.remove();let s=A("nextEmpty",{operator:"prefixed"});return s==null||s.remove(),{previousPlaceholder:t,nextPlaceholder:e,previousEmptyElement:r,nextEmptyElement:s}};var R=async()=>{var C,v;let t=await b();if(!t)return[];let e=!1,r=!1,s=t.createCMSListInstances([V("element","list",{operator:"prefixed"})]);if(!s.length)return[];let i=O();if(!i)return[];let{previousPlaceholder:o,nextPlaceholder:n,previousEmptyElement:c,nextEmptyElement:a}=i,{origin:p,pathname:T}=window.location,f=p+T,g=()=>(!o||o&&e)&&(!n||n&&r);for(let E of s){if(g())break;let y=S=>{if(g()){E.off("additems",y),E.wrapper.remove();return}let _=S.findIndex(({href:l})=>l&&w(l)===w(f));if(!(_<0)){if(o){let l=S[_-1];l&&!e?(c==null||c.remove(),o.appendChild(l.element),e=!0):c&&o.appendChild(c)}if(n){let l=S[_+1];l&&!r?(a==null||a.remove(),n.appendChild(l.element),r=!0):a&&n.appendChild(a)}}};E.on("additems",y),y(E.items),E.wrapper.style.display="none"}return(v=(C=window.fsAttributes[u]).resolve)==null||v.call(C,s),s};L();b();var k,K;(k=window.fsAttributes)[K=u]||(k[K]={});var{preventsLoad:ot}=B(),$=window.fsAttributes[u];$.version=N;ot?$.init=R:(window.Webflow||(window.Webflow=[]),window.Webflow.push(R));})();
{
"name": "@finsweet/attributes-cmsprevnext",
"version": "1.4.3",
"version": "1.4.4",
"description": "Add Previous and Next buttons in Collection Template Pages.",

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

"dependencies": {
"@finsweet/attributes-cmscore": "1.6.7",
"@finsweet/attributes-cmscore": "1.6.8",
"@finsweet/ts-utils": "^0.33.1",
"@global/constants": "1.0.0",
"@global/factory": "1.1.1"
"@global/constants": "1.0.1",
"@global/factory": "1.1.2"
},

@@ -43,0 +43,0 @@ "scripts": {

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