reactionview 0.2.2 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/app/assets/javascripts/reactionview-dev-tools.esm.js +10 -3
- data/app/assets/javascripts/reactionview-dev-tools.esm.js.map +1 -1
- data/app/assets/javascripts/reactionview-dev-tools.umd.js +10 -3
- data/app/assets/javascripts/reactionview-dev-tools.umd.js.map +1 -1
- data/lib/generators/reactionview/install_generator.rb +3 -0
- data/lib/reactionview/config.rb +7 -0
- data/lib/reactionview/template/handlers/herb/herb.rb +16 -20
- data/lib/reactionview/template/handlers/herb.rb +20 -8
- data/lib/reactionview/version.rb +1 -1
- data/reactionview.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 530f22c1b1537707f2e401964c9f1946d233a1f9c74bccd3e35eb38259564721
|
|
4
|
+
data.tar.gz: 5a485bef60283f135db4b113b0a5a5d46c94e71db5f2df1756fdb7bb5bd1f8d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03d30dbf3f7420f6b40a5e688b2bc8d4823238e5db610ffba78b87c3990d064224a2dac39925ec6581e1a582777fb3dd5fc4c8568b4178aad8fe30e4e6b6ae49
|
|
7
|
+
data.tar.gz: c60e7348bed3dabe3ed5defffd0bd24b2bb230096c16e3f7373c674df0ee981168d8677fba55a7defd3d3a6c0a9efe415de2f731c45ac2a2fe13976887f0d434
|
data/README.md
CHANGED
|
@@ -45,6 +45,9 @@ ReActionView.configure do |config|
|
|
|
45
45
|
|
|
46
46
|
# Enable debug mode
|
|
47
47
|
config.debug_mode = Rails.env.development?
|
|
48
|
+
|
|
49
|
+
# Validation mode (:raise, :overlay, or :none) — defaults to :raise in test, :overlay otherwise
|
|
50
|
+
# config.validation_mode = :overlay
|
|
48
51
|
end
|
|
49
52
|
```
|
|
50
53
|
|
|
@@ -62,6 +65,6 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/marcor
|
|
|
62
65
|
|
|
63
66
|
Everyone interacting in the ReActionView project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/marcoroth/reactionview/blob/main/CODE_OF_CONDUCT.md).
|
|
64
67
|
|
|
65
|
-
## License
|
|
68
|
+
## License
|
|
66
69
|
|
|
67
70
|
This project is available as open source under the terms of the [MIT License](https://github.com/marcoroth/reactionview/blob/main/LICENSE.txt).
|
|
@@ -79,7 +79,7 @@ class ErrorOverlay {
|
|
|
79
79
|
const htmlTemplates = document.querySelectorAll('template[data-herb-parser-error]');
|
|
80
80
|
htmlTemplates.forEach((template, _index) => {
|
|
81
81
|
try {
|
|
82
|
-
|
|
82
|
+
const htmlContent = template.innerHTML?.trim() || template.textContent?.trim();
|
|
83
83
|
if (htmlContent) {
|
|
84
84
|
this.displayParserErrorOverlay(htmlContent);
|
|
85
85
|
templatesToRemove.push(template);
|
|
@@ -491,11 +491,18 @@ class ErrorOverlay {
|
|
|
491
491
|
<div class="herb-dismiss-hint" style="padding-left: 24px; padding-right: 24px; padding-bottom: 12px;">
|
|
492
492
|
Click outside, press <kbd style="display: inline-block; padding: 2px 6px; font-family: monospace; font-size: 0.9em; color: #333; background: #f7f7f7; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 2px 0 #ccc, 0 2px 3px rgba(0,0,0,0.2) inset;">Esc</kbd> key, or fix the code to dismiss.<br>
|
|
493
493
|
|
|
494
|
-
|
|
494
|
+
${this.getDismissHint()}
|
|
495
495
|
</div>
|
|
496
496
|
</div>
|
|
497
497
|
`;
|
|
498
498
|
}
|
|
499
|
+
getDismissHint() {
|
|
500
|
+
const template = document.querySelector('template[data-herb-dismiss-hint]');
|
|
501
|
+
if (template) {
|
|
502
|
+
return template.innerHTML.trim();
|
|
503
|
+
}
|
|
504
|
+
return `You can also disable this overlay by passing <code style="color: #ffeb3b; font-family: monospace; font-size: 12pt;">validation_mode: :none</code> to <code style="color: #ffeb3b; font-family: monospace; font-size: 12pt;">Herb::Engine</code>.`;
|
|
505
|
+
}
|
|
499
506
|
getValidationOverlayStyles() {
|
|
500
507
|
return `
|
|
501
508
|
.herb-validation-overlay {
|
|
@@ -1689,7 +1696,7 @@ class HerbOverlay {
|
|
|
1689
1696
|
try {
|
|
1690
1697
|
window.open(url, '_self');
|
|
1691
1698
|
}
|
|
1692
|
-
catch (
|
|
1699
|
+
catch (_error) {
|
|
1693
1700
|
console.log(`Open in editor: ${absolutePath}:${line}:${column}`);
|
|
1694
1701
|
}
|
|
1695
1702
|
}
|