@industry-theme/file-city-panel 0.2.18 → 0.2.20
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAqBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAqBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAsnCD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA8BxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/panels/components/Legend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAA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AAE,mBAAmB,EAAE,CAAC;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAicxC,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -2148,8 +2148,7 @@ const Legend = ({
|
|
|
2148
2148
|
onAgentLayerClick,
|
|
2149
2149
|
onQualityMetricClick,
|
|
2150
2150
|
onClearAgentLayers,
|
|
2151
|
-
position = "bottom"
|
|
2152
|
-
maxSize
|
|
2151
|
+
position = "bottom"
|
|
2153
2152
|
}) => {
|
|
2154
2153
|
const { theme: theme2 } = useTheme();
|
|
2155
2154
|
const hasGitStatus = gitStatus && gitStatus.length > 0;
|
|
@@ -2179,15 +2178,9 @@ const Legend = ({
|
|
|
2179
2178
|
overflowY: "auto",
|
|
2180
2179
|
overflowX: "hidden",
|
|
2181
2180
|
boxSizing: "border-box",
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
height: "100%"
|
|
2186
|
-
} : {
|
|
2187
|
-
maxHeight: maxSize && maxSize > 0 ? maxSize : void 0,
|
|
2188
|
-
width: "100%"
|
|
2189
|
-
},
|
|
2190
|
-
flexShrink: 0
|
|
2181
|
+
flex: 1,
|
|
2182
|
+
minWidth: 0,
|
|
2183
|
+
minHeight: 0
|
|
2191
2184
|
},
|
|
2192
2185
|
children: [
|
|
2193
2186
|
isEmpty && /* @__PURE__ */ jsxs(
|
|
@@ -14925,7 +14918,6 @@ const CodeCityPanelContent = ({
|
|
|
14925
14918
|
const { theme: theme2 } = useTheme();
|
|
14926
14919
|
const [cityData, setCityData] = useState(null);
|
|
14927
14920
|
const [hoverInfo, setHoverInfo] = useState(null);
|
|
14928
|
-
const [showLegend, setShowLegend] = useState(true);
|
|
14929
14921
|
const [highlightLayers, setHighlightLayers] = useState([]);
|
|
14930
14922
|
const [baseLayers, setBaseLayers] = useState([]);
|
|
14931
14923
|
const [loading, setLoading] = useState(false);
|
|
@@ -14949,24 +14941,22 @@ const CodeCityPanelContent = ({
|
|
|
14949
14941
|
}, []);
|
|
14950
14942
|
const headerCompact = containerSize ? containerSize.width < 400 : false;
|
|
14951
14943
|
const LEGEND_MIN_SIZE = 200;
|
|
14944
|
+
const HOVER_BAR_HEIGHT = 48;
|
|
14952
14945
|
const layout = useMemo(() => {
|
|
14953
14946
|
if (!containerSize) {
|
|
14954
|
-
return {
|
|
14947
|
+
return { mapSize: 0, legendPosition: "bottom" };
|
|
14955
14948
|
}
|
|
14956
14949
|
const { width, height } = containerSize;
|
|
14957
14950
|
const isLandscape = width > height;
|
|
14958
14951
|
if (isLandscape) {
|
|
14959
14952
|
const idealMapSize = height;
|
|
14960
14953
|
const availableForLegend = width - idealMapSize;
|
|
14961
|
-
const
|
|
14962
|
-
const
|
|
14963
|
-
return {
|
|
14954
|
+
const legendNeedsMoreSpace = availableForLegend < LEGEND_MIN_SIZE;
|
|
14955
|
+
const mapSize = legendNeedsMoreSpace ? width - LEGEND_MIN_SIZE : idealMapSize;
|
|
14956
|
+
return { mapSize, legendPosition: "right" };
|
|
14964
14957
|
} else {
|
|
14965
|
-
const
|
|
14966
|
-
|
|
14967
|
-
const legendMaxSize = Math.max(availableForLegend, LEGEND_MIN_SIZE);
|
|
14968
|
-
const minMapSize = height - legendMaxSize;
|
|
14969
|
-
return { minMapSize, legendPosition: "bottom", legendMaxSize };
|
|
14958
|
+
const mapSize = width + HOVER_BAR_HEIGHT;
|
|
14959
|
+
return { mapSize, legendPosition: "bottom" };
|
|
14970
14960
|
}
|
|
14971
14961
|
}, [containerSize]);
|
|
14972
14962
|
const fileTreeSlice = context.getSlice("fileTree");
|
|
@@ -15566,30 +15556,6 @@ const CodeCityPanelContent = ({
|
|
|
15566
15556
|
},
|
|
15567
15557
|
children: currentColorModeConfig.name
|
|
15568
15558
|
}
|
|
15569
|
-
),
|
|
15570
|
-
(legendFileTypes.length > 0 || legendGitStatus.length > 0 || legendQualityMetrics.length > 0) && /* @__PURE__ */ jsx(
|
|
15571
|
-
"button",
|
|
15572
|
-
{
|
|
15573
|
-
onClick: () => setShowLegend(!showLegend),
|
|
15574
|
-
style: {
|
|
15575
|
-
fontSize: theme2.fontSizes[0],
|
|
15576
|
-
fontFamily: theme2.fonts.body,
|
|
15577
|
-
color: showLegend ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
15578
|
-
backgroundColor: showLegend ? theme2.colors.primary + "22" : theme2.colors.background,
|
|
15579
|
-
padding: "0 16px",
|
|
15580
|
-
marginRight: "-16px",
|
|
15581
|
-
borderRadius: 0,
|
|
15582
|
-
display: "flex",
|
|
15583
|
-
alignItems: "center",
|
|
15584
|
-
alignSelf: "stretch",
|
|
15585
|
-
gap: "4px",
|
|
15586
|
-
border: "none",
|
|
15587
|
-
cursor: "pointer",
|
|
15588
|
-
transition: "all 0.2s ease"
|
|
15589
|
-
},
|
|
15590
|
-
title: showLegend ? "Hide legend" : "Show legend",
|
|
15591
|
-
children: "Legend"
|
|
15592
|
-
}
|
|
15593
15559
|
)
|
|
15594
15560
|
]
|
|
15595
15561
|
}
|
|
@@ -15600,6 +15566,7 @@ const CodeCityPanelContent = ({
|
|
|
15600
15566
|
ref: contentContainerRef,
|
|
15601
15567
|
style: {
|
|
15602
15568
|
flex: 1,
|
|
15569
|
+
width: "100%",
|
|
15603
15570
|
position: "relative",
|
|
15604
15571
|
overflow: "hidden",
|
|
15605
15572
|
display: "flex",
|
|
@@ -15610,9 +15577,11 @@ const CodeCityPanelContent = ({
|
|
|
15610
15577
|
"div",
|
|
15611
15578
|
{
|
|
15612
15579
|
style: {
|
|
15613
|
-
|
|
15614
|
-
|
|
15615
|
-
|
|
15580
|
+
// In landscape: fixed width for square map, flex height
|
|
15581
|
+
// In portrait: fixed height for square map + hover bar, full width
|
|
15582
|
+
width: layout.legendPosition === "right" ? layout.mapSize : "100%",
|
|
15583
|
+
height: layout.legendPosition === "bottom" ? layout.mapSize : "100%",
|
|
15584
|
+
flexShrink: 0,
|
|
15616
15585
|
position: "relative",
|
|
15617
15586
|
display: "flex",
|
|
15618
15587
|
flexDirection: "column"
|
|
@@ -15818,7 +15787,7 @@ const CodeCityPanelContent = ({
|
|
|
15818
15787
|
]
|
|
15819
15788
|
}
|
|
15820
15789
|
),
|
|
15821
|
-
|
|
15790
|
+
/* @__PURE__ */ jsx(
|
|
15822
15791
|
Legend,
|
|
15823
15792
|
{
|
|
15824
15793
|
fileTypes: legendFileTypes,
|
|
@@ -15831,8 +15800,7 @@ const CodeCityPanelContent = ({
|
|
|
15831
15800
|
onAgentLayerClick: toggleAgentLayer,
|
|
15832
15801
|
onQualityMetricClick: toggleQualityMetric,
|
|
15833
15802
|
onClearAgentLayers: clearAgentLayers,
|
|
15834
|
-
position: layout.legendPosition
|
|
15835
|
-
maxSize: layout.legendMaxSize
|
|
15803
|
+
position: layout.legendPosition
|
|
15836
15804
|
}
|
|
15837
15805
|
)
|
|
15838
15806
|
]
|