@industry-theme/file-city-panel 0.5.64 → 0.5.65
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":"FileCityTrailExplorerPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/FileCityTrailExplorerPanel/FileCityTrailExplorerPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,8BAA8B,CAAC;AAiBtC,OAAO,KAAK,EAEV,oCAAoC,EAErC,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"FileCityTrailExplorerPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/FileCityTrailExplorerPanel/FileCityTrailExplorerPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,8BAA8B,CAAC;AAiBtC,OAAO,KAAK,EAEV,oCAAoC,EAErC,MAAM,wCAAwC,CAAC;AA2BhD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAC/C,oCAAoC,CA+ErC,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -258684,7 +258684,6 @@ const pierreStyle = {
|
|
|
258684
258684
|
};
|
|
258685
258685
|
const SEQUENCE_DRAWER_HEIGHT_PCT = 45;
|
|
258686
258686
|
const SNIPPET_PANE_WIDTH_PX = 460;
|
|
258687
|
-
const HEADER_HEIGHT_PX = 48;
|
|
258688
258687
|
const PANEL_TRANSITION_MS = 280;
|
|
258689
258688
|
const THREE_D_TOGGLE_DISABLED = true;
|
|
258690
258689
|
const FileCityTrailExplorerPanel = ({ context, actions }) => {
|
|
@@ -258766,6 +258765,7 @@ const FileCityTrailSequenceLayout = ({
|
|
|
258766
258765
|
return;
|
|
258767
258766
|
}, [hasLineCounts]);
|
|
258768
258767
|
const effectiveShow3D = false;
|
|
258768
|
+
const [viewMode, setViewMode] = React.useState("city");
|
|
258769
258769
|
const [showSequenceDrawer, setShowSequenceDrawer] = React.useState(false);
|
|
258770
258770
|
const [drawerHeightOverridePct, setDrawerHeightOverridePct] = React.useState(null);
|
|
258771
258771
|
const [isResizingDrawer, setIsResizingDrawer] = React.useState(false);
|
|
@@ -259086,16 +259086,28 @@ const FileCityTrailSequenceLayout = ({
|
|
|
259086
259086
|
setDrawerHeightOverridePct(null);
|
|
259087
259087
|
setShowSequenceDrawer((v) => !v);
|
|
259088
259088
|
},
|
|
259089
|
-
canExit: selectedMarkerId != null || showSequenceDrawer || snippetExpanded,
|
|
259089
|
+
canExit: selectedMarkerId != null || showSequenceDrawer || snippetExpanded || viewMode !== "city",
|
|
259090
259090
|
onExitTrail: () => {
|
|
259091
259091
|
onSelectMarker(null);
|
|
259092
259092
|
setShowSequenceDrawer(false);
|
|
259093
259093
|
setDrawerHeightOverridePct(null);
|
|
259094
259094
|
setSnippetExpanded(false);
|
|
259095
|
-
|
|
259095
|
+
setViewMode("city");
|
|
259096
|
+
},
|
|
259097
|
+
viewMode,
|
|
259098
|
+
onSetViewMode: setViewMode
|
|
259096
259099
|
}
|
|
259097
259100
|
),
|
|
259098
|
-
/* @__PURE__ */
|
|
259101
|
+
viewMode === "doc" ? /* @__PURE__ */ jsx(
|
|
259102
|
+
TrailDocumentView,
|
|
259103
|
+
{
|
|
259104
|
+
markers: markersForThisRepo,
|
|
259105
|
+
summary: trail2.summary,
|
|
259106
|
+
readFile,
|
|
259107
|
+
selectedMarkerId,
|
|
259108
|
+
onSelectMarker
|
|
259109
|
+
}
|
|
259110
|
+
) : /* @__PURE__ */ jsxs(
|
|
259099
259111
|
"div",
|
|
259100
259112
|
{
|
|
259101
259113
|
ref: containerRef,
|
|
@@ -259643,6 +259655,251 @@ const SidePaneFrame = React.forwardRef(
|
|
|
259643
259655
|
);
|
|
259644
259656
|
}
|
|
259645
259657
|
);
|
|
259658
|
+
const TrailDocumentView = ({
|
|
259659
|
+
markers,
|
|
259660
|
+
summary,
|
|
259661
|
+
readFile,
|
|
259662
|
+
selectedMarkerId,
|
|
259663
|
+
onSelectMarker
|
|
259664
|
+
}) => {
|
|
259665
|
+
const { theme: theme2 } = useTheme();
|
|
259666
|
+
return /* @__PURE__ */ jsx(
|
|
259667
|
+
"div",
|
|
259668
|
+
{
|
|
259669
|
+
style: {
|
|
259670
|
+
flex: 1,
|
|
259671
|
+
minHeight: 0,
|
|
259672
|
+
overflowY: "auto",
|
|
259673
|
+
overflowX: "hidden",
|
|
259674
|
+
padding: "24px 32px 64px",
|
|
259675
|
+
background: theme2.colors.background
|
|
259676
|
+
},
|
|
259677
|
+
children: /* @__PURE__ */ jsxs("div", { style: { maxWidth: 880, margin: "0 auto" }, children: [
|
|
259678
|
+
summary ? /* @__PURE__ */ jsx(
|
|
259679
|
+
"div",
|
|
259680
|
+
{
|
|
259681
|
+
style: {
|
|
259682
|
+
fontFamily: theme2.fonts.body,
|
|
259683
|
+
fontSize: theme2.fontSizes[1],
|
|
259684
|
+
lineHeight: 1.6,
|
|
259685
|
+
color: theme2.colors.text,
|
|
259686
|
+
whiteSpace: "pre-wrap",
|
|
259687
|
+
marginBottom: 32,
|
|
259688
|
+
paddingBottom: 24,
|
|
259689
|
+
borderBottom: `1px solid ${theme2.colors.border}`
|
|
259690
|
+
},
|
|
259691
|
+
children: summary
|
|
259692
|
+
}
|
|
259693
|
+
) : null,
|
|
259694
|
+
markers.length === 0 ? /* @__PURE__ */ jsx(
|
|
259695
|
+
"div",
|
|
259696
|
+
{
|
|
259697
|
+
style: {
|
|
259698
|
+
fontFamily: theme2.fonts.body,
|
|
259699
|
+
fontSize: theme2.fontSizes[1],
|
|
259700
|
+
color: theme2.colors.textSecondary
|
|
259701
|
+
},
|
|
259702
|
+
children: "No markers in this repo."
|
|
259703
|
+
}
|
|
259704
|
+
) : markers.map((marker, idx) => /* @__PURE__ */ jsx(
|
|
259705
|
+
TrailDocumentCard,
|
|
259706
|
+
{
|
|
259707
|
+
index: idx,
|
|
259708
|
+
total: markers.length,
|
|
259709
|
+
marker,
|
|
259710
|
+
readFile,
|
|
259711
|
+
isActive: marker.id === selectedMarkerId,
|
|
259712
|
+
onActivate: () => onSelectMarker(
|
|
259713
|
+
marker.id === selectedMarkerId ? null : marker.id
|
|
259714
|
+
)
|
|
259715
|
+
},
|
|
259716
|
+
marker.id
|
|
259717
|
+
))
|
|
259718
|
+
] })
|
|
259719
|
+
}
|
|
259720
|
+
);
|
|
259721
|
+
};
|
|
259722
|
+
const TrailDocumentCard = ({
|
|
259723
|
+
index: index2,
|
|
259724
|
+
total,
|
|
259725
|
+
marker,
|
|
259726
|
+
readFile,
|
|
259727
|
+
isActive,
|
|
259728
|
+
onActivate
|
|
259729
|
+
}) => {
|
|
259730
|
+
const { theme: theme2 } = useTheme();
|
|
259731
|
+
const fileName = marker.sourcePath ? marker.sourcePath.split("/").pop() ?? marker.sourcePath : null;
|
|
259732
|
+
const headingLabel = marker.label ?? `Marker ${index2 + 1}`;
|
|
259733
|
+
const snippet2 = marker.snippet;
|
|
259734
|
+
const [snippetExpanded, setSnippetExpanded] = React.useState(false);
|
|
259735
|
+
return /* @__PURE__ */ jsxs(
|
|
259736
|
+
"div",
|
|
259737
|
+
{
|
|
259738
|
+
style: {
|
|
259739
|
+
marginBottom: 32,
|
|
259740
|
+
border: `1px solid ${isActive ? theme2.colors.accent : theme2.colors.border}`,
|
|
259741
|
+
borderRadius: theme2.radii[3],
|
|
259742
|
+
background: theme2.colors.background,
|
|
259743
|
+
boxShadow: isActive ? `0 0 0 2px ${withAlpha(theme2.colors.accent, 0.18)}` : "none",
|
|
259744
|
+
overflow: "hidden"
|
|
259745
|
+
},
|
|
259746
|
+
children: [
|
|
259747
|
+
/* @__PURE__ */ jsxs(
|
|
259748
|
+
"button",
|
|
259749
|
+
{
|
|
259750
|
+
type: "button",
|
|
259751
|
+
onClick: onActivate,
|
|
259752
|
+
title: isActive ? "Clear selection" : "Select this marker on the city view",
|
|
259753
|
+
style: {
|
|
259754
|
+
display: "flex",
|
|
259755
|
+
flexDirection: "column",
|
|
259756
|
+
alignItems: "flex-start",
|
|
259757
|
+
gap: 4,
|
|
259758
|
+
width: "100%",
|
|
259759
|
+
textAlign: "left",
|
|
259760
|
+
padding: "16px 20px",
|
|
259761
|
+
background: "transparent",
|
|
259762
|
+
border: "none",
|
|
259763
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
259764
|
+
cursor: "pointer",
|
|
259765
|
+
color: theme2.colors.text
|
|
259766
|
+
},
|
|
259767
|
+
children: [
|
|
259768
|
+
/* @__PURE__ */ jsxs(
|
|
259769
|
+
"div",
|
|
259770
|
+
{
|
|
259771
|
+
style: {
|
|
259772
|
+
fontFamily: theme2.fonts.body,
|
|
259773
|
+
fontSize: theme2.fontSizes[0],
|
|
259774
|
+
color: theme2.colors.textSecondary,
|
|
259775
|
+
letterSpacing: "0.04em",
|
|
259776
|
+
textTransform: "uppercase"
|
|
259777
|
+
},
|
|
259778
|
+
children: [
|
|
259779
|
+
index2 + 1,
|
|
259780
|
+
" / ",
|
|
259781
|
+
total
|
|
259782
|
+
]
|
|
259783
|
+
}
|
|
259784
|
+
),
|
|
259785
|
+
/* @__PURE__ */ jsx(
|
|
259786
|
+
"div",
|
|
259787
|
+
{
|
|
259788
|
+
style: {
|
|
259789
|
+
fontFamily: theme2.fonts.heading,
|
|
259790
|
+
fontSize: theme2.fontSizes[2],
|
|
259791
|
+
fontWeight: theme2.fontWeights.semibold,
|
|
259792
|
+
color: theme2.colors.text
|
|
259793
|
+
},
|
|
259794
|
+
children: headingLabel
|
|
259795
|
+
}
|
|
259796
|
+
),
|
|
259797
|
+
marker.sourcePath ? /* @__PURE__ */ jsx(
|
|
259798
|
+
"div",
|
|
259799
|
+
{
|
|
259800
|
+
style: {
|
|
259801
|
+
fontFamily: theme2.fonts.monospace,
|
|
259802
|
+
fontSize: theme2.fontSizes[0],
|
|
259803
|
+
color: theme2.colors.textSecondary
|
|
259804
|
+
},
|
|
259805
|
+
children: marker.sourcePath
|
|
259806
|
+
}
|
|
259807
|
+
) : null
|
|
259808
|
+
]
|
|
259809
|
+
}
|
|
259810
|
+
),
|
|
259811
|
+
marker.description ? /* @__PURE__ */ jsx(
|
|
259812
|
+
"div",
|
|
259813
|
+
{
|
|
259814
|
+
style: {
|
|
259815
|
+
fontFamily: theme2.fonts.body,
|
|
259816
|
+
fontSize: theme2.fontSizes[1],
|
|
259817
|
+
lineHeight: 1.6,
|
|
259818
|
+
color: theme2.colors.text,
|
|
259819
|
+
whiteSpace: "pre-wrap",
|
|
259820
|
+
padding: "16px 20px",
|
|
259821
|
+
borderBottom: snippet2 ? `1px solid ${theme2.colors.border}` : "none"
|
|
259822
|
+
},
|
|
259823
|
+
children: marker.description
|
|
259824
|
+
}
|
|
259825
|
+
) : null,
|
|
259826
|
+
snippet2 && marker.sourcePath ? /* @__PURE__ */ jsxs("div", { style: { background: theme2.colors.background }, children: [
|
|
259827
|
+
/* @__PURE__ */ jsxs(
|
|
259828
|
+
"button",
|
|
259829
|
+
{
|
|
259830
|
+
type: "button",
|
|
259831
|
+
onClick: () => setSnippetExpanded((v) => !v),
|
|
259832
|
+
"aria-expanded": snippetExpanded,
|
|
259833
|
+
title: snippetExpanded ? "Hide snippet" : "Show snippet",
|
|
259834
|
+
style: {
|
|
259835
|
+
display: "flex",
|
|
259836
|
+
alignItems: "center",
|
|
259837
|
+
gap: 8,
|
|
259838
|
+
width: "100%",
|
|
259839
|
+
textAlign: "left",
|
|
259840
|
+
padding: "10px 20px",
|
|
259841
|
+
background: "transparent",
|
|
259842
|
+
border: "none",
|
|
259843
|
+
borderBottom: snippetExpanded ? `1px solid ${theme2.colors.border}` : "none",
|
|
259844
|
+
cursor: "pointer",
|
|
259845
|
+
fontFamily: theme2.fonts.body,
|
|
259846
|
+
fontSize: theme2.fontSizes[0],
|
|
259847
|
+
fontWeight: theme2.fontWeights.medium,
|
|
259848
|
+
color: theme2.colors.textSecondary,
|
|
259849
|
+
letterSpacing: "0.04em",
|
|
259850
|
+
textTransform: "uppercase"
|
|
259851
|
+
},
|
|
259852
|
+
children: [
|
|
259853
|
+
/* @__PURE__ */ jsx(
|
|
259854
|
+
"span",
|
|
259855
|
+
{
|
|
259856
|
+
"aria-hidden": true,
|
|
259857
|
+
style: {
|
|
259858
|
+
display: "inline-block",
|
|
259859
|
+
width: 10,
|
|
259860
|
+
transform: snippetExpanded ? "rotate(90deg)" : "rotate(0deg)",
|
|
259861
|
+
transition: "transform 120ms ease"
|
|
259862
|
+
},
|
|
259863
|
+
children: "▶"
|
|
259864
|
+
}
|
|
259865
|
+
),
|
|
259866
|
+
snippetExpanded ? "Hide snippet" : "Show snippet"
|
|
259867
|
+
]
|
|
259868
|
+
}
|
|
259869
|
+
),
|
|
259870
|
+
snippetExpanded ? /* @__PURE__ */ jsx("div", { style: { padding: 12 }, children: snippet2.kind === "slice" ? /* @__PURE__ */ jsx(
|
|
259871
|
+
TrailSnippetView,
|
|
259872
|
+
{
|
|
259873
|
+
filePath: marker.sourcePath,
|
|
259874
|
+
fileName: fileName ?? marker.sourcePath,
|
|
259875
|
+
startLine: snippet2.startLine,
|
|
259876
|
+
endLine: snippet2.endLine,
|
|
259877
|
+
focusLine: snippet2.focusLine,
|
|
259878
|
+
contextLines: snippet2.contextLines,
|
|
259879
|
+
readFile,
|
|
259880
|
+
background: theme2.colors.background
|
|
259881
|
+
}
|
|
259882
|
+
) : /* @__PURE__ */ jsx(
|
|
259883
|
+
TrailDiffSnippetView,
|
|
259884
|
+
{
|
|
259885
|
+
filePath: marker.sourcePath,
|
|
259886
|
+
fileName: fileName ?? marker.sourcePath,
|
|
259887
|
+
oldContents: snippet2.oldContents,
|
|
259888
|
+
newContents: snippet2.newContents,
|
|
259889
|
+
readFile,
|
|
259890
|
+
startLine: snippet2.startLine,
|
|
259891
|
+
endLine: snippet2.endLine,
|
|
259892
|
+
focusLine: snippet2.focusLine,
|
|
259893
|
+
contextLines: snippet2.contextLines,
|
|
259894
|
+
diffStyle: snippet2.diffStyle,
|
|
259895
|
+
background: theme2.colors.background
|
|
259896
|
+
}
|
|
259897
|
+
) }) : null
|
|
259898
|
+
] }) : null
|
|
259899
|
+
]
|
|
259900
|
+
}
|
|
259901
|
+
);
|
|
259902
|
+
};
|
|
259646
259903
|
const TrailHeader = ({
|
|
259647
259904
|
trail: trail2,
|
|
259648
259905
|
markerCount,
|
|
@@ -259652,7 +259909,9 @@ const TrailHeader = ({
|
|
|
259652
259909
|
showSequenceDrawer,
|
|
259653
259910
|
onToggleSequenceDrawer,
|
|
259654
259911
|
canExit,
|
|
259655
|
-
onExitTrail
|
|
259912
|
+
onExitTrail,
|
|
259913
|
+
viewMode,
|
|
259914
|
+
onSetViewMode
|
|
259656
259915
|
}) => {
|
|
259657
259916
|
const { theme: theme2 } = useTheme();
|
|
259658
259917
|
const toggleButtonStyle = (active) => ({
|
|
@@ -259668,11 +259927,28 @@ const TrailHeader = ({
|
|
|
259668
259927
|
cursor: "pointer",
|
|
259669
259928
|
lineHeight: 1.2
|
|
259670
259929
|
});
|
|
259930
|
+
const segmentStyle = (active, side) => ({
|
|
259931
|
+
flexShrink: 0,
|
|
259932
|
+
fontFamily: theme2.fonts.body,
|
|
259933
|
+
fontSize: theme2.fontSizes[0],
|
|
259934
|
+
fontWeight: theme2.fontWeights.medium,
|
|
259935
|
+
color: active ? theme2.colors.background : theme2.colors.text,
|
|
259936
|
+
background: active ? theme2.colors.accent : "transparent",
|
|
259937
|
+
border: `1px solid ${active ? theme2.colors.accent : theme2.colors.muted}`,
|
|
259938
|
+
borderTopLeftRadius: side === "left" ? theme2.radii[3] : 0,
|
|
259939
|
+
borderBottomLeftRadius: side === "left" ? theme2.radii[3] : 0,
|
|
259940
|
+
borderTopRightRadius: side === "right" ? theme2.radii[3] : 0,
|
|
259941
|
+
borderBottomRightRadius: side === "right" ? theme2.radii[3] : 0,
|
|
259942
|
+
marginLeft: side === "right" ? -1 : 0,
|
|
259943
|
+
padding: "4px 10px",
|
|
259944
|
+
cursor: "pointer",
|
|
259945
|
+
lineHeight: 1.2
|
|
259946
|
+
});
|
|
259947
|
+
const isDoc = viewMode === "doc";
|
|
259671
259948
|
return /* @__PURE__ */ jsxs(
|
|
259672
259949
|
"div",
|
|
259673
259950
|
{
|
|
259674
259951
|
style: {
|
|
259675
|
-
height: HEADER_HEIGHT_PX,
|
|
259676
259952
|
padding: "8px 16px",
|
|
259677
259953
|
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
259678
259954
|
display: "flex",
|
|
@@ -259726,7 +260002,7 @@ const TrailHeader = ({
|
|
|
259726
260002
|
}
|
|
259727
260003
|
),
|
|
259728
260004
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
259729
|
-
/* @__PURE__ */ jsx(
|
|
260005
|
+
isDoc ? null : /* @__PURE__ */ jsx(
|
|
259730
260006
|
"button",
|
|
259731
260007
|
{
|
|
259732
260008
|
type: "button",
|
|
@@ -259761,7 +260037,7 @@ const TrailHeader = ({
|
|
|
259761
260037
|
children: "Exit"
|
|
259762
260038
|
}
|
|
259763
260039
|
),
|
|
259764
|
-
hideToggle ? null : /* @__PURE__ */ jsx(
|
|
260040
|
+
hideToggle || isDoc ? null : /* @__PURE__ */ jsx(
|
|
259765
260041
|
"button",
|
|
259766
260042
|
{
|
|
259767
260043
|
type: "button",
|
|
@@ -259771,7 +260047,31 @@ const TrailHeader = ({
|
|
|
259771
260047
|
style: toggleButtonStyle(show3D),
|
|
259772
260048
|
children: "3D"
|
|
259773
260049
|
}
|
|
259774
|
-
)
|
|
260050
|
+
),
|
|
260051
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", marginLeft: 6 }, children: [
|
|
260052
|
+
/* @__PURE__ */ jsx(
|
|
260053
|
+
"button",
|
|
260054
|
+
{
|
|
260055
|
+
type: "button",
|
|
260056
|
+
onClick: () => onSetViewMode("city"),
|
|
260057
|
+
"aria-pressed": !isDoc,
|
|
260058
|
+
title: "City view — 3D buildings + sequence drawer",
|
|
260059
|
+
style: segmentStyle(!isDoc, "left"),
|
|
260060
|
+
children: "City"
|
|
260061
|
+
}
|
|
260062
|
+
),
|
|
260063
|
+
/* @__PURE__ */ jsx(
|
|
260064
|
+
"button",
|
|
260065
|
+
{
|
|
260066
|
+
type: "button",
|
|
260067
|
+
onClick: () => onSetViewMode("doc"),
|
|
260068
|
+
"aria-pressed": isDoc,
|
|
260069
|
+
title: "Document view — scroll all markers as one page",
|
|
260070
|
+
style: segmentStyle(isDoc, "right"),
|
|
260071
|
+
children: "Doc"
|
|
260072
|
+
}
|
|
260073
|
+
)
|
|
260074
|
+
] })
|
|
259775
260075
|
] })
|
|
259776
260076
|
]
|
|
259777
260077
|
}
|