@doan-labs/peek 0.1.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 +38 -0
- package/dist/animate.d.ts +58 -0
- package/dist/draw.d.ts +69 -0
- package/dist/identity.d.ts +55 -0
- package/dist/identity.js +398 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1700 -0
- package/dist/peek.d.ts +13 -0
- package/dist/svg.d.ts +33 -0
- package/dist/svg.js +1053 -0
- package/dist/tables.d.ts +258 -0
- package/package.json +70 -0
- package/src/animate.ts +670 -0
- package/src/draw.ts +849 -0
- package/src/identity.ts +147 -0
- package/src/index.ts +28 -0
- package/src/peek.tsx +98 -0
- package/src/svg.ts +94 -0
- package/src/tables.ts +414 -0
package/dist/peek.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type Gaze } from './draw.js';
|
|
3
|
+
import { type PeekOptions } from './svg.js';
|
|
4
|
+
export type PeekProps = Omit<PeekOptions, 'gaze' | 'id'> & {
|
|
5
|
+
name: string;
|
|
6
|
+
/** x and y in -1..1, or 'pointer' to follow the pointer (animate only). */
|
|
7
|
+
gaze?: Gaze | 'pointer';
|
|
8
|
+
/** Bring it to life after mount. Off under prefers-reduced-motion. */
|
|
9
|
+
animate?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
export declare function Peek({ name, gaze, animate, className, style, ...rest }: PeekProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
package/dist/svg.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type DrawOptions, type Frame, type Gaze, type Node, type Pose } from './draw.js';
|
|
2
|
+
import { type Axes, type Identity } from './identity.js';
|
|
3
|
+
import type { Expression } from './tables.js';
|
|
4
|
+
export type PeekOptions = Partial<Axes> & {
|
|
5
|
+
/** px. Drives the stroke ramp (thicker below 96) and the riso print. */
|
|
6
|
+
size?: number;
|
|
7
|
+
expression?: Expression;
|
|
8
|
+
/** Where the eyes look, x and y in -1..1. */
|
|
9
|
+
gaze?: Gaze;
|
|
10
|
+
frame?: Frame;
|
|
11
|
+
/** false clips the frame to a circle. Default true. */
|
|
12
|
+
square?: boolean;
|
|
13
|
+
/** Accessible name, default the name; false marks it decorative. */
|
|
14
|
+
title?: string | false;
|
|
15
|
+
/** Riso plates and grain, visible from 120px up. Default off. */
|
|
16
|
+
riso?: boolean;
|
|
17
|
+
/** Pin a style version. Default the latest. */
|
|
18
|
+
version?: number;
|
|
19
|
+
/** Prefix for ids inside the SVG. Default derived from everything drawn,
|
|
20
|
+
* so two different avatars inlined in one page never share defs. */
|
|
21
|
+
id?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A name decides identity unless the caller overrides an axis: an explicit
|
|
25
|
+
* face, color or part wins over the hash, and every other axis stays put.
|
|
26
|
+
*/
|
|
27
|
+
export declare function settle(name: string, o: PeekOptions, live?: boolean): {
|
|
28
|
+
who: Identity;
|
|
29
|
+
pose: Pose;
|
|
30
|
+
opts: DrawOptions;
|
|
31
|
+
};
|
|
32
|
+
export declare function serialize(node: Node): string;
|
|
33
|
+
export declare function toSvg(name: string, props?: PeekOptions): string;
|