@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.
- package/dist/{access-ePqdQqkV.js → access-Dpfoi4cA.js} +7 -1
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +1 -1
- package/dist/{activity-pySy9t7Y.d.ts → activity-B1I5HJQI.d.ts} +1 -1
- package/dist/{activity-CZiPgZy0.js → activity-Jd9CgEa3.js} +52 -15
- package/dist/{authoring-DQPG0VAm.js → authoring-DdQ3pHqt.js} +6 -3
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +3 -3
- package/dist/boot/index.js +1 -1
- package/dist/{boot-D28lesMw.js → boot-DWe880Et.js} +16 -15
- package/dist/{cleanup-ARiXproi.js → cleanup-c837KVij.js} +16 -6
- package/dist/{component-cleanup-Bug5tSiG.js → component-cleanup-BUfUleGZ.js} +2 -2
- package/dist/{component-internal-Bw4Mf9fd.js → component-internal-DcrLymUJ.js} +5 -5
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-Y8F73Uln.d.ts → control-DhUZU4_V.d.ts} +2 -1
- package/dist/{control-nrS65oG3.js → control-oLADku43.js} +4 -4
- package/dist/{csp-nonce-ZTlD_EnK.js → csp-nonce-Bc52OIVc.js} +19 -2
- package/dist/data/index.js +1 -1
- package/dist/{data-BRS5woEh.js → data-Dkqb8_QP.js} +3 -3
- package/dist/{deferred-oqtAJ4iH.js → deferred-vUOy-awa.js} +198 -16
- package/dist/{effect-B487asyz.js → effect-lnxQIpJG.js} +2 -2
- package/dist/{fastlane-BOr4lSLl.js → fastlane-CrfB3QG0.js} +2 -2
- package/dist/{for-internal-DjpV8ioj.js → for-internal-B_mnQhan.js} +18 -6
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +2 -2
- package/dist/foundations/state/index.d.ts +1 -1
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +2 -2
- package/dist/foundations/structures/index.js +3 -3
- package/dist/fx/index.js +1 -1
- package/dist/{index-BApH3laU.d.ts → index-Bkh9S9-t.d.ts} +6 -2
- package/dist/{index-_UN08Pg1.d.ts → index-pIgGaXvS.d.ts} +19 -3
- package/dist/{index-DUXXZ31H.d.ts → index-r-nt13FE.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/{lifecycle-batch-CFI4NKpJ.js → lifecycle-batch-Dfpid9-A.js} +39 -20
- package/dist/{lifecycle-operations-KYOIcM5R.js → lifecycle-operations-BrYrBsXY.js} +1 -1
- package/dist/{navigate-CgVIrrSs.d.ts → navigate-NyIjQUwI.d.ts} +1 -1
- package/dist/{navigate-Dr3cjOSz.js → navigate-b4GGxO_l.js} +15 -14
- package/dist/{portal-pHBoqwYd.js → portal-BVWjAhNQ.js} +5 -5
- package/dist/{readable-_GQGe_St.js → readable-B5NtV7V0.js} +1 -1
- package/dist/{renderer-B9j5IV1q.js → renderer-CZzNtoj2.js} +57 -16
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +5 -5
- package/dist/{route-matching-IfQZmqkN.js → route-matching-DHduNiGk.js} +49 -6
- package/dist/router/index.d.ts +7 -7
- package/dist/router/index.js +9 -7
- package/dist/{selector-DJ1-N1K-.js → selector-Ck_Pp9av.js} +2 -2
- package/dist/ssg/index.d.ts +9 -3
- package/dist/ssg/index.js +30 -15
- package/dist/ssr/index.d.ts +7 -3
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-CtC4lChT.js → ssr-CpiBHMNv.js} +29 -18
- package/dist/ssr-DSHd_Q9K.js +25 -0
- package/dist/{state-BzIMC6-i.js → state-DCjONcHK.js} +4 -3
- package/dist/{structures-D3vO-WMN.js → structures-DSLF_iis.js} +4 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/{verify-hydration-BguOSco9.js → verify-hydration-C3QBBQqR.js} +2 -2
- package/package.json +1 -1
- package/dist/ssr-CbQO5xd3.js +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as registerCommitOperation } from "./component-internal-Bw4Mf9fd.js";
|
|
2
1
|
import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-DzJEbYGE.js";
|
|
2
|
+
import { a as registerCommitOperation } from "./component-internal-DcrLymUJ.js";
|
|
3
3
|
import { t as isRouteActivityActive } from "./route-activity-CNJfpwx-.js";
|
|
4
4
|
//#region src/runtime/lifecycle-operations.ts
|
|
5
5
|
function normalizePredicates(predicates) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { b as isDevelopmentEnvironment, r as flushRuntimeScheduler, v as logger, x as isProductionEnvironment } from "./access-
|
|
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 { r as executeComponent } from "./component-internal-
|
|
4
|
-
import { t as cleanupReadableSubscriptionSources } from "./readable-
|
|
5
|
-
import { n as cleanupComponentGeneration, t as cleanupComponent } from "./component-cleanup-
|
|
6
|
-
import { i as drainLifecycleCommitErrors, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-
|
|
7
|
-
import { _ as teardownNodeSubtree } from "./cleanup-
|
|
8
|
-
import { d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, p as hasRouteRenderData } from "./deferred-
|
|
9
|
-
import {
|
|
10
|
-
import { r as clearDefaultPortalForInstance, t as DefaultPortal } from "./portal-
|
|
11
|
-
import { t as CspNonceScope } from "./csp-nonce-
|
|
12
|
-
import { a as clearStagedAppRenderRouteLocation, i as syncCurrentRouteSnapshot, o as createAppRenderRuntime, s as stageAppRenderRouteLocation } from "./activity-
|
|
3
|
+
import { r as executeComponent } from "./component-internal-DcrLymUJ.js";
|
|
4
|
+
import { t as cleanupReadableSubscriptionSources } from "./readable-B5NtV7V0.js";
|
|
5
|
+
import { n as cleanupComponentGeneration, t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
|
|
6
|
+
import { i as drainLifecycleCommitErrors, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-Dfpid9-A.js";
|
|
7
|
+
import { _ as teardownNodeSubtree } from "./cleanup-c837KVij.js";
|
|
8
|
+
import { d as getRouteRenderContext, f as getRouteRenderData, m as resolveRouteRequest, p as hasRouteRenderData, v as withoutRouteHydrationMetadata } from "./deferred-vUOy-awa.js";
|
|
9
|
+
import { I as lockRouteRegistration, o as addRouteBasePath, r as computeRouteActivityMatches, y as getActiveRouteBasePath } from "./route-matching-DHduNiGk.js";
|
|
10
|
+
import { r as clearDefaultPortalForInstance, t as DefaultPortal } from "./portal-BVWjAhNQ.js";
|
|
11
|
+
import { t as CspNonceScope } from "./csp-nonce-Bc52OIVc.js";
|
|
12
|
+
import { a as clearStagedAppRenderRouteLocation, i as syncCurrentRouteSnapshot, o as createAppRenderRuntime, s as stageAppRenderRouteLocation } from "./activity-Jd9CgEa3.js";
|
|
13
13
|
//#region src/router/navigation-registry.ts
|
|
14
14
|
let currentInstance = null;
|
|
15
15
|
let currentPathname = "/";
|
|
@@ -722,7 +722,7 @@ function getResolvedRouteHandler(resolved) {
|
|
|
722
722
|
function updateRouteRuntime(instance, resolved, href) {
|
|
723
723
|
const current = instance._appRenderRuntime;
|
|
724
724
|
const runtime = createAppRenderRuntime({
|
|
725
|
-
framework: current?.framework,
|
|
725
|
+
framework: withoutRouteHydrationMetadata(current?.framework),
|
|
726
726
|
route: resolved?.kind === "render" ? getRouteRenderData(resolved) : void 0,
|
|
727
727
|
hasRoute: resolved?.kind === "render" && hasRouteRenderData(resolved)
|
|
728
728
|
});
|
|
@@ -992,8 +992,9 @@ let navigationInitialized = false;
|
|
|
992
992
|
configureNavigationRegistryHost({ cancelRouteRequests });
|
|
993
993
|
function navigate(path, options = {}) {
|
|
994
994
|
if (typeof window === "undefined") return;
|
|
995
|
-
const
|
|
996
|
-
|
|
995
|
+
const targetPath = addRouteBasePath(path, getActiveRouteBasePath());
|
|
996
|
+
const initialTarget = parseTargetUrl(targetPath);
|
|
997
|
+
navigateWithRedirectState(targetPath, options, {
|
|
997
998
|
redirects: 0,
|
|
998
999
|
visited: /* @__PURE__ */ new Set([`${initialTarget.pathname}${initialTarget.search}${initialTarget.hash}`])
|
|
999
1000
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { o as getRuntimeRenderer } from "./access-
|
|
2
|
-
import { t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
3
|
-
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-_GQGe_St.js";
|
|
1
|
+
import { o as getRuntimeRenderer } from "./access-Dpfoi4cA.js";
|
|
4
2
|
import { f as getCurrentComponentInstance, m as getCurrentPortalScope } from "./component-scope-DzJEbYGE.js";
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
3
|
+
import { t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
4
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
|
|
5
|
+
import { t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
|
|
6
|
+
import { c as getCurrentLifecycleCommitBatch, u as registerLifecycleTransaction } from "./lifecycle-batch-Dfpid9-A.js";
|
|
7
7
|
import { n as getActiveRenderContext } from "./render-context-D-DFk2WN.js";
|
|
8
8
|
import { i as createSSRPortalHostToken, n as SSR_PORTAL_HOST, r as createSSRPortalAnchorToken, t as SSR_PORTAL_ANCHOR } from "./portal-w3oQ6oQU.js";
|
|
9
9
|
//#region src/runtime/portal.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as enqueueRuntimeTask, s as markRuntimeReactivePropsDirtySource } from "./access-
|
|
1
|
+
import { n as enqueueRuntimeTask, s as markRuntimeReactivePropsDirtySource } from "./access-Dpfoi4cA.js";
|
|
2
2
|
import { p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
|
|
3
3
|
//#region src/runtime/readable.ts
|
|
4
4
|
const DEVELOPMENT_BUILD_ENABLED = false;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { n as hasTransparentComponentResult, t as __CONTROL_BOUNDARY__ } from "./control-C-ApnFs1.js";
|
|
2
2
|
import { n as _isDOMElement, t as __ERROR_BOUNDARY__ } from "./vnode-D24p6IW2.js";
|
|
3
|
-
import { b as isDevelopmentEnvironment, c as runRuntimeHandlerScope, f as configureRuntimeRenderer, i as getDefaultRuntimeInstance, n as enqueueRuntimeTask, v as logger, y as getRuntimeEnv } from "./access-
|
|
4
|
-
import { n as markFastPathApplied, t as isBulkCommitActive } from "./fastlane-
|
|
5
|
-
import { i as isFragmentType, r as STATIC_CHILDREN } from "./jsx-C3IECePB.js";
|
|
6
|
-
import { d as getCurrentContextFrame, h as markVNodeTreeWithContextFrame, i as mountInstanceInline, n as createComponentInstance, o as renderComponentInline, p as getVNodeContextFrame, t as captureInlineRenderSnapshot, y as withContext } from "./component-internal-Bw4Mf9fd.js";
|
|
3
|
+
import { b as isDevelopmentEnvironment, c as runRuntimeHandlerScope, f as configureRuntimeRenderer, i as getDefaultRuntimeInstance, n as enqueueRuntimeTask, v as logger, y as getRuntimeEnv } from "./access-Dpfoi4cA.js";
|
|
4
|
+
import { n as markFastPathApplied, t as isBulkCommitActive } from "./fastlane-CrfB3QG0.js";
|
|
7
5
|
import { b as restoreDomCommitScope, c as enterDomCommitScope, p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { i as isFragmentType, r as STATIC_CHILDREN } from "./jsx-C3IECePB.js";
|
|
7
|
+
import { d as getCurrentContextFrame, h as markVNodeTreeWithContextFrame, i as mountInstanceInline, n as createComponentInstance, o as renderComponentInline, p as getVNodeContextFrame, t as captureInlineRenderSnapshot, y as withContext } from "./component-internal-DcrLymUJ.js";
|
|
8
|
+
import { t as cleanupComponent } from "./component-cleanup-BUfUleGZ.js";
|
|
9
|
+
import { c as getCurrentLifecycleCommitBatch, l as registerLifecycleRollback, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch, u as registerLifecycleTransaction } from "./lifecycle-batch-Dfpid9-A.js";
|
|
10
|
+
import { _ as setControlBoundaryContextFrame, a as registerForStateTransaction, b as rerenderChildScope, c as captureForFallbackTransactionSnapshot, d as clearCaseDomUpdateState, f as clearShowDomUpdateState, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, l as captureForItemTransactionSnapshot, n as clearForDomUpdateState, o as rollbackForStateTransaction, t as beginForStateTransaction, v as createChildScope, y as disposeChildScope } from "./for-internal-B_mnQhan.js";
|
|
11
|
+
import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-lnxQIpJG.js";
|
|
12
|
+
import { C as getDelegatedHandlersForElement, D as updateDelegatedListener, E as removeDelegatedListener, S as getDelegatedHandlerForElement, T as isEventDelegationEnabled, _ as teardownNodeSubtree, a as elementReactivePropsCleanup, b as addFreshDelegatedListener, c as forEachElementReactivePropCleanup, d as removeAllListeners, f as removeElementReactiveProps, g as setFreshElementReactivePropCleanup, h as setDirectElementReactivePropCleanup, i as elementListeners, l as getElementReactivePropCleanupSize, m as replaceElementRefBookkeeping, n as cleanupInstanceIfPresent, o as elementRefs, p as removeElementRef, r as cleanupInstancesUnder, s as forEachDescendantNode, t as REACTIVE_CHILDREN_KEY, u as getElementReactivePropsCleanupMap, v as updateElementRef, w as isDelegatedEvent, x as clearDelegatedHandlersForElement, y as addDelegatedListener } from "./cleanup-c837KVij.js";
|
|
13
13
|
import { a as isSSRPortalHydrationAnchor } from "./portal-w3oQ6oQU.js";
|
|
14
14
|
import { n as getPublicAttributeName, t as sanitizeCssValue } from "./css-BuPaTOfe.js";
|
|
15
|
-
import {
|
|
15
|
+
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-Bc52OIVc.js";
|
|
16
16
|
//#region src/runtime/error-boundary.ts
|
|
17
17
|
function createBoundaryReset(instance) {
|
|
18
18
|
return () => {
|
|
@@ -713,6 +713,15 @@ function isKeyedReorderFastPathEligible(parent, newChildren, oldKeyMap) {
|
|
|
713
713
|
}
|
|
714
714
|
//#endregion
|
|
715
715
|
//#region src/renderer/attributes.ts
|
|
716
|
+
function isDangerousInnerHTMLPayload(value) {
|
|
717
|
+
return value !== null && typeof value === "object" && "__html" in value;
|
|
718
|
+
}
|
|
719
|
+
function applyDangerousInnerHTMLValue(el, value) {
|
|
720
|
+
if (!isDangerousInnerHTMLPayload(value)) return;
|
|
721
|
+
if (isDevelopmentEnvironment()) logger.warn("[Askr] dangerouslySetInnerHTML is being used, which bypasses the framework's normal rendering and can introduce XSS vulnerabilities if the HTML is derived from untrusted input. Make sure the value is sanitized.");
|
|
722
|
+
const html = value.__html;
|
|
723
|
+
el.innerHTML = html === null || html === void 0 ? "" : String(html);
|
|
724
|
+
}
|
|
716
725
|
function applyFormControlProp(el, key, value, tagName) {
|
|
717
726
|
if (key === "value") {
|
|
718
727
|
const stringValue = String(value);
|
|
@@ -819,7 +828,8 @@ function applyStaticScalarPropsToElement(el, props, tagName) {
|
|
|
819
828
|
if (key === "class" || key === "className") writeElementClassName(el, String(value));
|
|
820
829
|
else if (key === "style") applyStylePropValue(el, value);
|
|
821
830
|
else if (key === "value" || key === "checked") applyFormControlProp(el, key, value, tagName);
|
|
822
|
-
else if (key
|
|
831
|
+
else if (key === "dangerouslySetInnerHTML") applyDangerousInnerHTMLValue(el, value);
|
|
832
|
+
else if (isUnsafeUrlAttribute(key, value)) removeRenderedAttribute(el, key);
|
|
823
833
|
else setRenderedAttribute(el, key, String(value));
|
|
824
834
|
}
|
|
825
835
|
}
|
|
@@ -870,6 +880,7 @@ function applyClassPropValue(el, value, previousValue, descriptor) {
|
|
|
870
880
|
if (descriptor) descriptor.lastClassTokens = nextTokens;
|
|
871
881
|
}
|
|
872
882
|
function applyScalarPropValue(el, key, value, tagName, previousValue, descriptor) {
|
|
883
|
+
if (key === "dangerouslySetInnerHTML" && !isDangerousInnerHTMLPayload(value)) return;
|
|
873
884
|
if (value === void 0 || value === null || value === false) {
|
|
874
885
|
if (key === "class" || key === "className") {
|
|
875
886
|
const previousTokens = descriptor?.lastClassTokens;
|
|
@@ -885,7 +896,8 @@ function applyScalarPropValue(el, key, value, tagName, previousValue, descriptor
|
|
|
885
896
|
if (key === "class" || key === "className") applyClassPropValue(el, value, previousValue, descriptor);
|
|
886
897
|
else if (key === "style") applyStylePropValue(el, value);
|
|
887
898
|
else if (key === "value" || key === "checked") applyFormControlProp(el, key, value, tagName);
|
|
888
|
-
else if (key
|
|
899
|
+
else if (key === "dangerouslySetInnerHTML") applyDangerousInnerHTMLValue(el, value);
|
|
900
|
+
else if (isUnsafeUrlAttribute(key, value)) removeRenderedAttribute(el, key);
|
|
889
901
|
else setRenderedAttribute(el, key, String(value));
|
|
890
902
|
}
|
|
891
903
|
function removeStaleAttributes(el, vnode, props) {
|
|
@@ -1266,7 +1278,7 @@ function findHostInstanceByType(host, type, node, parent, wrapperDepth) {
|
|
|
1266
1278
|
if (identityMatches.length === 1) return identityMatches[0];
|
|
1267
1279
|
if (identityMatches.length > 1 && key !== void 0) return identityMatches[identityMatches.length - 1];
|
|
1268
1280
|
const sameType = instances.filter((instance) => instance.fn === type);
|
|
1269
|
-
if (sameType.length === 1) return sameType[0];
|
|
1281
|
+
if (key === void 0 && sameType.length === 1) return sameType[0];
|
|
1270
1282
|
return null;
|
|
1271
1283
|
}
|
|
1272
1284
|
if (host.__ASKR_INSTANCE?.fn === type) {
|
|
@@ -1642,6 +1654,10 @@ function applyPropsToElement$1(el, props, tagName, isHydrationSkipped) {
|
|
|
1642
1654
|
continue;
|
|
1643
1655
|
}
|
|
1644
1656
|
if (isSkippedProp(key)) continue;
|
|
1657
|
+
if (key === "dangerouslySetInnerHTML") {
|
|
1658
|
+
applyScalarPropValue(el, key, value, tagName);
|
|
1659
|
+
continue;
|
|
1660
|
+
}
|
|
1645
1661
|
if (value === void 0 || value === null || value === false) continue;
|
|
1646
1662
|
const eventProp = parseEventProp(key);
|
|
1647
1663
|
if (eventProp) {
|
|
@@ -1666,6 +1682,15 @@ function syncElementPropBindings(el, domVNode, props, usesReactiveChildren) {
|
|
|
1666
1682
|
const value = props[key];
|
|
1667
1683
|
if (key === "ref") continue;
|
|
1668
1684
|
if (isSkippedProp(key)) continue;
|
|
1685
|
+
if (key === "dangerouslySetInnerHTML") {
|
|
1686
|
+
const existingEntry = existingReactiveProps?.get(key);
|
|
1687
|
+
if (existingEntry) {
|
|
1688
|
+
existingEntry.cleanup();
|
|
1689
|
+
existingReactiveProps?.delete(key);
|
|
1690
|
+
}
|
|
1691
|
+
applyScalarPropValue(el, key, value, domVNode.type);
|
|
1692
|
+
continue;
|
|
1693
|
+
}
|
|
1669
1694
|
const eventProp = parseEventProp(key);
|
|
1670
1695
|
const eventName = eventProp?.eventName;
|
|
1671
1696
|
const eventCapture = eventProp?.capture ?? false;
|
|
@@ -3713,6 +3738,7 @@ function updateElementChildren$1(el, children, forceUpdate = false) {
|
|
|
3713
3738
|
}
|
|
3714
3739
|
clearControlBoundaryCommitOwner(el);
|
|
3715
3740
|
if (children === null || children === void 0) {
|
|
3741
|
+
keyedElements.delete(el);
|
|
3716
3742
|
for (let n = el.firstChild; n;) {
|
|
3717
3743
|
const next = n.nextSibling;
|
|
3718
3744
|
teardownNodeSubtree(n);
|
|
@@ -3722,7 +3748,7 @@ function updateElementChildren$1(el, children, forceUpdate = false) {
|
|
|
3722
3748
|
return;
|
|
3723
3749
|
}
|
|
3724
3750
|
if (!Array.isArray(children) && isFragmentVNode(children)) {
|
|
3725
|
-
|
|
3751
|
+
updateElementChildren$1(el, normalizeComponentChildren(children), forceUpdate);
|
|
3726
3752
|
return;
|
|
3727
3753
|
}
|
|
3728
3754
|
if (!Array.isArray(children) && (typeof children === "string" || typeof children === "number")) {
|
|
@@ -4827,6 +4853,8 @@ function commitForStateBoundaryChildrenImpl(parent, forState, childrenVNodes, ru
|
|
|
4827
4853
|
commitDirtyNoReorder(dirtyIndices);
|
|
4828
4854
|
break;
|
|
4829
4855
|
case "REMOVE_ONE":
|
|
4856
|
+
removeForBoundaryNodes(parent, forState.lastRemovedNodes, { teardown: false });
|
|
4857
|
+
removedBoundaryConsumed = true;
|
|
4830
4858
|
commitDirtyNoReorder(dirtyIndices);
|
|
4831
4859
|
break;
|
|
4832
4860
|
case "TRUNCATE":
|
|
@@ -4989,6 +5017,8 @@ function captureRangeFocus(range, parent) {
|
|
|
4989
5017
|
} : null;
|
|
4990
5018
|
return () => {
|
|
4991
5019
|
if (!active.isConnected || active.ownerDocument.activeElement === active) return;
|
|
5020
|
+
const currentActive = active.ownerDocument.activeElement;
|
|
5021
|
+
if (currentActive instanceof Element && currentActive !== active.ownerDocument.body && currentActive !== active.ownerDocument.documentElement && currentActive.isConnected) return;
|
|
4992
5022
|
try {
|
|
4993
5023
|
active.focus({ preventScroll: true });
|
|
4994
5024
|
} catch {
|
|
@@ -6419,6 +6449,7 @@ function isBlueprintKeyProp(key) {
|
|
|
6419
6449
|
}
|
|
6420
6450
|
function classifyProp(value, key) {
|
|
6421
6451
|
if (key === "ref") return { kind: "ref" };
|
|
6452
|
+
if (key === "dangerouslySetInnerHTML") return null;
|
|
6422
6453
|
if (key.startsWith("on") && key.length > 2) return typeof value === "function" ? { kind: "event" } : null;
|
|
6423
6454
|
if (typeof value === "function") return { kind: "reactive" };
|
|
6424
6455
|
if (value === void 0 || value === null || value === false) return { kind: "empty" };
|
|
@@ -6894,6 +6925,7 @@ function createOwnedResultNodeWithBlueprint(owner, node, parentNamespace) {
|
|
|
6894
6925
|
}
|
|
6895
6926
|
function createIntrinsicElement(node, type, props, parentNamespace) {
|
|
6896
6927
|
const children = props.children ?? node.children;
|
|
6928
|
+
const usesDangerousHTML = isDangerousInnerHTMLPayload(props.dangerouslySetInnerHTML);
|
|
6897
6929
|
const elementNamespace = resolveChildNamespace(type, parentNamespace);
|
|
6898
6930
|
const el = createElementForNamespace(type, parentNamespace);
|
|
6899
6931
|
try {
|
|
@@ -6905,7 +6937,7 @@ function createIntrinsicElement(node, type, props, parentNamespace) {
|
|
|
6905
6937
|
return el;
|
|
6906
6938
|
}
|
|
6907
6939
|
applyPropsToElement$1(el, props, type, isHydrationSkipped);
|
|
6908
|
-
if (children !== null && children !== void 0) {
|
|
6940
|
+
if (!usesDangerousHTML && children !== null && children !== void 0) {
|
|
6909
6941
|
const controlBoundaryVNode = getDirectControlBoundaryVNode(children);
|
|
6910
6942
|
if (controlBoundaryVNode) {
|
|
6911
6943
|
const controlState = getControlBoundaryState(controlBoundaryVNode);
|
|
@@ -6965,7 +6997,8 @@ function applyElementUpdateFromVnode(el, vnode, updateChildren, forceChildrenUpd
|
|
|
6965
6997
|
if (!_isDOMElement(vnode)) return;
|
|
6966
6998
|
const props = vnode.props || {};
|
|
6967
6999
|
const domVNode = vnode;
|
|
6968
|
-
const
|
|
7000
|
+
const usesDangerousHTML = isDangerousInnerHTMLPayload(props.dangerouslySetInnerHTML);
|
|
7001
|
+
const shouldUpdateChildren = updateChildren && props.imperativeChildren !== true && !usesDangerousHTML;
|
|
6969
7002
|
if (isHydrationSkipped(el)) {
|
|
6970
7003
|
rememberDeferredHydrationVNode(el, vnode, getCurrentInstance(), getCurrentInstance()?.ownerFrame ?? null);
|
|
6971
7004
|
clearHydrationDeferredSubtree(el);
|
|
@@ -6973,6 +7006,7 @@ function applyElementUpdateFromVnode(el, vnode, updateChildren, forceChildrenUpd
|
|
|
6973
7006
|
}
|
|
6974
7007
|
materializeKey(el, vnode, props);
|
|
6975
7008
|
updateElementRef(el, props.ref);
|
|
7009
|
+
if (usesDangerousHTML) updateElementChildren$1(el, void 0, forceChildrenUpdate);
|
|
6976
7010
|
if (!hasTrackedElementPropBindings(el)) {
|
|
6977
7011
|
if (!forceChildrenUpdate && hasMatchingStaticProps(el, props, vnode.type)) {
|
|
6978
7012
|
if (shouldUpdateChildren) {
|
|
@@ -7226,6 +7260,13 @@ function replaceComponentRange(instance, result, host) {
|
|
|
7226
7260
|
const emptyResult = result === null || result === void 0 || result === false;
|
|
7227
7261
|
if (host instanceof Comment && emptyResult) return host;
|
|
7228
7262
|
if (!(host instanceof Comment) && !emptyResult && !isTransparentComponentResult(result)) return null;
|
|
7263
|
+
if (host instanceof Element && _isDOMElement(result) && hasTransparentComponentResult(result.type)) {
|
|
7264
|
+
const syncedHost = getRendererDOMHost().syncComponentElement(host, result, result.type, result.props ?? {}, getParentNamespace(parent), false, retainedInstances);
|
|
7265
|
+
if (syncedHost) {
|
|
7266
|
+
retainReplacementOwnerChain(syncedHost, instance, retainedInstances);
|
|
7267
|
+
return syncedHost;
|
|
7268
|
+
}
|
|
7269
|
+
}
|
|
7229
7270
|
return beginComponentHostReplacement(instanceHost, instance, instance.target, retainedInstances).replace(() => materializeComponentResultNode(instance, result, getParentNamespace(parent)), (nextHost) => retainReplacementOwnerChain(nextHost, instance, retainedInstances));
|
|
7230
7271
|
}
|
|
7231
7272
|
const placeholder = host;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ut as getSignal } from "../index-
|
|
2
|
-
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-
|
|
1
|
+
import { ut as getSignal } from "../index-pIgGaXvS.js";
|
|
2
|
+
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-B1I5HJQI.js";
|
|
3
3
|
//#region src/runtime/resource-operation.d.ts
|
|
4
4
|
interface ResourceResult<T> {
|
|
5
5
|
value: T | null;
|
package/dist/resources/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane } from "../access-
|
|
2
|
-
import { a as registerCommitOperation } from "../component-internal-Bw4Mf9fd.js";
|
|
1
|
+
import { t as enqueueRuntimeLane } from "../access-Dpfoi4cA.js";
|
|
3
2
|
import { f as getCurrentComponentInstance, g as getSignal, i as claimHookIndex } from "../component-scope-DzJEbYGE.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
3
|
+
import { a as registerCommitOperation } from "../component-internal-DcrLymUJ.js";
|
|
4
|
+
import { G as resource } from "../route-matching-DHduNiGk.js";
|
|
5
|
+
import { a as task, i as routeActive, n as documentVisible, o as timer, r as on, s as windowFocused, t as capture } from "../lifecycle-operations-BrYrBsXY.js";
|
|
6
|
+
import { n as onRouteChange } from "../activity-Jd9CgEa3.js";
|
|
7
7
|
//#region src/runtime/stream-operation.ts
|
|
8
8
|
function toError(value) {
|
|
9
9
|
return value instanceof Error ? value : new Error(String(value));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane, v as logger } from "./access-
|
|
2
|
-
import { c as registerCommitOperationForInstance, d as getCurrentContextFrame, v as withAsyncResourceContext } from "./component-internal-Bw4Mf9fd.js";
|
|
1
|
+
import { t as enqueueRuntimeLane, v as logger } from "./access-Dpfoi4cA.js";
|
|
3
2
|
import { f as getCurrentComponentInstance } from "./component-scope-DzJEbYGE.js";
|
|
4
|
-
import {
|
|
3
|
+
import { c as registerCommitOperationForInstance, d as getCurrentContextFrame, v as withAsyncResourceContext } from "./component-internal-DcrLymUJ.js";
|
|
4
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Dfpid9-A.js";
|
|
5
5
|
import { t as brandSnapshotSource } from "./snapshot-source-BB42xgwb.js";
|
|
6
6
|
import { d as SSRDataMissingError, i as getNextRenderKey, n as getActiveRenderContext, r as getCurrentRenderData, u as throwSSRDataMissing } from "./render-context-D-DFk2WN.js";
|
|
7
|
-
import { t as state } from "./state-
|
|
7
|
+
import { t as state } from "./state-DCjONcHK.js";
|
|
8
8
|
//#region src/runtime/resource-cell.ts
|
|
9
9
|
/**
|
|
10
10
|
* Pure, component-agnostic ResourceCell state machine.
|
|
@@ -401,6 +401,7 @@ const registrationScopeStack = [];
|
|
|
401
401
|
let registrationLocked = false;
|
|
402
402
|
let defaultRouteAuthOptions;
|
|
403
403
|
let activeClientRouteAuthOptions;
|
|
404
|
+
let defaultRouteBasePath = "";
|
|
404
405
|
function getDepth(path) {
|
|
405
406
|
const normalized = path.endsWith("/") && path !== "/" ? path.slice(0, -1) : path;
|
|
406
407
|
return normalized === "/" ? 0 : normalized.split("/").filter(Boolean).length;
|
|
@@ -448,6 +449,15 @@ function getDefaultRouteAuthOptions() {
|
|
|
448
449
|
function setDefaultRouteAuthOptions(auth) {
|
|
449
450
|
defaultRouteAuthOptions = auth;
|
|
450
451
|
}
|
|
452
|
+
function getDefaultRouteBasePath() {
|
|
453
|
+
return defaultRouteBasePath;
|
|
454
|
+
}
|
|
455
|
+
function setDefaultRouteBasePath(basePath) {
|
|
456
|
+
defaultRouteBasePath = basePath;
|
|
457
|
+
}
|
|
458
|
+
function getActiveRouteBasePath() {
|
|
459
|
+
return getActiveRenderContext()?.basePath ?? defaultRouteBasePath;
|
|
460
|
+
}
|
|
451
461
|
function getCurrentLayoutChain() {
|
|
452
462
|
const layoutChain = [];
|
|
453
463
|
for (const scope of registrationScopeStack) if (scope.layout) layoutChain.push({ component: scope.layout });
|
|
@@ -514,6 +524,7 @@ function clearRouteState() {
|
|
|
514
524
|
registrationLocked = false;
|
|
515
525
|
defaultRouteAuthOptions = void 0;
|
|
516
526
|
activeClientRouteAuthOptions = void 0;
|
|
527
|
+
defaultRouteBasePath = "";
|
|
517
528
|
}
|
|
518
529
|
function snapshotRouteState() {
|
|
519
530
|
return {
|
|
@@ -523,6 +534,7 @@ function snapshotRouteState() {
|
|
|
523
534
|
registrationLocked,
|
|
524
535
|
defaultRouteAuthOptions,
|
|
525
536
|
activeClientRouteAuthOptions,
|
|
537
|
+
defaultRouteBasePath,
|
|
526
538
|
routesByDepth: [...routesByDepth.entries()].map(([depth, depthRoutes]) => [depth, [...depthRoutes]]),
|
|
527
539
|
registrationScopeStack: [...registrationScopeStack]
|
|
528
540
|
};
|
|
@@ -541,6 +553,7 @@ function restoreRouteState(snapshot) {
|
|
|
541
553
|
registrationLocked = snapshot.registrationLocked;
|
|
542
554
|
defaultRouteAuthOptions = snapshot.defaultRouteAuthOptions;
|
|
543
555
|
activeClientRouteAuthOptions = snapshot.activeClientRouteAuthOptions;
|
|
556
|
+
defaultRouteBasePath = snapshot.defaultRouteBasePath;
|
|
544
557
|
}
|
|
545
558
|
//#endregion
|
|
546
559
|
//#region src/router/route-context.ts
|
|
@@ -617,6 +630,34 @@ function buildRouteContext(target, params, options) {
|
|
|
617
630
|
};
|
|
618
631
|
}
|
|
619
632
|
//#endregion
|
|
633
|
+
//#region src/router/base-path.ts
|
|
634
|
+
/** Normalize the public mount point used by one route registry. */
|
|
635
|
+
function normalizeRouteBasePath(value) {
|
|
636
|
+
if (value === void 0 || value === "" || value === "/") return "";
|
|
637
|
+
if (!value.startsWith("/") || /\/{2,}/.test(value) || value.includes("?") || value.includes("#") || value.includes("\\")) throw new TypeError(`Route basePath must be an absolute pathname without a query or hash. Received: ${JSON.stringify(value)}`);
|
|
638
|
+
const normalized = value.endsWith("/") ? value.slice(0, -1) : value;
|
|
639
|
+
if (normalized.split("/").some((segment) => segment === "." || segment === "..")) throw new TypeError("Route basePath must not contain dot segments.");
|
|
640
|
+
return normalized;
|
|
641
|
+
}
|
|
642
|
+
function parsedTarget(target) {
|
|
643
|
+
return new URL(target, "http://askr.invalid");
|
|
644
|
+
}
|
|
645
|
+
/** Add a registry mount point to one logical root-relative route target. */
|
|
646
|
+
function addRouteBasePath(target, basePath) {
|
|
647
|
+
if (!basePath || !target.startsWith("/") || target.startsWith("//")) return target;
|
|
648
|
+
const parsed = parsedTarget(target);
|
|
649
|
+
if (parsed.origin !== "http://askr.invalid" || parsed.pathname === basePath || parsed.pathname.startsWith(`${basePath}/`)) return target;
|
|
650
|
+
return `${basePath}${parsed.pathname}${parsed.search}${parsed.hash}`;
|
|
651
|
+
}
|
|
652
|
+
/** Remove a registry mount point and retain query/hash for logical matching. */
|
|
653
|
+
function removeRouteBasePath(target, basePath) {
|
|
654
|
+
const parsed = parsedTarget(target);
|
|
655
|
+
if (!basePath) return `${parsed.pathname}${parsed.search}${parsed.hash}`;
|
|
656
|
+
if (parsed.pathname === basePath || parsed.pathname === `${basePath}/`) return `/${parsed.search}${parsed.hash}`;
|
|
657
|
+
if (!parsed.pathname.startsWith(`${basePath}/`)) return void 0;
|
|
658
|
+
return `${parsed.pathname.slice(basePath.length)}${parsed.search}${parsed.hash}`;
|
|
659
|
+
}
|
|
660
|
+
//#endregion
|
|
620
661
|
//#region src/router/route-matching.ts
|
|
621
662
|
const routeSegsCache = /* @__PURE__ */ new WeakMap();
|
|
622
663
|
const routeRankCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -752,7 +793,9 @@ function computeMatchesFromRouteRecords(pathname, routeRecords) {
|
|
|
752
793
|
}];
|
|
753
794
|
}
|
|
754
795
|
function computeRouteActivityMatches(pathname, options) {
|
|
755
|
-
|
|
796
|
+
const logicalPath = removeRouteBasePath(pathname, normalizeRouteBasePath(options.registry.manifest.basePath));
|
|
797
|
+
if (logicalPath === void 0) return [];
|
|
798
|
+
return computeMatchesFromRouteRecords(logicalPath, options.registry.manifest.records);
|
|
756
799
|
}
|
|
757
800
|
function resolveRoute(pathname) {
|
|
758
801
|
const normalized = pathname.endsWith("/") && pathname !== "/" ? pathname.slice(0, -1) : pathname;
|
|
@@ -784,4 +827,4 @@ function _resolveRouteMatchFromRoutes(pathname, routeList) {
|
|
|
784
827
|
return findBestResolvedRouteFromRoutes(pathname, routeList);
|
|
785
828
|
}
|
|
786
829
|
//#endregion
|
|
787
|
-
export {
|
|
830
|
+
export { getDefaultRouteBasePath as A, setDefaultRouteBasePath as B, getCurrentInheritedPolicies as C, getCurrentPathPrefix as D, getCurrentPageScope as E, insertRecordSorted as F, resource as G, computeRank as H, lockRouteRegistration as I, pushRegistrationScope as L, getRouteRecords as M, hasActivePageScope as N, getCurrentScopeKind as O, hasRegisteredRoutes as P, restoreRouteState as R, getCurrentInheritedMeta as S, getCurrentPageChain as T, normalizeRouteSegmentName as U, snapshotRouteState as V, parseSegments as W, clearRouteState as _, resolveRouteFromRoutes as a, getActiveRoutes as b, removeRouteBasePath as c, deepFreeze as d, makeQuery as f, assertRouteRegistrationUnlocked as g, addRouteToStores as h, getMatchingRouteRecord as i, getRouteList as j, getDefaultRouteAuthOptions as k, buildRouteContext as l, _setActiveRouteAuthOptions as m, computeMatchesFromRoutes as n, addRouteBasePath as o, parseLocation as p, computeRouteActivityMatches as r, normalizeRouteBasePath as s, _resolveRouteMatchFromRoutes as t, buildRouteContextBase as u, getActiveRouteAuthOptions as v, getCurrentLayoutChain as w, getCurrentInheritedAuthRequirements as x, getActiveRouteBasePath as y, setDefaultRouteAuthOptions as z };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as RenderableChild } from "../control-
|
|
1
|
+
import { u as RenderableChild } from "../control-DhUZU4_V.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../jsx-Dvr2SGRG.js";
|
|
3
|
-
import { A as RouteHandler, B as RouteQuery, C as Route, D as RouteContext, E as RouteComponent, F as RouteMode, G as RouteRegistryOptions, H as RouteRef, I as RouteOptions, J as RouteRequestResult, K as RouteRenderResult, L as RouteParams, M as RouteMatch, N as RouteMeta, O as RouteDefinition, P as RouteMetaSource, R as RoutePathParams, S as ParsedSegment, T as RouteAuthResolver, U as RouteRefSearch, V as RouteRecord, W as RouteRegistry, X as RouteSearchValue, Y as RouteSearch, Z as RouteSnapshot, _ as AccessRedirectStatus, b as PageHelperOptions, f as AccessAllowDecision, g as AccessRedirectDecision, h as AccessDenyStatus, j as RouteManifest, k as RouteDestination, m as AccessDenyDecision, p as AccessDecision, q as RouteRequestOptions, v as GroupHelperOptions, w as RouteAuthOptions, x as PageScopeRecord, y as LayoutScopeRecord, z as RoutePolicy } from "../index-
|
|
3
|
+
import { A as RouteHandler, B as RouteQuery, C as Route, D as RouteContext, E as RouteComponent, F as RouteMode, G as RouteRegistryOptions, H as RouteRef, I as RouteOptions, J as RouteRequestResult, K as RouteRenderResult, L as RouteParams, M as RouteMatch, N as RouteMeta, O as RouteDefinition, P as RouteMetaSource, R as RoutePathParams, S as ParsedSegment, T as RouteAuthResolver, U as RouteRefSearch, V as RouteRecord, W as RouteRegistry, X as RouteSearchValue, Y as RouteSearch, Z as RouteSnapshot, _ as AccessRedirectStatus, b as PageHelperOptions, f as AccessAllowDecision, g as AccessRedirectDecision, h as AccessDenyStatus, j as RouteManifest, k as RouteDestination, m as AccessDenyDecision, p as AccessDecision, q as RouteRequestOptions, v as GroupHelperOptions, w as RouteAuthOptions, x as PageScopeRecord, y as LayoutScopeRecord, z as RoutePolicy } from "../index-pIgGaXvS.js";
|
|
4
4
|
import "../types-C9YcqVpk.js";
|
|
5
|
-
import { a as ScrollRestorationOptions, i as NavigationScrollBehavior, n as NavigateOptions, r as HistoryScrollBehavior, t as navigate } from "../navigate-
|
|
6
|
-
import { i as onRouteChange, n as RouteChangeOptions, r as currentRoute, t as RouteChangeCleanup } from "../activity-
|
|
5
|
+
import { a as ScrollRestorationOptions, i as NavigationScrollBehavior, n as NavigateOptions, r as HistoryScrollBehavior, t as navigate } from "../navigate-NyIjQUwI.js";
|
|
6
|
+
import { i as onRouteChange, n as RouteChangeOptions, r as currentRoute, t as RouteChangeCleanup } from "../activity-B1I5HJQI.js";
|
|
7
7
|
import { AuthContext, AuthContext as AuthContext$1, AuthRequirement, AuthRequirement as AuthRequirement$1 } from "@askrjs/auth";
|
|
8
8
|
import { ObjectSchema } from "@askrjs/schema";
|
|
9
9
|
//#region src/router/route-query.d.ts
|
|
@@ -29,7 +29,7 @@ type RouteComponentParam<TComponent extends AnyRouteComponent> = Parameters<TCom
|
|
|
29
29
|
type CompatibleAbsoluteRouteComponent<Path extends string, TComponent extends AnyRouteComponent> = Parameters<TComponent> extends [] ? TComponent : RoutePathParams<Path> extends RouteComponentParam<TComponent> ? TComponent : never;
|
|
30
30
|
type CompatibleRelativeRouteComponent<Path extends string, TComponent extends AnyRouteComponent> = Parameters<TComponent> extends [] ? TComponent : RouteComponentParam<TComponent> extends Record<keyof RoutePathParams<Path>, string> ? TComponent : never;
|
|
31
31
|
type CompatibleRouteComponent<Path extends string, TComponent extends AnyRouteComponent> = Path extends `/${string}` ? CompatibleAbsoluteRouteComponent<Path, TComponent> : CompatibleRelativeRouteComponent<Path, TComponent>;
|
|
32
|
-
type RouteOptionsForComponent<Path extends string, TComponent extends AnyRouteComponent, TSearchSchema extends ObjectSchema<RouteSearch> | undefined = ObjectSchema<RouteSearch> | undefined> = Parameters<TComponent> extends [] ? RouteOptions<RoutePathParams<Path>, TSearchSchema> : RouteComponentParam<TComponent> extends RouteParams ? RouteOptions<RouteComponentParam<TComponent>, TSearchSchema> : RouteOptions<RoutePathParams<Path>, TSearchSchema>;
|
|
32
|
+
type RouteOptionsForComponent<Path extends string, TComponent extends AnyRouteComponent, TSearchSchema extends ObjectSchema<RouteSearch> | undefined = ObjectSchema<RouteSearch> | undefined, TLoaderData = unknown, TDehydratedData = TLoaderData> = Parameters<TComponent> extends [] ? RouteOptions<RoutePathParams<Path>, TSearchSchema, TLoaderData, TDehydratedData> : RouteComponentParam<TComponent> extends RouteParams ? RouteOptions<RouteComponentParam<TComponent>, TSearchSchema, TLoaderData, TDehydratedData> : RouteOptions<RoutePathParams<Path>, TSearchSchema, TLoaderData, TDehydratedData>;
|
|
33
33
|
declare function group(options: GroupHelperOptions, fn: RouteDefinition): void;
|
|
34
34
|
declare function page<const TPath extends string>(path: TPath, Component: RouteComponent<RoutePathParams<TPath>>, fn: RouteDefinition): void;
|
|
35
35
|
declare function page<const TPath extends string, TComponent extends AnyRouteComponent>(path: TPath, Component: CompatibleRouteComponent<TPath, TComponent>, fn: RouteDefinition): void;
|
|
@@ -37,8 +37,8 @@ declare function page<const TPath extends string>(path: TPath, Component: RouteC
|
|
|
37
37
|
declare function page<const TPath extends string, TComponent extends AnyRouteComponent>(path: TPath, Component: CompatibleRouteComponent<TPath, TComponent>, options: PageHelperOptions, fn: RouteDefinition): void;
|
|
38
38
|
declare function index(Component: RouteComponent, options?: RouteOptions): void;
|
|
39
39
|
declare function fallback(Component: RouteComponent): void;
|
|
40
|
-
declare function route<const TPath extends string, const TSearchSchema extends ObjectSchema<RouteSearch> | undefined = undefined>(path: TPath, Component: RouteComponent<RoutePathParams<TPath>>, options?: RouteOptions<RoutePathParams<TPath>, TSearchSchema>): RouteRef<RoutePathParams<TPath>, RouteRefSearch<TSearchSchema>>;
|
|
41
|
-
declare function route<const TPath extends string, TComponent extends AnyRouteComponent, const TSearchSchema extends ObjectSchema<RouteSearch> | undefined = undefined>(path: TPath, Component: CompatibleRouteComponent<TPath, TComponent>, options?: RouteOptionsForComponent<TPath, TComponent, TSearchSchema>): RouteRef<RoutePathParams<TPath>, RouteRefSearch<TSearchSchema>>;
|
|
40
|
+
declare function route<const TPath extends string, const TSearchSchema extends ObjectSchema<RouteSearch> | undefined = undefined, TLoaderData = unknown, TDehydratedData = TLoaderData>(path: TPath, Component: RouteComponent<RoutePathParams<TPath>>, options?: RouteOptions<RoutePathParams<TPath>, TSearchSchema, TLoaderData, TDehydratedData>): RouteRef<RoutePathParams<TPath>, RouteRefSearch<TSearchSchema>>;
|
|
41
|
+
declare function route<const TPath extends string, TComponent extends AnyRouteComponent, const TSearchSchema extends ObjectSchema<RouteSearch> | undefined = undefined, TLoaderData = unknown, TDehydratedData = TLoaderData>(path: TPath, Component: CompatibleRouteComponent<TPath, TComponent>, options?: RouteOptionsForComponent<TPath, TComponent, TSearchSchema, TLoaderData, TDehydratedData>): RouteRef<RoutePathParams<TPath>, RouteRefSearch<TSearchSchema>>;
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/router/auth.d.ts
|
|
44
44
|
/** Return the identity resolved for the route currently being rendered. */
|
package/dist/router/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as currentAuth, O as lazy, a as resolveDeferredValues, i as isDeferred, l as createRouteRegistry, m as resolveRouteRequest, n as Resolve, r as defer, s as routeData, w as Outlet } from "../deferred-vUOy-awa.js";
|
|
2
|
+
import { o as addRouteBasePath, y as getActiveRouteBasePath } from "../route-matching-DHduNiGk.js";
|
|
3
|
+
import { a as isSafeHref } from "../csp-nonce-Bc52OIVc.js";
|
|
3
4
|
import { jsx } from "../jsx-runtime.js";
|
|
4
|
-
import { a as route, i as page, n as group, r as index, t as fallback } from "../authoring-
|
|
5
|
-
import { n as onRouteChange, t as currentRoute } from "../activity-
|
|
6
|
-
import { a as serializeRouteMeta, c as getCurrentHref, d as parseTargetUrl, h as syncRegisteredRouteSnapshot, i as resolveRouteMeta, l as getRegisteredAppsSnapshot, m as syncAppRegistrationLocation, n as navigate, p as setCurrentRouteLocation, r as reconcileRouteMeta, s as saveScrollPosition, u as getWindowHref } from "../navigate-
|
|
5
|
+
import { a as route, i as page, n as group, r as index, t as fallback } from "../authoring-DdQ3pHqt.js";
|
|
6
|
+
import { n as onRouteChange, t as currentRoute } from "../activity-Jd9CgEa3.js";
|
|
7
|
+
import { a as serializeRouteMeta, c as getCurrentHref, d as parseTargetUrl, h as syncRegisteredRouteSnapshot, i as resolveRouteMeta, l as getRegisteredAppsSnapshot, m as syncAppRegistrationLocation, n as navigate, p as setCurrentRouteLocation, r as reconcileRouteMeta, s as saveScrollPosition, u as getWindowHref } from "../navigate-b4GGxO_l.js";
|
|
7
8
|
import { o as mergeProps } from "../compose-ref-Cc_YkUpM.js";
|
|
8
9
|
import { t as applyInteractionPolicy } from "../interactions-DgGQyUQv.js";
|
|
9
10
|
//#region src/router/route-query.ts
|
|
@@ -116,7 +117,7 @@ function formatSearchIssues(issues) {
|
|
|
116
117
|
return issues.map((issue) => `${issue.path.length ? issue.path.join(".") : "search"}: ${issue.message}`).join("; ");
|
|
117
118
|
}
|
|
118
119
|
function to(route, params, search) {
|
|
119
|
-
const path = buildPath(route, params);
|
|
120
|
+
const path = addRouteBasePath(buildPath(route, params), route.basePath ?? "");
|
|
120
121
|
const parsedSearch = route.searchSchema?.safeParse(search ?? {});
|
|
121
122
|
if (parsedSearch && !parsedSearch.success) throw new Error(`Invalid route search. ${formatSearchIssues(parsedSearch.issues)}`);
|
|
122
123
|
const values = parsedSearch?.success ? parsedSearch.data : search;
|
|
@@ -167,7 +168,8 @@ function isSameOriginNavigableHref(href) {
|
|
|
167
168
|
* - Composable via mergeProps
|
|
168
169
|
*/
|
|
169
170
|
function Link({ href: suppliedHref, to, class: className, children, rel, target, "aria-current": ariaCurrent, "aria-label": ariaLabel, onPress, onClick, ...rest }) {
|
|
170
|
-
const
|
|
171
|
+
const supplied = to?.href ?? suppliedHref;
|
|
172
|
+
const href = supplied ? addRouteBasePath(supplied, getActiveRouteBasePath()) : supplied;
|
|
171
173
|
if (!href) throw new Error("Link requires href or to.");
|
|
172
174
|
if (!isSafeHref(href)) throw new TypeError("Link href uses an unsafe URL scheme.");
|
|
173
175
|
const handleNavigation = (e) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane } from "./access-
|
|
2
|
-
import { c as markReadableUsage, f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-_GQGe_St.js";
|
|
1
|
+
import { t as enqueueRuntimeLane } from "./access-Dpfoi4cA.js";
|
|
3
2
|
import { i as claimHookIndex, p as getCurrentInstance } from "./component-scope-DzJEbYGE.js";
|
|
3
|
+
import { c as markReadableUsage, f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-B5NtV7V0.js";
|
|
4
4
|
//#region src/runtime/selector-store.ts
|
|
5
5
|
const dirtySelectorRecords = /* @__PURE__ */ new Set();
|
|
6
6
|
let hasPendingSelectorFlush = false;
|
package/dist/ssg/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as DocumentRenderArgs, m as DocumentRenderer, p as DocumentRenderContext } from "../control-
|
|
2
|
-
import { A as RouteHandler, I as RouteOptions, R as RoutePathParams, W as RouteRegistry, z as RoutePolicy } from "../index-
|
|
1
|
+
import { _ as SSRStyleRegistrationValidation, f as DocumentRenderArgs, m as DocumentRenderer, p as DocumentRenderContext } from "../control-DhUZU4_V.js";
|
|
2
|
+
import { A as RouteHandler, I as RouteOptions, R as RoutePathParams, W as RouteRegistry, z as RoutePolicy } from "../index-pIgGaXvS.js";
|
|
3
3
|
import { AuthRequirement } from "@askrjs/auth";
|
|
4
4
|
import "node:fs/promises";
|
|
5
5
|
//#region src/ssg/types.d.ts
|
|
@@ -31,6 +31,10 @@ interface RouteConfig<Path extends string = string> {
|
|
|
31
31
|
invalidationKeys?: string[];
|
|
32
32
|
/** Route loader resolved completely before static HTML is rendered. */
|
|
33
33
|
loader?: RouteOptions['loader'];
|
|
34
|
+
/** Select the loader data transported for initial hydration. */
|
|
35
|
+
dehydrate?: RouteOptions['dehydrate'];
|
|
36
|
+
/** @internal Public mount point inherited from the owning registry. */
|
|
37
|
+
basePath?: string;
|
|
34
38
|
/**
|
|
35
39
|
* SSG entry generator for parameterized routes.
|
|
36
40
|
*
|
|
@@ -54,6 +58,8 @@ interface SSGBaseOptions {
|
|
|
54
58
|
dataOverrides?: Record<string, unknown>;
|
|
55
59
|
/** Optional document wrapper for full HTML output */
|
|
56
60
|
document?: DocumentRenderer;
|
|
61
|
+
/** Diagnose document renderers that omit request-local SSR style registrations. */
|
|
62
|
+
styleRegistrationValidation?: SSRStyleRegistrationValidation;
|
|
57
63
|
/** Static files or directories published with the generated routes. */
|
|
58
64
|
assets?: readonly SSGAssetSource[];
|
|
59
65
|
/** Optional concurrency limit for rendering (default: 1) */
|
|
@@ -242,4 +248,4 @@ declare function createStaticGen(options: SSGOptions): {
|
|
|
242
248
|
getResult(): SSGResult | null;
|
|
243
249
|
};
|
|
244
250
|
//#endregion
|
|
245
|
-
export { type DiscoveredResources, type DocumentRenderArgs, type DocumentRenderContext, type DocumentRenderer, type RouteConfig, type RouteRenderReason, type RouteRenderResult, type RouteRenderStatus, type SSGAssetSource, type SSGGenerateOptions, type SSGMetadata, type SSGMode, type SSGOptions, type SSGResult, createStaticGen };
|
|
251
|
+
export { type DiscoveredResources, type DocumentRenderArgs, type DocumentRenderContext, type DocumentRenderer, type RouteConfig, type RouteRenderReason, type RouteRenderResult, type RouteRenderStatus, type SSGAssetSource, type SSGGenerateOptions, type SSGMetadata, type SSGMode, type SSGOptions, type SSGResult, type SSRStyleRegistrationValidation, createStaticGen };
|