@ilha/router 0.8.9 → 0.8.11

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.
package/dist/index.d.ts CHANGED
@@ -359,8 +359,12 @@ export interface LinkInterceptionOptions {
359
359
  prefetch?: boolean;
360
360
  }
361
361
  export declare function enableLinkInterception(root?: Element | Document, options?: LinkInterceptionOptions): () => void;
362
- export declare const RouterView: Island<Record<string, unknown>, Record<never, never>>;
363
- export declare const RouterLink: Island<Record<string, unknown>, Omit<Omit<Record<never, never>, K> & Record<"href", string>, "label"> & Record<"label", string>>;
362
+ export declare const RouterView: Island<{
363
+ [x: string]: unknown;
364
+ }, {}>;
365
+ export declare const RouterLink: Island<{
366
+ [x: string]: unknown;
367
+ }, Omit<Omit<{}, K> & Record<"href", string>, "label"> & Record<"label", string>>;
364
368
  export interface IsActiveOptions {
365
369
  /**
366
370
  * When `false`, `isActive("/docs")` also matches nested paths like
@@ -395,8 +399,12 @@ declare const _default: {
395
399
  prefetch: typeof prefetch;
396
400
  beforeNavigate: typeof beforeNavigate;
397
401
  afterNavigate: typeof afterNavigate;
398
- RouterView: Island<Record<string, unknown>, Record<never, never>>;
399
- RouterLink: Island<Record<string, unknown>, Omit<Omit<Record<never, never>, K> & Record<"href", string>, "label"> & Record<"label", string>>;
402
+ RouterView: Island<{
403
+ [x: string]: unknown;
404
+ }, {}>;
405
+ RouterLink: Island<{
406
+ [x: string]: unknown;
407
+ }, Omit<Omit<{}, K> & Record<"href", string>, "label"> & Record<"label", string>>;
400
408
  loader: typeof loader;
401
409
  redirect: typeof redirect;
402
410
  error: typeof error;
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { A as wrapLayout, C as routePath, D as src_default, E as serializeHead, M as setHistoryMode, O as useRoute, S as routeParams, T as router, _ as navigating, a as RouterView, b as redirect, c as composeLoaders, d as error, f as head, g as navigate, h as loader, i as RouterLink, j as getHistoryMode, k as wrapError, l as defineLayout, m as isActive, n as LoaderError, o as afterNavigate, p as invalidate, r as Redirect, s as beforeNavigate, t as LOADER_ENDPOINT, u as enableLinkInterception, v as prefetch, w as routeSearch, x as routeHash, y as prime } from "./src-Dfq3JPRz.js";
1
+ import { A as wrapLayout, C as routePath, D as src_default, E as serializeHead, M as setHistoryMode, O as useRoute, S as routeParams, T as router, _ as navigating, a as RouterView, b as redirect, c as composeLoaders, d as error, f as head, g as navigate, h as loader, i as RouterLink, j as getHistoryMode, k as wrapError, l as defineLayout, m as isActive, n as LoaderError, o as afterNavigate, p as invalidate, r as Redirect, s as beforeNavigate, t as LOADER_ENDPOINT, u as enableLinkInterception, v as prefetch, w as routeSearch, x as routeHash, y as prime } from "./src-BKWkRtMx.js";
2
2
 
3
3
  export { LOADER_ENDPOINT, LoaderError, Redirect, RouterLink, RouterView, afterNavigate, beforeNavigate, composeLoaders, src_default as default, defineLayout, enableLinkInterception, error, getHistoryMode, head, invalidate, isActive, loader, navigate, navigating, prefetch, prime, redirect, routeHash, routeParams, routePath, routeSearch, router, serializeHead, setHistoryMode, useRoute, wrapError, wrapLayout };
@@ -333,10 +333,11 @@ function wrapLayout(layout, page) {
333
333
  const layoutInputRef = {};
334
334
  const KeyedPage = ((props) => {
335
335
  const merged = layoutInputRef.merged;
336
- return rawKeyedPage(merged && typeof merged === "object" ? {
336
+ const slotProps = merged && typeof merged === "object" ? {
337
337
  ...merged,
338
338
  ...props ?? {}
339
- } : props);
339
+ } : props;
340
+ return rawKeyedPage(slotProps);
340
341
  });
341
342
  Object.assign(KeyedPage, { toString: page.toString.bind(page) });
342
343
  KeyedPage[ISLAND_CALL] = true;
@@ -941,8 +942,11 @@ const _activeIslandSig = context("router.active", null);
941
942
  function activeIsland(value) {
942
943
  const store = activeRouteStore();
943
944
  if (arguments.length > 0) {
944
- if (store) return store.island = value ?? null;
945
- return _activeIslandSig(value ?? null), value ?? null;
945
+ const next = value ?? null;
946
+ if (store) return store.island = next;
947
+ if (next === null) _activeIslandSig(null);
948
+ else _activeIslandSig(() => next);
949
+ return next;
946
950
  }
947
951
  return store ? store.island : _activeIslandSig();
948
952
  }
package/dist/ssr.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as LOADER_ENDPOINT } from "./src-Dfq3JPRz.js";
1
+ import { t as LOADER_ENDPOINT } from "./src-BKWkRtMx.js";
2
2
  import { pageRouter, registry } from "ilha:pages/server";
3
3
  import "ilha:loaders";
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilha/router",
3
- "version": "0.8.9",
3
+ "version": "0.8.11",
4
4
  "description": "A tiny SPA router for Ilha",
5
5
  "keywords": [
6
6
  "frontend",
@@ -64,14 +64,14 @@
64
64
  "test": "bun test"
65
65
  },
66
66
  "dependencies": {
67
- "rou3": "0.9.0",
67
+ "rou3": "0.9.1",
68
68
  "unplugin": "3.3.0"
69
69
  },
70
70
  "devDependencies": {
71
- "ilha": "0.9.5",
72
- "vite": "^8.1.3"
71
+ "ilha": "0.10.1",
72
+ "vite": "^8.1.5"
73
73
  },
74
74
  "peerDependencies": {
75
- "ilha": ">=0.9.5"
75
+ "ilha": ">=0.10.1"
76
76
  }
77
77
  }