@graphrefly/ts 0.0.0 → 0.0.1
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 +135 -0
- package/dist/adapters/index.cjs +105 -66
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +11 -136
- package/dist/adapters/index.d.ts +11 -136
- package/dist/adapters/index.js +27 -225
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/observe-storage.d.cts +4 -4
- package/dist/adapters/observe-storage.d.ts +4 -4
- package/dist/adapters/observe-storage.js +1 -0
- package/dist/adapters/observe-storage.js.map +1 -1
- package/dist/adapters/react.cjs +166 -0
- package/dist/adapters/react.cjs.map +1 -0
- package/dist/adapters/react.d.cts +31 -0
- package/dist/adapters/react.d.ts +31 -0
- package/dist/adapters/react.js +51 -0
- package/dist/adapters/react.js.map +1 -0
- package/dist/adapters/solid.cjs +157 -0
- package/dist/adapters/solid.cjs.map +1 -0
- package/dist/adapters/solid.d.cts +26 -0
- package/dist/adapters/solid.d.ts +26 -0
- package/dist/adapters/solid.js +48 -0
- package/dist/adapters/solid.js.map +1 -0
- package/dist/adapters/svelte.cjs +148 -0
- package/dist/adapters/svelte.cjs.map +1 -0
- package/dist/adapters/svelte.d.cts +31 -0
- package/dist/adapters/svelte.d.ts +31 -0
- package/dist/adapters/svelte.js +46 -0
- package/dist/adapters/svelte.js.map +1 -0
- package/dist/adapters/vue.cjs +155 -0
- package/dist/adapters/vue.cjs.map +1 -0
- package/dist/adapters/vue.d.cts +26 -0
- package/dist/adapters/vue.d.ts +26 -0
- package/dist/adapters/vue.js +46 -0
- package/dist/adapters/vue.js.map +1 -0
- package/dist/agent-runtime-BesGDZcB.d.ts +555 -0
- package/dist/agent-runtime-DZTJ3C-p.d.cts +555 -0
- package/dist/agentic-memory-BmRCvh0d.d.ts +517 -0
- package/dist/agentic-memory-DfuVZ-lY.d.cts +517 -0
- package/dist/capability-admission-B0BzqAm5.d.cts +102 -0
- package/dist/capability-admission-g0mn9hpq.d.ts +102 -0
- package/dist/{chunk-JR4IKCR2.js → chunk-2747WN4Y.js} +5 -5
- package/dist/{chunk-2ILL7HQI.js → chunk-3JR3EDB2.js} +17 -17
- package/dist/{chunk-2ILL7HQI.js.map → chunk-3JR3EDB2.js.map} +1 -1
- package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
- package/dist/{chunk-DJC4CHLQ.js → chunk-43BKLFZU.js} +9 -9
- package/dist/chunk-6XAIOL3X.js +2407 -0
- package/dist/chunk-6XAIOL3X.js.map +1 -0
- package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
- package/dist/{chunk-Y3ZLRGHC.js → chunk-CZNV3VXM.js} +16 -16
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/{chunk-JIMUDQN3.js → chunk-FBUU43PM.js} +2 -2
- package/dist/chunk-H75VXTGT.js +219 -0
- package/dist/chunk-H75VXTGT.js.map +1 -0
- package/dist/{chunk-RIIOUTGM.js → chunk-HKK2JD7Z.js} +12 -9
- package/dist/chunk-HKK2JD7Z.js.map +1 -0
- package/dist/{chunk-D6BG7U6A.js → chunk-IXZBUWSP.js} +3 -3
- package/dist/chunk-PC3BTTBE.js +3217 -0
- package/dist/chunk-PC3BTTBE.js.map +1 -0
- package/dist/chunk-QFY4AFY4.js +879 -0
- package/dist/chunk-QFY4AFY4.js.map +1 -0
- package/dist/{chunk-DK554R7P.js → chunk-S6HXABGL.js} +2 -1
- package/dist/chunk-S6HXABGL.js.map +1 -0
- package/dist/{chunk-PKVBHGBM.js → chunk-SS2A464I.js} +7 -7
- package/dist/chunk-UT3MHJCW.js +49 -0
- package/dist/chunk-UT3MHJCW.js.map +1 -0
- package/dist/{chunk-G4M3NHRJ.js → chunk-V7CIJE4B.js} +3 -3
- package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
- package/dist/chunk-VTHLCFN4.js +368 -0
- package/dist/chunk-VTHLCFN4.js.map +1 -0
- package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
- package/dist/chunk-WQIA3GFB.js.map +1 -0
- package/dist/{chunk-I3IHOHCJ.js → chunk-XKXWK2KP.js} +108 -64
- package/dist/chunk-XKXWK2KP.js.map +1 -0
- package/dist/{chunk-COHO25CZ.js → chunk-YDSIVHRR.js} +553 -7
- package/dist/chunk-YDSIVHRR.js.map +1 -0
- package/dist/chunk-YXMZ2N6J.js +1884 -0
- package/dist/chunk-YXMZ2N6J.js.map +1 -0
- package/dist/composition/index.cjs +102 -57
- package/dist/composition/index.cjs.map +1 -1
- package/dist/composition/index.d.cts +4 -4
- package/dist/composition/index.d.ts +4 -4
- package/dist/composition/index.js +6 -5
- package/dist/core/index.cjs +102 -57
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +5 -4
- package/dist/cqrs/index.cjs.map +1 -1
- package/dist/cqrs/index.d.cts +4 -4
- package/dist/cqrs/index.d.ts +4 -4
- package/dist/cqrs/index.js +3 -2
- package/dist/cqrs/index.js.map +1 -1
- package/dist/cqrs/messaging.cjs +312 -0
- package/dist/cqrs/messaging.cjs.map +1 -0
- package/dist/cqrs/messaging.d.cts +57 -0
- package/dist/cqrs/messaging.d.ts +57 -0
- package/dist/cqrs/messaging.js +274 -0
- package/dist/cqrs/messaging.js.map +1 -0
- package/dist/cqrs/work-queue.cjs +329 -0
- package/dist/cqrs/work-queue.cjs.map +1 -0
- package/dist/cqrs/work-queue.d.cts +90 -0
- package/dist/cqrs/work-queue.d.ts +90 -0
- package/dist/cqrs/work-queue.js +292 -0
- package/dist/cqrs/work-queue.js.map +1 -0
- package/dist/data/index.cjs +19 -0
- package/dist/data/index.cjs.map +1 -0
- package/dist/data/index.d.cts +36 -0
- package/dist/data/index.d.ts +36 -0
- package/dist/data/index.js +1 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data-structures/index.cjs +105 -57
- package/dist/data-structures/index.cjs.map +1 -1
- package/dist/data-structures/index.d.cts +8 -8
- package/dist/data-structures/index.d.ts +8 -8
- package/dist/data-structures/index.js +7 -6
- package/dist/{describe-BZb7AS2y.d.ts → describe-BpyJuWkw.d.ts} +1 -1
- package/dist/{describe-Ciu8SUnN.d.cts → describe-DYMw_l1C.d.cts} +1 -1
- package/dist/executors/work-queue.cjs +342 -0
- package/dist/executors/work-queue.cjs.map +1 -0
- package/dist/executors/work-queue.d.cts +90 -0
- package/dist/executors/work-queue.d.ts +90 -0
- package/dist/executors/work-queue.js +306 -0
- package/dist/executors/work-queue.js.map +1 -0
- package/dist/graph/index.cjs +112 -58
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +9 -9
- package/dist/graph/index.d.ts +9 -9
- package/dist/graph/index.js +18 -17
- package/dist/{graph-DfdF9zy4.d.ts → graph-D-1-SQeC.d.ts} +3 -3
- package/dist/{graph-s23RbbFO.d.cts → graph-DCEWh4T2.d.cts} +3 -3
- package/dist/{index-CAEmLCYF.d.cts → index-72VZC0-E.d.cts} +2 -2
- package/dist/{index-SnzZu3x7.d.ts → index-Bmxeu0nK.d.ts} +2 -2
- package/dist/index.cjs +112 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +118 -113
- package/dist/inspection/boundary.cjs +98 -0
- package/dist/inspection/boundary.cjs.map +1 -0
- package/dist/inspection/boundary.d.cts +61 -0
- package/dist/inspection/boundary.d.ts +61 -0
- package/dist/inspection/boundary.js +75 -0
- package/dist/inspection/boundary.js.map +1 -0
- package/dist/{messages-BZqrGGm1.d.ts → messages-CAzUPPJM.d.cts} +10 -5
- package/dist/{messages-BZqrGGm1.d.cts → messages-CAzUPPJM.d.ts} +10 -5
- package/dist/messaging/index.cjs +744 -613
- package/dist/messaging/index.cjs.map +1 -1
- package/dist/messaging/index.d.cts +216 -160
- package/dist/messaging/index.d.ts +216 -160
- package/dist/messaging/index.js +19 -749
- package/dist/messaging/index.js.map +1 -1
- package/dist/operators/index.cjs +102 -57
- package/dist/operators/index.cjs.map +1 -1
- package/dist/operators/index.d.cts +6 -6
- package/dist/operators/index.d.ts +6 -6
- package/dist/operators/index.js +8 -7
- package/dist/orchestration/index.cjs +3333 -59
- package/dist/orchestration/index.cjs.map +1 -1
- package/dist/orchestration/index.d.cts +7 -4
- package/dist/orchestration/index.d.ts +7 -4
- package/dist/orchestration/index.js +49 -8
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/messaging.cjs +314 -0
- package/dist/orchestration/messaging.cjs.map +1 -0
- package/dist/orchestration/messaging.d.cts +59 -0
- package/dist/orchestration/messaging.d.ts +59 -0
- package/dist/orchestration/messaging.js +276 -0
- package/dist/orchestration/messaging.js.map +1 -0
- package/dist/orchestration/work-queue.cjs +262 -0
- package/dist/orchestration/work-queue.cjs.map +1 -0
- package/dist/orchestration/work-queue.d.cts +85 -0
- package/dist/orchestration/work-queue.d.ts +85 -0
- package/dist/orchestration/work-queue.js +226 -0
- package/dist/orchestration/work-queue.js.map +1 -0
- package/dist/patterns/event-flow.cjs +447 -0
- package/dist/patterns/event-flow.cjs.map +1 -0
- package/dist/patterns/event-flow.d.cts +115 -0
- package/dist/patterns/event-flow.d.ts +115 -0
- package/dist/patterns/event-flow.js +14 -0
- package/dist/patterns/event-flow.js.map +1 -0
- package/dist/patterns/index.cjs +423 -18
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +8 -5
- package/dist/patterns/index.d.ts +8 -5
- package/dist/patterns/index.js +13 -4
- package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BAmfrGjd.d.ts} +9 -9
- package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-DNV0-gFi.d.cts} +9 -9
- package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BNEldDyi.d.cts} +5 -5
- package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-YZsAQsWK.d.ts} +5 -5
- package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-DRD1LJ2H.d.cts} +6 -6
- package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-EsDiCmJk.d.ts} +6 -6
- package/dist/render/index.d.cts +3 -3
- package/dist/render/index.d.ts +3 -3
- package/dist/render/index.js +1 -0
- package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-DKuNzuWw.d.cts} +2 -2
- package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-uwbwJdhe.d.ts} +2 -2
- package/dist/solutions/index.cjs +4478 -2
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +13 -519
- package/dist/solutions/index.d.ts +13 -519
- package/dist/solutions/index.js +90 -6
- package/dist/solutions/reactive-layout/browser/index.cjs +449 -0
- package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/browser/index.d.cts +44 -0
- package/dist/solutions/reactive-layout/browser/index.d.ts +44 -0
- package/dist/solutions/reactive-layout/browser/index.js +69 -0
- package/dist/solutions/reactive-layout/browser/index.js.map +1 -0
- package/dist/solutions/reactive-layout/index.cjs +4266 -0
- package/dist/solutions/reactive-layout/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/index.d.cts +581 -0
- package/dist/solutions/reactive-layout/index.d.ts +581 -0
- package/dist/solutions/reactive-layout/index.js +86 -0
- package/dist/solutions/reactive-layout/index.js.map +1 -0
- package/dist/solutions/reactive-layout/node-canvas/index.cjs +545 -0
- package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/node-canvas/index.d.cts +54 -0
- package/dist/solutions/reactive-layout/node-canvas/index.d.ts +54 -0
- package/dist/solutions/reactive-layout/node-canvas/index.js +131 -0
- package/dist/solutions/reactive-layout/node-canvas/index.js.map +1 -0
- package/dist/solutions/reactive-layout/react-native/index.cjs +494 -0
- package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/react-native/index.d.cts +51 -0
- package/dist/solutions/reactive-layout/react-native/index.d.ts +51 -0
- package/dist/solutions/reactive-layout/react-native/index.js +77 -0
- package/dist/solutions/reactive-layout/react-native/index.js.map +1 -0
- package/dist/solutions/reactive-layout/skia/index.cjs +547 -0
- package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/skia/index.d.cts +64 -0
- package/dist/solutions/reactive-layout/skia/index.d.ts +64 -0
- package/dist/solutions/reactive-layout/skia/index.js +70 -0
- package/dist/solutions/reactive-layout/skia/index.js.map +1 -0
- package/dist/solutions/work-item/actions.cjs +2164 -0
- package/dist/solutions/work-item/actions.cjs.map +1 -0
- package/dist/solutions/work-item/actions.d.cts +201 -0
- package/dist/solutions/work-item/actions.d.ts +201 -0
- package/dist/solutions/work-item/actions.js +1454 -0
- package/dist/solutions/work-item/actions.js.map +1 -0
- package/dist/solutions/work-item/scheduling.cjs +2454 -0
- package/dist/solutions/work-item/scheduling.cjs.map +1 -0
- package/dist/solutions/work-item/scheduling.d.cts +433 -0
- package/dist/solutions/work-item/scheduling.d.ts +433 -0
- package/dist/solutions/work-item/scheduling.js +32 -0
- package/dist/solutions/work-item/scheduling.js.map +1 -0
- package/dist/solutions/work-item/work-queue.cjs +306 -0
- package/dist/solutions/work-item/work-queue.cjs.map +1 -0
- package/dist/solutions/work-item/work-queue.d.cts +71 -0
- package/dist/solutions/work-item/work-queue.d.ts +71 -0
- package/dist/solutions/work-item/work-queue.js +270 -0
- package/dist/solutions/work-item/work-queue.js.map +1 -0
- package/dist/sources/browser.cjs +169 -57
- package/dist/sources/browser.cjs.map +1 -1
- package/dist/sources/browser.d.cts +33 -6
- package/dist/sources/browser.d.ts +33 -6
- package/dist/sources/browser.js +73 -6
- package/dist/sources/browser.js.map +1 -1
- package/dist/sources/index.cjs +102 -57
- package/dist/sources/index.cjs.map +1 -1
- package/dist/sources/index.d.cts +5 -5
- package/dist/sources/index.d.ts +5 -5
- package/dist/sources/index.js +6 -5
- package/dist/sources/node.cjs.map +1 -1
- package/dist/sources/node.d.cts +4 -4
- package/dist/sources/node.d.ts +4 -4
- package/dist/sources/node.js +2 -1
- package/dist/sources/node.js.map +1 -1
- package/dist/storage/browser.js +1 -0
- package/dist/storage/browser.js.map +1 -1
- package/dist/storage/index.d.cts +5 -5
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/index.js +5 -4
- package/dist/storage/node.js +1 -0
- package/dist/storage/node.js.map +1 -1
- package/dist/store-C-joM4gh.d.ts +123 -0
- package/dist/store-CNJwmT-h.d.cts +123 -0
- package/dist/testing/index.cjs +1 -0
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3 -2
- package/dist/{types-h12mNYbq.d.ts → types-BsJvElYZ.d.ts} +31 -31
- package/dist/{types-bNMSWKqF.d.cts → types-CcPIn7sy.d.cts} +31 -31
- package/dist/work-item-runtime-C3M79vE9.d.ts +228 -0
- package/dist/work-item-runtime-qaVgsL0T.d.cts +228 -0
- package/dist/work-queue/index.cjs +1132 -0
- package/dist/work-queue/index.cjs.map +1 -0
- package/dist/work-queue/index.d.cts +369 -0
- package/dist/work-queue/index.d.ts +369 -0
- package/dist/work-queue/index.js +1078 -0
- package/dist/work-queue/index.js.map +1 -0
- package/package.json +266 -2
- package/dist/chunk-COHO25CZ.js.map +0 -1
- package/dist/chunk-DK554R7P.js.map +0 -1
- package/dist/chunk-I3IHOHCJ.js.map +0 -1
- package/dist/chunk-RIIOUTGM.js.map +0 -1
- package/dist/chunk-SWTLEQL6.js.map +0 -1
- /package/dist/{chunk-JR4IKCR2.js.map → chunk-2747WN4Y.js.map} +0 -0
- /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
- /package/dist/{chunk-DJC4CHLQ.js.map → chunk-43BKLFZU.js.map} +0 -0
- /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
- /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-CZNV3VXM.js.map} +0 -0
- /package/dist/{chunk-JIMUDQN3.js.map → chunk-FBUU43PM.js.map} +0 -0
- /package/dist/{chunk-D6BG7U6A.js.map → chunk-IXZBUWSP.js.map} +0 -0
- /package/dist/{chunk-PKVBHGBM.js.map → chunk-SS2A464I.js.map} +0 -0
- /package/dist/{chunk-G4M3NHRJ.js.map → chunk-V7CIJE4B.js.map} +0 -0
- /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
package/dist/sources/browser.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(browser_exports, {
|
|
|
33
33
|
fromIter: () => fromIter,
|
|
34
34
|
fromPromise: () => fromPromise,
|
|
35
35
|
fromPushNotification: () => fromPushNotification,
|
|
36
|
+
fromRaf: () => fromRaf,
|
|
36
37
|
fromSSE: () => fromSSE,
|
|
37
38
|
fromSSEWithOptions: () => fromSSEWithOptions,
|
|
38
39
|
fromTimer: () => fromTimer,
|
|
@@ -70,6 +71,7 @@ var TIER = {
|
|
|
70
71
|
START: TIER_START,
|
|
71
72
|
PAUSE: TIER_CONTROL,
|
|
72
73
|
RESUME: TIER_CONTROL,
|
|
74
|
+
PULL: TIER_CONTROL,
|
|
73
75
|
DIRTY: TIER_NOTIFICATION,
|
|
74
76
|
DATA: TIER_VALUE,
|
|
75
77
|
RESOLVED: TIER_VALUE,
|
|
@@ -912,6 +914,17 @@ function notifyTopologyDepsChanged(node, prevDeps, deps) {
|
|
|
912
914
|
function terminalView(t) {
|
|
913
915
|
return t === void 0 ? false : t;
|
|
914
916
|
}
|
|
917
|
+
function normalizePullDemand(demand) {
|
|
918
|
+
if (typeof demand !== "object" || demand === null || Array.isArray(demand)) {
|
|
919
|
+
throw new Error("ctx.up: PULL requires { pullId, params? } demand payload (D269)");
|
|
920
|
+
}
|
|
921
|
+
const pullId = demand.pullId;
|
|
922
|
+
if (typeof pullId !== "string" && typeof pullId !== "symbol") {
|
|
923
|
+
throw new Error("ctx.up: PULL demand requires a string or symbol pullId (D269)");
|
|
924
|
+
}
|
|
925
|
+
const params = demand.params;
|
|
926
|
+
return params === void 0 ? { pullId } : { pullId, params };
|
|
927
|
+
}
|
|
915
928
|
function validateDownPayloads(msgs) {
|
|
916
929
|
for (const m of msgs) {
|
|
917
930
|
if (m[0] === "DATA" && m[1] === void 0) {
|
|
@@ -955,7 +968,7 @@ var Node = class {
|
|
|
955
968
|
const pull = opts.pullId !== void 0;
|
|
956
969
|
if (pull && pausable === false)
|
|
957
970
|
throw new Error(
|
|
958
|
-
"node: pullId is incompatible with pausable:false \u2014 a pull node
|
|
971
|
+
"node: pullId is incompatible with pausable:false \u2014 a pull node uses the pausable delivery-content axis (R-pull / R-pause-modes / D55,D269)"
|
|
959
972
|
);
|
|
960
973
|
let handle;
|
|
961
974
|
if (handleOrFn === null) handle = null;
|
|
@@ -978,7 +991,6 @@ var Node = class {
|
|
|
978
991
|
value.status = "settled";
|
|
979
992
|
}
|
|
980
993
|
const pauseLockset = /* @__PURE__ */ new Set();
|
|
981
|
-
if (pull) pauseLockset.add(pullLock);
|
|
982
994
|
this._core = core ?? new NodeCore();
|
|
983
995
|
const created = this._core.createSlot(
|
|
984
996
|
{
|
|
@@ -1019,7 +1031,9 @@ var Node = class {
|
|
|
1019
1031
|
pauseLockset,
|
|
1020
1032
|
pausedDepWaveOccurred: false,
|
|
1021
1033
|
pauseBuffer: [],
|
|
1022
|
-
demandOwed:
|
|
1034
|
+
demandOwed: void 0,
|
|
1035
|
+
activePull: void 0,
|
|
1036
|
+
pullDirtyOwed: false,
|
|
1023
1037
|
inDeliverDemand: false
|
|
1024
1038
|
},
|
|
1025
1039
|
privateState: { value: SENTINEL, persist: false },
|
|
@@ -1076,10 +1090,11 @@ var Node = class {
|
|
|
1076
1090
|
this._wave.batchDirtyOwed = false;
|
|
1077
1091
|
this._control.pauseBuffer = [];
|
|
1078
1092
|
this._control.pausedDepWaveOccurred = false;
|
|
1079
|
-
this._control.demandOwed =
|
|
1093
|
+
this._control.demandOwed = void 0;
|
|
1094
|
+
this._control.activePull = void 0;
|
|
1095
|
+
this._control.pullDirtyOwed = false;
|
|
1080
1096
|
this._control.inDeliverDemand = false;
|
|
1081
1097
|
this._control.pauseLockset.clear();
|
|
1082
|
-
if (this._slot.pull) this._control.pauseLockset.add(this._slot.pullLock);
|
|
1083
1098
|
this._privateState.value = state.ctxState.value;
|
|
1084
1099
|
this._privateState.persist = state.ctxState.persist;
|
|
1085
1100
|
if (state.version === false) {
|
|
@@ -1118,17 +1133,16 @@ var Node = class {
|
|
|
1118
1133
|
subscriberCountReaders.set(this, () => this._subscriberCount());
|
|
1119
1134
|
activationReaders.set(this, () => this._lifecycle.activated);
|
|
1120
1135
|
}
|
|
1121
|
-
/** R-pull (D55): true while a pull node is
|
|
1136
|
+
/** R-pull (D55/D272): true while a pull node is not serving a PULL demand pulse. */
|
|
1122
1137
|
_isPullQuiet() {
|
|
1123
|
-
return this._slot.pull && this._control.
|
|
1138
|
+
return this._slot.pull && this._control.activePull === void 0;
|
|
1124
1139
|
}
|
|
1125
1140
|
/**
|
|
1126
|
-
* R-pull (
|
|
1127
|
-
* triggers computation). A consumer demands one delivery by cone-routing
|
|
1128
|
-
* reference): `ctx.up([["
|
|
1129
|
-
* `ctx.upNext([["
|
|
1130
|
-
*
|
|
1131
|
-
* for inspection/describe; routing matches by the pullId value carried in the RESUME, by identity.
|
|
1141
|
+
* R-pull (D269/D272): this pull node's pullId (pure data, like {@link cache}/{@link handle} —
|
|
1142
|
+
* never triggers computation). A consumer demands one delivery by cone-routing PULL of it (no
|
|
1143
|
+
* node reference): `ctx.up([["PULL", { pullId }]])` (immediate; loops back → D37 for a self-read
|
|
1144
|
+
* dep) or `ctx.upNext([["PULL", { pullId }]])` (boundary-deferred self-demand). Undefined for a
|
|
1145
|
+
* non-pull node. The author writes the pullId verbatim; routing matches by identity.
|
|
1132
1146
|
*/
|
|
1133
1147
|
get pullId() {
|
|
1134
1148
|
return this._slot.pullLock;
|
|
@@ -1235,10 +1249,10 @@ var Node = class {
|
|
|
1235
1249
|
});
|
|
1236
1250
|
}
|
|
1237
1251
|
/**
|
|
1238
|
-
* Enqueue a deferred up-going control wave (R-up-routing / R-pull /
|
|
1252
|
+
* Enqueue a deferred up-going control/demand wave (R-up-routing / R-pull / D269): at the committed wave
|
|
1239
1253
|
* boundary, route `msgs` up from THIS node (broadcast, or up the single `towardDep` edge). The
|
|
1240
|
-
* deferred form of `ctx.up` — the SELF-demand path: a consumer issues `ctx.upNext([[
|
|
1241
|
-
* pullId]])` to demand a dep it ALSO reads; the demand applies at the boundary (not mid-fn), so
|
|
1254
|
+
* deferred form of `ctx.up` — the SELF-demand path: a consumer issues `ctx.upNext([[PULL,
|
|
1255
|
+
* { pullId }]])` to demand a dep it ALSO reads; the demand applies at the boundary (not mid-fn), so
|
|
1242
1256
|
* the pull node's delivery loops back as a FRESH wave rather than re-entering the consumer (D37 /
|
|
1243
1257
|
* R-reentrancy). Rides the same R-rewire-deferred (D47) drain as ctx.rewireNext.
|
|
1244
1258
|
*/
|
|
@@ -1453,7 +1467,6 @@ var Node = class {
|
|
|
1453
1467
|
this._lifecycle.activated = true;
|
|
1454
1468
|
const seedRestoredDeps = this._restoredActivationPending;
|
|
1455
1469
|
this._restoredActivationPending = false;
|
|
1456
|
-
if (this._slot.pull) this._control.pauseLockset.add(this._slot.pullLock);
|
|
1457
1470
|
this._dep.unsubs = new Array(this._slot.deps.length);
|
|
1458
1471
|
this._dep.idxBoxes = new Array(this._slot.deps.length);
|
|
1459
1472
|
for (const dep of this._slot.deps)
|
|
@@ -1525,7 +1538,9 @@ var Node = class {
|
|
|
1525
1538
|
this._control.pauseLockset.clear();
|
|
1526
1539
|
this._control.pauseBuffer = [];
|
|
1527
1540
|
this._control.pausedDepWaveOccurred = false;
|
|
1528
|
-
this._control.demandOwed =
|
|
1541
|
+
this._control.demandOwed = void 0;
|
|
1542
|
+
this._control.activePull = void 0;
|
|
1543
|
+
this._control.pullDirtyOwed = false;
|
|
1529
1544
|
this._value.replayRing = [];
|
|
1530
1545
|
if (!this._privateState.persist) this._privateState.value = SENTINEL;
|
|
1531
1546
|
}
|
|
@@ -1537,8 +1552,7 @@ var Node = class {
|
|
|
1537
1552
|
return this._lifecycle.subscribers.size;
|
|
1538
1553
|
}
|
|
1539
1554
|
_isRuntimeQuiescentForRelease() {
|
|
1540
|
-
|
|
1541
|
-
return !this._released && this._value.status !== "dirty" && this._value.status !== "pending" && this._wave.pending === 0 && !this._wave.insideRunWave && !this._wave.inDepMutation && !this._wave.rewireRunPending && !this._wave.batchDirtyOwed && this._dep.dirty.every((dirty) => !dirty) && this._control.pauseBuffer.length === 0 && !this._control.pausedDepWaveOccurred && !this._control.demandOwed && !this._control.inDeliverDemand && (this._control.pauseLockset.size === 0 || allowedPullQuietLock);
|
|
1555
|
+
return !this._released && this._value.status !== "dirty" && this._value.status !== "pending" && this._wave.pending === 0 && !this._wave.insideRunWave && !this._wave.inDepMutation && !this._wave.rewireRunPending && !this._wave.batchDirtyOwed && this._dep.dirty.every((dirty) => !dirty) && this._control.pauseBuffer.length === 0 && !this._control.pausedDepWaveOccurred && this._control.demandOwed === void 0 && this._control.activePull === void 0 && !this._control.inDeliverDemand && this._control.pauseLockset.size === 0;
|
|
1542
1556
|
}
|
|
1543
1557
|
_releaseRuntime() {
|
|
1544
1558
|
if (this._released) return;
|
|
@@ -1594,7 +1608,9 @@ var Node = class {
|
|
|
1594
1608
|
this._control.pauseLockset.clear();
|
|
1595
1609
|
this._control.pauseBuffer = [];
|
|
1596
1610
|
this._control.pausedDepWaveOccurred = false;
|
|
1597
|
-
this._control.demandOwed =
|
|
1611
|
+
this._control.demandOwed = void 0;
|
|
1612
|
+
this._control.activePull = void 0;
|
|
1613
|
+
this._control.pullDirtyOwed = false;
|
|
1598
1614
|
this._restoredActivationPending = false;
|
|
1599
1615
|
checkpointReaders.delete(this);
|
|
1600
1616
|
restoreWriters.delete(this);
|
|
@@ -1776,7 +1792,7 @@ var Node = class {
|
|
|
1776
1792
|
this._wave.rewireRunPending = true;
|
|
1777
1793
|
return;
|
|
1778
1794
|
}
|
|
1779
|
-
if (this._slot.pausable === true && this._isPaused()) {
|
|
1795
|
+
if (this._slot.pausable === true && (this._isPaused() || this._isPullQuiet())) {
|
|
1780
1796
|
this._control.pausedDepWaveOccurred = true;
|
|
1781
1797
|
return;
|
|
1782
1798
|
}
|
|
@@ -1916,10 +1932,11 @@ var Node = class {
|
|
|
1916
1932
|
unsubscribeDep: (dep, fn) => this._requestRewireNext({ kind: "remove", dep, fn }),
|
|
1917
1933
|
replaceDeps: (deps, fn) => this._requestRewireNext({ kind: "set", deps, fn })
|
|
1918
1934
|
},
|
|
1919
|
-
// R-up-routing / R-pull (
|
|
1920
|
-
//
|
|
1935
|
+
// R-up-routing / R-pull (D269): deferred up — route a control/demand wave (e.g. PULL)
|
|
1936
|
+
// up the declared cone at the committed boundary. The SELF-demand path: an
|
|
1921
1937
|
// immediate ctx.up whose delivery loops back re-enters this fn (D37 / R-reentrancy).
|
|
1922
1938
|
upNext: (msgs, towardDep) => this._requestUpNext(msgs, towardDep),
|
|
1939
|
+
...this._control.activePull === void 0 ? {} : { pull: this._control.activePull },
|
|
1923
1940
|
[CTX_DEP_CACHE]: { latest: snapshot?.latest ?? this._dep.prev },
|
|
1924
1941
|
[CTX_NODE_BINDING]: {
|
|
1925
1942
|
dispatcher: this._slot.dispatcher,
|
|
@@ -1934,6 +1951,11 @@ var Node = class {
|
|
|
1934
1951
|
_refreshCtx(ctx) {
|
|
1935
1952
|
ctx.waveData = this._dep.waveData;
|
|
1936
1953
|
ctx.terminal = this._dep.terminalInput.map(terminalView);
|
|
1954
|
+
if (this._control.activePull === void 0) {
|
|
1955
|
+
delete ctx.pull;
|
|
1956
|
+
} else {
|
|
1957
|
+
ctx.pull = this._control.activePull;
|
|
1958
|
+
}
|
|
1937
1959
|
ctx[CTX_DEP_CACHE] = { latest: this._dep.prev };
|
|
1938
1960
|
}
|
|
1939
1961
|
_makeState() {
|
|
@@ -2026,7 +2048,7 @@ var Node = class {
|
|
|
2026
2048
|
plannedVersions[i] = plannedVersion;
|
|
2027
2049
|
}
|
|
2028
2050
|
}
|
|
2029
|
-
if (hasTier3 && !this._wave.insideRunWave && !this._wave.emittedDirtyThisWave) {
|
|
2051
|
+
if (hasTier3 && (!this._wave.insideRunWave || this._control.pullDirtyOwed) && !this._wave.emittedDirtyThisWave) {
|
|
2030
2052
|
this._wave.emittedDirtyThisWave = true;
|
|
2031
2053
|
this._value.status = "dirty";
|
|
2032
2054
|
this._emitToSubs(["DIRTY"], { wave: deliveryWave, last: false });
|
|
@@ -2106,13 +2128,18 @@ var Node = class {
|
|
|
2106
2128
|
if (m[0] === "PAUSE") {
|
|
2107
2129
|
this._pauseAcquire(m[1]);
|
|
2108
2130
|
} else if (m[0] === "RESUME") {
|
|
2109
|
-
if (this.
|
|
2110
|
-
if (!this._markDemandRouted(m[1], routeState)) this._onDemand();
|
|
2111
|
-
} else if (this._control.pauseLockset.has(m[1])) {
|
|
2131
|
+
if (this._control.pauseLockset.has(m[1])) {
|
|
2112
2132
|
this._pauseRelease(m[1]);
|
|
2113
2133
|
} else {
|
|
2114
2134
|
this._forwardUp(m, towardDep, routeState);
|
|
2115
2135
|
}
|
|
2136
|
+
} else if (m[0] === "PULL") {
|
|
2137
|
+
const demand = normalizePullDemand(m[1]);
|
|
2138
|
+
if (this._slot.pull && demand.pullId === this._slot.pullLock) {
|
|
2139
|
+
if (!this._markDemandRouted(demand.pullId, routeState)) this._onDemand(demand);
|
|
2140
|
+
} else {
|
|
2141
|
+
this._forwardUp(["PULL", demand], towardDep, routeState);
|
|
2142
|
+
}
|
|
2116
2143
|
} else if (this._slot.deps.length === 0) {
|
|
2117
2144
|
if (m[0] === "INVALIDATE") this._down([["INVALIDATE"]]);
|
|
2118
2145
|
} else {
|
|
@@ -2134,7 +2161,7 @@ var Node = class {
|
|
|
2134
2161
|
* Forward one up-going control message toward deps (R-up-routing): up the single declared edge
|
|
2135
2162
|
* `towardDep` (directed — prunes other branches; only meaningful on the issuer's FIRST hop) or
|
|
2136
2163
|
* broadcast up ALL deps. A depless source has no deps → the message DROPS here (the terminus —
|
|
2137
|
-
* e.g. a cone-routed
|
|
2164
|
+
* e.g. a cone-routed PULL whose pullId no node up this cone holds, R-up-at-source). Recursive
|
|
2138
2165
|
* forwarding carries the same per-wave route state and no `towardDep` → broadcast beyond the
|
|
2139
2166
|
* first hop.
|
|
2140
2167
|
*/
|
|
@@ -2153,9 +2180,7 @@ var Node = class {
|
|
|
2153
2180
|
}
|
|
2154
2181
|
_hasBoundaryPauseLock() {
|
|
2155
2182
|
if (this._slot.pausable === false) return false;
|
|
2156
|
-
|
|
2157
|
-
if (this._slot.pull && this._control.pauseLockset.has(this._slot.pullLock)) locks--;
|
|
2158
|
-
return locks > 0;
|
|
2183
|
+
return this._control.pauseLockset.size > 0;
|
|
2159
2184
|
}
|
|
2160
2185
|
_isAsyncPool() {
|
|
2161
2186
|
return this._slot.handle !== null && this._slot.dispatcher.poolKind(this._slot.handle.poolId) === "async";
|
|
@@ -2166,17 +2191,19 @@ var Node = class {
|
|
|
2166
2191
|
_pauseRelease(lockId) {
|
|
2167
2192
|
if (!this._control.pauseLockset.has(lockId)) return;
|
|
2168
2193
|
this._control.pauseLockset.delete(lockId);
|
|
2169
|
-
if (this._slot.pull && this._control.demandOwed) this._fireOwedDemandIfReady();
|
|
2194
|
+
if (this._slot.pull && this._control.demandOwed !== void 0) this._fireOwedDemandIfReady();
|
|
2170
2195
|
if (this._hasBoundaryPauseLock()) return;
|
|
2171
2196
|
scheduleBoundaryDrain(this._core);
|
|
2172
|
-
if (this.
|
|
2197
|
+
if (this._slot.pull) return;
|
|
2173
2198
|
this._onResume();
|
|
2174
2199
|
}
|
|
2175
2200
|
_onResume() {
|
|
2176
2201
|
if (this._value.terminal !== void 0) {
|
|
2177
2202
|
this._control.pauseBuffer = [];
|
|
2178
2203
|
this._control.pausedDepWaveOccurred = false;
|
|
2179
|
-
this._control.demandOwed =
|
|
2204
|
+
this._control.demandOwed = void 0;
|
|
2205
|
+
this._control.activePull = void 0;
|
|
2206
|
+
this._control.pullDirtyOwed = false;
|
|
2180
2207
|
return;
|
|
2181
2208
|
}
|
|
2182
2209
|
if (this._control.pauseBuffer.length > 0) {
|
|
@@ -2190,41 +2217,38 @@ var Node = class {
|
|
|
2190
2217
|
}
|
|
2191
2218
|
}
|
|
2192
2219
|
/**
|
|
2193
|
-
* R-pull (
|
|
2220
|
+
* R-pull (D269): can this pull node fire a demand NOW? — not terminal, settle-ready (_pending===0),
|
|
2194
2221
|
* and no OTHER (non-pullId) lock holds it paused. The gate that decides fire-now vs OWE.
|
|
2195
2222
|
*/
|
|
2196
2223
|
_canFireDemand() {
|
|
2197
2224
|
if (this._value.terminal !== void 0 || this._wave.pending > 0) return false;
|
|
2198
|
-
|
|
2199
|
-
return this._control.pauseLockset.size <= own;
|
|
2225
|
+
return this._control.pauseLockset.size === 0;
|
|
2200
2226
|
}
|
|
2201
2227
|
/**
|
|
2202
|
-
* R-pull (
|
|
2203
|
-
*
|
|
2204
|
-
* `finally` so a throwing pull fn (graph-less node, no D30 catch) cannot leave the node
|
|
2205
|
-
* permanently non-quiet (the wedge-fix silently disabled) — QA-found robustness fix.
|
|
2228
|
+
* R-pull (D269/D272): deliver ONE demand pulse — install activePull so the demand wave may
|
|
2229
|
+
* emit, fire it, then clear activePull so the node is quiet again (1:1).
|
|
2206
2230
|
*/
|
|
2207
|
-
_deliverPullDemand() {
|
|
2208
|
-
this._control.demandOwed =
|
|
2231
|
+
_deliverPullDemand(demand) {
|
|
2232
|
+
this._control.demandOwed = void 0;
|
|
2233
|
+
this._control.activePull = demand;
|
|
2209
2234
|
this._control.inDeliverDemand = true;
|
|
2210
|
-
this._control.pauseLockset.delete(this._slot.pullLock);
|
|
2211
2235
|
try {
|
|
2212
2236
|
this._firePullDemand();
|
|
2213
2237
|
} finally {
|
|
2214
|
-
this._control.
|
|
2238
|
+
this._control.activePull = void 0;
|
|
2215
2239
|
this._control.inDeliverDemand = false;
|
|
2216
2240
|
}
|
|
2217
2241
|
}
|
|
2218
2242
|
/**
|
|
2219
|
-
* R-pull (
|
|
2243
|
+
* R-pull (D269): a cone-routed PULL of THIS node's pullId arrived (R-up-routing) = a DEMAND.
|
|
2220
2244
|
* Fire immediately if able; else OWE it — pin-5 (a dep DIRTY in flight, _pending>0) or F4/F5 (an
|
|
2221
2245
|
* external PAUSE lock co-holds the node) — and fire when the node next becomes able. A demand
|
|
2222
2246
|
* arriving WHILE a delivery is in flight (synchronous re-entry) is DROPPED (1:1, QA guard).
|
|
2223
2247
|
*/
|
|
2224
|
-
_onDemand() {
|
|
2248
|
+
_onDemand(demand) {
|
|
2225
2249
|
if (this._control.inDeliverDemand) return;
|
|
2226
|
-
if (this._canFireDemand()) this._deliverPullDemand();
|
|
2227
|
-
else this._control.demandOwed =
|
|
2250
|
+
if (this._canFireDemand()) this._deliverPullDemand(demand);
|
|
2251
|
+
else this._control.demandOwed = demand;
|
|
2228
2252
|
}
|
|
2229
2253
|
/**
|
|
2230
2254
|
* R-pull (D55): service ONE demand. Delivery content = the orthogonal pausable mode:
|
|
@@ -2237,33 +2261,53 @@ var Node = class {
|
|
|
2237
2261
|
* `_markDirty` relays the leading DIRTY (not absorbed).
|
|
2238
2262
|
*/
|
|
2239
2263
|
_firePullDemand() {
|
|
2264
|
+
let drainedBuffer = false;
|
|
2240
2265
|
if (this._control.pauseBuffer.length > 0) {
|
|
2241
2266
|
const buf = this._control.pauseBuffer;
|
|
2242
2267
|
this._control.pauseBuffer = [];
|
|
2243
2268
|
for (const wave of buf) this._down(wave);
|
|
2269
|
+
drainedBuffer = true;
|
|
2244
2270
|
}
|
|
2271
|
+
if (drainedBuffer) return;
|
|
2245
2272
|
if (this._control.pausedDepWaveOccurred) {
|
|
2246
2273
|
const gated = this._slot.handle !== null && !this._wave.hasCalledFnOnce && !(this._slot.partial || this._allDepsSettled());
|
|
2247
2274
|
if (this._wave.pending > 0 || gated) return;
|
|
2248
2275
|
this._control.pausedDepWaveOccurred = false;
|
|
2249
|
-
this.
|
|
2250
|
-
this.
|
|
2276
|
+
this._wave.emittedDirtyThisWave = false;
|
|
2277
|
+
this._control.pullDirtyOwed = true;
|
|
2278
|
+
try {
|
|
2279
|
+
this._tryRun();
|
|
2280
|
+
} finally {
|
|
2281
|
+
this._control.pullDirtyOwed = false;
|
|
2282
|
+
}
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
if (this._slot.handle !== null) {
|
|
2286
|
+
if (!this._wave.hasCalledFnOnce && !(this._slot.partial || this._allDepsSettled())) return;
|
|
2287
|
+
this._wave.emittedDirtyThisWave = false;
|
|
2288
|
+
this._control.pullDirtyOwed = true;
|
|
2289
|
+
try {
|
|
2290
|
+
this._runWave();
|
|
2291
|
+
} finally {
|
|
2292
|
+
this._control.pullDirtyOwed = false;
|
|
2293
|
+
}
|
|
2251
2294
|
}
|
|
2252
2295
|
}
|
|
2253
2296
|
/**
|
|
2254
|
-
* R-pull (
|
|
2297
|
+
* R-pull (D269): fire a demand that was OWED (deferred at demand time) once the node becomes
|
|
2255
2298
|
* able — called from the dep-settle arms (DATA/RESOLVED/INVALIDATE/terminal drain _pending, pin-5
|
|
2256
2299
|
* + B1/F6) and from `_pauseRelease` (an external PAUSE lock releases, F4/F5).
|
|
2257
2300
|
*/
|
|
2258
2301
|
_fireOwedDemandIfReady() {
|
|
2259
2302
|
if (this._control.inDeliverDemand) return;
|
|
2260
|
-
if (this._slot.pull && this._control.demandOwed && this._canFireDemand())
|
|
2261
|
-
this._deliverPullDemand();
|
|
2303
|
+
if (this._slot.pull && this._control.demandOwed !== void 0 && this._canFireDemand()) {
|
|
2304
|
+
this._deliverPullDemand(this._control.demandOwed);
|
|
2305
|
+
}
|
|
2262
2306
|
}
|
|
2263
2307
|
/** Should an outgoing settle slice be deferred into the pause buffer? */
|
|
2264
2308
|
_shouldBufferOnPause() {
|
|
2265
2309
|
if (this._slot.pausable === false) return false;
|
|
2266
|
-
if (!this._isPaused()) return false;
|
|
2310
|
+
if (!this._isPaused() && !this._isPullQuiet()) return false;
|
|
2267
2311
|
if (this._slot.pausable === "resumeAll") return true;
|
|
2268
2312
|
if (!this._wave.insideRunWave && this._isAsyncPool() && this._slot.deps.length > 0) return true;
|
|
2269
2313
|
return false;
|
|
@@ -2303,7 +2347,9 @@ var Node = class {
|
|
|
2303
2347
|
this._control.pauseLockset.clear();
|
|
2304
2348
|
this._control.pauseBuffer = [];
|
|
2305
2349
|
this._control.pausedDepWaveOccurred = false;
|
|
2306
|
-
this._control.demandOwed =
|
|
2350
|
+
this._control.demandOwed = void 0;
|
|
2351
|
+
this._control.activePull = void 0;
|
|
2352
|
+
this._control.pullDirtyOwed = false;
|
|
2307
2353
|
this._value.replayRing = [];
|
|
2308
2354
|
const isCompute = this._slot.handle !== null || this._slot.deps.length > 0;
|
|
2309
2355
|
if (isCompute) {
|
|
@@ -3002,6 +3048,71 @@ function source2(factory, setup) {
|
|
|
3002
3048
|
}
|
|
3003
3049
|
};
|
|
3004
3050
|
}
|
|
3051
|
+
function defaultAnimationFrameScheduler(fallbackMs) {
|
|
3052
|
+
const host = globalThis;
|
|
3053
|
+
if (typeof host.requestAnimationFrame === "function" && typeof host.cancelAnimationFrame === "function") {
|
|
3054
|
+
return {
|
|
3055
|
+
requestAnimationFrame: (callback) => host.requestAnimationFrame?.(callback) ?? 0,
|
|
3056
|
+
cancelAnimationFrame: (handle) => {
|
|
3057
|
+
if (typeof handle === "number") host.cancelAnimationFrame?.(handle);
|
|
3058
|
+
}
|
|
3059
|
+
};
|
|
3060
|
+
}
|
|
3061
|
+
return {
|
|
3062
|
+
requestAnimationFrame(callback) {
|
|
3063
|
+
return setTimeout(() => callback(Date.now()), fallbackMs);
|
|
3064
|
+
},
|
|
3065
|
+
cancelAnimationFrame(handle) {
|
|
3066
|
+
clearTimeout(handle);
|
|
3067
|
+
}
|
|
3068
|
+
};
|
|
3069
|
+
}
|
|
3070
|
+
function defaultVisibilityDocument() {
|
|
3071
|
+
return globalThis.document;
|
|
3072
|
+
}
|
|
3073
|
+
function fromRaf(opts = {}) {
|
|
3074
|
+
const fallbackMsOpt = opts.fallbackMs;
|
|
3075
|
+
const fallbackMs = Number.isFinite(fallbackMsOpt) && fallbackMsOpt !== void 0 && fallbackMsOpt > 0 ? fallbackMsOpt : 16;
|
|
3076
|
+
const scheduler = opts.scheduler ?? defaultAnimationFrameScheduler(fallbackMs);
|
|
3077
|
+
const visibilityDocument = opts.document ?? defaultVisibilityDocument();
|
|
3078
|
+
return {
|
|
3079
|
+
factory: "fromRaf",
|
|
3080
|
+
opts: { pool: "sync", pausable: false },
|
|
3081
|
+
body: (ctx) => {
|
|
3082
|
+
let active2 = true;
|
|
3083
|
+
let frame;
|
|
3084
|
+
const cancelPending = () => {
|
|
3085
|
+
if (frame === void 0) return;
|
|
3086
|
+
scheduler.cancelAnimationFrame(frame);
|
|
3087
|
+
frame = void 0;
|
|
3088
|
+
};
|
|
3089
|
+
const isHidden = () => opts.pauseWhenHidden === true && visibilityDocument?.visibilityState === "hidden";
|
|
3090
|
+
const schedule = () => {
|
|
3091
|
+
if (!active2 || frame !== void 0 || isHidden()) return;
|
|
3092
|
+
frame = scheduler.requestAnimationFrame((time) => {
|
|
3093
|
+
frame = void 0;
|
|
3094
|
+
if (!active2 || isHidden()) return;
|
|
3095
|
+
ctx.down([["DATA", Number.isFinite(time) ? time : Date.now()]]);
|
|
3096
|
+
schedule();
|
|
3097
|
+
});
|
|
3098
|
+
};
|
|
3099
|
+
const onVisibilityChange = () => {
|
|
3100
|
+
if (!active2) return;
|
|
3101
|
+
if (isHidden()) cancelPending();
|
|
3102
|
+
else schedule();
|
|
3103
|
+
};
|
|
3104
|
+
if (opts.pauseWhenHidden === true && visibilityDocument?.addEventListener && visibilityDocument.removeEventListener) {
|
|
3105
|
+
visibilityDocument.addEventListener("visibilitychange", onVisibilityChange);
|
|
3106
|
+
}
|
|
3107
|
+
ctx.onDeactivation(() => {
|
|
3108
|
+
active2 = false;
|
|
3109
|
+
cancelPending();
|
|
3110
|
+
visibilityDocument?.removeEventListener?.("visibilitychange", onVisibilityChange);
|
|
3111
|
+
});
|
|
3112
|
+
schedule();
|
|
3113
|
+
}
|
|
3114
|
+
};
|
|
3115
|
+
}
|
|
3005
3116
|
function fromIDBRequest(request) {
|
|
3006
3117
|
return source2("fromIDBRequest", (ctx) => {
|
|
3007
3118
|
let done = false;
|
|
@@ -3076,6 +3187,7 @@ function fromIDBTransaction(transaction) {
|
|
|
3076
3187
|
fromIter,
|
|
3077
3188
|
fromPromise,
|
|
3078
3189
|
fromPushNotification,
|
|
3190
|
+
fromRaf,
|
|
3079
3191
|
fromSSE,
|
|
3080
3192
|
fromSSEWithOptions,
|
|
3081
3193
|
fromTimer,
|