@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.
Files changed (113) hide show
  1. package/dist/index.esm.js +12 -64
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +12 -64
  4. package/dist/index.js.map +1 -1
  5. package/package.json +7 -7
  6. package/preact/README.md +56 -51
  7. package/preact/compat/client.js +19 -0
  8. package/preact/compat/client.mjs +22 -0
  9. package/preact/compat/dist/compat.js +1 -1
  10. package/preact/compat/dist/compat.js.map +1 -1
  11. package/preact/compat/dist/compat.mjs +1 -1
  12. package/preact/compat/dist/compat.module.js +1 -1
  13. package/preact/compat/dist/compat.module.js.map +1 -1
  14. package/preact/compat/dist/compat.umd.js +1 -1
  15. package/preact/compat/dist/compat.umd.js.map +1 -1
  16. package/preact/compat/jsx-dev-runtime.js +2 -0
  17. package/preact/compat/jsx-dev-runtime.mjs +2 -0
  18. package/preact/compat/jsx-runtime.js +2 -0
  19. package/preact/compat/jsx-runtime.mjs +2 -0
  20. package/preact/compat/package.json +31 -0
  21. package/preact/compat/scheduler.js +15 -0
  22. package/preact/compat/{src/scheduler.js → scheduler.mjs} +8 -9
  23. package/preact/compat/server.browser.js +4 -0
  24. package/preact/compat/src/PureComponent.js +1 -1
  25. package/preact/compat/src/forwardRef.js +2 -9
  26. package/preact/compat/src/index.d.ts +58 -4
  27. package/preact/compat/src/index.js +73 -2
  28. package/preact/compat/src/portals.js +4 -2
  29. package/preact/compat/src/render.js +133 -76
  30. package/preact/compat/src/suspense-list.d.ts +2 -2
  31. package/preact/compat/src/suspense-list.js +14 -13
  32. package/preact/compat/src/suspense.d.ts +4 -4
  33. package/preact/compat/src/suspense.js +6 -6
  34. package/preact/compat/src/util.js +10 -0
  35. package/preact/debug/dist/debug.js +1 -1
  36. package/preact/debug/dist/debug.js.map +1 -1
  37. package/preact/debug/dist/debug.mjs +1 -1
  38. package/preact/debug/dist/debug.module.js +1 -1
  39. package/preact/debug/dist/debug.module.js.map +1 -1
  40. package/preact/debug/dist/debug.umd.js +1 -1
  41. package/preact/debug/dist/debug.umd.js.map +1 -1
  42. package/preact/debug/package.json +9 -0
  43. package/preact/debug/src/check-props.js +3 -3
  44. package/preact/debug/src/debug.js +38 -17
  45. package/preact/debug/src/index.d.ts +4 -0
  46. package/preact/debug/src/util.js +4 -0
  47. package/preact/devtools/dist/devtools.js +1 -1
  48. package/preact/devtools/dist/devtools.js.map +1 -1
  49. package/preact/devtools/dist/devtools.mjs +1 -1
  50. package/preact/devtools/dist/devtools.module.js +1 -1
  51. package/preact/devtools/dist/devtools.module.js.map +1 -1
  52. package/preact/devtools/dist/devtools.umd.js +1 -1
  53. package/preact/devtools/dist/devtools.umd.js.map +1 -1
  54. package/preact/devtools/package.json +23 -14
  55. package/preact/devtools/src/devtools.js +1 -1
  56. package/preact/dist/preact.js +1 -1
  57. package/preact/dist/preact.js.map +1 -1
  58. package/preact/dist/preact.min.js +1 -1
  59. package/preact/dist/preact.min.js.map +1 -1
  60. package/preact/dist/preact.min.module.js +2 -0
  61. package/preact/dist/preact.min.module.js.map +1 -0
  62. package/preact/dist/preact.min.umd.js +2 -0
  63. package/preact/dist/preact.min.umd.js.map +1 -0
  64. package/preact/dist/preact.mjs +1 -1
  65. package/preact/dist/preact.module.js +1 -1
  66. package/preact/dist/preact.module.js.map +1 -1
  67. package/preact/dist/preact.umd.js +1 -1
  68. package/preact/dist/preact.umd.js.map +1 -1
  69. package/preact/hooks/dist/hooks.js +1 -1
  70. package/preact/hooks/dist/hooks.js.map +1 -1
  71. package/preact/hooks/dist/hooks.mjs +1 -1
  72. package/preact/hooks/dist/hooks.module.js +1 -1
  73. package/preact/hooks/dist/hooks.module.js.map +1 -1
  74. package/preact/hooks/dist/hooks.umd.js +1 -1
  75. package/preact/hooks/dist/hooks.umd.js.map +1 -1
  76. package/preact/hooks/package.json +9 -0
  77. package/preact/hooks/src/index.d.ts +26 -14
  78. package/preact/hooks/src/index.js +169 -44
  79. package/preact/hooks/src/internal.d.ts +12 -2
  80. package/preact/jsx-runtime/dist/jsxRuntime.js +1 -1
  81. package/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
  82. package/preact/jsx-runtime/dist/jsxRuntime.mjs +1 -1
  83. package/preact/jsx-runtime/dist/jsxRuntime.module.js +1 -1
  84. package/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
  85. package/preact/jsx-runtime/dist/jsxRuntime.umd.js +1 -1
  86. package/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
  87. package/preact/jsx-runtime/package.json +26 -17
  88. package/preact/jsx-runtime/src/index.js +19 -13
  89. package/preact/package.json +315 -262
  90. package/preact/src/clone-element.js +16 -10
  91. package/preact/src/component.js +33 -23
  92. package/preact/src/constants.js +2 -1
  93. package/preact/src/create-context.js +8 -3
  94. package/preact/src/create-element.js +9 -11
  95. package/preact/src/diff/catch-error.js +4 -2
  96. package/preact/src/diff/children.js +41 -32
  97. package/preact/src/diff/index.js +81 -34
  98. package/preact/src/diff/props.js +15 -14
  99. package/preact/src/index.d.ts +369 -301
  100. package/preact/src/internal.d.ts +11 -2
  101. package/preact/src/jsx.d.ts +1862 -626
  102. package/preact/src/options.js +1 -2
  103. package/preact/src/render.js +5 -6
  104. package/preact/src/util.js +6 -0
  105. package/preact/test-utils/dist/testUtils.js +1 -1
  106. package/preact/test-utils/dist/testUtils.js.map +1 -1
  107. package/preact/test-utils/dist/testUtils.mjs +1 -1
  108. package/preact/test-utils/dist/testUtils.module.js +1 -1
  109. package/preact/test-utils/dist/testUtils.module.js.map +1 -1
  110. package/preact/test-utils/dist/testUtils.umd.js +1 -1
  111. package/preact/test-utils/dist/testUtils.umd.js.map +1 -1
  112. package/preact/test-utils/package.json +9 -0
  113. 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 _(_,e,o,n,t){var l={};for(var u in e)"ref"!=u&&(l[u]=e[u]);var f,i,p={type:_,props:l,key:o,ref:e&&e.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++r.options.__v,__source:n,__self:t};if("function"==typeof _&&(f=_.defaultProps))for(i in f)void 0===l[i]&&(l[i]=f[i]);return r.options.vnode&&r.options.vnode(p),p}exports.Fragment=r.Fragment,exports.jsx=_,exports.jsxs=_,exports.jsxDEV=_;
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 {string} [__source]\n * @param {string} [__self]\n */\nfunction createVNode(type, props, key, __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\tfor (let i in props) {\n\t\tif (i != 'ref') {\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: props && props.ref,\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: ++options._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\tlet defaults, i;\n\tif (typeof type === 'function' && (defaults = type.defaultProps)) {\n\t\tfor (i in defaults)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = defaults[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":["createVNode","type","props","key","__source","__self","normalizedProps","i","defaults","vnode","ref","undefined","constructor","options","defaultProps"],"mappings":"wBAuBA,SAASA,EAAYC,EAAMC,EAAOC,EAAKC,EAAUC,OAI5CC,EAAkB,OACjB,IAAIC,KAAKL,EACJ,OAALK,IACHD,EAAgBC,GAAKL,EAAMK,QAwBzBC,EAAUD,EApBRE,EAAQ,CACbR,KAAAA,EACAC,MAAOI,EACPH,IAAAA,EACAO,IAAKR,GAASA,EAAMQ,QACT,QACF,SACD,MACF,cACIC,MACE,SACA,KACZC,iBAAaD,QACAE,cACbT,SAAAA,EACAC,OAAAA,MAMmB,mBAATJ,IAAwBO,EAAWP,EAAKa,kBAC7CP,KAAKC,OACkBG,IAAvBL,EAAgBC,KACnBD,EAAgBC,GAAKC,EAASD,WAI7BM,UAAQJ,OAAOI,UAAQJ,MAAMA,GAC1BA"}
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,Fragment as _}from"../..";export{Fragment}from"../..";function o(_,o,e,n,t){var f={};for(var l in o)"ref"!=l&&(f[l]=o[l]);var s,u,a={type:_,props:f,key:e,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++r.__v,__source:n,__self:t};if("function"==typeof _&&(s=_.defaultProps))for(u in s)void 0===f[u]&&(f[u]=s[u]);return r.vnode&&r.vnode(a),a}export{o as jsx,o as jsxs,o as jsxDEV};
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,Fragment as _}from"../..";export{Fragment}from"../..";function o(_,o,e,n,t){var f={};for(var l in o)"ref"!=l&&(f[l]=o[l]);var s,u,a={type:_,props:f,key:e,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++r.__v,__source:n,__self:t};if("function"==typeof _&&(s=_.defaultProps))for(u in s)void 0===f[u]&&(f[u]=s[u]);return r.vnode&&r.vnode(a),a}export{o as jsx,o as jsxs,o as jsxDEV};
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 {string} [__source]\n * @param {string} [__self]\n */\nfunction createVNode(type, props, key, __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\tfor (let i in props) {\n\t\tif (i != 'ref') {\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: props && props.ref,\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: ++options._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\tlet defaults, i;\n\tif (typeof type === 'function' && (defaults = type.defaultProps)) {\n\t\tfor (i in defaults)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = defaults[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":["createVNode","type","props","key","__source","__self","normalizedProps","i","defaults","vnode","ref","undefined","constructor","options","defaultProps"],"mappings":"4EAuBA,SAASA,EAAYC,EAAMC,EAAOC,EAAKC,EAAUC,OAI5CC,EAAkB,OACjB,IAAIC,KAAKL,EACJ,OAALK,IACHD,EAAgBC,GAAKL,EAAMK,QAwBzBC,EAAUD,EApBRE,EAAQ,CACbR,KAAAA,EACAC,MAAOI,EACPH,IAAAA,EACAO,IAAKR,GAASA,EAAMQ,QACT,QACF,SACD,MACF,cACIC,MACE,SACA,KACZC,iBAAaD,QACAE,MACbT,SAAAA,EACAC,OAAAA,MAMmB,mBAATJ,IAAwBO,EAAWP,EAAKa,kBAC7CP,KAAKC,OACkBG,IAAvBL,EAAgBC,KACnBD,EAAgBC,GAAKC,EAASD,WAI7BM,EAAQJ,OAAOI,EAAQJ,MAAMA,GAC1BA"}
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 o(e,o,r,t,_){var f={};for(var i in o)"ref"!=i&&(f[i]=o[i]);var u,c,l={type:e,props:f,key:r,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++n.options.__v,__source:t,__self:_};if("function"==typeof e&&(u=e.defaultProps))for(c in u)void 0===f[c]&&(f[c]=u[c]);return n.options.vnode&&n.options.vnode(l),l}e.Fragment=n.Fragment,e.jsx=o,e.jsxs=o,e.jsxDEV=o});
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 {string} [__source]\n * @param {string} [__self]\n */\nfunction createVNode(type, props, key, __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\tfor (let i in props) {\n\t\tif (i != 'ref') {\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: props && props.ref,\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: ++options._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\tlet defaults, i;\n\tif (typeof type === 'function' && (defaults = type.defaultProps)) {\n\t\tfor (i in defaults)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = defaults[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":["createVNode","type","props","key","__source","__self","normalizedProps","i","defaults","vnode","ref","undefined","constructor","options","defaultProps"],"mappings":"sNAuBA,SAASA,EAAYC,EAAMC,EAAOC,EAAKC,EAAUC,OAI5CC,EAAkB,OACjB,IAAIC,KAAKL,EACJ,OAALK,IACHD,EAAgBC,GAAKL,EAAMK,QAwBzBC,EAAUD,EApBRE,EAAQ,CACbR,KAAAA,EACAC,MAAOI,EACPH,IAAAA,EACAO,IAAKR,GAASA,EAAMQ,QACT,QACF,SACD,MACF,cACIC,MACE,SACA,KACZC,iBAAaD,QACAE,cACbT,SAAAA,EACAC,OAAAA,MAMmB,mBAATJ,IAAwBO,EAAWP,EAAKa,kBAC7CP,KAAKC,OACkBG,IAAvBL,EAAgBC,KACnBD,EAAgBC,GAAKC,EAASD,WAI7BM,UAAQJ,OAAOI,UAAQJ,MAAMA,GAC1BA"}
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
- "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
- }
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 {string} [__source]
22
- * @param {string} [__self]
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
- for (let i in props) {
30
- if (i != 'ref') {
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: props && props.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: ++options._vnodeId,
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
- let defaults, i;
56
- if (typeof type === 'function' && (defaults = type.defaultProps)) {
57
- for (i in defaults)
58
- if (normalizedProps[i] === undefined) {
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