@octostar/map-component 0.2.20 → 0.2.22

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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The tooltip is the one consumer that used to read record fields straight off
3
+ * the rendered feature. Since TEAM-7584 a read-only feature's payload is the
4
+ * paint keep-list, so the tooltip resolves the record by id in the feature
5
+ * stores instead -- the same move click-select and the context menu already
6
+ * make.
7
+ */
8
+ /** The part of `maplibregl.MapGeoJSONFeature` this module needs, kept
9
+ * structural so there is no maplibre value import and the tests run in node. */
10
+ export interface RenderedFeatureLike {
11
+ id?: string | number;
12
+ geometry: GeoJSON.Geometry;
13
+ properties: Record<string, unknown> | null;
14
+ }
15
+ export type FeatureLookup = (id: string) => GeoJSON.Feature | null;
16
+ /** `properties.id` is the sync's canonical string id; MapLibre's own `id` may
17
+ * be absent or numeric. Null when neither is usable. */
18
+ export declare function renderedFeatureId(f: RenderedFeatureLike): string | null;
19
+ /**
20
+ * The feature the tooltip should describe: the stored record when the rendered
21
+ * id resolves, otherwise a copy of the rendered feature -- overlays and DVL
22
+ * bins have no store record and must still tooltip.
23
+ *
24
+ * The resolved record is deep-cloned, so a host provider cannot reach the
25
+ * feature stores through a nested value or the geometry. A shallow copy would
26
+ * not be enough here: records carry arbitrary host fields, and before the
27
+ * render source was slimmed the tooltip saw only throwaway tile-clipped
28
+ * geometry and sanitized primitives. The resolved case uses the *stored*
29
+ * geometry -- the rendered one is tile-clipped, and a host reading geometry
30
+ * wants the whole shape.
31
+ *
32
+ * Only ever called for the handful of features under the cursor, so the clone
33
+ * is not on a hot path.
34
+ */
35
+ export declare function resolveTooltipFeature(rendered: RenderedFeatureLike, lookup: FeatureLookup): GeoJSON.Feature;
36
+ //# sourceMappingURL=tooltip-feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip-feature.d.ts","sourceRoot":"","sources":["../../../client/src/lib/tooltip-feature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;gFACgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;AAEnE;wDACwD;AACxD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAKvE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,OAAO,CAiBjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octostar/map-component",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "description": "MapLibre-based map editor component",