vite-plugin-specter 0.3.2 → 0.3.4
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/dist/client.js +11 -14
- package/dist/extension-chrome/background.js +4 -0
- package/dist/extension-chrome/content.js +982 -0
- package/dist/extension-chrome/icons/icon128.png +0 -0
- package/dist/extension-chrome/icons/icon16.png +0 -0
- package/dist/extension-chrome/icons/icon32.png +0 -0
- package/dist/extension-chrome/icons/icon48.png +0 -0
- package/dist/extension-chrome/manifest.json +38 -0
- package/dist/extension-firefox/content.js +11 -14
- package/dist/extension-firefox/manifest.json +8 -2
- package/dist/index.cjs +11 -14
- package/dist/index.js +11 -14
- package/extension/background.js +1 -5
- package/extension/content.js +11 -14
- package/extension/manifest.firefox.json +21 -7
- package/extension/manifest.json +8 -6
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -273,17 +273,11 @@
|
|
|
273
273
|
return { hex: toHex(m[1], m[2], m[3]), alpha: m[4] !== undefined ? parseFloat(m[4]) : 1 };
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
function colorLabel(str) {
|
|
277
|
-
var c = parseColor(str);
|
|
278
|
-
if (!c) return null;
|
|
279
|
-
if (c.alpha < 1) return c.hex + ' (' + Math.round(c.alpha * 100) + '% opacity)';
|
|
280
|
-
return c.hex;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
276
|
function colorObj(str) {
|
|
284
277
|
var c = parseColor(str);
|
|
285
278
|
if (!c) return null;
|
|
286
|
-
|
|
279
|
+
var label = c.alpha < 1 ? c.hex + ' (' + Math.round(c.alpha * 100) + '% opacity)' : c.hex;
|
|
280
|
+
return { raw: str, hex: c.hex, alpha: c.alpha, label: label };
|
|
287
281
|
}
|
|
288
282
|
|
|
289
283
|
function edge(t, r, b, l) {
|
|
@@ -485,6 +479,7 @@
|
|
|
485
479
|
function clearHoverOutline() {
|
|
486
480
|
if (outlinedEl) {
|
|
487
481
|
outlinedEl.style.outline = prevOutline;
|
|
482
|
+
outlinedEl.style.outlineOffset = '';
|
|
488
483
|
outlinedEl = null;
|
|
489
484
|
}
|
|
490
485
|
}
|
|
@@ -561,7 +556,7 @@
|
|
|
561
556
|
}
|
|
562
557
|
|
|
563
558
|
function clearSelection() {
|
|
564
|
-
selectedEls.forEach(function (el) { el.style.outline = ''; });
|
|
559
|
+
selectedEls.forEach(function (el) { el.style.outline = ''; el.style.outlineOffset = ''; });
|
|
565
560
|
selectedEls.length = 0;
|
|
566
561
|
selectedBadges.forEach(function (b) { b.remove(); });
|
|
567
562
|
selectedBadges.length = 0;
|
|
@@ -926,7 +921,7 @@
|
|
|
926
921
|
if (isInputFocused()) return;
|
|
927
922
|
|
|
928
923
|
if (e.key === 'p' || e.key === 'P') {
|
|
929
|
-
if (
|
|
924
|
+
if (!lastHovered) return;
|
|
930
925
|
clearHoverOutline();
|
|
931
926
|
toggleSelection(lastHovered);
|
|
932
927
|
return;
|
|
@@ -945,11 +940,12 @@
|
|
|
945
940
|
}
|
|
946
941
|
|
|
947
942
|
if (e.key === 'Escape') {
|
|
948
|
-
if (pinEl) {
|
|
943
|
+
if (pinEl || selectedEls.length > 0) {
|
|
949
944
|
clearPin();
|
|
945
|
+
clearSelection();
|
|
950
946
|
clearMeasureOverlay();
|
|
951
947
|
hideTooltip();
|
|
952
|
-
|
|
948
|
+
collapsePill();
|
|
953
949
|
} else {
|
|
954
950
|
deactivate();
|
|
955
951
|
}
|
|
@@ -975,8 +971,9 @@
|
|
|
975
971
|
|
|
976
972
|
window.__specterToggle = function() { if (fiActive) deactivate(); else activate(); };
|
|
977
973
|
|
|
978
|
-
|
|
979
|
-
|
|
974
|
+
var _rt = (typeof browser !== 'undefined' && browser.runtime) || (typeof chrome !== 'undefined' && chrome.runtime);
|
|
975
|
+
if (_rt && _rt.onMessage) {
|
|
976
|
+
_rt.onMessage.addListener(function(msg) {
|
|
980
977
|
if (msg && msg.type === 'specter-toggle') window.__specterToggle();
|
|
981
978
|
});
|
|
982
979
|
}
|