isomorfeus-preact 10.6.15 → 10.6.16

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: 477ee7e9d7f1af01eb798486973807f63b32a8db1fee61c5559c12b3490409f1
4
- data.tar.gz: 0ff4bd0ef757956daf3c6ded9e527a49ad6bfc4edc7a9f943fc86b8fa4eddc06
3
+ metadata.gz: 2796e916f3c62cec0b330e99b7ac6fb46b368f059c3ed1278353211fc4c8370c
4
+ data.tar.gz: ad47708be18d9e8f781a8e5bbddbc8501667bafbdee75b9589656789245d656c
5
5
  SHA512:
6
- metadata.gz: c795d9dbbdccc8c968c20bd494ef1eeac0f73b0ecc0850a4ea76d1c8e4b45221f7c8fbb1c574c088a99060702ee3a56602847bdf4b5b44fdc21f49765753394b
7
- data.tar.gz: a7727b43a807a03fd55e58c647741f8c42e6f007eb1a7123a982e59c9fdfbe2780ea0870cf083226c923a54240c33c8c7b8b7e05585a5b1377991801df056840
6
+ metadata.gz: 2d40522093a724e462b77833292c29622521832d1faac7cedf584eadf20ea4005a42de057252927eac7d1c96b847f4a19c62416722f1e818a058b3b97b04a2a2
7
+ data.tar.gz: 612ebd137795482e93c356869f32af3c4f50b4164ce629ff4c3822a4dda8a4fc748b34899ee771771c3e0e0e57e4198547c62fb7e2466f3b02b2215ce8198d25
@@ -31,6 +31,7 @@ if RUBY_ENGINE == 'opal'
31
31
  require 'isomorfeus/props/validate_hash_proxy'
32
32
  require 'isomorfeus/props/validator'
33
33
  require 'lucid_prop_declaration/mixin'
34
+ require 'preact/params'
34
35
  require 'preact/props'
35
36
 
36
37
  # HTML Elements and Fragment support
@@ -46,7 +47,6 @@ if RUBY_ENGINE == 'opal'
46
47
  require 'preact/component/initializer'
47
48
  require 'preact/component/native_component_constructor'
48
49
  require 'preact/state'
49
- require 'preact/component/params'
50
50
  require 'preact/component/resolution'
51
51
  require 'preact/component/mixin'
52
52
  require 'preact/component/base'
@@ -4,8 +4,6 @@ module LucidComponent
4
4
  @native = native_component
5
5
  @app_store = LucidComponent::AppStoreProxy.new(self)
6
6
  @class_store = LucidComponent::ClassStoreProxy.new(self.class.to_s, self, @native)
7
- # @iso_store = Isomorfeus::IsomorphicStoreProxy.new(self)
8
- # @local_store = Isomorfeus::LocalStoreProxy.new(self)
9
7
  @store = LucidComponent::InstanceStoreProxy.new(self)
10
8
  @props = `Opal.Preact.Props.$new(#@native)`
11
9
  @state = `Opal.Preact.State.$new(#@native)`
@@ -113,7 +113,7 @@ module Preact
113
113
 
114
114
  def ruby_ref(name)
115
115
  return `#@native[name]` if `(typeof #@native[name] === 'function')`
116
- Preact::Ref::new(`#@native[name]`)
116
+ `Opal.Preact.Ref.$new(#@native[name])`
117
117
  end
118
118
 
119
119
  def set_state(updater, &callback)
@@ -10,9 +10,9 @@ module Preact
10
10
  def const_missing(const_name)
11
11
  %x{
12
12
  if (typeof Opal.global[const_name] !== "undefined" && (const_name[0] === const_name[0].toUpperCase())) {
13
- var new_const = #{Preact::NativeConstantWrapper.new(`Opal.global[const_name]`, const_name)};
13
+ var new_const = Opal.Preact.NativeConstantWrapper.$new(Opal.global[const_name], const_name);
14
14
  new_const.preact_component = Opal.global[const_name];
15
- #{Object.const_set(const_name, `new_const`)};
15
+ Opal.Object.$const_set(const_name, new_const);
16
16
  return new_const;
17
17
  } else {
18
18
  return #{_preact_component_class_resolution_original_const_missing(const_name)};
@@ -0,0 +1,16 @@
1
+ module Preact
2
+ class Params
3
+ include Native::Wrapper
4
+
5
+ def method_missing(prop, *args, &block)
6
+ %x{
7
+ const p = #@native;
8
+ if (typeof p[prop] === 'undefined') {
9
+ prop = Opal.Preact.lower_camelize(prop);
10
+ if (typeof p[prop] === 'undefined') { return nil; }
11
+ }
12
+ return p[prop];
13
+ }
14
+ end
15
+ end
16
+ end
data/lib/preact/props.rb CHANGED
@@ -29,7 +29,7 @@ module Preact
29
29
  def params
30
30
  return @params if @params
31
31
  return nil if `typeof #@native.props.params === 'undefined'`
32
- @params = ::Preact::Component::Params.new(`#@native.props.params`)
32
+ @params = `Opal.Preact.Params.$new(#@native.props.params)`
33
33
  end
34
34
 
35
35
  def to_h
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.15'
2
+ VERSION = '10.6.16'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-preact
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.15
4
+ version: 10.6.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
@@ -268,11 +268,11 @@ files:
268
268
  - lib/preact/component/initializer.rb
269
269
  - lib/preact/component/mixin.rb
270
270
  - lib/preact/component/native_component_constructor.rb
271
- - lib/preact/component/params.rb
272
271
  - lib/preact/component/resolution.rb
273
272
  - lib/preact/context_wrapper.rb
274
273
  - lib/preact/native_constant_wrapper.rb
275
274
  - lib/preact/options.rb
275
+ - lib/preact/params.rb
276
276
  - lib/preact/props.rb
277
277
  - lib/preact/ref.rb
278
278
  - lib/preact/state.rb
@@ -1,18 +0,0 @@
1
- module Preact
2
- module Component
3
- class Params
4
- include Native::Wrapper
5
-
6
- def method_missing(prop, *args, &block)
7
- %x{
8
- const p = #@native;
9
- if (typeof p[prop] === 'undefined') {
10
- prop = Opal.Preact.lower_camelize(prop);
11
- if (typeof p[prop] === 'undefined') { return nil; }
12
- }
13
- return p[prop];
14
- }
15
- end
16
- end
17
- end
18
- end