@vinena/knobs 0.7.0 → 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 (111) hide show
  1. package/CHANGELOG.md +18 -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-mcg6d5zp.js} +21 -19
  10. package/dist/{elementsview-jg4edt86.js → elementsview-mwr1s17z.js} +21 -19
  11. package/dist/engine/bezels.d.ts +2 -2
  12. package/dist/engine/check.d.ts +2 -2
  13. package/dist/engine/describe.d.ts +2 -2
  14. package/dist/engine/devices.d.ts +3 -3
  15. package/dist/engine/fit.d.ts +4 -4
  16. package/dist/engine/foldhand.d.ts +2 -2
  17. package/dist/engine/frame.d.ts +6 -6
  18. package/dist/engine/frames.d.ts +4 -4
  19. package/dist/engine/fresh.d.ts +12 -5
  20. package/dist/engine/header.d.ts +3 -1
  21. package/dist/engine/identity.d.ts +4 -4
  22. package/dist/engine/index.d.ts +7 -7
  23. package/dist/engine/locale.d.ts +2 -2
  24. package/dist/engine/morph.d.ts +2 -2
  25. package/dist/engine/native.d.ts +8 -8
  26. package/dist/engine/placeholder.d.ts +3 -3
  27. package/dist/engine/reload.d.ts +2 -2
  28. package/dist/engine/screen.d.ts +2 -2
  29. package/dist/engine/scrollkeep.d.ts +1 -1
  30. package/dist/engine/store.d.ts +11 -11
  31. package/dist/engine/storekeys.d.ts +34 -0
  32. package/dist/engine/style.d.ts +1 -1
  33. package/dist/engine/tabicon.d.ts +2 -2
  34. package/dist/engine/underneath.d.ts +1 -0
  35. package/dist/engine/width.d.ts +3 -3
  36. package/dist/{framekit-40pzennw.js → framekit-4v7nc3ea.js} +23 -18
  37. package/dist/{framekit-r16k97n7.js → framekit-wyppj1se.js} +23 -18
  38. package/dist/grab/clipboard.d.ts +2 -0
  39. package/dist/{index-jfv7vavj.js → index-311fys81.js} +93 -29
  40. package/dist/index-3dcgysws.js +77 -0
  41. package/dist/{index-s6fya8pm.js → index-3s4v7gw5.js} +11 -10
  42. package/dist/{index-ztnjefrh.js → index-585hs9tp.js} +5 -1
  43. package/dist/{index-za4ppxay.js → index-6t0w5s7p.js} +1 -1
  44. package/dist/{index-0qkj2mgb.js → index-82y8x8vv.js} +14 -11
  45. package/dist/{index-tqq2ygpj.js → index-9targr2f.js} +26 -16
  46. package/dist/{index-8d1yk9d2.js → index-a23nv5j4.js} +59 -39
  47. package/dist/{index-t4kssacm.js → index-abwqw8jh.js} +6 -1
  48. package/dist/{index-s6yzsvs4.js → index-bgzyc7rz.js} +22 -15
  49. package/dist/{index-xxbb8y41.js → index-c1t6knbf.js} +20 -14
  50. package/dist/{index-3nwycv3p.js → index-cqymjce4.js} +20 -14
  51. package/dist/{index-v2v4rmpe.js → index-dvtbh3c8.js} +24 -18
  52. package/dist/{index-cb91vcka.js → index-k4w5v53q.js} +1 -1
  53. package/dist/{index-q53j8wg5.js → index-n31pn4ax.js} +19 -15
  54. package/dist/{index-ymqm185m.js → index-rps0bdq9.js} +1 -1
  55. package/dist/{index-a8ffw5ft.js → index-szd9bddn.js} +1 -1
  56. package/dist/{index-2jc9dnta.js → index-vhda420r.js} +11 -5
  57. package/dist/{index-xs29b55n.js → index-vmprrfwe.js} +5 -2
  58. package/dist/{index-fjrrgd9h.js → index-vmz7htwn.js} +1 -1
  59. package/dist/index.d.ts +14 -8
  60. package/dist/index.global.js +159 -159
  61. package/dist/index.js +57 -32
  62. package/dist/instance.d.ts +7 -1
  63. package/dist/mark.d.ts +50 -0
  64. package/dist/{react-0gxs9aef.js → react-4ezjf7mq.js} +24 -18
  65. package/dist/react-4qn9vsjw.js +78 -0
  66. package/dist/{react-73reavv4.js → react-4tcwpama.js} +1 -1
  67. package/dist/{react-6ngtb6p9.js → react-7eyps0cg.js} +1 -1
  68. package/dist/{react-vvc4x9kq.js → react-7tzwahsm.js} +14 -11
  69. package/dist/{react-yx3g9k55.js → react-amvrbng8.js} +5 -2
  70. package/dist/{react-5rq7bnsy.js → react-atw9y8ny.js} +5 -1
  71. package/dist/{react-4phtr2nd.js → react-dg4bjv3j.js} +1 -1
  72. package/dist/{react-meve34wp.js → react-hdneb4v3.js} +11 -5
  73. package/dist/{react-h9w04skh.js → react-j87bdhhe.js} +4 -1
  74. package/dist/{react-wtgvkf6g.js → react-mkafgzqf.js} +1 -1
  75. package/dist/{react-zp7fdw8e.js → react-ppyj3fg2.js} +59 -39
  76. package/dist/{react-0r5418av.js → react-rbmk30xk.js} +92 -29
  77. package/dist/{react-actmnkwp.js → react-rxw73n04.js} +1 -1
  78. package/dist/{react-5h7pxnax.js → react-tet7swk2.js} +22 -15
  79. package/dist/{react-8nmtt0ge.js → react-w94cfn87.js} +19 -15
  80. package/dist/{react-fq4551ks.js → react-wzd3cfg8.js} +11 -10
  81. package/dist/{react-3ev6rwqz.js → react-x209et38.js} +26 -16
  82. package/dist/react.d.ts +3 -1
  83. package/dist/react.js +60 -33
  84. package/dist/{replay-pmesjfa3.js → replay-3xqgt3xg.js} +8 -8
  85. package/dist/{replay-m5g8km9y.js → replay-48gn27bj.js} +8 -8
  86. package/dist/storage/onload.d.ts +1 -1
  87. package/dist/{storageview-9a6zm47z.js → storageview-2rvwk0v7.js} +16 -13
  88. package/dist/{storageview-x62v1c3j.js → storageview-6vq7nz02.js} +16 -13
  89. package/dist/styles/force.d.ts +3 -1
  90. package/dist/types.d.ts +4 -4
  91. package/dist/ui/actions.d.ts +3 -3
  92. package/dist/ui/bindings.d.ts +1 -1
  93. package/dist/ui/catalog.d.ts +14 -14
  94. package/dist/ui/changes.d.ts +1 -1
  95. package/dist/ui/colors.d.ts +1 -1
  96. package/dist/ui/deviceknobs.d.ts +2 -2
  97. package/dist/ui/editors.d.ts +3 -3
  98. package/dist/ui/foldslider.d.ts +2 -2
  99. package/dist/ui/keys.d.ts +1 -1
  100. package/dist/ui/list.d.ts +10 -10
  101. package/dist/ui/palette.d.ts +2 -2
  102. package/dist/ui/pin.d.ts +2 -2
  103. package/dist/ui/prefs.d.ts +1 -1
  104. package/dist/ui/rows.d.ts +3 -3
  105. package/dist/ui/storageview.d.ts +2 -2
  106. package/dist/ui/stylesview.d.ts +3 -3
  107. package/dist/ui/swatches.d.ts +2 -2
  108. package/package.json +1 -1
  109. package/skills/knobs/SKILL.md +36 -35
  110. package/dist/index-5tv6sr74.js +0 -23
  111. package/dist/react-t2qnewz2.js +0 -24
@@ -4,7 +4,7 @@ import {
4
4
  HTML_MIN,
5
5
  forcedSelector,
6
6
  forcing
7
- } from "./index-tqq2ygpj.js";
7
+ } from "./index-9targr2f.js";
8
8
  import"./index-58jdczmj.js";
9
9
  import {
10
10
  HIDE_ATTRIBUTE,
@@ -29,7 +29,7 @@ import {
29
29
  rulesOf,
30
30
  successor,
31
31
  textEdit
32
- } from "./index-v2v4rmpe.js";
32
+ } from "./index-dvtbh3c8.js";
33
33
  import {
34
34
  compareSpecificity,
35
35
  edits,
@@ -38,11 +38,11 @@ import {
38
38
  readSavedEdit,
39
39
  specificity,
40
40
  splitList
41
- } from "./index-q53j8wg5.js";
41
+ } from "./index-n31pn4ax.js";
42
42
  import {
43
43
  boxValue,
44
44
  sizeText
45
- } from "./index-ymqm185m.js";
45
+ } from "./index-rps0bdq9.js";
46
46
  import {
47
47
  TITLE_MAX,
48
48
  crumbText,
@@ -54,7 +54,7 @@ import {
54
54
  swatchOf,
55
55
  valueParts,
56
56
  variableTip
57
- } from "./index-za4ppxay.js";
57
+ } from "./index-6t0w5s7p.js";
58
58
  import {
59
59
  NEW_RULE_SHEET,
60
60
  cssOff,
@@ -76,13 +76,13 @@ import {
76
76
  valueText,
77
77
  varReferences,
78
78
  variableNames
79
- } from "./index-a8ffw5ft.js";
79
+ } from "./index-szd9bddn.js";
80
80
  import {
81
81
  elementSelector
82
- } from "./index-t4kssacm.js";
82
+ } from "./index-abwqw8jh.js";
83
83
  import {
84
84
  copyText
85
- } from "./index-ztnjefrh.js";
85
+ } from "./index-585hs9tp.js";
86
86
  import {
87
87
  button,
88
88
  el,
@@ -93,31 +93,33 @@ import {
93
93
  segments,
94
94
  toolToggle,
95
95
  toolbar
96
- } from "./index-fjrrgd9h.js";
96
+ } from "./index-vmz7htwn.js";
97
97
  import {
98
98
  getState,
99
99
  subscribe
100
- } from "./index-8d1yk9d2.js";
100
+ } from "./index-a23nv5j4.js";
101
101
  import {
102
102
  isMac
103
- } from "./index-s6yzsvs4.js";
103
+ } from "./index-bgzyc7rz.js";
104
104
  import {
105
105
  comboLabel,
106
106
  isDevknobs,
107
107
  letterMatches,
108
108
  typesInField,
109
109
  withShift
110
- } from "./index-2jc9dnta.js";
110
+ } from "./index-vhda420r.js";
111
111
  import {
112
112
  SIDES,
113
113
  boxModel,
114
114
  contentSize,
115
115
  ownInline
116
- } from "./index-jfv7vavj.js";
116
+ } from "./index-311fys81.js";
117
117
  import"./index-a974q3aa.js";
118
118
  import {
119
- __require
120
- } from "./index-5tv6sr74.js";
119
+ __require,
120
+ isMarked,
121
+ ownSelector
122
+ } from "./index-3dcgysws.js";
121
123
 
122
124
  // src/edit/text.ts
123
125
  var MARKUP_KINDS = new Set(["text", "attr", "html", "hide", "delete", "move"]);
@@ -304,7 +306,7 @@ function promptText(edits2) {
304
306
  var COPIED = "copied";
305
307
  var NOT_COPIED = "could not copy";
306
308
  var COPIED_FOR = 1200;
307
- var AGENT_NOTE = "agents read and apply edits: devknobs.edits() / setEdits()";
309
+ var AGENT_NOTE = "agents read and apply edits: knobs.edits() / setEdits()";
308
310
  function keptLine(kept, missed) {
309
311
  const made = `${kept} ${kept === 1 ? "edit" : "edits"} kept from before the reload`;
310
312
  return missed > 0 ? `${made}, ${missed} could not be found` : made;
@@ -479,7 +481,7 @@ var found = new WeakMap;
479
481
  var locateSource = (element) => {
480
482
  let pending = found.get(element);
481
483
  if (!pending) {
482
- pending = import("./context-vd2xep5t.js").then(({ grabEntry }) => grabEntry(element)).then(({ source }) => {
484
+ pending = import("./context-h1bdt8w3.js").then(({ grabEntry }) => grabEntry(element)).then(({ source }) => {
483
485
  if (!source || source.origin !== "app")
484
486
  return null;
485
487
  return source.lineNumber ? `${source.filePath}:${source.lineNumber}` : source.filePath;
@@ -1616,7 +1618,7 @@ function isFrame(element) {
1616
1618
  return element.namespaceURI === "http://www.w3.org/1999/xhtml" && (element.localName === "head" || element.localName === "body");
1617
1619
  }
1618
1620
  function holdsOwn(element) {
1619
- return element.querySelector("[data-devknobs]") !== null;
1621
+ return element.querySelector(ownSelector()) !== null;
1620
1622
  }
1621
1623
  function actionsFor(row) {
1622
1624
  if (!row || row.pseudo !== null)
@@ -2783,7 +2785,7 @@ function isOwn(record) {
2783
2785
  if (record.type !== "childList")
2784
2786
  return false;
2785
2787
  const nodes = [...Array.from(record.addedNodes), ...Array.from(record.removedNodes)];
2786
- return nodes.length > 0 && nodes.every((node) => isElement2(node) && node.hasAttribute("data-devknobs"));
2788
+ return nodes.length > 0 && nodes.every((node) => isElement2(node) && isMarked(node));
2787
2789
  }
2788
2790
  function knobsOf(state) {
2789
2791
  return JSON.stringify({ ...state, panel: null });
@@ -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;