hyper-router 4.2.6.lap27 → 4.2.6.lap28

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: 448bd6affb8fd36645b9f78c35ed715cd5d3fb25ebfa14331323519ac3b5f7ef
4
- data.tar.gz: e21a60ce13ef24fa50111a3504158fe357f3ca7f7e50a9bc0f305e35729709c0
3
+ metadata.gz: 5d6a961fab37e34b49156b390ddf107de0102396983746c37ec88f9a7d282897
4
+ data.tar.gz: e93abed440a1b9a6f0011cfeacbc713b7ba15bbd35f45747aaee3a7fba71950b
5
5
  SHA512:
6
- metadata.gz: 862190e2d45e0fa580bce4d4aa89dbeeeb9739c0f2c634091755ba8ccfd68329bd4685b5f813cd0ce0178101be730e51289bebaf5e51f1e924c9df9c96b9f186
7
- data.tar.gz: 367f34143efdf53679dcbee9843463a964d78fbb71972378ff0244a31f8d883be6d97bc4460ea7437146590baad44c20653a11ec5c306879f597783ae2f1c3aa
6
+ metadata.gz: 001744c6a12ba68a5a08a499cfdb4a3337ec9e441a18b182865a273d3ad24e53b1334f26f727e716e63c2e7a575d1b174efa7d2abf65125871788ed33f0ec709
7
+ data.tar.gz: c915699849693ee93359a5a972961c5147573465614411cdd441e81038ce317490e11eb6b303e5b83fea208d953d7b9d277160c051017747df0a88b85926f47f
@@ -38,7 +38,7 @@ module HyperRouter
38
38
 
39
39
  def render_router(&block)
40
40
  define_method(:render) do
41
- raise(HyperRouter::NoHistoryError, 'A history must be defined') unless history
41
+ self.class.history :browser unless history
42
42
 
43
43
  React::Router::Router(history: history.to_n) do
44
44
  instance_eval(&block)
@@ -16,6 +16,9 @@ module HyperRouter
16
16
  opts[:activeClassName] = opts.delete(:active_class).to_n if opts[:active_class]
17
17
  opts[:activeStyle] = opts.delete(:active_style).to_n if opts[:active_style]
18
18
  opts[:isActive] = opts.delete(:active).to_n if opts[:active]
19
+ if (%i[activeClassName activeStyle isActive] & opts.keys).any?
20
+ React::State.get_state(HyperRouter, :location)
21
+ end
19
22
  React::Router::DOM::NavLink(opts, &children)
20
23
  end
21
24
 
@@ -1,4 +1,4 @@
1
1
  module HyperRouter
2
- VERSION = '4.2.6.lap27'
3
- HYPERLOOP_VERSION = '1.0.0.lap27'
2
+ VERSION = '4.2.6.lap28'
3
+ HYPERLOOP_VERSION = '1.0.0.lap28'
4
4
  end
@@ -22,6 +22,16 @@ module Hyperloop
22
22
  define_method(:history) do
23
23
  params.history
24
24
  end
25
+
26
+ before_mount do
27
+ @_react_router_unlisten = history.listen do |location, action|
28
+ React::State.set_state(HyperRouter, :location, location)
29
+ end
30
+ end
31
+
32
+ before_unmount do
33
+ @_react_router_unlisten.call if @_react_router_unlisten
34
+ end
25
35
  end
26
36
  end
27
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyper-router
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.6.lap27
4
+ version: 4.2.6.lap28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam George
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-07 00:00:00.000000000 Z
12
+ date: 2018-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hyper-component
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 1.0.0.lap27
20
+ version: 1.0.0.lap28
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 1.0.0.lap27
27
+ version: 1.0.0.lap28
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: hyper-react
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 1.0.0.lap27
34
+ version: 1.0.0.lap28
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 1.0.0.lap27
41
+ version: 1.0.0.lap28
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: opal-browser
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -149,14 +149,14 @@ dependencies:
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 1.0.0.lap27
152
+ version: 1.0.0.lap28
153
153
  type: :development
154
154
  prerelease: false
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 1.0.0.lap27
159
+ version: 1.0.0.lap28
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: listen
162
162
  requirement: !ruby/object:Gem::Requirement
@@ -492,7 +492,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
492
492
  version: 1.3.1
493
493
  requirements: []
494
494
  rubyforge_project:
495
- rubygems_version: 2.7.3
495
+ rubygems_version: 2.7.6
496
496
  signing_key:
497
497
  specification_version: 4
498
498
  summary: hyper-router for Opal, part of ruby-hyperloop