@agent-scope/render 1.20.4 → 1.20.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.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -575,15 +575,21 @@ interface MatrixAxis<T = unknown> {
|
|
|
575
575
|
*/
|
|
576
576
|
interface MatrixRenderer {
|
|
577
577
|
/**
|
|
578
|
-
* Render a single cell given the merged props for
|
|
578
|
+
* Render a single cell given the merged props for this matrix cell.
|
|
579
579
|
*
|
|
580
580
|
* @param props - The combined prop snapshot for this matrix cell.
|
|
581
581
|
* Keys are axis names; values are the axis value for this cell.
|
|
582
582
|
* @param complexityClass - Routing hint (passed through from the descriptor).
|
|
583
|
+
* @param renderMode - Requested render backend. `browser` forces the real DOM
|
|
584
|
+
* Playwright path even when the descriptor is classified
|
|
585
|
+
* as simple; this prevents Satori-style placeholder output
|
|
586
|
+
* for rich components such as datepickers.
|
|
583
587
|
* @returns Resolved RenderResult.
|
|
584
588
|
*/
|
|
585
|
-
renderCell(props: Record<string, unknown>, complexityClass: ComplexityClass): Promise<RenderResult>;
|
|
589
|
+
renderCell(props: Record<string, unknown>, complexityClass: ComplexityClass, renderMode?: RenderMode): Promise<RenderResult>;
|
|
586
590
|
}
|
|
591
|
+
/** Render backend requested by CLI/config callers. */
|
|
592
|
+
type RenderMode = "auto" | "browser";
|
|
587
593
|
/**
|
|
588
594
|
* A single cell in the rendered matrix grid.
|
|
589
595
|
*/
|
|
@@ -663,12 +669,15 @@ declare class RenderMatrix {
|
|
|
663
669
|
private readonly renderer;
|
|
664
670
|
private readonly axes;
|
|
665
671
|
private readonly complexityClass;
|
|
672
|
+
private readonly renderMode;
|
|
666
673
|
/** Maximum number of cells to render in parallel. @default 8 */
|
|
667
674
|
private readonly concurrency;
|
|
668
675
|
constructor(renderer: MatrixRenderer, axes: MatrixAxis[], options?: {
|
|
669
676
|
complexityClass?: ComplexityClass;
|
|
670
677
|
/** Max parallel renders. Default 8. */
|
|
671
678
|
concurrency?: number;
|
|
679
|
+
/** Force a render backend for every matrix cell. Default: auto. */
|
|
680
|
+
renderMode?: RenderMode;
|
|
672
681
|
});
|
|
673
682
|
/** Total number of cells (product of all axis cardinalities). */
|
|
674
683
|
get cellCount(): number;
|
|
@@ -945,4 +954,4 @@ declare function stressAxis(id: StressCategoryId): {
|
|
|
945
954
|
*/
|
|
946
955
|
declare function extractInlineStyles(element: React.ReactNode, path?: string): Record<string, Record<string, string>>;
|
|
947
956
|
|
|
948
|
-
export { ALL_CONTEXTS, ALL_CONTEXT_IDS, ALL_STRESS_IDS, ALL_STRESS_PRESETS, type BoundingBox, BrowserPool, type BrowserPoolConfig, COMPOSITION_CONTEXTS, type CaptureOptions, type CellBounds, type CellCoordinateMap, type CompositionContext, type CompositionContextId, type ContainerOptions, type ContainerType, type CrashedRenderResult, type DOMNode, type EnvironmentOptions, type FontEntry, type HeuristicFlag, type MatrixAxis, type MatrixCell, type MatrixRenderer, type MatrixResult, type MatrixStats, type PageSlot, type PoolPreset, type PoolSizeConfig, RenderError, type RenderErrorFields, RenderMatrix, type RenderOptions, type RenderOutcome, type RenderResult, type RendererConfig, type SatoriRenderOptions, SatoriRenderer, type SourceLocation, SpriteSheetGenerator, type SpriteSheetOptions, type SpriteSheetResult, type StressCategoryId, type StressPreset, type SuccessRenderResult, type ViewportOptions, cartesianProduct, clearFontCache, contextAxis, detectHeuristicFlags, extractInlineStyles, fontCacheSize, getContext, getContexts, getStressPreset, getStressPresets, labelForValue, loadFont, safeRender, stressAxis, wrapWithProviders };
|
|
957
|
+
export { ALL_CONTEXTS, ALL_CONTEXT_IDS, ALL_STRESS_IDS, ALL_STRESS_PRESETS, type BoundingBox, BrowserPool, type BrowserPoolConfig, COMPOSITION_CONTEXTS, type CaptureOptions, type CellBounds, type CellCoordinateMap, type CompositionContext, type CompositionContextId, type ContainerOptions, type ContainerType, type CrashedRenderResult, type DOMNode, type EnvironmentOptions, type FontEntry, type HeuristicFlag, type MatrixAxis, type MatrixCell, type MatrixRenderer, type MatrixResult, type MatrixStats, type PageSlot, type PoolPreset, type PoolSizeConfig, RenderError, type RenderErrorFields, RenderMatrix, type RenderMode, type RenderOptions, type RenderOutcome, type RenderResult, type RendererConfig, type SatoriRenderOptions, SatoriRenderer, type SourceLocation, SpriteSheetGenerator, type SpriteSheetOptions, type SpriteSheetResult, type StressCategoryId, type StressPreset, type SuccessRenderResult, type ViewportOptions, cartesianProduct, clearFontCache, contextAxis, detectHeuristicFlags, extractInlineStyles, fontCacheSize, getContext, getContexts, getStressPreset, getStressPresets, labelForValue, loadFont, safeRender, stressAxis, wrapWithProviders };
|
package/dist/index.d.ts
CHANGED
|
@@ -575,15 +575,21 @@ interface MatrixAxis<T = unknown> {
|
|
|
575
575
|
*/
|
|
576
576
|
interface MatrixRenderer {
|
|
577
577
|
/**
|
|
578
|
-
* Render a single cell given the merged props for
|
|
578
|
+
* Render a single cell given the merged props for this matrix cell.
|
|
579
579
|
*
|
|
580
580
|
* @param props - The combined prop snapshot for this matrix cell.
|
|
581
581
|
* Keys are axis names; values are the axis value for this cell.
|
|
582
582
|
* @param complexityClass - Routing hint (passed through from the descriptor).
|
|
583
|
+
* @param renderMode - Requested render backend. `browser` forces the real DOM
|
|
584
|
+
* Playwright path even when the descriptor is classified
|
|
585
|
+
* as simple; this prevents Satori-style placeholder output
|
|
586
|
+
* for rich components such as datepickers.
|
|
583
587
|
* @returns Resolved RenderResult.
|
|
584
588
|
*/
|
|
585
|
-
renderCell(props: Record<string, unknown>, complexityClass: ComplexityClass): Promise<RenderResult>;
|
|
589
|
+
renderCell(props: Record<string, unknown>, complexityClass: ComplexityClass, renderMode?: RenderMode): Promise<RenderResult>;
|
|
586
590
|
}
|
|
591
|
+
/** Render backend requested by CLI/config callers. */
|
|
592
|
+
type RenderMode = "auto" | "browser";
|
|
587
593
|
/**
|
|
588
594
|
* A single cell in the rendered matrix grid.
|
|
589
595
|
*/
|
|
@@ -663,12 +669,15 @@ declare class RenderMatrix {
|
|
|
663
669
|
private readonly renderer;
|
|
664
670
|
private readonly axes;
|
|
665
671
|
private readonly complexityClass;
|
|
672
|
+
private readonly renderMode;
|
|
666
673
|
/** Maximum number of cells to render in parallel. @default 8 */
|
|
667
674
|
private readonly concurrency;
|
|
668
675
|
constructor(renderer: MatrixRenderer, axes: MatrixAxis[], options?: {
|
|
669
676
|
complexityClass?: ComplexityClass;
|
|
670
677
|
/** Max parallel renders. Default 8. */
|
|
671
678
|
concurrency?: number;
|
|
679
|
+
/** Force a render backend for every matrix cell. Default: auto. */
|
|
680
|
+
renderMode?: RenderMode;
|
|
672
681
|
});
|
|
673
682
|
/** Total number of cells (product of all axis cardinalities). */
|
|
674
683
|
get cellCount(): number;
|
|
@@ -945,4 +954,4 @@ declare function stressAxis(id: StressCategoryId): {
|
|
|
945
954
|
*/
|
|
946
955
|
declare function extractInlineStyles(element: React.ReactNode, path?: string): Record<string, Record<string, string>>;
|
|
947
956
|
|
|
948
|
-
export { ALL_CONTEXTS, ALL_CONTEXT_IDS, ALL_STRESS_IDS, ALL_STRESS_PRESETS, type BoundingBox, BrowserPool, type BrowserPoolConfig, COMPOSITION_CONTEXTS, type CaptureOptions, type CellBounds, type CellCoordinateMap, type CompositionContext, type CompositionContextId, type ContainerOptions, type ContainerType, type CrashedRenderResult, type DOMNode, type EnvironmentOptions, type FontEntry, type HeuristicFlag, type MatrixAxis, type MatrixCell, type MatrixRenderer, type MatrixResult, type MatrixStats, type PageSlot, type PoolPreset, type PoolSizeConfig, RenderError, type RenderErrorFields, RenderMatrix, type RenderOptions, type RenderOutcome, type RenderResult, type RendererConfig, type SatoriRenderOptions, SatoriRenderer, type SourceLocation, SpriteSheetGenerator, type SpriteSheetOptions, type SpriteSheetResult, type StressCategoryId, type StressPreset, type SuccessRenderResult, type ViewportOptions, cartesianProduct, clearFontCache, contextAxis, detectHeuristicFlags, extractInlineStyles, fontCacheSize, getContext, getContexts, getStressPreset, getStressPresets, labelForValue, loadFont, safeRender, stressAxis, wrapWithProviders };
|
|
957
|
+
export { ALL_CONTEXTS, ALL_CONTEXT_IDS, ALL_STRESS_IDS, ALL_STRESS_PRESETS, type BoundingBox, BrowserPool, type BrowserPoolConfig, COMPOSITION_CONTEXTS, type CaptureOptions, type CellBounds, type CellCoordinateMap, type CompositionContext, type CompositionContextId, type ContainerOptions, type ContainerType, type CrashedRenderResult, type DOMNode, type EnvironmentOptions, type FontEntry, type HeuristicFlag, type MatrixAxis, type MatrixCell, type MatrixRenderer, type MatrixResult, type MatrixStats, type PageSlot, type PoolPreset, type PoolSizeConfig, RenderError, type RenderErrorFields, RenderMatrix, type RenderMode, type RenderOptions, type RenderOutcome, type RenderResult, type RendererConfig, type SatoriRenderOptions, SatoriRenderer, type SourceLocation, SpriteSheetGenerator, type SpriteSheetOptions, type SpriteSheetResult, type StressCategoryId, type StressPreset, type SuccessRenderResult, type ViewportOptions, cartesianProduct, clearFontCache, contextAxis, detectHeuristicFlags, extractInlineStyles, fontCacheSize, getContext, getContexts, getStressPreset, getStressPresets, labelForValue, loadFont, safeRender, stressAxis, wrapWithProviders };
|
package/dist/index.js
CHANGED
|
@@ -800,6 +800,7 @@ var RenderMatrix = class {
|
|
|
800
800
|
renderer;
|
|
801
801
|
axes;
|
|
802
802
|
complexityClass;
|
|
803
|
+
renderMode;
|
|
803
804
|
/** Maximum number of cells to render in parallel. @default 8 */
|
|
804
805
|
concurrency;
|
|
805
806
|
constructor(renderer, axes, options = {}) {
|
|
@@ -814,6 +815,7 @@ var RenderMatrix = class {
|
|
|
814
815
|
this.renderer = renderer;
|
|
815
816
|
this.axes = axes;
|
|
816
817
|
this.complexityClass = options.complexityClass ?? "simple";
|
|
818
|
+
this.renderMode = options.renderMode ?? "auto";
|
|
817
819
|
this.concurrency = options.concurrency ?? 8;
|
|
818
820
|
}
|
|
819
821
|
// ---------------------------------------------------------------------------
|
|
@@ -879,7 +881,7 @@ var RenderMatrix = class {
|
|
|
879
881
|
const val = combo[axisIdx];
|
|
880
882
|
axisIndices.push(axis ? axis.values.indexOf(val) : -1);
|
|
881
883
|
}
|
|
882
|
-
const result = await this.renderer.renderCell(props, this.complexityClass);
|
|
884
|
+
const result = await this.renderer.renderCell(props, this.complexityClass, this.renderMode);
|
|
883
885
|
cells[i] = { props, result, index: i, axisIndices };
|
|
884
886
|
}
|
|
885
887
|
};
|