-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into docs/demo-basic
- Loading branch information
Showing
16 changed files
with
1,131 additions
and
600 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@tresjs/core", | ||
"type": "module", | ||
"version": "4.2.10", | ||
"version": "4.3.0", | ||
"packageManager": "[email protected]", | ||
"description": "Declarative ThreeJS using Vue Components", | ||
"author": "Alvaro Saburido <[email protected]> (https://github.com/alvarosabu/)", | ||
|
@@ -71,7 +71,7 @@ | |
}, | ||
"dependencies": { | ||
"@alvarosabu/utils": "^3.2.0", | ||
"@vue/devtools-api": "^7.4.5", | ||
"@vue/devtools-api": "^6.6.3", | ||
"@vueuse/core": "^11.1.0" | ||
}, | ||
"devDependencies": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"globals": { | ||
"Component": true, | ||
"ComponentPublicInstance": true, | ||
"ComputedRef": true, | ||
"EffectScope": true, | ||
"ExtractDefaultPropTypes": true, | ||
"ExtractPropTypes": true, | ||
"ExtractPublicPropTypes": true, | ||
"InjectionKey": true, | ||
"PropType": true, | ||
"Ref": true, | ||
"VNode": true, | ||
"WritableComputedRef": true, | ||
"computed": true, | ||
"createApp": true, | ||
"customRef": true, | ||
"defineAsyncComponent": true, | ||
"defineComponent": true, | ||
"effectScope": true, | ||
"getCurrentInstance": true, | ||
"getCurrentScope": true, | ||
"h": true, | ||
"inject": true, | ||
"isProxy": true, | ||
"isReactive": true, | ||
"isReadonly": true, | ||
"isRef": true, | ||
"markRaw": true, | ||
"nextTick": true, | ||
"onActivated": true, | ||
"onBeforeMount": true, | ||
"onBeforeUnmount": true, | ||
"onBeforeUpdate": true, | ||
"onDeactivated": true, | ||
"onErrorCaptured": true, | ||
"onMounted": true, | ||
"onRenderTracked": true, | ||
"onRenderTriggered": true, | ||
"onScopeDispose": true, | ||
"onServerPrefetch": true, | ||
"onUnmounted": true, | ||
"onUpdated": true, | ||
"provide": true, | ||
"reactive": true, | ||
"readonly": true, | ||
"ref": true, | ||
"resolveComponent": true, | ||
"shallowReactive": true, | ||
"shallowReadonly": true, | ||
"shallowRef": true, | ||
"toRaw": true, | ||
"toRef": true, | ||
"toRefs": true, | ||
"toValue": true, | ||
"triggerRef": true, | ||
"unref": true, | ||
"useAttrs": true, | ||
"useCssModule": true, | ||
"useCssVars": true, | ||
"useSlots": true, | ||
"watch": true, | ||
"watchEffect": true, | ||
"watchPostEffect": true, | ||
"watchSyncEffect": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- ProvideBridge.vue --> | ||
<script setup lang="ts"> | ||
import { provide } from 'vue' | ||
interface Props { | ||
keysValues: Record<string, any> | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
keysValues: () => ({}), | ||
}) | ||
for (const [key, value] of Object.entries(props.keysValues)) { | ||
provide(key, value) | ||
} | ||
</script> | ||
|
||
<template> | ||
<TresGroup> | ||
<slot></slot> | ||
</TresGroup> | ||
</template> |
15 changes: 15 additions & 0 deletions
15
playground/vue/src/pages/issues/732/ProvideInjectExperience.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
import { TresCanvas } from '@tresjs/core' | ||
import SubComponentWithInject from './SubComponentWithInject.vue' | ||
provide('test', '✅ Precedence is correct') | ||
</script> | ||
|
||
<template> | ||
<TresCanvas clear-color="#82DBC5"> | ||
<TresPerspectiveCamera :position="[11, 11, 11]" :look-at="[0, 0, 0]" /> | ||
<SubComponentWithInject /> | ||
<TresGridHelper /> | ||
<TresAmbientLight :intensity="1" /> | ||
</TresCanvas> | ||
</template> |
24 changes: 24 additions & 0 deletions
24
playground/vue/src/pages/issues/732/SubComponentWithInject.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- eslint-disable no-console --> | ||
<script setup lang="ts"> | ||
import { inject, watchEffect } from 'vue' | ||
const awiwi = inject('awiwi') | ||
const bululu = inject('bululu') | ||
const vRoute = inject('v-route') | ||
console.log(inject('test')) | ||
watchEffect(() => console.log('tres:awiwi', awiwi?.a)) | ||
watchEffect(() => console.log('tres:bululu', bululu?.value)) | ||
watchEffect(() => console.log('tres:v-route', vRoute)) | ||
watchEffect(() => console.log('tres:useTres', inject('useTres'))) | ||
</script> | ||
|
||
<template> | ||
<TresMesh> | ||
<TresBoxGeometry :args="[1, 1, 1]" /> | ||
<TresMeshNormalMaterial /> | ||
</TresMesh> | ||
</template> |
20 changes: 20 additions & 0 deletions
20
playground/vue/src/pages/issues/732/SubVueComponentWithInject.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script setup lang="ts"> | ||
import { inject, watchEffect } from 'vue' | ||
const awiwi = inject('awiwi') | ||
const bululu = inject('bululu') | ||
// eslint-disable-next-line no-console | ||
watchEffect(() => console.log('vue:awiwi', awiwi?.a)) | ||
// eslint-disable-next-line no-console | ||
watchEffect(() => console.log('vue:bululu', bululu?.value)) | ||
// eslint-disable-next-line no-console | ||
watchEffect(() => console.log('vue:v-route', inject('v-route'))) | ||
// eslint-disable-next-line no-console | ||
watchEffect(() => console.log('vue:useTres', inject('useTres'))) | ||
</script> | ||
|
||
<template> | ||
<p>awiwi: {{ awiwi }}</p> | ||
<p>bululu: {{ bululu }}</p> | ||
<p>v-route: {{ inject('v-route') }}</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
import { provide, reactive } from 'vue' | ||
import ProvideInjectExperience from './ProvideInjectExperience.vue' | ||
import SubVueComponentWithInject from './SubVueComponentWithInject.vue' | ||
const obj = reactive({ | ||
a: 1, | ||
}) | ||
const bululu = ref(1) | ||
provide('awiwi', obj) | ||
provide('bululu', bululu) | ||
provide('test', '❌ Precendence is incorrect') | ||
function onClick() { | ||
obj.a++ | ||
bululu.value++ | ||
} | ||
</script> | ||
|
||
<template> | ||
<button @click="onClick">Click me </button> | ||
<SubVueComponentWithInject /> | ||
<ProvideInjectExperience /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.