@oeave/bakery3 0.0.0-stage → 0.1.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 (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +562 -2
  3. package/dist/animation-B1h0Ryvj.d.ts +97 -0
  4. package/dist/bake/index.d.ts +369 -0
  5. package/dist/bake/index.js +9 -0
  6. package/dist/bake/index.js.map +1 -0
  7. package/dist/bake-DaOlenyx.d.ts +1357 -0
  8. package/dist/catalog/index.d.ts +100 -0
  9. package/dist/catalog/index.js +154 -0
  10. package/dist/catalog/index.js.map +1 -0
  11. package/dist/catalog.gen-BM-aNf7n.d.ts +733 -0
  12. package/dist/chunk-25ZXSVQ3.js +1107 -0
  13. package/dist/chunk-25ZXSVQ3.js.map +1 -0
  14. package/dist/chunk-3G5QL4F4.js +145 -0
  15. package/dist/chunk-3G5QL4F4.js.map +1 -0
  16. package/dist/chunk-4E5VV4QY.js +12 -0
  17. package/dist/chunk-4E5VV4QY.js.map +1 -0
  18. package/dist/chunk-54WJDN5R.js +3286 -0
  19. package/dist/chunk-54WJDN5R.js.map +1 -0
  20. package/dist/chunk-6NYR73Y7.js +832 -0
  21. package/dist/chunk-6NYR73Y7.js.map +1 -0
  22. package/dist/chunk-6YVQANMW.js +1463 -0
  23. package/dist/chunk-6YVQANMW.js.map +1 -0
  24. package/dist/chunk-AF5BIELI.js +70 -0
  25. package/dist/chunk-AF5BIELI.js.map +1 -0
  26. package/dist/chunk-APBOWWSV.js +92 -0
  27. package/dist/chunk-APBOWWSV.js.map +1 -0
  28. package/dist/chunk-ARMTTZXZ.js +1157 -0
  29. package/dist/chunk-ARMTTZXZ.js.map +1 -0
  30. package/dist/chunk-CX4WTVGH.js +4492 -0
  31. package/dist/chunk-CX4WTVGH.js.map +1 -0
  32. package/dist/chunk-HQTUFVMM.js +1412 -0
  33. package/dist/chunk-HQTUFVMM.js.map +1 -0
  34. package/dist/chunk-MD2U6S4N.js +1952 -0
  35. package/dist/chunk-MD2U6S4N.js.map +1 -0
  36. package/dist/chunk-S4AJTLLN.js +23 -0
  37. package/dist/chunk-S4AJTLLN.js.map +1 -0
  38. package/dist/chunk-TGFNQBKC.js +551 -0
  39. package/dist/chunk-TGFNQBKC.js.map +1 -0
  40. package/dist/chunk-V3QINEEG.js +87 -0
  41. package/dist/chunk-V3QINEEG.js.map +1 -0
  42. package/dist/chunk-W6WQ5UP7.js +91 -0
  43. package/dist/chunk-W6WQ5UP7.js.map +1 -0
  44. package/dist/chunk-WBIAFIHV.js +346 -0
  45. package/dist/chunk-WBIAFIHV.js.map +1 -0
  46. package/dist/chunk-ZEBVAIJJ.js +156 -0
  47. package/dist/chunk-ZEBVAIJJ.js.map +1 -0
  48. package/dist/devtools/index.d.ts +536 -0
  49. package/dist/devtools/index.js +15 -0
  50. package/dist/devtools/index.js.map +1 -0
  51. package/dist/environments/index.d.ts +93 -0
  52. package/dist/environments/index.js +382 -0
  53. package/dist/environments/index.js.map +1 -0
  54. package/dist/hotspots/index.d.ts +111 -0
  55. package/dist/hotspots/index.js +285 -0
  56. package/dist/hotspots/index.js.map +1 -0
  57. package/dist/index.d.ts +944 -0
  58. package/dist/index.js +15 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/node/index.cjs +5115 -0
  61. package/dist/node/index.cjs.map +1 -0
  62. package/dist/node/index.d.cts +4862 -0
  63. package/dist/node/index.d.ts +576 -0
  64. package/dist/node/index.js +1279 -0
  65. package/dist/node/index.js.map +1 -0
  66. package/dist/prepare-C5qVvaw4.d.ts +112 -0
  67. package/dist/presets/index.d.ts +526 -0
  68. package/dist/presets/index.js +14 -0
  69. package/dist/presets/index.js.map +1 -0
  70. package/dist/r3f/index.d.ts +159 -0
  71. package/dist/r3f/index.js +592 -0
  72. package/dist/r3f/index.js.map +1 -0
  73. package/dist/room-S5TLCK4F.js +9 -0
  74. package/dist/room-S5TLCK4F.js.map +1 -0
  75. package/dist/rooms.gen-vhj6sFW5.d.ts +1434 -0
  76. package/dist/session-YCQS4MRH.js +9 -0
  77. package/dist/session-YCQS4MRH.js.map +1 -0
  78. package/dist/shapes/index.d.ts +222 -0
  79. package/dist/shapes/index.js +836 -0
  80. package/dist/shapes/index.js.map +1 -0
  81. package/dist/testRun-BIPXaVPb.d.ts +1130 -0
  82. package/dist/timeline-ChwgD7bT.d.ts +470 -0
  83. package/dist/tsl/index.d.ts +165 -0
  84. package/dist/tsl/index.js +310 -0
  85. package/dist/tsl/index.js.map +1 -0
  86. package/package.json +170 -4
@@ -0,0 +1,159 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
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';
6
+ import { Bakery3Options, Bakery3, RenderVideoOptions, RenderJob, EstimateOptions } from '../index.js';
7
+ export { RenderOptions } from '../index.js';
8
+ import { a as TimelineOptions, T as Timeline } from '../timeline-ChwgD7bT.js';
9
+ export { K as Keyframe, b as Track, c as createTimeline } from '../timeline-ChwgD7bT.js';
10
+ import { DevPanelTab, TimelinePanelTarget, BakeTransport, DevPanelHistoryOptions, TimelinePanelOptions } from '../devtools/index.js';
11
+ import '../animation-B1h0Ryvj.js';
12
+ import 'three';
13
+ import '../prepare-C5qVvaw4.js';
14
+ import '../bake/index.js';
15
+
16
+ /**
17
+ * Mount INSIDE `<Canvas>`.
18
+ *
19
+ * It has to be: `useThree` only resolves against R3F's own store, and the
20
+ * point of the provider is to hold the live scene and camera. Wrapping
21
+ * `<Canvas>` with it instead yields an error from `useThree`, not from here.
22
+ *
23
+ * The client is rebuilt when `apiKey` or `baseUrl` changes. `token` is read
24
+ * through a ref, so a token function written inline does not rebuild it.
25
+ */
26
+ declare function Bakery3Provider({ children, ...options }: Bakery3Options & {
27
+ children?: ReactNode;
28
+ }): react_jsx_runtime.JSX.Element;
29
+ type UseBakery3 = {
30
+ /**
31
+ * One render, watched: `job`, `progress`, `previewUrl` and `result` follow
32
+ * it. With `cameras` it is a set of pictures instead, handed back as it is:
33
+ * a set reports through `set.wait({ onProgress })`, not through one job's
34
+ * state.
35
+ */
36
+ render: Bakery3['render'];
37
+ /** Every variant, from every camera. The provider's live scene is the default. */
38
+ renderVariants: Bakery3['renderVariants'];
39
+ /** What that run would cost, with nothing admitted. */
40
+ quoteVariants: Bakery3['quoteVariants'];
41
+ /** Three variants, every camera, small and fast: look before paying. */
42
+ testVariants: Bakery3['testVariants'];
43
+ /** A render by id, as a job: after a reload, in another tab, from a
44
+ * webhook. Needs no canvas. */
45
+ getRender: Bakery3['getRender'];
46
+ /** A timeline bound to the provider's live scene and camera. */
47
+ timeline: (options?: TimelineOptions) => Timeline;
48
+ /** The same capture as `render`, plus a baked timeline, as a video. */
49
+ renderVideo: (options: RenderVideoOptions) => Promise<RenderJob>;
50
+ estimate: (options?: EstimateOptions) => Promise<CostEstimate>;
51
+ check: () => CompatibilityReport;
52
+ /**
53
+ * The latest render or video, once it was accepted. With a provider it is
54
+ * shared: every `useBakery3()` under it, and the devtools panel, see the
55
+ * same one, whichever component started it.
56
+ */
57
+ job: RenderJob | null;
58
+ /** True from the call until the latest render settles, whichever way. */
59
+ isRendering: boolean;
60
+ /** Available seconds before the final image, on `studio` and `ultra`. */
61
+ previewUrl: string | undefined;
62
+ /** 0 to 1. */
63
+ progress: number;
64
+ /** The finished render: `result.url` is the image or the video. */
65
+ result: RenderResult | null;
66
+ error: Error | null;
67
+ /**
68
+ * The client itself. Without options, null outside `<Canvas>` until the
69
+ * provider inside it has mounted; `ready` says the same thing as a boolean.
70
+ */
71
+ bakery3: Bakery3 | null;
72
+ /** Without options, false until a `<Bakery3Provider>` has mounted. Disable
73
+ * a render button on it. */
74
+ ready: boolean;
75
+ };
76
+ /**
77
+ * Works on both sides of `<Canvas>`, with or without a provider.
78
+ *
79
+ * With options (`{ apiKey }` or `{ token }`) it is a client of its own. Each
80
+ * call renders the canvas it is inside, or, from the ordinary DOM, the one
81
+ * canvas on the page; with several it refuses and points at the provider.
82
+ *
83
+ * Without options it uses `<Bakery3Provider>`. Inside the provider it reads
84
+ * React context. Outside, where a render button actually lives (R3F's
85
+ * reconciler has no `<button>`), it reads the store the provider publishes
86
+ * to. With two providers on one page, the one that mounted last is the one an
87
+ * outside caller gets, so call the hook inside the provider when that matters.
88
+ */
89
+ declare function useBakery3(options?: Bakery3Options): UseBakery3;
90
+
91
+ type Props = {
92
+ /**
93
+ * What the browser renders. Mounted normally. A material element
94
+ * (`<shaderMaterial>`, `<meshStandardMaterial>`), or a component that
95
+ * forwards its ref to one: the fallback is written onto the material that
96
+ * ref reaches. A ref of your own on it still receives the material.
97
+ */
98
+ web: ReactNode;
99
+ /**
100
+ * What the render shows instead. A `<meshPhysicalMaterial>` element, read
101
+ * for its props and never mounted.
102
+ */
103
+ render: ReactElement<Record<string, unknown>>;
104
+ };
105
+ declare function Bakery3Material({ web, render }: Props): react_jsx_runtime.JSX.Element;
106
+
107
+ type Bakery3DevtoolsProps = {
108
+ /**
109
+ * A client of its own, as `useBakery3({ apiKey })` has: no
110
+ * `<Bakery3Provider>` needed. The panel shows the page's one `<Canvas>`
111
+ * (or the one it is inside), waiting for it to mount. Leave out `apiKey`
112
+ * and `token` to use the provider's client instead.
113
+ */
114
+ apiKey?: string;
115
+ /** A function that mints a browser token, as the provider takes. */
116
+ token?: TokenProvider;
117
+ /** With `apiKey` or `token`: the API to talk to. */
118
+ baseUrl?: string;
119
+ /** With `apiKey` or `token`: the `fetch` the client uses. */
120
+ fetch?: typeof fetch;
121
+ /** With `apiKey` or `token`: defaults folded into every render. */
122
+ defaults?: Bakery3Options['defaults'];
123
+ /** Corner to sit in. */
124
+ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
125
+ defaultQuality?: QualityPreset;
126
+ defaultOpen?: boolean;
127
+ defaultTab?: DevPanelTab;
128
+ /**
129
+ * The timeline the Video tab films. Without one the panel makes its own on
130
+ * the live scene and camera, empty: frame a shot and press Keyframe camera.
131
+ */
132
+ timeline?: Timeline;
133
+ /** Objects offered in the timeline's "add track" picker. */
134
+ timelineTargets?: TimelinePanelTarget[];
135
+ /** Fired when the timeline takes the camera and when it gives it back.
136
+ * Suspend your orbit controls here. */
137
+ onPlaybackChange?: (active: boolean) => void;
138
+ /** Bake with your own worker instead of the hosted one. */
139
+ bakeTransport?: BakeTransport;
140
+ /** Where a bundle's relative uris resolve against, when it has any. */
141
+ bakeBaseUrl?: string;
142
+ /** Zero the realtime lights when a generation is applied. Off by default:
143
+ * the session already replaces diffuse lighting with the lightmap (see
144
+ * bake/shading.ts), so muting only removes the lamps' highlights. It is a
145
+ * look to switch on from the panel, not a correction. */
146
+ muteLightsOnApply?: boolean;
147
+ history?: DevPanelHistoryOptions;
148
+ };
149
+ declare function Bakery3Devtools(props: Bakery3DevtoolsProps): null;
150
+
151
+ /** Everything the vanilla panel takes except `container`: the element is
152
+ * fixed-positioned and appended to the body, so a React parent choosing where
153
+ * it lands in the tree would change nothing except when it unmounts. */
154
+ type Bakery3TimelineProps = Omit<TimelinePanelOptions, 'container'>;
155
+ /** Mounts the devtools timeline panel for as long as this component is
156
+ * rendered. Renders nothing itself. */
157
+ declare function Bakery3Timeline(props: Bakery3TimelineProps): null;
158
+
159
+ export { BakeTransport, Bakery3, Bakery3Devtools, type Bakery3DevtoolsProps, Bakery3Material, Bakery3Options, Bakery3Provider, Bakery3Timeline, type Bakery3TimelineProps, EstimateOptions, RenderVideoOptions, Timeline, TimelineOptions, type UseBakery3, useBakery3 };