@vinena/knobs 0.7.0 → 0.7.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 (116) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +2 -2
  3. package/dist/cli.js +2 -2
  4. package/dist/{context-eawqn680.js → context-2r76ext7.js} +3 -3
  5. package/dist/{context-vd2xep5t.js → context-h1bdt8w3.js} +3 -3
  6. package/dist/early.global.js +7 -8
  7. package/dist/edit/html.d.ts +7 -3
  8. package/dist/edit/keep.d.ts +1 -1
  9. package/dist/{elementsview-m33ejs4r.js → elementsview-1bar694x.js} +21 -19
  10. package/dist/{elementsview-jg4edt86.js → elementsview-p2wc9b0s.js} +21 -19
  11. package/dist/engine/bandmedia.d.ts +119 -0
  12. package/dist/engine/bezels.d.ts +2 -2
  13. package/dist/engine/browserui.d.ts +3 -1
  14. package/dist/engine/check.d.ts +2 -2
  15. package/dist/engine/describe.d.ts +2 -2
  16. package/dist/engine/devices.d.ts +3 -3
  17. package/dist/engine/fit.d.ts +4 -4
  18. package/dist/engine/foldhand.d.ts +2 -2
  19. package/dist/engine/frame.d.ts +6 -6
  20. package/dist/engine/frames.d.ts +4 -4
  21. package/dist/engine/fresh.d.ts +12 -5
  22. package/dist/engine/header.d.ts +3 -1
  23. package/dist/engine/identity.d.ts +4 -4
  24. package/dist/engine/index.d.ts +7 -7
  25. package/dist/engine/locale.d.ts +2 -2
  26. package/dist/engine/morph.d.ts +2 -2
  27. package/dist/engine/native.d.ts +8 -8
  28. package/dist/engine/pageshot.d.ts +24 -4
  29. package/dist/engine/placeholder.d.ts +3 -3
  30. package/dist/engine/reload.d.ts +2 -2
  31. package/dist/engine/safaridraw.d.ts +24 -3
  32. package/dist/engine/screen.d.ts +2 -2
  33. package/dist/engine/scrollkeep.d.ts +1 -1
  34. package/dist/engine/store.d.ts +11 -11
  35. package/dist/engine/storekeys.d.ts +34 -0
  36. package/dist/engine/style.d.ts +1 -1
  37. package/dist/engine/tabicon.d.ts +2 -2
  38. package/dist/engine/underbar.d.ts +26 -7
  39. package/dist/engine/underneath.d.ts +1 -0
  40. package/dist/engine/width.d.ts +3 -3
  41. package/dist/{framekit-r16k97n7.js → framekit-n57ts9zt.js} +959 -87
  42. package/dist/{framekit-40pzennw.js → framekit-wqp811a2.js} +959 -87
  43. package/dist/grab/clipboard.d.ts +2 -0
  44. package/dist/{index-jfv7vavj.js → index-311fys81.js} +93 -29
  45. package/dist/index-3dcgysws.js +77 -0
  46. package/dist/{index-ztnjefrh.js → index-585hs9tp.js} +5 -1
  47. package/dist/{index-za4ppxay.js → index-6t0w5s7p.js} +1 -1
  48. package/dist/{index-tqq2ygpj.js → index-9targr2f.js} +26 -16
  49. package/dist/{index-t4kssacm.js → index-abwqw8jh.js} +6 -1
  50. package/dist/{index-s6yzsvs4.js → index-b8cnnbpr.js} +25 -18
  51. package/dist/{index-xxbb8y41.js → index-cfrnrg24.js} +20 -14
  52. package/dist/{index-v2v4rmpe.js → index-dvtbh3c8.js} +24 -18
  53. package/dist/{index-0qkj2mgb.js → index-j8hrzag1.js} +14 -11
  54. package/dist/{index-cb91vcka.js → index-k4w5v53q.js} +1 -1
  55. package/dist/{index-q53j8wg5.js → index-n31pn4ax.js} +19 -15
  56. package/dist/{index-s6fya8pm.js → index-pvknvvkw.js} +11 -10
  57. package/dist/{index-3nwycv3p.js → index-qz04adp5.js} +20 -14
  58. package/dist/{index-ymqm185m.js → index-rps0bdq9.js} +1 -1
  59. package/dist/{index-a8ffw5ft.js → index-szd9bddn.js} +1 -1
  60. package/dist/{index-8d1yk9d2.js → index-t7a07nm9.js} +59 -39
  61. package/dist/{index-2jc9dnta.js → index-vhda420r.js} +11 -5
  62. package/dist/{index-xs29b55n.js → index-vmprrfwe.js} +5 -2
  63. package/dist/{index-fjrrgd9h.js → index-vmz7htwn.js} +1 -1
  64. package/dist/index.d.ts +14 -8
  65. package/dist/index.global.js +182 -165
  66. package/dist/index.js +57 -32
  67. package/dist/instance.d.ts +7 -1
  68. package/dist/mark.d.ts +50 -0
  69. package/dist/{react-vvc4x9kq.js → react-0tbd51s3.js} +14 -11
  70. package/dist/{react-0gxs9aef.js → react-4ezjf7mq.js} +24 -18
  71. package/dist/react-4qn9vsjw.js +78 -0
  72. package/dist/{react-73reavv4.js → react-4tcwpama.js} +1 -1
  73. package/dist/{react-6ngtb6p9.js → react-7eyps0cg.js} +1 -1
  74. package/dist/{react-zp7fdw8e.js → react-881wvm1z.js} +59 -39
  75. package/dist/{react-yx3g9k55.js → react-amvrbng8.js} +5 -2
  76. package/dist/{react-5rq7bnsy.js → react-atw9y8ny.js} +5 -1
  77. package/dist/{react-4phtr2nd.js → react-dg4bjv3j.js} +1 -1
  78. package/dist/{react-meve34wp.js → react-hdneb4v3.js} +11 -5
  79. package/dist/{react-h9w04skh.js → react-j87bdhhe.js} +4 -1
  80. package/dist/{react-wtgvkf6g.js → react-mkafgzqf.js} +1 -1
  81. package/dist/{react-fq4551ks.js → react-pf7fc2f3.js} +11 -10
  82. package/dist/{react-0r5418av.js → react-rbmk30xk.js} +92 -29
  83. package/dist/{react-actmnkwp.js → react-rxw73n04.js} +1 -1
  84. package/dist/{react-8nmtt0ge.js → react-w94cfn87.js} +19 -15
  85. package/dist/{react-3ev6rwqz.js → react-x209et38.js} +26 -16
  86. package/dist/{react-5h7pxnax.js → react-zj0dbpdg.js} +25 -18
  87. package/dist/react.d.ts +3 -1
  88. package/dist/react.js +60 -33
  89. package/dist/{replay-pmesjfa3.js → replay-3xqgt3xg.js} +8 -8
  90. package/dist/{replay-m5g8km9y.js → replay-48gn27bj.js} +8 -8
  91. package/dist/storage/onload.d.ts +1 -1
  92. package/dist/{storageview-9a6zm47z.js → storageview-5tvmca8y.js} +16 -13
  93. package/dist/{storageview-x62v1c3j.js → storageview-ec52x60p.js} +16 -13
  94. package/dist/styles/force.d.ts +3 -1
  95. package/dist/types.d.ts +4 -4
  96. package/dist/ui/actions.d.ts +3 -3
  97. package/dist/ui/bindings.d.ts +1 -1
  98. package/dist/ui/catalog.d.ts +14 -14
  99. package/dist/ui/changes.d.ts +1 -1
  100. package/dist/ui/colors.d.ts +1 -1
  101. package/dist/ui/deviceknobs.d.ts +2 -2
  102. package/dist/ui/editors.d.ts +3 -3
  103. package/dist/ui/foldslider.d.ts +2 -2
  104. package/dist/ui/keys.d.ts +1 -1
  105. package/dist/ui/list.d.ts +10 -10
  106. package/dist/ui/palette.d.ts +2 -2
  107. package/dist/ui/pin.d.ts +2 -2
  108. package/dist/ui/prefs.d.ts +1 -1
  109. package/dist/ui/rows.d.ts +3 -3
  110. package/dist/ui/storageview.d.ts +2 -2
  111. package/dist/ui/stylesview.d.ts +3 -3
  112. package/dist/ui/swatches.d.ts +2 -2
  113. package/package.json +2 -1
  114. package/skills/knobs/SKILL.md +36 -35
  115. package/dist/index-5tv6sr74.js +0 -23
  116. package/dist/react-t2qnewz2.js +0 -24
@@ -1,9 +1,18 @@
1
+ /** The elements of a page that show a picture of their own, which a drawing of the page cannot load and a rough one draws by hand. */
2
+ export declare const MEDIA = "img, video, canvas";
3
+ export type MediaNode = HTMLImageElement | HTMLVideoElement | HTMLCanvasElement;
1
4
  /** A picture, video or drawing of the page that can be drawn now, and its size as made, in its own px. */
2
- interface Media {
5
+ export interface Media {
3
6
  source: CanvasImageSource;
4
7
  width: number;
5
8
  height: number;
9
+ /** How many of the source's px one of its px as made takes, where they differ: 1 where unset. */
10
+ scale?: number;
6
11
  }
12
+ /** What `node` shows, where it has it by now: a picture that has loaded, a video with a frame, a drawing with a size. */
13
+ export declare function mediaOf(node: MediaNode): Media | null;
14
+ /** What of an element's computed style fits a picture into its box. */
15
+ export type FitStyle = Pick<CSSStyleDeclaration, "borderLeftWidth" | "borderRightWidth" | "borderTopWidth" | "borderBottomWidth" | "paddingLeft" | "paddingRight" | "paddingTop" | "paddingBottom" | "objectFit" | "objectPosition" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius" | "imageRendering">;
7
16
  /**
8
17
  * Draw one of the page's pictures where its element shows it, `rect`, as its
9
18
  * `style` fits it in: inside the border and padding, cut and placed as
@@ -12,7 +21,7 @@ interface Media {
12
21
  * drawn into the element's box whole is squeezed wherever the page cuts it
13
22
  * to cover the box, or leaves room around it.
14
23
  */
15
- export declare function drawMedia(pen: CanvasRenderingContext2D, media: Media, rect: DOMRect, style: CSSStyleDeclaration): void;
24
+ export declare function drawMedia(pen: CanvasRenderingContext2D, media: Media, rect: Pick<DOMRect, "left" | "top" | "width" | "height">, style: FitStyle): void;
16
25
  /**
17
26
  * What the page's pictures show now, which no change to the page tells of: a
18
27
  * picture another source was picked for, or one that has loaded since, each
@@ -101,11 +110,23 @@ export declare function marginPlace(shot: number, padded: number): {
101
110
  };
102
111
  /** A picture of nothing, `width` by `height` px as made, as data: it holds a picture's place and draws none. */
103
112
  export declare function blankUrl(width: number, height: number): string;
113
+ /** Does an element with `overflow` on one axis, as it computes, cut off what overflows it there? */
114
+ export declare function cuts(overflow: string): boolean;
115
+ /**
116
+ * The element of the page in `doc` whose overflow the viewport takes: the
117
+ * root, or the body where the root's overflow is visible both ways, or null
118
+ * where it has no body. The page lays that element out as if its overflow
119
+ * were visible. Its copy in a drawing is no document's root, so it would
120
+ * cut off what overflows it, or make a scroll container of it.
121
+ */
122
+ export declare function viewportOverflow(doc: Document, view: Window): Element | null;
104
123
  /**
105
124
  * The page in `frame`, copied as it is now for `paintPage`, or null where it
106
125
  * is out of reach. What `leave` picks of the page is left out of the copy.
126
+ * `each` is told of each element of the page and its copy, before anything is
127
+ * taken out of the copy.
107
128
  */
108
- export declare function copyPage(frame: HTMLIFrameElement, leave?: (node: Element) => boolean): Element | null;
129
+ export declare function copyPage(frame: HTMLIFrameElement, leave?: (node: Element) => boolean, each?: (node: Element, copy: Element) => void): Element | null;
109
130
  /** `svg` as a data url, any lone half of a pair made U+FFFD first, as encoding one throws. */
110
131
  export declare function svgUrl(svg: string): string;
111
132
  /**
@@ -152,4 +173,3 @@ export declare function paintPage(frame: HTMLIFrameElement, glass: HTMLElement,
152
173
  width: number;
153
174
  height: number;
154
175
  }, color: string, copy: Element): Promise<HTMLCanvasElement | null>;
155
- export {};
@@ -1,4 +1,4 @@
1
- import type { DevknobsState, MatColorValue } from "../types";
1
+ import type { KnobsState, MatColorValue } from "../types";
2
2
  import type { Look } from "./browserkit";
3
3
  import type { Docked } from "./dock";
4
4
  /**
@@ -12,7 +12,7 @@ export declare const Z_INDEX = 2147483645;
12
12
  /** Marks the early script's style and its stand-in. */
13
13
  export declare const EARLY = "early";
14
14
  /** Where the frame's drawing is kept for the next page, in `sessionStorage`. */
15
- export declare const SNAPSHOT_KEY = "devknobs:snapshot";
15
+ export declare const SNAPSHOT_KEY = "knobs:snapshot";
16
16
  /** The version of the snapshot `SNAPSHOT_KEY` keeps. Bump it with a new shape, see stored.ts. */
17
17
  export declare const SNAPSHOT_VERSION = 1;
18
18
  /** How long the stand-in waits for devknobs before it gives the page back, in ms. */
@@ -25,7 +25,7 @@ export declare const GIVE_UP = 3000;
25
25
  */
26
26
  export declare function coverCss(mat: MatColorValue | null): string;
27
27
  /** The knobs a drawing of the frame depends on, beside the window's size. */
28
- export type Drawn = Pick<DevknobsState, "width" | "height" | "frame" | "dpr" | "vision" | "scheme" | "device" | "orientation" | "posture" | "mock" | "browser" | "bars" | "edgeToEdge" | "zoom" | "mat"> & {
28
+ export type Drawn = Pick<KnobsState, "width" | "height" | "frame" | "dpr" | "vision" | "scheme" | "device" | "orientation" | "posture" | "mock" | "browser" | "bars" | "edgeToEdge" | "zoom" | "mat"> & {
29
29
  panel: Docked;
30
30
  };
31
31
  /** The window's size and pixel ratio, which a drawing of the frame depends on too. */
@@ -1,4 +1,4 @@
1
- import type { DevknobsState } from "../types";
1
+ import type { KnobsState } from "../types";
2
2
  /** What the reloads need of the width knob's frame. */
3
3
  export interface Frame {
4
4
  /** The window inside the frame, while there is one. */
@@ -32,4 +32,4 @@ export declare function navigationOf(view: Window): EventTarget | null;
32
32
  */
33
33
  export declare function settle(): void;
34
34
  /** Keep the knobs, and reload the frame if its page loaded as another device. */
35
- export declare function knobs(state: DevknobsState): void;
35
+ export declare function knobs(state: KnobsState): void;
@@ -2,6 +2,8 @@ import type { Actions, Look, Painted } from "./browserkit";
2
2
  import { type Color } from "./color";
3
3
  import { type Bars, type Shape } from "./browserui";
4
4
  import type { Rect } from "./mock";
5
+ /** The domain's padding above and below, in em: its box then holds the system font's ascent and descent, 1.23 em at most. */
6
+ export declare const DOMAIN_PAD = 0.15;
5
7
  export declare const SAFARI_CSS: string;
6
8
  /**
7
9
  * The status bar's glyphs, measured on the iOS 27.0 simulator in pt, on the
@@ -130,8 +132,27 @@ export declare const DUO_GLYPHS: {
130
132
  };
131
133
  /** The address as Safari shows it: the host alone, without its port. */
132
134
  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. */
134
- export declare function pillBox(pill: Shape, host: string): Rect;
135
+ /**
136
+ * The room the domain has in `shape`, in px, on a screen `width` wide: in
137
+ * the minimized pill, the domain's advance at the pill's size, or as much as
138
+ * the pill gets PILL_MARGIN in from the screen's sides; in an address, as
139
+ * wide as it goes centered, MARK_CLEAR clear of the glyphs at its ends.
140
+ */
141
+ export declare function domainRoom(shape: Shape, host: string, width: number): number;
142
+ /** How the domain is shown in a shape: its size, its room, and is its start cut? */
143
+ export interface DomainFit {
144
+ size: number;
145
+ room: number;
146
+ cut: boolean;
147
+ }
148
+ /**
149
+ * How Safari fits the domain in `shape` on a screen `width` wide: the pill at
150
+ * its own size, cut where the screen's sides clamp it; an address at 17, shrunk
151
+ * to its room down to FIELD_LEAST, and cut where it is still too wide there.
152
+ */
153
+ export declare function domainFit(shape: Shape, host: string, width: number): DomainFit;
154
+ /** The minimized domain pill's box on a screen `width` wide: its domain's room and the pill's either side. */
155
+ export declare function pillBox(pill: Shape, host: string, width: number): Rect;
135
156
  /** How Safari's glass looks over a color of the page. */
136
157
  export interface Tint {
137
158
  /** The glass's color where the page under it is that color all over. */
@@ -166,7 +187,7 @@ export declare function scrimOver(node: HTMLElement, mini: Bars, look: Look): Co
166
187
  * Safari's bars, drawn once for both states (the plus to menu morph of
167
188
  * transitions.dev). The address capsule, Bottom's card or Top's address bar
168
189
  * is one surface that becomes the minimized pill: its box and corners tween,
169
- * the domain glides and scales from 17 to the pill's size in it, and the page
190
+ * the domain glides and scales from its fitted size to the pill's in it, and the page
170
191
  * menu, reload and Bottom's buttons fade out as an icon swap. The capsules
171
192
  * beside it fade and drift 10 px.
172
193
  */
@@ -1,4 +1,4 @@
1
- import type { DevknobsState } from "../types";
1
+ import type { KnobsState } from "../types";
2
2
  /**
3
3
  * A phone's or a tablet's screen as the page reads it in `window.screen`:
4
4
  * `width`, `height`, `availWidth` and `availHeight` in css px, all of the
@@ -15,7 +15,7 @@ export interface ScreenSize {
15
15
  /** Where not the height. */
16
16
  availHeight?: number;
17
17
  }
18
- type ScreenKnobs = Pick<DevknobsState, "device" | "posture" | "orientation">;
18
+ type ScreenKnobs = Pick<KnobsState, "device" | "posture" | "orientation">;
19
19
  /** The screen a page in the frame reads for these knobs, null for the window's own. */
20
20
  export declare function screenSizeOf(state: ScreenKnobs): ScreenSize | null;
21
21
  /** Put `size` on the screen of the window `scope`, or null to give it back what it had. */
@@ -8,7 +8,7 @@
8
8
  * too, where it starts the session over.
9
9
  */
10
10
  /** Where the positions are kept for the next page, in `sessionStorage`. */
11
- export declare const SCROLL_KEY = "devknobs:scroll";
11
+ export declare const SCROLL_KEY = "knobs:scroll";
12
12
  /** The version of the record `SCROLL_KEY` keeps. Bump it with a change of shape, see stored.ts. */
13
13
  export declare const SCROLL_VERSION = 1;
14
14
  /** How long a load devknobs asked for has to bring its page, in ms. A later load is the visitor's. */
@@ -1,12 +1,12 @@
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
- export declare const STORAGE_KEY = "devknobs";
1
+ import type { BarsValue, BrowserValue, ClockMode, ConnectionValue, ContrastValue, KnobsState, KnobsStatePatch, DevIconValue, DirValue, EdgeValue, GeoErrorValue, CustomColor, GrabColorValue, MotionValue, OnlineValue, OrientationValue, PanelValue, SaveDataValue, SchemeValue, SideValue, TransparencyValue, VisionValue } from "../types";
2
+ export declare const STORAGE_KEY = "knobs";
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;
5
5
  /**
6
6
  * Where the panel's place is kept beside the session, in `localStorage`, so
7
7
  * a new tab or session starts with the panel where the user last put it.
8
8
  */
9
- export declare const PLACE_KEY = "devknobs:place";
9
+ export declare const PLACE_KEY = "knobs:place";
10
10
  /** The version of the place `PLACE_KEY` keeps. Bump it with a change of shape, see stored.ts. */
11
11
  export declare const PLACE_VERSION = 2;
12
12
  /** What of the panel outlives the session: its side, where it sits on it, and whether it is pinned there. */
@@ -21,7 +21,7 @@ export declare const DEFAULT_PINNED: readonly string[];
21
21
  * and the panel's top with it.
22
22
  */
23
23
  export declare const PANEL_START = 128;
24
- export declare const DEFAULT_STATE: DevknobsState;
24
+ export declare const DEFAULT_STATE: KnobsState;
25
25
  export declare const SCHEMES: SchemeValue[];
26
26
  export declare const MOTIONS: MotionValue[];
27
27
  export declare const CONTRASTS: ContrastValue[];
@@ -41,29 +41,29 @@ export declare const DEV_ICONS: DevIconValue[];
41
41
  export declare const VISIONS: VisionValue[];
42
42
  export declare const GRAB_COLORS: Exclude<GrabColorValue, CustomColor>[];
43
43
  /** The place of a state's panel, as `PLACE_KEY` keeps it. */
44
- export declare function placeText(state: DevknobsState): string;
44
+ export declare function placeText(state: KnobsState): string;
45
45
  /**
46
46
  * Read a stored state, falling back to the defaults field by field. The
47
47
  * panel's place falls back to `place`, the one kept across sessions, before
48
48
  * the defaults, so the session's own place wins where it has one.
49
49
  */
50
- export declare function parse(json: string | null | undefined, place?: string | null): DevknobsState;
50
+ export declare function parse(json: string | null | undefined, place?: string | null): KnobsState;
51
51
  /**
52
52
  * What reset all leaves: every knob at its default and the default rows
53
53
  * listed, with the panel where it is, pinned or not.
54
54
  */
55
- export declare function resetState(state: DevknobsState): DevknobsState;
55
+ export declare function resetState(state: KnobsState): KnobsState;
56
56
  /**
57
57
  * Merge a patch into a state, one level deep for the object knobs. The clock
58
58
  * takes a new anchor when it moves. A device brings its size, and the device
59
59
  * fields follow the size the frame ends up with.
60
60
  */
61
- export declare function merge(state: DevknobsState, patch: DevknobsStatePatch): DevknobsState;
62
- export declare function load(): DevknobsState;
63
- export declare function save(state: DevknobsState): void;
61
+ export declare function merge(state: KnobsState, patch: KnobsStatePatch): KnobsState;
62
+ export declare function load(): KnobsState;
63
+ export declare function save(state: KnobsState): void;
64
64
  /**
65
65
  * Keep the panel's place across sessions. Only a move the user makes writes
66
66
  * it, so a tab that merely lays the panel out again leaves the place another
67
67
  * tab put there alone.
68
68
  */
69
- export declare function keepPlace(state: DevknobsState): void;
69
+ export declare function keepPlace(state: KnobsState): void;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The names of the items knobs keeps in web storage. Each is `knobs` or
3
+ * `knobs:<name>`, and was `devknobs` or `devknobs:<name>` before the rename.
4
+ * An old copy (an npm copy before 0.8, or the 0.7 extension) and a new copy
5
+ * can share one origin. The old copy reads and writes the old name only, and
6
+ * a new copy writes both names with one value, so where the two differ, the
7
+ * old copy wrote last. While both are written, the old name is the truth: a
8
+ * read takes the old item, a write puts the old item first and then the new
9
+ * one, a remove drops both, and an item is listed only where its old name is.
10
+ *
11
+ * Writing the old items goes away two minor releases after 0.8. That release
12
+ * must copy each old item to its new name once, then read the new name only,
13
+ * and drop the old item on every write, so a stale old item never comes back.
14
+ */
15
+ /** A key as a copy before the rename wrote it: `knobs:x` was `devknobs:x`. */
16
+ export declare function oldKey(key: string): string;
17
+ /** The new name of an item knobs keeps, old or new, or null for one of the page's. */
18
+ export declare function ownName(key: string): string | null;
19
+ /** Is `key` an item knobs keeps for itself, under either name, and not one of the page's? */
20
+ export declare function isOwnKey(key: string): boolean;
21
+ /** Does a storage event's key name the item `key`, under either name? */
22
+ export declare function sameItem(eventKey: string | null, key: string): boolean;
23
+ /**
24
+ * The item `key`, read under its old name where it has one. A new item with
25
+ * no old one beside it is not read: an old copy removes the old name only, so
26
+ * that new item is one the old copy removed.
27
+ */
28
+ export declare function readItem(storage: Storage | null | undefined, key: string): string | null;
29
+ /** Write the item `key` under both names, the old one first, so a refused second write leaves the truth current. */
30
+ export declare function writeItem(storage: Storage | null | undefined, key: string, value: string): void;
31
+ /** Drop the item `key` under both names. */
32
+ export declare function removeItem(storage: Storage | null | undefined, key: string): void;
33
+ /** The new names of the items that start with `prefix`, a new name, listed where their old name is, as `readItem` reads them. */
34
+ export declare function itemKeys(storage: Storage, prefix: string): string[];
@@ -36,7 +36,7 @@ export interface SwitchedSheet {
36
36
  export declare function switchedSheet(root: Root, name: string): SwitchedSheet | null;
37
37
  /** The sheet devknobs keeps on the page under `name`, if it has one. */
38
38
  export declare function findStyle(name: string, doc?: Document): OwnStyle | null;
39
- /** Every node devknobs adds to the page carries `data-devknobs`. */
39
+ /** Every node devknobs adds to the page carries `data-knobs` and `data-devknobs`. */
40
40
  export declare function ensureStyle(name: string, doc?: Document): OwnStyle;
41
41
  export declare function removeStyle(name: string, doc?: Document): void;
42
42
  export {};
@@ -9,9 +9,9 @@ import { type IconSource } from "./devicon";
9
9
  * links on a navigation gets its new ones drawn too.
10
10
  */
11
11
  /** Where a link keeps the address it had before the ribbon. */
12
- export declare const ORIGINAL_HREF = "data-devknobs-href";
12
+ export declare const ORIGINAL_HREF: "data-devknobs-href";
13
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";
14
+ export declare const ADDED_ICON: "data-devknobs-icon";
15
15
  /** Whether a host is this machine or the local network, where a page is a dev one. */
16
16
  export declare function localHost(hostname: string): boolean;
17
17
  /** Whether the ribbon shows on a host: `auto` on a local one only. */
@@ -1,3 +1,4 @@
1
+ import { type Overlay, type Span } from "./bandmedia";
1
2
  import { type Look } from "./browserkit";
2
3
  import type { Bars } from "./browserui";
3
4
  import type { Rect } from "./mock";
@@ -9,12 +10,16 @@ import type { Rect } from "./mock";
9
10
  * viewport's bottom edge: one picture of the whole document, drawn by the
10
11
  * browser through an svg, which a scroll only moves. It is pictured again
11
12
  * 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.
13
+ * the time, and when the band scrolls past the pictures read for it. The
14
+ * pictures, videos and drawings near the band are in it as they show, which
15
+ * a drawing of the copy could not load (see `bandmedia.ts`). What is pinned
16
+ * to the screen is left out of it, as it stays in the viewport on the phone,
17
+ * and a fixed footer's color is carried down instead, by the screen's fill
18
+ * under the band. A page out of reach shows that fill too. A page that
19
+ * scrolls in its body, not in its document, shows its body's content past
20
+ * the viewport, as far down as the body is scrolled.
16
21
  */
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";
22
+ 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.underbar > canvas {\n position: absolute;\n left: 0;\n top: 0;\n max-width: none;\n will-change: transform;\n}\n";
18
23
  /** The band under the viewport, in the screen's css px, or null where the page reaches the screen's bottom. */
19
24
  export declare function bandRect(page: Rect | null, height: number): Rect | null;
20
25
  /**
@@ -35,19 +40,33 @@ export declare function bandShift(scrollY: number, innerHeight: number, scale: n
35
40
  * whole document, which would stretch them.
36
41
  */
37
42
  export declare function viewportUnits(css: string, height: number): string;
43
+ /**
44
+ * The body of the page in `doc`, where the page scrolls in it and not in its
45
+ * document: the root's overflow went to the viewport, so the body keeps its
46
+ * own, which scrolls up and down. Null where the document scrolls.
47
+ */
48
+ export declare function bodyScroller(doc: Document, view: Window): HTMLElement | null;
49
+ /** How far down the page in `doc` is scrolled, in its document and in a body that scrolls, in css px. */
50
+ export declare function scrollOf(doc: Document, view: Window): number;
38
51
  /** The picture of a page as an svg, `width` by `height` css px, and its markup's address. */
39
52
  export interface Picture {
40
53
  src: string;
41
54
  width: number;
42
55
  height: number;
56
+ /** The stretch of the document whose pictures it shows, or null where the page has none to show. */
57
+ span: Span | null;
58
+ /** What the frame may not read near the band, drawn by hand over it. */
59
+ overlay: Overlay | null;
43
60
  }
44
61
  /**
45
62
  * The whole page in `frame` as an svg as tall as the document, laid out as
46
63
  * the frame lays it out, or null where it is out of reach. Its viewport
47
64
  * lengths and the root's height are the frame's, and what is fixed to the
48
- * screen is left out.
65
+ * screen is left out. The pictures near the band, `band` of the document's
66
+ * css px tall under the viewport, are in it, and `loaded` is told when one
67
+ * comes that was not there yet.
49
68
  */
50
- export declare function pictureOf(frame: HTMLIFrameElement): Picture | null;
69
+ export declare function pictureOf(frame: HTMLIFrameElement, band?: number, loaded?: () => void): Picture | null;
51
70
  export interface Underbar {
52
71
  /** Lay the band over `rect` of the screen, at `zoom`, in the page's `look`, or hide it with null. */
53
72
  show(rect: Rect | null, zoom: number, look: Look | null): void;
@@ -1,3 +1,4 @@
1
+ /** `showModal` as the page had it, while the page underneath gets plain dialogs. */
1
2
  /**
2
3
  * Hide the page under the frame, what it adds to the body later too, and give
3
4
  * it plain dialogs, until `uncover`.
@@ -1,10 +1,10 @@
1
- import type { DevknobsState, ZoomValue } from "../types";
1
+ import type { KnobsState, ZoomValue } from "../types";
2
2
  import { type Docked } from "./dock";
3
3
  import { type FrameKnobs, type ZoomAction } from "./frame";
4
4
  import { type FrameRefusal } from "./native";
5
5
  export { type Fit, fit, label, origin, STRIP } from "./fit";
6
6
  /** What the frame takes from the knobs. */
7
- export type ViewportValue = FrameKnobs & Pick<DevknobsState, "scheme" | "device" | "orientation" | "posture" | "mock" | "browser" | "bars" | "edgeToEdge" | "zoom" | "mat"> & {
7
+ export type ViewportValue = FrameKnobs & Pick<KnobsState, "scheme" | "device" | "orientation" | "posture" | "mock" | "browser" | "bars" | "edgeToEdge" | "zoom" | "mat"> & {
8
8
  panel: Docked;
9
9
  };
10
10
  /**
@@ -24,7 +24,7 @@ export declare const COVER_CAP: number;
24
24
  /** The window inside the frame, while there is one. */
25
25
  export declare function frameWindow(): Window | null;
26
26
  /** Keep the knobs and hand them to the frame, which applies them to its own page. */
27
- export declare function sync(state: DevknobsState): void;
27
+ export declare function sync(state: KnobsState): void;
28
28
  export declare function onExit(handler: (() => void) | null): void;
29
29
  export declare function onRefused(handler: ((url: string) => Promise<FrameRefusal | null>) | null): void;
30
30
  export declare function onFramed(handler: ((open: boolean) => void | Promise<void>) | null): void;