isomorfeus-preact 10.6.12 → 10.6.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isomorfeus/preact_view_helper.rb +3 -2
  3. data/lib/isomorfeus/props/validate_hash_proxy.rb +1 -1
  4. data/lib/isomorfeus/props/validator.rb +6 -4
  5. data/lib/isomorfeus-preact.rb +4 -4
  6. data/lib/isomorfeus_preact/lucid_component/api.rb +1 -1
  7. data/lib/isomorfeus_preact/lucid_component/initializer.rb +2 -4
  8. data/lib/isomorfeus_preact/lucid_func/initializer.rb +1 -1
  9. data/lib/isomorfeus_preact/preact/function_component/initializer.rb +1 -1
  10. data/lib/preact/component/api.rb +2 -2
  11. data/lib/preact/component/callbacks.rb +6 -6
  12. data/lib/preact/component/initializer.rb +2 -2
  13. data/lib/preact/component/native_component_constructor.rb +1 -1
  14. data/lib/preact/component/resolution.rb +2 -2
  15. data/lib/preact/params.rb +16 -0
  16. data/lib/preact/props.rb +51 -0
  17. data/lib/preact/state.rb +67 -0
  18. data/lib/preact/version.rb +1 -1
  19. data/lib/preact.rb +2 -2
  20. data/node_modules/.package-lock.json +3 -3
  21. data/node_modules/preact/LICENSE +21 -21
  22. data/node_modules/preact/README.md +187 -187
  23. data/node_modules/preact/compat/dist/compat.js +1 -1
  24. data/node_modules/preact/compat/dist/compat.js.map +1 -1
  25. data/node_modules/preact/compat/dist/compat.mjs +1 -1
  26. data/node_modules/preact/compat/dist/compat.module.js +1 -1
  27. data/node_modules/preact/compat/dist/compat.module.js.map +1 -1
  28. data/node_modules/preact/compat/dist/compat.umd.js +1 -1
  29. data/node_modules/preact/compat/dist/compat.umd.js.map +1 -1
  30. data/node_modules/preact/compat/jsx-dev-runtime.js +1 -1
  31. data/node_modules/preact/compat/jsx-dev-runtime.mjs +1 -1
  32. data/node_modules/preact/compat/jsx-runtime.js +1 -1
  33. data/node_modules/preact/compat/jsx-runtime.mjs +1 -1
  34. data/node_modules/preact/compat/package.json +19 -19
  35. data/node_modules/preact/compat/scheduler.js +15 -15
  36. data/node_modules/preact/compat/scheduler.mjs +23 -23
  37. data/node_modules/preact/compat/server.js +15 -15
  38. data/node_modules/preact/compat/server.mjs +4 -4
  39. data/node_modules/preact/compat/src/Children.js +21 -21
  40. data/node_modules/preact/compat/src/PureComponent.js +15 -15
  41. data/node_modules/preact/compat/src/forwardRef.js +51 -51
  42. data/node_modules/preact/compat/src/index.d.ts +141 -141
  43. data/node_modules/preact/compat/src/index.js +187 -187
  44. data/node_modules/preact/compat/src/internal.d.ts +47 -47
  45. data/node_modules/preact/compat/src/memo.js +34 -34
  46. data/node_modules/preact/compat/src/portals.js +80 -80
  47. data/node_modules/preact/compat/src/render.js +229 -230
  48. data/node_modules/preact/compat/src/suspense-list.d.ts +14 -14
  49. data/node_modules/preact/compat/src/suspense-list.js +126 -126
  50. data/node_modules/preact/compat/src/suspense.d.ts +15 -15
  51. data/node_modules/preact/compat/src/suspense.js +270 -270
  52. data/node_modules/preact/compat/src/util.js +28 -28
  53. data/node_modules/preact/compat/test-utils.js +1 -1
  54. data/node_modules/preact/debug/dist/debug.js.map +1 -1
  55. data/node_modules/preact/debug/dist/debug.module.js.map +1 -1
  56. data/node_modules/preact/debug/dist/debug.umd.js.map +1 -1
  57. data/node_modules/preact/debug/package.json +18 -18
  58. data/node_modules/preact/debug/src/check-props.js +54 -54
  59. data/node_modules/preact/debug/src/component-stack.js +146 -146
  60. data/node_modules/preact/debug/src/constants.js +3 -3
  61. data/node_modules/preact/debug/src/debug.js +442 -442
  62. data/node_modules/preact/debug/src/index.js +6 -6
  63. data/node_modules/preact/debug/src/internal.d.ts +82 -82
  64. data/node_modules/preact/debug/src/util.js +11 -11
  65. data/node_modules/preact/devtools/dist/devtools.js +1 -1
  66. data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
  67. data/node_modules/preact/devtools/dist/devtools.mjs +1 -1
  68. data/node_modules/preact/devtools/dist/devtools.module.js +1 -1
  69. data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
  70. data/node_modules/preact/devtools/dist/devtools.umd.js +1 -1
  71. data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
  72. data/node_modules/preact/devtools/package.json +16 -16
  73. data/node_modules/preact/devtools/src/devtools.js +10 -10
  74. data/node_modules/preact/devtools/src/index.d.ts +8 -8
  75. data/node_modules/preact/devtools/src/index.js +15 -15
  76. data/node_modules/preact/dist/preact.js.map +1 -1
  77. data/node_modules/preact/dist/preact.min.js.map +1 -1
  78. data/node_modules/preact/dist/preact.module.js.map +1 -1
  79. data/node_modules/preact/dist/preact.umd.js.map +1 -1
  80. data/node_modules/preact/hooks/dist/hooks.js +1 -1
  81. data/node_modules/preact/hooks/dist/hooks.js.map +1 -1
  82. data/node_modules/preact/hooks/dist/hooks.mjs +1 -1
  83. data/node_modules/preact/hooks/dist/hooks.module.js +1 -1
  84. data/node_modules/preact/hooks/dist/hooks.module.js.map +1 -1
  85. data/node_modules/preact/hooks/dist/hooks.umd.js +1 -1
  86. data/node_modules/preact/hooks/dist/hooks.umd.js.map +1 -1
  87. data/node_modules/preact/hooks/package.json +26 -26
  88. data/node_modules/preact/hooks/src/index.d.ts +139 -139
  89. data/node_modules/preact/hooks/src/index.js +386 -388
  90. data/node_modules/preact/hooks/src/internal.d.ts +75 -75
  91. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
  92. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
  93. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
  94. data/node_modules/preact/jsx-runtime/package.json +19 -19
  95. data/node_modules/preact/jsx-runtime/src/index.d.ts +50 -50
  96. data/node_modules/preact/jsx-runtime/src/index.js +77 -77
  97. data/node_modules/preact/package.json +291 -287
  98. data/node_modules/preact/src/cjs.js +3 -3
  99. data/node_modules/preact/src/clone-element.js +34 -34
  100. data/node_modules/preact/src/component.js +225 -225
  101. data/node_modules/preact/src/constants.js +3 -3
  102. data/node_modules/preact/src/create-context.js +68 -68
  103. data/node_modules/preact/src/create-element.js +98 -98
  104. data/node_modules/preact/src/diff/catch-error.js +38 -38
  105. data/node_modules/preact/src/diff/children.js +335 -335
  106. data/node_modules/preact/src/diff/index.js +516 -516
  107. data/node_modules/preact/src/diff/props.js +158 -158
  108. data/node_modules/preact/src/index.d.ts +310 -310
  109. data/node_modules/preact/src/index.js +13 -13
  110. data/node_modules/preact/src/internal.d.ts +146 -146
  111. data/node_modules/preact/src/jsx.d.ts +1005 -1005
  112. data/node_modules/preact/src/options.js +16 -16
  113. data/node_modules/preact/src/render.js +75 -75
  114. data/node_modules/preact/src/util.js +27 -27
  115. data/node_modules/preact/test-utils/dist/testUtils.js.map +1 -1
  116. data/node_modules/preact/test-utils/dist/testUtils.module.js.map +1 -1
  117. data/node_modules/preact/test-utils/dist/testUtils.umd.js.map +1 -1
  118. data/node_modules/preact/test-utils/package.json +19 -19
  119. data/node_modules/preact/test-utils/src/index.d.ts +3 -3
  120. data/node_modules/preact/test-utils/src/index.js +117 -117
  121. data/package.json +1 -1
  122. metadata +9 -9
  123. data/lib/preact/component/params.rb +0 -18
  124. data/lib/preact/component/props.rb +0 -55
  125. data/lib/preact/component/state.rb +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dbb1ab44f4abdcc7cae7f4d2e1eddd2be46f9598e3e632447e80df5565751388
4
- data.tar.gz: 1d090bea6a1c20472951832066106c01455b711c785bd6c8978917adacf411de
3
+ metadata.gz: 2796e916f3c62cec0b330e99b7ac6fb46b368f059c3ed1278353211fc4c8370c
4
+ data.tar.gz: ad47708be18d9e8f781a8e5bbddbc8501667bafbdee75b9589656789245d656c
5
5
  SHA512:
6
- metadata.gz: 1a3fe6e155523191ea2f39e858406b94df39a1e2a6a6afac92394cfb4af34adf51b9e1b314ba17441f8009e3e19ff0143efdde441d35de3c41259425aa274498
7
- data.tar.gz: ccc2b7b87060ae70fcc603539c51c2444d0638349e4e679faf88e884755864d02f5fa2004878e95ffe17e7dea50cc8f595be99dd30999fbeaf8014f2645869fd
6
+ metadata.gz: 2d40522093a724e462b77833292c29622521832d1faac7cedf584eadf20ea4005a42de057252927eac7d1c96b847f4a19c62416722f1e818a058b3b97b04a2a2
7
+ data.tar.gz: 612ebd137795482e93c356869f32af3c4f50b4164ce629ff4c3822a4dda8a4fc748b34899ee771771c3e0e0e57e4198547c62fb7e2466f3b02b2215ce8198d25
@@ -68,7 +68,7 @@ module Isomorfeus
68
68
  let exception;
69
69
  if (typeof global.Opal.Isomorfeus.Transport !== 'undefined' && api_ws_path !== '') {
70
70
  global.Opal.Isomorfeus.TopLevel["$transport_ws_url="]("#{transport_ws_url}");
71
- global.Opal.send(global.Opal.Isomorfeus.Transport.$promise_connect(), 'then', [], ($$1 = function(){
71
+ global.Opal.send(global.Opal.Isomorfeus.Transport.$promise_connect(global.IsomorfeusSessionId), 'then', [], ($$1 = function(){
72
72
  try {
73
73
  global.Opal.Isomorfeus.TopLevel.$render_component_to_string('#{component_name}', #{Oj.dump(props, mode: :strict)});
74
74
  global.FirstPassFinished = 'transport';
@@ -77,7 +77,8 @@ module Isomorfeus
77
77
  global.FirstPassFinished = 'transport';
78
78
  }
79
79
  }, $$1.$$s = this, $$1.$$arity = 0, $$1))
80
- } else { return global.FirstPassFinished = true; };
80
+ return false;
81
+ } else { global.FirstPassFinished = true; return true; };
81
82
  JAVASCRIPT
82
83
  # execute first render pass
83
84
  begin
@@ -30,7 +30,7 @@ module Isomorfeus
30
30
 
31
31
  def ensure(v = nil, &block)
32
32
  if block_given?
33
- @validation_hash[:ensure_block] = block
33
+ @validation_hash[:ensure] = block
34
34
  else
35
35
  @validation_hash[:ensure] = v
36
36
  end
@@ -52,10 +52,12 @@ module Isomorfeus
52
52
 
53
53
  def ensure!
54
54
  if @o.key?(:ensure)
55
- @v = @o[:ensure] unless @v
56
- true
57
- elsif @o.key?(:ensure_block)
58
- @v = @o[:ensure_block].call(@v)
55
+ proc_or_val = @o[:ensure]
56
+ if proc_or_val.class == Proc
57
+ @v = proc_or_val.call(@v)
58
+ else
59
+ @v = proc_or_val
60
+ end
59
61
  true
60
62
  else
61
63
  false
@@ -21,7 +21,7 @@ if RUBY_ENGINE == 'opal'
21
21
 
22
22
  # nanocss
23
23
  require 'nano_css'
24
-
24
+
25
25
  # preact
26
26
  require 'preact/version'
27
27
  require 'preact'
@@ -31,7 +31,8 @@ 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/component/props'
34
+ require 'preact/params'
35
+ require 'preact/props'
35
36
 
36
37
  # HTML Elements and Fragment support
37
38
  require 'preact/component/elements'
@@ -45,8 +46,7 @@ if RUBY_ENGINE == 'opal'
45
46
  require 'preact/component/callbacks'
46
47
  require 'preact/component/initializer'
47
48
  require 'preact/component/native_component_constructor'
48
- require 'preact/component/state'
49
- require 'preact/component/params'
49
+ require 'preact/state'
50
50
  require 'preact/component/resolution'
51
51
  require 'preact/component/mixin'
52
52
  require 'preact/component/base'
@@ -2,7 +2,7 @@ module LucidComponent
2
2
  module Api
3
3
  def self.included(base)
4
4
  base.instance_exec do
5
- # store
5
+ # stores
6
6
  attr_accessor :app_store
7
7
  attr_accessor :class_store
8
8
  attr_accessor :store
@@ -4,11 +4,9 @@ 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
- @props = `Opal.Preact.Component.Props.$new(#@native)`
11
- @state = `Opal.Preact.Component.State.$new(#@native)`
8
+ @props = `Opal.Preact.Props.$new(#@native)`
9
+ @state = `Opal.Preact.State.$new(#@native)`
12
10
  end
13
11
  end
14
12
  end
@@ -2,7 +2,7 @@ module LucidFunc
2
2
  module Initializer
3
3
  def initialize
4
4
  self.JS[:native_props] = `{ props: null }`
5
- @native_props = `Opal.Preact.Component.Props.$new(#{self})`
5
+ @native_props = `Opal.Preact.Props.$new(#{self})`
6
6
  @app_store = LucidComponent::AppStoreProxy.new(self)
7
7
  @class_store = LucidComponent::ClassStoreProxy.new(self.class.to_s, self, self)
8
8
  @store = LucidComponent::InstanceStoreProxy.new(self)
@@ -3,7 +3,7 @@ module Preact
3
3
  module Initializer
4
4
  def initialize
5
5
  self.JS[:native_props] = `{ props: null }`
6
- @native_props = ::Preact::Component::Props.new(self)
6
+ @native_props = `Opal.Preact.Props.$new(self)`
7
7
  end
8
8
  end
9
9
  end
@@ -41,7 +41,7 @@ module Preact
41
41
  if (callback) { callback.call(); }
42
42
  }
43
43
  }
44
- @default_state = Preact::Component::State.new(`native_state`)
44
+ @default_state = `Opal.Preact.State.$new(native_state)`
45
45
  end
46
46
 
47
47
  def render(&block)
@@ -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)
@@ -41,8 +41,8 @@ module Preact
41
41
  %x{
42
42
  var fun = function(prev_props, prev_state, snapshot) {
43
43
  Opal.Preact.active_redux_components.push(this);
44
- #{`this.__ruby_instance`.instance_exec(`Opal.Preact.Component.Props.$new({props: prev_props})`,
45
- `Opal.Preact.Component.State.$new({state: prev_state})`,
44
+ #{`this.__ruby_instance`.instance_exec(`Opal.Preact.Props.$new({props: prev_props})`,
45
+ `Opal.Preact.State.$new({state: prev_state})`,
46
46
  `snapshot`, &block)};
47
47
  Opal.Preact.active_redux_components.pop();
48
48
  }
@@ -69,8 +69,8 @@ module Preact
69
69
  %x{
70
70
  var fun = function(props, state) {
71
71
  Opal.Preact.active_redux_components.push(this);
72
- var result = #{`this.__ruby_instance`.instance_exec(`Opal.Preact.Component.Props.$new({props: props})`,
73
- `Opal.Preact.Component.State.$new({state: state})`, &block)};
72
+ var result = #{`this.__ruby_instance`.instance_exec(`Opal.Preact.Props.$new({props: props})`,
73
+ `Opal.Preact.State.$new({state: state})`, &block)};
74
74
  Opal.Preact.active_redux_components.pop();
75
75
  if (typeof result.$to_n === 'function') { result = result.$to_n() }
76
76
  if (result === Opal.nil) { return null; }
@@ -85,8 +85,8 @@ module Preact
85
85
  %x{
86
86
  var fun = function(prev_props, prev_state) {
87
87
  Opal.Preact.active_redux_components.push(this);
88
- var result = #{`this.__ruby_instance`.instance_exec(`Opal.Preact.Component.Props.$new({props: prev_props})`,
89
- `Opal.Preact.Component.State.$new({state: prev_state})`, &block)};
88
+ var result = #{`this.__ruby_instance`.instance_exec(`Opal.Preact.Props.$new({props: prev_props})`,
89
+ `Opal.Preact.State.$new({state: prev_state})`, &block)};
90
90
  Opal.Preact.active_redux_components.pop();
91
91
  if (result === Opal.nil) { return null; }
92
92
  return result;
@@ -3,8 +3,8 @@ module Preact
3
3
  module Initializer
4
4
  def initialize(native_component)
5
5
  @native = native_component
6
- @props = `Opal.Preact.Component.Props.$new(#@native)`
7
- @state = `Opal.Preact.Component.State.$new(#@native)`
6
+ @props = `Opal.Preact.Props.$new(#@native)`
7
+ @state = `Opal.Preact.State.$new(#@native)`
8
8
  end
9
9
  end
10
10
  end
@@ -46,7 +46,7 @@ module Preact
46
46
  }
47
47
  shouldComponentUpdate(next_props, next_state) {
48
48
  if (base.should_component_update_block) {
49
- return #{!!`this.__ruby_instance`.instance_exec(Preact::Component::Props.new(`{props: next_props}`), Preact::Component::State.new(`{state: next_state }`), &`base.should_component_update_block`)};
49
+ return #{!!`this.__ruby_instance`.instance_exec(`Opal.Preact.Props.$new({props: next_props})`, `Opal.Preact.State.$new({state: next_state })`, &`base.should_component_update_block`)};
50
50
  }
51
51
  if (!Opal.Preact.props_are_equal(this.props, next_props)) { return true; }
52
52
  if (Opal.Preact.state_is_not_equal(this.state, next_state)) { return true; }
@@ -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
@@ -0,0 +1,51 @@
1
+ module Preact
2
+ class Props
3
+ def initialize(native)
4
+ @native = native
5
+ end
6
+
7
+ def ==(other_props)
8
+ %x{
9
+ if (Opal.Preact.props_are_equal(#@native.props, #{other_props.to_n})) { return true; }
10
+ return false;
11
+ }
12
+ end
13
+
14
+ def method_missing(prop, *args, &block)
15
+ %x{
16
+ const p = #@native.props;
17
+ if (typeof p[prop] === 'undefined') {
18
+ prop = Opal.Preact.lower_camelize(prop);
19
+ if (typeof p[prop] === 'undefined') { return nil; }
20
+ }
21
+ return p[prop];
22
+ }
23
+ end
24
+
25
+ def theme
26
+ `#@native.props.iso_theme`
27
+ end
28
+
29
+ def params
30
+ return @params if @params
31
+ return nil if `typeof #@native.props.params === 'undefined'`
32
+ @params = `Opal.Preact.Params.$new(#@native.props.params)`
33
+ end
34
+
35
+ def to_h
36
+ `Opal.Hash.$new(#@native.props)`.transform_keys!(&:underscore)
37
+ end
38
+
39
+ def to_json
40
+ JSON.dump(to_transport)
41
+ end
42
+
43
+ def to_n
44
+ `#@native.props`
45
+ end
46
+
47
+ def to_transport
48
+ {}.merge(to_h)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,67 @@
1
+ module Preact
2
+ class State
3
+ include ::Native::Wrapper
4
+
5
+ def initialize(native)
6
+ @native = native
7
+ end
8
+
9
+ def ==(other_state)
10
+ %x{
11
+ if (Opal.Preact.state_is_not_equal(#@native.state, #{other_state.to_raw_n})) { return false; }
12
+ return true;
13
+ }
14
+ end
15
+
16
+ def method_missing(key, *args, &block)
17
+ if `args.length > 0`
18
+ new_state = `{}`
19
+ new_state.JS[(`key.endsWith('=')` ? key.chop : key)] = args[0]
20
+ if block_given?
21
+ @native.JS.setState(new_state, `function() { block.$call(); }`)
22
+ else
23
+ @native.JS.setState(new_state, `null`)
24
+ end
25
+ else
26
+ %x{
27
+ if (typeof #@native.state[key] === 'undefined') { return nil; }
28
+ return #@native.state[key];
29
+ }
30
+ end
31
+ end
32
+
33
+ def set_state(updater, &block)
34
+ new_state = `{}`
35
+ updater.each do |key, value|
36
+ new_state.JS[key] = value
37
+ end
38
+ if block_given?
39
+ @native.JS.setState(new_state, `function() { block.$call(); }`)
40
+ else
41
+ @native.JS.setState(new_state, `null`)
42
+ end
43
+ end
44
+
45
+ def size
46
+ `Object.keys(#@native.state).length`;
47
+ end
48
+
49
+ def to_n
50
+ %x{
51
+ var new_native = {};
52
+ for (var key in #@native.state) {
53
+ if (typeof #@native.state[key].$to_n !== "undefined") {
54
+ new_native[key] = #@native.state[key].$to_n();
55
+ } else {
56
+ new_native[key] = #@native.state[key];
57
+ }
58
+ }
59
+ return new_native;
60
+ }
61
+ end
62
+
63
+ def to_raw_n
64
+ `#@native.state`
65
+ end
66
+ end
67
+ end
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.12'
2
+ VERSION = '10.6.16'
3
3
  end
data/lib/preact.rb CHANGED
@@ -256,14 +256,14 @@ module Preact
256
256
  `Opal.global.Preact.toChildArray(children)`
257
257
  end
258
258
 
259
- def self.clone_element(ruby_preact_element, props = nil, children = nil, &block)
259
+ def self.clone_element(native_preact_element, props = nil, children = nil, &block)
260
260
  block_result = `null`
261
261
  if block_given?
262
262
  block_result = block.call
263
263
  block_result = `null` unless block_result
264
264
  end
265
265
  native_props = props ? `Opal.Preact.to_native_preact_props(props)` : `null`
266
- `Opal.global.Preact.cloneElement(ruby_preact_element.$to_n(), native_props, block_result)`
266
+ `Opal.global.Preact.cloneElement(native_preact_element, native_props, block_result)`
267
267
  end
268
268
 
269
269
  def self.create_context(const_name, default_value)
@@ -4,9 +4,9 @@
4
4
  "requires": true,
5
5
  "packages": {
6
6
  "node_modules/preact": {
7
- "version": "10.6.4",
8
- "resolved": "https://registry.npmjs.org/preact/-/preact-10.6.4.tgz",
9
- "integrity": "sha512-WyosM7pxGcndU8hY0OQlLd54tOU+qmG45QXj2dAYrL11HoyU/EzOSTlpJsirbBr1QW7lICxSsVJJmcmUglovHQ==",
7
+ "version": "10.6.5",
8
+ "resolved": "https://registry.npmjs.org/preact/-/preact-10.6.5.tgz",
9
+ "integrity": "sha512-i+LXM6JiVjQXSt2jG2vZZFapGpCuk1fl8o6ii3G84MA3xgj686FKjs4JFDkmUVhtxyq21+4ay74zqPykz9hU6w==",
10
10
  "funding": {
11
11
  "type": "opencollective",
12
12
  "url": "https://opencollective.com/preact"
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015-present Jason Miller
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-present Jason Miller
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.