@askrjs/askr 0.0.84 → 0.0.85

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 (64) hide show
  1. package/dist/{access-ePqdQqkV.js → access-Dpfoi4cA.js} +7 -1
  2. package/dist/actions/index.d.ts +1 -1
  3. package/dist/actions/index.js +1 -1
  4. package/dist/{activity-pySy9t7Y.d.ts → activity-B1I5HJQI.d.ts} +1 -1
  5. package/dist/{activity-CZiPgZy0.js → activity-Jd9CgEa3.js} +52 -15
  6. package/dist/{authoring-DQPG0VAm.js → authoring-DdQ3pHqt.js} +6 -3
  7. package/dist/benchmark.js +8 -8
  8. package/dist/boot/index.d.ts +3 -3
  9. package/dist/boot/index.js +1 -1
  10. package/dist/{boot-D28lesMw.js → boot-DWe880Et.js} +16 -15
  11. package/dist/{cleanup-ARiXproi.js → cleanup-c837KVij.js} +16 -6
  12. package/dist/{component-cleanup-Bug5tSiG.js → component-cleanup-BUfUleGZ.js} +2 -2
  13. package/dist/{component-internal-Bw4Mf9fd.js → component-internal-DcrLymUJ.js} +5 -5
  14. package/dist/components/index.d.ts +1 -1
  15. package/dist/components/index.js +1 -1
  16. package/dist/control/index.d.ts +1 -1
  17. package/dist/control/index.js +1 -1
  18. package/dist/{control-Y8F73Uln.d.ts → control-DhUZU4_V.d.ts} +2 -1
  19. package/dist/{control-nrS65oG3.js → control-oLADku43.js} +4 -4
  20. package/dist/{csp-nonce-ZTlD_EnK.js → csp-nonce-Bc52OIVc.js} +19 -2
  21. package/dist/data/index.js +1 -1
  22. package/dist/{data-BRS5woEh.js → data-Dkqb8_QP.js} +3 -3
  23. package/dist/{deferred-oqtAJ4iH.js → deferred-vUOy-awa.js} +198 -16
  24. package/dist/{effect-B487asyz.js → effect-lnxQIpJG.js} +2 -2
  25. package/dist/{fastlane-BOr4lSLl.js → fastlane-CrfB3QG0.js} +2 -2
  26. package/dist/{for-internal-DjpV8ioj.js → for-internal-B_mnQhan.js} +18 -6
  27. package/dist/foundations/index.d.ts +1 -1
  28. package/dist/foundations/index.js +2 -2
  29. package/dist/foundations/state/index.d.ts +1 -1
  30. package/dist/foundations/state/index.js +1 -1
  31. package/dist/foundations/structures/index.d.ts +2 -2
  32. package/dist/foundations/structures/index.js +3 -3
  33. package/dist/fx/index.js +1 -1
  34. package/dist/{index-BApH3laU.d.ts → index-Bkh9S9-t.d.ts} +6 -2
  35. package/dist/{index-_UN08Pg1.d.ts → index-pIgGaXvS.d.ts} +19 -3
  36. package/dist/{index-DUXXZ31H.d.ts → index-r-nt13FE.d.ts} +1 -1
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.js +10 -10
  39. package/dist/{lifecycle-batch-CFI4NKpJ.js → lifecycle-batch-Dfpid9-A.js} +39 -20
  40. package/dist/{lifecycle-operations-KYOIcM5R.js → lifecycle-operations-BrYrBsXY.js} +1 -1
  41. package/dist/{navigate-CgVIrrSs.d.ts → navigate-NyIjQUwI.d.ts} +1 -1
  42. package/dist/{navigate-Dr3cjOSz.js → navigate-b4GGxO_l.js} +15 -14
  43. package/dist/{portal-pHBoqwYd.js → portal-BVWjAhNQ.js} +5 -5
  44. package/dist/{readable-_GQGe_St.js → readable-B5NtV7V0.js} +1 -1
  45. package/dist/{renderer-B9j5IV1q.js → renderer-CZzNtoj2.js} +57 -16
  46. package/dist/resources/index.d.ts +2 -2
  47. package/dist/resources/index.js +5 -5
  48. package/dist/{route-matching-IfQZmqkN.js → route-matching-DHduNiGk.js} +49 -6
  49. package/dist/router/index.d.ts +7 -7
  50. package/dist/router/index.js +9 -7
  51. package/dist/{selector-DJ1-N1K-.js → selector-Ck_Pp9av.js} +2 -2
  52. package/dist/ssg/index.d.ts +9 -3
  53. package/dist/ssg/index.js +30 -15
  54. package/dist/ssr/index.d.ts +7 -3
  55. package/dist/ssr/index.js +1 -1
  56. package/dist/{ssr-CtC4lChT.js → ssr-CpiBHMNv.js} +29 -18
  57. package/dist/ssr-DSHd_Q9K.js +25 -0
  58. package/dist/{state-BzIMC6-i.js → state-DCjONcHK.js} +4 -3
  59. package/dist/{structures-D3vO-WMN.js → structures-DSLF_iis.js} +4 -2
  60. package/dist/testing/index.d.ts +2 -2
  61. package/dist/testing/index.js +3 -3
  62. package/dist/{verify-hydration-BguOSco9.js → verify-hydration-C3QBBQqR.js} +2 -2
  63. package/package.json +1 -1
  64. package/dist/ssr-CbQO5xd3.js +0 -12
@@ -1,3 +1,4 @@
1
+ import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-DzJEbYGE.js";
1
2
  //#region src/common/env.ts
2
3
  function normalizeEnv(source) {
3
4
  if (!source) return {};
@@ -471,7 +472,12 @@ function enqueueRuntimeLane(lane, task) {
471
472
  getRuntimeScheduler().enqueueInLane(lane, task);
472
473
  }
473
474
  function runRuntimeHandlerScope(fn, flushMode = "defer") {
474
- return getRuntimeScheduler().runInHandlerScope(fn, flushMode);
475
+ const savedScope = clearCurrentComponentScope();
476
+ try {
477
+ return getRuntimeScheduler().runInHandlerScope(fn, flushMode);
478
+ } finally {
479
+ restoreCurrentComponentScope(savedScope);
480
+ }
475
481
  }
476
482
  function runRuntimeWithSyncProgress(fn) {
477
483
  return getRuntimeScheduler().runWithSyncProgress(fn);
@@ -1,2 +1,2 @@
1
- import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-_UN08Pg1.js";
1
+ import { a as action, i as ActionValidationError, n as ActionForm, o as defineAction, r as ActionStatus, t as ActionDescriptor } from "../index-pIgGaXvS.js";
2
2
  export { ActionDescriptor, ActionForm, ActionStatus, ActionValidationError, action, defineAction };
@@ -1,6 +1,6 @@
1
1
  import { d as getCurrentAppRenderRuntime } from "../component-scope-DzJEbYGE.js";
2
2
  import { r as getCurrentRenderData } from "../render-context-D-DFk2WN.js";
3
- import { t as state } from "../state-BzIMC6-i.js";
3
+ import { t as state } from "../state-DCjONcHK.js";
4
4
  import { jsx, jsxs } from "../jsx-runtime.js";
5
5
  import { c as resolveDataRuntimeState, s as invalidateQueriesForRuntime } from "../data-runtime-D68YOo9L.js";
6
6
  //#region src/actions/runtime.ts
@@ -1,4 +1,4 @@
1
- import { L as RouteParams, Z as RouteSnapshot } from "./index-_UN08Pg1.js";
1
+ import { L as RouteParams, Z as RouteSnapshot } from "./index-pIgGaXvS.js";
2
2
  //#region src/router/activity.d.ts
3
3
  interface RouteChangeOptions {
4
4
  immediate?: boolean;
@@ -1,8 +1,8 @@
1
- import { a as registerCommitOperation } from "./component-internal-Bw4Mf9fd.js";
2
- import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-_GQGe_St.js";
3
1
  import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
2
+ import { a as registerCommitOperation } from "./component-internal-DcrLymUJ.js";
3
+ import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
4
4
  import { n as getActiveRenderContext } from "./render-context-D-DFk2WN.js";
5
- import { c as deepFreeze, g as getActiveRoutes, l as makeQuery, n as computeMatchesFromRoutes, u as parseLocation } from "./route-matching-IfQZmqkN.js";
5
+ import { b as getActiveRoutes, c as removeRouteBasePath, d as deepFreeze, f as makeQuery, n as computeMatchesFromRoutes, p as parseLocation, y as getActiveRouteBasePath } from "./route-matching-DHduNiGk.js";
6
6
  import { n as syncRouteActivitySnapshot } from "./route-activity-CNJfpwx-.js";
7
7
  //#region src/common/app-render-runtime.ts
8
8
  const stagedRouteLocations = /* @__PURE__ */ new WeakMap();
@@ -79,18 +79,34 @@ function onRouteChange(fn, options = {}) {
79
79
  });
80
80
  }
81
81
  let serverLocation = null;
82
+ function logicalRoutePathname(pathname) {
83
+ const logical = removeRouteBasePath(pathname, getActiveRouteBasePath());
84
+ return logical === void 0 ? void 0 : parseLocation(logical).pathname;
85
+ }
86
+ function routePathname(pathname) {
87
+ const logical = logicalRoutePathname(pathname);
88
+ return logical === void 0 ? {
89
+ pathname: parseLocation(pathname).pathname,
90
+ withinBasePath: false
91
+ } : {
92
+ pathname: logical,
93
+ withinBasePath: true
94
+ };
95
+ }
82
96
  function setServerLocation(url) {
83
97
  serverLocation = url;
84
98
  if (url) {
85
- const parsed = parseLocation(url);
86
- syncRouteActivitySnapshot(parsed.pathname, computeMatchesFromRoutes(parsed.pathname, getActiveRoutes()));
99
+ const location = routePathname(parseLocation(url).pathname);
100
+ syncRouteActivitySnapshot(location.pathname, location.withinBasePath ? computeMatchesFromRoutes(location.pathname, getActiveRoutes()) : []);
87
101
  return;
88
102
  }
89
103
  syncRouteActivitySnapshot(currentRouteSnapshot.path, currentRouteSnapshot.matches);
90
104
  }
91
105
  function buildRouteSnapshot(pathname, search, hash) {
106
+ const location = routePathname(pathname);
107
+ pathname = location.pathname;
92
108
  const query = makeQuery(search);
93
- const matches = computeMatchesFromRoutes(pathname, getActiveRoutes());
109
+ const matches = location.withinBasePath ? computeMatchesFromRoutes(pathname, getActiveRoutes()) : [];
94
110
  return Object.freeze({
95
111
  path: pathname,
96
112
  params: deepFreeze({ ...matches[0]?.params }),
@@ -101,7 +117,7 @@ function buildRouteSnapshot(pathname, search, hash) {
101
117
  }
102
118
  function setCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
103
119
  currentRouteSnapshot = buildRouteSnapshot(pathname, search, hash);
104
- syncRouteActivitySnapshot(pathname, activityMatches ?? currentRouteSnapshot.matches);
120
+ syncRouteActivitySnapshot(currentRouteSnapshot.path, activityMatches ?? currentRouteSnapshot.matches);
105
121
  const instance = getCurrentComponentInstance();
106
122
  markReadableDerivedSubscribersDirty(currentRouteSource);
107
123
  markReactivePropsDirtySource(currentRouteSource);
@@ -109,27 +125,48 @@ function setCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
109
125
  }
110
126
  function readCurrentRouteLocation() {
111
127
  const renderContext = getActiveRenderContext();
112
- if (renderContext?.url) return parseLocation(renderContext.url);
128
+ if (renderContext?.url) {
129
+ const parsed = parseLocation(renderContext.url);
130
+ const location = routePathname(parsed.pathname);
131
+ return {
132
+ ...parsed,
133
+ ...location
134
+ };
135
+ }
113
136
  const stagedRouteLocation = getStagedAppRenderRouteLocation(getCurrentAppRenderRuntime());
114
- if (stagedRouteLocation) return parseLocation(stagedRouteLocation);
137
+ if (stagedRouteLocation) {
138
+ const parsed = parseLocation(stagedRouteLocation);
139
+ const location = routePathname(parsed.pathname);
140
+ return {
141
+ ...parsed,
142
+ ...location
143
+ };
144
+ }
115
145
  if (typeof window !== "undefined" && window.location) return {
116
- pathname: window.location.pathname || "/",
146
+ ...routePathname(window.location.pathname || "/"),
117
147
  search: window.location.search || "",
118
148
  hash: window.location.hash || ""
119
149
  };
120
- if (serverLocation) return parseLocation(serverLocation);
150
+ if (serverLocation) {
151
+ const parsed = parseLocation(serverLocation);
152
+ const location = routePathname(parsed.pathname);
153
+ return {
154
+ ...parsed,
155
+ ...location
156
+ };
157
+ }
121
158
  return {
122
- pathname: currentRouteSnapshot.path,
159
+ ...routePathname(currentRouteSnapshot.path),
123
160
  search: "",
124
161
  hash: currentRouteSnapshot.hash ?? ""
125
162
  };
126
163
  }
127
164
  function readCurrentRouteSnapshot() {
128
165
  if (!getCurrentComponentInstance()) throw new Error("currentRoute() can only be called during component render execution. Call currentRoute() from inside your component function.");
129
- const { pathname, search, hash } = readCurrentRouteLocation();
166
+ const { pathname, search, hash, withinBasePath } = readCurrentRouteLocation();
130
167
  const query = makeQuery(search);
131
- const matches = computeMatchesFromRoutes(pathname, getActiveRoutes());
132
- const params = deepFreeze({ ...getActiveRenderContext()?.params ?? matches[0]?.params ?? {} });
168
+ const matches = withinBasePath ? computeMatchesFromRoutes(pathname, getActiveRoutes()) : [];
169
+ const params = deepFreeze({ ...(withinBasePath ? getActiveRenderContext()?.params : void 0) ?? matches[0]?.params ?? {} });
133
170
  return Object.freeze({
134
171
  path: pathname,
135
172
  params,
@@ -1,6 +1,6 @@
1
1
  import { f as getCurrentComponentInstance } from "./component-scope-DzJEbYGE.js";
2
- import { E as getExecutionModel, x as createRouteHandler } from "./deferred-oqtAJ4iH.js";
3
- import { A as insertRecordSorted, C as getCurrentPathPrefix, I as computeRank, L as normalizeRouteSegmentName, M as pushRegistrationScope, O as hasActivePageScope, R as parseSegments, S as getCurrentPageScope, _ as getCurrentInheritedAuthRequirements, b as getCurrentLayoutChain, f as addRouteToStores, p as assertRouteRegistrationUnlocked, v as getCurrentInheritedMeta, w as getCurrentScopeKind, x as getCurrentPageChain, y as getCurrentInheritedPolicies } from "./route-matching-IfQZmqkN.js";
2
+ import { A as getExecutionModel, T as createRouteHandler } from "./deferred-vUOy-awa.js";
3
+ import { A as getDefaultRouteBasePath, C as getCurrentInheritedPolicies, D as getCurrentPathPrefix, E as getCurrentPageScope, F as insertRecordSorted, H as computeRank, L as pushRegistrationScope, N as hasActivePageScope, O as getCurrentScopeKind, S as getCurrentInheritedMeta, T as getCurrentPageChain, U as normalizeRouteSegmentName, W as parseSegments, g as assertRouteRegistrationUnlocked, h as addRouteToStores, w as getCurrentLayoutChain, x as getCurrentInheritedAuthRequirements } from "./route-matching-DHduNiGk.js";
4
4
  import { allOf } from "@askrjs/auth";
5
5
  //#region src/router/access.ts
6
6
  function compileNodePolicies(node) {
@@ -92,11 +92,13 @@ function pushPageScope(path, Component, options, fn) {
92
92
  function normalizeRouteOptions(options) {
93
93
  if (!options) return;
94
94
  const loader = options.loader;
95
+ const dehydrate = options.dehydrate;
95
96
  const preload = options.preload;
96
97
  const policies = compileNodePolicies(options);
97
- if (!loader && !preload && !options.entries && policies.length === 0 && !options.title && !options.namespace && !options.search && !options.meta && !options.actions && options.auth === void 0) return;
98
+ if (!loader && !dehydrate && !preload && !options.entries && policies.length === 0 && !options.title && !options.namespace && !options.search && !options.meta && !options.actions && options.auth === void 0) return;
98
99
  return {
99
100
  ...loader ? { loader } : {},
101
+ ...dehydrate ? { dehydrate } : {},
100
102
  ...preload ? { preload } : {},
101
103
  ...options.entries ? { entries: options.entries } : {},
102
104
  ...options.auth !== void 0 ? { auth: options.auth } : {},
@@ -193,6 +195,7 @@ function route(path, Component, options) {
193
195
  registerRouteAtResolvedPath(resolveRouteRegistrationPath(path), Component, options);
194
196
  return Object.freeze({
195
197
  path: resolveRouteRegistrationPath(path),
198
+ ...getDefaultRouteBasePath() ? { basePath: getDefaultRouteBasePath() } : {},
196
199
  ...options?.search ? { searchSchema: options.search } : {}
197
200
  });
198
201
  }
package/dist/benchmark.js CHANGED
@@ -1,10 +1,10 @@
1
- import { r as flushRuntimeScheduler } from "./access-ePqdQqkV.js";
2
- import { t as installRendererBridge } from "./renderer-B9j5IV1q.js";
3
- import { t as state } from "./state-BzIMC6-i.js";
4
- import { t as selector } from "./selector-DJ1-N1K-.js";
5
- import { i as For } from "./control-nrS65oG3.js";
1
+ import { r as flushRuntimeScheduler } from "./access-Dpfoi4cA.js";
2
+ import { t as installRendererBridge } from "./renderer-CZzNtoj2.js";
3
+ import { t as state } from "./state-DCjONcHK.js";
4
+ import { t as selector } from "./selector-Ck_Pp9av.js";
5
+ import { i as For } from "./control-oLADku43.js";
6
6
  import { jsx, jsxs } from "./jsx-runtime.js";
7
- import { t as createIsland } from "./boot-D28lesMw.js";
7
+ import { t as createIsland } from "./boot-DWe880Et.js";
8
8
  //#region src/bench/components/benchmark-row.tsx
9
9
  function BenchmarkRow({ item, isSelected, onSelect, onRemove }) {
10
10
  return /* @__PURE__ */ jsxs("tr", {
@@ -63,8 +63,8 @@ function BenchmarkTable({ rows, isSelected, onSelect, onRemove }) {
63
63
  installRendererBridge();
64
64
  const benchmarkMetadata = {
65
65
  packageName: "@askrjs/askr",
66
- packageVersion: "0.0.84",
67
- buildLabel: "0.0.84-local"
66
+ packageVersion: "0.0.85",
67
+ buildLabel: "0.0.85-local"
68
68
  };
69
69
  function getBenchmarkMetadata() {
70
70
  return { ...benchmarkMetadata };
@@ -1,7 +1,7 @@
1
- import { l as ComponentFunction } from "../control-Y8F73Uln.js";
2
- import { W as RouteRegistry, w as RouteAuthOptions } from "../index-_UN08Pg1.js";
1
+ import { l as ComponentFunction } from "../control-DhUZU4_V.js";
2
+ import { W as RouteRegistry, w as RouteAuthOptions } from "../index-pIgGaXvS.js";
3
3
  import { v as DataRuntime } from "../index-5S-fi2xy.js";
4
- import { a as ScrollRestorationOptions } from "../navigate-CgVIrrSs.js";
4
+ import { a as ScrollRestorationOptions } from "../navigate-NyIjQUwI.js";
5
5
  //#region src/boot/types.d.ts
6
6
  type IslandConfig = {
7
7
  root: Element | string;
@@ -1,2 +1,2 @@
1
- import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-D28lesMw.js";
1
+ import { a as cleanupApp, i as hydrateSPA, n as createIslands, o as hasApp, r as createSPA, t as createIsland } from "../boot-DWe880Et.js";
2
2
  export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
@@ -1,20 +1,20 @@
1
- import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
1
+ import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-Dpfoi4cA.js";
2
2
  import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
3
- import { n as createComponentInstance, r as executeComponent } from "./component-internal-Bw4Mf9fd.js";
4
- import { t as cleanupComponent } from "./component-cleanup-Bug5tSiG.js";
5
- import { p as isPromiseLike } from "./lifecycle-batch-CFI4NKpJ.js";
6
- import { a as setStaticChildSlotsCacheEnabled, c as endHydrationDirectListenerMode, d as discardHydrationListenerTransaction, i as registerDeferredHydrationBoundary, l as beginHydrationListenerTransaction, n as activateHydrationBoundary$1, o as withIntrinsicHydrationAdoption, r as clearDeferredHydrationBoundaries, s as beginHydrationDirectListenerMode, t as installRendererBridge, u as commitHydrationListenerTransaction } from "./renderer-B9j5IV1q.js";
7
- import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-ARiXproi.js";
8
- import { T as assertExecutionModel, c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData, v as pageRenderEnvelope } from "./deferred-oqtAJ4iH.js";
3
+ import { n as createComponentInstance, r as executeComponent } from "./component-internal-DcrLymUJ.js";
4
+ import { t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
5
+ import { p as isPromiseLike } from "./lifecycle-batch-Dfpid9-A.js";
6
+ import { a as setStaticChildSlotsCacheEnabled, c as endHydrationDirectListenerMode, d as discardHydrationListenerTransaction, i as registerDeferredHydrationBoundary, l as beginHydrationListenerTransaction, n as activateHydrationBoundary$1, o as withIntrinsicHydrationAdoption, r as clearDeferredHydrationBoundaries, s as beginHydrationDirectListenerMode, t as installRendererBridge, u as commitHydrationListenerTransaction } from "./renderer-CZzNtoj2.js";
7
+ import { _ as teardownNodeSubtree, d as removeAllListeners } from "./cleanup-c837KVij.js";
8
+ import { S as pageRenderEnvelope, c as _applyManifest, d as getRouteRenderContext, f as getRouteRenderData, k as assertExecutionModel, m as resolveRouteRequest, o as reviveDeferredValue, p as hasRouteRenderData } from "./deferred-vUOy-awa.js";
9
9
  import { c as stopHydrationRenderPhase, o as startHydrationRenderPhase } from "./render-context-D-DFk2WN.js";
10
- import { d as _setActiveRouteAuthOptions, j as lockRouteRegistration, k as hasRegisteredRoutes, m as clearRouteState } from "./route-matching-IfQZmqkN.js";
11
- import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-pHBoqwYd.js";
12
- import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-ZTlD_EnK.js";
10
+ import { I as lockRouteRegistration, P as hasRegisteredRoutes, _ as clearRouteState, m as _setActiveRouteAuthOptions } from "./route-matching-DHduNiGk.js";
11
+ import { a as disposeDefaultPortalScope, t as DefaultPortal } from "./portal-BVWjAhNQ.js";
12
+ import { r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-Bc52OIVc.js";
13
13
  import { i as getDefaultDataRuntime } from "./data-runtime-D68YOo9L.js";
14
14
  import { a as hydrateDataRuntime } from "./query-registry-BL6rjGsO.js";
15
- import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-CZiPgZy0.js";
16
- import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-Dr3cjOSz.js";
17
- import "./ssr-CbQO5xd3.js";
15
+ import { o as createAppRenderRuntime, r as setServerLocation } from "./activity-Jd9CgEa3.js";
16
+ import { f as registerAppInstance, g as unregisterAppInstance, i as resolveRouteMeta, o as configureScrollRestoration, r as reconcileRouteMeta, t as initializeNavigation } from "./navigate-b4GGxO_l.js";
17
+ import "./ssr-DSHd_Q9K.js";
18
18
  //#region src/boot/hydration.ts
19
19
  const DEFERRED_PAYLOAD = "__askr_deferred__";
20
20
  function applyDeferredStreamPatches(rootElement) {
@@ -493,7 +493,8 @@ async function createSPA(config) {
493
493
  };
494
494
  _setActiveRouteAuthOptions(routeAuth);
495
495
  if (isProductionEnvironment()) lockRouteRegistration();
496
- const { path, resolved } = await resolveInitialRoute(routeAuth, { registry: config.registry });
496
+ const { path, href: currentUrl, resolved } = await resolveInitialRoute(routeAuth, { registry: config.registry });
497
+ setServerLocation(currentUrl);
497
498
  const appRuntime = createAppRenderRuntime(resolved?.kind === "render" && hasRouteRenderData(resolved) ? {
498
499
  route: getRouteRenderData(resolved),
499
500
  hasRoute: true
@@ -585,7 +586,7 @@ async function hydrateSPA(config) {
585
586
  cspNonce: config.cspNonce
586
587
  }));
587
588
  if (shouldVerifyHydrationMarkup(config)) {
588
- const { verifyHydrationSyncForUrl } = await import("./verify-hydration-BguOSco9.js");
589
+ const { verifyHydrationSyncForUrl } = await import("./verify-hydration-C3QBBQqR.js");
589
590
  if (!verifyHydrationSyncForUrl({
590
591
  root: rootElement,
591
592
  url: currentUrl,
@@ -1,7 +1,7 @@
1
- import { c as runRuntimeHandlerScope, v as logger } from "./access-ePqdQqkV.js";
2
- import "./fastlane-BOr4lSLl.js";
3
- import { t as cleanupComponent } from "./component-cleanup-Bug5tSiG.js";
4
- import { u as registerLifecycleTransaction } from "./lifecycle-batch-CFI4NKpJ.js";
1
+ import { c as runRuntimeHandlerScope, v as logger } from "./access-Dpfoi4cA.js";
2
+ import "./fastlane-CrfB3QG0.js";
3
+ import { t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
4
+ import { u as registerLifecycleTransaction } from "./lifecycle-batch-Dfpid9-A.js";
5
5
  //#region src/runtime/events.ts
6
6
  /**
7
7
  * Event delegation system for Askr
@@ -74,13 +74,23 @@ const containerDelegatedListeners = /* @__PURE__ */ new Map();
74
74
  function isEventDelegationEnabled() {
75
75
  return eventDelegationEnabled;
76
76
  }
77
+ function usesDelegatedCapture(eventName) {
78
+ return eventName === "focus" || eventName === "blur" || eventName === "scroll";
79
+ }
80
+ function removeContainerDelegatedListener(container, eventName, handler) {
81
+ if (usesDelegatedCapture(eventName)) {
82
+ container.removeEventListener(eventName, handler, true);
83
+ return;
84
+ }
85
+ container.removeEventListener(eventName, handler);
86
+ }
77
87
  function decrementContainerListenerUsage(entry) {
78
88
  const listeners = containerDelegatedListeners.get(entry.container);
79
89
  const listener = listeners?.get(entry.eventName);
80
90
  if (!listener) return;
81
91
  listener.usage -= 1;
82
92
  if (listener.usage > 0) return;
83
- entry.container.removeEventListener(entry.eventName, listener.handler);
93
+ removeContainerDelegatedListener(entry.container, entry.eventName, listener.handler);
84
94
  listeners?.delete(entry.eventName);
85
95
  if (listeners?.size === 0) containerDelegatedListeners.delete(entry.container);
86
96
  }
@@ -140,7 +150,7 @@ function attachDelegatedListener(container, element, eventName, handler, origina
140
150
  }, "sync");
141
151
  };
142
152
  const passiveOptions = getPassiveOptions(eventName);
143
- const listenerOptions = eventName === "focus" || eventName === "blur" || eventName === "scroll" ? {
153
+ const listenerOptions = usesDelegatedCapture(eventName) ? {
144
154
  ...passiveOptions ?? options,
145
155
  capture: true
146
156
  } : passiveOptions ?? options;
@@ -1,6 +1,6 @@
1
- import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
2
- import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-_GQGe_St.js";
1
+ import { b as isDevelopmentEnvironment, v as logger, x as isProductionEnvironment } from "./access-Dpfoi4cA.js";
3
2
  import { a as clearCurrentComponentScope, y as restoreCurrentComponentScope } from "./component-scope-DzJEbYGE.js";
3
+ import { n as cleanupReadableSubscriptions, t as cleanupReadableSubscriptionSources } from "./readable-B5NtV7V0.js";
4
4
  //#region src/runtime/state-diagnostics.ts
5
5
  /**
6
6
  * Report state cells that were never read during a component's completed
@@ -1,10 +1,10 @@
1
1
  import { a as markTransparentComponentResult, i as markEagerControlPrimitive } from "./control-C-ApnFs1.js";
2
- import { b as isDevelopmentEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, v as logger, x as isProductionEnvironment } from "./access-ePqdQqkV.js";
3
- import { r as tryRuntimeFastLaneSync, t as isBulkCommitActive } from "./fastlane-BOr4lSLl.js";
4
- import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
5
- import { i as finalizeReadableSubscriptions } from "./readable-_GQGe_St.js";
2
+ import { b as isDevelopmentEnvironment, n as enqueueRuntimeTask, o as getRuntimeRenderer, v as logger, x as isProductionEnvironment } from "./access-Dpfoi4cA.js";
3
+ import { r as tryRuntimeFastLaneSync, t as isBulkCommitActive } from "./fastlane-CrfB3QG0.js";
6
4
  import { C as restoreRenderScopedComponent, S as restoreInlineRenderTracking, _ as getSignalForInstance, b as restoreDomCommitScope, c as enterDomCommitScope, f as getCurrentComponentInstance, l as enterRenderScopedComponent, m as getCurrentPortalScope, n as captureInlineComponentScope, o as clearRenderTracking, p as getCurrentInstance, r as captureInlineRenderTracking, s as enterComponentExecutionScope, t as beginRenderTracking, u as exitComponentExecutionScope, v as resetRenderState, x as restoreInlineComponentScope } from "./component-scope-DzJEbYGE.js";
7
- import { a as enqueueLifecycleCommitForInstance, d as discardCommitOperations, f as executeCommittedLifecycleOperations, n as captureInlineRenderSnapshot$1, o as finalizeInlineReadSubscriptions, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-CFI4NKpJ.js";
5
+ import { r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
6
+ import { i as finalizeReadableSubscriptions } from "./readable-B5NtV7V0.js";
7
+ import { a as enqueueLifecycleCommitForInstance, d as discardCommitOperations, f as executeCommittedLifecycleOperations, n as captureInlineRenderSnapshot$1, o as finalizeInlineReadSubscriptions, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-Dfpid9-A.js";
8
8
  //#region src/runtime/context.ts
9
9
  const TransparentContextScopeComponent = markTransparentComponentResult(ContextScopeComponent);
10
10
  let nextScopeIdentityKey = 0;
@@ -1,4 +1,4 @@
1
- import { d as VNode } from "../control-Y8F73Uln.js";
1
+ import { d as VNode } from "../control-DhUZU4_V.js";
2
2
  import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
3
3
  //#region src/common/error-boundary.d.ts
4
4
  type ErrorBoundaryContent = VNode | readonly VNode[];
@@ -1,6 +1,6 @@
1
1
  import { t as __ERROR_BOUNDARY__ } from "../vnode-D24p6IW2.js";
2
- import { t as ELEMENT_TYPE } from "../jsx-C3IECePB.js";
3
2
  import { f as getCurrentComponentInstance } from "../component-scope-DzJEbYGE.js";
3
+ import { t as ELEMENT_TYPE } from "../jsx-C3IECePB.js";
4
4
  //#region src/components/error-boundary.tsx
5
5
  function ensureBoundaryState(instance, resetKey) {
6
6
  const boundaryState = instance.errorBoundaryState ?? (instance.errorBoundaryState = {
@@ -1,2 +1,2 @@
1
- import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-DUXXZ31H.js";
1
+ import { a as Show, c as ForProps, i as MatchProps, n as CaseProps, o as ShowProps, r as Match, s as For, t as Case } from "../index-r-nt13FE.js";
2
2
  export { Case, type CaseProps, For, type ForProps, Match, type MatchProps, Show, type ShowProps };
@@ -1,2 +1,2 @@
1
- import { i as For, n as Match, r as Show, t as Case } from "../control-nrS65oG3.js";
1
+ import { i as For, n as Match, r as Show, t as Case } from "../control-oLADku43.js";
2
2
  export { Case, For, Match, Show };
@@ -82,6 +82,7 @@ interface DocumentRenderArgs {
82
82
  context: DocumentRenderContext;
83
83
  }
84
84
  type DocumentRenderer = (args: DocumentRenderArgs) => string;
85
+ type SSRStyleRegistrationValidation = 'warn' | 'error' | 'off';
85
86
  /** Full context for sink-based streaming SSR */
86
87
  type SSRContext = {
87
88
  url: string;
@@ -445,4 +446,4 @@ interface ControlTransaction {
445
446
  registered: boolean;
446
447
  }
447
448
  //#endregion
448
- export { State as _, ComponentInstance as a, state as b, readScope as c, VNode as d, DocumentRenderArgs as f, SSRStyleRegistration as g, SSRData as h, ReadableSource as i, ComponentFunction as l, DocumentRenderer as m, ChildScope as n, Scope as o, DocumentRenderContext as p, DOMRange as r, defineScope as s, ForEachSource as t, RenderableChild as u, StateSetter as v, StateTuple as y };
449
+ export { SSRStyleRegistrationValidation as _, ComponentInstance as a, StateTuple as b, readScope as c, VNode as d, DocumentRenderArgs as f, SSRStyleRegistration as g, SSRData as h, ReadableSource as i, ComponentFunction as l, DocumentRenderer as m, ChildScope as n, Scope as o, DocumentRenderContext as p, DOMRange as r, defineScope as s, ForEachSource as t, RenderableChild as u, State as v, state as x, StateSetter as y };
@@ -1,9 +1,9 @@
1
1
  import { i as markEagerControlPrimitive, t as __CONTROL_BOUNDARY__ } from "./control-C-ApnFs1.js";
2
- import { b as isDevelopmentEnvironment } from "./access-ePqdQqkV.js";
2
+ import { b as isDevelopmentEnvironment } from "./access-Dpfoi4cA.js";
3
3
  import { n as Fragment } from "./jsx-C3IECePB.js";
4
- import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-DjpV8ioj.js";
5
- import { t as createFineGrainedEffect } from "./effect-B487asyz.js";
6
- import { t as state } from "./state-BzIMC6-i.js";
4
+ import { m as createShowState, p as createCaseState, s as useForState } from "./for-internal-B_mnQhan.js";
5
+ import { t as createFineGrainedEffect } from "./effect-lnxQIpJG.js";
6
+ import { t as state } from "./state-DCjONcHK.js";
7
7
  //#region src/control/shared.ts
8
8
  function normalizeBoundaryChild(value) {
9
9
  if (Array.isArray(value)) {
@@ -1,4 +1,4 @@
1
- import { g as readScope, u as defineScope } from "./component-internal-Bw4Mf9fd.js";
1
+ import { g as readScope, u as defineScope } from "./component-internal-DcrLymUJ.js";
2
2
  //#region src/common/url.ts
3
3
  const SAFE_URL_SCHEMES = /* @__PURE__ */ new Set([
4
4
  "http",
@@ -13,6 +13,23 @@ function isSafeHref(value) {
13
13
  const scheme = URL_SCHEME_RE.exec(compact)?.[1]?.toLowerCase();
14
14
  return scheme === void 0 || SAFE_URL_SCHEMES.has(scheme);
15
15
  }
16
+ /**
17
+ * Attribute names (lowercased) that can carry a browser-navigable/executable
18
+ * URL and must be checked against isSafeHref. Shared between the client
19
+ * renderer (renderer/attributes.ts) and SSR (ssr/attrs.ts) so their unsafe-
20
+ * URL handling can't drift. Deliberately excludes `src`: it covers a much
21
+ * wider range of legitimate non-navigable values (data: image URIs, blob:
22
+ * URLs, etc.) where the same scheme allowlist would be overly aggressive.
23
+ */
24
+ const UNSAFE_URL_SCHEME_ATTRIBUTES = /* @__PURE__ */ new Set([
25
+ "href",
26
+ "formaction",
27
+ "action",
28
+ "xlink:href"
29
+ ]);
30
+ function isUnsafeUrlAttribute(key, value) {
31
+ return UNSAFE_URL_SCHEME_ATTRIBUTES.has(key.toLowerCase()) && !isSafeHref(String(value));
32
+ }
16
33
  //#endregion
17
34
  //#region src/common/router-internal.ts
18
35
  const ROUTE_ROOT_COMPONENT = Symbol.for("askr.route-root-component");
@@ -45,4 +62,4 @@ function validateCspNonce(value) {
45
62
  return value;
46
63
  }
47
64
  //#endregion
48
- export { isSafeHref as a, ROUTE_ROOT_COMPONENT as i, cspNonce as n, validateCspNonce as r, CspNonceScope as t };
65
+ export { isSafeHref as a, ROUTE_ROOT_COMPONENT as i, cspNonce as n, isUnsafeUrlAttribute as o, validateCspNonce as r, CspNonceScope as t };
@@ -1,4 +1,4 @@
1
1
  import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-D68YOo9L.js";
2
- import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-BRS5woEh.js";
2
+ import { a as queryScope, i as invalidateOnInterval, n as createMutation, r as invalidate, t as createQuery } from "../data-Dkqb8_QP.js";
3
3
  import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery, t as createQueryPrefetchContext } from "../query-registry-BL6rjGsO.js";
4
4
  export { createDataRuntime, createMutation, createQuery, createQueryPrefetchContext, defineQuery, defineServerQueries, dehydrateDataRuntime, getDefaultDataRuntime, hydrateDataRuntime, invalidate, invalidateOnInterval, prefetchQuery, queryScope, serveQuery };
@@ -1,8 +1,8 @@
1
- import { n as enqueueRuntimeTask, v as logger } from "./access-ePqdQqkV.js";
2
- import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-_GQGe_St.js";
1
+ import { n as enqueueRuntimeTask, v as logger } from "./access-Dpfoi4cA.js";
3
2
  import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
3
+ import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
4
4
  import { n as getActiveRenderContext } from "./render-context-D-DFk2WN.js";
5
- import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-KYOIcM5R.js";
5
+ import { i as routeActive, n as documentVisible, o as timer, s as windowFocused } from "./lifecycle-operations-BrYrBsXY.js";
6
6
  import { a as getMutationSlotStore, c as resolveDataRuntimeState, i as getDefaultDataRuntime, n as ensureMutationCleanup, o as getQuerySlotStore, r as ensureQueryCleanup, s as invalidateQueriesForRuntime } from "./data-runtime-D68YOo9L.js";
7
7
  //#region src/data/query-key.ts
8
8
  function serializeQueryKeyNumber(part) {