@oeave/bakery3 0.1.0 → 0.2.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.
Files changed (67) hide show
  1. package/README.md +10 -10
  2. package/dist/bake/index.d.ts +3 -3
  3. package/dist/bake/index.js +4 -4
  4. package/dist/{bake-DaOlenyx.d.ts → bake-DZ-CJR6f.d.ts} +8 -1
  5. package/dist/catalog/index.d.ts +5 -5
  6. package/dist/catalog/index.js +3 -3
  7. package/dist/{chunk-V3QINEEG.js → chunk-62M6XXNX.js} +58 -3
  8. package/dist/chunk-62M6XXNX.js.map +1 -0
  9. package/dist/{chunk-ARMTTZXZ.js → chunk-6FYI6AJM.js} +8 -8
  10. package/dist/chunk-6FYI6AJM.js.map +1 -0
  11. package/dist/{chunk-W6WQ5UP7.js → chunk-APWUCEEB.js} +32 -5
  12. package/dist/chunk-APWUCEEB.js.map +1 -0
  13. package/dist/{chunk-6YVQANMW.js → chunk-HNMSWQU7.js} +262 -16
  14. package/dist/chunk-HNMSWQU7.js.map +1 -0
  15. package/dist/{chunk-HQTUFVMM.js → chunk-JFYUDERE.js} +3 -3
  16. package/dist/chunk-JFYUDERE.js.map +1 -0
  17. package/dist/{chunk-TGFNQBKC.js → chunk-KNUAOILG.js} +5 -5
  18. package/dist/chunk-KNUAOILG.js.map +1 -0
  19. package/dist/chunk-KZLVTSBI.js +191 -0
  20. package/dist/chunk-KZLVTSBI.js.map +1 -0
  21. package/dist/{chunk-MD2U6S4N.js → chunk-LAKXC4WR.js} +218 -142
  22. package/dist/chunk-LAKXC4WR.js.map +1 -0
  23. package/dist/{chunk-25ZXSVQ3.js → chunk-NXBAZGNB.js} +3 -3
  24. package/dist/{chunk-25ZXSVQ3.js.map → chunk-NXBAZGNB.js.map} +1 -1
  25. package/dist/{chunk-54WJDN5R.js → chunk-QRCT5UGZ.js} +4 -4
  26. package/dist/{chunk-54WJDN5R.js.map → chunk-QRCT5UGZ.js.map} +1 -1
  27. package/dist/{chunk-APBOWWSV.js → chunk-UWBP7B54.js} +3 -3
  28. package/dist/chunk-UWBP7B54.js.map +1 -0
  29. package/dist/{chunk-WBIAFIHV.js → chunk-XK35ANPJ.js} +3 -3
  30. package/dist/{chunk-WBIAFIHV.js.map → chunk-XK35ANPJ.js.map} +1 -1
  31. package/dist/{chunk-CX4WTVGH.js → chunk-Z7IYVH22.js} +386 -97
  32. package/dist/chunk-Z7IYVH22.js.map +1 -0
  33. package/dist/devtools/index.d.ts +3 -3
  34. package/dist/devtools/index.js +9 -9
  35. package/dist/index.d.ts +39 -8
  36. package/dist/index.js +10 -10
  37. package/dist/node/index.cjs +266 -141
  38. package/dist/node/index.cjs.map +1 -1
  39. package/dist/node/index.d.cts +152 -87
  40. package/dist/node/index.d.ts +27 -6
  41. package/dist/node/index.js +52 -3
  42. package/dist/node/index.js.map +1 -1
  43. package/dist/{prepare-C5qVvaw4.d.ts → prepare-BtjY4G3q.d.ts} +1 -1
  44. package/dist/presets/index.d.ts +37 -1
  45. package/dist/presets/index.js +4 -4
  46. package/dist/presets/index.js.map +1 -1
  47. package/dist/r3f/index.d.ts +4 -4
  48. package/dist/r3f/index.js +12 -12
  49. package/dist/{room-S5TLCK4F.js → room-FS26KAPQ.js} +6 -6
  50. package/dist/{room-S5TLCK4F.js.map → room-FS26KAPQ.js.map} +1 -1
  51. package/dist/{rooms.gen-vhj6sFW5.d.ts → rooms.gen-DItzBR9k.d.ts} +112 -84
  52. package/dist/session-VCIQEO26.js +9 -0
  53. package/dist/{session-YCQS4MRH.js.map → session-VCIQEO26.js.map} +1 -1
  54. package/dist/{testRun-BIPXaVPb.d.ts → testRun-20OARnQr.d.ts} +12 -3
  55. package/package.json +1 -1
  56. package/dist/chunk-6YVQANMW.js.map +0 -1
  57. package/dist/chunk-AF5BIELI.js +0 -70
  58. package/dist/chunk-AF5BIELI.js.map +0 -1
  59. package/dist/chunk-APBOWWSV.js.map +0 -1
  60. package/dist/chunk-ARMTTZXZ.js.map +0 -1
  61. package/dist/chunk-CX4WTVGH.js.map +0 -1
  62. package/dist/chunk-HQTUFVMM.js.map +0 -1
  63. package/dist/chunk-MD2U6S4N.js.map +0 -1
  64. package/dist/chunk-TGFNQBKC.js.map +0 -1
  65. package/dist/chunk-V3QINEEG.js.map +0 -1
  66. package/dist/chunk-W6WQ5UP7.js.map +0 -1
  67. package/dist/session-YCQS4MRH.js +0 -9
@@ -1,5 +1,5 @@
1
1
  import { Object3D, Mesh } from 'three';
2
- import { B as BakeTextureSize, a as BakeQuality, b as BakeAtlas, c as BakeView } from './bake-DaOlenyx.js';
2
+ import { B as BakeTextureSize, a as BakeQuality, b as BakeAtlas, c as BakeView } from './bake-DZ-CJR6f.js';
3
3
 
4
4
  /**
5
5
  * The request half: a live scene becomes a `BakeSpec` plus its assets.
@@ -1,7 +1,7 @@
1
1
  import { P as PedestalPresetName, M as MaterialPresetName, a as PresetTextureSize, H as HdriPresetName } from '../catalog.gen-BM-aNf7n.js';
2
2
  export { b as HDRI_PRESETS, c as HdriPresetInfo, d as MATERIAL_PRESETS, e as MaterialPresetInfo, f as PEDESTAL_PRESETS, g as PedestalPresetInfo, h as PresetMapName } from '../catalog.gen-BM-aNf7n.js';
3
3
  import { Group, ColorRepresentation, MeshStandardMaterial, DataTexture, Texture, Object3D, Vector3, PerspectiveCamera } from 'three';
4
- import { a as RoomPresetLighting, R as RoomPresetName } from '../rooms.gen-vhj6sFW5.js';
4
+ import { a as RoomPresetLighting, R as RoomPresetName } from '../rooms.gen-DItzBR9k.js';
5
5
 
6
6
  /**
7
7
  * Where the preset library is served from.
@@ -373,6 +373,23 @@ type PresetRoomOptions = {
373
373
  * downloads them; `setPresetRoomPrebaked(room, false)` turns them off.
374
374
  */
375
375
  prebaked?: boolean;
376
+ /**
377
+ * Show the room's BAKED version when it has one for this lighting (see
378
+ * `ROOM_PRESETS[name].baked`): one optimized file with the room's traced
379
+ * light already in it, so the room in the page looks like its render and
380
+ * costs a few megabytes. Default true.
381
+ *
382
+ * It changes only what the page draws. A render still builds the real
383
+ * room, full geometry and full-size maps, under the same light the baked
384
+ * one was traced with. A bake covers your product, the stand and the
385
+ * product's shadow, traced in that real room.
386
+ *
387
+ * The room must be as published: another floor, walls, ceiling, sill,
388
+ * stand, map outside or picture is a room nobody baked, and `bake: true`
389
+ * and `lights: false` ask for the stand-in by name. In all of those, and
390
+ * when the baked file cannot be fetched, the page gets the stand-in.
391
+ */
392
+ baked?: boolean;
376
393
  baseUrl?: string;
377
394
  materialOptions?: PresetMaterialOptions;
378
395
  };
@@ -405,6 +422,17 @@ interface PresetRoom extends Group {
405
422
  * option), or with `null` when there is none for this room as it is.
406
423
  */
407
424
  prebaked: Promise<PresetRoomPrebake | null>;
425
+ /**
426
+ * `'baked'` when the page is showing the room's baked version, `'standIn'`
427
+ * when it is showing the stand-in. Set when `ready` resolves.
428
+ */
429
+ shown?: 'baked' | 'standIn';
430
+ /**
431
+ * In a baked room: what the product reflects, traced from where it
432
+ * stands. `scene.environment = room.userData.environment`. Absent in a
433
+ * stand-in.
434
+ */
435
+ environment?: Texture;
408
436
  [key: string]: any;
409
437
  };
410
438
  }
@@ -517,6 +545,14 @@ type RoomPresetInfo = {
517
545
  * its shadow. In the others a bake lights the whole room.
518
546
  */
519
547
  readonly prebaked: readonly RoomPresetLighting[];
548
+ /**
549
+ * The lighting modes this room has a baked version for. In those,
550
+ * `createPresetRoom()` shows the baked room in the browser (one optimized
551
+ * file with its traced light in it), a render builds the real room, and a
552
+ * bake covers only the product, its stand and its shadow. In the others
553
+ * the browser shows a lighter stand-in.
554
+ */
555
+ readonly baked: readonly RoomPresetLighting[];
520
556
  };
521
557
  /** Every preset room, by name. */
522
558
  declare const ROOM_PRESETS: {
@@ -1,9 +1,9 @@
1
- export { applyPresetRoomCamera, createPedestal, createPresetMaterial, createPresetRoom, createRoom, createSkyEnvironment, loadPresetEnvironment, loadPresetMaterial } from '../chunk-6YVQANMW.js';
2
- import '../chunk-AF5BIELI.js';
1
+ export { applyPresetRoomCamera, createPedestal, createPresetMaterial, createPresetRoom, createRoom, createSkyEnvironment, loadPresetEnvironment, loadPresetMaterial } from '../chunk-HNMSWQU7.js';
2
+ import '../chunk-KZLVTSBI.js';
3
3
  export { presetBaseUrl, setPresetBaseUrl } from '../chunk-4E5VV4QY.js';
4
- export { setPresetRoomPrebaked } from '../chunk-W6WQ5UP7.js';
4
+ export { setPresetRoomPrebaked } from '../chunk-APWUCEEB.js';
5
5
  export { HDRI_PRESETS, MATERIAL_PRESETS, PEDESTAL_PRESETS } from '../chunk-6NYR73Y7.js';
6
- import { ROOM_PRESETS } from '../chunk-MD2U6S4N.js';
6
+ import { ROOM_PRESETS } from '../chunk-LAKXC4WR.js';
7
7
  import '../chunk-3G5QL4F4.js';
8
8
 
9
9
  // src/presets/roomCatalog.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/presets/roomCatalog.ts"],"names":["ROOM_PRESETS"],"mappings":";;;;;;;;;AA6FO,IAAMA,aAAAA,GAET","file":"index.js","sourcesContent":["/**\n * The public face of the room catalog: `ROOM_PRESETS` as a developer reads\n * it.\n *\n * The generated record (`rooms.gen.ts`) carries everything the SDK and the\n * renderer agree on: the published build hash, the stand-in's file, the\n * preview's brightness and colour per mode, the sky's irradiance, the scene\n * complexity the estimator prices. None of that is anything a page decides\n * with, and all of it changes whenever a room is published again, so the\n * public type names only what a developer chooses or places by. The object\n * is the same one; the SDK's own code reads the full record from\n * `rooms.gen.ts`.\n */\n\nimport {\n ROOM_PRESETS as ROOM_RECORDS,\n type RoomPresetLighting,\n type RoomPresetName,\n} from './rooms.gen.js';\n\n/** A preset surface: a preset material and its tint. */\nexport type RoomPresetSurface = {\n readonly material: string;\n readonly color: string;\n};\n\n/** What a preset room is, as `ROOM_PRESETS[name]` lists it. */\nexport type RoomPresetInfo = {\n /** Its name for people, for a picker. */\n readonly label: string;\n /** A sentence about it, for a picker. */\n readonly description: string;\n /** Meters. Floor at y = 0, centered on the origin; north is −z. */\n readonly size: {\n readonly width: number;\n readonly height: number;\n readonly depth: number;\n };\n /** The lighting mode the room was designed under; any of the four can be asked for. */\n readonly lighting: RoomPresetLighting;\n /** The surfaces it comes with, which `createPresetRoom()` options replace. */\n readonly surfaces: {\n readonly floor: RoomPresetSurface;\n readonly walls: RoomPresetSurface;\n readonly ceiling: RoomPresetSurface;\n readonly sill: { readonly material: string };\n };\n /** What the product stands on, where, and how high its top is. */\n readonly stand: {\n readonly type: string | null;\n readonly material: string | null;\n readonly x: number;\n readonly z: number;\n readonly rotationDeg: number;\n readonly top: number;\n /** three.js axes, meters. `null` when the room has no stand. */\n readonly size: {\n readonly x: number;\n readonly y: number;\n readonly z: number;\n } | null;\n };\n /** The framing the room was designed with, in its own frame (`applyPresetRoomCamera`). */\n readonly camera: {\n readonly position: readonly [number, number, number];\n readonly target: readonly [number, number, number];\n readonly lensMm: number;\n readonly fstop: number | null;\n };\n /**\n * The pictures the room hangs, in the order it hangs them: which wall, and\n * how long the image's longest side is in meters. `createPresetRoom({\n * pictures })` fills them in this order.\n */\n readonly pictures: readonly {\n readonly wall: string;\n readonly size: number;\n }[];\n /**\n * The `toneMappingExposure` the room is designed for, per lighting mode;\n * `createPresetRoom()` leaves the current mode's on `userData.exposure`.\n */\n readonly exposure: Readonly<Record<RoomPresetLighting, number>>;\n /**\n * The lighting modes this room's own traced light is published for. In\n * those, `createPresetRoom()` shows it in the viewport, and a bake of a\n * product in the unmodified room covers only the product, its stand and\n * its shadow. In the others a bake lights the whole room.\n */\n readonly prebaked: readonly RoomPresetLighting[];\n};\n\n/** Every preset room, by name. */\nexport const ROOM_PRESETS: {\n readonly [Name in RoomPresetName]: RoomPresetInfo;\n} = ROOM_RECORDS;\n"]}
1
+ {"version":3,"sources":["../../src/presets/roomCatalog.ts"],"names":["ROOM_PRESETS"],"mappings":";;;;;;;;;AAqGO,IAAMA,aAAAA,GAET","file":"index.js","sourcesContent":["/**\n * The public face of the room catalog: `ROOM_PRESETS` as a developer reads\n * it.\n *\n * The generated record (`rooms.gen.ts`) carries everything the SDK and the\n * renderer agree on: the published build hash, the stand-in's file, the\n * preview's brightness and colour per mode, the sky's irradiance, the scene\n * complexity the estimator prices. None of that is anything a page decides\n * with, and all of it changes whenever a room is published again, so the\n * public type names only what a developer chooses or places by. The object\n * is the same one; the SDK's own code reads the full record from\n * `rooms.gen.ts`.\n */\n\nimport {\n ROOM_PRESETS as ROOM_RECORDS,\n type RoomPresetLighting,\n type RoomPresetName,\n} from './rooms.gen.js';\n\n/** A preset surface: a preset material and its tint. */\nexport type RoomPresetSurface = {\n readonly material: string;\n readonly color: string;\n};\n\n/** What a preset room is, as `ROOM_PRESETS[name]` lists it. */\nexport type RoomPresetInfo = {\n /** Its name for people, for a picker. */\n readonly label: string;\n /** A sentence about it, for a picker. */\n readonly description: string;\n /** Meters. Floor at y = 0, centered on the origin; north is −z. */\n readonly size: {\n readonly width: number;\n readonly height: number;\n readonly depth: number;\n };\n /** The lighting mode the room was designed under; any of the four can be asked for. */\n readonly lighting: RoomPresetLighting;\n /** The surfaces it comes with, which `createPresetRoom()` options replace. */\n readonly surfaces: {\n readonly floor: RoomPresetSurface;\n readonly walls: RoomPresetSurface;\n readonly ceiling: RoomPresetSurface;\n readonly sill: { readonly material: string };\n };\n /** What the product stands on, where, and how high its top is. */\n readonly stand: {\n readonly type: string | null;\n readonly material: string | null;\n readonly x: number;\n readonly z: number;\n readonly rotationDeg: number;\n readonly top: number;\n /** three.js axes, meters. `null` when the room has no stand. */\n readonly size: {\n readonly x: number;\n readonly y: number;\n readonly z: number;\n } | null;\n };\n /** The framing the room was designed with, in its own frame (`applyPresetRoomCamera`). */\n readonly camera: {\n readonly position: readonly [number, number, number];\n readonly target: readonly [number, number, number];\n readonly lensMm: number;\n readonly fstop: number | null;\n };\n /**\n * The pictures the room hangs, in the order it hangs them: which wall, and\n * how long the image's longest side is in meters. `createPresetRoom({\n * pictures })` fills them in this order.\n */\n readonly pictures: readonly {\n readonly wall: string;\n readonly size: number;\n }[];\n /**\n * The `toneMappingExposure` the room is designed for, per lighting mode;\n * `createPresetRoom()` leaves the current mode's on `userData.exposure`.\n */\n readonly exposure: Readonly<Record<RoomPresetLighting, number>>;\n /**\n * The lighting modes this room's own traced light is published for. In\n * those, `createPresetRoom()` shows it in the viewport, and a bake of a\n * product in the unmodified room covers only the product, its stand and\n * its shadow. In the others a bake lights the whole room.\n */\n readonly prebaked: readonly RoomPresetLighting[];\n /**\n * The lighting modes this room has a baked version for. In those,\n * `createPresetRoom()` shows the baked room in the browser (one optimized\n * file with its traced light in it), a render builds the real room, and a\n * bake covers only the product, its stand and its shadow. In the others\n * the browser shows a lighter stand-in.\n */\n readonly baked: readonly RoomPresetLighting[];\n};\n\n/** Every preset room, by name. */\nexport const ROOM_PRESETS: {\n readonly [Name in RoomPresetName]: RoomPresetInfo;\n} = ROOM_RECORDS;\n"]}
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, ReactElement } from 'react';
3
- import { d as CompatibilityReport, Q as QualityPreset } from '../bake-DaOlenyx.js';
4
- import { C as CostEstimate, u as RenderResult, v as TokenProvider } from '../testRun-BIPXaVPb.js';
5
- export { c as Bakery3Error, w as RenderBudgetExceeded } from '../testRun-BIPXaVPb.js';
3
+ import { d as CompatibilityReport, Q as QualityPreset } from '../bake-DZ-CJR6f.js';
4
+ import { C as CostEstimate, v as RenderResult, w as TokenProvider } from '../testRun-20OARnQr.js';
5
+ export { c as Bakery3Error, x as RenderBudgetExceeded } from '../testRun-20OARnQr.js';
6
6
  import { Bakery3Options, Bakery3, RenderVideoOptions, RenderJob, EstimateOptions } from '../index.js';
7
7
  export { RenderOptions } from '../index.js';
8
8
  import { a as TimelineOptions, T as Timeline } from '../timeline-ChwgD7bT.js';
@@ -10,7 +10,7 @@ export { K as Keyframe, b as Track, c as createTimeline } from '../timeline-Chwg
10
10
  import { DevPanelTab, TimelinePanelTarget, BakeTransport, DevPanelHistoryOptions, TimelinePanelOptions } from '../devtools/index.js';
11
11
  import '../animation-B1h0Ryvj.js';
12
12
  import 'three';
13
- import '../prepare-C5qVvaw4.js';
13
+ import '../prepare-BtjY4G3q.js';
14
14
  import '../bake/index.js';
15
15
 
16
16
  /**
package/dist/r3f/index.js CHANGED
@@ -1,19 +1,19 @@
1
- 'use client';import { createBakery3 } from '../chunk-ARMTTZXZ.js';
2
- import '../chunk-WBIAFIHV.js';
3
- import '../chunk-25ZXSVQ3.js';
1
+ 'use client';import { createBakery3 } from '../chunk-6FYI6AJM.js';
2
+ import '../chunk-XK35ANPJ.js';
3
+ import '../chunk-NXBAZGNB.js';
4
4
  import '../chunk-ZEBVAIJJ.js';
5
- import { mountBakery3Devtools, mountTimelinePanel } from '../chunk-54WJDN5R.js';
6
- export { Timeline, createTimeline } from '../chunk-CX4WTVGH.js';
7
- import '../chunk-V3QINEEG.js';
8
- import '../chunk-APBOWWSV.js';
5
+ import { mountBakery3Devtools, mountTimelinePanel } from '../chunk-QRCT5UGZ.js';
6
+ export { Timeline, createTimeline } from '../chunk-Z7IYVH22.js';
7
+ import '../chunk-62M6XXNX.js';
8
+ import '../chunk-UWBP7B54.js';
9
9
  import '../chunk-S4AJTLLN.js';
10
- import { rememberEnvironmentSource } from '../chunk-AF5BIELI.js';
11
- import '../chunk-TGFNQBKC.js';
12
- import '../chunk-HQTUFVMM.js';
10
+ import { rememberEnvironmentSource } from '../chunk-KZLVTSBI.js';
11
+ import '../chunk-KNUAOILG.js';
12
+ import '../chunk-JFYUDERE.js';
13
13
  import '../chunk-4E5VV4QY.js';
14
- import '../chunk-W6WQ5UP7.js';
14
+ import '../chunk-APWUCEEB.js';
15
15
  import '../chunk-6NYR73Y7.js';
16
- import '../chunk-MD2U6S4N.js';
16
+ import '../chunk-LAKXC4WR.js';
17
17
  import { Bakery3Error } from '../chunk-3G5QL4F4.js';
18
18
  export { Bakery3Error, RenderBudgetExceeded } from '../chunk-3G5QL4F4.js';
19
19
  import { createContext, useContext, useState, useEffect, useMemo, useRef, useSyncExternalStore, useCallback, Children, isValidElement, cloneElement, version } from 'react';
@@ -1,9 +1,9 @@
1
- export { applyPresetRoomCamera, coverFit, createPresetRoom, plainFloatGeometry, presetRoomBounds, presetRoomUrl, roomLensFovDeg, stampRoomIds, stampRoomStandIns } from './chunk-6YVQANMW.js';
2
- export { findPresetRooms, roomPresetFactsOf, roomPresetSpecOf } from './chunk-AF5BIELI.js';
1
+ export { applyPresetRoomCamera, coverFit, createPresetRoom, plainFloatGeometry, presetRoomBounds, presetRoomUrl, roomLensFovDeg, stampRoomIds, stampRoomStandIns } from './chunk-HNMSWQU7.js';
2
+ import './chunk-KZLVTSBI.js';
3
3
  import './chunk-4E5VV4QY.js';
4
- import './chunk-W6WQ5UP7.js';
4
+ export { findPresetRooms, roomPresetFactsOf, roomPresetSpecOf } from './chunk-APWUCEEB.js';
5
5
  import './chunk-6NYR73Y7.js';
6
- export { ROOM_PRESETS } from './chunk-MD2U6S4N.js';
6
+ export { ROOM_PRESETS } from './chunk-LAKXC4WR.js';
7
7
  import './chunk-3G5QL4F4.js';
8
- //# sourceMappingURL=room-S5TLCK4F.js.map
9
- //# sourceMappingURL=room-S5TLCK4F.js.map
8
+ //# sourceMappingURL=room-FS26KAPQ.js.map
9
+ //# sourceMappingURL=room-FS26KAPQ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"room-S5TLCK4F.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"room-FS26KAPQ.js"}