@vinena/knobs 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -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-1bar694x.js} +21 -19
- package/dist/{elementsview-jg4edt86.js → elementsview-p2wc9b0s.js} +21 -19
- package/dist/engine/bandmedia.d.ts +119 -0
- package/dist/engine/bezels.d.ts +2 -2
- package/dist/engine/browserui.d.ts +3 -1
- 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/pageshot.d.ts +24 -4
- package/dist/engine/placeholder.d.ts +3 -3
- package/dist/engine/reload.d.ts +2 -2
- package/dist/engine/safaridraw.d.ts +24 -3
- 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/underbar.d.ts +26 -7
- package/dist/engine/underneath.d.ts +1 -0
- package/dist/engine/width.d.ts +3 -3
- package/dist/{framekit-r16k97n7.js → framekit-n57ts9zt.js} +959 -87
- package/dist/{framekit-40pzennw.js → framekit-wqp811a2.js} +959 -87
- 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-ztnjefrh.js → index-585hs9tp.js} +5 -1
- package/dist/{index-za4ppxay.js → index-6t0w5s7p.js} +1 -1
- package/dist/{index-tqq2ygpj.js → index-9targr2f.js} +26 -16
- package/dist/{index-t4kssacm.js → index-abwqw8jh.js} +6 -1
- package/dist/{index-s6yzsvs4.js → index-b8cnnbpr.js} +25 -18
- package/dist/{index-xxbb8y41.js → index-cfrnrg24.js} +20 -14
- package/dist/{index-v2v4rmpe.js → index-dvtbh3c8.js} +24 -18
- package/dist/{index-0qkj2mgb.js → index-j8hrzag1.js} +14 -11
- package/dist/{index-cb91vcka.js → index-k4w5v53q.js} +1 -1
- package/dist/{index-q53j8wg5.js → index-n31pn4ax.js} +19 -15
- package/dist/{index-s6fya8pm.js → index-pvknvvkw.js} +11 -10
- package/dist/{index-3nwycv3p.js → index-qz04adp5.js} +20 -14
- package/dist/{index-ymqm185m.js → index-rps0bdq9.js} +1 -1
- package/dist/{index-a8ffw5ft.js → index-szd9bddn.js} +1 -1
- package/dist/{index-8d1yk9d2.js → index-t7a07nm9.js} +59 -39
- 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 +182 -165
- package/dist/index.js +57 -32
- package/dist/instance.d.ts +7 -1
- package/dist/mark.d.ts +50 -0
- package/dist/{react-vvc4x9kq.js → react-0tbd51s3.js} +14 -11
- 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-zp7fdw8e.js → react-881wvm1z.js} +59 -39
- 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-fq4551ks.js → react-pf7fc2f3.js} +11 -10
- package/dist/{react-0r5418av.js → react-rbmk30xk.js} +92 -29
- package/dist/{react-actmnkwp.js → react-rxw73n04.js} +1 -1
- package/dist/{react-8nmtt0ge.js → react-w94cfn87.js} +19 -15
- package/dist/{react-3ev6rwqz.js → react-x209et38.js} +26 -16
- package/dist/{react-5h7pxnax.js → react-zj0dbpdg.js} +25 -18
- 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-5tvmca8y.js} +16 -13
- package/dist/{storageview-x62v1c3j.js → storageview-ec52x60p.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 +2 -1
- package/skills/knobs/SKILL.md +36 -35
- package/dist/index-5tv6sr74.js +0 -23
- package/dist/react-t2qnewz2.js +0 -24
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
grabColor,
|
|
7
7
|
isCLike,
|
|
8
8
|
isElement
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-pvknvvkw.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-t7a07nm9.js";
|
|
37
|
+
import"./index-b8cnnbpr.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))
|
|
@@ -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;
|
|
@@ -4,24 +4,27 @@ import {
|
|
|
4
4
|
lay,
|
|
5
5
|
rowBox,
|
|
6
6
|
rowButton
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-vmz7htwn.js";
|
|
8
8
|
import {
|
|
9
9
|
getState
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-t7a07nm9.js";
|
|
11
11
|
import {
|
|
12
12
|
icon
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-vhda420r.js";
|
|
14
14
|
import {
|
|
15
15
|
isDevknobsFrame,
|
|
16
|
+
isOwnKey,
|
|
16
17
|
newer,
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
readItem,
|
|
19
|
+
webStorage,
|
|
20
|
+
writeItem
|
|
21
|
+
} from "./index-311fys81.js";
|
|
19
22
|
import {
|
|
20
23
|
__require
|
|
21
|
-
} from "./index-
|
|
24
|
+
} from "./index-3dcgysws.js";
|
|
22
25
|
|
|
23
26
|
// src/storage/onload.ts
|
|
24
|
-
var PRESETS_KEY = "
|
|
27
|
+
var PRESETS_KEY = "knobs:storage-presets";
|
|
25
28
|
var PRESETS_VERSION = 1;
|
|
26
29
|
var DONE = Symbol.for("devknobs.presets");
|
|
27
30
|
function fields(value) {
|
|
@@ -32,7 +35,7 @@ function list(value) {
|
|
|
32
35
|
}
|
|
33
36
|
function storedPresets() {
|
|
34
37
|
try {
|
|
35
|
-
const raw = JSON.parse(webStorage("local")
|
|
38
|
+
const raw = JSON.parse(readItem(webStorage("local"), PRESETS_KEY) ?? "null");
|
|
36
39
|
return newer(raw, PRESETS_VERSION) ? [] : list(fields(raw).presets);
|
|
37
40
|
} catch {
|
|
38
41
|
return [];
|
|
@@ -57,7 +60,7 @@ function empty(storage) {
|
|
|
57
60
|
const keys = [];
|
|
58
61
|
for (let index = 0;index < storage.length; index++) {
|
|
59
62
|
const key = storage.key(index);
|
|
60
|
-
if (key !== null &&
|
|
63
|
+
if (key !== null && !isOwnKey(key))
|
|
61
64
|
keys.push(key);
|
|
62
65
|
}
|
|
63
66
|
for (const key of keys)
|
|
@@ -129,7 +132,7 @@ function stopOnLoad() {
|
|
|
129
132
|
const presets = storedPresets();
|
|
130
133
|
if (presets.some((preset) => preset.onLoad === true)) {
|
|
131
134
|
const off = presets.map((preset) => ({ ...preset, onLoad: false }));
|
|
132
|
-
webStorage("local")
|
|
135
|
+
writeItem(webStorage("local"), PRESETS_KEY, JSON.stringify({ v: PRESETS_VERSION, presets: off }));
|
|
133
136
|
}
|
|
134
137
|
} catch {}
|
|
135
138
|
forgetApplied();
|
|
@@ -324,7 +327,7 @@ function createPane(context) {
|
|
|
324
327
|
// src/ui/storageaction.ts
|
|
325
328
|
var STORAGE_VIEW = "storage";
|
|
326
329
|
function load() {
|
|
327
|
-
return import("./storageview-
|
|
330
|
+
return import("./storageview-ec52x60p.js").then((loaded) => loaded.storageView({
|
|
328
331
|
visible: () => getState().panel.open && !document.hidden
|
|
329
332
|
}));
|
|
330
333
|
}
|
|
@@ -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,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
label
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-szd9bddn.js";
|
|
4
4
|
import {
|
|
5
5
|
frameWindow,
|
|
6
6
|
subscribe
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-t7a07nm9.js";
|
|
8
8
|
import {
|
|
9
9
|
inField,
|
|
10
10
|
isFunctionKey,
|
|
11
11
|
keyIs,
|
|
12
12
|
typesInField,
|
|
13
13
|
withShift
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-vhda420r.js";
|
|
15
15
|
import {
|
|
16
16
|
addStyle,
|
|
17
17
|
isDevknobsFrame,
|
|
@@ -19,10 +19,11 @@ import {
|
|
|
19
19
|
post,
|
|
20
20
|
readMessage,
|
|
21
21
|
systemMedia
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-311fys81.js";
|
|
23
23
|
import {
|
|
24
|
-
__require
|
|
25
|
-
|
|
24
|
+
__require,
|
|
25
|
+
markOwn
|
|
26
|
+
} from "./index-3dcgysws.js";
|
|
26
27
|
|
|
27
28
|
// src/grab/keys.ts
|
|
28
29
|
var HOLD = 100;
|
|
@@ -153,7 +154,7 @@ function systemScheme() {
|
|
|
153
154
|
if (own)
|
|
154
155
|
return own.scheme;
|
|
155
156
|
const host = document.createElement("div");
|
|
156
|
-
host
|
|
157
|
+
markOwn(host, "probe");
|
|
157
158
|
host.style.cssText = "position:fixed;width:0;height:0;overflow:hidden;pointer-events:none";
|
|
158
159
|
const root = host.attachShadow({ mode: "open" });
|
|
159
160
|
addStyle(root, "i{display:block;width:0}@media (prefers-color-scheme: dark){i{width:1px}}");
|
|
@@ -164,7 +165,7 @@ function systemScheme() {
|
|
|
164
165
|
host.remove();
|
|
165
166
|
return dark ? "dark" : "light";
|
|
166
167
|
}
|
|
167
|
-
function createGrab(options = {}, loadMode = () => import("./index-
|
|
168
|
+
function createGrab(options = {}, loadMode = () => import("./index-cfrnrg24.js")) {
|
|
168
169
|
const keyNow = options.key ?? defaultGrabKey;
|
|
169
170
|
const { purpose } = options;
|
|
170
171
|
const channel = purpose?.channel ?? "grab";
|
|
@@ -373,7 +374,7 @@ function held(view) {
|
|
|
373
374
|
return null;
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
|
-
function createInspect(options = {}, load = () => import("./index-
|
|
377
|
+
function createInspect(options = {}, load = () => import("./index-cfrnrg24.js"), frameOf = frameWindow) {
|
|
377
378
|
const inFrame = isDevknobsFrame();
|
|
378
379
|
const listeners = new Set;
|
|
379
380
|
let outliner = null;
|
|
@@ -481,7 +482,7 @@ async function copyText(text, data = { "text/plain": text }) {
|
|
|
481
482
|
};
|
|
482
483
|
const textarea = document.createElement("textarea");
|
|
483
484
|
textarea.value = text;
|
|
484
|
-
textarea
|
|
485
|
+
markOwn(textarea, "grab");
|
|
485
486
|
textarea.setAttribute("aria-hidden", "true");
|
|
486
487
|
textarea.style.cssText = "position:fixed;left:-9999px;top:0;opacity:0";
|
|
487
488
|
document.addEventListener("copy", onCopy);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
grabColor,
|
|
8
8
|
isCLike,
|
|
9
9
|
isElement
|
|
10
|
-
} from "./react-
|
|
10
|
+
} from "./react-pf7fc2f3.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-881wvm1z.js";
|
|
38
|
+
import"./react-zj0dbpdg.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))
|