@tresjs/nuxt 1.1.6 → 1.2.0-next.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/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@tresjs/nuxt",
3
3
  "configKey": "tres",
4
- "version": "1.1.6"
4
+ "version": "1.2.0-next.0"
5
5
  }
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { readFile } from 'fs/promises';
2
- import { defineNuxtModule, createResolver, addComponent, addImports, resolvePath } from '@nuxt/kit';
2
+ import { defineNuxtModule, addComponent, addImports, resolvePath } from '@nuxt/kit';
3
3
  import * as core from '@tresjs/core';
4
4
  import { templateCompilerOptions } from '@tresjs/core';
5
5
  import { readPackageJSON } from 'pkg-types';
@@ -14,10 +14,10 @@ const module = defineNuxtModule({
14
14
  modules: []
15
15
  },
16
16
  async setup(options, nuxt) {
17
- const resolver = createResolver(import.meta.url);
18
17
  addComponent({
19
- filePath: resolver.resolve("./runtime/components/TresCanvas.vue"),
20
- name: "TresCanvas"
18
+ name: "TresCanvas",
19
+ filePath: "@tresjs/core",
20
+ export: "TresCanvas"
21
21
  });
22
22
  nuxt.options.build.transpile.push(/@tresjs/);
23
23
  for (const name in core) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tresjs/nuxt",
3
3
  "type": "module",
4
- "version": "1.1.6",
4
+ "version": "1.2.0-next.0",
5
5
  "packageManager": "pnpm@8.6.2",
6
6
  "description": "TresJS integration for Nuxt.",
7
7
  "author": "Daniel Roe (https://github.com/danielroe/)",
@@ -33,9 +33,9 @@
33
33
  "test:watch": "vitest watch"
34
34
  },
35
35
  "dependencies": {
36
- "@nuxt/kit": "^3.7.1",
37
- "@tresjs/cientos": "3.3.0",
38
- "@tresjs/core": "3.2.1",
36
+ "@nuxt/kit": "^3.7.4",
37
+ "@tresjs/cientos": "3.4.1",
38
+ "@tresjs/core": "3.2.3",
39
39
  "@types/three": "^0.156.0",
40
40
  "mlly": "^1.4.2",
41
41
  "pkg-types": "^1.0.3",
@@ -45,16 +45,16 @@
45
45
  "devDependencies": {
46
46
  "@alvarosabu/eslint-config-vue": "^0.4.0",
47
47
  "@nuxt/eslint-config": "^0.2.0",
48
- "@nuxt/module-builder": "^0.5.1",
49
- "@nuxt/schema": "^3.7.1",
50
- "@nuxt/test-utils": "^3.7.1",
51
- "@release-it/conventional-changelog": "^7.0.1",
48
+ "@nuxt/module-builder": "^0.5.2",
49
+ "@nuxt/schema": "^3.7.4",
50
+ "@nuxt/test-utils": "^3.7.4",
51
+ "@release-it/conventional-changelog": "^7.0.2",
52
52
  "@types/node": "^20.6.0",
53
53
  "changelogen": "^0.5.5",
54
54
  "eslint": "^8.49.0",
55
- "nuxt": "^3.7.1",
55
+ "nuxt": "^3.7.4",
56
56
  "playwright": "^1.37.1",
57
- "release-it": "^16.1.5",
57
+ "release-it": "^16.2.1",
58
58
  "vitest": "^0.34.4"
59
59
  }
60
60
  }
@@ -1,62 +0,0 @@
1
- <script setup lang="ts">
2
- import { ref } from 'vue'
3
- import { TresCanvas as TC } from '@tresjs/core'
4
- import type { TresCamera } from '@tresjs/core'
5
- import { ACESFilmicToneMapping, PCFSoftShadowMap, SRGBColorSpace } from 'three'
6
- import type { ColorSpace, ShadowMapType, ToneMapping, WebGLRendererParameters } from 'three'
7
-
8
- withDefaults(defineProps<TresCanvasProps>(), {
9
- alpha: false,
10
- antialias: true,
11
- depth: true,
12
- stencil: true,
13
- preserveDrawingBuffer: false,
14
- })
15
-
16
- const rendererPresets = {
17
- realistic: {
18
- outputColorSpace: SRGBColorSpace,
19
- toneMapping: ACESFilmicToneMapping,
20
- toneMappingExposure: 3,
21
- shadowMap: {
22
- enabled: true,
23
- type: PCFSoftShadowMap,
24
- },
25
- },
26
- }
27
-
28
- type RendererPresetsType = keyof typeof rendererPresets
29
-
30
- interface TresCanvasProps extends Omit<WebGLRendererParameters, 'canvas'> {
31
- // required by for useRenderer
32
- shadows?: boolean
33
- clearColor?: string
34
- toneMapping?: ToneMapping
35
- shadowMapType?: ShadowMapType
36
- useLegacyLights?: boolean
37
- outputColorSpace?: ColorSpace
38
- toneMappingExposure?: number
39
-
40
- // required by useTresContextProvider
41
- windowSize?: boolean
42
- preset?: RendererPresetsType
43
- disableRender?: boolean
44
- camera?: TresCamera
45
- }
46
- const stateRef = ref()
47
-
48
- defineExpose({
49
- state: stateRef,
50
- })
51
- </script>
52
-
53
- <template>
54
- <ClientOnly>
55
- <TC
56
- ref="stateRef"
57
- v-bind="$props"
58
- >
59
- <slot />
60
- </TC>
61
- </ClientOnly>
62
- </template>