@vinena/knobs 0.6.6 → 0.7.1

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 +26 -0
  2. package/README.md +13 -7
  3. package/THIRD_PARTY_NOTICES.md +3 -3
  4. package/dist/cli.d.ts +95 -0
  5. package/dist/cli.js +527 -0
  6. package/dist/{context-eawqn680.js → context-2r76ext7.js} +3 -3
  7. package/dist/{context-vd2xep5t.js → context-h1bdt8w3.js} +3 -3
  8. package/dist/early.global.js +7 -8
  9. package/dist/edit/html.d.ts +7 -3
  10. package/dist/edit/keep.d.ts +2 -2
  11. package/dist/{elementsview-n26sp8m7.js → elementsview-mcg6d5zp.js} +21 -19
  12. package/dist/{elementsview-dpm0xmb2.js → elementsview-mwr1s17z.js} +21 -19
  13. package/dist/engine/bezels.d.ts +2 -2
  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/placeholder.d.ts +3 -3
  29. package/dist/engine/reload.d.ts +2 -2
  30. package/dist/engine/screen.d.ts +2 -2
  31. package/dist/engine/scrollkeep.d.ts +1 -1
  32. package/dist/engine/store.d.ts +11 -11
  33. package/dist/engine/storekeys.d.ts +34 -0
  34. package/dist/engine/style.d.ts +1 -1
  35. package/dist/engine/tabicon.d.ts +2 -2
  36. package/dist/engine/underneath.d.ts +1 -0
  37. package/dist/engine/width.d.ts +3 -3
  38. package/dist/{framekit-0as9t6a7.js → framekit-4v7nc3ea.js} +25 -20
  39. package/dist/{framekit-dknq662p.js → framekit-wyppj1se.js} +25 -20
  40. package/dist/grab/clipboard.d.ts +2 -0
  41. package/dist/{index-jfv7vavj.js → index-311fys81.js} +93 -29
  42. package/dist/index-3dcgysws.js +77 -0
  43. package/dist/{index-7vb2ct4s.js → index-3s4v7gw5.js} +11 -10
  44. package/dist/{index-ztnjefrh.js → index-585hs9tp.js} +5 -1
  45. package/dist/{index-za4ppxay.js → index-6t0w5s7p.js} +1 -1
  46. package/dist/{index-r1rdj05c.js → index-82y8x8vv.js} +14 -11
  47. package/dist/{index-dxga6h10.js → index-9targr2f.js} +26 -16
  48. package/dist/{index-x3sxssbs.js → index-a23nv5j4.js} +65 -45
  49. package/dist/{index-t4kssacm.js → index-abwqw8jh.js} +6 -1
  50. package/dist/{index-s6yzsvs4.js → index-bgzyc7rz.js} +22 -15
  51. package/dist/{index-t4wrs2a3.js → index-c1t6knbf.js} +20 -14
  52. package/dist/{index-7w0nm76e.js → index-cqymjce4.js} +20 -14
  53. package/dist/{index-69fvtkcm.js → index-dvtbh3c8.js} +24 -18
  54. package/dist/{index-ajs4na3f.js → index-k4w5v53q.js} +2 -2
  55. package/dist/{index-df35z48z.js → index-n31pn4ax.js} +20 -16
  56. package/dist/{index-ymqm185m.js → index-rps0bdq9.js} +1 -1
  57. package/dist/{index-a8ffw5ft.js → index-szd9bddn.js} +1 -1
  58. package/dist/{index-whehz74d.js → index-vhda420r.js} +32 -6
  59. package/dist/{index-xs29b55n.js → index-vmprrfwe.js} +5 -2
  60. package/dist/{index-20bc9yrj.js → index-vmz7htwn.js} +1 -1
  61. package/dist/index.d.ts +14 -8
  62. package/dist/index.global.js +176 -159
  63. package/dist/index.js +108 -43
  64. package/dist/instance.d.ts +7 -1
  65. package/dist/mark.d.ts +50 -0
  66. package/dist/{react-msn10fjb.js → react-4ezjf7mq.js} +24 -18
  67. package/dist/react-4qn9vsjw.js +78 -0
  68. package/dist/{react-73reavv4.js → react-4tcwpama.js} +1 -1
  69. package/dist/{react-k4pkm1p5.js → react-7eyps0cg.js} +2 -2
  70. package/dist/{react-10r2rczp.js → react-7tzwahsm.js} +14 -11
  71. package/dist/{react-yx3g9k55.js → react-amvrbng8.js} +5 -2
  72. package/dist/{react-5rq7bnsy.js → react-atw9y8ny.js} +5 -1
  73. package/dist/{react-4phtr2nd.js → react-dg4bjv3j.js} +1 -1
  74. package/dist/{react-vbk58f9m.js → react-hdneb4v3.js} +32 -6
  75. package/dist/{react-h9w04skh.js → react-j87bdhhe.js} +4 -1
  76. package/dist/{react-wtgvkf6g.js → react-mkafgzqf.js} +1 -1
  77. package/dist/{react-a1r0nr0g.js → react-ppyj3fg2.js} +65 -45
  78. package/dist/{react-0r5418av.js → react-rbmk30xk.js} +92 -29
  79. package/dist/{react-y9gr8yt2.js → react-rxw73n04.js} +1 -1
  80. package/dist/{react-5h7pxnax.js → react-tet7swk2.js} +22 -15
  81. package/dist/{react-5ekfj7g3.js → react-w94cfn87.js} +20 -16
  82. package/dist/{react-v08ywmtw.js → react-wzd3cfg8.js} +11 -10
  83. package/dist/{react-2b7725je.js → react-x209et38.js} +26 -16
  84. package/dist/react.d.ts +3 -1
  85. package/dist/react.js +111 -44
  86. package/dist/{replay-ehgxp9py.js → replay-3xqgt3xg.js} +8 -8
  87. package/dist/{replay-461gcdh1.js → replay-48gn27bj.js} +8 -8
  88. package/dist/storage/onload.d.ts +1 -1
  89. package/dist/{storageview-5p1y11b5.js → storageview-2rvwk0v7.js} +20 -17
  90. package/dist/{storageview-kxzpnfvr.js → storageview-6vq7nz02.js} +20 -17
  91. package/dist/styles/force.d.ts +3 -1
  92. package/dist/types.d.ts +4 -4
  93. package/dist/ui/actions.d.ts +3 -3
  94. package/dist/ui/bindings.d.ts +1 -1
  95. package/dist/ui/catalog.d.ts +14 -14
  96. package/dist/ui/changes.d.ts +1 -1
  97. package/dist/ui/colors.d.ts +1 -1
  98. package/dist/ui/deviceknobs.d.ts +2 -2
  99. package/dist/ui/editors.d.ts +3 -3
  100. package/dist/ui/foldslider.d.ts +2 -2
  101. package/dist/ui/icons.d.ts +5 -2
  102. package/dist/ui/keys.d.ts +1 -1
  103. package/dist/ui/list.d.ts +10 -10
  104. package/dist/ui/palette.d.ts +2 -2
  105. package/dist/ui/panel.d.ts +2 -0
  106. package/dist/ui/pin.d.ts +2 -2
  107. package/dist/ui/prefs.d.ts +1 -1
  108. package/dist/ui/rows.d.ts +3 -3
  109. package/dist/ui/settings.d.ts +11 -1
  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 +5 -2
  114. package/skills/{devknobs → knobs}/SKILL.md +52 -51
  115. package/dist/index-5tv6sr74.js +0 -23
  116. package/dist/react-t2qnewz2.js +0 -24
@@ -1,4 +1,4 @@
1
- import type { DevknobsState, OrientationValue } from "../types";
1
+ import type { KnobsState, OrientationValue } from "../types";
2
2
  import { type FoldShots } from "./fold";
3
3
  import { type Mock, type Radius } from "./mock";
4
4
  /**
@@ -129,7 +129,7 @@ export declare function foldShots(): FoldPictures | null;
129
129
  /** May the Duo's fold frames still come in for a fold: are they loading or loaded, and has none failed? */
130
130
  export declare function foldShotsDue(): boolean;
131
131
  /** What picks the body drawn around the frame. */
132
- export type BodyKnobs = Pick<DevknobsState, "mock" | "device" | "orientation" | "posture">;
132
+ export type BodyKnobs = Pick<KnobsState, "mock" | "device" | "orientation" | "posture">;
133
133
  /**
134
134
  * The body around the frame: the maker's bezel image where the device has
135
135
  * one, and the drawn mock where it has none or the image does not load. While
@@ -1,8 +1,8 @@
1
- import type { DevknobsStatePatch } from "../types";
1
+ import type { KnobsStatePatch } from "../types";
2
2
  /**
3
3
  * Throw a TypeError at a patch an agent got wrong: a knob or a field the
4
4
  * state does not have, or a value outside what `describe()` says the knob
5
5
  * takes, or for a field it leaves out, what the stored state reads.
6
6
  * The whole patch is checked before any of it is applied.
7
7
  */
8
- export declare function checkPatch(patch: unknown): asserts patch is DevknobsStatePatch;
8
+ export declare function checkPatch(patch: unknown): asserts patch is KnobsStatePatch;
@@ -1,4 +1,4 @@
1
- import type { DevknobsState } from "../types";
1
+ import type { KnobsState } from "../types";
2
2
  /**
3
3
  * What applying a knob takes: nothing, a load or reload of the page in the
4
4
  * device frame, or a reload of the whole page.
@@ -35,7 +35,7 @@ export interface KnobField {
35
35
  export type KnobValue = string | number | boolean | Record<string, string | number | boolean>;
36
36
  export interface KnobDescription {
37
37
  /** The key in a `setState` patch. An object knob may be patched field by field. */
38
- key: keyof DevknobsState;
38
+ key: keyof KnobsState;
39
39
  description: string;
40
40
  value: KnobShape;
41
41
  /** The value `reset()` goes back to, or for `panel`, which `reset()` leaves as it is, the first mount's. */
@@ -1,4 +1,4 @@
1
- import type { DevknobsState, DevknobsStatePatch, OrientationValue, PostureValue } from "../types";
1
+ import type { KnobsState, KnobsStatePatch, OrientationValue, PostureValue } from "../types";
2
2
  export type DeviceKind = "phone" | "tablet" | "laptop" | "desktop";
3
3
  export interface DevicePreset {
4
4
  id: string;
@@ -86,7 +86,7 @@ export declare function turn(size: {
86
86
  * the patch says how. A new orientation alone turns a frame that has both a
87
87
  * width and a height. What the patch sets itself wins over all of it.
88
88
  */
89
- export declare function hold(state: DevknobsState, patch: DevknobsStatePatch): DevknobsStatePatch;
89
+ export declare function hold(state: KnobsState, patch: KnobsStatePatch): KnobsStatePatch;
90
90
  /**
91
91
  * Keep the device fields true to the size: the orientation is the way the
92
92
  * frame stands, portrait while it has no width or height to turn, and a size
@@ -94,4 +94,4 @@ export declare function hold(state: DevknobsState, patch: DevknobsStatePatch): D
94
94
  * brought, unless the change named a browser itself (`dropUa` false). Without a foldable,
95
95
  * the posture is the first, so one picked next comes up in it.
96
96
  */
97
- export declare function settle(state: DevknobsState, dropUa?: boolean): DevknobsState;
97
+ export declare function settle(state: KnobsState, dropUa?: boolean): KnobsState;
@@ -1,4 +1,4 @@
1
- import type { DevknobsState, PostureValue, SideValue } from "../types";
1
+ import type { KnobsState, PostureValue, SideValue } from "../types";
2
2
  import type { Sides } from "./mock";
3
3
  import { type Point } from "./zoom";
4
4
  /** The room over the readout's row, so it stands clear of the window's top edge, in px. */
@@ -28,7 +28,7 @@ export interface Fit {
28
28
  top: number;
29
29
  }
30
30
  /** Does the letterbox read the frame out? A frame the window's size, fitted, is the window. */
31
- export declare function hasStrip(knobs: Pick<DevknobsState, "width" | "height" | "zoom">): boolean;
31
+ export declare function hasStrip(knobs: Pick<KnobsState, "width" | "height" | "zoom">): boolean;
32
32
  /**
33
33
  * Place a frame in a letterbox of `size`, under its readout strip. A width or
34
34
  * height of the frame's own keeps a margin around it, and the window's own
@@ -46,7 +46,7 @@ export declare function hasStrip(knobs: Pick<DevknobsState, "width" | "height" |
46
46
  * is fitted and centered. With a mock, a fit is drawn a hair smaller so the
47
47
  * screen is a whole number of the `ratio`'s device pixels tall.
48
48
  */
49
- export declare function fit(knobs: Pick<DevknobsState, "width" | "height" | "zoom">, size: {
49
+ export declare function fit(knobs: Pick<KnobsState, "width" | "height" | "zoom">, size: {
50
50
  width: number;
51
51
  height: number;
52
52
  }, options?: {
@@ -70,7 +70,7 @@ export declare function origin(place: Fit, room: {
70
70
  * A phone's browser leaves the page less of the screen, and that is the size
71
71
  * it says. The zoom control beside it says the scale.
72
72
  */
73
- export declare function label(place: Fit, knobs: Pick<DevknobsState, "dpr" | "height" | "device"> & {
73
+ export declare function label(place: Fit, knobs: Pick<KnobsState, "dpr" | "height" | "device"> & {
74
74
  posture?: PostureValue;
75
75
  }, page?: {
76
76
  width: number;
@@ -1,4 +1,4 @@
1
- import type { DevknobsState } from "../types";
1
+ import type { KnobsState } from "../types";
2
2
  import { foldRest, holdingHinge, watchFold, watchHinge } from "./foldrun";
3
3
  /**
4
4
  * A hand on a foldable's hinge, for the panel's fold slider, which is
@@ -12,7 +12,7 @@ export { foldRest, holdingHinge, watchFold, watchHinge };
12
12
  * of one toward its other posture, which stays shut or open till the hand
13
13
  * moves. False where it cannot, as while a device turns or changes.
14
14
  */
15
- export declare function takeHinge(state: DevknobsState): boolean;
15
+ export declare function takeHinge(state: KnobsState): boolean;
16
16
  /** Move the hinge the hand holds toward `target`, 0 shut to 1 open. False where no hand holds one. */
17
17
  export declare function moveHinge(target: number): boolean;
18
18
  /**
@@ -1,7 +1,7 @@
1
1
  import { type BoxRing } from "../grab/boxmodel";
2
- import type { DevknobsState, DevknobsStatePatch, PanelValue, SchemeValue } from "../types";
2
+ import type { KnobsState, KnobsStatePatch, PanelValue, SchemeValue } from "../types";
3
3
  /** Marks the iframe the width knob renders the page in. */
4
- export declare const FRAME_ATTRIBUTE = "data-devknobs-frame";
4
+ export declare const FRAME_ATTRIBUTE: "data-devknobs-frame";
5
5
  /**
6
6
  * The same frame by window name. A page that cannot reach its frame element,
7
7
  * such as one on `file:`, still knows it is framed and never opens a frame of
@@ -24,7 +24,7 @@ export type DevknobsMessage =
24
24
  {
25
25
  source: "devknobs";
26
26
  type: "state";
27
- state: DevknobsState;
27
+ state: KnobsState;
28
28
  native?: boolean;
29
29
  } | {
30
30
  source: "devknobs";
@@ -73,14 +73,14 @@ export declare function isDevknobsFrame(): boolean;
73
73
  export declare function nativeScheme(scheme: SchemeValue): boolean;
74
74
  export declare function handsSchemeDown(root: Node): boolean;
75
75
  /** The knobs that bring the frame up. */
76
- export type FrameKnobs = Pick<DevknobsState, "width" | "height" | "frame" | "dpr" | "vision">;
76
+ export type FrameKnobs = Pick<KnobsState, "width" | "height" | "frame" | "dpr" | "vision">;
77
77
  /** Each of those knobs at the value that leaves the frame down. */
78
78
  export declare const UNFRAMED: FrameKnobs;
79
79
  /**
80
80
  * The frame leaving on its own: every knob that keeps it up off and the panel
81
81
  * unpinned. No device as well, so the browser it brought goes as picking none does.
82
82
  */
83
- export declare const EXITED: DevknobsStatePatch;
83
+ export declare const EXITED: KnobsStatePatch;
84
84
  /** The frame knobs, with the panel where it can be pinned to its side. */
85
85
  export type Framing = FrameKnobs & {
86
86
  panel?: Pick<PanelValue, "docked">;
@@ -111,7 +111,7 @@ export declare function frameForced(knobs: Framing): boolean;
111
111
  * The knobs a framed page runs with. It is the viewport already, so it never
112
112
  * frames itself, for a knob or for a pinned panel.
113
113
  */
114
- export declare function framed(state: DevknobsState): DevknobsState;
114
+ export declare function framed(state: KnobsState): KnobsState;
115
115
  /**
116
116
  * Read a devknobs message sent by `from` on `origin`. Anything from another
117
117
  * window or origin, or in another shape, is null.
@@ -1,4 +1,4 @@
1
- import type { DevknobsState, ZoomValue } from "../types";
1
+ import type { KnobsState, ZoomValue } from "../types";
2
2
  import { type ZoomAction } from "./frame";
3
3
  import type { FrameRefusal } from "./native";
4
4
  import type * as Kit from "./framekit";
@@ -15,8 +15,8 @@ type FrameKit = typeof Kit;
15
15
  export declare function loadFrames(): Promise<void>;
16
16
  /** For tests: load the kit from `next` in place of `framekit.ts`. */
17
17
  export declare function loadKitWith(next: () => Promise<FrameKit>): void;
18
- export declare function apply(state: DevknobsState): void;
19
- export declare function sync(state: DevknobsState): void;
18
+ export declare function apply(state: KnobsState): void;
19
+ export declare function sync(state: KnobsState): void;
20
20
  export declare function reset(): void;
21
21
  export declare function onExit(handler: (() => void) | null): void;
22
22
  export declare function onZoom(handler: ((zoom: ZoomValue) => void) | null): void;
@@ -33,7 +33,7 @@ export declare function idle(): boolean;
33
33
  export declare function panelSized(glide: boolean): void;
34
34
  export declare function zoomKey(action: ZoomAction): boolean;
35
35
  export declare function landSplash(): void;
36
- export declare function takeHinge(state: DevknobsState): boolean;
36
+ export declare function takeHinge(state: KnobsState): boolean;
37
37
  export declare function moveHinge(target: number): boolean;
38
38
  export declare function letGo(stop: number): boolean;
39
39
  export declare function holdingHinge(): boolean;
@@ -1,18 +1,25 @@
1
1
  /**
2
- * Fresh mode, and the one way to web storage. With `devknobs=fresh` in the
3
- * page's address, devknobs shows what a first visit sees: it leaves
2
+ * Fresh mode, and the one way to web storage. With `knobs=fresh` (or the old
3
+ * `devknobs=fresh`) in the page's address, devknobs shows what a first visit
4
+ * sees: it leaves
4
5
  * `localStorage` alone, and a load of the page it did not ask for starts with
5
6
  * none of its items in `sessionStorage`. Every read and write devknobs makes
6
7
  * for itself goes through `webStorage`, so the rule holds in one place. The
7
8
  * storage view shows the page's own items, and reaches those directly.
8
9
  */
9
- /** The address parameter and the value that turn fresh mode on. */
10
+ /**
11
+ * The address parameter and the value that turn fresh mode on. `withFresh`
12
+ * writes this one, the old name, so a copy older than 0.8 in the width knob's
13
+ * frame still reads it. Until 1.0.
14
+ */
10
15
  export declare const FRESH_PARAM = "devknobs";
11
16
  export declare const FRESH_VALUE = "fresh";
17
+ /** The parameter's new name, which turns fresh mode on as well. */
18
+ export declare const KNOBS_FRESH_PARAM = "knobs";
12
19
  /** On the width knob's frame while the page above is in fresh mode. */
13
- export declare const FRESH_ATTRIBUTE = "data-devknobs-fresh";
20
+ export declare const FRESH_ATTRIBUTE: "data-devknobs-fresh";
14
21
  /** Where a reload devknobs is about to ask for is timed, in `sessionStorage`. */
15
- export declare const FRESH_RELOAD_KEY = "devknobs:fresh-reload";
22
+ export declare const FRESH_RELOAD_KEY = "knobs:fresh-reload";
16
23
  /** The version of the timing `FRESH_RELOAD_KEY` keeps. Bump it with a change of shape, see stored.ts. */
17
24
  export declare const FRESH_RELOAD_VERSION = 1;
18
25
  /** How long a reload devknobs asked for has to bring its page, in ms. A later load is the user's. */
@@ -1,6 +1,8 @@
1
1
  import type { ClockValue } from "../types";
2
2
  /** The request header that tells the page's own server what time the clock says. */
3
- export declare const NOW_HEADER = "x-devknobs-now";
3
+ export declare const NOW_HEADER = "x-knobs-now";
4
+ /** The header's old name, sent beside it with the same value until 1.0. */
5
+ export declare const OLD_NOW_HEADER = "x-devknobs-now";
4
6
  /** Asked for, and a clock set to send. The real time is no news to a server. */
5
7
  export declare function sends(clock: ClockValue): boolean;
6
8
  /**
@@ -1,4 +1,4 @@
1
- import type { DevknobsState, DprValue } from "../types";
1
+ import type { KnobsState, DprValue } from "../types";
2
2
  /**
3
3
  * What a page reads once as it loads and keeps: the browser, the touch screen
4
4
  * and the pixel ratio. A script that sniffed the user agent or set a canvas up
@@ -13,11 +13,11 @@ export interface Identity {
13
13
  /** Real phone mode: the frame's page loads go to servers as the device, so the page loads again when it turns. */
14
14
  served?: boolean;
15
15
  }
16
- type IdentityKnobs = Pick<DevknobsState, "ua" | "device" | "dpr"> & {
17
- panel?: Pick<DevknobsState["panel"], "realPhone">;
16
+ type IdentityKnobs = Pick<KnobsState, "ua" | "device" | "dpr"> & {
17
+ panel?: Pick<KnobsState["panel"], "realPhone">;
18
18
  };
19
19
  /** What the frame's new window is patched with: its identity, and the screen it reads. */
20
- type PatchKnobs = IdentityKnobs & Pick<DevknobsState, "posture" | "orientation">;
20
+ type PatchKnobs = IdentityKnobs & Pick<KnobsState, "posture" | "orientation">;
21
21
  export declare function identityOf(state: IdentityKnobs): Identity;
22
22
  /** Does a page loaded as `loaded` read wrong under `next`? Not while no page has loaded. */
23
23
  export declare function stale(loaded: Identity | null, next: Identity): boolean;
@@ -1,21 +1,21 @@
1
- import type { DevknobsState, DevknobsStatePatch } from "../types";
1
+ import type { KnobsState, KnobsStatePatch } from "../types";
2
2
  import { type NativeDriver, type NativeSetting } from "./native";
3
3
  export interface EngineOptions {
4
4
  /** Keep the knobs in sessionStorage across reloads. Defaults to true. */
5
5
  persist?: boolean;
6
6
  /** Knobs to apply on top of the stored state. */
7
- state?: DevknobsStatePatch;
7
+ state?: KnobsStatePatch;
8
8
  /**
9
9
  * A host that sets text size, offline, the prefers knobs or the viewport
10
10
  * for real. Those knobs leave the page alone and go to it instead.
11
11
  */
12
12
  native?: NativeDriver;
13
13
  }
14
- export type Listener = (state: DevknobsState) => void;
15
- export declare function getState(): DevknobsState;
14
+ export type Listener = (state: KnobsState) => void;
15
+ export declare function getState(): KnobsState;
16
16
  /** Hear about every knob change, whoever made it. Returns the way to stop. */
17
17
  export declare function subscribe(listener: Listener): () => void;
18
- export declare function applyState(next: DevknobsState): void;
18
+ export declare function applyState(next: KnobsState): void;
19
19
  /**
20
20
  * Turn the host's driver off or on, every knob kept. Off, it is handed its
21
21
  * defaults and the page emulates its knobs as with no driver; on, it takes
@@ -30,14 +30,14 @@ export declare function nativeSwitch(): {
30
30
  on: boolean;
31
31
  note: string | null;
32
32
  } | null;
33
- export declare function setState(patch: DevknobsStatePatch): DevknobsState;
33
+ export declare function setState(patch: KnobsStatePatch): KnobsState;
34
34
  /**
35
35
  * The knobs, once the frame has caught up with them and the panel has slid
36
36
  * where it goes. A page devknobs reloads never resolves it: ask again on the
37
37
  * next page. Rejects while devknobs is not mounted, and when it unmounts
38
38
  * during the wait.
39
39
  */
40
- export declare function ready(): Promise<DevknobsState>;
40
+ export declare function ready(): Promise<KnobsState>;
41
41
  /**
42
42
  * The panel says how to tell it is still sliding, open or closed, its handle
43
43
  * with it, so `ready()` waits for it to land. Returns the way to stop.
@@ -8,11 +8,11 @@ export declare const PARAGLIDE_COOKIE = "PARAGLIDE_LOCALE";
8
8
  * a reload and dies with the tab: a second tab left on `system` never puts
9
9
  * back what this one wrote.
10
10
  */
11
- export declare const OWNER_KEY = "devknobs:locale-stores";
11
+ export declare const OWNER_KEY = "knobs:locale-stores";
12
12
  /** The version of the record `OWNER_KEY` keeps. Bump it with a change of shape, see stored.ts. */
13
13
  export declare const OWNER_VERSION = 1;
14
14
  /** Where the last reload devknobs asked for is timed. */
15
- export declare const RELOAD_KEY = "devknobs:locale-reload";
15
+ export declare const RELOAD_KEY = "knobs:locale-reload";
16
16
  /** The version of the timing `RELOAD_KEY` keeps. Bump it with a change of shape, see stored.ts. */
17
17
  export declare const RELOAD_VERSION = 1;
18
18
  /** The direction `Intl` knows for the tag, script and all, or null when it does not. */
@@ -1,4 +1,4 @@
1
- import type { DevknobsState } from "../types";
1
+ import type { KnobsState } from "../types";
2
2
  import { type Framing } from "./frame";
3
3
  import type { Rect } from "./mock";
4
4
  /**
@@ -142,7 +142,7 @@ export declare function folds(from: string, to: string): boolean;
142
142
  * Which way the frame is drawn, for a move: `closed`, `frame` for one with no
143
143
  * device, or the device and the way it is held, and a foldable's posture.
144
144
  */
145
- export declare function shapeOf(knobs: Framing & Pick<DevknobsState, "device" | "orientation" | "posture">): string;
145
+ export declare function shapeOf(knobs: Framing & Pick<KnobsState, "device" | "orientation" | "posture">): string;
146
146
  /**
147
147
  * Does going from one shape to the other move? A device that comes, goes,
148
148
  * changes or turns does. A width, a height or a zoom changes in place, as
@@ -1,4 +1,4 @@
1
- import type { ContrastValue, DevknobsState, MotionValue, SchemeValue, TextValue, TransparencyValue, UaValue } from "../types";
1
+ import type { ContrastValue, KnobsState, MotionValue, SchemeValue, TextValue, TransparencyValue, UaValue } from "../types";
2
2
  import { type UaPreset } from "./ua";
3
3
  /** The prefers knobs, as a host sets them for real. */
4
4
  export interface NativeMedia {
@@ -122,15 +122,15 @@ export interface NativeSetting {
122
122
  change: (on: boolean) => void;
123
123
  }
124
124
  /** Does the frame draw something around the page, beside giving it a size? */
125
- export declare function drawnAround(state: DevknobsState): boolean;
125
+ export declare function drawnAround(state: KnobsState): boolean;
126
126
  /** The viewport a host can set for these knobs, null where they need no size or the frame draws. */
127
- export declare function nativeViewport(state: DevknobsState): NativeViewport | null;
127
+ export declare function nativeViewport(state: KnobsState): NativeViewport | null;
128
128
  /** The browser a host sends requests as for the ua knob, null for the browser's own. */
129
129
  export declare function nativeUa(value: UaValue): NativeUa | null;
130
130
  /** The state the page's own emulation runs with: each knob the driver takes is left at system. */
131
- export declare function inPage(state: DevknobsState, driver: NativeDriver | null): DevknobsState;
131
+ export declare function inPage(state: KnobsState, driver: NativeDriver | null): KnobsState;
132
132
  /** The state the frame runs with: no size of its own while the driver sets the viewport. */
133
- export declare function framing(state: DevknobsState, driver: NativeDriver | null): DevknobsState;
133
+ export declare function framing(state: KnobsState, driver: NativeDriver | null): KnobsState;
134
134
  export declare function nativeEnabled(): boolean;
135
135
  export declare function enableNative(on: boolean): void;
136
136
  /** What the frame's next load waits for: a part the host is still setting, or null. */
@@ -138,7 +138,7 @@ export declare function handing(): Promise<void> | null;
138
138
  /** What a host's answer holds the frame's load for: until it settles, at most `HAND_WAIT`, or null for none. */
139
139
  export declare function settles(result: unknown): Promise<void> | null;
140
140
  /** Hand the driver the knobs it takes, those that changed since. */
141
- export declare function drive(driver: NativeDriver, state: DevknobsState): void;
141
+ export declare function drive(driver: NativeDriver, state: KnobsState): void;
142
142
  /**
143
143
  * The browser a host sends requests as: the ua knob, unless it is the one the
144
144
  * device brought and the device stays in the frame. The frame emulates that
@@ -146,9 +146,9 @@ export declare function drive(driver: NativeDriver, state: DevknobsState): void;
146
146
  * once. A host sizing the whole tab as the device (`sized`) sends it too. In
147
147
  * real phone mode the device's goes out for the frame's page loads alone.
148
148
  */
149
- export declare function hostUa(state: DevknobsState, sized: boolean): NativeUa | null;
149
+ export declare function hostUa(state: KnobsState, sized: boolean): NativeUa | null;
150
150
  /** Hand the driver the ua knob, which it takes with its switch off too. */
151
- export declare function driveUa(driver: NativeDriver, state: DevknobsState, sized?: boolean): void;
151
+ export declare function driveUa(driver: NativeDriver, state: KnobsState, sized?: boolean): void;
152
152
  /**
153
153
  * Hand the driver every default, for an unmount, and forget what it had. A
154
154
  * driver never handed anything gets nothing. `ua` false keeps the ua part as
@@ -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;
@@ -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
+ /** `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;