{"_id":"@a-morphous/frontispiece-ink-storylets","_rev":"1-60d4ff8cc9157fd596f6670b0919fc03","name":"@a-morphous/frontispiece-ink-storylets","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@a-morphous/frontispiece-ink-storylets","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@a-morphous/frontispiece-ink-storylets@1.0.0","maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"dist":{"shasum":"6f3a22dde222098cbab52a3ff6b479058f8ecbf3","tarball":"https://registry.npmjs.org/@a-morphous/frontispiece-ink-storylets/-/frontispiece-ink-storylets-1.0.0.tgz","fileCount":11,"integrity":"sha512-RNeKuZ+f6m8d1EuAA2dX/Wv4J3VEPxnMmhIGmyfebeVly5x+zMzLhnFTdusemOVhmXnj/+8UlbQX6OehoBZ/WQ==","signatures":[{"sig":"MEYCIQDdYkDx72yUgFwXJ4ufppYSvlEvaluEJSRUZ9m3Ot5vlgIhAKeaPTYJ0vW280+zLu1YC7PLftec1dazocZjeI0HzE7q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":233235},"main":"dist/ink-storylets.js","type":"module","_from":"file:a-morphous-frontispiece-ink-storylets-1.0.0.tgz","module":"dist/ink-storylets.module.js","scripts":{"pub":"pnpm publish --access public","test":"echo \"Error: no test specified\" && exit 1","build":"node build","start":"node build -w","dryRun":"pnpm publish --dry-run"},"_npmUser":{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"},"_resolved":"/private/var/folders/pd/2r2pf8ln2cv61g2b_k9fr5nc0000gn/T/31724c509aa714870be816f260878edd/a-morphous-frontispiece-ink-storylets-1.0.0.tgz","_integrity":"sha512-RNeKuZ+f6m8d1EuAA2dX/Wv4J3VEPxnMmhIGmyfebeVly5x+zMzLhnFTdusemOVhmXnj/+8UlbQX6OehoBZ/WQ==","_npmVersion":"10.2.3","description":"Extension to `ink-processor` that enables storylets.","directories":{},"_nodeVersion":"20.10.0","dependencies":{"immer":"^10.1.1"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.24.0","npm-dts":"^1.3.12","minimist":"^1.2.8","@a-morphous/frontispiece-ink-utils":"^1.1.0","@a-morphous/frontispiece-ink-processor":"^4.2.4"},"peerDependencies":{"@a-morphous/frontispiece-ink-utils":"^1.1.0","@a-morphous/frontispiece-ink-processor":"^4.2.4"},"_npmOperationalInternal":{"tmp":"tmp/frontispiece-ink-storylets_1.0.0_1729049425353_0.7661515880184506","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@a-morphous/frontispiece-ink-storylets","version":"1.0.1","description":"Extension to `ink-processor` that enables storylets.","main":"dist/ink-storylets.js","module":"dist/ink-storylets.module.js","type":"module","keywords":[],"author":"","license":"ISC","dependencies":{"immer":"^10.1.1"},"devDependencies":{"esbuild":"^0.24.0","minimist":"^1.2.8","npm-dts":"^1.3.12","@a-morphous/frontispiece-ink-processor":"^4.2.4","@a-morphous/frontispiece-ink-utils":"^1.1.0"},"peerDependencies":{"@a-morphous/frontispiece-ink-processor":"^4.2.4","@a-morphous/frontispiece-ink-utils":"^1.1.0"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"node build","dryRun":"pnpm publish --dry-run","pub":"pnpm publish --access public","start":"node build -w"},"_id":"@a-morphous/frontispiece-ink-storylets@1.0.1","_integrity":"sha512-owgeSau/DF+MIs1BVPfVOjAy1fw2mTaRI1TSXWkJPYIIuQpUGJnHrlgCVHiNGO6AC9y2rt1q2M8De1euF1riMA==","_resolved":"/private/var/folders/pd/2r2pf8ln2cv61g2b_k9fr5nc0000gn/T/fcc937c2cd676202e3a09c23131809b2/a-morphous-frontispiece-ink-storylets-1.0.1.tgz","_from":"file:a-morphous-frontispiece-ink-storylets-1.0.1.tgz","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-owgeSau/DF+MIs1BVPfVOjAy1fw2mTaRI1TSXWkJPYIIuQpUGJnHrlgCVHiNGO6AC9y2rt1q2M8De1euF1riMA==","shasum":"690e3cda1996b78a438e7c008cf581518f6447b1","tarball":"https://registry.npmjs.org/@a-morphous/frontispiece-ink-storylets/-/frontispiece-ink-storylets-1.0.1.tgz","fileCount":14,"unpackedSize":236810,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4xJukBxVgJGNGAfLjBrwUGDqTz7mCzIWKRUChoXMbtwIgR2zs01N+cF83dxNwFAa8tZic1VIhBoLAF+BlI5BipoU="}]},"_npmUser":{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"},"directories":{},"maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/frontispiece-ink-storylets_1.0.1_1729056095594_0.5241762023770729"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-16T03:30:25.244Z","modified":"2024-10-16T05:21:36.036Z","1.0.0":"2024-10-16T03:30:25.573Z","1.0.1":"2024-10-16T05:21:35.833Z"},"license":"ISC","keywords":[],"description":"Extension to `ink-processor` that enables storylets.","maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"readme":"# Ink Storylets\n\nExtension to `ink-processor` that enables storylets.\n\n## Usage\n\nFirst, run `CreateStorylets`. By default, the getter and setter will work with `inkJS`, though you can define custom getter and setters for variables for other ink implementations.\n\nIn the engine, once the ink processor is created, register the 'HUB' as a new command. This is the command you use to start your storylet section, and get your storylets.\n\n> Note that `HUB` must be in all-caps to work with [Recital](https://www.npmjs.com/package/@a-morphous/recital-stage-ink)\n\n```ts\n\nconst storylets = CreateStorylets()\nInkHookStateController.registerCommand('HUB', storylets.Hub)\n\n```\n\nThe hub will cause you, when you select choices, to get a list of choices from available storylets. When you click on one of those choices, the engine should make sure to use the custom `followStoryletChoice` function:\n\n```tsx\n<button onClick={() => {\nconst anyChoice = props.choice as VisualStoryletChoice\nif (anyChoice.id === 'storylet-choice') {\n\tfollowVisualStoryletChoice(inkState._engine, anyChoice)\n} else {\n\tinkState.makeChoice(props.choice.index)\n}\n}}>{props.choice.text}</button>\n```\n\n## Writing stories with storylets\n\nThe code here assumes you're using Recital, in which case storylet syntax [can be found here.](https://www.npmjs.com/package/@a-morphous/recital-stage-ink#storylets)\n\nAll storylet sections are top-level knots, and the storylets are the stitches inside of the knot, with tags attached to the stitch to produce the logic.","readmeFilename":"README.md"}