@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
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ATTRIBUTES,
|
|
3
|
+
hasMark
|
|
4
|
+
} from "./index-3dcgysws.js";
|
|
5
|
+
|
|
1
6
|
// src/grab/selector.ts
|
|
2
7
|
var VALUE_MAX = 120;
|
|
3
8
|
var PREFERRED = [
|
|
@@ -120,7 +125,7 @@ function nthChildSelector(element) {
|
|
|
120
125
|
function frameOf(element) {
|
|
121
126
|
try {
|
|
122
127
|
const frame = element.ownerDocument.defaultView?.frameElement ?? null;
|
|
123
|
-
return frame
|
|
128
|
+
return frame && hasMark(frame, ATTRIBUTES.frame) ? null : frame;
|
|
124
129
|
} catch {
|
|
125
130
|
return null;
|
|
126
131
|
}
|
|
@@ -9,13 +9,20 @@ import {
|
|
|
9
9
|
knobFrame,
|
|
10
10
|
newer,
|
|
11
11
|
parseHex,
|
|
12
|
+
readItem,
|
|
12
13
|
realNow,
|
|
14
|
+
removeItem,
|
|
13
15
|
removeStyle,
|
|
14
16
|
screenOf,
|
|
15
17
|
stamped,
|
|
16
18
|
turn,
|
|
17
|
-
webStorage
|
|
18
|
-
|
|
19
|
+
webStorage,
|
|
20
|
+
writeItem
|
|
21
|
+
} from "./index-311fys81.js";
|
|
22
|
+
import {
|
|
23
|
+
findOwn,
|
|
24
|
+
ownSelector
|
|
25
|
+
} from "./index-3dcgysws.js";
|
|
19
26
|
|
|
20
27
|
// src/engine/ua.ts
|
|
21
28
|
var CHROME = "154.0.8037.98";
|
|
@@ -293,7 +300,7 @@ function reset(scope = globalThis) {
|
|
|
293
300
|
}
|
|
294
301
|
|
|
295
302
|
// src/engine/scrollkeep.ts
|
|
296
|
-
var SCROLL_KEY = "
|
|
303
|
+
var SCROLL_KEY = "knobs:scroll";
|
|
297
304
|
var SCROLL_VERSION = 1;
|
|
298
305
|
var SCROLL_WINDOW = 1e4;
|
|
299
306
|
var HOLD = 2000;
|
|
@@ -422,11 +429,11 @@ function keep(view, role) {
|
|
|
422
429
|
const session = webStorage("session");
|
|
423
430
|
if (!session)
|
|
424
431
|
return;
|
|
425
|
-
const kept = keptWith(parseKept(session
|
|
432
|
+
const kept = keptWith(parseKept(readItem(session, SCROLL_KEY)), role, placeIn(view), realNow());
|
|
426
433
|
if (kept)
|
|
427
|
-
session
|
|
434
|
+
writeItem(session, SCROLL_KEY, JSON.stringify(stamped(kept, SCROLL_VERSION)));
|
|
428
435
|
else
|
|
429
|
-
|
|
436
|
+
removeItem(session, SCROLL_KEY);
|
|
430
437
|
} catch {}
|
|
431
438
|
}
|
|
432
439
|
function keepOwn() {
|
|
@@ -443,15 +450,15 @@ function resume() {
|
|
|
443
450
|
let target = null;
|
|
444
451
|
try {
|
|
445
452
|
const session = webStorage("session");
|
|
446
|
-
const text = session
|
|
453
|
+
const text = readItem(session, SCROLL_KEY);
|
|
447
454
|
if (!session || text === null)
|
|
448
455
|
return;
|
|
449
456
|
const role = isDevknobsFrame() ? "frame" : "page";
|
|
450
457
|
const { place, rest } = take(parseKept(text), role, window.location.pathname, realNow());
|
|
451
458
|
if (rest)
|
|
452
|
-
session
|
|
459
|
+
writeItem(session, SCROLL_KEY, JSON.stringify(stamped(rest, SCROLL_VERSION)));
|
|
453
460
|
else
|
|
454
|
-
|
|
461
|
+
removeItem(session, SCROLL_KEY);
|
|
455
462
|
target = place;
|
|
456
463
|
} catch {
|
|
457
464
|
return;
|
|
@@ -1682,7 +1689,7 @@ function putMat(node, mat) {
|
|
|
1682
1689
|
// src/engine/placeholder.ts
|
|
1683
1690
|
var Z_INDEX = 2147483645;
|
|
1684
1691
|
var EARLY = "early";
|
|
1685
|
-
var SNAPSHOT_KEY = "
|
|
1692
|
+
var SNAPSHOT_KEY = "knobs:snapshot";
|
|
1686
1693
|
var SNAPSHOT_VERSION = 1;
|
|
1687
1694
|
var EARLY_FRAMES = 60;
|
|
1688
1695
|
var earlyWait = 0;
|
|
@@ -1743,7 +1750,7 @@ function lookOf(value) {
|
|
|
1743
1750
|
}
|
|
1744
1751
|
function readSnapshot(knobs, view) {
|
|
1745
1752
|
try {
|
|
1746
|
-
const text = webStorage("session")
|
|
1753
|
+
const text = readItem(webStorage("session"), SNAPSHOT_KEY);
|
|
1747
1754
|
if (!text)
|
|
1748
1755
|
return null;
|
|
1749
1756
|
const data = JSON.parse(text);
|
|
@@ -1764,7 +1771,7 @@ function readSnapshot(knobs, view) {
|
|
|
1764
1771
|
}
|
|
1765
1772
|
function writeSnapshot(snapshot) {
|
|
1766
1773
|
try {
|
|
1767
|
-
webStorage("session")
|
|
1774
|
+
writeItem(webStorage("session"), SNAPSHOT_KEY, JSON.stringify(stamped(snapshot, SNAPSHOT_VERSION)));
|
|
1768
1775
|
} catch {
|
|
1769
1776
|
clearSnapshot();
|
|
1770
1777
|
}
|
|
@@ -1790,14 +1797,14 @@ function keepDrawing({ letterbox, zoom, key, css, look }) {
|
|
|
1790
1797
|
}
|
|
1791
1798
|
function clearSnapshot() {
|
|
1792
1799
|
try {
|
|
1793
|
-
webStorage("session")
|
|
1800
|
+
removeItem(webStorage("session"), SNAPSHOT_KEY);
|
|
1794
1801
|
} catch {}
|
|
1795
1802
|
}
|
|
1796
1803
|
function earlyHost() {
|
|
1797
|
-
return document
|
|
1804
|
+
return findOwn(document, EARLY, "div");
|
|
1798
1805
|
}
|
|
1799
1806
|
function dropEarly() {
|
|
1800
|
-
for (const node of Array.from(document.querySelectorAll(
|
|
1807
|
+
for (const node of Array.from(document.querySelectorAll(ownSelector(EARLY)))) {
|
|
1801
1808
|
node.remove();
|
|
1802
1809
|
}
|
|
1803
1810
|
removeStyle(EARLY);
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
grabColor,
|
|
7
7
|
isCLike,
|
|
8
8
|
isElement
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-3s4v7gw5.js";
|
|
10
10
|
import {
|
|
11
11
|
componentOf,
|
|
12
12
|
escapeText,
|
|
@@ -14,18 +14,18 @@ import {
|
|
|
14
14
|
grabEntry,
|
|
15
15
|
joinEntries,
|
|
16
16
|
quickEntry
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-vmprrfwe.js";
|
|
18
18
|
import"./index-aymfvd8s.js";
|
|
19
19
|
import {
|
|
20
20
|
shorthand,
|
|
21
21
|
sizeText,
|
|
22
22
|
tidy
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-rps0bdq9.js";
|
|
24
24
|
import {
|
|
25
25
|
middle
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
26
|
+
} from "./index-6t0w5s7p.js";
|
|
27
|
+
import"./index-szd9bddn.js";
|
|
28
|
+
import"./index-abwqw8jh.js";
|
|
29
29
|
import {
|
|
30
30
|
HOST_RESET,
|
|
31
31
|
LAYER,
|
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
holdInTopLayer,
|
|
34
34
|
pause,
|
|
35
35
|
subscribe
|
|
36
|
-
} from "./index-
|
|
37
|
-
import"./index-
|
|
36
|
+
} from "./index-a23nv5j4.js";
|
|
37
|
+
import"./index-bgzyc7rz.js";
|
|
38
38
|
import {
|
|
39
39
|
composedParent,
|
|
40
40
|
grabTargetAt,
|
|
41
41
|
icon,
|
|
42
42
|
isDevknobs,
|
|
43
43
|
isGrabbable
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-vhda420r.js";
|
|
45
45
|
import {
|
|
46
46
|
RINGS,
|
|
47
47
|
addStyle,
|
|
@@ -61,11 +61,15 @@ import {
|
|
|
61
61
|
ringQuads,
|
|
62
62
|
systemMedia,
|
|
63
63
|
watchSystemMedia
|
|
64
|
-
} from "./index-
|
|
64
|
+
} from "./index-311fys81.js";
|
|
65
65
|
import"./index-a974q3aa.js";
|
|
66
|
-
import
|
|
66
|
+
import {
|
|
67
|
+
markOwn,
|
|
68
|
+
ownSelector
|
|
69
|
+
} from "./index-3dcgysws.js";
|
|
67
70
|
|
|
68
71
|
// src/grab/clipboard.ts
|
|
72
|
+
var KNOBS_TYPE = "application/x-knobs-grab";
|
|
69
73
|
var DEVKNOBS_TYPE = "application/x-devknobs-grab";
|
|
70
74
|
var REACT_GRAB_TYPE = "application/x-react-grab";
|
|
71
75
|
function clipboardData(payload, now = Date.now()) {
|
|
@@ -77,10 +81,12 @@ function clipboardData(payload, now = Date.now()) {
|
|
|
77
81
|
stackContext: entry.stackContext,
|
|
78
82
|
frames: entry.frames
|
|
79
83
|
}));
|
|
84
|
+
const own = JSON.stringify({ ...payload, timestamp: now });
|
|
80
85
|
return {
|
|
81
86
|
"text/plain": payload.content,
|
|
82
87
|
"text/html": `<meta charset='utf-8'><pre><code>${escapeText(payload.content)}</code></pre>`,
|
|
83
|
-
[
|
|
88
|
+
[KNOBS_TYPE]: own,
|
|
89
|
+
[DEVKNOBS_TYPE]: own,
|
|
84
90
|
[REACT_GRAB_TYPE]: JSON.stringify({
|
|
85
91
|
version: "devknobs",
|
|
86
92
|
content: payload.content,
|
|
@@ -1092,7 +1098,7 @@ function place(node, shape, ratio) {
|
|
|
1092
1098
|
}
|
|
1093
1099
|
function createOverlay(quiet = false, model = false) {
|
|
1094
1100
|
const host = document.createElement("div");
|
|
1095
|
-
host
|
|
1101
|
+
markOwn(host, "grab");
|
|
1096
1102
|
host.style.cssText = `position:fixed;inset:0;width:auto;height:auto;pointer-events:none;z-index:${Z_INDEX}`;
|
|
1097
1103
|
const root = host.attachShadow({ mode: "open" });
|
|
1098
1104
|
addStyle(root, HOST_RESET + HOST_CSS + CSS2);
|
|
@@ -1600,7 +1606,7 @@ function startMode(options, page = PAGE) {
|
|
|
1600
1606
|
let hitTimer = 0;
|
|
1601
1607
|
let settleTimer = 0;
|
|
1602
1608
|
let stopped = false;
|
|
1603
|
-
ensureStyle("grab-cursor").textContent =
|
|
1609
|
+
ensureStyle("grab-cursor").textContent = `*:not(${ownSelector()}){cursor:crosshair!important}`;
|
|
1604
1610
|
pause(true);
|
|
1605
1611
|
function warm(element) {
|
|
1606
1612
|
if (purpose || ready.has(element) || warming.has(element))
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
grabColor,
|
|
8
8
|
isCLike,
|
|
9
9
|
isElement
|
|
10
|
-
} from "./react-
|
|
10
|
+
} from "./react-wzd3cfg8.js";
|
|
11
11
|
import {
|
|
12
12
|
componentOf,
|
|
13
13
|
escapeText,
|
|
@@ -15,18 +15,18 @@ import {
|
|
|
15
15
|
grabEntry,
|
|
16
16
|
joinEntries,
|
|
17
17
|
quickEntry
|
|
18
|
-
} from "./react-
|
|
18
|
+
} from "./react-amvrbng8.js";
|
|
19
19
|
import"./react-1gqwa2yw.js";
|
|
20
20
|
import {
|
|
21
21
|
shorthand,
|
|
22
22
|
sizeText,
|
|
23
23
|
tidy
|
|
24
|
-
} from "./react-
|
|
24
|
+
} from "./react-mkafgzqf.js";
|
|
25
25
|
import {
|
|
26
26
|
middle
|
|
27
|
-
} from "./react-
|
|
28
|
-
import"./react-
|
|
29
|
-
import"./react-
|
|
27
|
+
} from "./react-4tcwpama.js";
|
|
28
|
+
import"./react-dg4bjv3j.js";
|
|
29
|
+
import"./react-atw9y8ny.js";
|
|
30
30
|
import {
|
|
31
31
|
HOST_RESET,
|
|
32
32
|
LAYER,
|
|
@@ -34,15 +34,15 @@ import {
|
|
|
34
34
|
holdInTopLayer,
|
|
35
35
|
pause,
|
|
36
36
|
subscribe
|
|
37
|
-
} from "./react-
|
|
38
|
-
import"./react-
|
|
37
|
+
} from "./react-ppyj3fg2.js";
|
|
38
|
+
import"./react-tet7swk2.js";
|
|
39
39
|
import {
|
|
40
40
|
composedParent,
|
|
41
41
|
grabTargetAt,
|
|
42
42
|
icon,
|
|
43
43
|
isDevknobs,
|
|
44
44
|
isGrabbable
|
|
45
|
-
} from "./react-
|
|
45
|
+
} from "./react-hdneb4v3.js";
|
|
46
46
|
import {
|
|
47
47
|
RINGS,
|
|
48
48
|
addStyle,
|
|
@@ -62,11 +62,15 @@ import {
|
|
|
62
62
|
ringQuads,
|
|
63
63
|
systemMedia,
|
|
64
64
|
watchSystemMedia
|
|
65
|
-
} from "./react-
|
|
65
|
+
} from "./react-rbmk30xk.js";
|
|
66
66
|
import"./react-fp73vhyd.js";
|
|
67
|
-
import
|
|
67
|
+
import {
|
|
68
|
+
markOwn,
|
|
69
|
+
ownSelector
|
|
70
|
+
} from "./react-4qn9vsjw.js";
|
|
68
71
|
|
|
69
72
|
// src/grab/clipboard.ts
|
|
73
|
+
var KNOBS_TYPE = "application/x-knobs-grab";
|
|
70
74
|
var DEVKNOBS_TYPE = "application/x-devknobs-grab";
|
|
71
75
|
var REACT_GRAB_TYPE = "application/x-react-grab";
|
|
72
76
|
function clipboardData(payload, now = Date.now()) {
|
|
@@ -78,10 +82,12 @@ function clipboardData(payload, now = Date.now()) {
|
|
|
78
82
|
stackContext: entry.stackContext,
|
|
79
83
|
frames: entry.frames
|
|
80
84
|
}));
|
|
85
|
+
const own = JSON.stringify({ ...payload, timestamp: now });
|
|
81
86
|
return {
|
|
82
87
|
"text/plain": payload.content,
|
|
83
88
|
"text/html": `<meta charset='utf-8'><pre><code>${escapeText(payload.content)}</code></pre>`,
|
|
84
|
-
[
|
|
89
|
+
[KNOBS_TYPE]: own,
|
|
90
|
+
[DEVKNOBS_TYPE]: own,
|
|
85
91
|
[REACT_GRAB_TYPE]: JSON.stringify({
|
|
86
92
|
version: "devknobs",
|
|
87
93
|
content: payload.content,
|
|
@@ -1093,7 +1099,7 @@ function place(node, shape, ratio) {
|
|
|
1093
1099
|
}
|
|
1094
1100
|
function createOverlay(quiet = false, model = false) {
|
|
1095
1101
|
const host = document.createElement("div");
|
|
1096
|
-
host
|
|
1102
|
+
markOwn(host, "grab");
|
|
1097
1103
|
host.style.cssText = `position:fixed;inset:0;width:auto;height:auto;pointer-events:none;z-index:${Z_INDEX}`;
|
|
1098
1104
|
const root = host.attachShadow({ mode: "open" });
|
|
1099
1105
|
addStyle(root, HOST_RESET + HOST_CSS + CSS2);
|
|
@@ -1601,7 +1607,7 @@ function startMode(options, page = PAGE) {
|
|
|
1601
1607
|
let hitTimer = 0;
|
|
1602
1608
|
let settleTimer = 0;
|
|
1603
1609
|
let stopped = false;
|
|
1604
|
-
ensureStyle("grab-cursor").textContent =
|
|
1610
|
+
ensureStyle("grab-cursor").textContent = `*:not(${ownSelector()}){cursor:crosshair!important}`;
|
|
1605
1611
|
pause(true);
|
|
1606
1612
|
function warm(element) {
|
|
1607
1613
|
if (purpose || ready.has(element) || warming.has(element))
|
|
@@ -5,32 +5,41 @@ import {
|
|
|
5
5
|
riskyElement,
|
|
6
6
|
specificity,
|
|
7
7
|
splitList
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-n31pn4ax.js";
|
|
9
9
|
import {
|
|
10
10
|
middle
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-6t0w5s7p.js";
|
|
12
12
|
import {
|
|
13
13
|
NEW_RULE_SHEET,
|
|
14
14
|
isNewRuleSheet,
|
|
15
15
|
isShadowRoot,
|
|
16
16
|
label
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-szd9bddn.js";
|
|
18
18
|
import {
|
|
19
19
|
actButton,
|
|
20
20
|
el
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-vmz7htwn.js";
|
|
22
22
|
import {
|
|
23
23
|
icon,
|
|
24
24
|
isDevknobs,
|
|
25
25
|
typesInField
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-vhda420r.js";
|
|
27
27
|
import {
|
|
28
28
|
addStyle,
|
|
29
29
|
authoredQuery,
|
|
30
30
|
ensureStyle,
|
|
31
31
|
isDocument,
|
|
32
32
|
isOwnSheet
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-311fys81.js";
|
|
34
|
+
import {
|
|
35
|
+
ATTRIBUTES,
|
|
36
|
+
isMarked,
|
|
37
|
+
isOwnName,
|
|
38
|
+
newName,
|
|
39
|
+
ownSelector,
|
|
40
|
+
removeMark,
|
|
41
|
+
setMark
|
|
42
|
+
} from "./index-3dcgysws.js";
|
|
34
43
|
|
|
35
44
|
// src/styles/collect.ts
|
|
36
45
|
function isKind(rule, kind) {
|
|
@@ -277,7 +286,7 @@ function layerRanks(marks, holds) {
|
|
|
277
286
|
}
|
|
278
287
|
|
|
279
288
|
// src/edit/html.ts
|
|
280
|
-
var HIDE_ATTRIBUTE =
|
|
289
|
+
var HIDE_ATTRIBUTE = ATTRIBUTES.hide;
|
|
281
290
|
var HIDE_CSS = `[${HIDE_ATTRIBUTE}], [${HIDE_ATTRIBUTE}] * { visibility: hidden !important; }`;
|
|
282
291
|
var HTML = "http://www.w3.org/1999/xhtml";
|
|
283
292
|
var successors = new WeakMap;
|
|
@@ -303,9 +312,6 @@ function isElement(node) {
|
|
|
303
312
|
function isShadowRoot2(node) {
|
|
304
313
|
return node.nodeType === 11 && "host" in node;
|
|
305
314
|
}
|
|
306
|
-
function isOwnName(name) {
|
|
307
|
-
return name.toLowerCase().startsWith("data-devknobs");
|
|
308
|
-
}
|
|
309
315
|
function ends(text) {
|
|
310
316
|
const lead = /^\s*/.exec(text)?.[0] ?? "";
|
|
311
317
|
const trail = lead.length === text.length ? "" : /\s*$/.exec(text)?.[0] ?? "";
|
|
@@ -428,9 +434,9 @@ function hideEdit(target, element, style = hideStyle) {
|
|
|
428
434
|
const hidden = element.hasAttribute(HIDE_ATTRIBUTE);
|
|
429
435
|
const set = (on) => {
|
|
430
436
|
if (on)
|
|
431
|
-
element
|
|
437
|
+
setMark(element, HIDE_ATTRIBUTE);
|
|
432
438
|
else
|
|
433
|
-
element
|
|
439
|
+
removeMark(element, HIDE_ATTRIBUTE);
|
|
434
440
|
};
|
|
435
441
|
return {
|
|
436
442
|
edit: { kind: "hide", target: { ...target }, property: "hidden", before: hidden ? "hidden" : null, after: hidden ? null : "hidden" },
|
|
@@ -481,7 +487,7 @@ function deleteEdit(target, node, before, property = "node") {
|
|
|
481
487
|
};
|
|
482
488
|
}
|
|
483
489
|
function isOwnElement(node) {
|
|
484
|
-
return isElement(node) && node
|
|
490
|
+
return isElement(node) && isMarked(node);
|
|
485
491
|
}
|
|
486
492
|
function nextElementOf(node) {
|
|
487
493
|
for (let at = node.nextSibling;at; at = at.nextSibling)
|
|
@@ -511,7 +517,7 @@ function movable(node) {
|
|
|
511
517
|
return false;
|
|
512
518
|
if (riskyElement(node) || Array.from(node.querySelectorAll("*")).some(riskyElement))
|
|
513
519
|
return false;
|
|
514
|
-
return node.querySelector(
|
|
520
|
+
return node.querySelector(ownSelector()) === null;
|
|
515
521
|
}
|
|
516
522
|
var EMPTY = new Set([
|
|
517
523
|
...["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr", "template"],
|
|
@@ -658,10 +664,10 @@ function isDocument2(node) {
|
|
|
658
664
|
return node.nodeType === DOCUMENT;
|
|
659
665
|
}
|
|
660
666
|
function isOwnNode(node) {
|
|
661
|
-
return isElement2(node) && node
|
|
667
|
+
return isElement2(node) && isMarked(node);
|
|
662
668
|
}
|
|
663
669
|
function isOwnAttribute(name) {
|
|
664
|
-
return name
|
|
670
|
+
return isOwnName(name);
|
|
665
671
|
}
|
|
666
672
|
function parentOf(node) {
|
|
667
673
|
if (isShadowRoot3(node))
|
|
@@ -980,7 +986,7 @@ function markupOf(node) {
|
|
|
980
986
|
const copy = node.cloneNode(true);
|
|
981
987
|
if (!isElement2(copy))
|
|
982
988
|
return "";
|
|
983
|
-
for (const own of Array.from(copy.querySelectorAll(
|
|
989
|
+
for (const own of Array.from(copy.querySelectorAll(ownSelector())))
|
|
984
990
|
own.remove();
|
|
985
991
|
for (const one of [copy, ...Array.from(copy.querySelectorAll("*"))]) {
|
|
986
992
|
for (const attr of Array.from(one.attributes))
|
|
@@ -1415,7 +1421,7 @@ function createDomTree(context, model = createTreeModel()) {
|
|
|
1415
1421
|
any = true;
|
|
1416
1422
|
} else if (record.type === "attributes") {
|
|
1417
1423
|
const name = record.attributeName ?? "";
|
|
1418
|
-
if (name === HIDE_ATTRIBUTE) {
|
|
1424
|
+
if (name === HIDE_ATTRIBUTE || name === newName(HIDE_ATTRIBUTE)) {
|
|
1419
1425
|
drop(target);
|
|
1420
1426
|
any = true;
|
|
1421
1427
|
continue;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
+
itemKeys,
|
|
2
3
|
newer,
|
|
4
|
+
readItem,
|
|
3
5
|
realNow,
|
|
6
|
+
removeItem,
|
|
7
|
+
sameItem,
|
|
4
8
|
stamped,
|
|
5
|
-
webStorage
|
|
6
|
-
|
|
9
|
+
webStorage,
|
|
10
|
+
writeItem
|
|
11
|
+
} from "./index-311fys81.js";
|
|
7
12
|
import {
|
|
8
13
|
__require
|
|
9
|
-
} from "./index-
|
|
14
|
+
} from "./index-3dcgysws.js";
|
|
10
15
|
|
|
11
16
|
// src/edit/log.ts
|
|
12
17
|
function copy(edit) {
|
|
@@ -180,7 +185,7 @@ function riskyEdit(edit) {
|
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
// src/edit/keep.ts
|
|
183
|
-
var EDITS_KEY = "
|
|
188
|
+
var EDITS_KEY = "knobs:edits:";
|
|
184
189
|
var EDITS_VERSION = 1;
|
|
185
190
|
var MAX_EDITS = 200;
|
|
186
191
|
var MAX_BYTES = 256 * 1024;
|
|
@@ -289,29 +294,28 @@ function writtenAt(text2) {
|
|
|
289
294
|
}
|
|
290
295
|
function otherPages(storage, kept) {
|
|
291
296
|
const pages = [];
|
|
292
|
-
for (
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
pages.push({ key, at: writtenAt(storage.getItem(key)) });
|
|
297
|
+
for (const key of itemKeys(storage, EDITS_KEY)) {
|
|
298
|
+
if (key !== kept)
|
|
299
|
+
pages.push({ key, at: writtenAt(readItem(storage, key)) });
|
|
296
300
|
}
|
|
297
301
|
return pages.sort((a, b) => b.at - a.at).map((page) => page.key);
|
|
298
302
|
}
|
|
299
303
|
function evict(storage, kept) {
|
|
300
304
|
for (const key of otherPages(storage, kept).slice(MAX_PAGES - 1))
|
|
301
|
-
|
|
305
|
+
removeItem(storage, key);
|
|
302
306
|
}
|
|
303
307
|
function write(storage, key, text2) {
|
|
304
308
|
let older = null;
|
|
305
309
|
for (;; ) {
|
|
306
310
|
try {
|
|
307
|
-
storage
|
|
311
|
+
writeItem(storage, key, text2);
|
|
308
312
|
return;
|
|
309
313
|
} catch (error) {
|
|
310
314
|
older ??= otherPages(storage, key);
|
|
311
315
|
const oldest = older.pop();
|
|
312
316
|
if (!oldest)
|
|
313
317
|
throw error;
|
|
314
|
-
|
|
318
|
+
removeItem(storage, oldest);
|
|
315
319
|
}
|
|
316
320
|
}
|
|
317
321
|
}
|
|
@@ -327,7 +331,7 @@ function localEditsStore(path = pathNow()) {
|
|
|
327
331
|
return {
|
|
328
332
|
load() {
|
|
329
333
|
try {
|
|
330
|
-
const kept = webStorage("local")
|
|
334
|
+
const kept = readItem(webStorage("local"), pageKey());
|
|
331
335
|
return kept ? JSON.parse(kept) : null;
|
|
332
336
|
} catch {
|
|
333
337
|
return null;
|
|
@@ -339,7 +343,7 @@ function localEditsStore(path = pathNow()) {
|
|
|
339
343
|
return;
|
|
340
344
|
try {
|
|
341
345
|
if (kept === null)
|
|
342
|
-
|
|
346
|
+
removeItem(storage, pageKey());
|
|
343
347
|
else {
|
|
344
348
|
write(storage, pageKey(), JSON.stringify({ ...kept, at: realNow() }));
|
|
345
349
|
evict(storage, pageKey());
|
|
@@ -348,7 +352,7 @@ function localEditsStore(path = pathNow()) {
|
|
|
348
352
|
},
|
|
349
353
|
subscribe(listener) {
|
|
350
354
|
const onStorage = (event) => {
|
|
351
|
-
if (event.key === null || event.key
|
|
355
|
+
if (event.key === null || sameItem(event.key, pageKey()))
|
|
352
356
|
listener();
|
|
353
357
|
};
|
|
354
358
|
window.addEventListener("storage", onStorage);
|
|
@@ -408,7 +412,7 @@ function settled(view, quiet = QUIET, longest = SETTLE_MAX) {
|
|
|
408
412
|
}
|
|
409
413
|
function createKeeper(options) {
|
|
410
414
|
const { log, store, view } = options;
|
|
411
|
-
const loadReplay = options.replay ?? (() => import("./replay-
|
|
415
|
+
const loadReplay = options.replay ?? (() => import("./replay-3xqgt3xg.js").then(({ replayEdits }) => replayEdits));
|
|
412
416
|
const wait = options.settled ?? (() => settled(view));
|
|
413
417
|
const frame = options.frame ?? (() => null);
|
|
414
418
|
const ours = new WeakMap;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
post
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-311fys81.js";
|
|
4
|
+
import {
|
|
5
|
+
ATTRIBUTES,
|
|
6
|
+
hasMark,
|
|
7
|
+
isMarked
|
|
8
|
+
} from "./index-3dcgysws.js";
|
|
4
9
|
|
|
5
10
|
// src/ui/icons.ts
|
|
6
11
|
var SVG = "http://www.w3.org/2000/svg";
|
|
@@ -417,7 +422,7 @@ function defaultKeys(options = {}) {
|
|
|
417
422
|
settings: free(SETTINGS_KEYS)
|
|
418
423
|
};
|
|
419
424
|
}
|
|
420
|
-
var KEYS_FIELD =
|
|
425
|
+
var KEYS_FIELD = ATTRIBUTES.keys;
|
|
421
426
|
function isTyping(node) {
|
|
422
427
|
const element = node;
|
|
423
428
|
const tag = element?.tagName;
|
|
@@ -451,7 +456,8 @@ function typesInField(event) {
|
|
|
451
456
|
const target = event.composedPath?.()[0] ?? event.target;
|
|
452
457
|
if (!isEditable(target))
|
|
453
458
|
return false;
|
|
454
|
-
|
|
459
|
+
const element = target;
|
|
460
|
+
return typeof element?.hasAttribute !== "function" || !hasMark(element, KEYS_FIELD);
|
|
455
461
|
}
|
|
456
462
|
function lowerKey(key) {
|
|
457
463
|
return key === "İ" ? "i" : key.toLowerCase();
|
|
@@ -606,7 +612,7 @@ function composedParent(element) {
|
|
|
606
612
|
}
|
|
607
613
|
function isDevknobs(element) {
|
|
608
614
|
for (let current = element;current; current = composedParent(current)) {
|
|
609
|
-
if (current
|
|
615
|
+
if (isMarked(current))
|
|
610
616
|
return true;
|
|
611
617
|
}
|
|
612
618
|
return false;
|
|
@@ -674,7 +680,7 @@ function descend(start, x, y) {
|
|
|
674
680
|
continue;
|
|
675
681
|
for (let index = 0;index < children.length; index++) {
|
|
676
682
|
const child = children[index];
|
|
677
|
-
if (!child || child
|
|
683
|
+
if (!child || isMarked(child) || !holds(child, x, y))
|
|
678
684
|
continue;
|
|
679
685
|
if (isHidden(child) || isClearLayer(child))
|
|
680
686
|
continue;
|
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
elementSelector,
|
|
6
6
|
nearestSemanticSelector,
|
|
7
7
|
selectorTarget
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-abwqw8jh.js";
|
|
9
|
+
import {
|
|
10
|
+
isOwnName
|
|
11
|
+
} from "./index-3dcgysws.js";
|
|
9
12
|
|
|
10
13
|
// src/grab/fiber.ts
|
|
11
14
|
var FORWARD_REF = Symbol.for("react.forward_ref");
|
|
@@ -162,7 +165,7 @@ function truncateEscaped(html, max) {
|
|
|
162
165
|
return `${whole}${SUFFIX}`.slice(0, max);
|
|
163
166
|
}
|
|
164
167
|
function isInternal(name) {
|
|
165
|
-
return name
|
|
168
|
+
return isOwnName(name) || name.startsWith("data-react-grab-");
|
|
166
169
|
}
|
|
167
170
|
var GENERATED_CLASS = [
|
|
168
171
|
/^[\w-]+__[\w-]+\.[\w-]+$/,
|