@askrjs/askr 0.2.4 → 0.3.0
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 +11 -0
- package/dist/access-CEA2pOry.js +1046 -0
- package/dist/actions/index.d.ts +16 -2
- package/dist/actions/index.js +5 -5
- package/dist/{activity-FirwPXA_.js → activity-oy2YFTFF.js} +10 -16
- package/dist/benchmark.js +8 -9
- package/dist/boot/index.d.ts +19 -9
- package/dist/boot/index.js +1 -1
- package/dist/{boot-tWyF6121.js → boot-BMBMWUGI.js} +680 -441
- package/dist/capabilities-Bbf0mlp9.js +42 -0
- package/dist/components/index.d.ts +11 -8
- package/dist/components/index.js +1 -1
- package/dist/{compose-ref-Bfaf4kUC.js → compose-ref-v0qGlHoN.js} +7 -1
- package/dist/control/index.d.ts +20 -2
- package/dist/control/index.js +1 -1
- package/dist/{control-C-wSaq9V.js → control-BR_mrX__.js} +4 -4
- package/dist/core.d.ts +163 -0
- package/dist/csp-nonce-BfFWcd0w.js +173 -0
- package/dist/data/index.d.ts +74 -2
- package/dist/data/index.js +3 -3
- package/dist/{data-ghKopAbp.js → data-2edW0jhF.js} +108 -122
- package/dist/{data-runtime-7t_Y0iv3.js → data-runtime-CxoY98lX.js} +22 -15
- package/dist/{deferred-CxjWCkIn.js → deferred-CbgNhf67.js} +5 -5
- package/dist/dom-renderer.d.ts +77 -0
- package/dist/domains/actions.d.ts +70 -0
- package/dist/domains/component.d.ts +119 -0
- package/dist/domains/context.d.ts +73 -0
- package/dist/domains/control.d.ts +328 -0
- package/dist/domains/data.d.ts +461 -0
- package/dist/domains/diagnostics.d.ts +21 -0
- package/dist/domains/lifecycle.d.ts +112 -0
- package/dist/domains/refs.d.ts +18 -0
- package/dist/domains/renderer.d.ts +127 -0
- package/dist/domains/routing.d.ts +501 -0
- package/dist/domains/scheduler.d.ts +79 -0
- package/dist/domains/server.d.ts +112 -0
- package/dist/domains/state.d.ts +129 -0
- package/dist/domains/telemetry.d.ts +29 -0
- package/dist/eager-control.d.ts +8 -0
- package/dist/{effect-CNwstBBD.js → effect-C3Zsc1k6.js} +14 -41
- package/dist/{types-DWVrKn9N.d.ts → elements.d.ts} +79 -42
- package/dist/{for-internal-DyBHfKJA.js → for-state-BDykeOJL.js} +598 -494
- package/dist/foundations/icon/index.d.ts +67 -16
- package/dist/foundations/icon/index.js +1 -1
- package/dist/foundations/index.d.ts +26 -3
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +73 -34
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.d.ts +12 -5
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +44 -3
- package/dist/foundations/structures/index.js +1 -1
- package/dist/foundations/utilities/index.d.ts +34 -3
- package/dist/foundations/utilities/index.js +1 -1
- package/dist/fx/index.d.ts +72 -25
- package/dist/fx/index.js +8 -8
- package/dist/index.d.ts +121 -4
- package/dist/index.js +316 -47
- package/dist/{component-internal-C4hKKQBF.js → instance-VAFYVJOa.js} +495 -283
- package/dist/{interactions-D102JxBR.js → interactions-CTeACdT_.js} +1 -1
- package/dist/jsx-dev-runtime.d.ts +51 -11
- package/dist/jsx-globals.d.ts +2 -0
- package/dist/jsx-runtime-CPJXAOBF.js +43 -0
- package/dist/jsx-runtime.d.ts +17 -3
- package/dist/jsx-runtime.js +2 -42
- package/dist/jsx.d.ts +108 -0
- package/dist/{manifest-D6rfj_jC.js → manifest-D1P3UNWV.js} +4 -9
- package/dist/{navigate-ZZu1IV0B.js → navigate-prC5V8XV.js} +125 -472
- package/dist/{navigate-F4sHgWbw.d.ts → navigation.d.ts} +8 -8
- package/dist/{readable-Di1fzSwm.js → notify-DxxuDPeY.js} +96 -34
- package/dist/{query-registry-Bua3cDyb.js → query-registry-LrYpQsDJ.js} +1 -1
- package/dist/{compose-ref-DOJHoW5X.d.ts → refs.d.ts} +11 -7
- package/dist/{ssr-Doog-AfJ.js → render-resolved-BC0W7_5b.js} +165 -558
- package/dist/{renderer-Cl23O0hV.js → renderer-CT0HeY58.js} +6825 -5692
- package/dist/{resolution-ClD-K7Lz.js → resolution-3DskUkjG.js} +189 -180
- package/dist/{resource-operation-Vz1S5h2k.js → resource-18-sFRl9.js} +98 -58
- package/dist/resources/index.d.ts +64 -12
- package/dist/resources/index.js +214 -8
- package/dist/route-activity.d.ts +21 -0
- package/dist/{route-matching-Bo6UqG-5.js → route-matching-CUzZ31gT.js} +68 -82
- package/dist/router/index.d.ts +378 -79
- package/dist/router/index.js +9 -9
- package/dist/router-internal-7nuNEHfG.js +36 -0
- package/dist/scope-Cq_iYbTR.js +403 -0
- package/dist/{selector-CsKuomw0.js → selector-BSPVkjKP.js} +26 -27
- package/dist/{shared-CYBH3F8I.js → shared-kU8yvryp.js} +3 -6
- package/dist/{snapshot-source-BB42xgwb.js → snapshot-source-An4iKajG.js} +1 -1
- package/dist/ssg/index.d.ts +51 -15
- package/dist/ssg/index.js +269 -209
- package/dist/ssr/index.d.ts +121 -68
- package/dist/ssr/index.js +2 -1
- package/dist/ssr-CiNm6Vzl.js +393 -0
- package/dist/{ssr-DSHd_Q9K.js → ssr-EPjwJH5R.js} +5 -1
- package/dist/{state-BGJgYSyQ.js → state-BXJfudq1.js} +10 -15
- package/dist/{structures-DFyK5AdQ.js → structures-CjEzfj4h.js} +37 -57
- package/dist/{index-CTpMmzgN.d.ts → structures.d.ts} +57 -36
- package/dist/testing/index.d.ts +123 -24
- package/dist/testing/index.js +24 -61
- package/dist/timer-C7uqnJVt.js +85 -0
- package/dist/{index-B1gu0_m0.d.ts → utilities.d.ts} +24 -13
- package/dist/{verify-hydration-BZPJ_kYa.js → verify-hydration-ikaxotf7.js} +8 -5
- package/package.json +12 -14
- package/dist/access-BucjYZcX.js +0 -509
- package/dist/activity-DooIuxQO.d.ts +0 -14
- package/dist/benchmark.d.ts +0 -26
- package/dist/cleanup-TXSsApEl.js +0 -535
- package/dist/component-cleanup-jdbgjkT1.js +0 -143
- package/dist/component-scope-4I3yEMkb.js +0 -195
- package/dist/control-Cxag1yqV.d.ts +0 -8
- package/dist/csp-nonce-9NFUb7hJ.js +0 -72
- package/dist/css-BuPaTOfe.js +0 -70
- package/dist/fastlane-BKZduiBQ.js +0 -166
- package/dist/index-Dgjbo2gU.d.ts +0 -1456
- package/dist/jsx-runtime-Cg7GqY1S.d.ts +0 -2
- package/dist/jsx-runtime-gVIaTPw0.d.ts +0 -38
- package/dist/lifecycle-batch-63aXFf2S.js +0 -253
- package/dist/lifecycle-operations-Q0k3EFnG.js +0 -287
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { O as ownCleanup, b as attachOwnership } from "./scope-Cq_iYbTR.js";
|
|
2
|
+
//#region src/runtime/component/capabilities.ts
|
|
3
|
+
/** Integrations may identify and attach to a lifetime without changing it. */
|
|
4
|
+
function getComponentLifetimeIdentity(instance) {
|
|
5
|
+
return instance.owner.identity;
|
|
6
|
+
}
|
|
7
|
+
function adoptComponentParent(instance, parent, lifetime = parent?.owner ?? null) {
|
|
8
|
+
instance.parentInstance = parent;
|
|
9
|
+
attachOwnership(instance.owner, lifetime ?? void 0);
|
|
10
|
+
}
|
|
11
|
+
function ownComponentCleanup(instance, cleanup) {
|
|
12
|
+
ownCleanup(instance.owner, cleanup);
|
|
13
|
+
}
|
|
14
|
+
function isServerComponent(instance) {
|
|
15
|
+
return instance.ssr === true;
|
|
16
|
+
}
|
|
17
|
+
/** All lifecycle primitives share the execution record's single slot store. */
|
|
18
|
+
function getComponentLifecycleSlot(instance, index, kind, create, name = kind) {
|
|
19
|
+
const slots = instance.lifecycleSlots ??= [];
|
|
20
|
+
const existing = slots[index];
|
|
21
|
+
if (existing) {
|
|
22
|
+
if (existing.kind !== kind) throw new Error(`${name}() lifecycle order violation: slot ${index} already belongs to ${existing.kind}(). Keep lifecycle primitives in a stable top-level order.`);
|
|
23
|
+
return existing;
|
|
24
|
+
}
|
|
25
|
+
const slot = create();
|
|
26
|
+
slots[index] = slot;
|
|
27
|
+
return slot;
|
|
28
|
+
}
|
|
29
|
+
/** Identity mutation stays with the execution record; renderers resolve keys. */
|
|
30
|
+
function setComponentVNodeIdentity(instance, node, parent, resolveKey, wrapperDepth = 0, position) {
|
|
31
|
+
adoptComponentParent(instance, parent);
|
|
32
|
+
instance._vnodeOwner = typeof node === "object" && node !== null ? node : void 0;
|
|
33
|
+
instance._vnodeParent = parent;
|
|
34
|
+
instance._vnodeParentGeneration = parent?.owner.identity;
|
|
35
|
+
const key = resolveKey(node);
|
|
36
|
+
if (key === void 0) delete instance._vnodeKey;
|
|
37
|
+
else instance._vnodeKey = key;
|
|
38
|
+
instance._vnodePosition = position;
|
|
39
|
+
instance._wrapperDepth = wrapperDepth;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { ownComponentCleanup as a, isServerComponent as i, getComponentLifecycleSlot as n, setComponentVNodeIdentity as o, getComponentLifetimeIdentity as r, adoptComponentParent as t };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/common/error-boundary.d.ts
|
|
1
|
+
import { VNode } from '../core.js';
|
|
2
|
+
import { JSXElement, Props } from '../elements.js';
|
|
4
3
|
type ErrorBoundaryContent = VNode | readonly VNode[];
|
|
5
4
|
type ErrorBoundaryFallbackValue = ErrorBoundaryContent | Node;
|
|
6
5
|
/** Renders a fallback for the caught error; call `reset` to retry the children. */
|
|
7
|
-
type ErrorBoundaryFallbackRender = (
|
|
6
|
+
type ErrorBoundaryFallbackRender = (
|
|
7
|
+
error: unknown,
|
|
8
|
+
reset: () => void
|
|
9
|
+
) => ErrorBoundaryFallbackValue;
|
|
8
10
|
/** Props for {@link ErrorBoundary}. */
|
|
9
11
|
interface ErrorBoundaryProps extends Props {
|
|
10
12
|
children?: ErrorBoundaryContent;
|
|
@@ -15,12 +17,13 @@ interface ErrorBoundaryProps extends Props {
|
|
|
15
17
|
/** Changing this value resets the boundary, re-rendering the children. */
|
|
16
18
|
resetKey?: unknown;
|
|
17
19
|
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/components/error-boundary.d.ts
|
|
20
20
|
/**
|
|
21
21
|
* Creates a boundary for descendant mount and post-mount render/commit errors,
|
|
22
22
|
* including content materialized through a portal host.
|
|
23
23
|
*/
|
|
24
24
|
declare function ErrorBoundary(props: ErrorBoundaryProps): JSXElement;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
export {
|
|
26
|
+
ErrorBoundary,
|
|
27
|
+
type ErrorBoundaryFallbackRender,
|
|
28
|
+
type ErrorBoundaryProps,
|
|
29
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { f as getCurrentComponentInstance } from "../scope-Cq_iYbTR.js";
|
|
1
2
|
import { t as __ERROR_BOUNDARY__ } from "../vnode-D24p6IW2.js";
|
|
2
|
-
import { f as getCurrentComponentInstance } from "../component-scope-4I3yEMkb.js";
|
|
3
3
|
import { t as ELEMENT_TYPE } from "../jsx-DRS-qjiN.js";
|
|
4
4
|
//#region src/components/error-boundary.tsx
|
|
5
5
|
function ensureBoundaryState(instance, resetKey) {
|
|
@@ -13,7 +13,13 @@ function setRef(ref, value) {
|
|
|
13
13
|
/** Combine multiple refs into one callback ref that writes to all of them. */
|
|
14
14
|
function composeRefs(...refs) {
|
|
15
15
|
return (value) => {
|
|
16
|
-
|
|
16
|
+
const errors = [];
|
|
17
|
+
for (const ref of refs) try {
|
|
18
|
+
setRef(ref, value);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
errors.push(error);
|
|
21
|
+
}
|
|
22
|
+
if (errors.length > 0) throw new AggregateError(errors, "Composed ref callbacks failed");
|
|
17
23
|
};
|
|
18
24
|
}
|
|
19
25
|
//#endregion
|
package/dist/control/index.d.ts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Show,
|
|
3
|
+
ShowProps,
|
|
4
|
+
For,
|
|
5
|
+
CaseProps,
|
|
6
|
+
Match,
|
|
7
|
+
MatchProps,
|
|
8
|
+
ForProps,
|
|
9
|
+
Case,
|
|
10
|
+
} from '../core.js';
|
|
11
|
+
export {
|
|
12
|
+
Case,
|
|
13
|
+
type CaseProps,
|
|
14
|
+
For,
|
|
15
|
+
type ForProps,
|
|
16
|
+
Match,
|
|
17
|
+
type MatchProps,
|
|
18
|
+
Show,
|
|
19
|
+
type ShowProps,
|
|
20
|
+
};
|
package/dist/control/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as For, n as Match, r as Show, t as Case } from "../control-
|
|
1
|
+
import { i as For, n as Match, r as Show, t as Case } from "../control-BR_mrX__.js";
|
|
2
2
|
export { Case, For, Match, Show };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { w as isDevelopmentEnvironment } from "./access-CEA2pOry.js";
|
|
1
2
|
import { i as markEagerControlPrimitive, t as __CONTROL_BOUNDARY__ } from "./control-C-ApnFs1.js";
|
|
2
|
-
import { x as isDevelopmentEnvironment } from "./access-BucjYZcX.js";
|
|
3
3
|
import { n as Fragment } from "./jsx-DRS-qjiN.js";
|
|
4
|
-
import { m as createShowState, p as createCaseState, s as useForState } from "./for-
|
|
5
|
-
import { t as createFineGrainedEffect } from "./effect-
|
|
6
|
-
import { t as state } from "./state-
|
|
4
|
+
import { m as createShowState, p as createCaseState, s as useForState } from "./for-state-BDykeOJL.js";
|
|
5
|
+
import { t as createFineGrainedEffect } from "./effect-C3Zsc1k6.js";
|
|
6
|
+
import { t as state } from "./state-BXJfudq1.js";
|
|
7
7
|
//#region src/control/shared.ts
|
|
8
8
|
function normalizeBoundaryChild(value) {
|
|
9
9
|
if (Array.isArray(value)) {
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/** Compatibility re-export surface for maintained domain contracts. */
|
|
2
|
+
import './jsx-globals.js';
|
|
3
|
+
export {
|
|
4
|
+
selector,
|
|
5
|
+
StateSetter,
|
|
6
|
+
StateTuple,
|
|
7
|
+
state,
|
|
8
|
+
derive,
|
|
9
|
+
Derived,
|
|
10
|
+
State,
|
|
11
|
+
Selector,
|
|
12
|
+
} from './domains/state.js';
|
|
13
|
+
export {
|
|
14
|
+
cspNonce,
|
|
15
|
+
SSRStyleRegistrationValidation,
|
|
16
|
+
SSRPortalState,
|
|
17
|
+
DocumentRenderer,
|
|
18
|
+
DeferredBoundaryRegistration,
|
|
19
|
+
DocumentRenderContext,
|
|
20
|
+
registerSSRStyle,
|
|
21
|
+
SSRData,
|
|
22
|
+
DocumentRenderArgs,
|
|
23
|
+
CspNonceScope,
|
|
24
|
+
SSRStyleRegistration,
|
|
25
|
+
} from './domains/server.js';
|
|
26
|
+
export {
|
|
27
|
+
RenderableChild,
|
|
28
|
+
ComponentFunction,
|
|
29
|
+
defineScope,
|
|
30
|
+
VNode,
|
|
31
|
+
readScope,
|
|
32
|
+
Scope,
|
|
33
|
+
} from './domains/context.js';
|
|
34
|
+
export {
|
|
35
|
+
createMutation,
|
|
36
|
+
createQuery,
|
|
37
|
+
invalidate,
|
|
38
|
+
QueryStaleReason,
|
|
39
|
+
Mutation,
|
|
40
|
+
createDataRuntime,
|
|
41
|
+
ServerQueryRegistry,
|
|
42
|
+
QueryCollection,
|
|
43
|
+
defineServerQueries,
|
|
44
|
+
QueryCollectionOptions,
|
|
45
|
+
dehydrateDataRuntime,
|
|
46
|
+
QueryConsistency,
|
|
47
|
+
createQueryCollection,
|
|
48
|
+
QueryScope,
|
|
49
|
+
serveQuery,
|
|
50
|
+
QueryPrefetchContext,
|
|
51
|
+
InvalidateOptions,
|
|
52
|
+
createQueryPrefetchContext,
|
|
53
|
+
QueryCollectionEntry,
|
|
54
|
+
prefetchQuery,
|
|
55
|
+
QueryKeyPart,
|
|
56
|
+
DataRuntimeOptions,
|
|
57
|
+
MutationOptions,
|
|
58
|
+
hydrateDataRuntime,
|
|
59
|
+
QueryDefinition,
|
|
60
|
+
InvalidateOnIntervalOptions,
|
|
61
|
+
ServerQueryEntry,
|
|
62
|
+
Query,
|
|
63
|
+
DataRuntime,
|
|
64
|
+
defineQuery,
|
|
65
|
+
QueryCollectionKey,
|
|
66
|
+
invalidateOnInterval,
|
|
67
|
+
ServerQueryHandler,
|
|
68
|
+
getDefaultDataRuntime,
|
|
69
|
+
queryScope,
|
|
70
|
+
} from './domains/data.js';
|
|
71
|
+
export { CoreTelemetry } from './domains/telemetry.js';
|
|
72
|
+
export {
|
|
73
|
+
RouteSnapshot,
|
|
74
|
+
RouteDefinition,
|
|
75
|
+
RoutePathParams,
|
|
76
|
+
PageScopeRecord,
|
|
77
|
+
RouteAuthResolver,
|
|
78
|
+
RouteAuthOptions,
|
|
79
|
+
RouteMeta,
|
|
80
|
+
RouteRefSearch,
|
|
81
|
+
RouteQuery,
|
|
82
|
+
RouteMetaSource,
|
|
83
|
+
RouteRenderResult,
|
|
84
|
+
RouteRegistry,
|
|
85
|
+
RouteMode,
|
|
86
|
+
RouteHandler,
|
|
87
|
+
RouteManifest,
|
|
88
|
+
RouteComponent,
|
|
89
|
+
RouteMatch,
|
|
90
|
+
RouteSearchValue,
|
|
91
|
+
RouteOptions,
|
|
92
|
+
PageHelperOptions,
|
|
93
|
+
Route,
|
|
94
|
+
RouteRecord,
|
|
95
|
+
RoutePolicy,
|
|
96
|
+
RouteRef,
|
|
97
|
+
RouteRequestResult,
|
|
98
|
+
RouteRequestOptions,
|
|
99
|
+
RouteSearch,
|
|
100
|
+
AccessDenyStatus,
|
|
101
|
+
GroupHelperOptions,
|
|
102
|
+
AccessDenyDecision,
|
|
103
|
+
AccessDecision,
|
|
104
|
+
RouteDestination,
|
|
105
|
+
RouteContext,
|
|
106
|
+
AccessAllowDecision,
|
|
107
|
+
RouteRegistryOptions,
|
|
108
|
+
AccessRedirectDecision,
|
|
109
|
+
ParsedSegment,
|
|
110
|
+
LayoutScopeRecord,
|
|
111
|
+
AccessRedirectStatus,
|
|
112
|
+
RouteParams,
|
|
113
|
+
} from './domains/routing.js';
|
|
114
|
+
export { getSignal } from './domains/component.js';
|
|
115
|
+
export { scheduleEventHandler } from './domains/scheduler.js';
|
|
116
|
+
export {
|
|
117
|
+
RuntimeKeyedReorderDecision,
|
|
118
|
+
getDefaultRuntime,
|
|
119
|
+
RuntimeRendererHost,
|
|
120
|
+
AskrRuntime,
|
|
121
|
+
AskrRuntimeOptions,
|
|
122
|
+
createRuntime,
|
|
123
|
+
} from './domains/renderer.js';
|
|
124
|
+
export {
|
|
125
|
+
Show,
|
|
126
|
+
ShowProps,
|
|
127
|
+
For,
|
|
128
|
+
CaseProps,
|
|
129
|
+
Match,
|
|
130
|
+
MatchProps,
|
|
131
|
+
ForProps,
|
|
132
|
+
Case,
|
|
133
|
+
} from './domains/control.js';
|
|
134
|
+
export {
|
|
135
|
+
routeActive,
|
|
136
|
+
TimerOptions,
|
|
137
|
+
WatchSource,
|
|
138
|
+
WatchCallback,
|
|
139
|
+
on,
|
|
140
|
+
ActivityPredicate,
|
|
141
|
+
ListenerTarget,
|
|
142
|
+
capture,
|
|
143
|
+
WatchValues,
|
|
144
|
+
documentVisible,
|
|
145
|
+
task,
|
|
146
|
+
watch,
|
|
147
|
+
WatchContext,
|
|
148
|
+
windowFocused,
|
|
149
|
+
timer,
|
|
150
|
+
} from './domains/lifecycle.js';
|
|
151
|
+
export {
|
|
152
|
+
configureRenderDiagnostics,
|
|
153
|
+
RenderDiagnosticsOptions,
|
|
154
|
+
} from './domains/diagnostics.js';
|
|
155
|
+
export { createRef, Ref } from './domains/refs.js';
|
|
156
|
+
export {
|
|
157
|
+
action,
|
|
158
|
+
ActionValidationError,
|
|
159
|
+
ActionForm,
|
|
160
|
+
defineAction,
|
|
161
|
+
ActionStatus,
|
|
162
|
+
ActionDescriptor,
|
|
163
|
+
} from './domains/actions.js';
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { m as defineScope, v as readScope } from "./instance-VAFYVJOa.js";
|
|
2
|
+
//#region src/common/attr-names.ts
|
|
3
|
+
/**
|
|
4
|
+
* JSX prop name to rendered HTML attribute name.
|
|
5
|
+
*
|
|
6
|
+
* The DOM renderer additionally lowercases the result for non-SVG elements,
|
|
7
|
+
* using the element's real namespace. SSR renders to text and has no element to
|
|
8
|
+
* ask, so every camelCase attribute the public prop types declare is mapped
|
|
9
|
+
* explicitly here — otherwise SSR emits `tabIndex` where the DOM renderer
|
|
10
|
+
* writes `tabindex`. All of the entries below are HTML-only attribute names
|
|
11
|
+
* that are lowercase in SVG too, so the mapping is namespace-independent.
|
|
12
|
+
*/
|
|
13
|
+
const PUBLIC_ATTRIBUTE_NAME_MAP = {
|
|
14
|
+
className: "class",
|
|
15
|
+
htmlFor: "for",
|
|
16
|
+
strokeWidth: "stroke-width",
|
|
17
|
+
strokeLinecap: "stroke-linecap",
|
|
18
|
+
strokeLinejoin: "stroke-linejoin",
|
|
19
|
+
fillRule: "fill-rule",
|
|
20
|
+
clipRule: "clip-rule",
|
|
21
|
+
autoComplete: "autocomplete",
|
|
22
|
+
colSpan: "colspan",
|
|
23
|
+
contentEditable: "contenteditable",
|
|
24
|
+
enterKeyHint: "enterkeyhint",
|
|
25
|
+
inputMode: "inputmode",
|
|
26
|
+
maxLength: "maxlength",
|
|
27
|
+
minLength: "minlength",
|
|
28
|
+
noValidate: "novalidate",
|
|
29
|
+
readOnly: "readonly",
|
|
30
|
+
rowSpan: "rowspan",
|
|
31
|
+
spellCheck: "spellcheck",
|
|
32
|
+
tabIndex: "tabindex"
|
|
33
|
+
};
|
|
34
|
+
function getPublicAttributeName(propName) {
|
|
35
|
+
return PUBLIC_ATTRIBUTE_NAME_MAP[propName] ?? propName;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/common/prop-classification.ts
|
|
39
|
+
/**
|
|
40
|
+
* The prop vocabulary shared by the DOM renderer and the SSR renderer.
|
|
41
|
+
*
|
|
42
|
+
* These questions — is this prop framework-internal, is it an ARIA attribute,
|
|
43
|
+
* how is a style property named, does a `true` value render bare — were
|
|
44
|
+
* previously answered separately on each side, and the answers had drifted.
|
|
45
|
+
* Both renderers must agree for hydration to match, so the answers live here.
|
|
46
|
+
*/
|
|
47
|
+
/** Props that are never rendered as attributes by either renderer. */
|
|
48
|
+
function isSkippedProp(key) {
|
|
49
|
+
return key === "children" || key === "imperativeChildren" || key === "key" || key === "ref";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* ARIA state attributes take the strings `"true"`/`"false"`, so unlike HTML
|
|
53
|
+
* boolean attributes a `false` value is meaningful and must still be rendered.
|
|
54
|
+
*/
|
|
55
|
+
function isAriaAttribute(key) {
|
|
56
|
+
return key.length > 5 && key.slice(0, 5).toLowerCase() === "aria-";
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* CSS custom properties are case-sensitive and must survive verbatim; every
|
|
60
|
+
* other style property is camelCase in JSX and kebab-case in CSS.
|
|
61
|
+
*/
|
|
62
|
+
function normalizeStylePropertyName(propertyName) {
|
|
63
|
+
if (propertyName.startsWith("--")) return propertyName;
|
|
64
|
+
return propertyName.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* HTML boolean content attributes: present means true, and the value is
|
|
68
|
+
* ignored. A `true` prop renders these bare on both sides. Anything else —
|
|
69
|
+
* `aria-*`, `data-*`, arbitrary attributes — renders the literal `"true"`,
|
|
70
|
+
* because for those the value carries the meaning.
|
|
71
|
+
*/
|
|
72
|
+
const BOOLEAN_HTML_ATTRIBUTES = new Set("allowfullscreen async autofocus autoplay checked controls default defer disabled formnovalidate inert ismap itemscope loop multiple muted nomodule novalidate open playsinline readonly required reversed selected".split(" "));
|
|
73
|
+
/**
|
|
74
|
+
* The attribute text for a prop value that is exactly `true`.
|
|
75
|
+
*
|
|
76
|
+
* Boolean attributes render bare (an empty value); everything else renders
|
|
77
|
+
* `"true"` so ARIA state and `data-` payloads survive a round trip.
|
|
78
|
+
*/
|
|
79
|
+
function booleanAttributeValue(attributeName) {
|
|
80
|
+
return BOOLEAN_HTML_ATTRIBUTES.has(attributeName.toLowerCase()) ? "" : "true";
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/common/css.ts
|
|
84
|
+
const CSS_UNSAFE_RE = /[{}<>\\]/g;
|
|
85
|
+
const CSS_URI_SCHEME_RE = /(?:^|[\s(,])([a-z][a-z0-9+.-]*):/i;
|
|
86
|
+
const CSS_FUNCTION_NAME_RE = /([a-z-][a-z0-9-]*)\s*\(/gi;
|
|
87
|
+
const CSS_ALLOWED_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
88
|
+
"var",
|
|
89
|
+
"calc",
|
|
90
|
+
"min",
|
|
91
|
+
"max",
|
|
92
|
+
"clamp",
|
|
93
|
+
"rgb",
|
|
94
|
+
"rgba",
|
|
95
|
+
"hsl",
|
|
96
|
+
"hsla",
|
|
97
|
+
"lab",
|
|
98
|
+
"lch",
|
|
99
|
+
"oklab",
|
|
100
|
+
"oklch",
|
|
101
|
+
"color",
|
|
102
|
+
"color-mix",
|
|
103
|
+
"translate",
|
|
104
|
+
"translatex",
|
|
105
|
+
"translatey",
|
|
106
|
+
"translatez",
|
|
107
|
+
"scale",
|
|
108
|
+
"scalex",
|
|
109
|
+
"scaley",
|
|
110
|
+
"scalez",
|
|
111
|
+
"rotate",
|
|
112
|
+
"rotatex",
|
|
113
|
+
"rotatey",
|
|
114
|
+
"rotatez",
|
|
115
|
+
"skew",
|
|
116
|
+
"skewx",
|
|
117
|
+
"skewy",
|
|
118
|
+
"matrix",
|
|
119
|
+
"matrix3d",
|
|
120
|
+
"linear-gradient",
|
|
121
|
+
"radial-gradient",
|
|
122
|
+
"conic-gradient",
|
|
123
|
+
"repeating-linear-gradient",
|
|
124
|
+
"repeating-radial-gradient",
|
|
125
|
+
"repeating-conic-gradient",
|
|
126
|
+
"cubic-bezier",
|
|
127
|
+
"steps"
|
|
128
|
+
]);
|
|
129
|
+
function sanitizeCssValue(value) {
|
|
130
|
+
const str = String(value);
|
|
131
|
+
if (CSS_URI_SCHEME_RE.test(str)) return "";
|
|
132
|
+
if (str.includes("(")) {
|
|
133
|
+
for (const match of str.matchAll(CSS_FUNCTION_NAME_RE)) if (!CSS_ALLOWED_FUNCTIONS.has(match[1].toLowerCase())) return "";
|
|
134
|
+
}
|
|
135
|
+
return str.replace(CSS_UNSAFE_RE, "");
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/csp-nonce.ts
|
|
139
|
+
/** Lexical scope carrying the CSP nonce for the current render, if any. */
|
|
140
|
+
const CspNonceScope = defineScope(void 0);
|
|
141
|
+
/**
|
|
142
|
+
* Read the CSP nonce for the current render from {@link CspNonceScope}.
|
|
143
|
+
*
|
|
144
|
+
* @returns The active nonce, or `undefined` when called outside of a
|
|
145
|
+
* component render or when no nonce was configured.
|
|
146
|
+
*/
|
|
147
|
+
function cspNonce() {
|
|
148
|
+
try {
|
|
149
|
+
return readScope(CspNonceScope);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
if (error instanceof Error && error.message.startsWith("readScope() can only be called during component render")) return;
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function validateCspNonce(value) {
|
|
156
|
+
if (value === void 0) return void 0;
|
|
157
|
+
const invalid = () => {
|
|
158
|
+
throw new TypeError("CSP nonce must be valid base64 or base64url encoding at least 16 bytes.");
|
|
159
|
+
};
|
|
160
|
+
if (value.length === 0 || !/^[A-Za-z0-9+/_-]+={0,2}$/.test(value) || value.length % 4 === 1 || /=/.test(value.slice(0, -2))) invalid();
|
|
161
|
+
const unpadded = value.replace(/-/g, "+").replace(/_/g, "/").replace(/=+$/, "");
|
|
162
|
+
const padded = unpadded.padEnd(Math.ceil(unpadded.length / 4) * 4, "=");
|
|
163
|
+
let decoded = "";
|
|
164
|
+
try {
|
|
165
|
+
decoded = atob(padded);
|
|
166
|
+
} catch {
|
|
167
|
+
invalid();
|
|
168
|
+
}
|
|
169
|
+
if (decoded.length < 16) invalid();
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
export { booleanAttributeValue as a, normalizeStylePropertyName as c, sanitizeCssValue as i, getPublicAttributeName as l, cspNonce as n, isAriaAttribute as o, validateCspNonce as r, isSkippedProp as s, CspNonceScope as t };
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,2 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createMutation,
|
|
3
|
+
createQuery,
|
|
4
|
+
invalidate,
|
|
5
|
+
QueryStaleReason,
|
|
6
|
+
Mutation,
|
|
7
|
+
createDataRuntime,
|
|
8
|
+
ServerQueryRegistry,
|
|
9
|
+
QueryCollection,
|
|
10
|
+
defineServerQueries,
|
|
11
|
+
QueryCollectionOptions,
|
|
12
|
+
dehydrateDataRuntime,
|
|
13
|
+
QueryConsistency,
|
|
14
|
+
createQueryCollection,
|
|
15
|
+
QueryScope,
|
|
16
|
+
serveQuery,
|
|
17
|
+
QueryPrefetchContext,
|
|
18
|
+
InvalidateOptions,
|
|
19
|
+
createQueryPrefetchContext,
|
|
20
|
+
QueryCollectionEntry,
|
|
21
|
+
prefetchQuery,
|
|
22
|
+
QueryKeyPart,
|
|
23
|
+
DataRuntimeOptions,
|
|
24
|
+
MutationOptions,
|
|
25
|
+
hydrateDataRuntime,
|
|
26
|
+
QueryDefinition,
|
|
27
|
+
InvalidateOnIntervalOptions,
|
|
28
|
+
ServerQueryEntry,
|
|
29
|
+
Query,
|
|
30
|
+
DataRuntime,
|
|
31
|
+
defineQuery,
|
|
32
|
+
QueryCollectionKey,
|
|
33
|
+
invalidateOnInterval,
|
|
34
|
+
ServerQueryHandler,
|
|
35
|
+
getDefaultDataRuntime,
|
|
36
|
+
queryScope,
|
|
37
|
+
} from '../core.js';
|
|
38
|
+
export {
|
|
39
|
+
type DataRuntime,
|
|
40
|
+
type DataRuntimeOptions,
|
|
41
|
+
type InvalidateOnIntervalOptions,
|
|
42
|
+
type InvalidateOptions,
|
|
43
|
+
type Mutation,
|
|
44
|
+
type MutationOptions,
|
|
45
|
+
type Query,
|
|
46
|
+
type QueryCollection,
|
|
47
|
+
type QueryCollectionEntry,
|
|
48
|
+
type QueryCollectionKey,
|
|
49
|
+
type QueryCollectionOptions,
|
|
50
|
+
type QueryConsistency,
|
|
51
|
+
type QueryDefinition,
|
|
52
|
+
type QueryKeyPart,
|
|
53
|
+
type QueryPrefetchContext,
|
|
54
|
+
type QueryScope,
|
|
55
|
+
type QueryStaleReason,
|
|
56
|
+
type ServerQueryEntry,
|
|
57
|
+
type ServerQueryHandler,
|
|
58
|
+
type ServerQueryRegistry,
|
|
59
|
+
createDataRuntime,
|
|
60
|
+
createMutation,
|
|
61
|
+
createQuery,
|
|
62
|
+
createQueryCollection,
|
|
63
|
+
createQueryPrefetchContext,
|
|
64
|
+
defineQuery,
|
|
65
|
+
defineServerQueries,
|
|
66
|
+
dehydrateDataRuntime,
|
|
67
|
+
getDefaultDataRuntime,
|
|
68
|
+
hydrateDataRuntime,
|
|
69
|
+
invalidate,
|
|
70
|
+
invalidateOnInterval,
|
|
71
|
+
prefetchQuery,
|
|
72
|
+
queryScope,
|
|
73
|
+
serveQuery,
|
|
74
|
+
};
|
package/dist/data/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery, t as createQueryPrefetchContext } from "../query-registry-
|
|
1
|
+
import { i as getDefaultDataRuntime, t as createDataRuntime } from "../data-runtime-CxoY98lX.js";
|
|
2
|
+
import { c as createMutation, d as queryScope, l as invalidate, n as createQuery, t as createQueryCollection, u as invalidateOnInterval } from "../data-2edW0jhF.js";
|
|
3
|
+
import { a as hydrateDataRuntime, i as dehydrateDataRuntime, n as defineQuery, o as prefetchQuery, r as defineServerQueries, s as serveQuery, t as createQueryPrefetchContext } from "../query-registry-LrYpQsDJ.js";
|
|
4
4
|
export { createDataRuntime, createMutation, createQuery, createQueryCollection, createQueryPrefetchContext, defineQuery, defineServerQueries, dehydrateDataRuntime, getDefaultDataRuntime, hydrateDataRuntime, invalidate, invalidateOnInterval, prefetchQuery, queryScope, serveQuery };
|