@finsweet/attributes-cmscombine
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -1,1 +0,1 @@ | ||
(()=>{var P=Object.defineProperty;var k=(e,t,s)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var x=(e,t,s)=>(k(e,typeof t!="symbol"?t+"":t,s),s);var C="@finsweet/attributes-cmscore";var m=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,s){if(this.alertsActivated&&window.alert(t),s==="error")throw new Error(t)}};x(m,"alertsActivated",!1);var V=`https://cdn.jsdelivr.net/npm/${C}@1/cmscore.js`,T=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let s=import(V);return t.coreImport=s,s.then(o=>{o&&(t.coreVersion||(t.coreVersion=o.version))}),s}catch(s){m.alert(`${s}`,"error");return}};var u="fs-attributes";var p="cmscombine";var D=`${u}-support`,$="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",_=async()=>{let{fsAttributes:e,location:t}=window,{host:s,searchParams:o}=new URL(t.href);if(!s.includes("webflow.io")||!o.has(D))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((i,r)=>{let n=document.createElement("script");n.src=$,n.onload=()=>i(!0),n.onerror=r,document.head.append(n)})}catch(i){return!1}return e.supportImport};var E=e=>t=>`${e}${t?`-${t}`:""}`,d=e=>{let t=(o,i,r)=>{let n=e[o],{key:c,values:a}=n,l;if(!i)return`[${c}]`;let A=a==null?void 0:a[i];typeof A=="string"?l=A:l=A(r&&"instanceIndex"in r?r.instanceIndex:void 0);let f=r&&"caseInsensitive"in r&&r.caseInsensitive?"i":"";if(!(r!=null&&r.operator))return`[${c}="${l}"${f}]`;switch(r.operator){case"prefixed":return`[${c}^="${l}"${f}]`;case"suffixed":return`[${c}$="${l}"${f}]`;case"contains":return`[${c}*="${l}"${f}]`}};function s(o,i){let r=t("element",o,i),n=(i==null?void 0:i.scope)||document;return i!=null&&i.all?n.querySelectorAll(r):n.querySelector(r)}return[t,s]};var b={preventLoad:{key:`${u}-preventload`},debugMode:{key:`${u}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${u}-dev`}},[I,ft]=d(b);var R=()=>{let{currentScript:e}=document,{preventLoad:t,debugMode:s}=b,o=typeof(e==null?void 0:e.getAttribute(t.key))=="string";return typeof(e==null?void 0:e.getAttribute(s.key))=="string"&&m.activateAlerts(),{preventsLoad:o}};var g=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var s,o;for(let[i,r]of t)(o=(s=this[i])==null?void 0:s.loading)==null||o.then(r)}};K(e),j(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,_()},K=e=>{let t=I("src","finsweet",{operator:"contains"}),s=I("dev"),i=[...document.querySelectorAll(`script${t}, script${s}`)].reduce((r,n)=>{var a;let c=n.getAttribute(b.dev.key)||((a=n.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return c&&!r.includes(c)&&r.push(c),r},[]);for(let r of i){e[r]={};let n=e[r];n.loading=new Promise(c=>{n.resolve=a=>{c(a),delete n.resolve}})}},j=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var h="1.6.3";var q=`fs-${p}`,H="list",X="items-count",w={element:{key:`${q}-element`,values:{list:E(H),itemsCount:E(X)}}},[M,U]=d(w);var v=e=>{var s;let t=[];for(let o of e){let i=o.getInstanceIndex(w.element.key),r=t[s=i||0]||(t[s]={lists:[],target:o,instanceIndex:i});o!==r.target&&r.lists.push(o)}return t=t.filter(o=>o&&o.lists.length),t};var y=async(e,t)=>{let s=t.map(({element:o})=>o);await e.addItems(s)};var S=async()=>{var i,r;let e=await T();if(!e)return[];let t=e.createCMSListInstances([M("element","list",{operator:"prefixed"})]),s=v(t),o=await Promise.all(s.map(G));return(r=(i=window.fsAttributes[p]).resolve)==null||r.call(i,o),o},G=async({lists:e,target:t,instanceIndex:s})=>{if(!t.itemsCount){let o=U("itemsCount",{instanceIndex:s});o&&t.addItemsCount(o)}for(let o of e)o.on("additems",async i=>await y(t,i));return await Promise.all(e.map(async({wrapper:o,items:i})=>{o.remove(),await y(t,i)})),t};g();T();var B,L;(B=window.fsAttributes)[L=p]||(B[L]={});var{preventsLoad:Y}=R(),O=window.fsAttributes[p];O.version=h;Y?O.init=S:(window.Webflow||(window.Webflow=[]),window.Webflow.push(S));})(); | ||
(()=>{var P=Object.defineProperty;var k=(e,t,s)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var x=(e,t,s)=>(k(e,typeof t!="symbol"?t+"":t,s),s);var C="@finsweet/attributes-cmscore";var m=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,s){if(this.alertsActivated&&window.alert(t),s==="error")throw new Error(t)}};x(m,"alertsActivated",!1);var V=`https://cdn.jsdelivr.net/npm/${C}@1/cmscore.js`,T=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let s=import(V);return t.coreImport=s,s.then(o=>{o&&(t.coreVersion||(t.coreVersion=o.version))}),s}catch(s){m.alert(`${s}`,"error");return}};var u="fs-attributes";var p="cmscombine";var D=`${u}-support`,$="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",_=async()=>{let{fsAttributes:e,location:t}=window,{host:s,searchParams:o}=new URL(t.href);if(!s.includes("webflow.io")||!o.has(D))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((i,r)=>{let n=document.createElement("script");n.src=$,n.onload=()=>i(!0),n.onerror=r,document.head.append(n)})}catch(i){return!1}return e.supportImport};var E=e=>t=>`${e}${t?`-${t}`:""}`,d=e=>{let t=(o,i,r)=>{let n=e[o],{key:c,values:a}=n,l;if(!i)return`[${c}]`;let A=a==null?void 0:a[i];typeof A=="string"?l=A:l=A(r&&"instanceIndex"in r?r.instanceIndex:void 0);let f=r&&"caseInsensitive"in r&&r.caseInsensitive?"i":"";if(!(r!=null&&r.operator))return`[${c}="${l}"${f}]`;switch(r.operator){case"prefixed":return`[${c}^="${l}"${f}]`;case"suffixed":return`[${c}$="${l}"${f}]`;case"contains":return`[${c}*="${l}"${f}]`}};function s(o,i){let r=t("element",o,i),n=(i==null?void 0:i.scope)||document;return i!=null&&i.all?n.querySelectorAll(r):n.querySelector(r)}return[t,s]};var b={preventLoad:{key:`${u}-preventload`},debugMode:{key:`${u}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${u}-dev`}},[I,ft]=d(b);var R=()=>{let{currentScript:e}=document,{preventLoad:t,debugMode:s}=b,o=typeof(e==null?void 0:e.getAttribute(t.key))=="string";return typeof(e==null?void 0:e.getAttribute(s.key))=="string"&&m.activateAlerts(),{preventsLoad:o}};var g=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var s,o;for(let[i,r]of t)(o=(s=this[i])==null?void 0:s.loading)==null||o.then(r)}};K(e),j(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,_()},K=e=>{let t=I("src","finsweet",{operator:"contains"}),s=I("dev"),i=[...document.querySelectorAll(`script${t}, script${s}`)].reduce((r,n)=>{var a;let c=n.getAttribute(b.dev.key)||((a=n.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return c&&!r.includes(c)&&r.push(c),r},[]);for(let r of i){e[r]={};let n=e[r];n.loading=new Promise(c=>{n.resolve=a=>{c(a),delete n.resolve}})}},j=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var h="1.6.4";var q=`fs-${p}`,H="list",X="items-count",w={element:{key:`${q}-element`,values:{list:E(H),itemsCount:E(X)}}},[M,U]=d(w);var v=e=>{var s;let t=[];for(let o of e){let i=o.getInstanceIndex(w.element.key),r=t[s=i||0]||(t[s]={lists:[],target:o,instanceIndex:i});o!==r.target&&r.lists.push(o)}return t=t.filter(o=>o&&o.lists.length),t};var y=async(e,t)=>{let s=t.map(({element:o})=>o);await e.addItems(s)};var S=async()=>{var i,r;let e=await T();if(!e)return[];let t=e.createCMSListInstances([M("element","list",{operator:"prefixed"})]),s=v(t),o=await Promise.all(s.map(G));return(r=(i=window.fsAttributes[p]).resolve)==null||r.call(i,o),o},G=async({lists:e,target:t,instanceIndex:s})=>{if(!t.itemsCount){let o=U("itemsCount",{instanceIndex:s});o&&t.addItemsCount(o)}for(let o of e)o.on("additems",async i=>await y(t,i));return await Promise.all(e.map(async({wrapper:o,items:i})=>{o.remove(),await y(t,i)})),t};g();T();var B,L;(B=window.fsAttributes)[L=p]||(B[L]={});var{preventsLoad:Y}=R(),O=window.fsAttributes[p];O.version=h;Y?O.init=S:(window.Webflow||(window.Webflow=[]),window.Webflow.push(S));})(); |
{ | ||
"name": "@finsweet/attributes-cmscombine", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "Combine multiple Collection Lists to one Collection List.", | ||
@@ -37,5 +37,5 @@ "homepage": "https://www.finsweet.com/attributes", | ||
"dependencies": { | ||
"@finsweet/attributes-cmscore": "1.6.8", | ||
"@global/factory": "1.1.2", | ||
"@global/constants": "1.0.1" | ||
"@finsweet/attributes-cmscore": "1.6.9", | ||
"@global/factory": "1.1.3", | ||
"@global/constants": "1.0.2" | ||
}, | ||
@@ -42,0 +42,0 @@ "scripts": { |
+ Added@finsweet/attributes-cmscore@1.6.9(transitive)
- Removed@finsweet/attributes-cmscore@1.6.8(transitive)
Updated@global/constants@1.0.2
Updated@global/factory@1.1.3