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
@@ -1,146 +1,146 @@
1
- import { options, Fragment } from 'preact';
2
-
3
- /**
4
- * Get human readable name of the component/dom node
5
- * @param {import('./internal').VNode} vnode
6
- * @param {import('./internal').VNode} vnode
7
- * @returns {string}
8
- */
9
- export function getDisplayName(vnode) {
10
- if (vnode.type === Fragment) {
11
- return 'Fragment';
12
- } else if (typeof vnode.type == 'function') {
13
- return vnode.type.displayName || vnode.type.name;
14
- } else if (typeof vnode.type == 'string') {
15
- return vnode.type;
16
- }
17
-
18
- return '#text';
19
- }
20
-
21
- /**
22
- * Used to keep track of the currently rendered `vnode` and print it
23
- * in debug messages.
24
- */
25
- let renderStack = [];
26
-
27
- /**
28
- * Keep track of the current owners. An owner describes a component
29
- * which was responsible to render a specific `vnode`. This exclude
30
- * children that are passed via `props.children`, because they belong
31
- * to the parent owner.
32
- *
33
- * ```jsx
34
- * const Foo = props => <div>{props.children}</div> // div's owner is Foo
35
- * const Bar = props => {
36
- * return (
37
- * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar
38
- * )
39
- * }
40
- * ```
41
- *
42
- * Note: A `vnode` may be hoisted to the root scope due to compiler
43
- * optimiztions. In these cases the `_owner` will be different.
44
- */
45
- let ownerStack = [];
46
-
47
- /**
48
- * Get the currently rendered `vnode`
49
- * @returns {import('./internal').VNode | null}
50
- */
51
- export function getCurrentVNode() {
52
- return renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;
53
- }
54
-
55
- /**
56
- * If the user doesn't have `@babel/plugin-transform-react-jsx-source`
57
- * somewhere in his tool chain we can't print the filename and source
58
- * location of a component. In that case we just omit that, but we'll
59
- * print a helpful message to the console, notifying the user of it.
60
- */
61
- let hasBabelPlugin = false;
62
-
63
- /**
64
- * Check if a `vnode` is a possible owner.
65
- * @param {import('./internal').VNode} vnode
66
- */
67
- function isPossibleOwner(vnode) {
68
- return typeof vnode.type == 'function' && vnode.type != Fragment;
69
- }
70
-
71
- /**
72
- * Return the component stack that was captured up to this point.
73
- * @param {import('./internal').VNode} vnode
74
- * @returns {string}
75
- */
76
- export function getOwnerStack(vnode) {
77
- const stack = [vnode];
78
- let next = vnode;
79
- while (next._owner != null) {
80
- stack.push(next._owner);
81
- next = next._owner;
82
- }
83
-
84
- return stack.reduce((acc, owner) => {
85
- acc += ` in ${getDisplayName(owner)}`;
86
-
87
- const source = owner.__source;
88
- if (source) {
89
- acc += ` (at ${source.fileName}:${source.lineNumber})`;
90
- } else if (!hasBabelPlugin) {
91
- hasBabelPlugin = true;
92
- console.warn(
93
- 'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'
94
- );
95
- }
96
-
97
- return (acc += '\n');
98
- }, '');
99
- }
100
-
101
- /**
102
- * Setup code to capture the component trace while rendering. Note that
103
- * we cannot simply traverse `vnode._parent` upwards, because we have some
104
- * debug messages for `this.setState` where the `vnode` is `undefined`.
105
- */
106
- export function setupComponentStack() {
107
- let oldDiff = options._diff;
108
- let oldDiffed = options.diffed;
109
- let oldRoot = options._root;
110
- let oldVNode = options.vnode;
111
- let oldRender = options._render;
112
-
113
- options.diffed = vnode => {
114
- if (isPossibleOwner(vnode)) {
115
- ownerStack.pop();
116
- }
117
- renderStack.pop();
118
- if (oldDiffed) oldDiffed(vnode);
119
- };
120
-
121
- options._diff = vnode => {
122
- if (isPossibleOwner(vnode)) {
123
- renderStack.push(vnode);
124
- }
125
- if (oldDiff) oldDiff(vnode);
126
- };
127
-
128
- options._root = (vnode, parent) => {
129
- ownerStack = [];
130
- if (oldRoot) oldRoot(vnode, parent);
131
- };
132
-
133
- options.vnode = vnode => {
134
- vnode._owner =
135
- ownerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;
136
- if (oldVNode) oldVNode(vnode);
137
- };
138
-
139
- options._render = vnode => {
140
- if (isPossibleOwner(vnode)) {
141
- ownerStack.push(vnode);
142
- }
143
-
144
- if (oldRender) oldRender(vnode);
145
- };
146
- }
1
+ import { options, Fragment } from 'preact';
2
+
3
+ /**
4
+ * Get human readable name of the component/dom node
5
+ * @param {import('./internal').VNode} vnode
6
+ * @param {import('./internal').VNode} vnode
7
+ * @returns {string}
8
+ */
9
+ export function getDisplayName(vnode) {
10
+ if (vnode.type === Fragment) {
11
+ return 'Fragment';
12
+ } else if (typeof vnode.type == 'function') {
13
+ return vnode.type.displayName || vnode.type.name;
14
+ } else if (typeof vnode.type == 'string') {
15
+ return vnode.type;
16
+ }
17
+
18
+ return '#text';
19
+ }
20
+
21
+ /**
22
+ * Used to keep track of the currently rendered `vnode` and print it
23
+ * in debug messages.
24
+ */
25
+ let renderStack = [];
26
+
27
+ /**
28
+ * Keep track of the current owners. An owner describes a component
29
+ * which was responsible to render a specific `vnode`. This exclude
30
+ * children that are passed via `props.children`, because they belong
31
+ * to the parent owner.
32
+ *
33
+ * ```jsx
34
+ * const Foo = props => <div>{props.children}</div> // div's owner is Foo
35
+ * const Bar = props => {
36
+ * return (
37
+ * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar
38
+ * )
39
+ * }
40
+ * ```
41
+ *
42
+ * Note: A `vnode` may be hoisted to the root scope due to compiler
43
+ * optimiztions. In these cases the `_owner` will be different.
44
+ */
45
+ let ownerStack = [];
46
+
47
+ /**
48
+ * Get the currently rendered `vnode`
49
+ * @returns {import('./internal').VNode | null}
50
+ */
51
+ export function getCurrentVNode() {
52
+ return renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;
53
+ }
54
+
55
+ /**
56
+ * If the user doesn't have `@babel/plugin-transform-react-jsx-source`
57
+ * somewhere in his tool chain we can't print the filename and source
58
+ * location of a component. In that case we just omit that, but we'll
59
+ * print a helpful message to the console, notifying the user of it.
60
+ */
61
+ let hasBabelPlugin = false;
62
+
63
+ /**
64
+ * Check if a `vnode` is a possible owner.
65
+ * @param {import('./internal').VNode} vnode
66
+ */
67
+ function isPossibleOwner(vnode) {
68
+ return typeof vnode.type == 'function' && vnode.type != Fragment;
69
+ }
70
+
71
+ /**
72
+ * Return the component stack that was captured up to this point.
73
+ * @param {import('./internal').VNode} vnode
74
+ * @returns {string}
75
+ */
76
+ export function getOwnerStack(vnode) {
77
+ const stack = [vnode];
78
+ let next = vnode;
79
+ while (next._owner != null) {
80
+ stack.push(next._owner);
81
+ next = next._owner;
82
+ }
83
+
84
+ return stack.reduce((acc, owner) => {
85
+ acc += ` in ${getDisplayName(owner)}`;
86
+
87
+ const source = owner.__source;
88
+ if (source) {
89
+ acc += ` (at ${source.fileName}:${source.lineNumber})`;
90
+ } else if (!hasBabelPlugin) {
91
+ hasBabelPlugin = true;
92
+ console.warn(
93
+ 'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'
94
+ );
95
+ }
96
+
97
+ return (acc += '\n');
98
+ }, '');
99
+ }
100
+
101
+ /**
102
+ * Setup code to capture the component trace while rendering. Note that
103
+ * we cannot simply traverse `vnode._parent` upwards, because we have some
104
+ * debug messages for `this.setState` where the `vnode` is `undefined`.
105
+ */
106
+ export function setupComponentStack() {
107
+ let oldDiff = options._diff;
108
+ let oldDiffed = options.diffed;
109
+ let oldRoot = options._root;
110
+ let oldVNode = options.vnode;
111
+ let oldRender = options._render;
112
+
113
+ options.diffed = vnode => {
114
+ if (isPossibleOwner(vnode)) {
115
+ ownerStack.pop();
116
+ }
117
+ renderStack.pop();
118
+ if (oldDiffed) oldDiffed(vnode);
119
+ };
120
+
121
+ options._diff = vnode => {
122
+ if (isPossibleOwner(vnode)) {
123
+ renderStack.push(vnode);
124
+ }
125
+ if (oldDiff) oldDiff(vnode);
126
+ };
127
+
128
+ options._root = (vnode, parent) => {
129
+ ownerStack = [];
130
+ if (oldRoot) oldRoot(vnode, parent);
131
+ };
132
+
133
+ options.vnode = vnode => {
134
+ vnode._owner =
135
+ ownerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;
136
+ if (oldVNode) oldVNode(vnode);
137
+ };
138
+
139
+ options._render = vnode => {
140
+ if (isPossibleOwner(vnode)) {
141
+ ownerStack.push(vnode);
142
+ }
143
+
144
+ if (oldRender) oldRender(vnode);
145
+ };
146
+ }
@@ -1,3 +1,3 @@
1
- export const ELEMENT_NODE = 1;
2
- export const DOCUMENT_NODE = 9;
3
- export const DOCUMENT_FRAGMENT_NODE = 11;
1
+ export const ELEMENT_NODE = 1;
2
+ export const DOCUMENT_NODE = 9;
3
+ export const DOCUMENT_FRAGMENT_NODE = 11;