@herb-tools/dev-tools 0.8.9 → 0.9.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herb-tools/dev-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Development tools for visual debugging in HTML+ERB templates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@herb-tools/core": "0.
|
|
33
|
+
"@herb-tools/core": "0.9.0"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"package.json",
|
package/src/error-overlay.ts
CHANGED
|
@@ -76,7 +76,7 @@ export class ErrorOverlay {
|
|
|
76
76
|
|
|
77
77
|
htmlTemplates.forEach((template, _index) => {
|
|
78
78
|
try {
|
|
79
|
-
|
|
79
|
+
const htmlContent = template.innerHTML?.trim() || template.textContent?.trim();
|
|
80
80
|
|
|
81
81
|
if (htmlContent) {
|
|
82
82
|
this.displayParserErrorOverlay(htmlContent);
|
package/src/herb-overlay.ts
CHANGED
|
@@ -157,7 +157,7 @@ export class HerbOverlay {
|
|
|
157
157
|
<label class="herb-toggle-label">
|
|
158
158
|
<input type="checkbox" id="herbToggleViewOutlines" class="herb-toggle-input">
|
|
159
159
|
<span class="herb-toggle-switch"></span>
|
|
160
|
-
<span class="herb-toggle-text">
|
|
160
|
+
<span class="herb-toggle-text herb-outline-preview herb-outline-view">View Outlines</span>
|
|
161
161
|
</label>
|
|
162
162
|
</div>
|
|
163
163
|
|
|
@@ -165,7 +165,7 @@ export class HerbOverlay {
|
|
|
165
165
|
<label class="herb-toggle-label">
|
|
166
166
|
<input type="checkbox" id="herbTogglePartialOutlines" class="herb-toggle-input">
|
|
167
167
|
<span class="herb-toggle-switch"></span>
|
|
168
|
-
<span class="herb-toggle-text">
|
|
168
|
+
<span class="herb-toggle-text herb-outline-preview herb-outline-partial">Partial Outlines</span>
|
|
169
169
|
</label>
|
|
170
170
|
</div>
|
|
171
171
|
|
|
@@ -173,7 +173,7 @@ export class HerbOverlay {
|
|
|
173
173
|
<label class="herb-toggle-label">
|
|
174
174
|
<input type="checkbox" id="herbToggleComponentOutlines" class="herb-toggle-input">
|
|
175
175
|
<span class="herb-toggle-switch"></span>
|
|
176
|
-
<span class="herb-toggle-text">
|
|
176
|
+
<span class="herb-toggle-text herb-outline-preview herb-outline-component">Component Outlines</span>
|
|
177
177
|
</label>
|
|
178
178
|
</div>
|
|
179
179
|
|
|
@@ -181,7 +181,7 @@ export class HerbOverlay {
|
|
|
181
181
|
<label class="herb-toggle-label">
|
|
182
182
|
<input type="checkbox" id="herbToggleERBOutlines" class="herb-toggle-input">
|
|
183
183
|
<span class="herb-toggle-switch"></span>
|
|
184
|
-
<span class="herb-toggle-text">
|
|
184
|
+
<span class="herb-toggle-text herb-outline-preview herb-outline-erb">ERB Output Outlines</span>
|
|
185
185
|
</label>
|
|
186
186
|
|
|
187
187
|
<div class="herb-nested-toggle" id="herbERBHoverRevealNested" style="display: none;">
|
|
@@ -551,7 +551,7 @@ export class HerbOverlay {
|
|
|
551
551
|
if (element.localName === 'html' || window.getComputedStyle(element).overflowY !== 'visible') {
|
|
552
552
|
label.style.top = '0';
|
|
553
553
|
}
|
|
554
|
-
|
|
554
|
+
|
|
555
555
|
if (window.getComputedStyle(element).position === 'static') {
|
|
556
556
|
element.style.position = 'relative';
|
|
557
557
|
}
|
|
@@ -586,7 +586,7 @@ export class HerbOverlay {
|
|
|
586
586
|
const elements = document.querySelectorAll('[data-herb-debug-showing-erb')
|
|
587
587
|
|
|
588
588
|
elements.forEach(element => {
|
|
589
|
-
const originalContent = element.getAttribute('data-herb-debug-original') ||
|
|
589
|
+
const originalContent = element.getAttribute('data-herb-debug-original') || "";
|
|
590
590
|
|
|
591
591
|
element.innerHTML = originalContent;
|
|
592
592
|
element.removeAttribute("data-herb-debug-showing-erb")
|
|
@@ -617,7 +617,7 @@ export class HerbOverlay {
|
|
|
617
617
|
this.addTooltipHoverHandler(element);
|
|
618
618
|
}
|
|
619
619
|
} else {
|
|
620
|
-
const originalContent = element.getAttribute('data-herb-debug-original') ||
|
|
620
|
+
const originalContent = element.getAttribute('data-herb-debug-original') || "";
|
|
621
621
|
|
|
622
622
|
if (element && element.hasAttribute("data-herb-debug-showing-erb")) {
|
|
623
623
|
element.innerHTML = originalContent;
|
|
@@ -1055,7 +1055,7 @@ export class HerbOverlay {
|
|
|
1055
1055
|
if (url) {
|
|
1056
1056
|
try {
|
|
1057
1057
|
window.open(url, '_self');
|
|
1058
|
-
} catch (
|
|
1058
|
+
} catch (_error) {
|
|
1059
1059
|
console.log(`Open in editor: ${absolutePath}:${line}:${column}`);
|
|
1060
1060
|
}
|
|
1061
1061
|
} else {
|
package/src/styles.css
CHANGED
|
@@ -421,6 +421,32 @@
|
|
|
421
421
|
flex: 1;
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
+
.herb-outline-preview {
|
|
425
|
+
padding: 2px 8px;
|
|
426
|
+
border-radius: 4px;
|
|
427
|
+
border: 2px dotted transparent;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.herb-outline-view {
|
|
431
|
+
border-color: #3b82f6;
|
|
432
|
+
background-color: #eff6ff;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.herb-outline-partial {
|
|
436
|
+
border-color: #10b981;
|
|
437
|
+
background-color: #ecfdf5;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.herb-outline-component {
|
|
441
|
+
border-color: #f59e0b;
|
|
442
|
+
background-color: #fffbeb;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.herb-outline-erb {
|
|
446
|
+
border-color: #a78bfa;
|
|
447
|
+
background-color: #f5f3ff;
|
|
448
|
+
}
|
|
449
|
+
|
|
424
450
|
.herb-toggle-label:hover .herb-toggle-switch {
|
|
425
451
|
background: #94a3b8;
|
|
426
452
|
}
|