@finsweet/attributes-cmsload
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -1,1 +0,1 @@ | ||
"use strict";(()=>{var Me=Object.create;var K=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty;var ke=(e,t,o)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Oe=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,o)=>(typeof require!="undefined"?require:t)[o]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var $e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ke=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Be(t))!Ue.call(e,r)&&r!==o&&K(e,r,{get:()=>t[r],enumerable:!(n=Ie(t,r))||n.enumerable});return e};var j=(e,t,o)=>(o=e!=null?Me(Ne(e)):{},Ke(t||!e||!e.__esModule?K(o,"default",{value:e,enumerable:!0}):o,e));var X=(e,t,o)=>(ke(e,typeof t!="symbol"?t+"":t,o),o);var Ae=$e((br,be)=>{be.exports=Rt;function Rt(e,t,o,n){var r,i,s;return function(){if(s=this,i=Array.prototype.slice.call(arguments),r&&(o||n))return;if(!o)return c(),r=setTimeout(l,t),r;r=setTimeout(c,t),e.apply(s,i);function l(){c(),e.apply(s,i)}function c(){clearTimeout(r),r=null}}}});var _="fs-attributes";var C="cmsload";var b=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,o){if(this.alertsActivated&&window.alert(t),o==="error")throw new Error(t)}};X(b,"alertsActivated",!1);var h=()=>{};function P(e,t,o,n){return e?(e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)):h}var M="w--current";var L={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 Q={addToCartForm:"w-commerce-commerceaddtocartform"},z={trigger:"w-lightbox"};var I=(e,t=!0)=>e.cloneNode(t);var J=(e,t)=>!!e&&t.includes(e);function B(e,t,o,n=!0){let r=o?[o]:[];if(!e)return r;let i=e.split(",").reduce((s,a)=>{let l=a.trim();return(!n||l)&&s.push(l),s},[]);if(t){let s=i.filter(a=>J(a,t));return s.length?s:r}return i}var D=e=>e!=null;var Z=new Map([["tiny","(max-width: 479px)"],["small","(max-width: 767px)"],["medium","(max-width: 991px)"],["main","(min-width: 992px)"]]);var{wrapper:De,list:Ve,paginationWrapper:Fe,paginationNext:He,paginationPrevious:Ge,emptyState:Ye,pageCount:We}=L;function y(e,t,o=document){let n=typeof e=="string"?o.querySelector(e):e;if(!n)return;let r=n.closest(`.${De}`);if(!r)return;let i=r.querySelector(`.${Ve}`);return t==="wrapper"?r:t==="list"?i:t==="items"?[...(i==null?void 0:i.children)||[]]:t==="pageCount"?r.querySelector(`.${We}`):t==="empty"?r.querySelector(`:scope > .${Ye}`):t==="pagination"?r.querySelector(`.${Fe}`):r.querySelector(`.${t==="next"?He:Ge}`)}var V=(e,t=document)=>{e=e.filter(i=>i);let o=e.join(", ")||`.${L.wrapper}`;return[...t.querySelectorAll(o)].reduce((i,s)=>{if(!s)return i;let a=y(s,"wrapper");return!a||i.includes(a)||i.push(a),i},[])};var F=()=>{for(let[e,t]of Z)if(window.matchMedia(t).matches)return e;return"main"};function ee(e,t,o){var r;let n=window.fsAttributes[e];return n.destroy=o||h,(r=n.resolve)==null||r.call(n,t),t}var qe="https://cdn.jsdelivr.net/npm/@finsweet/attributes-animation@1/functions.js",te=async()=>{let{fsAttributes:e}=window;e.animation||(e.animation={});let{animation:t}=e;if(t.import)return t.import;try{return t.import=import(qe),t.import}catch(o){b.alert(`${o}`,"error");return}};var oe=async()=>{let{fsAttributes:e}=window;e.cmscore||(e.cmscore={});let{cmscore:t}=e;if(t.import)return t.import;try{return t.import=import("https://cdn.jsdelivr.net/npm/@finsweet/attributes-cmscore@1/cmscore.js"),t.import.then(o=>{o&&(t.version||(t.version=o.version))}),t.import}catch(o){b.alert(`${o}`,"error");return}};var je=`${_}-support`,Xe="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",re=async()=>{let{fsAttributes:e,location:t}=window,{host:o,searchParams:n}=new URL(t.href);e.support||(e.support={});let{support:r}=e;if(!o.includes("webflow.io")||!n.has(je))return!1;if(r.import)return r.import;try{r.import=new Promise((i,s)=>{let a=document.createElement("script");a.src=Xe,a.onload=()=>i(!0),a.onerror=s,document.head.append(a)})}catch(i){return!1}return r.import};var x=e=>t=>`${e}${t?`-${t}`:""}`,N=e=>{let t=(n,r,i)=>{let s=e[n],{key:a,values:l}=s,c;if(!r)return`[${a}]`;let m=l==null?void 0:l[r];typeof m=="string"?c=m:c=m(i&&"instanceIndex"in i?i.instanceIndex:void 0);let p=i&&"caseInsensitive"in i&&i.caseInsensitive?"i":"";if(!(i!=null&&i.operator))return`[${a}="${c}"${p}]`;switch(i.operator){case"prefixed":return`[${a}^="${c}"${p}]`;case"suffixed":return`[${a}$="${c}"${p}]`;case"contains":return`[${a}*="${c}"${p}]`}};function o(n,r){let i=t("element",n,r),s=(r==null?void 0:r.scope)||document;return r!=null&&r.all?[...s.querySelectorAll(i)]:s.querySelector(i)}return[t,o]};var v={preventLoad:{key:`${_}-preventload`},debugMode:{key:`${_}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${_}-dev`}},[H,Fo]=N(v);var ne=e=>{let{currentScript:t}=document,o={};if(!t)return{attributes:o,preventsLoad:!1};let r={preventsLoad:typeof t.getAttribute(v.preventLoad.key)=="string",attributes:o};for(let i in e){let s=t.getAttribute(e[i]);r.attributes[i]=s}return r};var se=({scriptAttributes:e,attributeKey:t,version:o,init:n})=>{var a;Qe(),(a=window.fsAttributes)[t]||(a[t]={});let{preventsLoad:r,attributes:i}=ne(e),s=window.fsAttributes[t];s.version=o,s.init=n,r||(window.Webflow||(window.Webflow=[]),window.Webflow.push(()=>n(i)))},Qe=()=>{let e=ze();if(window.fsAttributes&&!Array.isArray(window.fsAttributes)){ie(window.fsAttributes,e);return}let t={cms:{},push(...o){var n,r;for(let[i,s]of o)(r=(n=this[i])==null?void 0:n.loading)==null||r.then(s)},destroy(){var o,n;for(let r of e)(n=(o=window.fsAttributes[r])==null?void 0:o.destroy)==null||n.call(o)}};ie(t,e),Je(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,re()},ze=()=>{let e=H("src","finsweet",{operator:"contains"}),t=H("dev");return[...document.querySelectorAll(`script${e}, script${t}`)].reduce((r,i)=>{var a;let s=i.getAttribute(v.dev.key)||((a=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return s&&!r.includes(s)&&r.push(s),r},[])},ie=(e,t)=>{for(let o of t){if(e[o])continue;e[o]={};let n=e[o];n.loading=new Promise(r=>{n.resolve=i=>{r(i),delete n.resolve}})}},Je=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var ae="1.9.0";var U=async e=>{let o=await(await fetch(e)).text();return new DOMParser().parseFromString(o,"text/html")};var ce=({textContent:e})=>{if(!e)return;let[,t]=e.split("/");return t?parseInt(t.trim()):void 0},k=async(e,t,o,n)=>{n==null||n.preventDefault();let{items:r,itemsPerPage:i}=e;if(!(!t&&i===r.length)){if(i+o<=r.length)e.itemsPerPage=i+o;else if(t){let s=await e.once("renderitems");e.itemsPerPage=i+s.length}else e.itemsPerPage+=r.length-i;await e.renderItems(!0)}},le=e=>{let{pagesQuery:t,currentPage:o,totalPages:n,paginationNext:r,paginationPrevious:i}=e;!o||(i&&(i.style.display=o!==1?"":"none",i.href=`?${t}=${o-1}`),r&&(r.style.display=o!==n?"":"none",r.href=`?${t}=${o+1}`))},ue=(e,{currentPage:t,totalPages:o})=>{e.setAttribute("aria-label",`Page ${t} of ${o}`),e.textContent=`${t} / ${o}`};var O=async(e,t,o)=>{var p;let{index:n,paginationNext:r,paginationPrevious:i,originalItemsPerPage:s}=t,a=V([],e)[n];if(!a)return;if(!i||!r){let f=y(a,"pagination"),d=y(a,"previous"),u=y(a,"next");if(d){let g=[...(f==null?void 0:f.children)||[]].indexOf(d);t.addPaginationButton(d,"paginationPrevious",g)}if(u){let g=[...(f==null?void 0:f.children)||[]].indexOf(u);d||(g+=1),t.addPaginationButton(u,"paginationNext",g)}}let l=(p=y(a,"next"))==null?void 0:p.href,c=y(a,"items"),{length:m}=c;return l&&s!==m&&(t.originalItemsPerPage=t.itemsPerPage=m),await t.addItems(c,o),l};var A=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n,extractingPaginationData:r}=e;if(!t&&!o)return;await r;let i=n?ce(n):void 0;await e.displayElement("loader"),i?await me(e,i):await et(e),await e.emit("finishload"),await e.displayElement("loader",!1)},et=async e=>{let{paginationNext:t,currentPage:o}=e;if(o&&await me(e,o),!t)return;let{href:n}=t,r=[n],i=async s=>{try{let a=await U(s),l=await O(a,e);if(!l||r.includes(l))return;r.push(l),await i(l)}catch(a){return}};await i(n)},me=async(e,t)=>{let{paginationNext:o,paginationPrevious:n}=e;if(!o&&!n)return;let{pagesQuery:r,currentPage:i}=e;if(!r||!i)return;let{origin:s,pathname:a}=window.location;for(let c=i-1;c>=1;c--)try{let m=await U(`${s}${a}?${r}=${c}`);await O(m,e,"unshift")}catch(m){return}let l=[];for(let c=i+1;c<=t;c++)l[c]=(async()=>{let m=l[c-1];try{let p=await U(`${s}${a}?${r}=${c}`);await m,await O(p,e)}catch(p){await m;return}})();await Promise.all(l)};var pe=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n,itemsPerPage:r}=e;if(!t)return;o&&(o.style.display="none"),n==null||n.remove();let i=!0,s=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:m,items:p,itemsPerPage:f}=e;if(!i&&p.length===f)return c();t.style.display=m.length>f?"":"none"});let l=P(t,"click",async m=>{m.preventDefault(),!s&&(s=!0,await k(e,i,r,m),s=!1)}),c=()=>{l(),t.style.display="none"};return await A(e),i=!1,c};var de=tt;function tt(e,t,o){var n=null,r=null,i=o&&o.leading,s=o&&o.trailing;i==null&&(i=!0),s==null&&(s=!i),i==!0&&(s=!1);var a=function(){n&&(clearTimeout(n),n=null)},l=function(){var m=r;a(),m&&m()},c=function(){var m=i&&!n,p=this,f=arguments;if(r=function(){return e.apply(p,f)},n||(n=setTimeout(function(){if(n=null,s)return r()},t)),m)return m=!1,r()};return c.cancel=a,c.flush=l,c}var T=`fs-${C}`,ot="list",rt="loader",nt="items-count",it="visible-count",st="visible-count-from",at="visible-count-to",ct="scroll-anchor",lt="page-button",ut="page-dots",mt="empty",pt="mode",dt={loadUnder:"load-under",renderAll:"render-all",pagination:"pagination",infinite:"infinite"},ft="threshold",gt="pagesiblings",Et="pageboundary",Tt="animation",St="easing",yt="duration",xt="stagger",bt="resetix",At={true:"true"},wt="showquery",_t={true:"true"},R={element:{key:`${T}-element`,values:{list:x(ot),loader:x(rt),itemsCount:x(nt),visibleCount:x(it),visibleCountFrom:x(st),visibleCountTo:x(at),scrollAnchor:x(ct),empty:x(mt),pageButton:lt,pageDots:ut}},mode:{key:`${T}-${pt}`,values:dt},threshold:{key:`${T}-${ft}`},pageSiblings:{key:`${T}-${gt}`},pageBoundary:{key:`${T}-${Et}`},animation:{key:`${T}-${Tt}`},easing:{key:`${T}-${St}`},duration:{key:`${T}-${yt}`},stagger:{key:`${T}-${xt}`},resetIx:{key:`${T}-${bt}`,values:At},showQuery:{key:`${T}-${wt}`,values:_t}},[$,S]=N(R),fe="-20",ge=1,Ee=1,Te={main:0,medium:1,small:2,tiny:3};var{pageSiblings:{key:Ct},pageBoundary:{key:Pt},threshold:{key:Lt},showQuery:{key:ht,values:vt}}=R,Se=e=>{let{paginationWrapper:t,paginationCount:o}=e;if(!t)return;let n=S("pageButton",{operator:"prefixed",scope:t}),r=S("pageDots",{operator:"prefixed",scope:t});r?r.remove():(r=document.createElement("div"),r.textContent="...");let i=e.getAttribute(Pt),s=(i?B(i):[]).map(d=>parseInt(d)),a=e.getAttribute(Ct),l=(a?B(a):[]).map(d=>parseInt(d)),[c,m]=G(s,l),p=[s,l].some(({length:d})=>d>1),f=e.getAttribute(ht)===vt.true;return{paginationWrapper:t,pageButtonTemplate:n,pageDotsTemplate:r,paginationCount:o,pageBoundary:c,pageBoundaryValues:s,pageSiblings:m,pageSiblingsValues:l,hasBreakpoints:p,showQueryParams:f}},G=(e,t)=>{let o=F(),n=Te[o],r=[];[e,t].forEach((a,l)=>{for(let c=n;c>=0;c--){let m=a[c];if(typeof m=="number"){r[l]=m;break}}});let[i,s]=r;return i!=null||(i=Ee),s!=null||(s=ge),[i,s]},ye=e=>{let t=parseInt(e.getAttribute(Lt)||fe);return 1-t/100};var xe=async e=>{let{list:t,paginationNext:o,paginationPrevious:n,paginationCount:r,itemsPerPage:i}=e;if(!t||!o)return;n&&(n.style.display="none"),r==null||r.remove();let s=ye(e),a=!0,l=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:d,items:u,itemsPerPage:g}=e;if(!a&&u.length===g){f();return}o.style.display=d.length>g?"":"none"});let c=async d=>{d.preventDefault()},m=de(async()=>{if(l)return;let{innerHeight:d}=window,{bottom:u}=t.getBoundingClientRect(),g=s*d;u>0&&u<=g&&(l=!0,await k(e,a,i),l=!1)},100),p=new IntersectionObserver(d=>{for(let{isIntersecting:u}of d)window[u?"addEventListener":"removeEventListener"]("scroll",m)}),f=()=>{window.removeEventListener("scroll",m),o.removeEventListener("click",c),o.style.display="none",p.disconnect()};return o.addEventListener("click",c),p.observe(t),await A(e),a=!1,f};var we=j(Ae(),1);var{paginationNext:Mt,paginationPrevious:It}=L,_e=async e=>{let t=Se(e);if(!t)return;let{paginationWrapper:o,pageButtonTemplate:n,pageDotsTemplate:r,paginationCount:i,pageBoundary:s,pageBoundaryValues:a,pageSiblings:l,pageSiblingsValues:c,hasBreakpoints:m,showQueryParams:p}=t,f;if(n){let{parentElement:g}=n;n.remove(),g&&(f={parentElement:g,pageButtonTemplate:n,pageDotsTemplate:r,pageBoundary:s,pageSiblings:l,renderedElements:new Map([])})}e.initPagination(p),e.on("renderitems",()=>Bt(e,f,i));let d=P(o,"click",g=>kt(g,f,e)),u;return f&&m&&(u=P(window,"resize",(0,we.default)(()=>{Ot(f,e,a,c)},100))),await A(e),()=>{d(),u==null||u()}},Bt=(e,t,o,n=!0)=>{t&&Ce(t,e),o&&ue(o,e),n&&le(e)},Ce=(e,t)=>{let{currentPage:o,totalPages:n}=t;if(!o)return;let{parentElement:r,renderedElements:i,pageBoundary:s,pageSiblings:a}=e,l=[...i],c=a*2+1,p=s*2+c+2,f=o-1<p-c,d=n-o<p-c;for(let u=1;u<=p;u++){let[g,Y]=l[u-1]||[],[W]=l[u-2]||[];if(u>n){g&&(g.remove(),l[u-1]=void 0);continue}let E;n<=p?E=u:f?u>p-s?E=n-(p-u):u===p-s?E=null:E=u:d?u<s+1?E=u:u===s+1?E=null:E=n-(p-u):u<s+1?E=u:u>p-s?E=n-(p-u):u===s+1||u===p-s?E=null:E=o+(u-(s+1)-(1+a));let w;Y!==E&&(g==null||g.remove(),w=Nt(e,E,t),l[u-1]=[w,E],W?r.insertBefore(w,W.nextSibling):r.appendChild(w),w.style.opacity="");let q=w||g;!q||Ut(q,E===o)}e.renderedElements=new Map([...l.filter(D)])},Nt=({pageButtonTemplate:e,pageDotsTemplate:t},o,{pagesQuery:n})=>{if(!o)return I(t);let r=I(e);return r.classList.remove(M),r.textContent=`${o}`,r instanceof HTMLAnchorElement&&n&&(r.href=`?${n}=${o}`),r},Ut=(e,t)=>{t?(e.classList.add(M),e.setAttribute("aria-current","page")):(e.classList.remove(M),e.removeAttribute("aria-current"))},kt=(e,t,o)=>{let{target:n}=e;if(!(n instanceof Element))return;let r=n.closest($("element","pageButton",{operator:"prefixed"})),i=n.closest(`.${Mt}`),s=n.closest(`.${It}`);if(!r&&!i&&!s)return;e.preventDefault();let{currentPage:a,totalPages:l}=o;if(!a)return;let c;i&&(c=a+1),s&&(c=a-1),r&&(c=t==null?void 0:t.renderedElements.get(r)),!!c&&c>=1&&c<=l&&o.switchPage(c)},Ot=(e,t,...o)=>{let{pageBoundary:n,pageSiblings:r,renderedElements:i}=e,[s,a]=G(...o);if(!(n===s&&r===a)){e.pageBoundary=s,e.pageSiblings=a;for(let[l]of i)l.remove();i.clear(),Ce(e,t)}};var Pe=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n}=e;!t||(t.style.display="none",o&&(o.style.display="none"),n==null||n.remove(),await A(e))};var{element:{key:$t},mode:{key:Kt,values:{renderAll:Dt,infinite:Vt,pagination:Ft}},animation:{key:Ht},duration:{key:Le},easing:{key:he},stagger:{key:Gt},resetIx:{key:Yt,values:Wt}}=R,ve=async(e,t)=>{let o=e.getInstanceIndex($t),{items:n}=e,{Webflow:r}=window,i=!!r&&"require"in r;t.addItemsAnimation(e,{animationKey:Ht,durationKey:Le,easingKey:he,staggerKey:Gt}),t.addListAnimation(e,{durationKey:Le,easingKey:he});let s=i&&!!r.require("commerce")&&n.some(({element:d})=>d.querySelector(`.${Q.addToCartForm}`));s&&(e.restartCommerce=s);let a=i&&!!r.require("lightbox")&&n.some(({element:d})=>d.querySelector(`.${z.trigger}`));a&&(e.restartLightbox=a);let l=e.getAttribute(Yt)===Wt.true;l&&(e.restartIx=l);let c=S("loader",{instanceIndex:o});c&&e.addLoader(c);let m=S("empty",{instanceIndex:o});if(m&&e.addEmptyElement(m),!e.itemsCount){let d=S("itemsCount",{instanceIndex:o});d&&e.addItemsCount(d)}if(!e.visibleCount||!e.visibleCountFrom||!e.visibleCountTo){let d=S("visibleCount",{instanceIndex:o}),u=S("visibleCountFrom",{instanceIndex:o}),g=S("visibleCountTo",{instanceIndex:o});e.addVisibleCount(d,u,g)}if(!e.scrollAnchor){let d=S("scrollAnchor",{instanceIndex:o});d&&(e.scrollAnchor=d)}let p=e.getAttribute(Kt);return p===Dt?await Pe(e):p===Vt?await xe(e):p===Ft?await _e(e):await pe(e)};var Re=async()=>{let e=await oe();if(!e)return[];let t=e.createCMSListInstances([$("element","list",{operator:"prefixed"})]),o=await Promise.all(t.map(n=>ve(n,e)));return ee(C,t,()=>{var n;for(let r of t)(n=r.destroy)==null||n.call(r);for(let r of o)r==null||r()})};se({init:Re,version:ae,attributeKey:C});te();})(); | ||
"use strict";(()=>{var De=Object.create;var V=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty;var Ge=(e,t,o)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var We=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ye=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ve(t))!Fe.call(e,r)&&r!==o&&V(e,r,{get:()=>t[r],enumerable:!(n=Ke(t,r))||n.enumerable});return e};var qe=(e,t,o)=>(o=e!=null?De(He(e)):{},Ye(t||!e||!e.__esModule?V(o,"default",{value:e,enumerable:!0}):o,e));var z=(e,t,o)=>(Ge(e,typeof t!="symbol"?t+"":t,o),o);var Re=We(($r,ve)=>{ve.exports=Nt;function Nt(e,t,o,n){var r,i,s;return function(){if(s=this,i=Array.prototype.slice.call(arguments),r&&(o||n))return;if(!o)return l(),r=setTimeout(c,t),r;r=setTimeout(l,t),e.apply(s,i);function c(){l(),e.apply(s,i)}function l(){clearTimeout(r),r=null}}}});var L="fs-attributes";var J="animation";var Z="cmscore";var w="cmsload";var H="support";var b=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,o){if(this.alertsActivated&&window.alert(t),o==="error")throw new Error(t)}};z(b,"alertsActivated",!1);var v=()=>{};function P(e,t,o,n){return e?(e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)):v}var I="w--current";var ee={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 te={addToCartForm:"w-commerce-commerceaddtocartform"},oe={trigger:"w-lightbox"};var re=e=>e instanceof Element;var ne=e=>e instanceof HTMLAnchorElement;var ie=(e,t)=>!!e&&t.includes(e);var F=e=>e!=null;var B=e=>typeof e=="string",se=e=>typeof e=="number";var N=(e,t=!0)=>e.cloneNode(t);function U(e,t,o,n=!0){let r=o?[o]:[];if(!e)return r;let i=e.split(",").reduce((s,a)=>{let c=a.trim();return(!n||c)&&s.push(c),s},[]);if(t){let s=i.filter(a=>ie(a,t));return s.length?s:r}return i}var ae=new Map([["tiny","(max-width: 479px)"],["small","(max-width: 767px)"],["medium","(max-width: 991px)"],["main","(min-width: 992px)"]]);var G=()=>{for(let[e,t]of ae)if(window.matchMedia(t).matches)return e;return"main"};function le(e,t,o){var r;let n=window.fsAttributes[e];return n.destroy=o||v,(r=n.resolve)==null||r.call(n,t),t}var h=(e,t="1",o="iife")=>{let r=`${e}${o==="esm"?".esm":""}.js`;return`https://cdn.jsdelivr.net/npm/@finsweet/attributes-${e}@${t}/${r}`};var je=h(J,"1","esm"),ce=async()=>{let{fsAttributes:e}=window;e.animation||(e.animation={});let{animation:t}=e;if(t.import)return t.import;try{return t.import=import(je),t.import}catch(o){b.alert(`${o}`,"error");return}};var Xe=h(Z,"1"),me=async()=>{let{fsAttributes:e}=window;e.cmscore||(e.cmscore={});let{cmscore:t}=e;if(t.import)return t.import;try{return t.import=import(Xe),t.import.then(o=>{o&&(t.version||(t.version=o.version))}),t.import}catch(o){b.alert(`${o}`,"error");return}};var Qe=`${L}-${H}`,pe=async()=>{var r;let{fsAttributes:e,location:t}=window,{host:o,searchParams:n}=new URL(t.href);return!o.includes("webflow.io")||!n.has(Qe)?!1:(r=e.import)==null?void 0:r.call(e,H,"1")};var A=e=>t=>`${e}${t?`-${t}`:""}`,O=e=>{let t=(r,i,s)=>{let a=e[r],{key:c,values:l}=a,p;if(!i)return`[${c}]`;let u=l==null?void 0:l[i];B(u)?p=u:p=u(s&&"instanceIndex"in s?s.instanceIndex:void 0);let f=s&&"caseInsensitive"in s&&s.caseInsensitive?"i":"";if(!(s!=null&&s.operator))return`[${c}="${p}"${f}]`;switch(s.operator){case"prefixed":return`[${c}^="${p}"${f}]`;case"suffixed":return`[${c}$="${p}"${f}]`;case"contains":return`[${c}*="${p}"${f}]`}};function o(r,i){let s=t("element",r,i),a=(i==null?void 0:i.scope)||document;return i!=null&&i.all?[...a.querySelectorAll(s)]:a.querySelector(s)}return[t,o,(r,i)=>{let s=e[i];return s?r.getAttribute(s.key):null}]};var R={preventLoad:{key:`${L}-preventload`},debugMode:{key:`${L}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${L}-dev`}},[W,jo]=O(R);var ue=e=>{let{currentScript:t}=document,o={};if(!t)return{attributes:o,preventsLoad:!1};let r={preventsLoad:B(t.getAttribute(R.preventLoad.key)),attributes:o};for(let i in e){let s=t.getAttribute(e[i]);r.attributes[i]=s}return r};var de=({scriptAttributes:e,attributeKey:t,version:o,init:n})=>{var a;ze(),(a=window.fsAttributes)[t]||(a[t]={});let{preventsLoad:r,attributes:i}=ue(e),s=window.fsAttributes[t];s.version=o,s.init=n,r||(window.Webflow||(window.Webflow=[]),window.Webflow.push(()=>n(i)))},ze=()=>{let e=Ze();if(window.fsAttributes&&!Array.isArray(window.fsAttributes)){Y(window.fsAttributes,e);return}let t=Je(e);Y(t,e),et(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,pe()},Je=e=>{let t={cms:{},push(...o){var n,r;for(let[i,s]of o)(r=(n=this[i])==null?void 0:n.loading)==null||r.then(s)},async import(o,n){let r=t[o];return r||new Promise(i=>{let s=document.createElement("script");s.src=h(o,n),s.async=!0,s.onload=()=>{let[a]=Y(t,[o]);i(a)},document.head.append(s)})},destroy(){var o,n;for(let r of e)(n=(o=window.fsAttributes[r])==null?void 0:o.destroy)==null||n.call(o)}};return t},Ze=()=>{let e=W("src","finsweet",{operator:"contains"}),t=W("dev");return[...document.querySelectorAll(`script${e}, script${t}`)].reduce((r,i)=>{var a;let s=i.getAttribute(R.dev.key)||((a=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return s&&!r.includes(s)&&r.push(s),r},[])},Y=(e,t)=>t.map(n=>{let r=e[n];return r||(e[n]={},r=e[n],r.loading=new Promise(i=>{r.resolve=s=>{i(s),delete r.resolve}}),r)}),et=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var fe="1.10.0";var ot="fs-cms-element",rt={wrapper:"wrapper",list:"list",item:"item",paginationWrapper:"pagination-wrapper",paginationNext:"pagination-next",paginationPrevious:"pagination-previous",pageCount:"page-count",emptyState:"empty"},T=e=>{let t=`.${ee[e]}`,o=`[${ot}="${rt[e]}"]`;return`:is(${t}, ${o})`},Ee=(e,t=document)=>{e=e.filter(i=>i);let o=e.join(", ")||T("wrapper");return[...t.querySelectorAll(o)].reduce((i,s)=>{if(!s)return i;let a=C(s,"wrapper");return!a||i.includes(a)||i.push(a),i},[])};function C(e,t,o=document){let n=typeof e=="string"?o.querySelector(e):e;if(!n)return;let r=n.closest(T("wrapper"));if(!r)return;let i=r.querySelector(T("list"));return t==="wrapper"?r:t==="list"?i:t==="items"?[...(i==null?void 0:i.querySelectorAll(`:scope > ${T("item")}`))||[]]:t==="pageCount"?r.querySelector(T("pageCount")):t==="empty"?r.querySelector(`:scope > ${T("emptyState")}`):t==="pagination"?r.querySelector(T("paginationWrapper")):r.querySelector(T(t==="next"?"paginationNext":"paginationPrevious"))}var $=async e=>{let o=await(await fetch(e)).text();return new DOMParser().parseFromString(o,"text/html")};var ge=({textContent:e})=>{if(!e)return;let[,t]=e.split("/");return t?parseInt(t.trim()):void 0},k=async(e,t,o,n)=>{n==null||n.preventDefault();let{items:r,itemsPerPage:i}=e;if(!(!t&&i===r.length)){if(i+o<=r.length)e.itemsPerPage=i+o;else if(t){let s=await e.once("renderitems");e.itemsPerPage=i+s.length}else e.itemsPerPage+=r.length-i;await e.renderItems(!0)}},Te=e=>{let{pagesQuery:t,currentPage:o,totalPages:n,paginationNext:r,paginationPrevious:i}=e;!o||(i&&(i.style.display=o!==1?"":"none",i.href=`?${t}=${o-1}`),r&&(r.style.display=o!==n?"":"none",r.href=`?${t}=${o+1}`))},Se=(e,{currentPage:t,totalPages:o})=>{e.setAttribute("aria-label",`Page ${t} of ${o}`),e.textContent=`${t} / ${o}`};var D=async(e,t,o)=>{var u;let{index:n,paginationNext:r,paginationPrevious:i,originalItemsPerPage:s}=t,a=Ee([],e)[n];if(!a)return;if(!i||!r){let f=C(a,"pagination"),d=C(a,"previous"),m=C(a,"next");if(d){let E=[...(f==null?void 0:f.children)||[]].indexOf(d);t.addPaginationButton(d,"paginationPrevious",E)}if(m){let E=[...(f==null?void 0:f.children)||[]].indexOf(m);d||(E+=1),t.addPaginationButton(m,"paginationNext",E)}}let c=(u=C(a,"next"))==null?void 0:u.href,l=C(a,"items"),{length:p}=l;return c&&s!==p&&(t.originalItemsPerPage=t.itemsPerPage=p),await t.addItems(l,o),c};var y=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n,extractingPaginationData:r}=e;if(!t&&!o)return;await r;let i=n?ge(n):void 0;await e.displayElement("loader"),i?await xe(e,i):await nt(e),await e.emit("finishload"),await e.displayElement("loader",!1)},nt=async e=>{let{paginationNext:t,currentPage:o}=e;if(o&&await xe(e,o),!t)return;let{href:n}=t,r=[n],i=async s=>{try{let a=await $(s),c=await D(a,e);if(!c||r.includes(c))return;r.push(c),await i(c)}catch(a){return}};await i(n)},xe=async(e,t)=>{let{paginationNext:o,paginationPrevious:n}=e;if(!o&&!n)return;let{pagesQuery:r,currentPage:i}=e;if(!r||!i)return;let{origin:s,pathname:a}=window.location;for(let l=i-1;l>=1;l--)try{let p=await $(`${s}${a}?${r}=${l}`);await D(p,e,"unshift")}catch(p){return}let c=[];for(let l=i+1;l<=t;l++)c[l]=(async()=>{let p=c[l-1];try{let u=await $(`${s}${a}?${r}=${l}`);await p,await D(u,e)}catch(u){await p;return}})();await Promise.all(c)};var Ae=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n,itemsPerPage:r}=e;if(!t)return;o&&(o.style.display="none"),n==null||n.remove();let i=!0,s=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:p,items:u,itemsPerPage:f}=e;if(!i&&u.length===f)return l();t.style.display=p.length>f?"":"none"});let c=P(t,"click",async p=>{p.preventDefault(),!s&&(s=!0,await k(e,i,r,p),s=!1)}),l=()=>{c(),t.style.display="none"};return await y(e),i=!1,l};var be=it;function it(e,t,o){var n=null,r=null,i=o&&o.leading,s=o&&o.trailing;i==null&&(i=!0),s==null&&(s=!i),i==!0&&(s=!1);var a=function(){n&&(clearTimeout(n),n=null)},c=function(){var p=r;a(),p&&p()},l=function(){var p=i&&!n,u=this,f=arguments;if(r=function(){return e.apply(u,f)},n||(n=setTimeout(function(){if(n=null,s)return r()},t)),p)return p=!1,r()};return l.cancel=a,l.flush=c,l}var S=`fs-${w}`,st="list",at="loader",lt="items-count",ct="visible-count",mt="visible-count-from",pt="visible-count-to",ut="scroll-anchor",dt="page-button",ft="page-dots",Et="empty",gt="mode",Tt={loadUnder:"load-under",renderAll:"render-all",pagination:"pagination",infinite:"infinite"},St="threshold",xt="pagesiblings",At="pageboundary",bt="animation",yt="easing",Ct="duration",_t="stagger",Lt="resetix",wt={true:"true"},Pt="showquery",ht={true:"true"},M={element:{key:`${S}-element`,values:{list:A(st),loader:A(at),itemsCount:A(lt),visibleCount:A(ct),visibleCountFrom:A(mt),visibleCountTo:A(pt),scrollAnchor:A(ut),empty:A(Et),pageButton:dt,pageDots:ft}},mode:{key:`${S}-${gt}`,values:Tt},threshold:{key:`${S}-${St}`},pageSiblings:{key:`${S}-${xt}`},pageBoundary:{key:`${S}-${At}`},animation:{key:`${S}-${bt}`},easing:{key:`${S}-${yt}`},duration:{key:`${S}-${Ct}`},stagger:{key:`${S}-${_t}`},resetIx:{key:`${S}-${Lt}`,values:wt},showQuery:{key:`${S}-${Pt}`,values:ht}},[K,x]=O(M),ye="-20",Ce=1,_e=1,Le={main:0,medium:1,small:2,tiny:3};var{pageSiblings:{key:vt},pageBoundary:{key:Rt},threshold:{key:Mt},showQuery:{key:It,values:Bt}}=M,we=e=>{let{paginationWrapper:t,paginationCount:o}=e;if(!t)return;let n=x("pageButton",{operator:"prefixed",scope:t}),r=x("pageDots",{operator:"prefixed",scope:t});r?r.remove():(r=document.createElement("div"),r.textContent="...");let i=e.getAttribute(Rt),s=(i?U(i):[]).map(d=>parseInt(d)),a=e.getAttribute(vt),c=(a?U(a):[]).map(d=>parseInt(d)),[l,p]=q(s,c),u=[s,c].some(({length:d})=>d>1),f=e.getAttribute(It)===Bt.true;return{paginationWrapper:t,pageButtonTemplate:n,pageDotsTemplate:r,paginationCount:o,pageBoundary:l,pageBoundaryValues:s,pageSiblings:p,pageSiblingsValues:c,hasBreakpoints:u,showQueryParams:f}},q=(e,t)=>{let o=G(),n=Le[o],r=[];[e,t].forEach((a,c)=>{for(let l=n;l>=0;l--){let p=a[l];if(se(p)){r[c]=p;break}}});let[i,s]=r;return i!=null||(i=_e),s!=null||(s=Ce),[i,s]},Pe=e=>1-parseInt(e.getAttribute(Mt)||ye)/100;var he=async e=>{let{list:t,paginationNext:o,paginationPrevious:n,paginationCount:r,itemsPerPage:i}=e;if(!t||!o)return;n&&(n.style.display="none"),r==null||r.remove();let s=Pe(e),a=!0,c=!1;e.initPagination(),e.on("renderitems",()=>{let{validItems:d,items:m,itemsPerPage:E}=e;if(!a&&m.length===E){f();return}o.style.display=d.length>E?"":"none"});let l=async d=>{d.preventDefault()},p=be(async()=>{if(c)return;let{innerHeight:d}=window,{bottom:m}=t.getBoundingClientRect(),E=s*d;m>0&&m<=E&&(c=!0,await k(e,a,i),c=!1)},100),u=new IntersectionObserver(d=>{for(let{isIntersecting:m}of d)window[m?"addEventListener":"removeEventListener"]("scroll",p)}),f=()=>{window.removeEventListener("scroll",p),o.removeEventListener("click",l),o.style.display="none",u.disconnect()};return o.addEventListener("click",l),u.observe(t),await y(e),a=!1,f};var Me=qe(Re(),1);var Ie=async e=>{let t=we(e);if(!t)return;let{paginationWrapper:o,pageButtonTemplate:n,pageDotsTemplate:r,paginationCount:i,pageBoundary:s,pageBoundaryValues:a,pageSiblings:c,pageSiblingsValues:l,hasBreakpoints:p,showQueryParams:u}=t,f;if(n){let{parentElement:E}=n;n.remove(),E&&(f={parentElement:E,pageButtonTemplate:n,pageDotsTemplate:r,pageBoundary:s,pageSiblings:c,renderedElements:new Map([])})}e.initPagination(u),e.on("renderitems",()=>Ut(e,f,i));let d=P(o,"click",E=>kt(E,f,e)),m;return f&&p&&(m=P(window,"resize",(0,Me.default)(()=>{Dt(f,e,a,l)},100))),await y(e),()=>{d(),m==null||m()}},Ut=(e,t,o,n=!0)=>{t&&Be(t,e),o&&Se(o,e),n&&Te(e)},Be=(e,t)=>{let{currentPage:o,totalPages:n}=t;if(!o)return;let{parentElement:r,renderedElements:i,pageBoundary:s,pageSiblings:a}=e,c=[...i],l=a*2+1,u=s*2+l+2,f=o-1<u-l,d=n-o<u-l;for(let m=1;m<=u;m++){let[E,j]=c[m-1]||[],[X]=c[m-2]||[];if(m>n){E&&(E.remove(),c[m-1]=void 0);continue}let g;n<=u?g=m:f?m>u-s?g=n-(u-m):m===u-s?g=null:g=m:d?m<s+1?g=m:m===s+1?g=null:g=n-(u-m):m<s+1?g=m:m>u-s?g=n-(u-m):m===s+1||m===u-s?g=null:g=o+(m-(s+1)-(1+a));let _;j!==g&&(E==null||E.remove(),_=Ot(e,g,t),c[m-1]=[_,g],X?r.insertBefore(_,X.nextSibling):r.appendChild(_),_.style.opacity="");let Q=_||E;!Q||$t(Q,g===o)}e.renderedElements=new Map([...c.filter(F)])},Ot=({pageButtonTemplate:e,pageDotsTemplate:t},o,{pagesQuery:n})=>{if(!o)return N(t);let r=N(e);return r.classList.remove(I),r.textContent=`${o}`,ne(r)&&n&&(r.href=`?${n}=${o}`),r},$t=(e,t)=>{t?(e.classList.add(I),e.setAttribute("aria-current","page")):(e.classList.remove(I),e.removeAttribute("aria-current"))},kt=(e,t,o)=>{let{target:n}=e;if(!re(n))return;let r=n.closest(K("element","pageButton",{operator:"prefixed"})),i=n.closest(T("paginationNext")),s=n.closest(T("paginationPrevious"));if(!r&&!i&&!s)return;e.preventDefault();let{currentPage:a,totalPages:c}=o;if(!a)return;let l;i&&(l=a+1),s&&(l=a-1),r&&(l=t==null?void 0:t.renderedElements.get(r)),!!l&&l>=1&&l<=c&&o.switchPage(l)},Dt=(e,t,...o)=>{let{pageBoundary:n,pageSiblings:r,renderedElements:i}=e,[s,a]=q(...o);if(!(n===s&&r===a)){e.pageBoundary=s,e.pageSiblings=a;for(let[c]of i)c.remove();i.clear(),Be(e,t)}};var Ne=async e=>{let{paginationNext:t,paginationPrevious:o,paginationCount:n}=e;!t||(t.style.display="none",o&&(o.style.display="none"),n==null||n.remove(),await y(e))};var{element:{key:Kt},mode:{key:Vt,values:{renderAll:Ht,infinite:Ft,pagination:Gt}},animation:{key:Wt},duration:{key:Ue},easing:{key:Oe},stagger:{key:Yt},resetIx:{key:qt,values:jt}}=M,$e=async(e,t)=>{let o=e.getInstanceIndex(Kt),{items:n}=e,{Webflow:r}=window,i=!!r&&"require"in r;t.addItemsAnimation(e,{animationKey:Wt,durationKey:Ue,easingKey:Oe,staggerKey:Yt}),t.addListAnimation(e,{durationKey:Ue,easingKey:Oe});let s=i&&!!r.require("commerce")&&n.some(({element:d})=>d.querySelector(`.${te.addToCartForm}`));s&&(e.restartCommerce=s);let a=i&&!!r.require("lightbox")&&n.some(({element:d})=>d.querySelector(`.${oe.trigger}`));a&&(e.restartLightbox=a);let c=e.getAttribute(qt)===jt.true;c&&(e.restartIx=c);let l=x("loader",{instanceIndex:o});l&&e.addLoader(l);let p=x("empty",{instanceIndex:o});if(p&&e.addEmptyElement(p),!e.itemsCount){let d=x("itemsCount",{instanceIndex:o});d&&e.addItemsCount(d)}if(!e.visibleCount||!e.visibleCountFrom||!e.visibleCountTo){let d=x("visibleCount",{instanceIndex:o}),m=x("visibleCountFrom",{instanceIndex:o}),E=x("visibleCountTo",{instanceIndex:o});e.addVisibleCount(d,m,E)}if(!e.scrollAnchor){let d=x("scrollAnchor",{instanceIndex:o});d&&(e.scrollAnchor=d)}let u=e.getAttribute(Vt);return u===Ht?await Ne(e):u===Ft?await he(e):u===Gt?await Ie(e):await Ae(e)};var ke=async()=>{let e=await me();if(!e)return[];let t=e.createCMSListInstances([K("element","list",{operator:"prefixed"})]),o=await Promise.all(t.map(n=>$e(n,e)));return le(w,t,()=>{var n;for(let r of t)(n=r.destroy)==null||n.call(r);for(let r of o)r==null||r()})};de({init:ke,version:fe,attributeKey:w});ce();})(); |
{ | ||
"name": "@finsweet/attributes-cmsload", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Load More Webflow CMS items on the page after the page has loaded.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://www.finsweet.com/attributes", |
@@ -1,1 +0,1 @@ | ||
{"elements":[{"key":"list","description":"Defines the list to load more items.","required":true,"appliedTo":[{"label":"Collection List","selectors":[".w-dyn-items",".w-dyn-list"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[]},{"key":"loader","description":"Defines an element that will be displayed while the library is loading items in the background.","required":false,"appliedTo":[{"label":"Image","selectors":["img"]},{"label":"GIF","selectors":["img"]},{"label":"Embed Code","selectors":["div.w-embed"]},{"label":"Lottie Animation","selectors":["[data-animation-type=\"lottie\"]"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"items-count","description":"Defines an element where to display the total items of the list.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"visible-count","description":"Defines an element where to display the amount of visible items.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"visible-count-from","description":"Defines an element where to display the lower range of visible items.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"visible-count-to","description":"Defines an element where to display the upper range of visible items.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"scroll-anchor","description":"Defines an element where to scroll the view every time a page in `Pagination` mode is switched.","required":false,"appliedTo":[{"label":"Div Block","selectors":["div","header","footer","nav","main","section","article","aside","address","figure"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"},{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"page-button","description":"Defines the template element to generate all page buttons for the `Pagination` mode.","required":false,"appliedTo":[{"label":"Button","selectors":["a.w-button"]},{"label":"Link Block","selectors":["a.w-inline-block"]},{"label":"Text Link","selectors":["a"]}],"multiplesInInstance":false,"requiresInstance":false,"conditions":[{"condition":"isChildOf","type":"element","element":"list"},{"condition":"isChildOf","type":"selector","selector":[{"label":"Pagination Wrapper","selectors":[".w-pagination-wrapper"]}]},{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"page-dots","description":"Defines the template element to create the page dots separators.","required":false,"appliedTo":[{"label":"Div Block","selectors":["div","header","footer","nav","main","section","article","aside","address","figure"]},{"label":"Text Element","selectors":["p","span","div"]}],"multiplesInInstance":false,"requiresInstance":false,"conditions":[{"type":"element","condition":"isChildOf","element":"list"},{"type":"selector","condition":"isChildOf","selector":[{"label":"Pagination Wrapper","selectors":[".w-pagination-wrapper"]}]},{"type":"element","condition":"settings","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"empty","description":"Defines the Empty State element for when there are no elements to show.","required":false,"requiresInstance":true,"multiplesInInstance":false,"appliedTo":[{"label":"Div Block","selectors":["div","header","footer","nav","main","section","article","aside","address","figure"]}],"conditions":[{"condition":"exists","type":"element","element":"list"}]}],"settings":[{"key":"mode","description":"Defines the loading mode.","appliedTo":{"elements":["list"]},"value":{"type":"options","options":[{"value":"load-under","description":"When clicking the Next button more items will be loaded and rendered at the end of the list."},{"value":"infinite","description":"When the bottom of the list reaches a certain threshold more items will be loaded and rendered at the end of the list."},{"value":"pagination","description":"Users can quickly navigate through pages."},{"value":"render-all","description":"All items will be loaded and rendered on the list. Not advised for lists with more than 200 items."}],"default":"load-under"},"conditions":[]},{"key":"threshold","description":"Defines when new items will load when the user scrolls","appliedTo":{"elements":["list"]},"value":{"type":"float","default":"-20"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"infinite"}]}]},{"key":"pagesiblings","description":"Defines the amount of digits to display either side of the current page. It can be a comma-separated string listing the values in a `Desktop, Tablet, Landscape, Portrait` order.","appliedTo":{"elements":["list"]},"value":{"type":"commaSeparatedFloat","default":"1"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"pageboundary","description":"Defines the amount of digits to display at the start and end of a page buttons list. It can be a comma-separated string listing the values in a `Desktop, Tablet, Landscape, Portrait` order.","appliedTo":{"elements":["list"]},"value":{"type":"commaSeparatedFloat","default":"1"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"animation","description":"Defines the animation to use when appending elements to the list.","appliedTo":{"elements":["list"]},"value":{"type":"options","options":[{"value":"fade","description":"The items will fade-in."},{"value":"slide-up","description":"The items will slide from the bottom."},{"value":"slide-down","description":"The items will slide from the top."},{"value":"slide-right","description":"The items will slide from the left to the right."},{"value":"slide-left","description":"The items will slide from the right to the left."},{"value":"grow","description":"The items will grow-in."},{"value":"shrink","description":"The items will shrink-in."},{"value":"spin","description":"The items will spin-in."}],"default":"fade"},"conditions":[]},{"key":"easing","description":"Defines the easing function of the animation.","appliedTo":{"elements":["list"]},"value":{"type":"options","options":[{"value":"linear","description":"The items animation curve will be linear."},{"value":"ease","description":"The items animation curve will be ease."},{"value":"ease-in","description":"The items animation curve will be ease-in."},{"value":"ease-out","description":"The items animation curve will be ease-out."},{"value":"ease-in-out","description":"The items animation curve will be ease-in-out."}],"default":"ease"},"conditions":[]},{"key":"duration","description":"Defines the duration of the animation in miliseconds.","appliedTo":{"elements":["list"]},"value":{"type":"float","default":"100"},"conditions":[]},{"key":"stagger","description":"Defines a stagger delay for the items animation in miliseconds.","appliedTo":{"elements":["list"]},"value":{"type":"float"},"conditions":[]},{"key":"resetix","description":"Defines if Webflow's interactions should be restarted after rendering new items. Use it if your Collection List Items use interactions.","appliedTo":{"elements":["list"]},"value":{"type":"boolean","default":"true"},"conditions":[]},{"key":"showquery","description":"Defines if the pagination query params should be displayed on the URL.","appliedTo":{"elements":["list"]},"value":{"type":"boolean","default":"true"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]}]} | ||
{"elements":[{"key":"list","description":"Defines the list to load more items.","required":true,"appliedTo":[{"label":"Collection List","selectors":[":is(.w-dyn-items, [fs-cms-element=\"list\"])",":is(.w-dyn-list, [fs-cms-element=\"wrapper\"])"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[]},{"key":"loader","description":"Defines an element that will be displayed while the library is loading items in the background.","required":false,"appliedTo":[{"label":"Image","selectors":["img"]},{"label":"GIF","selectors":["img"]},{"label":"Embed Code","selectors":["div.w-embed"]},{"label":"Lottie Animation","selectors":["[data-animation-type=\"lottie\"]"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"items-count","description":"Defines an element where to display the total items of the list.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"visible-count","description":"Defines an element where to display the amount of visible items.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"visible-count-from","description":"Defines an element where to display the lower range of visible items.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"visible-count-to","description":"Defines an element where to display the upper range of visible items.","required":false,"appliedTo":[{"label":"Text Block","selectors":["div"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"}]},{"key":"scroll-anchor","description":"Defines an element where to scroll the view every time a page in `Pagination` mode is switched.","required":false,"appliedTo":[{"label":"Div Block","selectors":["div","header","footer","nav","main","section","article","aside","address","figure"]}],"multiplesInInstance":false,"requiresInstance":true,"conditions":[{"condition":"exists","type":"element","element":"list"},{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"page-button","description":"Defines the template element to generate all page buttons for the `Pagination` mode.","required":false,"appliedTo":[{"label":"Button","selectors":["a.w-button"]},{"label":"Link Block","selectors":["a.w-inline-block"]},{"label":"Text Link","selectors":["a"]}],"multiplesInInstance":false,"requiresInstance":false,"conditions":[{"condition":"isChildOf","type":"element","element":"list"},{"condition":"isChildOf","type":"selector","selector":[{"label":"Pagination Wrapper","selectors":[":is(.w-pagination-wrapper, [fs-cms-element=\"pagination-wrapper\"])"]}]},{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"page-dots","description":"Defines the template element to create the page dots separators.","required":false,"appliedTo":[{"label":"Div Block","selectors":["div","header","footer","nav","main","section","article","aside","address","figure"]},{"label":"Text Element","selectors":["p","span","div"]}],"multiplesInInstance":false,"requiresInstance":false,"conditions":[{"type":"element","condition":"isChildOf","element":"list"},{"type":"selector","condition":"isChildOf","selector":[{"label":"Pagination Wrapper","selectors":[":is(.w-pagination-wrapper, [fs-cms-element=\"pagination-wrapper\"])"]}]},{"type":"element","condition":"settings","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"empty","description":"Defines the Empty State element for when there are no elements to show.","required":false,"requiresInstance":true,"multiplesInInstance":false,"appliedTo":[{"label":"Div Block","selectors":["div","header","footer","nav","main","section","article","aside","address","figure"]}],"conditions":[{"condition":"exists","type":"element","element":"list"}]}],"settings":[{"key":"mode","description":"Defines the loading mode.","appliedTo":{"elements":["list"]},"value":{"type":"options","options":[{"value":"load-under","description":"When clicking the Next button more items will be loaded and rendered at the end of the list."},{"value":"infinite","description":"When the bottom of the list reaches a certain threshold more items will be loaded and rendered at the end of the list."},{"value":"pagination","description":"Users can quickly navigate through pages."},{"value":"render-all","description":"All items will be loaded and rendered on the list. Not advised for lists with more than 200 items."}],"default":"load-under"},"conditions":[]},{"key":"threshold","description":"Defines when new items will load when the user scrolls","appliedTo":{"elements":["list"]},"value":{"type":"float","default":"-20"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"infinite"}]}]},{"key":"pagesiblings","description":"Defines the amount of digits to display either side of the current page. It can be a comma-separated string listing the values in a `Desktop, Tablet, Landscape, Portrait` order.","appliedTo":{"elements":["list"]},"value":{"type":"commaSeparatedFloat","default":"1"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"pageboundary","description":"Defines the amount of digits to display at the start and end of a page buttons list. It can be a comma-separated string listing the values in a `Desktop, Tablet, Landscape, Portrait` order.","appliedTo":{"elements":["list"]},"value":{"type":"commaSeparatedFloat","default":"1"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]},{"key":"animation","description":"Defines the animation to use when appending elements to the list.","appliedTo":{"elements":["list"]},"value":{"type":"options","options":[{"value":"fade","description":"The items will fade-in."},{"value":"slide-up","description":"The items will slide from the bottom."},{"value":"slide-down","description":"The items will slide from the top."},{"value":"slide-right","description":"The items will slide from the left to the right."},{"value":"slide-left","description":"The items will slide from the right to the left."},{"value":"grow","description":"The items will grow-in."},{"value":"shrink","description":"The items will shrink-in."},{"value":"spin","description":"The items will spin-in."}],"default":"fade"},"conditions":[]},{"key":"easing","description":"Defines the easing function of the animation.","appliedTo":{"elements":["list"]},"value":{"type":"options","options":[{"value":"linear","description":"The items animation curve will be linear."},{"value":"ease","description":"The items animation curve will be ease."},{"value":"ease-in","description":"The items animation curve will be ease-in."},{"value":"ease-out","description":"The items animation curve will be ease-out."},{"value":"ease-in-out","description":"The items animation curve will be ease-in-out."}],"default":"ease"},"conditions":[]},{"key":"duration","description":"Defines the duration of the animation in miliseconds.","appliedTo":{"elements":["list"]},"value":{"type":"float","default":"100"},"conditions":[]},{"key":"stagger","description":"Defines a stagger delay for the items animation in miliseconds.","appliedTo":{"elements":["list"]},"value":{"type":"float"},"conditions":[]},{"key":"resetix","description":"Defines if Webflow's interactions should be restarted after rendering new items. Use it if your Collection List Items use interactions.","appliedTo":{"elements":["list"]},"value":{"type":"boolean","default":"true"},"conditions":[]},{"key":"showquery","description":"Defines if the pagination query params should be displayed on the URL.","appliedTo":{"elements":["list"]},"value":{"type":"boolean","default":"true"},"conditions":[{"condition":"settings","type":"element","element":"list","settings":[{"key":"mode","value":"pagination"}]}]}]} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
34944
0
0
1