@jay-framework/compiler-jay-html 0.15.5 → 0.15.6
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/index.d.cts +29 -9
- package/dist/index.js +1906 -1798
- package/package.json +9 -9
package/dist/index.d.cts
CHANGED
|
@@ -39,6 +39,8 @@ interface ContractParam {
|
|
|
39
39
|
}
|
|
40
40
|
interface Contract {
|
|
41
41
|
name: string;
|
|
42
|
+
/** Human-readable description of the contract (for agent-kit and validation). */
|
|
43
|
+
description?: string;
|
|
42
44
|
tags: Array<ContractTag>;
|
|
43
45
|
props?: Array<ContractProp>;
|
|
44
46
|
/** URL/load params (e.g. slug for [slug] route). Generates Params extends UrlParams. */
|
|
@@ -95,10 +97,16 @@ interface JayImportResolver {
|
|
|
95
97
|
/**
|
|
96
98
|
* Read a jay-html file adjacent to a component module.
|
|
97
99
|
* Given a module src path (e.g., "./header/header"), resolves to the absolute path
|
|
98
|
-
* and reads the corresponding .jay-html file
|
|
99
|
-
*
|
|
100
|
+
* and reads the corresponding .jay-html file. Tries two conventions:
|
|
101
|
+
* 1. File-based: `<src>.jay-html` (e.g., `header/header.jay-html`)
|
|
102
|
+
* 2. Directory-based: `<src>/<basename>.jay-html` (e.g., `header/header/header.jay-html`)
|
|
103
|
+
* Returns the file content and the directory containing the jay-html file, or null if not found.
|
|
100
104
|
*/
|
|
101
|
-
readJayHtml(importingModuleDir: string, src: string):
|
|
105
|
+
readJayHtml(importingModuleDir: string, src: string): {
|
|
106
|
+
content: string;
|
|
107
|
+
componentDir: string;
|
|
108
|
+
filePath: string;
|
|
109
|
+
} | null;
|
|
102
110
|
}
|
|
103
111
|
declare const JAY_IMPORT_RESOLVER: JayImportResolver;
|
|
104
112
|
|
|
@@ -185,6 +193,11 @@ interface JayHtmlSourceFile extends CompilerSourceFile {
|
|
|
185
193
|
* Used by the dev server to watch these files for changes.
|
|
186
194
|
*/
|
|
187
195
|
linkedCssFiles?: string[];
|
|
196
|
+
/**
|
|
197
|
+
* Absolute paths to headfull FS component jay-html files included by this page.
|
|
198
|
+
* Includes nested headfull components. Used by the dev server to watch for changes.
|
|
199
|
+
*/
|
|
200
|
+
linkedComponentFiles?: string[];
|
|
188
201
|
filename?: string;
|
|
189
202
|
contract?: Contract;
|
|
190
203
|
contractRef?: string;
|
|
@@ -229,11 +242,12 @@ declare function generateServerElementFile(jayFile: JayHtmlSourceFile, _options?
|
|
|
229
242
|
/**
|
|
230
243
|
* Coordinate pre-processing for SSR/hydration consistency.
|
|
231
244
|
*
|
|
232
|
-
* Assigns `jay-coordinate-base` attributes to all elements
|
|
233
|
-
* in a single pass before either server or hydrate
|
|
234
|
-
* Both compilers read
|
|
245
|
+
* Assigns `jay-coordinate-base` and `jay-scope` attributes to all elements
|
|
246
|
+
* that need coordinates, in a single pass before either server or hydrate
|
|
247
|
+
* compilation runs. Both compilers read these attributes instead of computing
|
|
248
|
+
* coordinates independently.
|
|
235
249
|
*
|
|
236
|
-
* See Design Log #103, #106.
|
|
250
|
+
* See Design Log #103, #106, #126 (scoped coordinates).
|
|
237
251
|
*/
|
|
238
252
|
|
|
239
253
|
interface AssignCoordinatesOptions {
|
|
@@ -254,7 +268,7 @@ interface AssignCoordinatesResult {
|
|
|
254
268
|
*/
|
|
255
269
|
declare function assignCoordinatesToJayHtml(jayHtml: string, headlessContractNames: Set<string>): string;
|
|
256
270
|
/**
|
|
257
|
-
* Assign `jay-coordinate-base` attributes to elements in the DOM tree.
|
|
271
|
+
* Assign `jay-coordinate-base` and `jay-scope` attributes to elements in the DOM tree.
|
|
258
272
|
*
|
|
259
273
|
* Must run after slow-render (which resolves slow conditions, unrolls slowForEach,
|
|
260
274
|
* and wraps multi-child headless inline templates).
|
|
@@ -278,7 +292,13 @@ declare function assignCoordinates(body: HTMLElement, options: AssignCoordinates
|
|
|
278
292
|
* @returns The HTML with headfull FS templates injected (or unchanged if none found)
|
|
279
293
|
*/
|
|
280
294
|
declare function injectHeadfullFSTemplates(html: string, sourceDir: string, importResolver: JayImportResolver): string;
|
|
281
|
-
declare function parseJayFile(html: string, filename: string, filePath: string, options: ResolveTsConfigOptions, linkedContractResolver: JayImportResolver, projectRoot: string
|
|
295
|
+
declare function parseJayFile(html: string, filename: string, filePath: string, options: ResolveTsConfigOptions, linkedContractResolver: JayImportResolver, projectRoot: string,
|
|
296
|
+
/** Optional source directory for resolving headfull FS files (jay-html, contracts).
|
|
297
|
+
* When parsing pre-rendered files, filePath is in build/pre-rendered/ but headfull
|
|
298
|
+
* relative paths were written for the original source directory. Pass the source
|
|
299
|
+
* directory here so file resolution works correctly while module paths stay relative
|
|
300
|
+
* to the actual filePath. */
|
|
301
|
+
sourceDir?: string): Promise<WithValidations<JayHtmlSourceFile>>;
|
|
282
302
|
declare function getJayHtmlImports(html: string): string[];
|
|
283
303
|
|
|
284
304
|
declare const htmlElementTagNameMap: {
|