@mobilewright/inspector 0.0.60 → 0.0.61
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 +47 -0
- package/dist/lib/inspect-screen.d.ts.map +1 -0
- package/dist/lib/inspect-screen.js +104 -0
- package/dist/lib/inspect-screen.js.map +1 -0
- package/dist/lib/locator-derivation.d.ts +15 -2
- package/dist/lib/locator-derivation.d.ts.map +1 -1
- package/dist/lib/locator-derivation.js +21 -6
- 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 +79 -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 +119 -0
- package/public/css/app.css +250 -0
- 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 +301 -0
- package/public/js/inspect.js +7 -0
- package/public/js/view-tree.js +182 -0
- package/public/logo.png +0 -0
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;
|
|
@@ -706,3 +709,250 @@ main {
|
|
|
706
709
|
border-top: 1px solid var(--c-border);
|
|
707
710
|
}
|
|
708
711
|
}
|
|
712
|
+
|
|
713
|
+
/* ---- Codegen ---- */
|
|
714
|
+
|
|
715
|
+
/* Icon font copied from Playwright (vscode codicons, MIT, see fonts/codicon-LICENSE.txt). */
|
|
716
|
+
@font-face {
|
|
717
|
+
font-family: "codicon";
|
|
718
|
+
src: url("../fonts/codicon.ttf") format("truetype");
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.codicon {
|
|
722
|
+
font: normal normal normal 16px/1 codicon;
|
|
723
|
+
display: inline-block;
|
|
724
|
+
-webkit-font-smoothing: antialiased;
|
|
725
|
+
user-select: none;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.codicon-circle-large-filled::before { content: '\ebb4'; }
|
|
729
|
+
.codicon-whole-word::before { content: '\eb7e'; }
|
|
730
|
+
.codicon-symbol-constant::before { content: '\eb5d'; }
|
|
731
|
+
.codicon-gist::before { content: '\eafb'; }
|
|
732
|
+
.codicon-home::before { content: '\eb06'; }
|
|
733
|
+
.codicon-multiple-windows::before { content: '\eb23'; }
|
|
734
|
+
.codicon-arrow-left::before { content: '\ea9b'; }
|
|
735
|
+
.codicon-list-tree::before { content: '\eb86'; }
|
|
736
|
+
.codicon-files::before { content: '\eaf0'; }
|
|
737
|
+
.codicon-check::before { content: '\eab2'; }
|
|
738
|
+
.codicon-location::before { content: '\eb1a'; }
|
|
739
|
+
.codicon-chevron-down::before { content: '\eab4'; }
|
|
740
|
+
.codicon-chevron-right::before { content: '\eab6'; }
|
|
741
|
+
|
|
742
|
+
.codegen #screenshot-img { cursor: crosshair; }
|
|
743
|
+
|
|
744
|
+
.codegen #screenshot-pane {
|
|
745
|
+
flex-direction: column;
|
|
746
|
+
align-items: center;
|
|
747
|
+
justify-content: flex-start; /* keep the device buttons at the top, whatever the image height */
|
|
748
|
+
gap: 8px;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
#device-toolbar {
|
|
752
|
+
display: flex;
|
|
753
|
+
gap: 4px;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/* The image is hidden whenever a placeholder shows (no device, connecting, no screenshot yet). */
|
|
757
|
+
#screenshot-pane:has(#screenshot-img[hidden]) #device-toolbar { display: none; }
|
|
758
|
+
|
|
759
|
+
/* The element under the pointer; clicks pass through to the screenshot. */
|
|
760
|
+
.hover-rect {
|
|
761
|
+
fill: var(--c-accent);
|
|
762
|
+
fill-opacity: 0.5;
|
|
763
|
+
stroke: var(--c-accent);
|
|
764
|
+
stroke-width: 2;
|
|
765
|
+
pointer-events: none;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
#editor-pane {
|
|
769
|
+
flex: 1;
|
|
770
|
+
display: flex;
|
|
771
|
+
flex-direction: column;
|
|
772
|
+
min-width: 0;
|
|
773
|
+
background: var(--c-surface2);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
#recorder-toolbar {
|
|
777
|
+
display: flex;
|
|
778
|
+
align-items: center;
|
|
779
|
+
gap: 4px;
|
|
780
|
+
padding: 4px 8px;
|
|
781
|
+
background: var(--c-surface);
|
|
782
|
+
border-bottom: 1px solid var(--c-border);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.tool-btn {
|
|
786
|
+
display: inline-flex;
|
|
787
|
+
align-items: center;
|
|
788
|
+
gap: 6px;
|
|
789
|
+
background: none;
|
|
790
|
+
color: var(--c-text);
|
|
791
|
+
border: 1px solid transparent;
|
|
792
|
+
border-radius: 4px;
|
|
793
|
+
padding: 4px 8px;
|
|
794
|
+
font-size: 12px;
|
|
795
|
+
cursor: pointer;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.tool-btn:hover:not(:disabled) { background: var(--c-row-hover); }
|
|
799
|
+
.tool-btn:focus-visible { outline: none; border-color: var(--c-accent); }
|
|
800
|
+
.tool-btn:disabled { opacity: 0.4; cursor: default; }
|
|
801
|
+
|
|
802
|
+
#record-btn .codicon { color: var(--c-text-muted); }
|
|
803
|
+
.assert-btn[aria-pressed="true"] { background: var(--c-accent-dim); border-color: var(--c-accent); }
|
|
804
|
+
|
|
805
|
+
/* In assert modes the hover box turns the "selected" color, so it's clear a click won't tap. */
|
|
806
|
+
[data-click-mode="assertText"] .hover-rect,
|
|
807
|
+
[data-click-mode="assertValue"] .hover-rect {
|
|
808
|
+
fill: var(--c-selected);
|
|
809
|
+
stroke: var(--c-selected);
|
|
810
|
+
}
|
|
811
|
+
#record-btn[aria-pressed="true"] .codicon { color: var(--c-status-error); }
|
|
812
|
+
|
|
813
|
+
.tool-separator {
|
|
814
|
+
width: 1px;
|
|
815
|
+
height: 16px;
|
|
816
|
+
margin: 0 4px;
|
|
817
|
+
background: var(--c-border);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
#code-editor {
|
|
821
|
+
flex: 1;
|
|
822
|
+
resize: none;
|
|
823
|
+
border: none;
|
|
824
|
+
outline: none;
|
|
825
|
+
padding: 12px 16px;
|
|
826
|
+
background: var(--c-pane-bg);
|
|
827
|
+
color: var(--c-text);
|
|
828
|
+
font: 13px/1.5 'SF Mono', Menlo, Monaco, monospace;
|
|
829
|
+
tab-size: 2;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/* ---- View tree ---- */
|
|
833
|
+
|
|
834
|
+
#tree-pane {
|
|
835
|
+
flex: 0 0 var(--tree-width, 360px);
|
|
836
|
+
min-width: 240px;
|
|
837
|
+
max-width: 60%;
|
|
838
|
+
display: flex;
|
|
839
|
+
flex-direction: column;
|
|
840
|
+
overflow: hidden;
|
|
841
|
+
background: var(--c-surface2);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
#view-tree {
|
|
845
|
+
flex: 1;
|
|
846
|
+
min-height: 0;
|
|
847
|
+
overflow: auto;
|
|
848
|
+
padding: 4px 0;
|
|
849
|
+
font: 12px/22px 'SF Mono', Menlo, Monaco, monospace;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
.tree-row {
|
|
853
|
+
display: flex;
|
|
854
|
+
align-items: center;
|
|
855
|
+
padding-right: 8px;
|
|
856
|
+
white-space: nowrap;
|
|
857
|
+
cursor: pointer;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.tree-row:hover { background: var(--c-row-hover); }
|
|
861
|
+
.tree-row.offscreen { opacity: 0.5; }
|
|
862
|
+
|
|
863
|
+
.tree-twisty {
|
|
864
|
+
flex: none;
|
|
865
|
+
width: 18px;
|
|
866
|
+
background: none;
|
|
867
|
+
border: none;
|
|
868
|
+
color: var(--c-text-muted);
|
|
869
|
+
cursor: pointer;
|
|
870
|
+
padding: 0;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.tree-type { color: var(--c-text); }
|
|
874
|
+
.tree-name { color: var(--c-text-muted); overflow: hidden; text-overflow: ellipsis; }
|
|
875
|
+
|
|
876
|
+
/* ---- Set location popover ---- */
|
|
877
|
+
|
|
878
|
+
#geo-popover {
|
|
879
|
+
padding: 16px;
|
|
880
|
+
border: 1px solid var(--c-border);
|
|
881
|
+
border-radius: 8px;
|
|
882
|
+
background: var(--c-surface);
|
|
883
|
+
color: var(--c-text);
|
|
884
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
#geo-popover[popover]:popover-open {
|
|
888
|
+
display: flex;
|
|
889
|
+
flex-direction: column;
|
|
890
|
+
gap: 10px;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
#geo-popover::backdrop { background: rgba(0, 0, 0, 0.3); }
|
|
894
|
+
|
|
895
|
+
#geo-popover label {
|
|
896
|
+
display: flex;
|
|
897
|
+
justify-content: space-between;
|
|
898
|
+
align-items: center;
|
|
899
|
+
gap: 12px;
|
|
900
|
+
font-size: 12px;
|
|
901
|
+
color: var(--c-text-muted);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
#geo-popover input {
|
|
905
|
+
width: 140px;
|
|
906
|
+
background: var(--c-bg);
|
|
907
|
+
color: var(--c-text);
|
|
908
|
+
border: 1px solid var(--c-border);
|
|
909
|
+
border-radius: 4px;
|
|
910
|
+
padding: 4px 8px;
|
|
911
|
+
font: 12px 'SF Mono', Menlo, Monaco, monospace;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
#geo-popover input:focus { outline: none; border-color: var(--c-accent); }
|
|
915
|
+
|
|
916
|
+
.geo-actions {
|
|
917
|
+
display: flex;
|
|
918
|
+
justify-content: space-between;
|
|
919
|
+
gap: 8px;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.geo-set-btn { border-color: var(--c-accent); color: var(--c-accent); }
|
|
923
|
+
|
|
924
|
+
.tree-row.selected { background: var(--c-selected-bg); }
|
|
925
|
+
|
|
926
|
+
/* ---- Element details under the view tree (codegen) ---- */
|
|
927
|
+
|
|
928
|
+
#tree-pane #detail-pane {
|
|
929
|
+
flex: 0 0 var(--detail-height, 40%);
|
|
930
|
+
min-height: 80px;
|
|
931
|
+
max-height: 85%;
|
|
932
|
+
min-width: 0;
|
|
933
|
+
max-width: none;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.splitter.horizontal {
|
|
937
|
+
cursor: row-resize;
|
|
938
|
+
background: linear-gradient(var(--c-border), var(--c-border)) center / 100% 1px no-repeat;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
.splitter.horizontal:hover,
|
|
942
|
+
.splitter.horizontal:focus-visible,
|
|
943
|
+
.splitter.horizontal.dragging {
|
|
944
|
+
background: linear-gradient(var(--c-accent), var(--c-accent)) center / 100% 3px no-repeat;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
#detail-actions {
|
|
948
|
+
display: flex;
|
|
949
|
+
gap: 6px;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
.gesture-btn {
|
|
953
|
+
flex: 1;
|
|
954
|
+
justify-content: center;
|
|
955
|
+
border-color: var(--c-border);
|
|
956
|
+
background: var(--c-surface2);
|
|
957
|
+
}
|
|
958
|
+
|
|
@@ -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>
|