@objectifthunes/three-book 0.5.5 → 0.5.7

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 CHANGED
@@ -149,6 +149,11 @@ Final color = `texture * paperColor`. Keep color white (`new THREE.Color(1, 1, 1
149
149
  | Core | `Book`, `BookContent`, `BookDirection`, `Paper`, `PaperSetup`, `PaperUVMargin` |
150
150
  | Binding | `BookBinding`, `BookBound`, `StapleBookBinding`, `StapleBookBound`, `StapleSetup` |
151
151
  | Content | `IPageContent`, `PageContent`, `SpritePageContent2` |
152
+ | Text | `TextBlock`, `TextBlockOptions` — styled text rendered to 2D canvas. Methods: `draw(ctx)`, `wrapLines(ctx)`, `measureHeight(ctx)`, `hitTest(ctx, px, py)` |
153
+ | Text overlay | `TextOverlayContent`, `TextOverlayContentOptions` — `IPageContent` that composites text blocks on top of a source canvas. Methods: `addText(opts)`, `removeText(text)`, `updateText(index, opts)`, `markDirty()`, `update(root?)`, `syncMaterials(root)`, `dispose()` |
154
+ | Spreads | `SpreadContent`, `SpreadContentOptions` — double-page spread with text. Same methods as `TextOverlayContent` plus `left`/`right` accessors. `getSpreadPairs(pageCount)` returns valid 0-indexed spread start positions |
155
+ | Texture utils | `createPageCanvas(color, label, image, fitMode, fullBleed, pageWidth?, pageHeight?, imageRect?)`, `createPageTexture(…)`, `computeDefaultImageRect(image, canvasWidth, canvasHeight, fitMode, fullBleed)`, `loadImage(blob)` |
156
+ | Texture types | `PX_PER_UNIT` (256) — pixels per world unit. `ImageFitMode` (`'contain' \| 'cover' \| 'fill'`), `ImageRect` (`{ x, y, width, height }`), `LoadedImage` (`{ image, objectUrl }`) |
152
157
  | Auto turn | `AutoTurnDirection`, `AutoTurnMode`, `AutoTurnSettings`, `AutoTurnSetting` |
153
158
  | Low-level | `PaperMeshData`, `PaperPattern`, `PaperNode`, `PaperMeshUtility`, `PaperMaterialData`, `RendererFactory`, `BookRenderer`, `MeshFactory`, `PaperMeshDataPool` |
154
159