@vinena/knobs 0.5.1 → 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 (59) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +7 -0
  3. package/dist/early.global.js +6 -6
  4. package/dist/{elementsview-jnkbhzkj.js → elementsview-2z4pkrdz.js} +4 -4
  5. package/dist/{elementsview-tf4qzmtw.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-zvze25nf.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-ke6v7919.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-k015tb6c.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-sq9pkw4k.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-eygws6cx.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-vf8v8q8j.js → storageview-r595qpt9.js} +4 -4
  51. package/dist/{storageview-sb23henh.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/engine/endroom.d.ts +0 -21
@@ -56,7 +56,7 @@ var DEVICES = [
56
56
  touch: true,
57
57
  kind: "phone",
58
58
  postures: {
59
- closed: { id: "iphone-duo-closed", label: "iPhone Duo (closed)" },
59
+ closed: { id: "iphone-duo-closed", label: "iPhone Duo (closed)", clockwise: true },
60
60
  open: {
61
61
  id: "iphone-duo-open",
62
62
  label: "iPhone Duo (open)",
@@ -1338,6 +1338,7 @@ var DEFAULT_STATE = {
1338
1338
  tab: "top",
1339
1339
  docked: false,
1340
1340
  handle: true,
1341
+ devIcon: "auto",
1341
1342
  pinned: [...DEFAULT_PINNED]
1342
1343
  }
1343
1344
  };
@@ -1356,6 +1357,7 @@ var BROWSERS = ["auto", "compact", "bottom", "top", "off"];
1356
1357
  var ORIENTATIONS = ["portrait", "landscape"];
1357
1358
  var EDGES = ["top", "bottom", "none"];
1358
1359
  var SIDES2 = ["left", "right"];
1360
+ var DEV_ICONS = ["auto", "on", "off"];
1359
1361
  var VISIONS = [
1360
1362
  "none",
1361
1363
  "protanopia",
@@ -1508,6 +1510,7 @@ function parse(json, place) {
1508
1510
  open: bool(panel.open, DEFAULT_STATE.panel.open),
1509
1511
  ...placeOf(panel, home),
1510
1512
  handle: bool(panel.handle, DEFAULT_STATE.panel.handle),
1513
+ devIcon: oneOf(panel.devIcon, DEV_ICONS, DEFAULT_STATE.panel.devIcon),
1511
1514
  pinned: state.panel === undefined ? [...DEFAULT_PINNED] : rowIds(panel.pinned)
1512
1515
  }
1513
1516
  };
@@ -3109,10 +3112,10 @@ var BODIES = {
3109
3112
  },
3110
3113
  "iphone-air": {
3111
3114
  bezel: sides2(15.3, 15.3, 15.3, 15.3),
3112
- screenRadius: 62,
3115
+ screenRadius: 65,
3113
3116
  bodyRadius: 77.3,
3114
3117
  out: 2.7,
3115
- front: [pill("sensor", 147.8, 20.4, 124.6, 36)],
3118
+ front: [pill("sensor", 147.33, 20, 125.33, 36.67)],
3116
3119
  buttons: [left(185, 41.7), left(257.3, 67.7), left(343, 67.7), right(280.7, 106.7, 3)]
3117
3120
  },
3118
3121
  "iphone-17": {
@@ -3120,7 +3123,7 @@ var BODIES = {
3120
3123
  screenRadius: 62,
3121
3124
  bodyRadius: 76.7,
3122
3125
  out: 3,
3123
- front: [pill("sensor", 138.8, 14.3, 124.5, 35.9)],
3126
+ front: [pill("sensor", 138.33, 14, 125.33, 36.67)],
3124
3127
  buttons: [left(185, 41.7), left(257.3, 67.7), left(342.7, 68), right(280.3, 107, 2.7)]
3125
3128
  },
3126
3129
  "iphone-17-pro": {
@@ -3128,7 +3131,7 @@ var BODIES = {
3128
3131
  screenRadius: 62,
3129
3132
  bodyRadius: 77.7,
3130
3133
  out: 3,
3131
- front: [pill("sensor", 138.8, 14.4, 124.4, 35.8)],
3134
+ front: [pill("sensor", 138.33, 14, 125.33, 36.67)],
3132
3135
  buttons: [left(186, 41.7), left(258.3, 67.7), left(344, 67.7), right(281.7, 107, 2.7)]
3133
3136
  },
3134
3137
  "iphone-17-pro-max": {
@@ -3136,7 +3139,7 @@ var BODIES = {
3136
3139
  screenRadius: 62,
3137
3140
  bodyRadius: 77.3,
3138
3141
  out: 2.7,
3139
- front: [pill("sensor", 157.8, 14.5, 124.4, 35.8)],
3142
+ front: [pill("sensor", 157.33, 14, 125.33, 36.67)],
3140
3143
  buttons: [left(186.3, 41.7), left(258.7, 67.7), left(344.3, 67.7), right(282, 106.7)]
3141
3144
  },
3142
3145
  "iphone-16": {
@@ -3160,7 +3163,7 @@ var BODIES = {
3160
3163
  screenRadius: 62,
3161
3164
  bodyRadius: 77.9,
3162
3165
  out: 2.7,
3163
- front: [pill("sensor", 138.4, 13.5, 125.2, 36.7)],
3166
+ front: [pill("sensor", 138.33, 14, 125.33, 36.67)],
3164
3167
  buttons: [...IPHONE_LEFT, ...iphoneRight(541.3)]
3165
3168
  },
3166
3169
  "iphone-16-pro-max": {
@@ -3270,19 +3273,57 @@ var LAYOUTS = {
3270
3273
  safari: ["compact", "bottom", "top", "off"],
3271
3274
  chrome: ["top", "bottom", "off"]
3272
3275
  };
3276
+ var DUO_COVER = {
3277
+ column: 84,
3278
+ bottom: 98,
3279
+ minimized: 60,
3280
+ axis: 48,
3281
+ time: { y: 91.5, size: 15.75 },
3282
+ ring: { y: 129.9, radius: 18.9, stroke: 3.5 },
3283
+ buttons: [174.2, 234.2],
3284
+ capsule: 102,
3285
+ gap: 34,
3286
+ inset: 24,
3287
+ across: {
3288
+ top: 80,
3289
+ minimized: 26,
3290
+ side: 7.33,
3291
+ address: { x: 209, width: 260 },
3292
+ end: 149.33
3293
+ }
3294
+ };
3295
+ var DUO_INNER = {
3296
+ top: 80,
3297
+ minimized: 51,
3298
+ axis: 47.67,
3299
+ time: { x: 99.83, y: 47.4, size: 15.75 },
3300
+ ring: { y: 47.9, radius: 18.9, stroke: 3.5 },
3301
+ side: 6,
3302
+ address: { landscape: { x: 295, width: 361 }, portrait: { x: 184, width: 241.5 } },
3303
+ end: 232,
3304
+ pill: 23.5
3305
+ };
3306
+ var DUO_ROW = 26;
3307
+ var DUO_PILL = { height: 20, size: 12, pad: 15 };
3308
+ function runsUnderBars(id) {
3309
+ return !SAFARI2[id]?.duo;
3310
+ }
3311
+ var DUO_LAYOUTS = ["compact", "off"];
3312
+ var STATUS_PRO = { time: 73.83, right: 369.67 };
3313
+ var STATUS_MAX = { time: 83.17, right: 401.67 };
3273
3314
  var SAFARI2 = {
3274
3315
  "iphone-18-pro": { top: 62, side: 62, faceId: true },
3275
3316
  "iphone-18-pro-max": { top: 62, side: 62, faceId: true },
3276
- "iphone-duo-closed": { top: 82, side: 82, faceId: true },
3277
- "iphone-duo-open": { top: 40, side: 24, faceId: true },
3278
- "iphone-air": { top: 68, side: 68, faceId: true },
3279
- "iphone-17": { top: 62, side: 62, faceId: true },
3280
- "iphone-17-pro": { top: 62, side: 62, faceId: true },
3281
- "iphone-17-pro-max": { top: 62, side: 62, faceId: true },
3317
+ "iphone-duo-closed": { top: 0, side: 0, faceId: true, duo: "cover" },
3318
+ "iphone-duo-open": { top: DUO_INNER.top, side: 0, faceId: true, duo: "inner" },
3319
+ "iphone-air": { top: 68, side: 68, faceId: true, status: { time: 77.17, right: 387.67 } },
3320
+ "iphone-17": { top: 62, side: 62, faceId: true, status: STATUS_PRO },
3321
+ "iphone-17-pro": { top: 62, side: 62, faceId: true, status: STATUS_PRO },
3322
+ "iphone-17-pro-max": { top: 62, side: 62, faceId: true, status: STATUS_MAX },
3282
3323
  "iphone-16": { top: 59, side: 59, faceId: true },
3283
3324
  "iphone-16-plus": { top: 59, side: 59, faceId: true },
3284
- "iphone-16-pro": { top: 62, side: 62, faceId: true },
3285
- "iphone-16-pro-max": { top: 62, side: 62, faceId: true },
3325
+ "iphone-16-pro": { top: 62, side: 62, faceId: true, status: STATUS_PRO },
3326
+ "iphone-16-pro-max": { top: 62, side: 62, faceId: true, status: STATUS_MAX },
3286
3327
  "iphone-se": { top: 20, side: 0, faceId: false }
3287
3328
  };
3288
3329
  var CHROME2 = {
@@ -3313,6 +3354,8 @@ function platformOf(id) {
3313
3354
  return null;
3314
3355
  }
3315
3356
  function layoutOptions(id) {
3357
+ if (SAFARI2[id]?.duo)
3358
+ return DUO_LAYOUTS;
3316
3359
  const platform = platformOf(id);
3317
3360
  return platform ? LAYOUTS[platform] : [];
3318
3361
  }
@@ -3332,10 +3375,22 @@ function viewportOf(device, orientation, layout, minimized, edge = false) {
3332
3375
  if (!layout || layout === "off")
3333
3376
  return whole;
3334
3377
  const safari = SAFARI2[device.id];
3378
+ if (safari?.duo === "cover" && orientation === "landscape") {
3379
+ const { across } = DUO_COVER;
3380
+ const top2 = minimized ? across.minimized : across.top;
3381
+ return rect(0, top2, W, H - top2);
3382
+ }
3383
+ if (safari?.duo === "cover") {
3384
+ const bottom = minimized ? DUO_COVER.minimized : DUO_COVER.bottom;
3385
+ return rect(0, 0, W - DUO_COVER.column, H - bottom);
3386
+ }
3387
+ if (safari?.duo === "inner") {
3388
+ const top2 = minimized ? DUO_INNER.minimized : DUO_INNER.top;
3389
+ return rect(0, top2, W, H - top2);
3390
+ }
3335
3391
  if (safari) {
3336
- if (edge) {
3337
- return orientation === "landscape" ? rect(safari.side, 0, W - 2 * safari.side, H) : rect(0, safari.top, W, H - safari.top);
3338
- }
3392
+ if (edge && orientation === "landscape")
3393
+ return rect(safari.side, 0, W - 2 * safari.side, H);
3339
3394
  if (orientation === "landscape") {
3340
3395
  const top2 = minimized ? 0 : SAFARI_BARS.landscape;
3341
3396
  return rect(safari.side, top2, W - 2 * safari.side, H - top2);
@@ -3363,58 +3418,34 @@ function viewportOf(device, orientation, layout, minimized, edge = false) {
3363
3418
  const height = tall - chrome.top - toolbar - chin;
3364
3419
  return rect(0, chrome.top + (layout === "top" ? toolbar : 0), W, height);
3365
3420
  }
3366
- function endRoom(device, orientation, layout, minimized, edge) {
3367
- if (!edge)
3368
- return 0;
3369
- const drawn = viewportOf(device, orientation, layout, minimized, true);
3370
- const real = viewportOf(device, orientation, layout, minimized);
3371
- return drawn.y + drawn.height - (real.y + real.height);
3372
- }
3373
3421
  function capsule(kind, box, marks = []) {
3374
3422
  return { kind, ...box, radius: Math.min(box.width, box.height) / 2, marks };
3375
3423
  }
3376
3424
  function mark(glyph, x, y) {
3377
3425
  return { glyph, x, y };
3378
3426
  }
3379
- var FADE = [
3380
- [-64, 0],
3381
- [-52, 0.05],
3382
- [-40, 0.12],
3383
- [-28, 0.24],
3384
- [-18, 0.4],
3385
- [-9, 0.6],
3386
- [0, 0.85]
3427
+ var SCRIM = [
3428
+ [0, 0.81],
3429
+ [20, 0.67],
3430
+ [40, 0.41],
3431
+ [60, 0.16],
3432
+ [80, 0.03],
3433
+ [100, 0]
3387
3434
  ];
3388
- var FADE_EDGE = 0.92;
3389
- function edgeFade(bars, H) {
3390
- const low = bars.shapes.filter((shape) => shape.kind !== "pill" && shape.y > H / 2);
3391
- if (bars.minimized || low.length === 0) {
3392
- const stops = [
3393
- { at: 0, alpha: 0 },
3394
- { at: 12, alpha: 0.12 },
3395
- { at: 24, alpha: 0.35 }
3396
- ];
3397
- return { y: H - 24, height: 24, stops };
3435
+ function alphaAt(fade, y) {
3436
+ const at = y - fade.y;
3437
+ const { stops } = fade;
3438
+ const first = stops[0];
3439
+ if (!first || at <= first.at)
3440
+ return first?.alpha ?? 0;
3441
+ for (let i = 1;i < stops.length; i++) {
3442
+ const from = stops[i - 1];
3443
+ const to = stops[i];
3444
+ if (!from || !to || at > to.at)
3445
+ continue;
3446
+ return from.alpha + (to.alpha - from.alpha) * (at - from.at) / (to.at - from.at || 1);
3398
3447
  }
3399
- const y = Math.min(...low.map((shape) => shape.y)) - 40;
3400
- const height = H - y;
3401
- const eased = [
3402
- [0, 0],
3403
- [0.33, 0.06],
3404
- [0.6, 0.18],
3405
- [0.8, 0.33],
3406
- [1, 0.55]
3407
- ];
3408
- return { y, height, stops: eased.map(([at, alpha]) => ({ at: Math.round(at * height), alpha })) };
3409
- }
3410
- function fadeFrom(end, H) {
3411
- if (end >= H)
3412
- return null;
3413
- const y = end + (FADE[0]?.[0] ?? 0);
3414
- const stops = FADE.filter(([at]) => end + at < H).map(([at, alpha]) => {
3415
- return { at: end + at - y, alpha };
3416
- });
3417
- return { y, height: H - y, stops: [...stops, { at: H - y, alpha: FADE_EDGE }] };
3448
+ return stops.at(-1)?.alpha ?? 0;
3418
3449
  }
3419
3450
  function sensorMiddle(id) {
3420
3451
  const sensor = BODIES[id]?.front.find((front) => front.kind === "sensor");
@@ -3423,19 +3454,21 @@ function sensorMiddle(id) {
3423
3454
  return { x: sensor.x + sensor.width / 2, y: sensor.y + sensor.height / 2, width: sensor.width };
3424
3455
  }
3425
3456
  var SAFARI_TEXT = { field: 17, pill: 13 };
3457
+ var SAFARI_PILL = { height: 32, size: SAFARI_TEXT.pill, pad: 33 };
3426
3458
  var BOTTOM_ROW = [0.1032, 0.3056, 0.4965, 0.6925, 0.8872];
3427
3459
  var TOP_ROW = [0.0884, 0.2986, 0.4962, 0.6994, 0.9012];
3428
3460
  var ROW = ["back", "forward", "share", "bookmarks", "tabs"];
3429
- function domainPill(W, top2) {
3461
+ function domainPill(x, top2, look = SAFARI_PILL) {
3462
+ const { height, size: size2, pad } = look;
3430
3463
  return {
3431
3464
  kind: "pill",
3432
- x: W / 2,
3465
+ x,
3433
3466
  y: top2,
3434
3467
  width: 0,
3435
- height: 32,
3436
- radius: 16,
3468
+ height,
3469
+ radius: height / 2,
3437
3470
  marks: [],
3438
- text: { x: W / 2, y: top2 + 16, size: SAFARI_TEXT.pill }
3471
+ text: { x, y: top2 + height / 2, size: size2, pad }
3439
3472
  };
3440
3473
  }
3441
3474
  function address(kind, box, page, reload) {
@@ -3448,6 +3481,74 @@ function address(kind, box, page, reload) {
3448
3481
  text: { x: box.x + box.width / 2, y, size: SAFARI_TEXT.field }
3449
3482
  };
3450
3483
  }
3484
+ function acrossRow(left2, right2, y) {
3485
+ const s = left2;
3486
+ const row = (x2, width2) => rect(x2, y, width2, 44);
3487
+ const end = row(right2 - 10 - 132, 132);
3488
+ const middle = y + 22;
3489
+ const [from, to] = [s + 66 + 44 + 8, end.x - 8];
3490
+ const width = Math.min(318, to - from);
3491
+ const x = Math.min(Math.max((left2 + right2) / 2 - width / 2, from), to - width);
3492
+ return [
3493
+ capsule("glass", row(s + 10, 44), [mark("back", s + 32, middle)]),
3494
+ capsule("glass", row(s + 66, 44), [mark("bookmarks", s + 88, middle)]),
3495
+ address("glass", row(x, width), 24, 22),
3496
+ capsule("glass", end, [
3497
+ mark("share", end.x + 22, middle),
3498
+ mark("plus", end.x + 66, middle),
3499
+ mark("tabs", end.x + 110, middle)
3500
+ ])
3501
+ ];
3502
+ }
3503
+ function duoRow(side, field, endX, end) {
3504
+ const y = DUO_ROW;
3505
+ const middle = y + 22;
3506
+ const row = (x, width) => rect(x, y, width, 44);
3507
+ return [
3508
+ capsule("glass", row(side + 10, 44), [mark("back", side + 32, middle)]),
3509
+ capsule("glass", row(side + 66, 44), [mark("bookmarks", side + 88, middle)]),
3510
+ address("glass", row(field.x, field.width), 22, 24.5),
3511
+ capsule("glass", row(endX, 44 * end.length), end.map((glyph, at) => mark(glyph, endX + 22 + 44 * at, middle)))
3512
+ ];
3513
+ }
3514
+ function duoCover(bars, W, H, orientation, minimized) {
3515
+ const c = DUO_COVER;
3516
+ if (orientation === "landscape") {
3517
+ const { across } = c;
3518
+ if (minimized)
3519
+ bars.shapes = [domainPill(W / 2, (across.minimized - DUO_PILL.height) / 2, DUO_PILL)];
3520
+ else
3521
+ bars.shapes = duoRow(across.side, across.address, W - across.end, ["share", "plus", "tabs"]);
3522
+ return bars;
3523
+ }
3524
+ const page = W - c.column;
3525
+ const x = W - c.axis;
3526
+ bars.column = { x, strip: false, time: { x, ...c.time }, ring: { ...c.ring } };
3527
+ if (minimized) {
3528
+ bars.shapes = [domainPill(page / 2, H - 46)];
3529
+ return bars;
3530
+ }
3531
+ const button = (y, glyph) => capsule("glass", rect(x - 24, y, 48, 48), [mark(glyph, x, y + 24)]);
3532
+ const [back = 0, reader = 0] = c.buttons;
3533
+ const low = H - c.gap - c.capsule;
3534
+ bars.shapes = [
3535
+ address("glass", rect(c.inset, H - c.gap - 48, page - 2 * c.inset, 48), 24, 24),
3536
+ button(back, "back"),
3537
+ button(reader, "bookmarks"),
3538
+ capsule("glass", rect(x - 24, low, 48, c.capsule), [mark("plus", x, low + 24), mark("tabs", x, H - c.gap - 24)])
3539
+ ];
3540
+ return bars;
3541
+ }
3542
+ function duoInner(bars, W, orientation, minimized) {
3543
+ const d = DUO_INNER;
3544
+ if (minimized) {
3545
+ bars.shapes = [domainPill(W / 2, d.pill, DUO_PILL)];
3546
+ return bars;
3547
+ }
3548
+ bars.column = { x: W - d.axis, strip: true, time: { ...d.time, x: W - d.time.x }, ring: { ...d.ring } };
3549
+ bars.shapes = duoRow(d.side, d.address[orientation], W - d.end, ["plus", "tabs"]);
3550
+ return bars;
3551
+ }
3451
3552
  function safariBars(device, spec, orientation, layout, minimized) {
3452
3553
  const { width: W, height: H } = turn(device, orientation);
3453
3554
  const bars = {
@@ -3457,38 +3558,29 @@ function safariBars(device, spec, orientation, layout, minimized) {
3457
3558
  orientation,
3458
3559
  minimized,
3459
3560
  status: null,
3561
+ column: null,
3460
3562
  shapes: [],
3461
3563
  chin: null,
3462
3564
  hairline: null,
3463
- fade: null,
3565
+ scrim: null,
3464
3566
  edge: false
3465
3567
  };
3568
+ if (spec.duo === "cover")
3569
+ return duoCover(bars, W, H, orientation, minimized);
3570
+ if (spec.duo === "inner")
3571
+ return duoInner(bars, W, orientation, minimized);
3466
3572
  if (orientation === "landscape") {
3467
- if (minimized)
3468
- return bars;
3469
- const s = spec.side;
3470
- const y = 10;
3471
- const row2 = (x, width) => rect(x, y, width, 44);
3472
- const right2 = row2(W - s - 10 - 132, 132);
3473
- const middle = y + 22;
3474
- bars.shapes = [
3475
- capsule("glass", row2(s + 10, 44), [mark("back", s + 32, middle)]),
3476
- capsule("glass", row2(s + 66, 44), [mark("bookmarks", s + 88, middle)]),
3477
- address("glass", row2((W - 318) / 2, 318), 24, 22),
3478
- capsule("glass", right2, [
3479
- mark("share", right2.x + 22, middle),
3480
- mark("plus", right2.x + 66, middle),
3481
- mark("tabs", right2.x + 110, middle)
3482
- ])
3483
- ];
3573
+ if (!minimized)
3574
+ bars.shapes = acrossRow(spec.side, W - spec.side, 10);
3484
3575
  return bars;
3485
3576
  }
3486
3577
  bars.status = safariStatus(device.id, spec, W);
3487
3578
  const page = viewportOf(device, orientation, layout, minimized);
3488
- bars.fade = fadeFrom(page.y + page.height, H);
3489
3579
  const T = spec.top;
3490
3580
  if (minimized) {
3491
- bars.shapes = [layout === "top" ? domainPill(W, T) : domainPill(W, H - 46)];
3581
+ bars.shapes = [domainPill(W / 2, layout === "top" ? T : H - 46)];
3582
+ const stops = SCRIM.map(([at, alpha]) => ({ at, alpha }));
3583
+ bars.scrim = { y: 0, height: 100, stops, at: { x: W / 2, y: page.y + 1 } };
3492
3584
  return bars;
3493
3585
  }
3494
3586
  if (layout === "compact") {
@@ -3497,7 +3589,7 @@ function safariBars(device, spec, orientation, layout, minimized) {
3497
3589
  bars.shapes = [
3498
3590
  capsule("glass", rect(34, y, 48, 48), [mark("back", 58, middle)]),
3499
3591
  address("glass", rect(90, y, W - 180, 48), 24, 22),
3500
- capsule("glass", rect(W - 82, y, 48, 48), [mark("more", W - 58, middle)])
3592
+ capsule("glass", rect(W - 82, y, 48, 48), [mark("tabs", W - 58, middle)])
3501
3593
  ];
3502
3594
  return bars;
3503
3595
  }
@@ -3535,29 +3627,35 @@ function safariStatus(id, spec, W) {
3535
3627
  height: spec.top,
3536
3628
  time: { x: W / 2, y: 10, size: 15 },
3537
3629
  icons: { x: 6, y: 10, align: "start" },
3538
- battery: { x: W - 7, y: 10 }
3630
+ battery: { x: W - 7, y: 10 },
3631
+ large: false
3539
3632
  };
3540
3633
  }
3634
+ const large = W >= 420;
3635
+ const size2 = large ? 19 : 18;
3541
3636
  if (!island) {
3542
3637
  const y = spec.top / 2 + 2;
3543
3638
  return {
3544
3639
  height: spec.top,
3545
- time: { x: 58, y, size: 17 },
3546
- icons: { x: W - 36, y, align: "end" }
3640
+ time: { x: 58, y, size: size2 },
3641
+ icons: { x: W - 36, y, align: "end" },
3642
+ large
3547
3643
  };
3548
3644
  }
3549
3645
  const left2 = island.x - island.width / 2;
3550
3646
  if (left2 > W / 2) {
3551
3647
  return {
3552
3648
  height: spec.top,
3553
- time: { x: 52, y: island.y, size: 17 },
3554
- icons: { x: left2 - 12, y: island.y, align: "end" }
3649
+ time: { x: 52, y: island.y, size: size2 },
3650
+ icons: { x: left2 - 12, y: island.y, align: "end" },
3651
+ large
3555
3652
  };
3556
3653
  }
3557
3654
  return {
3558
3655
  height: spec.top,
3559
- time: { x: left2 * 0.535, y: island.y, size: 17 },
3560
- icons: { x: W - 35.4, y: island.y, align: "end" }
3656
+ time: { x: spec.status?.time ?? left2 * 0.535, y: island.y, size: size2 },
3657
+ icons: { x: spec.status?.right ?? W - (large ? 38.33 : 32.33), y: island.y, align: "end" },
3658
+ large
3561
3659
  };
3562
3660
  }
3563
3661
  function chromeStatus(id, height, W, orientation) {
@@ -3567,7 +3665,8 @@ function chromeStatus(id, height, W, orientation) {
3567
3665
  return {
3568
3666
  height,
3569
3667
  time: { x: side, y, size: 14 },
3570
- icons: { x: W - side, y, align: "end" }
3668
+ icons: { x: W - side, y, align: "end" },
3669
+ large: false
3571
3670
  };
3572
3671
  }
3573
3672
  function chromeBars(device, spec, orientation, layout, minimized) {
@@ -3582,10 +3681,11 @@ function chromeBars(device, spec, orientation, layout, minimized) {
3582
3681
  orientation,
3583
3682
  minimized,
3584
3683
  status: chromeStatus(device.id, statusHeight, W, orientation),
3684
+ column: null,
3585
3685
  shapes: [],
3586
3686
  chin: null,
3587
3687
  hairline: null,
3588
- fade: null,
3688
+ scrim: null,
3589
3689
  edge: false
3590
3690
  };
3591
3691
  if (minimized)
@@ -3629,10 +3729,8 @@ function barsOf(device, orientation, layout, minimized, edge = false) {
3629
3729
  const safari = SAFARI2[device.id];
3630
3730
  if (safari) {
3631
3731
  const bars = safariBars(device, safari, orientation, layout, minimized);
3632
- if (!edge)
3633
- return bars;
3634
- const { height: H } = turn(device, orientation);
3635
- return { ...bars, edge, fade: orientation === "portrait" ? edgeFade(bars, H) : null };
3732
+ const upright = orientation === "portrait" || safari.duo !== undefined;
3733
+ return { ...bars, edge: edge || upright };
3636
3734
  }
3637
3735
  const chrome = CHROME2[device.id];
3638
3736
  if (chrome)
@@ -3652,6 +3750,10 @@ function barsStep(state, event) {
3652
3750
  if (event.type === "resize")
3653
3751
  return { ...state, lockUntil: event.time + BARS_LOCK };
3654
3752
  const { y, time } = event;
3753
+ const room = event.room ?? 0;
3754
+ const near = state.minimized && room > 0 && y - room <= BARS_TOP;
3755
+ if (near)
3756
+ return { ...state, minimized: false, y, anchor: y };
3655
3757
  if (time < state.lockUntil)
3656
3758
  return { ...state, y, anchor: y };
3657
3759
  if (y <= BARS_TOP)
@@ -3663,12 +3765,18 @@ function barsStep(state, event) {
3663
3765
  return { ...state, y, anchor: anchor2 };
3664
3766
  }
3665
3767
  const anchor = Math.min(state.anchor, y);
3666
- if (y - anchor >= BARS_DOWN)
3768
+ const left2 = room > 0 ? Math.min(y, event.rest ?? Infinity) : y;
3769
+ const clear = left2 - 2 * room >= BARS_DOWN;
3770
+ if (y - anchor >= BARS_DOWN && clear)
3667
3771
  return { ...state, minimized: true, y, anchor: y };
3668
3772
  return { ...state, y, anchor };
3669
3773
  }
3670
3774
 
3671
3775
  // src/engine/mock.ts
3776
+ function islandOf(id) {
3777
+ const sensor = BODIES[id]?.front.find((front) => front.kind === "sensor");
3778
+ return sensor && sensor.width > sensor.height ? sensor : null;
3779
+ }
3672
3780
  function round(kind, rect2) {
3673
3781
  return { kind, ...rect2, radius: Math.min(rect2.width, rect2.height) / 2 };
3674
3782
  }
@@ -3743,7 +3851,8 @@ function mockOf(id, orientation) {
3743
3851
  return key ? [shown, round("key", at(key))] : [shown];
3744
3852
  })
3745
3853
  ];
3746
- const upright = { width, height, inset: inset2, body, screenRadius, bodyRadius, parts };
3854
+ const continuous = islandOf(id) !== null;
3855
+ const upright = { width, height, inset: inset2, body, screenRadius, continuous, bodyRadius, parts };
3747
3856
  if (orientation === "portrait")
3748
3857
  return upright;
3749
3858
  const clockwise = device.clockwise === true;
@@ -3971,13 +4080,60 @@ function removeStyle(name, doc = document) {
3971
4080
  findStyle(name, doc)?.remove();
3972
4081
  }
3973
4082
 
4083
+ // src/engine/screen.ts
4084
+ var KEYS2 = ["width", "height", "availWidth", "availHeight"];
4085
+ function screenSizeOf(state) {
4086
+ const device = formOf(state.device, state.posture);
4087
+ if (!device || device.kind !== "phone" && device.kind !== "tablet")
4088
+ return null;
4089
+ if (device.ua !== "iphone-safari")
4090
+ return turn(device, state.orientation);
4091
+ const { width, height } = turn(deviceOf(state.device) ?? device, "portrait");
4092
+ const across = device.postures !== undefined && state.posture !== "open" && state.orientation === "landscape";
4093
+ return across ? { width, height, availHeight: width } : { width, height };
4094
+ }
4095
+ var ORIGINALS = Symbol.for("devknobs.screen");
4096
+ function originalsOf(own) {
4097
+ const held = Reflect.get(own, ORIGINALS);
4098
+ return held instanceof Map ? held : undefined;
4099
+ }
4100
+ function apply5(size2, scope = globalThis) {
4101
+ const own = Reflect.get(scope, "screen");
4102
+ if (typeof own !== "object" || own === null)
4103
+ return;
4104
+ const originals2 = originalsOf(own);
4105
+ if (!size2) {
4106
+ if (!originals2)
4107
+ return;
4108
+ for (const [key, descriptor] of originals2) {
4109
+ if (descriptor)
4110
+ Object.defineProperty(own, key, descriptor);
4111
+ else
4112
+ Reflect.deleteProperty(own, key);
4113
+ }
4114
+ Reflect.deleteProperty(own, ORIGINALS);
4115
+ return;
4116
+ }
4117
+ if (!originals2) {
4118
+ const kept = new Map(KEYS2.map((key) => [key, Object.getOwnPropertyDescriptor(own, key)]));
4119
+ Object.defineProperty(own, ORIGINALS, { configurable: true, value: kept });
4120
+ }
4121
+ for (const key of KEYS2) {
4122
+ const value = key === "width" || key === "availWidth" ? size2.width : key === "availHeight" ? size2.availHeight ?? size2.height : size2.height;
4123
+ Object.defineProperty(own, key, { configurable: true, enumerable: true, get: () => value });
4124
+ }
4125
+ }
4126
+ function reset5() {
4127
+ apply5(null);
4128
+ }
4129
+
3974
4130
  // src/engine/scrollbars.ts
3975
4131
  var NAME2 = "scrollbars";
3976
4132
  var COMMIT_WAIT = 1000;
3977
4133
  var CSS2 = "*{scrollbar-width:none!important}::-webkit-scrollbar{display:none!important}";
3978
- function apply5(value) {
4134
+ function apply6(value) {
3979
4135
  if (!value) {
3980
- reset5();
4136
+ reset6();
3981
4137
  return;
3982
4138
  }
3983
4139
  ensureStyle(NAME2).textContent = CSS2;
@@ -4020,7 +4176,7 @@ function equip(view) {
4020
4176
  };
4021
4177
  channel.port2.postMessage(null);
4022
4178
  }
4023
- function reset5() {
4179
+ function reset6() {
4024
4180
  removeStyle(NAME2);
4025
4181
  }
4026
4182
 
@@ -4028,7 +4184,7 @@ function reset5() {
4028
4184
  var TOUCH_POINTS = 5;
4029
4185
  var handler = false;
4030
4186
  var points = false;
4031
- function apply6(value) {
4187
+ function apply7(value) {
4032
4188
  if (value.on && !handler && !("ontouchstart" in window)) {
4033
4189
  Object.defineProperty(window, "ontouchstart", {
4034
4190
  configurable: true,
@@ -4071,8 +4227,8 @@ function equip2(view, points2) {
4071
4227
  get: () => TOUCH_POINTS
4072
4228
  });
4073
4229
  }
4074
- function reset6() {
4075
- apply6({ on: false, points: false });
4230
+ function reset7() {
4231
+ apply7({ on: false, points: false });
4076
4232
  }
4077
4233
 
4078
4234
  // src/engine/matcolors.ts
@@ -4227,6 +4383,7 @@ function snapshotKey(knobs, view) {
4227
4383
  view.devicePixelRatio
4228
4384
  ]);
4229
4385
  }
4386
+ var RGB = /^rgb\(\d{1,3}, \d{1,3}, \d{1,3}\)$/;
4230
4387
  function lookOf(value) {
4231
4388
  if (typeof value !== "object" || value === null)
4232
4389
  return null;
@@ -4235,7 +4392,7 @@ function lookOf(value) {
4235
4392
  const scheme = read2("scheme");
4236
4393
  const host = read2("host");
4237
4394
  const flags = [read2("dark"), read2("canBack"), read2("canForward")];
4238
- if (typeof background !== "string" || !/^rgb\(\d{1,3}, \d{1,3}, \d{1,3}\)$/.test(background)) {
4395
+ if (typeof background !== "string" || !RGB.test(background)) {
4239
4396
  return null;
4240
4397
  }
4241
4398
  if (scheme !== "light" && scheme !== "dark" || typeof host !== "string")
@@ -4245,7 +4402,13 @@ function lookOf(value) {
4245
4402
  return null;
4246
4403
  if (typeof canForward !== "boolean")
4247
4404
  return null;
4248
- return { background, dark, scheme, host, canBack, canForward };
4405
+ const color = (key) => {
4406
+ const value2 = read2(key);
4407
+ return typeof value2 === "string" && RGB.test(value2) ? value2 : background;
4408
+ };
4409
+ const top2 = color("top");
4410
+ const bottom = color("bottom");
4411
+ return { background, top: top2, bottom, footer: read2("footer") === true, under: [], dark, scheme, host, canBack, canForward };
4249
4412
  }
4250
4413
  function readSnapshot(knobs, view) {
4251
4414
  try {
@@ -4421,4 +4584,4 @@ function readMark(detail) {
4421
4584
  return finite(x) && finite(y) ? { at: { x, y }, pressed, held } : null;
4422
4585
  }
4423
4586
 
4424
- 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, setSystemMedia, 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 };
4587
+ 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, setSystemMedia, 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 };