@graphrefly/graphrefly 0.24.0 → 0.25.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.
Files changed (33) hide show
  1. package/dist/{chunk-IPLKX3L2.js → chunk-EVR6UFUV.js} +2 -2
  2. package/dist/{chunk-5WGT55R4.js → chunk-IAHGTNOZ.js} +4 -2
  3. package/dist/{chunk-5WGT55R4.js.map → chunk-IAHGTNOZ.js.map} +1 -1
  4. package/dist/{chunk-AOCBDH4T.js → chunk-L2GLW2U7.js} +68 -1
  5. package/dist/chunk-L2GLW2U7.js.map +1 -0
  6. package/dist/{chunk-TDEXAMGO.js → chunk-TKE3JGOH.js} +488 -16
  7. package/dist/chunk-TKE3JGOH.js.map +1 -0
  8. package/dist/compat/nestjs/index.cjs.map +1 -1
  9. package/dist/compat/nestjs/index.js +2 -2
  10. package/dist/extra/index.cjs +68 -0
  11. package/dist/extra/index.cjs.map +1 -1
  12. package/dist/extra/index.d.cts +1 -1
  13. package/dist/extra/index.d.ts +1 -1
  14. package/dist/extra/index.js +4 -2
  15. package/dist/{index-1z8vRTCt.d.cts → index-Ch0IpIO0.d.cts} +29 -2
  16. package/dist/{index-b5BYtczN.d.cts → index-DKE1EATr.d.cts} +222 -2
  17. package/dist/{index-BysCTzJz.d.ts → index-Ds23Wvou.d.ts} +29 -2
  18. package/dist/{index-D7XgsUt7.d.ts → index-OXImXMq6.d.ts} +222 -2
  19. package/dist/index.cjs +550 -15
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +3 -3
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.js +6 -4
  24. package/dist/index.js.map +1 -1
  25. package/dist/patterns/reactive-layout/index.cjs +488 -16
  26. package/dist/patterns/reactive-layout/index.cjs.map +1 -1
  27. package/dist/patterns/reactive-layout/index.d.cts +1 -1
  28. package/dist/patterns/reactive-layout/index.d.ts +1 -1
  29. package/dist/patterns/reactive-layout/index.js +16 -4
  30. package/package.json +1 -1
  31. package/dist/chunk-AOCBDH4T.js.map +0 -1
  32. package/dist/chunk-TDEXAMGO.js.map +0 -1
  33. /package/dist/{chunk-IPLKX3L2.js.map → chunk-EVR6UFUV.js.map} +0 -0
@@ -31,14 +31,14 @@ import {
31
31
  getNodeToken,
32
32
  observeSSE,
33
33
  observeSubscription
34
- } from "../../chunk-IPLKX3L2.js";
34
+ } from "../../chunk-EVR6UFUV.js";
35
35
  import "../../chunk-QOWVNWOC.js";
36
36
  import {
37
37
  toObservable
38
38
  } from "../../chunk-PY4XCDLR.js";
39
39
  import "../../chunk-MW4VAKAO.js";
40
40
  import "../../chunk-HWPIFSW2.js";
41
- import "../../chunk-AOCBDH4T.js";
41
+ import "../../chunk-L2GLW2U7.js";
42
42
  import "../../chunk-XOFWRC73.js";
43
43
  import "../../chunk-H4RVA4VE.js";
44
44
  import "../../chunk-7TAQJHQV.js";
@@ -100,6 +100,7 @@ __export(extra_exports, {
100
100
  fromPromise: () => fromPromise,
101
101
  fromPulsar: () => fromPulsar,
102
102
  fromRabbitMQ: () => fromRabbitMQ,
103
+ fromRaf: () => fromRaf,
103
104
  fromRedisStream: () => fromRedisStream,
104
105
  fromSSE: () => fromSSE,
105
106
  fromSqlite: () => fromSqlite,
@@ -2471,6 +2472,72 @@ function fromTimer(ms, opts) {
2471
2472
  return cleanup;
2472
2473
  }, sourceOpts2(rest));
2473
2474
  }
2475
+ function fromRaf(opts) {
2476
+ const { signal, ...rest } = opts ?? {};
2477
+ return producer((a) => {
2478
+ let done = false;
2479
+ let rafId;
2480
+ let fallbackTimer;
2481
+ let abortListenerAdded = false;
2482
+ let visibilityListenerAdded = false;
2483
+ const raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : void 0;
2484
+ const caf = typeof cancelAnimationFrame === "function" ? cancelAnimationFrame : void 0;
2485
+ const doc = typeof document !== "undefined" ? document : void 0;
2486
+ const clearPending = () => {
2487
+ if (rafId !== void 0 && caf) caf(rafId);
2488
+ if (fallbackTimer !== void 0) clearTimeout(fallbackTimer);
2489
+ rafId = void 0;
2490
+ fallbackTimer = void 0;
2491
+ };
2492
+ const cleanup = () => {
2493
+ done = true;
2494
+ clearPending();
2495
+ if (abortListenerAdded) {
2496
+ signal?.removeEventListener("abort", onAbort);
2497
+ abortListenerAdded = false;
2498
+ }
2499
+ if (visibilityListenerAdded && doc) {
2500
+ doc.removeEventListener("visibilitychange", onVisibilityChange);
2501
+ visibilityListenerAdded = false;
2502
+ }
2503
+ };
2504
+ const onAbort = () => {
2505
+ if (done) return;
2506
+ cleanup();
2507
+ a.down([[ERROR, signal.reason]]);
2508
+ };
2509
+ const tick = (now) => {
2510
+ if (done) return;
2511
+ a.emit(now);
2512
+ scheduleNext();
2513
+ };
2514
+ const scheduleNext = () => {
2515
+ if (done) return;
2516
+ if (raf && (!doc || doc.visibilityState !== "hidden")) {
2517
+ rafId = raf(tick);
2518
+ } else {
2519
+ fallbackTimer = setTimeout(() => tick(performance.now()), 16);
2520
+ }
2521
+ };
2522
+ const onVisibilityChange = () => {
2523
+ if (done) return;
2524
+ clearPending();
2525
+ scheduleNext();
2526
+ };
2527
+ if (signal?.aborted) {
2528
+ onAbort();
2529
+ return cleanup;
2530
+ }
2531
+ signal?.addEventListener("abort", onAbort, { once: true });
2532
+ abortListenerAdded = signal !== void 0;
2533
+ if (doc && raf) {
2534
+ doc.addEventListener("visibilitychange", onVisibilityChange);
2535
+ visibilityListenerAdded = true;
2536
+ }
2537
+ scheduleNext();
2538
+ return cleanup;
2539
+ }, sourceOpts2(rest));
2540
+ }
2474
2541
  function fromCron(expr, opts) {
2475
2542
  const schedule = parseCron(expr);
2476
2543
  const { tickMs: tickOpt, output, ...rest } = opts ?? {};
@@ -9687,6 +9754,7 @@ function workerSelf(target, opts) {
9687
9754
  fromPromise,
9688
9755
  fromPulsar,
9689
9756
  fromRabbitMQ,
9757
+ fromRaf,
9690
9758
  fromRedisStream,
9691
9759
  fromSSE,
9692
9760
  fromSqlite,