@bpmn-io/properties-panel 3.13.0 → 3.14.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.
- package/dist/assets/properties-panel.css +0 -4
- package/dist/index.esm.js +31 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +66 -63
- package/dist/index.js.map +1 -1
- package/package.json +27 -30
- package/preact/README.md +2 -2
- package/preact/compat/LICENSE +21 -0
- package/preact/compat/dist/compat.js +1 -1
- package/preact/compat/dist/compat.js.map +1 -1
- package/preact/compat/dist/compat.mjs +1 -1
- package/preact/compat/dist/compat.module.js +1 -1
- package/preact/compat/dist/compat.module.js.map +1 -1
- package/preact/compat/dist/compat.umd.js +1 -1
- package/preact/compat/dist/compat.umd.js.map +1 -1
- package/preact/compat/server.browser.js +7 -0
- package/preact/compat/server.mjs +7 -0
- package/preact/compat/src/index.d.ts +22 -8
- package/preact/compat/src/index.js +35 -3
- package/preact/compat/src/portals.js +26 -35
- package/preact/compat/src/suspense.js +9 -6
- package/preact/compat/src/util.js +0 -5
- package/preact/debug/LICENSE +21 -0
- package/preact/debug/dist/debug.js +1 -1
- package/preact/debug/dist/debug.js.map +1 -1
- package/preact/debug/dist/debug.mjs +1 -1
- package/preact/debug/dist/debug.module.js +1 -1
- package/preact/debug/dist/debug.module.js.map +1 -1
- package/preact/debug/dist/debug.umd.js +1 -1
- package/preact/debug/dist/debug.umd.js.map +1 -1
- package/preact/debug/src/debug.js +124 -42
- package/preact/devtools/LICENSE +21 -0
- package/preact/devtools/dist/devtools.js +1 -1
- package/preact/devtools/dist/devtools.js.map +1 -1
- package/preact/devtools/dist/devtools.mjs +1 -1
- package/preact/devtools/dist/devtools.module.js +1 -1
- package/preact/devtools/dist/devtools.module.js.map +1 -1
- package/preact/devtools/dist/devtools.umd.js +1 -1
- package/preact/devtools/dist/devtools.umd.js.map +1 -1
- package/preact/devtools/src/devtools.js +1 -1
- package/preact/dist/preact.js +1 -1
- package/preact/dist/preact.js.map +1 -1
- package/preact/dist/preact.min.js +1 -1
- package/preact/dist/preact.min.js.map +1 -1
- package/preact/dist/preact.min.module.js +1 -1
- package/preact/dist/preact.min.module.js.map +1 -1
- package/preact/dist/preact.min.umd.js +1 -1
- package/preact/dist/preact.min.umd.js.map +1 -1
- package/preact/dist/preact.mjs +1 -1
- package/preact/dist/preact.module.js +1 -1
- package/preact/dist/preact.module.js.map +1 -1
- package/preact/dist/preact.umd.js +1 -1
- package/preact/dist/preact.umd.js.map +1 -1
- package/preact/hooks/LICENSE +21 -0
- package/preact/jsx-runtime/LICENSE +21 -0
- package/preact/jsx-runtime/dist/jsxRuntime.js +1 -1
- package/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
- package/preact/jsx-runtime/dist/jsxRuntime.mjs +1 -1
- package/preact/jsx-runtime/dist/jsxRuntime.module.js +1 -1
- package/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
- package/preact/jsx-runtime/dist/jsxRuntime.umd.js +1 -1
- package/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
- package/preact/jsx-runtime/src/index.d.ts +10 -0
- package/preact/jsx-runtime/src/index.js +113 -4
- package/preact/jsx-runtime/src/utils.js +36 -0
- package/preact/package.json +4 -3
- package/preact/src/clone-element.js +6 -4
- package/preact/src/component.js +34 -28
- package/preact/src/constants.js +13 -1
- package/preact/src/create-context.js +3 -3
- package/preact/src/create-element.js +14 -11
- package/preact/src/diff/catch-error.js +11 -7
- package/preact/src/diff/children.js +321 -218
- package/preact/src/diff/index.js +188 -142
- package/preact/src/diff/props.js +31 -38
- package/preact/src/index.d.ts +38 -19
- package/preact/src/index.js +1 -1
- package/preact/src/internal.d.ts +183 -153
- package/preact/src/jsx.d.ts +883 -19
- package/preact/src/options.js +1 -1
- package/preact/src/render.js +11 -11
- package/preact/src/util.js +2 -2
- package/preact/test-utils/dist/testUtils.js +1 -1
- package/preact/test-utils/dist/testUtils.js.map +1 -1
- package/preact/test-utils/dist/testUtils.mjs +1 -1
- package/preact/test-utils/dist/testUtils.module.js +1 -1
- package/preact/test-utils/dist/testUtils.module.js.map +1 -1
- package/preact/test-utils/dist/testUtils.umd.js +1 -1
- package/preact/test-utils/dist/testUtils.umd.js.map +1 -1
- package/preact/test-utils/src/index.js +13 -5
|
@@ -15,12 +15,42 @@ import { assign, isNaN } from './util';
|
|
|
15
15
|
|
|
16
16
|
const isWeakMapSupported = typeof WeakMap == 'function';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @param {import('./internal').VNode} vnode
|
|
20
|
+
* @returns {Array<string>}
|
|
21
|
+
*/
|
|
22
|
+
function getDomChildren(vnode) {
|
|
23
|
+
let domChildren = [];
|
|
24
|
+
|
|
25
|
+
if (!vnode._children) return domChildren;
|
|
26
|
+
|
|
27
|
+
vnode._children.forEach(child => {
|
|
28
|
+
if (child && typeof child.type === 'function') {
|
|
29
|
+
domChildren.push.apply(domChildren, getDomChildren(child));
|
|
30
|
+
} else if (child && typeof child.type === 'string') {
|
|
31
|
+
domChildren.push(child.type);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return domChildren;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {import('./internal').VNode} parent
|
|
40
|
+
* @returns {string}
|
|
41
|
+
*/
|
|
42
|
+
function getClosestDomNodeParentName(parent) {
|
|
43
|
+
if (!parent) return '';
|
|
20
44
|
if (typeof parent.type == 'function') {
|
|
21
|
-
|
|
45
|
+
if (parent._parent === null) {
|
|
46
|
+
if (parent._dom !== null && parent._dom.parentNode !== null) {
|
|
47
|
+
return parent._dom.parentNode.localName;
|
|
48
|
+
}
|
|
49
|
+
return '';
|
|
50
|
+
}
|
|
51
|
+
return getClosestDomNodeParentName(parent._parent);
|
|
22
52
|
}
|
|
23
|
-
return parent;
|
|
53
|
+
return /** @type {string} */ (parent.type);
|
|
24
54
|
}
|
|
25
55
|
|
|
26
56
|
export function initDebug() {
|
|
@@ -116,8 +146,7 @@ export function initDebug() {
|
|
|
116
146
|
};
|
|
117
147
|
|
|
118
148
|
options._diff = vnode => {
|
|
119
|
-
let { type
|
|
120
|
-
let parentVNode = getClosestDomNodeParent(parent);
|
|
149
|
+
let { type } = vnode;
|
|
121
150
|
|
|
122
151
|
hooksAllowed = true;
|
|
123
152
|
|
|
@@ -146,41 +175,6 @@ export function initDebug() {
|
|
|
146
175
|
);
|
|
147
176
|
}
|
|
148
177
|
|
|
149
|
-
if (
|
|
150
|
-
(type === 'thead' || type === 'tfoot' || type === 'tbody') &&
|
|
151
|
-
parentVNode.type !== 'table'
|
|
152
|
-
) {
|
|
153
|
-
console.error(
|
|
154
|
-
'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +
|
|
155
|
-
serializeVNode(vnode) +
|
|
156
|
-
`\n\n${getOwnerStack(vnode)}`
|
|
157
|
-
);
|
|
158
|
-
} else if (
|
|
159
|
-
type === 'tr' &&
|
|
160
|
-
parentVNode.type !== 'thead' &&
|
|
161
|
-
parentVNode.type !== 'tfoot' &&
|
|
162
|
-
parentVNode.type !== 'tbody' &&
|
|
163
|
-
parentVNode.type !== 'table'
|
|
164
|
-
) {
|
|
165
|
-
console.error(
|
|
166
|
-
'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +
|
|
167
|
-
serializeVNode(vnode) +
|
|
168
|
-
`\n\n${getOwnerStack(vnode)}`
|
|
169
|
-
);
|
|
170
|
-
} else if (type === 'td' && parentVNode.type !== 'tr') {
|
|
171
|
-
console.error(
|
|
172
|
-
'Improper nesting of table. Your <td> should have a <tr> parent.' +
|
|
173
|
-
serializeVNode(vnode) +
|
|
174
|
-
`\n\n${getOwnerStack(vnode)}`
|
|
175
|
-
);
|
|
176
|
-
} else if (type === 'th' && parentVNode.type !== 'tr') {
|
|
177
|
-
console.error(
|
|
178
|
-
'Improper nesting of table. Your <th> should have a <tr>.' +
|
|
179
|
-
serializeVNode(vnode) +
|
|
180
|
-
`\n\n${getOwnerStack(vnode)}`
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
178
|
if (
|
|
185
179
|
vnode.ref !== undefined &&
|
|
186
180
|
typeof vnode.ref != 'function' &&
|
|
@@ -319,6 +313,7 @@ export function initDebug() {
|
|
|
319
313
|
};
|
|
320
314
|
|
|
321
315
|
options.diffed = vnode => {
|
|
316
|
+
const { type, _parent: parent } = vnode;
|
|
322
317
|
// Check if the user passed plain objects as children. Note that we cannot
|
|
323
318
|
// move this check into `options.vnode` because components can receive
|
|
324
319
|
// children in any shape they want (e.g.
|
|
@@ -338,6 +333,77 @@ export function initDebug() {
|
|
|
338
333
|
});
|
|
339
334
|
}
|
|
340
335
|
|
|
336
|
+
if (typeof type === 'string' && (isTableElement(type) || type === 'p')) {
|
|
337
|
+
// Avoid false positives when Preact only partially rendered the
|
|
338
|
+
// HTML tree. Whilst we attempt to include the outer DOM in our
|
|
339
|
+
// validation, this wouldn't work on the server for
|
|
340
|
+
// `preact-render-to-string`. There we'd otherwise flood the terminal
|
|
341
|
+
// with false positives, which we'd like to avoid.
|
|
342
|
+
let domParentName = getClosestDomNodeParentName(parent);
|
|
343
|
+
if (domParentName !== '') {
|
|
344
|
+
if (
|
|
345
|
+
type === 'table' &&
|
|
346
|
+
// Tables can be nested inside each other if it's inside a cell.
|
|
347
|
+
// See https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced#nesting_tables
|
|
348
|
+
domParentName !== 'td' &&
|
|
349
|
+
isTableElement(domParentName)
|
|
350
|
+
) {
|
|
351
|
+
console.log(domParentName, parent._dom);
|
|
352
|
+
console.error(
|
|
353
|
+
'Improper nesting of table. Your <table> should not have a table-node parent.' +
|
|
354
|
+
serializeVNode(vnode) +
|
|
355
|
+
`\n\n${getOwnerStack(vnode)}`
|
|
356
|
+
);
|
|
357
|
+
} else if (
|
|
358
|
+
(type === 'thead' || type === 'tfoot' || type === 'tbody') &&
|
|
359
|
+
domParentName !== 'table'
|
|
360
|
+
) {
|
|
361
|
+
console.error(
|
|
362
|
+
'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +
|
|
363
|
+
serializeVNode(vnode) +
|
|
364
|
+
`\n\n${getOwnerStack(vnode)}`
|
|
365
|
+
);
|
|
366
|
+
} else if (
|
|
367
|
+
type === 'tr' &&
|
|
368
|
+
domParentName !== 'thead' &&
|
|
369
|
+
domParentName !== 'tfoot' &&
|
|
370
|
+
domParentName !== 'tbody' &&
|
|
371
|
+
domParentName !== 'table'
|
|
372
|
+
) {
|
|
373
|
+
console.error(
|
|
374
|
+
'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +
|
|
375
|
+
serializeVNode(vnode) +
|
|
376
|
+
`\n\n${getOwnerStack(vnode)}`
|
|
377
|
+
);
|
|
378
|
+
} else if (type === 'td' && domParentName !== 'tr') {
|
|
379
|
+
console.error(
|
|
380
|
+
'Improper nesting of table. Your <td> should have a <tr> parent.' +
|
|
381
|
+
serializeVNode(vnode) +
|
|
382
|
+
`\n\n${getOwnerStack(vnode)}`
|
|
383
|
+
);
|
|
384
|
+
} else if (type === 'th' && domParentName !== 'tr') {
|
|
385
|
+
console.error(
|
|
386
|
+
'Improper nesting of table. Your <th> should have a <tr>.' +
|
|
387
|
+
serializeVNode(vnode) +
|
|
388
|
+
`\n\n${getOwnerStack(vnode)}`
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
} else if (type === 'p') {
|
|
392
|
+
let illegalDomChildrenTypes = getDomChildren(vnode).filter(childType =>
|
|
393
|
+
ILLEGAL_PARAGRAPH_CHILD_ELEMENTS.test(childType)
|
|
394
|
+
);
|
|
395
|
+
if (illegalDomChildrenTypes.length) {
|
|
396
|
+
console.error(
|
|
397
|
+
'Improper nesting of paragraph. Your <p> should not have ' +
|
|
398
|
+
illegalDomChildrenTypes.join(', ') +
|
|
399
|
+
'as child-elements.' +
|
|
400
|
+
serializeVNode(vnode) +
|
|
401
|
+
`\n\n${getOwnerStack(vnode)}`
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
341
407
|
hooksAllowed = false;
|
|
342
408
|
|
|
343
409
|
if (oldDiffed) oldDiffed(vnode);
|
|
@@ -374,7 +440,8 @@ export function initDebug() {
|
|
|
374
440
|
for (let i = 0; i < hooks.length; i += 1) {
|
|
375
441
|
const hook = hooks[i];
|
|
376
442
|
if (hook._args) {
|
|
377
|
-
for (
|
|
443
|
+
for (let j = 0; j < hook._args.length; j++) {
|
|
444
|
+
const arg = hook._args[j];
|
|
378
445
|
if (isNaN(arg)) {
|
|
379
446
|
const componentName = getDisplayName(vnode);
|
|
380
447
|
throw new Error(
|
|
@@ -408,6 +475,21 @@ Component.prototype.setState = function (update, callback) {
|
|
|
408
475
|
return setState.call(this, update, callback);
|
|
409
476
|
};
|
|
410
477
|
|
|
478
|
+
function isTableElement(type) {
|
|
479
|
+
return (
|
|
480
|
+
type === 'table' ||
|
|
481
|
+
type === 'tfoot' ||
|
|
482
|
+
type === 'tbody' ||
|
|
483
|
+
type === 'thead' ||
|
|
484
|
+
type === 'td' ||
|
|
485
|
+
type === 'tr' ||
|
|
486
|
+
type === 'th'
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const ILLEGAL_PARAGRAPH_CHILD_ELEMENTS =
|
|
491
|
+
/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/;
|
|
492
|
+
|
|
411
493
|
const forceUpdate = Component.prototype.forceUpdate;
|
|
412
494
|
Component.prototype.forceUpdate = function (callback) {
|
|
413
495
|
if (this._vnode == null) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-present Jason Miller
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var n=require("../..");"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.
|
|
1
|
+
var n=require("../..");"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.19.3",n.options,{Fragment:n.Fragment,Component:n.Component}),exports.addHookName=function(e,o){return n.options.__a&&n.options.__a(o),e};
|
|
2
2
|
//# sourceMappingURL=devtools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { options, Fragment, Component } from '../..';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.
|
|
1
|
+
{"version":3,"file":"devtools.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { options, Fragment, Component } from '../..';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.19.3', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","import { options } from '../..';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n"],"names":["window","__PREACT_DEVTOOLS__","attachPreact","options","Fragment","Component","value","name","__a"],"mappings":"wBAGsB,oBAAVA,QAAyBA,OAAOC,qBAC1CD,OAAOC,oBAAoBC,aAAa,UAAWC,EAAAA,QAAS,CAC3DC,SAAAA,EAAAA,SACAC,UAAAA,EAF2DA,gCCKvD,SAAqBC,EAAOC,GAIlC,OAHIJ,EAAAA,QAAsBK,KACzBL,EAAAA,QAAOK,IAAcD,GAEfD,CACP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{options as n,Fragment as o,Component as e}from"../..";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.
|
|
1
|
+
import{options as n,Fragment as o,Component as e}from"../..";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.19.3",n,{Fragment:o,Component:e});export{t as addHookName};
|
|
2
2
|
//# sourceMappingURL=devtools.module.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{options as n,Fragment as o,Component as e}from"../..";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.
|
|
1
|
+
import{options as n,Fragment as o,Component as e}from"../..";function t(o,e){return n.__a&&n.__a(e),o}"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.19.3",n,{Fragment:o,Component:e});export{t as addHookName};
|
|
2
2
|
//# sourceMappingURL=devtools.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.module.js","sources":["../src/index.js","../src/devtools.js"],"sourcesContent":["import { options } from '../..';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n","import { options, Fragment, Component } from '../..';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.
|
|
1
|
+
{"version":3,"file":"devtools.module.js","sources":["../src/index.js","../src/devtools.js"],"sourcesContent":["import { options } from '../..';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n","import { options, Fragment, Component } from '../..';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.19.3', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n"],"names":["addHookName","value","name","options","__a","window","__PREACT_DEVTOOLS__","attachPreact","Fragment","Component"],"mappings":"8DASO,SAASA,EAAYC,EAAOC,GAIlC,OAHIC,EAAsBC,KACzBD,EAAOC,IAAcF,GAEfD,CACP,CCXqB,oBAAVI,QAAyBA,OAAOC,qBAC1CD,OAAOC,oBAAoBC,aAAa,UAAWJ,EAAS,CAC3DK,SAAAA,EACAC,UAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("../..")):"function"==typeof define&&define.amd?define(["exports","preact"],n):n((e||self).preactDevtools={},e.preact)}(this,function(e,n){"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("../..")):"function"==typeof define&&define.amd?define(["exports","preact"],n):n((e||self).preactDevtools={},e.preact)}(this,function(e,n){"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.19.3",n.options,{Fragment:n.Fragment,Component:n.Component}),e.addHookName=function(e,o){return n.options.__a&&n.options.__a(o),e}});
|
|
2
2
|
//# sourceMappingURL=devtools.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.umd.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { options, Fragment, Component } from '../..';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.
|
|
1
|
+
{"version":3,"file":"devtools.umd.js","sources":["../src/devtools.js","../src/index.js"],"sourcesContent":["import { options, Fragment, Component } from '../..';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.19.3', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","import { options } from '../..';\nimport { initDevTools } from './devtools';\n\ninitDevTools();\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, name: string) => T}\n */\nexport function addHookName(value, name) {\n\tif (options._addHookName) {\n\t\toptions._addHookName(name);\n\t}\n\treturn value;\n}\n"],"names":["window","__PREACT_DEVTOOLS__","attachPreact","options","Fragment","Component","value","name","__a"],"mappings":"8QAGsB,oBAAVA,QAAyBA,OAAOC,qBAC1CD,OAAOC,oBAAoBC,aAAa,UAAWC,EAAAA,QAAS,CAC3DC,SAAAA,EAAAA,SACAC,UAAAA,EAF2DA,0BCKvD,SAAqBC,EAAOC,GAIlC,OAHIJ,EAAAA,QAAsBK,KACzBL,EAAAA,QAAOK,IAAcD,GAEfD,CACP"}
|
|
@@ -2,7 +2,7 @@ import { options, Fragment, Component } from '../..';
|
|
|
2
2
|
|
|
3
3
|
export function initDevTools() {
|
|
4
4
|
if (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {
|
|
5
|
-
window.__PREACT_DEVTOOLS__.attachPreact('10.
|
|
5
|
+
window.__PREACT_DEVTOOLS__.attachPreact('10.19.3', options, {
|
|
6
6
|
Fragment,
|
|
7
7
|
Component
|
|
8
8
|
});
|
package/preact/dist/preact.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var n,l,u,t,i,o,r,f,e,c={},s=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,a=Array.isArray;function v(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d(l,f,i,o,null)}function d(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function _(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?x(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function g(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!m.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(m)}function m(){var n,l,u,t,o,r,e,c;for(i.sort(f);n=i.shift();)n.__d&&(l=i.length,t=void 0,o=void 0,e=(r=(u=n).__v).__e,(c=u.__P)&&(t=[],(o=v({},r)).__v=r.__v+1,j(c,r,o,u.__n,void 0!==c.ownerSVGElement,null!=r.__h?[e]:null,t,null==e?x(r):e,r.__h),z(t,r),r.__e!=e&&b(r)),i.length>l&&i.sort(f));m.__r=0}function w(n,l,u,t,i,o,r,f,e,p){var v,h,y,k,b,g,m,w=t&&t.__k||s,$=w.length;for(u.__k=[],v=0;v<l.length;v++)if(null!=(k=u.__k[v]=null==(k=l[v])||"boolean"==typeof k||"function"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?d(null,k,null,null,k):a(k)?d(_,{children:k},null,null,null):k.__b>0?d(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(y=w[v])||y&&k.key==y.key&&k.type===y.type)w[v]=void 0;else for(h=0;h<$;h++){if((y=w[h])&&k.key==y.key&&k.type===y.type){w[h]=void 0;break}y=null}j(n,k,y=y||c,i,o,r,f,e,p),b=k.__e,(h=k.ref)&&y.ref!=h&&(m||(m=[]),y.ref&&m.push(y.ref,null,k),m.push(h,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===y.__k?k.__d=e=P(k,e,n):e=C(n,k,y,w,b,e),"function"==typeof u.type&&(u.__d=e)):e&&y.__e==e&&e.parentNode!=n&&(e=x(y))}for(u.__e=g,v=$;v--;)null!=w[v]&&("function"==typeof u.type&&null!=w[v].__e&&w[v].__e==u.__d&&(u.__d=S(t).nextSibling),N(w[v],w[v]));if(m)for(v=0;v<m.length;v++)M(m[v],m[++v],m[++v])}function P(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?P(t,l,u):C(u,t,t,i,t.__e,l));return l}function C(n,l,u,t,i,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||i!=o||null==i.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(i),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<t.length;e+=1)if(f==i)break n;n.insertBefore(i,o),r=o}return void 0!==r?r:i.nextSibling}function S(n){var l,u,t;if(null==n.type||"string"==typeof n.type)return n.__e;if(n.__k)for(l=n.__k.length-1;l>=0;l--)if((u=n.__k[l])&&(t=S(u)))return t;return null}function $(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],t)}function A(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||p.test(l)?u:u+"px"}function H(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||A(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||A(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function I(n){return this.l[n.type+!1](l.event?l.event(n):n)}function T(n){return this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,t,i,o,r,f,e,c){var s,p,h,y,d,x,b,g,m,P,C,S,$,A,H,I=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof I){if(g=u.props,m=(s=I.contextType)&&i[s.__c],P=s?m?m.props.value:s.__:i,t.__c?b=(p=u.__c=t.__c).__=p.__E:("prototype"in I&&I.prototype.render?u.__c=p=new I(g,P):(u.__c=p=new k(g,P),p.constructor=I,p.render=O),m&&m.sub(p),p.props=g,p.state||(p.state={}),p.context=P,p.__n=i,h=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,I.getDerivedStateFromProps(g,p.__s))),y=p.props,d=p.state,p.__v=u,h)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==I.getDerivedStateFromProps&&g!==y&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,P),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,P)||u.__v===t.__v){for(u.__v!==t.__v&&(p.props=g,p.state=p.__s,p.__d=!1),p.__e=!1,u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u)}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,P),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(y,d,x)})}if(p.context=P,p.props=g,p.__P=n,S=l.__r,$=0,"prototype"in I&&I.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),s=p.render(p.props,p.state,p.context),A=0;A<p._sb.length;A++)p.__h.push(p._sb[A]);p._sb=[]}else do{p.__d=!1,S&&S(u),s=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++$<25);p.state=p.__s,null!=p.getChildContext&&(i=v(v({},i),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(x=p.getSnapshotBeforeUpdate(y,d)),w(n,a(H=null!=s&&s.type===_&&null==s.key?s.props.children:s)?H:[H],u,t,i,o,r,f,e,c),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),b&&(p.__E=p.__=null),p.__e=!1}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=L(t.__e,u,t,i,o,r,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,t)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,t,i,o,r,f,e){var s,p,v,y=t.props,d=u.props,_=u.type,k=0;if("svg"===_&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!_&&(_?s.localName===_:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===_)return document.createTextNode(d);l=o?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),r=null,e=!1}if(null===_)y===d||e&&l.data===d||(l.data=d);else{if(r=r&&n.call(l.childNodes),p=(y=t.props||c).dangerouslySetInnerHTML,v=d.dangerouslySetInnerHTML,!e){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||p)&&(v&&(p&&v.__html==p.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if($(l,d,y,o,e),v)u.__k=[];else if(w(l,a(k=u.props.children)?k:[k],u,t,i,o&&"foreignObject"!==_,r,f,r?r[0]:t.__k&&x(t,0),e),null!=r)for(k=r.length;k--;)null!=r[k]&&h(r[k]);e||("value"in d&&void 0!==(k=d.value)&&(k!==l.value||"progress"===_&&!k||"option"===_&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1))}return l}function M(n,u,t){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,t)}}function N(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||M(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&N(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||h(n.__e),n.__=n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function q(u,t,i){var o,r,f;l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],j(t,u=(!o&&i||t).__k=y(_,null,[u]),r||c,c,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o),z(f,u)}n=s.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof n&&(n=n(v({},u),this.props)),n&&v(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),g(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),g(this))},k.prototype.render=_,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},m.__r=0,e=0,exports.Component=k,exports.Fragment=_,exports.cloneElement=function(l,u,t){var i,o,r,f,e=v({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),d(l.type,e,i||l.key,o||l.ref,null)},exports.createContext=function(n,l){var u={__c:l="__cC"+e++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,g(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u},exports.createElement=y,exports.createRef=function(){return{current:null}},exports.h=y,exports.hydrate=function n(l,u){q(l,u,n)},exports.isValidElement=t,exports.options=l,exports.render=q,exports.toChildArray=function n(l,u){return u=u||[],null==l||"boolean"==typeof l||(a(l)?l.some(function(l){n(l,u)}):u.push(l)),u};
|
|
1
|
+
var n,l,t,u,i,o,r,e,f,c={},s=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function v(n,l){for(var t in l)n[t]=l[t];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function y(l,t,u){var i,o,r,e={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:e[r]=t[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return d(l,e,i,o,null)}function d(n,u,i,o,r){var e={type:n,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function _(n){return n.children}function x(n,l){this.props=n,this.context=l}function g(n,l){if(null==l)return n.__?g(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?g(n):null}function b(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return b(n)}}function k(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!m.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(m)}function m(){var n,t,u,o,r,f,c,s,a;for(i.sort(e);n=i.shift();)n.__d&&(t=i.length,o=void 0,f=(r=(u=n).__v).__e,s=[],a=[],(c=u.__P)&&((o=v({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),A(c,o,r,u.__n,void 0!==c.ownerSVGElement,32&r.__u?[f]:null,s,null==f?g(r):f,!!(32&r.__u),a),o.__.__k[o.__i]=o,D(s,o,a),o.__e!=f&&b(o)),i.length>t&&i.sort(e));m.__r=0}function w(n,l,t,u,i,o,r,e,f,a,p){var v,h,y,d,_,x=u&&u.__k||s,g=l.length;for(t.__d=f,P(t,l,x),f=t.__d,v=0;v<g;v++)null!=(y=t.__k[v])&&"boolean"!=typeof y&&"function"!=typeof y&&(h=-1===y.__i?c:x[y.__i]||c,y.__i=v,A(n,y,h,i,o,r,e,f,a,p),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&M(h.ref,null,y),p.push(y.ref,y.__c||d,y)),null==_&&null!=d&&(_=d),65536&y.__u||h.__k===y.__k?f=S(y,f,n):"function"==typeof y.type&&void 0!==y.__d?f=y.__d:d&&(f=d.nextSibling),y.__d=void 0,y.__u&=-196609);t.__d=f,t.__e=_}function P(n,l,t){var u,i,o,r,e,f=l.length,c=t.length,s=c,a=0;for(n.__k=[],u=0;u<f;u++)null!=(i=n.__k[u]=null==(i=l[u])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?d(null,i,null,null,i):p(i)?d(_,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?d(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,e=$(i,t,r=u+a,s),i.__i=e,o=null,-1!==e&&(s--,(o=t[e])&&(o.__u|=131072)),null==o||null===o.__v?(-1==e&&a--,"function"!=typeof i.type&&(i.__u|=65536)):e!==r&&(e===r+1?a++:e>r?s>f-r?a+=e-r:a--:a=e<r&&e==r-1?e-r:0,e!==u+a&&(i.__u|=65536))):(o=t[u])&&null==o.key&&o.__e&&(o.__e==n.__d&&(n.__d=g(o)),j(o,o,!1),t[u]=null,s--);if(s)for(u=0;u<c;u++)null!=(o=t[u])&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=g(o)),j(o,o))}function S(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=S(u[i],l,t));return l}return n.__e!=l&&(t.insertBefore(n.__e,l||null),l=n.__e),l&&l.nextSibling}function $(n,l,t,u){var i=n.key,o=n.type,r=t-1,e=t+1,f=l[t];if(null===f||f&&i==f.key&&o===f.type)return t;if(u>(null!=f&&0==(131072&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(131072&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(131072&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function C(n,l,t){"-"===l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||a.test(l)?t:t+"px"}function H(n,l,t,u,i){var o;n:if("style"===l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||C(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||C(n.style,l,t[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=t,t?u?t.t=u.t:(t.t=Date.now(),n.addEventListener(l,o?T:I,o)):n.removeEventListener(l,o?T:I,o);else{if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==t?"":t;break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,t))}}function I(n){var t=this.l[n.type+!1];if(n.u){if(n.u<=t.t)return}else n.u=Date.now();return t(l.event?l.event(n):n)}function T(n){return this.l[n.type+!0](l.event?l.event(n):n)}function A(n,t,u,i,o,r,e,f,c,s){var a,h,y,d,g,b,k,m,P,S,$,C,H,I,T,A=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),r=[f=t.__e=u.__e]),(a=l.__b)&&a(t);n:if("function"==typeof A)try{if(m=t.props,P=(a=A.contextType)&&i[a.__c],S=a?P?P.props.value:a.__:i,u.__c?k=(h=t.__c=u.__c).__=h.__E:("prototype"in A&&A.prototype.render?t.__c=h=new A(m,S):(t.__c=h=new x(m,S),h.constructor=A,h.render=z),P&&P.sub(h),h.props=m,h.state||(h.state={}),h.context=S,h.__n=i,y=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=A.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=v({},h.__s)),v(h.__s,A.getDerivedStateFromProps(m,h.__s))),d=h.props,g=h.state,h.__v=t,y)null==A.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==A.getDerivedStateFromProps&&m!==d&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,S),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,S)||t.__v===u.__v)){for(t.__v!==u.__v&&(h.props=m,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.forEach(function(n){n&&(n.__=t)}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,S),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(d,g,b)})}if(h.context=S,h.props=m,h.__P=n,h.__e=!1,C=l.__r,H=0,"prototype"in A&&A.prototype.render){for(h.state=h.__s,h.__d=!1,C&&C(t),a=h.render(h.props,h.state,h.context),I=0;I<h._sb.length;I++)h.__h.push(h._sb[I]);h._sb=[]}else do{h.__d=!1,C&&C(t),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=v(v({},i),h.getChildContext())),y||null==h.getSnapshotBeforeUpdate||(b=h.getSnapshotBeforeUpdate(d,g)),w(n,p(T=null!=a&&a.type===_&&null==a.key?a.props.children:a)?T:[T],t,u,i,o,r,e,f,c,s),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),k&&(h.__E=h.__=null)}catch(n){t.__v=null,c||null!=r?(t.__e=f,t.__u|=c?160:32,r[r.indexOf(f)]=null):(t.__e=u.__e,t.__k=u.__k),l.__e(n,t,u)}else null==r&&t.__v===u.__v?(t.__k=u.__k,t.__e=u.__e):t.__e=L(u.__e,t,u,i,o,r,e,c,s);(a=l.diffed)&&a(t)}function D(n,t,u){t.__d=void 0;for(var i=0;i<u.length;i++)M(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function L(l,t,u,i,o,r,e,f,s){var a,v,y,d,_,x,b,k=u.props,m=t.props,P=t.type;if("svg"===P&&(o=!0),null!=r)for(a=0;a<r.length;a++)if((_=r[a])&&"setAttribute"in _==!!P&&(P?_.localName===P:3===_.nodeType)){l=_,r[a]=null;break}if(null==l){if(null===P)return document.createTextNode(m);l=o?document.createElementNS("http://www.w3.org/2000/svg",P):document.createElement(P,m.is&&m),r=null,f=!1}if(null===P)k===m||f&&l.data===m||(l.data=m);else{if(r=r&&n.call(l.childNodes),k=u.props||c,!f&&null!=r)for(k={},a=0;a<l.attributes.length;a++)k[(_=l.attributes[a]).name]=_.value;for(a in k)_=k[a],"children"==a||("dangerouslySetInnerHTML"==a?y=_:"key"===a||a in m||H(l,a,null,_,o));for(a in m)_=m[a],"children"==a?d=_:"dangerouslySetInnerHTML"==a?v=_:"value"==a?x=_:"checked"==a?b=_:"key"===a||f&&"function"!=typeof _||k[a]===_||H(l,a,_,k[a],o);if(v)f||y&&(v.__html===y.__html||v.__html===l.innerHTML)||(l.innerHTML=v.__html),t.__k=[];else if(y&&(l.innerHTML=""),w(l,p(d)?d:[d],t,u,i,o&&"foreignObject"!==P,r,e,r?r[0]:u.__k&&g(u,0),f,s),null!=r)for(a=r.length;a--;)null!=r[a]&&h(r[a]);f||(a="value",void 0!==x&&(x!==l[a]||"progress"===P&&!x||"option"===P&&x!==k[a])&&H(l,a,x,k[a],!1),a="checked",void 0!==b&&b!==l[a]&&H(l,a,b,k[a],!1))}return l}function M(n,t,u){try{"function"==typeof n?n(t):n.current=t}catch(n){l.__e(n,u)}}function j(n,t,u){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||M(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&j(i[o],t,u||"function"!=typeof n.type);u||null==n.__e||h(n.__e),n.__=n.__e=n.__d=void 0}function z(n,l,t){return this.constructor(n,t)}function N(t,u,i){var o,r,e,f;l.__&&l.__(t,u),r=(o="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],A(u,t=(!o&&i||u).__k=y(_,null,[t]),r||c,c,void 0!==u.ownerSVGElement,!o&&i?[i]:r?null:u.firstChild?n.call(u.childNodes):null,e,!o&&i?i:r?r.__e:u.firstChild,o,f),D(e,t,f)}n=s.slice,l={__e:function(n,l,t,u){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,u||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof n&&(n=n(v({},t),this.props)),n&&v(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),k(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),k(this))},x.prototype.render=_,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},m.__r=0,f=0,exports.Component=x,exports.Fragment=_,exports.cloneElement=function(l,t,u){var i,o,r,e,f=v({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==r?i=t[r]:"ref"==r?o=t[r]:f[r]=void 0===t[r]&&void 0!==e?e[r]:t[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),d(l.type,f,i||l.key,o||l.ref,null)},exports.createContext=function(n,l){var t={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,u;return this.getChildContext||(t=[],(u={})[l]=this,this.getChildContext=function(){return u},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.some(function(n){n.__e=!0,k(n)})},this.sub=function(n){t.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t.splice(t.indexOf(n),1),l&&l.call(n)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t},exports.createElement=y,exports.createRef=function(){return{current:null}},exports.h=y,exports.hydrate=function n(l,t){N(l,t,n)},exports.isValidElement=u,exports.options=l,exports.render=N,exports.toChildArray=function n(l,t){return t=t||[],null==l||"boolean"==typeof l||(p(l)?l.some(function(l){n(l,t)}):t.push(l)),t};
|
|
2
2
|
//# sourceMappingURL=preact.js.map
|