@graphrefly/graphrefly 0.25.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-IAHGTNOZ.js → chunk-AMCG74RZ.js} +193 -24
- package/dist/chunk-AMCG74RZ.js.map +1 -0
- package/dist/{chunk-L2GLW2U7.js → chunk-BVZYTZ5H.js} +9 -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-EVR6UFUV.js → chunk-IZYUSJC7.js} +16 -14
- package/dist/{chunk-EVR6UFUV.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-TKE3JGOH.js → chunk-LCE3GF5P.js} +5 -692
- 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-ZQMEI34O.js +713 -0
- 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 +222 -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 +6 -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-B6NFqv3z.d.ts → graph-6tZ5jEzr.d.cts} +195 -4
- package/dist/{graph-D-3JIQme.d.cts → 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-OXImXMq6.d.ts → index-BW1z3BN9.d.ts} +18 -196
- 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-Ds23Wvou.d.ts → index-BeIdBfcb.d.cts} +120 -573
- 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-DKE1EATr.d.cts → index-C8mdwMXc.d.cts} +18 -196
- 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-Ch0IpIO0.d.cts → index-DdD5MVDL.d.ts} +120 -573
- 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 +1780 -176
- 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 +1202 -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 +355 -13
- 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 +15 -12
- 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-IAHGTNOZ.js.map +0 -1
- package/dist/chunk-L2GLW2U7.js.map +0 -1
- package/dist/chunk-MW4VAKAO.js +0 -47
- package/dist/chunk-MW4VAKAO.js.map +0 -1
- package/dist/chunk-TKE3JGOH.js.map +0 -1
- package/dist/chunk-XOFWRC73.js.map +0 -1
- /package/dist/{chunk-H4RVA4VE.js.map → chunk-VYPWMZ6H.js.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { T as ToObservableOptions, t as toObservable } from '../../observable-
|
|
2
|
-
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-
|
|
1
|
+
export { T as ToObservableOptions, t as toObservable } from '../../observable-Crr1jgzx.cjs';
|
|
2
|
+
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-_oMEWlDq.cjs';
|
|
3
3
|
import 'rxjs';
|
|
4
|
-
import '../../node-
|
|
4
|
+
import '../../node-C_IBuvX2.cjs';
|
|
5
5
|
import '@nestjs/common';
|
|
6
6
|
import '@nestjs/core';
|
|
7
|
-
import '../../graph-
|
|
8
|
-
import '../../meta-
|
|
9
|
-
import '../../storage-
|
|
7
|
+
import '../../graph-6tZ5jEzr.cjs';
|
|
8
|
+
import '../../meta-C0-8XW6Q.cjs';
|
|
9
|
+
import '../../storage-DiqWHzVI.cjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { T as ToObservableOptions, t as toObservable } from '../../observable-
|
|
2
|
-
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-
|
|
1
|
+
export { T as ToObservableOptions, t as toObservable } from '../../observable-DCk45RH5.js';
|
|
2
|
+
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-CuYwdKO-.js';
|
|
3
3
|
import 'rxjs';
|
|
4
|
-
import '../../node-
|
|
4
|
+
import '../../node-C_IBuvX2.js';
|
|
5
5
|
import '@nestjs/common';
|
|
6
6
|
import '@nestjs/core';
|
|
7
|
-
import '../../graph-
|
|
8
|
-
import '../../meta-
|
|
9
|
-
import '../../storage-
|
|
7
|
+
import '../../graph-DQ69XU0g.js';
|
|
8
|
+
import '../../meta-BGqSZ7mt.js';
|
|
9
|
+
import '../../storage-BMycWEh2.js';
|
|
@@ -31,18 +31,19 @@ import {
|
|
|
31
31
|
getNodeToken,
|
|
32
32
|
observeSSE,
|
|
33
33
|
observeSubscription
|
|
34
|
-
} from "../../chunk-
|
|
35
|
-
import "../../chunk-QOWVNWOC.js";
|
|
34
|
+
} from "../../chunk-IZYUSJC7.js";
|
|
36
35
|
import {
|
|
37
36
|
toObservable
|
|
38
|
-
} from "../../chunk-
|
|
39
|
-
import "../../chunk-
|
|
40
|
-
import "../../chunk-
|
|
41
|
-
import "../../chunk-
|
|
42
|
-
import "../../chunk-
|
|
43
|
-
import "../../chunk-
|
|
37
|
+
} from "../../chunk-RB6QPHJ7.js";
|
|
38
|
+
import "../../chunk-3ZWCKRHX.js";
|
|
39
|
+
import "../../chunk-6LDQFTYS.js";
|
|
40
|
+
import "../../chunk-JSCT3CR4.js";
|
|
41
|
+
import "../../chunk-BVZYTZ5H.js";
|
|
42
|
+
import "../../chunk-THTWHNU4.js";
|
|
44
43
|
import "../../chunk-7TAQJHQV.js";
|
|
45
|
-
import "../../chunk-
|
|
44
|
+
import "../../chunk-VYPWMZ6H.js";
|
|
45
|
+
import "../../chunk-PHOUUNK7.js";
|
|
46
|
+
import "../../chunk-SX52TAR4.js";
|
|
46
47
|
export {
|
|
47
48
|
ACTOR_KEY,
|
|
48
49
|
COMMAND_HANDLERS,
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/compat/react/index.ts
|
|
21
|
+
var react_exports = {};
|
|
22
|
+
__export(react_exports, {
|
|
23
|
+
useStore: () => useStore,
|
|
24
|
+
useSubscribe: () => useSubscribe,
|
|
25
|
+
useSubscribeRecord: () => useSubscribeRecord
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(react_exports);
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
|
|
30
|
+
// src/core/messages.ts
|
|
31
|
+
var START = /* @__PURE__ */ Symbol.for("graphrefly/START");
|
|
32
|
+
var DATA = /* @__PURE__ */ Symbol.for("graphrefly/DATA");
|
|
33
|
+
var DIRTY = /* @__PURE__ */ Symbol.for("graphrefly/DIRTY");
|
|
34
|
+
var RESOLVED = /* @__PURE__ */ Symbol.for("graphrefly/RESOLVED");
|
|
35
|
+
var INVALIDATE = /* @__PURE__ */ Symbol.for("graphrefly/INVALIDATE");
|
|
36
|
+
var TEARDOWN = /* @__PURE__ */ Symbol.for("graphrefly/TEARDOWN");
|
|
37
|
+
var COMPLETE = /* @__PURE__ */ Symbol.for("graphrefly/COMPLETE");
|
|
38
|
+
var DIRTY_MSG = Object.freeze([DIRTY]);
|
|
39
|
+
var RESOLVED_MSG = Object.freeze([RESOLVED]);
|
|
40
|
+
var INVALIDATE_MSG = Object.freeze([INVALIDATE]);
|
|
41
|
+
var START_MSG = Object.freeze([START]);
|
|
42
|
+
var COMPLETE_MSG = Object.freeze([COMPLETE]);
|
|
43
|
+
var TEARDOWN_MSG = Object.freeze([TEARDOWN]);
|
|
44
|
+
var DIRTY_ONLY_BATCH = Object.freeze([DIRTY_MSG]);
|
|
45
|
+
var RESOLVED_ONLY_BATCH = Object.freeze([RESOLVED_MSG]);
|
|
46
|
+
var INVALIDATE_ONLY_BATCH = Object.freeze([INVALIDATE_MSG]);
|
|
47
|
+
var COMPLETE_ONLY_BATCH = Object.freeze([COMPLETE_MSG]);
|
|
48
|
+
var TEARDOWN_ONLY_BATCH = Object.freeze([TEARDOWN_MSG]);
|
|
49
|
+
|
|
50
|
+
// src/compat/react/index.ts
|
|
51
|
+
function useSubscribe(node) {
|
|
52
|
+
return (0, import_react.useSyncExternalStore)(
|
|
53
|
+
(onStoreChange) => {
|
|
54
|
+
let disposed = false;
|
|
55
|
+
const unsub = node.subscribe(() => {
|
|
56
|
+
if (!disposed) onStoreChange();
|
|
57
|
+
});
|
|
58
|
+
return () => {
|
|
59
|
+
disposed = true;
|
|
60
|
+
unsub();
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
() => node.cache,
|
|
64
|
+
() => node.cache
|
|
65
|
+
// Server snapshot
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function useStore(node) {
|
|
69
|
+
const value = useSubscribe(node);
|
|
70
|
+
const setter = (0, import_react.useCallback)(
|
|
71
|
+
(v) => {
|
|
72
|
+
node.down([[DIRTY], [DATA, v]]);
|
|
73
|
+
},
|
|
74
|
+
[node]
|
|
75
|
+
);
|
|
76
|
+
return [value, setter];
|
|
77
|
+
}
|
|
78
|
+
function useSubscribeRecord(keysNode, factory) {
|
|
79
|
+
const factoryRef = (0, import_react.useRef)(factory);
|
|
80
|
+
factoryRef.current = factory;
|
|
81
|
+
const store = (0, import_react.useMemo)(() => {
|
|
82
|
+
const computeSnap = () => {
|
|
83
|
+
const snap = {};
|
|
84
|
+
const keys = keysNode.cache ?? [];
|
|
85
|
+
for (const key of keys) {
|
|
86
|
+
const nodes = factoryRef.current(key);
|
|
87
|
+
const values = {};
|
|
88
|
+
for (const field of Object.keys(nodes)) {
|
|
89
|
+
values[field] = nodes[field].cache;
|
|
90
|
+
}
|
|
91
|
+
snap[key] = values;
|
|
92
|
+
}
|
|
93
|
+
return snap;
|
|
94
|
+
};
|
|
95
|
+
let currentSnapshot = computeSnap();
|
|
96
|
+
return {
|
|
97
|
+
subscribe: (onStoreChange) => {
|
|
98
|
+
let disposed = false;
|
|
99
|
+
let entrySubs = [];
|
|
100
|
+
const cleanupEntries = () => {
|
|
101
|
+
for (const unsub of entrySubs) unsub();
|
|
102
|
+
entrySubs = [];
|
|
103
|
+
};
|
|
104
|
+
const sync = (nextKeys) => {
|
|
105
|
+
cleanupEntries();
|
|
106
|
+
for (const key of nextKeys) {
|
|
107
|
+
const nodes = factoryRef.current(key);
|
|
108
|
+
for (const field of Object.keys(nodes)) {
|
|
109
|
+
const unsub = nodes[field].subscribe(() => {
|
|
110
|
+
currentSnapshot = computeSnap();
|
|
111
|
+
if (!disposed) onStoreChange();
|
|
112
|
+
});
|
|
113
|
+
entrySubs.push(unsub);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
currentSnapshot = computeSnap();
|
|
117
|
+
if (!disposed) onStoreChange();
|
|
118
|
+
};
|
|
119
|
+
const keysUnsub = keysNode.subscribe((msgs) => {
|
|
120
|
+
const hasSettled = msgs.some((m) => m[0] === DATA || m[0] === RESOLVED);
|
|
121
|
+
if (!disposed && hasSettled) sync(keysNode.cache ?? []);
|
|
122
|
+
});
|
|
123
|
+
sync(keysNode.cache ?? []);
|
|
124
|
+
return () => {
|
|
125
|
+
disposed = true;
|
|
126
|
+
keysUnsub();
|
|
127
|
+
cleanupEntries();
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
getSnapshot: () => currentSnapshot
|
|
131
|
+
};
|
|
132
|
+
}, [keysNode]);
|
|
133
|
+
return (0, import_react.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
134
|
+
}
|
|
135
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
136
|
+
0 && (module.exports = {
|
|
137
|
+
useStore,
|
|
138
|
+
useSubscribe,
|
|
139
|
+
useSubscribeRecord
|
|
140
|
+
});
|
|
141
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/compat/react/index.ts","../../../src/core/messages.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// React bindings — useStore / useSubscribe\n// ---------------------------------------------------------------------------\n// Bridges GraphReFly nodes into React via useSyncExternalStore.\n// Works with any Node<T>, including companion nodes (node.meta.status).\n//\n// Usage:\n// import { useStore, useSubscribe } from '@graphrefly/graphrefly-ts/compat/react';\n// // Optional peer install (only for this adapter): pnpm add react react-dom\n// const value = useSubscribe(myNode); // T | undefined (read-only)\n// const [count, setCount] = useStore(counter); // [T | undefined, setter]\n// ---------------------------------------------------------------------------\n\nimport { useCallback, useMemo, useRef, useSyncExternalStore } from \"react\";\nimport { DATA, DIRTY, type Messages, RESOLVED } from \"../../core/messages.js\";\nimport type { Node } from \"../../core/node.js\";\n\n/**\n * Subscribe to a read-only `Node<T>` as a React value. Re-renders on node value settlement.\n * Subscription lifecycle is tied to React mount/unmount (not node terminal messages).\n *\n * @param node - Any `Node<T>`.\n * @returns `T | undefined` — the current node value, kept in sync via `useSyncExternalStore`.\n */\nexport function useSubscribe<T>(node: Node<T>): T | undefined | null {\n\treturn useSyncExternalStore(\n\t\t(onStoreChange) => {\n\t\t\tlet disposed = false;\n\t\t\tconst unsub = node.subscribe(() => {\n\t\t\t\tif (!disposed) onStoreChange();\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tdisposed = true;\n\t\t\t\tunsub();\n\t\t\t};\n\t\t},\n\t\t() => node.cache,\n\t\t() => node.cache, // Server snapshot\n\t);\n}\n\n/**\n * Bind a writable `Node<T>` as a React `[value, setter]` tuple.\n * Setting the value always pushes `[[DIRTY], [DATA, value]]`, including `value === undefined`.\n * Subscription lifecycle is tied to React mount/unmount (not node terminal messages).\n *\n * @param node - A `Node<T>` (e.g. state node).\n * @returns `[T | undefined, (value: T) => void]` — current value and setter function.\n */\nexport function useStore<T>(node: Node<T>): [T | undefined | null, (value: T) => void] {\n\tconst value = useSubscribe(node);\n\tconst setter = useCallback(\n\t\t(v: T) => {\n\t\t\tnode.down([[DIRTY], [DATA, v]]);\n\t\t},\n\t\t[node],\n\t);\n\treturn [value, setter];\n}\n\n/** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */\nexport type NodeFactory<K, R extends Record<string, any>> = (key: K) => {\n\t[P in keyof R]: Node<R[P]>;\n};\n\n/**\n * Subscribe to a dynamic set of keyed node records.\n * Re-subscribes all per-key fields whenever `keysNode` changes.\n * Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.\n * Guaranteed to clean up strictly with React hook lifecycle, utilizing no global mappings.\n *\n * @param keysNode - Node of current keys (e.g. node IDs)\n * @param factory - Function returning `{ [field]: Node<V> }` for each key.\n * @returns `Record<K, R>` — snapshot of resolved values for all keys.\n */\nexport function useSubscribeRecord<K extends string, R extends Record<string, any>>(\n\tkeysNode: Node<K[]>,\n\tfactory: NodeFactory<K, R>,\n): Record<K, R> {\n\tconst factoryRef = useRef(factory);\n\tfactoryRef.current = factory;\n\n\tconst store = useMemo(() => {\n\t\tconst computeSnap = () => {\n\t\t\tconst snap = {} as Record<K, R>;\n\t\t\tconst keys = keysNode.cache ?? [];\n\t\t\tfor (const key of keys) {\n\t\t\t\tconst nodes = factoryRef.current(key);\n\t\t\t\tconst values = {} as R;\n\t\t\t\tfor (const field of Object.keys(nodes) as (keyof R)[]) {\n\t\t\t\t\tvalues[field] = nodes[field].cache as R[keyof R];\n\t\t\t\t}\n\t\t\t\tsnap[key] = values;\n\t\t\t}\n\t\t\treturn snap;\n\t\t};\n\n\t\tlet currentSnapshot = computeSnap();\n\n\t\treturn {\n\t\t\tsubscribe: (onStoreChange: () => void) => {\n\t\t\t\tlet disposed = false;\n\t\t\t\tlet entrySubs: Array<() => void> = [];\n\n\t\t\t\tconst cleanupEntries = () => {\n\t\t\t\t\tfor (const unsub of entrySubs) unsub();\n\t\t\t\t\tentrySubs = [];\n\t\t\t\t};\n\n\t\t\t\tconst sync = (nextKeys: K[]) => {\n\t\t\t\t\tcleanupEntries();\n\t\t\t\t\tfor (const key of nextKeys) {\n\t\t\t\t\t\tconst nodes = factoryRef.current(key);\n\t\t\t\t\t\tfor (const field of Object.keys(nodes) as (keyof R)[]) {\n\t\t\t\t\t\t\tconst unsub = nodes[field].subscribe(() => {\n\t\t\t\t\t\t\t\tcurrentSnapshot = computeSnap();\n\t\t\t\t\t\t\t\tif (!disposed) onStoreChange();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tentrySubs.push(unsub);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcurrentSnapshot = computeSnap();\n\t\t\t\t\tif (!disposed) onStoreChange();\n\t\t\t\t};\n\n\t\t\t\tconst keysUnsub = keysNode.subscribe((msgs: Messages) => {\n\t\t\t\t\tconst hasSettled = msgs.some((m) => m[0] === DATA || m[0] === RESOLVED);\n\t\t\t\t\tif (!disposed && hasSettled) sync(keysNode.cache ?? []);\n\t\t\t\t});\n\t\t\t\tsync(keysNode.cache ?? []);\n\n\t\t\t\treturn () => {\n\t\t\t\t\tdisposed = true;\n\t\t\t\t\tkeysUnsub();\n\t\t\t\t\tcleanupEntries();\n\t\t\t\t};\n\t\t\t},\n\t\t\tgetSnapshot: () => currentSnapshot,\n\t\t};\n\t}, [keysNode]);\n\n\treturn useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n}\n","/**\n * GraphReFly message protocol — §1 `~/src/graphrefly/GRAPHREFLY-SPEC.md`.\n * Emissions are always `[[Type, Data?], ...]` (no single-tuple shorthand).\n *\n * This file is protocol-pure:\n * - Message type symbols (10 built-ins).\n * - `Message` / `Messages` tuple types.\n * - `MessageTypeRegistration` interface (shape of a registry entry).\n *\n * It does NOT own the registry, tier lookups, or any cross-cutting singleton\n * state — that lives in `GraphReFlyConfig` (see `config.ts`) so custom\n * protocols can build isolated instances. Import this module when you need\n * the symbol constants or the tuple types; import `config.ts` when you need\n * tier / wire-crossing / registry lookups.\n */\n\n/** Subscribe-time handshake. Delivered to each new sink at the top of `subscribe()`. Tier 0. */\nexport const START = Symbol.for(\"graphrefly/START\");\n/** Value delivery (`DATA`, value). Tier 3 — deferred inside `batch()`. */\nexport const DATA = Symbol.for(\"graphrefly/DATA\");\n/** Phase 1: value about to change. Tier 1 — immediate. */\nexport const DIRTY = Symbol.for(\"graphrefly/DIRTY\");\n/** Phase 2: dirty pass completed, value unchanged. Tier 3 — deferred inside `batch()`. */\nexport const RESOLVED = Symbol.for(\"graphrefly/RESOLVED\");\n/** Clear cached state; do not auto-emit. Tier 1 — immediate. */\nexport const INVALIDATE = Symbol.for(\"graphrefly/INVALIDATE\");\n/** Suspend activity. Tier 2 — immediate. */\nexport const PAUSE = Symbol.for(\"graphrefly/PAUSE\");\n/** Resume after pause. Tier 2 — immediate. */\nexport const RESUME = Symbol.for(\"graphrefly/RESUME\");\n/** Permanent cleanup. Tier 5 — deferred to batch phase 4. */\nexport const TEARDOWN = Symbol.for(\"graphrefly/TEARDOWN\");\n/** Clean termination. Tier 4 — deferred to batch phase 3. */\nexport const COMPLETE = Symbol.for(\"graphrefly/COMPLETE\");\n/** Error termination. Tier 4 — deferred to batch phase 3. */\nexport const ERROR = Symbol.for(\"graphrefly/ERROR\");\n\n/** One protocol tuple: `[Type, optional payload]`. */\nexport type Message = readonly [symbol, unknown?];\n\n/** A batch of tuples — the wire shape for `node.down()` / `node.up()`. */\nexport type Messages = readonly Message[];\n\n// ---------------------------------------------------------------------------\n// Interned singletons for payload-free tuples\n// ---------------------------------------------------------------------------\n//\n// Every emission path used to allocate fresh `[[DIRTY]]`, `[[RESOLVED]]`,\n// etc. — two arrays per emit in the hot path. Since none of these tuples\n// carry a payload, one frozen instance is indistinguishable from a\n// fresh one. We intern them at module load and reuse forever. Only\n// `[DATA, v]`, `[ERROR, e]`, `[PAUSE, lockId]`, `[RESUME, lockId]` still\n// allocate per-call because they carry payloads.\n//\n// Downstream code MUST treat these as immutable. `Object.freeze` makes\n// accidental mutation throw in strict mode. Do not `push`, splice, or\n// otherwise mutate a Messages array that came from one of these.\n\n/** Singleton `[DIRTY]` tuple — payload-free, interned. */\nexport const DIRTY_MSG: Message = Object.freeze([DIRTY]) as Message;\n/** Singleton `[RESOLVED]` tuple — payload-free, interned. */\nexport const RESOLVED_MSG: Message = Object.freeze([RESOLVED]) as Message;\n/** Singleton `[INVALIDATE]` tuple — payload-free, interned. */\nexport const INVALIDATE_MSG: Message = Object.freeze([INVALIDATE]) as Message;\n/** Singleton `[START]` tuple — payload-free, interned. */\nexport const START_MSG: Message = Object.freeze([START]) as Message;\n/** Singleton `[COMPLETE]` tuple — payload-free, interned. */\nexport const COMPLETE_MSG: Message = Object.freeze([COMPLETE]) as Message;\n/** Singleton `[TEARDOWN]` tuple — payload-free, interned. */\nexport const TEARDOWN_MSG: Message = Object.freeze([TEARDOWN]) as Message;\n\n/** Pre-wrapped `[[DIRTY]]` for `_emit([DIRTY_ONLY_BATCH])`-style callers. */\nexport const DIRTY_ONLY_BATCH: Messages = Object.freeze([DIRTY_MSG]) as Messages;\n/** Pre-wrapped `[[RESOLVED]]`. */\nexport const RESOLVED_ONLY_BATCH: Messages = Object.freeze([RESOLVED_MSG]) as Messages;\n/** Pre-wrapped `[[INVALIDATE]]`. */\nexport const INVALIDATE_ONLY_BATCH: Messages = Object.freeze([INVALIDATE_MSG]) as Messages;\n/** Pre-wrapped `[[COMPLETE]]`. */\nexport const COMPLETE_ONLY_BATCH: Messages = Object.freeze([COMPLETE_MSG]) as Messages;\n/** Pre-wrapped `[[TEARDOWN]]`. */\nexport const TEARDOWN_ONLY_BATCH: Messages = Object.freeze([TEARDOWN_MSG]) as Messages;\n\n// ---------------------------------------------------------------------------\n// Registry entry shape\n// ---------------------------------------------------------------------------\n\n/**\n * Per-type record stored in a {@link GraphReFlyConfig}'s registry.\n *\n * - `tier` — signal tier (0–5 built-in; custom tiers allowed but should fit\n * the phase model used by `batch.ts`).\n * - `wireCrossing` — when `true`, forwarded across SSE/WebSocket/worker\n * adapters. Defaults to `tier >= 3` if omitted in registration input.\n * - `metaPassthrough` — when `false`, this message type is filtered out of\n * `Graph.signal` deliveries to meta companion nodes (spec §2.3). Meta\n * companions still receive everything via their primary's own cascade.\n * Defaults to `true` (meta receives the message).\n */\nexport interface MessageTypeRegistration {\n\ttier: number;\n\twireCrossing: boolean;\n\tmetaPassthrough: boolean;\n}\n\n/**\n * Input accepted by {@link GraphReFlyConfig.registerMessageType}. Only `tier`\n * is required; `wireCrossing` defaults to `tier >= 3`; `metaPassthrough`\n * defaults to `true`.\n */\nexport interface MessageTypeRegistrationInput {\n\ttier: number;\n\twireCrossing?: boolean;\n\tmetaPassthrough?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,mBAAmE;;;ACI5D,IAAM,QAAQ,uBAAO,IAAI,kBAAkB;AAE3C,IAAM,OAAO,uBAAO,IAAI,iBAAiB;AAEzC,IAAM,QAAQ,uBAAO,IAAI,kBAAkB;AAE3C,IAAM,WAAW,uBAAO,IAAI,qBAAqB;AAEjD,IAAM,aAAa,uBAAO,IAAI,uBA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,SAAS,SAAS,CAAC,CAAC;AAEzB,eAAO,MAAM;AACZ,qBAAW;AACX,oBAAU;AACV,yBAAe;AAAA,QAChB;AAAA,MACD;AAAA,MACA,aAAa,MAAM;AAAA,IACpB;AAAA,EACD,GAAG,CAAC,QAAQ,CAAC;AAEb,aAAO,mCAAqB,MAAM,WAAW,MAAM,aAAa,MAAM,WAAW;AAClF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/compat/solid/index.ts
|
|
21
|
+
var solid_exports = {};
|
|
22
|
+
__export(solid_exports, {
|
|
23
|
+
useStore: () => useStore,
|
|
24
|
+
useSubscribe: () => useSubscribe,
|
|
25
|
+
useSubscribeRecord: () => useSubscribeRecord
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(solid_exports);
|
|
28
|
+
var import_solid_js = require("solid-js");
|
|
29
|
+
|
|
30
|
+
// src/core/messages.ts
|
|
31
|
+
var START = /* @__PURE__ */ Symbol.for("graphrefly/START");
|
|
32
|
+
var DATA = /* @__PURE__ */ Symbol.for("graphrefly/DATA");
|
|
33
|
+
var DIRTY = /* @__PURE__ */ Symbol.for("graphrefly/DIRTY");
|
|
34
|
+
var RESOLVED = /* @__PURE__ */ Symbol.for("graphrefly/RESOLVED");
|
|
35
|
+
var INVALIDATE = /* @__PURE__ */ Symbol.for("graphrefly/INVALIDATE");
|
|
36
|
+
var TEARDOWN = /* @__PURE__ */ Symbol.for("graphrefly/TEARDOWN");
|
|
37
|
+
var COMPLETE = /* @__PURE__ */ Symbol.for("graphrefly/COMPLETE");
|
|
38
|
+
var DIRTY_MSG = Object.freeze([DIRTY]);
|
|
39
|
+
var RESOLVED_MSG = Object.freeze([RESOLVED]);
|
|
40
|
+
var INVALIDATE_MSG = Object.freeze([INVALIDATE]);
|
|
41
|
+
var START_MSG = Object.freeze([START]);
|
|
42
|
+
var COMPLETE_MSG = Object.freeze([COMPLETE]);
|
|
43
|
+
var TEARDOWN_MSG = Object.freeze([TEARDOWN]);
|
|
44
|
+
var DIRTY_ONLY_BATCH = Object.freeze([DIRTY_MSG]);
|
|
45
|
+
var RESOLVED_ONLY_BATCH = Object.freeze([RESOLVED_MSG]);
|
|
46
|
+
var INVALIDATE_ONLY_BATCH = Object.freeze([INVALIDATE_MSG]);
|
|
47
|
+
var COMPLETE_ONLY_BATCH = Object.freeze([COMPLETE_MSG]);
|
|
48
|
+
var TEARDOWN_ONLY_BATCH = Object.freeze([TEARDOWN_MSG]);
|
|
49
|
+
|
|
50
|
+
// src/compat/solid/index.ts
|
|
51
|
+
function useSubscribe(node) {
|
|
52
|
+
const [value, setValue] = (0, import_solid_js.createSignal)(node.cache, { equals: false });
|
|
53
|
+
const unsub = node.subscribe(() => {
|
|
54
|
+
setValue(() => node.cache);
|
|
55
|
+
});
|
|
56
|
+
if ((0, import_solid_js.getOwner)()) {
|
|
57
|
+
(0, import_solid_js.onCleanup)(() => unsub());
|
|
58
|
+
} else if (typeof console !== "undefined") {
|
|
59
|
+
console.warn(
|
|
60
|
+
"[graphrefly-ts] useSubscribe called outside a Solid reactive owner \u2014 subscription will not be auto-disposed."
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function useStore(node) {
|
|
66
|
+
const value = useSubscribe(node);
|
|
67
|
+
const setter = (v) => {
|
|
68
|
+
node.down([[DIRTY], [DATA, v]]);
|
|
69
|
+
};
|
|
70
|
+
return [value, setter];
|
|
71
|
+
}
|
|
72
|
+
function useSubscribeRecord(keysNode, factory) {
|
|
73
|
+
const [value, setValue] = (0, import_solid_js.createSignal)({}, { equals: false });
|
|
74
|
+
let entrySubs = [];
|
|
75
|
+
const cleanupEntries = () => {
|
|
76
|
+
for (const unsub of entrySubs) unsub();
|
|
77
|
+
entrySubs = [];
|
|
78
|
+
};
|
|
79
|
+
const buildSnapshot = () => {
|
|
80
|
+
const snap = {};
|
|
81
|
+
for (const key of keysNode.cache ?? []) {
|
|
82
|
+
const nodes = factory(key);
|
|
83
|
+
const values = {};
|
|
84
|
+
for (const field of Object.keys(nodes)) {
|
|
85
|
+
values[field] = nodes[field].cache;
|
|
86
|
+
}
|
|
87
|
+
snap[key] = values;
|
|
88
|
+
}
|
|
89
|
+
return snap;
|
|
90
|
+
};
|
|
91
|
+
const sync = (nextKeys) => {
|
|
92
|
+
cleanupEntries();
|
|
93
|
+
for (const key of nextKeys) {
|
|
94
|
+
const nodes = factory(key);
|
|
95
|
+
for (const field of Object.keys(nodes)) {
|
|
96
|
+
const unsub = nodes[field].subscribe(() => {
|
|
97
|
+
setValue(() => buildSnapshot());
|
|
98
|
+
});
|
|
99
|
+
entrySubs.push(unsub);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
setValue(() => buildSnapshot());
|
|
103
|
+
};
|
|
104
|
+
const keysUnsub = keysNode.subscribe((msgs) => {
|
|
105
|
+
if (msgs.some((m) => m[0] === DATA || m[0] === RESOLVED)) {
|
|
106
|
+
sync(keysNode.cache ?? []);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
sync(keysNode.cache ?? []);
|
|
110
|
+
if ((0, import_solid_js.getOwner)()) {
|
|
111
|
+
(0, import_solid_js.onCleanup)(() => {
|
|
112
|
+
keysUnsub();
|
|
113
|
+
cleanupEntries();
|
|
114
|
+
});
|
|
115
|
+
} else if (typeof console !== "undefined") {
|
|
116
|
+
console.warn(
|
|
117
|
+
"[graphrefly-ts] useSubscribeRecord called outside a Solid reactive owner \u2014 subscription will not be auto-disposed."
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return value;
|
|
121
|
+
}
|
|
122
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
123
|
+
0 && (module.exports = {
|
|
124
|
+
useStore,
|
|
125
|
+
useSubscribe,
|
|
126
|
+
useSubscribeRecord
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/compat/solid/index.ts","../../../src/core/messages.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Solid bindings — useSubscribe / useStore\n// ---------------------------------------------------------------------------\n// Bridges GraphReFly nodes into Solid reactivity via createSignal.\n// Works with any Node<T>, including companion nodes (node.meta.status).\n//\n// Usage:\n// import { useSubscribe, useStore } from '@graphrefly/graphrefly-ts/compat/solid';\n// // Optional peer install (only for this adapter): pnpm add solid-js\n// const status = useSubscribe(wsStatusNode); // Accessor<string | undefined>\n// const [count, setCount] = useStore(countNode); // [Accessor<number | undefined>, Setter]\n// ---------------------------------------------------------------------------\n\nimport { createSignal, getOwner, onCleanup } from \"solid-js\";\nimport { DATA, DIRTY, type Messages, RESOLVED } from \"../../core/messages.js\";\nimport type { Node } from \"../../core/node.js\";\n\n/** Solid accessor function — returns current value when called. */\nexport type Accessor<T> = () => T;\n\n/**\n * Subscribe to a `Node<T>` as a Solid signal. Auto-cleans up with the owning scope.\n * Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).\n */\nexport function useSubscribe<T>(node: Node<T>): Accessor<T | undefined | null> {\n\tconst [value, setValue] = createSignal(node.cache, { equals: false });\n\n\tconst unsub = node.subscribe(() => {\n\t\tsetValue(() => node.cache);\n\t});\n\n\tif (getOwner()) {\n\t\tonCleanup(() => unsub());\n\t} else if (typeof console !== \"undefined\") {\n\t\tconsole.warn(\n\t\t\t\"[graphrefly-ts] useSubscribe called outside a Solid reactive owner — subscription will not be auto-disposed.\",\n\t\t);\n\t}\n\n\treturn value;\n}\n\n/**\n * Bind a writable `Node<T>` as a Solid resource tuple `[accessor, setter]`.\n * Setter always forwards `[[DIRTY], [DATA, value]]`, including `value === undefined`.\n * Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).\n */\nexport function useStore<T>(node: Node<T>): [Accessor<T | undefined | null>, (v: T) => void] {\n\tconst value = useSubscribe(node);\n\tconst setter = (v: T) => {\n\t\tnode.down([[DIRTY], [DATA, v]]);\n\t};\n\treturn [value, setter];\n}\n\n/** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */\nexport type NodeFactory<K, R extends Record<string, any>> = (key: K) => {\n\t[P in keyof R]: Node<R[P]>;\n};\n\n/**\n * Subscribe to a dynamic set of keyed node records as a Solid accessor.\n * Re-subscribes all per-key fields whenever `keys` changes.\n * Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.\n */\nexport function useSubscribeRecord<K extends string, R extends Record<string, any>>(\n\tkeysNode: Node<K[]>,\n\tfactory: NodeFactory<K, R>,\n): Accessor<Record<K, R>> {\n\tconst [value, setValue] = createSignal({} as Record<K, R>, { equals: false });\n\tlet entrySubs: Array<() => void> = [];\n\n\tconst cleanupEntries = () => {\n\t\tfor (const unsub of entrySubs) unsub();\n\t\tentrySubs = [];\n\t};\n\n\tconst buildSnapshot = (): Record<K, R> => {\n\t\tconst snap = {} as Record<K, R>;\n\t\tfor (const key of keysNode.cache ?? []) {\n\t\t\tconst nodes = factory(key);\n\t\t\tconst values = {} as R;\n\t\t\tfor (const field of Object.keys(nodes) as (keyof R)[]) {\n\t\t\t\tvalues[field] = nodes[field].cache as R[keyof R];\n\t\t\t}\n\t\t\tsnap[key] = values;\n\t\t}\n\t\treturn snap;\n\t};\n\n\tconst sync = (nextKeys: K[]) => {\n\t\tcleanupEntries();\n\t\tfor (const key of nextKeys) {\n\t\t\tconst nodes = factory(key);\n\t\t\tfor (const field of Object.keys(nodes) as (keyof R)[]) {\n\t\t\t\tconst unsub = nodes[field].subscribe(() => {\n\t\t\t\t\tsetValue(() => buildSnapshot());\n\t\t\t\t});\n\t\t\t\tentrySubs.push(unsub);\n\t\t\t}\n\t\t}\n\t\tsetValue(() => buildSnapshot());\n\t};\n\n\tconst keysUnsub = keysNode.subscribe((msgs: Messages) => {\n\t\tif (msgs.some((m) => m[0] === DATA || m[0] === RESOLVED)) {\n\t\t\tsync(keysNode.cache ?? []);\n\t\t}\n\t});\n\tsync(keysNode.cache ?? []);\n\n\tif (getOwner()) {\n\t\tonCleanup(() => {\n\t\t\tkeysUnsub();\n\t\t\tcleanupEntries();\n\t\t});\n\t} else if (typeof console !== \"undefined\") {\n\t\tconsole.warn(\n\t\t\t\"[graphrefly-ts] useSubscribeRecord called outside a Solid reactive owner — subscription will not be auto-disposed.\",\n\t\t);\n\t}\n\n\treturn value;\n}\n","/**\n * GraphReFly message protocol — §1 `~/src/graphrefly/GRAPHREFLY-SPEC.md`.\n * Emissions are always `[[Type, Data?], ...]` (no single-tuple shorthand).\n *\n * This file is protocol-pure:\n * - Message type symbols (10 built-ins).\n * - `Message` / `Messages` tuple types.\n * - `MessageTypeRegistration` interface (shape of a registry entry).\n *\n * It does NOT own the registry, tier lookups, or any cross-cutting singleton\n * state — that lives in `GraphReFlyConfig` (see `config.ts`) so custom\n * protocols can build isolated instances. Import this module when you need\n * the symbol constants or the tuple types; import `config.ts` when you need\n * tier / wire-crossing / registry lookups.\n */\n\n/** Subscribe-time handshake. Delivered to each new sink at the top of `subscribe()`. Tier 0. */\nexport const START = Symbol.for(\"graphrefly/START\");\n/** Value delivery (`DATA`, value). Tier 3 — deferred inside `batch()`. */\nexport const DATA = Symbol.for(\"graphrefly/DATA\");\n/** Phase 1: value about to change. Tier 1 — immediate. */\nexport const DIRTY = Symbol.for(\"graphrefly/DIRTY\");\n/** Phase 2: dirty pass completed, value unchanged. Tier 3 — deferred inside `batch()`. */\nexport const RESOLVED = Symbol.for(\"graphrefly/RESOLVED\");\n/** Clear cached state; do not auto-emit. Tier 1 — immediate. */\nexport const INVALIDATE = Symbol.for(\"graphrefly/INVALIDATE\");\n/** Suspend activity. Tier 2 — immediate. */\nexport const PAUSE = Symbol.for(\"graphrefly/PAUSE\");\n/** Resume after pause. Tier 2 — immediate. */\nexport const RESUME = Symbol.for(\"graphrefly/RESUME\");\n/** Permanent cleanup. Tier 5 — deferred to batch phase 4. */\nexport const TEARDOWN = Symbol.for(\"graphrefly/TEARDOWN\");\n/** Clean termination. Tier 4 — deferred to batch phase 3. */\nexport const COMPLETE = Symbol.for(\"graphrefly/COMPLETE\");\n/** Error termination. Tier 4 — deferred to batch phase 3. */\nexport const ERROR = Symbol.for(\"graphrefly/ERROR\");\n\n/** One protocol tuple: `[Type, optional payload]`. */\nexport type Message = readonly [symbol, unknown?];\n\n/** A batch of tuples — the wire shape for `node.down()` / `node.up()`. */\nexport type Messages = readonly Message[];\n\n// ---------------------------------------------------------------------------\n// Interned singletons for payload-free tuples\n// ---------------------------------------------------------------------------\n//\n// Every emission path used to allocate fresh `[[DIRTY]]`, `[[RESOLVED]]`,\n// etc. — two arrays per emit in the hot path. Since none of these tuples\n// carry a payload, one frozen instance is indistinguishable from a\n// fresh one. We intern them at module load and reuse forever. Only\n// `[DATA, v]`, `[ERROR, e]`, `[PAUSE, lockId]`, `[RESUME, lockId]` still\n// allocate per-call because they carry payloads.\n//\n// Downstream code MUST treat these as immutable. `Object.freeze` makes\n// accidental mutation throw in strict mode. Do not `push`, splice, or\n// otherwise mutate a Messages array that came from one of these.\n\n/** Singleton `[DIRTY]` tuple — payload-free, interned. */\nexport const DIRTY_MSG: Message = Object.freeze([DIRTY]) as Message;\n/** Singleton `[RESOLVED]` tuple — payload-free, interned. */\nexport const RESOLVED_MSG: Message = Object.freeze([RESOLVED]) as Message;\n/** Singleton `[INVALIDATE]` tuple — payload-free, interned. */\nexport const INVALIDATE_MSG: Message = Object.freeze([INVALIDATE]) as Message;\n/** Singleton `[START]` tuple — payload-free, interned. */\nexport const START_MSG: Message = Object.freeze([START]) as Message;\n/** Singleton `[COMPLETE]` tuple — payload-free, interned. */\nexport const COMPLETE_MSG: Message = Object.freeze([COMPLETE]) as Message;\n/** Singleton `[TEARDOWN]` tuple — payload-free, interned. */\nexport const TEARDOWN_MSG: Message = Object.freeze([TEARDOWN]) as Message;\n\n/** Pre-wrapped `[[DIRTY]]` for `_emit([DIRTY_ONLY_BATCH])`-style callers. */\nexport const DIRTY_ONLY_BATCH: Messages = Object.freeze([DIRTY_MSG]) as Messages;\n/** Pre-wrapped `[[RESOLVED]]`. */\nexport const RESOLVED_ONLY_BATCH: Messages = Object.freeze([RESOLVED_MSG]) as Messages;\n/** Pre-wrapped `[[INVALIDATE]]`. */\nexport const INVALIDATE_ONLY_BATCH: Messages = Object.freeze([INVALIDATE_MSG]) as Messages;\n/** Pre-wrapped `[[COMPLETE]]`. */\nexport const COMPLETE_ONLY_BATCH: Messages = Object.freeze([COMPLETE_MSG]) as Messages;\n/** Pre-wrapped `[[TEARDOWN]]`. */\nexport const TEARDOWN_ONLY_BATCH: Messages = Object.freeze([TEARDOWN_MSG]) as Messages;\n\n// ---------------------------------------------------------------------------\n// Registry entry shape\n// ---------------------------------------------------------------------------\n\n/**\n * Per-type record stored in a {@link GraphReFlyConfig}'s registry.\n *\n * - `tier` — signal tier (0–5 built-in; custom tiers allowed but should fit\n * the phase model used by `batch.ts`).\n * - `wireCrossing` — when `true`, forwarded across SSE/WebSocket/worker\n * adapters. Defaults to `tier >= 3` if omitted in registration input.\n * - `metaPassthrough` — when `false`, this message type is filtered out of\n * `Graph.signal` deliveries to meta companion nodes (spec §2.3). Meta\n * companions still receive everything via their primary's own cascade.\n * Defaults to `true` (meta receives the message).\n */\nexport interface MessageTypeRegistration {\n\ttier: number;\n\twireCrossing: boolean;\n\tmetaPassthrough: boolean;\n}\n\n/**\n * Input accepted by {@link GraphReFlyConfig.registerMessageType}. Only `tier`\n * is required; `wireCrossing` defaults to `tier >= 3`; `metaPassthrough`\n * defaults to `true`.\n */\nexport interface MessageTypeRegistrationInput {\n\ttier: number;\n\twireCrossing?: boolean;\n\tmetaPassthrough?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,sBAAkD;;;ACI3C,IAAM,QAAQ,uBAAO,IAAI,kBAAkB;AAE3C,IAAM,OAAO,uBAAO,IAAI,iBAAiB;AAEzC,IAAM,QAAQ,uBAAO,IAAI,kBAAkB;AAE3C,IAAM,WAAW,uBAAO,IAAI,qBAAqB;AAEjD,IAAM,aAAa,uBAAO,IAAI,uBAAuB;AAMrD,IAAM,WAAW,uBAAO,IAAI,qBAAqB;AAEjD,IAAM,WAAW,uBAAO,IAAI,qBAAqB;AA0BjD,IAAM,YAAqB,OAAO,OAAO,CAAC,KAAK,CAAC;AAEhD,IAAM,eAAwB,OAAO,OAAO,CAAC,QAAQ,CAAC;AAEtD,IAAM,iBAA0B,OAAO,OAAO,CAAC,UAAU,CAAC;AAE1D,IAAM,YAAqB,OAAO,OAAO,CAAC,KAAK,CAAC;AAEhD,IAAM,eAAwB,OAAO,OAAO,CAAC,QAAQ,CAAC;AAEtD,IAAM,eAAwB,OAAO,OAAO,CAAC,QAAQ,CAAC;AAGtD,IAAM,mBAA6B,OAAO,OAAO,CAAC,SAAS,CAAC;AAE5D,IA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C9B;AACA,WAAK,GAAG,IAAI;AAAA,IACb;AACA,WAAO;AAAA,EACR;AAEA,QAAM,OAAO,CAAC,aAAkB;AAC/B,mBAAe;AACf,eAAW,OAAO,UAAU;AAC3B,YAAM,QAAQ,QAAQ,GAAG;AACzB,iBAAW,SAAS,OAAO,KAAK,KAAK,GAAkB;AACtD,cAAM,QAAQ,MAAM,KAAK,EAAE,UAAU,MAAM;AAC1C,mBAAS,MAAM,cAAc,CAAC;AAAA,QAC/B,CAAC;AACD,kBAAU,KAAK,KAAK;AAAA,MACrB;AAAA,IACD;AACA,aAAS,MAAM,cAAc,CAAC;AAAA,EAC/B;AAEA,QAAM,YAAY,SAAS,UAAU,CAAC,SAAmB;AACxD,QAAI,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,QAAQ,EAAE,CAAC,MAAM,QAAQ,GAAG;AACzD,WAAK,SAAS,SAAS,CAAC,CAAC;AAAA,IAC1B;AAAA,EACD,CAAC;AACD,OAAK,SAAS,SAAS,CAAC,CAAC;AAEzB,UAAI,0BAAS,GAAG;AACf,mCAAU,MAAM;AACf,gBAAU;AACV,qBAAe;AAAA,IAChB,CAAC;AAAA,EACF,WAAW,OAAO,YAAY,aAAa;AAC1C,YAAQ;AAAA,MACP;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/compat/svelte/index.ts
|
|
21
|
+
var svelte_exports = {};
|
|
22
|
+
__export(svelte_exports, {
|
|
23
|
+
useStore: () => useStore,
|
|
24
|
+
useSubscribe: () => useSubscribe,
|
|
25
|
+
useSubscribeRecord: () => useSubscribeRecord
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(svelte_exports);
|
|
28
|
+
|
|
29
|
+
// src/core/messages.ts
|
|
30
|
+
var START = /* @__PURE__ */ Symbol.for("graphrefly/START");
|
|
31
|
+
var DATA = /* @__PURE__ */ Symbol.for("graphrefly/DATA");
|
|
32
|
+
var DIRTY = /* @__PURE__ */ Symbol.for("graphrefly/DIRTY");
|
|
33
|
+
var RESOLVED = /* @__PURE__ */ Symbol.for("graphrefly/RESOLVED");
|
|
34
|
+
var INVALIDATE = /* @__PURE__ */ Symbol.for("graphrefly/INVALIDATE");
|
|
35
|
+
var TEARDOWN = /* @__PURE__ */ Symbol.for("graphrefly/TEARDOWN");
|
|
36
|
+
var COMPLETE = /* @__PURE__ */ Symbol.for("graphrefly/COMPLETE");
|
|
37
|
+
var DIRTY_MSG = Object.freeze([DIRTY]);
|
|
38
|
+
var RESOLVED_MSG = Object.freeze([RESOLVED]);
|
|
39
|
+
var INVALIDATE_MSG = Object.freeze([INVALIDATE]);
|
|
40
|
+
var START_MSG = Object.freeze([START]);
|
|
41
|
+
var COMPLETE_MSG = Object.freeze([COMPLETE]);
|
|
42
|
+
var TEARDOWN_MSG = Object.freeze([TEARDOWN]);
|
|
43
|
+
var DIRTY_ONLY_BATCH = Object.freeze([DIRTY_MSG]);
|
|
44
|
+
var RESOLVED_ONLY_BATCH = Object.freeze([RESOLVED_MSG]);
|
|
45
|
+
var INVALIDATE_ONLY_BATCH = Object.freeze([INVALIDATE_MSG]);
|
|
46
|
+
var COMPLETE_ONLY_BATCH = Object.freeze([COMPLETE_MSG]);
|
|
47
|
+
var TEARDOWN_ONLY_BATCH = Object.freeze([TEARDOWN_MSG]);
|
|
48
|
+
|
|
49
|
+
// src/compat/svelte/index.ts
|
|
50
|
+
function useSubscribe(node) {
|
|
51
|
+
return {
|
|
52
|
+
subscribe(run) {
|
|
53
|
+
const unsub = node.subscribe(() => {
|
|
54
|
+
run(node.cache);
|
|
55
|
+
});
|
|
56
|
+
run(node.cache);
|
|
57
|
+
return unsub;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function useStore(node) {
|
|
62
|
+
return {
|
|
63
|
+
subscribe(run) {
|
|
64
|
+
const unsub = node.subscribe(() => {
|
|
65
|
+
run(node.cache);
|
|
66
|
+
});
|
|
67
|
+
run(node.cache);
|
|
68
|
+
return unsub;
|
|
69
|
+
},
|
|
70
|
+
set(value) {
|
|
71
|
+
node.down([[DIRTY], [DATA, value]]);
|
|
72
|
+
},
|
|
73
|
+
update(updater) {
|
|
74
|
+
const next = updater(node.cache);
|
|
75
|
+
node.down([[DIRTY], [DATA, next]]);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function useSubscribeRecord(keysNode, factory) {
|
|
80
|
+
return {
|
|
81
|
+
subscribe(run) {
|
|
82
|
+
let entrySubs = [];
|
|
83
|
+
const cleanupEntries = () => {
|
|
84
|
+
for (const unsub of entrySubs) unsub();
|
|
85
|
+
entrySubs = [];
|
|
86
|
+
};
|
|
87
|
+
const buildSnapshot = () => {
|
|
88
|
+
const snap = {};
|
|
89
|
+
for (const key of keysNode.cache ?? []) {
|
|
90
|
+
const nodes = factory(key);
|
|
91
|
+
const values = {};
|
|
92
|
+
for (const field of Object.keys(nodes)) {
|
|
93
|
+
values[field] = nodes[field].cache;
|
|
94
|
+
}
|
|
95
|
+
snap[key] = values;
|
|
96
|
+
}
|
|
97
|
+
return snap;
|
|
98
|
+
};
|
|
99
|
+
const sync = (nextKeys) => {
|
|
100
|
+
cleanupEntries();
|
|
101
|
+
for (const key of nextKeys) {
|
|
102
|
+
const nodes = factory(key);
|
|
103
|
+
for (const field of Object.keys(nodes)) {
|
|
104
|
+
const unsub = nodes[field].subscribe(() => {
|
|
105
|
+
run(buildSnapshot());
|
|
106
|
+
});
|
|
107
|
+
entrySubs.push(unsub);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
run(buildSnapshot());
|
|
111
|
+
};
|
|
112
|
+
const keysUnsub = keysNode.subscribe((msgs) => {
|
|
113
|
+
if (msgs.some((m) => m[0] === DATA || m[0] === RESOLVED)) {
|
|
114
|
+
sync(keysNode.cache ?? []);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
sync(keysNode.cache ?? []);
|
|
118
|
+
return () => {
|
|
119
|
+
keysUnsub();
|
|
120
|
+
cleanupEntries();
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
126
|
+
0 && (module.exports = {
|
|
127
|
+
useStore,
|
|
128
|
+
useSubscribe,
|
|
129
|
+
useSubscribeRecord
|
|
130
|
+
});
|
|
131
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/compat/svelte/index.ts","../../../src/core/messages.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Svelte bindings — useSubscribe / useStore\n// ---------------------------------------------------------------------------\n// Bridges GraphReFly nodes into Svelte's store contract. Works with any\n// Node<T>, including companion nodes (node.meta.status).\n//\n// Usage:\n// import { useSubscribe, useStore } from '@graphrefly/graphrefly-ts/compat/svelte';\n// // Optional peer install (only for this adapter): pnpm add svelte\n// const status = useSubscribe(wsStatusNode); // Svelte readable store\n// const count = useStore(countNode); // Svelte writable store\n// // In template: $status, $count\n// // $count = 42\n// ---------------------------------------------------------------------------\n\nimport { DATA, DIRTY, type Messages, RESOLVED } from \"../../core/messages.js\";\nimport type { Node } from \"../../core/node.js\";\n\n/** Svelte store contract — implements the minimal `subscribe` method. */\nexport interface SvelteReadable<T> {\n\tsubscribe(run: (value: T) => void): () => void;\n}\n\n/** Svelte writable store contract. */\nexport interface SvelteWritable<T> extends SvelteReadable<T> {\n\tset(value: T): void;\n\tupdate(updater: (value: T) => T): void;\n}\n\n/**\n * Subscribe to a `Node<T>` as a Svelte readable store (implements Svelte store contract).\n * Subscription lifecycle is tied to Svelte store unsubscription (not node terminal messages).\n */\nexport function useSubscribe<T>(node: Node<T>): SvelteReadable<T | undefined | null> {\n\treturn {\n\t\tsubscribe(run: (value: T | undefined | null) => void): () => void {\n\t\t\tconst unsub = node.subscribe(() => {\n\t\t\t\trun(node.cache);\n\t\t\t});\n\t\t\trun(node.cache);\n\t\t\treturn unsub;\n\t\t},\n\t};\n}\n\n/**\n * Bind a writable `Node<T>` as a Svelte writable store.\n * Reads and writes adapt seamlessly.\n * Setter/update always forward `[[DIRTY], [DATA, value]]`, including `value === undefined`.\n * Subscription lifecycle is tied to Svelte store unsubscription (not node terminal messages).\n */\nexport function useStore<T>(node: Node<T>): SvelteWritable<T | undefined | null> {\n\treturn {\n\t\tsubscribe(run: (value: T | undefined | null) => void): () => void {\n\t\t\tconst unsub = node.subscribe(() => {\n\t\t\t\trun(node.cache);\n\t\t\t});\n\t\t\trun(node.cache);\n\t\t\treturn unsub;\n\t\t},\n\t\tset(value: T | undefined | null) {\n\t\t\tnode.down([[DIRTY], [DATA, value]]);\n\t\t},\n\t\tupdate(updater: (value: T | undefined | null) => T | undefined | null) {\n\t\t\tconst next = updater(node.cache);\n\t\t\tnode.down([[DIRTY], [DATA, next]]);\n\t\t},\n\t};\n}\n\n/** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */\nexport type NodeFactory<K, R extends Record<string, any>> = (key: K) => {\n\t[P in keyof R]: Node<R[P]>;\n};\n\n/**\n * Subscribe to a dynamic keyed record of nodes as a Svelte readable store.\n * Re-subscribes all per-key fields whenever `keysNode` changes.\n * Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.\n */\nexport function useSubscribeRecord<K extends string, R extends Record<string, any>>(\n\tkeysNode: Node<K[]>,\n\tfactory: NodeFactory<K, R>,\n): SvelteReadable<Record<K, R>> {\n\treturn {\n\t\tsubscribe(run: (value: Record<K, R>) => void): () => void {\n\t\t\tlet entrySubs: Array<() => void> = [];\n\n\t\t\tconst cleanupEntries = () => {\n\t\t\t\tfor (const unsub of entrySubs) unsub();\n\t\t\t\tentrySubs = [];\n\t\t\t};\n\n\t\t\tconst buildSnapshot = (): Record<K, R> => {\n\t\t\t\tconst snap = {} as Record<K, R>;\n\t\t\t\tfor (const key of keysNode.cache ?? []) {\n\t\t\t\t\tconst nodes = factory(key);\n\t\t\t\t\tconst values = {} as R;\n\t\t\t\t\tfor (const field of Object.keys(nodes) as (keyof R)[]) {\n\t\t\t\t\t\tvalues[field] = nodes[field].cache as R[keyof R];\n\t\t\t\t\t}\n\t\t\t\t\tsnap[key] = values;\n\t\t\t\t}\n\t\t\t\treturn snap;\n\t\t\t};\n\n\t\t\tconst sync = (nextKeys: K[]) => {\n\t\t\t\tcleanupEntries();\n\t\t\t\tfor (const key of nextKeys) {\n\t\t\t\t\tconst nodes = factory(key);\n\t\t\t\t\tfor (const field of Object.keys(nodes) as (keyof R)[]) {\n\t\t\t\t\t\tconst unsub = nodes[field].subscribe(() => {\n\t\t\t\t\t\t\trun(buildSnapshot());\n\t\t\t\t\t\t});\n\t\t\t\t\t\tentrySubs.push(unsub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trun(buildSnapshot());\n\t\t\t};\n\n\t\t\tconst keysUnsub = keysNode.subscribe((msgs: Messages) => {\n\t\t\t\tif (msgs.some((m) => m[0] === DATA || m[0] === RESOLVED)) {\n\t\t\t\t\tsync(keysNode.cache ?? []);\n\t\t\t\t}\n\t\t\t});\n\t\t\tsync(keysNode.cache ?? []);\n\n\t\t\treturn () => {\n\t\t\t\tkeysUnsub();\n\t\t\t\tcleanupEntries();\n\t\t\t};\n\t\t},\n\t};\n}\n","/**\n * GraphReFly message protocol — §1 `~/src/graphrefly/GRAPHREFLY-SPEC.md`.\n * Emissions are always `[[Type, Data?], ...]` (no single-tuple shorthand).\n *\n * This file is protocol-pure:\n * - Message type symbols (10 built-ins).\n * - `Message` / `Messages` tuple types.\n * - `MessageTypeRegistration` interface (shape of a registry entry).\n *\n * It does NOT own the registry, tier lookups, or any cross-cutting singleton\n * state — that lives in `GraphReFlyConfig` (see `config.ts`) so custom\n * protocols can build isolated instances. Import this module when you need\n * the symbol constants or the tuple types; import `config.ts` when you need\n * tier / wire-crossing / registry lookups.\n */\n\n/** Subscribe-time handshake. Delivered to each new sink at the top of `subscribe()`. Tier 0. */\nexport const START = Symbol.for(\"graphrefly/START\");\n/** Value delivery (`DATA`, value). Tier 3 — deferred inside `batch()`. */\nexport const DATA = Symbol.for(\"graphrefly/DATA\");\n/** Phase 1: value about to change. Tier 1 — immediate. */\nexport const DIRTY = Symbol.for(\"graphrefly/DIRTY\");\n/** Phase 2: dirty pass completed, value unchanged. Tier 3 — deferred inside `batch()`. */\nexport const RESOLVED = Symbol.for(\"graphrefly/RESOLVED\");\n/** Clear cached state; do not auto-emit. Tier 1 — immediate. */\nexport const INVALIDATE = Symbol.for(\"graphrefly/INVALIDATE\");\n/** Suspend activity. Tier 2 — immediate. */\nexport const PAUSE = Symbol.for(\"graphrefly/PAUSE\");\n/** Resume after pause. Tier 2 — immediate. */\nexport const RESUME = Symbol.for(\"graphrefly/RESUME\");\n/** Permanent cleanup. Tier 5 — deferred to batch phase 4. */\nexport const TEARDOWN = Symbol.for(\"graphrefly/TEARDOWN\");\n/** Clean termination. Tier 4 — deferred to batch phase 3. */\nexport const COMPLETE = Symbol.for(\"graphrefly/COMPLETE\");\n/** Error termination. Tier 4 — deferred to batch phase 3. */\nexport const ERROR = Symbol.for(\"graphrefly/ERROR\");\n\n/** One protocol tuple: `[Type, optional payload]`. */\nexport type Message = readonly [symbol, unknown?];\n\n/** A batch of tuples — the wire shape for `node.down()` / `node.up()`. */\nexport type Messages = readonly Message[];\n\n// ---------------------------------------------------------------------------\n// Interned singletons for payload-free tuples\n// ---------------------------------------------------------------------------\n//\n// Every emission path used to allocate fresh `[[DIRTY]]`, `[[RESOLVED]]`,\n// etc. — two arrays per emit in the hot path. Since none of these tuples\n// carry a payload, one frozen instance is indistinguishable from a\n// fresh one. We intern them at module load and reuse forever. Only\n// `[DATA, v]`, `[ERROR, e]`, `[PAUSE, lockId]`, `[RESUME, lockId]` still\n// allocate per-call because they carry payloads.\n//\n// Downstream code MUST treat these as immutable. `Object.freeze` makes\n// accidental mutation throw in strict mode. Do not `push`, splice, or\n// otherwise mutate a Messages array that came from one of these.\n\n/** Singleton `[DIRTY]` tuple — payload-free, interned. */\nexport const DIRTY_MSG: Message = Object.freeze([DIRTY]) as Message;\n/** Singleton `[RESOLVED]` tuple — payload-free, interned. */\nexport const RESOLVED_MSG: Message = Object.freeze([RESOLVED]) as Message;\n/** Singleton `[INVALIDATE]` tuple — payload-free, interned. */\nexport const INVALIDATE_MSG: Message = Object.freeze([INVALIDATE]) as Message;\n/** Singleton `[START]` tuple — payload-free, interned. */\nexport const START_MSG: Message = Object.freeze([START]) as Message;\n/** Singleton `[COMPLETE]` tuple — payload-free, interned. */\nexport const COMPLETE_MSG: Message = Object.freeze([COMPLETE]) as Message;\n/** Singleton `[TEARDOWN]` tuple — payload-free, interned. */\nexport const TEARDOWN_MSG: Message = Object.freeze([TEARDOWN]) as Message;\n\n/** Pre-wrapped `[[DIRTY]]` for `_emit([DIRTY_ONLY_BATCH])`-style callers. */\nexport const DIRTY_ONLY_BATCH: Messages = Object.freeze([DIRTY_MSG]) as Messages;\n/** Pre-wrapped `[[RESOLVED]]`. */\nexport const RESOLVED_ONLY_BATCH: Messages = Object.freeze([RESOLVED_MSG]) as Messages;\n/** Pre-wrapped `[[INVALIDATE]]`. */\nexport const INVALIDATE_ONLY_BATCH: Messages = Object.freeze([INVALIDATE_MSG]) as Messages;\n/** Pre-wrapped `[[COMPLETE]]`. */\nexport const COMPLETE_ONLY_BATCH: Messages = Object.freeze([COMPLETE_MSG]) as Messages;\n/** Pre-wrapped `[[TEARDOWN]]`. */\nexport const TEARDOWN_ONLY_BATCH: Messages = Object.freeze([TEARDOWN_MSG]) as Messages;\n\n// ---------------------------------------------------------------------------\n// Registry entry shape\n// ---------------------------------------------------------------------------\n\n/**\n * Per-type record stored in a {@link GraphReFlyConfig}'s registry.\n *\n * - `tier` — signal tier (0–5 built-in; custom tiers allowed but should fit\n * the phase model used by `batch.ts`).\n * - `wireCrossing` — when `true`, forwarded across SSE/WebSocket/worker\n * adapters. Defaults to `tier >= 3` if omitted in registration input.\n * - `metaPassthrough` — when `false`, this message type is filtered out of\n * `Graph.signal` deliveries to meta companion nodes (spec §2.3). Meta\n * companions still receive everything via their primary's own cascade.\n * Defaults to `true` (meta receives the message).\n */\nexport interface MessageTypeRegistration {\n\ttier: number;\n\twireCrossing: boolean;\n\tmetaPassthrough: boolean;\n}\n\n/**\n * Input accepted by {@link GraphReFlyConfig.registerMessageType}. Only `tier`\n * is required; `wireCrossing` defaults to `tier >= 3`; `metaPassthrough`\n * defaults to `true`.\n */\nexport interface MessageTypeRegistrationInput {\n\ttier: number;\n\twireCrossing?: boolean;\n\tmetaPassthrough?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,IAAM,QAAQ,uBAAO,IAAI,kBAAkB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