@genesislcap/foundation-utils 15.90.0 → 15.90.1-GENC-1829.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.
@@ -258,204 +258,6 @@
258
258
  }
259
259
  ]
260
260
  },
261
- {
262
- "kind": "javascript-module",
263
- "path": "src/data/inMemoryDatabase.ts",
264
- "declarations": [
265
- {
266
- "kind": "class",
267
- "description": "An in memory database of specific DatabaseRecord types.",
268
- "name": "InMemoryDatabase",
269
- "members": [
270
- {
271
- "kind": "field",
272
- "name": "isWorking",
273
- "type": {
274
- "text": "boolean"
275
- },
276
- "privacy": "public",
277
- "default": "false"
278
- },
279
- {
280
- "kind": "field",
281
- "name": "records",
282
- "type": {
283
- "text": "Record<string, T>"
284
- },
285
- "privacy": "private",
286
- "default": "{}"
287
- },
288
- {
289
- "kind": "field",
290
- "name": "beforeUpdateListeners",
291
- "privacy": "private"
292
- },
293
- {
294
- "kind": "field",
295
- "name": "afterUpdateListeners",
296
- "privacy": "private"
297
- },
298
- {
299
- "kind": "method",
300
- "name": "create",
301
- "privacy": "public",
302
- "return": {
303
- "type": {
304
- "text": "Promise<DatabaseAccessResult.Create<T>>"
305
- }
306
- },
307
- "parameters": [
308
- {
309
- "name": "newValue",
310
- "type": {
311
- "text": "Omit<T, 'id'>"
312
- }
313
- }
314
- ]
315
- },
316
- {
317
- "kind": "method",
318
- "name": "read",
319
- "privacy": "public",
320
- "return": {
321
- "type": {
322
- "text": "Promise<DatabaseAccessResult.Read<T>>"
323
- }
324
- },
325
- "parameters": [
326
- {
327
- "name": "id",
328
- "type": {
329
- "text": "string"
330
- }
331
- }
332
- ]
333
- },
334
- {
335
- "kind": "method",
336
- "name": "update",
337
- "privacy": "public",
338
- "return": {
339
- "type": {
340
- "text": "Promise<DatabaseAccessResult.Update<T>>"
341
- }
342
- },
343
- "parameters": [
344
- {
345
- "name": "id",
346
- "type": {
347
- "text": "string"
348
- }
349
- },
350
- {
351
- "name": "newValue",
352
- "type": {
353
- "text": "Omit<Partial<T>, 'id'>"
354
- }
355
- }
356
- ]
357
- },
358
- {
359
- "kind": "method",
360
- "name": "delete",
361
- "privacy": "public",
362
- "return": {
363
- "type": {
364
- "text": "Promise<DatabaseAccessResult.Delete>"
365
- }
366
- },
367
- "parameters": [
368
- {
369
- "name": "id",
370
- "type": {
371
- "text": "string"
372
- }
373
- }
374
- ]
375
- },
376
- {
377
- "kind": "method",
378
- "name": "visit",
379
- "privacy": "public",
380
- "return": {
381
- "type": {
382
- "text": "Promise<void>"
383
- }
384
- },
385
- "parameters": [
386
- {
387
- "name": "visitor",
388
- "type": {
389
- "text": "(record: T) => void"
390
- }
391
- }
392
- ]
393
- },
394
- {
395
- "kind": "method",
396
- "name": "onBeforeUpdate",
397
- "privacy": "public",
398
- "return": {
399
- "type": {
400
- "text": "() => void"
401
- }
402
- },
403
- "parameters": [
404
- {
405
- "name": "listener",
406
- "type": {
407
- "text": "Listener<DatabaseEvent.BeforeUpdate<T>>"
408
- }
409
- }
410
- ]
411
- },
412
- {
413
- "kind": "method",
414
- "name": "onAfterUpdate",
415
- "privacy": "public",
416
- "return": {
417
- "type": {
418
- "text": "() => void"
419
- }
420
- },
421
- "parameters": [
422
- {
423
- "name": "listener",
424
- "type": {
425
- "text": "Listener<DatabaseEvent.AfterUpdate<T>>"
426
- }
427
- }
428
- ]
429
- }
430
- ]
431
- }
432
- ],
433
- "exports": [
434
- {
435
- "kind": "js",
436
- "name": "InMemoryDatabase",
437
- "declaration": {
438
- "name": "InMemoryDatabase",
439
- "module": "src/data/inMemoryDatabase.ts"
440
- }
441
- }
442
- ]
443
- },
444
- {
445
- "kind": "javascript-module",
446
- "path": "src/data/index.ts",
447
- "declarations": [],
448
- "exports": [
449
- {
450
- "kind": "js",
451
- "name": "*",
452
- "declaration": {
453
- "name": "*",
454
- "package": "./inMemoryDatabase"
455
- }
456
- }
457
- ]
458
- },
459
261
  {
460
262
  "kind": "javascript-module",
461
263
  "path": "src/design-system/design-system.ts",
@@ -694,6 +496,59 @@
694
496
  }
695
497
  ]
696
498
  },
499
+ {
500
+ "kind": "javascript-module",
501
+ "path": "src/decorators/index.ts",
502
+ "declarations": [],
503
+ "exports": [
504
+ {
505
+ "kind": "js",
506
+ "name": "*",
507
+ "declaration": {
508
+ "name": "*",
509
+ "package": "./renderOnChange"
510
+ }
511
+ }
512
+ ]
513
+ },
514
+ {
515
+ "kind": "javascript-module",
516
+ "path": "src/decorators/renderOnChange.ts",
517
+ "declarations": [
518
+ {
519
+ "kind": "function",
520
+ "name": "renderOnChange",
521
+ "parameters": [
522
+ {
523
+ "name": "target",
524
+ "type": {
525
+ "text": "FASTElement & { render(): void }"
526
+ },
527
+ "description": "The target to define the property change handler on."
528
+ },
529
+ {
530
+ "name": "name",
531
+ "type": {
532
+ "text": "string"
533
+ },
534
+ "description": "The property name."
535
+ }
536
+ ],
537
+ "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
538
+ "privacy": "public"
539
+ }
540
+ ],
541
+ "exports": [
542
+ {
543
+ "kind": "js",
544
+ "name": "renderOnChange",
545
+ "declaration": {
546
+ "name": "renderOnChange",
547
+ "module": "src/decorators/renderOnChange.ts"
548
+ }
549
+ }
550
+ ]
551
+ },
697
552
  {
698
553
  "kind": "javascript-module",
699
554
  "path": "src/directives/index.ts",
@@ -719,7 +574,7 @@
719
574
  },
720
575
  {
721
576
  "kind": "javascript-module",
722
- "path": "src/decorators/index.ts",
577
+ "path": "src/encoding/index.ts",
723
578
  "declarations": [],
724
579
  "exports": [
725
580
  {
@@ -727,52 +582,197 @@
727
582
  "name": "*",
728
583
  "declaration": {
729
584
  "name": "*",
730
- "package": "./renderOnChange"
585
+ "package": "./base64"
731
586
  }
732
587
  }
733
588
  ]
734
589
  },
735
590
  {
736
591
  "kind": "javascript-module",
737
- "path": "src/decorators/renderOnChange.ts",
592
+ "path": "src/data/inMemoryDatabase.ts",
738
593
  "declarations": [
739
594
  {
740
- "kind": "function",
741
- "name": "renderOnChange",
742
- "parameters": [
595
+ "kind": "class",
596
+ "description": "An in memory database of specific DatabaseRecord types.",
597
+ "name": "InMemoryDatabase",
598
+ "members": [
743
599
  {
744
- "name": "target",
600
+ "kind": "field",
601
+ "name": "isWorking",
745
602
  "type": {
746
- "text": "FASTElement & { render(): void }"
603
+ "text": "boolean"
747
604
  },
748
- "description": "The target to define the property change handler on."
605
+ "privacy": "public",
606
+ "default": "false"
749
607
  },
750
608
  {
751
- "name": "name",
609
+ "kind": "field",
610
+ "name": "records",
752
611
  "type": {
753
- "text": "string"
612
+ "text": "Record<string, T>"
754
613
  },
755
- "description": "The property name."
614
+ "privacy": "private",
615
+ "default": "{}"
616
+ },
617
+ {
618
+ "kind": "field",
619
+ "name": "beforeUpdateListeners",
620
+ "privacy": "private"
621
+ },
622
+ {
623
+ "kind": "field",
624
+ "name": "afterUpdateListeners",
625
+ "privacy": "private"
626
+ },
627
+ {
628
+ "kind": "method",
629
+ "name": "create",
630
+ "privacy": "public",
631
+ "return": {
632
+ "type": {
633
+ "text": "Promise<DatabaseAccessResult.Create<T>>"
634
+ }
635
+ },
636
+ "parameters": [
637
+ {
638
+ "name": "newValue",
639
+ "type": {
640
+ "text": "Omit<T, 'id'>"
641
+ }
642
+ }
643
+ ]
644
+ },
645
+ {
646
+ "kind": "method",
647
+ "name": "read",
648
+ "privacy": "public",
649
+ "return": {
650
+ "type": {
651
+ "text": "Promise<DatabaseAccessResult.Read<T>>"
652
+ }
653
+ },
654
+ "parameters": [
655
+ {
656
+ "name": "id",
657
+ "type": {
658
+ "text": "string"
659
+ }
660
+ }
661
+ ]
662
+ },
663
+ {
664
+ "kind": "method",
665
+ "name": "update",
666
+ "privacy": "public",
667
+ "return": {
668
+ "type": {
669
+ "text": "Promise<DatabaseAccessResult.Update<T>>"
670
+ }
671
+ },
672
+ "parameters": [
673
+ {
674
+ "name": "id",
675
+ "type": {
676
+ "text": "string"
677
+ }
678
+ },
679
+ {
680
+ "name": "newValue",
681
+ "type": {
682
+ "text": "Omit<Partial<T>, 'id'>"
683
+ }
684
+ }
685
+ ]
686
+ },
687
+ {
688
+ "kind": "method",
689
+ "name": "delete",
690
+ "privacy": "public",
691
+ "return": {
692
+ "type": {
693
+ "text": "Promise<DatabaseAccessResult.Delete>"
694
+ }
695
+ },
696
+ "parameters": [
697
+ {
698
+ "name": "id",
699
+ "type": {
700
+ "text": "string"
701
+ }
702
+ }
703
+ ]
704
+ },
705
+ {
706
+ "kind": "method",
707
+ "name": "visit",
708
+ "privacy": "public",
709
+ "return": {
710
+ "type": {
711
+ "text": "Promise<void>"
712
+ }
713
+ },
714
+ "parameters": [
715
+ {
716
+ "name": "visitor",
717
+ "type": {
718
+ "text": "(record: T) => void"
719
+ }
720
+ }
721
+ ]
722
+ },
723
+ {
724
+ "kind": "method",
725
+ "name": "onBeforeUpdate",
726
+ "privacy": "public",
727
+ "return": {
728
+ "type": {
729
+ "text": "() => void"
730
+ }
731
+ },
732
+ "parameters": [
733
+ {
734
+ "name": "listener",
735
+ "type": {
736
+ "text": "Listener<DatabaseEvent.BeforeUpdate<T>>"
737
+ }
738
+ }
739
+ ]
740
+ },
741
+ {
742
+ "kind": "method",
743
+ "name": "onAfterUpdate",
744
+ "privacy": "public",
745
+ "return": {
746
+ "type": {
747
+ "text": "() => void"
748
+ }
749
+ },
750
+ "parameters": [
751
+ {
752
+ "name": "listener",
753
+ "type": {
754
+ "text": "Listener<DatabaseEvent.AfterUpdate<T>>"
755
+ }
756
+ }
757
+ ]
756
758
  }
757
- ],
758
- "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
759
- "privacy": "public"
759
+ ]
760
760
  }
761
761
  ],
762
762
  "exports": [
763
763
  {
764
764
  "kind": "js",
765
- "name": "renderOnChange",
765
+ "name": "InMemoryDatabase",
766
766
  "declaration": {
767
- "name": "renderOnChange",
768
- "module": "src/decorators/renderOnChange.ts"
767
+ "name": "InMemoryDatabase",
768
+ "module": "src/data/inMemoryDatabase.ts"
769
769
  }
770
770
  }
771
771
  ]
772
772
  },
773
773
  {
774
774
  "kind": "javascript-module",
775
- "path": "src/encoding/index.ts",
775
+ "path": "src/data/index.ts",
776
776
  "declarations": [],
777
777
  "exports": [
778
778
  {
@@ -780,7 +780,7 @@
780
780
  "name": "*",
781
781
  "declaration": {
782
782
  "name": "*",
783
- "package": "./base64"
783
+ "package": "./inMemoryDatabase"
784
784
  }
785
785
  }
786
786
  ]
@@ -32,6 +32,11 @@ export declare const createObserver: <EventType>() => Observer<EventType>;
32
32
  * @param element - HTMLElement to observe
33
33
  * @param callback - any function called when the visibility changes
34
34
  * @returns A cleanup function to disconnect the observer
35
+ * @remarks
36
+ * The observer uses the implicit root, the top-level viewport, so content of an open modal (a
37
+ * `<dialog>` opened with `showModal()`, or a `position: fixed` overlay) is reported as visible when
38
+ * it is on screen. An element is reported as hidden while it is scrolled out of the viewport, and an
39
+ * element inside an iframe is reported as hidden while the iframe itself is off screen.
35
40
  * @public
36
41
  */
37
42
  export declare const respondToVisibility: (element: HTMLElement, callback: (arg0: boolean) => any) => (() => void);
@@ -1 +1 @@
1
- {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../src/observer/observer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,CAAC;AAC1D;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,SAAS,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC;AACjF;;;GAGG;AACH,MAAM,MAAM,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,SAAS;IACjC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,OAAK,QAAQ,CAAC,SAAS,CAW9D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,WAAW,EACpB,UAAU,CAAC,IAAI,EAAE,OAAO,KAAK,GAAG,KAC/B,CAAC,MAAM,IAAI,CAgBb,CAAC"}
1
+ {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../src/observer/observer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,CAAC;AAC1D;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,SAAS,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC;AACjF;;;GAGG;AACH,MAAM,MAAM,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,SAAS;IACjC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,OAAK,QAAQ,CAAC,SAAS,CAW9D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,WAAW,EACpB,UAAU,CAAC,IAAI,EAAE,OAAO,KAAK,GAAG,KAC/B,CAAC,MAAM,IAAI,CAYb,CAAC"}
@@ -19,17 +19,19 @@ export const createObserver = () => {
19
19
  * @param element - HTMLElement to observe
20
20
  * @param callback - any function called when the visibility changes
21
21
  * @returns A cleanup function to disconnect the observer
22
+ * @remarks
23
+ * The observer uses the implicit root, the top-level viewport, so content of an open modal (a
24
+ * `<dialog>` opened with `showModal()`, or a `position: fixed` overlay) is reported as visible when
25
+ * it is on screen. An element is reported as hidden while it is scrolled out of the viewport, and an
26
+ * element inside an iframe is reported as hidden while the iframe itself is off screen.
22
27
  * @public
23
28
  */
24
29
  export const respondToVisibility = (element, callback) => {
25
- const options = {
26
- root: document.documentElement,
27
- };
28
30
  const observer = new IntersectionObserver((entries) => {
29
31
  entries.forEach((entry) => {
30
32
  callback(entry.intersectionRatio > 0);
31
33
  });
32
- }, options);
34
+ });
33
35
  observer.observe(element);
34
36
  return () => {
35
37
  observer.disconnect();
@@ -19589,7 +19589,7 @@
19589
19589
  {
19590
19590
  "kind": "Function",
19591
19591
  "canonicalReference": "@genesislcap/foundation-utils!respondToVisibility:function(1)",
19592
- "docComment": "/**\n * Setup an `IntersectionObserver` which will activate a callback function when an element becomes visible on screen\n *\n * @param element - HTMLElement to observe\n *\n * @param callback - any function called when the visibility changes\n *\n * @returns A cleanup function to disconnect the observer\n *\n * @public\n */\n",
19592
+ "docComment": "/**\n * Setup an `IntersectionObserver` which will activate a callback function when an element becomes visible on screen\n *\n * @remarks\n *\n * The observer uses the implicit root, the top-level viewport, so content of an open modal (a `<dialog>` opened with `showModal()`, or a `position: fixed` overlay) is reported as visible when it is on screen. An element is reported as hidden while it is scrolled out of the viewport, and an element inside an iframe is reported as hidden while the iframe itself is off screen.\n *\n * @param element - HTMLElement to observe\n *\n * @param callback - any function called when the visibility changes\n *\n * @returns A cleanup function to disconnect the observer\n *\n * @public\n */\n",
19593
19593
  "excerptTokens": [
19594
19594
  {
19595
19595
  "kind": "Content",
@@ -2463,6 +2463,11 @@ export declare type ResourceType = (typeof ResourceType)[keyof typeof ResourceTy
2463
2463
  * @param element - HTMLElement to observe
2464
2464
  * @param callback - any function called when the visibility changes
2465
2465
  * @returns A cleanup function to disconnect the observer
2466
+ * @remarks
2467
+ * The observer uses the implicit root, the top-level viewport, so content of an open modal (a
2468
+ * `<dialog>` opened with `showModal()`, or a `position: fixed` overlay) is reported as visible when
2469
+ * it is on screen. An element is reported as hidden while it is scrolled out of the viewport, and an
2470
+ * element inside an iframe is reported as hidden while the iframe itself is off screen.
2466
2471
  * @public
2467
2472
  */
2468
2473
  export declare const respondToVisibility: (element: HTMLElement, callback: (arg0: boolean) => any) => (() => void);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-utils",
3
3
  "description": "Genesis Foundation Utils",
4
- "version": "15.90.0",
4
+ "version": "15.90.1-GENC-1829.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -29,17 +29,17 @@
29
29
  }
30
30
  },
31
31
  "devDependencies": {
32
- "@genesislcap/foundation-testing": "15.90.0",
33
- "@genesislcap/genx": "15.90.0",
34
- "@genesislcap/ts-builder": "15.90.0",
35
- "@genesislcap/uvu-playwright-builder": "15.90.0",
36
- "@genesislcap/vite-builder": "15.90.0",
37
- "@genesislcap/webpack-builder": "15.90.0",
32
+ "@genesislcap/foundation-testing": "15.90.1-GENC-1829.1",
33
+ "@genesislcap/genx": "15.90.1-GENC-1829.1",
34
+ "@genesislcap/ts-builder": "15.90.1-GENC-1829.1",
35
+ "@genesislcap/uvu-playwright-builder": "15.90.1-GENC-1829.1",
36
+ "@genesislcap/vite-builder": "15.90.1-GENC-1829.1",
37
+ "@genesislcap/webpack-builder": "15.90.1-GENC-1829.1",
38
38
  "@types/json-schema": "^7.0.11"
39
39
  },
40
40
  "dependencies": {
41
- "@genesislcap/expression-builder": "15.90.0",
42
- "@genesislcap/foundation-logger": "15.90.0",
41
+ "@genesislcap/expression-builder": "15.90.1-GENC-1829.1",
42
+ "@genesislcap/foundation-logger": "15.90.1-GENC-1829.1",
43
43
  "@microsoft/fast-components": "2.30.6",
44
44
  "@microsoft/fast-element": "1.14.0",
45
45
  "@microsoft/fast-foundation": "2.50.0",