sibujs 4.5.0 → 4.7.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 (116) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.cjs +326 -133
  3. package/dist/browser.d.cts +46 -14
  4. package/dist/browser.d.ts +46 -14
  5. package/dist/browser.js +8 -6
  6. package/dist/build.cjs +2094 -1033
  7. package/dist/build.d.cts +133 -44
  8. package/dist/build.d.ts +133 -44
  9. package/dist/build.js +1372 -574
  10. package/dist/cdn.dev.global.js +10 -10
  11. package/dist/cdn.full.dev.global.js +11 -11
  12. package/dist/cdn.full.global.js +10 -10
  13. package/dist/cdn.global.js +10 -10
  14. package/dist/{chunk-2DCGACUU.js → chunk-2BPG2XDA.js} +251 -66
  15. package/dist/{chunk-IXKSNWV5.js → chunk-2INLLLMZ.js} +1 -1
  16. package/dist/{chunk-4PMLNECI.js → chunk-3QWBSL5R.js} +98 -29
  17. package/dist/{chunk-KKLW7YWL.js → chunk-4AWA2PVD.js} +275 -144
  18. package/dist/chunk-5HZXGZ6T.js +24 -0
  19. package/dist/{chunk-PCT43HW3.js → chunk-7LUJQAOJ.js} +1 -1
  20. package/dist/{chunk-5DXA2J44.js → chunk-7XHATCIH.js} +5 -2
  21. package/dist/chunk-BC2SECJD.js +44 -0
  22. package/dist/{chunk-TBYTO6BS.js → chunk-BSY63EM6.js} +136 -80
  23. package/dist/{chunk-FTIR4QW2.js → chunk-DKXRACVN.js} +6 -8
  24. package/dist/{chunk-ONOHFDLG.js → chunk-FNJXNGYZ.js} +3 -3
  25. package/dist/{chunk-XZZOBQAY.js → chunk-FQRUXCEE.js} +6 -5
  26. package/dist/{chunk-NIOYEGBQ.js → chunk-HURREPU2.js} +27 -13
  27. package/dist/chunk-J6FW5TV6.js +233 -0
  28. package/dist/{chunk-UGRX3S57.js → chunk-JWKYU5GV.js} +22 -4
  29. package/dist/chunk-NYNYSPK7.js +318 -0
  30. package/dist/{chunk-RBTPLM32.js → chunk-RUSSKG6G.js} +13 -12
  31. package/dist/{chunk-7LN645I6.js → chunk-SLM3IA34.js} +3 -3
  32. package/dist/{chunk-R25EFXXC.js → chunk-TUCPL2HB.js} +3 -3
  33. package/dist/{chunk-B3WHI2QA.js → chunk-UNWRJRKC.js} +55 -31
  34. package/dist/{chunk-KEISJXBU.js → chunk-UOL2ECCS.js} +44 -17
  35. package/dist/{chunk-RJE2BNI4.js → chunk-VZSG24LS.js} +108 -45
  36. package/dist/{chunk-RIXRAYIU.js → chunk-WEQ3DMVL.js} +10 -4
  37. package/dist/{chunk-3JZ4L5TJ.js → chunk-WOLJZUFQ.js} +354 -90
  38. package/dist/{chunk-S373NSMK.js → chunk-XYV3EDB7.js} +283 -123
  39. package/dist/{chunk-VZKNK2V7.js → chunk-XZR4PXRE.js} +296 -38
  40. package/dist/{chunk-GW3SCCZG.js → chunk-Z3OHK6QT.js} +153 -110
  41. package/dist/{chunk-OMJJM3KM.js → chunk-ZVL7TY4K.js} +287 -130
  42. package/dist/{contracts-DBdg9J_a.d.ts → contracts-CLqzJnOV.d.ts} +36 -17
  43. package/dist/{contracts-DBdg9J_a.d.cts → contracts-CTOJXu-x.d.cts} +36 -17
  44. package/dist/{customElement-OB9CIsc5.d.cts → customElement-MmInOW1U.d.cts} +21 -0
  45. package/dist/{customElement-OB9CIsc5.d.ts → customElement-MmInOW1U.d.ts} +21 -0
  46. package/dist/data.cjs +410 -155
  47. package/dist/data.d.cts +166 -12
  48. package/dist/data.d.ts +166 -12
  49. package/dist/data.js +12 -9
  50. package/dist/devtools.cjs +98 -61
  51. package/dist/devtools.js +7 -8
  52. package/dist/dispose-GEIG2KOF.js +28 -0
  53. package/dist/ecosystem.cjs +372 -126
  54. package/dist/ecosystem.d.cts +20 -3
  55. package/dist/ecosystem.d.ts +20 -3
  56. package/dist/ecosystem.js +12 -12
  57. package/dist/extras.cjs +2366 -909
  58. package/dist/extras.d.cts +11 -9
  59. package/dist/extras.d.ts +11 -9
  60. package/dist/extras.js +39 -28
  61. package/dist/index.cjs +421 -158
  62. package/dist/index.d.cts +213 -171
  63. package/dist/index.d.ts +213 -171
  64. package/dist/index.js +24 -27
  65. package/dist/motion.cjs +118 -44
  66. package/dist/motion.js +5 -5
  67. package/dist/patterns.cjs +344 -53
  68. package/dist/patterns.d.cts +28 -9
  69. package/dist/patterns.d.ts +28 -9
  70. package/dist/patterns.js +8 -8
  71. package/dist/performance.cjs +325 -220
  72. package/dist/performance.d.cts +2 -2
  73. package/dist/performance.d.ts +2 -2
  74. package/dist/performance.js +8 -9
  75. package/dist/plugin-DVgSnTfK.d.cts +112 -0
  76. package/dist/plugin-DVgSnTfK.d.ts +112 -0
  77. package/dist/plugins.cjs +664 -233
  78. package/dist/plugins.d.cts +127 -14
  79. package/dist/plugins.d.ts +127 -14
  80. package/dist/plugins.js +96 -42
  81. package/dist/signal-EotCj4hS.d.cts +110 -0
  82. package/dist/signal-EotCj4hS.d.ts +110 -0
  83. package/dist/{ssr-BiPRdZ6n.d.cts → ssr-Bli9XRW5.d.cts} +5 -0
  84. package/dist/{ssr-BiPRdZ6n.d.ts → ssr-Bli9XRW5.d.ts} +5 -0
  85. package/dist/{ssr-Y7XOEPEN.js → ssr-XOTUASDO.js} +4 -5
  86. package/dist/ssr.cjs +229 -84
  87. package/dist/ssr.d.cts +9 -3
  88. package/dist/ssr.d.ts +9 -3
  89. package/dist/ssr.js +11 -12
  90. package/dist/{startup-BMpaiMhP.d.ts → startup-BLfSeL15.d.cts} +73 -22
  91. package/dist/{startup-BMpaiMhP.d.cts → startup-BLfSeL15.d.ts} +73 -22
  92. package/dist/tagFactory-8qL9LCIx.d.cts +156 -0
  93. package/dist/tagFactory-BL2fymez.d.ts +156 -0
  94. package/dist/testing.cjs +2503 -2191
  95. package/dist/testing.d.cts +56 -5
  96. package/dist/testing.d.ts +56 -5
  97. package/dist/testing.js +580 -307
  98. package/dist/types-CJFViL6Q.d.cts +26 -0
  99. package/dist/types-CJFViL6Q.d.ts +26 -0
  100. package/dist/ui.cjs +732 -329
  101. package/dist/ui.d.cts +41 -7
  102. package/dist/ui.d.ts +41 -7
  103. package/dist/ui.js +151 -56
  104. package/dist/widgets.cjs +267 -291
  105. package/dist/widgets.js +9 -10
  106. package/package.json +4 -2
  107. package/dist/chunk-2WLZ6757.js +0 -149
  108. package/dist/chunk-CCSJMTRN.js +0 -15
  109. package/dist/chunk-QKRPLZ2V.js +0 -108
  110. package/dist/chunk-VUF4ALSW.js +0 -60
  111. package/dist/chunk-WWV3SJ3L.js +0 -131
  112. package/dist/dispose-46BOMMQJ.js +0 -19
  113. package/dist/plugin-D30wlGW5.d.cts +0 -71
  114. package/dist/plugin-D30wlGW5.d.ts +0 -71
  115. package/dist/tagFactory-DVoDpHye.d.cts +0 -215
  116. package/dist/tagFactory-DVoDpHye.d.ts +0 -215
@@ -1,9 +1,20 @@
1
- import { T as TrustedHTML } from './ssr-BiPRdZ6n.cjs';
2
- export { P as PluginContext, a as PluginRegistry, S as SibuPlugin, c as createPlugin, b as createPluginRegistry, i as inject, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, d as triggerPluginMount, e as triggerPluginUnmount } from './plugin-D30wlGW5.cjs';
3
- export { M as Migration, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, a as compareSemVer, d as createBootSequence, e as createBundle, f as createMigrationRunner, g as createModuleRegistry, h as createSSRCache, i as createTestHarness, j as deferNonCritical, k as env, l as healthCheck, m as lazyModule, p as packageInfo, n as parseSemVer, o as preloadCritical, q as prerenderRoutes, s as satisfies } from './startup-BMpaiMhP.cjs';
1
+ import { A as Accessor } from './signal-EotCj4hS.cjs';
2
+ import { N as NodeChildren } from './types-CJFViL6Q.cjs';
3
+ import { T as TrustedHTML } from './ssr-Bli9XRW5.cjs';
4
+ export { P as PluginContext, a as PluginInstallCancelledError, b as PluginRegistry, S as SibuPlugin, c as createPlugin, d as createPluginRegistry, i as inject, e as isPluginInstallCancelledError, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, f as triggerPluginMount, g as triggerPluginUnmount } from './plugin-DVgSnTfK.cjs';
5
+ export { L as LazyModule, M as Migration, a as MigrationStorageError, P as PackageExportTarget, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, d as compareSemVer, e as createBootSequence, f as createBundle, g as createMigrationRunner, h as createModuleRegistry, i as createSSRCache, j as createTestHarness, k as deferNonCritical, l as env, m as healthCheck, n as lazyModule, p as packageInfo, o as parseSemVer, q as preloadCritical, r as prerenderRoutes, s as satisfies } from './startup-BLfSeL15.cjs';
4
6
 
5
7
  type Translations = Record<string, string>;
6
- type Params$1 = Record<string, string | number>;
8
+ /**
9
+ * Interpolation parameters for `t()`, `translated()` and `Trans()`.
10
+ *
11
+ * A value may be a GETTER (a signal accessor or any `() => value`). Getters are
12
+ * called at lookup time, so inside a binding the parameter is tracked exactly
13
+ * like the locale: `translated("hello", { name: userName })` re-renders when
14
+ * either `userName` or the locale changes.
15
+ */
16
+ type TranslationParams = Record<string, string | number | (() => string | number)>;
17
+ type Params$1 = TranslationParams;
7
18
  /**
8
19
  * Set the active locale.
9
20
  *
@@ -56,21 +67,72 @@ declare function getLocale(): string;
56
67
  * because the assignment form would invoke the inherited `__proto__` setter for
57
68
  * a locale of that name instead of registering it. Locale names and translation
58
69
  * keys are treated literally throughout — see PROTOTYPE SAFETY above.
70
+ *
71
+ * NOTIFY. Every registration bumps the dictionary revision, so bindings that
72
+ * already rendered a key re-run and pick the new message up — the order of
73
+ * `setLocale()` and `registerTranslations()` no longer matters. The bump comes
74
+ * after publication, so a re-running binding can only ever see the new
75
+ * dictionary.
59
76
  */
60
77
  declare function registerTranslations(locale: string, messages: Translations): void;
61
78
  /**
62
79
  * Translate `key` in the current locale, falling back to the key itself when it
63
80
  * is not registered. A registered empty string is a translation and is returned
64
81
  * unchanged; the previous `|| key` discarded it and returned the key.
82
+ *
83
+ * `t()` returns a STRING — a snapshot. It is live only when it is read inside a
84
+ * binding (`span(() => t("hello"))`), because that binding is what re-runs.
85
+ * Called directly in a component body, `span(t("hello"))` renders the message
86
+ * once and never updates. For anything on screen prefer {@link translated},
87
+ * which hands the binding a getter and works for text children and attributes
88
+ * alike. `t()` remains the right call for one-off strings: event handlers,
89
+ * `confirm()` prompts, log lines, server renders.
90
+ *
91
+ * Parameter getters are resolved on every call, so `t("hi", { name: userName })`
92
+ * inside a binding tracks `userName` too.
65
93
  */
66
94
  declare function t(key: string, params?: Params$1): string;
67
95
  /**
68
- * Trans component — renders a translated string reactively.
69
- * Automatically updates when the client locale changes. During SSR it renders
70
- * once, using the locale belonging to the current request.
96
+ * A LIVE translation: returns a getter that re-reads the message every time a
97
+ * binding calls it. Pass it anywhere the tag factories accept a reactive value
98
+ * — a text child or any attribute — and only that one text node or attribute
99
+ * updates when the locale changes, when messages for it are registered later,
100
+ * or when a getter parameter changes. The surrounding elements are never
101
+ * rebuilt, so focus, typed input values and element identity survive a language
102
+ * switch.
103
+ *
104
+ * During SSR the binding evaluates once, using the locale of the current
105
+ * request.
106
+ *
107
+ * @param key Translation key
108
+ * @param params Optional interpolation parameters; values may be getters
109
+ * @returns An accessor producing the translated string
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const [userName] = signal("Ada");
114
+ *
115
+ * header([
116
+ * h1(translated("app.title")),
117
+ * span(translated("greeting", { name: userName })),
118
+ * input({ placeholder: translated("search.placeholder"), "aria-label": translated("search.label") }),
119
+ * ]);
120
+ *
121
+ * setLocale("es"); // text and attributes update in place — no re-render
122
+ * ```
123
+ */
124
+ declare function translated(key: string, params?: Params$1): Accessor<string>;
125
+ /**
126
+ * Trans component — renders a translated string reactively inside a `<span>`.
127
+ * Automatically updates when the client locale changes, when messages for the
128
+ * active locale are registered, and when a getter parameter changes. During SSR
129
+ * it renders once, using the locale belonging to the current request.
130
+ *
131
+ * When no wrapper element is wanted, pass {@link translated} straight to the
132
+ * parent instead: `p(translated("greeting"))`.
71
133
  *
72
134
  * @param key Translation key
73
- * @param params Optional interpolation parameters
135
+ * @param params Optional interpolation parameters; values may be getters
74
136
  * @returns An HTMLElement (span) that reactively shows the translated text
75
137
  *
76
138
  * @example
@@ -78,8 +140,8 @@ declare function t(key: string, params?: Params$1): string;
78
140
  * registerTranslations("en", { greeting: "Hello, {name}!" });
79
141
  * registerTranslations("es", { greeting: "Hola, {name}!" });
80
142
  *
81
- * div([Trans("greeting", { name: "World" })]);
82
- * // When locale changes, the text updates automatically
143
+ * div([Trans("greeting", { name: userName })]);
144
+ * // When the locale or userName changes, the text updates automatically
83
145
  * ```
84
146
  */
85
147
  declare function Trans(key: string, params?: Params$1): HTMLElement;
@@ -98,6 +160,9 @@ declare function hasTranslation(key: string): boolean;
98
160
  *
99
161
  * Own enumerable keys, so a locale is listed exactly when it was registered -
100
162
  * including one named `"__proto__"`, which publication now stores literally.
163
+ *
164
+ * Read inside a binding the list is live: registering a new locale re-runs it,
165
+ * so a language picker built from it picks up lazily loaded locales.
101
166
  */
102
167
  declare function getAvailableLocales(): string[];
103
168
 
@@ -127,6 +192,41 @@ interface RouteBase {
127
192
  readonly children?: RouteDef[];
128
193
  readonly beforeEnter?: Guard | Guard[];
129
194
  readonly alias?: string | string[];
195
+ /**
196
+ * Identity of the mounted instance of this route's component.
197
+ *
198
+ * When a navigation stays on this route but the key changes, the outlet
199
+ * disposes the old instance (running its `onUnmount` / `onCleanup`
200
+ * callbacks and releasing its bindings) and mounts a fresh one — so a page
201
+ * that reads `route().params.id` once at setup always sees the right id.
202
+ *
203
+ * **Default:** the path params this record declares in its *own* path (and
204
+ * aliases). `/records/1` → `/records/2` remounts; `?tab=a` → `?tab=b` or a
205
+ * hash change does not. A parent layout is not remounted when only a child's
206
+ * param changes — the child's `Outlet()` remounts the child instead. A
207
+ * record with no params of its own is never remounted by a param change, and
208
+ * a `*` tail (`pathMatch`) is not part of the default: a catch-all keeps its
209
+ * instance and reads `pathMatch` reactively (`key: (r) => r.params.pathMatch`
210
+ * remounts per path).
211
+ *
212
+ * **Override:** return any string derived from the route. Return a constant
213
+ * to keep one long-lived instance across param changes (the instance must
214
+ * then read params reactively, e.g. `routerState().params()` or
215
+ * `() => route().params.id`). Include query values to also remount on a
216
+ * query change.
217
+ *
218
+ * Called untracked with the committed route. Ignored by `KeepAliveRoute()`,
219
+ * which already keeps one instance per full location.
220
+ *
221
+ * @example
222
+ * ```ts
223
+ * // Keep one instance for every record; the page reads params reactively.
224
+ * { path: "/records/:id", component: RecordPage, key: () => "record" }
225
+ * // Also remount when ?tab changes.
226
+ * { path: "/records/:id", component: RecordPage, key: (r) => `${r.params.id}|${r.query.tab ?? ""}` }
227
+ * ```
228
+ */
229
+ readonly key?: (route: RouteContext) => string;
130
230
  }
131
231
  interface ComponentRoute extends RouteBase {
132
232
  readonly component: Component;
@@ -367,6 +467,11 @@ declare function setRoutes(routes: RouteDef[]): void;
367
467
  /**
368
468
  * Read the current route as a plain snapshot.
369
469
  *
470
+ * Reading it once in a route component's setup is safe: when a navigation
471
+ * changes that route's own params, the outlet mounts a fresh instance (see
472
+ * `RouteBase.key`). Inside a getter — `() => route().params.id` — the read is
473
+ * reactive, which is what a long-lived layout or a constant-`key` route needs.
474
+ *
370
475
  * @returns The active {@link RouteContext} (path, params, query, hash).
371
476
  * @throws If no router has been created yet.
372
477
  */
@@ -456,7 +561,10 @@ declare function beforeResolve(guard: NavigationGuard): () => void;
456
561
  declare function afterEach(hook: (to: RouteContext, from: RouteContext) => void): () => void;
457
562
  /**
458
563
  * The route outlet: renders whichever component matches the current route, and
459
- * swaps it on every navigation.
564
+ * swaps it when the top-level matched record or its instance key changes. By
565
+ * default the key is that record's own path params, so `/records/1` →
566
+ * `/records/2` mounts a fresh instance while a query- or hash-only change keeps
567
+ * the current one (see `RouteBase.key`).
460
568
  *
461
569
  * @returns A Comment anchor that manages the matched component. Like every
462
570
  * factory here it hands back a live node the caller can insert directly.
@@ -525,11 +633,11 @@ declare function RouterLink(props: {
525
633
  activeClass?: string;
526
634
  exactActiveClass?: string;
527
635
  /** @deprecated Pass children positionally: `RouterLink(props, children)`. */
528
- nodes?: string | Node | (string | Node)[];
636
+ nodes?: NodeChildren;
529
637
  target?: string;
530
638
  rel?: string;
531
639
  [key: string]: unknown;
532
- }, children?: string | Node | (string | Node)[]): HTMLAnchorElement;
640
+ }, children?: NodeChildren): HTMLAnchorElement;
533
641
  /**
534
642
  * Async boundary for code-split / deferred content.
535
643
  *
@@ -617,6 +725,11 @@ declare function __removeRouterPagehideHandler(): void;
617
725
  /**
618
726
  * Outlet renders the child route component within a layout.
619
727
  * Use inside a parent route's component to render matched children.
728
+ *
729
+ * The child is remounted when the matched child record changes or when its
730
+ * instance key does — by default the params declared below the top-level
731
+ * record, so a child-only param change remounts the child and leaves the
732
+ * layout in place (see `RouteBase.key`).
620
733
  */
621
734
  declare function Outlet(): Node;
622
735
  /**
@@ -782,4 +895,4 @@ declare function createSSRRouter(routes: SSRRouteDef[]): {
782
895
  }) => string;
783
896
  };
784
897
 
785
- export { type AsyncComponent, type AsyncRoute, type Component, type ComponentRoute, type Guard, type GuardResult, KeepAliveRoute, type LazyComponent, type LazyRoute, type NavigationFailure, type NavigationFailureReason, type NavigationGuard, type NavigationNext, type NavigationResult, type NavigationTarget, Outlet, type Params, type RedirectRoute, Route, type RouteBase, type RouteContext, type RouteDef, type RouteMeta, type RouteTransitionOptions, RouterLink, type RouterOptions, type RouterPlugin, type SSRRouteDef, type SSRRouteState, type ScrollBehavior, type ScrollPosition, SibuRouter, Suspense, Trans, __getNavigationEpoch, __removeRouterPagehideHandler, addRoute, afterEach, back, beforeEach, beforeResolve, buildURL, createMemoryRouter, createRouter, createSSRRouter, deserializeRouteState, destroyRouter, forward, getAvailableLocales, getLocale, getRouteInfo, getRouteTransition, go, hasRoute, hasTranslation, hydrateRouter, lazy, navigate, preloadRoute, push, registerTranslations, removeRoute, renderRouteToDocument, renderRouteToString, replace, resolveServerRoute, route, router, routerPlugin, routerState, serializeRouteState, setLocale, setRouteTransition, setRoutes, t };
898
+ export { type AsyncComponent, type AsyncRoute, type Component, type ComponentRoute, type Guard, type GuardResult, KeepAliveRoute, type LazyComponent, type LazyRoute, type NavigationFailure, type NavigationFailureReason, type NavigationGuard, type NavigationNext, type NavigationResult, type NavigationTarget, Outlet, type Params, type RedirectRoute, Route, type RouteBase, type RouteContext, type RouteDef, type RouteMeta, type RouteTransitionOptions, RouterLink, type RouterOptions, type RouterPlugin, type SSRRouteDef, type SSRRouteState, type ScrollBehavior, type ScrollPosition, SibuRouter, Suspense, Trans, type TranslationParams, __getNavigationEpoch, __removeRouterPagehideHandler, addRoute, afterEach, back, beforeEach, beforeResolve, buildURL, createMemoryRouter, createRouter, createSSRRouter, deserializeRouteState, destroyRouter, forward, getAvailableLocales, getLocale, getRouteInfo, getRouteTransition, go, hasRoute, hasTranslation, hydrateRouter, lazy, navigate, preloadRoute, push, registerTranslations, removeRoute, renderRouteToDocument, renderRouteToString, replace, resolveServerRoute, route, router, routerPlugin, routerState, serializeRouteState, setLocale, setRouteTransition, setRoutes, t, translated };
package/dist/plugins.d.ts CHANGED
@@ -1,9 +1,20 @@
1
- import { T as TrustedHTML } from './ssr-BiPRdZ6n.js';
2
- export { P as PluginContext, a as PluginRegistry, S as SibuPlugin, c as createPlugin, b as createPluginRegistry, i as inject, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, d as triggerPluginMount, e as triggerPluginUnmount } from './plugin-D30wlGW5.js';
3
- export { M as Migration, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, a as compareSemVer, d as createBootSequence, e as createBundle, f as createMigrationRunner, g as createModuleRegistry, h as createSSRCache, i as createTestHarness, j as deferNonCritical, k as env, l as healthCheck, m as lazyModule, p as packageInfo, n as parseSemVer, o as preloadCritical, q as prerenderRoutes, s as satisfies } from './startup-BMpaiMhP.js';
1
+ import { A as Accessor } from './signal-EotCj4hS.js';
2
+ import { N as NodeChildren } from './types-CJFViL6Q.js';
3
+ import { T as TrustedHTML } from './ssr-Bli9XRW5.js';
4
+ export { P as PluginContext, a as PluginInstallCancelledError, b as PluginRegistry, S as SibuPlugin, c as createPlugin, d as createPluginRegistry, i as inject, e as isPluginInstallCancelledError, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, f as triggerPluginMount, g as triggerPluginUnmount } from './plugin-DVgSnTfK.js';
5
+ export { L as LazyModule, M as Migration, a as MigrationStorageError, P as PackageExportTarget, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, d as compareSemVer, e as createBootSequence, f as createBundle, g as createMigrationRunner, h as createModuleRegistry, i as createSSRCache, j as createTestHarness, k as deferNonCritical, l as env, m as healthCheck, n as lazyModule, p as packageInfo, o as parseSemVer, q as preloadCritical, r as prerenderRoutes, s as satisfies } from './startup-BLfSeL15.js';
4
6
 
5
7
  type Translations = Record<string, string>;
6
- type Params$1 = Record<string, string | number>;
8
+ /**
9
+ * Interpolation parameters for `t()`, `translated()` and `Trans()`.
10
+ *
11
+ * A value may be a GETTER (a signal accessor or any `() => value`). Getters are
12
+ * called at lookup time, so inside a binding the parameter is tracked exactly
13
+ * like the locale: `translated("hello", { name: userName })` re-renders when
14
+ * either `userName` or the locale changes.
15
+ */
16
+ type TranslationParams = Record<string, string | number | (() => string | number)>;
17
+ type Params$1 = TranslationParams;
7
18
  /**
8
19
  * Set the active locale.
9
20
  *
@@ -56,21 +67,72 @@ declare function getLocale(): string;
56
67
  * because the assignment form would invoke the inherited `__proto__` setter for
57
68
  * a locale of that name instead of registering it. Locale names and translation
58
69
  * keys are treated literally throughout — see PROTOTYPE SAFETY above.
70
+ *
71
+ * NOTIFY. Every registration bumps the dictionary revision, so bindings that
72
+ * already rendered a key re-run and pick the new message up — the order of
73
+ * `setLocale()` and `registerTranslations()` no longer matters. The bump comes
74
+ * after publication, so a re-running binding can only ever see the new
75
+ * dictionary.
59
76
  */
60
77
  declare function registerTranslations(locale: string, messages: Translations): void;
61
78
  /**
62
79
  * Translate `key` in the current locale, falling back to the key itself when it
63
80
  * is not registered. A registered empty string is a translation and is returned
64
81
  * unchanged; the previous `|| key` discarded it and returned the key.
82
+ *
83
+ * `t()` returns a STRING — a snapshot. It is live only when it is read inside a
84
+ * binding (`span(() => t("hello"))`), because that binding is what re-runs.
85
+ * Called directly in a component body, `span(t("hello"))` renders the message
86
+ * once and never updates. For anything on screen prefer {@link translated},
87
+ * which hands the binding a getter and works for text children and attributes
88
+ * alike. `t()` remains the right call for one-off strings: event handlers,
89
+ * `confirm()` prompts, log lines, server renders.
90
+ *
91
+ * Parameter getters are resolved on every call, so `t("hi", { name: userName })`
92
+ * inside a binding tracks `userName` too.
65
93
  */
66
94
  declare function t(key: string, params?: Params$1): string;
67
95
  /**
68
- * Trans component — renders a translated string reactively.
69
- * Automatically updates when the client locale changes. During SSR it renders
70
- * once, using the locale belonging to the current request.
96
+ * A LIVE translation: returns a getter that re-reads the message every time a
97
+ * binding calls it. Pass it anywhere the tag factories accept a reactive value
98
+ * — a text child or any attribute — and only that one text node or attribute
99
+ * updates when the locale changes, when messages for it are registered later,
100
+ * or when a getter parameter changes. The surrounding elements are never
101
+ * rebuilt, so focus, typed input values and element identity survive a language
102
+ * switch.
103
+ *
104
+ * During SSR the binding evaluates once, using the locale of the current
105
+ * request.
106
+ *
107
+ * @param key Translation key
108
+ * @param params Optional interpolation parameters; values may be getters
109
+ * @returns An accessor producing the translated string
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const [userName] = signal("Ada");
114
+ *
115
+ * header([
116
+ * h1(translated("app.title")),
117
+ * span(translated("greeting", { name: userName })),
118
+ * input({ placeholder: translated("search.placeholder"), "aria-label": translated("search.label") }),
119
+ * ]);
120
+ *
121
+ * setLocale("es"); // text and attributes update in place — no re-render
122
+ * ```
123
+ */
124
+ declare function translated(key: string, params?: Params$1): Accessor<string>;
125
+ /**
126
+ * Trans component — renders a translated string reactively inside a `<span>`.
127
+ * Automatically updates when the client locale changes, when messages for the
128
+ * active locale are registered, and when a getter parameter changes. During SSR
129
+ * it renders once, using the locale belonging to the current request.
130
+ *
131
+ * When no wrapper element is wanted, pass {@link translated} straight to the
132
+ * parent instead: `p(translated("greeting"))`.
71
133
  *
72
134
  * @param key Translation key
73
- * @param params Optional interpolation parameters
135
+ * @param params Optional interpolation parameters; values may be getters
74
136
  * @returns An HTMLElement (span) that reactively shows the translated text
75
137
  *
76
138
  * @example
@@ -78,8 +140,8 @@ declare function t(key: string, params?: Params$1): string;
78
140
  * registerTranslations("en", { greeting: "Hello, {name}!" });
79
141
  * registerTranslations("es", { greeting: "Hola, {name}!" });
80
142
  *
81
- * div([Trans("greeting", { name: "World" })]);
82
- * // When locale changes, the text updates automatically
143
+ * div([Trans("greeting", { name: userName })]);
144
+ * // When the locale or userName changes, the text updates automatically
83
145
  * ```
84
146
  */
85
147
  declare function Trans(key: string, params?: Params$1): HTMLElement;
@@ -98,6 +160,9 @@ declare function hasTranslation(key: string): boolean;
98
160
  *
99
161
  * Own enumerable keys, so a locale is listed exactly when it was registered -
100
162
  * including one named `"__proto__"`, which publication now stores literally.
163
+ *
164
+ * Read inside a binding the list is live: registering a new locale re-runs it,
165
+ * so a language picker built from it picks up lazily loaded locales.
101
166
  */
102
167
  declare function getAvailableLocales(): string[];
103
168
 
@@ -127,6 +192,41 @@ interface RouteBase {
127
192
  readonly children?: RouteDef[];
128
193
  readonly beforeEnter?: Guard | Guard[];
129
194
  readonly alias?: string | string[];
195
+ /**
196
+ * Identity of the mounted instance of this route's component.
197
+ *
198
+ * When a navigation stays on this route but the key changes, the outlet
199
+ * disposes the old instance (running its `onUnmount` / `onCleanup`
200
+ * callbacks and releasing its bindings) and mounts a fresh one — so a page
201
+ * that reads `route().params.id` once at setup always sees the right id.
202
+ *
203
+ * **Default:** the path params this record declares in its *own* path (and
204
+ * aliases). `/records/1` → `/records/2` remounts; `?tab=a` → `?tab=b` or a
205
+ * hash change does not. A parent layout is not remounted when only a child's
206
+ * param changes — the child's `Outlet()` remounts the child instead. A
207
+ * record with no params of its own is never remounted by a param change, and
208
+ * a `*` tail (`pathMatch`) is not part of the default: a catch-all keeps its
209
+ * instance and reads `pathMatch` reactively (`key: (r) => r.params.pathMatch`
210
+ * remounts per path).
211
+ *
212
+ * **Override:** return any string derived from the route. Return a constant
213
+ * to keep one long-lived instance across param changes (the instance must
214
+ * then read params reactively, e.g. `routerState().params()` or
215
+ * `() => route().params.id`). Include query values to also remount on a
216
+ * query change.
217
+ *
218
+ * Called untracked with the committed route. Ignored by `KeepAliveRoute()`,
219
+ * which already keeps one instance per full location.
220
+ *
221
+ * @example
222
+ * ```ts
223
+ * // Keep one instance for every record; the page reads params reactively.
224
+ * { path: "/records/:id", component: RecordPage, key: () => "record" }
225
+ * // Also remount when ?tab changes.
226
+ * { path: "/records/:id", component: RecordPage, key: (r) => `${r.params.id}|${r.query.tab ?? ""}` }
227
+ * ```
228
+ */
229
+ readonly key?: (route: RouteContext) => string;
130
230
  }
131
231
  interface ComponentRoute extends RouteBase {
132
232
  readonly component: Component;
@@ -367,6 +467,11 @@ declare function setRoutes(routes: RouteDef[]): void;
367
467
  /**
368
468
  * Read the current route as a plain snapshot.
369
469
  *
470
+ * Reading it once in a route component's setup is safe: when a navigation
471
+ * changes that route's own params, the outlet mounts a fresh instance (see
472
+ * `RouteBase.key`). Inside a getter — `() => route().params.id` — the read is
473
+ * reactive, which is what a long-lived layout or a constant-`key` route needs.
474
+ *
370
475
  * @returns The active {@link RouteContext} (path, params, query, hash).
371
476
  * @throws If no router has been created yet.
372
477
  */
@@ -456,7 +561,10 @@ declare function beforeResolve(guard: NavigationGuard): () => void;
456
561
  declare function afterEach(hook: (to: RouteContext, from: RouteContext) => void): () => void;
457
562
  /**
458
563
  * The route outlet: renders whichever component matches the current route, and
459
- * swaps it on every navigation.
564
+ * swaps it when the top-level matched record or its instance key changes. By
565
+ * default the key is that record's own path params, so `/records/1` →
566
+ * `/records/2` mounts a fresh instance while a query- or hash-only change keeps
567
+ * the current one (see `RouteBase.key`).
460
568
  *
461
569
  * @returns A Comment anchor that manages the matched component. Like every
462
570
  * factory here it hands back a live node the caller can insert directly.
@@ -525,11 +633,11 @@ declare function RouterLink(props: {
525
633
  activeClass?: string;
526
634
  exactActiveClass?: string;
527
635
  /** @deprecated Pass children positionally: `RouterLink(props, children)`. */
528
- nodes?: string | Node | (string | Node)[];
636
+ nodes?: NodeChildren;
529
637
  target?: string;
530
638
  rel?: string;
531
639
  [key: string]: unknown;
532
- }, children?: string | Node | (string | Node)[]): HTMLAnchorElement;
640
+ }, children?: NodeChildren): HTMLAnchorElement;
533
641
  /**
534
642
  * Async boundary for code-split / deferred content.
535
643
  *
@@ -617,6 +725,11 @@ declare function __removeRouterPagehideHandler(): void;
617
725
  /**
618
726
  * Outlet renders the child route component within a layout.
619
727
  * Use inside a parent route's component to render matched children.
728
+ *
729
+ * The child is remounted when the matched child record changes or when its
730
+ * instance key does — by default the params declared below the top-level
731
+ * record, so a child-only param change remounts the child and leaves the
732
+ * layout in place (see `RouteBase.key`).
620
733
  */
621
734
  declare function Outlet(): Node;
622
735
  /**
@@ -782,4 +895,4 @@ declare function createSSRRouter(routes: SSRRouteDef[]): {
782
895
  }) => string;
783
896
  };
784
897
 
785
- export { type AsyncComponent, type AsyncRoute, type Component, type ComponentRoute, type Guard, type GuardResult, KeepAliveRoute, type LazyComponent, type LazyRoute, type NavigationFailure, type NavigationFailureReason, type NavigationGuard, type NavigationNext, type NavigationResult, type NavigationTarget, Outlet, type Params, type RedirectRoute, Route, type RouteBase, type RouteContext, type RouteDef, type RouteMeta, type RouteTransitionOptions, RouterLink, type RouterOptions, type RouterPlugin, type SSRRouteDef, type SSRRouteState, type ScrollBehavior, type ScrollPosition, SibuRouter, Suspense, Trans, __getNavigationEpoch, __removeRouterPagehideHandler, addRoute, afterEach, back, beforeEach, beforeResolve, buildURL, createMemoryRouter, createRouter, createSSRRouter, deserializeRouteState, destroyRouter, forward, getAvailableLocales, getLocale, getRouteInfo, getRouteTransition, go, hasRoute, hasTranslation, hydrateRouter, lazy, navigate, preloadRoute, push, registerTranslations, removeRoute, renderRouteToDocument, renderRouteToString, replace, resolveServerRoute, route, router, routerPlugin, routerState, serializeRouteState, setLocale, setRouteTransition, setRoutes, t };
898
+ export { type AsyncComponent, type AsyncRoute, type Component, type ComponentRoute, type Guard, type GuardResult, KeepAliveRoute, type LazyComponent, type LazyRoute, type NavigationFailure, type NavigationFailureReason, type NavigationGuard, type NavigationNext, type NavigationResult, type NavigationTarget, Outlet, type Params, type RedirectRoute, Route, type RouteBase, type RouteContext, type RouteDef, type RouteMeta, type RouteTransitionOptions, RouterLink, type RouterOptions, type RouterPlugin, type SSRRouteDef, type SSRRouteState, type ScrollBehavior, type ScrollPosition, SibuRouter, Suspense, Trans, type TranslationParams, __getNavigationEpoch, __removeRouterPagehideHandler, addRoute, afterEach, back, beforeEach, beforeResolve, buildURL, createMemoryRouter, createRouter, createSSRRouter, deserializeRouteState, destroyRouter, forward, getAvailableLocales, getLocale, getRouteInfo, getRouteTransition, go, hasRoute, hasTranslation, hydrateRouter, lazy, navigate, preloadRoute, push, registerTranslations, removeRoute, renderRouteToDocument, renderRouteToString, replace, resolveServerRoute, route, router, routerPlugin, routerState, serializeRouteState, setLocale, setRouteTransition, setRoutes, t, translated };