@vinena/knobs 0.5.0 → 0.5.2

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 (75) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +7 -0
  3. package/dist/early.global.js +6 -6
  4. package/dist/{elementsview-6g274ptr.js → elementsview-2z4pkrdz.js} +4 -4
  5. package/dist/{elementsview-pkzp9kc6.js → elementsview-qn8qyksa.js} +4 -4
  6. package/dist/engine/browserdraw.d.ts +24 -2
  7. package/dist/engine/browserkit.d.ts +18 -1
  8. package/dist/engine/browserui.d.ts +162 -22
  9. package/dist/engine/devicon.d.ts +59 -0
  10. package/dist/engine/fit.d.ts +4 -3
  11. package/dist/engine/foldflip.d.ts +40 -0
  12. package/dist/engine/identity.d.ts +7 -4
  13. package/dist/engine/mock.d.ts +16 -0
  14. package/dist/engine/mockdata.d.ts +4 -1
  15. package/dist/engine/mockdraw.d.ts +14 -2
  16. package/dist/engine/pageshot.d.ts +5 -2
  17. package/dist/engine/safaridraw.d.ts +162 -10
  18. package/dist/engine/screen.d.ts +24 -0
  19. package/dist/engine/store.d.ts +2 -1
  20. package/dist/engine/tabicon.d.ts +43 -0
  21. package/dist/engine/toplayer.d.ts +62 -0
  22. package/dist/engine/touchpointer.d.ts +0 -21
  23. package/dist/engine/underbar.d.ts +61 -0
  24. package/dist/{framekit-g96t6nmq.js → framekit-te90cjs0.js} +2325 -1572
  25. package/dist/{framekit-3n7p79ht.js → framekit-w0v516w5.js} +2325 -1572
  26. package/dist/host.d.ts +51 -0
  27. package/dist/{index-64rd634h.js → index-30fc6php.js} +1 -1
  28. package/dist/{index-dvr4x91q.js → index-9re7sv56.js} +20 -8
  29. package/dist/{index-0casarhy.js → index-agwr37gw.js} +1 -1
  30. package/dist/{index-2d6wvs8h.js → index-dan2kpsd.js} +4 -4
  31. package/dist/{index-kzsb9drs.js → index-hv02xka3.js} +20 -8
  32. package/dist/{index-peh33xjv.js → index-pewcdh28.js} +1 -1
  33. package/dist/{index-d0cjxjsm.js → index-r72tz2vn.js} +1 -1
  34. package/dist/{index-33x9hxe3.js → index-sxe5079a.js} +605 -187
  35. package/dist/{index-5d6qzte3.js → index-trx7bxdk.js} +4 -4
  36. package/dist/{index-5baxvd3v.js → index-xjhwp5cj.js} +275 -112
  37. package/dist/index.d.ts +26 -1
  38. package/dist/index.global.js +270 -176
  39. package/dist/index.js +398 -124
  40. package/dist/instance.d.ts +23 -4
  41. package/dist/{react-pdvseef0.js → react-05jh9jv5.js} +1 -1
  42. package/dist/{react-4kbj1t4h.js → react-16spgn0h.js} +1 -1
  43. package/dist/{react-65tgdbs8.js → react-4pvp6amm.js} +1 -1
  44. package/dist/{react-qv0nykcv.js → react-ayg1bgw3.js} +602 -184
  45. package/dist/{react-xxfpfddf.js → react-exjcpxma.js} +1 -1
  46. package/dist/{react-carf84xv.js → react-fm9y8dbn.js} +275 -112
  47. package/dist/{react-mv9y20jy.js → react-sw8d8c94.js} +4 -4
  48. package/dist/{react-71a9ypex.js → react-zy1mmhgz.js} +4 -4
  49. package/dist/react.js +394 -123
  50. package/dist/{storageview-vdkbp6rt.js → storageview-r595qpt9.js} +4 -4
  51. package/dist/{storageview-j9d44f99.js → storageview-s7heg93p.js} +4 -4
  52. package/dist/types.d.ts +7 -0
  53. package/dist/ui/footer.d.ts +9 -2
  54. package/dist/ui/panel.d.ts +16 -2
  55. package/dist/ui/settings.d.ts +17 -1
  56. package/dist/version.d.ts +2 -0
  57. package/package.json +3 -2
  58. package/skills/devknobs/SKILL.md +1 -1
  59. package/dist/elementsview-jnkbhzkj.js +0 -2873
  60. package/dist/elementsview-tf4qzmtw.js +0 -2874
  61. package/dist/engine/endroom.d.ts +0 -21
  62. package/dist/framekit-095qevka.js +0 -8838
  63. package/dist/framekit-q5aad770.js +0 -8839
  64. package/dist/index-hw56t3zy.js +0 -4800
  65. package/dist/index-k015tb6c.js +0 -357
  66. package/dist/index-ke6v7919.js +0 -4801
  67. package/dist/index-qxye1j73.js +0 -528
  68. package/dist/index-z5ytnj01.js +0 -4563
  69. package/dist/index-zvze25nf.js +0 -686
  70. package/dist/react-eygws6cx.js +0 -358
  71. package/dist/react-sq9pkw4k.js +0 -687
  72. package/dist/react-vjm88w4t.js +0 -4564
  73. package/dist/react-znfrjqk8.js +0 -529
  74. package/dist/storageview-sb23henh.js +0 -2729
  75. package/dist/storageview-vf8v8q8j.js +0 -2728
@@ -3,7 +3,7 @@ import {
3
3
  deviceOf,
4
4
  formOf,
5
5
  needsFrame
6
- } from "./react-carf84xv.js";
6
+ } from "./react-fm9y8dbn.js";
7
7
 
8
8
  // src/engine/morph.ts
9
9
  var MORPH_TIME = {
@@ -57,7 +57,7 @@ var DEVICES = [
57
57
  touch: true,
58
58
  kind: "phone",
59
59
  postures: {
60
- closed: { id: "iphone-duo-closed", label: "iPhone Duo (closed)" },
60
+ closed: { id: "iphone-duo-closed", label: "iPhone Duo (closed)", clockwise: true },
61
61
  open: {
62
62
  id: "iphone-duo-open",
63
63
  label: "iPhone Duo (open)",
@@ -1209,6 +1209,7 @@ var DEFAULT_STATE = {
1209
1209
  tab: "top",
1210
1210
  docked: false,
1211
1211
  handle: true,
1212
+ devIcon: "auto",
1212
1213
  pinned: [...DEFAULT_PINNED]
1213
1214
  }
1214
1215
  };
@@ -1227,6 +1228,7 @@ var BROWSERS = ["auto", "compact", "bottom", "top", "off"];
1227
1228
  var ORIENTATIONS = ["portrait", "landscape"];
1228
1229
  var EDGES = ["top", "bottom", "none"];
1229
1230
  var SIDES2 = ["left", "right"];
1231
+ var DEV_ICONS = ["auto", "on", "off"];
1230
1232
  var VISIONS = [
1231
1233
  "none",
1232
1234
  "protanopia",
@@ -1379,6 +1381,7 @@ function parse(json, place) {
1379
1381
  open: bool(panel.open, DEFAULT_STATE.panel.open),
1380
1382
  ...placeOf(panel, home),
1381
1383
  handle: bool(panel.handle, DEFAULT_STATE.panel.handle),
1384
+ devIcon: oneOf(panel.devIcon, DEV_ICONS, DEFAULT_STATE.panel.devIcon),
1382
1385
  pinned: state.panel === undefined ? [...DEFAULT_PINNED] : rowIds(panel.pinned)
1383
1386
  }
1384
1387
  };
@@ -1995,10 +1998,10 @@ var BODIES = {
1995
1998
  },
1996
1999
  "iphone-air": {
1997
2000
  bezel: sides2(15.3, 15.3, 15.3, 15.3),
1998
- screenRadius: 62,
2001
+ screenRadius: 65,
1999
2002
  bodyRadius: 77.3,
2000
2003
  out: 2.7,
2001
- front: [pill("sensor", 147.8, 20.4, 124.6, 36)],
2004
+ front: [pill("sensor", 147.33, 20, 125.33, 36.67)],
2002
2005
  buttons: [left(185, 41.7), left(257.3, 67.7), left(343, 67.7), right(280.7, 106.7, 3)]
2003
2006
  },
2004
2007
  "iphone-17": {
@@ -2006,7 +2009,7 @@ var BODIES = {
2006
2009
  screenRadius: 62,
2007
2010
  bodyRadius: 76.7,
2008
2011
  out: 3,
2009
- front: [pill("sensor", 138.8, 14.3, 124.5, 35.9)],
2012
+ front: [pill("sensor", 138.33, 14, 125.33, 36.67)],
2010
2013
  buttons: [left(185, 41.7), left(257.3, 67.7), left(342.7, 68), right(280.3, 107, 2.7)]
2011
2014
  },
2012
2015
  "iphone-17-pro": {
@@ -2014,7 +2017,7 @@ var BODIES = {
2014
2017
  screenRadius: 62,
2015
2018
  bodyRadius: 77.7,
2016
2019
  out: 3,
2017
- front: [pill("sensor", 138.8, 14.4, 124.4, 35.8)],
2020
+ front: [pill("sensor", 138.33, 14, 125.33, 36.67)],
2018
2021
  buttons: [left(186, 41.7), left(258.3, 67.7), left(344, 67.7), right(281.7, 107, 2.7)]
2019
2022
  },
2020
2023
  "iphone-17-pro-max": {
@@ -2022,7 +2025,7 @@ var BODIES = {
2022
2025
  screenRadius: 62,
2023
2026
  bodyRadius: 77.3,
2024
2027
  out: 2.7,
2025
- front: [pill("sensor", 157.8, 14.5, 124.4, 35.8)],
2028
+ front: [pill("sensor", 157.33, 14, 125.33, 36.67)],
2026
2029
  buttons: [left(186.3, 41.7), left(258.7, 67.7), left(344.3, 67.7), right(282, 106.7)]
2027
2030
  },
2028
2031
  "iphone-16": {
@@ -2046,7 +2049,7 @@ var BODIES = {
2046
2049
  screenRadius: 62,
2047
2050
  bodyRadius: 77.9,
2048
2051
  out: 2.7,
2049
- front: [pill("sensor", 138.4, 13.5, 125.2, 36.7)],
2052
+ front: [pill("sensor", 138.33, 14, 125.33, 36.67)],
2050
2053
  buttons: [...IPHONE_LEFT, ...iphoneRight(541.3)]
2051
2054
  },
2052
2055
  "iphone-16-pro-max": {
@@ -2156,19 +2159,57 @@ var LAYOUTS = {
2156
2159
  safari: ["compact", "bottom", "top", "off"],
2157
2160
  chrome: ["top", "bottom", "off"]
2158
2161
  };
2162
+ var DUO_COVER = {
2163
+ column: 84,
2164
+ bottom: 98,
2165
+ minimized: 60,
2166
+ axis: 48,
2167
+ time: { y: 91.5, size: 15.75 },
2168
+ ring: { y: 129.9, radius: 18.9, stroke: 3.5 },
2169
+ buttons: [174.2, 234.2],
2170
+ capsule: 102,
2171
+ gap: 34,
2172
+ inset: 24,
2173
+ across: {
2174
+ top: 80,
2175
+ minimized: 26,
2176
+ side: 7.33,
2177
+ address: { x: 209, width: 260 },
2178
+ end: 149.33
2179
+ }
2180
+ };
2181
+ var DUO_INNER = {
2182
+ top: 80,
2183
+ minimized: 51,
2184
+ axis: 47.67,
2185
+ time: { x: 99.83, y: 47.4, size: 15.75 },
2186
+ ring: { y: 47.9, radius: 18.9, stroke: 3.5 },
2187
+ side: 6,
2188
+ address: { landscape: { x: 295, width: 361 }, portrait: { x: 184, width: 241.5 } },
2189
+ end: 232,
2190
+ pill: 23.5
2191
+ };
2192
+ var DUO_ROW = 26;
2193
+ var DUO_PILL = { height: 20, size: 12, pad: 15 };
2194
+ function runsUnderBars(id) {
2195
+ return !SAFARI[id]?.duo;
2196
+ }
2197
+ var DUO_LAYOUTS = ["compact", "off"];
2198
+ var STATUS_PRO = { time: 73.83, right: 369.67 };
2199
+ var STATUS_MAX = { time: 83.17, right: 401.67 };
2159
2200
  var SAFARI = {
2160
2201
  "iphone-18-pro": { top: 62, side: 62, faceId: true },
2161
2202
  "iphone-18-pro-max": { top: 62, side: 62, faceId: true },
2162
- "iphone-duo-closed": { top: 82, side: 82, faceId: true },
2163
- "iphone-duo-open": { top: 40, side: 24, faceId: true },
2164
- "iphone-air": { top: 68, side: 68, faceId: true },
2165
- "iphone-17": { top: 62, side: 62, faceId: true },
2166
- "iphone-17-pro": { top: 62, side: 62, faceId: true },
2167
- "iphone-17-pro-max": { top: 62, side: 62, faceId: true },
2203
+ "iphone-duo-closed": { top: 0, side: 0, faceId: true, duo: "cover" },
2204
+ "iphone-duo-open": { top: DUO_INNER.top, side: 0, faceId: true, duo: "inner" },
2205
+ "iphone-air": { top: 68, side: 68, faceId: true, status: { time: 77.17, right: 387.67 } },
2206
+ "iphone-17": { top: 62, side: 62, faceId: true, status: STATUS_PRO },
2207
+ "iphone-17-pro": { top: 62, side: 62, faceId: true, status: STATUS_PRO },
2208
+ "iphone-17-pro-max": { top: 62, side: 62, faceId: true, status: STATUS_MAX },
2168
2209
  "iphone-16": { top: 59, side: 59, faceId: true },
2169
2210
  "iphone-16-plus": { top: 59, side: 59, faceId: true },
2170
- "iphone-16-pro": { top: 62, side: 62, faceId: true },
2171
- "iphone-16-pro-max": { top: 62, side: 62, faceId: true },
2211
+ "iphone-16-pro": { top: 62, side: 62, faceId: true, status: STATUS_PRO },
2212
+ "iphone-16-pro-max": { top: 62, side: 62, faceId: true, status: STATUS_MAX },
2172
2213
  "iphone-se": { top: 20, side: 0, faceId: false }
2173
2214
  };
2174
2215
  var CHROME = {
@@ -2199,6 +2240,8 @@ function platformOf(id) {
2199
2240
  return null;
2200
2241
  }
2201
2242
  function layoutOptions(id) {
2243
+ if (SAFARI[id]?.duo)
2244
+ return DUO_LAYOUTS;
2202
2245
  const platform = platformOf(id);
2203
2246
  return platform ? LAYOUTS[platform] : [];
2204
2247
  }
@@ -2218,10 +2261,22 @@ function viewportOf(device, orientation, layout, minimized, edge = false) {
2218
2261
  if (!layout || layout === "off")
2219
2262
  return whole;
2220
2263
  const safari = SAFARI[device.id];
2264
+ if (safari?.duo === "cover" && orientation === "landscape") {
2265
+ const { across } = DUO_COVER;
2266
+ const top2 = minimized ? across.minimized : across.top;
2267
+ return rect(0, top2, W, H - top2);
2268
+ }
2269
+ if (safari?.duo === "cover") {
2270
+ const bottom = minimized ? DUO_COVER.minimized : DUO_COVER.bottom;
2271
+ return rect(0, 0, W - DUO_COVER.column, H - bottom);
2272
+ }
2273
+ if (safari?.duo === "inner") {
2274
+ const top2 = minimized ? DUO_INNER.minimized : DUO_INNER.top;
2275
+ return rect(0, top2, W, H - top2);
2276
+ }
2221
2277
  if (safari) {
2222
- if (edge) {
2223
- return orientation === "landscape" ? rect(safari.side, 0, W - 2 * safari.side, H) : rect(0, safari.top, W, H - safari.top);
2224
- }
2278
+ if (edge && orientation === "landscape")
2279
+ return rect(safari.side, 0, W - 2 * safari.side, H);
2225
2280
  if (orientation === "landscape") {
2226
2281
  const top2 = minimized ? 0 : SAFARI_BARS.landscape;
2227
2282
  return rect(safari.side, top2, W - 2 * safari.side, H - top2);
@@ -2249,58 +2304,34 @@ function viewportOf(device, orientation, layout, minimized, edge = false) {
2249
2304
  const height = tall - chrome.top - toolbar - chin;
2250
2305
  return rect(0, chrome.top + (layout === "top" ? toolbar : 0), W, height);
2251
2306
  }
2252
- function endRoom(device, orientation, layout, minimized, edge) {
2253
- if (!edge)
2254
- return 0;
2255
- const drawn = viewportOf(device, orientation, layout, minimized, true);
2256
- const real = viewportOf(device, orientation, layout, minimized);
2257
- return drawn.y + drawn.height - (real.y + real.height);
2258
- }
2259
2307
  function capsule(kind, box, marks = []) {
2260
2308
  return { kind, ...box, radius: Math.min(box.width, box.height) / 2, marks };
2261
2309
  }
2262
2310
  function mark(glyph, x, y) {
2263
2311
  return { glyph, x, y };
2264
2312
  }
2265
- var FADE = [
2266
- [-64, 0],
2267
- [-52, 0.05],
2268
- [-40, 0.12],
2269
- [-28, 0.24],
2270
- [-18, 0.4],
2271
- [-9, 0.6],
2272
- [0, 0.85]
2313
+ var SCRIM = [
2314
+ [0, 0.81],
2315
+ [20, 0.67],
2316
+ [40, 0.41],
2317
+ [60, 0.16],
2318
+ [80, 0.03],
2319
+ [100, 0]
2273
2320
  ];
2274
- var FADE_EDGE = 0.92;
2275
- function edgeFade(bars, H) {
2276
- const low = bars.shapes.filter((shape) => shape.kind !== "pill" && shape.y > H / 2);
2277
- if (bars.minimized || low.length === 0) {
2278
- const stops = [
2279
- { at: 0, alpha: 0 },
2280
- { at: 12, alpha: 0.12 },
2281
- { at: 24, alpha: 0.35 }
2282
- ];
2283
- return { y: H - 24, height: 24, stops };
2321
+ function alphaAt(fade, y) {
2322
+ const at = y - fade.y;
2323
+ const { stops } = fade;
2324
+ const first = stops[0];
2325
+ if (!first || at <= first.at)
2326
+ return first?.alpha ?? 0;
2327
+ for (let i = 1;i < stops.length; i++) {
2328
+ const from = stops[i - 1];
2329
+ const to = stops[i];
2330
+ if (!from || !to || at > to.at)
2331
+ continue;
2332
+ return from.alpha + (to.alpha - from.alpha) * (at - from.at) / (to.at - from.at || 1);
2284
2333
  }
2285
- const y = Math.min(...low.map((shape) => shape.y)) - 40;
2286
- const height = H - y;
2287
- const eased = [
2288
- [0, 0],
2289
- [0.33, 0.06],
2290
- [0.6, 0.18],
2291
- [0.8, 0.33],
2292
- [1, 0.55]
2293
- ];
2294
- return { y, height, stops: eased.map(([at, alpha]) => ({ at: Math.round(at * height), alpha })) };
2295
- }
2296
- function fadeFrom(end, H) {
2297
- if (end >= H)
2298
- return null;
2299
- const y = end + (FADE[0]?.[0] ?? 0);
2300
- const stops = FADE.filter(([at]) => end + at < H).map(([at, alpha]) => {
2301
- return { at: end + at - y, alpha };
2302
- });
2303
- return { y, height: H - y, stops: [...stops, { at: H - y, alpha: FADE_EDGE }] };
2334
+ return stops.at(-1)?.alpha ?? 0;
2304
2335
  }
2305
2336
  function sensorMiddle(id) {
2306
2337
  const sensor = BODIES[id]?.front.find((front) => front.kind === "sensor");
@@ -2309,19 +2340,21 @@ function sensorMiddle(id) {
2309
2340
  return { x: sensor.x + sensor.width / 2, y: sensor.y + sensor.height / 2, width: sensor.width };
2310
2341
  }
2311
2342
  var SAFARI_TEXT = { field: 17, pill: 13 };
2343
+ var SAFARI_PILL = { height: 32, size: SAFARI_TEXT.pill, pad: 33 };
2312
2344
  var BOTTOM_ROW = [0.1032, 0.3056, 0.4965, 0.6925, 0.8872];
2313
2345
  var TOP_ROW = [0.0884, 0.2986, 0.4962, 0.6994, 0.9012];
2314
2346
  var ROW = ["back", "forward", "share", "bookmarks", "tabs"];
2315
- function domainPill(W, top2) {
2347
+ function domainPill(x, top2, look = SAFARI_PILL) {
2348
+ const { height, size, pad } = look;
2316
2349
  return {
2317
2350
  kind: "pill",
2318
- x: W / 2,
2351
+ x,
2319
2352
  y: top2,
2320
2353
  width: 0,
2321
- height: 32,
2322
- radius: 16,
2354
+ height,
2355
+ radius: height / 2,
2323
2356
  marks: [],
2324
- text: { x: W / 2, y: top2 + 16, size: SAFARI_TEXT.pill }
2357
+ text: { x, y: top2 + height / 2, size, pad }
2325
2358
  };
2326
2359
  }
2327
2360
  function address(kind, box, page, reload) {
@@ -2334,6 +2367,74 @@ function address(kind, box, page, reload) {
2334
2367
  text: { x: box.x + box.width / 2, y, size: SAFARI_TEXT.field }
2335
2368
  };
2336
2369
  }
2370
+ function acrossRow(left2, right2, y) {
2371
+ const s = left2;
2372
+ const row = (x2, width2) => rect(x2, y, width2, 44);
2373
+ const end = row(right2 - 10 - 132, 132);
2374
+ const middle = y + 22;
2375
+ const [from, to] = [s + 66 + 44 + 8, end.x - 8];
2376
+ const width = Math.min(318, to - from);
2377
+ const x = Math.min(Math.max((left2 + right2) / 2 - width / 2, from), to - width);
2378
+ return [
2379
+ capsule("glass", row(s + 10, 44), [mark("back", s + 32, middle)]),
2380
+ capsule("glass", row(s + 66, 44), [mark("bookmarks", s + 88, middle)]),
2381
+ address("glass", row(x, width), 24, 22),
2382
+ capsule("glass", end, [
2383
+ mark("share", end.x + 22, middle),
2384
+ mark("plus", end.x + 66, middle),
2385
+ mark("tabs", end.x + 110, middle)
2386
+ ])
2387
+ ];
2388
+ }
2389
+ function duoRow(side, field, endX, end) {
2390
+ const y = DUO_ROW;
2391
+ const middle = y + 22;
2392
+ const row = (x, width) => rect(x, y, width, 44);
2393
+ return [
2394
+ capsule("glass", row(side + 10, 44), [mark("back", side + 32, middle)]),
2395
+ capsule("glass", row(side + 66, 44), [mark("bookmarks", side + 88, middle)]),
2396
+ address("glass", row(field.x, field.width), 22, 24.5),
2397
+ capsule("glass", row(endX, 44 * end.length), end.map((glyph, at) => mark(glyph, endX + 22 + 44 * at, middle)))
2398
+ ];
2399
+ }
2400
+ function duoCover(bars, W, H, orientation, minimized) {
2401
+ const c = DUO_COVER;
2402
+ if (orientation === "landscape") {
2403
+ const { across } = c;
2404
+ if (minimized)
2405
+ bars.shapes = [domainPill(W / 2, (across.minimized - DUO_PILL.height) / 2, DUO_PILL)];
2406
+ else
2407
+ bars.shapes = duoRow(across.side, across.address, W - across.end, ["share", "plus", "tabs"]);
2408
+ return bars;
2409
+ }
2410
+ const page = W - c.column;
2411
+ const x = W - c.axis;
2412
+ bars.column = { x, strip: false, time: { x, ...c.time }, ring: { ...c.ring } };
2413
+ if (minimized) {
2414
+ bars.shapes = [domainPill(page / 2, H - 46)];
2415
+ return bars;
2416
+ }
2417
+ const button = (y, glyph) => capsule("glass", rect(x - 24, y, 48, 48), [mark(glyph, x, y + 24)]);
2418
+ const [back = 0, reader = 0] = c.buttons;
2419
+ const low = H - c.gap - c.capsule;
2420
+ bars.shapes = [
2421
+ address("glass", rect(c.inset, H - c.gap - 48, page - 2 * c.inset, 48), 24, 24),
2422
+ button(back, "back"),
2423
+ button(reader, "bookmarks"),
2424
+ capsule("glass", rect(x - 24, low, 48, c.capsule), [mark("plus", x, low + 24), mark("tabs", x, H - c.gap - 24)])
2425
+ ];
2426
+ return bars;
2427
+ }
2428
+ function duoInner(bars, W, orientation, minimized) {
2429
+ const d = DUO_INNER;
2430
+ if (minimized) {
2431
+ bars.shapes = [domainPill(W / 2, d.pill, DUO_PILL)];
2432
+ return bars;
2433
+ }
2434
+ bars.column = { x: W - d.axis, strip: true, time: { ...d.time, x: W - d.time.x }, ring: { ...d.ring } };
2435
+ bars.shapes = duoRow(d.side, d.address[orientation], W - d.end, ["plus", "tabs"]);
2436
+ return bars;
2437
+ }
2337
2438
  function safariBars(device, spec, orientation, layout, minimized) {
2338
2439
  const { width: W, height: H } = turn(device, orientation);
2339
2440
  const bars = {
@@ -2343,38 +2444,29 @@ function safariBars(device, spec, orientation, layout, minimized) {
2343
2444
  orientation,
2344
2445
  minimized,
2345
2446
  status: null,
2447
+ column: null,
2346
2448
  shapes: [],
2347
2449
  chin: null,
2348
2450
  hairline: null,
2349
- fade: null,
2451
+ scrim: null,
2350
2452
  edge: false
2351
2453
  };
2454
+ if (spec.duo === "cover")
2455
+ return duoCover(bars, W, H, orientation, minimized);
2456
+ if (spec.duo === "inner")
2457
+ return duoInner(bars, W, orientation, minimized);
2352
2458
  if (orientation === "landscape") {
2353
- if (minimized)
2354
- return bars;
2355
- const s = spec.side;
2356
- const y = 10;
2357
- const row2 = (x, width) => rect(x, y, width, 44);
2358
- const right2 = row2(W - s - 10 - 132, 132);
2359
- const middle = y + 22;
2360
- bars.shapes = [
2361
- capsule("glass", row2(s + 10, 44), [mark("back", s + 32, middle)]),
2362
- capsule("glass", row2(s + 66, 44), [mark("bookmarks", s + 88, middle)]),
2363
- address("glass", row2((W - 318) / 2, 318), 24, 22),
2364
- capsule("glass", right2, [
2365
- mark("share", right2.x + 22, middle),
2366
- mark("plus", right2.x + 66, middle),
2367
- mark("tabs", right2.x + 110, middle)
2368
- ])
2369
- ];
2459
+ if (!minimized)
2460
+ bars.shapes = acrossRow(spec.side, W - spec.side, 10);
2370
2461
  return bars;
2371
2462
  }
2372
2463
  bars.status = safariStatus(device.id, spec, W);
2373
2464
  const page = viewportOf(device, orientation, layout, minimized);
2374
- bars.fade = fadeFrom(page.y + page.height, H);
2375
2465
  const T = spec.top;
2376
2466
  if (minimized) {
2377
- bars.shapes = [layout === "top" ? domainPill(W, T) : domainPill(W, H - 46)];
2467
+ bars.shapes = [domainPill(W / 2, layout === "top" ? T : H - 46)];
2468
+ const stops = SCRIM.map(([at, alpha]) => ({ at, alpha }));
2469
+ bars.scrim = { y: 0, height: 100, stops, at: { x: W / 2, y: page.y + 1 } };
2378
2470
  return bars;
2379
2471
  }
2380
2472
  if (layout === "compact") {
@@ -2383,7 +2475,7 @@ function safariBars(device, spec, orientation, layout, minimized) {
2383
2475
  bars.shapes = [
2384
2476
  capsule("glass", rect(34, y, 48, 48), [mark("back", 58, middle)]),
2385
2477
  address("glass", rect(90, y, W - 180, 48), 24, 22),
2386
- capsule("glass", rect(W - 82, y, 48, 48), [mark("more", W - 58, middle)])
2478
+ capsule("glass", rect(W - 82, y, 48, 48), [mark("tabs", W - 58, middle)])
2387
2479
  ];
2388
2480
  return bars;
2389
2481
  }
@@ -2421,29 +2513,35 @@ function safariStatus(id, spec, W) {
2421
2513
  height: spec.top,
2422
2514
  time: { x: W / 2, y: 10, size: 15 },
2423
2515
  icons: { x: 6, y: 10, align: "start" },
2424
- battery: { x: W - 7, y: 10 }
2516
+ battery: { x: W - 7, y: 10 },
2517
+ large: false
2425
2518
  };
2426
2519
  }
2520
+ const large = W >= 420;
2521
+ const size = large ? 19 : 18;
2427
2522
  if (!island) {
2428
2523
  const y = spec.top / 2 + 2;
2429
2524
  return {
2430
2525
  height: spec.top,
2431
- time: { x: 58, y, size: 17 },
2432
- icons: { x: W - 36, y, align: "end" }
2526
+ time: { x: 58, y, size },
2527
+ icons: { x: W - 36, y, align: "end" },
2528
+ large
2433
2529
  };
2434
2530
  }
2435
2531
  const left2 = island.x - island.width / 2;
2436
2532
  if (left2 > W / 2) {
2437
2533
  return {
2438
2534
  height: spec.top,
2439
- time: { x: 52, y: island.y, size: 17 },
2440
- icons: { x: left2 - 12, y: island.y, align: "end" }
2535
+ time: { x: 52, y: island.y, size },
2536
+ icons: { x: left2 - 12, y: island.y, align: "end" },
2537
+ large
2441
2538
  };
2442
2539
  }
2443
2540
  return {
2444
2541
  height: spec.top,
2445
- time: { x: left2 * 0.535, y: island.y, size: 17 },
2446
- icons: { x: W - 35.4, y: island.y, align: "end" }
2542
+ time: { x: spec.status?.time ?? left2 * 0.535, y: island.y, size },
2543
+ icons: { x: spec.status?.right ?? W - (large ? 38.33 : 32.33), y: island.y, align: "end" },
2544
+ large
2447
2545
  };
2448
2546
  }
2449
2547
  function chromeStatus(id, height, W, orientation) {
@@ -2453,7 +2551,8 @@ function chromeStatus(id, height, W, orientation) {
2453
2551
  return {
2454
2552
  height,
2455
2553
  time: { x: side, y, size: 14 },
2456
- icons: { x: W - side, y, align: "end" }
2554
+ icons: { x: W - side, y, align: "end" },
2555
+ large: false
2457
2556
  };
2458
2557
  }
2459
2558
  function chromeBars(device, spec, orientation, layout, minimized) {
@@ -2468,10 +2567,11 @@ function chromeBars(device, spec, orientation, layout, minimized) {
2468
2567
  orientation,
2469
2568
  minimized,
2470
2569
  status: chromeStatus(device.id, statusHeight, W, orientation),
2570
+ column: null,
2471
2571
  shapes: [],
2472
2572
  chin: null,
2473
2573
  hairline: null,
2474
- fade: null,
2574
+ scrim: null,
2475
2575
  edge: false
2476
2576
  };
2477
2577
  if (minimized)
@@ -2515,10 +2615,8 @@ function barsOf(device, orientation, layout, minimized, edge = false) {
2515
2615
  const safari = SAFARI[device.id];
2516
2616
  if (safari) {
2517
2617
  const bars = safariBars(device, safari, orientation, layout, minimized);
2518
- if (!edge)
2519
- return bars;
2520
- const { height: H } = turn(device, orientation);
2521
- return { ...bars, edge, fade: orientation === "portrait" ? edgeFade(bars, H) : null };
2618
+ const upright = orientation === "portrait" || safari.duo !== undefined;
2619
+ return { ...bars, edge: edge || upright };
2522
2620
  }
2523
2621
  const chrome = CHROME[device.id];
2524
2622
  if (chrome)
@@ -2538,6 +2636,10 @@ function barsStep(state, event) {
2538
2636
  if (event.type === "resize")
2539
2637
  return { ...state, lockUntil: event.time + BARS_LOCK };
2540
2638
  const { y, time } = event;
2639
+ const room = event.room ?? 0;
2640
+ const near = state.minimized && room > 0 && y - room <= BARS_TOP;
2641
+ if (near)
2642
+ return { ...state, minimized: false, y, anchor: y };
2541
2643
  if (time < state.lockUntil)
2542
2644
  return { ...state, y, anchor: y };
2543
2645
  if (y <= BARS_TOP)
@@ -2549,7 +2651,9 @@ function barsStep(state, event) {
2549
2651
  return { ...state, y, anchor: anchor2 };
2550
2652
  }
2551
2653
  const anchor = Math.min(state.anchor, y);
2552
- if (y - anchor >= BARS_DOWN)
2654
+ const left2 = room > 0 ? Math.min(y, event.rest ?? Infinity) : y;
2655
+ const clear = left2 - 2 * room >= BARS_DOWN;
2656
+ if (y - anchor >= BARS_DOWN && clear)
2553
2657
  return { ...state, minimized: true, y, anchor: y };
2554
2658
  return { ...state, y, anchor };
2555
2659
  }
@@ -2830,6 +2934,10 @@ function reset2(scope = globalThis) {
2830
2934
  }
2831
2935
 
2832
2936
  // src/engine/mock.ts
2937
+ function islandOf(id) {
2938
+ const sensor = BODIES[id]?.front.find((front) => front.kind === "sensor");
2939
+ return sensor && sensor.width > sensor.height ? sensor : null;
2940
+ }
2833
2941
  function round(kind, rect2) {
2834
2942
  return { kind, ...rect2, radius: Math.min(rect2.width, rect2.height) / 2 };
2835
2943
  }
@@ -2904,7 +3012,8 @@ function mockOf(id, orientation) {
2904
3012
  return key ? [shown, round("key", at(key))] : [shown];
2905
3013
  })
2906
3014
  ];
2907
- const upright = { width, height, inset: inset2, body, screenRadius, bodyRadius, parts };
3015
+ const continuous = islandOf(id) !== null;
3016
+ const upright = { width, height, inset: inset2, body, screenRadius, continuous, bodyRadius, parts };
2908
3017
  if (orientation === "portrait")
2909
3018
  return upright;
2910
3019
  const clockwise = device.clockwise === true;
@@ -3284,6 +3393,7 @@ function snapshotKey(knobs, view) {
3284
3393
  view.devicePixelRatio
3285
3394
  ]);
3286
3395
  }
3396
+ var RGB = /^rgb\(\d{1,3}, \d{1,3}, \d{1,3}\)$/;
3287
3397
  function lookOf(value) {
3288
3398
  if (typeof value !== "object" || value === null)
3289
3399
  return null;
@@ -3292,7 +3402,7 @@ function lookOf(value) {
3292
3402
  const scheme = read2("scheme");
3293
3403
  const host = read2("host");
3294
3404
  const flags = [read2("dark"), read2("canBack"), read2("canForward")];
3295
- if (typeof background !== "string" || !/^rgb\(\d{1,3}, \d{1,3}, \d{1,3}\)$/.test(background)) {
3405
+ if (typeof background !== "string" || !RGB.test(background)) {
3296
3406
  return null;
3297
3407
  }
3298
3408
  if (scheme !== "light" && scheme !== "dark" || typeof host !== "string")
@@ -3302,7 +3412,13 @@ function lookOf(value) {
3302
3412
  return null;
3303
3413
  if (typeof canForward !== "boolean")
3304
3414
  return null;
3305
- return { background, dark, scheme, host, canBack, canForward };
3415
+ const color = (key) => {
3416
+ const value2 = read2(key);
3417
+ return typeof value2 === "string" && RGB.test(value2) ? value2 : background;
3418
+ };
3419
+ const top2 = color("top");
3420
+ const bottom = color("bottom");
3421
+ return { background, top: top2, bottom, footer: read2("footer") === true, under: [], dark, scheme, host, canBack, canForward };
3306
3422
  }
3307
3423
  function readSnapshot(knobs, view) {
3308
3424
  try {
@@ -4260,13 +4376,60 @@ function destroy() {
4260
4376
  Reflect.deleteProperty(window, EARLY3);
4261
4377
  }
4262
4378
 
4379
+ // src/engine/screen.ts
4380
+ var KEYS2 = ["width", "height", "availWidth", "availHeight"];
4381
+ function screenSizeOf(state) {
4382
+ const device = formOf(state.device, state.posture);
4383
+ if (!device || device.kind !== "phone" && device.kind !== "tablet")
4384
+ return null;
4385
+ if (device.ua !== "iphone-safari")
4386
+ return turn(device, state.orientation);
4387
+ const { width, height } = turn(deviceOf(state.device) ?? device, "portrait");
4388
+ const across = device.postures !== undefined && state.posture !== "open" && state.orientation === "landscape";
4389
+ return across ? { width, height, availHeight: width } : { width, height };
4390
+ }
4391
+ var ORIGINALS = Symbol.for("devknobs.screen");
4392
+ function originalsOf(own) {
4393
+ const held = Reflect.get(own, ORIGINALS);
4394
+ return held instanceof Map ? held : undefined;
4395
+ }
4396
+ function apply5(size2, scope = globalThis) {
4397
+ const own = Reflect.get(scope, "screen");
4398
+ if (typeof own !== "object" || own === null)
4399
+ return;
4400
+ const originals2 = originalsOf(own);
4401
+ if (!size2) {
4402
+ if (!originals2)
4403
+ return;
4404
+ for (const [key, descriptor] of originals2) {
4405
+ if (descriptor)
4406
+ Object.defineProperty(own, key, descriptor);
4407
+ else
4408
+ Reflect.deleteProperty(own, key);
4409
+ }
4410
+ Reflect.deleteProperty(own, ORIGINALS);
4411
+ return;
4412
+ }
4413
+ if (!originals2) {
4414
+ const kept = new Map(KEYS2.map((key) => [key, Object.getOwnPropertyDescriptor(own, key)]));
4415
+ Object.defineProperty(own, ORIGINALS, { configurable: true, value: kept });
4416
+ }
4417
+ for (const key of KEYS2) {
4418
+ const value = key === "width" || key === "availWidth" ? size2.width : key === "availHeight" ? size2.availHeight ?? size2.height : size2.height;
4419
+ Object.defineProperty(own, key, { configurable: true, enumerable: true, get: () => value });
4420
+ }
4421
+ }
4422
+ function reset5() {
4423
+ apply5(null);
4424
+ }
4425
+
4263
4426
  // src/engine/scrollbars.ts
4264
4427
  var NAME2 = "scrollbars";
4265
4428
  var COMMIT_WAIT = 1000;
4266
4429
  var CSS2 = "*{scrollbar-width:none!important}::-webkit-scrollbar{display:none!important}";
4267
- function apply5(value) {
4430
+ function apply6(value) {
4268
4431
  if (!value) {
4269
- reset5();
4432
+ reset6();
4270
4433
  return;
4271
4434
  }
4272
4435
  ensureStyle(NAME2).textContent = CSS2;
@@ -4309,7 +4472,7 @@ function equip(view) {
4309
4472
  };
4310
4473
  channel.port2.postMessage(null);
4311
4474
  }
4312
- function reset5() {
4475
+ function reset6() {
4313
4476
  removeStyle(NAME2);
4314
4477
  }
4315
4478
 
@@ -4317,7 +4480,7 @@ function reset5() {
4317
4480
  var TOUCH_POINTS = 5;
4318
4481
  var handler = false;
4319
4482
  var points = false;
4320
- function apply6(value) {
4483
+ function apply7(value) {
4321
4484
  if (value.on && !handler && !("ontouchstart" in window)) {
4322
4485
  Object.defineProperty(window, "ontouchstart", {
4323
4486
  configurable: true,
@@ -4360,8 +4523,8 @@ function equip2(view, points2) {
4360
4523
  get: () => TOUCH_POINTS
4361
4524
  });
4362
4525
  }
4363
- function reset6() {
4364
- apply6({ on: false, points: false });
4526
+ function reset7() {
4527
+ apply7({ on: false, points: false });
4365
4528
  }
4366
4529
 
4367
4530
  // src/engine/touchmark.ts
@@ -4417,4 +4580,4 @@ function readMark(detail) {
4417
4580
  return finite(x) && finite(y) ? { at: { x, y }, pressed, held } : null;
4418
4581
  }
4419
4582
 
4420
- export { __export, __require, CLOCK_SPEED_MIN, CLOCK_SPEED_MAX, CLOCK_PRESETS, NativeDate, realNow, setClock, clockOn, now, wrapDate, NOW_READERS, temporalNow, readNow, takeOver, RINGS, SIDES, pxOf, boxModel, contentSize, hasBox, ringQuads, oneQuad, isPlain, alignQuads, ringPaths, luminance, parseColor, isCustomColor, toHex, readColor, POSTURES, openOf, DEVICES, deviceOf, formOf, formId, screenOf, hasTouch, turn, newer, stamped, FRESH_ATTRIBUTE, fresh, webStorage, loads, carried, ownReload, GEO_PRESETS, resolveGeo, apply, reset, ZOOM_PRESETS, ZOOM_MIN, ZOOM_MAX, percent, stepZoom, wheelZoom, anchorScroll, DEFAULT_PINNED, DEFAULT_STATE, SCHEMES, MOTIONS, CONTRASTS, TRANSPARENCIES, DIRS, GEO_ERRORS, CLOCK_MODES, ONLINES, CONNECTIONS, SAVE_DATAS, BARS, BROWSERS, ORIENTATIONS, EDGES, SIDES2 as SIDES1, VISIONS, GRAB_COLORS, resetState, merge, load, save, keepPlace, FRAME_ATTRIBUTE, FRAME_NAME, SIZE_MIN, SIZE_MAX, DPR_MIN, DPR_MAX, isDevknobsFrame, nativeScheme, handsSchemeDown, UNFRAMED, EXITED, knobFrame, needsFrame, plainFrame, frameForced, framed, readMessage, leaveFor, post, SHARED_VERSION, QUIET, shared2 as shared, share, evict, follow, keep, keepOwn, resume, systemMedia, watchSystemMedia, baseMatchMedia, still, ownInline, TEXT_MIN, TEXT_MAX, apply3 as apply1, reset3 as reset1, rewriteMediaText, authoredQuery, coarse, apply4 as apply2, destroy, platformOf, layoutOptions, layoutOf, viewportOf, endRoom, SAFARI_TEXT, barsOf, BARS_START, barsStep, turnSides, turnRadius, placeIn2 as placeIn, mockOf, UA_PRESETS, uaPreset, userAgentOf, apply2 as apply3, isMac, reset2, nativeViewport, inPage, framing, nativeEnabled, enableNative, handing, settles, drive, driveUa, release, styleNode, isOwnSheet, addStyle, findStyle, ensureStyle, removeStyle, apply5 as apply4, equip, reset5 as reset3, apply6 as apply5, equip2 as equip1, reset6 as reset4, DOT_LOOK, MARK_EVENT, readMark, MAT_COLORS2 as MAT_COLORS, MAT_COLOR_NAMES, matGradient, isMatName, putMat, Z_INDEX, snapshotKey, readSnapshot, keepDrawing, clearSnapshot, dropEarly, adoptEarly, stopAdopting };
4583
+ export { __export, __require, CLOCK_SPEED_MIN, CLOCK_SPEED_MAX, CLOCK_PRESETS, NativeDate, realNow, setClock, clockOn, now, wrapDate, NOW_READERS, temporalNow, readNow, takeOver, RINGS, SIDES, pxOf, boxModel, contentSize, hasBox, ringQuads, oneQuad, isPlain, alignQuads, ringPaths, luminance, parseColor, isCustomColor, toHex, parseHex, readColor, POSTURES, openOf, DEVICES, deviceOf, formOf, formId, screenOf, hasTouch, turn, newer, stamped, FRESH_ATTRIBUTE, fresh, webStorage, loads, carried, ownReload, GEO_PRESETS, resolveGeo, apply, reset, ZOOM_PRESETS, ZOOM_MIN, ZOOM_MAX, percent, stepZoom, wheelZoom, anchorScroll, DEFAULT_PINNED, DEFAULT_STATE, SCHEMES, MOTIONS, CONTRASTS, TRANSPARENCIES, DIRS, GEO_ERRORS, CLOCK_MODES, ONLINES, CONNECTIONS, SAVE_DATAS, BARS, BROWSERS, ORIENTATIONS, EDGES, SIDES2 as SIDES1, DEV_ICONS, VISIONS, GRAB_COLORS, resetState, merge, load, save, keepPlace, FRAME_ATTRIBUTE, FRAME_NAME, SIZE_MIN, SIZE_MAX, DPR_MIN, DPR_MAX, isDevknobsFrame, nativeScheme, handsSchemeDown, UNFRAMED, EXITED, knobFrame, needsFrame, plainFrame, frameForced, framed, readMessage, leaveFor, post, SHARED_VERSION, QUIET, shared2 as shared, share, evict, follow, keep, keepOwn, resume, systemMedia, watchSystemMedia, baseMatchMedia, still, ownInline, TEXT_MIN, TEXT_MAX, apply3 as apply1, reset3 as reset1, rewriteMediaText, authoredQuery, coarse, apply4 as apply2, destroy, runsUnderBars, platformOf, layoutOptions, layoutOf, viewportOf, alphaAt, SAFARI_TEXT, barsOf, BARS_START, barsStep, islandOf, round, turnRect, turnSides, turnRadius, placeIn2 as placeIn, mockOf, UA_PRESETS, uaPreset, userAgentOf, apply2 as apply3, isMac, reset2, nativeViewport, inPage, framing, nativeEnabled, enableNative, handing, settles, drive, driveUa, release, styleNode, isOwnSheet, addStyle, ensureStyle, removeStyle, screenSizeOf, apply5 as apply4, reset5 as reset3, apply6 as apply5, equip, reset6 as reset4, apply7 as apply6, equip2 as equip1, reset7 as reset5, DOT_LOOK, MARK_EVENT, readMark, MAT_COLORS2 as MAT_COLORS, MAT_COLOR_NAMES, matGradient, isMatName, putMat, Z_INDEX, snapshotKey, readSnapshot, keepDrawing, clearSnapshot, dropEarly, adoptEarly, stopAdopting };