@orieljs/framework 0.1.0-alpha.2 → 0.1.0-alpha.3

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.
@@ -0,0 +1,478 @@
1
+ import {
2
+ ServiceProvider,
3
+ Str,
4
+ facade,
5
+ inject
6
+ } from "./chunk-HU43NADT.js";
7
+ import {
8
+ ConfigRepository,
9
+ Session,
10
+ ViewFactory
11
+ } from "./chunk-S7YC43IH.js";
12
+
13
+ // ../View/dist/chunk-KIU7OKDI.js
14
+ var ELEMENT = /* @__PURE__ */ Symbol.for("oriel:view.element");
15
+ var Fragment = /* @__PURE__ */ Symbol.for("oriel:view.fragment");
16
+ function createElement(type, props, key) {
17
+ return { [ELEMENT]: true, type, props: props ?? {}, key };
18
+ }
19
+ function isElement(value) {
20
+ return typeof value === "object" && value !== null && value[ELEMENT] === true;
21
+ }
22
+ function jsx(type, props, key) {
23
+ return createElement(type, props, key);
24
+ }
25
+ var jsxs = jsx;
26
+
27
+ // ../View/dist/index.js
28
+ import { existsSync } from "fs";
29
+ import { isAbsolute, join, resolve } from "path";
30
+ import { pathToFileURL } from "url";
31
+ var ESCAPES = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#039;" };
32
+ var UNSAFE = /[&<>"']/g;
33
+ var HtmlString = class {
34
+ constructor(html = "") {
35
+ this.html = html;
36
+ }
37
+ html;
38
+ toHtml() {
39
+ return this.html;
40
+ }
41
+ toString() {
42
+ return this.html;
43
+ }
44
+ isEmpty() {
45
+ return this.html === "";
46
+ }
47
+ };
48
+ function raw(html) {
49
+ return new HtmlString(html);
50
+ }
51
+ function isHtmlable(value) {
52
+ return typeof value === "object" && value !== null && typeof value.toHtml === "function";
53
+ }
54
+ function e(value) {
55
+ if (value === null || value === void 0) return "";
56
+ if (isHtmlable(value)) return value.toHtml();
57
+ return String(value).replace(UNSAFE, (char) => ESCAPES[char]);
58
+ }
59
+ var ViewRenderError = class extends Error {
60
+ name = "ViewRenderError";
61
+ kind = "Server";
62
+ status = 500;
63
+ };
64
+ var ViewNotFoundError = class extends Error {
65
+ constructor(view2, searched = []) {
66
+ super(`View [${view2}] not found.`);
67
+ this.view = view2;
68
+ this.searched = searched;
69
+ }
70
+ view;
71
+ searched;
72
+ name = "ViewNotFoundError";
73
+ kind = "Server";
74
+ status = 500;
75
+ };
76
+ var InvalidViewError = class extends Error {
77
+ name = "InvalidViewError";
78
+ kind = "Server";
79
+ status = 500;
80
+ };
81
+ var SKIPPED = /* @__PURE__ */ new Set(["children", "dangerouslySetInnerHTML", "key", "ref"]);
82
+ var RENAMED = { className: "class", htmlFor: "for" };
83
+ var VALID_NAME = /^[^\s"'<>/=\u0000-\u001f\u007f]+$/;
84
+ var UNITLESS = /* @__PURE__ */ new Set([
85
+ "animation-iteration-count",
86
+ "aspect-ratio",
87
+ "border-image-outset",
88
+ "border-image-slice",
89
+ "border-image-width",
90
+ "column-count",
91
+ "columns",
92
+ "fill-opacity",
93
+ "flex",
94
+ "flex-grow",
95
+ "flex-shrink",
96
+ "flex-order",
97
+ "font-weight",
98
+ "grid-area",
99
+ "grid-column",
100
+ "grid-column-end",
101
+ "grid-column-start",
102
+ "grid-row",
103
+ "grid-row-end",
104
+ "grid-row-start",
105
+ "line-clamp",
106
+ "line-height",
107
+ "opacity",
108
+ "order",
109
+ "orphans",
110
+ "scale",
111
+ "stop-opacity",
112
+ "stroke-dashoffset",
113
+ "stroke-opacity",
114
+ "stroke-width",
115
+ "tab-size",
116
+ "widows",
117
+ "z-index",
118
+ "zoom"
119
+ ]);
120
+ function classNames(value) {
121
+ if (value === null || value === void 0 || value === false || value === "") return "";
122
+ if (typeof value === "string" || typeof value === "number") return String(value).trim();
123
+ if (Array.isArray(value)) return value.map(classNames).filter((name) => name !== "").join(" ");
124
+ return Object.entries(value).filter(([, on]) => Boolean(on)).map(([name]) => name).join(" ");
125
+ }
126
+ var kebab = (property) => property.startsWith("--") ? property : property.replace(/^ms([A-Z])/, "-ms-$1").replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
127
+ function styleString(style) {
128
+ const parts = [];
129
+ for (const [property, value] of Object.entries(style)) {
130
+ if (value === null || value === void 0 || value === false || value === "") continue;
131
+ const name = kebab(property);
132
+ const text = typeof value === "number" && value !== 0 && !UNITLESS.has(name) && !name.startsWith("--") ? `${value}px` : String(value);
133
+ parts.push(`${name}:${text}`);
134
+ }
135
+ return parts.join(";");
136
+ }
137
+ function assertValidName(name, what) {
138
+ if (!VALID_NAME.test(name)) throw new ViewRenderError(`Invalid ${what} name [${name}].`);
139
+ }
140
+ function renderAttributes(props) {
141
+ let out = "";
142
+ let classes = "";
143
+ for (const [prop, value] of Object.entries(props)) {
144
+ if (SKIPPED.has(prop)) continue;
145
+ if (value === void 0 || value === null) continue;
146
+ if (typeof value === "function" || typeof value === "symbol") continue;
147
+ const name = RENAMED[prop] ?? prop;
148
+ assertValidName(name, "attribute");
149
+ if (typeof value === "boolean" && (name.startsWith("aria-") || name.startsWith("data-"))) {
150
+ out += ` ${name}="${value}"`;
151
+ continue;
152
+ }
153
+ if (value === false) continue;
154
+ if (name === "class") {
155
+ const joined = classNames(value);
156
+ classes = classes === "" ? joined : joined === "" ? classes : `${classes} ${joined}`;
157
+ continue;
158
+ }
159
+ if (value === true) {
160
+ out += ` ${name}`;
161
+ continue;
162
+ }
163
+ const text = name === "style" && typeof value === "object" ? styleString(value) : attributeText(value);
164
+ out += ` ${name}="${e(text)}"`;
165
+ }
166
+ return classes === "" ? out : ` class="${e(classes)}"${out}`;
167
+ }
168
+ function attributeText(value) {
169
+ if (typeof value !== "object" || value === null) return String(value);
170
+ if (isHtmlable(value)) return value.toHtml();
171
+ if (value instanceof Date) return value.toISOString();
172
+ return JSON.stringify(value);
173
+ }
174
+ var VOID = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "source", "track", "wbr"]);
175
+ var isThenable = (value) => typeof value === "object" && value !== null && typeof value.then === "function";
176
+ var isRenderer = (value) => typeof value.render === "function" && isHtmlable(value);
177
+ async function write(node, sink) {
178
+ if (node === null || node === void 0 || typeof node === "boolean") return;
179
+ if (typeof node === "string") return sink.write(e(node));
180
+ if (typeof node === "number" || typeof node === "bigint") return sink.write(String(node));
181
+ if (isElement(node)) return writeElement(node, sink);
182
+ if (isThenable(node)) {
183
+ sink.flush();
184
+ const resolved = await node;
185
+ return write(resolved, sink);
186
+ }
187
+ if (isRenderer(node)) {
188
+ sink.flush();
189
+ return sink.write(await node.render());
190
+ }
191
+ if (isHtmlable(node)) return sink.write(node.toHtml());
192
+ if (typeof node[Symbol.iterator] === "function") {
193
+ for (const child of node) await write(child, sink);
194
+ return;
195
+ }
196
+ throw new ViewRenderError(`Objects are not valid as a child (found: object with keys {${Object.keys(node).join(", ")}}).`);
197
+ }
198
+ async function writeElement(element, sink) {
199
+ const { type, props } = element;
200
+ if (type === Fragment) return write(props.children, sink);
201
+ if (typeof type === "function") {
202
+ const result = type(props);
203
+ if (isThenable(result)) sink.flush();
204
+ const resolved = await result;
205
+ return write(resolved, sink);
206
+ }
207
+ if (typeof type !== "string") throw new ViewRenderError(`Invalid element type [${String(type)}].`);
208
+ assertValidName(type, "tag");
209
+ const inner = props.dangerouslySetInnerHTML;
210
+ const hasChildren = props.children !== void 0 && props.children !== null;
211
+ if (inner !== void 0 && hasChildren) {
212
+ throw new ViewRenderError(`<${type}> can't have both children and dangerouslySetInnerHTML.`);
213
+ }
214
+ if (type === "html") sink.write("<!DOCTYPE html>");
215
+ sink.write(`<${type}${renderAttributes(props)}>`);
216
+ if (VOID.has(type.toLowerCase())) {
217
+ if (hasChildren || inner !== void 0) throw new ViewRenderError(`<${type}> is a void element and can't have children.`);
218
+ return;
219
+ }
220
+ if (inner !== void 0) sink.write(String(inner.__html ?? ""));
221
+ else await write(props.children, sink);
222
+ sink.write(`</${type}>`);
223
+ }
224
+ async function renderToString(node) {
225
+ const parts = [];
226
+ await write(node, { write: (html) => void parts.push(html), flush: () => {
227
+ } });
228
+ return parts.join("");
229
+ }
230
+ function renderToStream(node) {
231
+ const encoder = new TextEncoder();
232
+ return new ReadableStream({
233
+ async start(controller) {
234
+ let buffer = "";
235
+ const sink = {
236
+ write: (html) => void (buffer += html),
237
+ flush: () => {
238
+ if (buffer === "") return;
239
+ controller.enqueue(encoder.encode(buffer));
240
+ buffer = "";
241
+ }
242
+ };
243
+ try {
244
+ await write(node, sink);
245
+ sink.flush();
246
+ controller.close();
247
+ } catch (error) {
248
+ controller.error(error);
249
+ }
250
+ }
251
+ });
252
+ }
253
+ var HINT = "::";
254
+ var FileViewFinder = class _FileViewFinder {
255
+ constructor(paths, extensions = _FileViewFinder.defaultExtensions) {
256
+ this.extensions = extensions;
257
+ this.locations = paths.map((path) => resolve(path));
258
+ }
259
+ extensions;
260
+ static defaultExtensions = ["tsx", "ts", "jsx", "js", "mjs"];
261
+ locations;
262
+ hints = /* @__PURE__ */ new Map();
263
+ views = /* @__PURE__ */ new Map();
264
+ /** The absolute path of the view file. Throws ViewNotFoundError. */
265
+ find(name) {
266
+ const cached = this.views.get(name);
267
+ if (cached !== void 0) return cached;
268
+ const [locations, view2] = this.parse(name);
269
+ const searched = [];
270
+ for (const location of locations) {
271
+ for (const extension of this.extensions) {
272
+ const file = join(location, `${view2}.${extension}`);
273
+ searched.push(file);
274
+ if (existsSync(file)) {
275
+ this.views.set(name, file);
276
+ return file;
277
+ }
278
+ }
279
+ }
280
+ throw new ViewNotFoundError(name, searched);
281
+ }
282
+ addLocation(path) {
283
+ this.locations.push(resolve(path));
284
+ }
285
+ prependLocation(path) {
286
+ this.locations.unshift(resolve(path));
287
+ }
288
+ /** Views under a namespace: addNamespace('mail', dir) makes 'mail::message' resolve to <dir>/message.tsx. */
289
+ addNamespace(namespace, hints) {
290
+ const existing = this.hints.get(namespace) ?? [];
291
+ this.hints.set(namespace, [...existing, ...[hints].flat().map((path) => resolve(path))]);
292
+ }
293
+ replaceNamespace(namespace, hints) {
294
+ this.hints.set(namespace, [hints].flat().map((path) => resolve(path)));
295
+ this.flush();
296
+ }
297
+ getPaths() {
298
+ return [...this.locations];
299
+ }
300
+ getHints() {
301
+ return Object.fromEntries(this.hints);
302
+ }
303
+ /** Forget cached lookups. */
304
+ flush() {
305
+ this.views.clear();
306
+ }
307
+ /** [locations to search, relative file stem]. Dots become directories, so '..' can't climb out of a location. */
308
+ parse(name) {
309
+ let locations = this.locations;
310
+ let view2 = name;
311
+ const at = name.indexOf(HINT);
312
+ if (at !== -1) {
313
+ const namespace = name.slice(0, at);
314
+ view2 = name.slice(at + HINT.length);
315
+ const hints = this.hints.get(namespace);
316
+ if (hints === void 0) throw new ViewNotFoundError(name);
317
+ locations = hints;
318
+ }
319
+ const stem = view2.replaceAll(".", "/");
320
+ if (view2 === "" || stem.includes("\0") || isAbsolute(stem) || stem.split(/[\\/]/).some((segment) => segment === "")) {
321
+ throw new ViewNotFoundError(name);
322
+ }
323
+ return [locations, stem];
324
+ }
325
+ };
326
+ var TsxView = class {
327
+ constructor(environment, name, path, data = {}) {
328
+ this.environment = environment;
329
+ this.name = name;
330
+ this.path = path;
331
+ this.data = { ...data };
332
+ }
333
+ environment;
334
+ name;
335
+ path;
336
+ data;
337
+ html;
338
+ with(key, value) {
339
+ if (typeof key === "string") this.data[key] = value;
340
+ else Object.assign(this.data, key);
341
+ return this;
342
+ }
343
+ /** The view's own data (Laravel's getData()). */
344
+ getData() {
345
+ return { ...this.data };
346
+ }
347
+ /** Shared data overlaid with the view's data: exactly the props the component receives. */
348
+ gatherData() {
349
+ return { ...this.environment.getShared(), ...this.data };
350
+ }
351
+ async render() {
352
+ await this.environment.callComposer(this);
353
+ const component = await this.environment.load(this.path, this.name);
354
+ this.html = await renderToString(createElement(component, this.gatherData()));
355
+ return this.html;
356
+ }
357
+ toHtml() {
358
+ if (this.html === void 0) {
359
+ throw new ViewRenderError(`View [${this.name}] has not been rendered: await view.render() before toHtml().`);
360
+ }
361
+ return this.html;
362
+ }
363
+ };
364
+ var Factory = class {
365
+ constructor(finder) {
366
+ this.finder = finder;
367
+ }
368
+ finder;
369
+ shared = {};
370
+ composers = [];
371
+ /** Throws ViewNotFoundError ("View [x] not found.") when no file matches. */
372
+ make(name, data = {}) {
373
+ return new TsxView(this, name, this.finder.find(name), data);
374
+ }
375
+ /** The first view that exists (Laravel's View::first()). */
376
+ first(names, data = {}) {
377
+ const name = names.find((candidate) => this.exists(candidate));
378
+ if (name === void 0) throw new ViewNotFoundError(names.join(", "));
379
+ return this.make(name, data);
380
+ }
381
+ exists(name) {
382
+ try {
383
+ this.finder.find(name);
384
+ return true;
385
+ } catch (error) {
386
+ if (error instanceof ViewNotFoundError) return false;
387
+ throw error;
388
+ }
389
+ }
390
+ /** App-wide data every view receives as props (view data wins on conflicts). */
391
+ share(key, value) {
392
+ if (typeof key === "string") this.shared[key] = value;
393
+ else Object.assign(this.shared, key);
394
+ }
395
+ getShared() {
396
+ return { ...this.shared };
397
+ }
398
+ /** Runs before matching views render. Patterns use `*` wildcards: 'posts.*', '*'. */
399
+ composer(views, composer) {
400
+ this.composers.push({ patterns: [views].flat(), composer });
401
+ }
402
+ async callComposer(view2) {
403
+ for (const { patterns, composer } of this.composers) {
404
+ if (patterns.some((pattern) => Str.is(pattern, view2.name))) await composer(view2);
405
+ }
406
+ }
407
+ /** Renders TSX, a string, an Htmlable or a View (or promises of them) to HTML, like Laravel's Blade::render(). */
408
+ renderToString(node) {
409
+ return renderToString(node);
410
+ }
411
+ /** Imports the view file (Node's module cache keeps it) and returns its default-export component. */
412
+ async load(path, name) {
413
+ const module = await import(pathToFileURL(path).href);
414
+ if (typeof module.default !== "function") {
415
+ throw new InvalidViewError(`View [${name}] (${path}) must default-export a component function.`);
416
+ }
417
+ return module.default;
418
+ }
419
+ addLocation(path) {
420
+ this.finder.addLocation(path);
421
+ }
422
+ addNamespace(namespace, hints) {
423
+ this.finder.addNamespace(namespace, hints);
424
+ return this;
425
+ }
426
+ getFinder() {
427
+ return this.finder;
428
+ }
429
+ };
430
+ function view(name, data = {}) {
431
+ const factory = inject(ViewFactory);
432
+ return name === void 0 ? factory : factory.make(name, data);
433
+ }
434
+ function csrfField() {
435
+ return new HtmlString(`<input type="hidden" name="_token" value="${e(inject(Session).token())}" autocomplete="off">`);
436
+ }
437
+ function methodField(method) {
438
+ return new HtmlString(`<input type="hidden" name="_method" value="${e(method.toUpperCase())}">`);
439
+ }
440
+ var View = facade(ViewFactory);
441
+ var ViewServiceProvider = class extends ServiceProvider {
442
+ register() {
443
+ this.mergeConfigFrom({ paths: [this.app.resourcePath("views")] }, "view");
444
+ this.app.singleton(ViewFactory, () => {
445
+ const paths = this.app.make(ConfigRepository).get("view.paths", [this.app.resourcePath("views")]);
446
+ return new Factory(new FileViewFinder(paths));
447
+ });
448
+ }
449
+ };
450
+
451
+ export {
452
+ ELEMENT,
453
+ Fragment,
454
+ createElement,
455
+ isElement,
456
+ jsx,
457
+ jsxs,
458
+ HtmlString,
459
+ raw,
460
+ isHtmlable,
461
+ e,
462
+ ViewRenderError,
463
+ ViewNotFoundError,
464
+ InvalidViewError,
465
+ classNames,
466
+ styleString,
467
+ renderToString,
468
+ renderToStream,
469
+ FileViewFinder,
470
+ TsxView,
471
+ Factory,
472
+ view,
473
+ csrfField,
474
+ methodField,
475
+ View,
476
+ ViewServiceProvider
477
+ };
478
+ //# sourceMappingURL=chunk-WEGTH46M.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../View/Element.ts","../../View/jsx-runtime.ts","../../View/Html.ts","../../View/errors.ts","../../View/attributes.ts","../../View/render.ts","../../View/FileViewFinder.ts","../../View/TsxView.ts","../../View/Factory.ts","../../View/helpers.ts","../../View/facade.ts","../../View/ViewServiceProvider.ts"],"sourcesContent":["import type { Htmlable } from '@orieljs/contracts'\n\n/** Marks the objects jsx() returns (Symbol.for, so two copies of the package agree). */\nexport const ELEMENT: unique symbol = Symbol.for('oriel:view.element')\n\nexport type Props = Record<string, unknown>\n\n/** Anything that can appear as a child: text is escaped, Htmlable is emitted as-is, promises are awaited. */\nexport type Renderable =\n | OrielElement\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | Htmlable\n | Promise<Renderable>\n | Iterable<Renderable>\n\n/** A function component. It may be async: the renderer awaits it. */\nexport type Component<P = Props> = (props: P) => Renderable | Promise<Renderable>\n\n/**\n * `<>…</>` and `<Fragment>`: renders its children only. A symbol at runtime; typed as a component so that\n * `<Fragment>` type-checks as a JSX tag.\n */\nexport const Fragment = Symbol.for('oriel:view.fragment') as unknown as (props: { children?: Renderable }) => Renderable\n\nexport type ElementType = string | Component<never>\n\n/** What `<div />` evaluates to: an inert description, rendered later by renderToString()/renderToStream(). */\nexport interface OrielElement {\n readonly [ELEMENT]: true\n readonly type: ElementType\n readonly props: Props\n readonly key: string | number | undefined\n}\n\nexport function createElement(type: ElementType, props: Props | null | undefined, key?: string | number): OrielElement {\n return { [ELEMENT]: true, type, props: props ?? {}, key }\n}\n\nexport function isElement(value: unknown): value is OrielElement {\n return typeof value === 'object' && value !== null && (value as Record<symbol, unknown>)[ELEMENT] === true\n}\n","/**\n * The automatic JSX runtime (`jsxImportSource: \"@orieljs/view\"`). jsx() only describes elements; rendering\n * (escaping, async components) happens in renderToString()/renderToStream().\n */\nimport type { ClassValue, StyleObject } from './attributes'\nimport { createElement, Fragment, type Component, type ElementType, type OrielElement, type Props, type Renderable } from './Element'\n\nexport { Fragment }\n\nexport function jsx(type: ElementType, props: Props | null, key?: string | number): OrielElement {\n return createElement(type, props, key)\n}\n\n/** Same as jsx(); the compiler uses it when there are several static children. */\nexport const jsxs = jsx\n\n/** Attributes every intrinsic element accepts. Unknown attributes (hx-*, x-*, o:click, …) are allowed. */\nexport interface HtmlAttributes {\n children?: Renderable\n class?: ClassValue\n className?: ClassValue\n style?: string | StyleObject\n dangerouslySetInnerHTML?: { __html: string }\n [attribute: string]: unknown\n}\n\nexport declare namespace JSX {\n type Element = OrielElement\n /** Lets components be async: `async function Posts() { … }` is a valid element type. */\n type ElementType = string | Component<never>\n interface ElementChildrenAttribute {\n children: unknown\n }\n interface IntrinsicAttributes {\n key?: string | number\n }\n interface IntrinsicElements {\n [element: string]: HtmlAttributes\n }\n}\n","import type { Htmlable } from '@orieljs/contracts'\n\nconst ESCAPES: Record<string, string> = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#039;' }\nconst UNSAFE = /[&<>\"']/g\n\n/** Markup that must not be escaped again (Laravel's Illuminate\\Support\\HtmlString). */\nexport class HtmlString implements Htmlable {\n constructor(private readonly html: string = '') {}\n\n toHtml(): string {\n return this.html\n }\n\n toString(): string {\n return this.html\n }\n\n isEmpty(): boolean {\n return this.html === ''\n }\n}\n\n/** Marks trusted markup so the renderer emits it unescaped: {raw(markdownHtml)}. Never pass user input. */\nexport function raw(html: string): HtmlString {\n return new HtmlString(html)\n}\n\nexport function isHtmlable(value: unknown): value is Htmlable {\n return typeof value === 'object' && value !== null && typeof (value as Htmlable).toHtml === 'function'\n}\n\n/** Laravel's e(): htmlspecialchars(ENT_QUOTES, double-encode). Htmlable values pass through; null is ''. */\nexport function e(value: unknown): string {\n if (value === null || value === undefined) return ''\n if (isHtmlable(value)) return value.toHtml()\n return String(value).replace(UNSAFE, (char) => ESCAPES[char]!)\n}\n","import type { ErrorKind, OrielError } from '@orieljs/contracts'\n\n/**\n * Programmer errors (Laravel throws InvalidArgumentException for these). Not an HTTP condition, so kind 'Server':\n * the exception handler reports them and renders a 500 whose message is hidden unless app.debug is on.\n */\nexport class ViewRenderError extends Error implements OrielError {\n override readonly name: string = 'ViewRenderError'\n readonly kind: ErrorKind = 'Server'\n readonly status = 500\n}\n\n/** Laravel's \"View [x] not found.\" (InvalidArgumentException). */\nexport class ViewNotFoundError extends Error implements OrielError {\n override readonly name: string = 'ViewNotFoundError'\n readonly kind: ErrorKind = 'Server'\n readonly status = 500\n constructor(readonly view: string, readonly searched: string[] = []) {\n super(`View [${view}] not found.`)\n }\n}\n\n/** A view file that doesn't default-export a component. */\nexport class InvalidViewError extends Error implements OrielError {\n override readonly name: string = 'InvalidViewError'\n readonly kind: ErrorKind = 'Server'\n readonly status = 500\n}\n","import { e, isHtmlable } from './Html'\nimport { ViewRenderError } from './errors'\n\n/** Props that are never attributes. */\nconst SKIPPED = new Set(['children', 'dangerouslySetInnerHTML', 'key', 'ref'])\n/** React-style prop names that map to a different HTML attribute. */\nconst RENAMED: Record<string, string> = { className: 'class', htmlFor: 'for' }\n/** HTML attribute names: no whitespace, quotes, `<`, `>`, `/`, `=` or control characters (WHATWG). */\nconst VALID_NAME = /^[^\\s\"'<>/=\\u0000-\\u001f\\u007f]+$/\n/** CSS properties whose numbers get no `px` (React's list, trimmed to what HTML pages use). */\nconst UNITLESS = new Set([\n 'animation-iteration-count', 'aspect-ratio', 'border-image-outset', 'border-image-slice', 'border-image-width',\n 'column-count', 'columns', 'fill-opacity', 'flex', 'flex-grow', 'flex-shrink', 'flex-order', 'font-weight',\n 'grid-area', 'grid-column', 'grid-column-end', 'grid-column-start', 'grid-row', 'grid-row-end', 'grid-row-start',\n 'line-clamp', 'line-height', 'opacity', 'order', 'orphans', 'scale', 'stop-opacity', 'stroke-dashoffset',\n 'stroke-opacity', 'stroke-width', 'tab-size', 'widows', 'z-index', 'zoom',\n])\n\nexport type ClassValue = string | number | null | undefined | false | ClassValue[] | Record<string, unknown>\nexport type StyleObject = Record<string, string | number | null | undefined | false>\n\n/** `class` accepts strings, arrays and `{ name: condition }` objects, like Blade's @class. */\nexport function classNames(value: ClassValue): string {\n if (value === null || value === undefined || value === false || value === '') return ''\n if (typeof value === 'string' || typeof value === 'number') return String(value).trim()\n if (Array.isArray(value)) return value.map(classNames).filter((name) => name !== '').join(' ')\n return Object.entries(value).filter(([, on]) => Boolean(on)).map(([name]) => name).join(' ')\n}\n\nconst kebab = (property: string) =>\n property.startsWith('--') ? property : property.replace(/^ms([A-Z])/, '-ms-$1').replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)\n\n/** `{ marginTop: 4, '--gap': '1rem' }` → `margin-top:4px;--gap:1rem`. */\nexport function styleString(style: StyleObject): string {\n const parts: string[] = []\n for (const [property, value] of Object.entries(style)) {\n if (value === null || value === undefined || value === false || value === '') continue\n const name = kebab(property)\n const text = typeof value === 'number' && value !== 0 && !UNITLESS.has(name) && !name.startsWith('--') ? `${value}px` : String(value)\n parts.push(`${name}:${text}`)\n }\n return parts.join(';')\n}\n\nexport function assertValidName(name: string, what: 'attribute' | 'tag'): void {\n if (!VALID_NAME.test(name)) throw new ViewRenderError(`Invalid ${what} name [${name}].`)\n}\n\n/** Serializes props to ` name=\"value\"` pairs. Every value is escaped (HtmlString too); names are validated, never escaped. */\nexport function renderAttributes(props: Record<string, unknown>): string {\n let out = ''\n let classes = ''\n for (const [prop, value] of Object.entries(props)) {\n if (SKIPPED.has(prop)) continue\n if (value === undefined || value === null) continue\n if (typeof value === 'function' || typeof value === 'symbol') continue // event handlers do nothing on the server\n const name = RENAMED[prop] ?? prop\n assertValidName(name, 'attribute')\n // aria-*/data-* are string attributes: booleans are written out, like React.\n if (typeof value === 'boolean' && (name.startsWith('aria-') || name.startsWith('data-'))) {\n out += ` ${name}=\"${value}\"`\n continue\n }\n if (value === false) continue\n if (name === 'class') {\n const joined = classNames(value as ClassValue)\n classes = classes === '' ? joined : joined === '' ? classes : `${classes} ${joined}`\n continue\n }\n // Boolean attributes (disabled, checked, …) are present or absent.\n if (value === true) {\n out += ` ${name}`\n continue\n }\n const text = name === 'style' && typeof value === 'object' ? styleString(value as StyleObject) : attributeText(value)\n out += ` ${name}=\"${e(text)}\"`\n }\n return classes === '' ? out : ` class=\"${e(classes)}\"${out}`\n}\n\n/** Attribute values are text: objects become JSON (x-data, data-*), Htmlable its markup; the caller escapes all of it. */\nfunction attributeText(value: unknown): string {\n if (typeof value !== 'object' || value === null) return String(value)\n if (isHtmlable(value)) return value.toHtml()\n if (value instanceof Date) return value.toISOString()\n return JSON.stringify(value)\n}\n","import { Fragment, isElement, type OrielElement, type Renderable } from './Element'\nimport { e, isHtmlable } from './Html'\nimport { assertValidName, renderAttributes } from './attributes'\nimport { ViewRenderError } from './errors'\n\n/** Elements that never have children or a closing tag. */\nconst VOID = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'source', 'track', 'wbr'])\n\n/** Where rendered HTML goes. flush() is called before every await, so a stream sends what is ready. */\ninterface Sink {\n write(html: string): void\n flush(): void\n}\n\ninterface Renderer {\n render(): Promise<string>\n}\n\nconst isThenable = (value: unknown): value is PromiseLike<unknown> =>\n typeof value === 'object' && value !== null && typeof (value as PromiseLike<unknown>).then === 'function'\n\n/** A View (or anything with an async render() and toHtml()) used as a child, like Blade's @include. */\nconst isRenderer = (value: object): value is Renderer =>\n typeof (value as Partial<Renderer>).render === 'function' && isHtmlable(value)\n\nasync function write(node: Renderable, sink: Sink): Promise<void> {\n if (node === null || node === undefined || typeof node === 'boolean') return\n if (typeof node === 'string') return sink.write(e(node))\n if (typeof node === 'number' || typeof node === 'bigint') return sink.write(String(node))\n if (isElement(node)) return writeElement(node, sink)\n if (isThenable(node)) {\n sink.flush()\n const resolved: unknown = await (node as PromiseLike<unknown>)\n return write(resolved as Renderable, sink)\n }\n if (isRenderer(node)) {\n sink.flush()\n return sink.write(await node.render())\n }\n if (isHtmlable(node)) return sink.write(node.toHtml())\n if (typeof (node as Iterable<Renderable>)[Symbol.iterator] === 'function') {\n for (const child of node as Iterable<Renderable>) await write(child, sink)\n return\n }\n throw new ViewRenderError(`Objects are not valid as a child (found: object with keys {${Object.keys(node).join(', ')}}).`)\n}\n\nasync function writeElement(element: OrielElement, sink: Sink): Promise<void> {\n const { type, props } = element\n if (type === Fragment) return write(props.children as Renderable, sink)\n if (typeof type === 'function') {\n const result = (type as (props: unknown) => unknown)(props)\n if (isThenable(result)) sink.flush()\n const resolved: unknown = await result\n return write(resolved as Renderable, sink)\n }\n if (typeof type !== 'string') throw new ViewRenderError(`Invalid element type [${String(type)}].`)\n assertValidName(type, 'tag')\n\n const inner = props.dangerouslySetInnerHTML as { __html?: unknown } | undefined\n const hasChildren = props.children !== undefined && props.children !== null\n if (inner !== undefined && hasChildren) {\n throw new ViewRenderError(`<${type}> can't have both children and dangerouslySetInnerHTML.`)\n }\n // A document root gets its doctype: TSX has no syntax for <!DOCTYPE html>.\n if (type === 'html') sink.write('<!DOCTYPE html>')\n sink.write(`<${type}${renderAttributes(props)}>`)\n if (VOID.has(type.toLowerCase())) {\n if (hasChildren || inner !== undefined) throw new ViewRenderError(`<${type}> is a void element and can't have children.`)\n return\n }\n if (inner !== undefined) sink.write(String(inner.__html ?? ''))\n else await write(props.children as Renderable, sink)\n sink.write(`</${type}>`)\n}\n\n/** Renders JSX (or any Renderable) to an HTML string. Async components and promises are awaited in order. */\nexport async function renderToString(node: Renderable): Promise<string> {\n const parts: string[] = []\n await write(node, { write: (html) => void parts.push(html), flush: () => {} })\n return parts.join('')\n}\n\n/** Renders to a UTF-8 byte stream, sending everything rendered so far each time rendering waits on a promise. */\nexport function renderToStream(node: Renderable): ReadableStream<Uint8Array> {\n const encoder = new TextEncoder()\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n let buffer = ''\n const sink: Sink = {\n write: (html) => void (buffer += html),\n flush: () => {\n if (buffer === '') return\n controller.enqueue(encoder.encode(buffer))\n buffer = ''\n },\n }\n try {\n await write(node, sink)\n sink.flush()\n controller.close()\n } catch (error) {\n controller.error(error)\n }\n },\n })\n}\n","import { existsSync } from 'node:fs'\nimport { isAbsolute, join, resolve } from 'node:path'\nimport { ViewNotFoundError } from './errors'\n\n/** `mail::message` → namespace `mail`, view `message` (Laravel's hint path delimiter). */\nconst HINT = '::'\n\n/**\n * Laravel's FileViewFinder: 'posts.index' → <location>/posts/index.<ext> for the first location and extension\n * that exist. Found paths are cached; misses are not, so a view created later is found.\n */\nexport class FileViewFinder {\n static readonly defaultExtensions = ['tsx', 'ts', 'jsx', 'js', 'mjs']\n\n private readonly locations: string[]\n private readonly hints = new Map<string, string[]>()\n private readonly views = new Map<string, string>()\n\n constructor(paths: string[], private readonly extensions: string[] = FileViewFinder.defaultExtensions) {\n this.locations = paths.map((path) => resolve(path))\n }\n\n /** The absolute path of the view file. Throws ViewNotFoundError. */\n find(name: string): string {\n const cached = this.views.get(name)\n if (cached !== undefined) return cached\n const [locations, view] = this.parse(name)\n const searched: string[] = []\n for (const location of locations) {\n for (const extension of this.extensions) {\n const file = join(location, `${view}.${extension}`)\n searched.push(file)\n if (existsSync(file)) {\n this.views.set(name, file)\n return file\n }\n }\n }\n throw new ViewNotFoundError(name, searched)\n }\n\n addLocation(path: string): void {\n this.locations.push(resolve(path))\n }\n\n prependLocation(path: string): void {\n this.locations.unshift(resolve(path))\n }\n\n /** Views under a namespace: addNamespace('mail', dir) makes 'mail::message' resolve to <dir>/message.tsx. */\n addNamespace(namespace: string, hints: string | string[]): void {\n const existing = this.hints.get(namespace) ?? []\n this.hints.set(namespace, [...existing, ...[hints].flat().map((path) => resolve(path))])\n }\n\n replaceNamespace(namespace: string, hints: string | string[]): void {\n this.hints.set(namespace, [hints].flat().map((path) => resolve(path)))\n this.flush()\n }\n\n getPaths(): string[] {\n return [...this.locations]\n }\n\n getHints(): Record<string, string[]> {\n return Object.fromEntries(this.hints)\n }\n\n /** Forget cached lookups. */\n flush(): void {\n this.views.clear()\n }\n\n /** [locations to search, relative file stem]. Dots become directories, so '..' can't climb out of a location. */\n private parse(name: string): [string[], string] {\n let locations = this.locations\n let view = name\n const at = name.indexOf(HINT)\n if (at !== -1) {\n const namespace = name.slice(0, at)\n view = name.slice(at + HINT.length)\n const hints = this.hints.get(namespace)\n if (hints === undefined) throw new ViewNotFoundError(name)\n locations = hints\n }\n const stem = view.replaceAll('.', '/')\n if (view === '' || stem.includes('\\0') || isAbsolute(stem) || stem.split(/[\\\\/]/).some((segment) => segment === '')) {\n throw new ViewNotFoundError(name)\n }\n return [locations, stem]\n }\n}\n","import type { View } from '@orieljs/contracts'\nimport { createElement, type Component } from './Element'\nimport { ViewRenderError } from './errors'\nimport { renderToString } from './render'\n\n/** What TsxView needs from its factory. */\nexport interface ViewEnvironment {\n getShared(): Record<string, unknown>\n callComposer(view: View): Promise<void>\n load(path: string, name: string): Promise<Component>\n}\n\n/**\n * One view: its name, file and data. render() runs the composers, imports the file and renders its default\n * export with { ...shared, ...data } as props. toHtml() returns the HTML of the last render().\n */\nexport class TsxView implements View {\n private data: Record<string, unknown>\n private html: string | undefined\n\n constructor(\n private readonly environment: ViewEnvironment,\n readonly name: string,\n readonly path: string,\n data: Record<string, unknown> = {},\n ) {\n this.data = { ...data }\n }\n\n with(key: string | Record<string, unknown>, value?: unknown): this {\n if (typeof key === 'string') this.data[key] = value\n else Object.assign(this.data, key)\n return this\n }\n\n /** The view's own data (Laravel's getData()). */\n getData(): Record<string, unknown> {\n return { ...this.data }\n }\n\n /** Shared data overlaid with the view's data: exactly the props the component receives. */\n gatherData(): Record<string, unknown> {\n return { ...this.environment.getShared(), ...this.data }\n }\n\n async render(): Promise<string> {\n await this.environment.callComposer(this)\n const component = await this.environment.load(this.path, this.name)\n this.html = await renderToString(createElement(component as Component<never>, this.gatherData()))\n return this.html\n }\n\n toHtml(): string {\n if (this.html === undefined) {\n throw new ViewRenderError(`View [${this.name}] has not been rendered: await view.render() before toHtml().`)\n }\n return this.html\n }\n}\n","import { pathToFileURL } from 'node:url'\nimport type { View, ViewFactory } from '@orieljs/contracts'\nimport { Str } from '@orieljs/support'\nimport type { Component, Renderable } from './Element'\nimport { InvalidViewError, ViewNotFoundError } from './errors'\nimport type { FileViewFinder } from './FileViewFinder'\nimport { renderToString } from './render'\nimport { TsxView, type ViewEnvironment } from './TsxView'\n\ntype Composer = (view: View) => void | Promise<void>\n\n/** Laravel's view Factory: finds views by dotted name, shares data app-wide and runs view composers. */\nexport class Factory implements ViewFactory, ViewEnvironment {\n private readonly shared: Record<string, unknown> = {}\n private readonly composers: Array<{ patterns: string[]; composer: Composer }> = []\n\n constructor(private readonly finder: FileViewFinder) {}\n\n /** Throws ViewNotFoundError (\"View [x] not found.\") when no file matches. */\n make(name: string, data: Record<string, unknown> = {}): TsxView {\n return new TsxView(this, name, this.finder.find(name), data)\n }\n\n /** The first view that exists (Laravel's View::first()). */\n first(names: string[], data: Record<string, unknown> = {}): TsxView {\n const name = names.find((candidate) => this.exists(candidate))\n if (name === undefined) throw new ViewNotFoundError(names.join(', '))\n return this.make(name, data)\n }\n\n exists(name: string): boolean {\n try {\n this.finder.find(name)\n return true\n } catch (error) {\n if (error instanceof ViewNotFoundError) return false\n throw error\n }\n }\n\n /** App-wide data every view receives as props (view data wins on conflicts). */\n share(key: string | Record<string, unknown>, value?: unknown): void {\n if (typeof key === 'string') this.shared[key] = value\n else Object.assign(this.shared, key)\n }\n\n getShared(): Record<string, unknown> {\n return { ...this.shared }\n }\n\n /** Runs before matching views render. Patterns use `*` wildcards: 'posts.*', '*'. */\n composer(views: string | string[], composer: Composer): void {\n this.composers.push({ patterns: [views].flat(), composer })\n }\n\n async callComposer(view: View): Promise<void> {\n for (const { patterns, composer } of this.composers) {\n if (patterns.some((pattern) => Str.is(pattern, view.name))) await composer(view)\n }\n }\n\n /** Renders TSX, a string, an Htmlable or a View (or promises of them) to HTML, like Laravel's Blade::render(). */\n renderToString(node: unknown): Promise<string> {\n return renderToString(node as Renderable)\n }\n\n /** Imports the view file (Node's module cache keeps it) and returns its default-export component. */\n async load(path: string, name: string): Promise<Component> {\n const module = (await import(pathToFileURL(path).href)) as { default?: unknown }\n if (typeof module.default !== 'function') {\n throw new InvalidViewError(`View [${name}] (${path}) must default-export a component function.`)\n }\n return module.default as Component\n }\n\n addLocation(path: string): void {\n this.finder.addLocation(path)\n }\n\n addNamespace(namespace: string, hints: string | string[]): this {\n this.finder.addNamespace(namespace, hints)\n return this\n }\n\n getFinder(): FileViewFinder {\n return this.finder\n }\n}\n","import { Session, ViewFactory, type View } from '@orieljs/contracts'\nimport { inject } from '@orieljs/container'\nimport { e, HtmlString } from './Html'\n\n/** view() → the ViewFactory; view('posts.index', data) → a View to return from a route or render. */\nexport function view(): ViewFactory\nexport function view(name: string, data?: Record<string, unknown>): View\nexport function view(name?: string, data: Record<string, unknown> = {}): ViewFactory | View {\n const factory = inject(ViewFactory)\n return name === undefined ? factory : factory.make(name, data)\n}\n\n/** Blade's @csrf / csrf_field(): the hidden _token input for the current request's session. */\nexport function csrfField(): HtmlString {\n return new HtmlString(`<input type=\"hidden\" name=\"_token\" value=\"${e(inject(Session).token())}\" autocomplete=\"off\">`)\n}\n\n/** Blade's @method('PUT') / method_field(): spoofs PUT/PATCH/DELETE from an HTML form. */\nexport function methodField(method: string): HtmlString {\n return new HtmlString(`<input type=\"hidden\" name=\"_method\" value=\"${e(method.toUpperCase())}\">`)\n}\n","import { ViewFactory, type Token } from '@orieljs/contracts'\nimport { facade } from '@orieljs/support'\nimport type { Factory } from './Factory'\n\n/** The View facade: View.make(), View.exists(), View.share(), View.composer(), View.first(), View.addNamespace(). */\nexport const View = facade(ViewFactory as unknown as Token<Factory>)\n","import { ConfigRepository, ViewFactory } from '@orieljs/contracts'\nimport { ServiceProvider } from '@orieljs/support'\nimport { Factory } from './Factory'\nimport { FileViewFinder } from './FileViewFinder'\n\n/** Binds the ViewFactory (resources/views by default) and merges the `view` config, like Laravel's config/view.php. */\nexport class ViewServiceProvider extends ServiceProvider {\n override register(): void {\n this.mergeConfigFrom({ paths: [this.app.resourcePath('views')] }, 'view')\n this.app.singleton(ViewFactory, () => {\n const paths = this.app.make(ConfigRepository).get<string[]>('view.paths', [this.app.resourcePath('views')])\n return new Factory(new FileViewFinder(paths))\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAGO,IAAM,UAAyB,uBAAO,IAAI,oBAAoB;AAwB9D,IAAM,WAAW,uBAAO,IAAI,qBAAqB;AAYjD,SAAS,cAAc,MAAmB,OAAiC,KAAqC;AACrH,SAAO,EAAE,CAAC,OAAO,GAAG,MAAM,MAAM,OAAO,SAAS,CAAC,GAAG,IAAI;AAC1D;AAEO,SA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AAS,YAAwB;AACtC,SAAO,IAAI,WAAW,6CAA6C,EAAE,OAAO,OAAO,EAAE,MAAM,CAAC,CAAC,uBAAuB;AACtH;AAGO,SAAS,YAAY,QAA4B;AACtD,SAAO,IAAI,WAAW,8CAA8C,EAAE,OAAO,YAAY,CAAC,CAAC,IAAI;AACjG;ACfO,IAAM,OAAO,OAAOC,WAAwC;ACC5D,IAAM,sBAAN,cAAkC,gBAAgB;EAC9C,WAAiB;AACxB,SAAK,gBAAgB,EAAE,OAAO,CAAC,KAAK,IAAI,aAAa,OAAO,CAAC,EAAE,GAAG,MAAM;AACxE,SAAK,IAAI,UAAUA,aAAa,MAAM;AACpC,YAAM,QAAQ,KAAK,IAAI,KAAK,gBAAgB,EAAE,IAAc,cAAc,CAAC,KAAK,IAAI,aAAa,OAAO,CAAC,CAAC;AAC1G,aAAO,IAAI,QAAQ,IAAI,eAAe,KAAK,CAAC;IAC9C,CAAC;EACH;AACF;","names":["view","ViewFactory"]}
@@ -334,7 +334,11 @@ type ActionMethods<C> = {
334
334
  }[keyof C] & string;
335
335
  type ControllerAction<C> = readonly [Class<C>, ActionMethods<C>];
336
336
  type RouteClosure = (...args: any[]) => unknown;
337
- type RouteAction = RouteClosure | ControllerAction<any>;
337
+ /** A class with __invoke(): Route.get('/counter', Counter) (single-action controllers, full-page Live components). */
338
+ type InvokableClass = Class<{
339
+ __invoke(...args: any[]): unknown;
340
+ }>;
341
+ type RouteAction = RouteClosure | ControllerAction<any> | InvokableClass;
338
342
  type MiddlewareReference = string | MiddlewareClass;
339
343
  interface Route {
340
344
  readonly methods: readonly string[];
@@ -369,14 +373,14 @@ interface CurrentRoute {
369
373
  }
370
374
  declare const CurrentRoute: Token<CurrentRoute>;
371
375
  interface Router {
372
- get<C>(uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
373
- post<C>(uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
374
- put<C>(uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
375
- patch<C>(uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
376
- delete<C>(uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
377
- options<C>(uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
378
- any<C>(uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
379
- match<C>(methods: string[], uri: string, action: ControllerAction<C> | RouteClosure | string): Route;
376
+ get<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
377
+ post<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
378
+ put<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
379
+ patch<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
380
+ delete<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
381
+ options<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
382
+ any<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
383
+ match<C>(methods: string[], uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
380
384
  redirect(from: string, to: string, status?: number): Route;
381
385
  view(uri: string, view: string, data?: Record<string, unknown>): Route;
382
386
  /** Route.inertia('/about', 'About', props): a GET route that renders an Inertia page (Laravel's Route::inertia). */
@@ -503,6 +507,8 @@ interface ViewFactory {
503
507
  exists(name: string): boolean;
504
508
  share(key: string | Record<string, unknown>, value?: unknown): void;
505
509
  composer(views: string | string[], composer: (view: View) => void | Promise<void>): void;
510
+ /** Renders TSX (an element, a string, an Htmlable, a View, promises of them) to HTML, like Blade::render(). */
511
+ renderToString(node: unknown): Promise<string>;
506
512
  }
507
513
  declare const ViewFactory: Token<ViewFactory>;
508
514
 
@@ -1247,11 +1253,18 @@ interface LiveSnapshot {
1247
1253
  }
1248
1254
  interface LiveEffects {
1249
1255
  html?: string;
1256
+ /** Browser events from this.dispatch(); `self` keeps one on this component, `to` sends it to one component name. */
1250
1257
  dispatches?: Array<{
1251
1258
  name: string;
1252
- params: unknown[];
1259
+ params: Record<string, unknown>;
1260
+ self?: true;
1261
+ to?: string;
1253
1262
  }>;
1263
+ /** Events this component listens to (@On, static listeners); sent with the first render. */
1264
+ listeners?: string[];
1254
1265
  redirect?: string;
1266
+ /** Follow `redirect` with o:navigate instead of a full page load. */
1267
+ redirectUsingNavigate?: true;
1255
1268
  returns?: unknown[];
1256
1269
  }
1257
1270
  interface LiveUpdateRequest {
@@ -1273,12 +1286,17 @@ interface LiveUpdateResponse {
1273
1286
  }
1274
1287
  interface LiveManager {
1275
1288
  register(component: Class<unknown>, name?: string): void;
1276
- /** Server-renders the first HTML (snapshot embedded). */
1277
- mount(component: string | Class<unknown>, params?: Record<string, unknown>): Promise<string>;
1289
+ /** Server-renders the first HTML (snapshot embedded). `key` identifies a child inside its parent (o:key). */
1290
+ mount(component: string | Class<unknown>, params?: Record<string, unknown>, key?: string): Promise<string>;
1278
1291
  /** Checks checksums and CSRF, then applies updates and calls, re-renders and returns new snapshots. */
1279
1292
  update(request: LiveUpdateRequest): Promise<LiveUpdateResponse>;
1293
+ /**
1294
+ * A full-page component (Route.get('/counter', Counter)): mounts `component` (a component instance) with the current route's parameters and
1295
+ * returns the response, its layout view or a redirect.
1296
+ */
1297
+ page(component: object): Promise<unknown>;
1280
1298
  isLiveRequest(request: HttpRequest): boolean;
1281
1299
  }
1282
1300
  declare const LiveManager: Token<LiveManager>;
1283
1301
 
1284
- export { type AbilityCallback, type Abstract, type ActionMethods, type Address, Application, type Arrayable, type Attachment, AuthFactory, type Authenticatable, type AuthenticationError, type Batch, BatchRepository, type BodyInit, BusDispatcher, CacheManager, type CacheRepository, type Class, ClassRegistry, type ClosureCommand, type Command, type CommandContext, type Concrete, type ConfigCallbacks, ConfigRepository, ConsoleKernel, Container, type Content, type ControllerAction, type Cookie, CookieJar, type Credentials, CurrentRoute, type DatabaseConnection, DatabaseManager, type DriverName, Encrypter, type Enumerable, type Envelope, type ErrorKind, EventDispatcher, ExceptionCallbacks, ExceptionHandler, type ExceptionsConfigurator, type Factory, type FailedJob, FailedJobProvider, type Filesystem, FilesystemManager, Gate, type Guard, Hasher, type HeadersInit, type Htmlable, HttpKernel, HttpRequest, InertiaFactory, type InertiaOnceProp, type InertiaPage, type InertiaResponse, type InertiaScrollProp, InertiaSsrGateway, type InertiaSsrResponse, type Job, type Jsonable, type Listener, type ListenerClass, type LiveEffects, LiveManager, type LiveSnapshot, type LiveUpdateRequest, type LiveUpdateResponse, type Lock, type LogLevel, LogManager, type Logger, MailManager, type MailRecipient, type MailTransport, type Mailable, type Mailer, type MessageBag, type Middleware, MiddlewareCallbacks, type MiddlewareClass, type MiddlewareConfigurator, type MiddlewareReference, type ModelInstance, type ModelNotFoundError, type ModelStatic, type MustVerifyEmail, type Next, type Notifiable, type Notification, type NotificationChannel, NotificationDispatcher, type Operator, type OptionValue, type OrielError, type OutgoingMessage, PasswordBroker, type PasswordStatus, type PendingBatch, type PendingBatchOptions, type PendingChain, type PendingMail, type Pipe, type PipeClosure, type PipeNext, type Pipeline, PipelineFactory, type PropCallback, type PutOptions, type QueryBuilder, type Queue, type QueueJob, QueueManager, type QueuePayload, type RedirectResponse, Redirector, type ResourceOptions, type Responsable, ResponseFactory, type Route, type RouteAction, type RouteClosure, type RouteList, RouteModelResolver, type RouteName, type RouteRegistrar, Router, RoutingPaths, type Row, type RuleCallback, type Rules, Schedule, type ScheduledEvent, type SentMessage, type ServiceProvider, type ServiceProviderClass, Session, type SessionHandler, type ShouldQueue, type StatefulGuard, type Token, type UploadedFile, UrlGenerator, type UserProvider, type ValidationError, ValidationFactory, type ValidationRule, type Validator, type View, ViewFactory, token };
1302
+ export { type AbilityCallback, type Abstract, type ActionMethods, type Address, Application, type Arrayable, type Attachment, AuthFactory, type Authenticatable, type AuthenticationError, type Batch, BatchRepository, type BodyInit, BusDispatcher, CacheManager, type CacheRepository, type Class, ClassRegistry, type ClosureCommand, type Command, type CommandContext, type Concrete, type ConfigCallbacks, ConfigRepository, ConsoleKernel, Container, type Content, type ControllerAction, type Cookie, CookieJar, type Credentials, CurrentRoute, type DatabaseConnection, DatabaseManager, type DriverName, Encrypter, type Enumerable, type Envelope, type ErrorKind, EventDispatcher, ExceptionCallbacks, ExceptionHandler, type ExceptionsConfigurator, type Factory, type FailedJob, FailedJobProvider, type Filesystem, FilesystemManager, Gate, type Guard, Hasher, type HeadersInit, type Htmlable, HttpKernel, HttpRequest, InertiaFactory, type InertiaOnceProp, type InertiaPage, type InertiaResponse, type InertiaScrollProp, InertiaSsrGateway, type InertiaSsrResponse, type InvokableClass, type Job, type Jsonable, type Listener, type ListenerClass, type LiveEffects, LiveManager, type LiveSnapshot, type LiveUpdateRequest, type LiveUpdateResponse, type Lock, type LogLevel, LogManager, type Logger, MailManager, type MailRecipient, type MailTransport, type Mailable, type Mailer, type MessageBag, type Middleware, MiddlewareCallbacks, type MiddlewareClass, type MiddlewareConfigurator, type MiddlewareReference, type ModelInstance, type ModelNotFoundError, type ModelStatic, type MustVerifyEmail, type Next, type Notifiable, type Notification, type NotificationChannel, NotificationDispatcher, type Operator, type OptionValue, type OrielError, type OutgoingMessage, PasswordBroker, type PasswordStatus, type PendingBatch, type PendingBatchOptions, type PendingChain, type PendingMail, type Pipe, type PipeClosure, type PipeNext, type Pipeline, PipelineFactory, type PropCallback, type PutOptions, type QueryBuilder, type Queue, type QueueJob, QueueManager, type QueuePayload, type RedirectResponse, Redirector, type ResourceOptions, type Responsable, ResponseFactory, type Route, type RouteAction, type RouteClosure, type RouteList, RouteModelResolver, type RouteName, type RouteRegistrar, Router, RoutingPaths, type Row, type RuleCallback, type Rules, Schedule, type ScheduledEvent, type SentMessage, type ServiceProvider, type ServiceProviderClass, Session, type SessionHandler, type ShouldQueue, type StatefulGuard, type Token, type UploadedFile, UrlGenerator, type UserProvider, type ValidationError, ValidationFactory, type ValidationRule, type Validator, type View, ViewFactory, token };
package/dist/contracts.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  ValidationFactory,
43
43
  ViewFactory,
44
44
  token
45
- } from "./chunk-3ZRPBRAE.js";
45
+ } from "./chunk-S7YC43IH.js";
46
46
  export {
47
47
  Application,
48
48
  AuthFactory,