incajs 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chunks/{rendererCore-CIXQ3Bp7.js → rendererCore-vR5RIa7d.js} +10 -6
- package/dist/native.d.mts +1 -0
- package/dist/rendererCore.d.mts +1 -1
- package/dist/rendererCore.js +2 -2
- package/dist/tree.d.mts +7 -0
- package/dist/vue/patchProp.d.mts +6 -3
- package/dist/vue/runtime.d.mts +2 -0
- package/dist/vue-runtime.js +3 -0
- package/dist/vue.js +5 -5
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ framework. No Chromium, no DOM: UI renders directly on the GPU via
|
|
|
19
19
|
own root container instead of a DOM element; `app.mount()` with no
|
|
20
20
|
argument targets it, and `app.unmount`, `app.use`, etc. behave exactly
|
|
21
21
|
as `@vue/runtime-core` documents them.
|
|
22
|
-
-
|
|
23
|
-
|
|
22
|
+
- To use Vue, install `vue` next to `incajs`. It brings the peer
|
|
23
|
+
dependencies `@vue/runtime-core` and `@vue/runtime-dom`.
|
|
24
24
|
|
|
25
25
|
Part of [tom96da/incajs](https://github.com/tom96da/incajs).
|
|
@@ -86,15 +86,18 @@ function v(e) {
|
|
|
86
86
|
function y(e, t, r) {
|
|
87
87
|
n().setAttribute(e, t, r);
|
|
88
88
|
}
|
|
89
|
-
function b(e, t
|
|
89
|
+
function b(e, t) {
|
|
90
|
+
n().removeAttribute(e, t);
|
|
91
|
+
}
|
|
92
|
+
function x(e, t, r) {
|
|
90
93
|
n().setStyle(e, t, r);
|
|
91
94
|
}
|
|
92
|
-
function
|
|
95
|
+
function S(e, t) {
|
|
93
96
|
n().removeStyle(e, t);
|
|
94
97
|
}
|
|
95
98
|
//#endregion
|
|
96
99
|
//#region src/rendererCore.mts
|
|
97
|
-
var
|
|
100
|
+
var C = /* @__PURE__ */ t({
|
|
98
101
|
appendChild: () => h,
|
|
99
102
|
blur: () => f,
|
|
100
103
|
createNode: () => m,
|
|
@@ -102,13 +105,14 @@ var S = /* @__PURE__ */ t({
|
|
|
102
105
|
focus: () => d,
|
|
103
106
|
insertBefore: () => g,
|
|
104
107
|
latestEventId: () => o,
|
|
108
|
+
removeAttribute: () => b,
|
|
105
109
|
removeChild: () => _,
|
|
106
110
|
removeEventListener: () => u,
|
|
107
|
-
removeStyle: () =>
|
|
111
|
+
removeStyle: () => S,
|
|
108
112
|
rootNodeId: () => p,
|
|
109
113
|
setAttribute: () => y,
|
|
110
114
|
setEventListener: () => l,
|
|
111
|
-
setStyle: () =>
|
|
115
|
+
setStyle: () => x
|
|
112
116
|
});
|
|
113
117
|
//#endregion
|
|
114
|
-
export { g as a,
|
|
118
|
+
export { g as a, S as c, x as d, f, l as g, u as h, v as i, p as l, o as m, h as n, b as o, d as p, m as r, _ as s, C as t, y as u };
|
package/dist/native.d.mts
CHANGED
|
@@ -7,6 +7,7 @@ interface IncaNative {
|
|
|
7
7
|
insertBefore(parentId: NodeId, childId: NodeId, anchorId: NodeId | null): void;
|
|
8
8
|
removeChild(parentId: NodeId, childId: NodeId): void;
|
|
9
9
|
setAttribute(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
10
|
+
removeAttribute(nodeId: NodeId, key: string): void;
|
|
10
11
|
setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
11
12
|
removeStyle(nodeId: NodeId, key: string): void;
|
|
12
13
|
addEventListener(nodeId: NodeId, event: string, callbackId: CallbackId): void;
|
package/dist/rendererCore.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { setEventListener, removeEventListener, latestEventId, focus, blur } from './events.mts';
|
|
2
|
-
export { appendChild, createNode, destroyNode, insertBefore, removeChild, rootNodeId, setAttribute, setStyle, removeStyle, } from './tree.mts';
|
|
2
|
+
export { appendChild, createNode, destroyNode, insertBefore, removeChild, rootNodeId, setAttribute, removeAttribute, setStyle, removeStyle, } from './tree.mts';
|
|
3
3
|
/**
|
|
4
4
|
* The tree/event primitives a custom renderer (`incajs/vue`) drives the
|
|
5
5
|
* native tree through.
|
package/dist/rendererCore.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r,
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, c as t, d as n, f as r, g as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, u as m } from "./chunks/rendererCore-vR5RIa7d.js";
|
|
2
|
+
export { l as appendChild, r as blur, f as createNode, o as destroyNode, d as focus, e as insertBefore, c as latestEventId, u as removeAttribute, p as removeChild, a as removeEventListener, t as removeStyle, s as rootNodeId, m as setAttribute, i as setEventListener, n as setStyle };
|
package/dist/tree.d.mts
CHANGED
|
@@ -57,6 +57,13 @@ export declare function destroyNode(nodeId: NodeId): void;
|
|
|
57
57
|
* @param value - the attribute value
|
|
58
58
|
*/
|
|
59
59
|
export declare function setAttribute(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
60
|
+
/**
|
|
61
|
+
* Removes a non-style attribute/prop from `nodeId`. Removing an attribute
|
|
62
|
+
* that isn't set does nothing.
|
|
63
|
+
* @param nodeId - the node to update
|
|
64
|
+
* @param key - the attribute name
|
|
65
|
+
*/
|
|
66
|
+
export declare function removeAttribute(nodeId: NodeId, key: string): void;
|
|
60
67
|
/**
|
|
61
68
|
* Sets a style property on `nodeId` — the only way to reach {@link setAttribute}'s
|
|
62
69
|
* counterpart style map. A key from {@link StyleProps} gets compile-time
|
package/dist/vue/patchProp.d.mts
CHANGED
|
@@ -44,9 +44,12 @@ import { IncaElement } from './nodeOps.mts';
|
|
|
44
44
|
*
|
|
45
45
|
* ### Other props
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* A string, number or boolean `nextValue` goes to `core.setAttribute` as it
|
|
48
|
+
* is. A `null` or `undefined` `nextValue`, which includes a prop that is
|
|
49
|
+
* absent from the new vnode, goes to `core.removeAttribute`. Any other value
|
|
50
|
+
* (an object, array, function or symbol) goes to `core.setAttribute` as
|
|
51
|
+
* `String(nextValue)`. An `onUpdate:` key is a component event and sets
|
|
52
|
+
* nothing.
|
|
50
53
|
*
|
|
51
54
|
* @param core - the incajs bindings to drive the native tree through
|
|
52
55
|
*/
|
package/dist/vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as e, l as t, p as n, t as r } from "./chunks/rendererCore-vR5RIa7d.js";
|
|
2
2
|
import { ErrorCodes as i, callWithAsyncErrorHandling as a, createRenderer as o } from "@vue/runtime-core";
|
|
3
3
|
//#region src/vue/nodeOps.mts
|
|
4
4
|
function s(e) {
|
|
@@ -79,7 +79,7 @@ function s(e) {
|
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/vue/patchProp.mts
|
|
82
|
-
var c = (e) => /^on[A-Z]/.test(e), l = /(?:Once|Passive|Capture)$/;
|
|
82
|
+
var c = (e) => /^on[A-Z]/.test(e) && !e.startsWith("onUpdate:"), l = /(?:Once|Passive|Capture)$/;
|
|
83
83
|
function u(e) {
|
|
84
84
|
let t = e, n = !1, r;
|
|
85
85
|
for (; r = t.match(l);) t = t.slice(0, -r[0].length), r[0] === "Once" && (n = !0);
|
|
@@ -184,7 +184,7 @@ function b(e, t, n, r, i) {
|
|
|
184
184
|
}
|
|
185
185
|
function x(e) {
|
|
186
186
|
return (t, n, r, i, a, o) => {
|
|
187
|
-
n === "style" ? p(e, t, i) : c(n) ? b(e, t, n, i, o ?? null) :
|
|
187
|
+
n === "style" ? p(e, t, i) : c(n) ? b(e, t, n, i, o ?? null) : typeof i == "string" || typeof i == "number" || typeof i == "boolean" ? e.setAttribute(t.id, n, i) : i == null ? e.removeAttribute(t.id, n) : n.startsWith("onUpdate:") || e.setAttribute(t.id, n, String(i));
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
//#endregion
|
|
@@ -195,14 +195,14 @@ function S(i, a) {
|
|
|
195
195
|
patchProp: x(r)
|
|
196
196
|
}).createApp(i, a), l = c.mount.bind(c);
|
|
197
197
|
function u() {
|
|
198
|
-
let r =
|
|
198
|
+
let r = t();
|
|
199
199
|
return {
|
|
200
200
|
id: r,
|
|
201
201
|
kind: "element",
|
|
202
202
|
parent: null,
|
|
203
203
|
children: [],
|
|
204
204
|
focus: () => n(r),
|
|
205
|
-
blur: () =>
|
|
205
|
+
blur: () => e(r)
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
return Object.assign(c, { mount: (e) => l(e ?? u()) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incajs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-platform",
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"./vue": {
|
|
42
42
|
"types": "./dist/vue/index.d.mts",
|
|
43
43
|
"import": "./dist/vue.js"
|
|
44
|
+
},
|
|
45
|
+
"./vue/runtime": {
|
|
46
|
+
"types": "./dist/vue/runtime.d.mts",
|
|
47
|
+
"import": "./dist/vue-runtime.js"
|
|
44
48
|
}
|
|
45
49
|
},
|
|
46
50
|
"publishConfig": {
|
|
@@ -48,15 +52,20 @@
|
|
|
48
52
|
},
|
|
49
53
|
"devDependencies": {
|
|
50
54
|
"@vue/runtime-core": "^3.5.43",
|
|
55
|
+
"@vue/runtime-dom": "^3.5.43",
|
|
51
56
|
"oxfmt": "^0.71.0",
|
|
52
57
|
"oxlint": "^1.86.0"
|
|
53
58
|
},
|
|
54
59
|
"peerDependencies": {
|
|
55
|
-
"@vue/runtime-core": "^3.5.43"
|
|
60
|
+
"@vue/runtime-core": "^3.5.43",
|
|
61
|
+
"@vue/runtime-dom": "^3.5.43"
|
|
56
62
|
},
|
|
57
63
|
"peerDependenciesMeta": {
|
|
58
64
|
"@vue/runtime-core": {
|
|
59
65
|
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"@vue/runtime-dom": {
|
|
68
|
+
"optional": true
|
|
60
69
|
}
|
|
61
70
|
},
|
|
62
71
|
"engines": {
|