@vinena/knobs 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +7 -0
- package/dist/early.global.js +6 -6
- package/dist/{elementsview-6g274ptr.js → elementsview-2z4pkrdz.js} +4 -4
- package/dist/{elementsview-pkzp9kc6.js → elementsview-qn8qyksa.js} +4 -4
- package/dist/engine/browserdraw.d.ts +24 -2
- package/dist/engine/browserkit.d.ts +18 -1
- package/dist/engine/browserui.d.ts +162 -22
- package/dist/engine/devicon.d.ts +59 -0
- package/dist/engine/fit.d.ts +4 -3
- package/dist/engine/foldflip.d.ts +40 -0
- package/dist/engine/identity.d.ts +7 -4
- package/dist/engine/mock.d.ts +16 -0
- package/dist/engine/mockdata.d.ts +4 -1
- package/dist/engine/mockdraw.d.ts +14 -2
- package/dist/engine/pageshot.d.ts +5 -2
- package/dist/engine/safaridraw.d.ts +162 -10
- package/dist/engine/screen.d.ts +24 -0
- package/dist/engine/store.d.ts +2 -1
- package/dist/engine/tabicon.d.ts +43 -0
- package/dist/engine/toplayer.d.ts +62 -0
- package/dist/engine/touchpointer.d.ts +0 -21
- package/dist/engine/underbar.d.ts +61 -0
- package/dist/{framekit-g96t6nmq.js → framekit-te90cjs0.js} +2325 -1572
- package/dist/{framekit-3n7p79ht.js → framekit-w0v516w5.js} +2325 -1572
- package/dist/host.d.ts +51 -0
- package/dist/{index-64rd634h.js → index-30fc6php.js} +1 -1
- package/dist/{index-dvr4x91q.js → index-9re7sv56.js} +20 -8
- package/dist/{index-0casarhy.js → index-agwr37gw.js} +1 -1
- package/dist/{index-2d6wvs8h.js → index-dan2kpsd.js} +4 -4
- package/dist/{index-kzsb9drs.js → index-hv02xka3.js} +20 -8
- package/dist/{index-peh33xjv.js → index-pewcdh28.js} +1 -1
- package/dist/{index-d0cjxjsm.js → index-r72tz2vn.js} +1 -1
- package/dist/{index-33x9hxe3.js → index-sxe5079a.js} +605 -187
- package/dist/{index-5d6qzte3.js → index-trx7bxdk.js} +4 -4
- package/dist/{index-5baxvd3v.js → index-xjhwp5cj.js} +275 -112
- package/dist/index.d.ts +26 -1
- package/dist/index.global.js +270 -176
- package/dist/index.js +398 -124
- package/dist/instance.d.ts +23 -4
- package/dist/{react-pdvseef0.js → react-05jh9jv5.js} +1 -1
- package/dist/{react-4kbj1t4h.js → react-16spgn0h.js} +1 -1
- package/dist/{react-65tgdbs8.js → react-4pvp6amm.js} +1 -1
- package/dist/{react-qv0nykcv.js → react-ayg1bgw3.js} +602 -184
- package/dist/{react-xxfpfddf.js → react-exjcpxma.js} +1 -1
- package/dist/{react-carf84xv.js → react-fm9y8dbn.js} +275 -112
- package/dist/{react-mv9y20jy.js → react-sw8d8c94.js} +4 -4
- package/dist/{react-71a9ypex.js → react-zy1mmhgz.js} +4 -4
- package/dist/react.js +394 -123
- package/dist/{storageview-vdkbp6rt.js → storageview-r595qpt9.js} +4 -4
- package/dist/{storageview-j9d44f99.js → storageview-s7heg93p.js} +4 -4
- package/dist/types.d.ts +7 -0
- package/dist/ui/footer.d.ts +9 -2
- package/dist/ui/panel.d.ts +16 -2
- package/dist/ui/settings.d.ts +17 -1
- package/dist/version.d.ts +2 -0
- package/package.json +3 -2
- package/skills/devknobs/SKILL.md +1 -1
- package/dist/elementsview-jnkbhzkj.js +0 -2873
- package/dist/elementsview-tf4qzmtw.js +0 -2874
- package/dist/engine/endroom.d.ts +0 -21
- package/dist/framekit-095qevka.js +0 -8838
- package/dist/framekit-q5aad770.js +0 -8839
- package/dist/index-hw56t3zy.js +0 -4800
- package/dist/index-k015tb6c.js +0 -357
- package/dist/index-ke6v7919.js +0 -4801
- package/dist/index-qxye1j73.js +0 -528
- package/dist/index-z5ytnj01.js +0 -4563
- package/dist/index-zvze25nf.js +0 -686
- package/dist/react-eygws6cx.js +0 -358
- package/dist/react-sq9pkw4k.js +0 -687
- package/dist/react-vjm88w4t.js +0 -4564
- package/dist/react-znfrjqk8.js +0 -529
- package/dist/storageview-sb23henh.js +0 -2729
- package/dist/storageview-vf8v8q8j.js +0 -2728
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
cookieText,
|
|
6
6
|
put,
|
|
7
7
|
storedPresets
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-trx7bxdk.js";
|
|
9
9
|
import {
|
|
10
10
|
branch,
|
|
11
11
|
codeBlock,
|
|
@@ -27,17 +27,17 @@ import {
|
|
|
27
27
|
textArea,
|
|
28
28
|
textField,
|
|
29
29
|
toolbar
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-30fc6php.js";
|
|
31
31
|
import {
|
|
32
32
|
copyText
|
|
33
33
|
} from "./index-ztnjefrh.js";
|
|
34
34
|
import {
|
|
35
35
|
icon
|
|
36
|
-
} from "./index-
|
|
36
|
+
} from "./index-sxe5079a.js";
|
|
37
37
|
import {
|
|
38
38
|
stamped,
|
|
39
39
|
webStorage
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-xjhwp5cj.js";
|
|
41
41
|
|
|
42
42
|
// src/storage/site.ts
|
|
43
43
|
function isOwn(key) {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
cookieText,
|
|
7
7
|
put,
|
|
8
8
|
storedPresets
|
|
9
|
-
} from "./react-
|
|
9
|
+
} from "./react-sw8d8c94.js";
|
|
10
10
|
import {
|
|
11
11
|
branch,
|
|
12
12
|
codeBlock,
|
|
@@ -28,17 +28,17 @@ import {
|
|
|
28
28
|
textArea,
|
|
29
29
|
textField,
|
|
30
30
|
toolbar
|
|
31
|
-
} from "./react-
|
|
31
|
+
} from "./react-16spgn0h.js";
|
|
32
32
|
import {
|
|
33
33
|
copyText
|
|
34
34
|
} from "./react-h9w04skh.js";
|
|
35
35
|
import {
|
|
36
36
|
icon
|
|
37
|
-
} from "./react-
|
|
37
|
+
} from "./react-ayg1bgw3.js";
|
|
38
38
|
import {
|
|
39
39
|
stamped,
|
|
40
40
|
webStorage
|
|
41
|
-
} from "./react-
|
|
41
|
+
} from "./react-fm9y8dbn.js";
|
|
42
42
|
|
|
43
43
|
// src/storage/site.ts
|
|
44
44
|
function isOwn(key) {
|
package/dist/types.d.ts
CHANGED
|
@@ -127,6 +127,11 @@ export interface UaValue {
|
|
|
127
127
|
export type EdgeValue = "top" | "bottom" | "none";
|
|
128
128
|
/** The edge of the window the panel lives on. */
|
|
129
129
|
export type SideValue = "left" | "right";
|
|
130
|
+
/**
|
|
131
|
+
* The dev ribbon on the tab's icon: `auto` on a local host, such as
|
|
132
|
+
* localhost, `*.localhost` or a private network address, or always on or off.
|
|
133
|
+
*/
|
|
134
|
+
export type DevIconValue = "auto" | "on" | "off";
|
|
130
135
|
export interface PanelValue {
|
|
131
136
|
open: boolean;
|
|
132
137
|
/** The edge of the window the panel and its handle live on. */
|
|
@@ -149,6 +154,8 @@ export interface PanelValue {
|
|
|
149
154
|
* `handle` option and the user's setting can still hide it.
|
|
150
155
|
*/
|
|
151
156
|
handle: boolean;
|
|
157
|
+
/** The dev ribbon on the tab's icon, for this tab. */
|
|
158
|
+
devIcon: DevIconValue;
|
|
152
159
|
/**
|
|
153
160
|
* Ids of the rows set from the panel. Each stays in the list, back at its
|
|
154
161
|
* default too, until a hold on its `×` takes it off. Reset all lists the default rows
|
package/dist/ui/footer.d.ts
CHANGED
|
@@ -2,13 +2,20 @@ import type { GrabControl } from "../grab/control";
|
|
|
2
2
|
import { type LiveKeys } from "./bindings";
|
|
3
3
|
import { type Keys } from "./keys";
|
|
4
4
|
/**
|
|
5
|
-
* The panel's footer: the overflow badge, the fresh mode note,
|
|
5
|
+
* The panel's footer: the overflow badge, the fresh mode note, which copy
|
|
6
|
+
* runs the panel where a host and the page each have one, the keys the
|
|
6
7
|
* panel answers to, grab's and inspect's with them, each a control that does
|
|
7
8
|
* what its key does, the pin that docks the panel to its side, with the two
|
|
8
9
|
* controls a pinned panel has before it, and the way into the settings.
|
|
9
10
|
*/
|
|
10
11
|
/** What the footer says while fresh mode is on, so a panel back at its defaults is no surprise. */
|
|
11
12
|
export declare const FRESH_NOTE = "fresh mode: nothing is kept";
|
|
13
|
+
/**
|
|
14
|
+
* Which copy of devknobs runs the panel and its version, such as
|
|
15
|
+
* `extension 0.5.1` or `page 0.5.1-local.1767225600`: the footer says so where
|
|
16
|
+
* a host and a page can each run it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runtimeLabel(host: boolean, version: string): string;
|
|
12
19
|
/**
|
|
13
20
|
* What the footer says about the overflow knob, such as `2 overflowing`.
|
|
14
21
|
* Nothing while the knob is off, or before the count is known.
|
|
@@ -48,4 +55,4 @@ export interface Footer {
|
|
|
48
55
|
*/
|
|
49
56
|
drawPin(docked: boolean): void;
|
|
50
57
|
}
|
|
51
|
-
export declare function createFooter(keys: LiveKeys, grab: GrabControl | null, mac: boolean, inspect?: GrabControl | null): Footer;
|
|
58
|
+
export declare function createFooter(keys: LiveKeys, grab: GrabControl | null, mac: boolean, inspect?: GrabControl | null, runtime?: string | null): Footer;
|
package/dist/ui/panel.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type SystemMedia } from "../engine/system";
|
|
2
2
|
import type { GrabControl } from "../grab/control";
|
|
3
3
|
import type { InspectControl } from "../grab/inspect";
|
|
4
|
+
import type { PreferValue } from "../host";
|
|
4
5
|
import { type LiveKeys } from "./bindings";
|
|
5
6
|
export { wallInput } from "./catalog";
|
|
6
7
|
export interface PanelOptions {
|
|
@@ -18,8 +19,19 @@ export interface PanelOptions {
|
|
|
18
19
|
* user sets in the panel wins over it.
|
|
19
20
|
*/
|
|
20
21
|
handle?: boolean;
|
|
22
|
+
/** Who runs the panel, the host or the page, where a host gives the choice. */
|
|
23
|
+
prefer?: PanelPrefer;
|
|
24
|
+
}
|
|
25
|
+
/** A host's choice of who runs the panel, as the settings and the footer show it. */
|
|
26
|
+
export interface PanelPrefer {
|
|
27
|
+
value(): PreferValue;
|
|
28
|
+
change(value: PreferValue): void;
|
|
29
|
+
/** The footer's name for the copy that runs, such as `extension 0.5.1`. */
|
|
30
|
+
runtime: string;
|
|
21
31
|
}
|
|
22
32
|
export interface Panel {
|
|
33
|
+
/** Show the host's choice of who runs the panel again, which changed. */
|
|
34
|
+
drawPrefer(): void;
|
|
23
35
|
/** Take the panel off the page and drop every listener. */
|
|
24
36
|
destroy(): void;
|
|
25
37
|
}
|
|
@@ -28,9 +40,11 @@ export interface Panel {
|
|
|
28
40
|
* the panel is doing, so it never takes a pointer: the stylesheet hands that
|
|
29
41
|
* back to the handle and to a panel that is out, and every other pixel of the
|
|
30
42
|
* box belongs to the page underneath. The side it lives on anchors it to the
|
|
31
|
-
* left or the right edge
|
|
43
|
+
* left or the right edge, and the other edges and its size stay `auto` until
|
|
44
|
+
* set, whatever a popover would give them. Its z-index puts it over the page and grab's boxes where
|
|
45
|
+
* the browser has no top layer for it.
|
|
32
46
|
*/
|
|
33
|
-
export declare const HOST_STYLE = "position:fixed;top:0;z-index:
|
|
47
|
+
export declare const HOST_STYLE = "position:fixed;top:0;right:auto;bottom:auto;left:auto;width:auto;height:auto;z-index:2147483647;pointer-events:none";
|
|
34
48
|
/**
|
|
35
49
|
* Build the panel, put it on the page and keep it in step with the engine. The
|
|
36
50
|
* host carries an open shadow root, so the page cannot style the panel and the
|
package/dist/ui/settings.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GrabControl } from "../grab/control";
|
|
2
|
+
import { type PreferValue } from "../host";
|
|
2
3
|
import { type LiveKeys } from "./bindings";
|
|
3
4
|
import { type Binding, type Keys } from "./keys";
|
|
4
5
|
import type { LivePrefs } from "./prefs";
|
|
@@ -6,7 +7,8 @@ import { type Tips } from "./tooltip";
|
|
|
6
7
|
/**
|
|
7
8
|
* The settings view, which slides in over the rows: whether the handle shows
|
|
8
9
|
* while the panel is closed, the host's switch for its native driver where it
|
|
9
|
-
* gives one,
|
|
10
|
+
* gives one, which copy runs the panel where a host gives the choice, whether the tab's icon has the dev ribbon, and each binding's
|
|
11
|
+
* key, recorded from the next
|
|
10
12
|
* keys pressed. A key a binding cannot take is refused, and the chip says why.
|
|
11
13
|
*/
|
|
12
14
|
/** What a binding's chip says while it has no key: its default went to another binding. */
|
|
@@ -38,6 +40,10 @@ export interface SettingsContext {
|
|
|
38
40
|
handleShown(): boolean;
|
|
39
41
|
/** Let the knobs show the handle, which an agent may have hidden. */
|
|
40
42
|
showHandle(): void;
|
|
43
|
+
/** Whether the tab's icon has the dev ribbon. */
|
|
44
|
+
devIconShown(): boolean;
|
|
45
|
+
/** The user turned the dev ribbon on the tab's icon off or on. */
|
|
46
|
+
setDevIcon(on: boolean): void;
|
|
41
47
|
/** The words of the host's switch for its native driver, null with none. */
|
|
42
48
|
native: {
|
|
43
49
|
label: string;
|
|
@@ -45,6 +51,12 @@ export interface SettingsContext {
|
|
|
45
51
|
} | null;
|
|
46
52
|
/** The user turned the native driver off or on. */
|
|
47
53
|
setNative(on: boolean): void;
|
|
54
|
+
/** Whether the host or the page runs the panel, where a host gives the choice; null with none. */
|
|
55
|
+
prefer: {
|
|
56
|
+
value(): PreferValue;
|
|
57
|
+
} | null;
|
|
58
|
+
/** The user picked who runs the panel. */
|
|
59
|
+
setPrefer(value: PreferValue): void;
|
|
48
60
|
/** Whether the search is open. */
|
|
49
61
|
searching(): boolean;
|
|
50
62
|
leaveSearch(): void;
|
|
@@ -58,8 +70,12 @@ export interface Settings {
|
|
|
58
70
|
drawKeys(now: Keys): void;
|
|
59
71
|
/** Show whether the handle shows while the panel is closed. */
|
|
60
72
|
drawHandle(shown: boolean): void;
|
|
73
|
+
/** Show whether the tab's icon has the dev ribbon. */
|
|
74
|
+
drawDevIcon(shown: boolean): void;
|
|
61
75
|
/** Show whether the native driver is on, and why it last went off or on in place of its hint. */
|
|
62
76
|
drawNative(on: boolean, note: string | null): void;
|
|
77
|
+
/** Show who runs the panel, where a host gives the choice. */
|
|
78
|
+
drawPrefer(): void;
|
|
63
79
|
/** Take a key for the binding that records, if one does, and say whether it did. */
|
|
64
80
|
recordingKey(event: KeyboardEvent): boolean;
|
|
65
81
|
stopRecording(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vinena/knobs",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Mert Düzgün",
|
|
@@ -38,10 +38,11 @@
|
|
|
38
38
|
"./bezels/*": "./dist/bezels/*"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "bun scripts/bezelurls.ts && bun -e 'require(\"fs\").rmSync(\"dist.tmp\",{recursive:true,force:true})' && bun build src/index.ts --outdir dist.tmp --format esm --splitting --define DEVKNOBS_TUNE=false && bun build src/react.tsx --outdir dist.tmp --format esm --splitting --external react --banner '\"use client\";' --define DEVKNOBS_TUNE=false && bun build src/global.ts --outfile dist.tmp/index.global.js --format iife --minify --define 'import.meta.url=\"\"' --define DEVKNOBS_TUNE=false && bun build src/early.ts --outfile dist.tmp/early.global.js --format iife --minify --define DEVKNOBS_TUNE=false && tsc --emitDeclarationOnly --project tsconfig.build.json --outDir dist.tmp && rm -f dist.tmp/engine/foldtune.d.ts && if [ -d assets/bezels ]; then cp -R assets/bezels dist.tmp/bezels; fi && bun scripts/useclient.ts && bun scripts/tunefree.ts && bun -e 'const fs=require(\"fs\");fs.rmSync(\"dist\",{recursive:true,force:true});fs.renameSync(\"dist.tmp\",\"dist\")'",
|
|
41
|
+
"build": "bun scripts/bezelurls.ts && bun -e 'require(\"fs\").rmSync(\"dist.tmp\",{recursive:true,force:true})' && bun build src/index.ts --outdir dist.tmp --format esm --splitting --define DEVKNOBS_TUNE=false --define DEVKNOBS_VERSION=\\\"${DEVKNOBS_VERSION:-$npm_package_version}\\\" && bun build src/react.tsx --outdir dist.tmp --format esm --splitting --external react --banner '\"use client\";' --define DEVKNOBS_TUNE=false --define DEVKNOBS_VERSION=\\\"${DEVKNOBS_VERSION:-$npm_package_version}\\\" && bun build src/global.ts --outfile dist.tmp/index.global.js --format iife --minify --define 'import.meta.url=\"\"' --define DEVKNOBS_TUNE=false --define DEVKNOBS_VERSION=\\\"${DEVKNOBS_VERSION:-$npm_package_version}\\\" && bun build src/early.ts --outfile dist.tmp/early.global.js --format iife --minify --define DEVKNOBS_TUNE=false && tsc --emitDeclarationOnly --project tsconfig.build.json --outDir dist.tmp && rm -f dist.tmp/engine/foldtune.d.ts && if [ -d assets/bezels ]; then cp -R assets/bezels dist.tmp/bezels; fi && bun scripts/useclient.ts && bun scripts/tunefree.ts && bun -e 'const fs=require(\"fs\");fs.rmSync(\"dist\",{recursive:true,force:true});fs.renameSync(\"dist.tmp\",\"dist\")'",
|
|
42
42
|
"link": "bun scripts/link.ts link",
|
|
43
43
|
"unlink": "bun scripts/link.ts unlink",
|
|
44
44
|
"test": "bun test",
|
|
45
|
+
"toplayer": "node scripts/toplayer.ts",
|
|
45
46
|
"typecheck": "tsc --noEmit"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
package/skills/devknobs/SKILL.md
CHANGED
|
@@ -114,7 +114,7 @@ await window.devknobs.ready();
|
|
|
114
114
|
`window.devknobs.setState({ panel: { open: false, handle: false, docked: false } })`,
|
|
115
115
|
then `await window.devknobs.ready()`. `reset()` keeps this. Patch only
|
|
116
116
|
`open`, `docked` and `handle`. The other panel fields are the user's
|
|
117
|
-
layout. `panel.handle` is your layer. The user's own "show handle" setting
|
|
117
|
+
layout and settings, such as `devIcon`, the DEV ribbon on the tab's icon. `panel.handle` is your layer. The user's own "show handle" setting
|
|
118
118
|
can hide the handle too, and `getState()` does not show that setting.
|
|
119
119
|
2. Take a screenshot, or read the DOM.
|
|
120
120
|
3. A numeric width or height, a device, a numeric dpr, a vision other than
|