heartml 1.0.0.beta10 → 1.0.0.beta12

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: fc39b8b95e3a14342d16f006483ff3db734c3db584894ae45c7da44cedf5e906
4
- data.tar.gz: 19329707440f40285e43855688f1168272cdbc226ded81b41829f27dfeabdc02
3
+ metadata.gz: 8636b5bf59b3faa6b18cbc6848a794cecb3e9935cd209e8a85e619ebdeda5f79
4
+ data.tar.gz: beb6d956c8df7357c26c45aca81bd87222c8e476c42fb0b4907636c88a7785e1
5
5
  SHA512:
6
- metadata.gz: 5c11daaeee5d6a15636597fed5923ee9c5dcec0a877613dfa1b4750522d34d82700fc331e19fb8a89be2cbb85627996ae67f1631259aa725403b003ff0a98a6d
7
- data.tar.gz: 8ba6afd0cf152cf35541f1873a598284b79b8d838043cb44488d4a17ef25a9544886d5e563845db2e072885e2e15a6bbeb25464832213fa49a79024986a134fa
6
+ metadata.gz: 168d6809c47bc848bbed8d523fcbaf910df5ee0e5bbe04020ae91ed3b0c10bba005af4c0e556dcb05b14bb9877553757eea0d00da8fa0c5dd4033b24b52c45f1
7
+ data.tar.gz: 20285cb72493c1ce3f2fadbb95cd9f78cfb1ef11130602830974a420034457523cb9821a9e540ddfb2fa193ec054af5945b473f7c4d6cec947b28034d5b172b4
data/CHANGELOG.md CHANGED
@@ -2,11 +2,19 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## [1.0.0.beta10] - 2023-02-27
5
+ ## [1.0.0.beta12] - 2024-03-10
6
+
7
+ - Bugfix: shouldn't swallow `host-*` attributes for Ruby initializers
8
+
9
+ ## [1.0.0.beta11] - 2024-03-10
10
+
11
+ - Fix behavior of boolean values (`true/false` on aria attributes, `""`/missing otherwise)
12
+
13
+ ## [1.0.0.beta10] - 2024-02-27
6
14
 
7
15
  - Add the `$attribute` directive so iso effects will work
8
16
 
9
- ## [1.0.0.beta9] - 2023-02-24
17
+ ## [1.0.0.beta9] - 2024-02-24
10
18
 
11
19
  - Use `@attributes` by default
12
20
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heartml (1.0.0.beta10)
4
+ heartml (1.0.0.beta12)
5
5
  concurrent-ruby (~> 1.2)
6
6
  nokolexbor (>= 0.4.2)
7
7
 
@@ -45,7 +45,7 @@ module Heartml
45
45
  attrs.delete(k)
46
46
  end
47
47
  attrs.merge!(new_attrs)
48
- attrs.reject! { |k| k.start_with?("server-") || k.start_with?("iso-") || k.start_with?("host-") }
48
+ attrs.reject! { |k| k.start_with?("server-") || k.start_with?("iso-") }
49
49
  attrs.transform_keys! { _1.tr("-", "_").to_sym }
50
50
 
51
51
  obj = component.new(**attrs)
@@ -56,29 +56,34 @@ module Heartml
56
56
  }
57
57
 
58
58
  directive :attribute, ->(_, node, name, value) {
59
- node[name] = value
59
+ node[name] = value if name.match?(%r{^aria[A-Z-]}) || value
60
60
  }
61
61
  end
62
62
  end
63
63
 
64
64
  def _server_effect_binding(attribute:, node:)
65
65
  _iso_effect_binding(attribute:, node:)
66
- node.remove_attribute "host-effect"
66
+ node.remove_attribute "host-lazy-effect"
67
67
  end
68
68
 
69
69
  def _iso_effect_binding(attribute:, node:) # rubocop:disable Metrics
70
70
  syntax = attribute.value
71
71
  statements = syntax.split(";").map(&:strip)
72
72
 
73
- statements.each do |statement|
73
+ statements.each do |statement| # rubocop:disable Metrics
74
74
  if statement.start_with?("@")
75
75
  # property assignment
76
76
  expression = statement.split("=").map(&:strip)
77
77
  expression[0] = expression[0][1..]
78
78
 
79
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
80
85
 
81
- node.send("#{expression[0]}=", value_to_attribute(value))
86
+ node.send("#{expression[0]}=", attribute_value) unless attribute_value.nil?
82
87
  elsif statement.start_with?("$")
83
88
  # directive
84
89
  directive_name, args_str = statement.strip.match(/(.*)\((.*)\)/).captures
@@ -101,7 +106,7 @@ module Heartml
101
106
  send(method_name.strip, *args)
102
107
  end
103
108
 
104
- attribute.name = "host-effect"
109
+ attribute.name = "host-lazy-effect"
105
110
  end
106
111
  end
107
112
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Heartml
4
4
  # @return [String]
5
- VERSION = "1.0.0.beta10"
5
+ VERSION = "1.0.0.beta12"
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.beta10
4
+ version: 1.0.0.beta12
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-28 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby