git-viewer 11.0.0 → 12.0.0

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.
@@ -1729,7 +1729,8 @@ function Sidebar(handle) {
1729
1729
  RefSection,
1730
1730
  {
1731
1731
  title: remote.toUpperCase(),
1732
- nodes
1732
+ nodes,
1733
+ initialExpanded: false
1733
1734
  },
1734
1735
  remote
1735
1736
  ))
@@ -1739,36 +1740,43 @@ function Sidebar(handle) {
1739
1740
  );
1740
1741
  }
1741
1742
  function RefSection(handle) {
1742
- let expanded = true;
1743
- return ({ title, nodes }) => /* @__PURE__ */ jsx("div", { css: { marginBottom: "8px" }, children: [
1744
- /* @__PURE__ */ jsx(
1745
- "div",
1746
- {
1747
- css: {
1748
- padding: "4px 12px",
1749
- fontSize: "10px",
1750
- fontWeight: 600,
1751
- textTransform: "uppercase",
1752
- letterSpacing: "0.5px",
1753
- color: colors.textMuted,
1754
- cursor: "pointer",
1755
- "&:hover": { color: colors.text }
1756
- },
1757
- on: {
1758
- click: () => {
1759
- expanded = !expanded;
1760
- handle.update();
1761
- }
1762
- },
1763
- children: [
1764
- expanded ? "\u25BC" : "\u25B6",
1765
- " ",
1766
- title
1767
- ]
1768
- }
1769
- ),
1770
- expanded && /* @__PURE__ */ jsx("div", { css: { paddingLeft: "8px" }, children: nodes.map((node) => /* @__PURE__ */ jsx(RefNodeItem, { node, depth: 0 }, node.name)) })
1771
- ] });
1743
+ let expanded = null;
1744
+ return ({
1745
+ title,
1746
+ nodes,
1747
+ initialExpanded = true
1748
+ }) => {
1749
+ if (expanded === null) expanded = initialExpanded;
1750
+ return /* @__PURE__ */ jsx("div", { css: { marginBottom: "8px" }, children: [
1751
+ /* @__PURE__ */ jsx(
1752
+ "div",
1753
+ {
1754
+ css: {
1755
+ padding: "4px 12px",
1756
+ fontSize: "10px",
1757
+ fontWeight: 600,
1758
+ textTransform: "uppercase",
1759
+ letterSpacing: "0.5px",
1760
+ color: colors.textMuted,
1761
+ cursor: "pointer",
1762
+ "&:hover": { color: colors.text }
1763
+ },
1764
+ on: {
1765
+ click: () => {
1766
+ expanded = !expanded;
1767
+ handle.update();
1768
+ }
1769
+ },
1770
+ children: [
1771
+ expanded ? "\u25BC" : "\u25B6",
1772
+ " ",
1773
+ title
1774
+ ]
1775
+ }
1776
+ ),
1777
+ expanded && /* @__PURE__ */ jsx("div", { css: { paddingLeft: "8px" }, children: nodes.map((node) => /* @__PURE__ */ jsx(RefNodeItem, { node, depth: 0 }, node.name)) })
1778
+ ] });
1779
+ };
1772
1780
  }
1773
1781
  function RefNodeItem(handle) {
1774
1782
  let store = handle.context.get(App);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-viewer",
3
- "version": "11.0.0",
3
+ "version": "12.0.0",
4
4
  "description": "Visual git log viewer with branch graph and diff display",
5
5
  "repository": {
6
6
  "type": "git",