@nexart/ui-renderer 0.7.0 → 0.8.1
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/README.md +138 -319
- package/dist/capabilities.d.ts +5 -7
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +6 -8
- package/dist/compiler.d.ts +3 -3
- package/dist/compiler.js +4 -4
- package/dist/index.d.ts +33 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -30
- package/dist/preview/canvas-scaler.d.ts +70 -0
- package/dist/preview/canvas-scaler.d.ts.map +1 -0
- package/dist/preview/canvas-scaler.js +112 -0
- package/dist/preview/code-renderer.d.ts +11 -28
- package/dist/preview/code-renderer.d.ts.map +1 -1
- package/dist/preview/code-renderer.js +118 -660
- package/dist/preview/frame-budget.d.ts +43 -0
- package/dist/preview/frame-budget.d.ts.map +1 -0
- package/dist/preview/frame-budget.js +78 -0
- package/dist/preview/preview-engine.d.ts +42 -0
- package/dist/preview/preview-engine.d.ts.map +1 -0
- package/dist/preview/preview-engine.js +204 -0
- package/dist/preview/preview-runtime.d.ts +28 -0
- package/dist/preview/preview-runtime.d.ts.map +1 -0
- package/dist/preview/preview-runtime.js +512 -0
- package/dist/preview/preview-types.d.ts +116 -0
- package/dist/preview/preview-types.d.ts.map +1 -0
- package/dist/preview/preview-types.js +36 -0
- package/dist/preview/renderer.d.ts +3 -3
- package/dist/preview/renderer.js +3 -3
- package/dist/preview/unified-renderer.d.ts.map +1 -1
- package/dist/preview/unified-renderer.js +48 -22
- package/dist/system.d.ts +2 -2
- package/dist/system.d.ts.map +1 -1
- package/dist/system.js +8 -10
- package/dist/types.d.ts +9 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -5
- package/package.json +2 -2
package/dist/preview/renderer.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @nexart/ui-renderer v0.
|
|
2
|
+
* @nexart/ui-renderer v0.8.0 - Preview Renderer
|
|
3
3
|
*
|
|
4
4
|
* Renders visual approximations of NexArt systems.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Lightweight preview runtime — NOT canonical, NOT archival.
|
|
6
|
+
* For canonical output: use @nexart/codemode-sdk
|
|
7
7
|
*/
|
|
8
8
|
import { isCodeModeSystem, isUnifiedModeSystem } from '../system';
|
|
9
9
|
import { renderCodeModeSystem } from './code-renderer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-renderer.d.ts","sourceRoot":"","sources":["../../src/preview/unified-renderer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAkB,cAAc,EAAoE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"unified-renderer.d.ts","sourceRoot":"","sources":["../../src/preview/unified-renderer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAkB,cAAc,EAAoE,MAAM,UAAU,CAAC;AAmBhJ,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,KAAK,CAAC;IACnB,UAAU,EAAE,KAAK,CAAC;CACnB;AA6ED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,cAAmB,GAC3B,eAAe,CA0PjB"}
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import { compileBackgroundPreset, getPaletteColors } from '../presets/backgrounds';
|
|
7
7
|
import { compilePrimitive } from '../presets/primitives';
|
|
8
8
|
import { wrapSketch, validateSketchSafety } from '../presets/sketch-wrapper';
|
|
9
|
-
import {
|
|
9
|
+
import { createPreviewRuntime } from './preview-runtime';
|
|
10
|
+
import { calculateScaledDimensions, applyScaledDimensions, reapplyContextScale, clearCanvasIgnoringTransform } from './canvas-scaler';
|
|
11
|
+
import { createFrameBudget, canRenderFrame, recordFrame, resetBudget, shouldSkipFrame } from './frame-budget';
|
|
12
|
+
import { PREVIEW_BUDGET } from './preview-types';
|
|
10
13
|
function validateSketchElement(element) {
|
|
11
14
|
const { safe, warnings } = validateSketchSafety(element.code);
|
|
12
15
|
if (!safe) {
|
|
@@ -78,13 +81,22 @@ function compileSketchElement(element) {
|
|
|
78
81
|
};
|
|
79
82
|
}
|
|
80
83
|
export function renderUnifiedSystem(system, canvas, options = {}) {
|
|
84
|
+
console.log('[UIRenderer] Unified preview → lightweight runtime with budget limits');
|
|
85
|
+
console.log(`[UIRenderer] Budget: max ${PREVIEW_BUDGET.MAX_FRAMES} frames, ${PREVIEW_BUDGET.MAX_TOTAL_TIME_MS}ms`);
|
|
81
86
|
const { showBadge = true, onPreview, onComplete, onError } = options;
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
const scaled = calculateScaledDimensions(system.width, system.height);
|
|
88
|
+
if (scaled.wasScaled) {
|
|
89
|
+
console.log(`[UIRenderer] Canvas scaled: ${system.width}x${system.height} → ${scaled.renderWidth}x${scaled.renderHeight}`);
|
|
90
|
+
}
|
|
91
|
+
applyScaledDimensions(canvas, scaled);
|
|
92
|
+
// NOTE: Canvas resizing resets the 2D context transform.
|
|
93
|
+
// Reapply scale factor once after resize for correct rendering.
|
|
94
|
+
reapplyContextScale(canvas, scaled);
|
|
84
95
|
const ctx = canvas.getContext('2d');
|
|
85
96
|
let animationId = null;
|
|
86
97
|
let isRunning = false;
|
|
87
98
|
let isDestroyed = false;
|
|
99
|
+
const budget = createFrameBudget();
|
|
88
100
|
const palette = inferPalette(system.elements);
|
|
89
101
|
const colors = getPaletteColors(palette);
|
|
90
102
|
const totalFrames = system.loop?.duration ?? 120;
|
|
@@ -124,23 +136,23 @@ export function renderUnifiedSystem(system, canvas, options = {}) {
|
|
|
124
136
|
const drawBadge = () => {
|
|
125
137
|
if (!showBadge)
|
|
126
138
|
return;
|
|
127
|
-
const text = '⚠️ Preview
|
|
128
|
-
ctx.font = '
|
|
139
|
+
const text = '⚠️ Preview';
|
|
140
|
+
ctx.font = '10px -apple-system, sans-serif';
|
|
129
141
|
const metrics = ctx.measureText(text);
|
|
130
|
-
const padding =
|
|
142
|
+
const padding = 6;
|
|
131
143
|
const badgeWidth = metrics.width + padding * 2;
|
|
132
|
-
const badgeHeight =
|
|
133
|
-
const x =
|
|
134
|
-
const y =
|
|
144
|
+
const badgeHeight = 18;
|
|
145
|
+
const x = scaled.renderWidth - badgeWidth - 6;
|
|
146
|
+
const y = 6;
|
|
135
147
|
ctx.fillStyle = 'rgba(255, 100, 100, 0.15)';
|
|
136
148
|
ctx.strokeStyle = 'rgba(255, 100, 100, 0.4)';
|
|
137
149
|
ctx.lineWidth = 1;
|
|
138
150
|
ctx.beginPath();
|
|
139
|
-
ctx.roundRect(x, y, badgeWidth, badgeHeight,
|
|
151
|
+
ctx.roundRect(x, y, badgeWidth, badgeHeight, 3);
|
|
140
152
|
ctx.fill();
|
|
141
153
|
ctx.stroke();
|
|
142
154
|
ctx.fillStyle = '#ff9999';
|
|
143
|
-
ctx.fillText(text, x + padding, y +
|
|
155
|
+
ctx.fillText(text, x + padding, y + 13);
|
|
144
156
|
};
|
|
145
157
|
const executeCode = (p, code, frame, t) => {
|
|
146
158
|
if (!code.trim())
|
|
@@ -212,27 +224,41 @@ export function renderUnifiedSystem(system, canvas, options = {}) {
|
|
|
212
224
|
if (isDestroyed)
|
|
213
225
|
return;
|
|
214
226
|
try {
|
|
215
|
-
let
|
|
216
|
-
const p =
|
|
227
|
+
let frameCount = 0;
|
|
228
|
+
const p = createPreviewRuntime(canvas, scaled.renderWidth, scaled.renderHeight, system.seed);
|
|
217
229
|
runSetup(p);
|
|
230
|
+
resetBudget(budget);
|
|
231
|
+
isRunning = true;
|
|
218
232
|
const loop = () => {
|
|
219
233
|
if (!isRunning || isDestroyed)
|
|
220
234
|
return;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
235
|
+
if (!canRenderFrame(budget)) {
|
|
236
|
+
console.log(`[UIRenderer] Budget exhausted: ${budget.exhaustionReason}`);
|
|
237
|
+
isRunning = false;
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
frameCount++;
|
|
241
|
+
if (!shouldSkipFrame(frameCount)) {
|
|
242
|
+
const t = (frameCount % totalFrames) / totalFrames;
|
|
243
|
+
p.randomSeed(system.seed);
|
|
244
|
+
p.noiseSeed(system.seed);
|
|
245
|
+
try {
|
|
246
|
+
runDraw(p, frameCount, t);
|
|
247
|
+
drawBadge();
|
|
248
|
+
recordFrame(budget);
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
console.warn('[UIRenderer] Draw error:', error);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
227
254
|
animationId = requestAnimationFrame(loop);
|
|
228
255
|
};
|
|
229
|
-
isRunning = true;
|
|
230
256
|
animationId = requestAnimationFrame(loop);
|
|
231
257
|
}
|
|
232
258
|
catch (error) {
|
|
233
259
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
260
|
+
console.warn('[UIRenderer] Loop render error:', err.message);
|
|
234
261
|
onError?.(err);
|
|
235
|
-
throw err;
|
|
236
262
|
}
|
|
237
263
|
};
|
|
238
264
|
const render = () => {
|
|
@@ -256,7 +282,7 @@ export function renderUnifiedSystem(system, canvas, options = {}) {
|
|
|
256
282
|
const destroy = () => {
|
|
257
283
|
isDestroyed = true;
|
|
258
284
|
stop();
|
|
259
|
-
ctx
|
|
285
|
+
clearCanvasIgnoringTransform(ctx, canvas);
|
|
260
286
|
};
|
|
261
287
|
const renderer = {
|
|
262
288
|
render,
|
package/dist/system.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @nexart/ui-renderer v0.
|
|
2
|
+
* @nexart/ui-renderer v0.8.0 - System Creation & Validation
|
|
3
3
|
*
|
|
4
4
|
* Opinionated generative design system with aesthetic guardrails.
|
|
5
5
|
* Supports background, primitive, and sketch element types.
|
|
6
|
-
*
|
|
6
|
+
* Lightweight preview runtime — soft validation, no protocol errors.
|
|
7
7
|
*/
|
|
8
8
|
import type { NexArtSystemInput, NexArtSystem, DeclarativeSystem, NexArtCodeSystem, UnifiedSystem, ValidationResult } from './types';
|
|
9
9
|
export declare function validateSystem(input: NexArtSystemInput): ValidationResult;
|
package/dist/system.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EAEZ,iBAAiB,EAEjB,gBAAgB,EAEhB,aAAa,EAGb,gBAAgB,EAKjB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EAEZ,iBAAiB,EAEjB,gBAAgB,EAEhB,aAAa,EAGb,gBAAgB,EAKjB,MAAM,SAAS,CAAC;AA2UjB,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAiBzE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CA8DnE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,gBAAgB,CAEjF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,aAAa,CAEjF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,iBAAiB,CAErF"}
|
package/dist/system.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @nexart/ui-renderer v0.
|
|
2
|
+
* @nexart/ui-renderer v0.8.0 - System Creation & Validation
|
|
3
3
|
*
|
|
4
4
|
* Opinionated generative design system with aesthetic guardrails.
|
|
5
5
|
* Supports background, primitive, and sketch element types.
|
|
6
|
-
*
|
|
6
|
+
* Lightweight preview runtime — soft validation, no protocol errors.
|
|
7
7
|
*/
|
|
8
|
-
const CURRENT_VERSION = '0.
|
|
8
|
+
const CURRENT_VERSION = '0.8';
|
|
9
9
|
function isCodeSystem(input) {
|
|
10
10
|
return 'type' in input && input.type === 'code';
|
|
11
11
|
}
|
|
@@ -236,25 +236,23 @@ function validateCodeSystem(input) {
|
|
|
236
236
|
if (input.seed !== undefined && typeof input.seed !== 'number') {
|
|
237
237
|
errors.push('seed must be a number');
|
|
238
238
|
}
|
|
239
|
-
// VAR validation
|
|
240
|
-
//
|
|
241
|
-
// - Values must be finite numbers in 0-100 range
|
|
242
|
-
// - Runtime is always 10 elements (padded with zeros)
|
|
239
|
+
// VAR validation (soft - clamping applied at runtime, not errors)
|
|
240
|
+
// Preview renderer is permissive - clamps values instead of rejecting
|
|
243
241
|
if (input.vars !== undefined) {
|
|
244
242
|
if (!Array.isArray(input.vars)) {
|
|
245
243
|
errors.push('vars must be an array');
|
|
246
244
|
}
|
|
247
245
|
else if (input.vars.length > 10) {
|
|
248
|
-
|
|
246
|
+
console.warn(`[UIRenderer] VAR array has ${input.vars.length} elements, will use first 10`);
|
|
249
247
|
}
|
|
250
248
|
else {
|
|
251
249
|
for (let i = 0; i < input.vars.length; i++) {
|
|
252
250
|
const v = input.vars[i];
|
|
253
251
|
if (typeof v !== 'number' || !Number.isFinite(v)) {
|
|
254
|
-
|
|
252
|
+
console.warn(`[UIRenderer] VAR[${i}] is not a valid number, will use 0`);
|
|
255
253
|
}
|
|
256
254
|
else if (v < 0 || v > 100) {
|
|
257
|
-
|
|
255
|
+
console.warn(`[UIRenderer] VAR[${i}] = ${v} is out of 0-100 range, will be clamped`);
|
|
258
256
|
}
|
|
259
257
|
}
|
|
260
258
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @nexart/ui-renderer v0.
|
|
2
|
+
* @nexart/ui-renderer v0.8.1 - Type Definitions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* This SDK is non-canonical and for
|
|
6
|
-
*
|
|
4
|
+
* Lightweight Preview Runtime for NexArt Protocol.
|
|
5
|
+
* This SDK is non-canonical and for preview only.
|
|
6
|
+
*
|
|
7
|
+
* Performance-optimized with budget limits:
|
|
8
|
+
* - Max frames: 30
|
|
9
|
+
* - Max total time: 500ms
|
|
10
|
+
* - Max canvas dimension: 900px
|
|
7
11
|
*/
|
|
8
|
-
export declare const SDK_VERSION = "0.
|
|
12
|
+
export declare const SDK_VERSION = "0.8.1";
|
|
9
13
|
export declare const AESTHETIC_DEFAULTS: {
|
|
10
14
|
readonly background: {
|
|
11
15
|
readonly r: 246;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7E,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MA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1
|
/**
|
|
2
|
-
* @nexart/ui-renderer v0.
|
|
2
|
+
* @nexart/ui-renderer v0.8.1 - Type Definitions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* This SDK is non-canonical and for
|
|
6
|
-
*
|
|
4
|
+
* Lightweight Preview Runtime for NexArt Protocol.
|
|
5
|
+
* This SDK is non-canonical and for preview only.
|
|
6
|
+
*
|
|
7
|
+
* Performance-optimized with budget limits:
|
|
8
|
+
* - Max frames: 30
|
|
9
|
+
* - Max total time: 500ms
|
|
10
|
+
* - Max canvas dimension: 900px
|
|
7
11
|
*/
|
|
8
|
-
export const SDK_VERSION = '0.
|
|
12
|
+
export const SDK_VERSION = '0.8.1';
|
|
9
13
|
export const AESTHETIC_DEFAULTS = {
|
|
10
14
|
background: { r: 246, g: 245, b: 242 },
|
|
11
15
|
foreground: { r: 45, g: 45, b: 45 },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexart/ui-renderer",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"description": "Lightweight Preview Runtime for NexArt Protocol. Non-canonical, performance-optimized with budget limits (max 30 frames, 500ms, 900px canvas).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|