ranuts 0.4.1-alpha.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/CLAUDE.md +23 -16
  2. package/README.de.md +62 -0
  3. package/README.es.md +62 -0
  4. package/README.fa.md +62 -0
  5. package/README.ja.md +62 -0
  6. package/README.ko.md +62 -0
  7. package/README.md +35 -92
  8. package/README.pt.md +62 -0
  9. package/README.zh-CN.md +35 -91
  10. package/dist/iife/index.iife.js +4 -0
  11. package/dist/iife/utils.iife.js +4 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +306 -1
  14. package/dist/src/_virtual/_rolldown/runtime/index.js +12 -0
  15. package/dist/src/conversation/engine.d.ts +1 -1
  16. package/dist/src/conversation/engine.js +101 -0
  17. package/dist/src/conversation/index.d.ts +3 -3
  18. package/dist/src/conversation/index.js +4 -1
  19. package/dist/src/stream/accumulator.d.ts +1 -1
  20. package/dist/src/stream/accumulator.js +79 -0
  21. package/dist/src/stream/budget.d.ts +1 -1
  22. package/dist/src/stream/budget.js +45 -0
  23. package/dist/src/stream/index.d.ts +7 -7
  24. package/dist/src/stream/index.js +11 -1
  25. package/dist/src/stream/sse.d.ts +1 -1
  26. package/dist/src/stream/sse.js +61 -0
  27. package/dist/src/sw/index.js +52 -1
  28. package/dist/src/utils/async.js +49 -0
  29. package/dist/src/utils/audioRecorder.js +1121 -0
  30. package/dist/src/utils/behavior.js +9 -0
  31. package/dist/src/utils/binary.js +89 -0
  32. package/dist/src/utils/bom.d.ts +31 -9
  33. package/dist/src/utils/bom.js +165 -0
  34. package/dist/src/utils/bridge.js +310 -0
  35. package/dist/src/utils/canvas.js +103 -0
  36. package/dist/src/utils/chain.js +76 -0
  37. package/dist/src/utils/color.d.ts +0 -1
  38. package/dist/src/utils/color.js +312 -0
  39. package/dist/src/utils/compose.js +22 -0
  40. package/dist/src/utils/console.js +22 -0
  41. package/dist/src/utils/debounce.js +18 -0
  42. package/dist/src/utils/device.d.ts +0 -9
  43. package/dist/src/utils/device.js +31 -0
  44. package/dist/src/utils/diff.js +110 -0
  45. package/dist/src/utils/dom.d.ts +1 -1
  46. package/dist/src/utils/dom.js +89 -0
  47. package/dist/src/utils/error.js +11 -0
  48. package/dist/src/utils/event.d.ts +3 -3
  49. package/dist/src/utils/event.js +39 -0
  50. package/dist/src/utils/file.js +14 -0
  51. package/dist/src/utils/func.js +4 -0
  52. package/dist/src/utils/i18n/index.js +79 -1
  53. package/dist/src/utils/idb.js +177 -0
  54. package/dist/src/utils/img.d.ts +1 -1
  55. package/dist/src/utils/img.js +68 -0
  56. package/dist/src/utils/index.d.ts +80 -80
  57. package/dist/src/utils/index.js +306 -1
  58. package/dist/src/utils/lang.d.ts +23 -6
  59. package/dist/src/utils/lang.js +42 -0
  60. package/dist/src/utils/localePath.js +48 -0
  61. package/dist/src/utils/memoize.d.ts +1 -7
  62. package/dist/src/utils/memoize.js +16 -0
  63. package/dist/src/utils/mimeType.js +841 -0
  64. package/dist/src/utils/monitor.js +84 -0
  65. package/dist/src/utils/network.js +117 -0
  66. package/dist/src/utils/noop.js +5 -0
  67. package/dist/src/utils/number.js +185 -0
  68. package/dist/src/utils/obj.d.ts +2 -2
  69. package/dist/src/utils/obj.js +140 -0
  70. package/dist/src/utils/paginate.js +93 -0
  71. package/dist/src/utils/performance.js +26 -0
  72. package/dist/src/utils/placement.js +37 -0
  73. package/dist/src/utils/prefetch.js +69 -0
  74. package/dist/src/utils/queue.js +46 -0
  75. package/dist/src/utils/report.js +44 -0
  76. package/dist/src/utils/request.js +35 -0
  77. package/dist/src/utils/script.d.ts +1 -1
  78. package/dist/src/utils/script.js +46 -0
  79. package/dist/src/utils/scroll.js +62 -0
  80. package/dist/src/utils/secure.js +36 -0
  81. package/dist/src/utils/segment.js +43 -0
  82. package/dist/src/utils/signal.d.ts +1 -1
  83. package/dist/src/utils/signal.js +13 -0
  84. package/dist/src/utils/speech.js +59 -0
  85. package/dist/src/utils/storage.js +53 -0
  86. package/dist/src/utils/str.d.ts +0 -6
  87. package/dist/src/utils/str.js +395 -0
  88. package/dist/src/utils/style.js +29 -0
  89. package/dist/src/utils/subscribe.js +58 -0
  90. package/dist/src/utils/throttle.js +17 -0
  91. package/dist/src/utils/time.d.ts +0 -21
  92. package/dist/src/utils/time.js +97 -0
  93. package/dist/src/utils/totp/sha/common.d.ts +1 -1
  94. package/dist/src/utils/totp/sha/common.js +201 -0
  95. package/dist/src/utils/totp/sha/converters.d.ts +1 -1
  96. package/dist/src/utils/totp/sha/converters.js +188 -0
  97. package/dist/src/utils/totp/sha/primitives_32.js +55 -0
  98. package/dist/src/utils/totp/sha/primitives_64.js +85 -0
  99. package/dist/src/utils/totp/sha/sha.d.ts +1 -1
  100. package/dist/src/utils/totp/sha/sha.js +30 -0
  101. package/dist/src/utils/totp/sha/sha1.d.ts +2 -2
  102. package/dist/src/utils/totp/sha/sha1.js +51 -0
  103. package/dist/src/utils/totp/sha/sha256.d.ts +2 -2
  104. package/dist/src/utils/totp/sha/sha256.js +56 -0
  105. package/dist/src/utils/totp/sha/sha3.d.ts +3 -3
  106. package/dist/src/utils/totp/sha/sha3.js +253 -0
  107. package/dist/src/utils/totp/sha/sha512.d.ts +3 -3
  108. package/dist/src/utils/totp/sha/sha512.js +177 -0
  109. package/dist/src/utils/totp/totp.js +49 -0
  110. package/dist/src/utils/tween.js +59 -0
  111. package/dist/src/utils/visual/application.d.ts +4 -4
  112. package/dist/src/utils/visual/application.js +42 -0
  113. package/dist/src/utils/visual/enums.js +19 -0
  114. package/dist/src/utils/visual/event/boundary.d.ts +2 -2
  115. package/dist/src/utils/visual/event/boundary.js +93 -0
  116. package/dist/src/utils/visual/event/event.d.ts +1 -1
  117. package/dist/src/utils/visual/event/event.js +34 -0
  118. package/dist/src/utils/visual/event/index.d.ts +4 -4
  119. package/dist/src/utils/visual/event/types.d.ts +2 -2
  120. package/dist/src/utils/visual/event/types.js +23 -0
  121. package/dist/src/utils/visual/graphics/graphics.d.ts +8 -8
  122. package/dist/src/utils/visual/graphics/graphics.js +168 -0
  123. package/dist/src/utils/visual/graphics/graphicsData.d.ts +3 -3
  124. package/dist/src/utils/visual/graphics/graphicsData.js +12 -0
  125. package/dist/src/utils/visual/graphics/graphicsGeometry.d.ts +7 -7
  126. package/dist/src/utils/visual/graphics/graphicsGeometry.js +39 -0
  127. package/dist/src/utils/visual/graphics/index.d.ts +3 -3
  128. package/dist/src/utils/visual/index.d.ts +8 -8
  129. package/dist/src/utils/visual/index.js +20 -1
  130. package/dist/src/utils/visual/math/bezier.js +15 -0
  131. package/dist/src/utils/visual/math/enums.js +6 -0
  132. package/dist/src/utils/visual/math/index.d.ts +4 -4
  133. package/dist/src/utils/visual/math/matrix.d.ts +1 -1
  134. package/dist/src/utils/visual/math/matrix.js +59 -0
  135. package/dist/src/utils/visual/math/transform.d.ts +2 -2
  136. package/dist/src/utils/visual/math/transform.js +50 -0
  137. package/dist/src/utils/visual/render/batchRenderer.d.ts +4 -4
  138. package/dist/src/utils/visual/render/batchRenderer.js +59 -0
  139. package/dist/src/utils/visual/render/canvasRenderer.d.ts +3 -3
  140. package/dist/src/utils/visual/render/canvasRenderer.js +17 -0
  141. package/dist/src/utils/visual/render/filter.d.ts +1 -1
  142. package/dist/src/utils/visual/render/filter.js +92 -0
  143. package/dist/src/utils/visual/render/index.d.ts +2 -2
  144. package/dist/src/utils/visual/render/index.js +20 -0
  145. package/dist/src/utils/visual/render/render.d.ts +4 -4
  146. package/dist/src/utils/visual/render/render.js +19 -0
  147. package/dist/src/utils/visual/render/renderTarget.js +28 -0
  148. package/dist/src/utils/visual/render/utils/batch/index.d.ts +4 -4
  149. package/dist/src/utils/visual/render/utils/batch/index.js +88 -0
  150. package/dist/src/utils/visual/render/utils/earcut.js +328 -0
  151. package/dist/src/utils/visual/render/utils/float.js +65 -0
  152. package/dist/src/utils/visual/render/utils/index.js +50 -0
  153. package/dist/src/utils/visual/render/utils/verticy.d.ts +2 -2
  154. package/dist/src/utils/visual/render/utils/verticy.js +162 -0
  155. package/dist/src/utils/visual/render/utils/webgl/initShader.d.ts +1 -1
  156. package/dist/src/utils/visual/render/utils/webgl/initShader.js +31 -0
  157. package/dist/src/utils/visual/render/utils/webgl/shaders.js +22 -0
  158. package/dist/src/utils/visual/render/utils/webgpu/shaders.js +32 -0
  159. package/dist/src/utils/visual/render/webGPURenderer.d.ts +2 -2
  160. package/dist/src/utils/visual/render/webGPURenderer.js +185 -0
  161. package/dist/src/utils/visual/render/webGlRenderer.d.ts +2 -2
  162. package/dist/src/utils/visual/render/webGlRenderer.js +88 -0
  163. package/dist/src/utils/visual/shape/circle.d.ts +3 -3
  164. package/dist/src/utils/visual/shape/circle.js +17 -0
  165. package/dist/src/utils/visual/shape/ellipse.d.ts +3 -3
  166. package/dist/src/utils/visual/shape/ellipse.js +18 -0
  167. package/dist/src/utils/visual/shape/index.d.ts +6 -6
  168. package/dist/src/utils/visual/shape/polygon.d.ts +3 -3
  169. package/dist/src/utils/visual/shape/polygon.js +29 -0
  170. package/dist/src/utils/visual/shape/rectangle.d.ts +3 -3
  171. package/dist/src/utils/visual/shape/rectangle.js +18 -0
  172. package/dist/src/utils/visual/shape/roundedRectangle.d.ts +3 -3
  173. package/dist/src/utils/visual/shape/roundedRectangle.js +32 -0
  174. package/dist/src/utils/visual/shape/shape.d.ts +2 -2
  175. package/dist/src/utils/visual/shape/shape.js +5 -0
  176. package/dist/src/utils/visual/style/fill.js +18 -0
  177. package/dist/src/utils/visual/style/index.d.ts +2 -2
  178. package/dist/src/utils/visual/style/line.d.ts +2 -2
  179. package/dist/src/utils/visual/style/line.js +18 -0
  180. package/dist/src/utils/visual/types.d.ts +1 -1
  181. package/dist/src/utils/visual/vertex/container.d.ts +5 -5
  182. package/dist/src/utils/visual/vertex/container.js +54 -0
  183. package/dist/src/utils/visual/vertex/point.js +37 -0
  184. package/dist/src/utils/visual/vertex/vertex.d.ts +7 -7
  185. package/dist/src/utils/visual/vertex/vertex.js +76 -0
  186. package/dist/src/utils/worker.js +89 -0
  187. package/dist/src/utils/zip.js +161 -0
  188. package/dist/src/vnode/h.d.ts +1 -1
  189. package/dist/src/vnode/h.js +22 -0
  190. package/dist/src/vnode/hooks.d.ts +1 -1
  191. package/dist/src/vnode/htmlDomApi.js +94 -0
  192. package/dist/src/vnode/index.d.ts +16 -16
  193. package/dist/src/vnode/index.js +28 -1
  194. package/dist/src/vnode/init.d.ts +1 -1
  195. package/dist/src/vnode/init.js +104 -0
  196. package/dist/src/vnode/is.d.ts +1 -1
  197. package/dist/src/vnode/is.js +20 -0
  198. package/dist/src/vnode/modules/attributes.d.ts +1 -1
  199. package/dist/src/vnode/modules/attributes.js +21 -0
  200. package/dist/src/vnode/modules/class.d.ts +1 -1
  201. package/dist/src/vnode/modules/class.js +18 -0
  202. package/dist/src/vnode/modules/index.js +15 -0
  203. package/dist/src/vnode/modules/listeners.d.ts +1 -1
  204. package/dist/src/vnode/modules/listeners.js +36 -0
  205. package/dist/src/vnode/modules/props.d.ts +1 -1
  206. package/dist/src/vnode/modules/props.js +17 -0
  207. package/dist/src/vnode/modules/style.d.ts +1 -1
  208. package/dist/src/vnode/modules/style.js +52 -0
  209. package/dist/src/vnode/vnode.d.ts +6 -6
  210. package/dist/src/vnode/vnode.js +13 -0
  211. package/dist/third-party/jschardet/LICENSE.txt +504 -0
  212. package/dist/third-party/jschardet/NOTICE.txt +33 -0
  213. package/docs/API.md +8 -64
  214. package/package.json +12 -16
  215. package/dist/bin/generate-api-docs.d.ts +0 -1
  216. package/dist/build/build.es.d.ts +0 -2
  217. package/dist/build/build.umd.d.ts +0 -2
  218. package/dist/build/build.umd.node.d.ts +0 -2
  219. package/dist/build/build.umd.utils.d.ts +0 -2
  220. package/dist/chain-CTywmh_H.js +0 -1
  221. package/dist/color-BTvZUuf-.js +0 -1
  222. package/dist/enums-BAgbyGdH.js +0 -1
  223. package/dist/examples/clone-deep-example.d.ts +0 -1
  224. package/dist/examples/is-equal-example.d.ts +0 -1
  225. package/dist/i18n-DW21b_DJ.js +0 -1
  226. package/dist/plugins/vite-plugins-banner.d.ts +0 -2
  227. package/dist/rolldown-runtime-I3TIJKkN.js +0 -1
  228. package/dist/src/node/appendFile.d.ts +0 -7
  229. package/dist/src/node/body.d.ts +0 -9
  230. package/dist/src/node/color.d.ts +0 -7
  231. package/dist/src/node/command.d.ts +0 -8
  232. package/dist/src/node/ctx2req.d.ts +0 -5
  233. package/dist/src/node/fileInfo.d.ts +0 -7
  234. package/dist/src/node/fs.d.ts +0 -7
  235. package/dist/src/node/get.d.ts +0 -10
  236. package/dist/src/node/getIPAdress.d.ts +0 -1
  237. package/dist/src/node/index.d.ts +0 -25
  238. package/dist/src/node/index.js +0 -1
  239. package/dist/src/node/isColorSupported.d.ts +0 -2
  240. package/dist/src/node/paresUrl.d.ts +0 -19
  241. package/dist/src/node/readDir.d.ts +0 -6
  242. package/dist/src/node/readFile.d.ts +0 -9
  243. package/dist/src/node/router.d.ts +0 -42
  244. package/dist/src/node/send.d.ts +0 -7
  245. package/dist/src/node/server.d.ts +0 -18
  246. package/dist/src/node/startTask.d.ts +0 -2
  247. package/dist/src/node/stream.d.ts +0 -15
  248. package/dist/src/node/taskEnd.d.ts +0 -2
  249. package/dist/src/node/traverse.d.ts +0 -17
  250. package/dist/src/node/watchFile.d.ts +0 -8
  251. package/dist/src/node/writeFile.d.ts +0 -8
  252. package/dist/src/node/ws.d.ts +0 -8
  253. package/dist/src/utils/visual/render/utils/batch/index.test.d.ts +0 -1
  254. package/dist/src/utils/visual/render/utils/index.test.d.ts +0 -1
  255. package/dist/test/binary.test.d.ts +0 -1
  256. package/dist/test/bridge.test.d.ts +0 -1
  257. package/dist/test/budget.test.d.ts +0 -1
  258. package/dist/test/canvas.test.d.ts +0 -1
  259. package/dist/test/clearBr.test.d.ts +0 -1
  260. package/dist/test/cloneDeep.test.d.ts +0 -1
  261. package/dist/test/color.test.d.ts +0 -1
  262. package/dist/test/command.test.d.ts +0 -1
  263. package/dist/test/conversation.test.d.ts +0 -1
  264. package/dist/test/diff.test.d.ts +0 -1
  265. package/dist/test/encodeUrl.test.d.ts +0 -1
  266. package/dist/test/escapeHtml.test.d.ts +0 -1
  267. package/dist/test/formatBytes.test.d.ts +0 -1
  268. package/dist/test/is-equal.test.d.ts +0 -1
  269. package/dist/test/mimeType.test.d.ts +0 -1
  270. package/dist/test/package-exports.test.d.ts +0 -1
  271. package/dist/test/scroll.test.d.ts +0 -1
  272. package/dist/test/server.test.d.ts +0 -1
  273. package/dist/test/status.test.d.ts +0 -1
  274. package/dist/test/stream.test.d.ts +0 -1
  275. package/dist/test/sw.test.d.ts +0 -1
  276. package/dist/test/totp.test.d.ts +0 -1
  277. package/dist/test/tween.test.d.ts +0 -1
  278. package/dist/test/utils/async.test.d.ts +0 -1
  279. package/dist/test/utils/autosize.test.d.ts +0 -1
  280. package/dist/test/utils/color-grade.test.d.ts +0 -1
  281. package/dist/test/utils/compose.test.d.ts +0 -1
  282. package/dist/test/utils/event.test.d.ts +0 -1
  283. package/dist/test/utils/file-read.test.d.ts +0 -1
  284. package/dist/test/utils/format.test.d.ts +0 -1
  285. package/dist/test/utils/i18n.test.d.ts +0 -1
  286. package/dist/test/utils/idb-collection.test.d.ts +0 -1
  287. package/dist/test/utils/idb.test.d.ts +0 -1
  288. package/dist/test/utils/instrumentation.test.d.ts +0 -1
  289. package/dist/test/utils/interp.test.d.ts +0 -1
  290. package/dist/test/utils/lang.test.d.ts +0 -1
  291. package/dist/test/utils/locale-path.test.d.ts +0 -1
  292. package/dist/test/utils/media-query.test.d.ts +0 -1
  293. package/dist/test/utils/mergeObj.test.d.ts +0 -1
  294. package/dist/test/utils/number-parse.test.d.ts +0 -1
  295. package/dist/test/utils/paginate.test.d.ts +0 -1
  296. package/dist/test/utils/placement.test.d.ts +0 -1
  297. package/dist/test/utils/prefetch.test.d.ts +0 -1
  298. package/dist/test/utils/query-storage.test.d.ts +0 -1
  299. package/dist/test/utils/queue.test.d.ts +0 -1
  300. package/dist/test/utils/report-config.test.d.ts +0 -1
  301. package/dist/test/utils/report-image.test.d.ts +0 -1
  302. package/dist/test/utils/secure.test.d.ts +0 -1
  303. package/dist/test/utils/segment.test.d.ts +0 -1
  304. package/dist/test/utils/signal-once.test.d.ts +0 -1
  305. package/dist/test/utils/single-flight.test.d.ts +0 -1
  306. package/dist/test/utils/speech.test.d.ts +0 -1
  307. package/dist/test/utils/text-boundary.test.d.ts +0 -1
  308. package/dist/test/utils/time.test.d.ts +0 -1
  309. package/dist/test/utils/timing.test.d.ts +0 -1
  310. package/dist/test/utils/truncate.test.d.ts +0 -1
  311. package/dist/test/utils/visual/filter.test.d.ts +0 -1
  312. package/dist/test/utils/worker-client.test.d.ts +0 -1
  313. package/dist/test/utils/worker-serve.test.d.ts +0 -1
  314. package/dist/test/utils/zip.test.d.ts +0 -1
  315. package/dist/test/visual/math.test.d.ts +0 -1
  316. package/dist/test/visual-application.test.d.ts +0 -1
  317. package/dist/test/visual-batch.test.d.ts +0 -1
  318. package/dist/test/visual-math.test.d.ts +0 -1
  319. package/dist/test/vnode/index.d.ts +0 -1
  320. package/dist/test/vnode/server.d.ts +0 -2
  321. package/dist/test/vnode/vnode.d.ts +0 -1
  322. package/dist/test/vnode.test.d.ts +0 -1
  323. package/dist/test/websocket.test.d.ts +0 -1
  324. package/dist/test/writeFile.test.d.ts +0 -1
  325. package/dist/umd/index.umd.cjs +0 -1
  326. package/dist/umd/node/node.umd.cjs +0 -1
  327. package/dist/umd/utils/utils.umd.cjs +0 -1
  328. package/dist/utils-B4FnyUzW.js +0 -1
  329. package/dist/vite.config.d.ts +0 -8
  330. package/dist/vitest.config.d.ts +0 -2
@@ -0,0 +1,94 @@
1
+ function c(t, n) {
2
+ return document.createElement(t, n);
3
+ }
4
+ function l(t, n, e) {
5
+ return document.createElementNS(t, n, e);
6
+ }
7
+ function m() {
8
+ return u(document.createDocumentFragment());
9
+ }
10
+ function a(t) {
11
+ return document.createTextNode(t);
12
+ }
13
+ function f(t) {
14
+ return document.createComment(t);
15
+ }
16
+ function s(t, n, e) {
17
+ if (r(t)) {
18
+ let i = t;
19
+ for (; i && r(i); ) i = u(i).parent;
20
+ t = i ?? t;
21
+ }
22
+ r(n) && (n = u(n, t)), e && r(e) && (e = u(e).firstChildNode), t.insertBefore(n, e);
23
+ }
24
+ function C(t, n) {
25
+ t.removeChild(n);
26
+ }
27
+ function h(t, n) {
28
+ r(n) && (n = u(n, t)), t.appendChild(n);
29
+ }
30
+ function o(t) {
31
+ if (r(t)) {
32
+ for (; t && r(t); ) t = u(t).parent;
33
+ return t ?? null;
34
+ }
35
+ return t.parentNode;
36
+ }
37
+ function p(t) {
38
+ if (r(t)) {
39
+ const n = u(t), e = o(n);
40
+ if (e && n.lastChildNode) {
41
+ const i = Array.from(e.childNodes);
42
+ return i[i.indexOf(n.lastChildNode) + 1] ?? null;
43
+ }
44
+ return null;
45
+ }
46
+ return t.nextSibling;
47
+ }
48
+ function x(t) {
49
+ return t.tagName;
50
+ }
51
+ function d(t, n) {
52
+ t.textContent = n;
53
+ }
54
+ function g(t) {
55
+ return t.textContent;
56
+ }
57
+ function T(t) {
58
+ return t.nodeType === 1;
59
+ }
60
+ function y(t) {
61
+ return t.nodeType === 3;
62
+ }
63
+ function E(t) {
64
+ return t.nodeType === 8;
65
+ }
66
+ function r(t) {
67
+ return t.nodeType === 11;
68
+ }
69
+ function u(t, n) {
70
+ const e = t;
71
+ return e.parent ??= n ?? null, e.firstChildNode ??= t.firstChild, e.lastChildNode ??= t.lastChild, e;
72
+ }
73
+ var D = {
74
+ createElement: c,
75
+ createElementNS: l,
76
+ createTextNode: a,
77
+ createDocumentFragment: m,
78
+ createComment: f,
79
+ insertBefore: s,
80
+ removeChild: C,
81
+ appendChild: h,
82
+ parentNode: o,
83
+ nextSibling: p,
84
+ tagName: x,
85
+ setTextContent: d,
86
+ getTextContent: g,
87
+ isElement: T,
88
+ isText: y,
89
+ isComment: E,
90
+ isDocumentFragment: r
91
+ };
92
+ export {
93
+ D as htmlDomApi
94
+ };
@@ -1,18 +1,18 @@
1
- import { init } from './init';
2
- import { addNS, h } from './h';
3
- import { vnode } from './vnode';
4
- import { Chain, create } from '@/utils/chain';
5
- import { htmlDomApi } from './htmlDomApi';
6
- import { modules } from './modules';
7
- import { attributesModule } from './modules/attributes';
8
- import { classModule } from './modules/class';
9
- import { eventListenersModule } from './modules/listeners';
10
- import { propsModule } from './modules/props';
11
- import { styleModule } from './modules/style';
12
- import * as is from './is';
13
- import type { ArrayOrElement, Key, VNode, VNodeChildElement, VNodeChildren, VNodeData, VNodes } from './vnode';
14
- import type { Hooks } from './hooks';
15
- import type { DOMAPI, Fragment } from './htmlDomApi';
16
- import type { ModuleHook, Modules } from './modules';
1
+ import { init } from "./init.js";
2
+ import { addNS, h } from "./h.js";
3
+ import { vnode } from "./vnode.js";
4
+ import { Chain, create } from "../utils/chain.js";
5
+ import { htmlDomApi } from "./htmlDomApi.js";
6
+ import { modules } from "./modules/index.js";
7
+ import { attributesModule } from "./modules/attributes.js";
8
+ import { classModule } from "./modules/class.js";
9
+ import { eventListenersModule } from "./modules/listeners.js";
10
+ import { propsModule } from "./modules/props.js";
11
+ import { styleModule } from "./modules/style.js";
12
+ import * as is from "./is.js";
13
+ import type { ArrayOrElement, Key, VNode, VNodeChildElement, VNodeChildren, VNodeData, VNodes } from "./vnode.js";
14
+ import type { Hooks } from "./hooks.js";
15
+ import type { DOMAPI, Fragment } from "./htmlDomApi.js";
16
+ import type { ModuleHook, Modules } from "./modules/index.js";
17
17
  export { init, h, addNS, vnode, Chain, create, htmlDomApi, modules, attributesModule, classModule, eventListenersModule, propsModule, styleModule, is, };
18
18
  export type { VNode, VNodeData, VNodes, VNodeChildren, VNodeChildElement, ArrayOrElement, Key, Hooks, DOMAPI, Fragment, Modules, ModuleHook, };
@@ -1 +1,28 @@
1
- import{n as e}from"../../rolldown-runtime-I3TIJKkN.js";import{n as t,t as n}from"../../chain-CTywmh_H.js";function o(e,t,n,o,r){return{sel:e,data:t,children:n,text:o,elm:r,key:void 0===t?void 0:t.key}}function r(e){if(i(e)){for(;e&&i(e);)e=l(e).parent;return e??null}return e.parentNode}function i(e){return 11===e.nodeType}function l(e,t){const n=e;return n.parent??=t??null,n.firstChildNode??=e.firstChild,n.lastChildNode??=e.lastChild,n}var s={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,n){return document.createElementNS(e,t,n)},createTextNode:function(e){return document.createTextNode(e)},createDocumentFragment:function(){return l(document.createDocumentFragment())},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){if(i(e)){let t=e;for(;t&&i(t);)t=l(t).parent;e=t??e}i(t)&&(t=l(t,e)),n&&i(n)&&(n=l(n).firstChildNode),e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){i(t)&&(t=l(t,e)),e.appendChild(t)},parentNode:r,nextSibling:function(e){if(i(e)){const t=l(e),n=r(t);if(n&&t.lastChildNode){const e=Array.from(n.childNodes);return e[e.indexOf(t.lastChildNode)+1]??null}return null}return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType},isDocumentFragment:i},a=/* @__PURE__ */e({array:()=>c,isStr:()=>d,isVnode:()=>f,primitive:()=>u}),c=Array.isArray,d=e=>"string"==typeof e;function u(e){return"string"==typeof e||"number"==typeof e}function f(e){return!!e?.sel}function m(e,t){let n;const o=t.elm;let r=e.data&&e.data.attrs,i=t.data&&t.data.attrs;if((r||i)&&r!==i){for(n in r=r||{},i=i||{},i){const e=i[n];r[n]!==e&&(!0===e?o.setAttribute(n,""):!1===e?o.removeAttribute(n):120!==n.charCodeAt(0)?o.setAttribute(n,e):58===n.charCodeAt(3)?o.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,e):58===n.charCodeAt(5)?o.setAttributeNS("http://www.w3.org/1999/xlink",n,e):o.setAttribute(n,`${e}`))}for(n in r)n in i||o.removeAttribute(n)}}var p={create:m,update:m};function v(e,t){let n,o;const r=t.elm;let i=e.data&&e.data.class,l=t.data&&t.data.class;if((i||l)&&i!==l){for(o in i=i||{},l=l||{},i)i[o]&&!Object.prototype.hasOwnProperty.call(l,o)&&r.classList.remove(o);for(o in l)n=l[o],n!==i[o]&&r.classList[n?"add":"remove"](o)}}var h={create:v,update:v};function y(e,t,n){if((e=>"function"==typeof e)(e))e.call(t,n,t);else if("object"==typeof e)for(let o=0;o<e.length;o++)y(e[o],t,n)}function g(e,t){const n=e.type,o=t.data&&t.data.on;o&&o[n]&&y(o[n],t,e)}function C(e,t){const n=e?.data?.on,o=e?.listener,r=e.elm,i=t?.data?.on,l=t&&t.elm;let s;if(n!==i){if(n&&o)if(i)for(s in n)i[s]||r.removeEventListener(s,o,!1);else for(s in n)r.removeEventListener(s,o,!1);if(i){const o=t.listener=e.listener||function e(t){g(t,e.vnode)};if(n)for(s in i)n[s]||l.addEventListener(s,o,!1);else for(s in i)l.addEventListener(s,o,!1)}}}var x={create:C,update:C,destroy:C};function N(e,t){let n,o,r;const i=t.elm;let l=e.data?e.data.props:void 0,s=t.data?t.data.props:void 0;if((l||s)&&l!==s)for(n in l=l||{},s=s||{},s)o=s[n],r=l[n],r===o||"value"===n&&i[n]===o||(i[n]=o)}var b={create:N,update:N},w=!1;function A(e,t){let n,o;const r=t.elm;let i=e.data.style,l=t.data.style;if((i||l)&&i!==l){for(o in i=i||{},l=l||{},i)l[o]||("-"===o[0]&&"-"===o[1]?r.style.removeProperty(o):r.style[o]="");for(o in l)n=l[o],n!==i[o]&&("-"===o[0]&&"-"===o[1]?r.style.setProperty(o,n):r.style[o]=n)}}var E={pre:function(){w=!1},create:A,update:A,destroy:function(e){let t,n;const o=e.elm,r=e.data.style;if(r&&(t=r.destroy))for(n in t)o.style[n]=t[n]},remove:function(e,t){const n=e.data.style;if(!n||!n.remove)return void t();let o;w||(w=!0);const r=e.elm;let i=0;const l=n.remove;let s=0;const a=[];for(o in l)a.push(o),r.style[o]=l[o];const c=getComputedStyle(r)["transition-property"].split(", ");for(;i<c.length;++i)-1!==a.indexOf(c[i])&&s++;r.addEventListener("transitionend",function(e){e.target===r&&--s,0===s&&t()})}},T={attributesModule:p,classModule:h,eventListenersModule:x,propsModule:b,styleModule:E};function L(e,t){return e.key===t.key&&e.sel===t.sel}function S(e,t,n){const o={};for(let r=t;r<=n;++r){const t=e[r]?.key;void 0!==t&&(o[t]=r)}return o}var k=o("",{},[],void 0,void 0);function B(){const e=s,t={create:[],update:[],destroy:[]};for(const o of Object.keys(t)){t[o]=[];for(const e of Object.keys(T)){const n=T[e][o];void 0!==n&&t[o].push(n)}}function n(t){const n=t.id?"#"+t.id:"",r=t.className?"."+t.className.split(" ").join("."):"";return o(e.tagName(t).toLowerCase()+n+r,{},[],void 0,t)}function r(e){return void 0===e}function i(e){return void 0!==e}function l(n){let o;const i=n.children,s=n.sel;if("!"===s)r(n.text)&&(n.text=""),n.elm=e.createComment(`${n.text}`);else if(void 0!==s){const r=s.indexOf("#"),a=s.indexOf(".",r),d=r>0?r:s.length,f=a>0?a:s.length,m=-1!==r||-1!==a?s.slice(0,Math.min(d,f)):s,p=n.elm=e.createElement(m);for(d<f&&p.setAttribute("id",s.slice(d+1,f)),a>0&&p.setAttribute("class",s.slice(f+1).replace(/\./g," ")),o=0;o<t.create.length;++o)t.create[o](k,n);if(c(i))for(o=0;o<i.length;++o){const t=i[o];null!=t&&e.appendChild(p,l(t))}else u(n.text)&&e.appendChild(p,e.createTextNode(`${n.text}`))}else n.elm=e.createTextNode(`${n.text}`);return n.elm}function a(e){if(void 0!==e.data){for(let n=0;n<t.destroy.length;++n)t.destroy[n](e);if(void 0!==e.children)for(let t=0;t<e.children.length;++t){const n=e.children[t];null!=n&&"string"!=typeof n&&"number"!=typeof n&&a(n)}}}function d(t){return function(){const n=e.parentNode(t);e.removeChild(n,t)}}function f(t,n,o,r){for(;o<=r;++o){let r;const l=n[o];null!=l&&(i(l.sel)?(a(l),r=d(l.elm),r()):e.removeChild(t,l.elm))}}function m(t,n,o){let i,s,a,c,d=0,u=0,m=n.length-1,v=o.length-1,h=n[0],y=n[m],g=o[0],C=o[v];for(;d<=m&&u<=v;)null==h?h=n[++d]:null==y?y=n[--m]:null==g?g=o[++u]:null==C?C=o[--v]:L(h,g)?(p(h,g),h=n[++d],g=o[++u]):L(y,C)?(p(y,C),y=n[--m],C=o[--v]):L(h,C)?(p(h,C),e.insertBefore(t,h.elm,e.nextSibling(y.elm)),h=n[++d],C=o[--v]):L(y,g)?(p(y,g),e.insertBefore(t,y.elm,h.elm),y=n[--m],g=o[++u]):(void 0===i&&(i=S(n,d,m)),s=i[g.key],r(s)?e.insertBefore(t,l(g),h.elm):(a=n[s],a.sel!==g.sel?e.insertBefore(t,l(g),h.elm):(p(a,g),n[s]=void 0,e.insertBefore(t,a.elm,h.elm))),g=o[++u]);(d<=m||u<=v)&&(d>m?(c=null==o[v+1]?null:o[v+1].elm,function(t,n,o,r,i){for(;r<=i;++r){const i=o[r];null!=i&&e.insertBefore(t,l(i),n)}}(t,c,o,u,v)):f(t,n,d,m))}function p(e,n){if(void 0!==n.data)for(let r=0;r<t.update.length;++r)t.update[r](e,n);const o=n.elm=e.elm,l=e.children,s=n.children;e!==n&&r(n.text)&&i(l)&&i(s)&&l!==s&&m(o,l,s)}return function(t,o){let r,i;return function(e){return void 0!==e.sel}(t)||(t=n(t)),L(t,o)?p(t,o):(r=t.elm,i=e.parentNode(r),l(o),null!=i&&(e.insertBefore(i,o.elm,e.nextSibling(r)),f(i,[t],0,0))),o}}function O(e,t,n){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==t)for(let o=0;o<t.length;++o){const e=t[o];if("string"==typeof e||"number"==typeof e)continue;const n=e.data;void 0!==n&&O(n,e.children,e.sel)}}function j(e,t,n){let r,i,l,s={};if(void 0!==n?(null!=t&&(s=t),c(n)?r=n:u(n)?i=n:n&&n.sel&&(r=[n])):void 0!==t&&null!=t&&(c(t)?r=t:u(t)?i=t:f(t)?r=[t]:s=t),void 0!==r)for(l=0;l<r.length;++l){const e=r[l];u(e)&&(r[l]=o(void 0,void 0,void 0,e,void 0))}return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||O(s,r,e),o(e,s,r,i,void 0)}export{n as Chain,O as addNS,p as attributesModule,h as classModule,t as create,x as eventListenersModule,j as h,s as htmlDomApi,B as init,a as is,T as modules,b as propsModule,E as styleModule,o as vnode};
1
+ import { Chain as r, create as m } from "../utils/chain.js";
2
+ import { vnode as i } from "./vnode.js";
3
+ import { htmlDomApi as p } from "./htmlDomApi.js";
4
+ import { is_exports as s } from "./is.js";
5
+ import { attributesModule as l } from "./modules/attributes.js";
6
+ import { classModule as a } from "./modules/class.js";
7
+ import { eventListenersModule as M } from "./modules/listeners.js";
8
+ import { propsModule as c } from "./modules/props.js";
9
+ import { styleModule as x } from "./modules/style.js";
10
+ import { modules as y } from "./modules/index.js";
11
+ import { init as C } from "./init.js";
12
+ import { addNS as L, h as N } from "./h.js";
13
+ export {
14
+ r as Chain,
15
+ L as addNS,
16
+ l as attributesModule,
17
+ a as classModule,
18
+ m as create,
19
+ M as eventListenersModule,
20
+ N as h,
21
+ p as htmlDomApi,
22
+ C as init,
23
+ s as is,
24
+ y as modules,
25
+ c as propsModule,
26
+ x as styleModule,
27
+ i as vnode
28
+ };
@@ -1,2 +1,2 @@
1
- import type { VNode } from './vnode';
1
+ import type { VNode } from "./vnode.js";
2
2
  export declare function init(): (oldVnode: VNode | Element, vnode: VNode) => VNode;
@@ -0,0 +1,104 @@
1
+ import { vnode as T } from "./vnode.js";
2
+ import { htmlDomApi as $ } from "./htmlDomApi.js";
3
+ import { array as K, primitive as M } from "./is.js";
4
+ import { modules as I } from "./modules/index.js";
5
+ function g(r, c) {
6
+ return r.key === c.key && r.sel === c.sel;
7
+ }
8
+ function H(r) {
9
+ return r.sel !== void 0;
10
+ }
11
+ function L(r, c, k) {
12
+ const x = {};
13
+ for (let d = c; d <= k; ++d) {
14
+ const p = r[d]?.key;
15
+ p !== void 0 && (x[p] = d);
16
+ }
17
+ return x;
18
+ }
19
+ var R = T("", {}, [], void 0, void 0);
20
+ function G() {
21
+ const r = $, c = {
22
+ create: [],
23
+ update: [],
24
+ destroy: []
25
+ };
26
+ for (const e of Object.keys(c)) {
27
+ c[e] = [];
28
+ for (const t of Object.keys(I)) {
29
+ const i = I[t][e];
30
+ i !== void 0 && c[e].push(i);
31
+ }
32
+ }
33
+ function k(e) {
34
+ const t = e.id ? "#" + e.id : "", i = e.className ? "." + e.className.split(" ").join(".") : "";
35
+ return T(r.tagName(e).toLowerCase() + t + i, {}, [], void 0, e);
36
+ }
37
+ function x(e) {
38
+ return e === void 0;
39
+ }
40
+ function d(e) {
41
+ return e !== void 0;
42
+ }
43
+ function p(e) {
44
+ let t;
45
+ const i = e.children, l = e.sel;
46
+ if (l === "!")
47
+ x(e.text) && (e.text = ""), e.elm = r.createComment(`${e.text}`);
48
+ else if (l !== void 0) {
49
+ const f = l.indexOf("#"), n = l.indexOf(".", f), u = f > 0 ? f : l.length, o = n > 0 ? n : l.length, m = f !== -1 || n !== -1 ? l.slice(0, Math.min(u, o)) : l, s = e.elm = r.createElement(m);
50
+ for (u < o && s.setAttribute("id", l.slice(u + 1, o)), n > 0 && s.setAttribute("class", l.slice(o + 1).replace(/\./g, " ")), t = 0; t < c.create.length; ++t) c.create[t](R, e);
51
+ if (K(i)) for (t = 0; t < i.length; ++t) {
52
+ const a = i[t];
53
+ a != null && r.appendChild(s, p(a));
54
+ }
55
+ else M(e.text) && r.appendChild(s, r.createTextNode(`${e.text}`));
56
+ } else e.elm = r.createTextNode(`${e.text}`);
57
+ return e.elm;
58
+ }
59
+ function j(e, t, i, l, f) {
60
+ for (; l <= f; ++l) {
61
+ const n = i[l];
62
+ n != null && r.insertBefore(e, p(n), t);
63
+ }
64
+ }
65
+ function B(e) {
66
+ if (e.data !== void 0) {
67
+ for (let t = 0; t < c.destroy.length; ++t) c.destroy[t](e);
68
+ if (e.children !== void 0) for (let t = 0; t < e.children.length; ++t) {
69
+ const i = e.children[t];
70
+ i != null && typeof i != "string" && typeof i != "number" && B(i);
71
+ }
72
+ }
73
+ }
74
+ function A(e) {
75
+ return function() {
76
+ const i = r.parentNode(e);
77
+ r.removeChild(i, e);
78
+ };
79
+ }
80
+ function O(e, t, i, l) {
81
+ for (; i <= l; ++i) {
82
+ let f;
83
+ const n = t[i];
84
+ n != null && (d(n.sel) ? (B(n), f = A(n.elm), f()) : r.removeChild(e, n.elm));
85
+ }
86
+ }
87
+ function D(e, t, i) {
88
+ let l = 0, f = 0, n = t.length - 1, u = i.length - 1, o = t[0], m = t[n], s = i[0], a = i[u], N, h, b, S;
89
+ for (; l <= n && f <= u; ) o == null ? o = t[++l] : m == null ? m = t[--n] : s == null ? s = i[++f] : a == null ? a = i[--u] : g(o, s) ? (y(o, s), o = t[++l], s = i[++f]) : g(m, a) ? (y(m, a), m = t[--n], a = i[--u]) : g(o, a) ? (y(o, a), r.insertBefore(e, o.elm, r.nextSibling(m.elm)), o = t[++l], a = i[--u]) : g(m, s) ? (y(m, s), r.insertBefore(e, m.elm, o.elm), m = t[--n], s = i[++f]) : (N === void 0 && (N = L(t, l, n)), h = N[s.key], x(h) ? r.insertBefore(e, p(s), o.elm) : (b = t[h], b.sel !== s.sel ? r.insertBefore(e, p(s), o.elm) : (y(b, s), t[h] = void 0, r.insertBefore(e, b.elm, o.elm))), s = i[++f]);
90
+ (l <= n || f <= u) && (l > n ? (S = i[u + 1] == null ? null : i[u + 1].elm, j(e, S, i, f, u)) : O(e, t, l, n));
91
+ }
92
+ function y(e, t) {
93
+ if (t.data !== void 0) for (let n = 0; n < c.update.length; ++n) c.update[n](e, t);
94
+ const i = t.elm = e.elm, l = e.children, f = t.children;
95
+ e !== t && x(t.text) && d(l) && d(f) && l !== f && D(i, l, f);
96
+ }
97
+ return function(t, i) {
98
+ let l, f;
99
+ return H(t) || (t = k(t)), g(t, i) ? y(t, i) : (l = t.elm, f = r.parentNode(l), p(i), f != null && (r.insertBefore(f, i.elm, r.nextSibling(l)), O(f, [t], 0, 0))), i;
100
+ };
101
+ }
102
+ export {
103
+ G as init
104
+ };
@@ -2,7 +2,7 @@
2
2
  * @description: Type guards — array / string / primitive / VNode
3
3
  * @module
4
4
  */
5
- import type { VNode } from './vnode';
5
+ import type { VNode } from "./vnode.js";
6
6
  export declare const array: (arg: any) => arg is any[];
7
7
  export declare const isStr: (str: unknown) => str is string;
8
8
  export declare function primitive(s: unknown): s is string | number;
@@ -0,0 +1,20 @@
1
+ import { __exportAll as t } from "../_virtual/_rolldown/runtime/index.js";
2
+ var p = /* @__PURE__ */ t({
3
+ array: () => i,
4
+ isStr: () => e,
5
+ isVnode: () => o,
6
+ primitive: () => n
7
+ }), i = Array.isArray, e = (r) => typeof r == "string";
8
+ function n(r) {
9
+ return typeof r == "string" || typeof r == "number";
10
+ }
11
+ function o(r) {
12
+ return !!r?.sel;
13
+ }
14
+ export {
15
+ i as array,
16
+ e as isStr,
17
+ o as isVnode,
18
+ p as is_exports,
19
+ n as primitive
20
+ };
@@ -1,4 +1,4 @@
1
- import type { VNode } from '../vnode';
1
+ import type { VNode } from "../vnode.js";
2
2
  export type Attrs = Record<string, string | number | boolean>;
3
3
  declare function updateAttrs(oldVnode: VNode, vnode: VNode): void;
4
4
  export declare const attributesModule: {
@@ -0,0 +1,21 @@
1
+ var o = "http://www.w3.org/1999/xlink", A = "http://www.w3.org/XML/1998/namespace", u = 58, c = 120;
2
+ function f(l, s) {
3
+ let t;
4
+ const e = s.elm;
5
+ let i = l.data && l.data.attrs, r = s.data && s.data.attrs;
6
+ if (!(!i && !r) && i !== r) {
7
+ i = i || {}, r = r || {};
8
+ for (t in r) {
9
+ const a = r[t];
10
+ i[t] !== a && (a === !0 ? e.setAttribute(t, "") : a === !1 ? e.removeAttribute(t) : t.charCodeAt(0) !== c ? e.setAttribute(t, a) : t.charCodeAt(3) === u ? e.setAttributeNS(A, t, a) : t.charCodeAt(5) === u ? e.setAttributeNS(o, t, a) : e.setAttribute(t, `${a}`));
11
+ }
12
+ for (t in i) t in r || e.removeAttribute(t);
13
+ }
14
+ }
15
+ var n = {
16
+ create: f,
17
+ update: f
18
+ };
19
+ export {
20
+ n as attributesModule
21
+ };
@@ -1,4 +1,4 @@
1
- import type { VNode } from '../vnode';
1
+ import type { VNode } from "../vnode.js";
2
2
  export type Classes = Record<string, boolean>;
3
3
  declare function updateClass(oldVnode: VNode, vnode: VNode): void;
4
4
  export declare const classModule: {
@@ -0,0 +1,18 @@
1
+ function i(r, s) {
2
+ let l, a;
3
+ const c = s.elm;
4
+ let t = r.data && r.data.class, e = s.data && s.data.class;
5
+ if (!(!t && !e) && t !== e) {
6
+ t = t || {}, e = e || {};
7
+ for (a in t) t[a] && !Object.prototype.hasOwnProperty.call(e, a) && c.classList.remove(a);
8
+ for (a in e)
9
+ l = e[a], l !== t[a] && c.classList[l ? "add" : "remove"](a);
10
+ }
11
+ }
12
+ var o = {
13
+ create: i,
14
+ update: i
15
+ };
16
+ export {
17
+ o as classModule
18
+ };
@@ -0,0 +1,15 @@
1
+ import { attributesModule as o } from "./attributes.js";
2
+ import { classModule as r } from "./class.js";
3
+ import { eventListenersModule as e } from "./listeners.js";
4
+ import { propsModule as t } from "./props.js";
5
+ import { styleModule as m } from "./style.js";
6
+ var d = {
7
+ attributesModule: o,
8
+ classModule: r,
9
+ eventListenersModule: e,
10
+ propsModule: t,
11
+ styleModule: m
12
+ };
13
+ export {
14
+ d as modules
15
+ };
@@ -1,4 +1,4 @@
1
- import type { VNode } from '../vnode';
1
+ import type { VNode } from "../vnode.js";
2
2
  type Listener<T> = (this: VNode, ev: T, vnode: VNode) => void;
3
3
  export type On = {
4
4
  [N in keyof HTMLElementEventMap]?: Listener<HTMLElementEventMap[N]> | Array<Listener<HTMLElementEventMap[N]>>;
@@ -0,0 +1,36 @@
1
+ var u = (e) => typeof e == "function";
2
+ function c(e, t, n) {
3
+ if (u(e)) e.call(t, n, t);
4
+ else if (typeof e == "object") for (let i = 0; i < e.length; i++) c(e[i], t, n);
5
+ }
6
+ function m(e, t) {
7
+ const n = e.type, i = t.data && t.data.on;
8
+ i && i[n] && c(i[n], t, e);
9
+ }
10
+ function L() {
11
+ return function e(t) {
12
+ m(t, e.vnode);
13
+ };
14
+ }
15
+ function f(e, t) {
16
+ const n = e?.data?.on, i = e?.listener, o = e.elm, r = t?.data?.on, a = t && t.elm;
17
+ let s;
18
+ if (n !== r) {
19
+ if (n && i)
20
+ if (r) for (s in n) r[s] || o.removeEventListener(s, i, !1);
21
+ else for (s in n) o.removeEventListener(s, i, !1);
22
+ if (r) {
23
+ const l = t.listener = e.listener || L();
24
+ if (n) for (s in r) n[s] || a.addEventListener(s, l, !1);
25
+ else for (s in r) a.addEventListener(s, l, !1);
26
+ }
27
+ }
28
+ }
29
+ var E = {
30
+ create: f,
31
+ update: f,
32
+ destroy: f
33
+ };
34
+ export {
35
+ E as eventListenersModule
36
+ };
@@ -1,4 +1,4 @@
1
- import type { VNode } from '../vnode';
1
+ import type { VNode } from "../vnode.js";
2
2
  export type Props = Record<string, any>;
3
3
  declare function updateProps(oldVnode: VNode, vnode: VNode): void;
4
4
  export declare const propsModule: {
@@ -0,0 +1,17 @@
1
+ function d(o, p) {
2
+ let t, a, l;
3
+ const u = p.elm;
4
+ let e = o.data ? o.data.props : void 0, r = p.data ? p.data.props : void 0;
5
+ if (!(!e && !r) && e !== r) {
6
+ e = e || {}, r = r || {};
7
+ for (t in r)
8
+ a = r[t], l = e[t], l !== a && (t !== "value" || u[t] !== a) && (u[t] = a);
9
+ }
10
+ }
11
+ var i = {
12
+ create: d,
13
+ update: d
14
+ };
15
+ export {
16
+ i as propsModule
17
+ };
@@ -1,4 +1,4 @@
1
- import type { VNode } from '../vnode';
1
+ import type { VNode } from "../vnode.js";
2
2
  export type VNodeStyle = Record<string, any>;
3
3
  declare function updateStyle(oldVnode: VNode, vnode: VNode): void;
4
4
  declare function forceReflow(): void;
@@ -0,0 +1,52 @@
1
+ var f = !1;
2
+ function p(n, s) {
3
+ let t, e;
4
+ const l = s.elm;
5
+ let r = n.data.style, o = s.data.style;
6
+ if (!(!r && !o) && r !== o) {
7
+ r = r || {}, o = o || {};
8
+ for (e in r) o[e] || (e[0] === "-" && e[1] === "-" ? l.style.removeProperty(e) : l.style[e] = "");
9
+ for (e in o)
10
+ t = o[e], t !== r[e] && (e[0] === "-" && e[1] === "-" ? l.style.setProperty(e, t) : l.style[e] = t);
11
+ }
12
+ }
13
+ function u() {
14
+ f = !1;
15
+ }
16
+ function m(n) {
17
+ let s, t;
18
+ const e = n.elm, l = n.data.style;
19
+ if (!(!l || !(s = l.destroy)))
20
+ for (t in s) e.style[t] = s[t];
21
+ }
22
+ function d(n, s) {
23
+ const t = n.data.style;
24
+ if (!t || !t.remove) {
25
+ s();
26
+ return;
27
+ }
28
+ f || (f = !0);
29
+ let e;
30
+ const l = n.elm;
31
+ let r = 0;
32
+ const o = t.remove;
33
+ let i = 0;
34
+ const y = [];
35
+ for (e in o)
36
+ y.push(e), l.style[e] = o[e];
37
+ const a = getComputedStyle(l)["transition-property"].split(", ");
38
+ for (; r < a.length; ++r) y.indexOf(a[r]) !== -1 && i++;
39
+ l.addEventListener("transitionend", function(c) {
40
+ c.target === l && --i, i === 0 && s();
41
+ });
42
+ }
43
+ var v = {
44
+ pre: u,
45
+ create: p,
46
+ update: p,
47
+ destroy: m,
48
+ remove: d
49
+ };
50
+ export {
51
+ v as styleModule
52
+ };
@@ -1,9 +1,9 @@
1
- import type { On } from './modules/listeners';
2
- import type { Attrs } from './modules/attributes';
3
- import type { Classes } from './modules/class';
4
- import type { Props } from './modules/props';
5
- import type { VNodeStyle } from './modules/style';
6
- import type { Hooks } from './hooks';
1
+ import type { On } from "./modules/listeners.js";
2
+ import type { Attrs } from "./modules/attributes.js";
3
+ import type { Classes } from "./modules/class.js";
4
+ import type { Props } from "./modules/props.js";
5
+ import type { VNodeStyle } from "./modules/style.js";
6
+ import type { Hooks } from "./hooks.js";
7
7
  export type VNodes = VNode[];
8
8
  export type VNodeChildElement = VNode | string | number;
9
9
  export type ArrayOrElement<T> = T | T[];
@@ -0,0 +1,13 @@
1
+ function v(o, e, n, i, r) {
2
+ return {
3
+ sel: o,
4
+ data: e,
5
+ children: n,
6
+ text: i,
7
+ elm: r,
8
+ key: e === void 0 ? void 0 : e.key
9
+ };
10
+ }
11
+ export {
12
+ v as vnode
13
+ };