@nodaro/shared 3.5.0 → 3.7.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/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/scene3d-v2-resources.test.ts +3 -0
- package/src/__tests__/scene3d-v2.test.ts +3 -0
- package/src/image-overlay-layers.ts +10 -0
- package/src/scene3d-v2.ts +1 -1
package/package.json
CHANGED
|
@@ -199,6 +199,9 @@ describe("scene3d v2 resources — content hash", () => {
|
|
|
199
199
|
|
|
200
200
|
it("changes when any content changes", async () => {
|
|
201
201
|
const base = await computeScene3DPlanV2ContentHash(planV2())
|
|
202
|
+
const shadowed = planV2()
|
|
203
|
+
shadowed.lighting = { ...shadowed.lighting, preset: "clay-studio-v2" }
|
|
204
|
+
expect(await computeScene3DPlanV2ContentHash(shadowed)).not.toBe(base)
|
|
202
205
|
const recoloured = planV2()
|
|
203
206
|
recoloured.objects[1].materialBindings = [
|
|
204
207
|
{ role: "bodyPaint", materialName: "Body Paint", color: "#00ff00" },
|
|
@@ -754,6 +754,9 @@ describe("scene3d v2 — references and engines", () => {
|
|
|
754
754
|
})
|
|
755
755
|
|
|
756
756
|
it("pins the clay lighting preset", () => {
|
|
757
|
+
for (const preset of ["clay-studio-v1", "clay-studio-v2"] as const) {
|
|
758
|
+
expect(scene3DPlanV2Schema.safeParse(planV2({ lighting: { ...planV2().lighting, preset } })).success).toBe(true)
|
|
759
|
+
}
|
|
757
760
|
expect(scene3DPlanV2Schema.safeParse(planV2({ lighting: { ...planV2().lighting, preset: "neon" as never } })).success).toBe(
|
|
758
761
|
false,
|
|
759
762
|
)
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { z } from "zod"
|
|
18
18
|
|
|
19
|
+
/** The nine points a layer attaches to on the base image. THE definition —
|
|
20
|
+
* the route's Zod, the compositor, the canvas, the SDK and the CLI all read
|
|
21
|
+
* this one (it used to be spelled out separately in each). */
|
|
22
|
+
export const OVERLAY_ANCHORS = [
|
|
23
|
+
"top-left", "top", "top-right",
|
|
24
|
+
"left", "center", "right",
|
|
25
|
+
"bottom-left", "bottom", "bottom-right",
|
|
26
|
+
] as const
|
|
27
|
+
export type OverlayAnchor = (typeof OVERLAY_ANCHORS)[number]
|
|
28
|
+
|
|
19
29
|
export const OVERLAY_LAYER_KINDS = ["image", "text", "qr", "shape"] as const
|
|
20
30
|
export type OverlayLayerKind = (typeof OVERLAY_LAYER_KINDS)[number]
|
|
21
31
|
|
package/src/scene3d-v2.ts
CHANGED
|
@@ -251,7 +251,7 @@ export const SCENE3D_PRIMITIVE_MATERIAL_ROLE = "identity"
|
|
|
251
251
|
|
|
252
252
|
/** The standardized clay look, pinned by id. Browser preview, critic stills and
|
|
253
253
|
* the final export must implement a given preset identically. */
|
|
254
|
-
export const SCENE3D_CLAY_LIGHTING_PRESETS = ["clay-studio-v1"] as const
|
|
254
|
+
export const SCENE3D_CLAY_LIGHTING_PRESETS = ["clay-studio-v1", "clay-studio-v2"] as const
|
|
255
255
|
export type Scene3DClayLightingPreset = (typeof SCENE3D_CLAY_LIGHTING_PRESETS)[number]
|
|
256
256
|
|
|
257
257
|
// ---------------------------------------------------------------------------
|