@genesislcap/foundation-utils 15.88.2 → 15.89.0-canary.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.
@@ -509,6 +509,44 @@
509
509
  }
510
510
  ]
511
511
  },
512
+ {
513
+ "kind": "javascript-module",
514
+ "path": "src/directives/index.ts",
515
+ "declarations": [],
516
+ "exports": [
517
+ {
518
+ "kind": "js",
519
+ "name": "*",
520
+ "declaration": {
521
+ "name": "*",
522
+ "package": "./sync"
523
+ }
524
+ },
525
+ {
526
+ "kind": "js",
527
+ "name": "*",
528
+ "declaration": {
529
+ "name": "*",
530
+ "package": "./when-else"
531
+ }
532
+ }
533
+ ]
534
+ },
535
+ {
536
+ "kind": "javascript-module",
537
+ "path": "src/encoding/index.ts",
538
+ "declarations": [],
539
+ "exports": [
540
+ {
541
+ "kind": "js",
542
+ "name": "*",
543
+ "declaration": {
544
+ "name": "*",
545
+ "package": "./base64"
546
+ }
547
+ }
548
+ ]
549
+ },
512
550
  {
513
551
  "kind": "javascript-module",
514
552
  "path": "src/design-system/design-system.ts",
@@ -747,44 +785,6 @@
747
785
  }
748
786
  ]
749
787
  },
750
- {
751
- "kind": "javascript-module",
752
- "path": "src/directives/index.ts",
753
- "declarations": [],
754
- "exports": [
755
- {
756
- "kind": "js",
757
- "name": "*",
758
- "declaration": {
759
- "name": "*",
760
- "package": "./sync"
761
- }
762
- },
763
- {
764
- "kind": "js",
765
- "name": "*",
766
- "declaration": {
767
- "name": "*",
768
- "package": "./when-else"
769
- }
770
- }
771
- ]
772
- },
773
- {
774
- "kind": "javascript-module",
775
- "path": "src/encoding/index.ts",
776
- "declarations": [],
777
- "exports": [
778
- {
779
- "kind": "js",
780
- "name": "*",
781
- "declaration": {
782
- "name": "*",
783
- "package": "./base64"
784
- }
785
- }
786
- ]
787
- },
788
788
  {
789
789
  "kind": "javascript-module",
790
790
  "path": "src/env/index.ts",
@@ -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 default (implicit) root, i.e. the top-level viewport. An explicit
37
+ * `root: document.documentElement` reports elements outside its containing block chain as never
38
+ * intersecting, which includes content of an open modal (a `<dialog>` opened with `showModal()` in
39
+ * the top layer, or a `position: fixed` overlay), so the callback stayed at `false` there.
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 default (implicit) root, i.e. the top-level viewport. An explicit
24
+ * `root: document.documentElement` reports elements outside its containing block chain as never
25
+ * intersecting, which includes content of an open modal (a `<dialog>` opened with `showModal()` in
26
+ * the top layer, or a `position: fixed` overlay), so the callback stayed at `false` there.
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 default (implicit) root, i.e. the top-level viewport. An explicit `root: document.documentElement` reports elements outside its containing block chain as never intersecting, which includes content of an open modal (a `<dialog>` opened with `showModal()` in the top layer, or a `position: fixed` overlay), so the callback stayed at `false` there.\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 default (implicit) root, i.e. the top-level viewport. An explicit
2468
+ * `root: document.documentElement` reports elements outside its containing block chain as never
2469
+ * intersecting, which includes content of an open modal (a `<dialog>` opened with `showModal()` in
2470
+ * the top layer, or a `position: fixed` overlay), so the callback stayed at `false` there.
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.88.2",
4
+ "version": "15.89.0-canary.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.88.2",
33
- "@genesislcap/genx": "15.88.2",
34
- "@genesislcap/ts-builder": "15.88.2",
35
- "@genesislcap/uvu-playwright-builder": "15.88.2",
36
- "@genesislcap/vite-builder": "15.88.2",
37
- "@genesislcap/webpack-builder": "15.88.2",
32
+ "@genesislcap/foundation-testing": "15.89.0-canary.1",
33
+ "@genesislcap/genx": "15.89.0-canary.1",
34
+ "@genesislcap/ts-builder": "15.89.0-canary.1",
35
+ "@genesislcap/uvu-playwright-builder": "15.89.0-canary.1",
36
+ "@genesislcap/vite-builder": "15.89.0-canary.1",
37
+ "@genesislcap/webpack-builder": "15.89.0-canary.1",
38
38
  "@types/json-schema": "^7.0.11"
39
39
  },
40
40
  "dependencies": {
41
- "@genesislcap/expression-builder": "15.88.2",
42
- "@genesislcap/foundation-logger": "15.88.2",
41
+ "@genesislcap/expression-builder": "15.89.0-canary.1",
42
+ "@genesislcap/foundation-logger": "15.89.0-canary.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",