@vinena/knobs 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +7 -6
- package/dist/context-amfyasb5.js +23 -0
- package/dist/context-svtr7vwt.js +22 -0
- package/dist/early.global.js +5 -5
- package/dist/edit/css.d.ts +59 -0
- package/dist/edit/html.d.ts +91 -0
- package/dist/edit/keep.d.ts +175 -0
- package/dist/edit/log.d.ts +107 -0
- package/dist/edit/replay.d.ts +28 -0
- package/dist/edit/risk.d.ts +33 -0
- package/dist/edit/rule.d.ts +31 -0
- package/dist/edit/source.d.ts +12 -0
- package/dist/edit/text.d.ts +66 -0
- package/dist/elementsview-fyc06wjt.js +3702 -0
- package/dist/elementsview-k6zvvcne.js +3701 -0
- package/dist/engine/dock.d.ts +3 -4
- package/dist/engine/frame.d.ts +1 -1
- package/dist/engine/style.d.ts +15 -0
- package/dist/{framekit-cjz0e4y8.js → framekit-622h6w1f.js} +54 -47
- package/dist/{framekit-yk1jxjv7.js → framekit-yx612r28.js} +54 -47
- package/dist/index-0zp9py56.js +859 -0
- package/dist/{index-prjpx67p.js → index-1mstjadm.js} +126 -2167
- package/dist/{index-begsqdm0.js → index-4a4x1bt2.js} +1 -1
- package/dist/index-58jdczmj.js +44 -0
- package/dist/index-5tv6sr74.js +23 -0
- package/dist/index-6bc2ztfd.js +688 -0
- package/dist/index-7cb4x1vj.js +1885 -0
- package/dist/index-a974q3aa.js +34 -0
- package/dist/{index-q73py563.js → index-aymfvd8s.js} +1 -1
- package/dist/{index-zt3rheck.js → index-aynkv7qk.js} +11 -8
- package/dist/{index-p57fdttx.js → index-dzm8ywq0.js} +492 -2365
- package/dist/{index-9jhatmky.js → index-f60yax1j.js} +13 -8
- package/dist/index-f67wctn3.js +1858 -0
- package/dist/{index-vgfn2n1h.js → index-ftjdt358.js} +8 -171
- package/dist/{index-j1h13ahg.js → index-gm51cthv.js} +2 -45
- package/dist/index-kfdzsyyw.js +1859 -0
- package/dist/index-t4kssacm.js +208 -0
- package/dist/index-v0ht9q0g.js +1518 -0
- package/dist/{index-6wbgqkdz.js → index-x59vz1xx.js} +247 -905
- package/dist/index-xh39jtkq.js +32 -0
- package/dist/index-yb7fc59g.js +718 -0
- package/dist/index-zd6adby9.js +496 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.global.js +410 -152
- package/dist/index.js +504 -482
- package/dist/react-0wepdf60.js +1519 -0
- package/dist/{react-gefkdkdz.js → react-1gqwa2yw.js} +1 -1
- package/dist/{index-sn2y6j09.js → react-3mfz1x2a.js} +126 -2167
- package/dist/react-4rbjw9af.js +33 -0
- package/dist/react-5rq7bnsy.js +210 -0
- package/dist/react-6bz05qk1.js +860 -0
- package/dist/{react-qgz9afa2.js → react-6fnxxs30.js} +8 -171
- package/dist/react-6q2cw2ya.js +689 -0
- package/dist/{react-7vjfsh40.js → react-6t4dbdzn.js} +11 -8
- package/dist/react-88es9b5q.js +719 -0
- package/dist/react-97b5b8j4.js +46 -0
- package/dist/{react-mmq2zya3.js → react-bxzn8vq5.js} +1 -1
- package/dist/{react-3rhdj2k1.js → react-cs62p9qh.js} +62 -720
- package/dist/react-ethftdxp.js +497 -0
- package/dist/react-fp73vhyd.js +36 -0
- package/dist/{react-qfpg79hs.js → react-me102s1a.js} +2 -45
- package/dist/react-t2qnewz2.js +24 -0
- package/dist/react-ttj8f9qp.js +1886 -0
- package/dist/{react-806qmkyz.js → react-v8497a41.js} +13 -8
- package/dist/{react-6tss0r9f.js → react-wqn4sx0n.js} +265 -2137
- package/dist/react.js +500 -482
- package/dist/replay-j18rw92k.js +258 -0
- package/dist/replay-vtg0vqj2.js +257 -0
- package/dist/{storageview-7cv0vpdm.js → storageview-6xj7zb63.js} +11 -7
- package/dist/{storageview-dyhpgt8f.js → storageview-pzn8yaad.js} +11 -7
- package/dist/styles/force.d.ts +66 -0
- package/dist/ui/bindings.d.ts +31 -5
- package/dist/ui/changes.d.ts +49 -0
- package/dist/ui/cssauto.d.ts +119 -0
- package/dist/ui/cssedit.d.ts +80 -0
- package/dist/ui/domedit.d.ts +99 -0
- package/dist/ui/domtree.d.ts +26 -1
- package/dist/ui/elementsview.d.ts +19 -2
- package/dist/ui/htmledit.d.ts +62 -0
- package/dist/ui/inspector.d.ts +6 -1
- package/dist/ui/keys.d.ts +12 -8
- package/dist/ui/pane.d.ts +0 -2
- package/dist/ui/panel.d.ts +3 -0
- package/dist/ui/prefs.d.ts +30 -10
- package/dist/ui/settings.d.ts +2 -0
- package/dist/ui/size.d.ts +14 -22
- package/dist/ui/stylesview.d.ts +30 -1
- package/package.json +1 -1
- package/skills/devknobs/SKILL.md +95 -0
- package/dist/elementsview-1wsxcdtj.js +0 -2874
- package/dist/elementsview-3kv34jfx.js +0 -2873
- package/dist/index-78r0f8pw.js +0 -27
- package/dist/react-adky72h9.js +0 -29
package/dist/index.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FADE_CURVE,
|
|
3
|
-
PAGE_MIN,
|
|
4
|
-
dockRoom,
|
|
5
|
-
dockWidth,
|
|
6
3
|
ease,
|
|
7
4
|
keepMounted,
|
|
8
|
-
lerp
|
|
9
|
-
|
|
10
|
-
watchColumn
|
|
11
|
-
} from "./index-j1h13ahg.js";
|
|
5
|
+
lerp
|
|
6
|
+
} from "./index-gm51cthv.js";
|
|
12
7
|
import {
|
|
13
8
|
GRAB_COLORS as GRAB_COLORS2,
|
|
14
9
|
GRAB_COLOR_NAMES,
|
|
@@ -17,15 +12,51 @@ import {
|
|
|
17
12
|
createGrab,
|
|
18
13
|
createInspect,
|
|
19
14
|
oneAtATime
|
|
20
|
-
} from "./index-
|
|
15
|
+
} from "./index-f60yax1j.js";
|
|
21
16
|
import {
|
|
22
17
|
hushOnce
|
|
23
|
-
} from "./index-
|
|
18
|
+
} from "./index-aymfvd8s.js";
|
|
19
|
+
import {
|
|
20
|
+
DRAG_SLOP,
|
|
21
|
+
FLING_SPAN,
|
|
22
|
+
FLING_TRAVEL,
|
|
23
|
+
GLIDE,
|
|
24
|
+
between,
|
|
25
|
+
clearForced,
|
|
26
|
+
cornerAt,
|
|
27
|
+
createPrefs,
|
|
28
|
+
createSizer,
|
|
29
|
+
dockedHandle,
|
|
30
|
+
dragDocked,
|
|
31
|
+
dragTarget,
|
|
32
|
+
dragTo,
|
|
33
|
+
forceState,
|
|
34
|
+
glideTime,
|
|
35
|
+
landSide,
|
|
36
|
+
otherSide,
|
|
37
|
+
settle,
|
|
38
|
+
translateOf,
|
|
39
|
+
velocity
|
|
40
|
+
} from "./index-yb7fc59g.js";
|
|
41
|
+
import {
|
|
42
|
+
dockRoom,
|
|
43
|
+
dockWidth,
|
|
44
|
+
setDockWidth,
|
|
45
|
+
watchColumn
|
|
46
|
+
} from "./index-58jdczmj.js";
|
|
47
|
+
import {
|
|
48
|
+
edits,
|
|
49
|
+
forgetReplay,
|
|
50
|
+
framedPage,
|
|
51
|
+
pageSettled,
|
|
52
|
+
pathNow,
|
|
53
|
+
startKeep,
|
|
54
|
+
stopKeep
|
|
55
|
+
} from "./index-0zp9py56.js";
|
|
24
56
|
import {
|
|
25
57
|
label
|
|
26
|
-
} from "./index-
|
|
58
|
+
} from "./index-zd6adby9.js";
|
|
27
59
|
import {
|
|
28
|
-
PANE_WIDTH,
|
|
29
60
|
appliedOnLoad,
|
|
30
61
|
applyOnLoad,
|
|
31
62
|
closePane,
|
|
@@ -38,7 +69,7 @@ import {
|
|
|
38
69
|
showPane,
|
|
39
70
|
stopOnLoad,
|
|
40
71
|
viewHead
|
|
41
|
-
} from "./index-
|
|
72
|
+
} from "./index-aynkv7qk.js";
|
|
42
73
|
import {
|
|
43
74
|
actButton,
|
|
44
75
|
button,
|
|
@@ -67,59 +98,40 @@ import {
|
|
|
67
98
|
tabBar,
|
|
68
99
|
textField,
|
|
69
100
|
toolbar
|
|
70
|
-
} from "./index-
|
|
101
|
+
} from "./index-4a4x1bt2.js";
|
|
71
102
|
import {
|
|
72
|
-
BINDING_ICONS,
|
|
73
103
|
BODY_CAP,
|
|
74
104
|
HOST_RESET,
|
|
75
|
-
KEYS_FIELD,
|
|
76
105
|
LAYER,
|
|
77
106
|
LOCALE_PRESETS,
|
|
78
107
|
READ_MS,
|
|
79
|
-
ROW_ICONS,
|
|
80
108
|
SPEED_MAX,
|
|
81
109
|
SPEED_MIN,
|
|
82
110
|
TIME_ZONE_PRESETS,
|
|
83
111
|
canonicalTag,
|
|
84
112
|
canonicalZone,
|
|
85
|
-
comboLabel,
|
|
86
|
-
comboSpoken,
|
|
87
|
-
comboText,
|
|
88
|
-
defaultKeys,
|
|
89
113
|
devIconFor,
|
|
90
114
|
devIconShown,
|
|
91
|
-
escapeStep,
|
|
92
115
|
exports_engine,
|
|
93
116
|
foldRest,
|
|
94
|
-
forwardKeys,
|
|
95
117
|
frameWindow,
|
|
96
118
|
getState,
|
|
97
|
-
glyph,
|
|
98
|
-
highlightAt,
|
|
99
119
|
holdInTopLayer,
|
|
100
120
|
holdingHinge,
|
|
101
121
|
hostSendsUa,
|
|
102
|
-
icon,
|
|
103
|
-
isFunctionKey,
|
|
104
|
-
isSearchKey,
|
|
105
122
|
keepPlace,
|
|
106
|
-
keyAction,
|
|
107
123
|
landSplash,
|
|
108
124
|
letGo,
|
|
109
|
-
lowerKey,
|
|
110
125
|
moveHinge,
|
|
111
126
|
nativeSwitch,
|
|
112
127
|
onCount,
|
|
113
128
|
overflowCount,
|
|
114
|
-
paletteMove,
|
|
115
129
|
panelSized,
|
|
116
|
-
parseCombo,
|
|
117
130
|
ready,
|
|
118
131
|
replay,
|
|
119
132
|
requestLog,
|
|
120
133
|
reset,
|
|
121
134
|
resolveTimeZone,
|
|
122
|
-
rowIcon,
|
|
123
135
|
sends,
|
|
124
136
|
setNative,
|
|
125
137
|
setState,
|
|
@@ -127,13 +139,49 @@ import {
|
|
|
127
139
|
stop,
|
|
128
140
|
subscribe,
|
|
129
141
|
takeHinge,
|
|
130
|
-
typeAhead,
|
|
131
142
|
watchFold,
|
|
132
143
|
watchHinge,
|
|
133
144
|
watchPanel,
|
|
134
|
-
zoomAction,
|
|
135
145
|
zoomKey
|
|
136
|
-
} from "./index-
|
|
146
|
+
} from "./index-x59vz1xx.js";
|
|
147
|
+
import {
|
|
148
|
+
MAT_COLORS,
|
|
149
|
+
MAT_COLOR_NAMES,
|
|
150
|
+
UA_PRESETS,
|
|
151
|
+
isMac,
|
|
152
|
+
isMatName,
|
|
153
|
+
layoutOf,
|
|
154
|
+
layoutOptions,
|
|
155
|
+
matGradient,
|
|
156
|
+
mockOf,
|
|
157
|
+
platformOf,
|
|
158
|
+
runsUnderBars,
|
|
159
|
+
uaPreset,
|
|
160
|
+
userAgentOf
|
|
161
|
+
} from "./index-7cb4x1vj.js";
|
|
162
|
+
import {
|
|
163
|
+
BINDING_ICONS,
|
|
164
|
+
KEYS_FIELD,
|
|
165
|
+
ROW_ICONS,
|
|
166
|
+
comboLabel,
|
|
167
|
+
comboSpoken,
|
|
168
|
+
comboText,
|
|
169
|
+
defaultKeys,
|
|
170
|
+
escapeStep,
|
|
171
|
+
forwardKeys,
|
|
172
|
+
glyph,
|
|
173
|
+
highlightAt,
|
|
174
|
+
icon,
|
|
175
|
+
isFunctionKey,
|
|
176
|
+
isSearchKey,
|
|
177
|
+
keyAction,
|
|
178
|
+
lowerKey,
|
|
179
|
+
paletteMove,
|
|
180
|
+
parseCombo,
|
|
181
|
+
rowIcon,
|
|
182
|
+
typeAhead,
|
|
183
|
+
zoomAction
|
|
184
|
+
} from "./index-6bc2ztfd.js";
|
|
137
185
|
import {
|
|
138
186
|
BARS,
|
|
139
187
|
BROWSERS,
|
|
@@ -154,8 +202,6 @@ import {
|
|
|
154
202
|
GEO_ERRORS,
|
|
155
203
|
GEO_PRESETS,
|
|
156
204
|
GRAB_COLORS,
|
|
157
|
-
MAT_COLORS,
|
|
158
|
-
MAT_COLOR_NAMES,
|
|
159
205
|
MOTIONS,
|
|
160
206
|
NativeDate,
|
|
161
207
|
ONLINES,
|
|
@@ -169,12 +215,10 @@ import {
|
|
|
169
215
|
TEXT_MAX,
|
|
170
216
|
TEXT_MIN,
|
|
171
217
|
TRANSPARENCIES,
|
|
172
|
-
UA_PRESETS,
|
|
173
218
|
VISIONS,
|
|
174
219
|
ZOOM_MAX,
|
|
175
220
|
ZOOM_MIN,
|
|
176
221
|
ZOOM_PRESETS,
|
|
177
|
-
__require,
|
|
178
222
|
addStyle,
|
|
179
223
|
deviceOf,
|
|
180
224
|
formId,
|
|
@@ -184,35 +228,29 @@ import {
|
|
|
184
228
|
hasTouch,
|
|
185
229
|
isCustomColor,
|
|
186
230
|
isDevknobsFrame,
|
|
187
|
-
isMac,
|
|
188
|
-
isMatName,
|
|
189
231
|
knobFrame,
|
|
190
|
-
layoutOf,
|
|
191
|
-
layoutOptions,
|
|
192
|
-
matGradient,
|
|
193
|
-
mockOf,
|
|
194
232
|
needsFrame,
|
|
195
233
|
newer,
|
|
196
234
|
now,
|
|
197
235
|
openOf,
|
|
198
236
|
parseColor,
|
|
199
237
|
percent,
|
|
200
|
-
platformOf,
|
|
201
238
|
readColor,
|
|
202
239
|
readMessage,
|
|
203
240
|
realNow,
|
|
204
241
|
resolveGeo,
|
|
205
242
|
rewriteMediaText,
|
|
206
|
-
runsUnderBars,
|
|
207
243
|
setSystemMedia,
|
|
208
244
|
stamped,
|
|
209
245
|
still,
|
|
210
246
|
toHex,
|
|
211
|
-
uaPreset,
|
|
212
|
-
userAgentOf,
|
|
213
247
|
watchSystemMedia,
|
|
214
248
|
webStorage
|
|
215
|
-
} from "./index-
|
|
249
|
+
} from "./index-dzm8ywq0.js";
|
|
250
|
+
import"./index-a974q3aa.js";
|
|
251
|
+
import {
|
|
252
|
+
__require
|
|
253
|
+
} from "./index-5tv6sr74.js";
|
|
216
254
|
|
|
217
255
|
// src/ui/knobs.ts
|
|
218
256
|
var MINUTE = 60000;
|
|
@@ -1704,6 +1742,8 @@ var BINDINGS = [
|
|
|
1704
1742
|
"replay",
|
|
1705
1743
|
"requests",
|
|
1706
1744
|
"storage",
|
|
1745
|
+
"elements",
|
|
1746
|
+
"settings",
|
|
1707
1747
|
"reset"
|
|
1708
1748
|
];
|
|
1709
1749
|
var BINDING_WORDS = {
|
|
@@ -1713,7 +1753,9 @@ var BINDING_WORDS = {
|
|
|
1713
1753
|
replay: "replay animations",
|
|
1714
1754
|
requests: "requests",
|
|
1715
1755
|
storage: "storage",
|
|
1716
|
-
reset: "reset"
|
|
1756
|
+
reset: "reset",
|
|
1757
|
+
elements: "elements",
|
|
1758
|
+
settings: "settings"
|
|
1717
1759
|
};
|
|
1718
1760
|
var RESERVED_LETTERS = new Set([..."cvxzawrtqlnfpshm"]);
|
|
1719
1761
|
var ZOOM_KEYS = new Set(["=", "-", "_", "0"]);
|
|
@@ -1743,8 +1785,6 @@ function clashText(combo) {
|
|
|
1743
1785
|
function comboProblem(combo, binding, others = {}) {
|
|
1744
1786
|
if (!keepable(combo.key))
|
|
1745
1787
|
return "use a letter, digit, symbol or F1 to F12";
|
|
1746
|
-
if (bare(combo) && !isFunctionKey(combo.key))
|
|
1747
|
-
return "add a modifier, alone it types";
|
|
1748
1788
|
if (isReserved(combo))
|
|
1749
1789
|
return "the browser uses it";
|
|
1750
1790
|
if (combo.key === "/" && !combo.meta && !combo.ctrl && !combo.alt)
|
|
@@ -1808,6 +1848,9 @@ function readKeys(json) {
|
|
|
1808
1848
|
} catch {
|
|
1809
1849
|
return {};
|
|
1810
1850
|
}
|
|
1851
|
+
return keysOf(value);
|
|
1852
|
+
}
|
|
1853
|
+
function keysOf(value) {
|
|
1811
1854
|
if (newer(value, KEYS_VERSION))
|
|
1812
1855
|
return {};
|
|
1813
1856
|
const stored = record(value);
|
|
@@ -1869,10 +1912,41 @@ function keepKeys(keys) {
|
|
|
1869
1912
|
webStorage("local")?.setItem(KEYS_KEY, JSON.stringify(stamped(keys, KEYS_VERSION)));
|
|
1870
1913
|
} catch {}
|
|
1871
1914
|
}
|
|
1915
|
+
function keysListed(keys, listed) {
|
|
1916
|
+
const here = { ...keys };
|
|
1917
|
+
for (const binding of BINDINGS) {
|
|
1918
|
+
if (binding !== "panel" && !listed.includes(binding))
|
|
1919
|
+
here[binding] = null;
|
|
1920
|
+
}
|
|
1921
|
+
return here;
|
|
1922
|
+
}
|
|
1872
1923
|
function createKeys(options2 = {}) {
|
|
1873
1924
|
const base = defaultKeys(options2);
|
|
1874
1925
|
const grab = options2.grab !== false;
|
|
1875
|
-
|
|
1926
|
+
const store = options2.store ?? null;
|
|
1927
|
+
function load() {
|
|
1928
|
+
if (!store)
|
|
1929
|
+
return loadKeys();
|
|
1930
|
+
if (fresh())
|
|
1931
|
+
return {};
|
|
1932
|
+
try {
|
|
1933
|
+
return keysOf(store.load());
|
|
1934
|
+
} catch {
|
|
1935
|
+
return {};
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
function keep(keys2) {
|
|
1939
|
+
if (!store) {
|
|
1940
|
+
keepKeys(keys2);
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1943
|
+
if (fresh())
|
|
1944
|
+
return;
|
|
1945
|
+
try {
|
|
1946
|
+
store.save(stamped(keys2, KEYS_VERSION));
|
|
1947
|
+
} catch {}
|
|
1948
|
+
}
|
|
1949
|
+
let stored = load();
|
|
1876
1950
|
let keys = resolveKeys(base, stored, grab);
|
|
1877
1951
|
const listeners = new Set;
|
|
1878
1952
|
function changed() {
|
|
@@ -1883,12 +1957,16 @@ function createKeys(options2 = {}) {
|
|
|
1883
1957
|
function onStorage(event) {
|
|
1884
1958
|
if (event.key !== KEYS_KEY && event.key !== null)
|
|
1885
1959
|
return;
|
|
1960
|
+
heard();
|
|
1961
|
+
}
|
|
1962
|
+
function heard() {
|
|
1886
1963
|
if (fresh())
|
|
1887
1964
|
return;
|
|
1888
|
-
stored =
|
|
1965
|
+
stored = load();
|
|
1889
1966
|
changed();
|
|
1890
1967
|
}
|
|
1891
|
-
|
|
1968
|
+
const stopStore = store?.subscribe(heard) ?? null;
|
|
1969
|
+
if (!store && typeof window !== "undefined")
|
|
1892
1970
|
window.addEventListener("storage", onStorage);
|
|
1893
1971
|
return {
|
|
1894
1972
|
get: () => keys,
|
|
@@ -1903,7 +1981,7 @@ function createKeys(options2 = {}) {
|
|
|
1903
1981
|
else
|
|
1904
1982
|
next[binding] = comboText(combo);
|
|
1905
1983
|
stored = next;
|
|
1906
|
-
|
|
1984
|
+
keep(stored);
|
|
1907
1985
|
changed();
|
|
1908
1986
|
},
|
|
1909
1987
|
subscribe(listener) {
|
|
@@ -1915,6 +1993,7 @@ function createKeys(options2 = {}) {
|
|
|
1915
1993
|
recording: false,
|
|
1916
1994
|
destroy() {
|
|
1917
1995
|
listeners.clear();
|
|
1996
|
+
stopStore?.();
|
|
1918
1997
|
if (typeof window !== "undefined")
|
|
1919
1998
|
window.removeEventListener("storage", onStorage);
|
|
1920
1999
|
}
|
|
@@ -2277,122 +2356,6 @@ function createDockSlide(context) {
|
|
|
2277
2356
|
};
|
|
2278
2357
|
}
|
|
2279
2358
|
|
|
2280
|
-
// src/ui/place.ts
|
|
2281
|
-
var DRAG_SLOP = 4;
|
|
2282
|
-
var FLING_SPAN = 150;
|
|
2283
|
-
var FLING_STRETCH = 40;
|
|
2284
|
-
var FLING_LEAST = 8;
|
|
2285
|
-
var FLING = 0.5;
|
|
2286
|
-
var FLING_LEAN = 1.5;
|
|
2287
|
-
var FLING_TRAVEL = 16;
|
|
2288
|
-
var GLIDE = 220;
|
|
2289
|
-
var GLIDE_MAX = 440;
|
|
2290
|
-
var GLIDE_SPEED = 6;
|
|
2291
|
-
var PANEL_GAP = 8;
|
|
2292
|
-
var SNAP = 24;
|
|
2293
|
-
function dragTarget(shift, open) {
|
|
2294
|
-
return open && !shift ? "panel" : "handle";
|
|
2295
|
-
}
|
|
2296
|
-
function otherSide(side) {
|
|
2297
|
-
return side === "right" ? "left" : "right";
|
|
2298
|
-
}
|
|
2299
|
-
function between(value, min, max) {
|
|
2300
|
-
return Math.min(Math.max(value, min), Math.max(min, max));
|
|
2301
|
-
}
|
|
2302
|
-
function snap(value, min, max) {
|
|
2303
|
-
const end = Math.max(min, max);
|
|
2304
|
-
const at = between(value, min, end);
|
|
2305
|
-
if (at - min <= SNAP && at - min <= end - at)
|
|
2306
|
-
return min;
|
|
2307
|
-
return end - at <= SNAP ? end : at;
|
|
2308
|
-
}
|
|
2309
|
-
function edgeOf(value, min, max, had) {
|
|
2310
|
-
const top = Math.abs(value - min) < 0.5;
|
|
2311
|
-
const bottom = Math.abs(value - max) < 0.5;
|
|
2312
|
-
if (top && bottom)
|
|
2313
|
-
return had === "none" ? "top" : had;
|
|
2314
|
-
return top ? "top" : bottom ? "bottom" : "none";
|
|
2315
|
-
}
|
|
2316
|
-
function settle(place, room, anchor = "edge") {
|
|
2317
|
-
const last = room.view - PANEL_GAP - room.panel;
|
|
2318
|
-
const pull = anchor === "top" ? between : snap;
|
|
2319
|
-
const top = pull(anchor === "top" || place.edge === "none" ? place.top : place.edge === "top" ? PANEL_GAP : last, PANEL_GAP, last);
|
|
2320
|
-
const low = top + room.panel - room.handle;
|
|
2321
|
-
const y = pull(place.tab === "top" ? top : place.tab === "bottom" ? low : place.y, top, low);
|
|
2322
|
-
return {
|
|
2323
|
-
y,
|
|
2324
|
-
top,
|
|
2325
|
-
edge: edgeOf(top, PANEL_GAP, last, place.edge),
|
|
2326
|
-
tab: edgeOf(y, top, low, place.tab)
|
|
2327
|
-
};
|
|
2328
|
-
}
|
|
2329
|
-
function cornerAt(y, top, room) {
|
|
2330
|
-
return edgeOf(y, top, top + room.panel - room.handle, "none");
|
|
2331
|
-
}
|
|
2332
|
-
function dragTo(target, open, to, from, room) {
|
|
2333
|
-
const offset = from.y - from.top;
|
|
2334
|
-
if (target === "panel") {
|
|
2335
|
-
const top = snap(to, PANEL_GAP, room.view - PANEL_GAP - room.panel);
|
|
2336
|
-
return settle({ y: top + offset, top, edge: "none", tab: "none" }, room);
|
|
2337
|
-
}
|
|
2338
|
-
if (open)
|
|
2339
|
-
return settle({ ...from, y: to, tab: "none" }, room);
|
|
2340
|
-
const y = snap(to, PANEL_GAP, room.view - PANEL_GAP - room.handle);
|
|
2341
|
-
return settle({ y, top: y - offset, edge: "none", tab: "none" }, room);
|
|
2342
|
-
}
|
|
2343
|
-
function dragDocked(to, from, room) {
|
|
2344
|
-
const y = snap(to, PANEL_GAP, room.view - PANEL_GAP - room.handle);
|
|
2345
|
-
return { y, top: y - (from.y - from.top), edge: "none", tab: from.tab };
|
|
2346
|
-
}
|
|
2347
|
-
function dockedHandle(y, room) {
|
|
2348
|
-
return between(y, PANEL_GAP, room.view - PANEL_GAP - room.handle);
|
|
2349
|
-
}
|
|
2350
|
-
function speedOf(from, to) {
|
|
2351
|
-
const time = to.t - from.t;
|
|
2352
|
-
return { x: (to.x - from.x) / time, y: (to.y - from.y) / time };
|
|
2353
|
-
}
|
|
2354
|
-
function velocity(samples, at) {
|
|
2355
|
-
const recent = samples.filter((sample) => sample.t >= at - FLING_SPAN && sample.t <= at);
|
|
2356
|
-
let fastest = { x: 0, y: 0 };
|
|
2357
|
-
let read = false;
|
|
2358
|
-
for (const [index, end] of recent.entries()) {
|
|
2359
|
-
let start2;
|
|
2360
|
-
for (const sample of recent.slice(0, index)) {
|
|
2361
|
-
if (end.t - sample.t >= FLING_STRETCH)
|
|
2362
|
-
start2 = sample;
|
|
2363
|
-
}
|
|
2364
|
-
if (!start2)
|
|
2365
|
-
continue;
|
|
2366
|
-
const speed = speedOf(start2, end);
|
|
2367
|
-
if (!read || Math.hypot(speed.x, speed.y) > Math.hypot(fastest.x, fastest.y))
|
|
2368
|
-
fastest = speed;
|
|
2369
|
-
read = true;
|
|
2370
|
-
}
|
|
2371
|
-
const first = recent[0];
|
|
2372
|
-
const last = recent[recent.length - 1];
|
|
2373
|
-
if (!read && first && last && last.t - first.t >= FLING_LEAST)
|
|
2374
|
-
return speedOf(first, last);
|
|
2375
|
-
return fastest;
|
|
2376
|
-
}
|
|
2377
|
-
function glideTime(distance) {
|
|
2378
|
-
return between(distance / GLIDE_SPEED, GLIDE, GLIDE_MAX);
|
|
2379
|
-
}
|
|
2380
|
-
function landSide(side, x, width, vx, vy) {
|
|
2381
|
-
const other = otherSide(side);
|
|
2382
|
-
const toward = side === "right" ? -vx : vx;
|
|
2383
|
-
const across = Math.abs(vx) >= FLING && Math.abs(vx) > FLING_LEAN * Math.abs(vy);
|
|
2384
|
-
const past = side === "right" ? x < width / 2 : x > width / 2;
|
|
2385
|
-
if (across && toward > 0)
|
|
2386
|
-
return other;
|
|
2387
|
-
if (across && toward < 0)
|
|
2388
|
-
return side;
|
|
2389
|
-
return past ? other : side;
|
|
2390
|
-
}
|
|
2391
|
-
function translateOf(value) {
|
|
2392
|
-
const [x = 0, y = 0] = value === "none" ? [] : value.split(" ").map((part) => parseFloat(part));
|
|
2393
|
-
return { x: Number.isFinite(x) ? x : 0, y: Number.isFinite(y) ? y : 0 };
|
|
2394
|
-
}
|
|
2395
|
-
|
|
2396
2359
|
// src/ui/drag.ts
|
|
2397
2360
|
function createDrag(context) {
|
|
2398
2361
|
const { host, wrap, handle, panel } = context;
|
|
@@ -2671,7 +2634,7 @@ var PANE = { openPane, paneView, onPane, retitlePane, showPane };
|
|
|
2671
2634
|
function here(element) {
|
|
2672
2635
|
return element.isConnected && element.ownerDocument.defaultView !== null;
|
|
2673
2636
|
}
|
|
2674
|
-
function createInspector(context, load = () => import("./elementsview-
|
|
2637
|
+
function createInspector(context, load = () => import("./elementsview-k6zvvcne.js").then(({ createElementsView }) => ({ createStylesView: createElementsView })), pane = PANE) {
|
|
2675
2638
|
const { inspect, tips, prefs } = context;
|
|
2676
2639
|
const listeners = new Set;
|
|
2677
2640
|
let view = null;
|
|
@@ -2689,6 +2652,14 @@ function createInspector(context, load = () => import("./elementsview-3kv34jfx.j
|
|
|
2689
2652
|
function current() {
|
|
2690
2653
|
return held && here(held) ? held : null;
|
|
2691
2654
|
}
|
|
2655
|
+
function pageBody() {
|
|
2656
|
+
try {
|
|
2657
|
+
const page = framed ? frameWindow()?.document : typeof document === "undefined" ? undefined : document;
|
|
2658
|
+
return page?.body ?? null;
|
|
2659
|
+
} catch {
|
|
2660
|
+
return null;
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2692
2663
|
function point(element) {
|
|
2693
2664
|
if (element && inspect.isOn())
|
|
2694
2665
|
return;
|
|
@@ -2724,7 +2695,9 @@ function createInspector(context, load = () => import("./elementsview-3kv34jfx.j
|
|
|
2724
2695
|
},
|
|
2725
2696
|
...prefs && {
|
|
2726
2697
|
mode: { get: () => prefs.get().stylesMode, set: prefs.setStylesMode },
|
|
2727
|
-
box: { get: () => prefs.get().stylesBox, set: prefs.setStylesBox }
|
|
2698
|
+
box: { get: () => prefs.get().stylesBox, set: prefs.setStylesBox },
|
|
2699
|
+
diff: { get: () => prefs.get().changesDiff, set: prefs.setChangesDiff },
|
|
2700
|
+
htmlSize: { get: () => ({ height: prefs.get().htmlHeight, full: prefs.get().htmlFull }), set: prefs.setHtmlSize }
|
|
2728
2701
|
}
|
|
2729
2702
|
});
|
|
2730
2703
|
view = made;
|
|
@@ -2808,6 +2781,18 @@ function createInspector(context, load = () => import("./elementsview-3kv34jfx.j
|
|
|
2808
2781
|
else
|
|
2809
2782
|
inspect.set(true);
|
|
2810
2783
|
},
|
|
2784
|
+
elements() {
|
|
2785
|
+
if (inspect.isOn())
|
|
2786
|
+
inspect.set(false);
|
|
2787
|
+
if (!current()) {
|
|
2788
|
+
const body = pageBody();
|
|
2789
|
+
if (view)
|
|
2790
|
+
view.show(body);
|
|
2791
|
+
else
|
|
2792
|
+
hold(body);
|
|
2793
|
+
}
|
|
2794
|
+
reveal2();
|
|
2795
|
+
},
|
|
2811
2796
|
picked() {
|
|
2812
2797
|
const element = current();
|
|
2813
2798
|
return element ? label(element) : null;
|
|
@@ -4076,296 +4061,6 @@ function createPalette(context) {
|
|
|
4076
4061
|
};
|
|
4077
4062
|
}
|
|
4078
4063
|
|
|
4079
|
-
// src/ui/size.ts
|
|
4080
|
-
var LIST_WIDTH = 240;
|
|
4081
|
-
var VIEW_WIDTH = PANE_WIDTH;
|
|
4082
|
-
var LIST_MIN = 240;
|
|
4083
|
-
var VIEW_MIN = 280;
|
|
4084
|
-
var WIDTH_MAX = 720;
|
|
4085
|
-
var PAGE_ROOM = 96;
|
|
4086
|
-
function pageRoom(docked) {
|
|
4087
|
-
return docked ? PAGE_MIN : PAGE_ROOM;
|
|
4088
|
-
}
|
|
4089
|
-
var WIDTH_STEP = 16;
|
|
4090
|
-
var HANDLE_REACH = 21;
|
|
4091
|
-
function widthLimits(showing, view, page = PAGE_ROOM) {
|
|
4092
|
-
const min = showing === "view" ? VIEW_MIN : LIST_MIN;
|
|
4093
|
-
return { min, max: Math.max(min, Math.min(WIDTH_MAX, view - page)) };
|
|
4094
|
-
}
|
|
4095
|
-
function widthIn(showing, wanted, view, page = PAGE_ROOM) {
|
|
4096
|
-
const { min, max } = widthLimits(showing, view, page);
|
|
4097
|
-
const room = view - HANDLE_REACH - PANEL_GAP;
|
|
4098
|
-
return Math.max(LIST_MIN, Math.min(Math.round(between(wanted, min, max)), room));
|
|
4099
|
-
}
|
|
4100
|
-
function dragWidth(from, travel, side) {
|
|
4101
|
-
return from + (side === "right" ? -travel : travel);
|
|
4102
|
-
}
|
|
4103
|
-
function keyWidth(key, width, limits, side) {
|
|
4104
|
-
if (key === "Home")
|
|
4105
|
-
return limits.min;
|
|
4106
|
-
if (key === "End")
|
|
4107
|
-
return limits.max;
|
|
4108
|
-
if (key !== "ArrowLeft" && key !== "ArrowRight")
|
|
4109
|
-
return null;
|
|
4110
|
-
const wider = key === "ArrowLeft" === (side === "right");
|
|
4111
|
-
return between(width + (wider ? WIDTH_STEP : -WIDTH_STEP), limits.min, limits.max);
|
|
4112
|
-
}
|
|
4113
|
-
function widthGlides(cue) {
|
|
4114
|
-
return !cue.first && !cue.dragging && !cue.resizing;
|
|
4115
|
-
}
|
|
4116
|
-
function createSizer(context) {
|
|
4117
|
-
const { host, wrap, panel, prefs } = context;
|
|
4118
|
-
const strip = document.createElement("div");
|
|
4119
|
-
strip.className = "sizer";
|
|
4120
|
-
strip.tabIndex = 0;
|
|
4121
|
-
strip.setAttribute("role", "separator");
|
|
4122
|
-
strip.setAttribute("aria-orientation", "vertical");
|
|
4123
|
-
strip.setAttribute("aria-label", "panel width");
|
|
4124
|
-
let shown2 = null;
|
|
4125
|
-
let held = null;
|
|
4126
|
-
function viewWidth() {
|
|
4127
|
-
return document.documentElement.clientWidth || window.innerWidth;
|
|
4128
|
-
}
|
|
4129
|
-
function put(width) {
|
|
4130
|
-
wrap.style.setProperty("--panel-width", `${width}px`);
|
|
4131
|
-
}
|
|
4132
|
-
function apply(draw, resizing) {
|
|
4133
|
-
const showing = context.showing();
|
|
4134
|
-
const view = viewWidth();
|
|
4135
|
-
const kept = showing === "view" ? prefs.get().viewWidth : prefs.get().listWidth;
|
|
4136
|
-
const page = pageRoom(context.place().docked);
|
|
4137
|
-
const next = widthIn(showing, held?.showing === showing ? held.width : kept, view, page);
|
|
4138
|
-
const from = shown2;
|
|
4139
|
-
const limits = widthLimits(showing, view, page);
|
|
4140
|
-
strip.setAttribute("aria-valuemin", String(limits.min));
|
|
4141
|
-
strip.setAttribute("aria-valuemax", String(limits.max));
|
|
4142
|
-
if (next === from || from !== null && !context.place().open) {
|
|
4143
|
-
draw?.();
|
|
4144
|
-
return;
|
|
4145
|
-
}
|
|
4146
|
-
strip.setAttribute("aria-valuenow", String(next));
|
|
4147
|
-
const glide = widthGlides({ first: from === null, dragging: held !== null, resizing });
|
|
4148
|
-
shown2 = next;
|
|
4149
|
-
context.wide(next);
|
|
4150
|
-
host.style.width = `${HANDLE_REACH + next}px`;
|
|
4151
|
-
panel.style.transitionProperty = "none";
|
|
4152
|
-
put(next);
|
|
4153
|
-
draw?.();
|
|
4154
|
-
if (glide && from !== null)
|
|
4155
|
-
put(from);
|
|
4156
|
-
panel.getBoundingClientRect();
|
|
4157
|
-
panel.style.transitionProperty = "";
|
|
4158
|
-
put(next);
|
|
4159
|
-
if (from !== null)
|
|
4160
|
-
context.sized(glide);
|
|
4161
|
-
}
|
|
4162
|
-
function end(keep) {
|
|
4163
|
-
if (!held)
|
|
4164
|
-
return;
|
|
4165
|
-
const { showing, pointer, width, moved } = held;
|
|
4166
|
-
held = null;
|
|
4167
|
-
delete wrap.dataset.sizing;
|
|
4168
|
-
if (strip.hasPointerCapture(pointer))
|
|
4169
|
-
strip.releasePointerCapture(pointer);
|
|
4170
|
-
if (keep && moved)
|
|
4171
|
-
prefs.setWidth(showing, width);
|
|
4172
|
-
else
|
|
4173
|
-
apply(undefined, false);
|
|
4174
|
-
}
|
|
4175
|
-
strip.addEventListener("pointerdown", (event) => {
|
|
4176
|
-
if (event.button !== 0 || held || shown2 === null)
|
|
4177
|
-
return;
|
|
4178
|
-
held = {
|
|
4179
|
-
showing: context.showing(),
|
|
4180
|
-
pointer: event.pointerId,
|
|
4181
|
-
from: shown2,
|
|
4182
|
-
x: event.clientX,
|
|
4183
|
-
width: shown2,
|
|
4184
|
-
moved: false
|
|
4185
|
-
};
|
|
4186
|
-
wrap.dataset.sizing = "true";
|
|
4187
|
-
strip.setPointerCapture(event.pointerId);
|
|
4188
|
-
});
|
|
4189
|
-
strip.addEventListener("pointermove", (event) => {
|
|
4190
|
-
if (!held || event.pointerId !== held.pointer)
|
|
4191
|
-
return;
|
|
4192
|
-
const { side, docked } = context.place();
|
|
4193
|
-
const wanted = dragWidth(held.from, event.clientX - held.x, side);
|
|
4194
|
-
const width = widthIn(held.showing, wanted, viewWidth(), pageRoom(docked));
|
|
4195
|
-
if (width === held.width)
|
|
4196
|
-
return;
|
|
4197
|
-
held.width = width;
|
|
4198
|
-
held.moved = true;
|
|
4199
|
-
apply(undefined, false);
|
|
4200
|
-
});
|
|
4201
|
-
strip.addEventListener("pointerup", (event) => {
|
|
4202
|
-
if (event.pointerId === held?.pointer)
|
|
4203
|
-
end(true);
|
|
4204
|
-
});
|
|
4205
|
-
strip.addEventListener("pointercancel", (event) => {
|
|
4206
|
-
if (event.pointerId === held?.pointer)
|
|
4207
|
-
end(false);
|
|
4208
|
-
});
|
|
4209
|
-
strip.addEventListener("lostpointercapture", (event) => {
|
|
4210
|
-
if (event.pointerId === held?.pointer)
|
|
4211
|
-
end(false);
|
|
4212
|
-
});
|
|
4213
|
-
strip.addEventListener("dblclick", () => {
|
|
4214
|
-
const showing = context.showing();
|
|
4215
|
-
prefs.setWidth(showing, showing === "view" ? VIEW_WIDTH : LIST_WIDTH);
|
|
4216
|
-
});
|
|
4217
|
-
strip.addEventListener("keydown", (event) => {
|
|
4218
|
-
if (shown2 === null || event.altKey || event.ctrlKey || event.metaKey)
|
|
4219
|
-
return;
|
|
4220
|
-
const showing = context.showing();
|
|
4221
|
-
const { side, docked } = context.place();
|
|
4222
|
-
const limits = widthLimits(showing, viewWidth(), pageRoom(docked));
|
|
4223
|
-
const next = keyWidth(event.key, shown2, limits, side);
|
|
4224
|
-
if (next === null)
|
|
4225
|
-
return;
|
|
4226
|
-
event.preventDefault();
|
|
4227
|
-
prefs.setWidth(showing, next);
|
|
4228
|
-
});
|
|
4229
|
-
return {
|
|
4230
|
-
strip,
|
|
4231
|
-
size: (draw) => apply(draw, false),
|
|
4232
|
-
fit: () => apply(undefined, true),
|
|
4233
|
-
cancel: () => end(false)
|
|
4234
|
-
};
|
|
4235
|
-
}
|
|
4236
|
-
|
|
4237
|
-
// src/ui/prefs.ts
|
|
4238
|
-
var PREFS_KEY = "devknobs:prefs";
|
|
4239
|
-
var PREFS_VERSION = 4;
|
|
4240
|
-
var STYLES_MODE = "simple";
|
|
4241
|
-
var STYLES_BOX = true;
|
|
4242
|
-
var WIDTH_OF = { list: "listWidth", view: "viewWidth" };
|
|
4243
|
-
function readPrefs(json) {
|
|
4244
|
-
let value = null;
|
|
4245
|
-
try {
|
|
4246
|
-
value = json ? JSON.parse(json) : null;
|
|
4247
|
-
} catch {
|
|
4248
|
-
return {};
|
|
4249
|
-
}
|
|
4250
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
4251
|
-
return {};
|
|
4252
|
-
if (newer(value, PREFS_VERSION))
|
|
4253
|
-
return {};
|
|
4254
|
-
const prefs = {};
|
|
4255
|
-
const handle = Reflect.get(value, "handle");
|
|
4256
|
-
if (typeof handle === "boolean")
|
|
4257
|
-
prefs.handle = handle;
|
|
4258
|
-
for (const key of [WIDTH_OF.list, WIDTH_OF.view]) {
|
|
4259
|
-
const width = Reflect.get(value, key);
|
|
4260
|
-
if (typeof width === "number" && Number.isFinite(width) && width > 0)
|
|
4261
|
-
prefs[key] = width;
|
|
4262
|
-
}
|
|
4263
|
-
const mode = Reflect.get(value, "stylesMode");
|
|
4264
|
-
if (mode === "simple" || mode === "advanced")
|
|
4265
|
-
prefs.stylesMode = mode;
|
|
4266
|
-
const box = Reflect.get(value, "stylesBox");
|
|
4267
|
-
if (typeof box === "boolean")
|
|
4268
|
-
prefs.stylesBox = box;
|
|
4269
|
-
return prefs;
|
|
4270
|
-
}
|
|
4271
|
-
function resolvePrefs(base, stored) {
|
|
4272
|
-
return { ...base, ...stored };
|
|
4273
|
-
}
|
|
4274
|
-
function loadPrefs() {
|
|
4275
|
-
try {
|
|
4276
|
-
return readPrefs(webStorage("local")?.getItem(PREFS_KEY));
|
|
4277
|
-
} catch {
|
|
4278
|
-
return {};
|
|
4279
|
-
}
|
|
4280
|
-
}
|
|
4281
|
-
function keepPrefs(prefs) {
|
|
4282
|
-
try {
|
|
4283
|
-
if (Object.keys(prefs).length === 0)
|
|
4284
|
-
webStorage("local")?.removeItem(PREFS_KEY);
|
|
4285
|
-
else
|
|
4286
|
-
webStorage("local")?.setItem(PREFS_KEY, JSON.stringify(stamped(prefs, PREFS_VERSION)));
|
|
4287
|
-
} catch {}
|
|
4288
|
-
}
|
|
4289
|
-
function createPrefs(options2 = {}) {
|
|
4290
|
-
const base = {
|
|
4291
|
-
handle: options2.handle !== false,
|
|
4292
|
-
listWidth: LIST_WIDTH,
|
|
4293
|
-
viewWidth: VIEW_WIDTH,
|
|
4294
|
-
stylesMode: STYLES_MODE,
|
|
4295
|
-
stylesBox: STYLES_BOX
|
|
4296
|
-
};
|
|
4297
|
-
let stored = loadPrefs();
|
|
4298
|
-
let prefs = resolvePrefs(base, stored);
|
|
4299
|
-
const listeners = new Set;
|
|
4300
|
-
function changed() {
|
|
4301
|
-
prefs = resolvePrefs(base, stored);
|
|
4302
|
-
for (const listener of Array.from(listeners))
|
|
4303
|
-
listener();
|
|
4304
|
-
}
|
|
4305
|
-
function keep(next) {
|
|
4306
|
-
stored = next;
|
|
4307
|
-
keepPrefs(stored);
|
|
4308
|
-
changed();
|
|
4309
|
-
}
|
|
4310
|
-
function onStorage(event) {
|
|
4311
|
-
if (event.key !== PREFS_KEY && event.key !== null)
|
|
4312
|
-
return;
|
|
4313
|
-
if (fresh())
|
|
4314
|
-
return;
|
|
4315
|
-
stored = loadPrefs();
|
|
4316
|
-
changed();
|
|
4317
|
-
}
|
|
4318
|
-
if (typeof window !== "undefined")
|
|
4319
|
-
window.addEventListener("storage", onStorage);
|
|
4320
|
-
return {
|
|
4321
|
-
get: () => prefs,
|
|
4322
|
-
setHandle(on) {
|
|
4323
|
-
const next = { ...stored };
|
|
4324
|
-
if (on === base.handle)
|
|
4325
|
-
delete next.handle;
|
|
4326
|
-
else
|
|
4327
|
-
next.handle = on;
|
|
4328
|
-
keep(next);
|
|
4329
|
-
},
|
|
4330
|
-
setWidth(showing, px) {
|
|
4331
|
-
const key = WIDTH_OF[showing];
|
|
4332
|
-
const next = { ...stored };
|
|
4333
|
-
if (px === base[key])
|
|
4334
|
-
delete next[key];
|
|
4335
|
-
else
|
|
4336
|
-
next[key] = px;
|
|
4337
|
-
keep(next);
|
|
4338
|
-
},
|
|
4339
|
-
setStylesMode(mode) {
|
|
4340
|
-
const next = { ...stored };
|
|
4341
|
-
if (mode === base.stylesMode)
|
|
4342
|
-
delete next.stylesMode;
|
|
4343
|
-
else
|
|
4344
|
-
next.stylesMode = mode;
|
|
4345
|
-
keep(next);
|
|
4346
|
-
},
|
|
4347
|
-
setStylesBox(open) {
|
|
4348
|
-
const next = { ...stored };
|
|
4349
|
-
if (open === base.stylesBox)
|
|
4350
|
-
delete next.stylesBox;
|
|
4351
|
-
else
|
|
4352
|
-
next.stylesBox = open;
|
|
4353
|
-
keep(next);
|
|
4354
|
-
},
|
|
4355
|
-
subscribe(listener) {
|
|
4356
|
-
listeners.add(listener);
|
|
4357
|
-
return () => {
|
|
4358
|
-
listeners.delete(listener);
|
|
4359
|
-
};
|
|
4360
|
-
},
|
|
4361
|
-
destroy() {
|
|
4362
|
-
listeners.clear();
|
|
4363
|
-
if (typeof window !== "undefined")
|
|
4364
|
-
window.removeEventListener("storage", onStorage);
|
|
4365
|
-
}
|
|
4366
|
-
};
|
|
4367
|
-
}
|
|
4368
|
-
|
|
4369
4064
|
// src/ui/requestformat.ts
|
|
4370
4065
|
var LIGHT_WHY = "the browser gives a page only timing and size for this";
|
|
4371
4066
|
var HIDDEN = "<hidden>";
|
|
@@ -6885,6 +6580,7 @@ function createSettings(context) {
|
|
|
6885
6580
|
return true;
|
|
6886
6581
|
},
|
|
6887
6582
|
stopRecording,
|
|
6583
|
+
openKeys,
|
|
6888
6584
|
leaveKeys,
|
|
6889
6585
|
destroy: stopRefusing
|
|
6890
6586
|
};
|
|
@@ -6934,7 +6630,7 @@ var CSS = `
|
|
|
6934
6630
|
--edge: 0px;
|
|
6935
6631
|
--edge-line: transparent;
|
|
6936
6632
|
--glide: 220ms;
|
|
6937
|
-
--panel-width:
|
|
6633
|
+
--panel-width: 320px;
|
|
6938
6634
|
/* The columns: what a row keeps clear inside its edges, an icon's width,
|
|
6939
6635
|
the room between an icon and its word, and how far in a line of words
|
|
6940
6636
|
starts and ends. */
|
|
@@ -7041,6 +6737,7 @@ button {
|
|
|
7041
6737
|
}
|
|
7042
6738
|
:focus { outline: none; }
|
|
7043
6739
|
button:focus-visible { outline: 1px solid var(--faint); outline-offset: -1px; }
|
|
6740
|
+
input[type="checkbox"]:focus-visible { outline: 1px solid var(--faint); outline-offset: 1px; }
|
|
7044
6741
|
|
|
7045
6742
|
.handle {
|
|
7046
6743
|
flex: none;
|
|
@@ -7128,7 +6825,7 @@ button:focus-visible { outline: 1px solid var(--faint); outline-offset: -1px; }
|
|
|
7128
6825
|
would stay on the window's edge as a line the panel's height. It hides
|
|
7129
6826
|
once the slide is over. The edge side's border and the padding that pays
|
|
7130
6827
|
for it go once its color has eased out. The width glides to a new one, as
|
|
7131
|
-
|
|
6828
|
+
the strip's keys set it, and the panel turns that off under the strip. */
|
|
7132
6829
|
visibility: hidden;
|
|
7133
6830
|
transition: visibility 0s linear 150ms, border-top-right-radius var(--glide) ease-out,
|
|
7134
6831
|
border-bottom-right-radius var(--glide) ease-out, border-right-color var(--glide) ease-out,
|
|
@@ -8292,6 +7989,7 @@ button:focus-visible { outline: 1px solid var(--faint); outline-offset: -1px; }
|
|
|
8292
7989
|
user-select: text;
|
|
8293
7990
|
-webkit-user-select: text;
|
|
8294
7991
|
}
|
|
7992
|
+
.dom-row { position: relative; }
|
|
8295
7993
|
.dom-row:hover { background: var(--card); }
|
|
8296
7994
|
.dom-row.on { background: var(--card); }
|
|
8297
7995
|
.dom-tree:focus-within .dom-row.on { background: var(--pick); }
|
|
@@ -8299,6 +7997,110 @@ button:focus-visible { outline: 1px solid var(--faint); outline-offset: -1px; }
|
|
|
8299
7997
|
.dom-code { flex: 0 1 auto; min-width: 30ch; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
|
|
8300
7998
|
.dom-ref { white-space: pre; color: var(--faint); }
|
|
8301
7999
|
.dom-code > .act { margin-left: var(--col-pad); height: 1.6em; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6em; vertical-align: top; }
|
|
8000
|
+
/* A line whose element the panel hid, faint as its box on the page is gone. */
|
|
8001
|
+
.dom-hid > .dom-code { opacity: 0.5; }
|
|
8002
|
+
/* The html editor: line numbers on the card's fill beside the text, which is
|
|
8003
|
+
colored by the pre under a clear text box, the two set alike to the
|
|
8004
|
+
pixel, a scrollbar's room kept in both, so a long line wraps at the same
|
|
8005
|
+
place in each and its number stays at its first row. The grip under it
|
|
8006
|
+
drags its height, the button makes it the panel's. */
|
|
8007
|
+
.dom-code:has(> .html-ed), .dom-code:has(> .dom-edit) { flex: 1 1 auto; }
|
|
8008
|
+
.dom-code > .html-ed { display: block; width: 100%; min-width: 30ch; margin: 2px 0; }
|
|
8009
|
+
.html-ed-body {
|
|
8010
|
+
overflow: hidden;
|
|
8011
|
+
background: var(--bg);
|
|
8012
|
+
border-radius: 4px;
|
|
8013
|
+
box-shadow: inset 0 0 0 1px var(--faint);
|
|
8014
|
+
}
|
|
8015
|
+
.html-ed-code {
|
|
8016
|
+
position: relative;
|
|
8017
|
+
height: 100%;
|
|
8018
|
+
overflow: hidden;
|
|
8019
|
+
background: linear-gradient(var(--card), var(--card)) no-repeat;
|
|
8020
|
+
}
|
|
8021
|
+
.html-ed-hl, .html-ed .dom-html {
|
|
8022
|
+
position: absolute;
|
|
8023
|
+
inset: 0;
|
|
8024
|
+
margin: 0;
|
|
8025
|
+
padding: 4px var(--col-pad);
|
|
8026
|
+
font: 11px/1.6 var(--mono);
|
|
8027
|
+
letter-spacing: normal;
|
|
8028
|
+
white-space: pre-wrap;
|
|
8029
|
+
tab-size: 2;
|
|
8030
|
+
overflow-wrap: anywhere;
|
|
8031
|
+
word-break: normal;
|
|
8032
|
+
scrollbar-gutter: stable;
|
|
8033
|
+
scrollbar-width: thin;
|
|
8034
|
+
}
|
|
8035
|
+
.html-ed-hl { padding-left: 0; overflow: hidden; color: var(--fg); pointer-events: none; }
|
|
8036
|
+
.html-ed-hl > .html-ed-inner { display: grid; }
|
|
8037
|
+
.html-ed-num {
|
|
8038
|
+
padding: 0 var(--col-pad);
|
|
8039
|
+
color: var(--faint);
|
|
8040
|
+
text-align: right;
|
|
8041
|
+
user-select: none;
|
|
8042
|
+
-webkit-user-select: none;
|
|
8043
|
+
}
|
|
8044
|
+
.html-ed-text { min-height: 1.6em; padding-left: var(--col-pad); }
|
|
8045
|
+
.html-ed .dom-html {
|
|
8046
|
+
width: 100%;
|
|
8047
|
+
height: 100%;
|
|
8048
|
+
max-height: none;
|
|
8049
|
+
overflow: auto;
|
|
8050
|
+
resize: none;
|
|
8051
|
+
color: transparent;
|
|
8052
|
+
caret-color: var(--fg);
|
|
8053
|
+
background: transparent;
|
|
8054
|
+
border-radius: 0;
|
|
8055
|
+
box-shadow: none;
|
|
8056
|
+
scrollbar-width: thin;
|
|
8057
|
+
}
|
|
8058
|
+
.html-ed .dom-html::selection { background: color-mix(in srgb, var(--faint) 35%, transparent); }
|
|
8059
|
+
.html-ed .dom-html.bad { caret-color: var(--hot); }
|
|
8060
|
+
.html-ed:has(.bad) > .html-ed-body { box-shadow: inset 0 0 0 1px var(--hot); }
|
|
8061
|
+
.html-ed-foot { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
|
|
8062
|
+
.html-ed-grip { flex: 1 1 auto; display: grid; place-items: center; height: 12px; cursor: ns-resize; touch-action: none; }
|
|
8063
|
+
.html-ed-grip::after { content: ""; width: 32px; height: 3px; background: var(--line); border-radius: 2px; transition: background 120ms ease-out; }
|
|
8064
|
+
.html-ed-grip:hover::after { background: var(--faint); }
|
|
8065
|
+
.dom-code > .dom-apply { margin: 4px 0 2px; }
|
|
8066
|
+
/* The selected line's actions, kept in sight at the foot of the tree as it scrolls either way. */
|
|
8067
|
+
.dom-acts {
|
|
8068
|
+
position: sticky;
|
|
8069
|
+
left: 0;
|
|
8070
|
+
bottom: 0;
|
|
8071
|
+
display: flex;
|
|
8072
|
+
flex-wrap: wrap;
|
|
8073
|
+
gap: 4px;
|
|
8074
|
+
padding: 4px var(--view-end) 4px var(--view-start);
|
|
8075
|
+
background: var(--bg);
|
|
8076
|
+
border-top: 1px solid var(--line);
|
|
8077
|
+
}
|
|
8078
|
+
/* The handle that drags an element's line, at the start of its step in: on
|
|
8079
|
+
hover and on the selected line, and always under a finger. The line being
|
|
8080
|
+
dragged is faint; where it would go is a line over or under another, or
|
|
8081
|
+
a ring around the element it would go into. */
|
|
8082
|
+
.dom-grip {
|
|
8083
|
+
position: absolute;
|
|
8084
|
+
top: 0;
|
|
8085
|
+
width: 1.2em;
|
|
8086
|
+
line-height: 1.6;
|
|
8087
|
+
text-align: center;
|
|
8088
|
+
color: var(--faint);
|
|
8089
|
+
cursor: grab;
|
|
8090
|
+
opacity: 0;
|
|
8091
|
+
touch-action: none;
|
|
8092
|
+
user-select: none;
|
|
8093
|
+
-webkit-user-select: none;
|
|
8094
|
+
transition: opacity 120ms ease-out;
|
|
8095
|
+
}
|
|
8096
|
+
.dom-row:hover > .dom-grip, .dom-row.on > .dom-grip { opacity: 1; }
|
|
8097
|
+
@media (hover: none) { .dom-grip { opacity: 0.6; } }
|
|
8098
|
+
.dom-grip:hover { color: var(--fg); }
|
|
8099
|
+
.dom-drag, .dom-drag * { cursor: grabbing; }
|
|
8100
|
+
.dom-dragging > .dom-code { opacity: 0.45; }
|
|
8101
|
+
.dom-drop-before { box-shadow: inset 0 2px 0 var(--fg); }
|
|
8102
|
+
.dom-drop-after { box-shadow: inset 0 -2px 0 var(--fg); }
|
|
8103
|
+
.dom-drop-into { box-shadow: inset 0 0 0 1px var(--fg); }
|
|
8302
8104
|
.dom-flash { animation: dom-flash 900ms ease-out; }
|
|
8303
8105
|
@keyframes dom-flash {
|
|
8304
8106
|
from { background: var(--pick); }
|
|
@@ -8363,8 +8165,9 @@ button:focus-visible { outline: 1px solid var(--faint); outline-offset: -1px; }
|
|
|
8363
8165
|
text-overflow: ellipsis;
|
|
8364
8166
|
white-space: nowrap;
|
|
8365
8167
|
}
|
|
8366
|
-
/* A declaration that wraps goes on further in than it starts.
|
|
8367
|
-
|
|
8168
|
+
/* A declaration that wraps goes on further in than it starts. Every line
|
|
8169
|
+
keeps the gutter an editable line's box stands in, so no text moves. */
|
|
8170
|
+
.css-decl { display: block; padding-left: 30px; text-indent: -12px; text-decoration: none; }
|
|
8368
8171
|
/* A name has the color of a key, its value the text's, and the marks between
|
|
8369
8172
|
them are quiet. A declaration that is struck through is quiet all over. */
|
|
8370
8173
|
.css-name { color: var(--key); }
|
|
@@ -8412,10 +8215,143 @@ s.css-decl, s.css-decl .css-var, s.css-decl .css-name { color: var(--faint); tex
|
|
|
8412
8215
|
padding-right: var(--view-end);
|
|
8413
8216
|
padding-left: var(--view-start);
|
|
8414
8217
|
}
|
|
8415
|
-
.css-applied .css-decl { padding-left: 12px; }
|
|
8416
8218
|
.css-label { font-size: 10.5px; color: var(--faint); }
|
|
8417
8219
|
.css-comes { color: var(--faint); }
|
|
8418
8220
|
.css-hidden { padding: 2px var(--view-end) 2px var(--view-start); font-size: 10.5px; color: var(--faint); overflow-wrap: anywhere; }
|
|
8221
|
+
/* Editing, as in the browsers' tools: a checkbox in a line's gutter turns
|
|
8222
|
+
it off and on, shown on hover, on focus and on a line that is off. Its
|
|
8223
|
+
ring and its check are cut out of a fill by a mask, so they follow the
|
|
8224
|
+
theme with no line drawn. A value is a
|
|
8225
|
+
field on a click, as wide as what it holds, on the track's fill, its text
|
|
8226
|
+
red where the page did not take it. Adding a property is a quiet line
|
|
8227
|
+
under a block, in from its edge as a declaration's first line is. */
|
|
8228
|
+
.css-decl.can-edit { position: relative; }
|
|
8229
|
+
.css-toggle {
|
|
8230
|
+
position: absolute;
|
|
8231
|
+
top: 2.5px;
|
|
8232
|
+
left: 2px;
|
|
8233
|
+
width: 12px;
|
|
8234
|
+
height: 12px;
|
|
8235
|
+
opacity: 0;
|
|
8236
|
+
background: var(--faint);
|
|
8237
|
+
border-radius: 3px;
|
|
8238
|
+
cursor: pointer;
|
|
8239
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill-rule='evenodd' d='M3 0h6a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3zm0 1.25C2 1.25 1.25 2 1.25 3v6c0 1 .75 1.75 1.75 1.75h6c1 0 1.75-.75 1.75-1.75V3c0-1-.75-1.75-1.75-1.75z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
|
|
8240
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill-rule='evenodd' d='M3 0h6a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3zm0 1.25C2 1.25 1.25 2 1.25 3v6c0 1 .75 1.75 1.75 1.75h6c1 0 1.75-.75 1.75-1.75V3c0-1-.75-1.75-1.75-1.75z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
|
|
8241
|
+
transition: opacity 120ms ease-out;
|
|
8242
|
+
}
|
|
8243
|
+
.css-toggle:checked {
|
|
8244
|
+
background: var(--fg);
|
|
8245
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill-rule='evenodd' d='M3 0h6a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3zM2.6 6.1 3.7 5l1.6 1.6 3.4-3.4 1.1 1.1-4.5 4.5z'/%3E%3C/svg%3E");
|
|
8246
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill-rule='evenodd' d='M3 0h6a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3zM2.6 6.1 3.7 5l1.6 1.6 3.4-3.4 1.1 1.1-4.5 4.5z'/%3E%3C/svg%3E");
|
|
8247
|
+
}
|
|
8248
|
+
.css-decl.can-edit:hover > .css-toggle, .css-toggle:focus-visible, .css-decl.off > .css-toggle { opacity: 1; }
|
|
8249
|
+
.css-editable { border-radius: 2px; cursor: text; }
|
|
8250
|
+
.css-editable:hover, .css-editable:focus-visible { background: var(--track); }
|
|
8251
|
+
/* A field wraps where its value is wider than its line, and grows down, as
|
|
8252
|
+
tall as what it holds up to a height it scrolls in: nothing scrolls sideways. */
|
|
8253
|
+
.css-edit {
|
|
8254
|
+
max-width: 100%;
|
|
8255
|
+
max-height: 18em;
|
|
8256
|
+
padding: 0;
|
|
8257
|
+
font: inherit;
|
|
8258
|
+
text-indent: 0;
|
|
8259
|
+
vertical-align: top;
|
|
8260
|
+
white-space: pre-wrap;
|
|
8261
|
+
overflow-wrap: anywhere;
|
|
8262
|
+
overflow: hidden auto;
|
|
8263
|
+
resize: none;
|
|
8264
|
+
scrollbar-width: thin;
|
|
8265
|
+
color: var(--fg);
|
|
8266
|
+
background: var(--track);
|
|
8267
|
+
border-radius: 2px;
|
|
8268
|
+
}
|
|
8269
|
+
.css-edit.bad { color: var(--hot); }
|
|
8270
|
+
/* The field's ring, as a chip's field has it while focused, in place of the browser's border. */
|
|
8271
|
+
.inline-field { border: 0; box-shadow: inset 0 0 0 1px var(--faint); }
|
|
8272
|
+
.css-add, .css-adding { padding-left: 18px; }
|
|
8273
|
+
.css-add, .css-new-rule {
|
|
8274
|
+
display: block;
|
|
8275
|
+
font: 11px/1.5 var(--mono);
|
|
8276
|
+
color: var(--faint);
|
|
8277
|
+
border-radius: 2px;
|
|
8278
|
+
transition: color 120ms ease-out;
|
|
8279
|
+
}
|
|
8280
|
+
.css-add:hover, .css-new-rule:hover { color: var(--fg); }
|
|
8281
|
+
.css-adding { text-indent: 0; }
|
|
8282
|
+
/* The suggestions under a field of the styles view: a raised list placed
|
|
8283
|
+
under the field, the one marked in the selected line's tint. */
|
|
8284
|
+
.ac-list {
|
|
8285
|
+
position: absolute;
|
|
8286
|
+
z-index: 3;
|
|
8287
|
+
display: grid;
|
|
8288
|
+
min-width: 16ch;
|
|
8289
|
+
max-width: 100%;
|
|
8290
|
+
max-height: 12.8em;
|
|
8291
|
+
overflow-y: auto;
|
|
8292
|
+
padding: 2px 0;
|
|
8293
|
+
font: 11px/1.6 var(--mono);
|
|
8294
|
+
text-indent: 0;
|
|
8295
|
+
white-space: nowrap;
|
|
8296
|
+
color: var(--fg);
|
|
8297
|
+
background: var(--raised);
|
|
8298
|
+
border-radius: 4px;
|
|
8299
|
+
box-shadow: var(--lift), 0 0 0 1px var(--line);
|
|
8300
|
+
scrollbar-width: thin;
|
|
8301
|
+
}
|
|
8302
|
+
.ac-item { padding: 0 var(--col-pad); overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
|
|
8303
|
+
.ac-item:hover { background: var(--card); }
|
|
8304
|
+
.ac-item[aria-selected="true"] { background: var(--pick); }
|
|
8305
|
+
/* The line that adds a rule stands under the blocks, as the start of one. */
|
|
8306
|
+
.css-new-rule { justify-self: start; padding: 2px var(--view-end) 2px var(--view-start); }
|
|
8307
|
+
.css-rule-adding { padding: 2px var(--view-end) 2px var(--view-start); }
|
|
8308
|
+
/* The states a chip forces, in the editors' chips, the selector's font. */
|
|
8309
|
+
.force-states { padding: 0 var(--view-end) 4px var(--view-start); }
|
|
8310
|
+
.force-states .chip { font: 11px/22px var(--mono); }
|
|
8311
|
+
|
|
8312
|
+
/* The changes at the foot of the Elements view, which stay in sight while
|
|
8313
|
+
the styles scroll: a quiet head, each edit as diff lines tinted for what
|
|
8314
|
+
went and what came, then the buttons, the prompt the filled one. */
|
|
8315
|
+
.changes {
|
|
8316
|
+
position: sticky;
|
|
8317
|
+
bottom: 0;
|
|
8318
|
+
/* Over the styles' bar where the two meet, with a long list. */
|
|
8319
|
+
z-index: 2;
|
|
8320
|
+
display: grid;
|
|
8321
|
+
grid-template-columns: minmax(0, 1fr);
|
|
8322
|
+
gap: 6px;
|
|
8323
|
+
padding: 8px var(--view-end) 8px var(--view-start);
|
|
8324
|
+
background: var(--bg);
|
|
8325
|
+
border-top: 1px solid var(--line);
|
|
8326
|
+
}
|
|
8327
|
+
.changes-head, .changes-note { font-size: 10.5px; color: var(--faint); }
|
|
8328
|
+
/* The count is the button that folds the diff out, its chevron turned while it shows. */
|
|
8329
|
+
.changes-toggle { color: inherit; border-radius: 2px; transition: color 120ms ease-out; }
|
|
8330
|
+
.changes-toggle:hover { color: var(--fg); }
|
|
8331
|
+
.changes-toggle::before { content: "›"; display: inline-block; width: 2ch; text-align: left; transform-origin: 0.5ch 50%; transition: transform 120ms ease-out; }
|
|
8332
|
+
.changes-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
|
|
8333
|
+
/* What was made again as the page loaded, and the edits that were not. */
|
|
8334
|
+
.changes-kept { display: grid; gap: 2px; font-size: 11px; }
|
|
8335
|
+
.changes-kept-line { color: var(--fg); }
|
|
8336
|
+
.changes-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
|
|
8337
|
+
.changes-missed { padding-left: var(--col-pad); font: 10.5px/1.5 var(--mono); color: var(--faint); overflow-wrap: anywhere; }
|
|
8338
|
+
/* The switch that keeps the edits after a reload, over the tree. */
|
|
8339
|
+
.keep-line { padding: 4px 0 6px; border-bottom: 1px solid var(--line); }
|
|
8340
|
+
.keep-line .knob-label { color: var(--fg); }
|
|
8341
|
+
.changes-list {
|
|
8342
|
+
max-height: 30vh;
|
|
8343
|
+
overflow: auto;
|
|
8344
|
+
font: 11px/1.5 var(--mono);
|
|
8345
|
+
overflow-wrap: anywhere;
|
|
8346
|
+
scrollbar-width: thin;
|
|
8347
|
+
}
|
|
8348
|
+
.diff-place { padding: 4px var(--col-pad) 0; color: var(--faint); }
|
|
8349
|
+
.diff-place:first-child { padding-top: 0; }
|
|
8350
|
+
.diff-del, .diff-add { padding: 0 var(--col-pad); border-radius: 2px; }
|
|
8351
|
+
.diff-del { background: color-mix(in srgb, var(--hot) 14%, transparent); }
|
|
8352
|
+
.diff-add { background: color-mix(in srgb, var(--ok) 14%, transparent); }
|
|
8353
|
+
.changes-acts { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
8354
|
+
.chip.changes-go, .chip.changes-go:hover { color: var(--bg); background: var(--fg); }
|
|
8419
8355
|
|
|
8420
8356
|
/* The element's box, in a fold of the kit's: a picture of the element, so
|
|
8421
8357
|
its areas are filled, each in the hue the page's own tint of it has, mixed
|
|
@@ -8733,6 +8669,11 @@ function ownCss(media) {
|
|
|
8733
8669
|
};
|
|
8734
8670
|
return CSS.replace(/@media ([^{]+)\{/g, settle2).replaceAll("color-scheme: light dark", `color-scheme: ${media.scheme}`);
|
|
8735
8671
|
}
|
|
8672
|
+
function resetPage(log = edits, reset2 = reset) {
|
|
8673
|
+
log.undoAll();
|
|
8674
|
+
clearForced();
|
|
8675
|
+
reset2();
|
|
8676
|
+
}
|
|
8736
8677
|
function createPanel(options2 = {}) {
|
|
8737
8678
|
const keys = options2.keys ?? createKeys();
|
|
8738
8679
|
const prefs = createPrefs({ handle: options2.handle });
|
|
@@ -8758,7 +8699,7 @@ function createPanel(options2 = {}) {
|
|
|
8758
8699
|
const flip = () => drag.flip();
|
|
8759
8700
|
stage.flip = flip;
|
|
8760
8701
|
const actionsHere = availableActions();
|
|
8761
|
-
const bindingsHere = BINDINGS.filter((binding) => (binding !== "grab" || grab !== null) && (binding !== "inspect" || inspect !== null));
|
|
8702
|
+
const bindingsHere = BINDINGS.filter((binding) => (binding !== "grab" || grab !== null) && (binding !== "inspect" && binding !== "elements" || inspect !== null));
|
|
8762
8703
|
const host = document.createElement("div");
|
|
8763
8704
|
host.setAttribute("data-devknobs", "panel");
|
|
8764
8705
|
host.style.cssText = HOST_STYLE;
|
|
@@ -8867,7 +8808,6 @@ function createPanel(options2 = {}) {
|
|
|
8867
8808
|
wrap,
|
|
8868
8809
|
panel,
|
|
8869
8810
|
prefs,
|
|
8870
|
-
showing: () => viewing() ? "view" : "list",
|
|
8871
8811
|
place: () => getState().panel,
|
|
8872
8812
|
wide: setDockWidth,
|
|
8873
8813
|
sized: panelSized
|
|
@@ -8957,7 +8897,7 @@ function createPanel(options2 = {}) {
|
|
|
8957
8897
|
rows.hidden = !anyShown;
|
|
8958
8898
|
const resetHint = hints.get("reset");
|
|
8959
8899
|
if (resetHint)
|
|
8960
|
-
resetHint.disabled = isReset(state);
|
|
8900
|
+
resetHint.disabled = isReset(state) && edits.list().length === 0;
|
|
8961
8901
|
badge.textContent = overflowBadge(state.overflow, live.overflow);
|
|
8962
8902
|
badge.hidden = badge.textContent === "";
|
|
8963
8903
|
badge.classList.toggle("hot", hot);
|
|
@@ -9021,7 +8961,7 @@ function createPanel(options2 = {}) {
|
|
|
9021
8961
|
searchInput.value = "";
|
|
9022
8962
|
for (const action of actionsHere)
|
|
9023
8963
|
stopAction(action);
|
|
9024
|
-
|
|
8964
|
+
resetPage();
|
|
9025
8965
|
}
|
|
9026
8966
|
function onInspect(on) {
|
|
9027
8967
|
const at = root.activeElement;
|
|
@@ -9068,9 +9008,17 @@ function createPanel(options2 = {}) {
|
|
|
9068
9008
|
actionOf("storage")?.run();
|
|
9069
9009
|
return;
|
|
9070
9010
|
}
|
|
9011
|
+
if (action === "requests" || action === "elements") {
|
|
9012
|
+
showView(action);
|
|
9013
|
+
return;
|
|
9014
|
+
}
|
|
9015
|
+
if (action === "settings") {
|
|
9016
|
+
showSettings();
|
|
9017
|
+
return;
|
|
9018
|
+
}
|
|
9071
9019
|
if (!getState().panel.open)
|
|
9072
9020
|
return;
|
|
9073
|
-
if (action === "replay"
|
|
9021
|
+
if (action === "replay")
|
|
9074
9022
|
actionOf(action)?.run();
|
|
9075
9023
|
else if (action === "reset")
|
|
9076
9024
|
runCommand("reset");
|
|
@@ -9079,6 +9027,31 @@ function createPanel(options2 = {}) {
|
|
|
9079
9027
|
else
|
|
9080
9028
|
toggle(false);
|
|
9081
9029
|
}
|
|
9030
|
+
function opensPanel(action) {
|
|
9031
|
+
return action === "toggle" || action === "storage" || action === "requests" || action === "settings" || action === "elements";
|
|
9032
|
+
}
|
|
9033
|
+
function showView(action) {
|
|
9034
|
+
const id = side.view();
|
|
9035
|
+
const mine = action === "requests" ? requests.shows() : id === STYLES_VIEW;
|
|
9036
|
+
if (mine && getState().panel.open && viewing()) {
|
|
9037
|
+
side.close();
|
|
9038
|
+
return;
|
|
9039
|
+
}
|
|
9040
|
+
if (mine && id !== null)
|
|
9041
|
+
side.show(id);
|
|
9042
|
+
else if (action === "requests")
|
|
9043
|
+
requestsHere.toggle();
|
|
9044
|
+
else
|
|
9045
|
+
inspector?.elements();
|
|
9046
|
+
}
|
|
9047
|
+
function showSettings() {
|
|
9048
|
+
if (getState().panel.open && settings.editing()) {
|
|
9049
|
+
settings.leaveKeys();
|
|
9050
|
+
return;
|
|
9051
|
+
}
|
|
9052
|
+
toggle(true);
|
|
9053
|
+
settings.openKeys();
|
|
9054
|
+
}
|
|
9082
9055
|
function escape() {
|
|
9083
9056
|
if (drag.dragging() || !getState().panel.open)
|
|
9084
9057
|
return;
|
|
@@ -9128,8 +9101,8 @@ function createPanel(options2 = {}) {
|
|
|
9128
9101
|
event.stopPropagation();
|
|
9129
9102
|
return;
|
|
9130
9103
|
}
|
|
9131
|
-
const action = keyAction(event, keys.get());
|
|
9132
|
-
const acts = action !== null && action !== "close" && !drag.dragging() && (action
|
|
9104
|
+
const action = keyAction(event, keysListed(keys.get(), bindingsHere));
|
|
9105
|
+
const acts = action !== null && action !== "close" && !drag.dragging() && (opensPanel(action) || getState().panel.open);
|
|
9133
9106
|
const inSearch = event.composedPath()[0] === searchInput;
|
|
9134
9107
|
if (acts || action && action !== "close" && inSearch)
|
|
9135
9108
|
event.preventDefault();
|
|
@@ -9178,6 +9151,7 @@ function createPanel(options2 = {}) {
|
|
|
9178
9151
|
stage.inspector = inspector;
|
|
9179
9152
|
const stopModes = actionsHere.flatMap((action) => action.watch?.(render) ?? []);
|
|
9180
9153
|
const stopCount = onCount(render);
|
|
9154
|
+
const stopEdits = edits.subscribe(render);
|
|
9181
9155
|
window.addEventListener("keydown", onKeydown, true);
|
|
9182
9156
|
window.addEventListener("pointerdown", onPointerDown, true);
|
|
9183
9157
|
window.addEventListener("pointerup", onPointerUp, true);
|
|
@@ -9229,6 +9203,7 @@ function createPanel(options2 = {}) {
|
|
|
9229
9203
|
if (stage.inspector === inspector)
|
|
9230
9204
|
stage.inspector = null;
|
|
9231
9205
|
stopCount();
|
|
9206
|
+
stopEdits();
|
|
9232
9207
|
clearInterval(ticker);
|
|
9233
9208
|
tips.destroy();
|
|
9234
9209
|
settings.destroy();
|
|
@@ -9256,7 +9231,7 @@ function createPanel(options2 = {}) {
|
|
|
9256
9231
|
}
|
|
9257
9232
|
|
|
9258
9233
|
// src/version.ts
|
|
9259
|
-
var VERSION = "0.
|
|
9234
|
+
var VERSION = "0.6.0";
|
|
9260
9235
|
|
|
9261
9236
|
// src/index.ts
|
|
9262
9237
|
var PRESETS = {
|
|
@@ -9315,12 +9290,20 @@ function mount(options2 = {}) {
|
|
|
9315
9290
|
start(options2);
|
|
9316
9291
|
mounted = options2;
|
|
9317
9292
|
attach(options2);
|
|
9293
|
+
if (!isDevknobsFrame() && !fresh())
|
|
9294
|
+
keepEdits(options2.editsStore);
|
|
9295
|
+
}
|
|
9296
|
+
function keepEdits(store) {
|
|
9297
|
+
const path = pathNow();
|
|
9298
|
+
const frame = () => framedPage(window, frameWindow(), path, needsFrame(getState()));
|
|
9299
|
+
startKeep(store, { frame, settled: () => pageSettled(window, () => needsFrame(getState()), frame) });
|
|
9318
9300
|
}
|
|
9319
9301
|
function attach(options2) {
|
|
9320
9302
|
const live = createKeys({
|
|
9321
9303
|
hotkey: options2.hotkey,
|
|
9322
9304
|
grabKey: options2.grabKey,
|
|
9323
|
-
grab: options2.grab !== false
|
|
9305
|
+
grab: options2.grab !== false,
|
|
9306
|
+
store: options2.keysStore
|
|
9324
9307
|
});
|
|
9325
9308
|
keys = live;
|
|
9326
9309
|
if (options2.grab !== false) {
|
|
@@ -9425,6 +9408,7 @@ function adopt(options2, take) {
|
|
|
9425
9408
|
detach();
|
|
9426
9409
|
attach(mounted);
|
|
9427
9410
|
}
|
|
9411
|
+
var handing = false;
|
|
9428
9412
|
function handOver() {
|
|
9429
9413
|
const take = waiting;
|
|
9430
9414
|
const options2 = mounted;
|
|
@@ -9436,7 +9420,12 @@ function handOver() {
|
|
|
9436
9420
|
return;
|
|
9437
9421
|
}
|
|
9438
9422
|
const native = nativeSwitch();
|
|
9439
|
-
|
|
9423
|
+
handing = true;
|
|
9424
|
+
try {
|
|
9425
|
+
unmount();
|
|
9426
|
+
} finally {
|
|
9427
|
+
handing = false;
|
|
9428
|
+
}
|
|
9440
9429
|
const prefer = options2.prefer;
|
|
9441
9430
|
let took = false;
|
|
9442
9431
|
try {
|
|
@@ -9464,6 +9453,12 @@ function unmount() {
|
|
|
9464
9453
|
if (superseded(window, unmount))
|
|
9465
9454
|
return;
|
|
9466
9455
|
detach();
|
|
9456
|
+
stopKeep();
|
|
9457
|
+
if (!handing) {
|
|
9458
|
+
edits.undoAll();
|
|
9459
|
+
forgetReplay();
|
|
9460
|
+
clearForced();
|
|
9461
|
+
}
|
|
9467
9462
|
const native = mounted?.host ? nativeSwitch() : null;
|
|
9468
9463
|
stop();
|
|
9469
9464
|
withdraw(window, api);
|
|
@@ -9539,16 +9534,41 @@ async function grab(elements, options2) {
|
|
|
9539
9534
|
const host = hosted("grab");
|
|
9540
9535
|
if (host)
|
|
9541
9536
|
return host(elements, options2);
|
|
9542
|
-
const loaded = await import("./index-
|
|
9537
|
+
const loaded = await import("./index-f67wctn3.js");
|
|
9543
9538
|
return loaded.grab(elements, options2);
|
|
9544
9539
|
}
|
|
9545
|
-
|
|
9540
|
+
function edits2() {
|
|
9541
|
+
return (hosted("edits") ?? edits.list)();
|
|
9542
|
+
}
|
|
9543
|
+
async function setEdits(list) {
|
|
9544
|
+
const host = hosted("setEdits");
|
|
9545
|
+
if (host)
|
|
9546
|
+
return host(list);
|
|
9547
|
+
if (!Array.isArray(list))
|
|
9548
|
+
throw new TypeError("devknobs.setEdits takes a list of edits, as edits() gives them");
|
|
9549
|
+
const { replayEdits } = await import("./replay-vtg0vqj2.js");
|
|
9550
|
+
const { applied, skipped } = replayEdits(edits, list);
|
|
9551
|
+
return { applied, skipped };
|
|
9552
|
+
}
|
|
9553
|
+
function undoEdit() {
|
|
9554
|
+
return (hosted("undoEdit") ?? edits.undo)();
|
|
9555
|
+
}
|
|
9556
|
+
function forceState2(target, states = []) {
|
|
9557
|
+
const host = hosted("forceState");
|
|
9558
|
+
if (host)
|
|
9559
|
+
return host(target, states);
|
|
9560
|
+
const element = typeof target === "string" ? document.querySelector(target) : target;
|
|
9561
|
+
return forceState(element, states);
|
|
9562
|
+
}
|
|
9563
|
+
var api = { mount, unmount, getState: getState2, setState: setState2, reset: reset2, replay: replay2, grab, describe: describe2, ready: ready2, edits: edits2, setEdits, undoEdit, forceState: forceState2 };
|
|
9546
9564
|
export {
|
|
9547
9565
|
unmount,
|
|
9566
|
+
undoEdit,
|
|
9548
9567
|
setSystemMedia,
|
|
9549
9568
|
setState2 as setState,
|
|
9550
9569
|
setPrefer,
|
|
9551
9570
|
setNative2 as setNative,
|
|
9571
|
+
setEdits,
|
|
9552
9572
|
reset2 as reset,
|
|
9553
9573
|
replay2 as replay,
|
|
9554
9574
|
ready2 as ready,
|
|
@@ -9556,6 +9576,8 @@ export {
|
|
|
9556
9576
|
holdInTopLayer,
|
|
9557
9577
|
grab,
|
|
9558
9578
|
getState2 as getState,
|
|
9579
|
+
forceState2 as forceState,
|
|
9580
|
+
edits2 as edits,
|
|
9559
9581
|
describe2 as describe,
|
|
9560
9582
|
PRESETS,
|
|
9561
9583
|
LAYER
|