paperlab 0.8.0 → 0.8.1
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 +57 -30
- package/dist/{FxPostPass-V6YDK4H2.js → FxPostPass-ACFSHY3S.js} +4 -4
- package/dist/FxPostPass-ACFSHY3S.js.map +1 -0
- package/dist/{chunk-232SU3AQ.js → chunk-BIFUJCUA.js} +2 -2
- package/dist/{chunk-232SU3AQ.js.map → chunk-BIFUJCUA.js.map} +1 -1
- package/dist/{chunk-SVWWC5UL.js → chunk-LUKNPQ3S.js} +16 -17
- package/dist/chunk-LUKNPQ3S.js.map +1 -0
- package/dist/{chunk-7WOGU2D4.js → chunk-S74YZAXE.js} +2 -2
- package/dist/chunk-S74YZAXE.js.map +1 -0
- package/dist/{damageContract-nF1fgK7P.d.cts → damageContract-9RC4egJg.d.cts} +2 -2
- package/dist/{damageContract-nF1fgK7P.d.ts → damageContract-9RC4egJg.d.ts} +2 -2
- package/dist/fx.cjs +20 -20
- package/dist/fx.cjs.map +1 -1
- package/dist/fx.d.cts +42 -44
- package/dist/fx.d.ts +42 -44
- package/dist/fx.js +21 -21
- package/dist/fx.js.map +1 -1
- package/dist/index.cjs +22 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{slots-D_EE8GXn.d.cts → slots-DbJQfwVd.d.cts} +1 -1
- package/dist/{slots-D_EE8GXn.d.ts → slots-DbJQfwVd.d.ts} +1 -1
- package/dist/stage.cjs +23 -24
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.d.cts +1 -1
- package/dist/stage.d.ts +1 -1
- package/dist/stage.js +12 -12
- package/dist/stage.js.map +1 -1
- package/package.json +5 -5
- package/dist/FxPostPass-V6YDK4H2.js.map +0 -1
- package/dist/chunk-7WOGU2D4.js.map +0 -1
- package/dist/chunk-SVWWC5UL.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1673,7 +1673,7 @@ var paperConfigSchema = import_zod15.z.object({
|
|
|
1673
1673
|
ctx.addIssue({
|
|
1674
1674
|
code: import_zod15.z.ZodIssueCode.custom,
|
|
1675
1675
|
path: ["physics"],
|
|
1676
|
-
message: "the strip simulation and behavior/deformers
|
|
1676
|
+
message: "the strip simulation and behavior/deformers cannot be used together. The roll owns the vertices, and its rows are chain nodes rather than the sheet's own grid (pick Shape OR Strip)"
|
|
1677
1677
|
});
|
|
1678
1678
|
}
|
|
1679
1679
|
if (config.states) {
|
|
@@ -1695,7 +1695,7 @@ var paperConfigSchema = import_zod15.z.object({
|
|
|
1695
1695
|
ctx.addIssue({
|
|
1696
1696
|
code: import_zod15.z.ZodIssueCode.custom,
|
|
1697
1697
|
path: ["states", "states", name, "overrides"],
|
|
1698
|
-
message: `state "${name}" overrides don't validate against the paper schema: ${first ? `${first.path.join(".")}
|
|
1698
|
+
message: `state "${name}" overrides don't validate against the paper schema: ${first ? `${first.path.join(".")}: ${first.message}` : "invalid"}`
|
|
1699
1699
|
});
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
@@ -2406,7 +2406,7 @@ function getPreset(name) {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
function registerPreset(name, input) {
|
|
2408
2408
|
if (name in builtins) {
|
|
2409
|
-
throw new Error(`[paperlab] "${name}" is a built-in preset
|
|
2409
|
+
throw new Error(`[paperlab] "${name}" is a built-in preset. Pick another name.`);
|
|
2410
2410
|
}
|
|
2411
2411
|
paperConfigSchema.parse(input);
|
|
2412
2412
|
userPresets.set(name, input);
|
|
@@ -3329,7 +3329,7 @@ function resolveDeformerStack(raw) {
|
|
|
3329
3329
|
if (!parsed.success) {
|
|
3330
3330
|
const issue = parsed.error.issues[0];
|
|
3331
3331
|
throw new Error(
|
|
3332
|
-
`[paperlab] deformers[${i}] ("${instance.type}"): ${issue ? `${issue.path.join(".") || "options"}
|
|
3332
|
+
`[paperlab] deformers[${i}] ("${instance.type}"): ${issue ? `${issue.path.join(".") || "options"}: ${issue.message}` : "invalid options"}`
|
|
3333
3333
|
);
|
|
3334
3334
|
}
|
|
3335
3335
|
return {
|
|
@@ -4358,7 +4358,7 @@ var DAMAGE_LOOK_DEFAULTS = {
|
|
|
4358
4358
|
emberFlicker: 1.65,
|
|
4359
4359
|
emberGlow: 1.25,
|
|
4360
4360
|
sparkle: 0.5,
|
|
4361
|
-
// As wide as the char band
|
|
4361
|
+
// As wide as the char band: the lip has to be seen. At
|
|
4362
4362
|
// 0.95 mm it was a hairline tracing the edge.
|
|
4363
4363
|
lipWidth: 3.5,
|
|
4364
4364
|
charWidth: 3.5,
|
|
@@ -5498,11 +5498,11 @@ var THREE7 = __toESM(require("three"), 1);
|
|
|
5498
5498
|
var import_react5 = require("react");
|
|
5499
5499
|
var import_fiber2 = require("@react-three/fiber");
|
|
5500
5500
|
|
|
5501
|
-
// ../../node_modules/.pnpm/three-custom-shader-material@6.4.0_@react-three+fiber@9.7.0_@types+react@19.2.18_react-
|
|
5501
|
+
// ../../node_modules/.pnpm/three-custom-shader-material@6.4.0_@react-three+fiber@9.7.0_@types+react@19.2.18_react-_69d6cbf74dd7fcdbd515d35271d34b04/node_modules/three-custom-shader-material/three-custom-shader-material.es.js
|
|
5502
5502
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
5503
5503
|
var r = __toESM(require("react"), 1);
|
|
5504
5504
|
|
|
5505
|
-
// ../../node_modules/.pnpm/three-custom-shader-material@6.4.0_@react-three+fiber@9.7.0_@types+react@19.2.18_react-
|
|
5505
|
+
// ../../node_modules/.pnpm/three-custom-shader-material@6.4.0_@react-three+fiber@9.7.0_@types+react@19.2.18_react-_69d6cbf74dd7fcdbd515d35271d34b04/node_modules/three-custom-shader-material/vanilla/three-custom-shader-material.es.js
|
|
5506
5506
|
var v = __toESM(require("three"), 1);
|
|
5507
5507
|
var D = (
|
|
5508
5508
|
/* glsl */
|
|
@@ -6093,7 +6093,7 @@ var j = class extends v.Material {
|
|
|
6093
6093
|
}
|
|
6094
6094
|
};
|
|
6095
6095
|
|
|
6096
|
-
// ../../node_modules/.pnpm/three-custom-shader-material@6.4.0_@react-three+fiber@9.7.0_@types+react@19.2.18_react-
|
|
6096
|
+
// ../../node_modules/.pnpm/three-custom-shader-material@6.4.0_@react-three+fiber@9.7.0_@types+react@19.2.18_react-_69d6cbf74dd7fcdbd515d35271d34b04/node_modules/three-custom-shader-material/three-custom-shader-material.es.js
|
|
6097
6097
|
function l(u, e2) {
|
|
6098
6098
|
const t = r.useRef(false);
|
|
6099
6099
|
r.useEffect(() => {
|
|
@@ -7082,7 +7082,7 @@ vec3 plScorchTint(float t) {
|
|
|
7082
7082
|
return min(c / paper, vec3(1.0));
|
|
7083
7083
|
}
|
|
7084
7084
|
|
|
7085
|
-
/** The ember ramp
|
|
7085
|
+
/** The ember ramp: off \u2192 #870E03 \u2192 #A12108 \u2192 #F77E14 \u2192 #FEFBE0, hottest last. */
|
|
7086
7086
|
vec3 plEmberRamp(float t) {
|
|
7087
7087
|
vec3 c0 = plLinear(vec3(0.529, 0.055, 0.012));
|
|
7088
7088
|
vec3 c1 = plLinear(vec3(0.631, 0.129, 0.031));
|
|
@@ -7112,7 +7112,7 @@ void plDamage(inout vec4 color, inout float roughness) {
|
|
|
7112
7112
|
vec2 gradC = vec2(e.r - w.r, n.r - s.r) * 0.5 * perWorld;
|
|
7113
7113
|
// Scorch reaches ahead of the char, and further UP than anywhere else:
|
|
7114
7114
|
// the char a centimetre below this point, and the char a few millimetres
|
|
7115
|
-
// around it, each lent to the scorch at a discount
|
|
7115
|
+
// around it, each lent to the scorch at a discount.
|
|
7116
7116
|
vec2 mmUv = vec2(PL_MM) / uSheetSize;
|
|
7117
7117
|
float charBelow = max(texture2D(uDamage, uv - upUv * uLook2.y * mmUv).r, texture2D(uDamage, uv - upUv * 0.5 * uLook2.y * mmUv).r);
|
|
7118
7118
|
// A ring of eight, averaged: four diagonal maxima drew the grid back in as
|
|
@@ -7171,7 +7171,7 @@ void plDamage(inout vec4 color, inout float roughness) {
|
|
|
7171
7171
|
float lipEdge = uLook1.y * mix(0.7, 1.1, plFbm(vec2(dot(p, tangentR) / (5.0 * PL_MM), 1.7)));
|
|
7172
7172
|
float charEnd = lipEdge + uLook0.x + uLook3.w * mix(0.8, 1.2, plFbm(vec2(dot(p, tangentR) / (7.0 * PL_MM), 4.3)));
|
|
7173
7173
|
// Further above the burn than below it \u2014 hot gas rises and cooks the paper
|
|
7174
|
-
// over it
|
|
7174
|
+
// over it \u2014 out to the scorch's full reach straight up, and about
|
|
7175
7175
|
// half of it below and beside.
|
|
7176
7176
|
vec2 upMm = normalize(upUv * uSheetSize);
|
|
7177
7177
|
float above = length(toward) > 1e-3 ? max(0.0, dot(-normalize(toward), upMm)) : 0.0;
|
|
@@ -9516,7 +9516,7 @@ function buildDisplacementGLSL(stack, sheet2) {
|
|
|
9516
9516
|
const deformer = getDeformer(instance.type);
|
|
9517
9517
|
if (!deformer.glsl) {
|
|
9518
9518
|
throw new Error(
|
|
9519
|
-
`[paperlab] Deformer "${instance.type}" has no GLSL implementation
|
|
9519
|
+
`[paperlab] Deformer "${instance.type}" has no GLSL implementation, so it can't run in field mode.`
|
|
9520
9520
|
);
|
|
9521
9521
|
}
|
|
9522
9522
|
const ns = `u${cap(instance.type)}${i}_`;
|
|
@@ -10952,10 +10952,9 @@ function FieldKeyboardMirror({
|
|
|
10952
10952
|
children: [
|
|
10953
10953
|
paperLabel(slot, i),
|
|
10954
10954
|
carrying?.slot === i && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { "aria-live": "polite", children: [
|
|
10955
|
-
" ",
|
|
10956
|
-
"\u2014 carrying; zone ",
|
|
10955
|
+
", carrying. Zone ",
|
|
10957
10956
|
controller.current?.zoneIds()[carrying.zoneIndex] ?? "none",
|
|
10958
|
-
"
|
|
10957
|
+
". Enter places it, Escape puts it back."
|
|
10959
10958
|
] })
|
|
10960
10959
|
]
|
|
10961
10960
|
},
|
|
@@ -11284,7 +11283,7 @@ function withoutUploads(value) {
|
|
|
11284
11283
|
};
|
|
11285
11284
|
return { value: walk(value), replaced };
|
|
11286
11285
|
}
|
|
11287
|
-
var UPLOAD_NOTE = "// Uploaded pictures cannot travel in a snippet
|
|
11286
|
+
var UPLOAD_NOTE = "// Uploaded pictures cannot travel in a snippet, so the paths below are\n// stand-ins, in order. Point them at your own files.";
|
|
11288
11287
|
function buildJsxSnippet(config) {
|
|
11289
11288
|
const diffed = diffConfig(config);
|
|
11290
11289
|
delete diffed.meta;
|
|
@@ -11312,7 +11311,7 @@ var BEHAVIOR_PHRASES = {
|
|
|
11312
11311
|
settle: (o) => o.relax > 0.7 ? "lying where it landed, flat but for one corner the stiffness kept" : "just come to rest, still holding a little of the shape it fell in",
|
|
11313
11312
|
carry: () => "drooping from a pinched corner, fluttering as if being carried",
|
|
11314
11313
|
flight: (o) => o.path === "loop" ? "tumbling through a seamless airborne loop" : "tumbling across the scene on the wind",
|
|
11315
|
-
crumple: (o) => o.progress < 0.3 ? "lightly handled
|
|
11314
|
+
crumple: (o) => o.progress < 0.3 ? "lightly handled, with a few soft creases across it" : o.progress < 0.7 ? "crushed into irregular creased facets, as if screwed up and flattened out again" : "balled up in a fist"
|
|
11316
11315
|
};
|
|
11317
11316
|
function describeConfig(config) {
|
|
11318
11317
|
const stock = getStock(config.stock);
|
|
@@ -11373,8 +11372,8 @@ export function ${name}() {
|
|
|
11373
11372
|
give the parent an explicit height.
|
|
11374
11373
|
|
|
11375
11374
|
4. Verify: run the dev server. You should see ${describeConfig(config)}.
|
|
11376
|
-
If the canvas is blank, the parent container almost certainly has no height
|
|
11377
|
-
|
|
11375
|
+
If the canvas is blank, the parent container almost certainly has no height.
|
|
11376
|
+
Give it one (this is the classic React Three Fiber integration bug, not a
|
|
11378
11377
|
paperlab bug).
|
|
11379
11378
|
|
|
11380
11379
|
Constraints: don't modify the preset values; three >= 0.160 and React 19 are
|
|
@@ -11496,7 +11495,7 @@ function buildFieldComponentSource(input) {
|
|
|
11496
11495
|
id="${zone.id}"${accept}
|
|
11497
11496
|
bounds={${JSON.stringify(zone.bounds)}}${highlight}
|
|
11498
11497
|
onPlace={(paper, zone) => {
|
|
11499
|
-
// First-run smoke test
|
|
11498
|
+
// First-run smoke test. You should see this in the console on drop:
|
|
11500
11499
|
console.log(paper.presetName, '\u2192', zone.id)
|
|
11501
11500
|
// Then replace it: stamp a postmark, advance the flow, persist the placement, \u2026
|
|
11502
11501
|
}}
|
|
@@ -11547,7 +11546,7 @@ function buildFieldAgentPayload(input) {
|
|
|
11547
11546
|
npm i paperlab three @react-three/fiber gsap
|
|
11548
11547
|
|
|
11549
11548
|
2. Create the component below as \`components/PaperGallery.tsx\` (or the
|
|
11550
|
-
project's component convention). It is self-contained
|
|
11549
|
+
project's component convention). It is self-contained: every preset it
|
|
11551
11550
|
uses is inlined, and it owns its own <Canvas>:
|
|
11552
11551
|
|
|
11553
11552
|
\`\`\`tsx
|
|
@@ -11558,8 +11557,8 @@ ${buildFieldComponentSource(input)}
|
|
|
11558
11557
|
give the parent an explicit height.
|
|
11559
11558
|
|
|
11560
11559
|
4. Verify: run the dev server. You should see ${describeFieldConfig(input)}.
|
|
11561
|
-
If the canvas is blank, the parent container almost certainly has no height
|
|
11562
|
-
|
|
11560
|
+
If the canvas is blank, the parent container almost certainly has no height.
|
|
11561
|
+
Give it one (this is the classic React Three Fiber integration bug, not a
|
|
11563
11562
|
paperlab bug).
|
|
11564
11563
|
|
|
11565
11564
|
Constraints: don't modify the preset values; three >= 0.160 and React 19 are
|