@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.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/src/bridge.js +1 -1
- package/dist/cjs/src/create.js +5 -5
- package/dist/cjs/src/cssLonghands.js +1 -1
- package/dist/cjs/src/dispose.js +1 -1
- package/dist/cjs/src/extends.js +1 -1
- package/dist/cjs/src/inertOutside.js +1 -1
- package/dist/cjs/src/mountScheduler.js +1 -1
- package/dist/cjs/src/pluginHooks.js +1 -0
- package/dist/cjs/src/runContext.js +1 -0
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/esm/src/bridge.js +1 -1
- package/dist/esm/src/create.js +5 -5
- package/dist/esm/src/cssLonghands.js +1 -1
- package/dist/esm/src/dispose.js +1 -1
- package/dist/esm/src/extends.js +1 -1
- package/dist/esm/src/inertOutside.js +1 -1
- package/dist/esm/src/mountScheduler.js +1 -1
- package/dist/esm/src/pluginHooks.js +1 -0
- package/dist/esm/src/runContext.js +1 -0
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/package.json +7 -7
package/dist/esm/src/extends.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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
|
|
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
|
|
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};
|
package/dist/esm/src/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{batch as
|
|
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};
|
package/dist/esm/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="3.14.
|
|
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.
|
|
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.
|
|
24
|
-
"@symbo.ls/scratch": "^3.14.
|
|
25
|
-
"@symbo.ls/signal": "^3.14.
|
|
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.
|
|
28
|
-
"css-in-props": "^3.14.
|
|
29
|
-
"attrs-in-props": "^3.14.
|
|
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",
|