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.js
CHANGED
|
@@ -725,12 +725,14 @@ var CSS = `
|
|
|
725
725
|
position: fixed;
|
|
726
726
|
background: rgba(249, 115, 22, 0.2);
|
|
727
727
|
pointer-events: none;
|
|
728
|
+
z-index: 1;
|
|
728
729
|
}
|
|
729
730
|
|
|
730
731
|
.remarq-spacing-padding {
|
|
731
732
|
position: fixed;
|
|
732
733
|
background: rgba(34, 197, 94, 0.2);
|
|
733
734
|
pointer-events: none;
|
|
735
|
+
z-index: 2;
|
|
734
736
|
}
|
|
735
737
|
|
|
736
738
|
.remarq-spacing-content {
|
|
@@ -738,6 +740,7 @@ var CSS = `
|
|
|
738
740
|
background: rgba(59, 130, 246, 0.15);
|
|
739
741
|
border: 1px dashed rgba(59, 130, 246, 0.5);
|
|
740
742
|
pointer-events: none;
|
|
743
|
+
z-index: 3;
|
|
741
744
|
}
|
|
742
745
|
|
|
743
746
|
.remarq-spacing-gap {
|
|
@@ -837,6 +840,16 @@ var ThemeManager = class {
|
|
|
837
840
|
};
|
|
838
841
|
|
|
839
842
|
// src/ui/toolbar.ts
|
|
843
|
+
var TOOLTIPS = {
|
|
844
|
+
inspect: "Inspect element",
|
|
845
|
+
spacing: "Spacing overlay (S)",
|
|
846
|
+
copy: "Copy as Markdown",
|
|
847
|
+
export: "Export",
|
|
848
|
+
import: "Import JSON",
|
|
849
|
+
clear: "Clear all",
|
|
850
|
+
theme: "Toggle theme",
|
|
851
|
+
minimize: "Minimize"
|
|
852
|
+
};
|
|
840
853
|
var ICONS = {
|
|
841
854
|
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>',
|
|
842
855
|
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>',
|
|
@@ -916,9 +929,11 @@ var Toolbar = class {
|
|
|
916
929
|
this.toolbarEl.remove();
|
|
917
930
|
}
|
|
918
931
|
createButton(action, icon, handler) {
|
|
932
|
+
var _a;
|
|
919
933
|
const btn = document.createElement("button");
|
|
920
934
|
btn.className = "remarq-toolbar-btn";
|
|
921
935
|
btn.setAttribute("data-remarq-action", action);
|
|
936
|
+
btn.title = (_a = TOOLTIPS[action]) != null ? _a : "";
|
|
922
937
|
btn.innerHTML = icon;
|
|
923
938
|
btn.addEventListener("click", handler);
|
|
924
939
|
return btn;
|
|
@@ -1056,6 +1071,10 @@ var SpacingOverlay = class {
|
|
|
1056
1071
|
this.labels = [];
|
|
1057
1072
|
this.gapEls = [];
|
|
1058
1073
|
this.lastTarget = null;
|
|
1074
|
+
this.scrollHandler = () => {
|
|
1075
|
+
this.lastTarget = null;
|
|
1076
|
+
};
|
|
1077
|
+
window.addEventListener("scroll", this.scrollHandler, true);
|
|
1059
1078
|
this.containerEl = document.createElement("div");
|
|
1060
1079
|
this.containerEl.className = "remarq-spacing";
|
|
1061
1080
|
this.containerEl.style.display = "none";
|
|
@@ -1125,6 +1144,7 @@ var SpacingOverlay = class {
|
|
|
1125
1144
|
this.clearGaps();
|
|
1126
1145
|
}
|
|
1127
1146
|
destroy() {
|
|
1147
|
+
window.removeEventListener("scroll", this.scrollHandler, true);
|
|
1128
1148
|
this.clearLabels();
|
|
1129
1149
|
this.clearGaps();
|
|
1130
1150
|
this.containerEl.remove();
|