@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as getCurrentAppRenderRuntime, f as getCurrentComponentInstance } from "./component-scope-4I3yEMkb.js";
|
|
2
|
-
import { i as getExecutionModel } from "./manifest-
|
|
2
|
+
import { i as getExecutionModel } from "./manifest-D6rfj_jC.js";
|
|
3
3
|
import { n as getActiveRenderContext, r as getCurrentRenderData } from "./render-context-B7ohlh6t.js";
|
|
4
|
-
import { t as resource } from "./resource-operation-
|
|
4
|
+
import { t as resource } from "./resource-operation-CLQXCn1p.js";
|
|
5
5
|
import { A as getDefaultRouteBasePath, C as getCurrentInheritedPolicies, D as getCurrentPathPrefix, E as getCurrentPageScope, F as insertRecordSorted, H as computeRank, L as pushRegistrationScope, N as hasActivePageScope, O as getCurrentScopeKind, S as getCurrentInheritedMeta, T as getCurrentPageChain, U as normalizeRouteSegmentName, W as parseSegments, g as assertRouteRegistrationUnlocked, h as addRouteToStores, w as getCurrentLayoutChain, x as getCurrentInheritedAuthRequirements } from "./route-matching-Bo6UqG-5.js";
|
|
6
|
-
import { _ as createRouteHandler, d as DEFERRED_BOUNDARY, p as isDeferred, s as guardHydratedRouteData } from "./resolution-
|
|
6
|
+
import { _ as createRouteHandler, d as DEFERRED_BOUNDARY, p as isDeferred, s as guardHydratedRouteData } from "./resolution-D8PgnTzh.js";
|
|
7
7
|
import { allOf } from "@askrjs/auth";
|
|
8
8
|
//#region src/router/access.ts
|
|
9
9
|
function compileNodePolicies(node) {
|
|
@@ -167,12 +167,14 @@ function page(path, Component, optionsOrFn, maybeFn) {
|
|
|
167
167
|
if (typeof fn !== "function") throw new Error("page(path, Component, fn) requires a route definition callback as the final argument.");
|
|
168
168
|
pushPageScope(path, Component, options, fn);
|
|
169
169
|
}
|
|
170
|
+
/** Declare the index route for the enclosing `page()` scope. */
|
|
170
171
|
function index(Component, options) {
|
|
171
172
|
const pageScope = getCurrentPageScope();
|
|
172
173
|
if (pageScope?.hasIndex) throw new Error("page() cannot declare multiple index routes.");
|
|
173
174
|
if (pageScope) pageScope.hasIndex = true;
|
|
174
175
|
registerRouteAtResolvedPath(resolveIndexPath(), Component, options);
|
|
175
176
|
}
|
|
177
|
+
/** Declare the catch-all `/*` fallback route for the enclosing scope. */
|
|
176
178
|
function fallback(Component) {
|
|
177
179
|
if (hasActivePageScope()) {
|
|
178
180
|
if (getCurrentScopeKind() !== "page") throw new Error("fallback() inside page() must be declared directly in the page scope, not inside nested group().");
|
|
@@ -225,6 +227,7 @@ function awaitWithSignal(promise, signal) {
|
|
|
225
227
|
});
|
|
226
228
|
});
|
|
227
229
|
}
|
|
230
|
+
/** Recursively await any {@link Deferred} values nested within `input`, returning it once fully resolved. */
|
|
228
231
|
async function resolveDeferredValues(input, signal) {
|
|
229
232
|
const seen = /* @__PURE__ */ new Set();
|
|
230
233
|
const visit = async (value) => {
|
|
@@ -242,6 +245,7 @@ async function resolveDeferredValues(input, signal) {
|
|
|
242
245
|
await visit(input);
|
|
243
246
|
return input;
|
|
244
247
|
}
|
|
248
|
+
/** Read the current route's server loader data during render or hydration. */
|
|
245
249
|
function routeData() {
|
|
246
250
|
const envelope = getCurrentRenderData();
|
|
247
251
|
if (envelope) return guardHydratedRouteData(envelope.route, envelope.framework);
|
|
@@ -252,6 +256,7 @@ function routeData() {
|
|
|
252
256
|
function rejectedChild(props, error) {
|
|
253
257
|
return typeof props.rejected === "function" ? props.rejected(error) : props.rejected ?? null;
|
|
254
258
|
}
|
|
259
|
+
/** Render a {@link Deferred} value's fulfilled state, a pending placeholder, or a rejected fallback. */
|
|
255
260
|
function Resolve(props) {
|
|
256
261
|
if (props.value.state === "fulfilled") return props.children(props.value.value);
|
|
257
262
|
if (props.value.state === "rejected") return rejectedChild(props, props.value.error);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane } from "./access-
|
|
2
|
-
import { m as withFineGrainedReadTracking } from "./readable-
|
|
1
|
+
import { t as enqueueRuntimeLane } from "./access-d_DCdwqn.js";
|
|
2
|
+
import { m as withFineGrainedReadTracking } from "./readable-BsdGWsDE.js";
|
|
3
3
|
//#region src/runtime/effect.ts
|
|
4
4
|
const SOURCE_EFFECTS = Symbol("askr.source-effects");
|
|
5
5
|
const effectSources = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as setRuntimeBulkCommitProbe, o as getRuntimeRenderer, u as runRuntimeWithSyncProgress, x as isDevelopmentEnvironment } from "./access-
|
|
2
|
-
import { i as isFragmentType } from "./jsx-
|
|
3
|
-
import { i as finalizeReadableSubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty } from "./readable-
|
|
1
|
+
import { d as setRuntimeBulkCommitProbe, o as getRuntimeRenderer, u as runRuntimeWithSyncProgress, x as isDevelopmentEnvironment } from "./access-d_DCdwqn.js";
|
|
2
|
+
import { i as isFragmentType } from "./jsx-DRS-qjiN.js";
|
|
3
|
+
import { i as finalizeReadableSubscriptions, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty } from "./readable-BsdGWsDE.js";
|
|
4
4
|
//#region src/runtime/dev-namespace.ts
|
|
5
5
|
/**
|
|
6
6
|
* Set a value in the dev namespace (no-op in production).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as _isDOMElement } from "./vnode-D24p6IW2.js";
|
|
2
|
-
import { o as getRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-
|
|
2
|
+
import { o as getRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-d_DCdwqn.js";
|
|
3
3
|
import { h as getCurrentStateIndex, i as claimHookIndex, o as clearRenderTracking, p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
|
|
4
|
-
import { h as haveEquivalentContextFrames, n as createComponentInstance, s as renderScopedComponent, v as rebaseVNodeTreeWithContextFrame } from "./component-internal-
|
|
5
|
-
import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-
|
|
6
|
-
import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-
|
|
7
|
-
import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-
|
|
4
|
+
import { h as haveEquivalentContextFrames, n as createComponentInstance, s as renderScopedComponent, v as rebaseVNodeTreeWithContextFrame } from "./component-internal-DOVVMjG7.js";
|
|
5
|
+
import { d as shouldCoalesceFineGrainedItemReads, l as notifyReadableReaders, o as markReactivePropsDirtySource, s as markReadableDerivedSubscribersDirty, u as recordReadableRead } from "./readable-BsdGWsDE.js";
|
|
6
|
+
import { i as unregisterOwnedChildScope, r as registerOwnedChildScope, t as cleanupComponent } from "./component-cleanup-hrqSikl2.js";
|
|
7
|
+
import { o as finalizeInlineReadSubscriptions, u as registerLifecycleTransaction } from "./lifecycle-batch-BH0fax4F.js";
|
|
8
8
|
//#region src/runtime/child-scope.ts
|
|
9
9
|
const EMPTY_CHILD_SCOPE_PROPS = {};
|
|
10
10
|
const childScopesByInstance = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { r as JSXElement, s as Props } from "../../types-
|
|
2
|
-
import { t as Ref } from "../../compose-ref-
|
|
1
|
+
import { r as JSXElement, s as Props } from "../../types-DkVJhVs9.js";
|
|
2
|
+
import { t as Ref } from "../../compose-ref-DOJHoW5X.js";
|
|
3
3
|
//#region src/foundations/icon/icon.types.d.ts
|
|
4
|
+
/** Named icon size presets, mapped to CSS variables at render time. */
|
|
4
5
|
type IconSizeToken = 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
/** Camel-cased CSS style object accepted by icon `style` props. */
|
|
5
7
|
type IconStyleObject = Record<string, unknown>;
|
|
8
|
+
/** Props specific to the icon contract, independent of the underlying `<svg>` props. */
|
|
6
9
|
type IconOwnProps = {
|
|
7
10
|
size?: number | string;
|
|
8
11
|
strokeWidth?: number;
|
|
@@ -12,18 +15,26 @@ type IconOwnProps = {
|
|
|
12
15
|
style?: string | IconStyleObject;
|
|
13
16
|
iconName?: string;
|
|
14
17
|
};
|
|
18
|
+
/** Full prop set accepted by {@link IconBase} and generated icon components. */
|
|
15
19
|
type IconProps = Omit<Props, 'children' | 'class' | 'color' | 'height' | 'ref' | 'role' | 'stroke' | 'stroke-width' | 'style' | 'title' | 'width'> & IconOwnProps & {
|
|
16
20
|
children?: unknown;
|
|
17
21
|
ref?: Ref<SVGSVGElement>;
|
|
18
22
|
};
|
|
19
23
|
//#endregion
|
|
20
24
|
//#region src/foundations/icon/icon.d.ts
|
|
25
|
+
/** Check whether `value` is one of the named icon size tokens ('sm'|'md'|'lg'|'xl'). */
|
|
21
26
|
declare function isIconSizeToken(value: unknown): value is IconSizeToken;
|
|
27
|
+
/** Normalize a numeric icon size to a `px` string; strings pass through unchanged. */
|
|
22
28
|
declare function normalizeIconSizeValue(size: number | string): string;
|
|
29
|
+
/** Resolve a size (token or literal) to a CSS `var(--ak-icon-size-*, ...)` expression or literal value. */
|
|
23
30
|
declare function resolveIconSizeVariable(size: number | string): string;
|
|
31
|
+
/** Resolve a stroke width to a CSS `var(--ak-icon-stroke-width-*, ...)` expression, scoped to `sizeToken` when given. */
|
|
24
32
|
declare function resolveIconStrokeWidthVariable(strokeWidth: number, sizeToken: IconSizeToken | undefined): string;
|
|
33
|
+
/** Serialize an inline style object (or pass through a string) to a CSS declaration string. */
|
|
25
34
|
declare function serializeIconStyle(style: string | IconStyleObject | undefined): string;
|
|
35
|
+
/** Join non-empty CSS declaration fragments with `;`, dropping any that are blank. */
|
|
26
36
|
declare function joinIconStyle(...styles: Array<string | undefined>): string | undefined;
|
|
37
|
+
/** Compute the shared SVG attributes and inline style implementing the icon size/stroke/color contract. */
|
|
27
38
|
declare function getIconContractProps({ size, strokeWidth, color, title, style, iconName }: Pick<IconProps, 'color' | 'iconName' | 'size' | 'strokeWidth' | 'style' | 'title'>): {
|
|
28
39
|
sizeToken: IconSizeToken | undefined;
|
|
29
40
|
decorative: string | undefined;
|
|
@@ -45,6 +56,7 @@ declare function getIconContractProps({ size, strokeWidth, color, title, style,
|
|
|
45
56
|
'data-color': string | undefined;
|
|
46
57
|
};
|
|
47
58
|
};
|
|
59
|
+
/** Base `<svg>` wrapper implementing the icon contract; generated icon components render into it. */
|
|
48
60
|
declare function IconBase({ size, strokeWidth, color, title, class: className, style, iconName, children, ref, ...rest }: IconProps): JSXElement;
|
|
49
61
|
//#endregion
|
|
50
62
|
export { IconBase, type IconOwnProps, type IconProps, type IconSizeToken, type IconStyleObject, getIconContractProps, isIconSizeToken, joinIconStyle, normalizeIconSizeValue, resolveIconSizeVariable, resolveIconStrokeWidthVariable, serializeIconStyle };
|
|
@@ -6,17 +6,21 @@ const ICON_SIZE_TOKENS = [
|
|
|
6
6
|
"lg",
|
|
7
7
|
"xl"
|
|
8
8
|
];
|
|
9
|
+
/** Check whether `value` is one of the named icon size tokens ('sm'|'md'|'lg'|'xl'). */
|
|
9
10
|
function isIconSizeToken(value) {
|
|
10
11
|
return typeof value === "string" && ICON_SIZE_TOKENS.includes(value);
|
|
11
12
|
}
|
|
13
|
+
/** Normalize a numeric icon size to a `px` string; strings pass through unchanged. */
|
|
12
14
|
function normalizeIconSizeValue(size) {
|
|
13
15
|
if (typeof size === "number") return `${size}px`;
|
|
14
16
|
return size;
|
|
15
17
|
}
|
|
18
|
+
/** Resolve a size (token or literal) to a CSS `var(--ak-icon-size-*, ...)` expression or literal value. */
|
|
16
19
|
function resolveIconSizeVariable(size) {
|
|
17
20
|
if (isIconSizeToken(size)) return `var(--ak-icon-size-${size}, var(--ak-icon-size-md, 1.25rem))`;
|
|
18
21
|
return normalizeIconSizeValue(size);
|
|
19
22
|
}
|
|
23
|
+
/** Resolve a stroke width to a CSS `var(--ak-icon-stroke-width-*, ...)` expression, scoped to `sizeToken` when given. */
|
|
20
24
|
function resolveIconStrokeWidthVariable(strokeWidth, sizeToken) {
|
|
21
25
|
if (sizeToken) return `var(--ak-icon-stroke-width-${sizeToken}, var(--ak-icon-stroke-width-md, ${strokeWidth}))`;
|
|
22
26
|
return `var(--ak-icon-stroke-width-md, ${strokeWidth})`;
|
|
@@ -24,15 +28,18 @@ function resolveIconStrokeWidthVariable(strokeWidth, sizeToken) {
|
|
|
24
28
|
function camelToKebab(key) {
|
|
25
29
|
return key.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);
|
|
26
30
|
}
|
|
31
|
+
/** Serialize an inline style object (or pass through a string) to a CSS declaration string. */
|
|
27
32
|
function serializeIconStyle(style) {
|
|
28
33
|
if (!style) return "";
|
|
29
34
|
if (typeof style === "string") return style.trim();
|
|
30
35
|
return Object.entries(style).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => `${camelToKebab(key)}:${String(value)}`).join(";");
|
|
31
36
|
}
|
|
37
|
+
/** Join non-empty CSS declaration fragments with `;`, dropping any that are blank. */
|
|
32
38
|
function joinIconStyle(...styles) {
|
|
33
39
|
const merged = styles.map((style) => style?.trim()).filter(Boolean);
|
|
34
40
|
return merged.length > 0 ? merged.join(";") : void 0;
|
|
35
41
|
}
|
|
42
|
+
/** Compute the shared SVG attributes and inline style implementing the icon size/stroke/color contract. */
|
|
36
43
|
function getIconContractProps({ size = 20, strokeWidth = 2, color = "currentColor", title, style, iconName }) {
|
|
37
44
|
const sizeToken = isIconSizeToken(size) ? size : void 0;
|
|
38
45
|
const decorative = title ? void 0 : "true";
|
|
@@ -61,6 +68,7 @@ function getIconContractProps({ size = 20, strokeWidth = 2, color = "currentColo
|
|
|
61
68
|
}
|
|
62
69
|
};
|
|
63
70
|
}
|
|
71
|
+
/** Base `<svg>` wrapper implementing the icon contract; generated icon components render into it. */
|
|
64
72
|
function IconBase({ size = 20, strokeWidth = 2, color = "currentColor", title, class: className, style, iconName, children, ref, ...rest }) {
|
|
65
73
|
const { attrs } = getIconContractProps({
|
|
66
74
|
size,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as JSXElement } from "../types-
|
|
2
|
-
import { c as DefaultPortal, d as definePortal, f as Presence, h as SlotProps, l as Portal, m as Slot, p as PresenceProps, u as PortalProps, v as LayoutComponent, y as layout } from "../index-
|
|
1
|
+
import { r as JSXElement } from "../types-DkVJhVs9.js";
|
|
2
|
+
import { c as DefaultPortal, d as definePortal, f as Presence, h as SlotProps, l as Portal, m as Slot, p as PresenceProps, u as PortalProps, v as LayoutComponent, y as layout } from "../index-C29SEGIv.js";
|
|
3
3
|
export { DefaultPortal, type JSXElement, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, definePortal, layout };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as definePortal, c as layout, i as Portal, o as Presence, r as DefaultPortal, s as Slot } from "../structures-
|
|
1
|
+
import { a as definePortal, c as layout, i as Portal, o as Presence, r as DefaultPortal, s as Slot } from "../structures-umvVUD-M.js";
|
|
2
2
|
export { DefaultPortal, Portal, Presence, Slot, definePortal, layout };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Ref } from "../../compose-ref-
|
|
2
|
-
import { d as KeyboardLikeEvent, f as PointerLikeEvent, l as DefaultPreventable, p as PropagationStoppable } from "../../index-
|
|
1
|
+
import { t as Ref } from "../../compose-ref-DOJHoW5X.js";
|
|
2
|
+
import { d as KeyboardLikeEvent, f as PointerLikeEvent, l as DefaultPreventable, p as PropagationStoppable } from "../../index-CzH-0LcA.js";
|
|
3
3
|
//#region src/foundations/interactions/pressable.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* pressable
|
|
@@ -33,6 +33,7 @@ import { d as KeyboardLikeEvent, f as PointerLikeEvent, l as DefaultPreventable,
|
|
|
33
33
|
* - Held Enter/Space will fire onPress repeatedly (matches native button)
|
|
34
34
|
* - No debouncing or repeat prevention (platform parity)
|
|
35
35
|
*/
|
|
36
|
+
/** Options for {@link pressable}. */
|
|
36
37
|
interface PressableOptions {
|
|
37
38
|
disabled?: boolean;
|
|
38
39
|
onPress?: (e: PressEvent) => void;
|
|
@@ -42,6 +43,7 @@ interface PressableOptions {
|
|
|
42
43
|
isNativeButton?: boolean;
|
|
43
44
|
}
|
|
44
45
|
type PressEvent = DefaultPreventable & PropagationStoppable;
|
|
46
|
+
/** Element props returned by {@link pressable}. */
|
|
45
47
|
interface PressableResult {
|
|
46
48
|
onClick: (e: PressEvent) => void;
|
|
47
49
|
disabled?: true;
|
|
@@ -51,6 +53,7 @@ interface PressableResult {
|
|
|
51
53
|
onKeyUp?: (e: KeyboardLikeEvent) => void;
|
|
52
54
|
'aria-disabled'?: 'true';
|
|
53
55
|
}
|
|
56
|
+
/** Produce click/keyboard props implementing 'press' semantics for an element. */
|
|
54
57
|
declare function pressable({ disabled, onPress, isNativeButton }: PressableOptions): PressableResult;
|
|
55
58
|
//#endregion
|
|
56
59
|
//#region src/foundations/interactions/dismissable.d.ts
|
|
@@ -97,6 +100,7 @@ declare function pressable({ disabled, onPress, isNativeButton }: PressableOptio
|
|
|
97
100
|
* ❌ Can't create custom escape handler - this is the only one
|
|
98
101
|
* ❌ Can't bypass via direct event listeners - mergeProps composes correctly
|
|
99
102
|
*/
|
|
103
|
+
/** Options for {@link dismissable}. */
|
|
100
104
|
interface DismissableOptions {
|
|
101
105
|
/**
|
|
102
106
|
* Reference to the protected element for outside click detection. Attach the
|
|
@@ -112,6 +116,7 @@ interface DismissableOptions {
|
|
|
112
116
|
*/
|
|
113
117
|
onDismiss?: (trigger: 'escape' | 'outside') => void;
|
|
114
118
|
}
|
|
119
|
+
/** Produce keydown/outside-click props that invoke `onDismiss` on Escape or an outside click. */
|
|
115
120
|
declare function dismissable({ node, disabled, onDismiss }: DismissableOptions): {
|
|
116
121
|
onKeyDown: (e: KeyboardLikeEvent) => void;
|
|
117
122
|
onPointerDownCapture: (e: PointerLikeEvent) => void;
|
|
@@ -124,14 +129,17 @@ declare function dismissable({ node, disabled, onDismiss }: DismissableOptions):
|
|
|
124
129
|
* Normalize focus-related props for hosts.
|
|
125
130
|
* - No DOM manipulation here; returns props that the runtime may attach.
|
|
126
131
|
*/
|
|
132
|
+
/** Options for {@link focusable}. */
|
|
127
133
|
interface FocusableOptions {
|
|
128
134
|
disabled?: boolean;
|
|
129
135
|
tabIndex?: number | undefined;
|
|
130
136
|
}
|
|
137
|
+
/** Element props returned by {@link focusable}. */
|
|
131
138
|
interface FocusableResult {
|
|
132
139
|
tabIndex?: number;
|
|
133
140
|
'aria-disabled'?: 'true';
|
|
134
141
|
}
|
|
142
|
+
/** Normalize `tabIndex`/`aria-disabled` props for a focusable host. */
|
|
135
143
|
declare function focusable({ disabled, tabIndex }: FocusableOptions): FocusableResult;
|
|
136
144
|
//#endregion
|
|
137
145
|
//#region src/foundations/interactions/hoverable.d.ts
|
|
@@ -140,20 +148,25 @@ declare function focusable({ disabled, tabIndex }: FocusableOptions): FocusableR
|
|
|
140
148
|
*
|
|
141
149
|
* Produces props for pointer enter/leave handling. Pure and deterministic.
|
|
142
150
|
*/
|
|
151
|
+
/** Options for {@link hoverable}. */
|
|
143
152
|
interface HoverableOptions {
|
|
144
153
|
disabled?: boolean;
|
|
145
154
|
onEnter?: (e: HoverEvent) => void;
|
|
146
155
|
onLeave?: (e: HoverEvent) => void;
|
|
147
156
|
}
|
|
148
157
|
type HoverEvent = DefaultPreventable & PropagationStoppable;
|
|
158
|
+
/** Element props returned by {@link hoverable}. */
|
|
149
159
|
interface HoverableResult {
|
|
150
160
|
onPointerEnter?: (e: HoverEvent) => void;
|
|
151
161
|
onPointerLeave?: (e: HoverEvent) => void;
|
|
152
162
|
}
|
|
163
|
+
/** Produce pointer enter/leave props that call `onEnter`/`onLeave` unless disabled. */
|
|
153
164
|
declare function hoverable({ disabled, onEnter, onLeave }: HoverableOptions): HoverableResult;
|
|
154
165
|
//#endregion
|
|
155
166
|
//#region src/foundations/interactions/roving-focus.d.ts
|
|
167
|
+
/** Arrow-key axis for {@link rovingFocus}. */
|
|
156
168
|
type Orientation = 'horizontal' | 'vertical' | 'both';
|
|
169
|
+
/** Options for {@link rovingFocus}. */
|
|
157
170
|
interface RovingFocusOptions {
|
|
158
171
|
/**
|
|
159
172
|
* Current focused index
|
|
@@ -183,6 +196,7 @@ interface RovingFocusOptions {
|
|
|
183
196
|
*/
|
|
184
197
|
isDisabled?: (index: number) => boolean;
|
|
185
198
|
}
|
|
199
|
+
/** Container and per-item props returned by {@link rovingFocus}. */
|
|
186
200
|
interface RovingFocusResult {
|
|
187
201
|
/**
|
|
188
202
|
* Props for the container element (composes via mergeProps)
|
|
@@ -198,6 +212,7 @@ interface RovingFocusResult {
|
|
|
198
212
|
'data-roving-index': number;
|
|
199
213
|
};
|
|
200
214
|
}
|
|
215
|
+
/** Implement arrow-key roving tabindex navigation over a set of items. */
|
|
201
216
|
declare function rovingFocus(options: RovingFocusOptions): RovingFocusResult;
|
|
202
217
|
/**
|
|
203
218
|
* USAGE EXAMPLE:
|
|
@@ -227,6 +242,7 @@ declare function rovingFocus(options: RovingFocusOptions): RovingFocusResult;
|
|
|
227
242
|
*/
|
|
228
243
|
//#endregion
|
|
229
244
|
//#region src/foundations/interactions/interaction-policy.d.ts
|
|
245
|
+
/** Input to {@link applyInteractionPolicy}. */
|
|
230
246
|
interface InteractionPolicyInput {
|
|
231
247
|
/** Whether the host element is a native interactive element (button, a, etc) */
|
|
232
248
|
isNative: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as focusable, i as hoverable, n as mergeInteractionProps, o as dismissable, r as rovingFocus, s as pressable, t as applyInteractionPolicy } from "../../interactions-
|
|
1
|
+
import { a as focusable, i as hoverable, n as mergeInteractionProps, o as dismissable, r as rovingFocus, s as pressable, t as applyInteractionPolicy } from "../../interactions-B4XaFxt1.js";
|
|
2
2
|
export { applyInteractionPolicy, dismissable, focusable, hoverable, mergeInteractionProps, pressable, rovingFocus };
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dn as State } from "../../index-KQ7Vl4-8.js";
|
|
2
2
|
//#region src/foundations/state/controllable.d.ts
|
|
3
|
+
/** Whether `value` represents controlled mode (not `undefined`). */
|
|
3
4
|
declare function isControlled<T>(value: T | undefined): value is T;
|
|
5
|
+
/** Resolve the effective value and controlled-ness for a controllable prop. */
|
|
4
6
|
declare function resolveControllable<T>(value: T | undefined, defaultValue: T): {
|
|
5
7
|
value: T;
|
|
6
8
|
isControlled: boolean;
|
|
7
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Build a `set` function that calls `onChange` in controlled mode, or
|
|
12
|
+
* updates internal state and then calls `onChange` in uncontrolled mode.
|
|
13
|
+
*/
|
|
8
14
|
declare function makeControllable<T>(options: {
|
|
9
15
|
value: T | undefined;
|
|
10
16
|
defaultValue: T;
|
|
@@ -14,6 +20,7 @@ declare function makeControllable<T>(options: {
|
|
|
14
20
|
set: (next: T) => void;
|
|
15
21
|
isControlled: boolean;
|
|
16
22
|
};
|
|
23
|
+
/** A {@link State} accessor that also reports whether it is controlled. */
|
|
17
24
|
type ControllableState<T> = State<T> & {
|
|
18
25
|
isControlled: boolean;
|
|
19
26
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as state } from "../../state-
|
|
1
|
+
import { t as state } from "../../state-DmkGM_LN.js";
|
|
2
2
|
//#region src/foundations/state/controllable.ts
|
|
3
3
|
/**
|
|
4
4
|
* controllable
|
|
@@ -23,9 +23,11 @@ import { t as state } from "../../state-XPZYUzHL.js";
|
|
|
23
23
|
* controllableState uses Object.is() to prevent unnecessary onChange calls.
|
|
24
24
|
* This is intentional — strict equality, no deep comparison.
|
|
25
25
|
*/
|
|
26
|
+
/** Whether `value` represents controlled mode (not `undefined`). */
|
|
26
27
|
function isControlled(value) {
|
|
27
28
|
return value !== void 0;
|
|
28
29
|
}
|
|
30
|
+
/** Resolve the effective value and controlled-ness for a controllable prop. */
|
|
29
31
|
function resolveControllable(value, defaultValue) {
|
|
30
32
|
const controlled = isControlled(value);
|
|
31
33
|
return {
|
|
@@ -33,6 +35,10 @@ function resolveControllable(value, defaultValue) {
|
|
|
33
35
|
isControlled: controlled
|
|
34
36
|
};
|
|
35
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Build a `set` function that calls `onChange` in controlled mode, or
|
|
40
|
+
* updates internal state and then calls `onChange` in uncontrolled mode.
|
|
41
|
+
*/
|
|
36
42
|
function makeControllable(options) {
|
|
37
43
|
const { value, defaultValue, onChange, setInternal } = options;
|
|
38
44
|
const { isControlled } = resolveControllable(value, defaultValue);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as JSXElement } from "../../types-
|
|
2
|
-
import { _ as isElement, a as Collection, c as DefaultPortal, d as definePortal, f as Presence, g as cloneElement, h as SlotProps, i as createLayer, l as Portal, m as Slot, n as LayerManager, o as CollectionItem, p as PresenceProps, r as LayerOptions, s as createCollection, t as Layer, u as PortalProps, v as LayoutComponent, y as layout } from "../../index-
|
|
1
|
+
import { r as JSXElement } from "../../types-DkVJhVs9.js";
|
|
2
|
+
import { _ as isElement, a as Collection, c as DefaultPortal, d as definePortal, f as Presence, g as cloneElement, h as SlotProps, i as createLayer, l as Portal, m as Slot, n as LayerManager, o as CollectionItem, p as PresenceProps, r as LayerOptions, s as createCollection, t as Layer, u as PortalProps, v as LayoutComponent, y as layout } from "../../index-C29SEGIv.js";
|
|
3
3
|
export { type Collection, type CollectionItem, DefaultPortal, type JSXElement, type Layer, type LayerManager, type LayerOptions, type LayoutComponent, Portal, type PortalProps, Presence, type PresenceProps, Slot, type SlotProps, cloneElement, createCollection, createLayer, definePortal, isElement, layout };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as definePortal, c as layout, i as Portal, l as cloneElement, n as createCollection, o as Presence, r as DefaultPortal, s as Slot, t as createLayer, u as isElement } from "../../structures-
|
|
1
|
+
import { a as definePortal, c as layout, i as Portal, l as cloneElement, n as createCollection, o as Presence, r as DefaultPortal, s as Slot, t as createLayer, u as isElement } from "../../structures-umvVUD-M.js";
|
|
2
2
|
export { DefaultPortal, Portal, Presence, Slot, cloneElement, createCollection, createLayer, definePortal, isElement, layout };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as composeRefs, r as setRef, t as Ref } from "../../compose-ref-
|
|
2
|
-
import { a as ariaSelected, c as composeHandlers, d as KeyboardLikeEvent, f as PointerLikeEvent, i as ariaExpanded, l as DefaultPreventable, n as formatId, o as mergeProps, p as PropagationStoppable, r as ariaDisabled, s as ComposeHandlersOptions, t as FormatIdOptions, u as FocusLikeEvent } from "../../index-
|
|
1
|
+
import { n as composeRefs, r as setRef, t as Ref } from "../../compose-ref-DOJHoW5X.js";
|
|
2
|
+
import { a as ariaSelected, c as composeHandlers, d as KeyboardLikeEvent, f as PointerLikeEvent, i as ariaExpanded, l as DefaultPreventable, n as formatId, o as mergeProps, p as PropagationStoppable, r as ariaDisabled, s as ComposeHandlersOptions, t as FormatIdOptions, u as FocusLikeEvent } from "../../index-CzH-0LcA.js";
|
|
3
3
|
export { type ComposeHandlersOptions, type DefaultPreventable, type FocusLikeEvent, type FormatIdOptions, type KeyboardLikeEvent, type PointerLikeEvent, type PropagationStoppable, type Ref, ariaDisabled, ariaExpanded, ariaSelected, composeHandlers, composeRefs, formatId, mergeProps, setRef };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as ariaSelected, i as ariaExpanded, n as setRef, o as mergeProps, r as ariaDisabled, s as composeHandlers, t as composeRefs } from "../../compose-ref-
|
|
1
|
+
import { a as ariaSelected, i as ariaExpanded, n as setRef, o as mergeProps, r as ariaDisabled, s as composeHandlers, t as composeRefs } from "../../compose-ref-1Fhs7mbF.js";
|
|
2
2
|
import { t as formatId } from "../../utilities-C_CGX4Dz.js";
|
|
3
3
|
export { ariaDisabled, ariaExpanded, ariaSelected, composeHandlers, composeRefs, formatId, mergeProps, setRef };
|
package/dist/fx/index.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { X as scheduleEventHandler } from "../index-KQ7Vl4-8.js";
|
|
2
2
|
//#region src/fx/timing.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Timing utilities — pure helpers for common async patterns
|
|
5
5
|
* No framework coupling. No lifecycle awareness.
|
|
6
6
|
*/
|
|
7
|
+
/** Options for {@link debounce}. */
|
|
7
8
|
interface DebounceOptions {
|
|
8
9
|
leading?: boolean;
|
|
9
10
|
trailing?: boolean;
|
|
10
11
|
}
|
|
12
|
+
/** Options for {@link throttle}. */
|
|
11
13
|
interface ThrottleOptions {
|
|
12
14
|
leading?: boolean;
|
|
13
15
|
trailing?: boolean;
|
|
14
16
|
}
|
|
17
|
+
/** Options for {@link retry}. */
|
|
15
18
|
interface RetryOptions {
|
|
16
19
|
maxAttempts?: number;
|
|
17
20
|
delayMs?: number;
|
|
@@ -158,6 +161,7 @@ declare function retry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise
|
|
|
158
161
|
//#endregion
|
|
159
162
|
//#region src/fx/fx.d.ts
|
|
160
163
|
type CancelFn = () => void;
|
|
164
|
+
/** Wrap an event handler so rapid events are coalesced and delayed by `ms`. */
|
|
161
165
|
declare function debounceEvent(ms: number, handler: EventListener, options?: {
|
|
162
166
|
leading?: boolean;
|
|
163
167
|
trailing?: boolean;
|
|
@@ -165,16 +169,20 @@ declare function debounceEvent(ms: number, handler: EventListener, options?: {
|
|
|
165
169
|
cancel(): void;
|
|
166
170
|
flush(): void;
|
|
167
171
|
};
|
|
172
|
+
/** Wrap an event handler so it runs at most once per `ms` interval. */
|
|
168
173
|
declare function throttleEvent(ms: number, handler: EventListener, options?: {
|
|
169
174
|
leading?: boolean;
|
|
170
175
|
trailing?: boolean;
|
|
171
176
|
}): EventListener & {
|
|
172
177
|
cancel(): void;
|
|
173
178
|
};
|
|
179
|
+
/** Wrap an event handler so it runs at most once per animation frame, using the latest event. */
|
|
174
180
|
declare function rafEvent(handler: EventListener): EventListener & {
|
|
175
181
|
cancel(): void;
|
|
176
182
|
};
|
|
183
|
+
/** Schedule `fn` after `ms`, auto-cancelling on component cleanup; returns a cancel function. */
|
|
177
184
|
declare function scheduleTimeout(ms: number, fn: () => void): CancelFn;
|
|
185
|
+
/** Schedule `fn` during browser idle time, auto-cancelling on component cleanup. */
|
|
178
186
|
declare function scheduleIdle(fn: () => void, options?: {
|
|
179
187
|
timeout?: number;
|
|
180
188
|
}): CancelFn;
|
|
@@ -183,6 +191,7 @@ interface RetryOptions$1 {
|
|
|
183
191
|
delayMs?: number;
|
|
184
192
|
backoff?: (attemptIndex: number) => number;
|
|
185
193
|
}
|
|
194
|
+
/** Run `fn`, retrying with backoff on failure, auto-cancelling on component cleanup. */
|
|
186
195
|
declare function scheduleRetry<T>(fn: () => Promise<T>, options?: RetryOptions$1): {
|
|
187
196
|
cancel(): void;
|
|
188
197
|
};
|
package/dist/fx/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as scheduleEventHandler, n as enqueueRuntimeTask, y as logger } from "../access-
|
|
1
|
+
import { g as scheduleEventHandler, n as enqueueRuntimeTask, y as logger } from "../access-d_DCdwqn.js";
|
|
2
2
|
import { f as getCurrentComponentInstance } from "../component-scope-4I3yEMkb.js";
|
|
3
3
|
//#region src/fx/timing.ts
|
|
4
4
|
/**
|
|
@@ -263,6 +263,7 @@ function enqueueUserCallback(fn) {
|
|
|
263
263
|
}
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
+
/** Wrap an event handler so rapid events are coalesced and delayed by `ms`. */
|
|
266
267
|
function debounceEvent(ms, handler, options) {
|
|
267
268
|
const { leading = false, trailing = true } = options || {};
|
|
268
269
|
const inst = getCurrentComponentInstance();
|
|
@@ -309,6 +310,7 @@ function debounceEvent(ms, handler, options) {
|
|
|
309
310
|
});
|
|
310
311
|
return debounced;
|
|
311
312
|
}
|
|
313
|
+
/** Wrap an event handler so it runs at most once per `ms` interval. */
|
|
312
314
|
function throttleEvent(ms, handler, options) {
|
|
313
315
|
const { leading = true, trailing = true } = options || {};
|
|
314
316
|
const inst = getCurrentComponentInstance();
|
|
@@ -347,6 +349,7 @@ function throttleEvent(ms, handler, options) {
|
|
|
347
349
|
if (inst) (inst.cleanupFns ??= []).push(() => throttled.cancel());
|
|
348
350
|
return throttled;
|
|
349
351
|
}
|
|
352
|
+
/** Wrap an event handler so it runs at most once per animation frame, using the latest event. */
|
|
350
353
|
function rafEvent(handler) {
|
|
351
354
|
const inst = getCurrentComponentInstance();
|
|
352
355
|
if (inst && inst.ssr) return noopEventListener;
|
|
@@ -378,6 +381,7 @@ function rafEvent(handler) {
|
|
|
378
381
|
if (inst) (inst.cleanupFns ??= []).push(() => fn.cancel());
|
|
379
382
|
return fn;
|
|
380
383
|
}
|
|
384
|
+
/** Schedule `fn` after `ms`, auto-cancelling on component cleanup; returns a cancel function. */
|
|
381
385
|
function scheduleTimeout(ms, fn) {
|
|
382
386
|
throwIfDuringRender();
|
|
383
387
|
const inst = getCurrentComponentInstance();
|
|
@@ -395,6 +399,7 @@ function scheduleTimeout(ms, fn) {
|
|
|
395
399
|
if (inst) (inst.cleanupFns ??= []).push(cancel);
|
|
396
400
|
return cancel;
|
|
397
401
|
}
|
|
402
|
+
/** Schedule `fn` during browser idle time, auto-cancelling on component cleanup. */
|
|
398
403
|
function scheduleIdle(fn, options) {
|
|
399
404
|
throwIfDuringRender();
|
|
400
405
|
const inst = getCurrentComponentInstance();
|
|
@@ -421,6 +426,7 @@ function scheduleIdle(fn, options) {
|
|
|
421
426
|
if (inst) (inst.cleanupFns ??= []).push(cancel);
|
|
422
427
|
return cancel;
|
|
423
428
|
}
|
|
429
|
+
/** Run `fn`, retrying with backoff on failure, auto-cancelling on component cleanup. */
|
|
424
430
|
function scheduleRetry(fn, options) {
|
|
425
431
|
throwIfDuringRender();
|
|
426
432
|
const inst = getCurrentComponentInstance();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as JSXElement } from "./types-
|
|
1
|
+
import { rn as RenderableChild } from "./index-KQ7Vl4-8.js";
|
|
2
|
+
import { r as JSXElement } from "./types-DkVJhVs9.js";
|
|
3
3
|
//#region src/foundations/structures/layout.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Layout helper.
|
|
@@ -24,16 +24,24 @@ import { r as JSXElement } from "./types-BA9FJtfR.js";
|
|
|
24
24
|
* Props are spread into the layout component. This is intentional
|
|
25
25
|
* and deterministic — no merging or composition.
|
|
26
26
|
*/
|
|
27
|
+
/** A component that receives its route children via `props.children`. */
|
|
27
28
|
type LayoutComponent<P = object> = (props: P & {
|
|
28
29
|
children?: RenderableChild;
|
|
29
30
|
}) => unknown;
|
|
31
|
+
/**
|
|
32
|
+
* Wrap a {@link LayoutComponent} so it can be invoked as `(children, props)`,
|
|
33
|
+
* matching route layout conventions.
|
|
34
|
+
*/
|
|
30
35
|
declare function layout<P = object>(Layout: LayoutComponent<P>): (children?: RenderableChild, props?: P) => unknown;
|
|
31
36
|
//#endregion
|
|
32
37
|
//#region src/jsx/utils.d.ts
|
|
38
|
+
/** Check whether `value` is a JSX element vnode. */
|
|
33
39
|
declare function isElement(value: unknown): value is JSXElement;
|
|
40
|
+
/** Clone a JSX element, shallow-merging `props` over its existing props. */
|
|
34
41
|
declare function cloneElement(element: JSXElement, props: Record<string, unknown>): JSXElement;
|
|
35
42
|
//#endregion
|
|
36
43
|
//#region src/foundations/structures/slot.d.ts
|
|
44
|
+
/** Props for {@link Slot}: `asChild` selects prop-merging vs. fragment mode. */
|
|
37
45
|
type SlotProps = {
|
|
38
46
|
asChild: true;
|
|
39
47
|
children: JSXElement;
|
|
@@ -65,7 +73,9 @@ type SlotProps = {
|
|
|
65
73
|
declare function Slot(props: SlotProps): JSXElement | null;
|
|
66
74
|
//#endregion
|
|
67
75
|
//#region src/foundations/structures/presence.d.ts
|
|
76
|
+
/** Props for {@link Presence}. */
|
|
68
77
|
interface PresenceProps {
|
|
78
|
+
/** Whether the children should be mounted, or a function returning it. */
|
|
69
79
|
present: boolean | (() => boolean);
|
|
70
80
|
children?: RenderableChild;
|
|
71
81
|
}
|
|
@@ -95,17 +105,28 @@ interface PresenceProps {
|
|
|
95
105
|
declare function Presence({ present, children }: PresenceProps): JSXElement | null;
|
|
96
106
|
//#endregion
|
|
97
107
|
//#region src/runtime/portal.d.ts
|
|
108
|
+
/**
|
|
109
|
+
* A named portal channel created by {@link definePortal}: call it as a
|
|
110
|
+
* component to render the host, and call `.render(props)` to write content.
|
|
111
|
+
*/
|
|
98
112
|
interface Portal<T extends RenderableChild = RenderableChild> {
|
|
99
113
|
(): T | JSXElement | null | undefined;
|
|
100
114
|
render(props: {
|
|
101
115
|
children?: T;
|
|
102
116
|
}): unknown;
|
|
103
117
|
}
|
|
118
|
+
/** Props for the {@link Portal} component. */
|
|
104
119
|
interface PortalProps {
|
|
105
120
|
children?: RenderableChild;
|
|
106
121
|
}
|
|
122
|
+
/** Create a new named {@link Portal} channel with its own host and content. */
|
|
107
123
|
declare function definePortal<T extends RenderableChild = RenderableChild>(): Portal<T>;
|
|
124
|
+
/**
|
|
125
|
+
* The implicit portal channel that {@link Portal} writes to and that any
|
|
126
|
+
* host rendered without an explicit portal falls back to.
|
|
127
|
+
*/
|
|
108
128
|
declare const DefaultPortal: Portal<RenderableChild>;
|
|
129
|
+
/** Write children to the {@link DefaultPortal} host wherever it is rendered. */
|
|
109
130
|
declare function Portal(props: PortalProps): JSXElement | null;
|
|
110
131
|
//#endregion
|
|
111
132
|
//#region src/foundations/structures/collection.d.ts
|
|
@@ -133,10 +154,12 @@ declare function Portal(props: PortalProps): JSXElement | null;
|
|
|
133
154
|
* const allItems = collection.items();
|
|
134
155
|
* unregister();
|
|
135
156
|
*/
|
|
157
|
+
/** A registered node paired with its metadata inside a {@link Collection}. */
|
|
136
158
|
type CollectionItem<TNode, TMetadata = unknown> = {
|
|
137
159
|
node: TNode;
|
|
138
160
|
metadata: TMetadata;
|
|
139
161
|
};
|
|
162
|
+
/** Ordered descendant registry returned by {@link createCollection}. */
|
|
140
163
|
interface Collection<TNode, TMetadata = unknown> {
|
|
141
164
|
/**
|
|
142
165
|
* Register a node with optional metadata.
|
|
@@ -156,6 +179,7 @@ interface Collection<TNode, TMetadata = unknown> {
|
|
|
156
179
|
*/
|
|
157
180
|
size(): number;
|
|
158
181
|
}
|
|
182
|
+
/** Create an empty, insertion-ordered {@link Collection} registry. */
|
|
159
183
|
declare function createCollection<TNode, TMetadata = unknown>(): Collection<TNode, TMetadata>;
|
|
160
184
|
/**
|
|
161
185
|
* USAGE EXAMPLE:
|
|
@@ -207,6 +231,7 @@ declare function createCollection<TNode, TMetadata = unknown>(): Collection<TNod
|
|
|
207
231
|
* layer.isTop(); // true if this is the topmost layer
|
|
208
232
|
* layer.unregister();
|
|
209
233
|
*/
|
|
234
|
+
/** Options for registering a layer with {@link LayerManager.register}. */
|
|
210
235
|
interface LayerOptions {
|
|
211
236
|
/**
|
|
212
237
|
* Called when Escape is pressed and this is the top layer
|
|
@@ -221,6 +246,7 @@ interface LayerOptions {
|
|
|
221
246
|
*/
|
|
222
247
|
node?: Node | null;
|
|
223
248
|
}
|
|
249
|
+
/** A registered layer entry returned by {@link LayerManager.register}. */
|
|
224
250
|
interface Layer {
|
|
225
251
|
/**
|
|
226
252
|
* Unique layer ID
|
|
@@ -235,6 +261,7 @@ interface Layer {
|
|
|
235
261
|
*/
|
|
236
262
|
unregister(): void;
|
|
237
263
|
}
|
|
264
|
+
/** Stacking coordinator returned by {@link createLayer}. */
|
|
238
265
|
interface LayerManager {
|
|
239
266
|
/**
|
|
240
267
|
* Register a new layer
|
|
@@ -253,6 +280,7 @@ interface LayerManager {
|
|
|
253
280
|
*/
|
|
254
281
|
handleOutsidePointer(e: PointerEvent): void;
|
|
255
282
|
}
|
|
283
|
+
/** Create a new, empty {@link LayerManager} for coordinating overlay stacking. */
|
|
256
284
|
declare function createLayer(): LayerManager;
|
|
257
285
|
/**
|
|
258
286
|
* USAGE EXAMPLE:
|