isomorfeus-react 16.9.24 → 16.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. metadata +3 -85
  3. data/README.md +0 -64
  4. data/lib/browser/delegate_native.rb +0 -70
  5. data/lib/browser/element.rb +0 -176
  6. data/lib/browser/element/canvas.rb +0 -17
  7. data/lib/browser/element/media.rb +0 -78
  8. data/lib/browser/event.rb +0 -92
  9. data/lib/browser/event_target.rb +0 -39
  10. data/lib/browser/file_list.rb +0 -125
  11. data/lib/browser/iterable.rb +0 -15
  12. data/lib/isomorfeus-react-material-ui.rb +0 -10
  13. data/lib/isomorfeus-react.rb +0 -145
  14. data/lib/isomorfeus/config.rb +0 -130
  15. data/lib/isomorfeus/props/validate_hash_proxy.rb +0 -178
  16. data/lib/isomorfeus/props/validator.rb +0 -131
  17. data/lib/isomorfeus/react_view_helper.rb +0 -130
  18. data/lib/isomorfeus/top_level.rb +0 -86
  19. data/lib/isomorfeus/top_level_ssr.rb +0 -28
  20. data/lib/lucid_app/api.rb +0 -30
  21. data/lib/lucid_app/base.rb +0 -7
  22. data/lib/lucid_app/context.rb +0 -7
  23. data/lib/lucid_app/mixin.rb +0 -20
  24. data/lib/lucid_app/native_component_constructor.rb +0 -105
  25. data/lib/lucid_component/app_store_defaults.rb +0 -36
  26. data/lib/lucid_component/app_store_proxy.rb +0 -38
  27. data/lib/lucid_component/base.rb +0 -7
  28. data/lib/lucid_component/class_store_proxy.rb +0 -41
  29. data/lib/lucid_component/component_class_store_defaults.rb +0 -38
  30. data/lib/lucid_component/component_instance_store_defaults.rb +0 -35
  31. data/lib/lucid_component/event_handler.rb +0 -17
  32. data/lib/lucid_component/initializer.rb +0 -12
  33. data/lib/lucid_component/instance_store_proxy.rb +0 -45
  34. data/lib/lucid_component/mixin.rb +0 -18
  35. data/lib/lucid_component/native_component_constructor.rb +0 -116
  36. data/lib/lucid_component/reducers.rb +0 -48
  37. data/lib/lucid_component/store_api.rb +0 -38
  38. data/lib/lucid_component/styles_support.rb +0 -37
  39. data/lib/lucid_material/app/base.rb +0 -9
  40. data/lib/lucid_material/app/mixin.rb +0 -22
  41. data/lib/lucid_material/app/native_component_constructor.rb +0 -107
  42. data/lib/lucid_material/component/base.rb +0 -9
  43. data/lib/lucid_material/component/mixin.rb +0 -20
  44. data/lib/lucid_material/component/native_component_constructor.rb +0 -118
  45. data/lib/lucid_prop_declaration/mixin.rb +0 -91
  46. data/lib/react.rb +0 -195
  47. data/lib/react/active_support_support.rb +0 -13
  48. data/lib/react/children.rb +0 -35
  49. data/lib/react/component/api.rb +0 -80
  50. data/lib/react/component/base.rb +0 -9
  51. data/lib/react/component/callbacks.rb +0 -106
  52. data/lib/react/component/elements.rb +0 -60
  53. data/lib/react/component/event_handler.rb +0 -19
  54. data/lib/react/component/features.rb +0 -47
  55. data/lib/react/component/history.rb +0 -36
  56. data/lib/react/component/initializer.rb +0 -11
  57. data/lib/react/component/location.rb +0 -15
  58. data/lib/react/component/match.rb +0 -31
  59. data/lib/react/component/mixin.rb +0 -19
  60. data/lib/react/component/native_component_constructor.rb +0 -93
  61. data/lib/react/component/props.rb +0 -59
  62. data/lib/react/component/resolution.rb +0 -70
  63. data/lib/react/component/should_component_update.rb +0 -14
  64. data/lib/react/component/state.rb +0 -52
  65. data/lib/react/component/styles.rb +0 -27
  66. data/lib/react/component/unsafe_api.rb +0 -33
  67. data/lib/react/context_wrapper.rb +0 -46
  68. data/lib/react/function_component/api.rb +0 -63
  69. data/lib/react/function_component/base.rb +0 -9
  70. data/lib/react/function_component/creator.rb +0 -32
  71. data/lib/react/function_component/event_handler.rb +0 -13
  72. data/lib/react/function_component/mixin.rb +0 -14
  73. data/lib/react/function_component/resolution.rb +0 -62
  74. data/lib/react/memo_component/base.rb +0 -9
  75. data/lib/react/memo_component/creator.rb +0 -32
  76. data/lib/react/memo_component/mixin.rb +0 -14
  77. data/lib/react/native_constant_wrapper.rb +0 -26
  78. data/lib/react/pure_component/base.rb +0 -9
  79. data/lib/react/pure_component/mixin.rb +0 -18
  80. data/lib/react/ref.rb +0 -13
  81. data/lib/react/synthetic_event.rb +0 -53
  82. data/lib/react/version.rb +0 -3
  83. data/lib/react_dom.rb +0 -47
  84. data/lib/react_dom_server.rb +0 -19
@@ -1,9 +0,0 @@
1
- module React
2
- module FunctionComponent
3
- class Base
4
- def self.inherited(base)
5
- base.include(::React::FunctionComponent::Mixin)
6
- end
7
- end
8
- end
9
- end
@@ -1,32 +0,0 @@
1
- module React
2
- module FunctionComponent
3
- module Creator
4
- def self.extended(base)
5
- %x{
6
- base.react_component = function(props) {
7
- Opal.React.render_buffer.push([]);
8
- Opal.React.active_components.push(base);
9
- #{base.new(`props`).instance_exec(&`base.function_block`)};
10
- Opal.React.active_components.pop();
11
- return Opal.React.render_buffer.pop();
12
- }
13
- }
14
-
15
- base_module = base.to_s.deconstantize
16
- if base_module != ''
17
- base_module.constantize.define_singleton_method(base.to_s.demodulize) do |*args, &block|
18
- `Opal.React.internal_prepare_args_and_render(#{base}.react_component, args, block)`
19
- end
20
- else
21
- Object.define_method(base.to_s) do |*args, &block|
22
- `Opal.React.internal_prepare_args_and_render(#{base}.react_component, args, block)`
23
- end
24
- end
25
-
26
- def create_function(&block)
27
- `base.function_block = #{block}`
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,13 +0,0 @@
1
- module React
2
- module FunctionComponent
3
- module EventHandler
4
- def event_handler(name, &block)
5
- define_method(name) do |event, info|
6
- ruby_event = ::React::SyntheticEvent.new(event)
7
- block.call(ruby_event, info)
8
- end
9
- `self[name] = self.prototype['$' + name]`
10
- end
11
- end
12
- end
13
- end
@@ -1,14 +0,0 @@
1
- module React
2
- module FunctionComponent
3
- module Mixin
4
- def self.included(base)
5
- base.include(::React::Component::Elements)
6
- base.include(::React::Component::Features)
7
- base.include(::React::FunctionComponent::API)
8
- base.include(::React::FunctionComponent::Resolution)
9
- base.extend(::React::FunctionComponent::EventHandler)
10
- base.extend(::React::FunctionComponent::Creator)
11
- end
12
- end
13
- end
14
- end
@@ -1,62 +0,0 @@
1
- module React
2
- module FunctionComponent
3
- module Resolution
4
- def self.included(base)
5
- base.instance_exec do
6
- alias _react_function_component_resolution_original_const_missing const_missing
7
-
8
- def const_missing(const_name)
9
- # language=JS
10
- %x{
11
- if (typeof Opal.global[const_name] === "object") {
12
- var new_const = #{React::NativeConstantWrapper.new(`Opal.global[const_name]`, const_name)};
13
- #{Object.const_set(const_name, `new_const`)};
14
- return new_const;
15
- } else {
16
- return #{_react_function_component_resolution_original_const_missing(const_name)};
17
- }
18
- }
19
- end
20
- end
21
- end
22
-
23
- alias _react_function_component_resolution_original_method_missing method_missing
24
-
25
- def method_missing(component_name, *args, &block)
26
- # html tags are defined as methods, so they will not end up here.
27
- # first check for native component and render it, we want to be fast for native components
28
- # second check for ruby component and render it, they are a bit slower anyway
29
- # third pass on method missing
30
- # language=JS
31
- %x{
32
- var component = null;
33
- var component_type = typeof Opal.global[component_name];
34
- if (component_type === "function" || component_type === "object") {
35
- component = Opal.global[component_name];
36
- }
37
- else {
38
- try {
39
- var constant = self.$class().$const_get(component_name, true);
40
- if (typeof constant.react_component !== 'undefined') {
41
- component = constant.react_component;
42
- }
43
- } catch(err) { component = null; }
44
- }
45
- if (!component) {
46
- try {
47
- constant = Opal.Object.$const_get(component_name);
48
- if (typeof constant.react_component !== 'undefined') {
49
- component = constant.react_component;
50
- }
51
- } catch(err) { component = null; }
52
- }
53
- if (component) {
54
- return Opal.React.internal_prepare_args_and_render(component, args, block);
55
- } else {
56
- return #{_react_function_component_resolution_original_method_missing(component_name, *args, block)};
57
- }
58
- }
59
- end
60
- end
61
- end
62
- end
@@ -1,9 +0,0 @@
1
- module React
2
- module MemoComponent
3
- class Base
4
- def self.inherited(base)
5
- base.include(::React::MemoComponent::Mixin)
6
- end
7
- end
8
- end
9
- end
@@ -1,32 +0,0 @@
1
- module React
2
- module MemoComponent
3
- module Creator
4
- def self.extended(base)
5
- %x{
6
- base.equality_checker = null;
7
- base.react_component = Opal.global.React.memo(function(props) {
8
- Opal.React.render_buffer.push([]);
9
- Opal.React.active_components.push(base);
10
- #{base.new(`props`).instance_exec(&`base.function_block`)};
11
- Opal.React.active_components.pop();
12
- return Opal.React.render_buffer.pop();
13
- }, base.equality_checker);
14
- }
15
-
16
- def props_are_equal?(&block)
17
- %x{
18
- base.equality_checker = function (prev_props, next_props) {
19
- var prev_ruby_props = Opal.React.Component.Props.$new({props: prev_props});
20
- var next_ruby_props = Opal.React.Component.Props.$new({props: next_props});
21
- return #{base.new(`{}`).instance_exec(`prev_ruby_props`, `next_ruby_props`, &block)};
22
- }
23
- }
24
- end
25
-
26
- def create_memo(&block)
27
- `base.function_block = #{block}`
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,14 +0,0 @@
1
- module React
2
- module MemoComponent
3
- module Mixin
4
- def self.included(base)
5
- base.include(::React::Component::Elements)
6
- base.include(::React::Component::Features)
7
- base.include(::React::FunctionComponent::API)
8
- base.include(::React::FunctionComponent::Resolution)
9
- base.extend(::React::FunctionComponent::EventHandler)
10
- base.extend(::React::MemoComponent::Creator)
11
- end
12
- end
13
- end
14
- end
@@ -1,26 +0,0 @@
1
- module React
2
- class NativeConstantWrapper
3
- include ::Native::Wrapper
4
-
5
- def initialize(native, const_name)
6
- @native = native
7
- @const_name = const_name
8
- end
9
-
10
- def method_missing(name, *args, &block)
11
- # language=JS
12
- %x{
13
- var component = null;
14
- var component_type = typeof #@native[name];
15
- if (component_type === "function" || component_type === "object") {
16
- component = #@native[name];
17
- }
18
- if (component) {
19
- return Opal.React.internal_prepare_args_and_render(component, args, block);
20
- } else {
21
- #{raise NameError, "No such native Component #@const_name.#{name}"};
22
- }
23
- }
24
- end
25
- end
26
- end
@@ -1,9 +0,0 @@
1
- module React
2
- module PureComponent
3
- class Base
4
- def self.inherited(base)
5
- base.include(::React::PureComponent::Mixin)
6
- end
7
- end
8
- end
9
- end
@@ -1,18 +0,0 @@
1
- module React
2
- module PureComponent
3
- module Mixin
4
- def self.included(base)
5
- base.include(::Native::Wrapper)
6
- base.extend(::React::Component::NativeComponentConstructor)
7
- base.extend(::LucidPropDeclaration::Mixin)
8
- base.extend(::React::Component::EventHandler)
9
- base.include(::React::Component::Elements)
10
- base.include(::React::Component::API)
11
- base.include(::React::Component::Callbacks)
12
- base.include(::React::Component::Initializer)
13
- base.include(::React::Component::Features)
14
- base.include(::React::Component::Resolution)
15
- end
16
- end
17
- end
18
- end
@@ -1,13 +0,0 @@
1
- module React
2
- class Ref
3
- include ::Native::Wrapper
4
-
5
- def is_wrapped_ref
6
- true
7
- end
8
-
9
- def current
10
- `Opal.React.native_element_or_component_to_ruby(#@native.current)`
11
- end
12
- end
13
- end
@@ -1,53 +0,0 @@
1
- module React
2
- class SyntheticEvent
3
- include Native::Wrapper
4
- # helpers
5
- def self.native_accessors(*js_names)
6
- js_names.each do |js_name|
7
- ruby_name = js_name.underscore
8
- define_method(ruby_name) do
9
- @native.JS[js_name]
10
- end
11
- end
12
- end
13
-
14
- def self.native_boolean_accessors(*js_names)
15
- js_names.each do |js_name|
16
- ruby_name = js_name.underscore + '?'
17
- define_method(ruby_name) do
18
- @native.JS[js_name]
19
- end
20
- end
21
- end
22
-
23
- alias_native :get_modifier_state, :getModifierState
24
- alias_native :is_default_prevented?, :isDefaultPrevented
25
- alias_native :is_propagation_stopped?, :isPropagationStopped
26
- alias_native :persist, :persist
27
- alias_native :prevent_default, :preventDefault
28
- alias_native :stop_propagation, :stopPropagation
29
-
30
- native_accessors :animationName, :button, :buttons, :changedTouches, :charCode, :clientX, :clientY, :clipboardData, :data, :deltaMode, :deltaX,
31
- :deltaY, :deltaZ, :detail, :elapsedTime, :eventPhase, :height, :key, :keyCode, :locale, :location, :pageX, :pageY, :pointerId,
32
- :pointerType, :pressure, :propertyName, :pseudoElement, :screenX, :screenY, :tangentialPressure, :targetTouches, :tiltX, :tiltY,
33
- :timestamp, :touches, :twist, :type, :view, :which, :width
34
-
35
- native_boolean_accessors :altKey, :bubbles, :cancelable, :ctrlKey, :defaultPrevented, :isPrimary, :isTrusted, :metaKey, :repeat, :shiftKey
36
-
37
- def current_target
38
- Browser::Element.new(@native.JS[:currentTarget])
39
- end
40
-
41
- def native_event
42
- Browser::Event.new(@native.JS[:nativeEvent])
43
- end
44
-
45
- def related_target
46
- Browser::Element.new(@native.JS[:relatedTarget])
47
- end
48
-
49
- def target
50
- Browser::Element.new(@native.JS[:target])
51
- end
52
- end
53
- end
@@ -1,3 +0,0 @@
1
- module React
2
- VERSION = '16.9.24'
3
- end
@@ -1,47 +0,0 @@
1
- module ReactDOM
2
- class << self
3
- def create_portal(child, container)
4
- # container is a native DOM node
5
- `Opal.global.ReactDOM.createPortal(child, container)`
6
- end
7
-
8
- def find_dom_node(native_react_component)
9
- `Opal.global.ReactDOM.findDOMNode(native_react_component)`
10
- end
11
-
12
- def hydrate(native_react_element, container, &block)
13
- # container is a native DOM element
14
- `Opal.React.render_buffer.push([]);`
15
- result = if block_given?
16
- `Opal.global.ReactDOM.hydrate(native_react_element, container, function() { block.$call() })`
17
- else
18
- `Opal.global.ReactDOM.hydrate(native_react_element, container)`
19
- end
20
- `Opal.React.render_buffer.pop()`
21
- result
22
- end
23
-
24
- def render(native_react_element, container, &block)
25
- # container is a native DOM element
26
- `Opal.React.render_buffer.push([]);`
27
- result = if block_given?
28
- `Opal.global.ReactDOM.render(native_react_element, container, function() { block.$call() })`
29
- else
30
- `Opal.global.ReactDOM.render(native_react_element, container)`
31
- end
32
- `Opal.React.render_buffer.pop()`
33
- result
34
- end
35
-
36
- def unmount_component_at_node(element_or_query)
37
- if `(typeof element_or_query === 'string')` || (`(typeof element_or_query.$class === 'function')` && element_or_query.class == String)
38
- element = `document.body.querySelector(element_or_query)`
39
- elsif `(typeof element_or_query.$is_a === 'function')` && element_or_query.is_a?(Browser::Element)
40
- element = element_or_query.to_n
41
- else
42
- element = element_or_query
43
- end
44
- `Opal.global.ReactDOM.unmountComponentAtNode(element)`
45
- end
46
- end
47
- end
@@ -1,19 +0,0 @@
1
- module ReactDOMServer
2
- class << self
3
- def render_to_string(native_react_element)
4
- `Opal.global.ReactDOMServer.renderToString(native_react_element)`
5
- end
6
-
7
- def render_to_static_markup(native_react_element)
8
- `Opal.global.ReactDOMServer.renderToStaticMarkup(native_react_element)`
9
- end
10
-
11
- def render_to_node_stream(native_react_element)
12
- `Opal.global.ReactDOMServer.renderToNodeStream(native_react_element)`
13
- end
14
-
15
- def render_to_static_node_stream(native_react_element)
16
- `Opal.global.ReactDOMServer.renderToStaticNodeStream(native_react_element)`
17
- end
18
- end
19
- end