isomorfeus-preact 10.6.11 → 10.6.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/browser/event.rb +2 -0
- data/lib/isomorfeus/preact_view_helper.rb +3 -2
- data/lib/isomorfeus/props/validate_hash_proxy.rb +1 -1
- data/lib/isomorfeus/props/validator.rb +6 -4
- data/lib/isomorfeus-preact.rb +3 -3
- data/lib/isomorfeus_preact/lucid_component/api.rb +1 -1
- data/lib/isomorfeus_preact/lucid_component/initializer.rb +2 -2
- data/lib/isomorfeus_preact/lucid_func/initializer.rb +1 -1
- data/lib/isomorfeus_preact/preact/function_component/initializer.rb +1 -1
- data/lib/preact/component/api.rb +1 -1
- data/lib/preact/component/callbacks.rb +6 -6
- data/lib/preact/component/initializer.rb +2 -2
- data/lib/preact/component/native_component_constructor.rb +1 -1
- data/lib/preact/props.rb +51 -0
- data/lib/preact/state.rb +67 -0
- data/lib/preact/version.rb +1 -1
- data/lib/preact.rb +2 -2
- data/node_modules/.package-lock.json +3 -3
- data/node_modules/preact/LICENSE +21 -21
- data/node_modules/preact/README.md +187 -187
- data/node_modules/preact/compat/dist/compat.js +1 -1
- data/node_modules/preact/compat/dist/compat.js.map +1 -1
- data/node_modules/preact/compat/dist/compat.mjs +1 -1
- data/node_modules/preact/compat/dist/compat.module.js +1 -1
- data/node_modules/preact/compat/dist/compat.module.js.map +1 -1
- data/node_modules/preact/compat/dist/compat.umd.js +1 -1
- data/node_modules/preact/compat/dist/compat.umd.js.map +1 -1
- data/node_modules/preact/compat/jsx-dev-runtime.js +1 -1
- data/node_modules/preact/compat/jsx-dev-runtime.mjs +1 -1
- data/node_modules/preact/compat/jsx-runtime.js +1 -1
- data/node_modules/preact/compat/jsx-runtime.mjs +1 -1
- data/node_modules/preact/compat/package.json +19 -19
- data/node_modules/preact/compat/scheduler.js +15 -15
- data/node_modules/preact/compat/scheduler.mjs +23 -23
- data/node_modules/preact/compat/server.js +15 -15
- data/node_modules/preact/compat/server.mjs +4 -4
- data/node_modules/preact/compat/src/Children.js +21 -21
- data/node_modules/preact/compat/src/PureComponent.js +15 -15
- data/node_modules/preact/compat/src/forwardRef.js +51 -51
- data/node_modules/preact/compat/src/index.d.ts +141 -141
- data/node_modules/preact/compat/src/index.js +187 -187
- data/node_modules/preact/compat/src/internal.d.ts +47 -47
- data/node_modules/preact/compat/src/memo.js +34 -34
- data/node_modules/preact/compat/src/portals.js +80 -80
- data/node_modules/preact/compat/src/render.js +229 -230
- data/node_modules/preact/compat/src/suspense-list.d.ts +14 -14
- data/node_modules/preact/compat/src/suspense-list.js +126 -126
- data/node_modules/preact/compat/src/suspense.d.ts +15 -15
- data/node_modules/preact/compat/src/suspense.js +270 -270
- data/node_modules/preact/compat/src/util.js +28 -28
- data/node_modules/preact/compat/test-utils.js +1 -1
- data/node_modules/preact/debug/dist/debug.js.map +1 -1
- data/node_modules/preact/debug/dist/debug.module.js.map +1 -1
- data/node_modules/preact/debug/dist/debug.umd.js.map +1 -1
- data/node_modules/preact/debug/package.json +18 -18
- data/node_modules/preact/debug/src/check-props.js +54 -54
- data/node_modules/preact/debug/src/component-stack.js +146 -146
- data/node_modules/preact/debug/src/constants.js +3 -3
- data/node_modules/preact/debug/src/debug.js +442 -442
- data/node_modules/preact/debug/src/index.js +6 -6
- data/node_modules/preact/debug/src/internal.d.ts +82 -82
- data/node_modules/preact/debug/src/util.js +11 -11
- data/node_modules/preact/devtools/dist/devtools.js +1 -1
- data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
- data/node_modules/preact/devtools/dist/devtools.mjs +1 -1
- data/node_modules/preact/devtools/dist/devtools.module.js +1 -1
- data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
- data/node_modules/preact/devtools/dist/devtools.umd.js +1 -1
- data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
- data/node_modules/preact/devtools/package.json +16 -16
- data/node_modules/preact/devtools/src/devtools.js +10 -10
- data/node_modules/preact/devtools/src/index.d.ts +8 -8
- data/node_modules/preact/devtools/src/index.js +15 -15
- data/node_modules/preact/dist/preact.js.map +1 -1
- data/node_modules/preact/dist/preact.min.js.map +1 -1
- data/node_modules/preact/dist/preact.module.js.map +1 -1
- data/node_modules/preact/dist/preact.umd.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.js +1 -1
- data/node_modules/preact/hooks/dist/hooks.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.mjs +1 -1
- data/node_modules/preact/hooks/dist/hooks.module.js +1 -1
- data/node_modules/preact/hooks/dist/hooks.module.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.umd.js +1 -1
- data/node_modules/preact/hooks/dist/hooks.umd.js.map +1 -1
- data/node_modules/preact/hooks/package.json +26 -26
- data/node_modules/preact/hooks/src/index.d.ts +139 -139
- data/node_modules/preact/hooks/src/index.js +386 -388
- data/node_modules/preact/hooks/src/internal.d.ts +75 -75
- data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
- data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
- data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
- data/node_modules/preact/jsx-runtime/package.json +19 -19
- data/node_modules/preact/jsx-runtime/src/index.d.ts +50 -50
- data/node_modules/preact/jsx-runtime/src/index.js +77 -77
- data/node_modules/preact/package.json +291 -287
- data/node_modules/preact/src/cjs.js +3 -3
- data/node_modules/preact/src/clone-element.js +34 -34
- data/node_modules/preact/src/component.js +225 -225
- data/node_modules/preact/src/constants.js +3 -3
- data/node_modules/preact/src/create-context.js +68 -68
- data/node_modules/preact/src/create-element.js +98 -98
- data/node_modules/preact/src/diff/catch-error.js +38 -38
- data/node_modules/preact/src/diff/children.js +335 -335
- data/node_modules/preact/src/diff/index.js +516 -516
- data/node_modules/preact/src/diff/props.js +158 -158
- data/node_modules/preact/src/index.d.ts +310 -310
- data/node_modules/preact/src/index.js +13 -13
- data/node_modules/preact/src/internal.d.ts +146 -146
- data/node_modules/preact/src/jsx.d.ts +1005 -1005
- data/node_modules/preact/src/options.js +16 -16
- data/node_modules/preact/src/render.js +75 -75
- data/node_modules/preact/src/util.js +27 -27
- data/node_modules/preact/test-utils/dist/testUtils.js.map +1 -1
- data/node_modules/preact/test-utils/dist/testUtils.module.js.map +1 -1
- data/node_modules/preact/test-utils/dist/testUtils.umd.js.map +1 -1
- data/node_modules/preact/test-utils/package.json +19 -19
- data/node_modules/preact/test-utils/src/index.d.ts +3 -3
- data/node_modules/preact/test-utils/src/index.js +117 -117
- data/package.json +1 -1
- metadata +8 -8
- data/lib/preact/component/props.rb +0 -55
- data/lib/preact/component/state.rb +0 -58
@@ -1,98 +1,98 @@
|
|
1
|
-
import { slice } from './util';
|
2
|
-
import options from './options';
|
3
|
-
|
4
|
-
let vnodeId = 0;
|
5
|
-
|
6
|
-
/**
|
7
|
-
* Create an virtual node (used for JSX)
|
8
|
-
* @param {import('./internal').VNode["type"]} type The node name or Component
|
9
|
-
* constructor for this virtual node
|
10
|
-
* @param {object | null | undefined} [props] The properties of the virtual node
|
11
|
-
* @param {Array<import('.').ComponentChildren>} [children] The children of the virtual node
|
12
|
-
* @returns {import('./internal').VNode}
|
13
|
-
*/
|
14
|
-
export function createElement(type, props, children) {
|
15
|
-
let normalizedProps = {},
|
16
|
-
key,
|
17
|
-
ref,
|
18
|
-
i;
|
19
|
-
for (i in props) {
|
20
|
-
if (i == 'key') key = props[i];
|
21
|
-
else if (i == 'ref') ref = props[i];
|
22
|
-
else normalizedProps[i] = props[i];
|
23
|
-
}
|
24
|
-
|
25
|
-
if (arguments.length > 2) {
|
26
|
-
normalizedProps.children =
|
27
|
-
arguments.length > 3 ? slice.call(arguments, 2) : children;
|
28
|
-
}
|
29
|
-
|
30
|
-
// If a Component VNode, check for and apply defaultProps
|
31
|
-
// Note: type may be undefined in development, must never error here.
|
32
|
-
if (typeof type == 'function' && type.defaultProps != null) {
|
33
|
-
for (i in type.defaultProps) {
|
34
|
-
if (normalizedProps[i] === undefined) {
|
35
|
-
normalizedProps[i] = type.defaultProps[i];
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
|
40
|
-
return createVNode(type, normalizedProps, key, ref, null);
|
41
|
-
}
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Create a VNode (used internally by Preact)
|
45
|
-
* @param {import('./internal').VNode["type"]} type The node name or Component
|
46
|
-
* Constructor for this virtual node
|
47
|
-
* @param {object | string | number | null} props The properties of this virtual node.
|
48
|
-
* If this virtual node represents a text node, this is the text of the node (string or number).
|
49
|
-
* @param {string | number | null} key The key for this virtual node, used when
|
50
|
-
* diffing it against its children
|
51
|
-
* @param {import('./internal').VNode["ref"]} ref The ref property that will
|
52
|
-
* receive a reference to its created child
|
53
|
-
* @returns {import('./internal').VNode}
|
54
|
-
*/
|
55
|
-
export function createVNode(type, props, key, ref, original) {
|
56
|
-
// V8 seems to be better at detecting type shapes if the object is allocated from the same call site
|
57
|
-
// Do not inline into createElement and coerceToVNode!
|
58
|
-
const vnode = {
|
59
|
-
type,
|
60
|
-
props,
|
61
|
-
key,
|
62
|
-
ref,
|
63
|
-
_children: null,
|
64
|
-
_parent: null,
|
65
|
-
_depth: 0,
|
66
|
-
_dom: null,
|
67
|
-
// _nextDom must be initialized to undefined b/c it will eventually
|
68
|
-
// be set to dom.nextSibling which can return `null` and it is important
|
69
|
-
// to be able to distinguish between an uninitialized _nextDom and
|
70
|
-
// a _nextDom that has been set to `null`
|
71
|
-
_nextDom: undefined,
|
72
|
-
_component: null,
|
73
|
-
_hydrating: null,
|
74
|
-
constructor: undefined,
|
75
|
-
_original: original == null ? ++vnodeId : original
|
76
|
-
};
|
77
|
-
|
78
|
-
// Only invoke the vnode hook if this was *not* a direct copy:
|
79
|
-
if (original == null && options.vnode != null) options.vnode(vnode);
|
80
|
-
|
81
|
-
return vnode;
|
82
|
-
}
|
83
|
-
|
84
|
-
export function createRef() {
|
85
|
-
return { current: null };
|
86
|
-
}
|
87
|
-
|
88
|
-
export function Fragment(props) {
|
89
|
-
return props.children;
|
90
|
-
}
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Check if a the argument is a valid Preact VNode.
|
94
|
-
* @param {*} vnode
|
95
|
-
* @returns {vnode is import('./internal').VNode}
|
96
|
-
*/
|
97
|
-
export const isValidElement = vnode =>
|
98
|
-
vnode != null && vnode.constructor === undefined;
|
1
|
+
import { slice } from './util';
|
2
|
+
import options from './options';
|
3
|
+
|
4
|
+
let vnodeId = 0;
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Create an virtual node (used for JSX)
|
8
|
+
* @param {import('./internal').VNode["type"]} type The node name or Component
|
9
|
+
* constructor for this virtual node
|
10
|
+
* @param {object | null | undefined} [props] The properties of the virtual node
|
11
|
+
* @param {Array<import('.').ComponentChildren>} [children] The children of the virtual node
|
12
|
+
* @returns {import('./internal').VNode}
|
13
|
+
*/
|
14
|
+
export function createElement(type, props, children) {
|
15
|
+
let normalizedProps = {},
|
16
|
+
key,
|
17
|
+
ref,
|
18
|
+
i;
|
19
|
+
for (i in props) {
|
20
|
+
if (i == 'key') key = props[i];
|
21
|
+
else if (i == 'ref') ref = props[i];
|
22
|
+
else normalizedProps[i] = props[i];
|
23
|
+
}
|
24
|
+
|
25
|
+
if (arguments.length > 2) {
|
26
|
+
normalizedProps.children =
|
27
|
+
arguments.length > 3 ? slice.call(arguments, 2) : children;
|
28
|
+
}
|
29
|
+
|
30
|
+
// If a Component VNode, check for and apply defaultProps
|
31
|
+
// Note: type may be undefined in development, must never error here.
|
32
|
+
if (typeof type == 'function' && type.defaultProps != null) {
|
33
|
+
for (i in type.defaultProps) {
|
34
|
+
if (normalizedProps[i] === undefined) {
|
35
|
+
normalizedProps[i] = type.defaultProps[i];
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
return createVNode(type, normalizedProps, key, ref, null);
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Create a VNode (used internally by Preact)
|
45
|
+
* @param {import('./internal').VNode["type"]} type The node name or Component
|
46
|
+
* Constructor for this virtual node
|
47
|
+
* @param {object | string | number | null} props The properties of this virtual node.
|
48
|
+
* If this virtual node represents a text node, this is the text of the node (string or number).
|
49
|
+
* @param {string | number | null} key The key for this virtual node, used when
|
50
|
+
* diffing it against its children
|
51
|
+
* @param {import('./internal').VNode["ref"]} ref The ref property that will
|
52
|
+
* receive a reference to its created child
|
53
|
+
* @returns {import('./internal').VNode}
|
54
|
+
*/
|
55
|
+
export function createVNode(type, props, key, ref, original) {
|
56
|
+
// V8 seems to be better at detecting type shapes if the object is allocated from the same call site
|
57
|
+
// Do not inline into createElement and coerceToVNode!
|
58
|
+
const vnode = {
|
59
|
+
type,
|
60
|
+
props,
|
61
|
+
key,
|
62
|
+
ref,
|
63
|
+
_children: null,
|
64
|
+
_parent: null,
|
65
|
+
_depth: 0,
|
66
|
+
_dom: null,
|
67
|
+
// _nextDom must be initialized to undefined b/c it will eventually
|
68
|
+
// be set to dom.nextSibling which can return `null` and it is important
|
69
|
+
// to be able to distinguish between an uninitialized _nextDom and
|
70
|
+
// a _nextDom that has been set to `null`
|
71
|
+
_nextDom: undefined,
|
72
|
+
_component: null,
|
73
|
+
_hydrating: null,
|
74
|
+
constructor: undefined,
|
75
|
+
_original: original == null ? ++vnodeId : original
|
76
|
+
};
|
77
|
+
|
78
|
+
// Only invoke the vnode hook if this was *not* a direct copy:
|
79
|
+
if (original == null && options.vnode != null) options.vnode(vnode);
|
80
|
+
|
81
|
+
return vnode;
|
82
|
+
}
|
83
|
+
|
84
|
+
export function createRef() {
|
85
|
+
return { current: null };
|
86
|
+
}
|
87
|
+
|
88
|
+
export function Fragment(props) {
|
89
|
+
return props.children;
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Check if a the argument is a valid Preact VNode.
|
94
|
+
* @param {*} vnode
|
95
|
+
* @returns {vnode is import('./internal').VNode}
|
96
|
+
*/
|
97
|
+
export const isValidElement = vnode =>
|
98
|
+
vnode != null && vnode.constructor === undefined;
|
@@ -1,38 +1,38 @@
|
|
1
|
-
/**
|
2
|
-
* Find the closest error boundary to a thrown error and call it
|
3
|
-
* @param {object} error The thrown value
|
4
|
-
* @param {import('../internal').VNode} vnode The vnode that threw
|
5
|
-
* the error that was caught (except for unmounting when this parameter
|
6
|
-
* is the highest parent that was being unmounted)
|
7
|
-
*/
|
8
|
-
export function _catchError(error, vnode) {
|
9
|
-
/** @type {import('../internal').Component} */
|
10
|
-
let component, ctor, handled;
|
11
|
-
|
12
|
-
for (; (vnode = vnode._parent); ) {
|
13
|
-
if ((component = vnode._component) && !component._processingException) {
|
14
|
-
try {
|
15
|
-
ctor = component.constructor;
|
16
|
-
|
17
|
-
if (ctor && ctor.getDerivedStateFromError != null) {
|
18
|
-
component.setState(ctor.getDerivedStateFromError(error));
|
19
|
-
handled = component._dirty;
|
20
|
-
}
|
21
|
-
|
22
|
-
if (component.componentDidCatch != null) {
|
23
|
-
component.componentDidCatch(error);
|
24
|
-
handled = component._dirty;
|
25
|
-
}
|
26
|
-
|
27
|
-
// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.
|
28
|
-
if (handled) {
|
29
|
-
return (component._pendingError = component);
|
30
|
-
}
|
31
|
-
} catch (e) {
|
32
|
-
error = e;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
throw error;
|
38
|
-
}
|
1
|
+
/**
|
2
|
+
* Find the closest error boundary to a thrown error and call it
|
3
|
+
* @param {object} error The thrown value
|
4
|
+
* @param {import('../internal').VNode} vnode The vnode that threw
|
5
|
+
* the error that was caught (except for unmounting when this parameter
|
6
|
+
* is the highest parent that was being unmounted)
|
7
|
+
*/
|
8
|
+
export function _catchError(error, vnode) {
|
9
|
+
/** @type {import('../internal').Component} */
|
10
|
+
let component, ctor, handled;
|
11
|
+
|
12
|
+
for (; (vnode = vnode._parent); ) {
|
13
|
+
if ((component = vnode._component) && !component._processingException) {
|
14
|
+
try {
|
15
|
+
ctor = component.constructor;
|
16
|
+
|
17
|
+
if (ctor && ctor.getDerivedStateFromError != null) {
|
18
|
+
component.setState(ctor.getDerivedStateFromError(error));
|
19
|
+
handled = component._dirty;
|
20
|
+
}
|
21
|
+
|
22
|
+
if (component.componentDidCatch != null) {
|
23
|
+
component.componentDidCatch(error);
|
24
|
+
handled = component._dirty;
|
25
|
+
}
|
26
|
+
|
27
|
+
// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.
|
28
|
+
if (handled) {
|
29
|
+
return (component._pendingError = component);
|
30
|
+
}
|
31
|
+
} catch (e) {
|
32
|
+
error = e;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
throw error;
|
38
|
+
}
|