@unisim/sdk 0.202.0 → 0.203.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.
Files changed (56) hide show
  1. package/README.md +82 -0
  2. package/dist/i18n.d.ts.map +1 -1
  3. package/dist/i18n.js +32 -0
  4. package/dist/i18n.js.map +1 -1
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/phone/BottomSheet.d.ts +40 -0
  10. package/dist/phone/BottomSheet.d.ts.map +1 -0
  11. package/dist/phone/BottomSheet.js +51 -0
  12. package/dist/phone/BottomSheet.js.map +1 -0
  13. package/dist/phone/PhonePage.d.ts +46 -0
  14. package/dist/phone/PhonePage.d.ts.map +1 -0
  15. package/dist/phone/PhonePage.js +52 -0
  16. package/dist/phone/PhonePage.js.map +1 -0
  17. package/dist/phone/dialogs.d.ts +43 -0
  18. package/dist/phone/dialogs.d.ts.map +1 -0
  19. package/dist/phone/dialogs.js +128 -0
  20. package/dist/phone/dialogs.js.map +1 -0
  21. package/dist/phone/edgeSwipe.d.ts +18 -0
  22. package/dist/phone/edgeSwipe.d.ts.map +1 -0
  23. package/dist/phone/edgeSwipe.js +190 -0
  24. package/dist/phone/edgeSwipe.js.map +1 -0
  25. package/dist/phone/gestures.d.ts +60 -0
  26. package/dist/phone/gestures.d.ts.map +1 -0
  27. package/dist/phone/gestures.js +329 -0
  28. package/dist/phone/gestures.js.map +1 -0
  29. package/dist/phone/index.d.ts +16 -0
  30. package/dist/phone/index.d.ts.map +1 -0
  31. package/dist/phone/index.js +15 -0
  32. package/dist/phone/index.js.map +1 -0
  33. package/dist/phone/layers.d.ts +44 -0
  34. package/dist/phone/layers.d.ts.map +1 -0
  35. package/dist/phone/layers.js +225 -0
  36. package/dist/phone/layers.js.map +1 -0
  37. package/dist/phone/scrollHint.d.ts +22 -0
  38. package/dist/phone/scrollHint.d.ts.map +1 -0
  39. package/dist/phone/scrollHint.js +81 -0
  40. package/dist/phone/scrollHint.js.map +1 -0
  41. package/dist/phone/shared.d.ts +24 -0
  42. package/dist/phone/shared.d.ts.map +1 -0
  43. package/dist/phone/shared.js +59 -0
  44. package/dist/phone/shared.js.map +1 -0
  45. package/dist/phone/styles.d.ts +11 -0
  46. package/dist/phone/styles.d.ts.map +1 -0
  47. package/dist/phone/styles.js +139 -0
  48. package/dist/phone/styles.js.map +1 -0
  49. package/dist/phone/text.d.ts +6 -0
  50. package/dist/phone/text.d.ts.map +1 -0
  51. package/dist/phone/text.js +15 -0
  52. package/dist/phone/text.js.map +1 -0
  53. package/dist/revealOnExpand.d.ts.map +1 -1
  54. package/dist/revealOnExpand.js +28 -1
  55. package/dist/revealOnExpand.js.map +1 -1
  56. package/package.json +6 -1
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // <BottomSheet> — a sheet that rises from the bottom over a scrim: what a
4
+ // website popup or menu becomes in the phone apps (store-listings README §7).
5
+ //
6
+ // Ways to close it, all the same step: a tap on the scrim; the grip dragged
7
+ // down (past a third, or flicked); a BIG swipe down anywhere on it, from the
8
+ // top of its scroll (BRANDING.md ▸ "A big swipe down closes a drawer"); Back
9
+ // (Android's gesture, the browser's); Escape. A SHORTER pull puts the finger
10
+ // in its first text box, keyboard up, and the sheet stays (▸ "…a short pull
11
+ // puts you in its box").
12
+ //
13
+ // Reconciled from Universal PDF (`Sheet`, the original), Images / Converter /
14
+ // Compress (`Sheet`), BlackBook (`Sheet`, with a title) and Family
15
+ // (`PhoneSheet`, with `closable` and a darker scrim). PDF's `scrim={false}`
16
+ // is kept for a tool sheet the page above must stay usable under.
17
+ import { useRef } from 'react';
18
+ import { createPortal } from 'react-dom';
19
+ import { PHONE_LAYER_ATTR, useSheetBodyPull, useSheetPull } from './gestures.js';
20
+ import { usePhoneLayer } from './layers.js';
21
+ import { useEscape, useFocusHandOff, useOpenedAt } from './shared.js';
22
+ import { cx, injectPhoneStyles, themeAttr } from './styles.js';
23
+ export function BottomSheet({ label, title, onClose, closable = true, children, footer, scrim = true, theme = 'auto', portal = true, swipeToClose = true, lockScroll, className, style, bodyClassName, bodyStyle, bodyRef: bodyRefProp, }) {
24
+ injectPhoneStyles();
25
+ const ref = useRef(null);
26
+ const ownBodyRef = useRef(null);
27
+ const bodyRef = bodyRefProp ?? ownBodyRef;
28
+ const close = () => {
29
+ if (!closable)
30
+ return false;
31
+ return onClose();
32
+ };
33
+ const { isTop, zIndex } = usePhoneLayer('sheet', close, { lockScroll: lockScroll ?? scrim !== false });
34
+ const grip = useSheetPull(ref, () => void close());
35
+ useSheetBodyPull(ref, bodyRef, () => void close(), swipeToClose && isTop);
36
+ useEscape(isTop && closable, () => void close());
37
+ useFocusHandOff(ref, true);
38
+ const openedAt = useOpenedAt(true);
39
+ const sheet = (_jsxs("div", { ...themeAttr(theme), className: "unisim-phone-layer unisim-phone-sheet-wrap", style: { zIndex, pointerEvents: scrim === false ? 'none' : undefined }, children: [scrim !== false && (_jsx("div", { className: "unisim-phone-scrim", "data-tone": scrim === 'dark' ? 'dark' : undefined, onClick: () => void close(), "aria-hidden": "true" })), _jsxs("section", { ref: ref, role: "dialog", "aria-modal": scrim === false ? undefined : true, "aria-label": label, tabIndex: -1, [PHONE_LAYER_ATTR]: 'sheet', 'data-phone-opened-at': openedAt, className: cx('unisim-phone-sheet', className), style: { pointerEvents: 'auto', ...style }, children: [_jsx(PhoneSheetGrip, { grip: grip }), title != null && _jsx("h2", { className: "unisim-phone-sheet-title", children: title }), _jsx("div", { ref: bodyRef, className: cx('unisim-phone-sheet-body', bodyClassName), style: bodyStyle, children: children }), footer != null && _jsx("div", { className: "unisim-phone-sheet-foot", children: footer })] })] }));
40
+ return portal && typeof document !== 'undefined' ? createPortal(sheet, document.body) : sheet;
41
+ }
42
+ /**
43
+ * The grip, in a strip the width of the sheet so there is a finger's worth to
44
+ * take hold of. For a sheet of the app's own: `useSheetPull(sheetRef, close)`
45
+ * and `<PhoneSheetGrip grip={…} />` at its top.
46
+ */
47
+ export function PhoneSheetGrip({ grip, className }) {
48
+ injectPhoneStyles();
49
+ return (_jsx("div", { ...grip, "data-sheet-grip": "", className: cx('unisim-phone-grip', className), children: _jsx("span", { "aria-hidden": "true" }) }));
50
+ }
51
+ //# sourceMappingURL=BottomSheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["../../src/phone/BottomSheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,0EAA0E;AAC1E,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,yBAAyB;AACzB,EAAE;AACF,8EAA8E;AAC9E,mEAAmE;AACnE,4EAA4E;AAC5E,kEAAkE;AAElE,OAAO,EAAE,MAAM,EAAsD,MAAM,OAAO,CAAA;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAkB,MAAM,eAAe,CAAA;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAA;AA6B/E,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,GAAG,IAAI,EACf,QAAQ,EACR,MAAM,EACN,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,IAAI,EACb,YAAY,GAAG,IAAI,EACnB,UAAU,EACV,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EAAE,WAAW,G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type ReactNode, type RefObject } from 'react';
2
+ import { type PhoneTheme } from './styles.js';
3
+ export interface PhonePageProps {
4
+ /** The page's name: the bar's title and what a screen reader announces. */
5
+ title: string;
6
+ /**
7
+ * Go back. Called by the back link, the edge swipe, Android's back and
8
+ * Escape. Answer `false` to stay (the page asked first).
9
+ */
10
+ onBack: () => boolean | void;
11
+ /** The back link's words: where it goes ("Tune", "Contacts"). Default: "Back", translated. */
12
+ backLabel?: string;
13
+ /** False while the page must not be left (a job running): the link greys, and no gesture goes back. */
14
+ canGoBack?: boolean;
15
+ /** Buttons at the right of the bar. */
16
+ actions?: ReactNode;
17
+ /** Pinned under the body (an action row), above the home indicator. */
18
+ footer?: ReactNode;
19
+ /** A big heading at the top of the body that hands over to the bar as it scrolls away. */
20
+ largeTitle?: boolean;
21
+ /** A line under the large title. */
22
+ sub?: ReactNode;
23
+ /** False keeps the children mounted but hidden, with no layer (a shut fold). Default true. */
24
+ open?: boolean;
25
+ children: ReactNode;
26
+ /** 'auto' (default) follows `html.dark`; 'light' / 'dark' pin it. */
27
+ theme?: PhoneTheme;
28
+ /** The language for the kit's own words. Default: the provider's, else `<html lang>`. */
29
+ language?: string;
30
+ /** Render into <body> (default) — out of any transformed ancestor, which would trap `position: fixed`. */
31
+ portal?: boolean;
32
+ /** Swipe from the left edge goes back. Default true. */
33
+ swipeBack?: boolean;
34
+ /** A pull down puts the finger in the first text box. Default true. */
35
+ pullToType?: boolean;
36
+ /** Stop the page underneath scrolling while this is open. Default true. */
37
+ lockScroll?: boolean;
38
+ className?: string;
39
+ style?: CSSProperties;
40
+ bodyClassName?: string;
41
+ bodyStyle?: CSSProperties;
42
+ /** The scrolling body, for an app that needs it (its own pull-down search, a scroll position). */
43
+ bodyRef?: RefObject<HTMLDivElement>;
44
+ }
45
+ export declare function PhonePage({ title, onBack, backLabel, canGoBack, actions, footer, largeTitle, sub, open, children, theme, language, portal, swipeBack, pullToType, lockScroll, className, style, bodyClassName, bodyStyle, bodyRef: bodyRefProp, }: PhonePageProps): import("react/jsx-runtime").JSX.Element;
46
+ //# sourceMappingURL=PhonePage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhonePage.d.ts","sourceRoot":"","sources":["../../src/phone/PhonePage.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAA2B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAMnG,OAAO,EAAoC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAG/E,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,MAAM,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;IAC5B,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uGAAuG;IACvG,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,uCAAuC;IACvC,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,8FAA8F;IAC9F,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,SAAS,CAAA;IACnB,qEAAqE;IACrE,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0GAA0G;IAC1G,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,kGAAkG;IAClG,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAA;CACpC;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAM,EACN,SAAS,EACT,SAAgB,EAChB,OAAO,EACP,MAAM,EACN,UAAkB,EAClB,GAAG,EACH,IAAW,EACX,QAAQ,EACR,KAAc,EACd,QAAQ,EACR,MAAa,EACb,SAAgB,EAChB,UAAiB,EACjB,UAAiB,EACjB,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EAAE,WAAW,GACrB,EAAE,cAAc,2CAmEhB"}
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // <PhonePage> — a page of its own over the app: what a website dialog, a
4
+ // settings screen or a fold becomes in the phone apps (store-listings README
5
+ // §7, "Phone apps: no website popups"; BRANDING.md's phone rules).
6
+ //
7
+ // • A bar with a back link naming where it goes (Universal PDF, Family), a
8
+ // title, and room for the page's own buttons (BlackBook).
9
+ // • Back is the link, a swipe in from the left edge (the page follows the
10
+ // finger), Android's back gesture, and Escape — all four the same step,
11
+ // and only for the page on top.
12
+ // • A pull down from the top of the page puts the finger in its first text
13
+ // box; nothing focuses one on arrival.
14
+ // • `largeTitle`: a big heading at the top of the page that hands over to
15
+ // the bar as it scrolls away (Universal Family).
16
+ // • `open={false}` keeps the children MOUNTED and hidden, with no layer: the
17
+ // phone's version of a shut <details>, whose contents load and report
18
+ // counts while shut (Family's PhoneFold).
19
+ //
20
+ // Reconciled from Images / Converter / Compress (`Page`), BlackBook (`Page`)
21
+ // and Family (`PhonePage`, `PhoneFold`); the gestures are Universal PDF's.
22
+ import { useId, useRef, useState } from 'react';
23
+ import { createPortal } from 'react-dom';
24
+ import { useEdgeSwipeBack } from './edgeSwipe.js';
25
+ import { PHONE_LAYER_ATTR, usePagePullToType } from './gestures.js';
26
+ import { usePhoneLayer } from './layers.js';
27
+ import { useEscape, useFocusHandOff, useOpenedAt } from './shared.js';
28
+ import { cx, injectPhoneStyles, themeAttr } from './styles.js';
29
+ import { usePhoneText } from './text.js';
30
+ export function PhonePage({ title, onBack, backLabel, canGoBack = true, actions, footer, largeTitle = false, sub, open = true, children, theme = 'auto', language, portal = true, swipeBack = true, pullToType = true, lockScroll = true, className, style, bodyClassName, bodyStyle, bodyRef: bodyRefProp, }) {
31
+ injectPhoneStyles();
32
+ const text = usePhoneText(language);
33
+ const ref = useRef(null);
34
+ const ownBodyRef = useRef(null);
35
+ const bodyRef = bodyRefProp ?? ownBodyRef;
36
+ const titleId = useId();
37
+ const [titleGone, setTitleGone] = useState(false);
38
+ const back = () => {
39
+ if (!canGoBack)
40
+ return false;
41
+ return onBack();
42
+ };
43
+ const { isTop, zIndex } = usePhoneLayer('page', back, { open, lockScroll });
44
+ useEdgeSwipeBack(ref, open && isTop && canGoBack && swipeBack, () => void back());
45
+ usePagePullToType(bodyRef, open && isTop && pullToType);
46
+ useEscape(open && isTop && canGoBack, () => void back());
47
+ useFocusHandOff(ref, open);
48
+ const openedAt = useOpenedAt(open);
49
+ const page = (_jsxs("div", { ref: ref, role: open ? 'dialog' : undefined, "aria-modal": open ? true : undefined, "aria-labelledby": open ? titleId : undefined, tabIndex: -1, hidden: !open, [PHONE_LAYER_ATTR]: open ? 'page' : undefined, 'data-phone-opened-at': openedAt, ...themeAttr(theme), className: cx('unisim-phone-layer unisim-phone-page', className), style: { zIndex, ...style, ...(open ? null : { display: 'none' }) }, children: [_jsx("header", { className: "unisim-phone-bar", children: _jsxs("div", { className: "unisim-phone-bar-row", children: [_jsxs("button", { type: "button", className: "unisim-phone-back", onClick: () => void back(), disabled: !canGoBack, children: [_jsx("svg", { viewBox: "0 0 24 24", width: "22", height: "22", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", style: { flex: 'none' }, children: _jsx("path", { d: "M15 5l-7 7 7 7" }) }), _jsx("span", { children: backLabel ?? text('back') })] }), _jsx("h1", { id: titleId, className: "unisim-phone-title", "aria-hidden": largeTitle ? true : undefined, style: largeTitle ? { opacity: titleGone ? 1 : 0 } : undefined, children: title }), actions != null && _jsx("div", { className: "unisim-phone-actions", children: actions })] }) }), _jsxs("div", { ref: bodyRef, className: cx('unisim-phone-body', bodyClassName), style: bodyStyle, onScroll: largeTitle ? (e) => setTitleGone(e.currentTarget.scrollTop > 44) : undefined, children: [largeTitle && _jsx("h2", { className: "unisim-phone-large-title", children: title }), largeTitle && sub != null && _jsx("p", { className: "unisim-phone-sub", children: sub }), children, footer == null && _jsx("div", { "aria-hidden": "true", style: { height: 'calc(env(safe-area-inset-bottom, 0px) + 16px)' } })] }), footer != null && _jsx("div", { className: "unisim-phone-foot", children: footer })] }));
50
+ return portal && typeof document !== 'undefined' ? createPortal(page, document.body) : page;
51
+ }
52
+ //# sourceMappingURL=PhonePage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhonePage.js","sourceRoot":"","sources":["../../src/phone/PhonePage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,yEAAyE;AACzE,6EAA6E;AAC7E,mEAAmE;AACnE,EAAE;AACF,4EAA4E;AAC5E,6DAA6D;AAC7D,2EAA2E;AAC3E,2EAA2E;AAC3E,mCAAmC;AACnC,4EAA4E;AAC5E,0CAA0C;AAC1C,2EAA2E;AAC3E,oDAAoD;AACpD,8EAA8E;AAC9E,yEAAyE;AACzE,6CAA6C;AAC7C,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAE3E,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAsD,MAAM,OAAO,CAAA;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,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AAkB,YAAE,GAAG,GAAK,EACtE,QAAQ,EACR,MAAM,IAAI,IAAI,IAAI,6BAAiB,MAAM,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,+CAA+C,EAAE,GAAI,IAC7G,EACL,MAAM,IAAI,IAAI,IAAI,cAAK,SAAS,EAAC,mBAAmB,YAAE,MAAM,GAAO,IAChE,CACP,CAAA;IACD,OAAO,MAAM,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC7F,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { PhoneTheme } from './styles.js';
2
+ export interface PhoneAlertOptions {
3
+ message: string;
4
+ title?: string;
5
+ /** Default "OK", translated. */
6
+ okLabel?: string;
7
+ }
8
+ export interface PhoneConfirmOptions {
9
+ message: string;
10
+ title?: string;
11
+ /** The confirming button's words: say what it does ("Delete", "Reset"). */
12
+ confirmLabel: string;
13
+ /** Default "Cancel", translated. */
14
+ cancelLabel?: string;
15
+ /** A destructive action: the button is red. Default false. */
16
+ danger?: boolean;
17
+ }
18
+ export interface PhonePromptOptions {
19
+ message: string;
20
+ title?: string;
21
+ /** What is in the box to start with. */
22
+ value?: string;
23
+ placeholder?: string;
24
+ /** Default "OK", translated. */
25
+ confirmLabel?: string;
26
+ cancelLabel?: string;
27
+ inputMode?: 'text' | 'url' | 'email' | 'tel' | 'numeric' | 'decimal' | 'search';
28
+ type?: 'text' | 'url' | 'email' | 'tel' | 'password' | 'search';
29
+ }
30
+ /** Is a <PhoneDialogHost> mounted (so the phone's sheets answer, not the browser's boxes)? */
31
+ export declare function hasPhoneDialogHost(): boolean;
32
+ /** `alert()` on the website; a sheet with OK on the phone. */
33
+ export declare function phoneAlert(options: string | PhoneAlertOptions): Promise<void>;
34
+ /** `confirm()` on the website; a sheet with the confirming button and Cancel on the phone. */
35
+ export declare function phoneConfirm(options: PhoneConfirmOptions): Promise<boolean>;
36
+ /** `prompt()` on the website; a sheet with a text box on the phone. Null when cancelled. */
37
+ export declare function phonePrompt(options: PhonePromptOptions): Promise<string | null>;
38
+ /** Mount once in the phone chrome. */
39
+ export declare function PhoneDialogHost({ theme, language }: {
40
+ theme?: PhoneTheme;
41
+ language?: string;
42
+ }): import("react/jsx-runtime").JSX.Element | null;
43
+ //# sourceMappingURL=dialogs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogs.d.ts","sourceRoot":"","sources":["../../src/phone/dialogs.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;IAC/E,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAA;CAChE;AAkCD,8FAA8F;AAC9F,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAO7E;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAK3E;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAK/E;AAED,sCAAsC;AACtC,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,kDAW7F"}
@@ -0,0 +1,128 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ // alert(), confirm() and prompt(), the phone's way.
4
+ //
5
+ // A browser alert in a phone app reads "localhost says…" on Android and stops
6
+ // the web view dead, so on the phone the same words come up in a bottom sheet
7
+ // (store-listings README §7). Mount <PhoneDialogHost /> once in the phone
8
+ // chrome; `phoneAlert` / `phoneConfirm` / `phonePrompt` then ask through it.
9
+ // With no host mounted (the website, the desktop app) they fall back to the
10
+ // browser's own boxes, so shared code can call them everywhere.
11
+ //
12
+ // From Universal Images / Converter / Compress (`say`, `ask`, `AskHost`) and
13
+ // Universal PDF (`AskSheet`, a one-line question with a text box). One
14
+ // question at a time: a new one answers the open one "no" (PDF), where the
15
+ // Images copy left the first promise hanging for ever.
16
+ //
17
+ // Layout, kept from Images: the message, then the confirming button, then
18
+ // Cancel under it — an iOS action sheet's order, with the destructive button
19
+ // red. The sheet opens from a tap elsewhere on the screen, so a double tap
20
+ // cannot land on it.
21
+ import { useEffect, useId, useRef, useState, useSyncExternalStore } from 'react';
22
+ import { BottomSheet } from './BottomSheet.js';
23
+ import { usePhoneText } from './text.js';
24
+ let current = null;
25
+ let hosts = 0;
26
+ const listeners = new Set();
27
+ const emit = () => listeners.forEach((fn) => fn());
28
+ const subscribe = (fn) => {
29
+ listeners.add(fn);
30
+ return () => {
31
+ listeners.delete(fn);
32
+ };
33
+ };
34
+ /** Answer whatever is open with its "no" and clear it. */
35
+ function dismiss() {
36
+ const a = current;
37
+ current = null;
38
+ if (!a)
39
+ return;
40
+ if (a.kind === 'alert')
41
+ a.resolve();
42
+ else if (a.kind === 'confirm')
43
+ a.resolve(false);
44
+ else
45
+ a.resolve(null);
46
+ }
47
+ function open(a) {
48
+ dismiss();
49
+ current = a;
50
+ emit();
51
+ }
52
+ /** Is a <PhoneDialogHost> mounted (so the phone's sheets answer, not the browser's boxes)? */
53
+ export function hasPhoneDialogHost() {
54
+ return hosts > 0;
55
+ }
56
+ /** `alert()` on the website; a sheet with OK on the phone. */
57
+ export function phoneAlert(options) {
58
+ const o = typeof options === 'string' ? { message: options } : options;
59
+ if (!hosts) {
60
+ if (typeof window !== 'undefined')
61
+ window.alert(o.title ? `${o.title}\n\n${o.message}` : o.message);
62
+ return Promise.resolve();
63
+ }
64
+ return new Promise((resolve) => open({ kind: 'alert', o, resolve }));
65
+ }
66
+ /** `confirm()` on the website; a sheet with the confirming button and Cancel on the phone. */
67
+ export function phoneConfirm(options) {
68
+ if (!hosts) {
69
+ return Promise.resolve(typeof window !== 'undefined' && window.confirm(options.title ? `${options.title}\n\n${options.message}` : options.message));
70
+ }
71
+ return new Promise((resolve) => open({ kind: 'confirm', o: options, resolve }));
72
+ }
73
+ /** `prompt()` on the website; a sheet with a text box on the phone. Null when cancelled. */
74
+ export function phonePrompt(options) {
75
+ if (!hosts) {
76
+ return Promise.resolve(typeof window !== 'undefined' ? window.prompt(options.message, options.value ?? '') : null);
77
+ }
78
+ return new Promise((resolve) => open({ kind: 'prompt', o: options, resolve }));
79
+ }
80
+ /** Mount once in the phone chrome. */
81
+ export function PhoneDialogHost({ theme, language }) {
82
+ const ask = useSyncExternalStore(subscribe, () => current, () => null);
83
+ useEffect(() => {
84
+ hosts++;
85
+ return () => {
86
+ hosts--;
87
+ if (!hosts)
88
+ dismiss();
89
+ };
90
+ }, []);
91
+ if (!ask)
92
+ return null;
93
+ return _jsx(AskSheet, { ask: ask, theme: theme, language: language }, keyOf(ask));
94
+ }
95
+ const keys = new WeakMap();
96
+ let nextKey = 1;
97
+ function keyOf(a) {
98
+ let k = keys.get(a);
99
+ if (!k) {
100
+ k = nextKey++;
101
+ keys.set(a, k);
102
+ }
103
+ return k;
104
+ }
105
+ function AskSheet({ ask, theme, language }) {
106
+ const text = usePhoneText(language);
107
+ const id = useId();
108
+ const [value, setValue] = useState(ask.kind === 'prompt' ? ask.o.value ?? '' : '');
109
+ const inputRef = useRef(null);
110
+ const finish = (answer) => {
111
+ if (current !== ask)
112
+ return;
113
+ current = null;
114
+ emit();
115
+ if (ask.kind === 'alert')
116
+ ask.resolve();
117
+ else if (ask.kind === 'confirm')
118
+ ask.resolve(answer === 'yes');
119
+ else
120
+ ask.resolve(answer === 'yes' ? value : null);
121
+ };
122
+ const o = ask.o;
123
+ return (_jsx(BottomSheet, { label: o.title ?? o.message, onClose: () => finish('no'), theme: theme, children: _jsxs("div", { "data-phone-dialog": ask.kind, style: { display: 'flex', flexDirection: 'column', gap: 12, paddingBottom: 4 }, children: [o.title && _jsx("h2", { className: "unisim-phone-message-title", children: o.title }), ask.kind === 'prompt' ? (_jsxs("form", { style: { display: 'flex', flexDirection: 'column', gap: 12 }, onSubmit: (e) => {
124
+ e.preventDefault();
125
+ finish('yes');
126
+ }, children: [_jsx("label", { htmlFor: id, className: "unisim-phone-message", style: { textAlign: 'left' }, children: o.message }), _jsx("input", { ref: inputRef, id: id, className: "unisim-phone-input", value: value, onChange: (e) => setValue(e.target.value), placeholder: ask.o.placeholder, inputMode: ask.o.inputMode, type: ask.o.type ?? 'text', autoCapitalize: "off", autoCorrect: "off" }), _jsx("button", { type: "submit", className: "unisim-phone-btn", "data-tone": "primary", children: ask.o.confirmLabel ?? text('ok') }), _jsx("button", { type: "button", className: "unisim-phone-btn", onClick: () => finish('no'), children: ask.o.cancelLabel ?? text('cancel') })] })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "unisim-phone-message", children: o.message }), ask.kind === 'confirm' ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "unisim-phone-btn", "data-tone": ask.o.danger ? 'danger' : 'primary', onClick: () => finish('yes'), children: ask.o.confirmLabel }), _jsx("button", { type: "button", className: "unisim-phone-btn", onClick: () => finish('no'), children: ask.o.cancelLabel ?? text('cancel') })] })) : (_jsx("button", { type: "button", className: "unisim-phone-btn", "data-tone": "primary", onClick: () => finish('yes'), children: ask.o.okLabel ?? text('ok') }))] }))] }) }));
127
+ }
128
+ //# sourceMappingURL=dialogs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogs.js","sourceRoot":"","sources":["../../src/phone/dialogs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,oDAAoD;AACpD,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,gEAAgE;AAChE,EAAE;AACF,6EAA6E;AAC7E,uEAAuE;AACvE,2EAA2E;AAC3E,uDAAuD;AACvD,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,2EAA2E;AAC3E,qBAAqB;AAErB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAsCxC,IAAI,OAAO,GAAe,IAAI,CAAA;AAC9B,IAA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CAAC,CAAC,CACxB,8BACE,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,kBAAkB,eAAY,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,YAC5H,GAAG,CAAC,CAAC,CAAC,YAAY,GACZ,EACT,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,kBAAkB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAC3E,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,GAC7B,IACR,CACJ,CAAC,CAAC,CAAC,CACF,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,kBAAkB,eAAW,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,YAChG,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GACrB,CACV,IACA,CACJ,IACG,GACM,CACf,CAAA;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type RefObject } from 'react';
2
+ /** How close to the left edge a swipe has to start, as on iOS. */
3
+ export declare const EDGE_SWIPE_START_PX = 24;
4
+ /** Let go past this share of the width (or flick) and the page goes. */
5
+ export declare const EDGE_SWIPE_PAST: number;
6
+ /**
7
+ * While `enabled`, a swipe from the left edge of `ref`'s element drags the
8
+ * page across with the finger and, let go far enough (or flicked), finishes
9
+ * the slide and calls `onBack` — the same as the page's back link; short of
10
+ * that it settles back.
11
+ *
12
+ * What slides is the last `[data-edge-page]` inside the element (a page that
13
+ * stands over another inside one screen, like an article over its list), else
14
+ * the element itself. A `[data-edge-under]` beside it is shown for the length
15
+ * of the drag, so the list is what the article reveals.
16
+ */
17
+ export declare function useEdgeSwipeBack(ref: RefObject<HTMLElement | null>, enabled: boolean, onBack: () => void): void;
18
+ //# sourceMappingURL=edgeSwipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edgeSwipe.d.ts","sourceRoot":"","sources":["../../src/phone/edgeSwipe.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIzD,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,KAAK,CAAA;AAGrC,wEAAwE;AACxE,eAAO,MAAM,eAAe,QAAQ,CAAA;AAIpC;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAwH/G"}
@@ -0,0 +1,190 @@
1
+ 'use client';
2
+ // A swipe in from the left edge goes back a page, as everywhere else on an
3
+ // iPhone (BRANDING.md ▸ "A swipe from the left edge goes back", owner rule
4
+ // 2026-10-19: "Side swipe should go back a page, I am on send and it doesn't
5
+ // do anything"). The web view's own back/forward swipe stays off: it would
6
+ // walk the browser history, which here is the stack of layers (layers.ts),
7
+ // not pages anyone would recognise — so the gesture is ours, on the page.
8
+ //
9
+ // Moved here from Universal PDF's `src/native/edgeSwipe.ts` (the original;
10
+ // Images, Converter and Compress carried it unchanged), with Universal
11
+ // Family's one addition: a touch inside another layer rendered within this
12
+ // one (`[data-phone-layer]`, a sheet opened in place) is that layer's.
13
+ //
14
+ // Touch events rather than pointer events: a pointer drag that the browser
15
+ // also reads as a pan is taken over by the scroll (pointercancel) unless
16
+ // touch-action forbids it, and a touch-action on the page would cost the
17
+ // pages their sideways rows. A non-passive touchmove can say no to the scroll
18
+ // one gesture at a time instead, and only once the gesture is ours.
19
+ import { useEffect, useRef } from 'react';
20
+ import { prefersReducedMotion } from '../PullDrawer.js';
21
+ import { PHONE_LAYER_ATTR } from './gestures.js';
22
+ /** How close to the left edge a swipe has to start, as on iOS. */
23
+ export const EDGE_SWIPE_START_PX = 24;
24
+ /** Movement before the swipe's direction is read. */
25
+ const SLOP = 6;
26
+ /** Let go past this share of the width (or flick) and the page goes. */
27
+ export const EDGE_SWIPE_PAST = 1 / 3;
28
+ /** A flick, in px per ms. */
29
+ const FLICK = 0.5;
30
+ /**
31
+ * While `enabled`, a swipe from the left edge of `ref`'s element drags the
32
+ * page across with the finger and, let go far enough (or flicked), finishes
33
+ * the slide and calls `onBack` — the same as the page's back link; short of
34
+ * that it settles back.
35
+ *
36
+ * What slides is the last `[data-edge-page]` inside the element (a page that
37
+ * stands over another inside one screen, like an article over its list), else
38
+ * the element itself. A `[data-edge-under]` beside it is shown for the length
39
+ * of the drag, so the list is what the article reveals.
40
+ */
41
+ export function useEdgeSwipeBack(ref, enabled, onBack) {
42
+ const back = useRef(onBack);
43
+ back.current = onBack;
44
+ useEffect(() => {
45
+ const root = ref.current;
46
+ if (!enabled || !root)
47
+ return;
48
+ const host = root;
49
+ let swipe = null;
50
+ function onStart(e) {
51
+ if (swipe || e.touches.length !== 1) {
52
+ if (swipe?.ours)
53
+ settle(false);
54
+ swipe = null;
55
+ return;
56
+ }
57
+ const touch = e.touches[0];
58
+ if (touch.clientX - host.getBoundingClientRect().left > EDGE_SWIPE_START_PX)
59
+ return;
60
+ if (!(e.target instanceof Element) || ownsTheGesture(e.target, host))
61
+ return;
62
+ // A page or sheet open inside this one takes its own touches.
63
+ const layer = e.target.closest(`[${PHONE_LAYER_ATTR}]`);
64
+ if (layer && layer !== host && host.contains(layer))
65
+ return;
66
+ const pages = host.querySelectorAll('[data-edge-page]');
67
+ const page = pages.length ? pages[pages.length - 1] : host;
68
+ const under = page === host ? null : host.querySelector('[data-edge-under]');
69
+ swipe = { id: touch.identifier, x: touch.clientX, y: touch.clientY, ours: null, dx: 0, t: e.timeStamp, v: 0, page, under, hidden: under?.style.visibility ?? '' };
70
+ }
71
+ function onMove(e) {
72
+ const s = swipe;
73
+ if (!s)
74
+ return;
75
+ const touch = find(e.touches, s.id);
76
+ if (!touch)
77
+ return;
78
+ const dx = touch.clientX - s.x;
79
+ const dy = touch.clientY - s.y;
80
+ if (s.ours === null) {
81
+ if (Math.hypot(dx, dy) < SLOP)
82
+ return;
83
+ // Mostly sideways and rightwards, or it's the page's own scroll.
84
+ if (dx <= 0 || Math.abs(dx) < Math.abs(dy) * 1.2) {
85
+ swipe = null;
86
+ return;
87
+ }
88
+ s.ours = true;
89
+ begin(s.page, s.under);
90
+ }
91
+ if (e.cancelable)
92
+ e.preventDefault();
93
+ const x = Math.max(0, dx);
94
+ const dt = e.timeStamp - s.t;
95
+ if (dt > 0)
96
+ s.v = (x - s.dx) / dt;
97
+ s.dx = x;
98
+ s.t = e.timeStamp;
99
+ s.page.style.transform = x ? `translateX(${x}px)` : '';
100
+ }
101
+ function onEnd(e) {
102
+ const s = swipe;
103
+ if (!s || !find(e.changedTouches, s.id))
104
+ return;
105
+ if (s.ours)
106
+ settle(e.type === 'touchend');
107
+ swipe = null;
108
+ }
109
+ /** Let go: finish the slide and go back, or settle where it was. */
110
+ function settle(released) {
111
+ const s = swipe;
112
+ if (!s)
113
+ return;
114
+ const width = host.offsetWidth || window.innerWidth;
115
+ const away = released && (s.dx > width * EDGE_SWIPE_PAST || (s.v > FLICK && s.dx > 16));
116
+ const { page, under, hidden } = s;
117
+ // Tidied before going back, not after: the page underneath re-renders
118
+ // with its own visibility once it's the top one. A page that refuses to
119
+ // go (it asks first) is then simply back in place.
120
+ const tidy = () => {
121
+ page.style.transition = '';
122
+ page.style.transform = '';
123
+ page.style.boxShadow = '';
124
+ if (under)
125
+ under.style.visibility = hidden;
126
+ };
127
+ if (prefersReducedMotion()) {
128
+ tidy();
129
+ if (away)
130
+ back.current();
131
+ return;
132
+ }
133
+ page.style.transition = 'transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1)';
134
+ if (away) {
135
+ page.style.transform = `translateX(${width + 16}px)`;
136
+ window.setTimeout(() => {
137
+ tidy();
138
+ back.current();
139
+ }, 170);
140
+ }
141
+ else {
142
+ page.style.transform = '';
143
+ window.setTimeout(tidy, 190);
144
+ }
145
+ }
146
+ host.addEventListener('touchstart', onStart, { passive: true, capture: true });
147
+ host.addEventListener('touchmove', onMove, { passive: false, capture: true });
148
+ host.addEventListener('touchend', onEnd, { capture: true });
149
+ host.addEventListener('touchcancel', onEnd, { capture: true });
150
+ return () => {
151
+ host.removeEventListener('touchstart', onStart, { capture: true });
152
+ host.removeEventListener('touchmove', onMove, { capture: true });
153
+ host.removeEventListener('touchend', onEnd, { capture: true });
154
+ host.removeEventListener('touchcancel', onEnd, { capture: true });
155
+ };
156
+ }, [ref, enabled]);
157
+ }
158
+ function begin(page, under) {
159
+ // The page's slide-in would otherwise hold the transform while it runs.
160
+ page.getAnimations?.().forEach((a) => a.cancel());
161
+ page.style.transition = 'none';
162
+ page.style.boxShadow = '-8px 0 24px rgba(0,0,0,0.12)';
163
+ if (under)
164
+ under.style.visibility = 'visible';
165
+ }
166
+ function find(list, id) {
167
+ for (let i = 0; i < list.length; i++)
168
+ if (list[i].identifier === id)
169
+ return list[i];
170
+ return null;
171
+ }
172
+ /**
173
+ * Something under the finger that does its own dragging keeps it: a drawing
174
+ * pad or anything else that has turned the browser's panning off, a slider,
175
+ * or a sideways row that has been scrolled along (a swipe right there scrolls
176
+ * it back, as on iOS; one at its start has nothing to scroll back to).
177
+ */
178
+ function ownsTheGesture(target, host) {
179
+ for (let el = target; el && el !== host; el = el.parentElement) {
180
+ if (el instanceof HTMLInputElement && el.type === 'range')
181
+ return true;
182
+ const cs = getComputedStyle(el);
183
+ if (cs.touchAction === 'none' || cs.touchAction === 'pan-y')
184
+ return true;
185
+ if (/(auto|scroll)/.test(cs.overflowX) && el.scrollLeft > 0)
186
+ return true;
187
+ }
188
+ return false;
189
+ }
190
+ //# sourceMappingURL=edgeSwipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edgeSwipe.js","sourceRoot":"","sources":["../../src/phone/edg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