@askrjs/askr 0.2.1 → 0.2.3
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/CHANGELOG.md +12 -0
- package/README.md +32 -4
- package/capabilities.json +9 -2
- package/dist/{access-d_DCdwqn.js → access-Rr7CMa06.js} +11 -8
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +5 -4
- package/dist/{activity-DOmzl9Yu.d.ts → activity-CAJ5eho-.d.ts} +1 -1
- package/dist/{activity-B2Yy7Wz9.js → activity-ZxJXI9hF.js} +2 -2
- package/dist/{compose-ref-1Fhs7mbF.js → aria-hKjThHcp.js} +1 -18
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +2 -2
- package/dist/boot/index.js +1 -1
- package/dist/{boot-DVwjHCNh.js → boot-D4GaLA0d.js} +12 -14
- package/dist/{cleanup-DPtpXtA4.js → cleanup-DsrbV-rr.js} +6 -11
- package/dist/{component-cleanup-DPe8claJ.js → component-cleanup-DjpwO9WX.js} +2 -2
- package/dist/{component-internal-xW_OnTmC.js → component-internal-Dl02WQKS.js} +15 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/compose-ref-Bfaf4kUC.js +20 -0
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-BLVTE1gO.js → control-57x3wa4J.js} +4 -4
- package/dist/{csp-nonce-CCnMtOW-.js → csp-nonce-C9OuML0U.js} +1 -1
- package/dist/data/index.d.ts +2 -2
- package/dist/data/index.js +2 -2
- package/dist/{data-CAXqJzoS.js → data-B7XCDeC8.js} +268 -35
- package/dist/{deferred-BRw0gbn5.js → deferred-BELyvMsC.js} +2 -2
- package/dist/{effect-BQP5o0Kx.js → effect-4LwBwV58.js} +2 -2
- package/dist/{fastlane-DUxiFV9S.js → fastlane-Buz1Rvlr.js} +2 -2
- package/dist/{for-internal-DKcYl3nl.js → for-internal-DeoSg_AV.js} +5 -5
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +1 -1
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.d.ts +1 -1
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +1 -1
- package/dist/foundations/structures/index.js +1 -1
- package/dist/foundations/utilities/index.d.ts +1 -1
- package/dist/foundations/utilities/index.js +2 -1
- package/dist/fx/index.d.ts +1 -1
- package/dist/fx/index.js +1 -1
- package/dist/{index-CzH-0LcA.d.ts → index-B1gu0_m0.d.ts} +2 -0
- package/dist/{index-B1p8bHZE.d.ts → index-DSqXWc77.d.ts} +34 -1
- package/dist/{index-zEdpHD86.d.ts → index-r5THqzPN.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -11
- package/dist/{interactions-B-7vkBgx.js → interactions-D102JxBR.js} +10 -3
- package/dist/{lifecycle-batch-BYECQw8T.js → lifecycle-batch-Be-CLDjV.js} +2 -2
- package/dist/{lifecycle-operations-DJk_5MrD.js → lifecycle-operations-C5m03NQc.js} +1 -1
- package/dist/{navigate-DvJvo--6.js → navigate-C46GtScG.js} +9 -9
- package/dist/{navigate-DUcj-nLs.d.ts → navigate-wel1e6cU.d.ts} +1 -1
- package/dist/{readable-D-JIKCg2.js → readable-CEcteIDE.js} +1 -1
- package/dist/{renderer-RjZ8LHbt.js → renderer-BhXofszH.js} +15 -16
- package/dist/{resolution-dVYwYXrI.js → resolution-t8J0yNaU.js} +3 -3
- package/dist/{resource-operation-4qFIM02d.js → resource-operation-B8q-QRUx.js} +4 -4
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +5 -5
- package/dist/router/index.d.ts +3 -3
- package/dist/router/index.js +7 -7
- package/dist/{selector-NQiYHwZC.js → selector-C7rIpOnN.js} +2 -2
- package/dist/shared-CGrx2AOL.js +27 -0
- package/dist/ssg/index.d.ts +1 -1
- package/dist/ssg/index.js +4 -4
- package/dist/ssr/index.d.ts +7 -1
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-F87AcFMt.js → ssr-BaC5qHEw.js} +26 -15
- package/dist/{state-Ks-sWTQi.js → state-BzhOW2TX.js} +3 -3
- package/dist/{structures-C-wmHCi6.js → structures-BwfeO4Iz.js} +4 -4
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +4 -4
- package/dist/{verify-hydration-CThsx0pq.js → verify-hydration-_Q6avFp0.js} +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as getRuntimeFlushVersion, f as AskrRuntime, h as getDefaultRuntime, m as createRuntime, t as enqueueRuntimeLane } from "./access-
|
|
1
|
+
import { a as getRuntimeFlushVersion, f as AskrRuntime, h as getDefaultRuntime, m as createRuntime, t as enqueueRuntimeLane } from "./access-Rr7CMa06.js";
|
|
2
2
|
import { g as getSignal, i as claimHookIndex, p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
|
|
3
3
|
import { n as Fragment } from "./jsx-DRS-qjiN.js";
|
|
4
|
-
import { d as configureRenderDiagnostics, p as defineScope, y as readScope } from "./component-internal-
|
|
5
|
-
import { f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-
|
|
4
|
+
import { d as configureRenderDiagnostics, p as defineScope, y as readScope } from "./component-internal-Dl02WQKS.js";
|
|
5
|
+
import { f as syncDerivedDependencySubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, p as withDerivedReadTracking, r as clearDerivedDependencySubscriptions, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-CEcteIDE.js";
|
|
6
6
|
import { n as isSnapshotSource } from "./snapshot-source-BB42xgwb.js";
|
|
7
7
|
import { c as registerSSRStyle } from "./render-context-B7ohlh6t.js";
|
|
8
|
-
import { t as state } from "./state-
|
|
9
|
-
import { t as selector } from "./selector-
|
|
10
|
-
import { t as installRendererBridge } from "./renderer-
|
|
11
|
-
import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-
|
|
12
|
-
import { i as For, n as Match, r as Show, t as Case } from "./control-
|
|
8
|
+
import { t as state } from "./state-BzhOW2TX.js";
|
|
9
|
+
import { t as selector } from "./selector-C7rIpOnN.js";
|
|
10
|
+
import { t as installRendererBridge } from "./renderer-BhXofszH.js";
|
|
11
|
+
import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-C9OuML0U.js";
|
|
12
|
+
import { i as For, n as Match, r as Show, t as Case } from "./control-57x3wa4J.js";
|
|
13
13
|
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
14
|
-
import {
|
|
14
|
+
import { n as createQuery, t as createQueryCollection } from "./data-B7XCDeC8.js";
|
|
15
15
|
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-Bua3cDyb.js";
|
|
16
16
|
//#region src/runtime/derive.ts
|
|
17
17
|
const deriveCells = /* @__PURE__ */ new WeakMap();
|
|
@@ -176,10 +176,10 @@ function createRef() {
|
|
|
176
176
|
//#endregion
|
|
177
177
|
//#region src/index.ts
|
|
178
178
|
/**
|
|
179
|
-
* Askr:
|
|
179
|
+
* Askr: Lane-scheduled deterministic UI framework
|
|
180
180
|
*
|
|
181
181
|
* Public API surface — only users should import from here
|
|
182
182
|
*/
|
|
183
183
|
installRendererBridge();
|
|
184
184
|
//#endregion
|
|
185
|
-
export { AskrRuntime, Case, CspNonceScope, For, Fragment, Match, Show, configureRenderDiagnostics, createQuery, createRef, createRuntime, cspNonce, defineQuery, defineScope, defineServerQueries, dehydrateDataRuntime, derive, getDefaultRuntime, getSignal, hydrateDataRuntime, jsx, jsxs, prefetchQuery, readScope, registerSSRStyle, selector, serveQuery, state };
|
|
185
|
+
export { AskrRuntime, Case, CspNonceScope, For, Fragment, Match, Show, configureRenderDiagnostics, createQuery, createQueryCollection, createRef, createRuntime, cspNonce, defineQuery, defineScope, defineServerQueries, dehydrateDataRuntime, derive, getDefaultRuntime, getSignal, hydrateDataRuntime, jsx, jsxs, prefetchQuery, readScope, registerSSRStyle, selector, serveQuery, state };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as composeRefs } from "./compose-ref-Bfaf4kUC.js";
|
|
2
|
+
import { a as composeHandlers, i as mergeProps, t as ariaDisabled } from "./aria-hKjThHcp.js";
|
|
2
3
|
//#region src/foundations/interactions/pressable.ts
|
|
3
4
|
/** Produce click/keyboard props implementing 'press' semantics for an element. */
|
|
4
5
|
function pressable({ disabled, onPress, isNativeButton = false }) {
|
|
@@ -121,8 +122,9 @@ function rovingFocus(options) {
|
|
|
121
122
|
const { key } = e;
|
|
122
123
|
let direction;
|
|
123
124
|
if (orientation === "horizontal" || orientation === "both") {
|
|
124
|
-
|
|
125
|
-
if (key === "
|
|
125
|
+
const textDirection = resolveTextDirection(e);
|
|
126
|
+
if (key === "ArrowRight") direction = textDirection === "rtl" ? -1 : 1;
|
|
127
|
+
if (key === "ArrowLeft") direction = textDirection === "rtl" ? 1 : -1;
|
|
126
128
|
}
|
|
127
129
|
if (orientation === "vertical" || orientation === "both") {
|
|
128
130
|
if (key === "ArrowDown") direction = 1;
|
|
@@ -143,6 +145,11 @@ function rovingFocus(options) {
|
|
|
143
145
|
})
|
|
144
146
|
};
|
|
145
147
|
}
|
|
148
|
+
function resolveTextDirection(event) {
|
|
149
|
+
const candidate = event.currentTarget ?? event.target;
|
|
150
|
+
if (typeof Element === "undefined" || !(candidate instanceof Element)) return "ltr";
|
|
151
|
+
return candidate.ownerDocument.defaultView?.getComputedStyle(candidate).direction === "rtl" ? "rtl" : "ltr";
|
|
152
|
+
}
|
|
146
153
|
/**
|
|
147
154
|
* USAGE EXAMPLE:
|
|
148
155
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { y as logger } from "./access-
|
|
2
|
-
import { a as finalizeReadableSubscriptionsFromSnapshot } from "./readable-
|
|
1
|
+
import { y as logger } from "./access-Rr7CMa06.js";
|
|
2
|
+
import { a as finalizeReadableSubscriptionsFromSnapshot } from "./readable-CEcteIDE.js";
|
|
3
3
|
//#region src/common/promise.ts
|
|
4
4
|
function isPromiseLike(value) {
|
|
5
5
|
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as getCurrentComponentInstance, i as claimHookIndex } from "./component-scope-4I3yEMkb.js";
|
|
2
|
-
import { a as registerCommitOperation } from "./component-internal-
|
|
2
|
+
import { a as registerCommitOperation } from "./component-internal-Dl02WQKS.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,14 +1,14 @@
|
|
|
1
|
-
import { S as isProductionEnvironment, r as flushRuntimeScheduler, x as isDevelopmentEnvironment, y as logger } from "./access-
|
|
1
|
+
import { S as isProductionEnvironment, r as flushRuntimeScheduler, x as isDevelopmentEnvironment, y as logger } from "./access-Rr7CMa06.js";
|
|
2
2
|
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.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 { t as CspNonceScope } from "./csp-nonce-
|
|
3
|
+
import { r as executeComponent } from "./component-internal-Dl02WQKS.js";
|
|
4
|
+
import { t as cleanupReadableSubscriptionSources } from "./readable-CEcteIDE.js";
|
|
5
|
+
import { n as cleanupComponentGeneration, t as cleanupComponent } from "./component-cleanup-DjpwO9WX.js";
|
|
6
|
+
import { i as drainLifecycleCommitErrors, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-Be-CLDjV.js";
|
|
7
|
+
import { _ as teardownNodeSubtree } from "./cleanup-DsrbV-rr.js";
|
|
8
|
+
import { t as CspNonceScope } from "./csp-nonce-C9OuML0U.js";
|
|
9
9
|
import { I as lockRouteRegistration, o as addRouteBasePath, r as computeRouteActivityMatches, y as getActiveRouteBasePath } from "./route-matching-Bo6UqG-5.js";
|
|
10
|
-
import { a as resolveRouteRequest, i as hasRouteRenderData, n as getRouteRenderContext, r as getRouteRenderData, u as withoutRouteHydrationMetadata } from "./resolution-
|
|
11
|
-
import { a as clearStagedAppRenderRouteLocation, i as syncCurrentRouteSnapshot, o as createAppRenderRuntime, s as stageAppRenderRouteLocation } from "./activity-
|
|
10
|
+
import { a as resolveRouteRequest, i as hasRouteRenderData, n as getRouteRenderContext, r as getRouteRenderData, u as withoutRouteHydrationMetadata } from "./resolution-t8J0yNaU.js";
|
|
11
|
+
import { a as clearStagedAppRenderRouteLocation, i as syncCurrentRouteSnapshot, o as createAppRenderRuntime, s as stageAppRenderRouteLocation } from "./activity-ZxJXI9hF.js";
|
|
12
12
|
import { r as getDefaultPortalHost, t as clearRegisteredDefaultPortalForInstance } from "./default-portal-runtime-DvMvWJVp.js";
|
|
13
13
|
//#region src/router/navigation-registry.ts
|
|
14
14
|
let currentInstance = null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as markRuntimeReactivePropsDirtySource, n as enqueueRuntimeTask, s as isRuntimeSchedulerExecuting } from "./access-
|
|
1
|
+
import { c as markRuntimeReactivePropsDirtySource, n as enqueueRuntimeTask, s as isRuntimeSchedulerExecuting } from "./access-Rr7CMa06.js";
|
|
2
2
|
import { p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
|
|
3
3
|
//#region src/runtime/readable.ts
|
|
4
4
|
const DEVELOPMENT_BUILD_ENABLED = false;
|
|
@@ -1,17 +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 getRuntimeEnv, i as getDefaultRuntimeInstance, l as runRuntimeHandlerScope, n as enqueueRuntimeTask, p as configureRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-
|
|
4
|
-
import { n as isBulkCommitActive, r as markFastPathApplied } from "./fastlane-
|
|
3
|
+
import { b as getRuntimeEnv, i as getDefaultRuntimeInstance, l as runRuntimeHandlerScope, n as enqueueRuntimeTask, p as configureRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-Rr7CMa06.js";
|
|
4
|
+
import { n as isBulkCommitActive, r as markFastPathApplied } from "./fastlane-Buz1Rvlr.js";
|
|
5
5
|
import { T as withAppRenderRuntime, b as restoreDomCommitScope, c as enterDomCommitScope, d as getCurrentAppRenderRuntime, p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
|
|
6
6
|
import { i as isFragmentType, r as STATIC_CHILDREN } from "./jsx-DRS-qjiN.js";
|
|
7
|
-
import { S as withContext, c as createBoundaryReset, g as getVNodeContextFrame, i as mountInstanceInline, l as reportBoundaryError, m as getCurrentContextFrame, n as createComponentInstance, o as renderComponentInline, t as captureInlineRenderSnapshot, v as markVNodeTreeWithContextFrame } from "./component-internal-
|
|
8
|
-
import { t as cleanupComponent } from "./component-cleanup-
|
|
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-
|
|
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-
|
|
11
|
-
import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-
|
|
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-
|
|
7
|
+
import { S as withContext, c as createBoundaryReset, g as getVNodeContextFrame, i as mountInstanceInline, l as reportBoundaryError, m as getCurrentContextFrame, n as createComponentInstance, o as renderComponentInline, t as captureInlineRenderSnapshot, v as markVNodeTreeWithContextFrame } from "./component-internal-Dl02WQKS.js";
|
|
8
|
+
import { t as cleanupComponent } from "./component-cleanup-DjpwO9WX.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-Be-CLDjV.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-DeoSg_AV.js";
|
|
11
|
+
import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-4LwBwV58.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-DsrbV-rr.js";
|
|
13
|
+
import { n as setRef } from "./compose-ref-Bfaf4kUC.js";
|
|
13
14
|
import { n as getPublicAttributeName, t as sanitizeCssValue } from "./css-BuPaTOfe.js";
|
|
14
|
-
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-
|
|
15
|
+
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-C9OuML0U.js";
|
|
15
16
|
import { a as isSSRPortalHydrationAnchor } from "./portal-w3oQ6oQU.js";
|
|
16
17
|
//#region src/renderer/utils.ts
|
|
17
18
|
/**
|
|
@@ -330,7 +331,10 @@ function registerRange(range, owner) {
|
|
|
330
331
|
if (!owner) return;
|
|
331
332
|
const previousStartOwner = ownersByAnchor.get(range.start);
|
|
332
333
|
const previousEndOwner = ownersByAnchor.get(range.end);
|
|
333
|
-
for (const previousOwner of [previousStartOwner, previousEndOwner])
|
|
334
|
+
for (const previousOwner of [previousStartOwner, previousEndOwner]) {
|
|
335
|
+
const previousRange = previousOwner ? rangesByOwner.get(previousOwner) : void 0;
|
|
336
|
+
if (previousOwner && previousOwner !== owner && previousRange && (previousRange.start === range.start || previousRange.end === range.end)) rangesByOwner.delete(previousOwner);
|
|
337
|
+
}
|
|
334
338
|
rangesByOwner.set(owner, range);
|
|
335
339
|
ownersByAnchor.set(range.start, owner);
|
|
336
340
|
if (range.end !== range.start) ownersByAnchor.set(range.end, owner);
|
|
@@ -1907,13 +1911,8 @@ function restoreFormControl(element, snapshot) {
|
|
|
1907
1911
|
if (checked !== void 0 && "checked" in control) control.checked = checked;
|
|
1908
1912
|
}
|
|
1909
1913
|
function applyRefValue(ref, value) {
|
|
1910
|
-
if (!ref) return;
|
|
1911
1914
|
try {
|
|
1912
|
-
|
|
1913
|
-
ref(value);
|
|
1914
|
-
return;
|
|
1915
|
-
}
|
|
1916
|
-
if (Object.isExtensible(ref)) ref.current = value;
|
|
1915
|
+
setRef(ref, value);
|
|
1917
1916
|
} catch {}
|
|
1918
1917
|
}
|
|
1919
1918
|
function restoreRef(element, snapshot) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
2
|
-
import { p as defineScope, y as readScope } from "./component-internal-
|
|
3
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
2
|
+
import { p as defineScope, y as readScope } from "./component-internal-Dl02WQKS.js";
|
|
3
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Be-CLDjV.js";
|
|
4
4
|
import { S as withPageFramework, b as replacePageRoute, n as getActiveRenderContext } from "./render-context-B7ohlh6t.js";
|
|
5
|
-
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-
|
|
5
|
+
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-C9OuML0U.js";
|
|
6
6
|
import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-Bua3cDyb.js";
|
|
7
7
|
import { c as removeRouteBasePath, i as getMatchingRouteRecord, l as buildRouteContext, o as addRouteBasePath, s as normalizeRouteBasePath, u as buildRouteContextBase, v as getActiveRouteAuthOptions } from "./route-matching-Bo6UqG-5.js";
|
|
8
8
|
//#region src/router/route-data-loader.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane, y as logger } from "./access-
|
|
1
|
+
import { t as enqueueRuntimeLane, y as logger } from "./access-Rr7CMa06.js";
|
|
2
2
|
import { f as getCurrentComponentInstance } from "./component-scope-4I3yEMkb.js";
|
|
3
|
-
import { m as getCurrentContextFrame, u as registerCommitOperationForInstance, x as withAsyncResourceContext } from "./component-internal-
|
|
4
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
3
|
+
import { m as getCurrentContextFrame, u as registerCommitOperationForInstance, x as withAsyncResourceContext } from "./component-internal-Dl02WQKS.js";
|
|
4
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Be-CLDjV.js";
|
|
5
5
|
import { t as brandSnapshotSource } from "./snapshot-source-BB42xgwb.js";
|
|
6
6
|
import { C as SSRDataMissingError, a as getResourceVerificationSnapshot, i as getNextRenderKey, n as getActiveRenderContext, o as isHydrationVerificationRender, p as throwSSRDataMissing, r as getCurrentRenderData, s as recordResourceVerificationSnapshot } from "./render-context-B7ohlh6t.js";
|
|
7
|
-
import { t as state } from "./state-
|
|
7
|
+
import { t as state } from "./state-BzhOW2TX.js";
|
|
8
8
|
//#region src/runtime/resource-cell.ts
|
|
9
9
|
/**
|
|
10
10
|
* Pure, component-agnostic ResourceCell state machine.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-
|
|
1
|
+
import { Q as getSignal } from "../index-DSqXWc77.js";
|
|
2
|
+
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-CAJ5eho-.js";
|
|
3
3
|
//#region src/runtime/resource-operation.d.ts
|
|
4
4
|
/** Reactive result of a {@link resource}: current value, loading state, and controls. */
|
|
5
5
|
interface ResourceResult<T> {
|
package/dist/resources/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane } from "../access-
|
|
1
|
+
import { t as enqueueRuntimeLane } from "../access-Rr7CMa06.js";
|
|
2
2
|
import { f as getCurrentComponentInstance, g as getSignal, i as claimHookIndex } from "../component-scope-4I3yEMkb.js";
|
|
3
|
-
import { a as registerCommitOperation } from "../component-internal-
|
|
4
|
-
import { t as resource } from "../resource-operation-
|
|
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-
|
|
6
|
-
import { n as onRouteChange } from "../activity-
|
|
3
|
+
import { a as registerCommitOperation } from "../component-internal-Dl02WQKS.js";
|
|
4
|
+
import { t as resource } from "../resource-operation-B8q-QRUx.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-C5m03NQc.js";
|
|
6
|
+
import { n as onRouteChange } from "../activity-ZxJXI9hF.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));
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as AccessAllowDecision, At as RouteRefSearch, Ct as RouteOptions, Dt as RouteQuery, Et as RoutePolicy, Ft as RouteRequestResult, It as RouteSearch, Lt as RouteSearchValue, Mt as RouteRegistryOptions, Nt as RouteRenderResult, Ot as RouteRecord, Pt as RouteRequestOptions, Rt as RouteSnapshot, St as RouteMode, Tt as RoutePathParams, _t as RouteHandler, at as GroupHelperOptions, bt as RouteMeta, cn as RenderableChild, ct as PageScopeRecord, dt as RouteAuthOptions, et as AccessDecision, ft as RouteAuthResolver, gt as RouteDestination, ht as RouteDefinition, it as AccessRedirectStatus, jt as RouteRegistry, kt as RouteRef, lt as ParsedSegment, mt as RouteContext, nt as AccessDenyStatus, ot as LayoutScopeRecord, pt as RouteComponent, rt as AccessRedirectDecision, st as PageHelperOptions, tt as AccessDenyDecision, ut as Route, vt as RouteManifest, wt as RouteParams, xt as RouteMetaSource, yt as RouteMatch } from "../index-DSqXWc77.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../types-DkVJhVs9.js";
|
|
3
|
-
import { a as ScrollRestorationOptions, i as NavigationScrollBehavior, n as NavigateOptions, r as HistoryScrollBehavior, t as navigate } from "../navigate-
|
|
4
|
-
import { i as onRouteChange, n as RouteChangeOptions, r as currentRoute, t as RouteChangeCleanup } from "../activity-
|
|
3
|
+
import { a as ScrollRestorationOptions, i as NavigationScrollBehavior, n as NavigateOptions, r as HistoryScrollBehavior, t as navigate } from "../navigate-wel1e6cU.js";
|
|
4
|
+
import { i as onRouteChange, n as RouteChangeOptions, r as currentRoute, t as RouteChangeCleanup } from "../activity-CAJ5eho-.js";
|
|
5
5
|
import { AuthContext, AuthContext as AuthContext$1, AuthRequirement, AuthRequirement as AuthRequirement$1 } from "@askrjs/auth";
|
|
6
6
|
import { ObjectSchema } from "@askrjs/schema";
|
|
7
7
|
//#region src/router/route-query.d.ts
|
package/dist/router/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { n as createRouteRegistry } from "../manifest-D6rfj_jC.js";
|
|
2
|
-
import { a as isSafeHref } from "../csp-nonce-
|
|
2
|
+
import { a as isSafeHref } from "../csp-nonce-C9OuML0U.js";
|
|
3
3
|
import { jsx } from "../jsx-runtime.js";
|
|
4
4
|
import { o as addRouteBasePath, y as getActiveRouteBasePath } from "../route-matching-Bo6UqG-5.js";
|
|
5
|
-
import { a as group, c as route, i as fallback, n as resolveDeferredValues, o as index, r as routeData, s as page, t as Resolve } from "../deferred-
|
|
6
|
-
import { S as RouteDataLoadError, a as resolveRouteRequest, b as lazy, f as defer, g as Outlet, h as currentAuth, p as isDeferred, x as lazyRouteData } from "../resolution-
|
|
7
|
-
import { n as onRouteChange, t as currentRoute } from "../activity-
|
|
8
|
-
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-
|
|
9
|
-
import {
|
|
10
|
-
import { t as applyInteractionPolicy } from "../interactions-
|
|
5
|
+
import { a as group, c as route, i as fallback, n as resolveDeferredValues, o as index, r as routeData, s as page, t as Resolve } from "../deferred-BELyvMsC.js";
|
|
6
|
+
import { S as RouteDataLoadError, a as resolveRouteRequest, b as lazy, f as defer, g as Outlet, h as currentAuth, p as isDeferred, x as lazyRouteData } from "../resolution-t8J0yNaU.js";
|
|
7
|
+
import { n as onRouteChange, t as currentRoute } from "../activity-ZxJXI9hF.js";
|
|
8
|
+
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-C46GtScG.js";
|
|
9
|
+
import { i as mergeProps } from "../aria-hKjThHcp.js";
|
|
10
|
+
import { t as applyInteractionPolicy } from "../interactions-D102JxBR.js";
|
|
11
11
|
//#region src/router/route-query.ts
|
|
12
12
|
function getRouteQueryHistoryMode(options) {
|
|
13
13
|
if (options.history) return options.history;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane } from "./access-
|
|
1
|
+
import { t as enqueueRuntimeLane } from "./access-Rr7CMa06.js";
|
|
2
2
|
import { i as claimHookIndex, p as getCurrentInstance } from "./component-scope-4I3yEMkb.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-
|
|
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-CEcteIDE.js";
|
|
4
4
|
//#region src/runtime/selector-store.ts
|
|
5
5
|
const dirtySelectorRecords = /* @__PURE__ */ new Set();
|
|
6
6
|
let hasPendingSelectorFlush = false;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty } from "./readable-CEcteIDE.js";
|
|
2
|
+
//#region src/data/shared.ts
|
|
3
|
+
function createReadableSource() {
|
|
4
|
+
return (() => void 0);
|
|
5
|
+
}
|
|
6
|
+
function notifySource(source) {
|
|
7
|
+
markReadableDerivedSubscribersDirty(source);
|
|
8
|
+
markReactivePropsDirtySource(source);
|
|
9
|
+
notifyReadableReaders(source);
|
|
10
|
+
}
|
|
11
|
+
function isAbortError(error, signal) {
|
|
12
|
+
return signal.aborted || error instanceof Error && error.name === "AbortError" || typeof DOMException !== "undefined" && error instanceof DOMException && error.name === "AbortError";
|
|
13
|
+
}
|
|
14
|
+
/** Whether an async result still belongs to the latest generation. */
|
|
15
|
+
function isCurrentAsyncGeneration(currentGeneration, capturedGeneration) {
|
|
16
|
+
return currentGeneration === capturedGeneration;
|
|
17
|
+
}
|
|
18
|
+
/** Whether an async result still owns both its generation and controller. */
|
|
19
|
+
function isCurrentAsyncOperation(currentGeneration, capturedGeneration, currentController, capturedController) {
|
|
20
|
+
return isCurrentAsyncGeneration(currentGeneration, capturedGeneration) && currentController === capturedController;
|
|
21
|
+
}
|
|
22
|
+
function normalizeAsyncDataError(error, fallbackMessage) {
|
|
23
|
+
if (error instanceof Error) return error;
|
|
24
|
+
return new Error(error == null ? fallbackMessage : String(error));
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { normalizeAsyncDataError as a, isCurrentAsyncOperation as i, isAbortError as n, notifySource as o, isCurrentAsyncGeneration as r, createReadableSource as t };
|
package/dist/ssg/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as RouteOptions, Et as RoutePolicy, Tt as RoutePathParams, _t as RouteHandler, dn as DocumentRenderContext, fn as DocumentRenderer, hn as SSRStyleRegistrationValidation, jt as RouteRegistry, un as DocumentRenderArgs } from "../index-DSqXWc77.js";
|
|
2
2
|
import { AuthRequirement } from "@askrjs/auth";
|
|
3
3
|
import "node:fs/promises";
|
|
4
4
|
//#region src/ssg/types.d.ts
|
package/dist/ssg/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../access-
|
|
1
|
+
import "../access-Rr7CMa06.js";
|
|
2
2
|
import { n as createRouteRegistry } from "../manifest-D6rfj_jC.js";
|
|
3
3
|
import { o as addRouteBasePath } from "../route-matching-Bo6UqG-5.js";
|
|
4
|
-
import { c as route, n as resolveDeferredValues } from "../deferred-
|
|
5
|
-
import { S as RouteDataLoadError, c as prepareRouteHydrationData, t as bindResolvedRouteData, v as getRenderHandler, y as _preloadRouteHandler } from "../resolution-
|
|
4
|
+
import { c as route, n as resolveDeferredValues } from "../deferred-BELyvMsC.js";
|
|
5
|
+
import { S as RouteDataLoadError, c as prepareRouteHydrationData, t as bindResolvedRouteData, v as getRenderHandler, y as _preloadRouteHandler } from "../resolution-t8J0yNaU.js";
|
|
6
6
|
import { n as renderDocument } from "../ssr-DSHd_Q9K.js";
|
|
7
|
-
import { n as renderToString } from "../ssr-
|
|
7
|
+
import { n as renderToString } from "../ssr-BaC5qHEw.js";
|
|
8
8
|
import * as fs from "node:fs/promises";
|
|
9
9
|
import * as pathModule from "node:path";
|
|
10
10
|
import * as os from "node:os";
|
package/dist/ssr/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as DataRuntime, D as SSRPortalState, E as DeferredBoundaryRegistration, Ft as RouteRequestResult, Ot as RouteRecord, _t as RouteHandler, c as ServerQueryRegistry, dn as DocumentRenderContext, dt as RouteAuthOptions, en as QueryPrefetchContext, fn as DocumentRenderer, hn as SSRStyleRegistrationValidation, jt as RouteRegistry, mn as SSRStyleRegistration, pn as SSRData, rt as AccessRedirectDecision, tt as AccessDenyDecision, un as DocumentRenderArgs, ut as Route, zt as CoreTelemetry } from "../index-DSqXWc77.js";
|
|
2
2
|
import { r as JSXElement, s as Props } from "../types-DkVJhVs9.js";
|
|
3
3
|
import { AuthContext } from "@askrjs/auth";
|
|
4
4
|
//#region src/common/page-render-envelope.d.ts
|
|
@@ -51,6 +51,7 @@ declare function createRenderContext(seed?: number, opts?: {
|
|
|
51
51
|
params?: Record<string, string>;
|
|
52
52
|
routes?: readonly Route[];
|
|
53
53
|
routeAuth?: RouteAuthOptions;
|
|
54
|
+
authContext?: AuthContext;
|
|
54
55
|
basePath?: string;
|
|
55
56
|
signal?: AbortSignal;
|
|
56
57
|
dataRuntime?: unknown;
|
|
@@ -85,6 +86,9 @@ type SSRRouteSource = {
|
|
|
85
86
|
};
|
|
86
87
|
type RouteRenderOptions = SSRRouteSource & {
|
|
87
88
|
url: string;
|
|
89
|
+
auth?: RouteAuthOptions;
|
|
90
|
+
authContext?: AuthContext;
|
|
91
|
+
signal?: AbortSignal;
|
|
88
92
|
seed?: number;
|
|
89
93
|
data?: SSRData;
|
|
90
94
|
document?: DocumentRenderer;
|
|
@@ -137,6 +141,8 @@ declare function renderToStringSync(component: (props?: Record<string, unknown>)
|
|
|
137
141
|
/** @internal A composed page render envelope. */
|
|
138
142
|
envelope?: PageRenderEnvelope;
|
|
139
143
|
cspNonce?: string;
|
|
144
|
+
/** @internal Request-local authentication for deferred SSR passes. */
|
|
145
|
+
authContext?: import('@askrjs/auth').AuthContext;
|
|
140
146
|
/** @internal Capture request-local registrations produced by this pass. */
|
|
141
147
|
onContext?: (ctx: RenderContext) => void;
|
|
142
148
|
}): string;
|
package/dist/ssr/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { C as SSRDataMissingError } from "../render-context-B7ohlh6t.js";
|
|
2
|
-
import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-
|
|
2
|
+
import { a as renderResolvedToStringSync, c as createRenderContext, d as withRenderContextAsync, i as renderRouteRequestToString, l as getRenderContext, n as renderToString, o as renderToStringSync, r as renderRouteRequest, s as resolveRequest, t as renderToStream, u as withRenderContext } from "../ssr-BaC5qHEw.js";
|
|
3
3
|
export { SSRDataMissingError, createRenderContext, getRenderContext, renderResolvedToStringSync, renderRouteRequest, renderRouteRequestToString, renderToStream, renderToString, renderToStringSync, resolveRequest, withRenderContext, withRenderContextAsync };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { t as __CONTROL_BOUNDARY__ } from "./control-C-ApnFs1.js";
|
|
2
2
|
import { t as __ERROR_BOUNDARY__ } from "./vnode-D24p6IW2.js";
|
|
3
|
-
import { y as logger } from "./access-
|
|
3
|
+
import { y as logger } from "./access-Rr7CMa06.js";
|
|
4
4
|
import { f as getCurrentComponentInstance, w as setCurrentComponentInstance } from "./component-scope-4I3yEMkb.js";
|
|
5
5
|
import { i as isFragmentType, n as Fragment, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
6
|
-
import { f as callWithContext, g as getVNodeContextFrame, h as getExecutionContextFrame, n as createComponentInstance, v as markVNodeTreeWithContextFrame } from "./component-internal-
|
|
7
|
-
import { t as cleanupComponent } from "./component-cleanup-
|
|
8
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
9
|
-
import { _ as setControlBoundaryContextFrame, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, o as rollbackForStateTransaction, r as commitForStateTransaction } from "./for-internal-
|
|
6
|
+
import { f as callWithContext, g as getVNodeContextFrame, h as getExecutionContextFrame, n as createComponentInstance, v as markVNodeTreeWithContextFrame } from "./component-internal-Dl02WQKS.js";
|
|
7
|
+
import { t as cleanupComponent } from "./component-cleanup-DjpwO9WX.js";
|
|
8
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Be-CLDjV.js";
|
|
9
|
+
import { _ as setControlBoundaryContextFrame, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, o as rollbackForStateTransaction, r as commitForStateTransaction } from "./for-internal-DeoSg_AV.js";
|
|
10
10
|
import { C as SSRDataMissingError, _ as isEmptyPageRenderEnvelope, f as stopRenderPhase$1, h as createPageRenderEnvelope, t as configureRenderContextProvider, u as startRenderPhase$1, v as isPageRenderEnvelope, x as withHydrationRenderUrl } from "./render-context-B7ohlh6t.js";
|
|
11
11
|
import { n as getPublicAttributeName, t as sanitizeCssValue } from "./css-BuPaTOfe.js";
|
|
12
|
-
import { o as isUnsafeUrlAttribute, r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-
|
|
12
|
+
import { o as isUnsafeUrlAttribute, r as validateCspNonce, t as CspNonceScope } from "./csp-nonce-C9OuML0U.js";
|
|
13
13
|
import { n as SSR_PORTAL_HOST, t as SSR_PORTAL_ANCHOR } from "./portal-w3oQ6oQU.js";
|
|
14
14
|
import { t as createDataRuntime } from "./data-runtime-7t_Y0iv3.js";
|
|
15
15
|
import { c as withTelemetry, i as dehydrateDataRuntime, t as createQueryPrefetchContext } from "./query-registry-Bua3cDyb.js";
|
|
16
16
|
import { a as resolveRouteFromRoutes, c as removeRouteBasePath, s as normalizeRouteBasePath, t as _resolveRouteMatchFromRoutes } from "./route-matching-Bo6UqG-5.js";
|
|
17
|
-
import { a as resolveRouteRequest, d as DEFERRED_BOUNDARY, l as validateRouteHydrationData, o as getRouteHydrationMetadata, p as isDeferred } from "./resolution-
|
|
17
|
+
import { a as resolveRouteRequest, d as DEFERRED_BOUNDARY, l as validateRouteHydrationData, n as getRouteRenderContext, o as getRouteHydrationMetadata, p as isDeferred } from "./resolution-t8J0yNaU.js";
|
|
18
18
|
import { n as disposeRegisteredDefaultPortalScope, r as getDefaultPortalHost } from "./default-portal-runtime-DvMvWJVp.js";
|
|
19
19
|
import { n as renderDocument, t as SSR_RENDER_DATA_ATTR } from "./ssr-DSHd_Q9K.js";
|
|
20
20
|
//#region src/ssr/escape.ts
|
|
@@ -198,6 +198,7 @@ function createRenderContext(seed = 12345, opts = {}) {
|
|
|
198
198
|
params: opts.params,
|
|
199
199
|
routes: opts.routes,
|
|
200
200
|
routeAuth: opts.routeAuth,
|
|
201
|
+
authContext: opts.authContext,
|
|
201
202
|
basePath: opts.basePath,
|
|
202
203
|
signal: opts.signal,
|
|
203
204
|
dataRuntime: opts.dataRuntime ?? createDataRuntime({ queryCache }),
|
|
@@ -317,7 +318,11 @@ function resolvePolicyAwareSSRRoute(opts, routeTable) {
|
|
|
317
318
|
if (!matched) throw new Error(`SSR: no route found for url: ${href}`);
|
|
318
319
|
const resolved = getRouteRequestResultSync(resolveRouteRequest(href, {
|
|
319
320
|
registry: opts.registry,
|
|
320
|
-
mode: "ssr"
|
|
321
|
+
mode: "ssr",
|
|
322
|
+
auth: opts.auth,
|
|
323
|
+
authContext: opts.authContext,
|
|
324
|
+
request: opts.request,
|
|
325
|
+
signal: opts.signal
|
|
321
326
|
}));
|
|
322
327
|
if (resolved === null) throw new Error(`SSR: no route found for url: ${href}`);
|
|
323
328
|
if (resolved.kind === "redirect") {
|
|
@@ -340,7 +345,8 @@ function resolvePolicyAwareSSRRoute(opts, routeTable) {
|
|
|
340
345
|
...matched.route,
|
|
341
346
|
handler: routeHasSSRLoader(manifest, matched.route) ? resolved.handler : matched.route.handler
|
|
342
347
|
},
|
|
343
|
-
params: matched.params
|
|
348
|
+
params: matched.params,
|
|
349
|
+
authContext: getRouteRenderContext(resolved)?.auth
|
|
344
350
|
};
|
|
345
351
|
}
|
|
346
352
|
throw new Error(`[Askr] SSR redirect limit exceeded (${MAX_SSR_REDIRECTS}).`);
|
|
@@ -464,8 +470,11 @@ function resolveSSRRouteRender(opts) {
|
|
|
464
470
|
data,
|
|
465
471
|
params: resolvedRoute.params,
|
|
466
472
|
routes: routeTable,
|
|
473
|
+
routeAuth: opts.auth ?? opts.registry.manifest.auth,
|
|
474
|
+
signal: opts.signal ?? opts.request?.signal,
|
|
467
475
|
dataRuntime: opts.dataRuntime,
|
|
468
476
|
queryPrefetch: opts.queryPrefetch,
|
|
477
|
+
authContext: resolvedRoute.authContext,
|
|
469
478
|
envelope: opts.envelope,
|
|
470
479
|
cspNonce
|
|
471
480
|
});
|
|
@@ -1194,7 +1203,8 @@ function renderToStringSync(component, props, options) {
|
|
|
1194
1203
|
const ctx = createRenderContext(seed, {
|
|
1195
1204
|
data: options?.data,
|
|
1196
1205
|
envelope: options?.envelope,
|
|
1197
|
-
cspNonce: nonce
|
|
1206
|
+
cspNonce: nonce,
|
|
1207
|
+
authContext: options?.authContext
|
|
1198
1208
|
});
|
|
1199
1209
|
return withRenderContext(ctx, () => {
|
|
1200
1210
|
startRenderPhase(ctx.renderData);
|
|
@@ -1322,13 +1332,14 @@ function settleWithSignal(promise, signal) {
|
|
|
1322
1332
|
function stripHydrationPayload(html) {
|
|
1323
1333
|
return html.replace(/<script type="application\/json" data-askr-render-data="true">[\s\S]*?<\/script>$/, "");
|
|
1324
1334
|
}
|
|
1325
|
-
function renderBoundary(boundary, state, payload, seed, data, cspNonce) {
|
|
1335
|
+
function renderBoundary(boundary, state, payload, seed, data, cspNonce, authContext) {
|
|
1326
1336
|
const styles = [];
|
|
1327
1337
|
return {
|
|
1328
1338
|
html: stripHydrationPayload(renderToStringSync(() => state === "fulfilled" ? boundary.fulfilled(payload) : boundary.rejected(payload), {}, {
|
|
1329
1339
|
seed,
|
|
1330
1340
|
envelope: data ?? void 0,
|
|
1331
1341
|
cspNonce,
|
|
1342
|
+
authContext,
|
|
1332
1343
|
onContext: (context) => styles.push(...context.ssrStyles.values())
|
|
1333
1344
|
})),
|
|
1334
1345
|
styles
|
|
@@ -1344,7 +1355,7 @@ function patchChunk(id, html, styles, cspNonce) {
|
|
|
1344
1355
|
const selector = `askr-resolve[data-askr-deferred=${JSON.stringify(id)}]`;
|
|
1345
1356
|
return `${styles.length === 0 ? "" : `<style data-askr-style-registry="true" data-askr-deferred-style="true"${cspNonce ? ` nonce="${escapeHtmlAttribute(cspNonce)}"` : ""}>${escapeStyleRawText(styles.map((style) => style.cssText).join("\n"))}\n</style>`}<template data-askr-deferred-patch="${escapeHtmlAttribute(id)}">${html}</template><script${cspNonce ? ` nonce="${escapeHtmlAttribute(cspNonce)}"` : ""} data-askr-deferred-apply="${escapeHtmlAttribute(id)}">(function(s){var t=s.previousElementSibling;var c=t&&t.previousElementSibling;var r=document.querySelector('style[data-askr-style-registry="true"]:not([data-askr-deferred-style])');if(c&&c.tagName==='STYLE'&&r&&r!==c){r.append(c.textContent||'');c.remove();}else if(c&&c.tagName==='STYLE'){c.removeAttribute('data-askr-deferred-style');}var b=document.querySelector(${JSON.stringify(selector)});if(b&&t){b.replaceWith(t.content.cloneNode(true));}if(t)t.remove();s.remove();})(document.currentScript)<\/script>`;
|
|
1346
1357
|
}
|
|
1347
|
-
function createDeferredRenderStream(initialHtml, boundaries, signal, seed, data, runtime, cspNonce) {
|
|
1358
|
+
function createDeferredRenderStream(initialHtml, boundaries, signal, seed, data, runtime, cspNonce, authContext) {
|
|
1348
1359
|
const encoder = new TextEncoder();
|
|
1349
1360
|
const local = new AbortController();
|
|
1350
1361
|
let cancelled = false;
|
|
@@ -1381,7 +1392,7 @@ function createDeferredRenderStream(initialHtml, boundaries, signal, seed, data,
|
|
|
1381
1392
|
try {
|
|
1382
1393
|
const value = await settleWithSignal(boundary.promise, local.signal);
|
|
1383
1394
|
if (!cancelled && !closed) {
|
|
1384
|
-
const rendered = renderBoundary(boundary, "fulfilled", value, seed, data, cspNonce);
|
|
1395
|
+
const rendered = renderBoundary(boundary, "fulfilled", value, seed, data, cspNonce, authContext);
|
|
1385
1396
|
controller.enqueue(encoder.encode(patchChunk(boundary.id, rendered.html, rendered.styles, cspNonce)));
|
|
1386
1397
|
}
|
|
1387
1398
|
} catch (error) {
|
|
@@ -1390,7 +1401,7 @@ function createDeferredRenderStream(initialHtml, boundaries, signal, seed, data,
|
|
|
1390
1401
|
return;
|
|
1391
1402
|
}
|
|
1392
1403
|
if (!cancelled && !closed) {
|
|
1393
|
-
const rendered = renderBoundary(boundary, "rejected", error, seed, data, cspNonce);
|
|
1404
|
+
const rendered = renderBoundary(boundary, "rejected", error, seed, data, cspNonce, authContext);
|
|
1394
1405
|
controller.enqueue(encoder.encode(patchChunk(boundary.id, rendered.html, rendered.styles, cspNonce)));
|
|
1395
1406
|
}
|
|
1396
1407
|
}
|
|
@@ -1480,7 +1491,7 @@ async function renderRouteRequestInternal(options) {
|
|
|
1480
1491
|
kind: "render",
|
|
1481
1492
|
html,
|
|
1482
1493
|
styles: Array.from(context.ssrStyles.values()),
|
|
1483
|
-
...boundaries.length > 0 ? { stream: createDeferredRenderStream(html, boundaries, signal, options.seed, context.hydrationData, runtime, cspNonce) } : {},
|
|
1494
|
+
...boundaries.length > 0 ? { stream: createDeferredRenderStream(html, boundaries, signal, options.seed, context.hydrationData, runtime, cspNonce, context.authContext) } : {},
|
|
1484
1495
|
params: resolved.params
|
|
1485
1496
|
};
|
|
1486
1497
|
if (resolved.record) Object.defineProperty(result, "record", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as isProductionEnvironment } from "./access-
|
|
2
|
-
import { n as isBulkCommitActive, t as deferBulkCommitReadableNotification } from "./fastlane-
|
|
1
|
+
import { S as isProductionEnvironment } from "./access-Rr7CMa06.js";
|
|
2
|
+
import { n as isBulkCommitActive, t as deferBulkCommitReadableNotification } from "./fastlane-Buz1Rvlr.js";
|
|
3
3
|
import { i as claimHookIndex, p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
|
|
4
|
-
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-
|
|
4
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-CEcteIDE.js";
|
|
5
5
|
//#region src/runtime/state.ts
|
|
6
6
|
/**
|
|
7
7
|
* State primitive for Askr components
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { o as getRuntimeRenderer } from "./access-
|
|
1
|
+
import { o as getRuntimeRenderer } from "./access-Rr7CMa06.js";
|
|
2
2
|
import { f as getCurrentComponentInstance, m as getCurrentPortalScope } from "./component-scope-4I3yEMkb.js";
|
|
3
3
|
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
4
|
-
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-
|
|
5
|
-
import { t as cleanupComponent } from "./component-cleanup-
|
|
6
|
-
import { c as getCurrentLifecycleCommitBatch, u as registerLifecycleTransaction } from "./lifecycle-batch-
|
|
4
|
+
import { l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-CEcteIDE.js";
|
|
5
|
+
import { t as cleanupComponent } from "./component-cleanup-DjpwO9WX.js";
|
|
6
|
+
import { c as getCurrentLifecycleCommitBatch, u as registerLifecycleTransaction } from "./lifecycle-batch-Be-CLDjV.js";
|
|
7
7
|
import { n as getActiveRenderContext } from "./render-context-B7ohlh6t.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
|
import { i as registerDefaultPortalRuntime } from "./default-portal-runtime-DvMvWJVp.js";
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as DataRuntime, Kt as Query, Wt as Mutation, dt as RouteAuthOptions, jt as RouteRegistry, nn as QueryStaleReason, sn as ComponentFunction, yt as RouteMatch } from "../index-DSqXWc77.js";
|
|
2
2
|
//#region src/testing/render.d.ts
|
|
3
3
|
/** Options for {@link render} and {@link mount}. */
|
|
4
4
|
interface RenderOptions {
|
package/dist/testing/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as flushRuntimeScheduler } from "../access-
|
|
2
|
-
import { u as recordReadableRead } from "../readable-
|
|
1
|
+
import { r as flushRuntimeScheduler } from "../access-Rr7CMa06.js";
|
|
2
|
+
import { u as recordReadableRead } from "../readable-CEcteIDE.js";
|
|
3
3
|
import { l as addInvalidationListener, t as createDataRuntime } from "../data-runtime-7t_Y0iv3.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as normalizeAsyncDataError, o as notifySource, t as createReadableSource } from "../shared-CGrx2AOL.js";
|
|
5
5
|
import { r as computeRouteActivityMatches } from "../route-matching-Bo6UqG-5.js";
|
|
6
|
-
import { a as cleanupApp, r as createSPA, t as createIsland } from "../boot-
|
|
6
|
+
import { a as cleanupApp, r as createSPA, t as createIsland } from "../boot-D4GaLA0d.js";
|
|
7
7
|
//#region src/testing/render.ts
|
|
8
8
|
const renderStates = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
const eventConstructorNames = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as getHydrationRenderUrl, m as withHydrationVerificationRender } from "./render-context-B7ohlh6t.js";
|
|
2
2
|
import { t as SSR_RENDER_DATA_ATTR } from "./ssr-DSHd_Q9K.js";
|
|
3
|
-
import { a as renderResolvedToStringSync } from "./ssr-
|
|
3
|
+
import { a as renderResolvedToStringSync } from "./ssr-BaC5qHEw.js";
|
|
4
4
|
//#region src/ssr/verify-hydration.ts
|
|
5
5
|
function normalizeHydrationHtml(html) {
|
|
6
6
|
const template = document.createElement("template");
|