@bleedingdev/tanstack-redact 0.0.0-bootstrap → 0.2.1

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 (476) hide show
  1. package/LICENSE +1 -1
  2. package/dist/cloudflare/index.d.ts +6 -0
  3. package/dist/cloudflare/index.js +39 -0
  4. package/dist/cloudflare/index.js.map +7 -0
  5. package/dist/core/attributes.d.ts +4 -0
  6. package/dist/core/attributes.js +30 -0
  7. package/dist/core/attributes.js.map +7 -0
  8. package/dist/core/browser.d.ts +9 -0
  9. package/dist/core/browser.js +32 -0
  10. package/dist/core/browser.js.map +7 -0
  11. package/dist/core/class-props.d.ts +1 -0
  12. package/dist/core/class-props.js +15 -0
  13. package/dist/core/class-props.js.map +7 -0
  14. package/dist/core/devtools.d.ts +26 -0
  15. package/dist/core/devtools.js +70 -0
  16. package/dist/core/devtools.js.map +7 -0
  17. package/dist/core/functions.d.ts +6 -0
  18. package/dist/core/functions.js +14 -0
  19. package/dist/core/functions.js.map +7 -0
  20. package/dist/core/index.d.ts +2 -0
  21. package/dist/core/index.js +3 -0
  22. package/dist/core/index.js.map +7 -0
  23. package/dist/core/internal.d.ts +103 -0
  24. package/dist/core/internal.js +43 -0
  25. package/dist/core/internal.js.map +7 -0
  26. package/dist/core/resource-hints.d.ts +7 -0
  27. package/dist/core/resource-hints.js +20 -0
  28. package/dist/core/resource-hints.js.map +7 -0
  29. package/dist/core/types.d.ts +23 -0
  30. package/dist/core/types.js +8 -0
  31. package/dist/core/types.js.map +7 -0
  32. package/dist/core/unitless-style.d.ts +1 -0
  33. package/dist/core/unitless-style.js +5 -0
  34. package/dist/core/unitless-style.js.map +7 -0
  35. package/dist/dom/_all.d.ts +27 -0
  36. package/dist/dom/_all.js +51 -0
  37. package/dist/dom/_all.js.map +7 -0
  38. package/dist/dom/client.d.ts +9 -0
  39. package/dist/dom/client.js +13 -0
  40. package/dist/dom/client.js.map +7 -0
  41. package/dist/dom/commit.d.ts +27 -0
  42. package/dist/dom/commit.js +237 -0
  43. package/dist/dom/commit.js.map +7 -0
  44. package/dist/dom/devtools-effects.d.ts +8 -0
  45. package/dist/dom/devtools-effects.js +80 -0
  46. package/dist/dom/devtools-effects.js.map +7 -0
  47. package/dist/dom/devtools.d.ts +33 -0
  48. package/dist/dom/devtools.js +635 -0
  49. package/dist/dom/devtools.js.map +7 -0
  50. package/dist/dom/dispatcher.d.ts +4 -0
  51. package/dist/dom/dispatcher.js +437 -0
  52. package/dist/dom/dispatcher.js.map +7 -0
  53. package/dist/dom/document-metadata.d.ts +7 -0
  54. package/dist/dom/document-metadata.js +44 -0
  55. package/dist/dom/document-metadata.js.map +7 -0
  56. package/dist/dom/dom.d.ts +11 -0
  57. package/dist/dom/dom.js +165 -0
  58. package/dist/dom/dom.js.map +7 -0
  59. package/dist/dom/error-info.d.ts +2 -0
  60. package/dist/dom/error-info.js +19 -0
  61. package/dist/dom/error-info.js.map +7 -0
  62. package/dist/dom/event-replay.d.ts +13 -0
  63. package/dist/dom/event-replay.js +24 -0
  64. package/dist/dom/event-replay.js.map +7 -0
  65. package/dist/dom/features/activity/full.d.ts +1 -0
  66. package/dist/dom/features/activity/full.js +140 -0
  67. package/dist/dom/features/activity/full.js.map +7 -0
  68. package/dist/dom/features/activity/index.d.ts +1 -0
  69. package/dist/dom/features/activity/index.js +2 -0
  70. package/dist/dom/features/activity/index.js.map +7 -0
  71. package/dist/dom/features/activity/stub.d.ts +1 -0
  72. package/dist/dom/features/activity/stub.js +10 -0
  73. package/dist/dom/features/activity/stub.js.map +7 -0
  74. package/dist/dom/features/class/full.d.ts +1 -0
  75. package/dist/dom/features/class/full.js +208 -0
  76. package/dist/dom/features/class/full.js.map +7 -0
  77. package/dist/dom/features/class/index.d.ts +1 -0
  78. package/dist/dom/features/class/index.js +2 -0
  79. package/dist/dom/features/class/index.js.map +7 -0
  80. package/dist/dom/features/class/stub.d.ts +1 -0
  81. package/dist/dom/features/class/stub.js +46 -0
  82. package/dist/dom/features/class/stub.js.map +7 -0
  83. package/dist/dom/features/context/full.d.ts +4 -0
  84. package/dist/dom/features/context/full.js +103 -0
  85. package/dist/dom/features/context/full.js.map +7 -0
  86. package/dist/dom/features/context/index.d.ts +1 -0
  87. package/dist/dom/features/context/index.js +2 -0
  88. package/dist/dom/features/context/index.js.map +7 -0
  89. package/dist/dom/features/context/stub.d.ts +4 -0
  90. package/dist/dom/features/context/stub.js +21 -0
  91. package/dist/dom/features/context/stub.js.map +7 -0
  92. package/dist/dom/features/forward-ref/full.d.ts +1 -0
  93. package/dist/dom/features/forward-ref/full.js +9 -0
  94. package/dist/dom/features/forward-ref/full.js.map +7 -0
  95. package/dist/dom/features/forward-ref/index.d.ts +1 -0
  96. package/dist/dom/features/forward-ref/index.js +2 -0
  97. package/dist/dom/features/forward-ref/index.js.map +7 -0
  98. package/dist/dom/features/forward-ref/stub.d.ts +1 -0
  99. package/dist/dom/features/forward-ref/stub.js +9 -0
  100. package/dist/dom/features/forward-ref/stub.js.map +7 -0
  101. package/dist/dom/features/fragment-refs/index.d.ts +1 -0
  102. package/dist/dom/features/fragment-refs/index.js +9 -0
  103. package/dist/dom/features/fragment-refs/index.js.map +7 -0
  104. package/dist/dom/features/fragment-refs/stub.d.ts +5 -0
  105. package/dist/dom/features/fragment-refs/stub.js +17 -0
  106. package/dist/dom/features/fragment-refs/stub.js.map +7 -0
  107. package/dist/dom/features/hydration/full.d.ts +68 -0
  108. package/dist/dom/features/hydration/full.js +493 -0
  109. package/dist/dom/features/hydration/full.js.map +7 -0
  110. package/dist/dom/features/hydration/index.d.ts +1 -0
  111. package/dist/dom/features/hydration/index.js +2 -0
  112. package/dist/dom/features/hydration/index.js.map +7 -0
  113. package/dist/dom/features/hydration/stub.d.ts +36 -0
  114. package/dist/dom/features/hydration/stub.js +80 -0
  115. package/dist/dom/features/hydration/stub.js.map +7 -0
  116. package/dist/dom/features/index.d.ts +8 -0
  117. package/dist/dom/features/index.js +9 -0
  118. package/dist/dom/features/index.js.map +7 -0
  119. package/dist/dom/features/lazy/full.d.ts +1 -0
  120. package/dist/dom/features/lazy/full.js +23 -0
  121. package/dist/dom/features/lazy/full.js.map +7 -0
  122. package/dist/dom/features/lazy/index.d.ts +1 -0
  123. package/dist/dom/features/lazy/index.js +2 -0
  124. package/dist/dom/features/lazy/index.js.map +7 -0
  125. package/dist/dom/features/lazy/stub.d.ts +1 -0
  126. package/dist/dom/features/lazy/stub.js +19 -0
  127. package/dist/dom/features/lazy/stub.js.map +7 -0
  128. package/dist/dom/features/memo/full.d.ts +1 -0
  129. package/dist/dom/features/memo/full.js +34 -0
  130. package/dist/dom/features/memo/full.js.map +7 -0
  131. package/dist/dom/features/memo/index.d.ts +1 -0
  132. package/dist/dom/features/memo/index.js +2 -0
  133. package/dist/dom/features/memo/index.js.map +7 -0
  134. package/dist/dom/features/memo/stub.d.ts +1 -0
  135. package/dist/dom/features/memo/stub.js +9 -0
  136. package/dist/dom/features/memo/stub.js.map +7 -0
  137. package/dist/dom/features/portal/full.d.ts +1 -0
  138. package/dist/dom/features/portal/full.js +11 -0
  139. package/dist/dom/features/portal/full.js.map +7 -0
  140. package/dist/dom/features/portal/index.d.ts +1 -0
  141. package/dist/dom/features/portal/index.js +2 -0
  142. package/dist/dom/features/portal/index.js.map +7 -0
  143. package/dist/dom/features/portal/stub.d.ts +1 -0
  144. package/dist/dom/features/portal/stub.js +5 -0
  145. package/dist/dom/features/portal/stub.js.map +7 -0
  146. package/dist/dom/features/suspense/full.d.ts +1 -0
  147. package/dist/dom/features/suspense/full.js +389 -0
  148. package/dist/dom/features/suspense/full.js.map +7 -0
  149. package/dist/dom/features/suspense/index.d.ts +1 -0
  150. package/dist/dom/features/suspense/index.js +2 -0
  151. package/dist/dom/features/suspense/index.js.map +7 -0
  152. package/dist/dom/features/suspense/stub.d.ts +1 -0
  153. package/dist/dom/features/suspense/stub.js +4 -0
  154. package/dist/dom/features/suspense/stub.js.map +7 -0
  155. package/dist/dom/features/suspense-runtime/index.d.ts +1 -0
  156. package/dist/dom/features/suspense-runtime/index.js +2 -0
  157. package/dist/dom/features/suspense-runtime/index.js.map +7 -0
  158. package/dist/dom/features/suspense-runtime/stub.d.ts +1 -0
  159. package/dist/dom/features/suspense-runtime/stub.js +11 -0
  160. package/dist/dom/features/suspense-runtime/stub.js.map +7 -0
  161. package/dist/dom/features/view-transition/full.d.ts +7 -0
  162. package/dist/dom/features/view-transition/full.js +324 -0
  163. package/dist/dom/features/view-transition/full.js.map +7 -0
  164. package/dist/dom/features/view-transition/index.d.ts +1 -0
  165. package/dist/dom/features/view-transition/index.js +2 -0
  166. package/dist/dom/features/view-transition/index.js.map +7 -0
  167. package/dist/dom/features/view-transition/resources.d.ts +11 -0
  168. package/dist/dom/features/view-transition/resources.js +117 -0
  169. package/dist/dom/features/view-transition/resources.js.map +7 -0
  170. package/dist/dom/features/view-transition/stub.d.ts +7 -0
  171. package/dist/dom/features/view-transition/stub.js +21 -0
  172. package/dist/dom/features/view-transition/stub.js.map +7 -0
  173. package/dist/dom/features/view-transition/visual.d.ts +14 -0
  174. package/dist/dom/features/view-transition/visual.js +404 -0
  175. package/dist/dom/features/view-transition/visual.js.map +7 -0
  176. package/dist/dom/form-actions.d.ts +4 -0
  177. package/dist/dom/form-actions.js +74 -0
  178. package/dist/dom/form-actions.js.map +7 -0
  179. package/dist/dom/form-controls.d.ts +3 -0
  180. package/dist/dom/form-controls.js +91 -0
  181. package/dist/dom/form-controls.js.map +7 -0
  182. package/dist/dom/fragment-instance.d.ts +33 -0
  183. package/dist/dom/fragment-instance.js +449 -0
  184. package/dist/dom/fragment-instance.js.map +7 -0
  185. package/dist/dom/index.d.ts +61 -0
  186. package/dist/dom/index.js +71 -0
  187. package/dist/dom/index.js.map +7 -0
  188. package/dist/dom/portal.d.ts +2 -0
  189. package/dist/dom/portal.js +14 -0
  190. package/dist/dom/portal.js.map +7 -0
  191. package/dist/dom/react-ids.d.ts +6 -0
  192. package/dist/dom/react-ids.js +38 -0
  193. package/dist/dom/react-ids.js.map +7 -0
  194. package/dist/dom/reconcile.d.ts +86 -0
  195. package/dist/dom/reconcile.js +1305 -0
  196. package/dist/dom/reconcile.js.map +7 -0
  197. package/dist/dom/refresh.d.ts +12 -0
  198. package/dist/dom/refresh.js +174 -0
  199. package/dist/dom/refresh.js.map +7 -0
  200. package/dist/dom/resource-hints.d.ts +6 -0
  201. package/dist/dom/resource-hints.js +107 -0
  202. package/dist/dom/resource-hints.js.map +7 -0
  203. package/dist/dom/resource-store.d.ts +13 -0
  204. package/dist/dom/resource-store.js +47 -0
  205. package/dist/dom/resource-store.js.map +7 -0
  206. package/dist/dom/resources.d.ts +1 -0
  207. package/dist/dom/resources.js +46 -0
  208. package/dist/dom/resources.js.map +7 -0
  209. package/dist/dom/retained-effects.d.ts +6 -0
  210. package/dist/dom/retained-effects.js +67 -0
  211. package/dist/dom/retained-effects.js.map +7 -0
  212. package/dist/dom/root-internal.d.ts +11 -0
  213. package/dist/dom/root-internal.js +35 -0
  214. package/dist/dom/root-internal.js.map +7 -0
  215. package/dist/dom/root.d.ts +17 -0
  216. package/dist/dom/root.js +38 -0
  217. package/dist/dom/root.js.map +7 -0
  218. package/dist/dom/synthetic-event.d.ts +1 -0
  219. package/dist/dom/synthetic-event.js +35 -0
  220. package/dist/dom/synthetic-event.js.map +7 -0
  221. package/dist/dom/test-utils.d.ts +1 -0
  222. package/dist/dom/test-utils.js +5 -0
  223. package/dist/dom/test-utils.js.map +7 -0
  224. package/dist/dom/transitions.d.ts +9 -0
  225. package/dist/dom/transitions.js +147 -0
  226. package/dist/dom/transitions.js.map +7 -0
  227. package/dist/dom/tree.d.ts +5 -0
  228. package/dist/dom/tree.js +62 -0
  229. package/dist/dom/tree.js.map +7 -0
  230. package/dist/dom/walk.d.ts +2 -0
  231. package/dist/dom/walk.js +14 -0
  232. package/dist/dom/walk.js.map +7 -0
  233. package/dist/next/client.d.ts +9 -0
  234. package/dist/next/client.js +14 -0
  235. package/dist/next/client.js.map +7 -0
  236. package/dist/next/dev-cache-loader.cjs +13 -0
  237. package/dist/next/index.d.ts +2 -0
  238. package/dist/next/index.js +97 -0
  239. package/dist/next/index.js.map +7 -0
  240. package/dist/next/loader.cjs +10 -0
  241. package/dist/next/react.d.ts +71 -0
  242. package/dist/next/react.js +9 -0
  243. package/dist/next/react.js.map +7 -0
  244. package/dist/react/act.d.ts +3 -0
  245. package/dist/react/act.js +124 -0
  246. package/dist/react/act.js.map +7 -0
  247. package/dist/react/action-scope.d.ts +17 -0
  248. package/dist/react/action-scope.js +60 -0
  249. package/dist/react/action-scope.js.map +7 -0
  250. package/dist/react/activity.d.ts +7 -0
  251. package/dist/react/activity.js +7 -0
  252. package/dist/react/activity.js.map +7 -0
  253. package/dist/react/children.d.ts +8 -0
  254. package/dist/react/children.js +76 -0
  255. package/dist/react/children.js.map +7 -0
  256. package/dist/react/class.d.ts +36 -0
  257. package/dist/react/class.js +39 -0
  258. package/dist/react/class.js.map +7 -0
  259. package/dist/react/compiler-runtime.d.ts +1 -0
  260. package/dist/react/compiler-runtime.js +9 -0
  261. package/dist/react/compiler-runtime.js.map +7 -0
  262. package/dist/react/context.d.ts +32 -0
  263. package/dist/react/context.js +25 -0
  264. package/dist/react/context.js.map +7 -0
  265. package/dist/react/element.d.ts +13 -0
  266. package/dist/react/element.js +70 -0
  267. package/dist/react/element.js.map +7 -0
  268. package/dist/react/form-state.d.ts +26 -0
  269. package/dist/react/form-state.js +30 -0
  270. package/dist/react/form-state.js.map +7 -0
  271. package/dist/react/hooks.d.ts +67 -0
  272. package/dist/react/hooks.js +165 -0
  273. package/dist/react/hooks.js.map +7 -0
  274. package/dist/react/index.d.ts +99 -0
  275. package/dist/react/index.js +143 -0
  276. package/dist/react/index.js.map +7 -0
  277. package/dist/react/jsx-runtime.d.ts +24 -0
  278. package/dist/react/jsx-runtime.js +37 -0
  279. package/dist/react/jsx-runtime.js.map +7 -0
  280. package/dist/react/memo.d.ts +20 -0
  281. package/dist/react/memo.js +27 -0
  282. package/dist/react/memo.js.map +7 -0
  283. package/dist/react/portal.d.ts +1 -0
  284. package/dist/react/portal.js +5 -0
  285. package/dist/react/portal.js.map +7 -0
  286. package/dist/react/shared-internals.d.ts +52 -0
  287. package/dist/react/shared-internals.js +22 -0
  288. package/dist/react/shared-internals.js.map +7 -0
  289. package/dist/react/suspense.d.ts +15 -0
  290. package/dist/react/suspense.js +15 -0
  291. package/dist/react/suspense.js.map +7 -0
  292. package/dist/react/thenable.d.ts +1 -0
  293. package/dist/react/thenable.js +25 -0
  294. package/dist/react/thenable.js.map +7 -0
  295. package/dist/react/view-transition.d.ts +32 -0
  296. package/dist/react/view-transition.js +12 -0
  297. package/dist/react/view-transition.js.map +7 -0
  298. package/dist/scheduler/index.d.ts +44 -0
  299. package/dist/scheduler/index.js +109 -0
  300. package/dist/scheduler/index.js.map +7 -0
  301. package/dist/server/bootstrap-script.d.ts +3 -0
  302. package/dist/server/bootstrap-script.js +17 -0
  303. package/dist/server/bootstrap-script.js.map +7 -0
  304. package/dist/server/dispatcher.d.ts +57 -0
  305. package/dist/server/dispatcher.js +157 -0
  306. package/dist/server/dispatcher.js.map +7 -0
  307. package/dist/server/escape.d.ts +6 -0
  308. package/dist/server/escape.js +75 -0
  309. package/dist/server/escape.js.map +7 -0
  310. package/dist/server/index.d.ts +16 -0
  311. package/dist/server/index.js +25 -0
  312. package/dist/server/index.js.map +7 -0
  313. package/dist/server/insertion-context.d.ts +3 -0
  314. package/dist/server/insertion-context.js +32 -0
  315. package/dist/server/renderToString.d.ts +7 -0
  316. package/dist/server/renderToString.js +33 -0
  317. package/dist/server/renderToString.js.map +7 -0
  318. package/dist/server/resource-hints.d.ts +22 -0
  319. package/dist/server/resource-hints.js +168 -0
  320. package/dist/server/resource-hints.js.map +7 -0
  321. package/dist/server/stream-ids.d.ts +3 -0
  322. package/dist/server/stream-ids.js +8 -0
  323. package/dist/server/stream.d.ts +61 -0
  324. package/dist/server/stream.js +418 -0
  325. package/dist/server/stream.js.map +7 -0
  326. package/dist/server/walk.d.ts +58 -0
  327. package/dist/server/walk.js +378 -0
  328. package/dist/server/walk.js.map +7 -0
  329. package/dist/vinext/compatibility.d.ts +23 -0
  330. package/dist/vinext/compatibility.js +127 -0
  331. package/dist/vinext/compatibility.js.map +7 -0
  332. package/dist/vinext/flight-timing.d.ts +1 -0
  333. package/dist/vinext/flight-timing.js +46 -0
  334. package/dist/vinext/flight-timing.js.map +7 -0
  335. package/dist/vinext/index.d.ts +5 -0
  336. package/dist/vinext/index.js +50 -0
  337. package/dist/vinext/index.js.map +7 -0
  338. package/dist/vite/index.d.ts +102 -0
  339. package/dist/vite/index.js +291 -0
  340. package/dist/vite/index.js.map +7 -0
  341. package/dist/vite/react18.d.ts +4 -0
  342. package/dist/vite/react18.js +74 -0
  343. package/dist/vite/react18.js.map +7 -0
  344. package/package.json +113 -8
  345. package/src/cloudflare/index.ts +44 -0
  346. package/src/core/attributes.ts +20 -0
  347. package/src/core/browser.ts +34 -0
  348. package/src/core/class-props.ts +12 -0
  349. package/src/core/devtools.ts +69 -0
  350. package/src/core/functions.ts +11 -0
  351. package/src/core/index.ts +2 -0
  352. package/src/core/internal.ts +123 -0
  353. package/src/core/resource-hints.ts +39 -0
  354. package/src/core/types.ts +39 -0
  355. package/src/core/unitless-style.ts +1 -0
  356. package/src/dom/_all.ts +46 -0
  357. package/src/dom/client.ts +17 -0
  358. package/src/dom/commit.ts +223 -0
  359. package/src/dom/devtools-effects.ts +78 -0
  360. package/src/dom/devtools.ts +527 -0
  361. package/src/dom/dispatcher.ts +476 -0
  362. package/src/dom/document-metadata.ts +41 -0
  363. package/src/dom/dom.ts +181 -0
  364. package/src/dom/error-info.ts +20 -0
  365. package/src/dom/event-replay.ts +39 -0
  366. package/src/dom/features/activity/full.ts +150 -0
  367. package/src/dom/features/activity/index.ts +1 -0
  368. package/src/dom/features/activity/stub.ts +12 -0
  369. package/src/dom/features/class/full.ts +202 -0
  370. package/src/dom/features/class/index.ts +1 -0
  371. package/src/dom/features/class/stub.ts +58 -0
  372. package/src/dom/features/context/full.ts +107 -0
  373. package/src/dom/features/context/index.ts +1 -0
  374. package/src/dom/features/context/stub.ts +26 -0
  375. package/src/dom/features/forward-ref/full.ts +9 -0
  376. package/src/dom/features/forward-ref/index.ts +1 -0
  377. package/src/dom/features/forward-ref/stub.ts +15 -0
  378. package/src/dom/features/fragment-refs/index.ts +1 -0
  379. package/src/dom/features/fragment-refs/stub.ts +6 -0
  380. package/src/dom/features/hydration/full.ts +563 -0
  381. package/src/dom/features/hydration/index.ts +1 -0
  382. package/src/dom/features/hydration/stub.ts +86 -0
  383. package/src/dom/features/index.ts +12 -0
  384. package/src/dom/features/lazy/full.ts +27 -0
  385. package/src/dom/features/lazy/index.ts +1 -0
  386. package/src/dom/features/lazy/stub.ts +24 -0
  387. package/src/dom/features/memo/full.ts +39 -0
  388. package/src/dom/features/memo/index.ts +1 -0
  389. package/src/dom/features/memo/stub.ts +13 -0
  390. package/src/dom/features/portal/full.ts +14 -0
  391. package/src/dom/features/portal/index.ts +1 -0
  392. package/src/dom/features/portal/stub.ts +11 -0
  393. package/src/dom/features/suspense/full.ts +469 -0
  394. package/src/dom/features/suspense/index.ts +1 -0
  395. package/src/dom/features/suspense/stub.ts +13 -0
  396. package/src/dom/features/suspense-runtime/index.ts +1 -0
  397. package/src/dom/features/suspense-runtime/stub.ts +1 -0
  398. package/src/dom/features/view-transition/full.ts +292 -0
  399. package/src/dom/features/view-transition/index.ts +1 -0
  400. package/src/dom/features/view-transition/resources.ts +123 -0
  401. package/src/dom/features/view-transition/stub.ts +8 -0
  402. package/src/dom/features/view-transition/visual.ts +454 -0
  403. package/src/dom/form-actions.ts +69 -0
  404. package/src/dom/form-controls.ts +91 -0
  405. package/src/dom/fragment-instance.ts +462 -0
  406. package/src/dom/index.ts +49 -0
  407. package/src/dom/portal.ts +16 -0
  408. package/src/dom/react-ids.ts +36 -0
  409. package/src/dom/reconcile.ts +1423 -0
  410. package/src/dom/refresh.ts +171 -0
  411. package/src/dom/resource-hints.ts +104 -0
  412. package/src/dom/resource-store.ts +50 -0
  413. package/src/dom/resources.ts +47 -0
  414. package/src/dom/retained-effects.ts +57 -0
  415. package/src/dom/root-internal.ts +37 -0
  416. package/src/dom/root.ts +59 -0
  417. package/src/dom/synthetic-event.ts +22 -0
  418. package/src/dom/test-utils.ts +1 -0
  419. package/src/dom/transitions.ts +141 -0
  420. package/src/dom/tree.ts +56 -0
  421. package/src/dom/walk.ts +8 -0
  422. package/src/next/client.ts +10 -0
  423. package/src/next/dev-cache-loader.cjs +13 -0
  424. package/src/next/index.ts +95 -0
  425. package/src/next/loader.cjs +10 -0
  426. package/src/next/react.ts +7 -0
  427. package/src/react/act.ts +105 -0
  428. package/src/react/action-scope.ts +57 -0
  429. package/src/react/activity.ts +10 -0
  430. package/src/react/children.ts +86 -0
  431. package/src/react/class.ts +66 -0
  432. package/src/react/compiler-runtime.ts +8 -0
  433. package/src/react/context.ts +46 -0
  434. package/src/react/element.ts +82 -0
  435. package/src/react/form-state.ts +35 -0
  436. package/src/react/hooks.ts +214 -0
  437. package/src/react/index.ts +91 -0
  438. package/src/react/jsx-runtime.ts +50 -0
  439. package/src/react/memo.ts +42 -0
  440. package/src/react/portal.ts +1 -0
  441. package/src/react/shared-internals.ts +80 -0
  442. package/src/react/suspense.ts +18 -0
  443. package/src/react/thenable.ts +21 -0
  444. package/src/react/view-transition.ts +41 -0
  445. package/src/scheduler/index.ts +124 -0
  446. package/src/server/bootstrap-script.ts +92 -0
  447. package/src/server/dispatcher.ts +168 -0
  448. package/src/server/escape.ts +102 -0
  449. package/src/server/index.ts +26 -0
  450. package/src/server/insertion-context.ts +28 -0
  451. package/src/server/renderToString.ts +35 -0
  452. package/src/server/resource-hints.ts +166 -0
  453. package/src/server/stream-ids.ts +5 -0
  454. package/src/server/stream.ts +525 -0
  455. package/src/server/walk.ts +555 -0
  456. package/src/vinext/compatibility.ts +122 -0
  457. package/src/vinext/flight-timing.ts +37 -0
  458. package/src/vinext/index.ts +47 -0
  459. package/src/vite/index.ts +476 -0
  460. package/src/vite/react18.ts +74 -0
  461. package/vendor/cloudflare-vite-plugin/LICENSE +25 -0
  462. package/vendor/cloudflare-vite-plugin/README.md +9 -0
  463. package/vendor/cloudflare-vite-plugin/dist/chunk-U6NEESU5-BmLHqeIt.mjs +43 -0
  464. package/vendor/cloudflare-vite-plugin/dist/index.d.mts +155 -0
  465. package/vendor/cloudflare-vite-plugin/dist/index.mjs +94700 -0
  466. package/vendor/cloudflare-vite-plugin/dist/open-PCXX3ZDZ-DYH87NhH.mjs +530 -0
  467. package/vendor/cloudflare-vite-plugin/dist/package-4cnqy5mM.mjs +84 -0
  468. package/vendor/cloudflare-vite-plugin/dist/workers/asset-worker/index.js +5996 -0
  469. package/vendor/cloudflare-vite-plugin/dist/workers/router-worker/index.js +6414 -0
  470. package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/index.js +457 -0
  471. package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner-legacy.js +1129 -0
  472. package/vendor/cloudflare-vite-plugin/dist/workers/runner-worker/module-runner.js +1259 -0
  473. package/vendor/cloudflare-vite-plugin/dist/workers/vite-proxy-worker/index.js +31 -0
  474. package/vendor/cloudflare-vite-plugin/package.json +90 -0
  475. package/vendor/cloudflare-vite-plugin/provenance.json +26 -0
  476. package/README.md +0 -3
@@ -0,0 +1,462 @@
1
+ import { isString } from "../core/functions";
2
+ import { findRoot, getCurrentRoot, isActivityHidden, attachRef, detachRef, invokeCommit, type LayoutCommit } from './reconcile';
3
+ import { FiberTag, REACT_FRAGMENT_TYPE, type Fiber, type FiberRoot } from '../core';
4
+ import { isObject } from '../core/functions';
5
+ type Listener = EventListenerOrEventListenerObject;
6
+ type Observer = IntersectionObserver | ResizeObserver;
7
+ type OwnedNode = Node & {
8
+ reactFragments?: Set<FragmentInstance>;
9
+ };
10
+ type Registration = {
11
+ t: string;
12
+ l: Listener;
13
+ a: Listener;
14
+ c: boolean;
15
+ o: AddEventListenerOptions;
16
+ d?: () => void;
17
+ };
18
+ const instances = new WeakMap<FiberRoot, Set<FragmentInstance>>();
19
+ function siblings(fiber: Fiber, parent: Fiber | null): [
20
+ Node | null,
21
+ Node | null
22
+ ] {
23
+ let previous: Node | null = null;
24
+ let next: Node | null = null;
25
+ let found = false;
26
+ function visit(parent: Fiber): void {
27
+ for (let child = parent.c; child && !next; child = child.s) {
28
+ if (child === fiber)
29
+ found = true;
30
+ else if (child.t <= FiberTag.Text) {
31
+ if (found)
32
+ next = node(child);
33
+ else
34
+ previous = node(child);
35
+ }
36
+ else if (!isActivityHidden(child))
37
+ visit(child);
38
+ }
39
+ }
40
+ if (parent)
41
+ visit(parent);
42
+ return [previous, next];
43
+ }
44
+ const node = (fiber: Fiber): Node => (fiber.t === FiberTag.Root ? fiber.r!.c : fiber.n!);
45
+ function containsFiber(parent: Fiber, child: Fiber | null): boolean {
46
+ for (; child; child = child.p)
47
+ if (child === parent)
48
+ return true;
49
+ return false;
50
+ }
51
+ export function placeFragmentCommits(fiber: Fiber, entries: LayoutCommit[], pendingCommits: LayoutCommit[]): boolean | void {
52
+ if (fiber.type !== REACT_FRAGMENT_TYPE)
53
+ return;
54
+ // React attaches Fragment refs before their descendants. Only referenced
55
+ // Fragments need to locate this insertion point among queued commits.
56
+ let index = pendingCommits.findIndex(([child]) => containsFiber(fiber, child.p));
57
+ if (index < 0)
58
+ index = pendingCommits.length;
59
+ if (index < pendingCommits.length && currentCommit?.c.length) {
60
+ const count = entries.length;
61
+ onCommitRollback(() => { pendingCommits.splice(index, count); });
62
+ }
63
+ pendingCommits.splice(index, 0, ...entries);
64
+ return true;
65
+ }
66
+ export class FragmentInstance {
67
+ #nodes = new Set<OwnedNode>();
68
+ #listeners: Registration[] = [];
69
+ #observers = new Set<Observer>();
70
+ #pending = new Map<Observer, Set<Element>>();
71
+ #children: Node[] = [];
72
+ #ordered: Fiber[] = [];
73
+ #parent: Node | null = null;
74
+ #adjacent: [
75
+ Node | null,
76
+ Node | null
77
+ ] = [null, null];
78
+ #portalContainer: Node | null = null;
79
+ #fiber: Fiber;
80
+ constructor(fiber: Fiber) { this.#fiber = fiber; }
81
+ refresh(ordered: Fiber[]): void {
82
+ this.#children = hosts(this.#fiber).map(node);
83
+ let parent = this.#fiber.p;
84
+ this.#portalContainer = null;
85
+ for (; parent; parent = parent.p) {
86
+ if (parent.t === FiberTag.Host || parent.t === FiberTag.Root)
87
+ break;
88
+ if (parent.t === FiberTag.Portal && !this.#portalContainer)
89
+ this.#portalContainer = parent.m.container;
90
+ }
91
+ this.#parent = parent && node(parent);
92
+ this.#adjacent = siblings(this.#fiber, parent);
93
+ this.#ordered = ordered;
94
+ const current = new Set(this.#children);
95
+ for (const child of this.#nodes)
96
+ if (!current.has(child))
97
+ this.update(child, false);
98
+ for (const child of current)
99
+ this.update(child, true);
100
+ }
101
+ /** Renderer hook, called only for first-level host insertion/removal. */
102
+ update(child: OwnedNode, adding: boolean): void {
103
+ if (adding === this.#nodes.has(child))
104
+ return;
105
+ if (adding) {
106
+ this.#nodes.add(child);
107
+ (child.reactFragments ??= new Set()).add(this);
108
+ }
109
+ else {
110
+ this.#nodes.delete(child);
111
+ child.reactFragments?.delete(this);
112
+ }
113
+ for (const entry of this.#listeners) {
114
+ if (adding)
115
+ child.addEventListener(entry.t, entry.a, entry.o);
116
+ else
117
+ child.removeEventListener(entry.t, entry.a, entry.c);
118
+ }
119
+ if (child.nodeType !== 1)
120
+ return;
121
+ for (const observer of this.#observers) {
122
+ if (adding) {
123
+ this.#pending.get(observer)?.delete(child as Element);
124
+ observer.observe(child as Element);
125
+ }
126
+ else if (isString((observer as IntersectionObserver).rootMargin)) {
127
+ let pending = this.#pending.get(observer);
128
+ if (!pending) {
129
+ this.#pending.set(observer, pending = new Set());
130
+ const flush = () => {
131
+ for (const element of pending!)
132
+ observer.unobserve(element);
133
+ if (this.#pending.get(observer) === pending)
134
+ this.#pending.delete(observer);
135
+ };
136
+ const frame = child.ownerDocument?.defaultView?.requestAnimationFrame;
137
+ if (frame)
138
+ frame(() => frame(flush));
139
+ else
140
+ queueMicrotask(flush);
141
+ }
142
+ pending.add(child as Element);
143
+ }
144
+ else
145
+ observer.unobserve(child as Element);
146
+ }
147
+ }
148
+ addEventListener(type: string, listener: Listener | null, options?: boolean | AddEventListenerOptions): void {
149
+ if (!listener)
150
+ return;
151
+ const opts = typeof options === 'boolean' ? { capture: options } : options ?? {};
152
+ const capture = !!opts.capture;
153
+ if (opts.signal?.aborted || this.#listeners.some((entry) => entry.t === type && entry.l === listener && entry.c === capture))
154
+ return;
155
+ const instance = this;
156
+ const entry: Registration = {
157
+ t: type, l: listener, c: capture,
158
+ o: opts.passive === undefined ? { capture } : { capture, passive: opts.passive },
159
+ a: opts.once ? function (this: EventTarget, event: Event) {
160
+ instance.removeEventListener(type, listener, capture);
161
+ if (isFunction(listener))
162
+ listener.call(this, event);
163
+ else
164
+ listener.handleEvent(event);
165
+ } : listener,
166
+ };
167
+ if (opts.signal) {
168
+ const abort = () => this.removeEventListener(type, listener, capture);
169
+ opts.signal.addEventListener('abort', abort, { once: true });
170
+ entry.d = () => opts.signal!.removeEventListener('abort', abort);
171
+ }
172
+ this.#listeners.push(entry);
173
+ for (const child of this.#nodes)
174
+ child.addEventListener(type, entry.a, entry.o);
175
+ }
176
+ removeEventListener(type: string, listener: Listener | null, options?: boolean | EventListenerOptions): void {
177
+ const capture = typeof options === 'boolean' ? options : !!options?.capture;
178
+ const index = this.#listeners.findIndex((entry) => entry.t === type && entry.l === listener && entry.c === capture);
179
+ if (index < 0)
180
+ return;
181
+ const entry = this.#listeners.splice(index, 1)[0]!;
182
+ for (const child of this.#nodes)
183
+ child.removeEventListener(type, entry.a, capture);
184
+ entry.d?.();
185
+ }
186
+ dispatchEvent(event: Event): boolean {
187
+ const parent = !this.#fiber.u && this.#parent;
188
+ if (!parent)
189
+ return true;
190
+ const target = parent;
191
+ if (!this.#listeners.length && event.bubbles)
192
+ return target.dispatchEvent(event);
193
+ const document = (target.ownerDocument || target) as Document;
194
+ const temporary = target.nodeType === 9 ? document.createComment('') : document.createTextNode('');
195
+ for (const entry of this.#listeners)
196
+ temporary.addEventListener(entry.t, entry.a, entry.o);
197
+ target.appendChild(temporary);
198
+ try {
199
+ return temporary.dispatchEvent(event);
200
+ }
201
+ finally {
202
+ temporary.remove();
203
+ }
204
+ }
205
+ #focusChild(last: boolean, options?: FocusOptions): void {
206
+ // Parent links survive reconciliation. Filter the committed root order,
207
+ // not the work-in-progress child pointers, when focus is actually used.
208
+ const children = this.#ordered.filter(child => containsFiber(this.#fiber, child));
209
+ if (last)
210
+ children.reverse();
211
+ for (const child of children) {
212
+ if (child.t === FiberTag.Text)
213
+ continue;
214
+ const element = child.n as HTMLElement;
215
+ if (element.ownerDocument.activeElement === element)
216
+ return;
217
+ let focused = false;
218
+ const handleFocus = () => { focused = true; };
219
+ element.ownerDocument.addEventListener('focus', handleFocus, true);
220
+ try {
221
+ (element.focus ?? HTMLElement.prototype.focus).call(element, options);
222
+ }
223
+ finally {
224
+ element.ownerDocument.removeEventListener('focus', handleFocus, true);
225
+ }
226
+ if (focused)
227
+ return;
228
+ }
229
+ }
230
+ focus(options?: FocusOptions): void { this.#focusChild(false, options); }
231
+ focusLast(options?: FocusOptions): void { this.#focusChild(true, options); }
232
+ blur(): void {
233
+ const parent = this.#parent;
234
+ const active = parent && (parent.ownerDocument ?? parent as Document).activeElement as HTMLElement | null;
235
+ if (active && this.#children.some((child) => child.contains(active)))
236
+ active.blur();
237
+ }
238
+ observeUsing(observer: Observer): void {
239
+ this.#observers.add(observer);
240
+ for (const child of this.#nodes)
241
+ if (child.nodeType === 1)
242
+ observer.observe(child as Element);
243
+ }
244
+ unobserveUsing(observer: Observer): void {
245
+ if (!this.#observers.delete(observer))
246
+ return;
247
+ for (const child of this.#nodes)
248
+ if (child.nodeType === 1)
249
+ observer.unobserve(child as Element);
250
+ for (const child of this.#pending.get(observer) ?? [])
251
+ observer.unobserve(child);
252
+ this.#pending.get(observer)?.clear();
253
+ this.#pending.delete(observer);
254
+ }
255
+ getClientRects(): DOMRect[] {
256
+ const rects: DOMRect[] = [];
257
+ for (const child of this.#children) {
258
+ if (child.nodeType === 3) {
259
+ const range = child.ownerDocument!.createRange();
260
+ range.selectNodeContents(child);
261
+ rects.push(...range.getClientRects());
262
+ }
263
+ else
264
+ rects.push(...(child as Element).getClientRects());
265
+ }
266
+ return rects;
267
+ }
268
+ getRootNode(options?: GetRootNodeOptions): Node | FragmentInstance {
269
+ const parent = !this.#fiber.u && this.#parent;
270
+ return parent ? parent.getRootNode(options) : this;
271
+ }
272
+ compareDocumentPosition(other: Node): number {
273
+ const parent = !this.#fiber.u && this.#parent;
274
+ if (!parent)
275
+ return 1;
276
+ const children = this.#children;
277
+ let parentNode = parent;
278
+ if (!children.length) {
279
+ if (this.#portalContainer)
280
+ parentNode = this.#portalContainer;
281
+ let result = parentNode.compareDocumentPosition(other);
282
+ if (parentNode === other)
283
+ result = 8;
284
+ else if (result & 16) {
285
+ const following = this.#adjacent[1];
286
+ const position = following && following.compareDocumentPosition(other);
287
+ result = following && (position === 0 || position! & 4) ? 4 : 2;
288
+ }
289
+ return result | 32;
290
+ }
291
+ const first = children[0]!;
292
+ const last = children[children.length - 1]!;
293
+ if (this.#portalContainer)
294
+ parentNode = first.parentNode!;
295
+ if (!parentNode)
296
+ return 1;
297
+ const firstContained = parentNode.compareDocumentPosition(first) & 16;
298
+ const lastContained = parentNode.compareDocumentPosition(last) & 16;
299
+ const firstPosition = first.compareDocumentPosition(other);
300
+ const lastPosition = last.compareDocumentPosition(other);
301
+ const result = (firstContained && first === other) || (lastContained && last === other) ||
302
+ (firstPosition & 16) || (lastPosition & 16) ||
303
+ (firstContained && lastContained && (firstPosition & 4) && (lastPosition & 2)) ? 16 :
304
+ (!firstContained && first === other) || (!lastContained && last === other) ? 32 : firstPosition;
305
+ if (result & 33)
306
+ return result;
307
+ const ordered = this.#ordered;
308
+ let otherFiber: Fiber | undefined;
309
+ for (let target: Node | null = other; target && !otherFiber; target = target.parentNode) {
310
+ otherFiber = ordered.find((fiber) => fiber.n === target);
311
+ }
312
+ if (result & 16)
313
+ return containsFiber(this.#fiber, otherFiber ?? null) ? result : 32;
314
+ if (result & 8)
315
+ return otherFiber || other === other.ownerDocument || other === other.ownerDocument?.documentElement || other === other.ownerDocument?.body ? result : 32;
316
+ if (!otherFiber)
317
+ return 32;
318
+ const otherIndex = ordered.indexOf(otherFiber);
319
+ return ((result & 2) && otherIndex <= ordered.findIndex(fiber => fiber.n === first)) ||
320
+ ((result & 4) && otherIndex >= ordered.findIndex(fiber => fiber.n === last)) ? result : 32;
321
+ }
322
+ scrollIntoView(alignToTop?: boolean): void {
323
+ if (isObject(alignToTop))
324
+ throw new Error(process.env.NODE_ENV !== 'production' ? 'FragmentInstance.scrollIntoView expects a boolean, not an options object.' : '');
325
+ if (this.#fiber.u)
326
+ return;
327
+ const children = this.#children.slice();
328
+ const top = alignToTop !== false;
329
+ if (!children.length) {
330
+ const [previous, next] = this.#adjacent;
331
+ const fallback = top ? next ?? previous ?? this.#parent : previous ?? next;
332
+ if (fallback)
333
+ children.push(fallback);
334
+ }
335
+ if (top)
336
+ children.reverse();
337
+ for (const target of children) {
338
+ if (target.nodeType === 3) {
339
+ const range = target.ownerDocument!.createRange();
340
+ range.selectNodeContents(target);
341
+ const rect = range.getBoundingClientRect();
342
+ const window = target.ownerDocument!.defaultView!;
343
+ window.scrollTo(window.scrollX + rect.left, window.scrollY + (top ? rect.top : rect.bottom - window.innerHeight));
344
+ }
345
+ else if (target.nodeType === 11) {
346
+ ;
347
+ (target as ShadowRoot).host?.scrollIntoView(alignToTop);
348
+ }
349
+ else if (target.nodeType !== 9)
350
+ (target as Element).scrollIntoView(alignToTop);
351
+ }
352
+ }
353
+ dispose(): void {
354
+ for (const child of this.#nodes)
355
+ this.update(child, false);
356
+ for (const entry of this.#listeners)
357
+ entry.d?.();
358
+ this.#listeners = [];
359
+ this.#children = [];
360
+ this.#ordered = [];
361
+ this.#parent = null;
362
+ const root = this.#fiber.r ?? findRoot(this.#fiber);
363
+ if (root)
364
+ instances.get(root)?.delete(this);
365
+ }
366
+ }
367
+ export function refreshFragmentInstances(root: FiberRoot): void {
368
+ if (!root.fr)
369
+ return;
370
+ const registered = instances.get(root);
371
+ if (!registered?.size)
372
+ return;
373
+ queueMutation(() => {
374
+ if (!registered.size)
375
+ return;
376
+ const ordered = hosts(root.r, true);
377
+ for (const instance of registered)
378
+ instance.refresh(ordered);
379
+ });
380
+ }
381
+ export function createFragmentInstance(fiber: Fiber): FragmentInstance {
382
+ const root = fiber.r ?? findRoot(fiber);
383
+ if (root)
384
+ root.fr = true;
385
+ const instance = new FragmentInstance(fiber);
386
+ if (root) {
387
+ let registered = instances.get(root);
388
+ if (!registered)
389
+ instances.set(root, registered = new Set());
390
+ registered.add(instance);
391
+ onCommitRollback(() => { registered.delete(instance); });
392
+ onCommitFailure(() => { registered.delete(instance); });
393
+ }
394
+ return instance;
395
+ }
396
+ export function updateFragmentHost(fiber: Fiber, adding: boolean): void {
397
+ if (!(fiber.r ?? getCurrentRoot() ?? findRoot(fiber))?.fr || !fiber.n)
398
+ return;
399
+ const dom = fiber.n;
400
+ queueMutation(() => {
401
+ for (let parent = fiber.p; parent; parent = parent.p) {
402
+ if (adding && isActivityHidden(parent))
403
+ break;
404
+ if (parent.t === FiberTag.Fragment && parent.i instanceof FragmentInstance)
405
+ parent.i.update(dom, adding);
406
+ if (parent.t === FiberTag.Host || parent.t === FiberTag.Root)
407
+ break;
408
+ }
409
+ });
410
+ }
411
+ function hosts(fiber: Fiber, deep?: boolean, result: Fiber[] = []): Fiber[] {
412
+ for (let child = fiber.c; child; child = child.s) {
413
+ if (child.u || isActivityHidden(child))
414
+ continue;
415
+ const host = child.t <= FiberTag.Text;
416
+ if (host)
417
+ result.push(child);
418
+ if (!host || deep)
419
+ hosts(child, deep, result);
420
+ }
421
+ if (deep && fiber.t === FiberTag.Suspense && fiber.b?.f)
422
+ hosts(fiber.b.f, true, result);
423
+ return result;
424
+ }
425
+ // 0 synchronizes the ref, 1 runs cleanup, 2 disposes the unmounted instance.
426
+ export function commitFragmentRef(fiber: Fiber, phase = 0): void {
427
+ if (fiber.type !== REACT_FRAGMENT_TYPE)
428
+ return;
429
+ if (!phase) {
430
+ if (fiber.ref && !fiber.i)
431
+ fiber.i = createFragmentInstance(fiber);
432
+ const previous = fiber.b?.ref;
433
+ if (previous !== fiber.ref) {
434
+ if (fiber.e) {
435
+ const cleanups = fiber.e;
436
+ queueMutation(() => {
437
+ for (const cleanup of cleanups)
438
+ invokeCommit(fiber, cleanup);
439
+ });
440
+ fiber.e = null;
441
+ }
442
+ detachRef(previous, fiber);
443
+ fiber.b = { ...fiber.b, ref: fiber.ref };
444
+ if (fiber.i)
445
+ attachRef(fiber, fiber.i);
446
+ }
447
+ }
448
+ else if (fiber.i) {
449
+ if (phase === 2)
450
+ fiber.i.dispose();
451
+ else {
452
+ if (fiber.e) {
453
+ for (const cleanup of fiber.e)
454
+ invokeCommit(fiber, cleanup);
455
+ fiber.e = null;
456
+ }
457
+ detachRef(fiber.cr ?? fiber.ref, fiber);
458
+ }
459
+ }
460
+ }
461
+ import { onCommitFailure, onCommitRollback, queueMutation, currentCommit } from './commit';
462
+ import { isFunction } from '../core/functions';
@@ -0,0 +1,49 @@
1
+ import { requestFormReset } from './form-actions';
2
+ export { createPortal } from './portal';
3
+ import { createPortal } from './portal';
4
+ import { browser } from '../core/browser';
5
+ export type { BrowserToken } from '../core/browser';
6
+ import { preconnect, prefetchDNS, preload, preinit, preloadModule, preinitModule } from './resource-hints';
7
+ import { useFormStatus, useActionState as useFormState } from '../react/hooks';
8
+ export { flushSync, batchedUpdates as unstable_batchedUpdates } from './root';
9
+ import { flushSync, batchedUpdates } from './root';
10
+ export { browser } from '../core/browser';
11
+ import { findDOMNode } from './features/class';
12
+ // Root entry points register renderers. These DOM utilities can also run alone,
13
+ // so importing them must not eagerly install every optional renderer.
14
+ export { preconnect, prefetchDNS, preload, preinit, preloadModule, preinitModule };
15
+ export const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = {
16
+ d: {
17
+ f() { },
18
+ r: requestFormReset,
19
+ D: prefetchDNS,
20
+ C(href: string, crossOrigin?: string) { preconnect(href, { crossOrigin }); },
21
+ L(href: string, as: string, options?: any) { preload(href, { ...options, as }); },
22
+ m: preloadModule,
23
+ X(href: string, options?: any) { preinit(href, { ...options, as: 'script' }); },
24
+ S(href: string, precedence?: string, options?: any) { preinit(href, { ...options, as: 'style', precedence }); },
25
+ M: preinitModule,
26
+ },
27
+ p: 0,
28
+ findDOMNode,
29
+ };
30
+ export const version = '19.2.3';
31
+ // Required by React's default export consumers
32
+ export default {
33
+ useFormStatus,
34
+ useFormState,
35
+ requestFormReset,
36
+ flushSync,
37
+ unstable_batchedUpdates: batchedUpdates,
38
+ createPortal,
39
+ browser,
40
+ preconnect,
41
+ prefetchDNS,
42
+ preload,
43
+ preinit,
44
+ preloadModule,
45
+ preinitModule,
46
+ __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
47
+ version: '19.2.3',
48
+ };
49
+ export { useFormStatus, useFormState, requestFormReset };
@@ -0,0 +1,16 @@
1
+ import type { ReactNode, ReactElement } from '../core'
2
+ import { REACT_PORTAL_TYPE } from '../react'
3
+
4
+ export function createPortal(
5
+ children: ReactNode,
6
+ container: Element | DocumentFragment,
7
+ key: string | null = null,
8
+ ): ReactElement {
9
+ return {
10
+ $$typeof: REACT_PORTAL_TYPE as any,
11
+ type: REACT_PORTAL_TYPE as any,
12
+ key: key == null ? null : '' + key,
13
+ ref: null,
14
+ props: { children, container },
15
+ }
16
+ }
@@ -0,0 +1,36 @@
1
+ import type { Fiber, FiberRoot } from '../core';
2
+ // React SSR encodes the original child slots, including empty slots, into IDs.
3
+ // Redact SSR uses the same tree slots so suspended render order cannot change IDs.
4
+ let clientId = 0;
5
+ export const leadingBit = (tree: bigint): bigint => 1n << BigInt(tree.toString(2).length - 1);
6
+ export function forkId(base: bigint, count: number, index: number): bigint {
7
+ const bit = leadingBit(base);
8
+ return (bit << BigInt(32 - Math.clz32(count))) | (BigInt(index + 1) * bit) | (base ^ bit);
9
+ }
10
+ export function assignReactIds(parent: Fiber, children: object): void {
11
+ const paths = (children as {
12
+ ip?: bigint[];
13
+ }).ip;
14
+ if (!paths)
15
+ return;
16
+ let base = parent.it ?? 1n;
17
+ if (parent.im)
18
+ base = forkId(base, 1, 0);
19
+ const bit = leadingBit(base);
20
+ let index = 0;
21
+ for (let child = parent.c; child; child = child.s) {
22
+ const path = paths[child.ix ?? index++] ?? 1n;
23
+ child.it = (path * bit) | (base ^ bit);
24
+ }
25
+ }
26
+ export function reactId(fiber: Fiber, root: FiberRoot): string {
27
+ if (!root.h)
28
+ return clientReactId(root);
29
+ fiber.im = true;
30
+ const local = fiber.il ?? 0;
31
+ fiber.il = local + 1;
32
+ const tree = fiber.it ?? 1n;
33
+ const id = (tree ^ leadingBit(tree)).toString(32);
34
+ return '_' + (root.i ?? '') + 'R_' + id + (local ? 'H' + local.toString(32) : '') + '_';
35
+ }
36
+ export const clientReactId = (root: FiberRoot): string => ('_' + (root.i ?? '') + 'r_' + (clientId++).toString(32) + '_');