paperlab 0.5.0 → 0.5.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 +4 -2
- package/dist/{chunk-6IADJZX5.js → chunk-HRXQTJFS.js} +45 -28
- package/dist/chunk-HRXQTJFS.js.map +1 -0
- package/dist/index.cjs +107 -90
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/stage.cjs +254 -231
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.js +13 -5
- package/dist/stage.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-6IADJZX5.js.map +0 -1
package/dist/stage.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
LightRig,
|
|
4
4
|
PaperFieldMesh,
|
|
5
5
|
PaperLighting,
|
|
6
|
+
ReleaseContextOnUnmount,
|
|
6
7
|
createWalkPath,
|
|
7
8
|
cssColorOr,
|
|
8
9
|
diffConfig,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
resolveLighting,
|
|
16
17
|
usePrefersReducedMotion,
|
|
17
18
|
walkPathSchema
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HRXQTJFS.js";
|
|
19
20
|
|
|
20
21
|
// src/stage/PaperStage.tsx
|
|
21
22
|
import * as THREE6 from "three";
|
|
@@ -1694,7 +1695,8 @@ function PaperStage({ children, className, style, ...sceneProps }) {
|
|
|
1694
1695
|
},
|
|
1695
1696
|
children: [
|
|
1696
1697
|
/* @__PURE__ */ jsx7(PaperStageScene, { ...sceneProps }),
|
|
1697
|
-
children
|
|
1698
|
+
children,
|
|
1699
|
+
/* @__PURE__ */ jsx7(ReleaseContextOnUnmount, {})
|
|
1698
1700
|
]
|
|
1699
1701
|
}
|
|
1700
1702
|
) });
|
|
@@ -2067,7 +2069,11 @@ function describeStage(input) {
|
|
|
2067
2069
|
);
|
|
2068
2070
|
const moved = Object.entries(stage.light).filter(([, value]) => value !== void 0).map(([key]) => key);
|
|
2069
2071
|
if (moved.length > 0) parts.push(`with its ${moved.join(", ")} set by hand`);
|
|
2070
|
-
if (input.scroll)
|
|
2072
|
+
if (input.scroll) {
|
|
2073
|
+
parts.push(
|
|
2074
|
+
stage.showFigure ? "and scrolling the page walks the figure deeper into it" : "and scrolling the page carries the camera deeper into it"
|
|
2075
|
+
);
|
|
2076
|
+
}
|
|
2071
2077
|
return parts.join(", ");
|
|
2072
2078
|
}
|
|
2073
2079
|
function exportableImages(images) {
|
|
@@ -2108,6 +2114,7 @@ const banner = ${stringifyStage(diffConfig(paperConfigSchema.parse(input.paper))
|
|
|
2108
2114
|
const textConst = input.text?.trim() ? `
|
|
2109
2115
|
|
|
2110
2116
|
const text = ${JSON.stringify(input.text)}` : "";
|
|
2117
|
+
const scrolls = stageSchema.parse(input.stage).showFigure ? "walk the figure" : "move the camera";
|
|
2111
2118
|
const images = input.images?.length ? exportableImages(input.images) : null;
|
|
2112
2119
|
const imagesConst = images ? `
|
|
2113
2120
|
${images.substituted ? "\n// Your uploaded pictures cannot travel in a snippet \u2014 these are\n// placeholders in the same order. Point them at your own files." : ""}
|
|
@@ -2134,7 +2141,7 @@ export function ${name}() {
|
|
|
2134
2141
|
const ref = useRef<HTMLDivElement>(null)
|
|
2135
2142
|
const [progress, setProgress] = useState(0)
|
|
2136
2143
|
|
|
2137
|
-
// Scroll the section,
|
|
2144
|
+
// Scroll the section, ${scrolls}. The stage is pinned for the height
|
|
2138
2145
|
// of the section, so the page scrolling past it IS the walk.
|
|
2139
2146
|
useEffect(() => {
|
|
2140
2147
|
const el = ref.current
|
|
@@ -2171,7 +2178,8 @@ function buildStageAgentPayload(input) {
|
|
|
2171
2178
|
heights of scroll and pins the canvas inside that. Drop it into the page
|
|
2172
2179
|
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;
|
|
2173
2180
|
give the parent an explicit height.`;
|
|
2174
|
-
|
|
2181
|
+
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";
|
|
2182
|
+
return `Integrate a Paperlab stage \u2014 ${subject} \u2014 into this project. (paperlab agent-payload v${AGENT_PAYLOAD_VERSION})
|
|
2175
2183
|
|
|
2176
2184
|
1. Install the dependencies:
|
|
2177
2185
|
|