@tresjs/nuxt 1.0.2 → 1.1.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 +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -5
- package/dist/runtime/components/TresCanvas.vue +29 -27
- package/package.json +16 -18
package/README.md
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
1
2
|
import { defineNuxtModule, createResolver, addComponent, addImports, resolvePath } from '@nuxt/kit';
|
|
2
3
|
import * as core from '@tresjs/core';
|
|
4
|
+
import { templateCompilerOptions } from '@tresjs/core';
|
|
3
5
|
import { readPackageJSON } from 'pkg-types';
|
|
4
6
|
import { findExportNames } from 'mlly';
|
|
5
|
-
import { readFile } from 'fs/promises';
|
|
6
7
|
|
|
7
8
|
const module = defineNuxtModule({
|
|
8
9
|
meta: {
|
|
@@ -42,10 +43,7 @@ const module = defineNuxtModule({
|
|
|
42
43
|
nuxt.hook("prepare:types", ({ references }) => {
|
|
43
44
|
references.push({ types: "@tresjs/core" });
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
-
nuxt.options.vue.compilerOptions.isCustomElement = (tag) => {
|
|
47
|
-
return tag.startsWith("Tres") && tag !== "TresCanvas" || tag === "primitive" || isCustomElement?.(tag);
|
|
48
|
-
};
|
|
46
|
+
nuxt.options.vue.compilerOptions.isCustomElement = templateCompilerOptions.template.compilerOptions.isCustomElement;
|
|
49
47
|
const pkg = await readPackageJSON(nuxt.options.rootDir);
|
|
50
48
|
const coreDeps = Object.keys({ ...pkg.dependencies, ...pkg.devDependencies }).filter((d) => d.startsWith("@tresjs/"));
|
|
51
49
|
for (const mod of /* @__PURE__ */ new Set([...options.modules, ...coreDeps])) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref } from
|
|
3
|
-
import { TresCanvas as TC } from
|
|
4
|
-
import type { TresCamera } from
|
|
5
|
-
import {
|
|
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 } from 'three'
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
defineProps<TresCanvasProps>()
|
|
8
9
|
|
|
9
10
|
const rendererPresets = {
|
|
10
11
|
realistic: {
|
|
@@ -16,39 +17,40 @@ const rendererPresets = {
|
|
|
16
17
|
type: PCFSoftShadowMap,
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
|
-
}
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
type RendererPresetsType = keyof typeof rendererPresets
|
|
22
|
+
type RendererPresetsType = keyof typeof rendererPresets
|
|
22
23
|
|
|
23
24
|
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?:
|
|
33
|
-
preserveDrawingBuffer?: boolean
|
|
34
|
-
clearColor?: string
|
|
35
|
-
windowSize?: boolean
|
|
36
|
-
preset?: RendererPresetsType
|
|
37
|
-
disableRender?: boolean
|
|
38
|
-
camera?: TresCamera
|
|
25
|
+
shadows?: boolean
|
|
26
|
+
shadowMapType?: ShadowMapType
|
|
27
|
+
physicallyCorrectLights?: boolean
|
|
28
|
+
useLegacyLights?: boolean
|
|
29
|
+
outputColorSpace?: ColorSpace
|
|
30
|
+
toneMapping?: ToneMapping
|
|
31
|
+
toneMappingExposure?: number
|
|
32
|
+
context?: WebGLRenderingContext
|
|
33
|
+
powerPreference?: 'high-performance' | 'low-power' | 'default'
|
|
34
|
+
preserveDrawingBuffer?: boolean
|
|
35
|
+
clearColor?: string
|
|
36
|
+
windowSize?: boolean
|
|
37
|
+
preset?: RendererPresetsType
|
|
38
|
+
disableRender?: boolean
|
|
39
|
+
camera?: TresCamera
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const stateRef = ref();
|
|
41
|
+
const stateRef = ref()
|
|
43
42
|
|
|
44
43
|
defineExpose({
|
|
45
44
|
state: stateRef,
|
|
46
|
-
})
|
|
45
|
+
})
|
|
47
46
|
</script>
|
|
48
47
|
|
|
49
48
|
<template>
|
|
50
49
|
<ClientOnly>
|
|
51
|
-
<TC
|
|
50
|
+
<TC
|
|
51
|
+
ref="stateRef"
|
|
52
|
+
v-bind="$props"
|
|
53
|
+
>
|
|
52
54
|
<slot />
|
|
53
55
|
</TC>
|
|
54
56
|
</ClientOnly>
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tresjs/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
+
"version": "1.1.1",
|
|
4
5
|
"packageManager": "pnpm@8.6.2",
|
|
5
|
-
"version": "1.0.2",
|
|
6
6
|
"description": "TresJS integration for Nuxt.",
|
|
7
|
-
"repository": "@tresjs/nuxt",
|
|
8
7
|
"author": "Daniel Roe (https://github.com/danielroe/)",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": "@tresjs/nuxt",
|
|
9
10
|
"publishConfig": {
|
|
10
11
|
"access": "public"
|
|
11
12
|
},
|
|
12
|
-
"license": "MIT",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/types.d.ts",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
16
|
+
"require": "./dist/module.cjs",
|
|
17
|
+
"import": "./dist/module.mjs"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"main": "./dist/module.cjs",
|
|
@@ -33,29 +33,27 @@
|
|
|
33
33
|
"test:watch": "vitest watch"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@nuxt/kit": "^3.6.
|
|
37
|
-
"@tresjs/
|
|
38
|
-
"@tresjs/core": "^2.4.2",
|
|
39
|
-
"@tresjs/post-processing": "^0.3.0",
|
|
36
|
+
"@nuxt/kit": "^3.6.5",
|
|
37
|
+
"@tresjs/core": "^3.0.1",
|
|
40
38
|
"@types/three": "^0.154.0",
|
|
41
39
|
"mlly": "^1.4.0",
|
|
42
40
|
"pkg-types": "^1.0.3",
|
|
43
|
-
"three": "^0.
|
|
41
|
+
"three": "^0.155.0",
|
|
44
42
|
"typescript": "^5.1.6"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
|
-
"@alvarosabu/eslint-config-vue": "^0.
|
|
45
|
+
"@alvarosabu/eslint-config-vue": "^0.4.0",
|
|
48
46
|
"@nuxt/eslint-config": "^0.1.1",
|
|
49
47
|
"@nuxt/module-builder": "^0.4.0",
|
|
50
|
-
"@nuxt/schema": "^3.6.
|
|
51
|
-
"@nuxt/test-utils": "^3.6.
|
|
48
|
+
"@nuxt/schema": "^3.6.5",
|
|
49
|
+
"@nuxt/test-utils": "^3.6.5",
|
|
52
50
|
"@release-it/conventional-changelog": "^7.0.0",
|
|
53
|
-
"@types/node": "^20.4.
|
|
51
|
+
"@types/node": "^20.4.5",
|
|
54
52
|
"changelogen": "^0.5.4",
|
|
55
|
-
"eslint": "^8.
|
|
56
|
-
"nuxt": "^3.6.
|
|
57
|
-
"playwright": "^1.36.
|
|
58
|
-
"release-it": "^16.1.
|
|
53
|
+
"eslint": "^8.46.0",
|
|
54
|
+
"nuxt": "^3.6.5",
|
|
55
|
+
"playwright": "^1.36.2",
|
|
56
|
+
"release-it": "^16.1.3",
|
|
59
57
|
"vitest": "^0.33.0"
|
|
60
58
|
}
|
|
61
59
|
}
|