@octostar/map-component 0.1.20 → 0.1.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.
package/README.md CHANGED
@@ -78,6 +78,26 @@ function App() {
78
78
  | `PropertiesPanel` | Panel for editing feature properties |
79
79
  | `Timebar` | Timeline component for temporal filtering |
80
80
 
81
+ ## Tooltip & Property Utilities
82
+
83
+ The map component injects internal properties onto GeoJSON features at runtime (styling, selection state, heatmap visibility, etc.). When building custom tooltips via `tooltipProvider`, filter these out so users only see meaningful data:
84
+
85
+ ```tsx
86
+ import { isInternalProperty } from '@octostar/map-component';
87
+
88
+ const tooltipProvider = (feature) => {
89
+ const displayProps = Object.entries(feature.properties ?? {})
90
+ .filter(([key]) => !isInternalProperty(key));
91
+ // render displayProps...
92
+ };
93
+ ```
94
+
95
+ | Export | Description |
96
+ |--------|-------------|
97
+ | `isInternalProperty(key)` | Returns `true` if the key is injected by the map component at runtime |
98
+ | `INTERNAL_PROPERTY_KEYS` | `Set<string>` of exact keys (e.g. `fill`, `pointRadius`, `meta:type`) |
99
+ | `INTERNAL_PROPERTY_PREFIXES` | `string[]` of prefixes (e.g. `isHidden`, `isSelected`, `trace`) |
100
+
81
101
  ## Configuration Options
82
102
 
83
103
  ```tsx
package/dist/index.cjs CHANGED
@@ -9918,7 +9918,7 @@ const MapEditorCanvas = react.forwardRef(function MapEditorCanvas2({
9918
9918
  filterSvgPoints && /* @__PURE__ */ jsxRuntime.jsx(
9919
9919
  "svg",
9920
9920
  {
9921
- className: "absolute inset-0 w-full h-full pointer-events-none z-[99]",
9921
+ className: "absolute inset-0 w-full h-full pointer-events-none z-[10]",
9922
9922
  "data-testid": "filter-overlay",
9923
9923
  children: /* @__PURE__ */ jsxRuntime.jsx(
9924
9924
  "polygon",
@@ -11398,11 +11398,47 @@ function DebugSidebar({ onAddRandomPoints, onImportKML, canAddFeatures = true, c
11398
11398
  }
11399
11399
  );
11400
11400
  }
11401
+ const INTERNAL_PROPERTY_KEYS = /* @__PURE__ */ new Set([
11402
+ "fill",
11403
+ "fill-opacity",
11404
+ "pointRadius",
11405
+ "pointIcon",
11406
+ "pointIconSize",
11407
+ "circleCenter",
11408
+ "circleRadius",
11409
+ "icon",
11410
+ "iconSize",
11411
+ "fontSize",
11412
+ "fontColor",
11413
+ "fontWeight",
11414
+ "arrowSize",
11415
+ "label",
11416
+ "entityType",
11417
+ "kind",
11418
+ "meta:type",
11419
+ "stroke",
11420
+ "stroke-width",
11421
+ "stroke-opacity"
11422
+ ]);
11423
+ const INTERNAL_PROPERTY_PREFIXES = [
11424
+ "IsHiddenBy",
11425
+ "isHidden",
11426
+ "isSelected",
11427
+ "isTrace",
11428
+ "isTimeline",
11429
+ "trace"
11430
+ ];
11431
+ function isInternalProperty(key) {
11432
+ if (INTERNAL_PROPERTY_KEYS.has(key)) return true;
11433
+ return INTERNAL_PROPERTY_PREFIXES.some((prefix) => key.startsWith(prefix));
11434
+ }
11401
11435
  exports.ActionPanel = ActionPanel;
11402
11436
  exports.ClusterPieManager = ClusterPieManager;
11403
11437
  exports.ColorPickerPopover = ColorPickerPopover;
11404
11438
  exports.DebugSidebar = DebugSidebar;
11405
11439
  exports.DrawingToolbar = DrawingToolbar;
11440
+ exports.INTERNAL_PROPERTY_KEYS = INTERNAL_PROPERTY_KEYS;
11441
+ exports.INTERNAL_PROPERTY_PREFIXES = INTERNAL_PROPERTY_PREFIXES;
11406
11442
  exports.IconPicker = IconPicker;
11407
11443
  exports.LayersPanel = LayersPanel;
11408
11444
  exports.MAP_STYLES = MAP_STYLES;
@@ -11419,6 +11455,7 @@ exports.cn = cn;
11419
11455
  exports.createClusterPieManager = createClusterPieManager;
11420
11456
  exports.getIconComponent = getIconComponent;
11421
11457
  exports.isFeatureInRange = isFeatureInRange;
11458
+ exports.isInternalProperty = isInternalProperty;
11422
11459
  exports.isValidIconId = isValidIconId;
11423
11460
  exports.normalizeTemporalProperties = normalizeTemporalProperties;
11424
11461
  exports.parseKMLToGeoJSON = parseKMLToGeoJSON;