maquina-components 0.7.2 → 0.7.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.
- checksums.yaml +4 -4
- data/lib/maquina_components/doctor.rb +18 -8
- data/lib/maquina_components/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a908d12ac4b955850c1c9cf41cab32bbc12d4687d68fad543b43c74fc4f678d6
|
|
4
|
+
data.tar.gz: 83fa5e89747cd635883e93e6e47a034b64f59633f3b2207a9e9ae7e3aa5aad35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 903deaa1e5cdb313f8ae2b71a7e59d1c0608926d2951fc66aba2eb787d0e94763379dcfbe2e828c21e001e344f8dff474f5961e31e8c3f06592d13d558f6f61c
|
|
7
|
+
data.tar.gz: 9b62919d2c5bbabeba0842af06a2b3d24d576f3f307dd198e43119790b0bce36c0b0cc3108006c3f10cb5e6e02340d426baa01ca76a567f0800b805b748cd8d4
|
|
@@ -54,6 +54,13 @@ module MaquinaComponents
|
|
|
54
54
|
# Assigning a data URI to one of the five mark properties IS the 0.6.0
|
|
55
55
|
# pattern, so it must not be reported as a restated rule.
|
|
56
56
|
MARK_TOKEN_ASSIGNMENT = /--(?:checkbox-mark|checkbox-indeterminate|radio-mark|switch-thumb|select-chevron)-image\s*:/
|
|
57
|
+
RESTATED_SVG_SUGGESTION =
|
|
58
|
+
"0.6.0 exposes these marks as overridable custom properties:\n" \
|
|
59
|
+
"--checkbox-mark-image, --checkbox-indeterminate-image, --radio-mark-image,\n" \
|
|
60
|
+
"--switch-thumb-image, --select-chevron-image. Assign your SVG to the token\n" \
|
|
61
|
+
"instead of restating the engine's rule."
|
|
62
|
+
# A component hook in markup: data-component="..." or a helper's component: key.
|
|
63
|
+
MARKUP_COMPONENT_HOOK = /data-component=|\bcomponent:\s*[:"']/
|
|
57
64
|
RADIUS_DECL = /(?:border-radius\s*:|@apply[^;{}]*\brounded(?:-[a-z0-9\[\].\/-]+)?\b)/
|
|
58
65
|
SHADOW_DECL = /(?:box-shadow\s*:|@apply[^;{}]*\b(?:shadow|ring)(?:-[a-z0-9\[\].\/-]+)?\b)/
|
|
59
66
|
FOCUS_SELECTOR = /:focus(-visible|-within)?\b/
|
|
@@ -238,6 +245,13 @@ module MaquinaComponents
|
|
|
238
245
|
|
|
239
246
|
return unless component_selector?(chain)
|
|
240
247
|
|
|
248
|
+
# Only here, under a component selector, does an SVG restate an engine
|
|
249
|
+
# mark. Anywhere else it is the app's own artwork -- Rails' actiontext.css
|
|
250
|
+
# carries fifteen for the Trix editor.
|
|
251
|
+
if SVG_DATA_URI.match?(declaration) && !MARK_TOKEN_ASSIGNMENT.match?(declaration)
|
|
252
|
+
add(path, index, declaration, :breaking, "restated-svg-uri", RESTATED_SVG_SUGGESTION)
|
|
253
|
+
end
|
|
254
|
+
|
|
241
255
|
if RADIUS_DECL.match?(declaration)
|
|
242
256
|
add(path, index, declaration, :review, "hardcoded-radius",
|
|
243
257
|
"0.6.0 reads --control-radius / --surface-radius / --mark-radius / --pill-radius.\n" \
|
|
@@ -319,20 +333,16 @@ module MaquinaComponents
|
|
|
319
333
|
"Use the value form of the variant: data-[active=true]:... - the bare\n" \
|
|
320
334
|
"data-[active] variant relies on an attribute 0.6.0 no longer emits when false.")
|
|
321
335
|
end
|
|
322
|
-
|
|
323
|
-
if SVG_DATA_URI.match?(line) && !MARK_TOKEN_ASSIGNMENT.match?(line)
|
|
324
|
-
add(path, index, line, :breaking, "restated-svg-uri",
|
|
325
|
-
"0.6.0 exposes these marks as overridable custom properties:\n" \
|
|
326
|
-
"--checkbox-mark-image, --checkbox-indeterminate-image, --radio-mark-image,\n" \
|
|
327
|
-
"--switch-thumb-image, --select-chevron-image. Assign your SVG to the token\n" \
|
|
328
|
-
"instead of restating the engine's rule.")
|
|
329
|
-
end
|
|
330
336
|
end
|
|
331
337
|
|
|
332
338
|
def scan_markup(path)
|
|
333
339
|
read(path).each_with_index do |line, index|
|
|
334
340
|
scan_shared(path, index, line)
|
|
335
341
|
|
|
342
|
+
if SVG_DATA_URI.match?(line) && MARKUP_COMPONENT_HOOK.match?(line)
|
|
343
|
+
add(path, index, line, :breaking, "restated-svg-uri", RESTATED_SVG_SUGGESTION)
|
|
344
|
+
end
|
|
345
|
+
|
|
336
346
|
# Cross-file signals for check_invalid_without_aria.
|
|
337
347
|
@aria_invalid_seen ||= ARIA_INVALID.match?(line)
|
|
338
348
|
if ERROR_PART.match?(line) || FIELD_WITH_ERRORS.match?(line)
|