acrylblends 0.6.2 → 0.6.4

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 (316) hide show
  1. package/README.md +5 -1
  2. package/docs/framework/README.md +3 -2
  3. package/docs/framework/UPSTREAM.md +1 -1
  4. package/docs/framework/cordis/acryl-in-a-cordis-app.md +6 -0
  5. package/docs/framework/getting-started/basic.md +1 -0
  6. package/docs/framework/getting-started/desktop.md +41 -0
  7. package/docs/framework/guides/jsx-dom.md +0 -3
  8. package/docs/framework/guides/jsx.md +24 -3
  9. package/docs/framework/helpers/css.md +0 -3
  10. package/docs/framework/helpers/ssg.md +3 -6
  11. package/docs/framework/middleware/builtin/jsx-renderer.md +0 -3
  12. package/docs/framework/upstream.json +3 -3
  13. package/lib/accepts.d.ts +1 -1
  14. package/lib/acryl-base.d.ts +1 -1
  15. package/lib/adapter.d.ts +1 -1
  16. package/lib/{app-BdrVHBlJ.d.ts → app-D8riatvv.d.ts} +1 -1
  17. package/lib/base-BpQy2Rk7.d.ts +783 -0
  18. package/lib/base-ddiVmiE7.js +721 -0
  19. package/lib/basic-auth.d.ts +1 -1
  20. package/lib/bearer-auth.d.ts +1 -1
  21. package/lib/body-limit.d.ts +1 -1
  22. package/lib/cache.d.ts +1 -1
  23. package/lib/cache.js +4 -4
  24. package/lib/{client-BHTr318g.js → client-DDLXwhBo.js} +2 -125
  25. package/lib/client.d.ts +2 -2
  26. package/lib/client.js +2 -1
  27. package/lib/combine.d.ts +1 -1
  28. package/lib/common-D8Z4JRCw.d.ts +46 -0
  29. package/lib/components-0o0CBYNv.js +268 -0
  30. package/lib/components-DdI7-ns7.js +24 -0
  31. package/lib/compress.d.ts +1 -1
  32. package/lib/conninfo.d.ts +2 -2
  33. package/lib/constants-BR9jM9BC.js +9 -0
  34. package/lib/{context-B5Y1lLha.d.ts → context-DS3fYyG-.d.ts} +2 -2
  35. package/lib/context-DxFdY_un.d.ts +250 -0
  36. package/lib/context-storage.d.ts +1 -1
  37. package/lib/{cookie-D9_nQbsM.d.ts → cookie-CCelEqky.d.ts} +1 -1
  38. package/lib/cookie.d.ts +3 -3
  39. package/lib/cors.d.ts +1 -1
  40. package/lib/csrf.d.ts +1 -1
  41. package/lib/css-D2jb7X8b.js +320 -0
  42. package/lib/css.d.ts +82 -0
  43. package/lib/css.js +134 -0
  44. package/lib/dev.d.ts +2 -2
  45. package/lib/etag.d.ts +1 -1
  46. package/lib/factory.d.ts +2 -2
  47. package/lib/hooks-BMw6BAyP.js +762 -0
  48. package/lib/html-SllAe0YT.d.ts +46 -0
  49. package/lib/html.d.ts +1 -1
  50. package/lib/{index-m12zcmph.d.ts → index-Bb7YJKCq.d.ts} +3 -3
  51. package/lib/{index-Kqou8Fjh.d.ts → index-BvFh1Gfx.d.ts} +2 -2
  52. package/lib/index-C850MeBA.d.ts +94 -0
  53. package/lib/{index-DtEoak1i.d.ts → index-CTy4N7ng.d.ts} +2 -2
  54. package/lib/index.d.ts +4 -4
  55. package/lib/ip-restriction.d.ts +2 -2
  56. package/lib/jsx/dom/client.d.ts +30 -0
  57. package/lib/jsx/dom/client.js +49 -0
  58. package/lib/jsx/dom/css.d.ts +84 -0
  59. package/lib/jsx/dom/css.js +2 -0
  60. package/lib/jsx/dom/jsx-dev-runtime.d.ts +3 -0
  61. package/lib/jsx/dom/jsx-dev-runtime.js +2 -0
  62. package/lib/jsx/dom/jsx-runtime.d.ts +3 -0
  63. package/lib/jsx/dom/jsx-runtime.js +2 -0
  64. package/lib/jsx/dom/server.d.ts +105 -0
  65. package/lib/jsx/dom/server.js +37 -0
  66. package/lib/jsx/dom.d.ts +5 -0
  67. package/lib/jsx/dom.js +74 -0
  68. package/lib/jsx/jsx-dev-runtime.d.ts +6 -0
  69. package/lib/jsx/jsx-dev-runtime.js +14 -0
  70. package/lib/jsx/jsx-runtime.d.ts +10 -0
  71. package/lib/jsx/jsx-runtime.js +30 -0
  72. package/lib/jsx/streaming.d.ts +2 -0
  73. package/lib/jsx/streaming.js +2 -0
  74. package/lib/jsx-dev-runtime-B22O-Npk.d.ts +7 -0
  75. package/lib/jsx-dev-runtime-D18Y35TI.js +354 -0
  76. package/lib/jsx-renderer.d.ts +75 -0
  77. package/lib/jsx-renderer.js +99 -0
  78. package/lib/jsx-runtime-BVVgDSdq.d.ts +1 -0
  79. package/lib/jsx.d.ts +3 -0
  80. package/lib/jsx.js +47 -0
  81. package/lib/jwk.d.ts +4 -4
  82. package/lib/{jwt-BA65QhnJ.d.ts → jwt-BARhotDz.d.ts} +1 -1
  83. package/lib/jwt.d.ts +4 -4
  84. package/lib/language.d.ts +1 -1
  85. package/lib/logger.d.ts +1 -1
  86. package/lib/loopback-only.d.ts +1 -1
  87. package/lib/method-not-allowed.d.ts +2 -2
  88. package/lib/method-override.d.ts +2 -2
  89. package/lib/mount.d.ts +1 -1
  90. package/lib/node-server/conninfo.d.ts +1 -1
  91. package/lib/node-server/serve-static.d.ts +1 -1
  92. package/lib/node-server/serve-static.js +1 -1
  93. package/lib/node-server.d.ts +1 -1
  94. package/lib/node-server.js +1 -1
  95. package/lib/powered-by.d.ts +1 -1
  96. package/lib/pretty-json.d.ts +1 -1
  97. package/lib/proxy.d.ts +1 -1
  98. package/lib/quick.d.ts +1 -1
  99. package/lib/request-id.d.ts +1 -1
  100. package/lib/request.d.ts +1 -1
  101. package/lib/route.d.ts +1 -1
  102. package/lib/schema-validator.d.ts +1 -1
  103. package/lib/secure-headers.d.ts +1 -1
  104. package/lib/{serve-static-Dw_m6KxR.js → serve-static-B14MF1Va.js} +2 -0
  105. package/lib/serve-static.d.ts +1 -1
  106. package/lib/ssg-BwjcA-Ge.js +389 -0
  107. package/lib/ssg.d.ts +156 -0
  108. package/lib/ssg.js +2 -0
  109. package/lib/streaming.d.ts +1 -1
  110. package/lib/testing.d.ts +4 -4
  111. package/lib/testing.js +1 -1
  112. package/lib/timeout.d.ts +1 -1
  113. package/lib/timing.d.ts +1 -1
  114. package/lib/tiny.d.ts +1 -1
  115. package/lib/trailing-slash.d.ts +1 -1
  116. package/lib/{types-ZM9gIiKh.d.ts → types-Dv_nV2cv.d.ts} +1 -1
  117. package/lib/{types-D9DEXMjE.d.ts → types-Lqx5BxQF.d.ts} +8 -1
  118. package/lib/{types-Bd29gh2o.d.ts → types-zNxyEpG2.d.ts} +3 -3
  119. package/lib/types.d.ts +1 -1
  120. package/lib/utils/body.d.ts +1 -1
  121. package/lib/utils/cookie.d.ts +1 -1
  122. package/lib/utils/crypto.d.ts +1 -1
  123. package/lib/utils/html.d.ts +1 -45
  124. package/lib/utils/ipaddr.d.ts +1 -1
  125. package/lib/utils/jwt.d.ts +1 -1
  126. package/lib/utils/types.d.ts +2 -2
  127. package/lib/utils-Cx61GFMC.js +125 -0
  128. package/lib/validator.d.ts +2 -2
  129. package/lib/ws.d.ts +1 -1
  130. package/package.json +53 -1
  131. package/plugins/acryl-inspect/upstream.json +1 -1
  132. package/plugins/acryl-node-server/upstream.json +1 -1
  133. package/plugins/acryl-router/src/core/helper/css/common.ts +337 -0
  134. package/plugins/acryl-router/src/core/helper/css/index.ts +262 -0
  135. package/plugins/acryl-router/src/core/helper/ssg/index.ts +14 -0
  136. package/plugins/acryl-router/src/core/helper/ssg/middleware.ts +83 -0
  137. package/plugins/acryl-router/src/core/helper/ssg/plugins.ts +72 -0
  138. package/plugins/acryl-router/src/core/helper/ssg/ssg.ts +471 -0
  139. package/plugins/acryl-router/src/core/helper/ssg/utils.ts +118 -0
  140. package/plugins/acryl-router/src/core/jsx/base.ts +490 -0
  141. package/plugins/acryl-router/src/core/jsx/children.ts +20 -0
  142. package/plugins/acryl-router/src/core/jsx/components.ts +257 -0
  143. package/plugins/acryl-router/src/core/jsx/constants.ts +6 -0
  144. package/plugins/acryl-router/src/core/jsx/context.ts +266 -0
  145. package/plugins/acryl-router/src/core/jsx/dom/client.ts +89 -0
  146. package/plugins/acryl-router/src/core/jsx/dom/components.ts +39 -0
  147. package/plugins/acryl-router/src/core/jsx/dom/context.ts +52 -0
  148. package/plugins/acryl-router/src/core/jsx/dom/css.ts +263 -0
  149. package/plugins/acryl-router/src/core/jsx/dom/hooks/index.ts +91 -0
  150. package/plugins/acryl-router/src/core/jsx/dom/index.ts +170 -0
  151. package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.ts +438 -0
  152. package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.ts +23 -0
  153. package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.ts +8 -0
  154. package/plugins/acryl-router/src/core/jsx/dom/render.ts +879 -0
  155. package/plugins/acryl-router/src/core/jsx/dom/server.ts +76 -0
  156. package/plugins/acryl-router/src/core/jsx/dom/utils.ts +7 -0
  157. package/plugins/acryl-router/src/core/jsx/hooks/index.ts +437 -0
  158. package/plugins/acryl-router/src/core/jsx/index.ts +115 -0
  159. package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.ts +23 -0
  160. package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.ts +210 -0
  161. package/plugins/acryl-router/src/core/jsx/intrinsic-elements.ts +938 -0
  162. package/plugins/acryl-router/src/core/jsx/jsx-dev-runtime.ts +26 -0
  163. package/plugins/acryl-router/src/core/jsx/jsx-runtime.ts +51 -0
  164. package/plugins/acryl-router/src/core/jsx/streaming.ts +231 -0
  165. package/plugins/acryl-router/src/core/jsx/types.ts +41 -0
  166. package/plugins/acryl-router/src/core/jsx/utils.ts +202 -0
  167. package/plugins/acryl-router/src/core/middleware/cache/index.ts +4 -4
  168. package/plugins/acryl-router/src/core/middleware/jsx-renderer/index.ts +162 -0
  169. package/plugins/acryl-router/src/core/utils/types.ts +6 -0
  170. package/plugins/acryl-router/src/helpers/index.ts +2 -0
  171. package/plugins/acryl-router/src/middleware/index.ts +1 -0
  172. package/plugins/acryl-router/upstream.json +3 -3
  173. package/plugins/acryl-router-http/upstream.json +1 -1
  174. package/plugins/acryl-state/upstream.json +1 -1
  175. package/plugins/desktop/upstream.json +1 -1
  176. package/plugins/desktop-web/upstream.json +1 -1
  177. package/plugins/extensions/resolve.ts +4 -0
  178. package/plugins/save/plugin.json +1 -1
  179. package/shared/AGENTS.core.md +4 -0
  180. package/templates/agent/tsconfig.json +7 -1
  181. package/templates/todo/upstream.json +1 -1
  182. package/plugins/acryl-inspect/tests/report.spec.ts +0 -69
  183. package/plugins/acryl-inspect/tests/service.spec.ts +0 -121
  184. package/plugins/acryl-node-server/tests/adapter/app.ts +0 -76
  185. package/plugins/acryl-node-server/tests/adapter/assets/.static/plain.txt +0 -1
  186. package/plugins/acryl-node-server/tests/adapter/assets/favicon.ico +0 -0
  187. package/plugins/acryl-node-server/tests/adapter/assets/secret.txt +0 -1
  188. package/plugins/acryl-node-server/tests/adapter/assets/static/acryl.html +0 -1
  189. package/plugins/acryl-node-server/tests/adapter/assets/static/admin/secret.txt +0 -1
  190. package/plugins/acryl-node-server/tests/adapter/assets/static/data.json +0 -5
  191. package/plugins/acryl-node-server/tests/adapter/assets/static/extensionless +0 -1
  192. package/plugins/acryl-node-server/tests/adapter/assets/static/foo..bar.txt +0 -0
  193. package/plugins/acryl-node-server/tests/adapter/assets/static/index.html +0 -1
  194. package/plugins/acryl-node-server/tests/adapter/assets/static/plain.txt +0 -1
  195. package/plugins/acryl-node-server/tests/adapter/assets/static-with-context-path/plain.txt +0 -1
  196. package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.bin +0 -1
  197. package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.bin.br +0 -1
  198. package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.txt +0 -1
  199. package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.txt.br +0 -1
  200. package/plugins/acryl-node-server/tests/adapter/assets/static-with-precompressed/hello.txt.zst +0 -1
  201. package/plugins/acryl-node-server/tests/adapter/conninfo.test.ts +0 -34
  202. package/plugins/acryl-node-server/tests/adapter/content-length.test.ts +0 -248
  203. package/plugins/acryl-node-server/tests/adapter/early-hints.test.ts +0 -457
  204. package/plugins/acryl-node-server/tests/adapter/fixtures/keys/agent1-cert.pem +0 -23
  205. package/plugins/acryl-node-server/tests/adapter/fixtures/keys/agent1-key.pem +0 -27
  206. package/plugins/acryl-node-server/tests/adapter/headers.test.ts +0 -252
  207. package/plugins/acryl-node-server/tests/adapter/helpers/request.ts +0 -190
  208. package/plugins/acryl-node-server/tests/adapter/listener.test.ts +0 -727
  209. package/plugins/acryl-node-server/tests/adapter/request-client-disconnect.test.ts +0 -189
  210. package/plugins/acryl-node-server/tests/adapter/request.test.ts +0 -1230
  211. package/plugins/acryl-node-server/tests/adapter/response.test.ts +0 -285
  212. package/plugins/acryl-node-server/tests/adapter/serve-static.test.ts +0 -849
  213. package/plugins/acryl-node-server/tests/adapter/server-socket.test.ts +0 -790
  214. package/plugins/acryl-node-server/tests/adapter/server.test.ts +0 -1312
  215. package/plugins/acryl-node-server/tests/adapter/setup.ts +0 -16
  216. package/plugins/acryl-node-server/tests/adapter/url.test.ts +0 -76
  217. package/plugins/acryl-node-server/tests/adapter/utils/response.test.ts +0 -23
  218. package/plugins/acryl-node-server/tests/adapter/utils/stream.test.ts +0 -75
  219. package/plugins/acryl-node-server/tests/adapter/utils.test.ts +0 -235
  220. package/plugins/acryl-node-server/tests/adapter/websocket.test.ts +0 -260
  221. package/plugins/acryl-node-server/tests/server.spec.ts +0 -141
  222. package/plugins/acryl-router/src/core/app.test.ts +0 -3833
  223. package/plugins/acryl-router/src/core/client/client.test.ts +0 -2313
  224. package/plugins/acryl-router/src/core/client/types.test.ts +0 -149
  225. package/plugins/acryl-router/src/core/client/utils.test.ts +0 -405
  226. package/plugins/acryl-router/src/core/compose.test.ts +0 -751
  227. package/plugins/acryl-router/src/core/context.test.ts +0 -629
  228. package/plugins/acryl-router/src/core/helper/accepts/accepts.test.ts +0 -344
  229. package/plugins/acryl-router/src/core/helper/adapter/index.test.ts +0 -55
  230. package/plugins/acryl-router/src/core/helper/cookie/index.test.ts +0 -510
  231. package/plugins/acryl-router/src/core/helper/dev/index.test.ts +0 -181
  232. package/plugins/acryl-router/src/core/helper/factory/index.test.ts +0 -434
  233. package/plugins/acryl-router/src/core/helper/html/index.test.ts +0 -78
  234. package/plugins/acryl-router/src/core/helper/proxy/index.test.ts +0 -356
  235. package/plugins/acryl-router/src/core/helper/route/index.test.ts +0 -259
  236. package/plugins/acryl-router/src/core/helper/streaming/stream.test.ts +0 -128
  237. package/plugins/acryl-router/src/core/helper/streaming/text.test.ts +0 -34
  238. package/plugins/acryl-router/src/core/helper/testing/index.test.ts +0 -42
  239. package/plugins/acryl-router/src/core/helper/websocket/index.test.ts +0 -124
  240. package/plugins/acryl-router/src/core/http-exception.test.ts +0 -45
  241. package/plugins/acryl-router/src/core/middleware/basic-auth/index.test.ts +0 -434
  242. package/plugins/acryl-router/src/core/middleware/bearer-auth/index.test.ts +0 -1018
  243. package/plugins/acryl-router/src/core/middleware/body-limit/index.test.ts +0 -273
  244. package/plugins/acryl-router/src/core/middleware/cache/index.test.ts +0 -1211
  245. package/plugins/acryl-router/src/core/middleware/combine/index.test.ts +0 -355
  246. package/plugins/acryl-router/src/core/middleware/compress/index.test.ts +0 -535
  247. package/plugins/acryl-router/src/core/middleware/context-storage/index.test.ts +0 -43
  248. package/plugins/acryl-router/src/core/middleware/cors/index.test.ts +0 -532
  249. package/plugins/acryl-router/src/core/middleware/csrf/index.test.ts +0 -534
  250. package/plugins/acryl-router/src/core/middleware/etag/digest.test.ts +0 -21
  251. package/plugins/acryl-router/src/core/middleware/etag/index.test.ts +0 -503
  252. package/plugins/acryl-router/src/core/middleware/ip-restriction/index.test.ts +0 -217
  253. package/plugins/acryl-router/src/core/middleware/jwk/index.test.ts +0 -1135
  254. package/plugins/acryl-router/src/core/middleware/jwk/keys.test.json +0 -48
  255. package/plugins/acryl-router/src/core/middleware/jwt/index.test.ts +0 -802
  256. package/plugins/acryl-router/src/core/middleware/language/index.test.ts +0 -552
  257. package/plugins/acryl-router/src/core/middleware/logger/index.test.ts +0 -204
  258. package/plugins/acryl-router/src/core/middleware/method-not-allowed/index.test.ts +0 -292
  259. package/plugins/acryl-router/src/core/middleware/method-override/index.test.ts +0 -221
  260. package/plugins/acryl-router/src/core/middleware/mount/index.test.ts +0 -334
  261. package/plugins/acryl-router/src/core/middleware/powered-by/index.test.ts +0 -37
  262. package/plugins/acryl-router/src/core/middleware/pretty-json/index.test.ts +0 -218
  263. package/plugins/acryl-router/src/core/middleware/request-id/index.test.ts +0 -168
  264. package/plugins/acryl-router/src/core/middleware/secure-headers/index.test.ts +0 -671
  265. package/plugins/acryl-router/src/core/middleware/serve-static/index.test.ts +0 -450
  266. package/plugins/acryl-router/src/core/middleware/serve-static/path.test.ts +0 -50
  267. package/plugins/acryl-router/src/core/middleware/timeout/index.test.ts +0 -70
  268. package/plugins/acryl-router/src/core/middleware/timing/index.test.ts +0 -310
  269. package/plugins/acryl-router/src/core/middleware/trailing-slash/index.test.ts +0 -381
  270. package/plugins/acryl-router/src/core/preset/quick.test.ts +0 -42
  271. package/plugins/acryl-router/src/core/preset/tiny.test.ts +0 -42
  272. package/plugins/acryl-router/src/core/request.test.ts +0 -751
  273. package/plugins/acryl-router/src/core/router/common.case.test.ts +0 -1132
  274. package/plugins/acryl-router/src/core/router/linear-router/router.test.ts +0 -80
  275. package/plugins/acryl-router/src/core/router/pattern-router/router.test.ts +0 -46
  276. package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.test.ts +0 -154
  277. package/plugins/acryl-router/src/core/router/reg-exp-router/router.test.ts +0 -265
  278. package/plugins/acryl-router/src/core/router/smart-router/router.test.ts +0 -13
  279. package/plugins/acryl-router/src/core/router/trie-router/node.test.ts +0 -896
  280. package/plugins/acryl-router/src/core/router/trie-router/router.test.ts +0 -8
  281. package/plugins/acryl-router/src/core/types.test.ts +0 -4134
  282. package/plugins/acryl-router/src/core/utils/accept.test.ts +0 -299
  283. package/plugins/acryl-router/src/core/utils/basic-auth.test.ts +0 -56
  284. package/plugins/acryl-router/src/core/utils/body.test.ts +0 -496
  285. package/plugins/acryl-router/src/core/utils/buffer.test.ts +0 -147
  286. package/plugins/acryl-router/src/core/utils/color.test.ts +0 -23
  287. package/plugins/acryl-router/src/core/utils/concurrent.test.ts +0 -69
  288. package/plugins/acryl-router/src/core/utils/cookie.test.ts +0 -460
  289. package/plugins/acryl-router/src/core/utils/crypto.test.ts +0 -43
  290. package/plugins/acryl-router/src/core/utils/encode.test.ts +0 -61
  291. package/plugins/acryl-router/src/core/utils/filepath.test.ts +0 -78
  292. package/plugins/acryl-router/src/core/utils/html.test.ts +0 -16
  293. package/plugins/acryl-router/src/core/utils/ipaddr.test.ts +0 -149
  294. package/plugins/acryl-router/src/core/utils/jwt/jwa.test.ts +0 -86
  295. package/plugins/acryl-router/src/core/utils/jwt/jwt.test.ts +0 -1788
  296. package/plugins/acryl-router/src/core/utils/mime.test.ts +0 -64
  297. package/plugins/acryl-router/src/core/utils/stream.test.ts +0 -212
  298. package/plugins/acryl-router/src/core/utils/types.test.ts +0 -295
  299. package/plugins/acryl-router/src/core/utils/url.test.ts +0 -384
  300. package/plugins/acryl-router/src/core/validator/utils.test.ts +0 -82
  301. package/plugins/acryl-router/src/core/validator/validator.test.ts +0 -1488
  302. package/plugins/acryl-router/tests/docs-examples.spec.ts +0 -152
  303. package/plugins/acryl-router/tests/live-install.spec.ts +0 -64
  304. package/plugins/acryl-router/tests/loader.spec.ts +0 -72
  305. package/plugins/acryl-router/tests/loopback-only.spec.ts +0 -80
  306. package/plugins/acryl-router/tests/no-dom/consumer.ts +0 -11
  307. package/plugins/acryl-router/tests/no-dom/tsconfig.json +0 -13
  308. package/plugins/acryl-router/tests/service.spec.ts +0 -426
  309. package/plugins/acryl-router/tests/shadow-state.spec.ts +0 -79
  310. package/plugins/acryl-router-http/tests/adapter.spec.ts +0 -174
  311. package/plugins/acryl-router-http/tests/stream.spec.ts +0 -133
  312. package/plugins/acryl-router-http/tests/surfaces.spec.ts +0 -101
  313. package/plugins/acryl-state/src/react.ts +0 -11
  314. package/plugins/acryl-state/tests/cell.spec.ts +0 -71
  315. package/plugins/acryl-state/tests/react.spec.ts +0 -39
  316. package/plugins/acryl-state/tests/service.spec.ts +0 -132
@@ -0,0 +1,46 @@
1
+ //#region ../../plugins/acryl-router/src/core/utils/html.d.ts
2
+ /**
3
+ * @module
4
+ * HTML utility.
5
+ */
6
+ declare const HtmlEscapedCallbackPhase: {
7
+ readonly Stringify: 1;
8
+ readonly BeforeStream: 2;
9
+ readonly Stream: 3;
10
+ };
11
+ type HtmlEscapedCallbackOpts = {
12
+ buffer?: [string];
13
+ phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase];
14
+ context: Readonly<object>;
15
+ };
16
+ type HtmlEscapedCallback = (opts: HtmlEscapedCallbackOpts) => Promise<string> | undefined;
17
+ type HtmlEscaped = {
18
+ isEscaped: true;
19
+ callbacks?: HtmlEscapedCallback[];
20
+ };
21
+ type HtmlEscapedString = string & HtmlEscaped;
22
+ /**
23
+ * StringBuffer contains string and Promise<string> alternately
24
+ * The length of the array will be odd, the odd numbered element will be a string,
25
+ * and the even numbered element will be a Promise<string>.
26
+ * When concatenating into a single string, it must be processed from the tail.
27
+ * @example
28
+ * [
29
+ * 'framework.',
30
+ * Promise.resolve('ultra fast'),
31
+ * 'a ',
32
+ * Promise.resolve('is '),
33
+ * 'Acryl',
34
+ * ]
35
+ */
36
+ type StringBuffer = (string | Promise<string>)[];
37
+ type StringBufferWithCallbacks = StringBuffer & {
38
+ callbacks: HtmlEscapedCallback[];
39
+ };
40
+ declare const raw: (value: unknown, callbacks?: HtmlEscapedCallback[]) => HtmlEscapedString;
41
+ declare const stringBufferToString: (buffer: StringBuffer, callbacks: HtmlEscapedCallback[] | undefined) => Promise<HtmlEscapedString>;
42
+ declare const escapeToBuffer: (str: string, buffer: StringBuffer) => void;
43
+ declare const resolveCallbackSync: (str: string | HtmlEscapedString) => string;
44
+ declare const resolveCallback: (str: string | HtmlEscapedString | Promise<string>, phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase], preserveCallbacks: boolean, context: object, buffer?: [string]) => Promise<string>;
45
+ //#endregion
46
+ export { StringBuffer as a, raw as c, stringBufferToString as d, HtmlEscapedString as i, resolveCallback as l, HtmlEscapedCallback as n, StringBufferWithCallbacks as o, HtmlEscapedCallbackPhase as r, escapeToBuffer as s, HtmlEscaped as t, resolveCallbackSync as u };
package/lib/html.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { HtmlEscapedString, raw } from "./utils/html.js";
1
+ import { c as raw, i as HtmlEscapedString } from "./html-SllAe0YT.js";
2
2
 
3
3
  //#region ../../plugins/acryl-router/src/core/helper/html/index.d.ts
4
4
  declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => HtmlEscapedString | Promise<HtmlEscapedString>;
@@ -1,7 +1,7 @@
1
1
  import { n as ContentfulStatusCode, s as ServerErrorStatusCode, t as ClientErrorStatusCode } from "./http-status-DaAwGAFL.js";
2
- import { E as UnionToIntersection } from "./types-D9DEXMjE.js";
3
- import { t as Acryl } from "./app-BdrVHBlJ.js";
4
- import { a as ClientResponse, i as ClientRequestOptions, n as Client, s as FilterClientResponseByStatusCode } from "./types-Bd29gh2o.js";
2
+ import { D as UnionToIntersection } from "./types-Lqx5BxQF.js";
3
+ import { t as Acryl } from "./app-D8riatvv.js";
4
+ import { a as ClientResponse, i as ClientRequestOptions, n as Client, s as FilterClientResponseByStatusCode } from "./types-zNxyEpG2.js";
5
5
 
6
6
  //#region ../../plugins/acryl-router/src/core/client/client.d.ts
7
7
  declare const hc: <T extends Acryl<any, any, any>, Prefix extends string = string>(baseUrl: Prefix, options?: ClientRequestOptions) => UnionToIntersection<Client<T, Prefix>>;
@@ -1,6 +1,6 @@
1
- import { I as MiddlewareHandler, X as TypedResponse, t as Context } from "./context-B5Y1lLha.js";
1
+ import { L as MiddlewareHandler, Z as TypedResponse, t as Context } from "./context-DS3fYyG-.js";
2
2
  import { c as StatusCode } from "./http-status-DaAwGAFL.js";
3
- import { r as CloseEvent, t as BinaryType, y as MessageEvent } from "./types-D9DEXMjE.js";
3
+ import { b as MessageEvent, r as CloseEvent, t as BinaryType } from "./types-Lqx5BxQF.js";
4
4
 
5
5
  //#region ../../plugins/acryl-router/src/core/helper/websocket/index.d.ts
6
6
  /**
@@ -0,0 +1,94 @@
1
+ import { C as PropsWithChildren, G as useRef, Q as FallbackRender, Z as ErrorHandler, k as RefObject, t as Context } from "./context-DxFdY_un.js";
2
+ import { a as JSX, o as JSXNode, r as FC, s as Props, t as Child } from "./base-BpQy2Rk7.js";
3
+
4
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/components.d.ts
5
+ declare const ErrorBoundary: FC<PropsWithChildren<{
6
+ fallback?: Child;
7
+ fallbackRender?: FallbackRender;
8
+ onError?: ErrorHandler;
9
+ }>>;
10
+ declare const Suspense: FC<PropsWithChildren<{
11
+ fallback: any;
12
+ }>>;
13
+ //#endregion
14
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/context.d.ts
15
+ declare const createContext: <T>(defaultValue: T) => Context<T>;
16
+ //#endregion
17
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/render.d.ts
18
+ type Container = HTMLElement | DocumentFragment;
19
+ declare const render: (jsxNode: Child, container: Container) => void;
20
+ declare const flushSync: (callback: () => void) => void;
21
+ declare const createPortal: (children: Child, container: HTMLElement, key?: string) => Child;
22
+ //#endregion
23
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/index.d.ts
24
+ declare const createElement: (tag: string | ((props: Props) => JSXNode), props: Props | null, ...children: Child[]) => JSXNode;
25
+ declare const cloneElement: <T extends JSXNode | JSX.Element>(element: T, props: Props, ...children: Child[]) => T;
26
+ declare const memo: <T>(component: FC<T>, propsAreEqual?: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean) => FC<T>;
27
+ declare const _default: {
28
+ version: string;
29
+ useState: {
30
+ <T>(initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void];
31
+ <T = undefined>(): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void];
32
+ };
33
+ useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
34
+ useRef: typeof useRef;
35
+ useCallback: <T extends Function>(callback: T, deps: readonly unknown[]) => T;
36
+ use: <T>(promise: Promise<T>) => T;
37
+ startTransition: (callback: () => void) => void;
38
+ useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
39
+ useDeferredValue: <T>(value: T, initialValue?: T) => T;
40
+ startViewTransition: (callback: () => void) => void;
41
+ useViewTransition: () => [boolean, (callback: () => void) => void];
42
+ useMemo: <T>(factory: () => T, deps: readonly unknown[]) => T;
43
+ useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
44
+ useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
45
+ useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void];
46
+ useId: () => string;
47
+ useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void;
48
+ createRef: <T>() => RefObject<T | null>;
49
+ forwardRef: <T, P = {}>(Component: (props: P, ref?: RefObject<T | null>) => JSX.Element) => ((props: P & {
50
+ ref?: RefObject<T | null>;
51
+ }) => JSX.Element);
52
+ useImperativeHandle: <T>(ref: RefObject<T | null>, createHandle: () => T, deps: readonly unknown[]) => void;
53
+ useSyncExternalStore: <T>(subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
54
+ useFormStatus: () => {
55
+ pending: false;
56
+ data: null;
57
+ method: null;
58
+ action: null;
59
+ } | {
60
+ pending: true;
61
+ data: FormData;
62
+ method: "get" | "post";
63
+ action: string | ((formData: FormData) => void | Promise<void>);
64
+ };
65
+ useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
66
+ useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
67
+ Suspense: FC<PropsWithChildren<{
68
+ fallback: any;
69
+ }>>;
70
+ ErrorBoundary: FC<PropsWithChildren<{
71
+ fallback?: Child;
72
+ fallbackRender?: FallbackRender;
73
+ onError?: ErrorHandler;
74
+ }>>;
75
+ createContext: <T>(defaultValue: T) => Context<T>;
76
+ useContext: <T>(context: Context<T>) => T;
77
+ memo: <T>(component: FC<T>, propsAreEqual?: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean) => FC<T>;
78
+ isValidElement: (element: unknown) => element is JSXNode;
79
+ createElement: (tag: string | ((props: Props) => JSXNode), props: Props | null, ...children: Child[]) => JSXNode;
80
+ cloneElement: <T extends JSXNode | JSX.Element>(element: T, props: Props, ...children: Child[]) => T;
81
+ Children: {
82
+ map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[];
83
+ forEach: (children: Child[], fn: (child: Child, index: number) => void) => void;
84
+ count: (children: Child[]) => number;
85
+ only: (_children: Child[]) => Child;
86
+ toArray: (children: Child) => Child[];
87
+ };
88
+ Fragment: (props: Record<string, unknown>) => JSXNode;
89
+ StrictMode: (props: Record<string, unknown>) => JSXNode;
90
+ flushSync: (callback: () => void) => void;
91
+ createPortal: (children: Child, container: HTMLElement, key?: string) => Child;
92
+ };
93
+ //#endregion
94
+ export { createPortal as a, createContext as c, memo as i, ErrorBoundary as l, cloneElement as n, flushSync as o, createElement as r, render as s, _default as t, Suspense as u };
@@ -1,5 +1,5 @@
1
- import { A as Input, J as Schema, _ as Env, h as BlankSchema, o as AcrylRequest, p as BlankEnv } from "./context-B5Y1lLha.js";
2
- import { t as Acryl } from "./app-BdrVHBlJ.js";
1
+ import { Y as Schema, g as BlankSchema, j as Input, m as BlankEnv, s as AcrylRequest, v as Env } from "./context-DS3fYyG-.js";
2
+ import { t as Acryl } from "./app-D8riatvv.js";
3
3
 
4
4
  //#region ../../plugins/acryl-router/src/deprecated.d.ts
5
5
  /** @deprecated Use `Acryl` (`new Acryl()`); `App` is the 0.4 name and goes away in the next release. */
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Input, B as NotFoundResponse, D as Handler, I as MiddlewareHandler, J as Schema, R as Next, X as TypedResponse, Y as ToSchema, Z as ValidationTargets, _ as Env, a as ExecutionContext, n as ContextRenderer, o as AcrylRequest, r as ContextVariableMap, t as Context, v as ErrorHandler, z as NotFoundHandler } from "./context-B5Y1lLha.js";
2
- import { t as Acryl } from "./app-BdrVHBlJ.js";
3
- import { c as InferRequestType, i as ClientRequestOptions, l as InferResponseType } from "./types-Bd29gh2o.js";
4
- import { n as AppRequest, t as App } from "./index-DtEoak1i.js";
1
+ import { B as NotFoundHandler, L as MiddlewareHandler, O as Handler, Q as ValidationTargets, V as NotFoundResponse, X as ToSchema, Y as Schema, Z as TypedResponse, a as ExecutionContext, j as Input, n as ContextRenderer, r as ContextVariableMap, s as AcrylRequest, t as Context, v as Env, y as ErrorHandler, z as Next } from "./context-DS3fYyG-.js";
2
+ import { t as Acryl } from "./app-D8riatvv.js";
3
+ import { c as InferRequestType, i as ClientRequestOptions, l as InferResponseType } from "./types-zNxyEpG2.js";
4
+ import { n as AppRequest, t as App } from "./index-CTy4N7ng.js";
5
5
  export { Acryl, type AcrylRequest, App, type AppRequest, type ClientRequestOptions, Context, type ContextRenderer, type ContextVariableMap, type Env, type ErrorHandler, type ExecutionContext, type Handler, type InferRequestType, type InferResponseType, type Input, type MiddlewareHandler, type Next, type NotFoundHandler, type NotFoundResponse, type Schema, type ToSchema, type TypedResponse, type ValidationTargets };
@@ -1,5 +1,5 @@
1
- import { I as MiddlewareHandler, t as Context } from "./context-B5Y1lLha.js";
2
- import { r as GetConnInfo, t as AddressType } from "./types-ZM9gIiKh.js";
1
+ import { L as MiddlewareHandler, t as Context } from "./context-DS3fYyG-.js";
2
+ import { r as GetConnInfo, t as AddressType } from "./types-Dv_nV2cv.js";
3
3
 
4
4
  //#region ../../plugins/acryl-router/src/core/middleware/ip-restriction/index.d.ts
5
5
  /**
@@ -0,0 +1,30 @@
1
+ import { t as Child } from "../../base-BpQy2Rk7.js";
2
+
3
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/client.d.ts
4
+ interface Root {
5
+ render(children: Child): void;
6
+ unmount(): void;
7
+ }
8
+ type RootOptions = Record<string, unknown>;
9
+ /**
10
+ * Create a root object for rendering
11
+ * @param element Render target
12
+ * @param options Options for createRoot (not supported yet)
13
+ * @returns Root object has `render` and `unmount` methods
14
+ */
15
+ declare const createRoot: (element: HTMLElement | DocumentFragment, options?: RootOptions) => Root;
16
+ /**
17
+ * Create a root object and hydrate app to the target element.
18
+ * In acryl-router/jsx/dom, hydrate is equivalent to render.
19
+ * @param element Render target
20
+ * @param reactNode A JSXNode to render
21
+ * @param options Options for createRoot (not supported yet)
22
+ * @returns Root object has `render` and `unmount` methods
23
+ */
24
+ declare const hydrateRoot: (element: HTMLElement | DocumentFragment, reactNode: Child, options?: RootOptions) => Root;
25
+ declare const _default: {
26
+ createRoot: (element: HTMLElement | DocumentFragment, options?: RootOptions) => Root;
27
+ hydrateRoot: (element: HTMLElement | DocumentFragment, reactNode: Child, options?: RootOptions) => Root;
28
+ };
29
+ //#endregion
30
+ export { Root, RootOptions, createRoot, _default as default, hydrateRoot };
@@ -0,0 +1,49 @@
1
+ import { D as renderNode, S as buildNode, _ as useState } from "../../hooks-BMw6BAyP.js";
2
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/client.ts
3
+ /**
4
+ * Create a root object for rendering
5
+ * @param element Render target
6
+ * @param options Options for createRoot (not supported yet)
7
+ * @returns Root object has `render` and `unmount` methods
8
+ */
9
+ const createRoot = (element, options = {}) => {
10
+ let setJsxNode = void 0;
11
+ if (Object.keys(options).length > 0) console.warn("createRoot options are not supported yet");
12
+ return {
13
+ render(jsxNode) {
14
+ if (setJsxNode === null) throw new Error("Cannot update an unmounted root");
15
+ if (setJsxNode) setJsxNode(jsxNode);
16
+ else renderNode(buildNode({
17
+ tag: () => {
18
+ const [_jsxNode, _setJsxNode] = useState(jsxNode);
19
+ setJsxNode = _setJsxNode;
20
+ return _jsxNode;
21
+ },
22
+ props: {}
23
+ }), element);
24
+ },
25
+ unmount() {
26
+ setJsxNode?.(null);
27
+ setJsxNode = null;
28
+ }
29
+ };
30
+ };
31
+ /**
32
+ * Create a root object and hydrate app to the target element.
33
+ * In acryl-router/jsx/dom, hydrate is equivalent to render.
34
+ * @param element Render target
35
+ * @param reactNode A JSXNode to render
36
+ * @param options Options for createRoot (not supported yet)
37
+ * @returns Root object has `render` and `unmount` methods
38
+ */
39
+ const hydrateRoot = (element, reactNode, options = {}) => {
40
+ const root = createRoot(element, options);
41
+ root.render(reactNode);
42
+ return root;
43
+ };
44
+ var client_default = {
45
+ createRoot,
46
+ hydrateRoot
47
+ };
48
+ //#endregion
49
+ export { createRoot, client_default as default, hydrateRoot };
@@ -0,0 +1,84 @@
1
+ import { a as rawCssString, i as OnInvalidSlug, n as CssClassName, r as CssVariableType, t as ClassNameSlug } from "../../common-D8Z4JRCw.js";
2
+ import { C as PropsWithChildren } from "../../context-DxFdY_un.js";
3
+ import { r as FC } from "../../base-BpQy2Rk7.js";
4
+
5
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/css.d.ts
6
+ interface CreateCssJsxDomObjectsType {
7
+ (args: {
8
+ id: Readonly<string>;
9
+ }): readonly [{
10
+ toString(this: CssClassName): string;
11
+ }, FC<PropsWithChildren<void>>];
12
+ }
13
+ declare const createCssJsxDomObjects: CreateCssJsxDomObjectsType;
14
+ interface CssType {
15
+ (strings: TemplateStringsArray, ...values: CssVariableType[]): string;
16
+ }
17
+ interface CxType {
18
+ (...args: (string | boolean | null | undefined)[]): string;
19
+ }
20
+ interface KeyframesType {
21
+ (strings: TemplateStringsArray, ...values: CssVariableType[]): CssClassName;
22
+ }
23
+ interface ViewTransitionType {
24
+ (strings: TemplateStringsArray, ...values: CssVariableType[]): string;
25
+ (content: string): string;
26
+ (): string;
27
+ }
28
+ interface DefaultContextType {
29
+ css: CssType;
30
+ cx: CxType;
31
+ keyframes: KeyframesType;
32
+ viewTransition: ViewTransitionType;
33
+ Style: FC<PropsWithChildren<void>>;
34
+ }
35
+ /**
36
+ * @experimental
37
+ * `createCssContext` is an experimental feature.
38
+ * The API might be changed.
39
+ *
40
+ * @param options.id - The ID for the style element
41
+ * @param options.classNameSlug - Optional function to customize generated CSS class names
42
+ * @param options.onInvalidSlug - Optional callback function called when an invalid slug is returned from ClassNameSlug
43
+ */
44
+ declare const createCssContext: ({
45
+ id,
46
+ classNameSlug,
47
+ onInvalidSlug
48
+ }: {
49
+ id: Readonly<string>;
50
+ classNameSlug?: ClassNameSlug;
51
+ onInvalidSlug?: OnInvalidSlug;
52
+ }) => DefaultContextType;
53
+ /**
54
+ * @experimental
55
+ * `css` is an experimental feature.
56
+ * The API might be changed.
57
+ */
58
+ declare const css: CssType;
59
+ /**
60
+ * @experimental
61
+ * `cx` is an experimental feature.
62
+ * The API might be changed.
63
+ */
64
+ declare const cx: CxType;
65
+ /**
66
+ * @experimental
67
+ * `keyframes` is an experimental feature.
68
+ * The API might be changed.
69
+ */
70
+ declare const keyframes: KeyframesType;
71
+ /**
72
+ * @experimental
73
+ * `viewTransition` is an experimental feature.
74
+ * The API might be changed.
75
+ */
76
+ declare const viewTransition: ViewTransitionType;
77
+ /**
78
+ * @experimental
79
+ * `Style` is an experimental feature.
80
+ * The API might be changed.
81
+ */
82
+ declare const Style: FC<PropsWithChildren<void>>;
83
+ //#endregion
84
+ export { Style, createCssContext, createCssJsxDomObjects, css, cx, keyframes, rawCssString, viewTransition };
@@ -0,0 +1,2 @@
1
+ import { _ as rawCssString, a as cx, i as css, n as createCssContext, o as keyframes, r as createCssJsxDomObjects, s as viewTransition, t as Style } from "../../css-D2jb7X8b.js";
2
+ export { Style, createCssContext, createCssJsxDomObjects, css, cx, keyframes, rawCssString, viewTransition };
@@ -0,0 +1,3 @@
1
+ import { a as JSX } from "../../base-BpQy2Rk7.js";
2
+ import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-B22O-Npk.js";
3
+ export { Fragment, type JSX, jsxDEV };
@@ -0,0 +1,2 @@
1
+ import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-D18Y35TI.js";
2
+ export { Fragment, jsxDEV };
@@ -0,0 +1,3 @@
1
+ import { a as JSX } from "../../base-BpQy2Rk7.js";
2
+ import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-B22O-Npk.js";
3
+ export { Fragment, type JSX, jsxDEV as jsx, jsxDEV as jsxs };
@@ -0,0 +1,2 @@
1
+ import { n as jsxDEV, t as Fragment } from "../../jsx-dev-runtime-D18Y35TI.js";
2
+ export { Fragment, jsxDEV as jsx, jsxDEV as jsxs };
@@ -0,0 +1,105 @@
1
+ import { C as PropsWithChildren, G as useRef, Q as FallbackRender, Z as ErrorHandler, k as RefObject, t as Context } from "../../context-DxFdY_un.js";
2
+ import { a as JSX, o as JSXNode, r as FC, s as Props, t as Child } from "../../base-BpQy2Rk7.js";
3
+ import { t as _default$1 } from "../../index-C850MeBA.js";
4
+
5
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/server.d.ts
6
+ interface RenderToStringOptions {
7
+ identifierPrefix?: string;
8
+ }
9
+ /**
10
+ * Render JSX element to string.
11
+ * @param element JSX element to render.
12
+ * @param options Options for rendering.
13
+ * @returns Rendered string.
14
+ */
15
+ declare const renderToString: (element: Child, options?: RenderToStringOptions) => string;
16
+ interface RenderToReadableStreamOptions {
17
+ identifierPrefix?: string;
18
+ namespaceURI?: string;
19
+ nonce?: string;
20
+ bootstrapScriptContent?: string;
21
+ bootstrapScripts?: string[];
22
+ bootstrapModules?: string[];
23
+ progressiveChunkSize?: number;
24
+ signal?: AbortSignal;
25
+ onError?: (error: unknown) => string | void;
26
+ }
27
+ /**
28
+ * Render JSX element to readable stream.
29
+ * @param element JSX element to render.
30
+ * @param options Options for rendering.
31
+ * @returns Rendered readable stream.
32
+ */
33
+ declare const renderToReadableStream: (element: Child, options?: RenderToReadableStreamOptions) => Promise<ReadableStream<Uint8Array>>;
34
+ declare const _default: {
35
+ renderToString: (element: Child, options?: RenderToStringOptions) => string;
36
+ renderToReadableStream: (element: Child, options?: RenderToReadableStreamOptions) => Promise<ReadableStream<Uint8Array>>;
37
+ version: {
38
+ version: string;
39
+ useState: {
40
+ <T>(initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void];
41
+ <T = undefined>(): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void];
42
+ };
43
+ useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
44
+ useRef: typeof useRef;
45
+ useCallback: <T extends Function>(callback: T, deps: readonly unknown[]) => T;
46
+ use: <T>(promise: Promise<T>) => T;
47
+ startTransition: (callback: () => void) => void;
48
+ useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
49
+ useDeferredValue: <T>(value: T, initialValue?: T) => T;
50
+ startViewTransition: (callback: () => void) => void;
51
+ useViewTransition: () => [boolean, (callback: () => void) => void];
52
+ useMemo: <T>(factory: () => T, deps: readonly unknown[]) => T;
53
+ useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
54
+ useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
55
+ useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void];
56
+ useId: () => string;
57
+ useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void;
58
+ createRef: <T>() => RefObject<T | null>;
59
+ forwardRef: <T, P = {}>(Component: (props: P, ref?: RefObject<T | null>) => JSX.Element) => ((props: P & {
60
+ ref?: RefObject<T | null>;
61
+ }) => JSX.Element);
62
+ useImperativeHandle: <T>(ref: RefObject<T | null>, createHandle: () => T, deps: readonly unknown[]) => void;
63
+ useSyncExternalStore: <T>(subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
64
+ useFormStatus: () => {
65
+ pending: false;
66
+ data: null;
67
+ method: null;
68
+ action: null;
69
+ } | {
70
+ pending: true;
71
+ data: FormData;
72
+ method: "get" | "post";
73
+ action: string | ((formData: FormData) => void | Promise<void>);
74
+ };
75
+ useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
76
+ useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
77
+ Suspense: FC<PropsWithChildren<{
78
+ fallback: any;
79
+ }>>;
80
+ ErrorBoundary: FC<PropsWithChildren<{
81
+ fallback?: Child;
82
+ fallbackRender?: FallbackRender;
83
+ onError?: ErrorHandler;
84
+ }>>;
85
+ createContext: <T>(defaultValue: T) => Context<T>;
86
+ useContext: <T>(context: Context<T>) => T;
87
+ memo: <T>(component: FC<T>, propsAreEqual?: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean) => FC<T>;
88
+ isValidElement: (element: unknown) => element is JSXNode;
89
+ createElement: (tag: string | ((props: Props) => JSXNode), props: Props | null, ...children: Child[]) => JSXNode;
90
+ cloneElement: <T extends JSXNode | JSX.Element>(element: T, props: Props, ...children: Child[]) => T;
91
+ Children: {
92
+ map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[];
93
+ forEach: (children: Child[], fn: (child: Child, index: number) => void) => void;
94
+ count: (children: Child[]) => number;
95
+ only: (_children: Child[]) => Child;
96
+ toArray: (children: Child) => Child[];
97
+ };
98
+ Fragment: (props: Record<string, unknown>) => JSXNode;
99
+ StrictMode: (props: Record<string, unknown>) => JSXNode;
100
+ flushSync: (callback: () => void) => void;
101
+ createPortal: (children: Child, container: HTMLElement, key?: string) => Child;
102
+ };
103
+ };
104
+ //#endregion
105
+ export { RenderToReadableStreamOptions, RenderToStringOptions, _default as default, renderToReadableStream, renderToString, _default$1 as version };
@@ -0,0 +1,37 @@
1
+ import { u as renderChildren } from "../../base-ddiVmiE7.js";
2
+ import { i as renderToReadableStream$1 } from "../../components-0o0CBYNv.js";
3
+ import dom_default from "../dom.js";
4
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/server.ts
5
+ const prepareRoot = (element) => typeof element === "string" || Array.isArray(element) ? renderChildren([element]) : element;
6
+ /**
7
+ * Render JSX element to string.
8
+ * @param element JSX element to render.
9
+ * @param options Options for rendering.
10
+ * @returns Rendered string.
11
+ */
12
+ const renderToString = (element, options = {}) => {
13
+ if (Object.keys(options).length > 0) console.warn("options are not supported yet");
14
+ element = prepareRoot(element);
15
+ const res = element instanceof Promise ? element : element?.toString() ?? "";
16
+ if (typeof res !== "string") throw new Error("Async component is not supported in renderToString");
17
+ return res;
18
+ };
19
+ /**
20
+ * Render JSX element to readable stream.
21
+ * @param element JSX element to render.
22
+ * @param options Options for rendering.
23
+ * @returns Rendered readable stream.
24
+ */
25
+ const renderToReadableStream = async (element, options = {}) => {
26
+ if (Object.keys(options).some((key) => key !== "onError")) console.warn("options are not supported yet, except onError");
27
+ element = prepareRoot(element);
28
+ if (!element || typeof element !== "object") element = element?.toString() ?? "";
29
+ return renderToReadableStream$1(element, options.onError);
30
+ };
31
+ var server_default = {
32
+ renderToString,
33
+ renderToReadableStream,
34
+ version: dom_default
35
+ };
36
+ //#endregion
37
+ export { server_default as default, renderToReadableStream, renderToString, dom_default as version };
@@ -0,0 +1,5 @@
1
+ import { A as createRef, B as useImperativeHandle, C as PropsWithChildren, D as TransitionEvent, E as TouchEvent, F as useCallback, G as useRef, H as useLayoutEffect, I as useDebugValue, J as useTransition, K as useState, L as useDeferredValue, M as startTransition, N as startViewTransition, O as WheelEvent, P as use, R as useEffect, S as PointerEvent, T as ReactNode, U as useMemo, V as useInsertionEffect, W as useReducer, Y as useViewTransition, _ as Event, b as KeyboardEvent, c as useActionState, d as Children, f as AnimationEvent, g as DragEvent, h as ComponentClass, j as forwardRef, k as RefObject, l as useFormStatus, m as ClipboardEvent, p as CSSProperties, q as useSyncExternalStore, r as useContext, t as Context, u as useOptimistic, v as FocusEvent, w as ReactElement, x as MouseEvent, y as InputEvent, z as useId } from "../context-DxFdY_un.js";
2
+ import { f as reactAPICompatVersion, l as isValidElement, n as DOMAttributes, o as JSXNode, r as FC, t as Child } from "../base-BpQy2Rk7.js";
3
+ import { a as createPortal, c as createContext, i as memo, l as ErrorBoundary, n as cloneElement, o as flushSync, r as createElement, s as render, t as _default, u as Suspense } from "../index-C850MeBA.js";
4
+ import { t as Fragment } from "../jsx-dev-runtime-B22O-Npk.js";
5
+ export { type AnimationEvent, type CSSProperties, type Child, Children, type ClipboardEvent, type ComponentClass, type Context, type DOMAttributes, type DragEvent, ErrorBoundary, type Event, type FC, type FocusEvent, Fragment, Fragment as StrictMode, type InputEvent, type JSXNode, type KeyboardEvent, type MouseEvent, type PointerEvent, type PropsWithChildren, type ReactElement, type ReactNode, type RefObject, Suspense, type TouchEvent, type TransitionEvent, type WheelEvent, cloneElement, createContext, createElement, createElement as jsx, createPortal, createRef, _default as default, flushSync, forwardRef, isValidElement, memo, render, startTransition, startViewTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useFormStatus, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition, reactAPICompatVersion as version };
package/lib/jsx/dom.js ADDED
@@ -0,0 +1,74 @@
1
+ import { D as createContext, E as useContext, a as isValidElement, f as shallowEqual, g as Children, l as reactAPICompatVersion } from "../base-ddiVmiE7.js";
2
+ import { r as DOM_MEMO } from "../constants-BR9jM9BC.js";
3
+ import { C as createPortal, E as render, _ as useState, a as use, b as useViewTransition, c as useDeferredValue, d as useImperativeHandle, f as useInsertionEffect, g as useRef, h as useReducer, i as startViewTransition, l as useEffect, m as useMemo, n as forwardRef, o as useCallback, p as useLayoutEffect, r as startTransition, s as useDebugValue, t as createRef, u as useId, v as useSyncExternalStore, w as flushSync, y as useTransition } from "../hooks-BMw6BAyP.js";
4
+ import { a as useOptimistic, i as useFormStatus, n as jsxDEV, r as useActionState, t as Fragment } from "../jsx-dev-runtime-D18Y35TI.js";
5
+ import "./dom/jsx-runtime.js";
6
+ import { n as Suspense, t as ErrorBoundary } from "../components-DdI7-ns7.js";
7
+ //#region ../../plugins/acryl-router/src/core/jsx/dom/index.ts
8
+ /**
9
+ * @module
10
+ * This module provides APIs for `acryl-router/jsx/dom`.
11
+ */
12
+ const createElement = (tag, props, ...children) => {
13
+ const jsxProps = props ? { ...props } : {};
14
+ if (children.length) jsxProps.children = children.length === 1 ? children[0] : children;
15
+ let key = void 0;
16
+ if ("key" in jsxProps) {
17
+ key = jsxProps.key;
18
+ delete jsxProps.key;
19
+ }
20
+ return jsxDEV(tag, jsxProps, key);
21
+ };
22
+ const cloneElement = (element, props, ...children) => {
23
+ return jsxDEV(element.tag, {
24
+ ...element.props,
25
+ ...props,
26
+ children: children.length ? children : element.props.children
27
+ }, element.key);
28
+ };
29
+ const memo = (component, propsAreEqual = shallowEqual) => {
30
+ const wrapper = ((props) => component(props));
31
+ wrapper[DOM_MEMO] = propsAreEqual;
32
+ return wrapper;
33
+ };
34
+ var dom_default = {
35
+ version: reactAPICompatVersion,
36
+ useState,
37
+ useEffect,
38
+ useRef,
39
+ useCallback,
40
+ use,
41
+ startTransition,
42
+ useTransition,
43
+ useDeferredValue,
44
+ startViewTransition,
45
+ useViewTransition,
46
+ useMemo,
47
+ useLayoutEffect,
48
+ useInsertionEffect,
49
+ useReducer,
50
+ useId,
51
+ useDebugValue,
52
+ createRef,
53
+ forwardRef,
54
+ useImperativeHandle,
55
+ useSyncExternalStore,
56
+ useFormStatus,
57
+ useActionState,
58
+ useOptimistic,
59
+ Suspense,
60
+ ErrorBoundary,
61
+ createContext,
62
+ useContext,
63
+ memo,
64
+ isValidElement,
65
+ createElement,
66
+ cloneElement,
67
+ Children,
68
+ Fragment,
69
+ StrictMode: Fragment,
70
+ flushSync,
71
+ createPortal
72
+ };
73
+ //#endregion
74
+ export { Children, ErrorBoundary, Fragment, Fragment as StrictMode, Suspense, cloneElement, createContext, createElement, createElement as jsx, createPortal, createRef, dom_default as default, flushSync, forwardRef, isValidElement, memo, render, startTransition, startViewTransition, use, useActionState, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useFormStatus, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition, reactAPICompatVersion as version };
@@ -0,0 +1,6 @@
1
+ import { a as JSX, i as Fragment, o as JSXNode } from "../base-BpQy2Rk7.js";
2
+
3
+ //#region ../../plugins/acryl-router/src/core/jsx/jsx-dev-runtime.d.ts
4
+ declare function jsxDEV(tag: string | Function, props: Record<string, unknown>, key?: string): JSXNode;
5
+ //#endregion
6
+ export { Fragment, type JSX, jsxDEV };
@@ -0,0 +1,14 @@
1
+ import { s as jsxFn, t as Fragment } from "../base-ddiVmiE7.js";
2
+ //#region ../../plugins/acryl-router/src/core/jsx/jsx-dev-runtime.ts
3
+ function jsxDEV(tag, props, key) {
4
+ let node;
5
+ if (!props || !("children" in props)) node = jsxFn(tag, props, []);
6
+ else {
7
+ const children = props.children;
8
+ node = Array.isArray(children) ? jsxFn(tag, props, children) : jsxFn(tag, props, [children]);
9
+ }
10
+ node.key = key;
11
+ return node;
12
+ }
13
+ //#endregion
14
+ export { Fragment, jsxDEV };