@tresjs/core 5.8.1 → 5.8.3

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,6 +1,6 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v5.8.1
3
+ * version: v5.8.3
4
4
  * (c) 2026
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v5.8.1
3
+ * version: v5.8.3
4
4
  * (c) 2026
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
package/dist/tres.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v5.8.1
3
+ * version: v5.8.3
4
4
  * (c) 2026
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import * as vue15 from "vue";
8
+ import * as vue14 from "vue";
9
9
  import { App, ComputedRef, DefineComponent, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef, VNode, VNodeRef } from "vue";
10
10
  import * as THREE from "three";
11
11
  import { BufferGeometry, Camera, Color, ColorRepresentation, ColorSpace, Event, Fog, Group, Layers, Light, Loader, LoadingManager, Material, Mesh, Object3D, Object3DEventMap, OrthographicCamera, PerspectiveCamera, Scene, ShadowMapType, ToneMapping, Vector3, WebGLRenderer } from "three";
12
12
  import * as _vueuse_core0 from "@vueuse/core";
13
- import { EventHookOff, MaybeRef as MaybeRef$1, UseAsyncStateOptions, UseAsyncStateReturn } from "@vueuse/core";
13
+ import { EventHookOff, UseAsyncStateOptions, UseAsyncStateReturn } from "@vueuse/core";
14
14
  import { PointerEvent, PointerEventsMap } from "@pmndrs/pointer-events";
15
15
  import { Renderer } from "three/webgpu";
16
16
 
@@ -323,11 +323,11 @@ declare function useRendererManager({
323
323
  onRender: _vueuse_core0.EventHookOn<TresRenderer>;
324
324
  onError: _vueuse_core0.EventHookOn<TresRendererError>;
325
325
  invalidate: (amountOfFramesToInvalidate?: number) => void;
326
- canBeInvalidated: vue15.ComputedRef<boolean>;
326
+ canBeInvalidated: vue14.ComputedRef<boolean>;
327
327
  mode: "always" | "on-demand" | "manual" | undefined;
328
328
  replaceRenderFunction: (fn: RenderFunction) => void;
329
- isInitialized: vue15.Ref<boolean, boolean>;
330
- error: vue15.Ref<TresRendererError | null, TresRendererError | null>;
329
+ isInitialized: vue14.Ref<boolean, boolean>;
330
+ error: vue14.Ref<TresRendererError | null, TresRendererError | null>;
331
331
  };
332
332
  type UseRendererManagerReturn = ReturnType<typeof useRendererManager>;
333
333
  //#endregion
@@ -515,7 +515,7 @@ declare function buildGraph(object: Object3D | TresObject): TresObjectMap;
515
515
  //#endregion
516
516
  //#region src/composables/useLoader/component.vue.d.ts
517
517
  declare const __VLS_export$2: <T extends TresObjectMap>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
518
- props: vue15.PublicProps & __VLS_PrettifyLocal<{
518
+ props: vue14.PublicProps & __VLS_PrettifyLocal<{
519
519
  /**
520
520
  * The THREE.js loader to use
521
521
  */
@@ -539,20 +539,20 @@ declare const __VLS_export$2: <T extends TresObjectMap>(__VLS_props: NonNullable
539
539
  attrs: any;
540
540
  slots: {
541
541
  default?: (props: {
542
- state: vue15.UnwrapRef<T>;
542
+ state: vue14.UnwrapRef<T>;
543
543
  isLoading: boolean;
544
544
  error: unknown;
545
545
  }) => any;
546
546
  };
547
547
  emit: ((evt: "error", error: unknown) => void) & ((evt: "loaded", result: T) => void);
548
- }>) => vue15.VNode & {
548
+ }>) => vue14.VNode & {
549
549
  __ctx?: Awaited<typeof __VLS_setup>;
550
550
  };
551
551
  declare const _default$2: typeof __VLS_export$2;
552
552
  type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
553
553
  //#endregion
554
554
  //#region src/composables/useGraph/index.d.ts
555
- declare const useGraph: (object: MaybeRef$1<TresObject | undefined>) => vue15.ComputedRef<TresObjectMap | undefined>;
555
+ declare const useGraph: (object: MaybeRef<TresObject | undefined>) => vue14.ComputedRef<TresObjectMap | undefined>;
556
556
  //#endregion
557
557
  //#region src/utils/createPriorityEventHook.d.ts
558
558
  type Callback<T> = Parameters<EventHookOff<T>>[0];
@@ -603,7 +603,7 @@ type LoopContext = RafLoopContext & TresPartialContext;
603
603
  declare const useLoop: () => {
604
604
  stop: () => void;
605
605
  start: () => void;
606
- isActive: Readonly<vue15.ShallowRef<boolean>>;
606
+ isActive: Readonly<vue14.ShallowRef<boolean>>;
607
607
  onBeforeRender: PriorityEventHookOn<LoopContext>;
608
608
  onRender: PriorityEventHookOn<LoopContext>;
609
609
  render: (fn: RenderFunction) => void;
@@ -710,10 +710,10 @@ type __VLS_Props = ContextProps & {
710
710
  type __VLS_Slots$1 = {
711
711
  default: () => any;
712
712
  };
713
- declare const __VLS_base$1: vue15.DefineComponent<__VLS_Props, {
714
- context: vue15.ShallowRef<TresContext, TresContext>;
713
+ declare const __VLS_base$1: vue14.DefineComponent<__VLS_Props, {
714
+ context: vue14.ShallowRef<TresContext, TresContext>;
715
715
  dispose: () => void;
716
- }, {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {
716
+ }, {}, {}, {}, vue14.ComponentOptionsMixin, vue14.ComponentOptionsMixin, {
717
717
  click: (event: TresPointerEvent) => any;
718
718
  contextmenu: (event: TresPointerEvent) => any;
719
719
  pointermove: (event: TresPointerEvent) => any;
@@ -733,7 +733,7 @@ declare const __VLS_base$1: vue15.DefineComponent<__VLS_Props, {
733
733
  render: (context: TresContext) => any;
734
734
  beforeLoop: (context: TresContextWithClock) => any;
735
735
  loop: (context: TresContextWithClock) => any;
736
- }, string, vue15.PublicProps, Readonly<__VLS_Props> & Readonly<{
736
+ }, string, vue14.PublicProps, Readonly<__VLS_Props> & Readonly<{
737
737
  onClick?: ((event: TresPointerEvent) => any) | undefined;
738
738
  onContextmenu?: ((event: TresPointerEvent) => any) | undefined;
739
739
  onPointermove?: ((event: TresPointerEvent) => any) | undefined;
@@ -753,7 +753,7 @@ declare const __VLS_base$1: vue15.DefineComponent<__VLS_Props, {
753
753
  onRender?: ((context: TresContext) => any) | undefined;
754
754
  onBeforeLoop?: ((context: TresContextWithClock) => any) | undefined;
755
755
  onLoop?: ((context: TresContextWithClock) => any) | undefined;
756
- }>, {}, {}, {}, {}, string, vue15.ComponentProvideOptions, false, {}, any>;
756
+ }>, {}, {}, {}, {}, string, vue14.ComponentProvideOptions, false, {}, any>;
757
757
  declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
758
758
  declare const _default$1: typeof __VLS_export$1;
759
759
  type __VLS_WithSlots$1<T, S> = T & {
@@ -772,7 +772,7 @@ interface TresCanvasInstance {
772
772
  type __VLS_Slots = {
773
773
  default: () => any;
774
774
  };
775
- declare const __VLS_base: vue15.DefineComponent<ContextProps, TresCanvasInstance, {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {
775
+ declare const __VLS_base: vue14.DefineComponent<ContextProps, TresCanvasInstance, {}, {}, {}, vue14.ComponentOptionsMixin, vue14.ComponentOptionsMixin, {
776
776
  click: (event: TresPointerEvent) => any;
777
777
  contextmenu: (event: TresPointerEvent) => any;
778
778
  pointermove: (event: TresPointerEvent) => any;
@@ -792,7 +792,7 @@ declare const __VLS_base: vue15.DefineComponent<ContextProps, TresCanvasInstance
792
792
  render: (context: TresContext) => any;
793
793
  beforeLoop: (context: TresContextWithClock) => any;
794
794
  loop: (context: TresContextWithClock) => any;
795
- }, string, vue15.PublicProps, Readonly<ContextProps> & Readonly<{
795
+ }, string, vue14.PublicProps, Readonly<ContextProps> & Readonly<{
796
796
  onClick?: ((event: TresPointerEvent) => any) | undefined;
797
797
  onContextmenu?: ((event: TresPointerEvent) => any) | undefined;
798
798
  onPointermove?: ((event: TresPointerEvent) => any) | undefined;
@@ -829,7 +829,7 @@ declare const __VLS_base: vue15.DefineComponent<ContextProps, TresCanvasInstance
829
829
  shadowMapType: THREE.ShadowMapType;
830
830
  useLegacyLights: boolean;
831
831
  renderMode: "always" | "on-demand" | "manual";
832
- }, {}, {}, {}, string, vue15.ComponentProvideOptions, false, {}, any>;
832
+ }, {}, {}, {}, string, vue14.ComponentProvideOptions, false, {}, any>;
833
833
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
834
834
  declare const _default: typeof __VLS_export;
835
835
  type __VLS_WithSlots<T, S> = T & {
@@ -966,7 +966,7 @@ declare const isObject3D: (value: unknown) => value is Object3D<THREE.Object3DEv
966
966
  * // TypeScript knows value is Mesh here
967
967
  * value.geometry // OK
968
968
  */
969
- declare const isMesh: (value: unknown) => value is Mesh<BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, Material | Material[], THREE.Object3DEventMap>;
969
+ declare const isMesh: (value: unknown) => value is Mesh<BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, Material<THREE.MaterialEventMap> | Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>;
970
970
  /**
971
971
  * Type guard to check if a value is a Three.js Camera
972
972
  * @param value - The value to check
@@ -1044,7 +1044,7 @@ declare const isBufferGeometry: (value: unknown) => value is BufferGeometry<THRE
1044
1044
  * }
1045
1045
  * ```
1046
1046
  */
1047
- declare const isMaterial: (value: unknown) => value is Material;
1047
+ declare const isMaterial: (value: unknown) => value is Material<THREE.MaterialEventMap>;
1048
1048
  /**
1049
1049
  * Type guard to check if a value is a Three.js Light
1050
1050
  * @param value - The value to check
@@ -1092,7 +1092,7 @@ declare const isFog: (value: unknown) => value is Fog;
1092
1092
  * }
1093
1093
  * ```
1094
1094
  */
1095
- declare const isScene: (value: unknown) => value is Scene;
1095
+ declare const isScene: (value: unknown) => value is Scene<THREE.Object3DEventMap>;
1096
1096
  /**
1097
1097
  * Type guard to check if a value is a Three.js Group
1098
1098
  * @param value - The value to check
package/dist/tres.js CHANGED
@@ -1,20 +1,21 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v5.8.1
3
+ * version: v5.8.3
4
4
  * (c) 2026
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
8
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createRenderer, defineComponent, getCurrentInstance, h, isRef, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, reactive, readonly, ref, renderSlot, shallowRef, toValue, unref, useSlots, watch, watchEffect, withCtx } from "vue";
9
9
  import * as THREE from "three";
10
- import { ACESFilmicToneMapping, ArrowHelper, BackSide, BufferAttribute, BufferGeometry, Color, DirectionalLightHelper, DoubleSide, Float32BufferAttribute, HemisphereLightHelper, Layers, Line, LineBasicMaterial, Material, MathUtils, Mesh, MeshBasicMaterial, PCFSoftShadowMap, PerspectiveCamera, PointLightHelper, REVISION, Scene, SpotLightHelper, Vector3, WebGLRenderer } from "three";
10
+ import { ACESFilmicToneMapping, ArrowHelper, BufferAttribute, Color, DirectionalLightHelper, DoubleSide, HemisphereLightHelper, Layers, Material, MathUtils, Mesh, MeshBasicMaterial, PCFSoftShadowMap, PerspectiveCamera, PointLightHelper, REVISION, Scene, SpotLightHelper, Vector3, WebGLRenderer } from "three";
11
11
  import { createEventHook, createInjectionState, promiseTimeout, refDebounced, tryOnScopeDispose, unrefElement, useAsyncState, useDevicePixelRatio, useElementSize, useFps, useMemory, useRafFn, useTimeout, useWindowSize, whenever } from "@vueuse/core";
12
12
  import { camel, isEqual, isFunction, isNumber, isObject, isString, isUndefined } from "radashi";
13
13
  import { forwardHtmlEvents, getVoidObject } from "@pmndrs/pointer-events";
14
14
  import { setupDevtoolsPlugin } from "@vue/devtools-api";
15
+ import { RectAreaLightHelper } from "three/examples/jsm/helpers/RectAreaLightHelper.js";
15
16
 
16
17
  //#region package.json
17
- var version = "5.8.1";
18
+ var version = "5.8.3";
18
19
 
19
20
  //#endregion
20
21
  //#region src/utils/makeMap.ts
@@ -2520,86 +2521,6 @@ const vDistanceTo = {
2520
2521
  }
2521
2522
  };
2522
2523
 
2523
- //#endregion
2524
- //#region ../../node_modules/.pnpm/three-stdlib@2.36.1_three@0.183.1/node_modules/three-stdlib/helpers/RectAreaLightHelper.js
2525
- var RectAreaLightHelper = class extends Line {
2526
- constructor(light, color) {
2527
- const positions = [
2528
- 1,
2529
- 1,
2530
- 0,
2531
- -1,
2532
- 1,
2533
- 0,
2534
- -1,
2535
- -1,
2536
- 0,
2537
- 1,
2538
- -1,
2539
- 0,
2540
- 1,
2541
- 1,
2542
- 0
2543
- ];
2544
- const geometry = new BufferGeometry();
2545
- geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
2546
- geometry.computeBoundingSphere();
2547
- const material = new LineBasicMaterial({ fog: false });
2548
- super(geometry, material);
2549
- this.light = light;
2550
- this.color = color;
2551
- this.type = "RectAreaLightHelper";
2552
- const positions2 = [
2553
- 1,
2554
- 1,
2555
- 0,
2556
- -1,
2557
- 1,
2558
- 0,
2559
- -1,
2560
- -1,
2561
- 0,
2562
- 1,
2563
- 1,
2564
- 0,
2565
- -1,
2566
- -1,
2567
- 0,
2568
- 1,
2569
- -1,
2570
- 0
2571
- ];
2572
- const geometry2 = new BufferGeometry();
2573
- geometry2.setAttribute("position", new Float32BufferAttribute(positions2, 3));
2574
- geometry2.computeBoundingSphere();
2575
- this.add(new Mesh(geometry2, new MeshBasicMaterial({
2576
- side: BackSide,
2577
- fog: false
2578
- })));
2579
- }
2580
- updateMatrixWorld() {
2581
- this.scale.set(.5 * this.light.width, .5 * this.light.height, 1);
2582
- if (this.color !== void 0) {
2583
- this.material.color.set(this.color);
2584
- this.children[0].material.color.set(this.color);
2585
- } else {
2586
- this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
2587
- const c = this.material.color;
2588
- const max = Math.max(c.r, c.g, c.b);
2589
- if (max > 1) c.multiplyScalar(1 / max);
2590
- this.children[0].material.color.copy(this.material.color);
2591
- }
2592
- this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld);
2593
- this.children[0].matrixWorld.copy(this.matrixWorld);
2594
- }
2595
- dispose() {
2596
- this.geometry.dispose();
2597
- this.material.dispose();
2598
- this.children[0].geometry.dispose();
2599
- this.children[0].material.dispose();
2600
- }
2601
- };
2602
-
2603
2524
  //#endregion
2604
2525
  //#region src/directives/vLightHelper.ts
2605
2526
  let CurrentHelper;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tresjs/core",
3
3
  "type": "module",
4
- "version": "5.8.1",
4
+ "version": "5.8.3",
5
5
  "description": "Declarative ThreeJS using Vue Components",
6
6
  "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
7
7
  "license": "MIT",
@@ -45,38 +45,39 @@
45
45
  "vue": ">=3.4"
46
46
  },
47
47
  "dependencies": {
48
- "@pmndrs/pointer-events": "^6.6.17",
49
- "@vue/devtools-api": "^7.7.2",
50
- "@vueuse/core": "^13.9.0",
51
- "radashi": "^12.6.2"
48
+ "@pmndrs/pointer-events": "^6.6.30",
49
+ "@vue/devtools-api": "^8.1.2",
50
+ "@vueuse/core": "^14.3.0",
51
+ "radashi": "^12.9.1"
52
52
  },
53
53
  "devDependencies": {
54
- "@types/three": "^0.183.0",
55
- "@typescript-eslint/eslint-plugin": "^8.42.0",
56
- "@typescript-eslint/parser": "^8.42.0",
57
- "@vitejs/plugin-vue": "^6.0.1",
58
- "@vitest/coverage-v8": "3.2.4",
59
- "@vitest/ui": "^3.2.4",
60
- "@vue/test-utils": "^2.4.6",
61
- "eslint": "^9.34.0",
62
- "eslint-plugin-vue": "^10.4.0",
63
- "jsdom": "^27.0.0",
54
+ "@types/node": "^25.9.3",
55
+ "@types/three": "^0.184.1",
56
+ "@typescript-eslint/eslint-plugin": "^8.61.0",
57
+ "@typescript-eslint/parser": "^8.61.0",
58
+ "@vitejs/plugin-vue": "^6.0.7",
59
+ "@vitest/coverage-v8": "^4.1.8",
60
+ "@vitest/ui": "^4.1.8",
61
+ "@vue/test-utils": "^2.4.11",
62
+ "eslint": "^10.4.1",
63
+ "eslint-plugin-vue": "^10.9.2",
64
+ "jsdom": "^29.1.1",
64
65
  "kolorist": "^1.8.0",
65
66
  "pathe": "^2.0.3",
66
67
  "rollup-plugin-analyzer": "^4.0.0",
67
68
  "rollup-plugin-copy": "^3.5.0",
68
- "rollup-plugin-visualizer": "^6.0.3",
69
- "three": "^0.183.0",
69
+ "rollup-plugin-visualizer": "^7.0.1",
70
+ "three": "^0.184.0",
70
71
  "tsdown": "0.18.3",
71
- "typescript": "^5.8.3",
72
- "vite": "^7.1.9",
72
+ "typescript": "^6.0.3",
73
+ "vite": "^8.0.16",
73
74
  "vite-plugin-banner": "^0.8.1",
74
75
  "vite-plugin-dts": "4.5.4",
75
- "vite-plugin-inspect": "^11.3.3",
76
- "vitest": "3.2.4",
77
- "vue": "^3.5.22",
76
+ "vite-plugin-inspect": "^11.4.1",
77
+ "vitest": "4.1.8",
78
+ "vue": "^3.5.38",
78
79
  "vue-demi": "^0.14.10",
79
- "vue-tsc": "^3.2.1",
80
+ "vue-tsc": "^3.3.4",
80
81
  "@tresjs/eslint-config": "1.6.0"
81
82
  },
82
83
  "nx": {