@manyducks.co/dolla 2.0.0-alpha.56 → 2.0.0-alpha.58

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 (40) hide show
  1. package/README.md +5 -2
  2. package/bun.lock +207 -0
  3. package/dist/core/app.d.ts +17 -0
  4. package/dist/core/context.d.ts +71 -19
  5. package/dist/core/index.d.ts +2 -2
  6. package/dist/core/logger.d.ts +2 -2
  7. package/dist/core/markup.d.ts +14 -13
  8. package/dist/core/mount.d.ts +2 -2
  9. package/dist/core/nodes/dom.d.ts +3 -2
  10. package/dist/core/nodes/dynamic.d.ts +2 -1
  11. package/dist/core/nodes/html.d.ts +7 -5
  12. package/dist/core/nodes/portal.d.ts +4 -3
  13. package/dist/core/nodes/repeat.d.ts +5 -3
  14. package/dist/core/nodes/view.d.ts +6 -8
  15. package/dist/core/signals.d.ts +3 -23
  16. package/dist/core/views/default-crash-view.d.ts +12 -1
  17. package/dist/i18n.js +1 -1
  18. package/dist/index.js +85 -87
  19. package/dist/index.js.map +1 -1
  20. package/dist/jsx-dev-runtime.d.ts +2 -1
  21. package/dist/jsx-dev-runtime.js +4 -11
  22. package/dist/jsx-dev-runtime.js.map +1 -1
  23. package/dist/jsx-runtime.d.ts +3 -2
  24. package/dist/jsx-runtime.js +7 -13
  25. package/dist/jsx-runtime.js.map +1 -1
  26. package/dist/logger-C2AJnlaL.js +516 -0
  27. package/dist/logger-C2AJnlaL.js.map +1 -0
  28. package/dist/markup-BJx8Fwl2.js +1019 -0
  29. package/dist/markup-BJx8Fwl2.js.map +1 -0
  30. package/dist/{router-D43DV_bv.js → router-vfGbWwl9.js} +77 -76
  31. package/dist/router-vfGbWwl9.js.map +1 -0
  32. package/dist/router.js +1 -1
  33. package/dist/types.d.ts +35 -9
  34. package/docs/markup.md +4 -4
  35. package/package.json +2 -2
  36. package/dist/logger-sSxIw5od.js +0 -626
  37. package/dist/logger-sSxIw5od.js.map +0 -1
  38. package/dist/markup-DS7yYBga.js +0 -844
  39. package/dist/markup-DS7yYBga.js.map +0 -1
  40. package/dist/router-D43DV_bv.js.map +0 -1
package/README.md CHANGED
@@ -101,7 +101,10 @@ function MessageStore(options, ctx) {
101
101
  }
102
102
 
103
103
  function App(props, ctx) {
104
- const { message, setMessage } = ctx.provide(MessageStore);
104
+ // Provide a store for this and all child views.
105
+ ctx.addStore(MessageStore);
106
+
107
+ const { message, setMessage } = ctx.getStore(MessageStore);
105
108
  // Provides a MessageStore on this context and any child contexts.
106
109
  // When a store is provided its value is returned right away.
107
110
 
@@ -123,7 +126,7 @@ function App(props, ctx) {
123
126
  }
124
127
 
125
128
  function MessageView(props, ctx) {
126
- const { message } = ctx.get(MessageStore);
129
+ const { message } = ctx.getStore(MessageStore);
127
130
  // Gets the nearest instance of MessageStore. In this case the one provided at the parent.
128
131
 
129
132
  return <span>{message}</span>;
package/bun.lock ADDED
@@ -0,0 +1,207 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "workspaces": {
4
+ "": {
5
+ "name": "@manyducks.co/dolla",
6
+ "dependencies": {
7
+ "alien-signals": "^2.0.5",
8
+ },
9
+ "devDependencies": {
10
+ "@types/node": "^22.12.0",
11
+ "csstype": "^3.1.3",
12
+ "prettier": "^3.4.2",
13
+ "typescript": "^5.7.3",
14
+ "vite": "^6.0.11",
15
+ "vite-plugin-externalize-deps": "^0.9.0",
16
+ "vitest": "^3.0.5",
17
+ },
18
+ },
19
+ },
20
+ "packages": {
21
+ "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.24.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA=="],
22
+
23
+ "@esbuild/android-arm": ["@esbuild/android-arm@0.24.2", "", { "os": "android", "cpu": "arm" }, "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q=="],
24
+
25
+ "@esbuild/android-arm64": ["@esbuild/android-arm64@0.24.2", "", { "os": "android", "cpu": "arm64" }, "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg=="],
26
+
27
+ "@esbuild/android-x64": ["@esbuild/android-x64@0.24.2", "", { "os": "android", "cpu": "x64" }, "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw=="],
28
+
29
+ "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.24.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA=="],
30
+
31
+ "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.24.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA=="],
32
+
33
+ "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.24.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg=="],
34
+
35
+ "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.24.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q=="],
36
+
37
+ "@esbuild/linux-arm": ["@esbuild/linux-arm@0.24.2", "", { "os": "linux", "cpu": "arm" }, "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA=="],
38
+
39
+ "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.24.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg=="],
40
+
41
+ "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.24.2", "", { "os": "linux", "cpu": "ia32" }, "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw=="],
42
+
43
+ "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.24.2", "", { "os": "linux", "cpu": "none" }, "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ=="],
44
+
45
+ "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.24.2", "", { "os": "linux", "cpu": "none" }, "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw=="],
46
+
47
+ "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.24.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw=="],
48
+
49
+ "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.24.2", "", { "os": "linux", "cpu": "none" }, "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q=="],
50
+
51
+ "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.24.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw=="],
52
+
53
+ "@esbuild/linux-x64": ["@esbuild/linux-x64@0.24.2", "", { "os": "linux", "cpu": "x64" }, "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q=="],
54
+
55
+ "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.24.2", "", { "os": "none", "cpu": "arm64" }, "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw=="],
56
+
57
+ "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.24.2", "", { "os": "none", "cpu": "x64" }, "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw=="],
58
+
59
+ "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.24.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A=="],
60
+
61
+ "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.24.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA=="],
62
+
63
+ "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.24.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig=="],
64
+
65
+ "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.24.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ=="],
66
+
67
+ "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.24.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA=="],
68
+
69
+ "@esbuild/win32-x64": ["@esbuild/win32-x64@0.24.2", "", { "os": "win32", "cpu": "x64" }, "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg=="],
70
+
71
+ "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
72
+
73
+ "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.34.8", "", { "os": "android", "cpu": "arm" }, "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw=="],
74
+
75
+ "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.34.8", "", { "os": "android", "cpu": "arm64" }, "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q=="],
76
+
77
+ "@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.34.8", "", { "os": "darwin", "cpu": "arm64" }, "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q=="],
78
+
79
+ "@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.34.8", "", { "os": "darwin", "cpu": "x64" }, "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw=="],
80
+
81
+ "@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.34.8", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA=="],
82
+
83
+ "@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.34.8", "", { "os": "freebsd", "cpu": "x64" }, "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q=="],
84
+
85
+ "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.34.8", "", { "os": "linux", "cpu": "arm" }, "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g=="],
86
+
87
+ "@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.34.8", "", { "os": "linux", "cpu": "arm" }, "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA=="],
88
+
89
+ "@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.34.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A=="],
90
+
91
+ "@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.34.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q=="],
92
+
93
+ "@rollup/rollup-linux-loongarch64-gnu": ["@rollup/rollup-linux-loongarch64-gnu@4.34.8", "", { "os": "linux", "cpu": "none" }, "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ=="],
94
+
95
+ "@rollup/rollup-linux-powerpc64le-gnu": ["@rollup/rollup-linux-powerpc64le-gnu@4.34.8", "", { "os": "linux", "cpu": "ppc64" }, "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw=="],
96
+
97
+ "@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.34.8", "", { "os": "linux", "cpu": "none" }, "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw=="],
98
+
99
+ "@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.34.8", "", { "os": "linux", "cpu": "s390x" }, "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA=="],
100
+
101
+ "@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.34.8", "", { "os": "linux", "cpu": "x64" }, "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA=="],
102
+
103
+ "@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.34.8", "", { "os": "linux", "cpu": "x64" }, "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ=="],
104
+
105
+ "@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.34.8", "", { "os": "win32", "cpu": "arm64" }, "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ=="],
106
+
107
+ "@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.34.8", "", { "os": "win32", "cpu": "ia32" }, "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w=="],
108
+
109
+ "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.34.8", "", { "os": "win32", "cpu": "x64" }, "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g=="],
110
+
111
+ "@types/estree": ["@types/estree@1.0.6", "", {}, "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw=="],
112
+
113
+ "@types/node": ["@types/node@22.12.0", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA=="],
114
+
115
+ "@vitest/expect": ["@vitest/expect@3.0.5", "", { "dependencies": { "@vitest/spy": "3.0.5", "@vitest/utils": "3.0.5", "chai": "^5.1.2", "tinyrainbow": "^2.0.0" } }, "sha512-nNIOqupgZ4v5jWuQx2DSlHLEs7Q4Oh/7AYwNyE+k0UQzG7tSmjPXShUikn1mpNGzYEN2jJbTvLejwShMitovBA=="],
116
+
117
+ "@vitest/mocker": ["@vitest/mocker@3.0.5", "", { "dependencies": { "@vitest/spy": "3.0.5", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^5.0.0 || ^6.0.0" }, "optionalPeers": ["msw"] }, "sha512-CLPNBFBIE7x6aEGbIjaQAX03ZZlBMaWwAjBdMkIf/cAn6xzLTiM3zYqO/WAbieEjsAZir6tO71mzeHZoodThvw=="],
118
+
119
+ "@vitest/pretty-format": ["@vitest/pretty-format@3.0.5", "", { "dependencies": { "tinyrainbow": "^2.0.0" } }, "sha512-CjUtdmpOcm4RVtB+up8r2vVDLR16Mgm/bYdkGFe3Yj/scRfCpbSi2W/BDSDcFK7ohw8UXvjMbOp9H4fByd/cOA=="],
120
+
121
+ "@vitest/runner": ["@vitest/runner@3.0.5", "", { "dependencies": { "@vitest/utils": "3.0.5", "pathe": "^2.0.2" } }, "sha512-BAiZFityFexZQi2yN4OX3OkJC6scwRo8EhRB0Z5HIGGgd2q+Nq29LgHU/+ovCtd0fOfXj5ZI6pwdlUmC5bpi8A=="],
122
+
123
+ "@vitest/snapshot": ["@vitest/snapshot@3.0.5", "", { "dependencies": { "@vitest/pretty-format": "3.0.5", "magic-string": "^0.30.17", "pathe": "^2.0.2" } }, "sha512-GJPZYcd7v8QNUJ7vRvLDmRwl+a1fGg4T/54lZXe+UOGy47F9yUfE18hRCtXL5aHN/AONu29NGzIXSVFh9K0feA=="],
124
+
125
+ "@vitest/spy": ["@vitest/spy@3.0.5", "", { "dependencies": { "tinyspy": "^3.0.2" } }, "sha512-5fOzHj0WbUNqPK6blI/8VzZdkBlQLnT25knX0r4dbZI9qoZDf3qAdjoMmDcLG5A83W6oUUFJgUd0EYBc2P5xqg=="],
126
+
127
+ "@vitest/utils": ["@vitest/utils@3.0.5", "", { "dependencies": { "@vitest/pretty-format": "3.0.5", "loupe": "^3.1.2", "tinyrainbow": "^2.0.0" } }, "sha512-N9AX0NUoUtVwKwy21JtwzaqR5L5R5A99GAbrHfCCXK1lp593i/3AZAXhSP43wRQuxYsflrdzEfXZFo1reR1Nkg=="],
128
+
129
+ "alien-signals": ["alien-signals@2.0.5", "", {}, "sha512-PdJB6+06nUNAClInE3Dweq7/2xVAYM64vvvS1IHVHSJmgeOtEdrAGyp7Z2oJtYm0B342/Exd2NT0uMJaThcjLQ=="],
130
+
131
+ "assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="],
132
+
133
+ "cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="],
134
+
135
+ "chai": ["chai@5.1.2", "", { "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" } }, "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw=="],
136
+
137
+ "check-error": ["check-error@2.1.1", "", {}, "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw=="],
138
+
139
+ "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
140
+
141
+ "debug": ["debug@4.4.0", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="],
142
+
143
+ "deep-eql": ["deep-eql@5.0.2", "", {}, "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q=="],
144
+
145
+ "es-module-lexer": ["es-module-lexer@1.6.0", "", {}, "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ=="],
146
+
147
+ "esbuild": ["esbuild@0.24.2", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.24.2", "@esbuild/android-arm": "0.24.2", "@esbuild/android-arm64": "0.24.2", "@esbuild/android-x64": "0.24.2", "@esbuild/darwin-arm64": "0.24.2", "@esbuild/darwin-x64": "0.24.2", "@esbuild/freebsd-arm64": "0.24.2", "@esbuild/freebsd-x64": "0.24.2", "@esbuild/linux-arm": "0.24.2", "@esbuild/linux-arm64": "0.24.2", "@esbuild/linux-ia32": "0.24.2", "@esbuild/linux-loong64": "0.24.2", "@esbuild/linux-mips64el": "0.24.2", "@esbuild/linux-ppc64": "0.24.2", "@esbuild/linux-riscv64": "0.24.2", "@esbuild/linux-s390x": "0.24.2", "@esbuild/linux-x64": "0.24.2", "@esbuild/netbsd-arm64": "0.24.2", "@esbuild/netbsd-x64": "0.24.2", "@esbuild/openbsd-arm64": "0.24.2", "@esbuild/openbsd-x64": "0.24.2", "@esbuild/sunos-x64": "0.24.2", "@esbuild/win32-arm64": "0.24.2", "@esbuild/win32-ia32": "0.24.2", "@esbuild/win32-x64": "0.24.2" }, "bin": "bin/esbuild" }, "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA=="],
148
+
149
+ "estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="],
150
+
151
+ "expect-type": ["expect-type@1.1.0", "", {}, "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA=="],
152
+
153
+ "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
154
+
155
+ "loupe": ["loupe@3.1.3", "", {}, "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug=="],
156
+
157
+ "magic-string": ["magic-string@0.30.17", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } }, "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA=="],
158
+
159
+ "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
160
+
161
+ "nanoid": ["nanoid@3.3.8", "", { "bin": "bin/nanoid.cjs" }, "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w=="],
162
+
163
+ "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
164
+
165
+ "pathval": ["pathval@2.0.0", "", {}, "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA=="],
166
+
167
+ "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
168
+
169
+ "postcss": ["postcss@8.5.0", "", { "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-27VKOqrYfPncKA2NrFOVhP5MGAfHKLYn/Q0mz9cNQyRAKYi3VNHwYU2qKKqPCqgBmeeJ0uAFB56NumXZ5ZReXg=="],
170
+
171
+ "prettier": ["prettier@3.4.2", "", { "bin": "bin/prettier.cjs" }, "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ=="],
172
+
173
+ "rollup": ["rollup@4.34.8", "", { "dependencies": { "@types/estree": "1.0.6" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.34.8", "@rollup/rollup-android-arm64": "4.34.8", "@rollup/rollup-darwin-arm64": "4.34.8", "@rollup/rollup-darwin-x64": "4.34.8", "@rollup/rollup-freebsd-arm64": "4.34.8", "@rollup/rollup-freebsd-x64": "4.34.8", "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", "@rollup/rollup-linux-arm-musleabihf": "4.34.8", "@rollup/rollup-linux-arm64-gnu": "4.34.8", "@rollup/rollup-linux-arm64-musl": "4.34.8", "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", "@rollup/rollup-linux-riscv64-gnu": "4.34.8", "@rollup/rollup-linux-s390x-gnu": "4.34.8", "@rollup/rollup-linux-x64-gnu": "4.34.8", "@rollup/rollup-linux-x64-musl": "4.34.8", "@rollup/rollup-win32-arm64-msvc": "4.34.8", "@rollup/rollup-win32-ia32-msvc": "4.34.8", "@rollup/rollup-win32-x64-msvc": "4.34.8", "fsevents": "~2.3.2" }, "bin": "dist/bin/rollup" }, "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ=="],
174
+
175
+ "siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
176
+
177
+ "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
178
+
179
+ "stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="],
180
+
181
+ "std-env": ["std-env@3.8.0", "", {}, "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w=="],
182
+
183
+ "tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="],
184
+
185
+ "tinyexec": ["tinyexec@0.3.2", "", {}, "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA=="],
186
+
187
+ "tinypool": ["tinypool@1.0.2", "", {}, "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA=="],
188
+
189
+ "tinyrainbow": ["tinyrainbow@2.0.0", "", {}, "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw=="],
190
+
191
+ "tinyspy": ["tinyspy@3.0.2", "", {}, "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q=="],
192
+
193
+ "typescript": ["typescript@5.7.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw=="],
194
+
195
+ "undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
196
+
197
+ "vite": ["vite@6.0.11", "", { "dependencies": { "esbuild": "^0.24.2", "postcss": "^8.4.49", "rollup": "^4.23.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": "bin/vite.js" }, "sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg=="],
198
+
199
+ "vite-node": ["vite-node@3.0.5", "", { "dependencies": { "cac": "^6.7.14", "debug": "^4.4.0", "es-module-lexer": "^1.6.0", "pathe": "^2.0.2", "vite": "^5.0.0 || ^6.0.0" }, "bin": "vite-node.mjs" }, "sha512-02JEJl7SbtwSDJdYS537nU6l+ktdvcREfLksk/NDAqtdKWGqHl+joXzEubHROmS3E6pip+Xgu2tFezMu75jH7A=="],
200
+
201
+ "vite-plugin-externalize-deps": ["vite-plugin-externalize-deps@0.9.0", "", { "peerDependencies": { "vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" } }, "sha512-wg3qb5gCy2d1KpPKyD9wkXMcYJ84yjgziHrStq9/8R7chhUC73mhQz+tVtvhFiICQHsBn1pnkY4IBbPqF9JHNw=="],
202
+
203
+ "vitest": ["vitest@3.0.5", "", { "dependencies": { "@vitest/expect": "3.0.5", "@vitest/mocker": "3.0.5", "@vitest/pretty-format": "^3.0.5", "@vitest/runner": "3.0.5", "@vitest/snapshot": "3.0.5", "@vitest/spy": "3.0.5", "@vitest/utils": "3.0.5", "chai": "^5.1.2", "debug": "^4.4.0", "expect-type": "^1.1.0", "magic-string": "^0.30.17", "pathe": "^2.0.2", "std-env": "^3.8.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.2", "tinypool": "^1.0.2", "tinyrainbow": "^2.0.0", "vite": "^5.0.0 || ^6.0.0", "vite-node": "3.0.5", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "@vitest/browser": "3.0.5", "@vitest/ui": "3.0.5", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@types/debug", "@vitest/browser", "@vitest/ui", "happy-dom", "jsdom"], "bin": "vitest.mjs" }, "sha512-4dof+HvqONw9bvsYxtkfUp2uHsTN9bV2CZIi1pWgoFpL1Lld8LA1ka9q/ONSsoScAKG7NVGf2stJTI7XRkXb2Q=="],
204
+
205
+ "why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": "cli.js" }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="],
206
+ }
207
+ }
@@ -0,0 +1,17 @@
1
+ import { Router } from "../router/router";
2
+ import { Env, View } from "../types";
3
+ import { Context } from "./context";
4
+ import { MaybeSignal } from "./signals";
5
+ import { CrashViewProps } from "./views/default-crash-view";
6
+ export declare class App extends Context {
7
+ #private;
8
+ constructor(name: MaybeSignal<string>, view: View<{}> | Router);
9
+ setCrashView(view: View<CrashViewProps>): this;
10
+ setLogLevels(): this;
11
+ setLogFilter(): this;
12
+ setEnv(value: Env): this;
13
+ getEnv(): Env;
14
+ mount(parent: Element): Promise<void>;
15
+ mount(selector: string): Promise<void>;
16
+ unmount(): Promise<void>;
17
+ }
@@ -1,36 +1,56 @@
1
1
  import type { Store } from "../types";
2
2
  import { type Logger, type LoggerOptions } from "./logger";
3
3
  import { type EffectFn, type MaybeSignal, type UnsubscribeFn } from "./signals";
4
- type StoreMap = Map<Store<any, any>, any>;
5
4
  export declare enum LifecycleEvent {
6
5
  WILL_MOUNT = 0,
7
6
  DID_MOUNT = 1,
8
7
  WILL_UNMOUNT = 2,
9
- DID_UNMOUNT = 3
8
+ DID_UNMOUNT = 3,
9
+ DISPOSE = 4
10
10
  }
11
11
  type LifecycleListener = () => void;
12
12
  declare enum LifecycleState {
13
13
  Unmounted = 0,
14
14
  WillMount = 1,
15
- WillMountByDependent = 2,
16
- DidMount = 3,
17
- DidMountByDependent = 4,
18
- WillUnmount = 5,
19
- WillUnmountByDependent = 6,
20
- DidUnmount = 7
15
+ DidMount = 2,
16
+ WillUnmount = 3,
17
+ DidUnmount = 4,
18
+ Disposed = 5
21
19
  }
20
+ declare const NAME: unique symbol;
21
+ declare const LIFECYCLE: unique symbol;
22
+ declare const PARENT: unique symbol;
23
+ declare const STORES: unique symbol;
24
+ declare const STATE: unique symbol;
22
25
  /**
23
26
  * Manages lifecycle events for a Context.
24
27
  */
25
28
  declare class ContextLifecycle {
26
- #private;
29
+ private context;
27
30
  state: LifecycleState;
28
- dependents: number;
31
+ listeners: Map<LifecycleEvent, Set<LifecycleListener>>;
32
+ bound?: Set<Context>;
33
+ constructor(context: Context);
34
+ /**
35
+ * Listen for a certain event to be emitted. Listeners are called when the event results in a state change.
36
+ */
29
37
  on<E extends LifecycleEvent>(event: E, listener: LifecycleListener): void;
38
+ /**
39
+ * Stop a particular listener from being called when an event is emitted.
40
+ */
30
41
  off<E extends LifecycleEvent>(event: E, listener: LifecycleListener): void;
31
- notify<E extends LifecycleEvent>(event: E): void;
32
- emit<E extends LifecycleEvent>(event: E, dependent?: boolean): void;
33
- dispose(): void;
42
+ /**
43
+ * Advance the lifecycle state machine.
44
+ */
45
+ emit<E extends LifecycleEvent>(event: E): void;
46
+ /**
47
+ * Bind `context` to this lifecycle; when any event is emitted here it will be emitted for `context` as well.
48
+ */
49
+ bind(context: Context): void;
50
+ /**
51
+ * Call all the event's listeners and re-emit to bound contexts.
52
+ */
53
+ private notify;
34
54
  }
35
55
  export interface ContextOptions {
36
56
  logger?: LoggerOptions;
@@ -42,17 +62,41 @@ export interface Context extends Logger {
42
62
  }
43
63
  export declare class Context implements Logger {
44
64
  #private;
45
- _name: string;
46
- _lifecycle: ContextLifecycle;
47
- _parent?: Context;
48
- _stores?: StoreMap;
49
- _state?: Map<any, any>;
65
+ [NAME]: string;
66
+ [LIFECYCLE]: ContextLifecycle;
67
+ [PARENT]?: Context;
68
+ [STORES]?: Map<Store<any, any>, any>;
69
+ [STATE]?: Map<any, any>;
50
70
  get isMounted(): boolean;
51
71
  /**
52
72
  * Returns a new Context with this one as its parent.
53
73
  */
54
74
  static linked(parent: Context, name: MaybeSignal<string>, options?: LinkedContextOptions): Context;
55
- static emit(event: LifecycleEvent, context: Context): void;
75
+ /**
76
+ * Emit "will mount" lifecycle event to `context`.
77
+ */
78
+ static willMount(context: Context): void;
79
+ /**
80
+ * Emit "did mount" lifecycle event to `context`.
81
+ */
82
+ static didMount(context: Context): void;
83
+ /**
84
+ * Emit "will unmount" lifecycle event to `context`.
85
+ */
86
+ static willUnmount(context: Context): void;
87
+ /**
88
+ * Emit "did unmount" lifecycle event to `context`.
89
+ */
90
+ static didUnmount(context: Context): void;
91
+ /**
92
+ * Emit "dispose" lifecycle event to `context`.
93
+ */
94
+ static dispose(context: Context): void;
95
+ /**
96
+ * Traverses _parent contexts until arriving at one that doesn't have a parent itself.
97
+ * Returns null if this context is the parent.
98
+ */
99
+ static getRoot(context: Context): Context | null;
56
100
  constructor(name: MaybeSignal<string>, options?: ContextOptions);
57
101
  /**
58
102
  * Returns the current name of this context.
@@ -62,7 +106,15 @@ export declare class Context implements Logger {
62
106
  * Sets a new name for this context.
63
107
  */
64
108
  setName(name: MaybeSignal<string>): void;
109
+ /**
110
+ * Creates an instance of a store and attaches it to this context.
111
+ */
65
112
  addStore<T>(store: Store<any, T>, options?: any): this;
113
+ /**
114
+ * Retrieves the nearest instance of `store`. If this context doesn't have it, the parent context is checked. This process continues until either:
115
+ * 1. An instance of the store is found and returned.
116
+ * 2. No instance is found and an error is thrown.
117
+ */
66
118
  getStore<T>(store: Store<any, T>): T;
67
119
  /**
68
120
  * Schedule a callback function to run just before this context is mounted.
@@ -1,4 +1,4 @@
1
- export { $, effect, get, peek } from "./signals.js";
1
+ export { $, effect, get, untracked } from "./signals.js";
2
2
  export type { MaybeSignal, Signal, Source } from "./signals.js";
3
3
  export { createContext } from "./context.js";
4
4
  export type { Context } from "./context.js";
@@ -10,7 +10,7 @@ export { mount, type UnmountFn } from "./mount.js";
10
10
  export { deepEqual, shallowEqual, strictEqual } from "../utils.js";
11
11
  export { getEnv, setEnv } from "./env.js";
12
12
  export { createLogger, setLogFilter, setLogLevels } from "./logger.js";
13
- export type { Logger, LoggerErrorContext, LoggerOptions, LogLevels } from "./logger.js";
13
+ export type { Logger, LoggerErrorProps as LoggerErrorContext, LoggerOptions, LogLevels } from "./logger.js";
14
14
  export type { View, Store, InputType, Renderable, Env } from "../types.js";
15
15
  export type { CrashViewProps } from "./views/default-crash-view.js";
16
16
  import type { IntrinsicElements as Elements } from "../types.js";
@@ -27,13 +27,13 @@ export interface LoggerOptions {
27
27
  */
28
28
  console?: any;
29
29
  }
30
- export interface LoggerErrorContext {
30
+ export interface LoggerErrorProps {
31
31
  error: Error;
32
32
  loggerName: string;
33
33
  tag?: string;
34
34
  tagName?: string;
35
35
  }
36
- export declare function onLoggerCrash(listener: (context: LoggerErrorContext) => void): () => void;
36
+ export declare function onLoggerCrash(listener: (context: LoggerErrorProps) => void): () => void;
37
37
  export declare function createLogger(name: MaybeSignal<string>, options?: LoggerOptions): Logger;
38
38
  export declare function setLogFilter(filter: string | RegExp): void;
39
39
  export declare function setLogLevels(options: Partial<LogLevels>): void;
@@ -5,7 +5,7 @@ import { type MaybeSignal, type Signal } from "./signals.js";
5
5
  /**
6
6
  * Markup is a set of element metadata that hasn't been constructed into a MarkupElement yet.
7
7
  */
8
- export declare class Markup<P extends Record<any, any> = Record<any, any>> {
8
+ export declare class Markup<P = any> {
9
9
  /**
10
10
  * In the case of a view, type will be the View function itself. It can also hold an identifier for special nodes like "$cond", "$repeat", etc.
11
11
  * DOM nodes can be created by name, such as HTML elements like "div", "ul" or "span", SVG elements like ""
@@ -13,13 +13,10 @@ export declare class Markup<P extends Record<any, any> = Record<any, any>> {
13
13
  type: string | View<P>;
14
14
  /**
15
15
  * Data that will be passed to a new MarkupNode instance when it is constructed.
16
+ * Includes a `children` prop if children were passed.
16
17
  */
17
18
  props: P | undefined;
18
- /**
19
- *
20
- */
21
- children: Renderable[];
22
- constructor(type: string | View<P>, props?: P, ...children: Renderable[]);
19
+ constructor(type: string | View<P>, props?: P);
23
20
  }
24
21
  /**
25
22
  * A mountable node that has been constructed from Markup metadata.
@@ -32,15 +29,19 @@ export interface MarkupNode {
32
29
  /**
33
30
  *
34
31
  */
35
- readonly isMounted: boolean;
32
+ isMounted(): boolean;
36
33
  /**
37
34
  *
38
35
  */
39
- mount(parent: Node, after?: Node): void;
36
+ mount(parent: Element, after?: Node): void;
40
37
  /**
41
38
  *
42
39
  */
43
40
  unmount(parentIsUnmounting?: boolean): void;
41
+ /**
42
+ * Moves a node without unmounting and remounting (if the browser supports Element.moveBefore).
43
+ */
44
+ move(parent: Element, after?: Node): void;
44
45
  }
45
46
  export declare function isMarkupNode(value: any): value is MarkupNode;
46
47
  export declare enum MarkupType {
@@ -67,13 +68,13 @@ export interface MarkupProps {
67
68
  };
68
69
  [MarkupType.Portal]: {
69
70
  content: Renderable;
70
- parent: Node;
71
+ parent: Element;
71
72
  };
72
73
  [tag: string]: Record<string, any>;
73
74
  }
74
- export declare function m<T extends keyof MarkupProps>(type: T, props: MarkupProps[T], ...children: Renderable[]): Markup;
75
- export declare function m<P extends {}>(type: View<P>, props?: P, ...children: Renderable[]): Markup;
76
- export declare function m<P>(type: View<P>, props: P, ...children: any[]): Markup;
75
+ export declare function m<T extends keyof MarkupProps>(type: T, props: MarkupProps[T]): Markup;
76
+ export declare function m<P extends {}>(type: View<P>, props?: P): Markup;
77
+ export declare function m<P>(type: View<P>, props: P): Markup;
77
78
  /**
78
79
  * If `condition` is truthy, displays `thenContent`, otherwise `elseContent`.
79
80
  */
@@ -90,7 +91,7 @@ export declare function repeat<T>(items: MaybeSignal<T[]>, key: KeyFn<T>, render
90
91
  /**
91
92
  * Renders `content` into a `parent` node anywhere in the page, rather than its usual position in the view.
92
93
  */
93
- export declare function portal(parent: Node, content: Renderable): Markup;
94
+ export declare function portal(parent: Element, content: Renderable): Markup;
94
95
  export declare function render(content: Renderable, context?: Context): MarkupNode;
95
96
  /**
96
97
  * Convert basically anything into a set of MarkupElements.
@@ -1,10 +1,10 @@
1
1
  import { Router } from "../router/router";
2
2
  import type { View } from "../types";
3
3
  import { Context } from "./context";
4
- import { type LoggerErrorContext } from "./logger";
4
+ import { type LoggerErrorProps } from "./logger";
5
5
  export type UnmountFn = () => Promise<void>;
6
6
  export interface MountOptions {
7
- crashView?: View<LoggerErrorContext>;
7
+ crashView?: View<LoggerErrorProps>;
8
8
  /**
9
9
  * An existing Context to use as the root, otherwise a new one will be created.
10
10
  * Use this to provide top-level stores and state to the whole app.
@@ -6,8 +6,9 @@ import { IS_MARKUP_NODE } from "../symbols";
6
6
  export declare class DOMNode implements MarkupNode {
7
7
  [IS_MARKUP_NODE]: boolean;
8
8
  root: Node;
9
- get isMounted(): boolean;
10
9
  constructor(node: Node);
11
- mount(parent: Node, after?: Node): void;
10
+ isMounted(): boolean;
11
+ mount(parent: Element, after?: Node): void;
12
12
  unmount(parentIsUnmounting?: boolean): void;
13
+ move(parent: Element, after?: Node): void;
13
14
  }
@@ -15,10 +15,11 @@ export declare class Dynamic implements MarkupNode {
15
15
  private context;
16
16
  private $slot;
17
17
  private unsubscribe?;
18
- get isMounted(): boolean;
19
18
  constructor(context: Context, $slot: Signal<any>);
19
+ isMounted(): boolean;
20
20
  mount(parent: Node, after?: Node): void;
21
21
  unmount(parentIsUnmounting?: boolean): void;
22
+ move(parent: Element, after?: Node): void;
22
23
  private cleanup;
23
24
  private update;
24
25
  /**
@@ -4,18 +4,20 @@ import { IS_MARKUP_NODE } from "../symbols.js";
4
4
  export type Mixin<E extends Element = Element> = (element: E, context: Context) => void;
5
5
  export declare class HTML implements MarkupNode {
6
6
  [IS_MARKUP_NODE]: boolean;
7
- root: HTMLElement | SVGElement;
7
+ root?: HTMLElement | SVGElement;
8
+ private parentContext;
8
9
  private context;
9
- private props;
10
- private children?;
10
+ tag: string;
11
+ props: Record<string, any>;
11
12
  private childNodes;
12
13
  private unsubscribers;
13
14
  private ref?;
14
15
  private canClickAway;
15
- get isMounted(): boolean;
16
- constructor(context: Context, tag: string, props: Record<string, any>, children?: any[]);
16
+ constructor(context: Context, tag: string, props: Record<string, any>);
17
+ isMounted(): boolean;
17
18
  mount(parent: Node, after?: Node): void;
18
19
  unmount(parentIsUnmounting?: boolean): void;
20
+ move(parent: Element, after?: Node): void;
19
21
  private attachProp;
20
22
  private applyProps;
21
23
  private applyStyles;
@@ -11,8 +11,9 @@ export declare class Portal implements MarkupNode {
11
11
  private content;
12
12
  private parent;
13
13
  private element?;
14
- get isMounted(): boolean;
15
- constructor(context: Context, content: Renderable, parent: Node);
16
- mount(_parent: Node, _after?: Node): void;
14
+ constructor(context: Context, content: Renderable, parent: Element);
15
+ isMounted(): boolean;
16
+ mount(_parent: Element, _after?: Node): void;
17
17
  unmount(parentIsUnmounting?: boolean): void;
18
+ move(_parent: Element, _after?: Node): void;
18
19
  }
@@ -3,7 +3,8 @@ import type { Context } from "../context.js";
3
3
  import type { MarkupNode } from "../markup.js";
4
4
  import { type Signal } from "../signals.js";
5
5
  import { IS_MARKUP_NODE } from "../symbols.js";
6
- export type KeyFn<T> = (item: T, index: number) => string | number | symbol;
6
+ export type Key = string | number | symbol;
7
+ export type KeyFn<T> = (item: T, index: number) => Key;
7
8
  export type RenderFn<T> = (item: Signal<T>, index: Signal<number>, ctx: Context) => Renderable;
8
9
  export declare class Repeat<T> implements MarkupNode {
9
10
  [IS_MARKUP_NODE]: boolean;
@@ -14,10 +15,11 @@ export declare class Repeat<T> implements MarkupNode {
14
15
  private render;
15
16
  private unsubscribe;
16
17
  private connectedItems;
17
- get isMounted(): boolean;
18
18
  constructor(context: Context, items: Signal<T[]>, key: KeyFn<T>, render: RenderFn<T>);
19
- mount(parent: Node, after?: Node): void;
19
+ isMounted(): boolean;
20
+ mount(parent: Element, after?: Node): void;
20
21
  unmount(parentIsUnmounting?: boolean): void;
22
+ move(parent: Element, after?: Node): void;
21
23
  private _cleanup;
22
24
  private _update;
23
25
  }