incajs 0.0.17 → 0.0.18
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/dist/callbacks.d.mts +2 -2
- package/dist/chunks/{handle-SWQTonXe.js → handle-6SBsiUWz.js} +80 -45
- package/dist/chunks/{rendererCore-BWT8KFVJ.js → rendererCore-DEtME8eI.js} +1 -1
- package/dist/element/eventHandlers.d.mts +12 -0
- package/dist/element/handle.d.mts +2 -2
- package/dist/element/types.d.mts +14 -3
- package/dist/events.d.mts +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.js +1 -1
- package/dist/rendererCore.js +2 -2
- package/dist/tree.d.mts +2 -2
- package/dist/types.d.mts +75 -38
- package/dist/vue/patchProp.d.mts +14 -3
- package/dist/vue.js +54 -54
- package/package.json +1 -1
package/dist/callbacks.d.mts
CHANGED
|
@@ -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
|
|
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
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";
|
|
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
|
|
38
|
+
function v(e) {
|
|
4
39
|
return f(e) ? null : p(e.__node_id);
|
|
5
40
|
}
|
|
6
|
-
function
|
|
41
|
+
function y(e) {
|
|
7
42
|
let t = e.parent;
|
|
8
|
-
return !
|
|
43
|
+
return !v(e) || !t || !v(t) ? null : t;
|
|
9
44
|
}
|
|
10
|
-
function
|
|
11
|
-
let t =
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
81
|
-
let p = l(() => r),
|
|
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(
|
|
118
|
+
return f(T) ? "" : String(m(r, "id") ?? "");
|
|
84
119
|
},
|
|
85
120
|
set id(e) {
|
|
86
|
-
f(
|
|
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(
|
|
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 ===
|
|
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(
|
|
140
|
+
f(T) || p.addEventListener(...e);
|
|
106
141
|
},
|
|
107
142
|
removeEventListener: (...e) => {
|
|
108
|
-
f(
|
|
143
|
+
f(T) || p.removeEventListener(...e);
|
|
109
144
|
},
|
|
110
|
-
dispatchEvent: (e) => f(
|
|
145
|
+
dispatchEvent: (e) => f(T) || p.dispatchEvent(e),
|
|
111
146
|
get tabIndex() {
|
|
112
|
-
return
|
|
147
|
+
return S(f(T) ? null : m(r, "tabindex"), u ?? "");
|
|
113
148
|
},
|
|
114
149
|
set tabIndex(e) {
|
|
115
|
-
f(
|
|
150
|
+
f(T) || h(r, "tabindex", e | 0);
|
|
116
151
|
},
|
|
117
|
-
getBoundingClientRect: () =>
|
|
152
|
+
getBoundingClientRect: () => x(v(T)),
|
|
118
153
|
get offsetWidth() {
|
|
119
|
-
return Math.round(
|
|
154
|
+
return Math.round(v(T)?.[2] ?? 0);
|
|
120
155
|
},
|
|
121
156
|
get offsetHeight() {
|
|
122
|
-
return Math.round(
|
|
157
|
+
return Math.round(v(T)?.[3] ?? 0);
|
|
123
158
|
},
|
|
124
159
|
get offsetLeft() {
|
|
125
|
-
return
|
|
160
|
+
return b(T).left;
|
|
126
161
|
},
|
|
127
162
|
get offsetTop() {
|
|
128
|
-
return
|
|
163
|
+
return b(T).top;
|
|
129
164
|
},
|
|
130
165
|
get offsetParent() {
|
|
131
|
-
return
|
|
166
|
+
return y(T);
|
|
132
167
|
},
|
|
133
168
|
get clientWidth() {
|
|
134
|
-
let e =
|
|
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 =
|
|
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(
|
|
177
|
+
return Math.round(v(T)?.[4] ?? 0);
|
|
143
178
|
},
|
|
144
179
|
get clientTop() {
|
|
145
|
-
return Math.round(
|
|
180
|
+
return Math.round(v(T)?.[4] ?? 0);
|
|
146
181
|
},
|
|
147
182
|
get scrollLeft() {
|
|
148
|
-
return
|
|
183
|
+
return g()?.[0] ?? 0;
|
|
149
184
|
},
|
|
150
185
|
set scrollLeft(e) {
|
|
151
|
-
|
|
186
|
+
C(T, [e], !1);
|
|
152
187
|
},
|
|
153
188
|
get scrollTop() {
|
|
154
|
-
return
|
|
189
|
+
return g()?.[1] ?? 0;
|
|
155
190
|
},
|
|
156
191
|
set scrollTop(e) {
|
|
157
|
-
|
|
192
|
+
C(T, [void 0, e], !1);
|
|
158
193
|
},
|
|
159
194
|
get scrollWidth() {
|
|
160
|
-
return
|
|
195
|
+
return T.clientWidth + Math.round(g()?.[2] ?? 0);
|
|
161
196
|
},
|
|
162
197
|
get scrollHeight() {
|
|
163
|
-
return
|
|
198
|
+
return T.clientHeight + Math.round(g()?.[3] ?? 0);
|
|
164
199
|
},
|
|
165
|
-
scrollTo: (...e) =>
|
|
166
|
-
scrollBy: (...e) =>
|
|
200
|
+
scrollTo: (...e) => C(T, e, !1),
|
|
201
|
+
scrollBy: (...e) => C(T, e, !0),
|
|
167
202
|
scrollIntoView: (e) => {
|
|
168
|
-
if (f(
|
|
169
|
-
let { block: t, inline: n } =
|
|
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(
|
|
207
|
+
}, r), () => f(T));
|
|
208
|
+
return c === "element" && n(T), T;
|
|
174
209
|
}
|
|
175
|
-
function
|
|
210
|
+
function E() {
|
|
176
211
|
let e = c();
|
|
177
212
|
return e === null ? null : r(e) ?? null;
|
|
178
213
|
}
|
|
179
214
|
//#endregion
|
|
180
|
-
export {
|
|
215
|
+
export { T as n, E as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { n as j } from "./handle-6SBsiUWz.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
|
|
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`
|
package/dist/element/types.d.mts
CHANGED
|
@@ -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,
|
|
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 `
|
|
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
package/dist/rendererCore.js
CHANGED
|
@@ -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-
|
|
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
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-
|
|
3
|
+
import { n as R } from "./chunks/handle-6SBsiUWz.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
|
|
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,6 +23,8 @@ 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
|
|
@@ -57,12 +59,12 @@ export interface StyleProps {
|
|
|
57
59
|
corner_radius?: number;
|
|
58
60
|
/** Font size in px for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_color}. */
|
|
59
61
|
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?:
|
|
62
|
+
/** 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
|
+
overflow?: Overflow | `${Overflow} ${Overflow}`;
|
|
62
64
|
/** Horizontal overflow; wins over {@link StyleProps.overflow}. */
|
|
63
|
-
overflow_x?:
|
|
65
|
+
overflow_x?: Overflow;
|
|
64
66
|
/** Vertical overflow; wins over {@link StyleProps.overflow}. */
|
|
65
|
-
overflow_y?:
|
|
67
|
+
overflow_y?: Overflow;
|
|
66
68
|
/** 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
69
|
padding?: number;
|
|
68
70
|
/** Horizontal inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
|
|
@@ -141,7 +143,7 @@ export interface IncaEventTarget {
|
|
|
141
143
|
* as `this` when the event fires
|
|
142
144
|
* @param options - a {@link ListenerOptions}, or a boolean for `capture`
|
|
143
145
|
*/
|
|
144
|
-
addEventListener(type: string, listener: EventListenerOrObject | null, options?: boolean | ListenerOptions): void;
|
|
146
|
+
addEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E> | null, options?: boolean | ListenerOptions): void;
|
|
145
147
|
/**
|
|
146
148
|
* Drops the registration of `listener` for `type` with the same `capture`.
|
|
147
149
|
* A call that matches no registration changes nothing.
|
|
@@ -149,7 +151,7 @@ export interface IncaEventTarget {
|
|
|
149
151
|
* @param listener - the listener that was registered
|
|
150
152
|
* @param options - an object with `capture`, or a boolean for `capture`
|
|
151
153
|
*/
|
|
152
|
-
removeEventListener(type: string, listener: EventListenerOrObject | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
|
|
154
|
+
removeEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E> | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
|
|
153
155
|
/**
|
|
154
156
|
* Dispatches an `Event` or `CustomEvent` at the target.
|
|
155
157
|
* @param event - the event to dispatch
|
|
@@ -160,47 +162,82 @@ export interface IncaEventTarget {
|
|
|
160
162
|
dispatchEvent(event: EventLike): boolean;
|
|
161
163
|
}
|
|
162
164
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
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.
|
|
165
|
+
* The event object a listener receives. It carries these fields and the
|
|
166
|
+
* fields of its event kind, which this type leaves out. A listener that reads
|
|
167
|
+
* them declares its parameter with them, such as
|
|
168
|
+
* `(event: IncaEvent & { key: string }) => void`.
|
|
190
169
|
*
|
|
191
170
|
* See https://incajs.tom96da.com/reference/events for the event names the
|
|
192
171
|
* host dispatches and their fields.
|
|
193
172
|
*/
|
|
194
|
-
export
|
|
173
|
+
export interface IncaEvent {
|
|
174
|
+
/** The event's name. */
|
|
175
|
+
readonly type: string;
|
|
176
|
+
/**
|
|
177
|
+
* The element the event is about, or `window`. It is the deepest element
|
|
178
|
+
* under the pointer for pointer events, the nearest common ancestor of the
|
|
179
|
+
* press and the release for `click`, `dblclick` and `auxclick`, and the
|
|
180
|
+
* focused element for key events. With no such element it is `window`.
|
|
181
|
+
*/
|
|
182
|
+
readonly target: IncaEventTarget;
|
|
183
|
+
/** The same object as {@link IncaEvent.target}. */
|
|
184
|
+
readonly srcElement: IncaEventTarget;
|
|
185
|
+
/**
|
|
186
|
+
* The element or `window` whose listener is running, and `null` once the
|
|
187
|
+
* event has been handled. A listener function runs with it as `this`.
|
|
188
|
+
*/
|
|
189
|
+
readonly currentTarget: IncaEventTarget | null;
|
|
190
|
+
/** Whether the event travels up from `target`. Fixed per event name. */
|
|
191
|
+
readonly bubbles: boolean;
|
|
192
|
+
/** Whether `preventDefault()` can cancel the event. Fixed per event name. */
|
|
193
|
+
readonly cancelable: boolean;
|
|
194
|
+
/** Fixed per event name. */
|
|
195
|
+
readonly composed: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* 1 on the ancestors of `target` while the event travels down, 2 where
|
|
198
|
+
* `currentTarget` is `target`, 3 on the ancestors while it travels up, and 0
|
|
199
|
+
* once the event has been handled.
|
|
200
|
+
*/
|
|
201
|
+
readonly eventPhase: 0 | 1 | 2 | 3;
|
|
202
|
+
/** `true` once a listener called `preventDefault()` on a cancelable event. */
|
|
203
|
+
readonly defaultPrevented: boolean;
|
|
204
|
+
/** `true` for events the host dispatches and `false` for events a script dispatches. */
|
|
205
|
+
readonly isTrusted: boolean;
|
|
206
|
+
/** Milliseconds since the host started. */
|
|
207
|
+
readonly timeStamp: number;
|
|
208
|
+
/** A number that grows with each event and is the same on every node that event reaches. */
|
|
209
|
+
readonly eventId: number;
|
|
210
|
+
/** Assigning `true` while the event is dispatched stops it like `stopPropagation()`. */
|
|
211
|
+
cancelBubble: boolean;
|
|
212
|
+
/** The opposite of `defaultPrevented`. Assigning `false` cancels a cancelable event like `preventDefault()`. */
|
|
213
|
+
returnValue: boolean;
|
|
214
|
+
/** Stops the event from reaching the listeners of later nodes on its path. */
|
|
215
|
+
stopPropagation(): void;
|
|
216
|
+
/** Stops the event from reaching any later listener. */
|
|
217
|
+
stopImmediatePropagation(): void;
|
|
218
|
+
/** Cancels the event when it is cancelable and the listener is not passive. */
|
|
219
|
+
preventDefault(): void;
|
|
220
|
+
/**
|
|
221
|
+
* `target` and its ancestors, ending with `window`, and an empty array once
|
|
222
|
+
* the event has been handled.
|
|
223
|
+
*/
|
|
224
|
+
composedPath(): IncaEventTarget[];
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Signature of a callback registered via `addEventListener`. It receives the
|
|
228
|
+
* event, an {@link IncaEvent} unless the parameter declares another type, and
|
|
229
|
+
* runs with the event's `currentTarget` as `this`.
|
|
230
|
+
*/
|
|
231
|
+
export type EventListener<E = IncaEvent> = (this: IncaEventTarget, event: E) => void;
|
|
195
232
|
/**
|
|
196
233
|
* An object whose `handleEvent` method receives the events, called with the
|
|
197
|
-
* object as `this`. It takes the
|
|
234
|
+
* object as `this`. It takes the event an {@link EventListener} takes.
|
|
198
235
|
*/
|
|
199
|
-
export interface EventListenerObject {
|
|
200
|
-
handleEvent:
|
|
236
|
+
export interface EventListenerObject<E = IncaEvent> {
|
|
237
|
+
handleEvent(event: E): void;
|
|
201
238
|
}
|
|
202
239
|
/**
|
|
203
240
|
* What `addEventListener` accepts as a listener: an {@link EventListener} or
|
|
204
241
|
* an {@link EventListenerObject}.
|
|
205
242
|
*/
|
|
206
|
-
export type EventListenerOrObject = EventListener | EventListenerObject
|
|
243
|
+
export type EventListenerOrObject<E = IncaEvent> = EventListener<E> | EventListenerObject<E>;
|
package/dist/vue/patchProp.d.mts
CHANGED
|
@@ -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
|
|
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
|
|
45
|
-
*
|
|
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-
|
|
1
|
+
import { t as e } from "./chunks/rendererCore-DEtME8eI.js";
|
|
2
2
|
import { m as t } from "./chunks/hooks-BgB7lzTv.js";
|
|
3
|
-
import { n } from "./chunks/handle-
|
|
4
|
-
import { ErrorCodes as r, callWithAsyncErrorHandling as i, createRenderer as a } from "@vue/runtime-core";
|
|
3
|
+
import { n } from "./chunks/handle-6SBsiUWz.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
|
|
6
|
+
function s(e) {
|
|
7
7
|
return Object.defineProperty(e, "__v_skip", { value: !0 }), e;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function c(e) {
|
|
10
10
|
return {
|
|
11
|
-
createElement: (t) =>
|
|
12
|
-
createText: (t) =>
|
|
13
|
-
createComment: (t) =>
|
|
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
|
|
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
|
|
32
|
-
function
|
|
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(
|
|
40
|
-
return n.event = t[2] === ":" ? t.slice(3) :
|
|
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
|
|
43
|
-
function
|
|
44
|
-
let r = typeof n == "object" && n ? n : {}, i =
|
|
45
|
-
i ||
|
|
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())
|
|
48
|
-
for (let [n, o] of Object.entries(r))
|
|
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
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
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
|
|
72
|
-
function
|
|
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 &&
|
|
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
|
|
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
|
-
|
|
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,
|
|
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
|
|
111
|
-
let i =
|
|
112
|
-
a?.slots.delete(r) &&
|
|
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
|
|
115
|
-
let a =
|
|
114
|
+
function E(e, t, n, r, i) {
|
|
115
|
+
let a = h(n), o = y(r, n);
|
|
116
116
|
if (!o) {
|
|
117
|
-
|
|
117
|
+
T(e, t, a, n);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
let s =
|
|
121
|
-
c ||
|
|
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 =
|
|
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
|
-
|
|
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
|
|
141
|
+
var D = /* @__PURE__ */ new Set([
|
|
142
142
|
"disabled",
|
|
143
143
|
"hidden",
|
|
144
144
|
"inert"
|
|
145
145
|
]);
|
|
146
|
-
function
|
|
146
|
+
function O(e) {
|
|
147
147
|
return (t, n, r, i, a, o) => {
|
|
148
|
-
n === "style" ?
|
|
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
|
|
154
|
-
function
|
|
155
|
-
let
|
|
156
|
-
...
|
|
157
|
-
patchProp:
|
|
158
|
-
}, u = a(
|
|
159
|
-
Object.assign(
|
|
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 ??
|
|
164
|
-
return
|
|
163
|
+
let r = f(e ?? s(n(t(), "element")));
|
|
164
|
+
return k.add(d), r;
|
|
165
165
|
},
|
|
166
166
|
unmount: () => {
|
|
167
|
-
p(),
|
|
167
|
+
p(), k.delete(d);
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
172
|
-
export {
|
|
172
|
+
export { A as createIncaApp };
|