isomorfeus-preact 10.6.32 → 10.6.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isomorfeus/preact_view_helper.rb +11 -11
  3. data/lib/isomorfeus-preact.rb +15 -0
  4. data/lib/isomorfeus_preact/lucid_app/api.rb +30 -32
  5. data/lib/isomorfeus_preact/lucid_app/mixin.rb +12 -13
  6. data/lib/isomorfeus_preact/lucid_app/native_component_constructor.rb +88 -90
  7. data/lib/isomorfeus_preact/lucid_component/api.rb +95 -98
  8. data/lib/isomorfeus_preact/lucid_component/initializer.rb +7 -10
  9. data/lib/isomorfeus_preact/lucid_component/mixin.rb +11 -12
  10. data/lib/isomorfeus_preact/lucid_component/native_component_constructor.rb +77 -79
  11. data/lib/isomorfeus_preact/lucid_func/initializer.rb +6 -9
  12. data/lib/isomorfeus_preact/lucid_func/mixin.rb +8 -9
  13. data/lib/isomorfeus_preact/lucid_func/native_component_constructor.rb +49 -51
  14. data/lib/isomorfeus_preact/preact/function_component/api.rb +102 -106
  15. data/lib/isomorfeus_preact/preact/function_component/base.rb +5 -7
  16. data/lib/isomorfeus_preact/preact/function_component/initializer.rb +4 -8
  17. data/lib/isomorfeus_preact/preact/function_component/mixin.rb +6 -10
  18. data/lib/isomorfeus_preact/preact/function_component/native_component_constructor.rb +41 -45
  19. data/lib/lucid_app/context.rb +1 -1
  20. data/lib/nano_css.rb +10 -10
  21. data/lib/preact/component/api.rb +99 -103
  22. data/lib/preact/component/base.rb +5 -7
  23. data/lib/preact/component/callbacks.rb +99 -103
  24. data/lib/preact/component/initializer.rb +5 -9
  25. data/lib/preact/component/mixin.rb +9 -13
  26. data/lib/preact/component/native_component_constructor.rb +67 -71
  27. data/lib/preact/component_resolution.rb +78 -80
  28. data/lib/preact/elements.rb +55 -57
  29. data/lib/preact/version.rb +1 -1
  30. data/node_modules/.package-lock.json +3 -3
  31. data/node_modules/preact/compat/LICENSE +21 -0
  32. data/node_modules/preact/compat/jsx-dev-runtime.js +2 -0
  33. data/node_modules/preact/compat/jsx-dev-runtime.mjs +2 -0
  34. data/node_modules/preact/compat/jsx-runtime.js +2 -0
  35. data/node_modules/preact/compat/jsx-runtime.mjs +2 -0
  36. data/node_modules/preact/debug/LICENSE +21 -0
  37. data/node_modules/preact/devtools/LICENSE +21 -0
  38. data/node_modules/preact/devtools/dist/devtools.js +1 -1
  39. data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
  40. data/node_modules/preact/devtools/dist/devtools.mjs +1 -1
  41. data/node_modules/preact/devtools/dist/devtools.module.js +1 -1
  42. data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
  43. data/node_modules/preact/devtools/dist/devtools.umd.js +1 -1
  44. data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
  45. data/node_modules/preact/devtools/src/devtools.js +1 -1
  46. data/node_modules/preact/dist/preact.js +1 -1
  47. data/node_modules/preact/dist/preact.js.map +1 -1
  48. data/node_modules/preact/dist/preact.min.js +1 -1
  49. data/node_modules/preact/dist/preact.min.js.map +1 -1
  50. data/node_modules/preact/dist/preact.mjs +1 -1
  51. data/node_modules/preact/dist/preact.module.js +1 -1
  52. data/node_modules/preact/dist/preact.module.js.map +1 -1
  53. data/node_modules/preact/dist/preact.umd.js +1 -1
  54. data/node_modules/preact/dist/preact.umd.js.map +1 -1
  55. data/node_modules/preact/hooks/LICENSE +21 -0
  56. data/node_modules/preact/jsx-runtime/LICENSE +21 -0
  57. data/node_modules/preact/package.json +1 -1
  58. data/node_modules/preact/src/diff/index.js +6 -3
  59. data/package.json +1 -1
  60. metadata +11 -7
  61. data/lib/isomorfeus_preact/lucid_component/instance_store_proxy.rb +0 -44
@@ -1,11 +1,7 @@
1
- module Preact
2
- module Component
3
- module Initializer
4
- def initialize(native_component)
5
- @native = native_component
6
- @props = `Opal.Preact.Props.$new(#@native)`
7
- @state = `Opal.Preact.State.$new(#@native)`
8
- end
9
- end
1
+ module Preact::Component::Initializer
2
+ def initialize(native_component)
3
+ @native = native_component
4
+ @props = `Opal.Preact.Props.$new(#@native)`
5
+ @state = `Opal.Preact.State.$new(#@native)`
10
6
  end
11
7
  end
@@ -1,15 +1,11 @@
1
- module Preact
2
- module Component
3
- module Mixin
4
- def self.included(base)
5
- base.include(::Native::Wrapper)
6
- base.extend(::Preact::Component::NativeComponentConstructor)
7
- base.extend(::LucidPropDeclaration::Mixin)
8
- base.include(::Preact::Elements)
9
- base.include(::Preact::Component::Api)
10
- base.include(::Preact::Component::Callbacks)
11
- base.include(::Preact::Component::Initializer)
12
- end
13
- end
1
+ module Preact::Component::Mixin
2
+ def self.included(base)
3
+ base.include(::Native::Wrapper)
4
+ base.extend(::Preact::Component::NativeComponentConstructor)
5
+ base.extend(::LucidPropDeclaration::Mixin)
6
+ base.include(::Preact::Elements)
7
+ base.include(::Preact::Component::Api)
8
+ base.include(::Preact::Component::Callbacks)
9
+ base.include(::Preact::Component::Initializer)
14
10
  end
15
11
  end
@@ -1,81 +1,77 @@
1
- module Preact
2
- module Component
3
- module NativeComponentConstructor
4
- # for should_component_update we apply ruby semantics for comparing props
5
- # to do so, we convert the props to ruby hashes and then compare
6
- # this makes sure, that for example rubys Nil object gets handled properly
7
- def self.extended(base)
8
- component_name = base.to_s
9
- %x{
10
- base.preact_component = class extends Opal.global.Preact.Component {
11
- constructor(props) {
12
- super(props);
13
- if (base.$default_state_defined()) {
14
- this.state = base.$state().$to_n();
15
- } else {
16
- this.state = {};
17
- };
18
- this.__ruby_instance = base.$new(this);
19
- var defined_refs = #{base.defined_refs};
20
- for (var ref in defined_refs) {
21
- if (defined_refs[ref] != null) {
22
- let r = ref; // to ensure closure for function below gets correct ref name
23
- this[ref] = function(element) {
24
- const oper = Opal.Preact;
25
- element = oper.native_element_or_component_to_ruby(element);
26
- oper.register_active_component(this);
27
- try {
28
- #{`this.__ruby_instance`.instance_exec(`element`, &`defined_refs[r]`)}
29
- } catch (e) { console.error(e.message === nil ? 'error at' : e.message, e.stack); }
30
- oper.unregister_active_component(this);
31
- }
32
- this[ref] = this[ref].bind(this);
33
- } else {
34
- this[ref] = Opal.global.Preact.createRef();
35
- }
36
- }
37
- }
38
- static get displayName() {
39
- return #{component_name};
40
- }
41
- render(props, state) {
42
- const oper = Opal.Preact;
43
- oper.render_buffer.push([]);
44
- oper.register_active_component(this);
45
- try {
46
- let block_result = #{`this.__ruby_instance`.instance_exec(&`base.render_block`)};
47
- if (block_result && block_result !== nil) { oper.render_block_result(block_result); }
48
- } catch (e) {
49
- if (oper.using_did_catch) { throw e; }
50
- else { console.error(e.message === nil ? 'error at' : e.message, e.stack); }
51
- }
52
- oper.unregister_active_component(this);
53
- let result = oper.render_buffer.pop();
54
- return (result.length === 1) ? result[0] : result;
55
- }
56
- shouldComponentUpdate(next_props, next_state) {
57
- const oper = Opal.Preact;
58
- if (base.should_component_update_block) {
1
+ module Preact::Component::NativeComponentConstructor
2
+ # for should_component_update we apply ruby semantics for comparing props
3
+ # to do so, we convert the props to ruby hashes and then compare
4
+ # this makes sure, that for example rubys Nil object gets handled properly
5
+ def self.extended(base)
6
+ component_name = base.to_s
7
+ %x{
8
+ base.preact_component = class extends Opal.global.Preact.Component {
9
+ constructor(props) {
10
+ super(props);
11
+ if (base.$default_state_defined()) {
12
+ this.state = base.$state().$to_n();
13
+ } else {
14
+ this.state = {};
15
+ };
16
+ this.__ruby_instance = base.$new(this);
17
+ var defined_refs = #{base.defined_refs};
18
+ for (var ref in defined_refs) {
19
+ if (defined_refs[ref] != null) {
20
+ let r = ref; // to ensure closure for function below gets correct ref name
21
+ this[ref] = function(element) {
22
+ const oper = Opal.Preact;
23
+ element = oper.native_element_or_component_to_ruby(element);
59
24
  oper.register_active_component(this);
60
- let result;
61
25
  try {
62
- result = #{!!`this.__ruby_instance`.instance_exec(`oper.Props.$new({props: next_props})`, `oper.State.$new({state: next_state })`, &`base.should_component_update_block`)};
26
+ #{`this.__ruby_instance`.instance_exec(`element`, &`defined_refs[r]`)}
63
27
  } catch (e) { console.error(e.message === nil ? 'error at' : e.message, e.stack); }
64
28
  oper.unregister_active_component(this);
65
- return result;
66
29
  }
67
- if (!oper.props_are_equal(this.props, next_props)) { return true; }
68
- if (oper.state_is_not_equal(this.state, next_state)) { return true; }
69
- return false;
70
- }
71
- validateProp(props, propName, componentName) {
72
- try { base.$validate_prop(propName, props[propName]) }
73
- catch (e) { return new Error(componentName + " Error: prop validation failed: " + e.message); }
74
- return null;
30
+ this[ref] = this[ref].bind(this);
31
+ } else {
32
+ this[ref] = Opal.global.Preact.createRef();
75
33
  }
76
34
  }
77
35
  }
78
- end
79
- end
36
+ static get displayName() {
37
+ return #{component_name};
38
+ }
39
+ render(props, state) {
40
+ const oper = Opal.Preact;
41
+ oper.render_buffer.push([]);
42
+ oper.register_active_component(this);
43
+ try {
44
+ let block_result = #{`this.__ruby_instance`.instance_exec(&`base.render_block`)};
45
+ if (block_result && block_result !== nil) { oper.render_block_result(block_result); }
46
+ } catch (e) {
47
+ if (oper.using_did_catch) { throw e; }
48
+ else { console.error(e.message === nil ? 'error at' : e.message, e.stack); }
49
+ }
50
+ oper.unregister_active_component(this);
51
+ let result = oper.render_buffer.pop();
52
+ return (result.length === 1) ? result[0] : result;
53
+ }
54
+ shouldComponentUpdate(next_props, next_state) {
55
+ const oper = Opal.Preact;
56
+ if (base.should_component_update_block) {
57
+ oper.register_active_component(this);
58
+ let result;
59
+ try {
60
+ result = #{!!`this.__ruby_instance`.instance_exec(`oper.Props.$new({props: next_props})`, `oper.State.$new({state: next_state })`, &`base.should_component_update_block`)};
61
+ } catch (e) { console.error(e.message === nil ? 'error at' : e.message, e.stack); }
62
+ oper.unregister_active_component(this);
63
+ return result;
64
+ }
65
+ if (!oper.props_are_equal(this.props, next_props)) { return true; }
66
+ if (oper.state_is_not_equal(this.state, next_state)) { return true; }
67
+ return false;
68
+ }
69
+ validateProp(props, propName, componentName) {
70
+ try { base.$validate_prop(propName, props[propName]) }
71
+ catch (e) { return new Error(componentName + " Error: prop validation failed: " + e.message); }
72
+ return null;
73
+ }
74
+ }
75
+ }
80
76
  end
81
77
  end
@@ -1,94 +1,92 @@
1
- module Preact
2
- module ComponentResolution
3
- def self.included(base)
4
- base.instance_exec do
5
- unless method_defined?(:_preact_component_class_resolution_original_const_missing)
6
- alias _preact_component_class_resolution_original_const_missing const_missing
7
- end
1
+ module Preact::ComponentResolution
2
+ def self.included(base)
3
+ base.instance_exec do
4
+ unless method_defined?(:_preact_component_class_resolution_original_const_missing)
5
+ alias _preact_component_class_resolution_original_const_missing const_missing
6
+ end
8
7
 
9
- def const_missing(const_name)
10
- %x{
11
- if (typeof Opal.global[const_name] !== "undefined" && (const_name[0] === const_name[0].toUpperCase())) {
12
- var new_const = Opal.Preact.NativeConstantWrapper.$new(Opal.global[const_name], const_name);
13
- new_const.preact_component = Opal.global[const_name];
14
- Opal.Object.$const_set(const_name, new_const);
15
- return new_const;
16
- } else {
17
- return #{_preact_component_class_resolution_original_const_missing(const_name)};
18
- }
8
+ def const_missing(const_name)
9
+ %x{
10
+ if (typeof Opal.global[const_name] !== "undefined" && (const_name[0] === const_name[0].toUpperCase())) {
11
+ var new_const = Opal.Preact.NativeConstantWrapper.$new(Opal.global[const_name], const_name);
12
+ new_const.preact_component = Opal.global[const_name];
13
+ Opal.Object.$const_set(const_name, new_const);
14
+ return new_const;
15
+ } else {
16
+ return #{_preact_component_class_resolution_original_const_missing(const_name)};
19
17
  }
20
- end
18
+ }
19
+ end
21
20
 
22
- # this is required for autoloading support, as the component may not be loaded and so its method is not registered.
23
- # must load it first, done by const_get, and next time the method will be there.
24
- unless method_defined?(:_preact_component_class_resolution_original_method_missing)
25
- alias _preact_component_class_resolution_original_method_missing method_missing
26
- end
21
+ # this is required for autoloading support, as the component may not be loaded and so its method is not registered.
22
+ # must load it first, done by const_get, and next time the method will be there.
23
+ unless method_defined?(:_preact_component_class_resolution_original_method_missing)
24
+ alias _preact_component_class_resolution_original_method_missing method_missing
25
+ end
27
26
 
28
- def method_missing(component_name, *args, &block)
29
- # check for ruby component and render it
30
- # otherwise pass on method missing
31
- %x{
32
- var constant = null;
33
- if (typeof self.iso_preact_const_cache === 'undefined') { self.iso_preact_const_cache = {}; }
34
- if (typeof self.iso_preact_const_cache[component_name] !== 'undefined') {
35
- constant = self.iso_preact_const_cache[component_name]
36
- } else {
37
- try {
38
- constant = self.$const_get(component_name);
39
- self.iso_preact_const_cache[component_name] = constant;
40
- } catch(err) { }
41
- }
42
- if (constant && typeof constant.preact_component !== 'undefined') {
43
- return Opal.Preact.internal_prepare_args_and_render(constant.preact_component, args, block);
44
- }
45
- return #{_preact_component_class_resolution_original_method_missing(component_name, *args, block)};
27
+ def method_missing(component_name, *args, &block)
28
+ # check for ruby component and render it
29
+ # otherwise pass on method missing
30
+ %x{
31
+ var constant = null;
32
+ if (typeof self.iso_preact_const_cache === 'undefined') { self.iso_preact_const_cache = {}; }
33
+ if (typeof self.iso_preact_const_cache[component_name] !== 'undefined') {
34
+ constant = self.iso_preact_const_cache[component_name]
35
+ } else {
36
+ try {
37
+ constant = self.$const_get(component_name);
38
+ self.iso_preact_const_cache[component_name] = constant;
39
+ } catch(err) { }
40
+ }
41
+ if (constant && typeof constant.preact_component !== 'undefined') {
42
+ return Opal.Preact.internal_prepare_args_and_render(constant.preact_component, args, block);
46
43
  }
47
- end
44
+ return #{_preact_component_class_resolution_original_method_missing(component_name, *args, block)};
45
+ }
48
46
  end
49
47
  end
48
+ end
50
49
 
51
- unless method_defined?(:_preact_component_resolution_original_method_missing)
52
- alias _preact_component_resolution_original_method_missing method_missing
53
- end
50
+ unless method_defined?(:_preact_component_resolution_original_method_missing)
51
+ alias _preact_component_resolution_original_method_missing method_missing
52
+ end
54
53
 
55
- def method_missing(component_name, *args, &block)
56
- # Further on it must check for modules, because $const_get does not take
57
- # the full nesting into account, as usually its called via $$ with the
58
- # nesting provided by the compiler.
59
- %x{
60
- var constant;
61
- if (typeof self.iso_preact_const_cache === 'undefined') { self.iso_preact_const_cache = {}; }
62
- if (typeof self.iso_preact_const_cache[component_name] !== 'undefined') {
63
- constant = self.iso_preact_const_cache[component_name]
64
- } else if (typeof self.$$is_a_module !== 'undefined') {
65
- try {
66
- constant = self.$const_get(component_name);
67
- self.iso_preact_const_cache[component_name] = constant;
68
- } catch(err) { }
69
- } else {
70
- let sc = self.$class();
71
- try {
72
- constant = sc.$const_get(component_name);
73
- self.iso_preact_const_cache[component_name] = constant;
74
- } catch(err) {
75
- var module_names = sc.$to_s().split("::");
76
- var module_name;
77
- for (var i = module_names.length - 1; i > 0; i--) {
78
- module_name = module_names.slice(0, i).join('::');
79
- try {
80
- constant = sc.$const_get(module_name).$const_get(component_name, false);
81
- self.iso_preact_const_cache[component_name] = constant;
82
- break;
83
- } catch(err) { }
84
- }
54
+ def method_missing(component_name, *args, &block)
55
+ # Further on it must check for modules, because $const_get does not take
56
+ # the full nesting into account, as usually its called via $$ with the
57
+ # nesting provided by the compiler.
58
+ %x{
59
+ var constant;
60
+ if (typeof self.iso_preact_const_cache === 'undefined') { self.iso_preact_const_cache = {}; }
61
+ if (typeof self.iso_preact_const_cache[component_name] !== 'undefined') {
62
+ constant = self.iso_preact_const_cache[component_name]
63
+ } else if (typeof self.$$is_a_module !== 'undefined') {
64
+ try {
65
+ constant = self.$const_get(component_name);
66
+ self.iso_preact_const_cache[component_name] = constant;
67
+ } catch(err) { }
68
+ } else {
69
+ let sc = self.$class();
70
+ try {
71
+ constant = sc.$const_get(component_name);
72
+ self.iso_preact_const_cache[component_name] = constant;
73
+ } catch(err) {
74
+ var module_names = sc.$to_s().split("::");
75
+ var module_name;
76
+ for (var i = module_names.length - 1; i > 0; i--) {
77
+ module_name = module_names.slice(0, i).join('::');
78
+ try {
79
+ constant = sc.$const_get(module_name).$const_get(component_name, false);
80
+ self.iso_preact_const_cache[component_name] = constant;
81
+ break;
82
+ } catch(err) { }
85
83
  }
86
84
  }
87
- if (constant && typeof constant.preact_component !== 'undefined') {
88
- return Opal.Preact.internal_prepare_args_and_render(constant.preact_component, args, block);
89
- }
90
- return #{_preact_component_resolution_original_method_missing(component_name, *args, block)};
91
85
  }
92
- end
86
+ if (constant && typeof constant.preact_component !== 'undefined') {
87
+ return Opal.Preact.internal_prepare_args_and_render(constant.preact_component, args, block);
88
+ }
89
+ return #{_preact_component_resolution_original_method_missing(component_name, *args, block)};
90
+ }
93
91
  end
94
92
  end
@@ -1,62 +1,60 @@
1
- module Preact
2
- module Elements
3
- # https://www.w3.org/TR/html52/fullindex.html#index-elements
4
- # https://www.w3.org/TR/SVG11/eltindex.html
5
- SUPPORTED_HTML_AND_SVG_ELEMENTS = %w[
6
- a abbr address area article aside audio
7
- b base bdi bdo blockquote body br button
8
- canvas caption cite code col colgroup
9
- data datalist dd del details dfn dialog div dl dt
10
- em embed
11
- fieldset figcaption figure footer form
12
- h1 h2 h3 h4 h5 h6 head header hr html
13
- i iframe img input ins
14
- kbd
15
- label legend li link
16
- main map mark meta meter
17
- nav noscript
18
- object ol optgroup option output
19
- p param picture pre progress
20
- q
21
- rp rt rtc ruby
22
- s samp script section select small source span strong style sub summary sup
23
- table tbody td template textarea tfoot th thead time title tr track
24
- u ul
25
- var video
26
- wbr
27
- altGlyph altGlyphDef altGlyphItem animate animateColor animateMotion animateTransform
28
- circle clipPath color-profile cursor
29
- defs desc
30
- ellipse
31
- feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting
32
- feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur
33
- feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting
34
- feSpotLight feTile feTurbulence
35
- filter font font-face font-face-format font-face-name font-face-src font-face-uri foreignObject
36
- g glyph glyphRef
37
- hkern
38
- image
39
- line linearGradient
40
- marker mask metadata missing-glyph mpath
41
- path pattern polygon polyline
42
- radialGradient rect
43
- script set stop style svg switch symbol
44
- text textPath tref tspan
45
- use
46
- view vkern
47
- ]
1
+ module Preact::Elements
2
+ # https://www.w3.org/TR/html52/fullindex.html#index-elements
3
+ # https://www.w3.org/TR/SVG11/eltindex.html
4
+ SUPPORTED_HTML_AND_SVG_ELEMENTS = %w[
5
+ a abbr address area article aside audio
6
+ b base bdi bdo blockquote body br button
7
+ canvas caption cite code col colgroup
8
+ data datalist dd del details dfn dialog div dl dt
9
+ em embed
10
+ fieldset figcaption figure footer form
11
+ h1 h2 h3 h4 h5 h6 head header hr html
12
+ i iframe img input ins
13
+ kbd
14
+ label legend li link
15
+ main map mark meta meter
16
+ nav noscript
17
+ object ol optgroup option output
18
+ p param picture pre progress
19
+ q
20
+ rp rt rtc ruby
21
+ s samp script section select small source span strong style sub summary sup
22
+ table tbody td template textarea tfoot th thead time title tr track
23
+ u ul
24
+ var video
25
+ wbr
26
+ altGlyph altGlyphDef altGlyphItem animate animateColor animateMotion animateTransform
27
+ circle clipPath color-profile cursor
28
+ defs desc
29
+ ellipse
30
+ feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting
31
+ feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur
32
+ feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting
33
+ feSpotLight feTile feTurbulence
34
+ filter font font-face font-face-format font-face-name font-face-src font-face-uri foreignObject
35
+ g glyph glyphRef
36
+ hkern
37
+ image
38
+ line linearGradient
39
+ marker mask metadata missing-glyph mpath
40
+ path pattern polygon polyline
41
+ radialGradient rect
42
+ script set stop style svg switch symbol
43
+ text textPath tref tspan
44
+ use
45
+ view vkern
46
+ ]
48
47
 
49
- SUPPORTED_HTML_AND_SVG_ELEMENTS.each do |element|
50
- define_method(element) do |*args, &block|
51
- `Opal.Preact.internal_prepare_args_and_render(element, args, block)`
52
- end
53
- define_method(`element.toUpperCase()`) do |*args, &block|
54
- `Opal.Preact.internal_prepare_args_and_render(element, args, block)`
55
- end
48
+ SUPPORTED_HTML_AND_SVG_ELEMENTS.each do |element|
49
+ define_method(element) do |*args, &block|
50
+ `Opal.Preact.internal_prepare_args_and_render(element, args, block)`
56
51
  end
57
-
58
- def Fragment(*args, &block)
59
- `Opal.Preact.internal_prepare_args_and_render(Opal.global.Preact.Fragment, args, block)`
52
+ define_method(`element.toUpperCase()`) do |*args, &block|
53
+ `Opal.Preact.internal_prepare_args_and_render(element, args, block)`
60
54
  end
61
55
  end
56
+
57
+ def Fragment(*args, &block)
58
+ `Opal.Preact.internal_prepare_args_and_render(Opal.global.Preact.Fragment, args, block)`
59
+ end
62
60
  end
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.32'
2
+ VERSION = '10.6.36'
3
3
  end
@@ -4,9 +4,9 @@
4
4
  "requires": true,
5
5
  "packages": {
6
6
  "node_modules/preact": {
7
- "version": "10.6.5",
8
- "resolved": "https://registry.npmjs.org/preact/-/preact-10.6.5.tgz",
9
- "integrity": "sha512-i+LXM6JiVjQXSt2jG2vZZFapGpCuk1fl8o6ii3G84MA3xgj686FKjs4JFDkmUVhtxyq21+4ay74zqPykz9hU6w==",
7
+ "version": "10.6.6",
8
+ "resolved": "https://registry.npmjs.org/preact/-/preact-10.6.6.tgz",
9
+ "integrity": "sha512-dgxpTFV2vs4vizwKohYKkk7g7rmp1wOOcfd4Tz3IB3Wi+ivZzsn/SpeKJhRENSE+n8sUfsAl4S3HiCVT923ABw==",
10
10
  "funding": {
11
11
  "type": "opencollective",
12
12
  "url": "https://opencollective.com/preact"
@@ -0,0 +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 +1,3 @@
1
+ require('preact/compat');
2
+
1
3
  module.exports = require('preact/jsx-runtime');
@@ -1 +1,3 @@
1
+ import 'preact/compat';
2
+
1
3
  export * from 'preact/jsx-runtime';
@@ -1 +1,3 @@
1
+ require('preact/compat');
2
+
1
3
  module.exports = require('preact/jsx-runtime');
@@ -1 +1,3 @@
1
+ import 'preact/compat';
2
+
1
3
  export * from 'preact/jsx-runtime';
@@ -0,0 +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.
@@ -0,0 +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,2 +1,2 @@
1
- var n=require("preact");"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.5",n.options,{Fragment:n.Fragment,Component:n.Component}),exports.addHookName=function(e,o){return n.options.__a&&n.options.__a(o),e};
1
+ var n=require("preact");"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.6",n.options,{Fragment:n.Fragment,Component:n.Component}),exports.addHookName=function(e,o){return n.options.__a&&n.options.__a(o),e};
2
2
  //# sourceMappingURL=devtools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"devtools.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { options, Fragment, Component } from 'preact';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.6.5', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","import { options } from 'preact';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n"],"names":["window","__PREACT_DEVTOOLS__","attachPreact","options","Fragment","Component","value","name"],"mappings":"wBAGsB,oBAAVA,QAAyBA,OAAOC,qBAC1CD,OAAOC,oBAAoBC,aAAa,SAAUC,UAAS,CAC1DC,SAAAA,WACAC,UAAAA,kCCGI,SAAqBC,EAAOC,UAC9BJ,eACHA,cAAqBI,GAEfD"}
1
+ {"version":3,"file":"devtools.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { options, Fragment, Component } from 'preact';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.6.6', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","import { options } from 'preact';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n"],"names":["window","__PREACT_DEVTOOLS__","attachPreact","options","Fragment","Component","value","name"],"mappings":"wBAGsB,oBAAVA,QAAyBA,OAAOC,qBAC1CD,OAAOC,oBAAoBC,aAAa,SAAUC,UAAS,CAC1DC,SAAAA,WACAC,UAAAA,kCCGI,SAAqBC,EAAOC,UAC9BJ,eACHA,cAAqBI,GAEfD"}
@@ -1,2 +1,2 @@
1
- import{options as n,Fragment as o,Component as e}from"preact";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.5",n,{Fragment:o,Component:e});export{t as addHookName};
1
+ import{options as n,Fragment as o,Component as e}from"preact";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.6",n,{Fragment:o,Component:e});export{t as addHookName};
2
2
  //# sourceMappingURL=devtools.module.js.map
@@ -1,2 +1,2 @@
1
- import{options as n,Fragment as o,Component as e}from"preact";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.5",n,{Fragment:o,Component:e});export{t as addHookName};
1
+ import{options as n,Fragment as o,Component as e}from"preact";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.6",n,{Fragment:o,Component:e});export{t as addHookName};
2
2
  //# sourceMappingURL=devtools.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"devtools.module.js","sources":["../src/index.js","../src/devtools.js"],"sourcesContent":["import { options } from 'preact';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n","import { options, Fragment, Component } from 'preact';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.6.5', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n"],"names":["addHookName","value","name","options","window","__PREACT_DEVTOOLS__","attachPreact","Fragment","Component"],"mappings":"8DASO,SAASA,EAAYC,EAAOC,UAC9BC,OACHA,MAAqBD,GAEfD,ECVc,oBAAVG,QAAyBA,OAAOC,qBAC1CD,OAAOC,oBAAoBC,aAAa,SAAUH,EAAS,CAC1DI,SAAAA,EACAC,UAAAA"}
1
+ {"version":3,"file":"devtools.module.js","sources":["../src/index.js","../src/devtools.js"],"sourcesContent":["import { options } from 'preact';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n","import { options, Fragment, Component } from 'preact';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.6.6', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n"],"names":["addHookName","value","name","options","window","__PREACT_DEVTOOLS__","attachPreact","Fragment","Component"],"mappings":"8DASO,SAASA,EAAYC,EAAOC,UAC9BC,OACHA,MAAqBD,GAEfD,ECVc,oBAAVG,QAAyBA,OAAOC,qBAC1CD,OAAOC,oBAAoBC,aAAa,SAAUH,EAAS,CAC1DI,SAAAA,EACAC,UAAAA"}