sibujs 4.12.0 → 4.13.1

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 (74) hide show
  1. package/dist/browser.cjs +71 -18
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +6618 -6178
  4. package/dist/build.d.cts +554 -415
  5. package/dist/build.d.ts +554 -415
  6. package/dist/build.js +2091 -1735
  7. package/dist/cdn.dev.global.js +12 -12
  8. package/dist/cdn.full.dev.global.js +13 -13
  9. package/dist/cdn.full.global.js +12 -12
  10. package/dist/cdn.global.js +12 -12
  11. package/dist/{chunk-WFRQ6D7H.js → chunk-22OPSWMF.js} +1 -1
  12. package/dist/{chunk-ZJCHY2IB.js → chunk-2NC56RGY.js} +1 -1
  13. package/dist/{chunk-NB7TFSJE.js → chunk-2O6JJCUR.js} +4 -4
  14. package/dist/{chunk-B2Y5BJSP.js → chunk-4UTGDVSA.js} +70 -16
  15. package/dist/{chunk-NAVLCP4S.js → chunk-5RIBLY2N.js} +4 -4
  16. package/dist/{chunk-T5O2CUHV.js → chunk-5XUGJM3J.js} +1 -1
  17. package/dist/{chunk-HXT2RNH5.js → chunk-ADZHPN2B.js} +1 -1
  18. package/dist/chunk-B36ADEIR.js +21 -0
  19. package/dist/{chunk-DFZL3AX7.js → chunk-C73VBPEF.js} +9 -5
  20. package/dist/{chunk-WH4U2VUE.js → chunk-CPQKWCJ2.js} +13 -5
  21. package/dist/{chunk-LEUEKK4G.js → chunk-EU7T7EB3.js} +2 -2
  22. package/dist/{chunk-QLG5IK7F.js → chunk-G3Z2FEBR.js} +4 -4
  23. package/dist/{chunk-ZPY2UAKM.js → chunk-J4X7ICH4.js} +3 -3
  24. package/dist/{chunk-XX4BRMWF.js → chunk-K4LNUT5L.js} +1 -1
  25. package/dist/{chunk-CI4W6XAU.js → chunk-KC62VURU.js} +3 -3
  26. package/dist/chunk-N5TBYXHW.js +17 -0
  27. package/dist/{chunk-653KGQS2.js → chunk-OIKD7YDY.js} +2 -2
  28. package/dist/{chunk-LYTUTXQP.js → chunk-PBJYCE2Z.js} +46 -4
  29. package/dist/{chunk-EMB5PG7V.js → chunk-QC3NP47A.js} +1 -1
  30. package/dist/{chunk-IHA62NGJ.js → chunk-QKFVMIAV.js} +1 -1
  31. package/dist/{chunk-LXBMVGVB.js → chunk-QZ47OZ25.js} +3 -3
  32. package/dist/{chunk-ZTYCCBU3.js → chunk-VFPLWUT7.js} +44 -26
  33. package/dist/{chunk-RK7EPQPG.js → chunk-YFTBCCVH.js} +1 -1
  34. package/dist/data.cjs +71 -18
  35. package/dist/data.js +5 -5
  36. package/dist/datePicker-DxuxWpgF.d.cts +285 -0
  37. package/dist/datePicker-DxuxWpgF.d.ts +285 -0
  38. package/dist/devtools.cjs +71 -18
  39. package/dist/devtools.js +4 -4
  40. package/dist/ecosystem.cjs +82 -21
  41. package/dist/ecosystem.js +7 -7
  42. package/dist/extras.cjs +131 -23
  43. package/dist/extras.d.cts +2 -2
  44. package/dist/extras.d.ts +2 -2
  45. package/dist/extras.js +21 -20
  46. package/dist/index.cjs +115 -37
  47. package/dist/index.d.cts +59 -5
  48. package/dist/index.d.ts +59 -5
  49. package/dist/index.js +10 -10
  50. package/dist/motion.cjs +69 -16
  51. package/dist/motion.js +3 -3
  52. package/dist/patterns.cjs +71 -18
  53. package/dist/patterns.js +5 -5
  54. package/dist/performance.cjs +69 -16
  55. package/dist/performance.js +4 -4
  56. package/dist/plugins.cjs +1421 -996
  57. package/dist/plugins.d.cts +132 -3
  58. package/dist/plugins.d.ts +132 -3
  59. package/dist/plugins.js +262 -11
  60. package/dist/routeMiddleware-B1sp4P7a.d.ts +688 -0
  61. package/dist/routeMiddleware-CedQTsLK.d.cts +688 -0
  62. package/dist/ssr.cjs +3607 -3524
  63. package/dist/ssr.d.cts +20 -671
  64. package/dist/ssr.d.ts +20 -671
  65. package/dist/ssr.js +15 -7
  66. package/dist/testing.cjs +71 -18
  67. package/dist/testing.js +2 -2
  68. package/dist/ui.cjs +78 -18
  69. package/dist/ui.js +8 -7
  70. package/dist/widgets.cjs +1352 -952
  71. package/dist/widgets.d.cts +100 -268
  72. package/dist/widgets.d.ts +100 -268
  73. package/dist/widgets.js +316 -7
  74. package/package.json +9 -1
@@ -1,8 +1,8 @@
1
+ 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';
1
2
  import { A as Accessor } from './signal-EotCj4hS.cjs';
3
+ 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';
2
4
  import { C as Component$1, N as NodeChildren } from './types-CJFViL6Q.cjs';
3
5
  import { T as TrustedHTML } from './ssr-Db0Sgdu3.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';
6
6
 
7
7
  type Translations = Record<string, string>;
8
8
  /**
@@ -213,6 +213,16 @@ interface RouteBase {
213
213
  readonly path: string;
214
214
  readonly name?: string;
215
215
  readonly meta?: RouteMeta;
216
+ /**
217
+ * The document head while this route is committed: `title`, `description`,
218
+ * `canonical`, Open Graph (`og`) and extra `meta` entries. Values may be
219
+ * getters `(route) => string`, evaluated reactively. Nested records merge,
220
+ * the deepest winning; `createRouter({ head })` provides the defaults.
221
+ *
222
+ * The router manages the head only once some route (or the router) declares
223
+ * one, so an app without `head` is never touched.
224
+ */
225
+ readonly head?: RouteHead;
216
226
  readonly children?: RouteDef[];
217
227
  readonly beforeEnter?: Guard | Guard[];
218
228
  readonly alias?: string | string[];
@@ -306,6 +316,12 @@ interface RouterOptions {
306
316
  * - number — cache all routes with this max cache size
307
317
  */
308
318
  readonly keepAlive?: boolean | string[] | number;
319
+ /**
320
+ * Head defaults for every route, plus `titleTemplate`. Declaring it (or a
321
+ * `head` on any route) makes the router own `document.title` and the
322
+ * description / canonical / Open Graph tags; see {@link RouteBase.head}.
323
+ */
324
+ readonly head?: RouterHeadOptions;
309
325
  }
310
326
  type ScrollBehavior = (to: RouteContext, from: RouteContext, savedPosition: ScrollPosition | null) => ScrollPosition | null;
311
327
  interface ScrollPosition {
@@ -398,8 +414,16 @@ declare class SibuRouter {
398
414
  private cleanup;
399
415
  private destroyed;
400
416
  private navEpoch;
417
+ private headController;
418
+ private readonly readyPromise;
419
+ private resolveReady;
420
+ private loadedPromise;
401
421
  constructor(routes: RouteDef[], options?: RouterOptions);
402
422
  private initialize;
423
+ /** Load the component of every record the current route matched, without instantiating any. */
424
+ private preloadMatched;
425
+ /** Settles after the initial navigation and its component loads; see `routerReady()`. */
426
+ whenReady(): Promise<void>;
403
427
  private createInitialRoute;
404
428
  private handleLocationChange;
405
429
  private getCurrentPath;
@@ -412,6 +436,7 @@ declare class SibuRouter {
412
436
  }): Promise<NavigationResult>;
413
437
  private static readonly MAX_REDIRECT_DEPTH;
414
438
  private performNavigation;
439
+ private updateHead;
415
440
  private resolvePath;
416
441
  private isSameRoute;
417
442
  private updateHistory;
@@ -574,6 +599,26 @@ declare function router(): {
574
599
  beforeResolve: (guard: NavigationGuard) => (() => void) | undefined;
575
600
  afterEach: (hook: (to: RouteContext, from: RouteContext) => void) => (() => void) | undefined;
576
601
  };
602
+ /**
603
+ * Resolves once the router has resolved the page's initial location AND loaded
604
+ * the components that location matched (lazy route chunks included).
605
+ *
606
+ * Await it before `hydrate()` on a pre-rendered page: the client tree is then
607
+ * built with every route component already loaded, so the outlet renders in
608
+ * the same task and the swap from pre-rendered markup shows no empty frame.
609
+ * Also resolves if the initial navigation fails or the router is destroyed.
610
+ *
611
+ * @returns A promise that never rejects.
612
+ * @throws If no router has been created yet.
613
+ *
614
+ * @example
615
+ * ```ts
616
+ * createRouter(routes, { mode: "history" });
617
+ * await routerReady();
618
+ * hydrate(App, document.getElementById("app")!);
619
+ * ```
620
+ */
621
+ declare function routerReady(): Promise<void>;
577
622
  /**
578
623
  * Navigate to a target, running every registered guard.
579
624
  *
@@ -864,6 +909,90 @@ declare function createMemoryRouter(routes: RouteDef[], _initialPath?: string):
864
909
  push: (path: string) => Promise<NavigationResult>;
865
910
  };
866
911
 
912
+ /**
913
+ * One head value: a string, nothing, or a getter evaluated reactively against
914
+ * the committed route — so route params (`(r) => \`Order ${r.params.id}\``) and
915
+ * translated strings (`() => t("pricing.title")`) both work and stay current.
916
+ * `null` explicitly clears a value a parent route or the defaults set.
917
+ */
918
+ type RouteHeadValue = string | null | undefined | ((route: RouteContext) => string | null | undefined);
919
+ /** Open Graph tags a route can set. */
920
+ interface RouteHeadOpenGraph {
921
+ /** `og:title`. Defaults to the route's title (without `titleTemplate`). */
922
+ title?: RouteHeadValue;
923
+ /** `og:description`. Defaults to the route's description. */
924
+ description?: RouteHeadValue;
925
+ /** `og:image` — use an ABSOLUTE URL; link-preview bots do not resolve relative ones. */
926
+ image?: RouteHeadValue;
927
+ /** `og:url`. Defaults to the canonical URL. */
928
+ url?: RouteHeadValue;
929
+ /** `og:type`, e.g. `"website"` or `"article"`. */
930
+ type?: RouteHeadValue;
931
+ /** `og:site_name`. */
932
+ siteName?: RouteHeadValue;
933
+ }
934
+ /**
935
+ * The `head` of a route record (and of `createRouter({ head })`, as defaults).
936
+ *
937
+ * Nested records merge field by field, the deepest record winning; the router
938
+ * defaults sit underneath every route.
939
+ */
940
+ interface RouteHead {
941
+ /** `document.title`. */
942
+ title?: RouteHeadValue;
943
+ /** `<meta name="description">`. */
944
+ description?: RouteHeadValue;
945
+ /** `<link rel="canonical">` — use an absolute URL. */
946
+ canonical?: RouteHeadValue;
947
+ /** Open Graph tags. */
948
+ og?: RouteHeadOpenGraph;
949
+ /**
950
+ * Any other `<meta>` entries (`{ name: "robots", content: "noindex" }`,
951
+ * `{ name: "twitter:card", content: "summary_large_image" }`). Identified by
952
+ * their `name` or `property`; an entry with neither is ignored.
953
+ */
954
+ meta?: Record<string, RouteHeadValue>[];
955
+ }
956
+ /** Router-level head options: defaults for every route, plus the title template. */
957
+ interface RouterHeadOptions extends RouteHead {
958
+ /**
959
+ * Wraps every route title: `"%s · Studio"` or `(title) => \`${title} · Studio\``.
960
+ * Not applied to the default title itself.
961
+ */
962
+ titleTemplate?: string | ((title: string) => string);
963
+ }
964
+ /** One resolved `<head>` element, keyed by what it describes. */
965
+ interface ResolvedHeadTag {
966
+ /** Identity used to replace / remove the tag across navigations. */
967
+ key: string;
968
+ tag: "meta" | "link";
969
+ attrs: Record<string, string>;
970
+ }
971
+ /** The head a route resolves to. */
972
+ interface ResolvedRouteHead {
973
+ title: string | null;
974
+ tags: ResolvedHeadTag[];
975
+ }
976
+ /**
977
+ * Resolve the head a committed route renders: the router defaults, then every
978
+ * matched record from the root down. Getters are invoked here, so calling this
979
+ * inside an effect subscribes to whatever they read.
980
+ *
981
+ * @param route The committed route.
982
+ * @param defaults `createRouter({ head })`, if any.
983
+ * @returns The title and the tags, after the shared head policy.
984
+ */
985
+ declare function resolveRouteHead(route: RouteContext, defaults?: RouterHeadOptions): ResolvedRouteHead;
986
+ /**
987
+ * Serialize a resolved head to HTML, for SSR or a static page. Each tag carries
988
+ * the `data-sibu-head` marker so the client router adopts it on start-up
989
+ * instead of duplicating it.
990
+ *
991
+ * @param head The result of {@link resolveRouteHead}.
992
+ * @returns `<title>` plus one element per tag.
993
+ */
994
+ declare function routeHeadToHTML(head: ResolvedRouteHead): string;
995
+
867
996
  /**
868
997
  * Serializable route state that can be transferred from server to client.
869
998
  */
@@ -974,4 +1103,4 @@ declare function createSSRRouter(routes: SSRRouteDef[]): {
974
1103
  }) => string;
975
1104
  };
976
1105
 
977
- 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 NavigationQuery, type NavigationResult, type NavigationTarget, Outlet, type Params, type QueryValues, 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 };
1106
+ 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 NavigationQuery, type NavigationResult, type NavigationTarget, Outlet, type Params, type QueryValues, type RedirectRoute, type ResolvedHeadTag, type ResolvedRouteHead, Route, type RouteBase, type RouteContext, type RouteDef, type RouteHead, type RouteHeadOpenGraph, type RouteHeadValue, type RouteMeta, type RouteTransitionOptions, type RouterHeadOptions, 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, resolveRouteHead, resolveServerRoute, route, routeHeadToHTML, router, routerPlugin, routerReady, routerState, serializeRouteState, setLocale, setRouteTransition, setRoutes, t, translated };
package/dist/plugins.d.ts CHANGED
@@ -1,8 +1,8 @@
1
+ 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';
1
2
  import { A as Accessor } from './signal-EotCj4hS.js';
3
+ 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';
2
4
  import { C as Component$1, N as NodeChildren } from './types-CJFViL6Q.js';
3
5
  import { T as TrustedHTML } from './ssr-Db0Sgdu3.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';
6
6
 
7
7
  type Translations = Record<string, string>;
8
8
  /**
@@ -213,6 +213,16 @@ interface RouteBase {
213
213
  readonly path: string;
214
214
  readonly name?: string;
215
215
  readonly meta?: RouteMeta;
216
+ /**
217
+ * The document head while this route is committed: `title`, `description`,
218
+ * `canonical`, Open Graph (`og`) and extra `meta` entries. Values may be
219
+ * getters `(route) => string`, evaluated reactively. Nested records merge,
220
+ * the deepest winning; `createRouter({ head })` provides the defaults.
221
+ *
222
+ * The router manages the head only once some route (or the router) declares
223
+ * one, so an app without `head` is never touched.
224
+ */
225
+ readonly head?: RouteHead;
216
226
  readonly children?: RouteDef[];
217
227
  readonly beforeEnter?: Guard | Guard[];
218
228
  readonly alias?: string | string[];
@@ -306,6 +316,12 @@ interface RouterOptions {
306
316
  * - number — cache all routes with this max cache size
307
317
  */
308
318
  readonly keepAlive?: boolean | string[] | number;
319
+ /**
320
+ * Head defaults for every route, plus `titleTemplate`. Declaring it (or a
321
+ * `head` on any route) makes the router own `document.title` and the
322
+ * description / canonical / Open Graph tags; see {@link RouteBase.head}.
323
+ */
324
+ readonly head?: RouterHeadOptions;
309
325
  }
310
326
  type ScrollBehavior = (to: RouteContext, from: RouteContext, savedPosition: ScrollPosition | null) => ScrollPosition | null;
311
327
  interface ScrollPosition {
@@ -398,8 +414,16 @@ declare class SibuRouter {
398
414
  private cleanup;
399
415
  private destroyed;
400
416
  private navEpoch;
417
+ private headController;
418
+ private readonly readyPromise;
419
+ private resolveReady;
420
+ private loadedPromise;
401
421
  constructor(routes: RouteDef[], options?: RouterOptions);
402
422
  private initialize;
423
+ /** Load the component of every record the current route matched, without instantiating any. */
424
+ private preloadMatched;
425
+ /** Settles after the initial navigation and its component loads; see `routerReady()`. */
426
+ whenReady(): Promise<void>;
403
427
  private createInitialRoute;
404
428
  private handleLocationChange;
405
429
  private getCurrentPath;
@@ -412,6 +436,7 @@ declare class SibuRouter {
412
436
  }): Promise<NavigationResult>;
413
437
  private static readonly MAX_REDIRECT_DEPTH;
414
438
  private performNavigation;
439
+ private updateHead;
415
440
  private resolvePath;
416
441
  private isSameRoute;
417
442
  private updateHistory;
@@ -574,6 +599,26 @@ declare function router(): {
574
599
  beforeResolve: (guard: NavigationGuard) => (() => void) | undefined;
575
600
  afterEach: (hook: (to: RouteContext, from: RouteContext) => void) => (() => void) | undefined;
576
601
  };
602
+ /**
603
+ * Resolves once the router has resolved the page's initial location AND loaded
604
+ * the components that location matched (lazy route chunks included).
605
+ *
606
+ * Await it before `hydrate()` on a pre-rendered page: the client tree is then
607
+ * built with every route component already loaded, so the outlet renders in
608
+ * the same task and the swap from pre-rendered markup shows no empty frame.
609
+ * Also resolves if the initial navigation fails or the router is destroyed.
610
+ *
611
+ * @returns A promise that never rejects.
612
+ * @throws If no router has been created yet.
613
+ *
614
+ * @example
615
+ * ```ts
616
+ * createRouter(routes, { mode: "history" });
617
+ * await routerReady();
618
+ * hydrate(App, document.getElementById("app")!);
619
+ * ```
620
+ */
621
+ declare function routerReady(): Promise<void>;
577
622
  /**
578
623
  * Navigate to a target, running every registered guard.
579
624
  *
@@ -864,6 +909,90 @@ declare function createMemoryRouter(routes: RouteDef[], _initialPath?: string):
864
909
  push: (path: string) => Promise<NavigationResult>;
865
910
  };
866
911
 
912
+ /**
913
+ * One head value: a string, nothing, or a getter evaluated reactively against
914
+ * the committed route — so route params (`(r) => \`Order ${r.params.id}\``) and
915
+ * translated strings (`() => t("pricing.title")`) both work and stay current.
916
+ * `null` explicitly clears a value a parent route or the defaults set.
917
+ */
918
+ type RouteHeadValue = string | null | undefined | ((route: RouteContext) => string | null | undefined);
919
+ /** Open Graph tags a route can set. */
920
+ interface RouteHeadOpenGraph {
921
+ /** `og:title`. Defaults to the route's title (without `titleTemplate`). */
922
+ title?: RouteHeadValue;
923
+ /** `og:description`. Defaults to the route's description. */
924
+ description?: RouteHeadValue;
925
+ /** `og:image` — use an ABSOLUTE URL; link-preview bots do not resolve relative ones. */
926
+ image?: RouteHeadValue;
927
+ /** `og:url`. Defaults to the canonical URL. */
928
+ url?: RouteHeadValue;
929
+ /** `og:type`, e.g. `"website"` or `"article"`. */
930
+ type?: RouteHeadValue;
931
+ /** `og:site_name`. */
932
+ siteName?: RouteHeadValue;
933
+ }
934
+ /**
935
+ * The `head` of a route record (and of `createRouter({ head })`, as defaults).
936
+ *
937
+ * Nested records merge field by field, the deepest record winning; the router
938
+ * defaults sit underneath every route.
939
+ */
940
+ interface RouteHead {
941
+ /** `document.title`. */
942
+ title?: RouteHeadValue;
943
+ /** `<meta name="description">`. */
944
+ description?: RouteHeadValue;
945
+ /** `<link rel="canonical">` — use an absolute URL. */
946
+ canonical?: RouteHeadValue;
947
+ /** Open Graph tags. */
948
+ og?: RouteHeadOpenGraph;
949
+ /**
950
+ * Any other `<meta>` entries (`{ name: "robots", content: "noindex" }`,
951
+ * `{ name: "twitter:card", content: "summary_large_image" }`). Identified by
952
+ * their `name` or `property`; an entry with neither is ignored.
953
+ */
954
+ meta?: Record<string, RouteHeadValue>[];
955
+ }
956
+ /** Router-level head options: defaults for every route, plus the title template. */
957
+ interface RouterHeadOptions extends RouteHead {
958
+ /**
959
+ * Wraps every route title: `"%s · Studio"` or `(title) => \`${title} · Studio\``.
960
+ * Not applied to the default title itself.
961
+ */
962
+ titleTemplate?: string | ((title: string) => string);
963
+ }
964
+ /** One resolved `<head>` element, keyed by what it describes. */
965
+ interface ResolvedHeadTag {
966
+ /** Identity used to replace / remove the tag across navigations. */
967
+ key: string;
968
+ tag: "meta" | "link";
969
+ attrs: Record<string, string>;
970
+ }
971
+ /** The head a route resolves to. */
972
+ interface ResolvedRouteHead {
973
+ title: string | null;
974
+ tags: ResolvedHeadTag[];
975
+ }
976
+ /**
977
+ * Resolve the head a committed route renders: the router defaults, then every
978
+ * matched record from the root down. Getters are invoked here, so calling this
979
+ * inside an effect subscribes to whatever they read.
980
+ *
981
+ * @param route The committed route.
982
+ * @param defaults `createRouter({ head })`, if any.
983
+ * @returns The title and the tags, after the shared head policy.
984
+ */
985
+ declare function resolveRouteHead(route: RouteContext, defaults?: RouterHeadOptions): ResolvedRouteHead;
986
+ /**
987
+ * Serialize a resolved head to HTML, for SSR or a static page. Each tag carries
988
+ * the `data-sibu-head` marker so the client router adopts it on start-up
989
+ * instead of duplicating it.
990
+ *
991
+ * @param head The result of {@link resolveRouteHead}.
992
+ * @returns `<title>` plus one element per tag.
993
+ */
994
+ declare function routeHeadToHTML(head: ResolvedRouteHead): string;
995
+
867
996
  /**
868
997
  * Serializable route state that can be transferred from server to client.
869
998
  */
@@ -974,4 +1103,4 @@ declare function createSSRRouter(routes: SSRRouteDef[]): {
974
1103
  }) => string;
975
1104
  };
976
1105
 
977
- 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 NavigationQuery, type NavigationResult, type NavigationTarget, Outlet, type Params, type QueryValues, 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 };
1106
+ 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 NavigationQuery, type NavigationResult, type NavigationTarget, Outlet, type Params, type QueryValues, type RedirectRoute, type ResolvedHeadTag, type ResolvedRouteHead, Route, type RouteBase, type RouteContext, type RouteDef, type RouteHead, type RouteHeadOpenGraph, type RouteHeadValue, type RouteMeta, type RouteTransitionOptions, type RouterHeadOptions, 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, resolveRouteHead, resolveServerRoute, route, routeHeadToHTML, router, routerPlugin, routerReady, routerState, serializeRouteState, setLocale, setRouteTransition, setRoutes, t, translated };