From 23b2c6f534af8244331b2e76253624ffe84494c3 Mon Sep 17 00:00:00 2001 From: taDuc Date: Sun, 24 May 2026 10:51:45 +0700 Subject: [PATCH] refactor: migrate editor components and utilities to centralized uhm directory structure --- src/app/editor/[id]/page.tsx | 8 ++++---- .../components/editor}/EditorSearchResults.tsx | 0 .../editor/[id] => uhm/components/ui}/ResizeHandle.tsx | 0 .../editor/[id] => uhm/lib/editor}/editorPageUtils.ts | 0 .../lib/editor/geometry/useFeatureCommands.ts} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename src/{app/editor/[id] => uhm/components/editor}/EditorSearchResults.tsx (100%) rename src/{app/editor/[id] => uhm/components/ui}/ResizeHandle.tsx (100%) rename src/{app/editor/[id] => uhm/lib/editor}/editorPageUtils.ts (100%) rename src/{app/editor/[id]/featureCommands.ts => uhm/lib/editor/geometry/useFeatureCommands.ts} (98%) diff --git a/src/app/editor/[id]/page.tsx b/src/app/editor/[id]/page.tsx index 9e0ce6e..44b61e5 100644 --- a/src/app/editor/[id]/page.tsx +++ b/src/app/editor/[id]/page.tsx @@ -53,7 +53,7 @@ import { type MapImageOverlay, } from "@/uhm/components/map/imageOverlay"; import { FIXED_TIMELINE_RANGE, clampYearToFixedRange, normalizeTimelineYearValue } from "@/uhm/lib/utils/timeline"; -import { useFeatureCommands } from "./featureCommands"; +import { useFeatureCommands } from "@/uhm/lib/editor/geometry/useFeatureCommands"; import { deleteSubmission } from "@/uhm/api/projects"; import type { WikiSnapshot } from "@/uhm/types/wiki"; import type { BattleReplay, EntityWikiLinkSnapshot } from "@/uhm/types/projects"; @@ -62,8 +62,8 @@ import { useEditorStore, useEditorStoreApi, } from "@/uhm/store/editorStore"; -import { EditorSearchResults } from "./EditorSearchResults"; -import { ResizeHandle } from "./ResizeHandle"; +import { EditorSearchResults } from "@/uhm/components/editor/EditorSearchResults"; +import { ResizeHandle } from "@/uhm/components/ui/ResizeHandle"; import { clampNumber, formatCommitTitle, @@ -74,7 +74,7 @@ import { normalizeGeoSearchGeometry, normalizeReplaysForCompare, normalizeWikisForCompare, -} from "./editorPageUtils"; +} from "@/uhm/lib/editor/editorPageUtils"; const CURRENT_YEAR = new Date().getUTCFullYear(); const DEFAULT_EDITOR_USER_ID = "local-editor"; diff --git a/src/app/editor/[id]/EditorSearchResults.tsx b/src/uhm/components/editor/EditorSearchResults.tsx similarity index 100% rename from src/app/editor/[id]/EditorSearchResults.tsx rename to src/uhm/components/editor/EditorSearchResults.tsx diff --git a/src/app/editor/[id]/ResizeHandle.tsx b/src/uhm/components/ui/ResizeHandle.tsx similarity index 100% rename from src/app/editor/[id]/ResizeHandle.tsx rename to src/uhm/components/ui/ResizeHandle.tsx diff --git a/src/app/editor/[id]/editorPageUtils.ts b/src/uhm/lib/editor/editorPageUtils.ts similarity index 100% rename from src/app/editor/[id]/editorPageUtils.ts rename to src/uhm/lib/editor/editorPageUtils.ts diff --git a/src/app/editor/[id]/featureCommands.ts b/src/uhm/lib/editor/geometry/useFeatureCommands.ts similarity index 98% rename from src/app/editor/[id]/featureCommands.ts rename to src/uhm/lib/editor/geometry/useFeatureCommands.ts index 5155131..ae5fb88 100644 --- a/src/app/editor/[id]/featureCommands.ts +++ b/src/uhm/lib/editor/geometry/useFeatureCommands.ts @@ -2,7 +2,7 @@ import { useCallback } from "react"; import type { Dispatch, SetStateAction } from "react"; -import type { Entity } from "@/uhm/types/entities"; +import type { Entity } from "@/uhm/api/entities"; import type { Feature, FeatureProperties } from "@/uhm/types/geo"; import { ApiError } from "@/uhm/api/http"; import { buildFeatureEntityPatch } from "@/uhm/lib/editor/entity/entityBinding";