From d837a91dbeb16044b6f09d7fb988e5422be21a16 Mon Sep 17 00:00:00 2001 From: lby Date: Tue, 29 Oct 2024 16:23:42 +0800 Subject: [PATCH] refactor(web): update style filed default value & input type model (#1207) --- .../Editor/StyleInterface/StyleNode/Field/index.tsx | 8 ++++++++ .../Editor/StyleInterface/appearanceNodes/marker.ts | 2 +- .../Editor/StyleInterface/appearanceNodes/model.ts | 2 +- .../Map/LayerStylePanel/Editor/StyleInterface/types.ts | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/index.tsx b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/index.tsx index 8bd0763d06..b47df3a521 100644 --- a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/index.tsx +++ b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/StyleNode/Field/index.tsx @@ -57,6 +57,14 @@ const fieldComponents = { assetsTypes={IMAGE_TYPES} onChange={props.onUpdate} /> + ), + model: (props: FieldProps) => ( + ) }; diff --git a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts index 0e2dafdfb1..052c2a95cf 100644 --- a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts +++ b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/marker.ts @@ -63,7 +63,7 @@ export const markerNodes: AppearanceNode[] = [ id: "imageSize", title: "Image Size", field: "number", - defaultValue: 100 + defaultValue: 1 }, { id: "imageSizeInMeters", diff --git a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/model.ts b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/model.ts index b4f6d7e133..fc1daf8a16 100644 --- a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/model.ts +++ b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/appearanceNodes/model.ts @@ -12,7 +12,7 @@ export const modelNodes: AppearanceNode[] = [ { id: "url", title: "Url", - field: "text", + field: "model", defaultValue: "" }, { diff --git a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts index 6a532c1b9a..654c8e1b5a 100644 --- a/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts +++ b/web/src/beta/features/Editor/Map/LayerStylePanel/Editor/StyleInterface/types.ts @@ -12,7 +12,8 @@ export type AppearanceField = | "select" | "text" | "typography" - | "image"; + | "image" + | "model"; export type AppearanceNodes = Record;