@classic-homes/maps-react 0.7.0 → 0.7.5
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/dist/index.cjs +127 -40
- package/dist/index.css +28 -22
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +128 -41
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -99,7 +99,7 @@ var MapError = React6__namespace.forwardRef(
|
|
|
99
99
|
{
|
|
100
100
|
ref,
|
|
101
101
|
className: cn(
|
|
102
|
-
"flex flex-col items-center justify-center rounded-lg border border-destructive
|
|
102
|
+
"flex flex-col items-center justify-center rounded-lg border border-destructive bg-background",
|
|
103
103
|
className
|
|
104
104
|
),
|
|
105
105
|
style: { height: heightStyle },
|
|
@@ -137,7 +137,7 @@ var MapError = React6__namespace.forwardRef(
|
|
|
137
137
|
"button",
|
|
138
138
|
{
|
|
139
139
|
onClick: onRetry,
|
|
140
|
-
className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-
|
|
140
|
+
className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
141
141
|
children: "Retry"
|
|
142
142
|
}
|
|
143
143
|
)
|
|
@@ -155,7 +155,7 @@ var MapEmpty = React6__namespace.forwardRef(
|
|
|
155
155
|
{
|
|
156
156
|
ref,
|
|
157
157
|
className: cn(
|
|
158
|
-
"flex flex-col items-center justify-center rounded-lg border border-border bg-muted
|
|
158
|
+
"flex flex-col items-center justify-center rounded-lg border border-border bg-muted",
|
|
159
159
|
className
|
|
160
160
|
),
|
|
161
161
|
style: { height: heightStyle },
|
|
@@ -1074,7 +1074,8 @@ var Marker2 = React6__namespace.forwardRef(
|
|
|
1074
1074
|
({
|
|
1075
1075
|
id,
|
|
1076
1076
|
coordinates,
|
|
1077
|
-
|
|
1077
|
+
// Heritage Teal, as in Svelte (MapLibre's own default is a light blue)
|
|
1078
|
+
color = mapsCore.markerColor,
|
|
1078
1079
|
anchor = "bottom",
|
|
1079
1080
|
offset,
|
|
1080
1081
|
rotation,
|
|
@@ -1416,7 +1417,16 @@ var Popup2 = React6__namespace.forwardRef(
|
|
|
1416
1417
|
Popup2.displayName = "Popup";
|
|
1417
1418
|
var PopupCard = React6__namespace.forwardRef(
|
|
1418
1419
|
({ className, children, ...props }, ref) => {
|
|
1419
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1420
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1421
|
+
"div",
|
|
1422
|
+
{
|
|
1423
|
+
ref,
|
|
1424
|
+
"data-popup-card": "",
|
|
1425
|
+
className: cn("bg-popover text-popover-foreground", className),
|
|
1426
|
+
...props,
|
|
1427
|
+
children
|
|
1428
|
+
}
|
|
1429
|
+
);
|
|
1420
1430
|
}
|
|
1421
1431
|
);
|
|
1422
1432
|
PopupCard.displayName = "PopupCard";
|
|
@@ -1440,8 +1450,9 @@ var PopupHeader = React6__namespace.forwardRef(
|
|
|
1440
1450
|
"div",
|
|
1441
1451
|
{
|
|
1442
1452
|
ref,
|
|
1453
|
+
"data-popup-header": "",
|
|
1443
1454
|
className: cn(
|
|
1444
|
-
"flex items-start justify-between gap-2 border-b border-
|
|
1455
|
+
"flex items-start justify-between gap-2 border-b border-border bg-muted px-4 py-3 pr-12",
|
|
1445
1456
|
className
|
|
1446
1457
|
),
|
|
1447
1458
|
...props,
|
|
@@ -1456,7 +1467,16 @@ var PopupHeader = React6__namespace.forwardRef(
|
|
|
1456
1467
|
PopupHeader.displayName = "PopupHeader";
|
|
1457
1468
|
var PopupContent = React6__namespace.forwardRef(
|
|
1458
1469
|
({ className, children, ...props }, ref) => {
|
|
1459
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1470
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1471
|
+
"div",
|
|
1472
|
+
{
|
|
1473
|
+
ref,
|
|
1474
|
+
"data-popup-content": "",
|
|
1475
|
+
className: cn("px-4 py-3 text-sm", className),
|
|
1476
|
+
...props,
|
|
1477
|
+
children
|
|
1478
|
+
}
|
|
1479
|
+
);
|
|
1460
1480
|
}
|
|
1461
1481
|
);
|
|
1462
1482
|
PopupContent.displayName = "PopupContent";
|
|
@@ -1466,8 +1486,9 @@ var PopupFooter = React6__namespace.forwardRef(
|
|
|
1466
1486
|
"div",
|
|
1467
1487
|
{
|
|
1468
1488
|
ref,
|
|
1489
|
+
"data-popup-footer": "",
|
|
1469
1490
|
className: cn(
|
|
1470
|
-
"flex justify-end gap-2 border-t border-
|
|
1491
|
+
"flex justify-end gap-2 border-t border-border bg-muted px-4 py-3",
|
|
1471
1492
|
className
|
|
1472
1493
|
),
|
|
1473
1494
|
...props,
|
|
@@ -2396,7 +2417,7 @@ var Legend = ({
|
|
|
2396
2417
|
{
|
|
2397
2418
|
ref: legendRef,
|
|
2398
2419
|
className: cn(
|
|
2399
|
-
"absolute bg-card rounded-lg shadow-lg border border-
|
|
2420
|
+
"absolute bg-card rounded-lg shadow-lg border border-border",
|
|
2400
2421
|
"text-sm min-w-[140px]",
|
|
2401
2422
|
!visible && "invisible",
|
|
2402
2423
|
className
|
|
@@ -2446,8 +2467,7 @@ var Legend = ({
|
|
|
2446
2467
|
className: cn(
|
|
2447
2468
|
"flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
|
|
2448
2469
|
onItemClick && "hover:bg-muted cursor-pointer",
|
|
2449
|
-
!onItemClick && "cursor-default"
|
|
2450
|
-
item.active === false && "opacity-50"
|
|
2470
|
+
!onItemClick && "cursor-default"
|
|
2451
2471
|
),
|
|
2452
2472
|
onClick: () => handleItemClick(item, index),
|
|
2453
2473
|
disabled: !onItemClick,
|
|
@@ -2455,11 +2475,21 @@ var Legend = ({
|
|
|
2455
2475
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2456
2476
|
"span",
|
|
2457
2477
|
{
|
|
2458
|
-
className: "w-4 h-4 rounded flex-shrink-0",
|
|
2459
|
-
style: {
|
|
2478
|
+
className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
|
|
2479
|
+
style: {
|
|
2480
|
+
backgroundColor: item.active === false ? "transparent" : item.color
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
),
|
|
2484
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2485
|
+
"span",
|
|
2486
|
+
{
|
|
2487
|
+
className: cn(
|
|
2488
|
+
item.active === false ? "text-muted-foreground line-through" : "text-foreground"
|
|
2489
|
+
),
|
|
2490
|
+
children: item.label
|
|
2460
2491
|
}
|
|
2461
2492
|
),
|
|
2462
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: item.label }),
|
|
2463
2493
|
item.value !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
|
|
2464
2494
|
]
|
|
2465
2495
|
}
|
|
@@ -2525,7 +2555,7 @@ var LegendGroup = ({
|
|
|
2525
2555
|
{
|
|
2526
2556
|
ref: containerRef,
|
|
2527
2557
|
className: cn(
|
|
2528
|
-
"absolute bg-card rounded-lg shadow-lg border border-
|
|
2558
|
+
"absolute bg-card rounded-lg shadow-lg border border-border",
|
|
2529
2559
|
"text-sm min-w-[160px] max-w-[280px]",
|
|
2530
2560
|
!visible && "invisible",
|
|
2531
2561
|
className
|
|
@@ -2590,8 +2620,7 @@ var LegendGroup = ({
|
|
|
2590
2620
|
className: cn(
|
|
2591
2621
|
"flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
|
|
2592
2622
|
legend.onItemClick && "hover:bg-muted cursor-pointer",
|
|
2593
|
-
!legend.onItemClick && "cursor-default"
|
|
2594
|
-
item.active === false && "opacity-50"
|
|
2623
|
+
!legend.onItemClick && "cursor-default"
|
|
2595
2624
|
),
|
|
2596
2625
|
onClick: () => handleItemClick(legend, item, index),
|
|
2597
2626
|
disabled: !legend.onItemClick,
|
|
@@ -2599,11 +2628,22 @@ var LegendGroup = ({
|
|
|
2599
2628
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2600
2629
|
"span",
|
|
2601
2630
|
{
|
|
2602
|
-
className: "w-4 h-4 rounded flex-shrink-0",
|
|
2603
|
-
style: {
|
|
2631
|
+
className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
|
|
2632
|
+
style: {
|
|
2633
|
+
backgroundColor: item.active === false ? "transparent" : item.color
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
),
|
|
2637
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2638
|
+
"span",
|
|
2639
|
+
{
|
|
2640
|
+
className: cn(
|
|
2641
|
+
"truncate flex-1",
|
|
2642
|
+
item.active === false ? "text-muted-foreground line-through" : "text-foreground"
|
|
2643
|
+
),
|
|
2644
|
+
children: item.label
|
|
2604
2645
|
}
|
|
2605
2646
|
),
|
|
2606
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground truncate flex-1", children: item.label }),
|
|
2607
2647
|
item.value !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
|
|
2608
2648
|
]
|
|
2609
2649
|
}
|
|
@@ -2715,14 +2755,14 @@ var CoordinateDisplay = ({
|
|
|
2715
2755
|
className: cn(
|
|
2716
2756
|
"absolute bg-card rounded px-2 py-1",
|
|
2717
2757
|
"text-xs font-mono text-muted-foreground",
|
|
2718
|
-
"border border-
|
|
2758
|
+
"border border-border shadow-sm",
|
|
2719
2759
|
"flex items-center gap-3",
|
|
2720
2760
|
!visible && "invisible",
|
|
2721
2761
|
className
|
|
2722
2762
|
),
|
|
2723
2763
|
style: adjustedStyle,
|
|
2724
2764
|
children: [
|
|
2725
|
-
cursorLngLat ? /* @__PURE__ */ jsxRuntime.jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground
|
|
2765
|
+
cursorLngLat ? /* @__PURE__ */ jsxRuntime.jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Move cursor over map" }),
|
|
2726
2766
|
showZoom && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2727
2767
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-border", children: "|" }),
|
|
2728
2768
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { title: "Zoom level", children: [
|
|
@@ -2856,7 +2896,7 @@ var BasemapSwitcher = ({
|
|
|
2856
2896
|
ref: panelRef,
|
|
2857
2897
|
className: cn(
|
|
2858
2898
|
"absolute classic-basemap-panel-enter",
|
|
2859
|
-
"bg-card rounded-lg shadow-lg border border-
|
|
2899
|
+
"bg-card rounded-lg shadow-lg border border-border",
|
|
2860
2900
|
"p-2",
|
|
2861
2901
|
isTop ? "top-full mt-1" : "bottom-full mb-1",
|
|
2862
2902
|
position.includes("right") ? "right-0" : "left-0"
|
|
@@ -2889,8 +2929,9 @@ var BasemapSwitcher = ({
|
|
|
2889
2929
|
tabIndex: index === tabStopIndex ? 0 : -1,
|
|
2890
2930
|
className: cn(
|
|
2891
2931
|
"flex flex-col items-center gap-1 p-1 rounded cursor-pointer",
|
|
2892
|
-
|
|
2893
|
-
|
|
2932
|
+
// Selected: Linen, a check and a bold label. The ring is the focus
|
|
2933
|
+
// indicator only, so arrowing onto an option never looks selected
|
|
2934
|
+
isActive ? "bg-accent" : "hover:bg-muted"
|
|
2894
2935
|
),
|
|
2895
2936
|
onFocus: () => setTabStopIndex(index),
|
|
2896
2937
|
onClick: () => handleSelect(basemap),
|
|
@@ -2909,7 +2950,34 @@ var BasemapSwitcher = ({
|
|
|
2909
2950
|
}
|
|
2910
2951
|
}
|
|
2911
2952
|
),
|
|
2912
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2953
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2954
|
+
"span",
|
|
2955
|
+
{
|
|
2956
|
+
className: cn(
|
|
2957
|
+
"text-[10px] text-foreground truncate w-full text-center leading-tight",
|
|
2958
|
+
isActive && "font-semibold"
|
|
2959
|
+
),
|
|
2960
|
+
children: [
|
|
2961
|
+
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2962
|
+
"svg",
|
|
2963
|
+
{
|
|
2964
|
+
"aria-hidden": "true",
|
|
2965
|
+
width: "10",
|
|
2966
|
+
height: "10",
|
|
2967
|
+
viewBox: "0 0 24 24",
|
|
2968
|
+
fill: "none",
|
|
2969
|
+
stroke: "currentColor",
|
|
2970
|
+
strokeWidth: "3",
|
|
2971
|
+
strokeLinecap: "round",
|
|
2972
|
+
strokeLinejoin: "round",
|
|
2973
|
+
style: { display: "inline", verticalAlign: "-1px", marginRight: 2 },
|
|
2974
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
2975
|
+
}
|
|
2976
|
+
),
|
|
2977
|
+
basemap.label ?? basemap.name
|
|
2978
|
+
]
|
|
2979
|
+
}
|
|
2980
|
+
)
|
|
2913
2981
|
]
|
|
2914
2982
|
},
|
|
2915
2983
|
basemap.id
|
|
@@ -2926,7 +2994,7 @@ var BasemapSwitcher = ({
|
|
|
2926
2994
|
type: "button",
|
|
2927
2995
|
className: cn(
|
|
2928
2996
|
"w-[40px] h-[40px] flex items-center justify-center",
|
|
2929
|
-
"bg-card rounded shadow-lg border border-
|
|
2997
|
+
"bg-card rounded shadow-lg border border-border",
|
|
2930
2998
|
"hover:bg-muted cursor-pointer",
|
|
2931
2999
|
"text-foreground"
|
|
2932
3000
|
),
|
|
@@ -3191,17 +3259,32 @@ var LayerManager = ({
|
|
|
3191
3259
|
icon: paint["icon-opacity"] ?? 1
|
|
3192
3260
|
};
|
|
3193
3261
|
switch (layer.style.renderType) {
|
|
3194
|
-
case "fill":
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3262
|
+
case "fill": {
|
|
3263
|
+
const outline = mapsCore.getOutlineStyleForTheme(layer, theme);
|
|
3264
|
+
layerComponent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3265
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3266
|
+
FillLayer,
|
|
3267
|
+
{
|
|
3268
|
+
...layerProps,
|
|
3269
|
+
fillColor: paint["fill-color"],
|
|
3270
|
+
fillOpacity: baseOpacity.fill * state.opacity,
|
|
3271
|
+
fillOutlineColor: paint["fill-outline-color"]
|
|
3272
|
+
}
|
|
3273
|
+
),
|
|
3274
|
+
outline && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3275
|
+
LineLayer,
|
|
3276
|
+
{
|
|
3277
|
+
...layerProps,
|
|
3278
|
+
id: `${layerProps.id}${mapsCore.OUTLINE_LAYER_SUFFIX}`,
|
|
3279
|
+
lineColor: outline["line-color"],
|
|
3280
|
+
lineWidth: outline["line-width"],
|
|
3281
|
+
lineOpacity: (outline["line-opacity"] ?? 1) * state.opacity,
|
|
3282
|
+
lineDasharray: outline["line-dasharray"]
|
|
3283
|
+
}
|
|
3284
|
+
)
|
|
3285
|
+
] });
|
|
3204
3286
|
break;
|
|
3287
|
+
}
|
|
3205
3288
|
case "line":
|
|
3206
3289
|
layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3207
3290
|
LineLayer,
|
|
@@ -3398,7 +3481,7 @@ var LayerManager = ({
|
|
|
3398
3481
|
{
|
|
3399
3482
|
className: cn(
|
|
3400
3483
|
"absolute classic-layer-panel-enter",
|
|
3401
|
-
"bg-card rounded-lg shadow-lg border border-
|
|
3484
|
+
"bg-card rounded-lg shadow-lg border border-border",
|
|
3402
3485
|
"w-64",
|
|
3403
3486
|
isTop ? "top-full mt-1" : "bottom-full mb-1",
|
|
3404
3487
|
position.includes("right") ? "right-0" : "left-0"
|
|
@@ -3445,6 +3528,7 @@ var LayerManager = ({
|
|
|
3445
3528
|
type: "button",
|
|
3446
3529
|
className: "classic-layer-tab",
|
|
3447
3530
|
"data-active": activeCategory === "all",
|
|
3531
|
+
"aria-pressed": activeCategory === "all",
|
|
3448
3532
|
onClick: () => setActiveCategory("all"),
|
|
3449
3533
|
children: "All"
|
|
3450
3534
|
}
|
|
@@ -3455,6 +3539,7 @@ var LayerManager = ({
|
|
|
3455
3539
|
type: "button",
|
|
3456
3540
|
className: "classic-layer-tab",
|
|
3457
3541
|
"data-active": activeCategory === cat,
|
|
3542
|
+
"aria-pressed": activeCategory === cat,
|
|
3458
3543
|
onClick: () => setActiveCategory(cat),
|
|
3459
3544
|
children: mapsCore.CATEGORY_META[cat].label
|
|
3460
3545
|
},
|
|
@@ -3493,7 +3578,7 @@ var LayerManager = ({
|
|
|
3493
3578
|
type: "button",
|
|
3494
3579
|
className: cn(
|
|
3495
3580
|
"w-[40px] h-[40px] flex items-center justify-center",
|
|
3496
|
-
"bg-card rounded shadow-lg border border-
|
|
3581
|
+
"bg-card rounded shadow-lg border border-border",
|
|
3497
3582
|
"hover:bg-muted cursor-pointer",
|
|
3498
3583
|
"text-foreground"
|
|
3499
3584
|
),
|
|
@@ -3587,7 +3672,9 @@ var DeckOverlay = ({
|
|
|
3587
3672
|
const MapboxOverlay = deckMapbox.MapboxOverlay;
|
|
3588
3673
|
MapboxOverlayRef.current = MapboxOverlay;
|
|
3589
3674
|
const overlay = new MapboxOverlay({
|
|
3590
|
-
|
|
3675
|
+
// deck.gl reads map.transform, which MapLibre 6 no longer has: every
|
|
3676
|
+
// interleaved frame would throw, so fall back to overlaid rendering
|
|
3677
|
+
interleaved: mapsCore.resolveDeckInterleaved(map, interleaved),
|
|
3591
3678
|
layers: layersRef.current,
|
|
3592
3679
|
onHover,
|
|
3593
3680
|
onClick,
|
package/dist/index.css
CHANGED
|
@@ -702,7 +702,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
702
702
|
/* ../maps-core/src/styles/controls.css */
|
|
703
703
|
.maplibregl-ctrl-group {
|
|
704
704
|
background: hsl(var(--card)) !important;
|
|
705
|
-
border: 1px solid
|
|
705
|
+
border: 1px solid hsl(var(--border)) !important;
|
|
706
706
|
border-radius: 0.375rem !important;
|
|
707
707
|
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
|
|
708
708
|
overflow: hidden !important;
|
|
@@ -725,14 +725,14 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
725
725
|
}
|
|
726
726
|
.maplibregl-ctrl-group button:focus {
|
|
727
727
|
outline: none !important;
|
|
728
|
-
box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
|
|
728
|
+
box-shadow: inset 0 0 0 2px hsl(var(--ring)) !important;
|
|
729
729
|
}
|
|
730
730
|
.maplibregl-ctrl-group button:focus-visible {
|
|
731
731
|
outline: none !important;
|
|
732
|
-
box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
|
|
732
|
+
box-shadow: inset 0 0 0 2px hsl(var(--ring)) !important;
|
|
733
733
|
}
|
|
734
734
|
.maplibregl-ctrl-group button + button {
|
|
735
|
-
border-top: 1px solid
|
|
735
|
+
border-top: 1px solid hsl(var(--border)) !important;
|
|
736
736
|
}
|
|
737
737
|
.dark .maplibregl-ctrl-group button + button {
|
|
738
738
|
border-top-color: rgb(156 163 175) !important;
|
|
@@ -750,7 +750,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
750
750
|
}
|
|
751
751
|
.maplibregl-ctrl-scale {
|
|
752
752
|
background: hsl(var(--card)) !important;
|
|
753
|
-
border: 1px solid
|
|
753
|
+
border: 1px solid hsl(var(--border)) !important;
|
|
754
754
|
border-radius: 0.25rem !important;
|
|
755
755
|
padding: 0 4px !important;
|
|
756
756
|
font-family:
|
|
@@ -790,7 +790,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
790
790
|
.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {
|
|
791
791
|
}
|
|
792
792
|
.maplibregl-ctrl-attrib {
|
|
793
|
-
background: hsl(var(--card)
|
|
793
|
+
background: hsl(var(--card)) !important;
|
|
794
794
|
padding: 2px 5px !important;
|
|
795
795
|
font-size: 0.625rem !important;
|
|
796
796
|
border-radius: 0.25rem !important;
|
|
@@ -804,8 +804,8 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
804
804
|
text-decoration: underline !important;
|
|
805
805
|
}
|
|
806
806
|
.maplibregl-ctrl-attrib-button {
|
|
807
|
-
background-color: hsl(var(--card)
|
|
808
|
-
border: 1px solid
|
|
807
|
+
background-color: hsl(var(--card)) !important;
|
|
808
|
+
border: 1px solid hsl(var(--border)) !important;
|
|
809
809
|
border-radius: 0.25rem !important;
|
|
810
810
|
}
|
|
811
811
|
.dark .maplibregl-ctrl-attrib-button {
|
|
@@ -813,7 +813,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
813
813
|
}
|
|
814
814
|
.maplibregl-ctrl-attrib-button:focus {
|
|
815
815
|
outline: none !important;
|
|
816
|
-
box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
|
|
816
|
+
box-shadow: inset 0 0 0 2px hsl(var(--ring)) !important;
|
|
817
817
|
}
|
|
818
818
|
.maplibregl-ctrl-logo {
|
|
819
819
|
opacity: 0.7 !important;
|
|
@@ -920,7 +920,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
920
920
|
border-radius: 0.375rem;
|
|
921
921
|
}
|
|
922
922
|
.classic-layer-item:hover {
|
|
923
|
-
background-color: hsl(var(--muted)
|
|
923
|
+
background-color: hsl(var(--muted));
|
|
924
924
|
}
|
|
925
925
|
.classic-layer-item[data-dragging=true] {
|
|
926
926
|
opacity: 0.5;
|
|
@@ -948,10 +948,13 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
948
948
|
width: 100%;
|
|
949
949
|
height: 4px;
|
|
950
950
|
border-radius: 2px;
|
|
951
|
-
background: hsl(var(--
|
|
951
|
+
background: hsl(var(--outline, 70 9% 48%));
|
|
952
952
|
outline: none;
|
|
953
953
|
cursor: pointer;
|
|
954
954
|
}
|
|
955
|
+
.classic-layer-opacity-slider:focus-visible {
|
|
956
|
+
box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
|
|
957
|
+
}
|
|
955
958
|
.classic-layer-opacity-slider::-webkit-slider-thumb {
|
|
956
959
|
-webkit-appearance: none;
|
|
957
960
|
appearance: none;
|
|
@@ -979,11 +982,10 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
979
982
|
}
|
|
980
983
|
.classic-layer-drag-handle {
|
|
981
984
|
cursor: grab;
|
|
982
|
-
|
|
983
|
-
transition: opacity 150ms ease;
|
|
985
|
+
color: hsl(var(--muted-foreground));
|
|
984
986
|
}
|
|
985
987
|
.classic-layer-drag-handle:hover {
|
|
986
|
-
|
|
988
|
+
color: hsl(var(--foreground));
|
|
987
989
|
}
|
|
988
990
|
.classic-layer-drag-handle:active {
|
|
989
991
|
cursor: grabbing;
|
|
@@ -1014,11 +1016,10 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
1014
1016
|
color: hsl(var(--foreground));
|
|
1015
1017
|
font-size: 0.875rem;
|
|
1016
1018
|
outline: none;
|
|
1017
|
-
transition: border-color 150ms ease, box-shadow 150ms ease;
|
|
1018
1019
|
}
|
|
1019
|
-
.classic-layer-search:focus {
|
|
1020
|
-
border-color: hsl(var(--
|
|
1021
|
-
box-shadow: 0 0 0 2px hsl(var(--
|
|
1020
|
+
.classic-layer-search:focus-visible {
|
|
1021
|
+
border-color: hsl(var(--ring));
|
|
1022
|
+
box-shadow: 0 0 0 2px hsl(var(--ring));
|
|
1022
1023
|
}
|
|
1023
1024
|
.classic-layer-search::placeholder {
|
|
1024
1025
|
color: hsl(var(--muted-foreground));
|
|
@@ -1027,7 +1028,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
1027
1028
|
display: flex;
|
|
1028
1029
|
gap: 0.25rem;
|
|
1029
1030
|
padding: 0.25rem;
|
|
1030
|
-
background-color: hsl(var(--muted)
|
|
1031
|
+
background-color: hsl(var(--muted));
|
|
1031
1032
|
border-radius: 0.375rem;
|
|
1032
1033
|
}
|
|
1033
1034
|
.classic-layer-tab {
|
|
@@ -1044,9 +1045,14 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
1044
1045
|
color: hsl(var(--foreground));
|
|
1045
1046
|
}
|
|
1046
1047
|
.classic-layer-tab[data-active=true] {
|
|
1047
|
-
background-color: hsl(var(--
|
|
1048
|
-
color: hsl(var(--foreground));
|
|
1049
|
-
|
|
1048
|
+
background-color: hsl(var(--accent));
|
|
1049
|
+
color: hsl(var(--accent-foreground));
|
|
1050
|
+
font-weight: 600;
|
|
1051
|
+
box-shadow: inset 0 -3px 0 hsl(var(--primary));
|
|
1052
|
+
}
|
|
1053
|
+
.classic-layer-tab:focus-visible {
|
|
1054
|
+
outline: 2px solid hsl(var(--ring));
|
|
1055
|
+
outline-offset: 1px;
|
|
1050
1056
|
}
|
|
1051
1057
|
.classic-layer-error {
|
|
1052
1058
|
color: hsl(var(--destructive));
|
package/dist/index.d.cts
CHANGED
|
@@ -371,7 +371,7 @@ interface CustomControlProps {
|
|
|
371
371
|
* ```tsx
|
|
372
372
|
* <Map>
|
|
373
373
|
* <CustomControl position="top-right">
|
|
374
|
-
* <div className="bg-
|
|
374
|
+
* <div className="bg-card p-2 rounded shadow">
|
|
375
375
|
* Custom widget content
|
|
376
376
|
* </div>
|
|
377
377
|
* </CustomControl>
|
|
@@ -416,7 +416,11 @@ interface DeckOverlayProps {
|
|
|
416
416
|
isHovering: boolean;
|
|
417
417
|
isDragging: boolean;
|
|
418
418
|
}) => string;
|
|
419
|
-
/**
|
|
419
|
+
/**
|
|
420
|
+
* Whether to enable interleaved rendering (default: true). Ignored on
|
|
421
|
+
* MapLibre 6, which deck.gl cannot interleave into yet: the overlay is
|
|
422
|
+
* drawn on its own canvas above the map instead.
|
|
423
|
+
*/
|
|
420
424
|
interleaved?: boolean;
|
|
421
425
|
/** Deck.gl effects */
|
|
422
426
|
effects?: unknown[];
|
package/dist/index.d.ts
CHANGED
|
@@ -371,7 +371,7 @@ interface CustomControlProps {
|
|
|
371
371
|
* ```tsx
|
|
372
372
|
* <Map>
|
|
373
373
|
* <CustomControl position="top-right">
|
|
374
|
-
* <div className="bg-
|
|
374
|
+
* <div className="bg-card p-2 rounded shadow">
|
|
375
375
|
* Custom widget content
|
|
376
376
|
* </div>
|
|
377
377
|
* </CustomControl>
|
|
@@ -416,7 +416,11 @@ interface DeckOverlayProps {
|
|
|
416
416
|
isHovering: boolean;
|
|
417
417
|
isDragging: boolean;
|
|
418
418
|
}) => string;
|
|
419
|
-
/**
|
|
419
|
+
/**
|
|
420
|
+
* Whether to enable interleaved rendering (default: true). Ignored on
|
|
421
|
+
* MapLibre 6, which deck.gl cannot interleave into yet: the overlay is
|
|
422
|
+
* drawn on its own canvas above the map instead.
|
|
423
|
+
*/
|
|
420
424
|
interleaved?: boolean;
|
|
421
425
|
/** Deck.gl effects */
|
|
422
426
|
effects?: unknown[];
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as maplibregl from 'maplibre-gl';
|
|
|
7
7
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
8
8
|
import '@classic-homes/maps-core/styles/controls.css';
|
|
9
9
|
import '@classic-homes/maps-core/styles/marker.css';
|
|
10
|
-
import { createPositioningCoordinator, generateMapDescription, warnIfWorkerUrlMissing, applyMarkerProtection, applyMarkerChildProtection, removeMarkerProtection, DEFAULT_BASEMAP, darkTheme, lightTheme, THEME_DARK, THEME_LIGHT, calculateBounds, getChangedPaintProps, EDGE_MARGIN, formatCoordinates, getAvailableBasemaps, FREE_BASEMAPS, resolveBasemapThumbnail, createInitialLayerStates, getLayerCategories, searchLayers, groupLayersByCategory, toggleLayerVisibility, setLayerOpacity, getLayerStatesArray, reorderLayers, CATEGORY_META, resolveBasemapStyle, getGridNavigationIndex, STACK_GAP, getLayerStyleForTheme, resolveLayerSourceUrl } from '@classic-homes/maps-core';
|
|
10
|
+
import { createPositioningCoordinator, generateMapDescription, warnIfWorkerUrlMissing, markerColor, applyMarkerProtection, applyMarkerChildProtection, removeMarkerProtection, DEFAULT_BASEMAP, darkTheme, lightTheme, THEME_DARK, THEME_LIGHT, calculateBounds, getChangedPaintProps, EDGE_MARGIN, formatCoordinates, getAvailableBasemaps, FREE_BASEMAPS, resolveBasemapThumbnail, createInitialLayerStates, getLayerCategories, searchLayers, groupLayersByCategory, toggleLayerVisibility, setLayerOpacity, getLayerStatesArray, reorderLayers, CATEGORY_META, resolveBasemapStyle, getGridNavigationIndex, STACK_GAP, resolveDeckInterleaved, getLayerStyleForTheme, resolveLayerSourceUrl, getOutlineStyleForTheme, OUTLINE_LAYER_SUFFIX } from '@classic-homes/maps-core';
|
|
11
11
|
export { BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, CATEGORY_META, CITY_LIMITS, DEFAULT_BASEMAP, FLOOD_ZONES, FREE_BASEMAPS, OSM_STANDARD, PARKS, PRIMARY_BASEMAPS, SATELLITE_BASEMAP, SCHOOL_DISTRICTS, SPORTS_FACILITIES, THEME_DARK, THEME_LIGHT, TOPO_BASEMAP, TRAILS, TRANSIT_ROUTES, WATERSHEDS, ZONING_DISTRICTS, calculateBounds, calculateCentroid, combineBounds, countFeaturesByType, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createHoverExpression, createInitialLayerStates, createSelectionExpression, darkBasicStyle, darkTheme, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, formatArea, formatCoordinates, formatDistance, generateMapDescription, getAvailableBasemaps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getLayerCategories, getLayerStyleForTheme, getLayersByCategory, getSelectionStyle, groupLayersByCategory, isClusterFeature, isValidBounds, lightBasicStyle, lightTheme, loadGeoJSON, resolveBasemapStyle, resolveLayerSourceUrl, searchLayers, setLayerOpacity, toggleLayerVisibility, validateGeoJSON } from '@classic-homes/maps-core';
|
|
12
12
|
import * as ReactDOM from 'react-dom';
|
|
13
13
|
import { panToFitPopup, normalizePadding } from '@classic-homes/maps-core/utils';
|
|
@@ -82,7 +82,7 @@ var MapError = React6.forwardRef(
|
|
|
82
82
|
{
|
|
83
83
|
ref,
|
|
84
84
|
className: cn(
|
|
85
|
-
"flex flex-col items-center justify-center rounded-lg border border-destructive
|
|
85
|
+
"flex flex-col items-center justify-center rounded-lg border border-destructive bg-background",
|
|
86
86
|
className
|
|
87
87
|
),
|
|
88
88
|
style: { height: heightStyle },
|
|
@@ -120,7 +120,7 @@ var MapError = React6.forwardRef(
|
|
|
120
120
|
"button",
|
|
121
121
|
{
|
|
122
122
|
onClick: onRetry,
|
|
123
|
-
className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-
|
|
123
|
+
className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
124
124
|
children: "Retry"
|
|
125
125
|
}
|
|
126
126
|
)
|
|
@@ -138,7 +138,7 @@ var MapEmpty = React6.forwardRef(
|
|
|
138
138
|
{
|
|
139
139
|
ref,
|
|
140
140
|
className: cn(
|
|
141
|
-
"flex flex-col items-center justify-center rounded-lg border border-border bg-muted
|
|
141
|
+
"flex flex-col items-center justify-center rounded-lg border border-border bg-muted",
|
|
142
142
|
className
|
|
143
143
|
),
|
|
144
144
|
style: { height: heightStyle },
|
|
@@ -1057,7 +1057,8 @@ var Marker2 = React6.forwardRef(
|
|
|
1057
1057
|
({
|
|
1058
1058
|
id,
|
|
1059
1059
|
coordinates,
|
|
1060
|
-
|
|
1060
|
+
// Heritage Teal, as in Svelte (MapLibre's own default is a light blue)
|
|
1061
|
+
color = markerColor,
|
|
1061
1062
|
anchor = "bottom",
|
|
1062
1063
|
offset,
|
|
1063
1064
|
rotation,
|
|
@@ -1399,7 +1400,16 @@ var Popup2 = React6.forwardRef(
|
|
|
1399
1400
|
Popup2.displayName = "Popup";
|
|
1400
1401
|
var PopupCard = React6.forwardRef(
|
|
1401
1402
|
({ className, children, ...props }, ref) => {
|
|
1402
|
-
return /* @__PURE__ */ jsx(
|
|
1403
|
+
return /* @__PURE__ */ jsx(
|
|
1404
|
+
"div",
|
|
1405
|
+
{
|
|
1406
|
+
ref,
|
|
1407
|
+
"data-popup-card": "",
|
|
1408
|
+
className: cn("bg-popover text-popover-foreground", className),
|
|
1409
|
+
...props,
|
|
1410
|
+
children
|
|
1411
|
+
}
|
|
1412
|
+
);
|
|
1403
1413
|
}
|
|
1404
1414
|
);
|
|
1405
1415
|
PopupCard.displayName = "PopupCard";
|
|
@@ -1423,8 +1433,9 @@ var PopupHeader = React6.forwardRef(
|
|
|
1423
1433
|
"div",
|
|
1424
1434
|
{
|
|
1425
1435
|
ref,
|
|
1436
|
+
"data-popup-header": "",
|
|
1426
1437
|
className: cn(
|
|
1427
|
-
"flex items-start justify-between gap-2 border-b border-
|
|
1438
|
+
"flex items-start justify-between gap-2 border-b border-border bg-muted px-4 py-3 pr-12",
|
|
1428
1439
|
className
|
|
1429
1440
|
),
|
|
1430
1441
|
...props,
|
|
@@ -1439,7 +1450,16 @@ var PopupHeader = React6.forwardRef(
|
|
|
1439
1450
|
PopupHeader.displayName = "PopupHeader";
|
|
1440
1451
|
var PopupContent = React6.forwardRef(
|
|
1441
1452
|
({ className, children, ...props }, ref) => {
|
|
1442
|
-
return /* @__PURE__ */ jsx(
|
|
1453
|
+
return /* @__PURE__ */ jsx(
|
|
1454
|
+
"div",
|
|
1455
|
+
{
|
|
1456
|
+
ref,
|
|
1457
|
+
"data-popup-content": "",
|
|
1458
|
+
className: cn("px-4 py-3 text-sm", className),
|
|
1459
|
+
...props,
|
|
1460
|
+
children
|
|
1461
|
+
}
|
|
1462
|
+
);
|
|
1443
1463
|
}
|
|
1444
1464
|
);
|
|
1445
1465
|
PopupContent.displayName = "PopupContent";
|
|
@@ -1449,8 +1469,9 @@ var PopupFooter = React6.forwardRef(
|
|
|
1449
1469
|
"div",
|
|
1450
1470
|
{
|
|
1451
1471
|
ref,
|
|
1472
|
+
"data-popup-footer": "",
|
|
1452
1473
|
className: cn(
|
|
1453
|
-
"flex justify-end gap-2 border-t border-
|
|
1474
|
+
"flex justify-end gap-2 border-t border-border bg-muted px-4 py-3",
|
|
1454
1475
|
className
|
|
1455
1476
|
),
|
|
1456
1477
|
...props,
|
|
@@ -2379,7 +2400,7 @@ var Legend = ({
|
|
|
2379
2400
|
{
|
|
2380
2401
|
ref: legendRef,
|
|
2381
2402
|
className: cn(
|
|
2382
|
-
"absolute bg-card rounded-lg shadow-lg border border-
|
|
2403
|
+
"absolute bg-card rounded-lg shadow-lg border border-border",
|
|
2383
2404
|
"text-sm min-w-[140px]",
|
|
2384
2405
|
!visible && "invisible",
|
|
2385
2406
|
className
|
|
@@ -2429,8 +2450,7 @@ var Legend = ({
|
|
|
2429
2450
|
className: cn(
|
|
2430
2451
|
"flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
|
|
2431
2452
|
onItemClick && "hover:bg-muted cursor-pointer",
|
|
2432
|
-
!onItemClick && "cursor-default"
|
|
2433
|
-
item.active === false && "opacity-50"
|
|
2453
|
+
!onItemClick && "cursor-default"
|
|
2434
2454
|
),
|
|
2435
2455
|
onClick: () => handleItemClick(item, index),
|
|
2436
2456
|
disabled: !onItemClick,
|
|
@@ -2438,11 +2458,21 @@ var Legend = ({
|
|
|
2438
2458
|
/* @__PURE__ */ jsx(
|
|
2439
2459
|
"span",
|
|
2440
2460
|
{
|
|
2441
|
-
className: "w-4 h-4 rounded flex-shrink-0",
|
|
2442
|
-
style: {
|
|
2461
|
+
className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
|
|
2462
|
+
style: {
|
|
2463
|
+
backgroundColor: item.active === false ? "transparent" : item.color
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
),
|
|
2467
|
+
/* @__PURE__ */ jsx(
|
|
2468
|
+
"span",
|
|
2469
|
+
{
|
|
2470
|
+
className: cn(
|
|
2471
|
+
item.active === false ? "text-muted-foreground line-through" : "text-foreground"
|
|
2472
|
+
),
|
|
2473
|
+
children: item.label
|
|
2443
2474
|
}
|
|
2444
2475
|
),
|
|
2445
|
-
/* @__PURE__ */ jsx("span", { className: "text-foreground", children: item.label }),
|
|
2446
2476
|
item.value !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
|
|
2447
2477
|
]
|
|
2448
2478
|
}
|
|
@@ -2508,7 +2538,7 @@ var LegendGroup = ({
|
|
|
2508
2538
|
{
|
|
2509
2539
|
ref: containerRef,
|
|
2510
2540
|
className: cn(
|
|
2511
|
-
"absolute bg-card rounded-lg shadow-lg border border-
|
|
2541
|
+
"absolute bg-card rounded-lg shadow-lg border border-border",
|
|
2512
2542
|
"text-sm min-w-[160px] max-w-[280px]",
|
|
2513
2543
|
!visible && "invisible",
|
|
2514
2544
|
className
|
|
@@ -2573,8 +2603,7 @@ var LegendGroup = ({
|
|
|
2573
2603
|
className: cn(
|
|
2574
2604
|
"flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
|
|
2575
2605
|
legend.onItemClick && "hover:bg-muted cursor-pointer",
|
|
2576
|
-
!legend.onItemClick && "cursor-default"
|
|
2577
|
-
item.active === false && "opacity-50"
|
|
2606
|
+
!legend.onItemClick && "cursor-default"
|
|
2578
2607
|
),
|
|
2579
2608
|
onClick: () => handleItemClick(legend, item, index),
|
|
2580
2609
|
disabled: !legend.onItemClick,
|
|
@@ -2582,11 +2611,22 @@ var LegendGroup = ({
|
|
|
2582
2611
|
/* @__PURE__ */ jsx(
|
|
2583
2612
|
"span",
|
|
2584
2613
|
{
|
|
2585
|
-
className: "w-4 h-4 rounded flex-shrink-0",
|
|
2586
|
-
style: {
|
|
2614
|
+
className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
|
|
2615
|
+
style: {
|
|
2616
|
+
backgroundColor: item.active === false ? "transparent" : item.color
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
),
|
|
2620
|
+
/* @__PURE__ */ jsx(
|
|
2621
|
+
"span",
|
|
2622
|
+
{
|
|
2623
|
+
className: cn(
|
|
2624
|
+
"truncate flex-1",
|
|
2625
|
+
item.active === false ? "text-muted-foreground line-through" : "text-foreground"
|
|
2626
|
+
),
|
|
2627
|
+
children: item.label
|
|
2587
2628
|
}
|
|
2588
2629
|
),
|
|
2589
|
-
/* @__PURE__ */ jsx("span", { className: "text-foreground truncate flex-1", children: item.label }),
|
|
2590
2630
|
item.value !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
|
|
2591
2631
|
]
|
|
2592
2632
|
}
|
|
@@ -2698,14 +2738,14 @@ var CoordinateDisplay = ({
|
|
|
2698
2738
|
className: cn(
|
|
2699
2739
|
"absolute bg-card rounded px-2 py-1",
|
|
2700
2740
|
"text-xs font-mono text-muted-foreground",
|
|
2701
|
-
"border border-
|
|
2741
|
+
"border border-border shadow-sm",
|
|
2702
2742
|
"flex items-center gap-3",
|
|
2703
2743
|
!visible && "invisible",
|
|
2704
2744
|
className
|
|
2705
2745
|
),
|
|
2706
2746
|
style: adjustedStyle,
|
|
2707
2747
|
children: [
|
|
2708
|
-
cursorLngLat ? /* @__PURE__ */ jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground
|
|
2748
|
+
cursorLngLat ? /* @__PURE__ */ jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Move cursor over map" }),
|
|
2709
2749
|
showZoom && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2710
2750
|
/* @__PURE__ */ jsx("span", { className: "text-border", children: "|" }),
|
|
2711
2751
|
/* @__PURE__ */ jsxs("span", { title: "Zoom level", children: [
|
|
@@ -2839,7 +2879,7 @@ var BasemapSwitcher = ({
|
|
|
2839
2879
|
ref: panelRef,
|
|
2840
2880
|
className: cn(
|
|
2841
2881
|
"absolute classic-basemap-panel-enter",
|
|
2842
|
-
"bg-card rounded-lg shadow-lg border border-
|
|
2882
|
+
"bg-card rounded-lg shadow-lg border border-border",
|
|
2843
2883
|
"p-2",
|
|
2844
2884
|
isTop ? "top-full mt-1" : "bottom-full mb-1",
|
|
2845
2885
|
position.includes("right") ? "right-0" : "left-0"
|
|
@@ -2872,8 +2912,9 @@ var BasemapSwitcher = ({
|
|
|
2872
2912
|
tabIndex: index === tabStopIndex ? 0 : -1,
|
|
2873
2913
|
className: cn(
|
|
2874
2914
|
"flex flex-col items-center gap-1 p-1 rounded cursor-pointer",
|
|
2875
|
-
|
|
2876
|
-
|
|
2915
|
+
// Selected: Linen, a check and a bold label. The ring is the focus
|
|
2916
|
+
// indicator only, so arrowing onto an option never looks selected
|
|
2917
|
+
isActive ? "bg-accent" : "hover:bg-muted"
|
|
2877
2918
|
),
|
|
2878
2919
|
onFocus: () => setTabStopIndex(index),
|
|
2879
2920
|
onClick: () => handleSelect(basemap),
|
|
@@ -2892,7 +2933,34 @@ var BasemapSwitcher = ({
|
|
|
2892
2933
|
}
|
|
2893
2934
|
}
|
|
2894
2935
|
),
|
|
2895
|
-
/* @__PURE__ */
|
|
2936
|
+
/* @__PURE__ */ jsxs(
|
|
2937
|
+
"span",
|
|
2938
|
+
{
|
|
2939
|
+
className: cn(
|
|
2940
|
+
"text-[10px] text-foreground truncate w-full text-center leading-tight",
|
|
2941
|
+
isActive && "font-semibold"
|
|
2942
|
+
),
|
|
2943
|
+
children: [
|
|
2944
|
+
isActive && /* @__PURE__ */ jsx(
|
|
2945
|
+
"svg",
|
|
2946
|
+
{
|
|
2947
|
+
"aria-hidden": "true",
|
|
2948
|
+
width: "10",
|
|
2949
|
+
height: "10",
|
|
2950
|
+
viewBox: "0 0 24 24",
|
|
2951
|
+
fill: "none",
|
|
2952
|
+
stroke: "currentColor",
|
|
2953
|
+
strokeWidth: "3",
|
|
2954
|
+
strokeLinecap: "round",
|
|
2955
|
+
strokeLinejoin: "round",
|
|
2956
|
+
style: { display: "inline", verticalAlign: "-1px", marginRight: 2 },
|
|
2957
|
+
children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
2958
|
+
}
|
|
2959
|
+
),
|
|
2960
|
+
basemap.label ?? basemap.name
|
|
2961
|
+
]
|
|
2962
|
+
}
|
|
2963
|
+
)
|
|
2896
2964
|
]
|
|
2897
2965
|
},
|
|
2898
2966
|
basemap.id
|
|
@@ -2909,7 +2977,7 @@ var BasemapSwitcher = ({
|
|
|
2909
2977
|
type: "button",
|
|
2910
2978
|
className: cn(
|
|
2911
2979
|
"w-[40px] h-[40px] flex items-center justify-center",
|
|
2912
|
-
"bg-card rounded shadow-lg border border-
|
|
2980
|
+
"bg-card rounded shadow-lg border border-border",
|
|
2913
2981
|
"hover:bg-muted cursor-pointer",
|
|
2914
2982
|
"text-foreground"
|
|
2915
2983
|
),
|
|
@@ -3174,17 +3242,32 @@ var LayerManager = ({
|
|
|
3174
3242
|
icon: paint["icon-opacity"] ?? 1
|
|
3175
3243
|
};
|
|
3176
3244
|
switch (layer.style.renderType) {
|
|
3177
|
-
case "fill":
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3245
|
+
case "fill": {
|
|
3246
|
+
const outline = getOutlineStyleForTheme(layer, theme);
|
|
3247
|
+
layerComponent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3248
|
+
/* @__PURE__ */ jsx(
|
|
3249
|
+
FillLayer,
|
|
3250
|
+
{
|
|
3251
|
+
...layerProps,
|
|
3252
|
+
fillColor: paint["fill-color"],
|
|
3253
|
+
fillOpacity: baseOpacity.fill * state.opacity,
|
|
3254
|
+
fillOutlineColor: paint["fill-outline-color"]
|
|
3255
|
+
}
|
|
3256
|
+
),
|
|
3257
|
+
outline && /* @__PURE__ */ jsx(
|
|
3258
|
+
LineLayer,
|
|
3259
|
+
{
|
|
3260
|
+
...layerProps,
|
|
3261
|
+
id: `${layerProps.id}${OUTLINE_LAYER_SUFFIX}`,
|
|
3262
|
+
lineColor: outline["line-color"],
|
|
3263
|
+
lineWidth: outline["line-width"],
|
|
3264
|
+
lineOpacity: (outline["line-opacity"] ?? 1) * state.opacity,
|
|
3265
|
+
lineDasharray: outline["line-dasharray"]
|
|
3266
|
+
}
|
|
3267
|
+
)
|
|
3268
|
+
] });
|
|
3187
3269
|
break;
|
|
3270
|
+
}
|
|
3188
3271
|
case "line":
|
|
3189
3272
|
layerComponent = /* @__PURE__ */ jsx(
|
|
3190
3273
|
LineLayer,
|
|
@@ -3381,7 +3464,7 @@ var LayerManager = ({
|
|
|
3381
3464
|
{
|
|
3382
3465
|
className: cn(
|
|
3383
3466
|
"absolute classic-layer-panel-enter",
|
|
3384
|
-
"bg-card rounded-lg shadow-lg border border-
|
|
3467
|
+
"bg-card rounded-lg shadow-lg border border-border",
|
|
3385
3468
|
"w-64",
|
|
3386
3469
|
isTop ? "top-full mt-1" : "bottom-full mb-1",
|
|
3387
3470
|
position.includes("right") ? "right-0" : "left-0"
|
|
@@ -3428,6 +3511,7 @@ var LayerManager = ({
|
|
|
3428
3511
|
type: "button",
|
|
3429
3512
|
className: "classic-layer-tab",
|
|
3430
3513
|
"data-active": activeCategory === "all",
|
|
3514
|
+
"aria-pressed": activeCategory === "all",
|
|
3431
3515
|
onClick: () => setActiveCategory("all"),
|
|
3432
3516
|
children: "All"
|
|
3433
3517
|
}
|
|
@@ -3438,6 +3522,7 @@ var LayerManager = ({
|
|
|
3438
3522
|
type: "button",
|
|
3439
3523
|
className: "classic-layer-tab",
|
|
3440
3524
|
"data-active": activeCategory === cat,
|
|
3525
|
+
"aria-pressed": activeCategory === cat,
|
|
3441
3526
|
onClick: () => setActiveCategory(cat),
|
|
3442
3527
|
children: CATEGORY_META[cat].label
|
|
3443
3528
|
},
|
|
@@ -3476,7 +3561,7 @@ var LayerManager = ({
|
|
|
3476
3561
|
type: "button",
|
|
3477
3562
|
className: cn(
|
|
3478
3563
|
"w-[40px] h-[40px] flex items-center justify-center",
|
|
3479
|
-
"bg-card rounded shadow-lg border border-
|
|
3564
|
+
"bg-card rounded shadow-lg border border-border",
|
|
3480
3565
|
"hover:bg-muted cursor-pointer",
|
|
3481
3566
|
"text-foreground"
|
|
3482
3567
|
),
|
|
@@ -3570,7 +3655,9 @@ var DeckOverlay = ({
|
|
|
3570
3655
|
const MapboxOverlay = deckMapbox.MapboxOverlay;
|
|
3571
3656
|
MapboxOverlayRef.current = MapboxOverlay;
|
|
3572
3657
|
const overlay = new MapboxOverlay({
|
|
3573
|
-
|
|
3658
|
+
// deck.gl reads map.transform, which MapLibre 6 no longer has: every
|
|
3659
|
+
// interleaved frame would throw, so fall back to overlaid rendering
|
|
3660
|
+
interleaved: resolveDeckInterleaved(map, interleaved),
|
|
3574
3661
|
layers: layersRef.current,
|
|
3575
3662
|
onHover,
|
|
3576
3663
|
onClick,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classic-homes/maps-react",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "React MapLibre components for Classic Theme",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maps",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test": "vitest run"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@classic-homes/maps-core": "
|
|
49
|
+
"@classic-homes/maps-core": "^0.7.5",
|
|
50
50
|
"@classic-homes/theme-react": "*",
|
|
51
51
|
"class-variance-authority": "^0.7.0",
|
|
52
52
|
"clsx": "^2.1.0",
|