{"_id":"@andyed/kinetic-type-engine","name":"@andyed/kinetic-type-engine","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@andyed/kinetic-type-engine","version":"0.1.0","description":"Composable physics primitives for kinetic typography. Text segmentation, line breaking, optimal recognition point math, per-chunk timing, trail/blur kinematics, layout-safety zoom limits, font metrics. Extracted from iBlipper; brand-neutral by design.","license":"MIT","author":{"name":"Andy Edmonds"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","test":"echo 'tests are vitest-based; run from a consumer or scaffold vitest separately'","prepublishOnly":"npm run build"},"dependencies":{"compromise":"^14.14.4"},"devDependencies":{"@types/node":"^22","tsup":"^8","typescript":"^5"},"keywords":["kinetic-typography","rsvp","typography","text-layout","animation-physics","chunking","line-breaking","orp","optimal-recognition-point"],"repository":{"type":"git","url":"git+https://github.com/andyed/kinetic-type-engine.git"},"bugs":{"url":"https://github.com/andyed/kinetic-type-engine/issues"},"homepage":"https://github.com/andyed/kinetic-type-engine#readme","publishConfig":{"access":"public"},"gitHead":"a32be35ccbefebf36156b49b3a34c0617e7992ef","_id":"@andyed/kinetic-type-engine@0.1.0","_nodeVersion":"25.8.2","_npmVersion":"11.11.1","dist":{"integrity":"sha512-pDW4o/kSdWqew45mqBI7qnWt5zItTa9zyuByi4LtdKnISw4gGM2a33sbpjrN3yMphRz5yTqHGy4UlMwy/8F6Aw==","shasum":"b82e2484b52c311ef5d7cfbb6094908eed88ba25","tarball":"https://registry.npmjs.org/@andyed/kinetic-type-engine/-/kinetic-type-engine-0.1.0.tgz","fileCount":9,"unpackedSize":278652,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAyvC2IFrQrUf4RE9xWDsoe6lfENu0asNqzcA4bOWJKIAiAfFCzUUlb1XgzUf5/lWuzvxsuaEzo8hcMeQ9QUuGKECA=="}]},"_npmUser":{"name":"andyed","email":"andyed@gmail.com"},"directories":{},"maintainers":[{"name":"andyed","email":"andyed@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kinetic-type-engine_0.1.0_1777146725560_0.8840005648882134"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-25T19:52:05.490Z","0.1.0":"2026-04-25T19:52:05.694Z","modified":"2026-04-25T19:52:05.865Z"},"maintainers":[{"name":"andyed","email":"andyed@gmail.com"}],"description":"Composable physics primitives for kinetic typography. Text segmentation, line breaking, optimal recognition point math, per-chunk timing, trail/blur kinematics, layout-safety zoom limits, font metrics. Extracted from iBlipper; brand-neutral by design.","homepage":"https://github.com/andyed/kinetic-type-engine#readme","keywords":["kinetic-typography","rsvp","typography","text-layout","animation-physics","chunking","line-breaking","orp","optimal-recognition-point"],"repository":{"type":"git","url":"git+https://github.com/andyed/kinetic-type-engine.git"},"author":{"name":"Andy Edmonds"},"bugs":{"url":"https://github.com/andyed/kinetic-type-engine/issues"},"license":"MIT","readme":"# @andyed/kinetic-type-engine\n\nComposable physics primitives for kinetic typography — text segmentation, line breaking, optimal-recognition-point math, per-chunk timing, trail kinematics, layout-safety zoom limits, font metrics. Brand-neutral by design.\n\nExtracted from [iBlipper](https://iblipper.com), the motion-type synthesizer. The engine ships the math that any kinetic-typography system needs; **named emotion recipes** (`emphatic`, `hurry`, `playful`, …) live in consumers, not here, because rehearsed rhetorical vocabulary is brand IP, not public-good math.\n\n## Status\n\n**v0.1.0** — first publish. Public surface is the union of every module's exports; expect refinement in 0.2 once consumers hit the API in production.\n\n## Install\n\n```bash\nnpm install @andyed/kinetic-type-engine\n```\n\n## Use\n\n```ts\nimport {\n  processText,           // text → presentation chunks\n  applySmartLineBreaks,  // text → multi-line layout under width budget\n  calculateFrameDuration,// per-chunk display duration\n  getSafeZoom,           // max zoom that keeps text on screen\n  smartChunkWithNLP,     // chunk text using grammatical phrase boundaries\n} from '@andyed/kinetic-type-engine';\n\n// RSVP: split a passage into chunks for serial presentation\nconst chunks = processText('The quick brown fox jumps over the lazy dog.', 2);\n\n// For each chunk, compute display duration at 600 WPM\nconst durations = chunks.map(c => calculateFrameDuration(c, 600));\n\n// Multi-line layout: break a long line under a max-width budget\nconst wrapped = applySmartLineBreaks(\n  'EXPRESSION',\n  /* maxWidth */ 720,\n  /* fontSize */ 96,\n);\n```\n\n## Modules\n\n| Module | Role |\n|---|---|\n| `chunking` | Text → chunk segmentation. Density-aware, emoji-safe, preserves visual overrides. |\n| `constants` | Shared timing/normalization constants. |\n| `fonts` | Font-stack metrics + per-font character-width factors. |\n| `layoutSafety` | `getSafeZoom()` — geometric + motion-overhead zoom limits. |\n| `lineBreaking` | `applySmartLineBreaks`, `willTextWrap`, `calculateTargetCharsPerLine`. |\n| `nlp` | `smartChunkWithNLP` — phrase-boundary chunking via [compromise](https://github.com/spencermountain/compromise). |\n| `timingModel` | `calculateFrameDuration`, `getAnimationPhases`. |\n| `trailModes` | Trail/blur kinematics primitives. |\n\n## What's not here\n\n- **Optimal-recognition-point (ORP) and Bouma-offset math** are RSVP-specific (rapid serial visual presentation — the iBlipper reader's core technique) and stay in [iBlipper](https://github.com/andyed/iblipper2025) as proprietary. The engine ships the kinetic-typography primitives shared across all consumers; ORP is an iBlipper-specific reading optimization.\n- **Named emotion recipes** (`emphatic`, `hurry`, `playful`, …) are curated rhetorical vocabulary and live in iBlipper. Compose your own from the primitives here.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n\n## Lineage\n\nCarved out of iBlipper's `src/engine/` per the [extraction spec](https://github.com/andyed/iblipper2025/blob/main/docs/kinetic_type_engine_extraction_spec.md). The product (React + Capacitor + IAP + share-by-URL viral loop + curated emotion vocabulary + RSVP/ORP reader) stays at [iblipper2025](https://github.com/andyed/iblipper2025). The shared math is here.\n","readmeFilename":"README.md","_rev":"1-0946439ca1f1df0ff93295734ebb3d74"}