@graphrefly/graphrefly 0.20.0 → 0.21.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 (42) hide show
  1. package/README.md +20 -3
  2. package/dist/{chunk-3N2Y6PCR.js → chunk-2UDLYZHT.js} +3 -3
  3. package/dist/{chunk-XYL3GLB3.js → chunk-4MQ2J6IG.js} +2 -2
  4. package/dist/{chunk-XYL3GLB3.js.map → chunk-4MQ2J6IG.js.map} +1 -1
  5. package/dist/{chunk-2L5J6RPM.js → chunk-7IGHIFTT.js} +2 -2
  6. package/dist/{chunk-PGEU5MEH.js → chunk-DOSLSFKL.js} +3 -3
  7. package/dist/{chunk-BJAOEU4D.js → chunk-ECN37NVS.js} +154 -196
  8. package/dist/chunk-ECN37NVS.js.map +1 -0
  9. package/dist/{chunk-R2LPZIY2.js → chunk-G66H6ZRK.js} +3 -3
  10. package/dist/{chunk-OOA2UTXF.js → chunk-VOQFK7YN.js} +2 -2
  11. package/dist/{chunk-5PSVTDNZ.js → chunk-XWBVAO2R.js} +4 -4
  12. package/dist/{chunk-IAPLC4NR.js → chunk-ZTCDY5NQ.js} +3 -3
  13. package/dist/compat/nestjs/index.cjs +1 -1
  14. package/dist/compat/nestjs/index.cjs.map +1 -1
  15. package/dist/compat/nestjs/index.js +7 -7
  16. package/dist/core/index.cjs +1 -1
  17. package/dist/core/index.cjs.map +1 -1
  18. package/dist/core/index.js +3 -3
  19. package/dist/extra/index.cjs +152 -194
  20. package/dist/extra/index.cjs.map +1 -1
  21. package/dist/extra/index.js +3 -3
  22. package/dist/graph/index.cjs +1 -1
  23. package/dist/graph/index.cjs.map +1 -1
  24. package/dist/graph/index.js +4 -4
  25. package/dist/index.cjs +312 -196
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +201 -5
  28. package/dist/index.d.ts +201 -5
  29. package/dist/index.js +173 -15
  30. package/dist/index.js.map +1 -1
  31. package/dist/patterns/reactive-layout/index.cjs +1 -1
  32. package/dist/patterns/reactive-layout/index.cjs.map +1 -1
  33. package/dist/patterns/reactive-layout/index.js +4 -4
  34. package/package.json +2 -1
  35. package/dist/chunk-BJAOEU4D.js.map +0 -1
  36. /package/dist/{chunk-3N2Y6PCR.js.map → chunk-2UDLYZHT.js.map} +0 -0
  37. /package/dist/{chunk-2L5J6RPM.js.map → chunk-7IGHIFTT.js.map} +0 -0
  38. /package/dist/{chunk-PGEU5MEH.js.map → chunk-DOSLSFKL.js.map} +0 -0
  39. /package/dist/{chunk-R2LPZIY2.js.map → chunk-G66H6ZRK.js.map} +0 -0
  40. /package/dist/{chunk-OOA2UTXF.js.map → chunk-VOQFK7YN.js.map} +0 -0
  41. /package/dist/{chunk-5PSVTDNZ.js.map → chunk-XWBVAO2R.js.map} +0 -0
  42. /package/dist/{chunk-IAPLC4NR.js.map → chunk-ZTCDY5NQ.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  NO_VALUE,
4
4
  NodeImpl,
5
5
  accessHintForGuard
6
- } from "./chunk-XYL3GLB3.js";
6
+ } from "./chunk-4MQ2J6IG.js";
7
7
 
8
8
  // src/core/meta.ts
9
9
  function resolveDescribeFields(detail, fields) {
@@ -106,4 +106,4 @@ export {
106
106
  resolveDescribeFields,
107
107
  describeNode
108
108
  };
109
- //# sourceMappingURL=chunk-2L5J6RPM.js.map
109
+ //# sourceMappingURL=chunk-7IGHIFTT.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-WZ2Z2CRV.js";
4
4
  import {
5
5
  resolveDescribeFields
6
- } from "./chunk-2L5J6RPM.js";
6
+ } from "./chunk-7IGHIFTT.js";
7
7
  import {
8
8
  CLEANUP_RESULT,
9
9
  COMPLETE,
@@ -49,7 +49,7 @@ import {
49
49
  propagatesToMeta,
50
50
  state,
51
51
  wallClockNs
52
- } from "./chunk-XYL3GLB3.js";
52
+ } from "./chunk-4MQ2J6IG.js";
53
53
 
54
54
  // src/core/index.ts
55
55
  var core_exports = {};
@@ -159,4 +159,4 @@ export {
159
159
  bridge,
160
160
  core_exports
161
161
  };
162
- //# sourceMappingURL=chunk-PGEU5MEH.js.map
162
+ //# sourceMappingURL=chunk-DOSLSFKL.js.map
@@ -30,7 +30,7 @@ import {
30
30
  throwError,
31
31
  toArray,
32
32
  toObservable
33
- } from "./chunk-OOA2UTXF.js";
33
+ } from "./chunk-VOQFK7YN.js";
34
34
  import {
35
35
  ResettableTimer
36
36
  } from "./chunk-WZ2Z2CRV.js";
@@ -59,7 +59,7 @@ import {
59
59
  producer,
60
60
  state,
61
61
  wallClockNs
62
- } from "./chunk-XYL3GLB3.js";
62
+ } from "./chunk-4MQ2J6IG.js";
63
63
 
64
64
  // src/extra/index.ts
65
65
  var extra_exports = {};
@@ -3663,9 +3663,11 @@ function scan(source, reducer, seed, opts) {
3663
3663
  function reduce(source, reducer, seed, opts) {
3664
3664
  let acc = seed;
3665
3665
  let sawData = false;
3666
+ let depHasData = false;
3666
3667
  return node(
3667
3668
  [source],
3668
3669
  ([v]) => {
3670
+ if (!depHasData) return void 0;
3669
3671
  sawData = true;
3670
3672
  acc = reducer(acc, v);
3671
3673
  return void 0;
@@ -3676,8 +3678,10 @@ function reduce(source, reducer, seed, opts) {
3676
3678
  onResubscribe: opts?.resubscribable === true ? () => {
3677
3679
  acc = seed;
3678
3680
  sawData = false;
3681
+ depHasData = false;
3679
3682
  } : void 0,
3680
3683
  onMessage(msg, _i, a) {
3684
+ if (msg[0] === DATA) depHasData = true;
3681
3685
  if (msg[0] === COMPLETE) {
3682
3686
  if (!sawData) acc = seed;
3683
3687
  a.emit(acc);
@@ -3796,9 +3800,11 @@ function skip(source, count, opts) {
3796
3800
  }
3797
3801
  function takeWhile(source, predicate, opts) {
3798
3802
  let done = false;
3803
+ let depHasData = false;
3799
3804
  return node(
3800
3805
  [source],
3801
3806
  ([v], a) => {
3807
+ if (!depHasData) return void 0;
3802
3808
  if (done) return void 0;
3803
3809
  if (!predicate(v)) {
3804
3810
  done = true;
@@ -3811,6 +3817,7 @@ function takeWhile(source, predicate, opts) {
3811
3817
  ...operatorOpts2(opts),
3812
3818
  completeWhenDepsComplete: false,
3813
3819
  onMessage(msg, _i, a) {
3820
+ if (msg[0] === DATA) depHasData = true;
3814
3821
  if (done) {
3815
3822
  if (msg[0] === COMPLETE) {
3816
3823
  a.down([[COMPLETE]]);
@@ -3863,9 +3870,11 @@ function last(source, options) {
3863
3870
  const useDefault = options != null && Object.hasOwn(options, "defaultValue");
3864
3871
  let lastVal;
3865
3872
  let has = false;
3873
+ let depHasData = false;
3866
3874
  return node(
3867
3875
  [source],
3868
3876
  ([v]) => {
3877
+ if (!depHasData) return void 0;
3869
3878
  lastVal = v;
3870
3879
  has = true;
3871
3880
  return void 0;
@@ -3874,6 +3883,7 @@ function last(source, options) {
3874
3883
  ...operatorOpts2(rest),
3875
3884
  completeWhenDepsComplete: false,
3876
3885
  onMessage(msg, _i, a) {
3886
+ if (msg[0] === DATA) depHasData = true;
3877
3887
  if (msg[0] === COMPLETE) {
3878
3888
  if (has) {
3879
3889
  a.emit(lastVal);
@@ -4260,120 +4270,101 @@ function forwardInner(inner, a, onInnerComplete) {
4260
4270
  function switchMap(source, project, opts) {
4261
4271
  let innerUnsub;
4262
4272
  let sourceDone = false;
4263
- let attached = false;
4264
4273
  function clearInner() {
4265
4274
  innerUnsub?.();
4266
4275
  innerUnsub = void 0;
4267
4276
  }
4268
4277
  function attach(v, a) {
4269
- attached = true;
4270
4278
  clearInner();
4271
4279
  innerUnsub = forwardInner(fromAny(project(v)), a, () => {
4272
4280
  clearInner();
4273
4281
  if (sourceDone) a.down([[COMPLETE]]);
4274
4282
  });
4275
4283
  }
4276
- return node(
4277
- [source],
4278
- ([v], a) => {
4279
- if (!attached) attach(v, a);
4280
- return clearInner;
4281
- },
4282
- {
4283
- ...operatorOpts2(opts),
4284
- completeWhenDepsComplete: false,
4285
- onMessage(msg, _i, a) {
4286
- const t = msg[0];
4287
- if (t === ERROR) {
4288
- clearInner();
4289
- a.down([msg]);
4290
- return true;
4291
- }
4292
- if (t === COMPLETE) {
4293
- sourceDone = true;
4294
- if (innerUnsub === void 0) a.down([[COMPLETE]]);
4295
- return true;
4296
- }
4297
- if (t === DIRTY) {
4298
- a.down([[DIRTY]]);
4299
- return true;
4300
- }
4301
- if (t === RESOLVED) {
4302
- a.down([[RESOLVED]]);
4303
- return true;
4304
- }
4305
- if (t === DATA) {
4306
- attach(msg[1], a);
4307
- return true;
4308
- }
4309
- return false;
4284
+ return node([source], () => clearInner, {
4285
+ ...operatorOpts2(opts),
4286
+ completeWhenDepsComplete: false,
4287
+ onMessage(msg, _i, a) {
4288
+ const t = msg[0];
4289
+ if (t === ERROR) {
4290
+ clearInner();
4291
+ a.down([msg]);
4292
+ return true;
4310
4293
  }
4294
+ if (t === COMPLETE) {
4295
+ sourceDone = true;
4296
+ if (innerUnsub === void 0) a.down([[COMPLETE]]);
4297
+ return true;
4298
+ }
4299
+ if (t === DIRTY) {
4300
+ a.down([[DIRTY]]);
4301
+ return true;
4302
+ }
4303
+ if (t === RESOLVED) {
4304
+ a.down([[RESOLVED]]);
4305
+ return true;
4306
+ }
4307
+ if (t === DATA) {
4308
+ attach(msg[1], a);
4309
+ return true;
4310
+ }
4311
+ return false;
4311
4312
  }
4312
- );
4313
+ });
4313
4314
  }
4314
4315
  function exhaustMap(source, project, opts) {
4315
4316
  let innerUnsub;
4316
4317
  let sourceDone = false;
4317
- let attached = false;
4318
4318
  function clearInner() {
4319
4319
  innerUnsub?.();
4320
4320
  innerUnsub = void 0;
4321
4321
  }
4322
4322
  function attach(v, a) {
4323
- attached = true;
4324
4323
  innerUnsub = forwardInner(fromAny(project(v)), a, () => {
4325
4324
  clearInner();
4326
4325
  if (sourceDone) a.down([[COMPLETE]]);
4327
4326
  });
4328
4327
  }
4329
- return node(
4330
- [source],
4331
- ([v], a) => {
4332
- if (!attached && innerUnsub === void 0) attach(v, a);
4333
- return clearInner;
4334
- },
4335
- {
4336
- ...operatorOpts2(opts),
4337
- completeWhenDepsComplete: false,
4338
- onMessage(msg, _i, a) {
4339
- const t = msg[0];
4340
- if (t === ERROR) {
4341
- clearInner();
4342
- a.down([msg]);
4343
- return true;
4344
- }
4345
- if (t === COMPLETE) {
4346
- sourceDone = true;
4347
- if (innerUnsub === void 0) a.down([[COMPLETE]]);
4348
- return true;
4349
- }
4350
- if (t === DIRTY) {
4351
- a.down([[DIRTY]]);
4352
- return true;
4353
- }
4354
- if (t === RESOLVED) {
4328
+ return node([source], () => clearInner, {
4329
+ ...operatorOpts2(opts),
4330
+ completeWhenDepsComplete: false,
4331
+ onMessage(msg, _i, a) {
4332
+ const t = msg[0];
4333
+ if (t === ERROR) {
4334
+ clearInner();
4335
+ a.down([msg]);
4336
+ return true;
4337
+ }
4338
+ if (t === COMPLETE) {
4339
+ sourceDone = true;
4340
+ if (innerUnsub === void 0) a.down([[COMPLETE]]);
4341
+ return true;
4342
+ }
4343
+ if (t === DIRTY) {
4344
+ a.down([[DIRTY]]);
4345
+ return true;
4346
+ }
4347
+ if (t === RESOLVED) {
4348
+ a.down([[RESOLVED]]);
4349
+ return true;
4350
+ }
4351
+ if (t === DATA) {
4352
+ if (innerUnsub !== void 0) {
4355
4353
  a.down([[RESOLVED]]);
4356
4354
  return true;
4357
4355
  }
4358
- if (t === DATA) {
4359
- if (innerUnsub !== void 0) {
4360
- a.down([[RESOLVED]]);
4361
- return true;
4362
- }
4363
- attach(msg[1], a);
4364
- return true;
4365
- }
4366
- return false;
4356
+ attach(msg[1], a);
4357
+ return true;
4367
4358
  }
4359
+ return false;
4368
4360
  }
4369
- );
4361
+ });
4370
4362
  }
4371
4363
  function concatMap(source, project, opts) {
4372
4364
  const { maxBuffer: maxBuf, ...concatNodeOpts } = opts ?? {};
4373
4365
  const queue = [];
4374
4366
  let innerUnsub;
4375
4367
  let sourceDone = false;
4376
- let attached = false;
4377
4368
  function clearInner() {
4378
4369
  innerUnsub?.();
4379
4370
  innerUnsub = void 0;
@@ -4391,49 +4382,41 @@ function concatMap(source, project, opts) {
4391
4382
  });
4392
4383
  }
4393
4384
  function enqueue(v, a) {
4394
- attached = true;
4395
4385
  if (maxBuf && maxBuf > 0 && queue.length >= maxBuf) queue.shift();
4396
4386
  queue.push(v);
4397
4387
  tryPump(a);
4398
4388
  }
4399
- return node(
4400
- [source],
4401
- ([v], a) => {
4402
- if (!attached) enqueue(v, a);
4403
- return clearInner;
4404
- },
4405
- {
4406
- ...operatorOpts2(concatNodeOpts),
4407
- completeWhenDepsComplete: false,
4408
- onMessage(msg, _i, a) {
4409
- const t = msg[0];
4410
- if (t === ERROR) {
4411
- clearInner();
4412
- queue.length = 0;
4413
- a.down([msg]);
4414
- return true;
4415
- }
4416
- if (t === COMPLETE) {
4417
- sourceDone = true;
4418
- tryPump(a);
4419
- return true;
4420
- }
4421
- if (t === DIRTY) {
4422
- a.down([[DIRTY]]);
4423
- return true;
4424
- }
4425
- if (t === RESOLVED) {
4426
- a.down([[RESOLVED]]);
4427
- return true;
4428
- }
4429
- if (t === DATA) {
4430
- enqueue(msg[1], a);
4431
- return true;
4432
- }
4433
- return false;
4389
+ return node([source], () => clearInner, {
4390
+ ...operatorOpts2(concatNodeOpts),
4391
+ completeWhenDepsComplete: false,
4392
+ onMessage(msg, _i, a) {
4393
+ const t = msg[0];
4394
+ if (t === ERROR) {
4395
+ clearInner();
4396
+ queue.length = 0;
4397
+ a.down([msg]);
4398
+ return true;
4399
+ }
4400
+ if (t === COMPLETE) {
4401
+ sourceDone = true;
4402
+ tryPump(a);
4403
+ return true;
4404
+ }
4405
+ if (t === DIRTY) {
4406
+ a.down([[DIRTY]]);
4407
+ return true;
4434
4408
  }
4409
+ if (t === RESOLVED) {
4410
+ a.down([[RESOLVED]]);
4411
+ return true;
4412
+ }
4413
+ if (t === DATA) {
4414
+ enqueue(msg[1], a);
4415
+ return true;
4416
+ }
4417
+ return false;
4435
4418
  }
4436
- );
4419
+ });
4437
4420
  }
4438
4421
  function mergeMap(source, project, opts) {
4439
4422
  const { concurrent: concurrentOpt, ...mergeNodeOpts } = opts ?? {};
@@ -4489,47 +4472,36 @@ function mergeMap(source, project, opts) {
4489
4472
  active = 0;
4490
4473
  buffer2.length = 0;
4491
4474
  }
4492
- let attached = false;
4493
- return node(
4494
- [source],
4495
- ([v], a) => {
4496
- if (!attached) {
4497
- attached = true;
4498
- enqueue(v, a);
4475
+ return node([source], () => clearAll, {
4476
+ ...operatorOpts2(mergeNodeOpts),
4477
+ completeWhenDepsComplete: false,
4478
+ onMessage(msg, _i, a) {
4479
+ const t = msg[0];
4480
+ if (t === ERROR) {
4481
+ clearAll();
4482
+ a.down([msg]);
4483
+ return true;
4499
4484
  }
4500
- return clearAll;
4501
- },
4502
- {
4503
- ...operatorOpts2(mergeNodeOpts),
4504
- completeWhenDepsComplete: false,
4505
- onMessage(msg, _i, a) {
4506
- const t = msg[0];
4507
- if (t === ERROR) {
4508
- clearAll();
4509
- a.down([msg]);
4510
- return true;
4511
- }
4512
- if (t === COMPLETE) {
4513
- sourceDone = true;
4514
- tryComplete(a);
4515
- return true;
4516
- }
4517
- if (t === DIRTY) {
4518
- a.down([[DIRTY]]);
4519
- return true;
4520
- }
4521
- if (t === RESOLVED) {
4522
- a.down([[RESOLVED]]);
4523
- return true;
4524
- }
4525
- if (t === DATA) {
4526
- enqueue(msg[1], a);
4527
- return true;
4528
- }
4529
- return false;
4485
+ if (t === COMPLETE) {
4486
+ sourceDone = true;
4487
+ tryComplete(a);
4488
+ return true;
4489
+ }
4490
+ if (t === DIRTY) {
4491
+ a.down([[DIRTY]]);
4492
+ return true;
4493
+ }
4494
+ if (t === RESOLVED) {
4495
+ a.down([[RESOLVED]]);
4496
+ return true;
4497
+ }
4498
+ if (t === DATA) {
4499
+ enqueue(msg[1], a);
4500
+ return true;
4530
4501
  }
4502
+ return false;
4531
4503
  }
4532
- );
4504
+ });
4533
4505
  }
4534
4506
  var flatMap = mergeMap;
4535
4507
  function delay(source, ms, opts) {
@@ -4848,53 +4820,39 @@ function buffer(source, notifier, opts) {
4848
4820
  function bufferCount(source, count, opts) {
4849
4821
  if (count <= 0) throw new RangeError("bufferCount expects count > 0");
4850
4822
  const buf = [];
4851
- let started = false;
4852
- return node(
4853
- [source],
4854
- ([v], a) => {
4855
- if (!started) {
4856
- started = true;
4857
- buf.push(v);
4823
+ return node([source], () => void 0, {
4824
+ ...operatorOpts2(opts),
4825
+ completeWhenDepsComplete: false,
4826
+ onMessage(msg, _i, a) {
4827
+ const t = msg[0];
4828
+ if (t === ERROR) {
4829
+ a.down([msg]);
4830
+ return true;
4831
+ }
4832
+ if (t === COMPLETE) {
4833
+ if (buf.length > 0) a.emit([...buf]);
4834
+ buf.length = 0;
4835
+ a.down([[COMPLETE]]);
4836
+ return true;
4837
+ }
4838
+ if (t === DIRTY) {
4839
+ a.down([[DIRTY]]);
4840
+ return true;
4841
+ }
4842
+ if (t === RESOLVED) {
4843
+ a.down([[RESOLVED]]);
4844
+ return true;
4845
+ }
4846
+ if (t === DATA) {
4847
+ buf.push(msg[1]);
4858
4848
  if (buf.length >= count) {
4859
4849
  a.emit(buf.splice(0, buf.length));
4860
4850
  }
4851
+ return true;
4861
4852
  }
4862
- return void 0;
4863
- },
4864
- {
4865
- ...operatorOpts2(opts),
4866
- completeWhenDepsComplete: false,
4867
- onMessage(msg, _i, a) {
4868
- const t = msg[0];
4869
- if (t === ERROR) {
4870
- a.down([msg]);
4871
- return true;
4872
- }
4873
- if (t === COMPLETE) {
4874
- if (buf.length > 0) a.emit([...buf]);
4875
- buf.length = 0;
4876
- a.down([[COMPLETE]]);
4877
- return true;
4878
- }
4879
- if (t === DIRTY) {
4880
- a.down([[DIRTY]]);
4881
- return true;
4882
- }
4883
- if (t === RESOLVED) {
4884
- a.down([[RESOLVED]]);
4885
- return true;
4886
- }
4887
- if (t === DATA) {
4888
- buf.push(msg[1]);
4889
- if (buf.length >= count) {
4890
- a.emit(buf.splice(0, buf.length));
4891
- }
4892
- return true;
4893
- }
4894
- return false;
4895
- }
4853
+ return false;
4896
4854
  }
4897
- );
4855
+ });
4898
4856
  }
4899
4857
  function windowCount(source, count, opts) {
4900
4858
  if (count <= 0) throw new RangeError("windowCount expects count > 0");
@@ -6266,4 +6224,4 @@ export {
6266
6224
  workerSelf,
6267
6225
  extra_exports
6268
6226
  };
6269
- //# sourceMappingURL=chunk-BJAOEU4D.js.map
6227
+ //# sourceMappingURL=chunk-ECN37NVS.js.map