@symbo.ls/element 3.14.802 → 3.14.803

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
- 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 _,isStore as v}from"@symbo.ls/signal";import{REGISTRY as x}from"./registry.js";import{create as p,resolveStyleBlock as b,acquireBeforeUpdateGuard as g,releaseBeforeUpdateGuard as l,writeElementText as A,reconcileAttrProp as P,writeAttr as U,isStaticCssProp as j,recompileStaticCss as B}from"./create.js";import{dispatchPluginHook as u}from"./pluginHooks.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"&&g(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;_(()=>{if(o.state&&v(t.state)&&t.state.$update(o.state),o.text!==void 0&&(t.text=o.text,!i.__exec.text&&t.node&&A(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=b(t,o.style);for(const n in e){const r=e[n];if(r==null)continue;const s=n.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),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];U(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(x.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&&p(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++)j(c[n])&&(e=!0);e&&B(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 O=S;export{O as default,S as update};
@@ -1 +1 @@
1
- const o="3.14.802";export{o as VERSION};
1
+ const o="3.14.803";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.803",
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",