Skip to content

Commit c19a0bc

Browse files
committed
feat: update graph ui
1 parent c61a83b commit c19a0bc

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

packages/devtools/src/app/components/flowmap/Node.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const props = defineProps<{
1616
<div v-if="props.lines?.bottom" absolute bottom-0 left-10 border="r base" h="1/2" max-h-4 z-flowmap-line />
1717
<slot name="before" />
1818
<div flex="~" :class="props.classNodeInline">
19+
<slot name="inline-before" />
1920
<div :class="props.classNodeOuter" border="~ base rounded-full" bg-base of-hidden>
2021
<slot name="inner">
2122
<div px3 py1 :class="props.classNodeInner" flex="~ inline gap-2 items-center">

packages/devtools/src/app/pages/build/[build]/transform.vue

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,34 @@ function select(transform: RolldownModuleTransformInfo) {
3838
</template>
3939
</FlowmapNode>
4040

41-
<FlowmapNode :lines="{ top: true, bottom: true }" pl4 py2>
41+
<FlowmapNode :lines="{ top: true, bottom: true }" pl6 py2>
4242
<template #content>
4343
<div i-ph-magnifying-glass-duotone /> Resolve Id
4444
</template>
4545
</FlowmapNode>
4646

47-
<FlowmapNode :lines="{ top: true }" pl4 py2>
47+
<FlowmapNode
48+
:lines="{ top: true, bottom: info.loads.length === 0 }" pl6 py2
49+
:class-node-outer="info.loads.length === 0 ? 'border-dashed' : ''"
50+
>
4851
<template #content>
4952
<div i-ph-upload-simple-duotone /> Load
53+
<span op50 text-xs>({{ info.loads.length }})</span>
54+
</template>
55+
<template v-if="info.loads.length > 0" #inline-before>
56+
<button w-6 h-6 mr1 ml--7 mya rounded-full hover="bg-active" flex="~ items-center justify-center">
57+
<div i-ph-caret-down text-sm op50 />
58+
</button>
5059
</template>
51-
<template #inline-after>
60+
<template v-if="info.loads.length > 0" #inline-after>
5261
<div w-8 relative>
5362
<div absolute top="1/2" left-0 bottom--4 right="1/2" border="t r base rounded-rt-2xl" z-flowmap-line />
5463
</div>
55-
<button>
56-
<div i-ph-caret-down />
57-
</button>
5864
</template>
59-
<template #after>
65+
<template v-if="info.loads.length > 0" #after>
6066
<div pl-12 pt2>
6167
<template v-for="(load, idx) of info.loads" :key="load.plugin_name">
62-
<FlowmapNode :lines="{ top: idx > 0, bottom: idx < info.loads.length - 1 }" pl4 py1>
68+
<FlowmapNode :lines="{ top: idx > 0, bottom: idx < info.loads.length - 1 }" pl6 py1>
6369
<template #content>
6470
<DisplayPluginName :name="load.plugin_name" class="font-mono text-sm" />
6571
</template>
@@ -69,17 +75,23 @@ function select(transform: RolldownModuleTransformInfo) {
6975
</template>
7076
</FlowmapNode>
7177

72-
<FlowmapNode :lines="{ top: true }" pl4 py2>
78+
<FlowmapNode
79+
:lines="{ top: true, bottom: info.transforms.length === 0 }" pl6 py2
80+
:class-node-outer="info.transforms.length === 0 ? 'border-dashed' : ''"
81+
>
7382
<template #content>
7483
<div i-ph-magic-wand-duotone /> Transform
84+
<span op50 text-xs>({{ info.transforms.length }})</span>
85+
</template>
86+
<template v-if="info.transforms.length > 0" #inline-before>
87+
<button w-6 h-6 mr1 ml--7 mya rounded-full hover="bg-active" flex="~ items-center justify-center">
88+
<div i-ph-caret-down text-sm op50 />
89+
</button>
7590
</template>
76-
<template #inline-after>
91+
<template v-if="info.transforms.length > 0" #inline-after>
7792
<div w-8 relative>
7893
<div absolute top="1/2" left-0 bottom--4 right="1/2" border="t r base rounded-rt-2xl" z-flowmap-line />
7994
</div>
80-
<button>
81-
<div i-ph-caret-down />
82-
</button>
8395
</template>
8496
<template #after>
8597
<div pl-12 pt2>
@@ -88,7 +100,7 @@ function select(transform: RolldownModuleTransformInfo) {
88100
:lines="{ top: idx > 0, bottom: idx < info.transforms.length - 1 }"
89101
class-node-inline="gap-2 items-center"
90102
:class-node-outer="transform.source_from === transform.source_to ? 'border-dashed' : ''"
91-
pl4 py1
103+
pl6 py1
92104
>
93105
<template #inner>
94106
<button
@@ -111,19 +123,19 @@ function select(transform: RolldownModuleTransformInfo) {
111123
</template>
112124
</FlowmapNode>
113125

114-
<FlowmapNode :lines="{ top: true, bottom: true }" pl4 py2>
126+
<FlowmapNode :lines="{ top: true, bottom: true }" pl6 py2>
115127
<template #content>
116128
<div i-ph-shapes-duotone /> Chunk
117129
</template>
118130
</FlowmapNode>
119131

120-
<FlowmapNode :lines="{ top: true, bottom: true }" pl4 py2>
132+
<FlowmapNode :lines="{ top: true, bottom: true }" pl6 py2>
121133
<template #content>
122134
<div i-ph-tree-duotone /> Tree shake
123135
</template>
124136
</FlowmapNode>
125137

126-
<FlowmapNode :lines="{ top: true }" pl4 py2>
138+
<FlowmapNode :lines="{ top: true }" pl6 py2>
127139
<template #content>
128140
<div i-ph-package-duotone /> Generate
129141
</template>

0 commit comments

Comments
 (0)