|
1 | 1 | <script setup lang="ts"> |
2 | 2 | import type { ModuleInfo, RolldownModuleFlowNode, RolldownModuleLoadNoChanges, RolldownModuleTransformInfo, RolldownModuleTransformNoChanges } from '../../../node/rpc/functions/rolldown-get-module-info' |
3 | 3 | import type { SessionContext } from '../../types/data' |
| 4 | +import { Menu as VMenu } from 'floating-vue' |
4 | 5 | import { computed, ref, shallowRef, toRefs } from 'vue' |
5 | 6 | import PluginName from '../display/PluginName.vue' |
6 | 7 |
|
@@ -104,17 +105,72 @@ const codeDisplay = computed(() => { |
104 | 105 | </script> |
105 | 106 |
|
106 | 107 | <template> |
107 | | - <div of-auto> |
108 | | - <FlowmapNode |
109 | | - :lines="{ bottom: true }" pt4 |
110 | | - :active="selected != null" |
111 | | - > |
112 | | - <template #content> |
113 | | - <div p2> |
114 | | - <DisplayModuleId :id="info.id" /> |
115 | | - </div> |
| 108 | + <div of-auto pt4> |
| 109 | + <div v-if="info.importers?.length" flex="~ gap-2" pb4 text-sm> |
| 110 | + <VMenu> |
| 111 | + <FlowmapNode :lines="{ bottom: true }" :active="selected != null" class-node-outer="border-dashed"> |
| 112 | + <template #inner> |
| 113 | + <div flex="~ items-center gap-1" text-sm text-blue px3 py1> |
| 114 | + <div i-ph-arrows-merge-duotone rotate-270 /> |
| 115 | + {{ info.importers?.length }} importers |
| 116 | + </div> |
| 117 | + </template> |
| 118 | + </FlowmapNode> |
| 119 | + <template #popper="{ hide }"> |
| 120 | + <div p2 flex="~ col gap-1"> |
| 121 | + <DisplayModuleId |
| 122 | + v-for="importer of info.importers" |
| 123 | + :id="importer" |
| 124 | + :key="importer" |
| 125 | + :session="session" |
| 126 | + :link="true" |
| 127 | + class="hover:bg-active" |
| 128 | + px2 py1 rounded |
| 129 | + @click="hide" |
| 130 | + /> |
| 131 | + </div> |
| 132 | + </template> |
| 133 | + </VMenu> |
| 134 | + </div> |
| 135 | + <div flex="~"> |
| 136 | + <FlowmapNode |
| 137 | + :lines="{ bottom: true }" |
| 138 | + :active="selected != null" |
| 139 | + > |
| 140 | + <template #content> |
| 141 | + <div p2> |
| 142 | + <DisplayModuleId :id="info.id" /> |
| 143 | + </div> |
| 144 | + </template> |
| 145 | + </FlowmapNode> |
| 146 | + <template v-if="info.imports?.length"> |
| 147 | + <div w-10 border="t base dashed" mya /> |
| 148 | + <VMenu mya> |
| 149 | + <FlowmapNode :active="selected != null" class-node-outer="border-dashed"> |
| 150 | + <template #inner> |
| 151 | + <div flex="~ items-center gap-1" text-sm text-orange px3 py1> |
| 152 | + <div i-ph-arrows-split-duotone rotate-270 /> |
| 153 | + {{ info.imports?.length }} imports |
| 154 | + </div> |
| 155 | + </template> |
| 156 | + </FlowmapNode> |
| 157 | + <template #popper="{ hide }"> |
| 158 | + <div p2 flex="~ col gap-1"> |
| 159 | + <DisplayModuleId |
| 160 | + v-for="imp of info.imports" |
| 161 | + :id="imp" |
| 162 | + :key="imp" |
| 163 | + :session="session" |
| 164 | + :link="true" |
| 165 | + class="hover:bg-active" |
| 166 | + px2 py1 rounded |
| 167 | + @click="hide" |
| 168 | + /> |
| 169 | + </div> |
| 170 | + </template> |
| 171 | + </VMenu> |
116 | 172 | </template> |
117 | | - </FlowmapNode> |
| 173 | + </div> |
118 | 174 | <div w-max flex="~ gap-4"> |
119 | 175 | <div select-none> |
120 | 176 | <FlowmapExpandable |
|
0 commit comments