@symbo.ls/element 3.14.797 → 3.14.799
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 +42 -0
- package/dist/cjs/src/attributeFirst.js +1 -1
- package/dist/cjs/src/bridge.js +1 -0
- package/dist/cjs/src/create.js +5 -5
- package/dist/cjs/src/cssLonghands.js +1 -1
- package/dist/cjs/src/delegate.js +1 -1
- package/dist/cjs/src/dispose.js +1 -1
- package/dist/cjs/src/extends.js +1 -1
- package/dist/cjs/src/index.js +1 -1
- package/dist/cjs/src/inertOutside.js +1 -0
- package/dist/cjs/src/registry.js +1 -1
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/esm/src/attributeFirst.js +1 -1
- package/dist/esm/src/bridge.js +1 -0
- package/dist/esm/src/create.js +5 -5
- package/dist/esm/src/cssLonghands.js +1 -1
- package/dist/esm/src/delegate.js +1 -1
- package/dist/esm/src/dispose.js +1 -1
- package/dist/esm/src/extends.js +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/inertOutside.js +1 -0
- package/dist/esm/src/registry.js +1 -1
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/package.json +8 -8
package/dist/esm/src/extends.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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};
|
package/dist/esm/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{create as
|
|
1
|
+
import{create as o,default as r,flushMounts as E}from"./create.js";import{update as d}from"./update.js";import{dispose as p,remove as s}from"./dispose.js";import{REGISTRY as m,LIFECYCLE_EVENTS as n,DELEGATED_EVENTS as x,NON_BUBBLING_EVENTS as g,MIXINS as T}from"./registry.js";import{addDelegatedEvent as N,removeDelegatedEvent as v,registerEvent as S,registerGlobalEvent as u,globalEventKeyInfo as G}from"./delegate.js";import{cacheNode as c,detectTag as L,createHTMLNode as V,isValidTag as _,isSvgTag as h,SVG_TAGS as D}from"./cache.js";import{applyExtends as B}from"./extends.js";import{addMethods as b,refreshContextProto as y}from"./methods.js";import{inertOutsidePlugin as O}from"./inertOutside.js";export{x as DELEGATED_EVENTS,n as LIFECYCLE_EVENTS,T as MIXINS,g as NON_BUBBLING_EVENTS,m as REGISTRY,D as SVG_TAGS,N as addDelegatedEvent,b as addMethods,B as applyExtends,c as cacheNode,o as create,V as createHTMLNode,r as default,L as detectTag,p as dispose,E as flushMounts,G as globalEventKeyInfo,O as inertOutsidePlugin,h as isSvgTag,_ as isValidTag,y as refreshContextProto,S as registerEvent,u as registerGlobalEvent,s as remove,v as removeDelegatedEvent,d as update};
|
|
@@ -0,0 +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};
|
package/dist/esm/src/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","srcObject","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),s=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{s as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
|
|
1
|
+
const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","vars","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","srcObject","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove","bridgeMount","bridgeUpdate","bridgeDestroy"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),s=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{s as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
|
package/dist/esm/src/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{batch as
|
|
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 P,isStaticCssProp as j,recompileStaticCss as U}from"./create.js";import{runPluginHook as u}from"@symbo.ls/utils/function.js";import{serializeAttrValue as B,isEnumeratedTrueFalseAttr as S}from"attrs-in-props";function k(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,s=[];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 c=n.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),y=String(r).replace(/\s*!important\s*$/,"");e.node.style.setProperty(c,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];n==null||n===!1&&!S(t)?e.node.removeAttribute(t):typeof n!="function"&&typeof n!="object"&&e.node.setAttribute(t,B(t,n))}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 c=t.charCodeAt(0);c>=65&&c<=90&&x(n,e,t,f)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=n,typeof n!="function"&&s.push(t))}});for(let t=0;t<s.length;t++)P(e,s[t]);if(e.node){let t=d;for(let n=0;!t&&n<s.length;n++)j(s[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 w=k;export{w as default,k as update};
|
package/dist/esm/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="3.14.
|
|
1
|
+
const o="3.14.799";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.799",
|
|
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.
|
|
26
|
-
"@symbo.ls/state": "^3.14.
|
|
27
|
-
"@symbo.ls/utils": "^3.14.
|
|
28
|
-
"css-in-props": "^3.14.
|
|
29
|
-
"attrs-in-props": "^3.14.
|
|
23
|
+
"@symbo.ls/css": "^3.14.774",
|
|
24
|
+
"@symbo.ls/scratch": "^3.14.786",
|
|
25
|
+
"@symbo.ls/signal": "^3.14.786",
|
|
26
|
+
"@symbo.ls/state": "^3.14.681",
|
|
27
|
+
"@symbo.ls/utils": "^3.14.784",
|
|
28
|
+
"css-in-props": "^3.14.761",
|
|
29
|
+
"attrs-in-props": "^3.14.694"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|