paperlab 0.6.0 → 0.7.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 +5 -1
- package/dist/FxPostPass-M66QMVVC.js +166 -0
- package/dist/FxPostPass-M66QMVVC.js.map +1 -0
- package/dist/Grade-SBGYELKV.js +49 -0
- package/dist/Grade-SBGYELKV.js.map +1 -0
- package/dist/chunk-7TLIWPGM.js +36 -0
- package/dist/chunk-7TLIWPGM.js.map +1 -0
- package/dist/chunk-GB6BMHC3.js +811 -0
- package/dist/chunk-GB6BMHC3.js.map +1 -0
- package/dist/{chunk-E22ILEDO.js → chunk-MZCAN3AR.js} +1264 -197
- package/dist/chunk-MZCAN3AR.js.map +1 -0
- package/dist/damageContract-DPF1YFLZ.d.cts +129 -0
- package/dist/damageContract-DPF1YFLZ.d.ts +129 -0
- package/dist/fx.cjs +4276 -0
- package/dist/fx.cjs.map +1 -0
- package/dist/fx.d.cts +1796 -0
- package/dist/fx.d.ts +1796 -0
- package/dist/fx.js +3194 -0
- package/dist/fx.js.map +1 -0
- package/dist/index.cjs +2652 -914
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -4
- package/dist/index.d.ts +34 -4
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/stage.cjs +2864 -1087
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.js +31 -51
- package/dist/stage.js.map +1 -1
- package/package.json +16 -3
- package/dist/chunk-E22ILEDO.js.map +0 -1
package/dist/stage.js
CHANGED
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
resolveLighting,
|
|
17
17
|
usePrefersReducedMotion,
|
|
18
18
|
walkPathSchema
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MZCAN3AR.js";
|
|
20
|
+
import "./chunk-7TLIWPGM.js";
|
|
20
21
|
|
|
21
22
|
// src/stage/PaperStage.tsx
|
|
22
23
|
import * as THREE6 from "three";
|
|
@@ -789,50 +790,28 @@ function Suspension({
|
|
|
789
790
|
] });
|
|
790
791
|
}
|
|
791
792
|
|
|
792
|
-
// src/stage/
|
|
793
|
-
import {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
const vignette = grade
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
return /* @__PURE__ */ jsxs5(EffectComposer, { children: [
|
|
815
|
-
bloom ? /* @__PURE__ */ jsx6(
|
|
816
|
-
Bloom,
|
|
817
|
-
{
|
|
818
|
-
intensity: grade.bloom,
|
|
819
|
-
luminanceThreshold: grade.threshold,
|
|
820
|
-
luminanceSmoothing: 0.22,
|
|
821
|
-
mipmapBlur: true
|
|
822
|
-
}
|
|
823
|
-
) : null,
|
|
824
|
-
depth ? /* @__PURE__ */ jsx6(
|
|
825
|
-
DepthOfField,
|
|
826
|
-
{
|
|
827
|
-
focusDistance: 8e-3,
|
|
828
|
-
focalLength: 0.02 + grade.depth * 0.04,
|
|
829
|
-
bokehScale: grade.depth * 2.5
|
|
830
|
-
}
|
|
831
|
-
) : null,
|
|
832
|
-
/* @__PURE__ */ jsx6(ToneMapping, { mode: toneMappingModes[film] }),
|
|
833
|
-
vignette ? /* @__PURE__ */ jsx6(Vignette, { offset: 0.32, darkness: grade.vignette }) : null,
|
|
834
|
-
grain ? /* @__PURE__ */ jsx6(Noise, { opacity: grade.grain, blendFunction: BlendFunction.OVERLAY }) : null
|
|
835
|
-
] });
|
|
793
|
+
// src/stage/GradeLazy.tsx
|
|
794
|
+
import { Suspense as Suspense2, lazy } from "react";
|
|
795
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
796
|
+
var Grade = lazy(
|
|
797
|
+
() => import("./Grade-SBGYELKV.js").then((m) => ({ default: m.Grade })).catch((error) => {
|
|
798
|
+
warnOnce(error);
|
|
799
|
+
return { default: (() => null) };
|
|
800
|
+
})
|
|
801
|
+
);
|
|
802
|
+
var warned = false;
|
|
803
|
+
function warnOnce(cause) {
|
|
804
|
+
if (warned) return;
|
|
805
|
+
warned = true;
|
|
806
|
+
console.warn(
|
|
807
|
+
"[paperlab/stage] Rendering without the print pass \u2014 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
|
+
...cause === void 0 ? [] : [cause]
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
function GradePass(props) {
|
|
812
|
+
const { bloom, depth, vignette, grain } = props.grade;
|
|
813
|
+
if (!(bloom > 0 || depth > 0 || vignette > 0 || grain > 0)) return null;
|
|
814
|
+
return /* @__PURE__ */ jsx6(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx6(Grade, { ...props }) });
|
|
836
815
|
}
|
|
837
816
|
|
|
838
817
|
// src/stage/schema.ts
|
|
@@ -1389,7 +1368,7 @@ function settleTier(tier, fps, failed) {
|
|
|
1389
1368
|
}
|
|
1390
1369
|
|
|
1391
1370
|
// src/stage/PaperStage.tsx
|
|
1392
|
-
import { jsx as jsx7, jsxs as
|
|
1371
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1393
1372
|
var stageBanner = {
|
|
1394
1373
|
sheet: { width: 1.5, height: 8.5, segments: "auto" },
|
|
1395
1374
|
stock: "vellum",
|
|
@@ -1589,7 +1568,7 @@ function PaperStageScene({
|
|
|
1589
1568
|
const size = paperHeight * stage.source.spread;
|
|
1590
1569
|
return { position: [x, size * 0.35, z6], yaw: Math.atan2(-tx, -tz), size };
|
|
1591
1570
|
}, [path, stage.source.beyond, stage.source.spread, paperHeight]);
|
|
1592
|
-
return /* @__PURE__ */
|
|
1571
|
+
return /* @__PURE__ */ jsxs5(LightRig, { rig, children: [
|
|
1593
1572
|
/* @__PURE__ */ jsx7(ShotRig, { stage, paperHeight, walk: walk.walk }),
|
|
1594
1573
|
/* @__PURE__ */ jsx7(
|
|
1595
1574
|
PaperLighting,
|
|
@@ -1680,12 +1659,12 @@ function PaperStageScene({
|
|
|
1680
1659
|
frozen: reducedMotion
|
|
1681
1660
|
}
|
|
1682
1661
|
),
|
|
1683
|
-
settings.grade && /* @__PURE__ */ jsx7(
|
|
1662
|
+
settings.grade && /* @__PURE__ */ jsx7(GradePass, { grade: stage.grade, film: rig.film })
|
|
1684
1663
|
] });
|
|
1685
1664
|
}
|
|
1686
1665
|
function PaperStage({ children, className, style, ...sceneProps }) {
|
|
1687
1666
|
const dpr = qualityFor(sceneProps.quality ?? "auto").dpr;
|
|
1688
|
-
return /* @__PURE__ */ jsx7("div", { className, style: { width: "100%", height: "100%", ...style }, children: /* @__PURE__ */
|
|
1667
|
+
return /* @__PURE__ */ jsx7("div", { className, style: { width: "100%", height: "100%", ...style }, children: /* @__PURE__ */ jsxs5(
|
|
1689
1668
|
Canvas,
|
|
1690
1669
|
{
|
|
1691
1670
|
shadows: true,
|
|
@@ -2187,8 +2166,9 @@ function buildStageAgentPayload(input) {
|
|
|
2187
2166
|
npm i paperlab three @react-three/fiber gsap @react-three/postprocessing postprocessing
|
|
2188
2167
|
|
|
2189
2168
|
The last two are only needed by stage mode \u2014 <Paper> and <PaperField> do
|
|
2190
|
-
not use them \u2014
|
|
2191
|
-
|
|
2169
|
+
not use them \u2014 and they are optional even here: <PaperStage> loads the
|
|
2170
|
+
print pass on demand, so a stage without them renders, just without the
|
|
2171
|
+
tone curve, bloom, vignette and grain. Install them to get the grade.
|
|
2192
2172
|
|
|
2193
2173
|
2. Create the component below as \`components/${name}.tsx\` (or the project's
|
|
2194
2174
|
component convention). It is self-contained \u2014 it owns its own <Canvas>,
|