@bpmn-io/properties-panel 2.2.1 → 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.
- package/dist/index.esm.js +12 -64
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -64
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/preact/README.md +56 -51
- package/preact/compat/client.js +19 -0
- package/preact/compat/client.mjs +22 -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/jsx-dev-runtime.js +2 -0
- package/preact/compat/jsx-dev-runtime.mjs +2 -0
- package/preact/compat/jsx-runtime.js +2 -0
- package/preact/compat/jsx-runtime.mjs +2 -0
- package/preact/compat/package.json +31 -0
- package/preact/compat/scheduler.js +15 -0
- package/preact/compat/{src/scheduler.js → scheduler.mjs} +8 -9
- package/preact/compat/server.browser.js +4 -0
- package/preact/compat/src/PureComponent.js +1 -1
- package/preact/compat/src/forwardRef.js +2 -9
- package/preact/compat/src/index.d.ts +58 -4
- package/preact/compat/src/index.js +73 -2
- package/preact/compat/src/portals.js +4 -2
- package/preact/compat/src/render.js +133 -76
- package/preact/compat/src/suspense-list.d.ts +2 -2
- package/preact/compat/src/suspense-list.js +14 -13
- package/preact/compat/src/suspense.d.ts +4 -4
- package/preact/compat/src/suspense.js +6 -6
- package/preact/compat/src/util.js +10 -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/package.json +9 -0
- package/preact/debug/src/check-props.js +3 -3
- package/preact/debug/src/debug.js +38 -17
- package/preact/debug/src/index.d.ts +4 -0
- package/preact/debug/src/util.js +4 -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/package.json +23 -14
- 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 +2 -0
- package/preact/dist/preact.min.module.js.map +1 -0
- package/preact/dist/preact.min.umd.js +2 -0
- package/preact/dist/preact.min.umd.js.map +1 -0
- 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/dist/hooks.js +1 -1
- package/preact/hooks/dist/hooks.js.map +1 -1
- package/preact/hooks/dist/hooks.mjs +1 -1
- package/preact/hooks/dist/hooks.module.js +1 -1
- package/preact/hooks/dist/hooks.module.js.map +1 -1
- package/preact/hooks/dist/hooks.umd.js +1 -1
- package/preact/hooks/dist/hooks.umd.js.map +1 -1
- package/preact/hooks/package.json +9 -0
- package/preact/hooks/src/index.d.ts +26 -14
- package/preact/hooks/src/index.js +169 -44
- package/preact/hooks/src/internal.d.ts +12 -2
- 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/package.json +26 -17
- package/preact/jsx-runtime/src/index.js +19 -13
- package/preact/package.json +315 -262
- package/preact/src/clone-element.js +16 -10
- package/preact/src/component.js +33 -23
- package/preact/src/constants.js +2 -1
- package/preact/src/create-context.js +8 -3
- package/preact/src/create-element.js +9 -11
- package/preact/src/diff/catch-error.js +4 -2
- package/preact/src/diff/children.js +41 -32
- package/preact/src/diff/index.js +81 -34
- package/preact/src/diff/props.js +15 -14
- package/preact/src/index.d.ts +369 -301
- package/preact/src/internal.d.ts +11 -2
- package/preact/src/jsx.d.ts +1862 -626
- package/preact/src/options.js +1 -2
- package/preact/src/render.js +5 -6
- package/preact/src/util.js +6 -0
- 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/package.json +9 -0
- package/preact/test-utils/src/index.js +2 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Component as PreactComponent,
|
|
3
|
-
PreactContext
|
|
3
|
+
PreactContext,
|
|
4
|
+
ErrorInfo,
|
|
5
|
+
VNode as PreactVNode
|
|
4
6
|
} from '../../src/internal';
|
|
5
7
|
import { Reducer } from '.';
|
|
6
8
|
|
|
@@ -36,6 +38,10 @@ export interface Component extends PreactComponent<any, any> {
|
|
|
36
38
|
__hooks?: ComponentHooks;
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
export interface VNode extends PreactVNode {
|
|
42
|
+
_mask?: [number, number];
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
export type HookState =
|
|
40
46
|
| EffectHookState
|
|
41
47
|
| MemoHookState
|
|
@@ -49,16 +55,20 @@ export type Cleanup = () => void;
|
|
|
49
55
|
export interface EffectHookState {
|
|
50
56
|
_value?: Effect;
|
|
51
57
|
_args?: any[];
|
|
58
|
+
_pendingArgs?: any[];
|
|
52
59
|
_cleanup?: Cleanup | void;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
export interface MemoHookState {
|
|
56
63
|
_value?: any;
|
|
64
|
+
_pendingValue?: any;
|
|
57
65
|
_args?: any[];
|
|
66
|
+
_pendingArgs?: any[];
|
|
58
67
|
_factory?: () => any;
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
export interface ReducerHookState {
|
|
71
|
+
_nextValue?: any;
|
|
62
72
|
_value?: any;
|
|
63
73
|
_component?: Component;
|
|
64
74
|
_reducer?: Reducer<any, any>;
|
|
@@ -71,5 +81,5 @@ export interface ContextHookState {
|
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
export interface ErrorBoundaryHookState {
|
|
74
|
-
_value?: (error: any) => void;
|
|
84
|
+
_value?: (error: any, errorInfo: ErrorInfo) => void;
|
|
75
85
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var r=require("../..");function _(_,
|
|
1
|
+
var r=require("../.."),e=0;function _(_,n,o,t,u,l){var f,i,c={};for(i in n)"ref"==i?f=n[i]:c[i]=n[i];var p={type:_,props:c,key:o,ref:f,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--e,__source:u,__self:l};if("function"==typeof _&&(f=_.defaultProps))for(i in f)void 0===c[i]&&(c[i]=f[i]);return r.options.vnode&&r.options.vnode(p),p}Object.defineProperty(exports,"Fragment",{enumerable:!0,get:function(){return r.Fragment}}),exports.jsx=_,exports.jsxDEV=_,exports.jsxs=_;
|
|
2
2
|
//# sourceMappingURL=jsxRuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsxRuntime.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from '../..';\n\n/** @typedef {import('preact').VNode} VNode */\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {
|
|
1
|
+
{"version":3,"file":"jsxRuntime.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from '../..';\n\n/** @typedef {import('preact').VNode} VNode */\n\nlet vnodeId = 0;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = {},\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'ref') {\n\t\t\tref = props[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (typeof normalizedProps[i] === 'undefined') {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment\n};\n"],"names":["vnodeId","createVNode","type","props","key","isStaticChildren","__source","__self","ref","i","normalizedProps","vnode","__k","__","__b","__e","__d","undefined","__c","__h","constructor","__v","defaultProps","options"],"mappings":"wBAIIA,EAAU,EAsBd,SAASC,EAAYC,EAAMC,EAAOC,EAAKC,EAAkBC,EAAUC,GAIlE,IACCC,EACAC,EAFGC,EAAkB,GAGtB,IAAKD,KAAKN,EACA,OAALM,EACHD,EAAML,EAAMM,GAEZC,EAAgBD,GAAKN,EAAMM,GAI7B,IAAME,EAAQ,CACbT,KAAAA,EACAC,MAAOO,EACPN,IAAAA,EACAI,IAAAA,EACAI,IAAW,KACXC,GAAS,KACTC,IAAQ,EACRC,IAAM,KACNC,SAAUC,EACVC,IAAY,KACZC,IAAY,KACZC,iBAAaH,EACbI,MAAarB,EACbM,SAAAA,EACAC,OAAAA,GAKD,GAAoB,mBAATL,IAAwBM,EAAMN,EAAKoB,cAC7C,IAAKb,KAAKD,OACyB,IAAvBE,EAAgBD,KAC1BC,EAAgBD,GAAKD,EAAIC,IAK5B,OADIc,EAAOA,QAACZ,OAAOY,EAAAA,QAAQZ,MAAMA,GAC1BA,CACP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{options as r
|
|
1
|
+
import{options as r}from"../..";export{Fragment}from"../..";var _=0;function o(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return r.vnode&&r.vnode(i),i}export{o as jsx,o as jsxDEV,o as jsxs};
|
|
2
2
|
//# sourceMappingURL=jsxRuntime.module.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{options as r
|
|
1
|
+
import{options as r}from"../..";export{Fragment}from"../..";var _=0;function o(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return r.vnode&&r.vnode(i),i}export{o as jsx,o as jsxDEV,o as jsxs};
|
|
2
2
|
//# sourceMappingURL=jsxRuntime.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsxRuntime.module.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from '../..';\n\n/** @typedef {import('preact').VNode} VNode */\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {
|
|
1
|
+
{"version":3,"file":"jsxRuntime.module.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from '../..';\n\n/** @typedef {import('preact').VNode} VNode */\n\nlet vnodeId = 0;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = {},\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'ref') {\n\t\t\tref = props[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (typeof normalizedProps[i] === 'undefined') {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment\n};\n"],"names":["vnodeId","createVNode","type","props","key","isStaticChildren","__source","__self","ref","i","normalizedProps","vnode","__k","__","__b","__e","__d","undefined","__c","__h","constructor","__v","defaultProps","options"],"mappings":"8DAIA,IAAIA,EAAU,EAsBd,SAASC,EAAYC,EAAMC,EAAOC,EAAKC,EAAkBC,EAAUC,GAIlE,IACCC,EACAC,EAFGC,EAAkB,GAGtB,IAAKD,KAAKN,EACA,OAALM,EACHD,EAAML,EAAMM,GAEZC,EAAgBD,GAAKN,EAAMM,GAI7B,IAAME,EAAQ,CACbT,KAAAA,EACAC,MAAOO,EACPN,IAAAA,EACAI,IAAAA,EACAI,IAAW,KACXC,GAAS,KACTC,IAAQ,EACRC,IAAM,KACNC,SAAUC,EACVC,IAAY,KACZC,IAAY,KACZC,iBAAaH,EACbI,MAAarB,EACbM,SAAAA,EACAC,OAAAA,GAKD,GAAoB,mBAATL,IAAwBM,EAAMN,EAAKoB,cAC7C,IAAKb,KAAKD,OACyB,IAAvBE,EAAgBD,KAC1BC,EAAgBD,GAAKD,EAAIC,IAK5B,OADIc,EAAQZ,OAAOY,EAAQZ,MAAMA,GAC1BA,CACP"}
|
|
@@ -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.jsxRuntime={},e.preact)}(this,function(e,n){function
|
|
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).jsxRuntime={},e.preact)}(this,function(e,n){var o=0;function t(e,t,r,f,i,u){var _,l,c={};for(l in t)"ref"==l?_=t[l]:c[l]=t[l];var p={type:e,props:c,key:r,ref:_,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o,__source:i,__self:u};if("function"==typeof e&&(_=e.defaultProps))for(l in _)void 0===c[l]&&(c[l]=_[l]);return n.options.vnode&&n.options.vnode(p),p}Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return n.Fragment}}),e.jsx=t,e.jsxDEV=t,e.jsxs=t});
|
|
2
2
|
//# sourceMappingURL=jsxRuntime.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsxRuntime.umd.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from '../..';\n\n/** @typedef {import('preact').VNode} VNode */\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {
|
|
1
|
+
{"version":3,"file":"jsxRuntime.umd.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from '../..';\n\n/** @typedef {import('preact').VNode} VNode */\n\nlet vnodeId = 0;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = {},\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'ref') {\n\t\t\tref = props[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (typeof normalizedProps[i] === 'undefined') {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment\n};\n"],"names":["vnodeId","createVNode","type","props","key","isStaticChildren","__source","__self","ref","i","normalizedProps","vnode","__k","__","__b","__e","__d","undefined","__c","__h","constructor","__v","defaultProps","options"],"mappings":"0QAIA,IAAIA,EAAU,EAsBd,SAASC,EAAYC,EAAMC,EAAOC,EAAKC,EAAkBC,EAAUC,GAIlE,IACCC,EACAC,EAFGC,EAAkB,GAGtB,IAAKD,KAAKN,EACA,OAALM,EACHD,EAAML,EAAMM,GAEZC,EAAgBD,GAAKN,EAAMM,GAI7B,IAAME,EAAQ,CACbT,KAAAA,EACAC,MAAOO,EACPN,IAAAA,EACAI,IAAAA,EACAI,IAAW,KACXC,GAAS,KACTC,IAAQ,EACRC,IAAM,KACNC,SAAUC,EACVC,IAAY,KACZC,IAAY,KACZC,iBAAaH,EACbI,MAAarB,EACbM,SAAAA,EACAC,OAAAA,GAKD,GAAoB,mBAATL,IAAwBM,EAAMN,EAAKoB,cAC7C,IAAKb,KAAKD,OACyB,IAAvBE,EAAgBD,KAC1BC,EAAgBD,GAAKD,EAAIC,IAK5B,OADIc,EAAOA,QAACZ,OAAOY,EAAAA,QAAQZ,MAAMA,GAC1BA,CACP"}
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
"name": "jsx-runtime",
|
|
3
|
+
"amdName": "jsxRuntime",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "Preact JSX runtime",
|
|
7
|
+
"main": "dist/jsxRuntime.js",
|
|
8
|
+
"module": "dist/jsxRuntime.module.js",
|
|
9
|
+
"umd:main": "dist/jsxRuntime.umd.js",
|
|
10
|
+
"source": "src/index.js",
|
|
11
|
+
"types": "src/index.d.ts",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"preact": "^10.0.0"
|
|
15
|
+
},
|
|
16
|
+
"mangle": {
|
|
17
|
+
"regex": "^_"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./src/index.d.ts",
|
|
22
|
+
"browser": "./dist/jsxRuntime.module.js",
|
|
23
|
+
"umd": "./dist/jsxRuntime.umd.js",
|
|
24
|
+
"import": "./dist/jsxRuntime.mjs",
|
|
25
|
+
"require": "./dist/jsxRuntime.js"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
19
28
|
}
|
|
@@ -2,6 +2,8 @@ import { options, Fragment } from '../..';
|
|
|
2
2
|
|
|
3
3
|
/** @typedef {import('preact').VNode} VNode */
|
|
4
4
|
|
|
5
|
+
let vnodeId = 0;
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* @fileoverview
|
|
7
9
|
* This file exports various methods that implement Babel's "automatic" JSX runtime API:
|
|
@@ -18,16 +20,21 @@ import { options, Fragment } from '../..';
|
|
|
18
20
|
* @param {VNode['type']} type
|
|
19
21
|
* @param {VNode['props']} props
|
|
20
22
|
* @param {VNode['key']} [key]
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {
|
|
23
|
+
* @param {unknown} [isStaticChildren]
|
|
24
|
+
* @param {unknown} [__source]
|
|
25
|
+
* @param {unknown} [__self]
|
|
23
26
|
*/
|
|
24
|
-
function createVNode(type, props, key, __source, __self) {
|
|
27
|
+
function createVNode(type, props, key, isStaticChildren, __source, __self) {
|
|
25
28
|
// We'll want to preserve `ref` in props to get rid of the need for
|
|
26
29
|
// forwardRef components in the future, but that should happen via
|
|
27
30
|
// a separate PR.
|
|
28
|
-
let normalizedProps = {}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
let normalizedProps = {},
|
|
32
|
+
ref,
|
|
33
|
+
i;
|
|
34
|
+
for (i in props) {
|
|
35
|
+
if (i == 'ref') {
|
|
36
|
+
ref = props[i];
|
|
37
|
+
} else {
|
|
31
38
|
normalizedProps[i] = props[i];
|
|
32
39
|
}
|
|
33
40
|
}
|
|
@@ -36,7 +43,7 @@ function createVNode(type, props, key, __source, __self) {
|
|
|
36
43
|
type,
|
|
37
44
|
props: normalizedProps,
|
|
38
45
|
key,
|
|
39
|
-
ref
|
|
46
|
+
ref,
|
|
40
47
|
_children: null,
|
|
41
48
|
_parent: null,
|
|
42
49
|
_depth: 0,
|
|
@@ -45,18 +52,17 @@ function createVNode(type, props, key, __source, __self) {
|
|
|
45
52
|
_component: null,
|
|
46
53
|
_hydrating: null,
|
|
47
54
|
constructor: undefined,
|
|
48
|
-
_original:
|
|
55
|
+
_original: --vnodeId,
|
|
49
56
|
__source,
|
|
50
57
|
__self
|
|
51
58
|
};
|
|
52
59
|
|
|
53
60
|
// If a Component VNode, check for and apply defaultProps.
|
|
54
61
|
// Note: `type` is often a String, and can be `undefined` in development.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
normalizedProps[i] = defaults[i];
|
|
62
|
+
if (typeof type === 'function' && (ref = type.defaultProps)) {
|
|
63
|
+
for (i in ref)
|
|
64
|
+
if (typeof normalizedProps[i] === 'undefined') {
|
|
65
|
+
normalizedProps[i] = ref[i];
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
|