@dxos/solid-ui-geo 0.8.4-main.bc674ce → 0.8.4-main.bd9b33e6c8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/solid-ui-geo",
3
- "version": "0.8.4-main.bc674ce",
3
+ "version": "0.8.4-main.bd9b33e6c8",
4
4
  "description": "Geo components for SolidJS.",
5
5
  "homepage": "https://github.com/dxos",
6
6
  "bugs": "https://github.com/dxos/issues",
@@ -49,12 +49,12 @@
49
49
  "topojson-client": "^3.1.0",
50
50
  "topojson-simplify": "^3.0.3",
51
51
  "versor": "^0.2.0",
52
- "@dxos/async": "0.8.4-main.bc674ce",
53
- "@dxos/debug": "0.8.4-main.bc674ce",
54
- "@dxos/log": "0.8.4-main.bc674ce",
55
- "@dxos/node-std": "0.8.4-main.bc674ce",
56
- "@dxos/ui-theme": "0.8.4-main.bc674ce",
57
- "@dxos/util": "0.8.4-main.bc674ce"
52
+ "@dxos/async": "0.8.4-main.bd9b33e6c8",
53
+ "@dxos/debug": "0.8.4-main.bd9b33e6c8",
54
+ "@dxos/log": "0.8.4-main.bd9b33e6c8",
55
+ "@dxos/node-std": "0.8.4-main.bd9b33e6c8",
56
+ "@dxos/ui-theme": "0.8.4-main.bd9b33e6c8",
57
+ "@dxos/util": "0.8.4-main.bd9b33e6c8"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@solidjs/testing-library": "^0.8.10",
@@ -66,12 +66,12 @@
66
66
  "@types/topojson-specification": "^1.0.5",
67
67
  "JSONStream": "^1.3.5",
68
68
  "geojson2h3": "^1.2.0",
69
- "solid-js": "^1.9.9",
69
+ "solid-js": "^1.9.11",
70
70
  "vite-plugin-solid": "^2.11.10",
71
- "@dxos/storybook-utils": "0.8.4-main.bc674ce"
71
+ "@dxos/storybook-utils": "0.8.4-main.bd9b33e6c8"
72
72
  },
73
73
  "peerDependencies": {
74
- "solid-js": "^1.9.9"
74
+ "solid-js": "^1.9.11"
75
75
  },
76
76
  "publishConfig": {
77
77
  "access": "public"
@@ -122,7 +122,7 @@ const createTrip = (
122
122
  );
123
123
  };
124
124
 
125
- type StoryProps = Pick<GlobeRootProps, 'zoom' | 'translation' | 'rotation'> &
125
+ type DefaultStoryProps = Pick<GlobeRootProps, 'zoom' | 'translation' | 'rotation'> &
126
126
  Pick<GlobeCanvasProps, 'projection' | 'styles'> & {
127
127
  drag?: boolean;
128
128
  spin?: boolean;
@@ -140,7 +140,7 @@ const DefaultStory = ({
140
140
  spin = false,
141
141
  tour = false,
142
142
  xAxis = false,
143
- }: StoryProps) => {
143
+ }: DefaultStoryProps) => {
144
144
  const [controller, setController] = createSignal<GlobeController | null>(null);
145
145
 
146
146
  const [dots] = createResource(async () => {
@@ -29,6 +29,7 @@ import {
29
29
  timer,
30
30
  } from '../../util';
31
31
  import { ActionControls, type ControlProps, ZoomControls, controlPositions } from '../Toolbar';
32
+ import { mx } from '@dxos/ui-theme';
32
33
 
33
34
  /**
34
35
  * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
@@ -135,11 +136,11 @@ const GlobeRoot = (props: GlobeRootProps) => {
135
136
  );
136
137
 
137
138
  return (
138
- <div ref={containerRef} class={`relative flex grow overflow-hidden ${props.class ?? ''}`} {...props}>
139
- <GlobeContextProvider size={size()} {...props}>
139
+ <GlobeContextProvider size={size()} {...props}>
140
+ <div ref={containerRef} class={mx('relative dx-container')} {...props}>
140
141
  {props.children}
141
- </GlobeContextProvider>
142
- </div>
142
+ </div>
143
+ </GlobeContextProvider>
143
144
  );
144
145
  };
145
146
 
@@ -205,9 +206,9 @@ const GlobeCanvas = (props: GlobeCanvasProps) => {
205
206
  },
206
207
  translation,
207
208
  rotation,
208
- setZoom: (s) => {
209
- if (typeof s === 'function') {
210
- const is = interpolateNumber(zoomValue, s(zoomValue));
209
+ setZoom: (state) => {
210
+ if (typeof state === 'function') {
211
+ const is = interpolateNumber(zoomValue, state(zoomValue));
211
212
  // Stop easing if already zooming.
212
213
  transition()
213
214
  .ease(zooming ? easeLinear : easeSinOut)
@@ -221,8 +222,8 @@ const GlobeCanvas = (props: GlobeCanvasProps) => {
221
222
  zooming = false;
222
223
  });
223
224
  } else {
224
- zoomValue = s;
225
- setZoom(s);
225
+ zoomValue = state;
226
+ setZoom(state);
226
227
  }
227
228
  },
228
229
  setTranslation,
@@ -278,7 +279,7 @@ const GlobeDebug = (props: { position?: ControlPosition }) => {
278
279
  const { size, zoom, translation, rotation } = useGlobeContext();
279
280
  return (
280
281
  <div
281
- class={`z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded ${
282
+ class={`z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded-sm ${
282
283
  controlPositions[props.position ?? 'topleft']
283
284
  }`}
284
285
  >
@@ -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;
@@ -277,7 +278,7 @@ const CustomControl = (props: { children: JSX.Element; position: ControlPosition
277
278
 
278
279
  const Control = L.Control.extend({
279
280
  onAdd: () => {
280
- const container = L.DomUtil.create('div', `${controlPositions[props.position]} !m-0`);
281
+ const container = L.DomUtil.create('div', `${controlPositions[props.position]} m-0!`);
281
282
  L.DomEvent.disableClickPropagation(container);
282
283
  L.DomEvent.disableScrollPropagation(container);
283
284
 
@@ -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
  >