@threlte/gltf 2.0.2 → 3.0.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/CHANGELOG.md +12 -0
- package/package.json +2 -2
- package/src/utils/parser.js +6 -9
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threlte/gltf",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.0",
|
|
4
4
|
"description": "GLTF to Threlte converter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"meshoptimizer": "^0.18.1",
|
|
42
42
|
"prettier": "^2.8.3",
|
|
43
43
|
"prettier-plugin-svelte": "^2.9.0",
|
|
44
|
-
"sharp": "^0.
|
|
44
|
+
"sharp": "^0.32.0",
|
|
45
45
|
"svelte": "^3.55.1",
|
|
46
46
|
"three": "0.122.0",
|
|
47
47
|
"three-stdlib": "^2.21.8"
|
package/src/utils/parser.js
CHANGED
|
@@ -473,11 +473,9 @@ function parse(fileName, gltf, options = {}) {
|
|
|
473
473
|
|
|
474
474
|
const imports = `
|
|
475
475
|
${options.types ? `\nimport type * as THREE from 'three'` : ''}
|
|
476
|
-
import { Group } from 'three'
|
|
477
476
|
import { ${[
|
|
478
477
|
'T',
|
|
479
|
-
options.types && !options.isolated ? 'type Props, type Events, type Slots' : ''
|
|
480
|
-
!options.isolated && 'forwardEventHandlers'
|
|
478
|
+
options.types && !options.isolated ? 'type Props, type Events, type Slots' : ''
|
|
481
479
|
]
|
|
482
480
|
.filter(Boolean)
|
|
483
481
|
.join(', ')} } from '@threlte/core'
|
|
@@ -530,10 +528,8 @@ ${
|
|
|
530
528
|
|
|
531
529
|
|
|
532
530
|
<script${options.types ? ' lang="ts"' : ''}>
|
|
533
|
-
|
|
534
531
|
${!options.preload ? imports : ''}
|
|
535
532
|
|
|
536
|
-
${options.types && !options.isolated ? 'type $$Props = Props<THREE.Group>' : ''}
|
|
537
533
|
${options.types && !options.isolated ? 'type $$Events = Events<THREE.Group>' : ''}
|
|
538
534
|
${
|
|
539
535
|
options.types && !options.isolated
|
|
@@ -541,7 +537,10 @@ ${
|
|
|
541
537
|
: ''
|
|
542
538
|
}
|
|
543
539
|
|
|
544
|
-
|
|
540
|
+
let {
|
|
541
|
+
ref = $bindable(),
|
|
542
|
+
...props
|
|
543
|
+
}${options.types && !options.isolated ? ': Props<THREE.Group>' : ''} = $props()
|
|
545
544
|
|
|
546
545
|
${!options.preload && options.suspense ? 'const suspend = useSuspense()' : ''}
|
|
547
546
|
|
|
@@ -555,11 +554,9 @@ ${
|
|
|
555
554
|
}(gltf, ref)`
|
|
556
555
|
: ''
|
|
557
556
|
}
|
|
558
|
-
|
|
559
|
-
${!options.isolated ? 'const component = forwardEventHandlers()' : ''}
|
|
560
557
|
</script>
|
|
561
558
|
|
|
562
|
-
<T
|
|
559
|
+
<T.Group bind:ref dispose={false} ${!options.isolated ? '{...props}' : ''}>
|
|
563
560
|
{#await gltf}
|
|
564
561
|
<slot name="fallback" />
|
|
565
562
|
{:then gltf}
|