open-bot-avatar 0.1.1 → 0.2.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/README.md +3 -2
- package/dist/dom/clock.d.ts +5 -3
- package/dist/dom/clock.d.ts.map +1 -1
- package/dist/dom/clock.js +24 -6
- package/dist/dom/clock.js.map +1 -1
- package/dist/dom/mount.d.ts +8 -2
- package/dist/dom/mount.d.ts.map +1 -1
- package/dist/dom/mount.js +82 -14
- package/dist/dom/mount.js.map +1 -1
- package/dist/dom/paint.d.ts +49 -0
- package/dist/dom/paint.d.ts.map +1 -0
- package/dist/dom/paint.js +183 -0
- package/dist/dom/paint.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/render.d.ts +34 -6
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +86 -13
- package/dist/render.js.map +1 -1
- package/dist/types.d.ts +4 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.js +2 -2
- package/dist/validate.js.map +1 -1
- package/package.json +1 -1
- package/src/dom/clock.ts +22 -7
- package/src/dom/mount.ts +90 -16
- package/src/dom/paint.ts +215 -0
- package/src/index.ts +1 -1
- package/src/render.ts +108 -16
- package/src/types.ts +4 -1
- package/src/validate.ts +2 -2
package/src/types.ts
CHANGED
|
@@ -44,7 +44,10 @@ export interface RenderOptions {
|
|
|
44
44
|
color?: string;
|
|
45
45
|
/** Eye color as #rgb or #rrggbb. Defaults to a plain near-black ink. */
|
|
46
46
|
eyeColor?: string;
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Rendered width/height in CSS pixels. Omit for a fluid SVG. In sceneFrame it lets small
|
|
49
|
+
* live avatars skip cross-sections that would sit less than a pixel apart.
|
|
50
|
+
*/
|
|
48
51
|
size?: number;
|
|
49
52
|
/** Volume amount 0..14 (default 6 = natural depth; 0 = flat). Scales every part's inferred depth. */
|
|
50
53
|
depth?: number;
|
package/src/validate.ts
CHANGED
|
@@ -211,7 +211,7 @@ export function validateAvatar(input: unknown): ValidationResult {
|
|
|
211
211
|
errors.push('name must be 1-40 printable characters without < or >');
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
let path =
|
|
214
|
+
let path: string | null = null;
|
|
215
215
|
if (!isRecord(input.body)) errors.push('body must be an object { "path": "..." }');
|
|
216
216
|
else {
|
|
217
217
|
for (const k of Object.keys(input.body)) if (k !== 'path') errors.push(`unknown field "body.${k}" (only "path" is allowed)`);
|
|
@@ -238,7 +238,7 @@ export function validateAvatar(input: unknown): ValidationResult {
|
|
|
238
238
|
|
|
239
239
|
let normalized = '';
|
|
240
240
|
let body: BodyAnalysis | null = null;
|
|
241
|
-
if (path) {
|
|
241
|
+
if (path !== null) {
|
|
242
242
|
try {
|
|
243
243
|
const segs = parsePath(path);
|
|
244
244
|
normalized = serializePath(segs);
|