@fluixi/dom 1.0.0-alpha.63 → 1.0.0-alpha.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/dom.cjs +1 -1
- package/dist/cdn/dom.global.js +1 -1
- package/dist/cdn/dom.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/dom/dynamic-element.cjs +1 -0
- package/dist/lib/dom/dynamic-element.d.ts +10 -0
- package/dist/lib/dom/dynamic-element.d.ts.map +1 -0
- package/dist/lib/dom/dynamic-element.js +61 -0
- package/dist/lib/dom/dynamic-element.mjs +1 -0
- package/dist/lib/dom/index.cjs +1 -1
- package/dist/lib/dom/index.mjs +1 -1
- package/dist/lib/dom/runtime.cjs +1 -1
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +3 -9
- package/dist/lib/dom/runtime.mjs +1 -1
- package/dist/lib/element/attributes.cjs +1 -1
- package/dist/lib/element/attributes.d.ts +19 -19
- package/dist/lib/element/attributes.d.ts.map +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/lib/dom/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function nt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ot(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function it(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var st=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),at=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),j="http://www.w3.org/2000/svg";function Te(e){return e.localName.includes("-")}function q(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Te(e)){e[t]=n;return}x(e,t,n,o)}var F=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function oe(e,t=document){return t.querySelector(e)}function ft(e,t=document){return Array.from(t.querySelectorAll(e))}function ut(e,t){return e.closest(t)}function lt(e,...t){e.classList.add(...t)}function ct(e,...t){e.classList.remove(...t)}function dt(e,...t){t.forEach(n=>e.classList.toggle(n))}function pt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function yt(e,t){return e.getAttribute(t)}function mt(e,t){e.removeAttribute(t)}function we(e,t){Object.assign(e.style,t)}function gt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function xt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")we(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ht(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Et(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function bt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Nt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Tt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function wt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function St(e,t=5e3){return new Promise((n,o)=>{let r=oe(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=oe(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function vt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Ct(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function At(e){return typeof e=="object"&&e!==null&&e.$$typeof===Se}function ve(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Rt(e){if(typeof e!="function")return!1;try{let t=e();return ve(t)}catch{return!1}}function Lt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Pt(e){return e instanceof Node}function Mt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _t(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ue,createEffect as A,createRenderEffect as y,createRoot as Me,onCleanup as S,readChildren as _e}from"@fluixi/reactive/signal";var N=typeof document>"u";function Ce(e){N=e}var W=Symbol.for("fluixi.server-node"),re=null;function V(){if(!re)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return re}function C(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function K(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function B(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ie=null;function se(e){ie=e}function G(){return ie}function J(e,t){return l.active&&t.parentNode===e}function X(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ae(){return l.active?l.cursor:null}function Re(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Le(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Pe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&X(t)}function Ie(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function $e(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Kt(e){return $e(Ie(e))}var Bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),De={};var ae=new Map,P=new Set,O=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function le(e){if(!N)for(let t of e)P.has(t)||O.has(t)||(P.add(t),document.addEventListener(t,Oe))}function Oe(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ke(e,t,n){if(e[`$$${t}`]=n,O.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}P.has(t)||le([t])}function fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Gt(e){return!O.has(e)}function Jt(e){return typeof e=="function"}function T(e,t=!1){if(N)return V().createText(e);if(l.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ce(e,t=!1){if(N)return V().createElement(e,t);if(l.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(j,e):document.createElement(e)}function Xt(e,t=!1){let n=ae.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ae.set(e,o),o}function zt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function He(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?He(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ut(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Yt(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var b=0,je=200;function qe(e,t,n,o,r){let f=o,s=new Map;return y(()=>{let i;if(h(e)&&!g(e)){if(!s.has(e)){b++;try{let a=e();s.set(e,a)}finally{b--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;b++;try{let c=u();s.set(u,c)}finally{b--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!h(i))break}b++;try{f=M(t,i,n,f,s),r(f)}finally{b--}})}function R(e,t,n,o){if(b>je)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){b++;try{r=M(e,t,n,null)}finally{b--}return()=>r}let i=qe(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function M(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&M(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=T(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&B(o))return o.data=t,o;let s=T(t);return o&&o.parentNode===e?e.replaceChild(s,o):J(e,s)||m(e,s,n),s}if(C(t))return J(e,t)?(X(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];E(t,s,e,n,!0,r,a);let u=Fe(e,i,s,n);for(let c of a){let d=R(e,c.sig,c.marker);S(()=>{w(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return M(e,a,n,o)}}}return w(e,o,n)}function E(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!g(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!g(u)&&!h(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=T("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?E(c,t,n,o,r,f):E([c],t,n,o,r,f);continue}continue}Array.isArray(u)?E(u,t,n,o,r,f,s):E([u],t,n,o,r,f,s);continue}if(L(a)){let u=T("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(E([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let p=1;p<d.length;p++)u.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){E(a,t,n,o,r,f,s);continue}if(C(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?E(c,t,n,o,!1,f):E([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(T(u));continue}t.push(T(String(a)))}}}}function Fe(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let p=a;for(;p<s;)c.set(n[p],p++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let p=i,H=1;for(;++p<f&&p<s&&!(!c.has(t[p])||c.get(t[p])!==d+H);)H++;if(H>d-a){let Ne=t[i];for(;a<d;)m(e,n[a++],Ne)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function _(e,t,n){n==null?delete e[t]:e[t]=n}function de(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function pe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function z(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):y(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function U(e,t,n){return typeof n!="function"?(_(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;_(e,t,o)})}function ye(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):y(()=>{let o=n();x(e,t,!!o)})}function I(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){A(()=>{I(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(y(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function D(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Zt(e){let{element:t,props:n,prevProps:o=De,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!K(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===j,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){me(u,t);continue}if(a==="use"){pe(t,u);continue}if(a.startsWith("on:")){i.push(de(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(U(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(z(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ye(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(y(()=>I(t,u()))):I(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(y(()=>$(t,u()))):$(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(y(()=>D(t,u()))):D(t,u);continue}if(a.startsWith("on")){let p=a.slice(2).toLowerCase();c&&fe(t,p),u&&ke(t,p,u);continue}let d=F.has(a)||!s&&a in t;typeof u=="function"?i.push(d?U(t,a,u):z(t,a,u,s)):i.push(y(()=>d?_(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();fe(t,u)}else F.has(a)?_(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Qt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){me(r,e);continue}if(o!=="children"){if(o==="use"){pe(e,r);continue}if(o.startsWith("on:")){de(e,o.slice(3),r);continue}if(o.startsWith("prop:")){U(e,o.slice(5),r);continue}if(o.startsWith("attr:")){z(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ye(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(O.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,P.has(f)||le([f]);continue}if(o==="class"||o==="className"){I(e,r);continue}if(o==="classList"){typeof r=="function"?y(()=>$(e,r())):$(e,r);continue}if(o==="style"){typeof r=="function"?y(()=>D(e,r())):D(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});S(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});S(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});S(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=A(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{s()})}else{let f=!0;y(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();q(e,o,s,n)});S(()=>{f()})}else y(()=>q(e,o,t[o],n))}}}function en(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function tn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function me(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function nn(e,t,n){let o=t||document.body,r=_e(()=>e),f=[];return ue(()=>{let s=y(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):C(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),S(()=>{f.forEach(i=>i())})}),null}function on(e){return typeof e=="string"&&e.toLowerCase()===e}function rn(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function sn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function an(e){return typeof e=="function"&&e.length===0&&g(e)}function ge(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return Me(s=>{ue(()=>{l.active||(t.textContent=""),R(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var We="__fx_dom_create_component__",v=globalThis[We]??={fn:null};function un(e){v.fn=e}function ln(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function cn(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var dn=()=>v.fn!==null,pn=()=>v.fn!==null;function yn(){v.fn=null}var k,Ve={getStore:()=>k,run(e,t){let n=k;k=e;try{return t()}finally{k=n}}},Ke=Ve;function xe(){return Ke.getStore()}import{setResourceIdSource as Ge,setServerDataGetter as Je}from"@fluixi/reactive/signal";var Be="__FX_DATA__";var Y;function he(){let e=globalThis.__FX_DATA__;if(e)return e;if(Y!==void 0)return Y;let t=null;if(typeof document<"u"){let n=document.getElementById(Be)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Y=t}function Z(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=typeof process<"u"&&process.env&&!1;function ee(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ze(e){Z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Xe.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(Q&&t&&ee(`<${e}>`,t),null)}function Ue(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}Z();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Q&&t&&ee(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ye(e){Z();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(Q&&t&&ee(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ee=!1;function Ze(){Ee||(Ee=!0,se({hydrateElement:ze,hydrateText:Ue,hydrateMarker:Ye}))}function te(e,t,n){Ze(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=he(),r=n?.resourceNamespace,f=0;Ge(()=>r?`${r}:r${f++}`:`r${f++}`),Je(o?s=>s in o?{value:o[s]}:void 0:null);try{return ge(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ne="fluixi-island";function Qe(e){let{component:t,props:n={},name:o}=e,r=ce(ne),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=N?xe():void 0;if(s){let i=s.nextIslandNamespace(f);R(r,()=>s.withResourceScope(i,()=>t(n)))}else R(r,()=>t(n));return r}var be=!1;function et(){if(be||typeof document>"u")return;be=!0;let e=document.createElement("style");e.textContent=`${ne}{display:contents}`,document.head.appendChild(e)}function tt(e){if(typeof document>"u")return;et();let t=document.querySelectorAll(ne),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}te(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{Qe as Island,F as JSX_PROPERTIES,at as SVG_ELEMENTS,j as SVG_NAMESPACE,st as VOID_ELEMENTS,lt as addClass,ke as addDelegatedEventListener,de as addNativeEventListener,Et as appendChildren,q as applyElementProp,Qt as applyProps,pe as applyUse,Ae as captureHydrationCursor,w as cleanChildren,zt as cloneTemplate,ut as closest,cn as createComponent,xt as createElement,ce as createNativeElement,nn as createPortal,Xt as createTemplate,wt as delegate,le as delegateEvents,sn as escapeHTML,Ut as fnName,Bt as generateID,yt as getAttribute,_t as getGlobal,rt as getLitEventName,Tt as getOffset,Kt as getStableElementId,gt as getStyle,me as handleRef,pt as hasClass,te as hydrate,Pe as hydrateAdvancePast,tt as hydrateIslands,ln as initializeIntegration,R as insert,M as insertExpression,dn as intergartionInitialized,an as isAccessor,Te as isCustomElement,Pt as isDOMNode,Gt as isDelegatedEvent,K as isDomElement,C as isDomNode,B as isDomText,ot as isEventHandler,Jt as isFunction,pn as isIntegrationInitialized,Lt as isJSXTemplate,ve as isLitTemplateResult,on as isNativeElement,L as isPromise,At as isReactElement,rn as isSVGElement,N as isServer,Rt as isTemplateFactory,bt as isVisible,Yt as iterateFn,He as makeArrayFlat,en as mergeProps,vt as observeIntersection,Ct as observeResize,oe as query,ft as queryAll,un as registerCreateComponent,Mt as registerGlobal,mt as removeAttribute,ht as removeChildren,ct as removeClass,fe as removeDelegatedEventListener,ge as render,yn as resetIntegration,Re as runHydrationAt,Le as runWithoutHydration,Nt as scrollIntoView,x as setAttribute,$ as setClassList,I as setClassName,z as setDynamicAttribute,ye as setDynamicBoolAttribute,U as setDynamicProperty,_ as setProperty,Ce as setServerMode,D as setStyle,we as setStyles,it as shouldSetAsProperty,tn as splitProps,Zt as spread,nt as toAttributeName,dt as toggleClass,St as waitForElement};
|
|
1
|
+
function nt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ot(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function it(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var st=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),at=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),j="http://www.w3.org/2000/svg";function Te(e){return e.localName.includes("-")}function q(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Te(e)){e[t]=n;return}x(e,t,n,o)}var F=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function oe(e,t=document){return t.querySelector(e)}function ft(e,t=document){return Array.from(t.querySelectorAll(e))}function ut(e,t){return e.closest(t)}function lt(e,...t){e.classList.add(...t)}function ct(e,...t){e.classList.remove(...t)}function dt(e,...t){t.forEach(n=>e.classList.toggle(n))}function pt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function yt(e,t){return e.getAttribute(t)}function mt(e,t){e.removeAttribute(t)}function we(e,t){Object.assign(e.style,t)}function gt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function xt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")we(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ht(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Et(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function bt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Nt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Tt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function wt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function St(e,t=5e3){return new Promise((n,o)=>{let r=oe(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=oe(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function vt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Ct(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function At(e){return typeof e=="object"&&e!==null&&e.$$typeof===Se}function ve(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Rt(e){if(typeof e!="function")return!1;try{let t=e();return ve(t)}catch{return!1}}function Lt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Pt(e){return e instanceof Node}function Mt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _t(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ue,createEffect as A,createRenderEffect as p,createRoot as Me,onCleanup as S,readChildren as _e}from"@fluixi/reactive/signal";var N=typeof document>"u";function Ce(e){N=e}var W=Symbol.for("fluixi.server-node"),re=null;function V(){if(!re)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return re}function C(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function K(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function B(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ie=null;function se(e){ie=e}function G(){return ie}function J(e,t){return l.active&&t.parentNode===e}function X(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ae(){return l.active?l.cursor:null}function Re(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Le(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Pe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&X(t)}function Ie(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function $e(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Kt(e){return $e(Ie(e))}var Bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),De={};var ae=new Map,P=new Set,O=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function le(e){if(!N)for(let t of e)P.has(t)||O.has(t)||(P.add(t),document.addEventListener(t,Oe))}function Oe(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ke(e,t,n){if(e[`$$${t}`]=n,O.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}P.has(t)||le([t])}function fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Gt(e){return!O.has(e)}function Jt(e){return typeof e=="function"}function T(e,t=!1){if(N)return V().createText(e);if(l.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ce(e,t=!1){if(N)return V().createElement(e,t);if(l.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(j,e):document.createElement(e)}function Xt(e,t=!1){let n=ae.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ae.set(e,o),o}function zt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function He(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?He(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ut(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Yt(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var b=0,je=200;function qe(e,t,n,o,r){let f=o,s=new Map;return p(()=>{let i;if(h(e)&&!g(e)){if(!s.has(e)){b++;try{let a=e();s.set(e,a)}finally{b--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;b++;try{let c=u();s.set(u,c)}finally{b--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!h(i))break}b++;try{f=M(t,i,n,f,s),r(f)}finally{b--}})}function R(e,t,n,o){if(b>je)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){b++;try{r=M(e,t,n,null)}finally{b--}return()=>r}let i=qe(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function M(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&M(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=T(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&B(o))return o.data=t,o;let s=T(t);return o&&o.parentNode===e?e.replaceChild(s,o):J(e,s)||m(e,s,n),s}if(C(t))return J(e,t)?(X(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];E(t,s,e,n,!0,r,a);let u=Fe(e,i,s,n);for(let c of a){let d=R(e,c.sig,c.marker);S(()=>{w(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return M(e,a,n,o)}}}return w(e,o,n)}function E(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!g(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!g(u)&&!h(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=T("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?E(c,t,n,o,r,f):E([c],t,n,o,r,f);continue}continue}Array.isArray(u)?E(u,t,n,o,r,f,s):E([u],t,n,o,r,f,s);continue}if(L(a)){let u=T("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(E([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){E(a,t,n,o,r,f,s);continue}if(C(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?E(c,t,n,o,!1,f):E([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(T(u));continue}t.push(T(String(a)))}}}}function Fe(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let y=a;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let y=i,H=1;for(;++y<f&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+H);)H++;if(H>d-a){let Ne=t[i];for(;a<d;)m(e,n[a++],Ne)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function _(e,t,n){n==null?delete e[t]:e[t]=n}function de(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function pe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function z(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):p(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function U(e,t,n){return typeof n!="function"?(_(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;_(e,t,o)})}function ye(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let o=n();x(e,t,!!o)})}function I(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>I(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(p(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function D(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Zt(e){let{element:t,props:n,prevProps:o=De,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!K(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===j,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){me(u,t);continue}if(a==="use"){pe(t,u);continue}if(a.startsWith("on:")){i.push(de(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(U(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(z(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ye(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(p(()=>I(t,u()))):I(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(p(()=>$(t,u()))):$(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(p(()=>D(t,u()))):D(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();c&&fe(t,y),u&&ke(t,y,u);continue}let d=F.has(a)||!s&&a in t;typeof u=="function"?i.push(d?U(t,a,u):z(t,a,u,s)):i.push(p(()=>d?_(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();fe(t,u)}else F.has(a)?_(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Qt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){me(r,e);continue}if(o!=="children"){if(o==="use"){pe(e,r);continue}if(o.startsWith("on:")){de(e,o.slice(3),r);continue}if(o.startsWith("prop:")){U(e,o.slice(5),r);continue}if(o.startsWith("attr:")){z(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ye(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(O.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,P.has(f)||le([f]);continue}if(o==="class"||o==="className"){I(e,r);continue}if(o==="classList"){typeof r=="function"?p(()=>$(e,r())):$(e,r);continue}if(o==="style"){typeof r=="function"?p(()=>D(e,r())):D(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});S(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=A(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{s()})}else{let f=!0;p(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();q(e,o,s,n)});S(()=>{f()})}else p(()=>q(e,o,t[o],n))}}}function en(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function tn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function me(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function nn(e,t,n){let o=t||document.body,r=_e(()=>e),f=[];return ue(()=>{let s=p(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):C(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),S(()=>{f.forEach(i=>i())})}),null}function on(e){return typeof e=="string"&&e.toLowerCase()===e}function rn(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function sn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function an(e){return typeof e=="function"&&e.length===0&&g(e)}function ge(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return Me(s=>{ue(()=>{l.active||(t.textContent=""),R(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var We="__fx_dom_create_component__",v=globalThis[We]??={fn:null};function un(e){v.fn=e}function ln(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function cn(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var dn=()=>v.fn!==null,pn=()=>v.fn!==null;function yn(){v.fn=null}var k,Ve={getStore:()=>k,run(e,t){let n=k;k=e;try{return t()}finally{k=n}}},Ke=Ve;function xe(){return Ke.getStore()}import{setResourceIdSource as Ge,setServerDataGetter as Je}from"@fluixi/reactive/signal";var Be="__FX_DATA__";var Y;function he(){let e=globalThis.__FX_DATA__;if(e)return e;if(Y!==void 0)return Y;let t=null;if(typeof document<"u"){let n=document.getElementById(Be)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Y=t}function Z(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=typeof process<"u"&&process.env&&!1;function ee(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ze(e){Z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Xe.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(Q&&t&&ee(`<${e}>`,t),null)}function Ue(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}Z();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Q&&t&&ee(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ye(e){Z();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(Q&&t&&ee(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ee=!1;function Ze(){Ee||(Ee=!0,se({hydrateElement:ze,hydrateText:Ue,hydrateMarker:Ye}))}function te(e,t,n){Ze(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=he(),r=n?.resourceNamespace,f=0;Ge(()=>r?`${r}:r${f++}`:`r${f++}`),Je(o?s=>s in o?{value:o[s]}:void 0:null);try{return ge(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ne="fluixi-island";function Qe(e){let{component:t,props:n={},name:o}=e,r=ce(ne),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=N?xe():void 0;if(s){let i=s.nextIslandNamespace(f);R(r,()=>s.withResourceScope(i,()=>t(n)))}else R(r,()=>t(n));return r}var be=!1;function et(){if(be||typeof document>"u")return;be=!0;let e=document.createElement("style");e.textContent=`${ne}{display:contents}`,document.head.appendChild(e)}function tt(e){if(typeof document>"u")return;et();let t=document.querySelectorAll(ne),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}te(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{Qe as Island,F as JSX_PROPERTIES,at as SVG_ELEMENTS,j as SVG_NAMESPACE,st as VOID_ELEMENTS,lt as addClass,ke as addDelegatedEventListener,de as addNativeEventListener,Et as appendChildren,q as applyElementProp,Qt as applyProps,pe as applyUse,Ae as captureHydrationCursor,w as cleanChildren,zt as cloneTemplate,ut as closest,cn as createComponent,xt as createElement,ce as createNativeElement,nn as createPortal,Xt as createTemplate,wt as delegate,le as delegateEvents,sn as escapeHTML,Ut as fnName,Bt as generateID,yt as getAttribute,_t as getGlobal,rt as getLitEventName,Tt as getOffset,Kt as getStableElementId,gt as getStyle,me as handleRef,pt as hasClass,te as hydrate,Pe as hydrateAdvancePast,tt as hydrateIslands,ln as initializeIntegration,R as insert,M as insertExpression,dn as intergartionInitialized,an as isAccessor,Te as isCustomElement,Pt as isDOMNode,Gt as isDelegatedEvent,K as isDomElement,C as isDomNode,B as isDomText,ot as isEventHandler,Jt as isFunction,pn as isIntegrationInitialized,Lt as isJSXTemplate,ve as isLitTemplateResult,on as isNativeElement,L as isPromise,At as isReactElement,rn as isSVGElement,N as isServer,Rt as isTemplateFactory,bt as isVisible,Yt as iterateFn,He as makeArrayFlat,en as mergeProps,vt as observeIntersection,Ct as observeResize,oe as query,ft as queryAll,un as registerCreateComponent,Mt as registerGlobal,mt as removeAttribute,ht as removeChildren,ct as removeClass,fe as removeDelegatedEventListener,ge as render,yn as resetIntegration,Re as runHydrationAt,Le as runWithoutHydration,Nt as scrollIntoView,x as setAttribute,$ as setClassList,I as setClassName,z as setDynamicAttribute,ye as setDynamicBoolAttribute,U as setDynamicProperty,_ as setProperty,Ce as setServerMode,D as setStyle,we as setStyles,it as shouldSetAsProperty,tn as splitProps,Zt as spread,nt as toAttributeName,dt as toggleClass,St as waitForElement};
|
package/dist/lib/dom/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ae=(e,t)=>{for(var n in t)_(e,n,{get:t[n],enumerable:!0})},ue=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of se(t))!fe.call(e,f)&&f!==n&&_(e,f,{get:()=>t[f],enumerable:!(o=re(t,f))||o.enumerable});return e};var le=e=>ue(_({},"__esModule",{value:!0}),e);var We={};ae(We,{addDelegatedEventListener:()=>ne,addNativeEventListener:()=>X,applyProps:()=>Me,applyUse:()=>z,cleanChildren:()=>b,cloneTemplate:()=>we,createNativeElement:()=>Ne,createPortal:()=>He,createTemplate:()=>Te,delegateEvents:()=>q,escapeHTML:()=>_e,fnName:()=>Se,generateID:()=>he,getStableElementId:()=>ge,handleRef:()=>U,insert:()=>G,insertExpression:()=>A,isAccessor:()=>De,isDelegatedEvent:()=>Ee,isFunction:()=>be,isNativeElement:()=>je,isPromise:()=>S,isSVGElement:()=>$e,iterateFn:()=>Ae,makeArrayFlat:()=>oe,mergeProps:()=>Re,removeDelegatedEventListener:()=>B,render:()=>Fe,setClassList:()=>C,setClassName:()=>L,setDynamicAttribute:()=>O,setDynamicBoolAttribute:()=>J,setDynamicProperty:()=>H,setProperty:()=>v,setStyle:()=>P,splitProps:()=>Oe,spread:()=>Pe});module.exports=le(We);var p=require("@fluixi/reactive/signal");var D="http://www.w3.org/2000/svg";function ce(e){return e.localName.includes("-")}function F(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ce(e)){e[t]=n;return}T(e,t,n,o)}var W=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var ke=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var l=require("@fluixi/reactive/signal");var M=typeof document>"u";var I=Symbol.for("fluixi.server-node"),Y=null;function k(){if(!Y)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Y}function w(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function Z(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Q(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var x={active:!1,cursor:null,parents:[]},de=null;function V(){return de}function K(e,t){return x.active&&t.parentNode===e}function ee(e){let t=x.parents.lastIndexOf(e);t!==-1&&(x.parents.length=t),x.cursor=e.nextSibling}function ye(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,f=e;for(;f=f.previousElementSibling;)f.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function pe(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function ge(e){return pe(ye(e))}var he=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),xe={};var te=new Map,R=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function q(e){if(!M)for(let t of e)R.has(t)||j.has(t)||(R.add(t),document.addEventListener(t,me))}function me(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ne(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let f=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,f),e[o]=f}return}R.has(t)||q([t])}function B(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Ee(e){return!j.has(e)}function be(e){return typeof e=="function"}function N(e,t=!1){if(M)return k().createText(e);if(x.active&&!t){let n=V()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ne(e,t=!1){if(M)return k().createElement(e,t);if(x.active){let n=V()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(D,e):document.createElement(e)}function Te(e,t=!1){let n=te.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,te.set(e,o),o}function we(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function oe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?oe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Se(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ae(e){if((0,p.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,p.isSignal)(t)&&!h(t);)t=t();return t}var E=0,ve=200;function Le(e,t,n,o,f){let a=o,s=new Map;return(0,l.createRenderEffect)(()=>{let r;if(h(e)&&!(0,p.isSignal)(e)){if(!s.has(e)){E++;try{let i=e();s.set(e,i)}finally{E--}}for(r=s.get(e);typeof r=="function"&&(0,p.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,p.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!s.has(r)){let u=r;E++;try{let c=u();s.set(u,c)}finally{E--}}r=s.get(r)}else if((0,p.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,p.isSignal)(r)&&!h(r))break}E++;try{a=A(t,r,n,a,s),f(a)}finally{E--}})}function G(e,t,n,o){if(E>ve)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=N("",!0),e.appendChild(n));let f=o??null,a=i=>Array.isArray(i)&&i.some(u=>typeof u=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{f=A(e,t,n,null)}finally{E--}return()=>f}let r=Le(s(t),e,n,f,i=>{f=i});return()=>(r?.(),f)}function A(e,t,n,o,f){if(t==null||typeof t=="boolean")return b(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return b(e,o,n);if(S(t)){let s=N("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),b(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(r=>{s.parentNode===e&&A(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=N(t);return g(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=b(e,o,n)}if(o&&Q(o))return o.data=t,o;let s=N(t);return o&&o.parentNode===e?e.replaceChild(s,o):K(e,s)||g(e,s,n),s}if(w(t))return K(e,t)?(ee(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),b(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,s,e,n,!0,f,i);let u=Ce(e,r,s,n);for(let c of i){let d=G(e,c.sig,c.marker);(0,l.onCleanup)(()=>{b(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return A(e,i,n,o)}}}return b(e,o,n)}function m(e,t,n,o,f=!0,a,s){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!S(i)&&!(0,p.isSignal)(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let u;for(h(i)&&!(0,p.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),u=a.get(i)):u=i();typeof u=="function"&&!S(u)&&!(0,p.isSignal)(u)&&!h(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,p.isSignal)(u)){if(s){let d=N("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&(0,p.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?m(c,t,n,o,f,a):m([c],t,n,o,f,a);continue}continue}Array.isArray(u)?m(u,t,n,o,f,a,s):m([u],t,n,o,f,a,s);continue}if(S(i)){let u=N("",!0);t.push(u),i.then(c=>{if(u.parentNode){let d=[];if(m([c],d,u.parentNode,void 0,!1,a),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){m(i,t,n,o,f,a,s);continue}if(w(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let u=i;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?m(c,t,n,o,!1,a):m([c],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let u=String(i);if(u.trim()===""&&u!==" ")continue;t.push(N(u));continue}t.push(N(String(i)))}}}}function Ce(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let f=n.length,a=t.length,s=f,r=0,i=0,u=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&t[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<f?i?n[i-1].nextSibling??void 0:n[s-i]:u;for(;i<s;)g(e,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[s-1]&&n[i]===t[a-1]){let d=t[--a].nextSibling;g(e,n[i++],t[r++].nextSibling),g(e,n[--s],d),t[a]=t[r-1]}else{if(!c){c=new Map;let y=i;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[r]);if(d!=null)if(i<d&&d<s){let y=r,$=1;for(;++y<a&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+$);)$++;if($>d-i){let ie=t[r];for(;i<d;)g(e,n[i++],ie)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(g(e,n[i++],u),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function b(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){x.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function v(e,t,n){n==null?delete e[t]:e[t]=n}function X(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function z(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function O(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,l.createRenderEffect)(()=>{let f=typeof n=="function"?n():n;T(e,t,f,o)})}function H(e,t,n){return typeof n!="function"?(v(e,t,n),()=>{}):(0,l.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;v(e,t,o)})}function J(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,l.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,l.createEffect)(()=>{L(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function C(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push((0,l.createRenderEffect)(()=>{let s=!!f();for(let r of a)e.classList.toggle(r,s)}));else{let s=!!(typeof f=="function"?f():f);for(let r of a)e.classList.toggle(r,s)}}}function P(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function Pe(e){let{element:t,props:n,prevProps:o=xe,isSVG:f=!1,skipChildren:a=!1}=e;if(!t||!Z(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=f||t.namespaceURI===D,r=[];for(let i in n){if(a&&i==="children")continue;let u=n[i],c=o[i];if(u===c)continue;if(i==="ref"){U(u,t);continue}if(i==="use"){z(t,u);continue}if(i.startsWith("on:")){r.push(X(t,i.slice(3),u));continue}if(i.startsWith("prop:")){r.push(H(t,i.slice(5),u));continue}if(i.startsWith("attr:")){r.push(O(t,i.slice(5),u,s));continue}if(i.startsWith("bool:")){r.push(J(t,i.slice(5),u));continue}if(i==="class"||i==="className"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>L(t,u()))):L(t,u);continue}if(i==="classList"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>C(t,u()))):C(t,u,r);continue}if(i==="style"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>P(t,u()))):P(t,u);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();c&&B(t,y),u&&ne(t,y,u);continue}let d=W.has(i)||!s&&i in t;typeof u=="function"?r.push(d?H(t,i,u):O(t,i,u,s)):r.push((0,l.createRenderEffect)(()=>d?v(t,i,n[i]):T(t,i,n[i],s)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let u=i.slice(2).toLowerCase();B(t,u)}else W.has(i)?v(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Me(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){U(f,e);continue}if(o!=="children"){if(o==="use"){z(e,f);continue}if(o.startsWith("on:")){X(e,o.slice(3),f);continue}if(o.startsWith("prop:")){H(e,o.slice(5),f);continue}if(o.startsWith("attr:")){O(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){J(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(j.has(a)){e[`$$${a}`]=f;let s=`__fx_${a}`;if(!e[s]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[s]=r}}else e[`$$${a}`]=f,R.has(a)||q([a]);continue}if(o==="class"||o==="className"){L(e,f);continue}if(o==="classList"){typeof f=="function"?(0,l.createRenderEffect)(()=>C(e,f())):C(e,f);continue}if(o==="style"){typeof f=="function"?(0,l.createRenderEffect)(()=>P(e,f())):P(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,l.onCleanup)(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,s=(0,l.createEffect)(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});(0,l.onCleanup)(()=>{s()})}else{let a=!0;(0,l.createRenderEffect)(()=>{let s=t[o];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();F(e,o,s,n)});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>F(e,o,t[o],n))}}}function Re(...e){let t=o=>{for(let f=e.length-1;f>=0;f--){let a=e[f];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let f of e)if(f&&o in f)return!0;return!1};return new Proxy({},{get:(o,f)=>t(f),has:(o,f)=>n(f),ownKeys:()=>{let o=new Set;for(let f of e)if(f)for(let a of Reflect.ownKeys(f))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,f)=>n(f)?{enumerable:!0,configurable:!0,get:()=>t(f)}:void 0})}function Oe(e,...t){let n=new Set;for(let s of t)for(let r of s)n.add(r);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),f=t.map(s=>{let r=new Set(s);return new Proxy({},{get:(i,u)=>r.has(u)?e[u]:void 0,has:(i,u)=>r.has(u)&&u in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,u)=>r.has(u)&&u in e?o(u):void 0})}),a=new Proxy({},{get:(s,r)=>n.has(r)?void 0:e[r],has:(s,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,r)=>!n.has(r)&&r in e?o(r):void 0});return[...f,a]}function U(e,t){if(e){if(w(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function He(e,t,n){let o=t||document.body,f=(0,l.readChildren)(()=>e),a=[];return(0,l.batch)(()=>{let s=(0,l.createRenderEffect)(()=>{let r=f();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):w(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(s),(0,l.onCleanup)(()=>{a.forEach(r=>r())})}),null}function je(e){return typeof e=="string"&&e.toLowerCase()===e}function $e(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function _e(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function De(e){return typeof e=="function"&&e.length===0&&(0,p.isSignal)(e)}function Fe(e,t,n){if(!t)throw new Error("Container element is required");let o,f,a=[];return(0,l.createRoot)(s=>{(0,l.batch)(()=>{x.active||(t.textContent=""),G(t,e)}),f=s}),()=>{f?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}
|
|
1
|
+
"use strict";var _=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ae=(e,t)=>{for(var n in t)_(e,n,{get:t[n],enumerable:!0})},ue=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of se(t))!fe.call(e,f)&&f!==n&&_(e,f,{get:()=>t[f],enumerable:!(o=re(t,f))||o.enumerable});return e};var le=e=>ue(_({},"__esModule",{value:!0}),e);var We={};ae(We,{addDelegatedEventListener:()=>ne,addNativeEventListener:()=>X,applyProps:()=>Me,applyUse:()=>z,cleanChildren:()=>b,cloneTemplate:()=>we,createNativeElement:()=>Ne,createPortal:()=>He,createTemplate:()=>Te,delegateEvents:()=>q,escapeHTML:()=>_e,fnName:()=>Se,generateID:()=>he,getStableElementId:()=>ge,handleRef:()=>U,insert:()=>G,insertExpression:()=>A,isAccessor:()=>De,isDelegatedEvent:()=>Ee,isFunction:()=>be,isNativeElement:()=>je,isPromise:()=>S,isSVGElement:()=>$e,iterateFn:()=>Ae,makeArrayFlat:()=>oe,mergeProps:()=>Re,removeDelegatedEventListener:()=>B,render:()=>Fe,setClassList:()=>C,setClassName:()=>L,setDynamicAttribute:()=>O,setDynamicBoolAttribute:()=>J,setDynamicProperty:()=>H,setProperty:()=>v,setStyle:()=>P,splitProps:()=>Oe,spread:()=>Pe});module.exports=le(We);var p=require("@fluixi/reactive/signal");var D="http://www.w3.org/2000/svg";function ce(e){return e.localName.includes("-")}function F(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ce(e)){e[t]=n;return}T(e,t,n,o)}var W=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var ke=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var l=require("@fluixi/reactive/signal");var M=typeof document>"u";var I=Symbol.for("fluixi.server-node"),Y=null;function k(){if(!Y)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Y}function w(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function Z(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Q(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var x={active:!1,cursor:null,parents:[]},de=null;function V(){return de}function K(e,t){return x.active&&t.parentNode===e}function ee(e){let t=x.parents.lastIndexOf(e);t!==-1&&(x.parents.length=t),x.cursor=e.nextSibling}function ye(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,f=e;for(;f=f.previousElementSibling;)f.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function pe(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function ge(e){return pe(ye(e))}var he=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),xe={};var te=new Map,R=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function q(e){if(!M)for(let t of e)R.has(t)||j.has(t)||(R.add(t),document.addEventListener(t,me))}function me(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ne(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let f=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,f),e[o]=f}return}R.has(t)||q([t])}function B(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Ee(e){return!j.has(e)}function be(e){return typeof e=="function"}function N(e,t=!1){if(M)return k().createText(e);if(x.active&&!t){let n=V()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ne(e,t=!1){if(M)return k().createElement(e,t);if(x.active){let n=V()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(D,e):document.createElement(e)}function Te(e,t=!1){let n=te.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,te.set(e,o),o}function we(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function oe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?oe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Se(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ae(e){if((0,p.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,p.isSignal)(t)&&!h(t);)t=t();return t}var E=0,ve=200;function Le(e,t,n,o,f){let a=o,s=new Map;return(0,l.createRenderEffect)(()=>{let r;if(h(e)&&!(0,p.isSignal)(e)){if(!s.has(e)){E++;try{let i=e();s.set(e,i)}finally{E--}}for(r=s.get(e);typeof r=="function"&&(0,p.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,p.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!s.has(r)){let u=r;E++;try{let c=u();s.set(u,c)}finally{E--}}r=s.get(r)}else if((0,p.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,p.isSignal)(r)&&!h(r))break}E++;try{a=A(t,r,n,a,s),f(a)}finally{E--}})}function G(e,t,n,o){if(E>ve)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=N("",!0),e.appendChild(n));let f=o??null,a=i=>Array.isArray(i)&&i.some(u=>typeof u=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{f=A(e,t,n,null)}finally{E--}return()=>f}let r=Le(s(t),e,n,f,i=>{f=i});return()=>(r?.(),f)}function A(e,t,n,o,f){if(t==null||typeof t=="boolean")return b(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return b(e,o,n);if(S(t)){let s=N("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),b(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(r=>{s.parentNode===e&&A(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=N(t);return g(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=b(e,o,n)}if(o&&Q(o))return o.data=t,o;let s=N(t);return o&&o.parentNode===e?e.replaceChild(s,o):K(e,s)||g(e,s,n),s}if(w(t))return K(e,t)?(ee(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),b(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,s,e,n,!0,f,i);let u=Ce(e,r,s,n);for(let c of i){let d=G(e,c.sig,c.marker);(0,l.onCleanup)(()=>{b(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return A(e,i,n,o)}}}return b(e,o,n)}function m(e,t,n,o,f=!0,a,s){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!S(i)&&!(0,p.isSignal)(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let u;for(h(i)&&!(0,p.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),u=a.get(i)):u=i();typeof u=="function"&&!S(u)&&!(0,p.isSignal)(u)&&!h(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,p.isSignal)(u)){if(s){let d=N("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&(0,p.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?m(c,t,n,o,f,a):m([c],t,n,o,f,a);continue}continue}Array.isArray(u)?m(u,t,n,o,f,a,s):m([u],t,n,o,f,a,s);continue}if(S(i)){let u=N("",!0);t.push(u),i.then(c=>{if(u.parentNode){let d=[];if(m([c],d,u.parentNode,void 0,!1,a),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){m(i,t,n,o,f,a,s);continue}if(w(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let u=i;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?m(c,t,n,o,!1,a):m([c],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let u=String(i);if(u.trim()===""&&u!==" ")continue;t.push(N(u));continue}t.push(N(String(i)))}}}}function Ce(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let f=n.length,a=t.length,s=f,r=0,i=0,u=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&t[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<f?i?n[i-1].nextSibling??void 0:n[s-i]:u;for(;i<s;)g(e,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[s-1]&&n[i]===t[a-1]){let d=t[--a].nextSibling;g(e,n[i++],t[r++].nextSibling),g(e,n[--s],d),t[a]=t[r-1]}else{if(!c){c=new Map;let y=i;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[r]);if(d!=null)if(i<d&&d<s){let y=r,$=1;for(;++y<a&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+$);)$++;if($>d-i){let ie=t[r];for(;i<d;)g(e,n[i++],ie)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(g(e,n[i++],u),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function b(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){x.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function v(e,t,n){n==null?delete e[t]:e[t]=n}function X(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function z(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function O(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,l.createRenderEffect)(()=>{let f=typeof n=="function"?n():n;T(e,t,f,o)})}function H(e,t,n){return typeof n!="function"?(v(e,t,n),()=>{}):(0,l.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;v(e,t,o)})}function J(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,l.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,l.createRenderEffect)(()=>L(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function C(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push((0,l.createRenderEffect)(()=>{let s=!!f();for(let r of a)e.classList.toggle(r,s)}));else{let s=!!(typeof f=="function"?f():f);for(let r of a)e.classList.toggle(r,s)}}}function P(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function Pe(e){let{element:t,props:n,prevProps:o=xe,isSVG:f=!1,skipChildren:a=!1}=e;if(!t||!Z(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=f||t.namespaceURI===D,r=[];for(let i in n){if(a&&i==="children")continue;let u=n[i],c=o[i];if(u===c)continue;if(i==="ref"){U(u,t);continue}if(i==="use"){z(t,u);continue}if(i.startsWith("on:")){r.push(X(t,i.slice(3),u));continue}if(i.startsWith("prop:")){r.push(H(t,i.slice(5),u));continue}if(i.startsWith("attr:")){r.push(O(t,i.slice(5),u,s));continue}if(i.startsWith("bool:")){r.push(J(t,i.slice(5),u));continue}if(i==="class"||i==="className"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>L(t,u()))):L(t,u);continue}if(i==="classList"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>C(t,u()))):C(t,u,r);continue}if(i==="style"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>P(t,u()))):P(t,u);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();c&&B(t,y),u&&ne(t,y,u);continue}let d=W.has(i)||!s&&i in t;typeof u=="function"?r.push(d?H(t,i,u):O(t,i,u,s)):r.push((0,l.createRenderEffect)(()=>d?v(t,i,n[i]):T(t,i,n[i],s)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let u=i.slice(2).toLowerCase();B(t,u)}else W.has(i)?v(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Me(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){U(f,e);continue}if(o!=="children"){if(o==="use"){z(e,f);continue}if(o.startsWith("on:")){X(e,o.slice(3),f);continue}if(o.startsWith("prop:")){H(e,o.slice(5),f);continue}if(o.startsWith("attr:")){O(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){J(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(j.has(a)){e[`$$${a}`]=f;let s=`__fx_${a}`;if(!e[s]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[s]=r}}else e[`$$${a}`]=f,R.has(a)||q([a]);continue}if(o==="class"||o==="className"){L(e,f);continue}if(o==="classList"){typeof f=="function"?(0,l.createRenderEffect)(()=>C(e,f())):C(e,f);continue}if(o==="style"){typeof f=="function"?(0,l.createRenderEffect)(()=>P(e,f())):P(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,l.onCleanup)(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,s=(0,l.createEffect)(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});(0,l.onCleanup)(()=>{s()})}else{let a=!0;(0,l.createRenderEffect)(()=>{let s=t[o];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();F(e,o,s,n)});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>F(e,o,t[o],n))}}}function Re(...e){let t=o=>{for(let f=e.length-1;f>=0;f--){let a=e[f];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let f of e)if(f&&o in f)return!0;return!1};return new Proxy({},{get:(o,f)=>t(f),has:(o,f)=>n(f),ownKeys:()=>{let o=new Set;for(let f of e)if(f)for(let a of Reflect.ownKeys(f))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,f)=>n(f)?{enumerable:!0,configurable:!0,get:()=>t(f)}:void 0})}function Oe(e,...t){let n=new Set;for(let s of t)for(let r of s)n.add(r);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),f=t.map(s=>{let r=new Set(s);return new Proxy({},{get:(i,u)=>r.has(u)?e[u]:void 0,has:(i,u)=>r.has(u)&&u in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,u)=>r.has(u)&&u in e?o(u):void 0})}),a=new Proxy({},{get:(s,r)=>n.has(r)?void 0:e[r],has:(s,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,r)=>!n.has(r)&&r in e?o(r):void 0});return[...f,a]}function U(e,t){if(e){if(w(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function He(e,t,n){let o=t||document.body,f=(0,l.readChildren)(()=>e),a=[];return(0,l.batch)(()=>{let s=(0,l.createRenderEffect)(()=>{let r=f();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):w(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(s),(0,l.onCleanup)(()=>{a.forEach(r=>r())})}),null}function je(e){return typeof e=="string"&&e.toLowerCase()===e}function $e(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function _e(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function De(e){return typeof e=="function"&&e.length===0&&(0,p.isSignal)(e)}function Fe(e,t,n){if(!t)throw new Error("Container element is required");let o,f,a=[];return(0,l.createRoot)(s=>{(0,l.batch)(()=>{x.active||(t.textContent=""),G(t,e)}),f=s}),()=>{f?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuEH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAEtD;AACD,eAAO,MAAM,UAAU,cAMtB,CAAC;AAMF,KAAK,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAE3B,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAChC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,QAAQ,GAChB,IAAI,GACJ,IAAI,EAAE,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,CAAC,MAAM,GAAG,CAAC,CAAC;AAyBhB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAOzD;AAmBD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAMD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAExD;AAuBD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,OAAO,CASvE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,mBAAmB,CAS/E;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,UAAQ,GACZ,gBAAgB,GAAG,OAAO,CAI5B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAS1C;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,QAAQ,OAGlC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAkBxC;AA8FD,wBAAgB,MAAM,CACpB,MAAM,EAAE,IAAI,EACZ,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,EAC/C,MAAM,CAAC,EAAE,IAAI,EACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,GAC1B,CAAC,MAAM,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,CAsCvD;AAMD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,QAAQ,EACf,MAAM,CAAC,EAAE,IAAI,EACb,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAC9B,cAAc,CAAC,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,GAClC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CA2JtB;AA0RD,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,EACZ,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAC9B,MAAM,CAAC,EAAE,IAAI,GACZ,IAAI,CAYN;AA2BD,wBAAgB,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAGxE;AAED;;;;;GAKG;AACH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,IAAI,CAO7F;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAY3D;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,GAAG,EACb,KAAK,UAAQ,GACZ,MAAM,IAAI,CASZ;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,MAAM,IAAI,CASxF;AAID,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,MAAM,IAAI,CASjG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuEH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAEtD;AACD,eAAO,MAAM,UAAU,cAMtB,CAAC;AAMF,KAAK,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAE3B,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAChC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,QAAQ,GAChB,IAAI,GACJ,IAAI,EAAE,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,CAAC,MAAM,GAAG,CAAC,CAAC;AAyBhB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAOzD;AAmBD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAMD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAExD;AAuBD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,OAAO,CASvE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,mBAAmB,CAS/E;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,UAAQ,GACZ,gBAAgB,GAAG,OAAO,CAI5B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAS1C;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,QAAQ,OAGlC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAkBxC;AA8FD,wBAAgB,MAAM,CACpB,MAAM,EAAE,IAAI,EACZ,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,EAC/C,MAAM,CAAC,EAAE,IAAI,EACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,GAC1B,CAAC,MAAM,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,CAsCvD;AAMD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,QAAQ,EACf,MAAM,CAAC,EAAE,IAAI,EACb,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAC9B,cAAc,CAAC,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,GAClC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CA2JtB;AA0RD,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,EACZ,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAC9B,MAAM,CAAC,EAAE,IAAI,GACZ,IAAI,CAYN;AA2BD,wBAAgB,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAGxE;AAED;;;;;GAKG;AACH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,IAAI,CAO7F;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAY3D;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,GAAG,EACb,KAAK,UAAQ,GACZ,MAAM,IAAI,CASZ;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,MAAM,IAAI,CASxF;AAID,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,MAAM,IAAI,CASjG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CA8B/D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAC5B,IAAI,CAiBN;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAexD;AAMD,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,IAAI,CA8IzD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,UAAQ,GAAG,IAAI,CA2K5F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CA4BxE;AAED,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI;KAC1C,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAClE,KAAK,EAAE,CAAC,EACR,GAAG,IAAI,EAAE,CAAC,GACT,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CA8BlD;AAQD,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAe1D;AAMD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,QAgDpE;AAKD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMjD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAOnD;AAMD,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAE9D;AAED,mGAAmG;AACnG,wBAAgB,MAAM,CAAC,CAAC,EACtB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,GAAG,GACZ,MAAM,IAAI,CAkCZ"}
|
package/dist/lib/dom/runtime.js
CHANGED
|
@@ -921,17 +921,11 @@ export function setClassName(element, value) {
|
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
923
|
if (typeof value === 'function') {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
// element.setAttribute('class', value());
|
|
928
|
-
});
|
|
924
|
+
// A render effect, like every other attribute binding — `spread` already wraps
|
|
925
|
+
// class this way, so going through `applyProps` shouldn't schedule it later.
|
|
926
|
+
createRenderEffect(() => setClassName(element, value()));
|
|
929
927
|
return;
|
|
930
928
|
}
|
|
931
|
-
// if (typeof value === 'function') {
|
|
932
|
-
// setClassName(element, value());
|
|
933
|
-
// return;
|
|
934
|
-
// }
|
|
935
929
|
if (typeof value === 'string') {
|
|
936
930
|
element.setAttribute('class', value);
|
|
937
931
|
return;
|
package/dist/lib/dom/runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSignal as g}from"@fluixi/reactive/signal";var _="http://www.w3.org/2000/svg";function re(e){return e.localName.includes("-")}function D(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(re(e)){e[t]=n;return}N(e,t,n,o)}var F=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var me=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Y,createEffect as S,createRenderEffect as y,createRoot as fe,onCleanup as w,readChildren as ae}from"@fluixi/reactive/signal";var v=typeof document>"u";var W=Symbol.for("fluixi.server-node"),q=null;function I(){if(!q)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return q}function A(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function G(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function X(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var x={active:!1,cursor:null,parents:[]},se=null;function k(){return se}function V(e,t){return x.active&&t.parentNode===e}function z(e){let t=x.parents.lastIndexOf(e);t!==-1&&(x.parents.length=t),x.cursor=e.nextSibling}function ue(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,f=e;for(;f=f.previousElementSibling;)f.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function le(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Me(e){return le(ue(e))}var Re=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ce={};var J=new Map,C=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Z(e){if(!v)for(let t of e)C.has(t)||j.has(t)||(C.add(t),document.addEventListener(t,de))}function de(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ye(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let f=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,f),e[o]=f}return}C.has(t)||Z([t])}function U(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Oe(e){return!j.has(e)}function He(e){return typeof e=="function"}function b(e,t=!1){if(v)return I().createText(e);if(x.active&&!t){let n=k()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function je(e,t=!1){if(v)return I().createElement(e,t);if(x.active){let n=k()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(_,e):document.createElement(e)}function $e(e,t=!1){let n=J.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,J.set(e,o),o}function _e(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function pe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?pe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function De(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Fe(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var E=0,ge=200;function he(e,t,n,o,f){let a=o,s=new Map;return y(()=>{let r;if(h(e)&&!g(e)){if(!s.has(e)){E++;try{let i=e();s.set(e,i)}finally{E--}}for(r=s.get(e);typeof r=="function"&&g(r);)r=r()}else for(r=e();typeof r=="function"&&g(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!s.has(r)){let u=r;E++;try{let l=u();s.set(u,l)}finally{E--}}r=s.get(r)}else if(g(r))r=r();else if(r=r(),typeof r!="function"||!g(r)&&!h(r))break}E++;try{a=P(t,r,n,a,s),f(a)}finally{E--}})}function Q(e,t,n,o){if(E>ge)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),e.appendChild(n));let f=o??null,a=i=>Array.isArray(i)&&i.some(u=>typeof u=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{f=P(e,t,n,null)}finally{E--}return()=>f}let r=he(s(t),e,n,f,i=>{f=i});return()=>(r?.(),f)}function P(e,t,n,o,f){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(L(t)){let s=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):p(e,s,n):o?e.replaceChild(s,o):p(e,s,n),t.then(r=>{s.parentNode===e&&P(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=b(t);return p(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&X(o))return o.data=t,o;let s=b(t);return o&&o.parentNode===e?e.replaceChild(s,o):V(e,s)||p(e,s,n),s}if(A(t))return V(e,t)?(z(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,s,e,n,!0,f,i);let u=xe(e,r,s,n);for(let l of i){let c=Q(e,l.sig,l.marker);w(()=>{T(e,c()),l.marker.parentNode===e&&e.removeChild(l.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return P(e,i,n,o)}}}return T(e,o,n)}function m(e,t,n,o,f=!0,a,s){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!L(i)&&!g(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let u;for(h(i)&&!g(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),u=a.get(i)):u=i();typeof u=="function"&&!L(u)&&!g(u)&&!h(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let c=b("",!0);t.push(c),s.push({marker:c,sig:u});continue}let l=u();for(;typeof l=="function"&&g(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?m(l,t,n,o,f,a):m([l],t,n,o,f,a);continue}continue}Array.isArray(u)?m(u,t,n,o,f,a,s):m([u],t,n,o,f,a,s);continue}if(L(i)){let u=b("",!0);t.push(u),i.then(l=>{if(u.parentNode){let c=[];if(m([l],c,u.parentNode,void 0,!1,a),c.length>0){u.parentNode.replaceChild(c[0],u);for(let d=1;d<c.length;d++)u.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(i)){m(i,t,n,o,f,a,s);continue}if(A(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let u=i;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?m(l,t,n,o,!1,a):m([l],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let u=String(i);if(u.trim()===""&&u!==" ")continue;t.push(b(u));continue}t.push(b(String(i)))}}}}function xe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let f=n.length,a=t.length,s=f,r=0,i=0,u=a>0?t[a-1].nextSibling??void 0:o,l=null;for(;r<a||i<s;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&t[a-1]===n[s-1];)a--,s--;if(a===r){let c=s<f?i?n[i-1].nextSibling??void 0:n[s-i]:u;for(;i<s;)p(e,n[i++],c)}else if(s===i)for(;r<a;)(!l||!l.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[s-1]&&n[i]===t[a-1]){let c=t[--a].nextSibling;p(e,n[i++],t[r++].nextSibling),p(e,n[--s],c),t[a]=t[r-1]}else{if(!l){l=new Map;let d=i;for(;d<s;)l.set(n[d],d++)}let c=l.get(t[r]);if(c!=null)if(i<c&&c<s){let d=r,$=1;for(;++d<a&&d<s&&!(!l.has(t[d])||l.get(t[d])!==c+$);)$++;if($>c-i){let ie=t[r];for(;i<c;)p(e,n[i++],ie)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(p(e,n[i++],u),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){x.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function M(e,t,n){n==null?delete e[t]:e[t]=n}function ee(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function te(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function K(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):y(()=>{let f=typeof n=="function"?n():n;N(e,t,f,o)})}function B(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function ne(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):y(()=>{let o=n();N(e,t,!!o)})}function R(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){S(()=>{R(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function O(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(y(()=>{let s=!!f();for(let r of a)e.classList.toggle(r,s)}));else{let s=!!(typeof f=="function"?f():f);for(let r of a)e.classList.toggle(r,s)}}}function H(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function We(e){let{element:t,props:n,prevProps:o=ce,isSVG:f=!1,skipChildren:a=!1}=e;if(!t||!G(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=f||t.namespaceURI===_,r=[];for(let i in n){if(a&&i==="children")continue;let u=n[i],l=o[i];if(u===l)continue;if(i==="ref"){oe(u,t);continue}if(i==="use"){te(t,u);continue}if(i.startsWith("on:")){r.push(ee(t,i.slice(3),u));continue}if(i.startsWith("prop:")){r.push(B(t,i.slice(5),u));continue}if(i.startsWith("attr:")){r.push(K(t,i.slice(5),u,s));continue}if(i.startsWith("bool:")){r.push(ne(t,i.slice(5),u));continue}if(i==="class"||i==="className"){typeof u=="function"?r.push(y(()=>R(t,u()))):R(t,u);continue}if(i==="classList"){typeof u=="function"?r.push(y(()=>O(t,u()))):O(t,u,r);continue}if(i==="style"){typeof u=="function"?r.push(y(()=>H(t,u()))):H(t,u);continue}if(i.startsWith("on")){let d=i.slice(2).toLowerCase();l&&U(t,d),u&&ye(t,d,u);continue}let c=F.has(i)||!s&&i in t;typeof u=="function"?r.push(c?B(t,i,u):K(t,i,u,s)):r.push(y(()=>c?M(t,i,n[i]):N(t,i,n[i],s)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let u=i.slice(2).toLowerCase();U(t,u)}else F.has(i)?M(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Ie(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){oe(f,e);continue}if(o!=="children"){if(o==="use"){te(e,f);continue}if(o.startsWith("on:")){ee(e,o.slice(3),f);continue}if(o.startsWith("prop:")){B(e,o.slice(5),f);continue}if(o.startsWith("attr:")){K(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ne(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(j.has(a)){e[`$$${a}`]=f;let s=`__fx_${a}`;if(!e[s]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[s]=r}}else e[`$$${a}`]=f,C.has(a)||Z([a]);continue}if(o==="class"||o==="className"){R(e,f);continue}if(o==="classList"){typeof f=="function"?y(()=>O(e,f())):O(e,f);continue}if(o==="style"){typeof f=="function"?y(()=>H(e,f())):H(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function";)s=s();e.innerHTML=s});w(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});w(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});w(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,s=S(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});w(()=>{s()})}else{let a=!0;y(()=>{let s=t[o];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();D(e,o,s,n)});w(()=>{a()})}else y(()=>D(e,o,t[o],n))}}}function ke(...e){let t=o=>{for(let f=e.length-1;f>=0;f--){let a=e[f];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let f of e)if(f&&o in f)return!0;return!1};return new Proxy({},{get:(o,f)=>t(f),has:(o,f)=>n(f),ownKeys:()=>{let o=new Set;for(let f of e)if(f)for(let a of Reflect.ownKeys(f))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,f)=>n(f)?{enumerable:!0,configurable:!0,get:()=>t(f)}:void 0})}function Ve(e,...t){let n=new Set;for(let s of t)for(let r of s)n.add(r);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),f=t.map(s=>{let r=new Set(s);return new Proxy({},{get:(i,u)=>r.has(u)?e[u]:void 0,has:(i,u)=>r.has(u)&&u in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,u)=>r.has(u)&&u in e?o(u):void 0})}),a=new Proxy({},{get:(s,r)=>n.has(r)?void 0:e[r],has:(s,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,r)=>!n.has(r)&&r in e?o(r):void 0});return[...f,a]}function oe(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Ke(e,t,n){let o=t||document.body,f=ae(()=>e),a=[];return Y(()=>{let s=y(()=>{let r=f();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):A(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(s),w(()=>{a.forEach(r=>r())})}),null}function Be(e){return typeof e=="string"&&e.toLowerCase()===e}function qe(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Ge(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Xe(e){return typeof e=="function"&&e.length===0&&g(e)}function ze(e,t,n){if(!t)throw new Error("Container element is required");let o,f,a=[];return fe(s=>{Y(()=>{x.active||(t.textContent=""),Q(t,e)}),f=s}),()=>{f?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}export{ye as addDelegatedEventListener,ee as addNativeEventListener,Ie as applyProps,te as applyUse,T as cleanChildren,_e as cloneTemplate,je as createNativeElement,Ke as createPortal,$e as createTemplate,Z as delegateEvents,Ge as escapeHTML,De as fnName,Re as generateID,Me as getStableElementId,oe as handleRef,Q as insert,P as insertExpression,Xe as isAccessor,Oe as isDelegatedEvent,He as isFunction,Be as isNativeElement,L as isPromise,qe as isSVGElement,Fe as iterateFn,pe as makeArrayFlat,ke as mergeProps,U as removeDelegatedEventListener,ze as render,O as setClassList,R as setClassName,K as setDynamicAttribute,ne as setDynamicBoolAttribute,B as setDynamicProperty,M as setProperty,H as setStyle,Ve as splitProps,We as spread};
|
|
1
|
+
import{isSignal as g}from"@fluixi/reactive/signal";var _="http://www.w3.org/2000/svg";function re(e){return e.localName.includes("-")}function D(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(re(e)){e[t]=n;return}N(e,t,n,o)}var F=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var me=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Y,createEffect as A,createRenderEffect as d,createRoot as fe,onCleanup as w,readChildren as ae}from"@fluixi/reactive/signal";var v=typeof document>"u";var W=Symbol.for("fluixi.server-node"),q=null;function I(){if(!q)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return q}function S(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function G(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function X(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var x={active:!1,cursor:null,parents:[]},se=null;function k(){return se}function V(e,t){return x.active&&t.parentNode===e}function z(e){let t=x.parents.lastIndexOf(e);t!==-1&&(x.parents.length=t),x.cursor=e.nextSibling}function ue(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,f=e;for(;f=f.previousElementSibling;)f.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function le(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Me(e){return le(ue(e))}var Re=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ce={};var J=new Map,C=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Z(e){if(!v)for(let t of e)C.has(t)||j.has(t)||(C.add(t),document.addEventListener(t,de))}function de(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ye(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let f=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,f),e[o]=f}return}C.has(t)||Z([t])}function U(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Oe(e){return!j.has(e)}function He(e){return typeof e=="function"}function b(e,t=!1){if(v)return I().createText(e);if(x.active&&!t){let n=k()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function je(e,t=!1){if(v)return I().createElement(e,t);if(x.active){let n=k()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(_,e):document.createElement(e)}function $e(e,t=!1){let n=J.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,J.set(e,o),o}function _e(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function pe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?pe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function De(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Fe(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var E=0,ge=200;function he(e,t,n,o,f){let a=o,s=new Map;return d(()=>{let r;if(h(e)&&!g(e)){if(!s.has(e)){E++;try{let i=e();s.set(e,i)}finally{E--}}for(r=s.get(e);typeof r=="function"&&g(r);)r=r()}else for(r=e();typeof r=="function"&&g(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!s.has(r)){let u=r;E++;try{let l=u();s.set(u,l)}finally{E--}}r=s.get(r)}else if(g(r))r=r();else if(r=r(),typeof r!="function"||!g(r)&&!h(r))break}E++;try{a=P(t,r,n,a,s),f(a)}finally{E--}})}function Q(e,t,n,o){if(E>ge)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),e.appendChild(n));let f=o??null,a=i=>Array.isArray(i)&&i.some(u=>typeof u=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{f=P(e,t,n,null)}finally{E--}return()=>f}let r=he(s(t),e,n,f,i=>{f=i});return()=>(r?.(),f)}function P(e,t,n,o,f){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(L(t)){let s=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):p(e,s,n):o?e.replaceChild(s,o):p(e,s,n),t.then(r=>{s.parentNode===e&&P(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=b(t);return p(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&X(o))return o.data=t,o;let s=b(t);return o&&o.parentNode===e?e.replaceChild(s,o):V(e,s)||p(e,s,n),s}if(S(t))return V(e,t)?(z(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,s,e,n,!0,f,i);let u=xe(e,r,s,n);for(let l of i){let c=Q(e,l.sig,l.marker);w(()=>{T(e,c()),l.marker.parentNode===e&&e.removeChild(l.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return P(e,i,n,o)}}}return T(e,o,n)}function m(e,t,n,o,f=!0,a,s){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!L(i)&&!g(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let u;for(h(i)&&!g(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),u=a.get(i)):u=i();typeof u=="function"&&!L(u)&&!g(u)&&!h(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let c=b("",!0);t.push(c),s.push({marker:c,sig:u});continue}let l=u();for(;typeof l=="function"&&g(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?m(l,t,n,o,f,a):m([l],t,n,o,f,a);continue}continue}Array.isArray(u)?m(u,t,n,o,f,a,s):m([u],t,n,o,f,a,s);continue}if(L(i)){let u=b("",!0);t.push(u),i.then(l=>{if(u.parentNode){let c=[];if(m([l],c,u.parentNode,void 0,!1,a),c.length>0){u.parentNode.replaceChild(c[0],u);for(let y=1;y<c.length;y++)u.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(i)){m(i,t,n,o,f,a,s);continue}if(S(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let u=i;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?m(l,t,n,o,!1,a):m([l],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let u=String(i);if(u.trim()===""&&u!==" ")continue;t.push(b(u));continue}t.push(b(String(i)))}}}}function xe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let f=n.length,a=t.length,s=f,r=0,i=0,u=a>0?t[a-1].nextSibling??void 0:o,l=null;for(;r<a||i<s;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&t[a-1]===n[s-1];)a--,s--;if(a===r){let c=s<f?i?n[i-1].nextSibling??void 0:n[s-i]:u;for(;i<s;)p(e,n[i++],c)}else if(s===i)for(;r<a;)(!l||!l.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[s-1]&&n[i]===t[a-1]){let c=t[--a].nextSibling;p(e,n[i++],t[r++].nextSibling),p(e,n[--s],c),t[a]=t[r-1]}else{if(!l){l=new Map;let y=i;for(;y<s;)l.set(n[y],y++)}let c=l.get(t[r]);if(c!=null)if(i<c&&c<s){let y=r,$=1;for(;++y<a&&y<s&&!(!l.has(t[y])||l.get(t[y])!==c+$);)$++;if($>c-i){let ie=t[r];for(;i<c;)p(e,n[i++],ie)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(p(e,n[i++],u),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){x.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function M(e,t,n){n==null?delete e[t]:e[t]=n}function ee(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function te(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function K(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):d(()=>{let f=typeof n=="function"?n():n;N(e,t,f,o)})}function B(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):d(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function ne(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):d(()=>{let o=n();N(e,t,!!o)})}function R(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){d(()=>R(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function O(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(d(()=>{let s=!!f();for(let r of a)e.classList.toggle(r,s)}));else{let s=!!(typeof f=="function"?f():f);for(let r of a)e.classList.toggle(r,s)}}}function H(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function We(e){let{element:t,props:n,prevProps:o=ce,isSVG:f=!1,skipChildren:a=!1}=e;if(!t||!G(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=f||t.namespaceURI===_,r=[];for(let i in n){if(a&&i==="children")continue;let u=n[i],l=o[i];if(u===l)continue;if(i==="ref"){oe(u,t);continue}if(i==="use"){te(t,u);continue}if(i.startsWith("on:")){r.push(ee(t,i.slice(3),u));continue}if(i.startsWith("prop:")){r.push(B(t,i.slice(5),u));continue}if(i.startsWith("attr:")){r.push(K(t,i.slice(5),u,s));continue}if(i.startsWith("bool:")){r.push(ne(t,i.slice(5),u));continue}if(i==="class"||i==="className"){typeof u=="function"?r.push(d(()=>R(t,u()))):R(t,u);continue}if(i==="classList"){typeof u=="function"?r.push(d(()=>O(t,u()))):O(t,u,r);continue}if(i==="style"){typeof u=="function"?r.push(d(()=>H(t,u()))):H(t,u);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();l&&U(t,y),u&&ye(t,y,u);continue}let c=F.has(i)||!s&&i in t;typeof u=="function"?r.push(c?B(t,i,u):K(t,i,u,s)):r.push(d(()=>c?M(t,i,n[i]):N(t,i,n[i],s)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let u=i.slice(2).toLowerCase();U(t,u)}else F.has(i)?M(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Ie(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){oe(f,e);continue}if(o!=="children"){if(o==="use"){te(e,f);continue}if(o.startsWith("on:")){ee(e,o.slice(3),f);continue}if(o.startsWith("prop:")){B(e,o.slice(5),f);continue}if(o.startsWith("attr:")){K(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ne(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(j.has(a)){e[`$$${a}`]=f;let s=`__fx_${a}`;if(!e[s]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[s]=r}}else e[`$$${a}`]=f,C.has(a)||Z([a]);continue}if(o==="class"||o==="className"){R(e,f);continue}if(o==="classList"){typeof f=="function"?d(()=>O(e,f())):O(e,f);continue}if(o==="style"){typeof f=="function"?d(()=>H(e,f())):H(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=A(()=>{let s=f();for(;typeof s=="function";)s=s();e.innerHTML=s});w(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=A(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});w(()=>{a()})}else d(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=A(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});w(()=>{a()})}else d(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,s=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});w(()=>{s()})}else{let a=!0;d(()=>{let s=t[o];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof f=="function"){let a=A(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();D(e,o,s,n)});w(()=>{a()})}else d(()=>D(e,o,t[o],n))}}}function ke(...e){let t=o=>{for(let f=e.length-1;f>=0;f--){let a=e[f];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let f of e)if(f&&o in f)return!0;return!1};return new Proxy({},{get:(o,f)=>t(f),has:(o,f)=>n(f),ownKeys:()=>{let o=new Set;for(let f of e)if(f)for(let a of Reflect.ownKeys(f))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,f)=>n(f)?{enumerable:!0,configurable:!0,get:()=>t(f)}:void 0})}function Ve(e,...t){let n=new Set;for(let s of t)for(let r of s)n.add(r);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),f=t.map(s=>{let r=new Set(s);return new Proxy({},{get:(i,u)=>r.has(u)?e[u]:void 0,has:(i,u)=>r.has(u)&&u in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,u)=>r.has(u)&&u in e?o(u):void 0})}),a=new Proxy({},{get:(s,r)=>n.has(r)?void 0:e[r],has:(s,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,r)=>!n.has(r)&&r in e?o(r):void 0});return[...f,a]}function oe(e,t){if(e){if(S(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Ke(e,t,n){let o=t||document.body,f=ae(()=>e),a=[];return Y(()=>{let s=d(()=>{let r=f();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):S(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(s),w(()=>{a.forEach(r=>r())})}),null}function Be(e){return typeof e=="string"&&e.toLowerCase()===e}function qe(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Ge(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Xe(e){return typeof e=="function"&&e.length===0&&g(e)}function ze(e,t,n){if(!t)throw new Error("Container element is required");let o,f,a=[];return fe(s=>{Y(()=>{x.active||(t.textContent=""),Q(t,e)}),f=s}),()=>{f?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}export{ye as addDelegatedEventListener,ee as addNativeEventListener,Ie as applyProps,te as applyUse,T as cleanChildren,_e as cloneTemplate,je as createNativeElement,Ke as createPortal,$e as createTemplate,Z as delegateEvents,Ge as escapeHTML,De as fnName,Re as generateID,Me as getStableElementId,oe as handleRef,Q as insert,P as insertExpression,Xe as isAccessor,Oe as isDelegatedEvent,He as isFunction,Be as isNativeElement,L as isPromise,qe as isSVGElement,Fe as iterateFn,pe as makeArrayFlat,ke as mergeProps,U as removeDelegatedEventListener,ze as render,O as setClassList,R as setClassName,K as setDynamicAttribute,ne as setDynamicBoolAttribute,B as setDynamicProperty,M as setProperty,H as setStyle,Ve as splitProps,We as spread};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of o(e))!u.call(t,n)&&n!==a&&r(t,n,{get:()=>e[n],enumerable:!(i=s(e,n))||i.enumerable});return t};var l=t=>c(r({},"__esModule",{value:!0}),t);var g={};module.exports=l(g);
|
|
@@ -232,7 +232,7 @@ export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
|
|
|
232
232
|
exportparts?: string;
|
|
233
233
|
exportParts?: string;
|
|
234
234
|
hidden?: Reactive<boolean>;
|
|
235
|
-
id?:
|
|
235
|
+
id?: Reactive<string>;
|
|
236
236
|
inert?: boolean;
|
|
237
237
|
inputmode?: HTMLInputMode;
|
|
238
238
|
inputMode?: HTMLInputMode;
|
|
@@ -244,10 +244,10 @@ export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
|
|
|
244
244
|
slot?: string;
|
|
245
245
|
spellCheck?: boolean;
|
|
246
246
|
spellcheck?: boolean;
|
|
247
|
-
style?:
|
|
247
|
+
style?: Reactive<string | CSSProperties>;
|
|
248
248
|
tabIndex?: Reactive<number>;
|
|
249
249
|
tabindex?: Reactive<number>;
|
|
250
|
-
title?:
|
|
250
|
+
title?: Reactive<string>;
|
|
251
251
|
translate?: 'yes' | 'no';
|
|
252
252
|
itemid?: string;
|
|
253
253
|
itemId?: string;
|
|
@@ -288,7 +288,7 @@ export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
|
|
|
288
288
|
}
|
|
289
289
|
export interface AnchorHTMLAttributes<T = HTMLAnchorElement> extends HTMLAttributes<T> {
|
|
290
290
|
download?: any;
|
|
291
|
-
href?:
|
|
291
|
+
href?: Reactive<string>;
|
|
292
292
|
hrefLang?: string;
|
|
293
293
|
hreflang?: string;
|
|
294
294
|
media?: string;
|
|
@@ -326,7 +326,7 @@ export interface ButtonHTMLAttributes<T = HTMLButtonElement> extends HTMLAttribu
|
|
|
326
326
|
command?: string;
|
|
327
327
|
commandfor?: string;
|
|
328
328
|
commandFor?: string;
|
|
329
|
-
disabled?:
|
|
329
|
+
disabled?: Reactive<boolean>;
|
|
330
330
|
form?: string;
|
|
331
331
|
formAction?: string;
|
|
332
332
|
formaction?: string;
|
|
@@ -437,7 +437,7 @@ export interface ImgHTMLAttributes<T = HTMLImageElement> extends HTMLAttributes<
|
|
|
437
437
|
referrerPolicy?: HTMLReferrerPolicy;
|
|
438
438
|
referrerpolicy?: HTMLReferrerPolicy;
|
|
439
439
|
sizes?: string;
|
|
440
|
-
src?:
|
|
440
|
+
src?: Reactive<string>;
|
|
441
441
|
srcSet?: string;
|
|
442
442
|
srcset?: string;
|
|
443
443
|
useMap?: string;
|
|
@@ -452,12 +452,12 @@ export interface InputHTMLAttributes<T = HTMLInputElement> extends HTMLAttribute
|
|
|
452
452
|
autoFocus?: boolean;
|
|
453
453
|
autofocus?: boolean;
|
|
454
454
|
capture?: boolean | 'user' | 'environment';
|
|
455
|
-
checked?:
|
|
455
|
+
checked?: Reactive<boolean>;
|
|
456
456
|
crossOrigin?: HTMLCrossOrigin;
|
|
457
457
|
crossorigin?: HTMLCrossOrigin;
|
|
458
458
|
dirName?: string;
|
|
459
459
|
dirname?: string;
|
|
460
|
-
disabled?:
|
|
460
|
+
disabled?: Reactive<boolean>;
|
|
461
461
|
form?: string;
|
|
462
462
|
formAction?: string;
|
|
463
463
|
formaction?: string;
|
|
@@ -481,7 +481,7 @@ export interface InputHTMLAttributes<T = HTMLInputElement> extends HTMLAttribute
|
|
|
481
481
|
multiple?: Reactive<boolean>;
|
|
482
482
|
name?: string;
|
|
483
483
|
pattern?: Reactive<string>;
|
|
484
|
-
placeholder?:
|
|
484
|
+
placeholder?: Reactive<string>;
|
|
485
485
|
popoverTarget?: string;
|
|
486
486
|
popovertarget?: string;
|
|
487
487
|
popoverTargetAction?: 'hide' | 'show' | 'toggle';
|
|
@@ -493,7 +493,7 @@ export interface InputHTMLAttributes<T = HTMLInputElement> extends HTMLAttribute
|
|
|
493
493
|
size?: Reactive<number>;
|
|
494
494
|
src?: string;
|
|
495
495
|
step?: Reactive<number | string>;
|
|
496
|
-
indeterminate?:
|
|
496
|
+
indeterminate?: Reactive<boolean>;
|
|
497
497
|
type?: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
|
|
498
498
|
useMap?: string;
|
|
499
499
|
usemap?: string;
|
|
@@ -649,7 +649,7 @@ export interface SelectHTMLAttributes<T = HTMLSelectElement> extends HTMLAttribu
|
|
|
649
649
|
autocomplete?: string;
|
|
650
650
|
autoFocus?: boolean;
|
|
651
651
|
autofocus?: boolean;
|
|
652
|
-
disabled?:
|
|
652
|
+
disabled?: Reactive<boolean>;
|
|
653
653
|
form?: string;
|
|
654
654
|
multiple?: Reactive<boolean>;
|
|
655
655
|
name?: string;
|
|
@@ -711,14 +711,14 @@ export interface TextareaHTMLAttributes<T = HTMLTextAreaElement> extends HTMLAtt
|
|
|
711
711
|
cols?: number;
|
|
712
712
|
dirName?: string;
|
|
713
713
|
dirname?: string;
|
|
714
|
-
disabled?:
|
|
714
|
+
disabled?: Reactive<boolean>;
|
|
715
715
|
form?: string;
|
|
716
716
|
maxLength?: Reactive<number>;
|
|
717
717
|
maxlength?: Reactive<number>;
|
|
718
718
|
minLength?: Reactive<number>;
|
|
719
719
|
minlength?: Reactive<number>;
|
|
720
720
|
name?: string;
|
|
721
|
-
placeholder?:
|
|
721
|
+
placeholder?: Reactive<string>;
|
|
722
722
|
readOnly?: Reactive<boolean>;
|
|
723
723
|
readonly?: Reactive<boolean>;
|
|
724
724
|
required?: Reactive<boolean>;
|
|
@@ -765,10 +765,10 @@ export interface VideoHTMLAttributes<T = HTMLVideoElement> extends MediaHTMLAttr
|
|
|
765
765
|
export interface AudioHTMLAttributes<T = HTMLAudioElement> extends MediaHTMLAttributes<T> {
|
|
766
766
|
}
|
|
767
767
|
export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
|
|
768
|
-
id?: string
|
|
769
|
-
class?:
|
|
770
|
-
className?: string
|
|
771
|
-
style?:
|
|
768
|
+
id?: Reactive<string>;
|
|
769
|
+
class?: Reactive<string>;
|
|
770
|
+
className?: Reactive<string>;
|
|
771
|
+
style?: Reactive<string | CSSProperties>;
|
|
772
772
|
ref?: RefCallback<T> | {
|
|
773
773
|
current: T | null;
|
|
774
774
|
} | {
|
|
@@ -778,8 +778,8 @@ export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
|
|
|
778
778
|
children?: ComponentChild;
|
|
779
779
|
tabIndex?: Reactive<number>;
|
|
780
780
|
tabindex?: Reactive<number>;
|
|
781
|
-
lang?: string
|
|
782
|
-
xml_lang?: string
|
|
781
|
+
lang?: Reactive<string>;
|
|
782
|
+
xml_lang?: Reactive<string>;
|
|
783
783
|
color?: Reactive<string>;
|
|
784
784
|
fill?: Reactive<string>;
|
|
785
785
|
fillOpacity?: Reactive<number | string>;
|