@symbo.ls/element 3.14.802 → 3.14.804

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.
@@ -1 +1 @@
1
- const A=new WeakMap;function l(t){const r=[];return t.extends&&(Array.isArray(t.extends)?r.push(...t.extends):r.push(t.extends)),t.extend&&(Array.isArray(t.extend)?r.push(...t.extend):r.push(t.extend)),r}function h(t,r,e){const s=l(r);if(!s.length)return;const f=(t.context||e?.context||{}).components||{};for(let n=0;n<s.length;n++){const o=y(s[n],f);o&&o!==r&&p(t,o,e,new Set([r]))}}function y(t,r){if(typeof t=="string"){if(t.includes(">")){const e=t.split(">").map(c=>c.trim());let s=r[e[0]]||r[`smbls.${e[0]}`];for(let c=1;c<e.length&&s;c++)s=s[e[c]];return s||null}return r[t]||r[`smbls.${t}`]||null}return typeof t=="object"&&t!==null?t:null}function p(t,r,e,s=new Set){if(s.has(r))return;s.add(r);const c=l(r);if(c.length){const o=(t.context||e?.context||{}).components||{};for(let a=0;a<c.length;a++){const u=y(c[a],o);u&&p(t,u,e,s)}}const f=i(t);for(const n in r){if(n==="extends"||n==="extend")continue;const o=r[n];f&&f.set(n,f.rank),t[n]===void 0?o&&typeof o=="object"&&!Array.isArray(o)&&typeof o!="function"?t[n]={...o}:t[n]=o:typeof t[n]=="object"&&typeof o=="object"&&!Array.isArray(t[n])&&!Array.isArray(o)&&t[n]!==null&&o!==null?t[n]=x(t[n],o):t[n]=o}}function i(t){const r=t&&t.__ref;if(!r)return null;let e=r.__mergeLayer;return e||(e=r.__mergeLayer=new Map),e.rank=(e.rank||0)+1,e}function x(t,r){const e={...t};for(const s in r){const c=e[s],f=r[s];c&&f&&typeof c=="object"&&typeof f=="object"&&!Array.isArray(c)&&!Array.isArray(f)&&typeof c!="function"&&typeof f!="function"?e[s]=x(c,f):e[s]=f}return e}export{h as applyExtends,i as openMergeLayer};
1
+ import{CSS_PROPS_REGISTRY as A}from"css-in-props";import{CSS_LONGHAND_SHORTHANDS as x,CSS_SHORTHAND_LONGHANDS as _,cssPropName as g,cssCamelName as S}from"./cssLonghands.js";const N=new WeakMap;function l(r){const t=[];return r.extends&&(Array.isArray(r.extends)?t.push(...r.extends):t.push(r.extends)),r.extend&&(Array.isArray(r.extend)?t.push(...r.extend):t.push(r.extend)),t}function w(r,t,e){const n=l(t);if(!n.length)return;const c=(r.context||e?.context||{}).components||{};for(let s=0;s<n.length;s++){const o=p(n[s],c);o&&o!==t&&y(r,o,e,new Set([t]))}}function p(r,t){if(typeof r=="string"){if(r.includes(">")){const e=r.split(">").map(a=>a.trim());let n=t[e[0]]||t[`smbls.${e[0]}`];for(let a=1;a<e.length&&n;a++)n=n[e[a]];return n||null}return t[r]||t[`smbls.${r}`]||null}return typeof r=="object"&&r!==null?r:null}function y(r,t,e,n=new Set){if(n.has(t))return;n.add(t);const a=l(t);if(a.length){const o=(r.context||e?.context||{}).components||{};for(let u=0;u<a.length;u++){const i=p(a[u],o);i&&y(r,i,e,n)}}const c=L(r);for(const s in t){if(s==="extends"||s==="extend")continue;const o=t[s];c&&c.mark(s),r[s]===void 0?o&&typeof o=="object"&&!Array.isArray(o)&&typeof o!="function"?r[s]={...o}:r[s]=o:typeof r[s]=="object"&&typeof o=="object"&&!Array.isArray(r[s])&&!Array.isArray(o)&&r[s]!==null&&o!==null?r[s]=h(r[s],o):r[s]=o}}class k{constructor(){this.rank=0,this.ranks=null}mark(t){b(t)&&(this.ranks||(this.ranks=new Map),this.ranks.set(t,this.rank))}get(t){return this.ranks?this.ranks.get(t):void 0}get size(){return this.ranks?this.ranks.size:0}}const f=new Set;for(const r of[x,_])for(const t in r)f.add(t),f.add(S(t));const d=new Map;function b(r){const t=r.charCodeAt(0);if(t>=65&&t<=90||t>=48&&t<=57)return!1;let e=d.get(r);return e===void 0&&(e=!!A[r]||f.has(r)||r.indexOf("-")>=0&&!(r.charCodeAt(0)===45&&r.charCodeAt(1)===45)&&f.has(g(r)),d.set(r,e)),e}function L(r){const t=r&&r.__ref;if(!t)return null;let e=t.__mergeLayer;return e||(e=t.__mergeLayer=new k),e.rank++,e}function j(r){const t=r&&r.__ref&&r.__ref.__mergeLayer;if(!t||!t.ranks)return;let e;for(const n of t.ranks.values())if(e===void 0)e=n;else if(n!==e)return;t.ranks=null}function h(r,t){const e={...r};for(const n in t){const a=e[n],c=t[n];a&&c&&typeof a=="object"&&typeof c=="object"&&!Array.isArray(a)&&!Array.isArray(c)&&typeof a!="function"&&typeof c!="function"?e[n]=h(a,c):e[n]=c}return e}export{w as applyExtends,j as closeMergeLayer,L as openMergeLayer};
@@ -1 +1 @@
1
- import{createEffect as F,getObserver as M,setObserver as E}from"@symbo.ls/signal";const a="inertOutside",N=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),R='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',x={attributes:!0,attributeFilter:["inert"]},w=new WeakMap,g=new WeakMap,d=new Set,O=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function f(e){const t=M();t&&E(null);try{return e()}catch(n){console.error("[smbls] inertOutside:",n)}finally{t&&E(t)}}function _(e){const t=()=>f(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function P(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=w.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(s=>f(()=>b(t,s))),w.set(e,t),t)}function S(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function L(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const T=e=>!!(e.closest&&e.closest("[inert]"));function k(e){const t=e.ownerDocument,n=new Set,s=[];for(let o=e;o!==t.body;o=o.parentNode){const c=o.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;s.push(c);for(let l=c.firstElementChild;l;l=l.nextElementSibling)l!==o&&!N.has(l.tagName)&&n.add(l)}return{outside:n,parents:s}}function A(e,t){for(let n=0;n<t.length;n++){const{type:s,target:o}=t[n];s==="attributes"&&e.held.has(o)&&e.held.set(o,!o.hasAttribute("inert"))}}function b(e,t){const{doc:n,held:s,observer:o}=e;t&&A(e,t),A(e,o.takeRecords());const c=e.top,l=[];for(const r of e.layers){const y=S(r,n);y&&!r.live&&(l.push(r),r.returnFocus=L(n)),r.live=y}l.length&&(e.layers=e.layers.filter(r=>!l.includes(r)).concat(l));let i=null;for(let r=e.layers.length-1;r>=0&&!i;r--)e.layers[r].live&&(i=e.layers[r]);e.top=i;const{outside:p,parents:v}=i?k(i.element.node):{outside:new Set,parents:[]};for(const[r,y]of s)p.has(r)||(y&&r.removeAttribute("inert"),s.delete(r));for(const r of p)s.has(r)||s.set(r,!1),r.hasAttribute("inert")||(r.setAttribute("inert",""),s.set(r,!0));o.takeRecords(),o.disconnect();for(const r of v)o.observe(r,{childList:!0});for(const r of s.keys())o.observe(r,x);if(e.layers.some(r=>!r.live)?d.add(e):d.delete(e),i===c)return;const u=c&&!(c.declared&&c.live)?c:null;if(i&&l.includes(i))u&&u.returnFocus&&(i.returnFocus=u.returnFocus),_(()=>m(e,i));else if(u){const r=u.returnFocus;_(()=>D(e,u,r))}u&&(u.returnFocus=null)}function m(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const s=e.doc,o=s.activeElement;if(o&&n.contains(o))return;const c=new Set,l=(i,p)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const v=p&&i.getAttribute("tabindex");return v&&parseInt(v,10)<0?!1:(i.focus(),s.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(l(i,!1))return;for(const i of n.querySelectorAll(R))if(l(i,!0))return;o&&o!==s.body&&typeof o.blur=="function"&&o.blur()}function D(e,t,n){if(t.declared&&t.live)return;const s=e.doc,o=s.activeElement,c=t.element.node;(!o||o===s.body||c&&c.contains(o)||T(o))&&(n&&n.isConnected&&n.ownerDocument===s&&!T(n)&&(n.focus({preventScroll:!0}),s.activeElement===n)||e.top&&m(e,e.top))}function h(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const s=n.layers.indexOf(e);s!==-1&&n.layers.splice(s,1)}b(n)}function C(e){let t=e[a];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function I(e){let t=g.get(e);if(t)return t;const n=e.__ref,s=e.node;if(!n||!s||s.nodeType!==1)return null;const o=P(s.ownerDocument);if(!o)return null;t={element:e,manager:o,declared:!1,live:!1,returnFocus:null},g.set(e,t);const c=F(()=>{const l=C(e);f(()=>h(t,l))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+a});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>f(()=>h(t,!1))),t}function q(){for(const e of d){if(!e.doc.defaultView){d.delete(e);continue}e.layers.some(t=>!t.live&&S(t,e.doc))&&b(e)}}const B={name:a,create(e){O(e,a)&&f(()=>I(e))},render(){d.size&&f(q)},update(e){O(e,a)&&f(()=>{const t=I(e);t&&h(t,C(e))})}};export{B as inertOutsidePlugin};
1
+ import{createEffect as I}from"@symbo.ls/signal";import{untrack as F}from"./runContext.js";const a="inertOutside",M=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),N='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',R={attributes:!0,attributeFilter:["inert"]},E=new WeakMap,w=new WeakMap,d=new Set,g=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function f(e){try{return F(e)}catch(t){console.error("[smbls] inertOutside:",t)}}function O(e){const t=()=>f(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function x(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=E.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(s=>f(()=>h(t,s))),E.set(e,t),t)}function _(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function P(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const S=e=>!!(e.closest&&e.closest("[inert]"));function k(e){const t=e.ownerDocument,n=new Set,s=[];for(let o=e;o!==t.body;o=o.parentNode){const c=o.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;s.push(c);for(let u=c.firstElementChild;u;u=u.nextElementSibling)u!==o&&!M.has(u.tagName)&&n.add(u)}return{outside:n,parents:s}}function T(e,t){for(let n=0;n<t.length;n++){const{type:s,target:o}=t[n];s==="attributes"&&e.held.has(o)&&e.held.set(o,!o.hasAttribute("inert"))}}function h(e,t){const{doc:n,held:s,observer:o}=e;t&&T(e,t),T(e,o.takeRecords());const c=e.top,u=[];for(const r of e.layers){const y=_(r,n);y&&!r.live&&(u.push(r),r.returnFocus=P(n)),r.live=y}u.length&&(e.layers=e.layers.filter(r=>!u.includes(r)).concat(u));let i=null;for(let r=e.layers.length-1;r>=0&&!i;r--)e.layers[r].live&&(i=e.layers[r]);e.top=i;const{outside:p,parents:v}=i?k(i.element.node):{outside:new Set,parents:[]};for(const[r,y]of s)p.has(r)||(y&&r.removeAttribute("inert"),s.delete(r));for(const r of p)s.has(r)||s.set(r,!1),r.hasAttribute("inert")||(r.setAttribute("inert",""),s.set(r,!0));o.takeRecords(),o.disconnect();for(const r of v)o.observe(r,{childList:!0});for(const r of s.keys())o.observe(r,R);if(e.layers.some(r=>!r.live)?d.add(e):d.delete(e),i===c)return;const l=c&&!(c.declared&&c.live)?c:null;if(i&&u.includes(i))l&&l.returnFocus&&(i.returnFocus=l.returnFocus),O(()=>m(e,i));else if(l){const r=l.returnFocus;O(()=>L(e,l,r))}l&&(l.returnFocus=null)}function m(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const s=e.doc,o=s.activeElement;if(o&&n.contains(o))return;const c=new Set,u=(i,p)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const v=p&&i.getAttribute("tabindex");return v&&parseInt(v,10)<0?!1:(i.focus(),s.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(u(i,!1))return;for(const i of n.querySelectorAll(N))if(u(i,!0))return;o&&o!==s.body&&typeof o.blur=="function"&&o.blur()}function L(e,t,n){if(t.declared&&t.live)return;const s=e.doc,o=s.activeElement,c=t.element.node;(!o||o===s.body||c&&c.contains(o)||S(o))&&(n&&n.isConnected&&n.ownerDocument===s&&!S(n)&&(n.focus({preventScroll:!0}),s.activeElement===n)||e.top&&m(e,e.top))}function b(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const s=n.layers.indexOf(e);s!==-1&&n.layers.splice(s,1)}h(n)}function A(e){let t=e[a];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function C(e){let t=w.get(e);if(t)return t;const n=e.__ref,s=e.node;if(!n||!s||s.nodeType!==1)return null;const o=x(s.ownerDocument);if(!o)return null;t={element:e,manager:o,declared:!1,live:!1,returnFocus:null},w.set(e,t);const c=I(()=>{const u=A(e);f(()=>b(t,u))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+a});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>f(()=>b(t,!1))),t}function D(){for(const e of d){if(!e.doc.defaultView){d.delete(e);continue}e.layers.some(t=>!t.live&&_(t,e.doc))&&h(e)}}const B={name:a,create(e){g(e,a)&&f(()=>C(e))},render(){d.size&&f(D)},update(e){g(e,a)&&f(()=>{const t=C(e);t&&b(t,A(e))})}};export{B as inertOutsidePlugin};
@@ -1 +1 @@
1
- const a=50,o=[];let u=!1,e=0;function f(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function c(n){const t=typeof globalThis<"u"?globalThis.scheduler:null;if(t&&typeof t.yield=="function"){t.yield().then(n,n);return}if(typeof MessageChannel=="function"){const s=new MessageChannel;s.port1.onmessage=()=>{s.port1.close(),n()},s.port2.postMessage(0);return}setTimeout(n,0)}function d(){return e?f()-e>=50:!1}let r=0;function p(){r===0&&!e&&(e=f()),r++}function h(){r>0&&r--,r===0&&!u&&(e=0)}function _(n){o.push(n),u||(u=!0,c(l))}function l(){for(e=f();o.length;){const n=o.shift();try{n()}catch(t){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",t?.message||t)}if(f()-e>=50)break}if(o.length){c(l);return}u=!1,e=0,r=0}function g(){let t=0;for(e=0;o.length&&t++<1e5;){const s=o.shift();try{s()}catch(i){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",i?.message||i)}}u=!1,e=0,r=0}function M(){return o.length}function y(){o.length=0,u=!1,e=0,r=0}export{a as MOUNT_YIELD_BUDGET_MS,g as __flushMountQueueSync,M as __pendingMountChunks,y as __resetMountQueue,h as closeMountBudget,_ as enqueueMountWork,d as mountBudgetExhausted,p as openMountBudget};
1
+ const p=50,r=[];let l=!1,n=0,s=!1;function i(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function a(e){const t=typeof globalThis<"u"?globalThis.scheduler:null;if(t&&typeof t.yield=="function"){t.yield().then(e,e);return}if(typeof MessageChannel=="function"){const o=new MessageChannel;o.port1.onmessage=()=>{o.port1.close(),e()},o.port2.postMessage(0);return}setTimeout(e,0)}function h(e=0){return!n||i()-n+e<50?!1:(s=!0,!0)}function _(){let e=0,t=0,o=0;return{begin(){o=i()},end(){const f=i()-o;e+=f,t++;const c=e/t;return f>c?f:c}}}let u=0;function g(){u===0&&!n&&(n=i(),s=!1),u++}function M(){u>0&&u--,u===0&&!l&&(n=0,s=!1)}function m(e){r.push(e),l||(l=!0,a(d))}function d(){for(n=i(),s=!1;r.length;){const e=r.shift();try{e()}catch(t){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",t?.message||t)}if(s||i()-n>=50)break}if(r.length){a(d);return}l=!1,n=0,s=!1,u=0}function y(){let t=0;for(n=0;r.length&&t++<1e5;){const o=r.shift();try{o()}catch(f){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",f?.message||f)}}l=!1,n=0,s=!1,u=0}function x(){return r.length}function T(){r.length=0,l=!1,n=0,s=!1,u=0}export{p as MOUNT_YIELD_BUDGET_MS,y as __flushMountQueueSync,x as __pendingMountChunks,T as __resetMountQueue,_ as childCostMeter,M as closeMountBudget,m as enqueueMountWork,h as mountBudgetExhausted,g as openMountBudget};
@@ -0,0 +1 @@
1
+ import{runPluginHook as c}from"@symbo.ls/utils/function.js";const o=new WeakMap;let l=null,f=null;function s(t,n){let e=t===l?f:o.get(t);(!e||e.length!==t.length)&&(e={length:t.length,hooks:new Map},o.set(t,e)),l=t,f=e;let r=e.hooks.get(n);if(r===void 0){r=!1;for(const i of t)if(typeof i[n]=="function"){r=!0;break}e.hooks.set(n,r)}return r}function u(t,n){const e=t&&t.context&&t.context.plugins;return!!(e&&e.length&&s(e,n))}function a(t,n,...e){return u(n,t)?c(t,n,...e):!1}function h(t,n,e){a("error",t,{hook:n,error:e})||console.error(`[DOMQL] Lifecycle "${n}" error:`,e)}export{a as dispatchPluginHook,u as hasPluginHook,h as reportLifecycleError};
@@ -0,0 +1 @@
1
+ import*as s from"@symbo.ls/signal";import{pushConfig as n,popConfig as o}from"@symbo.ls/scratch";function c(r,t){const e=r&&r.context&&r.context.designSystem;if(!e)return t();n(e);try{return t()}finally{o()}}const u=s.untrack||(r=>{const t=s.getObserver();if(!t)return r();s.setObserver(null);try{return r()}finally{s.setObserver(t)}});export{u as untrack,c as withDesignSystem};
@@ -1 +1 @@
1
- import{batch as _,isStore as v}from"@symbo.ls/signal";import{REGISTRY as p}from"./registry.js";import{create as x,resolveStyleBlock as b,acquireBeforeUpdateGuard as g,releaseBeforeUpdateGuard as l,writeElementText as A,reconcileAttrProp as k,checkedBefore as P,followChecked as j,isStaticCssProp as B,recompileStaticCss as U}from"./create.js";import{runPluginHook as u}from"@symbo.ls/utils/function.js";import{serializeAttrValue as S,isEnumeratedTrueFalseAttr as C}from"attrs-in-props";function w(o={},f={}){const e=this,i=e.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!f.preventListeners&&typeof e.onBeforeUpdate=="function"&&g(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,f);if(t&&typeof t.then=="function")t.then(()=>l(i,!1),n=>{l(i,!0),e.context?.plugins?.length&&u("error",e,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if(l(i,!1),t===!1)return e}catch(t){throw l(i,!0),t}const a=!o||Object.keys(o).length===0,c=[];let d=!1;_(()=>{if(o.state&&v(e.state)&&e.state.$update(o.state),o.text!==void 0&&(e.text=o.text,!i.__exec.text&&e.node&&A(e,o.text??"")),o.html!==void 0&&(e.html=o.html,!i.__exec.html&&e.node&&(e.node.innerHTML=o.html)),o.style&&e.node?.style){if(!i.__exec.style){const t=b(e,o.style);for(const n in t){const r=t[n];if(r==null)continue;const s=n.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),y=String(r).replace(/\s*!important\s*$/,"");e.node.style.setProperty(s,y,"important")}}e.style||(e.style={}),Object.assign(e.style,o.style)}if(o.attr&&e.node?.setAttribute){for(const t in o.attr){const n=o.attr[t],r=P(e.node,t);n==null||n===!1&&!C(t)?e.node.removeAttribute(t):typeof n!="function"&&typeof n!="object"&&e.node.setAttribute(t,S(t,n)),j(e.node,r)}e.attr||(e.attr={}),Object.assign(e.attr,o.attr)}if(o.data&&e.node?.dataset){for(const t in o.data)e.node.dataset[t]=o.data[t];e.data||(e.data={}),Object.assign(e.data,o.data)}if(o.vars&&typeof o.vars=="object"&&!Array.isArray(o.vars)){const t=e.vars&&typeof e.vars=="object"&&!Array.isArray(e.vars)?e.vars:null;e.vars={...t,...o.vars},d=!0}for(const t in o){if(p.has(t)||t==="state")continue;const n=o[t],r=e[t];if(r&&r.__ref&&typeof r.update=="function")r.update(n,f);else if(typeof n=="object"&&n!==null){const s=t.charCodeAt(0);s>=65&&s<=90&&x(n,e,t,f)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=n,typeof n!="function"&&c.push(t))}});for(let t=0;t<c.length;t++)k(e,c[t]);if(e.node){let t=d;for(let n=0;!t&&n<c.length;n++)B(c[n])&&(t=!0);t&&U(e)}if(e.node&&a&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const n=i.__effects[t];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return u("update",e),!f.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,f),e}var G=w;export{G as default,w as update};
1
+ import{batch as h,isStore as _}from"@symbo.ls/signal";import{REGISTRY as v}from"./registry.js";import{create as x,resolveStyleBlock as p,acquireBeforeUpdateGuard as b,releaseBeforeUpdateGuard as l,writeElementText as g,reconcileAttrProp as P,writeAttr as A,isStaticCssProp as U,recompileStaticCss as j}from"./create.js";import{dispatchPluginHook as u}from"./pluginHooks.js";import{cssPropName as B}from"./cssLonghands.js";function S(o={},f={}){const t=this,i=t.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!f.preventListeners&&typeof t.onBeforeUpdate=="function"&&b(i))try{const e=t.onBeforeUpdate(t,t.state,t.context,f);if(e&&typeof e.then=="function")e.then(()=>l(i,!1),n=>{l(i,!0),u("error",t,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if(l(i,!1),e===!1)return t}catch(e){throw l(i,!0),e}const a=!o||Object.keys(o).length===0,c=[];let d=!1;h(()=>{if(o.state&&_(t.state)&&t.state.$update(o.state),o.text!==void 0&&(t.text=o.text,!i.__exec.text&&t.node&&g(t,o.text??"")),o.html!==void 0&&(t.html=o.html,!i.__exec.html&&t.node&&(t.node.innerHTML=o.html)),o.style&&t.node?.style){if(!i.__exec.style){const e=p(t,o.style);for(const n in e){const r=e[n];if(r==null)continue;const s=B(n),y=String(r).replace(/\s*!important\s*$/,"");t.node.style.setProperty(s,y,"important")}}t.style||(t.style={}),Object.assign(t.style,o.style)}if(o.attr&&t.node?.setAttribute){for(const e in o.attr){const n=o.attr[e];A(t.node,e,n)}t.attr||(t.attr={}),Object.assign(t.attr,o.attr)}if(o.data&&t.node?.dataset){for(const e in o.data)t.node.dataset[e]=o.data[e];t.data||(t.data={}),Object.assign(t.data,o.data)}if(o.vars&&typeof o.vars=="object"&&!Array.isArray(o.vars)){const e=t.vars&&typeof t.vars=="object"&&!Array.isArray(t.vars)?t.vars:null;t.vars={...e,...o.vars},d=!0}for(const e in o){if(v.has(e)||e==="state")continue;const n=o[e],r=t[e];if(r&&r.__ref&&typeof r.update=="function")r.update(n,f);else if(typeof n=="object"&&n!==null){const s=e.charCodeAt(0);s>=65&&s<=90&&x(n,t,e,f)}else e!=="text"&&e!=="html"&&e!=="style"&&e!=="attr"&&e!=="data"&&(t[e]=n,typeof n!="function"&&c.push(e))}});for(let e=0;e<c.length;e++)P(t,c[e]);if(t.node){let e=d;for(let n=0;!e&&n<c.length;n++)U(c[n])&&(e=!0);e&&j(t)}if(t.node&&a&&i.__effects&&i.__effects.length)for(let e=0;e<i.__effects.length;e++){const n=i.__effects[e];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(t.node&&i.__conditionalRunners)for(const e of i.__conditionalRunners)e();return u("update",t),!f.preventListeners&&typeof t.onUpdate=="function"&&t.onUpdate(t,t.state,t.context,f),t}var L=S;export{L as default,S as update};
@@ -1 +1 @@
1
- const o="3.14.802";export{o as VERSION};
1
+ const o="3.14.804";export{o as VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.802",
3
+ "version": "3.14.804",
4
4
  "description": "Core element creation, update, and disposal engine for smbls v3.14",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -20,13 +20,13 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@symbo.ls/css": "^3.14.775",
24
- "@symbo.ls/scratch": "^3.14.787",
25
- "@symbo.ls/signal": "^3.14.786",
23
+ "@symbo.ls/css": "^3.14.777",
24
+ "@symbo.ls/scratch": "^3.14.788",
25
+ "@symbo.ls/signal": "^3.14.787",
26
26
  "@symbo.ls/state": "^3.14.681",
27
- "@symbo.ls/utils": "^3.14.785",
28
- "css-in-props": "^3.14.761",
29
- "attrs-in-props": "^3.14.695"
27
+ "@symbo.ls/utils": "^3.14.786",
28
+ "css-in-props": "^3.14.762",
29
+ "attrs-in-props": "^3.14.696"
30
30
  },
31
31
  "files": [
32
32
  "dist",