@jay-framework/compiler-jay-html 0.24.6 → 0.24.7

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { JayType, WithValidations, PluginComponentResolution, PluginManifest, JayEnumType, RefsTree, CompilerSourceFile, SourceFileFormat, JayImportLink, JayHtmlHeadMeta, TemplatePart, GenerateTarget, Imports, MainRuntimeModes, JayObjectType } from '@jay-framework/compiler-shared';
1
+ import { JayType, WithValidations, PluginComponentResolution, PluginManifest, JayEnumType, RefsTree, JayImportLink, CompilerSourceFile, SourceFileFormat, JayHtmlHeadMeta, TemplatePart, GenerateTarget, Imports, MainRuntimeModes, JayObjectType } from '@jay-framework/compiler-shared';
2
2
  import { HTMLElement } from 'node-html-parser';
3
3
  import { ResolveTsConfigOptions } from '@jay-framework/compiler-analyze-exported-types';
4
4
  import { Coordinate } from '@jay-framework/runtime';
@@ -177,6 +177,8 @@ interface JayHeadlessImports {
177
177
  metadata?: Record<string, unknown>;
178
178
  headlessProps?: Record<string, string>;
179
179
  structural?: boolean;
180
+ template?: string;
181
+ suppressedValidations?: string[];
180
182
  }
181
183
  interface JayHtmlHeadLink {
182
184
  rel: string;
@@ -224,7 +226,7 @@ interface JayHtmlSourceFile extends CompilerSourceFile {
224
226
  clientTrackByMap?: Record<string, string>;
225
227
  headMeta?: JayHtmlHeadMeta;
226
228
  /** Per-page validation overrides from <script type="application/jay-validations">. */
227
- validationOverrides?: Record<string, Record<string, boolean>>;
229
+ validationOverrides?: Record<string, Record<string, boolean | string[]>>;
228
230
  scripts?: JayHtmlScript[];
229
231
  }
230
232
 
@@ -232,7 +234,22 @@ declare function parseTemplateParts(value: string): TemplatePart[];
232
234
  declare function parseIsEnum(expression: string): boolean;
233
235
  declare function parseEnumValues(expression: string): string[];
234
236
 
235
- declare function renderRefsType(refs: RefsTree, refsType: string, generateTarget?: GenerateTarget): {
237
+ declare function renderRefsType(refs: RefsTree, refsType: string, generateTarget?: GenerateTarget,
238
+ /**
239
+ * DL#193 Phase 3: when false, skip emitting the component-ref helper `export type` declarations
240
+ * (`XRef<ParentVS>` / `XRefs<ParentVS>`) and emit only the `export interface`. Used when two
241
+ * interfaces (single + repeated) share the same helpers — the helpers are emitted once by the
242
+ * companion call and re-emitting them would be a duplicate-identifier error.
243
+ */
244
+ emitComponentRefHelpers?: boolean,
245
+ /**
246
+ * DL#193 Phase 3: shared set of helper identifiers (`CounterRef`, `CounterRefs`) already emitted
247
+ * elsewhere in the file. When provided, a helper whose identifier is already present is skipped
248
+ * and newly-emitted identifiers are added. This deduplicates the shared helpers across BOTH a
249
+ * single/repeated pair AND across multiple structural instances that embed the same inner
250
+ * component (each would otherwise re-declare `CounterRef` → duplicate-identifier error).
251
+ */
252
+ emittedHelpers?: Set<string>): {
236
253
  imports: Imports;
237
254
  renderedRefs: string;
238
255
  };
@@ -292,21 +309,6 @@ declare function assignCoordinatesToJayHtml(jayHtml: string, headlessContractNam
292
309
  */
293
310
  declare function assignCoordinates(body: HTMLElement, options: AssignCoordinatesOptions): AssignCoordinatesResult;
294
311
 
295
- /**
296
- * Inject headfull full-stack component templates into jay-html.
297
- * Finds <script type="application/jay-headfull" contract="..."> tags,
298
- * reads each component's jay-html file, and injects the body content
299
- * into matching <jay:Name> tags that are empty/self-closing.
300
- *
301
- * This must be called on the raw HTML string BEFORE the slow render pipeline,
302
- * so that instance bindings can be resolved during pre-rendering.
303
- *
304
- * @param html - The raw jay-html content
305
- * @param sourceDir - Absolute path to the directory containing the jay-html file
306
- * @param importResolver - Resolver for reading component jay-html files
307
- * @returns The HTML with headfull FS templates injected (or unchanged if none found)
308
- */
309
- declare function injectHeadfullFSTemplates(html: string, sourceDir: string, importResolver: JayImportResolver): string;
310
312
  declare function parseJayFile(html: string, filename: string, filePath: string, options: ResolveTsConfigOptions, linkedContractResolver: JayImportResolver, projectRoot: string,
311
313
  /** Optional source directory for resolving headfull FS files (jay-html, contracts).
312
314
  * When parsing pre-rendered files, filePath is in build/pre-rendered/ but headfull
@@ -562,6 +564,12 @@ interface DiscoveredHeadlessInstance {
562
564
  * Built from ancestor slowForEach jayTrackBy values + "contractName:localIndex".
563
565
  */
564
566
  coordinate: Coordinate;
567
+ /**
568
+ * Coordinate of the nearest enclosing headless instance (DL#196). A nested instance's
569
+ * prop bindings resolve against this enclosing instance's resolved ViewState rather than
570
+ * the page ViewState. `undefined` for top-level instances (enclosing scope is the page).
571
+ */
572
+ parentCoordinate?: Coordinate;
565
573
  }
566
574
  /**
567
575
  * Resolved data for a headless component instance.
@@ -613,4 +621,4 @@ declare function resolveHeadlessInstances(preRenderedJayHtml: string, instanceDa
613
621
  */
614
622
  declare function hasSlowPhaseProperties(contract: Contract | undefined): boolean;
615
623
 
616
- export { type ActionDefinition, type AssignCoordinatesOptions, type AssignCoordinatesResult, type Contract, type ContractImportInfo, type ContractParam, type ContractParamKind, 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 JayHtmlScript, 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, htmlElementTagNameMap, injectHeadfullFSTemplates, isTagInPhase, loadLinkedContract, parseAction, parseContract, parseEnumValues, parseIsEnum, parseJayFile, parseTemplateParts, renderRefsType, resolveHeadlessInstances, slowRenderTransform, validateContractPhases };
624
+ export { type ActionDefinition, type AssignCoordinatesOptions, type AssignCoordinatesResult, type Contract, type ContractImportInfo, type ContractParam, type ContractParamKind, 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 JayHeadlessImports, type JayHtmlScript, 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, htmlElementTagNameMap, isTagInPhase, loadLinkedContract, parseAction, parseContract, parseEnumValues, parseIsEnum, parseJayFile, parseTemplateParts, renderRefsType, resolveHeadlessInstances, slowRenderTransform, validateContractPhases };