@bedrock-layout/solid 1.7.0 → 1.7.1
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/lib/index.cjs.js +1 -1
- package/lib/index.m.js +68 -65
- package/lib/index.umd.js +1 -1
- package/package.json +3 -3
package/lib/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("open-props"),l=require("solid-js"),P=require("@bedrock-layout/register-resize-callback"),Z=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],K=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Z]),p=new Set(["innerHTML","textContent","innerText","children"]),ee=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),te=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ne(e,t){const n=te[e];return typeof n=="object"?n[t]?n.$:void 0:n}const ie=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),se=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function re(e,t,n){let i=n.length,s=t.length,o=i,c=0,r=0,a=t[s-1].nextSibling,f=null;for(;c<s||r<o;){if(t[c]===n[r]){c++,r++;continue}for(;t[s-1]===n[o-1];)s--,o--;if(s===c){const d=o<i?r?n[r-1].nextSibling:n[o-r]:a;for(;r<o;)e.insertBefore(n[r++],d)}else if(o===r)for(;c<s;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[o-1]&&n[r]===t[s-1]){const d=t[--s].nextSibling;e.insertBefore(n[r++],t[c++].nextSibling),e.insertBefore(n[--o],d),t[s]=n[o]}else{if(!f){f=new Map;let u=r;for(;u<o;)f.set(n[u],u++)}const d=f.get(t[c]);if(d!=null)if(r<d&&d<o){let u=c,h=1,$;for(;++u<s&&u<o&&!(($=f.get(t[u]))==null||$!==d+h);)h++;if(h>d-r){const I=t[c];for(;r<d;)e.insertBefore(n[r++],I)}else e.replaceChild(n[r++],t[c++])}else c++;else t[c++].remove()}}}const N="_$DX_DELEGATE";function D(e,t,n){let i;const s=()=>{const c=document.createElement("template");return c.innerHTML=e,n?c.content.firstChild.firstChild:c.content.firstChild},o=t?()=>l.untrack(()=>document.importNode(i||(i=s()),!0)):()=>(i||(i=s())).cloneNode(!0);return o.cloneNode=o,o}function ce(e,t=window.document){const n=t[N]||(t[N]=new Set);for(let i=0,s=e.length;i<s;i++){const o=e[i];n.has(o)||(n.add(o),t.addEventListener(o,be))}}function T(e,t,n){l.sharedConfig.context&&e.isConnected||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ae(e,t,n,i){l.sharedConfig.context&&e.isConnected||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function le(e,t){l.sharedConfig.context&&e.isConnected||(t==null?e.removeAttribute("class"):e.className=t)}function fe(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const s=n[0];e.addEventListener(t,n[0]=o=>s.call(e,n[1],o))}else e.addEventListener(t,n)}function de(e,t,n={}){const i=Object.keys(t||{}),s=Object.keys(n);let o,c;for(o=0,c=s.length;o<c;o++){const r=s[o];!r||r==="undefined"||t[r]||(L(e,r,!1),delete n[r])}for(o=0,c=i.length;o<c;o++){const r=i[o],a=!!t[r];!r||r==="undefined"||n[r]===a||!a||(L(e,r,!0),n[r]=a)}return n}function G(e,t,n){if(!t)return n?T(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let s,o;for(o in n)t[o]==null&&i.removeProperty(o),delete n[o];for(o in t)s=t[o],s!==n[o]&&(i.setProperty(o,s),n[o]=s);return n}function ue(e,t={},n,i){const s={};return i||l.createRenderEffect(()=>s.children=x(e,t.children,s.children)),l.createRenderEffect(()=>t.ref&&t.ref(e)),l.createRenderEffect(()=>ye(e,t,n,!0,s,!0)),s}function ge(e,t,n){return l.untrack(()=>e(t,n))}function H(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return x(e,t,i,n);l.createRenderEffect(s=>x(e,t(),s,n),i)}function ye(e,t,n,i,s={},o=!1){t||(t={});for(const c in s)if(!(c in t)){if(c==="children")continue;s[c]=R(e,c,null,s[c],n,o)}for(const c in t){if(c==="children"){i||x(e,t.children);continue}const r=t[c];s[c]=R(e,c,r,s[c],n,o)}}function me(e){let t,n;return!l.sharedConfig.context||!(t=l.sharedConfig.registry.get(n=Ce()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function he(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function L(e,t,n){const i=t.trim().split(/\s+/);for(let s=0,o=i.length;s<o;s++)e.classList.toggle(i[s],n)}function R(e,t,n,i,s,o){let c,r,a,f,d;if(t==="style")return G(e,n,i);if(t==="classList")return de(e,n,i);if(n===i)return i;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const u=t.slice(3);i&&e.removeEventListener(u,i),n&&e.addEventListener(u,n)}else if(t.slice(0,10)==="oncapture:"){const u=t.slice(10);i&&e.removeEventListener(u,i,!0),n&&e.addEventListener(u,n,!0)}else if(t.slice(0,2)==="on"){const u=t.slice(2).toLowerCase(),h=ie.has(u);if(!h&&i){const $=Array.isArray(i)?i[0]:i;e.removeEventListener(u,$)}(h||n)&&(fe(e,u,n,h),h&&ce([u]))}else if(t.slice(0,5)==="attr:")T(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(a=p.has(t))||!s&&((f=ne(t,e.tagName))||(r=K.has(t)))||(c=e.nodeName.includes("-"))){if(d)t=t.slice(5),r=!0;else if(l.sharedConfig.context&&e.isConnected)return n;t==="class"||t==="className"?le(e,n):c&&!r&&!a?e[he(t)]=n:e[f||t]=n}else{const u=s&&t.indexOf(":")>-1&&oe[t.split(":")[0]];u?ae(e,u,t,n):T(e,ee[t]||t,n)}return n}function be(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const s=n[`${t}Data`];if(s!==void 0?i.call(n,s,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function x(e,t,n,i,s){const o=!!l.sharedConfig.context&&e.isConnected;if(o){!n&&(n=[...e.childNodes]);let a=[];for(let f=0;f<n.length;f++){const d=n[f];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():a.push(d)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const c=typeof t,r=i!==void 0;if(e=r&&n[0]&&n[0].parentNode||e,c==="string"||c==="number"){if(o)return n;if(c==="number"&&(t=t.toString()),r){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=S(e,n,i,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||c==="boolean"){if(o)return n;n=S(e,n,i)}else{if(c==="function")return l.createRenderEffect(()=>{let a=t();for(;typeof a=="function";)a=a();n=x(e,a,n,i)}),()=>n;if(Array.isArray(t)){const a=[],f=n&&Array.isArray(n);if(v(a,t,n,s))return l.createRenderEffect(()=>n=x(e,a,n,i,!0)),()=>n;if(o){if(!a.length)return n;if(i===void 0)return[...e.childNodes];let d=a[0],u=[d];for(;(d=d.nextSibling)!==i;)u.push(d);return n=u}if(a.length===0){if(n=S(e,n,i),r)return n}else f?n.length===0?W(e,a,i):re(e,n,a):(n&&S(e),W(e,a));n=a}else if(t.nodeType){if(o&&t.parentNode)return n=r?[t]:t;if(Array.isArray(n)){if(r)return n=S(e,n,i,t);S(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function v(e,t,n,i){let s=!1;for(let o=0,c=t.length;o<c;o++){let r=t[o],a=n&&n[e.length],f;if(!(r==null||r===!0||r===!1))if((f=typeof r)=="object"&&r.nodeType)e.push(r);else if(Array.isArray(r))s=v(e,r,a)||s;else if(f==="function")if(i){for(;typeof r=="function";)r=r();s=v(e,Array.isArray(r)?r:[r],Array.isArray(a)?a:[a])||s}else e.push(r),s=!0;else{const d=String(r);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return s}function W(e,t,n=null){for(let i=0,s=t.length;i<s;i++)e.insertBefore(t[i],n)}function S(e,t,n,i){if(n===void 0)return e.textContent="";const s=i||document.createTextNode("");if(t.length){let o=!1;for(let c=t.length-1;c>=0;c--){const r=t[c];if(s!==r){const a=r.parentNode===e;!o&&!c?a?e.replaceChild(s,r):e.insertBefore(s,n):a&&r.remove()}else o=!0}}else e.insertBefore(s,n);return[s]}function Ce(){const e=l.sharedConfig.context;return`${e.id}${e.count++}`}const $e="http://www.w3.org/2000/svg";function Se(e,t=!1){return t?document.createElementNS($e,e):document.createElement(e)}function xe(e){const[t,n]=l.splitProps(e,["component"]),i=l.createMemo(()=>t.component);return l.createMemo(()=>{const s=i();switch(typeof s){case"function":return l.untrack(()=>s(n));case"string":const o=se.has(s),c=l.sharedConfig.context?me():Se(s,o);return ue(c,n,o),c}})}function w(e){return e??void 0}function g(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function y(e,t){return l.createComponent(xe,l.mergeProps({get component(){return e()}},t))}function m(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const _=/^--\D{1}.{0,100}$/;function F(e){return _.test(e)}function E(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,_].some(t=>t.test(e))}const{sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Me,sizeContent1:Te,sizeContent2:ve,sizeContent3:Oe,sizeHeader1:ze,sizeHeader2:ke,sizeHeader3:Ne,size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze}=Y,Ke={size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze},pe={sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Me,sizeContent1:Te,sizeContent2:ve,sizeContent3:Oe,sizeHeader1:ze,sizeHeader2:ke,sizeHeader3:Ne},V=Ke,X=pe;function q(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function O(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&E(t)?F(t)?`var(${t})`:t:w(b(e,t))}function b(e,t){const n=e.space??V,i=q(Object.entries(n).map(([s,o])=>[s,typeof o=="number"?`${o}px`:o]));return w(i[t])}function A(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&E(t))return F(t)?`var(${t})`:t;const n=e.sizes??X,i=q(Object.entries(n).map(([s,o])=>[s,typeof o=="number"?`${o}px`:o]));return w(i[t])}function et(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function tt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),n=()=>`--maxWidth: ${et(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",s=()=>e.centerChildren?"center-children":"",o=()=>[i(),s()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","maxWidth","centerText","centerChildren"]),m({style:c,"data-bedrock-center":o})))}const U=l.createContext({});function nt(e){return l.createComponent(U.Provider,{get value(){return e.theme},get children(){return e.children}})}function C(){try{return l.useContext(U)}catch{return{}}}function it(e,t){return A(e,t)}function st(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${it(t,e.minItemWidth)}`,o=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","minItemWidth","noStretchedColumns"]),m({style:c,"data-bedrock-column-drop":o})))}function ot(e,t){const[n,i]=l.createSignal(!1),[s,o]=l.createSignal();return l.onMount(()=>{P.init()}),l.createEffect(()=>{if(w(s())===void 0)return;t&&t(s());const c=P.registerCallback(s(),r=>{var f;const a=((f=r.borderBoxSize)==null?void 0:f.inlineSize)??r.contentRect.width;if(a>0){const d=a<=e;i(d)}});l.onCleanup(c)}),[n,o]}function rt(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function ct(e){return Array.isArray(e)?e.join("/"):e}function at(e){return rt(e)?ct(e):void 0}function lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),n=()=>at(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",s=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",o=()=>[t(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","ratio","position"]),m({style:o,"data-bedrock-frame":()=>""})))}function Q(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,o=()=>[n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","minItemWidth"]),m({style:o,"data-bedrock-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const j=96;function J(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function k(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return ft(i,n);case"em":return z(n,"font-size");case"rem":return z(document.body,"font-size");case"in":return j;case"cm":return j/2.54;case"mm":return j/25.4;case"pt":return j/72;case"pc":return j/6;case"px":return 1;default:{const[s,o]=J(i);if(isNaN(s))return;if(!o)return s;const c=k(o,t);return typeof c=="number"?s*c:void 0}}}function z(e,t){const[n,i]=J(getComputedStyle(e).getPropertyValue(t));return n*(k(i,e)??1)}function ft(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=z(n,"height")/128;return t.removeChild(n),i}var dt=D("<div>");const M=1,ut=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,gt=e=>{const[t,n]=l.createSignal(1),[i,s]=l.createSignal(),o=C();return l.onMount(()=>(P.init(),0)),l.createEffect(()=>{const c=w(i());if(c===void 0)return;const r=P.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?b(o,e.gutter)??"1px":"1px",d=ut?k(f,a):void 0,u=Math.max(d??M,M),[h]=Array.from(a.children),$=1+Math.min(a.scrollHeight,h.scrollHeight),I=Math.max(Math.ceil($/u),M);return n(I),0});return l.onCleanup(r),0}),(()=>{var c=dt();return ge(s,c),H(c,()=>e.children),l.createRenderEffect(r=>G(c,`grid-row: span ${t()};`,r)),c})()},yt=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(s=>l.createComponent(gt,{get gutter(){return e.gutter},children:s}));return l.createComponent(Q,l.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},mt={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},ht={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function bt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.justify!==void 0?mt[e.justify]:void 0,o=()=>e.align!==void 0?ht[e.align]:void 0,c=()=>[n(),i()].join("; "),r=()=>[s(),o()].filter(Boolean).join(" ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","justify","align"]),m({style:c,"data-bedrock-inline-cluster":r})))}const Ct={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},$t={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function St(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((u,[h,$])=>u+`${h}:${$};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?Ct[e.justify]:void 0,r=()=>e.align!==void 0?$t[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),o(),s()].join("; "),d=()=>[c(),r(),a()].filter(Boolean).join(" ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","justify","align","stretch","switchAt"]),m({style:f,"data-bedrock-inline":d})))}const xt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],wt=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[s,o])=>({...i,[xt(s)]:O(e,o)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>O(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[s,o])=>i+`${s}:${o};`,"")};function jt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[c,r])=>o+`${c}:${r};`,""),i=()=>wt(t,e.padding),s=()=>[n(),i()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","padding"]),m({style:s,"data-bedrock-padbox":()=>""})))}function At(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},o=()=>[n(),i()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter"]),m({style:o,"data-bedrock-reel":s})))}const B={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Pt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",s=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,o=()=>B[e.fraction??"1/2"]??B["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,r=()=>[n(),s(),i(),c()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","fraction"]),m({style:r,"data-bedrock-split":o})))}const Et={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function It(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>[n(),i()].join("; "),o=()=>e.align!==void 0?Et[e.align]:void 0,c=()=>[o()].filter(Boolean).join(" ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter"]),m({style:s,"data-bedrock-stack":c})))}var Mt=D("<div data-bedrock-cover-centered>");function Tt(e){return typeof e=="number"?`${e}px`:e&&E(e)?e:"100vh"}function vt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minHeight: ${Tt(e.minHeight)};`,o=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","minHeight","stretchContent"]),m({style:c,"data-bedrock-cover":o})))}function Ot(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(vt,l.mergeProps(n,{get children(){return[l.createMemo(()=>t.top),(()=>{var i=Mt();return H(i,()=>t.children),i})(),l.createMemo(()=>t.bottom)]}}))}function zt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--columns: ${w(Math.max(e.colCount??e.columns??1,1))??1};`,o=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),s(),o()].filter(Boolean).join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","columns","colCount","switchAt"]),m({style:c,"data-bedrock-columns":()=>""})))}const kt=e=>typeof e=="number"?e:1;function Nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),n=()=>`--span: ${kt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",s=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",o=()=>[t(),n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","span","offsetStart","offsetEnd"]),m({style:o,"data-bedrock-column":()=>""})))}exports.Center=tt;exports.Column=Nt;exports.ColumnDrop=st;exports.Columns=zt;exports.Cover=Ot;exports.Frame=lt;exports.Grid=Q;exports.Inline=St;exports.InlineCluster=bt;exports.MasonryGrid=yt;exports.PadBox=jt;exports.Reel=At;exports.Split=Pt;exports.Stack=It;exports.ThemeProvider=nt;exports.checkIsCSSLength=E;exports.createContainerQuery=ot;exports.getSafeGutter=O;exports.getSizeValue=A;exports.getSpacingValue=b;exports.sizes=X;exports.spacing=V;exports.useTheme=C;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("open-props"),l=require("solid-js"),P=require("@bedrock-layout/register-resize-callback"),K=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],p=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...K]),ee=new Set(["innerHTML","textContent","innerText","children"]),te=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ne=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ie(e,t){const n=ne[e];return typeof n=="object"?n[t]?n.$:void 0:n}const se=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),oe=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),re={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ce(e,t,n){let i=n.length,s=t.length,o=i,c=0,r=0,a=t[s-1].nextSibling,f=null;for(;c<s||r<o;){if(t[c]===n[r]){c++,r++;continue}for(;t[s-1]===n[o-1];)s--,o--;if(s===c){const d=o<i?r?n[r-1].nextSibling:n[o-r]:a;for(;r<o;)e.insertBefore(n[r++],d)}else if(o===r)for(;c<s;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[o-1]&&n[r]===t[s-1]){const d=t[--s].nextSibling;e.insertBefore(n[r++],t[c++].nextSibling),e.insertBefore(n[--o],d),t[s]=n[o]}else{if(!f){f=new Map;let u=r;for(;u<o;)f.set(n[u],u++)}const d=f.get(t[c]);if(d!=null)if(r<d&&d<o){let u=c,h=1,$;for(;++u<s&&u<o&&!(($=f.get(t[u]))==null||$!==d+h);)h++;if(h>d-r){const I=t[c];for(;r<d;)e.insertBefore(n[r++],I)}else e.replaceChild(n[r++],t[c++])}else c++;else t[c++].remove()}}}const N="_$DX_DELEGATE";function D(e,t,n){let i;const s=()=>{const c=document.createElement("template");return c.innerHTML=e,n?c.content.firstChild.firstChild:c.content.firstChild},o=t?()=>l.untrack(()=>document.importNode(i||(i=s()),!0)):()=>(i||(i=s())).cloneNode(!0);return o.cloneNode=o,o}function ae(e,t=window.document){const n=t[N]||(t[N]=new Set);for(let i=0,s=e.length;i<s;i++){const o=e[i];n.has(o)||(n.add(o),t.addEventListener(o,be))}}function T(e,t,n){l.sharedConfig.context&&e.isConnected||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function le(e,t,n,i){l.sharedConfig.context&&e.isConnected||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function fe(e,t){l.sharedConfig.context&&e.isConnected||(t==null?e.removeAttribute("class"):e.className=t)}function de(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const s=n[0];e.addEventListener(t,n[0]=o=>s.call(e,n[1],o))}else e.addEventListener(t,n)}function ue(e,t,n={}){const i=Object.keys(t||{}),s=Object.keys(n);let o,c;for(o=0,c=s.length;o<c;o++){const r=s[o];!r||r==="undefined"||t[r]||(L(e,r,!1),delete n[r])}for(o=0,c=i.length;o<c;o++){const r=i[o],a=!!t[r];!r||r==="undefined"||n[r]===a||!a||(L(e,r,!0),n[r]=a)}return n}function G(e,t,n){if(!t)return n?T(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let s,o;for(o in n)t[o]==null&&i.removeProperty(o),delete n[o];for(o in t)s=t[o],s!==n[o]&&(i.setProperty(o,s),n[o]=s);return n}function ge(e,t={},n,i){const s={};return i||l.createRenderEffect(()=>s.children=x(e,t.children,s.children)),l.createRenderEffect(()=>typeof t.ref=="function"?H(t.ref,e):t.ref=e),l.createRenderEffect(()=>ye(e,t,n,!0,s,!0)),s}function H(e,t,n){return l.untrack(()=>e(t,n))}function _(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return x(e,t,i,n);l.createRenderEffect(s=>x(e,t(),s,n),i)}function ye(e,t,n,i,s={},o=!1){t||(t={});for(const c in s)if(!(c in t)){if(c==="children")continue;s[c]=R(e,c,null,s[c],n,o)}for(const c in t){if(c==="children"){i||x(e,t.children);continue}const r=t[c];s[c]=R(e,c,r,s[c],n,o)}}function me(e){let t,n;return!l.sharedConfig.context||!(t=l.sharedConfig.registry.get(n=Ce()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function he(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function L(e,t,n){const i=t.trim().split(/\s+/);for(let s=0,o=i.length;s<o;s++)e.classList.toggle(i[s],n)}function R(e,t,n,i,s,o){let c,r,a,f,d;if(t==="style")return G(e,n,i);if(t==="classList")return ue(e,n,i);if(n===i)return i;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const u=t.slice(3);i&&e.removeEventListener(u,i),n&&e.addEventListener(u,n)}else if(t.slice(0,10)==="oncapture:"){const u=t.slice(10);i&&e.removeEventListener(u,i,!0),n&&e.addEventListener(u,n,!0)}else if(t.slice(0,2)==="on"){const u=t.slice(2).toLowerCase(),h=se.has(u);if(!h&&i){const $=Array.isArray(i)?i[0]:i;e.removeEventListener(u,$)}(h||n)&&(de(e,u,n,h),h&&ae([u]))}else if(t.slice(0,5)==="attr:")T(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(a=ee.has(t))||!s&&((f=ie(t,e.tagName))||(r=p.has(t)))||(c=e.nodeName.includes("-"))){if(d)t=t.slice(5),r=!0;else if(l.sharedConfig.context&&e.isConnected)return n;t==="class"||t==="className"?fe(e,n):c&&!r&&!a?e[he(t)]=n:e[f||t]=n}else{const u=s&&t.indexOf(":")>-1&&re[t.split(":")[0]];u?le(e,u,t,n):T(e,te[t]||t,n)}return n}function be(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const s=n[`${t}Data`];if(s!==void 0?i.call(n,s,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function x(e,t,n,i,s){const o=!!l.sharedConfig.context&&e.isConnected;if(o){!n&&(n=[...e.childNodes]);let a=[];for(let f=0;f<n.length;f++){const d=n[f];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():a.push(d)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const c=typeof t,r=i!==void 0;if(e=r&&n[0]&&n[0].parentNode||e,c==="string"||c==="number"){if(o)return n;if(c==="number"&&(t=t.toString()),r){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=S(e,n,i,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||c==="boolean"){if(o)return n;n=S(e,n,i)}else{if(c==="function")return l.createRenderEffect(()=>{let a=t();for(;typeof a=="function";)a=a();n=x(e,a,n,i)}),()=>n;if(Array.isArray(t)){const a=[],f=n&&Array.isArray(n);if(v(a,t,n,s))return l.createRenderEffect(()=>n=x(e,a,n,i,!0)),()=>n;if(o){if(!a.length)return n;if(i===void 0)return[...e.childNodes];let d=a[0],u=[d];for(;(d=d.nextSibling)!==i;)u.push(d);return n=u}if(a.length===0){if(n=S(e,n,i),r)return n}else f?n.length===0?W(e,a,i):ce(e,n,a):(n&&S(e),W(e,a));n=a}else if(t.nodeType){if(o&&t.parentNode)return n=r?[t]:t;if(Array.isArray(n)){if(r)return n=S(e,n,i,t);S(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function v(e,t,n,i){let s=!1;for(let o=0,c=t.length;o<c;o++){let r=t[o],a=n&&n[e.length],f;if(!(r==null||r===!0||r===!1))if((f=typeof r)=="object"&&r.nodeType)e.push(r);else if(Array.isArray(r))s=v(e,r,a)||s;else if(f==="function")if(i){for(;typeof r=="function";)r=r();s=v(e,Array.isArray(r)?r:[r],Array.isArray(a)?a:[a])||s}else e.push(r),s=!0;else{const d=String(r);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return s}function W(e,t,n=null){for(let i=0,s=t.length;i<s;i++)e.insertBefore(t[i],n)}function S(e,t,n,i){if(n===void 0)return e.textContent="";const s=i||document.createTextNode("");if(t.length){let o=!1;for(let c=t.length-1;c>=0;c--){const r=t[c];if(s!==r){const a=r.parentNode===e;!o&&!c?a?e.replaceChild(s,r):e.insertBefore(s,n):a&&r.remove()}else o=!0}}else e.insertBefore(s,n);return[s]}function Ce(){const e=l.sharedConfig.context;return`${e.id}${e.count++}`}const $e="http://www.w3.org/2000/svg";function Se(e,t=!1){return t?document.createElementNS($e,e):document.createElement(e)}function xe(e){const[t,n]=l.splitProps(e,["component"]),i=l.createMemo(()=>t.component);return l.createMemo(()=>{const s=i();switch(typeof s){case"function":return l.untrack(()=>s(n));case"string":const o=oe.has(s),c=l.sharedConfig.context?me():Se(s,o);return ge(c,n,o),c}})}function w(e){return e??void 0}function g(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function y(e,t){return l.createComponent(xe,l.mergeProps({get component(){return e()}},t))}function m(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const F=/^--\D{1}.{0,100}$/;function V(e){return F.test(e)}function E(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,F].some(t=>t.test(e))}const{sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Me,sizeContent1:Te,sizeContent2:ve,sizeContent3:Oe,sizeHeader1:ze,sizeHeader2:ke,sizeHeader3:Ne,size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze}=Z,Ke={size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze},pe={sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Me,sizeContent1:Te,sizeContent2:ve,sizeContent3:Oe,sizeHeader1:ze,sizeHeader2:ke,sizeHeader3:Ne},X=Ke,q=pe;function U(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function O(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&E(t)?V(t)?`var(${t})`:t:w(b(e,t))}function b(e,t){const n=e.space??X,i=U(Object.entries(n).map(([s,o])=>[s,typeof o=="number"?`${o}px`:o]));return w(i[t])}function A(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&E(t))return V(t)?`var(${t})`:t;const n=e.sizes??q,i=U(Object.entries(n).map(([s,o])=>[s,typeof o=="number"?`${o}px`:o]));return w(i[t])}function et(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function tt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),n=()=>`--maxWidth: ${et(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",s=()=>e.centerChildren?"center-children":"",o=()=>[i(),s()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","maxWidth","centerText","centerChildren"]),m({style:c,"data-bedrock-center":o})))}const Q=l.createContext({});function nt(e){return l.createComponent(Q.Provider,{get value(){return e.theme},get children(){return e.children}})}function C(){try{return l.useContext(Q)}catch{return{}}}function it(e,t){return A(e,t)}function st(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${it(t,e.minItemWidth)}`,o=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","minItemWidth","noStretchedColumns"]),m({style:c,"data-bedrock-column-drop":o})))}function ot(e,t){const[n,i]=l.createSignal(!1),[s,o]=l.createSignal();return l.onMount(()=>{P.init()}),l.createEffect(()=>{if(w(s())===void 0)return;t&&t(s());const c=P.registerCallback(s(),r=>{var f;const a=((f=r.borderBoxSize)==null?void 0:f.inlineSize)??r.contentRect.width;if(a>0){const d=a<=e;i(d)}});l.onCleanup(c)}),[n,o]}function rt(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function ct(e){return Array.isArray(e)?e.join("/"):e}function at(e){return rt(e)?ct(e):void 0}function lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),n=()=>at(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",s=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",o=()=>[t(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","ratio","position"]),m({style:o,"data-bedrock-frame":()=>""})))}function J(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,o=()=>[n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","minItemWidth"]),m({style:o,"data-bedrock-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const j=96;function Y(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function k(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return ft(i,n);case"em":return z(n,"font-size");case"rem":return z(document.body,"font-size");case"in":return j;case"cm":return j/2.54;case"mm":return j/25.4;case"pt":return j/72;case"pc":return j/6;case"px":return 1;default:{const[s,o]=Y(i);if(isNaN(s))return;if(!o)return s;const c=k(o,t);return typeof c=="number"?s*c:void 0}}}function z(e,t){const[n,i]=Y(getComputedStyle(e).getPropertyValue(t));return n*(k(i,e)??1)}function ft(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=z(n,"height")/128;return t.removeChild(n),i}var dt=D("<div>");const M=1,ut=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,gt=e=>{const[t,n]=l.createSignal(1),[i,s]=l.createSignal(),o=C();return l.onMount(()=>(P.init(),0)),l.createEffect(()=>{const c=w(i());if(c===void 0)return;const r=P.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?b(o,e.gutter)??"1px":"1px",d=ut?k(f,a):void 0,u=Math.max(d??M,M),[h]=Array.from(a.children),$=1+Math.min(a.scrollHeight,h.scrollHeight),I=Math.max(Math.ceil($/u),M);return n(I),0});return l.onCleanup(r),0}),(()=>{var c=dt();return H(s,c),_(c,()=>e.children),l.createRenderEffect(r=>G(c,`grid-row: span ${t()};`,r)),c})()},yt=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(s=>l.createComponent(gt,{get gutter(){return e.gutter},children:s}));return l.createComponent(J,l.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},mt={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},ht={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function bt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.justify!==void 0?mt[e.justify]:void 0,o=()=>e.align!==void 0?ht[e.align]:void 0,c=()=>[n(),i()].join("; "),r=()=>[s(),o()].filter(Boolean).join(" ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","justify","align"]),m({style:c,"data-bedrock-inline-cluster":r})))}const Ct={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},$t={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function St(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((u,[h,$])=>u+`${h}:${$};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?Ct[e.justify]:void 0,r=()=>e.align!==void 0?$t[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),o(),s()].join("; "),d=()=>[c(),r(),a()].filter(Boolean).join(" ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","justify","align","stretch","switchAt"]),m({style:f,"data-bedrock-inline":d})))}const xt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],wt=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[s,o])=>({...i,[xt(s)]:O(e,o)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>O(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[s,o])=>i+`${s}:${o};`,"")};function jt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[c,r])=>o+`${c}:${r};`,""),i=()=>wt(t,e.padding),s=()=>[n(),i()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","padding"]),m({style:s,"data-bedrock-padbox":()=>""})))}function At(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},o=()=>[n(),i()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter"]),m({style:o,"data-bedrock-reel":s})))}const B={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Pt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",s=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,o=()=>B[e.fraction??"1/2"]??B["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,r=()=>[n(),s(),i(),c()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","fraction"]),m({style:r,"data-bedrock-split":o})))}const Et={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function It(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>[n(),i()].join("; "),o=()=>e.align!==void 0?Et[e.align]:void 0,c=()=>[o()].filter(Boolean).join(" ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter"]),m({style:s,"data-bedrock-stack":c})))}var Mt=D("<div data-bedrock-cover-centered>");function Tt(e){return typeof e=="number"?`${e}px`:e&&E(e)?e:"100vh"}function vt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minHeight: ${Tt(e.minHeight)};`,o=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","minHeight","stretchContent"]),m({style:c,"data-bedrock-cover":o})))}function Ot(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(vt,l.mergeProps(n,{get children(){return[l.createMemo(()=>t.top),(()=>{var i=Mt();return _(i,()=>t.children),i})(),l.createMemo(()=>t.bottom)]}}))}function zt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[a,f])=>r+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>`--columns: ${w(Math.max(e.colCount??e.columns??1,1))??1};`,o=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),s(),o()].filter(Boolean).join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","gutter","columns","colCount","switchAt"]),m({style:c,"data-bedrock-columns":()=>""})))}const kt=e=>typeof e=="number"?e:1;function Nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[r,a])=>c+`${r}:${a};`,""),n=()=>`--span: ${kt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",s=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",o=()=>[t(),n(),i(),s()].join("; ");return y(()=>e.as??"div",l.mergeProps(g(e,["as","span","offsetStart","offsetEnd"]),m({style:o,"data-bedrock-column":()=>""})))}exports.Center=tt;exports.Column=Nt;exports.ColumnDrop=st;exports.Columns=zt;exports.Cover=Ot;exports.Frame=lt;exports.Grid=J;exports.Inline=St;exports.InlineCluster=bt;exports.MasonryGrid=yt;exports.PadBox=jt;exports.Reel=At;exports.Split=Pt;exports.Stack=It;exports.ThemeProvider=nt;exports.checkIsCSSLength=E;exports.createContainerQuery=ot;exports.getSafeGutter=O;exports.getSizeValue=A;exports.getSpacingValue=b;exports.sizes=q;exports.spacing=X;exports.useTheme=C;
|
package/lib/index.m.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createRenderEffect as w, sharedConfig as y, splitProps as V, createMemo as T, untrack as L, createComponent as I, mergeProps as d, createContext as
|
|
1
|
+
import ot from "open-props";
|
|
2
|
+
import { createRenderEffect as w, sharedConfig as y, splitProps as V, createMemo as T, untrack as L, createComponent as I, mergeProps as d, createContext as ct, useContext as rt, createSignal as v, onMount as X, createEffect as U, onCleanup as q, children as lt } from "solid-js";
|
|
3
3
|
import { init as Q, registerCallback as Y } from "@bedrock-layout/register-resize-callback";
|
|
4
|
-
const
|
|
4
|
+
const at = [
|
|
5
5
|
"allowfullscreen",
|
|
6
6
|
"async",
|
|
7
7
|
"autofocus",
|
|
@@ -27,7 +27,7 @@ const lt = [
|
|
|
27
27
|
"reversed",
|
|
28
28
|
"seamless",
|
|
29
29
|
"selected"
|
|
30
|
-
],
|
|
30
|
+
], ft = /* @__PURE__ */ new Set([
|
|
31
31
|
"className",
|
|
32
32
|
"value",
|
|
33
33
|
"readOnly",
|
|
@@ -35,16 +35,16 @@ const lt = [
|
|
|
35
35
|
"isMap",
|
|
36
36
|
"noModule",
|
|
37
37
|
"playsInline",
|
|
38
|
-
...
|
|
39
|
-
]),
|
|
38
|
+
...at
|
|
39
|
+
]), ut = /* @__PURE__ */ new Set([
|
|
40
40
|
"innerHTML",
|
|
41
41
|
"textContent",
|
|
42
42
|
"innerText",
|
|
43
43
|
"children"
|
|
44
|
-
]),
|
|
44
|
+
]), dt = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
45
45
|
className: "class",
|
|
46
46
|
htmlFor: "for"
|
|
47
|
-
}),
|
|
47
|
+
}), yt = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
48
48
|
class: "className",
|
|
49
49
|
formnovalidate: {
|
|
50
50
|
$: "formNoValidate",
|
|
@@ -69,11 +69,11 @@ const lt = [
|
|
|
69
69
|
TEXTAREA: 1
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
function
|
|
73
|
-
const n =
|
|
72
|
+
function mt(t, e) {
|
|
73
|
+
const n = yt[t];
|
|
74
74
|
return typeof n == "object" ? n[e] ? n.$ : void 0 : n;
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const ht = /* @__PURE__ */ new Set([
|
|
77
77
|
"beforeinput",
|
|
78
78
|
"click",
|
|
79
79
|
"dblclick",
|
|
@@ -96,7 +96,7 @@ const mt = /* @__PURE__ */ new Set([
|
|
|
96
96
|
"touchend",
|
|
97
97
|
"touchmove",
|
|
98
98
|
"touchstart"
|
|
99
|
-
]),
|
|
99
|
+
]), gt = /* @__PURE__ */ new Set([
|
|
100
100
|
"altGlyph",
|
|
101
101
|
"altGlyphDef",
|
|
102
102
|
"altGlyphItem",
|
|
@@ -119,6 +119,7 @@ const mt = /* @__PURE__ */ new Set([
|
|
|
119
119
|
"feDiffuseLighting",
|
|
120
120
|
"feDisplacementMap",
|
|
121
121
|
"feDistantLight",
|
|
122
|
+
"feDropShadow",
|
|
122
123
|
"feFlood",
|
|
123
124
|
"feFuncA",
|
|
124
125
|
"feFuncB",
|
|
@@ -173,11 +174,11 @@ const mt = /* @__PURE__ */ new Set([
|
|
|
173
174
|
"use",
|
|
174
175
|
"view",
|
|
175
176
|
"vkern"
|
|
176
|
-
]),
|
|
177
|
+
]), bt = {
|
|
177
178
|
xlink: "http://www.w3.org/1999/xlink",
|
|
178
179
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
179
180
|
};
|
|
180
|
-
function
|
|
181
|
+
function $t(t, e, n) {
|
|
181
182
|
let i = n.length, s = e.length, o = i, r = 0, c = 0, l = e[s - 1].nextSibling, a = null;
|
|
182
183
|
for (; r < s || c < o; ) {
|
|
183
184
|
if (e[r] === n[c]) {
|
|
@@ -222,7 +223,7 @@ function bt(t, e, n) {
|
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
|
-
const
|
|
226
|
+
const D = "_$DX_DELEGATE";
|
|
226
227
|
function J(t, e, n) {
|
|
227
228
|
let i;
|
|
228
229
|
const s = () => {
|
|
@@ -231,8 +232,8 @@ function J(t, e, n) {
|
|
|
231
232
|
}, o = e ? () => L(() => document.importNode(i || (i = s()), !0)) : () => (i || (i = s())).cloneNode(!0);
|
|
232
233
|
return o.cloneNode = o, o;
|
|
233
234
|
}
|
|
234
|
-
function
|
|
235
|
-
const n = e[
|
|
235
|
+
function xt(t, e = window.document) {
|
|
236
|
+
const n = e[D] || (e[D] = /* @__PURE__ */ new Set());
|
|
236
237
|
for (let i = 0, s = t.length; i < s; i++) {
|
|
237
238
|
const o = t[i];
|
|
238
239
|
n.has(o) || (n.add(o), e.addEventListener(o, vt));
|
|
@@ -241,13 +242,13 @@ function $t(t, e = window.document) {
|
|
|
241
242
|
function z(t, e, n) {
|
|
242
243
|
y.context && t.isConnected || (n == null ? t.removeAttribute(e) : t.setAttribute(e, n));
|
|
243
244
|
}
|
|
244
|
-
function
|
|
245
|
+
function St(t, e, n, i) {
|
|
245
246
|
y.context && t.isConnected || (i == null ? t.removeAttributeNS(e, n) : t.setAttributeNS(e, n, i));
|
|
246
247
|
}
|
|
247
|
-
function
|
|
248
|
+
function wt(t, e) {
|
|
248
249
|
y.context && t.isConnected || (e == null ? t.removeAttribute("class") : t.className = e);
|
|
249
250
|
}
|
|
250
|
-
function
|
|
251
|
+
function jt(t, e, n, i) {
|
|
251
252
|
if (i)
|
|
252
253
|
Array.isArray(n) ? (t[`$$${e}`] = n[0], t[`$$${e}Data`] = n[1]) : t[`$$${e}`] = n;
|
|
253
254
|
else if (Array.isArray(n)) {
|
|
@@ -256,16 +257,16 @@ function wt(t, e, n, i) {
|
|
|
256
257
|
} else
|
|
257
258
|
t.addEventListener(e, n);
|
|
258
259
|
}
|
|
259
|
-
function
|
|
260
|
+
function Ct(t, e, n = {}) {
|
|
260
261
|
const i = Object.keys(e || {}), s = Object.keys(n);
|
|
261
262
|
let o, r;
|
|
262
263
|
for (o = 0, r = s.length; o < r; o++) {
|
|
263
264
|
const c = s[o];
|
|
264
|
-
!c || c === "undefined" || e[c] || (
|
|
265
|
+
!c || c === "undefined" || e[c] || (R(t, c, !1), delete n[c]);
|
|
265
266
|
}
|
|
266
267
|
for (o = 0, r = i.length; o < r; o++) {
|
|
267
268
|
const c = i[o], l = !!e[c];
|
|
268
|
-
!c || c === "undefined" || n[c] === l || !l || (
|
|
269
|
+
!c || c === "undefined" || n[c] === l || !l || (R(t, c, !0), n[c] = l);
|
|
269
270
|
}
|
|
270
271
|
return n;
|
|
271
272
|
}
|
|
@@ -283,16 +284,18 @@ function Z(t, e, n) {
|
|
|
283
284
|
s = e[o], s !== n[o] && (i.setProperty(o, s), n[o] = s);
|
|
284
285
|
return n;
|
|
285
286
|
}
|
|
286
|
-
function
|
|
287
|
+
function At(t, e = {}, n, i) {
|
|
287
288
|
const s = {};
|
|
288
289
|
return i || w(
|
|
289
290
|
() => s.children = C(t, e.children, s.children)
|
|
290
|
-
), w(
|
|
291
|
+
), w(
|
|
292
|
+
() => typeof e.ref == "function" ? K(e.ref, t) : e.ref = t
|
|
293
|
+
), w(() => Et(t, e, n, !0, s, !0)), s;
|
|
291
294
|
}
|
|
292
|
-
function
|
|
295
|
+
function K(t, e, n) {
|
|
293
296
|
return L(() => t(e, n));
|
|
294
297
|
}
|
|
295
|
-
function
|
|
298
|
+
function p(t, e, n, i) {
|
|
296
299
|
if (n !== void 0 && !i && (i = []), typeof e != "function")
|
|
297
300
|
return C(t, e, i, n);
|
|
298
301
|
w((s) => C(t, e(), s, n), i);
|
|
@@ -321,7 +324,7 @@ function It(t) {
|
|
|
321
324
|
function Tt(t) {
|
|
322
325
|
return t.toLowerCase().replace(/-([a-z])/g, (e, n) => n.toUpperCase());
|
|
323
326
|
}
|
|
324
|
-
function
|
|
327
|
+
function R(t, e, n) {
|
|
325
328
|
const i = e.trim().split(/\s+/);
|
|
326
329
|
for (let s = 0, o = i.length; s < o; s++)
|
|
327
330
|
t.classList.toggle(i[s], n);
|
|
@@ -331,7 +334,7 @@ function G(t, e, n, i, s, o) {
|
|
|
331
334
|
if (e === "style")
|
|
332
335
|
return Z(t, n, i);
|
|
333
336
|
if (e === "classList")
|
|
334
|
-
return
|
|
337
|
+
return Ct(t, n, i);
|
|
335
338
|
if (n === i)
|
|
336
339
|
return i;
|
|
337
340
|
if (e === "ref")
|
|
@@ -343,23 +346,23 @@ function G(t, e, n, i, s, o) {
|
|
|
343
346
|
const u = e.slice(10);
|
|
344
347
|
i && t.removeEventListener(u, i, !0), n && t.addEventListener(u, n, !0);
|
|
345
348
|
} else if (e.slice(0, 2) === "on") {
|
|
346
|
-
const u = e.slice(2).toLowerCase(), b =
|
|
349
|
+
const u = e.slice(2).toLowerCase(), b = ht.has(u);
|
|
347
350
|
if (!b && i) {
|
|
348
351
|
const S = Array.isArray(i) ? i[0] : i;
|
|
349
352
|
t.removeEventListener(u, S);
|
|
350
353
|
}
|
|
351
|
-
(b || n) && (
|
|
354
|
+
(b || n) && (jt(t, u, n, b), b && xt([u]));
|
|
352
355
|
} else if (e.slice(0, 5) === "attr:")
|
|
353
356
|
z(t, e.slice(5), n);
|
|
354
|
-
else if ((f = e.slice(0, 5) === "prop:") || (l =
|
|
357
|
+
else if ((f = e.slice(0, 5) === "prop:") || (l = ut.has(e)) || !s && ((a = mt(e, t.tagName)) || (c = ft.has(e))) || (r = t.nodeName.includes("-"))) {
|
|
355
358
|
if (f)
|
|
356
359
|
e = e.slice(5), c = !0;
|
|
357
360
|
else if (y.context && t.isConnected)
|
|
358
361
|
return n;
|
|
359
|
-
e === "class" || e === "className" ?
|
|
362
|
+
e === "class" || e === "className" ? wt(t, n) : r && !c && !l ? t[Tt(e)] = n : t[a || e] = n;
|
|
360
363
|
} else {
|
|
361
|
-
const u = s && e.indexOf(":") > -1 &&
|
|
362
|
-
u ?
|
|
364
|
+
const u = s && e.indexOf(":") > -1 && bt[e.split(":")[0]];
|
|
365
|
+
u ? St(t, u, e, n) : z(t, dt[e] || e, n);
|
|
363
366
|
}
|
|
364
367
|
return n;
|
|
365
368
|
}
|
|
@@ -438,7 +441,7 @@ function C(t, e, n, i, s) {
|
|
|
438
441
|
if (n = j(t, n, i), c)
|
|
439
442
|
return n;
|
|
440
443
|
} else
|
|
441
|
-
a ? n.length === 0 ? H(t, l, i) :
|
|
444
|
+
a ? n.length === 0 ? H(t, l, i) : $t(t, n, l) : (n && j(t), H(t, l));
|
|
442
445
|
n = l;
|
|
443
446
|
} else if (e.nodeType) {
|
|
444
447
|
if (o && e.parentNode)
|
|
@@ -519,8 +522,8 @@ function zt(t) {
|
|
|
519
522
|
case "function":
|
|
520
523
|
return L(() => s(n));
|
|
521
524
|
case "string":
|
|
522
|
-
const o =
|
|
523
|
-
return
|
|
525
|
+
const o = gt.has(s), r = y.context ? It() : Mt(s, o);
|
|
526
|
+
return At(r, n, o), r;
|
|
524
527
|
}
|
|
525
528
|
});
|
|
526
529
|
}
|
|
@@ -557,12 +560,12 @@ function g(t) {
|
|
|
557
560
|
});
|
|
558
561
|
}, {}) : new Error("Please provide an object with accessor values only.");
|
|
559
562
|
}
|
|
560
|
-
const
|
|
561
|
-
function
|
|
562
|
-
return
|
|
563
|
+
const tt = /^--\D{1}.{0,100}$/;
|
|
564
|
+
function et(t) {
|
|
565
|
+
return tt.test(t);
|
|
563
566
|
}
|
|
564
567
|
function W(t) {
|
|
565
|
-
return typeof t != "string" ? !1 : [/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/, /^var\(--\D{1}.{0,100}\)$/,
|
|
568
|
+
return typeof t != "string" ? !1 : [/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/, /^var\(--\D{1}.{0,100}\)$/, tt].some((e) => e.test(t));
|
|
566
569
|
}
|
|
567
570
|
const {
|
|
568
571
|
sizeXxs: Nt,
|
|
@@ -570,8 +573,8 @@ const {
|
|
|
570
573
|
sizeSm: Lt,
|
|
571
574
|
sizeMd: Wt,
|
|
572
575
|
sizeLg: Bt,
|
|
573
|
-
sizeXl:
|
|
574
|
-
sizeXxl:
|
|
576
|
+
sizeXl: Dt,
|
|
577
|
+
sizeXxl: Rt,
|
|
575
578
|
sizeContent1: Gt,
|
|
576
579
|
sizeContent2: Ht,
|
|
577
580
|
sizeContent3: _t,
|
|
@@ -595,7 +598,7 @@ const {
|
|
|
595
598
|
size13: ce,
|
|
596
599
|
size14: re,
|
|
597
600
|
size15: le
|
|
598
|
-
} =
|
|
601
|
+
} = ot, ae = {
|
|
599
602
|
size000: Ut,
|
|
600
603
|
size00: qt,
|
|
601
604
|
size1: Qt,
|
|
@@ -619,8 +622,8 @@ const {
|
|
|
619
622
|
sizeSm: Lt,
|
|
620
623
|
sizeMd: Wt,
|
|
621
624
|
sizeLg: Bt,
|
|
622
|
-
sizeXl:
|
|
623
|
-
sizeXxl:
|
|
625
|
+
sizeXl: Dt,
|
|
626
|
+
sizeXxl: Rt,
|
|
624
627
|
sizeContent1: Gt,
|
|
625
628
|
sizeContent2: Ht,
|
|
626
629
|
sizeContent3: _t,
|
|
@@ -628,7 +631,7 @@ const {
|
|
|
628
631
|
sizeHeader2: Vt,
|
|
629
632
|
sizeHeader3: Xt
|
|
630
633
|
}, ue = ae, de = fe;
|
|
631
|
-
function
|
|
634
|
+
function nt(t) {
|
|
632
635
|
return t.reduce((e, [n, i]) => ({
|
|
633
636
|
...e,
|
|
634
637
|
[n]: i
|
|
@@ -636,10 +639,10 @@ function et(t) {
|
|
|
636
639
|
}
|
|
637
640
|
function _(t, e) {
|
|
638
641
|
if (e !== void 0)
|
|
639
|
-
return typeof e == "number" && e >= 0 ? `${e}px` : typeof e == "string" && W(e) ?
|
|
642
|
+
return typeof e == "number" && e >= 0 ? `${e}px` : typeof e == "string" && W(e) ? et(e) ? `var(${e})` : e : A($(t, e));
|
|
640
643
|
}
|
|
641
644
|
function $(t, e) {
|
|
642
|
-
const n = t.space ?? ue, i =
|
|
645
|
+
const n = t.space ?? ue, i = nt(Object.entries(n).map(([s, o]) => [s, typeof o == "number" ? `${o}px` : o]));
|
|
643
646
|
return A(i[e]);
|
|
644
647
|
}
|
|
645
648
|
function O(t, e) {
|
|
@@ -648,8 +651,8 @@ function O(t, e) {
|
|
|
648
651
|
if (typeof e == "number" && e >= 0)
|
|
649
652
|
return `${e}px`;
|
|
650
653
|
if (typeof e == "string" && W(e))
|
|
651
|
-
return
|
|
652
|
-
const n = t.sizes ?? de, i =
|
|
654
|
+
return et(e) ? `var(${e})` : e;
|
|
655
|
+
const n = t.sizes ?? de, i = nt(Object.entries(n).map(([s, o]) => [s, typeof o == "number" ? `${o}px` : o]));
|
|
653
656
|
return A(i[e]);
|
|
654
657
|
}
|
|
655
658
|
function ye(t) {
|
|
@@ -662,9 +665,9 @@ function Be(t) {
|
|
|
662
665
|
"data-bedrock-center": o
|
|
663
666
|
})));
|
|
664
667
|
}
|
|
665
|
-
const
|
|
666
|
-
function
|
|
667
|
-
return I(
|
|
668
|
+
const it = ct({});
|
|
669
|
+
function De(t) {
|
|
670
|
+
return I(it.Provider, {
|
|
668
671
|
get value() {
|
|
669
672
|
return t.theme;
|
|
670
673
|
},
|
|
@@ -675,7 +678,7 @@ function Re(t) {
|
|
|
675
678
|
}
|
|
676
679
|
function x() {
|
|
677
680
|
try {
|
|
678
|
-
return
|
|
681
|
+
return rt(it);
|
|
679
682
|
} catch {
|
|
680
683
|
return {};
|
|
681
684
|
}
|
|
@@ -683,7 +686,7 @@ function x() {
|
|
|
683
686
|
function me(t, e) {
|
|
684
687
|
return O(t, e);
|
|
685
688
|
}
|
|
686
|
-
function
|
|
689
|
+
function Re(t) {
|
|
687
690
|
const e = x(), n = () => typeof t.style == "string" ? t.style : Object.entries(t.style ?? {}).reduce((c, [l, a]) => c + `${l}:${a};`, ""), i = () => `--gutter: ${$(e, t.gap ?? t.gutter ?? "size00") ?? "0px"}`, s = () => `--minItemWidth: ${me(e, t.minItemWidth)}`, o = () => t.noStretchedColumns === !0 ? "no-stretched-columns" : "", r = () => [n(), i(), s()].join("; ");
|
|
688
691
|
return h(() => t.as ?? "div", d(m(t, ["as", "gutter", "minItemWidth", "noStretchedColumns"]), g({
|
|
689
692
|
style: r,
|
|
@@ -733,7 +736,7 @@ function $e(t) {
|
|
|
733
736
|
})));
|
|
734
737
|
}
|
|
735
738
|
const E = 96;
|
|
736
|
-
function
|
|
739
|
+
function st(t) {
|
|
737
740
|
const e = String(t), n = parseFloat(e), [, i] = e.match(/[\d.\-+]*\s*(.*)/) ?? ["", ""];
|
|
738
741
|
return [n, i];
|
|
739
742
|
}
|
|
@@ -768,7 +771,7 @@ function B(t, e) {
|
|
|
768
771
|
case "px":
|
|
769
772
|
return 1;
|
|
770
773
|
default: {
|
|
771
|
-
const [s, o] =
|
|
774
|
+
const [s, o] = st(i);
|
|
772
775
|
if (isNaN(s))
|
|
773
776
|
return;
|
|
774
777
|
if (!o)
|
|
@@ -779,7 +782,7 @@ function B(t, e) {
|
|
|
779
782
|
}
|
|
780
783
|
}
|
|
781
784
|
function k(t, e) {
|
|
782
|
-
const [n, i] =
|
|
785
|
+
const [n, i] = st(
|
|
783
786
|
getComputedStyle(t).getPropertyValue(e)
|
|
784
787
|
);
|
|
785
788
|
return n * (B(i, t) ?? 1);
|
|
@@ -807,10 +810,10 @@ const M = 1, we = typeof window == "object" && typeof document == "object" && do
|
|
|
807
810
|
return q(c), 0;
|
|
808
811
|
}), (() => {
|
|
809
812
|
var r = Se();
|
|
810
|
-
return
|
|
813
|
+
return K(s, r), p(r, () => t.children), w((c) => Z(r, `grid-row: span ${e()};`, c)), r;
|
|
811
814
|
})();
|
|
812
815
|
}, _e = (t) => {
|
|
813
|
-
const e =
|
|
816
|
+
const e = lt(() => t.children), i = [].concat(e()).filter(Boolean).map((s) => I(je, {
|
|
814
817
|
get gutter() {
|
|
815
818
|
return t.gutter;
|
|
816
819
|
},
|
|
@@ -952,7 +955,7 @@ function Ye(t) {
|
|
|
952
955
|
get children() {
|
|
953
956
|
return [T(() => e.top), (() => {
|
|
954
957
|
var i = Pe();
|
|
955
|
-
return
|
|
958
|
+
return p(i, () => e.children), i;
|
|
956
959
|
})(), T(() => e.bottom)];
|
|
957
960
|
}
|
|
958
961
|
}));
|
|
@@ -975,7 +978,7 @@ function Ze(t) {
|
|
|
975
978
|
export {
|
|
976
979
|
Be as Center,
|
|
977
980
|
Ze as Column,
|
|
978
|
-
|
|
981
|
+
Re as ColumnDrop,
|
|
979
982
|
Je as Columns,
|
|
980
983
|
Ye as Cover,
|
|
981
984
|
He as Frame,
|
|
@@ -987,7 +990,7 @@ export {
|
|
|
987
990
|
Ue as Reel,
|
|
988
991
|
qe as Split,
|
|
989
992
|
Qe as Stack,
|
|
990
|
-
|
|
993
|
+
De as ThemeProvider,
|
|
991
994
|
W as checkIsCSSLength,
|
|
992
995
|
Ge as createContainerQuery,
|
|
993
996
|
_ as getSafeGutter,
|
package/lib/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("open-props"),require("solid-js"),require("@bedrock-layout/register-resize-callback")):typeof define=="function"&&define.amd?define(["exports","open-props","solid-js","@bedrock-layout/register-resize-callback"],x):(d=typeof globalThis<"u"?globalThis:d||self,x(d.solid={},d.OpenProps,d.solidJs,d.registerResizeCallback))})(this,function(d,x,f,T){"use strict";const p=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],J=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...p]),ee=new Set(["innerHTML","textContent","innerText","children"]),te=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ne=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ie(e,t){const n=ne[e];return typeof n=="object"?n[t]?n.$:void 0:n}const re=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ce=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function se(e,t,n){let i=n.length,r=t.length,c=i,s=0,o=0,a=t[r-1].nextSibling,l=null;for(;s<r||o<c;){if(t[s]===n[o]){s++,o++;continue}for(;t[r-1]===n[c-1];)r--,c--;if(r===s){const u=c<i?o?n[o-1].nextSibling:n[c-o]:a;for(;o<c;)e.insertBefore(n[o++],u)}else if(c===o)for(;s<r;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[c-1]&&n[o]===t[r-1]){const u=t[--r].nextSibling;e.insertBefore(n[o++],t[s++].nextSibling),e.insertBefore(n[--c],u),t[r]=n[c]}else{if(!l){l=new Map;let g=o;for(;g<c;)l.set(n[g],g++)}const u=l.get(t[s]);if(u!=null)if(o<u&&u<c){let g=s,C=1,S;for(;++g<r&&g<c&&!((S=l.get(t[g]))==null||S!==u+C);)C++;if(C>u-o){const L=t[s];for(;o<u;)e.insertBefore(n[o++],L)}else e.replaceChild(n[o++],t[s++])}else s++;else t[s++].remove()}}}const W="_$DX_DELEGATE";function B(e,t,n){let i;const r=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},c=t?()=>f.untrack(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return c.cloneNode=c,c}function ae(e,t=window.document){const n=t[W]||(t[W]=new Set);for(let i=0,r=e.length;i<r;i++){const c=e[i];n.has(c)||(n.add(c),t.addEventListener(c,$e))}}function M(e,t,n){f.sharedConfig.context&&e.isConnected||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function fe(e,t,n,i){f.sharedConfig.context&&e.isConnected||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function le(e,t){f.sharedConfig.context&&e.isConnected||(t==null?e.removeAttribute("class"):e.className=t)}function ue(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=c=>r.call(e,n[1],c))}else e.addEventListener(t,n)}function de(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let c,s;for(c=0,s=r.length;c<s;c++){const o=r[c];!o||o==="undefined"||t[o]||(G(e,o,!1),delete n[o])}for(c=0,s=i.length;c<s;c++){const o=i[c],a=!!t[o];!o||o==="undefined"||n[o]===a||!a||(G(e,o,!0),n[o]=a)}return n}function R(e,t,n){if(!t)return n?M(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let r,c;for(c in n)t[c]==null&&i.removeProperty(c),delete n[c];for(c in t)r=t[c],r!==n[c]&&(i.setProperty(c,r),n[c]=r);return n}function ge(e,t={},n,i){const r={};return i||f.createRenderEffect(()=>r.children=j(e,t.children,r.children)),f.createRenderEffect(()=>t.ref&&t.ref(e)),f.createRenderEffect(()=>me(e,t,n,!0,r,!0)),r}function ye(e,t,n){return f.untrack(()=>e(t,n))}function D(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return j(e,t,i,n);f.createRenderEffect(r=>j(e,t(),r,n),i)}function me(e,t,n,i,r={},c=!1){t||(t={});for(const s in r)if(!(s in t)){if(s==="children")continue;r[s]=H(e,s,null,r[s],n,c)}for(const s in t){if(s==="children"){i||j(e,t.children);continue}const o=t[s];r[s]=H(e,s,o,r[s],n,c)}}function he(e){let t,n;return!f.sharedConfig.context||!(t=f.sharedConfig.registry.get(n=Ce()))?e():(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function be(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function G(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,c=i.length;r<c;r++)e.classList.toggle(i[r],n)}function H(e,t,n,i,r,c){let s,o,a,l,u;if(t==="style")return R(e,n,i);if(t==="classList")return de(e,n,i);if(n===i)return i;if(t==="ref")c||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);i&&e.removeEventListener(g,i),n&&e.addEventListener(g,n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);i&&e.removeEventListener(g,i,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),C=re.has(g);if(!C&&i){const S=Array.isArray(i)?i[0]:i;e.removeEventListener(g,S)}(C||n)&&(ue(e,g,n,C),C&&ae([g]))}else if(t.slice(0,5)==="attr:")M(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(a=ee.has(t))||!r&&((l=ie(t,e.tagName))||(o=J.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),o=!0;else if(f.sharedConfig.context&&e.isConnected)return n;t==="class"||t==="className"?le(e,n):s&&!o&&!a?e[be(t)]=n:e[l||t]=n}else{const g=r&&t.indexOf(":")>-1&&oe[t.split(":")[0]];g?fe(e,g,t,n):M(e,te[t]||t,n)}return n}function $e(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),f.sharedConfig.registry&&!f.sharedConfig.done&&(f.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i.call(n,r,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function j(e,t,n,i,r){const c=!!f.sharedConfig.context&&e.isConnected;if(c){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const u=n[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():a.push(u)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,o=i!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(c)return n;if(s==="number"&&(t=t.toString()),o){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=w(e,n,i,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(c)return n;n=w(e,n,i)}else{if(s==="function")return f.createRenderEffect(()=>{let a=t();for(;typeof a=="function";)a=a();n=j(e,a,n,i)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(v(a,t,n,r))return f.createRenderEffect(()=>n=j(e,a,n,i,!0)),()=>n;if(c){if(!a.length)return n;if(i===void 0)return[...e.childNodes];let u=a[0],g=[u];for(;(u=u.nextSibling)!==i;)g.push(u);return n=g}if(a.length===0){if(n=w(e,n,i),o)return n}else l?n.length===0?_(e,a,i):se(e,n,a):(n&&w(e),_(e,a));n=a}else if(t.nodeType){if(c&&t.parentNode)return n=o?[t]:t;if(Array.isArray(n)){if(o)return n=w(e,n,i,t);w(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function v(e,t,n,i){let r=!1;for(let c=0,s=t.length;c<s;c++){let o=t[c],a=n&&n[e.length],l;if(!(o==null||o===!0||o===!1))if((l=typeof o)=="object"&&o.nodeType)e.push(o);else if(Array.isArray(o))r=v(e,o,a)||r;else if(l==="function")if(i){for(;typeof o=="function";)o=o();r=v(e,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||r}else e.push(o),r=!0;else{const u=String(o);a&&a.nodeType===3&&a.data===u?e.push(a):e.push(document.createTextNode(u))}}return r}function _(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function w(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let c=!1;for(let s=t.length-1;s>=0;s--){const o=t[s];if(r!==o){const a=o.parentNode===e;!c&&!s?a?e.replaceChild(r,o):e.insertBefore(r,n):a&&o.remove()}else c=!0}}else e.insertBefore(r,n);return[r]}function Ce(){const e=f.sharedConfig.context;return`${e.id}${e.count++}`}const Se="http://www.w3.org/2000/svg";function je(e,t=!1){return t?document.createElementNS(Se,e):document.createElement(e)}function we(e){const[t,n]=f.splitProps(e,["component"]),i=f.createMemo(()=>t.component);return f.createMemo(()=>{const r=i();switch(typeof r){case"function":return f.untrack(()=>r(n));case"string":const c=ce.has(r),s=f.sharedConfig.context?he():je(r,c);return ge(s,n,c),s}})}function A(e){return e??void 0}function y(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function m(e,t){return f.createComponent(we,f.mergeProps({get component(){return e()}},t))}function h(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const F=/^--\D{1}.{0,100}$/;function V(e){return F.test(e)}function I(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,F].some(t=>t.test(e))}const{sizeXxs:Ae,sizeXs:xe,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:ve,sizeContent2:Oe,sizeContent3:ze,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le,size000:We,size00:Be,size1:Re,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe}=x,Je={size000:We,size00:Be,size1:Re,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe},et={sizeXxs:Ae,sizeXs:xe,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:ve,sizeContent2:Oe,sizeContent3:ze,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le},X=Je,q=et;function U(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function O(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&I(t)?V(t)?`var(${t})`:t:A(b(e,t))}function b(e,t){const n=e.space??X,i=U(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return A(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&I(t))return V(t)?`var(${t})`:t;const n=e.sizes??q,i=U(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return A(i[t])}function tt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),n=()=>`--maxWidth: ${tt(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",c=()=>[i(),r()].filter(Boolean).join(" "),s=()=>[t(),n()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),h({style:s,"data-bedrock-center":c})))}const Q=f.createContext({});function it(e){return f.createComponent(Q.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return f.useContext(Q)}catch{return{}}}function rt(e,t){return P(e,t)}function ct(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${rt(t,e.minItemWidth)}`,c=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",s=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),h({style:s,"data-bedrock-column-drop":c})))}function ot(e,t){const[n,i]=f.createSignal(!1),[r,c]=f.createSignal();return f.onMount(()=>{T.init()}),f.createEffect(()=>{if(A(r())===void 0)return;t&&t(r());const s=T.registerCallback(r(),o=>{var l;const a=((l=o.borderBoxSize)==null?void 0:l.inlineSize)??o.contentRect.width;if(a>0){const u=a<=e;i(u)}});f.onCleanup(s)}),[n,c]}function st(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function at(e){return Array.isArray(e)?e.join("/"):e}function ft(e){return st(e)?at(e):void 0}function lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),n=()=>ft(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",c=()=>[t(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","ratio","position"]),h({style:c,"data-bedrock-frame":()=>""})))}function Y(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,c=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth"]),h({style:c,"data-bedrock-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const E=96;function Z(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function z(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return ut(i,n);case"em":return k(n,"font-size");case"rem":return k(document.body,"font-size");case"in":return E;case"cm":return E/2.54;case"mm":return E/25.4;case"pt":return E/72;case"pc":return E/6;case"px":return 1;default:{const[r,c]=Z(i);if(isNaN(r))return;if(!c)return r;const s=z(c,t);return typeof s=="number"?r*s:void 0}}}function k(e,t){const[n,i]=Z(getComputedStyle(e).getPropertyValue(t));return n*(z(i,e)??1)}function ut(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=k(n,"height")/128;return t.removeChild(n),i}var dt=B("<div>");const N=1,gt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,yt=e=>{const[t,n]=f.createSignal(1),[i,r]=f.createSignal(),c=$();return f.onMount(()=>(T.init(),0)),f.createEffect(()=>{const s=A(i());if(s===void 0)return;const o=T.registerCallback(s,({target:a})=>{n(1);const l=e.gutter?b(c,e.gutter)??"1px":"1px",u=gt?z(l,a):void 0,g=Math.max(u??N,N),[C]=Array.from(a.children),S=1+Math.min(a.scrollHeight,C.scrollHeight),L=Math.max(Math.ceil(S/g),N);return n(L),0});return f.onCleanup(o),0}),(()=>{var s=dt();return ye(r,s),D(s,()=>e.children),f.createRenderEffect(o=>R(s,`grid-row: span ${t()};`,o)),s})()},mt=e=>{const t=f.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>f.createComponent(yt,{get gutter(){return e.gutter},children:r}));return f.createComponent(Y,f.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},ht={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},bt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function $t(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,u])=>a+`${l}:${u};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.justify!==void 0?ht[e.justify]:void 0,c=()=>e.align!==void 0?bt[e.align]:void 0,s=()=>[n(),i()].join("; "),o=()=>[r(),c()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align"]),h({style:s,"data-bedrock-inline-cluster":o})))}const Ct={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},St={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((g,[C,S])=>g+`${C}:${S};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>e.justify!==void 0?Ct[e.justify]:void 0,o=()=>e.align!==void 0?St[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,l=()=>[n(),i(),c(),r()].join("; "),u=()=>[s(),o(),a()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),h({style:l,"data-bedrock-inline":u})))}const wt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],At=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[r,c])=>({...i,[wt(r)]:O(e,c)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>O(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,c])=>i+`${r}:${c};`,"")};function xt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[s,o])=>c+`${s}:${o};`,""),i=()=>At(t,e.padding),r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","padding"]),h({style:r,"data-bedrock-padbox":()=>""})))}function Pt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},c=()=>[n(),i()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:c,"data-bedrock-reel":r})))}const K={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Et(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,u])=>a+`${l}:${u};`,""),i=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",r=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,c=()=>K[e.fraction??"1/2"]??K["1/2"],s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),r(),i(),s()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","fraction"]),h({style:o,"data-bedrock-split":c})))}const Tt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function It(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>[n(),i()].join("; "),c=()=>e.align!==void 0?Tt[e.align]:void 0,s=()=>[c()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:r,"data-bedrock-stack":s})))}var Mt=B("<div data-bedrock-cover-centered>");function vt(e){return typeof e=="number"?`${e}px`:e&&I(e)?e:"100vh"}function Ot(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minHeight: ${vt(e.minHeight)};`,c=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",s=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","minHeight","stretchContent"]),h({style:s,"data-bedrock-cover":c})))}function zt(e){const[t,n]=f.splitProps(e,["children","top","bottom"]);return f.createComponent(Ot,f.mergeProps(n,{get children(){return[f.createMemo(()=>t.top),(()=>{var i=Mt();return D(i,()=>t.children),i})(),f.createMemo(()=>t.bottom)]}}))}function kt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--columns: ${A(Math.max(e.colCount??e.columns??1,1))??1};`,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>[n(),i(),r(),c()].filter(Boolean).join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","columns","colCount","switchAt"]),h({style:s,"data-bedrock-columns":()=>""})))}const Nt=e=>typeof e=="number"?e:1;function Lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),n=()=>`--span: ${Nt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",c=()=>[t(),n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),h({style:c,"data-bedrock-column":()=>""})))}d.Center=nt,d.Column=Lt,d.ColumnDrop=ct,d.Columns=kt,d.Cover=zt,d.Frame=lt,d.Grid=Y,d.Inline=jt,d.InlineCluster=$t,d.MasonryGrid=mt,d.PadBox=xt,d.Reel=Pt,d.Split=Et,d.Stack=It,d.ThemeProvider=it,d.checkIsCSSLength=I,d.createContainerQuery=ot,d.getSafeGutter=O,d.getSizeValue=P,d.getSpacingValue=b,d.sizes=q,d.spacing=X,d.useTheme=$,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(d,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("open-props"),require("solid-js"),require("@bedrock-layout/register-resize-callback")):typeof define=="function"&&define.amd?define(["exports","open-props","solid-js","@bedrock-layout/register-resize-callback"],x):(d=typeof globalThis<"u"?globalThis:d||self,x(d.solid={},d.OpenProps,d.solidJs,d.registerResizeCallback))})(this,function(d,x,f,T){"use strict";const J=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],ee=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...J]),te=new Set(["innerHTML","textContent","innerText","children"]),ne=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ie=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function re(e,t){const n=ie[e];return typeof n=="object"?n[t]?n.$:void 0:n}const ce=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),oe=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),se={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ae(e,t,n){let i=n.length,r=t.length,c=i,s=0,o=0,a=t[r-1].nextSibling,l=null;for(;s<r||o<c;){if(t[s]===n[o]){s++,o++;continue}for(;t[r-1]===n[c-1];)r--,c--;if(r===s){const u=c<i?o?n[o-1].nextSibling:n[c-o]:a;for(;o<c;)e.insertBefore(n[o++],u)}else if(c===o)for(;s<r;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[c-1]&&n[o]===t[r-1]){const u=t[--r].nextSibling;e.insertBefore(n[o++],t[s++].nextSibling),e.insertBefore(n[--c],u),t[r]=n[c]}else{if(!l){l=new Map;let g=o;for(;g<c;)l.set(n[g],g++)}const u=l.get(t[s]);if(u!=null)if(o<u&&u<c){let g=s,C=1,S;for(;++g<r&&g<c&&!((S=l.get(t[g]))==null||S!==u+C);)C++;if(C>u-o){const L=t[s];for(;o<u;)e.insertBefore(n[o++],L)}else e.replaceChild(n[o++],t[s++])}else s++;else t[s++].remove()}}}const W="_$DX_DELEGATE";function B(e,t,n){let i;const r=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},c=t?()=>f.untrack(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return c.cloneNode=c,c}function fe(e,t=window.document){const n=t[W]||(t[W]=new Set);for(let i=0,r=e.length;i<r;i++){const c=e[i];n.has(c)||(n.add(c),t.addEventListener(c,$e))}}function M(e,t,n){f.sharedConfig.context&&e.isConnected||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function le(e,t,n,i){f.sharedConfig.context&&e.isConnected||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function ue(e,t){f.sharedConfig.context&&e.isConnected||(t==null?e.removeAttribute("class"):e.className=t)}function de(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=c=>r.call(e,n[1],c))}else e.addEventListener(t,n)}function ge(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let c,s;for(c=0,s=r.length;c<s;c++){const o=r[c];!o||o==="undefined"||t[o]||(H(e,o,!1),delete n[o])}for(c=0,s=i.length;c<s;c++){const o=i[c],a=!!t[o];!o||o==="undefined"||n[o]===a||!a||(H(e,o,!0),n[o]=a)}return n}function R(e,t,n){if(!t)return n?M(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let r,c;for(c in n)t[c]==null&&i.removeProperty(c),delete n[c];for(c in t)r=t[c],r!==n[c]&&(i.setProperty(c,r),n[c]=r);return n}function ye(e,t={},n,i){const r={};return i||f.createRenderEffect(()=>r.children=j(e,t.children,r.children)),f.createRenderEffect(()=>typeof t.ref=="function"?D(t.ref,e):t.ref=e),f.createRenderEffect(()=>me(e,t,n,!0,r,!0)),r}function D(e,t,n){return f.untrack(()=>e(t,n))}function G(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return j(e,t,i,n);f.createRenderEffect(r=>j(e,t(),r,n),i)}function me(e,t,n,i,r={},c=!1){t||(t={});for(const s in r)if(!(s in t)){if(s==="children")continue;r[s]=_(e,s,null,r[s],n,c)}for(const s in t){if(s==="children"){i||j(e,t.children);continue}const o=t[s];r[s]=_(e,s,o,r[s],n,c)}}function he(e){let t,n;return!f.sharedConfig.context||!(t=f.sharedConfig.registry.get(n=Ce()))?e():(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function be(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function H(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,c=i.length;r<c;r++)e.classList.toggle(i[r],n)}function _(e,t,n,i,r,c){let s,o,a,l,u;if(t==="style")return R(e,n,i);if(t==="classList")return ge(e,n,i);if(n===i)return i;if(t==="ref")c||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);i&&e.removeEventListener(g,i),n&&e.addEventListener(g,n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);i&&e.removeEventListener(g,i,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),C=ce.has(g);if(!C&&i){const S=Array.isArray(i)?i[0]:i;e.removeEventListener(g,S)}(C||n)&&(de(e,g,n,C),C&&fe([g]))}else if(t.slice(0,5)==="attr:")M(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(a=te.has(t))||!r&&((l=re(t,e.tagName))||(o=ee.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),o=!0;else if(f.sharedConfig.context&&e.isConnected)return n;t==="class"||t==="className"?ue(e,n):s&&!o&&!a?e[be(t)]=n:e[l||t]=n}else{const g=r&&t.indexOf(":")>-1&&se[t.split(":")[0]];g?le(e,g,t,n):M(e,ne[t]||t,n)}return n}function $e(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),f.sharedConfig.registry&&!f.sharedConfig.done&&(f.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i.call(n,r,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function j(e,t,n,i,r){const c=!!f.sharedConfig.context&&e.isConnected;if(c){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const u=n[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():a.push(u)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,o=i!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(c)return n;if(s==="number"&&(t=t.toString()),o){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=w(e,n,i,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(c)return n;n=w(e,n,i)}else{if(s==="function")return f.createRenderEffect(()=>{let a=t();for(;typeof a=="function";)a=a();n=j(e,a,n,i)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(v(a,t,n,r))return f.createRenderEffect(()=>n=j(e,a,n,i,!0)),()=>n;if(c){if(!a.length)return n;if(i===void 0)return[...e.childNodes];let u=a[0],g=[u];for(;(u=u.nextSibling)!==i;)g.push(u);return n=g}if(a.length===0){if(n=w(e,n,i),o)return n}else l?n.length===0?F(e,a,i):ae(e,n,a):(n&&w(e),F(e,a));n=a}else if(t.nodeType){if(c&&t.parentNode)return n=o?[t]:t;if(Array.isArray(n)){if(o)return n=w(e,n,i,t);w(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function v(e,t,n,i){let r=!1;for(let c=0,s=t.length;c<s;c++){let o=t[c],a=n&&n[e.length],l;if(!(o==null||o===!0||o===!1))if((l=typeof o)=="object"&&o.nodeType)e.push(o);else if(Array.isArray(o))r=v(e,o,a)||r;else if(l==="function")if(i){for(;typeof o=="function";)o=o();r=v(e,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||r}else e.push(o),r=!0;else{const u=String(o);a&&a.nodeType===3&&a.data===u?e.push(a):e.push(document.createTextNode(u))}}return r}function F(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function w(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let c=!1;for(let s=t.length-1;s>=0;s--){const o=t[s];if(r!==o){const a=o.parentNode===e;!c&&!s?a?e.replaceChild(r,o):e.insertBefore(r,n):a&&o.remove()}else c=!0}}else e.insertBefore(r,n);return[r]}function Ce(){const e=f.sharedConfig.context;return`${e.id}${e.count++}`}const Se="http://www.w3.org/2000/svg";function je(e,t=!1){return t?document.createElementNS(Se,e):document.createElement(e)}function we(e){const[t,n]=f.splitProps(e,["component"]),i=f.createMemo(()=>t.component);return f.createMemo(()=>{const r=i();switch(typeof r){case"function":return f.untrack(()=>r(n));case"string":const c=oe.has(r),s=f.sharedConfig.context?he():je(r,c);return ye(s,n,c),s}})}function A(e){return e??void 0}function y(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function m(e,t){return f.createComponent(we,f.mergeProps({get component(){return e()}},t))}function h(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const V=/^--\D{1}.{0,100}$/;function X(e){return V.test(e)}function I(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,V].some(t=>t.test(e))}const{sizeXxs:Ae,sizeXs:xe,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:ve,sizeContent2:Oe,sizeContent3:ze,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le,size000:We,size00:Be,size1:Re,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe}=x,Je={size000:We,size00:Be,size1:Re,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe},et={sizeXxs:Ae,sizeXs:xe,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:ve,sizeContent2:Oe,sizeContent3:ze,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le},q=Je,U=et;function Q(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function O(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&I(t)?X(t)?`var(${t})`:t:A(b(e,t))}function b(e,t){const n=e.space??q,i=Q(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return A(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&I(t))return X(t)?`var(${t})`:t;const n=e.sizes??U,i=Q(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return A(i[t])}function tt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),n=()=>`--maxWidth: ${tt(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",c=()=>[i(),r()].filter(Boolean).join(" "),s=()=>[t(),n()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),h({style:s,"data-bedrock-center":c})))}const Y=f.createContext({});function it(e){return f.createComponent(Y.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return f.useContext(Y)}catch{return{}}}function rt(e,t){return P(e,t)}function ct(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${rt(t,e.minItemWidth)}`,c=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",s=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),h({style:s,"data-bedrock-column-drop":c})))}function ot(e,t){const[n,i]=f.createSignal(!1),[r,c]=f.createSignal();return f.onMount(()=>{T.init()}),f.createEffect(()=>{if(A(r())===void 0)return;t&&t(r());const s=T.registerCallback(r(),o=>{var l;const a=((l=o.borderBoxSize)==null?void 0:l.inlineSize)??o.contentRect.width;if(a>0){const u=a<=e;i(u)}});f.onCleanup(s)}),[n,c]}function st(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function at(e){return Array.isArray(e)?e.join("/"):e}function ft(e){return st(e)?at(e):void 0}function lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),n=()=>ft(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",c=()=>[t(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","ratio","position"]),h({style:c,"data-bedrock-frame":()=>""})))}function Z(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,c=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth"]),h({style:c,"data-bedrock-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const E=96;function K(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function z(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return ut(i,n);case"em":return k(n,"font-size");case"rem":return k(document.body,"font-size");case"in":return E;case"cm":return E/2.54;case"mm":return E/25.4;case"pt":return E/72;case"pc":return E/6;case"px":return 1;default:{const[r,c]=K(i);if(isNaN(r))return;if(!c)return r;const s=z(c,t);return typeof s=="number"?r*s:void 0}}}function k(e,t){const[n,i]=K(getComputedStyle(e).getPropertyValue(t));return n*(z(i,e)??1)}function ut(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=k(n,"height")/128;return t.removeChild(n),i}var dt=B("<div>");const N=1,gt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,yt=e=>{const[t,n]=f.createSignal(1),[i,r]=f.createSignal(),c=$();return f.onMount(()=>(T.init(),0)),f.createEffect(()=>{const s=A(i());if(s===void 0)return;const o=T.registerCallback(s,({target:a})=>{n(1);const l=e.gutter?b(c,e.gutter)??"1px":"1px",u=gt?z(l,a):void 0,g=Math.max(u??N,N),[C]=Array.from(a.children),S=1+Math.min(a.scrollHeight,C.scrollHeight),L=Math.max(Math.ceil(S/g),N);return n(L),0});return f.onCleanup(o),0}),(()=>{var s=dt();return D(r,s),G(s,()=>e.children),f.createRenderEffect(o=>R(s,`grid-row: span ${t()};`,o)),s})()},mt=e=>{const t=f.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>f.createComponent(yt,{get gutter(){return e.gutter},children:r}));return f.createComponent(Z,f.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},ht={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},bt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function $t(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,u])=>a+`${l}:${u};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.justify!==void 0?ht[e.justify]:void 0,c=()=>e.align!==void 0?bt[e.align]:void 0,s=()=>[n(),i()].join("; "),o=()=>[r(),c()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align"]),h({style:s,"data-bedrock-inline-cluster":o})))}const Ct={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},St={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((g,[C,S])=>g+`${C}:${S};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>e.justify!==void 0?Ct[e.justify]:void 0,o=()=>e.align!==void 0?St[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,l=()=>[n(),i(),c(),r()].join("; "),u=()=>[s(),o(),a()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),h({style:l,"data-bedrock-inline":u})))}const wt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],At=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[r,c])=>({...i,[wt(r)]:O(e,c)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>O(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,c])=>i+`${r}:${c};`,"")};function xt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[s,o])=>c+`${s}:${o};`,""),i=()=>At(t,e.padding),r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","padding"]),h({style:r,"data-bedrock-padbox":()=>""})))}function Pt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},c=()=>[n(),i()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:c,"data-bedrock-reel":r})))}const p={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Et(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,u])=>a+`${l}:${u};`,""),i=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",r=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,c=()=>p[e.fraction??"1/2"]??p["1/2"],s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),r(),i(),s()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","fraction"]),h({style:o,"data-bedrock-split":c})))}const Tt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function It(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>[n(),i()].join("; "),c=()=>e.align!==void 0?Tt[e.align]:void 0,s=()=>[c()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:r,"data-bedrock-stack":s})))}var Mt=B("<div data-bedrock-cover-centered>");function vt(e){return typeof e=="number"?`${e}px`:e&&I(e)?e:"100vh"}function Ot(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minHeight: ${vt(e.minHeight)};`,c=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",s=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","minHeight","stretchContent"]),h({style:s,"data-bedrock-cover":c})))}function zt(e){const[t,n]=f.splitProps(e,["children","top","bottom"]);return f.createComponent(Ot,f.mergeProps(n,{get children(){return[f.createMemo(()=>t.top),(()=>{var i=Mt();return G(i,()=>t.children),i})(),f.createMemo(()=>t.bottom)]}}))}function kt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,l])=>o+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--columns: ${A(Math.max(e.colCount??e.columns??1,1))??1};`,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>[n(),i(),r(),c()].filter(Boolean).join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","columns","colCount","switchAt"]),h({style:s,"data-bedrock-columns":()=>""})))}const Nt=e=>typeof e=="number"?e:1;function Lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[o,a])=>s+`${o}:${a};`,""),n=()=>`--span: ${Nt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",c=()=>[t(),n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),h({style:c,"data-bedrock-column":()=>""})))}d.Center=nt,d.Column=Lt,d.ColumnDrop=ct,d.Columns=kt,d.Cover=zt,d.Frame=lt,d.Grid=Z,d.Inline=jt,d.InlineCluster=$t,d.MasonryGrid=mt,d.PadBox=xt,d.Reel=Pt,d.Split=Et,d.Stack=It,d.ThemeProvider=it,d.checkIsCSSLength=I,d.createContainerQuery=ot,d.getSafeGutter=O,d.getSizeValue=P,d.getSpacingValue=b,d.sizes=U,d.spacing=q,d.useTheme=$,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock-layout/solid",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Solid Foundational Layout Primitives for your Solid-js App",
|
|
5
5
|
"info": "Solid Bedrock Layout is a Solid.js port of the Bedrock Layout primitives written for react. Bedrock primitives are built to allow you to compose them together to create your own custom layouts. Many 'complex' layouts can be created by composing Bedrock Layout Primitives",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"solid-js": "^1.3.7"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@bedrock-layout/register-resize-callback": "^2.0.
|
|
59
|
+
"@bedrock-layout/register-resize-callback": "^2.0.12"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"bugs": {
|
|
72
72
|
"url": "https://github.com/Bedrock-Layouts/Solid-Bedrock/issues"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "7339d1a74ef75f45c11a13c1bd31bab6fbeedc57"
|
|
75
75
|
}
|