incajs 0.0.22 → 0.0.23

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.
Files changed (38) hide show
  1. package/dist/chunks/hooks-N7NnMPKd.js +1 -0
  2. package/dist/chunks/rendererCore-B3-0H_IR.d.ts +385 -0
  3. package/dist/chunks/rendererCore-b4ytjgR8.js +1 -0
  4. package/dist/chunks/rolldown-runtime-DK3Fl9T5.js +1 -0
  5. package/dist/chunks/window-DD6KfOr9.d.ts +691 -0
  6. package/dist/index.d.ts +12 -0
  7. package/dist/index.js +1 -1
  8. package/dist/rendererCore.d.ts +3 -0
  9. package/dist/rendererCore.js +1 -3
  10. package/dist/vue-runtime.d.ts +3 -0
  11. package/dist/vue-runtime.js +1 -2
  12. package/dist/{vue/createApp.d.mts → vue.d.ts} +6 -4
  13. package/dist/vue.js +2 -178
  14. package/package.json +6 -18
  15. package/dist/callbacks.d.mts +0 -31
  16. package/dist/chunks/hooks-TbLjfN0c.js +0 -417
  17. package/dist/chunks/rendererCore-BUNTDvYu.js +0 -110
  18. package/dist/document.d.mts +0 -11
  19. package/dist/element/eventHandlers.d.mts +0 -12
  20. package/dist/element/geometry.d.mts +0 -61
  21. package/dist/element/handle.d.mts +0 -29
  22. package/dist/element/lifecycle.d.mts +0 -51
  23. package/dist/element/scroll.d.mts +0 -42
  24. package/dist/element/shadowTree.d.mts +0 -64
  25. package/dist/element/types.d.mts +0 -149
  26. package/dist/eventTarget.d.mts +0 -11
  27. package/dist/events.d.mts +0 -105
  28. package/dist/index.d.mts +0 -6
  29. package/dist/native.d.mts +0 -46
  30. package/dist/rendererCore.d.mts +0 -14
  31. package/dist/targets.d.mts +0 -1
  32. package/dist/tree.d.mts +0 -157
  33. package/dist/types.d.mts +0 -454
  34. package/dist/vue/index.d.mts +0 -2
  35. package/dist/vue/nodeOps.d.mts +0 -29
  36. package/dist/vue/patchProp.d.mts +0 -79
  37. package/dist/vue/runtime.d.mts +0 -2
  38. package/dist/window.d.mts +0 -13
@@ -0,0 +1,12 @@
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";
2
+ /**
3
+ * The event target between the elements and `window`. An event at an element
4
+ * passes through it, and it is the next target after the mount container.
5
+ *
6
+ * It has the listener methods `addEventListener`, `removeEventListener` and
7
+ * `dispatchEvent`, the event handler properties such as `onkeydown`, and
8
+ * `activeElement`. A `wheel` listener is passive unless its options say
9
+ * `passive: false`. It is an instance of the global `Document`.
10
+ */
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 };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { n as document, t as window } from "./chunks/hooks-TbLjfN0c.js";
1
+ export{i as document,r as window}from"./chunks/hooks-N7NnMPKd.js";
@@ -0,0 +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,3 +1 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, u as c } from "./chunks/rendererCore-BUNTDvYu.js";
2
- import { A as l, C as u, D as d, E as f, N as p, O as m, S as h, T as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, o as A, p as j, r as M, s as N, t as P, u as F, v as I, w as L, x as R, y as z } from "./chunks/hooks-TbLjfN0c.js";
3
- export { L as addEventListener, v as appendChild, g as blur, f as click, i as createCommentNode, o as createElementNode, u as createEventTarget, M as createIncaElement, A as createNode, n as createTextNode, N as destroyNode, d as dispatchEvent, m as focus, b as focusedNode, O as getAttribute, F as holdNode, e as insert, x as insertBefore, E as isDestroyed, D as latestEventId, S as layoutOf, a as nextSibling, s as parentNode, j as releaseNode, p as releaseWhenCollected, t as remove, k as removeAttribute, w as removeChild, l as removeEventListener, C as removeStyle, T as rootElement, _ as rootNodeId, I as scrollIntoViewNode, z as scrollNode, y as scrollOf, R as setAttribute, r as setElementText, h as setStyle, c as setText, P 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-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};
@@ -0,0 +1,3 @@
1
+ import { vModelText, withKeys, withModifiers } from "@vue/runtime-dom";
2
+ export * from "@vue/runtime-core";
3
+ export { vModelText, withKeys, withModifiers };
@@ -1,2 +1 @@
1
- export { withKeys, withModifiers } from "@vue/runtime-dom";
2
- export * from "@vue/runtime-core";
1
+ export{vModelText,withKeys,withModifiers}from"@vue/runtime-dom";export*from"@vue/runtime-core";
@@ -1,12 +1,13 @@
1
- import { App, Component, ComponentPublicInstance } from '@vue/runtime-core';
2
- import { IncaElement } from '../rendererCore.mts';
1
+ import { k as IncaElement } from "./chunks/window-DD6KfOr9.js";
2
+ import "./chunks/rendererCore-B3-0H_IR.js";
3
+ import { App, Component, ComponentPublicInstance } from "@vue/runtime-core";
3
4
  /**
4
5
  * `@vue/runtime-core`'s `App`, with `mount` also callable with no argument
5
6
  * to target the host's own root container. `use`, `mixin`, `component` and
6
7
  * `directive` return an `IncaApp`.
7
8
  */
8
- export type IncaApp = App<IncaElement> & {
9
- mount: (rootContainer?: IncaElement) => ComponentPublicInstance;
9
+ type IncaApp = App<IncaElement> & {
10
+ mount: (rootContainer?: IncaElement) => ComponentPublicInstance;
10
11
  };
11
12
  /**
12
13
  * Creates a Vue app whose root mounts on an {@link IncaElement} host
@@ -18,3 +19,4 @@ export type IncaApp = App<IncaElement> & {
18
19
  * @returns the created app
19
20
  */
20
21
  export declare function createIncaApp(rootComponent: Component, rootProps?: Record<string, unknown> | null): IncaApp;
22
+ export type { IncaApp };
package/dist/vue.js CHANGED
@@ -1,178 +1,2 @@
1
- import { t as e } from "./chunks/rendererCore-BUNTDvYu.js";
2
- import { i as t } from "./chunks/hooks-TbLjfN0c.js";
3
- import { ErrorCodes as n, callWithAsyncErrorHandling as r, createRenderer as i, warn as a } from "@vue/runtime-core";
4
- //#region src/vue/nodeOps.mts
5
- function o(e) {
6
- return Object.defineProperty(e, "__v_skip", { value: !0 }), e;
7
- }
8
- function s(e) {
9
- return {
10
- createElement: (t) => o(e.createElementNode(t)),
11
- createText: (t) => o(e.createTextNode(t)),
12
- createComment: (t) => o(e.createCommentNode()),
13
- setText: (t, n) => e.setText(t, n),
14
- setElementText: (t, n) => e.setElementText(t, n),
15
- insert: (t, n, r) => e.insert(t, n, r),
16
- remove: (t) => e.remove(t),
17
- parentNode: e.parentNode,
18
- nextSibling: e.nextSibling
19
- };
20
- }
21
- function c(e, t) {
22
- let n = (t) => (e.holdNode(t.__node_id), e.releaseWhenCollected(t), t), { createElement: r, createText: i } = t;
23
- return {
24
- createElement: (e) => n(r(e)),
25
- createText: (e) => n(i(e))
26
- };
27
- }
28
- //#endregion
29
- //#region src/vue/patchProp.mts
30
- var 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();
31
- function m(e) {
32
- let t = e, n = {
33
- event: "",
34
- once: !1,
35
- capture: !1,
36
- passive: !1
37
- }, r;
38
- 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;
39
- return n.event = t[2] === ":" ? t.slice(3) : p(t.slice(2)), n;
40
- }
41
- var h = (e) => typeof e == "string" || typeof e == "number", g = /* @__PURE__ */ new WeakMap();
42
- function _(e, t, n) {
43
- let r = typeof n == "object" && n ? n : {}, i = g.get(t);
44
- i || g.set(t, i = /* @__PURE__ */ new Map());
45
- let a = !1;
46
- for (let n of i.keys()) h(r[n]) || (e.removeStyle(t.__node_id, n), i.delete(n), a = !0);
47
- 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));
48
- }
49
- function v(e, t) {
50
- 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?
51
- Expected function or array of functions, received type ${typeof e}.`), []) : null;
52
- }
53
- function y(e, t) {
54
- let n = e[0];
55
- if (typeof n != "object" || !n) return t(() => !1);
56
- let r = n.stopImmediatePropagation;
57
- if (typeof r != "function") return t(() => !1);
58
- let i = Object.hasOwn(n, "stopImmediatePropagation"), a = !1;
59
- try {
60
- n.stopImmediatePropagation = (...e) => (a = !0, r.apply(n, e));
61
- } catch {
62
- return t(() => !1);
63
- }
64
- try {
65
- t(() => a);
66
- } finally {
67
- i ? n.stopImmediatePropagation = r : delete n.stopImmediatePropagation;
68
- }
69
- }
70
- var b = /* @__PURE__ */ new WeakMap(), x = ({ event: e, capture: t, passive: n }) => `${e}:${t === !0}:${n === !0}`;
71
- function S(e, t, n, r) {
72
- let i = Array.from(r.slots.values()).some((e) => !e.fired);
73
- 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);
74
- }
75
- function C(e, t, i, { event: a, capture: o, passive: s }) {
76
- let c = {
77
- event: a,
78
- options: {
79
- capture: o,
80
- passive: s
81
- },
82
- slots: /* @__PURE__ */ new Map(),
83
- registered: !1,
84
- dispatcher: (...a) => {
85
- let o = [], s = a[0]?.eventId;
86
- y(a, (l) => {
87
- for (let u of Array.from(c.slots.keys())) {
88
- if (l()) break;
89
- let d = c.slots.get(u);
90
- if (d && !d.fired && !(typeof s == "number" && d.attachedAt >= s)) {
91
- d.once && (d.fired = !0, S(e, t, i, c));
92
- for (let e of d.handlers) {
93
- if (l()) break;
94
- if (e) try {
95
- r(e, d.instance, n.NATIVE_EVENT_HANDLER, a);
96
- } catch (e) {
97
- o.push(e);
98
- }
99
- }
100
- }
101
- }
102
- });
103
- for (let e of o.slice(1)) Promise.reject(e);
104
- if (o.length > 0) throw o[0];
105
- }
106
- };
107
- return c;
108
- }
109
- function w(e, t, n, r) {
110
- let i = x(n), a = b.get(t)?.get(i);
111
- a?.slots.delete(r) && S(e, t, i, a);
112
- }
113
- function T(e, t, n, r, i) {
114
- let a = m(n), o = v(r, n);
115
- if (!o) {
116
- w(e, t, a, n);
117
- return;
118
- }
119
- let s = x(a), c = b.get(t);
120
- c || b.set(t, c = /* @__PURE__ */ new Map());
121
- let l = c.get(s);
122
- l || c.set(s, l = C(e, t, s, a));
123
- let u = l.slots.get(n);
124
- if (u) u.handlers = o, u.instance = i;
125
- else {
126
- l.slots.set(n, {
127
- attachedAt: e.latestEventId(),
128
- handlers: o,
129
- instance: i,
130
- once: a.once,
131
- fired: !1
132
- });
133
- try {
134
- S(e, t, s, l);
135
- } catch (e) {
136
- throw l.slots.delete(n), l.slots.size === 0 && c.delete(s), e;
137
- }
138
- }
139
- }
140
- var E = /* @__PURE__ */ new Set([
141
- "disabled",
142
- "hidden",
143
- "inert",
144
- "allowfullscreen",
145
- "formnovalidate",
146
- "ismap",
147
- "itemscope",
148
- "nomodule",
149
- "novalidate",
150
- "readonly"
151
- ]);
152
- function D(e) {
153
- return (t, n, r, i, a, o) => {
154
- 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) : 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)));
155
- };
156
- }
157
- //#endregion
158
- //#region src/vue/createApp.mts
159
- var O = /* @__PURE__ */ new Set();
160
- function k(n, r) {
161
- let a = {
162
- ...s(e),
163
- patchProp: D(e)
164
- }, l = i(a);
165
- Object.assign(a, c(e, a));
166
- let u = l.createApp(n, r), d = u.mount.bind(u), f = u.unmount.bind(u);
167
- return Object.assign(u, {
168
- mount: (e) => {
169
- let n = d(e ?? o(t()));
170
- return O.add(u), n;
171
- },
172
- unmount: () => {
173
- f(), O.delete(u);
174
- }
175
- });
176
- }
177
- //#endregion
178
- export { k as createIncaApp };
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?
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.22",
3
+ "version": "0.0.23",
4
4
  "description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
5
5
  "keywords": [
6
6
  "cross-platform",
@@ -33,33 +33,28 @@
33
33
  "sideEffects": [
34
34
  "src/callbacks.mts",
35
35
  "src/targets.mts",
36
+ "src/interfaces.mts",
36
37
  "dist/chunks/hooks-*.js"
37
38
  ],
38
39
  "main": "./dist/index.js",
39
- "types": "./dist/index.d.mts",
40
+ "types": "./dist/index.d.ts",
40
41
  "exports": {
41
42
  ".": {
42
- "types": "./dist/index.d.mts",
43
+ "types": "./dist/index.d.ts",
43
44
  "import": "./dist/index.js"
44
45
  },
45
46
  "./vue": {
46
- "types": "./dist/vue/index.d.mts",
47
+ "types": "./dist/vue.d.ts",
47
48
  "import": "./dist/vue.js"
48
49
  },
49
50
  "./vue/runtime": {
50
- "types": "./dist/vue/runtime.d.mts",
51
+ "types": "./dist/vue-runtime.d.ts",
51
52
  "import": "./dist/vue-runtime.js"
52
53
  }
53
54
  },
54
55
  "publishConfig": {
55
56
  "access": "public"
56
57
  },
57
- "devDependencies": {
58
- "@vue/runtime-core": "^3.5.43",
59
- "@vue/runtime-dom": "^3.5.43",
60
- "oxfmt": "^0.72.0",
61
- "oxlint": "^1.87.0"
62
- },
63
58
  "peerDependencies": {
64
59
  "@vue/runtime-core": "^3.5.43",
65
60
  "@vue/runtime-dom": "^3.5.43"
@@ -74,12 +69,5 @@
74
69
  },
75
70
  "engines": {
76
71
  "node": ">=22.18"
77
- },
78
- "scripts": {
79
- "build": "vite build",
80
- "test": "vitest run",
81
- "lint": "oxlint --type-aware",
82
- "format": "oxfmt --check .",
83
- "typecheck": "oxlint -A all --type-aware --type-check"
84
72
  }
85
73
  }
@@ -1,31 +0,0 @@
1
- import { EventTargetId, HostCallback } from './native.mts';
2
- import { CallbackId, EventListenerOrObject } from './types.mts';
3
- /**
4
- * Records `callable` under `callbackId` at `globalThis.__inca_callbacks__`.
5
- * @param group - the node, event and capture flag as one string, from {@link groupOf}
6
- * @param listener - the listener the caller registered, which identifies the registration
7
- * @param callbackId - the id the host returned for the registration
8
- * @param callable - the function the host runs
9
- */
10
- export declare function addCallback(group: string, listener: EventListenerOrObject<never, never>, callbackId: CallbackId, callable: HostCallback): void;
11
- /**
12
- * @param group - the node, event and capture flag as one string
13
- * @param listener - the listener the caller registered
14
- * @returns the id registered for the pair, or `undefined`
15
- */
16
- export declare function callbackIdFor(group: string, listener: EventListenerOrObject<never, never>): CallbackId | undefined;
17
- /**
18
- * Forgets `callbackId` and the listener it names. An id that was never
19
- * registered, or was released already, changes nothing.
20
- * @param callbackId - the id to drop
21
- */
22
- export declare function releaseCallback(callbackId: CallbackId): void;
23
- /**
24
- * The capture flag is part of the identity: the same target, event and
25
- * function can listen in both phases side by side.
26
- * @param target - the event target (node id, "$document" or "$window")
27
- * @param event - the event name
28
- * @param capture - the capture flag of the registration
29
- * @returns the target, event and capture flag as one string
30
- */
31
- export declare const groupOf: (target: EventTargetId, event: string, capture: boolean | undefined) => string;