@graphrefly/graphrefly 0.24.0 → 0.26.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/README.md +8 -0
- package/dist/{chunk-QOWVNWOC.js → chunk-3ZWCKRHX.js} +27 -25
- package/dist/{chunk-QOWVNWOC.js.map → chunk-3ZWCKRHX.js.map} +1 -1
- package/dist/chunk-6LDQFTYS.js +102 -0
- package/dist/chunk-6LDQFTYS.js.map +1 -0
- package/dist/{chunk-5WGT55R4.js → chunk-AMCG74RZ.js} +195 -24
- package/dist/chunk-AMCG74RZ.js.map +1 -0
- package/dist/{chunk-AOCBDH4T.js → chunk-BVZYTZ5H.js} +76 -103
- package/dist/chunk-BVZYTZ5H.js.map +1 -0
- package/dist/chunk-FQMKGR6L.js +330 -0
- package/dist/chunk-FQMKGR6L.js.map +1 -0
- package/dist/chunk-HXZEYDUR.js +94 -0
- package/dist/chunk-HXZEYDUR.js.map +1 -0
- package/dist/{chunk-IPLKX3L2.js → chunk-IZYUSJC7.js} +16 -14
- package/dist/{chunk-IPLKX3L2.js.map → chunk-IZYUSJC7.js.map} +1 -1
- package/dist/chunk-J22W6HV3.js +107 -0
- package/dist/chunk-J22W6HV3.js.map +1 -0
- package/dist/{chunk-HWPIFSW2.js → chunk-JSCT3CR4.js} +6 -4
- package/dist/{chunk-HWPIFSW2.js.map → chunk-JSCT3CR4.js.map} +1 -1
- package/dist/chunk-JYXEWPH4.js +62 -0
- package/dist/chunk-JYXEWPH4.js.map +1 -0
- package/dist/chunk-LCE3GF5P.js +866 -0
- package/dist/chunk-LCE3GF5P.js.map +1 -0
- package/dist/chunk-MJ2NKQQL.js +119 -0
- package/dist/chunk-MJ2NKQQL.js.map +1 -0
- package/dist/chunk-N6UR7YVY.js +198 -0
- package/dist/chunk-N6UR7YVY.js.map +1 -0
- package/dist/chunk-OHISZPOJ.js +97 -0
- package/dist/chunk-OHISZPOJ.js.map +1 -0
- package/dist/{chunk-5DJTTKX3.js → chunk-PHOUUNK7.js} +74 -111
- package/dist/chunk-PHOUUNK7.js.map +1 -0
- package/dist/{chunk-PY4XCDLR.js → chunk-RB6QPHJ7.js} +8 -6
- package/dist/{chunk-PY4XCDLR.js.map → chunk-RB6QPHJ7.js.map} +1 -1
- package/dist/chunk-SN4YWWYO.js +171 -0
- package/dist/chunk-SN4YWWYO.js.map +1 -0
- package/dist/chunk-SX52TAR4.js +110 -0
- package/dist/chunk-SX52TAR4.js.map +1 -0
- package/dist/{chunk-XOFWRC73.js → chunk-THTWHNU4.js} +319 -24
- package/dist/chunk-THTWHNU4.js.map +1 -0
- package/dist/{chunk-H4RVA4VE.js → chunk-VYPWMZ6H.js} +2 -2
- package/dist/chunk-XGPU467M.js +136 -0
- package/dist/chunk-XGPU467M.js.map +1 -0
- package/dist/{chunk-TDEXAMGO.js → chunk-ZQMEI34O.js} +206 -574
- package/dist/chunk-ZQMEI34O.js.map +1 -0
- package/dist/compat/index.cjs +7656 -0
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +18 -0
- package/dist/compat/index.d.ts +18 -0
- package/dist/compat/index.js +49 -0
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +2048 -0
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +2 -0
- package/dist/compat/jotai/index.d.ts +2 -0
- package/dist/compat/jotai/index.js +9 -0
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +2175 -0
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +2 -0
- package/dist/compat/nanostores/index.d.ts +2 -0
- package/dist/compat/nanostores/index.js +23 -0
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +350 -16
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +6 -6
- package/dist/compat/nestjs/index.d.ts +6 -6
- package/dist/compat/nestjs/index.js +10 -9
- package/dist/compat/react/index.cjs +141 -0
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +2 -0
- package/dist/compat/react/index.d.ts +2 -0
- package/dist/compat/react/index.js +12 -0
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +128 -0
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +2 -0
- package/dist/compat/solid/index.d.ts +2 -0
- package/dist/compat/solid/index.js +12 -0
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +131 -0
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +2 -0
- package/dist/compat/svelte/index.d.ts +2 -0
- package/dist/compat/svelte/index.js +12 -0
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +146 -0
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +3 -0
- package/dist/compat/vue/index.d.ts +3 -0
- package/dist/compat/vue/index.js +12 -0
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +4931 -0
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +5 -0
- package/dist/compat/zustand/index.d.ts +5 -0
- package/dist/compat/zustand/index.js +12 -0
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +53 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +26 -24
- package/dist/demo-shell-26p5fVxn.d.cts +102 -0
- package/dist/demo-shell-DEp-nMTl.d.ts +102 -0
- package/dist/extra/index.cjs +290 -110
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +5 -4
- package/dist/extra/index.d.ts +5 -4
- package/dist/extra/index.js +8 -5
- package/dist/extra/sources.cjs +2486 -0
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +465 -0
- package/dist/extra/sources.d.ts +465 -0
- package/dist/extra/sources.js +57 -0
- package/dist/extra/sources.js.map +1 -0
- package/dist/graph/index.cjs +408 -14
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +13 -5
- package/dist/{graph-D-3JIQme.d.cts → graph-6tZ5jEzr.d.cts} +195 -4
- package/dist/{graph-B6NFqv3z.d.ts → graph-DQ69XU0g.d.ts} +195 -4
- package/dist/index-B4MP_8V_.d.cts +37 -0
- package/dist/index-BEfE8H_G.d.cts +121 -0
- package/dist/{index-D7XgsUt7.d.ts → index-BW1z3BN9.d.ts} +169 -127
- package/dist/index-BYOHF0zP.d.ts +34 -0
- package/dist/index-B_IP40nB.d.cts +36 -0
- package/dist/index-Bd_fwmLf.d.cts +45 -0
- package/dist/{index-BysCTzJz.d.ts → index-BeIdBfcb.d.cts} +121 -547
- package/dist/index-BjI6ty9z.d.ts +121 -0
- package/dist/index-Bxb5ZYc9.d.cts +34 -0
- package/dist/{index-BJB7t9gg.d.cts → index-C0ZXMaXO.d.cts} +2 -2
- package/dist/{index-b5BYtczN.d.cts → index-C8mdwMXc.d.cts} +169 -127
- package/dist/index-CDAjUFIv.d.ts +36 -0
- package/dist/index-CPgZ5wRl.d.ts +44 -0
- package/dist/{index-AMWewNDe.d.cts → index-CUwyr1Kk.d.cts} +33 -4
- package/dist/index-CUyrtuOf.d.cts +127 -0
- package/dist/{index-C-TXEa7C.d.ts → index-CY2TljO4.d.ts} +2 -2
- package/dist/index-CmnuOibw.d.ts +37 -0
- package/dist/{index-DiobMNwE.d.ts → index-CuYwdKO-.d.ts} +3 -3
- package/dist/index-DFhjO4Gg.d.cts +44 -0
- package/dist/{index-1z8vRTCt.d.cts → index-DdD5MVDL.d.ts} +121 -547
- package/dist/index-DrISNAOm.d.ts +45 -0
- package/dist/index-QBpffFW-.d.cts +86 -0
- package/dist/{index-J7Kc0oIQ.d.cts → index-_oMEWlDq.d.cts} +3 -3
- package/dist/{index-CYkjxu3s.d.ts → index-eJ6T_qGM.d.ts} +33 -4
- package/dist/index-qldRdbQw.d.ts +86 -0
- package/dist/index-xdGjv0nO.d.ts +127 -0
- package/dist/index.cjs +2334 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1007 -648
- package/dist/index.d.ts +1007 -648
- package/dist/index.js +1204 -1172
- package/dist/index.js.map +1 -1
- package/dist/{meta-CnkLA_43.d.ts → meta-BGqSZ7mt.d.ts} +1 -1
- package/dist/{meta-DWbkoq1s.d.cts → meta-C0-8XW6Q.d.cts} +1 -1
- package/dist/{node-B-f-Lu-k.d.cts → node-C_IBuvX2.d.cts} +26 -1
- package/dist/{node-B-f-Lu-k.d.ts → node-C_IBuvX2.d.ts} +26 -1
- package/dist/{observable-DBnrwcar.d.cts → observable-Crr1jgzx.d.cts} +1 -1
- package/dist/{observable-uP-wy_uK.d.ts → observable-DCk45RH5.d.ts} +1 -1
- package/dist/patterns/demo-shell.cjs +5604 -0
- package/dist/patterns/demo-shell.cjs.map +1 -0
- package/dist/patterns/demo-shell.d.cts +6 -0
- package/dist/patterns/demo-shell.d.ts +6 -0
- package/dist/patterns/demo-shell.js +15 -0
- package/dist/patterns/demo-shell.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +843 -29
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +6 -5
- package/dist/patterns/reactive-layout/index.d.ts +6 -5
- package/dist/patterns/reactive-layout/index.js +25 -10
- package/dist/reactive-layout-BaOQefHu.d.cts +183 -0
- package/dist/reactive-layout-D9gejYXE.d.ts +183 -0
- package/dist/{storage-BuTdpCI1.d.cts → storage-BMycWEh2.d.ts} +9 -1
- package/dist/{storage-F2X1U1x0.d.ts → storage-DiqWHzVI.d.cts} +9 -1
- package/package.json +32 -2
- package/dist/chunk-5DJTTKX3.js.map +0 -1
- package/dist/chunk-5WGT55R4.js.map +0 -1
- package/dist/chunk-AOCBDH4T.js.map +0 -1
- package/dist/chunk-MW4VAKAO.js +0 -47
- package/dist/chunk-MW4VAKAO.js.map +0 -1
- package/dist/chunk-TDEXAMGO.js.map +0 -1
- package/dist/chunk-XOFWRC73.js.map +0 -1
- /package/dist/{chunk-H4RVA4VE.js.map → chunk-VYPWMZ6H.js.map} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { i as index$2 } from './index-qldRdbQw.js';
|
|
2
|
+
import { i as index$3 } from './index-xdGjv0nO.js';
|
|
3
|
+
import { i as index$4 } from './index-CuYwdKO-.js';
|
|
4
|
+
import { i as index$5 } from './index-CPgZ5wRl.js';
|
|
5
|
+
import { N as Node } from './node-C_IBuvX2.js';
|
|
6
|
+
import { i as index$6 } from './index-CDAjUFIv.js';
|
|
7
|
+
import { i as index$7 } from './index-DrISNAOm.js';
|
|
8
|
+
import { i as index$8 } from './index-BYOHF0zP.js';
|
|
9
|
+
import { i as index$9 } from './index-CmnuOibw.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Options for creating signals.
|
|
13
|
+
*
|
|
14
|
+
* @category compat
|
|
15
|
+
*/
|
|
16
|
+
interface SignalOptions {
|
|
17
|
+
/** Optional identifier for the underlying node. */
|
|
18
|
+
name?: string;
|
|
19
|
+
/** Custom equality function for change detection. */
|
|
20
|
+
equals?: (a: any, b: any) => boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Common interface for all reactive signals.
|
|
24
|
+
*
|
|
25
|
+
* @category compat
|
|
26
|
+
*/
|
|
27
|
+
interface AnySignal<T> {
|
|
28
|
+
/** Returns the current value of the signal. */
|
|
29
|
+
get(): T;
|
|
30
|
+
/** @internal The underlying GraphReFly node. */
|
|
31
|
+
_node: Node<T>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* TC39 `Signal.State` — a writable signal backed by a GraphReFly `state` node.
|
|
35
|
+
* Automatically registers itself as a dependency if read inside a `Computed`.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const count = new Signal.State(0);
|
|
40
|
+
* count.get(); // 0
|
|
41
|
+
* count.set(1);
|
|
42
|
+
* count.get(); // 1
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare class SignalState<T> implements AnySignal<T> {
|
|
46
|
+
/** @internal */
|
|
47
|
+
_node: Node<T>;
|
|
48
|
+
private readonly _equals;
|
|
49
|
+
constructor(initial: T, opts?: SignalOptions);
|
|
50
|
+
get(): T;
|
|
51
|
+
set(value: T): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* TC39 `Signal.Computed` — a read-only signal backed by `dynamicNode`.
|
|
55
|
+
* Automatically tracks dependencies when `get()` is called on other signals
|
|
56
|
+
* during its computation.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const count = new Signal.State(0);
|
|
61
|
+
* const doubled = new Signal.Computed(() => count.get() * 2);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare class SignalComputed<T> implements AnySignal<T> {
|
|
65
|
+
/** @internal */
|
|
66
|
+
_node: Node<T>;
|
|
67
|
+
constructor(computation: () => T, opts?: SignalOptions);
|
|
68
|
+
get(): T;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* TC39 Signals-compatible namespace. Wraps GraphReFly primitives.
|
|
72
|
+
* Provides auto-tracking conforming to the TS39 signals proposal.
|
|
73
|
+
*
|
|
74
|
+
* @category compat
|
|
75
|
+
*/
|
|
76
|
+
declare const Signal: {
|
|
77
|
+
readonly State: typeof SignalState;
|
|
78
|
+
readonly Computed: typeof SignalComputed;
|
|
79
|
+
/**
|
|
80
|
+
* Subscribes to changes on a signal.
|
|
81
|
+
* Returns an unsubscribe callback.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const count = new Signal.State(0);
|
|
86
|
+
* const unsub = Signal.sub(count, v => console.log(v));
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
readonly sub: <T>(signal: AnySignal<T>, callback: ((value: T) => void) | {
|
|
90
|
+
data?: (value: T) => void;
|
|
91
|
+
error?: (err: unknown) => void;
|
|
92
|
+
complete?: () => void;
|
|
93
|
+
}) => (() => void);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type index$1_AnySignal<T> = AnySignal<T>;
|
|
97
|
+
declare const index$1_Signal: typeof Signal;
|
|
98
|
+
type index$1_SignalComputed<T> = SignalComputed<T>;
|
|
99
|
+
declare const index$1_SignalComputed: typeof SignalComputed;
|
|
100
|
+
type index$1_SignalOptions = SignalOptions;
|
|
101
|
+
type index$1_SignalState<T> = SignalState<T>;
|
|
102
|
+
declare const index$1_SignalState: typeof SignalState;
|
|
103
|
+
declare namespace index$1 {
|
|
104
|
+
export { type index$1_AnySignal as AnySignal, index$1_Signal as Signal, index$1_SignalComputed as SignalComputed, type index$1_SignalOptions as SignalOptions, index$1_SignalState as SignalState };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Compat layer: compatibility wrappers for other state management libraries (Phase 5.1b).
|
|
109
|
+
*
|
|
110
|
+
* Framework adapters are optional peers. Install only what you use:
|
|
111
|
+
* - `@graphrefly/graphrefly-ts/compat/react` -> `react`, `react-dom`
|
|
112
|
+
* - `@graphrefly/graphrefly-ts/compat/vue` -> `vue`
|
|
113
|
+
* - `@graphrefly/graphrefly-ts/compat/svelte` -> `svelte`
|
|
114
|
+
* - `@graphrefly/graphrefly-ts/compat/solid` -> `solid-js`
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
declare namespace index {
|
|
118
|
+
export { index$2 as jotai, index$3 as nanostores, index$4 as nestjs, index$5 as react, index$1 as signals, index$6 as solid, index$7 as svelte, index$8 as vue, index$9 as zustand };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export { index$1 as a, index as i };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Ref, WatchSource } from 'vue';
|
|
2
|
+
import { N as Node } from './node-C_IBuvX2.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Subscribe to a read-only `Node<T>` as a Vue `Ref<T>`. Auto-unsubscribes on scope disposal.
|
|
6
|
+
* Subscription lifecycle is tied to Vue scope disposal (not node terminal messages).
|
|
7
|
+
*/
|
|
8
|
+
declare function useSubscribe<T>(node: Node<T>): Readonly<Ref<T | undefined | null>>;
|
|
9
|
+
/**
|
|
10
|
+
* Bind a writable `Node<T>` as a Vue `Ref<T>`. Reads and writes are bidirectional.
|
|
11
|
+
* Value sets always dispatch `[[DIRTY], [DATA, value]]`, including `value === undefined`.
|
|
12
|
+
* Subscription lifecycle is tied to Vue scope disposal (not node terminal messages).
|
|
13
|
+
*/
|
|
14
|
+
declare function useStore<T>(node: Node<T>): Ref<T | undefined | null>;
|
|
15
|
+
/** Maps a key to an object of nodes. Used by `useSubscribeRecord` factory. */
|
|
16
|
+
type NodeFactory<K, R extends Record<string, any>> = (key: K) => {
|
|
17
|
+
[P in keyof R]: Node<R[P]>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Subscribe to a dynamic set of keyed node records. When keys change,
|
|
21
|
+
* old subscriptions are torn down and new ones created automatically.
|
|
22
|
+
* Must be called during Vue `setup()`.
|
|
23
|
+
*/
|
|
24
|
+
declare function useSubscribeRecord<K extends string, R extends Record<string, any>>(keys: WatchSource<K[] | undefined>, factory: NodeFactory<K, R>): Readonly<Ref<Record<K, R>>>;
|
|
25
|
+
|
|
26
|
+
type index_NodeFactory<K, R extends Record<string, any>> = NodeFactory<K, R>;
|
|
27
|
+
declare const index_useStore: typeof useStore;
|
|
28
|
+
declare const index_useSubscribe: typeof useSubscribe;
|
|
29
|
+
declare const index_useSubscribeRecord: typeof useSubscribeRecord;
|
|
30
|
+
declare namespace index {
|
|
31
|
+
export { type index_NodeFactory as NodeFactory, index_useStore as useStore, index_useSubscribe as useSubscribe, index_useSubscribeRecord as useSubscribeRecord };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { type NodeFactory as N, useSubscribe as a, useSubscribeRecord as b, index as i, useStore as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Messages, a as NodeOptions, F as FnCtx, N as Node, b as NodeActions, x as NodeFnCleanup, A as Actor, C as COMPLETE, c as COMPLETE_MSG, d as COMPLETE_ONLY_BATCH, D as DATA, e as DEFAULT_ACTOR, f as DIRTY, g as DIRTY_MSG, h as DIRTY_ONLY_BATCH, i as DepRecord, E as ERROR,
|
|
2
|
-
import { D as DescribeDetail, a as DescribeField, b as DescribeNodeOutput, r as resolveDescribeFields } from './meta-
|
|
1
|
+
import { t as Messages, a as NodeOptions, F as FnCtx, N as Node, b as NodeActions, x as NodeFnCleanup, A as Actor, C as COMPLETE, c as COMPLETE_MSG, d as COMPLETE_ONLY_BATCH, D as DATA, e as DEFAULT_ACTOR, f as DIRTY, g as DIRTY_MSG, h as DIRTY_ONLY_BATCH, i as DepRecord, E as ERROR, j as GlobalInspectorEvent, k as GlobalInspectorHook, l as GraphReFlyConfig, G as GuardAction, m as GuardDenied, n as GuardDeniedDetails, H as HashFn, I as INVALIDATE, o as INVALIDATE_MSG, p as INVALIDATE_ONLY_BATCH, M as Message, q as MessageContext, r as MessageTypeRegistration, s as MessageTypeRegistrationInput, u as NodeCtx, v as NodeDescribeKind, w as NodeFn, y as NodeGuard, z as NodeImpl, B as NodeInspectorHook, J as NodeInspectorHookEvent, K as NodeSink, L as NodeStatus, O as NodeTransportOptions, Q as NodeVersionInfo, R as OnMessageHandler, S as OnSubscribeHandler, T as PAUSE, U as PolicyAllow, V as PolicyDeny, P as PolicyRuleData, W as RESOLVED, X as RESOLVED_MSG, Y as RESOLVED_ONLY_BATCH, Z as RESUME, _ as START, $ as START_MSG, a0 as SubscribeContext, a1 as TEARDOWN, a2 as TEARDOWN_MSG, a3 as TEARDOWN_ONLY_BATCH, a4 as V0, a5 as V1, a6 as VersioningLevel, a7 as VersioningOptions, a8 as accessHintForGuard, a9 as advanceVersion, aa as configure, ab as createVersioning, ac as defaultConfig, ad as defaultHash, ae as isV1, af as node, ag as normalizeActor, ah as policy, ai as policyFromRules, aj as registerBuiltins } from './node-C_IBuvX2.cjs';
|
|
2
|
+
import { D as DescribeDetail, a as DescribeField, b as DescribeNodeOutput, r as resolveDescribeFields } from './meta-C0-8XW6Q.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Batch deferral for tier-3+ messages, plus per-node emit coalescing inside
|
|
@@ -1,119 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/** Pluggable measurement backend. */
|
|
5
|
-
interface MeasurementAdapter {
|
|
6
|
-
measureSegment(text: string, font: string): {
|
|
7
|
-
width: number;
|
|
8
|
-
};
|
|
9
|
-
/** Optional; adapters may omit for read-only / stateless measurement. */
|
|
10
|
-
clearCache?(): void;
|
|
11
|
-
}
|
|
12
|
-
/** Mutable counters for `analyzeAndMeasure` cache hit ratio (hits / (hits + misses)). */
|
|
13
|
-
type SegmentMeasureStats = {
|
|
14
|
-
hits: number;
|
|
15
|
-
misses: number;
|
|
16
|
-
};
|
|
17
|
-
/** Break kind for each segment (ported from Pretext analysis.ts). */
|
|
18
|
-
type SegmentBreakKind = "text" | "space" | "zero-width-break" | "soft-hyphen" | "hard-break";
|
|
19
|
-
/** A measured text segment ready for line breaking. */
|
|
20
|
-
type PreparedSegment = {
|
|
21
|
-
text: string;
|
|
22
|
-
width: number;
|
|
23
|
-
kind: SegmentBreakKind;
|
|
24
|
-
/** Grapheme widths for overflow-wrap: break-word (null if single grapheme). */
|
|
25
|
-
graphemeWidths: number[] | null;
|
|
26
|
-
};
|
|
27
|
-
/** A laid-out line with start/end cursors. */
|
|
28
|
-
type LayoutLine = {
|
|
29
|
-
text: string;
|
|
30
|
-
width: number;
|
|
31
|
-
startSegment: number;
|
|
32
|
-
startGrapheme: number;
|
|
33
|
-
endSegment: number;
|
|
34
|
-
endGrapheme: number;
|
|
35
|
-
};
|
|
36
|
-
/** Per-character position for hit testing. */
|
|
37
|
-
type CharPosition = {
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
width: number;
|
|
41
|
-
height: number;
|
|
42
|
-
line: number;
|
|
43
|
-
};
|
|
44
|
-
/** Full layout result from the line-breaks derived node. */
|
|
45
|
-
type LineBreaksResult = {
|
|
46
|
-
lines: LayoutLine[];
|
|
47
|
-
lineCount: number;
|
|
48
|
-
};
|
|
49
|
-
/** Result of the reactive layout graph's describe-accessible state. */
|
|
50
|
-
type ReactiveLayoutBundle = {
|
|
51
|
-
graph: Graph;
|
|
52
|
-
/** Set input text. */
|
|
53
|
-
setText: (text: string) => void;
|
|
54
|
-
/** Set CSS font string. */
|
|
55
|
-
setFont: (font: string) => void;
|
|
56
|
-
/** Set line height (px). */
|
|
57
|
-
setLineHeight: (lineHeight: number) => void;
|
|
58
|
-
/** Set max width constraint (px). */
|
|
59
|
-
setMaxWidth: (maxWidth: number) => void;
|
|
60
|
-
/** Segments node. */
|
|
61
|
-
segments: Node<PreparedSegment[]>;
|
|
62
|
-
/** Line breaks node. */
|
|
63
|
-
lineBreaks: Node<LineBreaksResult>;
|
|
64
|
-
/** Total height node. */
|
|
65
|
-
height: Node<number>;
|
|
66
|
-
/** Per-character positions node. */
|
|
67
|
-
charPositions: Node<CharPosition[]>;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Merge segmentation pieces: sticky punctuation, CJK per-grapheme splitting,
|
|
71
|
-
* and produce the final measured segment list.
|
|
72
|
-
*/
|
|
73
|
-
declare function analyzeAndMeasure(text: string, font: string, adapter: MeasurementAdapter, cache: Map<string, Map<string, number>>, stats?: SegmentMeasureStats): PreparedSegment[];
|
|
74
|
-
/**
|
|
75
|
-
* Greedy line-breaking algorithm.
|
|
76
|
-
*
|
|
77
|
-
* Walks segments left to right, accumulating width. Breaks when a segment would
|
|
78
|
-
* overflow maxWidth. Supports:
|
|
79
|
-
* - Trailing space hang (spaces don't trigger breaks)
|
|
80
|
-
* - overflow-wrap: break-word via grapheme widths
|
|
81
|
-
* - Soft hyphens (break opportunity, adds visible hyphen width)
|
|
82
|
-
* - Hard breaks (forced newline)
|
|
83
|
-
*/
|
|
84
|
-
declare function computeLineBreaks(segments: PreparedSegment[], maxWidth: number, adapter: MeasurementAdapter, font: string, cache: Map<string, Map<string, number>>): LineBreaksResult;
|
|
85
|
-
/** Compute per-character x,y positions from line breaks and segments. */
|
|
86
|
-
declare function computeCharPositions(lineBreaks: LineBreaksResult, segments: PreparedSegment[], lineHeight: number): CharPosition[];
|
|
87
|
-
type ReactiveLayoutOptions = {
|
|
88
|
-
/** Measurement backend (required). */
|
|
89
|
-
adapter: MeasurementAdapter;
|
|
90
|
-
/** Graph name (default: "reactive-layout"). */
|
|
91
|
-
name?: string;
|
|
92
|
-
/** Initial text. */
|
|
93
|
-
text?: string;
|
|
94
|
-
/** Initial CSS font string. */
|
|
95
|
-
font?: string;
|
|
96
|
-
/** Initial line height in px. */
|
|
97
|
-
lineHeight?: number;
|
|
98
|
-
/** Initial max width in px (clamped to ≥ 0). */
|
|
99
|
-
maxWidth?: number;
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Create a reactive text layout graph.
|
|
103
|
-
*
|
|
104
|
-
* ```
|
|
105
|
-
* Graph("reactive-layout")
|
|
106
|
-
* ├── state("text")
|
|
107
|
-
* ├── state("font")
|
|
108
|
-
* ├── state("line-height")
|
|
109
|
-
* ├── state("max-width")
|
|
110
|
-
* ├── derived("segments") — text + font → PreparedSegment[]
|
|
111
|
-
* ├── derived("line-breaks") — segments + max-width → LineBreaksResult
|
|
112
|
-
* ├── derived("height") — line-breaks → number
|
|
113
|
-
* └── derived("char-positions") — line-breaks + segments → CharPosition[]
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
declare function reactiveLayout(opts: ReactiveLayoutOptions): ReactiveLayoutBundle;
|
|
1
|
+
import { M as MeasurementAdapter, P as PreparedSegment, L as LineBreaksResult, C as CharPosition, a as LayoutCursor, I as Interval, b as LayoutLine, c as LayoutNextLineContext, d as LayoutNextLineResult, R as ReactiveLayoutBundle, e as ReactiveLayoutOptions, S as SegmentBreakKind, f as SegmentMeasureStats, g as analyzeAndMeasure, h as carveTextLineSlots, i as computeCharPositions, j as computeLineBreaks, l as layoutNextLine, r as reactiveLayout } from './reactive-layout-BaOQefHu.cjs';
|
|
2
|
+
import { N as Node } from './node-C_IBuvX2.cjs';
|
|
3
|
+
import { G as Graph } from './graph-6tZ5jEzr.cjs';
|
|
117
4
|
|
|
118
5
|
/**
|
|
119
6
|
* MeasurementAdapter implementations (roadmap §7.1 — pluggable backends).
|
|
@@ -392,6 +279,142 @@ declare function computeTotalHeight(flow: PositionedBlock[]): number;
|
|
|
392
279
|
*/
|
|
393
280
|
declare function reactiveBlockLayout(opts: ReactiveBlockLayoutOptions): ReactiveBlockLayoutBundle;
|
|
394
281
|
|
|
282
|
+
/** A circle obstacle. Center `(cx, cy)`, radius `r`; text keeps `padding` distance. */
|
|
283
|
+
type CircleObstacle = {
|
|
284
|
+
kind: "circle";
|
|
285
|
+
cx: number;
|
|
286
|
+
cy: number;
|
|
287
|
+
r: number;
|
|
288
|
+
/** Horizontal padding between obstacle and wrapped text (default 0). */
|
|
289
|
+
hPad?: number;
|
|
290
|
+
/** Vertical padding — band overlap tolerance (default 0). */
|
|
291
|
+
vPad?: number;
|
|
292
|
+
};
|
|
293
|
+
/** A rectangle obstacle. Top-left `(x, y)`, size `(w, h)`. */
|
|
294
|
+
type RectObstacle = {
|
|
295
|
+
kind: "rect";
|
|
296
|
+
x: number;
|
|
297
|
+
y: number;
|
|
298
|
+
w: number;
|
|
299
|
+
h: number;
|
|
300
|
+
hPad?: number;
|
|
301
|
+
vPad?: number;
|
|
302
|
+
};
|
|
303
|
+
/** Union of built-in obstacle shapes. */
|
|
304
|
+
type Obstacle = CircleObstacle | RectObstacle;
|
|
305
|
+
/**
|
|
306
|
+
* Compute the horizontal interval occluded by a circle at vertical band
|
|
307
|
+
* `[bandTop, bandBottom]`, or `null` if no occlusion.
|
|
308
|
+
*
|
|
309
|
+
* Exported so consumers that render obstacle outlines in sync with the flow
|
|
310
|
+
* can reuse the same geometry the flow engine uses — no divergence.
|
|
311
|
+
*/
|
|
312
|
+
declare function circleIntervalForBand(o: CircleObstacle, bandTop: number, bandBottom: number): Interval | null;
|
|
313
|
+
/** Same as `circleIntervalForBand` for rectangles. */
|
|
314
|
+
declare function rectIntervalForBand(o: RectObstacle, bandTop: number, bandBottom: number): Interval | null;
|
|
315
|
+
type FlowContainer = {
|
|
316
|
+
width: number;
|
|
317
|
+
height: number;
|
|
318
|
+
paddingX?: number;
|
|
319
|
+
paddingY?: number;
|
|
320
|
+
};
|
|
321
|
+
type FlowColumns = {
|
|
322
|
+
count: number;
|
|
323
|
+
gap: number;
|
|
324
|
+
};
|
|
325
|
+
/** A single positioned line after flow layout. */
|
|
326
|
+
type PositionedLine = {
|
|
327
|
+
x: number;
|
|
328
|
+
y: number;
|
|
329
|
+
/** Natural measured width of the text content. */
|
|
330
|
+
width: number;
|
|
331
|
+
/** Width of the slot this line was placed in — use this as the DOM element's
|
|
332
|
+
* `width` when applying `text-align: justify` so the line stretches to the
|
|
333
|
+
* obstacle edge on both sides. */
|
|
334
|
+
slotWidth: number;
|
|
335
|
+
text: string;
|
|
336
|
+
/** Which column index this line belongs to (0-based). */
|
|
337
|
+
columnIndex: number;
|
|
338
|
+
/** `true` iff the slot's right edge was carved short by an obstacle (the
|
|
339
|
+
* slot sits to the LEFT of an obstacle). Renderers can right-align text
|
|
340
|
+
* in these slots so single-word lines still hug the obstacle — CSS
|
|
341
|
+
* `text-align: justify` can't stretch single-word lines, which otherwise
|
|
342
|
+
* produces a visible asymmetry vs. the slot on the other side of the
|
|
343
|
+
* obstacle (which is flush by default). */
|
|
344
|
+
flushToRight: boolean;
|
|
345
|
+
};
|
|
346
|
+
/** Options for `reactiveFlowLayout`. */
|
|
347
|
+
type ReactiveFlowLayoutOptions = {
|
|
348
|
+
adapter: MeasurementAdapter;
|
|
349
|
+
name?: string;
|
|
350
|
+
text?: string;
|
|
351
|
+
font?: string;
|
|
352
|
+
lineHeight?: number;
|
|
353
|
+
container?: FlowContainer;
|
|
354
|
+
columns?: FlowColumns;
|
|
355
|
+
obstacles?: Obstacle[];
|
|
356
|
+
/** Minimum slot width (px) below which a slot is discarded rather than squeezed. Default `20`. */
|
|
357
|
+
minSlotWidth?: number;
|
|
358
|
+
};
|
|
359
|
+
/** Result bundle from `reactiveFlowLayout`. */
|
|
360
|
+
type ReactiveFlowLayoutBundle = {
|
|
361
|
+
graph: Graph;
|
|
362
|
+
setText: (text: string) => void;
|
|
363
|
+
setFont: (font: string) => void;
|
|
364
|
+
setLineHeight: (lh: number) => void;
|
|
365
|
+
setContainer: (c: FlowContainer) => void;
|
|
366
|
+
setColumns: (c: FlowColumns) => void;
|
|
367
|
+
setObstacles: (o: Obstacle[]) => void;
|
|
368
|
+
segments: Node<PreparedSegment[]>;
|
|
369
|
+
flowLines: Node<PositionedLine[]>;
|
|
370
|
+
};
|
|
371
|
+
/** Result of `computeFlowLines`. */
|
|
372
|
+
type FlowLinesResult = {
|
|
373
|
+
/** Positioned lines in render order (columns inner-ordered top-to-bottom). */
|
|
374
|
+
lines: PositionedLine[];
|
|
375
|
+
/** Cursor position after the last line was placed. If
|
|
376
|
+
* `cursor.segmentIndex < segments.length`, the layout **truncated** — the
|
|
377
|
+
* container couldn't fit all text. */
|
|
378
|
+
cursor: LayoutCursor;
|
|
379
|
+
};
|
|
380
|
+
/**
|
|
381
|
+
* Lay out `segments` across N columns, wrapping each line around `obstacles`.
|
|
382
|
+
* Pure function — no reactive wiring. Exported for testing and for consumers
|
|
383
|
+
* who want to run flow layout outside a Graph.
|
|
384
|
+
*
|
|
385
|
+
* `carveTextLineSlots` guarantees left-to-right-ordered, non-overlapping slots,
|
|
386
|
+
* so this function does not sort them.
|
|
387
|
+
*/
|
|
388
|
+
declare function computeFlowLines(segments: PreparedSegment[], container: FlowContainer, columns: FlowColumns, obstacles: Obstacle[], lineHeight: number, minSlotWidth: number): FlowLinesResult;
|
|
389
|
+
/**
|
|
390
|
+
* Create a reactive flow-layout graph: N columns of text wrapping around
|
|
391
|
+
* shape obstacles. Re-runs only the dependent derived nodes on any input
|
|
392
|
+
* change. Obstacle movement (e.g. rAF-driven) invalidates `flow-lines` only;
|
|
393
|
+
* `segments` stays cached as long as `text`/`font` don't change.
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```ts
|
|
397
|
+
* import { fromRaf, reactiveFlowLayout } from "@graphrefly/graphrefly-ts";
|
|
398
|
+
*
|
|
399
|
+
* const flow = reactiveFlowLayout({
|
|
400
|
+
* adapter: new CanvasMeasureAdapter(),
|
|
401
|
+
* text: longEssay,
|
|
402
|
+
* font: "18px serif",
|
|
403
|
+
* lineHeight: 26,
|
|
404
|
+
* container: { width: 900, height: 600, paddingX: 40, paddingY: 40 },
|
|
405
|
+
* columns: { count: 2, gap: 32 },
|
|
406
|
+
* obstacles: [{ kind: "circle", cx: 450, cy: 300, r: 80 }],
|
|
407
|
+
* });
|
|
408
|
+
*
|
|
409
|
+
* // Animate the obstacle via rAF:
|
|
410
|
+
* fromRaf().subscribe(([[, t]]) => {
|
|
411
|
+
* const x = 450 + 120 * Math.sin((t as number) * 0.001);
|
|
412
|
+
* flow.setObstacles([{ kind: "circle", cx: x, cy: 300, r: 80 }]);
|
|
413
|
+
* });
|
|
414
|
+
* ```
|
|
415
|
+
*/
|
|
416
|
+
declare function reactiveFlowLayout(opts: ReactiveFlowLayoutOptions): ReactiveFlowLayoutBundle;
|
|
417
|
+
|
|
395
418
|
/**
|
|
396
419
|
* Reactive layout pattern — standalone subpath export.
|
|
397
420
|
*
|
|
@@ -405,45 +428,64 @@ type index_CanvasMeasureAdapter = CanvasMeasureAdapter;
|
|
|
405
428
|
declare const index_CanvasMeasureAdapter: typeof CanvasMeasureAdapter;
|
|
406
429
|
type index_CanvasMeasureAdapterOptions = CanvasMeasureAdapterOptions;
|
|
407
430
|
type index_CanvasModule = CanvasModule;
|
|
408
|
-
|
|
431
|
+
declare const index_CharPosition: typeof CharPosition;
|
|
432
|
+
type index_CircleObstacle = CircleObstacle;
|
|
409
433
|
type index_CliMeasureAdapter = CliMeasureAdapter;
|
|
410
434
|
declare const index_CliMeasureAdapter: typeof CliMeasureAdapter;
|
|
411
435
|
type index_CliMeasureAdapterOptions = CliMeasureAdapterOptions;
|
|
412
436
|
type index_ContentBlock = ContentBlock;
|
|
437
|
+
type index_FlowColumns = FlowColumns;
|
|
438
|
+
type index_FlowContainer = FlowContainer;
|
|
439
|
+
type index_FlowLinesResult = FlowLinesResult;
|
|
413
440
|
type index_ImageMeasurer = ImageMeasurer;
|
|
414
441
|
type index_ImageSizeAdapter = ImageSizeAdapter;
|
|
415
442
|
declare const index_ImageSizeAdapter: typeof ImageSizeAdapter;
|
|
416
|
-
|
|
417
|
-
|
|
443
|
+
declare const index_Interval: typeof Interval;
|
|
444
|
+
declare const index_LayoutCursor: typeof LayoutCursor;
|
|
445
|
+
declare const index_LayoutLine: typeof LayoutLine;
|
|
446
|
+
declare const index_LayoutNextLineContext: typeof LayoutNextLineContext;
|
|
447
|
+
declare const index_LayoutNextLineResult: typeof LayoutNextLineResult;
|
|
448
|
+
declare const index_LineBreaksResult: typeof LineBreaksResult;
|
|
418
449
|
type index_MeasuredBlock = MeasuredBlock;
|
|
419
|
-
|
|
450
|
+
declare const index_MeasurementAdapter: typeof MeasurementAdapter;
|
|
420
451
|
type index_NodeCanvasMeasureAdapter = NodeCanvasMeasureAdapter;
|
|
421
452
|
declare const index_NodeCanvasMeasureAdapter: typeof NodeCanvasMeasureAdapter;
|
|
453
|
+
type index_Obstacle = Obstacle;
|
|
422
454
|
type index_PositionedBlock = PositionedBlock;
|
|
455
|
+
type index_PositionedLine = PositionedLine;
|
|
423
456
|
type index_PrecomputedAdapter = PrecomputedAdapter;
|
|
424
457
|
declare const index_PrecomputedAdapter: typeof PrecomputedAdapter;
|
|
425
458
|
type index_PrecomputedAdapterOptions = PrecomputedAdapterOptions;
|
|
426
|
-
|
|
459
|
+
declare const index_PreparedSegment: typeof PreparedSegment;
|
|
427
460
|
type index_ReactiveBlockLayoutBundle = ReactiveBlockLayoutBundle;
|
|
428
461
|
type index_ReactiveBlockLayoutOptions = ReactiveBlockLayoutOptions;
|
|
429
|
-
type
|
|
430
|
-
type
|
|
431
|
-
|
|
432
|
-
|
|
462
|
+
type index_ReactiveFlowLayoutBundle = ReactiveFlowLayoutBundle;
|
|
463
|
+
type index_ReactiveFlowLayoutOptions = ReactiveFlowLayoutOptions;
|
|
464
|
+
declare const index_ReactiveLayoutBundle: typeof ReactiveLayoutBundle;
|
|
465
|
+
declare const index_ReactiveLayoutOptions: typeof ReactiveLayoutOptions;
|
|
466
|
+
type index_RectObstacle = RectObstacle;
|
|
467
|
+
declare const index_SegmentBreakKind: typeof SegmentBreakKind;
|
|
468
|
+
declare const index_SegmentMeasureStats: typeof SegmentMeasureStats;
|
|
433
469
|
type index_SvgBoundsAdapter = SvgBoundsAdapter;
|
|
434
470
|
declare const index_SvgBoundsAdapter: typeof SvgBoundsAdapter;
|
|
435
471
|
type index_SvgMeasurer = SvgMeasurer;
|
|
436
472
|
declare const index_analyzeAndMeasure: typeof analyzeAndMeasure;
|
|
473
|
+
declare const index_carveTextLineSlots: typeof carveTextLineSlots;
|
|
474
|
+
declare const index_circleIntervalForBand: typeof circleIntervalForBand;
|
|
437
475
|
declare const index_computeBlockFlow: typeof computeBlockFlow;
|
|
438
476
|
declare const index_computeCharPositions: typeof computeCharPositions;
|
|
477
|
+
declare const index_computeFlowLines: typeof computeFlowLines;
|
|
439
478
|
declare const index_computeLineBreaks: typeof computeLineBreaks;
|
|
440
479
|
declare const index_computeTotalHeight: typeof computeTotalHeight;
|
|
480
|
+
declare const index_layoutNextLine: typeof layoutNextLine;
|
|
441
481
|
declare const index_measureBlock: typeof measureBlock;
|
|
442
482
|
declare const index_measureBlocks: typeof measureBlocks;
|
|
443
483
|
declare const index_reactiveBlockLayout: typeof reactiveBlockLayout;
|
|
484
|
+
declare const index_reactiveFlowLayout: typeof reactiveFlowLayout;
|
|
444
485
|
declare const index_reactiveLayout: typeof reactiveLayout;
|
|
486
|
+
declare const index_rectIntervalForBand: typeof rectIntervalForBand;
|
|
445
487
|
declare namespace index {
|
|
446
|
-
export { type index_BlockAdapters as BlockAdapters, index_CanvasMeasureAdapter as CanvasMeasureAdapter, type index_CanvasMeasureAdapterOptions as CanvasMeasureAdapterOptions, type index_CanvasModule as CanvasModule,
|
|
488
|
+
export { type index_BlockAdapters as BlockAdapters, index_CanvasMeasureAdapter as CanvasMeasureAdapter, type index_CanvasMeasureAdapterOptions as CanvasMeasureAdapterOptions, type index_CanvasModule as CanvasModule, index_CharPosition as CharPosition, type index_CircleObstacle as CircleObstacle, index_CliMeasureAdapter as CliMeasureAdapter, type index_CliMeasureAdapterOptions as CliMeasureAdapterOptions, type index_ContentBlock as ContentBlock, type index_FlowColumns as FlowColumns, type index_FlowContainer as FlowContainer, type index_FlowLinesResult as FlowLinesResult, type index_ImageMeasurer as ImageMeasurer, index_ImageSizeAdapter as ImageSizeAdapter, index_Interval as Interval, index_LayoutCursor as LayoutCursor, index_LayoutLine as LayoutLine, index_LayoutNextLineContext as LayoutNextLineContext, index_LayoutNextLineResult as LayoutNextLineResult, index_LineBreaksResult as LineBreaksResult, type index_MeasuredBlock as MeasuredBlock, index_MeasurementAdapter as MeasurementAdapter, index_NodeCanvasMeasureAdapter as NodeCanvasMeasureAdapter, type index_Obstacle as Obstacle, type index_PositionedBlock as PositionedBlock, type index_PositionedLine as PositionedLine, index_PrecomputedAdapter as PrecomputedAdapter, type index_PrecomputedAdapterOptions as PrecomputedAdapterOptions, index_PreparedSegment as PreparedSegment, type index_ReactiveBlockLayoutBundle as ReactiveBlockLayoutBundle, type index_ReactiveBlockLayoutOptions as ReactiveBlockLayoutOptions, type index_ReactiveFlowLayoutBundle as ReactiveFlowLayoutBundle, type index_ReactiveFlowLayoutOptions as ReactiveFlowLayoutOptions, index_ReactiveLayoutBundle as ReactiveLayoutBundle, index_ReactiveLayoutOptions as ReactiveLayoutOptions, type index_RectObstacle as RectObstacle, index_SegmentBreakKind as SegmentBreakKind, index_SegmentMeasureStats as SegmentMeasureStats, index_SvgBoundsAdapter as SvgBoundsAdapter, type index_SvgMeasurer as SvgMeasurer, index_analyzeAndMeasure as analyzeAndMeasure, index_carveTextLineSlots as carveTextLineSlots, index_circleIntervalForBand as circleIntervalForBand, index_computeBlockFlow as computeBlockFlow, index_computeCharPositions as computeCharPositions, index_computeFlowLines as computeFlowLines, index_computeLineBreaks as computeLineBreaks, index_computeTotalHeight as computeTotalHeight, index_layoutNextLine as layoutNextLine, index_measureBlock as measureBlock, index_measureBlocks as measureBlocks, index_reactiveBlockLayout as reactiveBlockLayout, index_reactiveFlowLayout as reactiveFlowLayout, index_reactiveLayout as reactiveLayout, index_rectIntervalForBand as rectIntervalForBand };
|
|
447
489
|
}
|
|
448
490
|
|
|
449
|
-
export {
|
|
491
|
+
export { rectIntervalForBand as A, type BlockAdapters as B, CanvasMeasureAdapter as C, type FlowColumns as F, type ImageMeasurer as I, type MeasuredBlock as M, NodeCanvasMeasureAdapter as N, type Obstacle as O, type PositionedBlock as P, type ReactiveBlockLayoutBundle as R, SvgBoundsAdapter as S, type CanvasMeasureAdapterOptions as a, type CanvasModule as b, type CircleObstacle as c, CliMeasureAdapter as d, type CliMeasureAdapterOptions as e, type ContentBlock as f, type FlowContainer as g, type FlowLinesResult as h, index as i, ImageSizeAdapter as j, type PositionedLine as k, PrecomputedAdapter as l, type PrecomputedAdapterOptions as m, type ReactiveBlockLayoutOptions as n, type ReactiveFlowLayoutBundle as o, type ReactiveFlowLayoutOptions as p, type RectObstacle as q, type SvgMeasurer as r, circleIntervalForBand as s, computeBlockFlow as t, computeFlowLines as u, computeTotalHeight as v, measureBlock as w, measureBlocks as x, reactiveBlockLayout as y, reactiveFlowLayout as z };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { N as Node } from './node-C_IBuvX2.js';
|
|
2
|
+
|
|
3
|
+
/** Solid accessor function — returns current value when called. */
|
|
4
|
+
type Accessor<T> = () => T;
|
|
5
|
+
/**
|
|
6
|
+
* Subscribe to a `Node<T>` as a Solid signal. Auto-cleans up with the owning scope.
|
|
7
|
+
* Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).
|
|
8
|
+
*/
|
|
9
|
+
declare function useSubscribe<T>(node: Node<T>): Accessor<T | undefined | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Bind a writable `Node<T>` as a Solid resource tuple `[accessor, setter]`.
|
|
12
|
+
* Setter always forwards `[[DIRTY], [DATA, value]]`, including `value === undefined`.
|
|
13
|
+
* Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).
|
|
14
|
+
*/
|
|
15
|
+
declare function useStore<T>(node: Node<T>): [Accessor<T | undefined | null>, (v: T) => void];
|
|
16
|
+
/** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */
|
|
17
|
+
type NodeFactory<K, R extends Record<string, any>> = (key: K) => {
|
|
18
|
+
[P in keyof R]: Node<R[P]>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe to a dynamic set of keyed node records as a Solid accessor.
|
|
22
|
+
* Re-subscribes all per-key fields whenever `keys` changes.
|
|
23
|
+
* Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.
|
|
24
|
+
*/
|
|
25
|
+
declare function useSubscribeRecord<K extends string, R extends Record<string, any>>(keysNode: Node<K[]>, factory: NodeFactory<K, R>): Accessor<Record<K, R>>;
|
|
26
|
+
|
|
27
|
+
type index_Accessor<T> = Accessor<T>;
|
|
28
|
+
type index_NodeFactory<K, R extends Record<string, any>> = NodeFactory<K, R>;
|
|
29
|
+
declare const index_useStore: typeof useStore;
|
|
30
|
+
declare const index_useSubscribe: typeof useSubscribe;
|
|
31
|
+
declare const index_useSubscribeRecord: typeof useSubscribeRecord;
|
|
32
|
+
declare namespace index {
|
|
33
|
+
export { type index_Accessor as Accessor, type index_NodeFactory as NodeFactory, index_useStore as useStore, index_useSubscribe as useSubscribe, index_useSubscribeRecord as useSubscribeRecord };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { type Accessor as A, type NodeFactory as N, useSubscribe as a, useSubscribeRecord as b, index as i, useStore as u };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { N as Node } from './node-C_IBuvX2.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Subscribe to a read-only `Node<T>` as a React value. Re-renders on node value settlement.
|
|
5
|
+
* Subscription lifecycle is tied to React mount/unmount (not node terminal messages).
|
|
6
|
+
*
|
|
7
|
+
* @param node - Any `Node<T>`.
|
|
8
|
+
* @returns `T | undefined` — the current node value, kept in sync via `useSyncExternalStore`.
|
|
9
|
+
*/
|
|
10
|
+
declare function useSubscribe<T>(node: Node<T>): T | undefined | null;
|
|
11
|
+
/**
|
|
12
|
+
* Bind a writable `Node<T>` as a React `[value, setter]` tuple.
|
|
13
|
+
* Setting the value always pushes `[[DIRTY], [DATA, value]]`, including `value === undefined`.
|
|
14
|
+
* Subscription lifecycle is tied to React mount/unmount (not node terminal messages).
|
|
15
|
+
*
|
|
16
|
+
* @param node - A `Node<T>` (e.g. state node).
|
|
17
|
+
* @returns `[T | undefined, (value: T) => void]` — current value and setter function.
|
|
18
|
+
*/
|
|
19
|
+
declare function useStore<T>(node: Node<T>): [T | undefined | null, (value: T) => void];
|
|
20
|
+
/** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */
|
|
21
|
+
type NodeFactory<K, R extends Record<string, any>> = (key: K) => {
|
|
22
|
+
[P in keyof R]: Node<R[P]>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Subscribe to a dynamic set of keyed node records.
|
|
26
|
+
* Re-subscribes all per-key fields whenever `keysNode` changes.
|
|
27
|
+
* Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.
|
|
28
|
+
* Guaranteed to clean up strictly with React hook lifecycle, utilizing no global mappings.
|
|
29
|
+
*
|
|
30
|
+
* @param keysNode - Node of current keys (e.g. node IDs)
|
|
31
|
+
* @param factory - Function returning `{ [field]: Node<V> }` for each key.
|
|
32
|
+
* @returns `Record<K, R>` — snapshot of resolved values for all keys.
|
|
33
|
+
*/
|
|
34
|
+
declare function useSubscribeRecord<K extends string, R extends Record<string, any>>(keysNode: Node<K[]>, factory: NodeFactory<K, R>): Record<K, R>;
|
|
35
|
+
|
|
36
|
+
type index_NodeFactory<K, R extends Record<string, any>> = NodeFactory<K, R>;
|
|
37
|
+
declare const index_useStore: typeof useStore;
|
|
38
|
+
declare const index_useSubscribe: typeof useSubscribe;
|
|
39
|
+
declare const index_useSubscribeRecord: typeof useSubscribeRecord;
|
|
40
|
+
declare namespace index {
|
|
41
|
+
export { type index_NodeFactory as NodeFactory, index_useStore as useStore, index_useSubscribe as useSubscribe, index_useSubscribeRecord as useSubscribeRecord };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { type NodeFactory as N, useSubscribe as a, useSubscribeRecord as b, index as i, useStore as u };
|