@peerbots/face 0.0.0-stage → 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 +30 -2
- package/dist/VizijFaceView-DEMuLMAb.d.ts +63 -0
- package/dist/chunk-EAYBAWGE.js +1487 -0
- package/dist/chunk-EAYBAWGE.js.map +1 -0
- package/dist/chunk-QGFC2GUD.js +211 -0
- package/dist/chunk-QGFC2GUD.js.map +1 -0
- package/dist/chunk-ZEXL2QPJ.js +68 -0
- package/dist/chunk-ZEXL2QPJ.js.map +1 -0
- package/dist/index.cjs +4639 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +557 -0
- package/dist/index.js +1660 -0
- package/dist/index.js.map +1 -0
- package/dist/pixi.cjs +2421 -0
- package/dist/pixi.cjs.map +1 -0
- package/dist/pixi.d.ts +33 -0
- package/dist/pixi.js +889 -0
- package/dist/pixi.js.map +1 -0
- package/dist/vizij.cjs +1556 -0
- package/dist/vizij.cjs.map +1 -0
- package/dist/vizij.d.ts +2 -0
- package/dist/vizij.js +193 -0
- package/dist/vizij.js.map +1 -0
- package/package.json +116 -4
- package/public/FaceAssets/Hugo/cheek.png +0 -0
- package/public/FaceAssets/Hugo/concerned_l.png +0 -0
- package/public/FaceAssets/Hugo/concerned_r.png +0 -0
- package/public/FaceAssets/Hugo/happy_l.png +0 -0
- package/public/FaceAssets/Hugo/happy_r.png +0 -0
- package/public/FaceAssets/Hugo/hugo_spritesheet.json +97 -0
- package/public/FaceAssets/Hugo/hugo_spritesheet.png +0 -0
- package/public/FaceAssets/Hugo/neutral_l.png +0 -0
- package/public/FaceAssets/Hugo/neutral_r.png +0 -0
- package/public/FaceAssets/Hugo/sad_l.png +0 -0
- package/public/FaceAssets/Hugo/sad_r.png +0 -0
- package/public/FaceAssets/Hugo/sleepy_l.png +0 -0
- package/public/FaceAssets/Hugo/sleepy_r.png +0 -0
- package/public/FaceAssets/Hugo/surprised_l.png +0 -0
- package/public/FaceAssets/Hugo/surprised_r.png +0 -0
- package/public/FaceAssets/Icons/Concerned.png +0 -0
- package/public/FaceAssets/Icons/Neutral.png +0 -0
- package/public/FaceAssets/Icons/Sad.png +0 -0
- package/public/FaceAssets/Icons/Sleep.png +0 -0
- package/public/FaceAssets/Icons/Surprised.png +0 -0
- package/public/FaceAssets/Misty/misty_spritesheet.json +97 -0
- package/public/FaceAssets/Misty/misty_spritesheet.png +0 -0
- package/public/FaceAssets/Robotic/robotic_spritesheet.json +97 -0
- package/public/FaceAssets/Robotic/robotic_spritesheet.png +0 -0
- package/public/FaceAssets/Vizij/Hugo.glb +0 -0
- package/public/FaceAssets/Vizij/brand.svg +15 -0
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @peerbots/face
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Canonical Peerbots Robot Face rendering engine, assets, viseme & amplitude synchronization, two-tier TTS audio caching, and modular Zustand state slices.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Dual Canonical Renderers + Pluggable Strategy (`FaceRendererStrategy`)**:
|
|
8
|
+
- `PixiFaceView`: PixiJS v8 2D sprite & vector renderer (`Hugo`, `Simple`, `Robotic`, `Display`) with spritesheet emotions, natural blinking & breathing, smooth gaze interpolation, and amplitude-driven mouth shapes.
|
|
9
|
+
- `VizijFaceView`: 3D WebAssembly skeletal & blendshape renderer (`Hugo - Expressive` and custom `.glb` uploads) powered by `@vizij/runtime-react`.
|
|
10
|
+
- `StaticFaceFallback` & `FaceViewSkeleton`: Accessible ARIA-annotated fallback for headless browsers and WebGL-disabled environments with canonical sprite previews from `FaceAssets`.
|
|
11
|
+
- **Zero Backend Lock-In**: Zero Firebase, Firestore, or PubNub dependencies. Inject remote TTS (e.g., AWS Polly) via `SpeechSynthesizerAdapter` while built-in Web Speech API synthesis and `TtsAudioCache` (in-memory LRU + IndexedDB) handle caching and fallback automatically.
|
|
12
|
+
- **Modular Zustand Store Slices**: `createFaceRenderingSlice`, `createFaceSpeechSlice`, `createPeerbotsFaceStore`, `FaceStoreProvider`, and `useFaceStore`.
|
|
13
|
+
|
|
14
|
+
## Assets Setup
|
|
15
|
+
|
|
16
|
+
Copy or serve `node_modules/@peerbots/face/public/FaceAssets` at `/FaceAssets` in your application's public directory (or pass a custom `assetBaseUrl` to `createPeerbotsFaceStore({ assetBaseUrl })`).
|
|
17
|
+
|
|
18
|
+
## Development & CI
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm ci
|
|
22
|
+
npm run check:ci # Typecheck, ESLint, Vitest coverage (>=80%), and Playwright Storybook WCAG 2.1 AA tests
|
|
23
|
+
npm run build # Build ESM + CJS + DTS bundles to dist/
|
|
24
|
+
npm run build-storybook # Build static Storybook documentation
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Releases & Publishing (Changesets)
|
|
28
|
+
|
|
29
|
+
1. Record changes with `npm run changeset` and commit the generated `.changeset/*.md` file.
|
|
30
|
+
2. Pushing to `main` runs `.github/workflows/publish.yml`, which opens or updates the **"Version Packages"** pull request.
|
|
31
|
+
3. Merging **"Version Packages"** (with `NPM_TOKEN` configured in GitHub Actions secrets) builds `dist/` and publishes `@peerbots/face` to npm.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
interface FaceUiLabels {
|
|
4
|
+
loading: string;
|
|
5
|
+
poweredBy: string;
|
|
6
|
+
tapToEnableSound: string;
|
|
7
|
+
allowSpeech: string;
|
|
8
|
+
characterSelection: string;
|
|
9
|
+
face: string;
|
|
10
|
+
uploadGlb: string;
|
|
11
|
+
vizijUploadGlb: string;
|
|
12
|
+
vizijErrorPrefix: string;
|
|
13
|
+
faceCapabilities: string;
|
|
14
|
+
color: string;
|
|
15
|
+
emotion: string;
|
|
16
|
+
speech: string;
|
|
17
|
+
faceSpecificSettings: string;
|
|
18
|
+
faceExpressivity: string;
|
|
19
|
+
eyes: string;
|
|
20
|
+
mouth: string;
|
|
21
|
+
cheeks: string;
|
|
22
|
+
emotionDisplay: string;
|
|
23
|
+
defaultOption: string;
|
|
24
|
+
noneOption: string;
|
|
25
|
+
emoticon: string;
|
|
26
|
+
emoji: string;
|
|
27
|
+
positioning: string;
|
|
28
|
+
autoRotate: string;
|
|
29
|
+
rotate: string;
|
|
30
|
+
reset: string;
|
|
31
|
+
zoom: string;
|
|
32
|
+
horizontalOffset: string;
|
|
33
|
+
verticalOffset: string;
|
|
34
|
+
faceSettings: string;
|
|
35
|
+
onFaceButtons: string;
|
|
36
|
+
showFullScreenButton: string;
|
|
37
|
+
showScrollButton: string;
|
|
38
|
+
speechBehavior: string;
|
|
39
|
+
newButtonSpeech: string;
|
|
40
|
+
interruptSpeech: string;
|
|
41
|
+
queueSpeech: string;
|
|
42
|
+
captions: string;
|
|
43
|
+
fontSize: string;
|
|
44
|
+
verticalPosition: string;
|
|
45
|
+
voiceSelectorLanguage: string;
|
|
46
|
+
voiceSelectorVoice: string;
|
|
47
|
+
unknownFaceType: string;
|
|
48
|
+
sendEmotion: string;
|
|
49
|
+
sendColor: string;
|
|
50
|
+
textToSpeakPlaceholder: string;
|
|
51
|
+
textToSpeakAria: string;
|
|
52
|
+
speak: string;
|
|
53
|
+
testFace: string;
|
|
54
|
+
}
|
|
55
|
+
declare const DEFAULT_FACE_UI_LABELS: FaceUiLabels;
|
|
56
|
+
declare function resolveFaceUiLabels(overrides?: Partial<FaceUiLabels>): FaceUiLabels;
|
|
57
|
+
|
|
58
|
+
interface VizijFaceViewProps {
|
|
59
|
+
labels?: Partial<FaceUiLabels>;
|
|
60
|
+
}
|
|
61
|
+
declare function VizijFaceView({ labels }?: VizijFaceViewProps): react.JSX.Element | null;
|
|
62
|
+
|
|
63
|
+
export { DEFAULT_FACE_UI_LABELS as D, type FaceUiLabels as F, type VizijFaceViewProps as V, VizijFaceView as a, resolveFaceUiLabels as r };
|