@dxos/solid-ui-geo 0.8.4-main.ef1bc66f44 → 0.8.4-main.effb148878

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.
Files changed (59) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/browser/chunk-RMZP4JBX.mjs +9 -0
  3. package/dist/lib/browser/{countries-110m-6FO6R2F2.mjs → countries-110m-MXSNZ6PF.mjs} +1 -1
  4. package/dist/lib/browser/data.mjs +1 -1
  5. package/dist/lib/browser/index.mjs +241 -196
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/translations.mjs +19 -0
  9. package/dist/lib/browser/translations.mjs.map +7 -0
  10. package/dist/lib/node-esm/{chunk-KNEGK7HI.mjs → chunk-ICM52DKE.mjs} +2 -2
  11. package/dist/lib/node-esm/{countries-110m-UQ4O6NQR.mjs → countries-110m-HEHEK3AV.mjs} +1 -1
  12. package/dist/lib/node-esm/data.mjs +1 -1
  13. package/dist/lib/node-esm/index.mjs +241 -196
  14. package/dist/lib/node-esm/index.mjs.map +4 -4
  15. package/dist/lib/node-esm/meta.json +1 -1
  16. package/dist/lib/node-esm/translations.mjs +21 -0
  17. package/dist/lib/node-esm/translations.mjs.map +7 -0
  18. package/dist/types/data/airports.d.ts +4 -4
  19. package/dist/types/data/airports.d.ts.map +1 -1
  20. package/dist/types/data/countries-110m.d.ts.map +1 -1
  21. package/dist/types/data/countries-dots-3.d.ts.map +1 -1
  22. package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
  23. package/dist/types/src/components/Globe/Globe.solid-stories.d.ts +3 -3
  24. package/dist/types/src/components/Globe/Globe.solid-stories.d.ts.map +1 -1
  25. package/dist/types/src/components/Map/Map.d.ts +1 -1
  26. package/dist/types/src/components/Map/Map.d.ts.map +1 -1
  27. package/dist/types/src/components/Map/Map.solid-stories.d.ts.map +1 -1
  28. package/dist/types/src/components/Toolbar/Controls.d.ts.map +1 -1
  29. package/dist/types/src/hooks/context.d.ts.map +1 -1
  30. package/dist/types/src/hooks/useDrag.d.ts.map +1 -1
  31. package/dist/types/src/hooks/useGlobeZoomHandler.d.ts +1 -1
  32. package/dist/types/src/hooks/useGlobeZoomHandler.d.ts.map +1 -1
  33. package/dist/types/src/hooks/useMapZoomHandler.d.ts +1 -1
  34. package/dist/types/src/hooks/useMapZoomHandler.d.ts.map +1 -1
  35. package/dist/types/src/hooks/useSpinner.d.ts.map +1 -1
  36. package/dist/types/src/hooks/useTour.d.ts.map +1 -1
  37. package/dist/types/src/index.d.ts +0 -1
  38. package/dist/types/src/index.d.ts.map +1 -1
  39. package/dist/types/src/translations.d.ts +4 -4
  40. package/dist/types/src/translations.d.ts.map +1 -1
  41. package/dist/types/src/util/debug.d.ts.map +1 -1
  42. package/dist/types/src/util/inertia.d.ts.map +1 -1
  43. package/dist/types/src/util/path.d.ts.map +1 -1
  44. package/dist/types/src/util/render.d.ts.map +1 -1
  45. package/dist/types/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +25 -23
  47. package/src/components/Globe/Globe.solid-stories.tsx +2 -3
  48. package/src/components/Globe/Globe.tsx +7 -5
  49. package/src/components/Map/Map.solid-stories.tsx +0 -1
  50. package/src/components/Map/Map.tsx +18 -7
  51. package/src/components/Toolbar/Controls.tsx +4 -4
  52. package/src/hooks/useSpinner.ts +0 -1
  53. package/src/index.ts +0 -1
  54. package/src/util/render.ts +0 -1
  55. package/dist/lib/browser/chunk-KONL6N4F.mjs +0 -9
  56. /package/dist/lib/browser/{chunk-KONL6N4F.mjs.map → chunk-RMZP4JBX.mjs.map} +0 -0
  57. /package/dist/lib/browser/{countries-110m-6FO6R2F2.mjs.map → countries-110m-MXSNZ6PF.mjs.map} +0 -0
  58. /package/dist/lib/node-esm/{chunk-KNEGK7HI.mjs.map → chunk-ICM52DKE.mjs.map} +0 -0
  59. /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.ef1bc66f44",
3
+ "version": "0.8.4-main.effb148878",
4
4
  "description": "Geo components for SolidJS.",
5
5
  "homepage": "https://github.com/dxos",
6
6
  "bugs": "https://github.com/dxos/issues",
@@ -8,30 +8,32 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/dxos/dxos"
10
10
  },
11
- "license": "MIT",
11
+ "license": "FSL-1.1-Apache-2.0",
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
- "types": "./dist/types/src/index.d.ts",
23
- "browser": "./dist/lib/browser/index.mjs",
24
- "node": "./dist/lib/node-esm/index.mjs"
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/async": "0.8.4-main.ef1bc66f44",
53
- "@dxos/debug": "0.8.4-main.ef1bc66f44",
54
- "@dxos/log": "0.8.4-main.ef1bc66f44",
55
- "@dxos/ui-theme": "0.8.4-main.ef1bc66f44",
56
- "@dxos/util": "0.8.4-main.ef1bc66f44",
57
- "@dxos/node-std": "0.8.4-main.ef1bc66f44"
54
+ "@dxos/debug": "0.8.4-main.effb148878",
55
+ "@dxos/async": "0.8.4-main.effb148878",
56
+ "@dxos/node-std": "0.8.4-main.effb148878",
57
+ "@dxos/ui-theme": "0.8.4-main.effb148878",
58
+ "@dxos/util": "0.8.4-main.effb148878",
59
+ "@dxos/log": "0.8.4-main.effb148878"
58
60
  },
59
61
  "devDependencies": {
60
62
  "@solidjs/testing-library": "^0.8.10",
@@ -66,12 +68,12 @@
66
68
  "@types/topojson-specification": "^1.0.5",
67
69
  "JSONStream": "^1.3.5",
68
70
  "geojson2h3": "^1.2.0",
69
- "solid-js": "^1.9.9",
70
- "vite-plugin-solid": "^2.11.10",
71
- "@dxos/storybook-utils": "0.8.4-main.ef1bc66f44"
71
+ "solid-js": "^1.9.11",
72
+ "vite-plugin-solid": "^2.11.12",
73
+ "@dxos/storybook-utils": "0.8.4-main.effb148878"
72
74
  },
73
75
  "peerDependencies": {
74
- "solid-js": "^1.9.9"
76
+ "solid-js": "^1.9.11"
75
77
  },
76
78
  "publishConfig": {
77
79
  "access": "public"
@@ -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 StoryProps = Pick<GlobeRootProps, 'zoom' | 'translation' | 'rotation'> &
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
- }: StoryProps) => {
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
- <div ref={containerRef} class={`relative flex grow overflow-hidden ${props.class ?? ''}`} {...props}>
139
- <GlobeContextProvider size={size()} {...props}>
140
+ <GlobeContextProvider size={size()} {...props}>
141
+ <div ref={containerRef} class={mx('relative dx-container')} {...props}>
140
142
  {props.children}
141
- </GlobeContextProvider>
142
- </div>
143
+ </div>
144
+ </GlobeContextProvider>
143
145
  );
144
146
  };
145
147
 
@@ -278,7 +280,7 @@ const GlobeDebug = (props: { position?: ControlPosition }) => {
278
280
  const { size, zoom, translation, rotation } = useGlobeContext();
279
281
  return (
280
282
  <div
281
- class={`z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded ${
283
+ class={`z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded-sm ${
282
284
  controlPositions[props.position ?? 'topleft']
283
285
  }`}
284
286
  >
@@ -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[] }) => {
@@ -55,6 +55,7 @@ const useMapContext = (displayName: string) => {
55
55
  if (!context) {
56
56
  throw new Error(`${displayName} must be used within Map.Root`);
57
57
  }
58
+
58
59
  return context;
59
60
  };
60
61
 
@@ -63,8 +64,8 @@ const useMapContext = (displayName: string) => {
63
64
  //
64
65
 
65
66
  type MapRootProps = {
66
- children: JSX.Element;
67
67
  ref?: (controller: MapController) => void;
68
+ children: JSX.Element;
68
69
  class?: string;
69
70
  scrollWheelZoom?: boolean;
70
71
  doubleClickZoom?: boolean;
@@ -84,7 +85,9 @@ const MapRoot = (props: MapRootProps) => {
84
85
  const [attention, setAttention] = createSignal(false);
85
86
 
86
87
  onMount(() => {
87
- if (!mapContainer) return;
88
+ if (!mapContainer) {
89
+ return;
90
+ }
88
91
 
89
92
  const leafletMap = L.map(mapContainer, {
90
93
  center: props.center ?? defaults.center,
@@ -118,7 +121,9 @@ const MapRoot = (props: MapRootProps) => {
118
121
  // Enable/disable scroll wheel zoom based on attention
119
122
  createEffect(() => {
120
123
  const leafletMap = map();
121
- if (!leafletMap) return;
124
+ if (!leafletMap) {
125
+ return;
126
+ }
122
127
 
123
128
  if (attention()) {
124
129
  leafletMap.scrollWheelZoom.enable();
@@ -149,7 +154,9 @@ const MapTiles = () => {
149
154
 
150
155
  createEffect(() => {
151
156
  const leafletMap = map();
152
- if (!leafletMap) return;
157
+ if (!leafletMap) {
158
+ return;
159
+ }
153
160
 
154
161
  const att = attention();
155
162
  tileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
@@ -211,7 +218,9 @@ const MapMarkers = (props: MapMarkersProps) => {
211
218
 
212
219
  createEffect(() => {
213
220
  const leafletMap = map();
214
- if (!leafletMap) return;
221
+ if (!leafletMap) {
222
+ return;
223
+ }
215
224
 
216
225
  const markerList = props.markers?.() ?? [];
217
226
  const currentIds = new Set(markerList.map((m) => m.id));
@@ -273,11 +282,13 @@ const CustomControl = (props: { children: JSX.Element; position: ControlPosition
273
282
 
274
283
  createEffect(() => {
275
284
  const map = mapAccessor();
276
- if (!map || !controlContainer) return;
285
+ if (!map || !controlContainer) {
286
+ return;
287
+ }
277
288
 
278
289
  const Control = L.Control.extend({
279
290
  onAdd: () => {
280
- const container = L.DomUtil.create('div', `${controlPositions[props.position]} !m-0`);
291
+ const container = L.DomUtil.create('div', `${controlPositions[props.position]} m-0!`);
281
292
  L.DomEvent.disableClickPropagation(container);
282
293
  L.DomEvent.disableScrollPropagation(container);
283
294
 
@@ -24,7 +24,7 @@ export const ZoomControls = (props: ControlProps): JSX.Element => {
24
24
  <div class={`flex flex-row gap-2 ${props.class ?? ''}`}>
25
25
  <button
26
26
  type='button'
27
- class='dx-button dx-focus-ring w-10 h-10 min-bs-[2.5rem] pli-3 rounded-sm flex items-center justify-center'
27
+ class='dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center'
28
28
  onClick={() => props.onAction?.('zoom-in')}
29
29
  title='Zoom in'
30
30
  >
@@ -32,7 +32,7 @@ export const ZoomControls = (props: ControlProps): JSX.Element => {
32
32
  </button>
33
33
  <button
34
34
  type='button'
35
- class='dx-button dx-focus-ring w-10 h-10 min-bs-[2.5rem] pli-3 rounded-sm flex items-center justify-center'
35
+ class='dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center'
36
36
  onClick={() => props.onAction?.('zoom-out')}
37
37
  title='Zoom out'
38
38
  >
@@ -47,7 +47,7 @@ export const ActionControls = (props: ControlProps): JSX.Element => {
47
47
  <div class={`flex flex-row gap-2 ${props.class ?? ''}`}>
48
48
  <button
49
49
  type='button'
50
- class='dx-button dx-focus-ring w-10 h-10 min-bs-[2.5rem] pli-3 rounded-sm flex items-center justify-center'
50
+ class='dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center'
51
51
  onClick={() => props.onAction?.('start')}
52
52
  title='Start'
53
53
  >
@@ -55,7 +55,7 @@ export const ActionControls = (props: ControlProps): JSX.Element => {
55
55
  </button>
56
56
  <button
57
57
  type='button'
58
- class='dx-button dx-focus-ring w-10 h-10 min-bs-[2.5rem] pli-3 rounded-sm flex items-center justify-center'
58
+ class='dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center'
59
59
  onClick={() => props.onAction?.('toggle')}
60
60
  title='Toggle'
61
61
  >
@@ -7,7 +7,6 @@ import { type Timer } from 'd3';
7
7
  import { createEffect, createSignal, onCleanup } from 'solid-js';
8
8
 
9
9
  import { type GlobeController } from '../components';
10
-
11
10
  import { type Vector } from './context';
12
11
 
13
12
  export type SpinnerOptions = {
package/src/index.ts CHANGED
@@ -5,6 +5,5 @@
5
5
  export * from './components';
6
6
  export * from './data';
7
7
  export * from './hooks';
8
- export * from './translations';
9
8
  export type * from './types';
10
9
  export * from './util';
@@ -7,7 +7,6 @@ import { feature, mesh } from 'topojson-client';
7
7
  import { type Topology } from 'topojson-specification';
8
8
 
9
9
  import { type LatLngLiteral } from '../types';
10
-
11
10
  import { geoLine, geoPoint } from './path';
12
11
 
13
12
  export type Styles = Record<string, any>;
@@ -1,9 +0,0 @@
1
- // src/data.ts
2
- var loadTopology = async () => {
3
- return (await import("./countries-110m-6FO6R2F2.mjs")).default;
4
- };
5
-
6
- export {
7
- loadTopology
8
- };
9
- //# sourceMappingURL=chunk-KONL6N4F.mjs.map