@askrjs/askr 0.0.84 → 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.
Files changed (71) hide show
  1. package/dist/{access-ePqdQqkV.js → access-Dpfoi4cA.js} +7 -1
  2. package/dist/actions/index.d.ts +1 -1
  3. package/dist/actions/index.js +3 -3
  4. package/dist/{activity-pySy9t7Y.d.ts → activity-B1I5HJQI.d.ts} +1 -1
  5. package/dist/{activity-CZiPgZy0.js → activity-BvgvaMZA.js} +53 -16
  6. package/dist/benchmark.js +8 -8
  7. package/dist/boot/index.d.ts +3 -3
  8. package/dist/boot/index.js +1 -1
  9. package/dist/{boot-D28lesMw.js → boot-CViTpUiB.js} +22 -20
  10. package/dist/{cleanup-ARiXproi.js → cleanup-c837KVij.js} +16 -6
  11. package/dist/{component-cleanup-Bug5tSiG.js → component-cleanup-BUfUleGZ.js} +2 -2
  12. package/dist/{component-internal-Bw4Mf9fd.js → component-internal-DcrLymUJ.js} +5 -5
  13. package/dist/components/index.d.ts +1 -1
  14. package/dist/components/index.js +1 -1
  15. package/dist/control/index.d.ts +1 -1
  16. package/dist/control/index.js +1 -1
  17. package/dist/{control-Y8F73Uln.d.ts → control-DhUZU4_V.d.ts} +2 -1
  18. package/dist/{control-nrS65oG3.js → control-oLADku43.js} +4 -4
  19. package/dist/{csp-nonce-ZTlD_EnK.js → csp-nonce-Bc52OIVc.js} +19 -2
  20. package/dist/data/index.js +3 -3
  21. package/dist/{data-BRS5woEh.js → data-DGrD3-qA.js} +5 -5
  22. package/dist/{data-runtime-D68YOo9L.js → data-runtime-Ck3tJDDQ.js} +1 -1
  23. package/dist/default-portal-runtime-DvMvWJVp.js +20 -0
  24. package/dist/{authoring-DQPG0VAm.js → deferred-nleQtdfY.js} +85 -5
  25. package/dist/{effect-B487asyz.js → effect-lnxQIpJG.js} +2 -2
  26. package/dist/{fastlane-BOr4lSLl.js → fastlane-CrfB3QG0.js} +2 -2
  27. package/dist/{for-internal-DjpV8ioj.js → for-internal-B_mnQhan.js} +18 -6
  28. package/dist/foundations/index.d.ts +1 -1
  29. package/dist/foundations/index.js +1 -2
  30. package/dist/foundations/state/index.d.ts +1 -1
  31. package/dist/foundations/state/index.js +1 -1
  32. package/dist/foundations/structures/index.d.ts +2 -2
  33. package/dist/foundations/structures/index.js +2 -3
  34. package/dist/fx/index.js +1 -1
  35. package/dist/{index-BApH3laU.d.ts → index-DflhL1h8.d.ts} +20 -16
  36. package/dist/{index-_UN08Pg1.d.ts → index-pIgGaXvS.d.ts} +19 -3
  37. package/dist/{index-DUXXZ31H.d.ts → index-r-nt13FE.d.ts} +1 -1
  38. package/dist/index.d.ts +3 -3
  39. package/dist/index.js +12 -12
  40. package/dist/{lifecycle-batch-CFI4NKpJ.js → lifecycle-batch-Dfpid9-A.js} +39 -20
  41. package/dist/{lifecycle-operations-KYOIcM5R.js → lifecycle-operations-BrYrBsXY.js} +1 -1
  42. package/dist/manifest-D1P9uTlz.js +53 -0
  43. package/dist/{navigate-Dr3cjOSz.js → navigate-BwAPbpCb.js} +17 -16
  44. package/dist/{navigate-CgVIrrSs.d.ts → navigate-NyIjQUwI.d.ts} +1 -1
  45. package/dist/{query-registry-BL6rjGsO.js → query-registry-CPW_6nwF.js} +1 -1
  46. package/dist/{readable-_GQGe_St.js → readable-B5NtV7V0.js} +1 -1
  47. package/dist/render-context-D0Hoj9dW.js +161 -0
  48. package/dist/{renderer-B9j5IV1q.js → renderer-D9DL9R2D.js} +58 -17
  49. package/dist/{deferred-oqtAJ4iH.js → resolution-YHwi4Bav.js} +234 -222
  50. package/dist/resource-operation-ys6eDoRJ.js +304 -0
  51. package/dist/resources/index.d.ts +2 -2
  52. package/dist/resources/index.js +5 -5
  53. package/dist/{route-matching-IfQZmqkN.js → route-matching-DqULzZtC.js} +46 -277
  54. package/dist/router/index.d.ts +12 -10
  55. package/dist/router/index.js +10 -7
  56. package/dist/{selector-DJ1-N1K-.js → selector-Ck_Pp9av.js} +2 -2
  57. package/dist/ssg/index.d.ts +9 -3
  58. package/dist/ssg/index.js +31 -15
  59. package/dist/ssr/index.d.ts +7 -3
  60. package/dist/ssr/index.js +2 -2
  61. package/dist/{ssr-CtC4lChT.js → ssr-B98593qJ.js} +53 -27
  62. package/dist/ssr-DSHd_Q9K.js +25 -0
  63. package/dist/{state-BzIMC6-i.js → state-DCjONcHK.js} +4 -3
  64. package/dist/{portal-pHBoqwYd.js → structures-DsOm-clq.js} +236 -7
  65. package/dist/testing/index.d.ts +2 -2
  66. package/dist/testing/index.js +4 -4
  67. package/dist/{verify-hydration-BguOSco9.js → verify-hydration-ww1dgwea.js} +5 -4
  68. package/package.json +2 -2
  69. package/dist/render-context-D-DFk2WN.js +0 -73
  70. package/dist/ssr-CbQO5xd3.js +0 -12
  71. package/dist/structures-D3vO-WMN.js +0 -221
@@ -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,12 +0,0 @@
1
- //#region src/common/ssr.ts
2
- function renderDocument(document, args, apiName) {
3
- const html = document(args);
4
- if (typeof html !== "string") {
5
- const received = typeof html === "object" && html !== null && "then" in html && typeof html.then === "function" ? "a Promise-like value" : html === null ? "null" : Array.isArray(html) ? "an array" : typeof html;
6
- throw new Error(`${apiName} document() must synchronously return a string; received ${received}.`);
7
- }
8
- return html;
9
- }
10
- const SSR_RENDER_DATA_ATTR = "data-askr-render-data";
11
- //#endregion
12
- export { renderDocument as n, SSR_RENDER_DATA_ATTR as t };
@@ -1,221 +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
- ...element,
9
- props: {
10
- ...element.props,
11
- ...props
12
- }
13
- };
14
- }
15
- //#endregion
16
- //#region src/foundations/structures/layout.tsx
17
- function layout(Layout) {
18
- return (children, props) => {
19
- return Layout({
20
- ...props,
21
- children
22
- });
23
- };
24
- }
25
- //#endregion
26
- //#region src/foundations/structures/slot.tsx
27
- /**
28
- * Slot
29
- *
30
- * Structural primitive for prop forwarding patterns.
31
- *
32
- * POLICY DECISIONS (LOCKED):
33
- *
34
- * 1. asChild Pattern
35
- * When asChild=true, merges props into the single child element.
36
- * Child must be a valid JSXElement; non-element children return null.
37
- * **Slot props override child props** (injection pattern).
38
- *
39
- * 2. Fallback Behavior
40
- * When asChild=false, returns a Fragment (structural no-op).
41
- * No DOM element is introduced.
42
- *
43
- * 3. Type Safety
44
- * asChild=true requires exactly one JSXElement child (enforced by type).
45
- * Runtime validates with isElement() check.
46
- */
47
- function Slot(props) {
48
- if (props.asChild) {
49
- const { children, asChild: _asChild, ...rest } = props;
50
- if (isElement(children)) return cloneElement(children, rest);
51
- return null;
52
- }
53
- return {
54
- $$typeof: ELEMENT_TYPE,
55
- type: Fragment,
56
- props: { children: props.children },
57
- key: null
58
- };
59
- }
60
- //#endregion
61
- //#region src/foundations/structures/presence.ts
62
- /**
63
- * Presence
64
- *
65
- * Structural policy primitive for conditional mount/unmount.
66
- * - No timers
67
- * - No animation coupling
68
- * - No DOM side-effects
69
- *
70
- * POLICY DECISIONS (LOCKED):
71
- *
72
- * 1. Present as Function
73
- * Accepts boolean OR function to support lazy evaluation patterns.
74
- * Function is called once per render. Use boolean form for static values.
75
- *
76
- * 2. Children Type
77
- * Presence forwards normal renderable child content only.
78
- * Imperative DOM nodes are not part of the public contract.
79
- *
80
- * 3. Immediate Mount/Unmount
81
- * No exit animations or transitions. When `present` becomes false,
82
- * children are removed immediately. Animation must be layered above
83
- * this primitive.
84
- */
85
- function Presence({ present, children }) {
86
- if (!(typeof present === "function" ? present() : Boolean(present))) return null;
87
- return {
88
- $$typeof: ELEMENT_TYPE,
89
- type: Fragment,
90
- props: { children },
91
- key: null
92
- };
93
- }
94
- //#endregion
95
- //#region src/foundations/structures/collection.ts
96
- function createCollection() {
97
- const registry = /* @__PURE__ */ new Map();
98
- function register(node, metadata) {
99
- const item = {
100
- node,
101
- metadata
102
- };
103
- registry.set(node, item);
104
- return () => {
105
- registry.delete(node);
106
- };
107
- }
108
- function items() {
109
- return Array.from(registry.values());
110
- }
111
- function clear() {
112
- registry.clear();
113
- }
114
- function size() {
115
- return registry.size;
116
- }
117
- return {
118
- register,
119
- items,
120
- clear,
121
- size
122
- };
123
- }
124
- /**
125
- * USAGE EXAMPLE:
126
- *
127
- * // Create a collection for menu items
128
- * const menuItems = createCollection<HTMLElement, { disabled: boolean }>();
129
- *
130
- * // Register items
131
- * const unregister1 = menuItems.register(element1, { disabled: false });
132
- * const unregister2 = menuItems.register(element2, { disabled: true });
133
- *
134
- * // Query items
135
- * const allItems = menuItems.items();
136
- * const enabledItems = allItems.filter(item => !item.metadata.disabled);
137
- *
138
- * // Cleanup
139
- * unregister1();
140
- * unregister2();
141
- */
142
- //#endregion
143
- //#region src/foundations/structures/layer.ts
144
- function createLayer() {
145
- const stack = [];
146
- let nextId = 1;
147
- function register(options) {
148
- const id = nextId++;
149
- const entry = {
150
- id,
151
- options
152
- };
153
- stack.push(entry);
154
- function isTop() {
155
- return stack[stack.length - 1]?.id === id;
156
- }
157
- function unregister() {
158
- const index = stack.findIndex((e) => e.id === id);
159
- if (index !== -1) stack.splice(index, 1);
160
- }
161
- return {
162
- id,
163
- isTop,
164
- unregister
165
- };
166
- }
167
- function layers() {
168
- return stack.map((entry) => ({
169
- id: entry.id,
170
- isTop: () => stack[stack.length - 1]?.id === entry.id,
171
- unregister: () => {
172
- const index = stack.findIndex((e) => e.id === entry.id);
173
- if (index !== -1) stack.splice(index, 1);
174
- }
175
- }));
176
- }
177
- function handleEscape() {
178
- const top = stack[stack.length - 1];
179
- if (top) top.options.onEscape?.();
180
- }
181
- function handleOutsidePointer(e) {
182
- const top = stack[stack.length - 1];
183
- if (!top) return;
184
- const node = top.options.node;
185
- if (node && e.target instanceof Node) {
186
- if (!node.contains(e.target)) top.options.onOutsidePointer?.(e);
187
- } else top.options.onOutsidePointer?.(e);
188
- }
189
- return {
190
- register,
191
- layers,
192
- handleEscape,
193
- handleOutsidePointer
194
- };
195
- }
196
- /**
197
- * USAGE EXAMPLE:
198
- *
199
- * const layerManager = createLayer();
200
- *
201
- * function Modal({ onClose }) {
202
- * const modalRef = ref<HTMLDivElement>();
203
- *
204
- * const layer = layerManager.register({
205
- * node: modalRef.current,
206
- * onEscape: onClose,
207
- * onOutsidePointer: onClose,
208
- * });
209
- *
210
- * onUnmount(() => layer.unregister());
211
- *
212
- * return (
213
- * <div ref={modalRef}>
214
- * <h1>Modal</h1>
215
- * {layer.isTop() && <p>I am on top!</p>}
216
- * </div>
217
- * );
218
- * }
219
- */
220
- //#endregion
221
- export { layout as a, Slot as i, createCollection as n, Presence as r, createLayer as t };