@graphrefly/graphrefly 0.1.0
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/LICENSE +21 -0
- package/README.md +234 -0
- package/dist/chunk-5X3LAO3B.js +1571 -0
- package/dist/chunk-5X3LAO3B.js.map +1 -0
- package/dist/chunk-6W5SGIGB.js +1793 -0
- package/dist/chunk-6W5SGIGB.js.map +1 -0
- package/dist/chunk-CP6MNKAA.js +97 -0
- package/dist/chunk-CP6MNKAA.js.map +1 -0
- package/dist/chunk-HP7OKEOE.js +107 -0
- package/dist/chunk-HP7OKEOE.js.map +1 -0
- package/dist/chunk-KWXPDASV.js +781 -0
- package/dist/chunk-KWXPDASV.js.map +1 -0
- package/dist/chunk-O3PI7W45.js +68 -0
- package/dist/chunk-O3PI7W45.js.map +1 -0
- package/dist/chunk-QW7H3ICI.js +1372 -0
- package/dist/chunk-QW7H3ICI.js.map +1 -0
- package/dist/chunk-VPS7L64N.js +4785 -0
- package/dist/chunk-VPS7L64N.js.map +1 -0
- package/dist/chunk-Z4Y4FMQN.js +1097 -0
- package/dist/chunk-Z4Y4FMQN.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +4883 -0
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +7 -0
- package/dist/compat/nestjs/index.d.ts +7 -0
- package/dist/compat/nestjs/index.js +84 -0
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/core/index.cjs +1632 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +2 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +90 -0
- package/dist/core/index.js.map +1 -0
- package/dist/extra/index.cjs +6885 -0
- package/dist/extra/index.cjs.map +1 -0
- package/dist/extra/index.d.cts +5 -0
- package/dist/extra/index.d.ts +5 -0
- package/dist/extra/index.js +290 -0
- package/dist/extra/index.js.map +1 -0
- package/dist/graph/index.cjs +3225 -0
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +3 -0
- package/dist/graph/index.d.ts +3 -0
- package/dist/graph/index.js +25 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph-CL_ZDAj9.d.cts +605 -0
- package/dist/graph-D18qmsNm.d.ts +605 -0
- package/dist/index-B6SsZs2h.d.cts +3463 -0
- package/dist/index-B7eOdgEx.d.ts +449 -0
- package/dist/index-BHUvlQ3v.d.ts +3463 -0
- package/dist/index-BtK55IE2.d.ts +231 -0
- package/dist/index-BvhgZRHK.d.cts +231 -0
- package/dist/index-Bvy_6CaN.d.ts +452 -0
- package/dist/index-C3BMRmmp.d.cts +449 -0
- package/dist/index-C5mqLhMX.d.cts +452 -0
- package/dist/index-CP_QvbWu.d.ts +940 -0
- package/dist/index-D_geH2Bm.d.cts +940 -0
- package/dist/index.cjs +14843 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1517 -0
- package/dist/index.d.ts +1517 -0
- package/dist/index.js +3649 -0
- package/dist/index.js.map +1 -0
- package/dist/meta-BsF6Sag9.d.cts +607 -0
- package/dist/meta-BsF6Sag9.d.ts +607 -0
- package/dist/patterns/reactive-layout/index.cjs +4143 -0
- package/dist/patterns/reactive-layout/index.cjs.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +3 -0
- package/dist/patterns/reactive-layout/index.d.ts +3 -0
- package/dist/patterns/reactive-layout/index.js +38 -0
- package/dist/patterns/reactive-layout/index.js.map +1 -0
- package/dist/reactive-log-BfvfNWQh.d.cts +137 -0
- package/dist/reactive-log-ohLmTXoZ.d.ts +137 -0
- package/package.json +256 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { B as BlockAdapters, C as CanvasMeasureAdapter, a as CanvasMeasureAdapterOptions, b as CanvasModule, c as CharPosition, d as CliMeasureAdapter, e as CliMeasureAdapterOptions, f as ContentBlock, I as ImageMeasurer, g as ImageSizeAdapter, L as LayoutLine, h as LineBreaksResult, M as MeasuredBlock, j as MeasurementAdapter, N as NodeCanvasMeasureAdapter, P as PositionedBlock, k as PrecomputedAdapter, l as PrecomputedAdapterOptions, m as PreparedSegment, R as ReactiveBlockLayoutBundle, n as ReactiveBlockLayoutOptions, o as ReactiveLayoutBundle, p as ReactiveLayoutOptions, S as SegmentBreakKind, q as SegmentMeasureStats, r as SvgBoundsAdapter, s as SvgMeasurer, t as analyzeAndMeasure, u as computeBlockFlow, v as computeCharPositions, w as computeLineBreaks, x as computeTotalHeight, y as measureBlock, z as measureBlocks, A as reactiveBlockLayout, D as reactiveLayout } from '../../index-C3BMRmmp.cjs';
|
|
2
|
+
import '../../meta-BsF6Sag9.cjs';
|
|
3
|
+
import '../../graph-CL_ZDAj9.cjs';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { B as BlockAdapters, C as CanvasMeasureAdapter, a as CanvasMeasureAdapterOptions, b as CanvasModule, c as CharPosition, d as CliMeasureAdapter, e as CliMeasureAdapterOptions, f as ContentBlock, I as ImageMeasurer, g as ImageSizeAdapter, L as LayoutLine, h as LineBreaksResult, M as MeasuredBlock, j as MeasurementAdapter, N as NodeCanvasMeasureAdapter, P as PositionedBlock, k as PrecomputedAdapter, l as PrecomputedAdapterOptions, m as PreparedSegment, R as ReactiveBlockLayoutBundle, n as ReactiveBlockLayoutOptions, o as ReactiveLayoutBundle, p as ReactiveLayoutOptions, S as SegmentBreakKind, q as SegmentMeasureStats, r as SvgBoundsAdapter, s as SvgMeasurer, t as analyzeAndMeasure, u as computeBlockFlow, v as computeCharPositions, w as computeLineBreaks, x as computeTotalHeight, y as measureBlock, z as measureBlocks, A as reactiveBlockLayout, D as reactiveLayout } from '../../index-B7eOdgEx.js';
|
|
2
|
+
import '../../meta-BsF6Sag9.js';
|
|
3
|
+
import '../../graph-D18qmsNm.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CanvasMeasureAdapter,
|
|
3
|
+
CliMeasureAdapter,
|
|
4
|
+
ImageSizeAdapter,
|
|
5
|
+
NodeCanvasMeasureAdapter,
|
|
6
|
+
PrecomputedAdapter,
|
|
7
|
+
SvgBoundsAdapter,
|
|
8
|
+
analyzeAndMeasure,
|
|
9
|
+
computeBlockFlow,
|
|
10
|
+
computeCharPositions,
|
|
11
|
+
computeLineBreaks,
|
|
12
|
+
computeTotalHeight,
|
|
13
|
+
measureBlock,
|
|
14
|
+
measureBlocks,
|
|
15
|
+
reactiveBlockLayout,
|
|
16
|
+
reactiveLayout
|
|
17
|
+
} from "../../chunk-Z4Y4FMQN.js";
|
|
18
|
+
import "../../chunk-6W5SGIGB.js";
|
|
19
|
+
import "../../chunk-O3PI7W45.js";
|
|
20
|
+
import "../../chunk-5X3LAO3B.js";
|
|
21
|
+
export {
|
|
22
|
+
CanvasMeasureAdapter,
|
|
23
|
+
CliMeasureAdapter,
|
|
24
|
+
ImageSizeAdapter,
|
|
25
|
+
NodeCanvasMeasureAdapter,
|
|
26
|
+
PrecomputedAdapter,
|
|
27
|
+
SvgBoundsAdapter,
|
|
28
|
+
analyzeAndMeasure,
|
|
29
|
+
computeBlockFlow,
|
|
30
|
+
computeCharPositions,
|
|
31
|
+
computeLineBreaks,
|
|
32
|
+
computeTotalHeight,
|
|
33
|
+
measureBlock,
|
|
34
|
+
measureBlocks,
|
|
35
|
+
reactiveBlockLayout,
|
|
36
|
+
reactiveLayout
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { i as Messages, N as Node } from './meta-BsF6Sag9.cjs';
|
|
3
|
+
import { G as Graph, v as ObserveOptions } from './graph-CL_ZDAj9.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Bridge a `Node<T>` to an RxJS `Observable<T>`.
|
|
7
|
+
*
|
|
8
|
+
* Emits the node's value on each `DATA` message. Maps `ERROR` to
|
|
9
|
+
* `subscriber.error()` and `COMPLETE` to `subscriber.complete()`.
|
|
10
|
+
* Protocol-internal signals (DIRTY, RESOLVED, PAUSE, etc.) are skipped.
|
|
11
|
+
*
|
|
12
|
+
* Unsubscribing the Observable unsubscribes the node.
|
|
13
|
+
*/
|
|
14
|
+
declare function toObservable<T>(node: Node<T>): Observable<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Bridge a `Node<T>` to an `Observable<Messages>` — raw message batches.
|
|
17
|
+
*
|
|
18
|
+
* Each emission is a full `[[Type, Data?], ...]` batch. The Observable
|
|
19
|
+
* terminates on ERROR or COMPLETE (the terminal batch is still emitted
|
|
20
|
+
* as the final `next()` before the Observable signal).
|
|
21
|
+
*/
|
|
22
|
+
declare function toMessages$<T>(node: Node<T>): Observable<Messages>;
|
|
23
|
+
/**
|
|
24
|
+
* Observe a single node in a `Graph` as an `Observable<T>`.
|
|
25
|
+
*
|
|
26
|
+
* Equivalent to `toObservable(graph.resolve(path))` but routes through
|
|
27
|
+
* `graph.observe()` so actor guards are respected when provided.
|
|
28
|
+
*/
|
|
29
|
+
declare function observeNode$<T>(graph: Graph, path: string, options?: ObserveOptions): Observable<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Observe all nodes in a `Graph` as an `Observable<{ path, messages }>`.
|
|
32
|
+
*
|
|
33
|
+
* Each emission carries the qualified node path and the raw message batch.
|
|
34
|
+
* The Observable never self-completes (graphs are long-lived); dispose by
|
|
35
|
+
* unsubscribing.
|
|
36
|
+
*/
|
|
37
|
+
declare function observeGraph$(graph: Graph, options?: ObserveOptions): Observable<{
|
|
38
|
+
path: string;
|
|
39
|
+
messages: Messages;
|
|
40
|
+
}>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Shared internals for roadmap §3.2 data structures (option B — versioned snapshots).
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* Not re-exported from the package barrel; consumers use concrete factories
|
|
47
|
+
* (`reactiveMap`, …). Keeps `equals` / snapshot wiring consistent across
|
|
48
|
+
* collections without exposing a second public protocol.
|
|
49
|
+
*
|
|
50
|
+
* @packageDocumentation
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Immutable value paired with a monotonic version for {@link NodeOptions.equals}.
|
|
55
|
+
* Downstream nodes can treat unchanged versions as `RESOLVED`-eligible via `equals`.
|
|
56
|
+
*
|
|
57
|
+
* When the backing node has V0 versioning (GRAPHREFLY-SPEC §7), `v0` carries
|
|
58
|
+
* the node's identity (`id`) and version counter for diff-friendly observation
|
|
59
|
+
* and cross-snapshot dedup (roadmap §6.0b).
|
|
60
|
+
*/
|
|
61
|
+
type Versioned<T> = {
|
|
62
|
+
readonly version: number;
|
|
63
|
+
readonly value: T;
|
|
64
|
+
/** V0 identity from the backing node, when versioning is enabled. */
|
|
65
|
+
readonly v0?: {
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly version: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type ReactiveLogSnapshot<T> = Versioned<{
|
|
72
|
+
entries: readonly T[];
|
|
73
|
+
}>;
|
|
74
|
+
type ReactiveLogOptions = {
|
|
75
|
+
name?: string;
|
|
76
|
+
maxSize?: number;
|
|
77
|
+
};
|
|
78
|
+
type ReactiveLogBundle<T> = {
|
|
79
|
+
/** Emits {@link ReactiveLogSnapshot} on each append/clear (two-phase). */
|
|
80
|
+
readonly entries: Node<ReactiveLogSnapshot<T>>;
|
|
81
|
+
append: (value: T) => void;
|
|
82
|
+
/** Push all values, trim once, emit one snapshot. */
|
|
83
|
+
appendMany: (values: readonly T[]) => void;
|
|
84
|
+
clear: () => void;
|
|
85
|
+
/** Remove the first `n` entries; emits snapshot. */
|
|
86
|
+
trimHead: (n: number) => void;
|
|
87
|
+
/** Last `n` entries (or fewer); updates when the log changes. */
|
|
88
|
+
tail: (n: number) => Node<readonly T[]>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Creates an append-only reactive log with versioned tuple snapshots.
|
|
92
|
+
*
|
|
93
|
+
* @param initial - Optional seed entries (copied).
|
|
94
|
+
* @param options - Optional `name` for `describe()` / debugging.
|
|
95
|
+
* @returns Bundle with `entries` (state node), `append`, `clear`, and {@link ReactiveLogBundle.tail}.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* **Derived views:** {@link tail} and {@link logSlice} install an internal noop subscription so
|
|
99
|
+
* `get()` stays wired without an external sink; creating very many disposable derived nodes can
|
|
100
|
+
* retain subscriptions until the log bundle is unreachable.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { reactiveLog } from "@graphrefly/graphrefly-ts";
|
|
105
|
+
*
|
|
106
|
+
* const lg = reactiveLog<number>([1, 2], { name: "audit" });
|
|
107
|
+
* lg.append(3);
|
|
108
|
+
* lg.entries.subscribe((msgs) => console.log(msgs));
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @category extra
|
|
112
|
+
*/
|
|
113
|
+
declare function reactiveLog<T>(initial?: readonly T[], options?: ReactiveLogOptions): ReactiveLogBundle<T>;
|
|
114
|
+
/**
|
|
115
|
+
* Builds a derived node for `entries.slice(start, stop)` (same semantics as `Array.prototype.slice`; `stop` exclusive).
|
|
116
|
+
*
|
|
117
|
+
* @param log - Log from {@link reactiveLog}.
|
|
118
|
+
* @param start - Start index (must be `>= 0`).
|
|
119
|
+
* @param stop - End index (exclusive); omit to slice to the end.
|
|
120
|
+
* @returns Derived node emitting the sliced readonly array.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* import { reactiveLog, logSlice } from "@graphrefly/graphrefly-ts";
|
|
125
|
+
*
|
|
126
|
+
* const lg = reactiveLog<number>([10, 20, 30, 40, 50]);
|
|
127
|
+
* const slice$ = logSlice(lg, 1, 4); // reactive view of [20, 30, 40]
|
|
128
|
+
* slice$.subscribe((msgs) => console.log(msgs));
|
|
129
|
+
*
|
|
130
|
+
* lg.append(60); // slice$ now reflects [20, 30, 40] (indices 1–3 of updated log)
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @category extra
|
|
134
|
+
*/
|
|
135
|
+
declare function logSlice<T>(log: ReactiveLogBundle<T>, start: number, stop?: number): Node<readonly T[]>;
|
|
136
|
+
|
|
137
|
+
export { type ReactiveLogSnapshot as R, type Versioned as V, type ReactiveLogBundle as a, type ReactiveLogOptions as b, observeNode$ as c, toObservable as d, logSlice as l, observeGraph$ as o, reactiveLog as r, toMessages$ as t };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { i as Messages, N as Node } from './meta-BsF6Sag9.js';
|
|
3
|
+
import { G as Graph, v as ObserveOptions } from './graph-D18qmsNm.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Bridge a `Node<T>` to an RxJS `Observable<T>`.
|
|
7
|
+
*
|
|
8
|
+
* Emits the node's value on each `DATA` message. Maps `ERROR` to
|
|
9
|
+
* `subscriber.error()` and `COMPLETE` to `subscriber.complete()`.
|
|
10
|
+
* Protocol-internal signals (DIRTY, RESOLVED, PAUSE, etc.) are skipped.
|
|
11
|
+
*
|
|
12
|
+
* Unsubscribing the Observable unsubscribes the node.
|
|
13
|
+
*/
|
|
14
|
+
declare function toObservable<T>(node: Node<T>): Observable<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Bridge a `Node<T>` to an `Observable<Messages>` — raw message batches.
|
|
17
|
+
*
|
|
18
|
+
* Each emission is a full `[[Type, Data?], ...]` batch. The Observable
|
|
19
|
+
* terminates on ERROR or COMPLETE (the terminal batch is still emitted
|
|
20
|
+
* as the final `next()` before the Observable signal).
|
|
21
|
+
*/
|
|
22
|
+
declare function toMessages$<T>(node: Node<T>): Observable<Messages>;
|
|
23
|
+
/**
|
|
24
|
+
* Observe a single node in a `Graph` as an `Observable<T>`.
|
|
25
|
+
*
|
|
26
|
+
* Equivalent to `toObservable(graph.resolve(path))` but routes through
|
|
27
|
+
* `graph.observe()` so actor guards are respected when provided.
|
|
28
|
+
*/
|
|
29
|
+
declare function observeNode$<T>(graph: Graph, path: string, options?: ObserveOptions): Observable<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Observe all nodes in a `Graph` as an `Observable<{ path, messages }>`.
|
|
32
|
+
*
|
|
33
|
+
* Each emission carries the qualified node path and the raw message batch.
|
|
34
|
+
* The Observable never self-completes (graphs are long-lived); dispose by
|
|
35
|
+
* unsubscribing.
|
|
36
|
+
*/
|
|
37
|
+
declare function observeGraph$(graph: Graph, options?: ObserveOptions): Observable<{
|
|
38
|
+
path: string;
|
|
39
|
+
messages: Messages;
|
|
40
|
+
}>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Shared internals for roadmap §3.2 data structures (option B — versioned snapshots).
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* Not re-exported from the package barrel; consumers use concrete factories
|
|
47
|
+
* (`reactiveMap`, …). Keeps `equals` / snapshot wiring consistent across
|
|
48
|
+
* collections without exposing a second public protocol.
|
|
49
|
+
*
|
|
50
|
+
* @packageDocumentation
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Immutable value paired with a monotonic version for {@link NodeOptions.equals}.
|
|
55
|
+
* Downstream nodes can treat unchanged versions as `RESOLVED`-eligible via `equals`.
|
|
56
|
+
*
|
|
57
|
+
* When the backing node has V0 versioning (GRAPHREFLY-SPEC §7), `v0` carries
|
|
58
|
+
* the node's identity (`id`) and version counter for diff-friendly observation
|
|
59
|
+
* and cross-snapshot dedup (roadmap §6.0b).
|
|
60
|
+
*/
|
|
61
|
+
type Versioned<T> = {
|
|
62
|
+
readonly version: number;
|
|
63
|
+
readonly value: T;
|
|
64
|
+
/** V0 identity from the backing node, when versioning is enabled. */
|
|
65
|
+
readonly v0?: {
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly version: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type ReactiveLogSnapshot<T> = Versioned<{
|
|
72
|
+
entries: readonly T[];
|
|
73
|
+
}>;
|
|
74
|
+
type ReactiveLogOptions = {
|
|
75
|
+
name?: string;
|
|
76
|
+
maxSize?: number;
|
|
77
|
+
};
|
|
78
|
+
type ReactiveLogBundle<T> = {
|
|
79
|
+
/** Emits {@link ReactiveLogSnapshot} on each append/clear (two-phase). */
|
|
80
|
+
readonly entries: Node<ReactiveLogSnapshot<T>>;
|
|
81
|
+
append: (value: T) => void;
|
|
82
|
+
/** Push all values, trim once, emit one snapshot. */
|
|
83
|
+
appendMany: (values: readonly T[]) => void;
|
|
84
|
+
clear: () => void;
|
|
85
|
+
/** Remove the first `n` entries; emits snapshot. */
|
|
86
|
+
trimHead: (n: number) => void;
|
|
87
|
+
/** Last `n` entries (or fewer); updates when the log changes. */
|
|
88
|
+
tail: (n: number) => Node<readonly T[]>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Creates an append-only reactive log with versioned tuple snapshots.
|
|
92
|
+
*
|
|
93
|
+
* @param initial - Optional seed entries (copied).
|
|
94
|
+
* @param options - Optional `name` for `describe()` / debugging.
|
|
95
|
+
* @returns Bundle with `entries` (state node), `append`, `clear`, and {@link ReactiveLogBundle.tail}.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* **Derived views:** {@link tail} and {@link logSlice} install an internal noop subscription so
|
|
99
|
+
* `get()` stays wired without an external sink; creating very many disposable derived nodes can
|
|
100
|
+
* retain subscriptions until the log bundle is unreachable.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { reactiveLog } from "@graphrefly/graphrefly-ts";
|
|
105
|
+
*
|
|
106
|
+
* const lg = reactiveLog<number>([1, 2], { name: "audit" });
|
|
107
|
+
* lg.append(3);
|
|
108
|
+
* lg.entries.subscribe((msgs) => console.log(msgs));
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @category extra
|
|
112
|
+
*/
|
|
113
|
+
declare function reactiveLog<T>(initial?: readonly T[], options?: ReactiveLogOptions): ReactiveLogBundle<T>;
|
|
114
|
+
/**
|
|
115
|
+
* Builds a derived node for `entries.slice(start, stop)` (same semantics as `Array.prototype.slice`; `stop` exclusive).
|
|
116
|
+
*
|
|
117
|
+
* @param log - Log from {@link reactiveLog}.
|
|
118
|
+
* @param start - Start index (must be `>= 0`).
|
|
119
|
+
* @param stop - End index (exclusive); omit to slice to the end.
|
|
120
|
+
* @returns Derived node emitting the sliced readonly array.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* import { reactiveLog, logSlice } from "@graphrefly/graphrefly-ts";
|
|
125
|
+
*
|
|
126
|
+
* const lg = reactiveLog<number>([10, 20, 30, 40, 50]);
|
|
127
|
+
* const slice$ = logSlice(lg, 1, 4); // reactive view of [20, 30, 40]
|
|
128
|
+
* slice$.subscribe((msgs) => console.log(msgs));
|
|
129
|
+
*
|
|
130
|
+
* lg.append(60); // slice$ now reflects [20, 30, 40] (indices 1–3 of updated log)
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @category extra
|
|
134
|
+
*/
|
|
135
|
+
declare function logSlice<T>(log: ReactiveLogBundle<T>, start: number, stop?: number): Node<readonly T[]>;
|
|
136
|
+
|
|
137
|
+
export { type ReactiveLogSnapshot as R, type Versioned as V, type ReactiveLogBundle as a, type ReactiveLogOptions as b, observeNode$ as c, toObservable as d, logSlice as l, observeGraph$ as o, reactiveLog as r, toMessages$ as t };
|
package/package.json
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@graphrefly/graphrefly",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be",
|
|
5
|
+
"description": "Reactive graph protocol for human + LLM co-operation. Composable nodes, glitch-free diamond resolution, two-phase push, framework adapters (React/Vue/Svelte/Solid/NestJS), durable streaming. Zero dependencies.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./dist/index.d.cts",
|
|
19
|
+
"default": "./dist/index.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"./core": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/core/index.d.ts",
|
|
25
|
+
"default": "./dist/core/index.js"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/core/index.d.cts",
|
|
29
|
+
"default": "./dist/core/index.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./extra": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/extra/index.d.ts",
|
|
35
|
+
"default": "./dist/extra/index.js"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/extra/index.d.cts",
|
|
39
|
+
"default": "./dist/extra/index.cjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"./graph": {
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/graph/index.d.ts",
|
|
45
|
+
"default": "./dist/graph/index.js"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/graph/index.d.cts",
|
|
49
|
+
"default": "./dist/graph/index.cjs"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"./compat": {
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./dist/compat/index.d.ts",
|
|
55
|
+
"default": "./dist/compat/index.js"
|
|
56
|
+
},
|
|
57
|
+
"require": {
|
|
58
|
+
"types": "./dist/compat/index.d.cts",
|
|
59
|
+
"default": "./dist/compat/index.cjs"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"./compat/jotai": {
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./dist/compat/jotai/index.d.ts",
|
|
65
|
+
"default": "./dist/compat/jotai/index.js"
|
|
66
|
+
},
|
|
67
|
+
"require": {
|
|
68
|
+
"types": "./dist/compat/jotai/index.d.cts",
|
|
69
|
+
"default": "./dist/compat/jotai/index.cjs"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"./compat/zustand": {
|
|
73
|
+
"import": {
|
|
74
|
+
"types": "./dist/compat/zustand/index.d.ts",
|
|
75
|
+
"default": "./dist/compat/zustand/index.js"
|
|
76
|
+
},
|
|
77
|
+
"require": {
|
|
78
|
+
"types": "./dist/compat/zustand/index.d.cts",
|
|
79
|
+
"default": "./dist/compat/zustand/index.cjs"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"./compat/react": {
|
|
83
|
+
"import": {
|
|
84
|
+
"types": "./dist/compat/react/index.d.ts",
|
|
85
|
+
"default": "./dist/compat/react/index.js"
|
|
86
|
+
},
|
|
87
|
+
"require": {
|
|
88
|
+
"types": "./dist/compat/react/index.d.cts",
|
|
89
|
+
"default": "./dist/compat/react/index.cjs"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"./compat/vue": {
|
|
93
|
+
"import": {
|
|
94
|
+
"types": "./dist/compat/vue/index.d.ts",
|
|
95
|
+
"default": "./dist/compat/vue/index.js"
|
|
96
|
+
},
|
|
97
|
+
"require": {
|
|
98
|
+
"types": "./dist/compat/vue/index.d.cts",
|
|
99
|
+
"default": "./dist/compat/vue/index.cjs"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"./compat/svelte": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/compat/svelte/index.d.ts",
|
|
105
|
+
"default": "./dist/compat/svelte/index.js"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/compat/svelte/index.d.cts",
|
|
109
|
+
"default": "./dist/compat/svelte/index.cjs"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"./compat/solid": {
|
|
113
|
+
"import": {
|
|
114
|
+
"types": "./dist/compat/solid/index.d.ts",
|
|
115
|
+
"default": "./dist/compat/solid/index.js"
|
|
116
|
+
},
|
|
117
|
+
"require": {
|
|
118
|
+
"types": "./dist/compat/solid/index.d.cts",
|
|
119
|
+
"default": "./dist/compat/solid/index.cjs"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"./compat/nestjs": {
|
|
123
|
+
"import": {
|
|
124
|
+
"types": "./dist/compat/nestjs/index.d.ts",
|
|
125
|
+
"default": "./dist/compat/nestjs/index.js"
|
|
126
|
+
},
|
|
127
|
+
"require": {
|
|
128
|
+
"types": "./dist/compat/nestjs/index.d.cts",
|
|
129
|
+
"default": "./dist/compat/nestjs/index.cjs"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"./reactive-layout": {
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/patterns/reactive-layout/index.d.ts",
|
|
135
|
+
"default": "./dist/patterns/reactive-layout/index.js"
|
|
136
|
+
},
|
|
137
|
+
"require": {
|
|
138
|
+
"types": "./dist/patterns/reactive-layout/index.d.cts",
|
|
139
|
+
"default": "./dist/patterns/reactive-layout/index.cjs"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"files": [
|
|
144
|
+
"dist",
|
|
145
|
+
"LICENSE"
|
|
146
|
+
],
|
|
147
|
+
"publishConfig": {
|
|
148
|
+
"access": "public"
|
|
149
|
+
},
|
|
150
|
+
"scripts": {
|
|
151
|
+
"prepublishOnly": "pnpm run build",
|
|
152
|
+
"docs:dev": "pnpm --dir website dev",
|
|
153
|
+
"docs:build": "pnpm --dir website build",
|
|
154
|
+
"docs:preview": "pnpm --dir website preview",
|
|
155
|
+
"build": "tsup",
|
|
156
|
+
"test": "vitest run",
|
|
157
|
+
"bench": "vitest bench",
|
|
158
|
+
"bench:baseline": "vitest bench --outputJson benchmarks/vitest-baseline.json",
|
|
159
|
+
"test:watch": "vitest",
|
|
160
|
+
"lint": "biome check .",
|
|
161
|
+
"lint:fix": "biome check --write .",
|
|
162
|
+
"format": "biome format --write ."
|
|
163
|
+
},
|
|
164
|
+
"keywords": [
|
|
165
|
+
"reactive",
|
|
166
|
+
"graph",
|
|
167
|
+
"state-management",
|
|
168
|
+
"signals",
|
|
169
|
+
"streaming",
|
|
170
|
+
"llm",
|
|
171
|
+
"ai-agents",
|
|
172
|
+
"observable",
|
|
173
|
+
"derived-state",
|
|
174
|
+
"diamond-resolution",
|
|
175
|
+
"orchestration",
|
|
176
|
+
"durable-workflow",
|
|
177
|
+
"callbag",
|
|
178
|
+
"framework-agnostic",
|
|
179
|
+
"react",
|
|
180
|
+
"vue",
|
|
181
|
+
"svelte",
|
|
182
|
+
"solid",
|
|
183
|
+
"nestjs",
|
|
184
|
+
"zero-dependency"
|
|
185
|
+
],
|
|
186
|
+
"license": "MIT",
|
|
187
|
+
"peerDependencies": {
|
|
188
|
+
"react": ">=18",
|
|
189
|
+
"react-dom": ">=18",
|
|
190
|
+
"solid-js": ">=1",
|
|
191
|
+
"svelte": ">=4",
|
|
192
|
+
"vue": ">=3",
|
|
193
|
+
"@nestjs/common": ">=10",
|
|
194
|
+
"rxjs": ">=7"
|
|
195
|
+
},
|
|
196
|
+
"peerDependenciesMeta": {
|
|
197
|
+
"react": {
|
|
198
|
+
"optional": true
|
|
199
|
+
},
|
|
200
|
+
"react-dom": {
|
|
201
|
+
"optional": true
|
|
202
|
+
},
|
|
203
|
+
"solid-js": {
|
|
204
|
+
"optional": true
|
|
205
|
+
},
|
|
206
|
+
"svelte": {
|
|
207
|
+
"optional": true
|
|
208
|
+
},
|
|
209
|
+
"vue": {
|
|
210
|
+
"optional": true
|
|
211
|
+
},
|
|
212
|
+
"@nestjs/common": {
|
|
213
|
+
"optional": true
|
|
214
|
+
},
|
|
215
|
+
"rxjs": {
|
|
216
|
+
"optional": true
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"devDependencies": {
|
|
220
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
221
|
+
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
222
|
+
"@semantic-release/git": "^10.0.1",
|
|
223
|
+
"@semantic-release/github": "^11.0.0",
|
|
224
|
+
"@semantic-release/npm": "^12.0.0",
|
|
225
|
+
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
226
|
+
"@biomejs/biome": "2.4.6",
|
|
227
|
+
"@nestjs/common": "^11.1.17",
|
|
228
|
+
"@nestjs/core": "^11.1.17",
|
|
229
|
+
"@nestjs/testing": "^11.1.17",
|
|
230
|
+
"@solidjs/testing-library": "^0.8.10",
|
|
231
|
+
"@testing-library/react": "^16.3.2",
|
|
232
|
+
"@testing-library/svelte": "^5.3.1",
|
|
233
|
+
"@testing-library/vue": "^8.1.0",
|
|
234
|
+
"@types/node": "^25.5.0",
|
|
235
|
+
"@types/react": "^19.2.14",
|
|
236
|
+
"@types/react-dom": "^19.2.3",
|
|
237
|
+
"jsdom": "^29.0.1",
|
|
238
|
+
"react": "^19.2.4",
|
|
239
|
+
"react-dom": "^19.2.4",
|
|
240
|
+
"reflect-metadata": "^0.2.2",
|
|
241
|
+
"rxjs": "^7.8.2",
|
|
242
|
+
"solid-js": "^1.9.12",
|
|
243
|
+
"svelte": "^5.55.1",
|
|
244
|
+
"semantic-release": "^24.0.0",
|
|
245
|
+
"tsup": "^8.5.1",
|
|
246
|
+
"typescript": "^5.7.0",
|
|
247
|
+
"vitest": "^3.0.0",
|
|
248
|
+
"vue": "^3.5.31"
|
|
249
|
+
},
|
|
250
|
+
"pnpm": {
|
|
251
|
+
"onlyBuiltDependencies": [
|
|
252
|
+
"@biomejs/biome",
|
|
253
|
+
"esbuild"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
}
|