@githumbi/grabby 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/angular/index.js +138 -23
- package/dist/angular/index.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/core/index.cjs +230 -115
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +138 -23
- package/dist/core/index.js.map +1 -1
- package/dist/grabby.global.js +98 -80
- package/dist/react/index.js +138 -23
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.cjs
CHANGED
|
@@ -679,6 +679,7 @@ function createCrosshair() {
|
|
|
679
679
|
let hLine = null;
|
|
680
680
|
let vLine = null;
|
|
681
681
|
let listening = false;
|
|
682
|
+
let held = false;
|
|
682
683
|
function injectStyles2() {
|
|
683
684
|
if (hasStyles(CROSSHAIR_STYLE_ID)) return;
|
|
684
685
|
addStyles(CROSSHAIR_STYLE_ID, `
|
|
@@ -701,7 +702,7 @@ function createCrosshair() {
|
|
|
701
702
|
width: 1px;
|
|
702
703
|
}
|
|
703
704
|
`);
|
|
704
|
-
addStyles(CURSOR_STYLE_ID, "body.grabby-crosshair-active { cursor: crosshair !important; }", "document");
|
|
705
|
+
addStyles(CURSOR_STYLE_ID, "body.grabby-crosshair-active:not(.grabby-crosshair-held) { cursor: crosshair !important; }", "document");
|
|
705
706
|
}
|
|
706
707
|
function ensureElements() {
|
|
707
708
|
if (!hLine) {
|
|
@@ -718,7 +719,12 @@ function createCrosshair() {
|
|
|
718
719
|
getUiRoot().appendChild(vLine);
|
|
719
720
|
}
|
|
720
721
|
}
|
|
722
|
+
function hideLines() {
|
|
723
|
+
if (hLine) hLine.style.top = "-10px";
|
|
724
|
+
if (vLine) vLine.style.left = "-10px";
|
|
725
|
+
}
|
|
721
726
|
function handleMouseMove(e) {
|
|
727
|
+
if (held) return;
|
|
722
728
|
if (hLine) {
|
|
723
729
|
hLine.style.top = `${e.clientY}px`;
|
|
724
730
|
}
|
|
@@ -739,13 +745,19 @@ function createCrosshair() {
|
|
|
739
745
|
listening = false;
|
|
740
746
|
document.body.classList.remove("grabby-crosshair-active");
|
|
741
747
|
document.removeEventListener("mousemove", handleMouseMove, true);
|
|
742
|
-
|
|
743
|
-
|
|
748
|
+
hideLines();
|
|
749
|
+
},
|
|
750
|
+
hold(on) {
|
|
751
|
+
if (held === on) return;
|
|
752
|
+
held = on;
|
|
753
|
+
document.body.classList.toggle("grabby-crosshair-held", on);
|
|
754
|
+
if (on) hideLines();
|
|
744
755
|
},
|
|
745
756
|
isCrosshairElement(el) {
|
|
746
757
|
return el === hLine || el === vLine || el.id === H_LINE_ID || el.id === V_LINE_ID;
|
|
747
758
|
},
|
|
748
759
|
dispose() {
|
|
760
|
+
this.hold(false);
|
|
749
761
|
this.deactivate();
|
|
750
762
|
_optionalChain([hLine, 'optionalAccess', _17 => _17.remove, 'call', _18 => _18()]);
|
|
751
763
|
_optionalChain([vLine, 'optionalAccess', _19 => _19.remove, 'call', _20 => _20()]);
|
|
@@ -1148,6 +1160,7 @@ function buildUniqueSelector(el) {
|
|
|
1148
1160
|
// src/core/picker/element-picker.ts
|
|
1149
1161
|
function createElementPicker(deps) {
|
|
1150
1162
|
let hoveredElement = null;
|
|
1163
|
+
let heldElement = null;
|
|
1151
1164
|
let listening = false;
|
|
1152
1165
|
function resolveComponentName(el) {
|
|
1153
1166
|
const resolver = deps.getComponentResolver();
|
|
@@ -1178,17 +1191,21 @@ function createElementPicker(deps) {
|
|
|
1178
1191
|
if (!raw || raw.closest(`[${IGNORE_ATTR}]`)) return raw && _optionalChain([deps, 'access', _33 => _33.isToolbarElement, 'optionalCall', _34 => _34(raw)]) ? raw : null;
|
|
1179
1192
|
return exact ? raw : promoteTarget(raw);
|
|
1180
1193
|
}
|
|
1194
|
+
function showOverlay(target) {
|
|
1195
|
+
const componentName = resolveComponentName(target);
|
|
1196
|
+
const sourcePath = resolveSourcePath(target);
|
|
1197
|
+
const cssClasses = filterAngularClasses(target.classList);
|
|
1198
|
+
deps.overlay.show(target, componentName, sourcePath, cssClasses);
|
|
1199
|
+
}
|
|
1181
1200
|
function handleMouseMove(e) {
|
|
1201
|
+
if (heldElement) return;
|
|
1182
1202
|
const target = elementAtPoint(e.clientX, e.clientY, e.shiftKey);
|
|
1183
1203
|
if (!target || deps.overlay.isOverlayElement(target)) return;
|
|
1184
1204
|
if (deps.crosshair.isCrosshairElement(target)) return;
|
|
1185
1205
|
if (_optionalChain([deps, 'access', _35 => _35.isToolbarElement, 'optionalCall', _36 => _36(target)])) return;
|
|
1186
1206
|
if (target === hoveredElement) return;
|
|
1187
1207
|
hoveredElement = target;
|
|
1188
|
-
|
|
1189
|
-
const sourcePath = resolveSourcePath(target);
|
|
1190
|
-
const cssClasses = filterAngularClasses(target.classList);
|
|
1191
|
-
deps.overlay.show(target, componentName, sourcePath, cssClasses);
|
|
1208
|
+
showOverlay(target);
|
|
1192
1209
|
deps.onHover(target);
|
|
1193
1210
|
}
|
|
1194
1211
|
function handleClick(e) {
|
|
@@ -1198,6 +1215,7 @@ function createElementPicker(deps) {
|
|
|
1198
1215
|
if (target && (_optionalChain([deps, 'access', _39 => _39.isToolbarElement, 'optionalCall', _40 => _40(target)]) || deps.crosshair.isCrosshairElement(target))) return;
|
|
1199
1216
|
e.preventDefault();
|
|
1200
1217
|
e.stopPropagation();
|
|
1218
|
+
if (heldElement) return;
|
|
1201
1219
|
if (hoveredElement) {
|
|
1202
1220
|
deps.onSelect(hoveredElement);
|
|
1203
1221
|
}
|
|
@@ -1214,12 +1232,29 @@ function createElementPicker(deps) {
|
|
|
1214
1232
|
if (!listening) return;
|
|
1215
1233
|
listening = false;
|
|
1216
1234
|
hoveredElement = null;
|
|
1235
|
+
heldElement = null;
|
|
1236
|
+
deps.crosshair.hold(false);
|
|
1217
1237
|
deps.crosshair.deactivate();
|
|
1218
1238
|
document.removeEventListener("mousemove", handleMouseMove, true);
|
|
1219
1239
|
document.removeEventListener("click", handleClick, true);
|
|
1220
1240
|
deps.overlay.hide();
|
|
1221
1241
|
deps.onHover(null);
|
|
1222
1242
|
},
|
|
1243
|
+
hold(element) {
|
|
1244
|
+
if (!listening) return;
|
|
1245
|
+
heldElement = element;
|
|
1246
|
+
hoveredElement = element;
|
|
1247
|
+
deps.crosshair.hold(true);
|
|
1248
|
+
showOverlay(element);
|
|
1249
|
+
},
|
|
1250
|
+
release() {
|
|
1251
|
+
if (!heldElement) return;
|
|
1252
|
+
heldElement = null;
|
|
1253
|
+
deps.crosshair.hold(false);
|
|
1254
|
+
},
|
|
1255
|
+
isHolding() {
|
|
1256
|
+
return heldElement !== null;
|
|
1257
|
+
},
|
|
1223
1258
|
getHoveredElement() {
|
|
1224
1259
|
return hoveredElement;
|
|
1225
1260
|
},
|
|
@@ -1552,6 +1587,8 @@ function createToolbarRenderer(callbacks, options = {}) {
|
|
|
1552
1587
|
let allElements = /* @__PURE__ */ new Set();
|
|
1553
1588
|
let badge = null;
|
|
1554
1589
|
let status = null;
|
|
1590
|
+
let expandBadge = null;
|
|
1591
|
+
let collapsed = false;
|
|
1555
1592
|
function injectStyles2() {
|
|
1556
1593
|
if (hasStyles(STYLE_ID3)) return;
|
|
1557
1594
|
addStyles(STYLE_ID3, `
|
|
@@ -1667,6 +1704,24 @@ function createToolbarRenderer(callbacks, options = {}) {
|
|
|
1667
1704
|
background: var(--grabby-accent-hover, #1d4ed8);
|
|
1668
1705
|
color: #fff;
|
|
1669
1706
|
}
|
|
1707
|
+
#${TOOLBAR_ID} button.grabby-btn-expand { display: none; }
|
|
1708
|
+
#${TOOLBAR_ID}.grabby-toolbar-collapsed {
|
|
1709
|
+
left: auto;
|
|
1710
|
+
right: 20px;
|
|
1711
|
+
transform: none;
|
|
1712
|
+
padding: 4px;
|
|
1713
|
+
}
|
|
1714
|
+
#${TOOLBAR_ID}.grabby-toolbar-collapsed.grabby-toolbar-hidden {
|
|
1715
|
+
transform: translateY(20px);
|
|
1716
|
+
}
|
|
1717
|
+
#${TOOLBAR_ID}.grabby-toolbar-collapsed > * { display: none !important; }
|
|
1718
|
+
#${TOOLBAR_ID}.grabby-toolbar-collapsed > button.grabby-btn-expand {
|
|
1719
|
+
display: flex !important;
|
|
1720
|
+
width: 40px;
|
|
1721
|
+
height: 40px;
|
|
1722
|
+
border-radius: 50%;
|
|
1723
|
+
color: var(--grabby-accent, #2563eb);
|
|
1724
|
+
}
|
|
1670
1725
|
#${TOOLBAR_ID} .grabby-toolbar-left.grabby-toolbar-left-hidden {
|
|
1671
1726
|
max-width: 0;
|
|
1672
1727
|
opacity: 0;
|
|
@@ -1707,6 +1762,12 @@ function createToolbarRenderer(callbacks, options = {}) {
|
|
|
1707
1762
|
buttons.history.appendChild(badge);
|
|
1708
1763
|
buttons.enable = createButton("enable", ICON_POWER, "Enable/Disable", callbacks.onEnableToggle);
|
|
1709
1764
|
buttons.dismiss = createButton("dismiss", ICON_DISMISS, _nullishCoalesce(options.dismissLabel, () => ( "Dismiss toolbar")), callbacks.onDismiss);
|
|
1765
|
+
buttons.expand = createButton("expand", ICON_GRAB, _nullishCoalesce(options.expandLabel, () => ( "Open Grabby toolbar")), () => _optionalChain([callbacks, 'access', _45 => _45.onExpand, 'optionalCall', _46 => _46()]));
|
|
1766
|
+
buttons.expand.classList.add("grabby-btn-expand");
|
|
1767
|
+
expandBadge = document.createElement("span");
|
|
1768
|
+
expandBadge.className = "grabby-badge";
|
|
1769
|
+
expandBadge.hidden = true;
|
|
1770
|
+
buttons.expand.appendChild(expandBadge);
|
|
1710
1771
|
const divider = document.createElement("span");
|
|
1711
1772
|
divider.className = "grabby-toolbar-divider";
|
|
1712
1773
|
leftGroup = document.createElement("div");
|
|
@@ -1729,7 +1790,7 @@ function createToolbarRenderer(callbacks, options = {}) {
|
|
|
1729
1790
|
buttons.finish.addEventListener("click", (e) => {
|
|
1730
1791
|
e.preventDefault();
|
|
1731
1792
|
e.stopPropagation();
|
|
1732
|
-
_optionalChain([callbacks, 'access',
|
|
1793
|
+
_optionalChain([callbacks, 'access', _47 => _47.onFinish, 'optionalCall', _48 => _48()]);
|
|
1733
1794
|
});
|
|
1734
1795
|
container.appendChild(status);
|
|
1735
1796
|
container.appendChild(buttons.finish);
|
|
@@ -1737,6 +1798,8 @@ function createToolbarRenderer(callbacks, options = {}) {
|
|
|
1737
1798
|
}
|
|
1738
1799
|
if (!options.hideEnable) container.appendChild(buttons.enable);
|
|
1739
1800
|
container.appendChild(buttons.dismiss);
|
|
1801
|
+
container.appendChild(buttons.expand);
|
|
1802
|
+
container.classList.toggle("grabby-toolbar-collapsed", collapsed);
|
|
1740
1803
|
getUiRoot().appendChild(container);
|
|
1741
1804
|
allElements.clear();
|
|
1742
1805
|
allElements.add(container);
|
|
@@ -1764,26 +1827,38 @@ function createToolbarRenderer(callbacks, options = {}) {
|
|
|
1764
1827
|
buttons.selection.classList.remove("grabby-btn-active");
|
|
1765
1828
|
}
|
|
1766
1829
|
const count = state.toolbar.comments.length;
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1830
|
+
for (const b of [badge, expandBadge]) {
|
|
1831
|
+
if (!b) continue;
|
|
1832
|
+
b.hidden = count === 0;
|
|
1833
|
+
b.textContent = count > 99 ? "99+" : String(count);
|
|
1770
1834
|
}
|
|
1771
1835
|
buttons.history.setAttribute("aria-label", count ? `Comments (${count})` : "Comments");
|
|
1772
1836
|
if (status && buttons.finish) {
|
|
1773
1837
|
const summary = syncSummary(state.toolbar.comments);
|
|
1774
1838
|
status.hidden = !summary;
|
|
1775
|
-
status.textContent = _nullishCoalesce(_optionalChain([summary, 'optionalAccess',
|
|
1776
|
-
status.dataset.tone = _nullishCoalesce(_optionalChain([summary, 'optionalAccess',
|
|
1839
|
+
status.textContent = _nullishCoalesce(_optionalChain([summary, 'optionalAccess', _49 => _49.text]), () => ( ""));
|
|
1840
|
+
status.dataset.tone = _nullishCoalesce(_optionalChain([summary, 'optionalAccess', _50 => _50.tone]), () => ( ""));
|
|
1777
1841
|
buttons.finish.hidden = count === 0;
|
|
1778
1842
|
}
|
|
1779
1843
|
if (state.options.enabled) {
|
|
1780
1844
|
buttons.enable.classList.add("grabby-btn-active");
|
|
1781
|
-
_optionalChain([leftGroup, 'optionalAccess',
|
|
1845
|
+
_optionalChain([leftGroup, 'optionalAccess', _51 => _51.classList, 'access', _52 => _52.remove, 'call', _53 => _53("grabby-toolbar-left-hidden")]);
|
|
1782
1846
|
} else {
|
|
1783
1847
|
buttons.enable.classList.remove("grabby-btn-active");
|
|
1784
|
-
_optionalChain([leftGroup, 'optionalAccess',
|
|
1848
|
+
_optionalChain([leftGroup, 'optionalAccess', _54 => _54.classList, 'access', _55 => _55.add, 'call', _56 => _56("grabby-toolbar-left-hidden")]);
|
|
1785
1849
|
}
|
|
1786
1850
|
},
|
|
1851
|
+
collapse() {
|
|
1852
|
+
collapsed = true;
|
|
1853
|
+
_optionalChain([container, 'optionalAccess', _57 => _57.classList, 'access', _58 => _58.add, 'call', _59 => _59("grabby-toolbar-collapsed")]);
|
|
1854
|
+
},
|
|
1855
|
+
expand() {
|
|
1856
|
+
collapsed = false;
|
|
1857
|
+
_optionalChain([container, 'optionalAccess', _60 => _60.classList, 'access', _61 => _61.remove, 'call', _62 => _62("grabby-toolbar-collapsed")]);
|
|
1858
|
+
},
|
|
1859
|
+
isCollapsed() {
|
|
1860
|
+
return collapsed;
|
|
1861
|
+
},
|
|
1787
1862
|
isToolbarElement(el) {
|
|
1788
1863
|
if (allElements.has(el)) return true;
|
|
1789
1864
|
let current = el;
|
|
@@ -1795,12 +1870,13 @@ function createToolbarRenderer(callbacks, options = {}) {
|
|
|
1795
1870
|
return false;
|
|
1796
1871
|
},
|
|
1797
1872
|
dispose() {
|
|
1798
|
-
_optionalChain([container, 'optionalAccess',
|
|
1873
|
+
_optionalChain([container, 'optionalAccess', _63 => _63.remove, 'call', _64 => _64()]);
|
|
1799
1874
|
removeStyles(STYLE_ID3);
|
|
1800
1875
|
container = null;
|
|
1801
1876
|
leftGroup = null;
|
|
1802
1877
|
buttons = {};
|
|
1803
1878
|
badge = null;
|
|
1879
|
+
expandBadge = null;
|
|
1804
1880
|
status = null;
|
|
1805
1881
|
allElements.clear();
|
|
1806
1882
|
}
|
|
@@ -1845,7 +1921,7 @@ function header(comments, env, ctx) {
|
|
|
1845
1921
|
if (frameworks.length) meta.push(frameworks.join(", "));
|
|
1846
1922
|
const routes = uniq(comments.map((c) => c.page.route));
|
|
1847
1923
|
if (!ctx.showRoutes && routes.length === 1) meta.push(`page ${routes[0]}`);
|
|
1848
|
-
const vp = _optionalChain([comments, 'access',
|
|
1924
|
+
const vp = _optionalChain([comments, 'access', _65 => _65[0], 'optionalAccess', _66 => _66.page, 'access', _67 => _67.viewport]);
|
|
1849
1925
|
if (vp) meta.push(`${vp[0]}\xD7${vp[1]}`);
|
|
1850
1926
|
meta.push((_nullishCoalesce(env.now, () => ( /* @__PURE__ */ new Date()))).toISOString().slice(0, 10));
|
|
1851
1927
|
lines.push(meta.join(" \xB7 "));
|
|
@@ -1871,8 +1947,8 @@ function detailBlock(c, i, ctx, groupHasSource, headedComponent) {
|
|
|
1871
1947
|
const b = (text) => lines.push(` - ${text}`);
|
|
1872
1948
|
const where = [`\`${t.preview}\``, `(${t.kind})`];
|
|
1873
1949
|
if (t.component && t.component !== headedComponent) {
|
|
1874
|
-
where.push(_optionalChain([t, 'access',
|
|
1875
|
-
} else if (_optionalChain([t, 'access',
|
|
1950
|
+
where.push(_optionalChain([t, 'access', _68 => _68.source, 'optionalAccess', _69 => _69.line]) != null && groupHasSource ? `${t.component} line ${t.source.line}` : t.component);
|
|
1951
|
+
} else if (_optionalChain([t, 'access', _70 => _70.source, 'optionalAccess', _71 => _71.line]) != null && groupHasSource) {
|
|
1876
1952
|
where.push(`line ${t.source.line}`);
|
|
1877
1953
|
}
|
|
1878
1954
|
b(where.join(" "));
|
|
@@ -1888,7 +1964,7 @@ function detailBlock(c, i, ctx, groupHasSource, headedComponent) {
|
|
|
1888
1964
|
for (const [k, v] of Object.entries(t.extra)) b(`${k}: ${v}`);
|
|
1889
1965
|
b(`viewport: ${c.page.viewport[0]}\xD7${c.page.viewport[1]}`);
|
|
1890
1966
|
}
|
|
1891
|
-
if (_optionalChain([c, 'access',
|
|
1967
|
+
if (_optionalChain([c, 'access', _72 => _72.screenshot, 'optionalAccess', _73 => _73.url])) b(`screenshot: ${c.screenshot.url}`);
|
|
1892
1968
|
const meta = [];
|
|
1893
1969
|
if (ctx.showAuthors) meta.push(`by ${authorLabel(c.author)}`);
|
|
1894
1970
|
if (ctx.showRoutes) meta.push(`on ${c.page.route}`);
|
|
@@ -1914,7 +1990,7 @@ function formatExport(comments, level = "standard", env = {}) {
|
|
|
1914
1990
|
}
|
|
1915
1991
|
const groups = /* @__PURE__ */ new Map();
|
|
1916
1992
|
for (const c of ordered) {
|
|
1917
|
-
const key = _nullishCoalesce(_optionalChain([c, 'access',
|
|
1993
|
+
const key = _nullishCoalesce(_optionalChain([c, 'access', _74 => _74.target, 'access', _75 => _75.source, 'optionalAccess', _76 => _76.file]), () => ( ""));
|
|
1918
1994
|
const list = groups.get(key);
|
|
1919
1995
|
if (list) list.push(c);
|
|
1920
1996
|
else groups.set(key, [c]);
|
|
@@ -1924,7 +2000,7 @@ function formatExport(comments, level = "standard", env = {}) {
|
|
|
1924
2000
|
out.push("");
|
|
1925
2001
|
const components = uniq(list.map((c) => c.target.component));
|
|
1926
2002
|
const headed = file && components.length === 1 ? components[0] : null;
|
|
1927
|
-
const lines = uniq(list.map((c) => _nullishCoalesce(_optionalChain([c, 'access',
|
|
2003
|
+
const lines = uniq(list.map((c) => _nullishCoalesce(_optionalChain([c, 'access', _77 => _77.target, 'access', _78 => _78.source, 'optionalAccess', _79 => _79.line]), () => ( null))));
|
|
1928
2004
|
if (file) {
|
|
1929
2005
|
const loc = lines.length === 1 ? location2(file, lines[0], true) : file;
|
|
1930
2006
|
out.push(`## ${loc}${headed ? ` \xB7 ${headed}` : ""}`);
|
|
@@ -2109,7 +2185,7 @@ function createCommentsPanel(callbacks, options = {}) {
|
|
|
2109
2185
|
let visible = false;
|
|
2110
2186
|
let objectUrls = [];
|
|
2111
2187
|
function ensurePanel() {
|
|
2112
|
-
if (_optionalChain([panel, 'optionalAccess',
|
|
2188
|
+
if (_optionalChain([panel, 'optionalAccess', _80 => _80.isConnected])) return panel;
|
|
2113
2189
|
addStyles(STYLE_ID4, CSS2);
|
|
2114
2190
|
panel = h("div", { id: PANEL_ID, role: "dialog", "aria-label": "Comments" });
|
|
2115
2191
|
getUiRoot().appendChild(panel);
|
|
@@ -2120,7 +2196,7 @@ function createCommentsPanel(callbacks, options = {}) {
|
|
|
2120
2196
|
objectUrls = [];
|
|
2121
2197
|
}
|
|
2122
2198
|
function thumbnail(comment) {
|
|
2123
|
-
const localId = _optionalChain([comment, 'access',
|
|
2199
|
+
const localId = _optionalChain([comment, 'access', _81 => _81.screenshot, 'optionalAccess', _82 => _82.localId]);
|
|
2124
2200
|
if (!localId) return null;
|
|
2125
2201
|
const img = h("img", { class: "grabby-thumb", alt: "", loading: "lazy" });
|
|
2126
2202
|
img.addEventListener("error", () => img.remove(), { once: true });
|
|
@@ -2229,7 +2305,7 @@ function createCommentsPanel(callbacks, options = {}) {
|
|
|
2229
2305
|
h("strong", null, live ? "Nothing sent yet" : "No comments yet"),
|
|
2230
2306
|
live ? "Click Comment, then click the part of the page you want to talk about." : "Click the hand icon (or press Alt+G), then click anything on the page to comment on it."
|
|
2231
2307
|
) : h("div", { class: "grabby-panel-list" }, ...comments.map((c) => row2(c, showAuthors)));
|
|
2232
|
-
const who = _nullishCoalesce(_optionalChain([options, 'access',
|
|
2308
|
+
const who = _nullishCoalesce(_optionalChain([options, 'access', _83 => _83.identityLabel, 'optionalCall', _84 => _84()]), () => ( null));
|
|
2233
2309
|
let footer = null;
|
|
2234
2310
|
if (live && who) {
|
|
2235
2311
|
footer = h(
|
|
@@ -2242,7 +2318,7 @@ function createCommentsPanel(callbacks, options = {}) {
|
|
|
2242
2318
|
"data-grabby-change-identity": "",
|
|
2243
2319
|
onclick: (e) => {
|
|
2244
2320
|
e.stopPropagation();
|
|
2245
|
-
_optionalChain([callbacks, 'access',
|
|
2321
|
+
_optionalChain([callbacks, 'access', _85 => _85.onChangeIdentity, 'optionalCall', _86 => _86()]);
|
|
2246
2322
|
}
|
|
2247
2323
|
}, "Change")
|
|
2248
2324
|
);
|
|
@@ -2276,7 +2352,7 @@ function createCommentsPanel(callbacks, options = {}) {
|
|
|
2276
2352
|
},
|
|
2277
2353
|
hide() {
|
|
2278
2354
|
visible = false;
|
|
2279
|
-
_optionalChain([panel, 'optionalAccess',
|
|
2355
|
+
_optionalChain([panel, 'optionalAccess', _87 => _87.classList, 'access', _88 => _88.remove, 'call', _89 => _89("grabby-popover-visible")]);
|
|
2280
2356
|
},
|
|
2281
2357
|
isVisible() {
|
|
2282
2358
|
return visible;
|
|
@@ -2286,7 +2362,7 @@ function createCommentsPanel(callbacks, options = {}) {
|
|
|
2286
2362
|
},
|
|
2287
2363
|
dispose() {
|
|
2288
2364
|
revokeThumbs();
|
|
2289
|
-
_optionalChain([panel, 'optionalAccess',
|
|
2365
|
+
_optionalChain([panel, 'optionalAccess', _90 => _90.remove, 'call', _91 => _91()]);
|
|
2290
2366
|
removeStyles(STYLE_ID4);
|
|
2291
2367
|
panel = null;
|
|
2292
2368
|
visible = false;
|
|
@@ -2446,7 +2522,7 @@ function createCommentPopover(callbacks) {
|
|
|
2446
2522
|
autocomplete: "name",
|
|
2447
2523
|
"aria-label": "Your name"
|
|
2448
2524
|
});
|
|
2449
|
-
const post = () => finish({ name: _optionalChain([nameInput, 'optionalAccess',
|
|
2525
|
+
const post = () => finish({ name: _optionalChain([nameInput, 'optionalAccess', _92 => _92.value, 'access', _93 => _93.trim, 'call', _94 => _94()]) || null });
|
|
2450
2526
|
popover.replaceChildren(
|
|
2451
2527
|
h("div", { class: "grabby-cp-title" }, "Thanks! Who is this from?"),
|
|
2452
2528
|
h("div", { class: "grabby-cp-sub" }, "Your name helps the team follow up. It's remembered in this browser."),
|
|
@@ -2480,7 +2556,7 @@ function createCommentPopover(callbacks) {
|
|
|
2480
2556
|
} else if (e.key === "Enter" && deepActiveElement() === nameInput) {
|
|
2481
2557
|
e.preventDefault();
|
|
2482
2558
|
e.stopImmediatePropagation();
|
|
2483
|
-
finish({ name: _optionalChain([nameInput, 'optionalAccess',
|
|
2559
|
+
finish({ name: _optionalChain([nameInput, 'optionalAccess', _95 => _95.value, 'access', _96 => _96.trim, 'call', _97 => _97()]) || null });
|
|
2484
2560
|
}
|
|
2485
2561
|
return;
|
|
2486
2562
|
}
|
|
@@ -2515,7 +2591,7 @@ function createCommentPopover(callbacks) {
|
|
|
2515
2591
|
}
|
|
2516
2592
|
function doHide() {
|
|
2517
2593
|
visible = false;
|
|
2518
|
-
_optionalChain([popover, 'optionalAccess',
|
|
2594
|
+
_optionalChain([popover, 'optionalAccess', _98 => _98.remove, 'call', _99 => _99()]);
|
|
2519
2595
|
popover = null;
|
|
2520
2596
|
textarea = null;
|
|
2521
2597
|
nameInput = null;
|
|
@@ -2533,8 +2609,8 @@ function createCommentPopover(callbacks) {
|
|
|
2533
2609
|
visible = true;
|
|
2534
2610
|
position(el, opts.anchor);
|
|
2535
2611
|
attachKey();
|
|
2536
|
-
_optionalChain([textarea, 'optionalAccess',
|
|
2537
|
-
requestAnimationFrame(() => _optionalChain([textarea, 'optionalAccess',
|
|
2612
|
+
_optionalChain([textarea, 'optionalAccess', _100 => _100.focus, 'call', _101 => _101()]);
|
|
2613
|
+
requestAnimationFrame(() => _optionalChain([textarea, 'optionalAccess', _102 => _102.focus, 'call', _103 => _103()]));
|
|
2538
2614
|
},
|
|
2539
2615
|
hide() {
|
|
2540
2616
|
if (!visible) return;
|
|
@@ -2546,7 +2622,7 @@ function createCommentPopover(callbacks) {
|
|
|
2546
2622
|
hasDraft() {
|
|
2547
2623
|
if (!visible) return false;
|
|
2548
2624
|
if (stage === "identity") return true;
|
|
2549
|
-
const v = _nullishCoalesce(_optionalChain([textarea, 'optionalAccess',
|
|
2625
|
+
const v = _nullishCoalesce(_optionalChain([textarea, 'optionalAccess', _104 => _104.value, 'access', _105 => _105.trim, 'call', _106 => _106()]), () => ( ""));
|
|
2550
2626
|
return v !== "" && v !== initialValue.trim();
|
|
2551
2627
|
},
|
|
2552
2628
|
isPopoverElement(el) {
|
|
@@ -2635,7 +2711,7 @@ function createCopySheet(callbacks) {
|
|
|
2635
2711
|
document.removeEventListener("keydown", keyHandler, true);
|
|
2636
2712
|
keyHandler = null;
|
|
2637
2713
|
}
|
|
2638
|
-
_optionalChain([callbacks, 'access',
|
|
2714
|
+
_optionalChain([callbacks, 'access', _107 => _107.onClose, 'optionalCall', _108 => _108()]);
|
|
2639
2715
|
}
|
|
2640
2716
|
function open(options) {
|
|
2641
2717
|
close();
|
|
@@ -2657,12 +2733,12 @@ function createCopySheet(callbacks) {
|
|
|
2657
2733
|
level = next;
|
|
2658
2734
|
edited = false;
|
|
2659
2735
|
textarea.value = options.render(level);
|
|
2660
|
-
hint.textContent = _nullishCoalesce(_optionalChain([LEVELS, 'access',
|
|
2736
|
+
hint.textContent = _nullishCoalesce(_optionalChain([LEVELS, 'access', _109 => _109.find, 'call', _110 => _110((l) => l.id === level), 'optionalAccess', _111 => _111.hint]), () => ( ""));
|
|
2661
2737
|
for (const [id, btn] of segButtons) btn.setAttribute("aria-checked", String(id === level));
|
|
2662
2738
|
status.classList.remove("grabby-error");
|
|
2663
2739
|
status.textContent = discarded ? "Your edits were replaced by the new detail level." : "";
|
|
2664
2740
|
updateTokens();
|
|
2665
|
-
_optionalChain([callbacks, 'access',
|
|
2741
|
+
_optionalChain([callbacks, 'access', _112 => _112.onLevelChange, 'optionalCall', _113 => _113(level)]);
|
|
2666
2742
|
}
|
|
2667
2743
|
const seg = h(
|
|
2668
2744
|
"div",
|
|
@@ -2740,7 +2816,7 @@ function createCopySheet(callbacks) {
|
|
|
2740
2816
|
document.addEventListener("keydown", keyHandler, true);
|
|
2741
2817
|
getUiRoot().appendChild(sheet);
|
|
2742
2818
|
setLevel(level, true);
|
|
2743
|
-
_optionalChain([sheet, 'access',
|
|
2819
|
+
_optionalChain([sheet, 'access', _114 => _114.querySelector, 'call', _115 => _115("[data-grabby-copy-clear]"), 'optionalAccess', _116 => _116.focus, 'call', _117 => _117()]);
|
|
2744
2820
|
}
|
|
2745
2821
|
return {
|
|
2746
2822
|
open,
|
|
@@ -2888,7 +2964,7 @@ function createFinishSheet(callbacks) {
|
|
|
2888
2964
|
...note ? [h("div", { class: "grabby-finish-note" }, note)] : [],
|
|
2889
2965
|
h("div", { class: "grabby-finish-actions" }, ...actions)
|
|
2890
2966
|
);
|
|
2891
|
-
_optionalChain([sheet, 'access',
|
|
2967
|
+
_optionalChain([sheet, 'access', _118 => _118.querySelector, 'call', _119 => _119(".grabby-btn-primary:not([disabled])"), 'optionalAccess', _120 => _120.focus, 'call', _121 => _121()]);
|
|
2892
2968
|
}
|
|
2893
2969
|
return {
|
|
2894
2970
|
open(next) {
|
|
@@ -2972,7 +3048,7 @@ function createCoachMark() {
|
|
|
2972
3048
|
let el = null;
|
|
2973
3049
|
function dismiss() {
|
|
2974
3050
|
markSeen();
|
|
2975
|
-
_optionalChain([el, 'optionalAccess',
|
|
3051
|
+
_optionalChain([el, 'optionalAccess', _122 => _122.remove, 'call', _123 => _123()]);
|
|
2976
3052
|
el = null;
|
|
2977
3053
|
}
|
|
2978
3054
|
return {
|
|
@@ -3004,7 +3080,7 @@ function createCoachMark() {
|
|
|
3004
3080
|
},
|
|
3005
3081
|
dismiss,
|
|
3006
3082
|
dispose() {
|
|
3007
|
-
_optionalChain([el, 'optionalAccess',
|
|
3083
|
+
_optionalChain([el, 'optionalAccess', _124 => _124.remove, 'call', _125 => _125()]);
|
|
3008
3084
|
el = null;
|
|
3009
3085
|
removeStyles(STYLE_ID8);
|
|
3010
3086
|
}
|
|
@@ -3098,14 +3174,14 @@ function createOutbox(deps) {
|
|
|
3098
3174
|
if (job.kind === "comment") {
|
|
3099
3175
|
const res2 = await postComment(comment);
|
|
3100
3176
|
if (res2.ok) {
|
|
3101
|
-
if (_optionalChain([deps, 'access',
|
|
3177
|
+
if (_optionalChain([deps, 'access', _126 => _126.getComment, 'call', _127 => _127(job.id), 'optionalAccess', _128 => _128.screenshot, 'optionalAccess', _129 => _129.localId])) add(job.id, "shot");
|
|
3102
3178
|
return "done";
|
|
3103
3179
|
}
|
|
3104
3180
|
if (res2.status === 429 || res2.status >= 500) return "retry";
|
|
3105
3181
|
deps.onState(job.id, "failed", await res2.text().catch(() => String(res2.status)));
|
|
3106
3182
|
return "drop";
|
|
3107
3183
|
}
|
|
3108
|
-
const localId = _optionalChain([comment, 'access',
|
|
3184
|
+
const localId = _optionalChain([comment, 'access', _130 => _130.screenshot, 'optionalAccess', _131 => _131.localId]);
|
|
3109
3185
|
const blob = localId ? await deps.getScreenshot(localId) : null;
|
|
3110
3186
|
if (!blob) return "drop";
|
|
3111
3187
|
const { width, height } = comment.screenshot;
|
|
@@ -3366,7 +3442,7 @@ function createFreezeOverlay() {
|
|
|
3366
3442
|
removeHoverRules();
|
|
3367
3443
|
unfreezeAnimations();
|
|
3368
3444
|
unblockEvents();
|
|
3369
|
-
_optionalChain([overlay, 'optionalAccess',
|
|
3445
|
+
_optionalChain([overlay, 'optionalAccess', _132 => _132.remove, 'call', _133 => _133()]);
|
|
3370
3446
|
removeStyles(FREEZE_STYLE_ID);
|
|
3371
3447
|
overlay = null;
|
|
3372
3448
|
visible = false;
|
|
@@ -3548,7 +3624,7 @@ function clearPersistedHistory() {
|
|
|
3548
3624
|
var baselineFrame = null;
|
|
3549
3625
|
var baselineCache = /* @__PURE__ */ new Map();
|
|
3550
3626
|
function baselineDoc() {
|
|
3551
|
-
if (_optionalChain([baselineFrame, 'optionalAccess',
|
|
3627
|
+
if (_optionalChain([baselineFrame, 'optionalAccess', _134 => _134.isConnected]) && baselineFrame.contentDocument) return baselineFrame.contentDocument;
|
|
3552
3628
|
try {
|
|
3553
3629
|
baselineFrame = document.createElement("iframe");
|
|
3554
3630
|
baselineFrame.setAttribute("aria-hidden", "true");
|
|
@@ -3578,8 +3654,8 @@ function baselineFor(tag, type, props) {
|
|
|
3578
3654
|
const missing = props.filter((p) => !cached.has(p));
|
|
3579
3655
|
if (missing.length > 0) {
|
|
3580
3656
|
const doc = baselineDoc();
|
|
3581
|
-
const view = _optionalChain([doc, 'optionalAccess',
|
|
3582
|
-
if (_optionalChain([doc, 'optionalAccess',
|
|
3657
|
+
const view = _optionalChain([doc, 'optionalAccess', _135 => _135.defaultView]);
|
|
3658
|
+
if (_optionalChain([doc, 'optionalAccess', _136 => _136.body]) && view) {
|
|
3583
3659
|
const probe = doc.createElement(tag);
|
|
3584
3660
|
if (type) probe.setAttribute("type", type);
|
|
3585
3661
|
doc.body.appendChild(probe);
|
|
@@ -3593,7 +3669,7 @@ function baselineFor(tag, type, props) {
|
|
|
3593
3669
|
return cached;
|
|
3594
3670
|
}
|
|
3595
3671
|
function disposeStyleBaseline() {
|
|
3596
|
-
_optionalChain([baselineFrame, 'optionalAccess',
|
|
3672
|
+
_optionalChain([baselineFrame, 'optionalAccess', _137 => _137.remove, 'call', _138 => _138()]);
|
|
3597
3673
|
baselineFrame = null;
|
|
3598
3674
|
baselineCache.clear();
|
|
3599
3675
|
}
|
|
@@ -3695,7 +3771,7 @@ function states(el) {
|
|
|
3695
3771
|
}
|
|
3696
3772
|
function actionFacts(el) {
|
|
3697
3773
|
const f = {};
|
|
3698
|
-
const imgAlt = _nullishCoalesce(_optionalChain([el, 'access',
|
|
3774
|
+
const imgAlt = _nullishCoalesce(_optionalChain([el, 'access', _139 => _139.querySelector, 'call', _140 => _140("img[alt]"), 'optionalAccess', _141 => _141.getAttribute, 'call', _142 => _142("alt")]), () => ( ""));
|
|
3699
3775
|
put(f, "label", accessibleLabel(el) || textOf(el, 80) || redact(_nullishCoalesce(el.getAttribute("title"), () => ( ""))) || redact(imgAlt));
|
|
3700
3776
|
if (el.tagName === "A") put(f, "href", sanitizeUrl(_nullishCoalesce(el.getAttribute("href"), () => ( ""))));
|
|
3701
3777
|
else if (el.tagName === "BUTTON" || el.tagName === "INPUT") put(f, "type", _nullishCoalesce(el.getAttribute("type"), () => ( (el.tagName === "BUTTON" ? "submit" : ""))));
|
|
@@ -3744,7 +3820,7 @@ function mediaFacts(el) {
|
|
|
3744
3820
|
put(f, "label", accessibleLabel(el) || textOf(_nullishCoalesce(el.querySelector("title"), () => ( el)), 40));
|
|
3745
3821
|
put(f, "viewBox", _nullishCoalesce(el.getAttribute("viewBox"), () => ( "")));
|
|
3746
3822
|
} else if (el.tagName === "VIDEO" || el.tagName === "AUDIO" || el.tagName === "IFRAME") {
|
|
3747
|
-
put(f, "src", basename3(_nullishCoalesce(_nullishCoalesce(el.getAttribute("src"), () => ( _optionalChain([el, 'access',
|
|
3823
|
+
put(f, "src", basename3(_nullishCoalesce(_nullishCoalesce(el.getAttribute("src"), () => ( _optionalChain([el, 'access', _143 => _143.querySelector, 'call', _144 => _144("source"), 'optionalAccess', _145 => _145.getAttribute, 'call', _146 => _146("src")]))), () => ( ""))));
|
|
3748
3824
|
put(f, "title", redact(_nullishCoalesce(el.getAttribute("title"), () => ( ""))));
|
|
3749
3825
|
}
|
|
3750
3826
|
put(f, "size", size(el));
|
|
@@ -3752,8 +3828,8 @@ function mediaFacts(el) {
|
|
|
3752
3828
|
return f;
|
|
3753
3829
|
}
|
|
3754
3830
|
function childLabel(child, resolver) {
|
|
3755
|
-
const resolved = _optionalChain([resolver, 'optionalCall',
|
|
3756
|
-
if (_optionalChain([resolved, 'optionalAccess',
|
|
3831
|
+
const resolved = _optionalChain([resolver, 'optionalCall', _147 => _147(child)]);
|
|
3832
|
+
if (_optionalChain([resolved, 'optionalAccess', _148 => _148.name]) && resolved.hostElement === child) return resolved.name;
|
|
3757
3833
|
const tag = child.tagName.toLowerCase();
|
|
3758
3834
|
if (/^h[1-6]$/.test(tag)) return "heading";
|
|
3759
3835
|
if (tag === "a") return "link";
|
|
@@ -3788,7 +3864,7 @@ function sectionFacts(el, resolver) {
|
|
|
3788
3864
|
const f = {};
|
|
3789
3865
|
put(f, "title", redact(el.ownerDocument.title));
|
|
3790
3866
|
put(f, "viewport", `${window.innerWidth}\xD7${window.innerHeight}`);
|
|
3791
|
-
const regions = Array.from(el.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter((r) => !_optionalChain([r, 'access',
|
|
3867
|
+
const regions = Array.from(el.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter((r) => !_optionalChain([r, 'access', _149 => _149.parentElement, 'optionalAccess', _150 => _150.closest, 'call', _151 => _151('header, nav, main, aside, footer, section, [role="region"]')]) || r.parentElement === el).slice(0, 8).map((r) => {
|
|
3792
3868
|
const heading = firstHeading2(r);
|
|
3793
3869
|
return heading ? `${r.tagName.toLowerCase()} "${truncate(heading, 30)}"` : r.tagName.toLowerCase();
|
|
3794
3870
|
});
|
|
@@ -3845,22 +3921,22 @@ function isAppFile(file) {
|
|
|
3845
3921
|
return !!file && !/(^|[\\/])node_modules[\\/]/.test(file);
|
|
3846
3922
|
}
|
|
3847
3923
|
function resolveStack(el, deps) {
|
|
3848
|
-
const comp = _nullishCoalesce(_optionalChain([deps, 'access',
|
|
3924
|
+
const comp = _nullishCoalesce(_optionalChain([deps, 'access', _152 => _152.componentResolver, 'optionalCall', _153 => _153(el)]), () => ( null));
|
|
3849
3925
|
const frames = [];
|
|
3850
3926
|
const named = [];
|
|
3851
|
-
for (const entry of _nullishCoalesce(_optionalChain([comp, 'optionalAccess',
|
|
3927
|
+
for (const entry of _nullishCoalesce(_optionalChain([comp, 'optionalAccess', _154 => _154.stack]), () => ( []))) {
|
|
3852
3928
|
const src = entry.filePath !== void 0 ? { filePath: entry.filePath, line: _nullishCoalesce(entry.line, () => ( null)) } : entry.hostElement && deps.sourceResolver ? deps.sourceResolver(entry.hostElement) : null;
|
|
3853
|
-
const frame = { name: entry.name, file: _nullishCoalesce(_optionalChain([src, 'optionalAccess',
|
|
3929
|
+
const frame = { name: entry.name, file: _nullishCoalesce(_optionalChain([src, 'optionalAccess', _155 => _155.filePath]), () => ( null)), line: _nullishCoalesce(_optionalChain([src, 'optionalAccess', _156 => _156.line]), () => ( null)) };
|
|
3854
3930
|
named.push(frame);
|
|
3855
3931
|
if (isAppFile(frame.file) && frames.length < MAX_STACK) frames.push(frame);
|
|
3856
3932
|
}
|
|
3857
|
-
return { component: _nullishCoalesce(_optionalChain([comp, 'optionalAccess',
|
|
3933
|
+
return { component: _nullishCoalesce(_optionalChain([comp, 'optionalAccess', _157 => _157.name]), () => ( null)), frames: frames.length > 0 ? frames : named.slice(0, 2) };
|
|
3858
3934
|
}
|
|
3859
3935
|
function resolveSource(el, deps, frames) {
|
|
3860
|
-
const own = _optionalChain([deps, 'access',
|
|
3936
|
+
const own = _optionalChain([deps, 'access', _158 => _158.sourceResolver, 'optionalCall', _159 => _159(el)]);
|
|
3861
3937
|
if (own && isAppFile(own.filePath)) return { file: own.filePath, line: own.line, column: own.column };
|
|
3862
3938
|
const first = frames.find((f) => isAppFile(f.file));
|
|
3863
|
-
return _optionalChain([first, 'optionalAccess',
|
|
3939
|
+
return _optionalChain([first, 'optionalAccess', _160 => _160.file]) ? { file: first.file, line: first.line, column: null } : null;
|
|
3864
3940
|
}
|
|
3865
3941
|
function captureTarget(el, deps) {
|
|
3866
3942
|
const cleanClasses = _nullishCoalesce(deps.cleanClasses, () => ( ((list) => list.filter((c) => !isNoiseClass(c)))));
|
|
@@ -3911,7 +3987,7 @@ function sandboxHtml() {
|
|
|
3911
3987
|
return policy ? policy.createHTML(SANDBOX_HTML) : null;
|
|
3912
3988
|
}
|
|
3913
3989
|
async function getSandbox() {
|
|
3914
|
-
if (_optionalChain([sandbox, 'optionalAccess',
|
|
3990
|
+
if (_optionalChain([sandbox, 'optionalAccess', _161 => _161.isConnected])) return sandbox;
|
|
3915
3991
|
const frame = document.createElement("iframe");
|
|
3916
3992
|
frame.setAttribute("aria-hidden", "true");
|
|
3917
3993
|
frame.setAttribute("tabindex", "-1");
|
|
@@ -3935,7 +4011,7 @@ async function getSandbox() {
|
|
|
3935
4011
|
return frame;
|
|
3936
4012
|
}
|
|
3937
4013
|
function disposeScreenshotSandbox() {
|
|
3938
|
-
_optionalChain([sandbox, 'optionalAccess',
|
|
4014
|
+
_optionalChain([sandbox, 'optionalAccess', _162 => _162.remove, 'call', _163 => _163()]);
|
|
3939
4015
|
sandbox = null;
|
|
3940
4016
|
}
|
|
3941
4017
|
function withTimeout(promise, ms) {
|
|
@@ -4095,7 +4171,7 @@ function resolveComponent(element) {
|
|
|
4095
4171
|
name: cleanComponentName(owning.constructor.name),
|
|
4096
4172
|
hostElement: _nullishCoalesce(host2, () => ( walk.parentElement))
|
|
4097
4173
|
});
|
|
4098
|
-
current = _nullishCoalesce(_nullishCoalesce(_optionalChain([host2, 'optionalAccess',
|
|
4174
|
+
current = _nullishCoalesce(_nullishCoalesce(_optionalChain([host2, 'optionalAccess', _164 => _164.parentElement]), () => ( _optionalChain([walk, 'access', _165 => _165.parentElement, 'optionalAccess', _166 => _166.parentElement]))), () => ( null));
|
|
4099
4175
|
while (current) {
|
|
4100
4176
|
const comp = ng.getComponent(current);
|
|
4101
4177
|
if (comp && !seen2.has(comp)) {
|
|
@@ -4229,14 +4305,14 @@ function resolveComponent2(element) {
|
|
|
4229
4305
|
let current = fiber;
|
|
4230
4306
|
while (current && stack.length < MAX_STACK2) {
|
|
4231
4307
|
const name = getComponentName(current.type);
|
|
4232
|
-
if (name && !isNoise(name) && _optionalChain([stack, 'access',
|
|
4308
|
+
if (name && !isNoise(name) && _optionalChain([stack, 'access', _167 => _167[stack.length - 1], 'optionalAccess', _168 => _168.name]) !== name) {
|
|
4233
4309
|
stack.push({ name, hostElement: findHostElement(current) });
|
|
4234
4310
|
}
|
|
4235
4311
|
current = current.return;
|
|
4236
4312
|
}
|
|
4237
4313
|
return {
|
|
4238
|
-
name: _nullishCoalesce(_optionalChain([stack, 'access',
|
|
4239
|
-
hostElement: _nullishCoalesce(_optionalChain([stack, 'access',
|
|
4314
|
+
name: _nullishCoalesce(_optionalChain([stack, 'access', _169 => _169[0], 'optionalAccess', _170 => _170.name]), () => ( null)),
|
|
4315
|
+
hostElement: _nullishCoalesce(_optionalChain([stack, 'access', _171 => _171[0], 'optionalAccess', _172 => _172.hostElement]), () => ( null)),
|
|
4240
4316
|
stack
|
|
4241
4317
|
};
|
|
4242
4318
|
}
|
|
@@ -4247,7 +4323,7 @@ var LOCATION = /^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;
|
|
|
4247
4323
|
function resolveSource3(element) {
|
|
4248
4324
|
let current = element;
|
|
4249
4325
|
while (current) {
|
|
4250
|
-
const raw = _optionalChain([current, 'access',
|
|
4326
|
+
const raw = _optionalChain([current, 'access', _173 => _173.getAttribute, 'optionalCall', _174 => _174(SOURCE_ATTRIBUTE)]);
|
|
4251
4327
|
if (raw) return parseLocation(raw);
|
|
4252
4328
|
current = current.parentElement;
|
|
4253
4329
|
}
|
|
@@ -4259,7 +4335,7 @@ function parseLocation(raw) {
|
|
|
4259
4335
|
return { filePath: match[1], line: Number(match[2]), column: Number(match[3]) };
|
|
4260
4336
|
}
|
|
4261
4337
|
function ownStamp(element) {
|
|
4262
|
-
const raw = _optionalChain([element, 'optionalAccess',
|
|
4338
|
+
const raw = _optionalChain([element, 'optionalAccess', _175 => _175.getAttribute, 'optionalCall', _176 => _176(SOURCE_ATTRIBUTE)]);
|
|
4263
4339
|
if (!raw) return null;
|
|
4264
4340
|
const match = LOCATION.exec(raw);
|
|
4265
4341
|
if (!match) return { file: raw, line: null, column: null, name: null };
|
|
@@ -4274,8 +4350,8 @@ function nameFromStamps(result) {
|
|
|
4274
4350
|
const stack = [];
|
|
4275
4351
|
for (const entry of result.stack) {
|
|
4276
4352
|
const stamp = ownStamp(entry.hostElement);
|
|
4277
|
-
const name = _nullishCoalesce(_optionalChain([stamp, 'optionalAccess',
|
|
4278
|
-
if (name && _optionalChain([stack, 'access',
|
|
4353
|
+
const name = _nullishCoalesce(_optionalChain([stamp, 'optionalAccess', _177 => _177.name]), () => ( (stamp ? baseName(stamp.file) : null)));
|
|
4354
|
+
if (name && _optionalChain([stack, 'access', _178 => _178[stack.length - 1], 'optionalAccess', _179 => _179.name]) !== name) stack.push({ name, hostElement: entry.hostElement });
|
|
4279
4355
|
}
|
|
4280
4356
|
return stack[0] ? { name: stack[0].name, hostElement: stack[0].hostElement, stack } : null;
|
|
4281
4357
|
}
|
|
@@ -4311,7 +4387,7 @@ function vue3Name(inst) {
|
|
|
4311
4387
|
return t.__name || t.name || t.displayName || (t.__file ? baseName(t.__file) : null);
|
|
4312
4388
|
}
|
|
4313
4389
|
function vue3Host(inst) {
|
|
4314
|
-
return firstElement(_nullishCoalesce(_optionalChain([inst, 'access',
|
|
4390
|
+
return firstElement(_nullishCoalesce(_optionalChain([inst, 'access', _180 => _180.subTree, 'optionalAccess', _181 => _181.el]), () => ( _optionalChain([inst, 'access', _182 => _182.vnode, 'optionalAccess', _183 => _183.el]))));
|
|
4315
4391
|
}
|
|
4316
4392
|
function vue2Owner(el) {
|
|
4317
4393
|
let current = el;
|
|
@@ -4351,7 +4427,7 @@ function resolveVueComponent(el) {
|
|
|
4351
4427
|
}
|
|
4352
4428
|
function resolveVueSource(el) {
|
|
4353
4429
|
const inst3 = vue3Owner(el);
|
|
4354
|
-
const file = _nullishCoalesce(_optionalChain([inst3, 'optionalAccess',
|
|
4430
|
+
const file = _nullishCoalesce(_optionalChain([inst3, 'optionalAccess', _184 => _184.type, 'optionalAccess', _185 => _185.__file]), () => ( _optionalChain([vue2Owner, 'call', _186 => _186(el), 'optionalAccess', _187 => _187.$options, 'optionalAccess', _188 => _188.__file])));
|
|
4355
4431
|
return file ? { filePath: relativizePath(file), line: null, column: null } : NO_SOURCE;
|
|
4356
4432
|
}
|
|
4357
4433
|
var vueAdapter = {
|
|
@@ -4367,19 +4443,19 @@ function metaOf(el) {
|
|
|
4367
4443
|
let current = el;
|
|
4368
4444
|
while (current) {
|
|
4369
4445
|
const meta = current.__svelte_meta;
|
|
4370
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
4446
|
+
if (_optionalChain([meta, 'optionalAccess', _189 => _189.loc])) return { meta, el: current };
|
|
4371
4447
|
current = current.parentElement;
|
|
4372
4448
|
}
|
|
4373
4449
|
return null;
|
|
4374
4450
|
}
|
|
4375
4451
|
function lineOf(meta) {
|
|
4376
|
-
const line = _optionalChain([meta, 'access',
|
|
4452
|
+
const line = _optionalChain([meta, 'access', _190 => _190.loc, 'optionalAccess', _191 => _191.line]);
|
|
4377
4453
|
if (typeof line !== "number") return null;
|
|
4378
4454
|
return "parent" in meta ? line : line + 1;
|
|
4379
4455
|
}
|
|
4380
4456
|
function resolveSvelteComponent(el) {
|
|
4381
4457
|
const found = metaOf(el);
|
|
4382
|
-
if (!_optionalChain([found, 'optionalAccess',
|
|
4458
|
+
if (!_optionalChain([found, 'optionalAccess', _192 => _192.meta, 'access', _193 => _193.loc, 'optionalAccess', _194 => _194.file])) return null;
|
|
4383
4459
|
const { meta } = found;
|
|
4384
4460
|
const own = baseName(meta.loc.file);
|
|
4385
4461
|
const stack = [{ name: own, hostElement: found.el }];
|
|
@@ -4393,9 +4469,9 @@ function resolveSvelteComponent(el) {
|
|
|
4393
4469
|
}
|
|
4394
4470
|
function resolveSvelteSource(el) {
|
|
4395
4471
|
const found = metaOf(el);
|
|
4396
|
-
const file = _optionalChain([found, 'optionalAccess',
|
|
4472
|
+
const file = _optionalChain([found, 'optionalAccess', _195 => _195.meta, 'access', _196 => _196.loc, 'optionalAccess', _197 => _197.file]);
|
|
4397
4473
|
if (!found || !file) return NO_SOURCE;
|
|
4398
|
-
const column = _optionalChain([found, 'access',
|
|
4474
|
+
const column = _optionalChain([found, 'access', _198 => _198.meta, 'access', _199 => _199.loc, 'optionalAccess', _200 => _200.column]);
|
|
4399
4475
|
return {
|
|
4400
4476
|
filePath: relativizePath(file),
|
|
4401
4477
|
line: lineOf(found.meta),
|
|
@@ -4415,10 +4491,10 @@ var domAdapter = {
|
|
|
4415
4491
|
name: "HTML",
|
|
4416
4492
|
resolveComponent: (el) => {
|
|
4417
4493
|
const host2 = el.closest("[data-component]");
|
|
4418
|
-
const name = _optionalChain([host2, 'optionalAccess',
|
|
4494
|
+
const name = _optionalChain([host2, 'optionalAccess', _201 => _201.getAttribute, 'call', _202 => _202("data-component")]);
|
|
4419
4495
|
if (!host2 || !name) return null;
|
|
4420
4496
|
const stack = [];
|
|
4421
|
-
for (let h2 = host2; h2; h2 = _nullishCoalesce(_optionalChain([h2, 'access',
|
|
4497
|
+
for (let h2 = host2; h2; h2 = _nullishCoalesce(_optionalChain([h2, 'access', _203 => _203.parentElement, 'optionalAccess', _204 => _204.closest, 'call', _205 => _205("[data-component]")]), () => ( null))) {
|
|
4422
4498
|
const n = h2.getAttribute("data-component");
|
|
4423
4499
|
if (n) stack.push({ name: n, hostElement: h2 });
|
|
4424
4500
|
if (stack.length >= 12) break;
|
|
@@ -4440,7 +4516,7 @@ function composeAdapters(adapters = DEFAULT_ADAPTERS) {
|
|
|
4440
4516
|
for (const adapter of adapters) {
|
|
4441
4517
|
try {
|
|
4442
4518
|
const result = adapter.resolveComponent(el);
|
|
4443
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
4519
|
+
if (_optionalChain([result, 'optionalAccess', _206 => _206.name])) return { adapter, result };
|
|
4444
4520
|
} catch (e30) {
|
|
4445
4521
|
}
|
|
4446
4522
|
}
|
|
@@ -4448,7 +4524,7 @@ function composeAdapters(adapters = DEFAULT_ADAPTERS) {
|
|
|
4448
4524
|
}
|
|
4449
4525
|
return {
|
|
4450
4526
|
resolveComponent(el) {
|
|
4451
|
-
return _nullishCoalesce(_optionalChain([owner, 'call',
|
|
4527
|
+
return _nullishCoalesce(_optionalChain([owner, 'call', _207 => _207(el), 'optionalAccess', _208 => _208.result]), () => ( null));
|
|
4452
4528
|
},
|
|
4453
4529
|
resolveSource(el) {
|
|
4454
4530
|
const stamped = resolveSource3(el);
|
|
@@ -4457,15 +4533,15 @@ function composeAdapters(adapters = DEFAULT_ADAPTERS) {
|
|
|
4457
4533
|
const ordered = found ? [found.adapter, ...adapters.filter((a) => a !== found.adapter)] : adapters;
|
|
4458
4534
|
for (const adapter of ordered) {
|
|
4459
4535
|
try {
|
|
4460
|
-
const src = _optionalChain([adapter, 'access',
|
|
4461
|
-
if (_optionalChain([src, 'optionalAccess',
|
|
4536
|
+
const src = _optionalChain([adapter, 'access', _209 => _209.resolveSource, 'optionalCall', _210 => _210(el)]);
|
|
4537
|
+
if (_optionalChain([src, 'optionalAccess', _211 => _211.filePath])) return src;
|
|
4462
4538
|
} catch (e31) {
|
|
4463
4539
|
}
|
|
4464
4540
|
}
|
|
4465
4541
|
return null;
|
|
4466
4542
|
},
|
|
4467
4543
|
frameworkFor(el) {
|
|
4468
|
-
return _nullishCoalesce(_optionalChain([owner, 'call',
|
|
4544
|
+
return _nullishCoalesce(_optionalChain([owner, 'call', _212 => _212(el), 'optionalAccess', _213 => _213.adapter, 'access', _214 => _214.name]), () => ( "HTML"));
|
|
4469
4545
|
},
|
|
4470
4546
|
cleanClasses(classes) {
|
|
4471
4547
|
return adapters.reduce((list, a) => a.cleanClasses ? a.cleanClasses(list) : list, classes);
|
|
@@ -4497,7 +4573,7 @@ function getDefaultOptions() {
|
|
|
4497
4573
|
};
|
|
4498
4574
|
}
|
|
4499
4575
|
function init(options) {
|
|
4500
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4576
|
+
if (_optionalChain([options, 'optionalAccess', _215 => _215.mode]) === "live" && !_chunk6CBIOKZVcjs.consumeFeedbackLink.call(void 0, options.projectKey)) {
|
|
4501
4577
|
return createDormantApi(options);
|
|
4502
4578
|
}
|
|
4503
4579
|
return createGrabInstance(options);
|
|
@@ -4523,7 +4599,7 @@ function createDormantApi(options) {
|
|
|
4523
4599
|
real.show();
|
|
4524
4600
|
return;
|
|
4525
4601
|
}
|
|
4526
|
-
_optionalChain([flusher, 'optionalAccess',
|
|
4602
|
+
_optionalChain([flusher, 'optionalAccess', _216 => _216.dispose, 'call', _217 => _217()]);
|
|
4527
4603
|
_chunk6CBIOKZVcjs.startFeedbackSession.call(void 0, );
|
|
4528
4604
|
real = createGrabInstance(options);
|
|
4529
4605
|
for (const fn of queued.splice(0)) fn(real);
|
|
@@ -4550,14 +4626,29 @@ function flushLeftovers(options) {
|
|
|
4550
4626
|
}
|
|
4551
4627
|
});
|
|
4552
4628
|
}
|
|
4629
|
+
var COLLAPSED_KEY = "grabby:v1:collapsed";
|
|
4630
|
+
function loadCollapsed() {
|
|
4631
|
+
try {
|
|
4632
|
+
return sessionStorage.getItem(COLLAPSED_KEY) === "1";
|
|
4633
|
+
} catch (e33) {
|
|
4634
|
+
return false;
|
|
4635
|
+
}
|
|
4636
|
+
}
|
|
4637
|
+
function saveCollapsed(on) {
|
|
4638
|
+
try {
|
|
4639
|
+
if (on) sessionStorage.setItem(COLLAPSED_KEY, "1");
|
|
4640
|
+
else sessionStorage.removeItem(COLLAPSED_KEY);
|
|
4641
|
+
} catch (e34) {
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4553
4644
|
function isDevMode() {
|
|
4554
4645
|
try {
|
|
4555
4646
|
if (typeof ngDevMode !== "undefined" && ngDevMode === false) return false;
|
|
4556
|
-
} catch (
|
|
4647
|
+
} catch (e35) {
|
|
4557
4648
|
}
|
|
4558
4649
|
try {
|
|
4559
4650
|
if (process.env.NODE_ENV === "production") return false;
|
|
4560
|
-
} catch (
|
|
4651
|
+
} catch (e36) {
|
|
4561
4652
|
}
|
|
4562
4653
|
return true;
|
|
4563
4654
|
}
|
|
@@ -4565,14 +4656,14 @@ function loadLevel(fallback) {
|
|
|
4565
4656
|
try {
|
|
4566
4657
|
const v = localStorage.getItem(LEVEL_KEY);
|
|
4567
4658
|
if (v === "compact" || v === "standard" || v === "detailed") return v;
|
|
4568
|
-
} catch (
|
|
4659
|
+
} catch (e37) {
|
|
4569
4660
|
}
|
|
4570
4661
|
return fallback;
|
|
4571
4662
|
}
|
|
4572
4663
|
function saveLevel(level) {
|
|
4573
4664
|
try {
|
|
4574
4665
|
localStorage.setItem(LEVEL_KEY, level);
|
|
4575
|
-
} catch (
|
|
4666
|
+
} catch (e38) {
|
|
4576
4667
|
}
|
|
4577
4668
|
}
|
|
4578
4669
|
function createNoopApi() {
|
|
@@ -4632,6 +4723,7 @@ function createGrabInstance(options) {
|
|
|
4632
4723
|
let selectedElement = null;
|
|
4633
4724
|
let pendingShot = null;
|
|
4634
4725
|
let level = loadLevel(merged.detailLevel);
|
|
4726
|
+
let collapsed = loadCollapsed();
|
|
4635
4727
|
const pendingShotDeletes = /* @__PURE__ */ new Map();
|
|
4636
4728
|
themeManager.apply(store.state.toolbar.themeMode);
|
|
4637
4729
|
updateToastOffset();
|
|
@@ -4683,9 +4775,9 @@ function createGrabInstance(options) {
|
|
|
4683
4775
|
function toastDetail(c) {
|
|
4684
4776
|
return {
|
|
4685
4777
|
componentName: c.target.component,
|
|
4686
|
-
filePath: _nullishCoalesce(_optionalChain([c, 'access',
|
|
4687
|
-
line: _nullishCoalesce(_optionalChain([c, 'access',
|
|
4688
|
-
column: _nullishCoalesce(_optionalChain([c, 'access',
|
|
4778
|
+
filePath: _nullishCoalesce(_optionalChain([c, 'access', _218 => _218.target, 'access', _219 => _219.source, 'optionalAccess', _220 => _220.file]), () => ( null)),
|
|
4779
|
+
line: _nullishCoalesce(_optionalChain([c, 'access', _221 => _221.target, 'access', _222 => _222.source, 'optionalAccess', _223 => _223.line]), () => ( null)),
|
|
4780
|
+
column: _nullishCoalesce(_optionalChain([c, 'access', _224 => _224.target, 'access', _225 => _225.source, 'optionalAccess', _226 => _226.column]), () => ( null))
|
|
4689
4781
|
};
|
|
4690
4782
|
}
|
|
4691
4783
|
function saveComment(element, text, shot) {
|
|
@@ -4709,7 +4801,7 @@ function createGrabInstance(options) {
|
|
|
4709
4801
|
};
|
|
4710
4802
|
setComments([comment, ...comments()].slice(0, MAX_COMMENTS));
|
|
4711
4803
|
pluginRegistry.callHook("onComment", comment, element);
|
|
4712
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
4804
|
+
_optionalChain([outbox, 'optionalAccess', _227 => _227.send, 'call', _228 => _228(comment.id)]);
|
|
4713
4805
|
if (shot) void attachScreenshot(comment.id, shot);
|
|
4714
4806
|
const count = comments().length;
|
|
4715
4807
|
if (live) {
|
|
@@ -4744,7 +4836,7 @@ function createGrabInstance(options) {
|
|
|
4744
4836
|
const updated = { ...current, screenshot: { localId: id, width: result.width, height: result.height } };
|
|
4745
4837
|
setComments(comments().map((c) => c.id === id ? updated : c));
|
|
4746
4838
|
pluginRegistry.callHook("onScreenshot", updated, result.blob);
|
|
4747
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
4839
|
+
_optionalChain([outbox, 'optionalAccess', _229 => _229.sendScreenshot, 'call', _230 => _230(id)]);
|
|
4748
4840
|
}
|
|
4749
4841
|
function removeComments(ids, message, withdraw = false) {
|
|
4750
4842
|
if (ids.length === 0) return;
|
|
@@ -4755,7 +4847,7 @@ function createGrabInstance(options) {
|
|
|
4755
4847
|
const withdrawn = withdraw && outbox ? removed.filter((c) => c.sync !== void 0) : [];
|
|
4756
4848
|
const hadQueued = new Set(withdrawn.filter((c) => outbox.isQueued(c.id)).map((c) => c.id));
|
|
4757
4849
|
for (const c of withdrawn) outbox.remove(c.id, c.author.sessionId, message ? UNDO_MS + 500 : 0);
|
|
4758
|
-
const shotIds = removed.flatMap((c) => _optionalChain([c, 'access',
|
|
4850
|
+
const shotIds = removed.flatMap((c) => _optionalChain([c, 'access', _231 => _231.screenshot, 'optionalAccess', _232 => _232.localId]) ? [c.screenshot.localId] : []);
|
|
4759
4851
|
const key = randomId();
|
|
4760
4852
|
pendingShotDeletes.set(key, setTimeout(() => {
|
|
4761
4853
|
pendingShotDeletes.delete(key);
|
|
@@ -4774,7 +4866,7 @@ function createGrabInstance(options) {
|
|
|
4774
4866
|
const back = removed.filter((c) => !present.has(c.id)).map((c) => resend.has(c.id) ? { ...c, sync: "pending" } : c);
|
|
4775
4867
|
const restored = [...back, ...comments()].sort((a, b) => b.createdAt - a.createdAt);
|
|
4776
4868
|
setComments(restored);
|
|
4777
|
-
for (const id of resend) _optionalChain([outbox, 'optionalAccess',
|
|
4869
|
+
for (const id of resend) _optionalChain([outbox, 'optionalAccess', _233 => _233.send, 'call', _234 => _234(id)]);
|
|
4778
4870
|
showToast(`Restored ${removed.length} comment${removed.length === 1 ? "" : "s"}`);
|
|
4779
4871
|
}
|
|
4780
4872
|
}]
|
|
@@ -4805,9 +4897,17 @@ function createGrabInstance(options) {
|
|
|
4805
4897
|
function isAnyToolbarElement(el) {
|
|
4806
4898
|
return isUiNode(el) || freezeOverlay.isFreezeElement(el);
|
|
4807
4899
|
}
|
|
4900
|
+
function hideCommentPopover() {
|
|
4901
|
+
commentPopover.hide();
|
|
4902
|
+
if (picker.isHolding()) {
|
|
4903
|
+
selectedElement = null;
|
|
4904
|
+
pendingShot = null;
|
|
4905
|
+
picker.release();
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4808
4908
|
function closeAllPopovers() {
|
|
4809
4909
|
commentsPanel.hide();
|
|
4810
|
-
|
|
4910
|
+
hideCommentPopover();
|
|
4811
4911
|
copySheet.close();
|
|
4812
4912
|
finishSheet.close();
|
|
4813
4913
|
}
|
|
@@ -4847,6 +4947,7 @@ function createGrabInstance(options) {
|
|
|
4847
4947
|
pluginRegistry.callHook("onElementSelect", element);
|
|
4848
4948
|
coachMark.dismiss();
|
|
4849
4949
|
showSelectFeedback(element);
|
|
4950
|
+
picker.hold(element);
|
|
4850
4951
|
commentPopover.show({ anchor: element, mode: "new", askIdentity: shouldAskIdentity() });
|
|
4851
4952
|
}
|
|
4852
4953
|
});
|
|
@@ -4857,6 +4958,7 @@ function createGrabInstance(options) {
|
|
|
4857
4958
|
store.state.toolbar = { ...store.state.toolbar, visible: true };
|
|
4858
4959
|
toolbar.show();
|
|
4859
4960
|
}
|
|
4961
|
+
if (collapsed) expandToolbar();
|
|
4860
4962
|
closeAllPopovers();
|
|
4861
4963
|
store.state.active = true;
|
|
4862
4964
|
picker.activate();
|
|
@@ -4891,7 +4993,7 @@ function createGrabInstance(options) {
|
|
|
4891
4993
|
}
|
|
4892
4994
|
},
|
|
4893
4995
|
onHistory() {
|
|
4894
|
-
|
|
4996
|
+
hideCommentPopover();
|
|
4895
4997
|
copySheet.close();
|
|
4896
4998
|
if (commentsPanel.isVisible()) {
|
|
4897
4999
|
commentsPanel.hide();
|
|
@@ -4908,16 +5010,28 @@ function createGrabInstance(options) {
|
|
|
4908
5010
|
}
|
|
4909
5011
|
toolbar.update(store.state);
|
|
4910
5012
|
},
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
}
|
|
4917
|
-
exitFeedbackMode();
|
|
4918
|
-
},
|
|
5013
|
+
// Close collapses the toolbar into a round button in the bottom-right
|
|
5014
|
+
// corner instead of removing it, so nothing is lost and it's one click
|
|
5015
|
+
// back. Comments keep sending while it's collapsed.
|
|
5016
|
+
onDismiss: collapseToolbar,
|
|
5017
|
+
onExpand: expandToolbar,
|
|
4919
5018
|
onFinish: openFinishSheet
|
|
4920
|
-
}, live ? { label: "Comment", dismissLabel: "
|
|
5019
|
+
}, live ? { label: "Comment", dismissLabel: "Hide toolbar", expandLabel: "Leave feedback", hideEnable: true, review: !!merged.server } : { dismissLabel: "Hide toolbar", expandLabel: "Open Grabby toolbar" });
|
|
5020
|
+
function collapseToolbar() {
|
|
5021
|
+
closeAllPopovers();
|
|
5022
|
+
coachMark.dismiss();
|
|
5023
|
+
doDeactivate(true);
|
|
5024
|
+
collapsed = true;
|
|
5025
|
+
toolbar.collapse();
|
|
5026
|
+
saveCollapsed(true);
|
|
5027
|
+
updateToastOffset();
|
|
5028
|
+
}
|
|
5029
|
+
function expandToolbar() {
|
|
5030
|
+
collapsed = false;
|
|
5031
|
+
toolbar.expand();
|
|
5032
|
+
saveCollapsed(false);
|
|
5033
|
+
updateToastOffset();
|
|
5034
|
+
}
|
|
4921
5035
|
const commentsPanel = createCommentsPanel({
|
|
4922
5036
|
onHover(comment) {
|
|
4923
5037
|
const el = comment ? safeQuery(comment.target.selector) : null;
|
|
@@ -4979,7 +5093,7 @@ function createGrabInstance(options) {
|
|
|
4979
5093
|
});
|
|
4980
5094
|
const finishSheet = createFinishSheet({
|
|
4981
5095
|
onDone() {
|
|
4982
|
-
const done = comments().filter((c) => c.sync === "sent" && !_optionalChain([outbox, 'optionalAccess',
|
|
5096
|
+
const done = comments().filter((c) => c.sync === "sent" && !_optionalChain([outbox, 'optionalAccess', _235 => _235.isQueued, 'call', _236 => _236(c.id)])).map((c) => c.id);
|
|
4983
5097
|
if (!comments().length) {
|
|
4984
5098
|
exitFeedbackMode();
|
|
4985
5099
|
return;
|
|
@@ -4993,9 +5107,9 @@ function createGrabInstance(options) {
|
|
|
4993
5107
|
if (failed.length) {
|
|
4994
5108
|
const ids = new Set(failed.map((c) => c.id));
|
|
4995
5109
|
setComments(comments().map((c) => ids.has(c.id) ? { ...c, sync: "pending" } : c));
|
|
4996
|
-
for (const id of ids) _optionalChain([outbox, 'optionalAccess',
|
|
5110
|
+
for (const id of ids) _optionalChain([outbox, 'optionalAccess', _237 => _237.send, 'call', _238 => _238(id)]);
|
|
4997
5111
|
}
|
|
4998
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5112
|
+
_optionalChain([outbox, 'optionalAccess', _239 => _239.flush, 'call', _240 => _240()]);
|
|
4999
5113
|
}
|
|
5000
5114
|
});
|
|
5001
5115
|
const commentPopover = createCommentPopover({
|
|
@@ -5015,7 +5129,7 @@ function createGrabInstance(options) {
|
|
|
5015
5129
|
(c) => c.id === ctx.entryId ? { ...c, comment: value, updatedAt: Date.now(), ...outbox ? { sync: "pending" } : {} } : c
|
|
5016
5130
|
);
|
|
5017
5131
|
setComments(updated);
|
|
5018
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5132
|
+
_optionalChain([outbox, 'optionalAccess', _241 => _241.send, 'call', _242 => _242(ctx.entryId)]);
|
|
5019
5133
|
showToast("Comment updated");
|
|
5020
5134
|
commentsPanel.show([...updated]);
|
|
5021
5135
|
},
|
|
@@ -5040,7 +5154,7 @@ function createGrabInstance(options) {
|
|
|
5040
5154
|
document.addEventListener("click", handleDocumentClick);
|
|
5041
5155
|
function handlePageHide() {
|
|
5042
5156
|
flushPendingWrite();
|
|
5043
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5157
|
+
_optionalChain([outbox, 'optionalAccess', _243 => _243.flushOnExit, 'call', _244 => _244()]);
|
|
5044
5158
|
}
|
|
5045
5159
|
function handleVisibilityChange() {
|
|
5046
5160
|
if (document.visibilityState === "hidden") flushPendingWrite();
|
|
@@ -5054,7 +5168,7 @@ function createGrabInstance(options) {
|
|
|
5054
5168
|
}
|
|
5055
5169
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
5056
5170
|
function updateToastOffset() {
|
|
5057
|
-
if (store.state.toolbar.visible) {
|
|
5171
|
+
if (store.state.toolbar.visible && !collapsed) {
|
|
5058
5172
|
document.documentElement.style.setProperty("--grabby-toast-bottom", TOOLBAR_TOAST_OFFSET);
|
|
5059
5173
|
} else {
|
|
5060
5174
|
document.documentElement.style.removeProperty("--grabby-toast-bottom");
|
|
@@ -5192,7 +5306,7 @@ function createGrabInstance(options) {
|
|
|
5192
5306
|
copySheet.dispose();
|
|
5193
5307
|
finishSheet.dispose();
|
|
5194
5308
|
coachMark.dispose();
|
|
5195
|
-
_optionalChain([outbox, 'optionalAccess',
|
|
5309
|
+
_optionalChain([outbox, 'optionalAccess', _245 => _245.dispose, 'call', _246 => _246()]);
|
|
5196
5310
|
themeManager.dispose();
|
|
5197
5311
|
disposeStyleBaseline();
|
|
5198
5312
|
disposeScreenshotSandbox();
|
|
@@ -5204,9 +5318,10 @@ function createGrabInstance(options) {
|
|
|
5204
5318
|
keyboard.start();
|
|
5205
5319
|
}
|
|
5206
5320
|
store.state.toolbar = { ...store.state.toolbar, visible: false };
|
|
5321
|
+
if (collapsed) toolbar.collapse();
|
|
5207
5322
|
if (live && merged.showToolbar) {
|
|
5208
5323
|
api.showToolbar();
|
|
5209
|
-
coachMark.maybeShow();
|
|
5324
|
+
if (!collapsed) coachMark.maybeShow();
|
|
5210
5325
|
}
|
|
5211
5326
|
store.subscribe((state, key) => {
|
|
5212
5327
|
if (key === "options") {
|