incajs 0.0.18 → 0.0.20

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.
@@ -1,4 +1,4 @@
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-D1NFQN8Q.js";
2
2
  //#region src/element/eventHandlers.mts
3
3
  var g = [
4
4
  "auxclick",
@@ -124,12 +124,12 @@ function T(r, c, u) {
124
124
  parent: null,
125
125
  children: [],
126
126
  focus: (e) => {
127
- if (f(T)) return;
128
- let t = e?.preventScroll;
129
- t === void 0 ? o(r) : o(r, !!t);
127
+ f(T) || o(r, !!e?.preventScroll);
130
128
  },
131
129
  blur: () => a(r),
132
- click: () => t(r),
130
+ click: () => {
131
+ f(T) || t(r);
132
+ },
133
133
  contains: (t) => {
134
134
  if (t == null) return !1;
135
135
  if (!e(t)) throw TypeError("the value is not a node. pass an element, a text node or null");
@@ -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;
@@ -109,7 +112,7 @@ function k(t) {
109
112
  e().click(t);
110
113
  }
111
114
  function A(t, n) {
112
- n === void 0 ? e().focusNode(t) : e().focusNode(t, n);
115
+ e().focusNode(t, n);
113
116
  }
114
117
  function j(t) {
115
118
  e().blurNode(t);
@@ -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-6SBsiUWz.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-D1NFQN8Q.js";
2
+ import { n as j } from "./handle-DdYIkUcm.js";
3
3
  //#region \0rolldown/runtime.js
4
4
  var M = Object.defineProperty, N = (e, t) => {
5
5
  let n = {};
@@ -48,8 +48,9 @@ export interface IncaElement extends IncaEventTarget, EventHandlers {
48
48
  /** Unfocuses this node next frame, if it is the focused one. */
49
49
  blur(): void;
50
50
  /**
51
- * Fires an untrusted `click` at this node. A disabled `button`, a node whose
52
- * own click is still running and an unknown node ignore the call.
51
+ * Fires an untrusted `click` at this node. A disabled `button` and a node
52
+ * whose own click is still running ignore the call. After the node is
53
+ * removed, the call does nothing.
53
54
  */
54
55
  click(): void;
55
56
  /**
package/dist/events.d.mts CHANGED
@@ -46,10 +46,11 @@ export declare function removeEventListener(nodeId: NodeId, event: string, liste
46
46
  */
47
47
  export declare function dispatchEvent(nodeId: NodeId, event: EventLike): boolean;
48
48
  /**
49
- * Fires an untrusted `click` at `nodeId`. A disabled `button`, a node whose
50
- * own click is still running and an unknown node ignore the call.
49
+ * Fires an untrusted `click` at `nodeId`. A disabled `button` and a node whose
50
+ * own click is still running ignore the call.
51
51
  * @param nodeId - the node to click
52
52
  * @throws TypeError when `nodeId` is malformed
53
+ * @throws TypeError when `nodeId` names no node
53
54
  */
54
55
  export declare function click(nodeId: NodeId): void;
55
56
  /**
@@ -59,6 +60,8 @@ export declare function click(nodeId: NodeId): void;
59
60
  * is optional. The scroll containers around the node scroll it into view.
60
61
  * @param nodeId - the node to focus
61
62
  * @param preventScroll - `true` to leave the scroll containers in place; omitted or `false` scrolls the node into view
63
+ * @throws TypeError when `nodeId` is malformed
64
+ * @throws TypeError when `nodeId` names no node
62
65
  */
63
66
  export declare function focus(nodeId: NodeId, preventScroll?: boolean): void;
64
67
  /**
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-6SBsiUWz.js";
1
+ import { t as e } from "./chunks/hooks-D1NFQN8Q.js";
2
+ import { t } from "./chunks/handle-DdYIkUcm.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-DEtME8eI.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-6SBsiUWz.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-NnTAUL80.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-D1NFQN8Q.js";
3
+ import { n as R } from "./chunks/handle-DdYIkUcm.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/types.d.mts CHANGED
@@ -30,7 +30,8 @@ export type Overflow = "visible" | "hidden" | "clip" | "scroll" | "auto";
30
30
  * overload checks. A deliberately incomplete, v1 layout/paint vocabulary. The
31
31
  * renderer also reads the camelCase and kebab-case spellings. An unrecognized
32
32
  * key or a value shape that doesn't parse (e.g. a malformed enum string) is
33
- * 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).
34
35
  */
35
36
  export interface StyleProps {
36
37
  /** Layout mode for this node's children. `"none"` skips both layout and rendering for the whole subtree. */
@@ -41,13 +42,13 @@ export interface StyleProps {
41
42
  justify_content?: "start" | "end" | "center" | "stretch";
42
43
  /** Cross-axis alignment of children within this container. */
43
44
  align_items?: "start" | "end" | "center" | "stretch";
44
- /** Uniform spacing, in px, between children, applied on both axes. */
45
+ /** Uniform spacing, in px (`>= 0`), between children, applied on both axes. */
45
46
  gap?: number;
46
- /** Fixed width in px, or `"auto"` to size to content. */
47
+ /** Fixed width in px (`>= 0`), or `"auto"` to size to content. */
47
48
  width?: number | "auto";
48
- /** Fixed height in px, or `"auto"` to size to content. */
49
+ /** Fixed height in px (`>= 0`), or `"auto"` to size to content. */
49
50
  height?: number | "auto";
50
- /** Uniform border width in px, applied to all four sides. */
51
+ /** Uniform border width in px (`>= 0`), applied to all four sides. */
51
52
  border_width?: number;
52
53
  /** Fill color, as a hex number (`0xRRGGBB`) or a CSS-style string (`"#rrggbb"`/`"#rgb"`). */
53
54
  background?: number | string;
@@ -55,9 +56,9 @@ export interface StyleProps {
55
56
  border_color?: number | string;
56
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. */
57
58
  text_color?: number | string;
58
- /** Uniform corner radius in px, applied to all four corners. */
59
+ /** Uniform corner radius in px (`>= 0`), applied to all four corners. */
59
60
  corner_radius?: number;
60
- /** 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}. */
61
62
  text_size?: number;
62
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}. */
63
64
  overflow?: Overflow | `${Overflow} ${Overflow}`;
@@ -99,13 +100,13 @@ export interface StyleProps {
99
100
  flex_shrink?: number;
100
101
  /** Opacity from `0` to `1`, applied to this node and its descendants; values outside are clamped. */
101
102
  opacity?: number;
102
- /** Minimum width in px, or `"auto"` for the default minimum. */
103
+ /** Minimum width in px (`>= 0`), or `"auto"` for the default minimum. */
103
104
  min_width?: number | "auto";
104
- /** Minimum height in px, or `"auto"` for the default minimum. */
105
+ /** Minimum height in px (`>= 0`), or `"auto"` for the default minimum. */
105
106
  min_height?: number | "auto";
106
- /** Maximum width in px, or `"auto"` for no limit. */
107
+ /** Maximum width in px (`>= 0`), or `"auto"` for no limit. */
107
108
  max_width?: number | "auto";
108
- /** Maximum height in px, or `"auto"` for no limit. */
109
+ /** Maximum height in px (`>= 0`), or `"auto"` for no limit. */
109
110
  max_height?: number | "auto";
110
111
  }
111
112
  /**
@@ -66,12 +66,13 @@ import { IncaCore, IncaElement } from '../rendererCore.mts';
66
66
  * ### Other props
67
67
  *
68
68
  * A string, number or boolean `nextValue` goes to `core.setAttribute` as it
69
- * is. A `disabled`, `hidden` or `inert` set to `false` goes to
70
- * `core.removeAttribute`, as does a `null` or `undefined` `nextValue`, which
71
- * includes a prop that is absent from the new vnode. Any other value (an
72
- * object, array, function or symbol) goes to `core.setAttribute` as
73
- * `String(nextValue)`. An `onUpdate:` key is a component event and sets
74
- * nothing.
69
+ * is. A `null` or `undefined` `nextValue` goes to `core.removeAttribute`,
70
+ * which includes a prop that is absent from the new vnode. So does any falsy
71
+ * value other than `""` for a boolean attribute: `disabled`, `hidden`,
72
+ * `inert`, and the names Vue treats as boolean attributes, such as
73
+ * `readonly`. Any other value (an object, array, function or symbol) goes to
74
+ * `core.setAttribute` as `String(nextValue)`. An `onUpdate:` key is a
75
+ * component event and sets nothing.
75
76
  *
76
77
  * @param core - the incajs bindings to drive the native tree through
77
78
  */
package/dist/vue.js CHANGED
@@ -1,6 +1,6 @@
1
- import { t as e } from "./chunks/rendererCore-DEtME8eI.js";
2
- import { m as t } from "./chunks/hooks-BgB7lzTv.js";
3
- import { n } from "./chunks/handle-6SBsiUWz.js";
1
+ import { t as e } from "./chunks/rendererCore-NnTAUL80.js";
2
+ import { m as t } from "./chunks/hooks-D1NFQN8Q.js";
3
+ import { n } from "./chunks/handle-DdYIkUcm.js";
4
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
6
  function s(e) {
@@ -141,11 +141,18 @@ function E(e, t, n, r, i) {
141
141
  var D = /* @__PURE__ */ new Set([
142
142
  "disabled",
143
143
  "hidden",
144
- "inert"
144
+ "inert",
145
+ "allowfullscreen",
146
+ "formnovalidate",
147
+ "ismap",
148
+ "itemscope",
149
+ "nomodule",
150
+ "novalidate",
151
+ "readonly"
145
152
  ]);
146
153
  function O(e) {
147
154
  return (t, n, r, i, a, o) => {
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)));
155
+ 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 && 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)));
149
156
  };
150
157
  }
151
158
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incajs",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
5
5
  "keywords": [
6
6
  "cross-platform",