@vinena/knobs 0.7.0 → 0.7.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 (116) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +2 -2
  3. package/dist/cli.js +2 -2
  4. package/dist/{context-eawqn680.js → context-2r76ext7.js} +3 -3
  5. package/dist/{context-vd2xep5t.js → context-h1bdt8w3.js} +3 -3
  6. package/dist/early.global.js +7 -8
  7. package/dist/edit/html.d.ts +7 -3
  8. package/dist/edit/keep.d.ts +1 -1
  9. package/dist/{elementsview-m33ejs4r.js → elementsview-1bar694x.js} +21 -19
  10. package/dist/{elementsview-jg4edt86.js → elementsview-p2wc9b0s.js} +21 -19
  11. package/dist/engine/bandmedia.d.ts +119 -0
  12. package/dist/engine/bezels.d.ts +2 -2
  13. package/dist/engine/browserui.d.ts +3 -1
  14. package/dist/engine/check.d.ts +2 -2
  15. package/dist/engine/describe.d.ts +2 -2
  16. package/dist/engine/devices.d.ts +3 -3
  17. package/dist/engine/fit.d.ts +4 -4
  18. package/dist/engine/foldhand.d.ts +2 -2
  19. package/dist/engine/frame.d.ts +6 -6
  20. package/dist/engine/frames.d.ts +4 -4
  21. package/dist/engine/fresh.d.ts +12 -5
  22. package/dist/engine/header.d.ts +3 -1
  23. package/dist/engine/identity.d.ts +4 -4
  24. package/dist/engine/index.d.ts +7 -7
  25. package/dist/engine/locale.d.ts +2 -2
  26. package/dist/engine/morph.d.ts +2 -2
  27. package/dist/engine/native.d.ts +8 -8
  28. package/dist/engine/pageshot.d.ts +24 -4
  29. package/dist/engine/placeholder.d.ts +3 -3
  30. package/dist/engine/reload.d.ts +2 -2
  31. package/dist/engine/safaridraw.d.ts +24 -3
  32. package/dist/engine/screen.d.ts +2 -2
  33. package/dist/engine/scrollkeep.d.ts +1 -1
  34. package/dist/engine/store.d.ts +11 -11
  35. package/dist/engine/storekeys.d.ts +34 -0
  36. package/dist/engine/style.d.ts +1 -1
  37. package/dist/engine/tabicon.d.ts +2 -2
  38. package/dist/engine/underbar.d.ts +26 -7
  39. package/dist/engine/underneath.d.ts +1 -0
  40. package/dist/engine/width.d.ts +3 -3
  41. package/dist/{framekit-r16k97n7.js → framekit-n57ts9zt.js} +959 -87
  42. package/dist/{framekit-40pzennw.js → framekit-wqp811a2.js} +959 -87
  43. package/dist/grab/clipboard.d.ts +2 -0
  44. package/dist/{index-jfv7vavj.js → index-311fys81.js} +93 -29
  45. package/dist/index-3dcgysws.js +77 -0
  46. package/dist/{index-ztnjefrh.js → index-585hs9tp.js} +5 -1
  47. package/dist/{index-za4ppxay.js → index-6t0w5s7p.js} +1 -1
  48. package/dist/{index-tqq2ygpj.js → index-9targr2f.js} +26 -16
  49. package/dist/{index-t4kssacm.js → index-abwqw8jh.js} +6 -1
  50. package/dist/{index-s6yzsvs4.js → index-b8cnnbpr.js} +25 -18
  51. package/dist/{index-xxbb8y41.js → index-cfrnrg24.js} +20 -14
  52. package/dist/{index-v2v4rmpe.js → index-dvtbh3c8.js} +24 -18
  53. package/dist/{index-0qkj2mgb.js → index-j8hrzag1.js} +14 -11
  54. package/dist/{index-cb91vcka.js → index-k4w5v53q.js} +1 -1
  55. package/dist/{index-q53j8wg5.js → index-n31pn4ax.js} +19 -15
  56. package/dist/{index-s6fya8pm.js → index-pvknvvkw.js} +11 -10
  57. package/dist/{index-3nwycv3p.js → index-qz04adp5.js} +20 -14
  58. package/dist/{index-ymqm185m.js → index-rps0bdq9.js} +1 -1
  59. package/dist/{index-a8ffw5ft.js → index-szd9bddn.js} +1 -1
  60. package/dist/{index-8d1yk9d2.js → index-t7a07nm9.js} +59 -39
  61. package/dist/{index-2jc9dnta.js → index-vhda420r.js} +11 -5
  62. package/dist/{index-xs29b55n.js → index-vmprrfwe.js} +5 -2
  63. package/dist/{index-fjrrgd9h.js → index-vmz7htwn.js} +1 -1
  64. package/dist/index.d.ts +14 -8
  65. package/dist/index.global.js +182 -165
  66. package/dist/index.js +57 -32
  67. package/dist/instance.d.ts +7 -1
  68. package/dist/mark.d.ts +50 -0
  69. package/dist/{react-vvc4x9kq.js → react-0tbd51s3.js} +14 -11
  70. package/dist/{react-0gxs9aef.js → react-4ezjf7mq.js} +24 -18
  71. package/dist/react-4qn9vsjw.js +78 -0
  72. package/dist/{react-73reavv4.js → react-4tcwpama.js} +1 -1
  73. package/dist/{react-6ngtb6p9.js → react-7eyps0cg.js} +1 -1
  74. package/dist/{react-zp7fdw8e.js → react-881wvm1z.js} +59 -39
  75. package/dist/{react-yx3g9k55.js → react-amvrbng8.js} +5 -2
  76. package/dist/{react-5rq7bnsy.js → react-atw9y8ny.js} +5 -1
  77. package/dist/{react-4phtr2nd.js → react-dg4bjv3j.js} +1 -1
  78. package/dist/{react-meve34wp.js → react-hdneb4v3.js} +11 -5
  79. package/dist/{react-h9w04skh.js → react-j87bdhhe.js} +4 -1
  80. package/dist/{react-wtgvkf6g.js → react-mkafgzqf.js} +1 -1
  81. package/dist/{react-fq4551ks.js → react-pf7fc2f3.js} +11 -10
  82. package/dist/{react-0r5418av.js → react-rbmk30xk.js} +92 -29
  83. package/dist/{react-actmnkwp.js → react-rxw73n04.js} +1 -1
  84. package/dist/{react-8nmtt0ge.js → react-w94cfn87.js} +19 -15
  85. package/dist/{react-3ev6rwqz.js → react-x209et38.js} +26 -16
  86. package/dist/{react-5h7pxnax.js → react-zj0dbpdg.js} +25 -18
  87. package/dist/react.d.ts +3 -1
  88. package/dist/react.js +60 -33
  89. package/dist/{replay-pmesjfa3.js → replay-3xqgt3xg.js} +8 -8
  90. package/dist/{replay-m5g8km9y.js → replay-48gn27bj.js} +8 -8
  91. package/dist/storage/onload.d.ts +1 -1
  92. package/dist/{storageview-9a6zm47z.js → storageview-5tvmca8y.js} +16 -13
  93. package/dist/{storageview-x62v1c3j.js → storageview-ec52x60p.js} +16 -13
  94. package/dist/styles/force.d.ts +3 -1
  95. package/dist/types.d.ts +4 -4
  96. package/dist/ui/actions.d.ts +3 -3
  97. package/dist/ui/bindings.d.ts +1 -1
  98. package/dist/ui/catalog.d.ts +14 -14
  99. package/dist/ui/changes.d.ts +1 -1
  100. package/dist/ui/colors.d.ts +1 -1
  101. package/dist/ui/deviceknobs.d.ts +2 -2
  102. package/dist/ui/editors.d.ts +3 -3
  103. package/dist/ui/foldslider.d.ts +2 -2
  104. package/dist/ui/keys.d.ts +1 -1
  105. package/dist/ui/list.d.ts +10 -10
  106. package/dist/ui/palette.d.ts +2 -2
  107. package/dist/ui/pin.d.ts +2 -2
  108. package/dist/ui/prefs.d.ts +1 -1
  109. package/dist/ui/rows.d.ts +3 -3
  110. package/dist/ui/storageview.d.ts +2 -2
  111. package/dist/ui/stylesview.d.ts +3 -3
  112. package/dist/ui/swatches.d.ts +2 -2
  113. package/package.json +2 -1
  114. package/skills/knobs/SKILL.md +36 -35
  115. package/dist/index-5tv6sr74.js +0 -23
  116. package/dist/react-t2qnewz2.js +0 -24
@@ -22,11 +22,11 @@ import {
22
22
  resume,
23
23
  screenSizeOf,
24
24
  uaPreset
25
- } from "./index-s6yzsvs4.js";
25
+ } from "./index-b8cnnbpr.js";
26
26
  import {
27
27
  composedParent,
28
28
  isDevknobs
29
- } from "./index-2jc9dnta.js";
29
+ } from "./index-vhda420r.js";
30
30
  import {
31
31
  DEFAULT_STATE,
32
32
  EXITED,
@@ -52,9 +52,11 @@ import {
52
52
  now,
53
53
  ownReload,
54
54
  post,
55
+ readItem,
55
56
  readMessage,
56
57
  readNow,
57
58
  realNow,
59
+ removeItem,
58
60
  removeStyle,
59
61
  reset,
60
62
  reset1 as reset2,
@@ -67,8 +69,9 @@ import {
67
69
  takeOver,
68
70
  temporalNow,
69
71
  webStorage,
70
- wrapDate
71
- } from "./index-jfv7vavj.js";
72
+ wrapDate,
73
+ writeItem
74
+ } from "./index-311fys81.js";
72
75
  import {
73
76
  QUIET,
74
77
  SHARED_VERSION,
@@ -77,9 +80,18 @@ import {
77
80
  shared
78
81
  } from "./index-a974q3aa.js";
79
82
  import {
83
+ ATTRIBUTES,
84
+ OLD_MARK,
85
+ OWN_AND_IN,
80
86
  __export,
81
- __require
82
- } from "./index-5tv6sr74.js";
87
+ __require,
88
+ either,
89
+ isMarked,
90
+ markOwn,
91
+ ownSelector,
92
+ removeMark,
93
+ setMark
94
+ } from "./index-3dcgysws.js";
83
95
 
84
96
  // src/engine/intl.ts
85
97
  var SERVICES = [
@@ -211,9 +223,9 @@ var LOCALE_PRESETS = [
211
223
  "zh-CN"
212
224
  ];
213
225
  var PARAGLIDE_COOKIE = "PARAGLIDE_LOCALE";
214
- var OWNER_KEY = "devknobs:locale-stores";
226
+ var OWNER_KEY = "knobs:locale-stores";
215
227
  var OWNER_VERSION = 1;
216
- var RELOAD_KEY = "devknobs:locale-reload";
228
+ var RELOAD_KEY = "knobs:locale-reload";
217
229
  var RELOAD_VERSION = 1;
218
230
  var RELOAD_THROTTLE = 5000;
219
231
  var HOLD_BUDGET = 20;
@@ -316,7 +328,7 @@ function parseOwned(json) {
316
328
  }
317
329
  function readOwned() {
318
330
  try {
319
- return parseOwned(webStorage("session")?.getItem(OWNER_KEY) ?? null);
331
+ return parseOwned(readItem(webStorage("session"), OWNER_KEY));
320
332
  } catch {
321
333
  return null;
322
334
  }
@@ -324,7 +336,7 @@ function readOwned() {
324
336
  function writeOwned(owned) {
325
337
  try {
326
338
  const session = webStorage("session");
327
- session?.setItem(OWNER_KEY, JSON.stringify(stamped(owned, OWNER_VERSION)));
339
+ writeItem(session, OWNER_KEY, JSON.stringify(stamped(owned, OWNER_VERSION)));
328
340
  return session !== null;
329
341
  } catch {
330
342
  return false;
@@ -332,7 +344,7 @@ function writeOwned(owned) {
332
344
  }
333
345
  function clearOwned() {
334
346
  try {
335
- webStorage("session")?.removeItem(OWNER_KEY);
347
+ removeItem(webStorage("session"), OWNER_KEY);
336
348
  } catch {}
337
349
  }
338
350
  function parseReload(text) {
@@ -356,7 +368,7 @@ function reloadWait() {
356
368
  const session = webStorage("session");
357
369
  if (!session)
358
370
  return Infinity;
359
- const previous = parseReload(session.getItem(RELOAD_KEY));
371
+ const previous = parseReload(readItem(session, RELOAD_KEY));
360
372
  if (!(previous > 0))
361
373
  return 0;
362
374
  return Math.min(RELOAD_THROTTLE, Math.max(0, previous + RELOAD_THROTTLE - realNow()));
@@ -377,7 +389,7 @@ function reloadOnce() {
377
389
  const session = webStorage("session");
378
390
  if (!session)
379
391
  return false;
380
- session.setItem(RELOAD_KEY, JSON.stringify(record));
392
+ writeItem(session, RELOAD_KEY, JSON.stringify(record));
381
393
  } catch {
382
394
  return false;
383
395
  }
@@ -983,7 +995,7 @@ var HOST_RESET = `
983
995
  transition: none !important;
984
996
  animation: none !important;
985
997
  }`;
986
- var BACKDROP_CSS = "[data-devknobs][popover]::backdrop{display:none!important}";
998
+ var BACKDROP_CSS = `${either(OLD_MARK, "][popover]::backdrop")}{display:none!important}`;
987
999
  var TOP_LAYER = [":popover-open", ":modal", ":fullscreen"];
988
1000
  var POINTER = ["pointerover", "pointermove", "pointerdown"];
989
1001
  var held2 = [];
@@ -1132,7 +1144,7 @@ function holdInTopLayer(host, rank) {
1132
1144
 
1133
1145
  // src/engine/frames.ts
1134
1146
  var kit = null;
1135
- var load2 = () => import("./framekit-40pzennw.js");
1147
+ var load2 = () => import("./framekit-wqp811a2.js");
1136
1148
  var loading = null;
1137
1149
  var down = false;
1138
1150
  var waiting = [];
@@ -2285,7 +2297,9 @@ function requestLog() {
2285
2297
  }
2286
2298
 
2287
2299
  // src/engine/header.ts
2288
- var NOW_HEADER = "x-devknobs-now";
2300
+ var NOW_HEADER = "x-knobs-now";
2301
+ var OLD_NOW_HEADER = "x-devknobs-now";
2302
+ var NOW_HEADERS = [NOW_HEADER, OLD_NOW_HEADER];
2289
2303
  var on = false;
2290
2304
  var installed2 = [];
2291
2305
  var ownOrigin = new WeakSet;
@@ -2309,11 +2323,15 @@ function isRequest2(input) {
2309
2323
  function withHeader(input, init) {
2310
2324
  if (isRequest2(input) && init?.headers === undefined) {
2311
2325
  const copy = new Request(input);
2312
- copy.headers.set(NOW_HEADER, stamp());
2326
+ const value2 = stamp();
2327
+ for (const name of NOW_HEADERS)
2328
+ copy.headers.set(name, value2);
2313
2329
  return [copy, init];
2314
2330
  }
2315
2331
  const headers = new Headers(init?.headers);
2316
- headers.set(NOW_HEADER, stamp());
2332
+ const value = stamp();
2333
+ for (const name of NOW_HEADERS)
2334
+ headers.set(name, value);
2317
2335
  return [input, { ...init, headers }];
2318
2336
  }
2319
2337
  function install4(target, key, make) {
@@ -2350,7 +2368,9 @@ function patch() {
2350
2368
  install4(xhr, "send", (original) => function(...args) {
2351
2369
  if (on && ownOrigin.has(this)) {
2352
2370
  try {
2353
- this.setRequestHeader(NOW_HEADER, stamp());
2371
+ const value = stamp();
2372
+ for (const name of NOW_HEADERS)
2373
+ this.setRequestHeader(name, value);
2354
2374
  } catch {}
2355
2375
  }
2356
2376
  return original.apply(this, args);
@@ -2443,7 +2463,7 @@ function apply13(value) {
2443
2463
  reset12();
2444
2464
  return;
2445
2465
  }
2446
- ensureStyle(NAME).textContent = "body *:not([data-devknobs],[data-devknobs] *){outline:1px solid rgba(127,127,127,.5)!important}";
2466
+ ensureStyle(NAME).textContent = `body *:not(${OWN_AND_IN}){outline:1px solid rgba(127,127,127,.5)!important}`;
2447
2467
  }
2448
2468
  function reset12() {
2449
2469
  removeStyle(NAME);
@@ -2453,7 +2473,7 @@ function reset12() {
2453
2473
  function isOwn2(node) {
2454
2474
  let current = node;
2455
2475
  while (current) {
2456
- if (current instanceof Element && current.closest("[data-devknobs]"))
2476
+ if (current instanceof Element && current.closest(ownSelector()))
2457
2477
  return true;
2458
2478
  const root = current.getRootNode();
2459
2479
  current = root instanceof ShadowRoot ? root.host : null;
@@ -2464,7 +2484,7 @@ function walk(visit) {
2464
2484
  const pending = [document];
2465
2485
  for (let root = pending.pop();root; root = pending.pop()) {
2466
2486
  for (const element of Array.from(root.querySelectorAll("*"))) {
2467
- if (element.hasAttribute("data-devknobs"))
2487
+ if (isMarked(element))
2468
2488
  continue;
2469
2489
  visit(element);
2470
2490
  if (element.shadowRoot)
@@ -2629,7 +2649,7 @@ function start2() {
2629
2649
  if (host || !document.body)
2630
2650
  return;
2631
2651
  host = document.createElement("div");
2632
- host.setAttribute("data-devknobs", "overflow");
2652
+ markOwn(host, "overflow");
2633
2653
  host.style.cssText = `position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:${Z_INDEX}`;
2634
2654
  layer = host.attachShadow({ mode: "open" });
2635
2655
  sheet = addStyle(layer, CSS);
@@ -2684,8 +2704,8 @@ var ACCENTED = "áƀçðéƒĝĥîĵķļɱñöþǫŕšţûṽŵẋýžÅƁÇÐÉ
2684
2704
  var accented = Array.from(ACCENTED);
2685
2705
  var ACCENTS = new Map(Array.from(PLAIN, (char, i) => [char, accented[i] ?? char]));
2686
2706
  var GROWTH = 0.35;
2687
- var ATTRIBUTES = ["placeholder", "title", "aria-label", "alt"];
2688
- var SKIPPED = "script,style,noscript,textarea,option:not([value]),[data-devknobs]";
2707
+ var ATTRIBUTES2 = ["placeholder", "title", "aria-label", "alt"];
2708
+ var SKIPPED = `script,style,noscript,textarea,option:not([value]),${ownSelector()}`;
2689
2709
  var LETTER = /\p{L}/u;
2690
2710
  function pseudoText(text2) {
2691
2711
  const core = text2.trim();
@@ -2771,7 +2791,7 @@ function swapNode(node) {
2771
2791
  if (node.nodeType === Node.TEXT_NODE)
2772
2792
  swapText(node);
2773
2793
  else
2774
- for (const name of ATTRIBUTES)
2794
+ for (const name of ATTRIBUTES2)
2775
2795
  swapAttribute(node, name);
2776
2796
  }
2777
2797
  function swapTree(root) {
@@ -2833,7 +2853,7 @@ function start3() {
2833
2853
  subtree: true,
2834
2854
  characterData: true,
2835
2855
  attributes: true,
2836
- attributeFilter: ATTRIBUTES
2856
+ attributeFilter: ATTRIBUTES2
2837
2857
  });
2838
2858
  }
2839
2859
  function whenIdle(run) {
@@ -2950,7 +2970,7 @@ function collect(roots = shadowRoots()) {
2950
2970
  }
2951
2971
 
2952
2972
  // src/engine/replay.ts
2953
- var MARK = "data-devknobs-replay";
2973
+ var MARK = ATTRIBUTES.replay;
2954
2974
  var BOXES = [
2955
2975
  ["", "self"],
2956
2976
  ["::before", "before"],
@@ -2992,7 +3012,7 @@ function restartFinished(live) {
2992
3012
  const tokens = BOXES.filter(([pseudo]) => finished(element, pseudo, names)).map(([, token]) => token);
2993
3013
  if (tokens.length === 0)
2994
3014
  return;
2995
- element.setAttribute(MARK, tokens.join(" "));
3015
+ setMark(element, MARK, tokens.join(" "));
2996
3016
  marked.push(element);
2997
3017
  roots.add(element.getRootNode());
2998
3018
  });
@@ -3003,7 +3023,7 @@ function restartFinished(live) {
3003
3023
  for (const style of styles)
3004
3024
  style.remove();
3005
3025
  for (const element of marked)
3006
- element.removeAttribute(MARK);
3026
+ removeMark(element, MARK);
3007
3027
  }
3008
3028
  function replay() {
3009
3029
  const animations = collect();
@@ -3019,7 +3039,7 @@ function replay() {
3019
3039
 
3020
3040
  // src/engine/spacing.ts
3021
3041
  var NAME2 = "spacing";
3022
- var NOT_OURS = ":not([data-devknobs],[data-devknobs] *)";
3042
+ var NOT_OURS = `:not(${OWN_AND_IN})`;
3023
3043
  var CSS2 = `*${NOT_OURS}{line-height:1.5!important;letter-spacing:.12em!important;word-spacing:.16em!important}` + `p${NOT_OURS}{margin-bottom:2em!important}`;
3024
3044
  function apply16(value) {
3025
3045
  if (!value) {
@@ -3107,8 +3127,8 @@ function drawDevIcon(context, size, source) {
3107
3127
  }
3108
3128
 
3109
3129
  // src/engine/tabicon.ts
3110
- var ORIGINAL_HREF = "data-devknobs-href";
3111
- var ADDED_ICON = "data-devknobs-icon";
3130
+ var ORIGINAL_HREF = ATTRIBUTES.href;
3131
+ var ADDED_ICON = ATTRIBUTES.icon;
3112
3132
  var FALLBACK = "/favicon.ico";
3113
3133
  var TOUCH_RELS = ["apple-touch-icon", "apple-touch-icon-precomposed"];
3114
3134
  function localHost(hostname) {
@@ -3196,7 +3216,7 @@ function createTabIcon(env) {
3196
3216
  return;
3197
3217
  }
3198
3218
  drawn.set(link, { url, original: href });
3199
- link.setAttribute(ORIGINAL_HREF, href);
3219
+ setMark(link, ORIGINAL_HREF, href);
3200
3220
  link.setAttribute("href", url);
3201
3221
  });
3202
3222
  }
@@ -3208,7 +3228,7 @@ function createTabIcon(env) {
3208
3228
  drawn.delete(link);
3209
3229
  if (link.getAttribute("href") === mine.url)
3210
3230
  link.setAttribute("href", mine.original);
3211
- link.removeAttribute(ORIGINAL_HREF);
3231
+ removeMark(link, ORIGINAL_HREF);
3212
3232
  }
3213
3233
  function linksIn(node) {
3214
3234
  if (isIconLink(node))
@@ -3224,7 +3244,7 @@ function createTabIcon(env) {
3224
3244
  const link = doc.createElement("link");
3225
3245
  link.setAttribute("rel", "icon");
3226
3246
  link.setAttribute("href", FALLBACK);
3227
- link.setAttribute(ADDED_ICON, "");
3247
+ setMark(link, ADDED_ICON);
3228
3248
  added = link;
3229
3249
  (doc.head ?? doc.documentElement).append(link);
3230
3250
  swap(link);
@@ -3289,7 +3309,7 @@ function createTabIcon(env) {
3289
3309
  for (const [link, { url, original }] of drawn) {
3290
3310
  if (link.getAttribute("href") === url)
3291
3311
  link.setAttribute("href", original);
3292
- link.removeAttribute(ORIGINAL_HREF);
3312
+ removeMark(link, ORIGINAL_HREF);
3293
3313
  }
3294
3314
  drawn.clear();
3295
3315
  added?.remove();
@@ -3527,7 +3547,7 @@ var EVENTS = [
3527
3547
  "dragstart",
3528
3548
  "selectstart"
3529
3549
  ];
3530
- var CURSOR_CSS = "*:not([data-devknobs]){cursor:none!important}:where([data-devknobs]){cursor:auto}";
3550
+ var CURSOR_CSS = `*:not(${ownSelector()}){cursor:none!important}:where(${ownSelector()}){cursor:auto}`;
3531
3551
  var DRAG_CSS = "*{-webkit-user-select:none!important;user-select:none!important}";
3532
3552
  var DOT_CSS = `
3533
3553
  :host {
@@ -3680,7 +3700,7 @@ function mountDot() {
3680
3700
  if (host2)
3681
3701
  return;
3682
3702
  host2 = document.createElement("div");
3683
- host2.setAttribute("data-devknobs", "touch-pointer");
3703
+ markOwn(host2, "touch-pointer");
3684
3704
  const root = host2.attachShadow({ mode: "open" });
3685
3705
  addStyle(root, DOT_CSS);
3686
3706
  dot = document.createElement("div");
@@ -1,6 +1,11 @@
1
1
  import {
2
2
  post
3
- } from "./index-jfv7vavj.js";
3
+ } from "./index-311fys81.js";
4
+ import {
5
+ ATTRIBUTES,
6
+ hasMark,
7
+ isMarked
8
+ } from "./index-3dcgysws.js";
4
9
 
5
10
  // src/ui/icons.ts
6
11
  var SVG = "http://www.w3.org/2000/svg";
@@ -417,7 +422,7 @@ function defaultKeys(options = {}) {
417
422
  settings: free(SETTINGS_KEYS)
418
423
  };
419
424
  }
420
- var KEYS_FIELD = "data-devknobs-keys";
425
+ var KEYS_FIELD = ATTRIBUTES.keys;
421
426
  function isTyping(node) {
422
427
  const element = node;
423
428
  const tag = element?.tagName;
@@ -451,7 +456,8 @@ function typesInField(event) {
451
456
  const target = event.composedPath?.()[0] ?? event.target;
452
457
  if (!isEditable(target))
453
458
  return false;
454
- return target?.hasAttribute?.(KEYS_FIELD) !== true;
459
+ const element = target;
460
+ return typeof element?.hasAttribute !== "function" || !hasMark(element, KEYS_FIELD);
455
461
  }
456
462
  function lowerKey(key) {
457
463
  return key === "İ" ? "i" : key.toLowerCase();
@@ -606,7 +612,7 @@ function composedParent(element) {
606
612
  }
607
613
  function isDevknobs(element) {
608
614
  for (let current = element;current; current = composedParent(current)) {
609
- if (current.hasAttribute("data-devknobs"))
615
+ if (isMarked(current))
610
616
  return true;
611
617
  }
612
618
  return false;
@@ -674,7 +680,7 @@ function descend(start, x, y) {
674
680
  continue;
675
681
  for (let index = 0;index < children.length; index++) {
676
682
  const child = children[index];
677
- if (!child || child.hasAttribute("data-devknobs") || !holds(child, x, y))
683
+ if (!child || isMarked(child) || !holds(child, x, y))
678
684
  continue;
679
685
  if (isHidden(child) || isClearLayer(child))
680
686
  continue;
@@ -5,7 +5,10 @@ import {
5
5
  elementSelector,
6
6
  nearestSemanticSelector,
7
7
  selectorTarget
8
- } from "./index-t4kssacm.js";
8
+ } from "./index-abwqw8jh.js";
9
+ import {
10
+ isOwnName
11
+ } from "./index-3dcgysws.js";
9
12
 
10
13
  // src/grab/fiber.ts
11
14
  var FORWARD_REF = Symbol.for("react.forward_ref");
@@ -162,7 +165,7 @@ function truncateEscaped(html, max) {
162
165
  return `${whole}${SUFFIX}`.slice(0, max);
163
166
  }
164
167
  function isInternal(name) {
165
- return name.startsWith("data-devknobs") || name.startsWith("data-react-grab-");
168
+ return isOwnName(name) || name.startsWith("data-react-grab-");
166
169
  }
167
170
  var GENERATED_CLASS = [
168
171
  /^[\w-]+__[\w-]+\.[\w-]+$/,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  icon,
3
3
  radioMove
4
- } from "./index-2jc9dnta.js";
4
+ } from "./index-vhda420r.js";
5
5
 
6
6
  // src/ui/dom.ts
7
7
  function el(tag, className, text) {
package/dist/index.d.ts CHANGED
@@ -5,9 +5,9 @@ import { type Edit } from "./edit/log";
5
5
  import { type ForcedState } from "./styles/force";
6
6
  import type { GrabOptions, GrabResult } from "./grab/types";
7
7
  import { type HostBuild, type PreferSetting, type PreferValue } from "./host";
8
- import type { DevknobsState, DevknobsStatePatch, GrabColorValue } from "./types";
8
+ import type { KnobsState, KnobsStatePatch, GrabColorValue } from "./types";
9
9
  import { type KeysStore } from "./ui/bindings";
10
- export type { BarsValue, BrowserValue, ClockMode, ClockValue, ConnectionValue, ContrastValue, DevknobsState, DevknobsStatePatch, DevIconValue, DirValue, DprValue, EdgeValue, GeoErrorValue, GeoValue, GrabColorValue, HeightValue, Knob, LocaleValue, MotionValue, NetworkValue, OnlineValue, OrientationValue, PanelValue, SaveDataValue, SchemeValue, SideValue, SpeedValue, TextValue, TimeZoneValue, TransparencyValue, UaValue, VisionValue, WidthValue, ZoomValue, } from "./types";
10
+ export type { BarsValue, BrowserValue, ClockMode, ClockValue, ConnectionValue, ContrastValue, KnobsState, KnobsStatePatch, DevIconValue, DirValue, DprValue, EdgeValue, GeoErrorValue, GeoValue, GrabColorValue, HeightValue, Knob, LocaleValue, MotionValue, NetworkValue, OnlineValue, OrientationValue, PanelValue, SaveDataValue, SchemeValue, SideValue, SpeedValue, TextValue, TimeZoneValue, TransparencyValue, UaValue, VisionValue, WidthValue, ZoomValue, } from "./types";
11
11
  export type { KnobDescription, KnobField, KnobReload, KnobShape, KnobValue, } from "./engine/describe";
12
12
  export type { DeviceKind, DevicePreset } from "./engine/devices";
13
13
  export type { Edit, EditKind, EditPlace, EditTarget } from "./edit/log";
@@ -124,16 +124,16 @@ export { holdInTopLayer, LAYER, type TopLayerHold } from "./engine/toplayer";
124
124
  * switch. `note` shows on that switch, such as why it went off.
125
125
  */
126
126
  export declare const setNative: typeof engine.setNative;
127
- export declare function getState(): DevknobsState;
127
+ export declare function getState(): KnobsState;
128
128
  /**
129
129
  * Apply a patch of knobs. A knob or a field the state does not have, or a
130
130
  * value it does not take, throws a TypeError, and then nothing changes. The
131
131
  * whole of `getState()` goes back in.
132
132
  */
133
- export declare function setState(patch: DevknobsStatePatch): DevknobsState;
133
+ export declare function setState(patch: KnobsStatePatch): KnobsState;
134
134
  export declare function reset(): void;
135
135
  export declare function replay(): void;
136
- export declare function ready(): Promise<DevknobsState>;
136
+ export declare function ready(): Promise<KnobsState>;
137
137
  export declare function describe(): KnobDescription[];
138
138
  /**
139
139
  * Copy what an agent needs to find the elements in the code: their html, the
@@ -194,10 +194,16 @@ declare const api: {
194
194
  undoEdit: typeof undoEdit;
195
195
  forceState: typeof forceState;
196
196
  };
197
- /** What `mount` puts at `window.devknobs`, for agents that run code in the page. */
198
- export type DevknobsApi = typeof api;
197
+ /** What `mount` puts at `window.knobs` and `window.devknobs`, for agents that run code in the page. */
198
+ export type KnobsApi = typeof api;
199
+ /** @deprecated use KnobsApi */
200
+ export type DevknobsApi = KnobsApi;
201
+ /** @deprecated use KnobsState */
202
+ export type DevknobsState = KnobsState;
203
+ /** @deprecated use KnobsStatePatch */
204
+ export type DevknobsStatePatch = KnobsStatePatch;
199
205
  declare global {
200
206
  interface Window {
201
- devknobs?: DevknobsApi;
207
+ devknobs?: KnobsApi;
202
208
  }
203
209
  }