sootsim 0.1.153 → 0.1.155
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/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-VUP4VAVS.js → agent-C3BYGNOR.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-D4ESDAXG.js → agent-wrapper-DR75UMEL.js} +2 -2
- package/dist-cli/chunks/{app-fonts-ZYYLH4SC.js → app-fonts-TC5QZXEN.js} +2 -2
- package/dist-cli/chunks/{assert-BFLCTPDL.js → assert-YICVET3K.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-LIMVUYCU.js +2 -0
- package/dist-cli/chunks/beta-GGCQHRJW.js +2 -0
- package/dist-cli/chunks/{camera-FSKBR7NQ.js → camera-4F5RQCBC.js} +2 -2
- package/dist-cli/chunks/{chunk-JWOALEME.js → chunk-2A4RF2GA.js} +2 -2
- package/dist-cli/chunks/{chunk-YNAS44F7.js → chunk-4BCGD37Q.js} +1 -1
- package/dist-cli/chunks/chunk-4BFAO5OU.js +2 -0
- package/dist-cli/chunks/{chunk-PZNY2IMY.js → chunk-6QWKWASG.js} +2 -2
- package/dist-cli/chunks/{chunk-J62KE5RK.js → chunk-7R5V5AIL.js} +1 -1
- package/dist-cli/chunks/{chunk-W2JRJNRF.js → chunk-ANM2NBPM.js} +1 -1
- package/dist-cli/chunks/{chunk-VKGXM77Z.js → chunk-AYRY5U2Y.js} +1 -1
- package/dist-cli/chunks/{chunk-H66V4LS4.js → chunk-BLTW2X3S.js} +2 -2
- package/dist-cli/chunks/chunk-BQ3UFSIG.js +1 -0
- package/dist-cli/chunks/{chunk-3H2TX3GH.js → chunk-BSY42HG5.js} +3 -3
- package/dist-cli/chunks/{chunk-KM6DRJEI.js → chunk-D43GSIWC.js} +2 -2
- package/dist-cli/chunks/{chunk-4FLQLE7X.js → chunk-DOQDF7TJ.js} +1 -1
- package/dist-cli/chunks/{chunk-GRE44V25.js → chunk-DQCTDCDF.js} +1 -1
- package/dist-cli/chunks/{chunk-SMYWVHZJ.js → chunk-DXBJHAQE.js} +2 -2
- package/dist-cli/chunks/{chunk-V6OMDU5O.js → chunk-EQ4VACQH.js} +2 -2
- package/dist-cli/chunks/{chunk-OEKYS3CU.js → chunk-EXF6FEAH.js} +2 -2
- package/dist-cli/chunks/{chunk-IEJ4RC3G.js → chunk-FUCVU7VO.js} +1 -1
- package/dist-cli/chunks/{chunk-UDN3JDKK.js → chunk-FY42AEQT.js} +2 -2
- package/dist-cli/chunks/{chunk-RSGKJDBB.js → chunk-IAE4IW7O.js} +2 -2
- package/dist-cli/chunks/{chunk-2IWPNBFB.js → chunk-IFV2H2PN.js} +2 -2
- package/dist-cli/chunks/{chunk-EXCVVWAW.js → chunk-INMKIIZH.js} +2 -2
- package/dist-cli/chunks/{chunk-D7LOPY4O.js → chunk-J4F5YPVG.js} +2 -2
- package/dist-cli/chunks/{chunk-FRAH3R5M.js → chunk-JD3CVFGB.js} +2 -2
- package/dist-cli/chunks/{chunk-BKX7SEPA.js → chunk-JDYTNXVQ.js} +1 -1
- package/dist-cli/chunks/{chunk-SQJ7EOXE.js → chunk-KJZD6GOC.js} +2 -2
- package/dist-cli/chunks/{chunk-V6T7LUYX.js → chunk-LQUJ5CK6.js} +3 -3
- package/dist-cli/chunks/{chunk-PR4A6ZBX.js → chunk-LTAFJDXF.js} +1 -1
- package/dist-cli/chunks/{chunk-D46GUIMS.js → chunk-M5LTONRB.js} +1 -1
- package/dist-cli/chunks/{chunk-YAMN6VOF.js → chunk-MDTM3GKQ.js} +1 -1
- package/dist-cli/chunks/{chunk-OVL52WGS.js → chunk-QQUWPJAN.js} +1 -1
- package/dist-cli/chunks/{chunk-KWCYMNNZ.js → chunk-QURX7PNL.js} +3 -3
- package/dist-cli/chunks/{chunk-W4H7MQVB.js → chunk-SEG4UA6N.js} +1 -1
- package/dist-cli/chunks/{chunk-LB6OTENV.js → chunk-SYECZJG3.js} +2 -2
- package/dist-cli/chunks/chunk-TJEKTG6V.js +1 -0
- package/dist-cli/chunks/chunk-U4JYYYUW.js +1 -0
- package/dist-cli/chunks/{chunk-BI5YCP4N.js → chunk-U5DVNBRT.js} +1 -1
- package/dist-cli/chunks/{chunk-EYBETMFT.js → chunk-UNE2CDA5.js} +2 -2
- package/dist-cli/chunks/{chunk-FHNZ72F2.js → chunk-UQTGLV4M.js} +1 -1
- package/dist-cli/chunks/{chunk-7ZMQBJPJ.js → chunk-UZZA6QOG.js} +2 -2
- package/dist-cli/chunks/{chunk-R2CHKR3F.js → chunk-VIDSBYBM.js} +2 -2
- package/dist-cli/chunks/{chunk-QR5D3PYK.js → chunk-VYUW5QK4.js} +1 -1
- package/dist-cli/chunks/{chunk-HWXC2EGB.js → chunk-WGMRS45V.js} +1 -1
- package/dist-cli/chunks/{chunk-XPQOPN7M.js → chunk-XQTW3Z46.js} +2 -2
- package/dist-cli/chunks/{chunk-VHNOMO4C.js → chunk-YXCVIAAU.js} +2 -2
- package/dist-cli/chunks/{chunk-LGXJNSQ7.js → chunk-ZHBF3X54.js} +2 -2
- package/dist-cli/chunks/cli-version-O7QJ4BZ2.js +2 -0
- package/dist-cli/chunks/{compat-3R3EOAHC.js → compat-5ZDXKMVB.js} +3 -3
- package/dist-cli/chunks/{config-M5QFP3HY.js → config-SALDFPNQ.js} +2 -2
- package/dist-cli/chunks/{control-VYNHMIGQ.js → control-CNRPHEU4.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-IXGMLKLH.js → cpu-profile-DWVQYLU2.js} +2 -2
- package/dist-cli/chunks/{daemon-UBTYY6D4.js → daemon-ZOLT5A64.js} +2 -2
- package/dist-cli/chunks/{debug-LV3MG5PC.js → debug-T2TZRZLM.js} +3 -3
- package/dist-cli/chunks/{detox-Q47VQ5PD.js → detox-ELF424V7.js} +2 -2
- package/dist-cli/chunks/{device-YCYTUZMI.js → device-VS6S2VBJ.js} +2 -2
- package/dist-cli/chunks/{diagnose-ST3MONQ7.js → diagnose-C6S6GF6P.js} +2 -2
- package/dist-cli/chunks/drivers-36GE2TDC.js +2 -0
- package/dist-cli/chunks/{electron-ZCYDKW2J.js → electron-364UUDHO.js} +3 -3
- package/dist-cli/chunks/flow-5D5SRQT6.js +2 -0
- package/dist-cli/chunks/help-F4BRZV6Y.js +2 -0
- package/dist-cli/chunks/{hints-F7FLRJZB.js → hints-CQHHEBUY.js} +2 -2
- package/dist-cli/chunks/{home-paths-XQ3Z7MZ2.js → home-paths-3S52MOTF.js} +2 -2
- package/dist-cli/chunks/{inspect-T3HU4JTX.js → inspect-TFHVPSB4.js} +3 -3
- package/dist-cli/chunks/install-WYCI7SLJ.js +2 -0
- package/dist-cli/chunks/{install-desktop-XEBZ4KIS.js → install-desktop-N2DYSBOT.js} +3 -3
- package/dist-cli/chunks/{keys-GLJBONHU.js → keys-5DJVHPJW.js} +2 -2
- package/dist-cli/chunks/{launch-JQRLMLEL.js → launch-PZY7TD5A.js} +3 -3
- package/dist-cli/chunks/{login-GWOXMZL2.js → login-TYJBJLHC.js} +4 -4
- package/dist-cli/chunks/{logout-WHUPTLE2.js → logout-SG4UGABE.js} +2 -2
- package/dist-cli/chunks/{maestro-D6JKMP67.js → maestro-H4CCHNKL.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-G43O66KE.js +2 -0
- package/dist-cli/chunks/{preview-UBF5FA32.js → preview-C6X3ITFK.js} +2 -2
- package/dist-cli/chunks/{profile-GTP2VYXL.js → profile-PTUACNTX.js} +2 -2
- package/dist-cli/chunks/{react-KITQMQJH.js → react-3D7WSSLI.js} +2 -2
- package/dist-cli/chunks/{record-DR37W3JA.js → record-MEMW545L.js} +2 -2
- package/dist-cli/chunks/runtime-ZLDHSWAR.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-DNETQTB7.js → runtime-delivery-UYRGLL35.js} +2 -2
- package/dist-cli/chunks/{screenshot-YFSYOMN2.js → screenshot-OWF4HNV6.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-OPRSV6SC.js → screenshot-mode-KM65465J.js} +2 -2
- package/dist-cli/chunks/{screenshots-ZW7O7GUN.js → screenshots-MJXEOC2O.js} +2 -2
- package/dist-cli/chunks/{server-P6LFB6TE.js → server-Q5ZYFO5O.js} +3 -3
- package/dist-cli/chunks/setup-repo-MANQTJRC.js +2 -0
- package/dist-cli/chunks/{skills-ET4YCGCE.js → skills-G2MSPKGR.js} +2 -2
- package/dist-cli/chunks/{slides-YBQMTQDC.js → slides-TZTHVGWV.js} +2 -2
- package/dist-cli/chunks/{start-ETZPDPFI.js → start-CJ35MCB6.js} +4 -4
- package/dist-cli/chunks/store-LZD4WSTY.js +2 -0
- package/dist-cli/chunks/telemetry-MR3X56AA.js +2 -0
- package/dist-cli/chunks/{test-7ONSXHTV.js → test-MUGRVEBG.js} +3 -3
- package/dist-cli/chunks/{three-mode-NJOEKCOV.js → three-mode-CQ6XZZU3.js} +2 -2
- package/dist-cli/chunks/{timeline-4HDF2MVZ.js → timeline-MM43OOX2.js} +2 -2
- package/dist-cli/chunks/{upgrade-P5OKZBKQ.js → upgrade-A4CBZ3A5.js} +2 -2
- package/dist-cli/chunks/upload-3UDJ4OHD.js +2 -0
- package/dist-cli/chunks/{version-CKVITOE4.js → version-ONYEMBRD.js} +2 -2
- package/dist-cli/chunks/{web-NZ6X3775.js → web-EYRW3MVM.js} +2 -2
- package/dist-cli/chunks/{what-happened-C22PRVY2.js → what-happened-H4ZLTNBG.js} +2 -2
- package/dist-cli/chunks/{whoami-ILT2PJHK.js → whoami-U63F2I7B.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +18 -5
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/menu.cjs +468 -0
- package/dist-lib/menu.mjs +434 -0
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +19 -6
- package/dist-lib/vite.cjs +1 -1
- package/package.json +7 -1
- package/src/bridge-constants.ts +21 -4
- package/src/menu.ts +578 -0
- package/dist-cli/chunks/auto-bootstrap-COJBYU4X.js +0 -2
- package/dist-cli/chunks/beta-3KCKUADE.js +0 -2
- package/dist-cli/chunks/chunk-BH3U25T4.js +0 -1
- package/dist-cli/chunks/chunk-OQWKR3A5.js +0 -2
- package/dist-cli/chunks/chunk-PUYHI5PX.js +0 -1
- package/dist-cli/chunks/chunk-QJT4LINK.js +0 -1
- package/dist-cli/chunks/cli-version-XHYPGWVW.js +0 -2
- package/dist-cli/chunks/drivers-MBE4KVMK.js +0 -2
- package/dist-cli/chunks/flow-UQX7RP42.js +0 -2
- package/dist-cli/chunks/help-EWU4IV5Y.js +0 -2
- package/dist-cli/chunks/install-NNYE7LQ7.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-MQJP3RHL.js +0 -2
- package/dist-cli/chunks/runtime-NQXJVL2M.js +0 -2
- package/dist-cli/chunks/setup-repo-OXIAB6PS.js +0 -2
- package/dist-cli/chunks/store-NAABILLN.js +0 -2
- package/dist-cli/chunks/telemetry-FEMV2Q4T.js +0 -2
- package/dist-cli/chunks/upload-IQU5LLDG.js +0 -2
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
/*! sootsim v0.1.155 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/menu.ts
|
|
23
|
+
var menu_exports = {};
|
|
24
|
+
__export(menu_exports, {
|
|
25
|
+
SOOTSIM_ENGINE_EVENT_NAME: () => SOOTSIM_ENGINE_EVENT_NAME,
|
|
26
|
+
SOOTSIM_SHELL_COMMAND_NAME: () => SOOTSIM_SHELL_COMMAND_NAME,
|
|
27
|
+
buildSootSimDeviceChoiceDefs: () => buildSootSimDeviceChoiceDefs,
|
|
28
|
+
buildSootSimMenuDefs: () => buildSootSimMenuDefs,
|
|
29
|
+
formatAccelerator: () => formatAccelerator,
|
|
30
|
+
getMenuShortcutEntries: () => getMenuShortcutEntries,
|
|
31
|
+
getMenuShortcutEntriesFromDefs: () => getMenuShortcutEntriesFromDefs,
|
|
32
|
+
getShortcutDocSections: () => getShortcutDocSections,
|
|
33
|
+
getShortcutDocSectionsFromDefs: () => getShortcutDocSectionsFromDefs,
|
|
34
|
+
matchesAccelerator: () => matchesAccelerator
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(menu_exports);
|
|
37
|
+
var SOOTSIM_ENGINE_EVENT_NAME = "sootsim:engine-event";
|
|
38
|
+
var SOOTSIM_SHELL_COMMAND_NAME = "sootsim:shell-command";
|
|
39
|
+
function buildSootSimMenuDefs(state, deviceChoices) {
|
|
40
|
+
return [
|
|
41
|
+
appMenu(),
|
|
42
|
+
fileMenu(state, deviceChoices),
|
|
43
|
+
editMenu(),
|
|
44
|
+
deviceMenu(state, deviceChoices),
|
|
45
|
+
debugMenu(),
|
|
46
|
+
windowMenu(state),
|
|
47
|
+
helpMenu()
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
function appMenu() {
|
|
51
|
+
return {
|
|
52
|
+
label: "SootSim",
|
|
53
|
+
brand: true,
|
|
54
|
+
items: [
|
|
55
|
+
{ label: "About SootSim", action: "about" },
|
|
56
|
+
{ type: "separator" },
|
|
57
|
+
{
|
|
58
|
+
label: "Preferences...",
|
|
59
|
+
accelerator: "CmdOrCtrl+,",
|
|
60
|
+
action: "preferences",
|
|
61
|
+
browserAccelerator: true,
|
|
62
|
+
shortcutLabel: "settings",
|
|
63
|
+
showInShortcutDocs: true
|
|
64
|
+
},
|
|
65
|
+
{ type: "separator" },
|
|
66
|
+
{
|
|
67
|
+
label: "Hide SootSim",
|
|
68
|
+
accelerator: "CmdOrCtrl+H",
|
|
69
|
+
action: "hide",
|
|
70
|
+
hiddenIn: "browser"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: "Hide Others",
|
|
74
|
+
accelerator: "CmdOrCtrl+Alt+H",
|
|
75
|
+
action: "hide-others",
|
|
76
|
+
hiddenIn: "browser"
|
|
77
|
+
},
|
|
78
|
+
{ label: "Show All", action: "unhide", hiddenIn: "browser" },
|
|
79
|
+
{ type: "separator" },
|
|
80
|
+
{
|
|
81
|
+
label: "Quit SootSim",
|
|
82
|
+
accelerator: "CmdOrCtrl+Q",
|
|
83
|
+
action: "quit",
|
|
84
|
+
hiddenIn: "browser"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function fileMenu(state, deviceChoices) {
|
|
90
|
+
return {
|
|
91
|
+
label: "File",
|
|
92
|
+
notMinimal: true,
|
|
93
|
+
items: [
|
|
94
|
+
{ label: "New Window", accelerator: "CmdOrCtrl+N", action: "new-window" },
|
|
95
|
+
{
|
|
96
|
+
label: "New Simulator",
|
|
97
|
+
hiddenIn: "browser",
|
|
98
|
+
items: buildSootSimDeviceChoiceDefs(state.currentDevice, deviceChoices, {
|
|
99
|
+
action: "new-simulator"
|
|
100
|
+
})
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: "Close Window",
|
|
104
|
+
accelerator: "CmdOrCtrl+W",
|
|
105
|
+
action: "close-window",
|
|
106
|
+
hiddenIn: "browser"
|
|
107
|
+
},
|
|
108
|
+
{ type: "separator" },
|
|
109
|
+
{ label: "Save Screen", accelerator: "CmdOrCtrl+S", action: "save-screen" },
|
|
110
|
+
{ label: "Copy Screen", accelerator: "CmdOrCtrl+Alt+C", action: "copy-screen" },
|
|
111
|
+
{ type: "separator" },
|
|
112
|
+
{
|
|
113
|
+
label: "Record",
|
|
114
|
+
accelerator: "Ctrl+CmdOrCtrl+R",
|
|
115
|
+
action: "toggle-recording",
|
|
116
|
+
browserAccelerator: true,
|
|
117
|
+
shortcutLabel: "start/stop recording",
|
|
118
|
+
showInShortcutDocs: true
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function editMenu() {
|
|
124
|
+
return {
|
|
125
|
+
label: "Edit",
|
|
126
|
+
hiddenIn: "browser",
|
|
127
|
+
items: [
|
|
128
|
+
{ label: "Undo", accelerator: "CmdOrCtrl+Z", action: "undo" },
|
|
129
|
+
{ label: "Redo", accelerator: "CmdOrCtrl+Shift+Z", action: "redo" },
|
|
130
|
+
{ type: "separator" },
|
|
131
|
+
{ label: "Cut", accelerator: "CmdOrCtrl+X", action: "cut" },
|
|
132
|
+
{ label: "Copy", accelerator: "CmdOrCtrl+C", action: "copy" },
|
|
133
|
+
{ label: "Paste", accelerator: "CmdOrCtrl+V", action: "paste" },
|
|
134
|
+
{ label: "Select All", accelerator: "CmdOrCtrl+A", action: "select-all" }
|
|
135
|
+
]
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function deviceMenu(state, deviceChoices) {
|
|
139
|
+
return {
|
|
140
|
+
label: "Device",
|
|
141
|
+
items: [
|
|
142
|
+
{ label: "Restart", accelerator: "CmdOrCtrl+R", action: "reload" },
|
|
143
|
+
{ label: "Erase All Content and Settings...", action: "erase-all" },
|
|
144
|
+
{ type: "separator" },
|
|
145
|
+
{
|
|
146
|
+
label: "Home",
|
|
147
|
+
accelerator: "Shift+CmdOrCtrl+H",
|
|
148
|
+
action: "home",
|
|
149
|
+
browserAccelerator: true,
|
|
150
|
+
shortcutLabel: "go home",
|
|
151
|
+
showInShortcutDocs: true
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: "Lock",
|
|
155
|
+
accelerator: "CmdOrCtrl+L",
|
|
156
|
+
action: "lock",
|
|
157
|
+
shortcutLabel: "lock / unlock",
|
|
158
|
+
showInShortcutDocs: true
|
|
159
|
+
},
|
|
160
|
+
{ label: "Shake", accelerator: "Ctrl+CmdOrCtrl+Z", action: "shake" },
|
|
161
|
+
{
|
|
162
|
+
label: "App Switcher",
|
|
163
|
+
accelerator: "Ctrl+Shift+CmdOrCtrl+H",
|
|
164
|
+
action: "app-switcher",
|
|
165
|
+
browserAccelerator: true,
|
|
166
|
+
shortcutLabel: "app switcher",
|
|
167
|
+
showInShortcutDocs: true
|
|
168
|
+
},
|
|
169
|
+
{ type: "separator" },
|
|
170
|
+
{ label: "Trigger Screenshot", action: "screenshot" },
|
|
171
|
+
{ type: "separator" },
|
|
172
|
+
...buildSootSimDeviceChoiceDefs(state.currentDevice, deviceChoices, {
|
|
173
|
+
action: "switch-device"
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function debugMenu() {
|
|
179
|
+
return {
|
|
180
|
+
label: "Debug",
|
|
181
|
+
items: [
|
|
182
|
+
{
|
|
183
|
+
label: "Toggle Devtools",
|
|
184
|
+
accelerator: "Alt+I",
|
|
185
|
+
action: "toggle-devtools",
|
|
186
|
+
browserAccelerator: true,
|
|
187
|
+
showInShortcutDocs: true
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
label: "Inspect",
|
|
191
|
+
accelerator: "CmdOrCtrl+I",
|
|
192
|
+
action: "toggle-inspect",
|
|
193
|
+
browserAccelerator: true
|
|
194
|
+
},
|
|
195
|
+
{ type: "separator" },
|
|
196
|
+
{
|
|
197
|
+
label: "Open Chrome Devtools",
|
|
198
|
+
accelerator: "CmdOrCtrl+Alt+I",
|
|
199
|
+
action: "open-devtools",
|
|
200
|
+
hiddenIn: "browser",
|
|
201
|
+
shortcutLabel: "developer tools",
|
|
202
|
+
showInShortcutDocs: true
|
|
203
|
+
},
|
|
204
|
+
{ type: "separator" },
|
|
205
|
+
{
|
|
206
|
+
label: "Clear Cache and Reload",
|
|
207
|
+
accelerator: "CmdOrCtrl+Shift+R",
|
|
208
|
+
action: "clear-cache"
|
|
209
|
+
},
|
|
210
|
+
{ label: "Clear Local Storage", action: "clear-localstorage" },
|
|
211
|
+
{ label: "Clear IndexedDB", action: "clear-indexeddb" },
|
|
212
|
+
{ label: "Clear Service Workers", action: "clear-serviceworkers" },
|
|
213
|
+
{ type: "separator" },
|
|
214
|
+
{ label: "Open User Data Folder", action: "open-userdata", hiddenIn: "browser" }
|
|
215
|
+
]
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function windowMenu(state) {
|
|
219
|
+
return {
|
|
220
|
+
label: "Window",
|
|
221
|
+
items: [
|
|
222
|
+
{
|
|
223
|
+
label: "Minimize",
|
|
224
|
+
accelerator: "CmdOrCtrl+M",
|
|
225
|
+
action: "minimize",
|
|
226
|
+
hiddenIn: "browser"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
label: "Close",
|
|
230
|
+
accelerator: "CmdOrCtrl+W",
|
|
231
|
+
action: "close-window",
|
|
232
|
+
hiddenIn: "browser"
|
|
233
|
+
},
|
|
234
|
+
{ type: "separator" },
|
|
235
|
+
{
|
|
236
|
+
label: "Toggle Appearance",
|
|
237
|
+
accelerator: "Shift+CmdOrCtrl+A",
|
|
238
|
+
action: "toggle-appearance",
|
|
239
|
+
browserAccelerator: true,
|
|
240
|
+
shortcutLabel: "toggle appearance",
|
|
241
|
+
showInShortcutDocs: true
|
|
242
|
+
},
|
|
243
|
+
{ type: "separator" },
|
|
244
|
+
{
|
|
245
|
+
label: "Show Device Bezels",
|
|
246
|
+
type: "checkbox",
|
|
247
|
+
checked: state.showBezels,
|
|
248
|
+
action: "toggle-bezels"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
label: "Show Top Bar",
|
|
252
|
+
type: "checkbox",
|
|
253
|
+
checked: state.showTopBar,
|
|
254
|
+
enabled: state.showBezels,
|
|
255
|
+
action: "toggle-topbar"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
label: "Screenshot",
|
|
259
|
+
type: "checkbox",
|
|
260
|
+
checked: state.screenshotMode,
|
|
261
|
+
action: "toggle-screenshot-mode",
|
|
262
|
+
hiddenIn: "electron"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
label: "3D",
|
|
266
|
+
type: "checkbox",
|
|
267
|
+
checked: state.threeMode,
|
|
268
|
+
action: "toggle-three-mode",
|
|
269
|
+
hiddenIn: "electron"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
label: "Stay On Top",
|
|
273
|
+
type: "checkbox",
|
|
274
|
+
checked: state.stayOnTop,
|
|
275
|
+
action: "toggle-stay-on-top",
|
|
276
|
+
hiddenIn: "browser"
|
|
277
|
+
},
|
|
278
|
+
{ type: "separator" },
|
|
279
|
+
{
|
|
280
|
+
label: "Physical Size",
|
|
281
|
+
accelerator: "CmdOrCtrl+1",
|
|
282
|
+
type: "radio",
|
|
283
|
+
checked: state.scaleMode === "physical",
|
|
284
|
+
action: "scale-physical"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
label: "Point Accurate",
|
|
288
|
+
accelerator: "CmdOrCtrl+2",
|
|
289
|
+
type: "radio",
|
|
290
|
+
checked: state.scaleMode === "point",
|
|
291
|
+
action: "scale-point"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: "Pixel Accurate",
|
|
295
|
+
accelerator: "CmdOrCtrl+3",
|
|
296
|
+
type: "radio",
|
|
297
|
+
checked: state.scaleMode === "pixel",
|
|
298
|
+
action: "scale-pixel"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
label: "Fit Screen",
|
|
302
|
+
accelerator: "CmdOrCtrl+0",
|
|
303
|
+
type: "radio",
|
|
304
|
+
checked: state.scaleMode === "fit",
|
|
305
|
+
action: "scale-fit"
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
function helpMenu() {
|
|
311
|
+
return {
|
|
312
|
+
label: "Help",
|
|
313
|
+
notMinimal: true,
|
|
314
|
+
items: [
|
|
315
|
+
{ label: "sootsim Website", action: "open-website" },
|
|
316
|
+
{
|
|
317
|
+
label: "Send Feedback...",
|
|
318
|
+
accelerator: "CmdOrCtrl+Shift+I",
|
|
319
|
+
action: "open-devtools-report",
|
|
320
|
+
showInShortcutDocs: true
|
|
321
|
+
},
|
|
322
|
+
{ label: "Show Onboarding", action: "open-devtools-onboard" }
|
|
323
|
+
]
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function buildSootSimDeviceChoiceDefs(currentDevice, deviceChoices, options) {
|
|
327
|
+
const items = [];
|
|
328
|
+
let lastPlatform = "";
|
|
329
|
+
const isStateful = options.action === "switch-device";
|
|
330
|
+
for (const choice of deviceChoices) {
|
|
331
|
+
if (lastPlatform && choice.platform !== lastPlatform) items.push({ type: "separator" });
|
|
332
|
+
lastPlatform = choice.platform;
|
|
333
|
+
if (isStateful) {
|
|
334
|
+
items.push({
|
|
335
|
+
label: choice.label,
|
|
336
|
+
type: "radio",
|
|
337
|
+
checked: choice.model === currentDevice,
|
|
338
|
+
action: options.action,
|
|
339
|
+
actionPayload: choice.model
|
|
340
|
+
});
|
|
341
|
+
} else {
|
|
342
|
+
items.push({
|
|
343
|
+
label: choice.label,
|
|
344
|
+
action: options.action,
|
|
345
|
+
actionPayload: choice.model
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return items;
|
|
350
|
+
}
|
|
351
|
+
function shouldIncludeItemForPlatform(item, platform) {
|
|
352
|
+
if (item.hiddenIn === platform) return false;
|
|
353
|
+
if (!item.accelerator || !item.action) return false;
|
|
354
|
+
if (platform === "browser") return item.browserAccelerator === true;
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
function shouldIncludeItemInDocs(item, platform) {
|
|
358
|
+
if (!item.showInShortcutDocs) return false;
|
|
359
|
+
if (platform === "browser" && !item.browserAccelerator) return false;
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
function collectMenuShortcutsFromDefs(menus, platform, includeItem) {
|
|
363
|
+
const entries = [];
|
|
364
|
+
const visit = (menuLabel, items) => {
|
|
365
|
+
for (const item of items) {
|
|
366
|
+
if (item.type === "separator") continue;
|
|
367
|
+
if (item.items?.length) visit(menuLabel, item.items);
|
|
368
|
+
if (!includeItem(item, platform)) continue;
|
|
369
|
+
const { accelerator, action } = item;
|
|
370
|
+
if (!accelerator || !action) continue;
|
|
371
|
+
entries.push({
|
|
372
|
+
menuLabel,
|
|
373
|
+
label: item.shortcutLabel ?? item.label,
|
|
374
|
+
accelerator,
|
|
375
|
+
action,
|
|
376
|
+
actionPayload: item.actionPayload
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
for (const menu of menus) {
|
|
381
|
+
if (menu.hiddenIn === platform) continue;
|
|
382
|
+
visit(menu.label, menu.items);
|
|
383
|
+
}
|
|
384
|
+
return entries;
|
|
385
|
+
}
|
|
386
|
+
function getMenuShortcutEntriesFromDefs(menus, platform) {
|
|
387
|
+
return collectMenuShortcutsFromDefs(menus, platform, shouldIncludeItemForPlatform);
|
|
388
|
+
}
|
|
389
|
+
function getMenuShortcutEntries(state, deviceChoices, platform) {
|
|
390
|
+
return getMenuShortcutEntriesFromDefs(
|
|
391
|
+
buildSootSimMenuDefs(state, deviceChoices),
|
|
392
|
+
platform
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
function getShortcutDocSections(state, deviceChoices, platform) {
|
|
396
|
+
return getShortcutDocSectionsFromDefs(
|
|
397
|
+
buildSootSimMenuDefs(state, deviceChoices),
|
|
398
|
+
platform
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
function getShortcutDocSectionsFromDefs(menus, platform) {
|
|
402
|
+
const sections = [];
|
|
403
|
+
const byMenu = /* @__PURE__ */ new Map();
|
|
404
|
+
for (const entry of collectMenuShortcutsFromDefs(
|
|
405
|
+
menus,
|
|
406
|
+
platform,
|
|
407
|
+
shouldIncludeItemInDocs
|
|
408
|
+
)) {
|
|
409
|
+
const items = byMenu.get(entry.menuLabel) ?? [];
|
|
410
|
+
items.push({
|
|
411
|
+
keys: formatAccelerator(entry.accelerator),
|
|
412
|
+
label: entry.label
|
|
413
|
+
});
|
|
414
|
+
byMenu.set(entry.menuLabel, items);
|
|
415
|
+
}
|
|
416
|
+
for (const [title, entries] of byMenu) {
|
|
417
|
+
sections.push({
|
|
418
|
+
title: title.toLowerCase(),
|
|
419
|
+
entries
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
return sections;
|
|
423
|
+
}
|
|
424
|
+
function formatAccelerator(accel) {
|
|
425
|
+
return accel.replace(/CmdOrCtrl\+/g, "\u2318").replace(/Ctrl\+/g, "\u2303").replace(/Alt\+/g, "\u2325").replace(/Shift\+/g, "\u21E7").replace(/Left/g, "\u2190").replace(/Right/g, "\u2192").replace(/Up/g, "\u2191").replace(/Down/g, "\u2193");
|
|
426
|
+
}
|
|
427
|
+
var ARROW_KEYS = {
|
|
428
|
+
Left: "arrowleft",
|
|
429
|
+
Right: "arrowright",
|
|
430
|
+
Up: "arrowup",
|
|
431
|
+
Down: "arrowdown"
|
|
432
|
+
};
|
|
433
|
+
function normalizeAcceleratorKey(key) {
|
|
434
|
+
return ARROW_KEYS[key] ?? key.toLowerCase();
|
|
435
|
+
}
|
|
436
|
+
function normalizeEventKey(key) {
|
|
437
|
+
return key.toLowerCase();
|
|
438
|
+
}
|
|
439
|
+
function matchesAccelerator(event, accelerator) {
|
|
440
|
+
const tokens = accelerator.split("+");
|
|
441
|
+
const keyToken = tokens[tokens.length - 1];
|
|
442
|
+
const wantsCmdOrCtrl = tokens.includes("CmdOrCtrl");
|
|
443
|
+
const wantsCtrl = tokens.includes("Ctrl");
|
|
444
|
+
const wantsAlt = tokens.includes("Alt");
|
|
445
|
+
const wantsShift = tokens.includes("Shift");
|
|
446
|
+
if (!keyToken) return false;
|
|
447
|
+
if (event.altKey !== wantsAlt) return false;
|
|
448
|
+
if (event.shiftKey !== wantsShift) return false;
|
|
449
|
+
const hasCmdOrCtrl = event.metaKey || event.ctrlKey;
|
|
450
|
+
if (wantsCmdOrCtrl && !hasCmdOrCtrl) return false;
|
|
451
|
+
if (!wantsCmdOrCtrl && event.metaKey) return false;
|
|
452
|
+
if (wantsCtrl && !event.ctrlKey) return false;
|
|
453
|
+
if (!wantsCtrl && !wantsCmdOrCtrl && event.ctrlKey) return false;
|
|
454
|
+
return normalizeEventKey(event.key) === normalizeAcceleratorKey(keyToken);
|
|
455
|
+
}
|
|
456
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
457
|
+
0 && (module.exports = {
|
|
458
|
+
SOOTSIM_ENGINE_EVENT_NAME,
|
|
459
|
+
SOOTSIM_SHELL_COMMAND_NAME,
|
|
460
|
+
buildSootSimDeviceChoiceDefs,
|
|
461
|
+
buildSootSimMenuDefs,
|
|
462
|
+
formatAccelerator,
|
|
463
|
+
getMenuShortcutEntries,
|
|
464
|
+
getMenuShortcutEntriesFromDefs,
|
|
465
|
+
getShortcutDocSections,
|
|
466
|
+
getShortcutDocSectionsFromDefs,
|
|
467
|
+
matchesAccelerator
|
|
468
|
+
});
|