@scenography/plugin-wall 0.6.0 → 0.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/{data-BMWvlhyh.cjs → data-BNQWrWKV.cjs} +3 -2
- package/dist/{data-BMWvlhyh.cjs.map → data-BNQWrWKV.cjs.map} +1 -1
- package/dist/{data-PI34E7UF.mjs → data-CzduhRW6.mjs} +4 -3
- package/dist/{data-PI34E7UF.mjs.map → data-CzduhRW6.mjs.map} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
|
@@ -35,7 +35,8 @@ const validateWall = (wall) => {
|
|
|
35
35
|
const wallData = {
|
|
36
36
|
kind: "walls",
|
|
37
37
|
cardinality: "many",
|
|
38
|
-
validate: (wall) => validateWall(wall)
|
|
38
|
+
validate: (wall) => validateWall(wall),
|
|
39
|
+
assets: (wall) => (0, _scenography_scene.surfaceTextureUrls)(wall.texture)
|
|
39
40
|
};
|
|
40
41
|
//#endregion
|
|
41
42
|
Object.defineProperty(exports, "WALL_DEFAULT_HEIGHT", {
|
|
@@ -81,4 +82,4 @@ Object.defineProperty(exports, "wallData", {
|
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
84
|
|
|
84
|
-
//# sourceMappingURL=data-
|
|
85
|
+
//# sourceMappingURL=data-BNQWrWKV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-
|
|
1
|
+
{"version":3,"file":"data-BNQWrWKV.cjs","names":["validateTexture"],"sources":["../src/data/geometry.ts","../src/data/validate.ts","../src/data/plugin.ts"],"sourcesContent":["import type { Vec2 } from \"@scenography/scene\";\n\nimport type { Wall } from \"./wall\";\n\nexport const WALL_DEFAULT_HEIGHT = 300;\nexport const WALL_DEFAULT_THICKNESS = 30;\n\n/** Number of segments in a wall path (one fewer than vertices unless closed). */\nexport const segmentCount = (wall: Wall): number =>\n wall.closed ? wall.path.length : wall.path.length - 1;\n\n/** Endpoints `[a, b]` of segment `i` (wrapping to the first vertex when closed). */\nexport const edgeEndpoints = (wall: Wall, segment: number): [Vec2, Vec2] => {\n const n = wall.path.length;\n return [wall.path[segment % n] as Vec2, wall.path[(segment + 1) % n] as Vec2];\n};\n\n/** Every edge name declared across all walls (the anchor namespace for artworks). */\nexport const allEdgeNames = (walls: Wall[]): string[] =>\n walls.flatMap((w) => (w.edges ?? []).map((e) => e.name));\n","import {\n existsProp,\n isVec2,\n nested,\n propIs,\n validate,\n validateTexture,\n when,\n type ValidationResult,\n} from \"@scenography/scene\";\n\nimport { segmentCount } from \"./geometry\";\nimport type { Wall } from \"./wall\";\n\nconst isWallPath = (path: unknown): boolean =>\n Array.isArray(path) && path.length >= 2 && path.every((p) => isVec2(p));\n\nexport const validateWall = (wall: Wall): ValidationResult => {\n const segments = segmentCount(wall);\n // Edge rules are built per declared edge (their paths carry the index); they\n // only run once the path itself is valid, since the range depends on it.\n const edgeRules = (wall.edges ?? []).flatMap((_, i) => [\n propIs(\n `edges[${i}].segment`,\n (s) => typeof s === \"number\" && s >= 0 && s < segments,\n (s) => `segment ${String(s)} is out of range (0..${segments - 1}).`,\n ),\n existsProp(`edges[${i}].name`, \"edge is missing a name.\"),\n ]);\n return validate<Wall>([\n existsProp(\"id\", \"Wall is missing an id.\"),\n nested(\"texture\", validateTexture),\n existsProp(\"path\"),\n propIs(\"path\", isWallPath, \"path must have at least two [x, z] vertices.\"),\n when((w: Wall) => isWallPath(w.path), ...edgeRules),\n ])(wall);\n};\n","import { surfaceTextureUrls, type DataPlugin } from \"@scenography/scene\";\n\nimport { validateWall } from \"./validate\";\nimport type { Wall } from \"./wall\";\n\n/**\n * The data half of the wall plugin: owns the `walls` scene key (a collection)\n * and validates each wall. Pure — no three.js. Pass it to `defineScene` so\n * scenes using walls validate without loading the runtime.\n */\nexport const wallData: DataPlugin<Wall> = {\n kind: \"walls\",\n cardinality: \"many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A,GAAA,mBAAA,mBAAA,CAA4B,KAAK,OAAO;AACnD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsProp, isVec2, nested, propIs, validate, validateTexture, when } from "@scenography/scene";
|
|
1
|
+
import { existsProp, isVec2, nested, propIs, surfaceTextureUrls, validate, validateTexture, when } from "@scenography/scene";
|
|
2
2
|
//#region src/data/geometry.ts
|
|
3
3
|
const WALL_DEFAULT_HEIGHT = 300;
|
|
4
4
|
const WALL_DEFAULT_THICKNESS = 30;
|
|
@@ -35,9 +35,10 @@ const validateWall = (wall) => {
|
|
|
35
35
|
const wallData = {
|
|
36
36
|
kind: "walls",
|
|
37
37
|
cardinality: "many",
|
|
38
|
-
validate: (wall) => validateWall(wall)
|
|
38
|
+
validate: (wall) => validateWall(wall),
|
|
39
|
+
assets: (wall) => surfaceTextureUrls(wall.texture)
|
|
39
40
|
};
|
|
40
41
|
//#endregion
|
|
41
42
|
export { allEdgeNames as a, WALL_DEFAULT_THICKNESS as i, validateWall as n, edgeEndpoints as o, WALL_DEFAULT_HEIGHT as r, segmentCount as s, wallData as t };
|
|
42
43
|
|
|
43
|
-
//# sourceMappingURL=data-
|
|
44
|
+
//# sourceMappingURL=data-CzduhRW6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-
|
|
1
|
+
{"version":3,"file":"data-CzduhRW6.mjs","names":[],"sources":["../src/data/geometry.ts","../src/data/validate.ts","../src/data/plugin.ts"],"sourcesContent":["import type { Vec2 } from \"@scenography/scene\";\n\nimport type { Wall } from \"./wall\";\n\nexport const WALL_DEFAULT_HEIGHT = 300;\nexport const WALL_DEFAULT_THICKNESS = 30;\n\n/** Number of segments in a wall path (one fewer than vertices unless closed). */\nexport const segmentCount = (wall: Wall): number =>\n wall.closed ? wall.path.length : wall.path.length - 1;\n\n/** Endpoints `[a, b]` of segment `i` (wrapping to the first vertex when closed). */\nexport const edgeEndpoints = (wall: Wall, segment: number): [Vec2, Vec2] => {\n const n = wall.path.length;\n return [wall.path[segment % n] as Vec2, wall.path[(segment + 1) % n] as Vec2];\n};\n\n/** Every edge name declared across all walls (the anchor namespace for artworks). */\nexport const allEdgeNames = (walls: Wall[]): string[] =>\n walls.flatMap((w) => (w.edges ?? []).map((e) => e.name));\n","import {\n existsProp,\n isVec2,\n nested,\n propIs,\n validate,\n validateTexture,\n when,\n type ValidationResult,\n} from \"@scenography/scene\";\n\nimport { segmentCount } from \"./geometry\";\nimport type { Wall } from \"./wall\";\n\nconst isWallPath = (path: unknown): boolean =>\n Array.isArray(path) && path.length >= 2 && path.every((p) => isVec2(p));\n\nexport const validateWall = (wall: Wall): ValidationResult => {\n const segments = segmentCount(wall);\n // Edge rules are built per declared edge (their paths carry the index); they\n // only run once the path itself is valid, since the range depends on it.\n const edgeRules = (wall.edges ?? []).flatMap((_, i) => [\n propIs(\n `edges[${i}].segment`,\n (s) => typeof s === \"number\" && s >= 0 && s < segments,\n (s) => `segment ${String(s)} is out of range (0..${segments - 1}).`,\n ),\n existsProp(`edges[${i}].name`, \"edge is missing a name.\"),\n ]);\n return validate<Wall>([\n existsProp(\"id\", \"Wall is missing an id.\"),\n nested(\"texture\", validateTexture),\n existsProp(\"path\"),\n propIs(\"path\", isWallPath, \"path must have at least two [x, z] vertices.\"),\n when((w: Wall) => isWallPath(w.path), ...edgeRules),\n ])(wall);\n};\n","import { surfaceTextureUrls, type DataPlugin } from \"@scenography/scene\";\n\nimport { validateWall } from \"./validate\";\nimport type { Wall } from \"./wall\";\n\n/**\n * The data half of the wall plugin: owns the `walls` scene key (a collection)\n * and validates each wall. Pure — no three.js. Pass it to `defineScene` so\n * scenes using walls validate without loading the runtime.\n */\nexport const wallData: DataPlugin<Wall> = {\n kind: \"walls\",\n cardinality: \"many\",\n validate: (wall) => validateWall(wall),\n assets: (wall) => surfaceTextureUrls(wall.texture),\n};\n"],"mappings":";;AAIA,MAAa,sBAAsB;AACnC,MAAa,yBAAyB;;AAGtC,MAAa,gBAAgB,SAC3B,KAAK,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,SAAS;;AAGtD,MAAa,iBAAiB,MAAY,YAAkC;CAC1E,MAAM,IAAI,KAAK,KAAK;CACpB,OAAO,CAAC,KAAK,KAAK,UAAU,IAAY,KAAK,MAAM,UAAU,KAAK,EAAU;AAC9E;;AAGA,MAAa,gBAAgB,UAC3B,MAAM,SAAS,OAAO,EAAE,SAAS,CAAC,EAAA,CAAG,KAAK,MAAM,EAAE,IAAI,CAAC;;;ACLzD,MAAM,cAAc,SAClB,MAAM,QAAQ,IAAI,KAAK,KAAK,UAAU,KAAK,KAAK,OAAO,MAAM,OAAO,CAAC,CAAC;AAExE,MAAa,gBAAgB,SAAiC;CAC5D,MAAM,WAAW,aAAa,IAAI;CAGlC,MAAM,aAAa,KAAK,SAAS,CAAC,EAAA,CAAG,SAAS,GAAG,MAAM,CACrD,OACE,SAAS,EAAE,aACV,MAAM,OAAO,MAAM,YAAY,KAAK,KAAK,IAAI,WAC7C,MAAM,WAAW,OAAO,CAAC,EAAE,uBAAuB,WAAW,EAAE,GAClE,GACA,WAAW,SAAS,EAAE,SAAS,yBAAyB,CAC1D,CAAC;CACD,OAAO,SAAe;EACpB,WAAW,MAAM,wBAAwB;EACzC,OAAO,WAAW,eAAe;EACjC,WAAW,MAAM;EACjB,OAAO,QAAQ,YAAY,8CAA8C;EACzE,MAAM,MAAY,WAAW,EAAE,IAAI,GAAG,GAAG,SAAS;CACpD,CAAC,CAAC,CAAC,IAAI;AACT;;;;;;;;AC1BA,MAAa,WAA6B;CACxC,MAAM;CACN,aAAa;CACb,WAAW,SAAS,aAAa,IAAI;CACrC,SAAS,SAAS,mBAAmB,KAAK,OAAO;AACnD"}
|
package/dist/data.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_data = require("./data-
|
|
2
|
+
const require_data = require("./data-BNQWrWKV.cjs");
|
|
3
3
|
exports.WALL_DEFAULT_HEIGHT = require_data.WALL_DEFAULT_HEIGHT;
|
|
4
4
|
exports.WALL_DEFAULT_THICKNESS = require_data.WALL_DEFAULT_THICKNESS;
|
|
5
5
|
exports.allEdgeNames = require_data.allEdgeNames;
|
package/dist/data.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as allEdgeNames, i as WALL_DEFAULT_THICKNESS, n as validateWall, o as edgeEndpoints, r as WALL_DEFAULT_HEIGHT, s as segmentCount, t as wallData } from "./data-
|
|
1
|
+
import { a as allEdgeNames, i as WALL_DEFAULT_THICKNESS, n as validateWall, o as edgeEndpoints, r as WALL_DEFAULT_HEIGHT, s as segmentCount, t as wallData } from "./data-CzduhRW6.mjs";
|
|
2
2
|
export { WALL_DEFAULT_HEIGHT, WALL_DEFAULT_THICKNESS, allEdgeNames, edgeEndpoints, segmentCount, validateWall, wallData };
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_data = require("./data-
|
|
2
|
+
const require_data = require("./data-BNQWrWKV.cjs");
|
|
3
3
|
let _scenography_engine = require("@scenography/engine");
|
|
4
4
|
let three = require("three");
|
|
5
5
|
//#region src/buildWall.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as allEdgeNames, i as WALL_DEFAULT_THICKNESS, n as validateWall, o as edgeEndpoints, r as WALL_DEFAULT_HEIGHT, s as segmentCount, t as wallData } from "./data-
|
|
1
|
+
import { a as allEdgeNames, i as WALL_DEFAULT_THICKNESS, n as validateWall, o as edgeEndpoints, r as WALL_DEFAULT_HEIGHT, s as segmentCount, t as wallData } from "./data-CzduhRW6.mjs";
|
|
2
2
|
import { COLLIDERS, EDGES, applyTexture } from "@scenography/engine";
|
|
3
3
|
import { BoxGeometry, Group, Mesh, MeshStandardMaterial } from "three";
|
|
4
4
|
//#region src/buildWall.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scenography/plugin-wall",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Wall plugin for scenography: extrudes a top-down path into walls, publishes named edges (for hanging art) and colliders. Data half importable without three.js.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@scenography/scene": "0.
|
|
36
|
+
"@scenography/scene": "0.7.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/three": "^0.160.0",
|
|
40
40
|
"three": "^0.160.0",
|
|
41
|
-
"@scenography/engine": "0.
|
|
41
|
+
"@scenography/engine": "0.7.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"three": ">=0.160.0",
|
|
45
|
-
"@scenography/engine": "0.
|
|
45
|
+
"@scenography/engine": "0.7.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsdown",
|