@floegence/floe-webapp-core 0.35.9 → 0.35.10

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.
@@ -1,16 +1,27 @@
1
- import { spread as B, mergeProps as N, insert as l, createComponent as b, memo as te, effect as re, className as ae, setStyleProperty as ie, template as f, setAttribute as $e, use as Se, delegateEvents as Re } from "solid-js/web";
2
- import { splitProps as Ee, createSignal as u, createMemo as k, createEffect as Ae, onCleanup as Ke, Show as W, For as _ } from "solid-js";
3
- import { cn as H } from "../../utils/cn.js";
4
- import { isRepeatableTerminalAction as Ce, DEFAULT_MOBILE_KEYBOARD_QUICK_INSERTS as Oe, applyTerminalModifiers as De, createMobileKeyboardPressTracker as Le, mapTerminalActionToKey as Me } from "./mobileKeyboardModel.js";
5
- import { floeTouchSurfaceAttrs as q, preventTouchSurfacePointerDown as oe } from "../../utils/touchSurfaceGuard.js";
6
- var xe = /* @__PURE__ */ f("<button type=button>"), Be = /* @__PURE__ */ f("<button>Hide"), Ne = /* @__PURE__ */ f('<div class=mobile-keyboard-rail-shell><div class=mobile-keyboard-suggestion-rail role=list aria-label="Terminal suggestions">'), We = /* @__PURE__ */ f('<div><div class=mobile-keyboard-panel><div></div><div class=mobile-keyboard-scroll><div class=mobile-keyboard-rail-shell><div class=mobile-keyboard-top-strip></div></div><div class=mobile-keyboard-main></div><div class=mobile-keyboard-bottom-zone><div class=mobile-keyboard-direction-pad role=group aria-label="Arrow keys">'), He = /* @__PURE__ */ f("<button>"), qe = /* @__PURE__ */ f("<div class=mobile-keyboard-row>");
7
- const Ye = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"], Ue = ["a", "s", "d", "f", "g", "h", "j", "k", "l"], ze = ["z", "x", "c", "v", "b", "n", "m"], Fe = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"], je = ["@", "#", "$", "%", "&", "*", "(", ")", "[", "]"], Qe = ["+", "=", "{", "}", ".", ",", "?", "!", "'"], Ve = [{
1
+ import { spread as V, mergeProps as N, insert as l, createComponent as p, memo as oe, effect as ae, className as se, setStyleProperty as le, template as v, setAttribute as Ae, use as Ce, delegateEvents as Le } from "solid-js/web";
2
+ import { splitProps as Oe, createSignal as y, createMemo as u, createEffect as ne, onCleanup as ce, Show as z, For as _ } from "solid-js";
3
+ import { cn as q } from "../../utils/cn.js";
4
+ import { isRepeatableTerminalAction as Me, DEFAULT_MOBILE_KEYBOARD_QUICK_INSERTS as De, applyTerminalModifiers as xe, createMobileKeyboardPressTracker as We, mapTerminalActionToKey as Be } from "./mobileKeyboardModel.js";
5
+ import { floeTouchSurfaceAttrs as Y, preventTouchSurfacePointerDown as de } from "../../utils/touchSurfaceGuard.js";
6
+ import { buildMobileKeyboardViewportStyle as He, resolveMobileKeyboardViewportMetrics as Ve } from "./mobileKeyboardViewport.js";
7
+ var Ne = /* @__PURE__ */ v("<button type=button>"), ze = /* @__PURE__ */ v("<button>Hide"), qe = /* @__PURE__ */ v('<div class=mobile-keyboard-rail-shell><div class=mobile-keyboard-suggestion-rail role=list aria-label="Terminal suggestions">'), Ye = /* @__PURE__ */ v('<div><div class=mobile-keyboard-panel><div></div><div class=mobile-keyboard-scroll><div class=mobile-keyboard-rail-shell><div class=mobile-keyboard-top-strip></div></div><div class=mobile-keyboard-main></div><div class=mobile-keyboard-bottom-zone><div class=mobile-keyboard-direction-pad role=group aria-label="Arrow keys">'), Ue = /* @__PURE__ */ v("<button>"), je = /* @__PURE__ */ v("<div class=mobile-keyboard-row>");
8
+ function Fe(I, i) {
9
+ if (typeof i == "string") {
10
+ const $ = Object.entries(I).filter(([, c]) => c).map(([c, E]) => `${c}: ${E}`).join("; ");
11
+ return $ ? `${i}; ${$}` : i;
12
+ }
13
+ return {
14
+ ...i ?? {},
15
+ ...I
16
+ };
17
+ }
18
+ const Qe = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"], Ge = ["a", "s", "d", "f", "g", "h", "j", "k", "l"], Je = ["z", "x", "c", "v", "b", "n", "m"], Xe = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"], Ze = ["@", "#", "$", "%", "&", "*", "(", ")", "[", "]"], et = ["+", "=", "{", "}", ".", ",", "?", "!", "'"], tt = [{
8
19
  action: "escape",
9
20
  label: "Esc"
10
21
  }, {
11
22
  action: "tab",
12
23
  label: "Tab"
13
- }], Ge = [{
24
+ }], rt = [{
14
25
  action: "arrow-up",
15
26
  label: "↑",
16
27
  position: "up"
@@ -26,254 +37,274 @@ const Ye = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"], Ue = ["a", "s", "
26
37
  action: "arrow-right",
27
38
  label: "→",
28
39
  position: "right"
29
- }], Je = 320, Xe = 68;
30
- function it(le) {
31
- const [n, se] = Ee(le, ["visible", "onKey", "onDismiss", "quickInserts", "suggestions", "onSuggestionSelect", "class"]), [g, Y] = u("letters"), [U, S] = u(!1), [z, R] = u(!1), [F, E] = u(!1), [ne, j] = u([]), [h, A] = u(null), ce = k(() => new Set(ne()));
32
- let K, v;
33
- const c = Le(), I = /* @__PURE__ */ new Map(), de = () => n.quickInserts ?? Oe, C = k(() => n.suggestions ?? []), Q = () => {
34
- S(!1), R(!1), E(!1);
40
+ }], it = 320, ot = 68;
41
+ function bt(I) {
42
+ const [i, $] = Oe(I, ["visible", "onKey", "onDismiss", "quickInserts", "suggestions", "onSuggestionSelect", "class", "style"]), [c, E] = y("letters"), [U, R] = y(!1), [j, A] = y(!1), [F, C] = y(!1), [be, Q] = y([]), [w, L] = y(null), [pe, G] = y({}), me = u(() => new Set(be()));
43
+ let O, h;
44
+ const d = We(), S = /* @__PURE__ */ new Map(), ye = () => i.quickInserts ?? De, M = u(() => i.suggestions ?? []), ue = u(() => Fe(pe(), i.style)), J = () => {
45
+ R(!1), A(!1), C(!1);
35
46
  }, P = () => {
36
- v && (clearTimeout(v), v = void 0);
37
- }, O = () => {
38
- j(c.getPressedKeyIds());
47
+ h && (clearTimeout(h), h = void 0);
48
+ }, D = () => {
49
+ Q(d.getPressedKeyIds());
39
50
  }, T = (e) => {
40
- const t = I.get(e);
41
- t && (t.delayTimer && clearTimeout(t.delayTimer), t.intervalTimer && clearInterval(t.intervalTimer), I.delete(e));
42
- }, V = () => {
43
- for (const e of I.keys())
51
+ const t = S.get(e);
52
+ t && (t.delayTimer && clearTimeout(t.delayTimer), t.intervalTimer && clearInterval(t.intervalTimer), S.delete(e));
53
+ }, X = () => {
54
+ for (const e of S.keys())
44
55
  T(e);
45
- }, be = () => {
46
- Y("letters"), Q(), c.reset(), j([]), A(null), P(), V();
47
- }, G = (e) => {
48
- e && n.onKey?.(e);
49
- }, pe = (e) => {
50
- G(De(e, {
56
+ }, fe = () => {
57
+ E("letters"), J(), d.reset(), Q([]), L(null), P(), X();
58
+ }, Z = (e) => {
59
+ e && i.onKey?.(e);
60
+ }, ke = (e) => {
61
+ Z(xe(e, {
51
62
  ctrl: U(),
52
- alt: z()
53
- })), Q();
54
- }, me = (e) => {
55
- G(Me(e)), S(!1), R(!1);
56
- }, D = (e) => g() !== "letters" ? e : F() ? e.toUpperCase() : e, ye = (e) => {
63
+ alt: j()
64
+ })), J();
65
+ }, ve = (e) => {
66
+ Z(Be(e)), R(!1), A(!1);
67
+ }, x = (e) => c() !== "letters" ? e : F() ? e.toUpperCase() : e, we = (e) => {
57
68
  switch (e) {
58
69
  case "ctrl":
59
- S((t) => !t);
70
+ R((t) => !t);
60
71
  return;
61
72
  case "alt":
62
- R((t) => !t);
73
+ A((t) => !t);
63
74
  return;
64
75
  case "shift":
65
- E((t) => !t);
76
+ C((t) => !t);
66
77
  }
67
- }, ue = (e) => {
68
- Y(e), E(!1);
69
- }, ke = (e, t, r) => {
70
- const s = K?.getBoundingClientRect(), i = r.getBoundingClientRect();
71
- P(), s && A({
78
+ }, he = (e) => {
79
+ E(e), C(!1);
80
+ }, Te = (e, t, r) => {
81
+ const n = O?.getBoundingClientRect(), a = r.getBoundingClientRect();
82
+ P(), n && L({
72
83
  pointerId: e,
73
84
  label: t,
74
- left: i.left - s.left + i.width / 2,
75
- top: i.top - s.top,
85
+ left: a.left - n.left + a.width / 2,
86
+ top: a.top - n.top,
76
87
  visible: !0
77
88
  });
78
- }, J = (e) => {
79
- h()?.pointerId === e && (P(), v = setTimeout(() => {
80
- A((t) => t?.pointerId === e ? {
89
+ }, ee = (e) => {
90
+ w()?.pointerId === e && (P(), h = setTimeout(() => {
91
+ L((t) => t?.pointerId === e ? {
81
92
  ...t,
82
93
  visible: !1
83
- } : t), v = void 0;
94
+ } : t), h = void 0;
84
95
  }, 100));
85
- }, fe = (e, t, r, s) => {
96
+ }, ge = (e, t, r, n) => {
86
97
  if (T(e), !r || typeof window > "u") return;
87
- const i = {};
88
- I.set(e, i), i.delayTimer = setTimeout(() => {
89
- i.delayTimer = void 0, c.hasPress(e, t) && (c.markRepeated(e), s(), i.intervalTimer = setInterval(() => {
90
- if (!c.hasPress(e, t)) {
98
+ const a = {};
99
+ S.set(e, a), a.delayTimer = setTimeout(() => {
100
+ a.delayTimer = void 0, d.hasPress(e, t) && (d.markRepeated(e), n(), a.intervalTimer = setInterval(() => {
101
+ if (!d.hasPress(e, t)) {
91
102
  T(e);
92
103
  return;
93
104
  }
94
- s();
95
- }, Xe));
96
- }, Je);
97
- }, he = (e, t) => {
98
- t.preventDefault(), t.currentTarget.setPointerCapture?.(t.pointerId), c.startPress(t.pointerId, e.keyId), O(), ke(t.pointerId, e.label, t.currentTarget), fe(t.pointerId, e.keyId, e.repeatable, e.activate);
99
- }, ve = (e, t) => {
105
+ n();
106
+ }, ot));
107
+ }, it);
108
+ }, _e = (e, t) => {
109
+ t.preventDefault(), t.currentTarget.setPointerCapture?.(t.pointerId), d.startPress(t.pointerId, e.keyId), D(), Te(t.pointerId, e.label, t.currentTarget), ge(t.pointerId, e.keyId, e.repeatable, e.activate);
110
+ }, Ie = (e, t) => {
100
111
  t.currentTarget.releasePointerCapture?.(t.pointerId), T(t.pointerId);
101
- const r = c.finishPress(t.pointerId, e.keyId);
102
- O(), J(t.pointerId), r.shouldActivate && e.activate();
103
- }, Te = (e) => {
104
- e.currentTarget.releasePointerCapture?.(e.pointerId), T(e.pointerId), c.cancelPress(e.pointerId), O(), J(e.pointerId);
105
- }, we = (e, t) => {
112
+ const r = d.finishPress(t.pointerId, e.keyId);
113
+ D(), ee(t.pointerId), r.shouldActivate && e.activate();
114
+ }, $e = (e) => {
115
+ e.currentTarget.releasePointerCapture?.(e.pointerId), T(e.pointerId), d.cancelPress(e.pointerId), D(), ee(e.pointerId);
116
+ }, Ee = (e, t) => {
106
117
  t.detail === 0 && e.activate();
107
- }, d = (e, t) => ({
118
+ }, b = (e, t) => ({
108
119
  keyId: t?.keyId ?? `text-${e}`,
109
120
  label: t?.label ?? e,
110
121
  repeatable: !1,
111
- activate: () => pe(e),
122
+ activate: () => ke(e),
112
123
  width: t?.width,
113
124
  class: t?.class,
114
125
  kind: "text"
115
- }), w = (e, t, r) => ({
126
+ }), g = (e, t, r) => ({
116
127
  keyId: r?.keyId ?? `action-${e}`,
117
128
  label: t,
118
- repeatable: r?.repeatable ?? Ce(e),
119
- activate: () => me(e),
129
+ repeatable: r?.repeatable ?? Me(e),
130
+ activate: () => ve(e),
120
131
  width: r?.width,
121
132
  class: r?.class,
122
133
  kind: "terminal"
123
- }), L = (e, t, r) => ({
134
+ }), W = (e, t, r) => ({
124
135
  keyId: `modifier-${e}`,
125
136
  label: t,
126
137
  repeatable: !1,
127
- activate: () => ye(e),
138
+ activate: () => we(e),
128
139
  width: e === "shift" ? "wide" : "normal",
129
- active: e === "ctrl" ? U() : e === "alt" ? z() : F(),
140
+ active: e === "ctrl" ? U() : e === "alt" ? j() : F(),
130
141
  kind: "modifier",
131
142
  class: r?.class
132
- }), _e = k(() => [...Ve.map((e) => w(e.action, e.label, {
143
+ }), Se = u(() => [...tt.map((e) => g(e.action, e.label, {
133
144
  class: "mobile-keyboard-key-compact"
134
- })), L("ctrl", "Ctrl", {
145
+ })), W("ctrl", "Ctrl", {
135
146
  class: "mobile-keyboard-key-compact"
136
- }), L("alt", "Alt", {
147
+ }), W("alt", "Alt", {
137
148
  class: "mobile-keyboard-key-compact"
138
- }), ...de().map((e) => d(e, {
149
+ }), ...ye().map((e) => b(e, {
139
150
  keyId: `quick-${e}`,
140
151
  class: "mobile-keyboard-key-compact mobile-keyboard-key-utility"
141
- }))]), ge = k(() => g() === "symbols" ? [Fe.map((e) => d(e)), je.map((e) => d(e)), [...Qe.map((e) => d(e)), w("backspace", "⌫", {
152
+ }))]), Pe = u(() => c() === "symbols" ? [Xe.map((e) => b(e)), Ze.map((e) => b(e)), [...et.map((e) => b(e)), g("backspace", "⌫", {
142
153
  width: "wide",
143
154
  class: "mobile-keyboard-key-backspace"
144
- })]] : [Ye.map((e) => d(D(e), {
155
+ })]] : [Qe.map((e) => b(x(e), {
145
156
  keyId: `letter-${e}`
146
- })), Ue.map((e) => d(D(e), {
157
+ })), Ge.map((e) => b(x(e), {
147
158
  keyId: `letter-${e}`
148
- })), [L("shift", "Shift"), ...ze.map((e) => d(D(e), {
159
+ })), [W("shift", "Shift"), ...Je.map((e) => b(x(e), {
149
160
  keyId: `letter-${e}`
150
- })), w("backspace", "⌫", {
161
+ })), g("backspace", "⌫", {
151
162
  width: "wide",
152
163
  class: "mobile-keyboard-key-backspace"
153
- })]]), M = k(() => [{
164
+ })]]), B = u(() => [{
154
165
  keyId: "mode-switch",
155
- label: g() === "letters" ? "123" : "ABC",
166
+ label: c() === "letters" ? "123" : "ABC",
156
167
  repeatable: !1,
157
- activate: () => ue(g() === "letters" ? "symbols" : "letters"),
168
+ activate: () => he(c() === "letters" ? "symbols" : "letters"),
158
169
  width: "wide",
159
170
  kind: "mode",
160
171
  class: "mobile-keyboard-key-bottom-mode"
161
- }, d(" ", {
172
+ }, b(" ", {
162
173
  keyId: "space",
163
174
  label: "Space",
164
175
  width: "space",
165
176
  class: "mobile-keyboard-key-bottom-space"
166
- }), w("enter", "Enter", {
177
+ }), g("enter", "Enter", {
167
178
  width: "wide",
168
179
  class: "mobile-keyboard-key-bottom-enter"
169
- })]), Ie = k(() => Ge.map((e) => w(e.action, e.label, {
180
+ })]), Ke = u(() => rt.map((e) => g(e.action, e.label, {
170
181
  class: `mobile-keyboard-direction-key mobile-keyboard-direction-key-${e.position}`
171
- }))), m = (e) => (() => {
172
- var t = xe();
173
- return t.$$click = (r) => we(e, r), t.addEventListener("pointercancel", Te), t.$$pointerup = (r) => ve(e, r), t.$$pointerdown = (r) => he(e, r), l(t, () => e.label), re((r) => {
174
- var s = H("mobile-keyboard-key", e.kind === "terminal" && "mobile-keyboard-key-terminal", e.kind === "modifier" && "mobile-keyboard-key-modifier", e.kind === "mode" && "mobile-keyboard-key-mode", e.width === "wide" && "mobile-keyboard-key-wide", e.width === "space" && "mobile-keyboard-key-space", e.active && "mobile-keyboard-key-active", ce().has(e.keyId) && "mobile-keyboard-key-pressed", e.class), i = e.active;
175
- return s !== r.e && ae(t, r.e = s), i !== r.t && $e(t, "aria-pressed", r.t = i), r;
182
+ }))), f = (e) => (() => {
183
+ var t = Ne();
184
+ return t.$$click = (r) => Ee(e, r), t.addEventListener("pointercancel", $e), t.$$pointerup = (r) => Ie(e, r), t.$$pointerdown = (r) => _e(e, r), l(t, () => e.label), ae((r) => {
185
+ var n = q("mobile-keyboard-key", e.kind === "terminal" && "mobile-keyboard-key-terminal", e.kind === "modifier" && "mobile-keyboard-key-modifier", e.kind === "mode" && "mobile-keyboard-key-mode", e.width === "wide" && "mobile-keyboard-key-wide", e.width === "space" && "mobile-keyboard-key-space", e.active && "mobile-keyboard-key-active", me().has(e.keyId) && "mobile-keyboard-key-pressed", e.class), a = e.active;
186
+ return n !== r.e && se(t, r.e = n), a !== r.t && Ae(t, "aria-pressed", r.t = a), r;
176
187
  }, {
177
188
  e: void 0,
178
189
  t: void 0
179
190
  }), t;
180
- })(), X = () => b(W, {
191
+ })(), te = () => p(z, {
181
192
  get when() {
182
- return n.onDismiss;
193
+ return i.onDismiss;
183
194
  },
184
195
  get children() {
185
- var e = Be();
186
- return B(e, N(q, {
196
+ var e = ze();
197
+ return V(e, N(Y, {
187
198
  type: "button",
188
199
  class: "mobile-keyboard-dismiss",
189
200
  "aria-label": "Close keyboard",
190
201
  onPointerDown: (t) => {
191
- oe(t), t.stopPropagation();
202
+ de(t), t.stopPropagation();
192
203
  },
193
204
  onClick: (t) => {
194
- t.stopPropagation(), n.onDismiss?.();
205
+ t.stopPropagation(), i.onDismiss?.();
195
206
  }
196
207
  }), !1, !0), e;
197
208
  }
198
209
  });
199
- return Ae(() => {
200
- n.visible || be();
201
- }), Ke(() => {
202
- P(), V();
210
+ return ne(() => {
211
+ i.visible || fe();
212
+ }), ne(() => {
213
+ if (typeof window > "u" || !i.visible) {
214
+ G({});
215
+ return;
216
+ }
217
+ const e = () => {
218
+ G(He(Ve({
219
+ innerWidth: window.innerWidth,
220
+ innerHeight: window.innerHeight,
221
+ visualViewport: window.visualViewport
222
+ })));
223
+ };
224
+ e();
225
+ const t = window.visualViewport;
226
+ window.addEventListener("resize", e), window.addEventListener("orientationchange", e), t?.addEventListener("resize", e), t?.addEventListener("scroll", e), ce(() => {
227
+ window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e), t?.removeEventListener("resize", e), t?.removeEventListener("scroll", e);
228
+ });
229
+ }), ce(() => {
230
+ P(), X();
203
231
  }), (() => {
204
- var e = We(), t = e.firstChild, r = t.firstChild, s = r.nextSibling, i = s.firstChild, Pe = i.firstChild, Z = i.nextSibling, $ = Z.nextSibling, x = $.firstChild;
205
- B(e, N(q, {
232
+ var e = Ye(), t = e.firstChild, r = t.firstChild, n = r.nextSibling, a = n.firstChild, Re = a.firstChild, re = a.nextSibling, K = re.nextSibling, H = K.firstChild;
233
+ V(e, N(Y, {
206
234
  get class() {
207
- return H("mobile-keyboard-root", n.visible && "mobile-keyboard-visible", n.class);
235
+ return q("mobile-keyboard-root", i.visible && "mobile-keyboard-visible", i.class);
236
+ },
237
+ get style() {
238
+ return ue();
208
239
  },
209
240
  get "aria-hidden"() {
210
- return !n.visible;
241
+ return !i.visible;
211
242
  },
212
243
  role: "group",
213
244
  "aria-label": "Mobile terminal keyboard"
214
- }, se), !1, !0);
215
- var ee = K;
216
- return typeof ee == "function" ? Se(ee, t) : K = t, l(r, () => h()?.label ?? ""), l(s, b(W, {
245
+ }, $), !1, !0);
246
+ var ie = O;
247
+ return typeof ie == "function" ? Ce(ie, t) : O = t, l(r, () => w()?.label ?? ""), l(n, p(z, {
217
248
  get when() {
218
- return C().length > 0;
249
+ return M().length > 0;
219
250
  },
220
251
  get children() {
221
- var a = Ne(), p = a.firstChild;
222
- return l(p, b(_, {
252
+ var o = qe(), m = o.firstChild;
253
+ return l(m, p(_, {
223
254
  get each() {
224
- return C();
255
+ return M();
225
256
  },
226
- children: (o) => (() => {
227
- var y = He();
228
- return B(y, N(q, {
257
+ children: (s) => (() => {
258
+ var k = Ue();
259
+ return V(k, N(Y, {
229
260
  type: "button",
230
261
  class: "mobile-keyboard-suggestion",
231
262
  get "data-kind"() {
232
- return o.kind;
263
+ return s.kind;
233
264
  },
234
265
  get title() {
235
- return o.detail ?? o.label;
266
+ return s.detail ?? s.label;
236
267
  },
237
268
  get "aria-label"() {
238
- return te(() => !!o.detail)() ? `${o.label} (${o.detail})` : o.label;
269
+ return oe(() => !!s.detail)() ? `${s.label} (${s.detail})` : s.label;
239
270
  },
240
- onPointerDown: oe,
241
- onClick: () => n.onSuggestionSelect?.(o)
242
- }), !1, !0), l(y, () => o.label), y;
271
+ onPointerDown: de,
272
+ onClick: () => i.onSuggestionSelect?.(s)
273
+ }), !1, !0), l(k, () => s.label), k;
243
274
  })()
244
- })), l(a, X, null), a;
275
+ })), l(o, te, null), o;
245
276
  }
246
- }), i), l(Pe, b(_, {
277
+ }), a), l(Re, p(_, {
247
278
  get each() {
248
- return _e();
279
+ return Se();
249
280
  },
250
- children: (a) => m(a)
251
- })), l(i, b(W, {
281
+ children: (o) => f(o)
282
+ })), l(a, p(z, {
252
283
  get when() {
253
- return te(() => !!n.onDismiss)() && C().length === 0;
284
+ return oe(() => !!i.onDismiss)() && M().length === 0;
254
285
  },
255
286
  get children() {
256
- return X();
287
+ return te();
257
288
  }
258
- }), null), l(Z, b(_, {
289
+ }), null), l(re, p(_, {
259
290
  get each() {
260
- return ge();
291
+ return Pe();
261
292
  },
262
- children: (a) => (() => {
263
- var p = qe();
264
- return l(p, b(_, {
265
- each: a,
266
- children: (o) => m(o)
267
- })), p;
293
+ children: (o) => (() => {
294
+ var m = je();
295
+ return l(m, p(_, {
296
+ each: o,
297
+ children: (s) => f(s)
298
+ })), m;
268
299
  })()
269
- })), l($, () => m(M()[0]), x), l($, () => m(M()[1]), x), l(x, b(_, {
300
+ })), l(K, () => f(B()[0]), H), l(K, () => f(B()[1]), H), l(H, p(_, {
270
301
  get each() {
271
- return Ie();
302
+ return Ke();
272
303
  },
273
- children: (a) => m(a)
274
- })), l($, () => m(M()[2]), null), re((a) => {
275
- var p = H("mobile-keyboard-popup", h()?.visible && "mobile-keyboard-popup-visible"), o = `${h()?.left ?? 0}px`, y = `${h()?.top ?? 0}px`;
276
- return p !== a.e && ae(r, a.e = p), o !== a.t && ie(r, "left", a.t = o), y !== a.a && ie(r, "top", a.a = y), a;
304
+ children: (o) => f(o)
305
+ })), l(K, () => f(B()[2]), null), ae((o) => {
306
+ var m = q("mobile-keyboard-popup", w()?.visible && "mobile-keyboard-popup-visible"), s = `${w()?.left ?? 0}px`, k = `${w()?.top ?? 0}px`;
307
+ return m !== o.e && se(r, o.e = m), s !== o.t && le(r, "left", o.t = s), k !== o.a && le(r, "top", o.a = k), o;
277
308
  }, {
278
309
  e: void 0,
279
310
  t: void 0,
@@ -281,7 +312,7 @@ function it(le) {
281
312
  }), e;
282
313
  })();
283
314
  }
284
- Re(["pointerdown", "pointerup", "click"]);
315
+ Le(["pointerdown", "pointerup", "click"]);
285
316
  export {
286
- it as MobileKeyboard
317
+ bt as MobileKeyboard
287
318
  };
@@ -0,0 +1,18 @@
1
+ export interface MobileKeyboardViewportSource {
2
+ innerWidth: number;
3
+ innerHeight: number;
4
+ visualViewport?: {
5
+ width?: number;
6
+ height?: number;
7
+ offsetLeft?: number;
8
+ offsetTop?: number;
9
+ } | null;
10
+ }
11
+ export interface MobileKeyboardViewportMetrics {
12
+ leftPx: number;
13
+ bottomPx: number;
14
+ widthPx: number;
15
+ heightPx: number;
16
+ }
17
+ export declare function resolveMobileKeyboardViewportMetrics(source: MobileKeyboardViewportSource): MobileKeyboardViewportMetrics;
18
+ export declare function buildMobileKeyboardViewportStyle(metrics: MobileKeyboardViewportMetrics): Record<string, string>;
@@ -0,0 +1,42 @@
1
+ function n(t) {
2
+ return Math.round(t * 1e3) / 1e3;
3
+ }
4
+ function i(t, o, e) {
5
+ return Math.min(e, Math.max(o, t));
6
+ }
7
+ function x(t, o) {
8
+ return Number.isFinite(t) ? Number(t) : o;
9
+ }
10
+ function a(t, o) {
11
+ const e = x(t, o);
12
+ return e <= 0 ? Math.max(0, n(o)) : n(e);
13
+ }
14
+ function l(t) {
15
+ const o = Math.max(0, a(t.innerWidth, 0)), e = Math.max(0, a(t.innerHeight, 0)), r = t.visualViewport ?? null, u = i(
16
+ a(r?.width, o),
17
+ 0,
18
+ o || Number.POSITIVE_INFINITY
19
+ ), h = i(
20
+ a(r?.height, e),
21
+ 0,
22
+ e || Number.POSITIVE_INFINITY
23
+ ), P = Math.max(0, o - u), b = Math.max(0, e - h), m = i(n(x(r?.offsetLeft, 0)), 0, P), I = i(n(x(r?.offsetTop, 0)), 0, b), p = i(n(e - (I + h)), 0, e);
24
+ return {
25
+ leftPx: m,
26
+ bottomPx: p,
27
+ widthPx: u,
28
+ heightPx: h
29
+ };
30
+ }
31
+ function s(t) {
32
+ return {
33
+ "--mobile-keyboard-viewport-left": `${t.leftPx}px`,
34
+ "--mobile-keyboard-viewport-bottom": `${t.bottomPx}px`,
35
+ "--mobile-keyboard-viewport-width": `${t.widthPx}px`,
36
+ "--mobile-keyboard-viewport-height": `${t.heightPx}px`
37
+ };
38
+ }
39
+ export {
40
+ s as buildMobileKeyboardViewportStyle,
41
+ l as resolveMobileKeyboardViewportMetrics
42
+ };