@scenography/props 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.
- package/dist/index.cjs +23 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.mjs +22 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +40 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let three = require("three");
|
|
3
|
+
//#region src/cube.ts
|
|
4
|
+
/**
|
|
5
|
+
* The first prop: a simple cube. Props are plain factory functions returning a
|
|
6
|
+
* three.js object, so the catalog stays tree-shakeable and each project can add
|
|
7
|
+
* its own without touching the engine.
|
|
8
|
+
*/
|
|
9
|
+
function createCube(options = {}) {
|
|
10
|
+
const { size = 50, color = "#b88b5c", position = [
|
|
11
|
+
0,
|
|
12
|
+
0,
|
|
13
|
+
0
|
|
14
|
+
] } = options;
|
|
15
|
+
const mesh = new three.Mesh(new three.BoxGeometry(size, size, size), new three.MeshStandardMaterial({ color }));
|
|
16
|
+
mesh.position.set(position[0], position[1], position[2]);
|
|
17
|
+
mesh.name = "prop:cube";
|
|
18
|
+
return mesh;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.createCube = createCube;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Mesh","BoxGeometry","MeshStandardMaterial"],"sources":["../src/cube.ts"],"sourcesContent":["import { BoxGeometry, Mesh, MeshStandardMaterial, type Object3D } from \"three\";\nimport type { Vec3 } from \"@scenography/core\";\n\nexport interface CubeOptions {\n /** Edge length in world units. Defaults to `50`. */\n size?: number;\n /** CSS-style color. Defaults to a warm gray. */\n color?: string;\n /** World position `[x, y, z]`. Defaults to the origin. */\n position?: Vec3;\n}\n\n/**\n * The first prop: a simple cube. Props are plain factory functions returning a\n * three.js object, so the catalog stays tree-shakeable and each project can add\n * its own without touching the engine.\n */\nexport function createCube(options: CubeOptions = {}): Object3D {\n const { size = 50, color = \"#b88b5c\", position = [0, 0, 0] } = options;\n const mesh = new Mesh(new BoxGeometry(size, size, size), new MeshStandardMaterial({ color }));\n mesh.position.set(position[0], position[1], position[2]);\n mesh.name = \"prop:cube\";\n return mesh;\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgB,WAAW,UAAuB,CAAC,GAAa;CAC9D,MAAM,EAAE,OAAO,IAAI,QAAQ,WAAW,WAAW;EAAC;EAAG;EAAG;CAAC,MAAM;CAC/D,MAAM,OAAO,IAAIA,MAAAA,KAAK,IAAIC,MAAAA,YAAY,MAAM,MAAM,IAAI,GAAG,IAAIC,MAAAA,qBAAqB,EAAE,MAAM,CAAC,CAAC;CAC5F,KAAK,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS,EAAE;CACvD,KAAK,OAAO;CACZ,OAAO;AACT"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Object3D } from "three";
|
|
2
|
+
import { Vec3 } from "@scenography/core";
|
|
3
|
+
|
|
4
|
+
//#region src/cube.d.ts
|
|
5
|
+
interface CubeOptions {
|
|
6
|
+
/** Edge length in world units. Defaults to `50`. */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** CSS-style color. Defaults to a warm gray. */
|
|
9
|
+
color?: string;
|
|
10
|
+
/** World position `[x, y, z]`. Defaults to the origin. */
|
|
11
|
+
position?: Vec3;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The first prop: a simple cube. Props are plain factory functions returning a
|
|
15
|
+
* three.js object, so the catalog stays tree-shakeable and each project can add
|
|
16
|
+
* its own without touching the engine.
|
|
17
|
+
*/
|
|
18
|
+
declare function createCube(options?: CubeOptions): Object3D;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type CubeOptions, createCube };
|
|
21
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Object3D } from "three";
|
|
2
|
+
import { Vec3 } from "@scenography/core";
|
|
3
|
+
|
|
4
|
+
//#region src/cube.d.ts
|
|
5
|
+
interface CubeOptions {
|
|
6
|
+
/** Edge length in world units. Defaults to `50`. */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** CSS-style color. Defaults to a warm gray. */
|
|
9
|
+
color?: string;
|
|
10
|
+
/** World position `[x, y, z]`. Defaults to the origin. */
|
|
11
|
+
position?: Vec3;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The first prop: a simple cube. Props are plain factory functions returning a
|
|
15
|
+
* three.js object, so the catalog stays tree-shakeable and each project can add
|
|
16
|
+
* its own without touching the engine.
|
|
17
|
+
*/
|
|
18
|
+
declare function createCube(options?: CubeOptions): Object3D;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type CubeOptions, createCube };
|
|
21
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BoxGeometry, Mesh, MeshStandardMaterial } from "three";
|
|
2
|
+
//#region src/cube.ts
|
|
3
|
+
/**
|
|
4
|
+
* The first prop: a simple cube. Props are plain factory functions returning a
|
|
5
|
+
* three.js object, so the catalog stays tree-shakeable and each project can add
|
|
6
|
+
* its own without touching the engine.
|
|
7
|
+
*/
|
|
8
|
+
function createCube(options = {}) {
|
|
9
|
+
const { size = 50, color = "#b88b5c", position = [
|
|
10
|
+
0,
|
|
11
|
+
0,
|
|
12
|
+
0
|
|
13
|
+
] } = options;
|
|
14
|
+
const mesh = new Mesh(new BoxGeometry(size, size, size), new MeshStandardMaterial({ color }));
|
|
15
|
+
mesh.position.set(position[0], position[1], position[2]);
|
|
16
|
+
mesh.name = "prop:cube";
|
|
17
|
+
return mesh;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { createCube };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/cube.ts"],"sourcesContent":["import { BoxGeometry, Mesh, MeshStandardMaterial, type Object3D } from \"three\";\nimport type { Vec3 } from \"@scenography/core\";\n\nexport interface CubeOptions {\n /** Edge length in world units. Defaults to `50`. */\n size?: number;\n /** CSS-style color. Defaults to a warm gray. */\n color?: string;\n /** World position `[x, y, z]`. Defaults to the origin. */\n position?: Vec3;\n}\n\n/**\n * The first prop: a simple cube. Props are plain factory functions returning a\n * three.js object, so the catalog stays tree-shakeable and each project can add\n * its own without touching the engine.\n */\nexport function createCube(options: CubeOptions = {}): Object3D {\n const { size = 50, color = \"#b88b5c\", position = [0, 0, 0] } = options;\n const mesh = new Mesh(new BoxGeometry(size, size, size), new MeshStandardMaterial({ color }));\n mesh.position.set(position[0], position[1], position[2]);\n mesh.name = \"prop:cube\";\n return mesh;\n}\n"],"mappings":";;;;;;;AAiBA,SAAgB,WAAW,UAAuB,CAAC,GAAa;CAC9D,MAAM,EAAE,OAAO,IAAI,QAAQ,WAAW,WAAW;EAAC;EAAG;EAAG;CAAC,MAAM;CAC/D,MAAM,OAAO,IAAI,KAAK,IAAI,YAAY,MAAM,MAAM,IAAI,GAAG,IAAI,qBAAqB,EAAE,MAAM,CAAC,CAAC;CAC5F,KAAK,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS,EAAE;CACvD,KAAK,OAAO;CACZ,OAAO;AACT"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@scenography/props",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Optional, tree-shakeable catalog of ready-made set-dressing objects (props) for scenography galleries.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.cts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/index.d.mts",
|
|
17
|
+
"default": "./dist/index.mjs"
|
|
18
|
+
},
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/index.d.cts",
|
|
21
|
+
"default": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@scenography/core": "0.1.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/three": "^0.160.0",
|
|
30
|
+
"three": "^0.160.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"three": ">=0.160.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsdown",
|
|
37
|
+
"dev": "tsdown --watch",
|
|
38
|
+
"typecheck": "tsc --noEmit"
|
|
39
|
+
}
|
|
40
|
+
}
|