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.4 to 1.4.5

2

cmsprevnext.js

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

(()=>{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));})();
(()=>{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="cmsprevnext";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.5";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.4",
"version": "1.4.5",
"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.8",
"@finsweet/attributes-cmscore": "1.6.9",
"@finsweet/ts-utils": "^0.33.1",
"@global/constants": "1.0.1",
"@global/factory": "1.1.2"
"@global/constants": "1.0.2",
"@global/factory": "1.1.3"
},

@@ -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