incajs 0.0.23 → 0.0.24

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.
@@ -0,0 +1 @@
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.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 Map,s=/* @__PURE__ */ new Map,c=()=>globalThis.__inca_callbacks__??={};function l(e,t,n,r){c()[n]=r;let i=o.get(e);i||o.set(e,i=/* @__PURE__ */ new Map),i.set(t,n),s.set(n,{group:e,listener:t})}function u(e,t){return o.get(e)?.get(t)}function d(e){delete c()[e];let t=s.get(e);if(t===void 0)return;s.delete(e);let n=o.get(t.group);n?.delete(t.listener),n?.size===0&&o.delete(t.group)}function f(e){for(let t of e)d(t)}const p=(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{f([e])}catch(e){r||(n=e),r=!0}if(pe(e),r)throw n},configurable:!0});function m(){return e().rootNodeId()}function ee(t){return e().createNode(t)}function te(t,n){e().appendChild(t,n)}function ne(t,n,r){e().insertBefore(t,n,r)}function re(t,n){e().removeChild(t,n)}function ie(t){f(e().destroyNode(t))}function ae(t){e().holdNode(t)}function oe(t){e().releaseNode(t)}function h(t,n,r){e().setAttribute(t,n,r)}function g(t,n){return e().getAttribute(t,n)}function _(t){return e().layoutOf(t)}function v(t){return e().scrollOf(t)}function y(t,n,r){e().scrollNode(t,n,r)}function b(t,n,r){e().scrollIntoViewNode(t,n,r)}function se(t,n){e().removeAttribute(t,n)}function x(t,n,r){e().setStyle(t,n,r)}function S(t,n){e().removeStyle(t,n)}function C(t){return e().inputValue(t)}function ce(t,n){e().setInputValue(t,n)}function w(){return e().focusedNode()}const T=/* @__PURE__ */ new WeakSet;function E(e,t){return T.add(e),Object.defineProperty(e,"__node_id",{value:t})}function le(e){return typeof e==`object`&&!!e&&T.has(e)}const D=/* @__PURE__ */ new Map,ue=new FinalizationRegistry(e=>{D.get(e)?.deref()||D.delete(e)});function de(e){D.set(e.__node_id,new WeakRef(e)),ue.register(e,e.__node_id)}function fe(e){D.delete(e)}function O(e){return D.get(e)?.deref()}const k=/* @__PURE__ */ new WeakSet;function A(e){return k.has(e)}function j(e){if(k.add(e),e.kind!==`text`){fe(e.__node_id);for(let t of e.children)j(t)}}function pe(e){for(let t of e){let e=O(t);e&&j(e)}}const me=new FinalizationRegistry(t=>e().releaseNode(t));function M(e){me.register(e,e.__node_id)}function N(){let e=w();return e===null?null:O(e)??null}let P=0;function F(){return P}function I(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>P&&(P=n),e(...t)}}function L(t,n,r,i={}){if(r==null)return;let a=p(t,n,i.capture);if(u(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)=>(R(t,n,r,i),o(...e)):o;l(a,r,e().addEventListener(t,n,i.capture===!0,i.passive===!0),I(s))}function R(t,n,r,i={}){if(r==null)return;let a=u(p(t,n,i.capture),r);a!==void 0&&(e().removeEventListener(t,n,a),d(a))}function z(t,n){return e().dispatchEvent(t,n)}function B(t){e().click(t)}function V(t,n){e().focusNode(t,n)}function H(t){e().blurNode(t)}function he(t,n){e().setPointerCapture(t,n)}function ge(t,n){e().releasePointerCapture(t,n)}function _e(t,n){return e().hasPointerCapture(t,n)}function U(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};L(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;R(n(),e,t,{capture:i})},dispatchEvent:e=>z(n(),e)}}function W(){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:W,writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(globalThis,"ShadowRoot",{value:ve,writable:!0,configurable:!0,enumerable:!1});const G=/* @__PURE__ */ Object.defineProperties(Object.setPrototypeOf(a(U(`$document`,[`wheel`]),()=>!1),W.prototype),{[Symbol.toStringTag]:{value:`Document`},activeElement:{get:N}}),K=/* @__PURE__ */ Object.defineProperty(a(U(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`});function q(e){return A(e)?null:_(e.__node_id)}function J(e){let t=e.parent;return!q(e)||!t||!q(t)?null:t}function Y(e){let t=q(e);if(!t)return{left:0,top:0};let n=J(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 ye(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 X(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 Z(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?v(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)};y(e.__node_id,l(a,s),l(o,c))}function be(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 Q(e,t,n,r=[]){let i=U(()=>e,r),o=()=>A(c)?null:v(e),s={get id(){return A(c)?``:String(g(e,`id`)??``)},set id(t){A(c)||h(e,`id`,String(t))},kind:t,parent:null,children:[],focus:t=>{A(c)||V(e,!!t?.preventScroll)},blur:()=>H(e),click:()=>{A(c)||B(e)},setPointerCapture:t=>he(e,t),releasePointerCapture:t=>ge(e,t),hasPointerCapture:t=>_e(e,t),contains:e=>{if(e==null)return!1;if(!le(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===c)return!0;return!1},addEventListener:(...e)=>{A(c)||i.addEventListener(...e)},removeEventListener:(...e)=>{A(c)||i.removeEventListener(...e)},dispatchEvent:e=>A(c)||i.dispatchEvent(e),get tabIndex(){return X(A(c)?null:g(e,`tabindex`),n??``)},set tabIndex(t){A(c)||h(e,`tabindex`,t|0)},getBoundingClientRect:()=>ye(q(c)),get offsetWidth(){return Math.round(q(c)?.[2]??0)},get offsetHeight(){return Math.round(q(c)?.[3]??0)},get offsetLeft(){return Y(c).left},get offsetTop(){return Y(c).top},get offsetParent(){return J(c)},get clientWidth(){let e=q(c);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=q(c);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(q(c)?.[4]??0)},get clientTop(){return Math.round(q(c)?.[4]??0)},get scrollLeft(){return o()?.[0]??0},set scrollLeft(e){Z(c,[e],!1)},get scrollTop(){return o()?.[1]??0},set scrollTop(e){Z(c,[void 0,e],!1)},get scrollWidth(){return c.clientWidth+Math.round(o()?.[2]??0)},get scrollHeight(){return c.clientHeight+Math.round(o()?.[3]??0)},scrollTo:(...e)=>Z(c,e,!1),scrollBy:(...e)=>Z(c,e,!0),scrollIntoView:t=>{if(A(c))return;let{block:n,inline:r}=be(t);b(e,n,r)},getRootNode:()=>{let e=c;for(;e.parent!==null;)e=e.parent;return e.__node_id===m()?G:e}};n===`input`&&Object.defineProperty(s,"value",{get:()=>A(c)?``:C(e),set:t=>{A(c)||ce(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let c=a(E(s,e),()=>A(c));return t===`element`&&de(c),c}function $(){let e=m();return O(e)??Q(e,`element`,void 0,[`wheel`])}Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>e===`$document`?G:e===`$window`?K:O(e)??(e===m()?$():null)),configurable:!0});export{b as A,ne as C,re as D,se as E,v as M,h as N,S as O,x as P,ae as S,oe as T,te as _,U as a,w as b,B as c,F as d,R as f,E as g,M as h,G as i,y as j,m as k,z as l,j as m,$ as n,L as o,A as p,K as r,H as s,Q as t,V as u,ee as v,_ as w,g as x,ie as y};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,C as n,D as r,E as i,M as a,N as o,O as s,P as c,S as l,T as u,_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,j as y,k as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,w as j,x as M,y as N}from"./hooks-N7NnMPKd.js";function P(e){let t=A(e);return O(t,`element`,e)}function F(e){let t=A(`text`);return o(t,`value`,e),_({kind:`text`,parent:null,text:e},t)}function I(){let e=A(`div`);return c(e,`display`,`none`),O(e,`comment`)}function L(e,t){o(e.__node_id,`value`,t),e.text=t}function R(e,t){for(let t of e.children.splice(0))N(t.__node_id),S(t),t.parent=null;if(!t)return;let n=F(t);d(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 B(e){e.parent&&r(e.parent.__node_id,e.__node_id),z(e)}function V(e,t,r){if(r===e&&e.parent===t)return;B(e);let i=r?t.children.indexOf(r):-1;n(t.__node_id,e.__node_id,r&&i!==-1?r.__node_id:null),i===-1?t.children.push(e):t.children.splice(i,0,e),e.parent=t}function H(e){z(e),N(e.__node_id),S(e)}function U(e){return e.parent}function W(e){let t=e.parent;if(!t)return null;let n=t.children.indexOf(e);return t.children[n+1]??null}var G=/* @__PURE__ */ e({addEventListener:()=>w,appendChild:()=>d,blur:()=>D,click:()=>m,createCommentNode:()=>I,createElementNode:()=>P,createEventTarget:()=>f,createIncaElement:()=>O,createNode:()=>A,createTextNode:()=>F,destroyNode:()=>N,dispatchEvent:()=>x,focus:()=>k,focusedNode:()=>p,getAttribute:()=>M,holdNode:()=>l,insert:()=>V,insertBefore:()=>n,isDestroyed:()=>T,latestEventId:()=>h,layoutOf:()=>j,nextSibling:()=>W,parentNode:()=>U,releaseNode:()=>u,releaseWhenCollected:()=>v,remove:()=>H,removeAttribute:()=>i,removeChild:()=>r,removeEventListener:()=>g,removeStyle:()=>s,rootElement:()=>C,rootNodeId:()=>b,scrollIntoViewNode:()=>t,scrollNode:()=>y,scrollOf:()=>a,setAttribute:()=>o,setElementText:()=>R,setStyle:()=>c,setText:()=>L,window:()=>E});export{V as a,H as c,F as i,R as l,I as n,W as o,P as r,U as s,G as t,L as u};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,C as n,D as r,E as i,M as a,N as o,O as s,P as c,S as l,T as u,_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,j as y,k as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,w as j,x as M,y as N}from"./hooks-DK2feJxZ.js";function P(e){let t=A(e);return O(t,`element`,e)}function F(e){let t=A(`text`);return o(t,`value`,e),_({kind:`text`,parent:null,text:e},t)}function I(){let e=A(`div`);return c(e,`display`,`none`),O(e,`comment`)}function L(e,t){o(e.__node_id,`value`,t),e.text=t}function R(e,t){for(let t of e.children.splice(0))N(t.__node_id),S(t),t.parent=null;if(!t)return;let n=F(t);d(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 B(e){e.parent&&r(e.parent.__node_id,e.__node_id),z(e)}function V(e,t,r){if(r===e&&e.parent===t)return;B(e);let i=r?t.children.indexOf(r):-1;n(t.__node_id,e.__node_id,r&&i!==-1?r.__node_id:null),i===-1?t.children.push(e):t.children.splice(i,0,e),e.parent=t}function H(e){z(e),N(e.__node_id),S(e)}function U(e){return e.parent}function W(e){let t=e.parent;if(!t)return null;let n=t.children.indexOf(e);return t.children[n+1]??null}var G=/* @__PURE__ */ e({addEventListener:()=>w,appendChild:()=>d,blur:()=>D,click:()=>m,createCommentNode:()=>I,createElementNode:()=>P,createEventTarget:()=>f,createIncaElement:()=>O,createNode:()=>A,createTextNode:()=>F,destroyNode:()=>N,dispatchEvent:()=>x,focus:()=>k,focusedNode:()=>p,getAttribute:()=>M,holdNode:()=>l,insert:()=>V,insertBefore:()=>n,isDestroyed:()=>T,latestEventId:()=>h,layoutOf:()=>j,nextSibling:()=>W,parentNode:()=>U,releaseNode:()=>u,releaseWhenCollected:()=>v,remove:()=>H,removeAttribute:()=>i,removeChild:()=>r,removeEventListener:()=>g,removeStyle:()=>s,rootElement:()=>C,rootNodeId:()=>b,scrollIntoViewNode:()=>t,scrollNode:()=>y,scrollOf:()=>a,setAttribute:()=>o,setElementText:()=>R,setStyle:()=>c,setText:()=>L,window:()=>E});export{V as a,H as c,F as i,R as l,I as n,W as o,P as r,U as s,G as t,L as u};
@@ -1,4 +1,4 @@
1
- import { A as IncaInputElement, C as Overflow, D as EventHandler, E as TagName, M as IncaText, O as EventHandlers, S as NodeId, T as StyleProps, _ 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 IncaNode, k as IncaElement, 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 ScrollAlignment, x as ListenerOptions, y as IncaWheelEvent } from "./window-DD6KfOr9.js";
1
+ import { A as IncaElement, C as Overflow, D as TagName, E as StyleProps, M as IncaNode, N as IncaText, O as EventHandler, S as NodeId, T as ScrollAlignment, _ 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 IncaInputElement, k as EventHandlers, 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 "./window-BtaK1Znc.js";
2
2
  /** What a listener or a dispatch names: a node id, or the tag of `document` or `window`. */
3
3
  type EventTargetId = NodeId | "$document" | "$window";
4
4
  /**
@@ -35,6 +35,8 @@ interface IncaNative {
35
35
  setPointerCapture(nodeId: NodeId, pointerId: number): void;
36
36
  releasePointerCapture(nodeId: NodeId, pointerId: number): void;
37
37
  hasPointerCapture(nodeId: NodeId, pointerId: number): boolean;
38
+ startTimer(delay: number, repeat: boolean): number | undefined;
39
+ stopTimer(id: number): void;
38
40
  }
39
41
  /** What the host calls: it passes the event object as the first argument. */
40
42
  type HostCallback = (...args: unknown[]) => void;
@@ -43,6 +45,7 @@ declare global {
43
45
  var __inca_callbacks__: Record<CallbackId, HostCallback>;
44
46
  var __inca_released__: (nodeIds: NodeId[], callbackIds: CallbackId[]) => void;
45
47
  var __inca_targets__: (targets: EventTargetId[]) => unknown[];
48
+ var __inca_timer__: (id: number) => void;
46
49
  }
47
50
  /**
48
51
  * Builds the listener methods of an event target: a node, document or window.
@@ -256,27 +259,27 @@ declare function scrollIntoViewNode(nodeId: NodeId, block: ScrollAlignment, inli
256
259
  */
257
260
  declare function removeAttribute(nodeId: NodeId, key: string): void;
258
261
  /**
259
- * Sets a style property on `nodeId`. A snake_case key from {@link StyleProps}
260
- * gets compile-time checking on its value's shape. Any other string key, such
261
- * as a camelCase or kebab-case spelling or a property the types do not list,
262
+ * Sets a style property on `nodeId`. A key from {@link StyleProps} gets
263
+ * compile-time checking on its value's shape. Any other string key, such as a
264
+ * camelCase or kebab-case spelling or a property the types do not list,
262
265
  * forwards as a raw {@link AttributeValue}.
263
266
  *
264
- * A key takes any of three spellings: kebab-case (`flex-direction`),
265
- * camelCase (`flexDirection`) or snake_case (`flex_direction`). All three
266
- * name the same property, and the value set most recently applies.
267
+ * A key takes kebab-case (`flex-direction`) or camelCase (`flexDirection`).
268
+ * Both spellings share one slot per property, and the value set most recently
269
+ * applies.
267
270
  * @param nodeId - the node to update
268
- * @param key - the style property name in any of the three spellings
271
+ * @param key - the style property name
269
272
  * @param value - the style property value
270
273
  */
271
274
  declare function setStyle<K extends keyof StyleProps>(nodeId: NodeId, key: K, value: NonNullable<StyleProps[K]>): void;
272
275
  declare function setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
273
276
  /**
274
277
  * Removes a style property from `nodeId`, so it renders as if never set.
275
- * Removing a property that isn't set does nothing. The key takes any of the
276
- * three spellings {@link setStyle} accepts, and removes the property whichever
277
- * spelling set it.
278
+ * Removing a property that isn't set does nothing. The key takes any spelling
279
+ * or CSS name {@link setStyle} accepts, and removes the property whichever
280
+ * one set it.
278
281
  * @param nodeId - the node to update
279
- * @param key - the style property name in any of the three spellings
282
+ * @param key - the style property name
280
283
  */
281
284
  declare function removeStyle(nodeId: NodeId, key: string): void;
282
285
  /**
@@ -375,7 +378,7 @@ declare function parentNode(node: IncaNode): IncaElement | null;
375
378
  */
376
379
  declare function nextSibling(node: IncaNode): IncaNode | null;
377
380
  declare namespace rendererCore_d_exports {
378
- 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, ScrollAlignment, StyleProps, TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, destroyNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isDestroyed, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
381
+ 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, destroyNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isDestroyed, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
379
382
  }
380
383
  /**
381
384
  * What a custom renderer (`incajs/vue`) drives the host through: the tree and
@@ -1,3 +1,9 @@
1
+ declare global {
2
+ function setTimeout<A extends unknown[]>(handler: (...args: A) => void, delay?: number, ...args: A): number;
3
+ function setInterval<A extends unknown[]>(handler: (...args: A) => void, delay?: number, ...args: A): number;
4
+ function clearTimeout(id?: number): void;
5
+ function clearInterval(id?: number): void;
6
+ }
1
7
  /** The events whose handler property every element has. */
2
8
  declare const HANDLER_EVENTS: readonly ["auxclick", "beforeinput", "blur", "change", "click", "contextmenu", "dblclick", "focus", "gotpointercapture", "input", "keydown", "keyup", "lostpointercapture", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointerenter", "pointerleave", "pointermove", "pointerout", "pointerover", "pointerup", "scroll", "wheel"];
3
9
  /** The plain values of a {@link RectLike}, as `toJSON` returns them. */
@@ -221,88 +227,94 @@ type ScrollAlignment = "start" | "center" | "end" | "nearest";
221
227
  /** One overflow value; `"auto"` is an alias of `"scroll"`. */
222
228
  type Overflow = "visible" | "hidden" | "clip" | "scroll" | "auto";
223
229
  /**
224
- * Style properties, in their snake_case spelling, that `setStyle`'s typed
225
- * overload checks. A deliberately incomplete, v1 layout/paint vocabulary. The
226
- * renderer also reads the camelCase and kebab-case spellings. An unrecognized
227
- * key or a value shape that doesn't parse (e.g. a malformed enum string) is
228
- * ignored by the renderer, and the host prints a warning line on stderr for
229
- * it (an empty string `''` prints none).
230
+ * A size in px: a number, `"0"` or a string such as `"10px"`. A string that reads as zero
231
+ * (`"0.0"`, `"-0"`) is also valid, and the unit is case-insensitive. The host warns on a space
232
+ * before `px`, a trailing `.` and hexadecimal, binary and octal, which the type admits.
233
+ */
234
+ type Px = number | "0" | `${number}px`;
235
+ /**
236
+ * Style properties that `setStyle`'s typed overload checks. A deliberately
237
+ * incomplete, v1 layout/paint vocabulary, written with the CSS property names.
238
+ * An unrecognized key or a value shape that doesn't parse (e.g. a malformed
239
+ * enum string) is ignored by the renderer, and the host prints a warning line
240
+ * on stderr for it (an empty string `''` prints none).
230
241
  */
231
242
  interface StyleProps {
232
243
  /** Layout mode for this node's children. `"none"` skips both layout and rendering for the whole subtree. */
233
244
  display?: "flex" | "block" | "grid" | "none";
234
245
  /** Main-axis direction for a `"flex"` container. */
235
- flex_direction?: "row" | "column" | "row_reverse" | "column_reverse";
246
+ flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
236
247
  /** Main-axis alignment of children within this container. */
237
- justify_content?: "start" | "end" | "center" | "stretch";
248
+ justifyContent?: "start" | "end" | "flex-start" | "flex-end" | "center" | "stretch";
238
249
  /** Cross-axis alignment of children within this container. */
239
- align_items?: "start" | "end" | "center" | "stretch";
250
+ alignItems?: "start" | "end" | "flex-start" | "flex-end" | "center" | "stretch";
240
251
  /** Uniform spacing, in px (`>= 0`), between children, applied on both axes. */
241
- gap?: number;
252
+ gap?: Px;
242
253
  /** Fixed width in px (`>= 0`), or `"auto"` to size to content. */
243
- width?: number | "auto";
254
+ width?: Px | "auto";
244
255
  /** Fixed height in px (`>= 0`), or `"auto"` to size to content. */
245
- height?: number | "auto";
256
+ height?: Px | "auto";
246
257
  /** Uniform border width in px (`>= 0`), applied to all four sides. */
247
- border_width?: number;
258
+ borderWidth?: Px;
248
259
  /** Fill color, as a hex number (`0xRRGGBB`) or a CSS-style string (`"#rrggbb"`/`"#rgb"`). */
249
- background?: number | string;
250
- /** Border color. Accepts the same formats as {@link StyleProps.background}. */
251
- border_color?: number | string;
252
- /** Color for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_size}; there's no separate per-leaf text styling. */
253
- text_color?: number | string;
260
+ backgroundColor?: number | string;
261
+ /** Border color. Accepts the same formats as {@link StyleProps.backgroundColor}. */
262
+ borderColor?: number | string;
263
+ /** Color for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.fontSize}; there's no separate per-leaf text styling. */
264
+ color?: number | string;
254
265
  /** Uniform corner radius in px (`>= 0`), applied to all four corners. */
255
- corner_radius?: number;
256
- /** Font size in px (`>= 0`) for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_color}. */
257
- text_size?: number;
258
- /** Overflow on both axes, or `"<x> <y>"` per axis; `"scroll"` (alias `"auto"`) makes the container scroll with the wheel. Overridden per axis by {@link StyleProps.overflow_x}/{@link StyleProps.overflow_y}. */
266
+ borderRadius?: Px;
267
+ /** Font size in px (`>= 0`) for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.color}. */
268
+ fontSize?: Px;
269
+ /** Overflow on both axes, or `"<x> <y>"` per axis; `"scroll"` (alias `"auto"`) makes the container scroll with the wheel. Overridden per axis by {@link StyleProps.overflowX}/{@link StyleProps.overflowY}. */
259
270
  overflow?: Overflow | `${Overflow} ${Overflow}`;
260
271
  /** Horizontal overflow; wins over {@link StyleProps.overflow}. */
261
- overflow_x?: Overflow;
272
+ overflowX?: Overflow;
262
273
  /** Vertical overflow; wins over {@link StyleProps.overflow}. */
263
- overflow_y?: Overflow;
264
- /** Inner spacing in px (`>= 0`) on all four sides. Overridden per axis by {@link StyleProps.padding_x}/{@link StyleProps.padding_y} and per side by the `padding_*` side keys. */
265
- padding?: number;
266
- /** Horizontal inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
267
- padding_x?: number;
268
- /** Vertical inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
269
- padding_y?: number;
270
- /** Top inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_y}. */
271
- padding_top?: number;
272
- /** Right inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_x}. */
273
- padding_right?: number;
274
- /** Bottom inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_y}. */
275
- padding_bottom?: number;
276
- /** Left inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_x}. */
277
- padding_left?: number;
278
- /** Outer spacing in px (negative allowed) or `"auto"` on all four sides. Overridden per axis by {@link StyleProps.margin_x}/{@link StyleProps.margin_y} and per side by the `margin_*` side keys. */
279
- margin?: number | "auto";
280
- /** Horizontal outer spacing; wins over {@link StyleProps.margin}. */
281
- margin_x?: number | "auto";
282
- /** Vertical outer spacing; wins over {@link StyleProps.margin}. */
283
- margin_y?: number | "auto";
284
- /** Top outer spacing; wins over {@link StyleProps.margin_y}. */
285
- margin_top?: number | "auto";
286
- /** Right outer spacing; wins over {@link StyleProps.margin_x}. */
287
- margin_right?: number | "auto";
288
- /** Bottom outer spacing; wins over {@link StyleProps.margin_y}. */
289
- margin_bottom?: number | "auto";
290
- /** Left outer spacing; wins over {@link StyleProps.margin_x}. */
291
- margin_left?: number | "auto";
292
- /** Share (`>= 0`) of the free space in the parent's main axis this node takes. */
293
- flex_grow?: number;
294
- /** Share (`>= 0`) of the overflow in the parent's main axis this node gives up. */
295
- flex_shrink?: number;
296
- /** Opacity from `0` to `1`, applied to this node and its descendants; values outside are clamped. */
297
- opacity?: number;
274
+ overflowY?: Overflow;
275
+ /** Inner spacing in px (`>= 0`) on all four sides. Overridden per side by the `padding*` side keys. */
276
+ padding?: Px;
277
+ /** Top inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
278
+ paddingTop?: Px;
279
+ /** Right inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
280
+ paddingRight?: Px;
281
+ /** Bottom inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
282
+ paddingBottom?: Px;
283
+ /** Left inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
284
+ paddingLeft?: Px;
285
+ /** Outer spacing in px (negative allowed) or `"auto"` on all four sides. Overridden per side by the `margin*` side keys. */
286
+ margin?: Px | "auto";
287
+ /** Top outer spacing; wins over {@link StyleProps.margin}. */
288
+ marginTop?: Px | "auto";
289
+ /** Right outer spacing; wins over {@link StyleProps.margin}. */
290
+ marginRight?: Px | "auto";
291
+ /** Bottom outer spacing; wins over {@link StyleProps.margin}. */
292
+ marginBottom?: Px | "auto";
293
+ /** Left outer spacing; wins over {@link StyleProps.margin}. */
294
+ marginLeft?: Px | "auto";
295
+ /**
296
+ * Share (`>= 0`) of the free space in the parent's main axis this node takes.
297
+ * The host warns on a trailing `.`, hexadecimal, binary and octal, which the type admits.
298
+ */
299
+ flexGrow?: number | `${number}`;
300
+ /**
301
+ * Share (`>= 0`) of the overflow in the parent's main axis this node gives up.
302
+ * The host warns on a trailing `.`, hexadecimal, binary and octal, which the type admits.
303
+ */
304
+ flexShrink?: number | `${number}`;
305
+ /**
306
+ * Opacity from `0` to `1`, applied to this node and its descendants; values outside are clamped.
307
+ * The host warns on a trailing `.`, hexadecimal, binary and octal, which the type admits.
308
+ */
309
+ opacity?: number | `${number}`;
298
310
  /** Minimum width in px (`>= 0`), or `"auto"` for the default minimum. */
299
- min_width?: number | "auto";
311
+ minWidth?: Px | "auto";
300
312
  /** Minimum height in px (`>= 0`), or `"auto"` for the default minimum. */
301
- min_height?: number | "auto";
313
+ minHeight?: Px | "auto";
302
314
  /** Maximum width in px (`>= 0`), or `"auto"` for no limit. */
303
- max_width?: number | "auto";
315
+ maxWidth?: Px | "auto";
304
316
  /** Maximum height in px (`>= 0`), or `"auto"` for no limit. */
305
- max_height?: number | "auto";
317
+ maxHeight?: Px | "auto";
306
318
  }
307
319
  /**
308
320
  * An event built in this runtime with `Event`, `CustomEvent` or another
@@ -688,4 +700,4 @@ type EventListenerOrObject<E = IncaEvent, T = IncaEventTarget> = EventListener<E
688
700
  * `dispatchEvent`, and the event handler properties such as `onkeydown`.
689
701
  */
690
702
  declare const window: IncaWindow;
691
- export { IncaInputElement as A, Overflow as C, EventHandler as D, TagName as E, RectLike as F, RectValues as I, IncaText as M, ScrollIntoViewOptions as N, EventHandlers as O, ScrollOptions as P, NodeId as S, StyleProps as T, 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, IncaNode as j, IncaElement 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, ScrollAlignment as w, ListenerOptions as x, IncaWheelEvent as y };
703
+ export { IncaElement as A, Overflow as C, TagName as D, StyleProps as E, ScrollOptions as F, RectLike as I, RectValues as L, IncaNode as M, IncaText as N, EventHandler as O, ScrollIntoViewOptions as P, NodeId as S, ScrollAlignment as T, 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, IncaInputElement as j, EventHandlers 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 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as IncaInputElement, E as TagName, F as RectLike, I as RectValues, N as ScrollIntoViewOptions, P as ScrollOptions, S as NodeId, T as StyleProps, _ 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 IncaNode, k as IncaElement, 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, x as ListenerOptions, y as IncaWheelEvent } from "./chunks/window-DD6KfOr9.js";
1
+ import { A as IncaElement, D as TagName, E as StyleProps, F as ScrollOptions, I as RectLike, L as RectValues, M as IncaNode, P as ScrollIntoViewOptions, S as NodeId, _ 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 IncaInputElement, 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-BtaK1Znc.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 IncaInputElement, E as TagName, F as RectLike, I as RectValues, N
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 RectLike, type RectValues, type ScrollIntoViewOptions, type ScrollOptions, type StyleProps, type TagName, window };
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 };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{i as document,r as window}from"./chunks/hooks-N7NnMPKd.js";
1
+ export{i as document,r as window}from"./chunks/hooks-DK2feJxZ.js";
@@ -1,3 +1,3 @@
1
- import { A as IncaInputElement, C as Overflow, D as EventHandler, E as TagName, M as IncaText, O as EventHandlers, S as NodeId, T as StyleProps, _ 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 IncaNode, k as IncaElement, 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 ScrollAlignment, x as ListenerOptions, y as IncaWheelEvent } from "./chunks/window-DD6KfOr9.js";
2
- import { A as setAttribute, C as removeAttribute, D as scrollIntoViewNode, E as rootNodeId, F as dispatchEvent, I as focus, L as latestEventId, M as addEventListener, N as blur, O as scrollNode, P as click, R as removeEventListener, S as releaseNode, T as removeStyle, _ as focusedNode, a as insert, b as insertBefore, c as remove, d as isDestroyed, f as createIncaElement, g as destroyNode, h as createNode, i as createTextNode, j as setStyle, k as scrollOf, l as setElementText, m as appendChild, n as createCommentNode, o as nextSibling, p as rootElement, r as createElementNode, s as parentNode, t as IncaCore, u as setText, v as getAttribute, w as removeChild, x as layoutOf, y as holdNode, z as createEventTarget } from "./chunks/rendererCore-B3-0H_IR.js";
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 ScrollAlignment, type StyleProps, type TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, destroyNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isDestroyed, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
1
+ import { A as IncaElement, C as Overflow, D as TagName, E as StyleProps, M as IncaNode, N as IncaText, O as EventHandler, S as NodeId, T as ScrollAlignment, _ 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 IncaInputElement, k as EventHandlers, 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-BtaK1Znc.js";
2
+ import { A as setAttribute, C as removeAttribute, D as scrollIntoViewNode, E as rootNodeId, F as dispatchEvent, I as focus, L as latestEventId, M as addEventListener, N as blur, O as scrollNode, P as click, R as removeEventListener, S as releaseNode, T as removeStyle, _ as focusedNode, a as insert, b as insertBefore, c as remove, d as isDestroyed, f as createIncaElement, g as destroyNode, h as createNode, i as createTextNode, j as setStyle, k as scrollOf, l as setElementText, m as appendChild, n as createCommentNode, o as nextSibling, p as rootElement, r as createElementNode, s as parentNode, t as IncaCore, u as setText, v as getAttribute, w as removeChild, x as layoutOf, y as holdNode, z as createEventTarget } from "./chunks/rendererCore-qq38UzW-.js";
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, destroyNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isDestroyed, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
@@ -1 +1 @@
1
- import{A as e,C as t,D as n,E as r,M as i,N as a,O as o,P as s,S as c,T as l,_ as u,a as d,b as f,c as p,d as m,f as h,h as g,j as _,k as v,l as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E,v as D,w as O,x as k,y as A}from"./chunks/hooks-N7NnMPKd.js";import{a as j,c as M,i as N,l as P,n as F,o as I,r as L,s as R,u as z}from"./chunks/rendererCore-b4ytjgR8.js";export{x as addEventListener,u as appendChild,w as blur,p as click,F as createCommentNode,L as createElementNode,d as createEventTarget,T as createIncaElement,D as createNode,N as createTextNode,A as destroyNode,y as dispatchEvent,E as focus,f as focusedNode,k as getAttribute,c as holdNode,j as insert,t as insertBefore,S as isDestroyed,m as latestEventId,O as layoutOf,I as nextSibling,R as parentNode,l as releaseNode,g as releaseWhenCollected,M as remove,r as removeAttribute,n as removeChild,h as removeEventListener,o as removeStyle,b as rootElement,v as rootNodeId,e as scrollIntoViewNode,_ as scrollNode,i as scrollOf,a as setAttribute,P as setElementText,s as setStyle,z as setText,C as window};
1
+ import{A as e,C as t,D as n,E as r,M as i,N as a,O as o,P as s,S as c,T as l,_ as u,a as d,b as f,c as p,d as m,f as h,h as g,j as _,k as v,l as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E,v as D,w as O,x as k,y as A}from"./chunks/hooks-DK2feJxZ.js";import{a as j,c as M,i as N,l as P,n as F,o as I,r as L,s as R,u as z}from"./chunks/rendererCore-Ezb4FOC9.js";export{x as addEventListener,u as appendChild,w as blur,p as click,F as createCommentNode,L as createElementNode,d as createEventTarget,T as createIncaElement,D as createNode,N as createTextNode,A as destroyNode,y as dispatchEvent,E as focus,f as focusedNode,k as getAttribute,c as holdNode,j as insert,t as insertBefore,S as isDestroyed,m as latestEventId,O as layoutOf,I as nextSibling,R as parentNode,l as releaseNode,g as releaseWhenCollected,M as remove,r as removeAttribute,n as removeChild,h as removeEventListener,o as removeStyle,b as rootElement,v as rootNodeId,e as scrollIntoViewNode,_ as scrollNode,i as scrollOf,a as setAttribute,P as setElementText,s as setStyle,z as setText,C as window};
package/dist/vue.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { k as IncaElement } from "./chunks/window-DD6KfOr9.js";
2
- import "./chunks/rendererCore-B3-0H_IR.js";
1
+ import { A as IncaElement } from "./chunks/window-BtaK1Znc.js";
2
+ import "./chunks/rendererCore-qq38UzW-.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{n as e}from"./chunks/hooks-N7NnMPKd.js";import{t}from"./chunks/rendererCore-b4ytjgR8.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()),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?
1
+ import{n as e}from"./chunks/hooks-DK2feJxZ.js";import{t}from"./chunks/rendererCore-Ezb4FOC9.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()),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.isDestroyed(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)&&!i&&i!==``?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.23",
3
+ "version": "0.0.24",
4
4
  "description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
5
5
  "keywords": [
6
6
  "cross-platform",
@@ -34,6 +34,7 @@
34
34
  "src/callbacks.mts",
35
35
  "src/targets.mts",
36
36
  "src/interfaces.mts",
37
+ "src/timers.mts",
37
38
  "dist/chunks/hooks-*.js"
38
39
  ],
39
40
  "main": "./dist/index.js",
@@ -69,5 +70,15 @@
69
70
  },
70
71
  "engines": {
71
72
  "node": ">=22.18"
73
+ },
74
+ "incajs": {
75
+ "frontends": {
76
+ "vue": {
77
+ "peers": [
78
+ "@vue/runtime-core",
79
+ "@vue/runtime-dom"
80
+ ]
81
+ }
82
+ }
72
83
  }
73
84
  }
@@ -1 +0,0 @@
1
- const e=/* @__PURE__ */ `auxclick.beforeinput.blur.change.click.contextmenu.dblclick.focus.gotpointercapture.input.keydown.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 Map,i=/* @__PURE__ */ new Map,a=()=>globalThis.__inca_callbacks__??={};function o(e,t,n,o){a()[n]=o;let s=r.get(e);s||r.set(e,s=/* @__PURE__ */ new Map),s.set(t,n),i.set(n,{group:e,listener:t})}function s(e,t){return r.get(e)?.get(t)}function c(e){delete a()[e];let t=i.get(e);if(t===void 0)return;i.delete(e);let n=r.get(t.group);n?.delete(t.listener),n?.size===0&&r.delete(t.group)}function l(e){for(let t of e)c(t)}const u=(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{l([e])}catch(e){r||(n=e),r=!0}if(ce(e),r)throw n},configurable:!0});function d(){return n().rootNodeId()}function ee(e){return n().createNode(e)}function te(e,t){n().appendChild(e,t)}function f(e,t,r){n().insertBefore(e,t,r)}function ne(e,t){n().removeChild(e,t)}function re(e){l(n().destroyNode(e))}function ie(e){n().holdNode(e)}function p(e){n().releaseNode(e)}function m(e,t,r){n().setAttribute(e,t,r)}function h(e,t){return n().getAttribute(e,t)}function g(e){return n().layoutOf(e)}function _(e){return n().scrollOf(e)}function v(e,t,r){n().scrollNode(e,t,r)}function y(e,t,r){n().scrollIntoViewNode(e,t,r)}function b(e,t){n().removeAttribute(e,t)}function x(e,t,r){n().setStyle(e,t,r)}function ae(e,t){n().removeStyle(e,t)}function S(e){return n().inputValue(e)}function C(e,t){n().setInputValue(e,t)}function w(){return n().focusedNode()}const T=/* @__PURE__ */ new WeakSet;function E(e,t){return T.add(e),Object.defineProperty(e,"__node_id",{value:t})}function D(e){return typeof e==`object`&&!!e&&T.has(e)}const O=/* @__PURE__ */ new Map,k=new FinalizationRegistry(e=>{O.get(e)?.deref()||O.delete(e)});function oe(e){O.set(e.__node_id,new WeakRef(e)),k.register(e,e.__node_id)}function se(e){O.delete(e)}function A(e){return O.get(e)?.deref()}const j=/* @__PURE__ */ new WeakSet;function M(e){return j.has(e)}function N(e){if(j.add(e),e.kind!==`text`){se(e.__node_id);for(let t of e.children)N(t)}}function ce(e){for(let t of e){let e=A(t);e&&N(e)}}const le=new FinalizationRegistry(e=>n().releaseNode(e));function ue(e){le.register(e,e.__node_id)}function P(){let e=w();return e===null?null:A(e)??null}let F=0;function I(){return F}function L(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>F&&(F=n),e(...t)}}function R(e,t,r,i={}){if(r==null)return;let a=u(e,t,i.capture);if(s(a,r)!==void 0)return;let c=(...e)=>typeof r==`function`?r.apply(e[0]?.currentTarget,e):r.handleEvent.apply(r,e),l=i.once?(...n)=>(z(e,t,r,i),c(...n)):c;o(a,r,n().addEventListener(e,t,i.capture===!0,i.passive===!0),L(l))}function z(e,t,r,i={}){if(r==null)return;let a=s(u(e,t,i.capture),r);a!==void 0&&(n().removeEventListener(e,t,a),c(a))}function B(e,t){return n().dispatchEvent(e,t)}function V(e){n().click(e)}function H(e,t){n().focusNode(e,t)}function U(e){n().blurNode(e)}function de(e,t){n().setPointerCapture(e,t)}function fe(e,t){n().releasePointerCapture(e,t)}function pe(e,t){return n().hasPointerCapture(e,t)}function W(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};R(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;z(n(),e,t,{capture:i})},dispatchEvent:e=>B(n(),e)}}function G(){throw TypeError(`document cannot be constructed. use the document export of incajs`)}function me(){throw TypeError(`a shadow root cannot be constructed. the host has no shadow roots`)}Object.defineProperty(globalThis,"Document",{value:G,writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(globalThis,"ShadowRoot",{value:me,writable:!0,configurable:!0,enumerable:!1});const K=/* @__PURE__ */ Object.defineProperties(Object.setPrototypeOf(t(W(`$document`,[`wheel`]),()=>!1),G.prototype),{[Symbol.toStringTag]:{value:`Document`},activeElement:{get:P}}),q=/* @__PURE__ */ Object.defineProperty(t(W(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`});function J(e){return M(e)?null:g(e.__node_id)}function Y(e){let t=e.parent;return!J(e)||!t||!J(t)?null:t}function X(e){let t=J(e);if(!t)return{left:0,top:0};let n=Y(e),r=n?J(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 he(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 ge(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 Z(e,t,n){if(M(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?_(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)};v(e.__node_id,l(a,s),l(o,c))}function _e(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 Q(e,n,r,i=[]){let a=W(()=>e,i),o=()=>M(c)?null:_(e),s={get id(){return M(c)?``:String(h(e,`id`)??``)},set id(t){M(c)||m(e,`id`,String(t))},kind:n,parent:null,children:[],focus:t=>{M(c)||H(e,!!t?.preventScroll)},blur:()=>U(e),click:()=>{M(c)||V(e)},setPointerCapture:t=>de(e,t),releasePointerCapture:t=>fe(e,t),hasPointerCapture:t=>pe(e,t),contains:e=>{if(e==null)return!1;if(!D(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===c)return!0;return!1},addEventListener:(...e)=>{M(c)||a.addEventListener(...e)},removeEventListener:(...e)=>{M(c)||a.removeEventListener(...e)},dispatchEvent:e=>M(c)||a.dispatchEvent(e),get tabIndex(){return ge(M(c)?null:h(e,`tabindex`),r??``)},set tabIndex(t){M(c)||m(e,`tabindex`,t|0)},getBoundingClientRect:()=>he(J(c)),get offsetWidth(){return Math.round(J(c)?.[2]??0)},get offsetHeight(){return Math.round(J(c)?.[3]??0)},get offsetLeft(){return X(c).left},get offsetTop(){return X(c).top},get offsetParent(){return Y(c)},get clientWidth(){let e=J(c);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=J(c);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(J(c)?.[4]??0)},get clientTop(){return Math.round(J(c)?.[4]??0)},get scrollLeft(){return o()?.[0]??0},set scrollLeft(e){Z(c,[e],!1)},get scrollTop(){return o()?.[1]??0},set scrollTop(e){Z(c,[void 0,e],!1)},get scrollWidth(){return c.clientWidth+Math.round(o()?.[2]??0)},get scrollHeight(){return c.clientHeight+Math.round(o()?.[3]??0)},scrollTo:(...e)=>Z(c,e,!1),scrollBy:(...e)=>Z(c,e,!0),scrollIntoView:t=>{if(M(c))return;let{block:n,inline:r}=_e(t);y(e,n,r)},getRootNode:()=>{let e=c;for(;e.parent!==null;)e=e.parent;return e.__node_id===d()?K:e}};r===`input`&&Object.defineProperty(s,"value",{get:()=>M(c)?``:S(e),set:t=>{M(c)||C(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let c=t(E(s,e),()=>M(c));return n===`element`&&oe(c),c}function $(){let e=d();return A(e)??Q(e,`element`,void 0,[`wheel`])}Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>e===`$document`?K:e===`$window`?q:A(e)??(e===d()?$():null)),configurable:!0});export{y as A,f as C,ne as D,b as E,_ as M,m as N,ae as O,x as P,ie as S,p as T,te as _,W as a,w as b,V as c,I as d,z as f,E as g,ue as h,K as i,v as j,d as k,B as l,N as m,$ as n,R as o,M as p,q as r,U as s,Q as t,H as u,ee as v,g as w,h as x,re as y};