incajs 0.0.26 → 0.0.28
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-CNWfrFj9.js +2 -0
- package/dist/chunks/{rendererCore-oCllOmUF.d.ts → rendererCore-B2W5p9bR.d.ts} +32 -22
- package/dist/chunks/rendererCore-D82agHLO.js +1 -0
- package/dist/chunks/{window-VD8HXwVy.d.ts → window-BhkZc6km.d.ts} +242 -16
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/rendererCore.d.ts +3 -3
- package/dist/rendererCore.js +1 -1
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +1 -1
- package/package.json +1 -2
- package/dist/chunks/hooks-BbPHSiFF.js +0 -2
- package/dist/chunks/rendererCore-BaVb8wQu.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=/* @__PURE__ */ `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`.split(`.`);function t(t,n){for(let r of e){let e=null,i=function(t){typeof e==`function`&&Reflect.apply(e,this,[t])===!1&&t.preventDefault()};Object.defineProperty(t,`on${r}`,{get:()=>e,set(a){n()||(e=typeof a==`function`||typeof a==`object`&&a?a:null,e===null?t.removeEventListener(r,i):t.addEventListener(r,i))}})}return t}function n(){return globalThis.__inca_native__}const r=/* @__PURE__ */ new WeakSet;function i(e,t){return r.add(e),Object.defineProperty(e,"__node_id",{value:t})}function a(e){return typeof e==`object`&&!!e&&r.has(e)}const o=/* @__PURE__ */ new Map,s=new FinalizationRegistry(e=>{o.get(e)?.deref()||o.delete(e)});function c(e){o.set(e.__node_id,new WeakRef(e)),s.register(e,e.__node_id)}function l(e){o.delete(e)}function u(e){return o.get(e)?.deref()}function d(e){let t=u(e);return t?.kind===`element`?t:void 0}const f=/* @__PURE__ */ new WeakSet;function p(e){return f.has(e)||m.has(e)}function ee(e){if(f.add(e),e.kind!==`text`)for(let t of e.__children)ee(t)}const m=/* @__PURE__ */ new WeakSet;function h(e){return m.has(e)}function g(e){if(m.add(e),l(e.__node_id),e.kind!==`text`)for(let t of e.__children)g(t)}function te(e){for(let t of e){let e=u(t);e&&g(e)}}const ne=new FinalizationRegistry(e=>n().releaseNode(e)),re=/* @__PURE__ */ new WeakSet;function ie(e){return re.has(e)}function _(e){re.add(e),ne.register(e,e.__node_id)}const v=/* @__PURE__ */ new Map,y=/* @__PURE__ */ new Map;function ae(e,t,n){let r=v.get(e);r||v.set(e,r=/* @__PURE__ */ new Map),r.set(t,n),y.set(n,{group:e,listener:t})}function b(e,t){return v.get(e)?.get(t)}function x(e){let t=y.get(e);if(t===void 0)return;y.delete(e);let n=v.get(t.group);n?.delete(t.listener),n?.size===0&&v.delete(t.group)}function S(e){for(let t of e)x(t)}const oe=(e,t,n)=>`${e}:${t}:${n===!0}`;Object.defineProperty(globalThis,"__inca_released__",{value:(e,t)=>{S(t),te(e)},configurable:!0});let C=0;function se(){return C}function ce(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>C&&(C=n),e(...t)}}function le(e,t,r,i={}){if(r==null)return;let a=oe(e,t,i.capture);if(b(a,r)!==void 0)return;let o=(...e)=>typeof r==`function`?r.apply(e[0]?.currentTarget,e):r.handleEvent.apply(r,e),s=i.once?(...n)=>(w(e,t,r,i),o(...n)):o;ae(a,r,n().addEventListener(e,t,ce(s),i.capture===!0,i.passive===!0))}function w(e,t,r,i={}){if(r==null)return;let a=b(oe(e,t,i.capture),r);a!==void 0&&(n().removeEventListener(e,t,a),x(a))}function ue(e,t){return n().dispatchEvent(e,t)}function de(e){n().click(e)}function fe(e,t){n().focusNode(e,t)}function pe(e){n().blurNode(e)}function me(e,t){n().setPointerCapture(e,t)}function he(e,t){n().releasePointerCapture(e,t)}function ge(e,t){return n().hasPointerCapture(e,t)}function T(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};le(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;w(n(),e,t,{capture:i})},dispatchEvent:e=>ue(n(),e)}}function _e(){throw TypeError(`document cannot be constructed. use the document export of incajs`)}function ve(){throw TypeError(`a shadow root cannot be constructed. the host has no shadow roots`)}Object.defineProperty(globalThis,"Document",{value:_e,writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(globalThis,"ShadowRoot",{value:ve,writable:!0,configurable:!0,enumerable:!1});function E(){return n().rootNodeId()}function D(e){return n().createNode(e)}function O(e,t){n().appendChild(e,t)}function k(e,t,r){n().insertBefore(e,t,r)}function A(e,t){n().removeChild(e,t)}function ye(e){S(n().releaseListeners(e))}function j(e){n().holdNode(e)}function be(e){n().releaseNode(e)}function M(e,t,r){n().setAttribute(e,t,r)}function N(e,t){return n().getAttribute(e,t)}function xe(e){return n().attributeNames(e)}function Se(e,t){return n().linkedNode(e,t)}function Ce(e){return n().childNodeIds(e)}function we(e){return n().isConnected(e)}function Te(e){return n().textContent(e)}function Ee(e){return n().wholeText(e)}function De(e,t,r){return n().substringData(e,t,r)}function Oe(e,t,r,i){n().replaceData(e,t,r,i)}function ke(e,t){return n().splitText(e,t)}function Ae(e,t){return n().matches(e,t)}function je(e,t){return n().closest(e,t)}function Me(e,t){return n().querySelector(e,t)}function Ne(e,t){return n().querySelectorAll(e,t)}function P(e){n().checkSelector(e)}function F(e){return n().layoutOf(e)}function I(e){return n().scrollOf(e)}function L(e,t,r){n().scrollNode(e,t,r)}function R(e,t,r){n().scrollIntoViewNode(e,t,r)}function Pe(e,t){n().removeAttribute(e,t)}function Fe(e,t,r){n().setStyle(e,t,r)}function Ie(e,t){n().removeStyle(e,t)}function Le(e){return n().inputValue(e)}function Re(e,t){n().setInputValue(e,t)}function ze(){return n().focusedNode()}function Be(){let e=ze();return e===null?null:d(e)??null}const z=/* @__PURE__ */ Object.defineProperties(Object.setPrototypeOf(t(T(`$document`,[`wheel`]),()=>!1),_e.prototype),{[Symbol.toStringTag]:{value:`Document`},activeElement:{get:Be}}),Ve=/* @__PURE__ */ Object.defineProperty(t(T(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`}),He=/^(?:0|[1-9]\d*)$/,Ue=2**32-1;function B(e){return He.test(e)&&Number(e)<Ue}function We(e,t){return t===``?null:e.find(e=>e.id===t)??e.find(e=>e.getAttribute(`name`)===t)??null}function Ge(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 V(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 Ke(e){let t=t=>We(e(),t);return V({tag:`HTMLCollection`,method:`namedItem`,source:e,find:t,named:t,names:Ge})}function qe(e,t,n){return V({tag:`NamedNodeMap`,method:`getNamedItem`,source:e,find:t,named:n,names:e=>e.map(e=>e.name)})}function H(e){return V({tag:`NodeList`,arrayMembers:!0,source:e,find:()=>null,named:()=>null,names:()=>[]})}const Je=/* @__PURE__ */ new Set([`\0`,` `,`
|
|
2
|
+
`,`\f`,`\r`,` `,`/`,`=`,`>`]);function Ye(e){if(e.length===0)return!1;for(let t of e)if(Je.has(t))return!1;return!0}function U(e){if(typeof e==`symbol`)throw TypeError(`a symbol cannot become text`);return String(e)}function W(e,t,n){if(e.length<t)throw TypeError(`${n}() needs ${t} argument${t===1?``:`s`}`)}function Xe(e){return e.replace(/[A-Z]/g,e=>e.toLowerCase())}var G=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=h(this.#r)?null:N(this.#t,this.#e);return t===null?(e.detach(this),!1):(this.#i=U(t),!0)}get name(){return this.#e}get localName(){return this.#e}get value(){return this.#a(),this.#i}set value(e){let t=U(e);this.#a()&&M(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 Ze(e,t){let n=t=>{let n=N(e,t);return n===null?null:U(n)},r=()=>h(t)?[]:xe(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 G(n,r,e,t,a),i.set(n,o)),o},s=e=>{let r=h(t)?null:n(e);if(r!==null)return o(e,r);let a=i.get(e);return a&&G.detach(a),null},c=()=>{let e=r(),t=new Set(e);for(let[e,n]of i)t.has(e)||G.detach(n);return e.map(e=>i.get(e)??o(e,n(e)))},l;return{getAttribute:(...e)=>(W(e,1,`getAttribute`),h(t)?null:n(U(e[0]))),setAttribute:(...n)=>{W(n,2,`setAttribute`);let r=U(n[0]),i=U(n[1]);if(!Ye(r))throw new DOMException(`the attribute name is not valid. it is empty or holds whitespace, '/', '=' or '>'`,`InvalidCharacterError`);h(t)||M(e,r,i)},hasAttribute:(...e)=>(W(e,1,`hasAttribute`),!h(t)&&n(U(e[0]))!==null),removeAttribute:(...n)=>{W(n,1,`removeAttribute`);let r=U(n[0]);h(t)||Pe(e,r)},getAttributeNames:()=>r(),get attributes(){return l??=qe(c,e=>s(Xe(e)),e=>e===Xe(e)?s(e):null),l}}}function Qe(e){return e.kind===`element`}function K(e){return e.__children.filter(Qe)}function $e(e,t){let n=e.parent?.__children??[];for(let r=n.indexOf(e)+t;r>=0&&r<n.length;r+=t){let e=n[r];if(Qe(e))return e}return null}function et(e){let t;return{get children(){return t??=Ke(()=>K(e))},get parentElement(){return e.parent},get firstElementChild(){return K(e)[0]??null},get lastElementChild(){return K(e).at(-1)??null},get childElementCount(){return K(e).length},get previousElementSibling(){return $e(e,-1)},get nextElementSibling(){return $e(e,1)}}}function q(e){return p(e)?null:F(e.__node_id)}function tt(e){let t=e.parent;return!q(e)||!t||!q(t)?null:t}function nt(e){let t=q(e);if(!t)return{left:0,top:0};let n=tt(e),r=n?q(n):null;return{left:Math.round(t[0]-(r?r[0]+r[4]:0)+t[5])||0,top:Math.round(t[1]-(r?r[1]+r[4]:0)+t[6])||0}}function rt(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 it(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}const at={element:1,text:3,comment:8};function J(e){return h(e)?e.kind===`text`?e.text:``:String(N(e.__node_id,`value`)??``)}function Y(e,t){e.kind===`element`||h(e)||(M(e.__node_id,`value`,t),e.kind===`text`&&(e.text=t))}function ot(e){let t=e.__node_id,n=n=>{if(h(e))return null;let r=Se(t,n);return r===null?null:u(r)??null},r,i=()=>h(e)?[]:Ce(t).flatMap(e=>u(e)??[]);return{get nodeType(){return at[e.kind]},get nodeName(){return e.kind===`element`?e.tagName:`#${e.kind}`},get nodeValue(){return e.kind===`element`?null:J(e)},set nodeValue(t){Y(e,String(t??``))},get isConnected(){return!h(e)&&we(t)},get ownerDocument(){return z},get parentNode(){let e=n(`parent`);return e===null?t===E()?z:null:e},get firstChild(){return n(`first`)},get lastChild(){return n(`last`)},get previousSibling(){return n(`previous`)},get nextSibling(){return n(`next`)},get childNodes(){return r??=H(i)},hasChildNodes:()=>i().length>0}}function X(e,t,n){if(p(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?I(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)};L(e.__node_id,l(a,s),l(o,c))}function st(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 ct(e){return e==null?``:U(e)}function lt(e){let t=e.__node_id,n=(n,r,i)=>{h(e)||(Oe(t,n,r,i),e.kind===`text`&&(e.text=J(e)))};return{get data(){return J(e)},set data(t){Y(e,t===null?``:U(t))},get length(){return J(e).length},get textContent(){return J(e)},set textContent(t){Y(e,ct(t))},substringData:(...n)=>{if(W(n,2,`substringData`),!h(e))return De(t,n[0],n[1]);let r=n[0]>>>0;return J(e).slice(r,r+(n[1]>>>0))},appendData:(...t)=>{W(t,1,`appendData`),n(J(e).length,0,U(t[0]))},insertData:(...e)=>{W(e,2,`insertData`),n(e[0],0,U(e[1]))},deleteData:(...e)=>{W(e,2,`deleteData`),n(e[0],e[1],``)},replaceData:(...e)=>{W(e,3,`replaceData`),n(e[0],e[1],U(e[2]))}}}function ut(e){let t=e.__node_id;return{get wholeText(){return h(e)?e.text:Ee(t)},splitText:(...n)=>{if(W(n,1,`splitText`),h(e))throw TypeError(`the text node was freed. create a new one`);let r=ke(t,n[0]),i=dt(r,String(N(r,`value`)??``));e.text=J(e);let a=e.parent;return a===null?(j(i.__node_id),_(i)):(a.__children.splice(a.__children.indexOf(e)+1,0,i),i.parent=a),i}}}function dt(e,t){let n=i({kind:`text`,parent:null,text:t},e);for(let e of[ot(n),lt(n),ut(n)])Object.defineProperties(n,Object.getOwnPropertyDescriptors(e));return c(n),n}function ft(e){let t=D(`#text`);return M(t,`value`,e),dt(t,e)}function pt(e,t){M(e.__node_id,`value`,t),e.text=t}function mt(e,t){for(let t of e.__children.slice())_t(t);if(!t)return;let n=ft(t);O(e.__node_id,n.__node_id),n.parent=e,e.__children.push(n)}function Z(e){let t=e.parent;if(!t)return;let n=t.__children.indexOf(e);n!==-1&&t.__children.splice(n,1),e.parent=null}function ht(e){e.parent&&A(e.parent.__node_id,e.__node_id),Z(e)}function gt(e,t,n){if(n===e&&e.parent===t)return;ht(e);let r=n?t.__children.indexOf(n):-1;k(t.__node_id,e.__node_id,n&&r!==-1?n.__node_id:null),r===-1?t.__children.push(e):t.__children.splice(r,0,e),e.parent=t}function _t(e){e.parent&&h(e.parent)?Z(e):ht(e),ye(e.__node_id),ee(e),e.kind===`element`&&!h(e)&&!ie(e)&&(j(e.__node_id),_(e))}function vt(e){return e.parent}function yt(e){let t=e.parent;if(!t)return null;let n=t.__children.indexOf(e);return t.__children[n+1]??null}function Q(e,t){return W(e,1,t),U(e[0])}function $(e,n,r=`div`,o=[]){let s=T(()=>e,o),l=()=>p(f)?null:I(e),u={get id(){return h(f)?``:String(N(e,`id`)??``)},set id(t){h(f)||M(e,`id`,String(t))},kind:n,tagName:r.replace(/[a-z]/g,e=>e.toUpperCase()),parent:null,__children:[],focus:t=>{p(f)||fe(e,!!t?.preventScroll)},blur:()=>pe(e),click:()=>{p(f)||de(e)},setPointerCapture:t=>me(e,t),releasePointerCapture:t=>he(e,t),hasPointerCapture:t=>ge(e,t),contains:e=>{if(e==null)return!1;if(!a(e))throw TypeError(`the value is not a node. pass an element, a text node or null`);for(let t=e;t!==null;t=t.parent)if(t===f)return!0;return!1},addEventListener:(...e)=>{p(f)||s.addEventListener(...e)},removeEventListener:(...e)=>{p(f)||s.removeEventListener(...e)},dispatchEvent:e=>h(f)||s.dispatchEvent(e),get tabIndex(){return it(h(f)?null:N(e,`tabindex`),r)},set tabIndex(t){h(f)||M(e,`tabindex`,t|0)},getBoundingClientRect:()=>rt(q(f)),get offsetWidth(){return Math.round(q(f)?.[2]??0)},get offsetHeight(){return Math.round(q(f)?.[3]??0)},get offsetLeft(){return nt(f).left},get offsetTop(){return nt(f).top},get offsetParent(){return tt(f)},get clientWidth(){let e=q(f);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=q(f);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(q(f)?.[4]??0)},get clientTop(){return Math.round(q(f)?.[4]??0)},get scrollLeft(){return l()?.[0]??0},set scrollLeft(e){X(f,[e],!1)},get scrollTop(){return l()?.[1]??0},set scrollTop(e){X(f,[void 0,e],!1)},get scrollWidth(){return f.clientWidth+Math.round(l()?.[2]??0)},get scrollHeight(){return f.clientHeight+Math.round(l()?.[3]??0)},scrollTo:(...e)=>X(f,e,!1),scrollBy:(...e)=>X(f,e,!0),scrollIntoView:t=>{if(p(f))return;let{block:n,inline:r}=st(t);R(e,n,r)},matches:(...t)=>{let n=Q(t,`matches`);return h(f)?(P(n),!1):Ae(e,n)},closest:(...t)=>{let n=Q(t,`closest`);if(h(f))return P(n),null;let r=je(e,n);if(r===null)return null;let i=f;for(;i!==null&&i.__node_id!==r;)i=i.parent;return i},querySelector:(...t)=>{let n=Q(t,`querySelector`);if(h(f))return P(n),null;let r=Me(e,n);return r===null?null:d(r)},querySelectorAll:(...t)=>{let n=Q(t,`querySelectorAll`);if(h(f))return P(n),H(()=>[]);let r=Ne(e,n).map(e=>d(e));return H(()=>r)},getRootNode:()=>{let e=f;for(;e.parent!==null;)e=e.parent;return e.__node_id===E()?z:e}};r===`input`&&Object.defineProperty(u,"value",{get:()=>h(f)?``:Le(e),set:t=>{h(f)||Re(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let f=t(i(u,e),()=>p(f));return Object.defineProperties(f,Object.getOwnPropertyDescriptors(Ze(e,f))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(et(f))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(ot(f))),Object.defineProperties(f,Object.getOwnPropertyDescriptors(n===`comment`?lt(f):bt(f))),c(f),f}function bt(e){return{get textContent(){return h(e)?``:Te(e.__node_id)},set textContent(t){h(e)||mt(e,ct(t))}}}function xt(e){return $(D(e),`element`,e)}function St(e=``){let t=D(`#comment`);return Fe(t,`display`,`none`),M(t,`value`,e),$(t,`comment`)}function Ct(){let e=E();return d(e)??$(e,`element`,void 0,[`wheel`])}Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>e===`$document`?z:e===`$window`?Ve:d(e)??(e===E()?Ct():null)),configurable:!0});export{Fe as A,_ as B,A as C,L as D,R as E,ue as F,fe as I,se as L,le as M,pe as N,I as O,de as P,w as R,Pe as S,E as T,N as _,ft as a,F as b,vt as c,pt as d,Ve as f,ze as g,D as h,Ct as i,T as j,M as k,_t as l,O as m,xt as n,gt as o,z as p,$ as r,yt as s,St as t,mt as u,j as v,Ie as w,be as x,k as y,p as z};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as EventHandler, B as TextContentMember, C as Overflow, D as TagName, E as StyleProps, F as IncaNode, I as IncaText, L as NamedNodeMap, M as HTMLCollectionOf, N as IncaElement, O as Attr, P as IncaInputElement, R as NodeListOf, S as NodeId, T as ScrollAlignment, V as TextMembers, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as EventHandlers, k as CharacterDataMembers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as NodeMembers } from "./window-BhkZc6km.js";
|
|
2
|
+
/** How {@link IncaNative.linkedNode} names the node to reach from a node. */
|
|
3
|
+
type NodeLink = "parent" | "first" | "last" | "previous" | "next";
|
|
2
4
|
/** What a listener or a dispatch names: a node id, or the tag of `document` or `window`. */
|
|
3
5
|
type EventTargetId = NodeId | "$document" | "$window";
|
|
4
6
|
/**
|
|
@@ -15,13 +17,24 @@ interface IncaNative {
|
|
|
15
17
|
getAttribute(nodeId: NodeId, key: string): AttributeValue | null;
|
|
16
18
|
removeAttribute(nodeId: NodeId, key: string): void;
|
|
17
19
|
attributeNames(nodeId: NodeId): string[];
|
|
20
|
+
linkedNode(nodeId: NodeId, link: NodeLink): NodeId | null;
|
|
21
|
+
childNodeIds(nodeId: NodeId): NodeId[];
|
|
22
|
+
isConnected(nodeId: NodeId): boolean;
|
|
23
|
+
textContent(nodeId: NodeId): string;
|
|
24
|
+
wholeText(nodeId: NodeId): string;
|
|
25
|
+
substringData(nodeId: NodeId, offset: number, count: number): string;
|
|
26
|
+
replaceData(nodeId: NodeId, offset: number, count: number, data: string): void;
|
|
27
|
+
splitText(nodeId: NodeId, offset: number): NodeId;
|
|
18
28
|
matches(nodeId: NodeId, selector: string): boolean;
|
|
19
29
|
closest(nodeId: NodeId, selector: string): NodeId | null;
|
|
30
|
+
checkSelector(selector: string): void;
|
|
31
|
+
querySelector(nodeId: NodeId, selector: string): NodeId | null;
|
|
32
|
+
querySelectorAll(nodeId: NodeId, selector: string): NodeId[];
|
|
20
33
|
setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
21
34
|
removeStyle(nodeId: NodeId, key: string): void;
|
|
22
35
|
inputValue(nodeId: NodeId): string;
|
|
23
36
|
setInputValue(nodeId: NodeId, value: string): void;
|
|
24
|
-
addEventListener(target: EventTargetId, event: string, capture?: boolean, passive?: boolean): CallbackId;
|
|
37
|
+
addEventListener(target: EventTargetId, event: string, callback: HostCallback, capture?: boolean, passive?: boolean): CallbackId;
|
|
25
38
|
removeEventListener(target: EventTargetId, event: string, callbackId: CallbackId): boolean;
|
|
26
39
|
releaseListeners(nodeId: NodeId): CallbackId[];
|
|
27
40
|
holdNode(nodeId: NodeId): void;
|
|
@@ -38,17 +51,13 @@ interface IncaNative {
|
|
|
38
51
|
setPointerCapture(nodeId: NodeId, pointerId: number): void;
|
|
39
52
|
releasePointerCapture(nodeId: NodeId, pointerId: number): void;
|
|
40
53
|
hasPointerCapture(nodeId: NodeId, pointerId: number): boolean;
|
|
41
|
-
startTimer(delay: number, repeat: boolean): number | undefined;
|
|
42
|
-
stopTimer(id: number): void;
|
|
43
54
|
}
|
|
44
55
|
/** What the host calls: it passes the event object as the first argument. */
|
|
45
56
|
type HostCallback = (...args: unknown[]) => void;
|
|
46
57
|
declare global {
|
|
47
58
|
var __inca_native__: IncaNative;
|
|
48
|
-
var __inca_callbacks__: Record<CallbackId, HostCallback>;
|
|
49
59
|
var __inca_released__: (nodeIds: NodeId[], callbackIds: CallbackId[]) => void;
|
|
50
60
|
var __inca_targets__: (targets: EventTargetId[]) => unknown[];
|
|
51
|
-
var __inca_timer__: (id: number) => void;
|
|
52
61
|
}
|
|
53
62
|
/**
|
|
54
63
|
* Builds the listener methods of an event target: a node, document or window.
|
|
@@ -285,8 +294,8 @@ declare function focusedNode(): NodeId | null;
|
|
|
285
294
|
* Builds the {@link IncaElement} handle for a native node: parentless,
|
|
286
295
|
* childless, with `id`, `focus()`, `blur()`, `click()`, the pointer capture
|
|
287
296
|
* methods, `contains()`, the listener methods of an event target, `tabIndex`,
|
|
288
|
-
* the `value` of an `input`, `getRootNode()`, the layout members and the event
|
|
289
|
-
* all driven through the host.
|
|
297
|
+
* the `value` of an `input`, `getRootNode()`, the layout members, the node members and the event
|
|
298
|
+
* handler properties, all driven through the host.
|
|
290
299
|
* @param id - the native node's id
|
|
291
300
|
* @param kind - whether the node is an element or a comment stand-in
|
|
292
301
|
* @param tag - the node's element kind, `div` when omitted; a `button` or `input` defaults to tab
|
|
@@ -296,6 +305,19 @@ declare function focusedNode(): NodeId | null;
|
|
|
296
305
|
* @returns the new handle
|
|
297
306
|
*/
|
|
298
307
|
declare function createIncaElement(id: NodeId, kind: IncaElement["kind"], tag?: TagName, passiveByDefault?: readonly string[]): IncaElement;
|
|
308
|
+
/**
|
|
309
|
+
* Allocates a new element node for `tag`.
|
|
310
|
+
* @param tag - the node's element kind
|
|
311
|
+
* @returns the new, parentless, childless element
|
|
312
|
+
*/
|
|
313
|
+
declare function createElementNode(tag: TagName): IncaElement;
|
|
314
|
+
/**
|
|
315
|
+
* Creates the hidden container that stands in for a comment node, such as a
|
|
316
|
+
* placeholder for conditional content.
|
|
317
|
+
* @param text - the data of the comment
|
|
318
|
+
* @returns the new hidden element
|
|
319
|
+
*/
|
|
320
|
+
declare function createCommentNode(text?: string): IncaElement;
|
|
299
321
|
/**
|
|
300
322
|
* Returns the handle of the host's mount container, which stands between the app's elements and
|
|
301
323
|
* `document` in an event path. A live handle is reused, so a mount and an event see one object.
|
|
@@ -310,24 +332,12 @@ declare function rootElement(): IncaElement;
|
|
|
310
332
|
* @returns `true` after {@link markRemoved} or {@link markDestroyed} reached `node`
|
|
311
333
|
*/
|
|
312
334
|
declare function isRemoved(node: IncaNode): boolean;
|
|
313
|
-
/**
|
|
314
|
-
* Allocates a new element node for `tag`.
|
|
315
|
-
* @param tag - the node's element kind
|
|
316
|
-
* @returns the new, parentless, childless element
|
|
317
|
-
*/
|
|
318
|
-
declare function createElementNode(tag: TagName): IncaElement;
|
|
319
335
|
/**
|
|
320
336
|
* Creates a text leaf.
|
|
321
337
|
* @param text - the initial text content
|
|
322
338
|
* @returns the new text leaf
|
|
323
339
|
*/
|
|
324
340
|
declare function createTextNode(text: string): IncaText;
|
|
325
|
-
/**
|
|
326
|
-
* Creates the hidden container that stands in for a comment node, such as a
|
|
327
|
-
* placeholder for conditional content.
|
|
328
|
-
* @returns the new hidden element
|
|
329
|
-
*/
|
|
330
|
-
declare function createCommentNode(): IncaElement;
|
|
331
341
|
/**
|
|
332
342
|
* Updates a text leaf's content in place.
|
|
333
343
|
* @param node - the text leaf to update
|
|
@@ -373,11 +383,11 @@ declare function parentNode(node: IncaNode): IncaElement | null;
|
|
|
373
383
|
*/
|
|
374
384
|
declare function nextSibling(node: IncaNode): IncaNode | null;
|
|
375
385
|
declare namespace rendererCore_d_exports {
|
|
376
|
-
export { AttributeValue, CallbackId, EventHandler, EventHandlers, EventLike, EventListener, EventListenerObject, EventListenerOrObject, IncaCompositionEvent, IncaCore, IncaDocument, IncaElement, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaInputElement, IncaInputEvent, IncaKeyboardEvent, IncaMouseEvent, IncaNode, IncaPointerEvent, IncaText, IncaUIEvent, IncaWheelEvent, IncaWindow, ListenerOptions, NodeId, Overflow, Px, ScrollAlignment, StyleProps, TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
|
|
386
|
+
export { Attr, AttributeValue, CallbackId, CharacterDataMembers, EventHandler, EventHandlers, EventLike, EventListener, EventListenerObject, EventListenerOrObject, HTMLCollectionOf, IncaCompositionEvent, IncaCore, IncaDocument, IncaElement, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaInputElement, IncaInputEvent, IncaKeyboardEvent, IncaMouseEvent, IncaNode, IncaPointerEvent, IncaText, IncaUIEvent, IncaWheelEvent, IncaWindow, ListenerOptions, NamedNodeMap, NodeId, NodeListOf, NodeMembers, Overflow, Px, ScrollAlignment, StyleProps, TagName, TextContentMember, TextMembers, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
|
|
377
387
|
}
|
|
378
388
|
/**
|
|
379
389
|
* What a custom renderer (`incajs/vue`) drives the host through: the tree and
|
|
380
390
|
* event calls, the element handles and the shadow tree.
|
|
381
391
|
*/
|
|
382
392
|
type IncaCore = typeof rendererCore_d_exports;
|
|
383
|
-
export { setStyle as A, removeChild as C, scrollNode as D, scrollIntoViewNode as E, focus as F, latestEventId as I, removeEventListener as L, blur as M, click as N, scrollOf as O, dispatchEvent as P, createEventTarget as R, removeAttribute as S, rootNodeId as T, getAttribute as _,
|
|
393
|
+
export { setStyle as A, removeChild as C, scrollNode as D, scrollIntoViewNode as E, focus as F, latestEventId as I, removeEventListener as L, blur as M, click as N, scrollOf as O, dispatchEvent as P, createEventTarget as R, removeAttribute as S, rootNodeId as T, getAttribute as _, parentNode as a, layoutOf as b, setText as c, createElementNode as d, createIncaElement as f, focusedNode as g, createNode as h, nextSibling as i, addEventListener as j, setAttribute as k, isRemoved as l, appendChild as m, createTextNode as n, remove as o, rootElement as p, insert as r, setElementText as s, IncaCore as t, createCommentNode as u, holdNode as v, removeStyle as w, releaseNode as x, insertBefore as y };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,B as n,C as r,D as i,E as a,F as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,T as h,_ as g,a as _,b as v,c as y,d as b,f as x,g as S,h as C,i as w,j as T,k as E,l as D,m as O,n as k,o as A,r as j,s as M,t as N,u as P,v as F,w as I,x as L,y as R,z}from"./hooks-CNWfrFj9.js";var B=/* @__PURE__ */ e({addEventListener:()=>l,appendChild:()=>O,blur:()=>u,click:()=>f,createCommentNode:()=>N,createElementNode:()=>k,createEventTarget:()=>T,createIncaElement:()=>j,createNode:()=>C,createTextNode:()=>_,dispatchEvent:()=>o,focus:()=>s,focusedNode:()=>S,getAttribute:()=>g,holdNode:()=>F,insert:()=>A,insertBefore:()=>R,isRemoved:()=>z,latestEventId:()=>c,layoutOf:()=>v,nextSibling:()=>M,parentNode:()=>y,releaseNode:()=>L,releaseWhenCollected:()=>n,remove:()=>D,removeAttribute:()=>m,removeChild:()=>r,removeEventListener:()=>p,removeStyle:()=>I,rootElement:()=>w,rootNodeId:()=>h,scrollIntoViewNode:()=>a,scrollNode:()=>i,scrollOf:()=>d,setAttribute:()=>E,setElementText:()=>P,setStyle:()=>t,setText:()=>b,window:()=>x});export{B as t};
|
|
@@ -3,6 +3,12 @@ declare global {
|
|
|
3
3
|
function setInterval<A extends unknown[]>(handler: (...args: A) => void, delay?: number, ...args: A): number;
|
|
4
4
|
function clearTimeout(id?: number): void;
|
|
5
5
|
function clearInterval(id?: number): void;
|
|
6
|
+
function requestAnimationFrame(callback: (time: number) => void): number;
|
|
7
|
+
function cancelAnimationFrame(id: number): void;
|
|
8
|
+
interface Performance {
|
|
9
|
+
now(): number;
|
|
10
|
+
}
|
|
11
|
+
var performance: Performance;
|
|
6
12
|
}
|
|
7
13
|
/** The events whose handler property every element has. */
|
|
8
14
|
declare const HANDLER_EVENTS: readonly ["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"];
|
|
@@ -49,18 +55,216 @@ type EventHandler<E = IncaEvent, T = IncaElement> = (this: T, event: E) => unkno
|
|
|
49
55
|
* `focusout` excepted.
|
|
50
56
|
*/
|
|
51
57
|
type EventHandlers<T = IncaElement> = { [K in (typeof HANDLER_EVENTS)[number] as `on${K}`]: EventHandler<IncaEventMap[K], T> | object | null; };
|
|
58
|
+
/** A live, read-only list of elements. */
|
|
59
|
+
interface HTMLCollectionOf<T extends IncaElement> {
|
|
60
|
+
readonly [index: number]: T;
|
|
61
|
+
/** The number of elements in the list. */
|
|
62
|
+
readonly length: number;
|
|
63
|
+
/**
|
|
64
|
+
* The element at `index`, or `null` beyond the list. The index converts to an unsigned 32-bit
|
|
65
|
+
* integer.
|
|
66
|
+
* @param index - The position in the list.
|
|
67
|
+
* @returns The element at `index`, or `null`.
|
|
68
|
+
*/
|
|
69
|
+
item(index: number): T | null;
|
|
70
|
+
/**
|
|
71
|
+
* The first element whose `id` is `name`, else the first whose `name` attribute is `name`, or
|
|
72
|
+
* `null`. The empty string finds none.
|
|
73
|
+
* @param name - An `id` or `name` attribute value.
|
|
74
|
+
* @returns The matching element, or `null`.
|
|
75
|
+
*/
|
|
76
|
+
namedItem(name: string): T | null;
|
|
77
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A read-only list of nodes. The list of `childNodes` follows later changes. The list of
|
|
81
|
+
* `querySelectorAll()` holds the elements found when it was made.
|
|
82
|
+
*/
|
|
83
|
+
interface NodeListOf<T extends IncaNode> {
|
|
84
|
+
readonly [index: number]: T;
|
|
85
|
+
/** The number of nodes in the list. */
|
|
86
|
+
readonly length: number;
|
|
87
|
+
/**
|
|
88
|
+
* The node at `index`, or `null` beyond the list. The index converts to an unsigned 32-bit
|
|
89
|
+
* integer.
|
|
90
|
+
* @param index - The position in the list.
|
|
91
|
+
* @returns The node at `index`, or `null`.
|
|
92
|
+
*/
|
|
93
|
+
item(index: number): T | null;
|
|
94
|
+
/**
|
|
95
|
+
* Calls `callback` with the node, its index and the list for each node in order.
|
|
96
|
+
* @throws TypeError when `callback` is not a function
|
|
97
|
+
* @param callback - The function to call for each node.
|
|
98
|
+
* @param thisArg - The value of `this` inside `callback`.
|
|
99
|
+
*/
|
|
100
|
+
forEach(callback: (value: T, index: number, list: NodeListOf<T>) => void, thisArg?: unknown): void;
|
|
101
|
+
/** The pairs of index and node in order. */
|
|
102
|
+
entries(): IterableIterator<[number, T]>;
|
|
103
|
+
/** The indices in order. */
|
|
104
|
+
keys(): IterableIterator<number>;
|
|
105
|
+
/** The nodes in order. */
|
|
106
|
+
values(): IterableIterator<T>;
|
|
107
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
108
|
+
}
|
|
109
|
+
/** An attribute of an element. It has no `Node` members. */
|
|
110
|
+
interface Attr {
|
|
111
|
+
/** The attribute name in lower case. */
|
|
112
|
+
readonly name: string;
|
|
113
|
+
/** The same as `name`. */
|
|
114
|
+
readonly localName: string;
|
|
115
|
+
/**
|
|
116
|
+
* The value. While the element holds the attribute, a read gives its current value and an
|
|
117
|
+
* assignment sets it as a string. After the attribute is removed, the `Attr` keeps the last
|
|
118
|
+
* value it read, and an assignment changes the `Attr` only.
|
|
119
|
+
*/
|
|
120
|
+
value: string;
|
|
121
|
+
/** Always `null`. */
|
|
122
|
+
readonly namespaceURI: null;
|
|
123
|
+
/** Always `null`. */
|
|
124
|
+
readonly prefix: null;
|
|
125
|
+
/** Always `true`. */
|
|
126
|
+
readonly specified: true;
|
|
127
|
+
/** The element that holds the attribute, or `null` once the attribute is removed. */
|
|
128
|
+
readonly ownerElement: IncaElement | null;
|
|
129
|
+
}
|
|
130
|
+
/** A live, read-only list of the attributes of an element in alphabetical order of the name. */
|
|
131
|
+
interface NamedNodeMap {
|
|
132
|
+
readonly [index: number]: Attr;
|
|
133
|
+
/** The number of attributes. */
|
|
134
|
+
readonly length: number;
|
|
135
|
+
/**
|
|
136
|
+
* The attribute at `index`, or `null` beyond the list. The index converts to an unsigned 32-bit
|
|
137
|
+
* integer.
|
|
138
|
+
* @param index - The position in the list.
|
|
139
|
+
* @returns The attribute at `index`, or `null`.
|
|
140
|
+
*/
|
|
141
|
+
item(index: number): Attr | null;
|
|
142
|
+
/**
|
|
143
|
+
* The attribute named `qualifiedName`, or `null`. The letters `A` to `Z` of the name match their
|
|
144
|
+
* lower case. Reading the same attribute twice gives the same object while it stays set.
|
|
145
|
+
* @param qualifiedName - The attribute name.
|
|
146
|
+
* @returns The attribute, or `null`.
|
|
147
|
+
*/
|
|
148
|
+
getNamedItem(qualifiedName: string): Attr | null;
|
|
149
|
+
[Symbol.iterator](): IterableIterator<Attr>;
|
|
150
|
+
}
|
|
151
|
+
/** The members every node has: what it is, its data and its place in the tree. */
|
|
152
|
+
interface NodeMembers {
|
|
153
|
+
/** `1` for an element, `3` for a text node and `8` for a comment stand-in. */
|
|
154
|
+
readonly nodeType: 1 | 3 | 8;
|
|
155
|
+
/**
|
|
156
|
+
* The {@link IncaElement.tagName} of an element, `"#text"` for a text node and `"#comment"` for a
|
|
157
|
+
* comment stand-in.
|
|
158
|
+
*/
|
|
159
|
+
readonly nodeName: string;
|
|
160
|
+
/**
|
|
161
|
+
* The data of a text node or a comment stand-in, and `null` for an element. Assigning `null` or
|
|
162
|
+
* `undefined` stores `""` and any other value stores its string. Assigning to an element or to a
|
|
163
|
+
* freed node does nothing.
|
|
164
|
+
*/
|
|
165
|
+
nodeValue: string | null;
|
|
166
|
+
/** Whether the node hangs under the mount container, which counts as connected. */
|
|
167
|
+
readonly isConnected: boolean;
|
|
168
|
+
/** The `document` export. */
|
|
169
|
+
readonly ownerDocument: IncaDocument;
|
|
170
|
+
/**
|
|
171
|
+
* The parent, `document` for the mount container and `null` for a detached node. A freed node
|
|
172
|
+
* reads `null`.
|
|
173
|
+
*/
|
|
174
|
+
readonly parentNode: IncaElement | IncaDocument | null;
|
|
175
|
+
/** The first child, or `null`. */
|
|
176
|
+
readonly firstChild: IncaNode | null;
|
|
177
|
+
/** The last child, or `null`. */
|
|
178
|
+
readonly lastChild: IncaNode | null;
|
|
179
|
+
/** The sibling right before this node, or `null`. */
|
|
180
|
+
readonly previousSibling: IncaNode | null;
|
|
181
|
+
/** The sibling right after this node, or `null`. */
|
|
182
|
+
readonly nextSibling: IncaNode | null;
|
|
183
|
+
/**
|
|
184
|
+
* The children in order, as a live list. Every read returns the same object, which follows later
|
|
185
|
+
* changes. A freed node has an empty list.
|
|
186
|
+
*/
|
|
187
|
+
readonly childNodes: NodeListOf<IncaNode>;
|
|
188
|
+
/** Whether the node has a child. */
|
|
189
|
+
hasChildNodes(): boolean;
|
|
190
|
+
}
|
|
191
|
+
/** The `textContent` of a node. */
|
|
192
|
+
interface TextContentMember {
|
|
193
|
+
/**
|
|
194
|
+
* The data of a text node or a comment stand-in, and the data of the text nodes below an
|
|
195
|
+
* element in tree order, comment stand-ins left out. Assigning `null` or `undefined` stores `""`
|
|
196
|
+
* and any other value stores its string. Assigning to an element replaces its children with one
|
|
197
|
+
* text node, or with none for `""`. A freed node reads `""` or its last data and ignores the
|
|
198
|
+
* assignment.
|
|
199
|
+
*/
|
|
200
|
+
textContent: string;
|
|
201
|
+
}
|
|
202
|
+
/** The members of a text node and a comment stand-in that read and edit their data. */
|
|
203
|
+
interface CharacterDataMembers extends TextContentMember {
|
|
204
|
+
/** The data. Assigning `null` stores `""` and any other value stores its string. */
|
|
205
|
+
data: string;
|
|
206
|
+
/** The number of UTF-16 code units of the data. */
|
|
207
|
+
readonly length: number;
|
|
208
|
+
/**
|
|
209
|
+
* The part of the data from `offset`. Both arguments convert to unsigned 32-bit integers and
|
|
210
|
+
* count UTF-16 code units. `count` stops at the end of the data.
|
|
211
|
+
* @param offset - Where the part starts.
|
|
212
|
+
* @param count - The length of the part.
|
|
213
|
+
* @throws {DOMException} named `IndexSizeError` when `offset` is beyond the data.
|
|
214
|
+
*/
|
|
215
|
+
substringData(offset: number, count: number): string;
|
|
216
|
+
/**
|
|
217
|
+
* Adds `data` at the end of the data.
|
|
218
|
+
* @param data - The text to add.
|
|
219
|
+
*/
|
|
220
|
+
appendData(data: string): void;
|
|
221
|
+
/**
|
|
222
|
+
* Adds `data` at `offset`.
|
|
223
|
+
* @param offset - Where to add.
|
|
224
|
+
* @param data - The text to add.
|
|
225
|
+
* @throws {DOMException} named `IndexSizeError` when `offset` is beyond the data.
|
|
226
|
+
*/
|
|
227
|
+
insertData(offset: number, data: string): void;
|
|
228
|
+
/**
|
|
229
|
+
* Removes `count` units from `offset`.
|
|
230
|
+
* @param offset - Where the removal starts.
|
|
231
|
+
* @param count - The number of units, stopping at the end of the data.
|
|
232
|
+
* @throws {DOMException} named `IndexSizeError` when `offset` is beyond the data.
|
|
233
|
+
*/
|
|
234
|
+
deleteData(offset: number, count: number): void;
|
|
235
|
+
/**
|
|
236
|
+
* Replaces `count` units from `offset` with `data`.
|
|
237
|
+
* @param offset - Where the replaced part starts.
|
|
238
|
+
* @param count - The number of units, stopping at the end of the data.
|
|
239
|
+
* @param data - The new text.
|
|
240
|
+
* @throws {DOMException} named `IndexSizeError` when `offset` is beyond the data.
|
|
241
|
+
*/
|
|
242
|
+
replaceData(offset: number, count: number, data: string): void;
|
|
243
|
+
}
|
|
244
|
+
/** The members only a text node has. */
|
|
245
|
+
interface TextMembers {
|
|
246
|
+
/** The data of this node and of the text nodes that touch it, in order. */
|
|
247
|
+
readonly wholeText: string;
|
|
248
|
+
/**
|
|
249
|
+
* Cuts the data at `offset`. This node keeps the head and the new node holds the tail. The new
|
|
250
|
+
* node follows this one when this one has a parent, and has no parent otherwise.
|
|
251
|
+
* @param offset - Where to cut, converted like the offset of `substringData()`.
|
|
252
|
+
* @returns The new node.
|
|
253
|
+
* @throws {DOMException} named `IndexSizeError` when `offset` is beyond the data.
|
|
254
|
+
*/
|
|
255
|
+
splitText(offset: number): IncaText;
|
|
256
|
+
}
|
|
52
257
|
/**
|
|
53
258
|
* A container node: either a real element or the hidden stand-in that
|
|
54
259
|
* `createCommentNode` makes. It is the only node type that can act as a
|
|
55
|
-
* parent. `parent`
|
|
56
|
-
* tree.
|
|
260
|
+
* parent. `parent` reads the node's current position in the tree.
|
|
57
261
|
*
|
|
58
262
|
* A removed node keeps its attributes and its position in its own subtree, and its members read
|
|
59
263
|
* them. Its listeners are dropped. `addEventListener()` and `removeEventListener()` ignore the
|
|
60
264
|
* call, an assignment to a handler property does nothing, and `dispatchEvent()` runs no listener
|
|
61
265
|
* on it.
|
|
62
266
|
*/
|
|
63
|
-
interface IncaElement extends IncaEventTarget, EventHandlers {
|
|
267
|
+
interface IncaElement extends IncaEventTarget, EventHandlers, NodeMembers, TextContentMember {
|
|
64
268
|
/**
|
|
65
269
|
* The `id` attribute, or an empty string when it is unset. Assigning sets
|
|
66
270
|
* the attribute to the value as a string.
|
|
@@ -78,8 +282,11 @@ interface IncaElement extends IncaEventTarget, EventHandlers {
|
|
|
78
282
|
readonly tagName: string;
|
|
79
283
|
/** The current parent, or `null` if this node isn't attached to the tree. */
|
|
80
284
|
parent: IncaElement | null;
|
|
81
|
-
/**
|
|
82
|
-
|
|
285
|
+
/**
|
|
286
|
+
* The child elements in order, as a live collection. Every read returns the same object, which
|
|
287
|
+
* follows later changes. A removed element lists the element children it kept.
|
|
288
|
+
*/
|
|
289
|
+
readonly children: HTMLCollectionOf<IncaElement>;
|
|
83
290
|
/** The parent element, or `null` for a detached node and for the mount container. */
|
|
84
291
|
readonly parentElement: IncaElement | null;
|
|
85
292
|
/** The first child that is an element, or `null`. */
|
|
@@ -168,28 +375,47 @@ interface IncaElement extends IncaEventTarget, EventHandlers {
|
|
|
168
375
|
/** The names of the set attributes in alphabetical order. */
|
|
169
376
|
getAttributeNames(): string[];
|
|
170
377
|
/**
|
|
171
|
-
* The set attributes as
|
|
172
|
-
*
|
|
378
|
+
* The set attributes as a live map. Every read returns the same object, which follows later
|
|
379
|
+
* changes. A key that equals the name of a set attribute reads its `Attr`.
|
|
173
380
|
*/
|
|
174
|
-
readonly attributes:
|
|
175
|
-
name: string;
|
|
176
|
-
value: string;
|
|
177
|
-
}[];
|
|
381
|
+
readonly attributes: NamedNodeMap;
|
|
178
382
|
/**
|
|
179
383
|
* Whether this element matches the selector list. `:hover`, `:focus` and the other interactive
|
|
180
384
|
* and form-state pseudo-classes never match.
|
|
181
|
-
* @throws DOMException named `SyntaxError` for an invalid selector
|
|
385
|
+
* @throws DOMException named `SyntaxError` for an invalid selector, also after this element is
|
|
386
|
+
* removed
|
|
182
387
|
* @param selectors - A selector list.
|
|
183
388
|
* @returns `true` when this element matches the selector list.
|
|
184
389
|
*/
|
|
185
390
|
matches(selectors: string): boolean;
|
|
186
391
|
/**
|
|
187
392
|
* The nearest element at or above this one that matches the selector list, or `null`.
|
|
188
|
-
* @throws DOMException named `SyntaxError` for an invalid selector
|
|
393
|
+
* @throws DOMException named `SyntaxError` for an invalid selector, also after this element is
|
|
394
|
+
* removed
|
|
189
395
|
* @param selectors - A selector list.
|
|
190
396
|
* @returns The matching element, or `null` when none matches.
|
|
191
397
|
*/
|
|
192
398
|
closest(selectors: string): IncaElement | null;
|
|
399
|
+
/**
|
|
400
|
+
* The first descendant element that matches the selector list, or `null`. This element is never
|
|
401
|
+
* in the result. `:scope` and a leading `&` select this element. A removed element searches the
|
|
402
|
+
* subtree it kept.
|
|
403
|
+
* @throws DOMException named `SyntaxError` for an invalid selector, also after this element is
|
|
404
|
+
* removed
|
|
405
|
+
* @param selectors - A selector list.
|
|
406
|
+
* @returns The first matching descendant in document order, or `null`.
|
|
407
|
+
*/
|
|
408
|
+
querySelector(selectors: string): IncaElement | null;
|
|
409
|
+
/**
|
|
410
|
+
* The descendant elements that match the selector list, in document order, as a list that later
|
|
411
|
+
* changes do not reach. Every call returns a new list. A removed element searches the subtree it
|
|
412
|
+
* kept.
|
|
413
|
+
* @throws DOMException named `SyntaxError` for an invalid selector, also after this element is
|
|
414
|
+
* removed
|
|
415
|
+
* @param selectors - A selector list.
|
|
416
|
+
* @returns The matching descendants.
|
|
417
|
+
*/
|
|
418
|
+
querySelectorAll(selectors: string): NodeListOf<IncaElement>;
|
|
193
419
|
/**
|
|
194
420
|
* The box this node was drawn at in the last frame, in window logical
|
|
195
421
|
* pixels. A node created in the same task reads all zeros.
|
|
@@ -253,7 +479,7 @@ interface IncaInputElement extends IncaElement {
|
|
|
253
479
|
value: string;
|
|
254
480
|
}
|
|
255
481
|
/** A text leaf node. */
|
|
256
|
-
interface IncaText {
|
|
482
|
+
interface IncaText extends NodeMembers, CharacterDataMembers, TextMembers {
|
|
257
483
|
/** Discriminates this node within the {@link IncaNode} union. */
|
|
258
484
|
readonly kind: "text";
|
|
259
485
|
/** The current parent, or `null` if this node isn't attached to the tree. */
|
|
@@ -511,7 +737,7 @@ interface IncaEvent {
|
|
|
511
737
|
readonly defaultPrevented: boolean;
|
|
512
738
|
/** `true` for events the host dispatches and `false` for events a script dispatches. */
|
|
513
739
|
readonly isTrusted: boolean;
|
|
514
|
-
/** Milliseconds since the
|
|
740
|
+
/** Milliseconds since the app was loaded. */
|
|
515
741
|
readonly timeStamp: number;
|
|
516
742
|
/** A number that grows with each event and is the same on every node that event reaches. */
|
|
517
743
|
readonly eventId: number;
|
|
@@ -774,4 +1000,4 @@ type EventListenerOrObject<E = IncaEvent, T = IncaEventTarget> = EventListener<E
|
|
|
774
1000
|
* `dispatchEvent`, and the event handler properties such as `onkeydown`.
|
|
775
1001
|
*/
|
|
776
1002
|
declare const window: IncaWindow;
|
|
777
|
-
export {
|
|
1003
|
+
export { EventHandler as A, TextContentMember as B, Overflow as C, TagName as D, StyleProps as E, IncaNode as F, RectValues as G, ScrollIntoViewOptions as H, IncaText as I, NamedNodeMap as L, HTMLCollectionOf as M, IncaElement as N, Attr as O, IncaInputElement as P, NodeListOf as R, NodeId as S, ScrollAlignment as T, ScrollOptions as U, TextMembers as V, RectLike as W, IncaPointerEvent as _, EventListener as a, IncaWindow as b, IncaCompositionEvent as c, IncaEventMap as d, IncaEventTarget as f, IncaMouseEvent as g, IncaKeyboardEvent as h, EventLike as i, EventHandlers as j, CharacterDataMembers as k, IncaDocument as l, IncaInputEvent as m, AttributeValue as n, EventListenerObject as o, IncaFocusEvent as p, CallbackId as r, EventListenerOrObject as s, window as t, IncaEvent as u, IncaUIEvent as v, Px as w, ListenerOptions as x, IncaWheelEvent as y, NodeMembers as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as TagName, E as StyleProps, F as IncaNode, G as RectValues, H as ScrollIntoViewOptions, L as NamedNodeMap, M as HTMLCollectionOf, N as IncaElement, O as Attr, P as IncaInputElement, R as NodeListOf, S as NodeId, U as ScrollOptions, W as RectLike, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent } from "./chunks/window-BhkZc6km.js";
|
|
2
2
|
/**
|
|
3
3
|
* The event target between the elements and `window`. An event at an element
|
|
4
4
|
* passes through it, and it is the next target after the mount container.
|
|
@@ -9,4 +9,4 @@ import { A as IncaElement, D as TagName, E as StyleProps, F as ScrollOptions, I
|
|
|
9
9
|
* `passive: false`. It is an instance of the global `Document`.
|
|
10
10
|
*/
|
|
11
11
|
export declare const document: IncaDocument;
|
|
12
|
-
export { type AttributeValue, type CallbackId, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type IncaCompositionEvent, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaPointerEvent, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NodeId, type Px, type RectLike, type RectValues, type ScrollIntoViewOptions, type ScrollOptions, type StyleProps, type TagName, window };
|
|
12
|
+
export { type Attr, type AttributeValue, type CallbackId, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type HTMLCollectionOf, type IncaCompositionEvent, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaPointerEvent, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NamedNodeMap, type NodeId, type NodeListOf, type Px, type RectLike, type RectValues, type ScrollIntoViewOptions, type ScrollOptions, type StyleProps, type TagName, window };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{p as document,f as window}from"./chunks/hooks-CNWfrFj9.js";
|
package/dist/rendererCore.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as setStyle, C as removeChild, D as scrollNode, E as scrollIntoViewNode, F as focus, I as latestEventId, L as removeEventListener, M as blur, N as click, O as scrollOf, P as dispatchEvent, R as createEventTarget, S as removeAttribute, T as rootNodeId, _ as getAttribute, a as
|
|
3
|
-
export { type AttributeValue, type CallbackId, type EventHandler, type EventHandlers, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type IncaCompositionEvent, IncaCore, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaPointerEvent, type IncaText, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NodeId, type Overflow, type Px, type ScrollAlignment, type StyleProps, type TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
|
|
1
|
+
import { A as EventHandler, B as TextContentMember, C as Overflow, D as TagName, E as StyleProps, F as IncaNode, I as IncaText, L as NamedNodeMap, M as HTMLCollectionOf, N as IncaElement, O as Attr, P as IncaInputElement, R as NodeListOf, S as NodeId, T as ScrollAlignment, V as TextMembers, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as EventHandlers, k as CharacterDataMembers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as NodeMembers } from "./chunks/window-BhkZc6km.js";
|
|
2
|
+
import { A as setStyle, C as removeChild, D as scrollNode, E as scrollIntoViewNode, F as focus, I as latestEventId, L as removeEventListener, M as blur, N as click, O as scrollOf, P as dispatchEvent, R as createEventTarget, S as removeAttribute, T as rootNodeId, _ as getAttribute, a as parentNode, b as layoutOf, c as setText, d as createElementNode, f as createIncaElement, g as focusedNode, h as createNode, i as nextSibling, j as addEventListener, k as setAttribute, l as isRemoved, m as appendChild, n as createTextNode, o as remove, p as rootElement, r as insert, s as setElementText, t as IncaCore, u as createCommentNode, v as holdNode, w as removeStyle, x as releaseNode, y as insertBefore } from "./chunks/rendererCore-B2W5p9bR.js";
|
|
3
|
+
export { type Attr, type AttributeValue, type CallbackId, type CharacterDataMembers, type EventHandler, type EventHandlers, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type HTMLCollectionOf, type IncaCompositionEvent, IncaCore, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaPointerEvent, type IncaText, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NamedNodeMap, type NodeId, type NodeListOf, type NodeMembers, type Overflow, type Px, type ScrollAlignment, type StyleProps, type TagName, type TextContentMember, type TextMembers, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
|
package/dist/rendererCore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{M as addEventListener,m as appendChild,N as blur,P as click,t as createCommentNode,n as createElementNode,j as createEventTarget,r as createIncaElement,h as createNode,a as createTextNode,F as dispatchEvent,I as focus,g as focusedNode,_ as getAttribute,v as holdNode,o as insert,y as insertBefore,z as isRemoved,L as latestEventId,b as layoutOf,s as nextSibling,c as parentNode,x as releaseNode,B as releaseWhenCollected,l as remove,S as removeAttribute,C as removeChild,R as removeEventListener,w as removeStyle,i as rootElement,T as rootNodeId,E as scrollIntoViewNode,D as scrollNode,O as scrollOf,k as setAttribute,u as setElementText,A as setStyle,d as setText,f as window}from"./chunks/hooks-CNWfrFj9.js";import"./chunks/rendererCore-D82agHLO.js";
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./chunks/rendererCore-
|
|
1
|
+
import { N as IncaElement } from "./chunks/window-BhkZc6km.js";
|
|
2
|
+
import "./chunks/rendererCore-B2W5p9bR.js";
|
|
3
3
|
import { App, Component, ComponentPublicInstance } from "@vue/runtime-core";
|
|
4
4
|
/**
|
|
5
5
|
* `@vue/runtime-core`'s `App`, with `mount` also callable with no argument
|
package/dist/vue.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as e}from"./chunks/hooks-CNWfrFj9.js";import{t}from"./chunks/rendererCore-D82agHLO.js";import{ErrorCodes as n,callWithAsyncErrorHandling as r,createRenderer as i,warn as a}from"@vue/runtime-core";function o(e){return Object.defineProperty(e,"__v_skip",{value:!0}),e}function s(e){return{createElement:t=>o(e.createElementNode(t)),createText:t=>o(e.createTextNode(t)),createComment:t=>o(e.createCommentNode(t)),setText:(t,n)=>e.setText(t,n),setElementText:(t,n)=>e.setElementText(t,n),insert:(t,n,r)=>e.insert(t,n,r),remove:t=>e.remove(t),parentNode:e.parentNode,nextSibling:e.nextSibling}}function c(e,t){let n=t=>(e.holdNode(t.__node_id),e.releaseWhenCollected(t),t),{createElement:r,createText:i}=t;return{createElement:e=>n(r(e)),createText:e=>n(i(e))}}const l=e=>/^on[^a-z]/.test(e),u=e=>/^on[a-z]/.test(e),d=/(?:Once|Passive|Capture)$/,f=/^on:?(?:Once|Passive|Capture)$/,p=e=>e.replace(/\B([A-Z])/g,`-$1`).toLowerCase();function m(e){let t=e,n={event:``,once:!1,capture:!1,passive:!1},r;for(;(r=t.match(d))&&!f.test(t);)t=t.slice(0,-r[0].length),r[0]===`Once`?n.once=!0:r[0]===`Capture`?n.capture=!0:n.passive=!0;return n.event=t[2]===`:`?t.slice(3):p(t.slice(2)),n}const h=e=>typeof e==`string`||typeof e==`number`,g=/* @__PURE__ */ new WeakMap;function _(e,t,n){let r=typeof n==`object`&&n?n:{},i=g.get(t);i||g.set(t,i=/* @__PURE__ */ new Map);let a=!1;for(let n of i.keys())h(r[n])||(e.removeStyle(t.__node_id,n),i.delete(n),a=!0);for(let[n,o]of Object.entries(r))h(o)&&(a||i.get(n)!==o)&&(e.setStyle(t.__node_id,n,o),i.set(n,o))}function v(e,t){return e?typeof e==`function`?[e]:Array.isArray(e)?e.slice():(a(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
2
2
|
Expected function or array of functions, received type ${typeof e}.`),[]):null}function y(e,t){let n=e[0];if(typeof n!=`object`||!n)return t(()=>!1);let r=n.stopImmediatePropagation;if(typeof r!=`function`)return t(()=>!1);let i=Object.hasOwn(n,`stopImmediatePropagation`),a=!1;try{n.stopImmediatePropagation=(...e)=>(a=!0,r.apply(n,e))}catch{return t(()=>!1)}try{t(()=>a)}finally{i?n.stopImmediatePropagation=r:delete n.stopImmediatePropagation}}const b=/* @__PURE__ */ new WeakMap,x=({event:e,capture:t,passive:n})=>`${e}:${t===!0}:${n===!0}`;function S(e,t,n,r){let i=Array.from(r.slots.values()).some(e=>!e.fired);i&&!r.registered&&!e.isRemoved(t)?(e.addEventListener(t.__node_id,r.event,r.dispatcher,r.options),r.registered=!0):!i&&r.registered&&(r.registered=!1,e.removeEventListener(t.__node_id,r.event,r.dispatcher,r.options)),r.slots.size===0&&b.get(t)?.delete(n)}function C(e,t,i,{event:a,capture:o,passive:s}){let c={event:a,options:{capture:o,passive:s},slots:/* @__PURE__ */ new Map,registered:!1,dispatcher:(...a)=>{let o=[],s=a[0]?.eventId;y(a,l=>{for(let u of Array.from(c.slots.keys())){if(l())break;let d=c.slots.get(u);if(d&&!d.fired&&!(typeof s==`number`&&d.attachedAt>=s)){d.once&&(d.fired=!0,S(e,t,i,c));for(let e of d.handlers){if(l())break;if(e)try{r(e,d.instance,n.NATIVE_EVENT_HANDLER,a)}catch(e){o.push(e)}}}}});for(let e of o.slice(1))Promise.reject(e);if(o.length>0)throw o[0]}};return c}function w(e,t,n,r){let i=x(n),a=b.get(t)?.get(i);a?.slots.delete(r)&&S(e,t,i,a)}function T(e,t,n,r,i){let a=m(n),o=v(r,n);if(!o){w(e,t,a,n);return}let s=x(a),c=b.get(t);c||b.set(t,c=/* @__PURE__ */ new Map);let l=c.get(s);l||c.set(s,l=C(e,t,s,a));let u=l.slots.get(n);if(u)u.handlers=o,u.instance=i;else{l.slots.set(n,{attachedAt:e.latestEventId(),handlers:o,instance:i,once:a.once,fired:!1});try{S(e,t,s,l)}catch(e){throw l.slots.delete(n),l.slots.size===0&&c.delete(s),e}}}const E=/* @__PURE__ */ new Set([`disabled`,`hidden`,`inert`,`allowfullscreen`,`formnovalidate`,`ismap`,`itemscope`,`nomodule`,`novalidate`,`readonly`]);function D(e){return(t,n,r,i,a,o)=>{n.startsWith(`onUpdate:`)||(n===`style`?_(e,t,i):l(n)?T(e,t,n,i,o??null):u(n)&&n in t?typeof i==`string`?(Reflect.set(t,n,null),e.setAttribute(t.__node_id,n,i)):Reflect.set(t,n,i):n===`value`&&`value`in t?Reflect.set(t,n,i??``):E.has(n)?n===`hidden`&&typeof i==`string`&&/^until-found$/i.test(i)?e.setAttribute(t.__node_id,n,i):i||i===``?e.setAttribute(t.__node_id,n,``):e.removeAttribute(t.__node_id,n):typeof i==`string`||typeof i==`number`||typeof i==`boolean`?e.setAttribute(t.__node_id,n,i):i==null?e.removeAttribute(t.__node_id,n):e.setAttribute(t.__node_id,n,String(i)))}}const O=/* @__PURE__ */ new Set;function k(n,r){let a={...s(t),patchProp:D(t)},l=i(a);Object.assign(a,c(t,a));let u=l.createApp(n,r),d=u.mount.bind(u),f=u.unmount.bind(u);return Object.assign(u,{mount:t=>{let n=d(t??o(e()));return O.add(u),n},unmount:()=>{f(),O.delete(u)}})}export{k as createIncaApp};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incajs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-platform",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"src/callbacks.mts",
|
|
37
37
|
"src/targets.mts",
|
|
38
38
|
"src/interfaces.mts",
|
|
39
|
-
"src/timers.mts",
|
|
40
39
|
"dist/chunks/hooks-*.js"
|
|
41
40
|
],
|
|
42
41
|
"main": "./dist/index.js",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function e(){return globalThis.__inca_native__}const t=/* @__PURE__ */ new Map;function n(n,r,i,a,o){if(typeof r!=`function`)throw TypeError(`${n} takes a function. pass a function as the handler`);let s=i|0,c=e().startTimer(s>0?s:0,o);if(c===void 0)throw RangeError(`timer ids are exhausted. restart the app`);return t.set(c,{handler:r,args:a,repeat:o}),c}function r(n){let r=n|0;t.delete(r)&&e().stopTimer(r)}Object.defineProperty(globalThis,"__inca_timer__",{value:n=>{let r=t.get(n);r===void 0?e().stopTimer(n):(r.repeat||t.delete(n),Reflect.apply(r.handler,globalThis,r.args))},configurable:!0}),typeof globalThis.__inca_native__?.startTimer==`function`&&Object.assign(globalThis,{setTimeout(e,t=0,...r){return n(`setTimeout`,e,t,r,!1)},setInterval(e,t=0,...r){return n(`setInterval`,e,t,r,!0)},clearTimeout(e=0){r(e)},clearInterval(e=0){r(e)}});const i=/* @__PURE__ */ `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`.split(`.`);function a(e,t){for(let n of i){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}const o=/* @__PURE__ */ new WeakSet;function s(e,t){return o.add(e),Object.defineProperty(e,"__node_id",{value:t})}function c(e){return typeof e==`object`&&!!e&&o.has(e)}const l=/* @__PURE__ */ new Map,u=new FinalizationRegistry(e=>{l.get(e)?.deref()||l.delete(e)});function ee(e){l.set(e.__node_id,new WeakRef(e)),u.register(e,e.__node_id)}function te(e){l.delete(e)}function d(e){return l.get(e)?.deref()}const f=/* @__PURE__ */ new WeakSet;function p(e){return f.has(e)||h.has(e)}function m(e){if(f.add(e),e.kind!==`text`)for(let t of e.children)m(t)}const h=/* @__PURE__ */ new WeakSet;function g(e){return h.has(e)}function _(e){if(h.add(e),e.kind!==`text`){te(e.__node_id);for(let t of e.children)_(t)}}function ne(e){for(let t of e){let e=d(t);e&&_(e)}}const re=new FinalizationRegistry(t=>e().releaseNode(t)),v=/* @__PURE__ */ new WeakSet;function ie(e){return v.has(e)}function ae(e){v.add(e),re.register(e,e.__node_id)}const y=/* @__PURE__ */ new Map,b=/* @__PURE__ */ new Map,x=()=>globalThis.__inca_callbacks__??={};function oe(e,t,n,r){x()[n]=r;let i=y.get(e);i||y.set(e,i=/* @__PURE__ */ new Map),i.set(t,n),b.set(n,{group:e,listener:t})}function S(e,t){return y.get(e)?.get(t)}function C(e){delete x()[e];let t=b.get(e);if(t===void 0)return;b.delete(e);let n=y.get(t.group);n?.delete(t.listener),n?.size===0&&y.delete(t.group)}function se(e){for(let t of e)C(t)}const w=(e,t,n)=>`${e}:${t}:${n===!0}`;Object.defineProperty(globalThis,"__inca_released__",{value:(e,t)=>{let n,r=!1;for(let e of t)try{se([e])}catch(e){r||(n=e),r=!0}if(ne(e),r)throw n},configurable:!0});let T=0;function ce(){return T}function le(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>T&&(T=n),e(...t)}}function E(t,n,r,i={}){if(r==null)return;let a=w(t,n,i.capture);if(S(a,r)!==void 0)return;let o=(...e)=>typeof r==`function`?r.apply(e[0]?.currentTarget,e):r.handleEvent.apply(r,e),s=i.once?(...e)=>(D(t,n,r,i),o(...e)):o;oe(a,r,e().addEventListener(t,n,i.capture===!0,i.passive===!0),le(s))}function D(t,n,r,i={}){if(r==null)return;let a=S(w(t,n,i.capture),r);a!==void 0&&(e().removeEventListener(t,n,a),C(a))}function O(t,n){return e().dispatchEvent(t,n)}function k(t){e().click(t)}function A(t,n){e().focusNode(t,n)}function j(t){e().blurNode(t)}function ue(t,n){e().setPointerCapture(t,n)}function de(t,n){e().releasePointerCapture(t,n)}function fe(t,n){return e().hasPointerCapture(t,n)}function M(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};E(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;D(n(),e,t,{capture:i})},dispatchEvent:e=>O(n(),e)}}function N(){throw TypeError(`document cannot be constructed. use the document export of incajs`)}function pe(){throw TypeError(`a shadow root cannot be constructed. the host has no shadow roots`)}Object.defineProperty(globalThis,"Document",{value:N,writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(globalThis,"ShadowRoot",{value:pe,writable:!0,configurable:!0,enumerable:!1});function P(){return e().rootNodeId()}function me(t){return e().createNode(t)}function he(t,n){e().appendChild(t,n)}function ge(t,n,r){e().insertBefore(t,n,r)}function _e(t,n){e().removeChild(t,n)}function ve(t){se(e().releaseListeners(t))}function ye(t){e().holdNode(t)}function be(t){e().releaseNode(t)}function F(t,n,r){e().setAttribute(t,n,r)}function I(t,n){return e().getAttribute(t,n)}function xe(t){return e().attributeNames(t)}function Se(t,n){return e().matches(t,n)}function Ce(t,n){return e().closest(t,n)}function L(t){return e().layoutOf(t)}function R(t){return e().scrollOf(t)}function z(t,n,r){e().scrollNode(t,n,r)}function B(t,n,r){e().scrollIntoViewNode(t,n,r)}function V(t,n){e().removeAttribute(t,n)}function we(t,n,r){e().setStyle(t,n,r)}function Te(t,n){e().removeStyle(t,n)}function Ee(t){return e().inputValue(t)}function De(t,n){e().setInputValue(t,n)}function H(){return e().focusedNode()}function Oe(){let e=H();return e===null?null:d(e)??null}const U=/* @__PURE__ */ Object.defineProperties(Object.setPrototypeOf(a(M(`$document`,[`wheel`]),()=>!1),N.prototype),{[Symbol.toStringTag]:{value:`Document`},activeElement:{get:Oe}}),W=/* @__PURE__ */ Object.defineProperty(a(M(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`}),ke=/* @__PURE__ */ new Set([`\0`,` `,`
|
|
2
|
-
`,`\f`,`\r`,` `,`/`,`=`,`>`]);function Ae(e){if(e.length===0)return!1;for(let t of e)if(ke.has(t))return!1;return!0}function G(e){if(typeof e==`symbol`)throw TypeError(`a symbol cannot become text`);return String(e)}function K(e,t,n){if(e.length<t)throw TypeError(`${n}() needs ${t} argument${t===1?``:`s`}`)}function je(e,t){let n=t=>{let n=I(e,t);return n===null?null:G(n)},r=()=>g(t)?[]:xe(e);return{getAttribute:(...e)=>(K(e,1,`getAttribute`),g(t)?null:n(G(e[0]))),setAttribute:(...n)=>{K(n,2,`setAttribute`);let r=G(n[0]),i=G(n[1]);if(!Ae(r))throw new DOMException(`the attribute name is not valid. it is empty or holds whitespace, '/', '=' or '>'`,`InvalidCharacterError`);g(t)||F(e,r,i)},hasAttribute:(...e)=>(K(e,1,`hasAttribute`),!g(t)&&n(G(e[0]))!==null),removeAttribute:(...n)=>{K(n,1,`removeAttribute`);let r=G(n[0]);g(t)||V(e,r)},getAttributeNames:()=>r(),get attributes(){return r().map(e=>({name:e,value:n(e)??``}))}}}function q(e){return e.kind===`element`}function J(e){return e.children.filter(q)}function Y(e,t){let n=e.parent?.children??[];for(let r=n.indexOf(e)+t;r>=0&&r<n.length;r+=t){let e=n[r];if(q(e))return e}return null}function Me(e){return{get parentElement(){return e.parent},get firstElementChild(){return J(e)[0]??null},get lastElementChild(){return J(e).at(-1)??null},get childElementCount(){return J(e).length},get previousElementSibling(){return Y(e,-1)},get nextElementSibling(){return Y(e,1)}}}function X(e){return p(e)?null:L(e.__node_id)}function Z(e){let t=e.parent;return!X(e)||!t||!X(t)?null:t}function Q(e){let t=X(e);if(!t)return{left:0,top:0};let n=Z(e),r=n?X(n):null;return{left:Math.round(t[0]-(r?r[0]+r[4]:0)+t[5])||0,top:Math.round(t[1]-(r?r[1]+r[4]:0)+t[6])||0}}function Ne(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 Pe(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 $(e,t,n){if(p(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?R(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)};z(e.__node_id,l(a,s),l(o,c))}function Fe(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 Ie(e,t,n=`div`,r=[]){let i=M(()=>e,r),o=()=>p(u)?null:R(e),l={get id(){return g(u)?``:String(I(e,`id`)??``)},set id(t){g(u)||F(e,`id`,String(t))},kind:t,tagName:n.replace(/[a-z]/g,e=>e.toUpperCase()),parent:null,children:[],focus:t=>{p(u)||A(e,!!t?.preventScroll)},blur:()=>j(e),click:()=>{p(u)||k(e)},setPointerCapture:t=>ue(e,t),releasePointerCapture:t=>de(e,t),hasPointerCapture:t=>fe(e,t),contains:e=>{if(e==null)return!1;if(!c(e))throw TypeError(`the value is not a node. pass an element, a text node or null`);for(let t=e;t!==null;t=t.parent)if(t===u)return!0;return!1},addEventListener:(...e)=>{p(u)||i.addEventListener(...e)},removeEventListener:(...e)=>{p(u)||i.removeEventListener(...e)},dispatchEvent:e=>g(u)||i.dispatchEvent(e),get tabIndex(){return Pe(g(u)?null:I(e,`tabindex`),n)},set tabIndex(t){g(u)||F(e,`tabindex`,t|0)},getBoundingClientRect:()=>Ne(X(u)),get offsetWidth(){return Math.round(X(u)?.[2]??0)},get offsetHeight(){return Math.round(X(u)?.[3]??0)},get offsetLeft(){return Q(u).left},get offsetTop(){return Q(u).top},get offsetParent(){return Z(u)},get clientWidth(){let e=X(u);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=X(u);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(X(u)?.[4]??0)},get clientTop(){return Math.round(X(u)?.[4]??0)},get scrollLeft(){return o()?.[0]??0},set scrollLeft(e){$(u,[e],!1)},get scrollTop(){return o()?.[1]??0},set scrollTop(e){$(u,[void 0,e],!1)},get scrollWidth(){return u.clientWidth+Math.round(o()?.[2]??0)},get scrollHeight(){return u.clientHeight+Math.round(o()?.[3]??0)},scrollTo:(...e)=>$(u,e,!1),scrollBy:(...e)=>$(u,e,!0),scrollIntoView:t=>{if(p(u))return;let{block:n,inline:r}=Fe(t);B(e,n,r)},matches:(...t)=>(K(t,1,`matches`),!g(u)&&Se(e,G(t[0]))),closest:(...t)=>{if(K(t,1,`closest`),g(u))return null;let n=Ce(e,G(t[0]));if(n===null)return null;let r=u;for(;r!==null&&r.__node_id!==n;)r=r.parent;return r},getRootNode:()=>{let e=u;for(;e.parent!==null;)e=e.parent;return e.__node_id===P()?U:e}};n===`input`&&Object.defineProperty(l,"value",{get:()=>g(u)?``:Ee(e),set:t=>{g(u)||De(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let u=a(s(l,e),()=>p(u));return Object.defineProperties(u,Object.getOwnPropertyDescriptors(je(e,u))),Object.defineProperties(u,Object.getOwnPropertyDescriptors(Me(u))),t===`element`&&ee(u),u}function Le(){let e=P();return d(e)??Ie(e,`element`,void 0,[`wheel`])}Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>e===`$document`?U:e===`$window`?W:d(e)??(e===P()?Le():null)),configurable:!0});export{D as A,M as C,O as D,k as E,ae as F,s as I,ie as M,p as N,A as O,m as P,we as S,j as T,P as _,he as a,R as b,I as c,L as d,ve as f,Te as g,_e as h,U as i,g as j,ce as k,ye as l,V as m,Le as n,me as o,be as p,W as r,H as s,Ie as t,ge as u,B as v,E as w,F as x,z as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,C as n,D as r,E as i,F as a,I as o,M as s,N as c,O as l,P as u,S as d,T as f,_ as p,a as m,b as h,c as g,d as _,f as v,g as y,h as b,j as x,k as S,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A,u as j,v as M,w as N,x as P,y as F}from"./hooks-BbPHSiFF.js";function I(e){let t=E(e);return A(t,`element`,e)}function L(e){let t=E(`#text`);return P(t,`value`,e),o({kind:`text`,parent:null,text:e},t)}function R(){let e=E(`#comment`);return d(e,`display`,`none`),A(e,`comment`)}function z(e,t){P(e.__node_id,`value`,t),e.text=t}function B(e,t){for(let t of e.children.slice())W(t);if(!t)return;let n=L(t);m(e.__node_id,n.__node_id),n.parent=e,e.children.push(n)}function V(e){let t=e.parent;if(!t)return;let n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e.parent=null}function H(e){e.parent&&b(e.parent.__node_id,e.__node_id),V(e)}function U(e,t,n){if(n===e&&e.parent===t)return;H(e);let r=n?t.children.indexOf(n):-1;j(t.__node_id,e.__node_id,n&&r!==-1?n.__node_id:null),r===-1?t.children.push(e):t.children.splice(r,0,e),e.parent=t}function W(e){e.parent&&x(e.parent)?V(e):H(e),v(e.__node_id),u(e),e.kind===`element`&&!x(e)&&!s(e)&&(C(e.__node_id),a(e))}function G(e){return e.parent}function K(e){let t=e.parent;if(!t)return null;let n=t.children.indexOf(e);return t.children[n+1]??null}var q=/* @__PURE__ */ e({addEventListener:()=>N,appendChild:()=>m,blur:()=>f,click:()=>i,createCommentNode:()=>R,createElementNode:()=>I,createEventTarget:()=>n,createIncaElement:()=>A,createNode:()=>E,createTextNode:()=>L,dispatchEvent:()=>r,focus:()=>l,focusedNode:()=>k,getAttribute:()=>g,holdNode:()=>C,insert:()=>U,insertBefore:()=>j,isRemoved:()=>c,latestEventId:()=>S,layoutOf:()=>_,nextSibling:()=>K,parentNode:()=>G,releaseNode:()=>D,releaseWhenCollected:()=>a,remove:()=>W,removeAttribute:()=>w,removeChild:()=>b,removeEventListener:()=>t,removeStyle:()=>y,rootElement:()=>T,rootNodeId:()=>p,scrollIntoViewNode:()=>M,scrollNode:()=>F,scrollOf:()=>h,setAttribute:()=>P,setElementText:()=>B,setStyle:()=>d,setText:()=>z,window:()=>O});export{U as a,W as c,L as i,B as l,R as n,K as o,I as r,G as s,q as t,z as u};
|