web-remarq 0.2.0 → 0.2.2

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.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 {
@@ -757,13 +760,14 @@ var CSS = `
757
760
  pointer-events: none;
758
761
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
759
762
  line-height: 1;
760
- text-shadow: 0 0 3px var(--remarq-bg), 0 0 3px var(--remarq-bg);
763
+ padding: 1px 3px;
764
+ border-radius: 2px;
761
765
  }
762
766
 
763
- .remarq-spacing-label-margin { color: #f97316; }
764
- .remarq-spacing-label-padding { color: #22c55e; }
765
- .remarq-spacing-label-content { color: #3b82f6; font-size: 10px; }
766
- .remarq-spacing-label-gap { color: #a855f7; font-size: 10px; }
767
+ .remarq-spacing-label-margin { color: #fff; background: rgba(249, 115, 22, 0.85); }
768
+ .remarq-spacing-label-padding { color: #fff; background: rgba(34, 197, 94, 0.85); }
769
+ .remarq-spacing-label-content { color: #fff; background: rgba(59, 130, 246, 0.85); font-size: 10px; }
770
+ .remarq-spacing-label-gap { color: #fff; background: rgba(168, 85, 247, 0.85); font-size: 10px; }
767
771
 
768
772
  .remarq-toolbar-btn:disabled { opacity: 0.3; cursor: default; }
769
773
  .remarq-toolbar-btn:disabled:hover { background: transparent; }
@@ -836,6 +840,16 @@ var ThemeManager = class {
836
840
  };
837
841
 
838
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
+ };
839
853
  var ICONS = {
840
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>',
841
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>',
@@ -915,9 +929,11 @@ var Toolbar = class {
915
929
  this.toolbarEl.remove();
916
930
  }
917
931
  createButton(action, icon, handler) {
932
+ var _a;
918
933
  const btn = document.createElement("button");
919
934
  btn.className = "remarq-toolbar-btn";
920
935
  btn.setAttribute("data-remarq-action", action);
936
+ btn.title = (_a = TOOLTIPS[action]) != null ? _a : "";
921
937
  btn.innerHTML = icon;
922
938
  btn.addEventListener("click", handler);
923
939
  return btn;
@@ -1055,6 +1071,10 @@ var SpacingOverlay = class {
1055
1071
  this.labels = [];
1056
1072
  this.gapEls = [];
1057
1073
  this.lastTarget = null;
1074
+ this.scrollHandler = () => {
1075
+ this.lastTarget = null;
1076
+ };
1077
+ window.addEventListener("scroll", this.scrollHandler, true);
1058
1078
  this.containerEl = document.createElement("div");
1059
1079
  this.containerEl.className = "remarq-spacing";
1060
1080
  this.containerEl.style.display = "none";
@@ -1124,6 +1144,7 @@ var SpacingOverlay = class {
1124
1144
  this.clearGaps();
1125
1145
  }
1126
1146
  destroy() {
1147
+ window.removeEventListener("scroll", this.scrollHandler, true);
1127
1148
  this.clearLabels();
1128
1149
  this.clearGaps();
1129
1150
  this.containerEl.remove();