@jay-framework/compiler-jay-html 0.13.0 → 0.14.0
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 +46 -2
- package/dist/index.js +16290 -14340
- package/package.json +10 -10
package/dist/index.d.cts
CHANGED
|
@@ -80,7 +80,7 @@ interface JayImportResolver {
|
|
|
80
80
|
/**
|
|
81
81
|
* Load a contract from a plugin, handling both static and dynamic contracts.
|
|
82
82
|
* For static contracts, loads from the plugin's contract file.
|
|
83
|
-
* For dynamic contracts, loads from materialized location (
|
|
83
|
+
* For dynamic contracts, loads from materialized location (agent-kit/materialized-contracts/).
|
|
84
84
|
*
|
|
85
85
|
* Returns the contract, path, and optional metadata (for dynamic contracts).
|
|
86
86
|
*/
|
|
@@ -195,10 +195,54 @@ interface JayHtmlSourceFile extends CompilerSourceFile {
|
|
|
195
195
|
declare function generateElementDefinitionFile(parsedFile: WithValidations<JayHtmlSourceFile>): WithValidations<string>;
|
|
196
196
|
declare function generateElementFile(jayFile: JayHtmlSourceFile, importerMode: MainRuntimeModes): WithValidations<string>;
|
|
197
197
|
declare function generateElementBridgeFile(jayFile: JayHtmlSourceFile): string;
|
|
198
|
+
declare function generateElementHydrateFile(jayFile: JayHtmlSourceFile, importerMode: MainRuntimeModes): WithValidations<string>;
|
|
199
|
+
interface ServerElementOptions {
|
|
200
|
+
/** Path to write debug coordinate pre-process output. When provided, the
|
|
201
|
+
* serialized DOM with jay-coordinate-base attributes is returned via result. */
|
|
202
|
+
debugCoordinatePreprocessPath?: string;
|
|
203
|
+
}
|
|
204
|
+
declare function generateServerElementFile(jayFile: JayHtmlSourceFile, _options?: ServerElementOptions): WithValidations<string>;
|
|
198
205
|
declare function generateSandboxRootFile(jayFile: JayHtmlSourceFile): string;
|
|
199
206
|
|
|
200
207
|
declare function generateElementFileReactTarget(jayFile: JayHtmlSourceFile, importerMode: MainRuntimeModes): WithValidations<string>;
|
|
201
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Coordinate pre-processing for SSR/hydration consistency.
|
|
211
|
+
*
|
|
212
|
+
* Assigns `jay-coordinate-base` attributes to all elements that need coordinates,
|
|
213
|
+
* in a single pass before either server or hydrate compilation runs.
|
|
214
|
+
* Both compilers read this attribute instead of computing coordinates independently.
|
|
215
|
+
*
|
|
216
|
+
* See Design Log #103, #106.
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
interface AssignCoordinatesOptions {
|
|
220
|
+
/** Set of headless contract names (for detecting <jay:xxx> tags) */
|
|
221
|
+
headlessContractNames: Set<string>;
|
|
222
|
+
/** @internal Auto-generated ref counters for headless instances without explicit refs.
|
|
223
|
+
* Created automatically if not provided. */
|
|
224
|
+
_refCounters?: Map<string, number>;
|
|
225
|
+
}
|
|
226
|
+
interface AssignCoordinatesResult {
|
|
227
|
+
/** Serialized DOM with jay-coordinate-base attributes, for debug output */
|
|
228
|
+
debugHtml: string;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Assign coordinates to a full jay-html string and return the result.
|
|
232
|
+
* Used by the pre-render pipeline so discoverHeadlessInstances gets elements
|
|
233
|
+
* with jay-coordinate-base, matching the hydrate compiler's coordinate format.
|
|
234
|
+
*/
|
|
235
|
+
declare function assignCoordinatesToJayHtml(jayHtml: string, headlessContractNames: Set<string>): string;
|
|
236
|
+
/**
|
|
237
|
+
* Assign `jay-coordinate-base` attributes to elements in the DOM tree.
|
|
238
|
+
*
|
|
239
|
+
* Must run after slow-render (which resolves slow conditions, unrolls slowForEach,
|
|
240
|
+
* and wraps multi-child headless inline templates).
|
|
241
|
+
*
|
|
242
|
+
* Mutates the DOM in place. Returns the serialized DOM for debug output.
|
|
243
|
+
*/
|
|
244
|
+
declare function assignCoordinates(body: HTMLElement, options: AssignCoordinatesOptions): AssignCoordinatesResult;
|
|
245
|
+
|
|
202
246
|
declare function parseJayFile(html: string, filename: string, filePath: string, options: ResolveTsConfigOptions, linkedContractResolver: JayImportResolver, projectRoot: string): Promise<WithValidations<JayHtmlSourceFile>>;
|
|
203
247
|
declare function getJayHtmlImports(html: string): string[];
|
|
204
248
|
|
|
@@ -385,4 +429,4 @@ declare function resolveHeadlessInstances(preRenderedJayHtml: string, instanceDa
|
|
|
385
429
|
*/
|
|
386
430
|
declare function hasSlowPhaseProperties(contract: Contract | undefined): boolean;
|
|
387
431
|
|
|
388
|
-
export { type ActionDefinition, type Contract, type ContractImportInfo, type ContractParam, type ContractProp, type ContractResolver, type ContractTag, ContractTagType, type DiscoveredHeadlessInstance, type EnumToImport, type ForEachHeadlessInstance, type HeadlessContractInfo, type HeadlessInstanceDiscoveryResult, type HeadlessInstanceResolvedData, JAY_IMPORT_RESOLVER, type JayContractImportLink, type JayHtmlSourceFile, type JayImportResolver, type PhaseViewStates, type RenderingPhase, type SlowRenderInput, type SlowRenderOutput, buildInstanceCoordinateKey, compileAction, compileContract, contractToAllPhaseViewStates, contractToImportsViewStateAndRefs, contractToPhaseViewState, createPhaseContract, defaultContractResolver, discoverHeadlessInstances, filterTagsByPhase, generateElementBridgeFile, generateElementDefinitionFile, generateElementFile, generateElementFileReactTarget, generateSandboxRootFile, generateTypes, getEffectivePhase, getJayHtmlImports, getLinkedContractDir, hasSlowPhaseProperties, isTagInPhase, loadLinkedContract, parseAction, parseContract, parseEnumValues, parseIsEnum, parseJayFile, renderRefsType, resolveHeadlessInstances, slowRenderTransform, validateContractPhases };
|
|
432
|
+
export { type ActionDefinition, type AssignCoordinatesOptions, type AssignCoordinatesResult, type Contract, type ContractImportInfo, type ContractParam, type ContractProp, type ContractResolver, type ContractTag, ContractTagType, type DiscoveredHeadlessInstance, type EnumToImport, type ForEachHeadlessInstance, type HeadlessContractInfo, type HeadlessInstanceDiscoveryResult, type HeadlessInstanceResolvedData, JAY_IMPORT_RESOLVER, type JayContractImportLink, type JayHtmlSourceFile, type JayImportResolver, type PhaseViewStates, type RenderingPhase, type ServerElementOptions, type SlowRenderInput, type SlowRenderOutput, assignCoordinates, assignCoordinatesToJayHtml, buildInstanceCoordinateKey, compileAction, compileContract, contractToAllPhaseViewStates, contractToImportsViewStateAndRefs, contractToPhaseViewState, createPhaseContract, defaultContractResolver, discoverHeadlessInstances, filterTagsByPhase, generateElementBridgeFile, generateElementDefinitionFile, generateElementFile, generateElementFileReactTarget, generateElementHydrateFile, generateSandboxRootFile, generateServerElementFile, generateTypes, getEffectivePhase, getJayHtmlImports, getLinkedContractDir, hasSlowPhaseProperties, isTagInPhase, loadLinkedContract, parseAction, parseContract, parseEnumValues, parseIsEnum, parseJayFile, renderRefsType, resolveHeadlessInstances, slowRenderTransform, validateContractPhases };
|