@octostar/map-component 0.4.2 → 0.6.0
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 +1 -0
- package/dist/index.mjs +163 -84
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +16 -22
- package/dist/types/components/drawing-toolbar.d.ts +2 -3
- package/dist/types/components/drawing-toolbar.d.ts.map +1 -1
- package/dist/types/components/feature-date-picker.d.ts +10 -0
- package/dist/types/components/feature-date-picker.d.ts.map +1 -0
- package/dist/types/components/layers-panel.d.ts.map +1 -1
- package/dist/types/components/map-editor-canvas.d.ts.map +1 -1
- package/dist/types/components/properties-panel.d.ts.map +1 -1
- package/dist/types/hooks/use-antd-prefix.d.ts +7 -0
- package/dist/types/hooks/use-antd-prefix.d.ts.map +1 -0
- package/dist/types/hooks/use-confirm.d.ts +9 -0
- package/dist/types/hooks/use-confirm.d.ts.map +1 -0
- package/dist/types/hooks/use-toast.d.ts.map +1 -1
- package/dist/types/lib/map-editor-api.d.ts +3 -3
- package/dist/types/lib/map-editor-api.d.ts.map +1 -1
- package/dist/types/lib/map-endpoints.d.ts +0 -1
- package/dist/types/lib/map-endpoints.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/types/components/demos/point-editor-demo.d.ts +0 -2
- package/dist/types/components/demos/point-editor-demo.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -99,6 +99,7 @@ Host requirements:
|
|
|
99
99
|
- maplibre-gl 6 needs WebGL2. A browser without it shows no map.
|
|
100
100
|
- maplibre's worker is inlined in this package and starts from a `blob:` URL, so a Content-Security-Policy needs `worker-src blob:`.
|
|
101
101
|
- Don't override or dedupe `maplibre-gl` in the host: the inlined worker must match the exact version this package pins, and a mismatch logs an error and breaks rendering. Take maplibre fixes by upgrading this package.
|
|
102
|
+
- `antd` 6.1 or later is a peer dependency: the host installs it, and the component renders through the host's `ConfigProvider` (class prefix, theme, CSS variables) and `App` (confirm dialogs, toasts). It never bundles an antd of its own, so a host needs no override to keep a single antd instance.
|
|
102
103
|
|
|
103
104
|
## Main Components
|
|
104
105
|
|
package/dist/index.mjs
CHANGED
|
@@ -7,15 +7,14 @@ import * as turf from "@turf/turf";
|
|
|
7
7
|
import { distance as distance$1, point } from "@turf/turf";
|
|
8
8
|
import * as THREE from "three";
|
|
9
9
|
import proj4 from "proj4";
|
|
10
|
-
import { Button, Modal, Input, App, message, Tooltip, Dropdown, Divider, Popover, Switch, Slider, Tag, Select, Segmented, Collapse, ColorPicker, Tabs, Card, Table
|
|
10
|
+
import { Button, Modal, Input, App, message, ConfigProvider, Tooltip, Dropdown, Divider, Popover, Switch, Slider, Tag, Select, Segmented, DatePicker, Collapse, ColorPicker, Tabs, Card, Table } from "antd";
|
|
11
11
|
import { clsx } from "clsx";
|
|
12
12
|
import { twMerge } from "tailwind-merge";
|
|
13
13
|
import { MousePointer2, Square, Hexagon, Circle, MoreVertical, ChevronDown, Filter, X, Move, Ruler, Search, Scan, Pencil, Database, MapPin, Minus, Pentagon, Type, MoveRight, Undo2, Redo2, Trash2, Navigation, Loader2, Map as Map$1, Satellite, FolderOpen, Upload, Download, MoreHorizontal, Focus, Box, Layers, Plus, ChevronRight, Eye, EyeOff, Lock, Smile, Package, Copy, FolderInput, Save, Calendar, Palette, Blend, RefreshCw, ExternalLink, Info, ChevronLeft, SkipBack, Pause, Play, Clock, AlertTriangle, TestTube, Users, GripVertical, Plane, FileJson, Check, Phone, Car, AlertCircle } from "lucide-react";
|
|
14
14
|
import { createPortal } from "react-dom";
|
|
15
|
-
import
|
|
15
|
+
import dayjs from "dayjs";
|
|
16
16
|
import { createStore, useStore } from "zustand";
|
|
17
17
|
import Flatbush from "flatbush";
|
|
18
|
-
import dayjs from "dayjs";
|
|
19
18
|
import * as toGeoJSON from "@mapbox/togeojson";
|
|
20
19
|
function detectSourceCRS(geojson) {
|
|
21
20
|
var _a, _b;
|
|
@@ -2789,18 +2788,13 @@ function stripInternalPropertiesFromFeature(feature, keep) {
|
|
|
2789
2788
|
const ToastContext = createContext(null);
|
|
2790
2789
|
function useToast() {
|
|
2791
2790
|
const externalToast = useContext(ToastContext);
|
|
2791
|
+
const { message: message$1 } = App.useApp();
|
|
2792
2792
|
if (externalToast) {
|
|
2793
2793
|
return { toast: externalToast };
|
|
2794
2794
|
}
|
|
2795
|
-
let message$1 = null;
|
|
2796
|
-
try {
|
|
2797
|
-
const app = App.useApp();
|
|
2798
|
-
message$1 = app.message;
|
|
2799
|
-
} catch {
|
|
2800
|
-
}
|
|
2801
2795
|
const toast = ({ title, description, variant }) => {
|
|
2802
2796
|
const content = description ? `${title ? title + ": " : ""}${description}` : title;
|
|
2803
|
-
const msg = message$1
|
|
2797
|
+
const msg = typeof message$1.success === "function" ? message$1 : message;
|
|
2804
2798
|
if (variant === "destructive") {
|
|
2805
2799
|
msg.error(content);
|
|
2806
2800
|
} else {
|
|
@@ -2809,13 +2803,25 @@ function useToast() {
|
|
|
2809
2803
|
};
|
|
2810
2804
|
return { toast };
|
|
2811
2805
|
}
|
|
2806
|
+
const POPUP_COMPONENTS = ["dropdown", "select-dropdown", "modal-root", "popover", "tooltip", "slider", "color-picker"];
|
|
2807
|
+
function useAntdPopupSelector() {
|
|
2808
|
+
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
2809
|
+
return useMemo(() => POPUP_COMPONENTS.map((c) => `.${getPrefixCls(c)}`).join(", "), [getPrefixCls]);
|
|
2810
|
+
}
|
|
2811
|
+
function useConfirm() {
|
|
2812
|
+
const { modal } = App.useApp();
|
|
2813
|
+
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
2814
|
+
return useMemo(() => {
|
|
2815
|
+
const confirm = typeof modal.confirm === "function" ? modal.confirm : Modal.confirm;
|
|
2816
|
+
return (props) => confirm({ prefixCls: getPrefixCls("modal"), ...props });
|
|
2817
|
+
}, [modal, getPrefixCls]);
|
|
2818
|
+
}
|
|
2812
2819
|
const DEFAULT_ENDPOINTS = {
|
|
2813
2820
|
streetsStyle: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",
|
|
2814
2821
|
darkStyle: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",
|
|
2815
2822
|
satelliteTiles: ["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],
|
|
2816
2823
|
satelliteAttribution: "Esri, Maxar, Earthstar Geographics",
|
|
2817
2824
|
terrainTiles: ["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],
|
|
2818
|
-
geocodingUrl: "https://nominatim.openstreetmap.org/search",
|
|
2819
2825
|
glyphsUrl: "/fonts/{fontstack}/{range}.pbf"
|
|
2820
2826
|
};
|
|
2821
2827
|
const BUILT_IN_NAMES = {
|
|
@@ -2833,8 +2839,7 @@ function resolveVectorStyle(endpoint, defaultStyle) {
|
|
|
2833
2839
|
return style ? { style, name: endpoint.name } : null;
|
|
2834
2840
|
}
|
|
2835
2841
|
function resolveGeocoder(endpoint) {
|
|
2836
|
-
if (isOff(endpoint)) return null;
|
|
2837
|
-
if (endpoint === void 0) return { url: DEFAULT_ENDPOINTS.geocodingUrl };
|
|
2842
|
+
if (endpoint === void 0 || isOff(endpoint)) return null;
|
|
2838
2843
|
if ("provider" in endpoint) return typeof endpoint.provider === "function" ? { provider: endpoint.provider } : null;
|
|
2839
2844
|
const url = nonEmpty(endpoint.url);
|
|
2840
2845
|
return url ? { url } : null;
|
|
@@ -3020,7 +3025,6 @@ function DrawingToolbar({
|
|
|
3020
3025
|
selectionOnly = false,
|
|
3021
3026
|
onGoTo,
|
|
3022
3027
|
onDropPoint,
|
|
3023
|
-
showGoToButton = false,
|
|
3024
3028
|
onFitToFeatures,
|
|
3025
3029
|
isSelectionToolActive = true,
|
|
3026
3030
|
onSelectionToolActiveChange,
|
|
@@ -3038,6 +3042,8 @@ function DrawingToolbar({
|
|
|
3038
3042
|
showUndoRedo = false
|
|
3039
3043
|
}) {
|
|
3040
3044
|
const { toast } = useToast();
|
|
3045
|
+
const confirm = useConfirm();
|
|
3046
|
+
const antdPopupSelector = useAntdPopupSelector();
|
|
3041
3047
|
const [goToLat, setGoToLat] = useState("");
|
|
3042
3048
|
const [goToLng, setGoToLng] = useState("");
|
|
3043
3049
|
const [goToAddress, setGoToAddress] = useState("");
|
|
@@ -3065,14 +3071,14 @@ function DrawingToolbar({
|
|
|
3065
3071
|
if (!featureSearchOpen) return;
|
|
3066
3072
|
const handlePointerDown = (e) => {
|
|
3067
3073
|
const target = e.target;
|
|
3068
|
-
if (target.closest('[data-testid="toolbar-drawing"]') || target.closest('[data-testid="search-panel"]') || target.closest(
|
|
3074
|
+
if (target.closest('[data-testid="toolbar-drawing"]') || target.closest('[data-testid="search-panel"]') || target.closest(antdPopupSelector)) {
|
|
3069
3075
|
return;
|
|
3070
3076
|
}
|
|
3071
3077
|
setFeatureSearchOpen(false);
|
|
3072
3078
|
};
|
|
3073
3079
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
3074
3080
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
3075
|
-
}, [featureSearchOpen]);
|
|
3081
|
+
}, [featureSearchOpen, antdPopupSelector]);
|
|
3076
3082
|
const getFeatureLabel = (f) => {
|
|
3077
3083
|
var _a;
|
|
3078
3084
|
const p = f.properties || {};
|
|
@@ -3207,7 +3213,7 @@ function DrawingToolbar({
|
|
|
3207
3213
|
}
|
|
3208
3214
|
};
|
|
3209
3215
|
const handleClearAll = () => {
|
|
3210
|
-
|
|
3216
|
+
confirm({
|
|
3211
3217
|
title: "Clear all features?",
|
|
3212
3218
|
content: `This will remove all ${featureCount} feature${featureCount !== 1 ? "s" : ""} from the map. This action cannot be undone.`,
|
|
3213
3219
|
okText: "Clear all",
|
|
@@ -4125,7 +4131,7 @@ function ColorPickerPopover({ value, onChange, testId }) {
|
|
|
4125
4131
|
content: popoverContent,
|
|
4126
4132
|
trigger: "click",
|
|
4127
4133
|
placement: "bottomLeft",
|
|
4128
|
-
|
|
4134
|
+
classNames: { root: "z-[10001]" },
|
|
4129
4135
|
children: /* @__PURE__ */ jsx(
|
|
4130
4136
|
Button,
|
|
4131
4137
|
{
|
|
@@ -4316,6 +4322,7 @@ function LayersPanel({
|
|
|
4316
4322
|
layerBadgeProvider,
|
|
4317
4323
|
featureCountProvider
|
|
4318
4324
|
}) {
|
|
4325
|
+
const confirm = useConfirm();
|
|
4319
4326
|
const [editingLayerId, setEditingLayerId] = useState(null);
|
|
4320
4327
|
const [editingName, setEditingName] = useState("");
|
|
4321
4328
|
const [expandedLayers, setExpandedLayers] = useState(/* @__PURE__ */ new Set());
|
|
@@ -4395,7 +4402,7 @@ function LayersPanel({
|
|
|
4395
4402
|
});
|
|
4396
4403
|
}, [selectedFeatureIds, onMoveFeatureToLayer]);
|
|
4397
4404
|
const handleDeleteLayer = useCallback((layer) => {
|
|
4398
|
-
|
|
4405
|
+
confirm({
|
|
4399
4406
|
title: `Delete layer "${layer.name}"?`,
|
|
4400
4407
|
content: "This will delete the layer and all its features.",
|
|
4401
4408
|
okText: "Delete",
|
|
@@ -4403,7 +4410,7 @@ function LayersPanel({
|
|
|
4403
4410
|
cancelText: "Cancel",
|
|
4404
4411
|
onOk: () => onRemoveLayer(layer.id)
|
|
4405
4412
|
});
|
|
4406
|
-
}, [onRemoveLayer]);
|
|
4413
|
+
}, [confirm, onRemoveLayer]);
|
|
4407
4414
|
const renderLayerItem = (layer) => {
|
|
4408
4415
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa;
|
|
4409
4416
|
const customCount = featureCountProvider == null ? void 0 : featureCountProvider(layer.id);
|
|
@@ -5477,6 +5484,121 @@ function LayersPanel({
|
|
|
5477
5484
|
}
|
|
5478
5485
|
);
|
|
5479
5486
|
}
|
|
5487
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
5488
|
+
function getDefaultExportFromCjs(x) {
|
|
5489
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
5490
|
+
}
|
|
5491
|
+
var localeData$1 = { exports: {} };
|
|
5492
|
+
(function(module, exports$1) {
|
|
5493
|
+
!(function(n, e) {
|
|
5494
|
+
module.exports = e();
|
|
5495
|
+
})(commonjsGlobal, (function() {
|
|
5496
|
+
return function(n, e, t) {
|
|
5497
|
+
var r = e.prototype, o = function(n2) {
|
|
5498
|
+
return n2 && (n2.indexOf ? n2 : n2.s);
|
|
5499
|
+
}, u = function(n2, e2, t2, r2, u2) {
|
|
5500
|
+
var i2 = n2.name ? n2 : n2.$locale(), a2 = o(i2[e2]), s2 = o(i2[t2]), f = a2 || s2.map((function(n3) {
|
|
5501
|
+
return n3.slice(0, r2);
|
|
5502
|
+
}));
|
|
5503
|
+
if (!u2) return f;
|
|
5504
|
+
var d = i2.weekStart;
|
|
5505
|
+
return f.map((function(n3, e3) {
|
|
5506
|
+
return f[(e3 + (d || 0)) % 7];
|
|
5507
|
+
}));
|
|
5508
|
+
}, i = function() {
|
|
5509
|
+
return t.Ls[t.locale()];
|
|
5510
|
+
}, a = function(n2, e2) {
|
|
5511
|
+
return n2.formats[e2] || (function(n3) {
|
|
5512
|
+
return n3.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(n4, e3, t2) {
|
|
5513
|
+
return e3 || t2.slice(1);
|
|
5514
|
+
}));
|
|
5515
|
+
})(n2.formats[e2.toUpperCase()]);
|
|
5516
|
+
}, s = function() {
|
|
5517
|
+
var n2 = this;
|
|
5518
|
+
return { months: function(e2) {
|
|
5519
|
+
return e2 ? e2.format("MMMM") : u(n2, "months");
|
|
5520
|
+
}, monthsShort: function(e2) {
|
|
5521
|
+
return e2 ? e2.format("MMM") : u(n2, "monthsShort", "months", 3);
|
|
5522
|
+
}, firstDayOfWeek: function() {
|
|
5523
|
+
return n2.$locale().weekStart || 0;
|
|
5524
|
+
}, weekdays: function(e2) {
|
|
5525
|
+
return e2 ? e2.format("dddd") : u(n2, "weekdays");
|
|
5526
|
+
}, weekdaysMin: function(e2) {
|
|
5527
|
+
return e2 ? e2.format("dd") : u(n2, "weekdaysMin", "weekdays", 2);
|
|
5528
|
+
}, weekdaysShort: function(e2) {
|
|
5529
|
+
return e2 ? e2.format("ddd") : u(n2, "weekdaysShort", "weekdays", 3);
|
|
5530
|
+
}, longDateFormat: function(e2) {
|
|
5531
|
+
return a(n2.$locale(), e2);
|
|
5532
|
+
}, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
|
|
5533
|
+
};
|
|
5534
|
+
r.localeData = function() {
|
|
5535
|
+
return s.bind(this)();
|
|
5536
|
+
}, t.localeData = function() {
|
|
5537
|
+
var n2 = i();
|
|
5538
|
+
return { firstDayOfWeek: function() {
|
|
5539
|
+
return n2.weekStart || 0;
|
|
5540
|
+
}, weekdays: function() {
|
|
5541
|
+
return t.weekdays();
|
|
5542
|
+
}, weekdaysShort: function() {
|
|
5543
|
+
return t.weekdaysShort();
|
|
5544
|
+
}, weekdaysMin: function() {
|
|
5545
|
+
return t.weekdaysMin();
|
|
5546
|
+
}, months: function() {
|
|
5547
|
+
return t.months();
|
|
5548
|
+
}, monthsShort: function() {
|
|
5549
|
+
return t.monthsShort();
|
|
5550
|
+
}, longDateFormat: function(e2) {
|
|
5551
|
+
return a(n2, e2);
|
|
5552
|
+
}, meridiem: n2.meridiem, ordinal: n2.ordinal };
|
|
5553
|
+
}, t.months = function() {
|
|
5554
|
+
return u(i(), "months");
|
|
5555
|
+
}, t.monthsShort = function() {
|
|
5556
|
+
return u(i(), "monthsShort", "months", 3);
|
|
5557
|
+
}, t.weekdays = function(n2) {
|
|
5558
|
+
return u(i(), "weekdays", null, null, n2);
|
|
5559
|
+
}, t.weekdaysShort = function(n2) {
|
|
5560
|
+
return u(i(), "weekdaysShort", "weekdays", 3, n2);
|
|
5561
|
+
}, t.weekdaysMin = function(n2) {
|
|
5562
|
+
return u(i(), "weekdaysMin", "weekdays", 2, n2);
|
|
5563
|
+
};
|
|
5564
|
+
};
|
|
5565
|
+
}));
|
|
5566
|
+
})(localeData$1);
|
|
5567
|
+
var localeDataExports = localeData$1.exports;
|
|
5568
|
+
const localeData = /* @__PURE__ */ getDefaultExportFromCjs(localeDataExports);
|
|
5569
|
+
var weekday$1 = { exports: {} };
|
|
5570
|
+
(function(module, exports$1) {
|
|
5571
|
+
!(function(e, t) {
|
|
5572
|
+
module.exports = t();
|
|
5573
|
+
})(commonjsGlobal, (function() {
|
|
5574
|
+
return function(e, t) {
|
|
5575
|
+
t.prototype.weekday = function(e2) {
|
|
5576
|
+
var t2 = this.$locale().weekStart || 0, i = this.$W, n = (i < t2 ? i + 7 : i) - t2;
|
|
5577
|
+
return this.$utils().u(e2) ? n : this.subtract(n, "day").add(e2, "day");
|
|
5578
|
+
};
|
|
5579
|
+
};
|
|
5580
|
+
}));
|
|
5581
|
+
})(weekday$1);
|
|
5582
|
+
var weekdayExports = weekday$1.exports;
|
|
5583
|
+
const weekday = /* @__PURE__ */ getDefaultExportFromCjs(weekdayExports);
|
|
5584
|
+
dayjs.extend(weekday);
|
|
5585
|
+
dayjs.extend(localeData);
|
|
5586
|
+
function FeatureDatePicker({ value, onChange, disabled, "data-testid": testId }) {
|
|
5587
|
+
const date = useMemo(() => value ? dayjs(value) : null, [value]);
|
|
5588
|
+
return /* @__PURE__ */ jsx(
|
|
5589
|
+
DatePicker,
|
|
5590
|
+
{
|
|
5591
|
+
showTime: true,
|
|
5592
|
+
format: "YYYY-MM-DD HH:mm",
|
|
5593
|
+
size: "small",
|
|
5594
|
+
value: date,
|
|
5595
|
+
onChange: (picked) => onChange(picked ? picked.startOf("minute").toISOString() : ""),
|
|
5596
|
+
disabled,
|
|
5597
|
+
className: "!h-6 flex-1",
|
|
5598
|
+
"data-testid": testId
|
|
5599
|
+
}
|
|
5600
|
+
);
|
|
5601
|
+
}
|
|
5480
5602
|
function deepClone(value) {
|
|
5481
5603
|
try {
|
|
5482
5604
|
return structuredClone(value);
|
|
@@ -5849,6 +5971,7 @@ function parseRecordFields(feature) {
|
|
|
5849
5971
|
return [];
|
|
5850
5972
|
}
|
|
5851
5973
|
}
|
|
5974
|
+
const FLUSH_COLLAPSE = { header: "!px-0 !py-1", body: "!px-0 !py-1" };
|
|
5852
5975
|
function RecordFieldsSection({ feature }) {
|
|
5853
5976
|
const fields = parseRecordFields(feature);
|
|
5854
5977
|
if (fields.length === 0) return null;
|
|
@@ -5858,7 +5981,7 @@ function RecordFieldsSection({ feature }) {
|
|
|
5858
5981
|
size: "small",
|
|
5859
5982
|
defaultActiveKey: [],
|
|
5860
5983
|
ghost: true,
|
|
5861
|
-
|
|
5984
|
+
classNames: FLUSH_COLLAPSE,
|
|
5862
5985
|
items: [{
|
|
5863
5986
|
key: "record-fields",
|
|
5864
5987
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -6115,8 +6238,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6115
6238
|
...feature.properties,
|
|
6116
6239
|
name: name || void 0,
|
|
6117
6240
|
description: description || void 0,
|
|
6118
|
-
startDate: startDate || void 0,
|
|
6119
|
-
endDate: endDate || void 0,
|
|
6241
|
+
startDate: ((overrides == null ? void 0 : overrides.startDate) ?? startDate) || void 0,
|
|
6242
|
+
endDate: ((overrides == null ? void 0 : overrides.endDate) ?? endDate) || void 0,
|
|
6120
6243
|
"stroke": (overrides == null ? void 0 : overrides.strokeColor) ?? strokeColor,
|
|
6121
6244
|
"stroke-width": (overrides == null ? void 0 : overrides.strokeWidth) ?? strokeWidth,
|
|
6122
6245
|
"stroke-opacity": (overrides == null ? void 0 : overrides.strokeOpacity) ?? strokeOpacity,
|
|
@@ -6463,7 +6586,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6463
6586
|
size: "small",
|
|
6464
6587
|
defaultActiveKey: startDate || endDate ? ["temporal"] : [],
|
|
6465
6588
|
ghost: true,
|
|
6466
|
-
|
|
6589
|
+
classNames: FLUSH_COLLAPSE,
|
|
6467
6590
|
items: [{
|
|
6468
6591
|
key: "temporal",
|
|
6469
6592
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -6479,75 +6602,31 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6479
6602
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6480
6603
|
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children: "Start" }),
|
|
6481
6604
|
/* @__PURE__ */ jsx(
|
|
6482
|
-
|
|
6605
|
+
FeatureDatePicker,
|
|
6483
6606
|
{
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
if (val) {
|
|
6489
|
-
const newDate = new Date(val).toISOString();
|
|
6490
|
-
setStartDate(newDate);
|
|
6491
|
-
setTimeout(() => handleSave(), 0);
|
|
6492
|
-
} else {
|
|
6493
|
-
setStartDate("");
|
|
6494
|
-
setTimeout(() => handleSave(), 0);
|
|
6495
|
-
}
|
|
6607
|
+
value: startDate,
|
|
6608
|
+
onChange: (iso) => {
|
|
6609
|
+
setStartDate(iso);
|
|
6610
|
+
handleSave({ startDate: iso });
|
|
6496
6611
|
},
|
|
6497
|
-
className: "flex-1 h-6 text-[13px] px-2 rounded-md border border-input bg-background",
|
|
6498
6612
|
disabled: !isEditMode,
|
|
6499
6613
|
"data-testid": "input-feature-start-date"
|
|
6500
6614
|
}
|
|
6501
|
-
),
|
|
6502
|
-
startDate && isEditMode && /* @__PURE__ */ jsx(
|
|
6503
|
-
Button,
|
|
6504
|
-
{
|
|
6505
|
-
type: "text",
|
|
6506
|
-
icon: /* @__PURE__ */ jsx(X, { className: "w-3 h-3" }),
|
|
6507
|
-
onClick: () => {
|
|
6508
|
-
setStartDate("");
|
|
6509
|
-
setTimeout(() => handleSave(), 0);
|
|
6510
|
-
},
|
|
6511
|
-
className: "!w-6 !h-6 !min-w-0 !p-0 shrink-0",
|
|
6512
|
-
"data-testid": "button-clear-start-date"
|
|
6513
|
-
}
|
|
6514
6615
|
)
|
|
6515
6616
|
] }),
|
|
6516
6617
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6517
6618
|
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children: "End" }),
|
|
6518
6619
|
/* @__PURE__ */ jsx(
|
|
6519
|
-
|
|
6620
|
+
FeatureDatePicker,
|
|
6520
6621
|
{
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
if (val) {
|
|
6526
|
-
const newDate = new Date(val).toISOString();
|
|
6527
|
-
setEndDate(newDate);
|
|
6528
|
-
setTimeout(() => handleSave(), 0);
|
|
6529
|
-
} else {
|
|
6530
|
-
setEndDate("");
|
|
6531
|
-
setTimeout(() => handleSave(), 0);
|
|
6532
|
-
}
|
|
6622
|
+
value: endDate,
|
|
6623
|
+
onChange: (iso) => {
|
|
6624
|
+
setEndDate(iso);
|
|
6625
|
+
handleSave({ endDate: iso });
|
|
6533
6626
|
},
|
|
6534
|
-
className: "flex-1 h-6 text-[13px] px-2 rounded-md border border-input bg-background",
|
|
6535
6627
|
disabled: !isEditMode,
|
|
6536
6628
|
"data-testid": "input-feature-end-date"
|
|
6537
6629
|
}
|
|
6538
|
-
),
|
|
6539
|
-
endDate && isEditMode && /* @__PURE__ */ jsx(
|
|
6540
|
-
Button,
|
|
6541
|
-
{
|
|
6542
|
-
type: "text",
|
|
6543
|
-
icon: /* @__PURE__ */ jsx(X, { className: "w-3 h-3" }),
|
|
6544
|
-
onClick: () => {
|
|
6545
|
-
setEndDate("");
|
|
6546
|
-
setTimeout(() => handleSave(), 0);
|
|
6547
|
-
},
|
|
6548
|
-
className: "!w-6 !h-6 !min-w-0 !p-0 shrink-0",
|
|
6549
|
-
"data-testid": "button-clear-end-date"
|
|
6550
|
-
}
|
|
6551
6630
|
)
|
|
6552
6631
|
] })
|
|
6553
6632
|
] })
|
|
@@ -7022,7 +7101,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7022
7101
|
size: "small",
|
|
7023
7102
|
defaultActiveKey: ["inline-entity-card"],
|
|
7024
7103
|
ghost: true,
|
|
7025
|
-
|
|
7104
|
+
classNames: FLUSH_COLLAPSE,
|
|
7026
7105
|
items: [{
|
|
7027
7106
|
key: "inline-entity-card",
|
|
7028
7107
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -7182,7 +7261,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7182
7261
|
onChange: handleTabChange,
|
|
7183
7262
|
onTabClick: handleTabClick,
|
|
7184
7263
|
size: "small",
|
|
7185
|
-
className: "flex-1 min-h-0 flex flex-col
|
|
7264
|
+
className: "flex-1 min-h-0 flex flex-col tabs-fill-column",
|
|
7265
|
+
classNames: { header: "!px-2 !mb-0 shrink-0" },
|
|
7186
7266
|
items: [
|
|
7187
7267
|
{
|
|
7188
7268
|
key: "cards",
|
|
@@ -9786,7 +9866,6 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
9786
9866
|
onViewportChange,
|
|
9787
9867
|
showClearFilter = false,
|
|
9788
9868
|
onClearFilter,
|
|
9789
|
-
showGoToButton = false,
|
|
9790
9869
|
onDropPoint,
|
|
9791
9870
|
onSearchEngineRequest,
|
|
9792
9871
|
onWorkspaceLoad,
|
|
@@ -13241,18 +13320,19 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13241
13320
|
const handleToggleLayers = useCallback(() => {
|
|
13242
13321
|
setShowLayers((prev) => !prev);
|
|
13243
13322
|
}, []);
|
|
13323
|
+
const antdPopupSelector = useAntdPopupSelector();
|
|
13244
13324
|
useEffect(() => {
|
|
13245
13325
|
if (!showLayers) return;
|
|
13246
13326
|
const handlePointerDown = (e) => {
|
|
13247
13327
|
const target = e.target;
|
|
13248
|
-
if (target.closest('[data-testid="panel-layers"]') || target.closest('[data-testid="button-toggle-layers"]') || target.closest(
|
|
13328
|
+
if (target.closest('[data-testid="panel-layers"]') || target.closest('[data-testid="button-toggle-layers"]') || target.closest(antdPopupSelector)) {
|
|
13249
13329
|
return;
|
|
13250
13330
|
}
|
|
13251
13331
|
setShowLayers(false);
|
|
13252
13332
|
};
|
|
13253
13333
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
13254
13334
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
13255
|
-
}, [showLayers]);
|
|
13335
|
+
}, [showLayers, antdPopupSelector]);
|
|
13256
13336
|
useEffect(() => {
|
|
13257
13337
|
if (!isMapLoaded || !enableKeyboardShortcuts || !mapContainer.current) return;
|
|
13258
13338
|
const container = mapContainer.current;
|
|
@@ -16922,7 +17002,6 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16922
17002
|
onFilterActiveChange: (active) => {
|
|
16923
17003
|
filterActiveRef.current = active;
|
|
16924
17004
|
},
|
|
16925
|
-
showGoToButton,
|
|
16926
17005
|
onFitToFeatures: handleFitToFeatures,
|
|
16927
17006
|
onDropPoint,
|
|
16928
17007
|
geocoder: endpoints == null ? void 0 : endpoints.geocoder,
|