@kunpeng-js/properties-panel 2026.0.0-alpha2 → 2026.10.2

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 (127) hide show
  1. package/LICENSE +9 -2
  2. package/dist/index.esm.js +3760 -3762
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +3724 -3804
  5. package/dist/index.js.map +1 -1
  6. package/package.json +22 -48
  7. package/preact/README.md +5 -5
  8. package/preact/compat/client.d.ts +1 -3
  9. package/preact/compat/dist/compat.mjs +2 -2
  10. package/preact/compat/dist/compat.mjs.map +1 -0
  11. package/preact/compat/package.json +2 -41
  12. package/preact/compat/scheduler.d.ts +12 -0
  13. package/preact/compat/server.d.ts +17 -0
  14. package/preact/compat/src/Children.js +3 -3
  15. package/preact/compat/src/PureComponent.js +20 -12
  16. package/preact/compat/src/forwardRef.js +4 -17
  17. package/preact/compat/src/hooks.js +17 -51
  18. package/preact/compat/src/index.d.ts +249 -164
  19. package/preact/compat/src/index.js +52 -43
  20. package/preact/compat/src/internal.d.ts +1 -2
  21. package/preact/compat/src/memo.js +2 -2
  22. package/preact/compat/src/portals.js +2 -68
  23. package/preact/compat/src/render.js +182 -73
  24. package/preact/compat/src/suspense.d.ts +1 -3
  25. package/preact/compat/src/suspense.js +169 -179
  26. package/preact/compat/src/util.js +5 -22
  27. package/preact/debug/dist/debug.mjs +2 -2
  28. package/preact/debug/dist/debug.mjs.map +1 -0
  29. package/preact/debug/package.json +3 -14
  30. package/preact/debug/src/check-props.js +2 -6
  31. package/preact/debug/src/component-stack.js +67 -16
  32. package/preact/debug/src/debug.js +80 -35
  33. package/preact/debug/src/index.d.ts +11 -1
  34. package/preact/debug/src/index.js +3 -1
  35. package/preact/debug/src/util.js +1 -11
  36. package/preact/devtools/dist/devtools.mjs +2 -2
  37. package/preact/devtools/dist/devtools.mjs.map +1 -0
  38. package/preact/devtools/package.json +3 -15
  39. package/preact/devtools/src/devtools.js +1 -1
  40. package/preact/dist/preact.mjs +2 -2
  41. package/preact/dist/preact.mjs.map +1 -0
  42. package/preact/hooks/dist/hooks.mjs +2 -2
  43. package/preact/hooks/dist/hooks.mjs.map +1 -0
  44. package/preact/hooks/package.json +5 -24
  45. package/preact/hooks/src/index.d.ts +6 -13
  46. package/preact/hooks/src/index.js +95 -73
  47. package/preact/hooks/src/internal.d.ts +8 -3
  48. package/preact/jsx-runtime/dist/jsxRuntime.mjs +2 -2
  49. package/preact/jsx-runtime/dist/jsxRuntime.mjs.map +1 -0
  50. package/preact/jsx-runtime/package.json +4 -16
  51. package/preact/jsx-runtime/src/index.d.ts +11 -11
  52. package/preact/jsx-runtime/src/index.js +25 -40
  53. package/preact/jsx-runtime/src/utils.js +3 -3
  54. package/preact/package.json +59 -115
  55. package/preact/src/component.js +54 -47
  56. package/preact/src/constants.js +17 -2
  57. package/preact/src/create-context.js +4 -14
  58. package/preact/src/create-element.js +42 -17
  59. package/preact/src/create-portal.js +20 -0
  60. package/preact/src/diff/catch-error.js +26 -8
  61. package/preact/src/diff/children.js +158 -96
  62. package/preact/src/diff/index.js +265 -146
  63. package/preact/src/diff/props.js +39 -50
  64. package/preact/src/dom.d.ts +796 -147
  65. package/preact/src/index.d.ts +7 -18
  66. package/preact/src/index.js +2 -1
  67. package/preact/src/internal.d.ts +16 -24
  68. package/preact/src/jsx.d.ts +222 -2910
  69. package/preact/src/render.js +30 -34
  70. package/preact/src/util.js +5 -20
  71. package/preact/test-utils/dist/testUtils.mjs +1 -1
  72. package/preact/test-utils/dist/testUtils.mjs.map +1 -0
  73. package/preact/test-utils/package.json +5 -17
  74. package/README.md +0 -35
  75. package/preact/compat/dist/compat.js +0 -2
  76. package/preact/compat/dist/compat.js.map +0 -1
  77. package/preact/compat/dist/compat.module.js +0 -2
  78. package/preact/compat/dist/compat.module.js.map +0 -1
  79. package/preact/compat/dist/compat.umd.js +0 -2
  80. package/preact/compat/dist/compat.umd.js.map +0 -1
  81. package/preact/compat/src/suspense-list.d.ts +0 -16
  82. package/preact/compat/src/suspense-list.js +0 -127
  83. package/preact/debug/dist/debug.js +0 -2
  84. package/preact/debug/dist/debug.js.map +0 -1
  85. package/preact/debug/dist/debug.module.js +0 -2
  86. package/preact/debug/dist/debug.module.js.map +0 -1
  87. package/preact/debug/dist/debug.umd.js +0 -2
  88. package/preact/debug/dist/debug.umd.js.map +0 -1
  89. package/preact/devtools/dist/devtools.js +0 -2
  90. package/preact/devtools/dist/devtools.js.map +0 -1
  91. package/preact/devtools/dist/devtools.module.js +0 -2
  92. package/preact/devtools/dist/devtools.module.js.map +0 -1
  93. package/preact/devtools/dist/devtools.umd.js +0 -2
  94. package/preact/devtools/dist/devtools.umd.js.map +0 -1
  95. package/preact/dist/preact.js +0 -2
  96. package/preact/dist/preact.js.map +0 -1
  97. package/preact/dist/preact.min.js +0 -2
  98. package/preact/dist/preact.min.js.map +0 -1
  99. package/preact/dist/preact.min.module.js +0 -2
  100. package/preact/dist/preact.min.module.js.map +0 -1
  101. package/preact/dist/preact.min.umd.js +0 -2
  102. package/preact/dist/preact.min.umd.js.map +0 -1
  103. package/preact/dist/preact.module.js +0 -2
  104. package/preact/dist/preact.module.js.map +0 -1
  105. package/preact/dist/preact.umd.js +0 -2
  106. package/preact/dist/preact.umd.js.map +0 -1
  107. package/preact/hooks/dist/hooks.js +0 -2
  108. package/preact/hooks/dist/hooks.js.map +0 -1
  109. package/preact/hooks/dist/hooks.module.js +0 -2
  110. package/preact/hooks/dist/hooks.module.js.map +0 -1
  111. package/preact/hooks/dist/hooks.umd.js +0 -2
  112. package/preact/hooks/dist/hooks.umd.js.map +0 -1
  113. package/preact/jsx-runtime/dist/jsxRuntime.js +0 -2
  114. package/preact/jsx-runtime/dist/jsxRuntime.js.map +0 -1
  115. package/preact/jsx-runtime/dist/jsxRuntime.module.js +0 -2
  116. package/preact/jsx-runtime/dist/jsxRuntime.module.js.map +0 -1
  117. package/preact/jsx-runtime/dist/jsxRuntime.umd.js +0 -2
  118. package/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +0 -1
  119. package/preact/src/cjs.js +0 -3
  120. package/preact/src/clone-element.js +0 -48
  121. package/preact/src/index-5.d.ts +0 -399
  122. package/preact/test-utils/dist/testUtils.js +0 -2
  123. package/preact/test-utils/dist/testUtils.js.map +0 -1
  124. package/preact/test-utils/dist/testUtils.module.js +0 -2
  125. package/preact/test-utils/dist/testUtils.module.js.map +0 -1
  126. package/preact/test-utils/dist/testUtils.umd.js +0 -2
  127. package/preact/test-utils/dist/testUtils.umd.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kunpeng-js/properties-panel",
3
- "version": "2026.0.0-alpha2",
3
+ "version": "2026.10.2",
4
4
  "description": "Library for creating bpmn-io properties panels.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -11,24 +11,16 @@
11
11
  },
12
12
  "./assets/*": "./assets/*",
13
13
  "./preact": {
14
- "browser": "./preact/dist/preact.module.js",
15
- "import": "./preact/dist/preact.mjs",
16
- "require": "./preact/dist/preact.js"
14
+ "default": "./preact/dist/preact.mjs"
17
15
  },
18
16
  "./preact/hooks": {
19
- "browser": "./preact/hooks/dist/hooks.module.js",
20
- "import": "./preact/hooks/dist/hooks.mjs",
21
- "require": "./preact/hooks/dist/hooks.js"
17
+ "default": "./preact/hooks/dist/hooks.mjs"
22
18
  },
23
19
  "./preact/compat": {
24
- "browser": "./preact/compat/dist/compat.module.js",
25
- "import": "./preact/compat/dist/compat.mjs",
26
- "require": "./preact/compat/dist/compat.js"
20
+ "default": "./preact/compat/dist/compat.mjs"
27
21
  },
28
22
  "./preact/jsx-runtime": {
29
- "browser": "./preact/jsx-runtime/dist/jsxRuntime.module.js",
30
- "import": "./preact/jsx-runtime/dist/jsxRuntime.mjs",
31
- "require": "./preact/jsx-runtime/dist/jsxRuntime.js"
23
+ "default": "./preact/jsx-runtime/dist/jsxRuntime.mjs"
32
24
  },
33
25
  "./preact/jsx-dev-runtime": {
34
26
  "browser": "./preact/compat/jsx-dev-runtime.mjs",
@@ -45,10 +37,12 @@
45
37
  ],
46
38
  "repository": {
47
39
  "type": "git",
48
- "url": "git+https://github.com/bpmn-io/properties-panel.git"
40
+ "url": "git+https://github.com/anyilanxin/kunpeng-bpm.git",
41
+ "directory": "packages/common/properties-panel"
49
42
  },
50
43
  "publishConfig": {
51
- "access": "public"
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org/"
52
46
  },
53
47
  "engines": {
54
48
  "node": "*"
@@ -62,55 +56,35 @@
62
56
  ],
63
57
  "license": "MIT",
64
58
  "dependencies": {
65
- "@carbon/icons": "^11.88.0",
59
+ "@carbon/icons": "^11.90.0",
66
60
  "@codemirror/autocomplete": "^6.20.3",
67
61
  "@codemirror/commands": "^6.11.1",
68
62
  "@codemirror/lang-json": "^6.0.2",
69
- "@codemirror/language": "^6.12.4",
63
+ "@codemirror/language": "^6.13.1",
70
64
  "@codemirror/lint": "^6.9.7",
71
- "@codemirror/state": "^6.7.5",
72
- "@codemirror/view": "^6.43.12",
65
+ "@codemirror/state": "^6.7.6",
66
+ "@codemirror/view": "^6.43.14",
73
67
  "classnames": "^2.5.1",
74
- "focus-trap": "^7.8.0",
68
+ "focus-trap": "^8.2.3",
75
69
  "min-dash": "^5.1.0",
76
70
  "min-dom": "^5.3.0",
77
- "@kunpeng-js/expression-editor": "2.6.1"
71
+ "@kunpeng-js/expression-editor": "2026.10.2"
78
72
  },
79
73
  "devDependencies": {
74
+ "preact": "^11.0.1",
75
+ "vite": "^7.3.7",
76
+ "vite-plugin-babel": "^1.7.3",
80
77
  "@babel/plugin-transform-react-jsx": "^7.29.7",
81
- "@testing-library/preact": "^3.2.4",
82
- "axe-core": "^4.13.0",
83
78
  "babel-plugin-inline-react-svg": "^2.0.2",
84
79
  "babel-plugin-module-resolver": "^5.0.3",
85
- "chai": "^6.2.2",
86
- "cross-env": "^7.0.3",
87
- "diagram-js": "^15.26.0",
88
- "eslint": "^9.39.5",
89
- "eslint-plugin-bpmn-io": "^2.4.0",
90
- "eslint-plugin-import": "^2.32.0",
91
- "eslint-plugin-react-hooks": "^7.1.1",
92
- "fs-extra": "^11.4.0",
93
- "happy-dom": "^17.6.3",
94
- "mocha-test-container-support": "^0.2.0",
95
- "npm-run-all2": "^9.0.3",
96
- "preact": "^10.29.8",
97
- "replace-in-file": "^7.2.0",
80
+ "replace-in-file": "^9.0.0",
81
+ "fs-extra": "^11.4.1",
98
82
  "rimraf": "^6.1.3",
99
- "sinon": "^22.1.0",
100
- "sinon-chai": "^4.0.1",
101
- "vite": "^8.3.0",
102
- "vite-plugin-babel": "^1.7.3",
103
- "vitest": "^3.2.7"
83
+ "@babel/core": "^7.29.7"
104
84
  },
105
85
  "types": "./dist/index.d.ts",
106
86
  "scripts": {
107
- "all": "run-s lint clean build test",
108
- "clean": "rimraf preact dist",
109
87
  "build": "vite build",
110
- "lib": "vite build",
111
- "build:watch": "vite build --watch",
112
- "lint": "eslint .",
113
- "dev": "vitest --watch",
114
- "test": "vitest run"
88
+ "clean": "rimraf dist preact"
115
89
  }
116
90
  }
package/preact/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  </a>
7
7
  </p>
8
- <p align="center">Fast <b>3kB</b> alternative to React with the same modern API.</p>
8
+ <p align="center">Fast <b>4kB</b> alternative to React with the same modern API.</p>
9
9
 
10
10
  **All the power of Virtual DOM components, without the overhead:**
11
11
 
@@ -13,7 +13,7 @@
13
13
  - Extensive React compatibility via a simple [preact/compat] alias
14
14
  - Everything you need: JSX, <abbr title="Virtual DOM">VDOM</abbr>, [DevTools], <abbr title="Hot Module Replacement">HMR</abbr>, <abbr title="Server-Side Rendering">SSR</abbr>.
15
15
  - Highly optimized diff algorithm and seamless hydration from Server Side Rendering
16
- - Supports all modern browsers and IE11
16
+ - Supports all modern browsers
17
17
  - Transparent asynchronous rendering with a pluggable scheduler
18
18
 
19
19
  ### 💁 More information at the [Preact Website ➞](https://preactjs.com)
@@ -29,8 +29,8 @@
29
29
  [![OpenCollective Sponsors](https://opencollective.com/preact/sponsors/badge.svg)](#sponsors)
30
30
 
31
31
  [![coveralls](https://img.shields.io/coveralls/preactjs/preact/main.svg)](https://coveralls.io/github/preactjs/preact)
32
- [![gzip size](https://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=gzip&label=gzip)](https://unpkg.com/preact/dist/preact.min.js)
33
- [![brotli size](https://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=brotli&label=brotli)](https://unpkg.com/preact/dist/preact.min.js)
32
+ [![gzip size](https://img.badgesize.io/https://unpkg.com/preact/dist/preact.mjs?compression=gzip&label=gzip)](https://unpkg.com/preact/dist/preact.mjs)
33
+ [![brotli size](https://img.badgesize.io/https://unpkg.com/preact/dist/preact.mjs?compression=brotli&label=brotli)](https://unpkg.com/preact/dist/preact.mjs)
34
34
 
35
35
  </td>
36
36
  </tr>
@@ -47,7 +47,7 @@ You can find some awesome libraries in the [awesome-preact list](https://github.
47
47
 
48
48
  #### Tutorial: Building UI with Preact
49
49
 
50
- With Preact, you create user interfaces by assembling trees of components and elements. Components are functions or classes that return a description of what their tree should output. These descriptions are typically written in [JSX](https://facebook.github.io/jsx/) (shown underneath), or [HTM](https://github.com/developit/htm) which leverages standard JavaScript Tagged Templates. Both syntaxes can express trees of elements with "props" (similar to HTML attributes) and children.
50
+ With Preact, you create user interfaces by assembling trees of components and elements. Components are functions or classes that return a description of what their tree should output. These descriptions are typically written in [JSX](https://react.dev/learn/writing-markup-with-jsx) (shown underneath), or [HTM](https://github.com/developit/htm) which leverages standard JavaScript Tagged Templates. Both syntaxes can express trees of elements with "props" (similar to HTML attributes) and children.
51
51
 
52
52
  To get started using Preact, first look at the render() function. This function accepts a tree description and creates the structure described. Next, it appends this structure to a parent DOM element provided as the second argument. Future calls to render() will reuse the existing tree and update it in-place in the DOM. Internally, render() will calculate the difference from previous outputted structures in an attempt to perform as few DOM operations as possible.
53
53
 
@@ -1,6 +1,4 @@
1
- // Intentionally not using a relative path to take advantage of
2
- // the TS version resolution mechanism
3
- import * as preact from 'preact';
1
+ import * as preact from '../src/index';
4
2
 
5
3
  export function createRoot(container: preact.ContainerNode): {
6
4
  render(children: preact.ComponentChild): void;
@@ -1,2 +1,2 @@
1
- import{Component as n,createElement as t,options as e,toChildArray as r,Fragment as u,render as o,hydrate as i,createContext as l,createRef as f,cloneElement as a}from"../..";export{Component,Fragment,Fragment as StrictMode,createContext,createElement,createRef}from"../..";import{useState as c,useLayoutEffect as s,useEffect as h,useCallback as v,useContext as d,useDebugValue as m,useId as p,useImperativeHandle as y,useMemo as _,useReducer as b,useRef as S}from"../../hooks";export*from"../../hooks";function g(n,t){for(var e in t)n[e]=t[e];return n}function E(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return!0;return!1}function C(n,t){var e=t(),r=c({t:{__:e,u:t}}),u=r[0].t,o=r[1];return s(function(){u.__=e,u.u=t,R(u)&&o({t:u})},[n,e,t]),h(function(){return R(u)&&o({t:u}),n(function(){R(u)&&o({t:u})})},[n]),e}function R(n){try{return!((t=n.__)===(e=n.u())&&(0!==t||1/t==1/e)||t!=t&&e!=e)}catch(n){return!0}var t,e}function x(n){n()}function w(n){return n}function k(){return[!1,x]}var I=s;function M(n,t){this.props=n,this.context=t}function N(n,e){function r(n){var t=this.props.ref;return t!=n.ref&&t&&("function"==typeof t?t(null):t.current=null),e?!e(this.props,n)||t!=n.ref:E(this.props,n)}function u(e){return this.shouldComponentUpdate=r,t(n,e)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.__f=u.prototype.isReactComponent=!0,u.type=n,u}(M.prototype=new n).isPureReactComponent=!0,M.prototype.shouldComponentUpdate=function(n,t){return E(this.props,n)||E(this.state,t)};var T=e.__b;e.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),T&&T(n)};var A="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function D(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=A,t.render=n,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var F=function(n,t){return null==n?null:r(r(n).map(t))},L={map:F,forEach:F,count:function(n){return n?r(n).length:0},only:function(n){var t=r(n);if(1!==t.length)throw"Children.only";return t[0]},toArray:r},O=e.__e;e.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k||[]),u.__c(n,t);O(n,t,e,r)};var U=e.unmount;function V(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return V(n,t,e)})),n}function W(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return W(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n}function P(){this.__u=0,this.o=null,this.__b=null}function j(n){var t=n.__&&n.__.__c;return t&&t.__a&&t.__a(n)}function z(n){var e,r,u,o=null;function i(i){if(e||(e=n()).then(function(n){n&&(o=n.default||n),u=!0},function(n){r=n,u=!0}),r)throw r;if(!u)throw e;return o?t(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function B(){this.i=null,this.l=null}e.unmount=function(n){var t=n.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),U&&U(n)},(P.prototype=new n).__c=function(n,t){var e=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(e);var u=j(r.__v),o=!1,i=function(){o||r.__z||(o=!0,e.__R=null,u?u(f):f())};e.__R=i;var l=e.__P;e.__P=null;var f=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=W(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=l,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},P.prototype.componentWillUnmount=function(){this.o=[]},P.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=V(this.__b,r,o.__O=o.__P)}this.__b=null}var i=e.__a&&t(u,null,n.fallback);return i&&(i.__u&=-33),[t(u,null,e.__a?null:n.children),i]};var H=function(n,t,e){if(++e[1]===e[0]&&n.l.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.l.size))for(e=n.i;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.i=e=e[2]}};function Z(n){return this.getChildContext=function(){return n.context},n.children}function Y(n){var e=this,r=n.h;if(e.componentWillUnmount=function(){o(null,e.v),e.v=null,e.h=null},e.h&&e.h!==r&&e.componentWillUnmount(),!e.v){for(var u=e.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;e.h=r,e.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:u.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(n,t){this.childNodes.push(n),e.h.insertBefore(n,t)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.h.removeChild(n)}}}o(t(Z,{context:e.context},n.__v),e.v)}function $(n,e){var r=t(Y,{__v:n,h:e});return r.containerInfo=e,r}(B.prototype=new n).__a=function(n){var t=this,e=j(t.__v),r=t.l.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),H(t,n,r)):u()};e?e(o):o()}},B.prototype.render=function(n){this.i=null,this.l=new Map;var t=r(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return n.children},B.prototype.componentDidUpdate=B.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(t,e){H(n,e,t)})};var q="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,G=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,J=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,K=/[A-Z0-9]/g,Q="undefined"!=typeof document,X=function(n){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};function nn(n,t,e){return null==t.__k&&(t.textContent=""),o(n,t),"function"==typeof e&&e(),n?n.__c:null}function tn(n,t,e){return i(n,t),"function"==typeof e&&e(),n?n.__c:null}n.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(n.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var en=e.event;e.event=function(n){return en&&(n=en(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var rn,un={configurable:!0,get:function(){return this.class}},on=e.vnode;e.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={},o=-1==e.indexOf("-");for(var i in t){var l=t[i];if(!("value"===i&&"defaultValue"in t&&null==l||Q&&"children"===i&&"noscript"===e||"class"===i||"className"===i)){var f=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===l?l="":"translate"===f&&"no"===l?l=!1:"o"===f[0]&&"n"===f[1]?"ondoubleclick"===f?i="ondblclick":"onchange"!==f||"input"!==e&&"textarea"!==e||X(t.type)?"onfocus"===f?i="onfocusin":"onblur"===f?i="onfocusout":J.test(i)&&(i=f):f=i="oninput":o&&G.test(i)?i=i.replace(K,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===f&&u[i=f]&&(i="oninputCapture"),u[i]=l}}"select"==e&&(u.multiple&&Array.isArray(u.value)&&(u.value=r(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),null!=u.defaultValue&&(u.value=r(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value}))),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",un)):t.className&&(u.class=u.className=t.className),n.props=u}(n),n.$$typeof=q,on&&on(n)};var ln=e.__r;e.__r=function(n){ln&&ln(n),rn=n.__c};var fn=e.diffed;e.diffed=function(n){fn&&fn(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value),rn=null};var an={ReactCurrentDispatcher:{current:{readContext:function(n){return rn.__n[n.__c].props.value},useCallback:v,useContext:d,useDebugValue:m,useDeferredValue:w,useEffect:h,useId:p,useImperativeHandle:y,useInsertionEffect:I,useLayoutEffect:s,useMemo:_,useReducer:b,useRef:S,useState:c,useSyncExternalStore:C,useTransition:k}}},cn="18.3.1";function sn(n){return t.bind(null,n)}function hn(n){return!!n&&n.$$typeof===q}function vn(n){return hn(n)&&n.type===u}function dn(n){return!!n&&"string"==typeof n.displayName&&0==n.displayName.indexOf("Memo(")}function mn(n){return hn(n)?a.apply(null,arguments):n}function pn(n){return!!n.__k&&(o(null,n),!0)}function yn(n){return n&&(n.base||1===n.nodeType&&n)||null}var _n=function(n,t){return n(t)},bn=function(n,t){var r,u=e.debounceRendering;e.debounceRendering=function(n){r=n};try{var o=n(t);return r&&r(),o}finally{e.debounceRendering=u}},Sn=hn,gn={useState:c,useId:p,useReducer:b,useEffect:h,useLayoutEffect:s,useInsertionEffect:I,useTransition:k,useDeferredValue:w,useSyncExternalStore:C,startTransition:x,useRef:S,useImperativeHandle:y,useMemo:_,useCallback:v,useContext:d,useDebugValue:m,version:"18.3.1",Children:L,render:nn,hydrate:tn,unmountComponentAtNode:pn,createPortal:$,createElement:t,createContext:l,createFactory:sn,cloneElement:mn,createRef:f,Fragment:u,isValidElement:hn,isElement:Sn,isFragment:vn,isMemo:dn,findDOMNode:yn,Component:n,PureComponent:M,memo:N,forwardRef:D,flushSync:bn,unstable_batchedUpdates:_n,StrictMode:u,Suspense:P,SuspenseList:B,lazy:z,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:an};export{L as Children,M as PureComponent,P as Suspense,B as SuspenseList,an as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,mn as cloneElement,sn as createFactory,$ as createPortal,gn as default,yn as findDOMNode,bn as flushSync,D as forwardRef,tn as hydrate,Sn as isElement,vn as isFragment,dn as isMemo,hn as isValidElement,z as lazy,N as memo,nn as render,x as startTransition,pn as unmountComponentAtNode,_n as unstable_batchedUpdates,w as useDeferredValue,I as useInsertionEffect,C as useSyncExternalStore,k as useTransition,cn as version};
2
- //# sourceMappingURL=compat.module.js.map
1
+ import{toChildArray as n,Component as t,createElement as e,createPortal as r,options as u,hydrate as i,render as o,Fragment as f,createRef as c,createContext as a,cloneElement as l}from"../..";export{Component,Fragment,Fragment as StrictMode,createContext,createElement,createRef}from"../..";import{useLayoutEffect as s,useRef as v,useState as h,useReducer as d,useMemo as p,useImperativeHandle as m,useId as y,useEffect as _,useDebugValue as b,useContext as g,useCallback as E}from"../../hooks";export*from"../../hooks";var S=function(t,e,r){return null==t?null:n(n(t).map(e.bind(r)))},C={map:S,forEach:S,count:function(t){return t?n(t).length:0},only:function(t){var e=n(t);if(1!=e.length)throw"Children.only";return e[0]},toArray:n},w=Object.assign;function R(n,t){for(var e in n)if("__source"!=e&&n[e]!==t[e])return!0;for(var r in t)if("__source"!=r&&!(r in n))return!0;return!1}var x=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/;function O(){function n(n,t){this.props=n,this.context=t}return(n.prototype=new t).isPureReactComponent=!0,n.prototype.shouldComponentUpdate=function(n,t){return R(this.props,n)||R(this.state,t)},n}var I=/* @__PURE__ */O(),j=Symbol.for("react.forward_ref");function k(n){function t(t){var e=w({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=j,t.render=n,t.prototype.isReactComponent=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}function M(n){n()}function D(n){return n}function F(){return[!1,M]}var L=s;function N(n){var t=v(n);return t.current=n,function(){return t.current.apply(void 0,arguments)}}function A(n,t){function r(n){var e=this.props.ref;return e!=n.ref&&e&&("function"==typeof e?e(null):e.current=null),t?!t(this.props,n)||e!=n.ref:R(this.props,n)}function u(t){return this.shouldComponentUpdate=r,e(n,t)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.type=n,u}function U(n,t){var e=r(n,t);return e.containerInfo=t,e}var V,T,W,P=Symbol.for("react.element"),$=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,z=/[A-Z0-9]/g,H=typeof document<"u",Z=/* @__PURE__ */X(function(n,t,e){var r=u.__s||T?(e||t)():t(),i=h({t:{__:r,u:t}}),o=i[0].t,f=i[1];return s(function(){o.__=r,o.u=t,B(o)&&f({t:o})},[n,r,t]),_(function(){return B(o)&&f({t:o}),n(function(){B(o)&&f({t:o})})},[n]),r});function B(n){try{return!Object.is(n.__,n.u())}catch(n){return!0}}var Y=function(n){return/fil|che|rad/.test(n)};function q(n,t,e){return null==t.__k&&(t.textContent=""),o(n,t),"function"==typeof e&&e(),n?n.__c:null}function G(n,t,e){return i(n,t),"function"==typeof e&&e(),n?n.__c:null}t.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(t.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})});var J=u.event;u.event=function(n){return J&&(n=J(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var K={configurable:!0,get:function(){return this.class}},Q=u.vnode;function X(n){if(!W){W=!0;var t=u.__r;u.__r=function(n){t&&t(n),32&n.__u&&(T=n),V=n.__c};var e=u.diffed;u.diffed=function(n){e&&e(n),V=null,T==n&&(T=null)}}return n}u.vnode=function(t){if("string"==typeof t.type)!function(t){var e=t.props,r=t.type,u={},i=-1==r.indexOf("-");for(var o in e){var f=e[o];if(!("value"==o&&"defaultValue"in e&&null==f||H&&"children"==o&&"noscript"==r||"class"==o||"className"==o)){if("style"==o&&"object"==typeof f){var c=void 0;for(var a in f)"number"!=typeof f[a]||x.test(a)||(c||(c=f=w({},f)),f[a]+="px")}else if("defaultValue"==o&&"value"in e&&null==e.value)o="value";else if("download"==o&&!0===f)f="";else if("translate"==o&&"no"===f)f=!1;else if("o"==o[0]&&"n"==o[1]){var l=o.toLowerCase();"ondoubleclick"==l?o="ondblclick":"onchange"!=l||"input"!=r&&"textarea"!=r||Y(e.type)?"onfocus"==l?o="onfocusin":"onblur"==l&&(o="onfocusout"):l=o="oninput","oninput"==l&&u[o=l]&&(o="oninputCapture")}else i&&$.test(o)?o=o.replace(z,"-$&").toLowerCase():null===f&&(f=void 0);u[o]=f}}"select"==r&&(u.multiple&&Array.isArray(u.value)&&(u.value=n(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),null!=u.defaultValue&&(u.value=n(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value}))),e.class&&!e.className?(u.class=e.class,Object.defineProperty(u,"className",K)):e.className&&(u.class=u.className=e.className),t.props=u}(t);else if("function"==typeof t.type&&("ref"in t.props&&"prototype"in t.type&&t.type.prototype.render&&(t.ref=t.props.ref,delete t.props.ref),t.type.defaultProps)){var e=w({},t.props);for(var r in t.type.defaultProps)void 0===e[r]&&(e[r]=t.type.defaultProps[r]);t.props=e}t.ref&&!("ref"in t.props)&&Object.defineProperty(t.props,"ref",{value:t.ref,configurable:!0,writable:!0}),t.$$typeof=P,Q&&Q(t)};var nn=/* @__PURE__ */X(function(n){if(n.then){if("fulfilled"==n.status)return n.value;if("rejected"==n.status)throw n.reason;throw n.status||(n.status="pending",n.then(function(t){n.status="fulfilled",n.value=t},function(t){n.status="rejected",n.reason=t})),n}var t=n.__c,e=V.__n[t];return e?(V[t]||(V[t]=!0,e.sub(V)),e.props.value):n.__}),tn={ReactCurrentDispatcher:{current:{readContext:nn,useCallback:E,useContext:g,useDebugValue:b,useDeferredValue:D,useEffect:_,useId:y,useImperativeHandle:m,useInsertionEffect:L,useLayoutEffect:s,useMemo:p,useReducer:d,useRef:v,useState:h,useSyncExternalStore:Z,useTransition:F}}};function en(n,t,e){if(n){var r=n.__c&&n.__c.__H;r&&(r.__.forEach(function(n){null!=n.__P&&("function"==typeof n.__c&&n.__c(),n.__c=n.__H=void 0)}),r.__h=n.__c.__h=[]),"string"==typeof n.type&&(n.__u|=8),null!=(n=w({constructor:void 0},n)).__c&&(n.__c.__P==e&&(n.__c.__P=t),n.__c.__g|=4,n.__c=n.ref=null),n.__k=n.__k&&n.__k.map(function(n){return en(n,t,e)})}return n}function rn(n,t,e){return n&&e&&("string"==typeof n.type&&(n.__u|=1),n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return rn(n,t,e)}),n.__c&&n.__c.__P==t&&(n.__e&&e.appendChild(n.__e),n.__c.__g|=4,n.__c.__P=e)),n}function un(){function n(){this.__u=0,this.i=null,this.__b=null}return function(){var n=u.__e;u.__e=function(t,e,r,u){if(t.then)for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return r&&!r.__c&&(e.__c.__H=void 0),i.__c(t,e);n(t,e,r,u)};var t=u.unmount;u.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),t&&t(n)}}(),(n.prototype=new t).__c=function(n,t){var e=this,r=t.__c;null==this.i&&(this.i=[]),this.i.push(r);var u=!1,i=function(){!u&&e.__P&&(u=!0,r.__R=null,f())};r.__R=i;var o=r.__P;r.__P=null;var f=function(){if(!--e.__u){if(e.state.__a){var n=e.state.__a;e.__v.__k[0]=rn(n,n.__c.__P,n.__c.__O)}var t;for(e.setState({__a:e.__b=null});t=e.i.pop();)t.__P=o,t.forceUpdate()}};this.__u++||32&t.__u||this.setState({__a:this.__b=this.__v.__k[0]}),n.then(i,i)},n.prototype.componentWillUnmount=function(){this.i=[],this.state.__a&&(this.__v.__k[0]=this.state.__a)},n.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),u=this.__v.__k[0].__c;this.__v.__k[0]=en(this.__b,r,u.__O=u.__P)}this.__b=null}return[e(f,null,t.__a?null:n.children),t.__a&&e(f,null,n.fallback)]},n}var on=/* @__PURE__ */un();function fn(n){var t,r,u,i=null;function o(o){if(t||(t=n()).then(function(n){n&&(i=n.default||n),u=!0},function(n){r=n,u=!0}),r)throw r;if(!u)throw t;return i?e(i,o):null}return o.displayName="Lazy",o}var cn="19.0.0";function an(n){return e.bind(null,n)}function ln(n){return!!n&&n.$$typeof===P}function sn(n){return ln(n)&&n.type==f}function vn(n){return!!n&&"string"==typeof n.displayName&&0==n.displayName.indexOf("Memo(")}function hn(n){return ln(n)?l.apply(null,arguments):n}function dn(n){return!!n.__k&&(o(null,n),!0)}function pn(n){return n&&(n.__v&&n.__v.__e||1==n.nodeType&&n)||null}var mn=function(n,t){var e,r=u.debounceRendering;u.debounceRendering=function(n){e=n};try{var i=n(t);return e&&e(),i}finally{u.debounceRendering=r}};function yn(n,t){return n(t)}var _n={useState:h,useId:y,useReducer:d,useEffect:_,useLayoutEffect:s,useInsertionEffect:L,useTransition:F,useDeferredValue:D,useSyncExternalStore:Z,useEffectEvent:N,startTransition:M,useRef:v,useImperativeHandle:m,useMemo:p,useCallback:E,useContext:g,use:nn,useDebugValue:b,version:"19.0.0",Children:C,render:q,hydrate:G,unmountComponentAtNode:dn,createPortal:U,createElement:e,createContext:a,createFactory:an,cloneElement:hn,createRef:c,Fragment:f,isValidElement:ln,isElement:ln,isFragment:sn,isMemo:vn,findDOMNode:pn,Component:t,PureComponent:I,memo:A,forwardRef:k,flushSync:mn,unstable_batchedUpdates:yn,StrictMode:f,Suspense:on,lazy:fn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:tn};export{C as Children,I as PureComponent,on as Suspense,tn as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hn as cloneElement,an as createFactory,U as createPortal,_n as default,pn as findDOMNode,mn as flushSync,k as forwardRef,G as hydrate,ln as isElement,sn as isFragment,vn as isMemo,ln as isValidElement,fn as lazy,A as memo,q as render,M as startTransition,dn as unmountComponentAtNode,yn as unstable_batchedUpdates,nn as use,D as useDeferredValue,N as useEffectEvent,L as useInsertionEffect,Z as useSyncExternalStore,F as useTransition,cn as version};
2
+ //# sourceMappingURL=compat.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compat.mjs","sources":["../src/Children.js","../src/util.js","../src/PureComponent.js","../src/forwardRef.js","../src/hooks.js","../src/memo.js","../src/portals.js","../src/render.js","../src/suspense.js","../../src/constants.js","../src/index.js"],"sourcesContent":["import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn, context) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn.bind(context)));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length != 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n","export const assign = Object.assign;\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i != '__source' && a[i] !== b[i]) return true;\n\tfor (let i in b) if (i != '__source' && !(i in a)) return true;\n\treturn false;\n}\n\nexport const IS_NON_DIMENSIONAL =\n\t/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/;\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n// Built in a factory so bundlers can drop it when unused\nfunction createPureComponent() {\n\t/**\n\t * Component class with a predefined `shouldComponentUpdate` implementation\n\t */\n\tfunction PureComponent(p, c) {\n\t\tthis.props = p;\n\t\tthis.context = c;\n\t}\n\tPureComponent.prototype = new Component();\n\t// Some third-party libraries check if this property is present\n\tPureComponent.prototype.isPureReactComponent = true;\n\tPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\t\treturn (\n\t\t\tshallowDiffers(this.props, props) || shallowDiffers(this.state, state)\n\t\t);\n\t};\n\treturn PureComponent;\n}\n\nexport const PureComponent = /* @__PURE__ */ createPureComponent();\n","import { assign } from './util';\n\nexport const REACT_FORWARD_SYMBOL = Symbol.for('react.forward_ref');\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardRefRenderFunction} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = fn;\n\n\tForwarded.prototype.isReactComponent = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\n\treturn Forwarded;\n}\n","import { useLayoutEffect, useRef } from 'preact/hooks';\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n\n/**\n * @template {Function} T\n * @param {T} callback\n * @returns {T}\n */\nexport function useEffectEvent(callback) {\n\tconst ref = useRef(callback);\n\tref.current = callback;\n\n\treturn /** @type {T} */ (\n\t\tfunction () {\n\t\t\treturn ref.current.apply(undefined, arguments);\n\t\t}\n\t);\n}\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tconst ref = this.props.ref;\n\t\tif (ref != nextProps.ref && ref) {\n\t\t\ttypeof ref == 'function' ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\treturn comparer\n\t\t\t? !comparer(this.props, nextProps) || ref != nextProps.ref\n\t\t\t: shallowDiffers(this.props, nextProps);\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed.type = c;\n\treturn Memoed;\n}\n","import { createPortal as corePortal } from 'preact';\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\tconst el = corePortal(vnode, container);\n\tel.containerInfo = container;\n\treturn el;\n}\n","import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport { useDeferredValue, useInsertionEffect, useTransition } from './index';\nimport { assign, IS_NON_DIMENSIONAL } from './util';\n\nexport const REACT_ELEMENT_TYPE = Symbol.for('react.element');\n\nconst MODE_HYDRATE = 1 << 5;\nlet currentComponent, hydrationRoot, renderTrackingInitialized;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\nconst IS_DOM = typeof document < 'u';\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport const useSyncExternalStore = /* @__PURE__ */ initRenderTracking(\n\tfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n\t\tconst serverRendering = options._skipEffects || hydrationRoot;\n\t\tconst value = serverRendering\n\t\t\t? (getServerSnapshot || getSnapshot)()\n\t\t\t: getSnapshot();\n\n\t\t/**\n\t\t * @typedef {{ _instance: Store }} StoreRef\n\t\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t\t */\n\t\tconst [{ _instance }, forceUpdate] = useState({\n\t\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t\t});\n\n\t\tuseLayoutEffect(() => {\n\t\t\t_instance._value = value;\n\t\t\t_instance._getSnapshot = getSnapshot;\n\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t}, [subscribe, value, getSnapshot]);\n\n\t\tuseEffect(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\n\t\t\treturn subscribe(() => {\n\t\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\t\tforceUpdate({ _instance });\n\t\t\t\t}\n\t\t\t});\n\t\t}, [subscribe]);\n\n\t\treturn value;\n\t}\n);\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\ttry {\n\t\treturn !Object.is(inst._value, inst._getSnapshot());\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\n// Input types for which onchange should not be converted to oninput.\nconst onChangeInputType = type => /fil|che|rad/.test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = true;\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = () => {};\n\te.isPropagationStopped = function isPropagationStopped() {\n\t\treturn this.cancelBubble;\n\t};\n\te.isDefaultPrevented = function isDefaultPrevented() {\n\t\treturn this.defaultPrevented;\n\t};\n\treturn (e.nativeEvent = e);\n};\n\nconst classNameDescriptorNonEnumberable = {\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {},\n\t\tisNonDashedType = type.indexOf('-') == -1;\n\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i == 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i == 'children' && type == 'noscript') ||\n\t\t\ti == 'class' ||\n\t\t\ti == 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i == 'style' && typeof value == 'object') {\n\t\t\tlet cloned;\n\t\t\tfor (let key in value) {\n\t\t\t\tif (typeof value[key] == 'number' && !IS_NON_DIMENSIONAL.test(key)) {\n\t\t\t\t\tif (!cloned) {\n\t\t\t\t\t\tcloned = value = assign({}, value);\n\t\t\t\t\t}\n\t\t\t\t\tvalue[key] += 'px';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (i == 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i == 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (i == 'translate' && value === 'no') {\n\t\t\tvalue = false;\n\t\t} else if (i[0] == 'o' && i[1] == 'n') {\n\t\t\tlet lowerCased = i.toLowerCase();\n\t\t\tif (lowerCased == 'ondoubleclick') {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\tlowerCased == 'onchange' &&\n\t\t\t\t(type == 'input' || type == 'textarea') &&\n\t\t\t\t!onChangeInputType(props.type)\n\t\t\t) {\n\t\t\t\tlowerCased = i = 'oninput';\n\t\t\t} else if (lowerCased == 'onfocus') {\n\t\t\t\ti = 'onfocusin';\n\t\t\t} else if (lowerCased == 'onblur') {\n\t\t\t\ti = 'onfocusout';\n\t\t\t}\n\n\t\t\t// Add support for onInput and onChange, see #3561\n\t\t\t// if we have an oninput prop already change it to oninputCapture\n\t\t\tif (lowerCased == 'oninput') {\n\t\t\t\ti = lowerCased;\n\t\t\t\tif (normalizedProps[i]) {\n\t\t\t\t\ti = 'oninputCapture';\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isNonDashedType && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\tif (type == 'select') {\n\t\t// Add support for array select values: <select multiple value={[]} />\n\t\tif (normalizedProps.multiple && Array.isArray(normalizedProps.value)) {\n\t\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t\t});\n\t\t}\n\n\t\t// Adding support for defaultValue in select tag\n\t\tif (normalizedProps.defaultValue != null) {\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tif (normalizedProps.multiple) {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t\t} else {\n\t\t\t\t\tchild.props.selected =\n\t\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tif (props.class && !props.className) {\n\t\tnormalizedProps.class = props.class;\n\t\tObject.defineProperty(\n\t\t\tnormalizedProps,\n\t\t\t'className',\n\t\t\tclassNameDescriptorNonEnumberable\n\t\t);\n\t} else if (props.className) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t}\n\n\tvnode.props = normalizedProps;\n}\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\t// only normalize props on Element nodes\n\tif (typeof vnode.type == 'string') {\n\t\thandleDomVNode(vnode);\n\t} else if (typeof vnode.type == 'function') {\n\t\tconst shouldApplyRef =\n\t\t\t'prototype' in vnode.type && vnode.type.prototype.render;\n\t\tif ('ref' in vnode.props && shouldApplyRef) {\n\t\t\tvnode.ref = vnode.props.ref;\n\t\t\tdelete vnode.props.ref;\n\t\t}\n\n\t\tif (vnode.type.defaultProps) {\n\t\t\tlet normalizedProps = assign({}, vnode.props);\n\t\t\tfor (let i in vnode.type.defaultProps) {\n\t\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\t\tnormalizedProps[i] = vnode.type.defaultProps[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvnode.props = normalizedProps;\n\t\t}\n\t}\n\n\t// React 19 keeps `ref` in element.props for every element type, and that's\n\t// where libraries detecting React 19 read it (e.g. MUI's getReactElementRef).\n\t// DOM and class vnodes keep theirs on vnode.ref.\n\tif (vnode.ref && !('ref' in vnode.props)) {\n\t\tObject.defineProperty(vnode.props, 'ref', {\n\t\t\tvalue: vnode.ref,\n\t\t\tconfigurable: true,\n\t\t\twritable: true\n\t\t});\n\t}\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay and useSyncExternalStore hydration.\nfunction initRenderTracking(value) {\n\tif (!renderTrackingInitialized) {\n\t\trenderTrackingInitialized = true;\n\n\t\tconst oldBeforeRender = options._render;\n\t\toptions._render = vnode => {\n\t\t\tif (oldBeforeRender) oldBeforeRender(vnode);\n\t\t\tif (vnode._flags & MODE_HYDRATE) hydrationRoot = vnode;\n\t\t\tcurrentComponent = vnode._component;\n\t\t};\n\n\t\tconst oldDiffed = options.diffed;\n\t\toptions.diffed = vnode => {\n\t\t\tif (oldDiffed) oldDiffed(vnode);\n\t\t\tcurrentComponent = null;\n\t\t\tif (hydrationRoot == vnode) hydrationRoot = null;\n\t\t};\n\t}\n\n\treturn value;\n}\n\n/**\n * Read the value of a Promise (suspending while pending) or a Context.\n * Unlike other hooks, `use` may be called conditionally.\n * @template T\n * @param {(Promise<T> & { status?: string, value?: T, reason?: any }) | import('../../src/internal').PreactContext} resource\n * @returns {T}\n */\nexport const use = /* @__PURE__ */ initRenderTracking(function use(resource) {\n\t// A Context is a function without a `then`, a thenable has one.\n\tif (resource.then) {\n\t\tif (resource.status == 'fulfilled') return resource.value;\n\t\tif (resource.status == 'rejected') throw resource.reason;\n\t\tif (!resource.status) {\n\t\t\tresource.status = 'pending';\n\t\t\tresource.then(\n\t\t\t\tvalue => {\n\t\t\t\t\tresource.status = 'fulfilled';\n\t\t\t\t\tresource.value = value;\n\t\t\t\t},\n\t\t\t\treason => {\n\t\t\t\t\tresource.status = 'rejected';\n\t\t\t\t\tresource.reason = reason;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\tthrow resource;\n\t}\n\n\tconst id = resource._id;\n\tconst provider = currentComponent._globalContext[id];\n\tif (!provider) return resource._defaultValue;\n\t// `use` runs on every render without hook state, while `provider.sub`\n\t// wraps `componentWillUnmount` on each call — mark the component so we\n\t// only subscribe it once.\n\tif (!currentComponent[id]) {\n\t\tcurrentComponent[id] = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n});\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext: use,\n\t\t\tuseCallback,\n\t\t\tuseContext,\n\t\t\tuseDebugValue,\n\t\t\tuseDeferredValue,\n\t\t\tuseEffect,\n\t\t\tuseId,\n\t\t\tuseImperativeHandle,\n\t\t\tuseInsertionEffect,\n\t\t\tuseLayoutEffect,\n\t\t\tuseMemo,\n\t\t\t// useMutableSource, // experimental-only and replaced by uSES, likely not worth supporting\n\t\t\tuseReducer,\n\t\t\tuseRef,\n\t\t\tuseState,\n\t\t\tuseSyncExternalStore,\n\t\t\tuseTransition\n\t\t}\n\t}\n};\n","import { Component, Fragment, createElement, options } from 'preact';\nimport {\n\tCOMPONENT_FORCE,\n\tFORCE_PROPS_REVALIDATE,\n\tMODE_HYDRATE,\n\tREF_DETACHED,\n\tUNDEFINED\n} from '../../src/constants';\nimport { assign } from './util';\n\nfunction initSuspenseHooks() {\n\tconst oldCatchError = options._catchError;\n\toptions._catchError = (error, newVNode, oldVNode, errorInfo) => {\n\t\tif (error.then) {\n\t\t\t/** @type {import('./internal').Component} */\n\t\t\tlet component;\n\t\t\tlet vnode = newVNode;\n\n\t\t\twhile ((vnode = vnode._parent)) {\n\t\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\t\t// A component that suspends before ever committing has no state\n\t\t\t\t\t// worth keeping; mounted ones keep their hooks while parked.\n\t\t\t\t\tif (oldVNode && !oldVNode._component)\n\t\t\t\t\t\tnewVNode._component.__hooks = UNDEFINED;\n\t\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toldCatchError(error, newVNode, oldVNode, errorInfo);\n\t};\n\n\tconst oldUnmount = options.unmount;\n\toptions.unmount = vnode => {\n\t\t/** @type {import('./internal').Component} */\n\t\tconst component = vnode._component;\n\t\tif (component && component._onResolve) {\n\t\t\tcomponent._onResolve();\n\t\t}\n\n\t\tif (oldUnmount) oldUnmount(vnode);\n\t};\n}\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tconst hooks = vnode._component && vnode._component.__hooks;\n\t\tif (hooks) {\n\t\t\thooks._list.forEach(effect => {\n\t\t\t\t// Only effects carry `_passive`; clearing `_args` makes them run\n\t\t\t\t// again when the tree is revealed, memo/ref state stays intact.\n\t\t\t\tif (effect._passive != null) {\n\t\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t\t\teffect._cleanup = effect._args = UNDEFINED;\n\t\t\t\t}\n\t\t\t});\n\t\t\t// Drop effects queued by the aborted render; `options._render` swaps in\n\t\t\t// a fresh `_pendingEffects` array before anything is pushed again, so\n\t\t\t// sharing one empty array here is safe.\n\t\t\thooks._pendingEffects = vnode._component._renderCallbacks = [];\n\t\t}\n\n\t\t// Unmounting the clone detaches DOM refs; flag the original so the\n\t\t// reveal attaches them again.\n\t\tif (typeof vnode.type == 'string') vnode._flags |= REF_DETACHED;\n\n\t\tvnode = assign({ constructor: UNDEFINED }, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom == parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\n\t\t\tvnode._component._bits |= COMPONENT_FORCE;\n\n\t\t\t// Keep component refs attached while parked, as object refs already are\n\t\t\tvnode._component = vnode.ref = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tvnode._flags |= FORCE_PROPS_REVALIDATE;\n\t\t}\n\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom == detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._bits |= COMPONENT_FORCE;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nfunction createSuspense() {\n\tinitSuspenseHooks();\n\n\tfunction Suspense() {\n\t\t// we do not call super here to golf some bytes...\n\t\tthis._pendingSuspensionCount = 0;\n\t\tthis._suspenders = null;\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Things we do here to save some bytes but are not proper JS inheritance:\n\t// - call `new Component()` as the prototype\n\t// - do not set `Suspense.prototype.constructor` to `Suspense`\n\tSuspense.prototype = new Component();\n\n\t/**\n\t * @this {import('./internal').SuspenseComponent}\n\t * @param {Promise} promise The thrown promise\n\t * @param {import('./internal').VNode<any, any>} suspendingVNode The suspending component\n\t */\n\tSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\t\tconst suspendingComponent = suspendingVNode._component;\n\n\t\tif (this._suspenders == null) {\n\t\t\tthis._suspenders = [];\n\t\t}\n\t\tthis._suspenders.push(suspendingComponent);\n\n\t\tlet resolved = false;\n\t\tconst onResolved = () => {\n\t\t\t// Core nulls `_parentDom` when the boundary unmounts.\n\t\t\tif (resolved || !this._parentDom) return;\n\n\t\t\tresolved = true;\n\t\t\tsuspendingComponent._onResolve = null;\n\n\t\t\tonSuspensionComplete();\n\t\t};\n\n\t\tsuspendingComponent._onResolve = onResolved;\n\n\t\t// Store and null _parentDom to prevent setState/forceUpdate from\n\t\t// scheduling renders while suspended. Render would be a no-op anyway\n\t\t// since renderComponent checks _parentDom, but this avoids queue churn.\n\t\tconst originalParentDom = suspendingComponent._parentDom;\n\t\tsuspendingComponent._parentDom = null;\n\n\t\tconst onSuspensionComplete = () => {\n\t\t\tif (!--this._pendingSuspensionCount) {\n\t\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t\t// suspended children into the _children array\n\t\t\t\tif (this.state._suspended) {\n\t\t\t\t\tconst suspendedVNode = this.state._suspended;\n\t\t\t\t\tthis._vnode._children[0] = removeOriginal(\n\t\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.setState({ _suspended: (this._detachOnNextRender = null) });\n\n\t\t\t\tlet suspended;\n\t\t\t\twhile ((suspended = this._suspenders.pop())) {\n\t\t\t\t\t// Restore _parentDom before forceUpdate so render can proceed\n\t\t\t\t\tsuspended._parentDom = originalParentDom;\n\t\t\t\t\tsuspended.forceUpdate();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t\t */\n\t\tif (\n\t\t\t!this._pendingSuspensionCount++ &&\n\t\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t\t) {\n\t\t\tthis.setState({\n\t\t\t\t_suspended: (this._detachOnNextRender = this._vnode._children[0])\n\t\t\t});\n\t\t}\n\t\tpromise.then(onResolved, onResolved);\n\t};\n\n\tSuspense.prototype.componentWillUnmount = function () {\n\t\tthis._suspenders = [];\n\t\tif (this.state._suspended) this._vnode._children[0] = this.state._suspended;\n\t};\n\n\t/**\n\t * @this {import('./internal').SuspenseComponent}\n\t * @param {import('./internal').SuspenseComponent[\"props\"]} props\n\t * @param {import('./internal').SuspenseState} state\n\t */\n\tSuspense.prototype.render = function (props, state) {\n\t\tif (this._detachOnNextRender) {\n\t\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t\t// (i.e. due to a setState further up in the tree)\n\t\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\t\tif (this._vnode._children) {\n\t\t\t\tconst detachedParent = document.createElement('div');\n\t\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\t\tthis._detachOnNextRender,\n\t\t\t\t\tdetachedParent,\n\t\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis._detachOnNextRender = null;\n\t\t}\n\n\t\treturn [\n\t\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\t\tstate._suspended && createElement(Fragment, null, props.fallback)\n\t\t];\n\t};\n\n\treturn Suspense;\n}\n\nexport const Suspense = /* @__PURE__ */ createSuspense();\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component = null;\n\tlet error;\n\tlet resolved;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tif (exports) {\n\t\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t\t}\n\t\t\t\t\tresolved = true;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t\tresolved = true;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!resolved) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn component ? createElement(component, props) : null;\n\t}\n\n\tLazy.displayName = 'Lazy';\n\treturn Lazy;\n}\n","// Vnode._flags\n/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n/** Indicates that this vnode has been unmounted before indicating the loss of event listeners */\nexport const FORCE_PROPS_REVALIDATE = 1 << 0;\n/** The vnode's ref was detached while its subtree was parked by Suspense */\nexport const REF_DETACHED = 1 << 3;\n\n// component._bits\n/** Component is processing an exception */\nexport const COMPONENT_PROCESSING_EXCEPTION = 1 << 0;\n/** Component has a pending error */\nexport const COMPONENT_PENDING_ERROR = 1 << 1;\n/** Component should force update (skip shouldComponentUpdate) */\nexport const COMPONENT_FORCE = 1 << 2;\n/** Component is queued for update */\nexport const COMPONENT_DIRTY = 1 << 3;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\n\nexport const MATHML_TOKEN_ELEMENTS = /^m(i|n|o|s|text|space)$/;\n","import {\n\tComponent,\n\tFragment,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\toptions,\n\tcloneElement as preactCloneElement,\n\trender as preactRender\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport { Children } from './Children';\nimport { PureComponent } from './PureComponent';\nimport { forwardRef } from './forwardRef';\nimport {\n\tstartTransition,\n\tuseDeferredValue,\n\tuseEffectEvent,\n\tuseInsertionEffect,\n\tuseTransition\n} from './hooks';\nimport { memo } from './memo';\nimport { createPortal } from './portals';\nimport {\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n\thydrate,\n\trender,\n\tuse,\n\tuseSyncExternalStore\n} from './render';\nimport { Suspense, lazy } from './suspense';\n\nconst version = '19.0.0'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Check if the passed element is a Fragment node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isFragment(element) {\n\treturn isValidElement(element) && element.type == Fragment;\n}\n\n/**\n * Check if the passed element is a Memo node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isMemo(element) {\n\treturn (\n\t\t!!element &&\n\t\ttypeof element.displayName == 'string' &&\n\t\telement.displayName.indexOf('Memo(') == 0\n\t);\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t((component._vnode && component._vnode._dom) ||\n\t\t\t\t(component.nodeType == 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => {\n\tconst prevDebounce = options.debounceRendering;\n\n\t// Capture the scheduled render callback so that all updates performed\n\t// inside the user callback are batched into a single synchronous commit\n\t// instead of every state setter rendering independently.\n\tlet flush;\n\toptions.debounceRendering = cb => {\n\t\tflush = cb;\n\t};\n\ttry {\n\t\tconst res = callback(arg);\n\t\tif (flush) flush();\n\t\treturn res;\n\t} finally {\n\t\toptions.debounceRendering = prevDebounce;\n\t}\n};\n\n/**\n * In React, `unstable_batchedUpdates` is a legacy feature that was made a no-op\n * outside of legacy mode in React 18 and a no-op across the board in React 19.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback\n * @param {Arg} [arg]\n * @returns {Result}\n */\nfunction unstable_batchedUpdates(callback, arg) {\n\treturn callback(arg);\n}\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\t// compat to react-is\n\tisValidElement as isElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tuseEffectEvent,\n\tuse,\n\tFragment as StrictMode,\n\tSuspense,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseEffectEvent,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuse,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisElement: isValidElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode: Fragment,\n\tSuspense,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n"],"names":["mapFn","children","fn","context","toChildArray","map","bind","Children","forEach","count","length","only","normalized","toArray","assign","Object","shallowDiffers","a","b","i","IS_NON_DIMENSIONAL","createPureComponent","PureComponent","p","c","this","props","prototype","Component","isPureReactComponent","shouldComponentUpdate","state","REACT_FORWARD_SYMBOL","Symbol","for","forwardRef","Forwarded","clone","ref","$$typeof","render","isReactComponent","displayName","name","startTransition","cb","useDeferredValue","val","useTransition","useInsertionEffect","useLayoutEffect","useEffectEvent","callback","useRef","current","apply","undefined","arguments","memo","comparer","shouldUpdate","nextProps","Memoed","createElement","type","createPortal","vnode","container","el","corePortal","containerInfo","currentComponent","hydrationRoot","renderTrackingInitialized","REACT_ELEMENT_TYPE","CAMEL_PROPS","CAMEL_REPLACE","IS_DOM","document","useSyncExternalStore","initRenderTracking","subscribe","getSnapshot","getServerSnapshot","value","options","__s","_useState","useState","_instance","__","_getSnapshot","forceUpdate","didSnapshotChange","useEffect","inst","is","error","onChangeInputType","test","parent","__k","textContent","preactRender","__c","hydrate","preactHydrate","key","defineProperty","configurable","get","set","v","writable","oldEventHook","event","e","persist","isPropagationStopped","cancelBubble","isDefaultPrevented","defaultPrevented","nativeEvent","classNameDescriptorNonEnumberable","class","oldVNodeHook","oldBeforeRender","__r","__u","oldDiffed","diffed","normalizedProps","isNonDashedType","indexOf","cloned","lowerCased","toLowerCase","replace","multiple","Array","isArray","child","selected","defaultValue","className","handleDomVNode","defaultProps","use","resource","then","status","reason","id","provider","__n","sub","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentDispatcher","readContext","useCallback","useContext","useDebugValue","useId","useImperativeHandle","useMemo","useReducer","detachedClone","detachedParent","parentDom","hooks","__H","effect","__P","__h","constructor","__g","removeOriginal","originalParent","__v","__e","appendChild","createSuspense","Suspense","_suspenders","__b","oldCatchError","newVNode","oldVNode","errorInfo","component","oldUnmount","unmount","__R","initSuspenseHooks","promise","suspendingVNode","_this","suspendingComponent","push","resolved","onResolved","onSuspensionComplete","originalParentDom","__a","suspendedVNode","__O","suspended","setState","pop","componentWillUnmount","detachedComponent","Fragment","fallback","lazy","loader","prom","Lazy","exports","default","version","createFactory","isValidElement","element","isFragment","isMemo","cloneElement","preactCloneElement","unmountComponentAtNode","findDOMNode","nodeType","flushSync","arg","flush","prevDebounce","debounceRendering","res","unstable_batchedUpdates","index","createContext","createRef","isElement","StrictMode"],"mappings":"6gBAEA,IAAMA,EAAQ,SAACC,EAAUC,EAAIC,GAC5B,OAAgB,MAAZF,EAAyB,KACtBG,EAAaA,EAAaH,GAAUI,IAAIH,EAAGI,KAAKH,IACxD,EAGaI,EAAW,CACvBF,IAAKL,EACLQ,QAASR,EACTS,MAAK,SAACR,GACL,OAAOA,EAAWG,EAAaH,GAAUS,OAAS,CACnD,EACAC,KAAI,SAACV,GACJ,IAAMW,EAAaR,EAAaH,GAChC,GAAyB,GAArBW,EAAWF,OAAa,KAAM,gBAClC,OAAOE,EAAW,EACnB,EACAC,QAAST,GCnBGU,EAASC,OAAOD,OAQtB,SAASE,EAAeC,EAAGC,GACjC,IAAK,IAAIC,KAAKF,EAAG,GAAS,YAALE,GAAmBF,EAAEE,KAAOD,EAAEC,GAAI,OAAO,EAC9D,IAAK,IAAIA,KAAKD,EAAG,GAAS,YAALC,KAAqBA,KAAKF,GAAI,OAAO,EAC1D,OAAO,CACR,CAEO,IAAMG,EACZ,oHCXD,SAASC,IAIR,SAASC,EAAcC,EAAGC,GACzBC,KAAKC,MAAQH,EACbE,KAAKtB,QAAUqB,CAChB,CASA,OARAF,EAAcK,UAAY,IAAIC,GAENC,sBAAuB,EAC/CP,EAAcK,UAAUG,sBAAwB,SAAUJ,EAAOK,GAChE,OACCf,EAAeS,KAAKC,MAAOA,IAAUV,EAAeS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,EAAUmL,GAC5B,IAKIC,EALEC,EAAepJ,EAAQqJ,kBAM7BrJ,EAAQqJ,kBAAoB,SAAA7L,GAC3B2L,EAAQ3L,CACT,EACA,IACC,IAAM8L,EAAMvL,EAASmL,GAErB,OADIC,GAAOA,IACJG,CAGR,CAFC,QACAtJ,EAAQqJ,kBAAoBD,CAC7B,CACD,EAWA,SAASG,GAAwBxL,EAAUmL,GAC1C,OAAOnL,EAASmL,EACjB,CA0CA,IAAAM,GAAe,CACdrJ,SAAAA,EACA0E,MAAAA,EACAG,WAAAA,EACAvE,UAAAA,EACA5C,gBAAAA,EACAD,mBAAAA,EACAD,cAAAA,EACAF,iBAAAA,EACAiC,qBAAAA,EACA5B,eAAAA,EACAP,gBAAAA,EACAS,OAAAA,EACA8G,oBAAAA,EACAC,QAAAA,EACAL,YAAAA,EACAC,WAAAA,EACAb,IAAAA,GACAc,cAAAA,EACA0D,QAnLe,SAoLfpN,SAAAA,EACAiC,OAAAA,EACAiE,QAAAA,EACA0H,uBAAAA,GACAlK,aAAAA,EACAF,cAAAA,EACA+K,cAAAA,EACAlB,cAAAA,GACAK,aAAAA,GACAc,UAAAA,EACA5B,SAAAA,EACAU,eAAAA,GACAmB,UAAWnB,GACXE,WAAAA,GACAC,OAAAA,GACAI,YAAAA,GACAxM,UAAAA,EACAN,cAAAA,EACAoC,KAAAA,EACAvB,WAAAA,EACAmM,UAAAA,GACAM,wBAAAA,GACAK,WAAY9B,EACZ7B,SAAAA,GACA+B,KAAAA,GACAzD,mDAAAA"}
@@ -1,12 +1,9 @@
1
1
  {
2
2
  "name": "preact-compat",
3
- "amdName": "preactCompat",
4
- "version": "4.0.0",
5
3
  "private": true,
6
4
  "description": "A React compatibility layer for Preact",
7
- "main": "dist/compat.js",
8
- "module": "dist/compat.module.js",
9
- "umd:main": "dist/compat.umd.js",
5
+ "main": "dist/compat.mjs",
6
+ "module": "dist/compat.mjs",
10
7
  "source": "src/index.js",
11
8
  "types": "src/index.d.ts",
12
9
  "license": "MIT",
@@ -15,41 +12,5 @@
15
12
  },
16
13
  "peerDependencies": {
17
14
  "preact": "^10.0.0"
18
- },
19
- "exports": {
20
- ".": {
21
- "types": "./src/index.d.ts",
22
- "browser": "./dist/compat.module.js",
23
- "umd": "./dist/compat.umd.js",
24
- "import": "./dist/compat.mjs",
25
- "require": "./dist/compat.js"
26
- },
27
- "./client": {
28
- "types": "./client.d.ts",
29
- "import": "./client.mjs",
30
- "require": "./client.js"
31
- },
32
- "./server": {
33
- "browser": "./server.browser.js",
34
- "import": "./server.mjs",
35
- "require": "./server.js"
36
- },
37
- "./jsx-runtime": {
38
- "import": "./jsx-runtime.mjs",
39
- "require": "./jsx-runtime.js"
40
- },
41
- "./jsx-dev-runtime": {
42
- "import": "./jsx-dev-runtime.mjs",
43
- "require": "./jsx-dev-runtime.js"
44
- },
45
- "./scheduler": {
46
- "import": "./scheduler.mjs",
47
- "require": "./scheduler.js"
48
- },
49
- "./test-utils": {
50
- "import": "./test-utils.mjs",
51
- "require": "./test-utils.js"
52
- },
53
- "./package.json": "./package.json"
54
15
  }
55
16
  }
@@ -0,0 +1,12 @@
1
+ export var unstable_ImmediatePriority: number;
2
+ export var unstable_UserBlockingPriority: number;
3
+ export var unstable_NormalPriority: number;
4
+ export var unstable_LowPriority: number;
5
+ export var unstable_IdlePriority: number;
6
+
7
+ export function unstable_runWithPriority(
8
+ priority: number,
9
+ callback: () => void
10
+ ): void;
11
+
12
+ export function unstable_now(): DOMHighResTimeStamp;
@@ -0,0 +1,17 @@
1
+ // @ts-nocheck moduleResolution "node" (node10) can't resolve the streaming
2
+ // subpaths of preact-render-to-string, which would error with skipLibCheck off.
3
+ // There the stream renderers are typed as `any`; everywhere else they resolve.
4
+ import { renderToString as _renderToString } from 'preact-render-to-string';
5
+ import { renderToPipeableStream as _renderToPipeableStream } from 'preact-render-to-string/stream-node';
6
+ import { renderToReadableStream as _renderToReadableStream } from 'preact-render-to-string/stream';
7
+
8
+ // A namespace + `export =` matches both builds: the CJS `module.exports` object
9
+ // and the ESM named exports plus default export.
10
+ declare namespace ReactDOMServer {
11
+ export const renderToString: typeof _renderToString;
12
+ export const renderToStaticMarkup: typeof _renderToString;
13
+ export const renderToPipeableStream: typeof _renderToPipeableStream;
14
+ export const renderToReadableStream: typeof _renderToReadableStream;
15
+ }
16
+
17
+ export = ReactDOMServer;
@@ -1,8 +1,8 @@
1
1
  import { toChildArray } from '../..';
2
2
 
3
- const mapFn = (children, fn) => {
3
+ const mapFn = (children, fn, context) => {
4
4
  if (children == null) return null;
5
- return toChildArray(toChildArray(children).map(fn));
5
+ return toChildArray(toChildArray(children).map(fn.bind(context)));
6
6
  };
7
7
 
8
8
  // This API is completely unnecessary for Preact, so it's basically passthrough.
@@ -14,7 +14,7 @@ export const Children = {
14
14
  },
15
15
  only(children) {
16
16
  const normalized = toChildArray(children);
17
- if (normalized.length !== 1) throw 'Children.only';
17
+ if (normalized.length != 1) throw 'Children.only';
18
18
  return normalized[0];
19
19
  },
20
20
  toArray: toChildArray
@@ -1,16 +1,24 @@
1
1
  import { Component } from '../..';
2
2
  import { shallowDiffers } from './util';
3
3
 
4
- /**
5
- * Component class with a predefined `shouldComponentUpdate` implementation
6
- */
7
- export function PureComponent(p, c) {
8
- this.props = p;
9
- this.context = c;
4
+ // Built in a factory so bundlers can drop it when unused
5
+ function createPureComponent() {
6
+ /**
7
+ * Component class with a predefined `shouldComponentUpdate` implementation
8
+ */
9
+ function PureComponent(p, c) {
10
+ this.props = p;
11
+ this.context = c;
12
+ }
13
+ PureComponent.prototype = new Component();
14
+ // Some third-party libraries check if this property is present
15
+ PureComponent.prototype.isPureReactComponent = true;
16
+ PureComponent.prototype.shouldComponentUpdate = function (props, state) {
17
+ return (
18
+ shallowDiffers(this.props, props) || shallowDiffers(this.state, state)
19
+ );
20
+ };
21
+ return PureComponent;
10
22
  }
11
- PureComponent.prototype = new Component();
12
- // Some third-party libraries check if this property is present
13
- PureComponent.prototype.isPureReactComponent = true;
14
- PureComponent.prototype.shouldComponentUpdate = function (props, state) {
15
- return shallowDiffers(this.props, props) || shallowDiffers(this.state, state);
16
- };
23
+
24
+ export const PureComponent = /* @__PURE__ */ createPureComponent();
@@ -1,26 +1,12 @@
1
- import { options } from '../..';
2
1
  import { assign } from './util';
3
2
 
4
- let oldDiffHook = options._diff;
5
- options._diff = vnode => {
6
- if (vnode.type && vnode.type._forwarded && vnode.ref) {
7
- vnode.props.ref = vnode.ref;
8
- vnode.ref = null;
9
- }
10
- if (oldDiffHook) oldDiffHook(vnode);
11
- };
12
-
13
- export const REACT_FORWARD_SYMBOL =
14
- (typeof Symbol != 'undefined' &&
15
- Symbol.for &&
16
- Symbol.for('react.forward_ref')) ||
17
- 0xf47;
3
+ export const REACT_FORWARD_SYMBOL = Symbol.for('react.forward_ref');
18
4
 
19
5
  /**
20
6
  * Pass ref down to a child. This is mainly used in libraries with HOCs that
21
7
  * wrap components. Using `forwardRef` there is an easy way to get a reference
22
8
  * of the wrapped component instead of one of the wrapper itself.
23
- * @param {import('./index').ForwardFn} fn
9
+ * @param {import('./index').ForwardRefRenderFunction} fn
24
10
  * @returns {import('./internal').FunctionComponent}
25
11
  */
26
12
  export function forwardRef(fn) {
@@ -38,7 +24,8 @@ export function forwardRef(fn) {
38
24
  // mobx-react throws.
39
25
  Forwarded.render = fn;
40
26
 
41
- Forwarded.prototype.isReactComponent = Forwarded._forwarded = true;
27
+ Forwarded.prototype.isReactComponent = true;
42
28
  Forwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';
29
+
43
30
  return Forwarded;
44
31
  }
@@ -1,54 +1,4 @@
1
- import { useState, useLayoutEffect, useEffect } from '../../hooks';
2
- import { is } from './util';
3
-
4
- /**
5
- * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84
6
- * on a high level this cuts out the warnings, ... and attempts a smaller implementation
7
- * @typedef {{ _value: any; _getSnapshot: () => any }} Store
8
- */
9
- export function useSyncExternalStore(subscribe, getSnapshot) {
10
- const value = getSnapshot();
11
-
12
- /**
13
- * @typedef {{ _instance: Store }} StoreRef
14
- * @type {[StoreRef, (store: StoreRef) => void]}
15
- */
16
- const [{ _instance }, forceUpdate] = useState({
17
- _instance: { _value: value, _getSnapshot: getSnapshot }
18
- });
19
-
20
- useLayoutEffect(() => {
21
- _instance._value = value;
22
- _instance._getSnapshot = getSnapshot;
23
-
24
- if (didSnapshotChange(_instance)) {
25
- forceUpdate({ _instance });
26
- }
27
- }, [subscribe, value, getSnapshot]);
28
-
29
- useEffect(() => {
30
- if (didSnapshotChange(_instance)) {
31
- forceUpdate({ _instance });
32
- }
33
-
34
- return subscribe(() => {
35
- if (didSnapshotChange(_instance)) {
36
- forceUpdate({ _instance });
37
- }
38
- });
39
- }, [subscribe]);
40
-
41
- return value;
42
- }
43
-
44
- /** @type {(inst: Store) => boolean} */
45
- function didSnapshotChange(inst) {
46
- try {
47
- return !is(inst._value, inst._getSnapshot());
48
- } catch (error) {
49
- return true;
50
- }
51
- }
1
+ import { useLayoutEffect, useRef } from '../../hooks';
52
2
 
53
3
  export function startTransition(cb) {
54
4
  cb();
@@ -65,3 +15,19 @@ export function useTransition() {
65
15
  // TODO: in theory this should be done after a VNode is diffed as we want to insert
66
16
  // styles/... before it attaches
67
17
  export const useInsertionEffect = useLayoutEffect;
18
+
19
+ /**
20
+ * @template {Function} T
21
+ * @param {T} callback
22
+ * @returns {T}
23
+ */
24
+ export function useEffectEvent(callback) {
25
+ const ref = useRef(callback);
26
+ ref.current = callback;
27
+
28
+ return /** @type {T} */ (
29
+ function () {
30
+ return ref.current.apply(undefined, arguments);
31
+ }
32
+ );
33
+ }