@octostar/map-component 0.2.12 → 0.2.13

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 (44) hide show
  1. package/dist/index.cjs +1171 -639
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.mjs +1172 -640
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/styles.css +1 -0
  6. package/dist/types/components/cursor-coordinates-overlay.d.ts +13 -0
  7. package/dist/types/components/cursor-coordinates-overlay.d.ts.map +1 -0
  8. package/dist/types/components/debug-sidebar.d.ts.map +1 -1
  9. package/dist/types/components/map-drop-zone.d.ts +7 -1
  10. package/dist/types/components/map-drop-zone.d.ts.map +1 -1
  11. package/dist/types/components/map-editor-canvas.d.ts.map +1 -1
  12. package/dist/types/lib/draw-render-gate.d.ts +10 -0
  13. package/dist/types/lib/draw-render-gate.d.ts.map +1 -0
  14. package/dist/types/lib/geojson-crs.d.ts +10 -0
  15. package/dist/types/lib/geojson-crs.d.ts.map +1 -0
  16. package/dist/types/lib/geojson-reproject.d.ts +15 -0
  17. package/dist/types/lib/geojson-reproject.d.ts.map +1 -0
  18. package/dist/types/lib/geojson-serialize.d.ts +21 -0
  19. package/dist/types/lib/geojson-serialize.d.ts.map +1 -0
  20. package/dist/types/lib/ingest-client.d.ts +25 -0
  21. package/dist/types/lib/ingest-client.d.ts.map +1 -0
  22. package/dist/types/lib/ingest-pipeline.d.ts +74 -0
  23. package/dist/types/lib/ingest-pipeline.d.ts.map +1 -0
  24. package/dist/types/lib/ingest.worker.d.ts +2 -0
  25. package/dist/types/lib/ingest.worker.d.ts.map +1 -0
  26. package/dist/types/lib/map-editor-api.d.ts +5 -0
  27. package/dist/types/lib/map-editor-api.d.ts.map +1 -1
  28. package/dist/types/lib/perf-log.d.ts +3 -0
  29. package/dist/types/lib/perf-log.d.ts.map +1 -0
  30. package/dist/types/lib/selection-diff.d.ts +24 -1
  31. package/dist/types/lib/selection-diff.d.ts.map +1 -1
  32. package/dist/types/lib/selection-hit-test.d.ts +25 -14
  33. package/dist/types/lib/selection-hit-test.d.ts.map +1 -1
  34. package/dist/types/lib/selection-spatial-index.d.ts +63 -0
  35. package/dist/types/lib/selection-spatial-index.d.ts.map +1 -0
  36. package/dist/types/lib/temporal-ingest.d.ts +53 -0
  37. package/dist/types/lib/temporal-ingest.d.ts.map +1 -0
  38. package/dist/types/lib/temporal-normalize.d.ts +11 -0
  39. package/dist/types/lib/temporal-normalize.d.ts.map +1 -0
  40. package/dist/types/lib/timeline-diff.d.ts +43 -0
  41. package/dist/types/lib/timeline-diff.d.ts.map +1 -0
  42. package/dist/types/lib/timeline-store.d.ts +1 -9
  43. package/dist/types/lib/timeline-store.d.ts.map +1 -1
  44. package/package.json +5 -4
@@ -0,0 +1,11 @@
1
+ export declare function parseDate(value: unknown): Date | null;
2
+ /**
3
+ * Quick check for temporal property values without expensive Date parsing.
4
+ * Use this to short-circuit before calling normalizeTemporalProperties.
5
+ */
6
+ export declare function hasAnyTemporalValue(properties: Record<string, unknown>): boolean;
7
+ export declare function normalizeTemporalProperties(properties: Record<string, unknown>): {
8
+ startDate: Date | null;
9
+ endDate: Date | null;
10
+ };
11
+ //# sourceMappingURL=temporal-normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal-normalize.d.ts","sourceRoot":"","sources":["../../../client/src/lib/temporal-normalize.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAQrD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAShF;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAChF,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;CACtB,CAqBA"}
@@ -0,0 +1,43 @@
1
+ import type { GeoJSONSourceDiff } from 'maplibre-gl';
2
+ import { type SelectionPaintCache, type UpdatableGeoJSONSource } from './selection-diff';
3
+ /**
4
+ * Minimal GeoJSON source diff for timeline-visibility changes.
5
+ *
6
+ * Timeline filtering never adds or removes features from the source — the
7
+ * full sync paints hidden features with `stroke-opacity: 0`,
8
+ * `fill-opacity: 0`, `isTimelineHidden: 1` (labels derive `text-opacity`
9
+ * from `stroke-opacity`, radius/stroke-width paint cases read
10
+ * `isTimelineHidden`). So a scrub/playback tick only needs to flip those
11
+ * three properties on the features whose hidden-state toggled, via
12
+ * `updateData`. The scan below is still O(present-features) per tick (a Set
13
+ * iteration + lookups); only the diff handed to the GPU is O(toggled) — the
14
+ * win over the full rebuild is skipping restyle + setData, not the scan. If
15
+ * the scan ever profiles hot, it can be driven from
16
+ * `hiddenIds ∪ appliedHiddenIds` (the caller already receives `hiddenIds`).
17
+ */
18
+ export type TimelinePaintCache = Pick<SelectionPaintCache, 'presentIds' | 'appliedHiddenIds' | 'visibleStrokeOpacityById' | 'visibleFillOpacityById'>;
19
+ /**
20
+ * Diff between the painted hidden set and the next visible set (null means
21
+ * no filter — everything visible). Show entries restore the recorded
22
+ * as-if-visible opacities, so features hidden for other reasons (3D-only)
23
+ * round-trip back to 0. Returns the diff (null when nothing toggles) and
24
+ * the full next hidden set for the caller to store on success.
25
+ */
26
+ export declare function buildTimelineVisibilityDiff(cache: TimelinePaintCache, nextVisibleSet: ReadonlySet<string> | null): {
27
+ diff: GeoJSONSourceDiff | null;
28
+ nextHiddenIds: Set<string>;
29
+ };
30
+ /**
31
+ * Apply a timeline-visibility change to the source as an updateData diff.
32
+ * Returns false when the caller must fall back to a full sync — no cache,
33
+ * non-updatable cache (duplicate painted ids), missing source, or a
34
+ * synchronous updateData throw (the cache is then left untouched; the full
35
+ * sync rebuilds it). Async updateData failures are pre-empted by the
36
+ * `updatable` gate, exactly like the selection fast path. On success the
37
+ * cache's applied hidden set is advanced to the painted state.
38
+ */
39
+ export declare function applyTimelineFastPath(cache: SelectionPaintCache | null, nextVisibleSet: ReadonlySet<string> | null, source: UpdatableGeoJSONSource | null | undefined): {
40
+ applied: boolean;
41
+ toggled: number;
42
+ };
43
+ //# sourceMappingURL=timeline-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-diff.d.ts","sourceRoot":"","sources":["../../../client/src/lib/timeline-diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,mBAAmB,EACnB,YAAY,GAAG,kBAAkB,GAAG,0BAA0B,GAAG,wBAAwB,CAC1F,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,kBAAkB,EACzB,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GACzC;IAAE,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CA4BhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,GAAG,IAAI,EACjC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,EAC1C,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAChD;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAYvC"}
@@ -29,15 +29,7 @@ export interface TimelineState {
29
29
  advancePlayhead: () => boolean;
30
30
  reset: () => void;
31
31
  }
32
- /**
33
- * Quick check for temporal property values without expensive Date parsing.
34
- * Use this to short-circuit before calling normalizeTemporalProperties.
35
- */
36
- export declare function hasAnyTemporalValue(properties: Record<string, unknown>): boolean;
37
- export declare function normalizeTemporalProperties(properties: Record<string, unknown>): {
38
- startDate: Date | null;
39
- endDate: Date | null;
40
- };
32
+ export { hasAnyTemporalValue, normalizeTemporalProperties } from './temporal-normalize';
41
33
  export declare function isFeatureInRange(feature: TemporalFeature, rangeStart: Date | null, rangeEnd: Date | null): boolean;
42
34
  export type TimelineStoreApi = StoreApi<TimelineState>;
43
35
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-store.d.ts","sourceRoot":"","sources":["../../../client/src/lib/timeline-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,QAAQ,EAAqB,MAAM,SAAS,CAAC;AAGlF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAE5B,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAE3B,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IAEtB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IAEtB,aAAa,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE3D,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,mBAAmB,EAAE,CAA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1C,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAExF,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,IAAI,GAAG,IAAI,EACvB,QAAQ,EAAE,IAAI,GAAG,IAAI,GACpB,OAAO,CAQT;AA2LD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,kDAA+C,CAAC;AAEjF;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAMtD;AAID;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAAC;AAClD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octostar/map-component",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "description": "MapLibre-based map editor component",
@@ -56,6 +56,7 @@
56
56
  "clsx": "^2.1.1",
57
57
  "date-fns": "^3.6.0",
58
58
  "dayjs": "^1.11.19",
59
+ "flatbush": "^3.3.1",
59
60
  "lucide-react": "^0.453.0",
60
61
  "maplibre-gl": "^5.14.0",
61
62
  "proj4": "^2.20.2",
@@ -99,6 +100,8 @@
99
100
  "@tailwindcss/typography": "^0.5.15",
100
101
  "@tailwindcss/vite": "^4.1.3",
101
102
  "@tanstack/react-query": "^5.60.5",
103
+ "@testing-library/dom": "^10.4.0",
104
+ "@testing-library/react": "^16.1.0",
102
105
  "@types/connect-pg-simple": "^7.0.3",
103
106
  "@types/express": "4.17.21",
104
107
  "@types/express-session": "^1.18.0",
@@ -124,6 +127,7 @@
124
127
  "express-session": "^1.18.1",
125
128
  "framer-motion": "^11.13.1",
126
129
  "input-otp": "^1.4.2",
130
+ "jsdom": "^25.0.1",
127
131
  "memorystore": "^1.6.7",
128
132
  "nanoid": "^5.0.9",
129
133
  "next-themes": "^0.4.6",
@@ -147,9 +151,6 @@
147
151
  "vaul": "^1.1.2",
148
152
  "vite": "^5.4.20",
149
153
  "vitest": "^2.1.9",
150
- "@testing-library/dom": "^10.4.0",
151
- "@testing-library/react": "^16.1.0",
152
- "jsdom": "^25.0.1",
153
154
  "wouter": "^3.3.5",
154
155
  "ws": "^8.18.0",
155
156
  "zod": "^3.24.2",