@vinena/knobs 0.5.2 → 0.5.3
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 +12 -0
- package/dist/early.global.js +5 -5
- package/dist/{elementsview-qn8qyksa.js → elementsview-1wsxcdtj.js} +4 -4
- package/dist/{elementsview-2z4pkrdz.js → elementsview-3kv34jfx.js} +4 -4
- package/dist/engine/browserdraw.d.ts +5 -0
- package/dist/engine/browserkit.d.ts +2 -0
- package/dist/engine/devices.d.ts +3 -2
- package/dist/engine/frames.d.ts +1 -0
- package/dist/engine/identity.d.ts +5 -1
- package/dist/engine/index.d.ts +2 -0
- package/dist/engine/mock.d.ts +0 -2
- package/dist/engine/mockdata.d.ts +4 -3
- package/dist/engine/mockdraw.d.ts +2 -14
- package/dist/engine/morphrun.d.ts +4 -0
- package/dist/engine/native.d.ts +31 -3
- package/dist/engine/notice.d.ts +1 -2
- package/dist/engine/width.d.ts +3 -0
- package/dist/{framekit-w0v516w5.js → framekit-cjz0e4y8.js} +213 -61
- package/dist/{framekit-te90cjs0.js → framekit-yk1jxjv7.js} +213 -61
- package/dist/{index-sxe5079a.js → index-6wbgqkdz.js} +24 -5
- package/dist/{index-dan2kpsd.js → index-9jhatmky.js} +4 -4
- package/dist/{index-30fc6php.js → index-begsqdm0.js} +1 -1
- package/dist/{index-pewcdh28.js → index-j1h13ahg.js} +1 -1
- package/dist/{index-xjhwp5cj.js → index-p57fdttx.js} +38 -23
- package/dist/{index-9re7sv56.js → index-prjpx67p.js} +5 -5
- package/dist/{index-r72tz2vn.js → index-q73py563.js} +1 -1
- package/dist/{index-hv02xka3.js → index-sn2y6j09.js} +5 -5
- package/dist/{index-agwr37gw.js → index-vgfn2n1h.js} +1 -1
- package/dist/{index-trx7bxdk.js → index-zt3rheck.js} +4 -4
- package/dist/index.global.js +183 -154
- package/dist/index.js +39 -13
- package/dist/{react-ayg1bgw3.js → react-3rhdj2k1.js} +24 -5
- package/dist/{react-fm9y8dbn.js → react-6tss0r9f.js} +38 -23
- package/dist/{react-sw8d8c94.js → react-7vjfsh40.js} +4 -4
- package/dist/{react-zy1mmhgz.js → react-806qmkyz.js} +4 -4
- package/dist/{react-4pvp6amm.js → react-gefkdkdz.js} +1 -1
- package/dist/{react-16spgn0h.js → react-mmq2zya3.js} +1 -1
- package/dist/{react-exjcpxma.js → react-qfpg79hs.js} +1 -1
- package/dist/{react-05jh9jv5.js → react-qgz9afa2.js} +1 -1
- package/dist/react.js +39 -13
- package/dist/{storageview-s7heg93p.js → storageview-7cv0vpdm.js} +4 -4
- package/dist/{storageview-r595qpt9.js → storageview-dyhpgt8f.js} +4 -4
- package/dist/types.d.ts +7 -0
- package/dist/ui/settings.d.ts +8 -0
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
lerp,
|
|
10
10
|
setDockWidth,
|
|
11
11
|
watchColumn
|
|
12
|
-
} from "./react-
|
|
12
|
+
} from "./react-qfpg79hs.js";
|
|
13
13
|
import {
|
|
14
14
|
GRAB_COLORS as GRAB_COLORS2,
|
|
15
15
|
GRAB_COLOR_NAMES,
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
createGrab,
|
|
19
19
|
createInspect,
|
|
20
20
|
oneAtATime
|
|
21
|
-
} from "./react-
|
|
21
|
+
} from "./react-806qmkyz.js";
|
|
22
22
|
import {
|
|
23
23
|
hushOnce
|
|
24
|
-
} from "./react-
|
|
24
|
+
} from "./react-gefkdkdz.js";
|
|
25
25
|
import {
|
|
26
26
|
label
|
|
27
27
|
} from "./react-adky72h9.js";
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
showPane,
|
|
40
40
|
stopOnLoad,
|
|
41
41
|
viewHead
|
|
42
|
-
} from "./react-
|
|
42
|
+
} from "./react-7vjfsh40.js";
|
|
43
43
|
import {
|
|
44
44
|
actButton,
|
|
45
45
|
button,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
tabBar,
|
|
69
69
|
textField,
|
|
70
70
|
toolbar
|
|
71
|
-
} from "./react-
|
|
71
|
+
} from "./react-mmq2zya3.js";
|
|
72
72
|
import {
|
|
73
73
|
BINDING_ICONS,
|
|
74
74
|
BODY_CAP,
|
|
@@ -99,6 +99,7 @@ import {
|
|
|
99
99
|
highlightAt,
|
|
100
100
|
holdInTopLayer,
|
|
101
101
|
holdingHinge,
|
|
102
|
+
hostSendsUa,
|
|
102
103
|
icon,
|
|
103
104
|
isFunctionKey,
|
|
104
105
|
isSearchKey,
|
|
@@ -133,7 +134,7 @@ import {
|
|
|
133
134
|
watchPanel,
|
|
134
135
|
zoomAction,
|
|
135
136
|
zoomKey
|
|
136
|
-
} from "./react-
|
|
137
|
+
} from "./react-3rhdj2k1.js";
|
|
137
138
|
import {
|
|
138
139
|
BARS,
|
|
139
140
|
BROWSERS,
|
|
@@ -211,7 +212,7 @@ import {
|
|
|
211
212
|
userAgentOf,
|
|
212
213
|
watchSystemMedia,
|
|
213
214
|
webStorage
|
|
214
|
-
} from "./react-
|
|
215
|
+
} from "./react-6tss0r9f.js";
|
|
215
216
|
|
|
216
217
|
// src/react.tsx
|
|
217
218
|
import { useEffect, useRef } from "react";
|
|
@@ -1455,7 +1456,8 @@ function knobs() {
|
|
|
1455
1456
|
open: field2("The panel is open.", flag2),
|
|
1456
1457
|
docked: field2("Pinned to its side as a column, with the page in a frame beside it.", flag2),
|
|
1457
1458
|
handle: field2("Show the knobs handle on the window's edge while the panel is closed. false keeps it out of screenshots for this tab.", flag2),
|
|
1458
|
-
devIcon: field2("The yellow DEV ribbon on the tab's icon and the apple-touch-icon. auto shows it on a local host only: localhost, *.localhost, *.local, 0.0.0.0, a loopback or private network address.", oneOf(DEV_ICONS))
|
|
1459
|
+
devIcon: field2("The yellow DEV ribbon on the tab's icon and the apple-touch-icon. auto shows it on a local host only: localhost, *.localhost, *.local, 0.0.0.0, a loopback or private network address.", oneOf(DEV_ICONS)),
|
|
1460
|
+
realPhone: field2("Real phone mode. true has a host that sends requests as another browser, the extension, send the device's user agent to servers for the frame's page loads, so a site serves its mobile site; some sites may sign you out. false sends none for a device in the frame. The extension saves a change made during a user gesture, such as a click (the panel's switch included), for every tab and site; a change a script makes without one stays in this tab.", flag2)
|
|
1459
1461
|
}
|
|
1460
1462
|
}, "frame")
|
|
1461
1463
|
};
|
|
@@ -1467,8 +1469,8 @@ function describe() {
|
|
|
1467
1469
|
}
|
|
1468
1470
|
function defaultOf(key) {
|
|
1469
1471
|
if (key === "panel") {
|
|
1470
|
-
const { open, docked, handle, devIcon } = DEFAULT_STATE.panel;
|
|
1471
|
-
return { open, docked, handle, devIcon };
|
|
1472
|
+
const { open, docked, handle, devIcon, realPhone } = DEFAULT_STATE.panel;
|
|
1473
|
+
return { open, docked, handle, devIcon, realPhone };
|
|
1472
1474
|
}
|
|
1473
1475
|
if (key === "clock") {
|
|
1474
1476
|
const { mode, at, speed, header } = DEFAULT_STATE.clock;
|
|
@@ -2672,7 +2674,7 @@ var PANE = { openPane, paneView, onPane, retitlePane, showPane };
|
|
|
2672
2674
|
function here(element) {
|
|
2673
2675
|
return element.isConnected && element.ownerDocument.defaultView !== null;
|
|
2674
2676
|
}
|
|
2675
|
-
function createInspector(context, load = () => import("./elementsview-
|
|
2677
|
+
function createInspector(context, load = () => import("./elementsview-1wsxcdtj.js").then(({ createElementsView }) => ({ createStylesView: createElementsView })), pane = PANE) {
|
|
2676
2678
|
const { inspect, tips, prefs } = context;
|
|
2677
2679
|
const listeners = new Set;
|
|
2678
2680
|
let view = null;
|
|
@@ -6635,6 +6637,7 @@ var HANDLE_HINT = 4000;
|
|
|
6635
6637
|
function handleHint(keys, mac) {
|
|
6636
6638
|
return `press ${comboLabel(keys.panel, mac)} to open knobs`;
|
|
6637
6639
|
}
|
|
6640
|
+
var REAL_PHONE_HINT = "sends the phone's user agent to sites, so they serve their mobile site. some sites may sign you out.";
|
|
6638
6641
|
function createSettings(context) {
|
|
6639
6642
|
const { keys, prefs, grab, mac, bindingsHere, keysToggle, said, tips, render, renderKeys } = context;
|
|
6640
6643
|
const keysView = el("div", "keys pane");
|
|
@@ -6701,6 +6704,23 @@ function createSettings(context) {
|
|
|
6701
6704
|
row.append(hint);
|
|
6702
6705
|
keysView.append(row);
|
|
6703
6706
|
}
|
|
6707
|
+
const realPhoneSwitch = button("switch row-control", "");
|
|
6708
|
+
if (context.realPhone) {
|
|
6709
|
+
realPhoneSwitch.setAttribute("role", "switch");
|
|
6710
|
+
realPhoneSwitch.setAttribute("aria-label", "real phone mode");
|
|
6711
|
+
const hint = el("div", "row-hint", REAL_PHONE_HINT);
|
|
6712
|
+
hint.id = "devknobs-real-phone-hint";
|
|
6713
|
+
realPhoneSwitch.setAttribute("aria-describedby", hint.id);
|
|
6714
|
+
const row = rowBox({
|
|
6715
|
+
main: el("div", "main"),
|
|
6716
|
+
glyph: icon("smartphone"),
|
|
6717
|
+
title: "real phone mode",
|
|
6718
|
+
ends: [realPhoneSwitch]
|
|
6719
|
+
}).box;
|
|
6720
|
+
row.append(hint);
|
|
6721
|
+
keysView.append(row);
|
|
6722
|
+
realPhoneSwitch.addEventListener("click", () => context.setRealPhone(realPhoneSwitch.getAttribute("aria-checked") !== "true"));
|
|
6723
|
+
}
|
|
6704
6724
|
const devIconSwitch = button("switch row-control", "");
|
|
6705
6725
|
devIconSwitch.setAttribute("role", "switch");
|
|
6706
6726
|
devIconSwitch.setAttribute("aria-label", "dev tab icon");
|
|
@@ -6845,6 +6865,9 @@ function createSettings(context) {
|
|
|
6845
6865
|
drawDevIcon(shown2) {
|
|
6846
6866
|
mark(devIconSwitch, shown2, "aria-checked");
|
|
6847
6867
|
},
|
|
6868
|
+
drawRealPhone(on) {
|
|
6869
|
+
mark(realPhoneSwitch, on, "aria-checked");
|
|
6870
|
+
},
|
|
6848
6871
|
drawNative(on, note) {
|
|
6849
6872
|
mark(nativeSwitch2, on, "aria-checked");
|
|
6850
6873
|
const hint = note ?? native?.hint ?? "";
|
|
@@ -8812,6 +8835,8 @@ function createPanel(options2 = {}) {
|
|
|
8812
8835
|
showHandle: () => setState({ panel: { handle: true } }),
|
|
8813
8836
|
devIconShown: () => devIconShown(getState().panel.devIcon, window.location.hostname),
|
|
8814
8837
|
setDevIcon: (on) => setState({ panel: { devIcon: devIconFor(on, window.location.hostname) } }),
|
|
8838
|
+
realPhone: hostSendsUa(),
|
|
8839
|
+
setRealPhone: (on) => setState({ panel: { realPhone: on } }),
|
|
8815
8840
|
native: nativeSwitch()?.setting ?? null,
|
|
8816
8841
|
setNative: (on) => {
|
|
8817
8842
|
nativeSwitch()?.setting.change(on);
|
|
@@ -8913,6 +8938,7 @@ function createPanel(options2 = {}) {
|
|
|
8913
8938
|
wrap.dataset.handle = handleShown ? "shown" : "hidden";
|
|
8914
8939
|
settings.drawHandle(handleShown);
|
|
8915
8940
|
settings.drawDevIcon(devIconShown(state.panel.devIcon, window.location.hostname));
|
|
8941
|
+
settings.drawRealPhone(state.panel.realPhone);
|
|
8916
8942
|
const nativeNow = nativeSwitch();
|
|
8917
8943
|
if (nativeNow)
|
|
8918
8944
|
settings.drawNative(nativeNow.on, nativeNow.note);
|
|
@@ -9233,7 +9259,7 @@ function createPanel(options2 = {}) {
|
|
|
9233
9259
|
}
|
|
9234
9260
|
|
|
9235
9261
|
// src/version.ts
|
|
9236
|
-
var VERSION = "0.5.
|
|
9262
|
+
var VERSION = "0.5.3";
|
|
9237
9263
|
// src/index.ts
|
|
9238
9264
|
var panel = null;
|
|
9239
9265
|
var stopKeys = null;
|
|
@@ -9507,7 +9533,7 @@ async function grab(elements, options2) {
|
|
|
9507
9533
|
const host = hosted("grab");
|
|
9508
9534
|
if (host)
|
|
9509
9535
|
return host(elements, options2);
|
|
9510
|
-
const loaded = await import("./index-
|
|
9536
|
+
const loaded = await import("./index-sn2y6j09.js");
|
|
9511
9537
|
return loaded.grab(elements, options2);
|
|
9512
9538
|
}
|
|
9513
9539
|
var api = { mount, unmount, getState: getState2, setState: setState2, reset: reset2, replay: replay2, grab, describe: describe2, ready: ready2 };
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
cookieText,
|
|
7
7
|
put,
|
|
8
8
|
storedPresets
|
|
9
|
-
} from "./react-
|
|
9
|
+
} from "./react-7vjfsh40.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-mmq2zya3.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-3rhdj2k1.js";
|
|
38
38
|
import {
|
|
39
39
|
stamped,
|
|
40
40
|
webStorage
|
|
41
|
-
} from "./react-
|
|
41
|
+
} from "./react-6tss0r9f.js";
|
|
42
42
|
|
|
43
43
|
// src/storage/site.ts
|
|
44
44
|
function isOwn(key) {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
cookieText,
|
|
6
6
|
put,
|
|
7
7
|
storedPresets
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-zt3rheck.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-begsqdm0.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-6wbgqkdz.js";
|
|
37
37
|
import {
|
|
38
38
|
stamped,
|
|
39
39
|
webStorage
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-p57fdttx.js";
|
|
41
41
|
|
|
42
42
|
// src/storage/site.ts
|
|
43
43
|
function isOwn(key) {
|
package/dist/types.d.ts
CHANGED
|
@@ -156,6 +156,13 @@ export interface PanelValue {
|
|
|
156
156
|
handle: boolean;
|
|
157
157
|
/** The dev ribbon on the tab's icon, for this tab. */
|
|
158
158
|
devIcon: DevIconValue;
|
|
159
|
+
/**
|
|
160
|
+
* Real phone mode: a host that sends requests as another browser sends the
|
|
161
|
+
* device's to servers for the frame's page loads, so a site serves its
|
|
162
|
+
* mobile site. Off, a device in the frame sends none. The host keeps it as
|
|
163
|
+
* one setting for every tab and site.
|
|
164
|
+
*/
|
|
165
|
+
realPhone: boolean;
|
|
159
166
|
/**
|
|
160
167
|
* Ids of the rows set from the panel. Each stays in the list, back at its
|
|
161
168
|
* default too, until a hold on its `×` takes it off. Reset all lists the default rows
|
package/dist/ui/settings.d.ts
CHANGED
|
@@ -44,6 +44,10 @@ export interface SettingsContext {
|
|
|
44
44
|
devIconShown(): boolean;
|
|
45
45
|
/** The user turned the dev ribbon on the tab's icon off or on. */
|
|
46
46
|
setDevIcon(on: boolean): void;
|
|
47
|
+
/** Real phone mode is offered: only a host that sends requests as another browser can. */
|
|
48
|
+
realPhone: boolean;
|
|
49
|
+
/** The user turned real phone mode off or on. */
|
|
50
|
+
setRealPhone(on: boolean): void;
|
|
47
51
|
/** The words of the host's switch for its native driver, null with none. */
|
|
48
52
|
native: {
|
|
49
53
|
label: string;
|
|
@@ -72,6 +76,8 @@ export interface Settings {
|
|
|
72
76
|
drawHandle(shown: boolean): void;
|
|
73
77
|
/** Show whether the tab's icon has the dev ribbon. */
|
|
74
78
|
drawDevIcon(shown: boolean): void;
|
|
79
|
+
/** Show whether real phone mode is on. */
|
|
80
|
+
drawRealPhone(on: boolean): void;
|
|
75
81
|
/** Show whether the native driver is on, and why it last went off or on in place of its hint. */
|
|
76
82
|
drawNative(on: boolean, note: string | null): void;
|
|
77
83
|
/** Show who runs the panel, where a host gives the choice. */
|
|
@@ -82,4 +88,6 @@ export interface Settings {
|
|
|
82
88
|
leaveKeys(): void;
|
|
83
89
|
destroy(): void;
|
|
84
90
|
}
|
|
91
|
+
/** What real phone mode costs, under its switch. */
|
|
92
|
+
export declare const REAL_PHONE_HINT = "sends the phone's user agent to sites, so they serve their mobile site. some sites may sign you out.";
|
|
85
93
|
export declare function createSettings(context: SettingsContext): Settings;
|