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.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 {
@@ -780,13 +783,14 @@ var CSS = `
780
783
  pointer-events: none;
781
784
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
782
785
  line-height: 1;
783
- text-shadow: 0 0 3px var(--remarq-bg), 0 0 3px var(--remarq-bg);
786
+ padding: 1px 3px;
787
+ border-radius: 2px;
784
788
  }
785
789
 
786
- .remarq-spacing-label-margin { color: #f97316; }
787
- .remarq-spacing-label-padding { color: #22c55e; }
788
- .remarq-spacing-label-content { color: #3b82f6; font-size: 10px; }
789
- .remarq-spacing-label-gap { color: #a855f7; font-size: 10px; }
790
+ .remarq-spacing-label-margin { color: #fff; background: rgba(249, 115, 22, 0.85); }
791
+ .remarq-spacing-label-padding { color: #fff; background: rgba(34, 197, 94, 0.85); }
792
+ .remarq-spacing-label-content { color: #fff; background: rgba(59, 130, 246, 0.85); font-size: 10px; }
793
+ .remarq-spacing-label-gap { color: #fff; background: rgba(168, 85, 247, 0.85); font-size: 10px; }
790
794
 
791
795
  .remarq-toolbar-btn:disabled { opacity: 0.3; cursor: default; }
792
796
  .remarq-toolbar-btn:disabled:hover { background: transparent; }
@@ -859,6 +863,16 @@ var ThemeManager = class {
859
863
  };
860
864
 
861
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
+ };
862
876
  var ICONS = {
863
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>',
864
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>',
@@ -938,9 +952,11 @@ var Toolbar = class {
938
952
  this.toolbarEl.remove();
939
953
  }
940
954
  createButton(action, icon, handler) {
955
+ var _a;
941
956
  const btn = document.createElement("button");
942
957
  btn.className = "remarq-toolbar-btn";
943
958
  btn.setAttribute("data-remarq-action", action);
959
+ btn.title = (_a = TOOLTIPS[action]) != null ? _a : "";
944
960
  btn.innerHTML = icon;
945
961
  btn.addEventListener("click", handler);
946
962
  return btn;
@@ -1078,6 +1094,10 @@ var SpacingOverlay = class {
1078
1094
  this.labels = [];
1079
1095
  this.gapEls = [];
1080
1096
  this.lastTarget = null;
1097
+ this.scrollHandler = () => {
1098
+ this.lastTarget = null;
1099
+ };
1100
+ window.addEventListener("scroll", this.scrollHandler, true);
1081
1101
  this.containerEl = document.createElement("div");
1082
1102
  this.containerEl.className = "remarq-spacing";
1083
1103
  this.containerEl.style.display = "none";
@@ -1147,6 +1167,7 @@ var SpacingOverlay = class {
1147
1167
  this.clearGaps();
1148
1168
  }
1149
1169
  destroy() {
1170
+ window.removeEventListener("scroll", this.scrollHandler, true);
1150
1171
  this.clearLabels();
1151
1172
  this.clearGaps();
1152
1173
  this.containerEl.remove();