@octostar/map-component 0.9.0 → 0.9.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/README.md CHANGED
@@ -65,6 +65,7 @@ This outputs:
65
65
  ```bash
66
66
  pnpm test # Vitest: pure logic in Node, no map
67
67
  pnpm test:e2e # Playwright: builds the demo app, drives the real map in Chromium
68
+ pnpm check:host-types # packs the library and type-checks a small host app (scripts/host-types) against it
68
69
  ```
69
70
 
70
71
  The e2e suite (`e2e/`) runs in CI on every PR into `main`. It clicks, drags,
@@ -1,4 +1,4 @@
1
- import type { GeocoderEndpoint, EndpointOff } from '@/lib/map-editor-api';
1
+ import type { GeocoderEndpoint, EndpointOff } from '../lib/map-editor-api.js';
2
2
  export type DrawingMode = 'simple_select' | 'view_select' | 'draw_point' | 'draw_line_string' | 'draw_polygon' | 'draw_rectangle' | 'direct_select' | 'draw_text' | 'draw_arrow' | 'draw_circle';
3
3
  export type MeasureMode = 'none' | 'distance' | 'area';
4
4
  export type SelectionMode = 'click' | 'rectangle' | 'polygon' | 'circle';
@@ -1,4 +1,4 @@
1
- import { EMOJI_BY_ID, ICONS, type IconDef } from '@/lib/icon-catalog';
1
+ import { EMOJI_BY_ID, ICONS, type IconDef } from '../lib/icon-catalog.js';
2
2
  interface IconPickerProps {
3
3
  value: string;
4
4
  onChange: (icon: string) => void;
@@ -1,4 +1,4 @@
1
- import type { IngestProgressStore } from '@/lib/ingest-progress';
1
+ import type { IngestProgressStore } from '../lib/ingest-progress.js';
2
2
  /**
3
3
  * Import-progress readout, isolated like CursorCoordinatesOverlay: progress
4
4
  * ticks arrive per streamed chunk, and holding them as canvas state would
@@ -1,6 +1,6 @@
1
1
  import { Map } from 'lucide-react';
2
- import { type MapLabels } from '@/lib/map-labels';
3
- import type { IconSuggestionProvider } from '@/lib/icon-by-field';
2
+ import { type MapLabels } from '../lib/map-labels.js';
3
+ import type { IconSuggestionProvider } from '../lib/icon-by-field.js';
4
4
  export type BuiltInMapStyle = 'streets' | 'satellite' | 'dark';
5
5
  export type MapStyle = BuiltInMapStyle | (string & {});
6
6
  export declare const MAP_STYLES: {
@@ -1,4 +1,4 @@
1
- import type { ContextMenuItem } from '@/lib/map-editor-api';
1
+ import type { ContextMenuItem } from '../lib/map-editor-api.js';
2
2
  interface MapContextMenuProps {
3
3
  /** Viewport point the menu opens at (the event's `clientX`/`clientY`). */
4
4
  x: number;
@@ -1,5 +1,5 @@
1
1
  import 'maplibre-gl/dist/maplibre-gl.css';
2
2
  import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
3
- import type { MapEditorHandle, MapEditorProps } from '@/lib/map-editor-api';
3
+ import type { MapEditorHandle, MapEditorProps } from '../lib/map-editor-api.js';
4
4
  export declare const MapEditorCanvas: import("react").ForwardRefExoticComponent<MapEditorProps & import("react").RefAttributes<MapEditorHandle>>;
5
5
  //# sourceMappingURL=map-editor-canvas.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { Layer, LayerFieldInfo, VisualConfig } from '@/components/layers-panel';
2
- import { type IconSuggestionProvider } from '@/lib/icon-by-field';
1
+ import type { Layer, LayerFieldInfo, VisualConfig } from './layers-panel.js';
2
+ import { type IconSuggestionProvider } from '../lib/icon-by-field.js';
3
3
  interface PointIconSettingsProps {
4
4
  layer: Layer;
5
5
  onUpdateVisualConfig: (layerId: string, config: VisualConfig) => void;
@@ -1,4 +1,4 @@
1
- import type { EntityCardProvider, TypePickerProvider, FeatureSaveProvider, FeatureRefreshProvider } from '@/lib/map-editor-api';
1
+ import type { EntityCardProvider, TypePickerProvider, FeatureSaveProvider, FeatureRefreshProvider } from '../lib/map-editor-api.js';
2
2
  interface FeatureProperties {
3
3
  name?: string;
4
4
  description?: string;
@@ -1,4 +1,4 @@
1
- import type { DrawingMode, SelectionMode } from '@/components/drawing-toolbar';
1
+ import type { DrawingMode, SelectionMode } from './drawing-toolbar.js';
2
2
  interface StatusIndicatorProps {
3
3
  activeMode: DrawingMode;
4
4
  featureCount: number;
@@ -1,4 +1,4 @@
1
- import { type MapLabels } from '@/lib/map-labels';
1
+ import { type MapLabels } from '../lib/map-labels.js';
2
2
  export declare const TIMEBAR_HEIGHT = 158;
3
3
  /** The row `keepExtraWhenEmpty` shows while there is no bar to draw. */
4
4
  export declare const EMPTY_TIMEBAR_HEIGHT = 46;
@@ -1,4 +1,4 @@
1
- import type { SizeConfig } from '@/components/layers-panel';
1
+ import type { SizeConfig } from '../components/layers-panel.js';
2
2
  import type { PaintExpression } from './selection-paint';
3
3
  /**
4
4
  * Zoom-scaled icons for host-owned points. A host sets, per point:
@@ -1,4 +1,4 @@
1
- import type { Layer } from '@/components/layers-panel';
1
+ import type { Layer } from '../components/layers-panel.js';
2
2
  import type { UndoCommand } from './map-history';
3
3
  /**
4
4
  * Host-owned layers (`Layer.hostOwned`): read-only layers whose features the
@@ -1,4 +1,4 @@
1
- import type { Layer } from '@/components/layers-panel';
1
+ import type { Layer } from '../components/layers-panel.js';
2
2
  /** Color a feature paints with when neither it nor its layer sets one. */
3
3
  export declare const DEFAULT_FEATURE_COLOR = "#3b82f6";
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import type * as maplibregl from 'maplibre-gl';
2
- import type { Layer } from '@/components/layers-panel';
2
+ import type { Layer } from '../components/layers-panel.js';
3
3
  import type { FeaturesTruncatedInfo, IngestTruncation } from './feature-cap';
4
4
  import type { IngestResult } from './ingest-pipeline';
5
5
  import type { MapLabels } from './map-labels';
@@ -1,4 +1,4 @@
1
- import type { Layer } from '@/components/layers-panel';
1
+ import type { Layer } from '../components/layers-panel.js';
2
2
  import { type GradientRange } from './color-utils';
3
3
  import { HOST_OWNED_PROP } from './label-pinning';
4
4
  /** Set by the styler on host-owned features; read by the label layout. */
@@ -1,4 +1,4 @@
1
- import type { Layer } from '@/components/layers-panel';
1
+ import type { Layer } from '../components/layers-panel.js';
2
2
  /**
3
3
  * Features per shard source for large read-only layers.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Layer } from '@/components/layers-panel';
1
+ import type { Layer } from '../components/layers-panel.js';
2
2
  /**
3
3
  * Everything a shard pass reads that would change what it paints.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Layer } from '@/components/layers-panel';
1
+ import type { Layer } from '../components/layers-panel.js';
2
2
  import { type CustomLayerRole } from './custom-layer-stack';
3
3
  import { type PaintContext } from './paint-feature';
4
4
  /** The MapLibre side of a pass, so the pass itself stays testable in node. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octostar/map-component",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "description": "MapLibre-based map editor component",
@@ -143,6 +143,7 @@
143
143
  "recharts": "^2.15.2",
144
144
  "tailwindcss": "^3.4.17",
145
145
  "tailwindcss-animate": "^1.0.7",
146
+ "tsc-alias": "1.9.10",
146
147
  "tsx": "^4.20.5",
147
148
  "tw-animate-css": "^1.2.5",
148
149
  "typescript": "5.6.3",
@@ -177,7 +178,8 @@
177
178
  "scripts": {
178
179
  "dev": "NODE_ENV=development tsx server/index.ts",
179
180
  "build": "tsx script/build.ts",
180
- "build:lib": "vite build --config vite.config.lib.ts && tsc -p tsconfig.build.json",
181
+ "build:lib": "vite build --config vite.config.lib.ts && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
182
+ "check:host-types": "node scripts/check-host-types.mjs",
181
183
  "start": "NODE_ENV=production node dist-app/index.cjs",
182
184
  "check": "tsc",
183
185
  "typecheck": "tsc --noEmit",