@mgdis/stencil-helpers 3.2.2 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -20,7 +20,7 @@
20
20
  `).join(""),t+=`
21
21
  `),t},ie=e=>`${e.docs}
22
22
 
23
- Type: \`${e.type}\``,_t=(e,t,r,s)=>({$schema:"https://json.schemastore.org/web-types",name:e,version:t,"description-markup":"markdown",contributions:{html:{elements:r.components.map(n=>{const i=me(s,n.filePath);return{name:n.tag,description:we(n),"doc-url":i,attributes:n.props.filter(a=>a.attr).map(a=>({name:a.attr,description:ie(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),js:{properties:n.props.map(a=>({name:a.name,description:ie(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),events:n.events.map(a=>({name:a.event,description:a.docs}))},css:{properties:n.styles.map(a=>({name:a.name,description:a.docs}))}}})}}}),bt=(e,t,r)=>[{name:"Storybook",url:me(e,r)},{name:"Sources",url:yt(t,r)}],vt=e=>{if(!e.values.some(({value:t})=>t===void 0))return e.values.map(({value:t})=>({name:t}))},mt=(e,t,r)=>({version:1.1,tags:e.components.map(s=>{const n=bt(t,r,s.filePath);return{name:s.tag,description:we(s),attributes:s.props.map(i=>({name:i.attr??i.name,description:ie(i),values:vt(i),references:n})),references:n}}),globalAttributes:[],valueSets:[]}),wt=e=>({version:1.1,properties:e.components.flatMap(t=>t.styles.map(r=>({name:r.name,description:r.docs})))}),St=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Et=e=>{const t={value:"2023",pattern:"yyyy"},r={value:"12",pattern:"mm"},s={value:"24",pattern:"dd"};return Se([t.value,r.value,s.value].join("-"),e,{timeZone:"UTC"}).replace(t.value,t.pattern).replace(r.value,r.pattern).replace(s.value,s.pattern)},Ot=(e,t,r)=>{const s=e.closest("[lang]"),n=Intl.NumberFormat.supportedLocalesOf(s==null?void 0:s.lang),i=n.length>0&&typeof n[0]=="string"?n[0]:navigator.language||r,a=i.split("-").shift();return Object.keys(t).length===0?{locale:i,messages:{lang:r}}:{locale:i,messages:t[a]||t[r]||{lang:r}}},At=(e,t,r)=>new Intl.NumberFormat(t,{style:"currency",currency:r}).format(e),kt=(e,t,r=0)=>new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(Number(e)),xt=(e,t,r=0)=>new Intl.NumberFormat(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}).format(e),jt=(e,t,r,s="short",n=0)=>new Intl.NumberFormat(t,{style:"unit",unit:r,unitDisplay:s,minimumFractionDigits:n,maximumFractionDigits:n}).format(e),Se=(e,t,r)=>typeof e!="string"||e===""||!St.test(e)?"":new Intl.DateTimeFormat(t,r).format(new Date(e)),Tt=(e,t)=>r=>Ot(r,e,t);var G={updatable:!0,slotRelocation:!0,experimentalSlotFixes:!1},Rt=Object.defineProperty,Nt=(e,t)=>{for(var r in t)Rt(e,r,{get:t[r],enumerable:!0})},It="http://www.w3.org/2000/svg",zt="http://www.w3.org/1999/xhtml",Ee=(e,t)=>t in e,Oe="http://www.w3.org/1999/xlink",T=typeof window<"u"?window:{},I={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,s)=>e.addEventListener(t,r,s),rel:(e,t,r,s)=>e.removeEventListener(t,r,s),ce:(e,t)=>new CustomEvent(e,t)},Mt=e=>e!=null&&e!==void 0,Ae=e=>(e=typeof e,e==="object"||e==="function"),Lt={};Nt(Lt,{err:()=>ke,map:()=>Ct,ok:()=>ae,unwrap:()=>Ft,unwrapErr:()=>Pt});var ae=e=>({isOk:!0,isErr:!1,value:e}),ke=e=>({isOk:!1,isErr:!0,value:e});function Ct(e,t){if(e.isOk){const r=t(e.value);return r instanceof Promise?r.then(s=>ae(s)):ae(r)}if(e.isErr){const r=e.value;return ke(r)}throw"should never get here"}var Ft=e=>{if(e.isOk)return e.value;throw e.value},Pt=e=>{if(e.isErr)return e.value;throw e.value},xe=e=>{const t=Re(e,"childNodes");e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&je(t,e.tagName).forEach(s=>{s.nodeType===1&&s.tagName==="SLOT-FB"&&(Ut(s,oe(s),!1).length?s.hidden=!0:s.hidden=!1)});let r=0;for(r=0;r<t.length;r++){const s=t[r];s.nodeType===1&&Re(s,"childNodes").length&&xe(s)}},Wt=e=>{const t=[];for(let r=0;r<e.length;r++){const s=e[r]["s-nr"]||void 0;s&&s.isConnected&&t.push(s)}return t};function je(e,t,r){let s=0,n=[],i;for(;s<e.length;s++)i=e[s],i["s-sr"]&&(!t||i["s-hn"]===t)&&r===void 0&&n.push(i),n=[...n,...je(i.childNodes,t,r)];return n}var Ut=(e,t,r=!0)=>{const s=[];(r&&e["s-sr"]||!e["s-sr"])&&s.push(e);let n=e;for(;n=n.nextSibling;)oe(n)===t&&(r||!n["s-sr"])&&s.push(n);return s},Te=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",oe=e=>typeof e["s-sn"]=="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0;function Dt(e){if(e.assignedElements||e.assignedNodes||!e["s-sr"])return;const t=r=>(function(s){const n=[],i=this["s-sn"];s!=null&&s.flatten&&console.error(`
23
+ Type: \`${e.type}\``,_t=(e,t,r,s)=>({$schema:"https://json.schemastore.org/web-types",name:e,version:t,"description-markup":"markdown",contributions:{html:{elements:r.components.map(n=>{const i=me(s,n.filePath);return{name:n.tag,description:we(n),"doc-url":i,attributes:n.props.filter(a=>a.attr).map(a=>({name:a.attr,description:ie(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),js:{properties:n.props.map(a=>({name:a.name,description:ie(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),events:n.events.map(a=>({name:a.event,description:a.docs}))},css:{properties:n.styles.map(a=>({name:a.name,description:a.docs}))}}})}}}),bt=(e,t,r)=>[{name:"Storybook",url:me(e,r)},{name:"Sources",url:yt(t,r)}],vt=e=>{if(!e.values.some(({value:t})=>t===void 0))return e.values.map(({value:t})=>({name:t}))},mt=(e,t,r)=>({version:1.1,tags:e.components.map(s=>{const n=bt(t,r,s.filePath);return{name:s.tag,description:we(s),attributes:s.props.map(i=>({name:i.attr??i.name,description:ie(i),values:vt(i),references:n})),references:n}}),globalAttributes:[],valueSets:[]}),wt=e=>({version:1.1,properties:e.components.flatMap(t=>t.styles.map(r=>({name:r.name,description:r.docs})))}),St=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Et=e=>{const t={value:"2023",pattern:"yyyy"},r={value:"12",pattern:"mm"},s={value:"24",pattern:"dd"};return Se([t.value,r.value,s.value].join("-"),e,{timeZone:"UTC"}).replace(t.value,t.pattern).replace(r.value,r.pattern).replace(s.value,s.pattern)},Ot=(e,t,r)=>{const s=e.closest("[lang]"),n=Intl.NumberFormat.supportedLocalesOf(s==null?void 0:s.lang),i=n.length>0&&typeof n[0]=="string"?n[0]:navigator.language||r,a=i.split("-").shift();return Object.keys(t).length===0?{locale:i,messages:{lang:r}}:{locale:i,messages:t[a]??t[r]??{lang:r}}},At=(e,t,r)=>new Intl.NumberFormat(t,{style:"currency",currency:r}).format(e),kt=(e,t,r=0)=>new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(Number(e)),xt=(e,t,r=0)=>new Intl.NumberFormat(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}).format(e),jt=(e,t,r,s="short",n=0)=>new Intl.NumberFormat(t,{style:"unit",unit:r,unitDisplay:s,minimumFractionDigits:n,maximumFractionDigits:n}).format(e),Se=(e,t,r)=>typeof e!="string"||e===""||!St.test(e)?"":new Intl.DateTimeFormat(t,r).format(new Date(e)),Tt=(e,t)=>r=>Ot(r,e,t);var G={updatable:!0,slotRelocation:!0,experimentalSlotFixes:!1},Rt=Object.defineProperty,Nt=(e,t)=>{for(var r in t)Rt(e,r,{get:t[r],enumerable:!0})},It="http://www.w3.org/2000/svg",zt="http://www.w3.org/1999/xhtml",Ee=(e,t)=>t in e,Oe="http://www.w3.org/1999/xlink",T=typeof window<"u"?window:{},I={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,s)=>e.addEventListener(t,r,s),rel:(e,t,r,s)=>e.removeEventListener(t,r,s),ce:(e,t)=>new CustomEvent(e,t)},Mt=e=>e!=null&&e!==void 0,Ae=e=>(e=typeof e,e==="object"||e==="function"),Lt={};Nt(Lt,{err:()=>ke,map:()=>Ct,ok:()=>ae,unwrap:()=>Ft,unwrapErr:()=>Pt});var ae=e=>({isOk:!0,isErr:!1,value:e}),ke=e=>({isOk:!1,isErr:!0,value:e});function Ct(e,t){if(e.isOk){const r=t(e.value);return r instanceof Promise?r.then(s=>ae(s)):ae(r)}if(e.isErr){const r=e.value;return ke(r)}throw"should never get here"}var Ft=e=>{if(e.isOk)return e.value;throw e.value},Pt=e=>{if(e.isErr)return e.value;throw e.value},xe=e=>{const t=Re(e,"childNodes");e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&je(t,e.tagName).forEach(s=>{s.nodeType===1&&s.tagName==="SLOT-FB"&&(Ut(s,oe(s),!1).length?s.hidden=!0:s.hidden=!1)});let r=0;for(r=0;r<t.length;r++){const s=t[r];s.nodeType===1&&Re(s,"childNodes").length&&xe(s)}},Wt=e=>{const t=[];for(let r=0;r<e.length;r++){const s=e[r]["s-nr"]||void 0;s&&s.isConnected&&t.push(s)}return t};function je(e,t,r){let s=0,n=[],i;for(;s<e.length;s++)i=e[s],i["s-sr"]&&(!t||i["s-hn"]===t)&&r===void 0&&n.push(i),n=[...n,...je(i.childNodes,t,r)];return n}var Ut=(e,t,r=!0)=>{const s=[];(r&&e["s-sr"]||!e["s-sr"])&&s.push(e);let n=e;for(;n=n.nextSibling;)oe(n)===t&&(r||!n["s-sr"])&&s.push(n);return s},Te=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",oe=e=>typeof e["s-sn"]=="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0;function Dt(e){if(e.assignedElements||e.assignedNodes||!e["s-sr"])return;const t=r=>(function(s){const n=[],i=this["s-sn"];s!=null&&s.flatten&&console.error(`
24
24
  Flattening is not supported for Stencil non-shadow slots.
25
25
  You can use \`.childNodes\` to nested slot fallback content.
26
26
  If you have a particular use case, please open an issue on the Stencil repo.