@daybook/feedback 1.5.0 → 1.6.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/LICENSE +21 -21
- package/README.md +521 -463
- package/dist/client.d.ts +5 -0
- package/dist/client.js +9 -2
- package/dist/feedback.js +10 -10
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -0
- package/dist/module.d.ts +23 -0
- package/dist/module.js +53 -0
- package/dist/types.d.ts +4 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/widget.js +384 -384
- package/package.json +53 -46
package/dist/widget.js
CHANGED
|
@@ -149,9 +149,9 @@ export class FeedbackWidget {
|
|
|
149
149
|
const near = at.startsWith('bottom') ? 'bottom' : 'top';
|
|
150
150
|
const side = at.endsWith('right') ? 'right' : 'left';
|
|
151
151
|
const offset = EDGE + this.clearance;
|
|
152
|
-
style.textContent = `:host {
|
|
153
|
-
--pm-${side}: ${EDGE}px; --pm-${side === 'right' ? 'left' : 'right'}: auto;
|
|
154
|
-
--pm-${near}: ${offset}px; --pm-${near === 'bottom' ? 'top' : 'bottom'}: auto;
|
|
152
|
+
style.textContent = `:host {
|
|
153
|
+
--pm-${side}: ${EDGE}px; --pm-${side === 'right' ? 'left' : 'right'}: auto;
|
|
154
|
+
--pm-${near}: ${offset}px; --pm-${near === 'bottom' ? 'top' : 'bottom'}: auto;
|
|
155
155
|
}`;
|
|
156
156
|
}
|
|
157
157
|
/** The box the widget would occupy if nothing were in its way. What the probe measures. */
|
|
@@ -862,17 +862,17 @@ export class FeedbackWidget {
|
|
|
862
862
|
note.setAttribute('role', 'status');
|
|
863
863
|
const reference = this.reference;
|
|
864
864
|
const failed = this.uploadsFailed;
|
|
865
|
-
note.innerHTML = `
|
|
866
|
-
<div class="sent__tick" aria-hidden="true">✓</div>
|
|
867
|
-
<div class="sent__body">
|
|
868
|
-
<div class="panel__title">Thank you — that is on its way.</div>
|
|
865
|
+
note.innerHTML = `
|
|
866
|
+
<div class="sent__tick" aria-hidden="true">✓</div>
|
|
867
|
+
<div class="sent__body">
|
|
868
|
+
<div class="panel__title">Thank you — that is on its way.</div>
|
|
869
869
|
${reference
|
|
870
|
-
? `<div class="sent__ref">
|
|
871
|
-
<code class="sent__id">${escapeHtml(reference)}</code>
|
|
872
|
-
<button type="button" class="sent__copy" data-copy>Copy</button>
|
|
873
|
-
</div>
|
|
870
|
+
? `<div class="sent__ref">
|
|
871
|
+
<code class="sent__id">${escapeHtml(reference)}</code>
|
|
872
|
+
<button type="button" class="sent__copy" data-copy>Copy</button>
|
|
873
|
+
</div>
|
|
874
874
|
<div class="panel__anchor">Quote it if you follow it up.</div>`
|
|
875
|
-
: ''}
|
|
875
|
+
: ''}
|
|
876
876
|
${failed > 0
|
|
877
877
|
// Said out loud. The report itself is safe, and the reporter is the only person who can
|
|
878
878
|
// tell that the picture they attached is missing from it — so they are told rather than
|
|
@@ -880,8 +880,8 @@ export class FeedbackWidget {
|
|
|
880
880
|
? `<div class="sent__warn">${failed === 1
|
|
881
881
|
? 'One attachment could not be uploaded.'
|
|
882
882
|
: `${failed} attachments could not be uploaded.`} The report was filed without it.</div>`
|
|
883
|
-
: ''}
|
|
884
|
-
</div>
|
|
883
|
+
: ''}
|
|
884
|
+
</div>
|
|
885
885
|
${reference
|
|
886
886
|
? '<button type="button" class="panel__close" data-dismiss aria-label="Dismiss">×</button>'
|
|
887
887
|
: ''}`;
|
|
@@ -1067,55 +1067,55 @@ export class FeedbackWidget {
|
|
|
1067
1067
|
// reporter pointed at something, and saying what they pointed at is how they know we understood.
|
|
1068
1068
|
// "Report a problem" is a heading anybody could have written; the anchor is theirs.
|
|
1069
1069
|
const capture = this.capture();
|
|
1070
|
-
panel.innerHTML = `
|
|
1071
|
-
<div class="panel__head" id="head">
|
|
1072
|
-
<span class="panel__grip" aria-hidden="true">⠿</span>
|
|
1073
|
-
<div class="panel__heading">
|
|
1074
|
-
<div class="panel__anchor">${escapeHtml(anchorLabel)}</div>
|
|
1075
|
-
<div class="panel__title">Report a problem</div>
|
|
1076
|
-
</div>
|
|
1077
|
-
<button id="close" class="panel__close" aria-label="Close">×</button>
|
|
1078
|
-
</div>
|
|
1079
|
-
|
|
1080
|
-
<!-- The pins, when there is more than one to tell apart, and the way to add one. -->
|
|
1081
|
-
<div id="pins" class="pins"></div>
|
|
1082
|
-
|
|
1083
|
-
<textarea id="message" rows="5" placeholder="What happened?"></textarea>
|
|
1084
|
-
|
|
1085
|
-
<!--
|
|
1086
|
-
Under the message, not above it. Four filled buttons at the top were the loudest thing in the
|
|
1087
|
-
panel and the least important decision in it — the default is right almost every time, and
|
|
1088
|
-
what somebody came here to do is type.
|
|
1089
|
-
-->
|
|
1090
|
-
<div class="panel__kinds">
|
|
1091
|
-
${['bug', 'idea', 'praise', 'question'].map((k, i) => `<button class="kind${i === 0 ? ' kind--on' : ''}" data-kind="${k}">${k}</button>`).join('')}
|
|
1092
|
-
</div>
|
|
1093
|
-
|
|
1094
|
-
<input id="email" type="email" placeholder="Email (optional, so we can reply)" autocomplete="email" />
|
|
1095
|
-
|
|
1096
|
-
<!-- One attachment area, not two. A checkbox for the screen and a dropzone for a file were
|
|
1097
|
-
two ways to do the same thing, stacked, both dim.
|
|
1098
|
-
|
|
1099
|
-
The capture control is rendered only when it can actually do something. It used to be
|
|
1100
|
-
drawn whatever the host had configured and then ignored downstream, so ticking it was a
|
|
1101
|
-
promise nobody kept. -->
|
|
1102
|
-
<div id="drop" class="drop">
|
|
1070
|
+
panel.innerHTML = `
|
|
1071
|
+
<div class="panel__head" id="head">
|
|
1072
|
+
<span class="panel__grip" aria-hidden="true">⠿</span>
|
|
1073
|
+
<div class="panel__heading">
|
|
1074
|
+
<div class="panel__anchor">${escapeHtml(anchorLabel)}</div>
|
|
1075
|
+
<div class="panel__title">Report a problem</div>
|
|
1076
|
+
</div>
|
|
1077
|
+
<button id="close" class="panel__close" aria-label="Close">×</button>
|
|
1078
|
+
</div>
|
|
1079
|
+
|
|
1080
|
+
<!-- The pins, when there is more than one to tell apart, and the way to add one. -->
|
|
1081
|
+
<div id="pins" class="pins"></div>
|
|
1082
|
+
|
|
1083
|
+
<textarea id="message" rows="5" placeholder="What happened?"></textarea>
|
|
1084
|
+
|
|
1085
|
+
<!--
|
|
1086
|
+
Under the message, not above it. Four filled buttons at the top were the loudest thing in the
|
|
1087
|
+
panel and the least important decision in it — the default is right almost every time, and
|
|
1088
|
+
what somebody came here to do is type.
|
|
1089
|
+
-->
|
|
1090
|
+
<div class="panel__kinds">
|
|
1091
|
+
${['bug', 'idea', 'praise', 'question'].map((k, i) => `<button class="kind${i === 0 ? ' kind--on' : ''}" data-kind="${k}">${k}</button>`).join('')}
|
|
1092
|
+
</div>
|
|
1093
|
+
|
|
1094
|
+
<input id="email" type="email" placeholder="Email (optional, so we can reply)" autocomplete="email" />
|
|
1095
|
+
|
|
1096
|
+
<!-- One attachment area, not two. A checkbox for the screen and a dropzone for a file were
|
|
1097
|
+
two ways to do the same thing, stacked, both dim.
|
|
1098
|
+
|
|
1099
|
+
The capture control is rendered only when it can actually do something. It used to be
|
|
1100
|
+
drawn whatever the host had configured and then ignored downstream, so ticking it was a
|
|
1101
|
+
promise nobody kept. -->
|
|
1102
|
+
<div id="drop" class="drop">
|
|
1103
1103
|
${capture.offered
|
|
1104
|
-
? `<label class="shot"><input id="shot" type="checkbox" ${capture.checked ? 'checked' : ''} /> Capture the screen</label>
|
|
1104
|
+
? `<label class="shot"><input id="shot" type="checkbox" ${capture.checked ? 'checked' : ''} /> Capture the screen</label>
|
|
1105
1105
|
<span class="drop__or">or paste, drop, or`
|
|
1106
|
-
: '<span class="drop__or">Paste, drop, or'}
|
|
1107
|
-
<input id="file" type="file" multiple accept="image/*,video/mp4,video/quicktime,video/webm" hidden />
|
|
1108
|
-
<button id="browse" class="link">choose a file</button>
|
|
1109
|
-
</span>
|
|
1110
|
-
</div>
|
|
1111
|
-
|
|
1112
|
-
<div id="files" class="files"></div>
|
|
1113
|
-
<div id="status" class="status"></div>
|
|
1114
|
-
|
|
1115
|
-
<div class="panel__foot">
|
|
1116
|
-
<span class="panel__note">Sends this page's contents, your browser, and recent errors.</span>
|
|
1117
|
-
<button id="cancel" class="ghost">Cancel</button>
|
|
1118
|
-
<button id="send" class="primary">Send</button>
|
|
1106
|
+
: '<span class="drop__or">Paste, drop, or'}
|
|
1107
|
+
<input id="file" type="file" multiple accept="image/*,video/mp4,video/quicktime,video/webm" hidden />
|
|
1108
|
+
<button id="browse" class="link">choose a file</button>
|
|
1109
|
+
</span>
|
|
1110
|
+
</div>
|
|
1111
|
+
|
|
1112
|
+
<div id="files" class="files"></div>
|
|
1113
|
+
<div id="status" class="status"></div>
|
|
1114
|
+
|
|
1115
|
+
<div class="panel__foot">
|
|
1116
|
+
<span class="panel__note">Sends this page's contents, your browser, and recent errors.</span>
|
|
1117
|
+
<button id="cancel" class="ghost">Cancel</button>
|
|
1118
|
+
<button id="send" class="primary">Send</button>
|
|
1119
1119
|
</div>`;
|
|
1120
1120
|
const files = [];
|
|
1121
1121
|
const fileList = panel.querySelector('#files');
|
|
@@ -1697,327 +1697,327 @@ export function previewLauncher(into, theme = {}) {
|
|
|
1697
1697
|
const BUTTON_STYLES = ['pill', 'pill-icon', 'icon', 'text', 'outline'];
|
|
1698
1698
|
const LIGHT = '--pm-surface: #fff; --pm-ink: #171717; --pm-muted: #525252; --pm-faint: #a3a3a3; --pm-line: #e5e5e5; --pm-line-strong: #d4d4d4; --pm-sunken: #f5f5f5; --pm-kbd: #404040; --pm-warn: #b45309; --pm-good: #047857; --pm-good-bg: #ecfdf5; --pm-good-line: #a7f3d0; --pm-accent: #171717; --pm-on-accent: #fafafa;';
|
|
1699
1699
|
const DARK = '--pm-surface: #1c1c1c; --pm-ink: #fafafa; --pm-muted: #a3a3a3; --pm-faint: #737373; --pm-line: #333; --pm-line-strong: #454545; --pm-sunken: #262626; --pm-kbd: #d4d4d4; --pm-warn: #fbbf24; --pm-good: #34d399; --pm-good-bg: #05271f; --pm-good-line: #065f46; --pm-accent: #fafafa; --pm-on-accent: #171717;';
|
|
1700
|
-
const STYLES = `
|
|
1701
|
-
/*
|
|
1702
|
-
Every colour in this file is one of these, and there are two sets of them.
|
|
1703
|
-
|
|
1704
|
-
Not for fashion: the widget is a panel laid over somebody else's page, and a white card on a dark
|
|
1705
|
-
application is a flashbang. It followed the host's scheme in exactly one respect before — it did
|
|
1706
|
-
not, and was always light.
|
|
1707
|
-
|
|
1708
|
-
System is the default and costs no JavaScript: the media query below is in the base stylesheet, so
|
|
1709
|
-
a widget nobody has configured tracks the reader's own setting. A workspace that picks light or
|
|
1710
|
-
dark gets those values written into the theme block instead, which is a later stylesheet at the
|
|
1711
|
-
same specificity and therefore wins over the query.
|
|
1712
|
-
|
|
1713
|
-
The accent pair is inverse emphasis — a dark pill on a light page, a light pill on a dark one —
|
|
1714
|
-
because the launcher sits on the HOST page rather than on our panel, and a near-black button on a
|
|
1715
|
-
near-black application is a button nobody finds. A host that sets its own accent gets white text
|
|
1716
|
-
on it, unchanged from before; we cannot compute contrast in CSS and guessing wrong is worse than
|
|
1717
|
-
the one case where a very pale brand colour needs its own care.
|
|
1718
|
-
*/
|
|
1719
|
-
:host {
|
|
1720
|
-
all: initial;
|
|
1721
|
-
|
|
1722
|
-
${LIGHT}
|
|
1723
|
-
|
|
1724
|
-
--pm-radius: 12px;
|
|
1725
|
-
|
|
1726
|
-
/* Offsets rather than a keyword: a custom property can hold a value, not a property name, so
|
|
1727
|
-
"put it on the left" has to be four numbers and not one word. */
|
|
1728
|
-
--pm-left: auto;
|
|
1729
|
-
--pm-right: 16px;
|
|
1730
|
-
--pm-top: auto;
|
|
1731
|
-
--pm-bottom: 16px;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
@media (prefers-color-scheme: dark) {
|
|
1735
|
-
:host { ${DARK} }
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
* { box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif }
|
|
1739
|
-
@media (prefers-reduced-motion: reduce) { .launcher { transition: none } }
|
|
1740
|
-
#layer { position: fixed; inset: 0; pointer-events: none }
|
|
1741
|
-
.launcher {
|
|
1742
|
-
position: fixed; pointer-events: auto;
|
|
1743
|
-
left: var(--pm-left); right: var(--pm-right);
|
|
1744
|
-
top: var(--pm-top); bottom: var(--pm-bottom);
|
|
1745
|
-
/* A back-to-top button appearing on scroll moves us; gliding reads as making room, and jumping
|
|
1746
|
-
reads as a bug. Honoured only where motion is welcome. */
|
|
1747
|
-
transition: bottom .18s ease, top .18s ease;
|
|
1748
|
-
padding: 9px 14px; border: 0; border-radius: 999px; cursor: pointer;
|
|
1749
|
-
background: var(--pm-accent); color: var(--pm-on-accent); font-size: 13px; font-weight: 500;
|
|
1750
|
-
box-shadow: 0 2px 12px rgba(0,0,0,.3);
|
|
1751
|
-
}
|
|
1752
|
-
/* Dragged to move (PM-B-0121); touch-action:none or a touch drag is claimed by page scrolling. */
|
|
1753
|
-
.launcher { touch-action: none; user-select: none }
|
|
1754
|
-
.launcher--dragging { transition: none; cursor: grabbing; box-shadow: 0 8px 24px rgba(0,0,0,.35) }
|
|
1755
|
-
.launcher:hover { filter: brightness(1.15) }
|
|
1756
|
-
.launcher--pending { cursor: default; opacity: .85 }
|
|
1757
|
-
.launcher--pending:hover { filter: none }
|
|
1758
|
-
.launcher__icon { flex: none; width: 15px; height: 15px; display: block }
|
|
1759
|
-
/* For previewLauncher: in the flow of a settings page rather than pinned to a corner. */
|
|
1760
|
-
.launcher--preview { position: static; cursor: default; opacity: 1 }
|
|
1761
|
-
|
|
1762
|
-
/*
|
|
1763
|
-
Five buttons, because one button cannot be right for every page it is a guest on.
|
|
1764
|
-
|
|
1765
|
-
A product with its own bold chat bubble does not want a second bold pill beside it; a spare
|
|
1766
|
-
documentation site does not want a filled button at all; a dense application often wants the
|
|
1767
|
-
smallest possible mark. The set is deliberately small — five things somebody can look at and
|
|
1768
|
-
choose between in a moment, rather than a colour picker and a padding field.
|
|
1769
|
-
|
|
1770
|
-
Every one of them keeps the same hit area at the same corner, so the clearance measurement and
|
|
1771
|
-
the placement work unchanged whichever is picked.
|
|
1772
|
-
*/
|
|
1773
|
-
.launcher { display: inline-flex; align-items: center; gap: 7px }
|
|
1774
|
-
|
|
1775
|
-
/* Filled and round. The default, and the one that reads as a product feature. */
|
|
1776
|
-
.launcher--pill {}
|
|
1777
|
-
|
|
1778
|
-
/* The same, with the icon in front for pages where a word alone reads as body text. */
|
|
1779
|
-
.launcher--pill-icon {}
|
|
1780
|
-
|
|
1781
|
-
/* The mark on its own, for a corner that is already busy. */
|
|
1782
|
-
.launcher--icon { padding: 10px; border-radius: 999px }
|
|
1783
|
-
|
|
1784
|
-
/* No fill at all. For a page whose own furniture is quiet and would be shouted over. */
|
|
1785
|
-
.launcher--text {
|
|
1786
|
-
background: transparent; color: var(--pm-ink); box-shadow: none;
|
|
1787
|
-
padding: 6px 8px; text-decoration: underline; text-underline-offset: 3px;
|
|
1788
|
-
}
|
|
1789
|
-
.launcher--text:hover { filter: none; color: var(--pm-accent) }
|
|
1790
|
-
|
|
1791
|
-
/* Outlined: present without being loud, and it inherits the accent rather than filling with it. */
|
|
1792
|
-
.launcher--outline {
|
|
1793
|
-
background: transparent; color: var(--pm-accent);
|
|
1794
|
-
border: 1px solid currentColor; box-shadow: none;
|
|
1795
|
-
}
|
|
1796
|
-
.launcher--outline:hover { filter: none; background: var(--pm-sunken) }
|
|
1797
|
-
.mask {
|
|
1798
|
-
position: fixed; inset: 0; pointer-events: auto; cursor: crosshair;
|
|
1799
|
-
background: rgba(23,23,23,.12);
|
|
1800
|
-
}
|
|
1801
|
-
/*
|
|
1802
|
-
The pinned element, ringed for the screenshot.
|
|
1803
|
-
|
|
1804
|
-
Three rings rather than one: a red line alone disappears against a red button, and a white one
|
|
1805
|
-
disappears against a white card. Red, then white, then a soft red — one of the three is always
|
|
1806
|
-
against something it contrasts with, on any page, without touching that page's own colours.
|
|
1807
|
-
*/
|
|
1808
|
-
.ring {
|
|
1809
|
-
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1810
|
-
border: 2px solid #ef4444;
|
|
1811
|
-
box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 0 0 5px rgba(239,68,68,.35);
|
|
1812
|
-
}
|
|
1813
|
-
/* The number, on the ring's corner so it never covers what the ring is about. */
|
|
1814
|
-
.ring__n, .marker__n {
|
|
1815
|
-
position: absolute; top: -11px; left: -11px; min-width: 20px; height: 20px; padding: 0 5px;
|
|
1816
|
-
border-radius: 10px; background: #ef4444; color: #fff; border: 2px solid #fff;
|
|
1817
|
-
font: 600 11px/16px system-ui, sans-serif; text-align: center; box-sizing: border-box;
|
|
1818
|
-
}
|
|
1819
|
-
/* What a click would pin, while picking. Dashed, so it reads as "this one?" rather than "pinned". */
|
|
1820
|
-
.hover {
|
|
1821
|
-
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1822
|
-
outline: 2px dashed #ef4444; outline-offset: 2px; background: rgba(239,68,68,.06);
|
|
1823
|
-
}
|
|
1824
|
-
/* A pin already made, while the composer is open. */
|
|
1825
|
-
.marker {
|
|
1826
|
-
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1827
|
-
border: 2px solid #ef4444; box-shadow: 0 0 0 2px rgba(255,255,255,.85);
|
|
1828
|
-
}
|
|
1829
|
-
/*
|
|
1830
|
-
A blur (PM-T-0682): the reporter's, on the page while they write and in the picture after.
|
|
1831
|
-
|
|
1832
|
-
A backdrop filter, so it blurs what is painted under it and touches nothing of the host's. The grey
|
|
1833
|
-
tint and the hairline make it read as a cover rather than as a page that failed to render. Neutral,
|
|
1834
|
-
not red: red on this layer means "this is what the report is about", and a blur means the opposite.
|
|
1835
|
-
*/
|
|
1836
|
-
.veil {
|
|
1837
|
-
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1838
|
-
-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
|
|
1839
|
-
background: rgba(115,115,115,.35);
|
|
1840
|
-
box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 0 0 1px rgba(23,23,23,.3);
|
|
1841
|
-
}
|
|
1842
|
-
/*
|
|
1843
|
-
Solid where nothing can be blurred behind an element: a cover that shows what it covers is worse
|
|
1844
|
-
than a grey box. That is Firefox before 103 and Chrome before 76, which say so.
|
|
1845
|
-
|
|
1846
|
-
One engine has been seen to claim it and not draw it — WebKit's Windows port, which no shipping
|
|
1847
|
-
browser uses — and the preview there is a tint over legible text. It has no getDisplayMedia, so it
|
|
1848
|
-
never takes a picture; the snapshot does not depend on any of this; and an element blur is also
|
|
1849
|
-
blurred on the element itself for the frame (screenshot.ts). Checked drawing in Chromium.
|
|
1850
|
-
*/
|
|
1851
|
-
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
1852
|
-
.veil { background: #8a8a8a }
|
|
1853
|
-
}
|
|
1854
|
-
/* Over a credential the capture found: solid, because a blurred key of a known shape can sometimes be
|
|
1855
|
-
read back, and nobody needs its shape to understand the report. */
|
|
1856
|
-
.veil--secret { background: #737373; box-shadow: none; border-radius: 2px }
|
|
1857
|
-
.veil__tag {
|
|
1858
|
-
position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 4px;
|
|
1859
|
-
background: rgba(23,23,23,.72); color: #fff; font: 600 10px/16px system-ui, sans-serif;
|
|
1860
|
-
white-space: nowrap;
|
|
1861
|
-
}
|
|
1862
|
-
/* What a click would blur, blurred already: the reporter sees the result before committing to it. */
|
|
1863
|
-
.hover--blur {
|
|
1864
|
-
outline-color: #525252;
|
|
1865
|
-
-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
|
|
1866
|
-
background: rgba(115,115,115,.25);
|
|
1867
|
-
}
|
|
1868
|
-
/* A touch drag draws the area rather than scrolling the page underneath it. */
|
|
1869
|
-
.mask--blur { touch-action: none }
|
|
1870
|
-
/*
|
|
1871
|
-
Bottom, not top.
|
|
1872
|
-
|
|
1873
|
-
At top:16px this landed on whatever the host puts at the top centre of their page — a logo, a
|
|
1874
|
-
nav bar, a search field. We are a guest here and we do not know what is up there; on our own app
|
|
1875
|
-
it covered the project switcher. The bottom centre is beside the launcher the reporter just
|
|
1876
|
-
clicked, which is space the widget already owns, and it keeps their eyes near the thing they are
|
|
1877
|
-
about to point at rather than sending them to the far edge of the screen and back.
|
|
1878
|
-
*/
|
|
1879
|
-
.hint {
|
|
1880
|
-
position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
|
|
1881
|
-
padding: 7px 12px; border-radius: 8px; background: var(--pm-ink); color: var(--pm-on-accent);
|
|
1882
|
-
font-size: 12px; white-space: nowrap;
|
|
1883
|
-
}
|
|
1884
|
-
kbd {
|
|
1885
|
-
padding: 1px 5px; border-radius: 4px; background: var(--pm-kbd); color: var(--pm-surface);
|
|
1886
|
-
font-family: ui-monospace, monospace; font-size: 11px;
|
|
1887
|
-
}
|
|
1888
|
-
.panel {
|
|
1889
|
-
position: fixed; width: 380px; max-width: calc(100vw - 32px); pointer-events: auto;
|
|
1890
|
-
left: var(--pm-left); right: var(--pm-right);
|
|
1891
|
-
top: var(--pm-top); bottom: var(--pm-bottom);
|
|
1892
|
-
padding: 16px; border-radius: var(--pm-radius); background: var(--pm-surface); color: var(--pm-ink);
|
|
1893
|
-
box-shadow: 0 8px 32px rgba(0,0,0,.24); font-size: 13px;
|
|
1894
|
-
}
|
|
1895
|
-
.panel__head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px }
|
|
1896
|
-
.panel__heading { min-width: 0 }
|
|
1897
|
-
.panel__title { font-weight: 600; font-size: 14px }
|
|
1898
|
-
|
|
1899
|
-
/*
|
|
1900
|
-
The header is the handle.
|
|
1901
|
-
|
|
1902
|
-
A 380px panel sits over the page somebody is reporting a problem with, and reading what is under
|
|
1903
|
-
it used to mean closing the widget and losing what had been written. touch-action:none because a
|
|
1904
|
-
drag on a touch screen is otherwise claimed by the page's own scrolling before we see it.
|
|
1905
|
-
*/
|
|
1906
|
-
.drag { cursor: grab; touch-action: none; user-select: none }
|
|
1907
|
-
.drag:active { cursor: grabbing }
|
|
1908
|
-
.panel__grip { flex: none; color: var(--pm-faint); font-size: 15px; line-height: 16px; letter-spacing: -1px }
|
|
1909
|
-
.drag:hover .panel__grip { color: var(--pm-muted) }
|
|
1910
|
-
.panel--dragging { box-shadow: 0 16px 48px rgba(0,0,0,.32); opacity: .92 }
|
|
1911
|
-
|
|
1912
|
-
/* An incomplete report, said plainly. Amber rather than red: the words arrived. */
|
|
1913
|
-
.sent__warn { margin-top: 6px; color: var(--pm-warn); font-size: 11px; line-height: 1.4 }
|
|
1914
|
-
|
|
1915
|
-
/* The anchor leads: it is what the reporter pointed at, and the part they need to recognise. */
|
|
1916
|
-
.pins { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; }
|
|
1917
|
-
.pin { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--pm-ink); }
|
|
1918
|
-
.pin__n {
|
|
1919
|
-
flex: none; min-width: 18px; height: 18px; border-radius: 9px; background: #ef4444; color: #fff;
|
|
1920
|
-
font: 600 11px/18px system-ui, sans-serif; text-align: center;
|
|
1921
|
-
}
|
|
1922
|
-
.pin__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1923
|
-
.pin__n--blur { background: #737373 }
|
|
1924
|
-
.pins__actions { display: flex; flex-wrap: wrap; gap: 4px 14px }
|
|
1925
|
-
.pins__add { align-self: flex-start; font-size: 12px; }
|
|
1926
|
-
.panel__anchor {
|
|
1927
|
-
color: var(--pm-muted); font-size: 11px;
|
|
1928
|
-
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
1929
|
-
}
|
|
1930
|
-
.panel__close {
|
|
1931
|
-
margin-left: auto; border: 0; background: none; cursor: pointer;
|
|
1932
|
-
color: var(--pm-faint); font-size: 20px; line-height: 1; padding: 0 2px;
|
|
1933
|
-
}
|
|
1934
|
-
.panel__close:hover { color: var(--pm-ink) }
|
|
1935
|
-
|
|
1936
|
-
/* A confirmation, not a form. */
|
|
1937
|
-
.panel--sent { display: flex; align-items: flex-start; gap: 10px }
|
|
1938
|
-
.sent__tick {
|
|
1939
|
-
flex: none; width: 24px; height: 24px; border-radius: 999px;
|
|
1940
|
-
background: var(--pm-good-bg); color: var(--pm-good);
|
|
1941
|
-
display: grid; place-items: center; font-size: 14px;
|
|
1942
|
-
}
|
|
1943
|
-
.sent__body { min-width: 0 }
|
|
1944
|
-
|
|
1945
|
-
/* The reference on its own line, at its own weight: it is the one thing here to take away. */
|
|
1946
|
-
.sent__ref { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px }
|
|
1947
|
-
.sent__id {
|
|
1948
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
|
|
1949
|
-
color: var(--pm-ink); background: var(--pm-sunken); border-radius: 5px; padding: 2px 6px;
|
|
1950
|
-
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
1951
|
-
}
|
|
1952
|
-
.sent__copy {
|
|
1953
|
-
flex: none; border: 1px solid var(--pm-line); border-radius: 6px; background: var(--pm-surface);
|
|
1954
|
-
color: var(--pm-muted); cursor: pointer; font-size: 11px; padding: 3px 8px;
|
|
1955
|
-
}
|
|
1956
|
-
.sent__copy:hover { border-color: var(--pm-faint); color: var(--pm-ink) }
|
|
1957
|
-
.sent__copy--done { border-color: var(--pm-good-line); background: var(--pm-good-bg); color: var(--pm-good) }
|
|
1958
|
-
|
|
1959
|
-
.panel__kinds { display: flex; gap: 6px; margin: 8px 0 }
|
|
1960
|
-
.kind {
|
|
1961
|
-
flex: 1; padding: 5px 0; border: 1px solid var(--pm-line); border-radius: 7px;
|
|
1962
|
-
background: var(--pm-surface); color: var(--pm-muted); cursor: pointer; font-size: 12px; text-transform: capitalize;
|
|
1963
|
-
}
|
|
1964
|
-
.kind--on { border-color: var(--pm-ink); background: var(--pm-ink); color: var(--pm-surface) }
|
|
1965
|
-
textarea, input[type=email] {
|
|
1966
|
-
width: 100%; padding: 8px; margin-bottom: 8px; border: 1px solid var(--pm-line);
|
|
1967
|
-
border-radius: 8px; font-size: 13px; resize: vertical; color: var(--pm-ink); background: var(--pm-surface);
|
|
1968
|
-
}
|
|
1969
|
-
textarea:focus, input:focus { outline: 2px solid var(--pm-ink); outline-offset: -1px }
|
|
1970
|
-
|
|
1971
|
-
/*
|
|
1972
|
-
* Sixteen pixels on a touch device, or iOS zooms the host page.
|
|
1973
|
-
*
|
|
1974
|
-
* Safari zooms in whenever a focused field's text is under 16px and never zooms back out. At 13px
|
|
1975
|
-
* that happened the moment somebody tapped the message box — so the act of reporting a bug left
|
|
1976
|
-
* the reporter's view of OUR CUSTOMER's site magnified and scrolled sideways, which is a rude
|
|
1977
|
-
* thing for an embedded widget to do to the page hosting it.
|
|
1978
|
-
*
|
|
1979
|
-
* The widget cannot fix this with a viewport meta even if that were acceptable: the meta belongs
|
|
1980
|
-
* to the host page and is not ours to touch. Making the text big enough is the only move
|
|
1981
|
-
* available, and it is the right one anyway.
|
|
1982
|
-
*/
|
|
1983
|
-
@media (pointer: coarse) {
|
|
1984
|
-
textarea, input[type=email] { font-size: 16px }
|
|
1985
|
-
}
|
|
1986
|
-
.shot { display: flex; align-items: center; gap: 6px; color: var(--pm-muted); font-size: 12px }
|
|
1987
|
-
|
|
1988
|
-
/*
|
|
1989
|
-
One row. Cancel used to sit ABOVE Send in a stacked span, which read as a label for it rather than
|
|
1990
|
-
an alternative to it — and put the escape hatch further from the thumb than the commit.
|
|
1991
|
-
*/
|
|
1992
|
-
.panel__foot {
|
|
1993
|
-
display: flex; align-items: center; gap: 8px; margin-top: 12px;
|
|
1994
|
-
padding-top: 12px; border-top: 1px solid var(--pm-sunken);
|
|
1995
|
-
}
|
|
1996
|
-
.panel__note { flex: 1; color: var(--pm-faint); font-size: 10px; line-height: 1.3 }
|
|
1997
|
-
.primary, .ghost {
|
|
1998
|
-
padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 500;
|
|
1999
|
-
}
|
|
2000
|
-
.primary { border: 0; background: var(--pm-ink); color: var(--pm-surface) }
|
|
2001
|
-
.primary:disabled { opacity: .5; cursor: default }
|
|
2002
|
-
.ghost { border: 0; background: transparent; color: var(--pm-muted) }
|
|
2003
|
-
.status { margin-top: 6px; color: var(--pm-warn); font-size: 11px; min-height: 0 }
|
|
2004
|
-
/*
|
|
2005
|
-
One attachment area, holding both ways of adding a picture. They were a checkbox and a dropzone
|
|
2006
|
-
stacked — two affordances for one job, and together the busiest part of a panel whose busiest part
|
|
2007
|
-
should be the message.
|
|
2008
|
-
*/
|
|
2009
|
-
.drop {
|
|
2010
|
-
display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
|
2011
|
-
margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--pm-line-strong); border-radius: 8px;
|
|
2012
|
-
color: var(--pm-faint); font-size: 11px;
|
|
2013
|
-
}
|
|
2014
|
-
.drop__or { color: var(--pm-faint) }
|
|
2015
|
-
.drop--over { border-color: var(--pm-ink); color: var(--pm-ink); background: var(--pm-sunken) }
|
|
2016
|
-
.files { display: flex; flex-direction: column; gap: 4px; margin-top: 8px }
|
|
2017
|
-
.file { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--pm-muted) }
|
|
2018
|
-
.file--bad { color: var(--pm-warn) }
|
|
2019
|
-
.file img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px }
|
|
2020
|
-
.file__icon { width: 28px; text-align: center }
|
|
2021
|
-
.file__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
|
|
2022
|
-
.link { border: 0; background: transparent; color: var(--pm-muted); cursor: pointer; font-size: 11px; text-decoration: underline }
|
|
1700
|
+
const STYLES = `
|
|
1701
|
+
/*
|
|
1702
|
+
Every colour in this file is one of these, and there are two sets of them.
|
|
1703
|
+
|
|
1704
|
+
Not for fashion: the widget is a panel laid over somebody else's page, and a white card on a dark
|
|
1705
|
+
application is a flashbang. It followed the host's scheme in exactly one respect before — it did
|
|
1706
|
+
not, and was always light.
|
|
1707
|
+
|
|
1708
|
+
System is the default and costs no JavaScript: the media query below is in the base stylesheet, so
|
|
1709
|
+
a widget nobody has configured tracks the reader's own setting. A workspace that picks light or
|
|
1710
|
+
dark gets those values written into the theme block instead, which is a later stylesheet at the
|
|
1711
|
+
same specificity and therefore wins over the query.
|
|
1712
|
+
|
|
1713
|
+
The accent pair is inverse emphasis — a dark pill on a light page, a light pill on a dark one —
|
|
1714
|
+
because the launcher sits on the HOST page rather than on our panel, and a near-black button on a
|
|
1715
|
+
near-black application is a button nobody finds. A host that sets its own accent gets white text
|
|
1716
|
+
on it, unchanged from before; we cannot compute contrast in CSS and guessing wrong is worse than
|
|
1717
|
+
the one case where a very pale brand colour needs its own care.
|
|
1718
|
+
*/
|
|
1719
|
+
:host {
|
|
1720
|
+
all: initial;
|
|
1721
|
+
|
|
1722
|
+
${LIGHT}
|
|
1723
|
+
|
|
1724
|
+
--pm-radius: 12px;
|
|
1725
|
+
|
|
1726
|
+
/* Offsets rather than a keyword: a custom property can hold a value, not a property name, so
|
|
1727
|
+
"put it on the left" has to be four numbers and not one word. */
|
|
1728
|
+
--pm-left: auto;
|
|
1729
|
+
--pm-right: 16px;
|
|
1730
|
+
--pm-top: auto;
|
|
1731
|
+
--pm-bottom: 16px;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
@media (prefers-color-scheme: dark) {
|
|
1735
|
+
:host { ${DARK} }
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
* { box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif }
|
|
1739
|
+
@media (prefers-reduced-motion: reduce) { .launcher { transition: none } }
|
|
1740
|
+
#layer { position: fixed; inset: 0; pointer-events: none }
|
|
1741
|
+
.launcher {
|
|
1742
|
+
position: fixed; pointer-events: auto;
|
|
1743
|
+
left: var(--pm-left); right: var(--pm-right);
|
|
1744
|
+
top: var(--pm-top); bottom: var(--pm-bottom);
|
|
1745
|
+
/* A back-to-top button appearing on scroll moves us; gliding reads as making room, and jumping
|
|
1746
|
+
reads as a bug. Honoured only where motion is welcome. */
|
|
1747
|
+
transition: bottom .18s ease, top .18s ease;
|
|
1748
|
+
padding: 9px 14px; border: 0; border-radius: 999px; cursor: pointer;
|
|
1749
|
+
background: var(--pm-accent); color: var(--pm-on-accent); font-size: 13px; font-weight: 500;
|
|
1750
|
+
box-shadow: 0 2px 12px rgba(0,0,0,.3);
|
|
1751
|
+
}
|
|
1752
|
+
/* Dragged to move (PM-B-0121); touch-action:none or a touch drag is claimed by page scrolling. */
|
|
1753
|
+
.launcher { touch-action: none; user-select: none }
|
|
1754
|
+
.launcher--dragging { transition: none; cursor: grabbing; box-shadow: 0 8px 24px rgba(0,0,0,.35) }
|
|
1755
|
+
.launcher:hover { filter: brightness(1.15) }
|
|
1756
|
+
.launcher--pending { cursor: default; opacity: .85 }
|
|
1757
|
+
.launcher--pending:hover { filter: none }
|
|
1758
|
+
.launcher__icon { flex: none; width: 15px; height: 15px; display: block }
|
|
1759
|
+
/* For previewLauncher: in the flow of a settings page rather than pinned to a corner. */
|
|
1760
|
+
.launcher--preview { position: static; cursor: default; opacity: 1 }
|
|
1761
|
+
|
|
1762
|
+
/*
|
|
1763
|
+
Five buttons, because one button cannot be right for every page it is a guest on.
|
|
1764
|
+
|
|
1765
|
+
A product with its own bold chat bubble does not want a second bold pill beside it; a spare
|
|
1766
|
+
documentation site does not want a filled button at all; a dense application often wants the
|
|
1767
|
+
smallest possible mark. The set is deliberately small — five things somebody can look at and
|
|
1768
|
+
choose between in a moment, rather than a colour picker and a padding field.
|
|
1769
|
+
|
|
1770
|
+
Every one of them keeps the same hit area at the same corner, so the clearance measurement and
|
|
1771
|
+
the placement work unchanged whichever is picked.
|
|
1772
|
+
*/
|
|
1773
|
+
.launcher { display: inline-flex; align-items: center; gap: 7px }
|
|
1774
|
+
|
|
1775
|
+
/* Filled and round. The default, and the one that reads as a product feature. */
|
|
1776
|
+
.launcher--pill {}
|
|
1777
|
+
|
|
1778
|
+
/* The same, with the icon in front for pages where a word alone reads as body text. */
|
|
1779
|
+
.launcher--pill-icon {}
|
|
1780
|
+
|
|
1781
|
+
/* The mark on its own, for a corner that is already busy. */
|
|
1782
|
+
.launcher--icon { padding: 10px; border-radius: 999px }
|
|
1783
|
+
|
|
1784
|
+
/* No fill at all. For a page whose own furniture is quiet and would be shouted over. */
|
|
1785
|
+
.launcher--text {
|
|
1786
|
+
background: transparent; color: var(--pm-ink); box-shadow: none;
|
|
1787
|
+
padding: 6px 8px; text-decoration: underline; text-underline-offset: 3px;
|
|
1788
|
+
}
|
|
1789
|
+
.launcher--text:hover { filter: none; color: var(--pm-accent) }
|
|
1790
|
+
|
|
1791
|
+
/* Outlined: present without being loud, and it inherits the accent rather than filling with it. */
|
|
1792
|
+
.launcher--outline {
|
|
1793
|
+
background: transparent; color: var(--pm-accent);
|
|
1794
|
+
border: 1px solid currentColor; box-shadow: none;
|
|
1795
|
+
}
|
|
1796
|
+
.launcher--outline:hover { filter: none; background: var(--pm-sunken) }
|
|
1797
|
+
.mask {
|
|
1798
|
+
position: fixed; inset: 0; pointer-events: auto; cursor: crosshair;
|
|
1799
|
+
background: rgba(23,23,23,.12);
|
|
1800
|
+
}
|
|
1801
|
+
/*
|
|
1802
|
+
The pinned element, ringed for the screenshot.
|
|
1803
|
+
|
|
1804
|
+
Three rings rather than one: a red line alone disappears against a red button, and a white one
|
|
1805
|
+
disappears against a white card. Red, then white, then a soft red — one of the three is always
|
|
1806
|
+
against something it contrasts with, on any page, without touching that page's own colours.
|
|
1807
|
+
*/
|
|
1808
|
+
.ring {
|
|
1809
|
+
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1810
|
+
border: 2px solid #ef4444;
|
|
1811
|
+
box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 0 0 5px rgba(239,68,68,.35);
|
|
1812
|
+
}
|
|
1813
|
+
/* The number, on the ring's corner so it never covers what the ring is about. */
|
|
1814
|
+
.ring__n, .marker__n {
|
|
1815
|
+
position: absolute; top: -11px; left: -11px; min-width: 20px; height: 20px; padding: 0 5px;
|
|
1816
|
+
border-radius: 10px; background: #ef4444; color: #fff; border: 2px solid #fff;
|
|
1817
|
+
font: 600 11px/16px system-ui, sans-serif; text-align: center; box-sizing: border-box;
|
|
1818
|
+
}
|
|
1819
|
+
/* What a click would pin, while picking. Dashed, so it reads as "this one?" rather than "pinned". */
|
|
1820
|
+
.hover {
|
|
1821
|
+
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1822
|
+
outline: 2px dashed #ef4444; outline-offset: 2px; background: rgba(239,68,68,.06);
|
|
1823
|
+
}
|
|
1824
|
+
/* A pin already made, while the composer is open. */
|
|
1825
|
+
.marker {
|
|
1826
|
+
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1827
|
+
border: 2px solid #ef4444; box-shadow: 0 0 0 2px rgba(255,255,255,.85);
|
|
1828
|
+
}
|
|
1829
|
+
/*
|
|
1830
|
+
A blur (PM-T-0682): the reporter's, on the page while they write and in the picture after.
|
|
1831
|
+
|
|
1832
|
+
A backdrop filter, so it blurs what is painted under it and touches nothing of the host's. The grey
|
|
1833
|
+
tint and the hairline make it read as a cover rather than as a page that failed to render. Neutral,
|
|
1834
|
+
not red: red on this layer means "this is what the report is about", and a blur means the opposite.
|
|
1835
|
+
*/
|
|
1836
|
+
.veil {
|
|
1837
|
+
position: fixed; pointer-events: none; border-radius: 3px;
|
|
1838
|
+
-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
|
|
1839
|
+
background: rgba(115,115,115,.35);
|
|
1840
|
+
box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 0 0 1px rgba(23,23,23,.3);
|
|
1841
|
+
}
|
|
1842
|
+
/*
|
|
1843
|
+
Solid where nothing can be blurred behind an element: a cover that shows what it covers is worse
|
|
1844
|
+
than a grey box. That is Firefox before 103 and Chrome before 76, which say so.
|
|
1845
|
+
|
|
1846
|
+
One engine has been seen to claim it and not draw it — WebKit's Windows port, which no shipping
|
|
1847
|
+
browser uses — and the preview there is a tint over legible text. It has no getDisplayMedia, so it
|
|
1848
|
+
never takes a picture; the snapshot does not depend on any of this; and an element blur is also
|
|
1849
|
+
blurred on the element itself for the frame (screenshot.ts). Checked drawing in Chromium.
|
|
1850
|
+
*/
|
|
1851
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
1852
|
+
.veil { background: #8a8a8a }
|
|
1853
|
+
}
|
|
1854
|
+
/* Over a credential the capture found: solid, because a blurred key of a known shape can sometimes be
|
|
1855
|
+
read back, and nobody needs its shape to understand the report. */
|
|
1856
|
+
.veil--secret { background: #737373; box-shadow: none; border-radius: 2px }
|
|
1857
|
+
.veil__tag {
|
|
1858
|
+
position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 4px;
|
|
1859
|
+
background: rgba(23,23,23,.72); color: #fff; font: 600 10px/16px system-ui, sans-serif;
|
|
1860
|
+
white-space: nowrap;
|
|
1861
|
+
}
|
|
1862
|
+
/* What a click would blur, blurred already: the reporter sees the result before committing to it. */
|
|
1863
|
+
.hover--blur {
|
|
1864
|
+
outline-color: #525252;
|
|
1865
|
+
-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
|
|
1866
|
+
background: rgba(115,115,115,.25);
|
|
1867
|
+
}
|
|
1868
|
+
/* A touch drag draws the area rather than scrolling the page underneath it. */
|
|
1869
|
+
.mask--blur { touch-action: none }
|
|
1870
|
+
/*
|
|
1871
|
+
Bottom, not top.
|
|
1872
|
+
|
|
1873
|
+
At top:16px this landed on whatever the host puts at the top centre of their page — a logo, a
|
|
1874
|
+
nav bar, a search field. We are a guest here and we do not know what is up there; on our own app
|
|
1875
|
+
it covered the project switcher. The bottom centre is beside the launcher the reporter just
|
|
1876
|
+
clicked, which is space the widget already owns, and it keeps their eyes near the thing they are
|
|
1877
|
+
about to point at rather than sending them to the far edge of the screen and back.
|
|
1878
|
+
*/
|
|
1879
|
+
.hint {
|
|
1880
|
+
position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
|
|
1881
|
+
padding: 7px 12px; border-radius: 8px; background: var(--pm-ink); color: var(--pm-on-accent);
|
|
1882
|
+
font-size: 12px; white-space: nowrap;
|
|
1883
|
+
}
|
|
1884
|
+
kbd {
|
|
1885
|
+
padding: 1px 5px; border-radius: 4px; background: var(--pm-kbd); color: var(--pm-surface);
|
|
1886
|
+
font-family: ui-monospace, monospace; font-size: 11px;
|
|
1887
|
+
}
|
|
1888
|
+
.panel {
|
|
1889
|
+
position: fixed; width: 380px; max-width: calc(100vw - 32px); pointer-events: auto;
|
|
1890
|
+
left: var(--pm-left); right: var(--pm-right);
|
|
1891
|
+
top: var(--pm-top); bottom: var(--pm-bottom);
|
|
1892
|
+
padding: 16px; border-radius: var(--pm-radius); background: var(--pm-surface); color: var(--pm-ink);
|
|
1893
|
+
box-shadow: 0 8px 32px rgba(0,0,0,.24); font-size: 13px;
|
|
1894
|
+
}
|
|
1895
|
+
.panel__head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px }
|
|
1896
|
+
.panel__heading { min-width: 0 }
|
|
1897
|
+
.panel__title { font-weight: 600; font-size: 14px }
|
|
1898
|
+
|
|
1899
|
+
/*
|
|
1900
|
+
The header is the handle.
|
|
1901
|
+
|
|
1902
|
+
A 380px panel sits over the page somebody is reporting a problem with, and reading what is under
|
|
1903
|
+
it used to mean closing the widget and losing what had been written. touch-action:none because a
|
|
1904
|
+
drag on a touch screen is otherwise claimed by the page's own scrolling before we see it.
|
|
1905
|
+
*/
|
|
1906
|
+
.drag { cursor: grab; touch-action: none; user-select: none }
|
|
1907
|
+
.drag:active { cursor: grabbing }
|
|
1908
|
+
.panel__grip { flex: none; color: var(--pm-faint); font-size: 15px; line-height: 16px; letter-spacing: -1px }
|
|
1909
|
+
.drag:hover .panel__grip { color: var(--pm-muted) }
|
|
1910
|
+
.panel--dragging { box-shadow: 0 16px 48px rgba(0,0,0,.32); opacity: .92 }
|
|
1911
|
+
|
|
1912
|
+
/* An incomplete report, said plainly. Amber rather than red: the words arrived. */
|
|
1913
|
+
.sent__warn { margin-top: 6px; color: var(--pm-warn); font-size: 11px; line-height: 1.4 }
|
|
1914
|
+
|
|
1915
|
+
/* The anchor leads: it is what the reporter pointed at, and the part they need to recognise. */
|
|
1916
|
+
.pins { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; }
|
|
1917
|
+
.pin { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--pm-ink); }
|
|
1918
|
+
.pin__n {
|
|
1919
|
+
flex: none; min-width: 18px; height: 18px; border-radius: 9px; background: #ef4444; color: #fff;
|
|
1920
|
+
font: 600 11px/18px system-ui, sans-serif; text-align: center;
|
|
1921
|
+
}
|
|
1922
|
+
.pin__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1923
|
+
.pin__n--blur { background: #737373 }
|
|
1924
|
+
.pins__actions { display: flex; flex-wrap: wrap; gap: 4px 14px }
|
|
1925
|
+
.pins__add { align-self: flex-start; font-size: 12px; }
|
|
1926
|
+
.panel__anchor {
|
|
1927
|
+
color: var(--pm-muted); font-size: 11px;
|
|
1928
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
1929
|
+
}
|
|
1930
|
+
.panel__close {
|
|
1931
|
+
margin-left: auto; border: 0; background: none; cursor: pointer;
|
|
1932
|
+
color: var(--pm-faint); font-size: 20px; line-height: 1; padding: 0 2px;
|
|
1933
|
+
}
|
|
1934
|
+
.panel__close:hover { color: var(--pm-ink) }
|
|
1935
|
+
|
|
1936
|
+
/* A confirmation, not a form. */
|
|
1937
|
+
.panel--sent { display: flex; align-items: flex-start; gap: 10px }
|
|
1938
|
+
.sent__tick {
|
|
1939
|
+
flex: none; width: 24px; height: 24px; border-radius: 999px;
|
|
1940
|
+
background: var(--pm-good-bg); color: var(--pm-good);
|
|
1941
|
+
display: grid; place-items: center; font-size: 14px;
|
|
1942
|
+
}
|
|
1943
|
+
.sent__body { min-width: 0 }
|
|
1944
|
+
|
|
1945
|
+
/* The reference on its own line, at its own weight: it is the one thing here to take away. */
|
|
1946
|
+
.sent__ref { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px }
|
|
1947
|
+
.sent__id {
|
|
1948
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
|
|
1949
|
+
color: var(--pm-ink); background: var(--pm-sunken); border-radius: 5px; padding: 2px 6px;
|
|
1950
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
1951
|
+
}
|
|
1952
|
+
.sent__copy {
|
|
1953
|
+
flex: none; border: 1px solid var(--pm-line); border-radius: 6px; background: var(--pm-surface);
|
|
1954
|
+
color: var(--pm-muted); cursor: pointer; font-size: 11px; padding: 3px 8px;
|
|
1955
|
+
}
|
|
1956
|
+
.sent__copy:hover { border-color: var(--pm-faint); color: var(--pm-ink) }
|
|
1957
|
+
.sent__copy--done { border-color: var(--pm-good-line); background: var(--pm-good-bg); color: var(--pm-good) }
|
|
1958
|
+
|
|
1959
|
+
.panel__kinds { display: flex; gap: 6px; margin: 8px 0 }
|
|
1960
|
+
.kind {
|
|
1961
|
+
flex: 1; padding: 5px 0; border: 1px solid var(--pm-line); border-radius: 7px;
|
|
1962
|
+
background: var(--pm-surface); color: var(--pm-muted); cursor: pointer; font-size: 12px; text-transform: capitalize;
|
|
1963
|
+
}
|
|
1964
|
+
.kind--on { border-color: var(--pm-ink); background: var(--pm-ink); color: var(--pm-surface) }
|
|
1965
|
+
textarea, input[type=email] {
|
|
1966
|
+
width: 100%; padding: 8px; margin-bottom: 8px; border: 1px solid var(--pm-line);
|
|
1967
|
+
border-radius: 8px; font-size: 13px; resize: vertical; color: var(--pm-ink); background: var(--pm-surface);
|
|
1968
|
+
}
|
|
1969
|
+
textarea:focus, input:focus { outline: 2px solid var(--pm-ink); outline-offset: -1px }
|
|
1970
|
+
|
|
1971
|
+
/*
|
|
1972
|
+
* Sixteen pixels on a touch device, or iOS zooms the host page.
|
|
1973
|
+
*
|
|
1974
|
+
* Safari zooms in whenever a focused field's text is under 16px and never zooms back out. At 13px
|
|
1975
|
+
* that happened the moment somebody tapped the message box — so the act of reporting a bug left
|
|
1976
|
+
* the reporter's view of OUR CUSTOMER's site magnified and scrolled sideways, which is a rude
|
|
1977
|
+
* thing for an embedded widget to do to the page hosting it.
|
|
1978
|
+
*
|
|
1979
|
+
* The widget cannot fix this with a viewport meta even if that were acceptable: the meta belongs
|
|
1980
|
+
* to the host page and is not ours to touch. Making the text big enough is the only move
|
|
1981
|
+
* available, and it is the right one anyway.
|
|
1982
|
+
*/
|
|
1983
|
+
@media (pointer: coarse) {
|
|
1984
|
+
textarea, input[type=email] { font-size: 16px }
|
|
1985
|
+
}
|
|
1986
|
+
.shot { display: flex; align-items: center; gap: 6px; color: var(--pm-muted); font-size: 12px }
|
|
1987
|
+
|
|
1988
|
+
/*
|
|
1989
|
+
One row. Cancel used to sit ABOVE Send in a stacked span, which read as a label for it rather than
|
|
1990
|
+
an alternative to it — and put the escape hatch further from the thumb than the commit.
|
|
1991
|
+
*/
|
|
1992
|
+
.panel__foot {
|
|
1993
|
+
display: flex; align-items: center; gap: 8px; margin-top: 12px;
|
|
1994
|
+
padding-top: 12px; border-top: 1px solid var(--pm-sunken);
|
|
1995
|
+
}
|
|
1996
|
+
.panel__note { flex: 1; color: var(--pm-faint); font-size: 10px; line-height: 1.3 }
|
|
1997
|
+
.primary, .ghost {
|
|
1998
|
+
padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 500;
|
|
1999
|
+
}
|
|
2000
|
+
.primary { border: 0; background: var(--pm-ink); color: var(--pm-surface) }
|
|
2001
|
+
.primary:disabled { opacity: .5; cursor: default }
|
|
2002
|
+
.ghost { border: 0; background: transparent; color: var(--pm-muted) }
|
|
2003
|
+
.status { margin-top: 6px; color: var(--pm-warn); font-size: 11px; min-height: 0 }
|
|
2004
|
+
/*
|
|
2005
|
+
One attachment area, holding both ways of adding a picture. They were a checkbox and a dropzone
|
|
2006
|
+
stacked — two affordances for one job, and together the busiest part of a panel whose busiest part
|
|
2007
|
+
should be the message.
|
|
2008
|
+
*/
|
|
2009
|
+
.drop {
|
|
2010
|
+
display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
|
2011
|
+
margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--pm-line-strong); border-radius: 8px;
|
|
2012
|
+
color: var(--pm-faint); font-size: 11px;
|
|
2013
|
+
}
|
|
2014
|
+
.drop__or { color: var(--pm-faint) }
|
|
2015
|
+
.drop--over { border-color: var(--pm-ink); color: var(--pm-ink); background: var(--pm-sunken) }
|
|
2016
|
+
.files { display: flex; flex-direction: column; gap: 4px; margin-top: 8px }
|
|
2017
|
+
.file { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--pm-muted) }
|
|
2018
|
+
.file--bad { color: var(--pm-warn) }
|
|
2019
|
+
.file img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px }
|
|
2020
|
+
.file__icon { width: 28px; text-align: center }
|
|
2021
|
+
.file__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
|
|
2022
|
+
.link { border: 0; background: transparent; color: var(--pm-muted); cursor: pointer; font-size: 11px; text-decoration: underline }
|
|
2023
2023
|
`;
|