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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 870cc289944a0b16196e5e259398cbdabf0ca1dd998bf2a178967898a3d1a57e
4
- data.tar.gz: db3daba76341084ee6e096fd2186cebdcf594b6faee992be2c9e62e4b5781eed
3
+ metadata.gz: a908d12ac4b955850c1c9cf41cab32bbc12d4687d68fad543b43c74fc4f678d6
4
+ data.tar.gz: 83fa5e89747cd635883e93e6e47a034b64f59633f3b2207a9e9ae7e3aa5aad35
5
5
  SHA512:
6
- metadata.gz: a1934e3230c028e772cbaf0a0276a21fbb6f8ea406e76c355fdfc29587b445619a717a2d7f69a388a65afbcdef5236e59495072192845993a3079c944b0ca59c
7
- data.tar.gz: 6c29f68c06d96157c4402ff03f1594aac41a748480d464c678bd995d10aa49ba055f759674786d666a1fb8b0f146fc76243a95171b146c88e82aa88d42df644c
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)
@@ -1,3 +1,3 @@
1
1
  module MaquinaComponents
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maquina-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Alberto Chávez