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/dist/stage.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  resolveLighting,
17
17
  usePrefersReducedMotion,
18
18
  walkPathSchema
19
- } from "./chunk-HRXQTJFS.js";
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 rgb = `${c.r * 255 | 0}, ${c.g * 255 | 0}, ${c.b * 255 | 0}`;
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
- glow.addColorStop(stop, `rgba(${rgb}, ${alpha})`);
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.default({}),
961
+ columns: stageColumnsSchema.prefault({}),
961
962
  /** A wall at the end of the walk with the source in it. */
962
- doorway: stageDoorwaySchema.default({})
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.default({}),
1017
- shot: shotSchema.default({}),
1018
- figure: figureSchema.default({}),
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.default({}),
1046
- ground: stageGroundSchema.default({}),
1046
+ source: stageSourceSchema.prefault({}),
1047
+ ground: stageGroundSchema.prefault({}),
1047
1048
  /** Ceiling and the architecture around the walk — see `stageRoomSchema`. */
1048
- room: stageRoomSchema.default({}),
1049
+ room: stageRoomSchema.prefault({}),
1049
1050
  /** Thread and clips — see `stageSuspensionSchema`. */
1050
- suspension: stageSuspensionSchema.default({}),
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.default({})
1063
+ grade: stageGradeSchema.prefault({})
1063
1064
  });
1064
1065
 
1065
1066
  // src/stage/navigate.ts