isomorfeus-preact 10.6.14 → 10.6.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isomorfeus-preact.rb +3 -3
  3. data/lib/isomorfeus_preact/lucid_component/api.rb +1 -1
  4. data/lib/isomorfeus_preact/lucid_component/initializer.rb +2 -2
  5. data/lib/isomorfeus_preact/lucid_func/initializer.rb +1 -1
  6. data/lib/isomorfeus_preact/preact/function_component/initializer.rb +1 -1
  7. data/lib/preact/component/api.rb +1 -1
  8. data/lib/preact/component/callbacks.rb +6 -6
  9. data/lib/preact/component/initializer.rb +2 -2
  10. data/lib/preact/component/native_component_constructor.rb +1 -1
  11. data/lib/preact/props.rb +51 -0
  12. data/lib/preact/state.rb +67 -0
  13. data/lib/preact/version.rb +1 -1
  14. data/lib/preact.rb +2 -2
  15. data/node_modules/.package-lock.json +3 -3
  16. data/node_modules/preact/LICENSE +21 -21
  17. data/node_modules/preact/README.md +187 -187
  18. data/node_modules/preact/compat/dist/compat.js +1 -1
  19. data/node_modules/preact/compat/dist/compat.js.map +1 -1
  20. data/node_modules/preact/compat/dist/compat.mjs +1 -1
  21. data/node_modules/preact/compat/dist/compat.module.js +1 -1
  22. data/node_modules/preact/compat/dist/compat.module.js.map +1 -1
  23. data/node_modules/preact/compat/dist/compat.umd.js +1 -1
  24. data/node_modules/preact/compat/dist/compat.umd.js.map +1 -1
  25. data/node_modules/preact/compat/jsx-dev-runtime.js +1 -1
  26. data/node_modules/preact/compat/jsx-dev-runtime.mjs +1 -1
  27. data/node_modules/preact/compat/jsx-runtime.js +1 -1
  28. data/node_modules/preact/compat/jsx-runtime.mjs +1 -1
  29. data/node_modules/preact/compat/package.json +19 -19
  30. data/node_modules/preact/compat/scheduler.js +15 -15
  31. data/node_modules/preact/compat/scheduler.mjs +23 -23
  32. data/node_modules/preact/compat/server.js +15 -15
  33. data/node_modules/preact/compat/server.mjs +4 -4
  34. data/node_modules/preact/compat/src/Children.js +21 -21
  35. data/node_modules/preact/compat/src/PureComponent.js +15 -15
  36. data/node_modules/preact/compat/src/forwardRef.js +51 -51
  37. data/node_modules/preact/compat/src/index.d.ts +141 -141
  38. data/node_modules/preact/compat/src/index.js +187 -187
  39. data/node_modules/preact/compat/src/internal.d.ts +47 -47
  40. data/node_modules/preact/compat/src/memo.js +34 -34
  41. data/node_modules/preact/compat/src/portals.js +80 -80
  42. data/node_modules/preact/compat/src/render.js +229 -230
  43. data/node_modules/preact/compat/src/suspense-list.d.ts +14 -14
  44. data/node_modules/preact/compat/src/suspense-list.js +126 -126
  45. data/node_modules/preact/compat/src/suspense.d.ts +15 -15
  46. data/node_modules/preact/compat/src/suspense.js +270 -270
  47. data/node_modules/preact/compat/src/util.js +28 -28
  48. data/node_modules/preact/compat/test-utils.js +1 -1
  49. data/node_modules/preact/debug/dist/debug.js.map +1 -1
  50. data/node_modules/preact/debug/dist/debug.module.js.map +1 -1
  51. data/node_modules/preact/debug/dist/debug.umd.js.map +1 -1
  52. data/node_modules/preact/debug/package.json +18 -18
  53. data/node_modules/preact/debug/src/check-props.js +54 -54
  54. data/node_modules/preact/debug/src/component-stack.js +146 -146
  55. data/node_modules/preact/debug/src/constants.js +3 -3
  56. data/node_modules/preact/debug/src/debug.js +442 -442
  57. data/node_modules/preact/debug/src/index.js +6 -6
  58. data/node_modules/preact/debug/src/internal.d.ts +82 -82
  59. data/node_modules/preact/debug/src/util.js +11 -11
  60. data/node_modules/preact/devtools/dist/devtools.js +1 -1
  61. data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
  62. data/node_modules/preact/devtools/dist/devtools.mjs +1 -1
  63. data/node_modules/preact/devtools/dist/devtools.module.js +1 -1
  64. data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
  65. data/node_modules/preact/devtools/dist/devtools.umd.js +1 -1
  66. data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
  67. data/node_modules/preact/devtools/package.json +16 -16
  68. data/node_modules/preact/devtools/src/devtools.js +10 -10
  69. data/node_modules/preact/devtools/src/index.d.ts +8 -8
  70. data/node_modules/preact/devtools/src/index.js +15 -15
  71. data/node_modules/preact/dist/preact.js.map +1 -1
  72. data/node_modules/preact/dist/preact.min.js.map +1 -1
  73. data/node_modules/preact/dist/preact.module.js.map +1 -1
  74. data/node_modules/preact/dist/preact.umd.js.map +1 -1
  75. data/node_modules/preact/hooks/dist/hooks.js +1 -1
  76. data/node_modules/preact/hooks/dist/hooks.js.map +1 -1
  77. data/node_modules/preact/hooks/dist/hooks.mjs +1 -1
  78. data/node_modules/preact/hooks/dist/hooks.module.js +1 -1
  79. data/node_modules/preact/hooks/dist/hooks.module.js.map +1 -1
  80. data/node_modules/preact/hooks/dist/hooks.umd.js +1 -1
  81. data/node_modules/preact/hooks/dist/hooks.umd.js.map +1 -1
  82. data/node_modules/preact/hooks/package.json +26 -26
  83. data/node_modules/preact/hooks/src/index.d.ts +139 -139
  84. data/node_modules/preact/hooks/src/index.js +386 -388
  85. data/node_modules/preact/hooks/src/internal.d.ts +75 -75
  86. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
  87. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
  88. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
  89. data/node_modules/preact/jsx-runtime/package.json +19 -19
  90. data/node_modules/preact/jsx-runtime/src/index.d.ts +50 -50
  91. data/node_modules/preact/jsx-runtime/src/index.js +77 -77
  92. data/node_modules/preact/package.json +291 -287
  93. data/node_modules/preact/src/cjs.js +3 -3
  94. data/node_modules/preact/src/clone-element.js +34 -34
  95. data/node_modules/preact/src/component.js +225 -225
  96. data/node_modules/preact/src/constants.js +3 -3
  97. data/node_modules/preact/src/create-context.js +68 -68
  98. data/node_modules/preact/src/create-element.js +98 -98
  99. data/node_modules/preact/src/diff/catch-error.js +38 -38
  100. data/node_modules/preact/src/diff/children.js +335 -335
  101. data/node_modules/preact/src/diff/index.js +516 -516
  102. data/node_modules/preact/src/diff/props.js +158 -158
  103. data/node_modules/preact/src/index.d.ts +310 -310
  104. data/node_modules/preact/src/index.js +13 -13
  105. data/node_modules/preact/src/internal.d.ts +146 -146
  106. data/node_modules/preact/src/jsx.d.ts +1005 -1005
  107. data/node_modules/preact/src/options.js +16 -16
  108. data/node_modules/preact/src/render.js +75 -75
  109. data/node_modules/preact/src/util.js +27 -27
  110. data/node_modules/preact/test-utils/dist/testUtils.js.map +1 -1
  111. data/node_modules/preact/test-utils/dist/testUtils.module.js.map +1 -1
  112. data/node_modules/preact/test-utils/dist/testUtils.umd.js.map +1 -1
  113. data/node_modules/preact/test-utils/package.json +19 -19
  114. data/node_modules/preact/test-utils/src/index.d.ts +3 -3
  115. data/node_modules/preact/test-utils/src/index.js +117 -117
  116. data/package.json +1 -1
  117. metadata +4 -4
  118. data/lib/preact/component/props.rb +0 -55
  119. data/lib/preact/component/state.rb +0 -58
@@ -1,55 +0,0 @@
1
- module Preact
2
- module Component
3
- class Props
4
- def initialize(native)
5
- @native = native
6
- end
7
-
8
- def method_missing(prop, *args, &block)
9
- %x{
10
- const p = #@native.props;
11
- if (typeof p[prop] === 'undefined') {
12
- prop = Opal.Preact.lower_camelize(prop);
13
- if (typeof p[prop] === 'undefined') { return nil; }
14
- }
15
- return p[prop];
16
- }
17
- end
18
-
19
- def children
20
- @native.JS[:props].JS[:children]
21
- end
22
-
23
- def isomorfeus_store
24
- # TODO
25
- @native.JS[:props].JS[:isomorfeus_store]
26
- end
27
-
28
- def theme
29
- `#@native.props.iso_theme`
30
- end
31
-
32
- def params
33
- return @params if @params
34
- return nil if `typeof #@native.props.params === 'undefined'`
35
- @params = ::Preact::Component::Params.new(`#@native.props.params`)
36
- end
37
-
38
- def to_h
39
- `Opal.Hash.$new(#@native.props)`.transform_keys!(&:underscore)
40
- end
41
-
42
- def to_json
43
- JSON.dump(to_transport)
44
- end
45
-
46
- def to_n
47
- @native.JS[:props]
48
- end
49
-
50
- def to_transport
51
- {}.merge(to_h)
52
- end
53
- end
54
- end
55
- end
@@ -1,58 +0,0 @@
1
- module Preact
2
- module Component
3
- class State
4
- include ::Native::Wrapper
5
-
6
- def initialize(native)
7
- @native = native
8
- end
9
-
10
- def method_missing(key, *args, &block)
11
- if `args.length > 0`
12
- new_state = `{}`
13
- new_state.JS[(`key.endsWith('=')` ? key.chop : key)] = args[0]
14
- if block_given?
15
- @native.JS.setState(new_state, `function() { block.$call(); }`)
16
- else
17
- @native.JS.setState(new_state, `null`)
18
- end
19
- else
20
- %x{
21
- if (typeof #@native.state[key] === 'undefined') { return nil; }
22
- return #@native.state[key];
23
- }
24
- end
25
- end
26
-
27
- def set_state(updater, &block)
28
- new_state = `{}`
29
- updater.each do |key, value|
30
- new_state.JS[key] = value
31
- end
32
- if block_given?
33
- @native.JS.setState(new_state, `function() { block.$call(); }`)
34
- else
35
- @native.JS.setState(new_state, `null`)
36
- end
37
- end
38
-
39
- def size
40
- `Object.keys(#@native.state).length`;
41
- end
42
-
43
- def to_n
44
- %x{
45
- var new_native = {};
46
- for (var key in #@native.state) {
47
- if (typeof #@native.state[key].$to_n !== "undefined") {
48
- new_native[key] = #@native.state[key].$to_n();
49
- } else {
50
- new_native[key] = #@native.state[key];
51
- }
52
- }
53
- return new_native;
54
- }
55
- end
56
- end
57
- end
58
- end