@tresjs/nuxt 1.0.0-beta.2 → 1.0.1

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/README.md CHANGED
@@ -17,7 +17,7 @@ Official Nuxt module for TresJS. Build 3D scenes as they were Vue components.
17
17
 
18
18
  - 🤓 Auto-import components and composables from the [TresJS ecosystem](https://github.com/orgs/Tresjs/repositories)
19
19
  - `TresCanvas` client only, you don't need to add `.client` to the component name or `<ClientOnly />`
20
- - Automatically configures vue compiler to support TresJS components, see [why](http://localhost:5174/guide/troubleshooting.html#failed-resolve-component-trescomponent-%F0%9F%A4%94)?
20
+ - Automatically configures vue compiler to support TresJS components, see [why](https://tresjs.org/guide/troubleshooting.html#failed-resolve-component-trescomponent-%F0%9F%A4%94)?
21
21
  - All the DX Magic that comes with Nuxt ✨
22
22
 
23
23
  ## Quick Setup
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@tresjs/nuxt",
3
3
  "configKey": "tres",
4
- "version": "1.0.0-beta.2"
4
+ "version": "1.0.1"
5
5
  }
@@ -1,21 +1,54 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue'
3
- import { TresCanvas as TC, TresCanvasProps } from '@tresjs/core';
4
- defineProps<TresCanvasProps>()
2
+ import { ref } from "vue";
3
+ import { TresCanvas as TC } from "@tresjs/core";
4
+ import type { TresCamera } from "@tresjs/core";
5
+ import { ColorSpace, ShadowMapType, ToneMapping } from "three";
5
6
 
6
- const stateRef = ref()
7
+ import { ACESFilmicToneMapping, PCFSoftShadowMap, SRGBColorSpace } from "three";
8
+
9
+ const rendererPresets = {
10
+ realistic: {
11
+ outputColorSpace: SRGBColorSpace,
12
+ toneMapping: ACESFilmicToneMapping,
13
+ toneMappingExposure: 3,
14
+ shadowMap: {
15
+ enabled: true,
16
+ type: PCFSoftShadowMap,
17
+ },
18
+ },
19
+ };
20
+
21
+ type RendererPresetsType = keyof typeof rendererPresets;
22
+
23
+ interface TresCanvasProps {
24
+ shadows?: boolean;
25
+ shadowMapType?: ShadowMapType;
26
+ physicallyCorrectLights?: boolean;
27
+ useLegacyLights?: boolean;
28
+ outputColorSpace?: ColorSpace;
29
+ toneMapping?: ToneMapping;
30
+ toneMappingExposure?: number;
31
+ context?: WebGLRenderingContext;
32
+ powerPreference?: "high-performance" | "low-power" | "default";
33
+ preserveDrawingBuffer?: boolean;
34
+ clearColor?: string;
35
+ windowSize?: boolean;
36
+ preset?: RendererPresetsType;
37
+ disableRender?: boolean;
38
+ camera?: TresCamera;
39
+ }
40
+ defineProps<TresCanvasProps>();
41
+
42
+ const stateRef = ref();
7
43
 
8
44
  defineExpose({
9
- state: stateRef
10
- })
45
+ state: stateRef,
46
+ });
11
47
  </script>
12
48
 
13
49
  <template>
14
50
  <ClientOnly>
15
- <TC
16
- ref="stateRef"
17
- v-bind="$props"
18
- >
51
+ <TC ref="stateRef" v-bind="$props">
19
52
  <slot />
20
53
  </TC>
21
54
  </ClientOnly>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tresjs/nuxt",
3
3
  "type": "module",
4
4
  "packageManager": "pnpm@8.6.2",
5
- "version": "1.0.0-beta.2",
5
+ "version": "1.0.1",
6
6
  "description": "TresJS integration for Nuxt.",
7
7
  "repository": "@tresjs/nuxt",
8
8
  "author": "Daniel Roe (https://github.com/danielroe/)",
@@ -33,28 +33,29 @@
33
33
  "test:watch": "vitest watch"
34
34
  },
35
35
  "dependencies": {
36
- "@nuxt/kit": "^3.5.2",
37
- "@tresjs/cientos": "^2.1.4",
38
- "@tresjs/core": "^2.2.0",
39
- "@tresjs/post-processing": "^0.2.0",
40
- "@types/three": "^0.152.1",
41
- "mlly": "^1.3.0",
36
+ "@nuxt/kit": "^3.6.3",
37
+ "@tresjs/cientos": "^2.3.0",
38
+ "@tresjs/core": "^2.4.2",
39
+ "@tresjs/post-processing": "^0.3.0",
40
+ "@types/three": "^0.154.0",
41
+ "mlly": "^1.4.0",
42
42
  "pkg-types": "^1.0.3",
43
- "three": "^0.153.0",
44
- "typescript": "^5.1.3"
43
+ "three": "^0.154.0",
44
+ "typescript": "^5.1.6"
45
45
  },
46
46
  "devDependencies": {
47
+ "@alvarosabu/eslint-config-vue": "^0.3.3",
47
48
  "@nuxt/eslint-config": "^0.1.1",
48
49
  "@nuxt/module-builder": "^0.4.0",
49
- "@nuxt/schema": "^3.5.2",
50
- "@nuxt/test-utils": "^3.5.1",
51
- "@release-it/conventional-changelog": "^5.1.1",
52
- "@types/node": "^20.3.1",
53
- "changelogen": "^0.5.3",
54
- "eslint": "^8.43.0",
55
- "nuxt": "^3.5.1",
56
- "playwright": "^1.35.1",
57
- "release-it": "^15.11.0",
58
- "vitest": "^0.32.2"
50
+ "@nuxt/schema": "^3.6.3",
51
+ "@nuxt/test-utils": "^3.6.3",
52
+ "@release-it/conventional-changelog": "^7.0.0",
53
+ "@types/node": "^20.4.2",
54
+ "changelogen": "^0.5.4",
55
+ "eslint": "^8.45.0",
56
+ "nuxt": "^3.6.3",
57
+ "playwright": "^1.36.1",
58
+ "release-it": "^16.1.2",
59
+ "vitest": "^0.33.0"
59
60
  }
60
61
  }