@vinena/knobs 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +2 -2
- package/dist/cli.js +2 -2
- package/dist/{context-eawqn680.js → context-2r76ext7.js} +3 -3
- package/dist/{context-vd2xep5t.js → context-h1bdt8w3.js} +3 -3
- package/dist/early.global.js +7 -8
- package/dist/edit/html.d.ts +7 -3
- package/dist/edit/keep.d.ts +1 -1
- package/dist/{elementsview-m33ejs4r.js → elementsview-mcg6d5zp.js} +21 -19
- package/dist/{elementsview-jg4edt86.js → elementsview-mwr1s17z.js} +21 -19
- package/dist/engine/bezels.d.ts +2 -2
- package/dist/engine/check.d.ts +2 -2
- package/dist/engine/describe.d.ts +2 -2
- package/dist/engine/devices.d.ts +3 -3
- package/dist/engine/fit.d.ts +4 -4
- package/dist/engine/foldhand.d.ts +2 -2
- package/dist/engine/frame.d.ts +6 -6
- package/dist/engine/frames.d.ts +4 -4
- package/dist/engine/fresh.d.ts +12 -5
- package/dist/engine/header.d.ts +3 -1
- package/dist/engine/identity.d.ts +4 -4
- package/dist/engine/index.d.ts +7 -7
- package/dist/engine/locale.d.ts +2 -2
- package/dist/engine/morph.d.ts +2 -2
- package/dist/engine/native.d.ts +8 -8
- package/dist/engine/placeholder.d.ts +3 -3
- package/dist/engine/reload.d.ts +2 -2
- package/dist/engine/screen.d.ts +2 -2
- package/dist/engine/scrollkeep.d.ts +1 -1
- package/dist/engine/store.d.ts +11 -11
- package/dist/engine/storekeys.d.ts +34 -0
- package/dist/engine/style.d.ts +1 -1
- package/dist/engine/tabicon.d.ts +2 -2
- package/dist/engine/underneath.d.ts +1 -0
- package/dist/engine/width.d.ts +3 -3
- package/dist/{framekit-40pzennw.js → framekit-4v7nc3ea.js} +23 -18
- package/dist/{framekit-r16k97n7.js → framekit-wyppj1se.js} +23 -18
- package/dist/grab/clipboard.d.ts +2 -0
- package/dist/{index-jfv7vavj.js → index-311fys81.js} +93 -29
- package/dist/index-3dcgysws.js +77 -0
- package/dist/{index-s6fya8pm.js → index-3s4v7gw5.js} +11 -10
- package/dist/{index-ztnjefrh.js → index-585hs9tp.js} +5 -1
- package/dist/{index-za4ppxay.js → index-6t0w5s7p.js} +1 -1
- package/dist/{index-0qkj2mgb.js → index-82y8x8vv.js} +14 -11
- package/dist/{index-tqq2ygpj.js → index-9targr2f.js} +26 -16
- package/dist/{index-8d1yk9d2.js → index-a23nv5j4.js} +59 -39
- package/dist/{index-t4kssacm.js → index-abwqw8jh.js} +6 -1
- package/dist/{index-s6yzsvs4.js → index-bgzyc7rz.js} +22 -15
- package/dist/{index-xxbb8y41.js → index-c1t6knbf.js} +20 -14
- package/dist/{index-3nwycv3p.js → index-cqymjce4.js} +20 -14
- package/dist/{index-v2v4rmpe.js → index-dvtbh3c8.js} +24 -18
- package/dist/{index-cb91vcka.js → index-k4w5v53q.js} +1 -1
- package/dist/{index-q53j8wg5.js → index-n31pn4ax.js} +19 -15
- package/dist/{index-ymqm185m.js → index-rps0bdq9.js} +1 -1
- package/dist/{index-a8ffw5ft.js → index-szd9bddn.js} +1 -1
- package/dist/{index-2jc9dnta.js → index-vhda420r.js} +11 -5
- package/dist/{index-xs29b55n.js → index-vmprrfwe.js} +5 -2
- package/dist/{index-fjrrgd9h.js → index-vmz7htwn.js} +1 -1
- package/dist/index.d.ts +14 -8
- package/dist/index.global.js +159 -159
- package/dist/index.js +57 -32
- package/dist/instance.d.ts +7 -1
- package/dist/mark.d.ts +50 -0
- package/dist/{react-0gxs9aef.js → react-4ezjf7mq.js} +24 -18
- package/dist/react-4qn9vsjw.js +78 -0
- package/dist/{react-73reavv4.js → react-4tcwpama.js} +1 -1
- package/dist/{react-6ngtb6p9.js → react-7eyps0cg.js} +1 -1
- package/dist/{react-vvc4x9kq.js → react-7tzwahsm.js} +14 -11
- package/dist/{react-yx3g9k55.js → react-amvrbng8.js} +5 -2
- package/dist/{react-5rq7bnsy.js → react-atw9y8ny.js} +5 -1
- package/dist/{react-4phtr2nd.js → react-dg4bjv3j.js} +1 -1
- package/dist/{react-meve34wp.js → react-hdneb4v3.js} +11 -5
- package/dist/{react-h9w04skh.js → react-j87bdhhe.js} +4 -1
- package/dist/{react-wtgvkf6g.js → react-mkafgzqf.js} +1 -1
- package/dist/{react-zp7fdw8e.js → react-ppyj3fg2.js} +59 -39
- package/dist/{react-0r5418av.js → react-rbmk30xk.js} +92 -29
- package/dist/{react-actmnkwp.js → react-rxw73n04.js} +1 -1
- package/dist/{react-5h7pxnax.js → react-tet7swk2.js} +22 -15
- package/dist/{react-8nmtt0ge.js → react-w94cfn87.js} +19 -15
- package/dist/{react-fq4551ks.js → react-wzd3cfg8.js} +11 -10
- package/dist/{react-3ev6rwqz.js → react-x209et38.js} +26 -16
- package/dist/react.d.ts +3 -1
- package/dist/react.js +60 -33
- package/dist/{replay-pmesjfa3.js → replay-3xqgt3xg.js} +8 -8
- package/dist/{replay-m5g8km9y.js → replay-48gn27bj.js} +8 -8
- package/dist/storage/onload.d.ts +1 -1
- package/dist/{storageview-9a6zm47z.js → storageview-2rvwk0v7.js} +16 -13
- package/dist/{storageview-x62v1c3j.js → storageview-6vq7nz02.js} +16 -13
- package/dist/styles/force.d.ts +3 -1
- package/dist/types.d.ts +4 -4
- package/dist/ui/actions.d.ts +3 -3
- package/dist/ui/bindings.d.ts +1 -1
- package/dist/ui/catalog.d.ts +14 -14
- package/dist/ui/changes.d.ts +1 -1
- package/dist/ui/colors.d.ts +1 -1
- package/dist/ui/deviceknobs.d.ts +2 -2
- package/dist/ui/editors.d.ts +3 -3
- package/dist/ui/foldslider.d.ts +2 -2
- package/dist/ui/keys.d.ts +1 -1
- package/dist/ui/list.d.ts +10 -10
- package/dist/ui/palette.d.ts +2 -2
- package/dist/ui/pin.d.ts +2 -2
- package/dist/ui/prefs.d.ts +1 -1
- package/dist/ui/rows.d.ts +3 -3
- package/dist/ui/storageview.d.ts +2 -2
- package/dist/ui/stylesview.d.ts +3 -3
- package/dist/ui/swatches.d.ts +2 -2
- package/package.json +1 -1
- package/skills/knobs/SKILL.md +36 -35
- package/dist/index-5tv6sr74.js +0 -23
- package/dist/react-t2qnewz2.js +0 -24
package/dist/react.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ease,
|
|
5
5
|
keepMounted,
|
|
6
6
|
lerp
|
|
7
|
-
} from "./react-
|
|
7
|
+
} from "./react-7eyps0cg.js";
|
|
8
8
|
import {
|
|
9
9
|
GRAB_COLORS as GRAB_COLORS2,
|
|
10
10
|
GRAB_COLOR_NAMES,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
createGrab,
|
|
14
14
|
createInspect,
|
|
15
15
|
oneAtATime
|
|
16
|
-
} from "./react-
|
|
16
|
+
} from "./react-wzd3cfg8.js";
|
|
17
17
|
import {
|
|
18
18
|
hushOnce
|
|
19
19
|
} from "./react-1gqwa2yw.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
settle,
|
|
39
39
|
translateOf,
|
|
40
40
|
velocity
|
|
41
|
-
} from "./react-
|
|
41
|
+
} from "./react-x209et38.js";
|
|
42
42
|
import {
|
|
43
43
|
dockRoom,
|
|
44
44
|
dockWidth,
|
|
@@ -54,10 +54,10 @@ import {
|
|
|
54
54
|
pathNow,
|
|
55
55
|
startKeep,
|
|
56
56
|
stopKeep
|
|
57
|
-
} from "./react-
|
|
57
|
+
} from "./react-w94cfn87.js";
|
|
58
58
|
import {
|
|
59
59
|
label
|
|
60
|
-
} from "./react-
|
|
60
|
+
} from "./react-dg4bjv3j.js";
|
|
61
61
|
import {
|
|
62
62
|
appliedOnLoad,
|
|
63
63
|
applyOnLoad,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
showPane,
|
|
72
72
|
stopOnLoad,
|
|
73
73
|
viewHead
|
|
74
|
-
} from "./react-
|
|
74
|
+
} from "./react-7tzwahsm.js";
|
|
75
75
|
import {
|
|
76
76
|
actButton,
|
|
77
77
|
button,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
tabBar,
|
|
101
101
|
textField,
|
|
102
102
|
toolbar
|
|
103
|
-
} from "./react-
|
|
103
|
+
} from "./react-rxw73n04.js";
|
|
104
104
|
import {
|
|
105
105
|
BODY_CAP,
|
|
106
106
|
HOST_RESET,
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
watchHinge,
|
|
146
146
|
watchPanel,
|
|
147
147
|
zoomKey
|
|
148
|
-
} from "./react-
|
|
148
|
+
} from "./react-ppyj3fg2.js";
|
|
149
149
|
import {
|
|
150
150
|
MAT_COLORS,
|
|
151
151
|
MAT_COLOR_NAMES,
|
|
@@ -160,7 +160,7 @@ import {
|
|
|
160
160
|
runsUnderBars,
|
|
161
161
|
uaPreset,
|
|
162
162
|
userAgentOf
|
|
163
|
-
} from "./react-
|
|
163
|
+
} from "./react-tet7swk2.js";
|
|
164
164
|
import {
|
|
165
165
|
BINDING_ICONS,
|
|
166
166
|
KEYS_FIELD,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
typeAhead,
|
|
186
186
|
vinenaMark,
|
|
187
187
|
zoomAction
|
|
188
|
-
} from "./react-
|
|
188
|
+
} from "./react-hdneb4v3.js";
|
|
189
189
|
import {
|
|
190
190
|
BARS,
|
|
191
191
|
BROWSERS,
|
|
@@ -240,20 +240,26 @@ import {
|
|
|
240
240
|
parseColor,
|
|
241
241
|
percent,
|
|
242
242
|
readColor,
|
|
243
|
+
readItem,
|
|
243
244
|
readMessage,
|
|
244
245
|
realNow,
|
|
246
|
+
removeItem,
|
|
245
247
|
resolveGeo,
|
|
246
248
|
rewriteMediaText,
|
|
249
|
+
sameItem,
|
|
247
250
|
stamped,
|
|
248
251
|
still,
|
|
249
252
|
toHex,
|
|
250
253
|
watchSystemMedia,
|
|
251
|
-
webStorage
|
|
252
|
-
|
|
254
|
+
webStorage,
|
|
255
|
+
writeItem
|
|
256
|
+
} from "./react-rbmk30xk.js";
|
|
253
257
|
import"./react-fp73vhyd.js";
|
|
254
258
|
import {
|
|
255
|
-
__require
|
|
256
|
-
|
|
259
|
+
__require,
|
|
260
|
+
markOwn,
|
|
261
|
+
setMark
|
|
262
|
+
} from "./react-4qn9vsjw.js";
|
|
257
263
|
|
|
258
264
|
// src/react.tsx
|
|
259
265
|
import { useEffect, useRef } from "react";
|
|
@@ -664,7 +670,7 @@ var HEADER = {
|
|
|
664
670
|
category: "location and time",
|
|
665
671
|
control: "switch",
|
|
666
672
|
options: OFF_ON,
|
|
667
|
-
aliases: ["header", "server", "x-devknobs-now", "backend"],
|
|
673
|
+
aliases: ["header", "server", "x-knobs-now", "x-devknobs-now", "backend"],
|
|
668
674
|
read: (state) => flag(state.clock.header),
|
|
669
675
|
write: (value) => ({ clock: { header: value === "on" } }),
|
|
670
676
|
reset: { clock: { header: DEFAULT_STATE.clock.header } },
|
|
@@ -1445,7 +1451,7 @@ function knobs() {
|
|
|
1445
1451
|
min: CLOCK_SPEED_MIN,
|
|
1446
1452
|
max: CLOCK_SPEED_MAX
|
|
1447
1453
|
}),
|
|
1448
|
-
header: field2("Send the clock's instant to the page's own origin in an x-
|
|
1454
|
+
header: field2("Send the clock's instant to the page's own origin in an x-knobs-now header (and the old x-devknobs-now).", flag2)
|
|
1449
1455
|
}
|
|
1450
1456
|
}),
|
|
1451
1457
|
network: spec("navigator.onLine and navigator.connection. Requests still go out.", {
|
|
@@ -1728,18 +1734,37 @@ function free(scope, release) {
|
|
|
1728
1734
|
Reflect.deleteProperty(scope, HOST);
|
|
1729
1735
|
}
|
|
1730
1736
|
var PINNED = Symbol.for("devknobs.pinned");
|
|
1737
|
+
var ACCESSOR = Symbol.for("devknobs.accessor");
|
|
1738
|
+
function ourKnobs(scope) {
|
|
1739
|
+
const get = Object.getOwnPropertyDescriptor(scope, "knobs")?.get;
|
|
1740
|
+
return get !== undefined && Reflect.get(get, ACCESSOR) === true ? { api: get() } : null;
|
|
1741
|
+
}
|
|
1731
1742
|
function expose(scope, api) {
|
|
1732
1743
|
Reflect.set(scope, "devknobs", api);
|
|
1744
|
+
if (Object.hasOwn(scope, "knobs") && ourKnobs(scope) === null)
|
|
1745
|
+
return;
|
|
1746
|
+
const get = () => api;
|
|
1747
|
+
Reflect.set(get, ACCESSOR, true);
|
|
1748
|
+
Object.defineProperty(scope, "knobs", {
|
|
1749
|
+
configurable: true,
|
|
1750
|
+
enumerable: true,
|
|
1751
|
+
get,
|
|
1752
|
+
set(value) {
|
|
1753
|
+
Object.defineProperty(scope, "knobs", { value, writable: true, configurable: true, enumerable: true });
|
|
1754
|
+
}
|
|
1755
|
+
});
|
|
1733
1756
|
}
|
|
1734
1757
|
function withdraw(scope, api) {
|
|
1735
1758
|
if (Reflect.get(scope, PINNED) === true)
|
|
1736
1759
|
return;
|
|
1737
1760
|
if (Reflect.get(scope, "devknobs") === api)
|
|
1738
1761
|
Reflect.deleteProperty(scope, "devknobs");
|
|
1762
|
+
if (ourKnobs(scope)?.api === api)
|
|
1763
|
+
Reflect.deleteProperty(scope, "knobs");
|
|
1739
1764
|
}
|
|
1740
1765
|
|
|
1741
1766
|
// src/ui/bindings.ts
|
|
1742
|
-
var KEYS_KEY = "
|
|
1767
|
+
var KEYS_KEY = "knobs:keys";
|
|
1743
1768
|
var KEYS_VERSION = 1;
|
|
1744
1769
|
var BINDINGS = [
|
|
1745
1770
|
"panel",
|
|
@@ -1905,7 +1930,7 @@ function resolveKeys(base, stored, grab = true) {
|
|
|
1905
1930
|
}
|
|
1906
1931
|
function loadKeys() {
|
|
1907
1932
|
try {
|
|
1908
|
-
return readKeys(webStorage("local")
|
|
1933
|
+
return readKeys(readItem(webStorage("local"), KEYS_KEY));
|
|
1909
1934
|
} catch {
|
|
1910
1935
|
return {};
|
|
1911
1936
|
}
|
|
@@ -1913,9 +1938,9 @@ function loadKeys() {
|
|
|
1913
1938
|
function keepKeys(keys) {
|
|
1914
1939
|
try {
|
|
1915
1940
|
if (Object.keys(keys).length === 0)
|
|
1916
|
-
webStorage("local")
|
|
1941
|
+
removeItem(webStorage("local"), KEYS_KEY);
|
|
1917
1942
|
else
|
|
1918
|
-
webStorage("local")
|
|
1943
|
+
writeItem(webStorage("local"), KEYS_KEY, JSON.stringify(stamped(keys, KEYS_VERSION)));
|
|
1919
1944
|
} catch {}
|
|
1920
1945
|
}
|
|
1921
1946
|
function keysListed(keys, listed) {
|
|
@@ -1961,7 +1986,7 @@ function createKeys(options2 = {}) {
|
|
|
1961
1986
|
listener();
|
|
1962
1987
|
}
|
|
1963
1988
|
function onStorage(event) {
|
|
1964
|
-
if (event.key !==
|
|
1989
|
+
if (event.key !== null && !sameItem(event.key, KEYS_KEY))
|
|
1965
1990
|
return;
|
|
1966
1991
|
heard();
|
|
1967
1992
|
}
|
|
@@ -2640,7 +2665,7 @@ var PANE = { openPane, paneView, onPane, retitlePane, showPane };
|
|
|
2640
2665
|
function here(element) {
|
|
2641
2666
|
return element.isConnected && element.ownerDocument.defaultView !== null;
|
|
2642
2667
|
}
|
|
2643
|
-
function createInspector(context, load = () => import("./elementsview-
|
|
2668
|
+
function createInspector(context, load = () => import("./elementsview-mcg6d5zp.js").then(({ createElementsView }) => ({ createStylesView: createElementsView })), pane = PANE) {
|
|
2644
2669
|
const { inspect, tips, prefs } = context;
|
|
2645
2670
|
const listeners = new Set;
|
|
2646
2671
|
let view = null;
|
|
@@ -2828,7 +2853,7 @@ function createInspector(context, load = () => import("./elementsview-m33ejs4r.j
|
|
|
2828
2853
|
}
|
|
2829
2854
|
|
|
2830
2855
|
// src/ui/colors.ts
|
|
2831
|
-
var COLORS_KEY = "
|
|
2856
|
+
var COLORS_KEY = "knobs:colors";
|
|
2832
2857
|
var COLORS_VERSION = 1;
|
|
2833
2858
|
var MOST_COLORS = 8;
|
|
2834
2859
|
function listOf(value) {
|
|
@@ -2868,7 +2893,7 @@ function pickColor(text, options2, list) {
|
|
|
2868
2893
|
}
|
|
2869
2894
|
function loadColors() {
|
|
2870
2895
|
try {
|
|
2871
|
-
return readColors(webStorage("local")
|
|
2896
|
+
return readColors(readItem(webStorage("local"), COLORS_KEY));
|
|
2872
2897
|
} catch {
|
|
2873
2898
|
return readColors(null);
|
|
2874
2899
|
}
|
|
@@ -2877,9 +2902,9 @@ function keepColors(colors) {
|
|
|
2877
2902
|
try {
|
|
2878
2903
|
const local = webStorage("local");
|
|
2879
2904
|
if (colors.mat.length + colors.grab.length === 0)
|
|
2880
|
-
|
|
2905
|
+
removeItem(local, COLORS_KEY);
|
|
2881
2906
|
else
|
|
2882
|
-
local
|
|
2907
|
+
writeItem(local, COLORS_KEY, colorsText(colors));
|
|
2883
2908
|
} catch {}
|
|
2884
2909
|
}
|
|
2885
2910
|
function createColors() {
|
|
@@ -2890,7 +2915,7 @@ function createColors() {
|
|
|
2890
2915
|
listener();
|
|
2891
2916
|
}
|
|
2892
2917
|
function onStorage(event) {
|
|
2893
|
-
if (event.key !==
|
|
2918
|
+
if (event.key !== null && !sameItem(event.key, COLORS_KEY))
|
|
2894
2919
|
return;
|
|
2895
2920
|
if (fresh())
|
|
2896
2921
|
return;
|
|
@@ -6330,7 +6355,7 @@ function isZero(duration) {
|
|
|
6330
6355
|
}
|
|
6331
6356
|
|
|
6332
6357
|
// src/version.ts
|
|
6333
|
-
var VERSION = "0.7.
|
|
6358
|
+
var VERSION = "0.7.1";
|
|
6334
6359
|
|
|
6335
6360
|
// src/ui/settings.ts
|
|
6336
6361
|
var NO_KEY = "not set";
|
|
@@ -8860,7 +8885,7 @@ function createPanel(options2 = {}) {
|
|
|
8860
8885
|
const actionsHere = availableActions();
|
|
8861
8886
|
const bindingsHere = BINDINGS.filter((binding) => (binding !== "grab" || grab !== null) && (binding !== "inspect" && binding !== "elements" || inspect !== null));
|
|
8862
8887
|
const host = document.createElement("div");
|
|
8863
|
-
host
|
|
8888
|
+
markOwn(host, "panel");
|
|
8864
8889
|
host.style.cssText = HOST_STYLE;
|
|
8865
8890
|
const root = host.attachShadow({ mode: "open" });
|
|
8866
8891
|
addStyle(root, HOST_RESET);
|
|
@@ -8879,7 +8904,7 @@ function createPanel(options2 = {}) {
|
|
|
8879
8904
|
searchInput.placeholder = "search knobs";
|
|
8880
8905
|
searchInput.autocomplete = "off";
|
|
8881
8906
|
searchInput.spellcheck = false;
|
|
8882
|
-
searchInput
|
|
8907
|
+
setMark(searchInput, KEYS_FIELD);
|
|
8883
8908
|
searchInput.setAttribute("role", "combobox");
|
|
8884
8909
|
searchInput.setAttribute("aria-label", "find a knob");
|
|
8885
8910
|
searchInput.setAttribute("aria-autocomplete", "list");
|
|
@@ -9684,7 +9709,7 @@ async function grab(elements, options2) {
|
|
|
9684
9709
|
const host = hosted("grab");
|
|
9685
9710
|
if (host)
|
|
9686
9711
|
return host(elements, options2);
|
|
9687
|
-
const loaded = await import("./index-
|
|
9712
|
+
const loaded = await import("./index-cqymjce4.js");
|
|
9688
9713
|
return loaded.grab(elements, options2);
|
|
9689
9714
|
}
|
|
9690
9715
|
function edits2() {
|
|
@@ -9696,7 +9721,7 @@ async function setEdits(list) {
|
|
|
9696
9721
|
return host(list);
|
|
9697
9722
|
if (!Array.isArray(list))
|
|
9698
9723
|
throw new TypeError("knobs: setEdits takes a list of edits, as edits() gives them");
|
|
9699
|
-
const { replayEdits } = await import("./replay-
|
|
9724
|
+
const { replayEdits } = await import("./replay-48gn27bj.js");
|
|
9700
9725
|
const { applied, skipped } = replayEdits(edits, list);
|
|
9701
9726
|
return { applied, skipped };
|
|
9702
9727
|
}
|
|
@@ -9713,7 +9738,7 @@ function forceState2(target, states = []) {
|
|
|
9713
9738
|
var api = { mount, unmount, getState: getState2, setState: setState2, reset: reset2, replay: replay2, grab, describe: describe2, ready: ready2, edits: edits2, setEdits, undoEdit, forceState: forceState2 };
|
|
9714
9739
|
|
|
9715
9740
|
// src/react.tsx
|
|
9716
|
-
function
|
|
9741
|
+
function Knobs(props) {
|
|
9717
9742
|
const options2 = useRef(props);
|
|
9718
9743
|
useEffect(() => {
|
|
9719
9744
|
mount(options2.current);
|
|
@@ -9721,6 +9746,8 @@ function DevKnobs(props) {
|
|
|
9721
9746
|
}, []);
|
|
9722
9747
|
return null;
|
|
9723
9748
|
}
|
|
9749
|
+
var DevKnobs = Knobs;
|
|
9724
9750
|
export {
|
|
9751
|
+
Knobs,
|
|
9725
9752
|
DevKnobs
|
|
9726
9753
|
};
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseHtml,
|
|
10
10
|
rulesOf,
|
|
11
11
|
textEdit
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-dvtbh3c8.js";
|
|
13
13
|
import {
|
|
14
14
|
REASONS,
|
|
15
15
|
RISK,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
riskyAttribute,
|
|
18
18
|
riskyElement,
|
|
19
19
|
riskyNodes
|
|
20
|
-
} from "./index-
|
|
21
|
-
import"./index-
|
|
20
|
+
} from "./index-n31pn4ax.js";
|
|
21
|
+
import"./index-6t0w5s7p.js";
|
|
22
22
|
import {
|
|
23
23
|
NEW_RULE_SHEET,
|
|
24
24
|
cssOff,
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
offIn,
|
|
29
29
|
ruleOf,
|
|
30
30
|
sheetIdOf
|
|
31
|
-
} from "./index-
|
|
32
|
-
import"./index-
|
|
33
|
-
import"./index-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
31
|
+
} from "./index-szd9bddn.js";
|
|
32
|
+
import"./index-vmz7htwn.js";
|
|
33
|
+
import"./index-vhda420r.js";
|
|
34
|
+
import"./index-311fys81.js";
|
|
35
|
+
import"./index-3dcgysws.js";
|
|
36
36
|
|
|
37
37
|
// src/edit/replay.ts
|
|
38
38
|
var AFTER_MISSED = "an earlier edit it may depend on was not made";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
parseHtml,
|
|
11
11
|
rulesOf,
|
|
12
12
|
textEdit
|
|
13
|
-
} from "./react-
|
|
13
|
+
} from "./react-4ezjf7mq.js";
|
|
14
14
|
import {
|
|
15
15
|
REASONS,
|
|
16
16
|
RISK,
|
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
riskyAttribute,
|
|
19
19
|
riskyElement,
|
|
20
20
|
riskyNodes
|
|
21
|
-
} from "./react-
|
|
22
|
-
import"./react-
|
|
21
|
+
} from "./react-w94cfn87.js";
|
|
22
|
+
import"./react-4tcwpama.js";
|
|
23
23
|
import {
|
|
24
24
|
NEW_RULE_SHEET,
|
|
25
25
|
cssOff,
|
|
@@ -29,11 +29,11 @@ import {
|
|
|
29
29
|
offIn,
|
|
30
30
|
ruleOf,
|
|
31
31
|
sheetIdOf
|
|
32
|
-
} from "./react-
|
|
33
|
-
import"./react-
|
|
34
|
-
import"./react-
|
|
35
|
-
import"./react-
|
|
36
|
-
import"./react-
|
|
32
|
+
} from "./react-dg4bjv3j.js";
|
|
33
|
+
import"./react-rxw73n04.js";
|
|
34
|
+
import"./react-hdneb4v3.js";
|
|
35
|
+
import"./react-rbmk30xk.js";
|
|
36
|
+
import"./react-4qn9vsjw.js";
|
|
37
37
|
|
|
38
38
|
// src/edit/replay.ts
|
|
39
39
|
var AFTER_MISSED = "an earlier edit it may depend on was not made";
|
package/dist/storage/onload.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the page above did, and the two share their storage.
|
|
8
8
|
*/
|
|
9
9
|
/** Where the presets are kept, in `localStorage`, through devknobs' own gateway. */
|
|
10
|
-
export declare const PRESETS_KEY = "
|
|
10
|
+
export declare const PRESETS_KEY = "knobs:storage-presets";
|
|
11
11
|
/** The version of what `PRESETS_KEY` keeps. Bump it with a new shape, see stored.ts. */
|
|
12
12
|
export declare const PRESETS_VERSION = 1;
|
|
13
13
|
type Fields = Record<string, unknown>;
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
cookieText,
|
|
7
7
|
put,
|
|
8
8
|
storedPresets
|
|
9
|
-
} from "./react-
|
|
9
|
+
} from "./react-7tzwahsm.js";
|
|
10
10
|
import {
|
|
11
11
|
copyText
|
|
12
|
-
} from "./react-
|
|
12
|
+
} from "./react-j87bdhhe.js";
|
|
13
13
|
import {
|
|
14
14
|
branch,
|
|
15
15
|
codeBlock,
|
|
@@ -31,22 +31,25 @@ import {
|
|
|
31
31
|
textArea,
|
|
32
32
|
textField,
|
|
33
33
|
toolbar
|
|
34
|
-
} from "./react-
|
|
35
|
-
import"./react-
|
|
36
|
-
import"./react-
|
|
34
|
+
} from "./react-rxw73n04.js";
|
|
35
|
+
import"./react-ppyj3fg2.js";
|
|
36
|
+
import"./react-tet7swk2.js";
|
|
37
37
|
import {
|
|
38
38
|
icon
|
|
39
|
-
} from "./react-
|
|
39
|
+
} from "./react-hdneb4v3.js";
|
|
40
40
|
import {
|
|
41
|
+
isOwnKey,
|
|
42
|
+
removeItem,
|
|
41
43
|
stamped,
|
|
42
|
-
webStorage
|
|
43
|
-
|
|
44
|
+
webStorage,
|
|
45
|
+
writeItem
|
|
46
|
+
} from "./react-rbmk30xk.js";
|
|
44
47
|
import"./react-fp73vhyd.js";
|
|
45
|
-
import"./react-
|
|
48
|
+
import"./react-4qn9vsjw.js";
|
|
46
49
|
|
|
47
50
|
// src/storage/site.ts
|
|
48
51
|
function isOwn(key) {
|
|
49
|
-
return key
|
|
52
|
+
return isOwnKey(key);
|
|
50
53
|
}
|
|
51
54
|
function nameOf(error) {
|
|
52
55
|
if (typeof error !== "object" || error === null)
|
|
@@ -1031,9 +1034,9 @@ function savePresets(presets) {
|
|
|
1031
1034
|
return "presets are not kept here";
|
|
1032
1035
|
try {
|
|
1033
1036
|
if (presets.length === 0)
|
|
1034
|
-
|
|
1037
|
+
removeItem(storage, PRESETS_KEY);
|
|
1035
1038
|
else
|
|
1036
|
-
storage
|
|
1039
|
+
writeItem(storage, PRESETS_KEY, JSON.stringify(stamped({ presets }, PRESETS_VERSION)));
|
|
1037
1040
|
return null;
|
|
1038
1041
|
} catch {
|
|
1039
1042
|
return "cannot keep the preset: the storage is full";
|
|
@@ -2133,7 +2136,7 @@ var NODE_ICONS = { database: "database", store: "table-2", cache: "file" };
|
|
|
2133
2136
|
var POLL_MS = 1000;
|
|
2134
2137
|
var FOLD_MS = 200;
|
|
2135
2138
|
var NOT_READ = "cannot read";
|
|
2136
|
-
var OWN_GROUP = "
|
|
2139
|
+
var OWN_GROUP = "knobs";
|
|
2137
2140
|
var kept = { expanded: new Set, seeded: false };
|
|
2138
2141
|
function labelOf(kind) {
|
|
2139
2142
|
return STORAGE_KINDS.find((entry) => entry.value === kind)?.label ?? kind;
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
cookieText,
|
|
6
6
|
put,
|
|
7
7
|
storedPresets
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-82y8x8vv.js";
|
|
9
9
|
import {
|
|
10
10
|
copyText
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-585hs9tp.js";
|
|
12
12
|
import {
|
|
13
13
|
branch,
|
|
14
14
|
codeBlock,
|
|
@@ -30,22 +30,25 @@ import {
|
|
|
30
30
|
textArea,
|
|
31
31
|
textField,
|
|
32
32
|
toolbar
|
|
33
|
-
} from "./index-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
33
|
+
} from "./index-vmz7htwn.js";
|
|
34
|
+
import"./index-a23nv5j4.js";
|
|
35
|
+
import"./index-bgzyc7rz.js";
|
|
36
36
|
import {
|
|
37
37
|
icon
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-vhda420r.js";
|
|
39
39
|
import {
|
|
40
|
+
isOwnKey,
|
|
41
|
+
removeItem,
|
|
40
42
|
stamped,
|
|
41
|
-
webStorage
|
|
42
|
-
|
|
43
|
+
webStorage,
|
|
44
|
+
writeItem
|
|
45
|
+
} from "./index-311fys81.js";
|
|
43
46
|
import"./index-a974q3aa.js";
|
|
44
|
-
import"./index-
|
|
47
|
+
import"./index-3dcgysws.js";
|
|
45
48
|
|
|
46
49
|
// src/storage/site.ts
|
|
47
50
|
function isOwn(key) {
|
|
48
|
-
return key
|
|
51
|
+
return isOwnKey(key);
|
|
49
52
|
}
|
|
50
53
|
function nameOf(error) {
|
|
51
54
|
if (typeof error !== "object" || error === null)
|
|
@@ -1030,9 +1033,9 @@ function savePresets(presets) {
|
|
|
1030
1033
|
return "presets are not kept here";
|
|
1031
1034
|
try {
|
|
1032
1035
|
if (presets.length === 0)
|
|
1033
|
-
|
|
1036
|
+
removeItem(storage, PRESETS_KEY);
|
|
1034
1037
|
else
|
|
1035
|
-
storage
|
|
1038
|
+
writeItem(storage, PRESETS_KEY, JSON.stringify(stamped({ presets }, PRESETS_VERSION)));
|
|
1036
1039
|
return null;
|
|
1037
1040
|
} catch {
|
|
1038
1041
|
return "cannot keep the preset: the storage is full";
|
|
@@ -2132,7 +2135,7 @@ var NODE_ICONS = { database: "database", store: "table-2", cache: "file" };
|
|
|
2132
2135
|
var POLL_MS = 1000;
|
|
2133
2136
|
var FOLD_MS = 200;
|
|
2134
2137
|
var NOT_READ = "cannot read";
|
|
2135
|
-
var OWN_GROUP = "
|
|
2138
|
+
var OWN_GROUP = "knobs";
|
|
2136
2139
|
var kept = { expanded: new Set, seeded: false };
|
|
2137
2140
|
function labelOf(kind) {
|
|
2138
2141
|
return STORAGE_KINDS.find((entry) => entry.value === kind)?.label ?? kind;
|
package/dist/styles/force.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* states is copied into a stylesheet of devknobs' own, with each such
|
|
9
9
|
* pseudo-class `:hover` written `:is(:hover, [data-devknobs-force~="hover"])`:
|
|
10
10
|
* as heavy as before, and true where the page has the state for real too.
|
|
11
|
+
* The element carries `data-knobs-force` too, which the copied rules leave
|
|
12
|
+
* out: every copy writes the old name, an older one on the page only that.
|
|
11
13
|
* The copy keeps the `@media`, `@supports`, `@container`, `@layer` and
|
|
12
14
|
* `@scope` around a rule, and nested rules come out whole. One element at a
|
|
13
15
|
* time. Forcing is no edit: the log never sees it. To use it:
|
|
@@ -33,7 +35,7 @@ import { type Scope } from "./tree";
|
|
|
33
35
|
export declare const FORCED_STATES: readonly ["hover", "focus", "focus-visible", "active", "focus-within"];
|
|
34
36
|
export type ForcedState = (typeof FORCED_STATES)[number];
|
|
35
37
|
/** The attribute that carries the states forced, on the element and on its ancestors. */
|
|
36
|
-
export declare const FORCE_ATTRIBUTE
|
|
38
|
+
export declare const FORCE_ATTRIBUTE: "data-devknobs-force";
|
|
37
39
|
/** A selector as it matches while states are forced. The same where it has none of them. */
|
|
38
40
|
export declare function forcedSelector(selector: string): string;
|
|
39
41
|
/** Whether a state is forced anywhere now. */
|
package/dist/types.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface ClockValue {
|
|
|
53
53
|
since: number;
|
|
54
54
|
/** Clock ms per real ms while it runs. */
|
|
55
55
|
speed: number;
|
|
56
|
-
/** Send the clock's instant to the page's own origin, in an `x-
|
|
56
|
+
/** Send the clock's instant to the page's own origin, in an `x-knobs-now` header, and the old `x-devknobs-now`. */
|
|
57
57
|
header: boolean;
|
|
58
58
|
}
|
|
59
59
|
/** Emulated `navigator.onLine`. Requests still go out: only the flag and its events change. */
|
|
@@ -170,7 +170,7 @@ export interface PanelValue {
|
|
|
170
170
|
*/
|
|
171
171
|
pinned: string[];
|
|
172
172
|
}
|
|
173
|
-
export interface
|
|
173
|
+
export interface KnobsState {
|
|
174
174
|
scheme: SchemeValue;
|
|
175
175
|
motion: MotionValue;
|
|
176
176
|
speed: SpeedValue;
|
|
@@ -225,8 +225,8 @@ export interface DevknobsState {
|
|
|
225
225
|
panel: PanelValue;
|
|
226
226
|
}
|
|
227
227
|
/** A partial state update. Object knobs may be patched field by field. */
|
|
228
|
-
export type
|
|
229
|
-
[K in keyof
|
|
228
|
+
export type KnobsStatePatch = {
|
|
229
|
+
[K in keyof KnobsState]?: KnobsState[K] extends object ? Partial<KnobsState[K]> : KnobsState[K];
|
|
230
230
|
};
|
|
231
231
|
/** Every knob module applies a value and can put the page back the way it was. */
|
|
232
232
|
export interface Knob<T> {
|
package/dist/ui/actions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KnobsState, KnobsStatePatch } from "../types";
|
|
2
2
|
import type { Action } from "./catalog";
|
|
3
3
|
import { type Keys } from "./keys";
|
|
4
4
|
/**
|
|
@@ -8,8 +8,8 @@ import { type Keys } from "./keys";
|
|
|
8
8
|
*/
|
|
9
9
|
/** Where the knobs are kept, as far as running an action goes. */
|
|
10
10
|
export interface Store {
|
|
11
|
-
getState():
|
|
12
|
-
setState(patch:
|
|
11
|
+
getState(): KnobsState;
|
|
12
|
+
setState(patch: KnobsStatePatch): unknown;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Run an action from the panel: from its row, the search, the browse list or
|
package/dist/ui/bindings.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type BaseKeys, type Binding, type Combo, type KeyLike, type Keys } from
|
|
|
4
4
|
* hold across reloads and in new tabs of the origin. Reset all leaves them. A
|
|
5
5
|
* mount with a `keysStore` keeps them there instead.
|
|
6
6
|
*/
|
|
7
|
-
export declare const KEYS_KEY = "
|
|
7
|
+
export declare const KEYS_KEY = "knobs:keys";
|
|
8
8
|
/** The version of the keys `KEYS_KEY` keeps. Bump it with a new shape, see stored.ts. */
|
|
9
9
|
export declare const KEYS_VERSION = 1;
|
|
10
10
|
/** The bindings in the order the panel lists them. */
|
package/dist/ui/catalog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomColor,
|
|
1
|
+
import type { CustomColor, KnobsState, KnobsStatePatch } from "../types";
|
|
2
2
|
import type { ColorList } from "./colors";
|
|
3
3
|
import type { IconName } from "./icons";
|
|
4
4
|
import type { Binding } from "./keys";
|
|
@@ -54,13 +54,13 @@ export interface Knob {
|
|
|
54
54
|
/** More words search finds the knob by. */
|
|
55
55
|
aliases: readonly string[];
|
|
56
56
|
/** The value that is on, as one of the option values where it is one. */
|
|
57
|
-
read(state:
|
|
57
|
+
read(state: KnobsState): string;
|
|
58
58
|
/** The patch that sets the knob to a value. */
|
|
59
|
-
write(value: string, state:
|
|
59
|
+
write(value: string, state: KnobsState): KnobsStatePatch;
|
|
60
60
|
/** The patch that puts the knob back to its default. */
|
|
61
|
-
reset:
|
|
61
|
+
reset: KnobsStatePatch;
|
|
62
62
|
/** The knob's part of its row's summary, asked only while it is off its default. */
|
|
63
|
-
brief?(state:
|
|
63
|
+
brief?(state: KnobsState, live: Live): string;
|
|
64
64
|
/** What a value outside the options is called. */
|
|
65
65
|
name?(value: string): string;
|
|
66
66
|
/** A value typed out in full that is not an option, or null. */
|
|
@@ -72,14 +72,14 @@ export interface Knob {
|
|
|
72
72
|
/** False where the browser has nothing for the knob to act on. */
|
|
73
73
|
available?(): boolean;
|
|
74
74
|
/** The option values the editor shows for this state, in order, where they depend on it. */
|
|
75
|
-
offers?(state:
|
|
75
|
+
offers?(state: KnobsState): readonly string[];
|
|
76
76
|
/** False while the knob does nothing, so the editor hides it. Search still sets it. */
|
|
77
|
-
shown?(state:
|
|
77
|
+
shown?(state: KnobsState): boolean;
|
|
78
78
|
/**
|
|
79
79
|
* The value another knob brought, which stands in for the default while it
|
|
80
80
|
* does: such a value puts the knob off nothing, and its row's `×` puts it back.
|
|
81
81
|
*/
|
|
82
|
-
base?(state:
|
|
82
|
+
base?(state: KnobsState): string | undefined;
|
|
83
83
|
/** The list of colors of the user's own its swatches take, each one a value as its hex. */
|
|
84
84
|
custom?: ColorList;
|
|
85
85
|
/** Show the value it has at once, with no way there, as a color still being picked asks. */
|
|
@@ -168,9 +168,9 @@ export declare function rowOf(id: KnobId): KnobRow;
|
|
|
168
168
|
export declare function availableKnobs(): Knob[];
|
|
169
169
|
/** The knobs of a row this browser can use. */
|
|
170
170
|
export declare function knobsOf(row: Row): Knob[];
|
|
171
|
-
export declare function offDefault(knob: Knob, state:
|
|
171
|
+
export declare function offDefault(knob: Knob, state: KnobsState): boolean;
|
|
172
172
|
/** The knob's part of a row summary, empty while it is at its default. */
|
|
173
|
-
export declare function brief(knob: Knob, state:
|
|
173
|
+
export declare function brief(knob: Knob, state: KnobsState, live: Live): string;
|
|
174
174
|
/** The actions this page has something for. */
|
|
175
175
|
export declare function availableActions(): Action[];
|
|
176
176
|
/** Whether the row has a place on this page: a row of knobs always, an action's where it has one. */
|
|
@@ -181,13 +181,13 @@ export declare function rowHere(row: Row): boolean;
|
|
|
181
181
|
* place is, not as a mode: it lists no row and reset all has nothing of it to
|
|
182
182
|
* put back.
|
|
183
183
|
*/
|
|
184
|
-
export declare function isActive(row: Row, state:
|
|
184
|
+
export declare function isActive(row: Row, state: KnobsState): boolean;
|
|
185
185
|
/** What the row says it emulates, such as `390 · dpr 2`. Empty while it emulates nothing. */
|
|
186
|
-
export declare function summary(row: Row, state:
|
|
186
|
+
export declare function summary(row: Row, state: KnobsState, live: Live): string;
|
|
187
187
|
/** Patches as one, merged a level deep like the store merges them. */
|
|
188
|
-
export declare function combine(patches: readonly
|
|
188
|
+
export declare function combine(patches: readonly KnobsStatePatch[]): KnobsStatePatch;
|
|
189
189
|
/** The patch that puts every knob of the row back to its default. */
|
|
190
|
-
export declare function resetPatch(row: Row):
|
|
190
|
+
export declare function resetPatch(row: Row): KnobsStatePatch;
|
|
191
191
|
/** The browse list: every knob the browser can use, by category. */
|
|
192
192
|
export declare function browse(): {
|
|
193
193
|
category: Category;
|