incajs 0.0.15 → 0.0.16
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 +1 -1
- package/dist/callbacks.d.mts +43 -0
- package/dist/chunks/handle-B1h0qxex.js +193 -0
- package/dist/chunks/rendererCore-U_s1R1v7.js +171 -0
- package/dist/element/geometry.d.mts +65 -0
- package/dist/{vue/createElement.d.mts → element/handle.d.mts} +7 -1
- package/dist/{vue/elements.d.mts → element/lifecycle.d.mts} +13 -1
- package/dist/{vue/scrollPosition.d.mts → element/scroll.d.mts} +23 -1
- package/dist/element/shadowTree.d.mts +71 -0
- package/dist/element/types.d.mts +119 -0
- package/dist/events.d.mts +2 -18
- package/dist/index.d.mts +4 -0
- package/dist/index.js +4 -3
- package/dist/native.d.mts +5 -2
- package/dist/rendererCore.d.mts +3 -3
- package/dist/rendererCore.js +1 -37
- package/dist/tree.d.mts +11 -6
- package/dist/types.d.mts +3 -4
- package/dist/vue/createApp.d.mts +1 -1
- package/dist/vue/index.d.mts +0 -6
- package/dist/vue/nodeOps.d.mts +10 -122
- package/dist/vue/patchProp.d.mts +2 -2
- package/dist/vue.js +97 -293
- package/package.json +1 -1
- package/dist/chunks/tree-Ds0zSuJO.js +0 -143
- package/dist/vue/activeElement.d.mts +0 -7
- package/dist/vue/destroyedNodes.d.mts +0 -13
- package/dist/vue/layoutBox.d.mts +0 -12
- package/dist/vue/offsetOf.d.mts +0 -14
- package/dist/vue/offsetParent.d.mts +0 -10
- package/dist/vue/rectOf.d.mts +0 -25
- package/dist/vue/scrollIntoViewArgs.d.mts +0 -22
- package/dist/vue/skipReactive.d.mts +0 -8
- package/dist/vue/tabIndexOf.d.mts +0 -9
- /package/dist/{createEventTarget.d.mts → eventTarget.d.mts} +0 -0
package/dist/vue.js
CHANGED
|
@@ -1,294 +1,104 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ErrorCodes as
|
|
4
|
-
//#region src/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { f as e, t } from "./chunks/rendererCore-U_s1R1v7.js";
|
|
2
|
+
import { n, r } from "./chunks/handle-B1h0qxex.js";
|
|
3
|
+
import { ErrorCodes as i, callWithAsyncErrorHandling as a, createRenderer as o } from "@vue/runtime-core";
|
|
4
|
+
//#region src/element/shadowTree.mts
|
|
5
|
+
function s(e, t) {
|
|
6
|
+
let r = e.createNode(t);
|
|
7
|
+
return n(e, r, "element", t);
|
|
8
|
+
}
|
|
9
|
+
function c(e, t) {
|
|
10
|
+
let n = e.createNode("text");
|
|
11
|
+
return e.setAttribute(n, "value", t), {
|
|
12
|
+
id: n,
|
|
13
|
+
kind: "text",
|
|
14
|
+
parent: null,
|
|
15
|
+
text: t
|
|
16
|
+
};
|
|
10
17
|
}
|
|
11
18
|
function l(e) {
|
|
12
|
-
|
|
19
|
+
let t = e.createNode("div");
|
|
20
|
+
return e.setStyle(t, "display", "none"), n(e, t, "comment");
|
|
13
21
|
}
|
|
14
|
-
function u(e) {
|
|
15
|
-
|
|
22
|
+
function u(e, t, n) {
|
|
23
|
+
e.setAttribute(t.id, "value", n), t.text = n;
|
|
24
|
+
}
|
|
25
|
+
function d(e, t, n) {
|
|
26
|
+
for (let n of t.children.splice(0)) e.destroyNode(n.id), r(n), n.parent = null;
|
|
27
|
+
if (!n) return;
|
|
28
|
+
let i = c(e, n);
|
|
29
|
+
e.appendChild(t.id, i.id), i.parent = t, t.children.push(i);
|
|
16
30
|
}
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/vue/destroyedNodes.mts
|
|
19
|
-
var d = /* @__PURE__ */ new WeakSet();
|
|
20
31
|
function f(e) {
|
|
21
|
-
|
|
32
|
+
let t = e.parent;
|
|
33
|
+
if (!t) return;
|
|
34
|
+
let n = t.children.indexOf(e);
|
|
35
|
+
n !== -1 && t.children.splice(n, 1), e.parent = null;
|
|
22
36
|
}
|
|
23
|
-
function p(e) {
|
|
24
|
-
|
|
25
|
-
l(e.id);
|
|
26
|
-
for (let t of e.children) p(t);
|
|
27
|
-
}
|
|
37
|
+
function p(e, t) {
|
|
38
|
+
t.parent && e.removeChild(t.parent.id, t.id), f(t);
|
|
28
39
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
function m(e, t, n, r) {
|
|
41
|
+
if (r === t && t.parent === n) return;
|
|
42
|
+
p(e, t);
|
|
43
|
+
let i = r ? n.children.indexOf(r) : -1;
|
|
44
|
+
e.insertBefore(n.id, t.id, r && i !== -1 ? r.id : null), i === -1 ? n.children.push(t) : n.children.splice(i, 0, t), t.parent = n;
|
|
33
45
|
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/vue/offsetParent.mts
|
|
36
46
|
function h(e, t) {
|
|
37
|
-
|
|
38
|
-
return !m(e, t) || !n || !m(e, n) ? null : n;
|
|
47
|
+
f(t), e.destroyNode(t.id), r(t);
|
|
39
48
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
function g(e, t) {
|
|
43
|
-
let n = m(e, t);
|
|
44
|
-
if (!n) return {
|
|
45
|
-
left: 0,
|
|
46
|
-
top: 0
|
|
47
|
-
};
|
|
48
|
-
let r = h(e, t), i = r ? m(e, r) : null;
|
|
49
|
-
return {
|
|
50
|
-
left: Math.round(n[0] - (i ? i[0] + i[4] : 0) + n[5]) || 0,
|
|
51
|
-
top: Math.round(n[1] - (i ? i[1] + i[4] : 0) + n[6]) || 0
|
|
52
|
-
};
|
|
49
|
+
function g(e) {
|
|
50
|
+
return e.parent;
|
|
53
51
|
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/vue/rectOf.mts
|
|
56
52
|
function _(e) {
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
0,
|
|
62
|
-
0
|
|
63
|
-
], a = {
|
|
64
|
-
x: t,
|
|
65
|
-
y: n,
|
|
66
|
-
width: r,
|
|
67
|
-
height: i,
|
|
68
|
-
top: n,
|
|
69
|
-
left: t,
|
|
70
|
-
right: t + r,
|
|
71
|
-
bottom: n + i
|
|
72
|
-
};
|
|
73
|
-
return {
|
|
74
|
-
...a,
|
|
75
|
-
toJSON: () => ({ ...a })
|
|
76
|
-
};
|
|
53
|
+
let t = e.parent;
|
|
54
|
+
if (!t) return null;
|
|
55
|
+
let n = t.children.indexOf(e);
|
|
56
|
+
return t.children[n + 1] ?? null;
|
|
77
57
|
}
|
|
78
58
|
//#endregion
|
|
79
|
-
//#region src/vue/
|
|
59
|
+
//#region src/vue/nodeOps.mts
|
|
80
60
|
function v(e) {
|
|
81
|
-
let t = [
|
|
82
|
-
"start",
|
|
83
|
-
"center",
|
|
84
|
-
"end",
|
|
85
|
-
"nearest"
|
|
86
|
-
];
|
|
87
|
-
return typeof e == "object" && e ? {
|
|
88
|
-
block: t.includes(e.block ?? "") ? e.block : "start",
|
|
89
|
-
inline: t.includes(e.inline ?? "") ? e.inline : "nearest"
|
|
90
|
-
} : {
|
|
91
|
-
block: e === !1 ? "end" : "start",
|
|
92
|
-
inline: "nearest"
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/vue/scrollPosition.mts
|
|
97
|
-
function y(e, t, n, r) {
|
|
98
|
-
if (f(t)) return;
|
|
99
|
-
let [i, a] = n, [o, s] = typeof i == "object" ? [i?.left, i?.top] : [i, a], [c, l] = r ? e.scrollOf(t.id) ?? [0, 0] : [0, 0], u = (e, t) => {
|
|
100
|
-
if (e === void 0) return null;
|
|
101
|
-
let n = Number(e);
|
|
102
|
-
return (r ? t : 0) + (Number.isFinite(n) ? n : 0);
|
|
103
|
-
};
|
|
104
|
-
e.scrollNode(t.id, u(o, c), u(s, l));
|
|
105
|
-
}
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/vue/skipReactive.mts
|
|
108
|
-
function b(e) {
|
|
109
61
|
return Object.defineProperty(e, "__v_skip", { value: !0 }), e;
|
|
110
62
|
}
|
|
111
|
-
|
|
112
|
-
//#region src/vue/tabIndexOf.mts
|
|
113
|
-
function x(e, t) {
|
|
114
|
-
let n = t === "button" ? 0 : -1;
|
|
115
|
-
if (typeof e != "string" && typeof e != "number") return n;
|
|
116
|
-
let r = /^[\t\n\f\r ]*([+-]?\d+)/.exec(String(e));
|
|
117
|
-
if (!r) return n;
|
|
118
|
-
let i = Number(r[1]) || 0;
|
|
119
|
-
return i >= -2147483648 && i <= 2147483647 ? i : n;
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/vue/createElement.mts
|
|
123
|
-
function S(e, t, n, r) {
|
|
124
|
-
let i = e.createEventTarget(() => t), a = () => f(o) ? null : e.scrollOf(t), o = {
|
|
125
|
-
id: t,
|
|
126
|
-
kind: n,
|
|
127
|
-
parent: null,
|
|
128
|
-
children: [],
|
|
129
|
-
focus: (n) => {
|
|
130
|
-
if (f(o)) return;
|
|
131
|
-
let r = n?.preventScroll;
|
|
132
|
-
r === void 0 ? e.focus(t) : e.focus(t, !!r);
|
|
133
|
-
},
|
|
134
|
-
blur: () => e.blur(t),
|
|
135
|
-
click: () => e.click(t),
|
|
136
|
-
addEventListener: (...e) => {
|
|
137
|
-
f(o) || i.addEventListener(...e);
|
|
138
|
-
},
|
|
139
|
-
removeEventListener: (...e) => {
|
|
140
|
-
f(o) || i.removeEventListener(...e);
|
|
141
|
-
},
|
|
142
|
-
dispatchEvent: (e) => f(o) || i.dispatchEvent(e),
|
|
143
|
-
get tabIndex() {
|
|
144
|
-
return x(f(o) ? null : e.getAttribute(t, "tabindex"), r ?? "");
|
|
145
|
-
},
|
|
146
|
-
set tabIndex(n) {
|
|
147
|
-
f(o) || e.setAttribute(t, "tabindex", n | 0);
|
|
148
|
-
},
|
|
149
|
-
getBoundingClientRect: () => _(m(e, o)),
|
|
150
|
-
get offsetWidth() {
|
|
151
|
-
return Math.round(m(e, o)?.[2] ?? 0);
|
|
152
|
-
},
|
|
153
|
-
get offsetHeight() {
|
|
154
|
-
return Math.round(m(e, o)?.[3] ?? 0);
|
|
155
|
-
},
|
|
156
|
-
get offsetLeft() {
|
|
157
|
-
return g(e, o).left;
|
|
158
|
-
},
|
|
159
|
-
get offsetTop() {
|
|
160
|
-
return g(e, o).top;
|
|
161
|
-
},
|
|
162
|
-
get offsetParent() {
|
|
163
|
-
return h(e, o);
|
|
164
|
-
},
|
|
165
|
-
get clientWidth() {
|
|
166
|
-
let t = m(e, o);
|
|
167
|
-
return t ? Math.max(0, Math.round(t[2] - 2 * t[4])) : 0;
|
|
168
|
-
},
|
|
169
|
-
get clientHeight() {
|
|
170
|
-
let t = m(e, o);
|
|
171
|
-
return t ? Math.max(0, Math.round(t[3] - 2 * t[4])) : 0;
|
|
172
|
-
},
|
|
173
|
-
get clientLeft() {
|
|
174
|
-
return Math.round(m(e, o)?.[4] ?? 0);
|
|
175
|
-
},
|
|
176
|
-
get clientTop() {
|
|
177
|
-
return Math.round(m(e, o)?.[4] ?? 0);
|
|
178
|
-
},
|
|
179
|
-
get scrollLeft() {
|
|
180
|
-
return a()?.[0] ?? 0;
|
|
181
|
-
},
|
|
182
|
-
set scrollLeft(t) {
|
|
183
|
-
y(e, o, [t], !1);
|
|
184
|
-
},
|
|
185
|
-
get scrollTop() {
|
|
186
|
-
return a()?.[1] ?? 0;
|
|
187
|
-
},
|
|
188
|
-
set scrollTop(t) {
|
|
189
|
-
y(e, o, [void 0, t], !1);
|
|
190
|
-
},
|
|
191
|
-
get scrollWidth() {
|
|
192
|
-
return o.clientWidth + Math.round(a()?.[2] ?? 0);
|
|
193
|
-
},
|
|
194
|
-
get scrollHeight() {
|
|
195
|
-
return o.clientHeight + Math.round(a()?.[3] ?? 0);
|
|
196
|
-
},
|
|
197
|
-
scrollTo: (...t) => y(e, o, t, !1),
|
|
198
|
-
scrollBy: (...t) => y(e, o, t, !0),
|
|
199
|
-
scrollIntoView: (n) => {
|
|
200
|
-
if (f(o)) return;
|
|
201
|
-
let { block: r, inline: i } = v(n);
|
|
202
|
-
e.scrollIntoViewNode(t, r, i);
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
return n === "element" && c(o), b(o);
|
|
206
|
-
}
|
|
207
|
-
//#endregion
|
|
208
|
-
//#region src/vue/nodeOps.mts
|
|
209
|
-
function C(e) {
|
|
210
|
-
function t(t) {
|
|
211
|
-
let n = e.createNode("text");
|
|
212
|
-
return e.setAttribute(n, "value", t), b({
|
|
213
|
-
id: n,
|
|
214
|
-
kind: "text",
|
|
215
|
-
parent: null,
|
|
216
|
-
text: t
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
function n(e) {
|
|
220
|
-
let t = e.parent;
|
|
221
|
-
if (!t) return;
|
|
222
|
-
let n = t.children.indexOf(e);
|
|
223
|
-
n !== -1 && t.children.splice(n, 1), e.parent = null;
|
|
224
|
-
}
|
|
225
|
-
function r(t) {
|
|
226
|
-
t.parent && e.removeChild(t.parent.id, t.id), n(t);
|
|
227
|
-
}
|
|
63
|
+
function y(e) {
|
|
228
64
|
return {
|
|
229
|
-
createElement(t)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
e.setAttribute(t.id, "value", n), t.text = n;
|
|
239
|
-
},
|
|
240
|
-
setElementText(n, r) {
|
|
241
|
-
for (let t of n.children.splice(0)) e.destroyNode(t.id), p(t), t.parent = null;
|
|
242
|
-
if (!r) return;
|
|
243
|
-
let i = t(r);
|
|
244
|
-
e.appendChild(n.id, i.id), i.parent = n, n.children.push(i);
|
|
245
|
-
},
|
|
246
|
-
insert(t, n, i) {
|
|
247
|
-
if (i === t && t.parent === n) return;
|
|
248
|
-
r(t);
|
|
249
|
-
let a = i ? n.children.indexOf(i) : -1;
|
|
250
|
-
e.insertBefore(n.id, t.id, i && a !== -1 ? i.id : null), a === -1 ? n.children.push(t) : n.children.splice(a, 0, t), t.parent = n;
|
|
251
|
-
},
|
|
252
|
-
remove(t) {
|
|
253
|
-
n(t), e.destroyNode(t.id), p(t);
|
|
254
|
-
},
|
|
255
|
-
parentNode(e) {
|
|
256
|
-
return e.parent;
|
|
257
|
-
},
|
|
258
|
-
nextSibling(e) {
|
|
259
|
-
let t = e.parent;
|
|
260
|
-
if (!t) return null;
|
|
261
|
-
let n = t.children.indexOf(e);
|
|
262
|
-
return t.children[n + 1] ?? null;
|
|
263
|
-
}
|
|
65
|
+
createElement: (t) => v(s(e, t)),
|
|
66
|
+
createText: (t) => v(c(e, t)),
|
|
67
|
+
createComment: (t) => v(l(e)),
|
|
68
|
+
setText: (t, n) => u(e, t, n),
|
|
69
|
+
setElementText: (t, n) => d(e, t, n),
|
|
70
|
+
insert: (t, n, r) => m(e, t, n, r),
|
|
71
|
+
remove: (t) => h(e, t),
|
|
72
|
+
parentNode: g,
|
|
73
|
+
nextSibling: _
|
|
264
74
|
};
|
|
265
75
|
}
|
|
266
76
|
//#endregion
|
|
267
77
|
//#region src/vue/patchProp.mts
|
|
268
|
-
var
|
|
269
|
-
function
|
|
78
|
+
var b = (e) => /^on[^a-z]/.test(e) && !e.startsWith("onUpdate:"), x = /(?:Once|Passive|Capture)$/, S = /^on:?(?:Once|Passive|Capture)$/, C = (e) => e.replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
79
|
+
function w(e) {
|
|
270
80
|
let t = e, n = {
|
|
271
81
|
event: "",
|
|
272
82
|
once: !1,
|
|
273
83
|
capture: !1,
|
|
274
84
|
passive: !1
|
|
275
85
|
}, r;
|
|
276
|
-
for (; (r = t.match(
|
|
277
|
-
return n.event = t[2] === ":" ? t.slice(3) :
|
|
86
|
+
for (; (r = t.match(x)) && !S.test(t);) t = t.slice(0, -r[0].length), r[0] === "Once" ? n.once = !0 : r[0] === "Capture" ? n.capture = !0 : n.passive = !0;
|
|
87
|
+
return n.event = t[2] === ":" ? t.slice(3) : C(t.slice(2)), n;
|
|
278
88
|
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
let r = typeof n == "object" && n ? n : {}, i =
|
|
282
|
-
i ||
|
|
89
|
+
var T = (e) => typeof e == "string" || typeof e == "number", E = /* @__PURE__ */ new WeakMap();
|
|
90
|
+
function D(e, t, n) {
|
|
91
|
+
let r = typeof n == "object" && n ? n : {}, i = E.get(t);
|
|
92
|
+
i || E.set(t, i = /* @__PURE__ */ new Map());
|
|
283
93
|
let a = !1;
|
|
284
|
-
for (let n of i.keys())
|
|
285
|
-
for (let [n, o] of Object.entries(r))
|
|
94
|
+
for (let n of i.keys()) T(r[n]) || (e.removeStyle(t.id, n), i.delete(n), a = !0);
|
|
95
|
+
for (let [n, o] of Object.entries(r)) T(o) && (a || i.get(n) !== o) && (e.setStyle(t.id, n, o), i.set(n, o));
|
|
286
96
|
}
|
|
287
|
-
function
|
|
97
|
+
function O(e) {
|
|
288
98
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "function");
|
|
289
99
|
return t.length === 0 ? null : t;
|
|
290
100
|
}
|
|
291
|
-
function
|
|
101
|
+
function k(e, t) {
|
|
292
102
|
let n = e[0];
|
|
293
103
|
if (typeof n != "object" || !n) return t(() => !1);
|
|
294
104
|
let r = n.stopImmediatePropagation;
|
|
@@ -305,32 +115,32 @@ function N(e, t) {
|
|
|
305
115
|
i ? n.stopImmediatePropagation = r : delete n.stopImmediatePropagation;
|
|
306
116
|
}
|
|
307
117
|
}
|
|
308
|
-
var
|
|
309
|
-
function
|
|
118
|
+
var A = /* @__PURE__ */ new WeakMap(), j = ({ event: e, capture: t, passive: n }) => `${e}:${t === !0}:${n === !0}`;
|
|
119
|
+
function M(e, t, n, r) {
|
|
310
120
|
let i = Array.from(r.slots.values()).some((e) => !e.fired);
|
|
311
|
-
i && !r.registered ? (e.addEventListener(t.id, r.event, r.dispatcher, r.options), r.registered = !0) : !i && r.registered && (r.registered = !1, e.removeEventListener(t.id, r.event, r.dispatcher, r.options)), r.slots.size === 0 &&
|
|
121
|
+
i && !r.registered ? (e.addEventListener(t.id, r.event, r.dispatcher, r.options), r.registered = !0) : !i && r.registered && (r.registered = !1, e.removeEventListener(t.id, r.event, r.dispatcher, r.options)), r.slots.size === 0 && A.get(t)?.delete(n);
|
|
312
122
|
}
|
|
313
|
-
function
|
|
123
|
+
function N(e, t, n, { event: r, capture: o, passive: s }) {
|
|
314
124
|
let c = {
|
|
315
|
-
event:
|
|
125
|
+
event: r,
|
|
316
126
|
options: {
|
|
317
127
|
capture: o,
|
|
318
128
|
passive: s
|
|
319
129
|
},
|
|
320
130
|
slots: /* @__PURE__ */ new Map(),
|
|
321
131
|
registered: !1,
|
|
322
|
-
dispatcher: (...
|
|
323
|
-
let o = [], s =
|
|
324
|
-
|
|
132
|
+
dispatcher: (...r) => {
|
|
133
|
+
let o = [], s = r[0]?.eventId;
|
|
134
|
+
k(r, (l) => {
|
|
325
135
|
for (let u of Array.from(c.slots.keys())) {
|
|
326
136
|
if (l()) break;
|
|
327
137
|
let d = c.slots.get(u);
|
|
328
138
|
if (d && !d.fired && !(typeof s == "number" && d.attachedAt >= s)) {
|
|
329
|
-
d.once && (d.fired = !0,
|
|
139
|
+
d.once && (d.fired = !0, M(e, t, n, c));
|
|
330
140
|
for (let e of d.handlers) {
|
|
331
141
|
if (l()) break;
|
|
332
142
|
try {
|
|
333
|
-
|
|
143
|
+
a(e, d.instance, i.NATIVE_EVENT_HANDLER, r);
|
|
334
144
|
} catch (e) {
|
|
335
145
|
o.push(e);
|
|
336
146
|
}
|
|
@@ -344,20 +154,20 @@ function L(e, t, n, { event: a, capture: o, passive: s }) {
|
|
|
344
154
|
};
|
|
345
155
|
return c;
|
|
346
156
|
}
|
|
347
|
-
function
|
|
348
|
-
let i =
|
|
349
|
-
a?.slots.delete(r) &&
|
|
157
|
+
function P(e, t, n, r) {
|
|
158
|
+
let i = j(n), a = A.get(t)?.get(i);
|
|
159
|
+
a?.slots.delete(r) && M(e, t, i, a);
|
|
350
160
|
}
|
|
351
|
-
function
|
|
352
|
-
let a =
|
|
161
|
+
function F(e, t, n, r, i) {
|
|
162
|
+
let a = w(n), o = O(r);
|
|
353
163
|
if (!o) {
|
|
354
|
-
|
|
164
|
+
P(e, t, a, n);
|
|
355
165
|
return;
|
|
356
166
|
}
|
|
357
|
-
let s =
|
|
358
|
-
c ||
|
|
167
|
+
let s = j(a), c = A.get(t);
|
|
168
|
+
c || A.set(t, c = /* @__PURE__ */ new Map());
|
|
359
169
|
let l = c.get(s);
|
|
360
|
-
l || c.set(s, l =
|
|
170
|
+
l || c.set(s, l = N(e, t, s, a));
|
|
361
171
|
let u = l.slots.get(n);
|
|
362
172
|
if (u) u.handlers = o, u.instance = i;
|
|
363
173
|
else {
|
|
@@ -369,36 +179,30 @@ function z(e, t, n, r, i) {
|
|
|
369
179
|
fired: !1
|
|
370
180
|
});
|
|
371
181
|
try {
|
|
372
|
-
|
|
182
|
+
M(e, t, s, l);
|
|
373
183
|
} catch (e) {
|
|
374
184
|
throw l.slots.delete(n), l.slots.size === 0 && c.delete(s), e;
|
|
375
185
|
}
|
|
376
186
|
}
|
|
377
187
|
}
|
|
378
|
-
var
|
|
188
|
+
var I = /* @__PURE__ */ new Set([
|
|
379
189
|
"disabled",
|
|
380
190
|
"hidden",
|
|
381
191
|
"inert"
|
|
382
192
|
]);
|
|
383
|
-
function
|
|
193
|
+
function L(e) {
|
|
384
194
|
return (t, n, r, i, a, o) => {
|
|
385
|
-
n === "style" ?
|
|
195
|
+
n === "style" ? D(e, t, i) : b(n) ? F(e, t, n, i, o ?? null) : I.has(n) && i === !1 ? e.removeAttribute(t.id, n) : 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));
|
|
386
196
|
};
|
|
387
197
|
}
|
|
388
198
|
//#endregion
|
|
389
199
|
//#region src/vue/createApp.mts
|
|
390
|
-
function
|
|
391
|
-
let
|
|
392
|
-
...
|
|
393
|
-
patchProp:
|
|
394
|
-
}).createApp(
|
|
395
|
-
return Object.assign(
|
|
396
|
-
}
|
|
397
|
-
//#endregion
|
|
398
|
-
//#region src/vue/activeElement.mts
|
|
399
|
-
function U() {
|
|
400
|
-
let t = e();
|
|
401
|
-
return t === null ? null : u(t) ?? null;
|
|
200
|
+
function R(r, i) {
|
|
201
|
+
let a = o({
|
|
202
|
+
...y(t),
|
|
203
|
+
patchProp: L(t)
|
|
204
|
+
}).createApp(r, i), s = a.mount.bind(a);
|
|
205
|
+
return Object.assign(a, { mount: (r) => s(r ?? v(n(t, e(), "element"))) });
|
|
402
206
|
}
|
|
403
207
|
//#endregion
|
|
404
|
-
export {
|
|
208
|
+
export { R as createIncaApp };
|
package/package.json
CHANGED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
//#region src/native.mts
|
|
2
|
-
function e() {
|
|
3
|
-
return globalThis.__inca_native__;
|
|
4
|
-
}
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/events.mts
|
|
7
|
-
function t() {
|
|
8
|
-
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = 0, r = () => globalThis.__inca_callbacks__ ??= {};
|
|
9
|
-
return {
|
|
10
|
-
add(i, a, o) {
|
|
11
|
-
let s = n++;
|
|
12
|
-
r()[s] = o;
|
|
13
|
-
let c = e.get(i);
|
|
14
|
-
return c || e.set(i, c = /* @__PURE__ */ new Map()), c.set(a, s), t.set(s, {
|
|
15
|
-
group: i,
|
|
16
|
-
listener: a
|
|
17
|
-
}), s;
|
|
18
|
-
},
|
|
19
|
-
idFor(t, n) {
|
|
20
|
-
return e.get(t)?.get(n);
|
|
21
|
-
},
|
|
22
|
-
release(n) {
|
|
23
|
-
delete r()[n];
|
|
24
|
-
let i = t.get(n);
|
|
25
|
-
if (i === void 0) return;
|
|
26
|
-
t.delete(n);
|
|
27
|
-
let a = e.get(i.group);
|
|
28
|
-
a?.delete(i.listener), a?.size === 0 && e.delete(i.group);
|
|
29
|
-
},
|
|
30
|
-
groupCount: () => e.size
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
var n = t(), r = (e, t, n) => `${e}:${t}:${n === !0}`, i = 0;
|
|
34
|
-
function a() {
|
|
35
|
-
return i;
|
|
36
|
-
}
|
|
37
|
-
function o(e) {
|
|
38
|
-
return (...t) => {
|
|
39
|
-
let n = t[0]?.eventId;
|
|
40
|
-
return typeof n == "number" && n > i && (i = n), e(...t);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function s(e) {
|
|
44
|
-
for (let t of e) n.release(t);
|
|
45
|
-
}
|
|
46
|
-
function c(t, i, a, s = {}) {
|
|
47
|
-
if (a == null) return;
|
|
48
|
-
let c = r(t, i, s.capture);
|
|
49
|
-
if (n.idFor(c, a) !== void 0) return;
|
|
50
|
-
let u = (...e) => typeof a == "function" ? a(...e) : a.handleEvent.apply(a, e), d = s.once ? (...e) => (l(t, i, a, s), u(...e)) : u, f = n.add(c, a, o(d));
|
|
51
|
-
try {
|
|
52
|
-
e().addEventListener(t, i, f, s.capture === !0, s.passive === !0);
|
|
53
|
-
} catch (e) {
|
|
54
|
-
throw n.release(f), e;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function l(t, i, a, o = {}) {
|
|
58
|
-
if (a == null) return;
|
|
59
|
-
let s = n.idFor(r(t, i, o.capture), a);
|
|
60
|
-
s !== void 0 && (e().removeEventListener(t, i, s), n.release(s));
|
|
61
|
-
}
|
|
62
|
-
function u(t, n) {
|
|
63
|
-
return e().dispatchEvent(t, n);
|
|
64
|
-
}
|
|
65
|
-
function d(t) {
|
|
66
|
-
e().click(t);
|
|
67
|
-
}
|
|
68
|
-
function f(t, n) {
|
|
69
|
-
n === void 0 ? e().focusNode(t) : e().focusNode(t, n);
|
|
70
|
-
}
|
|
71
|
-
function p(t) {
|
|
72
|
-
e().blurNode(t);
|
|
73
|
-
}
|
|
74
|
-
function m() {
|
|
75
|
-
return e().focusedNode();
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region src/createEventTarget.mts
|
|
79
|
-
function h(e, t = []) {
|
|
80
|
-
return {
|
|
81
|
-
addEventListener(n, r, i) {
|
|
82
|
-
let a = typeof i == "boolean" ? { capture: i } : i ?? {};
|
|
83
|
-
c(e(), n, r, {
|
|
84
|
-
...a,
|
|
85
|
-
passive: a.passive ?? t.includes(n)
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
removeEventListener(t, n, r) {
|
|
89
|
-
let i = typeof r == "boolean" ? r : r?.capture;
|
|
90
|
-
l(e(), t, n, { capture: i });
|
|
91
|
-
},
|
|
92
|
-
dispatchEvent: (t) => u(e(), t)
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/tree.mts
|
|
97
|
-
function g() {
|
|
98
|
-
return e().rootNodeId();
|
|
99
|
-
}
|
|
100
|
-
function _(t) {
|
|
101
|
-
return e().createNode(t);
|
|
102
|
-
}
|
|
103
|
-
function v(t, n) {
|
|
104
|
-
e().appendChild(t, n);
|
|
105
|
-
}
|
|
106
|
-
function y(t, n, r) {
|
|
107
|
-
e().insertBefore(t, n, r);
|
|
108
|
-
}
|
|
109
|
-
function b(t, n) {
|
|
110
|
-
e().removeChild(t, n);
|
|
111
|
-
}
|
|
112
|
-
function x(t) {
|
|
113
|
-
s(e().destroyNode(t));
|
|
114
|
-
}
|
|
115
|
-
function S(t, n, r) {
|
|
116
|
-
e().setAttribute(t, n, r);
|
|
117
|
-
}
|
|
118
|
-
function C(t, n) {
|
|
119
|
-
return e().getAttribute(t, n);
|
|
120
|
-
}
|
|
121
|
-
function w(t) {
|
|
122
|
-
return e().layoutOf(t);
|
|
123
|
-
}
|
|
124
|
-
function T(t) {
|
|
125
|
-
return e().scrollOf(t);
|
|
126
|
-
}
|
|
127
|
-
function E(t, n, r) {
|
|
128
|
-
e().scrollNode(t, n, r);
|
|
129
|
-
}
|
|
130
|
-
function D(t, n, r) {
|
|
131
|
-
e().scrollIntoViewNode(t, n, r);
|
|
132
|
-
}
|
|
133
|
-
function O(t, n) {
|
|
134
|
-
e().removeAttribute(t, n);
|
|
135
|
-
}
|
|
136
|
-
function k(t, n, r) {
|
|
137
|
-
e().setStyle(t, n, r);
|
|
138
|
-
}
|
|
139
|
-
function A(t, n) {
|
|
140
|
-
e().removeStyle(t, n);
|
|
141
|
-
}
|
|
142
|
-
//#endregion
|
|
143
|
-
export { a as C, m as S, c as _, y as a, u as b, b as c, D as d, E as f, h as g, k as h, C as i, A as l, S as m, _ as n, w as o, T as p, x as r, O as s, v as t, g as u, p as v, l as w, f as x, d as y };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IncaElement } from './nodeOps.mts';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the element that currently has focus. A `focus()` or `blur()` call
|
|
4
|
-
* takes effect for this function at once.
|
|
5
|
-
* @returns the focused element, or `null` when no element has focus
|
|
6
|
-
*/
|
|
7
|
-
export declare function activeElement(): IncaElement | null;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IncaNode } from './nodeOps.mts';
|
|
2
|
-
/**
|
|
3
|
-
* Whether the host freed `node` with its subtree.
|
|
4
|
-
* @param node - the handle to check
|
|
5
|
-
* @returns `true` after {@link markDestroyed} reached `node`
|
|
6
|
-
*/
|
|
7
|
-
export declare function isDestroyed(node: IncaNode): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Records that the host freed `node` and every descendant of it, and drops
|
|
10
|
-
* their element handles from the registry.
|
|
11
|
-
* @param node - the root of the freed subtree
|
|
12
|
-
*/
|
|
13
|
-
export declare function markDestroyed(node: IncaNode): void;
|
package/dist/vue/layoutBox.d.mts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IncaCore } from '../rendererCore.mts';
|
|
2
|
-
import { IncaElement } from './nodeOps.mts';
|
|
3
|
-
/** `[x, y, width, height, border, scrollX, scrollY]` of a node's last drawn frame. */
|
|
4
|
-
export type LayoutBox = readonly [number, number, number, number, number, number, number];
|
|
5
|
-
/**
|
|
6
|
-
* Reads the box a node was last drawn at. A destroyed node, or one with no
|
|
7
|
-
* recorded box, yields `null`.
|
|
8
|
-
* @param core - the incajs bindings to read through
|
|
9
|
-
* @param el - the node to read
|
|
10
|
-
* @returns the box, or `null`
|
|
11
|
-
*/
|
|
12
|
-
export declare function layoutBox(core: IncaCore, el: IncaElement): LayoutBox | null;
|
package/dist/vue/offsetOf.d.mts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IncaCore } from '../rendererCore.mts';
|
|
2
|
-
import { IncaElement } from './nodeOps.mts';
|
|
3
|
-
/**
|
|
4
|
-
* Where a node sits inside the padding edge of its offset parent, rounded to
|
|
5
|
-
* whole pixels. A node with no offset parent is measured from the window
|
|
6
|
-
* origin.
|
|
7
|
-
* @param core - the incajs bindings to read through
|
|
8
|
-
* @param el - the node to measure
|
|
9
|
-
* @returns `left` and `top`; both `0` when the node has no recorded box
|
|
10
|
-
*/
|
|
11
|
-
export declare function offsetOf(core: IncaCore, el: IncaElement): {
|
|
12
|
-
left: number;
|
|
13
|
-
top: number;
|
|
14
|
-
};
|