@abraca/nuxt 2.0.1 → 2.0.4
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.d.mts +18 -7
- package/dist/module.json +1 -1
- package/dist/module.mjs +21 -5
- package/dist/runtime/assets/aware-tokens.css +1 -0
- package/dist/runtime/components/AAccountSwitcherModal.d.vue.ts +16 -1
- package/dist/runtime/components/AAccountSwitcherModal.vue +33 -4
- package/dist/runtime/components/AAccountSwitcherModal.vue.d.ts +16 -1
- package/dist/runtime/components/AAuthLinkLanding.d.vue.ts +3 -0
- package/dist/runtime/components/AAuthLinkLanding.vue +85 -0
- package/dist/runtime/components/AAuthLinkLanding.vue.d.ts +3 -0
- package/dist/runtime/components/AClaimAccountModal.d.vue.ts +7 -1
- package/dist/runtime/components/AClaimAccountModal.vue +28 -13
- package/dist/runtime/components/AClaimAccountModal.vue.d.ts +7 -1
- package/dist/runtime/components/AEmailVerifyConfirmModal.d.vue.ts +30 -0
- package/dist/runtime/components/AEmailVerifyConfirmModal.vue +100 -0
- package/dist/runtime/components/AEmailVerifyConfirmModal.vue.d.ts +30 -0
- package/dist/runtime/components/AEmailVerifyRequestCard.d.vue.ts +22 -0
- package/dist/runtime/components/AEmailVerifyRequestCard.vue +65 -0
- package/dist/runtime/components/AEmailVerifyRequestCard.vue.d.ts +22 -0
- package/dist/runtime/components/AMnemonicLoginModal.d.vue.ts +1 -1
- package/dist/runtime/components/AMnemonicLoginModal.vue.d.ts +1 -1
- package/dist/runtime/components/ANodePanel.vue +2 -0
- package/dist/runtime/components/ANotificationBell.d.vue.ts +2 -2
- package/dist/runtime/components/ANotificationBell.vue.d.ts +2 -2
- package/dist/runtime/components/APasswordChangeModal.d.vue.ts +28 -0
- package/dist/runtime/components/APasswordChangeModal.vue +178 -0
- package/dist/runtime/components/APasswordChangeModal.vue.d.ts +28 -0
- package/dist/runtime/components/APasswordLoginModal.d.vue.ts +42 -0
- package/dist/runtime/components/APasswordLoginModal.vue +177 -0
- package/dist/runtime/components/APasswordLoginModal.vue.d.ts +42 -0
- package/dist/runtime/components/APasswordRegisterModal.d.vue.ts +49 -0
- package/dist/runtime/components/APasswordRegisterModal.vue +262 -0
- package/dist/runtime/components/APasswordRegisterModal.vue.d.ts +49 -0
- package/dist/runtime/components/APasswordResetConfirmModal.d.vue.ts +31 -0
- package/dist/runtime/components/APasswordResetConfirmModal.vue +154 -0
- package/dist/runtime/components/APasswordResetConfirmModal.vue.d.ts +31 -0
- package/dist/runtime/components/APasswordResetRequestModal.d.vue.ts +35 -0
- package/dist/runtime/components/APasswordResetRequestModal.vue +113 -0
- package/dist/runtime/components/APasswordResetRequestModal.vue.d.ts +35 -0
- package/dist/runtime/components/ASetPasswordCard.d.vue.ts +26 -0
- package/dist/runtime/components/ASetPasswordCard.vue +139 -0
- package/dist/runtime/components/ASetPasswordCard.vue.d.ts +26 -0
- package/dist/runtime/components/aware/AAccordion.d.vue.ts +2 -0
- package/dist/runtime/components/aware/AAccordion.vue +11 -1
- package/dist/runtime/components/aware/AAccordion.vue.d.ts +2 -0
- package/dist/runtime/components/aware/AButton.vue +3 -3
- package/dist/runtime/components/aware/ACollapsible.d.vue.ts +2 -0
- package/dist/runtime/components/aware/ACollapsible.vue +9 -1
- package/dist/runtime/components/aware/ACollapsible.vue.d.ts +2 -0
- package/dist/runtime/components/aware/AGlobalFocusLayer.vue +1 -1
- package/dist/runtime/components/aware/AHoverItem.vue +28 -3
- package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
- package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
- package/dist/runtime/components/aware/AModal.d.vue.ts +2 -0
- package/dist/runtime/components/aware/AModal.vue +9 -1
- package/dist/runtime/components/aware/AModal.vue.d.ts +2 -0
- package/dist/runtime/components/aware/APresenceBlobs.vue +1 -1
- package/dist/runtime/components/aware/APresenceCursors.vue +1 -1
- package/dist/runtime/components/aware/AScroll.d.vue.ts +2 -0
- package/dist/runtime/components/aware/AScroll.vue +13 -3
- package/dist/runtime/components/aware/AScroll.vue.d.ts +2 -0
- package/dist/runtime/components/aware/ASlideover.d.vue.ts +2 -0
- package/dist/runtime/components/aware/ASlideover.vue +9 -1
- package/dist/runtime/components/aware/ASlideover.vue.d.ts +2 -0
- package/dist/runtime/components/aware/ASlider.vue +1 -0
- package/dist/runtime/components/aware/ATabs.d.vue.ts +2 -0
- package/dist/runtime/components/aware/ATabs.vue +9 -1
- package/dist/runtime/components/aware/ATabs.vue.d.ts +2 -0
- package/dist/runtime/components/chat/ANodeChatPanel.vue +1 -0
- package/dist/runtime/components/editor/AEditorRedoButton.d.vue.ts +2 -2
- package/dist/runtime/components/editor/AEditorRedoButton.vue.d.ts +2 -2
- package/dist/runtime/components/editor/AEditorUndoButton.d.vue.ts +2 -2
- package/dist/runtime/components/editor/AEditorUndoButton.vue.d.ts +2 -2
- package/dist/runtime/components/shell/AUserMenu.d.vue.ts +2 -2
- package/dist/runtime/components/shell/AUserMenu.vue.d.ts +2 -2
- package/dist/runtime/components/shell/AUserProfilePopover.d.vue.ts +1 -1
- package/dist/runtime/components/shell/AUserProfilePopover.vue.d.ts +1 -1
- package/dist/runtime/composables/useAAField.js +7 -4
- package/dist/runtime/composables/useAAFocus.js +10 -5
- package/dist/runtime/composables/useAAFollowAnchor.js +68 -34
- package/dist/runtime/composables/useAAFollowPeer.d.ts +7 -4
- package/dist/runtime/composables/useAAFollowPeer.js +60 -11
- package/dist/runtime/composables/useAAViewport.d.ts +1 -1
- package/dist/runtime/composables/useAbracadabraAuth.d.ts +2 -0
- package/dist/runtime/composables/useAbracadabraAuth.js +2 -0
- package/dist/runtime/composables/useEmailVerification.d.ts +40 -26
- package/dist/runtime/composables/useEmailVerification.js +95 -43
- package/dist/runtime/composables/usePasswordAuth.d.ts +64 -0
- package/dist/runtime/composables/usePasswordAuth.js +126 -0
- package/dist/runtime/composables/useTiptapHistory.d.ts +2 -2
- package/dist/runtime/composables/useTiptapHistory.js +5 -5
- package/dist/runtime/extensions/views/MetaFieldView.vue +23 -6
- package/dist/runtime/plugin-abracadabra.client.js +57 -8
- package/dist/runtime/plugin-abracadabra.server.js +2 -0
- package/dist/runtime/server/plugins/abracadabra-service.js +20 -9
- package/dist/runtime/types.d.ts +11 -0
- package/dist/runtime/utils/awareRingStyle.js +1 -1
- package/package.json +7 -7
- package/dist/runtime/components/renderers/ASpatialRenderer.d.vue.ts +0 -19
- package/dist/runtime/components/renderers/ASpatialRenderer.vue +0 -459
- package/dist/runtime/components/renderers/ASpatialRenderer.vue.d.ts +0 -19
- package/dist/runtime/components/renderers/spatial/SpatialGround.d.vue.ts +0 -20
- package/dist/runtime/components/renderers/spatial/SpatialGround.vue +0 -26
- package/dist/runtime/components/renderers/spatial/SpatialGround.vue.d.ts +0 -20
- package/dist/runtime/components/renderers/spatial/SpatialObject.d.vue.ts +0 -17
- package/dist/runtime/components/renderers/spatial/SpatialObject.vue +0 -257
- package/dist/runtime/components/renderers/spatial/SpatialObject.vue.d.ts +0 -17
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.d.vue.ts +0 -15
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.vue +0 -18
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.vue.d.ts +0 -15
- package/dist/runtime/components/renderers/spatial/SpatialTransformInputs.d.vue.ts +0 -16
- package/dist/runtime/components/renderers/spatial/SpatialTransformInputs.vue +0 -66
- package/dist/runtime/components/renderers/spatial/SpatialTransformInputs.vue.d.ts +0 -16
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.d.vue.ts +0 -8
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.vue +0 -53
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.vue.d.ts +0 -8
- package/dist/runtime/composables/useSpatialCamera.d.ts +0 -16
- package/dist/runtime/composables/useSpatialCamera.js +0 -175
- package/dist/runtime/composables/useSpatialDrag.d.ts +0 -14
- package/dist/runtime/composables/useSpatialDrag.js +0 -137
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, shallowRef, watch } from "vue";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
entry: { type: Object, required: true },
|
|
5
|
-
tree: { type: Object, required: true },
|
|
6
|
-
selectedIds: { type: Set, required: true },
|
|
7
|
-
remoteSelections: { type: Map, required: true },
|
|
8
|
-
draggingId: { type: [String, null], required: true }
|
|
9
|
-
});
|
|
10
|
-
const children = computed(() => props.tree.childrenOf(props.entry.id));
|
|
11
|
-
const isSelected = computed(() => props.selectedIds.has(props.entry.id));
|
|
12
|
-
const remoteSelectionsForThis = computed(
|
|
13
|
-
() => props.remoteSelections.get(props.entry.id) ?? []
|
|
14
|
-
);
|
|
15
|
-
const shape = computed(() => props.entry.meta?.spShape ?? "box");
|
|
16
|
-
const position = computed(() => [
|
|
17
|
-
props.entry.meta?.spX ?? 0,
|
|
18
|
-
props.entry.meta?.spY ?? 0,
|
|
19
|
-
props.entry.meta?.spZ ?? 0
|
|
20
|
-
]);
|
|
21
|
-
const rotation = computed(() => {
|
|
22
|
-
const deg2rad = Math.PI / 180;
|
|
23
|
-
return [
|
|
24
|
-
(props.entry.meta?.spRX ?? 0) * deg2rad,
|
|
25
|
-
(props.entry.meta?.spRY ?? 0) * deg2rad,
|
|
26
|
-
(props.entry.meta?.spRZ ?? 0) * deg2rad
|
|
27
|
-
];
|
|
28
|
-
});
|
|
29
|
-
const scale = computed(() => [
|
|
30
|
-
props.entry.meta?.spSX ?? 1,
|
|
31
|
-
props.entry.meta?.spSY ?? 1,
|
|
32
|
-
props.entry.meta?.spSZ ?? 1
|
|
33
|
-
]);
|
|
34
|
-
const color = computed(() => props.entry.meta?.color ?? "#6366f1");
|
|
35
|
-
const opacity = computed(() => (props.entry.meta?.spOpacity ?? 100) / 100);
|
|
36
|
-
const isTransparent = computed(() => opacity.value < 1);
|
|
37
|
-
const isGroup = computed(() => children.value.length > 0 && shape.value !== "glb");
|
|
38
|
-
const glbModel = shallowRef(null);
|
|
39
|
-
const uploadId = computed(() => props.entry.meta?.spModelUploadId);
|
|
40
|
-
const docId = computed(() => props.entry.meta?.spModelDocId);
|
|
41
|
-
watch([shape, uploadId, docId], async ([sh, uid, did]) => {
|
|
42
|
-
if (sh !== "glb" || !uid || !did) {
|
|
43
|
-
glbModel.value = null;
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
const threePkg = "three";
|
|
48
|
-
const { GLTFLoader } = await import(
|
|
49
|
-
/* @vite-ignore */
|
|
50
|
-
`${threePkg}/examples/jsm/loaders/GLTFLoader.js`
|
|
51
|
-
);
|
|
52
|
-
const THREE = await import(
|
|
53
|
-
/* @vite-ignore */
|
|
54
|
-
threePkg
|
|
55
|
-
);
|
|
56
|
-
const loader = new GLTFLoader();
|
|
57
|
-
try {
|
|
58
|
-
const { DRACOLoader } = await import(
|
|
59
|
-
/* @vite-ignore */
|
|
60
|
-
`${threePkg}/examples/jsm/loaders/DRACOLoader.js`
|
|
61
|
-
);
|
|
62
|
-
const dracoLoader = new DRACOLoader();
|
|
63
|
-
dracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.7/");
|
|
64
|
-
loader.setDRACOLoader(dracoLoader);
|
|
65
|
-
} catch {
|
|
66
|
-
}
|
|
67
|
-
const gltf = await loader.loadAsync(uid);
|
|
68
|
-
const box = new THREE.Box3().setFromObject(gltf.scene);
|
|
69
|
-
const size = box.getSize(new THREE.Vector3());
|
|
70
|
-
const center = box.getCenter(new THREE.Vector3());
|
|
71
|
-
const maxDim = Math.max(size.x, size.y, size.z);
|
|
72
|
-
if (maxDim > 0) {
|
|
73
|
-
const s = 1 / maxDim;
|
|
74
|
-
gltf.scene.scale.multiplyScalar(s);
|
|
75
|
-
gltf.scene.position.sub(center.multiplyScalar(s));
|
|
76
|
-
}
|
|
77
|
-
glbModel.value = gltf.scene;
|
|
78
|
-
} catch (e) {
|
|
79
|
-
console.error("[SpatialObject] Failed to load GLB", uid, e);
|
|
80
|
-
}
|
|
81
|
-
}, { immediate: true });
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
<template>
|
|
85
|
-
<TresGroup
|
|
86
|
-
:position="position"
|
|
87
|
-
:rotation="rotation"
|
|
88
|
-
:scale="scale"
|
|
89
|
-
:user-data="{ entryId: entry.id }"
|
|
90
|
-
>
|
|
91
|
-
<!-- GLB Model -->
|
|
92
|
-
<template v-if="shape === 'glb'">
|
|
93
|
-
<primitive
|
|
94
|
-
v-if="glbModel"
|
|
95
|
-
:object="glbModel"
|
|
96
|
-
/>
|
|
97
|
-
<TresMesh
|
|
98
|
-
v-else
|
|
99
|
-
cast-shadow
|
|
100
|
-
receive-shadow
|
|
101
|
-
>
|
|
102
|
-
<TresBoxGeometry :args="[0.5, 0.5, 0.5]" />
|
|
103
|
-
<TresMeshStandardMaterial
|
|
104
|
-
color="#888888"
|
|
105
|
-
:wireframe="true"
|
|
106
|
-
:opacity="0.4"
|
|
107
|
-
:transparent="true"
|
|
108
|
-
/>
|
|
109
|
-
</TresMesh>
|
|
110
|
-
</template>
|
|
111
|
-
|
|
112
|
-
<TresMesh
|
|
113
|
-
v-else-if="shape === 'box'"
|
|
114
|
-
cast-shadow
|
|
115
|
-
receive-shadow
|
|
116
|
-
>
|
|
117
|
-
<TresBoxGeometry />
|
|
118
|
-
<TresMeshStandardMaterial
|
|
119
|
-
:color="color"
|
|
120
|
-
:opacity="opacity"
|
|
121
|
-
:transparent="isTransparent"
|
|
122
|
-
/>
|
|
123
|
-
</TresMesh>
|
|
124
|
-
|
|
125
|
-
<TresMesh
|
|
126
|
-
v-else-if="shape === 'sphere'"
|
|
127
|
-
cast-shadow
|
|
128
|
-
receive-shadow
|
|
129
|
-
>
|
|
130
|
-
<TresSphereGeometry :args="[0.5, 32, 32]" />
|
|
131
|
-
<TresMeshStandardMaterial
|
|
132
|
-
:color="color"
|
|
133
|
-
:opacity="opacity"
|
|
134
|
-
:transparent="isTransparent"
|
|
135
|
-
/>
|
|
136
|
-
</TresMesh>
|
|
137
|
-
|
|
138
|
-
<TresMesh
|
|
139
|
-
v-else-if="shape === 'cylinder'"
|
|
140
|
-
cast-shadow
|
|
141
|
-
receive-shadow
|
|
142
|
-
>
|
|
143
|
-
<TresCylinderGeometry :args="[0.5, 0.5, 1, 32]" />
|
|
144
|
-
<TresMeshStandardMaterial
|
|
145
|
-
:color="color"
|
|
146
|
-
:opacity="opacity"
|
|
147
|
-
:transparent="isTransparent"
|
|
148
|
-
/>
|
|
149
|
-
</TresMesh>
|
|
150
|
-
|
|
151
|
-
<TresMesh
|
|
152
|
-
v-else-if="shape === 'cone'"
|
|
153
|
-
cast-shadow
|
|
154
|
-
receive-shadow
|
|
155
|
-
>
|
|
156
|
-
<TresConeGeometry :args="[0.5, 1, 32]" />
|
|
157
|
-
<TresMeshStandardMaterial
|
|
158
|
-
:color="color"
|
|
159
|
-
:opacity="opacity"
|
|
160
|
-
:transparent="isTransparent"
|
|
161
|
-
/>
|
|
162
|
-
</TresMesh>
|
|
163
|
-
|
|
164
|
-
<TresMesh
|
|
165
|
-
v-else-if="shape === 'plane'"
|
|
166
|
-
receive-shadow
|
|
167
|
-
>
|
|
168
|
-
<TresPlaneGeometry :args="[1, 1]" />
|
|
169
|
-
<TresMeshStandardMaterial
|
|
170
|
-
:color="color"
|
|
171
|
-
:opacity="opacity"
|
|
172
|
-
:transparent="isTransparent"
|
|
173
|
-
:side="2"
|
|
174
|
-
/>
|
|
175
|
-
</TresMesh>
|
|
176
|
-
|
|
177
|
-
<TresMesh
|
|
178
|
-
v-else-if="shape === 'torus'"
|
|
179
|
-
cast-shadow
|
|
180
|
-
receive-shadow
|
|
181
|
-
>
|
|
182
|
-
<TresTorusGeometry :args="[0.4, 0.15, 16, 32]" />
|
|
183
|
-
<TresMeshStandardMaterial
|
|
184
|
-
:color="color"
|
|
185
|
-
:opacity="opacity"
|
|
186
|
-
:transparent="isTransparent"
|
|
187
|
-
/>
|
|
188
|
-
</TresMesh>
|
|
189
|
-
|
|
190
|
-
<TresMesh
|
|
191
|
-
v-else
|
|
192
|
-
cast-shadow
|
|
193
|
-
receive-shadow
|
|
194
|
-
>
|
|
195
|
-
<TresBoxGeometry />
|
|
196
|
-
<TresMeshStandardMaterial
|
|
197
|
-
:color="color"
|
|
198
|
-
:opacity="opacity"
|
|
199
|
-
:transparent="isTransparent"
|
|
200
|
-
/>
|
|
201
|
-
</TresMesh>
|
|
202
|
-
|
|
203
|
-
<!-- Selection highlight -->
|
|
204
|
-
<TresMesh
|
|
205
|
-
v-if="isSelected"
|
|
206
|
-
:scale="[1.02, 1.02, 1.02]"
|
|
207
|
-
>
|
|
208
|
-
<TresBoxGeometry />
|
|
209
|
-
<TresMeshBasicMaterial
|
|
210
|
-
color="#ffffff"
|
|
211
|
-
:wireframe="true"
|
|
212
|
-
:opacity="0.5"
|
|
213
|
-
:transparent="true"
|
|
214
|
-
/>
|
|
215
|
-
</TresMesh>
|
|
216
|
-
|
|
217
|
-
<!-- Remote user selection indicators -->
|
|
218
|
-
<TresMesh
|
|
219
|
-
v-for="rs in remoteSelectionsForThis"
|
|
220
|
-
:key="rs.color"
|
|
221
|
-
:scale="[1.04, 1.04, 1.04]"
|
|
222
|
-
>
|
|
223
|
-
<TresBoxGeometry />
|
|
224
|
-
<TresMeshBasicMaterial
|
|
225
|
-
:color="rs.color"
|
|
226
|
-
:wireframe="true"
|
|
227
|
-
:opacity="0.35"
|
|
228
|
-
:transparent="true"
|
|
229
|
-
/>
|
|
230
|
-
</TresMesh>
|
|
231
|
-
|
|
232
|
-
<!-- Group bounding indicator -->
|
|
233
|
-
<TresMesh
|
|
234
|
-
v-if="isGroup"
|
|
235
|
-
:scale="[1.1, 1.1, 1.1]"
|
|
236
|
-
>
|
|
237
|
-
<TresBoxGeometry />
|
|
238
|
-
<TresMeshBasicMaterial
|
|
239
|
-
color="#888888"
|
|
240
|
-
:wireframe="true"
|
|
241
|
-
:opacity="0.15"
|
|
242
|
-
:transparent="true"
|
|
243
|
-
/>
|
|
244
|
-
</TresMesh>
|
|
245
|
-
|
|
246
|
-
<!-- Recursive children -->
|
|
247
|
-
<SpatialObject
|
|
248
|
-
v-for="child in children"
|
|
249
|
-
:key="child.id"
|
|
250
|
-
:entry="child"
|
|
251
|
-
:tree="tree"
|
|
252
|
-
:selected-ids="selectedIds"
|
|
253
|
-
:remote-selections="remoteSelections"
|
|
254
|
-
:dragging-id="draggingId"
|
|
255
|
-
/>
|
|
256
|
-
</TresGroup>
|
|
257
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TreeEntry } from '../../../types.js';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
entry: TreeEntry;
|
|
4
|
-
tree: {
|
|
5
|
-
childrenOf: (parentId: string | null) => TreeEntry[];
|
|
6
|
-
updateMeta: (id: string, meta: Record<string, unknown>) => void;
|
|
7
|
-
};
|
|
8
|
-
selectedIds: Set<string>;
|
|
9
|
-
remoteSelections: Map<string, {
|
|
10
|
-
color: string;
|
|
11
|
-
name: string;
|
|
12
|
-
}[]>;
|
|
13
|
-
draggingId: string | null;
|
|
14
|
-
};
|
|
15
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
-
declare const _default: typeof __VLS_export;
|
|
17
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
-
ready: (ctx: {
|
|
3
|
-
scene: any;
|
|
4
|
-
camera: any;
|
|
5
|
-
canvas: any;
|
|
6
|
-
}) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
8
|
-
onReady?: ((ctx: {
|
|
9
|
-
scene: any;
|
|
10
|
-
camera: any;
|
|
11
|
-
canvas: any;
|
|
12
|
-
}) => any) | undefined;
|
|
13
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { watchEffect } from "vue";
|
|
3
|
-
const emit = defineEmits(["ready"]);
|
|
4
|
-
const { useTresContext } = await import("@tresjs/core");
|
|
5
|
-
const ctx = useTresContext();
|
|
6
|
-
watchEffect(() => {
|
|
7
|
-
const s = ctx.scene?.value;
|
|
8
|
-
const c = ctx.camera?.activeCamera?.value;
|
|
9
|
-
const r = ctx.renderer?.instance;
|
|
10
|
-
if (s && c && r) {
|
|
11
|
-
emit("ready", { scene: s, camera: c, canvas: r.domElement });
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<div style="display:none" />
|
|
18
|
-
</template>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
-
ready: (ctx: {
|
|
3
|
-
scene: any;
|
|
4
|
-
camera: any;
|
|
5
|
-
canvas: any;
|
|
6
|
-
}) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
8
|
-
onReady?: ((ctx: {
|
|
9
|
-
scene: any;
|
|
10
|
-
camera: any;
|
|
11
|
-
canvas: any;
|
|
12
|
-
}) => any) | undefined;
|
|
13
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SpatialTransformInputs — internal sub-component for ASpatialRenderer.
|
|
3
|
-
*
|
|
4
|
-
* Position / Rotation / Scale numeric inputs for a selected spatial object.
|
|
5
|
-
* Ported from cou-sh/app/components/spatial/SpatialTransformInputs.vue.
|
|
6
|
-
* Not auto-imported.
|
|
7
|
-
*/
|
|
8
|
-
import type { TreeEntry } from '../../../composables/useChildTree.js';
|
|
9
|
-
import type { useChildTree } from '../../../composables/useChildTree.js';
|
|
10
|
-
type __VLS_Props = {
|
|
11
|
-
entry: TreeEntry;
|
|
12
|
-
tree: ReturnType<typeof useChildTree>;
|
|
13
|
-
};
|
|
14
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
-
declare const _default: typeof __VLS_export;
|
|
16
|
-
export default _default;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
entry: { type: Object, required: true },
|
|
4
|
-
tree: { type: null, required: true }
|
|
5
|
-
});
|
|
6
|
-
function update(key, value) {
|
|
7
|
-
const num = Number.parseFloat(value);
|
|
8
|
-
if (Number.isFinite(num)) {
|
|
9
|
-
props.tree.updateMeta(props.entry.id, { [key]: num });
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const rows = [
|
|
13
|
-
{ label: "Pos", fields: [
|
|
14
|
-
{ key: "spX", axis: "X" },
|
|
15
|
-
{ key: "spY", axis: "Y" },
|
|
16
|
-
{ key: "spZ", axis: "Z" }
|
|
17
|
-
] },
|
|
18
|
-
{ label: "Rot", fields: [
|
|
19
|
-
{ key: "spRX", axis: "X" },
|
|
20
|
-
{ key: "spRY", axis: "Y" },
|
|
21
|
-
{ key: "spRZ", axis: "Z" }
|
|
22
|
-
] },
|
|
23
|
-
{ label: "Scale", fields: [
|
|
24
|
-
{ key: "spSX", axis: "X" },
|
|
25
|
-
{ key: "spSY", axis: "Y" },
|
|
26
|
-
{ key: "spSZ", axis: "Z" }
|
|
27
|
-
] }
|
|
28
|
-
];
|
|
29
|
-
function getVal(key) {
|
|
30
|
-
const v = props.entry.meta?.[key];
|
|
31
|
-
if (typeof v === "number") return v;
|
|
32
|
-
if (key.startsWith("spS")) return 1;
|
|
33
|
-
return 0;
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<template>
|
|
38
|
-
<div class="sp-transform-inputs">
|
|
39
|
-
<div
|
|
40
|
-
v-for="row in rows"
|
|
41
|
-
:key="row.label"
|
|
42
|
-
class="sp-row"
|
|
43
|
-
>
|
|
44
|
-
<span class="sp-label">{{ row.label }}</span>
|
|
45
|
-
<div
|
|
46
|
-
v-for="f in row.fields"
|
|
47
|
-
:key="f.key"
|
|
48
|
-
class="sp-field"
|
|
49
|
-
>
|
|
50
|
-
<span class="sp-axis">{{ f.axis }}</span>
|
|
51
|
-
<UInput
|
|
52
|
-
type="number"
|
|
53
|
-
size="xs"
|
|
54
|
-
:model-value="String(getVal(f.key))"
|
|
55
|
-
step="0.1"
|
|
56
|
-
class="sp-input"
|
|
57
|
-
@update:model-value="update(f.key, String($event))"
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
|
|
64
|
-
<style scoped>
|
|
65
|
-
.sp-transform-inputs{display:flex;flex-direction:column;gap:4px;margin-top:8px}.sp-row{align-items:center;display:flex;gap:4px}.sp-label{color:var(--ui-text-dimmed);flex-shrink:0;font-size:.7rem;font-weight:600;width:36px}.sp-field{align-items:center;display:flex;flex:1;gap:2px;min-width:0}.sp-axis{color:var(--ui-text-muted);flex-shrink:0;font-size:.65rem;font-weight:600;text-align:center;width:10px}.sp-input{flex:1;min-width:0}.sp-input :deep(input){font-size:.7rem;padding:2px 4px;text-align:right}
|
|
66
|
-
</style>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SpatialTransformInputs — internal sub-component for ASpatialRenderer.
|
|
3
|
-
*
|
|
4
|
-
* Position / Rotation / Scale numeric inputs for a selected spatial object.
|
|
5
|
-
* Ported from cou-sh/app/components/spatial/SpatialTransformInputs.vue.
|
|
6
|
-
* Not auto-imported.
|
|
7
|
-
*/
|
|
8
|
-
import type { TreeEntry } from '../../../composables/useChildTree.js';
|
|
9
|
-
import type { useChildTree } from '../../../composables/useChildTree.js';
|
|
10
|
-
type __VLS_Props = {
|
|
11
|
-
entry: TreeEntry;
|
|
12
|
-
tree: ReturnType<typeof useChildTree>;
|
|
13
|
-
};
|
|
14
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
-
declare const _default: typeof __VLS_export;
|
|
16
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
position: [number, number, number];
|
|
3
|
-
color: string;
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, computed, watch, onMounted, onBeforeUnmount } from "vue";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
position: { type: Array, required: true },
|
|
5
|
-
color: { type: String, required: true },
|
|
6
|
-
name: { type: String, required: true }
|
|
7
|
-
});
|
|
8
|
-
const smoothX = ref(props.position[0]);
|
|
9
|
-
const smoothY = ref(props.position[1]);
|
|
10
|
-
const smoothZ = ref(props.position[2]);
|
|
11
|
-
const LERP = 0.12;
|
|
12
|
-
let rafId = 0;
|
|
13
|
-
function tick() {
|
|
14
|
-
rafId = requestAnimationFrame(tick);
|
|
15
|
-
smoothX.value += (props.position[0] - smoothX.value) * LERP;
|
|
16
|
-
smoothY.value += (props.position[1] - smoothY.value) * LERP;
|
|
17
|
-
smoothZ.value += (props.position[2] - smoothZ.value) * LERP;
|
|
18
|
-
}
|
|
19
|
-
onMounted(() => {
|
|
20
|
-
rafId = requestAnimationFrame(tick);
|
|
21
|
-
});
|
|
22
|
-
onBeforeUnmount(() => {
|
|
23
|
-
cancelAnimationFrame(rafId);
|
|
24
|
-
});
|
|
25
|
-
watch(() => props.position, (pos) => {
|
|
26
|
-
const dx = pos[0] - smoothX.value;
|
|
27
|
-
const dy = pos[1] - smoothY.value;
|
|
28
|
-
const dz = pos[2] - smoothZ.value;
|
|
29
|
-
if (dx * dx + dy * dy + dz * dz > 400) {
|
|
30
|
-
smoothX.value = pos[0];
|
|
31
|
-
smoothY.value = pos[1];
|
|
32
|
-
smoothZ.value = pos[2];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
const avatarPos = computed(() => [
|
|
36
|
-
smoothX.value,
|
|
37
|
-
smoothY.value,
|
|
38
|
-
smoothZ.value
|
|
39
|
-
]);
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<template>
|
|
43
|
-
<TresGroup :position="avatarPos">
|
|
44
|
-
<TresMesh :position-y="0.4">
|
|
45
|
-
<TresCapsuleGeometry :args="[0.15, 0.4, 8, 16]" />
|
|
46
|
-
<TresMeshStandardMaterial :color="color" />
|
|
47
|
-
</TresMesh>
|
|
48
|
-
<TresMesh :position-y="0.85">
|
|
49
|
-
<TresSphereGeometry :args="[0.12, 16, 16]" />
|
|
50
|
-
<TresMeshStandardMaterial :color="color" />
|
|
51
|
-
</TresMesh>
|
|
52
|
-
</TresGroup>
|
|
53
|
-
</template>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
position: [number, number, number];
|
|
3
|
-
color: string;
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare function useSpatialCamera(setLocalState: (state: Record<string, unknown>) => void, isFollowing?: () => boolean): {
|
|
2
|
-
cameraRef: import("vue").Ref<any, any>;
|
|
3
|
-
cameraPosition: import("vue").ComputedRef<[number, number, number]>;
|
|
4
|
-
cameraTarget: import("vue").ComputedRef<[number, number, number]>;
|
|
5
|
-
controlMode: import("vue").Ref<"orbit" | "fly", "orbit" | "fly">;
|
|
6
|
-
azimuth: import("vue").Ref<number, number>;
|
|
7
|
-
elevation: import("vue").Ref<number, number>;
|
|
8
|
-
distance: import("vue").Ref<number, number>;
|
|
9
|
-
focusOn: (worldPos: [number, number, number]) => void;
|
|
10
|
-
broadcastCamera: () => void;
|
|
11
|
-
applyCameraState: (position: [number, number, number], target: [number, number, number]) => void;
|
|
12
|
-
onCanvasPointerDown: (ev: PointerEvent) => void;
|
|
13
|
-
onCanvasPointerMove: (ev: PointerEvent) => void;
|
|
14
|
-
onCanvasPointerUp: () => void;
|
|
15
|
-
onCanvasWheel: (ev: WheelEvent) => void;
|
|
16
|
-
};
|