@githumbi/grabby 0.5.0 → 0.5.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 +6 -0
- package/dist/angular/index.js +66 -17
- package/dist/angular/index.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/core/index.cjs +122 -73
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +66 -17
- package/dist/core/index.js.map +1 -1
- package/dist/grabby.global.js +132 -118
- package/dist/react/index.js +66 -17
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
package/dist/core/index.cjs
CHANGED
|
@@ -3562,6 +3562,8 @@ function createFreezeOverlay() {
|
|
|
3562
3562
|
|
|
3563
3563
|
// src/core/overlay/markers.ts
|
|
3564
3564
|
var LAYER_ID = "__grabby-markers__";
|
|
3565
|
+
var DOC_LAYER_ID = "__grabby-markers-doc__";
|
|
3566
|
+
var CONTEXT_CHECK_MS = 1e3;
|
|
3565
3567
|
var TIP_ID = "__grabby-marker-tip__";
|
|
3566
3568
|
var STYLE_ID9 = "__grabby-marker-styles__";
|
|
3567
3569
|
var SIZE = 22;
|
|
@@ -3573,8 +3575,18 @@ var ICON_EDIT = {
|
|
|
3573
3575
|
size: 12,
|
|
3574
3576
|
shapes: paths("M10.5 2.5l3 3L6 13H3v-3z", "M9 4l3 3")
|
|
3575
3577
|
};
|
|
3578
|
+
function scrollContextOf(el) {
|
|
3579
|
+
for (let cur = el.parentElement; cur && cur !== document.body && cur !== document.documentElement; cur = cur.parentElement) {
|
|
3580
|
+
const style = getComputedStyle(cur);
|
|
3581
|
+
if (style.position === "fixed" || style.position === "sticky") return "screen";
|
|
3582
|
+
if (/(auto|scroll|overlay)/.test(style.overflowY + style.overflowX)) return "screen";
|
|
3583
|
+
}
|
|
3584
|
+
const own = getComputedStyle(el).position;
|
|
3585
|
+
return own === "fixed" || own === "sticky" ? "screen" : "page";
|
|
3586
|
+
}
|
|
3576
3587
|
function createMarkers(deps) {
|
|
3577
3588
|
let layer = null;
|
|
3589
|
+
let docLayer = null;
|
|
3578
3590
|
let tip = null;
|
|
3579
3591
|
let visible = false;
|
|
3580
3592
|
let route = "";
|
|
@@ -3585,13 +3597,27 @@ function createMarkers(deps) {
|
|
|
3585
3597
|
function injectStyles2() {
|
|
3586
3598
|
if (hasStyles(STYLE_ID9)) return;
|
|
3587
3599
|
addStyles(STYLE_ID9, `
|
|
3600
|
+
/*
|
|
3601
|
+
* Page coordinates: the browser moves these with the page as it
|
|
3602
|
+
* scrolls, so they never trail behind their element. (A fixed layer
|
|
3603
|
+
* repositioned from script lags a frame behind fast scrolling.)
|
|
3604
|
+
*/
|
|
3605
|
+
#${DOC_LAYER_ID} {
|
|
3606
|
+
position: absolute;
|
|
3607
|
+
left: 0;
|
|
3608
|
+
top: 0;
|
|
3609
|
+
width: 0;
|
|
3610
|
+
height: 0;
|
|
3611
|
+
pointer-events: none;
|
|
3612
|
+
z-index: ${Z_INDEX_CROSSHAIR};
|
|
3613
|
+
}
|
|
3588
3614
|
#${LAYER_ID} {
|
|
3589
3615
|
position: fixed;
|
|
3590
3616
|
inset: 0;
|
|
3591
3617
|
pointer-events: none;
|
|
3592
3618
|
z-index: ${Z_INDEX_CROSSHAIR};
|
|
3593
3619
|
}
|
|
3594
|
-
|
|
3620
|
+
.grabby-markers-layer .grabby-marker {
|
|
3595
3621
|
position: absolute;
|
|
3596
3622
|
left: 0;
|
|
3597
3623
|
top: 0;
|
|
@@ -3612,22 +3638,22 @@ function createMarkers(deps) {
|
|
|
3612
3638
|
pointer-events: auto;
|
|
3613
3639
|
transition: transform 0.12s ease, box-shadow 0.15s ease;
|
|
3614
3640
|
}
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3641
|
+
.grabby-markers-layer .grabby-marker[hidden] { display: none; }
|
|
3642
|
+
.grabby-markers-layer .grabby-marker:hover,
|
|
3643
|
+
.grabby-markers-layer .grabby-marker:focus-visible {
|
|
3618
3644
|
z-index: 1;
|
|
3619
3645
|
outline: none;
|
|
3620
3646
|
box-shadow: 0 0 0 2px #fff, 0 0 0 5px color-mix(in srgb, var(--grabby-accent, #2563eb) 35%, transparent), 0 2px 6px rgba(0, 0, 0, 0.25);
|
|
3621
3647
|
}
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3648
|
+
.grabby-markers-layer .grabby-marker-edit { display: none; }
|
|
3649
|
+
.grabby-markers-layer .grabby-marker:hover .grabby-marker-num,
|
|
3650
|
+
.grabby-markers-layer .grabby-marker:focus-visible .grabby-marker-num { display: none; }
|
|
3651
|
+
.grabby-markers-layer .grabby-marker:hover .grabby-marker-edit,
|
|
3652
|
+
.grabby-markers-layer .grabby-marker:focus-visible .grabby-marker-edit { display: block; }
|
|
3653
|
+
.grabby-markers-layer .grabby-marker-in {
|
|
3628
3654
|
animation: grabby-marker-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
3629
3655
|
}
|
|
3630
|
-
|
|
3656
|
+
.grabby-markers-layer .grabby-marker-out {
|
|
3631
3657
|
animation: grabby-marker-out 0.2s ease-out both;
|
|
3632
3658
|
pointer-events: none;
|
|
3633
3659
|
}
|
|
@@ -3661,7 +3687,7 @@ function createMarkers(deps) {
|
|
|
3661
3687
|
to { opacity: 1; transform: none; }
|
|
3662
3688
|
}
|
|
3663
3689
|
@media (prefers-reduced-motion: reduce) {
|
|
3664
|
-
|
|
3690
|
+
.grabby-markers-layer .grabby-marker-in, .grabby-markers-layer .grabby-marker-out, #${TIP_ID} { animation: none; }
|
|
3665
3691
|
}
|
|
3666
3692
|
`);
|
|
3667
3693
|
}
|
|
@@ -3670,11 +3696,15 @@ function createMarkers(deps) {
|
|
|
3670
3696
|
injectStyles2();
|
|
3671
3697
|
layer = document.createElement("div");
|
|
3672
3698
|
layer.id = LAYER_ID;
|
|
3699
|
+
layer.className = "grabby-markers-layer";
|
|
3700
|
+
docLayer = document.createElement("div");
|
|
3701
|
+
docLayer.id = DOC_LAYER_ID;
|
|
3702
|
+
docLayer.className = "grabby-markers-layer";
|
|
3673
3703
|
tip = document.createElement("div");
|
|
3674
3704
|
tip.id = TIP_ID;
|
|
3675
3705
|
tip.hidden = true;
|
|
3676
3706
|
tip.setAttribute("role", "tooltip");
|
|
3677
|
-
getUiRoot().append(layer, tip);
|
|
3707
|
+
getUiRoot().append(docLayer, layer, tip);
|
|
3678
3708
|
return layer;
|
|
3679
3709
|
}
|
|
3680
3710
|
function pageComments() {
|
|
@@ -3692,7 +3722,7 @@ function createMarkers(deps) {
|
|
|
3692
3722
|
button.className = "grabby-marker";
|
|
3693
3723
|
button.dataset.grabbyMarker = comment.id;
|
|
3694
3724
|
button.append(number, svgIcon(ICON_EDIT, "grabby-marker-edit"));
|
|
3695
|
-
const entry = { comment, button, number, element: null, lastLookup: 0 };
|
|
3725
|
+
const entry = { comment, button, number, element: null, lastLookup: 0, context: "page", contextCheckedAt: -Infinity };
|
|
3696
3726
|
button.addEventListener("click", (e) => {
|
|
3697
3727
|
e.preventDefault();
|
|
3698
3728
|
e.stopPropagation();
|
|
@@ -3796,9 +3826,20 @@ function createMarkers(deps) {
|
|
|
3796
3826
|
entry.button.hidden = true;
|
|
3797
3827
|
continue;
|
|
3798
3828
|
}
|
|
3829
|
+
if (now - entry.contextCheckedAt >= CONTEXT_CHECK_MS) {
|
|
3830
|
+
entry.contextCheckedAt = now;
|
|
3831
|
+
entry.context = scrollContextOf(entry.element);
|
|
3832
|
+
const home = entry.context === "page" ? docLayer : layer;
|
|
3833
|
+
if (home && entry.button.parentElement !== home) home.appendChild(entry.button);
|
|
3834
|
+
}
|
|
3799
3835
|
const pin = _nullishCoalesce(entry.comment.pin, () => ( { x: 1, y: 0 }));
|
|
3800
|
-
const
|
|
3801
|
-
|
|
3836
|
+
const maxX = (document.documentElement.clientWidth || window.innerWidth) - SIZE;
|
|
3837
|
+
let x = Math.max(0, Math.min(rect.left + pin.x * rect.width - SIZE / 2, maxX));
|
|
3838
|
+
let y = rect.top + pin.y * rect.height - SIZE / 2;
|
|
3839
|
+
if (entry.context === "page") {
|
|
3840
|
+
x += window.scrollX;
|
|
3841
|
+
y = Math.max(0, y + window.scrollY);
|
|
3842
|
+
}
|
|
3802
3843
|
entry.button.hidden = false;
|
|
3803
3844
|
entry.button.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;
|
|
3804
3845
|
}
|
|
@@ -3828,6 +3869,9 @@ function createMarkers(deps) {
|
|
|
3828
3869
|
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
3829
3870
|
rafId = null;
|
|
3830
3871
|
}
|
|
3872
|
+
function handleScroll() {
|
|
3873
|
+
if (visible && entries.size) position(performance.now());
|
|
3874
|
+
}
|
|
3831
3875
|
return {
|
|
3832
3876
|
setVisible(next) {
|
|
3833
3877
|
if (next === visible) return;
|
|
@@ -3835,8 +3879,10 @@ function createMarkers(deps) {
|
|
|
3835
3879
|
if (next) {
|
|
3836
3880
|
route = deps.currentRoute();
|
|
3837
3881
|
lastRouteCheck = performance.now();
|
|
3882
|
+
document.addEventListener("scroll", handleScroll, { capture: true, passive: true });
|
|
3838
3883
|
sync(true);
|
|
3839
3884
|
} else {
|
|
3885
|
+
document.removeEventListener("scroll", handleScroll, true);
|
|
3840
3886
|
stop();
|
|
3841
3887
|
hideTip();
|
|
3842
3888
|
if (hovered) endHover(hovered);
|
|
@@ -3847,13 +3893,16 @@ function createMarkers(deps) {
|
|
|
3847
3893
|
sync(false);
|
|
3848
3894
|
},
|
|
3849
3895
|
isMarkerElement(el) {
|
|
3850
|
-
return
|
|
3896
|
+
return [layer, docLayer].some((l) => !!l && (l === el || l.contains(el)));
|
|
3851
3897
|
},
|
|
3852
3898
|
dispose() {
|
|
3853
3899
|
stop();
|
|
3900
|
+
document.removeEventListener("scroll", handleScroll, true);
|
|
3854
3901
|
entries.clear();
|
|
3855
3902
|
_optionalChain([layer, 'optionalAccess', _139 => _139.remove, 'call', _140 => _140()]);
|
|
3856
|
-
_optionalChain([
|
|
3903
|
+
_optionalChain([docLayer, 'optionalAccess', _141 => _141.remove, 'call', _142 => _142()]);
|
|
3904
|
+
docLayer = null;
|
|
3905
|
+
_optionalChain([tip, 'optionalAccess', _143 => _143.remove, 'call', _144 => _144()]);
|
|
3857
3906
|
layer = null;
|
|
3858
3907
|
tip = null;
|
|
3859
3908
|
hovered = null;
|
|
@@ -4037,7 +4086,7 @@ function clearPersistedHistory() {
|
|
|
4037
4086
|
var baselineFrame = null;
|
|
4038
4087
|
var baselineCache = /* @__PURE__ */ new Map();
|
|
4039
4088
|
function baselineDoc() {
|
|
4040
|
-
if (_optionalChain([baselineFrame, 'optionalAccess',
|
|
4089
|
+
if (_optionalChain([baselineFrame, 'optionalAccess', _145 => _145.isConnected]) && baselineFrame.contentDocument) return baselineFrame.contentDocument;
|
|
4041
4090
|
try {
|
|
4042
4091
|
baselineFrame = document.createElement("iframe");
|
|
4043
4092
|
baselineFrame.setAttribute("aria-hidden", "true");
|
|
@@ -4067,8 +4116,8 @@ function baselineFor(tag, type, props) {
|
|
|
4067
4116
|
const missing = props.filter((p) => !cached.has(p));
|
|
4068
4117
|
if (missing.length > 0) {
|
|
4069
4118
|
const doc = baselineDoc();
|
|
4070
|
-
const view = _optionalChain([doc, 'optionalAccess',
|
|
4071
|
-
if (_optionalChain([doc, 'optionalAccess',
|
|
4119
|
+
const view = _optionalChain([doc, 'optionalAccess', _146 => _146.defaultView]);
|
|
4120
|
+
if (_optionalChain([doc, 'optionalAccess', _147 => _147.body]) && view) {
|
|
4072
4121
|
const probe = doc.createElement(tag);
|
|
4073
4122
|
if (type) probe.setAttribute("type", type);
|
|
4074
4123
|
doc.body.appendChild(probe);
|
|
@@ -4082,7 +4131,7 @@ function baselineFor(tag, type, props) {
|
|
|
4082
4131
|
return cached;
|
|
4083
4132
|
}
|
|
4084
4133
|
function disposeStyleBaseline() {
|
|
4085
|
-
_optionalChain([baselineFrame, 'optionalAccess',
|
|
4134
|
+
_optionalChain([baselineFrame, 'optionalAccess', _148 => _148.remove, 'call', _149 => _149()]);
|
|
4086
4135
|
baselineFrame = null;
|
|
4087
4136
|
baselineCache.clear();
|
|
4088
4137
|
}
|
|
@@ -4184,7 +4233,7 @@ function states(el) {
|
|
|
4184
4233
|
}
|
|
4185
4234
|
function actionFacts(el) {
|
|
4186
4235
|
const f = {};
|
|
4187
|
-
const imgAlt = _nullishCoalesce(_optionalChain([el, 'access',
|
|
4236
|
+
const imgAlt = _nullishCoalesce(_optionalChain([el, 'access', _150 => _150.querySelector, 'call', _151 => _151("img[alt]"), 'optionalAccess', _152 => _152.getAttribute, 'call', _153 => _153("alt")]), () => ( ""));
|
|
4188
4237
|
put(f, "label", accessibleLabel(el) || textOf(el, 80) || redact(_nullishCoalesce(el.getAttribute("title"), () => ( ""))) || redact(imgAlt));
|
|
4189
4238
|
if (el.tagName === "A") put(f, "href", sanitizeUrl(_nullishCoalesce(el.getAttribute("href"), () => ( ""))));
|
|
4190
4239
|
else if (el.tagName === "BUTTON" || el.tagName === "INPUT") put(f, "type", _nullishCoalesce(el.getAttribute("type"), () => ( (el.tagName === "BUTTON" ? "submit" : ""))));
|
|
@@ -4233,7 +4282,7 @@ function mediaFacts(el) {
|
|
|
4233
4282
|
put(f, "label", accessibleLabel(el) || textOf(_nullishCoalesce(el.querySelector("title"), () => ( el)), 40));
|
|
4234
4283
|
put(f, "viewBox", _nullishCoalesce(el.getAttribute("viewBox"), () => ( "")));
|
|
4235
4284
|
} else if (el.tagName === "VIDEO" || el.tagName === "AUDIO" || el.tagName === "IFRAME") {
|
|
4236
|
-
put(f, "src", basename3(_nullishCoalesce(_nullishCoalesce(el.getAttribute("src"), () => ( _optionalChain([el, 'access',
|
|
4285
|
+
put(f, "src", basename3(_nullishCoalesce(_nullishCoalesce(el.getAttribute("src"), () => ( _optionalChain([el, 'access', _154 => _154.querySelector, 'call', _155 => _155("source"), 'optionalAccess', _156 => _156.getAttribute, 'call', _157 => _157("src")]))), () => ( ""))));
|
|
4237
4286
|
put(f, "title", redact(_nullishCoalesce(el.getAttribute("title"), () => ( ""))));
|
|
4238
4287
|
}
|
|
4239
4288
|
put(f, "size", size(el));
|
|
@@ -4241,8 +4290,8 @@ function mediaFacts(el) {
|
|
|
4241
4290
|
return f;
|
|
4242
4291
|
}
|
|
4243
4292
|
function childLabel(child, resolver) {
|
|
4244
|
-
const resolved = _optionalChain([resolver, 'optionalCall',
|
|
4245
|
-
if (_optionalChain([resolved, 'optionalAccess',
|
|
4293
|
+
const resolved = _optionalChain([resolver, 'optionalCall', _158 => _158(child)]);
|
|
4294
|
+
if (_optionalChain([resolved, 'optionalAccess', _159 => _159.name]) && resolved.hostElement === child) return resolved.name;
|
|
4246
4295
|
const tag = child.tagName.toLowerCase();
|
|
4247
4296
|
if (/^h[1-6]$/.test(tag)) return "heading";
|
|
4248
4297
|
if (tag === "a") return "link";
|
|
@@ -4277,7 +4326,7 @@ function sectionFacts(el, resolver) {
|
|
|
4277
4326
|
const f = {};
|
|
4278
4327
|
put(f, "title", redact(el.ownerDocument.title));
|
|
4279
4328
|
put(f, "viewport", `${window.innerWidth}\xD7${window.innerHeight}`);
|
|
4280
|
-
const regions = Array.from(el.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter((r) => !_optionalChain([r, 'access',
|
|
4329
|
+
const regions = Array.from(el.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter((r) => !_optionalChain([r, 'access', _160 => _160.parentElement, 'optionalAccess', _161 => _161.closest, 'call', _162 => _162('header, nav, main, aside, footer, section, [role="region"]')]) || r.parentElement === el).slice(0, 8).map((r) => {
|
|
4281
4330
|
const heading = firstHeading2(r);
|
|
4282
4331
|
return heading ? `${r.tagName.toLowerCase()} "${truncate(heading, 30)}"` : r.tagName.toLowerCase();
|
|
4283
4332
|
});
|
|
@@ -4334,22 +4383,22 @@ function isAppFile(file) {
|
|
|
4334
4383
|
return !!file && !/(^|[\\/])node_modules[\\/]/.test(file);
|
|
4335
4384
|
}
|
|
4336
4385
|
function resolveStack(el, deps) {
|
|
4337
|
-
const comp = _nullishCoalesce(_optionalChain([deps, 'access',
|
|
4386
|
+
const comp = _nullishCoalesce(_optionalChain([deps, 'access', _163 => _163.componentResolver, 'optionalCall', _164 => _164(el)]), () => ( null));
|
|
4338
4387
|
const frames = [];
|
|
4339
4388
|
const named = [];
|
|
4340
|
-
for (const entry of _nullishCoalesce(_optionalChain([comp, 'optionalAccess',
|
|
4389
|
+
for (const entry of _nullishCoalesce(_optionalChain([comp, 'optionalAccess', _165 => _165.stack]), () => ( []))) {
|
|
4341
4390
|
const src = entry.filePath !== void 0 ? { filePath: entry.filePath, line: _nullishCoalesce(entry.line, () => ( null)) } : entry.hostElement && deps.sourceResolver ? deps.sourceResolver(entry.hostElement) : null;
|
|
4342
|
-
const frame = { name: entry.name, file: _nullishCoalesce(_optionalChain([src, 'optionalAccess',
|
|
4391
|
+
const frame = { name: entry.name, file: _nullishCoalesce(_optionalChain([src, 'optionalAccess', _166 => _166.filePath]), () => ( null)), line: _nullishCoalesce(_optionalChain([src, 'optionalAccess', _167 => _167.line]), () => ( null)) };
|
|
4343
4392
|
named.push(frame);
|
|
4344
4393
|
if (isAppFile(frame.file) && frames.length < MAX_STACK) frames.push(frame);
|
|
4345
4394
|
}
|
|
4346
|
-
return { component: _nullishCoalesce(_optionalChain([comp, 'optionalAccess',
|
|
4395
|
+
return { component: _nullishCoalesce(_optionalChain([comp, 'optionalAccess', _168 => _168.name]), () => ( null)), frames: frames.length > 0 ? frames : named.slice(0, 2) };
|
|
4347
4396
|
}
|
|
4348
4397
|
function resolveSource(el, deps, frames) {
|
|
4349
|
-
const own = _optionalChain([deps, 'access',
|
|
4398
|
+
const own = _optionalChain([deps, 'access', _169 => _169.sourceResolver, 'optionalCall', _170 => _170(el)]);
|
|
4350
4399
|
if (own && isAppFile(own.filePath)) return { file: own.filePath, line: own.line, column: own.column };
|
|
4351
4400
|
const first = frames.find((f) => isAppFile(f.file));
|
|
4352
|
-
return _optionalChain([first, 'optionalAccess',
|
|
4401
|
+
return _optionalChain([first, 'optionalAccess', _171 => _171.file]) ? { file: first.file, line: first.line, column: null } : null;
|
|
4353
4402
|
}
|
|
4354
4403
|
function captureTarget(el, deps) {
|
|
4355
4404
|
const cleanClasses = _nullishCoalesce(deps.cleanClasses, () => ( ((list) => list.filter((c) => !isNoiseClass(c)))));
|
|
@@ -4400,7 +4449,7 @@ function sandboxHtml() {
|
|
|
4400
4449
|
return policy ? policy.createHTML(SANDBOX_HTML) : null;
|
|
4401
4450
|
}
|
|
4402
4451
|
async function getSandbox() {
|
|
4403
|
-
if (_optionalChain([sandbox, 'optionalAccess',
|
|
4452
|
+
if (_optionalChain([sandbox, 'optionalAccess', _172 => _172.isConnected])) return sandbox;
|
|
4404
4453
|
const frame = document.createElement("iframe");
|
|
4405
4454
|
frame.setAttribute("aria-hidden", "true");
|
|
4406
4455
|
frame.setAttribute("tabindex", "-1");
|
|
@@ -4424,7 +4473,7 @@ async function getSandbox() {
|
|
|
4424
4473
|
return frame;
|
|
4425
4474
|
}
|
|
4426
4475
|
function disposeScreenshotSandbox() {
|
|
4427
|
-
_optionalChain([sandbox, 'optionalAccess',
|
|
4476
|
+
_optionalChain([sandbox, 'optionalAccess', _173 => _173.remove, 'call', _174 => _174()]);
|
|
4428
4477
|
sandbox = null;
|
|
4429
4478
|
}
|
|
4430
4479
|
function withTimeout(promise, ms) {
|
|
@@ -4584,7 +4633,7 @@ function resolveComponent(element) {
|
|
|
4584
4633
|
name: cleanComponentName(owning.constructor.name),
|
|
4585
4634
|
hostElement: _nullishCoalesce(host2, () => ( walk.parentElement))
|
|
4586
4635
|
});
|
|
4587
|
-
current = _nullishCoalesce(_nullishCoalesce(_optionalChain([host2, 'optionalAccess',
|
|
4636
|
+
current = _nullishCoalesce(_nullishCoalesce(_optionalChain([host2, 'optionalAccess', _175 => _175.parentElement]), () => ( _optionalChain([walk, 'access', _176 => _176.parentElement, 'optionalAccess', _177 => _177.parentElement]))), () => ( null));
|
|
4588
4637
|
while (current) {
|
|
4589
4638
|
const comp = ng.getComponent(current);
|
|
4590
4639
|
if (comp && !seen2.has(comp)) {
|
|
@@ -4718,14 +4767,14 @@ function resolveComponent2(element) {
|
|
|
4718
4767
|
let current = fiber;
|
|
4719
4768
|
while (current && stack.length < MAX_STACK2) {
|
|
4720
4769
|
const name = getComponentName(current.type);
|
|
4721
|
-
if (name && !isNoise(name) && _optionalChain([stack, 'access',
|
|
4770
|
+
if (name && !isNoise(name) && _optionalChain([stack, 'access', _178 => _178[stack.length - 1], 'optionalAccess', _179 => _179.name]) !== name) {
|
|
4722
4771
|
stack.push({ name, hostElement: findHostElement(current) });
|
|
4723
4772
|
}
|
|
4724
4773
|
current = current.return;
|
|
4725
4774
|
}
|
|
4726
4775
|
return {
|
|
4727
|
-
name: _nullishCoalesce(_optionalChain([stack, 'access',
|
|
4728
|
-
hostElement: _nullishCoalesce(_optionalChain([stack, 'access',
|
|
4776
|
+
name: _nullishCoalesce(_optionalChain([stack, 'access', _180 => _180[0], 'optionalAccess', _181 => _181.name]), () => ( null)),
|
|
4777
|
+
hostElement: _nullishCoalesce(_optionalChain([stack, 'access', _182 => _182[0], 'optionalAccess', _183 => _183.hostElement]), () => ( null)),
|
|
4729
4778
|
stack
|
|
4730
4779
|
};
|
|
4731
4780
|
}
|
|
@@ -4736,7 +4785,7 @@ var LOCATION = /^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;
|
|
|
4736
4785
|
function resolveSource3(element) {
|
|
4737
4786
|
let current = element;
|
|
4738
4787
|
while (current) {
|
|
4739
|
-
const raw = _optionalChain([current, 'access',
|
|
4788
|
+
const raw = _optionalChain([current, 'access', _184 => _184.getAttribute, 'optionalCall', _185 => _185(SOURCE_ATTRIBUTE)]);
|
|
4740
4789
|
if (raw) return parseLocation(raw);
|
|
4741
4790
|
current = current.parentElement;
|
|
4742
4791
|
}
|
|
@@ -4748,7 +4797,7 @@ function parseLocation(raw) {
|
|
|
4748
4797
|
return { filePath: match[1], line: Number(match[2]), column: Number(match[3]) };
|
|
4749
4798
|
}
|
|
4750
4799
|
function ownStamp(element) {
|
|
4751
|
-
const raw = _optionalChain([element, 'optionalAccess',
|
|
4800
|
+
const raw = _optionalChain([element, 'optionalAccess', _186 => _186.getAttribute, 'optionalCall', _187 => _187(SOURCE_ATTRIBUTE)]);
|
|
4752
4801
|
if (!raw) return null;
|
|
4753
4802
|
const match = LOCATION.exec(raw);
|
|
4754
4803
|
if (!match) return { file: raw, line: null, column: null, name: null };
|
|
@@ -4763,8 +4812,8 @@ function nameFromStamps(result) {
|
|
|
4763
4812
|
const stack = [];
|
|
4764
4813
|
for (const entry of result.stack) {
|
|
4765
4814
|
const stamp = ownStamp(entry.hostElement);
|
|
4766
|
-
const name = _nullishCoalesce(_optionalChain([stamp, 'optionalAccess',
|
|
4767
|
-
if (name && _optionalChain([stack, 'access',
|
|
4815
|
+
const name = _nullishCoalesce(_optionalChain([stamp, 'optionalAccess', _188 => _188.name]), () => ( (stamp ? baseName(stamp.file) : null)));
|
|
4816
|
+
if (name && _optionalChain([stack, 'access', _189 => _189[stack.length - 1], 'optionalAccess', _190 => _190.name]) !== name) stack.push({ name, hostElement: entry.hostElement });
|
|
4768
4817
|
}
|
|
4769
4818
|
return stack[0] ? { name: stack[0].name, hostElement: stack[0].hostElement, stack } : null;
|
|
4770
4819
|
}
|
|
@@ -4800,7 +4849,7 @@ function vue3Name(inst) {
|
|
|
4800
4849
|
return t.__name || t.name || t.displayName || (t.__file ? baseName(t.__file) : null);
|
|
4801
4850
|
}
|
|
4802
4851
|
function vue3Host(inst) {
|
|
4803
|
-
return firstElement(_nullishCoalesce(_optionalChain([inst, 'access',
|
|
4852
|
+
return firstElement(_nullishCoalesce(_optionalChain([inst, 'access', _191 => _191.subTree, 'optionalAccess', _192 => _192.el]), () => ( _optionalChain([inst, 'access', _193 => _193.vnode, 'optionalAccess', _194 => _194.el]))));
|
|
4804
4853
|
}
|
|
4805
4854
|
function vue2Owner(el) {
|
|
4806
4855
|
let current = el;
|
|
@@ -4840,7 +4889,7 @@ function resolveVueComponent(el) {
|
|
|
4840
4889
|
}
|
|
4841
4890
|
function resolveVueSource(el) {
|
|
4842
4891
|
const inst3 = vue3Owner(el);
|
|
4843
|
-
const file = _nullishCoalesce(_optionalChain([inst3, 'optionalAccess',
|
|
4892
|
+
const file = _nullishCoalesce(_optionalChain([inst3, 'optionalAccess', _195 => _195.type, 'optionalAccess', _196 => _196.__file]), () => ( _optionalChain([vue2Owner, 'call', _197 => _197(el), 'optionalAccess', _198 => _198.$options, 'optionalAccess', _199 => _199.__file])));
|
|
4844
4893
|
return file ? { filePath: relativizePath(file), line: null, column: null } : NO_SOURCE;
|
|
4845
4894
|
}
|
|
4846
4895
|
var vueAdapter = {
|
|
@@ -4856,19 +4905,19 @@ function metaOf(el) {
|
|
|
4856
4905
|
let current = el;
|
|
4857
4906
|
while (current) {
|
|
4858
4907
|
const meta = current.__svelte_meta;
|
|
4859
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
4908
|
+
if (_optionalChain([meta, 'optionalAccess', _200 => _200.loc])) return { meta, el: current };
|
|
4860
4909
|
current = current.parentElement;
|
|
4861
4910
|
}
|
|
4862
4911
|
return null;
|
|
4863
4912
|
}
|
|
4864
4913
|
function lineOf(meta) {
|
|
4865
|
-
const line = _optionalChain([meta, 'access',
|
|
4914
|
+
const line = _optionalChain([meta, 'access', _201 => _201.loc, 'optionalAccess', _202 => _202.line]);
|
|
4866
4915
|
if (typeof line !== "number") return null;
|
|
4867
4916
|
return "parent" in meta ? line : line + 1;
|
|
4868
4917
|
}
|
|
4869
4918
|
function resolveSvelteComponent(el) {
|
|
4870
4919
|
const found = metaOf(el);
|
|
4871
|
-
if (!_optionalChain([found, 'optionalAccess',
|
|
4920
|
+
if (!_optionalChain([found, 'optionalAccess', _203 => _203.meta, 'access', _204 => _204.loc, 'optionalAccess', _205 => _205.file])) return null;
|
|
4872
4921
|
const { meta } = found;
|
|
4873
4922
|
const own = baseName(meta.loc.file);
|
|
4874
4923
|
const stack = [{ name: own, hostElement: found.el }];
|
|
@@ -4882,9 +4931,9 @@ function resolveSvelteComponent(el) {
|
|
|
4882
4931
|
}
|
|
4883
4932
|
function resolveSvelteSource(el) {
|
|
4884
4933
|
const found = metaOf(el);
|
|
4885
|
-
const file = _optionalChain([found, 'optionalAccess',
|
|
4934
|
+
const file = _optionalChain([found, 'optionalAccess', _206 => _206.meta, 'access', _207 => _207.loc, 'optionalAccess', _208 => _208.file]);
|
|
4886
4935
|
if (!found || !file) return NO_SOURCE;
|
|
4887
|
-
const column = _optionalChain([found, 'access',
|
|
4936
|
+
const column = _optionalChain([found, 'access', _209 => _209.meta, 'access', _210 => _210.loc, 'optionalAccess', _211 => _211.column]);
|
|
4888
4937
|
return {
|
|
4889
4938
|
filePath: relativizePath(file),
|
|
4890
4939
|
line: lineOf(found.meta),
|
|
@@ -4904,10 +4953,10 @@ var domAdapter = {
|
|
|
4904
4953
|
name: "HTML",
|
|
4905
4954
|
resolveComponent: (el) => {
|
|
4906
4955
|
const host2 = el.closest("[data-component]");
|
|
4907
|
-
const name = _optionalChain([host2, 'optionalAccess',
|
|
4956
|
+
const name = _optionalChain([host2, 'optionalAccess', _212 => _212.getAttribute, 'call', _213 => _213("data-component")]);
|
|
4908
4957
|
if (!host2 || !name) return null;
|
|
4909
4958
|
const stack = [];
|
|
4910
|
-
for (let h2 = host2; h2; h2 = _nullishCoalesce(_optionalChain([h2, 'access',
|
|
4959
|
+
for (let h2 = host2; h2; h2 = _nullishCoalesce(_optionalChain([h2, 'access', _214 => _214.parentElement, 'optionalAccess', _215 => _215.closest, 'call', _216 => _216("[data-component]")]), () => ( null))) {
|
|
4911
4960
|
const n = h2.getAttribute("data-component");
|
|
4912
4961
|
if (n) stack.push({ name: n, hostElement: h2 });
|
|
4913
4962
|
if (stack.length >= 12) break;
|
|
@@ -4929,7 +4978,7 @@ function composeAdapters(adapters = DEFAULT_ADAPTERS) {
|
|
|
4929
4978
|
for (const adapter of adapters) {
|
|
4930
4979
|
try {
|
|
4931
4980
|
const result = adapter.resolveComponent(el);
|
|
4932
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
4981
|
+
if (_optionalChain([result, 'optionalAccess', _217 => _217.name])) return { adapter, result };
|
|
4933
4982
|
} catch (e30) {
|
|
4934
4983
|
}
|
|
4935
4984
|
}
|
|
@@ -4937,7 +4986,7 @@ function composeAdapters(adapters = DEFAULT_ADAPTERS) {
|
|
|
4937
4986
|
}
|
|
4938
4987
|
return {
|
|
4939
4988
|
resolveComponent(el) {
|
|
4940
|
-
return _nullishCoalesce(_optionalChain([owner, 'call',
|
|
4989
|
+
return _nullishCoalesce(_optionalChain([owner, 'call', _218 => _218(el), 'optionalAccess', _219 => _219.result]), () => ( null));
|
|
4941
4990
|
},
|
|
4942
4991
|
resolveSource(el) {
|
|
4943
4992
|
const stamped = resolveSource3(el);
|
|
@@ -4946,15 +4995,15 @@ function composeAdapters(adapters = DEFAULT_ADAPTERS) {
|
|
|
4946
4995
|
const ordered = found ? [found.adapter, ...adapters.filter((a) => a !== found.adapter)] : adapters;
|
|
4947
4996
|
for (const adapter of ordered) {
|
|
4948
4997
|
try {
|
|
4949
|
-
const src = _optionalChain([adapter, 'access',
|
|
4950
|
-
if (_optionalChain([src, 'optionalAccess',
|
|
4998
|
+
const src = _optionalChain([adapter, 'access', _220 => _220.resolveSource, 'optionalCall', _221 => _221(el)]);
|
|
4999
|
+
if (_optionalChain([src, 'optionalAccess', _222 => _222.filePath])) return src;
|
|
4951
5000
|
} catch (e31) {
|
|
4952
5001
|
}
|
|
4953
5002
|
}
|
|
4954
5003
|
return null;
|
|
4955
5004
|
},
|
|
4956
5005
|
frameworkFor(el) {
|
|
4957
|
-
return _nullishCoalesce(_optionalChain([owner, 'call',
|
|
5006
|
+
return _nullishCoalesce(_optionalChain([owner, 'call', _223 => _223(el), 'optionalAccess', _224 => _224.adapter, 'access', _225 => _225.name]), () => ( "HTML"));
|
|
4958
5007
|
},
|
|
4959
5008
|
cleanClasses(classes) {
|
|
4960
5009
|
return adapters.reduce((list, a) => a.cleanClasses ? a.cleanClasses(list) : list, classes);
|
|
@@ -4986,7 +5035,7 @@ function getDefaultOptions() {
|
|
|
4986
5035
|
};
|
|
4987
5036
|
}
|
|
4988
5037
|
function init(options) {
|
|
4989
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5038
|
+
if (_optionalChain([options, 'optionalAccess', _226 => _226.mode]) === "live" && !_chunk6CBIOKZVcjs.consumeFeedbackLink.call(void 0, options.projectKey)) {
|
|
4990
5039
|
return createDormantApi(options);
|
|
4991
5040
|
}
|
|
4992
5041
|
return createGrabInstance(options);
|
|
@@ -5012,7 +5061,7 @@ function createDormantApi(options) {
|
|
|
5012
5061
|
real.show();
|
|
5013
5062
|
return;
|
|
5014
5063
|
}
|
|
5015
|
-
_optionalChain([flusher, 'optionalAccess',
|
|
5064
|
+
_optionalChain([flusher, 'optionalAccess', _227 => _227.dispose, 'call', _228 => _228()]);
|
|
5016
5065
|
_chunk6CBIOKZVcjs.startFeedbackSession.call(void 0, );
|
|
5017
5066
|
real = createGrabInstance(options);
|
|
5018
5067
|
for (const fn of queued.splice(0)) fn(real);
|
|
@@ -5191,9 +5240,9 @@ function createGrabInstance(options) {
|
|
|
5191
5240
|
function toastDetail(c) {
|
|
5192
5241
|
return {
|
|
5193
5242
|
componentName: c.target.component,
|
|
5194
|
-
filePath: _nullishCoalesce(_optionalChain([c, 'access',
|
|
5195
|
-
line: _nullishCoalesce(_optionalChain([c, 'access',
|
|
5196
|
-
column: _nullishCoalesce(_optionalChain([c, 'access',
|
|
5243
|
+
filePath: _nullishCoalesce(_optionalChain([c, 'access', _229 => _229.target, 'access', _230 => _230.source, 'optionalAccess', _231 => _231.file]), () => ( null)),
|
|
5244
|
+
line: _nullishCoalesce(_optionalChain([c, 'access', _232 => _232.target, 'access', _233 => _233.source, 'optionalAccess', _234 => _234.line]), () => ( null)),
|
|
5245
|
+
column: _nullishCoalesce(_optionalChain([c, 'access', _235 => _235.target, 'access', _236 => _236.source, 'optionalAccess', _237 => _237.column]), () => ( null))
|
|
5197
5246
|
};
|
|
5198
5247
|
}
|
|
5199
5248
|
function saveComment(element, text, shot, pin) {
|
|
@@ -5219,7 +5268,7 @@ function createGrabInstance(options) {
|
|
|
5219
5268
|
commentedElements.set(comment.id, element);
|
|
5220
5269
|
setComments([comment, ...comments()].slice(0, MAX_COMMENTS));
|
|
5221
5270
|
pluginRegistry.callHook("onComment", comment, element);
|
|
5222
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5271
|
+
_optionalChain([outbox, 'optionalAccess', _238 => _238.send, 'call', _239 => _239(comment.id)]);
|
|
5223
5272
|
if (shot) void attachScreenshot(comment.id, shot);
|
|
5224
5273
|
const count = comments().length;
|
|
5225
5274
|
if (live) {
|
|
@@ -5254,7 +5303,7 @@ function createGrabInstance(options) {
|
|
|
5254
5303
|
const updated = { ...current, screenshot: { localId: id, width: result.width, height: result.height } };
|
|
5255
5304
|
setComments(comments().map((c) => c.id === id ? updated : c));
|
|
5256
5305
|
pluginRegistry.callHook("onScreenshot", updated, result.blob);
|
|
5257
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5306
|
+
_optionalChain([outbox, 'optionalAccess', _240 => _240.sendScreenshot, 'call', _241 => _241(id)]);
|
|
5258
5307
|
}
|
|
5259
5308
|
function removeComments(ids, message, withdraw = false) {
|
|
5260
5309
|
if (ids.length === 0) return;
|
|
@@ -5266,7 +5315,7 @@ function createGrabInstance(options) {
|
|
|
5266
5315
|
const withdrawn = withdraw && outbox ? removed.filter((c) => c.sync !== void 0) : [];
|
|
5267
5316
|
const hadQueued = new Set(withdrawn.filter((c) => outbox.isQueued(c.id)).map((c) => c.id));
|
|
5268
5317
|
for (const c of withdrawn) outbox.remove(c.id, c.author.sessionId, message ? UNDO_MS + 500 : 0);
|
|
5269
|
-
const shotIds = removed.flatMap((c) => _optionalChain([c, 'access',
|
|
5318
|
+
const shotIds = removed.flatMap((c) => _optionalChain([c, 'access', _242 => _242.screenshot, 'optionalAccess', _243 => _243.localId]) ? [c.screenshot.localId] : []);
|
|
5270
5319
|
const key = randomId();
|
|
5271
5320
|
pendingShotDeletes.set(key, setTimeout(() => {
|
|
5272
5321
|
pendingShotDeletes.delete(key);
|
|
@@ -5285,7 +5334,7 @@ function createGrabInstance(options) {
|
|
|
5285
5334
|
const back = removed.filter((c) => !present.has(c.id)).map((c) => resend.has(c.id) ? { ...c, sync: "pending" } : c);
|
|
5286
5335
|
const restored = [...back, ...comments()].sort((a, b) => b.createdAt - a.createdAt);
|
|
5287
5336
|
setComments(restored);
|
|
5288
|
-
for (const id of resend) _optionalChain([outbox, 'optionalAccess',
|
|
5337
|
+
for (const id of resend) _optionalChain([outbox, 'optionalAccess', _244 => _244.send, 'call', _245 => _245(id)]);
|
|
5289
5338
|
showToast(`Restored ${removed.length} comment${removed.length === 1 ? "" : "s"}`);
|
|
5290
5339
|
}
|
|
5291
5340
|
}]
|
|
@@ -5388,7 +5437,7 @@ function createGrabInstance(options) {
|
|
|
5388
5437
|
currentRoute: () => sanitizeRoute(location, store.state.options.captureQueryParams),
|
|
5389
5438
|
findElement(comment) {
|
|
5390
5439
|
const known = commentedElements.get(comment.id);
|
|
5391
|
-
if (_optionalChain([known, 'optionalAccess',
|
|
5440
|
+
if (_optionalChain([known, 'optionalAccess', _246 => _246.isConnected])) return known;
|
|
5392
5441
|
return safeQuery(comment.target.selector);
|
|
5393
5442
|
},
|
|
5394
5443
|
onHover(comment, element) {
|
|
@@ -5557,7 +5606,7 @@ function createGrabInstance(options) {
|
|
|
5557
5606
|
});
|
|
5558
5607
|
const finishSheet = createFinishSheet({
|
|
5559
5608
|
onDone() {
|
|
5560
|
-
const done = comments().filter((c) => c.sync === "sent" && !_optionalChain([outbox, 'optionalAccess',
|
|
5609
|
+
const done = comments().filter((c) => c.sync === "sent" && !_optionalChain([outbox, 'optionalAccess', _247 => _247.isQueued, 'call', _248 => _248(c.id)])).map((c) => c.id);
|
|
5561
5610
|
if (!comments().length) {
|
|
5562
5611
|
exitFeedbackMode();
|
|
5563
5612
|
return;
|
|
@@ -5571,9 +5620,9 @@ function createGrabInstance(options) {
|
|
|
5571
5620
|
if (failed.length) {
|
|
5572
5621
|
const ids = new Set(failed.map((c) => c.id));
|
|
5573
5622
|
setComments(comments().map((c) => ids.has(c.id) ? { ...c, sync: "pending" } : c));
|
|
5574
|
-
for (const id of ids) _optionalChain([outbox, 'optionalAccess',
|
|
5623
|
+
for (const id of ids) _optionalChain([outbox, 'optionalAccess', _249 => _249.send, 'call', _250 => _250(id)]);
|
|
5575
5624
|
}
|
|
5576
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5625
|
+
_optionalChain([outbox, 'optionalAccess', _251 => _251.flush, 'call', _252 => _252()]);
|
|
5577
5626
|
}
|
|
5578
5627
|
});
|
|
5579
5628
|
const commentPopover = createCommentPopover({
|
|
@@ -5595,7 +5644,7 @@ function createGrabInstance(options) {
|
|
|
5595
5644
|
(c) => c.id === ctx.entryId ? { ...c, comment: value, updatedAt: Date.now(), ...outbox ? { sync: "pending" } : {} } : c
|
|
5596
5645
|
);
|
|
5597
5646
|
setComments(updated);
|
|
5598
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5647
|
+
_optionalChain([outbox, 'optionalAccess', _253 => _253.send, 'call', _254 => _254(ctx.entryId)]);
|
|
5599
5648
|
showToast("Comment updated");
|
|
5600
5649
|
if (editingFromMarker) endMarkerEdit();
|
|
5601
5650
|
else commentsPanel.show([...updated]);
|
|
@@ -5627,7 +5676,7 @@ function createGrabInstance(options) {
|
|
|
5627
5676
|
document.addEventListener("click", handleDocumentClick);
|
|
5628
5677
|
function handlePageHide() {
|
|
5629
5678
|
flushPendingWrite();
|
|
5630
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5679
|
+
_optionalChain([outbox, 'optionalAccess', _255 => _255.flushOnExit, 'call', _256 => _256()]);
|
|
5631
5680
|
}
|
|
5632
5681
|
function handleVisibilityChange() {
|
|
5633
5682
|
if (document.visibilityState === "hidden") flushPendingWrite();
|
|
@@ -5780,7 +5829,7 @@ function createGrabInstance(options) {
|
|
|
5780
5829
|
copySheet.dispose();
|
|
5781
5830
|
finishSheet.dispose();
|
|
5782
5831
|
coachMark.dispose();
|
|
5783
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5832
|
+
_optionalChain([outbox, 'optionalAccess', _257 => _257.dispose, 'call', _258 => _258()]);
|
|
5784
5833
|
themeManager.dispose();
|
|
5785
5834
|
disposeStyleBaseline();
|
|
5786
5835
|
disposeScreenshotSandbox();
|