paperlab 0.8.0 → 0.9.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 +59 -35
- 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-7WOGU2D4.js → chunk-S74YZAXE.js} +2 -2
- package/dist/chunk-S74YZAXE.js.map +1 -0
- package/dist/{chunk-SVWWC5UL.js → chunk-YQFQT3AH.js} +3336 -773
- package/dist/chunk-YQFQT3AH.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 +3396 -796
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -5
- package/dist/index.d.ts +63 -5
- package/dist/index.js +53 -8
- package/dist/index.js.map +1 -1
- package/dist/{slots-D_EE8GXn.d.cts → slots-BAVzglHw.d.cts} +125 -4
- package/dist/{slots-D_EE8GXn.d.ts → slots-BAVzglHw.d.ts} +125 -4
- package/dist/stage.cjs +3536 -979
- 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 +14 -13
- package/dist/stage.js.map +1 -1
- package/package.json +14 -14
- 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/stage.d.cts
CHANGED
package/dist/stage.d.ts
CHANGED
package/dist/stage.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_PAYLOAD_VERSION,
|
|
3
|
+
CANVAS_SHADOWS,
|
|
3
4
|
LightRig,
|
|
4
5
|
PaperFieldMesh,
|
|
5
6
|
PaperLighting,
|
|
@@ -16,8 +17,8 @@ import {
|
|
|
16
17
|
resolveLighting,
|
|
17
18
|
usePrefersReducedMotion,
|
|
18
19
|
walkPathSchema
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-YQFQT3AH.js";
|
|
21
|
+
import "./chunk-BIFUJCUA.js";
|
|
21
22
|
|
|
22
23
|
// src/stage/PaperStage.tsx
|
|
23
24
|
import * as THREE6 from "three";
|
|
@@ -304,7 +305,7 @@ var ModelBoundary = class extends Component {
|
|
|
304
305
|
return { failed: true };
|
|
305
306
|
}
|
|
306
307
|
componentDidCatch(error) {
|
|
307
|
-
console.warn("[paperlab] figure.model failed to load
|
|
308
|
+
console.warn("[paperlab] figure.model failed to load. Using the capsule figure.", error);
|
|
308
309
|
}
|
|
309
310
|
render() {
|
|
310
311
|
return this.state.failed ? this.props.fallback : this.props.children;
|
|
@@ -804,7 +805,7 @@ function warnOnce(cause) {
|
|
|
804
805
|
if (warned) return;
|
|
805
806
|
warned = true;
|
|
806
807
|
console.warn(
|
|
807
|
-
"[paperlab/stage] Rendering without the print pass
|
|
808
|
+
"[paperlab/stage] Rendering without the print pass, so tone curve, bloom, vignette and grain are off.\nThey need two optional peers:\n npm i @react-three/postprocessing postprocessing\nSet `grade` to all zeros to turn the pass off deliberately and silence this.",
|
|
808
809
|
...cause === void 0 ? [] : [cause]
|
|
809
810
|
);
|
|
810
811
|
}
|
|
@@ -1667,7 +1668,7 @@ function PaperStage({ children, className, style, ...sceneProps }) {
|
|
|
1667
1668
|
return /* @__PURE__ */ jsx7("div", { className, style: { width: "100%", height: "100%", ...style }, children: /* @__PURE__ */ jsxs5(
|
|
1668
1669
|
Canvas,
|
|
1669
1670
|
{
|
|
1670
|
-
shadows:
|
|
1671
|
+
shadows: CANVAS_SHADOWS,
|
|
1671
1672
|
dpr: [1, dpr],
|
|
1672
1673
|
camera: { fov: 38, near: 0.05, far: 400 },
|
|
1673
1674
|
onCreated: ({ scene }) => {
|
|
@@ -1932,7 +1933,7 @@ var stagePresets = {
|
|
|
1932
1933
|
archive: {
|
|
1933
1934
|
id: "archive",
|
|
1934
1935
|
label: "Archive",
|
|
1935
|
-
description: "Narrow strips packed tight
|
|
1936
|
+
description: "Narrow strips packed tight, a corridor of records you edge through.",
|
|
1936
1937
|
stage: {
|
|
1937
1938
|
path: walks.bend,
|
|
1938
1939
|
// Far enough back that the figure reads as small; a `low` camera
|
|
@@ -2097,7 +2098,7 @@ const text = ${JSON.stringify(input.text)}` : "";
|
|
|
2097
2098
|
const scrolls = stageSchema.parse(input.stage).showFigure ? "walk the figure" : "move the camera";
|
|
2098
2099
|
const images = input.images?.length ? exportableImages(input.images) : null;
|
|
2099
2100
|
const imagesConst = images ? `
|
|
2100
|
-
${images.substituted ? "\n// Your uploaded pictures cannot travel in a snippet
|
|
2101
|
+
${images.substituted ? "\n// Your uploaded pictures cannot travel in a snippet, so these are\n// placeholders in the same order. Point them at your own files." : ""}
|
|
2101
2102
|
const images = ${JSON.stringify(images.list, null, 2)}` : "";
|
|
2102
2103
|
if (!input.scroll) {
|
|
2103
2104
|
return `import { PaperStage, type StageConfigInput } from 'paperlab/stage'${input.paper ? "\nimport type { PaperConfigInput } from 'paperlab'" : ""}
|
|
@@ -2154,24 +2155,24 @@ ${propLines(input, " ")}
|
|
|
2154
2155
|
}
|
|
2155
2156
|
function buildStageAgentPayload(input) {
|
|
2156
2157
|
const name = input.componentName ?? "PaperNave";
|
|
2157
|
-
const sizing = input.scroll ? `4. Sizing: the component brings its own height
|
|
2158
|
+
const sizing = input.scroll ? `4. Sizing: the component brings its own height. It reserves ${SCROLL_HEIGHTS} viewport
|
|
2158
2159
|
heights of scroll and pins the canvas inside that. Drop it into the page
|
|
2159
2160
|
flow as a section; do NOT wrap it in a fixed-height container.` : `4. Sizing: the component fills its parent container. Place it where I ask;
|
|
2160
2161
|
give the parent an explicit height.`;
|
|
2161
2162
|
const subject = stageSchema.parse(input.stage).showFigure ? "paper as architecture, with a figure walking through it" : "paper as architecture, banners hung along a walk you move through";
|
|
2162
|
-
return `Integrate a Paperlab stage
|
|
2163
|
+
return `Integrate a Paperlab stage (${subject}) into this project. (paperlab agent-payload v${AGENT_PAYLOAD_VERSION})
|
|
2163
2164
|
|
|
2164
2165
|
1. Install the dependencies:
|
|
2165
2166
|
|
|
2166
2167
|
npm i paperlab three @react-three/fiber gsap @react-three/postprocessing postprocessing
|
|
2167
2168
|
|
|
2168
|
-
The last two are only needed by stage mode
|
|
2169
|
-
not use them
|
|
2169
|
+
The last two are only needed by stage mode (<Paper> and <PaperField> do
|
|
2170
|
+
not use them), and they are optional even here: <PaperStage> loads the
|
|
2170
2171
|
print pass on demand, so a stage without them renders, just without the
|
|
2171
2172
|
tone curve, bloom, vignette and grain. Install them to get the grade.
|
|
2172
2173
|
|
|
2173
2174
|
2. Create the component below as \`components/${name}.tsx\` (or the project's
|
|
2174
|
-
component convention). It is self-contained
|
|
2175
|
+
component convention). It is self-contained: it owns its own <Canvas>,
|
|
2175
2176
|
its own camera and its own lighting:
|
|
2176
2177
|
|
|
2177
2178
|
\`\`\`tsx
|
|
@@ -2184,7 +2185,7 @@ ${buildStageComponentSource(input)}
|
|
|
2184
2185
|
${sizing}
|
|
2185
2186
|
|
|
2186
2187
|
5. Verify: run the dev server. You should see ${describeStage(input)}.
|
|
2187
|
-
If the canvas is blank, the container almost certainly has no height
|
|
2188
|
+
If the canvas is blank, the container almost certainly has no height. Give
|
|
2188
2189
|
it one (this is the classic React Three Fiber integration bug, not a
|
|
2189
2190
|
paperlab bug).
|
|
2190
2191
|
|