one 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1420) hide show
  1. package/One.podspec +14 -0
  2. package/android/src/main/java/com/margelo/nitro/one/OneUpdatesLauncher.kt +28 -0
  3. package/android/src/main/java/dev/onejs/one/OnePackage.kt +2 -0
  4. package/android/src/main/java/dev/onejs/onenative/OneDOMHostManager.kt +85 -0
  5. package/android/src/main/java/dev/onejs/onenative/OneDOMHostView.kt +399 -0
  6. package/android/src/main/java/dev/onejs/onenative/OneDOMResources.kt +126 -0
  7. package/dist/cjs/cli/iosLinkSet.cjs +111 -0
  8. package/dist/cjs/cli/iosLinkSet.native.cjs +120 -0
  9. package/dist/cjs/cli/iosLinkSet.native.js +122 -0
  10. package/dist/cjs/cli/iosLinkSet.native.js.map +1 -0
  11. package/dist/cjs/cli/iosLinkSetAnalysis.cjs +329 -0
  12. package/dist/cjs/cli/iosLinkSetAnalysis.native.cjs +714 -0
  13. package/dist/cjs/cli/iosLinkSetAnalysis.native.js +716 -0
  14. package/dist/cjs/cli/iosLinkSetAnalysis.native.js.map +1 -0
  15. package/dist/cjs/cli/prebuild.cjs +5 -1
  16. package/dist/cjs/cli/prebuild.native.cjs +4 -2
  17. package/dist/cjs/cli/prebuild.native.js +4 -2
  18. package/dist/cjs/cli/prebuild.native.js.map +1 -1
  19. package/dist/cjs/cli/updatesPublish.cjs +16 -12
  20. package/dist/cjs/cli/updatesPublish.native.cjs +45 -22
  21. package/dist/cjs/cli/updatesPublish.native.js +45 -22
  22. package/dist/cjs/cli/updatesPublish.native.js.map +1 -1
  23. package/dist/cjs/cli.cjs +4 -2
  24. package/dist/cjs/cli.native.cjs +4 -2
  25. package/dist/cjs/cli.native.js +4 -2
  26. package/dist/cjs/cli.native.js.map +1 -1
  27. package/dist/cjs/createApp.cjs +8 -0
  28. package/dist/cjs/createHandleRequest.cjs +4 -17
  29. package/dist/cjs/createHandleRequest.native.cjs +6 -19
  30. package/dist/cjs/createHandleRequest.native.js +6 -19
  31. package/dist/cjs/createHandleRequest.native.js.map +1 -1
  32. package/dist/cjs/dom/browserBridge.cjs +177 -0
  33. package/dist/cjs/dom/browserBridge.native.cjs +290 -0
  34. package/dist/cjs/dom/browserBridge.native.js +292 -0
  35. package/dist/cjs/dom/browserBridge.native.js.map +1 -0
  36. package/dist/cjs/dom/client.cjs +69 -0
  37. package/dist/cjs/dom/client.native.cjs +81 -0
  38. package/dist/cjs/dom/client.native.js +83 -0
  39. package/dist/cjs/dom/client.native.js.map +1 -0
  40. package/dist/cjs/dom/context.cjs +25 -0
  41. package/dist/cjs/dom/context.native.cjs +27 -0
  42. package/dist/cjs/dom/context.native.js +29 -0
  43. package/dist/cjs/dom/context.native.js.map +1 -0
  44. package/dist/cjs/dom/host.native.cjs +152 -0
  45. package/dist/cjs/dom/host.native.js +154 -0
  46. package/dist/cjs/dom/host.native.js.map +1 -0
  47. package/dist/cjs/dom/index.cjs +88 -0
  48. package/dist/cjs/dom/index.native.cjs +136 -0
  49. package/dist/cjs/dom/index.native.js +138 -0
  50. package/dist/cjs/dom/index.native.js.map +1 -0
  51. package/dist/cjs/dom/measure.cjs +51 -0
  52. package/dist/cjs/dom/measure.native.cjs +55 -0
  53. package/dist/cjs/dom/measure.native.js +57 -0
  54. package/dist/cjs/dom/measure.native.js.map +1 -0
  55. package/dist/cjs/dom/nativeBridge.cjs +135 -0
  56. package/dist/cjs/dom/nativeBridge.native.cjs +223 -0
  57. package/dist/cjs/dom/nativeBridge.native.js +225 -0
  58. package/dist/cjs/dom/nativeBridge.native.js.map +1 -0
  59. package/dist/cjs/dom/peer.cjs +148 -0
  60. package/dist/cjs/dom/peer.native.cjs +227 -0
  61. package/dist/cjs/dom/peer.native.js +229 -0
  62. package/dist/cjs/dom/peer.native.js.map +1 -0
  63. package/dist/cjs/dom/protocol.cjs +185 -0
  64. package/dist/cjs/dom/protocol.native.cjs +209 -0
  65. package/dist/cjs/dom/protocol.native.js +211 -0
  66. package/dist/cjs/dom/protocol.native.js.map +1 -0
  67. package/dist/cjs/dom/serialize.cjs +140 -0
  68. package/dist/cjs/dom/serialize.native.cjs +284 -0
  69. package/dist/cjs/dom/serialize.native.js +286 -0
  70. package/dist/cjs/dom/serialize.native.js.map +1 -0
  71. package/dist/cjs/dom/types.cjs +16 -0
  72. package/dist/cjs/dom/types.native.cjs +18 -0
  73. package/dist/cjs/dom/types.native.js +20 -0
  74. package/dist/cjs/dom/types.native.js.map +1 -0
  75. package/dist/cjs/fork/getPathFromState.cjs +9 -1
  76. package/dist/cjs/fork/getPathFromState.native.cjs +48 -4
  77. package/dist/cjs/fork/getPathFromState.native.js +48 -4
  78. package/dist/cjs/fork/getPathFromState.native.js.map +1 -1
  79. package/dist/cjs/hooks.cjs +50 -1
  80. package/dist/cjs/hooks.native.cjs +55 -2
  81. package/dist/cjs/hooks.native.js +55 -2
  82. package/dist/cjs/hooks.native.js.map +1 -1
  83. package/dist/cjs/index.cjs +2 -0
  84. package/dist/cjs/index.native.cjs +2 -0
  85. package/dist/cjs/index.native.js +2 -0
  86. package/dist/cjs/index.native.js.map +1 -1
  87. package/dist/cjs/layouts/Tabs.linux.cjs +48 -0
  88. package/dist/cjs/layouts/Tabs.linux.native.cjs +50 -0
  89. package/dist/cjs/layouts/Tabs.linux.native.js +52 -0
  90. package/dist/cjs/layouts/Tabs.linux.native.js.map +1 -0
  91. package/dist/cjs/layouts/stack-navigator-desktop.cjs +26 -0
  92. package/dist/cjs/layouts/stack-navigator-desktop.native.cjs +28 -0
  93. package/dist/cjs/layouts/stack-navigator-desktop.native.js +30 -0
  94. package/dist/cjs/layouts/stack-navigator-desktop.native.js.map +1 -0
  95. package/dist/cjs/layouts/stack-navigator.linux.cjs +39 -0
  96. package/dist/cjs/layouts/stack-navigator.linux.native.cjs +41 -0
  97. package/dist/cjs/layouts/stack-navigator.linux.native.js +43 -0
  98. package/dist/cjs/layouts/stack-navigator.linux.native.js.map +1 -0
  99. package/dist/cjs/layouts/stack-navigator.macos.cjs +29 -0
  100. package/dist/cjs/layouts/stack-navigator.macos.native.cjs +31 -0
  101. package/dist/cjs/layouts/stack-navigator.macos.native.js +33 -0
  102. package/dist/cjs/layouts/stack-navigator.macos.native.js.map +1 -0
  103. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.linux.cjs +18 -0
  104. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.linux.native.cjs +20 -0
  105. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.linux.native.js +22 -0
  106. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.linux.native.js.map +1 -0
  107. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.macos.cjs +30 -0
  108. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.macos.native.cjs +33 -0
  109. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.macos.native.js +35 -0
  110. package/dist/cjs/layouts/stack-utils/StackToolbarBottomHost.macos.native.js.map +1 -0
  111. package/dist/cjs/link/Link.cjs +4 -3
  112. package/dist/cjs/link/Link.native.cjs +4 -3
  113. package/dist/cjs/link/Link.native.js +4 -3
  114. package/dist/cjs/link/Link.native.js.map +1 -1
  115. package/dist/cjs/loaderResponseToModule.cjs +41 -0
  116. package/dist/cjs/loaderResponseToModule.native.cjs +44 -0
  117. package/dist/cjs/loaderResponseToModule.native.js +46 -0
  118. package/dist/cjs/loaderResponseToModule.native.js.map +1 -0
  119. package/dist/cjs/loaderSearchParams.cjs +99 -0
  120. package/dist/cjs/loaderSearchParams.native.cjs +139 -0
  121. package/dist/cjs/loaderSearchParams.native.js +141 -0
  122. package/dist/cjs/loaderSearchParams.native.js.map +1 -0
  123. package/dist/cjs/one-shared.cjs +129 -0
  124. package/dist/cjs/one-shared.native.cjs +132 -0
  125. package/dist/cjs/one-shared.native.js +134 -0
  126. package/dist/cjs/one-shared.native.js.map +1 -0
  127. package/dist/cjs/one.cjs +2 -113
  128. package/dist/cjs/one.linux.cjs +57 -0
  129. package/dist/cjs/one.linux.native.cjs +59 -0
  130. package/dist/cjs/one.linux.native.js +61 -0
  131. package/dist/cjs/one.linux.native.js.map +1 -0
  132. package/dist/cjs/one.macos.cjs +45 -0
  133. package/dist/cjs/one.macos.native.cjs +47 -0
  134. package/dist/cjs/one.macos.native.js +49 -0
  135. package/dist/cjs/one.macos.native.js.map +1 -0
  136. package/dist/cjs/one.native.cjs +2 -114
  137. package/dist/cjs/one.native.js +2 -114
  138. package/dist/cjs/one.native.js.map +1 -1
  139. package/dist/cjs/platform/adaptive/fixed.cjs +48 -0
  140. package/dist/cjs/platform/adaptive/fixed.native.cjs +50 -0
  141. package/dist/cjs/platform/adaptive/fixed.native.js +52 -0
  142. package/dist/cjs/platform/adaptive/fixed.native.js.map +1 -0
  143. package/dist/cjs/platform/adaptive/index.cjs +2 -24
  144. package/dist/cjs/platform/adaptive/index.linux.cjs +18 -0
  145. package/dist/cjs/platform/adaptive/index.linux.native.cjs +20 -0
  146. package/dist/cjs/platform/adaptive/index.linux.native.js +22 -0
  147. package/dist/cjs/platform/adaptive/index.linux.native.js.map +1 -0
  148. package/dist/cjs/platform/adaptive/index.macos.cjs +39 -0
  149. package/dist/cjs/platform/adaptive/index.macos.native.cjs +41 -0
  150. package/dist/cjs/platform/adaptive/index.macos.native.js +43 -0
  151. package/dist/cjs/platform/adaptive/index.macos.native.js.map +1 -0
  152. package/dist/cjs/platform/controlTypes.cjs +16 -0
  153. package/dist/cjs/platform/controlTypes.native.cjs +18 -0
  154. package/dist/cjs/platform/controlTypes.native.js +20 -0
  155. package/dist/cjs/platform/controlTypes.native.js.map +1 -0
  156. package/dist/cjs/platform/desktop/appCommandTypes.cjs +16 -0
  157. package/dist/cjs/platform/desktop/appCommandTypes.native.cjs +18 -0
  158. package/dist/cjs/platform/desktop/appCommandTypes.native.js +20 -0
  159. package/dist/cjs/platform/desktop/appCommandTypes.native.js.map +1 -0
  160. package/dist/cjs/platform/desktop/createAppCommands.cjs +55 -0
  161. package/dist/cjs/platform/desktop/createAppCommands.native.cjs +60 -0
  162. package/dist/cjs/platform/desktop/createAppCommands.native.js +62 -0
  163. package/dist/cjs/platform/desktop/createAppCommands.native.js.map +1 -0
  164. package/dist/cjs/platform/desktop/createControls.cjs +65 -0
  165. package/dist/cjs/platform/desktop/createControls.native.cjs +69 -0
  166. package/dist/cjs/platform/desktop/createControls.native.js +71 -0
  167. package/dist/cjs/platform/desktop/createControls.native.js.map +1 -0
  168. package/dist/cjs/platform/linux/AppCommands.linux.cjs +25 -0
  169. package/dist/cjs/platform/linux/AppCommands.linux.native.cjs +27 -0
  170. package/dist/cjs/platform/linux/AppCommands.linux.native.js +29 -0
  171. package/dist/cjs/platform/linux/AppCommands.linux.native.js.map +1 -0
  172. package/dist/cjs/platform/linux/Button.linux.cjs +41 -0
  173. package/dist/cjs/platform/linux/Button.linux.native.cjs +49 -0
  174. package/dist/cjs/platform/linux/Button.linux.native.js +51 -0
  175. package/dist/cjs/platform/linux/Button.linux.native.js.map +1 -0
  176. package/dist/cjs/platform/linux/DropDown.linux.cjs +74 -0
  177. package/dist/cjs/platform/linux/DropDown.linux.native.cjs +91 -0
  178. package/dist/cjs/platform/linux/DropDown.linux.native.js +93 -0
  179. package/dist/cjs/platform/linux/DropDown.linux.native.js.map +1 -0
  180. package/dist/cjs/platform/linux/NavigationView.linux.cjs +114 -0
  181. package/dist/cjs/platform/linux/NavigationView.linux.native.cjs +130 -0
  182. package/dist/cjs/platform/linux/NavigationView.linux.native.js +132 -0
  183. package/dist/cjs/platform/linux/NavigationView.linux.native.js.map +1 -0
  184. package/dist/cjs/platform/linux/OneLinuxButtonNativeComponent.cjs +46 -0
  185. package/dist/cjs/platform/linux/OneLinuxButtonNativeComponent.native.cjs +46 -0
  186. package/dist/cjs/platform/linux/OneLinuxButtonNativeComponent.native.js +47 -0
  187. package/dist/cjs/platform/linux/OneLinuxButtonNativeComponent.native.js.map +7 -0
  188. package/dist/cjs/platform/linux/OneLinuxDropDownNativeComponent.cjs +55 -0
  189. package/dist/cjs/platform/linux/OneLinuxDropDownNativeComponent.native.cjs +55 -0
  190. package/dist/cjs/platform/linux/OneLinuxDropDownNativeComponent.native.js +56 -0
  191. package/dist/cjs/platform/linux/OneLinuxDropDownNativeComponent.native.js.map +7 -0
  192. package/dist/cjs/platform/linux/OneLinuxNavigationNativeComponent.cjs +55 -0
  193. package/dist/cjs/platform/linux/OneLinuxNavigationNativeComponent.native.cjs +55 -0
  194. package/dist/cjs/platform/linux/OneLinuxNavigationNativeComponent.native.js +56 -0
  195. package/dist/cjs/platform/linux/OneLinuxNavigationNativeComponent.native.js.map +7 -0
  196. package/dist/cjs/platform/linux/OneLinuxProgressBarNativeComponent.cjs +33 -0
  197. package/dist/cjs/platform/linux/OneLinuxProgressBarNativeComponent.native.cjs +33 -0
  198. package/dist/cjs/platform/linux/OneLinuxProgressBarNativeComponent.native.js +34 -0
  199. package/dist/cjs/platform/linux/OneLinuxProgressBarNativeComponent.native.js.map +7 -0
  200. package/dist/cjs/platform/linux/OneLinuxSecureFieldNativeComponent.cjs +52 -0
  201. package/dist/cjs/platform/linux/OneLinuxSecureFieldNativeComponent.native.cjs +52 -0
  202. package/dist/cjs/platform/linux/OneLinuxSecureFieldNativeComponent.native.js +53 -0
  203. package/dist/cjs/platform/linux/OneLinuxSecureFieldNativeComponent.native.js.map +7 -0
  204. package/dist/cjs/platform/linux/OneLinuxSegmentedControlNativeComponent.cjs +47 -0
  205. package/dist/cjs/platform/linux/OneLinuxSegmentedControlNativeComponent.native.cjs +47 -0
  206. package/dist/cjs/platform/linux/OneLinuxSegmentedControlNativeComponent.native.js +48 -0
  207. package/dist/cjs/platform/linux/OneLinuxSegmentedControlNativeComponent.native.js.map +7 -0
  208. package/dist/cjs/platform/linux/OneLinuxSliderNativeComponent.cjs +57 -0
  209. package/dist/cjs/platform/linux/OneLinuxSliderNativeComponent.native.cjs +57 -0
  210. package/dist/cjs/platform/linux/OneLinuxSliderNativeComponent.native.js +58 -0
  211. package/dist/cjs/platform/linux/OneLinuxSliderNativeComponent.native.js.map +7 -0
  212. package/dist/cjs/platform/linux/OneLinuxStepperNativeComponent.cjs +50 -0
  213. package/dist/cjs/platform/linux/OneLinuxStepperNativeComponent.native.cjs +50 -0
  214. package/dist/cjs/platform/linux/OneLinuxStepperNativeComponent.native.js +51 -0
  215. package/dist/cjs/platform/linux/OneLinuxStepperNativeComponent.native.js.map +7 -0
  216. package/dist/cjs/platform/linux/OneLinuxSwitchNativeComponent.cjs +45 -0
  217. package/dist/cjs/platform/linux/OneLinuxSwitchNativeComponent.native.cjs +45 -0
  218. package/dist/cjs/platform/linux/OneLinuxSwitchNativeComponent.native.js +46 -0
  219. package/dist/cjs/platform/linux/OneLinuxSwitchNativeComponent.native.js.map +7 -0
  220. package/dist/cjs/platform/linux/OneLinuxTextFieldNativeComponent.cjs +52 -0
  221. package/dist/cjs/platform/linux/OneLinuxTextFieldNativeComponent.native.cjs +52 -0
  222. package/dist/cjs/platform/linux/OneLinuxTextFieldNativeComponent.native.js +53 -0
  223. package/dist/cjs/platform/linux/OneLinuxTextFieldNativeComponent.native.js.map +7 -0
  224. package/dist/cjs/platform/linux/OneLinuxToggleNativeComponent.cjs +47 -0
  225. package/dist/cjs/platform/linux/OneLinuxToggleNativeComponent.native.cjs +47 -0
  226. package/dist/cjs/platform/linux/OneLinuxToggleNativeComponent.native.js +48 -0
  227. package/dist/cjs/platform/linux/OneLinuxToggleNativeComponent.native.js.map +7 -0
  228. package/dist/cjs/platform/linux/ProgressBar.linux.cjs +42 -0
  229. package/dist/cjs/platform/linux/ProgressBar.linux.native.cjs +45 -0
  230. package/dist/cjs/platform/linux/ProgressBar.linux.native.js +47 -0
  231. package/dist/cjs/platform/linux/ProgressBar.linux.native.js.map +1 -0
  232. package/dist/cjs/platform/linux/SecureField.linux.cjs +31 -0
  233. package/dist/cjs/platform/linux/SecureField.linux.native.cjs +33 -0
  234. package/dist/cjs/platform/linux/SecureField.linux.native.js +35 -0
  235. package/dist/cjs/platform/linux/SecureField.linux.native.js.map +1 -0
  236. package/dist/cjs/platform/linux/SegmentedControl.linux.cjs +39 -0
  237. package/dist/cjs/platform/linux/SegmentedControl.linux.native.cjs +49 -0
  238. package/dist/cjs/platform/linux/SegmentedControl.linux.native.js +51 -0
  239. package/dist/cjs/platform/linux/SegmentedControl.linux.native.js.map +1 -0
  240. package/dist/cjs/platform/linux/Slider.linux.cjs +71 -0
  241. package/dist/cjs/platform/linux/Slider.linux.native.cjs +78 -0
  242. package/dist/cjs/platform/linux/Slider.linux.native.js +80 -0
  243. package/dist/cjs/platform/linux/Slider.linux.native.js.map +1 -0
  244. package/dist/cjs/platform/linux/Stepper.linux.cjs +57 -0
  245. package/dist/cjs/platform/linux/Stepper.linux.native.cjs +62 -0
  246. package/dist/cjs/platform/linux/Stepper.linux.native.js +64 -0
  247. package/dist/cjs/platform/linux/Stepper.linux.native.js.map +1 -0
  248. package/dist/cjs/platform/linux/Switch.linux.cjs +47 -0
  249. package/dist/cjs/platform/linux/Switch.linux.native.cjs +52 -0
  250. package/dist/cjs/platform/linux/Switch.linux.native.js +54 -0
  251. package/dist/cjs/platform/linux/Switch.linux.native.js.map +1 -0
  252. package/dist/cjs/platform/linux/TextField.linux.cjs +59 -0
  253. package/dist/cjs/platform/linux/TextField.linux.native.cjs +68 -0
  254. package/dist/cjs/platform/linux/TextField.linux.native.js +70 -0
  255. package/dist/cjs/platform/linux/TextField.linux.native.js.map +1 -0
  256. package/dist/cjs/platform/linux/Toggle.linux.cjs +40 -0
  257. package/dist/cjs/platform/linux/Toggle.linux.native.cjs +50 -0
  258. package/dist/cjs/platform/linux/Toggle.linux.native.js +52 -0
  259. package/dist/cjs/platform/linux/Toggle.linux.native.js.map +1 -0
  260. package/dist/cjs/platform/linux/Window.linux.cjs +27 -0
  261. package/dist/cjs/platform/linux/Window.linux.native.cjs +29 -0
  262. package/dist/cjs/platform/linux/Window.linux.native.js +31 -0
  263. package/dist/cjs/platform/linux/Window.linux.native.js.map +1 -0
  264. package/dist/cjs/platform/mac/AppCommands.macos.cjs +25 -0
  265. package/dist/cjs/platform/mac/AppCommands.macos.native.cjs +27 -0
  266. package/dist/cjs/platform/mac/AppCommands.macos.native.js +29 -0
  267. package/dist/cjs/platform/mac/AppCommands.macos.native.js.map +1 -0
  268. package/dist/cjs/platform/mac/Button.macos.cjs +35 -0
  269. package/dist/cjs/platform/mac/Button.macos.native.cjs +40 -0
  270. package/dist/cjs/platform/mac/Button.macos.native.js +42 -0
  271. package/dist/cjs/platform/mac/Button.macos.native.js.map +1 -0
  272. package/dist/cjs/platform/mac/Image.macos.cjs +48 -0
  273. package/dist/cjs/platform/mac/Image.macos.native.cjs +51 -0
  274. package/dist/cjs/platform/mac/Image.macos.native.js +53 -0
  275. package/dist/cjs/platform/mac/Image.macos.native.js.map +1 -0
  276. package/dist/cjs/platform/mac/OneMacButtonNativeComponent.cjs +47 -0
  277. package/dist/cjs/platform/mac/OneMacButtonNativeComponent.native.cjs +47 -0
  278. package/dist/cjs/platform/mac/OneMacButtonNativeComponent.native.js +48 -0
  279. package/dist/cjs/platform/mac/OneMacButtonNativeComponent.native.js.map +7 -0
  280. package/dist/cjs/platform/mac/OneMacImageNativeComponent.cjs +35 -0
  281. package/dist/cjs/platform/mac/OneMacImageNativeComponent.native.cjs +35 -0
  282. package/dist/cjs/platform/mac/OneMacImageNativeComponent.native.js +36 -0
  283. package/dist/cjs/platform/mac/OneMacImageNativeComponent.native.js.map +7 -0
  284. package/dist/cjs/platform/mac/OneMacPopUpButtonNativeComponent.cjs +47 -0
  285. package/dist/cjs/platform/mac/OneMacPopUpButtonNativeComponent.native.cjs +47 -0
  286. package/dist/cjs/platform/mac/OneMacPopUpButtonNativeComponent.native.js +48 -0
  287. package/dist/cjs/platform/mac/OneMacPopUpButtonNativeComponent.native.js.map +7 -0
  288. package/dist/cjs/platform/mac/OneMacSegmentedControlNativeComponent.cjs +48 -0
  289. package/dist/cjs/platform/mac/OneMacSegmentedControlNativeComponent.native.cjs +48 -0
  290. package/dist/cjs/platform/mac/OneMacSegmentedControlNativeComponent.native.js +49 -0
  291. package/dist/cjs/platform/mac/OneMacSegmentedControlNativeComponent.native.js.map +7 -0
  292. package/dist/cjs/platform/mac/OneMacToggleNativeComponent.cjs +46 -0
  293. package/dist/cjs/platform/mac/OneMacToggleNativeComponent.native.cjs +46 -0
  294. package/dist/cjs/platform/mac/OneMacToggleNativeComponent.native.js +47 -0
  295. package/dist/cjs/platform/mac/OneMacToggleNativeComponent.native.js.map +7 -0
  296. package/dist/cjs/platform/mac/PopUpButton.macos.cjs +51 -0
  297. package/dist/cjs/platform/mac/PopUpButton.macos.native.cjs +56 -0
  298. package/dist/cjs/platform/mac/PopUpButton.macos.native.js +58 -0
  299. package/dist/cjs/platform/mac/PopUpButton.macos.native.js.map +1 -0
  300. package/dist/cjs/platform/mac/SegmentedControl.macos.cjs +38 -0
  301. package/dist/cjs/platform/mac/SegmentedControl.macos.native.cjs +47 -0
  302. package/dist/cjs/platform/mac/SegmentedControl.macos.native.js +49 -0
  303. package/dist/cjs/platform/mac/SegmentedControl.macos.native.js.map +1 -0
  304. package/dist/cjs/platform/mac/Toggle.macos.cjs +38 -0
  305. package/dist/cjs/platform/mac/Toggle.macos.native.cjs +47 -0
  306. package/dist/cjs/platform/mac/Toggle.macos.native.js +49 -0
  307. package/dist/cjs/platform/mac/Toggle.macos.native.js.map +1 -0
  308. package/dist/cjs/platform/specs/OneDOMHostNativeComponent.cjs +71 -0
  309. package/dist/cjs/platform/specs/OneDOMHostNativeComponent.native.cjs +71 -0
  310. package/dist/cjs/platform/specs/OneDOMHostNativeComponent.native.js +72 -0
  311. package/dist/cjs/platform/specs/OneDOMHostNativeComponent.native.js.map +7 -0
  312. package/dist/cjs/platform/split-view/split-view.linux.cjs +18 -0
  313. package/dist/cjs/platform/split-view/split-view.linux.native.cjs +20 -0
  314. package/dist/cjs/platform/split-view/split-view.linux.native.js +22 -0
  315. package/dist/cjs/platform/split-view/split-view.linux.native.js.map +1 -0
  316. package/dist/cjs/platform/split-view/split-view.macos.cjs +34 -0
  317. package/dist/cjs/platform/split-view/split-view.macos.native.cjs +37 -0
  318. package/dist/cjs/platform/split-view/split-view.macos.native.js +39 -0
  319. package/dist/cjs/platform/split-view/split-view.macos.native.js.map +1 -0
  320. package/dist/cjs/platform/store-review/index.native.cjs +1 -1
  321. package/dist/cjs/platform/store-review/index.native.js +1 -1
  322. package/dist/cjs/platform/store-review/index.native.js.map +1 -1
  323. package/dist/cjs/platform/ui/Image.linux.cjs +18 -0
  324. package/dist/cjs/platform/ui/Image.linux.native.cjs +20 -0
  325. package/dist/cjs/platform/ui/Image.linux.native.js +22 -0
  326. package/dist/cjs/platform/ui/Image.linux.native.js.map +1 -0
  327. package/dist/cjs/platform/ui/Image.macos.cjs +33 -0
  328. package/dist/cjs/platform/ui/Image.macos.native.cjs +36 -0
  329. package/dist/cjs/platform/ui/Image.macos.native.js +38 -0
  330. package/dist/cjs/platform/ui/Image.macos.native.js.map +1 -0
  331. package/dist/cjs/router/getRoutes.cjs +2 -0
  332. package/dist/cjs/router/getRoutes.native.cjs +2 -0
  333. package/dist/cjs/router/getRoutes.native.js +2 -0
  334. package/dist/cjs/router/getRoutes.native.js.map +1 -1
  335. package/dist/cjs/router/router.cjs +57 -31
  336. package/dist/cjs/router/router.native.cjs +20 -4
  337. package/dist/cjs/router/router.native.js +20 -4
  338. package/dist/cjs/router/router.native.js.map +1 -1
  339. package/dist/cjs/searchParams.cjs +102 -0
  340. package/dist/cjs/searchParams.native.cjs +194 -0
  341. package/dist/cjs/searchParams.native.js +196 -0
  342. package/dist/cjs/searchParams.native.js.map +1 -0
  343. package/dist/cjs/server/oneServe.cjs +15 -3
  344. package/dist/cjs/server/oneServe.native.cjs +16 -3
  345. package/dist/cjs/server/oneServe.native.js +16 -3
  346. package/dist/cjs/server/oneServe.native.js.map +1 -1
  347. package/dist/cjs/server/workerHandler.cjs +16 -3
  348. package/dist/cjs/server/workerHandler.native.cjs +17 -3
  349. package/dist/cjs/server/workerHandler.native.js +17 -3
  350. package/dist/cjs/server/workerHandler.native.js.map +1 -1
  351. package/dist/cjs/standardSchema.cjs +36 -0
  352. package/dist/cjs/standardSchema.native.cjs +39 -0
  353. package/dist/cjs/standardSchema.native.js +41 -0
  354. package/dist/cjs/standardSchema.native.js.map +1 -0
  355. package/dist/cjs/typed-routes/generateRouteTypes.cjs +26 -1
  356. package/dist/cjs/typed-routes/generateRouteTypes.native.cjs +68 -1
  357. package/dist/cjs/typed-routes/generateRouteTypes.native.js +68 -1
  358. package/dist/cjs/typed-routes/generateRouteTypes.native.js.map +1 -1
  359. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.cjs +27 -10
  360. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.cjs +35 -9
  361. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js +35 -9
  362. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -1
  363. package/dist/cjs/typed-routes/searchParamSchemas.cjs +316 -0
  364. package/dist/cjs/typed-routes/searchParamSchemas.native.cjs +527 -0
  365. package/dist/cjs/typed-routes/searchParamSchemas.native.js +529 -0
  366. package/dist/cjs/typed-routes/searchParamSchemas.native.js.map +1 -0
  367. package/dist/cjs/typed-routes/searchSchemaEntries.cjs +34 -0
  368. package/dist/cjs/typed-routes/searchSchemaEntries.native.cjs +38 -0
  369. package/dist/cjs/typed-routes/searchSchemaEntries.native.js +40 -0
  370. package/dist/cjs/typed-routes/searchSchemaEntries.native.js.map +1 -0
  371. package/dist/cjs/useLoader.cjs +40 -30
  372. package/dist/cjs/useLoader.native.cjs +51 -37
  373. package/dist/cjs/useLoader.native.js +51 -37
  374. package/dist/cjs/useLoader.native.js.map +1 -1
  375. package/dist/cjs/utils/cleanUrl.cjs +31 -3
  376. package/dist/cjs/utils/cleanUrl.native.cjs +31 -3
  377. package/dist/cjs/utils/cleanUrl.native.js +31 -3
  378. package/dist/cjs/utils/cleanUrl.native.js.map +1 -1
  379. package/dist/cjs/validateParams.cjs +3 -5
  380. package/dist/cjs/validateParams.native.cjs +3 -6
  381. package/dist/cjs/validateParams.native.js +3 -6
  382. package/dist/cjs/validateParams.native.js.map +1 -1
  383. package/dist/cjs/{validateSearch.cjs → validateSearchParams.cjs} +21 -14
  384. package/dist/cjs/{validateSearch.native.cjs → validateSearchParams.native.cjs} +21 -15
  385. package/dist/cjs/{validateSearch.native.js → validateSearchParams.native.js} +22 -16
  386. package/dist/cjs/validateSearchParams.native.js.map +1 -0
  387. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.cjs +36 -2
  388. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.cjs +36 -2
  389. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js +36 -2
  390. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -1
  391. package/dist/cjs/vite/dom/browser.cjs +172 -0
  392. package/dist/cjs/vite/dom/browser.native.cjs +220 -0
  393. package/dist/cjs/vite/dom/browser.native.js +222 -0
  394. package/dist/cjs/vite/dom/browser.native.js.map +1 -0
  395. package/dist/cjs/vite/dom/directive.cjs +76 -0
  396. package/dist/cjs/vite/dom/directive.native.cjs +135 -0
  397. package/dist/cjs/vite/dom/directive.native.js +137 -0
  398. package/dist/cjs/vite/dom/directive.native.js.map +1 -0
  399. package/dist/cjs/vite/dom/registry.cjs +71 -0
  400. package/dist/cjs/vite/dom/registry.native.cjs +184 -0
  401. package/dist/cjs/vite/dom/registry.native.js +186 -0
  402. package/dist/cjs/vite/dom/registry.native.js.map +1 -0
  403. package/dist/cjs/vite/one.cjs +28 -3
  404. package/dist/cjs/vite/one.native.cjs +35 -10
  405. package/dist/cjs/vite/one.native.js +35 -10
  406. package/dist/cjs/vite/one.native.js.map +1 -1
  407. package/dist/cjs/vite/plugins/clientTreeShakePlugin.cjs +1 -1
  408. package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.cjs +1 -1
  409. package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js +1 -1
  410. package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
  411. package/dist/cjs/vite/plugins/environmentGuardPlugin.cjs +6 -1
  412. package/dist/cjs/vite/plugins/environmentGuardPlugin.native.cjs +6 -1
  413. package/dist/cjs/vite/plugins/environmentGuardPlugin.native.js +6 -1
  414. package/dist/cjs/vite/plugins/environmentGuardPlugin.native.js.map +1 -1
  415. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.cjs +11 -7
  416. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.cjs +13 -7
  417. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +13 -7
  418. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
  419. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.cjs +8 -2
  420. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.cjs +8 -2
  421. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +8 -2
  422. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
  423. package/dist/cjs/vite/plugins/iosLinkSetPlugin.cjs +63 -0
  424. package/dist/cjs/vite/plugins/iosLinkSetPlugin.native.cjs +69 -0
  425. package/dist/cjs/vite/plugins/iosLinkSetPlugin.native.js +71 -0
  426. package/dist/cjs/vite/plugins/iosLinkSetPlugin.native.js.map +1 -0
  427. package/dist/cjs/vite/plugins/loaderSearchSchemasPlugin.cjs +67 -0
  428. package/dist/cjs/vite/plugins/loaderSearchSchemasPlugin.native.cjs +107 -0
  429. package/dist/cjs/vite/plugins/loaderSearchSchemasPlugin.native.js +109 -0
  430. package/dist/cjs/vite/plugins/loaderSearchSchemasPlugin.native.js.map +1 -0
  431. package/dist/cjs/vite/plugins/useDomPlugin.cjs +128 -22
  432. package/dist/cjs/vite/plugins/useDomPlugin.native.cjs +160 -22
  433. package/dist/cjs/vite/plugins/useDomPlugin.native.js +160 -22
  434. package/dist/cjs/vite/plugins/useDomPlugin.native.js.map +1 -1
  435. package/dist/esm/cli/iosLinkSet.mjs +83 -0
  436. package/dist/esm/cli/iosLinkSet.mjs.map +1 -0
  437. package/dist/esm/cli/iosLinkSet.native.js +90 -0
  438. package/dist/esm/cli/iosLinkSet.native.js.map +1 -0
  439. package/dist/esm/cli/iosLinkSetAnalysis.mjs +303 -0
  440. package/dist/esm/cli/iosLinkSetAnalysis.mjs.map +1 -0
  441. package/dist/esm/cli/iosLinkSetAnalysis.native.js +686 -0
  442. package/dist/esm/cli/iosLinkSetAnalysis.native.js.map +1 -0
  443. package/dist/esm/cli/prebuild.mjs +5 -1
  444. package/dist/esm/cli/prebuild.mjs.map +1 -1
  445. package/dist/esm/cli/prebuild.native.js +4 -2
  446. package/dist/esm/cli/prebuild.native.js.map +1 -1
  447. package/dist/esm/cli/updatesPublish.mjs +15 -11
  448. package/dist/esm/cli/updatesPublish.mjs.map +1 -1
  449. package/dist/esm/cli/updatesPublish.native.js +44 -21
  450. package/dist/esm/cli/updatesPublish.native.js.map +1 -1
  451. package/dist/esm/cli.mjs +4 -2
  452. package/dist/esm/cli.mjs.map +1 -1
  453. package/dist/esm/cli.native.js +4 -2
  454. package/dist/esm/cli.native.js.map +1 -1
  455. package/dist/esm/createApp.mjs +8 -0
  456. package/dist/esm/createApp.mjs.map +1 -1
  457. package/dist/esm/createHandleRequest.mjs +4 -17
  458. package/dist/esm/createHandleRequest.mjs.map +1 -1
  459. package/dist/esm/createHandleRequest.native.js +6 -19
  460. package/dist/esm/createHandleRequest.native.js.map +1 -1
  461. package/dist/esm/dom/browserBridge.mjs +158 -0
  462. package/dist/esm/dom/browserBridge.mjs.map +1 -0
  463. package/dist/esm/dom/browserBridge.native.js +269 -0
  464. package/dist/esm/dom/browserBridge.native.js.map +1 -0
  465. package/dist/esm/dom/client.mjs +49 -0
  466. package/dist/esm/dom/client.mjs.map +1 -0
  467. package/dist/esm/dom/client.native.js +59 -0
  468. package/dist/esm/dom/client.native.js.map +1 -0
  469. package/dist/esm/dom/context.mjs +6 -0
  470. package/dist/esm/dom/context.mjs.map +1 -0
  471. package/dist/esm/dom/context.native.js +6 -0
  472. package/dist/esm/dom/context.native.js.map +1 -0
  473. package/dist/esm/dom/host.native.js +125 -0
  474. package/dist/esm/dom/host.native.js.map +1 -0
  475. package/dist/esm/dom/index.mjs +69 -0
  476. package/dist/esm/dom/index.mjs.map +1 -0
  477. package/dist/esm/dom/index.native.js +115 -0
  478. package/dist/esm/dom/index.native.js.map +1 -0
  479. package/dist/esm/dom/measure.mjs +31 -0
  480. package/dist/esm/dom/measure.mjs.map +1 -0
  481. package/dist/esm/dom/measure.native.js +33 -0
  482. package/dist/esm/dom/measure.native.js.map +1 -0
  483. package/dist/esm/dom/nativeBridge.mjs +116 -0
  484. package/dist/esm/dom/nativeBridge.mjs.map +1 -0
  485. package/dist/esm/dom/nativeBridge.native.js +202 -0
  486. package/dist/esm/dom/nativeBridge.native.js.map +1 -0
  487. package/dist/esm/dom/peer.mjs +129 -0
  488. package/dist/esm/dom/peer.mjs.map +1 -0
  489. package/dist/esm/dom/peer.native.js +206 -0
  490. package/dist/esm/dom/peer.native.js.map +1 -0
  491. package/dist/esm/dom/protocol.mjs +162 -0
  492. package/dist/esm/dom/protocol.mjs.map +1 -0
  493. package/dist/esm/dom/protocol.native.js +184 -0
  494. package/dist/esm/dom/protocol.native.js.map +1 -0
  495. package/dist/esm/dom/serialize.mjs +114 -0
  496. package/dist/esm/dom/serialize.mjs.map +1 -0
  497. package/dist/esm/dom/serialize.native.js +256 -0
  498. package/dist/esm/dom/serialize.native.js.map +1 -0
  499. package/dist/esm/dom/types.mjs +0 -0
  500. package/dist/esm/dom/types.native.js +0 -0
  501. package/dist/esm/fork/getPathFromState.mjs +9 -1
  502. package/dist/esm/fork/getPathFromState.mjs.map +1 -1
  503. package/dist/esm/fork/getPathFromState.native.js +48 -4
  504. package/dist/esm/fork/getPathFromState.native.js.map +1 -1
  505. package/dist/esm/hooks.mjs +51 -2
  506. package/dist/esm/hooks.mjs.map +1 -1
  507. package/dist/esm/hooks.native.js +56 -3
  508. package/dist/esm/hooks.native.js.map +1 -1
  509. package/dist/esm/index.js +2 -1
  510. package/dist/esm/index.mjs +2 -1
  511. package/dist/esm/index.native.js +2 -1
  512. package/dist/esm/layouts/Tabs.linux.mjs +26 -0
  513. package/dist/esm/layouts/Tabs.linux.mjs.map +1 -0
  514. package/dist/esm/layouts/Tabs.linux.native.js +26 -0
  515. package/dist/esm/layouts/Tabs.linux.native.js.map +1 -0
  516. package/dist/esm/layouts/stack-navigator-desktop.mjs +6 -0
  517. package/dist/esm/layouts/stack-navigator-desktop.mjs.map +1 -0
  518. package/dist/esm/layouts/stack-navigator-desktop.native.js +6 -0
  519. package/dist/esm/layouts/stack-navigator-desktop.native.js.map +1 -0
  520. package/dist/esm/layouts/stack-navigator.linux.mjs +17 -0
  521. package/dist/esm/layouts/stack-navigator.linux.mjs.map +1 -0
  522. package/dist/esm/layouts/stack-navigator.linux.native.js +17 -0
  523. package/dist/esm/layouts/stack-navigator.linux.native.js.map +1 -0
  524. package/dist/esm/layouts/stack-navigator.macos.mjs +7 -0
  525. package/dist/esm/layouts/stack-navigator.macos.mjs.map +1 -0
  526. package/dist/esm/layouts/stack-navigator.macos.native.js +7 -0
  527. package/dist/esm/layouts/stack-navigator.macos.native.js.map +1 -0
  528. package/dist/esm/layouts/stack-utils/StackToolbarBottomHost.linux.mjs +1 -0
  529. package/dist/esm/layouts/stack-utils/StackToolbarBottomHost.linux.native.js +1 -0
  530. package/dist/esm/layouts/stack-utils/StackToolbarBottomHost.macos.mjs +11 -0
  531. package/dist/esm/layouts/stack-utils/StackToolbarBottomHost.macos.mjs.map +1 -0
  532. package/dist/esm/layouts/stack-utils/StackToolbarBottomHost.macos.native.js +12 -0
  533. package/dist/esm/layouts/stack-utils/StackToolbarBottomHost.macos.native.js.map +1 -0
  534. package/dist/esm/link/Link.mjs +4 -3
  535. package/dist/esm/link/Link.mjs.map +1 -1
  536. package/dist/esm/link/Link.native.js +4 -3
  537. package/dist/esm/link/Link.native.js.map +1 -1
  538. package/dist/esm/loaderResponseToModule.mjs +21 -0
  539. package/dist/esm/loaderResponseToModule.mjs.map +1 -0
  540. package/dist/esm/loaderResponseToModule.native.js +22 -0
  541. package/dist/esm/loaderResponseToModule.native.js.map +1 -0
  542. package/dist/esm/loaderSearchParams.mjs +76 -0
  543. package/dist/esm/loaderSearchParams.mjs.map +1 -0
  544. package/dist/esm/loaderSearchParams.native.js +114 -0
  545. package/dist/esm/loaderSearchParams.native.js.map +1 -0
  546. package/dist/esm/one-shared.mjs +110 -0
  547. package/dist/esm/one-shared.mjs.map +1 -0
  548. package/dist/esm/one-shared.native.js +111 -0
  549. package/dist/esm/one-shared.native.js.map +1 -0
  550. package/dist/esm/one.linux.mjs +38 -0
  551. package/dist/esm/one.linux.mjs.map +1 -0
  552. package/dist/esm/one.linux.native.js +38 -0
  553. package/dist/esm/one.linux.native.js.map +1 -0
  554. package/dist/esm/one.macos.mjs +26 -0
  555. package/dist/esm/one.macos.mjs.map +1 -0
  556. package/dist/esm/one.macos.native.js +26 -0
  557. package/dist/esm/one.macos.native.js.map +1 -0
  558. package/dist/esm/one.mjs +1 -110
  559. package/dist/esm/one.native.js +1 -111
  560. package/dist/esm/platform/adaptive/fixed.mjs +22 -0
  561. package/dist/esm/platform/adaptive/fixed.mjs.map +1 -0
  562. package/dist/esm/platform/adaptive/fixed.native.js +22 -0
  563. package/dist/esm/platform/adaptive/fixed.native.js.map +1 -0
  564. package/dist/esm/platform/adaptive/index.linux.mjs +1 -0
  565. package/dist/esm/platform/adaptive/index.linux.native.js +1 -0
  566. package/dist/esm/platform/adaptive/index.macos.mjs +6 -0
  567. package/dist/esm/platform/adaptive/index.macos.native.js +6 -0
  568. package/dist/esm/platform/adaptive/index.mjs +2 -21
  569. package/dist/esm/platform/controlTypes.mjs +0 -0
  570. package/dist/esm/platform/controlTypes.native.js +0 -0
  571. package/dist/esm/platform/desktop/appCommandTypes.mjs +0 -0
  572. package/dist/esm/platform/desktop/appCommandTypes.native.js +0 -0
  573. package/dist/esm/platform/desktop/createAppCommands.mjs +36 -0
  574. package/dist/esm/platform/desktop/createAppCommands.mjs.map +1 -0
  575. package/dist/esm/platform/desktop/createAppCommands.native.js +39 -0
  576. package/dist/esm/platform/desktop/createAppCommands.native.js.map +1 -0
  577. package/dist/esm/platform/desktop/createControls.mjs +42 -0
  578. package/dist/esm/platform/desktop/createControls.mjs.map +1 -0
  579. package/dist/esm/platform/desktop/createControls.native.js +44 -0
  580. package/dist/esm/platform/desktop/createControls.native.js.map +1 -0
  581. package/dist/esm/platform/linux/AppCommands.linux.mjs +6 -0
  582. package/dist/esm/platform/linux/AppCommands.linux.mjs.map +1 -0
  583. package/dist/esm/platform/linux/AppCommands.linux.native.js +6 -0
  584. package/dist/esm/platform/linux/AppCommands.linux.native.js.map +1 -0
  585. package/dist/esm/platform/linux/Button.linux.mjs +16 -0
  586. package/dist/esm/platform/linux/Button.linux.mjs.map +1 -0
  587. package/dist/esm/platform/linux/Button.linux.native.js +22 -0
  588. package/dist/esm/platform/linux/Button.linux.native.js.map +1 -0
  589. package/dist/esm/platform/linux/DropDown.linux.mjs +49 -0
  590. package/dist/esm/platform/linux/DropDown.linux.mjs.map +1 -0
  591. package/dist/esm/platform/linux/DropDown.linux.native.js +64 -0
  592. package/dist/esm/platform/linux/DropDown.linux.native.js.map +1 -0
  593. package/dist/esm/platform/linux/NavigationView.linux.mjs +89 -0
  594. package/dist/esm/platform/linux/NavigationView.linux.mjs.map +1 -0
  595. package/dist/esm/platform/linux/NavigationView.linux.native.js +103 -0
  596. package/dist/esm/platform/linux/NavigationView.linux.native.js.map +1 -0
  597. package/dist/esm/platform/linux/OneLinuxButtonNativeComponent.mjs +28 -0
  598. package/dist/esm/platform/linux/OneLinuxButtonNativeComponent.mjs.map +7 -0
  599. package/dist/esm/platform/linux/OneLinuxButtonNativeComponent.native.js +28 -0
  600. package/dist/esm/platform/linux/OneLinuxButtonNativeComponent.native.js.map +7 -0
  601. package/dist/esm/platform/linux/OneLinuxDropDownNativeComponent.mjs +37 -0
  602. package/dist/esm/platform/linux/OneLinuxDropDownNativeComponent.mjs.map +7 -0
  603. package/dist/esm/platform/linux/OneLinuxDropDownNativeComponent.native.js +37 -0
  604. package/dist/esm/platform/linux/OneLinuxDropDownNativeComponent.native.js.map +7 -0
  605. package/dist/esm/platform/linux/OneLinuxNavigationNativeComponent.mjs +37 -0
  606. package/dist/esm/platform/linux/OneLinuxNavigationNativeComponent.mjs.map +7 -0
  607. package/dist/esm/platform/linux/OneLinuxNavigationNativeComponent.native.js +37 -0
  608. package/dist/esm/platform/linux/OneLinuxNavigationNativeComponent.native.js.map +7 -0
  609. package/dist/esm/platform/linux/OneLinuxProgressBarNativeComponent.mjs +15 -0
  610. package/dist/esm/platform/linux/OneLinuxProgressBarNativeComponent.mjs.map +7 -0
  611. package/dist/esm/platform/linux/OneLinuxProgressBarNativeComponent.native.js +15 -0
  612. package/dist/esm/platform/linux/OneLinuxProgressBarNativeComponent.native.js.map +7 -0
  613. package/dist/esm/platform/linux/OneLinuxSecureFieldNativeComponent.mjs +34 -0
  614. package/dist/esm/platform/linux/OneLinuxSecureFieldNativeComponent.mjs.map +7 -0
  615. package/dist/esm/platform/linux/OneLinuxSecureFieldNativeComponent.native.js +34 -0
  616. package/dist/esm/platform/linux/OneLinuxSecureFieldNativeComponent.native.js.map +7 -0
  617. package/dist/esm/platform/linux/OneLinuxSegmentedControlNativeComponent.mjs +29 -0
  618. package/dist/esm/platform/linux/OneLinuxSegmentedControlNativeComponent.mjs.map +7 -0
  619. package/dist/esm/platform/linux/OneLinuxSegmentedControlNativeComponent.native.js +29 -0
  620. package/dist/esm/platform/linux/OneLinuxSegmentedControlNativeComponent.native.js.map +7 -0
  621. package/dist/esm/platform/linux/OneLinuxSliderNativeComponent.mjs +39 -0
  622. package/dist/esm/platform/linux/OneLinuxSliderNativeComponent.mjs.map +7 -0
  623. package/dist/esm/platform/linux/OneLinuxSliderNativeComponent.native.js +39 -0
  624. package/dist/esm/platform/linux/OneLinuxSliderNativeComponent.native.js.map +7 -0
  625. package/dist/esm/platform/linux/OneLinuxStepperNativeComponent.mjs +32 -0
  626. package/dist/esm/platform/linux/OneLinuxStepperNativeComponent.mjs.map +7 -0
  627. package/dist/esm/platform/linux/OneLinuxStepperNativeComponent.native.js +32 -0
  628. package/dist/esm/platform/linux/OneLinuxStepperNativeComponent.native.js.map +7 -0
  629. package/dist/esm/platform/linux/OneLinuxSwitchNativeComponent.mjs +27 -0
  630. package/dist/esm/platform/linux/OneLinuxSwitchNativeComponent.mjs.map +7 -0
  631. package/dist/esm/platform/linux/OneLinuxSwitchNativeComponent.native.js +27 -0
  632. package/dist/esm/platform/linux/OneLinuxSwitchNativeComponent.native.js.map +7 -0
  633. package/dist/esm/platform/linux/OneLinuxTextFieldNativeComponent.mjs +34 -0
  634. package/dist/esm/platform/linux/OneLinuxTextFieldNativeComponent.mjs.map +7 -0
  635. package/dist/esm/platform/linux/OneLinuxTextFieldNativeComponent.native.js +34 -0
  636. package/dist/esm/platform/linux/OneLinuxTextFieldNativeComponent.native.js.map +7 -0
  637. package/dist/esm/platform/linux/OneLinuxToggleNativeComponent.mjs +29 -0
  638. package/dist/esm/platform/linux/OneLinuxToggleNativeComponent.mjs.map +7 -0
  639. package/dist/esm/platform/linux/OneLinuxToggleNativeComponent.native.js +29 -0
  640. package/dist/esm/platform/linux/OneLinuxToggleNativeComponent.native.js.map +7 -0
  641. package/dist/esm/platform/linux/ProgressBar.linux.mjs +17 -0
  642. package/dist/esm/platform/linux/ProgressBar.linux.mjs.map +1 -0
  643. package/dist/esm/platform/linux/ProgressBar.linux.native.js +18 -0
  644. package/dist/esm/platform/linux/ProgressBar.linux.native.js.map +1 -0
  645. package/dist/esm/platform/linux/SecureField.linux.mjs +12 -0
  646. package/dist/esm/platform/linux/SecureField.linux.mjs.map +1 -0
  647. package/dist/esm/platform/linux/SecureField.linux.native.js +12 -0
  648. package/dist/esm/platform/linux/SecureField.linux.native.js.map +1 -0
  649. package/dist/esm/platform/linux/SegmentedControl.linux.mjs +14 -0
  650. package/dist/esm/platform/linux/SegmentedControl.linux.mjs.map +1 -0
  651. package/dist/esm/platform/linux/SegmentedControl.linux.native.js +22 -0
  652. package/dist/esm/platform/linux/SegmentedControl.linux.native.js.map +1 -0
  653. package/dist/esm/platform/linux/Slider.linux.mjs +46 -0
  654. package/dist/esm/platform/linux/Slider.linux.mjs.map +1 -0
  655. package/dist/esm/platform/linux/Slider.linux.native.js +51 -0
  656. package/dist/esm/platform/linux/Slider.linux.native.js.map +1 -0
  657. package/dist/esm/platform/linux/Stepper.linux.mjs +32 -0
  658. package/dist/esm/platform/linux/Stepper.linux.mjs.map +1 -0
  659. package/dist/esm/platform/linux/Stepper.linux.native.js +35 -0
  660. package/dist/esm/platform/linux/Stepper.linux.native.js.map +1 -0
  661. package/dist/esm/platform/linux/Switch.linux.mjs +22 -0
  662. package/dist/esm/platform/linux/Switch.linux.mjs.map +1 -0
  663. package/dist/esm/platform/linux/Switch.linux.native.js +25 -0
  664. package/dist/esm/platform/linux/Switch.linux.native.js.map +1 -0
  665. package/dist/esm/platform/linux/TextField.linux.mjs +31 -0
  666. package/dist/esm/platform/linux/TextField.linux.mjs.map +1 -0
  667. package/dist/esm/platform/linux/TextField.linux.native.js +38 -0
  668. package/dist/esm/platform/linux/TextField.linux.native.js.map +1 -0
  669. package/dist/esm/platform/linux/Toggle.linux.mjs +15 -0
  670. package/dist/esm/platform/linux/Toggle.linux.mjs.map +1 -0
  671. package/dist/esm/platform/linux/Toggle.linux.native.js +23 -0
  672. package/dist/esm/platform/linux/Toggle.linux.native.js.map +1 -0
  673. package/dist/esm/platform/linux/Window.linux.mjs +8 -0
  674. package/dist/esm/platform/linux/Window.linux.mjs.map +1 -0
  675. package/dist/esm/platform/linux/Window.linux.native.js +8 -0
  676. package/dist/esm/platform/linux/Window.linux.native.js.map +1 -0
  677. package/dist/esm/platform/mac/AppCommands.macos.mjs +6 -0
  678. package/dist/esm/platform/mac/AppCommands.macos.mjs.map +1 -0
  679. package/dist/esm/platform/mac/AppCommands.macos.native.js +6 -0
  680. package/dist/esm/platform/mac/AppCommands.macos.native.js.map +1 -0
  681. package/dist/esm/platform/mac/Button.macos.mjs +10 -0
  682. package/dist/esm/platform/mac/Button.macos.mjs.map +1 -0
  683. package/dist/esm/platform/mac/Button.macos.native.js +13 -0
  684. package/dist/esm/platform/mac/Button.macos.native.js.map +1 -0
  685. package/dist/esm/platform/mac/Image.macos.mjs +23 -0
  686. package/dist/esm/platform/mac/Image.macos.mjs.map +1 -0
  687. package/dist/esm/platform/mac/Image.macos.native.js +24 -0
  688. package/dist/esm/platform/mac/Image.macos.native.js.map +1 -0
  689. package/dist/esm/platform/mac/OneMacButtonNativeComponent.mjs +29 -0
  690. package/dist/esm/platform/mac/OneMacButtonNativeComponent.mjs.map +7 -0
  691. package/dist/esm/platform/mac/OneMacButtonNativeComponent.native.js +29 -0
  692. package/dist/esm/platform/mac/OneMacButtonNativeComponent.native.js.map +7 -0
  693. package/dist/esm/platform/mac/OneMacImageNativeComponent.mjs +17 -0
  694. package/dist/esm/platform/mac/OneMacImageNativeComponent.mjs.map +7 -0
  695. package/dist/esm/platform/mac/OneMacImageNativeComponent.native.js +17 -0
  696. package/dist/esm/platform/mac/OneMacImageNativeComponent.native.js.map +7 -0
  697. package/dist/esm/platform/mac/OneMacPopUpButtonNativeComponent.mjs +29 -0
  698. package/dist/esm/platform/mac/OneMacPopUpButtonNativeComponent.mjs.map +7 -0
  699. package/dist/esm/platform/mac/OneMacPopUpButtonNativeComponent.native.js +29 -0
  700. package/dist/esm/platform/mac/OneMacPopUpButtonNativeComponent.native.js.map +7 -0
  701. package/dist/esm/platform/mac/OneMacSegmentedControlNativeComponent.mjs +30 -0
  702. package/dist/esm/platform/mac/OneMacSegmentedControlNativeComponent.mjs.map +7 -0
  703. package/dist/esm/platform/mac/OneMacSegmentedControlNativeComponent.native.js +30 -0
  704. package/dist/esm/platform/mac/OneMacSegmentedControlNativeComponent.native.js.map +7 -0
  705. package/dist/esm/platform/mac/OneMacToggleNativeComponent.mjs +28 -0
  706. package/dist/esm/platform/mac/OneMacToggleNativeComponent.mjs.map +7 -0
  707. package/dist/esm/platform/mac/OneMacToggleNativeComponent.native.js +28 -0
  708. package/dist/esm/platform/mac/OneMacToggleNativeComponent.native.js.map +7 -0
  709. package/dist/esm/platform/mac/PopUpButton.macos.mjs +26 -0
  710. package/dist/esm/platform/mac/PopUpButton.macos.mjs.map +1 -0
  711. package/dist/esm/platform/mac/PopUpButton.macos.native.js +29 -0
  712. package/dist/esm/platform/mac/PopUpButton.macos.native.js.map +1 -0
  713. package/dist/esm/platform/mac/SegmentedControl.macos.mjs +13 -0
  714. package/dist/esm/platform/mac/SegmentedControl.macos.mjs.map +1 -0
  715. package/dist/esm/platform/mac/SegmentedControl.macos.native.js +20 -0
  716. package/dist/esm/platform/mac/SegmentedControl.macos.native.js.map +1 -0
  717. package/dist/esm/platform/mac/Toggle.macos.mjs +13 -0
  718. package/dist/esm/platform/mac/Toggle.macos.mjs.map +1 -0
  719. package/dist/esm/platform/mac/Toggle.macos.native.js +20 -0
  720. package/dist/esm/platform/mac/Toggle.macos.native.js.map +1 -0
  721. package/dist/esm/platform/specs/OneDOMHostNativeComponent.mjs +53 -0
  722. package/dist/esm/platform/specs/OneDOMHostNativeComponent.mjs.map +7 -0
  723. package/dist/esm/platform/specs/OneDOMHostNativeComponent.native.js +53 -0
  724. package/dist/esm/platform/specs/OneDOMHostNativeComponent.native.js.map +7 -0
  725. package/dist/esm/platform/split-view/split-view.linux.mjs +1 -0
  726. package/dist/esm/platform/split-view/split-view.linux.native.js +1 -0
  727. package/dist/esm/platform/split-view/split-view.macos.mjs +15 -0
  728. package/dist/esm/platform/split-view/split-view.macos.mjs.map +1 -0
  729. package/dist/esm/platform/split-view/split-view.macos.native.js +16 -0
  730. package/dist/esm/platform/split-view/split-view.macos.native.js.map +1 -0
  731. package/dist/esm/platform/store-review/index.native.js +1 -1
  732. package/dist/esm/platform/ui/Image.linux.mjs +1 -0
  733. package/dist/esm/platform/ui/Image.linux.native.js +1 -0
  734. package/dist/esm/platform/ui/Image.macos.mjs +14 -0
  735. package/dist/esm/platform/ui/Image.macos.mjs.map +1 -0
  736. package/dist/esm/platform/ui/Image.macos.native.js +15 -0
  737. package/dist/esm/platform/ui/Image.macos.native.js.map +1 -0
  738. package/dist/esm/router/getRoutes.mjs +2 -0
  739. package/dist/esm/router/getRoutes.mjs.map +1 -1
  740. package/dist/esm/router/getRoutes.native.js +2 -0
  741. package/dist/esm/router/getRoutes.native.js.map +1 -1
  742. package/dist/esm/router/router.mjs +56 -33
  743. package/dist/esm/router/router.mjs.map +1 -1
  744. package/dist/esm/router/router.native.js +18 -4
  745. package/dist/esm/router/router.native.js.map +1 -1
  746. package/dist/esm/searchParams.mjs +75 -0
  747. package/dist/esm/searchParams.mjs.map +1 -0
  748. package/dist/esm/searchParams.native.js +165 -0
  749. package/dist/esm/searchParams.native.js.map +1 -0
  750. package/dist/esm/server/oneServe.mjs +15 -3
  751. package/dist/esm/server/oneServe.mjs.map +1 -1
  752. package/dist/esm/server/oneServe.native.js +16 -3
  753. package/dist/esm/server/oneServe.native.js.map +1 -1
  754. package/dist/esm/server/workerHandler.mjs +16 -3
  755. package/dist/esm/server/workerHandler.mjs.map +1 -1
  756. package/dist/esm/server/workerHandler.native.js +17 -3
  757. package/dist/esm/server/workerHandler.native.js.map +1 -1
  758. package/dist/esm/standardSchema.mjs +13 -0
  759. package/dist/esm/standardSchema.mjs.map +1 -0
  760. package/dist/esm/standardSchema.native.js +14 -0
  761. package/dist/esm/standardSchema.native.js.map +1 -0
  762. package/dist/esm/typed-routes/generateRouteTypes.mjs +27 -2
  763. package/dist/esm/typed-routes/generateRouteTypes.mjs.map +1 -1
  764. package/dist/esm/typed-routes/generateRouteTypes.native.js +69 -2
  765. package/dist/esm/typed-routes/generateRouteTypes.native.js.map +1 -1
  766. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.mjs +27 -10
  767. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.mjs.map +1 -1
  768. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +35 -9
  769. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -1
  770. package/dist/esm/typed-routes/searchParamSchemas.mjs +297 -0
  771. package/dist/esm/typed-routes/searchParamSchemas.mjs.map +1 -0
  772. package/dist/esm/typed-routes/searchParamSchemas.native.js +506 -0
  773. package/dist/esm/typed-routes/searchParamSchemas.native.js.map +1 -0
  774. package/dist/esm/typed-routes/searchSchemaEntries.mjs +15 -0
  775. package/dist/esm/typed-routes/searchSchemaEntries.mjs.map +1 -0
  776. package/dist/esm/typed-routes/searchSchemaEntries.native.js +17 -0
  777. package/dist/esm/typed-routes/searchSchemaEntries.native.js.map +1 -0
  778. package/dist/esm/useLoader.mjs +44 -34
  779. package/dist/esm/useLoader.mjs.map +1 -1
  780. package/dist/esm/useLoader.native.js +49 -37
  781. package/dist/esm/useLoader.native.js.map +1 -1
  782. package/dist/esm/utils/cleanUrl.mjs +25 -3
  783. package/dist/esm/utils/cleanUrl.mjs.map +1 -1
  784. package/dist/esm/utils/cleanUrl.native.js +25 -3
  785. package/dist/esm/utils/cleanUrl.native.js.map +1 -1
  786. package/dist/esm/validateParams.mjs +3 -4
  787. package/dist/esm/validateParams.mjs.map +1 -1
  788. package/dist/esm/validateParams.native.js +3 -5
  789. package/dist/esm/validateParams.native.js.map +1 -1
  790. package/dist/esm/{validateSearch.mjs → validateSearchParams.mjs} +18 -11
  791. package/dist/esm/validateSearchParams.mjs.map +1 -0
  792. package/dist/esm/{validateSearch.native.js → validateSearchParams.native.js} +18 -12
  793. package/dist/esm/validateSearchParams.native.js.map +1 -0
  794. package/dist/esm/vercel/build/generate/createSsrServerlessFunction.mjs +36 -2
  795. package/dist/esm/vercel/build/generate/createSsrServerlessFunction.mjs.map +1 -1
  796. package/dist/esm/vercel/build/generate/createSsrServerlessFunction.native.js +36 -2
  797. package/dist/esm/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -1
  798. package/dist/esm/vite/dom/browser.mjs +147 -0
  799. package/dist/esm/vite/dom/browser.mjs.map +1 -0
  800. package/dist/esm/vite/dom/browser.native.js +193 -0
  801. package/dist/esm/vite/dom/browser.native.js.map +1 -0
  802. package/dist/esm/vite/dom/directive.mjs +51 -0
  803. package/dist/esm/vite/dom/directive.mjs.map +1 -0
  804. package/dist/esm/vite/dom/directive.native.js +108 -0
  805. package/dist/esm/vite/dom/directive.native.js.map +1 -0
  806. package/dist/esm/vite/dom/registry.mjs +52 -0
  807. package/dist/esm/vite/dom/registry.mjs.map +1 -0
  808. package/dist/esm/vite/dom/registry.native.js +163 -0
  809. package/dist/esm/vite/dom/registry.native.js.map +1 -0
  810. package/dist/esm/vite/one.mjs +28 -3
  811. package/dist/esm/vite/one.mjs.map +1 -1
  812. package/dist/esm/vite/one.native.js +35 -10
  813. package/dist/esm/vite/one.native.js.map +1 -1
  814. package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs +1 -1
  815. package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs.map +1 -1
  816. package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js +1 -1
  817. package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
  818. package/dist/esm/vite/plugins/environmentGuardPlugin.mjs +6 -1
  819. package/dist/esm/vite/plugins/environmentGuardPlugin.mjs.map +1 -1
  820. package/dist/esm/vite/plugins/environmentGuardPlugin.native.js +6 -1
  821. package/dist/esm/vite/plugins/environmentGuardPlugin.native.js.map +1 -1
  822. package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs +11 -7
  823. package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs.map +1 -1
  824. package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +13 -7
  825. package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
  826. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.mjs +8 -2
  827. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.mjs.map +1 -1
  828. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +8 -2
  829. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
  830. package/dist/esm/vite/plugins/iosLinkSetPlugin.mjs +44 -0
  831. package/dist/esm/vite/plugins/iosLinkSetPlugin.mjs.map +1 -0
  832. package/dist/esm/vite/plugins/iosLinkSetPlugin.native.js +48 -0
  833. package/dist/esm/vite/plugins/iosLinkSetPlugin.native.js.map +1 -0
  834. package/dist/esm/vite/plugins/loaderSearchSchemasPlugin.mjs +48 -0
  835. package/dist/esm/vite/plugins/loaderSearchSchemasPlugin.mjs.map +1 -0
  836. package/dist/esm/vite/plugins/loaderSearchSchemasPlugin.native.js +86 -0
  837. package/dist/esm/vite/plugins/loaderSearchSchemasPlugin.native.js.map +1 -0
  838. package/dist/esm/vite/plugins/useDomPlugin.mjs +128 -22
  839. package/dist/esm/vite/plugins/useDomPlugin.mjs.map +1 -1
  840. package/dist/esm/vite/plugins/useDomPlugin.native.js +160 -22
  841. package/dist/esm/vite/plugins/useDomPlugin.native.js.map +1 -1
  842. package/env.d.ts +6 -6
  843. package/ios/DOM/OneDOMHostView.swift +389 -0
  844. package/ios/DOM/OneDOMResourceHandler.swift +147 -0
  845. package/ios/DOM/README.md +5 -0
  846. package/ios/Generated/OneNativeAddPassToWalletButtonComponentView.mm +11 -0
  847. package/ios/Generated/OneNativeAddPassToWalletButtonView.swift +4 -0
  848. package/ios/Generated/OneNativeChartComponentView.mm +10 -0
  849. package/ios/Generated/OneNativeChartView.swift +3 -0
  850. package/ios/Generated/OneNativeLivePhotoViewComponentView.mm +10 -0
  851. package/ios/Generated/OneNativeLivePhotoViewView.swift +4 -0
  852. package/ios/Generated/OneNativePayWithApplePayButtonComponentView.mm +11 -0
  853. package/ios/Generated/OneNativePayWithApplePayButtonView.swift +4 -0
  854. package/ios/Generated/OneNativePhotosPickerComponentView.mm +11 -0
  855. package/ios/Generated/OneNativePhotosPickerView.swift +4 -0
  856. package/ios/Generated/OneNativeProductViewComponentView.mm +11 -0
  857. package/ios/Generated/OneNativeProductViewView.swift +4 -0
  858. package/ios/Generated/OneNativeQuickLookComponentView.mm +10 -0
  859. package/ios/Generated/OneNativeQuickLookView.swift +4 -0
  860. package/ios/Generated/OneNativeSignInWithAppleButtonComponentView.mm +11 -0
  861. package/ios/Generated/OneNativeSignInWithAppleButtonView.swift +4 -0
  862. package/ios/Generated/OneNativeStoreViewComponentView.mm +11 -0
  863. package/ios/Generated/OneNativeStoreViewView.swift +4 -0
  864. package/ios/Generated/OneNativeSubscriptionStoreViewComponentView.mm +11 -0
  865. package/ios/Generated/OneNativeSubscriptionStoreViewView.swift +3 -0
  866. package/ios/Generated/OneNativeSwiftUI.swift +10 -0
  867. package/ios/Generated/OneNativeViewSlots.swift +16 -0
  868. package/ios/Nitro/HybridOneAppleAuth.swift +2 -0
  869. package/ios/Nitro/HybridOneBrowser.swift +2 -0
  870. package/ios/Nitro/HybridOneImagePicker.swift +2 -0
  871. package/ios/Nitro/HybridOneMailCompose.swift +2 -0
  872. package/ios/Nitro/HybridOneMessageCompose.swift +2 -0
  873. package/ios/Nitro/HybridOnePhotoLibrary.swift +10 -0
  874. package/ios/Nitro/HybridOnePurchases.swift +2 -0
  875. package/ios/Nitro/HybridOneStoreReview.swift +37 -0
  876. package/ios/Nitro/OneUpdatesLauncher.swift +24 -0
  877. package/ios/OneDOMHostComponentView.h +5 -0
  878. package/ios/OneDOMHostComponentView.mm +85 -0
  879. package/ios/OneNativeStyle.swift +426 -1
  880. package/ios-link-set.json +196 -0
  881. package/linux/cpp/CMakeLists.txt +160 -0
  882. package/linux/cpp/OneLinuxControlState.h +42 -0
  883. package/linux/cpp/OneLinuxControls.cpp +53 -0
  884. package/linux/cpp/OneLinuxControls.h +70 -0
  885. package/linux/cpp/OneLinuxNavigationComponent.h +86 -0
  886. package/linux/cpp/compat/OneLinuxStdCompat.h +6 -0
  887. package/linux/cpp/compat/OneLinuxThreadName.h +7 -0
  888. package/linux/cpp/deps/CMakeLists.txt +29 -0
  889. package/linux/cpp/deps/cmake-utils/react-native-flags.cmake +15 -0
  890. package/linux/cpp/imagemanager/OneLinuxImageManager.cpp +213 -0
  891. package/linux/cpp/nitro/NitroLinuxPlatform.cpp +67 -0
  892. package/linux/cpp/textlayoutmanager/OneLinuxText.cpp +258 -0
  893. package/linux/cpp/textlayoutmanager/OneLinuxText.h +34 -0
  894. package/linux/cpp/textlayoutmanager/react/renderer/textlayoutmanager/TextLayoutManager.cpp +101 -0
  895. package/linux/cpp/textlayoutmanager/react/renderer/textlayoutmanager/TextLayoutManager.h +35 -0
  896. package/linux/host/OneLinuxAppShell.cpp +267 -0
  897. package/linux/host/OneLinuxAppShell.h +46 -0
  898. package/linux/host/OneLinuxControl.cpp +515 -0
  899. package/linux/host/OneLinuxControl.h +23 -0
  900. package/linux/host/OneLinuxControlledValue.h +51 -0
  901. package/linux/host/OneLinuxHost.cpp +381 -0
  902. package/linux/host/OneLinuxHost.h +64 -0
  903. package/linux/host/OneLinuxModules.cpp +63 -0
  904. package/linux/host/OneLinuxModules.h +20 -0
  905. package/linux/host/OneLinuxMountingManager.cpp +747 -0
  906. package/linux/host/OneLinuxMountingManager.h +86 -0
  907. package/linux/host/OneLinuxNavigation.cpp +202 -0
  908. package/linux/host/OneLinuxNavigation.h +45 -0
  909. package/linux/host/OneLinuxNetwork.cpp +513 -0
  910. package/linux/host/OneLinuxNetwork.h +31 -0
  911. package/linux/host/OneLinuxNitro.cpp +24 -0
  912. package/linux/host/OneLinuxNitro.h +15 -0
  913. package/linux/host/OneLinuxOpSqlite.cpp +79 -0
  914. package/linux/host/OneLinuxOpSqlite.h +15 -0
  915. package/linux/host/OneLinuxPointer.cpp +373 -0
  916. package/linux/host/OneLinuxPointer.h +57 -0
  917. package/linux/host/OneLinuxRuntime.cpp +204 -0
  918. package/linux/host/OneLinuxRuntime.h +80 -0
  919. package/linux/host/OneLinuxStartup.cpp +58 -0
  920. package/linux/host/OneLinuxStartup.h +9 -0
  921. package/linux/host/OneLinuxTextInput.cpp +585 -0
  922. package/linux/host/OneLinuxTextInput.h +99 -0
  923. package/linux/host/OneLinuxView.cpp +540 -0
  924. package/linux/host/OneLinuxView.h +75 -0
  925. package/linux/host/OneLinuxWorklets.cpp +210 -0
  926. package/linux/host/OneLinuxWorklets.h +20 -0
  927. package/linux/host/main.cpp +89 -0
  928. package/linux/react-native/Libraries/Utilities/Platform.js +22 -0
  929. package/linux/scripts/build-core.sh +48 -0
  930. package/linux/scripts/bundle-js.sh +27 -0
  931. package/linux/scripts/cache.sh +22 -0
  932. package/linux/scripts/lima-vm.sh +26 -0
  933. package/linux/scripts/package-app.sh +118 -0
  934. package/linux/scripts/package-core.sh +20 -0
  935. package/linux/scripts/prepare-core.sh +54 -0
  936. package/linux/scripts/prepare-deps.sh +102 -0
  937. package/linux/scripts/prepare-hermes.sh +64 -0
  938. package/linux/scripts/prepare-icu.sh +40 -0
  939. package/linux/scripts/screenshot.sh +67 -0
  940. package/linux/smoke/main.cpp +228 -0
  941. package/linux/smoke/smoke.js +1 -0
  942. package/macos/README.md +170 -0
  943. package/macos/cpp/.gitkeep +0 -0
  944. package/macos/cpp/CMakeLists.txt +157 -0
  945. package/macos/cpp/OneMacButton/OneMacButtonComponentDescriptor.h +11 -0
  946. package/macos/cpp/OneMacButton/OneMacButtonEventEmitter.cpp +7 -0
  947. package/macos/cpp/OneMacButton/OneMacButtonEventEmitter.h +11 -0
  948. package/macos/cpp/OneMacButton/OneMacButtonProps.cpp +11 -0
  949. package/macos/cpp/OneMacButton/OneMacButtonProps.h +17 -0
  950. package/macos/cpp/OneMacButton/OneMacButtonShadowNode.h +28 -0
  951. package/macos/cpp/OneMacButton/OneMacButtonShadowNode.mm +15 -0
  952. package/macos/cpp/OneMacImage/OneMacImageComponentDescriptor.h +6 -0
  953. package/macos/cpp/OneMacImage/OneMacImageProps.cpp +11 -0
  954. package/macos/cpp/OneMacImage/OneMacImageProps.h +14 -0
  955. package/macos/cpp/OneMacImage/OneMacImageShadowNode.cpp +9 -0
  956. package/macos/cpp/OneMacImage/OneMacImageShadowNode.h +18 -0
  957. package/macos/cpp/OneMacPopUpButton/OneMacPopUpButtonComponentDescriptor.h +11 -0
  958. package/macos/cpp/OneMacPopUpButton/OneMacPopUpButtonEventEmitter.cpp +7 -0
  959. package/macos/cpp/OneMacPopUpButton/OneMacPopUpButtonEventEmitter.h +14 -0
  960. package/macos/cpp/OneMacPopUpButton/OneMacPopUpButtonProps.cpp +11 -0
  961. package/macos/cpp/OneMacPopUpButton/OneMacPopUpButtonProps.h +17 -0
  962. package/macos/cpp/OneMacPopUpButton/OneMacPopUpButtonShadowNode.h +28 -0
  963. package/macos/cpp/OneMacPopUpButton/OneMacPopUpButtonShadowNode.mm +16 -0
  964. package/macos/cpp/OneMacSegmentedControl/OneMacSegmentedControlComponentDescriptor.h +11 -0
  965. package/macos/cpp/OneMacSegmentedControl/OneMacSegmentedControlEventEmitter.cpp +7 -0
  966. package/macos/cpp/OneMacSegmentedControl/OneMacSegmentedControlEventEmitter.h +14 -0
  967. package/macos/cpp/OneMacSegmentedControl/OneMacSegmentedControlProps.cpp +12 -0
  968. package/macos/cpp/OneMacSegmentedControl/OneMacSegmentedControlProps.h +18 -0
  969. package/macos/cpp/OneMacSegmentedControl/OneMacSegmentedControlShadowNode.h +28 -0
  970. package/macos/cpp/OneMacSegmentedControl/OneMacSegmentedControlShadowNode.mm +15 -0
  971. package/macos/cpp/OneMacToggle/OneMacToggleComponentDescriptor.h +11 -0
  972. package/macos/cpp/OneMacToggle/OneMacToggleEventEmitter.cpp +13 -0
  973. package/macos/cpp/OneMacToggle/OneMacToggleEventEmitter.h +20 -0
  974. package/macos/cpp/OneMacToggle/OneMacToggleProps.cpp +17 -0
  975. package/macos/cpp/OneMacToggle/OneMacToggleProps.h +23 -0
  976. package/macos/cpp/OneMacToggle/OneMacToggleShadowNode.h +29 -0
  977. package/macos/cpp/OneMacToggle/OneMacToggleShadowNode.mm +27 -0
  978. package/macos/cpp/graphics/react/renderer/graphics/HostPlatformColor.h +129 -0
  979. package/macos/cpp/graphics/react/renderer/graphics/HostPlatformColor.mm +83 -0
  980. package/macos/cpp/graphics/react/renderer/graphics/PlatformColorParser.h +20 -0
  981. package/macos/cpp/graphics/react/renderer/graphics/PlatformColorParser.mm +38 -0
  982. package/macos/cpp/textlayoutmanager/OneMacosText.h +22 -0
  983. package/macos/cpp/textlayoutmanager/OneMacosText.mm +207 -0
  984. package/macos/cpp/textlayoutmanager/react/renderer/textlayoutmanager/TextLayoutManager.h +35 -0
  985. package/macos/cpp/textlayoutmanager/react/renderer/textlayoutmanager/TextLayoutManager.mm +74 -0
  986. package/macos/host/.gitkeep +0 -0
  987. package/macos/host/OneMacosAnimated.mm +91 -0
  988. package/macos/host/OneMacosAppCommands.h +36 -0
  989. package/macos/host/OneMacosAppCommands.mm +731 -0
  990. package/macos/host/OneMacosBlobStore.h +9 -0
  991. package/macos/host/OneMacosBlobStore.mm +50 -0
  992. package/macos/host/OneMacosButtonComponentView.h +3 -0
  993. package/macos/host/OneMacosButtonComponentView.mm +55 -0
  994. package/macos/host/OneMacosComponentView.h +67 -0
  995. package/macos/host/OneMacosComponentView.mm +533 -0
  996. package/macos/host/OneMacosControlsHosting.h +26 -0
  997. package/macos/host/OneMacosDebug.h +6 -0
  998. package/macos/host/OneMacosDebug.mm +337 -0
  999. package/macos/host/OneMacosImageComponentView.h +6 -0
  1000. package/macos/host/OneMacosImageComponentView.mm +245 -0
  1001. package/macos/host/OneMacosImageManager.mm +91 -0
  1002. package/macos/host/OneMacosModules.h +35 -0
  1003. package/macos/host/OneMacosModules.mm +287 -0
  1004. package/macos/host/OneMacosMountingManager.h +36 -0
  1005. package/macos/host/OneMacosMountingManager.mm +285 -0
  1006. package/macos/host/OneMacosNetworking.h +13 -0
  1007. package/macos/host/OneMacosNetworking.mm +263 -0
  1008. package/macos/host/OneMacosOpSqlite.h +15 -0
  1009. package/macos/host/OneMacosOpSqlite.mm +74 -0
  1010. package/macos/host/OneMacosParagraphComponentView.h +4 -0
  1011. package/macos/host/OneMacosParagraphComponentView.mm +35 -0
  1012. package/macos/host/OneMacosPointerHandler.h +27 -0
  1013. package/macos/host/OneMacosPointerHandler.mm +405 -0
  1014. package/macos/host/OneMacosPopUpButtonComponentView.h +3 -0
  1015. package/macos/host/OneMacosPopUpButtonComponentView.mm +50 -0
  1016. package/macos/host/OneMacosRootView.h +21 -0
  1017. package/macos/host/OneMacosRootView.mm +520 -0
  1018. package/macos/host/OneMacosRuntime.h +46 -0
  1019. package/macos/host/OneMacosRuntime.mm +133 -0
  1020. package/macos/host/OneMacosScrollViewComponentView.h +6 -0
  1021. package/macos/host/OneMacosScrollViewComponentView.mm +240 -0
  1022. package/macos/host/OneMacosSegmentedControlComponentView.h +3 -0
  1023. package/macos/host/OneMacosSegmentedControlComponentView.mm +51 -0
  1024. package/macos/host/OneMacosSymbolImageComponentView.h +3 -0
  1025. package/macos/host/OneMacosSymbolImageComponentView.mm +67 -0
  1026. package/macos/host/OneMacosTextInputComponentView.h +7 -0
  1027. package/macos/host/OneMacosTextInputComponentView.mm +729 -0
  1028. package/macos/host/OneMacosToggleComponentView.h +4 -0
  1029. package/macos/host/OneMacosToggleComponentView.mm +57 -0
  1030. package/macos/host/OneMacosToggleHosting.h +15 -0
  1031. package/macos/host/OneMacosWebSocket.h +22 -0
  1032. package/macos/host/OneMacosWebSocket.mm +161 -0
  1033. package/macos/host/OneMacosWorklets.cpp +139 -0
  1034. package/macos/host/OneMacosWorklets.h +29 -0
  1035. package/macos/host/OneMacosWorkletsPlatform.mm +88 -0
  1036. package/macos/host/swift/OneMacControls.swift +155 -0
  1037. package/macos/host/swift/OneMacToggle.swift +71 -0
  1038. package/macos/react-native/Libraries/Utilities/Platform.js +22 -0
  1039. package/macos/template/macos/OneApp/Info.plist +31 -0
  1040. package/macos/template/macos/OneApp/OneApp-Bridging-Header.h +3 -0
  1041. package/macos/template/macos/OneApp/OneApp.swift +20 -0
  1042. package/macos/template/macos/scripts/build-core.sh +29 -0
  1043. package/macos/template/macos/scripts/bundle-js.sh +29 -0
  1044. package/macos/template/macos/scripts/embed-deps.sh +20 -0
  1045. package/macos/template/macos/scripts/embed-hermes.sh +10 -0
  1046. package/macos/template/macos/scripts/prepare-deps.sh +29 -0
  1047. package/macos/template/macos/scripts/prepare-hermes.sh +29 -0
  1048. package/native-core/host/OneHostCommandPredicate.h +118 -0
  1049. package/native-core/host/OneHostModule.h +125 -0
  1050. package/native-core/host/OneHostModules.cpp +355 -0
  1051. package/native-core/host/OneHostModules.h +20 -0
  1052. package/native-core/host/OneHostRuntime.cpp +314 -0
  1053. package/native-core/host/OneHostRuntime.h +153 -0
  1054. package/native-core/rn-core.cmake +101 -0
  1055. package/nitrogen/generated/ios/One-Swift-Cxx-Bridge.cpp +17 -0
  1056. package/nitrogen/generated/ios/One-Swift-Cxx-Bridge.hpp +19 -2
  1057. package/nitrogen/generated/ios/One-Swift-Cxx-Umbrella.hpp +5 -0
  1058. package/nitrogen/generated/ios/OneAutolinking.mm +22 -0
  1059. package/nitrogen/generated/ios/OneAutolinking.swift +42 -16
  1060. package/nitrogen/generated/ios/c++/HybridOneStoreReviewSpecSwift.cpp +11 -0
  1061. package/nitrogen/generated/ios/c++/HybridOneStoreReviewSpecSwift.hpp +82 -0
  1062. package/nitrogen/generated/ios/swift/HybridOneStoreReviewSpec.swift +55 -0
  1063. package/nitrogen/generated/ios/swift/HybridOneStoreReviewSpec_cxx.swift +145 -0
  1064. package/package.json +47 -18
  1065. package/react-native.config.cjs +1 -0
  1066. package/src/cli/build.ts +1 -1
  1067. package/src/cli/iosLinkSet.ts +86 -0
  1068. package/src/cli/iosLinkSetAnalysis.ts +411 -0
  1069. package/src/cli/prebuild.ts +8 -1
  1070. package/src/cli/updatesPublish.ts +25 -24
  1071. package/src/cli.ts +3 -1
  1072. package/src/createApp.tsx +5 -0
  1073. package/src/createHandleRequest.ts +6 -32
  1074. package/src/dom/README.md +27 -0
  1075. package/src/dom/browserBridge.ts +185 -0
  1076. package/src/dom/client.tsx +75 -0
  1077. package/src/dom/context.ts +4 -0
  1078. package/src/dom/host.native.tsx +137 -0
  1079. package/src/dom/index.ts +109 -0
  1080. package/src/dom/measure.ts +32 -0
  1081. package/src/dom/nativeBridge.ts +143 -0
  1082. package/src/dom/peer.ts +150 -0
  1083. package/src/dom/protocol.ts +171 -0
  1084. package/src/dom/serialize.ts +126 -0
  1085. package/src/dom/types.ts +38 -0
  1086. package/src/fork/getPathFromState.test.ts +14 -0
  1087. package/src/fork/getPathFromState.ts +10 -1
  1088. package/src/hooks.tsx +129 -2
  1089. package/src/index.ts +10 -0
  1090. package/src/interfaces/router.ts +63 -1
  1091. package/src/layouts/Tabs.linux.tsx +15 -0
  1092. package/src/layouts/stack-navigator-desktop.tsx +8 -0
  1093. package/src/layouts/stack-navigator.linux.tsx +12 -0
  1094. package/src/layouts/stack-navigator.macos.tsx +9 -0
  1095. package/src/layouts/stack-utils/StackToolbarBottomHost.linux.tsx +1 -0
  1096. package/src/layouts/stack-utils/StackToolbarBottomHost.macos.tsx +17 -0
  1097. package/src/link/Link.tsx +5 -3
  1098. package/src/link/Link.web.tsx +8 -3
  1099. package/src/loaderResponseToModule.ts +42 -0
  1100. package/src/loaderSearchParams.ts +115 -0
  1101. package/src/one-shared.ts +361 -0
  1102. package/src/one.linux.ts +42 -0
  1103. package/src/one.macos.ts +29 -0
  1104. package/src/one.ts +2 -303
  1105. package/src/platform/adaptive/fixed.ts +27 -0
  1106. package/src/platform/adaptive/index.linux.ts +1 -0
  1107. package/src/platform/adaptive/index.macos.ts +11 -0
  1108. package/src/platform/adaptive/index.ts +1 -26
  1109. package/src/platform/controlTypes.ts +12 -0
  1110. package/src/platform/desktop/appCommandTypes.ts +33 -0
  1111. package/src/platform/desktop/createAppCommands.ts +40 -0
  1112. package/src/platform/desktop/createControls.tsx +64 -0
  1113. package/src/platform/linux/AppCommands.linux.ts +6 -0
  1114. package/src/platform/linux/Button.linux.tsx +15 -0
  1115. package/src/platform/linux/DropDown.linux.tsx +50 -0
  1116. package/src/platform/linux/NavigationView.linux.tsx +80 -0
  1117. package/src/platform/linux/OneLinuxButtonNativeComponent.ts +23 -0
  1118. package/src/platform/linux/OneLinuxDropDownNativeComponent.ts +35 -0
  1119. package/src/platform/linux/OneLinuxNavigationNativeComponent.ts +21 -0
  1120. package/src/platform/linux/OneLinuxProgressBarNativeComponent.ts +10 -0
  1121. package/src/platform/linux/OneLinuxSecureFieldNativeComponent.ts +16 -0
  1122. package/src/platform/linux/OneLinuxSegmentedControlNativeComponent.ts +24 -0
  1123. package/src/platform/linux/OneLinuxSliderNativeComponent.ts +29 -0
  1124. package/src/platform/linux/OneLinuxStepperNativeComponent.ts +27 -0
  1125. package/src/platform/linux/OneLinuxSwitchNativeComponent.ts +20 -0
  1126. package/src/platform/linux/OneLinuxTextFieldNativeComponent.ts +16 -0
  1127. package/src/platform/linux/OneLinuxToggleNativeComponent.ts +14 -0
  1128. package/src/platform/linux/ProgressBar.linux.tsx +21 -0
  1129. package/src/platform/linux/SecureField.linux.tsx +7 -0
  1130. package/src/platform/linux/SegmentedControl.linux.tsx +13 -0
  1131. package/src/platform/linux/Slider.linux.tsx +67 -0
  1132. package/src/platform/linux/Stepper.linux.tsx +52 -0
  1133. package/src/platform/linux/Switch.linux.tsx +23 -0
  1134. package/src/platform/linux/TextField.linux.tsx +27 -0
  1135. package/src/platform/linux/Toggle.linux.tsx +12 -0
  1136. package/src/platform/linux/Window.linux.ts +12 -0
  1137. package/src/platform/mac/AppCommands.macos.ts +8 -0
  1138. package/src/platform/mac/Button.macos.tsx +12 -0
  1139. package/src/platform/mac/Image.macos.tsx +41 -0
  1140. package/src/platform/mac/OneMacButtonNativeComponent.ts +14 -0
  1141. package/src/platform/mac/OneMacImageNativeComponent.ts +12 -0
  1142. package/src/platform/mac/OneMacPopUpButtonNativeComponent.ts +20 -0
  1143. package/src/platform/mac/OneMacSegmentedControlNativeComponent.ts +21 -0
  1144. package/src/platform/mac/OneMacToggleNativeComponent.ts +21 -0
  1145. package/src/platform/mac/PopUpButton.macos.tsx +31 -0
  1146. package/src/platform/mac/SegmentedControl.macos.tsx +11 -0
  1147. package/src/platform/mac/Toggle.macos.tsx +12 -0
  1148. package/src/platform/specs/OneDOMHostNativeComponent.ts +30 -0
  1149. package/src/platform/specs/OneStoreReview.nitro.ts +1 -1
  1150. package/src/platform/split-view/split-view.linux.tsx +1 -0
  1151. package/src/platform/split-view/split-view.macos.tsx +26 -0
  1152. package/src/platform/ui/Image.linux.tsx +1 -0
  1153. package/src/platform/ui/Image.macos.tsx +9 -0
  1154. package/src/router/getRoutes.ts +1 -1
  1155. package/src/router/router.ts +61 -13
  1156. package/src/searchParams.ts +163 -0
  1157. package/src/server/oneServe.ts +33 -3
  1158. package/src/server/workerHandler.ts +27 -3
  1159. package/src/standardSchema.ts +82 -0
  1160. package/src/typed-routes/generateRouteTypes.ts +49 -3
  1161. package/src/typed-routes/getTypedRoutesDeclarationFile.ts +62 -10
  1162. package/src/typed-routes/searchParamSchemas.ts +377 -0
  1163. package/src/typed-routes/searchSchemaEntries.ts +22 -0
  1164. package/src/types.ts +15 -2
  1165. package/src/useLoader.ts +91 -43
  1166. package/src/utils/cleanUrl.ts +43 -2
  1167. package/src/validateParams.ts +3 -14
  1168. package/src/{validateSearch.ts → validateSearchParams.ts} +33 -33
  1169. package/src/vercel/build/generate/createSsrServerlessFunction.ts +36 -2
  1170. package/src/vite/dom/README.md +91 -0
  1171. package/src/vite/dom/browser.ts +152 -0
  1172. package/src/vite/dom/build.test.ts +204 -0
  1173. package/src/vite/dom/directive.ts +76 -0
  1174. package/src/vite/dom/registry.ts +67 -0
  1175. package/src/vite/one-defines.test.ts +59 -1
  1176. package/src/vite/one.ts +59 -3
  1177. package/src/vite/plugins/clientTreeShakePlugin.ts +7 -1
  1178. package/src/vite/plugins/environmentGuardPlugin.ts +4 -4
  1179. package/src/vite/plugins/fileSystemRouterPlugin.tsx +33 -7
  1180. package/src/vite/plugins/generateFileSystemRouteTypesPlugin.tsx +10 -2
  1181. package/src/vite/plugins/iosLinkSetPlugin.ts +64 -0
  1182. package/src/vite/plugins/iosSdkPlugin.ts +4 -1
  1183. package/src/vite/plugins/kotlinSourcePlugin.ts +4 -1
  1184. package/src/vite/plugins/loaderSearchSchemasPlugin.ts +69 -0
  1185. package/src/vite/plugins/swiftPackagePlugin.ts +4 -1
  1186. package/src/vite/plugins/useDomPlugin.ts +182 -35
  1187. package/src/vite/types.ts +5 -1
  1188. package/types/cli/build.d.ts +1 -1
  1189. package/types/cli/build.d.ts.map +1 -1
  1190. package/types/cli/iosLinkSet.d.ts +9 -0
  1191. package/types/cli/iosLinkSet.d.ts.map +1 -0
  1192. package/types/cli/iosLinkSetAnalysis.d.ts +25 -0
  1193. package/types/cli/iosLinkSetAnalysis.d.ts.map +1 -0
  1194. package/types/cli/prebuild.d.ts.map +1 -1
  1195. package/types/cli/updatesPublish.d.ts.map +1 -1
  1196. package/types/createApp.d.ts +8 -0
  1197. package/types/createApp.d.ts.map +1 -1
  1198. package/types/createHandleRequest.d.ts.map +1 -1
  1199. package/types/dom/browserBridge.d.ts +34 -0
  1200. package/types/dom/browserBridge.d.ts.map +1 -0
  1201. package/types/dom/client.d.ts +8 -0
  1202. package/types/dom/client.d.ts.map +1 -0
  1203. package/types/dom/context.d.ts +3 -0
  1204. package/types/dom/context.d.ts.map +1 -0
  1205. package/types/dom/host.native.d.ts +6 -0
  1206. package/types/dom/host.native.d.ts.map +1 -0
  1207. package/types/dom/index.d.ts +8 -0
  1208. package/types/dom/index.d.ts.map +1 -0
  1209. package/types/dom/measure.d.ts +3 -0
  1210. package/types/dom/measure.d.ts.map +1 -0
  1211. package/types/dom/nativeBridge.d.ts +32 -0
  1212. package/types/dom/nativeBridge.d.ts.map +1 -0
  1213. package/types/dom/peer.d.ts +26 -0
  1214. package/types/dom/peer.d.ts.map +1 -0
  1215. package/types/dom/protocol.d.ts +54 -0
  1216. package/types/dom/protocol.d.ts.map +1 -0
  1217. package/types/dom/serialize.d.ts +21 -0
  1218. package/types/dom/serialize.d.ts.map +1 -0
  1219. package/types/dom/types.d.ts +32 -0
  1220. package/types/dom/types.d.ts.map +1 -0
  1221. package/types/fork/getPathFromState.d.ts.map +1 -1
  1222. package/types/hooks.d.ts +30 -3
  1223. package/types/hooks.d.ts.map +1 -1
  1224. package/types/index.d.ts +3 -0
  1225. package/types/index.d.ts.map +1 -1
  1226. package/types/interfaces/router.d.ts +41 -1
  1227. package/types/interfaces/router.d.ts.map +1 -1
  1228. package/types/layouts/Tabs.linux.d.ts +212 -0
  1229. package/types/layouts/Tabs.linux.d.ts.map +1 -0
  1230. package/types/layouts/stack-navigator-desktop.d.ts +9 -0
  1231. package/types/layouts/stack-navigator-desktop.d.ts.map +1 -0
  1232. package/types/layouts/stack-navigator.linux.d.ts +3 -0
  1233. package/types/layouts/stack-navigator.linux.d.ts.map +1 -0
  1234. package/types/layouts/stack-navigator.macos.d.ts +7 -0
  1235. package/types/layouts/stack-navigator.macos.d.ts.map +1 -0
  1236. package/types/layouts/stack-utils/StackToolbarBottomHost.linux.d.ts +2 -0
  1237. package/types/layouts/stack-utils/StackToolbarBottomHost.linux.d.ts.map +1 -0
  1238. package/types/layouts/stack-utils/StackToolbarBottomHost.macos.d.ts +8 -0
  1239. package/types/layouts/stack-utils/StackToolbarBottomHost.macos.d.ts.map +1 -0
  1240. package/types/link/Link.d.ts.map +1 -1
  1241. package/types/link/Link.web.d.ts.map +1 -1
  1242. package/types/loaderResponseToModule.d.ts +7 -0
  1243. package/types/loaderResponseToModule.d.ts.map +1 -0
  1244. package/types/loaderSearchParams.d.ts +30 -0
  1245. package/types/loaderSearchParams.d.ts.map +1 -0
  1246. package/types/one-shared.d.ts +151 -0
  1247. package/types/one-shared.d.ts.map +1 -0
  1248. package/types/one.d.ts +1 -100
  1249. package/types/one.d.ts.map +1 -1
  1250. package/types/one.linux.d.ts +3 -0
  1251. package/types/one.linux.d.ts.map +1 -0
  1252. package/types/one.macos.d.ts +3 -0
  1253. package/types/one.macos.d.ts.map +1 -0
  1254. package/types/platform/adaptive/fixed.d.ts +7 -0
  1255. package/types/platform/adaptive/fixed.d.ts.map +1 -0
  1256. package/types/platform/adaptive/index.d.ts +1 -6
  1257. package/types/platform/adaptive/index.d.ts.map +1 -1
  1258. package/types/platform/adaptive/index.linux.d.ts +2 -0
  1259. package/types/platform/adaptive/index.linux.d.ts.map +1 -0
  1260. package/types/platform/adaptive/index.macos.d.ts +6 -0
  1261. package/types/platform/adaptive/index.macos.d.ts.map +1 -0
  1262. package/types/platform/controlTypes.d.ts +18 -0
  1263. package/types/platform/controlTypes.d.ts.map +1 -0
  1264. package/types/platform/desktop/appCommandTypes.d.ts +41 -0
  1265. package/types/platform/desktop/appCommandTypes.d.ts.map +1 -0
  1266. package/types/platform/desktop/createAppCommands.d.ts +6 -0
  1267. package/types/platform/desktop/createAppCommands.d.ts.map +1 -0
  1268. package/types/platform/desktop/createControls.d.ts +31 -0
  1269. package/types/platform/desktop/createControls.d.ts.map +1 -0
  1270. package/types/platform/linux/AppCommands.linux.d.ts +8 -0
  1271. package/types/platform/linux/AppCommands.linux.d.ts.map +1 -0
  1272. package/types/platform/linux/Button.linux.d.ts +4 -0
  1273. package/types/platform/linux/Button.linux.d.ts.map +1 -0
  1274. package/types/platform/linux/DropDown.linux.d.ts +26 -0
  1275. package/types/platform/linux/DropDown.linux.d.ts.map +1 -0
  1276. package/types/platform/linux/NavigationView.linux.d.ts +7 -0
  1277. package/types/platform/linux/NavigationView.linux.d.ts.map +1 -0
  1278. package/types/platform/linux/OneLinuxButtonNativeComponent.d.ts +17 -0
  1279. package/types/platform/linux/OneLinuxButtonNativeComponent.d.ts.map +1 -0
  1280. package/types/platform/linux/OneLinuxDropDownNativeComponent.d.ts +29 -0
  1281. package/types/platform/linux/OneLinuxDropDownNativeComponent.d.ts.map +1 -0
  1282. package/types/platform/linux/OneLinuxNavigationNativeComponent.d.ts +23 -0
  1283. package/types/platform/linux/OneLinuxNavigationNativeComponent.d.ts.map +1 -0
  1284. package/types/platform/linux/OneLinuxProgressBarNativeComponent.d.ts +9 -0
  1285. package/types/platform/linux/OneLinuxProgressBarNativeComponent.d.ts.map +1 -0
  1286. package/types/platform/linux/OneLinuxSecureFieldNativeComponent.d.ts +22 -0
  1287. package/types/platform/linux/OneLinuxSecureFieldNativeComponent.d.ts.map +1 -0
  1288. package/types/platform/linux/OneLinuxSegmentedControlNativeComponent.d.ts +18 -0
  1289. package/types/platform/linux/OneLinuxSegmentedControlNativeComponent.d.ts.map +1 -0
  1290. package/types/platform/linux/OneLinuxSliderNativeComponent.d.ts +26 -0
  1291. package/types/platform/linux/OneLinuxSliderNativeComponent.d.ts.map +1 -0
  1292. package/types/platform/linux/OneLinuxStepperNativeComponent.d.ts +21 -0
  1293. package/types/platform/linux/OneLinuxStepperNativeComponent.d.ts.map +1 -0
  1294. package/types/platform/linux/OneLinuxSwitchNativeComponent.d.ts +16 -0
  1295. package/types/platform/linux/OneLinuxSwitchNativeComponent.d.ts.map +1 -0
  1296. package/types/platform/linux/OneLinuxTextFieldNativeComponent.d.ts +22 -0
  1297. package/types/platform/linux/OneLinuxTextFieldNativeComponent.d.ts.map +1 -0
  1298. package/types/platform/linux/OneLinuxToggleNativeComponent.d.ts +18 -0
  1299. package/types/platform/linux/OneLinuxToggleNativeComponent.d.ts.map +1 -0
  1300. package/types/platform/linux/ProgressBar.linux.d.ts +7 -0
  1301. package/types/platform/linux/ProgressBar.linux.d.ts.map +1 -0
  1302. package/types/platform/linux/SecureField.linux.d.ts +4 -0
  1303. package/types/platform/linux/SecureField.linux.d.ts.map +1 -0
  1304. package/types/platform/linux/SegmentedControl.linux.d.ts +5 -0
  1305. package/types/platform/linux/SegmentedControl.linux.d.ts.map +1 -0
  1306. package/types/platform/linux/Slider.linux.d.ts +19 -0
  1307. package/types/platform/linux/Slider.linux.d.ts.map +1 -0
  1308. package/types/platform/linux/Stepper.linux.d.ts +11 -0
  1309. package/types/platform/linux/Stepper.linux.d.ts.map +1 -0
  1310. package/types/platform/linux/Switch.linux.d.ts +9 -0
  1311. package/types/platform/linux/Switch.linux.d.ts.map +1 -0
  1312. package/types/platform/linux/TextField.linux.d.ts +13 -0
  1313. package/types/platform/linux/TextField.linux.d.ts.map +1 -0
  1314. package/types/platform/linux/Toggle.linux.d.ts +4 -0
  1315. package/types/platform/linux/Toggle.linux.d.ts.map +1 -0
  1316. package/types/platform/linux/Window.linux.d.ts +4 -0
  1317. package/types/platform/linux/Window.linux.d.ts.map +1 -0
  1318. package/types/platform/mac/AppCommands.macos.d.ts +7 -0
  1319. package/types/platform/mac/AppCommands.macos.d.ts.map +1 -0
  1320. package/types/platform/mac/Button.macos.d.ts +7 -0
  1321. package/types/platform/mac/Button.macos.d.ts.map +1 -0
  1322. package/types/platform/mac/Image.macos.d.ts +11 -0
  1323. package/types/platform/mac/Image.macos.d.ts.map +1 -0
  1324. package/types/platform/mac/OneMacButtonNativeComponent.d.ts +13 -0
  1325. package/types/platform/mac/OneMacButtonNativeComponent.d.ts.map +1 -0
  1326. package/types/platform/mac/OneMacImageNativeComponent.d.ts +11 -0
  1327. package/types/platform/mac/OneMacImageNativeComponent.d.ts.map +1 -0
  1328. package/types/platform/mac/OneMacPopUpButtonNativeComponent.d.ts +18 -0
  1329. package/types/platform/mac/OneMacPopUpButtonNativeComponent.d.ts.map +1 -0
  1330. package/types/platform/mac/OneMacSegmentedControlNativeComponent.d.ts +19 -0
  1331. package/types/platform/mac/OneMacSegmentedControlNativeComponent.d.ts.map +1 -0
  1332. package/types/platform/mac/OneMacToggleNativeComponent.d.ts +17 -0
  1333. package/types/platform/mac/OneMacToggleNativeComponent.d.ts.map +1 -0
  1334. package/types/platform/mac/PopUpButton.macos.d.ts +14 -0
  1335. package/types/platform/mac/PopUpButton.macos.d.ts.map +1 -0
  1336. package/types/platform/mac/SegmentedControl.macos.d.ts +4 -0
  1337. package/types/platform/mac/SegmentedControl.macos.d.ts.map +1 -0
  1338. package/types/platform/mac/Toggle.macos.d.ts +5 -0
  1339. package/types/platform/mac/Toggle.macos.d.ts.map +1 -0
  1340. package/types/platform/specs/OneDOMHostNativeComponent.d.ts +34 -0
  1341. package/types/platform/specs/OneDOMHostNativeComponent.d.ts.map +1 -0
  1342. package/types/platform/specs/OneStoreReview.nitro.d.ts +1 -0
  1343. package/types/platform/specs/OneStoreReview.nitro.d.ts.map +1 -1
  1344. package/types/platform/split-view/split-view.linux.d.ts +2 -0
  1345. package/types/platform/split-view/split-view.linux.d.ts.map +1 -0
  1346. package/types/platform/split-view/split-view.macos.d.ts +16 -0
  1347. package/types/platform/split-view/split-view.macos.d.ts.map +1 -0
  1348. package/types/platform/ui/Image.linux.d.ts +2 -0
  1349. package/types/platform/ui/Image.linux.d.ts.map +1 -0
  1350. package/types/platform/ui/Image.macos.d.ts +3 -0
  1351. package/types/platform/ui/Image.macos.d.ts.map +1 -0
  1352. package/types/router/createRoute.d.ts +26 -3
  1353. package/types/router/createRoute.d.ts.map +1 -1
  1354. package/types/router/router.d.ts +6 -0
  1355. package/types/router/router.d.ts.map +1 -1
  1356. package/types/searchParams.d.ts +58 -0
  1357. package/types/searchParams.d.ts.map +1 -0
  1358. package/types/server/oneServe.d.ts.map +1 -1
  1359. package/types/server/workerHandler.d.ts.map +1 -1
  1360. package/types/standardSchema.d.ts +47 -0
  1361. package/types/standardSchema.d.ts.map +1 -0
  1362. package/types/typed-routes/generateRouteTypes.d.ts +5 -1
  1363. package/types/typed-routes/generateRouteTypes.d.ts.map +1 -1
  1364. package/types/typed-routes/getTypedRoutesDeclarationFile.d.ts +8 -1
  1365. package/types/typed-routes/getTypedRoutesDeclarationFile.d.ts.map +1 -1
  1366. package/types/typed-routes/searchParamSchemas.d.ts +34 -0
  1367. package/types/typed-routes/searchParamSchemas.d.ts.map +1 -0
  1368. package/types/typed-routes/searchSchemaEntries.d.ts +9 -0
  1369. package/types/typed-routes/searchSchemaEntries.d.ts.map +1 -0
  1370. package/types/types.d.ts +10 -2
  1371. package/types/types.d.ts.map +1 -1
  1372. package/types/useLoader.d.ts +2 -2
  1373. package/types/useLoader.d.ts.map +1 -1
  1374. package/types/utils/cleanUrl.d.ts +11 -1
  1375. package/types/utils/cleanUrl.d.ts.map +1 -1
  1376. package/types/validateParams.d.ts +1 -1
  1377. package/types/validateParams.d.ts.map +1 -1
  1378. package/types/{validateSearch.d.ts → validateSearchParams.d.ts} +13 -19
  1379. package/types/validateSearchParams.d.ts.map +1 -0
  1380. package/types/vercel/build/generate/createSsrServerlessFunction.d.ts.map +1 -1
  1381. package/types/vite/dom/browser.d.ts +8 -0
  1382. package/types/vite/dom/browser.d.ts.map +1 -0
  1383. package/types/vite/dom/directive.d.ts +6 -0
  1384. package/types/vite/dom/directive.d.ts.map +1 -0
  1385. package/types/vite/dom/registry.d.ts +23 -0
  1386. package/types/vite/dom/registry.d.ts.map +1 -0
  1387. package/types/vite/one.d.ts.map +1 -1
  1388. package/types/vite/plugins/clientTreeShakePlugin.d.ts.map +1 -1
  1389. package/types/vite/plugins/environmentGuardPlugin.d.ts +2 -2
  1390. package/types/vite/plugins/fileSystemRouterPlugin.d.ts.map +1 -1
  1391. package/types/vite/plugins/generateFileSystemRouteTypesPlugin.d.ts.map +1 -1
  1392. package/types/vite/plugins/iosLinkSetPlugin.d.ts +3 -0
  1393. package/types/vite/plugins/iosLinkSetPlugin.d.ts.map +1 -0
  1394. package/types/vite/plugins/iosSdkPlugin.d.ts +1 -1
  1395. package/types/vite/plugins/iosSdkPlugin.d.ts.map +1 -1
  1396. package/types/vite/plugins/kotlinSourcePlugin.d.ts +1 -1
  1397. package/types/vite/plugins/kotlinSourcePlugin.d.ts.map +1 -1
  1398. package/types/vite/plugins/loaderSearchSchemasPlugin.d.ts +14 -0
  1399. package/types/vite/plugins/loaderSearchSchemasPlugin.d.ts.map +1 -0
  1400. package/types/vite/plugins/swiftPackagePlugin.d.ts +1 -1
  1401. package/types/vite/plugins/swiftPackagePlugin.d.ts.map +1 -1
  1402. package/types/vite/plugins/useDomPlugin.d.ts +8 -1
  1403. package/types/vite/plugins/useDomPlugin.d.ts.map +1 -1
  1404. package/types/vite/types.d.ts +5 -1
  1405. package/types/vite/types.d.ts.map +1 -1
  1406. package/dist/cjs/platform/store-review/backend.ios.cjs +0 -47
  1407. package/dist/cjs/platform/store-review/backend.ios.js +0 -49
  1408. package/dist/cjs/platform/store-review/backend.ios.js.map +0 -1
  1409. package/dist/cjs/validateSearch.native.js.map +0 -1
  1410. package/dist/esm/one.mjs.map +0 -1
  1411. package/dist/esm/one.native.js.map +0 -1
  1412. package/dist/esm/platform/adaptive/index.mjs.map +0 -1
  1413. package/dist/esm/platform/store-review/backend.ios.js +0 -26
  1414. package/dist/esm/platform/store-review/backend.ios.js.map +0 -1
  1415. package/dist/esm/validateSearch.mjs.map +0 -1
  1416. package/dist/esm/validateSearch.native.js.map +0 -1
  1417. package/src/platform/store-review/backend.ios.ts +0 -28
  1418. package/types/platform/store-review/backend.ios.d.ts +0 -6
  1419. package/types/platform/store-review/backend.ios.d.ts.map +0 -1
  1420. package/types/validateSearch.d.ts.map +0 -1
@@ -1,12 +1,24 @@
1
1
  import { readFile, writeFile } from "node:fs/promises";
2
- import { dirname, join } from "node:path";
2
+ import { dirname, join, relative } from "node:path";
3
3
  import FSExtra from "fs-extra";
4
4
  import { removeSupportedExtensions } from "../router/matchers.mjs";
5
5
  import { globbedRoutesToRouteContext } from "../router/useViteRoutes.mjs";
6
6
  import { getRoutePaths } from "../utils/routeIndex.mjs";
7
7
  import { getTypedRoutesDeclarationFile } from "./getTypedRoutesDeclarationFile.mjs";
8
+ import { createSearchSchemaScanner } from "./searchParamSchemas.mjs";
8
9
  import { injectRouteHelpers } from "./injectRouteHelpers.mjs";
10
+ import { getSearchSchemaEntries } from "./searchSchemaEntries.mjs";
9
11
 
12
+ const warnedUnassociated = /* @__PURE__ */ new Set();
13
+ function toSearchSchemaType(outDir, ref) {
14
+ let specifier = ref.module;
15
+ if (ref.isFile) {
16
+ specifier = relative(outDir, ref.module).replaceAll("\\", "/").replace(/\.(tsx?|jsx?|mjs)$/, "");
17
+ if (!specifier.startsWith(".")) specifier = `./${specifier}`;
18
+ }
19
+ const quote = (text) => `'${text.replace(/[\\']/g, "\\$&")}'`;
20
+ return `typeof import(${quote(specifier)})[${quote(ref.name)}]`;
21
+ }
10
22
  async function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedRoutesMode, routePathsIn) {
11
23
  const routePaths = routePathsIn ?? getRoutePaths(routerRoot, ignoredRouteFiles);
12
24
  const routes = routePaths.reduce((acc, cur) => {
@@ -15,8 +27,20 @@ async function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedR
15
27
  return acc;
16
28
  }, {});
17
29
  const context = globbedRoutesToRouteContext(routes, routerRoot);
18
- const declarations = getTypedRoutesDeclarationFile(context);
19
30
  const outDir = dirname(outFile);
31
+ const { scan: scanSearchSchemas } = createSearchSchemaScanner(process.cwd());
32
+ const scannedFiles = /* @__PURE__ */ new Set();
33
+ const declarations = getTypedRoutesDeclarationFile(context, { getSearchParamTypes(contextKey) {
34
+ const scan = scanSearchSchemas(getSearchSchemaEntries(routePaths, contextKey).map((key) => join(process.cwd(), routerRoot, key)));
35
+ for (const file of scan.files) scannedFiles.add(file);
36
+ for (const { file, line } of scan.unassociated) {
37
+ const where = `${relative(process.cwd(), file)}:${line}`;
38
+ if (warnedUnassociated.has(where)) continue;
39
+ warnedUnassociated.add(where);
40
+ console.warn(`[one] ${where}: useSearchParams(schema) needs the schema to be an exported constant (or an import of one) so links can be typed from it`);
41
+ }
42
+ return scan.schemas.map((ref) => toSearchSchemaType(outDir, ref));
43
+ } });
20
44
  let currentDeclarations;
21
45
  try {
22
46
  currentDeclarations = await readFile(outFile, "utf8");
@@ -47,6 +71,7 @@ async function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedR
47
71
  await injectRouteHelpers(fullPath, cleanRouteName, mode);
48
72
  }
49
73
  }
74
+ return scannedFiles;
50
75
  }
51
76
 
52
77
  export { generateRouteTypes };
@@ -1 +1 @@
1
- {"version":3,"file":"generateRouteTypes.js","names":[],"sources":["esm/typed-routes/generateRouteTypes.js"],"sourcesContent":["import { readFile, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport FSExtra from \"fs-extra\";\nimport { removeSupportedExtensions } from \"../router/matchers\";\nimport { globbedRoutesToRouteContext } from \"../router/useViteRoutes\";\nimport { getRoutePaths } from \"../utils/routeIndex\";\nimport { getTypedRoutesDeclarationFile } from \"./getTypedRoutesDeclarationFile\";\nimport { injectRouteHelpers } from \"./injectRouteHelpers\";\nasync function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedRoutesMode, routePathsIn) {\n const routePaths = routePathsIn ?? getRoutePaths(routerRoot, ignoredRouteFiles);\n const routes = routePaths.reduce((acc, cur) => {\n const vitePath = `/${routerRoot}/${cur.replace(/^\\.\\//, \"\")}`;\n acc[vitePath] = {};\n return acc;\n }, {});\n const context = globbedRoutesToRouteContext(routes, routerRoot);\n const declarations = getTypedRoutesDeclarationFile(context);\n const outDir = dirname(outFile);\n let currentDeclarations;\n try {\n currentDeclarations = await readFile(outFile, \"utf8\");\n } catch (error) {\n if (error.code !== \"ENOENT\") {\n throw error;\n }\n }\n if (currentDeclarations !== declarations) {\n await FSExtra.ensureDir(outDir);\n await writeFile(outFile, declarations);\n }\n if (typedRoutesMode) {\n const mode = typedRoutesMode === \"type\" ? \"type\" : \"runtime\";\n for (const routePath of routePaths) {\n if (routePath.includes(\"_layout\") || routePath.includes(\"+api\") || routePath.startsWith(\"_\") || routePath.endsWith(\".d.ts\")) {\n continue;\n }\n const fullPath = join(process.cwd(), routerRoot, routePath);\n const routeName = routePath.replace(/^\\.\\//, \"\").replace(/\\+[^/]*$/, \"\").replace(/\\/index$/, \"\").replace(/index$/, \"\");\n let cleanRouteName = removeSupportedExtensions(routeName).replace(/\\/?index$/, \"\");\n if (!cleanRouteName.startsWith(\"/\")) {\n cleanRouteName = \"/\" + cleanRouteName;\n }\n if (!cleanRouteName.includes(\"[\")) {\n continue;\n }\n await injectRouteHelpers(fullPath, cleanRouteName, mode);\n }\n }\n}\nexport {\n generateRouteTypes\n};\n//# sourceMappingURL=generateRouteTypes.js.map\n"],"mappings":";;;;;;;;;;AAQA,eAAe,mBAAmB,SAAS,YAAY,mBAAmB,iBAAiB,cAAc;CACvG,MAAM,aAAa,gBAAgB,cAAc,YAAY,iBAAiB;CAC9E,MAAM,SAAS,WAAW,QAAQ,KAAK,QAAQ;EAC7C,MAAM,WAAW,IAAI,WAAW,GAAG,IAAI,QAAQ,SAAS,EAAE;EAC1D,IAAI,YAAY,CAAC;EACjB,OAAO;CACT,GAAG,CAAC,CAAC;CACL,MAAM,UAAU,4BAA4B,QAAQ,UAAU;CAC9D,MAAM,eAAe,8BAA8B,OAAO;CAC1D,MAAM,SAAS,QAAQ,OAAO;CAC9B,IAAI;CACJ,IAAI;EACF,sBAAsB,MAAM,SAAS,SAAS,MAAM;CACtD,SAAS,OAAO;EACd,IAAI,MAAM,SAAS,UAAU;GAC3B,MAAM;EACR;CACF;CACA,IAAI,wBAAwB,cAAc;EACxC,MAAM,QAAQ,UAAU,MAAM;EAC9B,MAAM,UAAU,SAAS,YAAY;CACvC;CACA,IAAI,iBAAiB;EACnB,MAAM,OAAO,oBAAoB,SAAS,SAAS;EACnD,KAAK,MAAM,aAAa,YAAY;GAClC,IAAI,UAAU,SAAS,SAAS,KAAK,UAAU,SAAS,MAAM,KAAK,UAAU,WAAW,GAAG,KAAK,UAAU,SAAS,OAAO,GAAG;IAC3H;GACF;GACA,MAAM,WAAW,KAAK,QAAQ,IAAI,GAAG,YAAY,SAAS;GAC1D,MAAM,YAAY,UAAU,QAAQ,SAAS,EAAE,CAAC,CAAC,QAAQ,YAAY,EAAE,CAAC,CAAC,QAAQ,YAAY,EAAE,CAAC,CAAC,QAAQ,UAAU,EAAE;GACrH,IAAI,iBAAiB,0BAA0B,SAAS,CAAC,CAAC,QAAQ,aAAa,EAAE;GACjF,IAAI,CAAC,eAAe,WAAW,GAAG,GAAG;IACnC,iBAAiB,MAAM;GACzB;GACA,IAAI,CAAC,eAAe,SAAS,GAAG,GAAG;IACjC;GACF;GACA,MAAM,mBAAmB,UAAU,gBAAgB,IAAI;EACzD;CACF;AACF"}
1
+ {"version":3,"file":"generateRouteTypes.js","names":[],"sources":["esm/typed-routes/generateRouteTypes.js"],"sourcesContent":["import { readFile, writeFile } from \"node:fs/promises\";\nimport { dirname, join, relative } from \"node:path\";\nimport FSExtra from \"fs-extra\";\nimport { removeSupportedExtensions } from \"../router/matchers\";\nimport { globbedRoutesToRouteContext } from \"../router/useViteRoutes\";\nimport { getRoutePaths } from \"../utils/routeIndex\";\nimport { getTypedRoutesDeclarationFile } from \"./getTypedRoutesDeclarationFile\";\nimport {\n createSearchSchemaScanner\n} from \"./searchParamSchemas\";\nimport { injectRouteHelpers } from \"./injectRouteHelpers\";\nimport { getSearchSchemaEntries } from \"./searchSchemaEntries\";\nconst warnedUnassociated = /* @__PURE__ */ new Set();\nfunction toSearchSchemaType(outDir, ref) {\n let specifier = ref.module;\n if (ref.isFile) {\n specifier = relative(outDir, ref.module).replaceAll(\"\\\\\", \"/\").replace(/\\.(tsx?|jsx?|mjs)$/, \"\");\n if (!specifier.startsWith(\".\")) specifier = `./${specifier}`;\n }\n const quote = (text) => `'${text.replace(/[\\\\']/g, \"\\\\$&\")}'`;\n return `typeof import(${quote(specifier)})[${quote(ref.name)}]`;\n}\nasync function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedRoutesMode, routePathsIn) {\n const routePaths = routePathsIn ?? getRoutePaths(routerRoot, ignoredRouteFiles);\n const routes = routePaths.reduce((acc, cur) => {\n const vitePath = `/${routerRoot}/${cur.replace(/^\\.\\//, \"\")}`;\n acc[vitePath] = {};\n return acc;\n }, {});\n const context = globbedRoutesToRouteContext(routes, routerRoot);\n const outDir = dirname(outFile);\n const { scan: scanSearchSchemas } = createSearchSchemaScanner(process.cwd());\n const scannedFiles = /* @__PURE__ */ new Set();\n const declarations = getTypedRoutesDeclarationFile(context, {\n getSearchParamTypes(contextKey) {\n const scan = scanSearchSchemas(\n getSearchSchemaEntries(routePaths, contextKey).map(\n (key) => join(process.cwd(), routerRoot, key)\n )\n );\n for (const file of scan.files) scannedFiles.add(file);\n for (const { file, line } of scan.unassociated) {\n const where = `${relative(process.cwd(), file)}:${line}`;\n if (warnedUnassociated.has(where)) continue;\n warnedUnassociated.add(where);\n console.warn(\n `[one] ${where}: useSearchParams(schema) needs the schema to be an exported constant (or an import of one) so links can be typed from it`\n );\n }\n return scan.schemas.map((ref) => toSearchSchemaType(outDir, ref));\n }\n });\n let currentDeclarations;\n try {\n currentDeclarations = await readFile(outFile, \"utf8\");\n } catch (error) {\n if (error.code !== \"ENOENT\") {\n throw error;\n }\n }\n if (currentDeclarations !== declarations) {\n await FSExtra.ensureDir(outDir);\n await writeFile(outFile, declarations);\n }\n if (typedRoutesMode) {\n const mode = typedRoutesMode === \"type\" ? \"type\" : \"runtime\";\n for (const routePath of routePaths) {\n if (routePath.includes(\"_layout\") || routePath.includes(\"+api\") || routePath.startsWith(\"_\") || routePath.endsWith(\".d.ts\")) {\n continue;\n }\n const fullPath = join(process.cwd(), routerRoot, routePath);\n const routeName = routePath.replace(/^\\.\\//, \"\").replace(/\\+[^/]*$/, \"\").replace(/\\/index$/, \"\").replace(/index$/, \"\");\n let cleanRouteName = removeSupportedExtensions(routeName).replace(/\\/?index$/, \"\");\n if (!cleanRouteName.startsWith(\"/\")) {\n cleanRouteName = \"/\" + cleanRouteName;\n }\n if (!cleanRouteName.includes(\"[\")) {\n continue;\n }\n await injectRouteHelpers(fullP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join, relative } from "path";
3
3
  import FSExtra from "fs-extra";
4
4
  import { removeSupportedExtensions } from "../router/matchers.native.js";
5
5
  import { globbedRoutesToRouteContext } from "../router/useViteRoutes.native.js";
6
6
  import { getRoutePaths } from "../utils/routeIndex.native.js";
7
7
  import { getTypedRoutesDeclarationFile } from "./getTypedRoutesDeclarationFile.native.js";
8
+ import { createSearchSchemaScanner } from "./searchParamSchemas.native.js";
8
9
  import { injectRouteHelpers } from "./injectRouteHelpers.native.js";
10
+ import { getSearchSchemaEntries } from "./searchSchemaEntries.native.js";
9
11
 
12
+ var warnedUnassociated = /* @__PURE__ */ new Set();
13
+ function toSearchSchemaType(outDir, ref) {
14
+ var specifier = ref.module;
15
+ if (ref.isFile) {
16
+ specifier = relative(outDir, ref.module).replaceAll("\\", "/").replace(/\.(tsx?|jsx?|mjs)$/, "");
17
+ if (!specifier.startsWith(".")) specifier = `./${specifier}`;
18
+ }
19
+ var quote = function quote2(text) {
20
+ return `'${text.replace(/[\\']/g, "\\$&")}'`;
21
+ };
22
+ return `typeof import(${quote(specifier)})[${quote(ref.name)}]`;
23
+ }
10
24
  async function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedRoutesMode, routePathsIn) {
11
25
  var routePaths = routePathsIn !== null && routePathsIn !== void 0 ? routePathsIn : getRoutePaths(routerRoot, ignoredRouteFiles);
12
26
  var routes = routePaths.reduce(function(acc, cur) {
@@ -15,8 +29,60 @@ async function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedR
15
29
  return acc;
16
30
  }, {});
17
31
  var context = globbedRoutesToRouteContext(routes, routerRoot);
18
- var declarations = getTypedRoutesDeclarationFile(context);
19
32
  var outDir = dirname(outFile);
33
+ var { scan: scanSearchSchemas } = createSearchSchemaScanner(process.cwd());
34
+ var scannedFiles = /* @__PURE__ */ new Set();
35
+ var declarations = getTypedRoutesDeclarationFile(context, { getSearchParamTypes(contextKey) {
36
+ var scan = scanSearchSchemas(getSearchSchemaEntries(routePaths, contextKey).map(function(key) {
37
+ return join(process.cwd(), routerRoot, key);
38
+ }));
39
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
40
+ try {
41
+ for (var _iterator2 = scan.files[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
42
+ var file = _step2.value;
43
+ scannedFiles.add(file);
44
+ }
45
+ } catch (err) {
46
+ _didIteratorError2 = true;
47
+ _iteratorError2 = err;
48
+ } finally {
49
+ try {
50
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
51
+ _iterator2.return();
52
+ }
53
+ } finally {
54
+ if (_didIteratorError2) {
55
+ throw _iteratorError2;
56
+ }
57
+ }
58
+ }
59
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
60
+ try {
61
+ for (var _iterator1 = scan.unassociated[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
62
+ var { file: file1, line } = _step1.value;
63
+ var where = `${relative(process.cwd(), file1)}:${line}`;
64
+ if (warnedUnassociated.has(where)) continue;
65
+ warnedUnassociated.add(where);
66
+ console.warn(`[one] ${where}: useSearchParams(schema) needs the schema to be an exported constant (or an import of one) so links can be typed from it`);
67
+ }
68
+ } catch (err) {
69
+ _didIteratorError1 = true;
70
+ _iteratorError1 = err;
71
+ } finally {
72
+ try {
73
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
74
+ _iterator1.return();
75
+ }
76
+ } finally {
77
+ if (_didIteratorError1) {
78
+ throw _iteratorError1;
79
+ }
80
+ }
81
+ }
82
+ return scan.schemas.map(function(ref) {
83
+ return toSearchSchemaType(outDir, ref);
84
+ });
85
+ } });
20
86
  var currentDeclarations;
21
87
  try {
22
88
  currentDeclarations = await readFile(outFile, "utf8");
@@ -64,6 +130,7 @@ async function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedR
64
130
  }
65
131
  }
66
132
  }
133
+ return scannedFiles;
67
134
  }
68
135
 
69
136
  export { generateRouteTypes };
@@ -1 +1 @@
1
- {"version":3,"file":"generateRouteTypes.native.js","names":[],"sources":["esm/typed-routes/generateRouteTypes.native.js"],"sourcesContent":["import { readFile, writeFile } from \"fs/promises\";\nimport { dirname, join } from \"path\";\nimport FSExtra from \"fs-extra\";\nimport { removeSupportedExtensions } from \"../router/matchers\";\nimport { globbedRoutesToRouteContext } from \"../router/useViteRoutes\";\nimport { getRoutePaths } from \"../utils/routeIndex\";\nimport { getTypedRoutesDeclarationFile } from \"./getTypedRoutesDeclarationFile\";\nimport { injectRouteHelpers } from \"./injectRouteHelpers\";\nasync function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedRoutesMode, routePathsIn) {\n var routePaths = routePathsIn !== null && routePathsIn !== void 0 ? routePathsIn : getRoutePaths(routerRoot, ignoredRouteFiles);\n var routes = routePaths.reduce(function(acc, cur) {\n var vitePath = `/${routerRoot}/${cur.replace(/^\\.\\//, \"\")}`;\n acc[vitePath] = {};\n return acc;\n }, {});\n var context = globbedRoutesToRouteContext(routes, routerRoot);\n var declarations = getTypedRoutesDeclarationFile(context);\n var outDir = dirname(outFile);\n var currentDeclarations;\n try {\n currentDeclarations = await readFile(outFile, \"utf8\");\n } catch (error) {\n if (error.code !== \"ENOENT\") {\n throw error;\n }\n }\n if (currentDeclarations !== declarations) {\n await FSExtra.ensureDir(outDir);\n await writeFile(outFile, declarations);\n }\n if (typedRoutesMode) {\n var mode = typedRoutesMode === \"type\" ? \"type\" : \"runtime\";\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = routePaths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routePath = _step.value;\n if (routePath.includes(\"_layout\") || routePath.includes(\"+api\") || routePath.startsWith(\"_\") || routePath.endsWith(\".d.ts\")) {\n continue;\n }\n var fullPath = join(process.cwd(), routerRoot, routePath);\n var routeName = routePath.replace(/^\\.\\//, \"\").replace(/\\+[^/]*$/, \"\").replace(/\\/index$/, \"\").replace(/index$/, \"\");\n var cleanRouteName = removeSupportedExtensions(routeName).replace(/\\/?index$/, \"\");\n if (!cleanRouteName.startsWith(\"/\")) {\n cleanRouteName = \"/\" + cleanRouteName;\n }\n if (!cleanRouteName.includes(\"[\")) {\n continue;\n }\n await injectRouteHelpers(fullPath, cleanRouteName, mode);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n}\nexport {\n generateRouteTypes\n};\n//# sourceMappingURL=generateRouteTypes.js.map\n"],"mappings":";;;;;;;;;;AAQA,eAAe,mBAAmB,SAAS,YAAY,mBAAmB,iBAAiB,cAAc;CACvG,IAAI,aAAa,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe,cAAc,YAAY,iBAAiB;CAC9H,IAAI,SAAS,WAAW,OAAO,SAAS,KAAK,KAAK;EAChD,IAAI,WAAW,IAAI,WAAW,GAAG,IAAI,QAAQ,SAAS,EAAE;EACxD,IAAI,YAAY,CAAC;EACjB,OAAO;CACT,GAAG,CAAC,CAAC;CACL,IAAI,UAAU,4BAA4B,QAAQ,UAAU;CAC5D,IAAI,eAAe,8BAA8B,OAAO;CACxD,IAAI,SAAS,QAAQ,OAAO;CAC5B,IAAI;CACJ,IAAI;EACF,sBAAsB,MAAM,SAAS,SAAS,MAAM;CACtD,SAAS,OAAO;EACd,IAAI,MAAM,SAAS,UAAU;GAC3B,MAAM;EACR;CACF;CACA,IAAI,wBAAwB,cAAc;EACxC,MAAM,QAAQ,UAAU,MAAM;EAC9B,MAAM,UAAU,SAAS,YAAY;CACvC;CACA,IAAI,iBAAiB;EACnB,IAAI,OAAO,oBAAoB,SAAS,SAAS;EACjD,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACF,KAAK,IAAI,YAAY,WAAW,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IAC3J,IAAI,YAAY,MAAM;IACtB,IAAI,UAAU,SAAS,SAAS,KAAK,UAAU,SAAS,MAAM,KAAK,UAAU,WAAW,GAAG,KAAK,UAAU,SAAS,OAAO,GAAG;KAC3H;IACF;IACA,IAAI,WAAW,KAAK,QAAQ,IAAI,GAAG,YAAY,SAAS;IACxD,IAAI,YAAY,UAAU,QAAQ,SAAS,EAAE,CAAC,CAAC,QAAQ,YAAY,EAAE,CAAC,CAAC,QAAQ,YAAY,EAAE,CAAC,CAAC,QAAQ,UAAU,EAAE;IACnH,IAAI,iBAAiB,0BAA0B,SAAS,CAAC,CAAC,QAAQ,aAAa,EAAE;IACjF,IAAI,CAAC,eAAe,WAAW,GAAG,GAAG;KACnC,iBAAiB,MAAM;IACzB;IACA,IAAI,CAAC,eAAe,SAAS,GAAG,GAAG;KACjC;IACF;IACA,MAAM,mBAAmB,UAAU,gBAAgB,IAAI;GACzD;EACF,SAAS,KAAK;GACZ,oBAAoB;GACpB,iBAAiB;EACnB,UAAU;GACR,IAAI;IACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;KAC1D,UAAU,OAAO;IACnB;GACF,UAAU;IACR,IAAI,mBAAmB;KACrB,MAAM;IACR;GACF;EACF;CACF;AACF"}
1
+ {"version":3,"file":"generateRouteTypes.native.js","names":[],"sources":["esm/typed-routes/generateRouteTypes.native.js"],"sourcesContent":["import { readFile, writeFile } from \"fs/promises\";\nimport { dirname, join, relative } from \"path\";\nimport FSExtra from \"fs-extra\";\nimport { removeSupportedExtensions } from \"../router/matchers\";\nimport { globbedRoutesToRouteContext } from \"../router/useViteRoutes\";\nimport { getRoutePaths } from \"../utils/routeIndex\";\nimport { getTypedRoutesDeclarationFile } from \"./getTypedRoutesDeclarationFile\";\nimport { createSearchSchemaScanner } from \"./searchParamSchemas\";\nimport { injectRouteHelpers } from \"./injectRouteHelpers\";\nimport { getSearchSchemaEntries } from \"./searchSchemaEntries\";\nvar warnedUnassociated = /* @__PURE__ */ new Set();\nfunction toSearchSchemaType(outDir, ref) {\n var specifier = ref.module;\n if (ref.isFile) {\n specifier = relative(outDir, ref.module).replaceAll(\"\\\\\", \"/\").replace(/\\.(tsx?|jsx?|mjs)$/, \"\");\n if (!specifier.startsWith(\".\")) specifier = `./${specifier}`;\n }\n var quote = function quote2(text) {\n return `'${text.replace(/[\\\\']/g, \"\\\\$&\")}'`;\n };\n return `typeof import(${quote(specifier)})[${quote(ref.name)}]`;\n}\nasync function generateRouteTypes(outFile, routerRoot, ignoredRouteFiles, typedRoutesMode, routePathsIn) {\n var routePaths = routePathsIn !== null && routePathsIn !== void 0 ? routePathsIn : getRoutePaths(routerRoot, ignoredRouteFiles);\n var routes = routePaths.reduce(function(acc, cur) {\n var vitePath = `/${routerRoot}/${cur.replace(/^\\.\\//, \"\")}`;\n acc[vitePath] = {};\n return acc;\n }, {});\n var context = globbedRoutesToRouteContext(routes, routerRoot);\n var outDir = dirname(outFile);\n var { scan: scanSearchSchemas } = createSearchSchemaScanner(process.cwd());\n var scannedFiles = /* @__PURE__ */ new Set();\n var declarations = getTypedRoutesDeclarationFile(context, {\n getSearchParamTypes(contextKey) {\n var scan = scanSearchSchemas(getSearchSchemaEntries(routePaths, contextKey).map(function(key) {\n return join(process.cwd(), routerRoot, key);\n }));\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = scan.files[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var file = _step2.value;\n scannedFiles.add(file);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = scan.unassociated[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var { file: file1, line } = _step1.value;\n var where = `${relative(process.cwd(), file1)}:${line}`;\n if (warnedUnassociated.has(where)) continue;\n warnedUnassociated.add(where);\n console.warn(`[one] ${where}: useSearchParams(schema) needs the schema to be an exported constant (or an import of one) so links can be typed from it`);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return scan.schemas.map(function(ref) {\n return toSearchSchemaType(outDir, ref);\n });\n }\n });\n var currentDeclarations;\n try {\n currentDeclarations = await readFile(outFile, \"utf8\");\n } catch (error) {\n if (error.code !== \"ENOENT\") {\n throw error;\n }\n }\n if (currentDeclarations !== declarations) {\n await FSExtra.ensureDir(outDir);\n await writeFile(outFile, declarations);\n }\n if (typedRoutesMode) {\n var mode = typedRoutesMode === \"type\" ? \"type\" : \"runtime\";\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = routePaths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routePath = _step.value;\n if (routePath.includes(\"_layout\") || routePath.includes(\"+api\") || routePath.startsWith(\"_\") || routePath.endsWith(\".d.ts\")) {\n continue;\n }\n var fullPath = join(process.cwd(), routerRoot, routePath);\n var routeName = routePath.replace(/^\\.\\//, \"\").replace(/\\+[^/]*$/, \"\").replace(/\\/index$/, \"\").replace(/index$/, \"\");\n var cleanRouteName = removeSupportedExtensions(routeName).replace(/\\/?index$/, \"\");\n if (!cleanRouteName.startsWith(\"/\")) {\n cleanRouteName = \"/\" + cleanRouteName;\n }\n if (!cleanRouteName.includes(\"[\")) {\n continue;\n }\n await injectRouteHelpers(fullPath, cleanRouteName, mode);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n return scannedFiles;\n}\nexport {\n generateRouteTypes\n};\n//# sourceMappingURL=generateRouteTypes.js.map\n"],"mappings":";;;;;;;;;;;;AAUA,IAAI,qCAAqC,IAAI,IAAI;AACjD,SAAS,mBAAmB,QAAQ,KAAK;CACvC,IAAI,YAAY,IAAI;CACpB,IAAI,IAAI,QAAQ;EACd,YAAY,SAAS,QAAQ,IAAI,MAAM,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC,CAAC,QAAQ,sBAAsB,EAAE;EAC/F,IAAI,CAAC,UAAU,WAAW,GAAG,GAAG,YAAY,KAAK;CACnD;CACA,IAAI,QAAQ,SAAS,OAAO,MAAM;EAChC,OAAO,IAAI,KAAK,QAAQ,UAAU,MAAM,EAAE;CAC5C;CACA,OAAO,iBAAiB,MAAM,SAAS,EAAE,IAAI,MAAM,IAAI,IAAI,EAAE;AAC/D;AACA,eAAe,mBAAmB,SAAS,YAAY,mBAAmB,iBAAiB,cAAc;CACvG,IAAI,aAAa,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe,cAAc,YAAY,iBAAiB;CAC9H,IAAI,SAAS,WAAW,OAAO,SAAS,KAAK,KAAK;EAChD,IAAI,WAAW,IAAI,WAAW,GAAG,IAAI,QAAQ,SAAS,EAAE;EACxD,IAAI,YAAY,CAAC;EACjB,OAAO;CACT,GAAG,CAAC,CAAC;CACL,IAAI,UAAU,4BAA4B,QAAQ,UAAU;CAC5D,IAAI,SAAS,QA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;IACF;IACA,MAAM,mBAAmB,UAAU,gBAAgB,IAAI;GACzD;EACF,SAAS,KAAK;GACZ,oBAAoB;GACpB,iBAAiB;EACnB,UAAU;GACR,IAAI;IACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;KAC1D,UAAU,OAAO;IACnB;GACF,UAAU;IACR,IAAI,mBAAmB;KACrB,MAAM;IACR;GACF;EACF;CACF;CACA,OAAO;AACT"}
@@ -3,15 +3,16 @@ import { isTypedRoute, removeSupportedExtensions } from "../router/matchers.mjs"
3
3
 
4
4
  const CATCH_ALL = /\[\.\.\..+?\]/g;
5
5
  const SLUG = /\[.+?\]/g;
6
- function getTypedRoutesDeclarationFile(ctx) {
6
+ function getTypedRoutesDeclarationFile(ctx, options = {}) {
7
7
  const staticRoutes = /* @__PURE__ */ new Set();
8
8
  const dynamicRoutes = /* @__PURE__ */ new Set();
9
9
  const dynamicRouteContextKeys = /* @__PURE__ */ new Set();
10
+ const searchParamSchemas = /* @__PURE__ */ new Map();
10
11
  walkRouteNode(getRoutes(ctx, {
11
12
  platformRoutes: false,
12
13
  ignoreEntryPoints: true,
13
14
  ignoreRequireErrors: true
14
- }), "", staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
15
+ }), "", staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, options.getSearchParamTypes);
15
16
  const hasRoutes = dynamicRouteContextKeys.size > 0;
16
17
  return `// deno-lint-ignore-file
17
18
  /* eslint-disable */
@@ -24,7 +25,9 @@ declare module 'one' {
24
25
  StaticRoutes:${setToUnionType(staticRoutes)}
25
26
  DynamicRoutes:${setToUnionType(dynamicRoutes)}
26
27
  DynamicRouteTemplate:${setToUnionType(dynamicRouteContextKeys)}
27
- IsTyped: true
28
+ IsTyped: true${searchParamSchemas.size ? `
29
+ SearchParamTypes: ${generateSearchParamTypesMap(searchParamSchemas, "SearchParamsOf")}
30
+ SearchParamOutputs: ${generateSearchParamTypesMap(searchParamSchemas, "SearchOutputOf")}` : ""}
28
31
  ${hasRoutes ? `RouteTypes: ${generateRouteTypesMap(dynamicRouteContextKeys)}` : ""}
29
32
  }
30
33
  }
@@ -33,12 +36,18 @@ ${hasRoutes ? `
33
36
  /**
34
37
  * Helper type for route information
35
38
  */
36
- type RouteInfo<Params = Record<string, never>> = {
39
+ type RouteInfo<Params = Record<string, never>, Path extends string = string> = {
37
40
  Params: Params
38
- LoaderProps: { path: string; search?: string; subdomain?: string; params: Params; request?: Request }
41
+ LoaderProps: import('one').LoaderProps<Params, OneRouter.LoaderSearchParams<Path>>
39
42
  }` : ""}
40
43
  `.trim();
41
44
  }
45
+ function generateSearchParamTypesMap(searchParamSchemas, wrapper) {
46
+ const entries = [...searchParamSchemas].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([routePath, schemas]) => ` '${routePath}': ${schemas.map((schema) => `OneRouter.${wrapper}<${schema}>`).join(" & ")}`).join("\n");
47
+ return `{
48
+ ${entries}
49
+ }`;
50
+ }
42
51
  function generateRouteTypesMap(dynamicRouteContextKeys) {
43
52
  if (dynamicRouteContextKeys.size === 0) {
44
53
  return "{}";
@@ -47,7 +56,7 @@ function generateRouteTypesMap(dynamicRouteContextKeys) {
47
56
  const entries = routes.map((routePath) => {
48
57
  const params = extractParams(routePath);
49
58
  const paramsType = params.length === 0 ? "{}" : generateInlineParamsType(params);
50
- return ` '${routePath}': RouteInfo<${paramsType}>`;
59
+ return ` '${routePath}': RouteInfo<${paramsType}, '${routePath}'>`;
51
60
  }).join("\n");
52
61
  return `{
53
62
  ${entries}
@@ -72,28 +81,36 @@ function generateInlineParamsType(params) {
72
81
  });
73
82
  return `{ ${entries.join("; ")} }`;
74
83
  }
75
- function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {
84
+ function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {
76
85
  if (!routeNode) return;
77
- addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
86
+ addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes);
78
87
  parentRoutePath = `${removeSupportedExtensions(`${parentRoutePath}/${routeNode.route}`).replace(/\/?index$/, "")}`;
79
88
  for (const child of routeNode.children) {
80
- walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
89
+ walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes);
81
90
  }
82
91
  }
83
- function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {
92
+ function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {
84
93
  if (!routeNode?.route) return;
85
94
  if (!isTypedRoute(routeNode.route)) return;
86
95
  let routePath = `${parentRoutePath}/${removeSupportedExtensions(routeNode.route).replace(/\/?index$/, "")}`;
87
96
  if (!routePath.startsWith("/")) {
88
97
  routePath = `/${routePath}`;
89
98
  }
99
+ const schemaTypes = routeNode.type !== "layout" ? getSearchParamTypes?.(routeNode.contextKey) : void 0;
100
+ const addSearchParamTypes = (path) => {
101
+ if (schemaTypes?.length && !searchParamSchemas.has(path)) {
102
+ searchParamSchemas.set(path, schemaTypes);
103
+ }
104
+ };
90
105
  if (routeNode.dynamic) {
91
106
  for (const path of generateCombinations(routePath)) {
107
+ addSearchParamTypes(path);
92
108
  dynamicRouteContextKeys.add(path);
93
109
  dynamicRoutes.add(`${path.replaceAll(CATCH_ALL, "${string}").replaceAll(SLUG, "${OneRouter.SingleRoutePart<T>}")}`);
94
110
  }
95
111
  } else {
96
112
  for (const combination of generateCombinations(routePath)) {
113
+ addSearchParamTypes(combination);
97
114
  staticRoutes.add(combination);
98
115
  }
99
116
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getTypedRoutesDeclarationFile.js","names":[],"sources":["esm/typed-routes/getTypedRoutesDeclarationFile.js"],"sourcesContent":["import { getRoutes } from \"../router/getRoutes\";\nimport { isTypedRoute, removeSupportedExtensions } from \"../router/matchers\";\nconst CATCH_ALL = /\\[\\.\\.\\..+?\\]/g;\nconst SLUG = /\\[.+?\\]/g;\nfunction getTypedRoutesDeclarationFile(ctx) {\n const staticRoutes = /* @__PURE__ */ new Set();\n const dynamicRoutes = /* @__PURE__ */ new Set();\n const dynamicRouteContextKeys = /* @__PURE__ */ new Set();\n walkRouteNode(\n getRoutes(ctx, {\n platformRoutes: false,\n // We don't need to generate platform specific routes\n ignoreEntryPoints: true,\n ignoreRequireErrors: true\n // importMode: 'async',\n }),\n \"\",\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys\n );\n const hasRoutes = dynamicRouteContextKeys.size > 0;\n return `// deno-lint-ignore-file\n/* eslint-disable */\n// biome-ignore: needed import\nimport type { OneRouter } from 'one'\n\ndeclare module 'one' {\n export namespace OneRouter {\n export interface __routes<T extends string = string> extends Record<string, unknown> {\n StaticRoutes:${setToUnionType(staticRoutes)}\n DynamicRoutes:${setToUnionType(dynamicRoutes)}\n DynamicRouteTemplate:${setToUnionType(dynamicRouteContextKeys)}\n IsTyped: true\n ${hasRoutes ? `RouteTypes: ${generateRouteTypesMap(dynamicRouteContextKeys)}` : \"\"}\n }\n }\n}\n${hasRoutes ? `\n/**\n * Helper type for route information\n */\ntype RouteInfo<Params = Record<string, never>> = {\n Params: Params\n LoaderProps: { path: string; search?: string; subdomain?: string; params: Params; request?: Request }\n}` : \"\"}\n`.trim();\n}\nfunction generateRouteTypesMap(dynamicRouteContextKeys) {\n if (dynamicRouteContextKeys.size === 0) {\n return \"{}\";\n }\n const routes = [...dynamicRouteContextKeys].sort();\n const entries = routes.map((routePath) => {\n const params = extractParams(routePath);\n const paramsType = params.length === 0 ? \"{}\" : generateInlineParamsType(params);\n return ` '${routePath}': RouteInfo<${paramsType}>`;\n }).join(\"\\n\");\n return `{\n${entries}\n }`;\n}\nfunction extractParams(routePath) {\n const params = [];\n const paramRegex = /\\[(\\.\\.\\.)?([\\w]+)\\]/g;\n let match;\n while ((match = paramRegex.exec(routePath)) !== null) {\n params.push({\n name: match[2],\n isCatchAll: match[1] === \"...\"\n });\n }\n return params;\n}\nfunction generateInlineParamsType(params) {\n const entries = params.map((p) => {\n const type = p.isCatchAll ? \"string[]\" : \"string\";\n return `${p.name}: ${type}`;\n });\n return `{ ${entries.join(\"; \")} }`;\n}\nfunction walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {\n if (!routeNode) return;\n addRouteNode(\n routeNode,\n parentRoutePath,\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys\n );\n parentRoutePath = `${removeSupportedExtensions(`${parentRoutePath}/${routeNode.route}`).replace(/\\/?index$/, \"\")}`;\n for (const child of routeNode.children) {\n walkRouteNode(\n child,\n parentRoutePath,\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys\n );\n }\n}\nfunction addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {\n if (!routeNode?.route) return;\n if (!isTypedRoute(routeNode.route)) return;\n let routePath = `${parentRoutePath}/${removeSupportedExtensions(routeNode.route).replace(/\\/?index$/, \"\")}`;\n if (!routePath.startsWith(\"/\")) {\n routePath = `/${routePath}`;\n }\n if (routeNode.dynamic) {\n for (const path of generateCombinations(routePath)) {\n dynamicRouteContextKeys.add(path);\n dynamicRoutes.add(\n // biome-ignore lint/suspicious/noTemplateCurlyInString: intentionally generating type string\n `${path.replaceAll(CATCH_ALL, \"${string}\").replaceAll(SLUG, \"${OneRouter.SingleRoutePart<T>}\")}`\n );\n }\n } else {\n for (const combination of generateCombinations(routePath)) {\n staticRoutes.add(combination);\n }\n }\n}\nconst setToUnionType = (set) => {\n if (set.size === 0) return \" never\";\n const sorted = [...set].sort();\n if (sorted.length === 1) return ` \\`${sorted[0]}\\``;\n return \"\\n | \" + sorted.map((s) => `\\`${s}\\``).join(\"\\n | \");\n};\nfunction generateCombinations(pathname) {\n const groups = pathname.split(\"/\").filter((part) => part.startsWith(\"(\") && part.endsWith(\")\"));\n const combinations = [];\n function generate(currentIndex, currentPath) {\n if (currentIndex === groups.length) {\n combinations.push(currentPath.replace(/\\/{2,}/g, \"/\"));\n return;\n }\n const group = groups[currentIndex];\n const withoutGroup = currentPath.replace(`/${group}`, \"\");\n generate(currentIndex + 1, withoutGroup);\n generate(currentIndex + 1, currentPath);\n }\n generate(0, pathname);\n return combinations;\n}\nexport {\n getTypedRoutesDeclarationFile\n};\n//# sourceMappingURL=getTypedRoutesDeclarationFile.js.map\n"],"mappings":";;;;AAEA,MAAM,YAAY;AAClB,MAAM,OAAO;AACb,SAAS,8BAA8B,KAAK;CAC1C,MAAM,+BAA+B,IAAI,IAAI;CAC7C,MAAM,gCAAgC,IAAI,IAAI;CAC9C,MAAM,0CAA0C,IAAI,IAAI;CACxD,cACE,UAAU,KAAK;EACb,gBAAgB;EAEhB,mBAAmB;EACnB,qBAAqB;CAEvB,CAAC,GACD,IACA,cACA,eACA,uBACF;CACA,MAAM,YAAY,wBAAwB,OAAO;CACjD,OAAO;;;;;;;;qBAQY,eAAe,YAAY,EAAE;sBAC5B,eAAe,aAAa,EAAE;6BACvB,eAAe,uBAAuB,EAAE;;QAE7D,YAAY,eAAe,sBAAsB,uBAAuB,MAAM,GAAG;;;;EAIvF,YAAY;;;;;;;KAOT,GAAG;EACN,KAAK;AACP;AACA,SAAS,sBAAsB,yBAAyB;CACtD,IAAI,wBAAwB,SAAS,GAAG;EACtC,OAAO;CACT;CACA,MAAM,SAAS,CAAC,GAAG,uBAAuB,CAAC,CAAC,KAAK;CACjD,MAAM,UAAU,OAAO,KAAK,cAAc;EACxC,MAAM,SAAS,cAAc,SAAS;EACtC,MAAM,aAAa,OAAO,WAAW,IAAI,OAAO,yBAAyB,MAAM;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W,CAAC,CAAC,WAAW,MAAM,iCAAiC,GAC/F;EACF;CACF,OAAO;EACL,KAAK,MAAM,eAAe,qBAAqB,SAAS,GAAG;GACzD,aAAa,IAAI,WAAW;EAC9B;CACF;AACF;AACA,MAAM,kBAAkB,QAAQ;CAC9B,IAAI,IAAI,SAAS,GAAG,OAAO;CAC3B,MAAM,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK;CAC7B,IAAI,OAAO,WAAW,GAAG,OAAO,MAAM,OAAO,GAAG;CAChD,OAAO,iBAAiB,OAAO,KAAK,MAAM,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,cAAc;AAC3E;AACA,SAAS,qBAAqB,UAAU;CACtC,MAAM,SAAS,SAAS,MAAM,GAAG,CAAC,CAAC,QAAQ,SAAS,KAAK,WAAW,GAAG,KAAK,KAAK,SAAS,GAAG,CAAC;CAC9F,MAAM,eAAe,CAAC;CACtB,SAAS,SAAS,cAAc,aAAa;EAC3C,IAAI,iBAAiB,OAAO,QAAQ;GAClC,aAAa,KAAK,YAAY,QAAQ,WAAW,GAAG,CAAC;GACrD;EACF;EACA,MAAM,QAAQ,OAAO;EACrB,MAAM,eAAe,YAAY,QAAQ,IAAI,SAAS,EAAE;EACxD,SAAS,eAAe,GAAG,YAAY;EACvC,SAAS,eAAe,GAAG,WAAW;CACxC;CACA,SAAS,GAAG,QAAQ;CACpB,OAAO;AACT"}
1
+ {"version":3,"file":"getTypedRoutesDeclarationFile.js","names":[],"sources":["esm/typed-routes/getTypedRoutesDeclarationFile.js"],"sourcesContent":["import { getRoutes } from \"../router/getRoutes\";\nimport { isTypedRoute, removeSupportedExtensions } from \"../router/matchers\";\nconst CATCH_ALL = /\\[\\.\\.\\..+?\\]/g;\nconst SLUG = /\\[.+?\\]/g;\nfunction getTypedRoutesDeclarationFile(ctx, options = {}) {\n const staticRoutes = /* @__PURE__ */ new Set();\n const dynamicRoutes = /* @__PURE__ */ new Set();\n const dynamicRouteContextKeys = /* @__PURE__ */ new Set();\n const searchParamSchemas = /* @__PURE__ */ new Map();\n walkRouteNode(\n getRoutes(ctx, {\n platformRoutes: false,\n // We don't need to generate platform specific routes\n ignoreEntryPoints: true,\n ignoreRequireErrors: true\n // importMode: 'async',\n }),\n \"\",\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys,\n searchParamSchemas,\n options.getSearchParamTypes\n );\n const hasRoutes = dynamicRouteContextKeys.size > 0;\n return `// deno-lint-ignore-file\n/* eslint-disable */\n// biome-ignore: needed import\nimport type { OneRouter } from 'one'\n\ndeclare module 'one' {\n export namespace OneRouter {\n export interface __routes<T extends string = string> extends Record<string, unknown> {\n StaticRoutes:${setToUnionType(staticRoutes)}\n DynamicRoutes:${setToUnionType(dynamicRoutes)}\n DynamicRouteTemplate:${setToUnionType(dynamicRouteContextKeys)}\n IsTyped: true${searchParamSchemas.size ? `\n SearchParamTypes: ${generateSearchParamTypesMap(searchParamSchemas, \"SearchParamsOf\")}\n SearchParamOutputs: ${generateSearchParamTypesMap(searchParamSchemas, \"SearchOutputOf\")}` : \"\"}\n ${hasRoutes ? `RouteTypes: ${generateRouteTypesMap(dynamicRouteContextKeys)}` : \"\"}\n }\n }\n}\n${hasRoutes ? `\n/**\n * Helper type for route information\n */\ntype RouteInfo<Params = Record<string, never>, Path extends string = string> = {\n Params: Params\n LoaderProps: import('one').LoaderProps<Params, OneRouter.LoaderSearchParams<Path>>\n}` : \"\"}\n`.trim();\n}\nfunction generateSearchParamTypesMap(searchParamSchemas, wrapper) {\n const entries = [...searchParamSchemas].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(\n ([routePath, schemas]) => ` '${routePath}': ${schemas.map((schema) => `OneRouter.${wrapper}<${schema}>`).join(\" & \")}`\n ).join(\"\\n\");\n return `{\n${entries}\n }`;\n}\nfunction generateRouteTypesMap(dynamicRouteContextKeys) {\n if (dynamicRouteContextKeys.size === 0) {\n return \"{}\";\n }\n const routes = [...dynamicRouteContextKeys].sort();\n const entries = routes.map((routePath) => {\n const params = extractParams(routePath);\n const paramsType = params.length === 0 ? \"{}\" : generateInlineParamsType(params);\n return ` '${routePath}': RouteInfo<${paramsType}, '${routePath}'>`;\n }).join(\"\\n\");\n return `{\n${entries}\n }`;\n}\nfunction extractParams(routePath) {\n const params = [];\n const paramRegex = /\\[(\\.\\.\\.)?([\\w]+)\\]/g;\n let match;\n while ((match = paramRegex.exec(routePath)) !== null) {\n params.push({\n name: match[2],\n isCatchAll: match[1] === \"...\"\n });\n }\n return params;\n}\nfunction generateInlineParamsType(params) {\n const entries = params.map((p) => {\n const type = p.isCatchAll ? \"string[]\" : \"string\";\n return `${p.name}: ${type}`;\n });\n return `{ ${entries.join(\"; \")} }`;\n}\nfunction walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {\n if (!routeNode) return;\n addRouteNode(\n routeNode,\n parentRoutePath,\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys,\n searchParamSchemas,\n getSearchParamTypes\n );\n parentRoutePath = `${removeSupportedExtensions(`${parentRoutePath}/${routeNode.route}`).replace(/\\/?index$/, \"\")}`;\n for (const child of routeNode.children) {\n walkRouteNode(\n child,\n parentRoutePath,\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys,\n searchParamSchemas,\n getSearchParamTypes\n );\n }\n}\nfunction addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {\n if (!routeNode?.route) return;\n if (!isTypedRoute(routeNode.route)) return;\n let routePath = `${parentRoutePath}/${removeSupportedExtensions(routeNode.route).replace(/\\/?index$/, \"\")}`;\n if (!routePath.startsWith(\"/\")) {\n routePath = `/${routePath}`;\n }\n const schemaTypes = routeNode.type !== \"layout\" ? getSearchParamTypes?.(routeNode.contextKey) : void 0;\n const addSearchParamTypes = (path) => {\n if (schemaTypes?.length && !searchParamSchemas.has(path)) {\n searchParamSchemas.set(path, schemaTypes);\n }\n };\n if (routeNode.dynamic) {\n for (const path of generateCombinations(routePath)) {\n addSearchParamTypes(path);\n dynamicRouteContextKeys.add(path);\n dynamicRoutes.add(\n // biome-ignore lint/suspicious/noTemplateCurlyInString: intentionally generating type string\n `${path.replaceAll(CATCH_ALL, \"${string}\").replaceAll(SLUG, \"${OneRouter.SingleRoutePart<T>}\")}`\n );\n }\n } else {\n for (const combination of generateCombinations(routePath)) {\n addSearchParamTypes(combination);\n staticRoutes.add(combination);\n }\n }\n}\nconst setToUnionType = (set) => {\n if (set.size === 0) return \" never\";\n const sorted = [...set].sort();\n if (sorted.length === 1) return ` \\`${sorted[0]}\\``;\n return \"\\n | \" + sorted.map((s) => `\\`${s}\\``).join(\"\\n | \");\n};\nfunction generateCombinations(pathname) {\n const groups = pathname.split(\"/\").filter((part) => part.startsWith(\"(\") && part.endsWith(\")\"));\n const combinations = [];\n function generate(currentIndex, currentPath) {\n if (currentIndex === groups.length) {\n combinations.push(currentPath.replace(/\\/{2,}/g, \"/\"));\n return;\n }\n const group = groups[currentIndex];\n const withoutGroup = currentPath.replace(`/${group}`, \"\");\n generate(currentIndex + 1, withoutGroup);\n generate(currentIndex + 1, currentPath);\n }\n generate(0, pathname);\n return combinations;\n}\nexport {\n getTypedRoutesDeclarationFile\n};\n//# sourceMappingURL=getTypedRoutesDeclarationFile.js.map\n"],"mappings":";;;;AAEA,MAAM,YAAY;AAClB,MAAM,OAAO;AACb,SAAS,8BAA8B,KAAK,UAAU,CAAC,GAAG;CACxD,MAAM,+BAA+B,IAAI,IAAI;CAC7C,MAAM,gCAAgC,IAAI,IAAI;CAC9C,MAAM,0CAA0C,IAAI,IAAI;CACxD,MAAM,qCAAqC,IAAI,IAAI;CACnD,cACE,UAAU,KAAK;EACb,gBAAgB;EAEhB,mBAAmB;EACnB,qBAAqB;CAEvB,CAAC,GACD,IACA,cACA,eACA,yBACA,oBACA,QAAQ,mBACV;CACA,MAAM,YAAY,wBAAwB,OAA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AiC,GAC/F;EACF;CACF,OAAO;EACL,KAAK,MAAM,eAAe,qBAAqB,SAAS,GAAG;GACzD,oBAAoB,WAAW;GAC/B,aAAa,IAAI,WAAW;EAC9B;CACF;AACF;AACA,MAAM,kBAAkB,QAAQ;CAC9B,IAAI,IAAI,SAAS,GAAG,OAAO;CAC3B,MAAM,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK;CAC7B,IAAI,OAAO,WAAW,GAAG,OAAO,MAAM,OAAO,GAAG;CAChD,OAAO,iBAAiB,OAAO,KAAK,MAAM,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,cAAc;AAC3E;AACA,SAAS,qBAAqB,UAAU;CACtC,MAAM,SAAS,SAAS,MAAM,GAAG,CAAC,CAAC,QAAQ,SAAS,KAAK,WAAW,GAAG,KAAK,KAAK,SAAS,GAAG,CAAC;CAC9F,MAAM,eAAe,CAAC;CACtB,SAAS,SAAS,cAAc,aAAa;EAC3C,IAAI,iBAAiB,OAAO,QAAQ;GAClC,aAAa,KAAK,YAAY,QAAQ,WAAW,GAAG,CAAC;GACrD;EACF;EACA,MAAM,QAAQ,OAAO;EACrB,MAAM,eAAe,YAAY,QAAQ,IAAI,SAAS,EAAE;EACxD,SAAS,eAAe,GAAG,YAAY;EACvC,SAAS,eAAe,GAAG,WAAW;CACxC;CACA,SAAS,GAAG,QAAQ;CACpB,OAAO;AACT"}
@@ -4,14 +4,16 @@ import { isTypedRoute, removeSupportedExtensions } from "../router/matchers.nati
4
4
  var CATCH_ALL = /\[\.\.\..+?\]/g;
5
5
  var SLUG = /\[.+?\]/g;
6
6
  function getTypedRoutesDeclarationFile(ctx) {
7
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
7
8
  var staticRoutes = /* @__PURE__ */ new Set();
8
9
  var dynamicRoutes = /* @__PURE__ */ new Set();
9
10
  var dynamicRouteContextKeys = /* @__PURE__ */ new Set();
11
+ var searchParamSchemas = /* @__PURE__ */ new Map();
10
12
  walkRouteNode(getRoutes(ctx, {
11
13
  platformRoutes: false,
12
14
  ignoreEntryPoints: true,
13
15
  ignoreRequireErrors: true
14
- }), "", staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
16
+ }), "", staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, options.getSearchParamTypes);
15
17
  var hasRoutes = dynamicRouteContextKeys.size > 0;
16
18
  return `// deno-lint-ignore-file
17
19
  /* eslint-disable */
@@ -24,7 +26,9 @@ declare module 'one' {
24
26
  StaticRoutes:${setToUnionType(staticRoutes)}
25
27
  DynamicRoutes:${setToUnionType(dynamicRoutes)}
26
28
  DynamicRouteTemplate:${setToUnionType(dynamicRouteContextKeys)}
27
- IsTyped: true
29
+ IsTyped: true${searchParamSchemas.size ? `
30
+ SearchParamTypes: ${generateSearchParamTypesMap(searchParamSchemas, "SearchParamsOf")}
31
+ SearchParamOutputs: ${generateSearchParamTypesMap(searchParamSchemas, "SearchOutputOf")}` : ""}
28
32
  ${hasRoutes ? `RouteTypes: ${generateRouteTypesMap(dynamicRouteContextKeys)}` : ""}
29
33
  }
30
34
  }
@@ -33,12 +37,26 @@ ${hasRoutes ? `
33
37
  /**
34
38
  * Helper type for route information
35
39
  */
36
- type RouteInfo<Params = Record<string, never>> = {
40
+ type RouteInfo<Params = Record<string, never>, Path extends string = string> = {
37
41
  Params: Params
38
- LoaderProps: { path: string; search?: string; subdomain?: string; params: Params; request?: Request }
42
+ LoaderProps: import('one').LoaderProps<Params, OneRouter.LoaderSearchParams<Path>>
39
43
  }` : ""}
40
44
  `.trim();
41
45
  }
46
+ function generateSearchParamTypesMap(searchParamSchemas, wrapper) {
47
+ var entries = [...searchParamSchemas].sort(function(param, param1) {
48
+ var [a] = param, [b] = param1;
49
+ return a < b ? -1 : a > b ? 1 : 0;
50
+ }).map(function(param) {
51
+ var [routePath, schemas] = param;
52
+ return ` '${routePath}': ${schemas.map(function(schema) {
53
+ return `OneRouter.${wrapper}<${schema}>`;
54
+ }).join(" & ")}`;
55
+ }).join("\n");
56
+ return `{
57
+ ${entries}
58
+ }`;
59
+ }
42
60
  function generateRouteTypesMap(dynamicRouteContextKeys) {
43
61
  if (dynamicRouteContextKeys.size === 0) {
44
62
  return "{}";
@@ -47,7 +65,7 @@ function generateRouteTypesMap(dynamicRouteContextKeys) {
47
65
  var entries = routes.map(function(routePath) {
48
66
  var params = extractParams(routePath);
49
67
  var paramsType = params.length === 0 ? "{}" : generateInlineParamsType(params);
50
- return ` '${routePath}': RouteInfo<${paramsType}>`;
68
+ return ` '${routePath}': RouteInfo<${paramsType}, '${routePath}'>`;
51
69
  }).join("\n");
52
70
  return `{
53
71
  ${entries}
@@ -72,15 +90,15 @@ function generateInlineParamsType(params) {
72
90
  });
73
91
  return `{ ${entries.join("; ")} }`;
74
92
  }
75
- function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {
93
+ function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {
76
94
  if (!routeNode) return;
77
- addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
95
+ addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes);
78
96
  parentRoutePath = `${removeSupportedExtensions(`${parentRoutePath}/${routeNode.route}`).replace(/\/?index$/, "")}`;
79
97
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
80
98
  try {
81
99
  for (var _iterator = routeNode.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
82
100
  var child = _step.value;
83
- walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
101
+ walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes);
84
102
  }
85
103
  } catch (err) {
86
104
  _didIteratorError = true;
@@ -97,18 +115,25 @@ function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes,
97
115
  }
98
116
  }
99
117
  }
100
- function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {
118
+ function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {
101
119
  if (!(routeNode === null || routeNode === void 0 ? void 0 : routeNode.route)) return;
102
120
  if (!isTypedRoute(routeNode.route)) return;
103
121
  var routePath = `${parentRoutePath}/${removeSupportedExtensions(routeNode.route).replace(/\/?index$/, "")}`;
104
122
  if (!routePath.startsWith("/")) {
105
123
  routePath = `/${routePath}`;
106
124
  }
125
+ var schemaTypes = routeNode.type !== "layout" ? getSearchParamTypes === null || getSearchParamTypes === void 0 ? void 0 : getSearchParamTypes(routeNode.contextKey) : void 0;
126
+ var addSearchParamTypes = function addSearchParamTypes2(path2) {
127
+ if ((schemaTypes === null || schemaTypes === void 0 ? void 0 : schemaTypes.length) && !searchParamSchemas.has(path2)) {
128
+ searchParamSchemas.set(path2, schemaTypes);
129
+ }
130
+ };
107
131
  if (routeNode.dynamic) {
108
132
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
109
133
  try {
110
134
  for (var _iterator = generateCombinations(routePath)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
111
135
  var path = _step.value;
136
+ addSearchParamTypes(path);
112
137
  dynamicRouteContextKeys.add(path);
113
138
  dynamicRoutes.add(`${path.replaceAll(CATCH_ALL, "${string}").replaceAll(SLUG, "${OneRouter.SingleRoutePart<T>}")}`);
114
139
  }
@@ -131,6 +156,7 @@ function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, d
131
156
  try {
132
157
  for (var _iterator1 = generateCombinations(routePath)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
133
158
  var combination = _step1.value;
159
+ addSearchParamTypes(combination);
134
160
  staticRoutes.add(combination);
135
161
  }
136
162
  } catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"getTypedRoutesDeclarationFile.native.js","names":[],"sources":["esm/typed-routes/getTypedRoutesDeclarationFile.native.js"],"sourcesContent":["import { getRoutes } from \"../router/getRoutes\";\nimport { isTypedRoute, removeSupportedExtensions } from \"../router/matchers\";\nvar CATCH_ALL = /\\[\\.\\.\\..+?\\]/g;\nvar SLUG = /\\[.+?\\]/g;\nfunction getTypedRoutesDeclarationFile(ctx) {\n var staticRoutes = /* @__PURE__ */ new Set();\n var dynamicRoutes = /* @__PURE__ */ new Set();\n var dynamicRouteContextKeys = /* @__PURE__ */ new Set();\n walkRouteNode(\n getRoutes(ctx, {\n platformRoutes: false,\n // We don't need to generate platform specific routes\n ignoreEntryPoints: true,\n ignoreRequireErrors: true\n }),\n // importMode: 'async',\n \"\",\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys\n );\n var hasRoutes = dynamicRouteContextKeys.size > 0;\n return `// deno-lint-ignore-file\n/* eslint-disable */\n// biome-ignore: needed import\nimport type { OneRouter } from 'one'\n\ndeclare module 'one' {\n export namespace OneRouter {\n export interface __routes<T extends string = string> extends Record<string, unknown> {\n StaticRoutes:${setToUnionType(staticRoutes)}\n DynamicRoutes:${setToUnionType(dynamicRoutes)}\n DynamicRouteTemplate:${setToUnionType(dynamicRouteContextKeys)}\n IsTyped: true\n ${hasRoutes ? `RouteTypes: ${generateRouteTypesMap(dynamicRouteContextKeys)}` : \"\"}\n }\n }\n}\n${hasRoutes ? `\n/**\n * Helper type for route information\n */\ntype RouteInfo<Params = Record<string, never>> = {\n Params: Params\n LoaderProps: { path: string; search?: string; subdomain?: string; params: Params; request?: Request }\n}` : \"\"}\n`.trim();\n}\nfunction generateRouteTypesMap(dynamicRouteContextKeys) {\n if (dynamicRouteContextKeys.size === 0) {\n return \"{}\";\n }\n var routes = [\n ...dynamicRouteContextKeys\n ].sort();\n var entries = routes.map(function(routePath) {\n var params = extractParams(routePath);\n var paramsType = params.length === 0 ? \"{}\" : generateInlineParamsType(params);\n return ` '${routePath}': RouteInfo<${paramsType}>`;\n }).join(\"\\n\");\n return `{\n${entries}\n }`;\n}\nfunction extractParams(routePath) {\n var params = [];\n var paramRegex = /\\[(\\.\\.\\.)?([\\w]+)\\]/g;\n var match;\n while ((match = paramRegex.exec(routePath)) !== null) {\n params.push({\n name: match[2],\n isCatchAll: match[1] === \"...\"\n });\n }\n return params;\n}\nfunction generateInlineParamsType(params) {\n var entries = params.map(function(p) {\n var type = p.isCatchAll ? \"string[]\" : \"string\";\n return `${p.name}: ${type}`;\n });\n return `{ ${entries.join(\"; \")} }`;\n}\nfunction walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {\n if (!routeNode) return;\n addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);\n parentRoutePath = `${removeSupportedExtensions(`${parentRoutePath}/${routeNode.route}`).replace(/\\/?index$/, \"\")}`;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = routeNode.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {\n if (!(routeNode === null || routeNode === void 0 ? void 0 : routeNode.route)) return;\n if (!isTypedRoute(routeNode.route)) return;\n var routePath = `${parentRoutePath}/${removeSupportedExtensions(routeNode.route).replace(/\\/?index$/, \"\")}`;\n if (!routePath.startsWith(\"/\")) {\n routePath = `/${routePath}`;\n }\n if (routeNode.dynamic) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = generateCombinations(routePath)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var path = _step.value;\n dynamicRouteContextKeys.add(path);\n dynamicRoutes.add(\n // biome-ignore lint/suspicious/noTemplateCurlyInString: intentionally generating type string\n `${path.replaceAll(CATCH_ALL, \"${string}\").replaceAll(SLUG, \"${OneRouter.SingleRoutePart<T>}\")}`\n );\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else {\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = generateCombinations(routePath)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var combination = _step1.value;\n staticRoutes.add(combination);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n}\nvar setToUnionType = function setToUnionType2(set) {\n if (set.size === 0) return \" never\";\n var sorted = [\n ...set\n ].sort();\n if (sorted.length === 1) return ` \\`${sorted[0]}\\``;\n return \"\\n | \" + sorted.map(function(s) {\n return `\\`${s}\\``;\n }).join(\"\\n | \");\n};\nfunction generateCombinations(pathname) {\n var groups = pathname.split(\"/\").filter(function(part) {\n return part.startsWith(\"(\") && part.endsWith(\")\");\n });\n var combinations = [];\n function generate(currentIndex, currentPath) {\n if (currentIndex === groups.length) {\n combinations.push(currentPath.replace(/\\/{2,}/g, \"/\"));\n return;\n }\n var group = groups[currentIndex];\n var withoutGroup = currentPath.replace(`/${group}`, \"\");\n generate(currentIndex + 1, withoutGroup);\n generate(currentIndex + 1, currentPath);\n }\n generate(0, pathname);\n return combinations;\n}\nexport {\n getTypedRoutesDeclarationFile\n};\n//# sourceMappingURL=getTypedRoutesDeclarationFile.js.map\n"],"mappings":";;;;AAEA,IAAI,YAAY;AAChB,IAAI,OAAO;AACX,SAAS,8BAA8B,KAAK;CAC1C,IAAI,+BAA+B,IAAI,IAAI;CAC3C,IAAI,gCAAgC,IAAI,IAAI;CAC5C,IAAI,0CAA0C,IAAI,IAAI;CACtD,cACE,UAAU,KAAK;EACb,gBAAgB;EAEhB,mBAAmB;EACnB,qBAAqB;CACvB,CAAC,GAED,IACA,cACA,eACA,uBACF;CACA,IAAI,YAAY,wBAAwB,OAAO;CAC/C,OAAO;;;;;;;;qBAQY,eAAe,YAAY,EAAE;sBAC5B,eAAe,aAAa,EAAE;6BACvB,eAAe,uBAAuB,EAAE;;QAE7D,YAAY,eAAe,sBAAsB,uBAAuB,MAAM,GAAG;;;;EAIvF,YAAY;;;;;;;KAOT,GAAG;EACN,KAAK;AACP;AACA,SAAS,sBAAsB,yBAAyB;CACtD,IAAI,wBAAwB,SAAS,GAAG;EACtC,OAAO;CACT;CACA,IAAI,SAAS,CACX,GAAG,uBACL,CAAC,CAAC,KAAK;CACP,IAAI,UAAU,OAAO,IAAI,SAAS,WAAW;EAC3C,IAAI,SAAS,cAAc,SAAS;EACpC,IAAI,aAAa,OAAO,WAAW,IAAI,OAAO,yBAAyB,MAAM;EAC7E,OAAO,YAAY,UAAU,eAAe,WAAW;CACzD,CAAC,CAAC,CAAC,KAAK,IAAI;CACZ,OAAO;EACP,QAAQ;;AAEV;AACA,SAAS,cAAc,WAAW;CAChC,IAAI,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ACA,IAAI,iBAAiB,SAAS,gBAAgB,KAAK;CACjD,IAAI,IAAI,SAAS,GAAG,OAAO;CAC3B,IAAI,SAAS,CACX,GAAG,GACL,CAAC,CAAC,KAAK;CACP,IAAI,OAAO,WAAW,GAAG,OAAO,MAAM,OAAO,GAAG;CAChD,OAAO,iBAAiB,OAAO,IAAI,SAAS,GAAG;EAC7C,OAAO,KAAK,EAAE;CAChB,CAAC,CAAC,CAAC,KAAK,cAAc;AACxB;AACA,SAAS,qBAAqB,UAAU;CACtC,IAAI,SAAS,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,SAAS,MAAM;EACrD,OAAO,KAAK,WAAW,GAAG,KAAK,KAAK,SAAS,GAAG;CAClD,CAAC;CACD,IAAI,eAAe,CAAC;CACpB,SAAS,SAAS,cAAc,aAAa;EAC3C,IAAI,iBAAiB,OAAO,QAAQ;GAClC,aAAa,KAAK,YAAY,QAAQ,WAAW,GAAG,CAAC;GACrD;EACF;EACA,IAAI,QAAQ,OAAO;EACnB,IAAI,eAAe,YAAY,QAAQ,IAAI,SAAS,EAAE;EACtD,SAAS,eAAe,GAAG,YAAY;EACvC,SAAS,eAAe,GAAG,WAAW;CACxC;CACA,SAAS,GAAG,QAAQ;CACpB,OAAO;AACT"}
1
+ {"version":3,"file":"getTypedRoutesDeclarationFile.native.js","names":[],"sources":["esm/typed-routes/getTypedRoutesDeclarationFile.native.js"],"sourcesContent":["import { getRoutes } from \"../router/getRoutes\";\nimport { isTypedRoute, removeSupportedExtensions } from \"../router/matchers\";\nvar CATCH_ALL = /\\[\\.\\.\\..+?\\]/g;\nvar SLUG = /\\[.+?\\]/g;\nfunction getTypedRoutesDeclarationFile(ctx) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var staticRoutes = /* @__PURE__ */ new Set();\n var dynamicRoutes = /* @__PURE__ */ new Set();\n var dynamicRouteContextKeys = /* @__PURE__ */ new Set();\n var searchParamSchemas = /* @__PURE__ */ new Map();\n walkRouteNode(\n getRoutes(ctx, {\n platformRoutes: false,\n // We don't need to generate platform specific routes\n ignoreEntryPoints: true,\n ignoreRequireErrors: true\n }),\n // importMode: 'async',\n \"\",\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys,\n searchParamSchemas,\n options.getSearchParamTypes\n );\n var hasRoutes = dynamicRouteContextKeys.size > 0;\n return `// deno-lint-ignore-file\n/* eslint-disable */\n// biome-ignore: needed import\nimport type { OneRouter } from 'one'\n\ndeclare module 'one' {\n export namespace OneRouter {\n export interface __routes<T extends string = string> extends Record<string, unknown> {\n StaticRoutes:${setToUnionType(staticRoutes)}\n DynamicRoutes:${setToUnionType(dynamicRoutes)}\n DynamicRouteTemplate:${setToUnionType(dynamicRouteContextKeys)}\n IsTyped: true${searchParamSchemas.size ? `\n SearchParamTypes: ${generateSearchParamTypesMap(searchParamSchemas, \"SearchParamsOf\")}\n SearchParamOutputs: ${generateSearchParamTypesMap(searchParamSchemas, \"SearchOutputOf\")}` : \"\"}\n ${hasRoutes ? `RouteTypes: ${generateRouteTypesMap(dynamicRouteContextKeys)}` : \"\"}\n }\n }\n}\n${hasRoutes ? `\n/**\n * Helper type for route information\n */\ntype RouteInfo<Params = Record<string, never>, Path extends string = string> = {\n Params: Params\n LoaderProps: import('one').LoaderProps<Params, OneRouter.LoaderSearchParams<Path>>\n}` : \"\"}\n`.trim();\n}\nfunction generateSearchParamTypesMap(searchParamSchemas, wrapper) {\n var entries = [\n ...searchParamSchemas\n ].sort(function(param, param1) {\n var [a] = param, [b] = param1;\n return a < b ? -1 : a > b ? 1 : 0;\n }).map(function(param) {\n var [routePath, schemas] = param;\n return ` '${routePath}': ${schemas.map(function(schema) {\n return `OneRouter.${wrapper}<${schema}>`;\n }).join(\" & \")}`;\n }).join(\"\\n\");\n return `{\n${entries}\n }`;\n}\nfunction generateRouteTypesMap(dynamicRouteContextKeys) {\n if (dynamicRouteContextKeys.size === 0) {\n return \"{}\";\n }\n var routes = [\n ...dynamicRouteContextKeys\n ].sort();\n var entries = routes.map(function(routePath) {\n var params = extractParams(routePath);\n var paramsType = params.length === 0 ? \"{}\" : generateInlineParamsType(params);\n return ` '${routePath}': RouteInfo<${paramsType}, '${routePath}'>`;\n }).join(\"\\n\");\n return `{\n${entries}\n }`;\n}\nfunction extractParams(routePath) {\n var params = [];\n var paramRegex = /\\[(\\.\\.\\.)?([\\w]+)\\]/g;\n var match;\n while ((match = paramRegex.exec(routePath)) !== null) {\n params.push({\n name: match[2],\n isCatchAll: match[1] === \"...\"\n });\n }\n return params;\n}\nfunction generateInlineParamsType(params) {\n var entries = params.map(function(p) {\n var type = p.isCatchAll ? \"string[]\" : \"string\";\n return `${p.name}: ${type}`;\n });\n return `{ ${entries.join(\"; \")} }`;\n}\nfunction walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {\n if (!routeNode) return;\n addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes);\n parentRoutePath = `${removeSupportedExtensions(`${parentRoutePath}/${routeNode.route}`).replace(/\\/?index$/, \"\")}`;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = routeNode.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys, searchParamSchemas, getSearchParamTypes) {\n if (!(routeNode === null || routeNode === void 0 ? void 0 : routeNode.route)) return;\n if (!isTypedRoute(routeNode.route)) return;\n var routePath = `${parentRoutePath}/${removeSupportedExtensions(routeNode.route).replace(/\\/?index$/, \"\")}`;\n if (!routePath.startsWith(\"/\")) {\n routePath = `/${routePath}`;\n }\n var schemaTypes = routeNode.type !== \"layout\" ? getSearchParamTypes === null || getSearchParamTypes === void 0 ? void 0 : getSearchParamTypes(routeNode.contextKey) : void 0;\n var addSearchParamTypes = function addSearchParamTypes2(path2) {\n if ((schemaTypes === null || schemaTypes === void 0 ? void 0 : schemaTypes.length) && !searchParamSchemas.has(path2)) {\n searchParamSchemas.set(path2, schemaTypes);\n }\n };\n if (routeNode.dynamic) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = generateCombinations(routePath)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var path = _step.value;\n addSearchParamTypes(path);\n dynamicRouteContextKeys.add(path);\n dynamicRoutes.add(\n // biome-ignore lint/suspicious/noTemplateCurlyInString: intentionally generating type string\n `${path.replaceAll(CATCH_ALL, \"${string}\").replaceAll(SLUG, \"${OneRouter.SingleRoutePart<T>}\")}`\n );\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else {\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = generateCombinations(routePath)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var combination = _step1.value;\n addSearchParamTypes(combination);\n staticRoutes.add(combination);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n}\nvar setToUnionType = function setToUnionType2(set) {\n if (set.size === 0) return \" never\";\n var sorted = [\n ...set\n ].sort();\n if (sorted.length === 1) return ` \\`${sorted[0]}\\``;\n return \"\\n | \" + sorted.map(function(s) {\n return `\\`${s}\\``;\n }).join(\"\\n | \");\n};\nfunction generateCombinations(pathname) {\n var groups = pathname.split(\"/\").filter(function(part) {\n return part.startsWith(\"(\") && part.endsWith(\")\");\n });\n var combinations = [];\n function generate(currentIndex, currentPath) {\n if (currentIndex === groups.length) {\n combinations.push(currentPath.replace(/\\/{2,}/g, \"/\"));\n return;\n }\n var group = groups[currentIndex];\n var withoutGroup = currentPath.replace(`/${group}`, \"\");\n generate(currentIndex + 1, withoutGroup);\n generate(currentIndex + 1, currentPath);\n }\n generate(0, pathname);\n return combinations;\n}\nexport {\n getTypedRoutesDeclarationFile\n};\n//# sourceMappingURL=getTypedRoutesDeclarationFile.js.map\n"],"mappings":";;;;AAEA,IAAI,YAAY;AAChB,IAAI,OAAO;AACX,SAAS,8BAA8B,KAAK;CAC1C,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAChF,IAAI,+BAA+B,IAAI,IAAI;CAC3C,IAAI,gCAAgC,IAAI,IAAI;CAC5C,IAAI,0CAA0C,IAAI,IAAI;CACtD,IAAI,qCAAqC,IAAI,IAAI;CACjD,cACE,UAAU,KAAK;EACb,gBAAgB;EAEhB,mBAAmB;EACnB,qBAAqB;CACvB,CAAC,GAED,IACA,cACA,eACA,yBACA,oBACA,QAAQ,mBACV;CACA,IAAI,YAAY,wBAAwB,OAAO;CAC/C,OAAO;;;;;;;;qBAQY,eAAe,YAAY,EAAE;sBAC5B,eAAe,aAAa,EAAE;6BACvB,eAAe,uBAAuB,EAAE;qBAChD,mBAAmB,OAAO;0BACrB,4BAA4B,oBAAoB,gBAAgB,EAAE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