@vinena/knobs 0.5.2 → 0.6.0

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +7 -6
  3. package/dist/context-amfyasb5.js +23 -0
  4. package/dist/context-svtr7vwt.js +22 -0
  5. package/dist/early.global.js +6 -6
  6. package/dist/edit/css.d.ts +59 -0
  7. package/dist/edit/html.d.ts +91 -0
  8. package/dist/edit/keep.d.ts +175 -0
  9. package/dist/edit/log.d.ts +107 -0
  10. package/dist/edit/replay.d.ts +28 -0
  11. package/dist/edit/risk.d.ts +33 -0
  12. package/dist/edit/rule.d.ts +31 -0
  13. package/dist/edit/source.d.ts +12 -0
  14. package/dist/edit/text.d.ts +66 -0
  15. package/dist/elementsview-fyc06wjt.js +3702 -0
  16. package/dist/elementsview-k6zvvcne.js +3701 -0
  17. package/dist/engine/browserdraw.d.ts +5 -0
  18. package/dist/engine/browserkit.d.ts +2 -0
  19. package/dist/engine/devices.d.ts +3 -2
  20. package/dist/engine/dock.d.ts +3 -4
  21. package/dist/engine/frame.d.ts +1 -1
  22. package/dist/engine/frames.d.ts +1 -0
  23. package/dist/engine/identity.d.ts +5 -1
  24. package/dist/engine/index.d.ts +2 -0
  25. package/dist/engine/mock.d.ts +0 -2
  26. package/dist/engine/mockdata.d.ts +4 -3
  27. package/dist/engine/mockdraw.d.ts +2 -14
  28. package/dist/engine/morphrun.d.ts +4 -0
  29. package/dist/engine/native.d.ts +31 -3
  30. package/dist/engine/notice.d.ts +1 -2
  31. package/dist/engine/style.d.ts +15 -0
  32. package/dist/engine/width.d.ts +3 -0
  33. package/dist/{framekit-w0v516w5.js → framekit-622h6w1f.js} +264 -105
  34. package/dist/{framekit-te90cjs0.js → framekit-yx612r28.js} +264 -105
  35. package/dist/index-0zp9py56.js +859 -0
  36. package/dist/{index-9re7sv56.js → index-1mstjadm.js} +126 -2167
  37. package/dist/{index-30fc6php.js → index-4a4x1bt2.js} +1 -1
  38. package/dist/index-58jdczmj.js +44 -0
  39. package/dist/index-5tv6sr74.js +23 -0
  40. package/dist/index-6bc2ztfd.js +688 -0
  41. package/dist/index-7cb4x1vj.js +1885 -0
  42. package/dist/index-a974q3aa.js +34 -0
  43. package/dist/{index-r72tz2vn.js → index-aymfvd8s.js} +1 -1
  44. package/dist/{index-trx7bxdk.js → index-aynkv7qk.js} +11 -8
  45. package/dist/{index-xjhwp5cj.js → index-dzm8ywq0.js} +504 -2362
  46. package/dist/{index-dan2kpsd.js → index-f60yax1j.js} +13 -8
  47. package/dist/index-f67wctn3.js +1858 -0
  48. package/dist/{index-agwr37gw.js → index-ftjdt358.js} +8 -171
  49. package/dist/{index-pewcdh28.js → index-gm51cthv.js} +2 -45
  50. package/dist/index-kfdzsyyw.js +1859 -0
  51. package/dist/index-t4kssacm.js +208 -0
  52. package/dist/index-v0ht9q0g.js +1518 -0
  53. package/dist/{index-sxe5079a.js → index-x59vz1xx.js} +262 -901
  54. package/dist/index-xh39jtkq.js +32 -0
  55. package/dist/index-yb7fc59g.js +718 -0
  56. package/dist/index-zd6adby9.js +496 -0
  57. package/dist/index.d.ts +62 -0
  58. package/dist/index.global.js +447 -160
  59. package/dist/index.js +533 -485
  60. package/dist/react-0wepdf60.js +1519 -0
  61. package/dist/{react-4pvp6amm.js → react-1gqwa2yw.js} +1 -1
  62. package/dist/{index-hv02xka3.js → react-3mfz1x2a.js} +126 -2167
  63. package/dist/react-4rbjw9af.js +33 -0
  64. package/dist/react-5rq7bnsy.js +210 -0
  65. package/dist/react-6bz05qk1.js +860 -0
  66. package/dist/{react-05jh9jv5.js → react-6fnxxs30.js} +8 -171
  67. package/dist/react-6q2cw2ya.js +689 -0
  68. package/dist/{react-sw8d8c94.js → react-6t4dbdzn.js} +11 -8
  69. package/dist/react-88es9b5q.js +719 -0
  70. package/dist/react-97b5b8j4.js +46 -0
  71. package/dist/{react-16spgn0h.js → react-bxzn8vq5.js} +1 -1
  72. package/dist/{react-ayg1bgw3.js → react-cs62p9qh.js} +83 -722
  73. package/dist/react-ethftdxp.js +497 -0
  74. package/dist/react-fp73vhyd.js +36 -0
  75. package/dist/{react-exjcpxma.js → react-me102s1a.js} +2 -45
  76. package/dist/react-t2qnewz2.js +24 -0
  77. package/dist/react-ttj8f9qp.js +1886 -0
  78. package/dist/{react-zy1mmhgz.js → react-v8497a41.js} +13 -8
  79. package/dist/{react-fm9y8dbn.js → react-wqn4sx0n.js} +276 -2133
  80. package/dist/react.js +529 -485
  81. package/dist/replay-j18rw92k.js +258 -0
  82. package/dist/replay-vtg0vqj2.js +257 -0
  83. package/dist/{storageview-s7heg93p.js → storageview-6xj7zb63.js} +11 -7
  84. package/dist/{storageview-r595qpt9.js → storageview-pzn8yaad.js} +11 -7
  85. package/dist/styles/force.d.ts +66 -0
  86. package/dist/types.d.ts +7 -0
  87. package/dist/ui/bindings.d.ts +31 -5
  88. package/dist/ui/changes.d.ts +49 -0
  89. package/dist/ui/cssauto.d.ts +119 -0
  90. package/dist/ui/cssedit.d.ts +80 -0
  91. package/dist/ui/domedit.d.ts +99 -0
  92. package/dist/ui/domtree.d.ts +26 -1
  93. package/dist/ui/elementsview.d.ts +19 -2
  94. package/dist/ui/htmledit.d.ts +62 -0
  95. package/dist/ui/inspector.d.ts +6 -1
  96. package/dist/ui/keys.d.ts +12 -8
  97. package/dist/ui/pane.d.ts +0 -2
  98. package/dist/ui/panel.d.ts +3 -0
  99. package/dist/ui/prefs.d.ts +30 -10
  100. package/dist/ui/settings.d.ts +10 -0
  101. package/dist/ui/size.d.ts +14 -22
  102. package/dist/ui/stylesview.d.ts +30 -1
  103. package/package.json +1 -1
  104. package/skills/devknobs/SKILL.md +95 -0
  105. package/dist/elementsview-2z4pkrdz.js +0 -2873
  106. package/dist/elementsview-qn8qyksa.js +0 -2874
  107. package/dist/index-78r0f8pw.js +0 -27
  108. package/dist/react-adky72h9.js +0 -29
@@ -1,44 +1,53 @@
1
1
  "use client";
2
2
  import {
3
- DEFAULT_STATE,
4
3
  DOT_LOOK,
5
- EXITED,
6
4
  MARK_EVENT,
5
+ apply as apply4,
6
+ apply1 as apply5,
7
+ apply2 as apply6,
8
+ apply3 as apply7,
9
+ drive,
10
+ driveUa,
11
+ dropEarly,
12
+ enableNative,
13
+ framing,
14
+ inPage,
15
+ keepOwn,
16
+ nativeEnabled,
17
+ nativeViewport,
18
+ release,
19
+ reset as reset3,
20
+ reset1 as reset4,
21
+ reset2 as reset5,
22
+ reset3 as reset6,
23
+ resume,
24
+ screenSizeOf,
25
+ uaPreset
26
+ } from "./react-ttj8f9qp.js";
27
+ import {
28
+ composedParent,
29
+ isDevknobs
30
+ } from "./react-6q2cw2ya.js";
31
+ import {
32
+ DEFAULT_STATE,
33
+ EXITED,
7
34
  NOW_READERS,
8
35
  NativeDate,
9
- QUIET,
10
- SHARED_VERSION,
11
- __export,
12
- __require,
13
36
  addStyle,
14
37
  apply,
15
38
  apply1 as apply2,
16
39
  apply2 as apply3,
17
- apply3 as apply4,
18
- apply4 as apply5,
19
- apply5 as apply6,
20
- apply6 as apply7,
21
40
  clockOn,
22
41
  destroy,
23
- drive,
24
- driveUa,
25
- dropEarly,
26
- enableNative,
27
42
  ensureStyle,
28
- evict,
29
43
  framed,
30
- framing,
31
44
  hasTouch,
32
- inPage,
33
45
  isDevknobsFrame,
34
- keepOwn,
35
46
  keepPlace,
36
47
  leaveFor,
37
48
  load,
38
49
  merge,
39
- nativeEnabled,
40
50
  nativeScheme,
41
- nativeViewport,
42
51
  needsFrame,
43
52
  newer,
44
53
  now,
@@ -47,327 +56,31 @@ import {
47
56
  readMessage,
48
57
  readNow,
49
58
  realNow,
50
- release,
51
59
  removeStyle,
52
60
  reset,
53
61
  reset1 as reset2,
54
- reset2 as reset3,
55
- reset3 as reset4,
56
- reset4 as reset5,
57
- reset5 as reset6,
58
62
  resetState,
59
63
  resolveGeo,
60
- resume,
61
64
  save,
62
- screenSizeOf,
63
65
  setClock,
64
- share,
65
- shared,
66
66
  stamped,
67
67
  styleNode,
68
68
  takeOver,
69
69
  temporalNow,
70
- uaPreset,
71
70
  webStorage,
72
71
  wrapDate
73
- } from "./react-fm9y8dbn.js";
74
-
75
- // src/ui/icons.ts
76
- var SVG = "http://www.w3.org/2000/svg";
77
- var p = (d) => ["path", { d }];
78
- var c = (cx, cy, r) => ["circle", { cx, cy, r }];
79
- var ICONS = {
80
- "half-sun-moon": [
81
- p("M12 7a5 5 0 0 0 0 10"),
82
- p("M12 3a9 9 0 0 1 0 18 12 12 0 0 0 0-18z"),
83
- p("M3 12h2"),
84
- p("m5.64 5.64 1.41 1.41"),
85
- p("m5.64 18.36 1.41-1.41")
86
- ],
87
- contrast: [c("12", "12", "10"), p("M12 18a6 6 0 0 0 0-12v12z")],
88
- blend: [c("15", "9", "7"), c("9", "15", "7")],
89
- eye: [
90
- p("M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"),
91
- c("12", "12", "3")
92
- ],
93
- type: [p("M12 4v16"), p("M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"), p("M9 20h6")],
94
- wind: [
95
- p("M12.8 19.6A2 2 0 1 0 14 16H2"),
96
- p("M17.5 8a2.5 2.5 0 1 1 2 4H2"),
97
- p("M9.8 4.4A2 2 0 1 1 11 8H2")
98
- ],
99
- languages: [
100
- p("m5 8 6 6"),
101
- p("m4 14 6-6 2-3"),
102
- p("M2 5h12"),
103
- p("M7 2h1"),
104
- p("m22 22-5-10-5 10"),
105
- p("M14 18h6")
106
- ],
107
- "map-pin": [
108
- p("M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"),
109
- c("12", "10", "3")
110
- ],
111
- clock: [c("12", "12", "10"), p("M12 6v6l4 2")],
112
- wifi: [
113
- p("M12 20h.01"),
114
- p("M2 8.82a15 15 0 0 1 20 0"),
115
- p("M5 12.859a10 10 0 0 1 14 0"),
116
- p("M8.5 16.429a5 5 0 0 1 7 0")
117
- ],
118
- smartphone: [
119
- ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2" }],
120
- p("M12 18h.01")
121
- ],
122
- ruler: [
123
- p("M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"),
124
- p("m14.5 12.5 2-2"),
125
- p("m11.5 9.5 2-2"),
126
- p("m8.5 6.5 2-2"),
127
- p("m17.5 15.5 2-2")
128
- ],
129
- bug: [
130
- p("M12 20v-9"),
131
- p("M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z"),
132
- p("M14.12 3.88 16 2"),
133
- p("M21 21a4 4 0 0 0-3.81-4"),
134
- p("M21 5a4 4 0 0 1-3.55 3.97"),
135
- p("M22 13h-4"),
136
- p("M3 21a4 4 0 0 1 3.81-4"),
137
- p("M3 5a4 4 0 0 0 3.55 3.97"),
138
- p("M6 13H2"),
139
- p("m8 2 1.88 1.88"),
140
- p("M9 7.13V6a3 3 0 1 1 6 0v1.13")
141
- ],
142
- "square-dashed-mouse-pointer": [
143
- p("M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"),
144
- p("M5 3a2 2 0 0 0-2 2"),
145
- p("M19 3a2 2 0 0 1 2 2"),
146
- p("M5 21a2 2 0 0 1-2-2"),
147
- p("M9 3h1"),
148
- p("M9 21h2"),
149
- p("M14 3h1"),
150
- p("M3 9v1"),
151
- p("M21 9v2"),
152
- p("M3 14v1")
153
- ],
154
- braces: [
155
- p("M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"),
156
- p("M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1")
157
- ],
158
- settings: [
159
- p("M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"),
160
- c("12", "12", "3")
161
- ],
162
- "panel-right": [
163
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
164
- p("M15 3v18")
165
- ],
166
- "panel-left": [
167
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
168
- p("M9 3v18")
169
- ],
170
- "panel-right-close": [
171
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
172
- p("M15 3v18"),
173
- p("m8 9 3 3-3 3")
174
- ],
175
- "panel-right-open": [
176
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
177
- p("M15 3v18"),
178
- p("m10 15-3-3 3-3")
179
- ],
180
- pin: [
181
- p("M12 17v5"),
182
- p("M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z")
183
- ],
184
- "pin-off": [
185
- p("M12 17v5"),
186
- p("M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89"),
187
- p("m2 2 20 20"),
188
- p("M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11")
189
- ],
190
- eraser: [
191
- p("M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21"),
192
- p("m5.082 11.09 8.828 8.828")
193
- ],
194
- "rotate-ccw": [p("M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"), p("M3 3v5h5")],
195
- "arrow-up-down": [p("m21 16-4 4-4-4"), p("M17 20V4"), p("m3 8 4-4 4 4"), p("M7 4v16")],
196
- ban: [c("12", "12", "10"), p("M4.929 4.929 19.07 19.071")],
197
- copy: [
198
- ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }],
199
- p("M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2")
200
- ],
201
- "refresh-cw": [
202
- p("M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"),
203
- p("M21 3v5h-5"),
204
- p("M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"),
205
- p("M8 16H3v5")
206
- ],
207
- database: [
208
- ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }],
209
- p("M3 5V19A9 3 0 0 0 21 19V5"),
210
- p("M3 12A9 3 0 0 0 21 12")
211
- ],
212
- "trash-2": [
213
- p("M10 11v6"),
214
- p("M14 11v6"),
215
- p("M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"),
216
- p("M3 6h18"),
217
- p("M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2")
218
- ],
219
- check: [p("M20 6 9 17l-5-5")],
220
- "chevron-left": [p("m15 18-6-6 6-6")],
221
- "chevrons-left-right": [p("m9 7-5 5 5 5"), p("m15 7 5 5-5 5")],
222
- plus: [p("M5 12h14"), p("M12 5v14")],
223
- x: [p("M18 6 6 18"), p("m6 6 12 12")],
224
- "grip-vertical": [
225
- c("9", "12", "1"),
226
- c("9", "5", "1"),
227
- c("9", "19", "1"),
228
- c("15", "12", "1"),
229
- c("15", "5", "1"),
230
- c("15", "19", "1")
231
- ],
232
- image: [
233
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2" }],
234
- c("9", "9", "2"),
235
- p("m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21")
236
- ],
237
- film: [
238
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
239
- p("M7 3v18"),
240
- p("M3 7.5h4"),
241
- p("M3 12h18"),
242
- p("M3 16.5h4"),
243
- p("M17 3v18"),
244
- p("M17 7.5h4"),
245
- p("M17 16.5h4")
246
- ],
247
- file: [
248
- p("M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"),
249
- p("M14 2v5a1 1 0 0 0 1 1h5")
250
- ],
251
- "table-2": [
252
- p("M3 9h18"),
253
- p("M9 3v18"),
254
- ["rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }]
255
- ],
256
- cookie: [
257
- p("M11 17h.01"),
258
- p("M11.496 2c.324-.016.558.292.529.615a4 4 0 004.235 4.368.713.713 0 01.758.757 4 4 0 004.366 4.237c.323-.03.63.204.614.527a10 10 0 01-2.915 6.566A1 1 0 114.93 4.918 10 10 0 0111.496 2"),
259
- p("M12 12h.01"),
260
- p("M16 16h.01"),
261
- p("M16 3h.01"),
262
- p("M21 4h.01"),
263
- p("M21 8h.01"),
264
- p("M7 14h.01"),
265
- p("M9 8h.01")
266
- ],
267
- "hard-drive": [
268
- p("M10 16h.01"),
269
- p("M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"),
270
- p("M21.946 12.013H2.054"),
271
- p("M6 16h.01")
272
- ],
273
- bookmark: [
274
- p("M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z")
275
- ]
276
- };
277
- var BRANDS = {
278
- javascript: [
279
- "#F7DF1E",
280
- "M0 0h24v24H0V0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873-.736-.345-1.554-.585-1.797-1.14-.091-.33-.105-.51-.046-.705.15-.646.915-.84 1.515-.66.39.12.75.42.976.9 1.034-.676 1.034-.676 1.755-1.125-.27-.42-.404-.601-.586-.78-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005-1.14 1.291-.811 3.541.569 4.471 1.365 1.02 3.361 1.244 3.616 2.205.24 1.17-.87 1.545-1.966 1.41-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109 1.74 1.756 6.09 1.666 6.871-1.004.029-.09.24-.705.074-1.65l.046.067zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805 0 1.232.063 2.363-.138 2.711-.33.689-1.18.601-1.566.48-.396-.196-.597-.466-.83-.855-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517.855.51 2.004.675 3.207.405.783-.226 1.458-.691 1.811-1.411.51-.93.402-2.07.397-3.346.012-2.054 0-4.109 0-6.179l.004-.056z",
281
- ["#000", "M1 1h22v22H1z"]
282
- ],
283
- css: [
284
- "#663399",
285
- "M0 0v20.16A3.84 3.84 0 0 0 3.84 24h16.32A3.84 3.84 0 0 0 24 20.16V3.84A3.84 3.84 0 0 0 20.16 0Zm14.256 13.08c1.56 0 2.28 1.08 2.304 2.64h-1.608c.024-.288-.048-.6-.144-.84-.096-.192-.288-.264-.552-.264-.456 0-.696.264-.696.84-.024.576.288.888.768 1.08.72.288 1.608.744 1.92 1.296q.432.648.432 1.656c0 1.608-.912 2.592-2.496 2.592-1.656 0-2.4-1.032-2.424-2.688h1.68c0 .792.264 1.176.792 1.176.264 0 .456-.072.552-.24.192-.312.24-1.176-.048-1.512-.312-.408-.912-.6-1.32-.816q-.828-.396-1.224-.936c-.24-.36-.36-.888-.36-1.536 0-1.44.936-2.472 2.424-2.448m5.4 0c1.584 0 2.304 1.08 2.328 2.64h-1.608c0-.288-.048-.6-.168-.84-.096-.192-.264-.264-.528-.264-.48 0-.72.264-.72.84s.288.888.792 1.08c.696.288 1.608.744 1.92 1.296.264.432.408.984.408 1.656.024 1.608-.888 2.592-2.472 2.592-1.68 0-2.424-1.056-2.448-2.688h1.68c0 .744.264 1.176.792 1.176.264 0 .456-.072.552-.24.216-.312.264-1.176-.048-1.512-.288-.408-.888-.6-1.32-.816-.552-.264-.96-.576-1.2-.936s-.36-.888-.36-1.536c-.024-1.44.912-2.472 2.4-2.448m-11.031.018c.711-.006 1.419.198 1.839.63.432.432.672 1.128.648 1.992H9.336c.024-.456-.096-.792-.432-.96-.312-.144-.768-.048-.888.24-.12.264-.192.576-.168.864v3.504c0 .744.264 1.128.768 1.128a.65.65 0 0 0 .552-.264c.168-.24.192-.552.168-.84h1.776c.096 1.632-.984 2.712-2.568 2.688-1.536 0-2.496-.864-2.472-2.472v-4.032c0-.816.24-1.44.696-1.848.432-.408 1.146-.624 1.857-.63",
286
- ["#fff", "M4 12h18v11.3H4z"]
287
- ],
288
- html5: [
289
- "#E34F26",
290
- "M1.5 0h21l-1.91 21.563L11.977 24l-8.564-2.438L1.5 0zm7.031 9.75l-.232-2.718 10.059.003.23-2.622L5.412 4.41l.698 8.01h9.126l-.326 3.426-2.91.804-2.955-.81-.188-2.11H6.248l.33 4.171L12 19.351l5.379-1.443.744-8.157H8.531z",
291
- ["#fff", "M5 4h14v16H5z"]
292
- ],
293
- webassembly: [
294
- "#654FF0",
295
- "M14.745,0c0,0.042,0,0.085,0,0.129c0,1.52-1.232,2.752-2.752,2.752c-1.52,0-2.752-1.232-2.752-2.752 c0-0.045,0-0.087,0-0.129H0v24h24V0H14.745z M11.454,21.431l-1.169-5.783h-0.02l-1.264,5.783H7.39l-1.824-8.497h1.59l1.088,5.783 h0.02l1.311-5.783h1.487l1.177,5.854h0.02l1.242-5.854h1.561l-2.027,8.497H11.454z M20.209,21.431l-0.542-1.891h-2.861l-0.417,1.891 h-1.59l2.056-8.497h2.509l2.5,8.497H20.209z M17.812,15.028l-0.694,3.118h2.159l-0.796-3.118H17.812z",
296
- ["#fff", "M4 12h19v10H4z"]
297
- ],
298
- json: [
299
- "currentColor",
300
- "M12.043 23.968c.479-.004.953-.029 1.426-.094a11.805 11.805 0 003.146-.863 12.404 12.404 0 003.793-2.542 11.977 11.977 0 002.44-3.427 11.794 11.794 0 001.02-3.476c.149-1.16.135-2.346-.045-3.499a11.96 11.96 0 00-.793-2.788 11.197 11.197 0 00-.854-1.617c-1.168-1.837-2.861-3.314-4.81-4.3a12.835 12.835 0 00-2.172-.87h-.005c.119.063.24.132.345.201.12.074.239.146.351.225a8.93 8.93 0 011.559 1.33c1.063 1.145 1.797 2.548 2.218 4.041.284.982.434 1.998.495 3.017.044.743.044 1.491-.047 2.229-.149 1.27-.554 2.51-1.228 3.596a7.475 7.475 0 01-1.903 2.084c-1.244.928-2.877 1.482-4.436 1.114a3.916 3.916 0 01-.748-.258 4.692 4.692 0 01-.779-.45 6.08 6.08 0 01-1.244-1.105 6.507 6.507 0 01-1.049-1.747 7.366 7.366 0 01-.494-2.54c-.03-1.273.225-2.553.854-3.67a6.43 6.43 0 011.663-1.918c.225-.178.464-.333.704-.479l.016-.007a5.121 5.121 0 00-1.441-.12 4.963 4.963 0 00-1.228.24c-.359.12-.704.27-1.019.45a6.146 6.146 0 00-.733.494c-.211.18-.42.36-.615.555-1.123 1.153-1.768 2.682-2.022 4.256-.15.973-.15 1.96-.091 2.95.105 1.395.391 2.787.945 4.062a8.518 8.518 0 001.348 2.173 8.14 8.14 0 003.132 2.23 7.934 7.934 0 002.113.54c.074.015.149.015.209.015zm-2.934-.398a4.102 4.102 0 01-.45-.228 8.5 8.5 0 01-2.038-1.534c-1.094-1.137-1.827-2.566-2.247-4.08a15.184 15.184 0 01-.495-3.172 12.14 12.14 0 01.046-2.082c.135-1.257.495-2.501 1.124-3.58a6.889 6.889 0 011.783-2.053 6.23 6.23 0 011.633-.9 5.363 5.363 0 013.522-.045c.029 0 .029 0 .045.03.015.015.045.015.06.03.045.016.104.045.165.074.239.12.479.271.704.42a6.294 6.294 0 012.097 2.502c.42.914.615 1.934.631 2.938.014 1.079-.18 2.157-.645 3.146a6.42 6.42 0 01-2.638 2.832c.09.03.18.045.271.075.225.044.449.074.688.074 1.468.045 2.892-.66 3.94-1.647.195-.18.375-.375.54-.585.225-.27.435-.54.614-.823.239-.375.435-.75.614-1.154a8.112 8.112 0 00.509-1.664c.196-1.004.211-2.022.149-3.026-.135-2.022-.673-4.045-1.842-5.724a9.054 9.054 0 00-.555-.719 9.868 9.868 0 00-1.063-1.034 8.477 8.477 0 00-1.363-.915 9.927 9.927 0 00-1.692-.598l-.3-.06c-.209-.03-.42-.044-.634-.06a8.453 8.453 0 00-1.015.016c-.704.045-1.412.16-2.112.337C5.799 1.227 2.863 3.566 1.3 6.67A11.834 11.834 0 00.238 9.801a11.81 11.81 0 00-.104 3.775c.12 1.02.374 2.023.778 2.977.227.57.511 1.124.825 1.648 1.094 1.783 2.683 3.236 4.51 4.24.688.39 1.408.69 2.157.944.226.074.45.15.689.21z"
301
- ]
302
- };
303
- var ROW_ICONS = {
304
- scheme: "half-sun-moon",
305
- contrast: "contrast",
306
- transparency: "blend",
307
- vision: "eye",
308
- text: "type",
309
- motion: "wind",
310
- locale: "languages",
311
- location: "map-pin",
312
- clock: "clock",
313
- network: "wifi",
314
- device: "smartphone",
315
- viewport: "ruler",
316
- debug: "bug"
317
- };
318
- function rowIcon(row) {
319
- return row.action ? row.action.icon : ROW_ICONS[row.id];
320
- }
321
- var BINDING_ICONS = {
322
- panel: "panel-right-open",
323
- grab: "square-dashed-mouse-pointer",
324
- inspect: "braces",
325
- replay: "rotate-ccw",
326
- requests: "arrow-up-down",
327
- storage: "database",
328
- reset: "eraser"
329
- };
330
- function frame(size) {
331
- const svg = document.createElementNS(SVG, "svg");
332
- svg.setAttribute("class", "glyph");
333
- svg.setAttribute("viewBox", "0 0 24 24");
334
- svg.setAttribute("width", String(size));
335
- svg.setAttribute("height", String(size));
336
- svg.setAttribute("aria-hidden", "true");
337
- return svg;
338
- }
339
- function icon(name, size = 14) {
340
- const svg = frame(size);
341
- svg.setAttribute("fill", "none");
342
- svg.setAttribute("stroke", "currentColor");
343
- svg.setAttribute("stroke-width", "1.5");
344
- svg.setAttribute("stroke-linecap", "round");
345
- svg.setAttribute("stroke-linejoin", "round");
346
- for (const [tag, attributes] of ICONS[name]) {
347
- const shape = document.createElementNS(SVG, tag);
348
- for (const [key, value] of Object.entries(attributes))
349
- shape.setAttribute(key, value);
350
- svg.append(shape);
351
- }
352
- return svg;
353
- }
354
- function brand(name, size = 14) {
355
- const svg = frame(size);
356
- const [fill, d, behind] = BRANDS[name];
357
- for (const [color, path] of behind ? [behind, [fill, d]] : [[fill, d]]) {
358
- const shape = document.createElementNS(SVG, "path");
359
- shape.setAttribute("fill", color);
360
- shape.setAttribute("d", path);
361
- svg.append(shape);
362
- }
363
- return svg;
364
- }
365
- function isBrand(name) {
366
- return name in BRANDS;
367
- }
368
- function glyph(name, size = 14) {
369
- return isBrand(name) ? brand(name, size) : icon(name, size);
370
- }
72
+ } from "./react-wqn4sx0n.js";
73
+ import {
74
+ QUIET,
75
+ SHARED_VERSION,
76
+ evict,
77
+ share,
78
+ shared
79
+ } from "./react-fp73vhyd.js";
80
+ import {
81
+ __export,
82
+ __require
83
+ } from "./react-t2qnewz2.js";
371
84
 
372
85
  // src/engine/intl.ts
373
86
  var SERVICES = [
@@ -1232,137 +945,6 @@ function reset8() {
1232
945
  restoreTime();
1233
946
  }
1234
947
 
1235
- // src/grab/hit.ts
1236
- var MAX_DEPTH = 32;
1237
- var MAX_LAYERS = 8;
1238
- var REPLACED = new Set([
1239
- "audio",
1240
- "br",
1241
- "canvas",
1242
- "embed",
1243
- "hr",
1244
- "iframe",
1245
- "img",
1246
- "input",
1247
- "meter",
1248
- "object",
1249
- "progress",
1250
- "select",
1251
- "svg",
1252
- "textarea",
1253
- "video"
1254
- ]);
1255
- var CLEAR_COLOR = /^transparent$|[,/]\s*0\)$/;
1256
- function composedParent(element) {
1257
- if (element.parentElement)
1258
- return element.parentElement;
1259
- const root = element.getRootNode?.();
1260
- return root && "host" in root ? root.host : null;
1261
- }
1262
- function isDevknobs(element) {
1263
- for (let current = element;current; current = composedParent(current)) {
1264
- if (current.hasAttribute("data-devknobs"))
1265
- return true;
1266
- }
1267
- return false;
1268
- }
1269
- function isRoot(element) {
1270
- const tag2 = element.tagName.toLowerCase();
1271
- return tag2 === "html" || tag2 === "body";
1272
- }
1273
- function isGrabbable(element) {
1274
- return element !== null && !isRoot(element) && !isDevknobs(element);
1275
- }
1276
- function styleOf(element) {
1277
- return element.ownerDocument.defaultView?.getComputedStyle(element) ?? null;
1278
- }
1279
- function inside(rect, x, y) {
1280
- return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
1281
- }
1282
- function holds(element, x, y) {
1283
- if (!inside(element.getBoundingClientRect(), x, y))
1284
- return false;
1285
- const rects = element.getClientRects();
1286
- for (let index = 0;index < rects.length; index++) {
1287
- const rect = rects[index];
1288
- if (rect && rect.width > 0 && rect.height > 0 && inside(rect, x, y))
1289
- return true;
1290
- }
1291
- return false;
1292
- }
1293
- function area(element) {
1294
- const rect = element.getBoundingClientRect();
1295
- return rect.width * rect.height;
1296
- }
1297
- function isHidden(element) {
1298
- const visibility = styleOf(element)?.visibility;
1299
- return visibility !== undefined && visibility !== "visible";
1300
- }
1301
- function isClearLayer(element) {
1302
- if (element.children.length > 0 || element.shadowRoot)
1303
- return false;
1304
- if (REPLACED.has(element.tagName.toLowerCase()) || element.textContent?.trim())
1305
- return false;
1306
- const style = styleOf(element);
1307
- if (!style)
1308
- return false;
1309
- return style.backgroundImage === "none" && CLEAR_COLOR.test(style.backgroundColor);
1310
- }
1311
- function under(root, top, x, y) {
1312
- if (!root.elementsFromPoint || holds(top, x, y) && !isClearLayer(top))
1313
- return top;
1314
- for (const element of root.elementsFromPoint(x, y).slice(0, MAX_LAYERS)) {
1315
- if (element === top || !isGrabbable(element))
1316
- continue;
1317
- if (holds(element, x, y) && !isClearLayer(element))
1318
- return element;
1319
- }
1320
- return top;
1321
- }
1322
- function descend(start, x, y) {
1323
- let current = start;
1324
- for (let depth = 0;depth < MAX_DEPTH; depth += 1) {
1325
- let best = null;
1326
- let smallest = Number.POSITIVE_INFINITY;
1327
- for (const children of [current.children, current.shadowRoot?.children]) {
1328
- if (!children)
1329
- continue;
1330
- for (let index = 0;index < children.length; index++) {
1331
- const child = children[index];
1332
- if (!child || child.hasAttribute("data-devknobs") || !holds(child, x, y))
1333
- continue;
1334
- if (isHidden(child) || isClearLayer(child))
1335
- continue;
1336
- const size = area(child);
1337
- if (size > smallest)
1338
- continue;
1339
- best = child;
1340
- smallest = size;
1341
- }
1342
- }
1343
- if (!best)
1344
- break;
1345
- current = best;
1346
- }
1347
- return current;
1348
- }
1349
- function deepElementAt(root, x, y) {
1350
- let element = root.elementFromPoint(x, y);
1351
- while (element?.shadowRoot) {
1352
- const inner = element.shadowRoot.elementFromPoint(x, y);
1353
- if (!inner || inner === element)
1354
- break;
1355
- element = inner;
1356
- }
1357
- if (!isGrabbable(element))
1358
- return element;
1359
- return descend(under(root, element, x, y), x, y);
1360
- }
1361
- function grabTargetAt(root, x, y) {
1362
- const element = deepElementAt(root, x, y);
1363
- return isGrabbable(element) ? element : null;
1364
- }
1365
-
1366
948
  // src/engine/toplayer.ts
1367
949
  var LAYER = { overlay: 0, panel: 1, guide: 2, touch: 3 };
1368
950
  var HOST_RESET = `
@@ -2194,7 +1776,7 @@ function pause(on) {
2194
1776
 
2195
1777
  // src/engine/frames.ts
2196
1778
  var kit = null;
2197
- var load2 = () => import("./framekit-w0v516w5.js");
1779
+ var load2 = () => import("./framekit-622h6w1f.js");
2198
1780
  var loading = null;
2199
1781
  var down = false;
2200
1782
  var waiting = [];
@@ -2204,12 +1786,14 @@ var exit = null;
2204
1786
  var zoomTo = null;
2205
1787
  var askWhy = null;
2206
1788
  var framed2 = null;
1789
+ var loader = null;
2207
1790
  function arrived(loaded) {
2208
1791
  kit = loaded;
2209
1792
  loaded.width.onExit(exit);
2210
1793
  loaded.width.onZoom(zoomTo);
2211
1794
  loaded.width.onRefused(askWhy);
2212
1795
  loaded.width.onFramed(framed2);
1796
+ loaded.width.onLoader(loader);
2213
1797
  for (const run of waiting.splice(0))
2214
1798
  run(loaded);
2215
1799
  for (const state of [before, latest]) {
@@ -2290,6 +1874,10 @@ function onFramed(handler) {
2290
1874
  framed2 = handler;
2291
1875
  kit?.width.onFramed(handler);
2292
1876
  }
1877
+ function onLoader(handler) {
1878
+ loader = handler;
1879
+ kit?.width.onLoader(handler);
1880
+ }
2293
1881
  function frameWindow() {
2294
1882
  return kit?.width.frameWindow() ?? null;
2295
1883
  }
@@ -2343,6 +1931,7 @@ __export(exports_engine, {
2343
1931
  ready: () => ready,
2344
1932
  nativeSwitch: () => nativeSwitch,
2345
1933
  keepPlace: () => keepPlace2,
1934
+ hostSendsUa: () => hostSendsUa,
2346
1935
  getState: () => getState,
2347
1936
  applyState: () => applyState
2348
1937
  });
@@ -3552,7 +3141,7 @@ var host2 = null;
3552
3141
  var layer = null;
3553
3142
  var sheet = null;
3554
3143
  var observer = null;
3555
- var frame2 = 0;
3144
+ var frame = 0;
3556
3145
  var timer2 = 0;
3557
3146
  var count = 0;
3558
3147
  var logged = new WeakSet;
@@ -3665,10 +3254,10 @@ function update() {
3665
3254
  setCount(offenders.length);
3666
3255
  }
3667
3256
  function schedule() {
3668
- if (frame2 || !host2)
3257
+ if (frame || !host2)
3669
3258
  return;
3670
- frame2 = requestAnimationFrame(() => {
3671
- frame2 = 0;
3259
+ frame = requestAnimationFrame(() => {
3260
+ frame = 0;
3672
3261
  update();
3673
3262
  });
3674
3263
  }
@@ -3718,9 +3307,9 @@ function reset14() {
3718
3307
  window.removeEventListener("scroll", schedule, true);
3719
3308
  observer?.disconnect();
3720
3309
  observer = null;
3721
- if (frame2) {
3722
- cancelAnimationFrame(frame2);
3723
- frame2 = 0;
3310
+ if (frame) {
3311
+ cancelAnimationFrame(frame);
3312
+ frame = 0;
3724
3313
  }
3725
3314
  clearTimeout(timer2);
3726
3315
  timer2 = 0;
@@ -3949,9 +3538,9 @@ function whenSettled(settled, leaving2, value, mounted, wait = READY_WAIT) {
3949
3538
  reject(notMounted());
3950
3539
  return;
3951
3540
  }
3952
- let frame3 = 0;
3541
+ let frame2 = 0;
3953
3542
  const stop2 = () => {
3954
- window.cancelAnimationFrame(frame3);
3543
+ window.cancelAnimationFrame(frame2);
3955
3544
  window.clearTimeout(timer3);
3956
3545
  };
3957
3546
  const check = () => {
@@ -3963,7 +3552,7 @@ function whenSettled(settled, leaving2, value, mounted, wait = READY_WAIT) {
3963
3552
  return;
3964
3553
  }
3965
3554
  if (!settled()) {
3966
- frame3 = window.requestAnimationFrame(check);
3555
+ frame2 = window.requestAnimationFrame(check);
3967
3556
  return;
3968
3557
  }
3969
3558
  stop2();
@@ -3980,7 +3569,7 @@ function whenSettled(settled, leaving2, value, mounted, wait = READY_WAIT) {
3980
3569
  else
3981
3570
  reject(new Error("devknobs: not settled after 10 seconds"));
3982
3571
  }, wait);
3983
- frame3 = window.requestAnimationFrame(check);
3572
+ frame2 = window.requestAnimationFrame(check);
3984
3573
  });
3985
3574
  }
3986
3575
 
@@ -4404,7 +3993,7 @@ var rate = 1;
4404
3993
  var originals2 = new Map;
4405
3994
  var roots = [];
4406
3995
  var lastWalk = 0;
4407
- var frame3 = 0;
3996
+ var frame2 = 0;
4408
3997
  var listening = false;
4409
3998
  var nativeAnimate = null;
4410
3999
  var patchedAnimate = null;
@@ -4466,7 +4055,7 @@ function sweep(full) {
4466
4055
  syncGsap();
4467
4056
  }
4468
4057
  function tick(now2) {
4469
- frame3 = requestAnimationFrame(tick);
4058
+ frame2 = requestAnimationFrame(tick);
4470
4059
  const full = now2 - lastWalk >= ROOT_INTERVAL;
4471
4060
  if (full)
4472
4061
  lastWalk = now2;
@@ -4506,7 +4095,7 @@ function apply19(value) {
4506
4095
  reset18();
4507
4096
  return;
4508
4097
  }
4509
- if (next === rate && frame3)
4098
+ if (next === rate && frame2)
4510
4099
  return;
4511
4100
  rate = next;
4512
4101
  for (const [animation, original] of originals2)
@@ -4519,14 +4108,14 @@ function apply19(value) {
4519
4108
  }
4520
4109
  lastWalk = performance.now();
4521
4110
  sweep(true);
4522
- if (!frame3)
4523
- frame3 = requestAnimationFrame(tick);
4111
+ if (!frame2)
4112
+ frame2 = requestAnimationFrame(tick);
4524
4113
  }
4525
4114
  function reset18() {
4526
4115
  rate = 1;
4527
- if (frame3) {
4528
- cancelAnimationFrame(frame3);
4529
- frame3 = 0;
4116
+ if (frame2) {
4117
+ cancelAnimationFrame(frame2);
4118
+ frame2 = 0;
4530
4119
  }
4531
4120
  if (listening) {
4532
4121
  window.removeEventListener("animationstart", onStart, true);
@@ -4547,6 +4136,7 @@ var persist = true;
4547
4136
  var running = false;
4548
4137
  var native2 = null;
4549
4138
  var nativeNote = null;
4139
+ var toldRealPhone = false;
4550
4140
  var inFrame = false;
4551
4141
  var stopRelay = null;
4552
4142
  var panelMoving = null;
@@ -4565,6 +4155,10 @@ function driver() {
4565
4155
  }
4566
4156
  function applyState(next) {
4567
4157
  state = inFrame ? framed(next) : next;
4158
+ if (running && !inFrame && native2?.realPhone && toldRealPhone !== state.panel.realPhone) {
4159
+ toldRealPhone = state.panel.realPhone;
4160
+ native2.realPhone(toldRealPhone);
4161
+ }
4568
4162
  const active2 = driver();
4569
4163
  const page = inPage(state, active2);
4570
4164
  const scheme = inFrame && nativeScheme(page.scheme) ? "system" : page.scheme;
@@ -4597,8 +4191,8 @@ function applyState(next) {
4597
4191
  else if (native2 && !inFrame)
4598
4192
  driveUa(native2, state);
4599
4193
  apply17(state.spacing);
4600
- apply4(state.ua);
4601
4194
  const sized2 = inFrame ? state : framing(state, active2);
4195
+ apply4(!inFrame && needsFrame(sized2) ? DEFAULT_STATE.ua : state.ua);
4602
4196
  apply11(sized2);
4603
4197
  apply15(state.overflow && !needsFrame(sized2));
4604
4198
  apply14(state.outlines);
@@ -4619,6 +4213,9 @@ function setNative(on3, note) {
4619
4213
  if (running && (changed || note !== undefined))
4620
4214
  applyState(state);
4621
4215
  }
4216
+ function hostSendsUa() {
4217
+ return native2?.ua !== undefined && native2.realPhone !== undefined;
4218
+ }
4622
4219
  function nativeSwitch() {
4623
4220
  if (!native2?.setting)
4624
4221
  return null;
@@ -4687,7 +4284,10 @@ function start4(options = {}) {
4687
4284
  onZoom((zoom) => setState({ zoom }));
4688
4285
  onRefused(native2?.refused ?? null);
4689
4286
  onFramed(native2?.framed ?? null);
4690
- applyState(merge(stored ? load() : { ...DEFAULT_STATE }, options.state ?? {}));
4287
+ onLoader(native2?.load ?? null);
4288
+ const first = merge(stored ? load() : { ...DEFAULT_STATE }, options.state ?? {});
4289
+ toldRealPhone = first.panel.realPhone;
4290
+ applyState(first);
4691
4291
  if (!inFrame)
4692
4292
  return;
4693
4293
  relay(overflowCount());
@@ -4707,6 +4307,7 @@ function stop2() {
4707
4307
  onZoom(null);
4708
4308
  onRefused(null);
4709
4309
  onFramed(null);
4310
+ onLoader(null);
4710
4311
  destroy();
4711
4312
  reset6();
4712
4313
  reset9();
@@ -4739,244 +4340,4 @@ function replay2() {
4739
4340
  post(frameWindow(), { source: "devknobs", type: "replay" });
4740
4341
  }
4741
4342
 
4742
- // src/ui/keys.ts
4743
- function hotkeyOf(hotkey) {
4744
- return (hotkey ?? "k").toLowerCase();
4745
- }
4746
- var MODIFIER_NAMES = {
4747
- meta: "meta",
4748
- cmd: "meta",
4749
- command: "meta",
4750
- ctrl: "ctrl",
4751
- control: "ctrl",
4752
- shift: "shift",
4753
- alt: "alt",
4754
- option: "alt",
4755
- opt: "alt"
4756
- };
4757
- function parseCombo(spec) {
4758
- if (!spec?.trim())
4759
- return null;
4760
- const parsed = { meta: false, ctrl: false, shift: false, alt: false, key: "" };
4761
- for (const raw of spec.split("+")) {
4762
- const part = raw.trim().toLowerCase();
4763
- const modifier = MODIFIER_NAMES[part];
4764
- if (modifier)
4765
- parsed[modifier] = true;
4766
- else if (part && !parsed.key)
4767
- parsed.key = part;
4768
- else
4769
- return null;
4770
- }
4771
- return parsed.key ? parsed : null;
4772
- }
4773
- function comboText(combo) {
4774
- const names = [
4775
- combo.meta && "meta",
4776
- combo.ctrl && "ctrl",
4777
- combo.alt && "alt",
4778
- combo.shift && "shift"
4779
- ];
4780
- return [...names.filter((name) => Boolean(name)), combo.key].join("+");
4781
- }
4782
- function withShift(key2) {
4783
- return { meta: false, ctrl: false, shift: true, alt: false, key: key2 };
4784
- }
4785
- function isFunctionKey(key2) {
4786
- return /^f([1-9]|1[0-2])$/.test(key2);
4787
- }
4788
- function deletes(key2) {
4789
- return key2 === "backspace" || key2 === "delete";
4790
- }
4791
- var KEY_GLYPHS = { backspace: "⌫", delete: "⌦" };
4792
- var KEY_NAMES = { backspace: "Backspace", delete: "Delete" };
4793
- function comboLabel(combo, mac) {
4794
- const key2 = combo.key;
4795
- if (mac) {
4796
- const marks = `${combo.ctrl ? "⌃" : ""}${combo.alt ? "⌥" : ""}${combo.shift ? "⇧" : ""}${combo.meta ? "⌘" : ""}`;
4797
- return `${marks}${KEY_GLYPHS[key2] ?? key2.toUpperCase()}`;
4798
- }
4799
- const names = [
4800
- combo.ctrl && "Ctrl",
4801
- combo.alt && "Alt",
4802
- combo.shift && "Shift",
4803
- combo.meta && "Meta"
4804
- ];
4805
- const name = KEY_NAMES[key2] ?? key2.toUpperCase();
4806
- return [...names.filter((part) => Boolean(part)), name].join(" ");
4807
- }
4808
- function comboSpoken(combo) {
4809
- return comboText(combo).replaceAll("+", " ");
4810
- }
4811
- var INSPECT_KEYS = ["c", "i", "y"];
4812
- function defaultKeys(options = {}) {
4813
- const panel = withShift(hotkeyOf(options.hotkey));
4814
- const grab = parseCombo(options.grabKey) ?? withShift("g");
4815
- const taken = [panel, grab].map(comboText);
4816
- const free = INSPECT_KEYS.find((key2) => !taken.includes(comboText(withShift(key2))));
4817
- return {
4818
- panel,
4819
- grab,
4820
- inspect: withShift(free ?? "c"),
4821
- replay: withShift(REPLAY_KEY),
4822
- requests: withShift(REQUESTS_KEY),
4823
- storage: withShift(STORAGE_KEY),
4824
- reset: withShift("backspace")
4825
- };
4826
- }
4827
- var KEYS_FIELD = "data-devknobs-keys";
4828
- function isTyping(node) {
4829
- const element = node;
4830
- const tag2 = element?.tagName;
4831
- if (tag2 === "INPUT" || tag2 === "TEXTAREA")
4832
- return true;
4833
- return element?.isContentEditable === true;
4834
- }
4835
- function focusInClosedRoot(node) {
4836
- if (typeof HTMLElement === "undefined" || !(node instanceof HTMLElement))
4837
- return false;
4838
- if (!node.tagName.includes("-"))
4839
- return false;
4840
- if (node.shadowRoot !== null || node.hasAttribute("tabindex") || node.tabIndex >= 0)
4841
- return false;
4842
- const root = node.getRootNode();
4843
- if (root instanceof Document) {
4844
- if (node === root.body || node === root.documentElement)
4845
- return false;
4846
- } else if (!(root instanceof ShadowRoot)) {
4847
- return false;
4848
- }
4849
- return root.activeElement === node;
4850
- }
4851
- function isEditable(node) {
4852
- return isTyping(node) || node?.tagName === "SELECT" || focusInClosedRoot(node);
4853
- }
4854
- function typesInField(event) {
4855
- const target = event.composedPath?.()[0] ?? event.target;
4856
- if (!isEditable(target))
4857
- return false;
4858
- return target?.hasAttribute?.(KEYS_FIELD) !== true;
4859
- }
4860
- function lowerKey(key2) {
4861
- return key2 === "İ" ? "i" : key2.toLowerCase();
4862
- }
4863
- function letterMatches(event, letter) {
4864
- const key2 = lowerKey(event.key);
4865
- if (key2 === letter)
4866
- return true;
4867
- return [...key2].length === 1 && !/\p{Script=Latin}/u.test(key2) && event.code === `Key${letter.toUpperCase()}`;
4868
- }
4869
- function keyIs(event, key2) {
4870
- if (/^[a-z]$/.test(key2)) {
4871
- return letterMatches(event, key2) || event.altKey && event.code === `Key${key2.toUpperCase()}`;
4872
- }
4873
- if (event.key.toLowerCase() === key2)
4874
- return true;
4875
- if (/^[0-9]$/.test(key2))
4876
- return event.code === `Digit${key2}`;
4877
- return key2 === "backspace" && event.key === "Delete";
4878
- }
4879
- function comboMatches(event, combo) {
4880
- return event.isComposing !== true && event.metaKey === combo.meta && event.ctrlKey === combo.ctrl && event.shiftKey === combo.shift && event.altKey === combo.alt && keyIs(event, combo.key);
4881
- }
4882
- function actsHere(event, combo) {
4883
- if (isFunctionKey(combo.key))
4884
- return true;
4885
- if (deletes(combo.key))
4886
- return !isEditable(event.composedPath?.()[0] ?? event.target);
4887
- return !typesInField(event);
4888
- }
4889
- var REPLAY_KEY = "r";
4890
- var REQUESTS_KEY = "n";
4891
- var STORAGE_KEY = "s";
4892
- function keyAction(event, keys) {
4893
- if (event.key === "Escape")
4894
- return "close";
4895
- const steps = [
4896
- ["toggle", keys.panel],
4897
- ["replay", keys.replay],
4898
- ["requests", keys.requests],
4899
- ["reset", keys.reset],
4900
- ["storage", keys.storage]
4901
- ];
4902
- for (const [action, combo] of steps) {
4903
- if (combo && comboMatches(event, combo))
4904
- return actsHere(event, combo) ? action : null;
4905
- }
4906
- return null;
4907
- }
4908
- function isSearchKey(event) {
4909
- if (event.key !== "/" || event.altKey || event.ctrlKey || event.metaKey)
4910
- return false;
4911
- const target = event.composedPath?.()[0] ?? event.target;
4912
- return !isEditable(target);
4913
- }
4914
- function typeAhead(event) {
4915
- if (event.altKey || event.ctrlKey || event.metaKey || event.isComposing === true)
4916
- return null;
4917
- if ([...event.key].length !== 1 || event.key === " " || event.key === "/")
4918
- return null;
4919
- return isEditable(event.composedPath?.()[0] ?? event.target) ? null : event.key;
4920
- }
4921
- function zoomAction(event) {
4922
- if (!event.metaKey && !event.ctrlKey || event.altKey)
4923
- return null;
4924
- if (isTyping(event.composedPath?.()[0] ?? event.target))
4925
- return null;
4926
- if (event.key === "=" || event.key === "+")
4927
- return "zoom-in";
4928
- if (event.key === "-" || event.key === "_")
4929
- return "zoom-out";
4930
- return event.key === "0" ? "zoom-fit" : null;
4931
- }
4932
- function escapeStep(scene) {
4933
- if (scene.search)
4934
- return "search";
4935
- if (scene.filter)
4936
- return "filter";
4937
- if (scene.keys)
4938
- return "keys";
4939
- if (scene.view)
4940
- return "view";
4941
- if (scene.editor)
4942
- return "editor";
4943
- return "panel";
4944
- }
4945
- function highlightAt(cursor, count2, newQuery = false) {
4946
- return Math.min(Math.max(newQuery ? 0 : cursor, 0), count2 - 1);
4947
- }
4948
- function paletteMove(key2, cursor, count2) {
4949
- if (key2 === "ArrowDown" || key2 === "ArrowUp") {
4950
- return { cursor: highlightAt(cursor + (key2 === "ArrowDown" ? 1 : -1), count2), pick: false };
4951
- }
4952
- if (key2 === "Enter")
4953
- return { cursor: highlightAt(cursor, count2), pick: count2 > 0 };
4954
- return null;
4955
- }
4956
- function radioMove(key2, index, count2) {
4957
- if (count2 === 0)
4958
- return null;
4959
- if (key2 === "ArrowRight" || key2 === "ArrowDown")
4960
- return (index + 1) % count2;
4961
- if (key2 === "ArrowLeft" || key2 === "ArrowUp")
4962
- return (index - 1 + count2) % count2;
4963
- if (key2 === "Home")
4964
- return 0;
4965
- return key2 === "End" ? count2 - 1 : null;
4966
- }
4967
- function forwardKeys(keys = () => defaultKeys(), open = () => true) {
4968
- function onKeydown(event) {
4969
- const zoom = zoomAction(event);
4970
- const search = isSearchKey(event) && open();
4971
- const panelAction = keyAction(event, keys());
4972
- if (zoom || search || panelAction && panelAction !== "close")
4973
- event.preventDefault();
4974
- const action = panelAction ?? zoom ?? (search ? "search" : null);
4975
- if (action)
4976
- post(window.parent, { source: "devknobs", type: "key", action });
4977
- }
4978
- window.addEventListener("keydown", onKeydown, true);
4979
- return () => window.removeEventListener("keydown", onKeydown, true);
4980
- }
4981
-
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 };
4343
+ export { BODY_CAP, READ_MS, requestLog, sends, canonicalTag, LOCALE_PRESETS, overflowCount, onCount, devIconShown, devIconFor, SPEED_MIN, SPEED_MAX, TIME_ZONE_PRESETS, canonicalZone, resolveTimeZone, 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 };