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
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { IncaEventTarget, NodeId } from '../rendererCore.mts';
|
|
2
|
+
import { RectLike } from './geometry.mts';
|
|
3
|
+
import { ScrollIntoViewOptions, ScrollOptions } from './scroll.mts';
|
|
4
|
+
/**
|
|
5
|
+
* A container node: either a real element or the hidden stand-in that
|
|
6
|
+
* `createCommentNode` makes. It is the only node type that can act as a
|
|
7
|
+
* parent.
|
|
8
|
+
*
|
|
9
|
+
* `inca`'s native tree has no parent pointers and no way to list a
|
|
10
|
+
* node's children, so `parent`/`children` are maintained here as a
|
|
11
|
+
* JS-side shadow of the tree, kept in sync by `insert` and
|
|
12
|
+
* `remove`.
|
|
13
|
+
*
|
|
14
|
+
* After the node is removed, `addEventListener()` and `removeEventListener()`
|
|
15
|
+
* ignore the call, and `dispatchEvent()` returns `true`.
|
|
16
|
+
*/
|
|
17
|
+
export interface IncaElement extends IncaEventTarget {
|
|
18
|
+
/**
|
|
19
|
+
* The underlying native node's id, the only part of this object the native
|
|
20
|
+
* tree itself knows about.
|
|
21
|
+
*/
|
|
22
|
+
readonly id: NodeId;
|
|
23
|
+
/**
|
|
24
|
+
* `"comment"` for the hidden stand-in `createCommentNode`
|
|
25
|
+
* makes; `"element"` for every other container. Purely
|
|
26
|
+
* informational: both render identically once created.
|
|
27
|
+
*/
|
|
28
|
+
readonly kind: "element" | "comment";
|
|
29
|
+
/** The current parent, or `null` if this node isn't attached to the tree. */
|
|
30
|
+
parent: IncaElement | null;
|
|
31
|
+
/** This node's children, in render order. */
|
|
32
|
+
children: IncaNode[];
|
|
33
|
+
/**
|
|
34
|
+
* Focuses this node next frame. The node needs a `tabindex` attribute. A
|
|
35
|
+
* `true` `preventScroll` keeps every scroll container where it is. After
|
|
36
|
+
* the node is removed, the call does nothing.
|
|
37
|
+
*/
|
|
38
|
+
focus(options?: {
|
|
39
|
+
preventScroll?: boolean;
|
|
40
|
+
}): void;
|
|
41
|
+
/** Unfocuses this node next frame, if it is the focused one. */
|
|
42
|
+
blur(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Fires an untrusted `click` at this node. A disabled `button`, a node whose
|
|
45
|
+
* own click is still running and an unknown node ignore the call.
|
|
46
|
+
*/
|
|
47
|
+
click(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Assigning sets the `tabindex` attribute to the value's integer part,
|
|
50
|
+
* wrapped to 32 bits. Reading returns the `tabindex` attribute as an
|
|
51
|
+
* integer, or `-1` (`0` for a `button`) when it is unset or invalid.
|
|
52
|
+
* After the node is removed, reading gives that default and assigning does
|
|
53
|
+
* nothing.
|
|
54
|
+
*/
|
|
55
|
+
tabIndex: number;
|
|
56
|
+
/**
|
|
57
|
+
* The box this node was drawn at in the last frame, in window logical
|
|
58
|
+
* pixels. A node created in the same task reads all zeros.
|
|
59
|
+
*/
|
|
60
|
+
getBoundingClientRect(): RectLike;
|
|
61
|
+
/** The box width from the last frame, rounded. `0` until a frame draws the node. */
|
|
62
|
+
readonly offsetWidth: number;
|
|
63
|
+
/** The box height from the last frame, rounded. `0` until a frame draws the node. */
|
|
64
|
+
readonly offsetHeight: number;
|
|
65
|
+
/** The box's left edge from the last frame, relative to {@link offsetParent}. Stays fixed while the parent scrolls. */
|
|
66
|
+
readonly offsetLeft: number;
|
|
67
|
+
/** The box's top edge from the last frame, relative to {@link offsetParent}. Stays fixed while the parent scrolls. */
|
|
68
|
+
readonly offsetTop: number;
|
|
69
|
+
/**
|
|
70
|
+
* The parent, when this node and the parent both have a box from the last frame.
|
|
71
|
+
* `null` when either lacks a box or there is no parent.
|
|
72
|
+
*/
|
|
73
|
+
readonly offsetParent: IncaElement | null;
|
|
74
|
+
/** The box width less both borders, rounded, at least `0`. */
|
|
75
|
+
readonly clientWidth: number;
|
|
76
|
+
/** The box height less both borders, rounded, at least `0`. */
|
|
77
|
+
readonly clientHeight: number;
|
|
78
|
+
/** The border width, rounded. */
|
|
79
|
+
readonly clientLeft: number;
|
|
80
|
+
/** The border width, rounded. */
|
|
81
|
+
readonly clientTop: number;
|
|
82
|
+
/** The horizontal scroll offset. Assigning moves it at once, and reads are clamped to the last frame's maximum. */
|
|
83
|
+
scrollLeft: number;
|
|
84
|
+
/** The vertical scroll offset. Assigning moves it at once, and reads are clamped to the last frame's maximum. */
|
|
85
|
+
scrollTop: number;
|
|
86
|
+
/** The content width: {@link clientWidth} plus the largest horizontal offset. */
|
|
87
|
+
readonly scrollWidth: number;
|
|
88
|
+
/** The content height: {@link clientHeight} plus the largest vertical offset. */
|
|
89
|
+
readonly scrollHeight: number;
|
|
90
|
+
/** Sets the offset to `(left, top)`, or to the options object's `left` and `top`. */
|
|
91
|
+
scrollTo(left?: number, top?: number): void;
|
|
92
|
+
scrollTo(options: ScrollOptions): void;
|
|
93
|
+
/** Adds `(left, top)` to the offset, or the options object's `left` and `top`. */
|
|
94
|
+
scrollBy(left?: number, top?: number): void;
|
|
95
|
+
scrollBy(options: ScrollOptions): void;
|
|
96
|
+
/**
|
|
97
|
+
* Scrolls each scroll container around this node so the node shows. `true`
|
|
98
|
+
* or no argument aligns to the start and `false` to the end. An options
|
|
99
|
+
* object sets `block` (default `"start"`) and `inline` (default `"nearest"`);
|
|
100
|
+
* `behavior` is accepted and ignored. After the node is removed, the call
|
|
101
|
+
* does nothing.
|
|
102
|
+
*/
|
|
103
|
+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
|
|
104
|
+
}
|
|
105
|
+
/** A text leaf node. */
|
|
106
|
+
export interface IncaText {
|
|
107
|
+
/** The underlying native node's id. */
|
|
108
|
+
readonly id: NodeId;
|
|
109
|
+
/** Discriminates this node within the {@link IncaNode} union. */
|
|
110
|
+
readonly kind: "text";
|
|
111
|
+
/** The current parent, or `null` if this node isn't attached to the tree. */
|
|
112
|
+
parent: IncaElement | null;
|
|
113
|
+
/**
|
|
114
|
+
* The text content, mirroring the value pushed to the native node.
|
|
115
|
+
*/
|
|
116
|
+
text: string;
|
|
117
|
+
}
|
|
118
|
+
/** Any node the shadow tree holds: an element, comment, or text leaf. */
|
|
119
|
+
export type IncaNode = IncaElement | IncaText;
|
package/dist/events.d.mts
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* @returns how many `(nodeId, event, capture)` groups hold a registration
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare function registeredGroupCount(): number;
|
|
1
|
+
import { EventLike, EventListenerOrObject, ListenerOptions, NodeId } from './types.mts';
|
|
7
2
|
/**
|
|
8
3
|
* @returns the `eventId` of the newest event any registered listener has
|
|
9
4
|
* received, or 0 before the first. Ids grow with each event, and every
|
|
10
5
|
* listener of one event receives the same id.
|
|
11
6
|
*/
|
|
12
7
|
export declare function latestEventId(): number;
|
|
13
|
-
/**
|
|
14
|
-
* Drops the JS half of every registration in `callbackIds`. The native half
|
|
15
|
-
* is already gone by the time this runs — `destroyNode` takes both.
|
|
16
|
-
* @param callbackIds - ids the host reported as released
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export declare function releaseCallbacks(callbackIds: readonly CallbackId[]): void;
|
|
20
8
|
/**
|
|
21
9
|
* Registers `listener` for `event` on `nodeId`. Registering the same listener
|
|
22
10
|
* for the same node, event and `capture` again changes nothing, and the first
|
|
@@ -33,6 +21,7 @@ export declare function releaseCallbacks(callbackIds: readonly CallbackId[]): vo
|
|
|
33
21
|
* `once` removes the listener before it first runs
|
|
34
22
|
* @throws TypeError when `nodeId` is malformed
|
|
35
23
|
* @throws TypeError when `nodeId` names no node
|
|
24
|
+
* @throws RangeError when the host has issued its last callback id
|
|
36
25
|
*/
|
|
37
26
|
export declare function addEventListener(nodeId: NodeId, event: string, listener: EventListenerOrObject | null, options?: ListenerOptions): void;
|
|
38
27
|
/**
|
|
@@ -78,8 +67,3 @@ export declare function focus(nodeId: NodeId, preventScroll?: boolean): void;
|
|
|
78
67
|
* @param nodeId - the node to unfocus
|
|
79
68
|
*/
|
|
80
69
|
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.d.mts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
export { activeElement } from './element/handle.mts';
|
|
1
2
|
export { window } from './window.mts';
|
|
3
|
+
export type { RectLike, RectValues } from './element/geometry.mts';
|
|
4
|
+
export type { ScrollIntoViewOptions, ScrollOptions } from './element/scroll.mts';
|
|
5
|
+
export type { IncaElement, IncaNode } from './element/types.mts';
|
|
2
6
|
export type { AttributeValue, CallbackId, EventLike, EventListener, EventListenerObject, EventListenerOrObject, IncaEventTarget, ListenerOptions, NodeId, StyleProps, TagName, } from './types.mts';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as e, v as t } from "./chunks/rendererCore-U_s1R1v7.js";
|
|
2
|
+
import { t as n } from "./chunks/handle-B1h0qxex.js";
|
|
2
3
|
//#region src/window.mts
|
|
3
|
-
var
|
|
4
|
+
var r = /* @__PURE__ */ t(e, ["wheel"]);
|
|
4
5
|
//#endregion
|
|
5
|
-
export { n as window };
|
|
6
|
+
export { n as activeElement, r as window };
|
package/dist/native.d.mts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { AttributeValue, CallbackId, EventLike, NodeId, ScrollAlignment } from './types.mts';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The host-injected object every wrapper in this package forwards to. Not part of the public
|
|
4
|
+
* surface.
|
|
5
|
+
*/
|
|
3
6
|
interface IncaNative {
|
|
4
7
|
rootNodeId(): NodeId;
|
|
5
8
|
createNode(tag: string): NodeId;
|
|
@@ -11,7 +14,7 @@ interface IncaNative {
|
|
|
11
14
|
removeAttribute(nodeId: NodeId, key: string): void;
|
|
12
15
|
setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
13
16
|
removeStyle(nodeId: NodeId, key: string): void;
|
|
14
|
-
addEventListener(nodeId: NodeId, event: string,
|
|
17
|
+
addEventListener(nodeId: NodeId, event: string, capture?: boolean, passive?: boolean): CallbackId;
|
|
15
18
|
removeEventListener(nodeId: NodeId, event: string, callbackId: CallbackId): boolean;
|
|
16
19
|
destroyNode(nodeId: NodeId): CallbackId[];
|
|
17
20
|
focusNode(nodeId: NodeId, preventScroll?: boolean): void;
|
package/dist/rendererCore.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createEventTarget } from './
|
|
2
|
-
export { addEventListener, removeEventListener, latestEventId, focus, blur,
|
|
3
|
-
export { appendChild, createNode, destroyNode, insertBefore, removeChild, rootNodeId, setAttribute, getAttribute, layoutOf, scrollOf, scrollNode, scrollIntoViewNode, removeAttribute, setStyle, removeStyle, } from './tree.mts';
|
|
1
|
+
export { createEventTarget } from './eventTarget.mts';
|
|
2
|
+
export { addEventListener, removeEventListener, latestEventId, focus, blur, dispatchEvent, click, } from './events.mts';
|
|
3
|
+
export { focusedNode, 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,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var w = Object.defineProperty, T = /* @__PURE__ */ ((e, t) => {
|
|
4
|
-
let n = {};
|
|
5
|
-
for (var r in e) w(n, r, {
|
|
6
|
-
get: e[r],
|
|
7
|
-
enumerable: !0
|
|
8
|
-
});
|
|
9
|
-
return t || w(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
10
|
-
})({
|
|
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,
|
|
23
|
-
latestEventId: () => e,
|
|
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
|
|
35
|
-
});
|
|
36
|
-
//#endregion
|
|
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 };
|
|
1
|
+
export { y as addEventListener, n as appendChild, b as blur, x as click, v as createEventTarget, r as createNode, i as destroyNode, S as dispatchEvent, C as focus, a as focusedNode, o as getAttribute, s as insertBefore, w as latestEventId, c as layoutOf, l as removeAttribute, u as removeChild, T as removeEventListener, d as removeStyle, f as rootNodeId, p as scrollIntoViewNode, m as scrollNode, h as scrollOf, g as setAttribute, _ as setStyle } from "./chunks/rendererCore-U_s1R1v7.js";
|
package/dist/tree.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AttributeValue, NodeId, ScrollAlignment, StyleProps, TagName } from './types.mts';
|
|
2
2
|
/**
|
|
3
|
-
* Returns the host-allocated root container's id
|
|
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
|
|
5
5
|
* the first call and names the same node for the engine's lifetime.
|
|
6
6
|
* @returns the root node's id
|
|
@@ -8,7 +8,7 @@ import { AttributeValue, NodeId, ScrollAlignment, StyleProps, TagName } from './
|
|
|
8
8
|
export declare function rootNodeId(): NodeId;
|
|
9
9
|
/**
|
|
10
10
|
* Allocates a new node of kind `tag` in the native tree. The node starts out
|
|
11
|
-
* detached
|
|
11
|
+
* detached. Attach it with {@link appendChild}/{@link insertBefore}.
|
|
12
12
|
* @param tag - the node's element kind
|
|
13
13
|
* @returns the new node's id
|
|
14
14
|
*/
|
|
@@ -24,7 +24,7 @@ export declare function appendChild(parentId: NodeId, childId: NodeId): void;
|
|
|
24
24
|
* Attaches `childId` as a child of `parentId`, positioned before `anchorId`
|
|
25
25
|
* (or at the end, if `anchorId` is `null`). If `anchorId` names a real node
|
|
26
26
|
* that just isn't currently a child of `parentId`, this falls back to
|
|
27
|
-
* appending at the end instead of throwing
|
|
27
|
+
* appending at the end instead of throwing. Only a wholly unknown
|
|
28
28
|
* `anchorId` raises.
|
|
29
29
|
* @param parentId - the container to attach to
|
|
30
30
|
* @param childId - the node being attached
|
|
@@ -32,9 +32,9 @@ export declare function appendChild(parentId: NodeId, childId: NodeId): void;
|
|
|
32
32
|
*/
|
|
33
33
|
export declare function insertBefore(parentId: NodeId, childId: NodeId, anchorId: NodeId | null): void;
|
|
34
34
|
/**
|
|
35
|
-
* Detaches `childId` from `parentId`. The detached node stays alive
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* Detaches `childId` from `parentId`. The detached node stays alive and keeps
|
|
36
|
+
* its own children, so it can be re-attached elsewhere. Use
|
|
37
|
+
* {@link destroyNode} for a node that isn't coming back.
|
|
38
38
|
* @param parentId - the current container
|
|
39
39
|
* @param childId - the node being detached
|
|
40
40
|
*/
|
|
@@ -136,3 +136,8 @@ export declare function setStyle(nodeId: NodeId, key: string, value: AttributeVa
|
|
|
136
136
|
* @param key - the style property name in any of the three spellings
|
|
137
137
|
*/
|
|
138
138
|
export declare function removeStyle(nodeId: NodeId, key: string): void;
|
|
139
|
+
/**
|
|
140
|
+
* Returns the id of the focused node.
|
|
141
|
+
* @returns the focused node's id, or `null` when no node has focus
|
|
142
|
+
*/
|
|
143
|
+
export declare function focusedNode(): NodeId | null;
|
package/dist/types.d.mts
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
export type NodeId = number;
|
|
6
6
|
/**
|
|
7
7
|
* Id assigned to one registered event listener. Managed internally by
|
|
8
|
-
* `addEventListener`/`removeEventListener`/`destroyNode
|
|
9
|
-
* pass one directly.
|
|
8
|
+
* `addEventListener`/`removeEventListener`/`destroyNode`.
|
|
10
9
|
*/
|
|
11
10
|
export type CallbackId = number;
|
|
12
11
|
/**
|
|
@@ -16,7 +15,7 @@ export type CallbackId = number;
|
|
|
16
15
|
export type AttributeValue = string | number | boolean;
|
|
17
16
|
/**
|
|
18
17
|
* Element kind passed to `createNode`. `"text"` is the only tag with
|
|
19
|
-
* dedicated rendering behavior
|
|
18
|
+
* dedicated rendering behavior: it renders its `"value"` attribute followed
|
|
20
19
|
* by its descendants' text. Any other string is a generic styled
|
|
21
20
|
* container; the `string & {}` half of this type keeps `"text"`'s
|
|
22
21
|
* autocomplete while still accepting an arbitrary tag name.
|
|
@@ -40,7 +39,7 @@ export interface StyleProps {
|
|
|
40
39
|
justify_content?: "start" | "end" | "center" | "stretch";
|
|
41
40
|
/** Cross-axis alignment of children within this container. */
|
|
42
41
|
align_items?: "start" | "end" | "center" | "stretch";
|
|
43
|
-
/** Uniform spacing, in px, between children
|
|
42
|
+
/** Uniform spacing, in px, between children, applied on both axes. */
|
|
44
43
|
gap?: number;
|
|
45
44
|
/** Fixed width in px, or `"auto"` to size to content. */
|
|
46
45
|
width?: number | "auto";
|
package/dist/vue/createApp.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { App, Component, ComponentPublicInstance } from '@vue/runtime-core';
|
|
2
|
-
import { IncaElement } from '
|
|
2
|
+
import { IncaElement } from '../element/types.mts';
|
|
3
3
|
/**
|
|
4
4
|
* `@vue/runtime-core`'s `App`, with `mount` additionally callable with no
|
|
5
5
|
* argument to target the host's own root container. An intersection rather
|
package/dist/vue/index.d.mts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
export { createIncaApp } from './createApp.mts';
|
|
2
|
-
export { activeElement } from './activeElement.mts';
|
|
3
2
|
export type { IncaApp } from './createApp.mts';
|
|
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';
|
|
8
|
-
export type { IncaElement, IncaNode } from './nodeOps.mts';
|
package/dist/vue/nodeOps.d.mts
CHANGED
|
@@ -1,132 +1,20 @@
|
|
|
1
1
|
import { RendererOptions } from '@vue/runtime-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ScrollIntoViewOptions } from './scrollIntoViewArgs.mts';
|
|
5
|
-
import { ScrollOptions } from './scrollPosition.mts';
|
|
2
|
+
import { IncaElement, IncaNode } from '../element/types.mts';
|
|
3
|
+
import { IncaCore } from '../rendererCore.mts';
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
12
|
-
* node's children, so `parent`/`children` are maintained here as a
|
|
13
|
-
* JS-side shadow of the tree, kept in sync by {@link NodeOps.insert}/
|
|
14
|
-
* {@link NodeOps.remove}.
|
|
15
|
-
*
|
|
16
|
-
* After the node is removed, `addEventListener()` and `removeEventListener()`
|
|
17
|
-
* ignore the call, and `dispatchEvent()` returns `true`.
|
|
5
|
+
* Marks `handle` so that Vue's `reactive()` and `ref()` keep the object itself.
|
|
6
|
+
* A template ref then holds the same object the application receives from
|
|
7
|
+
* `activeElement()`.
|
|
8
|
+
* @param handle - the node handle to mark
|
|
9
|
+
* @returns `handle`
|
|
18
10
|
*/
|
|
19
|
-
export
|
|
20
|
-
/**
|
|
21
|
-
* The underlying native node's id — the only part of this object the native
|
|
22
|
-
* tree itself knows about.
|
|
23
|
-
*/
|
|
24
|
-
readonly id: NodeId;
|
|
25
|
-
/**
|
|
26
|
-
* `"comment"` for the hidden stand-in {@link NodeOps.createComment}
|
|
27
|
-
* produces; `"element"` for every other container. Purely
|
|
28
|
-
* informational — both render identically once created.
|
|
29
|
-
*/
|
|
30
|
-
readonly kind: "element" | "comment";
|
|
31
|
-
/** The current parent, or `null` if this node isn't attached to the tree. */
|
|
32
|
-
parent: IncaElement | null;
|
|
33
|
-
/** This node's children, in render order. */
|
|
34
|
-
children: IncaNode[];
|
|
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;
|
|
43
|
-
/** Unfocuses this node next frame, if it is the focused one. */
|
|
44
|
-
blur(): void;
|
|
45
|
-
/**
|
|
46
|
-
* Fires an untrusted `click` at this node. A disabled `button`, a node whose
|
|
47
|
-
* own click is still running and an unknown node ignore the call.
|
|
48
|
-
*/
|
|
49
|
-
click(): void;
|
|
50
|
-
/**
|
|
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.
|
|
56
|
-
*/
|
|
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;
|
|
106
|
-
}
|
|
107
|
-
/** A text leaf host node — `@vue/runtime-core`'s `HostNode` for text. */
|
|
108
|
-
export interface IncaText {
|
|
109
|
-
/** The underlying native node's id. */
|
|
110
|
-
readonly id: NodeId;
|
|
111
|
-
/** Discriminates this node within the {@link IncaNode} union. */
|
|
112
|
-
readonly kind: "text";
|
|
113
|
-
/** The current parent, or `null` if this node isn't attached to the tree. */
|
|
114
|
-
parent: IncaElement | null;
|
|
115
|
-
/**
|
|
116
|
-
* The text content, mirroring what's been pushed to the native node via
|
|
117
|
-
* {@link IncaCore.setAttribute}.
|
|
118
|
-
*/
|
|
119
|
-
text: string;
|
|
120
|
-
}
|
|
121
|
-
/** Any host node {@link NodeOps} can produce: an element, comment, or text leaf. */
|
|
122
|
-
export type IncaNode = IncaElement | IncaText;
|
|
11
|
+
export declare function skipReactive<T extends object>(handle: T): T;
|
|
123
12
|
/** {@link createNodeOps}'s return shape. */
|
|
124
13
|
export type NodeOps = Omit<RendererOptions<IncaNode, IncaElement>, "patchProp">;
|
|
125
14
|
/**
|
|
126
15
|
* `@vue/runtime-core`'s {@link RendererOptions}`<IncaNode, IncaElement>`,
|
|
127
|
-
* minus `patchProp
|
|
128
|
-
* renderer
|
|
129
|
-
* native bridge directly.
|
|
16
|
+
* minus `patchProp`. This is the host-node lifecycle half of `incajs/vue`'s custom
|
|
17
|
+
* renderer.
|
|
130
18
|
* @param core - the incajs bindings to drive the native tree through
|
|
131
19
|
*/
|
|
132
20
|
export declare function createNodeOps(core: IncaCore): NodeOps;
|
package/dist/vue/patchProp.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RendererOptions } from '@vue/runtime-core';
|
|
2
|
+
import { IncaElement } from '../element/types.mts';
|
|
2
3
|
import { IncaCore } from '../rendererCore.mts';
|
|
3
|
-
import { IncaElement } from './nodeOps.mts';
|
|
4
4
|
/**
|
|
5
|
-
* {@link RendererOptions.patchProp}
|
|
5
|
+
* {@link RendererOptions.patchProp} applies one changed `v-bind`/
|
|
6
6
|
* attribute/event prop to a host element.
|
|
7
7
|
*
|
|
8
8
|
* ### `style`
|