@bpmn-io/properties-panel 2.2.0 → 3.0.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 (114) hide show
  1. package/assets/properties-panel.css +11 -6
  2. package/dist/index.esm.js +12 -64
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +12 -64
  5. package/dist/index.js.map +1 -1
  6. package/package.json +7 -7
  7. package/preact/README.md +56 -51
  8. package/preact/compat/client.js +19 -0
  9. package/preact/compat/client.mjs +22 -0
  10. package/preact/compat/dist/compat.js +1 -1
  11. package/preact/compat/dist/compat.js.map +1 -1
  12. package/preact/compat/dist/compat.mjs +1 -1
  13. package/preact/compat/dist/compat.module.js +1 -1
  14. package/preact/compat/dist/compat.module.js.map +1 -1
  15. package/preact/compat/dist/compat.umd.js +1 -1
  16. package/preact/compat/dist/compat.umd.js.map +1 -1
  17. package/preact/compat/jsx-dev-runtime.js +2 -0
  18. package/preact/compat/jsx-dev-runtime.mjs +2 -0
  19. package/preact/compat/jsx-runtime.js +2 -0
  20. package/preact/compat/jsx-runtime.mjs +2 -0
  21. package/preact/compat/package.json +31 -0
  22. package/preact/compat/scheduler.js +15 -0
  23. package/preact/compat/{src/scheduler.js → scheduler.mjs} +8 -9
  24. package/preact/compat/server.browser.js +4 -0
  25. package/preact/compat/src/PureComponent.js +1 -1
  26. package/preact/compat/src/forwardRef.js +2 -9
  27. package/preact/compat/src/index.d.ts +58 -4
  28. package/preact/compat/src/index.js +73 -2
  29. package/preact/compat/src/portals.js +4 -2
  30. package/preact/compat/src/render.js +133 -76
  31. package/preact/compat/src/suspense-list.d.ts +2 -2
  32. package/preact/compat/src/suspense-list.js +14 -13
  33. package/preact/compat/src/suspense.d.ts +4 -4
  34. package/preact/compat/src/suspense.js +6 -6
  35. package/preact/compat/src/util.js +10 -0
  36. package/preact/debug/dist/debug.js +1 -1
  37. package/preact/debug/dist/debug.js.map +1 -1
  38. package/preact/debug/dist/debug.mjs +1 -1
  39. package/preact/debug/dist/debug.module.js +1 -1
  40. package/preact/debug/dist/debug.module.js.map +1 -1
  41. package/preact/debug/dist/debug.umd.js +1 -1
  42. package/preact/debug/dist/debug.umd.js.map +1 -1
  43. package/preact/debug/package.json +9 -0
  44. package/preact/debug/src/check-props.js +3 -3
  45. package/preact/debug/src/debug.js +38 -17
  46. package/preact/debug/src/index.d.ts +4 -0
  47. package/preact/debug/src/util.js +4 -0
  48. package/preact/devtools/dist/devtools.js +1 -1
  49. package/preact/devtools/dist/devtools.js.map +1 -1
  50. package/preact/devtools/dist/devtools.mjs +1 -1
  51. package/preact/devtools/dist/devtools.module.js +1 -1
  52. package/preact/devtools/dist/devtools.module.js.map +1 -1
  53. package/preact/devtools/dist/devtools.umd.js +1 -1
  54. package/preact/devtools/dist/devtools.umd.js.map +1 -1
  55. package/preact/devtools/package.json +23 -14
  56. package/preact/devtools/src/devtools.js +1 -1
  57. package/preact/dist/preact.js +1 -1
  58. package/preact/dist/preact.js.map +1 -1
  59. package/preact/dist/preact.min.js +1 -1
  60. package/preact/dist/preact.min.js.map +1 -1
  61. package/preact/dist/preact.min.module.js +2 -0
  62. package/preact/dist/preact.min.module.js.map +1 -0
  63. package/preact/dist/preact.min.umd.js +2 -0
  64. package/preact/dist/preact.min.umd.js.map +1 -0
  65. package/preact/dist/preact.mjs +1 -1
  66. package/preact/dist/preact.module.js +1 -1
  67. package/preact/dist/preact.module.js.map +1 -1
  68. package/preact/dist/preact.umd.js +1 -1
  69. package/preact/dist/preact.umd.js.map +1 -1
  70. package/preact/hooks/dist/hooks.js +1 -1
  71. package/preact/hooks/dist/hooks.js.map +1 -1
  72. package/preact/hooks/dist/hooks.mjs +1 -1
  73. package/preact/hooks/dist/hooks.module.js +1 -1
  74. package/preact/hooks/dist/hooks.module.js.map +1 -1
  75. package/preact/hooks/dist/hooks.umd.js +1 -1
  76. package/preact/hooks/dist/hooks.umd.js.map +1 -1
  77. package/preact/hooks/package.json +9 -0
  78. package/preact/hooks/src/index.d.ts +26 -14
  79. package/preact/hooks/src/index.js +169 -44
  80. package/preact/hooks/src/internal.d.ts +12 -2
  81. package/preact/jsx-runtime/dist/jsxRuntime.js +1 -1
  82. package/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
  83. package/preact/jsx-runtime/dist/jsxRuntime.mjs +1 -1
  84. package/preact/jsx-runtime/dist/jsxRuntime.module.js +1 -1
  85. package/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
  86. package/preact/jsx-runtime/dist/jsxRuntime.umd.js +1 -1
  87. package/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
  88. package/preact/jsx-runtime/package.json +26 -17
  89. package/preact/jsx-runtime/src/index.js +19 -13
  90. package/preact/package.json +315 -262
  91. package/preact/src/clone-element.js +16 -10
  92. package/preact/src/component.js +33 -23
  93. package/preact/src/constants.js +2 -1
  94. package/preact/src/create-context.js +8 -3
  95. package/preact/src/create-element.js +9 -11
  96. package/preact/src/diff/catch-error.js +4 -2
  97. package/preact/src/diff/children.js +41 -32
  98. package/preact/src/diff/index.js +81 -34
  99. package/preact/src/diff/props.js +15 -14
  100. package/preact/src/index.d.ts +369 -301
  101. package/preact/src/internal.d.ts +11 -2
  102. package/preact/src/jsx.d.ts +1862 -626
  103. package/preact/src/options.js +1 -2
  104. package/preact/src/render.js +5 -6
  105. package/preact/src/util.js +6 -0
  106. package/preact/test-utils/dist/testUtils.js +1 -1
  107. package/preact/test-utils/dist/testUtils.js.map +1 -1
  108. package/preact/test-utils/dist/testUtils.mjs +1 -1
  109. package/preact/test-utils/dist/testUtils.module.js +1 -1
  110. package/preact/test-utils/dist/testUtils.module.js.map +1 -1
  111. package/preact/test-utils/dist/testUtils.umd.js +1 -1
  112. package/preact/test-utils/dist/testUtils.umd.js.map +1 -1
  113. package/preact/test-utils/package.json +9 -0
  114. package/preact/test-utils/src/index.js +2 -1
@@ -9,6 +9,7 @@ import {
9
9
  } from '../..';
10
10
  import {
11
11
  useState,
12
+ useId,
12
13
  useReducer,
13
14
  useEffect,
14
15
  useLayoutEffect,
@@ -26,15 +27,15 @@ import { Children } from './Children';
26
27
  import { Suspense, lazy } from './suspense';
27
28
  import { SuspenseList } from './suspense-list';
28
29
  import { createPortal } from './portals';
30
+ import { is } from './util';
29
31
  import {
30
32
  hydrate,
31
33
  render,
32
34
  REACT_ELEMENT_TYPE,
33
35
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
34
36
  } from './render';
35
- export * from './scheduler';
36
37
 
37
- const version = '16.8.0'; // trick libraries to think we are react
38
+ const version = '17.0.2'; // trick libraries to think we are react
38
39
 
39
40
  /**
40
41
  * Legacy version of createElement.
@@ -101,12 +102,74 @@ function findDOMNode(component) {
101
102
  // eslint-disable-next-line camelcase
102
103
  const unstable_batchedUpdates = (callback, arg) => callback(arg);
103
104
 
105
+ /**
106
+ * In React, `flushSync` flushes the entire tree and forces a rerender. It's
107
+ * implmented here as a no-op.
108
+ * @template Arg
109
+ * @template Result
110
+ * @param {(arg: Arg) => Result} callback function that runs before the flush
111
+ * @param {Arg} [arg] Optional argument that can be passed to the callback
112
+ * @returns
113
+ */
114
+ const flushSync = (callback, arg) => callback(arg);
115
+
104
116
  /**
105
117
  * Strict Mode is not implemented in Preact, so we provide a stand-in for it
106
118
  * that just renders its children without imposing any restrictions.
107
119
  */
108
120
  const StrictMode = Fragment;
109
121
 
122
+ export function startTransition(cb) {
123
+ cb();
124
+ }
125
+
126
+ export function useDeferredValue(val) {
127
+ return val;
128
+ }
129
+
130
+ export function useTransition() {
131
+ return [false, startTransition];
132
+ }
133
+
134
+ // TODO: in theory this should be done after a VNode is diffed as we want to insert
135
+ // styles/... before it attaches
136
+ export const useInsertionEffect = useLayoutEffect;
137
+
138
+ /**
139
+ * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84
140
+ * on a high level this cuts out the warnings, ... and attempts a smaller implementation
141
+ */
142
+ export function useSyncExternalStore(subscribe, getSnapshot) {
143
+ const value = getSnapshot();
144
+
145
+ const [{ _instance }, forceUpdate] = useState({
146
+ _instance: { _value: value, _getSnapshot: getSnapshot }
147
+ });
148
+
149
+ useLayoutEffect(() => {
150
+ _instance._value = value;
151
+ _instance._getSnapshot = getSnapshot;
152
+
153
+ if (!is(_instance._value, getSnapshot())) {
154
+ forceUpdate({ _instance });
155
+ }
156
+ }, [subscribe, value, getSnapshot]);
157
+
158
+ useEffect(() => {
159
+ if (!is(_instance._value, _instance._getSnapshot())) {
160
+ forceUpdate({ _instance });
161
+ }
162
+
163
+ return subscribe(() => {
164
+ if (!is(_instance._value, _instance._getSnapshot())) {
165
+ forceUpdate({ _instance });
166
+ }
167
+ });
168
+ }, [subscribe]);
169
+
170
+ return value;
171
+ }
172
+
110
173
  export * from '../../hooks';
111
174
  export {
112
175
  version,
@@ -127,6 +190,7 @@ export {
127
190
  PureComponent,
128
191
  memo,
129
192
  forwardRef,
193
+ flushSync,
130
194
  // eslint-disable-next-line camelcase
131
195
  unstable_batchedUpdates,
132
196
  StrictMode,
@@ -139,9 +203,15 @@ export {
139
203
  // React copies the named exports to the default one.
140
204
  export default {
141
205
  useState,
206
+ useId,
142
207
  useReducer,
143
208
  useEffect,
144
209
  useLayoutEffect,
210
+ useInsertionEffect,
211
+ useTransition,
212
+ useDeferredValue,
213
+ useSyncExternalStore,
214
+ startTransition,
145
215
  useRef,
146
216
  useImperativeHandle,
147
217
  useMemo,
@@ -166,6 +236,7 @@ export default {
166
236
  PureComponent,
167
237
  memo,
168
238
  forwardRef,
239
+ flushSync,
169
240
  unstable_batchedUpdates,
170
241
  StrictMode,
171
242
  Suspense,
@@ -19,7 +19,7 @@ function Portal(props) {
19
19
  const _this = this;
20
20
  let container = props._container;
21
21
 
22
- _this.componentWillUnmount = function() {
22
+ _this.componentWillUnmount = function () {
23
23
  render(null, _this._temp);
24
24
  _this._temp = null;
25
25
  _this._container = null;
@@ -76,5 +76,7 @@ function Portal(props) {
76
76
  * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.
77
77
  */
78
78
  export function createPortal(vnode, container) {
79
- return createElement(Portal, { _vnode: vnode, _container: container });
79
+ const el = createElement(Portal, { _vnode: vnode, _container: container });
80
+ el.containerInfo = container;
81
+ return el;
80
82
  }
@@ -10,15 +10,20 @@ export const REACT_ELEMENT_TYPE =
10
10
  (typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||
11
11
  0xeac7;
12
12
 
13
- const CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|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]/;
13
+ const CAMEL_PROPS =
14
+ /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;
15
+ const ON_ANI = /^on(Ani|Tra|Tou|BeforeInp|Compo)/;
16
+ const CAMEL_REPLACE = /[A-Z0-9]/g;
17
+
18
+ const IS_DOM = typeof document !== 'undefined';
14
19
 
15
20
  // Input types for which onchange should not be converted to oninput.
16
21
  // type="file|checkbox|radio", plus "range" in IE11.
17
22
  // (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches "range")
18
23
  const onChangeInputType = type =>
19
24
  (typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'
20
- ? /fil|che|rad/i
21
- : /fil|che|ra/i
25
+ ? /fil|che|rad/
26
+ : /fil|che|ra/
22
27
  ).test(type);
23
28
 
24
29
  // Some libraries like `react-virtualized` explicitly check for this.
@@ -81,6 +86,7 @@ export function hydrate(vnode, parent, callback) {
81
86
  let oldEventHook = options.event;
82
87
  options.event = e => {
83
88
  if (oldEventHook) e = oldEventHook(e);
89
+
84
90
  e.persist = empty;
85
91
  e.isPropagationStopped = isPropagationStopped;
86
92
  e.isDefaultPrevented = isDefaultPrevented;
@@ -97,96 +103,125 @@ function isDefaultPrevented() {
97
103
  return this.defaultPrevented;
98
104
  }
99
105
 
100
- let classNameDescriptor = {
106
+ const classNameDescriptorNonEnumberable = {
107
+ enumerable: false,
101
108
  configurable: true,
102
109
  get() {
103
110
  return this.class;
104
111
  }
105
112
  };
106
113
 
107
- let oldVNodeHook = options.vnode;
108
- options.vnode = vnode => {
109
- let type = vnode.type;
110
- let props = vnode.props;
111
- let normalizedProps = props;
112
-
113
- // only normalize props on Element nodes
114
- if (typeof type === 'string') {
114
+ function handleDomVNode(vnode) {
115
+ let props = vnode.props,
116
+ type = vnode.type,
115
117
  normalizedProps = {};
116
118
 
117
- for (let i in props) {
118
- let value = props[i];
119
-
120
- if (i === 'value' && 'defaultValue' in props && value == null) {
121
- // Skip applying value if it is null/undefined and we already set
122
- // a default value
123
- continue;
124
- } else if (
125
- i === 'defaultValue' &&
126
- 'value' in props &&
127
- props.value == null
128
- ) {
129
- // `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.
130
- // `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.
131
- i = 'value';
132
- } else if (i === 'download' && value === true) {
133
- // Calling `setAttribute` with a truthy value will lead to it being
134
- // passed as a stringified value, e.g. `download="true"`. React
135
- // converts it to an empty string instead, otherwise the attribute
136
- // value will be used as the file name and the file will be called
137
- // "true" upon downloading it.
138
- value = '';
139
- } else if (/ondoubleclick/i.test(i)) {
140
- i = 'ondblclick';
141
- } else if (
142
- /^onchange(textarea|input)/i.test(i + type) &&
143
- !onChangeInputType(props.type)
144
- ) {
145
- i = 'oninput';
146
- } else if (/^on(Ani|Tra|Tou|BeforeInp)/.test(i)) {
147
- i = i.toLowerCase();
148
- } else if (CAMEL_PROPS.test(i)) {
149
- i = i.replace(/[A-Z0-9]/, '-$&').toLowerCase();
150
- } else if (value === null) {
151
- value = undefined;
152
- }
119
+ for (let i in props) {
120
+ let value = props[i];
153
121
 
154
- normalizedProps[i] = value;
122
+ if (
123
+ (i === 'value' && 'defaultValue' in props && value == null) ||
124
+ // Emulate React's behavior of not rendering the contents of noscript tags on the client.
125
+ (IS_DOM && i === 'children' && type === 'noscript') ||
126
+ i === 'class' ||
127
+ i === 'className'
128
+ ) {
129
+ // Skip applying value if it is null/undefined and we already set
130
+ // a default value
131
+ continue;
155
132
  }
156
133
 
157
- // Add support for array select values: <select multiple value={[]} />
158
- if (
159
- type == 'select' &&
160
- normalizedProps.multiple &&
161
- Array.isArray(normalizedProps.value)
134
+ let lowerCased = i.toLowerCase();
135
+ if (i === 'defaultValue' && 'value' in props && props.value == null) {
136
+ // `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.
137
+ // `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.
138
+ i = 'value';
139
+ } else if (i === 'download' && value === true) {
140
+ // Calling `setAttribute` with a truthy value will lead to it being
141
+ // passed as a stringified value, e.g. `download="true"`. React
142
+ // converts it to an empty string instead, otherwise the attribute
143
+ // value will be used as the file name and the file will be called
144
+ // "true" upon downloading it.
145
+ value = '';
146
+ } else if (lowerCased === 'ondoubleclick') {
147
+ i = 'ondblclick';
148
+ } else if (
149
+ lowerCased === 'onchange' &&
150
+ (type === 'input' || type === 'textarea') &&
151
+ !onChangeInputType(props.type)
162
152
  ) {
163
- // forEach() always returns undefined, which we abuse here to unset the value prop.
164
- normalizedProps.value = toChildArray(props.children).forEach(child => {
165
- child.props.selected =
166
- normalizedProps.value.indexOf(child.props.value) != -1;
167
- });
153
+ lowerCased = i = 'oninput';
154
+ } else if (lowerCased === 'onfocus') {
155
+ i = 'onfocusin';
156
+ } else if (lowerCased === 'onblur') {
157
+ i = 'onfocusout';
158
+ } else if (ON_ANI.test(i)) {
159
+ i = lowerCased;
160
+ } else if (type.indexOf('-') === -1 && CAMEL_PROPS.test(i)) {
161
+ i = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();
162
+ } else if (value === null) {
163
+ value = undefined;
168
164
  }
169
165
 
170
- // Adding support for defaultValue in select tag
171
- if (type == 'select' && normalizedProps.defaultValue != null) {
172
- normalizedProps.value = toChildArray(props.children).forEach(child => {
173
- if (normalizedProps.multiple) {
174
- child.props.selected =
175
- normalizedProps.defaultValue.indexOf(child.props.value) != -1;
176
- } else {
177
- child.props.selected =
178
- normalizedProps.defaultValue == child.props.value;
179
- }
180
- });
166
+ // Add support for onInput and onChange, see #3561
167
+ // if we have an oninput prop already change it to oninputCapture
168
+ if (lowerCased === 'oninput') {
169
+ i = lowerCased;
170
+ if (normalizedProps[i]) {
171
+ i = 'oninputCapture';
172
+ }
181
173
  }
182
174
 
183
- vnode.props = normalizedProps;
175
+ normalizedProps[i] = value;
184
176
  }
185
177
 
186
- if (type && props.class != props.className) {
187
- classNameDescriptor.enumerable = 'className' in props;
188
- if (props.className != null) normalizedProps.class = props.className;
189
- Object.defineProperty(normalizedProps, 'className', classNameDescriptor);
178
+ // Add support for array select values: <select multiple value={[]} />
179
+ if (
180
+ type == 'select' &&
181
+ normalizedProps.multiple &&
182
+ Array.isArray(normalizedProps.value)
183
+ ) {
184
+ // forEach() always returns undefined, which we abuse here to unset the value prop.
185
+ normalizedProps.value = toChildArray(props.children).forEach(child => {
186
+ child.props.selected =
187
+ normalizedProps.value.indexOf(child.props.value) != -1;
188
+ });
189
+ }
190
+
191
+ // Adding support for defaultValue in select tag
192
+ if (type == 'select' && normalizedProps.defaultValue != null) {
193
+ normalizedProps.value = toChildArray(props.children).forEach(child => {
194
+ if (normalizedProps.multiple) {
195
+ child.props.selected =
196
+ normalizedProps.defaultValue.indexOf(child.props.value) != -1;
197
+ } else {
198
+ child.props.selected =
199
+ normalizedProps.defaultValue == child.props.value;
200
+ }
201
+ });
202
+ }
203
+
204
+ if (props.class && !props.className) {
205
+ normalizedProps.class = props.class;
206
+ Object.defineProperty(
207
+ normalizedProps,
208
+ 'className',
209
+ classNameDescriptorNonEnumberable
210
+ );
211
+ } else if (props.className && !props.class) {
212
+ normalizedProps.class = normalizedProps.className = props.className;
213
+ } else if (props.class && props.className) {
214
+ normalizedProps.class = normalizedProps.className = props.className;
215
+ }
216
+
217
+ vnode.props = normalizedProps;
218
+ }
219
+
220
+ let oldVNodeHook = options.vnode;
221
+ options.vnode = vnode => {
222
+ // only normalize props on Element nodes
223
+ if (typeof vnode.type === 'string') {
224
+ handleDomVNode(vnode);
190
225
  }
191
226
 
192
227
  vnode.$$typeof = REACT_ELEMENT_TYPE;
@@ -197,13 +232,35 @@ options.vnode = vnode => {
197
232
  // Only needed for react-relay
198
233
  let currentComponent;
199
234
  const oldBeforeRender = options._render;
200
- options._render = function(vnode) {
235
+ options._render = function (vnode) {
201
236
  if (oldBeforeRender) {
202
237
  oldBeforeRender(vnode);
203
238
  }
204
239
  currentComponent = vnode._component;
205
240
  };
206
241
 
242
+ const oldDiffed = options.diffed;
243
+ /** @type {(vnode: import('./internal').VNode) => void} */
244
+ options.diffed = function (vnode) {
245
+ if (oldDiffed) {
246
+ oldDiffed(vnode);
247
+ }
248
+
249
+ const props = vnode.props;
250
+ const dom = vnode._dom;
251
+
252
+ if (
253
+ dom != null &&
254
+ vnode.type === 'textarea' &&
255
+ 'value' in props &&
256
+ props.value !== dom.value
257
+ ) {
258
+ dom.value = props.value == null ? '' : props.value;
259
+ }
260
+
261
+ currentComponent = null;
262
+ };
263
+
207
264
  // This is a very very private internal function for React it
208
265
  // is used to sort-of do runtime dependency injection. So far
209
266
  // only `react-relay` makes use of it. It uses it to read the
@@ -1,11 +1,11 @@
1
- import { Component, ComponentChild } from '../../src';
1
+ import { Component, ComponentChild, ComponentChildren } from '../../src';
2
2
 
3
3
  //
4
4
  // SuspenseList
5
5
  // -----------------------------------
6
6
 
7
7
  export interface SuspenseListProps {
8
- children?: preact.ComponentChildren;
8
+ children?: ComponentChildren;
9
9
  revealOrder?: 'forwards' | 'backwards' | 'together';
10
10
  }
11
11
 
@@ -57,7 +57,7 @@ const resolve = (list, child, node) => {
57
57
  // - do not set `Suspense.prototype.constructor` to `Suspense`
58
58
  SuspenseList.prototype = new Component();
59
59
 
60
- SuspenseList.prototype._suspended = function(child) {
60
+ SuspenseList.prototype._suspended = function (child) {
61
61
  const list = this;
62
62
  const delegated = suspended(list._vnode);
63
63
 
@@ -83,7 +83,7 @@ SuspenseList.prototype._suspended = function(child) {
83
83
  };
84
84
  };
85
85
 
86
- SuspenseList.prototype.render = function(props) {
86
+ SuspenseList.prototype.render = function (props) {
87
87
  this._next = null;
88
88
  this._map = new Map();
89
89
 
@@ -113,14 +113,15 @@ SuspenseList.prototype.render = function(props) {
113
113
  return props.children;
114
114
  };
115
115
 
116
- SuspenseList.prototype.componentDidUpdate = SuspenseList.prototype.componentDidMount = function() {
117
- // Iterate through all children after mounting for two reasons:
118
- // 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases
119
- // each node[RELEASED_COUNT] by 1, therefore balancing the counters.
120
- // The nodes can now be completely consumed from the linked list.
121
- // 2. Handle nodes that might have gotten resolved between render and
122
- // componentDidMount.
123
- this._map.forEach((node, child) => {
124
- resolve(this, child, node);
125
- });
126
- };
116
+ SuspenseList.prototype.componentDidUpdate =
117
+ SuspenseList.prototype.componentDidMount = function () {
118
+ // Iterate through all children after mounting for two reasons:
119
+ // 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases
120
+ // each node[RELEASED_COUNT] by 1, therefore balancing the counters.
121
+ // The nodes can now be completely consumed from the linked list.
122
+ // 2. Handle nodes that might have gotten resolved between render and
123
+ // componentDidMount.
124
+ this._map.forEach((node, child) => {
125
+ resolve(this, child, node);
126
+ });
127
+ };
@@ -1,13 +1,13 @@
1
- import { Component, ComponentChild } from '../../src';
1
+ import { Component, ComponentChild, ComponentChildren } from '../../src';
2
2
 
3
3
  //
4
4
  // Suspense/lazy
5
5
  // -----------------------------------
6
- export function lazy<T>(loader: () => Promise<{ default: T }>): T;
6
+ export function lazy<T>(loader: () => Promise<{ default: T } | T>): T;
7
7
 
8
8
  export interface SuspenseProps {
9
- children?: preact.ComponentChildren;
10
- fallback: preact.ComponentChildren;
9
+ children?: ComponentChildren;
10
+ fallback: ComponentChildren;
11
11
  }
12
12
 
13
13
  export class Suspense extends Component<SuspenseProps> {
@@ -2,7 +2,7 @@ import { Component, createElement, options, Fragment } from '../..';
2
2
  import { assign } from './util';
3
3
 
4
4
  const oldCatchError = options._catchError;
5
- options._catchError = function(error, newVNode, oldVNode) {
5
+ options._catchError = function (error, newVNode, oldVNode, errorInfo) {
6
6
  if (error.then) {
7
7
  /** @type {import('./internal').Component} */
8
8
  let component;
@@ -19,11 +19,11 @@ options._catchError = function(error, newVNode, oldVNode) {
19
19
  }
20
20
  }
21
21
  }
22
- oldCatchError(error, newVNode, oldVNode);
22
+ oldCatchError(error, newVNode, oldVNode, errorInfo);
23
23
  };
24
24
 
25
25
  const oldUnmount = options.unmount;
26
- options.unmount = function(vnode) {
26
+ options.unmount = function (vnode) {
27
27
  /** @type {import('./internal').Component} */
28
28
  const component = vnode._component;
29
29
  if (component && component._onResolve) {
@@ -110,7 +110,7 @@ Suspense.prototype = new Component();
110
110
  * @param {Promise} promise The thrown promise
111
111
  * @param {import('./internal').VNode<any, any>} suspendingVNode The suspending component
112
112
  */
113
- Suspense.prototype._childDidSuspend = function(promise, suspendingVNode) {
113
+ Suspense.prototype._childDidSuspend = function (promise, suspendingVNode) {
114
114
  const suspendingComponent = suspendingVNode._component;
115
115
 
116
116
  /** @type {import('./internal').SuspenseComponent} */
@@ -173,7 +173,7 @@ Suspense.prototype._childDidSuspend = function(promise, suspendingVNode) {
173
173
  promise.then(onResolved, onResolved);
174
174
  };
175
175
 
176
- Suspense.prototype.componentWillUnmount = function() {
176
+ Suspense.prototype.componentWillUnmount = function () {
177
177
  this._suspenders = [];
178
178
  };
179
179
 
@@ -182,7 +182,7 @@ Suspense.prototype.componentWillUnmount = function() {
182
182
  * @param {import('./internal').SuspenseComponent["props"]} props
183
183
  * @param {import('./internal').SuspenseState} state
184
184
  */
185
- Suspense.prototype.render = function(props, state) {
185
+ Suspense.prototype.render = function (props, state) {
186
186
  if (this._detachOnNextRender) {
187
187
  // When the Suspense's _vnode was created by a call to createVNode
188
188
  // (i.e. due to a setState further up in the tree)
@@ -26,3 +26,13 @@ export function removeNode(node) {
26
26
  let parentNode = node.parentNode;
27
27
  if (parentNode) parentNode.removeChild(node);
28
28
  }
29
+
30
+ /**
31
+ * Check if two values are the same value
32
+ * @param {*} x
33
+ * @param {*} y
34
+ * @returns {boolean}
35
+ */
36
+ export function is(x, y) {
37
+ return (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);
38
+ }
@@ -1,2 +1,2 @@
1
- var n=require("../..");require("../../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 s(e){return"function"==typeof e.type&&e.type!=n.Fragment}function c(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 l="function"==typeof WeakMap,u=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'+c(a())):null==this.__P&&console.warn('Can\'t call "this.setState" 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'+c(this.__v)),u.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 s=e.children;return"<"+o+r+(s&&s.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'+c(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'+c(this.__v)),f.call(this,n)},function(){!function(){var e=n.options.__b,t=n.options.diffed,a=n.options.__,i=n.options.vnode,c=n.options.__r;n.options.diffed=function(n){s(n)&&r.pop(),o.pop(),t&&t(n)},n.options.__b=function(n){s(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){s(n)&&r.push(n),c&&c(n)}}();var a=!1,i=n.options.__b,u=n.options.diffed,f=n.options.vnode,d=n.options.__e,h=n.options.__,y=n.options.__h,v=l?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,m=[];n.options.__e=function(n,e,o){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+t(e));for(var a=e;a;a=a.__)if(a.__c&&a.__c.__c){n=r;break}if(n instanceof Error)throw n}try{d(n,e,o),"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"+c(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"+c(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"+c(n)):"td"===o&&"tr"!==r.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+p(n)+"\n\n"+c(n)):"th"===o&&"tr"!==r.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+p(n)+"\n\n"+c(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+p(n)+"\n\n"+c(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"+c(n));if("string"==typeof n.type)for(var s in n.props)if("o"===s[0]&&"n"===s[1]&&"function"!=typeof n.props[s]&&null!=n.props[s])throw new Error("Component's \""+s+'" property should be a function, but got ['+typeof n.props[s]+"] instead\n"+p(n)+"\n\n"+c(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&v&&!v.lazyPropTypes.has(n.type)){var l="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var u=n.type();v.lazyPropTypes.set(n.type,!0),console.warn(l+"Component wrapped in lazy() is "+t(u))}catch(n){console.warn(l+"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 c(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.");y&&y(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"+c(n))}}),a=!1,u&&u(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"+c(n));break}e.push(r)}}}}(),exports.resetPropWarnings=function(){e={}};
1
+ var n=require("../..");function e(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=n[t];return o}function t(n,t){var o="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(o)return(o=o.call(n)).next.bind(o);if(Array.isArray(n)||(o=function(n,t){if(n){if("string"==typeof n)return e(n,t);var o=Object.prototype.toString.call(n).slice(8,-1);return"Object"===o&&n.constructor&&(o=n.constructor.name),"Map"===o||"Set"===o?Array.from(n):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?e(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){o&&(n=o);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}require("../../devtools");var o={};function r(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 a=[],i=[];function c(){return a.length>0?a[a.length-1]:null}var s=!1;function u(e){return"function"==typeof e.type&&e.type!=n.Fragment}function l(n){for(var e=[n],t=n;null!=t.__o;)e.push(t.__o),t=t.__o;return e.reduce(function(n,e){n+=" in "+r(e);var t=e.__source;return t?n+=" (at "+t.fileName+":"+t.lineNumber+")":s||(s=!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 f="function"==typeof WeakMap;function d(n){return n?"function"==typeof n.type?d(n.__):n:{}}var p=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'+l(c())),p.call(this,n,e)};var h=n.Component.prototype.forceUpdate;function v(n){var e=n.props,t=r(n),o="";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),o+=" "+a+"="+JSON.stringify(i)}var c=e.children;return"<"+t+o+(c&&c.length?">..</"+t+">":" />")}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'+l(c())):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'+l(this.__v)),h.call(this,n)},function(){!function(){var e=n.options.__b,t=n.options.diffed,o=n.options.__,r=n.options.vnode,c=n.options.__r;n.options.diffed=function(n){u(n)&&i.pop(),a.pop(),t&&t(n)},n.options.__b=function(n){u(n)&&a.push(n),e&&e(n)},n.options.__=function(n,e){i=[],o&&o(n,e)},n.options.vnode=function(n){n.__o=i.length>0?i[i.length-1]:null,r&&r(n)},n.options.__r=function(n){u(n)&&i.push(n),c&&c(n)}}();var e=!1,c=n.options.__b,s=n.options.diffed,p=n.options.vnode,h=n.options.__r,y=n.options.__e,m=n.options.__,b=n.options.__h,w=f?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,g=[];n.options.__e=function(n,e,t,o){if(e&&e.__c&&"function"==typeof n.then){var a=n;n=new Error("Missing Suspense. The throwing component was: "+r(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=a;break}if(n instanceof Error)throw n}try{(o=o||{}).componentStack=l(e),y(n,e,t,o),"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 t;switch(e.nodeType){case 1:case 11:case 9:t=!0;break;default:t=!1}if(!t){var o=r(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+o+" />, "+e+");")}m&&m(n,e)},n.options.__b=function(n){var t=n.type,a=d(n.__);if(e=!0,void 0===t)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"+v(n)+"\n\n"+l(n));if(null!=t&&"object"==typeof t){if(void 0!==t.__k&&void 0!==t.__e)throw new Error("Invalid type passed to createElement(): "+t+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+r(n)+" = "+v(t)+";\n let vnode = <My"+r(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+l(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(t)?"array":t))}if("thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===a.type?"tr"===t&&"thead"!==a.type&&"tfoot"!==a.type&&"tbody"!==a.type&&"table"!==a.type?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent."+v(n)+"\n\n"+l(n)):"td"===t&&"tr"!==a.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+v(n)+"\n\n"+l(n)):"th"===t&&"tr"!==a.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+v(n)+"\n\n"+l(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+v(n)+"\n\n"+l(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"+v(n)+"\n\n"+l(n));if("string"==typeof n.type)for(var i in n.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof n.props[i]&&null!=n.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof n.props[i]+"] instead\n"+v(n)+"\n\n"+l(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&w&&!w.lazyPropTypes.has(n.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var u=n.type();w.lazyPropTypes.set(n.type,!0),console.warn(s+"Component wrapped in lazy() is "+r(u))}catch(n){console.warn(s+"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,e,t,r,a){Object.keys(n).forEach(function(t){var i;try{i=n[t](e,t,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in o)&&(o[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(n.type.propTypes,f,0,r(n),function(){return l(n)})}c&&c(n)},n.options.__r=function(n){h&&h(n),e=!0},n.options.__h=function(n,t,o){if(!n||!e)throw new Error("Hook can only be invoked from render methods.");b&&b(n,t,o)};var E=function(n,e){return{get:function(){var t="get"+n+e;g&&g.indexOf(t)<0&&(g.push(t),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var t="set"+n+e;g&&g.indexOf(t)<0&&(g.push(t),console.warn("setting vnode."+n+" is not allowed, "+e))}}},k={nodeName:E("nodeName","use vnode.type"),attributes:E("attributes","use vnode.props"),children:E("children","use vnode.props.children")},_=Object.create({},k);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__=_,p&&p(n)},n.options.diffed=function(n){if(n.__k&&n.__k.forEach(function(e){if("object"==typeof e&&e&&void 0===e.type){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"+l(n))}}),e=!1,s&&s(n),null!=n.__k)for(var o=[],a=0;a<n.__k.length;a++){var i=n.__k[a];if(i&&null!=i.key){var c=i.key;if(-1!==o.indexOf(c)){console.error('Following component has two or more children with the same key attribute: "'+c+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+v(n)+"\n\n"+l(n));break}o.push(c)}}if(null!=n.__c&&null!=n.__c.__H){var u=n.__c.__H.__;if(u)for(var f=0;f<u.length;f+=1){var d=u[f];if(d.__H)for(var p,h=t(d.__H);!(p=h()).done;)if((m=p.value)!=m){var y=r(n);throw new Error("Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index "+f+" in component "+y+" was called with NaN.")}}}var m}}(),exports.resetPropWarnings=function(){o={}};
2
2
  //# sourceMappingURL=debug.js.map