isomorfeus-preact 22.9.0.rc5 → 22.9.0.rc7

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: 4a42f1660e1780885ea77e59545c00f5e6e88073f0f2de9576323ff0421d2b81
4
- data.tar.gz: bb96257c15ccbdb6a3211a6a271c5a47128760c0c1a72b44936ad39f298fbd02
3
+ metadata.gz: 1444a364c56453f0e45b901f88316ae4262494206149fb63108d206d84fff870
4
+ data.tar.gz: d22d8944d3001f1be119335ebaf72d2dac3bfb578b7eb83585ae58b1214171dc
5
5
  SHA512:
6
- metadata.gz: 59e489c2b5ac028fa61daef05dcb006c895b10dab3494146be42618fcd8927eb4747863c272fea18af9cac09bcd44f0d35a8fb718c20f835ebbfd29dd51e58e4
7
- data.tar.gz: ad20d418725934270727764e00abf22c7b84f83655b0753f1e8c753f45ef9ed0afbcf55c43ee89246220ec4805ec66b3cc7f94380b79403f185464e0d3c02983
6
+ metadata.gz: 01be4daedd99d8ba24d99125878af8032b0289a806e8eb98584f3bb7848d73fb7157770d30853199747a5ca14497cd9f5de90859006bfb4976e23c4247d68a60
7
+ data.tar.gz: 4962e6fb45985477eea0638976e9f600b1f448eedb68a2a9e245e914caefde52c6af0ad1df228b0747a6973bf018582bea1ac62d516c82812cc04d4a3e19abf4
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Preact
3
- VERSION = '22.9.0.rc5'
3
+ VERSION = '22.9.0.rc7'
4
4
  end
5
5
  end
data/lib/preact.rb CHANGED
@@ -770,7 +770,8 @@ module Preact
770
770
  if (newType.declared_props && newType.declared_props !== nil) {
771
771
  #{
772
772
  `newType.declared_props`.each do |prop, value|
773
- `newProps`[prop] = value[:default] if value.key?(:default) && !`newProps`.key?(prop)
773
+ `if (Object.hasOwnProperty.call(value.$$smap, "default") && !Object.hasOwnProperty.call(newProps.$$smap, prop)) { #{`newProps`[prop] = value[:default]} }`
774
+ nil
774
775
  end
775
776
  }
776
777
  if (Opal.Isomorfeus.development) { #{`newType`.validate_props(`newProps`)} }
@@ -1426,7 +1427,7 @@ module Preact
1426
1427
  declared_props = node_name.instance_variable_get(:@declared_props)
1427
1428
  if declared_props
1428
1429
  declared_props.each do |prop, value|
1429
- props[prop] = value[:default] if !props.key?(prop) && value.key?(:default)
1430
+ props[prop] = value[:default] if value.key?(:default) && !props.key?(prop)
1430
1431
  end
1431
1432
  node_name.validate_props(props) if Isomorfeus.development?
1432
1433
  end
data/lib/route.rb CHANGED
@@ -2,14 +2,15 @@ class Route < Preact::Component
2
2
  render do
3
3
  route_match = @context[:router][:matcher].call(props[:path], @context[:location])
4
4
  matches, params = props[:match] || route_match
5
- return unless matches
6
- component = props[:component]
7
- component_props = props[:component_props] || {}
8
- if component
9
- component = component.constantize if component.is_a?(String)
10
- Preact.create_element(component, component_props.merge!({ params: params }))
11
- else
12
- props[:children]
5
+ if matches
6
+ component = props[:component]
7
+ component_props = props[:component_props] || {}
8
+ if component
9
+ component = component.constantize if component.is_a?(String)
10
+ Preact.create_element(component, component_props.merge!({ params: params }))
11
+ else
12
+ props[:children]
13
+ end
13
14
  end
14
15
  end
15
16
  end
data/lib/switch.rb CHANGED
@@ -8,11 +8,11 @@ class Switch < Preact::Component
8
8
  end
9
9
  end
10
10
 
11
- def flatten(children)
12
- if children.is_a?(Array)
13
- children.compact!
14
- children.map! do |child|
15
- if RUBY_ENGINE == 'opal'
11
+ if RUBY_ENGINE == 'opal'
12
+ def flatten(children)
13
+ if children.is_a?(Array)
14
+ children.compact!
15
+ children.map! do |child|
16
16
  if child.is_a?(Array)
17
17
  flatten(child)
18
18
  elsif `child.type === Opal.Fragment`
@@ -20,18 +20,27 @@ class Switch < Preact::Component
20
20
  else
21
21
  child
22
22
  end
23
- else
23
+ end
24
+ else
25
+ [children]
26
+ end
27
+ end
28
+ else
29
+ def flatten(children)
30
+ if children.is_a?(Array)
31
+ children.compact!
32
+ children.map! do |child|
24
33
  if child.is_a?(Array)
25
34
  flatten(child)
26
35
  elsif child.type == ::Fragment
27
- flatten(child.JS[:props][:children])
36
+ flatten(child[:props][:children])
28
37
  else
29
38
  child
30
39
  end
31
40
  end
41
+ else
42
+ [children]
32
43
  end
33
- else
34
- [children]
35
44
  end
36
45
  end
37
46
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-preact
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.9.0.rc5
4
+ version: 22.9.0.rc7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-25 00:00:00.000000000 Z
11
+ date: 2022-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 22.9.0.rc5
61
+ version: 22.9.0.rc7
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 22.9.0.rc5
68
+ version: 22.9.0.rc7
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: isomorfeus-redux
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 22.9.0.rc5
75
+ version: 22.9.0.rc7
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 22.9.0.rc5
82
+ version: 22.9.0.rc7
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: isomorfeus-puppetmaster
85
85
  requirement: !ruby/object:Gem::Requirement