@mobilewright/inspector 0.0.60 → 0.0.62
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/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/device-manager.d.ts +24 -9
- package/dist/lib/device-manager.d.ts.map +1 -1
- package/dist/lib/device-manager.js +95 -14
- package/dist/lib/device-manager.js.map +1 -1
- package/dist/lib/inspect-screen.d.ts +48 -0
- package/dist/lib/inspect-screen.d.ts.map +1 -0
- package/dist/lib/inspect-screen.js +105 -0
- package/dist/lib/inspect-screen.js.map +1 -0
- package/dist/lib/locator-derivation.d.ts +17 -2
- package/dist/lib/locator-derivation.d.ts.map +1 -1
- package/dist/lib/locator-derivation.js +26 -7
- package/dist/lib/locator-derivation.js.map +1 -1
- package/dist/lib/timeout.d.ts +3 -0
- package/dist/lib/timeout.d.ts.map +1 -0
- package/dist/lib/timeout.js +9 -0
- package/dist/lib/timeout.js.map +1 -0
- package/dist/routes/device-actions.d.ts +7 -0
- package/dist/routes/device-actions.d.ts.map +1 -0
- package/dist/routes/device-actions.js +105 -0
- package/dist/routes/device-actions.js.map +1 -0
- package/dist/routes/devices.d.ts +1 -1
- package/dist/routes/devices.d.ts.map +1 -1
- package/dist/routes/devices.js +10 -11
- package/dist/routes/devices.js.map +1 -1
- package/dist/routes/inspect.d.ts.map +1 -1
- package/dist/routes/inspect.js +22 -92
- package/dist/routes/inspect.js.map +1 -1
- package/package.json +3 -3
- package/public/codegen.html +161 -0
- package/public/css/app.css +337 -2
- package/public/fonts/codicon-LICENSE.txt +21 -0
- package/public/fonts/codicon.ttf +0 -0
- package/public/index.html +3 -2
- package/public/js/app.js +203 -55
- package/public/js/codegen.js +425 -0
- package/public/js/inspect.js +7 -0
- package/public/js/view-tree.js +182 -0
- package/public/logo.png +0 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Mobilewright Codegen</title>
|
|
6
|
+
<link rel="stylesheet" href="/css/app.css" />
|
|
7
|
+
</head>
|
|
8
|
+
<body class="codegen">
|
|
9
|
+
<header>
|
|
10
|
+
<h1><img src="/logo.png" alt="" width="22" height="18" />Mobilewright Codegen</h1>
|
|
11
|
+
<div id="device-picker">
|
|
12
|
+
<select id="device-select" aria-label="Device">
|
|
13
|
+
<option value="">No devices found</option>
|
|
14
|
+
</select>
|
|
15
|
+
</div>
|
|
16
|
+
<div id="theme-controls">
|
|
17
|
+
<label for="theme-select">Theme</label>
|
|
18
|
+
<select id="theme-select">
|
|
19
|
+
<option value="void">Void</option>
|
|
20
|
+
<option value="aurora">Aurora</option>
|
|
21
|
+
<option value="crimson">Crimson</option>
|
|
22
|
+
<option value="arctic">Arctic</option>
|
|
23
|
+
<option value="synthwave">Synthwave</option>
|
|
24
|
+
</select>
|
|
25
|
+
</div>
|
|
26
|
+
<div id="status-bar" aria-live="polite"></div>
|
|
27
|
+
</header>
|
|
28
|
+
|
|
29
|
+
<main>
|
|
30
|
+
<section id="screenshot-pane">
|
|
31
|
+
<div id="device-toolbar" role="toolbar" aria-label="Device buttons">
|
|
32
|
+
<button class="tool-btn device-btn" data-button="HOME" title="Home" aria-label="Home" disabled>
|
|
33
|
+
<span class="codicon codicon-home" aria-hidden="true"></span>
|
|
34
|
+
</button>
|
|
35
|
+
<button class="tool-btn device-btn" data-button="APP_SWITCH" data-android-only title="App switch" aria-label="App switch" disabled>
|
|
36
|
+
<span class="codicon codicon-multiple-windows" aria-hidden="true"></span>
|
|
37
|
+
</button>
|
|
38
|
+
<button class="tool-btn device-btn" data-button="BACK" data-android-only title="Back" aria-label="Back" disabled>
|
|
39
|
+
<span class="codicon codicon-arrow-left" aria-hidden="true"></span>
|
|
40
|
+
</button>
|
|
41
|
+
<button id="geo-btn" class="tool-btn device-btn" popovertarget="geo-popover" title="Set location" aria-label="Set location" disabled>
|
|
42
|
+
<span class="codicon codicon-location" aria-hidden="true"></span>
|
|
43
|
+
</button>
|
|
44
|
+
<button id="url-btn" class="tool-btn device-btn" popovertarget="url-popover" title="Open URL" aria-label="Open URL" disabled>
|
|
45
|
+
<span class="codicon codicon-link" aria-hidden="true"></span>
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
<form id="url-popover" class="action-popover wide-popover" popover aria-labelledby="url-popover-title">
|
|
49
|
+
<div class="popover-header">
|
|
50
|
+
<h2 id="url-popover-title">Open URL</h2>
|
|
51
|
+
<button type="button" class="popover-close" popovertarget="url-popover" popovertargetaction="hide" aria-label="Close">×</button>
|
|
52
|
+
</div>
|
|
53
|
+
<p class="popover-hint">Opens a web link or deep link on the device and records <code>device.openUrl()</code>.</p>
|
|
54
|
+
<input name="url" type="text" autofocus aria-label="URL" placeholder="https://example.com or myapp://path" required />
|
|
55
|
+
<div class="popover-actions">
|
|
56
|
+
<button type="submit" class="tool-btn popover-submit-btn">Open</button>
|
|
57
|
+
</div>
|
|
58
|
+
</form>
|
|
59
|
+
<form id="fill-popover" class="action-popover wide-popover" popover aria-labelledby="fill-popover-title">
|
|
60
|
+
<div class="popover-header">
|
|
61
|
+
<h2 id="fill-popover-title">Fill text</h2>
|
|
62
|
+
<button type="button" class="popover-close" popovertarget="fill-popover" popovertargetaction="hide" aria-label="Close">×</button>
|
|
63
|
+
</div>
|
|
64
|
+
<p class="popover-hint">Taps the selected element, clears it and types this text. Records <code>locator.fill()</code>.</p>
|
|
65
|
+
<input name="text" type="text" autofocus aria-label="Text" placeholder="Text to type" />
|
|
66
|
+
<div class="popover-actions">
|
|
67
|
+
<button type="submit" class="tool-btn popover-submit-btn">Fill</button>
|
|
68
|
+
</div>
|
|
69
|
+
</form>
|
|
70
|
+
<form id="geo-popover" class="action-popover wide-popover" popover aria-labelledby="geo-popover-title">
|
|
71
|
+
<div class="popover-header">
|
|
72
|
+
<h2 id="geo-popover-title">Set location</h2>
|
|
73
|
+
<button type="button" class="popover-close" popovertarget="geo-popover" popovertargetaction="hide" aria-label="Close">×</button>
|
|
74
|
+
</div>
|
|
75
|
+
<p class="popover-hint">Moves the device's GPS to these coordinates and records <code>device.setGeolocation()</code>.</p>
|
|
76
|
+
<div class="popover-fields">
|
|
77
|
+
<label>Latitude <input name="latitude" autofocus type="number" step="any" min="-90" max="90" placeholder="-17.833" required /></label>
|
|
78
|
+
<label>Longitude <input name="longitude" type="number" step="any" min="-180" max="180" placeholder="177.947" required /></label>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="popover-actions">
|
|
81
|
+
<button type="button" id="geo-reset-btn" class="tool-btn">Reset location</button>
|
|
82
|
+
<button type="submit" class="tool-btn popover-submit-btn">Set</button>
|
|
83
|
+
</div>
|
|
84
|
+
</form>
|
|
85
|
+
<div id="screenshot-container">
|
|
86
|
+
<div id="no-device-msg">
|
|
87
|
+
<svg class="placeholder-icon" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
88
|
+
<rect x="14" y="4" width="36" height="56" rx="6" stroke="currentColor" stroke-width="2.5"/>
|
|
89
|
+
<rect x="20" y="10" width="24" height="36" rx="2" stroke="currentColor" stroke-width="1.5" opacity="0.4"/>
|
|
90
|
+
<circle cx="32" cy="54" r="2.5" fill="currentColor" opacity="0.5"/>
|
|
91
|
+
<line x1="28" y1="7" x2="36" y2="7" stroke="currentColor" stroke-width="2" stroke-linecap="round" opacity="0.4"/>
|
|
92
|
+
</svg>
|
|
93
|
+
<p class="placeholder-title" id="placeholder-title">Select a device</p>
|
|
94
|
+
<p class="placeholder-sub" id="placeholder-sub">Pick a connected device or simulator above</p>
|
|
95
|
+
</div>
|
|
96
|
+
<img id="screenshot-img" alt="Device screenshot" hidden />
|
|
97
|
+
<svg id="highlight-overlay" hidden></svg>
|
|
98
|
+
</div>
|
|
99
|
+
</section>
|
|
100
|
+
<div class="splitter" id="screenshot-splitter" role="separator" aria-orientation="vertical" aria-label="Resize device pane" tabindex="0"></div>
|
|
101
|
+
<section id="editor-pane">
|
|
102
|
+
<div id="recorder-toolbar" role="toolbar" aria-label="Recorder">
|
|
103
|
+
<button id="record-btn" class="tool-btn" aria-pressed="true" title="Stop recording">
|
|
104
|
+
<span class="codicon codicon-circle-large-filled" aria-hidden="true"></span>Record
|
|
105
|
+
</button>
|
|
106
|
+
<span class="tool-separator"></span>
|
|
107
|
+
<button id="assert-text-btn" class="tool-btn assert-btn" data-mode="assertText" title="Assert text" aria-label="Assert text" aria-pressed="false">
|
|
108
|
+
<span class="codicon codicon-whole-word" aria-hidden="true"></span>
|
|
109
|
+
</button>
|
|
110
|
+
<button id="assert-value-btn" class="tool-btn assert-btn" data-mode="assertValue" title="Assert value" aria-label="Assert value" aria-pressed="false">
|
|
111
|
+
<span class="codicon codicon-symbol-constant" aria-hidden="true"></span>
|
|
112
|
+
</button>
|
|
113
|
+
<button class="tool-btn" title="Assert snapshot (coming soon)" aria-label="Assert snapshot" disabled>
|
|
114
|
+
<span class="codicon codicon-gist" aria-hidden="true"></span>
|
|
115
|
+
</button>
|
|
116
|
+
<span class="tool-separator"></span>
|
|
117
|
+
<button id="tree-btn" class="tool-btn" title="View tree" aria-label="View tree" aria-pressed="false" aria-controls="tree-pane">
|
|
118
|
+
<span class="codicon codicon-list-tree" aria-hidden="true"></span>
|
|
119
|
+
</button>
|
|
120
|
+
<button id="copy-btn" class="tool-btn" title="Copy test" aria-label="Copy test">
|
|
121
|
+
<span class="codicon codicon-files" aria-hidden="true"></span>
|
|
122
|
+
</button>
|
|
123
|
+
<span class="tool-separator"></span>
|
|
124
|
+
<label id="target-picker">Target:
|
|
125
|
+
<select id="target-select">
|
|
126
|
+
<option value="test">Test Runner</option>
|
|
127
|
+
<option value="library">Library</option>
|
|
128
|
+
</select>
|
|
129
|
+
</label>
|
|
130
|
+
</div>
|
|
131
|
+
<textarea id="code-editor" spellcheck="false" aria-label="Generated test code"></textarea>
|
|
132
|
+
</section>
|
|
133
|
+
<div class="splitter" id="tree-splitter" role="separator" aria-orientation="vertical" aria-label="Resize view tree" tabindex="0"></div>
|
|
134
|
+
<section id="tree-pane" aria-label="View tree" hidden>
|
|
135
|
+
<div id="view-tree"></div>
|
|
136
|
+
<div class="splitter horizontal" id="detail-splitter" role="separator" aria-orientation="horizontal" aria-label="Resize element details" tabindex="0"></div>
|
|
137
|
+
<section id="detail-pane" hidden>
|
|
138
|
+
<div id="detail-header">
|
|
139
|
+
<span id="detail-type"></span>
|
|
140
|
+
<button id="detail-close" aria-label="Close detail panel">×</button>
|
|
141
|
+
</div>
|
|
142
|
+
<div id="detail-body">
|
|
143
|
+
<div id="detail-actions" role="group" aria-label="Element actions">
|
|
144
|
+
<button class="tool-btn gesture-btn" data-gesture="tap">Tap</button>
|
|
145
|
+
<button class="tool-btn gesture-btn" data-gesture="doubleTap">Double tap</button>
|
|
146
|
+
<button class="tool-btn gesture-btn" data-gesture="longPress">Long press</button>
|
|
147
|
+
<button id="fill-btn" class="tool-btn gesture-btn" popovertarget="fill-popover">Fill</button>
|
|
148
|
+
</div>
|
|
149
|
+
<div id="detail-locators"></div>
|
|
150
|
+
<div id="detail-properties"></div>
|
|
151
|
+
<div id="detail-raw" hidden></div>
|
|
152
|
+
</div>
|
|
153
|
+
</section>
|
|
154
|
+
</section>
|
|
155
|
+
</main>
|
|
156
|
+
|
|
157
|
+
<div id="error-toast" role="alert" hidden></div>
|
|
158
|
+
|
|
159
|
+
<script src="/js/codegen.js" type="module"></script>
|
|
160
|
+
</body>
|
|
161
|
+
</html>
|
package/public/css/app.css
CHANGED
|
@@ -169,6 +169,9 @@ header {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
header h1 {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: 8px;
|
|
172
175
|
font-size: 14px;
|
|
173
176
|
font-weight: 600;
|
|
174
177
|
margin: 0;
|
|
@@ -178,7 +181,8 @@ header h1 {
|
|
|
178
181
|
|
|
179
182
|
#device-picker select,
|
|
180
183
|
#auto-refresh-interval,
|
|
181
|
-
#theme-select
|
|
184
|
+
#theme-select,
|
|
185
|
+
#target-select {
|
|
182
186
|
background: var(--c-bg);
|
|
183
187
|
color: var(--c-text);
|
|
184
188
|
border: 1px solid var(--c-border);
|
|
@@ -191,7 +195,8 @@ header h1 {
|
|
|
191
195
|
|
|
192
196
|
#device-picker select:focus,
|
|
193
197
|
#auto-refresh-interval:focus,
|
|
194
|
-
#theme-select:focus
|
|
198
|
+
#theme-select:focus,
|
|
199
|
+
#target-select:focus {
|
|
195
200
|
border-color: var(--c-accent);
|
|
196
201
|
}
|
|
197
202
|
|
|
@@ -706,3 +711,333 @@ main {
|
|
|
706
711
|
border-top: 1px solid var(--c-border);
|
|
707
712
|
}
|
|
708
713
|
}
|
|
714
|
+
|
|
715
|
+
/* ---- Codegen ---- */
|
|
716
|
+
|
|
717
|
+
/* Icon font copied from Playwright (vscode codicons, MIT, see fonts/codicon-LICENSE.txt). */
|
|
718
|
+
@font-face {
|
|
719
|
+
font-family: "codicon";
|
|
720
|
+
src: url("../fonts/codicon.ttf") format("truetype");
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
.codicon {
|
|
724
|
+
font: normal normal normal 16px/1 codicon;
|
|
725
|
+
display: inline-block;
|
|
726
|
+
-webkit-font-smoothing: antialiased;
|
|
727
|
+
user-select: none;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.codicon-circle-large-filled::before { content: '\ebb4'; }
|
|
731
|
+
.codicon-whole-word::before { content: '\eb7e'; }
|
|
732
|
+
.codicon-symbol-constant::before { content: '\eb5d'; }
|
|
733
|
+
.codicon-gist::before { content: '\eafb'; }
|
|
734
|
+
.codicon-home::before { content: '\eb06'; }
|
|
735
|
+
.codicon-multiple-windows::before { content: '\eb23'; }
|
|
736
|
+
.codicon-arrow-left::before { content: '\ea9b'; }
|
|
737
|
+
.codicon-list-tree::before { content: '\eb86'; }
|
|
738
|
+
.codicon-files::before { content: '\eaf0'; }
|
|
739
|
+
.codicon-check::before { content: '\eab2'; }
|
|
740
|
+
.codicon-location::before { content: '\eb1a'; }
|
|
741
|
+
.codicon-link::before { content: '\eb15'; }
|
|
742
|
+
.codicon-chevron-down::before { content: '\eab4'; }
|
|
743
|
+
.codicon-chevron-right::before { content: '\eab6'; }
|
|
744
|
+
|
|
745
|
+
.codegen #screenshot-img { cursor: crosshair; }
|
|
746
|
+
|
|
747
|
+
.codegen #screenshot-pane {
|
|
748
|
+
flex-direction: column;
|
|
749
|
+
align-items: center;
|
|
750
|
+
justify-content: flex-start; /* keep the device buttons at the top, whatever the image height */
|
|
751
|
+
gap: 8px;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
#device-toolbar {
|
|
755
|
+
display: flex;
|
|
756
|
+
gap: 4px;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/* The image is hidden whenever a placeholder shows (no device, connecting, no screenshot yet). */
|
|
760
|
+
#screenshot-pane:has(#screenshot-img[hidden]) #device-toolbar { display: none; }
|
|
761
|
+
|
|
762
|
+
/* The element under the pointer; clicks pass through to the screenshot. */
|
|
763
|
+
.hover-rect {
|
|
764
|
+
fill: var(--c-accent);
|
|
765
|
+
fill-opacity: 0.5;
|
|
766
|
+
stroke: var(--c-accent);
|
|
767
|
+
stroke-width: 2;
|
|
768
|
+
pointer-events: none;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
#editor-pane {
|
|
772
|
+
flex: 1;
|
|
773
|
+
display: flex;
|
|
774
|
+
flex-direction: column;
|
|
775
|
+
min-width: 0;
|
|
776
|
+
background: var(--c-surface2);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
#recorder-toolbar {
|
|
780
|
+
display: flex;
|
|
781
|
+
align-items: center;
|
|
782
|
+
gap: 4px;
|
|
783
|
+
padding: 4px 8px;
|
|
784
|
+
background: var(--c-surface);
|
|
785
|
+
border-bottom: 1px solid var(--c-border);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.tool-btn {
|
|
789
|
+
display: inline-flex;
|
|
790
|
+
align-items: center;
|
|
791
|
+
gap: 6px;
|
|
792
|
+
background: none;
|
|
793
|
+
color: var(--c-text);
|
|
794
|
+
border: 1px solid transparent;
|
|
795
|
+
border-radius: 4px;
|
|
796
|
+
padding: 4px 8px;
|
|
797
|
+
font-size: 12px;
|
|
798
|
+
cursor: pointer;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.tool-btn:hover:not(:disabled) { background: var(--c-row-hover); }
|
|
802
|
+
.tool-btn:focus-visible { outline: none; border-color: var(--c-accent); }
|
|
803
|
+
.tool-btn:disabled { opacity: 0.4; cursor: default; }
|
|
804
|
+
|
|
805
|
+
#record-btn .codicon { color: var(--c-text-muted); }
|
|
806
|
+
.assert-btn[aria-pressed="true"] { background: var(--c-accent-dim); border-color: var(--c-accent); }
|
|
807
|
+
|
|
808
|
+
/* In assert modes the hover box turns the "selected" color, so it's clear a click won't tap. */
|
|
809
|
+
[data-click-mode="assertText"] .hover-rect,
|
|
810
|
+
[data-click-mode="assertValue"] .hover-rect {
|
|
811
|
+
fill: var(--c-selected);
|
|
812
|
+
stroke: var(--c-selected);
|
|
813
|
+
}
|
|
814
|
+
#record-btn[aria-pressed="true"] .codicon { color: var(--c-status-error); }
|
|
815
|
+
|
|
816
|
+
#target-picker {
|
|
817
|
+
display: flex;
|
|
818
|
+
align-items: center;
|
|
819
|
+
gap: 6px;
|
|
820
|
+
font-size: 11px;
|
|
821
|
+
color: var(--c-text-muted);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
.tool-separator {
|
|
825
|
+
width: 1px;
|
|
826
|
+
height: 16px;
|
|
827
|
+
margin: 0 4px;
|
|
828
|
+
background: var(--c-border);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
#code-editor {
|
|
832
|
+
flex: 1;
|
|
833
|
+
resize: none;
|
|
834
|
+
border: none;
|
|
835
|
+
outline: none;
|
|
836
|
+
padding: 12px 16px;
|
|
837
|
+
background: var(--c-pane-bg);
|
|
838
|
+
color: var(--c-text);
|
|
839
|
+
font: 13px/1.5 'SF Mono', Menlo, Monaco, monospace;
|
|
840
|
+
tab-size: 2;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/* ---- View tree ---- */
|
|
844
|
+
|
|
845
|
+
#tree-pane {
|
|
846
|
+
flex: 0 0 var(--tree-width, 360px);
|
|
847
|
+
min-width: 240px;
|
|
848
|
+
max-width: 60%;
|
|
849
|
+
display: flex;
|
|
850
|
+
flex-direction: column;
|
|
851
|
+
overflow: hidden;
|
|
852
|
+
background: var(--c-surface2);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
#view-tree {
|
|
856
|
+
flex: 1;
|
|
857
|
+
min-height: 0;
|
|
858
|
+
overflow: auto;
|
|
859
|
+
padding: 4px 0;
|
|
860
|
+
font: 12px/22px 'SF Mono', Menlo, Monaco, monospace;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
.tree-row {
|
|
864
|
+
display: flex;
|
|
865
|
+
align-items: center;
|
|
866
|
+
padding-right: 8px;
|
|
867
|
+
white-space: nowrap;
|
|
868
|
+
cursor: pointer;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.tree-row:hover { background: var(--c-row-hover); }
|
|
872
|
+
.tree-row.offscreen { opacity: 0.5; }
|
|
873
|
+
|
|
874
|
+
.tree-twisty {
|
|
875
|
+
flex: none;
|
|
876
|
+
width: 18px;
|
|
877
|
+
background: none;
|
|
878
|
+
border: none;
|
|
879
|
+
color: var(--c-text-muted);
|
|
880
|
+
cursor: pointer;
|
|
881
|
+
padding: 0;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.tree-type { color: var(--c-text); }
|
|
885
|
+
.tree-name { color: var(--c-text-muted); overflow: hidden; text-overflow: ellipsis; }
|
|
886
|
+
|
|
887
|
+
/* ---- Set location popover ---- */
|
|
888
|
+
|
|
889
|
+
/* Forms the codegen toolbar and element actions open to ask for input. */
|
|
890
|
+
.action-popover {
|
|
891
|
+
padding: 16px;
|
|
892
|
+
border: 1px solid var(--c-border);
|
|
893
|
+
border-radius: 8px;
|
|
894
|
+
background: var(--c-surface);
|
|
895
|
+
color: var(--c-text);
|
|
896
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.action-popover[popover]:popover-open {
|
|
900
|
+
display: flex;
|
|
901
|
+
flex-direction: column;
|
|
902
|
+
gap: 10px;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.action-popover::backdrop { background: rgba(0, 0, 0, 0.3); }
|
|
906
|
+
|
|
907
|
+
.action-popover label {
|
|
908
|
+
display: flex;
|
|
909
|
+
justify-content: space-between;
|
|
910
|
+
align-items: center;
|
|
911
|
+
gap: 12px;
|
|
912
|
+
font-size: 12px;
|
|
913
|
+
color: var(--c-text-muted);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
.action-popover input {
|
|
917
|
+
width: 140px;
|
|
918
|
+
background: var(--c-bg);
|
|
919
|
+
color: var(--c-text);
|
|
920
|
+
border: 1px solid var(--c-border);
|
|
921
|
+
border-radius: 4px;
|
|
922
|
+
padding: 4px 8px;
|
|
923
|
+
font: 12px 'SF Mono', Menlo, Monaco, monospace;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.action-popover input:focus { outline: none; border-color: var(--c-accent); }
|
|
927
|
+
|
|
928
|
+
/* URL and fill: a titled dialog with a full-width input. */
|
|
929
|
+
.wide-popover {
|
|
930
|
+
width: min(480px, calc(100vw - 32px));
|
|
931
|
+
padding: 20px;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.wide-popover input {
|
|
935
|
+
width: 100%;
|
|
936
|
+
padding: 8px 10px;
|
|
937
|
+
font-size: 13px;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
.popover-header {
|
|
941
|
+
display: flex;
|
|
942
|
+
justify-content: space-between;
|
|
943
|
+
align-items: center;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.popover-header h2 {
|
|
947
|
+
margin: 0;
|
|
948
|
+
font-size: 14px;
|
|
949
|
+
font-weight: 600;
|
|
950
|
+
color: var(--c-text-strong);
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
.popover-close {
|
|
954
|
+
background: none;
|
|
955
|
+
border: none;
|
|
956
|
+
color: var(--c-text-muted);
|
|
957
|
+
font-size: 18px;
|
|
958
|
+
line-height: 1;
|
|
959
|
+
padding: 0 4px;
|
|
960
|
+
cursor: pointer;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
.popover-close:hover { color: var(--c-text); }
|
|
964
|
+
|
|
965
|
+
.popover-hint {
|
|
966
|
+
margin: 0;
|
|
967
|
+
font-size: 12px;
|
|
968
|
+
color: var(--c-text-muted);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.popover-hint code { font-family: 'SF Mono', Menlo, Monaco, monospace; }
|
|
972
|
+
|
|
973
|
+
/* Side-by-side labeled inputs, each label stacked above its input. */
|
|
974
|
+
.popover-fields {
|
|
975
|
+
display: flex;
|
|
976
|
+
gap: 12px;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
.popover-fields label {
|
|
980
|
+
flex: 1;
|
|
981
|
+
flex-direction: column;
|
|
982
|
+
align-items: stretch;
|
|
983
|
+
gap: 4px;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
.popover-actions {
|
|
987
|
+
display: flex;
|
|
988
|
+
justify-content: space-between;
|
|
989
|
+
gap: 8px;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
.popover-submit-btn { margin-left: auto; border-color: var(--c-accent); color: var(--c-accent); }
|
|
993
|
+
|
|
994
|
+
.tree-row.selected { background: var(--c-selected-bg); }
|
|
995
|
+
|
|
996
|
+
/* Failed device actions (codegen); the status bar is overwritten by the next refresh. */
|
|
997
|
+
#error-toast {
|
|
998
|
+
position: fixed;
|
|
999
|
+
right: 16px;
|
|
1000
|
+
bottom: 16px;
|
|
1001
|
+
max-width: 420px;
|
|
1002
|
+
padding: 10px 14px;
|
|
1003
|
+
border-radius: 6px;
|
|
1004
|
+
background: var(--c-status-error);
|
|
1005
|
+
color: #fff;
|
|
1006
|
+
font-size: 12px;
|
|
1007
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
|
1008
|
+
z-index: 1000;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/* ---- Element details under the view tree (codegen) ---- */
|
|
1012
|
+
|
|
1013
|
+
#tree-pane #detail-pane {
|
|
1014
|
+
flex: 0 0 var(--detail-height, 40%);
|
|
1015
|
+
min-height: 80px;
|
|
1016
|
+
max-height: 85%;
|
|
1017
|
+
min-width: 0;
|
|
1018
|
+
max-width: none;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.splitter.horizontal {
|
|
1022
|
+
cursor: row-resize;
|
|
1023
|
+
background: linear-gradient(var(--c-border), var(--c-border)) center / 100% 1px no-repeat;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.splitter.horizontal:hover,
|
|
1027
|
+
.splitter.horizontal:focus-visible,
|
|
1028
|
+
.splitter.horizontal.dragging {
|
|
1029
|
+
background: linear-gradient(var(--c-accent), var(--c-accent)) center / 100% 3px no-repeat;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
#detail-actions {
|
|
1033
|
+
display: flex;
|
|
1034
|
+
gap: 6px;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.gesture-btn {
|
|
1038
|
+
flex: 1;
|
|
1039
|
+
justify-content: center;
|
|
1040
|
+
border-color: var(--c-border);
|
|
1041
|
+
background: var(--c-surface2);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 - present Microsoft Corporation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
Binary file
|
package/public/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</head>
|
|
8
8
|
<body>
|
|
9
9
|
<header>
|
|
10
|
-
<h1
|
|
10
|
+
<h1><img src="/logo.png" alt="" width="22" height="18" />Mobilewright Inspector</h1>
|
|
11
11
|
<div id="device-picker">
|
|
12
12
|
<select id="device-select" aria-label="Device">
|
|
13
13
|
<option value="">No devices found</option>
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
Auto-refresh
|
|
21
21
|
</label>
|
|
22
22
|
<select id="auto-refresh-interval" aria-label="Auto-refresh interval" disabled>
|
|
23
|
+
<option value="1000">1 s</option>
|
|
23
24
|
<option value="5000">5 s</option>
|
|
24
25
|
<option value="10000">10 s</option>
|
|
25
26
|
<option value="20000">20 s</option>
|
|
@@ -75,6 +76,6 @@
|
|
|
75
76
|
</section>
|
|
76
77
|
</main>
|
|
77
78
|
|
|
78
|
-
<script src="/js/
|
|
79
|
+
<script src="/js/inspect.js" type="module"></script>
|
|
79
80
|
</body>
|
|
80
81
|
</html>
|