@askrjs/askr 0.0.92 → 0.0.94
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 +3 -0
- package/dist/{access-DSkccuEI.js → access-d_DCdwqn.js} +3 -0
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +3 -2
- package/dist/{activity-DodHdC0L.js → activity-BshyLB3_.js} +4 -2
- package/dist/{activity-DxUcygE5.d.ts → activity-CJIQyo5X.d.ts} +5 -1
- package/dist/benchmark.d.ts +1 -1
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +12 -3
- package/dist/boot/index.js +1 -1
- package/dist/{boot-D71bjP4r.js → boot-BsMB_ySP.js} +21 -15
- package/dist/{cleanup-DAAhJjx5.js → cleanup-DefafSjG.js} +4 -4
- package/dist/{component-cleanup-CJCfu5ed.js → component-cleanup-hrqSikl2.js} +2 -2
- package/dist/{component-internal-DlAkCgBE.js → component-internal-DOVVMjG7.js} +7 -5
- package/dist/components/index.d.ts +7 -2
- package/dist/components/index.js +1 -1
- package/dist/{compose-ref-Cc_YkUpM.js → compose-ref-1Fhs7mbF.js} +13 -0
- package/dist/{compose-ref-Cizq72-x.d.ts → compose-ref-DOJHoW5X.d.ts} +3 -0
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-CdzY49Q2.d.ts → control-DdFw-Caz.d.ts} +1 -1
- package/dist/{control-Dv540XtV.js → control-DqOzkgc7.js} +9 -5
- package/dist/{csp-nonce-ByMbWv8s.js → csp-nonce-BBxq1zq4.js} +8 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +3 -3
- package/dist/{data-DcikEH9N.js → data-DYqokZzc.js} +15 -4
- package/dist/{data-runtime-oIdQWnPW.js → data-runtime-JxoRgrrt.js} +2 -0
- package/dist/{deferred-B6CafO5u.js → deferred-BS0Xpstg.js} +8 -3
- package/dist/{effect-BdZcHblj.js → effect-BdvdgMvV.js} +2 -2
- package/dist/{fastlane-B2s24fWt.js → fastlane-DGo7SxBQ.js} +3 -3
- package/dist/{for-internal-T1C7jd7x.js → for-internal-jrliHZmF.js} +5 -5
- package/dist/foundations/icon/index.d.ts +14 -2
- package/dist/foundations/icon/index.js +8 -0
- package/dist/foundations/index.d.ts +2 -2
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +18 -2
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.d.ts +8 -1
- package/dist/foundations/state/index.js +7 -1
- package/dist/foundations/structures/index.d.ts +2 -2
- package/dist/foundations/structures/index.js +1 -1
- package/dist/foundations/utilities/index.d.ts +2 -2
- package/dist/foundations/utilities/index.js +1 -1
- package/dist/fx/index.d.ts +10 -1
- package/dist/fx/index.js +7 -1
- package/dist/{index-oswRaMn6.d.ts → index-C29SEGIv.d.ts} +30 -2
- package/dist/{index-BnU0NPwM.d.ts → index-CzH-0LcA.d.ts} +18 -0
- package/dist/{index-DA3g8lm8.d.ts → index-KQ7Vl4-8.d.ts} +414 -5
- package/dist/index.d.ts +3 -4
- package/dist/index.js +13 -12
- package/dist/{interactions-CWkNEq_C.js → interactions-B4XaFxt1.js} +6 -1
- package/dist/{jsx-C3IECePB.js → jsx-DRS-qjiN.js} +2 -0
- package/dist/jsx-dev-runtime.d.ts +2 -2
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime-BTzDdBJ_.d.ts +2 -0
- package/dist/{jsx-runtime-Cfb2umb4.d.ts → jsx-runtime-Cdd6Gkb0.d.ts} +4 -2
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js +1 -1
- package/dist/{lifecycle-batch-Cyfd07rf.js → lifecycle-batch-BH0fax4F.js} +2 -2
- package/dist/{lifecycle-operations-CQ8fsc94.js → lifecycle-operations-Qxq6ABrC.js} +6 -1
- package/dist/{manifest-Dv0bO6kg.js → manifest-D6rfj_jC.js} +4 -0
- package/dist/{navigate-CZHPEUC4.d.ts → navigate-BL_FIIJ6.d.ts} +6 -1
- package/dist/{navigate-BbWj-QU-.js → navigate-CECCMPAr.js} +13 -10
- package/dist/{query-registry-qm13pEdK.js → query-registry-CimB1YeW.js} +11 -1
- package/dist/{readable-B99wh5Z_.js → readable-BsdGWsDE.js} +1 -1
- package/dist/{renderer-C6jz9nIN.js → renderer-CLvq458M.js} +10 -10
- package/dist/{resolution-B21kmOkp.js → resolution-D8PgnTzh.js} +11 -5
- package/dist/{resource-operation-CaAttQqz.js → resource-operation-CLQXCn1p.js} +4 -4
- package/dist/resources/index.d.ts +15 -2
- package/dist/resources/index.js +6 -5
- package/dist/router/index.d.ts +46 -4
- package/dist/router/index.js +15 -8
- package/dist/{selector-BLWwI55m.js → selector-CyK-sDwB.js} +4 -3
- package/dist/ssg/index.d.ts +5 -1
- package/dist/ssg/index.js +5 -5
- package/dist/ssr/index.d.ts +16 -3
- package/dist/ssr/index.js +1 -1
- package/dist/{ssr-CaZfvQWn.js → ssr-8_vHDWqV.js} +18 -10
- package/dist/{state-XPZYUzHL.js → state-DmkGM_LN.js} +3 -3
- package/dist/{structures-DKjkAmM5.js → structures-umvVUD-M.js} +19 -5
- package/dist/testing/index.d.ts +31 -2
- package/dist/testing/index.js +23 -5
- package/dist/{types-BA9FJtfR.d.ts → types-DkVJhVs9.d.ts} +4 -0
- package/dist/{verify-hydration-CcF-HJil.js → verify-hydration-jf8X2V3x.js} +1 -1
- package/package.json +1 -1
- package/dist/index-2bk8nldG.d.ts +0 -241
- package/dist/jsx-runtime-C_0v1pMN.d.ts +0 -2
- package/dist/scheduler-CmLO4Dfm.d.ts +0 -65
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { s as Props, t as Fragment } from "./types-
|
|
3
|
-
import {
|
|
4
|
-
import { i as jsxs, n as jsx } from "./jsx-runtime-Cfb2umb4.js";
|
|
1
|
+
import { $t as Scope, A as Case, B as RenderDiagnosticsOptions, C as Ref, D as registerSSRStyle, F as ShowProps, G as AskrRuntimeOptions, H as Derived, I as For, J as createRuntime, K as RuntimeKeyedReorderDecision, L as ForProps, M as Match, N as MatchProps, O as CspNonceScope, P as Show, Qt as ServerQueryHandler, R as Selector, U as derive, V as configureRenderDiagnostics, W as AskrRuntime, Y as getDefaultRuntime, Yt as QueryPrefetchContext, Z as getSignal, d as defineServerQueries, dn as State, en as defineScope, f as dehydrateDataRuntime, fn as StateSetter, h as serveQuery, j as CaseProps, k as cspNonce, m as prefetchQuery, mn as state, p as hydrateDataRuntime, pn as StateTuple, q as RuntimeRendererHost, qt as QueryDefinition, tn as readScope, u as defineQuery, w as createRef, x as createQuery, z as selector, zt as DataRuntime } from "./index-KQ7Vl4-8.js";
|
|
2
|
+
import { s as Props, t as Fragment } from "./types-DkVJhVs9.js";
|
|
3
|
+
import { i as jsxs, n as jsx } from "./jsx-runtime-Cdd6Gkb0.js";
|
|
5
4
|
export { AskrRuntime, type AskrRuntimeOptions, Case, type CaseProps, CspNonceScope, type DataRuntime, type Derived, For, type ForProps, Fragment, Match, type MatchProps, type Props, type QueryDefinition, type QueryPrefetchContext, type Ref, type RenderDiagnosticsOptions, type RuntimeKeyedReorderDecision, type RuntimeRendererHost, type Scope, type Selector, type ServerQueryHandler, Show, type ShowProps, type State, type StateSetter, type StateTuple, configureRenderDiagnostics, createQuery, createRef, createRuntime, cspNonce, defineQuery, defineScope, defineServerQueries, dehydrateDataRuntime, derive, getDefaultRuntime, getSignal, hydrateDataRuntime, jsx, jsxs, prefetchQuery, readScope, registerSSRStyle, selector, serveQuery, state };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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-d_DCdwqn.js";
|
|
2
2
|
import { g as getSignal, i as claimHookIndex, p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
|
|
3
|
-
import { n as Fragment } from "./jsx-
|
|
4
|
-
import { _ as readScope, d as defineScope, l as configureRenderDiagnostics } 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-
|
|
3
|
+
import { n as Fragment } from "./jsx-DRS-qjiN.js";
|
|
4
|
+
import { _ as readScope, d as defineScope, l as configureRenderDiagnostics } from "./component-internal-DOVVMjG7.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-BsdGWsDE.js";
|
|
6
6
|
import { n as isSnapshotSource } from "./snapshot-source-BB42xgwb.js";
|
|
7
|
-
import { t as installRendererBridge } from "./renderer-
|
|
7
|
+
import { t as installRendererBridge } from "./renderer-CLvq458M.js";
|
|
8
8
|
import { c as registerSSRStyle } from "./render-context-B7ohlh6t.js";
|
|
9
|
-
import { t as state } from "./state-
|
|
10
|
-
import { t as selector } from "./selector-
|
|
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-
|
|
9
|
+
import { t as state } from "./state-DmkGM_LN.js";
|
|
10
|
+
import { t as selector } from "./selector-CyK-sDwB.js";
|
|
11
|
+
import { n as cspNonce, t as CspNonceScope } from "./csp-nonce-BBxq1zq4.js";
|
|
12
|
+
import { i as For, n as Match, r as Show, t as Case } from "./control-DqOzkgc7.js";
|
|
13
13
|
import { jsx, jsxs } from "./jsx-runtime.js";
|
|
14
|
-
import { t as createQuery } from "./data-
|
|
15
|
-
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-
|
|
14
|
+
import { t as createQuery } from "./data-DYqokZzc.js";
|
|
15
|
+
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery } from "./query-registry-CimB1YeW.js";
|
|
16
16
|
//#region src/runtime/derive.ts
|
|
17
17
|
const deriveCells = /* @__PURE__ */ new WeakMap();
|
|
18
18
|
const dirtyDerivedCells = /* @__PURE__ */ new Set();
|
|
@@ -61,8 +61,8 @@ function flushDirtyDerivedCells() {
|
|
|
61
61
|
if (failures && failures.length > 1) throw new AggregateError(failures, "derive() recompute failures");
|
|
62
62
|
}
|
|
63
63
|
function recomputeDerivedCell(cell, notifyDownstream) {
|
|
64
|
-
if (!cell._dirty && cell._hasValue) return cell._value;
|
|
65
64
|
if (cell._evaluating) throw new Error("derive() cannot read itself recursively");
|
|
65
|
+
if (!cell._dirty && cell._hasValue) return cell._value;
|
|
66
66
|
cell._evaluating = true;
|
|
67
67
|
cell._dirty = false;
|
|
68
68
|
cell._pendingDependencySources = /* @__PURE__ */ new Set();
|
|
@@ -169,6 +169,7 @@ function derive(source, map) {
|
|
|
169
169
|
}
|
|
170
170
|
//#endregion
|
|
171
171
|
//#region src/ref.ts
|
|
172
|
+
/** Create a new, empty {@link Ref} holder. */
|
|
172
173
|
function createRef() {
|
|
173
174
|
return { current: null };
|
|
174
175
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { o as mergeProps, r as ariaDisabled, s as composeHandlers, t as composeRefs } from "./compose-ref-
|
|
1
|
+
import { o as mergeProps, r as ariaDisabled, s as composeHandlers, t as composeRefs } from "./compose-ref-1Fhs7mbF.js";
|
|
2
2
|
//#region src/foundations/interactions/pressable.ts
|
|
3
|
+
/** Produce click/keyboard props implementing 'press' semantics for an element. */
|
|
3
4
|
function pressable({ disabled, onPress, isNativeButton = false }) {
|
|
4
5
|
const props = { onClick: (e) => {
|
|
5
6
|
if (disabled) {
|
|
@@ -47,6 +48,7 @@ function pressable({ disabled, onPress, isNativeButton = false }) {
|
|
|
47
48
|
}
|
|
48
49
|
//#endregion
|
|
49
50
|
//#region src/foundations/interactions/dismissable.ts
|
|
51
|
+
/** Produce keydown/outside-click props that invoke `onDismiss` on Escape or an outside click. */
|
|
50
52
|
function dismissable({ node, disabled, onDismiss }) {
|
|
51
53
|
function handleKeyDown(e) {
|
|
52
54
|
if (disabled) return;
|
|
@@ -76,6 +78,7 @@ function dismissable({ node, disabled, onDismiss }) {
|
|
|
76
78
|
* Normalize focus-related props for hosts.
|
|
77
79
|
* - No DOM manipulation here; returns props that the runtime may attach.
|
|
78
80
|
*/
|
|
81
|
+
/** Normalize `tabIndex`/`aria-disabled` props for a focusable host. */
|
|
79
82
|
function focusable({ disabled, tabIndex }) {
|
|
80
83
|
return {
|
|
81
84
|
tabIndex: disabled ? -1 : tabIndex === void 0 ? 0 : tabIndex,
|
|
@@ -84,6 +87,7 @@ function focusable({ disabled, tabIndex }) {
|
|
|
84
87
|
}
|
|
85
88
|
//#endregion
|
|
86
89
|
//#region src/foundations/interactions/hoverable.ts
|
|
90
|
+
/** Produce pointer enter/leave props that call `onEnter`/`onLeave` unless disabled. */
|
|
87
91
|
function hoverable({ disabled, onEnter, onLeave }) {
|
|
88
92
|
return {
|
|
89
93
|
onPointerEnter: disabled ? void 0 : (e) => {
|
|
@@ -96,6 +100,7 @@ function hoverable({ disabled, onEnter, onLeave }) {
|
|
|
96
100
|
}
|
|
97
101
|
//#endregion
|
|
98
102
|
//#region src/foundations/interactions/roving-focus.ts
|
|
103
|
+
/** Implement arrow-key roving tabindex navigation over a set of items. */
|
|
99
104
|
function rovingFocus(options) {
|
|
100
105
|
const { currentIndex, itemCount, orientation = "horizontal", loop = false, onNavigate, isDisabled } = options;
|
|
101
106
|
const effectiveCurrentIndex = currentIndex >= 0 && currentIndex < itemCount && !isDisabled?.(currentIndex) ? currentIndex : Array.from({ length: itemCount }, (_, index) => index).find((index) => !isDisabled?.(index));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
//#region src/common/jsx.ts
|
|
2
|
+
/** Internal marker identifying an object as a JSX element vnode. */
|
|
2
3
|
const ELEMENT_TYPE = Symbol.for("askr.element");
|
|
4
|
+
/** The element type marker for JSX fragments (`<>...</>`), groups children without a wrapper element. */
|
|
3
5
|
const Fragment = Symbol.for("askr.fragment");
|
|
4
6
|
const STATIC_CHILDREN = Symbol.for("askr.static-children");
|
|
5
7
|
function isFragmentType(type) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as IntrinsicFallbackProps, i as JSXElementType, n as JSXComponent, o as KnownIntrinsicElementProps, r as JSXElement, s as Props, t as Fragment } from "./types-
|
|
2
|
-
import { t as EagerControlPrimitive } from "./control-
|
|
1
|
+
import { a as IntrinsicFallbackProps, i as JSXElementType, n as JSXComponent, o as KnownIntrinsicElementProps, r as JSXElement, s as Props, t as Fragment } from "./types-DkVJhVs9.js";
|
|
2
|
+
import { t as EagerControlPrimitive } from "./control-DdFw-Caz.js";
|
|
3
3
|
//#region src/jsx/jsx-dev-runtime.d.ts
|
|
4
4
|
declare namespace JSX {
|
|
5
5
|
type ElementType = string | symbol | ((props: never) => unknown);
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as isEagerControlPrimitive } from "./control-C-ApnFs1.js";
|
|
2
|
-
import { n as Fragment, r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-
|
|
2
|
+
import { n as Fragment, r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
3
3
|
//#region src/jsx/jsx-dev-runtime.ts
|
|
4
4
|
function annotatePropsUsage(props) {
|
|
5
5
|
return props ?? {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as IntrinsicFallbackProps, o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./types-
|
|
2
|
-
import { t as EagerControlPrimitive } from "./control-
|
|
1
|
+
import { a as IntrinsicFallbackProps, o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./types-DkVJhVs9.js";
|
|
2
|
+
import { t as EagerControlPrimitive } from "./control-DdFw-Caz.js";
|
|
3
3
|
//#region src/jsx/jsx-runtime.d.ts
|
|
4
4
|
declare namespace JSX {
|
|
5
5
|
type ElementType = string | symbol | ((props: never) => unknown);
|
|
@@ -22,11 +22,13 @@ declare function jsxDEV<TTag extends keyof KnownIntrinsicElementProps>(type: TTa
|
|
|
22
22
|
declare function jsxDEV<TTag extends string>(type: Exclude<TTag, keyof KnownIntrinsicElementProps>, props: IntrinsicFallbackProps | null, key?: string | number, isStaticChildren?: boolean): JSXElement;
|
|
23
23
|
declare function jsxDEV<TProps extends object>(type: (props: TProps) => unknown, props: TProps | null, key?: string | number, isStaticChildren?: boolean): JSXElement;
|
|
24
24
|
declare function jsxDEV(type: symbol, props: Props | null, key?: string | number, isStaticChildren?: boolean): JSXElement;
|
|
25
|
+
/** JSX factory for elements with a single or no child, used by the `jsxImportSource` transform. */
|
|
25
26
|
declare function jsx(type: EagerControlPrimitive, props: Props | null, key?: string | number): unknown;
|
|
26
27
|
declare function jsx<TTag extends keyof KnownIntrinsicElementProps>(type: TTag, props: KnownIntrinsicElementProps[TTag] | null, key?: string | number): JSXElement;
|
|
27
28
|
declare function jsx<TTag extends string>(type: Exclude<TTag, keyof KnownIntrinsicElementProps>, props: IntrinsicFallbackProps | null, key?: string | number): JSXElement;
|
|
28
29
|
declare function jsx<TProps extends object>(type: (props: TProps) => unknown, props: TProps | null, key?: string | number): JSXElement;
|
|
29
30
|
declare function jsx(type: symbol, props: Props | null, key?: string | number): JSXElement;
|
|
31
|
+
/** JSX factory for elements with multiple static children, used by the `jsxImportSource` transform. */
|
|
30
32
|
declare function jsxs(type: EagerControlPrimitive, props: Props | null, key?: string | number): unknown;
|
|
31
33
|
declare function jsxs<TTag extends keyof KnownIntrinsicElementProps>(type: TTag, props: KnownIntrinsicElementProps[TTag] | null, key?: string | number): JSXElement;
|
|
32
34
|
declare function jsxs<TTag extends string>(type: Exclude<TTag, keyof KnownIntrinsicElementProps>, props: IntrinsicFallbackProps | null, key?: string | number): JSXElement;
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as JSXElementType, n as JSXComponent, r as JSXElement, t as Fragment } from "./types-
|
|
2
|
-
import { i as jsxs, n as jsx, r as jsxDEV, t as JSX } from "./jsx-runtime-
|
|
1
|
+
import { i as JSXElementType, n as JSXComponent, r as JSXElement, t as Fragment } from "./types-DkVJhVs9.js";
|
|
2
|
+
import { i as jsxs, n as jsx, r as jsxDEV, t as JSX } from "./jsx-runtime-Cdd6Gkb0.js";
|
|
3
3
|
export { Fragment, JSX, type JSXComponent, type JSXElement, type JSXElementType, jsx, jsxDEV, jsxs };
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as isEagerControlPrimitive } from "./control-C-ApnFs1.js";
|
|
2
|
-
import { n as Fragment, r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-
|
|
2
|
+
import { n as Fragment, r as STATIC_CHILDREN, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
3
3
|
//#region src/jsx/jsx-runtime.ts
|
|
4
4
|
function markStaticChildren(props) {
|
|
5
5
|
if (Array.isArray(props.children)) Object.defineProperty(props.children, STATIC_CHILDREN, {
|
|
@@ -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-d_DCdwqn.js";
|
|
2
|
+
import { a as finalizeReadableSubscriptionsFromSnapshot } from "./readable-BsdGWsDE.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-DOVVMjG7.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) {
|
|
@@ -22,12 +22,15 @@ function getLifecycleSlot(instance, index, kind, create) {
|
|
|
22
22
|
lifecycleSlots[index] = slot;
|
|
23
23
|
return slot;
|
|
24
24
|
}
|
|
25
|
+
/** {@link ActivityPredicate} that is true while the current route matches `pathOrPaths`. */
|
|
25
26
|
function routeActive(pathOrPaths) {
|
|
26
27
|
return () => isRouteActivityActive(pathOrPaths);
|
|
27
28
|
}
|
|
29
|
+
/** {@link ActivityPredicate} that is true while the document is visible. */
|
|
28
30
|
function documentVisible() {
|
|
29
31
|
return () => typeof document === "undefined" || document.visibilityState !== "hidden";
|
|
30
32
|
}
|
|
33
|
+
/** {@link ActivityPredicate} that is true while the window has focus. */
|
|
31
34
|
function windowFocused() {
|
|
32
35
|
return () => typeof document === "undefined" || typeof document.hasFocus !== "function" || document.hasFocus();
|
|
33
36
|
}
|
|
@@ -72,6 +75,7 @@ function commitListenerSlot(instance, slot) {
|
|
|
72
75
|
});
|
|
73
76
|
}
|
|
74
77
|
}
|
|
78
|
+
/** Attach an owned event listener to `target` for the current component's lifetime. */
|
|
75
79
|
function on(target, event, handler, options) {
|
|
76
80
|
const instance = getCurrentComponentInstance();
|
|
77
81
|
if (!instance) return;
|
|
@@ -131,6 +135,7 @@ function commitTimerSlot(instance, slot) {
|
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
137
|
}
|
|
138
|
+
/** Run `fn` on an owned interval for the current component's lifetime, optionally gated by `options.when`. */
|
|
134
139
|
function timer(intervalMs, fn, options) {
|
|
135
140
|
const instance = getCurrentComponentInstance();
|
|
136
141
|
if (!instance) return;
|
|
@@ -33,6 +33,10 @@ function _applyManifest(manifest) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Run `definition` to declare routes (via `route`/`page`/`group`/`fallback`)
|
|
38
|
+
* and build a {@link RouteRegistry} to pass to `createSPA`/`hydrateSPA`.
|
|
39
|
+
*/
|
|
36
40
|
function createRouteRegistry(definition, options = {}) {
|
|
37
41
|
const previous = snapshotRouteState();
|
|
38
42
|
clearRouteState();
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-KQ7Vl4-8.js";
|
|
2
2
|
//#region src/router/navigation-scroll.d.ts
|
|
3
|
+
/** Scroll behavior for programmatic navigations (`navigate()`). */
|
|
3
4
|
type NavigationScrollBehavior = 'top' | 'preserve';
|
|
5
|
+
/** Scroll behavior for browser back/forward (popstate) navigations. */
|
|
4
6
|
type HistoryScrollBehavior = 'restore' | 'top' | 'preserve';
|
|
7
|
+
/** Options for {@link configureScrollRestoration}. */
|
|
5
8
|
type ScrollRestorationOptions = {
|
|
6
9
|
navigation?: NavigationScrollBehavior;
|
|
7
10
|
history?: HistoryScrollBehavior;
|
|
8
11
|
};
|
|
9
12
|
//#endregion
|
|
10
13
|
//#region src/router/navigation-targets.d.ts
|
|
14
|
+
/** Options for {@link navigate}. */
|
|
11
15
|
type NavigateOptions = {
|
|
12
16
|
history?: 'push' | 'replace';
|
|
13
17
|
replace?: boolean;
|
|
@@ -15,6 +19,7 @@ type NavigateOptions = {
|
|
|
15
19
|
};
|
|
16
20
|
//#endregion
|
|
17
21
|
//#region src/router/navigate.d.ts
|
|
22
|
+
/** Navigate the client-side router to `path` using the History API. */
|
|
18
23
|
declare function navigate(path: string, options?: NavigateOptions): void;
|
|
19
24
|
//#endregion
|
|
20
25
|
export { ScrollRestorationOptions as a, NavigationScrollBehavior as i, NavigateOptions as n, HistoryScrollBehavior as r, navigate as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { S as isProductionEnvironment, r as flushRuntimeScheduler, x as isDevelopmentEnvironment, y as logger } from "./access-
|
|
2
|
-
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-
|
|
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-
|
|
1
|
+
import { S as isProductionEnvironment, r as flushRuntimeScheduler, x as isDevelopmentEnvironment, y as logger } from "./access-d_DCdwqn.js";
|
|
2
|
+
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
3
|
+
import { r as executeComponent } from "./component-internal-DOVVMjG7.js";
|
|
4
|
+
import { t as cleanupReadableSubscriptionSources } from "./readable-BsdGWsDE.js";
|
|
5
|
+
import { n as cleanupComponentGeneration, t as cleanupComponent } from "./component-cleanup-hrqSikl2.js";
|
|
6
|
+
import { i as drainLifecycleCommitErrors, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch } from "./lifecycle-batch-BH0fax4F.js";
|
|
7
|
+
import { _ as teardownNodeSubtree } from "./cleanup-DefafSjG.js";
|
|
8
|
+
import { t as CspNonceScope } from "./csp-nonce-BBxq1zq4.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-D8PgnTzh.js";
|
|
11
|
+
import { a as clearStagedAppRenderRouteLocation, i as syncCurrentRouteSnapshot, o as createAppRenderRuntime, s as stageAppRenderRouteLocation } from "./activity-BshyLB3_.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;
|
|
@@ -240,6 +240,7 @@ function metadataSources(record) {
|
|
|
240
240
|
if (record.metaChain) return record.metaChain;
|
|
241
241
|
return record.options.meta ? [record.options.meta] : [];
|
|
242
242
|
}
|
|
243
|
+
/** Resolve a route's merged {@link RouteMeta} by running its metadata chain against `context`. */
|
|
243
244
|
async function resolveRouteMeta(record, context) {
|
|
244
245
|
let resolved = record.options.title ? { title: record.options.title } : {};
|
|
245
246
|
for (const source of metadataSources(record)) {
|
|
@@ -326,6 +327,7 @@ function serializeJsonLd(value) {
|
|
|
326
327
|
const json = JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
327
328
|
return `<script${ownedAttribute()} type="application/ld+json">${json}<\/script>`;
|
|
328
329
|
}
|
|
330
|
+
/** Render a {@link RouteMeta} to the `<title>`/`<meta>`/`<link>`/JSON-LD markup for the document `<head>`. */
|
|
329
331
|
function serializeRouteMeta(meta) {
|
|
330
332
|
const output = [];
|
|
331
333
|
if (meta.title !== void 0) output.push(`<title${ownedAttribute()}>${escapeText(meta.title)}</title>`);
|
|
@@ -993,6 +995,7 @@ function applyPopStateNavigationTargets(requestId, previousHref, previousState,
|
|
|
993
995
|
*/
|
|
994
996
|
let navigationInitialized = false;
|
|
995
997
|
configureNavigationRegistryHost({ cancelRouteRequests });
|
|
998
|
+
/** Navigate the client-side router to `path` using the History API. */
|
|
996
999
|
function navigate(path, options = {}) {
|
|
997
1000
|
if (typeof window === "undefined") return;
|
|
998
1001
|
const targetPath = addRouteBasePath(path, getActiveRouteBasePath());
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { i as getDefaultDataRuntime, t as createDataRuntime } from "./data-runtime-
|
|
1
|
+
import { i as getDefaultDataRuntime, t as createDataRuntime } from "./data-runtime-JxoRgrrt.js";
|
|
2
2
|
//#region src/common/telemetry.ts
|
|
3
3
|
function withTelemetry(span, fields, work) {
|
|
4
4
|
return span ? span(fields, work) : work();
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/data/query-registry.ts
|
|
8
|
+
/** Pair a {@link QueryDefinition} with the server-side handler that resolves it. */
|
|
8
9
|
function serveQuery(query, handler) {
|
|
9
10
|
return Object.freeze({
|
|
10
11
|
query,
|
|
11
12
|
handler
|
|
12
13
|
});
|
|
13
14
|
}
|
|
15
|
+
/** Build a {@link ServerQueryRegistry} from one or more {@link serveQuery} entries. */
|
|
14
16
|
function defineServerQueries(...entries) {
|
|
15
17
|
const frozenEntries = Object.freeze([...entries]);
|
|
16
18
|
const handlers = new Map(entries.map((entry) => [entry.query, entry.handler]));
|
|
@@ -21,9 +23,14 @@ function defineServerQueries(...entries) {
|
|
|
21
23
|
}
|
|
22
24
|
});
|
|
23
25
|
}
|
|
26
|
+
/** Freeze and return a reusable {@link QueryDefinition}. */
|
|
24
27
|
function defineQuery(definition) {
|
|
25
28
|
return Object.freeze({ ...definition });
|
|
26
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a {@link QueryPrefetchContext} for prefetching query data ahead of
|
|
32
|
+
* render, e.g. during SSR route resolution.
|
|
33
|
+
*/
|
|
27
34
|
function createQueryPrefetchContext(options = {}) {
|
|
28
35
|
const runtime = options.runtime ?? (options.mode === "spa" ? getDefaultDataRuntime() : createDataRuntime());
|
|
29
36
|
const signal = options.signal ?? new AbortController().signal;
|
|
@@ -54,9 +61,11 @@ function createQueryPrefetchContext(options = {}) {
|
|
|
54
61
|
}
|
|
55
62
|
};
|
|
56
63
|
}
|
|
64
|
+
/** Prefetch `query` with `input` into a {@link QueryPrefetchContext}'s runtime. */
|
|
57
65
|
async function prefetchQuery(context, query, input) {
|
|
58
66
|
return context.prefetch(query, input);
|
|
59
67
|
}
|
|
68
|
+
/** Extract a runtime's cached query data into a JSON-serializable snapshot, dropping non-serializable values. */
|
|
60
69
|
function dehydrateDataRuntime(runtime) {
|
|
61
70
|
const result = {};
|
|
62
71
|
for (const [key, value] of runtime.queryData) try {
|
|
@@ -65,6 +74,7 @@ function dehydrateDataRuntime(runtime) {
|
|
|
65
74
|
} catch {}
|
|
66
75
|
return result;
|
|
67
76
|
}
|
|
77
|
+
/** Load a {@link dehydrateDataRuntime} snapshot back into a runtime's query cache. */
|
|
68
78
|
function hydrateDataRuntime(runtime, data) {
|
|
69
79
|
if (!data || typeof data !== "object" || Array.isArray(data)) return;
|
|
70
80
|
for (const [key, value] of Object.entries(data)) runtime.queryData.set(key, value);
|
|
@@ -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-d_DCdwqn.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,17 @@
|
|
|
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-d_DCdwqn.js";
|
|
4
|
+
import { n as isBulkCommitActive, r as markFastPathApplied } from "./fastlane-DGo7SxBQ.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
|
-
import { i as isFragmentType, r as STATIC_CHILDREN } from "./jsx-
|
|
7
|
-
import { b as withContext, f as getCurrentContextFrame, g as markVNodeTreeWithContextFrame, i as mountInstanceInline, m as getVNodeContextFrame, n as createComponentInstance, o as renderComponentInline, t as captureInlineRenderSnapshot } 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-
|
|
6
|
+
import { i as isFragmentType, r as STATIC_CHILDREN } from "./jsx-DRS-qjiN.js";
|
|
7
|
+
import { b as withContext, f as getCurrentContextFrame, g as markVNodeTreeWithContextFrame, i as mountInstanceInline, m as getVNodeContextFrame, n as createComponentInstance, o as renderComponentInline, t as captureInlineRenderSnapshot } from "./component-internal-DOVVMjG7.js";
|
|
8
|
+
import { t as cleanupComponent } from "./component-cleanup-hrqSikl2.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-BH0fax4F.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-jrliHZmF.js";
|
|
11
|
+
import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-BdvdgMvV.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-DefafSjG.js";
|
|
13
13
|
import { n as getPublicAttributeName, t as sanitizeCssValue } from "./css-BuPaTOfe.js";
|
|
14
|
-
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-
|
|
14
|
+
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-BBxq1zq4.js";
|
|
15
15
|
import { a as isSSRPortalHydrationAnchor } from "./portal-w3oQ6oQU.js";
|
|
16
16
|
//#region src/runtime/error-boundary.ts
|
|
17
17
|
function createBoundaryReset(instance) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-
|
|
2
|
-
import { _ as readScope, d as defineScope } from "./component-internal-
|
|
3
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
1
|
+
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-DRS-qjiN.js";
|
|
2
|
+
import { _ as readScope, d as defineScope } from "./component-internal-DOVVMjG7.js";
|
|
3
|
+
import { p as isPromiseLike } from "./lifecycle-batch-BH0fax4F.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-
|
|
6
|
-
import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-
|
|
5
|
+
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-BBxq1zq4.js";
|
|
6
|
+
import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-CimB1YeW.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
|
|
9
|
+
/** Thrown when a route's `loader` rejects; wraps the original `cause`. */
|
|
9
10
|
var RouteDataLoadError = class extends Error {
|
|
10
11
|
constructor(route, phase, cause) {
|
|
11
12
|
const detail = cause instanceof Error ? cause.message : String(cause);
|
|
@@ -48,6 +49,7 @@ function startLazyLoad(state) {
|
|
|
48
49
|
pendingLazy.add(promise);
|
|
49
50
|
return promise;
|
|
50
51
|
}
|
|
52
|
+
/** Wrap a dynamic-import factory as a {@link LazyRouteComponent}, loaded on first use. */
|
|
51
53
|
function lazy(factory) {
|
|
52
54
|
const state = {
|
|
53
55
|
factory,
|
|
@@ -99,6 +101,7 @@ function _preloadRouteHandler(handler) {
|
|
|
99
101
|
//#endregion
|
|
100
102
|
//#region src/router/rendering.ts
|
|
101
103
|
const outletScope = defineScope(null);
|
|
104
|
+
/** Renders the nested route content for the enclosing layout or page scope. */
|
|
102
105
|
function Outlet() {
|
|
103
106
|
return {
|
|
104
107
|
$$typeof: ELEMENT_TYPE,
|
|
@@ -166,6 +169,7 @@ function setCurrentAuth(context) {
|
|
|
166
169
|
//#region src/common/deferred-value.ts
|
|
167
170
|
const DEFERRED_VALUE = Symbol.for("@askrjs/askr/deferred-value");
|
|
168
171
|
const DEFERRED_BOUNDARY = Symbol.for("@askrjs/askr/deferred-boundary");
|
|
172
|
+
/** Wrap a promise as a {@link Deferred} value that tracks its settled state and result. */
|
|
169
173
|
function defer(promise) {
|
|
170
174
|
let state = "pending";
|
|
171
175
|
let value;
|
|
@@ -195,6 +199,7 @@ function defer(promise) {
|
|
|
195
199
|
[DEFERRED_VALUE]: { value: true }
|
|
196
200
|
}));
|
|
197
201
|
}
|
|
202
|
+
/** Check whether `value` is a {@link Deferred} produced by {@link defer}. */
|
|
198
203
|
function isDeferred(value) {
|
|
199
204
|
if (!value || typeof value !== "object") return false;
|
|
200
205
|
const marker = Object.getOwnPropertyDescriptor(value, DEFERRED_VALUE);
|
|
@@ -510,6 +515,7 @@ function resolveMatchedRoute(record, params, context, authOptions, request, tele
|
|
|
510
515
|
const decision = record.options.auth(context.auth);
|
|
511
516
|
return isPromiseLike(decision) ? Promise.resolve(decision).then(continueResolution) : continueResolution(decision);
|
|
512
517
|
}
|
|
518
|
+
/** Resolve `target` against a route registry, applying auth/policies to produce a render/redirect/deny result. */
|
|
513
519
|
function resolveRouteRequest(target, options) {
|
|
514
520
|
if (!options?.registry) throw new TypeError("resolveRouteRequest requires options.registry.");
|
|
515
521
|
const basePath = normalizeRouteBasePath(options.registry.manifest.basePath);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane, y as logger } from "./access-
|
|
1
|
+
import { t as enqueueRuntimeLane, y as logger } from "./access-d_DCdwqn.js";
|
|
2
2
|
import { f as getCurrentComponentInstance } from "./component-scope-4I3yEMkb.js";
|
|
3
|
-
import { c as registerCommitOperationForInstance, f as getCurrentContextFrame, y as withAsyncResourceContext } from "./component-internal-
|
|
4
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
3
|
+
import { c as registerCommitOperationForInstance, f as getCurrentContextFrame, y as withAsyncResourceContext } from "./component-internal-DOVVMjG7.js";
|
|
4
|
+
import { p as isPromiseLike } from "./lifecycle-batch-BH0fax4F.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-DmkGM_LN.js";
|
|
8
8
|
//#region src/runtime/resource-cell.ts
|
|
9
9
|
/**
|
|
10
10
|
* Pure, component-agnostic ResourceCell state machine.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-
|
|
1
|
+
import { Z as getSignal } from "../index-KQ7Vl4-8.js";
|
|
2
|
+
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-CJIQyo5X.js";
|
|
3
3
|
//#region src/runtime/resource-operation.d.ts
|
|
4
|
+
/** Reactive result of a {@link resource}: current value, loading state, and controls. */
|
|
4
5
|
interface ResourceResult<T> {
|
|
5
6
|
value: T | null;
|
|
6
7
|
pending: boolean;
|
|
@@ -13,7 +14,9 @@ declare function resource<T, const TDeps extends readonly unknown[]>(fn: (opts:
|
|
|
13
14
|
}) => PromiseLike<T> | T, deps: TDeps): ResourceResult<T>;
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/runtime/stream-operation.d.ts
|
|
17
|
+
/** Connection status of a {@link stream}. */
|
|
16
18
|
type StreamStatus = 'connecting' | 'connected' | 'reconnecting' | 'closed' | 'error';
|
|
19
|
+
/** Reactive result of a {@link stream}: current value, connection status, and controls. */
|
|
17
20
|
interface StreamResult<T> {
|
|
18
21
|
value: T | null;
|
|
19
22
|
status: StreamStatus;
|
|
@@ -23,6 +26,7 @@ interface StreamResult<T> {
|
|
|
23
26
|
restart(): void;
|
|
24
27
|
close(): void;
|
|
25
28
|
}
|
|
29
|
+
/** Options for {@link stream}. */
|
|
26
30
|
interface StreamOptions<T> {
|
|
27
31
|
deps?: readonly unknown[];
|
|
28
32
|
initialValue?: T;
|
|
@@ -30,19 +34,28 @@ interface StreamOptions<T> {
|
|
|
30
34
|
type StreamSource<T> = (context: {
|
|
31
35
|
signal: AbortSignal;
|
|
32
36
|
}) => AsyncIterable<T> | PromiseLike<AsyncIterable<T>>;
|
|
37
|
+
/** Subscribe to a streaming data source for the current component's lifetime, with auto reconnect/cleanup. */
|
|
33
38
|
declare function stream<T>(source: StreamSource<T>, options?: StreamOptions<T>): StreamResult<T>;
|
|
34
39
|
//#endregion
|
|
35
40
|
//#region src/runtime/lifecycle-operations.d.ts
|
|
41
|
+
/** A gating condition for lifecycle primitives like {@link timer}; `true` means active. */
|
|
36
42
|
type ActivityPredicate = () => boolean;
|
|
43
|
+
/** Options for {@link timer}. */
|
|
37
44
|
interface TimerOptions {
|
|
38
45
|
when?: ActivityPredicate | readonly ActivityPredicate[];
|
|
39
46
|
}
|
|
47
|
+
/** {@link ActivityPredicate} that is true while the current route matches `pathOrPaths`. */
|
|
40
48
|
declare function routeActive(pathOrPaths: string | readonly string[]): ActivityPredicate;
|
|
49
|
+
/** {@link ActivityPredicate} that is true while the document is visible. */
|
|
41
50
|
declare function documentVisible(): ActivityPredicate;
|
|
51
|
+
/** {@link ActivityPredicate} that is true while the window has focus. */
|
|
42
52
|
declare function windowFocused(): ActivityPredicate;
|
|
53
|
+
/** An event target, or a function resolving one, accepted by {@link on}. */
|
|
43
54
|
type ListenerTarget = EventTarget | (() => EventTarget | null | undefined);
|
|
44
55
|
type ListenerOptions = boolean | AddEventListenerOptions | undefined;
|
|
56
|
+
/** Attach an owned event listener to `target` for the current component's lifetime. */
|
|
45
57
|
declare function on(target: ListenerTarget, event: string, handler: EventListener, options?: ListenerOptions): void;
|
|
58
|
+
/** Run `fn` on an owned interval for the current component's lifetime, optionally gated by `options.when`. */
|
|
46
59
|
declare function timer(intervalMs: number, fn: () => void, options?: TimerOptions): void;
|
|
47
60
|
/** Runs an owned task after commit. */
|
|
48
61
|
declare function task(fn: () => void | (() => void) | PromiseLike<void | (() => void)>): void;
|
package/dist/resources/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane } from "../access-
|
|
1
|
+
import { t as enqueueRuntimeLane } from "../access-d_DCdwqn.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-DOVVMjG7.js";
|
|
4
|
+
import { t as resource } from "../resource-operation-CLQXCn1p.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-Qxq6ABrC.js";
|
|
6
|
+
import { n as onRouteChange } from "../activity-BshyLB3_.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));
|
|
@@ -205,6 +205,7 @@ function getStreamSlot(instance, index, source, options) {
|
|
|
205
205
|
slots[index] = slot;
|
|
206
206
|
return slot;
|
|
207
207
|
}
|
|
208
|
+
/** Subscribe to a streaming data source for the current component's lifetime, with auto reconnect/cleanup. */
|
|
208
209
|
function stream(source, options = {}) {
|
|
209
210
|
const instance = getCurrentComponentInstance();
|
|
210
211
|
if (!instance) return createSnapshot(options);
|