@graphrefly/graphrefly 0.46.0 → 0.47.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/dist/base/composition/index.cjs +69 -15
- package/dist/base/composition/index.cjs.map +1 -1
- package/dist/base/composition/index.d.cts +1 -2
- package/dist/base/composition/index.d.ts +1 -2
- package/dist/base/composition/index.js +1 -1
- package/dist/base/index.cjs +69 -15
- package/dist/base/index.cjs.map +1 -1
- package/dist/base/index.d.cts +1 -2
- package/dist/base/index.d.ts +1 -2
- package/dist/base/index.js +1 -1
- package/dist/{chunk-WKSWLSCX.js → chunk-22SG74BD.js} +2 -2
- package/dist/{chunk-OO5BM6CJ.js → chunk-5IMMNARC.js} +2 -2
- package/dist/{chunk-KIIXR252.js → chunk-EHRRQ4IC.js} +2 -2
- package/dist/{chunk-HULCUY35.js → chunk-GWRNLJNW.js} +2 -2
- package/dist/{chunk-5THCXDWY.js → chunk-JKTC747G.js} +2 -2
- package/dist/{chunk-RGL53X5G.js → chunk-TNX5ZGDJ.js} +3 -3
- package/dist/{chunk-LBAJK24K.js → chunk-VLAGJZSL.js} +11 -3
- package/dist/chunk-VLAGJZSL.js.map +1 -0
- package/dist/chunk-Z65DVDEQ.js +146 -0
- package/dist/chunk-Z65DVDEQ.js.map +1 -0
- package/dist/{chunk-GBCENOLN.js → chunk-ZT4WMQW4.js} +3 -3
- package/dist/{chunk-FR6RGA3B.js → chunk-ZVXXDWIB.js} +19 -14
- package/dist/{chunk-FR6RGA3B.js.map → chunk-ZVXXDWIB.js.map} +1 -1
- package/dist/compat/index.cjs +156 -93
- package/dist/compat/index.cjs.map +1 -1
- package/dist/compat/index.d.cts +3 -3
- package/dist/compat/index.d.ts +3 -3
- package/dist/compat/index.js +2 -2
- package/dist/compat/nestjs/index.cjs +156 -93
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +4 -4
- package/dist/compat/nestjs/index.d.ts +4 -4
- package/dist/compat/nestjs/index.js +4 -5
- package/dist/{index-5SU_O78r.d.cts → index-B_p8tnvf.d.cts} +19 -3
- package/dist/{index-CEXCtYYJ.d.ts → index-_HDSmPyp.d.ts} +19 -3
- package/dist/index.cjs +77 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +9 -9
- package/dist/observable-B25XqCbZ.d.cts +59 -0
- package/dist/observable-B25XqCbZ.d.ts +59 -0
- package/dist/presets/ai/index.js +5 -5
- package/dist/presets/harness/index.js +7 -7
- package/dist/presets/index.js +8 -8
- package/dist/solutions/index.js +6 -6
- package/dist/utils/ai/index.js +3 -3
- package/dist/utils/index.cjs +8 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/memory/index.cjs +8 -3
- package/dist/utils/memory/index.cjs.map +1 -1
- package/dist/utils/memory/index.d.cts +78 -0
- package/dist/utils/memory/index.d.ts +78 -0
- package/dist/utils/memory/index.js +1 -1
- package/package.json +1 -5
- package/dist/chunk-3QZY5BI7.js +0 -92
- package/dist/chunk-3QZY5BI7.js.map +0 -1
- package/dist/chunk-LBAJK24K.js.map +0 -1
- package/dist/observable-BXQoW1P-.d.cts +0 -36
- package/dist/observable-BXQoW1P-.d.ts +0 -36
- /package/dist/{chunk-WKSWLSCX.js.map → chunk-22SG74BD.js.map} +0 -0
- /package/dist/{chunk-OO5BM6CJ.js.map → chunk-5IMMNARC.js.map} +0 -0
- /package/dist/{chunk-KIIXR252.js.map → chunk-EHRRQ4IC.js.map} +0 -0
- /package/dist/{chunk-HULCUY35.js.map → chunk-GWRNLJNW.js.map} +0 -0
- /package/dist/{chunk-5THCXDWY.js.map → chunk-JKTC747G.js.map} +0 -0
- /package/dist/{chunk-RGL53X5G.js.map → chunk-TNX5ZGDJ.js.map} +0 -0
- /package/dist/{chunk-GBCENOLN.js.map → chunk-ZT4WMQW4.js.map} +0 -0
|
@@ -487,43 +487,97 @@ function materialize(key, factories, parent, opts) {
|
|
|
487
487
|
|
|
488
488
|
// src/base/composition/observable.ts
|
|
489
489
|
var import_core6 = require("@graphrefly/pure-ts/core");
|
|
490
|
-
var
|
|
490
|
+
var OBSERVABLE_KEY = typeof Symbol === "function" && Symbol.observable || "@@observable";
|
|
491
|
+
function normalizeObserver(observer) {
|
|
492
|
+
return typeof observer === "function" ? { next: observer } : observer;
|
|
493
|
+
}
|
|
494
|
+
function makeInterop(onSubscribe) {
|
|
495
|
+
const obs = {
|
|
496
|
+
subscribe(rawObserver) {
|
|
497
|
+
const observer = normalizeObserver(rawObserver);
|
|
498
|
+
let closed = false;
|
|
499
|
+
let teardown;
|
|
500
|
+
let teardownPending = false;
|
|
501
|
+
const runTeardown = () => {
|
|
502
|
+
if (teardown) teardown();
|
|
503
|
+
else teardownPending = true;
|
|
504
|
+
};
|
|
505
|
+
const guarded = {
|
|
506
|
+
get closed() {
|
|
507
|
+
return closed;
|
|
508
|
+
},
|
|
509
|
+
next(value) {
|
|
510
|
+
if (!closed) observer.next?.(value);
|
|
511
|
+
},
|
|
512
|
+
error(err) {
|
|
513
|
+
if (closed) return;
|
|
514
|
+
closed = true;
|
|
515
|
+
try {
|
|
516
|
+
observer.error?.(err);
|
|
517
|
+
} finally {
|
|
518
|
+
runTeardown();
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
complete() {
|
|
522
|
+
if (closed) return;
|
|
523
|
+
closed = true;
|
|
524
|
+
try {
|
|
525
|
+
observer.complete?.();
|
|
526
|
+
} finally {
|
|
527
|
+
runTeardown();
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
teardown = onSubscribe(guarded);
|
|
532
|
+
if (teardownPending) teardown();
|
|
533
|
+
return {
|
|
534
|
+
unsubscribe() {
|
|
535
|
+
if (closed) return;
|
|
536
|
+
closed = true;
|
|
537
|
+
teardown?.();
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
obs[OBSERVABLE_KEY] = function() {
|
|
543
|
+
return this;
|
|
544
|
+
};
|
|
545
|
+
return obs;
|
|
546
|
+
}
|
|
491
547
|
function toObservable(node8, options) {
|
|
492
548
|
if (options?.raw) {
|
|
493
|
-
return
|
|
494
|
-
|
|
495
|
-
if (
|
|
496
|
-
|
|
549
|
+
return makeInterop((observer) => {
|
|
550
|
+
return node8.subscribe((msgs) => {
|
|
551
|
+
if (observer.closed) return;
|
|
552
|
+
observer.next?.(msgs);
|
|
497
553
|
for (const m of msgs) {
|
|
498
554
|
if (m[0] === import_core6.ERROR) {
|
|
499
|
-
|
|
555
|
+
observer.error?.(m[1]);
|
|
500
556
|
return;
|
|
501
557
|
}
|
|
502
558
|
if (m[0] === import_core6.COMPLETE) {
|
|
503
|
-
|
|
559
|
+
observer.complete?.();
|
|
504
560
|
return;
|
|
505
561
|
}
|
|
506
562
|
}
|
|
507
563
|
});
|
|
508
|
-
return unsub;
|
|
509
564
|
});
|
|
510
565
|
}
|
|
511
|
-
return
|
|
512
|
-
|
|
566
|
+
return makeInterop((observer) => {
|
|
567
|
+
return node8.subscribe((msgs) => {
|
|
513
568
|
for (const m of msgs) {
|
|
514
|
-
if (
|
|
569
|
+
if (observer.closed) return;
|
|
515
570
|
if (m[0] === import_core6.DATA) {
|
|
516
|
-
|
|
571
|
+
observer.next?.(m[1]);
|
|
517
572
|
} else if (m[0] === import_core6.ERROR) {
|
|
518
|
-
|
|
573
|
+
observer.error?.(m[1]);
|
|
519
574
|
return;
|
|
520
575
|
} else if (m[0] === import_core6.COMPLETE) {
|
|
521
|
-
|
|
576
|
+
observer.complete?.();
|
|
522
577
|
return;
|
|
523
578
|
}
|
|
524
579
|
}
|
|
525
580
|
});
|
|
526
|
-
return unsub;
|
|
527
581
|
});
|
|
528
582
|
}
|
|
529
583
|
|