@abyss-project/commons-front-core 20.2.0 → 20.3.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.
@@ -12,8 +12,8 @@
12
12
  export declare const dialogFootClearance: (restingTop: number) => number;
13
13
  /**
14
14
  * While `active`, keeps `DIALOG_FOOT_CLEARANCE_VAR` on the toast region up to date. The variable
15
- * lives on the region alone: `--abyss-toast-clearance` and the modal clearance belong to the cookie
16
- * banner, which removes them when it leaves. The region stays a child of `body`, so nothing here
15
+ * lives on the region alone: `--abyss-toast-clearance` belongs to the clearance registry (the largest
16
+ * claim, banner included) and the modal clearance to the cookie banner, which removes it when it leaves. The region stays a child of `body`, so nothing here
17
17
  * depends on what the surface's style does to `position: fixed`.
18
18
  */
19
19
  export declare const useDialogFootClearance: (region: HTMLElement | null, active: boolean) => void;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The distances, in px, that the things fixed to the bottom of the viewport claim for the toast
3
+ * region. Each caller owns one symbol key; the value published on `--abyss-toast-clearance` is the
4
+ * largest current claim, and the property is removed when no claim is left. Releasing a key never
5
+ * erases another caller's claim.
6
+ */
7
+ export declare class ToastClearanceRegistry {
8
+ private readonly claims;
9
+ claim(key: symbol, distance: number): void;
10
+ release(key: symbol): void;
11
+ private publish;
12
+ }
13
+ /** The one registry of the page: the variable it writes lives on the document root. */
14
+ export declare const toastClearanceRegistry: ToastClearanceRegistry;
@@ -1,7 +1,8 @@
1
1
  /**
2
- * The distance, from the bottom of the viewport, up to the top of what already occupies the bottom
3
- * right corner (the cookie-consent banner). The toast region keeps above it, so a notification
4
- * never covers the banner. Unset while nothing occupies the corner.
2
+ * The distance, from the bottom of the viewport, up to the top of the highest thing that already
3
+ * occupies the bottom (the cookie-consent banner, a screen's fixed bar): the largest claim of the
4
+ * clearance registry, written by it alone. The toast region keeps above it, so a notification never
5
+ * covers them. Unset while nothing claims.
5
6
  */
6
7
  export declare const TOAST_CLEARANCE_VAR = "--abyss-toast-clearance";
7
8
  /**
@@ -1,4 +1,4 @@
1
- import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-iQ9XTosT.js";
1
+ import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-BPBNaNNI.js";
2
2
  import { f as p } from "./Surface-DmHRzUtQ.js";
3
3
  export {
4
4
  o as AbyssCookieConsentProvider,
@@ -11,3 +11,4 @@ export * from './use-scroll-overflow-cue.hook';
11
11
  export * from './use-service-tour.hook';
12
12
  export * from './use-file-drop-target.hook';
13
13
  export * from './use-optimistic-mutation.hook';
14
+ export * from './use-toast-clearance.hook';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Tells the toast region that something fixed to the bottom of the viewport occupies `px` pixels
3
+ * (measured from the bottom edge), so a toast sits above it. The claim lasts while the calling
4
+ * component is mounted and `px` is positive; the toast keeps above the largest claim of the page,
5
+ * the cookie-consent banner included, and releasing one claim never erases another.
6
+ */
7
+ export declare const useToastClearance: (px: number | null | undefined) => void;
8
+ /**
9
+ * Measures an element, from its top to the bottom of the viewport (a bar at `bottom: 0` counts
10
+ * with its safe-area padding), and claims that distance for the toast region while `active` and
11
+ * attached. It follows the element's resize and the window's. Returns a callback ref to put on the
12
+ * element: an element attached after the hook, or remounted, is measured as soon as it is there.
13
+ */
14
+ export declare const useElementToastClearance: (active?: boolean) => ((element: HTMLElement | null) => void);
@@ -0,0 +1 @@
1
+ export {};