renew commit snapshot

This commit is contained in:
taDuc
2026-05-03 19:33:33 +07:00
parent fca188f0be
commit 34a5c3d041
18 changed files with 381 additions and 371 deletions

View File

@@ -36,6 +36,7 @@ import {
POLYGON_OPACITY_BY_TYPE,
POLYGON_STROKE_BY_TYPE,
} from "@/uhm/lib/map/style";
import { newId } from "@/uhm/lib/id";
type MapProps = {
mode: EditorMode;
@@ -1662,11 +1663,7 @@ function roundZoom(value: number): number {
}
function buildClientFeatureId(): string {
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
return crypto.randomUUID();
}
// Fallback đảm bảo tránh collision khi user tạo nhiều feature trong cùng 1ms.
return `feature-${Date.now()}-${Math.random().toString(16).slice(2, 10)}`;
return newId();
}
function clampNumber(value: number, min: number, max: number): number {