@mintjamsinc/ichigojs 0.1.57 → 0.1.59

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.
@@ -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,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.57",
3
+ "version": "0.1.59",
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",