@forge-kit/plugin-source-map-prase 0.0.1 → 0.0.2
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/dist/app.js +3 -3
- package/package.json +1 -1
- package/src/App.less +39 -79
- package/src/App.tsx +27 -32
- package/src/components/map-input-panel/index.less +0 -1
- package/src/components/map-input-panel/index.tsx +47 -50
- package/src/components/panel-card/index.less +18 -0
- package/src/components/panel-card/index.tsx +6 -8
- package/src/components/trace-chain/index.less +108 -106
- package/src/components/trace-chain/index.tsx +22 -23
|
@@ -3,6 +3,7 @@ import {Box, Button, Flex, Text} from "@forge-kit/component";
|
|
|
3
3
|
import {DndContext, PointerSensor, closestCenter, useSensor, useSensors, type DragEndEvent} from "@dnd-kit/core";
|
|
4
4
|
import {SortableContext, arrayMove, useSortable, verticalListSortingStrategy} from "@dnd-kit/sortable";
|
|
5
5
|
import {CSS} from "@dnd-kit/utilities";
|
|
6
|
+
import {PanelCard} from "@/components/panel-card";
|
|
6
7
|
import "./index.less";
|
|
7
8
|
|
|
8
9
|
interface TraceChainNode {
|
|
@@ -113,14 +114,6 @@ export const TraceChain: React.FC<TraceChainProps> = (props) => {
|
|
|
113
114
|
const {slots = [], data = [], onReorder, onDelete, className} = props
|
|
114
115
|
const sensors = useSensors(useSensor(PointerSensor, {activationConstraint: {distance: 6}}))
|
|
115
116
|
|
|
116
|
-
if (slots.length === 0) {
|
|
117
|
-
return (
|
|
118
|
-
<Box className={className || "trace-chain-root"}>
|
|
119
|
-
<Flex className="trace-chain-empty" align="center" justify="center">暂无解析链路,上传 map 并点击“解析链路”。</Flex>
|
|
120
|
-
</Box>
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
117
|
const handleDragEnd = (event: DragEndEvent) => {
|
|
125
118
|
const {active, over} = event
|
|
126
119
|
if (!over || active.id === over.id) return
|
|
@@ -132,20 +125,26 @@ export const TraceChain: React.FC<TraceChainProps> = (props) => {
|
|
|
132
125
|
}
|
|
133
126
|
|
|
134
127
|
return (
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
{
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
128
|
+
<PanelCard title="TRACE CHAIN" className="trace-panel-card">
|
|
129
|
+
<Flex className="trace-panel-content">
|
|
130
|
+
{Boolean(!slots.length) && (
|
|
131
|
+
<Box className={className || "trace-chain-root"}>
|
|
132
|
+
<Flex className="trace-chain-empty" align="center" justify="center">暂无解析链路,上传 map
|
|
133
|
+
并点击“解析链路”。</Flex>
|
|
134
|
+
</Box>
|
|
135
|
+
)}
|
|
136
|
+
{Boolean(slots.length) && (
|
|
137
|
+
<DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd}>
|
|
138
|
+
<SortableContext items={slots.map((item) => item.id)} strategy={verticalListSortingStrategy}>
|
|
139
|
+
<Box className={className || "trace-chain-root"}>
|
|
140
|
+
{slots.map((slot, index) => {
|
|
141
|
+
return <SortableTraceChainItem key={slot.id} slot={slot} hop={data[index]} index={index} onDelete={onDelete}/>
|
|
142
|
+
})}
|
|
143
|
+
</Box>
|
|
144
|
+
</SortableContext>
|
|
145
|
+
</DndContext>
|
|
146
|
+
)}
|
|
147
|
+
</Flex>
|
|
148
|
+
</PanelCard>
|
|
150
149
|
)
|
|
151
150
|
}
|