feat(web-platform): release V0.9.3 全模块界面重构
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Copy, LockKeyhole, Trash2 } from 'lucide-react';
|
||||
import { Button, ScrubbableNumberInput, Select } from '../components/ui';
|
||||
import { Button, ScrubbableNumberInput, Select, Tooltip } from '../components/ui';
|
||||
import { MAP_OBJECT_PLACEMENT_LABELS, type EditableMapObject } from './editor/types';
|
||||
|
||||
const PARAMETER_LABELS: Record<string, string> = {
|
||||
@@ -83,8 +83,8 @@ function colorValue(object: EditableMapObject): string {
|
||||
|
||||
function Section({ title, children }: { title: string; children: React.ReactNode }) {
|
||||
return (
|
||||
<section className="engineering-card rounded-lg border p-2.5">
|
||||
<h3 className="mb-2 text-[10px] font-semibold uppercase tracking-[0.12em] text-text-tertiary">
|
||||
<section className="border-b border-border-subtle pb-3">
|
||||
<h3 className="mb-2 text-xs font-semibold uppercase tracking-[0.12em] text-text-tertiary">
|
||||
{title}
|
||||
</h3>
|
||||
{children}
|
||||
@@ -132,7 +132,7 @@ export function MapObjectInspector({
|
||||
<div className="space-y-2" aria-label="地图物体检查器">
|
||||
<Section title="对象">
|
||||
<div className="space-y-2">
|
||||
<label className="block text-[11px] text-text-secondary">
|
||||
<label className="block text-xs text-text-secondary">
|
||||
名称
|
||||
<input
|
||||
aria-label="对象名称"
|
||||
@@ -144,7 +144,7 @@ export function MapObjectInspector({
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<label className="flex items-center justify-between text-[11px] text-text-secondary">
|
||||
<label className="flex items-center justify-between text-xs text-text-secondary">
|
||||
<span>启用碰撞与渲染</span>
|
||||
<input
|
||||
aria-label="启用地图对象"
|
||||
@@ -158,11 +158,15 @@ export function MapObjectInspector({
|
||||
</Section>
|
||||
|
||||
<Section title="位姿">
|
||||
<div className="mb-2 flex items-center justify-between rounded bg-surface/55 px-2 py-1.5 text-[10px] text-text-secondary">
|
||||
<div className="mb-2 flex items-center justify-between rounded bg-surface/55 px-2 py-1.5 text-xs text-text-secondary">
|
||||
<span>{MAP_OBJECT_PLACEMENT_LABELS[object.placementMode]}</span>
|
||||
<span className="flex items-center gap-1 text-text-tertiary">
|
||||
{poseLocked && <LockKeyhole className="h-3 w-3" aria-hidden="true" />}
|
||||
在视口工具条切换
|
||||
<Tooltip content="在视口底部切换放置方式;Z 随贴地或支撑面计算,锁定时不可移动。">
|
||||
<button type="button" className="min-h-7 underline decoration-dotted">
|
||||
放置说明
|
||||
</button>
|
||||
</Tooltip>
|
||||
</span>
|
||||
</div>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
@@ -170,6 +174,7 @@ export function MapObjectInspector({
|
||||
<ScrubbableNumberInput
|
||||
key={index}
|
||||
label={`${['X', 'Y', 'Z'][index]}(m)`}
|
||||
axis={(['x', 'y', 'z'] as const)[index]}
|
||||
aria-label={`对象位置${['X', 'Y', 'Z'][index]}`}
|
||||
value={value}
|
||||
step={0.1}
|
||||
@@ -181,6 +186,7 @@ export function MapObjectInspector({
|
||||
<ScrubbableNumberInput
|
||||
containerClassName="mt-2"
|
||||
label="绕 Z 旋转(°)"
|
||||
axis="z"
|
||||
aria-label="对象绕Z旋转"
|
||||
value={Number(yawDegrees(object).toFixed(4))}
|
||||
step={1}
|
||||
@@ -203,6 +209,7 @@ export function MapObjectInspector({
|
||||
<ScrubbableNumberInput
|
||||
key={key}
|
||||
label={PARAMETER_LABELS[key] ?? key}
|
||||
labelClassName="whitespace-normal"
|
||||
aria-label={`对象参数${key}`}
|
||||
value={value}
|
||||
min={0.001}
|
||||
@@ -214,9 +221,10 @@ export function MapObjectInspector({
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Section title="表面材质">
|
||||
<details className="domain-details">
|
||||
<summary>表面材质</summary>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<label className="text-[10px] text-text-secondary">
|
||||
<label className="text-xs text-text-secondary">
|
||||
材质预设
|
||||
<Select
|
||||
aria-label="对象表面材质"
|
||||
@@ -245,7 +253,7 @@ export function MapObjectInspector({
|
||||
))}
|
||||
</Select>
|
||||
</label>
|
||||
<label className="text-[10px] text-text-secondary">
|
||||
<label className="text-xs text-text-secondary">
|
||||
表面颜色
|
||||
<input
|
||||
aria-label="对象颜色"
|
||||
@@ -283,9 +291,10 @@ export function MapObjectInspector({
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Section>
|
||||
</details>
|
||||
|
||||
<Section title="摩擦力">
|
||||
<details className="domain-details">
|
||||
<summary>摩擦力</summary>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
{object.friction.map((value, index) => (
|
||||
<ScrubbableNumberInput
|
||||
@@ -301,7 +310,7 @@ export function MapObjectInspector({
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</Section>
|
||||
</details>
|
||||
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<Button disabled={loading} icon={<Copy className="h-3 w-3" />} onClick={onDuplicate}>
|
||||
|
||||
Reference in New Issue
Block a user