resuxjs 0.3.10 → 0.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/README.md +23 -1
  2. package/dist/bin.d.ts +1 -2
  3. package/dist/bin.js +4 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +28 -0
  6. package/dist/build/index.js +51 -0
  7. package/dist/build/index.js.map +1 -0
  8. package/dist/cli.d.ts +15 -5
  9. package/dist/cli.js +2648 -3668
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +14 -11
  12. package/dist/compiler/adapter.js +68 -93
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +8 -5
  15. package/dist/compiler/dev-warnings.js +248 -321
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +3 -0
  18. package/dist/compiler/directives.js +124 -150
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +96 -93
  21. package/dist/compiler/implementation.js +2967 -3430
  22. package/dist/compiler/index.d.ts +14 -11
  23. package/dist/compiler/index.js +68 -93
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +12 -5
  26. package/dist/core/config.js +42 -25
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +127 -126
  29. package/dist/core/hooks.js +45 -55
  30. package/dist/core/hooks.js.map +1 -1
  31. package/dist/core/index.d.ts +5 -4
  32. package/dist/core/index.js +5 -5
  33. package/dist/core/module-container.d.ts +76 -74
  34. package/dist/core/module-container.js +181 -186
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +15 -12
  37. package/dist/core/resux.js +17 -13
  38. package/dist/core/resux.js.map +1 -1
  39. package/dist/create-bin.d.ts +1 -2
  40. package/dist/create-bin.js +4 -0
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +3 -0
  43. package/dist/create.js +499 -638
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +4 -1
  46. package/dist/deploy/cloudflare.js +30 -34
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +6 -4
  49. package/dist/deploy/common.js +118 -188
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +3 -0
  52. package/dist/deploy/framework-runtime.js +43 -48
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +4 -1
  55. package/dist/deploy/index.js +58 -80
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +4 -1
  58. package/dist/deploy/netlify.js +40 -41
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +4 -1
  61. package/dist/deploy/node.js +24 -19
  62. package/dist/deploy/node.js.map +1 -1
  63. package/dist/deploy/production-report.d.ts +3 -0
  64. package/dist/deploy/production-report.js +14 -14
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +3 -0
  67. package/dist/deploy/runtime-dependencies.js +158 -220
  68. package/dist/deploy/runtime-dependencies.js.map +1 -1
  69. package/dist/deploy/static.d.ts +4 -1
  70. package/dist/deploy/static.js +16 -14
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +25 -22
  73. package/dist/deploy/types.js +0 -1
  74. package/dist/deploy/vercel.d.ts +4 -1
  75. package/dist/deploy/vercel.js +137 -188
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +15 -11
  78. package/dist/fonts/index.js +114 -134
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +79 -78
  81. package/dist/globals.js +0 -1
  82. package/dist/halal-core/ai/classifyProject.d.ts +4 -1
  83. package/dist/halal-core/ai/classifyProject.js +81 -95
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +5 -2
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +77 -95
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +38 -35
  89. package/dist/halal-core/ai/createProjectSummary.js +38 -39
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +3 -0
  92. package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
  93. package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
  94. package/dist/halal-core/ai/redactSensitiveData.d.ts +3 -0
  95. package/dist/halal-core/ai/redactSensitiveData.js +82 -110
  96. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  97. package/dist/halal-core/ai/validateAiResponse.d.ts +4 -1
  98. package/dist/halal-core/ai/validateAiResponse.js +58 -85
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +3 -0
  101. package/dist/halal-core/cli/check.js +28 -30
  102. package/dist/halal-core/cli/check.js.map +1 -1
  103. package/dist/halal-core/cli/explain.d.ts +3 -0
  104. package/dist/halal-core/cli/explain.js +27 -31
  105. package/dist/halal-core/cli/explain.js.map +1 -1
  106. package/dist/halal-core/cli/report.d.ts +3 -0
  107. package/dist/halal-core/cli/report.js +14 -10
  108. package/dist/halal-core/cli/report.js.map +1 -1
  109. package/dist/halal-core/cli/submitReview.d.ts +3 -0
  110. package/dist/halal-core/cli/submitReview.js +13 -9
  111. package/dist/halal-core/cli/submitReview.js.map +1 -1
  112. package/dist/halal-core/cli/verifyReview.d.ts +3 -0
  113. package/dist/halal-core/cli/verifyReview.js +18 -15
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +30 -27
  116. package/dist/halal-core/config.js +76 -118
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +6 -3
  119. package/dist/halal-core/crypto/integrity.js +64 -87
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +3 -0
  122. package/dist/halal-core/enforce.js +92 -105
  123. package/dist/halal-core/enforce.js.map +1 -1
  124. package/dist/halal-core/index.d.ts +20 -16
  125. package/dist/halal-core/index.js +18 -19
  126. package/dist/halal-core/lifecycle.d.ts +3 -0
  127. package/dist/halal-core/lifecycle.js +15 -13
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +4 -1
  130. package/dist/halal-core/policy.js +6 -2
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +4 -1
  133. package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
  134. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  135. package/dist/halal-core/report/formatTerminalReport.d.ts +4 -1
  136. package/dist/halal-core/report/formatTerminalReport.js +27 -37
  137. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  138. package/dist/halal-core/report/generateHalalReport.d.ts +7 -4
  139. package/dist/halal-core/report/generateHalalReport.js +26 -26
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +4 -1
  142. package/dist/halal-core/report/signReport.js +16 -12
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +9 -6
  145. package/dist/halal-core/report/verifyReport.js +51 -41
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +4 -1
  148. package/dist/halal-core/review/createReviewRequest.js +21 -17
  149. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  150. package/dist/halal-core/review/reviewPolicy.d.ts +3 -0
  151. package/dist/halal-core/review/reviewPolicy.js +19 -17
  152. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  153. package/dist/halal-core/review/signedReviewFile.d.ts +11 -8
  154. package/dist/halal-core/review/signedReviewFile.js +24 -22
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +9 -6
  157. package/dist/halal-core/review/verifyReviewApproval.js +68 -62
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +3 -0
  160. package/dist/halal-core/rules/adultContentRules.js +23 -23
  161. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -0
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
  164. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  165. package/dist/halal-core/rules/childSafetyRules.d.ts +3 -0
  166. package/dist/halal-core/rules/childSafetyRules.js +19 -19
  167. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  168. package/dist/halal-core/rules/coreCategories.d.ts +7 -4
  169. package/dist/halal-core/rules/coreCategories.js +237 -110
  170. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  171. package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -0
  172. package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
  173. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  174. package/dist/halal-core/rules/defaultBlockedRules.d.ts +21 -18
  175. package/dist/halal-core/rules/defaultBlockedRules.js +158 -199
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +8 -5
  178. package/dist/halal-core/rules/dependencyRules.js +50 -56
  179. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  180. package/dist/halal-core/rules/endpointRules.d.ts +6 -3
  181. package/dist/halal-core/rules/endpointRules.js +21 -23
  182. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  183. package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -0
  184. package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
  185. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  186. package/dist/halal-core/rules/financeRibaRules.d.ts +3 -0
  187. package/dist/halal-core/rules/financeRibaRules.js +20 -20
  188. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  189. package/dist/halal-core/rules/gamblingRules.d.ts +3 -0
  190. package/dist/halal-core/rules/gamblingRules.js +22 -22
  191. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  192. package/dist/halal-core/rules/generalHarmRules.d.ts +3 -0
  193. package/dist/halal-core/rules/generalHarmRules.js +15 -15
  194. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  195. package/dist/halal-core/rules/healthHarmRules.d.ts +3 -0
  196. package/dist/halal-core/rules/healthHarmRules.js +19 -19
  197. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  198. package/dist/halal-core/rules/keywordRules.d.ts +11 -8
  199. package/dist/halal-core/rules/keywordRules.js +90 -39
  200. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  201. package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -0
  202. package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
  203. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  204. package/dist/halal-core/rules/scamFraudRules.d.ts +3 -0
  205. package/dist/halal-core/rules/scamFraudRules.js +29 -29
  206. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  207. package/dist/halal-core/rules/selfHarmRules.d.ts +3 -0
  208. package/dist/halal-core/rules/selfHarmRules.js +17 -17
  209. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  210. package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -0
  211. package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
  212. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  213. package/dist/halal-core/runtime/guard.d.ts +17 -14
  214. package/dist/halal-core/runtime/guard.js +162 -183
  215. package/dist/halal-core/runtime/guard.js.map +1 -1
  216. package/dist/halal-core/runtime/index.d.ts +5 -4
  217. package/dist/halal-core/runtime/index.js +4 -5
  218. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -1
  219. package/dist/halal-core/runtime/reviewedMemory.js +74 -110
  220. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  221. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +10 -7
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js +132 -156
  223. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  224. package/dist/halal-core/runtime/types.d.ts +44 -41
  225. package/dist/halal-core/runtime/types.js +0 -1
  226. package/dist/halal-core/scanner/scanApiRoutes.d.ts +3 -0
  227. package/dist/halal-core/scanner/scanApiRoutes.js +32 -36
  228. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  229. package/dist/halal-core/scanner/scanComponents.d.ts +3 -0
  230. package/dist/halal-core/scanner/scanComponents.js +12 -13
  231. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  232. package/dist/halal-core/scanner/scanContent.d.ts +5 -2
  233. package/dist/halal-core/scanner/scanContent.js +193 -263
  234. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  235. package/dist/halal-core/scanner/scanDependencies.d.ts +3 -0
  236. package/dist/halal-core/scanner/scanDependencies.js +16 -15
  237. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  238. package/dist/halal-core/scanner/scanDomains.d.ts +5 -2
  239. package/dist/halal-core/scanner/scanDomains.js +12 -12
  240. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  241. package/dist/halal-core/scanner/scanEnvNames.d.ts +3 -0
  242. package/dist/halal-core/scanner/scanEnvNames.js +23 -26
  243. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  244. package/dist/halal-core/scanner/scanMetadata.d.ts +6 -3
  245. package/dist/halal-core/scanner/scanMetadata.js +20 -29
  246. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  247. package/dist/halal-core/scanner/scanPages.d.ts +3 -0
  248. package/dist/halal-core/scanner/scanPages.js +12 -15
  249. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  250. package/dist/halal-core/scanner/scanProject.d.ts +15 -10
  251. package/dist/halal-core/scanner/scanProject.js +43 -49
  252. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  253. package/dist/halal-core/scanner/scanRoutes.d.ts +3 -0
  254. package/dist/halal-core/scanner/scanRoutes.js +32 -39
  255. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  256. package/dist/halal-core/scanner/scanTranslations.d.ts +3 -0
  257. package/dist/halal-core/scanner/scanTranslations.js +21 -29
  258. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  259. package/dist/halal-core/status.d.ts +14 -11
  260. package/dist/halal-core/status.js +0 -1
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +3 -0
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js +26 -24
  263. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +3 -0
  265. package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
  266. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  267. package/dist/halal-core/tamper/verifyReportSignature.d.ts +6 -3
  268. package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
  269. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  270. package/dist/halal.d.ts +20 -1
  271. package/dist/halal.js +18 -2
  272. package/dist/i18n/index.d.ts +34 -31
  273. package/dist/i18n/index.js +219 -288
  274. package/dist/i18n/index.js.map +1 -1
  275. package/dist/i18n/shared.d.ts +18 -15
  276. package/dist/i18n/shared.js +204 -266
  277. package/dist/i18n/shared.js.map +1 -1
  278. package/dist/icons/index.d.ts +143 -139
  279. package/dist/icons/index.js +322 -273
  280. package/dist/icons/index.js.map +1 -1
  281. package/dist/index.d.ts +8 -1
  282. package/dist/index.js +7 -2
  283. package/dist/kit/index.d.ts +9 -6
  284. package/dist/kit/index.js +45 -43
  285. package/dist/kit/index.js.map +1 -1
  286. package/dist/nitro-server/index.d.ts +7 -4
  287. package/dist/nitro-server/index.js +6 -2
  288. package/dist/nitro-server/index.js.map +1 -1
  289. package/dist/node.d.ts +6 -3
  290. package/dist/node.js +88 -116
  291. package/dist/node.js.map +1 -1
  292. package/dist/reactivity/computed.d.ts +6 -3
  293. package/dist/reactivity/computed.js +46 -53
  294. package/dist/reactivity/computed.js.map +1 -1
  295. package/dist/reactivity/effect.d.ts +8 -5
  296. package/dist/reactivity/effect.js +105 -146
  297. package/dist/reactivity/effect.js.map +1 -1
  298. package/dist/reactivity/index.d.ts +8 -8
  299. package/dist/reactivity/index.js +7 -8
  300. package/dist/reactivity/reactive.d.ts +3 -0
  301. package/dist/reactivity/reactive.js +93 -133
  302. package/dist/reactivity/reactive.js.map +1 -1
  303. package/dist/reactivity/readonly.d.ts +2 -1
  304. package/dist/reactivity/readonly.js +2 -2
  305. package/dist/reactivity/ref.d.ts +15 -15
  306. package/dist/reactivity/ref.js +73 -81
  307. package/dist/reactivity/ref.js.map +1 -1
  308. package/dist/reactivity/scheduler.d.ts +3 -1
  309. package/dist/reactivity/scheduler.js +67 -69
  310. package/dist/reactivity/scheduler.js.map +1 -1
  311. package/dist/reactivity/types.d.ts +17 -14
  312. package/dist/reactivity/types.js +0 -1
  313. package/dist/reactivity/utils.d.ts +7 -4
  314. package/dist/reactivity/utils.js +25 -24
  315. package/dist/reactivity/utils.js.map +1 -1
  316. package/dist/reactivity/watch.d.ts +4 -2
  317. package/dist/reactivity/watch.js +75 -103
  318. package/dist/reactivity/watch.js.map +1 -1
  319. package/dist/runtime/core.d.ts +31 -0
  320. package/dist/runtime/core.js +156 -0
  321. package/dist/runtime/core.js.map +1 -0
  322. package/dist/runtime/index.d.ts +487 -461
  323. package/dist/runtime/index.js +4129 -5254
  324. package/dist/runtime/index.js.map +1 -1
  325. package/dist/runtime/reactivity.d.ts +7 -0
  326. package/dist/runtime/reactivity.js +6 -0
  327. package/dist/runtime/resume.d.ts +79 -0
  328. package/dist/runtime/resume.js +482 -0
  329. package/dist/runtime/resume.js.map +1 -0
  330. package/dist/runtime/router.d.ts +20 -0
  331. package/dist/runtime/router.js +60 -0
  332. package/dist/runtime/router.js.map +1 -0
  333. package/dist/runtime/streaming.d.ts +24 -0
  334. package/dist/runtime/streaming.js +200 -0
  335. package/dist/runtime/streaming.js.map +1 -0
  336. package/dist/security/media-fetch.d.ts +32 -0
  337. package/dist/security/media-fetch.js +301 -0
  338. package/dist/security/media-fetch.js.map +1 -0
  339. package/dist/security/path-boundary.d.ts +7 -0
  340. package/dist/security/path-boundary.js +70 -0
  341. package/dist/security/path-boundary.js.map +1 -0
  342. package/dist/ui/index.d.ts +1580 -1576
  343. package/dist/ui/index.js +975 -674
  344. package/dist/ui/index.js.map +1 -1
  345. package/dist/vite-builder/index.d.ts +6 -3
  346. package/dist/vite-builder/index.js +6 -2
  347. package/dist/vite-builder/index.js.map +1 -1
  348. package/package.json +46 -86
  349. package/dist/compiler/implementation.js.map +0 -1
  350. package/dist/core/index.js.map +0 -1
  351. package/dist/deploy/types.js.map +0 -1
  352. package/dist/globals.js.map +0 -1
  353. package/dist/halal-core/index.js.map +0 -1
  354. package/dist/halal-core/runtime/index.js.map +0 -1
  355. package/dist/halal-core/runtime/types.js.map +0 -1
  356. package/dist/halal-core/status.js.map +0 -1
  357. package/dist/halal.js.map +0 -1
  358. package/dist/index.js.map +0 -1
  359. package/dist/reactivity/index.js.map +0 -1
  360. package/dist/reactivity/readonly.js.map +0 -1
  361. package/dist/reactivity/types.js.map +0 -1
@@ -1,323 +1,254 @@
1
+ import { buildLocalePath, createI18nHead, normalizeI18nRuntimeConfig, normalizeI18nStrategy, resolveI18nRoute, resolveLocaleDirection, resolveLocalizedValue, translateRaw, translateText } from "./shared.js";
2
+ import { ref } from "../reactivity/ref.js";
3
+ import { computed } from "../reactivity/computed.js";
4
+ import { defineResuxModule, useResuxApp } from "../runtime/index.js";
1
5
  import { readFile } from "node:fs/promises";
2
6
  import path from "node:path";
3
7
  import { fileURLToPath, pathToFileURL } from "node:url";
4
- import { computed, ref, defineResuxModule, useResuxApp } from "../runtime/index.js";
5
- import { buildLocalePath, createI18nHead, normalizeI18nRuntimeConfig, normalizeI18nStrategy, resolveI18nRoute, resolveLocaleDirection, resolveLocalizedValue, translateRaw, translateText } from "./shared.js";
8
+ //#region src/i18n/index.ts
6
9
  function isRecord(value) {
7
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
10
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
8
11
  }
9
12
  function readCurrentRoutePath() {
10
- if (typeof window !== "undefined" && typeof location !== "undefined") {
11
- return `${location.pathname}${location.search}${location.hash}`;
12
- }
13
- const app = useResuxApp();
14
- const currentRoute = app.route;
15
- if (currentRoute && typeof currentRoute.path === "string" && currentRoute.path.trim()) {
16
- return currentRoute.path;
17
- }
18
- return "/";
13
+ if (typeof window !== "undefined" && typeof location !== "undefined") return `${location.pathname}${location.search}${location.hash}`;
14
+ const currentRoute = useResuxApp().route;
15
+ if (currentRoute && typeof currentRoute.path === "string" && currentRoute.path.trim()) return currentRoute.path;
16
+ return "/";
19
17
  }
20
18
  function readClientRouter() {
21
- const maybeRouter = globalThis.__RESUX_ROUTER__;
22
- if (!isRecord(maybeRouter)) {
23
- return null;
24
- }
25
- const push = maybeRouter.push;
26
- const replace = maybeRouter.replace;
27
- const back = maybeRouter.back;
28
- const forward = maybeRouter.forward;
29
- const go = maybeRouter.go;
30
- if (typeof push !== "function"
31
- || typeof replace !== "function"
32
- || typeof back !== "function"
33
- || typeof forward !== "function"
34
- || typeof go !== "function") {
35
- return null;
36
- }
37
- return maybeRouter;
19
+ const maybeRouter = globalThis.__RESUX_ROUTER__;
20
+ if (!isRecord(maybeRouter)) return null;
21
+ const push = maybeRouter.push;
22
+ const replace = maybeRouter.replace;
23
+ const back = maybeRouter.back;
24
+ const forward = maybeRouter.forward;
25
+ const go = maybeRouter.go;
26
+ if (typeof push !== "function" || typeof replace !== "function" || typeof back !== "function" || typeof forward !== "function" || typeof go !== "function") return null;
27
+ return maybeRouter;
38
28
  }
39
29
  function extractDynamicImportPath(fn) {
40
- const source = String(fn);
41
- const match = source.match(/import\((["'`])(.+?)\1\)/);
42
- if (!match) {
43
- return null;
44
- }
45
- return match[2] ?? null;
30
+ const match = String(fn).match(/import\((["'`])(.+?)\1\)/);
31
+ if (!match) return null;
32
+ return match[2] ?? null;
46
33
  }
47
34
  function normalizeMessageModule(value) {
48
- if (isRecord(value) && isRecord(value.default)) {
49
- return value.default;
50
- }
51
- return isRecord(value) ? value : {};
35
+ if (isRecord(value) && isRecord(value.default)) return value.default;
36
+ return isRecord(value) ? value : {};
52
37
  }
53
38
  async function loadMessageFromPath(rootDir, filePath) {
54
- let absolute = filePath;
55
- if (filePath.startsWith("file://")) {
56
- try {
57
- absolute = fileURLToPath(filePath);
58
- }
59
- catch {
60
- absolute = filePath;
61
- }
62
- }
63
- else if (!path.isAbsolute(filePath)) {
64
- absolute = path.resolve(rootDir, filePath);
65
- }
66
- const cleanPath = absolute.split("?")[0].split("#")[0];
67
- if (cleanPath.toLowerCase().endsWith(".json")) {
68
- try {
69
- return JSON.parse(await readFile(cleanPath, "utf8"));
70
- }
71
- catch {
72
- return {};
73
- }
74
- }
75
- try {
76
- const imported = await import(filePath.startsWith("file://") ? filePath : pathToFileURL(absolute).href);
77
- return normalizeMessageModule(imported.default ?? imported);
78
- }
79
- catch {
80
- return {};
81
- }
39
+ let absolute = filePath;
40
+ if (filePath.startsWith("file://")) try {
41
+ absolute = fileURLToPath(filePath);
42
+ } catch {
43
+ absolute = filePath;
44
+ }
45
+ else if (!path.isAbsolute(filePath)) absolute = path.resolve(rootDir, filePath);
46
+ const cleanPath = absolute.split("?")[0].split("#")[0];
47
+ if (cleanPath.toLowerCase().endsWith(".json")) try {
48
+ return JSON.parse(await readFile(cleanPath, "utf8"));
49
+ } catch {
50
+ return {};
51
+ }
52
+ try {
53
+ const imported = await (filePath.startsWith("file://") ? import(filePath) : import(pathToFileURL(absolute).href));
54
+ return normalizeMessageModule(imported.default ?? imported);
55
+ } catch {
56
+ return {};
57
+ }
82
58
  }
83
59
  async function resolveMessageSource(rootDir, source) {
84
- if (!source) {
85
- return {};
86
- }
87
- if (typeof source === "string") {
88
- return loadMessageFromPath(rootDir, source);
89
- }
90
- if (typeof source === "function") {
91
- const dynamicPath = extractDynamicImportPath(source);
92
- if (dynamicPath) {
93
- const absolute = path.isAbsolute(dynamicPath) ? dynamicPath : path.resolve(rootDir, dynamicPath);
94
- if (absolute.toLowerCase().endsWith(".json")) {
95
- return loadMessageFromPath(rootDir, absolute);
96
- }
97
- }
98
- try {
99
- const loaded = await source();
100
- return normalizeMessageModule(loaded);
101
- }
102
- catch {
103
- if (dynamicPath) {
104
- return loadMessageFromPath(rootDir, dynamicPath);
105
- }
106
- return {};
107
- }
108
- }
109
- return normalizeMessageModule(source);
60
+ if (!source) return {};
61
+ if (typeof source === "string") return loadMessageFromPath(rootDir, source);
62
+ if (typeof source === "function") {
63
+ const dynamicPath = extractDynamicImportPath(source);
64
+ if (dynamicPath) {
65
+ const absolute = path.isAbsolute(dynamicPath) ? dynamicPath : path.resolve(rootDir, dynamicPath);
66
+ if (absolute.toLowerCase().endsWith(".json")) return loadMessageFromPath(rootDir, absolute);
67
+ }
68
+ try {
69
+ return normalizeMessageModule(await source());
70
+ } catch {
71
+ if (dynamicPath) return loadMessageFromPath(rootDir, dynamicPath);
72
+ return {};
73
+ }
74
+ }
75
+ return normalizeMessageModule(source);
110
76
  }
111
77
  async function resolveMessages(rootDir, locales, messages) {
112
- const resolved = {};
113
- for (const locale of locales) {
114
- const code = String(locale.code || "").trim().toLowerCase();
115
- if (!code) {
116
- continue;
117
- }
118
- resolved[code] = await resolveMessageSource(rootDir, messages?.[code]);
119
- }
120
- return resolved;
78
+ const resolved = {};
79
+ for (const locale of locales) {
80
+ const code = String(locale.code || "").trim().toLowerCase();
81
+ if (!code) continue;
82
+ resolved[code] = await resolveMessageSource(rootDir, messages?.[code]);
83
+ }
84
+ return resolved;
121
85
  }
122
86
  async function buildRuntimeI18nConfig(context, inlineOptions) {
123
- const configFromResux = isRecord(context.options.i18n) ? context.options.i18n : {};
124
- const inline = isRecord(inlineOptions) ? inlineOptions : {};
125
- const rawLocales = Array.isArray(inline.locales)
126
- ? inline.locales
127
- : Array.isArray(configFromResux.locales)
128
- ? configFromResux.locales
129
- : [];
130
- const mergedMessages = {
131
- ...(isRecord(configFromResux.messages) ? configFromResux.messages : {}),
132
- ...(isRecord(inline.messages) ? inline.messages : {})
133
- };
134
- const mergedSeo = {
135
- ...(isRecord(configFromResux.seo) ? configFromResux.seo : {}),
136
- ...(isRecord(inline.seo) ? inline.seo : {})
137
- };
138
- const merged = {
139
- ...configFromResux,
140
- ...inline,
141
- locales: rawLocales,
142
- messages: mergedMessages,
143
- seo: mergedSeo
144
- };
145
- if (!Array.isArray(merged.locales) || !merged.locales.length) {
146
- return null;
147
- }
148
- const locales = merged.locales
149
- .filter((locale) => isRecord(locale))
150
- .map((locale) => ({
151
- code: String(locale.code ?? "").trim().toLowerCase(),
152
- name: typeof locale.name === "string" ? locale.name : undefined,
153
- dir: locale.dir === "rtl" ? "rtl" : "ltr"
154
- }))
155
- .filter((locale) => locale.code.length > 0);
156
- if (!locales.length) {
157
- return null;
158
- }
159
- const firstLocale = locales[0].code;
160
- const rawConfig = {
161
- defaultLocale: typeof merged.defaultLocale === "string" ? merged.defaultLocale.toLowerCase() : firstLocale,
162
- fallbackLocale: typeof merged.fallbackLocale === "string" ? merged.fallbackLocale.toLowerCase() : undefined,
163
- strategy: normalizeI18nStrategy(merged.strategy),
164
- locales,
165
- messages: await resolveMessages(context.rootDir, locales, merged.messages),
166
- seo: {
167
- hreflang: !isRecord(merged.seo) || merged.seo.hreflang !== false
168
- }
169
- };
170
- return normalizeI18nRuntimeConfig(rawConfig);
87
+ const configFromResux = isRecord(context.options.i18n) ? context.options.i18n : {};
88
+ const inline = isRecord(inlineOptions) ? inlineOptions : {};
89
+ const rawLocales = Array.isArray(inline.locales) ? inline.locales : Array.isArray(configFromResux.locales) ? configFromResux.locales : [];
90
+ const mergedMessages = {
91
+ ...isRecord(configFromResux.messages) ? configFromResux.messages : {},
92
+ ...isRecord(inline.messages) ? inline.messages : {}
93
+ };
94
+ const mergedSeo = {
95
+ ...isRecord(configFromResux.seo) ? configFromResux.seo : {},
96
+ ...isRecord(inline.seo) ? inline.seo : {}
97
+ };
98
+ const merged = {
99
+ ...configFromResux,
100
+ ...inline,
101
+ locales: rawLocales,
102
+ messages: mergedMessages,
103
+ seo: mergedSeo
104
+ };
105
+ if (!Array.isArray(merged.locales) || !merged.locales.length) return null;
106
+ const locales = merged.locales.filter((locale) => isRecord(locale)).map((locale) => ({
107
+ code: String(locale.code ?? "").trim().toLowerCase(),
108
+ name: typeof locale.name === "string" ? locale.name : void 0,
109
+ dir: locale.dir === "rtl" ? "rtl" : "ltr"
110
+ })).filter((locale) => locale.code.length > 0);
111
+ if (!locales.length) return null;
112
+ const firstLocale = locales[0].code;
113
+ const rawConfig = {
114
+ defaultLocale: typeof merged.defaultLocale === "string" ? merged.defaultLocale.toLowerCase() : firstLocale,
115
+ fallbackLocale: typeof merged.fallbackLocale === "string" ? merged.fallbackLocale.toLowerCase() : void 0,
116
+ strategy: normalizeI18nStrategy(merged.strategy),
117
+ locales,
118
+ messages: await resolveMessages(context.rootDir, locales, merged.messages),
119
+ seo: { hreflang: !isRecord(merged.seo) || merged.seo.hreflang !== false }
120
+ };
121
+ return normalizeI18nRuntimeConfig(rawConfig);
171
122
  }
172
123
  function readRuntimeI18nConfig() {
173
- const runtimeConfig = useResuxApp().$config;
174
- const publicConfig = isRecord(runtimeConfig.public) ? runtimeConfig.public : {};
175
- return normalizeI18nRuntimeConfig(publicConfig.i18n);
124
+ const runtimeConfig = useResuxApp().$config;
125
+ const publicConfig = isRecord(runtimeConfig.public) ? runtimeConfig.public : {};
126
+ return normalizeI18nRuntimeConfig(publicConfig.i18n);
176
127
  }
177
128
  const I18N_LOCALE_STATE_KEY = "__resux_i18n_locale_state";
178
129
  function resolveConfiguredLocale(config, localeCode) {
179
- const normalized = String(localeCode || "").trim().toLowerCase();
180
- return config.locales.find((locale) => locale.code === normalized) ?? null;
130
+ const normalized = String(localeCode || "").trim().toLowerCase();
131
+ return config.locales.find((locale) => locale.code === normalized) ?? null;
181
132
  }
182
133
  function useI18nLocaleState(config) {
183
- const app = useResuxApp();
184
- const existing = app.provides[I18N_LOCALE_STATE_KEY];
185
- if (isRecord(existing) && typeof existing.value === "string") {
186
- return existing;
187
- }
188
- const initialLocale = resolveI18nRoute(readCurrentRoutePath(), config).locale.code;
189
- const state = ref(initialLocale);
190
- app.provide(I18N_LOCALE_STATE_KEY, state);
191
- return state;
134
+ const app = useResuxApp();
135
+ const existing = app.provides[I18N_LOCALE_STATE_KEY];
136
+ if (isRecord(existing) && typeof existing.value === "string") return existing;
137
+ const initialLocale = resolveI18nRoute(readCurrentRoutePath(), config).locale.code;
138
+ const state = ref(initialLocale);
139
+ app.provide(I18N_LOCALE_STATE_KEY, state);
140
+ return state;
192
141
  }
193
142
  function applyNoPrefixDocumentLocale(config, localeCode) {
194
- if (typeof document === "undefined") {
195
- return;
196
- }
197
- const html = document.documentElement;
198
- if (!html) {
199
- return;
200
- }
201
- html.setAttribute("lang", localeCode);
202
- html.setAttribute("dir", resolveLocaleDirection(config, localeCode));
143
+ if (typeof document === "undefined") return;
144
+ const html = document.documentElement;
145
+ if (!html) return;
146
+ html.setAttribute("lang", localeCode);
147
+ html.setAttribute("dir", resolveLocaleDirection(config, localeCode));
203
148
  }
204
149
  function fallbackI18nConfig() {
205
- return {
206
- defaultLocale: "en",
207
- fallbackLocale: "en",
208
- strategy: "prefix_except_default",
209
- locales: [{ code: "en", dir: "ltr", name: "English" }],
210
- messages: { en: {} }
211
- };
212
- }
213
- export function useI18n() {
214
- const runtimeI18n = readRuntimeI18nConfig() ?? fallbackI18nConfig();
215
- const localeState = useI18nLocaleState(runtimeI18n);
216
- const locale = computed(() => runtimeI18n.strategy === "no_prefix"
217
- ? localeState.value
218
- : resolveI18nRoute(readCurrentRoutePath(), runtimeI18n).locale.code);
219
- const dir = computed(() => resolveLocaleDirection(runtimeI18n, locale.value));
220
- return {
221
- locale,
222
- dir,
223
- locales: runtimeI18n.locales,
224
- defaultLocale: runtimeI18n.defaultLocale,
225
- fallbackLocale: runtimeI18n.fallbackLocale,
226
- strategy: runtimeI18n.strategy,
227
- t(key, params = {}) {
228
- return translateText(runtimeI18n, locale.value, key, params);
229
- },
230
- tm(key) {
231
- return translateRaw(runtimeI18n, locale.value, key);
232
- },
233
- resolveLocalized(value) {
234
- return resolveLocalizedValue(value, locale.value, runtimeI18n.fallbackLocale);
235
- },
236
- localePath(to, localeCode) {
237
- return buildLocalePath(to, localeCode ?? locale.value, runtimeI18n);
238
- },
239
- switchLocalePath(localeCode, to) {
240
- return buildLocalePath(to ?? readCurrentRoutePath(), localeCode, runtimeI18n);
241
- },
242
- setLocale(localeCode, to) {
243
- const targetLocale = resolveConfiguredLocale(runtimeI18n, localeCode);
244
- if (!targetLocale) {
245
- return;
246
- }
247
- if (runtimeI18n.strategy === "no_prefix") {
248
- localeState.value = targetLocale.code;
249
- applyNoPrefixDocumentLocale(runtimeI18n, targetLocale.code);
250
- return;
251
- }
252
- const target = buildLocalePath(to ?? readCurrentRoutePath(), targetLocale.code, runtimeI18n);
253
- const router = readClientRouter();
254
- if (router) {
255
- return router.push(target);
256
- }
257
- if (typeof window !== "undefined" && typeof location !== "undefined") {
258
- location.assign(target);
259
- }
260
- }
261
- };
262
- }
263
- export function useLocalePath() {
264
- const { localePath } = useI18n();
265
- return localePath;
266
- }
267
- export function useSwitchLocalePath() {
268
- const { switchLocalePath } = useI18n();
269
- return switchLocalePath;
270
- }
271
- export function defineI18nConfig(config) {
272
- return config;
273
- }
274
- export function createI18nHeadEntry(routePath, routeOrigin) {
275
- const runtimeI18n = readRuntimeI18nConfig();
276
- if (!runtimeI18n) {
277
- return { htmlAttrs: { lang: "en", dir: "ltr" }, link: [] };
278
- }
279
- return createI18nHead(routePath, routeOrigin, runtimeI18n);
280
- }
281
- export default defineResuxModule({
282
- defaults: {
283
- strategy: "prefix_except_default"
284
- },
285
- async setup(options, context) {
286
- const runtimeI18n = await buildRuntimeI18nConfig(context, options ?? {});
287
- if (!runtimeI18n) {
288
- return;
289
- }
290
- const sourceI18n = isRecord(context.options.i18n)
291
- ? context.options.i18n
292
- : {};
293
- const sourceSeo = isRecord(sourceI18n.seo) ? sourceI18n.seo : {};
294
- const inlineSeoSource = isRecord(options) ? options : {};
295
- const inlineSeo = isRecord(inlineSeoSource.seo) ? inlineSeoSource.seo : {};
296
- const hreflangEnabled = sourceSeo.hreflang !== false;
297
- const hreflangInline = inlineSeo.hreflang !== false;
298
- context.extendRuntimeConfig({
299
- public: {
300
- i18n: {
301
- ...runtimeI18n,
302
- seo: {
303
- hreflang: hreflangEnabled && hreflangInline
304
- }
305
- }
306
- }
307
- });
308
- // Under the "prefix" strategy every locale is prefixed, so the bare root
309
- // path has no matching page. Redirect it to the default locale instead of
310
- // 404ing.
311
- if (runtimeI18n.strategy === "prefix") {
312
- context.addRouteRule("/", {
313
- redirect: { to: `/${runtimeI18n.defaultLocale}`, statusCode: 302 }
314
- });
315
- }
316
- }
150
+ return {
151
+ defaultLocale: "en",
152
+ fallbackLocale: "en",
153
+ strategy: "prefix_except_default",
154
+ locales: [{
155
+ code: "en",
156
+ dir: "ltr",
157
+ name: "English"
158
+ }],
159
+ messages: { en: {} }
160
+ };
161
+ }
162
+ function useI18n() {
163
+ const runtimeI18n = readRuntimeI18nConfig() ?? fallbackI18nConfig();
164
+ const localeState = useI18nLocaleState(runtimeI18n);
165
+ const locale = computed(() => runtimeI18n.strategy === "no_prefix" ? localeState.value : resolveI18nRoute(readCurrentRoutePath(), runtimeI18n).locale.code);
166
+ return {
167
+ locale,
168
+ dir: computed(() => resolveLocaleDirection(runtimeI18n, locale.value)),
169
+ locales: runtimeI18n.locales,
170
+ defaultLocale: runtimeI18n.defaultLocale,
171
+ fallbackLocale: runtimeI18n.fallbackLocale,
172
+ strategy: runtimeI18n.strategy,
173
+ t(key, params = {}) {
174
+ return translateText(runtimeI18n, locale.value, key, params);
175
+ },
176
+ tm(key) {
177
+ return translateRaw(runtimeI18n, locale.value, key);
178
+ },
179
+ resolveLocalized(value) {
180
+ return resolveLocalizedValue(value, locale.value, runtimeI18n.fallbackLocale);
181
+ },
182
+ localePath(to, localeCode) {
183
+ return buildLocalePath(to, localeCode ?? locale.value, runtimeI18n);
184
+ },
185
+ switchLocalePath(localeCode, to) {
186
+ return buildLocalePath(to ?? readCurrentRoutePath(), localeCode, runtimeI18n);
187
+ },
188
+ setLocale(localeCode, to) {
189
+ const targetLocale = resolveConfiguredLocale(runtimeI18n, localeCode);
190
+ if (!targetLocale) return;
191
+ if (runtimeI18n.strategy === "no_prefix") {
192
+ localeState.value = targetLocale.code;
193
+ applyNoPrefixDocumentLocale(runtimeI18n, targetLocale.code);
194
+ return;
195
+ }
196
+ const target = buildLocalePath(to ?? readCurrentRoutePath(), targetLocale.code, runtimeI18n);
197
+ const router = readClientRouter();
198
+ if (router) return router.push(target);
199
+ if (typeof window !== "undefined" && typeof location !== "undefined") location.assign(target);
200
+ }
201
+ };
202
+ }
203
+ function useLocalePath() {
204
+ const { localePath } = useI18n();
205
+ return localePath;
206
+ }
207
+ function useSwitchLocalePath() {
208
+ const { switchLocalePath } = useI18n();
209
+ return switchLocalePath;
210
+ }
211
+ function defineI18nConfig(config) {
212
+ return config;
213
+ }
214
+ function createI18nHeadEntry(routePath, routeOrigin) {
215
+ const runtimeI18n = readRuntimeI18nConfig();
216
+ if (!runtimeI18n) return {
217
+ htmlAttrs: {
218
+ lang: "en",
219
+ dir: "ltr"
220
+ },
221
+ link: []
222
+ };
223
+ return createI18nHead(routePath, routeOrigin, runtimeI18n);
224
+ }
225
+ var i18n_default = defineResuxModule({
226
+ defaults: { strategy: "prefix_except_default" },
227
+ async setup(options, context) {
228
+ const runtimeI18n = await buildRuntimeI18nConfig(context, options ?? {});
229
+ if (!runtimeI18n) return;
230
+ const sourceI18n = isRecord(context.options.i18n) ? context.options.i18n : {};
231
+ const sourceSeo = isRecord(sourceI18n.seo) ? sourceI18n.seo : {};
232
+ const inlineSeoSource = isRecord(options) ? options : {};
233
+ const inlineSeo = isRecord(inlineSeoSource.seo) ? inlineSeoSource.seo : {};
234
+ const hreflangEnabled = sourceSeo.hreflang !== false;
235
+ const hreflangInline = inlineSeo.hreflang !== false;
236
+ context.extendRuntimeConfig({ public: { i18n: {
237
+ ...runtimeI18n,
238
+ seo: { hreflang: hreflangEnabled && hreflangInline }
239
+ } } });
240
+ if (runtimeI18n.strategy === "prefix") context.addRouteRule("/", { redirect: {
241
+ to: `/${runtimeI18n.defaultLocale}`,
242
+ statusCode: 302
243
+ } });
244
+ }
317
245
  });
318
246
  if (typeof globalThis !== "undefined") {
319
- globalThis.__RESUX_USE_I18N__ ??= useI18n;
320
- globalThis.__RESUX_USE_LOCALE_PATH__ ??= useLocalePath;
321
- globalThis.__RESUX_USE_SWITCH_LOCALE_PATH__ ??= useSwitchLocalePath;
247
+ globalThis.__RESUX_USE_I18N__ ??= useI18n;
248
+ globalThis.__RESUX_USE_LOCALE_PATH__ ??= useLocalePath;
249
+ globalThis.__RESUX_USE_SWITCH_LOCALE_PATH__ ??= useSwitchLocalePath;
322
250
  }
251
+ //#endregion
252
+ export { createI18nHeadEntry, i18n_default as default, defineI18nConfig, useI18n, useLocalePath, useSwitchLocalePath };
253
+
323
254
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;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O,CAAC,YAAY,CAAC,GAAG,EAAE;gBACxB,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,WAAW,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE;aACnE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;IACrC,UAAkB,CAAC,kBAAkB,KAAK,OAAO,CAAC;IAClD,UAAkB,CAAC,yBAAyB,KAAK,aAAa,CAAC;IAC/D,UAAkB,CAAC,gCAAgC,KAAK,mBAAmB,CAAC;AAC/E,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/i18n/index.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport {\n computed,\n ref,\n defineResuxModule,\n type ResuxModuleContext,\n type Ref,\n useResuxApp,\n type ResuxRouter,\n type RuntimeConfig\n} from \"../runtime/index.js\";\nimport {\n buildLocalePath,\n createI18nHead,\n normalizeI18nRuntimeConfig,\n normalizeI18nStrategy,\n resolveI18nRoute,\n resolveLocaleDirection,\n resolveLocalizedValue,\n translateRaw,\n translateText,\n type ResuxI18nLocale,\n type ResuxI18nRuntimeConfig,\n type ResuxI18nStrategy,\n type ResuxI18nTranslationParams\n} from \"./shared.js\";\n\ntype MessageRecord = Record<string, unknown>;\n\nexport interface ResuxI18nLocaleInput {\n code: string;\n name?: string;\n dir?: \"ltr\" | \"rtl\";\n}\n\nexport type ResuxI18nMessageSource =\n | MessageRecord\n | string\n | (() => unknown | Promise<unknown>);\n\nexport interface ResuxI18nConfigInput {\n defaultLocale: string;\n fallbackLocale?: string;\n strategy?: ResuxI18nStrategy;\n locales: ResuxI18nLocaleInput[];\n messages?: Record<string, ResuxI18nMessageSource>;\n seo?: {\n hreflang?: boolean;\n };\n}\n\nexport interface ResuxI18nModuleOptions extends Partial<ResuxI18nConfigInput> {}\n\nexport interface UseI18nResult {\n locale: ReturnType<typeof computed<string>>;\n dir: ReturnType<typeof computed<\"ltr\" | \"rtl\">>;\n locales: ResuxI18nLocale[];\n defaultLocale: string;\n fallbackLocale: string;\n strategy: ResuxI18nStrategy;\n t: (key: string, params?: ResuxI18nTranslationParams) => string;\n tm: (key: string) => unknown;\n resolveLocalized: (value: unknown) => string | null;\n localePath: (to: string, localeCode?: string) => string;\n switchLocalePath: (localeCode: string, to?: string) => string;\n setLocale: (localeCode: string, to?: string) => Promise<void> | void;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value && typeof value === \"object\" && !Array.isArray(value));\n}\n\nfunction readCurrentRoutePath(): string {\n if (typeof window !== \"undefined\" && typeof location !== \"undefined\") {\n return `${location.pathname}${location.search}${location.hash}`;\n }\n\n const app = useResuxApp();\n const currentRoute = app.route;\n if (currentRoute && typeof currentRoute.path === \"string\" && currentRoute.path.trim()) {\n return currentRoute.path;\n }\n\n return \"/\";\n}\n\nfunction readClientRouter(): ResuxRouter | null {\n const maybeRouter = (globalThis as { __RESUX_ROUTER__?: unknown }).__RESUX_ROUTER__;\n if (!isRecord(maybeRouter)) {\n return null;\n }\n const push = maybeRouter.push;\n const replace = maybeRouter.replace;\n const back = maybeRouter.back;\n const forward = maybeRouter.forward;\n const go = maybeRouter.go;\n if (\n typeof push !== \"function\"\n || typeof replace !== \"function\"\n || typeof back !== \"function\"\n || typeof forward !== \"function\"\n || typeof go !== \"function\"\n ) {\n return null;\n }\n return maybeRouter as unknown as ResuxRouter;\n}\n\nfunction extractDynamicImportPath(fn: () => unknown): string | null {\n const source = String(fn);\n const match = source.match(/import\\(([\"'`])(.+?)\\1\\)/);\n if (!match) {\n return null;\n }\n return match[2] ?? null;\n}\n\nfunction normalizeMessageModule(value: unknown): MessageRecord {\n if (isRecord(value) && isRecord(value.default)) {\n return value.default;\n }\n return isRecord(value) ? value : {};\n}\n\nasync function loadMessageFromPath(rootDir: string, filePath: string): Promise<MessageRecord> {\n let absolute = filePath;\n if (filePath.startsWith(\"file://\")) {\n try {\n absolute = fileURLToPath(filePath);\n } catch {\n absolute = filePath;\n }\n } else if (!path.isAbsolute(filePath)) {\n absolute = path.resolve(rootDir, filePath);\n }\n\n const cleanPath = absolute.split(\"?\")[0].split(\"#\")[0];\n if (cleanPath.toLowerCase().endsWith(\".json\")) {\n try {\n return JSON.parse(await readFile(cleanPath, \"utf8\")) as MessageRecord;\n } catch {\n return {};\n }\n }\n try {\n const imported = await import(filePath.startsWith(\"file://\") ? filePath : pathToFileURL(absolute).href);\n return normalizeMessageModule(imported.default ?? imported);\n } catch {\n return {};\n }\n}\n\nasync function resolveMessageSource(rootDir: string, source: ResuxI18nMessageSource | undefined): Promise<MessageRecord> {\n if (!source) {\n return {};\n }\n\n if (typeof source === \"string\") {\n return loadMessageFromPath(rootDir, source);\n }\n\n if (typeof source === \"function\") {\n const dynamicPath = extractDynamicImportPath(source);\n if (dynamicPath) {\n const absolute = path.isAbsolute(dynamicPath) ? dynamicPath : path.resolve(rootDir, dynamicPath);\n if (absolute.toLowerCase().endsWith(\".json\")) {\n return loadMessageFromPath(rootDir, absolute);\n }\n }\n try {\n const loaded = await source();\n return normalizeMessageModule(loaded);\n } catch {\n if (dynamicPath) {\n return loadMessageFromPath(rootDir, dynamicPath);\n }\n return {};\n }\n }\n\n return normalizeMessageModule(source);\n}\n\nasync function resolveMessages(\n rootDir: string,\n locales: ResuxI18nLocaleInput[],\n messages: Record<string, ResuxI18nMessageSource> | undefined\n): Promise<Record<string, MessageRecord>> {\n const resolved: Record<string, MessageRecord> = {};\n for (const locale of locales) {\n const code = String(locale.code || \"\").trim().toLowerCase();\n if (!code) {\n continue;\n }\n resolved[code] = await resolveMessageSource(rootDir, messages?.[code]);\n }\n return resolved;\n}\n\nasync function buildRuntimeI18nConfig(\n context: ResuxModuleContext,\n inlineOptions: ResuxI18nModuleOptions\n): Promise<ResuxI18nRuntimeConfig | null> {\n const configFromResux = isRecord(context.options.i18n) ? context.options.i18n : {};\n const inline = isRecord(inlineOptions) ? inlineOptions : {};\n const rawLocales = Array.isArray(inline.locales)\n ? inline.locales\n : Array.isArray(configFromResux.locales)\n ? configFromResux.locales\n : [];\n const mergedMessages = {\n ...(isRecord(configFromResux.messages) ? configFromResux.messages : {}),\n ...(isRecord(inline.messages) ? inline.messages : {})\n };\n const mergedSeo = {\n ...(isRecord(configFromResux.seo) ? configFromResux.seo : {}),\n ...(isRecord(inline.seo) ? inline.seo : {})\n };\n const merged = {\n ...configFromResux,\n ...inline,\n locales: rawLocales,\n messages: mergedMessages,\n seo: mergedSeo\n } as ResuxI18nConfigInput;\n\n if (!Array.isArray(merged.locales) || !merged.locales.length) {\n return null;\n }\n\n const locales: ResuxI18nLocaleInput[] = merged.locales\n .filter((locale) => isRecord(locale))\n .map((locale) => ({\n code: String(locale.code ?? \"\").trim().toLowerCase(),\n name: typeof locale.name === \"string\" ? locale.name : undefined,\n dir: locale.dir === \"rtl\" ? \"rtl\" as const : \"ltr\" as const\n }))\n .filter((locale) => locale.code.length > 0);\n\n if (!locales.length) {\n return null;\n }\n\n const firstLocale = locales[0].code;\n const rawConfig: Record<string, unknown> = {\n defaultLocale: typeof merged.defaultLocale === \"string\" ? merged.defaultLocale.toLowerCase() : firstLocale,\n fallbackLocale: typeof merged.fallbackLocale === \"string\" ? merged.fallbackLocale.toLowerCase() : undefined,\n strategy: normalizeI18nStrategy(merged.strategy),\n locales,\n messages: await resolveMessages(context.rootDir, locales, merged.messages),\n seo: {\n hreflang: !isRecord(merged.seo) || merged.seo.hreflang !== false\n }\n };\n\n return normalizeI18nRuntimeConfig(rawConfig);\n}\n\nfunction readRuntimeI18nConfig(): ResuxI18nRuntimeConfig | null {\n const runtimeConfig = useResuxApp().$config as RuntimeConfig;\n const publicConfig = isRecord(runtimeConfig.public) ? runtimeConfig.public : {};\n return normalizeI18nRuntimeConfig(publicConfig.i18n);\n}\n\nconst I18N_LOCALE_STATE_KEY = \"__resux_i18n_locale_state\";\n\nfunction resolveConfiguredLocale(config: ResuxI18nRuntimeConfig, localeCode: string): ResuxI18nLocale | null {\n const normalized = String(localeCode || \"\").trim().toLowerCase();\n return config.locales.find((locale) => locale.code === normalized) ?? null;\n}\n\nfunction useI18nLocaleState(config: ResuxI18nRuntimeConfig): Ref<string> {\n const app = useResuxApp();\n const existing = app.provides[I18N_LOCALE_STATE_KEY];\n if (isRecord(existing) && typeof existing.value === \"string\") {\n return existing as unknown as Ref<string>;\n }\n\n const initialLocale = resolveI18nRoute(readCurrentRoutePath(), config).locale.code;\n const state = ref(initialLocale);\n app.provide(I18N_LOCALE_STATE_KEY, state);\n return state;\n}\n\nfunction applyNoPrefixDocumentLocale(config: ResuxI18nRuntimeConfig, localeCode: string): void {\n if (typeof document === \"undefined\") {\n return;\n }\n const html = document.documentElement;\n if (!html) {\n return;\n }\n html.setAttribute(\"lang\", localeCode);\n html.setAttribute(\"dir\", resolveLocaleDirection(config, localeCode));\n}\n\nfunction fallbackI18nConfig(): ResuxI18nRuntimeConfig {\n return {\n defaultLocale: \"en\",\n fallbackLocale: \"en\",\n strategy: \"prefix_except_default\",\n locales: [{ code: \"en\", dir: \"ltr\", name: \"English\" }],\n messages: { en: {} }\n };\n}\n\nexport function useI18n(): UseI18nResult {\n const runtimeI18n = readRuntimeI18nConfig() ?? fallbackI18nConfig();\n const localeState = useI18nLocaleState(runtimeI18n);\n const locale = computed(() => runtimeI18n.strategy === \"no_prefix\"\n ? localeState.value\n : resolveI18nRoute(readCurrentRoutePath(), runtimeI18n).locale.code);\n const dir = computed(() => resolveLocaleDirection(runtimeI18n, locale.value));\n\n return {\n locale,\n dir,\n locales: runtimeI18n.locales,\n defaultLocale: runtimeI18n.defaultLocale,\n fallbackLocale: runtimeI18n.fallbackLocale,\n strategy: runtimeI18n.strategy,\n t(key: string, params: ResuxI18nTranslationParams = {}): string {\n return translateText(runtimeI18n, locale.value, key, params);\n },\n tm(key: string): unknown {\n return translateRaw(runtimeI18n, locale.value, key);\n },\n resolveLocalized(value: unknown): string | null {\n return resolveLocalizedValue(value, locale.value, runtimeI18n.fallbackLocale);\n },\n localePath(to: string, localeCode?: string): string {\n return buildLocalePath(to, localeCode ?? locale.value, runtimeI18n);\n },\n switchLocalePath(localeCode: string, to?: string): string {\n return buildLocalePath(to ?? readCurrentRoutePath(), localeCode, runtimeI18n);\n },\n setLocale(localeCode: string, to?: string): Promise<void> | void {\n const targetLocale = resolveConfiguredLocale(runtimeI18n, localeCode);\n if (!targetLocale) {\n return;\n }\n if (runtimeI18n.strategy === \"no_prefix\") {\n localeState.value = targetLocale.code;\n applyNoPrefixDocumentLocale(runtimeI18n, targetLocale.code);\n return;\n }\n\n const target = buildLocalePath(to ?? readCurrentRoutePath(), targetLocale.code, runtimeI18n);\n const router = readClientRouter();\n if (router) {\n return router.push(target);\n }\n if (typeof window !== \"undefined\" && typeof location !== \"undefined\") {\n location.assign(target);\n }\n }\n };\n}\n\nexport function useLocalePath(): (to: string, localeCode?: string) => string {\n const { localePath } = useI18n();\n return localePath;\n}\n\nexport function useSwitchLocalePath(): (localeCode: string, to?: string) => string {\n const { switchLocalePath } = useI18n();\n return switchLocalePath;\n}\n\nexport function defineI18nConfig<T extends ResuxI18nConfigInput>(config: T): T {\n return config;\n}\n\nexport function createI18nHeadEntry(routePath: string, routeOrigin?: string): { htmlAttrs: Record<string, string>; link: Array<Record<string, string>> } {\n const runtimeI18n = readRuntimeI18nConfig();\n if (!runtimeI18n) {\n return { htmlAttrs: { lang: \"en\", dir: \"ltr\" }, link: [] };\n }\n return createI18nHead(routePath, routeOrigin, runtimeI18n);\n}\n\nexport default defineResuxModule<ResuxI18nModuleOptions>({\n defaults: {\n strategy: \"prefix_except_default\"\n },\n async setup(options, context) {\n const runtimeI18n = await buildRuntimeI18nConfig(context, options ?? {});\n if (!runtimeI18n) {\n return;\n }\n\n const sourceI18n = isRecord((context.options as Record<string, unknown>).i18n)\n ? (context.options as Record<string, unknown>).i18n as Record<string, unknown>\n : {};\n const sourceSeo = isRecord(sourceI18n.seo) ? sourceI18n.seo : {};\n const inlineSeoSource = isRecord(options) ? options : {};\n const inlineSeo = isRecord(inlineSeoSource.seo) ? inlineSeoSource.seo : {};\n const hreflangEnabled = sourceSeo.hreflang !== false;\n const hreflangInline = inlineSeo.hreflang !== false;\n\n context.extendRuntimeConfig({\n public: {\n i18n: {\n ...runtimeI18n,\n seo: {\n hreflang: hreflangEnabled && hreflangInline\n }\n }\n }\n });\n\n // Under the \"prefix\" strategy every locale is prefixed, so the bare root\n // path has no matching page. Redirect it to the default locale instead of\n // 404ing.\n if (runtimeI18n.strategy === \"prefix\") {\n context.addRouteRule(\"/\", {\n redirect: { to: `/${runtimeI18n.defaultLocale}`, statusCode: 302 }\n });\n }\n }\n});\n\nif (typeof globalThis !== \"undefined\") {\n (globalThis as any).__RESUX_USE_I18N__ ??= useI18n;\n (globalThis as any).__RESUX_USE_LOCALE_PATH__ ??= useLocalePath;\n (globalThis as any).__RESUX_USE_SWITCH_LOCALE_PATH__ ??= useSwitchLocalePath;\n}\n"],"mappings":";;;;;;;;AAsEA,SAAS,SAAS,OAAkD;CAClE,OAAO,QAAQ,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,CAAC;AAC5E;AAEA,SAAS,uBAA+B;CACtC,IAAI,OAAO,WAAW,eAAe,OAAO,aAAa,aACvD,OAAO,GAAG,SAAS,WAAW,SAAS,SAAS,SAAS;CAI3D,MAAM,eADM,YACW,CAAC,CAAC;CACzB,IAAI,gBAAgB,OAAO,aAAa,SAAS,YAAY,aAAa,KAAK,KAAK,GAClF,OAAO,aAAa;CAGtB,OAAO;AACT;AAEA,SAAS,mBAAuC;CAC9C,MAAM,cAAe,WAA8C;CACnE,IAAI,CAAC,SAAS,WAAW,GACvB,OAAO;CAET,MAAM,OAAO,YAAY;CACzB,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,YAAY;CACzB,MAAM,UAAU,YAAY;CAC5B,MAAM,KAAK,YAAY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