incajs 0.0.32 → 0.0.33
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/chunks/hooks-CxYWemIJ.js +1 -0
- package/dist/chunks/rendererCore-B5s1VDRj.d.ts +145 -0
- package/dist/chunks/rendererCore-Cnyh79II.js +1 -0
- package/dist/chunks/treeOps-HfdCml0F.js +1 -0
- package/dist/chunks/{window-gMkkjr_q.d.ts → window-CE2esnja.d.ts} +312 -46
- package/dist/globals.d.mts +4 -1
- package/dist/index.d.ts +3 -8
- package/dist/index.js +1 -1
- package/dist/rendererCore.d.ts +3 -3
- package/dist/rendererCore.js +1 -1
- package/dist/style.js +1 -1
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/hooks-DGPTjDZ2.js +0 -1
- package/dist/chunks/rendererCore-Cf8-27u1.d.ts +0 -445
- package/dist/chunks/rendererCore-p80C6A9w.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`http://www.w3.org/1999/xhtml`;function t(){return globalThis.__inca_native__}function n(){return t().rootNodeId()}function r(){return t().documentNodeId()}function i(e){return t().createElement(e)}function a(e,n){return t().createElementNS(e,n)}function o(e){return e.length===5?[e[1],e[2],e[3],e[4]]:e[1]}function s(e){return e[2]===`http://www.w3.org/1999/xhtml`?e[1]:[e[1],e[2],null,e[1]]}function c(e){return t().createNode(e)}function l(e,n){return t().appendChild(e,n)}function u(e,n,r){return t().insertBefore(e,n,r)}function d(e,n){t().removeChild(e,n)}function ee(e,n,r){return t().replaceChild(e,n,r)}function f(e,n){return t().cloneNode(e,n)}function te(e){return t().innerHtml(e)}function ne(e){return t().outerHtml(e)}function re(e,n){return t().setInnerHtml(e,n)}function ie(e,n){return t().setOuterHtml(e,n)}function ae(e,n,r){return t().insertAdjacentHtml(e,n,r)}function oe(e){return t().rootOf(e)}function se(e,n){return t().compareNodePosition(e,n)}function ce(e,n){return t().isEqualNode(e,n)}function le(e){return t().removeNode(e)}function p(e){t().holdNode(e)}function ue(e){t().releaseNode(e)}function de(e){return t().templateContent(e)}function m(e,n,r){return t().linkedNode(e,n,r)}function h(e,n){return t().childNodeIds(e,n)}function fe(e){return t().isConnected(e)}function pe(e){return t().textContent(e)}function me(e){return t().wholeText(e)}function he(e,n,r){return t().substringData(e,n,r)}function ge(e,n,r,i){t().replaceData(e,n,r,i)}function _e(e,n){return t().splitText(e,n)}function ve(e,n){return t().matches(e,n)}function ye(e,n){return t().closest(e,n)}function be(e,n){return t().querySelector(e,n)}function xe(e,n){return t().querySelectorAll(e,n)}function g(e){t().checkSelector(e)}function _(e,n,r){t().setAttribute(e,n,r)}function Se(e,n){return t().attributeKey(e,n)}function v(e,n){return t().getAttribute(e,n)}function Ce(e){return t().classList(e)}function we(e){return t().attributeNames(e)}function Te(e,n){return t().datasetGet(e,n)}function Ee(e,n,r){t().datasetSet(e,n,r)}function De(e,n){return t().datasetDelete(e,n)}function Oe(e){return t().datasetKeys(e)}function ke(){return t().datasetTarget()}function Ae(e,n){t().removeAttribute(e,n)}function je(e,n,r){t().setStyle(e,n,r)}function Me(e,n){t().removeStyle(e,n)}function Ne(e){return t().styleOf(e)}function Pe(e){return t().inputValue(e)}function Fe(e,n){t().setInputValue(e,n)}function Ie(e){return t().layoutOf(e)}function y(e){return t().scrollOf(e)}function Le(e,n,r){t().scrollNode(e,n,r)}function Re(e,n,r){t().scrollIntoViewNode(e,n,r)}function ze(e,n,r,i,a){return t().addEventListener(e,n,r,i,a)}function Be(e,n,r){return t().removeEventListener(e,n,r)}function Ve(e,n){return t().dispatchEvent(e,n)}function He(e){t().click(e)}function Ue(e,n){t().focusNode(e,n)}function We(e){t().blurNode(e)}function Ge(e,n){t().setPointerCapture(e,n)}function Ke(e,n){t().releasePointerCapture(e,n)}function qe(e,n){return t().hasPointerCapture(e,n)}function Je(){return t().focusedNode()}function b(){let e=[],t=[];return{get:t=>e[t>>>10]?.[t&1023],set(n,r){let i=n>>>10;for(;e.length<=i;)e.push(void 0),t.push(0);let a=e[i];a===void 0&&(a=e[i]=Array.from({length:1024}));let o=n&1023;a[o]===void 0&&t[i]++,a[o]=r},delete(n){let r=n>>>10,i=e[r],a=n&1023;i?.[a]!==void 0&&(i[a]=void 0,--t[r]===0&&(e[r]=void 0))}}}const Ye=/* @__PURE__ */ new WeakSet;function x(e,t){return Ye.add(e),Object.defineProperty(e,"__node_id",{value:t})}function Xe(e){return typeof e==`object`&&!!e&&Ye.has(e)}const S=b(),C=b();let Ze;function w(e){S.delete(e.__node_id),C.set(e.__node_id,new WeakRef(e))}function Qe(e){Ze=e.__node_id,w(e)}function T(e){let t=e.__node_id;t!==Ze&&(S.set(t,e),C.delete(t))}function E(e){D(e),O(e)}const $e=/* @__PURE__ */ new WeakMap;function et(e,t){D(e);let n=[];for(let r of t){let t=k(r);t!==void 0&&t!==e&&(D(t),n.push(t))}$e.set(e,n),dt(e)||M(e)}function D(e){let t=e.__node_id;C.set(t,new WeakRef(e)),S.delete(t)}function O(e){dt(e)||(p(e.__node_id),M(e))}function k(e){return S.get(e)??C.get(e)?.deref()}function tt(e){let t=k(e);return t?.kind===`element`?t:void 0}const nt=/* @__PURE__ */ new WeakMap,rt=/* @__PURE__ */ new WeakMap;function it(e){return e.kind===`element`?nt.get(e):void 0}function at(e,t){nt.set(e,t),rt.set(t,e)}const ot=/* @__PURE__ */ new WeakSet;function A(e){return ot.has(e)||j(e)}function st(e){for(let t of e){let e=k(t);e&&ot.add(e)}}function j(e){return k(e.__node_id)!==e}function ct(e){for(let t of e)S.delete(t),C.delete(t)}const lt=new FinalizationRegistry(e=>ue(e)),ut=/* @__PURE__ */ new WeakSet;function dt(e){return ut.has(e)}function M(e){ut.add(e),lt.register(e,e.__node_id)}const N=/* @__PURE__ */ new Map,P=b();function ft(e,t,n){let r=N.get(e);r||N.set(e,r=/* @__PURE__ */ new Map),r.set(t,n),P.set(n,{group:e,listener:t})}function pt(e,t){return N.get(e)?.get(t)}function mt(e){let t=P.get(e);if(t===void 0)return;P.delete(e);let n=N.get(t.group);n?.delete(t.listener),n?.size===0&&N.delete(t.group)}function ht(e){for(let t of e)mt(t)}const gt=(e,t,n)=>`${e}:${t}:${n===!0}`;Object.defineProperty(globalThis,"__inca_released__",{value:(e,t)=>{ht(t),ct(e)},configurable:!0});let F=0;function _t(){return F}function vt(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>F&&(F=n),e(...t)}}function yt(e,t,n,r={}){if(n==null)return;let i=gt(e,t,r.capture);if(pt(i,n)!==void 0)return;let a=(...e)=>typeof n==`function`?n.apply(e[0]?.currentTarget,e):n.handleEvent.apply(n,e);ft(i,n,ze(e,t,vt(r.once?(...i)=>(bt(e,t,n,r),a(...i)):a),r.capture===!0,r.passive===!0))}function bt(e,t,n,r={}){if(n==null)return;let i=pt(gt(e,t,r.capture),n);i!==void 0&&(Be(e,t,i),mt(i))}function I(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};yt(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;bt(n(),e,t,{capture:i})},dispatchEvent:e=>Ve(n(),e)}}function L(e){if(typeof e==`symbol`)throw TypeError(`a symbol cannot become text`);return String(e)}function R(e,t,n){if(e.length<t)throw TypeError(`${n}() needs ${t} argument${t===1?``:`s`}`)}function xt(e){return e==null?``:L(e)}function z(e,t){if(!Xe(e))throw TypeError(`parameter ${t} is not a node. pass an element, a text node, a comment or a fragment`);return e}const St=/^(?:0|[1-9]\d*)$/,Ct=2**32-1;function B(e){return St.test(e)&&Number(e)<Ct}function wt(e,t){return t===``?null:e.find(e=>e.id===t)??e.find(e=>e.getAttribute(`name`)===t)??null}function Tt(e){let t=/* @__PURE__ */ new Set;for(let n of e)t.add(n.id),t.add(n.getAttribute(`name`)??``);return t.delete(``),[...t]}function Et(e){let{source:t,named:n}=e,r=e=>{if(e!==l)throw TypeError(`the receiver is not a collection. call it on one`)},i={writable:!0,enumerable:!0,configurable:!0},a=Object.create(Object.prototype,{length:{get(){return r(this),t().length},enumerable:!0,configurable:!0},item:{...i,value:Object.defineProperty(function(...e){if(r(this),e.length<1)throw TypeError(`item() needs 1 argument`);return t()[e[0]>>>0]??null},"length",{value:1})},...e.method&&{[e.method]:{...i,value(...t){if(r(this),t.length<1)throw TypeError(`${e.method}() needs 1 argument`);return e.find(`${t[0]}`)}}},...e.arrayMembers&&{forEach:{...i,value:Array.prototype.forEach},entries:{...i,value:Array.prototype.entries},keys:{...i,value:Array.prototype.keys},values:{...i,value:Array.prototype.values}},[Symbol.iterator]:{...i,enumerable:!1,value:Array.prototype.values},[Symbol.toStringTag]:{value:e.tag,configurable:!0}}),o=Object.create(a),s=e=>Object.hasOwn(o,e),c=e=>B(e)||!s(e)&&!(e in a)&&n(e)!==null,l=new Proxy(o,{get(e,r,i){return typeof r==`symbol`?Reflect.get(o,r,i):B(r)?t()[Number(r)]:r in o?Reflect.get(o,r,i):n(r)??void 0},has(e,r){return typeof r==`symbol`||r in o?r in o:B(r)?Number(r)<t().length:n(r)!==null},set(e,t,n,r){return r===l&&typeof t==`string`&&c(t)?!1:Reflect.set(o,t,n,r)},deleteProperty(e,n){if(typeof n==`string`){if(B(n))return Number(n)>=t().length;if(c(n))return!1}return Reflect.deleteProperty(o,n)},preventExtensions:()=>!1,defineProperty(e,t,n){return typeof t==`string`&&c(t)?!1:Reflect.defineProperty(o,t,n)},ownKeys(){let n=t(),r=Array.from(n,(e,t)=>String(t)),i=e.names(n).filter(e=>!B(e)&&!(e in a)&&!s(e)),c=Reflect.ownKeys(o);return[...r,...c,...i]},getOwnPropertyDescriptor(e,r){if(typeof r==`symbol`||s(r))return Reflect.getOwnPropertyDescriptor(o,r);if(B(r)){let e=t()[Number(r)];return e?{value:e,writable:!1,enumerable:!0,configurable:!0}:void 0}let i=r in a?void 0:n(r);return i?{value:i,writable:!1,enumerable:!1,configurable:!0}:void 0}});return l}function Dt(e){let t=t=>wt(e(),t);return Et({tag:`HTMLCollection`,method:`namedItem`,source:e,find:t,named:t,names:Tt})}function Ot(e,t){return Et({tag:`NamedNodeMap`,method:`getNamedItem`,source:e,find:t,named:t,names:e=>e.map(e=>e.name)})}function kt(e){return Et({tag:`NodeList`,arrayMembers:!0,source:e,find:()=>null,named:()=>null,names:()=>[]})}var At=class e{#e;#t;#n;#r;#i;constructor(e,t,n,r,i){this.#e=e,this.#i=t,this.#t=n,this.#r=r,this.#n=i}static detach(e){e.#r=null,e.#n(e)}#a(){if(this.#r===null)return!1;let t=j(this.#r)?null:v(this.#t,this.#e);return t===null?(e.detach(this),!1):(this.#i=L(t),!0)}get name(){return this.#e}get localName(){return this.#e}get value(){return this.#a(),this.#i}set value(e){let t=L(e);this.#a()&&_(this.#t,this.#e,t),this.#i=t}get namespaceURI(){return null}get prefix(){return null}get specified(){return!0}get ownerElement(){return this.#a(),this.#r}get[Symbol.toStringTag](){return`Attr`}};function jt(e,t){let n=t=>{let n=v(e,t);return n===null?null:L(n)},r=()=>j(t)?[]:we(e),i=/* @__PURE__ */ new Map,a=e=>{i.get(e.name)===e&&i.delete(e.name)},o=(n,r)=>{let o=i.get(n);return o||(o=new At(n,r,e,t,a),i.set(n,o)),o},s=r=>{if(j(t))return null;let a=Se(e,r),s=n(a);if(s!==null)return o(a,s);let c=i.get(a);return c&&At.detach(c),null},c=()=>{let e=r(),t=new Set(e);for(let[e,n]of i)t.has(e)||At.detach(n);return e.map(e=>i.get(e)??o(e,n(e)))},l;return{getAttribute:(...e)=>(R(e,1,`getAttribute`),j(t)?null:n(L(e[0]))),setAttribute:(...n)=>{R(n,2,`setAttribute`);let r=L(n[0]),i=L(n[1]);j(t)||_(e,r,i)},hasAttribute:(...e)=>(R(e,1,`hasAttribute`),!j(t)&&n(L(e[0]))!==null),removeAttribute:(...n)=>{R(n,1,`removeAttribute`);let r=L(n[0]);j(t)||Ae(e,r)},getAttributeNames:()=>r(),get attributes(){return l??=Ot(c,s),l}}}function Mt(e,t){let n;return{get className(){return j(t)?``:String(v(e,`class`)??``)},set className(n){let r=L(n);j(t)||_(e,`class`,r)},get classList(){return n??=Ce(e)},set classList(t){(n??=Ce(e)).value=t}}}function Nt(e){let t;return{get dataset(){return t??=new Proxy(ke(),{get(t,n,r){let i=typeof n==`string`?Te(e,n):void 0;return typeof i==`string`?i:Reflect.get(t,n,r)},set(t,n,r,i){return typeof n==`string`?(Ee(e,n,L(r)),!0):Reflect.set(t,n,r,i)},deleteProperty(t,n){return typeof n==`string`?De(e,n):Reflect.deleteProperty(t,n)},defineProperty(t,n,r){return typeof n==`string`?!(`value`in r)||r.configurable===!1?!1:(Ee(e,n,L(r.value)),!0):Reflect.defineProperty(t,n,r)},preventExtensions:()=>!1,has:(t,n)=>typeof n==`string`&&Oe(e).includes(n)||Reflect.has(t,n),ownKeys:t=>[...Oe(e),...Reflect.ownKeys(t)],getOwnPropertyDescriptor(t,n){let r=typeof n==`string`?Te(e,n):void 0;return typeof r==`string`?{value:r,writable:!0,enumerable:!0,configurable:!0}:Reflect.getOwnPropertyDescriptor(t,n)}}),t}}}function Pt(e,t){let n=e.__node_id,r=e=>t.node(e),i=t=>{if(j(e))return null;let i=m(n,t,!0);return i===null?null:r(i)??null},a=()=>j(e)?[]:h(n,!0).flatMap(e=>r(e)??[]),o;return{get children(){return o??=Dt(a)},get parentElement(){return i(`parent`)},get firstElementChild(){return i(`first`)},get lastElementChild(){return i(`last`)},get childElementCount(){return a().length},get previousElementSibling(){return i(`previous`)},get nextElementSibling(){return i(`next`)}}}const Ft=((...e)=>e)(`auxclick`,`beforeinput`,`blur`,`change`,`click`,`contextmenu`,`dblclick`,`focus`,`gotpointercapture`,`input`,`keydown`,`keypress`,`keyup`,`lostpointercapture`,`mousedown`,`mouseenter`,`mouseleave`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointerenter`,`pointerleave`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`scroll`,`wheel`);function It(e,t){for(let n of Ft){let r=null,i=function(e){typeof r==`function`&&Reflect.apply(r,this,[e])===!1&&e.preventDefault()};Object.defineProperty(e,`on${n}`,{get:()=>r,set(a){t()||(r=typeof a==`function`||typeof a==`object`&&a?a:null,r===null?e.removeEventListener(n,i):e.addEventListener(n,i))}})}return e}function V(e){return A(e)?null:Ie(e.__node_id)}function Lt(e,t){if(!V(e))return null;let n=m(e.__node_id,`parent`,!0),r=n===null?void 0:t.node(n);return r&&V(r)?r:null}function Rt(e,t){let n=V(e);if(!n)return{left:0,top:0};let r=Lt(e,t),i=r?V(r):null;return{left:Math.round(n[0]-(i?i[0]+i[4]:0)+n[5])||0,top:Math.round(n[1]-(i?i[1]+i[4]:0)+n[6])||0}}function zt(e){let[t,n,r,i]=e??[0,0,0,0,0],a={x:t,y:n,width:r,height:i,top:n,left:t,right:t+r,bottom:n+i};return{...a,toJSON:()=>({...a})}}function Bt(e,t){let n=t===`button`||t===`input`?0:-1;if(typeof e!=`string`&&typeof e!=`number`)return n;let r=/^[\t\n\f\r ]*([+-]?\d+)/.exec(String(e));if(!r)return n;let i=Number(r[1])||0;return i>=-2147483648&&i<=2147483647?i:n}function Vt(e,t){return{getBoundingClientRect:()=>zt(V(e)),get offsetWidth(){return Math.round(V(e)?.[2]??0)},get offsetHeight(){return Math.round(V(e)?.[3]??0)},get offsetLeft(){return Rt(e,t).left},get offsetTop(){return Rt(e,t).top},get offsetParent(){return Lt(e,t)},get clientWidth(){let t=V(e);return t?Math.max(0,Math.round(t[2]-2*t[4])):0},get clientHeight(){let t=V(e);return t?Math.max(0,Math.round(t[3]-2*t[4])):0},get clientLeft(){return Math.round(V(e)?.[4]??0)},get clientTop(){return Math.round(V(e)?.[4]??0)}}}function Ht(e){return e===null?``:L(e)}function Ut(e,t){for(let n of e[1]){let[e,r]=n;r!==`#fragment`&&T(r===`#text`?t.text(e,n[4]??``):r===`#comment`?t.element(e,`comment`):t.element(e,`element`,s(n)))}}function Wt(e,t){let n=e.__node_id;return{get innerHTML(){return j(e)?``:te(n)},set innerHTML(r){let i=Ht(r);if(j(e))return;let a=h((it(e)??e).__node_id),o=re(n,i);for(let e of a){let t=k(e);t&&E(t)}Ut(o,t)},get outerHTML(){return j(e)?``:ne(n)},set outerHTML(r){let i=Ht(r);if(j(e))return;let a=ie(n,i);a!==null&&(E(e),Ut(a,t))},insertAdjacentHTML:(...r)=>{R(r,2,`insertAdjacentHTML`);let i=L(r[0]),a=L(r[1]);j(e)||Ut(ae(n,i,a),t)}}}function Gt(e){let t,n=()=>t??=Ne(e);return{get style(){return n()},set style(e){n().cssText=e===null?``:L(e)}}}function Kt(e,t,n){if(e.length===5)return n.element(e[0],`element`,o(e));switch(e[1]){case`#text`:return n.text(e[0],e[2]??``);case`#comment`:return n.element(e[0],`comment`);case`#document`:return n.documentCopy(e[0]);default:return t===0?n.fragment(e[0]):void 0}}function qt(e,t,n){let r=f(e.__node_id,t),i=Kt(r[0],0,n);for(let[e,t]of r.entries()){if(e===0)continue;let r=Kt(t,e,n);r&&T(r)}return O(i),i}function H(){return new DOMException(`the node was freed. pass a child of the node you call it on`,`NotFoundError`)}function U(e,t){let n=e.__node_id,r=e=>{e.kind!==`fragment`&&T(e)};return{appendChild:(...e)=>{R(e,1,`appendChild`);let t=z(e[0],1);return l(n,t.__node_id),r(t),t},insertBefore:(...e)=>{R(e,2,`insertBefore`);let t=z(e[0],1),i=e[1]===null||e[1]===void 0?null:z(e[1],2);if(i&&j(i))throw H();return u(n,t.__node_id,i?.__node_id??null),r(t),t},removeChild:(...e)=>{R(e,1,`removeChild`);let t=z(e[0],1);if(j(t))throw H();return d(n,t.__node_id),E(t),t},replaceChild:(...e)=>{R(e,2,`replaceChild`);let t=z(e[0],1),i=z(e[1],2);if(j(i))throw H();return ee(n,t.__node_id,i.__node_id),r(t),i!==t&&E(i),i},cloneNode:n=>qt(e,!!n,t)}}function W(e,t){let n=e.__node_id,r=e=>e==null?null:z(e,1);return{contains:t=>{let i=r(t);return i===null?!1:i===e?!0:j(e)||j(i)?!1:!!(se(n,i.__node_id)&16)},getRootNode:()=>j(e)?e:t.node(oe(n))??e,compareDocumentPosition:(...t)=>{R(t,1,`compareDocumentPosition`);let r=z(t[0],1);return r===e?0:j(e)||j(r)?33|(r.__node_id<n?2:4):se(n,r.__node_id)},isSameNode:t=>r(t)===e,isEqualNode:t=>{let i=r(t);return i===null?!1:j(e)||j(i)?i===e:ce(n,i.__node_id)}}}const Jt={element:1,text:3,comment:8,document:9,fragment:11};function G(e){return j(e)?e.kind===`text`?e.text:``:String(v(e.__node_id,`value`)??``)}function Yt(e,t){e.kind!==`element`&&e.kind!==`fragment`&&e.kind!==`document`&&(j(e)||(_(e.__node_id,`value`,t),e.kind===`text`&&(e.text=t)))}function K(e,t){let n=e.__node_id,r=r=>{if(j(e))return null;let i=m(n,r);return i===null?null:t.node(i)??null},i,a=()=>j(e)?[]:h(n).flatMap(e=>t.node(e)??[]);return{get nodeType(){return Jt[e.kind]},get nodeName(){return e.kind===`element`?e.tagName:e.kind===`fragment`?`#document-fragment`:`#${e.kind}`},get nodeValue(){return e.kind===`element`||e.kind===`fragment`||e.kind===`document`?null:G(e)},set nodeValue(t){Yt(e,String(t??``))},get isConnected(){return!j(e)&&fe(n)},get ownerDocument(){return e.kind===`document`?null:t.document()},get parentNode(){return r(`parent`)},get firstChild(){return r(`first`)},get lastChild(){return r(`last`)},get previousSibling(){return r(`previous`)},get nextSibling(){return r(`next`)},get childNodes(){return i??=kt(a)},hasChildNodes:()=>a().length>0}}function q(e,t,n){if(A(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?y(e.__node_id)??[0,0]:[0,0],l=(e,t)=>{if(e===void 0)return null;let r=Number(e);return(n?t:0)+(Number.isFinite(r)?r:0)};Le(e.__node_id,l(a,s),l(o,c))}function Xt(e){let t=[`start`,`center`,`end`,`nearest`];return typeof e==`object`&&e?{block:t.includes(e.block??``)?e.block:`start`,inline:t.includes(e.inline??``)?e.inline:`nearest`}:{block:e===!1?`end`:`start`,inline:`nearest`}}function Zt(e){let t=e.__node_id,n=()=>A(e)?null:y(t);return{get scrollLeft(){return n()?.[0]??0},set scrollLeft(t){q(e,[t],!1)},get scrollTop(){return n()?.[1]??0},set scrollTop(t){q(e,[void 0,t],!1)},get scrollWidth(){return e.clientWidth+Math.round(n()?.[2]??0)},get scrollHeight(){return e.clientHeight+Math.round(n()?.[3]??0)},scrollTo:(...t)=>q(e,t,!1),scrollBy:(...t)=>q(e,t,!0),scrollIntoView:n=>{if(A(e))return;let{block:r,inline:i}=Xt(n);Re(t,r,i)}}}function J(e,t){return R(e,1,t),L(e[0])}function Qt(e,t){return t.node(e)}function $t(e,t){let n=e.__node_id;return{querySelector:(...r)=>{let i=J(r,`querySelector`);if(j(e))return g(i),null;let a=be(n,i);return a===null?null:Qt(a,t)??null},querySelectorAll:(...r)=>{let i=J(r,`querySelectorAll`);if(j(e))return g(i),kt(()=>[]);let a=xe(n,i).flatMap(e=>Qt(e,t)??[]);return kt(()=>a)}}}function en(e,t){let n=e.__node_id;return{matches:(...t)=>{let r=J(t,`matches`);return j(e)?(g(r),!1):ve(n,r)},closest:(...r)=>{let i=J(r,`closest`);if(j(e))return g(i),null;let a=ye(n,i);return a===null?null:Qt(a,t)??null}}}function tn(e,t){at(e,t(de(e.__node_id))),p(e.__node_id),M(e)}function nn(e){let t=e.__node_id,n=(n,r,i)=>{j(e)||(ge(t,n,r,i),e.kind===`text`&&(e.text=G(e)))};return{get data(){return G(e)},set data(t){Yt(e,t===null?``:L(t))},get length(){return G(e).length},get textContent(){return G(e)},set textContent(t){Yt(e,xt(t))},substringData:(...n)=>{if(R(n,2,`substringData`),!j(e))return he(t,n[0],n[1]);let r=n[0]>>>0;return G(e).slice(r,r+(n[1]>>>0))},appendData:(...t)=>{R(t,1,`appendData`),n(G(e).length,0,L(t[0]))},insertData:(...e)=>{R(e,2,`insertData`),n(e[0],0,L(e[1]))},deleteData:(...e)=>{R(e,2,`deleteData`),n(e[0],e[1],``)},replaceData:(...e)=>{R(e,3,`replaceData`),n(e[0],e[1],L(e[2]))}}}function rn(e,t){let n=e.__node_id;return{get wholeText(){return j(e)?e.text:me(n)},splitText:(...r)=>{if(R(r,1,`splitText`),j(e))throw TypeError(`the text node was freed. create a new one`);let i=_e(n,r[0]),a=Y(i,String(v(i,`value`)??``),t);return e.text=G(e),m(i,`parent`)===null?O(a):T(a),a}}}function an(e,t){_(e.__node_id,`value`,t),e.text=t}function Y(e,t,n){let r=x({kind:`text`,text:t},e);for(let e of[K(r,n),U(r,n),W(r,n),nn(r),rn(r,n)])Object.defineProperties(r,Object.getOwnPropertyDescriptors(e));return w(r),r}const X={element:Z,text:(e,t)=>Y(e,t,X),fragment:pn,document:hn,documentCopy:e=>vn(e,!0),node:Q};function Z(t,n,r=`div`,i=[]){let[a,o,s,c]=typeof r==`string`?[r,e,null,r.replace(/[a-z]/g,e=>e.toUpperCase())]:r,l=o===e,u=I(()=>t,i),d={get id(){return j(f)?``:String(v(t,`id`)??``)},set id(e){j(f)||_(t,`id`,String(e))},kind:n,focus:e=>{A(f)||Ue(t,!!e?.preventScroll)},blur:()=>We(t),click:()=>{A(f)||He(t)},setPointerCapture:e=>Ge(t,e),releasePointerCapture:e=>Ke(t,e),hasPointerCapture:e=>qe(t,e),addEventListener:(...e)=>{A(f)||u.addEventListener(...e)},removeEventListener:(...e)=>{A(f)||u.removeEventListener(...e)},dispatchEvent:e=>j(f)||u.dispatchEvent(e),get tabIndex(){return Bt(j(f)?null:v(t,`tabindex`),l?a:``)},set tabIndex(e){j(f)||_(t,`tabindex`,e|0)}};for(let[e,t]of Object.entries({tagName:c,localName:a,namespaceURI:o,prefix:s}))Object.defineProperty(d,e,{value:t,enumerable:!0});let ee=l&&a===`template`;ee&&Object.defineProperty(d,"content",{get:()=>it(f),enumerable:!0,configurable:!0}),l&&a===`input`&&Object.defineProperty(d,"value",{get:()=>j(f)?``:Pe(t),set:e=>{j(f)||Fe(t,e===null?``:String(e))},enumerable:!0,configurable:!0});let f=It(x(d,t),()=>A(f));Object.defineProperties(f,Object.getOwnPropertyDescriptors(jt(t,f))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(Pt(f,X))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(K(f,X))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(U(f,X))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(W(f,X)));for(let e of[Vt(f,X),Zt(f),en(f,X),$t(f,X)])Object.defineProperties(f,Object.getOwnPropertyDescriptors(e));return Object.defineProperties(f,Object.getOwnPropertyDescriptors(n===`comment`?nn(f):on(f))),n!==`comment`&&(Object.defineProperties(f,Object.getOwnPropertyDescriptors(Mt(t,f))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(Wt(f,X))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(Gt(t))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(Nt(t)))),w(f),ee&&tn(f,pn),f}function on(e){return{get textContent(){return j(e)?``:pe(e.__node_id)},set textContent(t){j(e)||dn(e,xt(t))}}}function sn(e){return Z(c(e),`element`,e)}function cn(e=``){let t=c(`#comment`);return je(t,`display`,`none`),_(t,`value`,e),Z(t,`comment`)}function ln(e){let t=c(`#text`);return _(t,`value`,e),Y(t,e,X)}function un(e,t){return Y(e,t,X)}function dn(e,t){for(let t of h(e.__node_id)){d(e.__node_id,t);let n=k(t);n&&E(n)}if(!t)return;let n=ln(t);l(e.__node_id,n.__node_id),T(n)}function fn(){let e=n(),t=tt(e);if(t)return t;let r=Z(e,`element`,`div`,[`wheel`]);return Qe(r),r}function pn(e){let t=x({kind:`fragment`},e),n={get textContent(){return j(t)?``:pe(e)},set textContent(e){j(t)||dn(t,xt(e))}};for(let e of[K(t,X),U(t,X),W(t,X),n])Object.defineProperties(t,Object.getOwnPropertyDescriptors(e));return w(t),t}let mn;function hn(){return mn??=vn(r(),!1)}let gn;function _n(){return gn??=Object.defineProperty(It(I(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`})}function Q(e){return k(e)||(e===n()?fn():e===r()?hn():void 0)}function $(e){return O(e),e}function vn(e,t){let n=It(x({...I(e,[`wheel`]),kind:`document`,get textContent(){return null},set textContent(e){},get activeElement(){let n=t?null:Je();if(n!==null)return tt(n)??null;let r=m(e,`first`,!0),i=r===null?void 0:X.node(r);return i?.kind===`element`?i:null},createDocumentFragment:()=>$(pn(c(`#fragment`))),createElement:(...e)=>{R(e,1,`createElement`);let t=i(L(e[0]));return $(Z(t[0],`element`,o(t)))},createElementNS:(...e)=>{R(e,2,`createElementNS`);let t=a((e[0]===null||e[0]===void 0?null:L(e[0]))||null,L(e[1]));return $(Z(t[0],`element`,o(t)))},createTextNode:(...e)=>(R(e,1,`createTextNode`),$(ln(L(e[0])))),createComment:(...e)=>(R(e,1,`createComment`),$(cn(L(e[0]))))},e),()=>!1);for(let e of[K(n,X),U(n,X),W(n,X),$t(n,X)])Object.defineProperties(n,Object.getOwnPropertyDescriptors(e));return Object.setPrototypeOf(n,Document.prototype),w(n),n}const yn=/* @__PURE__ */ _n();Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>{if(e===`$window`)return yn;let t=Q(e);return t?.kind===`element`||t?.kind===`document`?t:null}),configurable:!0});export{Ie as A,c as B,k as C,Ve as D,He as E,Ae as F,ue as G,u as H,Me as I,le as K,_ as L,Le as M,y as N,Ue as O,v as P,je as R,st as S,We as T,m as U,p as V,xe as W,ht as _,Z as a,A as b,Q as c,an as d,H as f,bt as g,_t as h,sn as i,Re as j,Je as k,fn as l,yt as m,un as n,ln as o,I as p,n as q,cn as r,hn as s,yn as t,dn as u,T as v,M as w,et as x,j as y,h as z};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { $ as focus, A as EventHandlers, B as NamedNodeMap, C as TagName, D as DOMStringMap, E as CharacterDataMembers, F as IncaInputElement, H as NodeMembers, I as IncaNode, L as IncaParent, M as HtmlMembers, N as IncaElement, O as DOMTokenList, P as IncaFragment, Q as dispatchEvent, R as IncaTemplateElement, S as StyleProps, T as CSSStyleDeclaration, U as TextContentMember, V as NodeListOf, W as TextMembers, X as blur, Y as isRemoved, Z as click, _ as IncaWheelEvent, _t as EventTargetId, a as EventListenerOrObject, at as getAttribute, b as Overflow, c as IncaEvent, ct as setAttribute, d as IncaFocusEvent, dt as holdNode, et as focusedNode, f as IncaInputEvent, ft as releaseNode, g as IncaUIEvent, gt as ElementName, h as IncaPointerEvent, ht as CallbackId, i as EventListenerObject, it as scrollOf, j as HTMLCollectionOf, k as EventHandler, l as IncaEventMap, lt as setStyle, m as IncaMouseEvent, mt as AttributeValue, n as EventLike, nt as scrollIntoViewNode, o as IncaCompositionEvent, ot as removeAttribute, p as IncaKeyboardEvent, pt as rootNodeId, r as EventListener, rt as scrollNode, s as IncaDocument, st as removeStyle, t as window, tt as layoutOf, u as IncaEventTarget, ut as createNode, v as IncaWindow, vt as NodeId, w as Attr, x as Px, y as ListenerOptions, yt as ScrollAlignment, z as IncaText } from "./window-CE2esnja.js";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the listener methods of an event target: a node or window.
|
|
4
|
+
* @param target - the target id, or a function that resolves it each time a method runs
|
|
5
|
+
* @param passiveByDefault - event names whose listeners are passive unless
|
|
6
|
+
* their options say `passive: false`
|
|
7
|
+
* @returns the target's `addEventListener`, `removeEventListener` and
|
|
8
|
+
* `dispatchEvent`
|
|
9
|
+
*/
|
|
10
|
+
declare function createEventTarget(target: EventTargetId | (() => EventTargetId), passiveByDefault?: readonly string[]): IncaEventTarget;
|
|
11
|
+
/**
|
|
12
|
+
* @returns the `eventId` of the newest event any registered listener has
|
|
13
|
+
* received, or 0 before the first. Ids grow with each event, and every
|
|
14
|
+
* listener of one event receives the same id.
|
|
15
|
+
*/
|
|
16
|
+
declare function latestEventId(): number;
|
|
17
|
+
/**
|
|
18
|
+
* Registers `listener` for `event` on the target (node or window).
|
|
19
|
+
* Registering the same listener for the same target, event and `capture`
|
|
20
|
+
* again changes nothing, and the first registration keeps its other options.
|
|
21
|
+
* A `null` listener is ignored.
|
|
22
|
+
*
|
|
23
|
+
* Any event name is accepted, and it fires when the host dispatches that name.
|
|
24
|
+
* `IncaEventMap` gives the event type of each name the host dispatches.
|
|
25
|
+
* @param target - the event target (node id or "$window")
|
|
26
|
+
* @param event - the event name (e.g. `"click"`)
|
|
27
|
+
* @param listener - a function, called with the event's `currentTarget` as
|
|
28
|
+
* `this`, or an object whose `handleEvent` method is called with the object
|
|
29
|
+
* as `this` when the event fires
|
|
30
|
+
* @param options - `capture` listens while the event travels down to the
|
|
31
|
+
* target, `passive` ignores `preventDefault()` calls in `listener`, and
|
|
32
|
+
* `once` removes the listener before it first runs
|
|
33
|
+
* @throws TypeError when `target` is malformed or is an unknown target tag
|
|
34
|
+
* @throws TypeError when a node target names no node
|
|
35
|
+
* @throws RangeError when the host has issued its last callback id
|
|
36
|
+
*/
|
|
37
|
+
declare function addEventListener(target: EventTargetId, event: string, listener: EventListenerOrObject<never, never> | null, options?: ListenerOptions): void;
|
|
38
|
+
/**
|
|
39
|
+
* Drops the registration {@link addEventListener} made for `listener` on
|
|
40
|
+
* the target with the same `event` and `capture`. A no-op if there is none.
|
|
41
|
+
* @param target - the event target (node or window)
|
|
42
|
+
* @param event - the event name
|
|
43
|
+
* @param listener - the listener that was registered
|
|
44
|
+
* @param options - `capture` of the registration to drop
|
|
45
|
+
*/
|
|
46
|
+
declare function removeEventListener(target: EventTargetId, event: string, listener: EventListenerOrObject<never, never> | null, options?: Pick<ListenerOptions, "capture">): void;
|
|
47
|
+
/**
|
|
48
|
+
* Builds the {@link IncaElement} handle for a native node: parentless,
|
|
49
|
+
* childless, with `id`, `focus()`, `blur()`, `click()`, the pointer capture
|
|
50
|
+
* methods, the listener methods of an event target, `tabIndex`,
|
|
51
|
+
* the `value` of an `input`, the `style`, the `dataset`, the `classList`, the layout members,
|
|
52
|
+
* the node members and the event handler properties, all driven through the host.
|
|
53
|
+
* @param id - the native node's id
|
|
54
|
+
* @param kind - whether the node is an element or a comment stand-in
|
|
55
|
+
* @param name - the element name, an HTML `div` when omitted. An HTML `button` or `input`
|
|
56
|
+
* defaults to tab index `0`, an HTML `input` has `value` and an HTML `template` has `content`.
|
|
57
|
+
* The handle keeps the name, so the name members read after the host frees the node.
|
|
58
|
+
* @param passiveByDefault - event names whose listeners are passive unless their options say
|
|
59
|
+
* `passive: false`
|
|
60
|
+
* @returns the new handle
|
|
61
|
+
*/
|
|
62
|
+
declare function createIncaElement(id: NodeId, kind: IncaElement["kind"], name?: ElementName, passiveByDefault?: readonly string[]): IncaElement;
|
|
63
|
+
/**
|
|
64
|
+
* Allocates a new element node for `tag`.
|
|
65
|
+
* @param tag - the node's element kind
|
|
66
|
+
* @returns the new, parentless, childless element
|
|
67
|
+
*/
|
|
68
|
+
declare function createElementNode(tag: TagName): IncaElement;
|
|
69
|
+
/**
|
|
70
|
+
* Creates the hidden container that stands in for a comment node, such as a
|
|
71
|
+
* placeholder for conditional content.
|
|
72
|
+
* @param text - the data of the comment
|
|
73
|
+
* @returns the new hidden element
|
|
74
|
+
*/
|
|
75
|
+
declare function createCommentNode(text?: string): IncaElement;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a text leaf.
|
|
78
|
+
* @param text - the initial text content
|
|
79
|
+
* @returns the new text leaf
|
|
80
|
+
*/
|
|
81
|
+
declare function createTextNode(text: string): IncaText;
|
|
82
|
+
/**
|
|
83
|
+
* Replaces all of `el`'s children with at most a single text child holding
|
|
84
|
+
* `text`. The old children keep their listeners. An empty string leaves `el` childless.
|
|
85
|
+
* @param el - the element or fragment whose children are replaced
|
|
86
|
+
* @param text - the new text content
|
|
87
|
+
*/
|
|
88
|
+
declare function setElementText(el: IncaParent, text: string): void;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the handle of the host's mount container, which stands between the app's elements and
|
|
91
|
+
* `document` in an event path. A live handle is reused, so a mount and an event see one object.
|
|
92
|
+
* A `wheel` listener on it is passive unless its options say `passive: false`.
|
|
93
|
+
* @returns the mount container's handle
|
|
94
|
+
*/
|
|
95
|
+
declare function rootElement(): IncaElement;
|
|
96
|
+
/**
|
|
97
|
+
* Attaches `child` to `parent`, before `anchor` or at the end when `anchor` is
|
|
98
|
+
* omitted or `null`. If `anchor` is `child` itself and `child` is already in
|
|
99
|
+
* `parent`, nothing changes. A `child` attached elsewhere is detached first,
|
|
100
|
+
* so a move keeps the node alive.
|
|
101
|
+
* @param child - the node being attached
|
|
102
|
+
* @param parent - the new container
|
|
103
|
+
* @param anchor - the sibling to insert before, or omitted/`null` to append at the end
|
|
104
|
+
* @throws {DOMException} `NotFoundError` when `anchor` was freed or is no child of `parent`
|
|
105
|
+
*/
|
|
106
|
+
declare function insert(child: IncaNode, parent: IncaElement, anchor?: IncaNode | null): void;
|
|
107
|
+
/**
|
|
108
|
+
* Removes `child` for good: the native node leaves its parent and keeps its
|
|
109
|
+
* subtree, and every event listener registered in the subtree is released. The
|
|
110
|
+
* handles stay readable: the node is held until its handle is collected. A freed
|
|
111
|
+
* `child` changes nothing.
|
|
112
|
+
*
|
|
113
|
+
* A caller that removes a subtree calls this on its root alone.
|
|
114
|
+
* @param child - the node being removed
|
|
115
|
+
*/
|
|
116
|
+
declare function remove(child: IncaNode): void;
|
|
117
|
+
/**
|
|
118
|
+
* Looks up the current parent.
|
|
119
|
+
* @param node - the node to query
|
|
120
|
+
* @returns the parent element, or `null` when `node` has no parent, has a fragment or the document
|
|
121
|
+
* as its parent, or was freed
|
|
122
|
+
*/
|
|
123
|
+
declare function parentNode(node: IncaNode): IncaElement | null;
|
|
124
|
+
/**
|
|
125
|
+
* Looks up the next sibling.
|
|
126
|
+
* @param node - the node to query
|
|
127
|
+
* @returns the sibling immediately after `node` in its parent's children, or `null` when there is
|
|
128
|
+
* none, `node` has no parent or it was freed
|
|
129
|
+
*/
|
|
130
|
+
declare function nextSibling(node: IncaNode): IncaNode | null;
|
|
131
|
+
/**
|
|
132
|
+
* Updates a text leaf's content in place.
|
|
133
|
+
* @param node - the text leaf to update
|
|
134
|
+
* @param text - the new text content
|
|
135
|
+
*/
|
|
136
|
+
declare function setText(node: IncaText, text: string): void;
|
|
137
|
+
declare namespace rendererCore_d_exports {
|
|
138
|
+
export { Attr, AttributeValue, CSSStyleDeclaration, CallbackId, CharacterDataMembers, DOMStringMap, DOMTokenList, EventHandler, EventHandlers, EventLike, EventListener, EventListenerObject, EventListenerOrObject, HTMLCollectionOf, HtmlMembers, IncaCompositionEvent, IncaCore, IncaDocument, IncaElement, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaFragment, IncaInputElement, IncaInputEvent, IncaKeyboardEvent, IncaMouseEvent, IncaNode, IncaParent, IncaPointerEvent, IncaTemplateElement, IncaText, IncaUIEvent, IncaWheelEvent, IncaWindow, ListenerOptions, NamedNodeMap, NodeId, NodeListOf, NodeMembers, Overflow, Px, ScrollAlignment, StyleProps, TagName, TextContentMember, TextMembers, addEventListener, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* What a custom renderer (`incajs/vue`) drives the host through: the tree and
|
|
142
|
+
* event calls, the element handles and the tree operations.
|
|
143
|
+
*/
|
|
144
|
+
type IncaCore = typeof rendererCore_d_exports;
|
|
145
|
+
export { parentNode as a, createElementNode as c, rootElement as d, setElementText as f, createEventTarget as g, removeEventListener as h, nextSibling as i, createIncaElement as l, latestEventId as m, setText as n, remove as o, addEventListener as p, insert as r, createCommentNode as s, IncaCore as t, createTextNode as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,B as n,D as r,E as i,F as a,G as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,T as m,V as h,a as g,b as _,d as v,g as y,h as b,i as x,j as S,k as C,l as w,m as T,o as E,p as D,q as O,r as k,t as A,u as j,w as M}from"./hooks-CxYWemIJ.js";import{i as N,n as P,r as F,t as I}from"./treeOps-HfdCml0F.js";var L=/* @__PURE__ */ e({addEventListener:()=>T,blur:()=>m,click:()=>i,createCommentNode:()=>k,createElementNode:()=>x,createEventTarget:()=>D,createIncaElement:()=>g,createNode:()=>n,createTextNode:()=>E,dispatchEvent:()=>r,focus:()=>d,focusedNode:()=>C,getAttribute:()=>f,holdNode:()=>h,insert:()=>I,isRemoved:()=>_,latestEventId:()=>b,layoutOf:()=>t,nextSibling:()=>P,parentNode:()=>F,releaseNode:()=>o,releaseWhenCollected:()=>M,remove:()=>N,removeAttribute:()=>a,removeEventListener:()=>y,removeStyle:()=>s,rootElement:()=>w,rootNodeId:()=>O,scrollIntoViewNode:()=>S,scrollNode:()=>l,scrollOf:()=>u,setAttribute:()=>c,setElementText:()=>j,setStyle:()=>p,setText:()=>v,window:()=>A});export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e,K as t,S as n,U as r,_ as i,c as a,f as o,v as s,x as c,y as l}from"./hooks-CxYWemIJ.js";function u(t,n,r){if(r&&l(r))throw o();e(n.__node_id,t.__node_id,r?.__node_id??null),t.kind!==`fragment`&&s(t)}function d(e){if(l(e))return;let[r,a]=t(e.__node_id);i(r),n(a),c(e,a)}function f(e){if(l(e))return null;let t=r(e.__node_id,`parent`,!0);return t===null?null:a(t)??null}function p(e){if(l(e))return null;let t=r(e.__node_id,`next`);return t===null?null:a(t)??null}export{d as i,p as n,f as r,u as t};
|