@nexart/ui-renderer 0.2.0 → 0.3.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 +78 -4
- package/dist/compiler.d.ts +18 -2
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +25 -11
- package/dist/index.d.ts +19 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -7
- package/dist/presets/backgrounds.d.ts +14 -0
- package/dist/presets/backgrounds.d.ts.map +1 -0
- package/dist/presets/backgrounds.js +222 -0
- package/dist/presets/index.d.ts +7 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +6 -0
- package/dist/presets/primitives.d.ts +16 -0
- package/dist/presets/primitives.d.ts.map +1 -0
- package/dist/presets/primitives.js +282 -0
- package/dist/presets/sketch-wrapper.d.ts +14 -0
- package/dist/presets/sketch-wrapper.d.ts.map +1 -0
- package/dist/presets/sketch-wrapper.js +70 -0
- package/dist/preview/code-renderer.d.ts +25 -0
- package/dist/preview/code-renderer.d.ts.map +1 -0
- package/dist/preview/code-renderer.js +651 -0
- package/dist/preview/primitives/sketch.d.ts +14 -0
- package/dist/preview/primitives/sketch.d.ts.map +1 -0
- package/dist/preview/primitives/sketch.js +407 -0
- package/dist/preview/renderer.d.ts +1 -1
- package/dist/preview/renderer.d.ts.map +1 -1
- package/dist/preview/renderer.js +23 -13
- package/dist/preview/unified-renderer.d.ts +16 -0
- package/dist/preview/unified-renderer.d.ts.map +1 -0
- package/dist/preview/unified-renderer.js +270 -0
- package/dist/system.d.ts +7 -3
- package/dist/system.d.ts.map +1 -1
- package/dist/system.js +187 -11
- package/dist/types.d.ts +125 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -3
- package/package.json +11 -4
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitive Elements - Safe ranges with aesthetic clamping
|
|
3
|
+
* Declarative blocks that compose well and always look tasteful
|
|
4
|
+
* All code uses p5-compatible APIs only (no globalAlpha, etc.)
|
|
5
|
+
*/
|
|
6
|
+
import { AESTHETIC_DEFAULTS } from '../types';
|
|
7
|
+
function clamp(value, min, max) {
|
|
8
|
+
return Math.max(min, Math.min(max, value));
|
|
9
|
+
}
|
|
10
|
+
function resolveStrokeWeight(weight = 'auto') {
|
|
11
|
+
if (typeof weight === 'number') {
|
|
12
|
+
return clamp(weight, AESTHETIC_DEFAULTS.strokeWeight.min, AESTHETIC_DEFAULTS.strokeWeight.max);
|
|
13
|
+
}
|
|
14
|
+
switch (weight) {
|
|
15
|
+
case 'thin': return 0.5;
|
|
16
|
+
case 'thick': return 3;
|
|
17
|
+
case 'medium': return 1.5;
|
|
18
|
+
case 'auto':
|
|
19
|
+
default: return AESTHETIC_DEFAULTS.strokeWeight.default;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function resolveMotionSpeed(speed = 'slow') {
|
|
23
|
+
switch (speed) {
|
|
24
|
+
case 'fast': return 1.5;
|
|
25
|
+
case 'medium': return 1.0;
|
|
26
|
+
case 'slow':
|
|
27
|
+
default: return 0.5;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function resolveCount(count, defaultVal) {
|
|
31
|
+
if (count === undefined)
|
|
32
|
+
return defaultVal;
|
|
33
|
+
return clamp(count, AESTHETIC_DEFAULTS.density.min, AESTHETIC_DEFAULTS.density.max);
|
|
34
|
+
}
|
|
35
|
+
function resolveOpacity(opacity) {
|
|
36
|
+
if (opacity === undefined)
|
|
37
|
+
return 255;
|
|
38
|
+
return Math.round(clamp(opacity, 0.1, 1) * 255);
|
|
39
|
+
}
|
|
40
|
+
export function compilePrimitive(config, foreground = 'rgb(45, 45, 45)') {
|
|
41
|
+
const sw = resolveStrokeWeight(config.strokeWeight);
|
|
42
|
+
const speed = resolveMotionSpeed(config.motion);
|
|
43
|
+
const count = resolveCount(config.count, AESTHETIC_DEFAULTS.density.default);
|
|
44
|
+
const color = config.color || foreground;
|
|
45
|
+
const alpha = resolveOpacity(config.opacity);
|
|
46
|
+
switch (config.name) {
|
|
47
|
+
case 'waves':
|
|
48
|
+
return generateWavesPrimitive(count, sw, speed, color, alpha);
|
|
49
|
+
case 'dots':
|
|
50
|
+
return generateDotsPrimitive(count, color, alpha);
|
|
51
|
+
case 'lines':
|
|
52
|
+
return generateLinesPrimitive(count, sw, speed, color, alpha);
|
|
53
|
+
case 'grid':
|
|
54
|
+
return generateGridPrimitive(count, sw, color, alpha);
|
|
55
|
+
case 'flow':
|
|
56
|
+
return generateFlowPrimitive(count, sw, speed, color, alpha);
|
|
57
|
+
case 'orbits':
|
|
58
|
+
return generateOrbitsPrimitive(count, sw, speed, color, alpha);
|
|
59
|
+
case 'circles':
|
|
60
|
+
return generateCirclesPrimitive(count, sw, speed, color, alpha);
|
|
61
|
+
case 'stripes':
|
|
62
|
+
return generateStripesPrimitive(count, sw, speed, color, alpha);
|
|
63
|
+
default:
|
|
64
|
+
return generateWavesPrimitive(count, sw, speed, color, alpha);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function generateWavesPrimitive(count, sw, speed, color, alpha) {
|
|
68
|
+
return `
|
|
69
|
+
push();
|
|
70
|
+
noFill();
|
|
71
|
+
strokeWeight(${sw});
|
|
72
|
+
stroke(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
73
|
+
|
|
74
|
+
const margin = width * 0.08;
|
|
75
|
+
const spacing = (height - margin * 2) / ${count};
|
|
76
|
+
|
|
77
|
+
for (let i = 0; i < ${count}; i++) {
|
|
78
|
+
const y = margin + i * spacing;
|
|
79
|
+
const phase = i * 0.3 + t * TWO_PI * ${speed};
|
|
80
|
+
const amp = 12 + i * 4;
|
|
81
|
+
|
|
82
|
+
beginShape();
|
|
83
|
+
for (let x = margin; x <= width - margin; x += 3) {
|
|
84
|
+
const nx = (x - margin) / (width - margin * 2);
|
|
85
|
+
const wave = sin(nx * PI * 3 + phase) * amp;
|
|
86
|
+
const easeEdge = sin(nx * PI);
|
|
87
|
+
vertex(x, y + wave * easeEdge);
|
|
88
|
+
}
|
|
89
|
+
endShape();
|
|
90
|
+
}
|
|
91
|
+
pop();
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
function generateDotsPrimitive(count, color, alpha) {
|
|
95
|
+
return `
|
|
96
|
+
push();
|
|
97
|
+
noStroke();
|
|
98
|
+
fill(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
99
|
+
|
|
100
|
+
const margin = width * 0.1;
|
|
101
|
+
const cols = ${Math.ceil(Math.sqrt(count * 1.5))};
|
|
102
|
+
const rows = ${Math.ceil(count / Math.ceil(Math.sqrt(count * 1.5)))};
|
|
103
|
+
const spacing = min((width - margin * 2) / cols, (height - margin * 2) / rows);
|
|
104
|
+
|
|
105
|
+
for (let i = 0; i < cols; i++) {
|
|
106
|
+
for (let j = 0; j < rows; j++) {
|
|
107
|
+
const x = margin + i * spacing + spacing / 2;
|
|
108
|
+
const y = margin + j * spacing + spacing / 2;
|
|
109
|
+
|
|
110
|
+
const n = noise(i * 0.2, j * 0.2, t * 2);
|
|
111
|
+
const offsetX = (n - 0.5) * spacing * 0.4;
|
|
112
|
+
const offsetY = (noise(i * 0.2 + 50, j * 0.2, t * 2) - 0.5) * spacing * 0.4;
|
|
113
|
+
const size = 3 + n * 5;
|
|
114
|
+
|
|
115
|
+
ellipse(x + offsetX, y + offsetY, size);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
pop();
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
function generateLinesPrimitive(count, sw, speed, color, alpha) {
|
|
122
|
+
return `
|
|
123
|
+
push();
|
|
124
|
+
noFill();
|
|
125
|
+
strokeWeight(${sw});
|
|
126
|
+
stroke(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
127
|
+
|
|
128
|
+
const margin = width * 0.1;
|
|
129
|
+
const spacing = (width - margin * 2) / ${count};
|
|
130
|
+
|
|
131
|
+
for (let i = 0; i < ${count}; i++) {
|
|
132
|
+
const x = margin + i * spacing;
|
|
133
|
+
const phase = i * 0.15 + t * TWO_PI * ${speed};
|
|
134
|
+
|
|
135
|
+
beginShape();
|
|
136
|
+
for (let y = margin; y <= height - margin; y += 4) {
|
|
137
|
+
const ny = (y - margin) / (height - margin * 2);
|
|
138
|
+
const wave = sin(ny * PI * 2 + phase) * 12;
|
|
139
|
+
const ease = sin(ny * PI);
|
|
140
|
+
vertex(x + wave * ease, y);
|
|
141
|
+
}
|
|
142
|
+
endShape();
|
|
143
|
+
}
|
|
144
|
+
pop();
|
|
145
|
+
`;
|
|
146
|
+
}
|
|
147
|
+
function generateGridPrimitive(count, sw, color, alpha) {
|
|
148
|
+
const gridSize = Math.ceil(Math.sqrt(count));
|
|
149
|
+
return `
|
|
150
|
+
push();
|
|
151
|
+
rectMode(CENTER);
|
|
152
|
+
noFill();
|
|
153
|
+
strokeWeight(${sw});
|
|
154
|
+
stroke(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
155
|
+
|
|
156
|
+
const margin = width * 0.12;
|
|
157
|
+
const cols = ${gridSize};
|
|
158
|
+
const rows = ${gridSize};
|
|
159
|
+
const cellW = (width - margin * 2) / cols;
|
|
160
|
+
const cellH = (height - margin * 2) / rows;
|
|
161
|
+
const baseSize = min(cellW, cellH) * 0.5;
|
|
162
|
+
|
|
163
|
+
for (let i = 0; i < cols; i++) {
|
|
164
|
+
for (let j = 0; j < rows; j++) {
|
|
165
|
+
const x = margin + i * cellW + cellW / 2;
|
|
166
|
+
const y = margin + j * cellH + cellH / 2;
|
|
167
|
+
|
|
168
|
+
const n = noise(i * 0.3, j * 0.3, t * 1.5);
|
|
169
|
+
const size = baseSize * (0.4 + n * 0.6);
|
|
170
|
+
const rotation = n * PI * 0.2;
|
|
171
|
+
|
|
172
|
+
push();
|
|
173
|
+
translate(x, y);
|
|
174
|
+
rotate(rotation);
|
|
175
|
+
rect(0, 0, size, size);
|
|
176
|
+
pop();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
pop();
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
function generateFlowPrimitive(count, sw, speed, color, alpha) {
|
|
183
|
+
return `
|
|
184
|
+
push();
|
|
185
|
+
noFill();
|
|
186
|
+
strokeWeight(${sw});
|
|
187
|
+
stroke(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
188
|
+
|
|
189
|
+
const margin = width * 0.1;
|
|
190
|
+
const particleCount = ${count * 8};
|
|
191
|
+
const lineLength = 50;
|
|
192
|
+
|
|
193
|
+
for (let i = 0; i < particleCount; i++) {
|
|
194
|
+
const startX = margin + random() * (width - margin * 2);
|
|
195
|
+
const startY = margin + random() * (height - margin * 2);
|
|
196
|
+
|
|
197
|
+
beginShape();
|
|
198
|
+
let px = startX;
|
|
199
|
+
let py = startY;
|
|
200
|
+
|
|
201
|
+
for (let s = 0; s < lineLength; s++) {
|
|
202
|
+
const angle = noise(px * 0.005, py * 0.005, t * ${speed}) * TWO_PI * 2;
|
|
203
|
+
vertex(px, py);
|
|
204
|
+
px += cos(angle) * 2;
|
|
205
|
+
py += sin(angle) * 2;
|
|
206
|
+
|
|
207
|
+
if (px < margin || px > width - margin || py < margin || py > height - margin) break;
|
|
208
|
+
}
|
|
209
|
+
endShape();
|
|
210
|
+
}
|
|
211
|
+
pop();
|
|
212
|
+
`;
|
|
213
|
+
}
|
|
214
|
+
function generateOrbitsPrimitive(count, sw, speed, color, alpha) {
|
|
215
|
+
return `
|
|
216
|
+
push();
|
|
217
|
+
noFill();
|
|
218
|
+
strokeWeight(${sw});
|
|
219
|
+
stroke(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
220
|
+
|
|
221
|
+
const cx = width / 2;
|
|
222
|
+
const cy = height / 2;
|
|
223
|
+
const maxRadius = min(width, height) * 0.4;
|
|
224
|
+
|
|
225
|
+
for (let i = 0; i < ${count}; i++) {
|
|
226
|
+
const radius = maxRadius * (0.25 + i * ${0.75 / count});
|
|
227
|
+
const rotation = t * TWO_PI * ${speed} * (i % 2 === 0 ? 1 : -1);
|
|
228
|
+
|
|
229
|
+
beginShape();
|
|
230
|
+
for (let a = 0; a <= TWO_PI; a += 0.05) {
|
|
231
|
+
const wobble = sin(a * 4 + t * TWO_PI + i) * 6;
|
|
232
|
+
const r = radius + wobble;
|
|
233
|
+
const x = cx + cos(a + rotation) * r;
|
|
234
|
+
const y = cy + sin(a + rotation) * r;
|
|
235
|
+
vertex(x, y);
|
|
236
|
+
}
|
|
237
|
+
endShape(CLOSE);
|
|
238
|
+
}
|
|
239
|
+
pop();
|
|
240
|
+
`;
|
|
241
|
+
}
|
|
242
|
+
function generateCirclesPrimitive(count, sw, speed, color, alpha) {
|
|
243
|
+
return `
|
|
244
|
+
push();
|
|
245
|
+
noFill();
|
|
246
|
+
strokeWeight(${sw});
|
|
247
|
+
stroke(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
248
|
+
|
|
249
|
+
const cx = width / 2;
|
|
250
|
+
const cy = height / 2;
|
|
251
|
+
const maxRadius = min(width, height) * 0.4;
|
|
252
|
+
|
|
253
|
+
for (let i = 0; i < ${count}; i++) {
|
|
254
|
+
const baseRadius = maxRadius * (0.2 + i * ${0.8 / count});
|
|
255
|
+
const pulseOffset = i * 0.3;
|
|
256
|
+
const pulse = sin(t * TWO_PI * ${speed} + pulseOffset) * 10;
|
|
257
|
+
|
|
258
|
+
ellipse(cx, cy, (baseRadius + pulse) * 2);
|
|
259
|
+
}
|
|
260
|
+
pop();
|
|
261
|
+
`;
|
|
262
|
+
}
|
|
263
|
+
function generateStripesPrimitive(count, sw, speed, color, alpha) {
|
|
264
|
+
return `
|
|
265
|
+
push();
|
|
266
|
+
noFill();
|
|
267
|
+
strokeWeight(${sw});
|
|
268
|
+
stroke(red('${color}'), green('${color}'), blue('${color}'), ${alpha});
|
|
269
|
+
|
|
270
|
+
const margin = width * 0.08;
|
|
271
|
+
const spacing = (height - margin * 2) / ${count};
|
|
272
|
+
|
|
273
|
+
for (let i = 0; i < ${count}; i++) {
|
|
274
|
+
const y = margin + i * spacing;
|
|
275
|
+
const wavePhase = i * 0.2 + t * TWO_PI * ${speed};
|
|
276
|
+
const wave = sin(wavePhase) * 8;
|
|
277
|
+
|
|
278
|
+
line(margin, y + wave, width - margin, y + wave);
|
|
279
|
+
}
|
|
280
|
+
pop();
|
|
281
|
+
`;
|
|
282
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sketch Wrapper - Safety normalization for raw Code Mode sketches
|
|
3
|
+
* Wraps user-provided code with aesthetic defaults and safety measures
|
|
4
|
+
*/
|
|
5
|
+
export interface SketchWrapperConfig {
|
|
6
|
+
code: string;
|
|
7
|
+
normalize?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function wrapSketch(config: SketchWrapperConfig): string;
|
|
10
|
+
export declare function validateSketchSafety(code: string): {
|
|
11
|
+
safe: boolean;
|
|
12
|
+
warnings: string[];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=sketch-wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sketch-wrapper.d.ts","sourceRoot":"","sources":["../../src/presets/sketch-wrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAqB9D;AAoCD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA8BxF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sketch Wrapper - Safety normalization for raw Code Mode sketches
|
|
3
|
+
* Wraps user-provided code with aesthetic defaults and safety measures
|
|
4
|
+
*/
|
|
5
|
+
import { AESTHETIC_DEFAULTS } from '../types';
|
|
6
|
+
export function wrapSketch(config) {
|
|
7
|
+
const { code, normalize = true } = config;
|
|
8
|
+
if (!normalize) {
|
|
9
|
+
return code;
|
|
10
|
+
}
|
|
11
|
+
const bgColor = `rgb(${AESTHETIC_DEFAULTS.background.r}, ${AESTHETIC_DEFAULTS.background.g}, ${AESTHETIC_DEFAULTS.background.b})`;
|
|
12
|
+
const hasSetup = /function\s+setup\s*\(/.test(code);
|
|
13
|
+
const hasDraw = /function\s+draw\s*\(/.test(code);
|
|
14
|
+
if (hasSetup && hasDraw) {
|
|
15
|
+
return injectNormalizationIntoExistingCode(code, bgColor);
|
|
16
|
+
}
|
|
17
|
+
if (!hasSetup && !hasDraw) {
|
|
18
|
+
return wrapBareCode(code, bgColor);
|
|
19
|
+
}
|
|
20
|
+
return code;
|
|
21
|
+
}
|
|
22
|
+
function injectNormalizationIntoExistingCode(code, bgColor) {
|
|
23
|
+
let modified = code;
|
|
24
|
+
if (!/strokeWeight\s*\(/.test(code)) {
|
|
25
|
+
modified = modified.replace(/function\s+setup\s*\(\s*\)\s*\{/, `function setup() {\n strokeWeight(${AESTHETIC_DEFAULTS.strokeWeight.default});`);
|
|
26
|
+
}
|
|
27
|
+
if (!/background\s*\(/.test(code)) {
|
|
28
|
+
modified = modified.replace(/function\s+draw\s*\(\s*\)\s*\{/, `function draw() {\n background('${bgColor}');`);
|
|
29
|
+
}
|
|
30
|
+
return modified;
|
|
31
|
+
}
|
|
32
|
+
function wrapBareCode(code, bgColor) {
|
|
33
|
+
return `
|
|
34
|
+
function setup() {
|
|
35
|
+
strokeWeight(${AESTHETIC_DEFAULTS.strokeWeight.default});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function draw() {
|
|
39
|
+
background('${bgColor}');
|
|
40
|
+
|
|
41
|
+
${code}
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
export function validateSketchSafety(code) {
|
|
46
|
+
const warnings = [];
|
|
47
|
+
const dangerousPatterns = [
|
|
48
|
+
{ pattern: /eval\s*\(/, message: 'eval() is not allowed' },
|
|
49
|
+
{ pattern: /Function\s*\(/, message: 'Function constructor is not allowed' },
|
|
50
|
+
{ pattern: /document\s*\./, message: 'Direct DOM access is not allowed' },
|
|
51
|
+
{ pattern: /window\s*\./, message: 'Window access is not allowed' },
|
|
52
|
+
{ pattern: /import\s*\(/, message: 'Dynamic imports are not allowed' },
|
|
53
|
+
{ pattern: /require\s*\(/, message: 'require() is not allowed' },
|
|
54
|
+
];
|
|
55
|
+
for (const { pattern, message } of dangerousPatterns) {
|
|
56
|
+
if (pattern.test(code)) {
|
|
57
|
+
warnings.push(message);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (/Math\.random\s*\(/.test(code)) {
|
|
61
|
+
warnings.push('Math.random() may break determinism - use random() instead');
|
|
62
|
+
}
|
|
63
|
+
if (/Date\s*\(/.test(code) || /Date\.now\s*\(/.test(code)) {
|
|
64
|
+
warnings.push('Date functions may break determinism - use t or frameCount instead');
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
safe: warnings.filter(w => !w.includes('may break')).length === 0,
|
|
68
|
+
warnings,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/ui-renderer v0.3.0 - Code Mode Renderer
|
|
3
|
+
*
|
|
4
|
+
* Renders Code Mode systems using the canonical NexArt p5-like runtime.
|
|
5
|
+
* This uses the exact same execution logic as nexart.xyz for determinism.
|
|
6
|
+
*/
|
|
7
|
+
import type { NexArtCodeSystem, PreviewOptions } from '../types';
|
|
8
|
+
interface P5Runtime {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
frameCount: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function createP5Runtime(canvas: HTMLCanvasElement, width: number, height: number, seed: number): P5Runtime;
|
|
15
|
+
export interface CodeRenderer {
|
|
16
|
+
render: () => void;
|
|
17
|
+
start: () => void;
|
|
18
|
+
stop: () => void;
|
|
19
|
+
destroy: () => void;
|
|
20
|
+
isCanonical: false;
|
|
21
|
+
isArchival: false;
|
|
22
|
+
}
|
|
23
|
+
export declare function renderCodeModeSystem(system: NexArtCodeSystem, canvas: HTMLCanvasElement, options?: PreviewOptions): CodeRenderer;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=code-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-renderer.d.ts","sourceRoot":"","sources":["../../src/preview/code-renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAWjE,UAAU,SAAS;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AA4DD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,SAAS,CAueX;AASD,MAAM,WAAW,YAAY;IAC3B,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;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,cAAmB,GAC3B,YAAY,CAoMd"}
|