@rig-c/play 1.18.0 → 1.20.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/dist/DomRenderer.d.ts +7 -2
- package/dist/DomRenderer.d.ts.map +1 -1
- package/dist/DomTexture.d.ts +8 -0
- package/dist/DomTexture.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +157 -39
- package/dist/index.js.map +1 -1
- package/dist/loadModel.d.ts +10 -6
- package/dist/loadModel.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/loadModel.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type RegionImage } from './DomTexture.js';
|
|
1
|
+
import { type AtlasRegion, type RegionImage } from './DomTexture.js';
|
|
2
2
|
/**
|
|
3
3
|
* Loads a rig built by `rigc build`: the compiled model document
|
|
4
4
|
* (`skeleton.model.json`, spec `rigc-compiled/3`) and the page images its
|
|
5
|
-
* `pages` section names
|
|
5
|
+
* `pages` section names. The default cuts region bitmaps once; the atlas
|
|
6
|
+
* option retains page-backed descriptors without encoding region PNGs.
|
|
6
7
|
*
|
|
7
8
|
* The document states everything the player reads — the skeleton, the
|
|
8
9
|
* animations, and where every region sits on its page — so the `.atlas` and
|
|
@@ -30,7 +31,8 @@ export interface LoadModelOptions {
|
|
|
30
31
|
fetch?: typeof globalThis.fetch;
|
|
31
32
|
/**
|
|
32
33
|
* What the region cut produces — the rigid tier's per-region bitmaps, which
|
|
33
|
-
* only the DOM mode draws. `'
|
|
34
|
+
* only the DOM mode draws. `'atlas'`: opt-in page-backed rigid canvases,
|
|
35
|
+
* no PNG encode and an empty regionImages map. `'blob'` (default): `blob:` URLs the load
|
|
34
36
|
* owns and `dispose` frees. `'data'`: `data:` URLs, for a content policy or
|
|
35
37
|
* a snapshot that does not carry `blob:`; nothing to free. `'none'`: no cut
|
|
36
38
|
* at all, for a load that only ever draws in the canvas mode — the pages
|
|
@@ -47,7 +49,7 @@ export interface LoadModelOptions {
|
|
|
47
49
|
setsUrl?: string | null;
|
|
48
50
|
}
|
|
49
51
|
/** `LoadModelOptions.regions`: how, or whether, the regions are cut. */
|
|
50
|
-
export type RegionLoading = 'blob' | 'data' | 'none';
|
|
52
|
+
export type RegionLoading = 'atlas' | 'blob' | 'data' | 'none';
|
|
51
53
|
/**
|
|
52
54
|
* One attachment set read from `sets.json` (`spine-parts-sets/1` or
|
|
53
55
|
* `rig-parts-sets/1`): the slots it replaces (`slots`, slot name → attachment
|
|
@@ -106,9 +108,11 @@ export interface ModelAssets {
|
|
|
106
108
|
} | null;
|
|
107
109
|
/** How the regions were cut (`LoadModelOptions.regions`): `'none'` means `regionImages` is empty and only the canvas mode can draw. */
|
|
108
110
|
readonly regions: RegionLoading;
|
|
109
|
-
/**
|
|
111
|
+
/** Complete ready URL map on blob/data loads; empty on atlas/none loads. */
|
|
110
112
|
readonly regionImages: Map<string, RegionImage>;
|
|
111
|
-
/** Page
|
|
113
|
+
/** Page-backed rigid sources on an atlas load; empty on explicit blob/data/none loads. */
|
|
114
|
+
readonly atlasRegions: Map<string, AtlasRegion>;
|
|
115
|
+
/** Page images, keyed by the document's page names; shared by meshes and atlas regions. */
|
|
112
116
|
readonly pageImages: Map<string, HTMLImageElement>;
|
|
113
117
|
/**
|
|
114
118
|
* The document as `rig-c/core` read it. Opaque to callers: the player poses
|
package/dist/loadModel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadModel.d.ts","sourceRoot":"","sources":["../src/loadModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAgC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadModel.d.ts","sourceRoot":"","sources":["../src/loadModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAsB,KAAK,WAAW,EAAgC,MAAM,iBAAiB,CAAC;AAEvH;;;;;;;;;;;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IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,GAAG,SAAS,CAErF;AAqQD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CA6C/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rig-c/play",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "Plays skeleton.model.json written by rigc build as plain DOM elements — rigid slots as <img> posed by CSS matrix, deform meshes on small per-part canvases — or as one canvas.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@playwright/test": "1.62.1",
|
|
83
83
|
"@rig-c/parts": "1.60.0",
|
|
84
84
|
"@types/node": "^22",
|
|
85
|
-
"rig-c": "2.
|
|
85
|
+
"rig-c": "2.74.0",
|
|
86
86
|
"typescript": "^5.6.0",
|
|
87
87
|
"vite": "^6.0.0"
|
|
88
88
|
}
|