@tresjs/core 5.0.0-next.4 → 5.0.0-next.5

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.
@@ -1,4 +1,3 @@
1
- import { Object3D } from 'three';
2
1
  import { MaybeRef } from '@vueuse/core';
3
2
  import { TresObject } from '../../types';
4
- export declare function useGraph(object: MaybeRef<Object3D | TresObject>): import('vue').ComputedRef<import('../..').TresObjectMap>;
3
+ export declare function useGraph(object: MaybeRef<TresObject>): import('vue').ComputedRef<import('../..').TresObjectMap>;
@@ -57,6 +57,12 @@ export interface TresObject3D extends THREE.Object3D<THREE.Object3DEventMap> {
57
57
  export type TresObject = TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.Material | THREE.Fog) & {
58
58
  __tres?: LocalState;
59
59
  };
60
+ /**
61
+ * Union type covering all common Three.js material types
62
+ * This provides better TypeScript intellisense and type checking
63
+ * when accessing specific material properties
64
+ */
65
+ export type TresMaterial = THREE.MeshBasicMaterial | THREE.MeshStandardMaterial | THREE.MeshPhysicalMaterial | THREE.MeshLambertMaterial | THREE.MeshPhongMaterial | THREE.MeshToonMaterial | THREE.MeshNormalMaterial | THREE.MeshMatcapMaterial | THREE.MeshDepthMaterial | THREE.MeshDistanceMaterial | THREE.LineBasicMaterial | THREE.LineDashedMaterial | THREE.PointsMaterial | THREE.SpriteMaterial | THREE.ShaderMaterial | THREE.RawShaderMaterial | THREE.ShadowMaterial | THREE.Material;
60
66
  export type TresInstance = TresObject & {
61
67
  __tres: LocalState;
62
68
  };
@@ -1,14 +1,15 @@
1
- import { Material, Mesh, Object3D, Scene } from 'three';
1
+ import { Mesh, Scene } from 'three';
2
+ import { TresMaterial, TresObject } from '../types';
2
3
  export interface TresObjectMap {
3
4
  nodes: {
4
- [name: string]: Object3D;
5
+ [name: string]: TresObject;
5
6
  };
6
7
  materials: {
7
- [name: string]: Material;
8
+ [name: string]: TresMaterial;
8
9
  };
9
10
  meshes: {
10
11
  [name: string]: Mesh;
11
12
  };
12
13
  scene?: Scene;
13
14
  }
14
- export declare function buildGraph(object: Object3D): TresObjectMap;
15
+ export declare function buildGraph(object: TresObject): TresObjectMap;
package/dist/tres.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v5.0.0-next.4
3
+ * version: v5.0.0-next.5
4
4
  * (c) 2025
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
@@ -12,7 +12,7 @@ import { reactive as bo, toValue as D, watch as Ot, onUnmounted as se, defineCom
12
12
  import * as Er from "three";
13
13
  import { Layers as Lo, Scene as vr, MathUtils as Mo, Vector3 as k, MeshBasicMaterial as yr, DoubleSide as No, Clock as Vo, WebGLRenderer as Cr, Mesh as Ke, Material as Bo, Vector2 as Z, Ray as at, SphereGeometry as Uo, Object3D as je, Matrix4 as Se, BufferAttribute as Ar, Triangle as wr, Line3 as Ho, Plane as We, Raycaster as $o, Quaternion as lt, Sphere as zo, Color as Me, PCFSoftShadowMap as Ko, ACESFilmicToneMapping as jo, PerspectiveCamera as Wo, ArrowHelper as Go, Line as Yo, BufferGeometry as jt, Float32BufferAttribute as Wt, LineBasicMaterial as qo, BackSide as Xo, HemisphereLightHelper as Zo, SpotLightHelper as Qo, PointLightHelper as Jo, DirectionalLightHelper as ei } from "three";
14
14
  import { useAsyncState as ti, whenever as Gt, tryOnScopeDispose as ni, createEventHook as ye, useRafFn as br, useDevicePixelRatio as ri, useTimeout as oi, unrefElement as ii, useWindowSize as si, useElementSize as ui, refDebounced as Yt, useFps as ai, useMemory as li } from "@vueuse/core";
15
- const ci = "@tresjs/core", fi = "module", di = "5.0.0-next.4", pi = "pnpm@10.6.3", hi = "Declarative ThreeJS using Vue Components", _i = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", mi = "MIT", gi = { type: "git", url: "git+https://github.com/Tresjs/tres.git" }, Ei = ["vue", "3d", "threejs", "three", "threejs-vue"], vi = !1, yi = { ".": { types: "./dist/index.d.ts", import: "./dist/tres.js" }, "./components": { types: "./dist/src/components/index.d.ts" }, "./composables": { types: "./dist/src/composables/index.d.ts" }, "./types": { types: "./dist/src/types/index.d.ts" }, "./utils": { types: "./dist/src/utils/index.d.ts" }, "./*": "./*" }, Ci = "./dist/tres.js", Ai = "./dist/tres.js", wi = "./dist/index.d.ts", bi = ["*.d.ts", "dist"], Ti = { access: "public" }, Oi = { dev: "pnpm --filter='./playground/vue' dev", "dev:nuxt": "pnpm --filter='./playground/nuxt' dev", build: "vite build", test: "vitest", "test:ci": "vitest run", "test:ui": "vitest --ui --coverage.enabled=true", release: "release-it", coverage: "vitest run --coverage", lint: "eslint .", "lint:fix": "eslint . --fix", typecheck: "vue-tsc --noEmit", "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:serve": "vitepress serve docs", "docs:preview": "vitepress preview docs", "docs:contributors": "esno scripts/update-contributors.ts" }, Si = { three: ">=0.133", vue: ">=3.4" }, Pi = { "@alvarosabu/utils": "^3.2.0", "@pmndrs/pointer-events": "^6.6.17", "@vue/devtools-api": "^7.7.2", "@vueuse/core": "^12.5.0" }, Ii = { "@release-it/conventional-changelog": "^10.0.0", "@stackblitz/sdk": "^1.11.0", "@tresjs/cientos": "5.0.0-next.0", "@tresjs/eslint-config": "^1.4.0", "@types/three": "^0.173.0", "@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/parser": "^8.23.0", "@vitejs/plugin-vue": "^5.2.1", "@vitest/coverage-c8": "^0.33.0", "@vitest/coverage-v8": "^3.0.5", "@vitest/ui": "^3.0.5", "@vue/test-utils": "^2.4.6", eslint: "^9.19.0", "eslint-plugin-vue": "^9.32.0", esno: "^4.8.0", gsap: "^3.12.7", jsdom: "^26.0.0", kolorist: "^1.8.0", ohmyfetch: "^0.4.21", pathe: "^2.0.2", "release-it": "^18.1.2", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-visualizer": "^5.14.0", sponsorkit: "^16.3.0", three: "^0.173.0", unocss: "^65.4.3", unplugin: "^2.1.2", "unplugin-vue-components": "^28.0.0", vite: "^6.1.0", "vite-plugin-banner": "^0.8.0", "vite-plugin-dts": "4.5.0", "vite-plugin-inspect": "^10.1.0", "vite-plugin-require-transform": "^1.0.21", "vite-svg-loader": "^5.1.0", vitepress: "1.6.3", vitest: "3.0.5", vue: "3.5.13", "vue-demi": "^0.14.10", "vue-tsc": "^2.2.0" }, Di = {
15
+ const ci = "@tresjs/core", fi = "module", di = "5.0.0-next.5", pi = "pnpm@10.6.3", hi = "Declarative ThreeJS using Vue Components", _i = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", mi = "MIT", gi = { type: "git", url: "git+https://github.com/Tresjs/tres.git" }, Ei = ["vue", "3d", "threejs", "three", "threejs-vue"], vi = !1, yi = { ".": { types: "./dist/index.d.ts", import: "./dist/tres.js" }, "./components": { types: "./dist/src/components/index.d.ts" }, "./composables": { types: "./dist/src/composables/index.d.ts" }, "./types": { types: "./dist/src/types/index.d.ts" }, "./utils": { types: "./dist/src/utils/index.d.ts" }, "./*": "./*" }, Ci = "./dist/tres.js", Ai = "./dist/tres.js", wi = "./dist/index.d.ts", bi = ["*.d.ts", "dist"], Ti = { access: "public" }, Oi = { dev: "pnpm --filter='./playground/vue' dev", "dev:nuxt": "pnpm --filter='./playground/nuxt' dev", build: "vite build", test: "vitest", "test:ci": "vitest run", "test:ui": "vitest --ui --coverage.enabled=true", release: "release-it", coverage: "vitest run --coverage", lint: "eslint .", "lint:fix": "eslint . --fix", typecheck: "vue-tsc --noEmit", "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:serve": "vitepress serve docs", "docs:preview": "vitepress preview docs", "docs:contributors": "esno scripts/update-contributors.ts" }, Si = { three: ">=0.133", vue: ">=3.4" }, Pi = { "@alvarosabu/utils": "^3.2.0", "@pmndrs/pointer-events": "^6.6.17", "@vue/devtools-api": "^7.7.2", "@vueuse/core": "^12.5.0" }, Ii = { "@release-it/conventional-changelog": "^10.0.0", "@stackblitz/sdk": "^1.11.0", "@tresjs/cientos": "5.0.0-next.0", "@tresjs/eslint-config": "^1.4.0", "@types/three": "^0.177.0", "@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/parser": "^8.23.0", "@vitejs/plugin-vue": "^5.2.1", "@vitest/coverage-c8": "^0.33.0", "@vitest/coverage-v8": "^3.0.5", "@vitest/ui": "^3.0.5", "@vue/test-utils": "^2.4.6", eslint: "^9.19.0", "eslint-plugin-vue": "^9.32.0", esno: "^4.8.0", gsap: "^3.12.7", jsdom: "^26.0.0", kolorist: "^1.8.0", ohmyfetch: "^0.4.21", pathe: "^2.0.2", "release-it": "^18.1.2", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-visualizer": "^5.14.0", sponsorkit: "^16.3.0", three: "^0.177.0", unocss: "^65.4.3", unplugin: "^2.1.2", "unplugin-vue-components": "^28.0.0", vite: "^6.1.0", "vite-plugin-banner": "^0.8.0", "vite-plugin-dts": "4.5.4", "vite-plugin-inspect": "^10.1.0", "vite-plugin-require-transform": "^1.0.21", "vite-svg-loader": "^5.1.0", vitepress: "1.6.3", vitest: "3.0.5", vue: "3.5.17", "vue-demi": "^0.14.10", "vue-tsc": "^2.2.0" }, Di = {
16
16
  name: ci,
17
17
  type: fi,
18
18
  version: di,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tresjs/core",
3
3
  "type": "module",
4
- "version": "5.0.0-next.4",
4
+ "version": "5.0.0-next.5",
5
5
  "packageManager": "pnpm@10.6.3",
6
6
  "description": "Declarative ThreeJS using Vue Components",
7
7
  "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
@@ -80,7 +80,7 @@
80
80
  "@stackblitz/sdk": "^1.11.0",
81
81
  "@tresjs/cientos": "5.0.0-next.0",
82
82
  "@tresjs/eslint-config": "^1.4.0",
83
- "@types/three": "^0.173.0",
83
+ "@types/three": "^0.177.0",
84
84
  "@typescript-eslint/eslint-plugin": "^8.23.0",
85
85
  "@typescript-eslint/parser": "^8.23.0",
86
86
  "@vitejs/plugin-vue": "^5.2.1",
@@ -101,19 +101,19 @@
101
101
  "rollup-plugin-copy": "^3.5.0",
102
102
  "rollup-plugin-visualizer": "^5.14.0",
103
103
  "sponsorkit": "^16.3.0",
104
- "three": "^0.173.0",
104
+ "three": "^0.177.0",
105
105
  "unocss": "^65.4.3",
106
106
  "unplugin": "^2.1.2",
107
107
  "unplugin-vue-components": "^28.0.0",
108
108
  "vite": "^6.1.0",
109
109
  "vite-plugin-banner": "^0.8.0",
110
- "vite-plugin-dts": "4.5.0",
110
+ "vite-plugin-dts": "4.5.4",
111
111
  "vite-plugin-inspect": "^10.1.0",
112
112
  "vite-plugin-require-transform": "^1.0.21",
113
113
  "vite-svg-loader": "^5.1.0",
114
114
  "vitepress": "1.6.3",
115
115
  "vitest": "3.0.5",
116
- "vue": "3.5.13",
116
+ "vue": "3.5.17",
117
117
  "vue-demi": "^0.14.10",
118
118
  "vue-tsc": "^2.2.0"
119
119
  }