@vinena/knobs 0.5.0 → 0.5.2

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 (75) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +7 -0
  3. package/dist/early.global.js +6 -6
  4. package/dist/{elementsview-6g274ptr.js → elementsview-2z4pkrdz.js} +4 -4
  5. package/dist/{elementsview-pkzp9kc6.js → elementsview-qn8qyksa.js} +4 -4
  6. package/dist/engine/browserdraw.d.ts +24 -2
  7. package/dist/engine/browserkit.d.ts +18 -1
  8. package/dist/engine/browserui.d.ts +162 -22
  9. package/dist/engine/devicon.d.ts +59 -0
  10. package/dist/engine/fit.d.ts +4 -3
  11. package/dist/engine/foldflip.d.ts +40 -0
  12. package/dist/engine/identity.d.ts +7 -4
  13. package/dist/engine/mock.d.ts +16 -0
  14. package/dist/engine/mockdata.d.ts +4 -1
  15. package/dist/engine/mockdraw.d.ts +14 -2
  16. package/dist/engine/pageshot.d.ts +5 -2
  17. package/dist/engine/safaridraw.d.ts +162 -10
  18. package/dist/engine/screen.d.ts +24 -0
  19. package/dist/engine/store.d.ts +2 -1
  20. package/dist/engine/tabicon.d.ts +43 -0
  21. package/dist/engine/toplayer.d.ts +62 -0
  22. package/dist/engine/touchpointer.d.ts +0 -21
  23. package/dist/engine/underbar.d.ts +61 -0
  24. package/dist/{framekit-g96t6nmq.js → framekit-te90cjs0.js} +2325 -1572
  25. package/dist/{framekit-3n7p79ht.js → framekit-w0v516w5.js} +2325 -1572
  26. package/dist/host.d.ts +51 -0
  27. package/dist/{index-64rd634h.js → index-30fc6php.js} +1 -1
  28. package/dist/{index-dvr4x91q.js → index-9re7sv56.js} +20 -8
  29. package/dist/{index-0casarhy.js → index-agwr37gw.js} +1 -1
  30. package/dist/{index-2d6wvs8h.js → index-dan2kpsd.js} +4 -4
  31. package/dist/{index-kzsb9drs.js → index-hv02xka3.js} +20 -8
  32. package/dist/{index-peh33xjv.js → index-pewcdh28.js} +1 -1
  33. package/dist/{index-d0cjxjsm.js → index-r72tz2vn.js} +1 -1
  34. package/dist/{index-33x9hxe3.js → index-sxe5079a.js} +605 -187
  35. package/dist/{index-5d6qzte3.js → index-trx7bxdk.js} +4 -4
  36. package/dist/{index-5baxvd3v.js → index-xjhwp5cj.js} +275 -112
  37. package/dist/index.d.ts +26 -1
  38. package/dist/index.global.js +270 -176
  39. package/dist/index.js +398 -124
  40. package/dist/instance.d.ts +23 -4
  41. package/dist/{react-pdvseef0.js → react-05jh9jv5.js} +1 -1
  42. package/dist/{react-4kbj1t4h.js → react-16spgn0h.js} +1 -1
  43. package/dist/{react-65tgdbs8.js → react-4pvp6amm.js} +1 -1
  44. package/dist/{react-qv0nykcv.js → react-ayg1bgw3.js} +602 -184
  45. package/dist/{react-xxfpfddf.js → react-exjcpxma.js} +1 -1
  46. package/dist/{react-carf84xv.js → react-fm9y8dbn.js} +275 -112
  47. package/dist/{react-mv9y20jy.js → react-sw8d8c94.js} +4 -4
  48. package/dist/{react-71a9ypex.js → react-zy1mmhgz.js} +4 -4
  49. package/dist/react.js +394 -123
  50. package/dist/{storageview-vdkbp6rt.js → storageview-r595qpt9.js} +4 -4
  51. package/dist/{storageview-j9d44f99.js → storageview-s7heg93p.js} +4 -4
  52. package/dist/types.d.ts +7 -0
  53. package/dist/ui/footer.d.ts +9 -2
  54. package/dist/ui/panel.d.ts +16 -2
  55. package/dist/ui/settings.d.ts +17 -1
  56. package/dist/version.d.ts +2 -0
  57. package/package.json +3 -2
  58. package/skills/devknobs/SKILL.md +1 -1
  59. package/dist/elementsview-jnkbhzkj.js +0 -2873
  60. package/dist/elementsview-tf4qzmtw.js +0 -2874
  61. package/dist/engine/endroom.d.ts +0 -21
  62. package/dist/framekit-095qevka.js +0 -8838
  63. package/dist/framekit-q5aad770.js +0 -8839
  64. package/dist/index-hw56t3zy.js +0 -4800
  65. package/dist/index-k015tb6c.js +0 -357
  66. package/dist/index-ke6v7919.js +0 -4801
  67. package/dist/index-qxye1j73.js +0 -528
  68. package/dist/index-z5ytnj01.js +0 -4563
  69. package/dist/index-zvze25nf.js +0 -686
  70. package/dist/react-eygws6cx.js +0 -358
  71. package/dist/react-sq9pkw4k.js +0 -687
  72. package/dist/react-vjm88w4t.js +0 -4564
  73. package/dist/react-znfrjqk8.js +0 -529
  74. package/dist/storageview-sb23henh.js +0 -2729
  75. package/dist/storageview-vf8v8q8j.js +0 -2728
@@ -1,22 +1,174 @@
1
1
  import type { Actions, Look, Painted } from "./browserkit";
2
+ import { type Color } from "./color";
2
3
  import { type Bars, type Shape } from "./browserui";
3
4
  import type { Rect } from "./mock";
5
+ export declare const SAFARI_CSS: string;
4
6
  /**
5
- * iOS 26 Safari: Liquid Glass capsules over the page's own color and the
6
- * status bar. No home indicator: it goes once you switch apps, and here none
7
- * are switched. The glyphs are drawn here from the common ideas
8
- * (a chevron, a box with an arrow, an open book), not from Apple's symbols.
9
- * Colors are sampled from the simulator.
7
+ * The status bar's glyphs, measured on the iOS 27.0 simulator in pt, on the
8
+ * 17 Pro and, a size up, on the 17 Pro Max and the Air: each about 7% bigger
9
+ * than iOS 26's. Each sits on the island's center line: the time's digits a
10
+ * little under it, the bars and wifi by their bottom and the battery by its
11
+ * middle, `drop` px down.
10
12
  */
11
- export declare const SAFARI_CSS: string;
12
- /** The minimized domain pill's box: as wide as its text and 19 px either side. */
13
+ export declare const STATUS_GLYPHS: {
14
+ readonly regular: {
15
+ readonly time: {
16
+ readonly size: 18;
17
+ readonly spacing: -0.09;
18
+ readonly drop: 0.33;
19
+ };
20
+ /** The gap between the bars, wifi and the battery. */
21
+ readonly gap: 8.5;
22
+ readonly signal: {
23
+ readonly width: 3.33;
24
+ readonly pitch: 5.67;
25
+ readonly heights: readonly [6.33, 8.67, 11, 13.67];
26
+ readonly radius: 1.1;
27
+ readonly drop: 7.67;
28
+ };
29
+ readonly wifi: {
30
+ readonly width: 18.67;
31
+ readonly height: 13.67;
32
+ readonly bands: readonly [0, 3.14, 6.09, 7.83, 10.78, 12.57];
33
+ readonly angle: 45.4;
34
+ readonly round: 1.1;
35
+ readonly drop: 7.33;
36
+ };
37
+ readonly battery: {
38
+ readonly width: 26.33;
39
+ readonly height: 13.67;
40
+ readonly radius: 4.67;
41
+ readonly gap: 0.67;
42
+ readonly cap: readonly [2, 5];
43
+ readonly drop: -0.5;
44
+ };
45
+ };
46
+ readonly large: {
47
+ readonly time: {
48
+ readonly size: 19;
49
+ readonly spacing: -0.09;
50
+ readonly drop: 0.5;
51
+ };
52
+ readonly gap: 8.67;
53
+ readonly signal: {
54
+ readonly width: 3.67;
55
+ readonly pitch: 6.11;
56
+ readonly heights: readonly [7, 9.33, 12, 15];
57
+ readonly radius: 1.2;
58
+ readonly drop: 8.33;
59
+ };
60
+ readonly wifi: {
61
+ readonly width: 20.33;
62
+ readonly height: 15;
63
+ readonly bands: readonly [0, 3.45, 6.68, 8.59, 11.83, 13.79];
64
+ readonly angle: 45;
65
+ readonly round: 1.2;
66
+ readonly drop: 8;
67
+ };
68
+ readonly battery: {
69
+ readonly width: 29.33;
70
+ readonly height: 15;
71
+ readonly radius: 5;
72
+ readonly gap: 1;
73
+ readonly cap: readonly [2, 5];
74
+ readonly drop: -0.5;
75
+ };
76
+ };
77
+ };
78
+ type Glyphs = (typeof STATUS_GLYPHS)[keyof typeof STATUS_GLYPHS];
79
+ /** The battery's whole width: the body, the gap and its cap. */
80
+ export declare function batteryWidth(size: Glyphs["battery"]): number;
81
+ /**
82
+ * iOS 27's battery, in px of its box: a solid flat body, as much of it as
83
+ * the charge in the glyph's color and the rest flat gray, no outline, and
84
+ * the cap apart from the body, gray too. No percentage, as iOS shows it by
85
+ * default. Measured on the iOS 27.0 simulator: 26.33 x 13.67 with a 2 x 5
86
+ * cap 0.67 off on the 17 Pro, 29.33 x 15 and 1 off on the Pro Max.
87
+ */
88
+ export declare function batteryParts(size: Glyphs["battery"], charge: number): {
89
+ body: {
90
+ x: number;
91
+ y: number;
92
+ width: 26.33 | 29.33;
93
+ height: 15 | 13.67;
94
+ rx: 5 | 4.67;
95
+ };
96
+ level: {
97
+ d: string;
98
+ };
99
+ cap: {
100
+ x: number;
101
+ y: number;
102
+ width: 2;
103
+ height: 5;
104
+ };
105
+ };
106
+ /**
107
+ * The Duo's status, measured on the iOS 27.1 simulator in pt: the ring is
108
+ * open at the bottom, its ends 55 degrees each side of straight down, and the
109
+ * signal's four dots, 4 round, sit on its circle in the gap, 10 and 30.5
110
+ * degrees each side. Wifi in the ring is the iPhone's, 18.2 by 13.33. The
111
+ * ring's arc is the battery: as much of it as the charge, the rest at 35%.
112
+ */
113
+ export declare const DUO_GLYPHS: {
114
+ readonly time: {
115
+ readonly spacing: 0;
116
+ readonly drop: 0.8;
117
+ };
118
+ readonly ends: 55;
119
+ readonly dots: readonly [-30.5, -10, 10, 30.5];
120
+ readonly dot: 2;
121
+ readonly rest: 0.35;
122
+ readonly wifi: {
123
+ readonly width: 18.2;
124
+ readonly height: 13.33;
125
+ readonly bands: readonly [0, 3.06, 5.94, 7.64, 10.51, 12.26];
126
+ readonly angle: 45.4;
127
+ readonly round: 1.1;
128
+ readonly drop: 0;
129
+ };
130
+ };
131
+ /** The address as Safari shows it: the host alone, without its port. */
132
+ export declare function domainOf(host: string): string;
133
+ /** The minimized domain pill's box: its domain's advance and the pill's room either side. */
13
134
  export declare function pillBox(pill: Shape, host: string): Rect;
135
+ /** How Safari's glass looks over a color of the page. */
136
+ export interface Tint {
137
+ /** The glass's color where the page under it is that color all over. */
138
+ fill: string;
139
+ /** The tone of the glyphs and text on it. */
140
+ glyph: "light" | "dark";
141
+ /** Its edge: none and a soft shadow, a rim of its own hue, or dark glass's highlight. */
142
+ rim: "none" | "tint" | "highlight";
143
+ }
144
+ /**
145
+ * The glass over `under` in a page of `scheme`, from pairs measured on the
146
+ * iOS 27.0 simulator. The glass takes its tone from the content and from the
147
+ * scheme: light mode gives #f8f8f8 over white and #898989 over black, dark
148
+ * mode #b3b3b3 over white and #222222 over black, gray in between by the
149
+ * content's lightness. Saturated content gives glass in its own hue, lighter
150
+ * in light (#1e5bd7 gives #7eb1ff, #13a538 #5ce37e) and a little brighter in
151
+ * dark (#2a6ef2, #0ead37). Colors in between mix the two by how saturated
152
+ * they are. The glyphs on it follow the scheme alone: black in light, white
153
+ * in dark, whatever the glass.
154
+ */
155
+ export declare function glassTint(under: Color, scheme: "light" | "dark"): Tint;
156
+ /** The page's color under the point of the screen nearest `x`, `y`, else the page's own. */
157
+ export declare function underAt(look: Look, x: number, y: number): Color;
158
+ /**
159
+ * Lay the minimized bars' scrim in the page's color, and say what the status
160
+ * bar then shows under its glyphs: the content at the top of the page through
161
+ * the scrim. Null where a fixed or sticky bar holds the top, which keeps its
162
+ * color as the strip, and where the bars have no scrim.
163
+ */
164
+ export declare function scrimOver(node: HTMLElement, mini: Bars, look: Look): Color | null;
14
165
  /**
15
166
  * Safari's bars, drawn once for both states (the plus to menu morph of
16
167
  * transitions.dev). The address capsule, Bottom's card or Top's address bar
17
168
  * is one surface that becomes the minimized pill: its box and corners tween,
18
- * the domain glides and scales from 17 to 13 px in it, and the page menu,
19
- * reload and Bottom's buttons fade out as an icon swap. The capsules beside
20
- * it fade and drift 10 px. The scroll edge moves on the same curve.
169
+ * the domain glides and scales from 17 to the pill's size in it, and the page
170
+ * menu, reload and Bottom's buttons fade out as an icon swap. The capsules
171
+ * beside it fade and drift 10 px.
21
172
  */
22
173
  export declare function buildSafari(full: Bars, mini: Bars, look: Look, actions: Actions): Painted;
174
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { DevknobsState } from "../types";
2
+ /**
3
+ * A phone's or a tablet's screen as the page reads it in `window.screen`:
4
+ * `width`, `height`, `availWidth` and `availHeight` in css px, all of the
5
+ * screen, as iOS 26.5 Safari reports 402 x 874 on the 17 Pro on the
6
+ * simulator. iOS keeps them upright however the phone is held; Android turns
7
+ * them with it. The iPhone Duo reports its cover screen, 466 x 678, on
8
+ * either screen, and the cover held across is 466 high to `availHeight`,
9
+ * measured on the iOS 27.1 simulator. The getters go on the window's own `screen`, over its
10
+ * prototype's, and taking them off puts back what the screen had.
11
+ */
12
+ export interface ScreenSize {
13
+ width: number;
14
+ height: number;
15
+ /** Where not the height. */
16
+ availHeight?: number;
17
+ }
18
+ type ScreenKnobs = Pick<DevknobsState, "device" | "posture" | "orientation">;
19
+ /** The screen a page in the frame reads for these knobs, null for the window's own. */
20
+ export declare function screenSizeOf(state: ScreenKnobs): ScreenSize | null;
21
+ /** Put `size` on the screen of the window `scope`, or null to give it back what it had. */
22
+ export declare function apply(size: ScreenSize | null, scope?: object): void;
23
+ export declare function reset(): void;
24
+ export {};
@@ -1,4 +1,4 @@
1
- import type { BarsValue, BrowserValue, ClockMode, ConnectionValue, ContrastValue, DevknobsState, DevknobsStatePatch, DirValue, EdgeValue, GeoErrorValue, CustomColor, GrabColorValue, MotionValue, OnlineValue, OrientationValue, PanelValue, SaveDataValue, SchemeValue, SideValue, TransparencyValue, VisionValue } from "../types";
1
+ import type { BarsValue, BrowserValue, ClockMode, ConnectionValue, ContrastValue, DevknobsState, DevknobsStatePatch, DevIconValue, DirValue, EdgeValue, GeoErrorValue, CustomColor, GrabColorValue, MotionValue, OnlineValue, OrientationValue, PanelValue, SaveDataValue, SchemeValue, SideValue, TransparencyValue, VisionValue } from "../types";
2
2
  export declare const STORAGE_KEY = "devknobs";
3
3
  /** The version of the state `STORAGE_KEY` keeps. Bump it with a change of shape, see stored.ts. */
4
4
  export declare const STATE_VERSION = 2;
@@ -37,6 +37,7 @@ export declare const BROWSERS: BrowserValue[];
37
37
  export declare const ORIENTATIONS: OrientationValue[];
38
38
  export declare const EDGES: EdgeValue[];
39
39
  export declare const SIDES: SideValue[];
40
+ export declare const DEV_ICONS: DevIconValue[];
40
41
  export declare const VISIONS: VisionValue[];
41
42
  export declare const GRAB_COLORS: Exclude<GrabColorValue, CustomColor>[];
42
43
  /** The place of a state's panel, as `PLACE_KEY` keeps it. */
@@ -0,0 +1,43 @@
1
+ import type { DevIconValue } from "../types";
2
+ import { type IconSource } from "./devicon";
3
+ /**
4
+ * The dev ribbon on the page's own icons, so a dev tab tells itself apart
5
+ * from production at a glance. Every icon link of the top document, the
6
+ * apple touch icon too, gets its picture drawn again with the ribbon and
7
+ * put back as a png data url. Its own address is kept on the link, and goes
8
+ * back as it was when the ribbon goes. A framework that swaps the head's
9
+ * links on a navigation gets its new ones drawn too.
10
+ */
11
+ /** Where a link keeps the address it had before the ribbon. */
12
+ export declare const ORIGINAL_HREF = "data-devknobs-href";
13
+ /** Marks the icon link devknobs added, on a page with none, for its `/favicon.ico`. */
14
+ export declare const ADDED_ICON = "data-devknobs-icon";
15
+ /** Whether a host is this machine or the local network, where a page is a dev one. */
16
+ export declare function localHost(hostname: string): boolean;
17
+ /** Whether the ribbon shows on a host: `auto` on a local one only. */
18
+ export declare function devIconShown(value: DevIconValue, hostname: string): boolean;
19
+ /** The value that shows the ribbon or not on a host: `auto` where that is what a local host or another does anyway. */
20
+ export declare function devIconFor(on: boolean, hostname: string): DevIconValue;
21
+ /** Whether the ribbon shows on this page: the top document's alone, as the tab's icon is its. */
22
+ export declare function shownHere(value: DevIconValue): boolean;
23
+ /** A link the browser takes for the tab's icon or the home screen's. */
24
+ export declare function isIconLink(node: unknown): node is Element;
25
+ /** The size a link's icon is drawn at: its first declared size in 16 to 512, else 32, or 180 for a touch icon. */
26
+ export declare function iconSize(link: Element): number;
27
+ /** What the ribbon needs from the page, so tests can hand in their own. */
28
+ export interface TabIconEnv {
29
+ document: Document;
30
+ /** An address as a decoded image, null where it does not load. */
31
+ load(href: string): Promise<IconSource | null>;
32
+ /** The icon with the ribbon at `size` px as a png data url, null where it cannot be read back. */
33
+ render(source: IconSource, size: number): string | null;
34
+ Observer: typeof MutationObserver | undefined;
35
+ }
36
+ export interface TabIcon {
37
+ start(): void;
38
+ /** Give every link its own address back, and stop watching the head. */
39
+ stop(): void;
40
+ }
41
+ export declare function createTabIcon(env: TabIconEnv): TabIcon;
42
+ export declare function apply(on: boolean): void;
43
+ export declare function reset(): void;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Devknobs' own layers in the top layer, over the page's modal dialogs,
3
+ * popovers and fullscreen element, where the browser has popovers. Each host
4
+ * is a manual popover, which closes no other popover and no light dismiss
5
+ * closes. The top layer keeps the order things came in and paints the last
6
+ * over the rest, so a host goes out and in again to go on top, and the hosts
7
+ * go in again in their order whenever the page puts something new there.
8
+ * Without popovers each host stays a plain layer, its z-index its order.
9
+ */
10
+ /**
11
+ * Where each host goes, the lowest first: grab's boxes, then the panel, then
12
+ * a guide that points at the panel, such as a tour of it, then the touch cursor.
13
+ */
14
+ export declare const LAYER: {
15
+ readonly overlay: 0;
16
+ readonly panel: 1;
17
+ readonly guide: 2;
18
+ readonly touch: 3;
19
+ };
20
+ /**
21
+ * What a host's shadow root holds, so that none of the look a popover comes
22
+ * with, from the browser or from the page's own popover rules, reaches it.
23
+ * Where the host sits and how big it is stay its own.
24
+ */
25
+ export declare const HOST_RESET = "\n:host([popover]) {\n display: block !important;\n position: fixed !important;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n background: none !important;\n color: inherit !important;\n overflow: visible !important;\n max-width: none !important;\n max-height: none !important;\n box-shadow: none !important;\n outline: none !important;\n opacity: 1 !important;\n transform: none !important;\n translate: none !important;\n scale: none !important;\n rotate: none !important;\n filter: none !important;\n backdrop-filter: none !important;\n clip-path: none !important;\n mask: none !important;\n contain: none !important;\n container-type: normal !important;\n content-visibility: visible !important;\n visibility: visible !important;\n perspective: none !important;\n will-change: auto !important;\n zoom: 1 !important;\n min-width: 0 !important;\n min-height: 0 !important;\n position-anchor: auto !important;\n position-area: none !important;\n transition: none !important;\n animation: none !important;\n}";
26
+ /** A host in the top layer, to put on top again after it went back in the page, and to let go of. */
27
+ export interface TopLayerHold {
28
+ raise(): void;
29
+ release(): void;
30
+ }
31
+ /**
32
+ * Does a `toggle` or `beforetoggle` event tell of something that joins the
33
+ * top layer, where the last to come in paints over the rest? A popover or a
34
+ * dialog that opens does. Devknobs' own hosts and a `details` do not.
35
+ */
36
+ export declare function raises(change: {
37
+ newState: unknown;
38
+ tag: string;
39
+ own: boolean;
40
+ }): boolean;
41
+ /** Did a change of an `open` attribute open a dialog? For browsers whose dialogs send no `toggle`. */
42
+ export declare function dialogOpened(change: {
43
+ tag: string;
44
+ was: string | null;
45
+ open: boolean;
46
+ }): boolean;
47
+ /**
48
+ * The first thing on an event's path, from the target out, that is in the top
49
+ * layer. The path goes through shadow roots, where no `toggle` comes out of.
50
+ */
51
+ export declare function topLayerOf<T>(path: readonly unknown[], inTopLayer: (node: unknown) => node is T): T | null;
52
+ /** Where a host of `rank` goes among those held, after any of the same rank. */
53
+ export declare function placeOf(ranks: readonly number[], rank: number): number;
54
+ /** Can a host go in the top layer? Without popovers it stays a plain layer. */
55
+ export declare function layered(): boolean;
56
+ /**
57
+ * Put `host`, already in the page, in the top layer at its `rank`, and the
58
+ * hosts above it in again over it. Where the browser has no popovers, or
59
+ * will not show this one, it stays where it is, no popover, and nothing is
60
+ * watched for it.
61
+ */
62
+ export declare function holdInTopLayer(host: HTMLElement, rank: number): TopLayerHold;
@@ -83,27 +83,6 @@ export declare function inertiaStep(velocity: {
83
83
  };
84
84
  done: boolean;
85
85
  };
86
- /**
87
- * Does a `toggle` or `beforetoggle` event tell of something that joins the
88
- * top layer, where the last to come in paints over the rest? A popover or a
89
- * dialog that opens does. The cursor's own host and a `details` do not.
90
- */
91
- export declare function raises(change: {
92
- newState: unknown;
93
- tag: string;
94
- own: boolean;
95
- }): boolean;
96
- /** Did a change of an `open` attribute open a dialog? For browsers whose dialogs send no `toggle`. */
97
- export declare function dialogOpened(change: {
98
- tag: string;
99
- was: string | null;
100
- open: boolean;
101
- }): boolean;
102
- /**
103
- * The first thing on an event's path, from the target out, that is in the top
104
- * layer. The path goes through shadow roots, where no `toggle` comes out of.
105
- */
106
- export declare function topLayerOf<T>(path: readonly unknown[], inTopLayer: (node: unknown) => node is T): T | null;
107
86
  export declare function apply(on: boolean): void;
108
87
  export declare function reset(): void;
109
88
  /**
@@ -0,0 +1,61 @@
1
+ import { type Look } from "./browserkit";
2
+ import type { Bars } from "./browserui";
3
+ import type { Rect } from "./mock";
4
+ /**
5
+ * The page under Safari's bottom bars. The frame ends where Safari's viewport
6
+ * does, so `innerHeight`, `dvh` and a fixed `bottom: 0` read as on the phone,
7
+ * but the phone paints the page on below it, under the glass, to the bottom
8
+ * of the screen. The band there shows a picture of the document past the
9
+ * viewport's bottom edge: one picture of the whole document, drawn by the
10
+ * browser through an svg, which a scroll only moves. It is pictured again
11
+ * when the page changes, at most as often as keeps its cost to a tenth of
12
+ * the time. What is pinned to the screen is left out of it, as it stays in
13
+ * the viewport on the phone, and a fixed footer's color is carried down
14
+ * instead, by the screen's fill under the band. A page out of reach shows
15
+ * that fill too.
16
+ */
17
+ export declare const UNDERBAR_CSS = "\n.underbar {\n position: absolute;\n overflow: hidden;\n pointer-events: none;\n transform-origin: 0 0;\n}\n.underbar[hidden] { display: none; }\n.underbar > img {\n position: absolute;\n left: 0;\n top: 0;\n max-width: none;\n will-change: transform;\n}\n";
18
+ /** The band under the viewport, in the screen's css px, or null where the page reaches the screen's bottom. */
19
+ export declare function bandRect(page: Rect | null, height: number): Rect | null;
20
+ /**
21
+ * Does Safari show the page under its bars here? Only where its bars leave a
22
+ * band under the viewport, upright or with a status column, for a page the
23
+ * frame can read, with no fixed footer to carry its color down instead.
24
+ */
25
+ export declare function showsBand(bars: Bars | null, look: Look | null): boolean;
26
+ /**
27
+ * How far up the picture of the document moves in the band, in the screen's
28
+ * css px: the band starts at the viewport's bottom edge, `scrollY` and
29
+ * `innerHeight` down the document, each of its px `scale` of the screen's.
30
+ */
31
+ export declare function bandShift(scrollY: number, innerHeight: number, scale: number): number;
32
+ /**
33
+ * `css` with every length in viewport heights as the px they come to in a
34
+ * viewport `height` px tall. The picture's own viewport is as tall as the
35
+ * whole document, which would stretch them.
36
+ */
37
+ export declare function viewportUnits(css: string, height: number): string;
38
+ /** The picture of a page as an svg, `width` by `height` css px, and its markup's address. */
39
+ export interface Picture {
40
+ src: string;
41
+ width: number;
42
+ height: number;
43
+ }
44
+ /**
45
+ * The whole page in `frame` as an svg as tall as the document, laid out as
46
+ * the frame lays it out, or null where it is out of reach. Its viewport
47
+ * lengths and the root's height are the frame's, and what is fixed to the
48
+ * screen is left out.
49
+ */
50
+ export declare function pictureOf(frame: HTMLIFrameElement): Picture | null;
51
+ export interface Underbar {
52
+ /** Lay the band over `rect` of the screen, at `zoom`, in the page's `look`, or hide it with null. */
53
+ show(rect: Rect | null, zoom: number, look: Look | null): void;
54
+ /** Follow the page's scroll. */
55
+ move(): void;
56
+ /** Picture the page again: a knob changed how it looks. */
57
+ refresh(): void;
58
+ remove(): void;
59
+ }
60
+ /** The band under the viewport of `frame`, in `glass`, under the bars. */
61
+ export declare function createUnderbar(glass: HTMLElement, frame: HTMLIFrameElement): Underbar;