@askrjs/askr 0.0.86 → 0.0.88

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 (69) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/capabilities.json +25 -0
  3. package/dist/actions/index.d.ts +1 -1
  4. package/dist/actions/index.js +1 -1
  5. package/dist/{activity-BvgvaMZA.js → activity-C9naVZwy.js} +3 -2
  6. package/dist/{activity-B1I5HJQI.d.ts → activity-VMb7aJVx.d.ts} +1 -1
  7. package/dist/benchmark.d.ts +1 -1
  8. package/dist/benchmark.js +6 -6
  9. package/dist/boot/index.d.ts +4 -4
  10. package/dist/boot/index.js +1 -1
  11. package/dist/{boot-CViTpUiB.js → boot-BVHzYQz8.js} +11 -10
  12. package/dist/{component-internal-DcrLymUJ.js → component-internal-uVCJAre6.js} +1 -1
  13. package/dist/components/index.d.ts +2 -2
  14. package/dist/control/index.d.ts +1 -1
  15. package/dist/control/index.js +1 -1
  16. package/dist/{control-BjYBlytA.d.ts → control-CsGs2bLS.d.ts} +1 -1
  17. package/dist/{control-oLADku43.js → control-DlwTrXBN.js} +1 -1
  18. package/dist/{control-DhUZU4_V.d.ts → control-x8iehxf7.d.ts} +1 -1
  19. package/dist/{csp-nonce-Bc52OIVc.js → csp-nonce-CUscoNF1.js} +1 -1
  20. package/dist/data/index.d.ts +1 -1
  21. package/dist/data/index.js +3 -3
  22. package/dist/{data-DGrD3-qA.js → data-CXZ-FOa7.js} +5 -2
  23. package/dist/{data-runtime-Ck3tJDDQ.js → data-runtime-CnVeSvJz.js} +6 -4
  24. package/dist/{deferred-nleQtdfY.js → deferred-BCgoep1C.js} +5 -4
  25. package/dist/{for-internal-B_mnQhan.js → for-internal-Be7x2TFd.js} +9 -5
  26. package/dist/foundations/icon/index.d.ts +2 -2
  27. package/dist/foundations/icon/index.js +3 -2
  28. package/dist/foundations/index.d.ts +2 -2
  29. package/dist/foundations/index.js +1 -1
  30. package/dist/foundations/interactions/index.js +1 -1
  31. package/dist/foundations/state/index.d.ts +1 -1
  32. package/dist/foundations/structures/index.d.ts +2 -2
  33. package/dist/foundations/structures/index.js +1 -1
  34. package/dist/{index-r-nt13FE.d.ts → index-BYWsbogt.d.ts} +2 -2
  35. package/dist/{index-DflhL1h8.d.ts → index-DODUjRdZ.d.ts} +3 -3
  36. package/dist/{index-5S-fi2xy.d.ts → index-SGxMZLAc.d.ts} +3 -0
  37. package/dist/{index-pIgGaXvS.d.ts → index-yDjeTqs5.d.ts} +4 -4
  38. package/dist/index.d.ts +6 -6
  39. package/dist/index.js +7 -7
  40. package/dist/{interactions-DgGQyUQv.js → interactions-CWkNEq_C.js} +2 -1
  41. package/dist/{jsx-Dvr2SGRG.d.ts → jsx-BYXe_Nnk.d.ts} +18 -0
  42. package/dist/jsx-dev-runtime.d.ts +3 -3
  43. package/dist/jsx-runtime-BqhMEuT4.d.ts +2 -0
  44. package/dist/{jsx-runtime-Cr1jspx9.d.ts → jsx-runtime-LHh5tcTe.d.ts} +3 -3
  45. package/dist/jsx-runtime.d.ts +2 -2
  46. package/dist/{lifecycle-operations-BrYrBsXY.js → lifecycle-operations-DTO93Hrl.js} +1 -1
  47. package/dist/{navigate-BwAPbpCb.js → navigate-Bz6hh2JB.js} +4 -4
  48. package/dist/{navigate-NyIjQUwI.d.ts → navigate-kJ_EW8Y8.d.ts} +1 -1
  49. package/dist/{query-registry-CPW_6nwF.js → query-registry-p_0kkieE.js} +1 -1
  50. package/dist/{renderer-D9DL9R2D.js → renderer-5bjf5dIf.js} +53 -12
  51. package/dist/{resolution-YHwi4Bav.js → resolution-BRmiFYvw.js} +3 -3
  52. package/dist/{resource-operation-ys6eDoRJ.js → resource-operation-B94oj6xT.js} +1 -1
  53. package/dist/resources/index.d.ts +2 -2
  54. package/dist/resources/index.js +4 -4
  55. package/dist/router/index.d.ts +6 -6
  56. package/dist/router/index.js +17 -16
  57. package/dist/{selector-Ck_Pp9av.js → selector-BLNkRZ2i.js} +2 -1
  58. package/dist/ssg/index.d.ts +2 -2
  59. package/dist/ssg/index.js +3 -3
  60. package/dist/ssr/index.d.ts +4 -4
  61. package/dist/ssr/index.js +1 -1
  62. package/dist/{ssr-B98593qJ.js → ssr-D3hUAWyQ.js} +16 -11
  63. package/dist/{structures-DsOm-clq.js → structures--NKfTh3j.js} +2 -1
  64. package/dist/testing/index.d.ts +18 -4
  65. package/dist/testing/index.js +41 -3
  66. package/dist/{types-C9YcqVpk.d.ts → types-CsPtBGWb.d.ts} +1 -1
  67. package/dist/{verify-hydration-ww1dgwea.js → verify-hydration-Bd1kGLmH.js} +1 -1
  68. package/package.json +12 -10
  69. package/dist/jsx-runtime-C-oIHX9X.d.ts +0 -2
@@ -1,6 +1,6 @@
1
- import { l as ComponentFunction } from "../control-DhUZU4_V.js";
2
- import { M as RouteMatch, W as RouteRegistry, w as RouteAuthOptions } from "../index-pIgGaXvS.js";
3
- import { C as Query, k as QueryStaleReason } from "../index-5S-fi2xy.js";
1
+ import { l as ComponentFunction } from "../control-x8iehxf7.js";
2
+ import { M as RouteMatch, W as RouteRegistry, w as RouteAuthOptions } from "../index-yDjeTqs5.js";
3
+ import { C as Query, k as QueryStaleReason, v as DataRuntime } from "../index-SGxMZLAc.js";
4
4
  //#region src/testing/render.d.ts
5
5
  interface RenderOptions {
6
6
  /**
@@ -34,6 +34,20 @@ declare function mount(component: ComponentFunction, options?: RenderOptions): R
34
34
  declare function renderRoute(options: RouteRenderOptions): Promise<RenderResult>;
35
35
  //#endregion
36
36
  //#region src/testing/index.d.ts
37
+ /** Dispatch the browser click sequence expected by Askr's delegated events. */
38
+ declare function click(element: Element): boolean;
39
+ /** Set a text control's value and emit an input event for each character. */
40
+ declare function type(element: HTMLInputElement | HTMLTextAreaElement, text: string): void;
41
+ /** Dispatch a cancelable bubbling submit event on a form. */
42
+ declare function submit(form: HTMLFormElement): boolean;
43
+ interface QueryTestRegistry {
44
+ readonly runtime: DataRuntime;
45
+ set<T extends {}>(key: string, query: Query<T>): void;
46
+ delete(key: string): void;
47
+ clear(): void;
48
+ }
49
+ /** Create a keyed query fixture registry for a test render runtime. */
50
+ declare function createQueryTestRegistry(): QueryTestRegistry;
37
51
  type MockRefresh = () => void | Promise<void>;
38
52
  interface MockQueryOptions {
39
53
  refresh?: MockRefresh;
@@ -80,4 +94,4 @@ declare function createInvalidationRecorder(): InvalidationRecorder;
80
94
  declare function matchRoute(path: string, options: MatchRouteOptions): RouteMatch | null;
81
95
  declare function getRouteWarnings(options: MatchRouteOptions): RoutePatternWarning[];
82
96
  //#endregion
83
- export { InvalidationRecord, InvalidationRecorder, MockQueryOptions, MockRefresh, type RenderOptions, type RenderResult, RoutePatternWarning, type RouteRenderOptions, cleanup, createInvalidationRecorder, dispatch, flush, getRouteWarnings, matchRoute, mockQuery, mount, queryState, render, renderRoute };
97
+ export { InvalidationRecord, InvalidationRecorder, MockQueryOptions, MockRefresh, QueryTestRegistry, type RenderOptions, type RenderResult, RoutePatternWarning, type RouteRenderOptions, cleanup, click, createInvalidationRecorder, createQueryTestRegistry, dispatch, flush, getRouteWarnings, matchRoute, mockQuery, mount, queryState, render, renderRoute, submit, type };
@@ -1,7 +1,7 @@
1
1
  import { r as flushRuntimeScheduler } from "../access-Dpfoi4cA.js";
2
- import { l as addInvalidationListener } from "../data-runtime-Ck3tJDDQ.js";
2
+ import { l as addInvalidationListener, t as createDataRuntime } from "../data-runtime-CnVeSvJz.js";
3
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";
4
+ import { a as cleanupApp, r as createSPA, t as createIsland } from "../boot-BVHzYQz8.js";
5
5
  //#region src/testing/render.ts
6
6
  const renderStates = /* @__PURE__ */ new WeakMap();
7
7
  const eventConstructorNames = {
@@ -180,6 +180,44 @@ async function renderRoute(options) {
180
180
  }
181
181
  //#endregion
182
182
  //#region src/testing/index.ts
183
+ /** Dispatch the browser click sequence expected by Askr's delegated events. */
184
+ function click(element) {
185
+ if (!element || typeof element.dispatchEvent !== "function") throw new TypeError("@askrjs/askr/testing click requires an Element.");
186
+ return dispatch(element, "click");
187
+ }
188
+ /** Set a text control's value and emit an input event for each character. */
189
+ function type(element, text) {
190
+ if (!element || typeof element.dispatchEvent !== "function") throw new TypeError("@askrjs/askr/testing type requires a text control.");
191
+ for (const character of text) {
192
+ element.value += character;
193
+ dispatch(element, "input", {
194
+ inputType: "insertText",
195
+ data: character
196
+ });
197
+ }
198
+ }
199
+ /** Dispatch a cancelable bubbling submit event on a form. */
200
+ function submit(form) {
201
+ if (!form || typeof form.dispatchEvent !== "function") throw new TypeError("@askrjs/askr/testing submit requires a form.");
202
+ return dispatch(form, "submit");
203
+ }
204
+ /** Create a keyed query fixture registry for a test render runtime. */
205
+ function createQueryTestRegistry() {
206
+ const runtime = createDataRuntime();
207
+ return {
208
+ runtime,
209
+ set(key, query) {
210
+ if (typeof key !== "string" || key.length === 0) throw new TypeError("@askrjs/askr/testing query registry keys must be non-empty strings.");
211
+ runtime.queryTestOverrides.set(key, query);
212
+ },
213
+ delete(key) {
214
+ runtime.queryTestOverrides.delete(key);
215
+ },
216
+ clear() {
217
+ runtime.queryTestOverrides.clear();
218
+ }
219
+ };
220
+ }
183
221
  function normalizeRefresh(options) {
184
222
  return async () => {
185
223
  await options?.refresh?.();
@@ -342,4 +380,4 @@ function getRouteWarnings(options) {
342
380
  });
343
381
  }
344
382
  //#endregion
345
- export { cleanup, createInvalidationRecorder, dispatch, flush, getRouteWarnings, matchRoute, mockQuery, mount, queryState, render, renderRoute };
383
+ export { cleanup, click, createInvalidationRecorder, createQueryTestRegistry, dispatch, flush, getRouteWarnings, matchRoute, mockQuery, mount, queryState, render, renderRoute, submit, type };
@@ -1,4 +1,4 @@
1
- import { o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./jsx-Dvr2SGRG.js";
1
+ import { o as KnownIntrinsicElementProps, r as JSXElement, s as Props } from "./jsx-BYXe_Nnk.js";
2
2
  //#region src/jsx/types.d.ts
3
3
  declare global {
4
4
  namespace JSX {
@@ -1,6 +1,6 @@
1
1
  import { m as withHydrationVerificationRender } from "./render-context-D0Hoj9dW.js";
2
2
  import { t as SSR_RENDER_DATA_ATTR } from "./ssr-DSHd_Q9K.js";
3
- import { a as renderResolvedToStringSync } from "./ssr-B98593qJ.js";
3
+ import { a as renderResolvedToStringSync } from "./ssr-D3hUAWyQ.js";
4
4
  //#region src/ssr/verify-hydration.ts
5
5
  function normalizeHydrationHtml(html) {
6
6
  const template = document.createElement("template");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askrjs/askr",
3
- "version": "0.0.86",
3
+ "version": "0.0.88",
4
4
  "description": "Actor-backed deterministic UI framework",
5
5
  "keywords": [
6
6
  "askr",
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "files": [
26
26
  "capabilities.json",
27
+ "CHANGELOG.md",
27
28
  "dist/**/*.js",
28
29
  "dist/**/*.d.ts"
29
30
  ],
@@ -147,20 +148,21 @@
147
148
  "prepublishOnly": "npm run check"
148
149
  },
149
150
  "dependencies": {
150
- "@askrjs/auth": ">=0.0.1 <0.1.0",
151
- "@askrjs/schema": ">=0.0.1 <0.1.0"
151
+ "@askrjs/auth": ">=0.0.8 <0.1.0",
152
+ "@askrjs/schema": ">=0.0.5 <0.1.0"
152
153
  },
153
154
  "devDependencies": {
154
- "@types/node": "^26.1.1",
155
+ "@types/node": "^26.1.2",
156
+ "@typescript/native": "npm:typescript@^7.0.2",
155
157
  "@vitest/browser-playwright": "4.1.10",
156
158
  "cross-env": "^10.1.0",
157
- "jsdom": "^30.0.0",
158
- "playwright": "^1.61.1",
159
- "publint": "^0.3.21",
159
+ "jsdom": "^30.0.1",
160
+ "playwright": "^1.62.1",
161
+ "publint": "^0.3.23",
160
162
  "tsd": "^0.33.0",
161
- "typescript": "6.0.3",
162
- "vite": "^8.1.4",
163
- "vite-plus": "^0.2.4"
163
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
164
+ "vite": "^8.2.1",
165
+ "vite-plus": "^0.2.8"
164
166
  },
165
167
  "tsd": {
166
168
  "compilerOptions": {
@@ -1,2 +0,0 @@
1
- import "./types-C9YcqVpk.js";
2
- import "./jsx-runtime-Cr1jspx9.js";