@viamrobotics/test-widgets 0.0.1 → 0.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/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/maplibre/controls/center.svelte +13 -10
- package/dist/components/maplibre/controls/follow.svelte +9 -7
- package/dist/components/maplibre/controls/navigation.svelte +6 -4
- package/dist/components/maplibre/controls/satellite.svelte +6 -4
- package/dist/components/maplibre/{hooks.d.ts → hooks.svelte.d.ts} +9 -14
- package/dist/components/maplibre/{hooks.js → hooks.svelte.js} +31 -16
- package/dist/components/maplibre/index.d.ts +2 -2
- package/dist/components/maplibre/index.js +2 -2
- package/dist/components/maplibre/index.svelte +9 -2
- package/dist/components/maplibre/marker.svelte +5 -3
- package/dist/components/maplibre/plugins/{raycast.js → raycast.svelte.js} +8 -7
- package/dist/components/maplibre/plugins/three.svelte.js +8 -6
- package/dist/components/navigation-map/components/draw-tool.svelte +15 -8
- package/dist/components/navigation-map/components/nav/index.svelte +1 -1
- package/dist/components/navigation-map/components/nav/key.svelte +1 -1
- package/dist/components/navigation-map/components/nav/obstacles-legend.svelte +1 -1
- package/dist/components/navigation-map/components/nav/obstacles.svelte +5 -3
- package/dist/components/navigation-map/components/nav/waypoints.svelte +4 -2
- package/dist/components/navigation-map/components/obstacle.svelte +18 -12
- package/dist/components/navigation-map/plugins/interactivity.js +4 -2
- package/dist/components/widgets/arm/move-to-joint-positions.svelte +1 -0
- package/dist/components/widgets/arm/move-to-position.svelte +1 -0
- package/dist/components/widgets/navigation/obstacles/scene.svelte +4 -2
- package/package.json +116 -116
- /package/dist/components/maplibre/plugins/{raycast.d.ts → raycast.svelte.d.ts} +0 -0
|
@@ -21,8 +21,8 @@ export { default as DoCommandWidget } from './widgets/do-command/do-command.svel
|
|
|
21
21
|
export { default as EncoderWidget } from './widgets/encoder/encoder.svelte';
|
|
22
22
|
export { default as GantryWidget } from './widgets/gantry/gantry.svelte';
|
|
23
23
|
export { default as GantryHomeWidget } from './widgets/gantry/home.svelte';
|
|
24
|
-
export { default as GantryMoveToPositionWidget } from './widgets/gantry/move-to-position.svelte';
|
|
25
|
-
export { default as GantryQuickMoveWidget } from './widgets/gantry/quick-move.svelte';
|
|
24
|
+
export { default as GantryMoveToPositionWidget } from './widgets/gantry/move-to-position-widget.svelte';
|
|
25
|
+
export { default as GantryQuickMoveWidget } from './widgets/gantry/quick-move-widget.svelte';
|
|
26
26
|
export { default as GenericWidget } from './widgets/generic/generic.svelte';
|
|
27
27
|
export { default as GripperGrabWidget } from './widgets/gripper/grab.svelte';
|
|
28
28
|
export { default as GripperWidget } from './widgets/gripper/gripper.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -20,8 +20,8 @@ export { default as DoCommandWidget } from './widgets/do-command/do-command.svel
|
|
|
20
20
|
export { default as EncoderWidget } from './widgets/encoder/encoder.svelte';
|
|
21
21
|
export { default as GantryWidget } from './widgets/gantry/gantry.svelte';
|
|
22
22
|
export { default as GantryHomeWidget } from './widgets/gantry/home.svelte';
|
|
23
|
-
export { default as GantryMoveToPositionWidget } from './widgets/gantry/move-to-position.svelte';
|
|
24
|
-
export { default as GantryQuickMoveWidget } from './widgets/gantry/quick-move.svelte';
|
|
23
|
+
export { default as GantryMoveToPositionWidget } from './widgets/gantry/move-to-position-widget.svelte';
|
|
24
|
+
export { default as GantryQuickMoveWidget } from './widgets/gantry/quick-move-widget.svelte';
|
|
25
25
|
export { default as GenericWidget } from './widgets/generic/generic.svelte';
|
|
26
26
|
export { default as GripperGrabWidget } from './widgets/gripper/grab.svelte';
|
|
27
27
|
export { default as GripperWidget } from './widgets/gripper/gripper.svelte';
|
|
@@ -5,37 +5,40 @@
|
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { persisted } from '@viamrobotics/prime-core'
|
|
7
7
|
import { LngLat } from 'maplibre-gl'
|
|
8
|
+
import { fromStore } from 'svelte/store'
|
|
8
9
|
|
|
9
|
-
import { useMapLibre, useMapLibreEvent } from '../hooks'
|
|
10
|
+
import { useMapLibre, useMapLibreEvent } from '../hooks.svelte'
|
|
10
11
|
import LngLatInput from '../lnglat-input.svelte'
|
|
11
12
|
|
|
12
|
-
const {
|
|
13
|
+
const { center, ...context } = useMapLibre()
|
|
14
|
+
const map = fromStore(context.map)
|
|
15
|
+
|
|
13
16
|
const lastPosition = persisted<{ center: LngLat; zoom: number }>(
|
|
14
17
|
'viam-blocks-navigation-map-center',
|
|
15
18
|
{
|
|
16
|
-
center: map.getCenter(),
|
|
17
|
-
zoom: map.getZoom(),
|
|
19
|
+
center: map.current.getCenter(),
|
|
20
|
+
zoom: map.current.getZoom(),
|
|
18
21
|
}
|
|
19
22
|
)
|
|
20
23
|
|
|
21
24
|
if ($lastPosition) {
|
|
22
|
-
map.jumpTo({ center: $lastPosition.center, zoom: $lastPosition.zoom })
|
|
25
|
+
map.current.jumpTo({ center: $lastPosition.center, zoom: $lastPosition.zoom })
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
const handleInput = (center: LngLat) => {
|
|
26
|
-
map.jumpTo({ center })
|
|
29
|
+
map.current.jumpTo({ center })
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
useMapLibreEvent('move', () => {
|
|
30
33
|
lastPosition.set({
|
|
31
|
-
center: map.getCenter(),
|
|
32
|
-
zoom: map.getZoom(),
|
|
34
|
+
center: map.current.getCenter(),
|
|
35
|
+
zoom: map.current.getZoom(),
|
|
33
36
|
})
|
|
34
37
|
})
|
|
35
38
|
</script>
|
|
36
39
|
|
|
37
40
|
<LngLatInput
|
|
38
|
-
lng={$
|
|
39
|
-
lat={$
|
|
41
|
+
lng={$center.lng}
|
|
42
|
+
lat={$center.lat}
|
|
40
43
|
oninput={handleInput}
|
|
41
44
|
/>
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
-->
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { Button, Icon } from '@viamrobotics/prime-core'
|
|
7
|
+
import { fromStore } from 'svelte/store'
|
|
7
8
|
|
|
8
|
-
import { useMapLibre } from '../hooks'
|
|
9
|
+
import { useMapLibre } from '../hooks.svelte'
|
|
9
10
|
|
|
10
11
|
interface Props {
|
|
11
12
|
/** The map point to follow */
|
|
@@ -17,13 +18,14 @@
|
|
|
17
18
|
|
|
18
19
|
let { lng, lat, onChange, following = $bindable(false) }: Props = $props()
|
|
19
20
|
|
|
20
|
-
const
|
|
21
|
+
const context = useMapLibre()
|
|
22
|
+
const map = fromStore(context.map)
|
|
21
23
|
|
|
22
24
|
let rafID = 0
|
|
23
25
|
|
|
24
26
|
const follow = () => {
|
|
25
27
|
if (lng && lat && following) {
|
|
26
|
-
map.setCenter([lng, lat])
|
|
28
|
+
map.current.setCenter([lng, lat])
|
|
27
29
|
rafID = requestAnimationFrame(follow)
|
|
28
30
|
}
|
|
29
31
|
}
|
|
@@ -40,13 +42,13 @@
|
|
|
40
42
|
})
|
|
41
43
|
|
|
42
44
|
$effect(() => {
|
|
43
|
-
map.on('wheel', stop)
|
|
44
|
-
map.on('mousedown', stop)
|
|
45
|
+
map.current.on('wheel', stop)
|
|
46
|
+
map.current.on('mousedown', stop)
|
|
45
47
|
|
|
46
48
|
return () => {
|
|
47
49
|
cancelAnimationFrame(rafID)
|
|
48
|
-
map.off('wheel', stop)
|
|
49
|
-
map.off('mousedown', stop)
|
|
50
|
+
map.current.off('wheel', stop)
|
|
51
|
+
map.current.off('mousedown', stop)
|
|
50
52
|
}
|
|
51
53
|
})
|
|
52
54
|
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
-->
|
|
16
16
|
<script lang="ts">
|
|
17
17
|
import { type ControlPosition, NavigationControl } from 'maplibre-gl'
|
|
18
|
+
import { fromStore } from 'svelte/store'
|
|
18
19
|
|
|
19
|
-
import { useMapLibre } from '../hooks'
|
|
20
|
+
import { useMapLibre } from '../hooks.svelte'
|
|
20
21
|
|
|
21
22
|
interface Props {
|
|
22
23
|
position?: ControlPosition
|
|
@@ -32,7 +33,8 @@
|
|
|
32
33
|
visualizePitch = true,
|
|
33
34
|
}: Props = $props()
|
|
34
35
|
|
|
35
|
-
const
|
|
36
|
+
const context = useMapLibre()
|
|
37
|
+
const map = fromStore(context.map)
|
|
36
38
|
const control = new NavigationControl()
|
|
37
39
|
|
|
38
40
|
$effect(() => {
|
|
@@ -48,10 +50,10 @@
|
|
|
48
50
|
})
|
|
49
51
|
|
|
50
52
|
$effect(() => {
|
|
51
|
-
map.addControl(control, position)
|
|
53
|
+
map.current.addControl(control, position)
|
|
52
54
|
|
|
53
55
|
return () => {
|
|
54
|
-
map.removeControl(control)
|
|
56
|
+
map.current.removeControl(control)
|
|
55
57
|
}
|
|
56
58
|
})
|
|
57
59
|
</script>
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
-->
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { Button } from '@viamrobotics/prime-core'
|
|
7
|
+
import { fromStore } from 'svelte/store'
|
|
7
8
|
|
|
8
|
-
import { useMapLibre } from '../hooks'
|
|
9
|
+
import { useMapLibre } from '../hooks.svelte'
|
|
9
10
|
import { getGoogleMapsStyle } from '../style'
|
|
10
11
|
import { MapProviders } from '../types'
|
|
11
12
|
|
|
12
|
-
const {
|
|
13
|
+
const { satellite, mapProvider, apiKey, maxZoom, ...context } = useMapLibre()
|
|
14
|
+
const map = fromStore(context.map)
|
|
13
15
|
|
|
14
16
|
const onClick = () => {
|
|
15
17
|
satellite.set(!$satellite)
|
|
@@ -17,13 +19,13 @@
|
|
|
17
19
|
if ($mapProvider === MapProviders.googleMaps && $apiKey) {
|
|
18
20
|
try {
|
|
19
21
|
const style = getGoogleMapsStyle($apiKey, $maxZoom, $satellite ? 'satellite' : 'roadmap')
|
|
20
|
-
map.setStyle(style)
|
|
22
|
+
map.current.setStyle(style)
|
|
21
23
|
} catch (error) {
|
|
22
24
|
console.error('Failed to toggle satellite view:', error)
|
|
23
25
|
satellite.set(!$satellite)
|
|
24
26
|
}
|
|
25
27
|
} else {
|
|
26
|
-
map.setLayoutProperty('satellite', 'visibility', $satellite ? 'visible' : 'none')
|
|
28
|
+
map.current.setLayoutProperty('satellite', 'visibility', $satellite ? 'visible' : 'none')
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
</script>
|
|
@@ -14,23 +14,18 @@ interface MapContext {
|
|
|
14
14
|
apiKey: Writable<string | undefined>;
|
|
15
15
|
satellite: Writable<boolean>;
|
|
16
16
|
}
|
|
17
|
-
export declare const provideMapContext: (
|
|
17
|
+
export declare const provideMapContext: (options: () => {
|
|
18
|
+
center: LngLat;
|
|
19
|
+
zoom: number;
|
|
20
|
+
maxZoom: number;
|
|
21
|
+
mapProvider?: MapProvider;
|
|
22
|
+
apiKey?: string | undefined;
|
|
23
|
+
satellite?: boolean;
|
|
24
|
+
}) => MapContext;
|
|
18
25
|
/**
|
|
19
26
|
* Provides context for a <MapLibre> instance. Must be called within a child of this component.
|
|
20
27
|
*/
|
|
21
|
-
export declare const useMapLibre: () =>
|
|
22
|
-
map: Map;
|
|
23
|
-
mapCenter: Writable<LngLat>;
|
|
24
|
-
mapSize: Writable<{
|
|
25
|
-
width: number;
|
|
26
|
-
height: number;
|
|
27
|
-
}>;
|
|
28
|
-
mapZoom: Writable<number>;
|
|
29
|
-
maxZoom: Writable<number>;
|
|
30
|
-
mapProvider: Writable<MapProvider>;
|
|
31
|
-
apiKey: Writable<string | undefined>;
|
|
32
|
-
satellite: Writable<boolean>;
|
|
33
|
-
};
|
|
28
|
+
export declare const useMapLibre: () => MapContext;
|
|
34
29
|
/**
|
|
35
30
|
* Allows attaching events to a <MapLibre> instance. Must be called within a child of this component.
|
|
36
31
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { getContext,
|
|
2
|
-
import {
|
|
1
|
+
import { getContext, setContext } from 'svelte';
|
|
2
|
+
import { fromStore, writable } from 'svelte/store';
|
|
3
3
|
import { MapProviders } from './types';
|
|
4
4
|
const mapContextKey = Symbol('viam-maplibre');
|
|
5
|
-
export const provideMapContext = (
|
|
5
|
+
export const provideMapContext = (options) => {
|
|
6
|
+
const { center, zoom, maxZoom, mapProvider = MapProviders.openStreet, apiKey, satellite = false, } = $derived(options());
|
|
6
7
|
const context = {
|
|
7
8
|
map: writable(),
|
|
8
9
|
center: writable(center),
|
|
@@ -13,6 +14,24 @@ export const provideMapContext = (center, zoom, maxZoom, mapProvider = MapProvid
|
|
|
13
14
|
apiKey: writable(apiKey),
|
|
14
15
|
satellite: writable(satellite),
|
|
15
16
|
};
|
|
17
|
+
$effect(() => {
|
|
18
|
+
context.center.set(center);
|
|
19
|
+
});
|
|
20
|
+
$effect(() => {
|
|
21
|
+
context.zoom.set(zoom);
|
|
22
|
+
});
|
|
23
|
+
$effect(() => {
|
|
24
|
+
context.maxZoom.set(maxZoom);
|
|
25
|
+
});
|
|
26
|
+
$effect(() => {
|
|
27
|
+
context.mapProvider.set(mapProvider);
|
|
28
|
+
});
|
|
29
|
+
$effect(() => {
|
|
30
|
+
context.apiKey.set(apiKey);
|
|
31
|
+
});
|
|
32
|
+
$effect(() => {
|
|
33
|
+
context.satellite.set(satellite);
|
|
34
|
+
});
|
|
16
35
|
setContext(mapContextKey, context);
|
|
17
36
|
return context;
|
|
18
37
|
};
|
|
@@ -24,22 +43,18 @@ export const useMapLibre = () => {
|
|
|
24
43
|
if (!context) {
|
|
25
44
|
throw new Error('useMapLibre is a context sensitive hook that must be used inside a <MapLibre> component.');
|
|
26
45
|
}
|
|
27
|
-
return
|
|
28
|
-
map: get(context.map),
|
|
29
|
-
mapCenter: context.center,
|
|
30
|
-
mapSize: context.size,
|
|
31
|
-
mapZoom: context.zoom,
|
|
32
|
-
maxZoom: context.maxZoom,
|
|
33
|
-
mapProvider: context.mapProvider,
|
|
34
|
-
apiKey: context.apiKey,
|
|
35
|
-
satellite: context.satellite,
|
|
36
|
-
};
|
|
46
|
+
return context;
|
|
37
47
|
};
|
|
38
48
|
/**
|
|
39
49
|
* Allows attaching events to a <MapLibre> instance. Must be called within a child of this component.
|
|
40
50
|
*/
|
|
41
51
|
export const useMapLibreEvent = (event, listener) => {
|
|
42
|
-
const
|
|
43
|
-
map.
|
|
44
|
-
|
|
52
|
+
const context = useMapLibre();
|
|
53
|
+
const map = fromStore(context.map);
|
|
54
|
+
$effect(() => {
|
|
55
|
+
map.current.on(event, listener);
|
|
56
|
+
return () => {
|
|
57
|
+
map.current.off(event, listener);
|
|
58
|
+
};
|
|
59
|
+
});
|
|
45
60
|
};
|
|
@@ -3,11 +3,11 @@ export { default as FollowControls } from './controls/follow.svelte';
|
|
|
3
3
|
export { default as NavigationControls } from './controls/navigation.svelte';
|
|
4
4
|
export { default as SatelliteControls } from './controls/satellite.svelte';
|
|
5
5
|
export { default as DirectionalMarker } from './directional-marker.svelte';
|
|
6
|
-
export { useMapLibre, useMapLibreEvent } from './hooks';
|
|
6
|
+
export { useMapLibre, useMapLibreEvent } from './hooks.svelte';
|
|
7
7
|
export { default as MapLibre } from './index.svelte';
|
|
8
8
|
export { default as LngLatInput } from './lnglat-input.svelte';
|
|
9
9
|
export { default as MapLibreMarker } from './marker.svelte';
|
|
10
10
|
export { lngLatToMercator, mercatorToCartesian, lngLatToCartesian, cartesianToMercator, cartesianToLngLat, } from './math';
|
|
11
|
-
export { useMapLibreThreeRaycast } from './plugins/raycast';
|
|
11
|
+
export { useMapLibreThreeRaycast } from './plugins/raycast.svelte';
|
|
12
12
|
export { useMapLibreThreeRenderer } from './plugins/three.svelte';
|
|
13
13
|
export { MapProviders, type MapProvider, GeoPose, Waypoint } from './types';
|
|
@@ -3,11 +3,11 @@ export { default as FollowControls } from './controls/follow.svelte';
|
|
|
3
3
|
export { default as NavigationControls } from './controls/navigation.svelte';
|
|
4
4
|
export { default as SatelliteControls } from './controls/satellite.svelte';
|
|
5
5
|
export { default as DirectionalMarker } from './directional-marker.svelte';
|
|
6
|
-
export { useMapLibre, useMapLibreEvent } from './hooks';
|
|
6
|
+
export { useMapLibre, useMapLibreEvent } from './hooks.svelte';
|
|
7
7
|
export { default as MapLibre } from './index.svelte';
|
|
8
8
|
export { default as LngLatInput } from './lnglat-input.svelte';
|
|
9
9
|
export { default as MapLibreMarker } from './marker.svelte';
|
|
10
10
|
export { lngLatToMercator, mercatorToCartesian, lngLatToCartesian, cartesianToMercator, cartesianToLngLat, } from './math';
|
|
11
|
-
export { useMapLibreThreeRaycast } from './plugins/raycast';
|
|
11
|
+
export { useMapLibreThreeRaycast } from './plugins/raycast.svelte';
|
|
12
12
|
export { useMapLibreThreeRenderer } from './plugins/three.svelte';
|
|
13
13
|
export { MapProviders, GeoPose, Waypoint } from './types';
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import { LngLat, Map, type MapOptions } from 'maplibre-gl'
|
|
27
27
|
import { onMount, type Snippet, tick } from 'svelte'
|
|
28
28
|
|
|
29
|
-
import { provideMapContext } from './hooks'
|
|
29
|
+
import { provideMapContext } from './hooks.svelte'
|
|
30
30
|
import { getStyleSpecification } from './style'
|
|
31
31
|
import { type MapProvider, MapProviders } from './types'
|
|
32
32
|
import { DEFAULT_MAX_ZOOM } from './zoom'
|
|
@@ -110,7 +110,14 @@
|
|
|
110
110
|
...rest
|
|
111
111
|
}: Props = $props()
|
|
112
112
|
|
|
113
|
-
const context = provideMapContext(
|
|
113
|
+
const context = provideMapContext(() => ({
|
|
114
|
+
center,
|
|
115
|
+
zoom,
|
|
116
|
+
maxZoom,
|
|
117
|
+
mapProvider,
|
|
118
|
+
mapProviderKey,
|
|
119
|
+
satellite,
|
|
120
|
+
}))
|
|
114
121
|
|
|
115
122
|
let container = $state.raw<HTMLDivElement>()
|
|
116
123
|
let created = $state(false)
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
-->
|
|
14
14
|
<script lang="ts">
|
|
15
15
|
import { LngLat, Marker } from 'maplibre-gl'
|
|
16
|
+
import { fromStore } from 'svelte/store'
|
|
16
17
|
|
|
17
|
-
import { useMapLibre } from './hooks'
|
|
18
|
+
import { useMapLibre } from './hooks.svelte'
|
|
18
19
|
|
|
19
20
|
interface Props {
|
|
20
21
|
/** The longitude of the marker. */
|
|
@@ -33,7 +34,8 @@
|
|
|
33
34
|
|
|
34
35
|
const { lng = 0, lat = 0, rotation = 0, scale = 1, color = '', element }: Props = $props()
|
|
35
36
|
|
|
36
|
-
const
|
|
37
|
+
const context = useMapLibre()
|
|
38
|
+
const map = fromStore(context.map)
|
|
37
39
|
|
|
38
40
|
const marker = $derived.by(() => {
|
|
39
41
|
const value = new Marker(element ? { element, scale, color } : { scale, color })
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
|
|
45
47
|
$effect.pre(() => {
|
|
46
48
|
const currentMarker = marker
|
|
47
|
-
currentMarker.addTo(map)
|
|
49
|
+
currentMarker.addTo(map.current)
|
|
48
50
|
return () => {
|
|
49
51
|
currentMarker.remove()
|
|
50
52
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fromStore } from 'svelte/store';
|
|
2
2
|
import { Matrix4, Vector2, Vector3 } from 'three';
|
|
3
|
-
import { useMapLibre } from '../hooks';
|
|
3
|
+
import { useMapLibre } from '../hooks.svelte';
|
|
4
4
|
/**
|
|
5
5
|
* Provides raycasting against THREE objects projected on to a maplibre map.
|
|
6
6
|
*/
|
|
7
7
|
export const useMapLibreThreeRaycast = (cameraSignal) => {
|
|
8
|
-
const
|
|
8
|
+
const context = useMapLibre();
|
|
9
|
+
const map = fromStore(context.map);
|
|
9
10
|
const pointer = new Vector2();
|
|
10
11
|
const handleMouseMove = (event) => {
|
|
11
|
-
pointer.set((event.point.x / map.transform.width) * 2 - 1, -(event.point.y / map.transform.height) * 2 + 1);
|
|
12
|
+
pointer.set((event.point.x / map.current.transform.width) * 2 - 1, -(event.point.y / map.current.transform.height) * 2 + 1);
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
map.on('mousemove', handleMouseMove);
|
|
15
|
-
return () => map.off('mousemove', handleMouseMove);
|
|
14
|
+
$effect(() => {
|
|
15
|
+
map.current.on('mousemove', handleMouseMove);
|
|
16
|
+
return () => map.current.off('mousemove', handleMouseMove);
|
|
16
17
|
});
|
|
17
18
|
const cameraPosition = new Vector3();
|
|
18
19
|
const mousePosition = new Vector3();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MercatorCoordinate } from 'maplibre-gl';
|
|
2
|
+
import { fromStore } from 'svelte/store';
|
|
2
3
|
import { Line, Matrix4, Vector3 } from 'three';
|
|
3
|
-
import { useMapLibre } from '../hooks';
|
|
4
|
+
import { useMapLibre } from '../hooks.svelte';
|
|
4
5
|
import { lngLatToCartesian, mercatorToCartesian } from '../math';
|
|
5
6
|
/**
|
|
6
7
|
*
|
|
@@ -20,18 +21,19 @@ import { lngLatToCartesian, mercatorToCartesian } from '../math';
|
|
|
20
21
|
* @param renderFn A callback that runs on each map draw. Use it to render your scene.
|
|
21
22
|
*/
|
|
22
23
|
export const useMapLibreThreeRenderer = (scene, cameraSignal, renderFn) => {
|
|
23
|
-
const
|
|
24
|
+
const context = useMapLibre();
|
|
25
|
+
const map = fromStore(context.map);
|
|
24
26
|
const cameraTransform = new Matrix4();
|
|
25
27
|
const cameraMatrix = new Matrix4();
|
|
26
28
|
const scale = new Matrix4();
|
|
27
29
|
const rotation = new Matrix4().multiplyMatrices(new Matrix4().makeRotationX(-0.5 * Math.PI), new Matrix4().makeRotationY(Math.PI));
|
|
28
30
|
$effect(() => {
|
|
29
|
-
map.addLayer({
|
|
31
|
+
map.current.addLayer({
|
|
30
32
|
id: 'scene-layer',
|
|
31
33
|
type: 'custom',
|
|
32
34
|
renderingMode: '3d',
|
|
33
35
|
render(_, { modelViewProjectionMatrix }) {
|
|
34
|
-
const center = map.getCenter();
|
|
36
|
+
const center = map.current.getCenter();
|
|
35
37
|
const mercator = MercatorCoordinate.fromLngLat(center, 0);
|
|
36
38
|
const mercatorScale = mercator.meterInMercatorCoordinateUnits();
|
|
37
39
|
const { x: cx, y: cy } = mercatorToCartesian(mercator, mercatorScale);
|
|
@@ -63,11 +65,11 @@ export const useMapLibreThreeRenderer = (scene, cameraSignal, renderFn) => {
|
|
|
63
65
|
}
|
|
64
66
|
});
|
|
65
67
|
renderFn(scene, cameraSignal.current);
|
|
66
|
-
map.triggerRepaint();
|
|
68
|
+
map.current.triggerRepaint();
|
|
67
69
|
},
|
|
68
70
|
});
|
|
69
71
|
return () => {
|
|
70
|
-
map.removeLayer('scene-layer');
|
|
72
|
+
map.current.removeLayer('scene-layer');
|
|
71
73
|
};
|
|
72
74
|
});
|
|
73
75
|
};
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
type MapMouseEvent,
|
|
15
15
|
MercatorCoordinate,
|
|
16
16
|
} from 'maplibre-gl'
|
|
17
|
+
import { fromStore } from 'svelte/store'
|
|
17
18
|
|
|
18
19
|
import {
|
|
19
20
|
cartesianToMercator,
|
|
@@ -30,7 +31,8 @@
|
|
|
30
31
|
|
|
31
32
|
const { onUpdate }: Props = $props()
|
|
32
33
|
|
|
33
|
-
const
|
|
34
|
+
const context = useMapLibre()
|
|
35
|
+
const map = fromStore(context.map)
|
|
34
36
|
const nav = useNavigationMap()
|
|
35
37
|
|
|
36
38
|
let downLngLat = $state(new LngLat(0, 0))
|
|
@@ -94,21 +96,26 @@
|
|
|
94
96
|
|
|
95
97
|
const handleKeydown = (event: KeyboardEvent) => {
|
|
96
98
|
if (event.shiftKey) {
|
|
97
|
-
map.getCanvas().classList.add('!cursor-crosshair')
|
|
99
|
+
map.current.getCanvas().classList.add('!cursor-crosshair')
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
const handleKeyup = () => {
|
|
102
|
-
map.getCanvas().classList.remove('!cursor-crosshair')
|
|
104
|
+
map.current.getCanvas().classList.remove('!cursor-crosshair')
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
$effect
|
|
107
|
+
$effect(() => {
|
|
106
108
|
if (drawing) {
|
|
107
|
-
map.on('mousemove', handlePointerMove)
|
|
108
|
-
map.on('mouseup', handlePointerUp)
|
|
109
|
+
map.current.on('mousemove', handlePointerMove)
|
|
110
|
+
map.current.on('mouseup', handlePointerUp)
|
|
109
111
|
} else {
|
|
110
|
-
map.off('mousemove', handlePointerMove)
|
|
111
|
-
map.off('mouseup', handlePointerUp)
|
|
112
|
+
map.current.off('mousemove', handlePointerMove)
|
|
113
|
+
map.current.off('mouseup', handlePointerUp)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return () => {
|
|
117
|
+
map.current.off('mousemove', handlePointerMove)
|
|
118
|
+
map.current.off('mouseup', handlePointerUp)
|
|
112
119
|
}
|
|
113
120
|
})
|
|
114
121
|
</script>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
const nav = useNavigationMap()
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
<nav class="py-4 pl-4 sm:h-full sm:w-
|
|
22
|
+
<nav class="py-4 pl-4 sm:h-full sm:w-87.5">
|
|
23
23
|
<ol class="mb-2 flex flex-wrap items-center">
|
|
24
24
|
{#each nav.tabs as tabTitle (tabTitle)}
|
|
25
25
|
{@const selected = nav.tab === tabTitle}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { IconButton, Label, TextInput, Tooltip } from '@viamrobotics/prime-core'
|
|
3
3
|
import { LngLat, LngLatBounds } from 'maplibre-gl'
|
|
4
|
+
import { fromStore } from 'svelte/store'
|
|
4
5
|
|
|
5
6
|
import type { Geometry, Obstacle } from '../../types'
|
|
6
7
|
|
|
@@ -16,14 +17,15 @@
|
|
|
16
17
|
|
|
17
18
|
const { onupdate }: Props = $props()
|
|
18
19
|
|
|
19
|
-
const
|
|
20
|
+
const context = useMapLibre()
|
|
21
|
+
const map = fromStore(context.map)
|
|
20
22
|
const nav = useNavigationMap()
|
|
21
23
|
|
|
22
24
|
const handleSelect = (selection: { name: string; location: LngLat }) => {
|
|
23
25
|
const radius = nav.boundingRadius[selection.name]
|
|
24
26
|
const lngLat = new LngLat(selection.location.lng, selection.location.lat)
|
|
25
27
|
const bounds = LngLatBounds.fromLngLat(lngLat, radius)
|
|
26
|
-
map.fitBounds(bounds, {
|
|
28
|
+
map.current.fitBounds(bounds, {
|
|
27
29
|
padding: 100,
|
|
28
30
|
duration: 800,
|
|
29
31
|
curve: 0.1,
|
|
@@ -98,7 +100,7 @@
|
|
|
98
100
|
|
|
99
101
|
{#each nav.obstacles as { name, location, geometries, color, label }, index (index)}
|
|
100
102
|
<li
|
|
101
|
-
class="group border-b-medium flex min-h-
|
|
103
|
+
class="group border-b-medium flex min-h-7.5 items-center border-b pl-2 leading-none last:border-b-0"
|
|
102
104
|
class:pb-3={debugMode}
|
|
103
105
|
class:pt-1={debugMode}
|
|
104
106
|
class:bg-light={nav.selected === name}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { LngLat } from 'maplibre-gl'
|
|
3
3
|
|
|
4
4
|
import { IconButton } from '@viamrobotics/prime-core'
|
|
5
|
+
import { fromStore } from 'svelte/store'
|
|
5
6
|
|
|
6
7
|
import { useMapLibre, useMapLibreEvent, Waypoint } from '../../../maplibre'
|
|
7
8
|
import { useNavigationMap } from '../../use-navigation-map.svelte'
|
|
@@ -13,7 +14,8 @@
|
|
|
13
14
|
|
|
14
15
|
const { onaddwaypoint, ondeletewaypoint }: Props = $props()
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
+
const context = useMapLibre()
|
|
18
|
+
const map = fromStore(context.map)
|
|
17
19
|
const nav = useNavigationMap()
|
|
18
20
|
|
|
19
21
|
const handleDeleteWaypoint = (id: string) => {
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
icon="image-filter-center-focus"
|
|
51
53
|
label="Focus waypoint {index}"
|
|
52
54
|
on:click={() =>
|
|
53
|
-
map.flyTo({
|
|
55
|
+
map.current.flyTo({
|
|
54
56
|
zoom: 15,
|
|
55
57
|
duration: 800,
|
|
56
58
|
curve: 0.1,
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
type MapLayerTouchEvent,
|
|
9
9
|
type MapMouseEvent,
|
|
10
10
|
} from 'maplibre-gl'
|
|
11
|
-
import
|
|
11
|
+
import { fromStore } from 'svelte/store'
|
|
12
|
+
import { type BufferGeometry, Vector2 } from 'three'
|
|
12
13
|
|
|
13
14
|
import type { Obstacle } from '../types'
|
|
14
15
|
|
|
@@ -24,7 +25,8 @@
|
|
|
24
25
|
|
|
25
26
|
const { name, onupdate }: Props = $props()
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
+
const context = useMapLibre()
|
|
29
|
+
const map = fromStore(context.map)
|
|
28
30
|
const nav = useNavigationMap()
|
|
29
31
|
|
|
30
32
|
let pointerdownTheta = 0
|
|
@@ -35,13 +37,13 @@
|
|
|
35
37
|
|
|
36
38
|
let draggingObstacle = $state(false)
|
|
37
39
|
|
|
38
|
-
const pointermove = new
|
|
39
|
-
const pointerdown = new
|
|
40
|
+
const pointermove = new Vector2()
|
|
41
|
+
const pointerdown = new Vector2()
|
|
40
42
|
|
|
41
43
|
const debugMode = $derived(nav.environment === 'debug')
|
|
42
44
|
const obstacle = $derived(nav.obstacles.find((item) => item.name === name))
|
|
43
45
|
|
|
44
|
-
const handleGeometryCreate = (ref:
|
|
46
|
+
const handleGeometryCreate = (ref: BufferGeometry) => {
|
|
45
47
|
ref.rotateX(-Math.PI / 2)
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
return
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
map.dragPan.disable()
|
|
57
|
+
map.current.dragPan.disable()
|
|
56
58
|
draggingObstacle = true
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -66,7 +68,7 @@
|
|
|
66
68
|
|
|
67
69
|
if (isManipulating) {
|
|
68
70
|
event.preventDefault()
|
|
69
|
-
map.getCanvas().classList.add('!cursor-ns-resize')
|
|
71
|
+
map.current.getCanvas().classList.add('!cursor-ns-resize')
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
pointerdown.set(event.point.x, event.point.y)
|
|
@@ -164,17 +166,21 @@
|
|
|
164
166
|
|
|
165
167
|
const handlePointerUp = () => {
|
|
166
168
|
draggingObstacle = false
|
|
167
|
-
map.dragPan.enable()
|
|
168
|
-
map.getCanvas().classList.remove('!cursor-ns-resize')
|
|
169
|
+
map.current.dragPan.enable()
|
|
170
|
+
map.current.getCanvas().classList.remove('!cursor-ns-resize')
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
const active = $derived(nav.hovered === name || nav.selected === name)
|
|
172
174
|
|
|
173
|
-
$effect
|
|
175
|
+
$effect(() => {
|
|
174
176
|
if (draggingObstacle) {
|
|
175
|
-
map.on('mousemove', handlePointerMove)
|
|
177
|
+
map.current.on('mousemove', handlePointerMove)
|
|
176
178
|
} else {
|
|
177
|
-
map.off('mousemove', handlePointerMove)
|
|
179
|
+
map.current.off('mousemove', handlePointerMove)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return () => {
|
|
183
|
+
map.current.off('mousemove', handlePointerMove)
|
|
178
184
|
}
|
|
179
185
|
})
|
|
180
186
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useThrelte } from '@threlte/core';
|
|
2
2
|
import { interactivity } from '@threlte/extras';
|
|
3
|
+
import { fromStore } from 'svelte/store';
|
|
3
4
|
import { useMapLibre, useMapLibreThreeRaycast } from '../../maplibre';
|
|
4
5
|
/**
|
|
5
6
|
* Provides interactivity as described in @threlte/extras,
|
|
@@ -8,10 +9,11 @@ import { useMapLibre, useMapLibreThreeRaycast } from '../../maplibre';
|
|
|
8
9
|
*/
|
|
9
10
|
export const interactivityPlugin = () => {
|
|
10
11
|
const { camera } = useThrelte();
|
|
11
|
-
const
|
|
12
|
+
const context = useMapLibre();
|
|
13
|
+
const map = fromStore(context.map);
|
|
12
14
|
const { pointer, compute } = useMapLibreThreeRaycast(camera);
|
|
13
15
|
interactivity({
|
|
14
|
-
target: map.getCanvas(),
|
|
16
|
+
target: map.current.getCanvas(),
|
|
15
17
|
filter: (hits) => {
|
|
16
18
|
// Only return the first hit
|
|
17
19
|
return hits.slice(0, 1);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { T, useThrelte } from '@threlte/core'
|
|
3
3
|
import { interactivity } from '@threlte/extras'
|
|
4
|
+
import { fromStore } from 'svelte/store'
|
|
4
5
|
import { Camera, type Intersection, Plane, Vector3 } from 'three'
|
|
5
6
|
|
|
6
7
|
import {
|
|
@@ -16,7 +17,8 @@
|
|
|
16
17
|
|
|
17
18
|
const { view, children }: Props = $props()
|
|
18
19
|
|
|
19
|
-
const
|
|
20
|
+
const context = useMapLibre()
|
|
21
|
+
const map = fromStore(context.map)
|
|
20
22
|
const { scene, camera, renderer } = $state(useThrelte())
|
|
21
23
|
|
|
22
24
|
camera.set(new Camera())
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
const { pointer, compute } = useMapLibreThreeRaycast(camera)
|
|
25
27
|
|
|
26
28
|
interactivity({
|
|
27
|
-
target: map.getCanvas(),
|
|
29
|
+
target: map.current.getCanvas(),
|
|
28
30
|
filter: (hits: Intersection[]) => {
|
|
29
31
|
// Only return the first hit
|
|
30
32
|
return hits.slice(0, 1)
|
package/package.json
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
2
|
+
"name": "@viamrobotics/test-widgets",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"!dist/**/*.test.*",
|
|
9
|
+
"!dist/**/*.spec.*"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"svelte": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"svelte": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/viamrobotics/test-widgets.git"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"svelte": "^5.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@changesets/cli": "^2.30.0",
|
|
34
|
+
"@eslint/compat": "^2.0.3",
|
|
35
|
+
"@eslint/js": "^10.0.1",
|
|
36
|
+
"@fontsource-variable/public-sans": "^5.2.7",
|
|
37
|
+
"@fontsource-variable/roboto-mono": "^5.2.8",
|
|
38
|
+
"@fontsource-variable/space-grotesk": "^5.2.10",
|
|
39
|
+
"@playwright/test": "^1.59.1",
|
|
40
|
+
"@sentry/svelte": "^10.47.0",
|
|
41
|
+
"@svelte-put/resize": "^4.0.0",
|
|
42
|
+
"@sveltejs/adapter-static": "^3.0.10",
|
|
43
|
+
"@sveltejs/kit": "^2.55.0",
|
|
44
|
+
"@sveltejs/package": "^2.5.7",
|
|
45
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
46
|
+
"@tailwindcss/postcss": "^4.2.2",
|
|
47
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
48
|
+
"@tanstack/svelte-query": "^6.1.12",
|
|
49
|
+
"@tanstack/svelte-query-devtools": "^6.1.12",
|
|
50
|
+
"@testing-library/dom": "^10.4.1",
|
|
51
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
52
|
+
"@testing-library/svelte": "^5.3.1",
|
|
53
|
+
"@testing-library/user-event": "^14.6.1",
|
|
54
|
+
"@threlte/core": "^8.5.5",
|
|
55
|
+
"@threlte/extras": "^9.14.2",
|
|
56
|
+
"@threlte/test": "^1.0.0",
|
|
57
|
+
"@types/lodash-es": "^4.17.12",
|
|
58
|
+
"@types/node": "^25",
|
|
59
|
+
"@types/three": "^0.183.1",
|
|
60
|
+
"@viamrobotics/motion-tools": "^1.16.0",
|
|
61
|
+
"@viamrobotics/prime-core": "^0.1.16",
|
|
62
|
+
"@viamrobotics/prime-editor": "^0.0.2",
|
|
63
|
+
"@viamrobotics/sdk": "^0.68.1",
|
|
64
|
+
"@viamrobotics/svelte-sdk": "^1.1.5",
|
|
65
|
+
"@viamrobotics/tailwind-config": "^1.0.0",
|
|
66
|
+
"@viamrobotics/three": "^0.0.9",
|
|
67
|
+
"@vitest/browser": "^4.1.2",
|
|
68
|
+
"@vitest/browser-playwright": "^4.1.2",
|
|
69
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
70
|
+
"eslint": "^10.1.0",
|
|
71
|
+
"eslint-config-prettier": "^10.1.8",
|
|
72
|
+
"eslint-plugin-perfectionist": "^5.8.0",
|
|
73
|
+
"eslint-plugin-svelte": "^3.16.0",
|
|
74
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
75
|
+
"globals": "^17.4.0",
|
|
76
|
+
"lodash-es": "^4.18.1",
|
|
77
|
+
"maplibre-gl": "^5.21.1",
|
|
78
|
+
"mock-match-media": "^1.0.3",
|
|
79
|
+
"playwright": "^1.59.1",
|
|
80
|
+
"prettier": "^3.8.1",
|
|
81
|
+
"prettier-plugin-svelte": "^3.5.1",
|
|
82
|
+
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
83
|
+
"publint": "^0.3.18",
|
|
84
|
+
"runed": "^0.37.1",
|
|
85
|
+
"svelte": "^5.55.1",
|
|
86
|
+
"svelte-check": "^4.4.6",
|
|
87
|
+
"svelte-splitpanes": "^8.0.12",
|
|
88
|
+
"tailwind-merge": "^3.5.0",
|
|
89
|
+
"tailwindcss": "^4.2.2",
|
|
90
|
+
"three": "^0.183.2",
|
|
91
|
+
"threlte-uikit": "^1.2.1",
|
|
92
|
+
"type-fest": "^5.5.0",
|
|
93
|
+
"typescript": "^6.0.2",
|
|
94
|
+
"typescript-eslint": "^8.58.0",
|
|
95
|
+
"vite": "^8.0.3",
|
|
96
|
+
"vite-plugin-devtools-json": "^1.0.0",
|
|
97
|
+
"vite-plugin-glsl": "^1.5.6",
|
|
98
|
+
"vitest": "^4.1.2",
|
|
99
|
+
"vitest-browser-svelte": "^2.1.0"
|
|
100
|
+
},
|
|
101
|
+
"engines": {
|
|
102
|
+
"node": ">=22.12.0"
|
|
103
|
+
},
|
|
104
|
+
"scripts": {
|
|
105
|
+
"dev": "vite dev",
|
|
106
|
+
"build": "vite build && pnpm prepack",
|
|
107
|
+
"preview": "vite preview",
|
|
108
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",
|
|
109
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
110
|
+
"lint": "prettier --check . && eslint .",
|
|
111
|
+
"format": "prettier --write . && eslint . --fix",
|
|
112
|
+
"test:unit": "vitest",
|
|
113
|
+
"test": "pnpm test:unit -- --run",
|
|
114
|
+
"test:e2e": "playwright test",
|
|
115
|
+
"release": "changeset publish"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
File without changes
|