@dxos/solid-ui-geo 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29
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/lib/browser/chunk-RMZP4JBX.mjs +9 -0
- package/dist/lib/browser/{countries-110m-6FO6R2F2.mjs → countries-110m-MXSNZ6PF.mjs} +1 -1
- package/dist/lib/browser/data.mjs +1 -1
- package/dist/lib/browser/index.mjs +240 -195
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +19 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KNEGK7HI.mjs → chunk-ICM52DKE.mjs} +2 -2
- package/dist/lib/node-esm/{countries-110m-UQ4O6NQR.mjs → countries-110m-HEHEK3AV.mjs} +1 -1
- package/dist/lib/node-esm/data.mjs +1 -1
- package/dist/lib/node-esm/index.mjs +240 -195
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +21 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/data/airports.d.ts +4 -4
- package/dist/types/data/airports.d.ts.map +1 -1
- package/dist/types/data/countries-110m.d.ts.map +1 -1
- package/dist/types/data/countries-dots-3.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.solid-stories.d.ts +3 -3
- package/dist/types/src/components/Globe/Globe.solid-stories.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.d.ts +1 -1
- package/dist/types/src/components/Map/Map.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.solid-stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Controls.d.ts.map +1 -1
- package/dist/types/src/hooks/context.d.ts.map +1 -1
- package/dist/types/src/hooks/useDrag.d.ts.map +1 -1
- package/dist/types/src/hooks/useGlobeZoomHandler.d.ts +1 -1
- package/dist/types/src/hooks/useGlobeZoomHandler.d.ts.map +1 -1
- package/dist/types/src/hooks/useMapZoomHandler.d.ts +1 -1
- package/dist/types/src/hooks/useMapZoomHandler.d.ts.map +1 -1
- package/dist/types/src/hooks/useSpinner.d.ts.map +1 -1
- package/dist/types/src/hooks/useTour.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -4
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/debug.d.ts.map +1 -1
- package/dist/types/src/util/inertia.d.ts.map +1 -1
- package/dist/types/src/util/path.d.ts.map +1 -1
- package/dist/types/src/util/render.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -20
- package/src/components/Globe/Globe.solid-stories.tsx +2 -3
- package/src/components/Globe/Globe.tsx +6 -4
- package/src/components/Map/Map.solid-stories.tsx +0 -1
- package/src/components/Map/Map.tsx +16 -6
- package/src/hooks/useSpinner.ts +0 -1
- package/src/index.ts +0 -1
- package/src/util/render.ts +0 -1
- package/dist/lib/browser/chunk-KONL6N4F.mjs +0 -9
- /package/dist/lib/browser/{chunk-KONL6N4F.mjs.map → chunk-RMZP4JBX.mjs.map} +0 -0
- /package/dist/lib/browser/{countries-110m-6FO6R2F2.mjs.map → countries-110m-MXSNZ6PF.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-KNEGK7HI.mjs.map → chunk-ICM52DKE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{countries-110m-UQ4O6NQR.mjs.map → countries-110m-HEHEK3AV.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/solid-ui-geo",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dfabb4ec29",
|
|
4
4
|
"description": "Geo components for SolidJS.",
|
|
5
5
|
"homepage": "https://github.com/dxos",
|
|
6
6
|
"bugs": "https://github.com/dxos/issues",
|
|
@@ -12,26 +12,28 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#translations": "./src/translations.ts"
|
|
17
|
+
},
|
|
15
18
|
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/types/src/index.d.ts",
|
|
21
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
22
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
23
|
+
},
|
|
16
24
|
"./data": {
|
|
17
25
|
"types": "./dist/types/src/data.d.ts",
|
|
18
26
|
"browser": "./dist/lib/browser/data.mjs",
|
|
19
27
|
"node": "./dist/lib/node-esm/data.mjs"
|
|
20
28
|
},
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
29
|
+
"./translations": {
|
|
30
|
+
"source": "./src/translations.ts",
|
|
31
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
32
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
33
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
25
34
|
}
|
|
26
35
|
},
|
|
27
36
|
"types": "dist/types/src/index.d.ts",
|
|
28
|
-
"typesVersions": {
|
|
29
|
-
"*": {
|
|
30
|
-
"data": [
|
|
31
|
-
"dist/types/src/data.d.ts"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
37
|
"files": [
|
|
36
38
|
"data",
|
|
37
39
|
"dist",
|
|
@@ -49,12 +51,12 @@
|
|
|
49
51
|
"topojson-client": "^3.1.0",
|
|
50
52
|
"topojson-simplify": "^3.0.3",
|
|
51
53
|
"versor": "^0.2.0",
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/log": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/node-std": "0.8.4-main.
|
|
56
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
57
|
-
"@dxos/
|
|
54
|
+
"@dxos/async": "0.8.4-main.dfabb4ec29",
|
|
55
|
+
"@dxos/log": "0.8.4-main.dfabb4ec29",
|
|
56
|
+
"@dxos/util": "0.8.4-main.dfabb4ec29",
|
|
57
|
+
"@dxos/node-std": "0.8.4-main.dfabb4ec29",
|
|
58
|
+
"@dxos/ui-theme": "0.8.4-main.dfabb4ec29",
|
|
59
|
+
"@dxos/debug": "0.8.4-main.dfabb4ec29"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"@solidjs/testing-library": "^0.8.10",
|
|
@@ -67,8 +69,8 @@
|
|
|
67
69
|
"JSONStream": "^1.3.5",
|
|
68
70
|
"geojson2h3": "^1.2.0",
|
|
69
71
|
"solid-js": "^1.9.11",
|
|
70
|
-
"vite-plugin-solid": "^2.11.
|
|
71
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
72
|
+
"vite-plugin-solid": "^2.11.12",
|
|
73
|
+
"@dxos/storybook-utils": "0.8.4-main.dfabb4ec29"
|
|
72
74
|
},
|
|
73
75
|
"peerDependencies": {
|
|
74
76
|
"solid-js": "^1.9.11"
|
|
@@ -11,7 +11,6 @@ import { type Vector, useDrag, useGlobeZoomHandler, useSpinner, useTour } from '
|
|
|
11
11
|
import { type LatLngLiteral } from '../../types';
|
|
12
12
|
import { type StyleSet, closestPoint } from '../../util';
|
|
13
13
|
import { type ControlProps } from '../Toolbar';
|
|
14
|
-
|
|
15
14
|
import { Globe, type GlobeCanvasProps, type GlobeController, type GlobeRootProps } from './Globe';
|
|
16
15
|
|
|
17
16
|
// TODO(burdon): Load from JSON at runtime?
|
|
@@ -122,7 +121,7 @@ const createTrip = (
|
|
|
122
121
|
);
|
|
123
122
|
};
|
|
124
123
|
|
|
125
|
-
type
|
|
124
|
+
type DefaultStoryProps = Pick<GlobeRootProps, 'zoom' | 'translation' | 'rotation'> &
|
|
126
125
|
Pick<GlobeCanvasProps, 'projection' | 'styles'> & {
|
|
127
126
|
drag?: boolean;
|
|
128
127
|
spin?: boolean;
|
|
@@ -140,7 +139,7 @@ const DefaultStory = ({
|
|
|
140
139
|
spin = false,
|
|
141
140
|
tour = false,
|
|
142
141
|
xAxis = false,
|
|
143
|
-
}:
|
|
142
|
+
}: DefaultStoryProps) => {
|
|
144
143
|
const [controller, setController] = createSignal<GlobeController | null>(null);
|
|
145
144
|
|
|
146
145
|
const [dots] = createResource(async () => {
|
|
@@ -18,6 +18,8 @@ import { type ControlPosition } from 'leaflet';
|
|
|
18
18
|
import { type Accessor, type JSX, type Setter, Show, createEffect, createMemo, createSignal } from 'solid-js';
|
|
19
19
|
import { type Topology } from 'topojson-specification';
|
|
20
20
|
|
|
21
|
+
import { mx } from '@dxos/ui-theme';
|
|
22
|
+
|
|
21
23
|
import { GlobeContextProvider, type GlobeContextProviderProps, useGlobeContext } from '../../hooks';
|
|
22
24
|
import {
|
|
23
25
|
type Features,
|
|
@@ -135,11 +137,11 @@ const GlobeRoot = (props: GlobeRootProps) => {
|
|
|
135
137
|
);
|
|
136
138
|
|
|
137
139
|
return (
|
|
138
|
-
<
|
|
139
|
-
<
|
|
140
|
+
<GlobeContextProvider size={size()} {...props}>
|
|
141
|
+
<div ref={containerRef} class={mx('relative dx-container')} {...props}>
|
|
140
142
|
{props.children}
|
|
141
|
-
</
|
|
142
|
-
</
|
|
143
|
+
</div>
|
|
144
|
+
</GlobeContextProvider>
|
|
143
145
|
);
|
|
144
146
|
};
|
|
145
147
|
|
|
@@ -7,7 +7,6 @@ import { type Meta, type StoryObj } from 'storybook-solidjs-vite';
|
|
|
7
7
|
|
|
8
8
|
import { useMapZoomHandler } from '../../hooks';
|
|
9
9
|
import { type GeoMarker } from '../../types';
|
|
10
|
-
|
|
11
10
|
import { Map, type MapController } from './Map';
|
|
12
11
|
|
|
13
12
|
const DefaultStory = ({ markers = [] }: { markers?: GeoMarker[] }) => {
|
|
@@ -64,8 +64,8 @@ const useMapContext = (displayName: string) => {
|
|
|
64
64
|
//
|
|
65
65
|
|
|
66
66
|
type MapRootProps = {
|
|
67
|
-
children: JSX.Element;
|
|
68
67
|
ref?: (controller: MapController) => void;
|
|
68
|
+
children: JSX.Element;
|
|
69
69
|
class?: string;
|
|
70
70
|
scrollWheelZoom?: boolean;
|
|
71
71
|
doubleClickZoom?: boolean;
|
|
@@ -85,7 +85,9 @@ const MapRoot = (props: MapRootProps) => {
|
|
|
85
85
|
const [attention, setAttention] = createSignal(false);
|
|
86
86
|
|
|
87
87
|
onMount(() => {
|
|
88
|
-
if (!mapContainer)
|
|
88
|
+
if (!mapContainer) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
89
91
|
|
|
90
92
|
const leafletMap = L.map(mapContainer, {
|
|
91
93
|
center: props.center ?? defaults.center,
|
|
@@ -119,7 +121,9 @@ const MapRoot = (props: MapRootProps) => {
|
|
|
119
121
|
// Enable/disable scroll wheel zoom based on attention
|
|
120
122
|
createEffect(() => {
|
|
121
123
|
const leafletMap = map();
|
|
122
|
-
if (!leafletMap)
|
|
124
|
+
if (!leafletMap) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
123
127
|
|
|
124
128
|
if (attention()) {
|
|
125
129
|
leafletMap.scrollWheelZoom.enable();
|
|
@@ -150,7 +154,9 @@ const MapTiles = () => {
|
|
|
150
154
|
|
|
151
155
|
createEffect(() => {
|
|
152
156
|
const leafletMap = map();
|
|
153
|
-
if (!leafletMap)
|
|
157
|
+
if (!leafletMap) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
154
160
|
|
|
155
161
|
const att = attention();
|
|
156
162
|
tileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
@@ -212,7 +218,9 @@ const MapMarkers = (props: MapMarkersProps) => {
|
|
|
212
218
|
|
|
213
219
|
createEffect(() => {
|
|
214
220
|
const leafletMap = map();
|
|
215
|
-
if (!leafletMap)
|
|
221
|
+
if (!leafletMap) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
216
224
|
|
|
217
225
|
const markerList = props.markers?.() ?? [];
|
|
218
226
|
const currentIds = new Set(markerList.map((m) => m.id));
|
|
@@ -274,7 +282,9 @@ const CustomControl = (props: { children: JSX.Element; position: ControlPosition
|
|
|
274
282
|
|
|
275
283
|
createEffect(() => {
|
|
276
284
|
const map = mapAccessor();
|
|
277
|
-
if (!map || !controlContainer)
|
|
285
|
+
if (!map || !controlContainer) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
278
288
|
|
|
279
289
|
const Control = L.Control.extend({
|
|
280
290
|
onAdd: () => {
|
package/src/hooks/useSpinner.ts
CHANGED
package/src/index.ts
CHANGED
package/src/util/render.ts
CHANGED
|
File without changes
|
/package/dist/lib/browser/{countries-110m-6FO6R2F2.mjs.map → countries-110m-MXSNZ6PF.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{countries-110m-UQ4O6NQR.mjs.map → countries-110m-HEHEK3AV.mjs.map}
RENAMED
|
File without changes
|