web-remarq 0.2.1 → 0.2.3
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/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/web-remarq.global.global.js +20 -0
- package/dist/web-remarq.global.global.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -748,12 +748,14 @@ var CSS = `
|
|
|
748
748
|
position: fixed;
|
|
749
749
|
background: rgba(249, 115, 22, 0.2);
|
|
750
750
|
pointer-events: none;
|
|
751
|
+
z-index: 1;
|
|
751
752
|
}
|
|
752
753
|
|
|
753
754
|
.remarq-spacing-padding {
|
|
754
755
|
position: fixed;
|
|
755
756
|
background: rgba(34, 197, 94, 0.2);
|
|
756
757
|
pointer-events: none;
|
|
758
|
+
z-index: 2;
|
|
757
759
|
}
|
|
758
760
|
|
|
759
761
|
.remarq-spacing-content {
|
|
@@ -761,6 +763,7 @@ var CSS = `
|
|
|
761
763
|
background: rgba(59, 130, 246, 0.15);
|
|
762
764
|
border: 1px dashed rgba(59, 130, 246, 0.5);
|
|
763
765
|
pointer-events: none;
|
|
766
|
+
z-index: 3;
|
|
764
767
|
}
|
|
765
768
|
|
|
766
769
|
.remarq-spacing-gap {
|
|
@@ -860,6 +863,16 @@ var ThemeManager = class {
|
|
|
860
863
|
};
|
|
861
864
|
|
|
862
865
|
// src/ui/toolbar.ts
|
|
866
|
+
var TOOLTIPS = {
|
|
867
|
+
inspect: "Inspect element",
|
|
868
|
+
spacing: "Spacing overlay (S)",
|
|
869
|
+
copy: "Copy as Markdown",
|
|
870
|
+
export: "Export",
|
|
871
|
+
import: "Import JSON",
|
|
872
|
+
clear: "Clear all",
|
|
873
|
+
theme: "Toggle theme",
|
|
874
|
+
minimize: "Minimize"
|
|
875
|
+
};
|
|
863
876
|
var ICONS = {
|
|
864
877
|
inspect: '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="7" cy="7" r="4"/><line x1="10" y1="10" x2="14" y2="14"/></svg>',
|
|
865
878
|
spacing: '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 2h12M2 14h12M2 2v12M14 2v12"/><path d="M5 5h6v6H5z" stroke-dasharray="2 1"/></svg>',
|
|
@@ -939,9 +952,11 @@ var Toolbar = class {
|
|
|
939
952
|
this.toolbarEl.remove();
|
|
940
953
|
}
|
|
941
954
|
createButton(action, icon, handler) {
|
|
955
|
+
var _a;
|
|
942
956
|
const btn = document.createElement("button");
|
|
943
957
|
btn.className = "remarq-toolbar-btn";
|
|
944
958
|
btn.setAttribute("data-remarq-action", action);
|
|
959
|
+
btn.title = (_a = TOOLTIPS[action]) != null ? _a : "";
|
|
945
960
|
btn.innerHTML = icon;
|
|
946
961
|
btn.addEventListener("click", handler);
|
|
947
962
|
return btn;
|
|
@@ -1079,6 +1094,10 @@ var SpacingOverlay = class {
|
|
|
1079
1094
|
this.labels = [];
|
|
1080
1095
|
this.gapEls = [];
|
|
1081
1096
|
this.lastTarget = null;
|
|
1097
|
+
this.scrollHandler = () => {
|
|
1098
|
+
this.lastTarget = null;
|
|
1099
|
+
};
|
|
1100
|
+
window.addEventListener("scroll", this.scrollHandler, true);
|
|
1082
1101
|
this.containerEl = document.createElement("div");
|
|
1083
1102
|
this.containerEl.className = "remarq-spacing";
|
|
1084
1103
|
this.containerEl.style.display = "none";
|
|
@@ -1148,6 +1167,7 @@ var SpacingOverlay = class {
|
|
|
1148
1167
|
this.clearGaps();
|
|
1149
1168
|
}
|
|
1150
1169
|
destroy() {
|
|
1170
|
+
window.removeEventListener("scroll", this.scrollHandler, true);
|
|
1151
1171
|
this.clearLabels();
|
|
1152
1172
|
this.clearGaps();
|
|
1153
1173
|
this.containerEl.remove();
|