paperlab 0.5.1 → 0.6.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 +21 -6
- package/dist/{chunk-HRXQTJFS.js → chunk-E22ILEDO.js} +2408 -486
- package/dist/chunk-E22ILEDO.js.map +1 -0
- package/dist/index.cjs +2365 -435
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +175 -29
- package/dist/index.d.ts +175 -29
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/slots-C5PqY0Q5.d.cts +2297 -0
- package/dist/slots-C5PqY0Q5.d.ts +2297 -0
- package/dist/stage.cjs +2362 -452
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.d.cts +78 -636
- package/dist/stage.d.ts +78 -636
- package/dist/stage.js +15 -14
- package/dist/stage.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-HRXQTJFS.js.map +0 -1
- package/dist/slots-CIo7FnlY.d.cts +0 -13357
- package/dist/slots-CIo7FnlY.d.ts +0 -13357
package/dist/stage.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
resolveLighting,
|
|
17
17
|
usePrefersReducedMotion,
|
|
18
18
|
walkPathSchema
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-E22ILEDO.js";
|
|
20
20
|
|
|
21
21
|
// src/stage/PaperStage.tsx
|
|
22
22
|
import * as THREE6 from "three";
|
|
@@ -486,8 +486,7 @@ function makeGlowTexture(color) {
|
|
|
486
486
|
const ctx = canvas.getContext("2d");
|
|
487
487
|
const glow = ctx.createRadialGradient(size / 2, size / 2, 0, size / 2, size / 2, size / 2);
|
|
488
488
|
const c = new THREE3.Color(color);
|
|
489
|
-
const
|
|
490
|
-
for (const [stop, alpha] of [
|
|
489
|
+
for (const [stop, level] of [
|
|
491
490
|
[0, 1],
|
|
492
491
|
[0.5, 1],
|
|
493
492
|
[0.62, 0.66],
|
|
@@ -496,7 +495,8 @@ function makeGlowTexture(color) {
|
|
|
496
495
|
[0.94, 0.03],
|
|
497
496
|
[1, 0]
|
|
498
497
|
]) {
|
|
499
|
-
|
|
498
|
+
const scaled = `${c.r * 255 * level | 0}, ${c.g * 255 * level | 0}, ${c.b * 255 * level | 0}`;
|
|
499
|
+
glow.addColorStop(stop, `rgb(${scaled})`);
|
|
500
500
|
}
|
|
501
501
|
ctx.fillStyle = glow;
|
|
502
502
|
ctx.fillRect(0, 0, size, size);
|
|
@@ -521,6 +521,7 @@ function Source({
|
|
|
521
521
|
{
|
|
522
522
|
map: texture,
|
|
523
523
|
transparent: true,
|
|
524
|
+
blending: THREE3.AdditiveBlending,
|
|
524
525
|
color: new THREE3.Color(intensity, intensity, intensity),
|
|
525
526
|
depthWrite: false,
|
|
526
527
|
fog: false
|
|
@@ -957,9 +958,9 @@ var stageRoomSchema = z3.object({
|
|
|
957
958
|
height: z3.number().min(1).max(6).default(2.2),
|
|
958
959
|
color: z3.string().default("#171310").describe("color"),
|
|
959
960
|
/** Columns flanking the walk — see `stageColumnsSchema`. */
|
|
960
|
-
columns: stageColumnsSchema.
|
|
961
|
+
columns: stageColumnsSchema.prefault({}),
|
|
961
962
|
/** A wall at the end of the walk with the source in it. */
|
|
962
|
-
doorway: stageDoorwaySchema.
|
|
963
|
+
doorway: stageDoorwaySchema.prefault({})
|
|
963
964
|
});
|
|
964
965
|
var stageGradeSchema = z3.object({
|
|
965
966
|
/**
|
|
@@ -1013,9 +1014,9 @@ var stageGradeSchema = z3.object({
|
|
|
1013
1014
|
grain: z3.number().min(0).max(0.5).default(0.022)
|
|
1014
1015
|
});
|
|
1015
1016
|
var stageSchema = z3.object({
|
|
1016
|
-
path: walkPathSchema.
|
|
1017
|
-
shot: shotSchema.
|
|
1018
|
-
figure: figureSchema.
|
|
1017
|
+
path: walkPathSchema.prefault({}),
|
|
1018
|
+
shot: shotSchema.prefault({}),
|
|
1019
|
+
figure: figureSchema.prefault({}),
|
|
1019
1020
|
/** Stage mode is built for `nave`; the others are all front-lit. */
|
|
1020
1021
|
lighting: z3.enum(lightingNames).default("nave"),
|
|
1021
1022
|
/**
|
|
@@ -1042,12 +1043,12 @@ var stageSchema = z3.object({
|
|
|
1042
1043
|
* Still one flag away for anyone who wants it.
|
|
1043
1044
|
*/
|
|
1044
1045
|
showFigure: z3.boolean().default(false),
|
|
1045
|
-
source: stageSourceSchema.
|
|
1046
|
-
ground: stageGroundSchema.
|
|
1046
|
+
source: stageSourceSchema.prefault({}),
|
|
1047
|
+
ground: stageGroundSchema.prefault({}),
|
|
1047
1048
|
/** Ceiling and the architecture around the walk — see `stageRoomSchema`. */
|
|
1048
|
-
room: stageRoomSchema.
|
|
1049
|
+
room: stageRoomSchema.prefault({}),
|
|
1049
1050
|
/** Thread and clips — see `stageSuspensionSchema`. */
|
|
1050
|
-
suspension: stageSuspensionSchema.
|
|
1051
|
+
suspension: stageSuspensionSchema.prefault({}),
|
|
1051
1052
|
/**
|
|
1052
1053
|
* The print — bloom, vignette, grain.
|
|
1053
1054
|
*
|
|
@@ -1059,7 +1060,7 @@ var stageSchema = z3.object({
|
|
|
1059
1060
|
* behaviour: a stage silently losing its grade would be worse than a
|
|
1060
1061
|
* missing-module error that names the package.
|
|
1061
1062
|
*/
|
|
1062
|
-
grade: stageGradeSchema.
|
|
1063
|
+
grade: stageGradeSchema.prefault({})
|
|
1063
1064
|
});
|
|
1064
1065
|
|
|
1065
1066
|
// src/stage/navigate.ts
|