heartml 1.0.0.beta9 → 1.0.0.beta11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45a181e4dbbe1346219242f7f6bb784909e0c4434c5460a8c604e82b16277d2a
4
- data.tar.gz: 8848dd62e0186758310195aa36908bcfb8ab074cc1ac26d680848b2dc4fefdde
3
+ metadata.gz: 22baf05df8518c46483c4c689f724feb5ac2b1a446555f4d12f3bec534c26fb8
4
+ data.tar.gz: fcbc7708f8deaf2760bb5b021c51f3a7baeea5102e4a30c592f6692acac0bee8
5
5
  SHA512:
6
- metadata.gz: be785fe5ef3d2bcbc15422abc073af1387b8c6cc5219ed7fa5d4454fa341bc1acc17a94a46e2a89904ac5d93835fdf335d08c4fe2420952fe7de554237ad62ed
7
- data.tar.gz: 19e2a61d7693cdd78a50434fa1d27b6f694f397b28733d1315519b0602eeea650cfa3372faac9b68f81ad2578882b1b115b8ad129995a130d33c9ca8fa3b5a88
6
+ metadata.gz: ff66eff6ecb6e79f64223b6d7e18c6e635164e2e41740412e4481ac15119a996b465fc4b01fe5254c3d4aa652bba9780cfbcf17a38f941ca1da46d61aaf8ce50
7
+ data.tar.gz: 014a0f91536a95e1eb15cc1080e5896210e5e5dc334a967aee97e7106e316f9017a3ac468781348d0f938c695e16919ecac975a9051aa36389768c365a68c1a9
data/CHANGELOG.md CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## [1.0.0.beta9] - 2023-02-24
5
+ ## [1.0.0.beta11] - 2024-03-10
6
+
7
+ - Fix behavior of boolean values (`true/false` on aria attributes, `""`/missing otherwise)
8
+
9
+ ## [1.0.0.beta10] - 2024-02-27
10
+
11
+ - Add the `$attribute` directive so iso effects will work
12
+
13
+ ## [1.0.0.beta9] - 2024-02-24
6
14
 
7
15
  - Use `@attributes` by default
8
16
 
data/CODE_OF_CONDUCT.md CHANGED
@@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when
39
39
 
40
40
  ## Enforcement
41
41
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at jared@jaredwhite.com. All complaints will be reviewed and investigated promptly and fairly.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at jared@whitefusion.studio. All complaints will be reviewed and investigated promptly and fairly.
43
43
 
44
44
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
45
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heartml (1.0.0.beta9)
4
+ heartml (1.0.0.beta11)
5
5
  concurrent-ruby (~> 1.2)
6
6
  nokolexbor (>= 0.4.2)
7
7
 
@@ -54,27 +54,36 @@ module Heartml
54
54
  node.add_class k.to_s if v
55
55
  end
56
56
  }
57
+
58
+ directive :attribute, ->(_, node, name, value) {
59
+ node[name] = value if name.match?(%r{^aria[A-Z-]}) || value
60
+ }
57
61
  end
58
62
  end
59
63
 
60
64
  def _server_effect_binding(attribute:, node:)
61
65
  _iso_effect_binding(attribute:, node:)
62
- node.remove_attribute "host-effect"
66
+ node.remove_attribute "host-lazy-effect"
63
67
  end
64
68
 
65
69
  def _iso_effect_binding(attribute:, node:) # rubocop:disable Metrics
66
70
  syntax = attribute.value
67
71
  statements = syntax.split(";").map(&:strip)
68
72
 
69
- statements.each do |statement|
73
+ statements.each do |statement| # rubocop:disable Metrics
70
74
  if statement.start_with?("@")
71
75
  # property assignment
72
76
  expression = statement.split("=").map(&:strip)
73
77
  expression[0] = expression[0][1..]
74
78
 
75
79
  value = send(expression[1][1..])
80
+ attribute_value = if expression[0].match?(%r{^aria[A-Z-]}) && [true, false].include?(value)
81
+ value
82
+ else
83
+ value_to_attribute(value)
84
+ end
76
85
 
77
- node.send("#{expression[0]}=", value_to_attribute(value))
86
+ node.send("#{expression[0]}=", attribute_value) unless attribute_value.nil?
78
87
  elsif statement.start_with?("$")
79
88
  # directive
80
89
  directive_name, args_str = statement.strip.match(/(.*)\((.*)\)/).captures
@@ -97,7 +106,7 @@ module Heartml
97
106
  send(method_name.strip, *args)
98
107
  end
99
108
 
100
- attribute.name = "host-effect"
109
+ attribute.name = "host-lazy-effect"
101
110
  end
102
111
  end
103
112
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Heartml
4
4
  # @return [String]
5
- VERSION = "1.0.0.beta9"
5
+ VERSION = "1.0.0.beta11"
6
6
  end
data/lib/heartml.rb CHANGED
@@ -277,6 +277,8 @@ module Heartml
277
277
  val
278
278
  when TrueClass
279
279
  ""
280
+ when FalseClass
281
+ nil
280
282
  else
281
283
  val.to_json
282
284
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heartml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta9
4
+ version: 1.0.0.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared White
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-24 00:00:00.000000000 Z
11
+ date: 2024-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby