@craft-native/ts-maps 0.0.37 → 0.0.72
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/package.json +4 -4
- package/src/FilesystemTileBackend.ts +1 -1
- package/src/MapView.ts +7 -7
- package/src/adapters.ts +2 -2
- package/src/bridge-protocol.ts +1 -1
- package/src/index.ts +9 -9
- package/src/offlineRegion.ts +1 -1
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@craft-native/ts-maps",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.72",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Craft SDK bindings for the ts-maps interactive map runtime. Provides a cross-platform MapView component backed by the MapProvider.ts_maps variant in the Zig core.",
|
|
7
7
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"homepage": "https://github.com/
|
|
9
|
+
"homepage": "https://github.com/craft-native/craft#readme",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/
|
|
12
|
+
"url": "git+https://github.com/craft-native/craft.git",
|
|
13
13
|
"directory": "packages/ts-maps"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/bun": "^1.2.0",
|
|
58
|
-
"ts-maps": "^0.
|
|
58
|
+
"ts-maps": "^0.3.1",
|
|
59
59
|
"very-happy-dom": "^0.1.4"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -33,7 +33,7 @@ import type { Tile, TileCacheBackend } from 'ts-maps'
|
|
|
33
33
|
// Import the fs helpers directly from their source module rather than from
|
|
34
34
|
// the `craft-native` package root, matching how `MapView` talks to
|
|
35
35
|
// the bridge — keeps the type graph narrow.
|
|
36
|
-
import { fs, readBinaryFile, writeBinaryFile } from '../../typescript/src/api/fs'
|
|
36
|
+
import { fs, readBinaryFile, writeBinaryFile } from '../../typescript/src/api/fs.js'
|
|
37
37
|
|
|
38
38
|
export interface FilesystemBackendOptions {
|
|
39
39
|
/**
|
package/src/MapView.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// package root, so we don't pull the entire `craft-native` surface
|
|
11
11
|
// (including unrelated stx-templated sidebar files) through the type
|
|
12
12
|
// checker. The public API of the bridge is stable, so this is fine.
|
|
13
|
-
import type { NativeBridge } from '../../typescript/src/bridge/core'
|
|
14
|
-
import { getBridge } from '../../typescript/src/bridge/core'
|
|
13
|
+
import type { NativeBridge } from '../../typescript/src/bridge/core.js'
|
|
14
|
+
import { getBridge } from '../../typescript/src/bridge/core.js'
|
|
15
15
|
import type { TsMap } from 'ts-maps'
|
|
16
16
|
import { createMap, tileLayer } from 'ts-maps'
|
|
17
17
|
import {
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
craftPolylineToPolyline,
|
|
24
24
|
craftRegionToBounds,
|
|
25
25
|
latLngToCraftCoord,
|
|
26
|
-
} from './adapters'
|
|
26
|
+
} from './adapters.js'
|
|
27
27
|
import type {
|
|
28
28
|
MapBridgeEvent,
|
|
29
29
|
TypedMapBridgeRequest,
|
|
30
|
-
} from './bridge-protocol'
|
|
31
|
-
import { BRIDGE_NAMESPACE, mapEventName } from './bridge-protocol'
|
|
30
|
+
} from './bridge-protocol.js'
|
|
31
|
+
import { BRIDGE_NAMESPACE, mapEventName } from './bridge-protocol.js'
|
|
32
32
|
import type {
|
|
33
33
|
Coordinate,
|
|
34
34
|
MapCamera,
|
|
@@ -38,8 +38,8 @@ import type {
|
|
|
38
38
|
MapPolygon,
|
|
39
39
|
MapPolyline,
|
|
40
40
|
MapRegion,
|
|
41
|
-
} from './types'
|
|
42
|
-
import { defaultMapCamera, defaultMapConfiguration } from './types'
|
|
41
|
+
} from './types.js'
|
|
42
|
+
import { defaultMapCamera, defaultMapConfiguration } from './types.js'
|
|
43
43
|
|
|
44
44
|
// Monotonic counter — same pattern as `components/native.ts` in
|
|
45
45
|
// `craft-native` — so multiple map views created in the same tick
|
package/src/adapters.ts
CHANGED
|
@@ -17,8 +17,8 @@ import type {
|
|
|
17
17
|
MapPolygon,
|
|
18
18
|
MapPolyline,
|
|
19
19
|
MapRegion,
|
|
20
|
-
} from './types'
|
|
21
|
-
import { markerColorHex, strokePatternDashes } from './types'
|
|
20
|
+
} from './types.js'
|
|
21
|
+
import { markerColorHex, strokePatternDashes } from './types.js'
|
|
22
22
|
|
|
23
23
|
// ---------------------------------------------------------------------------
|
|
24
24
|
// Coordinates
|
package/src/bridge-protocol.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export {
|
|
|
19
19
|
type ComponentProps,
|
|
20
20
|
type MapViewInstance,
|
|
21
21
|
type MapViewProps,
|
|
22
|
-
} from './MapView'
|
|
22
|
+
} from './MapView.js'
|
|
23
23
|
|
|
24
24
|
// Type mirrors of the Zig structs.
|
|
25
25
|
export {
|
|
@@ -43,7 +43,7 @@ export {
|
|
|
43
43
|
type MarkerColor,
|
|
44
44
|
type StrokePattern,
|
|
45
45
|
type UserTrackingMode,
|
|
46
|
-
} from './types'
|
|
46
|
+
} from './types.js'
|
|
47
47
|
|
|
48
48
|
// Adapters (pure fns) for round-tripping between Craft and ts-maps types.
|
|
49
49
|
export {
|
|
@@ -60,7 +60,7 @@ export {
|
|
|
60
60
|
latLngToCraftCoord,
|
|
61
61
|
regionFromBounds,
|
|
62
62
|
type TsMapsCameraOptions,
|
|
63
|
-
} from './adapters'
|
|
63
|
+
} from './adapters.js'
|
|
64
64
|
|
|
65
65
|
// Bridge protocol constants/types.
|
|
66
66
|
export {
|
|
@@ -70,18 +70,18 @@ export {
|
|
|
70
70
|
type MapBridgeMethod,
|
|
71
71
|
type MapBridgeRequest,
|
|
72
72
|
type TypedMapBridgeRequest,
|
|
73
|
-
} from './bridge-protocol'
|
|
73
|
+
} from './bridge-protocol.js'
|
|
74
74
|
|
|
75
75
|
// Sandbox-filesystem tile persistence + offline region helpers.
|
|
76
76
|
export {
|
|
77
77
|
createFilesystemBackend,
|
|
78
78
|
type FilesystemBackendOptions,
|
|
79
|
-
} from './FilesystemTileBackend'
|
|
79
|
+
} from './FilesystemTileBackend.js'
|
|
80
80
|
export {
|
|
81
81
|
createFilesystemTileCache,
|
|
82
82
|
saveOfflineRegionToFilesystem,
|
|
83
83
|
type FilesystemOfflineRegionOptions,
|
|
84
|
-
} from './offlineRegion'
|
|
84
|
+
} from './offlineRegion.js'
|
|
85
85
|
|
|
86
86
|
// Runtime capability probe — tells the host app which renderer the
|
|
87
87
|
// device can realistically drive.
|
|
@@ -89,7 +89,7 @@ export {
|
|
|
89
89
|
probeCapabilities,
|
|
90
90
|
supportsAdvancedRendering,
|
|
91
91
|
type MapRendererCapabilities,
|
|
92
|
-
} from './capabilities'
|
|
92
|
+
} from './capabilities.js'
|
|
93
93
|
|
|
94
94
|
// createMap is the underlying ts-maps factory; re-export under its original
|
|
95
95
|
// name for parity with the spec which mentions `createMap` as a Craft export.
|
|
@@ -105,5 +105,5 @@ export const tsMapsProvider = 'ts_maps' as const
|
|
|
105
105
|
* Alias preserved for callers that imported the two helpers by spec name.
|
|
106
106
|
* `coordinateFromLatLng(LatLng) -> Coordinate`, `latLngFromCoordinate(Coordinate) -> LatLng`.
|
|
107
107
|
*/
|
|
108
|
-
export { latLngToCraftCoord as coordinateFromLatLng } from './adapters'
|
|
109
|
-
export { craftCoordToLatLng as latLngFromCoordinate } from './adapters'
|
|
108
|
+
export { latLngToCraftCoord as coordinateFromLatLng } from './adapters.js'
|
|
109
|
+
export { craftCoordToLatLng as latLngFromCoordinate } from './adapters.js'
|
package/src/offlineRegion.ts
CHANGED
|
@@ -28,7 +28,7 @@ import type {
|
|
|
28
28
|
TileCacheOptions,
|
|
29
29
|
} from 'ts-maps'
|
|
30
30
|
import { saveOfflineRegion, TileCache } from 'ts-maps'
|
|
31
|
-
import { createFilesystemBackend } from './FilesystemTileBackend'
|
|
31
|
+
import { createFilesystemBackend } from './FilesystemTileBackend.js'
|
|
32
32
|
|
|
33
33
|
export type OfflineBoundsLike =
|
|
34
34
|
| { west: number, south: number, east: number, north: number }
|