@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/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
lerp,
|
|
9
9
|
setDockWidth,
|
|
10
10
|
watchColumn
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-j1h13ahg.js";
|
|
12
12
|
import {
|
|
13
13
|
GRAB_COLORS as GRAB_COLORS2,
|
|
14
14
|
GRAB_COLOR_NAMES,
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
createGrab,
|
|
18
18
|
createInspect,
|
|
19
19
|
oneAtATime
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-9jhatmky.js";
|
|
21
21
|
import {
|
|
22
22
|
hushOnce
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-q73py563.js";
|
|
24
24
|
import {
|
|
25
25
|
label
|
|
26
26
|
} from "./index-78r0f8pw.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
showPane,
|
|
39
39
|
stopOnLoad,
|
|
40
40
|
viewHead
|
|
41
|
-
} from "./index-
|
|
41
|
+
} from "./index-zt3rheck.js";
|
|
42
42
|
import {
|
|
43
43
|
actButton,
|
|
44
44
|
button,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
tabBar,
|
|
68
68
|
textField,
|
|
69
69
|
toolbar
|
|
70
|
-
} from "./index-
|
|
70
|
+
} from "./index-begsqdm0.js";
|
|
71
71
|
import {
|
|
72
72
|
BINDING_ICONS,
|
|
73
73
|
BODY_CAP,
|
|
@@ -98,6 +98,7 @@ import {
|
|
|
98
98
|
highlightAt,
|
|
99
99
|
holdInTopLayer,
|
|
100
100
|
holdingHinge,
|
|
101
|
+
hostSendsUa,
|
|
101
102
|
icon,
|
|
102
103
|
isFunctionKey,
|
|
103
104
|
isSearchKey,
|
|
@@ -132,7 +133,7 @@ import {
|
|
|
132
133
|
watchPanel,
|
|
133
134
|
zoomAction,
|
|
134
135
|
zoomKey
|
|
135
|
-
} from "./index-
|
|
136
|
+
} from "./index-6wbgqkdz.js";
|
|
136
137
|
import {
|
|
137
138
|
BARS,
|
|
138
139
|
BROWSERS,
|
|
@@ -211,7 +212,7 @@ import {
|
|
|
211
212
|
userAgentOf,
|
|
212
213
|
watchSystemMedia,
|
|
213
214
|
webStorage
|
|
214
|
-
} from "./index-
|
|
215
|
+
} from "./index-p57fdttx.js";
|
|
215
216
|
|
|
216
217
|
// src/ui/knobs.ts
|
|
217
218
|
var MINUTE = 60000;
|
|
@@ -1452,7 +1453,8 @@ function knobs() {
|
|
|
1452
1453
|
open: field2("The panel is open.", flag2),
|
|
1453
1454
|
docked: field2("Pinned to its side as a column, with the page in a frame beside it.", flag2),
|
|
1454
1455
|
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),
|
|
1455
|
-
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))
|
|
1456
|
+
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)),
|
|
1457
|
+
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)
|
|
1456
1458
|
}
|
|
1457
1459
|
}, "frame")
|
|
1458
1460
|
};
|
|
@@ -1464,8 +1466,8 @@ function describe() {
|
|
|
1464
1466
|
}
|
|
1465
1467
|
function defaultOf(key) {
|
|
1466
1468
|
if (key === "panel") {
|
|
1467
|
-
const { open, docked, handle, devIcon } = DEFAULT_STATE.panel;
|
|
1468
|
-
return { open, docked, handle, devIcon };
|
|
1469
|
+
const { open, docked, handle, devIcon, realPhone } = DEFAULT_STATE.panel;
|
|
1470
|
+
return { open, docked, handle, devIcon, realPhone };
|
|
1469
1471
|
}
|
|
1470
1472
|
if (key === "clock") {
|
|
1471
1473
|
const { mode, at, speed, header } = DEFAULT_STATE.clock;
|
|
@@ -2669,7 +2671,7 @@ var PANE = { openPane, paneView, onPane, retitlePane, showPane };
|
|
|
2669
2671
|
function here(element) {
|
|
2670
2672
|
return element.isConnected && element.ownerDocument.defaultView !== null;
|
|
2671
2673
|
}
|
|
2672
|
-
function createInspector(context, load = () => import("./elementsview-
|
|
2674
|
+
function createInspector(context, load = () => import("./elementsview-3kv34jfx.js").then(({ createElementsView }) => ({ createStylesView: createElementsView })), pane = PANE) {
|
|
2673
2675
|
const { inspect, tips, prefs } = context;
|
|
2674
2676
|
const listeners = new Set;
|
|
2675
2677
|
let view = null;
|
|
@@ -6632,6 +6634,7 @@ var HANDLE_HINT = 4000;
|
|
|
6632
6634
|
function handleHint(keys, mac) {
|
|
6633
6635
|
return `press ${comboLabel(keys.panel, mac)} to open knobs`;
|
|
6634
6636
|
}
|
|
6637
|
+
var REAL_PHONE_HINT = "sends the phone's user agent to sites, so they serve their mobile site. some sites may sign you out.";
|
|
6635
6638
|
function createSettings(context) {
|
|
6636
6639
|
const { keys, prefs, grab, mac, bindingsHere, keysToggle, said, tips, render, renderKeys } = context;
|
|
6637
6640
|
const keysView = el("div", "keys pane");
|
|
@@ -6698,6 +6701,23 @@ function createSettings(context) {
|
|
|
6698
6701
|
row.append(hint);
|
|
6699
6702
|
keysView.append(row);
|
|
6700
6703
|
}
|
|
6704
|
+
const realPhoneSwitch = button("switch row-control", "");
|
|
6705
|
+
if (context.realPhone) {
|
|
6706
|
+
realPhoneSwitch.setAttribute("role", "switch");
|
|
6707
|
+
realPhoneSwitch.setAttribute("aria-label", "real phone mode");
|
|
6708
|
+
const hint = el("div", "row-hint", REAL_PHONE_HINT);
|
|
6709
|
+
hint.id = "devknobs-real-phone-hint";
|
|
6710
|
+
realPhoneSwitch.setAttribute("aria-describedby", hint.id);
|
|
6711
|
+
const row = rowBox({
|
|
6712
|
+
main: el("div", "main"),
|
|
6713
|
+
glyph: icon("smartphone"),
|
|
6714
|
+
title: "real phone mode",
|
|
6715
|
+
ends: [realPhoneSwitch]
|
|
6716
|
+
}).box;
|
|
6717
|
+
row.append(hint);
|
|
6718
|
+
keysView.append(row);
|
|
6719
|
+
realPhoneSwitch.addEventListener("click", () => context.setRealPhone(realPhoneSwitch.getAttribute("aria-checked") !== "true"));
|
|
6720
|
+
}
|
|
6701
6721
|
const devIconSwitch = button("switch row-control", "");
|
|
6702
6722
|
devIconSwitch.setAttribute("role", "switch");
|
|
6703
6723
|
devIconSwitch.setAttribute("aria-label", "dev tab icon");
|
|
@@ -6842,6 +6862,9 @@ function createSettings(context) {
|
|
|
6842
6862
|
drawDevIcon(shown2) {
|
|
6843
6863
|
mark(devIconSwitch, shown2, "aria-checked");
|
|
6844
6864
|
},
|
|
6865
|
+
drawRealPhone(on) {
|
|
6866
|
+
mark(realPhoneSwitch, on, "aria-checked");
|
|
6867
|
+
},
|
|
6845
6868
|
drawNative(on, note) {
|
|
6846
6869
|
mark(nativeSwitch2, on, "aria-checked");
|
|
6847
6870
|
const hint = note ?? native?.hint ?? "";
|
|
@@ -8809,6 +8832,8 @@ function createPanel(options2 = {}) {
|
|
|
8809
8832
|
showHandle: () => setState({ panel: { handle: true } }),
|
|
8810
8833
|
devIconShown: () => devIconShown(getState().panel.devIcon, window.location.hostname),
|
|
8811
8834
|
setDevIcon: (on) => setState({ panel: { devIcon: devIconFor(on, window.location.hostname) } }),
|
|
8835
|
+
realPhone: hostSendsUa(),
|
|
8836
|
+
setRealPhone: (on) => setState({ panel: { realPhone: on } }),
|
|
8812
8837
|
native: nativeSwitch()?.setting ?? null,
|
|
8813
8838
|
setNative: (on) => {
|
|
8814
8839
|
nativeSwitch()?.setting.change(on);
|
|
@@ -8910,6 +8935,7 @@ function createPanel(options2 = {}) {
|
|
|
8910
8935
|
wrap.dataset.handle = handleShown ? "shown" : "hidden";
|
|
8911
8936
|
settings.drawHandle(handleShown);
|
|
8912
8937
|
settings.drawDevIcon(devIconShown(state.panel.devIcon, window.location.hostname));
|
|
8938
|
+
settings.drawRealPhone(state.panel.realPhone);
|
|
8913
8939
|
const nativeNow = nativeSwitch();
|
|
8914
8940
|
if (nativeNow)
|
|
8915
8941
|
settings.drawNative(nativeNow.on, nativeNow.note);
|
|
@@ -9230,7 +9256,7 @@ function createPanel(options2 = {}) {
|
|
|
9230
9256
|
}
|
|
9231
9257
|
|
|
9232
9258
|
// src/version.ts
|
|
9233
|
-
var VERSION = "0.5.
|
|
9259
|
+
var VERSION = "0.5.3";
|
|
9234
9260
|
|
|
9235
9261
|
// src/index.ts
|
|
9236
9262
|
var PRESETS = {
|
|
@@ -9513,7 +9539,7 @@ async function grab(elements, options2) {
|
|
|
9513
9539
|
const host = hosted("grab");
|
|
9514
9540
|
if (host)
|
|
9515
9541
|
return host(elements, options2);
|
|
9516
|
-
const loaded = await import("./index-
|
|
9542
|
+
const loaded = await import("./index-prjpx67p.js");
|
|
9517
9543
|
return loaded.grab(elements, options2);
|
|
9518
9544
|
}
|
|
9519
9545
|
var api = { mount, unmount, getState: getState2, setState: setState2, reset: reset2, replay: replay2, grab, describe: describe2, ready: ready2 };
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
uaPreset,
|
|
71
71
|
webStorage,
|
|
72
72
|
wrapDate
|
|
73
|
-
} from "./react-
|
|
73
|
+
} from "./react-6tss0r9f.js";
|
|
74
74
|
|
|
75
75
|
// src/ui/icons.ts
|
|
76
76
|
var SVG = "http://www.w3.org/2000/svg";
|
|
@@ -2194,7 +2194,7 @@ function pause(on) {
|
|
|
2194
2194
|
|
|
2195
2195
|
// src/engine/frames.ts
|
|
2196
2196
|
var kit = null;
|
|
2197
|
-
var load2 = () => import("./framekit-
|
|
2197
|
+
var load2 = () => import("./framekit-cjz0e4y8.js");
|
|
2198
2198
|
var loading = null;
|
|
2199
2199
|
var down = false;
|
|
2200
2200
|
var waiting = [];
|
|
@@ -2204,12 +2204,14 @@ var exit = null;
|
|
|
2204
2204
|
var zoomTo = null;
|
|
2205
2205
|
var askWhy = null;
|
|
2206
2206
|
var framed2 = null;
|
|
2207
|
+
var loader = null;
|
|
2207
2208
|
function arrived(loaded) {
|
|
2208
2209
|
kit = loaded;
|
|
2209
2210
|
loaded.width.onExit(exit);
|
|
2210
2211
|
loaded.width.onZoom(zoomTo);
|
|
2211
2212
|
loaded.width.onRefused(askWhy);
|
|
2212
2213
|
loaded.width.onFramed(framed2);
|
|
2214
|
+
loaded.width.onLoader(loader);
|
|
2213
2215
|
for (const run of waiting.splice(0))
|
|
2214
2216
|
run(loaded);
|
|
2215
2217
|
for (const state of [before, latest]) {
|
|
@@ -2290,6 +2292,10 @@ function onFramed(handler) {
|
|
|
2290
2292
|
framed2 = handler;
|
|
2291
2293
|
kit?.width.onFramed(handler);
|
|
2292
2294
|
}
|
|
2295
|
+
function onLoader(handler) {
|
|
2296
|
+
loader = handler;
|
|
2297
|
+
kit?.width.onLoader(handler);
|
|
2298
|
+
}
|
|
2293
2299
|
function frameWindow() {
|
|
2294
2300
|
return kit?.width.frameWindow() ?? null;
|
|
2295
2301
|
}
|
|
@@ -2343,6 +2349,7 @@ __export(exports_engine, {
|
|
|
2343
2349
|
ready: () => ready,
|
|
2344
2350
|
nativeSwitch: () => nativeSwitch,
|
|
2345
2351
|
keepPlace: () => keepPlace2,
|
|
2352
|
+
hostSendsUa: () => hostSendsUa,
|
|
2346
2353
|
getState: () => getState,
|
|
2347
2354
|
applyState: () => applyState
|
|
2348
2355
|
});
|
|
@@ -4547,6 +4554,7 @@ var persist = true;
|
|
|
4547
4554
|
var running = false;
|
|
4548
4555
|
var native2 = null;
|
|
4549
4556
|
var nativeNote = null;
|
|
4557
|
+
var toldRealPhone = false;
|
|
4550
4558
|
var inFrame = false;
|
|
4551
4559
|
var stopRelay = null;
|
|
4552
4560
|
var panelMoving = null;
|
|
@@ -4565,6 +4573,10 @@ function driver() {
|
|
|
4565
4573
|
}
|
|
4566
4574
|
function applyState(next) {
|
|
4567
4575
|
state = inFrame ? framed(next) : next;
|
|
4576
|
+
if (running && !inFrame && native2?.realPhone && toldRealPhone !== state.panel.realPhone) {
|
|
4577
|
+
toldRealPhone = state.panel.realPhone;
|
|
4578
|
+
native2.realPhone(toldRealPhone);
|
|
4579
|
+
}
|
|
4568
4580
|
const active2 = driver();
|
|
4569
4581
|
const page = inPage(state, active2);
|
|
4570
4582
|
const scheme = inFrame && nativeScheme(page.scheme) ? "system" : page.scheme;
|
|
@@ -4597,8 +4609,8 @@ function applyState(next) {
|
|
|
4597
4609
|
else if (native2 && !inFrame)
|
|
4598
4610
|
driveUa(native2, state);
|
|
4599
4611
|
apply17(state.spacing);
|
|
4600
|
-
apply4(state.ua);
|
|
4601
4612
|
const sized2 = inFrame ? state : framing(state, active2);
|
|
4613
|
+
apply4(!inFrame && needsFrame(sized2) ? DEFAULT_STATE.ua : state.ua);
|
|
4602
4614
|
apply11(sized2);
|
|
4603
4615
|
apply15(state.overflow && !needsFrame(sized2));
|
|
4604
4616
|
apply14(state.outlines);
|
|
@@ -4619,6 +4631,9 @@ function setNative(on3, note) {
|
|
|
4619
4631
|
if (running && (changed || note !== undefined))
|
|
4620
4632
|
applyState(state);
|
|
4621
4633
|
}
|
|
4634
|
+
function hostSendsUa() {
|
|
4635
|
+
return native2?.ua !== undefined && native2.realPhone !== undefined;
|
|
4636
|
+
}
|
|
4622
4637
|
function nativeSwitch() {
|
|
4623
4638
|
if (!native2?.setting)
|
|
4624
4639
|
return null;
|
|
@@ -4687,7 +4702,10 @@ function start4(options = {}) {
|
|
|
4687
4702
|
onZoom((zoom) => setState({ zoom }));
|
|
4688
4703
|
onRefused(native2?.refused ?? null);
|
|
4689
4704
|
onFramed(native2?.framed ?? null);
|
|
4690
|
-
|
|
4705
|
+
onLoader(native2?.load ?? null);
|
|
4706
|
+
const first = merge(stored ? load() : { ...DEFAULT_STATE }, options.state ?? {});
|
|
4707
|
+
toldRealPhone = first.panel.realPhone;
|
|
4708
|
+
applyState(first);
|
|
4691
4709
|
if (!inFrame)
|
|
4692
4710
|
return;
|
|
4693
4711
|
relay(overflowCount());
|
|
@@ -4707,6 +4725,7 @@ function stop2() {
|
|
|
4707
4725
|
onZoom(null);
|
|
4708
4726
|
onRefused(null);
|
|
4709
4727
|
onFramed(null);
|
|
4728
|
+
onLoader(null);
|
|
4710
4729
|
destroy();
|
|
4711
4730
|
reset6();
|
|
4712
4731
|
reset9();
|
|
@@ -4979,4 +4998,4 @@ function forwardKeys(keys = () => defaultKeys(), open = () => true) {
|
|
|
4979
4998
|
return () => window.removeEventListener("keydown", onKeydown, true);
|
|
4980
4999
|
}
|
|
4981
5000
|
|
|
4982
|
-
export { BODY_CAP, READ_MS, requestLog, sends, canonicalTag, LOCALE_PRESETS, overflowCount, onCount, devIconShown, devIconFor, SPEED_MIN, SPEED_MAX, TIME_ZONE_PRESETS, canonicalZone, resolveTimeZone, composedParent, isDevknobs, isGrabbable, grabTargetAt, LAYER, HOST_RESET, holdInTopLayer, pause, frameWindow, panelSized, zoomKey, landSplash, takeHinge, moveHinge, letGo, holdingHinge, foldRest, watchFold, watchHinge, getState, subscribe, setNative, nativeSwitch, setState, ready, watchPanel, keepPlace2 as keepPlace, reset19 as reset, start4 as start, stop2 as stop, replay2 as replay, exports_engine, parseCombo, comboText, withShift, isFunctionKey, comboLabel, comboSpoken, defaultKeys, KEYS_FIELD, typesInField, lowerKey, keyIs, keyAction, isSearchKey, typeAhead, zoomAction, escapeStep, highlightAt, paletteMove, radioMove, forwardKeys, ROW_ICONS, rowIcon, BINDING_ICONS, icon, glyph };
|
|
5001
|
+
export { BODY_CAP, READ_MS, requestLog, sends, canonicalTag, LOCALE_PRESETS, overflowCount, onCount, devIconShown, devIconFor, SPEED_MIN, SPEED_MAX, TIME_ZONE_PRESETS, canonicalZone, resolveTimeZone, composedParent, isDevknobs, isGrabbable, grabTargetAt, LAYER, HOST_RESET, holdInTopLayer, pause, frameWindow, panelSized, zoomKey, landSplash, takeHinge, moveHinge, letGo, holdingHinge, foldRest, watchFold, watchHinge, getState, subscribe, setNative, hostSendsUa, nativeSwitch, setState, ready, watchPanel, keepPlace2 as keepPlace, reset19 as reset, start4 as start, stop2 as stop, replay2 as replay, exports_engine, parseCombo, comboText, withShift, isFunctionKey, comboLabel, comboSpoken, defaultKeys, KEYS_FIELD, typesInField, lowerKey, keyIs, keyAction, isSearchKey, typeAhead, zoomAction, escapeStep, highlightAt, paletteMove, radioMove, forwardKeys, ROW_ICONS, rowIcon, BINDING_ICONS, icon, glyph };
|
|
@@ -377,7 +377,7 @@ function hold(state, patch) {
|
|
|
377
377
|
}
|
|
378
378
|
return next;
|
|
379
379
|
}
|
|
380
|
-
function settle(state) {
|
|
380
|
+
function settle(state, dropUa = true) {
|
|
381
381
|
const { width, height } = state;
|
|
382
382
|
const sized = typeof width === "number" && typeof height === "number";
|
|
383
383
|
const orientation = sized && width > height ? "landscape" : "portrait";
|
|
@@ -388,7 +388,9 @@ function settle(state) {
|
|
|
388
388
|
const same = orientation === state.orientation && posture === state.posture;
|
|
389
389
|
if (same && id === state.device)
|
|
390
390
|
return state;
|
|
391
|
-
|
|
391
|
+
const dropped = dropUa && id !== state.device && device !== undefined && state.ua.preset === device.ua;
|
|
392
|
+
const ua = dropped ? { ...state.ua, preset: "system" } : state.ua;
|
|
393
|
+
return { ...state, orientation, posture, device: id, ua };
|
|
392
394
|
}
|
|
393
395
|
|
|
394
396
|
// src/engine/stored.ts
|
|
@@ -1210,6 +1212,7 @@ var DEFAULT_STATE = {
|
|
|
1210
1212
|
docked: false,
|
|
1211
1213
|
handle: true,
|
|
1212
1214
|
devIcon: "auto",
|
|
1215
|
+
realPhone: false,
|
|
1213
1216
|
pinned: [...DEFAULT_PINNED]
|
|
1214
1217
|
}
|
|
1215
1218
|
};
|
|
@@ -1382,6 +1385,7 @@ function parse(json, place) {
|
|
|
1382
1385
|
...placeOf(panel, home),
|
|
1383
1386
|
handle: bool(panel.handle, DEFAULT_STATE.panel.handle),
|
|
1384
1387
|
devIcon: oneOf(panel.devIcon, DEV_ICONS, DEFAULT_STATE.panel.devIcon),
|
|
1388
|
+
realPhone: bool(panel.realPhone, DEFAULT_STATE.panel.realPhone),
|
|
1385
1389
|
pinned: state.panel === undefined ? [...DEFAULT_PINNED] : rowIds(panel.pinned)
|
|
1386
1390
|
}
|
|
1387
1391
|
};
|
|
@@ -1400,7 +1404,7 @@ function merge(state, patch) {
|
|
|
1400
1404
|
network: { ...state.network, ...held.network },
|
|
1401
1405
|
ua: { ...state.ua, ...held.ua },
|
|
1402
1406
|
panel: { ...state.panel, ...held.panel }
|
|
1403
|
-
});
|
|
1407
|
+
}, patch.ua === undefined);
|
|
1404
1408
|
}
|
|
1405
1409
|
function item(kind, key) {
|
|
1406
1410
|
try {
|
|
@@ -1410,11 +1414,13 @@ function item(kind, key) {
|
|
|
1410
1414
|
}
|
|
1411
1415
|
}
|
|
1412
1416
|
function load() {
|
|
1413
|
-
|
|
1417
|
+
const state = parse(item("session", STORAGE_KEY), item("local", PLACE_KEY));
|
|
1418
|
+
return { ...state, panel: { ...state.panel, realPhone: DEFAULT_STATE.panel.realPhone } };
|
|
1414
1419
|
}
|
|
1415
1420
|
function save(state) {
|
|
1416
1421
|
try {
|
|
1417
|
-
|
|
1422
|
+
const { realPhone: _, ...panel } = state.panel;
|
|
1423
|
+
webStorage("session")?.setItem(STORAGE_KEY, JSON.stringify(stamped({ ...state, panel }, STATE_VERSION)));
|
|
1418
1424
|
} catch {}
|
|
1419
1425
|
}
|
|
1420
1426
|
function keepPlace(state) {
|
|
@@ -1965,7 +1971,7 @@ function iphoneRight(control) {
|
|
|
1965
1971
|
}
|
|
1966
1972
|
var BODIES = {
|
|
1967
1973
|
"iphone-18-pro": {
|
|
1968
|
-
bezel: sides2(15.7,
|
|
1974
|
+
bezel: sides2(15.7, 15.7, 15.7, 15.7),
|
|
1969
1975
|
screenRadius: 62,
|
|
1970
1976
|
bodyRadius: 77.7,
|
|
1971
1977
|
out: 3,
|
|
@@ -1973,7 +1979,7 @@ var BODIES = {
|
|
|
1973
1979
|
buttons: [left(186, 41.7), left(258.3, 67.7), left(344, 68), right(281.7, 107, 2.7)]
|
|
1974
1980
|
},
|
|
1975
1981
|
"iphone-18-pro-max": {
|
|
1976
|
-
bezel: sides2(15.3, 15.3, 15, 15.3),
|
|
1982
|
+
bezel: sides2(15.3, 15.3, 15.3, 15.3),
|
|
1977
1983
|
screenRadius: 62,
|
|
1978
1984
|
bodyRadius: 77.3,
|
|
1979
1985
|
out: 2.7,
|
|
@@ -1998,14 +2004,14 @@ var BODIES = {
|
|
|
1998
2004
|
},
|
|
1999
2005
|
"iphone-air": {
|
|
2000
2006
|
bezel: sides2(15.3, 15.3, 15.3, 15.3),
|
|
2001
|
-
screenRadius:
|
|
2007
|
+
screenRadius: 62,
|
|
2002
2008
|
bodyRadius: 77.3,
|
|
2003
2009
|
out: 2.7,
|
|
2004
2010
|
front: [pill("sensor", 147.33, 20, 125.33, 36.67)],
|
|
2005
2011
|
buttons: [left(185, 41.7), left(257.3, 67.7), left(343, 67.7), right(280.7, 106.7, 3)]
|
|
2006
2012
|
},
|
|
2007
2013
|
"iphone-17": {
|
|
2008
|
-
bezel: sides2(14.
|
|
2014
|
+
bezel: sides2(14.7, 14.7, 14.7, 14.7),
|
|
2009
2015
|
screenRadius: 62,
|
|
2010
2016
|
bodyRadius: 76.7,
|
|
2011
2017
|
out: 3,
|
|
@@ -2013,7 +2019,7 @@ var BODIES = {
|
|
|
2013
2019
|
buttons: [left(185, 41.7), left(257.3, 67.7), left(342.7, 68), right(280.3, 107, 2.7)]
|
|
2014
2020
|
},
|
|
2015
2021
|
"iphone-17-pro": {
|
|
2016
|
-
bezel: sides2(15.7,
|
|
2022
|
+
bezel: sides2(15.7, 15.7, 15.7, 15.7),
|
|
2017
2023
|
screenRadius: 62,
|
|
2018
2024
|
bodyRadius: 77.7,
|
|
2019
2025
|
out: 3,
|
|
@@ -2021,7 +2027,7 @@ var BODIES = {
|
|
|
2021
2027
|
buttons: [left(186, 41.7), left(258.3, 67.7), left(344, 67.7), right(281.7, 107, 2.7)]
|
|
2022
2028
|
},
|
|
2023
2029
|
"iphone-17-pro-max": {
|
|
2024
|
-
bezel: sides2(15.3, 15.3, 15, 15.3),
|
|
2030
|
+
bezel: sides2(15.3, 15.3, 15.3, 15.3),
|
|
2025
2031
|
screenRadius: 62,
|
|
2026
2032
|
bodyRadius: 77.3,
|
|
2027
2033
|
out: 2.7,
|
|
@@ -2029,8 +2035,8 @@ var BODIES = {
|
|
|
2029
2035
|
buttons: [left(186.3, 41.7), left(258.7, 67.7), left(344.3, 67.7), right(282, 106.7)]
|
|
2030
2036
|
},
|
|
2031
2037
|
"iphone-16": {
|
|
2032
|
-
bezel: sides2(19.7, 19.7, 19.
|
|
2033
|
-
screenRadius: 55,
|
|
2038
|
+
bezel: sides2(19.7, 19.7, 19.7, 19.7),
|
|
2039
|
+
screenRadius: 55.8,
|
|
2034
2040
|
bodyRadius: 75.5,
|
|
2035
2041
|
out: 2.7,
|
|
2036
2042
|
front: [pill("sensor", 134, 11.3, 124.9, 36.7)],
|
|
@@ -2038,15 +2044,15 @@ var BODIES = {
|
|
|
2038
2044
|
},
|
|
2039
2045
|
"iphone-16-plus": {
|
|
2040
2046
|
bezel: sides2(19.7, 19.7, 19.7, 19.7),
|
|
2041
|
-
screenRadius: 55,
|
|
2047
|
+
screenRadius: 55.8,
|
|
2042
2048
|
bodyRadius: 75.5,
|
|
2043
2049
|
out: 2.7,
|
|
2044
2050
|
front: [pill("sensor", 152.3, 11.3, 125.4, 36.7)],
|
|
2045
2051
|
buttons: [...IPHONE_LEFT, ...iphoneRight(608.5)]
|
|
2046
2052
|
},
|
|
2047
2053
|
"iphone-16-pro": {
|
|
2048
|
-
bezel: sides2(14.7, 14.7, 14.
|
|
2049
|
-
screenRadius:
|
|
2054
|
+
bezel: sides2(14.7, 14.7, 14.7, 14.7),
|
|
2055
|
+
screenRadius: 63.2,
|
|
2050
2056
|
bodyRadius: 77.9,
|
|
2051
2057
|
out: 2.7,
|
|
2052
2058
|
front: [pill("sensor", 138.33, 14, 125.33, 36.67)],
|
|
@@ -2054,7 +2060,7 @@ var BODIES = {
|
|
|
2054
2060
|
},
|
|
2055
2061
|
"iphone-16-pro-max": {
|
|
2056
2062
|
bezel: sides2(14.3, 14.3, 14.3, 14.3),
|
|
2057
|
-
screenRadius:
|
|
2063
|
+
screenRadius: 63.6,
|
|
2058
2064
|
bodyRadius: 77.9,
|
|
2059
2065
|
out: 2.7,
|
|
2060
2066
|
front: [pill("sensor", 157.3, 14, 125.4, 36.7)],
|
|
@@ -3012,8 +3018,7 @@ function mockOf(id, orientation) {
|
|
|
3012
3018
|
return key ? [shown, round("key", at(key))] : [shown];
|
|
3013
3019
|
})
|
|
3014
3020
|
];
|
|
3015
|
-
const
|
|
3016
|
-
const upright = { width, height, inset: inset2, body, screenRadius, continuous, bodyRadius, parts };
|
|
3021
|
+
const upright = { width, height, inset: inset2, body, screenRadius, bodyRadius, parts };
|
|
3017
3022
|
if (orientation === "portrait")
|
|
3018
3023
|
return upright;
|
|
3019
3024
|
const clockwise = device.clockwise === true;
|
|
@@ -3133,11 +3138,18 @@ function drive(driver, state) {
|
|
|
3133
3138
|
hand(driver, "media", { scheme, motion, contrast: contrast2, transparency });
|
|
3134
3139
|
if (driver.viewport)
|
|
3135
3140
|
hand(driver, "viewport", nativeViewport(state));
|
|
3136
|
-
driveUa(driver, state);
|
|
3141
|
+
driveUa(driver, state, driver.viewport !== undefined && nativeViewport(state) !== null);
|
|
3137
3142
|
}
|
|
3138
|
-
function
|
|
3143
|
+
function hostUa(state, sized) {
|
|
3144
|
+
const brought = [deviceOf(state.device)?.ua, formOf(state.device, state.posture)?.ua];
|
|
3145
|
+
if (sized || !brought.includes(state.ua.preset))
|
|
3146
|
+
return nativeUa(state.ua);
|
|
3147
|
+
const ua = state.panel.realPhone ? nativeUa(state.ua) : null;
|
|
3148
|
+
return ua && { ...ua, frame: true };
|
|
3149
|
+
}
|
|
3150
|
+
function driveUa(driver, state, sized = false) {
|
|
3139
3151
|
if (driver.ua)
|
|
3140
|
-
hand(driver, "ua",
|
|
3152
|
+
hand(driver, "ua", hostUa(state, sized));
|
|
3141
3153
|
}
|
|
3142
3154
|
function release(driver, ua = true) {
|
|
3143
3155
|
if (sent.size === 0)
|
|
@@ -3418,7 +3430,10 @@ function lookOf(value) {
|
|
|
3418
3430
|
};
|
|
3419
3431
|
const top2 = color("top");
|
|
3420
3432
|
const bottom = color("bottom");
|
|
3421
|
-
|
|
3433
|
+
const header = read2("header");
|
|
3434
|
+
if (typeof header !== "boolean")
|
|
3435
|
+
return null;
|
|
3436
|
+
return { background, top: top2, bottom, header, footer: read2("footer") === true, under: [], dark, scheme, host, canBack, canForward };
|
|
3422
3437
|
}
|
|
3423
3438
|
function readSnapshot(knobs, view) {
|
|
3424
3439
|
try {
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
lay,
|
|
6
6
|
rowBox,
|
|
7
7
|
rowButton
|
|
8
|
-
} from "./react-
|
|
8
|
+
} from "./react-mmq2zya3.js";
|
|
9
9
|
import {
|
|
10
10
|
getState,
|
|
11
11
|
icon
|
|
12
|
-
} from "./react-
|
|
12
|
+
} from "./react-3rhdj2k1.js";
|
|
13
13
|
import {
|
|
14
14
|
__require,
|
|
15
15
|
isDevknobsFrame,
|
|
16
16
|
newer,
|
|
17
17
|
webStorage
|
|
18
|
-
} from "./react-
|
|
18
|
+
} from "./react-6tss0r9f.js";
|
|
19
19
|
|
|
20
20
|
// src/ui/pane.ts
|
|
21
21
|
var PANE_WIDTH = 340;
|
|
@@ -207,7 +207,7 @@ function createPane(context) {
|
|
|
207
207
|
// src/ui/storageaction.ts
|
|
208
208
|
var STORAGE_VIEW = "storage";
|
|
209
209
|
function load() {
|
|
210
|
-
return import("./storageview-
|
|
210
|
+
return import("./storageview-7cv0vpdm.js").then((loaded) => loaded.storageView({
|
|
211
211
|
visible: () => getState().panel.open && !document.hidden
|
|
212
212
|
}));
|
|
213
213
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
subscribe,
|
|
10
10
|
typesInField,
|
|
11
11
|
withShift
|
|
12
|
-
} from "./react-
|
|
12
|
+
} from "./react-3rhdj2k1.js";
|
|
13
13
|
import {
|
|
14
14
|
__require,
|
|
15
15
|
addStyle,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
post,
|
|
19
19
|
readMessage,
|
|
20
20
|
systemMedia
|
|
21
|
-
} from "./react-
|
|
21
|
+
} from "./react-6tss0r9f.js";
|
|
22
22
|
|
|
23
23
|
// src/grab/keys.ts
|
|
24
24
|
var HOLD = 100;
|
|
@@ -160,7 +160,7 @@ function systemScheme() {
|
|
|
160
160
|
host.remove();
|
|
161
161
|
return dark ? "dark" : "light";
|
|
162
162
|
}
|
|
163
|
-
function createGrab(options = {}, loadMode = () => import("./index-
|
|
163
|
+
function createGrab(options = {}, loadMode = () => import("./index-sn2y6j09.js")) {
|
|
164
164
|
const keyNow = options.key ?? defaultGrabKey;
|
|
165
165
|
const { purpose } = options;
|
|
166
166
|
const channel = purpose?.channel ?? "grab";
|
|
@@ -369,7 +369,7 @@ function held(view) {
|
|
|
369
369
|
return null;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
function createInspect(options = {}, load = () => import("./index-
|
|
372
|
+
function createInspect(options = {}, load = () => import("./index-sn2y6j09.js"), frameOf = frameWindow) {
|
|
373
373
|
const inFrame = isDevknobsFrame();
|
|
374
374
|
const listeners = new Set;
|
|
375
375
|
let outliner = null;
|