paperlab 0.4.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 +20 -18
- package/dist/{chunk-4ZU5DZEF.js → chunk-HRXQTJFS.js} +526 -225
- package/dist/chunk-HRXQTJFS.js.map +1 -0
- package/dist/index.cjs +590 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -65
- package/dist/index.d.ts +36 -65
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/slots-CIo7FnlY.d.cts +13357 -0
- package/dist/slots-CIo7FnlY.d.ts +13357 -0
- package/dist/stage.cjs +2448 -2159
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.d.cts +52 -28
- package/dist/stage.d.ts +52 -28
- package/dist/stage.js +41 -15
- package/dist/stage.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-4ZU5DZEF.js.map +0 -1
- package/dist/slots-BYoLxVZ4.d.cts +0 -6008
- package/dist/slots-BYoLxVZ4.d.ts +0 -6008
package/dist/stage.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { F as FieldPaperSlot, a as PaperConfigInput } from './slots-
|
|
2
|
+
import { F as FieldPaperSlot, a as PaperConfigInput } from './slots-CIo7FnlY.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -218,15 +218,15 @@ declare const stageSchema: z.ZodObject<{
|
|
|
218
218
|
spread: z.ZodDefault<z.ZodNumber>;
|
|
219
219
|
}, "strip", z.ZodTypeAny, {
|
|
220
220
|
color: string;
|
|
221
|
-
enabled: boolean;
|
|
222
221
|
spread: number;
|
|
222
|
+
enabled: boolean;
|
|
223
223
|
zenith: string;
|
|
224
224
|
beyond: number;
|
|
225
225
|
surround: boolean;
|
|
226
226
|
}, {
|
|
227
227
|
color?: string | undefined;
|
|
228
|
-
enabled?: boolean | undefined;
|
|
229
228
|
spread?: number | undefined;
|
|
229
|
+
enabled?: boolean | undefined;
|
|
230
230
|
zenith?: string | undefined;
|
|
231
231
|
beyond?: number | undefined;
|
|
232
232
|
surround?: boolean | undefined;
|
|
@@ -478,6 +478,17 @@ declare const stageSchema: z.ZodObject<{
|
|
|
478
478
|
closed: boolean;
|
|
479
479
|
};
|
|
480
480
|
lighting: "studio" | "window" | "leaves" | "goldenhour" | "noir" | "nave" | "raking" | "lightbox";
|
|
481
|
+
light: {
|
|
482
|
+
key?: number | undefined;
|
|
483
|
+
height?: number | undefined;
|
|
484
|
+
color?: string | undefined;
|
|
485
|
+
studio?: number | undefined;
|
|
486
|
+
exposure?: number | undefined;
|
|
487
|
+
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
488
|
+
direction?: number | undefined;
|
|
489
|
+
ambient?: number | undefined;
|
|
490
|
+
haze?: number | undefined;
|
|
491
|
+
};
|
|
481
492
|
figure: {
|
|
482
493
|
height: number;
|
|
483
494
|
speed: number;
|
|
@@ -490,23 +501,12 @@ declare const stageSchema: z.ZodObject<{
|
|
|
490
501
|
};
|
|
491
502
|
source: {
|
|
492
503
|
color: string;
|
|
493
|
-
enabled: boolean;
|
|
494
504
|
spread: number;
|
|
505
|
+
enabled: boolean;
|
|
495
506
|
zenith: string;
|
|
496
507
|
beyond: number;
|
|
497
508
|
surround: boolean;
|
|
498
509
|
};
|
|
499
|
-
light: {
|
|
500
|
-
key?: number | undefined;
|
|
501
|
-
height?: number | undefined;
|
|
502
|
-
color?: string | undefined;
|
|
503
|
-
studio?: number | undefined;
|
|
504
|
-
exposure?: number | undefined;
|
|
505
|
-
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
506
|
-
direction?: number | undefined;
|
|
507
|
-
ambient?: number | undefined;
|
|
508
|
-
haze?: number | undefined;
|
|
509
|
-
};
|
|
510
510
|
shot: {
|
|
511
511
|
height: number;
|
|
512
512
|
offset: number;
|
|
@@ -555,6 +555,17 @@ declare const stageSchema: z.ZodObject<{
|
|
|
555
555
|
closed?: boolean | undefined;
|
|
556
556
|
} | undefined;
|
|
557
557
|
lighting?: "studio" | "window" | "leaves" | "goldenhour" | "noir" | "nave" | "raking" | "lightbox" | undefined;
|
|
558
|
+
light?: {
|
|
559
|
+
key?: number | undefined;
|
|
560
|
+
height?: number | undefined;
|
|
561
|
+
color?: string | undefined;
|
|
562
|
+
studio?: number | undefined;
|
|
563
|
+
exposure?: number | undefined;
|
|
564
|
+
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
565
|
+
direction?: number | undefined;
|
|
566
|
+
ambient?: number | undefined;
|
|
567
|
+
haze?: number | undefined;
|
|
568
|
+
} | undefined;
|
|
558
569
|
figure?: {
|
|
559
570
|
height?: number | undefined;
|
|
560
571
|
speed?: number | undefined;
|
|
@@ -567,23 +578,12 @@ declare const stageSchema: z.ZodObject<{
|
|
|
567
578
|
} | undefined;
|
|
568
579
|
source?: {
|
|
569
580
|
color?: string | undefined;
|
|
570
|
-
enabled?: boolean | undefined;
|
|
571
581
|
spread?: number | undefined;
|
|
582
|
+
enabled?: boolean | undefined;
|
|
572
583
|
zenith?: string | undefined;
|
|
573
584
|
beyond?: number | undefined;
|
|
574
585
|
surround?: boolean | undefined;
|
|
575
586
|
} | undefined;
|
|
576
|
-
light?: {
|
|
577
|
-
key?: number | undefined;
|
|
578
|
-
height?: number | undefined;
|
|
579
|
-
color?: string | undefined;
|
|
580
|
-
studio?: number | undefined;
|
|
581
|
-
exposure?: number | undefined;
|
|
582
|
-
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
583
|
-
direction?: number | undefined;
|
|
584
|
-
ambient?: number | undefined;
|
|
585
|
-
haze?: number | undefined;
|
|
586
|
-
} | undefined;
|
|
587
587
|
shot?: {
|
|
588
588
|
height?: number | undefined;
|
|
589
589
|
offset?: number | undefined;
|
|
@@ -739,6 +739,28 @@ declare const qualityNames: readonly ["auto", "low", "medium", "high"];
|
|
|
739
739
|
type QualityName = (typeof qualityNames)[number];
|
|
740
740
|
type QualityTier = Exclude<QualityName, 'auto'>;
|
|
741
741
|
|
|
742
|
+
/**
|
|
743
|
+
* Stage mode: paper as architecture, with a figure walking through it.
|
|
744
|
+
*
|
|
745
|
+
* The one guarantee worth stating — every part of the scene reads the SAME
|
|
746
|
+
* walk. The layout arranges along it, the figure follows it, the camera is
|
|
747
|
+
* stationed on it, and the source stands at the end of it. Handing those
|
|
748
|
+
* four their own copies of a path is the failure this component exists to
|
|
749
|
+
* prevent: a colonnade whose aisle the figure does not walk down is not a
|
|
750
|
+
* near-miss, it is a completely different picture.
|
|
751
|
+
*/
|
|
752
|
+
/** A banner: tall, translucent, with folds running the length of its drop. */
|
|
753
|
+
/**
|
|
754
|
+
* The sheet a stage hangs when the caller does not name one.
|
|
755
|
+
*
|
|
756
|
+
* Exported because it is the base anyone RESHAPING a banner has to start
|
|
757
|
+
* from. A caller who wants a wider drop wants this stock, this grain and
|
|
758
|
+
* this drape with different dimensions — and rebuilding it from the schema
|
|
759
|
+
* defaults instead gives a sheet of printer paper with no fold in it, which
|
|
760
|
+
* is a different object. A second copy of these numbers in a caller is a
|
|
761
|
+
* copy free to drift from the one the scene actually falls back to.
|
|
762
|
+
*/
|
|
763
|
+
declare const stageBanner: PaperConfigInput;
|
|
742
764
|
interface PaperStageSceneProps {
|
|
743
765
|
/** Walk, shot, figure, lighting — see `stageSchema`. */
|
|
744
766
|
stage?: StageConfigInput;
|
|
@@ -962,6 +984,8 @@ interface StageExportInput {
|
|
|
962
984
|
paper?: PaperConfigInput;
|
|
963
985
|
/** The words the space is built from. Omitted renders blank banners. */
|
|
964
986
|
text?: string;
|
|
987
|
+
/** Pictures on the banners, one per drop, instead of words. */
|
|
988
|
+
images?: string[];
|
|
965
989
|
count?: number;
|
|
966
990
|
/** Bind the walk to page scroll, pinned, rather than to the clock. */
|
|
967
991
|
scroll?: boolean;
|
|
@@ -977,4 +1001,4 @@ declare function buildStageComponentSource(input: StageExportInput): string;
|
|
|
977
1001
|
/** The self-contained stage integration brief — one paste into a coding agent. */
|
|
978
1002
|
declare function buildStageAgentPayload(input: StageExportInput): string;
|
|
979
1003
|
|
|
980
|
-
export { type Ground, PaperStage, type PaperStageProps, PaperStageScene, type PaperStageSceneProps, type QualityName, type QualityTier, type ShotName, type ShotOptions, type StageConfig, type StageConfigInput, type StageExportInput, type StageGradeConfig, type StageMotion, type StageMotionInput, type StagePreset, type StageScale, type StageShot, type WalkName, type WalkPath, type WalkPathOptions, buildStageAgentPayload, buildStageComponentSource, createWalkPath, describeStage, diffStage, getStagePreset, getWalk, listStagePresets, qualityNames, shotNames, stagePresets, stageSchema, walkNames, walks };
|
|
1004
|
+
export { type Ground, PaperStage, type PaperStageProps, PaperStageScene, type PaperStageSceneProps, type QualityName, type QualityTier, type ShotName, type ShotOptions, type StageConfig, type StageConfigInput, type StageExportInput, type StageGradeConfig, type StageMotion, type StageMotionInput, type StagePreset, type StageScale, type StageShot, type WalkName, type WalkPath, type WalkPathOptions, buildStageAgentPayload, buildStageComponentSource, createWalkPath, describeStage, diffStage, getStagePreset, getWalk, listStagePresets, qualityNames, shotNames, stageBanner, stagePresets, stageSchema, walkNames, walks };
|
package/dist/stage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { F as FieldPaperSlot, a as PaperConfigInput } from './slots-
|
|
2
|
+
import { F as FieldPaperSlot, a as PaperConfigInput } from './slots-CIo7FnlY.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -218,15 +218,15 @@ declare const stageSchema: z.ZodObject<{
|
|
|
218
218
|
spread: z.ZodDefault<z.ZodNumber>;
|
|
219
219
|
}, "strip", z.ZodTypeAny, {
|
|
220
220
|
color: string;
|
|
221
|
-
enabled: boolean;
|
|
222
221
|
spread: number;
|
|
222
|
+
enabled: boolean;
|
|
223
223
|
zenith: string;
|
|
224
224
|
beyond: number;
|
|
225
225
|
surround: boolean;
|
|
226
226
|
}, {
|
|
227
227
|
color?: string | undefined;
|
|
228
|
-
enabled?: boolean | undefined;
|
|
229
228
|
spread?: number | undefined;
|
|
229
|
+
enabled?: boolean | undefined;
|
|
230
230
|
zenith?: string | undefined;
|
|
231
231
|
beyond?: number | undefined;
|
|
232
232
|
surround?: boolean | undefined;
|
|
@@ -478,6 +478,17 @@ declare const stageSchema: z.ZodObject<{
|
|
|
478
478
|
closed: boolean;
|
|
479
479
|
};
|
|
480
480
|
lighting: "studio" | "window" | "leaves" | "goldenhour" | "noir" | "nave" | "raking" | "lightbox";
|
|
481
|
+
light: {
|
|
482
|
+
key?: number | undefined;
|
|
483
|
+
height?: number | undefined;
|
|
484
|
+
color?: string | undefined;
|
|
485
|
+
studio?: number | undefined;
|
|
486
|
+
exposure?: number | undefined;
|
|
487
|
+
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
488
|
+
direction?: number | undefined;
|
|
489
|
+
ambient?: number | undefined;
|
|
490
|
+
haze?: number | undefined;
|
|
491
|
+
};
|
|
481
492
|
figure: {
|
|
482
493
|
height: number;
|
|
483
494
|
speed: number;
|
|
@@ -490,23 +501,12 @@ declare const stageSchema: z.ZodObject<{
|
|
|
490
501
|
};
|
|
491
502
|
source: {
|
|
492
503
|
color: string;
|
|
493
|
-
enabled: boolean;
|
|
494
504
|
spread: number;
|
|
505
|
+
enabled: boolean;
|
|
495
506
|
zenith: string;
|
|
496
507
|
beyond: number;
|
|
497
508
|
surround: boolean;
|
|
498
509
|
};
|
|
499
|
-
light: {
|
|
500
|
-
key?: number | undefined;
|
|
501
|
-
height?: number | undefined;
|
|
502
|
-
color?: string | undefined;
|
|
503
|
-
studio?: number | undefined;
|
|
504
|
-
exposure?: number | undefined;
|
|
505
|
-
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
506
|
-
direction?: number | undefined;
|
|
507
|
-
ambient?: number | undefined;
|
|
508
|
-
haze?: number | undefined;
|
|
509
|
-
};
|
|
510
510
|
shot: {
|
|
511
511
|
height: number;
|
|
512
512
|
offset: number;
|
|
@@ -555,6 +555,17 @@ declare const stageSchema: z.ZodObject<{
|
|
|
555
555
|
closed?: boolean | undefined;
|
|
556
556
|
} | undefined;
|
|
557
557
|
lighting?: "studio" | "window" | "leaves" | "goldenhour" | "noir" | "nave" | "raking" | "lightbox" | undefined;
|
|
558
|
+
light?: {
|
|
559
|
+
key?: number | undefined;
|
|
560
|
+
height?: number | undefined;
|
|
561
|
+
color?: string | undefined;
|
|
562
|
+
studio?: number | undefined;
|
|
563
|
+
exposure?: number | undefined;
|
|
564
|
+
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
565
|
+
direction?: number | undefined;
|
|
566
|
+
ambient?: number | undefined;
|
|
567
|
+
haze?: number | undefined;
|
|
568
|
+
} | undefined;
|
|
558
569
|
figure?: {
|
|
559
570
|
height?: number | undefined;
|
|
560
571
|
speed?: number | undefined;
|
|
@@ -567,23 +578,12 @@ declare const stageSchema: z.ZodObject<{
|
|
|
567
578
|
} | undefined;
|
|
568
579
|
source?: {
|
|
569
580
|
color?: string | undefined;
|
|
570
|
-
enabled?: boolean | undefined;
|
|
571
581
|
spread?: number | undefined;
|
|
582
|
+
enabled?: boolean | undefined;
|
|
572
583
|
zenith?: string | undefined;
|
|
573
584
|
beyond?: number | undefined;
|
|
574
585
|
surround?: boolean | undefined;
|
|
575
586
|
} | undefined;
|
|
576
|
-
light?: {
|
|
577
|
-
key?: number | undefined;
|
|
578
|
-
height?: number | undefined;
|
|
579
|
-
color?: string | undefined;
|
|
580
|
-
studio?: number | undefined;
|
|
581
|
-
exposure?: number | undefined;
|
|
582
|
-
film?: "agx" | "neutral" | "filmic" | undefined;
|
|
583
|
-
direction?: number | undefined;
|
|
584
|
-
ambient?: number | undefined;
|
|
585
|
-
haze?: number | undefined;
|
|
586
|
-
} | undefined;
|
|
587
587
|
shot?: {
|
|
588
588
|
height?: number | undefined;
|
|
589
589
|
offset?: number | undefined;
|
|
@@ -739,6 +739,28 @@ declare const qualityNames: readonly ["auto", "low", "medium", "high"];
|
|
|
739
739
|
type QualityName = (typeof qualityNames)[number];
|
|
740
740
|
type QualityTier = Exclude<QualityName, 'auto'>;
|
|
741
741
|
|
|
742
|
+
/**
|
|
743
|
+
* Stage mode: paper as architecture, with a figure walking through it.
|
|
744
|
+
*
|
|
745
|
+
* The one guarantee worth stating — every part of the scene reads the SAME
|
|
746
|
+
* walk. The layout arranges along it, the figure follows it, the camera is
|
|
747
|
+
* stationed on it, and the source stands at the end of it. Handing those
|
|
748
|
+
* four their own copies of a path is the failure this component exists to
|
|
749
|
+
* prevent: a colonnade whose aisle the figure does not walk down is not a
|
|
750
|
+
* near-miss, it is a completely different picture.
|
|
751
|
+
*/
|
|
752
|
+
/** A banner: tall, translucent, with folds running the length of its drop. */
|
|
753
|
+
/**
|
|
754
|
+
* The sheet a stage hangs when the caller does not name one.
|
|
755
|
+
*
|
|
756
|
+
* Exported because it is the base anyone RESHAPING a banner has to start
|
|
757
|
+
* from. A caller who wants a wider drop wants this stock, this grain and
|
|
758
|
+
* this drape with different dimensions — and rebuilding it from the schema
|
|
759
|
+
* defaults instead gives a sheet of printer paper with no fold in it, which
|
|
760
|
+
* is a different object. A second copy of these numbers in a caller is a
|
|
761
|
+
* copy free to drift from the one the scene actually falls back to.
|
|
762
|
+
*/
|
|
763
|
+
declare const stageBanner: PaperConfigInput;
|
|
742
764
|
interface PaperStageSceneProps {
|
|
743
765
|
/** Walk, shot, figure, lighting — see `stageSchema`. */
|
|
744
766
|
stage?: StageConfigInput;
|
|
@@ -962,6 +984,8 @@ interface StageExportInput {
|
|
|
962
984
|
paper?: PaperConfigInput;
|
|
963
985
|
/** The words the space is built from. Omitted renders blank banners. */
|
|
964
986
|
text?: string;
|
|
987
|
+
/** Pictures on the banners, one per drop, instead of words. */
|
|
988
|
+
images?: string[];
|
|
965
989
|
count?: number;
|
|
966
990
|
/** Bind the walk to page scroll, pinned, rather than to the clock. */
|
|
967
991
|
scroll?: boolean;
|
|
@@ -977,4 +1001,4 @@ declare function buildStageComponentSource(input: StageExportInput): string;
|
|
|
977
1001
|
/** The self-contained stage integration brief — one paste into a coding agent. */
|
|
978
1002
|
declare function buildStageAgentPayload(input: StageExportInput): string;
|
|
979
1003
|
|
|
980
|
-
export { type Ground, PaperStage, type PaperStageProps, PaperStageScene, type PaperStageSceneProps, type QualityName, type QualityTier, type ShotName, type ShotOptions, type StageConfig, type StageConfigInput, type StageExportInput, type StageGradeConfig, type StageMotion, type StageMotionInput, type StagePreset, type StageScale, type StageShot, type WalkName, type WalkPath, type WalkPathOptions, buildStageAgentPayload, buildStageComponentSource, createWalkPath, describeStage, diffStage, getStagePreset, getWalk, listStagePresets, qualityNames, shotNames, stagePresets, stageSchema, walkNames, walks };
|
|
1004
|
+
export { type Ground, PaperStage, type PaperStageProps, PaperStageScene, type PaperStageSceneProps, type QualityName, type QualityTier, type ShotName, type ShotOptions, type StageConfig, type StageConfigInput, type StageExportInput, type StageGradeConfig, type StageMotion, type StageMotionInput, type StagePreset, type StageScale, type StageShot, type WalkName, type WalkPath, type WalkPathOptions, buildStageAgentPayload, buildStageComponentSource, createWalkPath, describeStage, diffStage, getStagePreset, getWalk, listStagePresets, qualityNames, shotNames, stageBanner, stagePresets, stageSchema, walkNames, walks };
|
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";
|
|
@@ -136,7 +137,7 @@ var figureSchema = z2.object({
|
|
|
136
137
|
/** Arm swing, 0..1. Drop it toward 0 for hands-in-pockets stillness. */
|
|
137
138
|
swing: z2.number().min(0).max(1).default(1),
|
|
138
139
|
/** Silhouette color. Near-black by default: it should read as an absence, not an object. */
|
|
139
|
-
color: z2.string().default("#0a0a0c"),
|
|
140
|
+
color: z2.string().default("#0a0a0c").describe("color"),
|
|
140
141
|
/**
|
|
141
142
|
* How the figure takes light.
|
|
142
143
|
*
|
|
@@ -838,7 +839,7 @@ import { z as z3 } from "zod";
|
|
|
838
839
|
var stageSourceSchema = z3.object({
|
|
839
840
|
/** The bright void the walk resolves toward. Without it the vanishing point is a hole. */
|
|
840
841
|
enabled: z3.boolean().default(true),
|
|
841
|
-
color: z3.string().default("#fff4e2"),
|
|
842
|
+
color: z3.string().default("#fff4e2").describe("color"),
|
|
842
843
|
/** How far past the end of the walk it stands, world units. */
|
|
843
844
|
beyond: z3.number().min(0).max(80).default(10),
|
|
844
845
|
/**
|
|
@@ -870,7 +871,7 @@ var stageGroundSchema = z3.object({
|
|
|
870
871
|
* kept its contrast against the source and gained a surface you can read
|
|
871
872
|
* the size of the room from.
|
|
872
873
|
*/
|
|
873
|
-
color: z3.string().default("#241e19"),
|
|
874
|
+
color: z3.string().default("#241e19").describe("color"),
|
|
874
875
|
/**
|
|
875
876
|
* Width of one poured slab, in world units. 0 leaves the floor unseamed.
|
|
876
877
|
*
|
|
@@ -894,7 +895,7 @@ var stageSuspensionSchema = z3.object({
|
|
|
894
895
|
* paper is meant to be impossible.
|
|
895
896
|
*/
|
|
896
897
|
type: z3.enum(["none", "thread", "rod"]).default("thread"),
|
|
897
|
-
color: z3.string().default("#9c948a"),
|
|
898
|
+
color: z3.string().default("#9c948a").describe("color"),
|
|
898
899
|
/**
|
|
899
900
|
* What grips the sheet.
|
|
900
901
|
*
|
|
@@ -935,13 +936,13 @@ var stageColumnsSchema = z3.object({
|
|
|
935
936
|
* more banners, and the eye stops being able to tell what the room is made
|
|
936
937
|
* of from what is hanging in it.
|
|
937
938
|
*/
|
|
938
|
-
color: z3.string().default("#5c554d")
|
|
939
|
+
color: z3.string().default("#5c554d").describe("color")
|
|
939
940
|
});
|
|
940
941
|
var stageDoorwaySchema = z3.object({
|
|
941
942
|
enabled: z3.boolean().default(false),
|
|
942
943
|
/** Opening size, as a multiple of the source's own. 1 frames it exactly. */
|
|
943
944
|
opening: z3.number().min(0.2).max(3).default(1.05),
|
|
944
|
-
color: z3.string().default("#171310")
|
|
945
|
+
color: z3.string().default("#171310").describe("color")
|
|
945
946
|
});
|
|
946
947
|
var stageRoomSchema = z3.object({
|
|
947
948
|
enabled: z3.boolean().default(true),
|
|
@@ -954,7 +955,7 @@ var stageRoomSchema = z3.object({
|
|
|
954
955
|
* happened to be scaled to that day.
|
|
955
956
|
*/
|
|
956
957
|
height: z3.number().min(1).max(6).default(2.2),
|
|
957
|
-
color: z3.string().default("#171310"),
|
|
958
|
+
color: z3.string().default("#171310").describe("color"),
|
|
958
959
|
/** Columns flanking the walk — see `stageColumnsSchema`. */
|
|
959
960
|
columns: stageColumnsSchema.default({}),
|
|
960
961
|
/** A wall at the end of the walk with the source in it. */
|
|
@@ -1388,12 +1389,13 @@ function settleTier(tier, fps, failed) {
|
|
|
1388
1389
|
|
|
1389
1390
|
// src/stage/PaperStage.tsx
|
|
1390
1391
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1391
|
-
var
|
|
1392
|
+
var stageBanner = {
|
|
1392
1393
|
sheet: { width: 1.5, height: 8.5, segments: "auto" },
|
|
1393
1394
|
stock: "vellum",
|
|
1394
1395
|
surface: { grain: 0.22 },
|
|
1395
1396
|
deformers: [{ type: "drape", options: { amplitude: 0.16, folds: 3, falloff: 1.7, gather: 0.28 } }]
|
|
1396
1397
|
};
|
|
1398
|
+
var BANNER = stageBanner;
|
|
1397
1399
|
function splitAcrossBanners(text, banners) {
|
|
1398
1400
|
const words = text.split(/\s+/).filter(Boolean);
|
|
1399
1401
|
if (words.length === 0 || banners <= 0) return [];
|
|
@@ -1693,7 +1695,8 @@ function PaperStage({ children, className, style, ...sceneProps }) {
|
|
|
1693
1695
|
},
|
|
1694
1696
|
children: [
|
|
1695
1697
|
/* @__PURE__ */ jsx7(PaperStageScene, { ...sceneProps }),
|
|
1696
|
-
children
|
|
1698
|
+
children,
|
|
1699
|
+
/* @__PURE__ */ jsx7(ReleaseContextOnUnmount, {})
|
|
1697
1700
|
]
|
|
1698
1701
|
}
|
|
1699
1702
|
) });
|
|
@@ -2051,6 +2054,8 @@ function describeStage(input) {
|
|
|
2051
2054
|
parts.push(`${count} tall paper banners standing along ${shape}`);
|
|
2052
2055
|
if (input.text?.trim()) {
|
|
2053
2056
|
parts.push("each printed with a column of your text running down it");
|
|
2057
|
+
} else if (input.images?.length) {
|
|
2058
|
+
parts.push(`each printed with one of ${input.images.length} pictures`);
|
|
2054
2059
|
}
|
|
2055
2060
|
parts.push(`seen ${SHOT_PHRASES[stage.shot.shot]}`);
|
|
2056
2061
|
if (stage.showFigure) {
|
|
@@ -2064,13 +2069,27 @@ function describeStage(input) {
|
|
|
2064
2069
|
);
|
|
2065
2070
|
const moved = Object.entries(stage.light).filter(([, value]) => value !== void 0).map(([key]) => key);
|
|
2066
2071
|
if (moved.length > 0) parts.push(`with its ${moved.join(", ")} set by hand`);
|
|
2067
|
-
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
|
+
}
|
|
2068
2077
|
return parts.join(", ");
|
|
2069
2078
|
}
|
|
2079
|
+
function exportableImages(images) {
|
|
2080
|
+
let substituted = false;
|
|
2081
|
+
const list = images.map((src, i) => {
|
|
2082
|
+
if (!src.startsWith("data:")) return src;
|
|
2083
|
+
substituted = true;
|
|
2084
|
+
return `/banner-${i + 1}.jpg`;
|
|
2085
|
+
});
|
|
2086
|
+
return { list, substituted };
|
|
2087
|
+
}
|
|
2070
2088
|
function propLines(input, indent) {
|
|
2071
2089
|
const lines = [];
|
|
2072
2090
|
if (input.paper) lines.push(`${indent}preset={banner}`);
|
|
2073
2091
|
if (input.text?.trim()) lines.push(`${indent}text={text}`);
|
|
2092
|
+
if (input.images?.length) lines.push(`${indent}images={images}`);
|
|
2074
2093
|
if (input.count !== void 0) lines.push(`${indent}count={${input.count}}`);
|
|
2075
2094
|
if (input.layout !== "colonnade") lines.push(`${indent}layout="${input.layout}"`);
|
|
2076
2095
|
const layoutOptions = input.layoutOptions ?? {};
|
|
@@ -2095,10 +2114,15 @@ const banner = ${stringifyStage(diffConfig(paperConfigSchema.parse(input.paper))
|
|
|
2095
2114
|
const textConst = input.text?.trim() ? `
|
|
2096
2115
|
|
|
2097
2116
|
const text = ${JSON.stringify(input.text)}` : "";
|
|
2117
|
+
const scrolls = stageSchema.parse(input.stage).showFigure ? "walk the figure" : "move the camera";
|
|
2118
|
+
const images = input.images?.length ? exportableImages(input.images) : null;
|
|
2119
|
+
const imagesConst = images ? `
|
|
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." : ""}
|
|
2121
|
+
const images = ${JSON.stringify(images.list, null, 2)}` : "";
|
|
2098
2122
|
if (!input.scroll) {
|
|
2099
2123
|
return `import { PaperStage, type StageConfigInput } from 'paperlab/stage'${input.paper ? "\nimport type { PaperConfigInput } from 'paperlab'" : ""}
|
|
2100
2124
|
|
|
2101
|
-
${stageConst}${bannerConst}${textConst}
|
|
2125
|
+
${stageConst}${bannerConst}${textConst}${imagesConst}
|
|
2102
2126
|
|
|
2103
2127
|
export function ${name}() {
|
|
2104
2128
|
return (
|
|
@@ -2111,13 +2135,13 @@ ${propLines(input, " ")}
|
|
|
2111
2135
|
return `import { useEffect, useRef, useState } from 'react'
|
|
2112
2136
|
import { PaperStage, type StageConfigInput } from 'paperlab/stage'${input.paper ? "\nimport type { PaperConfigInput } from 'paperlab'" : ""}
|
|
2113
2137
|
|
|
2114
|
-
${stageConst}${bannerConst}${textConst}
|
|
2138
|
+
${stageConst}${bannerConst}${textConst}${imagesConst}
|
|
2115
2139
|
|
|
2116
2140
|
export function ${name}() {
|
|
2117
2141
|
const ref = useRef<HTMLDivElement>(null)
|
|
2118
2142
|
const [progress, setProgress] = useState(0)
|
|
2119
2143
|
|
|
2120
|
-
// Scroll the section,
|
|
2144
|
+
// Scroll the section, ${scrolls}. The stage is pinned for the height
|
|
2121
2145
|
// of the section, so the page scrolling past it IS the walk.
|
|
2122
2146
|
useEffect(() => {
|
|
2123
2147
|
const el = ref.current
|
|
@@ -2154,7 +2178,8 @@ function buildStageAgentPayload(input) {
|
|
|
2154
2178
|
heights of scroll and pins the canvas inside that. Drop it into the page
|
|
2155
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;
|
|
2156
2180
|
give the parent an explicit height.`;
|
|
2157
|
-
|
|
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})
|
|
2158
2183
|
|
|
2159
2184
|
1. Install the dependencies:
|
|
2160
2185
|
|
|
@@ -2199,6 +2224,7 @@ export {
|
|
|
2199
2224
|
listStagePresets,
|
|
2200
2225
|
qualityNames,
|
|
2201
2226
|
shotNames,
|
|
2227
|
+
stageBanner,
|
|
2202
2228
|
stagePresets,
|
|
2203
2229
|
stageSchema,
|
|
2204
2230
|
walkNames,
|