@pgcorp/ui-kit 0.14.0 → 0.15.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/README.md +330 -12
- package/dist/assets/src/components/layout/{SResizeHandle.vue_vue_type_style_index_0_scoped_13b9b27a_lang.css → SResizeHandle.vue_vue_type_style_index_0_scoped_dc65aba1_lang.css} +1 -1
- package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_a108e8f1_scoped_a108e8f1_lang.css +2 -0
- package/dist/assets/src/components/shared/containers/{SCollapsiblePanel.css_vue_type_style_index_0_src_71824088_scoped_71824088_lang.css → SCollapsiblePanel.css_vue_type_style_index_0_src_db85261d_scoped_db85261d_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/{SOverlayHost.css_vue_type_style_index_0_src_8f9be94e_scoped_8f9be94e_lang.css → SOverlayHost.css_vue_type_style_index_0_src_09215628_scoped_09215628_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/{SPopover.css_vue_type_style_index_0_src_4091d007_scoped_4091d007_lang.css → SPopover.css_vue_type_style_index_0_src_a4f1f64a_scoped_a4f1f64a_lang.css} +1 -1
- package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_52396e42_scoped_52396e42_lang.css +2 -0
- package/dist/assets/src/components/shared/controls/SButton.css_vue_type_style_index_0_src_7a5acda9_scoped_7a5acda9_lang.css +1 -1
- package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_2562f916_scoped_2562f916_lang.css +2 -0
- package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_d630c922_scoped_d630c922_lang.css +2 -0
- package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_43b6e378_scoped_43b6e378_lang.css +1 -0
- package/dist/assets/src/components/shared/controls/{SDropdownMenu.css_vue_type_style_index_0_src_857e2649_scoped_857e2649_lang.css → SDropdownMenu.css_vue_type_style_index_0_src_40040ae5_scoped_40040ae5_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/{SMenuSurface.css_vue_type_style_index_0_src_84109ad9_scoped_84109ad9_lang.css → SMenuSurface.css_vue_type_style_index_0_src_d2b7d71b_scoped_d2b7d71b_lang.css} +1 -1
- package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_d1ead6c0_scoped_d1ead6c0_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_a69aa84b_scoped_a69aa84b_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_d94fcf8c_scoped_d94fcf8c_lang.css +2 -0
- package/dist/assets/src/components/shared/data-display/STooltip.css_vue_type_style_index_0_src_true_lang.css +1 -1
- package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_914bad28_scoped_914bad28_lang.css +2 -0
- package/dist/assets/src/components/shared/navigation/{SBottomNav.vue_vue_type_style_index_0_scoped_24be0f2b_lang.css → SBottomNav.vue_vue_type_style_index_0_scoped_68cf84b3_lang.css} +1 -1
- package/dist/src/components/layout/SResizeHandle.vue.js +2 -2
- package/dist/src/components/layout/SResizeHandle.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/src/components/shared/_internal/SDialogSurface.vue.d.ts +9 -1
- package/dist/src/components/shared/_internal/SDialogSurface.vue.js +2 -2
- package/dist/src/components/shared/_internal/SDialogSurface.vue_vue_type_script_setup_true_lang.js +174 -82
- package/dist/src/components/shared/_internal/dialogSurface.d.ts +2 -0
- package/dist/src/components/shared/_internal/dialogSurface.js +30 -27
- package/dist/src/components/shared/_internal/dialogSurfaceMotion.d.ts +14 -0
- package/dist/src/components/shared/_internal/dialogSurfaceMotion.js +84 -0
- package/dist/src/components/shared/_internal/focusTrap.js +15 -13
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue.d.ts +5 -0
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue.js +2 -2
- package/dist/src/components/shared/containers/SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js +123 -121
- package/dist/src/components/shared/containers/SDrawer.vue.d.ts +4 -4
- package/dist/src/components/shared/containers/SDrawer.vue.js +3 -6
- package/dist/src/components/shared/containers/SDrawer.vue_vue_type_script_setup_true_lang.js +104 -128
- package/dist/src/components/shared/containers/SModal.vue.d.ts +8 -8
- package/dist/src/components/shared/containers/SModal.vue.js +3 -6
- package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +87 -103
- package/dist/src/components/shared/containers/SOverlayHost.vue.js +2 -2
- package/dist/src/components/shared/containers/SOverlayHost.vue_vue_type_script_setup_true_lang.js +32 -31
- package/dist/src/components/shared/containers/SPanel.vue.d.ts +1 -1
- package/dist/src/components/shared/containers/SPopover.vue.js +2 -2
- package/dist/src/components/shared/containers/SPopover.vue_vue_type_script_setup_true_lang.js +225 -200
- package/dist/src/components/shared/containers/SSidebarSection.vue.js +2 -2
- package/dist/src/components/shared/containers/SSidebarSection.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/src/components/shared/controls/SCheckbox.vue.js +2 -2
- package/dist/src/components/shared/controls/SCheckbox.vue_vue_type_script_setup_true_lang.js +13 -7
- package/dist/src/components/shared/controls/SCombobox.vue.js +2 -2
- package/dist/src/components/shared/controls/SCombobox.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/src/components/shared/controls/SContextMenu.vue.js +2 -2
- package/dist/src/components/shared/controls/SContextMenu.vue_vue_type_script_setup_true_lang.js +86 -81
- package/dist/src/components/shared/controls/SDropdownMenu.vue.js +2 -2
- package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js +77 -72
- package/dist/src/components/shared/controls/SMenuSurface.vue.js +2 -2
- package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js +81 -77
- package/dist/src/components/shared/controls/SSelect.vue.js +2 -2
- package/dist/src/components/shared/controls/SSelect.vue_vue_type_script_setup_true_lang.js +85 -77
- package/dist/src/components/shared/data-display/SControlledToastViewport.vue.js +2 -2
- package/dist/src/components/shared/data-display/SControlledToastViewport.vue_vue_type_script_setup_true_lang.js +58 -49
- package/dist/src/components/shared/data-display/SScrollViewport.vue.d.ts +10 -5
- package/dist/src/components/shared/data-display/SScrollViewport.vue.js +2 -2
- package/dist/src/components/shared/data-display/SScrollViewport.vue_vue_type_script_setup_true_lang.js +162 -111
- package/dist/src/components/shared/data-display/STooltip.vue_vue_type_script_setup_true_lang.js +276 -224
- package/dist/src/components/shared/data-display/_internal/STableFrame.vue.d.ts +3 -3
- package/dist/src/components/shared/data-display/_internal/STableFrame.vue.js +2 -2
- package/dist/src/components/shared/data-display/_internal/STableFrame.vue_vue_type_script_setup_true_lang.js +62 -46
- package/dist/src/components/shared/data-display/scrollViewport.d.ts +2 -0
- package/dist/src/components/shared/navigation/SBottomNav.vue.js +2 -2
- package/dist/src/components/shared/navigation/SBottomNav.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/src/components/shared/navigation/STabList.vue.d.ts +1 -1
- package/dist/src/composables/useDialogOverlay.d.ts +12 -2
- package/dist/src/composables/useDialogOverlay.js +192 -119
- package/dist/src/internal/flatTree.d.ts +8 -0
- package/dist/src/internal/flatTree.js +23 -0
- package/dist/src/internal/focusNavigation.d.ts +3 -0
- package/dist/src/internal/focusNavigation.js +28 -15
- package/dist/src/internal/inertLease.d.ts +8 -0
- package/dist/src/internal/inertLease.js +33 -0
- package/dist/src/internal/layerStack.d.ts +40 -0
- package/dist/src/internal/layerStack.js +301 -94
- package/dist/src/internal/nativeFocus.d.ts +4 -0
- package/dist/src/internal/nativeFocus.js +12 -0
- package/dist/src/internal/overlayPortal.d.ts +17 -0
- package/dist/src/internal/overlayPortal.js +23 -0
- package/dist/src/internal/semanticSizing.d.ts +2 -2
- package/dist/src/internal/semanticSizing.js +2 -1
- package/dist/src/internal/useMenuLayer.d.ts +1 -0
- package/dist/src/internal/useMenuLayer.js +63 -57
- package/dist/src/internal/viewportModality.d.ts +27 -0
- package/dist/src/internal/viewportModality.js +132 -0
- package/dist/typography.js +17 -62
- package/docs/overlay-lifecycle.md +195 -0
- package/docs/public-api.md +141 -4
- package/docs/resize.md +34 -5
- package/docs/scroll-viewport.md +30 -10
- package/docs/theming.md +42 -8
- package/package.json +1 -1
- package/src/components/shared/_internal/SDialogSurface.css +185 -40
- package/src/components/shared/controls/SButton.css +0 -3
- package/src/components/shared/controls/SCheckbox.css +19 -7
- package/src/components/shared/data-display/SControlledToastViewport.css +2 -10
- package/src/components/shared/data-display/SScrollViewport.css +17 -1
- package/src/components/shared/data-display/STooltip.css +1 -1
- package/src/components/shared/data-display/_internal/STableFrame.css +1 -5
- package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_0e58afdc_scoped_0e58afdc_lang.css +0 -2
- package/dist/assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_61cf20dd_scoped_61cf20dd_lang.css +0 -2
- package/dist/assets/src/components/shared/containers/SModal.css_vue_type_style_index_0_src_42e1bd5f_scoped_42e1bd5f_lang.css +0 -2
- package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_21f71ae8_scoped_21f71ae8_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_55d4826e_scoped_55d4826e_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_537f5744_scoped_537f5744_lang.css +0 -2
- package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_03921269_scoped_03921269_lang.css +0 -1
- package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_df3d6688_scoped_df3d6688_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_5864b6c6_scoped_5864b6c6_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_e5d11342_scoped_e5d11342_lang.css +0 -2
- package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_52b5825e_scoped_52b5825e_lang.css +0 -2
- package/src/components/shared/containers/SDrawer.css +0 -87
- package/src/components/shared/containers/SModal.css +0 -27
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Native flat-tree parent, including explicit assigned slots and exposed shadow roots. */
|
|
2
|
+
export declare function flatTreeParent(node: Node): Node | null;
|
|
3
|
+
/** Rendered element children; shadow content replaces light DOM and slots expose actual assignments. */
|
|
4
|
+
export declare function flatTreeChildren(element: Element, exposedShadow?: ShadowRoot): readonly Element[];
|
|
5
|
+
/** Checks actual native ancestry without giving unassigned light DOM a shadow-surface membership. */
|
|
6
|
+
export declare function flatTreeContains(scope: ParentNode, target: Node): boolean;
|
|
7
|
+
/** Enumerates rendered native descendants in flat-tree order for Tab navigation. */
|
|
8
|
+
export declare function flatTreeElements(root: ParentNode): HTMLElement[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/internal/flatTree.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e instanceof Element && e.assignedSlot ? e.assignedSlot : e instanceof ShadowRoot ? e.host : e.parentNode;
|
|
4
|
+
}
|
|
5
|
+
function t(e, t) {
|
|
6
|
+
if (e instanceof HTMLSlotElement) return e.assignedNodes({ flatten: !0 }).length > 0 ? e.assignedElements({ flatten: !0 }) : [...e.children];
|
|
7
|
+
let n = t ?? e.shadowRoot;
|
|
8
|
+
return [...n ? n.children : e.children];
|
|
9
|
+
}
|
|
10
|
+
function n(t, n) {
|
|
11
|
+
for (let r = n; r; r = e(r)) if (r === t) return !0;
|
|
12
|
+
return !1;
|
|
13
|
+
}
|
|
14
|
+
function r(e) {
|
|
15
|
+
let n = [], r = (e) => {
|
|
16
|
+
e instanceof HTMLElement && n.push(e);
|
|
17
|
+
for (let n of t(e)) r(n);
|
|
18
|
+
}, i = e instanceof Element ? t(e) : [...e.children];
|
|
19
|
+
for (let e of i) r(e);
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { t as flatTreeChildren, n as flatTreeContains, r as flatTreeElements, e as flatTreeParent };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export { nativeFocusChain, nativeFocusedElement } from './nativeFocus';
|
|
1
2
|
/** Проверяет native focus capability независимо от временной видимости ancestor scope. */
|
|
2
3
|
export declare const hasFocusableSemantics: (element: HTMLElement) => boolean;
|
|
3
4
|
/** Проверяет programmatic/browser focus owner без layout-эвристик. / Checks a programmatic/browser focus owner without layout heuristics. */
|
|
4
5
|
export declare const isFocusableElement: (element: HTMLElement) => boolean;
|
|
6
|
+
/** Restored focus also admits explicitly programmatic dialog roots without adding a Tab stop. */
|
|
7
|
+
export declare const isProgrammaticallyFocusableElement: (element: HTMLElement) => boolean;
|
|
5
8
|
/**
|
|
6
9
|
* Поднимает произвольный event target до ближайшего canonical focus owner внутри optional boundary.
|
|
7
10
|
* Lifts an arbitrary event target to the nearest canonical focus owner inside an optional boundary.
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { flatTreeElements as e, flatTreeParent as t } from "./flatTree.js";
|
|
2
|
+
import { nativeFocusedElement as n } from "./nativeFocus.js";
|
|
3
|
+
import { isActualNativeModal as r, isNativeModalBackground as i } from "./viewportModality.js";
|
|
1
4
|
//#region src/internal/focusNavigation.ts
|
|
2
|
-
var
|
|
5
|
+
var a = [
|
|
3
6
|
"a[href]",
|
|
4
7
|
"button:not([disabled])",
|
|
5
8
|
"textarea:not([disabled])",
|
|
@@ -7,20 +10,30 @@ var e = [
|
|
|
7
10
|
"select:not([disabled])",
|
|
8
11
|
"[contenteditable=\"true\"]",
|
|
9
12
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
10
|
-
].join(", "),
|
|
11
|
-
if (
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
].join(", "), o = (e) => {
|
|
14
|
+
if (i(e)) return !1;
|
|
15
|
+
let n = window.getComputedStyle(e);
|
|
16
|
+
if (n.visibility === "hidden" || n.visibility === "collapse") return !1;
|
|
17
|
+
for (let n = e; n;) {
|
|
18
|
+
if (n.matches("[hidden], [aria-hidden=\"true\"]") || n.hasAttribute("inert") || window.getComputedStyle(n).display === "none") return !1;
|
|
19
|
+
if (r(n)) {
|
|
20
|
+
for (let e = t(n); e; e = t(e)) if (e instanceof Element && (e.matches("[hidden], [aria-hidden=\"true\"]") || window.getComputedStyle(e).display === "none")) return !1;
|
|
21
|
+
return !0;
|
|
22
|
+
}
|
|
23
|
+
let e = t(n);
|
|
24
|
+
n = e instanceof Element ? e : e instanceof ShadowRoot ? e.host : null;
|
|
25
|
+
}
|
|
26
|
+
return !0;
|
|
27
|
+
}, s = (e) => e.matches(a), c = (e) => !e.matches(":disabled") && s(e) && o(e), l = (e) => !e.matches(":disabled") && (s(e) || e.matches("[tabindex=\"-1\"]") || r(e)) && o(e), u = (e, t) => {
|
|
28
|
+
let n = (e instanceof Element ? e : e instanceof Node ? e.parentElement : null)?.closest(a) ?? null;
|
|
29
|
+
return !n || !c(n) || t instanceof Node && !t.contains(n) ? null : n;
|
|
30
|
+
}, d = (t, n = {}) => e(t).filter((e) => c(e) ? !n.requireLayout || e.offsetParent !== null || e.getClientRects().length > 0 : !1), f = (e, t, n, r) => {
|
|
31
|
+
let i = d(t).filter((e) => !n?.contains(e));
|
|
19
32
|
if (i.length === 0) return null;
|
|
20
|
-
let
|
|
21
|
-
if (
|
|
22
|
-
let
|
|
23
|
-
return
|
|
33
|
+
let a = i.indexOf(e);
|
|
34
|
+
if (a >= 0) return i[(a + (r ? -1 : 1) + i.length) % i.length] ?? null;
|
|
35
|
+
let o = r ? [...i].reverse() : i, s = r ? Node.DOCUMENT_POSITION_PRECEDING : Node.DOCUMENT_POSITION_FOLLOWING;
|
|
36
|
+
return o.find((t) => !!(e.compareDocumentPosition(t) & s)) ?? o[0] ?? null;
|
|
24
37
|
};
|
|
25
38
|
//#endregion
|
|
26
|
-
export {
|
|
39
|
+
export { u as findFocusableOwner, f as findRelativeTabTarget, d as getFocusableElements, s as hasFocusableSemantics, c as isFocusableElement, l as isProgrammaticallyFocusableElement, n as nativeFocusedElement };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Exact native inert ownership; overlapping owners restore the literal attribute after their last release. */
|
|
2
|
+
export interface InertLease {
|
|
3
|
+
readonly boundary: Element;
|
|
4
|
+
readonly isCurrent: () => boolean;
|
|
5
|
+
readonly release: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** Acquires one exact native boundary without changing aria-hidden or another owner's lifetime. */
|
|
8
|
+
export declare function acquireInertLease(boundary: Element): InertLease;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/internal/inertLease.ts
|
|
2
|
+
var e = /* @__PURE__ */ new WeakMap(), t = (e, t, n) => {
|
|
3
|
+
let r = !1;
|
|
4
|
+
for (let e of n) e.attributeName === "inert" && (t.ownedWrites > 0 ? --t.ownedWrites : r = !0);
|
|
5
|
+
r && (t.previous = e.getAttribute("inert")), t.owners.size > 0 && !e.hasAttribute("inert") && (t.ownedWrites += 1, e.setAttribute("inert", ""));
|
|
6
|
+
};
|
|
7
|
+
function n(n) {
|
|
8
|
+
let r = Symbol("inert-owner"), i = e.get(n);
|
|
9
|
+
if (i) t(n, i, i.observer.takeRecords());
|
|
10
|
+
else {
|
|
11
|
+
let r = new MutationObserver((e) => t(n, a, e)), a = {
|
|
12
|
+
previous: n.getAttribute("inert"),
|
|
13
|
+
owners: /* @__PURE__ */ new Set(),
|
|
14
|
+
observer: r,
|
|
15
|
+
ownedWrites: 0
|
|
16
|
+
};
|
|
17
|
+
r.observe(n, {
|
|
18
|
+
attributes: !0,
|
|
19
|
+
attributeFilter: ["inert"]
|
|
20
|
+
}), i = a, e.set(n, i);
|
|
21
|
+
}
|
|
22
|
+
i.owners.add(r), n.hasAttribute("inert") || (i.ownedWrites += 1, n.setAttribute("inert", ""));
|
|
23
|
+
let a = i;
|
|
24
|
+
return {
|
|
25
|
+
boundary: n,
|
|
26
|
+
isCurrent: () => a.owners.has(r) && e.get(n) === a && n.hasAttribute("inert"),
|
|
27
|
+
release: () => {
|
|
28
|
+
a.owners.has(r) && (t(n, a, a.observer.takeRecords()), !(!a.owners.delete(r) || a.owners.size > 0) && (e.delete(n), a.observer.disconnect(), a.previous === null ? n.removeAttribute("inert") : n.setAttribute("inert", a.previous)));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { n as acquireInertLease };
|
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
export type LayerKind = 'dialog' | 'listbox' | 'menu' | 'popover' | 'tooltip';
|
|
2
2
|
export type LayerDismissReason = 'escape' | 'outside-contextmenu' | 'outside-pointer';
|
|
3
|
+
/** One-cycle native focus authority. Cancellation is idempotent; no consumer-shaped token is accepted. */
|
|
4
|
+
export interface LayerFocusAdmission {
|
|
5
|
+
readonly restoreTarget: HTMLElement | null;
|
|
6
|
+
/** Executes this cycle's exact host acquisition; only that command may authorize source inertness loss. */
|
|
7
|
+
acquireHost: (acquire: () => () => void) => () => void;
|
|
8
|
+
cancel: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface LayerFocusAdmissionOptions {
|
|
11
|
+
/** Exact connected host content whose acquisition can make the captured native source inert. */
|
|
12
|
+
releaseBoundary?: HTMLElement | null;
|
|
13
|
+
}
|
|
3
14
|
export interface LayerRegistrationOptions {
|
|
4
15
|
kind: LayerKind;
|
|
5
16
|
root: () => HTMLElement | null;
|
|
6
17
|
anchor?: () => HTMLElement | null;
|
|
7
18
|
branches?: () => readonly HTMLElement[];
|
|
19
|
+
/** Exact additional modal/portal surfaces; anchors and dismissal branches are not modality roots. */
|
|
20
|
+
/** Actual native viewport owner and its exact direct portal; no div modality substitute. */
|
|
21
|
+
nativeDialog?: {
|
|
22
|
+
readonly subject: HTMLDialogElement;
|
|
23
|
+
readonly portal: () => HTMLElement | null;
|
|
24
|
+
};
|
|
25
|
+
/** Visual inside-pointer surfaces are distinct from a full-viewport semantic root. */
|
|
26
|
+
dismissalRoots?: () => readonly HTMLElement[];
|
|
8
27
|
/** Explicit composition owner; null keeps independent root dialogs outside focus-derived ancestry. */
|
|
9
28
|
parent?: LayerRegistration | null;
|
|
10
29
|
modal?: boolean;
|
|
11
30
|
/** Native event scope for a contained layer; global modal children do not inherit it. */
|
|
12
31
|
eventBoundary?: () => HTMLElement | null;
|
|
13
32
|
restoreTarget?: HTMLElement | null;
|
|
33
|
+
/** Captured before a transient source retires; belongs to this registration only. */
|
|
34
|
+
focusAdmission?: LayerFocusAdmission | null;
|
|
14
35
|
dismissOnEscape?: () => boolean;
|
|
15
36
|
dismissOnOutsidePointer?: () => boolean;
|
|
16
37
|
blocksParentFocusTrap?: boolean;
|
|
@@ -19,12 +40,25 @@ export interface LayerRegistrationOptions {
|
|
|
19
40
|
/** Releases owner UI/subscriptions when its ancestor retires, without a synthetic dismiss event. */
|
|
20
41
|
onRetire?: () => void;
|
|
21
42
|
}
|
|
43
|
+
/** Native focus-loss authority from the last genuine owner; BODY never creates it. */
|
|
44
|
+
export interface LayerOwnedFocusLoss {
|
|
45
|
+
/** True only while the exact owner/revisions survive and its observed source is unavailable. */
|
|
46
|
+
readonly isCurrentUnavailable: () => boolean;
|
|
47
|
+
}
|
|
22
48
|
export interface LayerRegistration {
|
|
23
49
|
readonly id: symbol;
|
|
24
50
|
readonly zIndex: string;
|
|
25
51
|
readonly focusScope: () => ParentNode;
|
|
26
52
|
/** Whether this registration still owns the global topmost focus request. */
|
|
27
53
|
readonly isTopmost: () => boolean;
|
|
54
|
+
/** Reconciles an exact native surface ref mount/replacement before its focus or interaction path. */
|
|
55
|
+
readonly refreshModality: () => void;
|
|
56
|
+
/** Native focus membership includes registered logical descendants, not unrelated layers. */
|
|
57
|
+
readonly containsFocusTarget: (target: Node) => boolean;
|
|
58
|
+
/** Captures only this registration's exact previously observed native focus target. */
|
|
59
|
+
readonly captureOwnedFocusLoss: (target: Element) => LayerOwnedFocusLoss | null;
|
|
60
|
+
/** Claims initial native focus once. External focus and unrelated lifecycle changes deny the claim. */
|
|
61
|
+
readonly claimFocus: (target: HTMLElement) => boolean;
|
|
28
62
|
/** Requests one Tab target, committed by this registration's normal close only. */
|
|
29
63
|
readonly handoffFocus: (target: HTMLElement) => () => void;
|
|
30
64
|
unregister: (options?: {
|
|
@@ -33,6 +67,12 @@ export interface LayerRegistration {
|
|
|
33
67
|
commitFocusHandoff?: boolean;
|
|
34
68
|
}) => void;
|
|
35
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Captures current native intent, including an exact still-pending owned menu return.
|
|
72
|
+
* It does not grant authority from an arbitrary historical BODY state. The snapshot
|
|
73
|
+
* owns observers until claim/cancel; callers must cancel on every abandoned cycle.
|
|
74
|
+
*/
|
|
75
|
+
export declare function captureLayerFocusAdmission(options?: LayerFocusAdmissionOptions): LayerFocusAdmission | null;
|
|
36
76
|
/**
|
|
37
77
|
* Регистрирует одну открытую overlay-поверхность в общем dismiss/focus/body-lock стеке.
|
|
38
78
|
* Registers one open overlay surface in the shared dismiss/focus/body-lock stack.
|