@orioncactuscorp/ui 1.16.0 → 1.18.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/CHANGELOG.md +164 -0
- package/README.md +55 -14
- package/dist/components/ActionArea/ActionArea.css +1 -1
- package/dist/components/ActionArea/ActionArea.js +56 -55
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Badge/Badge.js +45 -40
- package/dist/components/Badge/Badge.module.scss.js +9 -8
- package/dist/components/Fieldset/Fieldset.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +582 -563
- package/dist/components/Modal/Modal.module.scss.js +59 -57
- package/dist/components/Modal/blockSize.js +7 -0
- package/dist/components/Modal/cssTime.js +11 -0
- package/dist/components/Modal/fieldReveal.js +57 -0
- package/dist/components/Modal/headerTapScroll.js +10 -0
- package/dist/components/Modal/keyboardEditable.js +31 -0
- package/dist/components/Modal/keyboardInsetMemory.js +24 -0
- package/dist/components/Modal/keyboardSession.js +46 -73
- package/dist/components/Modal/modalResizeTarget.js +28 -0
- package/dist/components/Modal/modalScrollArbitration.js +69 -80
- package/dist/components/Modal/scrollportScroller.js +43 -0
- package/dist/components/Modal/tapCaret.js +32 -0
- package/dist/components/Modal/useBottomSheetIntrinsicHeight.js +58 -0
- package/dist/components/Modal/useFieldReveal.js +81 -0
- package/dist/components/Modal/useMeasuredElement.js +20 -0
- package/dist/components/Modal/useModalContentBlockTransition.js +128 -49
- package/dist/components/Modal/useModalContentSizeSignal.js +30 -0
- package/dist/components/Modal/useModalDrag.js +1136 -1056
- package/dist/components/Modal/useModalKeyboardAvoidance.js +200 -117
- package/dist/components/Modal/useModalViewportGeometry.js +35 -19
- package/dist/components/PositionSnap/policy.js +40 -43
- package/dist/components/internal/ModalPresentation.js +1 -1
- package/dist/styles.css +5 -5
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -1
- package/dist/ui/src/components/Badge/Badge.d.ts.map +1 -1
- package/dist/ui/src/components/Badge/types.d.ts +1 -1
- package/dist/ui/src/components/Badge/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts +2 -2
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.test.utils.d.ts +12 -0
- package/dist/ui/src/components/Modal/Modal.test.utils.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/blockSize.d.ts +2 -0
- package/dist/ui/src/components/Modal/blockSize.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/contexts.d.ts +6 -0
- package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/cssTime.d.ts +4 -0
- package/dist/ui/src/components/Modal/cssTime.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/fieldReveal.d.ts +18 -0
- package/dist/ui/src/components/Modal/fieldReveal.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/headerTapScroll.d.ts +5 -0
- package/dist/ui/src/components/Modal/headerTapScroll.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/keyboardEditable.d.ts +6 -0
- package/dist/ui/src/components/Modal/keyboardEditable.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/keyboardInsetMemory.d.ts +5 -0
- package/dist/ui/src/components/Modal/keyboardInsetMemory.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/keyboardSession.d.ts +4 -11
- package/dist/ui/src/components/Modal/keyboardSession.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/modalResizeTarget.d.ts +12 -0
- package/dist/ui/src/components/Modal/modalResizeTarget.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/scrollportScroller.d.ts +20 -0
- package/dist/ui/src/components/Modal/scrollportScroller.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/tapCaret.d.ts +10 -0
- package/dist/ui/src/components/Modal/tapCaret.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/types.d.ts +6 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useBottomSheetIntrinsicHeight.d.ts +28 -0
- package/dist/ui/src/components/Modal/useBottomSheetIntrinsicHeight.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useFieldReveal.d.ts +28 -0
- package/dist/ui/src/components/Modal/useFieldReveal.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/{useElementSize.d.ts → useMeasuredElement.d.ts} +1 -1
- package/dist/ui/src/components/Modal/useMeasuredElement.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts +20 -1
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalContentSizeSignal.d.ts +22 -0
- package/dist/ui/src/components/Modal/useModalContentSizeSignal.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts +6 -1
- package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts +1 -0
- package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts.map +1 -1
- package/dist/ui/src/components/PositionSnap/policy.d.ts.map +1 -1
- package/dist/ui/src/utils/gesture.d.ts +58 -0
- package/dist/ui/src/utils/gesture.d.ts.map +1 -0
- package/dist/utils/gesture.d.ts +2 -0
- package/dist/utils/gesture.js +103 -0
- package/docs/api-conventions.md +5 -0
- package/docs/gesture.md +64 -0
- package/docs/selector-contract.md +41 -10
- package/docs/spring.md +4 -0
- package/package.json +5 -1
- package/dist/components/Modal/useElementSize.js +0 -23
- package/dist/ui/src/components/Modal/useElementSize.d.ts.map +0 -1
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import './Modal.css';const o = "oc-Modal-module__trigger__B-N3y", a = "oc-Modal-module__backdrop__jYpTA", e = "oc-Modal-module__viewport__8dW9u", n = "oc-Modal-module__surfaceMotion__fJnTQ", _ = "oc-Modal-module__initialFocusTitle__eIZKr", l = "oc-Modal-
|
|
1
|
+
import './Modal.css';const o = "oc-Modal-module__trigger__B-N3y", a = "oc-Modal-module__backdrop__jYpTA", e = "oc-Modal-module__viewport__8dW9u", n = "oc-Modal-module__surfaceMotion__fJnTQ", _ = "oc-Modal-module__initialFocusTitle__eIZKr", l = "oc-Modal-module__bodyContainer__t57Y6", d = "oc-Modal-module__bottomFill__wKrvv", t = "oc-Modal-module__surface__FnAX8", i = "oc-Modal-module__feedbackOdd__auvRQ", c = "oc-Modal-module__feedbackEven__xT95f", r = "oc-Modal-module__header__NS30G", m = "oc-Modal-module__footer__Oyz-R", s = "oc-Modal-module__small__qdBEU", u = "oc-Modal-module__medium__JRDXg", g = "oc-Modal-module__large__O42Af", v = "oc-Modal-module__fixed__Gj1Dv", M = "oc-Modal-module__navigationSection__oHkbv", h = "oc-Modal-module__handleArea__cLoTW", f = "oc-Modal-module__handle__Fan4V", b = "oc-Modal-module__headerInner__F5nxn", T = "oc-Modal-module__headerLeading__v735-", k = "oc-Modal-module__headerTrailing__hQamr", y = "oc-Modal-module__headerTitle__tJ2Qv", F = "oc-Modal-module__headerBottom__g-Jta", P = "oc-Modal-module__close__058gy", I = "oc-Modal-module__navigationDialogTitle__vkGhC", p = "oc-Modal-module__navigationHeading__XioS6", j = "oc-Modal-module__navigation__ldQt-", S = "oc-Modal-module__navigationTitle__ncfjD", C = "oc-Modal-module__navigationIndicator__swRE1", D = "oc-Modal-module__navigationPanel__conuU", R = "oc-Modal-module__navigationPanelScroll__UO-ue", x = "oc-Modal-module__navigationPanelFrame__RljMi", A = "oc-Modal-module__navigationPanelInner__k0D4f", O = "oc-Modal-module__body__3zIj9", w = "oc-Modal-module__bodyContent__fRK23", B = {
|
|
2
2
|
trigger: o,
|
|
3
3
|
backdrop: a,
|
|
4
4
|
viewport: e,
|
|
5
5
|
surfaceMotion: n,
|
|
6
6
|
initialFocusTitle: _,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
bodyContainer: l,
|
|
8
|
+
bottomFill: d,
|
|
9
|
+
surface: t,
|
|
10
|
+
feedbackOdd: i,
|
|
10
11
|
"oc-modal-reject-shake": "oc-Modal-module__oc-modal-reject-shake__RJrNe",
|
|
11
|
-
feedbackEven:
|
|
12
|
+
feedbackEven: c,
|
|
12
13
|
"oc-modal-reject-shake-replay": "oc-Modal-module__oc-modal-reject-shake-replay__cbWGX",
|
|
13
|
-
header:
|
|
14
|
-
footer:
|
|
15
|
-
small:
|
|
16
|
-
medium:
|
|
14
|
+
header: r,
|
|
15
|
+
footer: m,
|
|
16
|
+
small: s,
|
|
17
|
+
medium: u,
|
|
17
18
|
large: g,
|
|
18
|
-
fixed:
|
|
19
|
-
navigationSection:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
fixed: v,
|
|
20
|
+
navigationSection: M,
|
|
21
|
+
handleArea: h,
|
|
22
|
+
handle: f,
|
|
23
|
+
headerInner: b,
|
|
24
|
+
headerLeading: T,
|
|
25
|
+
headerTrailing: k,
|
|
26
|
+
headerTitle: y,
|
|
27
|
+
headerBottom: F,
|
|
28
|
+
close: P,
|
|
29
|
+
navigationDialogTitle: I,
|
|
30
|
+
navigationHeading: p,
|
|
31
|
+
navigation: j,
|
|
32
|
+
navigationTitle: S,
|
|
33
|
+
navigationIndicator: C,
|
|
34
|
+
navigationPanel: D,
|
|
35
|
+
navigationPanelScroll: R,
|
|
36
|
+
navigationPanelFrame: x,
|
|
37
|
+
navigationPanelInner: A,
|
|
38
|
+
body: O,
|
|
38
39
|
bodyContent: w
|
|
39
40
|
};
|
|
40
41
|
export {
|
|
41
42
|
a as backdrop,
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
O as body,
|
|
44
|
+
l as bodyContainer,
|
|
44
45
|
w as bodyContent,
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
d as bottomFill,
|
|
47
|
+
P as close,
|
|
47
48
|
B as default,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
T as
|
|
58
|
-
|
|
49
|
+
c as feedbackEven,
|
|
50
|
+
i as feedbackOdd,
|
|
51
|
+
v as fixed,
|
|
52
|
+
m as footer,
|
|
53
|
+
f as handle,
|
|
54
|
+
h as handleArea,
|
|
55
|
+
r as header,
|
|
56
|
+
F as headerBottom,
|
|
57
|
+
b as headerInner,
|
|
58
|
+
T as headerLeading,
|
|
59
|
+
y as headerTitle,
|
|
60
|
+
k as headerTrailing,
|
|
59
61
|
_ as initialFocusTitle,
|
|
60
62
|
g as large,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
u as medium,
|
|
64
|
+
j as navigation,
|
|
65
|
+
I as navigationDialogTitle,
|
|
66
|
+
p as navigationHeading,
|
|
67
|
+
C as navigationIndicator,
|
|
68
|
+
D as navigationPanel,
|
|
69
|
+
x as navigationPanelFrame,
|
|
70
|
+
A as navigationPanelInner,
|
|
71
|
+
R as navigationPanelScroll,
|
|
72
|
+
M as navigationSection,
|
|
73
|
+
S as navigationTitle,
|
|
74
|
+
s as small,
|
|
75
|
+
t as surface,
|
|
74
76
|
n as surfaceMotion,
|
|
75
77
|
o as trigger,
|
|
76
78
|
e as viewport
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function s(t) {
|
|
2
|
+
const e = t.trim();
|
|
3
|
+
return e.endsWith("ms") ? Number.parseFloat(e) || 0 : e.endsWith("s") ? (Number.parseFloat(e) || 0) * 1e3 : 0;
|
|
4
|
+
}
|
|
5
|
+
function i(t) {
|
|
6
|
+
return t.split(",").reduce((e, r) => Math.max(e, s(r)), 0);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
i as getMaxCssTimeMs,
|
|
10
|
+
s as parseCssTimeMs
|
|
11
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const E = 16, d = 48;
|
|
2
|
+
function i({
|
|
3
|
+
labelRects: e,
|
|
4
|
+
targetRect: t
|
|
5
|
+
}) {
|
|
6
|
+
let n = t.top;
|
|
7
|
+
for (const o of e) {
|
|
8
|
+
const l = t.top - o.bottom;
|
|
9
|
+
o.top < n && l >= 0 && l <= 48 && (n = o.top);
|
|
10
|
+
}
|
|
11
|
+
return { bottom: t.bottom, top: n };
|
|
12
|
+
}
|
|
13
|
+
function b(e) {
|
|
14
|
+
const t = /* @__PURE__ */ new Set();
|
|
15
|
+
(e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) && e.labels && e.labels.forEach((o) => t.add(o));
|
|
16
|
+
const n = e.getAttribute("aria-labelledby");
|
|
17
|
+
if (n)
|
|
18
|
+
for (const o of n.split(/\s+/)) {
|
|
19
|
+
const l = o ? e.ownerDocument.getElementById(o) : null;
|
|
20
|
+
l instanceof HTMLElement && t.add(l);
|
|
21
|
+
}
|
|
22
|
+
return Array.from(t);
|
|
23
|
+
}
|
|
24
|
+
function f(e) {
|
|
25
|
+
return i({
|
|
26
|
+
labelRects: b(e).map(
|
|
27
|
+
(t) => t.getBoundingClientRect()
|
|
28
|
+
),
|
|
29
|
+
targetRect: e.getBoundingClientRect()
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function A(e) {
|
|
33
|
+
const t = Number.parseFloat(e ?? "");
|
|
34
|
+
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
35
|
+
}
|
|
36
|
+
function m({
|
|
37
|
+
bodyRect: e,
|
|
38
|
+
clearanceInset: t,
|
|
39
|
+
footerHeight: n,
|
|
40
|
+
revealed: o,
|
|
41
|
+
scrollPaddingStart: l,
|
|
42
|
+
targetRect: s
|
|
43
|
+
}) {
|
|
44
|
+
const r = e.top + l, a = s.top - r;
|
|
45
|
+
if (!o) return a;
|
|
46
|
+
const c = e.bottom - t - n;
|
|
47
|
+
return s.bottom > c - 16 || s.top < r ? a : 0;
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
d as KEYBOARD_REVEAL_LABEL_MAX_GAP,
|
|
51
|
+
E as KEYBOARD_REVEAL_SCROLL_PADDING,
|
|
52
|
+
b as getKeyboardRevealLabels,
|
|
53
|
+
i as getKeyboardRevealRect,
|
|
54
|
+
m as getKeyboardRevealScrollDelta,
|
|
55
|
+
f as getKeyboardRevealTargetRect,
|
|
56
|
+
A as parseScrollPadding
|
|
57
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const o = /* @__PURE__ */ new Set([
|
|
2
|
+
"email",
|
|
3
|
+
"number",
|
|
4
|
+
"password",
|
|
5
|
+
"search",
|
|
6
|
+
"tel",
|
|
7
|
+
"text",
|
|
8
|
+
"url"
|
|
9
|
+
]), i = /* @__PURE__ */ new Set(["decimal", "numeric", "tel"]), r = /* @__PURE__ */ new Set(["number", "tel"]);
|
|
10
|
+
function t(e) {
|
|
11
|
+
return !(e instanceof HTMLElement) || e.hasAttribute("disabled") || e.getAttribute("inputmode")?.toLowerCase() === "none" ? !1 : e.isContentEditable ? !0 : !(e instanceof HTMLInputElement) && !(e instanceof HTMLTextAreaElement) || e.readOnly ? !1 : e instanceof HTMLTextAreaElement ? !0 : o.has(e.type.toLowerCase());
|
|
12
|
+
}
|
|
13
|
+
function u(e) {
|
|
14
|
+
if (t(e)) return e;
|
|
15
|
+
if (!(e instanceof HTMLElement)) return null;
|
|
16
|
+
const n = e.closest("label")?.control ?? null;
|
|
17
|
+
return t(n) ? n : null;
|
|
18
|
+
}
|
|
19
|
+
function s(e) {
|
|
20
|
+
const n = e.getAttribute("inputmode")?.toLowerCase();
|
|
21
|
+
return n !== void 0 && n !== "" ? i.has(n) ? "numeric" : "text" : e instanceof HTMLInputElement && r.has(e.type.toLowerCase()) ? "numeric" : "text";
|
|
22
|
+
}
|
|
23
|
+
function l(e) {
|
|
24
|
+
return e.navigator.maxTouchPoints > 0 && typeof e.matchMedia == "function" && e.matchMedia("(pointer: coarse)").matches;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
s as getKeyboardClass,
|
|
28
|
+
u as getTapEditable,
|
|
29
|
+
l as hasSoftKeyboardEnvironment,
|
|
30
|
+
t as isKeyboardEditable
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const r = /* @__PURE__ */ new Map();
|
|
2
|
+
function d(o, s, e) {
|
|
3
|
+
const t = Math.round(o), n = r.get(t) ?? {};
|
|
4
|
+
r.set(t, {
|
|
5
|
+
...n,
|
|
6
|
+
[s]: e
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function c(o, s) {
|
|
10
|
+
const e = r.get(
|
|
11
|
+
Math.round(o)
|
|
12
|
+
);
|
|
13
|
+
if (!e) return;
|
|
14
|
+
const t = e[s];
|
|
15
|
+
if (t !== void 0) return t;
|
|
16
|
+
const n = Object.values(e).filter(
|
|
17
|
+
(a) => a !== void 0
|
|
18
|
+
);
|
|
19
|
+
return n.length > 0 ? Math.max(...n) : void 0;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
c as getSeedKeyboardInset,
|
|
23
|
+
d as recordMeasuredKeyboardInset
|
|
24
|
+
};
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
"number",
|
|
4
|
-
"password",
|
|
5
|
-
"search",
|
|
6
|
-
"tel",
|
|
7
|
-
"text",
|
|
8
|
-
"url"
|
|
9
|
-
]), i = /* @__PURE__ */ new Map();
|
|
10
|
-
function l(t, e) {
|
|
11
|
-
i.set(Math.round(t), e);
|
|
12
|
-
}
|
|
13
|
-
function b(t) {
|
|
14
|
-
return i.get(Math.round(t));
|
|
15
|
-
}
|
|
16
|
-
function c(t, e) {
|
|
1
|
+
const h = 80, u = 2;
|
|
2
|
+
function f(t, e) {
|
|
17
3
|
switch (e.type) {
|
|
18
4
|
case "focus": {
|
|
19
|
-
const { geometry:
|
|
20
|
-
return t &&
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
const { geometry: a, keyboardClass: r, target: i } = e;
|
|
6
|
+
return t && Math.abs(t.baselineWidth - a.width) < 80 ? {
|
|
7
|
+
...t,
|
|
8
|
+
baselineHeight: Math.max(t.baselineHeight, a.height),
|
|
9
|
+
baselineWidth: a.width,
|
|
10
|
+
keyboardClass: r,
|
|
11
|
+
phase: "active",
|
|
12
|
+
target: i
|
|
13
|
+
} : {
|
|
14
|
+
baselineHeight: a.height,
|
|
15
|
+
baselineOffsetLeft: a.offsetLeft,
|
|
16
|
+
baselineOffsetTop: a.offsetTop,
|
|
17
|
+
baselineWidth: a.width,
|
|
18
|
+
keyboardClass: r,
|
|
25
19
|
phase: "active",
|
|
26
20
|
sawKeyboard: !1,
|
|
27
|
-
target:
|
|
21
|
+
target: i
|
|
28
22
|
};
|
|
29
23
|
}
|
|
30
24
|
case "retain":
|
|
31
|
-
return t && {
|
|
25
|
+
return t && {
|
|
26
|
+
...t,
|
|
27
|
+
keyboardClass: e.keyboardClass,
|
|
28
|
+
phase: "active",
|
|
29
|
+
target: e.target
|
|
30
|
+
};
|
|
32
31
|
case "close":
|
|
33
32
|
return t && { ...t, phase: "closing", target: null };
|
|
34
33
|
case "measure":
|
|
@@ -37,68 +36,42 @@ function c(t, e) {
|
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
|
-
function
|
|
41
|
-
return !(t instanceof HTMLElement) || t.hasAttribute("disabled") ? !1 : t.isContentEditable || t.tagName === "TEXTAREA" ? !0 : t.tagName !== "INPUT" ? !1 : u.has(
|
|
42
|
-
(t.getAttribute("type") ?? "text").toLowerCase()
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
function o(t, e) {
|
|
39
|
+
function n(t, e) {
|
|
46
40
|
return !t || !e || Math.abs(t.baselineWidth - e.width) < 80;
|
|
47
41
|
}
|
|
48
|
-
function
|
|
42
|
+
function l(t, e) {
|
|
49
43
|
return Math.abs(t.baselineHeight - e.height) <= 2;
|
|
50
44
|
}
|
|
51
|
-
function
|
|
52
|
-
return !t || //
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
45
|
+
function c(t, e) {
|
|
46
|
+
return !t || // Blur is the only "keyboard will hide" signal the page gets: iOS reports
|
|
47
|
+
// the restored geometry in one sample only after its whole dismissal
|
|
48
|
+
// choreography (~0.5s). A closing session targets the resting inset at
|
|
49
|
+
// once and the footer glides down over that span (see the closing
|
|
50
|
+
// transition in Modal.module.scss) instead of waiting for the sample.
|
|
51
|
+
t.phase === "closing" || !e || !n(t, e) ? 0 : Math.max(0, t.baselineHeight - e.height);
|
|
56
52
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
return e;
|
|
60
|
-
const n = Math.max(t.baselineHeight, e.height);
|
|
61
|
-
return t.phase !== "closing" ? { ...e, height: n } : {
|
|
53
|
+
function o(t, e) {
|
|
54
|
+
return !t || !e || !n(t, e) ? e : {
|
|
62
55
|
...e,
|
|
63
|
-
height:
|
|
64
|
-
// A closing session targets the resting pan at once so the container
|
|
65
|
-
// glides back in step with the keyboard and the inset drop, instead of
|
|
66
|
-
// chasing WebKit's late restore samples and stranding the sheet offset
|
|
67
|
-
// until a terminal snap.
|
|
68
|
-
offsetLeft: t.baselineOffsetLeft,
|
|
69
|
-
offsetTop: t.baselineOffsetTop
|
|
56
|
+
height: Math.max(t.baselineHeight, e.height)
|
|
70
57
|
};
|
|
71
58
|
}
|
|
72
|
-
function
|
|
73
|
-
bodyRect: t,
|
|
74
|
-
clearanceInset: e,
|
|
75
|
-
footerHeight: n,
|
|
76
|
-
targetRect: r
|
|
77
|
-
}) {
|
|
78
|
-
const a = t.bottom - e - n;
|
|
79
|
-
return r.bottom > a - 16 ? r.bottom - a + 16 : r.top < t.top + 16 ? r.top - t.top - 16 : 0;
|
|
80
|
-
}
|
|
81
|
-
function A(t) {
|
|
59
|
+
function b(t) {
|
|
82
60
|
return t !== null && typeof t.getAnimations == "function" && typeof CSSTransition < "u";
|
|
83
61
|
}
|
|
84
|
-
function
|
|
62
|
+
function E(t) {
|
|
85
63
|
return t.getAnimations({ subtree: !0 }).some(
|
|
86
64
|
(e) => e instanceof CSSTransition && e.transitionProperty === "transform" && e.playState === "running"
|
|
87
65
|
);
|
|
88
66
|
}
|
|
89
67
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
o as isSessionGeometryCompatible,
|
|
100
|
-
_ as isSessionGeometryRestored,
|
|
101
|
-
c as keyboardSessionReducer,
|
|
102
|
-
l as recordMeasuredKeyboardInset,
|
|
103
|
-
A as supportsTransitionSettleDetection
|
|
68
|
+
u as KEYBOARD_VIEWPORT_RESTORE_EPSILON,
|
|
69
|
+
h as KEYBOARD_VIEWPORT_WIDTH_CHANGE_THRESHOLD,
|
|
70
|
+
c as getKeyboardInset,
|
|
71
|
+
o as getSessionStableViewportGeometry,
|
|
72
|
+
E as hasRunningTransformTransition,
|
|
73
|
+
n as isSessionGeometryCompatible,
|
|
74
|
+
l as isSessionGeometryRestored,
|
|
75
|
+
f as keyboardSessionReducer,
|
|
76
|
+
b as supportsTransitionSettleDetection
|
|
104
77
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const r = "--oc-modal-resize-target-scrollport-height", o = '[data-oc-modal-resizing="true"]';
|
|
2
|
+
function s(e, t) {
|
|
3
|
+
e.dataset.ocModalResizing = "true", t !== null && e.style.setProperty(
|
|
4
|
+
r,
|
|
5
|
+
`${t}px`
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
function i(e) {
|
|
9
|
+
delete e.dataset.ocModalResizing, e.style.removeProperty(r);
|
|
10
|
+
}
|
|
11
|
+
function l(e) {
|
|
12
|
+
return e.dataset.ocModalResizing === "true";
|
|
13
|
+
}
|
|
14
|
+
function n(e) {
|
|
15
|
+
const t = e.closest(o);
|
|
16
|
+
if (!t) return null;
|
|
17
|
+
const a = Number.parseFloat(
|
|
18
|
+
t.style.getPropertyValue(r)
|
|
19
|
+
);
|
|
20
|
+
return Number.isFinite(a) ? a : null;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
r as MODAL_RESIZE_TARGET_SCROLLPORT_HEIGHT_PROPERTY,
|
|
24
|
+
i as clearModalResizeTarget,
|
|
25
|
+
l as isModalResizeTargetPublished,
|
|
26
|
+
s as publishModalResizeTarget,
|
|
27
|
+
n as readModalResizeTarget
|
|
28
|
+
};
|