@vinena/knobs 0.6.4 → 0.6.6
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 +11 -0
- package/dist/{context-amfyasb5.js → context-eawqn680.js} +1 -1
- package/dist/{context-svtr7vwt.js → context-vd2xep5t.js} +1 -1
- package/dist/early.global.js +5 -5
- package/dist/{elementsview-05qybwpn.js → elementsview-dpm0xmb2.js} +12 -12
- package/dist/{elementsview-gjaqje2k.js → elementsview-n26sp8m7.js} +12 -12
- package/dist/engine/media.d.ts +3 -2
- package/dist/engine/pageshot.d.ts +25 -0
- package/dist/engine/shotmedia.d.ts +50 -0
- package/dist/{framekit-3bmkm34m.js → framekit-0as9t6a7.js} +194 -32
- package/dist/{framekit-h0jrc5gs.js → framekit-dknq662p.js} +194 -32
- package/dist/grab/fiber.d.ts +2 -0
- package/dist/grab/overlay.d.ts +10 -1
- package/dist/{index-fp1h37b3.js → index-20bc9yrj.js} +1 -1
- package/dist/{index-0yn3rnza.js → index-69fvtkcm.js} +6 -6
- package/dist/{index-h93t2tc5.js → index-7vb2ct4s.js} +6 -6
- package/dist/{index-0mav2k60.js → index-7w0nm76e.js} +10 -10
- package/dist/{index-zd6adby9.js → index-a8ffw5ft.js} +1 -1
- package/dist/{index-gm51cthv.js → index-ajs4na3f.js} +1 -1
- package/dist/{index-4192t60e.js → index-df35z48z.js} +2 -2
- package/dist/{index-6xsvcjnc.js → index-dxga6h10.js} +4 -4
- package/dist/{index-dzm8ywq0.js → index-jfv7vavj.js} +3 -20
- package/dist/{index-509g0pa8.js → index-r1rdj05c.js} +5 -5
- package/dist/{index-7cb4x1vj.js → index-s6yzsvs4.js} +1 -1
- package/dist/{index-aj1z83rt.js → index-t4wrs2a3.js} +10 -10
- package/dist/{index-rdssc7sz.js → index-whehz74d.js} +1 -1
- package/dist/{index-kpsrkzmf.js → index-x3sxssbs.js} +4 -4
- package/dist/{index-1mstjadm.js → index-xs29b55n.js} +4 -1
- package/dist/{index-xh39jtkq.js → index-ymqm185m.js} +1 -1
- package/dist/{index-ftjdt358.js → index-za4ppxay.js} +1 -1
- package/dist/index.global.js +125 -119
- package/dist/index.js +15 -15
- package/dist/{react-wqn4sx0n.js → react-0r5418av.js} +3 -20
- package/dist/{react-gkzn5n3v.js → react-10r2rczp.js} +5 -5
- package/dist/{react-r3zf2djn.js → react-2b7725je.js} +4 -4
- package/dist/{react-ethftdxp.js → react-4phtr2nd.js} +1 -1
- package/dist/{react-pvmjybgw.js → react-5ekfj7g3.js} +2 -2
- package/dist/{react-ttj8f9qp.js → react-5h7pxnax.js} +1 -1
- package/dist/{react-6fnxxs30.js → react-73reavv4.js} +1 -1
- package/dist/{react-2381cr3w.js → react-a1r0nr0g.js} +4 -4
- package/dist/{react-me102s1a.js → react-k4pkm1p5.js} +1 -1
- package/dist/{react-anqpcaqm.js → react-msn10fjb.js} +6 -6
- package/dist/{react-x1ndxf29.js → react-v08ywmtw.js} +6 -6
- package/dist/{react-4ykd817s.js → react-vbk58f9m.js} +1 -1
- package/dist/{react-4rbjw9af.js → react-wtgvkf6g.js} +1 -1
- package/dist/{react-ptamex0p.js → react-y9gr8yt2.js} +1 -1
- package/dist/{react-3mfz1x2a.js → react-yx3g9k55.js} +4 -1
- package/dist/react.js +15 -15
- package/dist/{replay-39ssrcqp.js → replay-461gcdh1.js} +7 -7
- package/dist/{replay-xacjqqt5.js → replay-ehgxp9py.js} +7 -7
- package/dist/{storageview-3gnncmmv.js → storageview-5p1y11b5.js} +6 -6
- package/dist/{storageview-dwsnvz36.js → storageview-kxzpnfvr.js} +6 -6
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
turnOf,
|
|
26
26
|
turnedPose,
|
|
27
27
|
windowRect
|
|
28
|
-
} from "./react-
|
|
28
|
+
} from "./react-k4pkm1p5.js";
|
|
29
29
|
import {
|
|
30
30
|
hush,
|
|
31
31
|
hushOnce,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
uaPreset,
|
|
84
84
|
userAgentOf,
|
|
85
85
|
viewportOf
|
|
86
|
-
} from "./react-
|
|
86
|
+
} from "./react-5h7pxnax.js";
|
|
87
87
|
import {
|
|
88
88
|
FRAME_ATTRIBUTE,
|
|
89
89
|
FRAME_NAME,
|
|
@@ -105,6 +105,7 @@ import {
|
|
|
105
105
|
hasTouch,
|
|
106
106
|
loads,
|
|
107
107
|
luminance,
|
|
108
|
+
mentionsFeature,
|
|
108
109
|
merge,
|
|
109
110
|
needsFrame,
|
|
110
111
|
openOf,
|
|
@@ -116,13 +117,15 @@ import {
|
|
|
116
117
|
post,
|
|
117
118
|
readMessage,
|
|
118
119
|
removeStyle,
|
|
120
|
+
rewriteMediaText,
|
|
119
121
|
screenOf,
|
|
120
122
|
stepZoom,
|
|
121
123
|
still,
|
|
122
124
|
styleNode,
|
|
123
125
|
turn,
|
|
126
|
+
walkRules,
|
|
124
127
|
wheelZoom
|
|
125
|
-
} from "./react-
|
|
128
|
+
} from "./react-0r5418av.js";
|
|
126
129
|
import"./react-fp73vhyd.js";
|
|
127
130
|
import {
|
|
128
131
|
__export
|
|
@@ -4588,6 +4591,113 @@ function forgetFonts() {
|
|
|
4588
4591
|
kept2 = null;
|
|
4589
4592
|
}
|
|
4590
4593
|
|
|
4594
|
+
// src/engine/shotmedia.ts
|
|
4595
|
+
var VALUES = [
|
|
4596
|
+
["prefers-color-scheme", ["light", "dark"]],
|
|
4597
|
+
["prefers-reduced-motion", ["reduce", "no-preference"]],
|
|
4598
|
+
["prefers-contrast", ["more", "less", "custom", "no-preference"]],
|
|
4599
|
+
["prefers-reduced-transparency", ["reduce", "no-preference"]],
|
|
4600
|
+
["pointer", ["none", "coarse", "fine"]],
|
|
4601
|
+
["any-pointer", ["none", "coarse", "fine"]],
|
|
4602
|
+
["hover", ["none", "hover"]],
|
|
4603
|
+
["any-hover", ["none", "hover"]]
|
|
4604
|
+
];
|
|
4605
|
+
function frameMedia(view) {
|
|
4606
|
+
const read = [];
|
|
4607
|
+
for (const [feature, values] of VALUES) {
|
|
4608
|
+
try {
|
|
4609
|
+
const matched = values.filter((value) => view.matchMedia(`(${feature}: ${value})`).matches);
|
|
4610
|
+
if (matched.length === 1 && matched[0])
|
|
4611
|
+
read.push([feature, matched[0]]);
|
|
4612
|
+
} catch {}
|
|
4613
|
+
}
|
|
4614
|
+
return read;
|
|
4615
|
+
}
|
|
4616
|
+
function prefixedNamespace(text) {
|
|
4617
|
+
return /^@namespace\s+(?!url\(|["'])\S/i.test(text);
|
|
4618
|
+
}
|
|
4619
|
+
function eitherScheme(value) {
|
|
4620
|
+
return /\blight\b/.test(value) && /\bdark\b/.test(value);
|
|
4621
|
+
}
|
|
4622
|
+
function fixed(value, scheme) {
|
|
4623
|
+
return /\bonly\b/.test(value) ? `${scheme} only` : scheme;
|
|
4624
|
+
}
|
|
4625
|
+
function eachStyle(rules, visit) {
|
|
4626
|
+
for (const rule of Array.from(rules)) {
|
|
4627
|
+
const style = rule.style;
|
|
4628
|
+
if (style)
|
|
4629
|
+
visit(style);
|
|
4630
|
+
const children = rule.cssRules;
|
|
4631
|
+
if (children && children !== rules)
|
|
4632
|
+
eachStyle(children, visit);
|
|
4633
|
+
}
|
|
4634
|
+
}
|
|
4635
|
+
function freezeMedia(rules, read, Sheet) {
|
|
4636
|
+
const scheme = read.find(([feature]) => feature === "prefers-color-scheme")?.[1];
|
|
4637
|
+
const schemed = (text) => scheme !== undefined && text.includes("color-scheme");
|
|
4638
|
+
if (read.length === 0)
|
|
4639
|
+
return { rules, computed: false };
|
|
4640
|
+
if (typeof Sheet?.prototype?.replaceSync !== "function")
|
|
4641
|
+
return { rules, computed: rules.some(schemed) };
|
|
4642
|
+
const namespaces = rules.filter(prefixedNamespace).join(`
|
|
4643
|
+
`);
|
|
4644
|
+
let computed = false;
|
|
4645
|
+
const frozen = rules.map((text) => {
|
|
4646
|
+
if (!(text.includes("@media") && mentionsFeature(text)) && !schemed(text))
|
|
4647
|
+
return text;
|
|
4648
|
+
try {
|
|
4649
|
+
const sheet = new Sheet;
|
|
4650
|
+
sheet.replaceSync(namespaces ? `${namespaces}
|
|
4651
|
+
${text}` : text);
|
|
4652
|
+
const parsed = Array.from(sheet.cssRules).filter((rule) => !rule.cssText.startsWith("@namespace"));
|
|
4653
|
+
if (parsed.length === 0)
|
|
4654
|
+
return text;
|
|
4655
|
+
walkRules(sheet.cssRules, (rule) => {
|
|
4656
|
+
let query = rule.media.mediaText;
|
|
4657
|
+
for (const [feature, value] of read)
|
|
4658
|
+
query = rewriteMediaText(query, feature, value);
|
|
4659
|
+
if (query !== rule.media.mediaText)
|
|
4660
|
+
rule.media.mediaText = query;
|
|
4661
|
+
}, new Set);
|
|
4662
|
+
if (scheme) {
|
|
4663
|
+
eachStyle(sheet.cssRules, (style) => {
|
|
4664
|
+
const value = style.getPropertyValue("color-scheme");
|
|
4665
|
+
if (value.includes("var("))
|
|
4666
|
+
computed = true;
|
|
4667
|
+
else if (eitherScheme(value)) {
|
|
4668
|
+
style.setProperty("color-scheme", fixed(value, scheme), style.getPropertyPriority("color-scheme"));
|
|
4669
|
+
}
|
|
4670
|
+
});
|
|
4671
|
+
}
|
|
4672
|
+
return parsed.map((rule) => rule.cssText).join(`
|
|
4673
|
+
`);
|
|
4674
|
+
} catch {
|
|
4675
|
+
if (schemed(text))
|
|
4676
|
+
computed = true;
|
|
4677
|
+
return text;
|
|
4678
|
+
}
|
|
4679
|
+
});
|
|
4680
|
+
return { rules: frozen, computed };
|
|
4681
|
+
}
|
|
4682
|
+
function schemePins(doc, view, scheme, computed) {
|
|
4683
|
+
const root = doc.documentElement;
|
|
4684
|
+
const schemeOf = (node) => view.getComputedStyle(node).getPropertyValue("color-scheme");
|
|
4685
|
+
let top = schemeOf(root);
|
|
4686
|
+
if (top === "normal" || top === "") {
|
|
4687
|
+
top = doc.querySelector('meta[name="color-scheme"]')?.getAttribute("content") ?? top;
|
|
4688
|
+
}
|
|
4689
|
+
const inline = new Set(doc.querySelectorAll('[style*="color-scheme"]'));
|
|
4690
|
+
if (!computed && inline.size === 0 && !eitherScheme(top))
|
|
4691
|
+
return null;
|
|
4692
|
+
return (node) => {
|
|
4693
|
+
const value = node === root ? top : computed || inline.has(node) ? schemeOf(node) : "";
|
|
4694
|
+
return eitherScheme(value) ? fixed(value, scheme) : null;
|
|
4695
|
+
};
|
|
4696
|
+
}
|
|
4697
|
+
function pinScheme(node, scheme) {
|
|
4698
|
+
node.setAttribute("style", `${node.getAttribute("style") ?? ""};color-scheme:${scheme} !important`);
|
|
4699
|
+
}
|
|
4700
|
+
|
|
4591
4701
|
// src/engine/pageshot.ts
|
|
4592
4702
|
var RES = 0.25;
|
|
4593
4703
|
var MOST = 1500;
|
|
@@ -4881,30 +4991,60 @@ function copyPage(frame2, leave) {
|
|
|
4881
4991
|
const doc = frame2.contentDocument;
|
|
4882
4992
|
if (!doc?.documentElement)
|
|
4883
4993
|
return null;
|
|
4994
|
+
const namespaces = [];
|
|
4884
4995
|
const rules = [];
|
|
4885
4996
|
const written2 = embedFonts(doc);
|
|
4886
4997
|
for (const sheet of [...doc.styleSheets, ...doc.adoptedStyleSheets ?? []]) {
|
|
4887
4998
|
try {
|
|
4888
|
-
|
|
4889
|
-
|
|
4999
|
+
const own = [];
|
|
5000
|
+
for (const rule of sheet.cssRules) {
|
|
5001
|
+
const text = written2(rule);
|
|
5002
|
+
if (!text.startsWith("@namespace"))
|
|
5003
|
+
own.push(text);
|
|
5004
|
+
else if (prefixedNamespace(text))
|
|
5005
|
+
namespaces.push(text);
|
|
5006
|
+
}
|
|
5007
|
+
const media = sheet.media?.mediaText ?? "";
|
|
5008
|
+
if (own.length > 0 && media !== "" && media !== "all")
|
|
5009
|
+
rules.push(`@media ${media} {
|
|
5010
|
+
${own.join(`
|
|
5011
|
+
`)}
|
|
5012
|
+
}`);
|
|
5013
|
+
else
|
|
5014
|
+
rules.push(...own);
|
|
4890
5015
|
} catch {}
|
|
4891
5016
|
}
|
|
5017
|
+
const view = doc.defaultView;
|
|
5018
|
+
const read = view ? frameMedia(view) : [];
|
|
5019
|
+
const frozen = freezeMedia([...namespaces, ...rules], read, view?.CSSStyleSheet);
|
|
5020
|
+
const scheme = read.find(([feature]) => feature === "prefers-color-scheme")?.[1];
|
|
5021
|
+
const pinned = view && scheme ? schemePins(doc, view, scheme, frozen.computed) : null;
|
|
5022
|
+
const pin = (node, copy) => {
|
|
5023
|
+
const to = pinned?.(node);
|
|
5024
|
+
if (to)
|
|
5025
|
+
pinScheme(copy, to);
|
|
5026
|
+
};
|
|
4892
5027
|
const inert = doc.implementation.createHTMLDocument("");
|
|
4893
5028
|
const root = inert.importNode(doc.documentElement, true);
|
|
4894
|
-
|
|
5029
|
+
pin(doc.documentElement, root);
|
|
5030
|
+
if (leave || pinned) {
|
|
4895
5031
|
const live = doc.documentElement.getElementsByTagName("*");
|
|
4896
5032
|
const copied = root.getElementsByTagName("*");
|
|
4897
5033
|
for (let index = 0;index < live.length; index++) {
|
|
4898
5034
|
const node = live[index];
|
|
4899
|
-
|
|
4900
|
-
|
|
5035
|
+
const copy = copied[index];
|
|
5036
|
+
if (!node || !copy)
|
|
5037
|
+
continue;
|
|
5038
|
+
if (leave?.(node))
|
|
5039
|
+
copy.setAttribute("data-devknobs", "");
|
|
5040
|
+
pin(node, copy);
|
|
4901
5041
|
}
|
|
4902
5042
|
}
|
|
4903
5043
|
blankPictures(doc.documentElement, root);
|
|
4904
5044
|
for (const node of root.querySelectorAll("script, link, style, noscript, [data-devknobs]"))
|
|
4905
5045
|
node.remove();
|
|
4906
5046
|
const style = inert.createElement("style");
|
|
4907
|
-
style.textContent = rules.join(`
|
|
5047
|
+
style.textContent = frozen.rules.join(`
|
|
4908
5048
|
`);
|
|
4909
5049
|
(root.querySelector("head") ?? root).append(style);
|
|
4910
5050
|
return root;
|
|
@@ -4918,6 +5058,24 @@ function rootSize(doc, view) {
|
|
|
4918
5058
|
const size = view.getComputedStyle(doc.documentElement).fontSize;
|
|
4919
5059
|
return size ? `font-size:${size} !important` : "";
|
|
4920
5060
|
}
|
|
5061
|
+
function layoutZoom(view) {
|
|
5062
|
+
if (!("userAgentData" in navigator))
|
|
5063
|
+
return 1;
|
|
5064
|
+
const ratio = view.devicePixelRatio;
|
|
5065
|
+
return Number.isFinite(ratio) && ratio > 0 ? ratio : 1;
|
|
5066
|
+
}
|
|
5067
|
+
function ownZoom(doc, view) {
|
|
5068
|
+
const own = Number(view.getComputedStyle(doc.documentElement).zoom);
|
|
5069
|
+
return Number.isFinite(own) && own > 0 ? own : 1;
|
|
5070
|
+
}
|
|
5071
|
+
function rootZoom(doc, view, ratio) {
|
|
5072
|
+
const own = ownZoom(doc, view);
|
|
5073
|
+
return ratio === 1 && own === 1 ? "" : `;zoom:${ratio * own} !important`;
|
|
5074
|
+
}
|
|
5075
|
+
function drawing(markup, width, height, sized, zoom) {
|
|
5076
|
+
const view = Number.isFinite(zoom) && zoom > 0 && zoom !== 1 ? ` viewBox="0 0 ${width * zoom} ${height * zoom}"` : "";
|
|
5077
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"${view} style="${sized}">` + `<foreignObject width="100%" height="100%">${markup}</foreignObject></svg>`;
|
|
5078
|
+
}
|
|
4921
5079
|
async function paintPage(frame2, glass, size, color, copy) {
|
|
4922
5080
|
const doc = frame2.contentDocument;
|
|
4923
5081
|
const view = frame2.contentWindow;
|
|
@@ -4945,11 +5103,14 @@ async function paintPage(frame2, glass, size, color, copy) {
|
|
|
4945
5103
|
} catch {}
|
|
4946
5104
|
}
|
|
4947
5105
|
const root = copy.cloneNode(true);
|
|
4948
|
-
const
|
|
5106
|
+
const own = ownZoom(doc, view);
|
|
5107
|
+
const scrolled = `position:relative;left:${-scrollX / own}px;top:${-scrollY / own}px`;
|
|
4949
5108
|
const sized = rootSize(doc, view);
|
|
4950
|
-
|
|
5109
|
+
const zoom = layoutZoom(view);
|
|
5110
|
+
const zoomed = rootZoom(doc, view, zoom);
|
|
5111
|
+
root.setAttribute("style", `${root.getAttribute("style") ?? ""};${sized};${scrolled}${zoomed}`);
|
|
4951
5112
|
const markup = new XMLSerializer().serializeToString(root);
|
|
4952
|
-
const svg =
|
|
5113
|
+
const svg = drawing(markup, width, height, sized, zoom);
|
|
4953
5114
|
const image = new Image;
|
|
4954
5115
|
try {
|
|
4955
5116
|
image.src = svgUrl(svg);
|
|
@@ -5029,12 +5190,13 @@ function pictureOf(frame2) {
|
|
|
5029
5190
|
node.setAttribute("style", viewportUnits(node.getAttribute("style") ?? "", tall));
|
|
5030
5191
|
}
|
|
5031
5192
|
const full = Math.max(doc.documentElement.scrollHeight, tall);
|
|
5032
|
-
const root = doc.documentElement.getBoundingClientRect().height;
|
|
5193
|
+
const root = doc.documentElement.getBoundingClientRect().height / ownZoom(doc, view);
|
|
5033
5194
|
const sized = rootSize(doc, view);
|
|
5034
|
-
|
|
5195
|
+
const zoom = layoutZoom(view);
|
|
5196
|
+
const zoomed = rootZoom(doc, view, zoom);
|
|
5197
|
+
copy.setAttribute("style", `${copy.getAttribute("style") ?? ""};${sized};height:${root}px !important${zoomed}`);
|
|
5035
5198
|
const markup = new XMLSerializer().serializeToString(copy);
|
|
5036
|
-
|
|
5037
|
-
return { src: svgUrl(svg), width, height: full };
|
|
5199
|
+
return { src: svgUrl(drawing(markup, width, full, sized, zoom)), width, height: full };
|
|
5038
5200
|
}
|
|
5039
5201
|
function createUnderbar(glass, frame2) {
|
|
5040
5202
|
const band = el("div", "underbar");
|
|
@@ -6402,8 +6564,8 @@ function copyBars(shown2, value, size) {
|
|
|
6402
6564
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${size.width}" height="${size.height}">` + `<foreignObject width="100%" height="100%">${markup}</foreignObject></svg>`;
|
|
6403
6565
|
const image = new Image;
|
|
6404
6566
|
image.src = svgUrl(svg);
|
|
6405
|
-
const
|
|
6406
|
-
return { drawing, size, glass: bars ? glassOf(bars, host) : [] };
|
|
6567
|
+
const drawing2 = image.decode().then(() => image, () => null);
|
|
6568
|
+
return { drawing: drawing2, size, glass: bars ? glassOf(bars, host) : [] };
|
|
6407
6569
|
}
|
|
6408
6570
|
async function paintBars(shot, bars) {
|
|
6409
6571
|
const image = await bars.drawing;
|
|
@@ -7065,10 +7227,10 @@ function leafOf(side, picture, turning2, across) {
|
|
|
7065
7227
|
screen.style.boxShadow = `0 0 0 ${UNDER}px #000`;
|
|
7066
7228
|
node.append(screen);
|
|
7067
7229
|
if (body) {
|
|
7068
|
-
const
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
node.append(
|
|
7230
|
+
const drawing2 = drawMock(body, size, href);
|
|
7231
|
+
drawing2.style.width = "100%";
|
|
7232
|
+
drawing2.style.height = "100%";
|
|
7233
|
+
node.append(drawing2);
|
|
7072
7234
|
}
|
|
7073
7235
|
const opening = placeAt(div(""), rect);
|
|
7074
7236
|
const dark = div("");
|
|
@@ -8661,7 +8823,7 @@ var veil = null;
|
|
|
8661
8823
|
var mat = null;
|
|
8662
8824
|
var matKey = "";
|
|
8663
8825
|
var stage = null;
|
|
8664
|
-
var
|
|
8826
|
+
var drawing2 = null;
|
|
8665
8827
|
var screen = null;
|
|
8666
8828
|
var glass = null;
|
|
8667
8829
|
var pageBox = null;
|
|
@@ -9145,7 +9307,7 @@ function unwatchDensity() {
|
|
|
9145
9307
|
densityRatio = 0;
|
|
9146
9308
|
}
|
|
9147
9309
|
function resize() {
|
|
9148
|
-
if (!frame3 || !letterbox || !stage || !
|
|
9310
|
+
if (!frame3 || !letterbox || !stage || !drawing2 || !screen || !readout || !caption)
|
|
9149
9311
|
return;
|
|
9150
9312
|
if (released || turning() || folding())
|
|
9151
9313
|
return;
|
|
@@ -9180,9 +9342,9 @@ function resize() {
|
|
|
9180
9342
|
const radii = mock ? corners(mock.screenRadius).map((radius) => `${radius * place2.zoom}px`) : [];
|
|
9181
9343
|
showBrowser(bars, page, place2, auto, radii.join(" "));
|
|
9182
9344
|
touchDot?.fit(place2, place2.zoom);
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
const at = mock ?
|
|
9345
|
+
drawing2.style.width = `${place2.box.width}px`;
|
|
9346
|
+
drawing2.style.height = `${place2.box.height}px`;
|
|
9347
|
+
const at = mock ? drawing2.getBoundingClientRect() : null;
|
|
9186
9348
|
const ratio = window.devicePixelRatio;
|
|
9187
9349
|
const nudge = at ? { x: snapShift(at.left + place2.left, ratio), y: snapShift(at.top + place2.top, ratio) } : null;
|
|
9188
9350
|
screen.style.left = `${place2.left - (mock?.inset.left ?? 0) * place2.scale + (nudge?.x ?? 0)}px`;
|
|
@@ -9508,8 +9670,8 @@ function open(veiled, first) {
|
|
|
9508
9670
|
readout.append(caption, picker);
|
|
9509
9671
|
stage = document.createElement("div");
|
|
9510
9672
|
stage.className = "stage";
|
|
9511
|
-
|
|
9512
|
-
|
|
9673
|
+
drawing2 = document.createElement("div");
|
|
9674
|
+
drawing2.className = "drawing";
|
|
9513
9675
|
screen = document.createElement("div");
|
|
9514
9676
|
screen.className = "screen";
|
|
9515
9677
|
glass = document.createElement("div");
|
|
@@ -9572,8 +9734,8 @@ function open(veiled, first) {
|
|
|
9572
9734
|
turnCover.className = "screenblank";
|
|
9573
9735
|
turnCover.hidden = true;
|
|
9574
9736
|
screen.append(glass);
|
|
9575
|
-
|
|
9576
|
-
stage.append(
|
|
9737
|
+
drawing2.append(screen);
|
|
9738
|
+
stage.append(drawing2);
|
|
9577
9739
|
letterbox.append(veil, back, readout, stage, notice);
|
|
9578
9740
|
letterbox.addEventListener("wheel", onWheel, { passive: false });
|
|
9579
9741
|
root.append(letterbox);
|
|
@@ -9638,7 +9800,7 @@ function teardown() {
|
|
|
9638
9800
|
mat = null;
|
|
9639
9801
|
matKey = "";
|
|
9640
9802
|
stage = null;
|
|
9641
|
-
|
|
9803
|
+
drawing2 = null;
|
|
9642
9804
|
screen = null;
|
|
9643
9805
|
glass = null;
|
|
9644
9806
|
pageBox = null;
|
package/dist/grab/fiber.d.ts
CHANGED
|
@@ -13,5 +13,7 @@ export declare function isComposite(fiber: Fiber): boolean;
|
|
|
13
13
|
* boundary at most, so a route's key far above never shows.
|
|
14
14
|
*/
|
|
15
15
|
export declare function listKey(fiber: Fiber | null): string | null;
|
|
16
|
+
/** A name a production build shortened, like `xf`: component names start uppercase. */
|
|
17
|
+
export declare function isMinifiedName(name: string): boolean;
|
|
16
18
|
/** Names of the components above the fiber, nearest first, that `accept` lets through. */
|
|
17
19
|
export declare function componentNames(fiber: Fiber | null, max: number, accept: (name: string) => boolean): string[];
|
package/dist/grab/overlay.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ export declare const LERP = 0.3;
|
|
|
5
5
|
export declare const HIDE_WAIT = 100;
|
|
6
6
|
/** How long the toast stays, and the box with it, in ms. */
|
|
7
7
|
export declare const TOAST_TIME = 1500;
|
|
8
|
+
/**
|
|
9
|
+
* One color for the boxes and the glow, wider where the screen shows P3: the
|
|
10
|
+
* one picked, one of the user's own too, or a blue, and a green where the page
|
|
11
|
+
* is blue. The label goes
|
|
12
|
+
* by the page: light on a dark one, dark on a light one.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CSS: string;
|
|
8
15
|
/**
|
|
9
16
|
* One frame of some numbers on their way to their targets, `elapsed` ms after
|
|
10
17
|
* the last. The same share of what is left goes each 60th of a second,
|
|
@@ -88,7 +95,9 @@ export declare function snap(value: number, ratio: number): number;
|
|
|
88
95
|
* the fill between them in three. The corners keep their size and only move.
|
|
89
96
|
* The lines and the fills are one device pixel of one color, stretched by
|
|
90
97
|
* whole ones: the browser puts a box on device pixels before it scales it, so
|
|
91
|
-
* one px stretched leaves gaps where a px is not a whole number of them.
|
|
98
|
+
* one px stretched leaves gaps where a px is not a whole number of them. A
|
|
99
|
+
* stretched piece must not be its own layer: the browser rounds the layer's
|
|
100
|
+
* size up, and the stretch makes that rounding grow with it. No
|
|
92
101
|
* two pieces overlap, and every side is on a whole device pixel, so they meet
|
|
93
102
|
* with no seam. The radius is not the shape's own, which is on its way: each
|
|
94
103
|
* new one paints the corners again, so the box takes its element's at once.
|
|
@@ -5,32 +5,32 @@ import {
|
|
|
5
5
|
riskyElement,
|
|
6
6
|
specificity,
|
|
7
7
|
splitList
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-df35z48z.js";
|
|
9
9
|
import {
|
|
10
10
|
middle
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-za4ppxay.js";
|
|
12
12
|
import {
|
|
13
13
|
NEW_RULE_SHEET,
|
|
14
14
|
isNewRuleSheet,
|
|
15
15
|
isShadowRoot,
|
|
16
16
|
label
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-a8ffw5ft.js";
|
|
18
18
|
import {
|
|
19
19
|
actButton,
|
|
20
20
|
el
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-20bc9yrj.js";
|
|
22
22
|
import {
|
|
23
23
|
icon,
|
|
24
24
|
isDevknobs,
|
|
25
25
|
typesInField
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-whehz74d.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-jfv7vavj.js";
|
|
34
34
|
|
|
35
35
|
// src/styles/collect.ts
|
|
36
36
|
function isKind(rule, kind) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
label
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-a8ffw5ft.js";
|
|
4
4
|
import {
|
|
5
5
|
frameWindow,
|
|
6
6
|
subscribe
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-x3sxssbs.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-whehz74d.js";
|
|
15
15
|
import {
|
|
16
16
|
addStyle,
|
|
17
17
|
isDevknobsFrame,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
post,
|
|
20
20
|
readMessage,
|
|
21
21
|
systemMedia
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-jfv7vavj.js";
|
|
23
23
|
import {
|
|
24
24
|
__require
|
|
25
25
|
} from "./index-5tv6sr74.js";
|
|
@@ -164,7 +164,7 @@ function systemScheme() {
|
|
|
164
164
|
host.remove();
|
|
165
165
|
return dark ? "dark" : "light";
|
|
166
166
|
}
|
|
167
|
-
function createGrab(options = {}, loadMode = () => import("./index-
|
|
167
|
+
function createGrab(options = {}, loadMode = () => import("./index-t4wrs2a3.js")) {
|
|
168
168
|
const keyNow = options.key ?? defaultGrabKey;
|
|
169
169
|
const { purpose } = options;
|
|
170
170
|
const channel = purpose?.channel ?? "grab";
|
|
@@ -373,7 +373,7 @@ function held(view) {
|
|
|
373
373
|
return null;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
function createInspect(options = {}, load = () => import("./index-
|
|
376
|
+
function createInspect(options = {}, load = () => import("./index-t4wrs2a3.js"), frameOf = frameWindow) {
|
|
377
377
|
const inFrame = isDevknobsFrame();
|
|
378
378
|
const listeners = new Set;
|
|
379
379
|
let outliner = null;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
grabColor,
|
|
8
8
|
isCLike,
|
|
9
9
|
isElement
|
|
10
|
-
} from "./react-
|
|
10
|
+
} from "./react-v08ywmtw.js";
|
|
11
11
|
import {
|
|
12
12
|
componentOf,
|
|
13
13
|
escapeText,
|
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
grabEntry,
|
|
16
16
|
joinEntries,
|
|
17
17
|
quickEntry
|
|
18
|
-
} from "./react-
|
|
18
|
+
} from "./react-yx3g9k55.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-wtgvkf6g.js";
|
|
25
25
|
import {
|
|
26
26
|
middle
|
|
27
|
-
} from "./react-
|
|
28
|
-
import"./react-
|
|
27
|
+
} from "./react-73reavv4.js";
|
|
28
|
+
import"./react-4phtr2nd.js";
|
|
29
29
|
import"./react-5rq7bnsy.js";
|
|
30
30
|
import {
|
|
31
31
|
HOST_RESET,
|
|
@@ -34,15 +34,15 @@ import {
|
|
|
34
34
|
holdInTopLayer,
|
|
35
35
|
pause,
|
|
36
36
|
subscribe
|
|
37
|
-
} from "./react-
|
|
38
|
-
import"./react-
|
|
37
|
+
} from "./react-a1r0nr0g.js";
|
|
38
|
+
import"./react-5h7pxnax.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-vbk58f9m.js";
|
|
46
46
|
import {
|
|
47
47
|
RINGS,
|
|
48
48
|
addStyle,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
ringQuads,
|
|
63
63
|
systemMedia,
|
|
64
64
|
watchSystemMedia
|
|
65
|
-
} from "./react-
|
|
65
|
+
} from "./react-0r5418av.js";
|
|
66
66
|
import"./react-fp73vhyd.js";
|
|
67
67
|
import"./react-t2qnewz2.js";
|
|
68
68
|
|
|
@@ -830,8 +830,8 @@ ${colorRules("p3")}
|
|
|
830
830
|
top: 0;
|
|
831
831
|
left: 0;
|
|
832
832
|
transform-origin: 0 0;
|
|
833
|
-
will-change: transform;
|
|
834
833
|
}
|
|
834
|
+
.glide { will-change: transform; }
|
|
835
835
|
.fills > .part, .lines > .part {
|
|
836
836
|
width: var(--unit);
|
|
837
837
|
height: var(--unit);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
realNow,
|
|
4
4
|
stamped,
|
|
5
5
|
webStorage
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-jfv7vavj.js";
|
|
7
7
|
import {
|
|
8
8
|
__require
|
|
9
9
|
} from "./index-5tv6sr74.js";
|
|
@@ -408,7 +408,7 @@ function settled(view, quiet = QUIET, longest = SETTLE_MAX) {
|
|
|
408
408
|
}
|
|
409
409
|
function createKeeper(options) {
|
|
410
410
|
const { log, store, view } = options;
|
|
411
|
-
const loadReplay = options.replay ?? (() => import("./replay-
|
|
411
|
+
const loadReplay = options.replay ?? (() => import("./replay-ehgxp9py.js").then(({ replayEdits }) => replayEdits));
|
|
412
412
|
const wait = options.settled ?? (() => settled(view));
|
|
413
413
|
const frame = options.frame ?? (() => null);
|
|
414
414
|
const ours = new WeakMap;
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
resolveNesting,
|
|
7
7
|
splitList
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-df35z48z.js";
|
|
9
9
|
import {
|
|
10
10
|
flatParent,
|
|
11
11
|
isNewRuleSheet,
|
|
12
12
|
isShadowRoot,
|
|
13
13
|
scopeOf
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-a8ffw5ft.js";
|
|
15
15
|
import {
|
|
16
16
|
isDevknobs
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-whehz74d.js";
|
|
18
18
|
import {
|
|
19
19
|
addStyle,
|
|
20
20
|
ensureStyle,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
stamped,
|
|
26
26
|
versionOf,
|
|
27
27
|
webStorage
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-jfv7vavj.js";
|
|
29
29
|
|
|
30
30
|
// src/styles/force.ts
|
|
31
31
|
var FORCED_STATES = ["hover", "focus", "focus-visible", "active", "focus-within"];
|