isomorfeus-preact 10.8.1 → 10.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/preact/version.rb +1 -1
- data/node_modules/.package-lock.json +5 -7
- data/node_modules/preact/compat/dist/compat.js +2 -2
- data/node_modules/preact/compat/dist/compat.js.map +1 -1
- data/node_modules/preact/compat/dist/compat.mjs +2 -2
- data/node_modules/preact/compat/dist/compat.module.js +2 -2
- data/node_modules/preact/compat/dist/compat.module.js.map +1 -1
- data/node_modules/preact/compat/dist/compat.umd.js +2 -2
- data/node_modules/preact/compat/dist/compat.umd.js.map +1 -1
- data/node_modules/preact/compat/src/render.js +238 -238
- data/node_modules/preact/debug/dist/debug.js +2 -2
- data/node_modules/preact/debug/dist/debug.js.map +1 -1
- data/node_modules/preact/debug/dist/debug.mjs +2 -2
- data/node_modules/preact/debug/dist/debug.module.js +2 -2
- data/node_modules/preact/debug/dist/debug.module.js.map +1 -1
- data/node_modules/preact/debug/dist/debug.umd.js +2 -2
- data/node_modules/preact/debug/dist/debug.umd.js.map +1 -1
- data/node_modules/preact/debug/src/debug.js +437 -444
- data/node_modules/preact/devtools/dist/devtools.js +2 -2
- data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
- data/node_modules/preact/devtools/dist/devtools.mjs +2 -2
- data/node_modules/preact/devtools/dist/devtools.module.js +2 -2
- data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
- data/node_modules/preact/devtools/dist/devtools.umd.js +2 -2
- data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
- data/node_modules/preact/devtools/src/devtools.js +10 -10
- data/node_modules/preact/hooks/dist/hooks.js +2 -2
- data/node_modules/preact/hooks/dist/hooks.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.mjs +2 -2
- data/node_modules/preact/hooks/dist/hooks.module.js +2 -2
- data/node_modules/preact/hooks/dist/hooks.module.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.umd.js +2 -2
- data/node_modules/preact/hooks/dist/hooks.umd.js.map +1 -1
- data/node_modules/preact/hooks/src/index.js +417 -426
- data/node_modules/preact/package.json +304 -304
- data/package.json +1 -1
- metadata +4 -4
@@ -1,238 +1,238 @@
|
|
1
|
-
import {
|
2
|
-
render as preactRender,
|
3
|
-
hydrate as preactHydrate,
|
4
|
-
options,
|
5
|
-
toChildArray,
|
6
|
-
Component
|
7
|
-
} from 'preact';
|
8
|
-
|
9
|
-
export const REACT_ELEMENT_TYPE =
|
10
|
-
(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||
|
11
|
-
0xeac7;
|
12
|
-
|
13
|
-
const CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;
|
14
|
-
|
15
|
-
const IS_DOM = typeof document !== 'undefined';
|
16
|
-
|
17
|
-
// Input types for which onchange should not be converted to oninput.
|
18
|
-
// type="file|checkbox|radio", plus "range" in IE11.
|
19
|
-
// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches "range")
|
20
|
-
const onChangeInputType = type =>
|
21
|
-
(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'
|
22
|
-
? /fil|che|rad/i
|
23
|
-
: /fil|che|ra/i
|
24
|
-
).test(type);
|
25
|
-
|
26
|
-
// Some libraries like `react-virtualized` explicitly check for this.
|
27
|
-
Component.prototype.isReactComponent = {};
|
28
|
-
|
29
|
-
// `UNSAFE_*` lifecycle hooks
|
30
|
-
// Preact only ever invokes the unprefixed methods.
|
31
|
-
// Here we provide a base "fallback" implementation that calls any defined UNSAFE_ prefixed method.
|
32
|
-
// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.
|
33
|
-
// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.
|
34
|
-
// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.
|
35
|
-
// See https://github.com/preactjs/preact/issues/1941
|
36
|
-
[
|
37
|
-
'componentWillMount',
|
38
|
-
'componentWillReceiveProps',
|
39
|
-
'componentWillUpdate'
|
40
|
-
].forEach(key => {
|
41
|
-
Object.defineProperty(Component.prototype, key, {
|
42
|
-
configurable: true,
|
43
|
-
get() {
|
44
|
-
return this['UNSAFE_' + key];
|
45
|
-
},
|
46
|
-
set(v) {
|
47
|
-
Object.defineProperty(this, key, {
|
48
|
-
configurable: true,
|
49
|
-
writable: true,
|
50
|
-
value: v
|
51
|
-
});
|
52
|
-
}
|
53
|
-
});
|
54
|
-
});
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Proxy render() since React returns a Component reference.
|
58
|
-
* @param {import('./internal').VNode} vnode VNode tree to render
|
59
|
-
* @param {import('./internal').PreactElement} parent DOM node to render vnode tree into
|
60
|
-
* @param {() => void} [callback] Optional callback that will be called after rendering
|
61
|
-
* @returns {import('./internal').Component | null} The root component reference or null
|
62
|
-
*/
|
63
|
-
export function render(vnode, parent, callback) {
|
64
|
-
// React destroys any existing DOM nodes, see #1727
|
65
|
-
// ...but only on the first render, see #1828
|
66
|
-
if (parent._children == null) {
|
67
|
-
parent.textContent = '';
|
68
|
-
}
|
69
|
-
|
70
|
-
preactRender(vnode, parent);
|
71
|
-
if (typeof callback == 'function') callback();
|
72
|
-
|
73
|
-
return vnode ? vnode._component : null;
|
74
|
-
}
|
75
|
-
|
76
|
-
export function hydrate(vnode, parent, callback) {
|
77
|
-
preactHydrate(vnode, parent);
|
78
|
-
if (typeof callback == 'function') callback();
|
79
|
-
|
80
|
-
return vnode ? vnode._component : null;
|
81
|
-
}
|
82
|
-
|
83
|
-
let oldEventHook = options.event;
|
84
|
-
options.event = e => {
|
85
|
-
if (oldEventHook) e = oldEventHook(e);
|
86
|
-
e.persist = empty;
|
87
|
-
e.isPropagationStopped = isPropagationStopped;
|
88
|
-
e.isDefaultPrevented = isDefaultPrevented;
|
89
|
-
return (e.nativeEvent = e);
|
90
|
-
};
|
91
|
-
|
92
|
-
function empty() {}
|
93
|
-
|
94
|
-
function isPropagationStopped() {
|
95
|
-
return this.cancelBubble;
|
96
|
-
}
|
97
|
-
|
98
|
-
function isDefaultPrevented() {
|
99
|
-
return this.defaultPrevented;
|
100
|
-
}
|
101
|
-
|
102
|
-
let classNameDescriptor = {
|
103
|
-
configurable: true,
|
104
|
-
get() {
|
105
|
-
return this.class;
|
106
|
-
}
|
107
|
-
};
|
108
|
-
|
109
|
-
let oldVNodeHook = options.vnode;
|
110
|
-
options.vnode = vnode => {
|
111
|
-
let type = vnode.type;
|
112
|
-
let props = vnode.props;
|
113
|
-
let normalizedProps = props;
|
114
|
-
|
115
|
-
// only normalize props on Element nodes
|
116
|
-
if (typeof type === 'string') {
|
117
|
-
const nonCustomElement = type.indexOf('-') === -1;
|
118
|
-
normalizedProps = {};
|
119
|
-
|
120
|
-
for (let i in props) {
|
121
|
-
let value = props[i];
|
122
|
-
|
123
|
-
if (IS_DOM && i === 'children' && type === 'noscript') {
|
124
|
-
// Emulate React's behavior of not rendering the contents of noscript tags on the client.
|
125
|
-
continue;
|
126
|
-
} else if (i === 'value' && 'defaultValue' in props && value == null) {
|
127
|
-
// Skip applying value if it is null/undefined and we already set
|
128
|
-
// a default value
|
129
|
-
continue;
|
130
|
-
} else if (
|
131
|
-
i === 'defaultValue' &&
|
132
|
-
'value' in props &&
|
133
|
-
props.value == null
|
134
|
-
) {
|
135
|
-
// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.
|
136
|
-
// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.
|
137
|
-
i = 'value';
|
138
|
-
} else if (i === 'download' && value === true) {
|
139
|
-
// Calling `setAttribute` with a truthy value will lead to it being
|
140
|
-
// passed as a stringified value, e.g. `download="true"`. React
|
141
|
-
// converts it to an empty string instead, otherwise the attribute
|
142
|
-
// value will be used as the file name and the file will be called
|
143
|
-
// "true" upon downloading it.
|
144
|
-
value = '';
|
145
|
-
} else if (/ondoubleclick/i.test(i)) {
|
146
|
-
i = 'ondblclick';
|
147
|
-
} else if (
|
148
|
-
/^onchange(textarea|input)/i.test(i + type) &&
|
149
|
-
!onChangeInputType(props.type)
|
150
|
-
) {
|
151
|
-
i = 'oninput';
|
152
|
-
} else if (/^onfocus$/i.test(i)) {
|
153
|
-
i = 'onfocusin';
|
154
|
-
} else if (/^onblur$/i.test(i)) {
|
155
|
-
i = 'onfocusout';
|
156
|
-
} else if (/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)) {
|
157
|
-
i = i.toLowerCase();
|
158
|
-
} else if (nonCustomElement && CAMEL_PROPS.test(i)) {
|
159
|
-
i = i.replace(/[A-Z0-9]/, '-$&').toLowerCase();
|
160
|
-
} else if (value === null) {
|
161
|
-
value = undefined;
|
162
|
-
}
|
163
|
-
|
164
|
-
// Add support for onInput and onChange, see #3561
|
165
|
-
// if we have an oninput prop already change it to oninputCapture
|
166
|
-
if (/^oninput
|
167
|
-
i = i.toLowerCase();
|
168
|
-
if (normalizedProps[i]) {
|
169
|
-
i = 'oninputCapture';
|
170
|
-
}
|
171
|
-
}
|
172
|
-
|
173
|
-
normalizedProps[i] = value;
|
174
|
-
}
|
175
|
-
|
176
|
-
// Add support for array select values: <select multiple value={[]} />
|
177
|
-
if (
|
178
|
-
type == 'select' &&
|
179
|
-
normalizedProps.multiple &&
|
180
|
-
Array.isArray(normalizedProps.value)
|
181
|
-
) {
|
182
|
-
// forEach() always returns undefined, which we abuse here to unset the value prop.
|
183
|
-
normalizedProps.value = toChildArray(props.children).forEach(child => {
|
184
|
-
child.props.selected =
|
185
|
-
normalizedProps.value.indexOf(child.props.value) != -1;
|
186
|
-
});
|
187
|
-
}
|
188
|
-
|
189
|
-
// Adding support for defaultValue in select tag
|
190
|
-
if (type == 'select' && normalizedProps.defaultValue != null) {
|
191
|
-
normalizedProps.value = toChildArray(props.children).forEach(child => {
|
192
|
-
if (normalizedProps.multiple) {
|
193
|
-
child.props.selected =
|
194
|
-
normalizedProps.defaultValue.indexOf(child.props.value) != -1;
|
195
|
-
} else {
|
196
|
-
child.props.selected =
|
197
|
-
normalizedProps.defaultValue == child.props.value;
|
198
|
-
}
|
199
|
-
});
|
200
|
-
}
|
201
|
-
|
202
|
-
vnode.props = normalizedProps;
|
203
|
-
|
204
|
-
if (props.class != props.className) {
|
205
|
-
classNameDescriptor.enumerable = 'className' in props;
|
206
|
-
if (props.className != null) normalizedProps.class = props.className;
|
207
|
-
Object.defineProperty(normalizedProps, 'className', classNameDescriptor);
|
208
|
-
}
|
209
|
-
}
|
210
|
-
|
211
|
-
vnode.$$typeof = REACT_ELEMENT_TYPE;
|
212
|
-
|
213
|
-
if (oldVNodeHook) oldVNodeHook(vnode);
|
214
|
-
};
|
215
|
-
|
216
|
-
// Only needed for react-relay
|
217
|
-
let currentComponent;
|
218
|
-
const oldBeforeRender = options._render;
|
219
|
-
options._render = function(vnode) {
|
220
|
-
if (oldBeforeRender) {
|
221
|
-
oldBeforeRender(vnode);
|
222
|
-
}
|
223
|
-
currentComponent = vnode._component;
|
224
|
-
};
|
225
|
-
|
226
|
-
// This is a very very private internal function for React it
|
227
|
-
// is used to sort-of do runtime dependency injection. So far
|
228
|
-
// only `react-relay` makes use of it. It uses it to read the
|
229
|
-
// context value.
|
230
|
-
export const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
231
|
-
ReactCurrentDispatcher: {
|
232
|
-
current: {
|
233
|
-
readContext(context) {
|
234
|
-
return currentComponent._globalContext[context._id].props.value;
|
235
|
-
}
|
236
|
-
}
|
237
|
-
}
|
238
|
-
};
|
1
|
+
import {
|
2
|
+
render as preactRender,
|
3
|
+
hydrate as preactHydrate,
|
4
|
+
options,
|
5
|
+
toChildArray,
|
6
|
+
Component
|
7
|
+
} from 'preact';
|
8
|
+
|
9
|
+
export const REACT_ELEMENT_TYPE =
|
10
|
+
(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||
|
11
|
+
0xeac7;
|
12
|
+
|
13
|
+
const CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|shape|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;
|
14
|
+
|
15
|
+
const IS_DOM = typeof document !== 'undefined';
|
16
|
+
|
17
|
+
// Input types for which onchange should not be converted to oninput.
|
18
|
+
// type="file|checkbox|radio", plus "range" in IE11.
|
19
|
+
// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches "range")
|
20
|
+
const onChangeInputType = type =>
|
21
|
+
(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'
|
22
|
+
? /fil|che|rad/i
|
23
|
+
: /fil|che|ra/i
|
24
|
+
).test(type);
|
25
|
+
|
26
|
+
// Some libraries like `react-virtualized` explicitly check for this.
|
27
|
+
Component.prototype.isReactComponent = {};
|
28
|
+
|
29
|
+
// `UNSAFE_*` lifecycle hooks
|
30
|
+
// Preact only ever invokes the unprefixed methods.
|
31
|
+
// Here we provide a base "fallback" implementation that calls any defined UNSAFE_ prefixed method.
|
32
|
+
// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.
|
33
|
+
// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.
|
34
|
+
// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.
|
35
|
+
// See https://github.com/preactjs/preact/issues/1941
|
36
|
+
[
|
37
|
+
'componentWillMount',
|
38
|
+
'componentWillReceiveProps',
|
39
|
+
'componentWillUpdate'
|
40
|
+
].forEach(key => {
|
41
|
+
Object.defineProperty(Component.prototype, key, {
|
42
|
+
configurable: true,
|
43
|
+
get() {
|
44
|
+
return this['UNSAFE_' + key];
|
45
|
+
},
|
46
|
+
set(v) {
|
47
|
+
Object.defineProperty(this, key, {
|
48
|
+
configurable: true,
|
49
|
+
writable: true,
|
50
|
+
value: v
|
51
|
+
});
|
52
|
+
}
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Proxy render() since React returns a Component reference.
|
58
|
+
* @param {import('./internal').VNode} vnode VNode tree to render
|
59
|
+
* @param {import('./internal').PreactElement} parent DOM node to render vnode tree into
|
60
|
+
* @param {() => void} [callback] Optional callback that will be called after rendering
|
61
|
+
* @returns {import('./internal').Component | null} The root component reference or null
|
62
|
+
*/
|
63
|
+
export function render(vnode, parent, callback) {
|
64
|
+
// React destroys any existing DOM nodes, see #1727
|
65
|
+
// ...but only on the first render, see #1828
|
66
|
+
if (parent._children == null) {
|
67
|
+
parent.textContent = '';
|
68
|
+
}
|
69
|
+
|
70
|
+
preactRender(vnode, parent);
|
71
|
+
if (typeof callback == 'function') callback();
|
72
|
+
|
73
|
+
return vnode ? vnode._component : null;
|
74
|
+
}
|
75
|
+
|
76
|
+
export function hydrate(vnode, parent, callback) {
|
77
|
+
preactHydrate(vnode, parent);
|
78
|
+
if (typeof callback == 'function') callback();
|
79
|
+
|
80
|
+
return vnode ? vnode._component : null;
|
81
|
+
}
|
82
|
+
|
83
|
+
let oldEventHook = options.event;
|
84
|
+
options.event = e => {
|
85
|
+
if (oldEventHook) e = oldEventHook(e);
|
86
|
+
e.persist = empty;
|
87
|
+
e.isPropagationStopped = isPropagationStopped;
|
88
|
+
e.isDefaultPrevented = isDefaultPrevented;
|
89
|
+
return (e.nativeEvent = e);
|
90
|
+
};
|
91
|
+
|
92
|
+
function empty() {}
|
93
|
+
|
94
|
+
function isPropagationStopped() {
|
95
|
+
return this.cancelBubble;
|
96
|
+
}
|
97
|
+
|
98
|
+
function isDefaultPrevented() {
|
99
|
+
return this.defaultPrevented;
|
100
|
+
}
|
101
|
+
|
102
|
+
let classNameDescriptor = {
|
103
|
+
configurable: true,
|
104
|
+
get() {
|
105
|
+
return this.class;
|
106
|
+
}
|
107
|
+
};
|
108
|
+
|
109
|
+
let oldVNodeHook = options.vnode;
|
110
|
+
options.vnode = vnode => {
|
111
|
+
let type = vnode.type;
|
112
|
+
let props = vnode.props;
|
113
|
+
let normalizedProps = props;
|
114
|
+
|
115
|
+
// only normalize props on Element nodes
|
116
|
+
if (typeof type === 'string') {
|
117
|
+
const nonCustomElement = type.indexOf('-') === -1;
|
118
|
+
normalizedProps = {};
|
119
|
+
|
120
|
+
for (let i in props) {
|
121
|
+
let value = props[i];
|
122
|
+
|
123
|
+
if (IS_DOM && i === 'children' && type === 'noscript') {
|
124
|
+
// Emulate React's behavior of not rendering the contents of noscript tags on the client.
|
125
|
+
continue;
|
126
|
+
} else if (i === 'value' && 'defaultValue' in props && value == null) {
|
127
|
+
// Skip applying value if it is null/undefined and we already set
|
128
|
+
// a default value
|
129
|
+
continue;
|
130
|
+
} else if (
|
131
|
+
i === 'defaultValue' &&
|
132
|
+
'value' in props &&
|
133
|
+
props.value == null
|
134
|
+
) {
|
135
|
+
// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.
|
136
|
+
// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.
|
137
|
+
i = 'value';
|
138
|
+
} else if (i === 'download' && value === true) {
|
139
|
+
// Calling `setAttribute` with a truthy value will lead to it being
|
140
|
+
// passed as a stringified value, e.g. `download="true"`. React
|
141
|
+
// converts it to an empty string instead, otherwise the attribute
|
142
|
+
// value will be used as the file name and the file will be called
|
143
|
+
// "true" upon downloading it.
|
144
|
+
value = '';
|
145
|
+
} else if (/ondoubleclick/i.test(i)) {
|
146
|
+
i = 'ondblclick';
|
147
|
+
} else if (
|
148
|
+
/^onchange(textarea|input)/i.test(i + type) &&
|
149
|
+
!onChangeInputType(props.type)
|
150
|
+
) {
|
151
|
+
i = 'oninput';
|
152
|
+
} else if (/^onfocus$/i.test(i)) {
|
153
|
+
i = 'onfocusin';
|
154
|
+
} else if (/^onblur$/i.test(i)) {
|
155
|
+
i = 'onfocusout';
|
156
|
+
} else if (/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)) {
|
157
|
+
i = i.toLowerCase();
|
158
|
+
} else if (nonCustomElement && CAMEL_PROPS.test(i)) {
|
159
|
+
i = i.replace(/[A-Z0-9]/, '-$&').toLowerCase();
|
160
|
+
} else if (value === null) {
|
161
|
+
value = undefined;
|
162
|
+
}
|
163
|
+
|
164
|
+
// Add support for onInput and onChange, see #3561
|
165
|
+
// if we have an oninput prop already change it to oninputCapture
|
166
|
+
if (/^oninput$/i.test(i)) {
|
167
|
+
i = i.toLowerCase();
|
168
|
+
if (normalizedProps[i]) {
|
169
|
+
i = 'oninputCapture';
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
normalizedProps[i] = value;
|
174
|
+
}
|
175
|
+
|
176
|
+
// Add support for array select values: <select multiple value={[]} />
|
177
|
+
if (
|
178
|
+
type == 'select' &&
|
179
|
+
normalizedProps.multiple &&
|
180
|
+
Array.isArray(normalizedProps.value)
|
181
|
+
) {
|
182
|
+
// forEach() always returns undefined, which we abuse here to unset the value prop.
|
183
|
+
normalizedProps.value = toChildArray(props.children).forEach(child => {
|
184
|
+
child.props.selected =
|
185
|
+
normalizedProps.value.indexOf(child.props.value) != -1;
|
186
|
+
});
|
187
|
+
}
|
188
|
+
|
189
|
+
// Adding support for defaultValue in select tag
|
190
|
+
if (type == 'select' && normalizedProps.defaultValue != null) {
|
191
|
+
normalizedProps.value = toChildArray(props.children).forEach(child => {
|
192
|
+
if (normalizedProps.multiple) {
|
193
|
+
child.props.selected =
|
194
|
+
normalizedProps.defaultValue.indexOf(child.props.value) != -1;
|
195
|
+
} else {
|
196
|
+
child.props.selected =
|
197
|
+
normalizedProps.defaultValue == child.props.value;
|
198
|
+
}
|
199
|
+
});
|
200
|
+
}
|
201
|
+
|
202
|
+
vnode.props = normalizedProps;
|
203
|
+
|
204
|
+
if (props.class != props.className) {
|
205
|
+
classNameDescriptor.enumerable = 'className' in props;
|
206
|
+
if (props.className != null) normalizedProps.class = props.className;
|
207
|
+
Object.defineProperty(normalizedProps, 'className', classNameDescriptor);
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
vnode.$$typeof = REACT_ELEMENT_TYPE;
|
212
|
+
|
213
|
+
if (oldVNodeHook) oldVNodeHook(vnode);
|
214
|
+
};
|
215
|
+
|
216
|
+
// Only needed for react-relay
|
217
|
+
let currentComponent;
|
218
|
+
const oldBeforeRender = options._render;
|
219
|
+
options._render = function(vnode) {
|
220
|
+
if (oldBeforeRender) {
|
221
|
+
oldBeforeRender(vnode);
|
222
|
+
}
|
223
|
+
currentComponent = vnode._component;
|
224
|
+
};
|
225
|
+
|
226
|
+
// This is a very very private internal function for React it
|
227
|
+
// is used to sort-of do runtime dependency injection. So far
|
228
|
+
// only `react-relay` makes use of it. It uses it to read the
|
229
|
+
// context value.
|
230
|
+
export const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
231
|
+
ReactCurrentDispatcher: {
|
232
|
+
current: {
|
233
|
+
readContext(context) {
|
234
|
+
return currentComponent._globalContext[context._id].props.value;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var n=require("preact");require("preact/devtools");var e={};function t(e){return e.type===n.Fragment?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var o=[],r=[];function a(){return o.length>0?o[o.length-1]:null}var i=!1;function
|
2
|
-
//# sourceMappingURL=debug.js.map
|
1
|
+
var n=require("preact");require("preact/devtools");var e={};function t(e){return e.type===n.Fragment?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var o=[],r=[];function a(){return o.length>0?o[o.length-1]:null}var i=!1;function c(e){return"function"==typeof e.type&&e.type!=n.Fragment}function s(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+t(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":i||(i=!0,console.warn("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.")),n+"\n"},"")}var u="function"==typeof WeakMap,l=n.Component.prototype.setState;n.Component.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+s(a())),l.call(this,n,e)};var f=n.Component.prototype.forceUpdate;function p(n){var e=n.props,o=t(n),r="";for(var a in e)if(e.hasOwnProperty(a)&&"children"!==a){var i=e[a];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+a+"="+JSON.stringify(i)}var c=e.children;return"<"+o+r+(c&&c.length?">..</"+o+">":" />")}n.Component.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+s(a())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+s(this.__v)),f.call(this,n)},function(){!function(){var e=n.options.__b,t=n.options.diffed,a=n.options.__,i=n.options.vnode,s=n.options.__r;n.options.diffed=function(n){c(n)&&r.pop(),o.pop(),t&&t(n)},n.options.__b=function(n){c(n)&&o.push(n),e&&e(n)},n.options.__=function(n,e){r=[],a&&a(n,e)},n.options.vnode=function(n){n.__o=r.length>0?r[r.length-1]:null,i&&i(n)},n.options.__r=function(n){c(n)&&r.push(n),s&&s(n)}}();var a=!1,i=n.options.__b,l=n.options.diffed,f=n.options.vnode,d=n.options.__e,h=n.options.__,v=n.options.__h,y=u?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,m=[];n.options.__e=function(n,e,o,r){if(e&&e.__c&&"function"==typeof n.then){var a=n;n=new Error("Missing Suspense. The throwing component was: "+t(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=a;break}if(n instanceof Error)throw n}try{(r=r||{}).componentStack=s(e),d(n,e,o,r),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},n.options.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var r=t(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+r+" />, "+e+");")}h&&h(n,e)},n.options.__b=function(n){var o=n.type,r=function n(e){return e?"function"==typeof e.type?n(e.__):e:{}}(n.__);if(a=!0,void 0===o)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+p(n)+"\n\n"+s(n));if(null!=o&&"object"==typeof o){if(void 0!==o.__k&&void 0!==o.__e)throw new Error("Invalid type passed to createElement(): "+o+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+t(n)+" = "+p(o)+";\n let vnode = <My"+t(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+s(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(o)?"array":o))}if("thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===r.type?"tr"===o&&"thead"!==r.type&&"tfoot"!==r.type&&"tbody"!==r.type&&"table"!==r.type?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent."+p(n)+"\n\n"+s(n)):"td"===o&&"tr"!==r.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+p(n)+"\n\n"+s(n)):"th"===o&&"tr"!==r.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+p(n)+"\n\n"+s(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+p(n)+"\n\n"+s(n)),void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+p(n)+"\n\n"+s(n));if("string"==typeof n.type)for(var c in n.props)if("o"===c[0]&&"n"===c[1]&&"function"!=typeof n.props[c]&&null!=n.props[c])throw new Error("Component's \""+c+'" property should be a function, but got ['+typeof n.props[c]+"] instead\n"+p(n)+"\n\n"+s(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&y&&!y.lazyPropTypes.has(n.type)){var u="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var l=n.type();y.lazyPropTypes.set(n.type,!0),console.warn(u+"Component wrapped in lazy() is "+t(l))}catch(n){console.warn(u+"We will log the wrapped component's name once it is loaded.")}}var f=n.props;n.type.__f&&delete(f=function(n,e){for(var t in e)n[t]=e[t];return n}({},f)).ref,function(n,t,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](t,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}!i||i.message in e||(e[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(n.type.propTypes,f,0,t(n),function(){return s(n)})}i&&i(n)},n.options.__h=function(n,e,t){if(!n||!a)throw new Error("Hook can only be invoked from render methods.");v&&v(n,e,t)};var b=function(n,e){return{get:function(){var t="get"+n+e;m&&m.indexOf(t)<0&&(m.push(t),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var t="set"+n+e;m&&m.indexOf(t)<0&&(m.push(t),console.warn("setting vnode."+n+" is not allowed, "+e))}}},w={nodeName:b("nodeName","use vnode.type"),attributes:b("attributes","use vnode.props"),children:b("children","use vnode.props.children")},g=Object.create({},w);n.options.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var t=n.props={};for(var o in e){var r=e[o];"__source"===o?n.__source=r:"__self"===o?n.__self=r:t[o]=r}}n.__proto__=g,f&&f(n)},n.options.diffed=function(n){if(n.__k&&n.__k.forEach(function(e){if(e&&void 0===e.type){delete e.__,delete e.__b;var t=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+t+"}.\n\n"+s(n))}}),a=!1,l&&l(n),null!=n.__k)for(var e=[],t=0;t<n.__k.length;t++){var o=n.__k[t];if(o&&null!=o.key){var r=o.key;if(-1!==e.indexOf(r)){console.error('Following component has two or more children with the same key attribute: "'+r+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+p(n)+"\n\n"+s(n));break}e.push(r)}}}}(),exports.resetPropWarnings=function(){e={}};
|
2
|
+
//# sourceMappingURL=debug.js.map
|