incajs 0.0.17 → 0.0.19

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.
@@ -7,13 +7,13 @@ import { CallbackId, EventListenerOrObject, NodeId } from './types.mts';
7
7
  * @param callbackId - the id the host returned for the registration
8
8
  * @param callable - the function the host runs
9
9
  */
10
- export declare function addCallback(group: string, listener: EventListenerOrObject, callbackId: CallbackId, callable: HostCallback): void;
10
+ export declare function addCallback(group: string, listener: EventListenerOrObject<never>, callbackId: CallbackId, callable: HostCallback): void;
11
11
  /**
12
12
  * @param group - the node, event and capture flag as one string
13
13
  * @param listener - the listener the caller registered
14
14
  * @returns the id registered for the pair, or `undefined`
15
15
  */
16
- export declare function callbackIdFor(group: string, listener: EventListenerOrObject): CallbackId | undefined;
16
+ export declare function callbackIdFor(group: string, listener: EventListenerOrObject<never>): CallbackId | undefined;
17
17
  /**
18
18
  * Forgets `callbackId` and the listener it names. An id that was never
19
19
  * registered, or was released already, changes nothing.
@@ -1,25 +1,60 @@
1
- import { A as e, C as t, M as n, O as r, P as i, S as a, T as o, _ as s, a as c, b as l, g as u, h as d, k as f, l as p, o as m, v as h } from "./hooks-BgB7lzTv.js";
1
+ import { A as e, C as t, M as n, O as r, P as i, S as a, T as o, _ as s, a as c, b as l, g as u, h as d, k as f, l as p, o as m, v as h } from "./hooks-COUJ5IPe.js";
2
+ //#region src/element/eventHandlers.mts
3
+ var g = [
4
+ "auxclick",
5
+ "blur",
6
+ "click",
7
+ "contextmenu",
8
+ "dblclick",
9
+ "focus",
10
+ "keydown",
11
+ "keyup",
12
+ "mousedown",
13
+ "mouseenter",
14
+ "mouseleave",
15
+ "mousemove",
16
+ "mouseout",
17
+ "mouseover",
18
+ "mouseup",
19
+ "scroll",
20
+ "wheel"
21
+ ];
22
+ function _(e, t) {
23
+ for (let n of g) {
24
+ let r = null, i = function(e) {
25
+ typeof r == "function" && Reflect.apply(r, this, [e]) === !1 && e.preventDefault();
26
+ };
27
+ Object.defineProperty(e, `on${n}`, {
28
+ get: () => r,
29
+ set(a) {
30
+ t() || (r = typeof a == "function" || typeof a == "object" && a ? a : null, r === null ? e.removeEventListener(n, i) : e.addEventListener(n, i));
31
+ }
32
+ });
33
+ }
34
+ return e;
35
+ }
36
+ //#endregion
2
37
  //#region src/element/geometry.mts
3
- function g(e) {
38
+ function v(e) {
4
39
  return f(e) ? null : p(e.__node_id);
5
40
  }
6
- function _(e) {
41
+ function y(e) {
7
42
  let t = e.parent;
8
- return !g(e) || !t || !g(t) ? null : t;
43
+ return !v(e) || !t || !v(t) ? null : t;
9
44
  }
10
- function v(e) {
11
- let t = g(e);
45
+ function b(e) {
46
+ let t = v(e);
12
47
  if (!t) return {
13
48
  left: 0,
14
49
  top: 0
15
50
  };
16
- let n = _(e), r = n ? g(n) : null;
51
+ let n = y(e), r = n ? v(n) : null;
17
52
  return {
18
53
  left: Math.round(t[0] - (r ? r[0] + r[4] : 0) + t[5]) || 0,
19
54
  top: Math.round(t[1] - (r ? r[1] + r[4] : 0) + t[6]) || 0
20
55
  };
21
56
  }
22
- function y(e) {
57
+ function x(e) {
23
58
  let [t, n, r, i] = e ?? [
24
59
  0,
25
60
  0,
@@ -41,7 +76,7 @@ function y(e) {
41
76
  toJSON: () => ({ ...a })
42
77
  };
43
78
  }
44
- function b(e, t) {
79
+ function S(e, t) {
45
80
  let n = t === "button" ? 0 : -1;
46
81
  if (typeof e != "string" && typeof e != "number") return n;
47
82
  let r = /^[\t\n\f\r ]*([+-]?\d+)/.exec(String(e));
@@ -51,7 +86,7 @@ function b(e, t) {
51
86
  }
52
87
  //#endregion
53
88
  //#region src/element/scroll.mts
54
- function x(e, t, n) {
89
+ function C(e, t, n) {
55
90
  if (f(e)) return;
56
91
  let [r, i] = t, [a, o] = typeof r == "object" ? [r?.left, r?.top] : [r, i], [c, l] = n ? s(e.__node_id) ?? [0, 0] : [0, 0], d = (e, t) => {
57
92
  if (e === void 0) return null;
@@ -60,7 +95,7 @@ function x(e, t, n) {
60
95
  };
61
96
  u(e.__node_id, d(a, c), d(o, l));
62
97
  }
63
- function S(e) {
98
+ function w(e) {
64
99
  let t = [
65
100
  "start",
66
101
  "center",
@@ -77,19 +112,19 @@ function S(e) {
77
112
  }
78
113
  //#endregion
79
114
  //#region src/element/handle.mts
80
- function C(r, c, u) {
81
- let p = l(() => r), C = () => f(w) ? null : s(r), w = i({
115
+ function T(r, c, u) {
116
+ let p = l(() => r), g = () => f(T) ? null : s(r), T = _(i({
82
117
  get id() {
83
- return f(w) ? "" : String(m(r, "id") ?? "");
118
+ return f(T) ? "" : String(m(r, "id") ?? "");
84
119
  },
85
120
  set id(e) {
86
- f(w) || h(r, "id", String(e));
121
+ f(T) || h(r, "id", String(e));
87
122
  },
88
123
  kind: c,
89
124
  parent: null,
90
125
  children: [],
91
126
  focus: (e) => {
92
- if (f(w)) return;
127
+ if (f(T)) return;
93
128
  let t = e?.preventScroll;
94
129
  t === void 0 ? o(r) : o(r, !!t);
95
130
  },
@@ -98,83 +133,83 @@ function C(r, c, u) {
98
133
  contains: (t) => {
99
134
  if (t == null) return !1;
100
135
  if (!e(t)) throw TypeError("the value is not a node. pass an element, a text node or null");
101
- for (let e = t; e !== null; e = e.parent) if (e === w) return !0;
136
+ for (let e = t; e !== null; e = e.parent) if (e === T) return !0;
102
137
  return !1;
103
138
  },
104
139
  addEventListener: (...e) => {
105
- f(w) || p.addEventListener(...e);
140
+ f(T) || p.addEventListener(...e);
106
141
  },
107
142
  removeEventListener: (...e) => {
108
- f(w) || p.removeEventListener(...e);
143
+ f(T) || p.removeEventListener(...e);
109
144
  },
110
- dispatchEvent: (e) => f(w) || p.dispatchEvent(e),
145
+ dispatchEvent: (e) => f(T) || p.dispatchEvent(e),
111
146
  get tabIndex() {
112
- return b(f(w) ? null : m(r, "tabindex"), u ?? "");
147
+ return S(f(T) ? null : m(r, "tabindex"), u ?? "");
113
148
  },
114
149
  set tabIndex(e) {
115
- f(w) || h(r, "tabindex", e | 0);
150
+ f(T) || h(r, "tabindex", e | 0);
116
151
  },
117
- getBoundingClientRect: () => y(g(w)),
152
+ getBoundingClientRect: () => x(v(T)),
118
153
  get offsetWidth() {
119
- return Math.round(g(w)?.[2] ?? 0);
154
+ return Math.round(v(T)?.[2] ?? 0);
120
155
  },
121
156
  get offsetHeight() {
122
- return Math.round(g(w)?.[3] ?? 0);
157
+ return Math.round(v(T)?.[3] ?? 0);
123
158
  },
124
159
  get offsetLeft() {
125
- return v(w).left;
160
+ return b(T).left;
126
161
  },
127
162
  get offsetTop() {
128
- return v(w).top;
163
+ return b(T).top;
129
164
  },
130
165
  get offsetParent() {
131
- return _(w);
166
+ return y(T);
132
167
  },
133
168
  get clientWidth() {
134
- let e = g(w);
169
+ let e = v(T);
135
170
  return e ? Math.max(0, Math.round(e[2] - 2 * e[4])) : 0;
136
171
  },
137
172
  get clientHeight() {
138
- let e = g(w);
173
+ let e = v(T);
139
174
  return e ? Math.max(0, Math.round(e[3] - 2 * e[4])) : 0;
140
175
  },
141
176
  get clientLeft() {
142
- return Math.round(g(w)?.[4] ?? 0);
177
+ return Math.round(v(T)?.[4] ?? 0);
143
178
  },
144
179
  get clientTop() {
145
- return Math.round(g(w)?.[4] ?? 0);
180
+ return Math.round(v(T)?.[4] ?? 0);
146
181
  },
147
182
  get scrollLeft() {
148
- return C()?.[0] ?? 0;
183
+ return g()?.[0] ?? 0;
149
184
  },
150
185
  set scrollLeft(e) {
151
- x(w, [e], !1);
186
+ C(T, [e], !1);
152
187
  },
153
188
  get scrollTop() {
154
- return C()?.[1] ?? 0;
189
+ return g()?.[1] ?? 0;
155
190
  },
156
191
  set scrollTop(e) {
157
- x(w, [void 0, e], !1);
192
+ C(T, [void 0, e], !1);
158
193
  },
159
194
  get scrollWidth() {
160
- return w.clientWidth + Math.round(C()?.[2] ?? 0);
195
+ return T.clientWidth + Math.round(g()?.[2] ?? 0);
161
196
  },
162
197
  get scrollHeight() {
163
- return w.clientHeight + Math.round(C()?.[3] ?? 0);
198
+ return T.clientHeight + Math.round(g()?.[3] ?? 0);
164
199
  },
165
- scrollTo: (...e) => x(w, e, !1),
166
- scrollBy: (...e) => x(w, e, !0),
200
+ scrollTo: (...e) => C(T, e, !1),
201
+ scrollBy: (...e) => C(T, e, !0),
167
202
  scrollIntoView: (e) => {
168
- if (f(w)) return;
169
- let { block: t, inline: n } = S(e);
203
+ if (f(T)) return;
204
+ let { block: t, inline: n } = w(e);
170
205
  d(r, t, n);
171
206
  }
172
- }, r);
173
- return c === "element" && n(w), w;
207
+ }, r), () => f(T));
208
+ return c === "element" && n(T), T;
174
209
  }
175
- function w() {
210
+ function E() {
176
211
  let e = c();
177
212
  return e === null ? null : r(e) ?? null;
178
213
  }
179
214
  //#endregion
180
- export { C as n, w as t };
215
+ export { T as n, E as t };
@@ -69,15 +69,18 @@ function x(e) {
69
69
  for (let t of e) b(t);
70
70
  }
71
71
  var S = (e, t, n) => `${e}:${t}:${n === !0}`;
72
- globalThis.__inca_released__ ??= (e, t) => {
73
- let n, r = !1;
74
- for (let e of t) try {
75
- x([e]);
76
- } catch (e) {
77
- r || (n = e), r = !0;
78
- }
79
- if (f(e), r) throw n;
80
- };
72
+ Object.defineProperty(globalThis, "__inca_released__", {
73
+ value: (e, t) => {
74
+ let n, r = !1;
75
+ for (let e of t) try {
76
+ x([e]);
77
+ } catch (e) {
78
+ r || (n = e), r = !0;
79
+ }
80
+ if (f(e), r) throw n;
81
+ },
82
+ configurable: !0
83
+ });
81
84
  //#endregion
82
85
  //#region src/events.mts
83
86
  var C = 0;
@@ -191,11 +194,12 @@ function X() {
191
194
  //#endregion
192
195
  //#region src/window.mts
193
196
  var Z = /* @__PURE__ */ Object.defineProperty(M(N, ["wheel"]), Symbol.toStringTag, { value: "Window" });
194
- //#endregion
195
- //#region src/targets.mts
196
- globalThis.__inca_targets__ ??= (e) => {
197
- let t = N();
198
- return e.map((e) => e === t ? Z : c(e) ?? null);
199
- };
197
+ Object.defineProperty(globalThis, "__inca_targets__", {
198
+ value: (e) => {
199
+ let t = N();
200
+ return e.map((e) => e === t ? Z : c(e) ?? null);
201
+ },
202
+ configurable: !0
203
+ });
200
204
  //#endregion
201
205
  export { r as A, k as C, D, w as E, o as M, m as N, c as O, n as P, j as S, A as T, W as _, X as a, M as b, I as c, q as d, L as f, G as g, K as h, R as i, d as j, u as k, U as l, N as m, F as n, H as o, Y as p, P as r, z as s, Z as t, B as u, V as v, O as w, E as x, J as y };
@@ -1,5 +1,5 @@
1
- import { C as e, D as t, E as n, N as r, P as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, j as g, k as _, l as v, m 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 "./hooks-BgB7lzTv.js";
2
- import { n as j } from "./handle-SWQTonXe.js";
1
+ import { C as e, D as t, E as n, N as r, P as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, j as g, k as _, l as v, m 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 "./hooks-COUJ5IPe.js";
2
+ import { n as j } from "./handle-C_4KtGsE.js";
3
3
  //#region \0rolldown/runtime.js
4
4
  var M = Object.defineProperty, N = (e, t) => {
5
5
  let n = {};
@@ -0,0 +1,12 @@
1
+ import { IncaEventTarget } from '../types.mts';
2
+ import { EventHandlers } from './types.mts';
3
+ /** The events whose handler property every element has. */
4
+ export declare const HANDLER_EVENTS: readonly ["auxclick", "blur", "click", "contextmenu", "dblclick", "focus", "keydown", "keyup", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "scroll", "wheel"];
5
+ /**
6
+ * Defines the event handler properties on `handle`. A value assigned while a property holds `null`
7
+ * registers a bubble listener through `handle.addEventListener`, and `null` removes it.
8
+ * @param handle - the element handle
9
+ * @param ignored - whether an assignment is ignored, as it is once the node is removed
10
+ * @returns `handle`, with the properties
11
+ */
12
+ export declare function withEventHandlers<T extends IncaEventTarget>(handle: T, ignored: () => boolean): T & EventHandlers;
@@ -3,8 +3,8 @@ import { IncaElement } from './types.mts';
3
3
  /**
4
4
  * Builds the {@link IncaElement} handle for a native node: parentless,
5
5
  * childless, with `id`, `focus()`, `blur()`, `click()`, `contains()`, the
6
- * listener methods of an event target, `tabIndex` and the layout members, all
7
- * driven through the host.
6
+ * listener methods of an event target, `tabIndex`, the layout members and the
7
+ * event handler properties, all driven through the host.
8
8
  * @param id - the native node's id
9
9
  * @param kind - whether the node is an element or a comment stand-in
10
10
  * @param tag - the node's element kind, if it has one; a `button` defaults to tab index `0`
@@ -1,6 +1,16 @@
1
- import { IncaEventTarget } from '../types.mts';
1
+ import { IncaEvent, IncaEventTarget } from '../types.mts';
2
+ import { HANDLER_EVENTS } from './eventHandlers.mts';
2
3
  import { RectLike } from './geometry.mts';
3
4
  import { ScrollIntoViewOptions, ScrollOptions } from './scroll.mts';
5
+ /** A function an event handler property holds, called with the element as `this` and the event. */
6
+ export type EventHandler = (this: IncaElement, event: IncaEvent) => unknown;
7
+ /**
8
+ * The event handler properties, such as `onclick`, of the events the host dispatches, `focusin` and
9
+ * `focusout` excepted.
10
+ */
11
+ export type EventHandlers = {
12
+ [K in (typeof HANDLER_EVENTS)[number] as `on${K}`]: EventHandler | object | null;
13
+ };
4
14
  /**
5
15
  * A container node: either a real element or the hidden stand-in that
6
16
  * `createCommentNode` makes. It is the only node type that can act as a
@@ -8,9 +18,10 @@ import { ScrollIntoViewOptions, ScrollOptions } from './scroll.mts';
8
18
  * tree.
9
19
  *
10
20
  * After the node is removed, `addEventListener()` and `removeEventListener()`
11
- * ignore the call, and `dispatchEvent()` returns `true`.
21
+ * ignore the call, an assignment to a handler property does nothing, and
22
+ * `dispatchEvent()` returns `true`.
12
23
  */
13
- export interface IncaElement extends IncaEventTarget {
24
+ export interface IncaElement extends IncaEventTarget, EventHandlers {
14
25
  /**
15
26
  * The `id` attribute, or an empty string when it is unset. Assigning sets
16
27
  * the attribute to the value as a string. After the node is removed,
package/dist/events.d.mts CHANGED
@@ -11,7 +11,7 @@ export declare function latestEventId(): number;
11
11
  * registration keeps its other options. A `null` listener is ignored.
12
12
  *
13
13
  * Any event name is accepted, and it fires when the host dispatches that name.
14
- * See the `EventListener` type for the fields an event carries.
14
+ * See the `IncaEvent` type for the fields an event carries.
15
15
  * @param nodeId - the node to listen on
16
16
  * @param event - the event name (e.g. `"click"`)
17
17
  * @param listener - a function, called with the event's `currentTarget` as
@@ -24,7 +24,7 @@ export declare function latestEventId(): number;
24
24
  * @throws TypeError when `nodeId` names no node
25
25
  * @throws RangeError when the host has issued its last callback id
26
26
  */
27
- export declare function addEventListener(nodeId: NodeId, event: string, listener: EventListenerOrObject | null, options?: ListenerOptions): void;
27
+ export declare function addEventListener(nodeId: NodeId, event: string, listener: EventListenerOrObject<never> | null, options?: ListenerOptions): void;
28
28
  /**
29
29
  * Drops the registration {@link addEventListener} made for `listener` on
30
30
  * `nodeId` with the same `event` and `capture`. A no-op if there is none.
@@ -33,7 +33,7 @@ export declare function addEventListener(nodeId: NodeId, event: string, listener
33
33
  * @param listener - the listener that was registered
34
34
  * @param options - `capture` of the registration to drop
35
35
  */
36
- export declare function removeEventListener(nodeId: NodeId, event: string, listener: EventListenerOrObject | null, options?: Pick<ListenerOptions, "capture">): void;
36
+ export declare function removeEventListener(nodeId: NodeId, event: string, listener: EventListenerOrObject<never> | null, options?: Pick<ListenerOptions, "capture">): void;
37
37
  /**
38
38
  * Dispatches `event` at `nodeId` along the path to the root.
39
39
  * @param nodeId - the node to dispatch at
package/dist/index.d.mts CHANGED
@@ -3,4 +3,4 @@ export { window } from './window.mts';
3
3
  export type { RectLike, RectValues } from './element/geometry.mts';
4
4
  export type { ScrollIntoViewOptions, ScrollOptions } from './element/scroll.mts';
5
5
  export type { IncaElement, IncaNode } from './element/types.mts';
6
- export type { AttributeValue, CallbackId, EventLike, EventListener, EventListenerObject, EventListenerOrObject, IncaEventTarget, ListenerOptions, NodeId, StyleProps, TagName, } from './types.mts';
6
+ export type { AttributeValue, CallbackId, EventLike, EventListener, EventListenerObject, EventListenerOrObject, IncaEvent, IncaEventTarget, ListenerOptions, NodeId, StyleProps, TagName, } from './types.mts';
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as e } from "./chunks/hooks-BgB7lzTv.js";
2
- import { t } from "./chunks/handle-SWQTonXe.js";
1
+ import { t as e } from "./chunks/hooks-COUJ5IPe.js";
2
+ import { t } from "./chunks/handle-C_4KtGsE.js";
3
3
  export { t as activeElement, e as window };
@@ -1,4 +1,4 @@
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-BWT8KFVJ.js";
2
- import { C as l, D as u, E as d, N as f, S as p, T as m, _ as h, a as g, b as _, c as v, d as y, f as b, g as x, h as S, i as C, k as w, l as T, m as E, n as D, o as O, p as k, r as A, s as j, t as M, u as N, v as P, w as F, x as I, y as L } from "./chunks/hooks-BgB7lzTv.js";
3
- import { n as R } from "./chunks/handle-SWQTonXe.js";
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-Bu6a8hAp.js";
2
+ import { C as l, D as u, E as d, N as f, S as p, T as m, _ as h, a as g, b as _, c as v, d as y, f as b, g as x, h as S, i as C, k as w, l as T, m as E, n as D, o as O, p as k, r as A, s as j, t as M, u as N, v as P, w as F, x as I, y as L } from "./chunks/hooks-COUJ5IPe.js";
3
+ import { n as R } from "./chunks/handle-C_4KtGsE.js";
4
4
  export { I as addEventListener, D as appendChild, p as blur, l as click, i as createCommentNode, o as createElementNode, _ as createEventTarget, R as createIncaElement, A as createNode, n as createTextNode, C as destroyNode, F as dispatchEvent, m as focus, g as focusedNode, O as getAttribute, j as holdNode, e as insert, v as insertBefore, w as isDestroyed, d as latestEventId, T as layoutOf, a as nextSibling, s as parentNode, N as releaseNode, f as releaseWhenCollected, t as remove, y as removeAttribute, b as removeChild, u as removeEventListener, k as removeStyle, E as rootNodeId, S as scrollIntoViewNode, x as scrollNode, h as scrollOf, P as setAttribute, r as setElementText, L as setStyle, c as setText, M as window };
package/dist/tree.d.mts CHANGED
@@ -95,7 +95,7 @@ export declare function layoutOf(nodeId: NodeId): readonly [number, number, numb
95
95
  * frame.
96
96
  * @param nodeId - the node to read
97
97
  * @returns `[left, top, maxLeft, maxTop]`, or `null` for a node whose `overflow` is
98
- * `visible` on both axes. The maxima are the largest offsets the node can take, as
98
+ * `visible` or `clip` on both axes. The maxima are the largest offsets the node can take, as
99
99
  * of the last drawn frame.
100
100
  * @throws {TypeError} when `nodeId` names no node
101
101
  */
@@ -103,7 +103,7 @@ export declare function scrollOf(nodeId: NodeId): readonly [number, number, numb
103
103
  /**
104
104
  * Sets the scroll offset of `nodeId` on one or both axes. A `null` axis keeps
105
105
  * its current offset. The host clamps each value to the scrollable range on
106
- * the next frame. A node with `overflow: visible` on both axes ignores the call.
106
+ * the next frame. A node whose `overflow` is `visible` or `clip` on both axes ignores the call.
107
107
  * @param nodeId - the node to scroll
108
108
  * @param left - the horizontal offset, or `null` to keep it
109
109
  * @param top - the vertical offset, or `null` to keep it
package/dist/types.d.mts CHANGED
@@ -23,12 +23,15 @@ export type AttributeValue = string | number | boolean;
23
23
  export type TagName = "text" | (string & {});
24
24
  /** Where `scrollIntoView` aligns a node on one axis. */
25
25
  export type ScrollAlignment = "start" | "center" | "end" | "nearest";
26
+ /** One overflow value; `"auto"` is an alias of `"scroll"`. */
27
+ export type Overflow = "visible" | "hidden" | "clip" | "scroll" | "auto";
26
28
  /**
27
29
  * Style properties, in their snake_case spelling, that `setStyle`'s typed
28
30
  * overload checks. A deliberately incomplete, v1 layout/paint vocabulary. The
29
31
  * renderer also reads the camelCase and kebab-case spellings. An unrecognized
30
32
  * key or a value shape that doesn't parse (e.g. a malformed enum string) is
31
- * ignored by the renderer.
33
+ * ignored by the renderer, and the host prints a warning line on stderr for
34
+ * it (an empty string `''` prints none).
32
35
  */
33
36
  export interface StyleProps {
34
37
  /** Layout mode for this node's children. `"none"` skips both layout and rendering for the whole subtree. */
@@ -39,13 +42,13 @@ export interface StyleProps {
39
42
  justify_content?: "start" | "end" | "center" | "stretch";
40
43
  /** Cross-axis alignment of children within this container. */
41
44
  align_items?: "start" | "end" | "center" | "stretch";
42
- /** Uniform spacing, in px, between children, applied on both axes. */
45
+ /** Uniform spacing, in px (`>= 0`), between children, applied on both axes. */
43
46
  gap?: number;
44
- /** Fixed width in px, or `"auto"` to size to content. */
47
+ /** Fixed width in px (`>= 0`), or `"auto"` to size to content. */
45
48
  width?: number | "auto";
46
- /** Fixed height in px, or `"auto"` to size to content. */
49
+ /** Fixed height in px (`>= 0`), or `"auto"` to size to content. */
47
50
  height?: number | "auto";
48
- /** Uniform border width in px, applied to all four sides. */
51
+ /** Uniform border width in px (`>= 0`), applied to all four sides. */
49
52
  border_width?: number;
50
53
  /** Fill color, as a hex number (`0xRRGGBB`) or a CSS-style string (`"#rrggbb"`/`"#rgb"`). */
51
54
  background?: number | string;
@@ -53,16 +56,16 @@ export interface StyleProps {
53
56
  border_color?: number | string;
54
57
  /** 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. */
55
58
  text_color?: number | string;
56
- /** Uniform corner radius in px, applied to all four corners. */
59
+ /** Uniform corner radius in px (`>= 0`), applied to all four corners. */
57
60
  corner_radius?: number;
58
- /** Font size in px for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_color}. */
61
+ /** Font size in px (`>= 0`) for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_color}. */
59
62
  text_size?: number;
60
- /** Overflow on both axes; `"scroll"` (alias `"auto"`) makes the container scroll with the wheel. Overridden per axis by {@link StyleProps.overflow_x}/{@link StyleProps.overflow_y}. */
61
- overflow?: "visible" | "hidden" | "scroll" | "auto";
63
+ /** 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}. */
64
+ overflow?: Overflow | `${Overflow} ${Overflow}`;
62
65
  /** Horizontal overflow; wins over {@link StyleProps.overflow}. */
63
- overflow_x?: "visible" | "hidden" | "scroll" | "auto";
66
+ overflow_x?: Overflow;
64
67
  /** Vertical overflow; wins over {@link StyleProps.overflow}. */
65
- overflow_y?: "visible" | "hidden" | "scroll" | "auto";
68
+ overflow_y?: Overflow;
66
69
  /** 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. */
67
70
  padding?: number;
68
71
  /** Horizontal inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
@@ -97,13 +100,13 @@ export interface StyleProps {
97
100
  flex_shrink?: number;
98
101
  /** Opacity from `0` to `1`, applied to this node and its descendants; values outside are clamped. */
99
102
  opacity?: number;
100
- /** Minimum width in px, or `"auto"` for the default minimum. */
103
+ /** Minimum width in px (`>= 0`), or `"auto"` for the default minimum. */
101
104
  min_width?: number | "auto";
102
- /** Minimum height in px, or `"auto"` for the default minimum. */
105
+ /** Minimum height in px (`>= 0`), or `"auto"` for the default minimum. */
103
106
  min_height?: number | "auto";
104
- /** Maximum width in px, or `"auto"` for no limit. */
107
+ /** Maximum width in px (`>= 0`), or `"auto"` for no limit. */
105
108
  max_width?: number | "auto";
106
- /** Maximum height in px, or `"auto"` for no limit. */
109
+ /** Maximum height in px (`>= 0`), or `"auto"` for no limit. */
107
110
  max_height?: number | "auto";
108
111
  }
109
112
  /**
@@ -141,7 +144,7 @@ export interface IncaEventTarget {
141
144
  * as `this` when the event fires
142
145
  * @param options - a {@link ListenerOptions}, or a boolean for `capture`
143
146
  */
144
- addEventListener(type: string, listener: EventListenerOrObject | null, options?: boolean | ListenerOptions): void;
147
+ addEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E> | null, options?: boolean | ListenerOptions): void;
145
148
  /**
146
149
  * Drops the registration of `listener` for `type` with the same `capture`.
147
150
  * A call that matches no registration changes nothing.
@@ -149,7 +152,7 @@ export interface IncaEventTarget {
149
152
  * @param listener - the listener that was registered
150
153
  * @param options - an object with `capture`, or a boolean for `capture`
151
154
  */
152
- removeEventListener(type: string, listener: EventListenerOrObject | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
155
+ removeEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E> | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
153
156
  /**
154
157
  * Dispatches an `Event` or `CustomEvent` at the target.
155
158
  * @param event - the event to dispatch
@@ -160,47 +163,82 @@ export interface IncaEventTarget {
160
163
  dispatchEvent(event: EventLike): boolean;
161
164
  }
162
165
  /**
163
- * Signature of a callback registered via `addEventListener`. Declare its
164
- * parameter as the event object, such as `(event: { key: string }) => void`.
165
- *
166
- * The native host calls it with one argument, an object with:
167
- * - `type`: the event's name.
168
- * - `target`: the element the event is about, or `window`. It is the deepest
169
- * element under the pointer for pointer events, the nearest common ancestor
170
- * of the press and the release for `click`, `dblclick` and `auxclick`, and
171
- * the focused element for key events. With no such element it is `window`.
172
- * - `currentTarget`: the element or `window` whose listener is running, and
173
- * `null` once the event has been handled. A listener function runs with it
174
- * as `this`.
175
- * - `composedPath()`: `target` and its ancestors, ending with `window`, and an
176
- * empty array once the event has been handled.
177
- * - `bubbles`, `cancelable` and `composed`: fixed per event name.
178
- * - `defaultPrevented`: `true` once a listener called `preventDefault()` on a
179
- * cancelable event.
180
- * - `eventPhase`: 1 on the ancestors of `target` while the event travels
181
- * down, 2 where `currentTarget` is `target`, 3 on the ancestors while it
182
- * travels up, and 0 once the event has been handled.
183
- * - `isTrusted`: `true` for events the host dispatches and `false` for events a
184
- * script dispatches.
185
- * - `timeStamp`: milliseconds since the host started, as a number.
186
- * - `eventId`: a number that grows with each event and is the same on every
187
- * node that event reaches.
188
- * - `stopPropagation()`, `stopImmediatePropagation()` and `preventDefault()`.
189
- * - the fields that event kind carries.
166
+ * The event object a listener receives. It carries these fields and the
167
+ * fields of its event kind, which this type leaves out. A listener that reads
168
+ * them declares its parameter with them, such as
169
+ * `(event: IncaEvent & { key: string }) => void`.
190
170
  *
191
171
  * See https://incajs.tom96da.com/reference/events for the event names the
192
172
  * host dispatches and their fields.
193
173
  */
194
- export type EventListener = (...args: never[]) => void;
174
+ export interface IncaEvent {
175
+ /** The event's name. */
176
+ readonly type: string;
177
+ /**
178
+ * The element the event is about, or `window`. It is the deepest element
179
+ * under the pointer for pointer events, the nearest common ancestor of the
180
+ * press and the release for `click`, `dblclick` and `auxclick`, and the
181
+ * focused element for key events. With no such element it is `window`.
182
+ */
183
+ readonly target: IncaEventTarget;
184
+ /** The same object as {@link IncaEvent.target}. */
185
+ readonly srcElement: IncaEventTarget;
186
+ /**
187
+ * The element or `window` whose listener is running, and `null` once the
188
+ * event has been handled. A listener function runs with it as `this`.
189
+ */
190
+ readonly currentTarget: IncaEventTarget | null;
191
+ /** Whether the event travels up from `target`. Fixed per event name. */
192
+ readonly bubbles: boolean;
193
+ /** Whether `preventDefault()` can cancel the event. Fixed per event name. */
194
+ readonly cancelable: boolean;
195
+ /** Fixed per event name. */
196
+ readonly composed: boolean;
197
+ /**
198
+ * 1 on the ancestors of `target` while the event travels down, 2 where
199
+ * `currentTarget` is `target`, 3 on the ancestors while it travels up, and 0
200
+ * once the event has been handled.
201
+ */
202
+ readonly eventPhase: 0 | 1 | 2 | 3;
203
+ /** `true` once a listener called `preventDefault()` on a cancelable event. */
204
+ readonly defaultPrevented: boolean;
205
+ /** `true` for events the host dispatches and `false` for events a script dispatches. */
206
+ readonly isTrusted: boolean;
207
+ /** Milliseconds since the host started. */
208
+ readonly timeStamp: number;
209
+ /** A number that grows with each event and is the same on every node that event reaches. */
210
+ readonly eventId: number;
211
+ /** Assigning `true` while the event is dispatched stops it like `stopPropagation()`. */
212
+ cancelBubble: boolean;
213
+ /** The opposite of `defaultPrevented`. Assigning `false` cancels a cancelable event like `preventDefault()`. */
214
+ returnValue: boolean;
215
+ /** Stops the event from reaching the listeners of later nodes on its path. */
216
+ stopPropagation(): void;
217
+ /** Stops the event from reaching any later listener. */
218
+ stopImmediatePropagation(): void;
219
+ /** Cancels the event when it is cancelable and the listener is not passive. */
220
+ preventDefault(): void;
221
+ /**
222
+ * `target` and its ancestors, ending with `window`, and an empty array once
223
+ * the event has been handled.
224
+ */
225
+ composedPath(): IncaEventTarget[];
226
+ }
227
+ /**
228
+ * Signature of a callback registered via `addEventListener`. It receives the
229
+ * event, an {@link IncaEvent} unless the parameter declares another type, and
230
+ * runs with the event's `currentTarget` as `this`.
231
+ */
232
+ export type EventListener<E = IncaEvent> = (this: IncaEventTarget, event: E) => void;
195
233
  /**
196
234
  * An object whose `handleEvent` method receives the events, called with the
197
- * object as `this`. It takes the arguments of an {@link EventListener}.
235
+ * object as `this`. It takes the event an {@link EventListener} takes.
198
236
  */
199
- export interface EventListenerObject {
200
- handleEvent: EventListener;
237
+ export interface EventListenerObject<E = IncaEvent> {
238
+ handleEvent(event: E): void;
201
239
  }
202
240
  /**
203
241
  * What `addEventListener` accepts as a listener: an {@link EventListener} or
204
242
  * an {@link EventListenerObject}.
205
243
  */
206
- export type EventListenerOrObject = EventListener | EventListenerObject;
244
+ export type EventListenerOrObject<E = IncaEvent> = EventListener<E> | EventListenerObject<E>;
@@ -21,7 +21,12 @@ import { IncaCore, IncaElement } from '../rendererCore.mts';
21
21
  * ### `onXxx`
22
22
  *
23
23
  * The key registers `nextValue` as a listener for `xxx`, taking a function
24
- * or an array of them, and unbinds that key's listener for anything else.
24
+ * or an array of them. A falsy `nextValue` unbinds that key's listener. Any
25
+ * other value keeps a listener that runs nothing, and a development build
26
+ * warns about it. A nested array runs its functions. Any other entry that is
27
+ * not a function runs nothing, and a development build warns about it when
28
+ * the event fires. A falsy entry of the array itself is skipped without a
29
+ * warning.
25
30
  * - Order: each distinct key (`onClick`, `onClickOnce`) is its own listener.
26
31
  * Keys that share the event, phase and passivity run in the order first
27
32
  * registered, a re-patch keeps its place, and the host sees one registration
@@ -41,8 +46,8 @@ import { IncaCore, IncaElement } from '../rendererCore.mts';
41
46
  * - Event names: `onXxx` listens for the hyphenated name (`onMyEvent` listens
42
47
  * for `my-event`), and `on:xxx` listens for the name after the colon as
43
48
  * written (`on:myEvent` listens for `myEvent`). The listener runs when the
44
- * host dispatches that name. See {@link EventListener} for the fields an
45
- * event carries.
49
+ * host dispatches that name. See `IncaEvent` for the fields an event
50
+ * carries.
46
51
  * - Errors: an error a handler throws, or a rejection of an async handler,
47
52
  * goes to the `onErrorCaptured` hooks and the app's `errorHandler`. Every
48
53
  * handler of an event runs even when an earlier one fails, until one calls
@@ -52,6 +57,12 @@ import { IncaCore, IncaElement } from '../rendererCore.mts';
52
57
  * development build warns and raises it to the host's error report, once
53
58
  * per failing handler.
54
59
  *
60
+ * ### `onxxx`
61
+ *
62
+ * A lowercase key that names a handler property of the element, such as
63
+ * `onclick`, assigns `nextValue` to that property. A string `nextValue`
64
+ * clears the property and goes to `core.setAttribute` like other props.
65
+ *
55
66
  * ### Other props
56
67
  *
57
68
  * A string, number or boolean `nextValue` goes to `core.setAttribute` as it
package/dist/vue.js CHANGED
@@ -1,16 +1,16 @@
1
- import { t as e } from "./chunks/rendererCore-BWT8KFVJ.js";
2
- import { m as t } from "./chunks/hooks-BgB7lzTv.js";
3
- import { n } from "./chunks/handle-SWQTonXe.js";
4
- import { ErrorCodes as r, callWithAsyncErrorHandling as i, createRenderer as a } from "@vue/runtime-core";
1
+ import { t as e } from "./chunks/rendererCore-Bu6a8hAp.js";
2
+ import { m as t } from "./chunks/hooks-COUJ5IPe.js";
3
+ import { n } from "./chunks/handle-C_4KtGsE.js";
4
+ import { ErrorCodes as r, callWithAsyncErrorHandling as i, createRenderer as a, warn as o } from "@vue/runtime-core";
5
5
  //#region src/vue/nodeOps.mts
6
- function o(e) {
6
+ function s(e) {
7
7
  return Object.defineProperty(e, "__v_skip", { value: !0 }), e;
8
8
  }
9
- function s(e) {
9
+ function c(e) {
10
10
  return {
11
- createElement: (t) => o(e.createElementNode(t)),
12
- createText: (t) => o(e.createTextNode(t)),
13
- createComment: (t) => o(e.createCommentNode()),
11
+ createElement: (t) => s(e.createElementNode(t)),
12
+ createText: (t) => s(e.createTextNode(t)),
13
+ createComment: (t) => s(e.createCommentNode()),
14
14
  setText: (t, n) => e.setText(t, n),
15
15
  setElementText: (t, n) => e.setElementText(t, n),
16
16
  insert: (t, n, r) => e.insert(t, n, r),
@@ -19,7 +19,7 @@ function s(e) {
19
19
  nextSibling: e.nextSibling
20
20
  };
21
21
  }
22
- function c(e, t) {
22
+ function l(e, t) {
23
23
  let n = (t) => (e.holdNode(t.__node_id), e.releaseWhenCollected(t), t), { createElement: r, createText: i } = t;
24
24
  return {
25
25
  createElement: (e) => n(r(e)),
@@ -28,30 +28,30 @@ function c(e, t) {
28
28
  }
29
29
  //#endregion
30
30
  //#region src/vue/patchProp.mts
31
- var l = (e) => /^on[^a-z]/.test(e) && !e.startsWith("onUpdate:"), u = /(?:Once|Passive|Capture)$/, d = /^on:?(?:Once|Passive|Capture)$/, f = (e) => e.replace(/\B([A-Z])/g, "-$1").toLowerCase();
32
- function p(e) {
31
+ var u = (e) => /^on[^a-z]/.test(e), d = (e) => /^on[a-z]/.test(e), f = /(?:Once|Passive|Capture)$/, p = /^on:?(?:Once|Passive|Capture)$/, m = (e) => e.replace(/\B([A-Z])/g, "-$1").toLowerCase();
32
+ function h(e) {
33
33
  let t = e, n = {
34
34
  event: "",
35
35
  once: !1,
36
36
  capture: !1,
37
37
  passive: !1
38
38
  }, r;
39
- for (; (r = t.match(u)) && !d.test(t);) t = t.slice(0, -r[0].length), r[0] === "Once" ? n.once = !0 : r[0] === "Capture" ? n.capture = !0 : n.passive = !0;
40
- return n.event = t[2] === ":" ? t.slice(3) : f(t.slice(2)), n;
39
+ for (; (r = t.match(f)) && !p.test(t);) t = t.slice(0, -r[0].length), r[0] === "Once" ? n.once = !0 : r[0] === "Capture" ? n.capture = !0 : n.passive = !0;
40
+ return n.event = t[2] === ":" ? t.slice(3) : m(t.slice(2)), n;
41
41
  }
42
- var m = (e) => typeof e == "string" || typeof e == "number", h = /* @__PURE__ */ new WeakMap();
43
- function g(e, t, n) {
44
- let r = typeof n == "object" && n ? n : {}, i = h.get(t);
45
- i || h.set(t, i = /* @__PURE__ */ new Map());
42
+ var g = (e) => typeof e == "string" || typeof e == "number", _ = /* @__PURE__ */ new WeakMap();
43
+ function v(e, t, n) {
44
+ let r = typeof n == "object" && n ? n : {}, i = _.get(t);
45
+ i || _.set(t, i = /* @__PURE__ */ new Map());
46
46
  let a = !1;
47
- for (let n of i.keys()) m(r[n]) || (e.removeStyle(t.__node_id, n), i.delete(n), a = !0);
48
- for (let [n, o] of Object.entries(r)) m(o) && (a || i.get(n) !== o) && (e.setStyle(t.__node_id, n, o), i.set(n, o));
47
+ for (let n of i.keys()) g(r[n]) || (e.removeStyle(t.__node_id, n), i.delete(n), a = !0);
48
+ for (let [n, o] of Object.entries(r)) g(o) && (a || i.get(n) !== o) && (e.setStyle(t.__node_id, n, o), i.set(n, o));
49
49
  }
50
- function _(e) {
51
- let t = (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "function");
52
- return t.length === 0 ? null : t;
50
+ function y(e, t) {
51
+ return e ? typeof e == "function" ? [e] : Array.isArray(e) ? e.slice() : (o(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
52
+ Expected function or array of functions, received type ${typeof e}.`), []) : null;
53
53
  }
54
- function v(e, t) {
54
+ function b(e, t) {
55
55
  let n = e[0];
56
56
  if (typeof n != "object" || !n) return t(() => !1);
57
57
  let r = n.stopImmediatePropagation;
@@ -68,12 +68,12 @@ function v(e, t) {
68
68
  i ? n.stopImmediatePropagation = r : delete n.stopImmediatePropagation;
69
69
  }
70
70
  }
71
- var y = /* @__PURE__ */ new WeakMap(), b = ({ event: e, capture: t, passive: n }) => `${e}:${t === !0}:${n === !0}`;
72
- function x(e, t, n, r) {
71
+ var x = /* @__PURE__ */ new WeakMap(), S = ({ event: e, capture: t, passive: n }) => `${e}:${t === !0}:${n === !0}`;
72
+ function C(e, t, n, r) {
73
73
  let i = Array.from(r.slots.values()).some((e) => !e.fired);
74
- 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 && y.get(t)?.delete(n);
74
+ 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 && x.get(t)?.delete(n);
75
75
  }
76
- function S(e, t, n, { event: a, capture: o, passive: s }) {
76
+ function w(e, t, n, { event: a, capture: o, passive: s }) {
77
77
  let c = {
78
78
  event: a,
79
79
  options: {
@@ -84,15 +84,15 @@ function S(e, t, n, { event: a, capture: o, passive: s }) {
84
84
  registered: !1,
85
85
  dispatcher: (...a) => {
86
86
  let o = [], s = a[0]?.eventId;
87
- v(a, (l) => {
87
+ b(a, (l) => {
88
88
  for (let u of Array.from(c.slots.keys())) {
89
89
  if (l()) break;
90
90
  let d = c.slots.get(u);
91
91
  if (d && !d.fired && !(typeof s == "number" && d.attachedAt >= s)) {
92
- d.once && (d.fired = !0, x(e, t, n, c));
92
+ d.once && (d.fired = !0, C(e, t, n, c));
93
93
  for (let e of d.handlers) {
94
94
  if (l()) break;
95
- try {
95
+ if (e) try {
96
96
  i(e, d.instance, r.NATIVE_EVENT_HANDLER, a);
97
97
  } catch (e) {
98
98
  o.push(e);
@@ -107,20 +107,20 @@ function S(e, t, n, { event: a, capture: o, passive: s }) {
107
107
  };
108
108
  return c;
109
109
  }
110
- function C(e, t, n, r) {
111
- let i = b(n), a = y.get(t)?.get(i);
112
- a?.slots.delete(r) && x(e, t, i, a);
110
+ function T(e, t, n, r) {
111
+ let i = S(n), a = x.get(t)?.get(i);
112
+ a?.slots.delete(r) && C(e, t, i, a);
113
113
  }
114
- function w(e, t, n, r, i) {
115
- let a = p(n), o = _(r);
114
+ function E(e, t, n, r, i) {
115
+ let a = h(n), o = y(r, n);
116
116
  if (!o) {
117
- C(e, t, a, n);
117
+ T(e, t, a, n);
118
118
  return;
119
119
  }
120
- let s = b(a), c = y.get(t);
121
- c || y.set(t, c = /* @__PURE__ */ new Map());
120
+ let s = S(a), c = x.get(t);
121
+ c || x.set(t, c = /* @__PURE__ */ new Map());
122
122
  let l = c.get(s);
123
- l || c.set(s, l = S(e, t, s, a));
123
+ l || c.set(s, l = w(e, t, s, a));
124
124
  let u = l.slots.get(n);
125
125
  if (u) u.handlers = o, u.instance = i;
126
126
  else {
@@ -132,41 +132,41 @@ function w(e, t, n, r, i) {
132
132
  fired: !1
133
133
  });
134
134
  try {
135
- x(e, t, s, l);
135
+ C(e, t, s, l);
136
136
  } catch (e) {
137
137
  throw l.slots.delete(n), l.slots.size === 0 && c.delete(s), e;
138
138
  }
139
139
  }
140
140
  }
141
- var T = /* @__PURE__ */ new Set([
141
+ var D = /* @__PURE__ */ new Set([
142
142
  "disabled",
143
143
  "hidden",
144
144
  "inert"
145
145
  ]);
146
- function E(e) {
146
+ function O(e) {
147
147
  return (t, n, r, i, a, o) => {
148
- n === "style" ? g(e, t, i) : l(n) ? w(e, t, n, i, o ?? null) : T.has(n) && i === !1 ? 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) : n.startsWith("onUpdate:") || e.setAttribute(t.__node_id, n, String(i));
148
+ n.startsWith("onUpdate:") || (n === "style" ? v(e, t, i) : u(n) ? E(e, t, n, i, o ?? null) : d(n) && n in t ? typeof i == "string" ? (Reflect.set(t, n, null), e.setAttribute(t.__node_id, n, i)) : Reflect.set(t, n, i) : D.has(n) && i === !1 ? 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)));
149
149
  };
150
150
  }
151
151
  //#endregion
152
152
  //#region src/vue/createApp.mts
153
- var D = /* @__PURE__ */ new Set();
154
- function O(r, i) {
155
- let l = {
156
- ...s(e),
157
- patchProp: E(e)
158
- }, u = a(l);
159
- Object.assign(l, c(e, l));
153
+ var k = /* @__PURE__ */ new Set();
154
+ function A(r, i) {
155
+ let o = {
156
+ ...c(e),
157
+ patchProp: O(e)
158
+ }, u = a(o);
159
+ Object.assign(o, l(e, o));
160
160
  let d = u.createApp(r, i), f = d.mount.bind(d), p = d.unmount.bind(d);
161
161
  return Object.assign(d, {
162
162
  mount: (e) => {
163
- let r = f(e ?? o(n(t(), "element")));
164
- return D.add(d), r;
163
+ let r = f(e ?? s(n(t(), "element")));
164
+ return k.add(d), r;
165
165
  },
166
166
  unmount: () => {
167
- p(), D.delete(d);
167
+ p(), k.delete(d);
168
168
  }
169
169
  });
170
170
  }
171
171
  //#endregion
172
- export { O as createIncaApp };
172
+ export { A as createIncaApp };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incajs",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
5
5
  "keywords": [
6
6
  "cross-platform",