@askrjs/askr 0.0.85 → 0.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +2 -2
- package/dist/{activity-Jd9CgEa3.js → activity-BvgvaMZA.js} +2 -2
- package/dist/benchmark.js +4 -4
- package/dist/boot/index.js +1 -1
- package/dist/{boot-DWe880Et.js → boot-CViTpUiB.js} +13 -12
- package/dist/data/index.js +3 -3
- package/dist/{data-Dkqb8_QP.js → data-DGrD3-qA.js} +2 -2
- package/dist/{data-runtime-D68YOo9L.js → data-runtime-Ck3tJDDQ.js} +1 -1
- package/dist/default-portal-runtime-DvMvWJVp.js +20 -0
- package/dist/{authoring-DdQ3pHqt.js → deferred-nleQtdfY.js} +81 -4
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +1 -2
- package/dist/foundations/structures/index.d.ts +1 -1
- package/dist/foundations/structures/index.js +1 -2
- package/dist/{index-Bkh9S9-t.d.ts → index-DflhL1h8.d.ts} +15 -15
- package/dist/index.js +4 -4
- package/dist/manifest-D1P9uTlz.js +53 -0
- package/dist/{navigate-b4GGxO_l.js → navigate-BwAPbpCb.js} +6 -6
- package/dist/{query-registry-BL6rjGsO.js → query-registry-CPW_6nwF.js} +1 -1
- package/dist/render-context-D0Hoj9dW.js +161 -0
- package/dist/{deferred-vUOy-awa.js → resolution-YHwi4Bav.js} +59 -229
- package/dist/resource-operation-ys6eDoRJ.js +304 -0
- package/dist/resources/index.js +2 -2
- package/dist/{route-matching-DHduNiGk.js → route-matching-DqULzZtC.js} +2 -276
- package/dist/router/index.d.ts +5 -3
- package/dist/router/index.js +6 -5
- package/dist/ssg/index.js +5 -4
- package/dist/ssr/index.js +2 -2
- package/dist/{ssr-CpiBHMNv.js → ssr-B98593qJ.js} +28 -13
- package/dist/{portal-BVWjAhNQ.js → structures-DsOm-clq.js} +232 -3
- package/dist/testing/index.js +3 -3
- package/dist/{verify-hydration-C3QBBQqR.js → verify-hydration-ww1dgwea.js} +4 -3
- package/package.json +2 -2
- package/dist/render-context-D-DFk2WN.js +0 -73
- package/dist/structures-DSLF_iis.js +0 -223
- package/dist/{renderer-CZzNtoj2.js → renderer-D9DL9R2D.js} +1 -1
package/dist/testing/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as flushRuntimeScheduler } from "../access-Dpfoi4cA.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as cleanupApp, r as createSPA, t as createIsland } from "../boot-
|
|
2
|
+
import { l as addInvalidationListener } from "../data-runtime-Ck3tJDDQ.js";
|
|
3
|
+
import { r as computeRouteActivityMatches } from "../route-matching-DqULzZtC.js";
|
|
4
|
+
import { a as cleanupApp, r as createSPA, t as createIsland } from "../boot-CViTpUiB.js";
|
|
5
5
|
//#region src/testing/render.ts
|
|
6
6
|
const renderStates = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
const eventConstructorNames = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { m as withHydrationVerificationRender } from "./render-context-D0Hoj9dW.js";
|
|
1
2
|
import { t as SSR_RENDER_DATA_ATTR } from "./ssr-DSHd_Q9K.js";
|
|
2
|
-
import { a as renderResolvedToStringSync } from "./ssr-
|
|
3
|
+
import { a as renderResolvedToStringSync } from "./ssr-B98593qJ.js";
|
|
3
4
|
//#region src/ssr/verify-hydration.ts
|
|
4
5
|
function normalizeHydrationHtml(html) {
|
|
5
6
|
const template = document.createElement("template");
|
|
@@ -9,13 +10,13 @@ function normalizeHydrationHtml(html) {
|
|
|
9
10
|
}
|
|
10
11
|
function verifyHydrationSyncForUrl(opts) {
|
|
11
12
|
const { root, url, registry, resolved, options } = opts;
|
|
12
|
-
const expected = renderResolvedToStringSync({
|
|
13
|
+
const expected = withHydrationVerificationRender(() => renderResolvedToStringSync({
|
|
13
14
|
url,
|
|
14
15
|
registry,
|
|
15
16
|
handler: resolved.handler,
|
|
16
17
|
params: resolved.params,
|
|
17
18
|
options
|
|
18
|
-
});
|
|
19
|
+
}));
|
|
19
20
|
return normalizeHydrationHtml(root.innerHTML) === normalizeHydrationHtml(expected);
|
|
20
21
|
}
|
|
21
22
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askrjs/askr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.86",
|
|
4
4
|
"description": "Actor-backed deterministic UI framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"askr",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
}
|
|
171
171
|
},
|
|
172
172
|
"engines": {
|
|
173
|
-
"node": ">=24.
|
|
173
|
+
"node": ">=24.0.0"
|
|
174
174
|
},
|
|
175
175
|
"packageManager": "npm@12.0.1",
|
|
176
176
|
"allowScripts": {
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
//#region src/common/ssr-errors.ts
|
|
2
|
-
/**
|
|
3
|
-
* Common call contracts: SSR error types
|
|
4
|
-
*/
|
|
5
|
-
var SSRDataMissingError = class SSRDataMissingError extends Error {
|
|
6
|
-
constructor(message = "Server-side rendering requires all data to be available synchronously. This component attempted to use async data during SSR.") {
|
|
7
|
-
super(message);
|
|
8
|
-
this.code = "SSR_DATA_MISSING";
|
|
9
|
-
this.name = "SSRDataMissingError";
|
|
10
|
-
Object.setPrototypeOf(this, SSRDataMissingError.prototype);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/common/render-context.ts
|
|
15
|
-
let provider = { getRenderContext() {
|
|
16
|
-
return null;
|
|
17
|
-
} };
|
|
18
|
-
let hydrationRenderData = null;
|
|
19
|
-
let hydrationKeyCounter = 0;
|
|
20
|
-
function configureRenderContextProvider(nextProvider) {
|
|
21
|
-
provider = nextProvider;
|
|
22
|
-
}
|
|
23
|
-
function getActiveRenderContext() {
|
|
24
|
-
return provider.getRenderContext();
|
|
25
|
-
}
|
|
26
|
-
/** Register request-local CSS produced during SSR without importing the SSR renderer in clients. */
|
|
27
|
-
function registerSSRStyle(id, cssText) {
|
|
28
|
-
const context = getActiveRenderContext();
|
|
29
|
-
if (!context?.ssrStyles) return;
|
|
30
|
-
const safeCssText = cssText.replace(/<\/style/gi, "<\\/style");
|
|
31
|
-
const existing = context.ssrStyles.get(id);
|
|
32
|
-
if (existing && existing.cssText !== safeCssText) throw new RangeError(`SSR style registration collision for ${JSON.stringify(id)}.`);
|
|
33
|
-
context.ssrStyles.set(id, {
|
|
34
|
-
id,
|
|
35
|
-
cssText: safeCssText
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function getCurrentRenderData() {
|
|
39
|
-
return getActiveRenderContext()?.renderData ?? hydrationRenderData;
|
|
40
|
-
}
|
|
41
|
-
function getNextRenderKey() {
|
|
42
|
-
const ctx = getActiveRenderContext();
|
|
43
|
-
if (ctx) return `r:${ctx.keyCounter++}`;
|
|
44
|
-
if (hydrationRenderData) return `r:${hydrationKeyCounter++}`;
|
|
45
|
-
return "r:0";
|
|
46
|
-
}
|
|
47
|
-
function startHydrationRenderPhase(data) {
|
|
48
|
-
hydrationRenderData = data;
|
|
49
|
-
hydrationKeyCounter = 0;
|
|
50
|
-
}
|
|
51
|
-
function stopHydrationRenderPhase() {
|
|
52
|
-
hydrationRenderData = null;
|
|
53
|
-
hydrationKeyCounter = 0;
|
|
54
|
-
}
|
|
55
|
-
function startRenderPhase(data) {
|
|
56
|
-
const ctx = getActiveRenderContext();
|
|
57
|
-
if (ctx) {
|
|
58
|
-
ctx.renderData = data ?? null;
|
|
59
|
-
ctx.keyCounter = 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function stopRenderPhase() {
|
|
63
|
-
const ctx = getActiveRenderContext();
|
|
64
|
-
if (ctx) {
|
|
65
|
-
ctx.renderData = null;
|
|
66
|
-
ctx.keyCounter = 0;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function throwSSRDataMissing() {
|
|
70
|
-
throw new SSRDataMissingError();
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
export { registerSSRStyle as a, stopHydrationRenderPhase as c, SSRDataMissingError as d, getNextRenderKey as i, stopRenderPhase as l, getActiveRenderContext as n, startHydrationRenderPhase as o, getCurrentRenderData as r, startRenderPhase as s, configureRenderContextProvider as t, throwSSRDataMissing as u };
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
2
|
-
//#region src/jsx/utils.ts
|
|
3
|
-
function isElement(value) {
|
|
4
|
-
return typeof value === "object" && value !== null && value.$$typeof === ELEMENT_TYPE;
|
|
5
|
-
}
|
|
6
|
-
function cloneElement(element, props) {
|
|
7
|
-
return {
|
|
8
|
-
$$typeof: element.$$typeof,
|
|
9
|
-
type: element.type,
|
|
10
|
-
key: element.key,
|
|
11
|
-
props: {
|
|
12
|
-
...element.props,
|
|
13
|
-
...props
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/foundations/structures/layout.tsx
|
|
19
|
-
function layout(Layout) {
|
|
20
|
-
return (children, props) => {
|
|
21
|
-
return Layout({
|
|
22
|
-
...props,
|
|
23
|
-
children
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/foundations/structures/slot.tsx
|
|
29
|
-
/**
|
|
30
|
-
* Slot
|
|
31
|
-
*
|
|
32
|
-
* Structural primitive for prop forwarding patterns.
|
|
33
|
-
*
|
|
34
|
-
* POLICY DECISIONS (LOCKED):
|
|
35
|
-
*
|
|
36
|
-
* 1. asChild Pattern
|
|
37
|
-
* When asChild=true, merges props into the single child element.
|
|
38
|
-
* Child must be a valid JSXElement; non-element children return null.
|
|
39
|
-
* **Slot props override child props** (injection pattern).
|
|
40
|
-
*
|
|
41
|
-
* 2. Fallback Behavior
|
|
42
|
-
* When asChild=false, returns a Fragment (structural no-op).
|
|
43
|
-
* No DOM element is introduced.
|
|
44
|
-
*
|
|
45
|
-
* 3. Type Safety
|
|
46
|
-
* asChild=true requires exactly one JSXElement child (enforced by type).
|
|
47
|
-
* Runtime validates with isElement() check.
|
|
48
|
-
*/
|
|
49
|
-
function Slot(props) {
|
|
50
|
-
if (props.asChild) {
|
|
51
|
-
const { children, asChild: _asChild, ...rest } = props;
|
|
52
|
-
if (isElement(children)) return cloneElement(children, rest);
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
$$typeof: ELEMENT_TYPE,
|
|
57
|
-
type: Fragment,
|
|
58
|
-
props: { children: props.children },
|
|
59
|
-
key: null
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/foundations/structures/presence.ts
|
|
64
|
-
/**
|
|
65
|
-
* Presence
|
|
66
|
-
*
|
|
67
|
-
* Structural policy primitive for conditional mount/unmount.
|
|
68
|
-
* - No timers
|
|
69
|
-
* - No animation coupling
|
|
70
|
-
* - No DOM side-effects
|
|
71
|
-
*
|
|
72
|
-
* POLICY DECISIONS (LOCKED):
|
|
73
|
-
*
|
|
74
|
-
* 1. Present as Function
|
|
75
|
-
* Accepts boolean OR function to support lazy evaluation patterns.
|
|
76
|
-
* Function is called once per render. Use boolean form for static values.
|
|
77
|
-
*
|
|
78
|
-
* 2. Children Type
|
|
79
|
-
* Presence forwards normal renderable child content only.
|
|
80
|
-
* Imperative DOM nodes are not part of the public contract.
|
|
81
|
-
*
|
|
82
|
-
* 3. Immediate Mount/Unmount
|
|
83
|
-
* No exit animations or transitions. When `present` becomes false,
|
|
84
|
-
* children are removed immediately. Animation must be layered above
|
|
85
|
-
* this primitive.
|
|
86
|
-
*/
|
|
87
|
-
function Presence({ present, children }) {
|
|
88
|
-
if (!(typeof present === "function" ? present() : Boolean(present))) return null;
|
|
89
|
-
return {
|
|
90
|
-
$$typeof: ELEMENT_TYPE,
|
|
91
|
-
type: Fragment,
|
|
92
|
-
props: { children },
|
|
93
|
-
key: null
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/foundations/structures/collection.ts
|
|
98
|
-
function createCollection() {
|
|
99
|
-
const registry = /* @__PURE__ */ new Map();
|
|
100
|
-
function register(node, metadata) {
|
|
101
|
-
const item = {
|
|
102
|
-
node,
|
|
103
|
-
metadata
|
|
104
|
-
};
|
|
105
|
-
registry.set(node, item);
|
|
106
|
-
return () => {
|
|
107
|
-
registry.delete(node);
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function items() {
|
|
111
|
-
return Array.from(registry.values());
|
|
112
|
-
}
|
|
113
|
-
function clear() {
|
|
114
|
-
registry.clear();
|
|
115
|
-
}
|
|
116
|
-
function size() {
|
|
117
|
-
return registry.size;
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
register,
|
|
121
|
-
items,
|
|
122
|
-
clear,
|
|
123
|
-
size
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* USAGE EXAMPLE:
|
|
128
|
-
*
|
|
129
|
-
* // Create a collection for menu items
|
|
130
|
-
* const menuItems = createCollection<HTMLElement, { disabled: boolean }>();
|
|
131
|
-
*
|
|
132
|
-
* // Register items
|
|
133
|
-
* const unregister1 = menuItems.register(element1, { disabled: false });
|
|
134
|
-
* const unregister2 = menuItems.register(element2, { disabled: true });
|
|
135
|
-
*
|
|
136
|
-
* // Query items
|
|
137
|
-
* const allItems = menuItems.items();
|
|
138
|
-
* const enabledItems = allItems.filter(item => !item.metadata.disabled);
|
|
139
|
-
*
|
|
140
|
-
* // Cleanup
|
|
141
|
-
* unregister1();
|
|
142
|
-
* unregister2();
|
|
143
|
-
*/
|
|
144
|
-
//#endregion
|
|
145
|
-
//#region src/foundations/structures/layer.ts
|
|
146
|
-
function createLayer() {
|
|
147
|
-
const stack = [];
|
|
148
|
-
let nextId = 1;
|
|
149
|
-
function register(options) {
|
|
150
|
-
const id = nextId++;
|
|
151
|
-
const entry = {
|
|
152
|
-
id,
|
|
153
|
-
options
|
|
154
|
-
};
|
|
155
|
-
stack.push(entry);
|
|
156
|
-
function isTop() {
|
|
157
|
-
return stack[stack.length - 1]?.id === id;
|
|
158
|
-
}
|
|
159
|
-
function unregister() {
|
|
160
|
-
const index = stack.findIndex((e) => e.id === id);
|
|
161
|
-
if (index !== -1) stack.splice(index, 1);
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
id,
|
|
165
|
-
isTop,
|
|
166
|
-
unregister
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
function layers() {
|
|
170
|
-
return stack.map((entry) => ({
|
|
171
|
-
id: entry.id,
|
|
172
|
-
isTop: () => stack[stack.length - 1]?.id === entry.id,
|
|
173
|
-
unregister: () => {
|
|
174
|
-
const index = stack.findIndex((e) => e.id === entry.id);
|
|
175
|
-
if (index !== -1) stack.splice(index, 1);
|
|
176
|
-
}
|
|
177
|
-
}));
|
|
178
|
-
}
|
|
179
|
-
function handleEscape() {
|
|
180
|
-
const top = stack[stack.length - 1];
|
|
181
|
-
if (top) top.options.onEscape?.();
|
|
182
|
-
}
|
|
183
|
-
function handleOutsidePointer(e) {
|
|
184
|
-
const top = stack[stack.length - 1];
|
|
185
|
-
if (!top) return;
|
|
186
|
-
const node = top.options.node;
|
|
187
|
-
if (node && e.target instanceof Node) {
|
|
188
|
-
if (!node.contains(e.target)) top.options.onOutsidePointer?.(e);
|
|
189
|
-
} else top.options.onOutsidePointer?.(e);
|
|
190
|
-
}
|
|
191
|
-
return {
|
|
192
|
-
register,
|
|
193
|
-
layers,
|
|
194
|
-
handleEscape,
|
|
195
|
-
handleOutsidePointer
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* USAGE EXAMPLE:
|
|
200
|
-
*
|
|
201
|
-
* const layerManager = createLayer();
|
|
202
|
-
*
|
|
203
|
-
* function Modal({ onClose }) {
|
|
204
|
-
* const modalRef = ref<HTMLDivElement>();
|
|
205
|
-
*
|
|
206
|
-
* const layer = layerManager.register({
|
|
207
|
-
* node: modalRef.current,
|
|
208
|
-
* onEscape: onClose,
|
|
209
|
-
* onOutsidePointer: onClose,
|
|
210
|
-
* });
|
|
211
|
-
*
|
|
212
|
-
* onUnmount(() => layer.unregister());
|
|
213
|
-
*
|
|
214
|
-
* return (
|
|
215
|
-
* <div ref={modalRef}>
|
|
216
|
-
* <h1>Modal</h1>
|
|
217
|
-
* {layer.isTop() && <p>I am on top!</p>}
|
|
218
|
-
* </div>
|
|
219
|
-
* );
|
|
220
|
-
* }
|
|
221
|
-
*/
|
|
222
|
-
//#endregion
|
|
223
|
-
export { layout as a, Slot as i, createCollection as n, cloneElement as o, Presence as r, isElement as s, createLayer as t };
|
|
@@ -10,9 +10,9 @@ import { c as getCurrentLifecycleCommitBatch, l as registerLifecycleRollback, p
|
|
|
10
10
|
import { _ as setControlBoundaryContextFrame, a as registerForStateTransaction, b as rerenderChildScope, c as captureForFallbackTransactionSnapshot, d as clearCaseDomUpdateState, f as clearShowDomUpdateState, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, l as captureForItemTransactionSnapshot, n as clearForDomUpdateState, o as rollbackForStateTransaction, t as beginForStateTransaction, v as createChildScope, y as disposeChildScope } from "./for-internal-B_mnQhan.js";
|
|
11
11
|
import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-lnxQIpJG.js";
|
|
12
12
|
import { C as getDelegatedHandlersForElement, D as updateDelegatedListener, E as removeDelegatedListener, S as getDelegatedHandlerForElement, T as isEventDelegationEnabled, _ as teardownNodeSubtree, a as elementReactivePropsCleanup, b as addFreshDelegatedListener, c as forEachElementReactivePropCleanup, d as removeAllListeners, f as removeElementReactiveProps, g as setFreshElementReactivePropCleanup, h as setDirectElementReactivePropCleanup, i as elementListeners, l as getElementReactivePropCleanupSize, m as replaceElementRefBookkeeping, n as cleanupInstanceIfPresent, o as elementRefs, p as removeElementRef, r as cleanupInstancesUnder, s as forEachDescendantNode, t as REACTIVE_CHILDREN_KEY, u as getElementReactivePropsCleanupMap, v as updateElementRef, w as isDelegatedEvent, x as clearDelegatedHandlersForElement, y as addDelegatedListener } from "./cleanup-c837KVij.js";
|
|
13
|
-
import { a as isSSRPortalHydrationAnchor } from "./portal-w3oQ6oQU.js";
|
|
14
13
|
import { n as getPublicAttributeName, t as sanitizeCssValue } from "./css-BuPaTOfe.js";
|
|
15
14
|
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-Bc52OIVc.js";
|
|
15
|
+
import { a as isSSRPortalHydrationAnchor } from "./portal-w3oQ6oQU.js";
|
|
16
16
|
//#region src/runtime/error-boundary.ts
|
|
17
17
|
function createBoundaryReset(instance) {
|
|
18
18
|
return () => {
|