@hackbuild/avatar-host 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/how.ts +29 -0
  2. package/package.json +9 -8
package/how.ts ADDED
@@ -0,0 +1,29 @@
1
+ // how this works: the fold of the package page and of the suite tool. Plain data, no imports;
2
+ // shape in tools/how.d.ts, checked by tsconfig.how.json, shipped in the tarball, never imported
3
+ // by the runtime entry. Text from the README.
4
+ const how: HowDoc = {
5
+ what: "host a character on a three.js stage in any container: ticketed loads through @hackbuild/avatar, a follow camera, the presence frame order, a loop that pauses when hidden, and a hb-avatar-host element.",
6
+ how: [
7
+ "a character on a three.js stage in any container. bodies load through @hackbuild/avatar into the normalized humanoid space; the camera frames and follows the posed body.",
8
+ "loads are ticketed: show(source) resolves to the result, or to null when a later show replaced it, so a slow file never lands over a newer one. a drop of files finds the model and the files it references by path, then by name.",
9
+ "one animation loop runs, and it stops while the page is hidden, the host is off screen or at zero size, or a sheet covers it. the main entry has no three.js; the hb-avatar-host element is under /three.",
10
+ ],
11
+ packages: ["@hackbuild/avatar-host"],
12
+ install: "npm install @hackbuild/avatar-host",
13
+ today: "git clone https://github.com/hackbuild/hackbuild-motion && cd hackbuild-motion && npm ci && npm run build && npm pack -w @hackbuild/avatar-host",
14
+ code: `import { defineAvatarHost } from "@hackbuild/avatar-host/three";
15
+ import { droppedFiles } from "@hackbuild/avatar-host";
16
+
17
+ defineAvatarHost("hb-avatar-host", {
18
+ // three-vrm (MIT) is imported on the first .vrm only
19
+ vrm: () => import("@hackbuild/avatar/vrm").then((m) => m.vrmHook()),
20
+ });
21
+ const el = document.querySelector("hb-avatar-host")!;
22
+ el.addEventListener("loaded", (e) => console.info(e.detail.caps));
23
+ el.addEventListener("failed", (e) => showError(e.detail.message));
24
+ zone.addEventListener("drop", async (e) => el.showFiles(await droppedFiles(e.dataTransfer!)));`,
25
+ lang: "ts",
26
+ links: { page: "https://hackbuild.github.io/hackbuild-motion/avatar-host/", source: "https://github.com/hackbuild/hackbuild-motion/tree/main/packages/avatar-host" },
27
+ };
28
+
29
+ export default how;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackbuild/avatar-host",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Host a character on a three.js stage in any container: ticketed loads through @hackbuild/avatar, a follow camera, the presence frame order, a loop that pauses when hidden, and a hb-avatar-host element.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,18 +30,19 @@
30
30
  "files": [
31
31
  "dist",
32
32
  "README.md",
33
- "LICENSE"
33
+ "LICENSE",
34
+ "how.ts"
34
35
  ],
35
36
  "scripts": {
36
37
  "build": "node ../../tools/build-package.mjs avatar-host"
37
38
  },
38
39
  "dependencies": {
39
- "@hackbuild/avatar": "0.1.0",
40
- "@hackbuild/environment": "0.1.0",
41
- "@hackbuild/lipsync": "0.1.0",
42
- "@hackbuild/organic": "0.1.0",
43
- "@hackbuild/presence": "0.1.0",
44
- "@hackbuild/rig": "0.1.0"
40
+ "@hackbuild/avatar": "0.1.1",
41
+ "@hackbuild/environment": "0.1.1",
42
+ "@hackbuild/lipsync": "0.1.1",
43
+ "@hackbuild/organic": "0.1.1",
44
+ "@hackbuild/presence": "0.1.1",
45
+ "@hackbuild/rig": "0.1.1"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "three": ">=0.186.1"