paperlab 0.4.0 → 0.5.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/README.md +16 -16
- package/dist/{chunk-4ZU5DZEF.js → chunk-6IADJZX5.js} +508 -224
- package/dist/chunk-6IADJZX5.js.map +1 -0
- package/dist/index.cjs +571 -272
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -65
- package/dist/index.d.ts +36 -65
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/slots-CIo7FnlY.d.cts +13357 -0
- package/dist/slots-CIo7FnlY.d.ts +13357 -0
- package/dist/stage.cjs +2377 -2111
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.d.cts +52 -28
- package/dist/stage.d.ts +52 -28
- package/dist/stage.js +29 -11
- package/dist/stage.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-4ZU5DZEF.js.map +0 -1
- package/dist/slots-BYoLxVZ4.d.cts +0 -6008
- package/dist/slots-BYoLxVZ4.d.ts +0 -6008
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
A hero image that peels, a receipt that unrolls, a letter that folds, a poster rippling in wind, a gallery ring of prints. A sheet is real 3D geometry, not a CSS trick and not a video — content is a texture on a mesh that genuinely bends, so text and imagery curl with perfect continuity.
|
|
10
10
|
|
|
11
|
-
**[Try it →](https://
|
|
11
|
+
**[Try it →](https://paperlab.nawwara.studio/)** · [the editor](https://paperlab.nawwara.studio/editor/) (desktop) · [the reference](https://paperlab.nawwara.studio/docs/) · [for coding agents](https://github.com/NourMtir0722/Paperlab/blob/main/AGENTS.md)
|
|
12
12
|
|
|
13
13
|
| | |
|
|
14
14
|
|---|---|
|
|
15
|
-
|  |  |
|
|
16
|
+
|  |  |
|
|
17
17
|
|
|
18
18
|
Every frame above is real geometry — no video, no sprite sheet.
|
|
19
19
|
|
|
@@ -94,25 +94,25 @@ Underneath them are seven **deformers** — `roll`, `curl`, `bend`, `fold`, `wav
|
|
|
94
94
|
|
|
95
95
|
### Stocks — 7
|
|
96
96
|
|
|
97
|
-

|
|
98
98
|
|
|
99
99
|
One sheet of words, seven papers. Stock is not a colour swap: thermal takes on banding, newsprint takes grain, vellum goes translucent and lets the light through it. On top of stock sit composable surface effects — grain, torn deckle edges, crease lines, perforation, aging — as shader chunks. Alpha-affecting effects use `alphaTest` rather than blending, so shadows stay correct.
|
|
100
100
|
|
|
101
101
|
### Layouts — 12
|
|
102
102
|
|
|
103
|
-

|
|
104
104
|
|
|
105
105
|
Every layout names somewhere paper actually sits: `book` (pages splayed from a spine — `split: 0` makes it a swatch deck), `accordion` (one continuous concertina strip), `fan` (a hand of cards), `spread` (a stack slid sideways), `pile` (a heap on a desk), `rack` (prints stood in a row, leaning back), `wall` (a pinned studio wall), `spill` (a dropped stack mid-air), `colonnade` (banners along a walk, for stage mode), `ring`, `sheet`, and `sweep` — a specimen chart of one sheet at ten stages of the same curl.
|
|
106
106
|
|
|
107
107
|
Each pose also carries a **bias**: how strongly that one sheet takes the deformation. So the top of a pile curls while the sheets pressed underneath lie flat — in the same draw call. A whole field is **one instanced draw call** with the deformers running on the GPU, and the camera frames itself from the layout's own poses, so a wide `wall` and a deep `ring` both land without hand-tuning.
|
|
108
108
|
|
|
109
|
-

|
|
110
110
|
|
|
111
111
|
Twelve sheets, twelve peeled corners, **one draw call** — the deformers run on the GPU and the text curls with the mesh.
|
|
112
112
|
|
|
113
113
|
### Lighting — 8 rigs
|
|
114
114
|
|
|
115
|
-

|
|
116
116
|
|
|
117
117
|
A rig is the starting point, not the ceiling. `light={{ exposure, film, key, color, direction, height, ambient, studio, haze }}` moves the lamp in the terms a person would say it in — degrees around the room, degrees above the horizon — and **studio** is the room itself as an environment map, which is what gives paper directional fill and something for its sheen to reflect. `window` and `leaves` carry a gobo; `lightbox` puts the source behind the sheet and lets you read it through the paper.
|
|
118
118
|
|
|
@@ -120,7 +120,7 @@ Overrides serialize *as* overrides, so a shared scene carries the two sliders yo
|
|
|
120
120
|
|
|
121
121
|
### Stage — paper as architecture
|
|
122
122
|
|
|
123
|
-

|
|
124
124
|
|
|
125
125
|
Banners hung the height of a room along a walk you travel, with light coming through the paper from an opening at the far end. `<PaperStage text="…" />` builds the whole space out of a sentence, and binding `progress` to scroll makes the page scroll the walk.
|
|
126
126
|
|
|
@@ -128,13 +128,13 @@ The room is real — a ceiling, poured floor slabs, columns with base plates, an
|
|
|
128
128
|
|
|
129
129
|
**Six rooms ship**, and they are not variations on a theme — the walk changes shape, the paper changes proportion, the light changes where it comes from:
|
|
130
130
|
|
|
131
|
-

|
|
132
132
|
|
|
133
133
|
Every one of those is built from the same two things: sheets of paper, and words printed on them. No imagery, no textures from anywhere else.
|
|
134
134
|
|
|
135
135
|
**Four camera shots** frame any of them, each reading the same walk as the arrangement and the light, so they cannot drift apart:
|
|
136
136
|
|
|
137
|
-

|
|
138
138
|
|
|
139
139
|
And it is navigable rather than a video. It drifts on its own until you touch it, then drag it (with inertia), wheel it, step banner to banner with the arrow keys, or click the paper you want to stand in front of. The stops come from the layout, so a step lands *on* a banner. `motion={{ capture: false }}` for a stage inside a scrolling page, so it never eats a reader's scroll. Quality adapts to the machine on its own across four tiers.
|
|
140
140
|
|
|
@@ -154,7 +154,7 @@ The zod schema in `config/schema.ts` is the single source of truth: it validates
|
|
|
154
154
|
|
|
155
155
|
A paper is data — a `.paper` JSON object validated by a zod schema — so it travels without asking anyone's permission. **You do not need to fork this repo to share one.**
|
|
156
156
|
|
|
157
|
-
**Sending one.** Sculpt a paper in the [editor](https://
|
|
157
|
+
**Sending one.** Sculpt a paper in the [editor](https://paperlab.nawwara.studio/editor/) and hit **Share**: you get a link with the whole paper packed into it. Anyone who opens that link lands in their own editor with your paper loaded and *editable* — a fork, not a read-only view. (Uploaded images are too big for a URL; use the ⬇ download and send the `.paper` file instead.)
|
|
158
158
|
|
|
159
159
|
**Receiving one.** Open the link, or drag a `.paper` file onto the preset panel. Either way it lands in your library next to the built-ins.
|
|
160
160
|
|
|
@@ -181,19 +181,19 @@ That's the whole loop: **make → send → remix → ship.** If you'd rather you
|
|
|
181
181
|
|
|
182
182
|
Three surfaces ship alongside the library, all built on its public API only.
|
|
183
183
|
|
|
184
|
-
**[The playground](https://
|
|
184
|
+
**[The playground](https://paperlab.nawwara.studio/playground/)** — one input, one scene, shareable by link. Type a sentence and it builds you a room out of it. Built for a phone.
|
|
185
185
|
|
|
186
|
-
**[The editor](https://
|
|
186
|
+
**[The editor](https://paperlab.nawwara.studio/editor/)** — a three-rail canvas tool: presets on the left, sculpt on canvas, inspector on the right, transport at the bottom (space = play/pause), undo and redo on ⌘Z.
|
|
187
187
|
|
|
188
|
-

|
|
189
189
|
|
|
190
190
|
The inspector is generated from the zod schema, so it can never drift from the API. Each behavior nominates the two or three params that *are* it — `unroll` opens on progress and tightness, and folds sheet, stock, content, surface, physics and scene away behind their own headings. Labels drag to scrub: full range in ~300px, shift for a 4× finer pass, click the readout to type an exact value.
|
|
191
191
|
|
|
192
|
-

|
|
193
193
|
|
|
194
194
|
Field mode composes galleries against the same panel — swap the layout, watch fourteen papers rearrange in one draw call. **Export code** ends the session in your codebase, and **Copy for AI** ends it in a coding agent's. It wants a real screen: under about 900px it says so and points you at the playground.
|
|
195
195
|
|
|
196
|
-
**[The reference](https://
|
|
196
|
+
**[The reference](https://paperlab.nawwara.studio/docs/)** — the whole catalogue with every behavior, deformer, layout, stock and surface rendering live. The catalogue is generated from the registries, so it cannot advertise something the library doesn't have.
|
|
197
197
|
|
|
198
198
|
## Development
|
|
199
199
|
|