incajs 0.0.14 → 0.0.15
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/chunks/{tree-BQ6ux0tE.js → tree-Ds0zSuJO.js} +32 -14
- package/dist/events.d.mts +8 -2
- package/dist/index.js +2 -2
- package/dist/native.d.mts +8 -2
- package/dist/rendererCore.d.mts +2 -2
- package/dist/rendererCore.js +28 -22
- package/dist/tree.d.mts +49 -1
- package/dist/types.d.mts +2 -2
- package/dist/vue/activeElement.d.mts +7 -0
- package/dist/vue/createElement.d.mts +2 -2
- package/dist/vue/destroyedNodes.d.mts +13 -0
- package/dist/vue/elements.d.mts +24 -0
- package/dist/vue/index.d.mts +4 -0
- package/dist/vue/layoutBox.d.mts +12 -0
- package/dist/vue/nodeOps.d.mts +67 -5
- package/dist/vue/offsetOf.d.mts +14 -0
- package/dist/vue/offsetParent.d.mts +10 -0
- package/dist/vue/rectOf.d.mts +25 -0
- package/dist/vue/scrollIntoViewArgs.d.mts +22 -0
- package/dist/vue/scrollPosition.d.mts +22 -0
- package/dist/vue/skipReactive.d.mts +8 -0
- package/dist/vue/tabIndexOf.d.mts +9 -0
- package/dist/vue.js +245 -56
- package/package.json +1 -1
|
@@ -65,15 +65,18 @@ function u(t, n) {
|
|
|
65
65
|
function d(t) {
|
|
66
66
|
e().click(t);
|
|
67
67
|
}
|
|
68
|
-
function f(t) {
|
|
69
|
-
e().focusNode(t);
|
|
68
|
+
function f(t, n) {
|
|
69
|
+
n === void 0 ? e().focusNode(t) : e().focusNode(t, n);
|
|
70
70
|
}
|
|
71
71
|
function p(t) {
|
|
72
72
|
e().blurNode(t);
|
|
73
73
|
}
|
|
74
|
+
function m() {
|
|
75
|
+
return e().focusedNode();
|
|
76
|
+
}
|
|
74
77
|
//#endregion
|
|
75
78
|
//#region src/createEventTarget.mts
|
|
76
|
-
function
|
|
79
|
+
function h(e, t = []) {
|
|
77
80
|
return {
|
|
78
81
|
addEventListener(n, r, i) {
|
|
79
82
|
let a = typeof i == "boolean" ? { capture: i } : i ?? {};
|
|
@@ -91,35 +94,50 @@ function m(e, t = []) {
|
|
|
91
94
|
}
|
|
92
95
|
//#endregion
|
|
93
96
|
//#region src/tree.mts
|
|
94
|
-
function
|
|
97
|
+
function g() {
|
|
95
98
|
return e().rootNodeId();
|
|
96
99
|
}
|
|
97
|
-
function
|
|
100
|
+
function _(t) {
|
|
98
101
|
return e().createNode(t);
|
|
99
102
|
}
|
|
100
|
-
function
|
|
103
|
+
function v(t, n) {
|
|
101
104
|
e().appendChild(t, n);
|
|
102
105
|
}
|
|
103
|
-
function
|
|
106
|
+
function y(t, n, r) {
|
|
104
107
|
e().insertBefore(t, n, r);
|
|
105
108
|
}
|
|
106
|
-
function
|
|
109
|
+
function b(t, n) {
|
|
107
110
|
e().removeChild(t, n);
|
|
108
111
|
}
|
|
109
|
-
function
|
|
112
|
+
function x(t) {
|
|
110
113
|
s(e().destroyNode(t));
|
|
111
114
|
}
|
|
112
|
-
function
|
|
115
|
+
function S(t, n, r) {
|
|
113
116
|
e().setAttribute(t, n, r);
|
|
114
117
|
}
|
|
115
|
-
function
|
|
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) {
|
|
116
134
|
e().removeAttribute(t, n);
|
|
117
135
|
}
|
|
118
|
-
function
|
|
136
|
+
function k(t, n, r) {
|
|
119
137
|
e().setStyle(t, n, r);
|
|
120
138
|
}
|
|
121
|
-
function
|
|
139
|
+
function A(t, n) {
|
|
122
140
|
e().removeStyle(t, n);
|
|
123
141
|
}
|
|
124
142
|
//#endregion
|
|
125
|
-
export { a as
|
|
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 };
|
package/dist/events.d.mts
CHANGED
|
@@ -66,10 +66,11 @@ export declare function click(nodeId: NodeId): void;
|
|
|
66
66
|
* Requests that `nodeId` become focused. Takes effect on the next frame,
|
|
67
67
|
* dispatching `"blur"`/`"focus"` for whatever actually changed. The node
|
|
68
68
|
* needs a `tabindex` attribute to take focus, and a listener for either event
|
|
69
|
-
* is optional.
|
|
69
|
+
* is optional. The scroll containers around the node scroll it into view.
|
|
70
70
|
* @param nodeId - the node to focus
|
|
71
|
+
* @param preventScroll - `true` to leave the scroll containers in place; omitted or `false` scrolls the node into view
|
|
71
72
|
*/
|
|
72
|
-
export declare function focus(nodeId: NodeId): void;
|
|
73
|
+
export declare function focus(nodeId: NodeId, preventScroll?: boolean): void;
|
|
73
74
|
/**
|
|
74
75
|
* Requests that `nodeId` become unfocused, the way `element.blur()` does.
|
|
75
76
|
* Takes effect on the next frame; a no-op if `nodeId` isn't the focused node
|
|
@@ -77,3 +78,8 @@ export declare function focus(nodeId: NodeId): void;
|
|
|
77
78
|
* @param nodeId - the node to unfocus
|
|
78
79
|
*/
|
|
79
80
|
export declare function blur(nodeId: NodeId): void;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the id of the focused node.
|
|
83
|
+
* @returns the focused node's id, or `null` when no node has focus
|
|
84
|
+
*/
|
|
85
|
+
export declare function focusedNode(): NodeId | null;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as e, u as t } from "./chunks/tree-Ds0zSuJO.js";
|
|
2
2
|
//#region src/window.mts
|
|
3
|
-
var n = /* @__PURE__ */ t
|
|
3
|
+
var n = /* @__PURE__ */ e(t, ["wheel"]);
|
|
4
4
|
//#endregion
|
|
5
5
|
export { n as window };
|
package/dist/native.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeValue, CallbackId, EventLike, NodeId } from './types.mts';
|
|
1
|
+
import { AttributeValue, CallbackId, EventLike, NodeId, ScrollAlignment } from './types.mts';
|
|
2
2
|
/** The host-injected object every wrapper in this package forwards to. Not part of the public surface — reach it through the wrappers instead. */
|
|
3
3
|
interface IncaNative {
|
|
4
4
|
rootNodeId(): NodeId;
|
|
@@ -7,14 +7,20 @@ 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
|
+
getAttribute(nodeId: NodeId, key: string): AttributeValue | null;
|
|
10
11
|
removeAttribute(nodeId: NodeId, key: string): void;
|
|
11
12
|
setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
12
13
|
removeStyle(nodeId: NodeId, key: string): void;
|
|
13
14
|
addEventListener(nodeId: NodeId, event: string, callbackId: CallbackId, capture?: boolean, passive?: boolean): void;
|
|
14
15
|
removeEventListener(nodeId: NodeId, event: string, callbackId: CallbackId): boolean;
|
|
15
16
|
destroyNode(nodeId: NodeId): CallbackId[];
|
|
16
|
-
focusNode(nodeId: NodeId): void;
|
|
17
|
+
focusNode(nodeId: NodeId, preventScroll?: boolean): void;
|
|
17
18
|
blurNode(nodeId: NodeId): void;
|
|
19
|
+
focusedNode(): NodeId | null;
|
|
20
|
+
layoutOf(nodeId: NodeId): readonly [number, number, number, number, number, number, number] | null;
|
|
21
|
+
scrollOf(nodeId: NodeId): readonly [number, number, number, number] | null;
|
|
22
|
+
scrollNode(nodeId: NodeId, left: number | null, top: number | null): void;
|
|
23
|
+
scrollIntoViewNode(nodeId: NodeId, block: ScrollAlignment, inline: ScrollAlignment): void;
|
|
18
24
|
dispatchEvent(nodeId: NodeId, event: EventLike): boolean;
|
|
19
25
|
click(nodeId: NodeId): void;
|
|
20
26
|
}
|
package/dist/rendererCore.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createEventTarget } from './createEventTarget.mts';
|
|
2
|
-
export { addEventListener, removeEventListener, latestEventId, focus, blur, dispatchEvent, click, } from './events.mts';
|
|
3
|
-
export { appendChild, createNode, destroyNode, insertBefore, removeChild, rootNodeId, setAttribute, removeAttribute, setStyle, removeStyle, } from './tree.mts';
|
|
2
|
+
export { addEventListener, removeEventListener, latestEventId, focus, blur, focusedNode, dispatchEvent, click, } from './events.mts';
|
|
3
|
+
export { appendChild, createNode, destroyNode, insertBefore, removeChild, rootNodeId, setAttribute, getAttribute, layoutOf, scrollOf, scrollNode, scrollIntoViewNode, removeAttribute, setStyle, removeStyle, } from './tree.mts';
|
|
4
4
|
export type * from './types.mts';
|
|
5
5
|
/**
|
|
6
6
|
* The tree/event primitives a custom renderer (`incajs/vue`) drives the
|
package/dist/rendererCore.js
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, w as x, x as S, y as C } from "./chunks/tree-Ds0zSuJO.js";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
|
-
var
|
|
3
|
+
var w = Object.defineProperty, T = /* @__PURE__ */ ((e, t) => {
|
|
4
4
|
let n = {};
|
|
5
|
-
for (var r in e)
|
|
5
|
+
for (var r in e) w(n, r, {
|
|
6
6
|
get: e[r],
|
|
7
7
|
enumerable: !0
|
|
8
8
|
});
|
|
9
|
-
return t ||
|
|
9
|
+
return t || w(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
10
10
|
})({
|
|
11
|
-
addEventListener: () =>
|
|
12
|
-
appendChild: () =>
|
|
13
|
-
blur: () =>
|
|
14
|
-
click: () =>
|
|
15
|
-
createEventTarget: () =>
|
|
16
|
-
createNode: () =>
|
|
17
|
-
destroyNode: () =>
|
|
18
|
-
dispatchEvent: () =>
|
|
19
|
-
focus: () =>
|
|
20
|
-
|
|
11
|
+
addEventListener: () => n,
|
|
12
|
+
appendChild: () => v,
|
|
13
|
+
blur: () => b,
|
|
14
|
+
click: () => C,
|
|
15
|
+
createEventTarget: () => c,
|
|
16
|
+
createNode: () => p,
|
|
17
|
+
destroyNode: () => g,
|
|
18
|
+
dispatchEvent: () => i,
|
|
19
|
+
focus: () => S,
|
|
20
|
+
focusedNode: () => t,
|
|
21
|
+
getAttribute: () => u,
|
|
22
|
+
insertBefore: () => r,
|
|
21
23
|
latestEventId: () => e,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
layoutOf: () => m,
|
|
25
|
+
removeAttribute: () => _,
|
|
26
|
+
removeChild: () => a,
|
|
27
|
+
removeEventListener: () => x,
|
|
28
|
+
removeStyle: () => d,
|
|
29
|
+
rootNodeId: () => y,
|
|
30
|
+
scrollIntoViewNode: () => o,
|
|
31
|
+
scrollNode: () => s,
|
|
32
|
+
scrollOf: () => h,
|
|
33
|
+
setAttribute: () => f,
|
|
34
|
+
setStyle: () => l
|
|
29
35
|
});
|
|
30
36
|
//#endregion
|
|
31
|
-
export {
|
|
37
|
+
export { n as addEventListener, v as appendChild, b as blur, C as click, c as createEventTarget, p as createNode, g as destroyNode, i as dispatchEvent, S as focus, t as focusedNode, u as getAttribute, r as insertBefore, e as latestEventId, m as layoutOf, _ as removeAttribute, a as removeChild, x as removeEventListener, d as removeStyle, y as rootNodeId, o as scrollIntoViewNode, s as scrollNode, h as scrollOf, f as setAttribute, l as setStyle, T as t };
|
package/dist/tree.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeValue, NodeId, StyleProps, TagName } from './types.mts';
|
|
1
|
+
import { AttributeValue, NodeId, ScrollAlignment, StyleProps, TagName } from './types.mts';
|
|
2
2
|
/**
|
|
3
3
|
* Returns the host-allocated root container's id — the node an app attaches
|
|
4
4
|
* itself under. The host allocates it with the tree, so this resolves from
|
|
@@ -57,6 +57,54 @@ 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
|
+
* Returns the attribute/prop stored on `nodeId` under `key`, or `null` when unset.
|
|
62
|
+
* @param nodeId - the node to read
|
|
63
|
+
* @param key - the attribute name
|
|
64
|
+
* @returns the stored value, or `null`
|
|
65
|
+
* @throws {TypeError} when `nodeId` names no node
|
|
66
|
+
*/
|
|
67
|
+
export declare function getAttribute(nodeId: NodeId, key: string): AttributeValue | null;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the box `nodeId` was drawn at in the last frame, in window logical
|
|
70
|
+
* pixels, or `null` if the node has no recorded box.
|
|
71
|
+
* @param nodeId - the node to read
|
|
72
|
+
* @returns `[x, y, width, height, border, scrollX, scrollY]`, or `null`. `border` is one uniform
|
|
73
|
+
* width on all sides. `scrollX` and `scrollY` are the positive scroll offset the parent applied
|
|
74
|
+
* to the box.
|
|
75
|
+
* @throws {TypeError} when `nodeId` names no node
|
|
76
|
+
*/
|
|
77
|
+
export declare function layoutOf(nodeId: NodeId): readonly [number, number, number, number, number, number, number] | null;
|
|
78
|
+
/**
|
|
79
|
+
* Returns the scroll offset of `nodeId` in window logical pixels. A write made
|
|
80
|
+
* since the last draw is included, clamped to the maximum of the last drawn
|
|
81
|
+
* frame.
|
|
82
|
+
* @param nodeId - the node to read
|
|
83
|
+
* @returns `[left, top, maxLeft, maxTop]`, or `null` for a node whose `overflow` is
|
|
84
|
+
* `visible` on both axes. The maxima are the largest offsets the node can take, as
|
|
85
|
+
* of the last drawn frame.
|
|
86
|
+
* @throws {TypeError} when `nodeId` names no node
|
|
87
|
+
*/
|
|
88
|
+
export declare function scrollOf(nodeId: NodeId): readonly [number, number, number, number] | null;
|
|
89
|
+
/**
|
|
90
|
+
* Sets the scroll offset of `nodeId` on one or both axes. A `null` axis keeps
|
|
91
|
+
* its current offset. The host clamps each value to the scrollable range on
|
|
92
|
+
* the next frame. A node with `overflow: visible` on both axes ignores the call.
|
|
93
|
+
* @param nodeId - the node to scroll
|
|
94
|
+
* @param left - the horizontal offset, or `null` to keep it
|
|
95
|
+
* @param top - the vertical offset, or `null` to keep it
|
|
96
|
+
* @throws {TypeError} when `nodeId` names no node
|
|
97
|
+
*/
|
|
98
|
+
export declare function scrollNode(nodeId: NodeId, left: number | null, top: number | null): void;
|
|
99
|
+
/**
|
|
100
|
+
* Scrolls each scroll container around `nodeId` so the node shows.
|
|
101
|
+
* @param nodeId - the node to bring into view
|
|
102
|
+
* @param block - the vertical alignment: `"start"`, `"center"`, `"end"` or `"nearest"`
|
|
103
|
+
* @param inline - the horizontal alignment: `"start"`, `"center"`, `"end"` or `"nearest"`
|
|
104
|
+
* @throws {TypeError} when `nodeId` names no node
|
|
105
|
+
* @throws {TypeError} when `block` or `inline` is not an alignment name
|
|
106
|
+
*/
|
|
107
|
+
export declare function scrollIntoViewNode(nodeId: NodeId, block: ScrollAlignment, inline: ScrollAlignment): void;
|
|
60
108
|
/**
|
|
61
109
|
* Removes a non-style attribute/prop from `nodeId`. Removing an attribute
|
|
62
110
|
* that isn't set does nothing.
|
package/dist/types.d.mts
CHANGED
|
@@ -22,6 +22,8 @@ export type AttributeValue = string | number | boolean;
|
|
|
22
22
|
* autocomplete while still accepting an arbitrary tag name.
|
|
23
23
|
*/
|
|
24
24
|
export type TagName = "text" | (string & {});
|
|
25
|
+
/** Where `scrollIntoView` aligns a node on one axis. */
|
|
26
|
+
export type ScrollAlignment = "start" | "center" | "end" | "nearest";
|
|
25
27
|
/**
|
|
26
28
|
* Style properties, in their snake_case spelling, that `setStyle`'s typed
|
|
27
29
|
* overload checks. A deliberately incomplete, v1 layout/paint vocabulary. The
|
|
@@ -138,7 +140,6 @@ export interface IncaEventTarget {
|
|
|
138
140
|
* @param listener - a function, or an object whose `handleEvent` method is
|
|
139
141
|
* called when the event fires
|
|
140
142
|
* @param options - a {@link ListenerOptions}, or a boolean for `capture`
|
|
141
|
-
* @throws TypeError when the target's node was destroyed
|
|
142
143
|
*/
|
|
143
144
|
addEventListener(type: string, listener: EventListenerOrObject | null, options?: boolean | ListenerOptions): void;
|
|
144
145
|
/**
|
|
@@ -153,7 +154,6 @@ export interface IncaEventTarget {
|
|
|
153
154
|
* Dispatches an `Event` or `CustomEvent` at the target.
|
|
154
155
|
* @param event - the event to dispatch
|
|
155
156
|
* @returns `false` when a listener canceled a cancelable event, else `true`
|
|
156
|
-
* @throws TypeError when the target's node was destroyed
|
|
157
157
|
* @throws TypeError when `event` is not an `Event` or `CustomEvent`
|
|
158
158
|
* @throws DOMException named `InvalidStateError` when `event` is being dispatched
|
|
159
159
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -3,11 +3,11 @@ import { IncaElement } from './nodeOps.mts';
|
|
|
3
3
|
/**
|
|
4
4
|
* Builds the {@link IncaElement} handle for a native node: parentless,
|
|
5
5
|
* childless, with `focus()`, `blur()`, `click()`, the listener methods of an
|
|
6
|
-
* event target
|
|
6
|
+
* event target, `tabIndex` and the layout members, all driven through `core`.
|
|
7
7
|
* @param core - the incajs bindings the handle drives
|
|
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
|
-
* @param tag - the node's element kind, if it has one; a `button`
|
|
10
|
+
* @param tag - the node's element kind, if it has one; a `button` defaults to tab index `0`
|
|
11
11
|
* @returns the new handle
|
|
12
12
|
*/
|
|
13
13
|
export declare function createIncaElement(core: IncaCore, id: NodeId, kind: IncaElement["kind"], tag?: TagName): IncaElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NodeId } from '../rendererCore.mts';
|
|
2
|
+
import { IncaElement } from './nodeOps.mts';
|
|
3
|
+
/**
|
|
4
|
+
* Records `element` under its id.
|
|
5
|
+
* @param element - the handle to record
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerElement(element: IncaElement): void;
|
|
8
|
+
/**
|
|
9
|
+
* Drops the record of a native node.
|
|
10
|
+
* @param id - the native node's id
|
|
11
|
+
*/
|
|
12
|
+
export declare function unregisterElement(id: NodeId): void;
|
|
13
|
+
/**
|
|
14
|
+
* Counts the recorded nodes, including those whose handle is already collected
|
|
15
|
+
* and waits for the registry to drop it.
|
|
16
|
+
* @returns the number of records
|
|
17
|
+
*/
|
|
18
|
+
export declare function recordedCount(): number;
|
|
19
|
+
/**
|
|
20
|
+
* Looks up the live handle of a native node.
|
|
21
|
+
* @param id - the native node's id
|
|
22
|
+
* @returns the handle, or `undefined` when none is live
|
|
23
|
+
*/
|
|
24
|
+
export declare function elementOf(id: NodeId): IncaElement | undefined;
|
package/dist/vue/index.d.mts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export { createIncaApp } from './createApp.mts';
|
|
2
|
+
export { activeElement } from './activeElement.mts';
|
|
2
3
|
export type { IncaApp } from './createApp.mts';
|
|
3
4
|
export type { IncaCore } from '../rendererCore.mts';
|
|
5
|
+
export type { RectLike, RectValues } from './rectOf.mts';
|
|
6
|
+
export type { ScrollOptions } from './scrollPosition.mts';
|
|
7
|
+
export type { ScrollIntoViewOptions } from './scrollIntoViewArgs.mts';
|
|
4
8
|
export type { IncaElement, IncaNode } from './nodeOps.mts';
|
|
@@ -0,0 +1,12 @@
|
|
|
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/nodeOps.d.mts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { RendererOptions } from '@vue/runtime-core';
|
|
2
2
|
import { IncaCore, IncaEventTarget, NodeId } from '../rendererCore.mts';
|
|
3
|
+
import { RectLike } from './rectOf.mts';
|
|
4
|
+
import { ScrollIntoViewOptions } from './scrollIntoViewArgs.mts';
|
|
5
|
+
import { ScrollOptions } from './scrollPosition.mts';
|
|
3
6
|
/**
|
|
4
7
|
* A container host node: either a real element or the hidden stand-in
|
|
5
8
|
* {@link NodeOps.createComment} uses. Also `@vue/runtime-core`'s
|
|
@@ -9,6 +12,9 @@ import { IncaCore, IncaEventTarget, NodeId } from '../rendererCore.mts';
|
|
|
9
12
|
* node's children, so `parent`/`children` are maintained here as a
|
|
10
13
|
* JS-side shadow of the tree, kept in sync by {@link NodeOps.insert}/
|
|
11
14
|
* {@link NodeOps.remove}.
|
|
15
|
+
*
|
|
16
|
+
* After the node is removed, `addEventListener()` and `removeEventListener()`
|
|
17
|
+
* ignore the call, and `dispatchEvent()` returns `true`.
|
|
12
18
|
*/
|
|
13
19
|
export interface IncaElement extends IncaEventTarget {
|
|
14
20
|
/**
|
|
@@ -26,8 +32,14 @@ export interface IncaElement extends IncaEventTarget {
|
|
|
26
32
|
parent: IncaElement | null;
|
|
27
33
|
/** This node's children, in render order. */
|
|
28
34
|
children: IncaNode[];
|
|
29
|
-
/**
|
|
30
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Focuses this node next frame. The node needs a `tabindex` attribute. A
|
|
37
|
+
* `true` `preventScroll` keeps every scroll container where it is. After
|
|
38
|
+
* the node is removed, the call does nothing.
|
|
39
|
+
*/
|
|
40
|
+
focus(options?: {
|
|
41
|
+
preventScroll?: boolean;
|
|
42
|
+
}): void;
|
|
31
43
|
/** Unfocuses this node next frame, if it is the focused one. */
|
|
32
44
|
blur(): void;
|
|
33
45
|
/**
|
|
@@ -36,11 +48,61 @@ export interface IncaElement extends IncaEventTarget {
|
|
|
36
48
|
*/
|
|
37
49
|
click(): void;
|
|
38
50
|
/**
|
|
39
|
-
* Assigning sets the `tabindex` attribute to the integer part
|
|
40
|
-
*
|
|
41
|
-
* `button`).
|
|
51
|
+
* Assigning sets the `tabindex` attribute to the value's integer part,
|
|
52
|
+
* wrapped to 32 bits. Reading returns the `tabindex` attribute as an
|
|
53
|
+
* integer, or `-1` (`0` for a `button`) when it is unset or invalid.
|
|
54
|
+
* After the node is removed, reading gives that default and assigning does
|
|
55
|
+
* nothing.
|
|
42
56
|
*/
|
|
43
57
|
tabIndex: number;
|
|
58
|
+
/**
|
|
59
|
+
* The box this node was drawn at in the last frame, in window logical
|
|
60
|
+
* pixels. A node created in the same task reads all zeros.
|
|
61
|
+
*/
|
|
62
|
+
getBoundingClientRect(): RectLike;
|
|
63
|
+
/** The box width from the last frame, rounded. `0` until a frame draws the node. */
|
|
64
|
+
readonly offsetWidth: number;
|
|
65
|
+
/** The box height from the last frame, rounded. `0` until a frame draws the node. */
|
|
66
|
+
readonly offsetHeight: number;
|
|
67
|
+
/** The box's left edge from the last frame, relative to {@link offsetParent}. Stays fixed while the parent scrolls. */
|
|
68
|
+
readonly offsetLeft: number;
|
|
69
|
+
/** The box's top edge from the last frame, relative to {@link offsetParent}. Stays fixed while the parent scrolls. */
|
|
70
|
+
readonly offsetTop: number;
|
|
71
|
+
/**
|
|
72
|
+
* The parent, when this node and the parent both have a box from the last frame.
|
|
73
|
+
* `null` when either lacks a box or there is no parent.
|
|
74
|
+
*/
|
|
75
|
+
readonly offsetParent: IncaElement | null;
|
|
76
|
+
/** The box width less both borders, rounded, at least `0`. */
|
|
77
|
+
readonly clientWidth: number;
|
|
78
|
+
/** The box height less both borders, rounded, at least `0`. */
|
|
79
|
+
readonly clientHeight: number;
|
|
80
|
+
/** The border width, rounded. */
|
|
81
|
+
readonly clientLeft: number;
|
|
82
|
+
/** The border width, rounded. */
|
|
83
|
+
readonly clientTop: number;
|
|
84
|
+
/** The horizontal scroll offset. Assigning moves it at once, and reads are clamped to the last frame's maximum. */
|
|
85
|
+
scrollLeft: number;
|
|
86
|
+
/** The vertical scroll offset. Assigning moves it at once, and reads are clamped to the last frame's maximum. */
|
|
87
|
+
scrollTop: number;
|
|
88
|
+
/** The content width: {@link clientWidth} plus the largest horizontal offset. */
|
|
89
|
+
readonly scrollWidth: number;
|
|
90
|
+
/** The content height: {@link clientHeight} plus the largest vertical offset. */
|
|
91
|
+
readonly scrollHeight: number;
|
|
92
|
+
/** Sets the offset to `(left, top)`, or to the options object's `left` and `top`. */
|
|
93
|
+
scrollTo(left?: number, top?: number): void;
|
|
94
|
+
scrollTo(options: ScrollOptions): void;
|
|
95
|
+
/** Adds `(left, top)` to the offset, or the options object's `left` and `top`. */
|
|
96
|
+
scrollBy(left?: number, top?: number): void;
|
|
97
|
+
scrollBy(options: ScrollOptions): void;
|
|
98
|
+
/**
|
|
99
|
+
* Scrolls each scroll container around this node so the node shows. `true`
|
|
100
|
+
* or no argument aligns to the start and `false` to the end. An options
|
|
101
|
+
* object sets `block` (default `"start"`) and `inline` (default `"nearest"`);
|
|
102
|
+
* `behavior` is accepted and ignored. After the node is removed, the call
|
|
103
|
+
* does nothing.
|
|
104
|
+
*/
|
|
105
|
+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
|
|
44
106
|
}
|
|
45
107
|
/** A text leaf host node — `@vue/runtime-core`'s `HostNode` for text. */
|
|
46
108
|
export interface IncaText {
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IncaCore } from '../rendererCore.mts';
|
|
2
|
+
import { IncaElement } from './nodeOps.mts';
|
|
3
|
+
/**
|
|
4
|
+
* The parent a node's offsets are measured from. It is the parent when both
|
|
5
|
+
* the node and the parent have a recorded box.
|
|
6
|
+
* @param core - the incajs bindings to read through
|
|
7
|
+
* @param el - the node to query
|
|
8
|
+
* @returns the parent, or `null`
|
|
9
|
+
*/
|
|
10
|
+
export declare function offsetParentOf(core: IncaCore, el: IncaElement): IncaElement | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LayoutBox } from './layoutBox.mts';
|
|
2
|
+
/** The plain values of a {@link RectLike}, as `toJSON` returns them. */
|
|
3
|
+
export interface RectValues {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
readonly top: number;
|
|
9
|
+
readonly left: number;
|
|
10
|
+
readonly right: number;
|
|
11
|
+
readonly bottom: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A rectangle with its position, its size and its four edges. `toJSON()` returns
|
|
15
|
+
* the plain values.
|
|
16
|
+
*/
|
|
17
|
+
export interface RectLike extends RectValues {
|
|
18
|
+
toJSON(): RectValues;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Builds a rect from a node's box. Values stay unrounded.
|
|
22
|
+
* @param layout - the box from {@link LayoutBox}, or `null` for no record
|
|
23
|
+
* @returns the rect; all zeros for `null`
|
|
24
|
+
*/
|
|
25
|
+
export declare function rectOf(layout: LayoutBox | null): RectLike;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ScrollAlignment } from '../types.mts';
|
|
2
|
+
/** The options form of `scrollIntoView()`. `behavior` is accepted and ignored. */
|
|
3
|
+
export interface ScrollIntoViewOptions {
|
|
4
|
+
/** The vertical alignment. Defaults to `"start"`. */
|
|
5
|
+
block?: ScrollAlignment;
|
|
6
|
+
/** The horizontal alignment. Defaults to `"nearest"`. */
|
|
7
|
+
inline?: ScrollAlignment;
|
|
8
|
+
/** `behavior` is ignored; every scroll applies at once. */
|
|
9
|
+
behavior?: "auto" | "instant" | "smooth";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Turns `scrollIntoView()`'s argument into the alignment pair. `true` or no
|
|
13
|
+
* argument aligns to the start, `false` to the end, and an options object
|
|
14
|
+
* takes each axis from its own key. An unknown string falls back to that
|
|
15
|
+
* axis's default.
|
|
16
|
+
* @param arg - the boolean or options object the caller passed
|
|
17
|
+
* @returns the `block` and `inline` alignments to send to the host
|
|
18
|
+
*/
|
|
19
|
+
export declare function scrollIntoViewArgs(arg?: boolean | ScrollIntoViewOptions): {
|
|
20
|
+
block: ScrollAlignment;
|
|
21
|
+
inline: ScrollAlignment;
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IncaCore } from '../rendererCore.mts';
|
|
2
|
+
import { IncaElement } from './nodeOps.mts';
|
|
3
|
+
/** The options form of `scrollTo()` and `scrollBy()`. `behavior` is accepted and ignored. */
|
|
4
|
+
export interface ScrollOptions {
|
|
5
|
+
/** The horizontal offset. Omit to keep the current one. */
|
|
6
|
+
left?: number;
|
|
7
|
+
/** The vertical offset. Omit to keep the current one. */
|
|
8
|
+
top?: number;
|
|
9
|
+
/** `behavior` is ignored; every scroll applies at once. */
|
|
10
|
+
behavior?: "auto" | "instant" | "smooth";
|
|
11
|
+
}
|
|
12
|
+
/** Either `(left, top)` or an options object. */
|
|
13
|
+
export type ScrollArgs = [left?: number, top?: number] | [options?: ScrollOptions];
|
|
14
|
+
/**
|
|
15
|
+
* Moves a node's scroll offset. An omitted axis keeps its offset, and a
|
|
16
|
+
* non-finite value counts as `0`. A destroyed node ignores the call.
|
|
17
|
+
* @param core - the incajs bindings to write through
|
|
18
|
+
* @param el - the node to scroll
|
|
19
|
+
* @param args - `(left, top)` or `{ left, top }`
|
|
20
|
+
* @param relative - `true` adds the values to the current offset
|
|
21
|
+
*/
|
|
22
|
+
export declare function scrollPosition(core: IncaCore, el: IncaElement, args: ScrollArgs, relative: boolean): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks `handle` so that Vue's `reactive()` and `ref()` keep the object itself.
|
|
3
|
+
* A template ref then holds the same object the application receives from
|
|
4
|
+
* `activeElement()`.
|
|
5
|
+
* @param handle - the node handle to mark
|
|
6
|
+
* @returns `handle`
|
|
7
|
+
*/
|
|
8
|
+
export declare function skipReactive<T extends object>(handle: T): T;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads a `tabindex` attribute value as the element's tab index. A value that
|
|
3
|
+
* is missing, not a string or number, has no leading integer, or falls outside
|
|
4
|
+
* the 32-bit signed range yields the default.
|
|
5
|
+
* @param value - the stored `tabindex` attribute, or `null` if unset
|
|
6
|
+
* @param kind - the element kind; `"button"` defaults to `0`, any other kind to `-1`
|
|
7
|
+
* @returns the parsed tab index, or the default
|
|
8
|
+
*/
|
|
9
|
+
export declare function tabIndexOf(value: string | number | boolean | null, kind: string): number;
|
package/dist/vue.js
CHANGED
|
@@ -1,37 +1,220 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./rendererCore.js";
|
|
3
|
-
import { ErrorCodes as
|
|
4
|
-
//#region src/vue/
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { S as e, u as t } from "./chunks/tree-Ds0zSuJO.js";
|
|
2
|
+
import { t as n } from "./rendererCore.js";
|
|
3
|
+
import { ErrorCodes as r, callWithAsyncErrorHandling as i, createRenderer as a } from "@vue/runtime-core";
|
|
4
|
+
//#region src/vue/elements.mts
|
|
5
|
+
var o = /* @__PURE__ */ new Map(), s = new FinalizationRegistry((e) => {
|
|
6
|
+
o.get(e)?.deref() || o.delete(e);
|
|
7
|
+
});
|
|
8
|
+
function c(e) {
|
|
9
|
+
o.set(e.id, new WeakRef(e)), s.register(e, e.id);
|
|
10
|
+
}
|
|
11
|
+
function l(e) {
|
|
12
|
+
o.delete(e);
|
|
13
|
+
}
|
|
14
|
+
function u(e) {
|
|
15
|
+
return o.get(e)?.deref();
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/vue/destroyedNodes.mts
|
|
19
|
+
var d = /* @__PURE__ */ new WeakSet();
|
|
20
|
+
function f(e) {
|
|
21
|
+
return d.has(e);
|
|
22
|
+
}
|
|
23
|
+
function p(e) {
|
|
24
|
+
if (d.add(e), e.kind !== "text") {
|
|
25
|
+
l(e.id);
|
|
26
|
+
for (let t of e.children) p(t);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/vue/layoutBox.mts
|
|
31
|
+
function m(e, t) {
|
|
32
|
+
return f(t) ? null : e.layoutOf(t.id);
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/vue/offsetParent.mts
|
|
36
|
+
function h(e, t) {
|
|
37
|
+
let n = t.parent;
|
|
38
|
+
return !m(e, t) || !n || !m(e, n) ? null : n;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/vue/offsetOf.mts
|
|
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;
|
|
7
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
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/vue/rectOf.mts
|
|
56
|
+
function _(e) {
|
|
57
|
+
let [t, n, r, i] = e ?? [
|
|
58
|
+
0,
|
|
59
|
+
0,
|
|
60
|
+
0,
|
|
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
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/vue/scrollIntoViewArgs.mts
|
|
80
|
+
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
|
+
return Object.defineProperty(e, "__v_skip", { value: !0 }), e;
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
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 = {
|
|
8
125
|
id: t,
|
|
9
126
|
kind: n,
|
|
10
127
|
parent: null,
|
|
11
128
|
children: [],
|
|
12
|
-
focus: () =>
|
|
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
|
+
},
|
|
13
134
|
blur: () => e.blur(t),
|
|
14
135
|
click: () => e.click(t),
|
|
15
|
-
...e
|
|
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),
|
|
16
143
|
get tabIndex() {
|
|
17
|
-
return
|
|
144
|
+
return x(f(o) ? null : e.getAttribute(t, "tabindex"), r ?? "");
|
|
18
145
|
},
|
|
19
146
|
set tabIndex(n) {
|
|
20
|
-
|
|
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);
|
|
21
203
|
}
|
|
22
204
|
};
|
|
205
|
+
return n === "element" && c(o), b(o);
|
|
23
206
|
}
|
|
24
207
|
//#endregion
|
|
25
208
|
//#region src/vue/nodeOps.mts
|
|
26
|
-
function
|
|
209
|
+
function C(e) {
|
|
27
210
|
function t(t) {
|
|
28
211
|
let n = e.createNode("text");
|
|
29
|
-
return e.setAttribute(n, "value", t), {
|
|
212
|
+
return e.setAttribute(n, "value", t), b({
|
|
30
213
|
id: n,
|
|
31
214
|
kind: "text",
|
|
32
215
|
parent: null,
|
|
33
216
|
text: t
|
|
34
|
-
};
|
|
217
|
+
});
|
|
35
218
|
}
|
|
36
219
|
function n(e) {
|
|
37
220
|
let t = e.parent;
|
|
@@ -44,18 +227,18 @@ function o(e) {
|
|
|
44
227
|
}
|
|
45
228
|
return {
|
|
46
229
|
createElement(t) {
|
|
47
|
-
return
|
|
230
|
+
return S(e, e.createNode(t), "element", t);
|
|
48
231
|
},
|
|
49
232
|
createText: t,
|
|
50
233
|
createComment(t) {
|
|
51
234
|
let n = e.createNode("div");
|
|
52
|
-
return e.setStyle(n, "display", "none"),
|
|
235
|
+
return e.setStyle(n, "display", "none"), S(e, n, "comment");
|
|
53
236
|
},
|
|
54
237
|
setText(t, n) {
|
|
55
238
|
e.setAttribute(t.id, "value", n), t.text = n;
|
|
56
239
|
},
|
|
57
240
|
setElementText(n, r) {
|
|
58
|
-
for (let t of n.children.splice(0)) e.destroyNode(t.id), t.parent = null;
|
|
241
|
+
for (let t of n.children.splice(0)) e.destroyNode(t.id), p(t), t.parent = null;
|
|
59
242
|
if (!r) return;
|
|
60
243
|
let i = t(r);
|
|
61
244
|
e.appendChild(n.id, i.id), i.parent = n, n.children.push(i);
|
|
@@ -67,7 +250,7 @@ function o(e) {
|
|
|
67
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;
|
|
68
251
|
},
|
|
69
252
|
remove(t) {
|
|
70
|
-
n(t), e.destroyNode(t.id);
|
|
253
|
+
n(t), e.destroyNode(t.id), p(t);
|
|
71
254
|
},
|
|
72
255
|
parentNode(e) {
|
|
73
256
|
return e.parent;
|
|
@@ -82,30 +265,30 @@ function o(e) {
|
|
|
82
265
|
}
|
|
83
266
|
//#endregion
|
|
84
267
|
//#region src/vue/patchProp.mts
|
|
85
|
-
var
|
|
86
|
-
function
|
|
268
|
+
var w = (e) => /^on[^a-z]/.test(e) && !e.startsWith("onUpdate:"), T = /(?:Once|Passive|Capture)$/, E = /^on:?(?:Once|Passive|Capture)$/, D = (e) => e.replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
269
|
+
function O(e) {
|
|
87
270
|
let t = e, n = {
|
|
88
271
|
event: "",
|
|
89
272
|
once: !1,
|
|
90
273
|
capture: !1,
|
|
91
274
|
passive: !1
|
|
92
275
|
}, r;
|
|
93
|
-
for (; (r = t.match(
|
|
94
|
-
return n.event = t[2] === ":" ? t.slice(3) :
|
|
276
|
+
for (; (r = t.match(T)) && !E.test(t);) t = t.slice(0, -r[0].length), r[0] === "Once" ? n.once = !0 : r[0] === "Capture" ? n.capture = !0 : n.passive = !0;
|
|
277
|
+
return n.event = t[2] === ":" ? t.slice(3) : D(t.slice(2)), n;
|
|
95
278
|
}
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
let r = typeof n == "object" && n ? n : {}, i =
|
|
99
|
-
i ||
|
|
279
|
+
var k = (e) => typeof e == "string" || typeof e == "number", A = /* @__PURE__ */ new WeakMap();
|
|
280
|
+
function j(e, t, n) {
|
|
281
|
+
let r = typeof n == "object" && n ? n : {}, i = A.get(t);
|
|
282
|
+
i || A.set(t, i = /* @__PURE__ */ new Map());
|
|
100
283
|
let a = !1;
|
|
101
|
-
for (let n of i.keys())
|
|
102
|
-
for (let [n, o] of Object.entries(r))
|
|
284
|
+
for (let n of i.keys()) k(r[n]) || (e.removeStyle(t.id, n), i.delete(n), a = !0);
|
|
285
|
+
for (let [n, o] of Object.entries(r)) k(o) && (a || i.get(n) !== o) && (e.setStyle(t.id, n, o), i.set(n, o));
|
|
103
286
|
}
|
|
104
|
-
function
|
|
287
|
+
function M(e) {
|
|
105
288
|
let t = (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "function");
|
|
106
289
|
return t.length === 0 ? null : t;
|
|
107
290
|
}
|
|
108
|
-
function
|
|
291
|
+
function N(e, t) {
|
|
109
292
|
let n = e[0];
|
|
110
293
|
if (typeof n != "object" || !n) return t(() => !1);
|
|
111
294
|
let r = n.stopImmediatePropagation;
|
|
@@ -122,12 +305,12 @@ function g(e, t) {
|
|
|
122
305
|
i ? n.stopImmediatePropagation = r : delete n.stopImmediatePropagation;
|
|
123
306
|
}
|
|
124
307
|
}
|
|
125
|
-
var
|
|
126
|
-
function
|
|
308
|
+
var P = /* @__PURE__ */ new WeakMap(), F = ({ event: e, capture: t, passive: n }) => `${e}:${t === !0}:${n === !0}`;
|
|
309
|
+
function I(e, t, n, r) {
|
|
127
310
|
let i = Array.from(r.slots.values()).some((e) => !e.fired);
|
|
128
|
-
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 &&
|
|
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 && P.get(t)?.delete(n);
|
|
129
312
|
}
|
|
130
|
-
function
|
|
313
|
+
function L(e, t, n, { event: a, capture: o, passive: s }) {
|
|
131
314
|
let c = {
|
|
132
315
|
event: a,
|
|
133
316
|
options: {
|
|
@@ -138,16 +321,16 @@ function b(e, t, i, { event: a, capture: o, passive: s }) {
|
|
|
138
321
|
registered: !1,
|
|
139
322
|
dispatcher: (...a) => {
|
|
140
323
|
let o = [], s = a[0]?.eventId;
|
|
141
|
-
|
|
324
|
+
N(a, (l) => {
|
|
142
325
|
for (let u of Array.from(c.slots.keys())) {
|
|
143
326
|
if (l()) break;
|
|
144
327
|
let d = c.slots.get(u);
|
|
145
328
|
if (d && !d.fired && !(typeof s == "number" && d.attachedAt >= s)) {
|
|
146
|
-
d.once && (d.fired = !0,
|
|
329
|
+
d.once && (d.fired = !0, I(e, t, n, c));
|
|
147
330
|
for (let e of d.handlers) {
|
|
148
331
|
if (l()) break;
|
|
149
332
|
try {
|
|
150
|
-
|
|
333
|
+
i(e, d.instance, r.NATIVE_EVENT_HANDLER, a);
|
|
151
334
|
} catch (e) {
|
|
152
335
|
o.push(e);
|
|
153
336
|
}
|
|
@@ -161,20 +344,20 @@ function b(e, t, i, { event: a, capture: o, passive: s }) {
|
|
|
161
344
|
};
|
|
162
345
|
return c;
|
|
163
346
|
}
|
|
164
|
-
function
|
|
165
|
-
let i =
|
|
166
|
-
a?.slots.delete(r) &&
|
|
347
|
+
function R(e, t, n, r) {
|
|
348
|
+
let i = F(n), a = P.get(t)?.get(i);
|
|
349
|
+
a?.slots.delete(r) && I(e, t, i, a);
|
|
167
350
|
}
|
|
168
|
-
function
|
|
169
|
-
let a =
|
|
351
|
+
function z(e, t, n, r, i) {
|
|
352
|
+
let a = O(n), o = M(r);
|
|
170
353
|
if (!o) {
|
|
171
|
-
|
|
354
|
+
R(e, t, a, n);
|
|
172
355
|
return;
|
|
173
356
|
}
|
|
174
|
-
let s =
|
|
175
|
-
c ||
|
|
357
|
+
let s = F(a), c = P.get(t);
|
|
358
|
+
c || P.set(t, c = /* @__PURE__ */ new Map());
|
|
176
359
|
let l = c.get(s);
|
|
177
|
-
l || c.set(s, l =
|
|
360
|
+
l || c.set(s, l = L(e, t, s, a));
|
|
178
361
|
let u = l.slots.get(n);
|
|
179
362
|
if (u) u.handlers = o, u.instance = i;
|
|
180
363
|
else {
|
|
@@ -186,30 +369,36 @@ function S(e, t, n, r, i) {
|
|
|
186
369
|
fired: !1
|
|
187
370
|
});
|
|
188
371
|
try {
|
|
189
|
-
|
|
372
|
+
I(e, t, s, l);
|
|
190
373
|
} catch (e) {
|
|
191
374
|
throw l.slots.delete(n), l.slots.size === 0 && c.delete(s), e;
|
|
192
375
|
}
|
|
193
376
|
}
|
|
194
377
|
}
|
|
195
|
-
var
|
|
378
|
+
var B = /* @__PURE__ */ new Set([
|
|
196
379
|
"disabled",
|
|
197
380
|
"hidden",
|
|
198
381
|
"inert"
|
|
199
382
|
]);
|
|
200
|
-
function
|
|
383
|
+
function V(e) {
|
|
201
384
|
return (t, n, r, i, a, o) => {
|
|
202
|
-
n === "style" ?
|
|
385
|
+
n === "style" ? j(e, t, i) : w(n) ? z(e, t, n, i, o ?? null) : B.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));
|
|
203
386
|
};
|
|
204
387
|
}
|
|
205
388
|
//#endregion
|
|
206
389
|
//#region src/vue/createApp.mts
|
|
207
|
-
function
|
|
208
|
-
let
|
|
209
|
-
...
|
|
210
|
-
patchProp:
|
|
211
|
-
}).createApp(
|
|
212
|
-
return Object.assign(
|
|
390
|
+
function H(e, r) {
|
|
391
|
+
let i = a({
|
|
392
|
+
...C(n),
|
|
393
|
+
patchProp: V(n)
|
|
394
|
+
}).createApp(e, r), o = i.mount.bind(i);
|
|
395
|
+
return Object.assign(i, { mount: (e) => o(e ?? S(n, t(), "element")) });
|
|
396
|
+
}
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/vue/activeElement.mts
|
|
399
|
+
function U() {
|
|
400
|
+
let t = e();
|
|
401
|
+
return t === null ? null : u(t) ?? null;
|
|
213
402
|
}
|
|
214
403
|
//#endregion
|
|
215
|
-
export {
|
|
404
|
+
export { U as activeElement, H as createIncaApp };
|