@mintjamsinc/ichigojs 0.1.58 → 0.1.60
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/ichigo.cjs +394 -71
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +394 -71
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.min.cjs +1 -1
- package/dist/ichigo.umd.js +394 -71
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/dist/types/ichigo/VNode.d.ts +8 -0
- package/dist/types/ichigo/directives/StandardDirectiveName.d.ts +3 -1
- package/dist/types/ichigo/directives/VFocusDirective.d.ts +87 -0
- package/dist/types/ichigo/util/VFragmentRange.d.ts +52 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { VBindings } from "./VBindings";
|
|
|
3
3
|
import { VCloser } from "./VCloser";
|
|
4
4
|
import { VDirectiveManager } from "./directives/VDirectiveManager";
|
|
5
5
|
import { VNodeInit } from "./VNodeInit";
|
|
6
|
+
import { VFragmentRange } from "./util/VFragmentRange";
|
|
6
7
|
/**
|
|
7
8
|
* Represents a virtual node in the virtual DOM.
|
|
8
9
|
* A virtual node corresponds to a real DOM node and contains additional information for data binding and directives.
|
|
@@ -91,6 +92,13 @@ export declare class VNode {
|
|
|
91
92
|
* @returns A Map for storing user data.
|
|
92
93
|
*/
|
|
93
94
|
get userData(): Map<string, any>;
|
|
95
|
+
/**
|
|
96
|
+
* The DOM range that bounds this VNode's expanded fragment content, if any.
|
|
97
|
+
* Set by directives that expand a <template> into a DocumentFragment
|
|
98
|
+
* (currently v-for and v-if).
|
|
99
|
+
*/
|
|
100
|
+
get fragmentRange(): VFragmentRange | undefined;
|
|
101
|
+
set fragmentRange(range: VFragmentRange | undefined);
|
|
94
102
|
/**
|
|
95
103
|
* The DOM path of this virtual node.
|
|
96
104
|
* This is a string representation of the path from the root to this node,
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { VNode } from "../VNode";
|
|
2
|
+
import { VBindingsPreparer } from "../VBindingsPreparer";
|
|
3
|
+
import { VDirective } from "./VDirective";
|
|
4
|
+
import { VDirectiveParseContext } from "./VDirectiveParseContext";
|
|
5
|
+
import { VDOMUpdater } from "../VDOMUpdater";
|
|
6
|
+
/**
|
|
7
|
+
* Directive for managing focus on form elements.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* <input v-focus> Focus once on mount.
|
|
11
|
+
* <input v-focus.select> Focus + select all on mount.
|
|
12
|
+
* <input v-focus="isOpen"> Focus when expression transitions from falsy to truthy.
|
|
13
|
+
* <input v-focus.select="isOpen"> Conditional focus + select all.
|
|
14
|
+
* <input v-focus.cursor-end="isOpen"> Conditional focus + place caret at end.
|
|
15
|
+
*
|
|
16
|
+
* Behavior notes:
|
|
17
|
+
* - Without an expression, the element is focused exactly once after mount.
|
|
18
|
+
* - With an expression, focus fires only on the falsy -> truthy edge,
|
|
19
|
+
* so the user is not repeatedly re-focused on every reactive update.
|
|
20
|
+
* - If the value is already truthy on mount, the element is focused.
|
|
21
|
+
* - Focus is deferred via requestAnimationFrame so that elements which
|
|
22
|
+
* become visible just before this directive runs (e.g. inside v-if /
|
|
23
|
+
* display:none containers) can still receive focus reliably.
|
|
24
|
+
*/
|
|
25
|
+
export declare class VFocusDirective implements VDirective {
|
|
26
|
+
#private;
|
|
27
|
+
/**
|
|
28
|
+
* @param context The context for parsing the directive.
|
|
29
|
+
*/
|
|
30
|
+
constructor(context: VDirectiveParseContext);
|
|
31
|
+
/**
|
|
32
|
+
* @inheritdoc
|
|
33
|
+
*/
|
|
34
|
+
get name(): string;
|
|
35
|
+
/**
|
|
36
|
+
* @inheritdoc
|
|
37
|
+
*/
|
|
38
|
+
get vNode(): VNode;
|
|
39
|
+
/**
|
|
40
|
+
* @inheritdoc
|
|
41
|
+
*/
|
|
42
|
+
get needsAnchor(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* @inheritdoc
|
|
45
|
+
*/
|
|
46
|
+
get bindingsPreparer(): VBindingsPreparer | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* @inheritdoc
|
|
49
|
+
*/
|
|
50
|
+
get domUpdater(): VDOMUpdater | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* @inheritdoc
|
|
53
|
+
*/
|
|
54
|
+
get templatize(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* @inheritdoc
|
|
57
|
+
*/
|
|
58
|
+
get dependentIdentifiers(): string[];
|
|
59
|
+
/**
|
|
60
|
+
* @inheritdoc
|
|
61
|
+
*/
|
|
62
|
+
get onMount(): (() => void) | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* @inheritdoc
|
|
65
|
+
*/
|
|
66
|
+
get onMounted(): (() => void) | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* @inheritdoc
|
|
69
|
+
*/
|
|
70
|
+
get onUpdate(): (() => void) | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* @inheritdoc
|
|
73
|
+
*/
|
|
74
|
+
get onUpdated(): (() => void) | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* @inheritdoc
|
|
77
|
+
*/
|
|
78
|
+
get onUnmount(): (() => void) | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* @inheritdoc
|
|
81
|
+
*/
|
|
82
|
+
get onUnmounted(): (() => void) | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* @inheritdoc
|
|
85
|
+
*/
|
|
86
|
+
destroy(): void;
|
|
87
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a contiguous range of DOM nodes that conceptually belong to a single VNode
|
|
3
|
+
* whose source is a <template> element (and therefore expands to multiple sibling nodes
|
|
4
|
+
* when inserted into the DOM).
|
|
5
|
+
*
|
|
6
|
+
* The range is bounded by two comment markers (start and end). All nodes between the
|
|
7
|
+
* markers (inclusive) form the range. Move and remove operations always act on the
|
|
8
|
+
* entire range atomically via the DOM Range API, which prevents the marker pair from
|
|
9
|
+
* becoming desynchronized from the content it bounds.
|
|
10
|
+
*
|
|
11
|
+
* This abstraction replaces ad-hoc per-marker bookkeeping previously stored in
|
|
12
|
+
* {@link VNode.userData} by directives such as v-for and v-if.
|
|
13
|
+
*/
|
|
14
|
+
export declare class VFragmentRange {
|
|
15
|
+
#private;
|
|
16
|
+
private constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Inserts content into a parent before the given reference sibling (or as last
|
|
19
|
+
* child when {@code refSibling} is null), wrapping it with start/end comment
|
|
20
|
+
* markers. Returns a {@link VFragmentRange} that tracks the inserted region.
|
|
21
|
+
*
|
|
22
|
+
* @param parent The parent node to insert into.
|
|
23
|
+
* @param refSibling The sibling to insert before (null = append).
|
|
24
|
+
* @param label A short label used for the marker comment text (helps debugging).
|
|
25
|
+
* @param content The content to insert. Typically a DocumentFragment cloned
|
|
26
|
+
* from a template's content, but any Node works.
|
|
27
|
+
*/
|
|
28
|
+
static insert(parent: Node, refSibling: Node | null, label: string, content: Node): VFragmentRange;
|
|
29
|
+
/**
|
|
30
|
+
* The start marker (inclusive boundary).
|
|
31
|
+
*/
|
|
32
|
+
get firstNode(): Comment;
|
|
33
|
+
/**
|
|
34
|
+
* The end marker (inclusive boundary).
|
|
35
|
+
*/
|
|
36
|
+
get lastNode(): Comment;
|
|
37
|
+
/**
|
|
38
|
+
* Move the entire range (start marker through end marker, inclusive) to be
|
|
39
|
+
* inserted before {@code refSibling} under {@code parent}. If {@code refSibling}
|
|
40
|
+
* is null the range is appended.
|
|
41
|
+
*
|
|
42
|
+
* Implemented via the DOM Range API so that all nodes between the markers move
|
|
43
|
+
* together as a single contiguous block, regardless of how many or which kinds
|
|
44
|
+
* of nodes currently sit between them.
|
|
45
|
+
*/
|
|
46
|
+
moveBefore(parent: Node, refSibling: Node | null): void;
|
|
47
|
+
/**
|
|
48
|
+
* Remove the entire range (start marker through end marker, inclusive) from its
|
|
49
|
+
* current parent. Safe to call even if the markers are already detached.
|
|
50
|
+
*/
|
|
51
|
+
remove(): void;
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintjamsinc/ichigojs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.60",
|
|
4
4
|
"description": "ichigo.js - Simple and intuitive reactive framework. Lightweight, fast, and user-friendly virtual DOM library",
|
|
5
5
|
"main": "./dist/ichigo.cjs",
|
|
6
6
|
"module": "./dist/ichigo.esm.js",
|