@industry-theme/git-panels 0.1.19 → 0.1.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.
@@ -403,9 +403,9 @@ const GitCommitHistoryPanel = ({
403
403
  const { theme: theme2 } = useTheme();
404
404
  const [limit, setLimit] = useState(25);
405
405
  const [selectedHash, setSelectedHash] = useState(null);
406
- const commitsSlice = context.getSlice("commits");
407
- const hasCommits = context.hasSlice("commits");
408
- const isLoading = context.isSliceLoading("commits");
406
+ const { commits: commitsSlice } = context;
407
+ const hasCommits = !!commitsSlice;
408
+ const isLoading = (commitsSlice == null ? void 0 : commitsSlice.loading) ?? false;
409
409
  const commits = ((_a = commitsSlice == null ? void 0 : commitsSlice.data) == null ? void 0 : _a.commits) ?? [];
410
410
  const sortedCommits = useMemo(() => {
411
411
  return commits.slice(0, limit).sort((a, b) => {
@@ -37547,20 +37547,20 @@ class EditMap {
37547
37547
  this.map.length = 0;
37548
37548
  }
37549
37549
  }
37550
- function addImplementation(editMap, at, remove, add) {
37550
+ function addImplementation(editMap, at2, remove, add) {
37551
37551
  let index2 = 0;
37552
37552
  if (remove === 0 && add.length === 0) {
37553
37553
  return;
37554
37554
  }
37555
37555
  while (index2 < editMap.map.length) {
37556
- if (editMap.map[index2][0] === at) {
37556
+ if (editMap.map[index2][0] === at2) {
37557
37557
  editMap.map[index2][1] += remove;
37558
37558
  editMap.map[index2][2].push(...add);
37559
37559
  return;
37560
37560
  }
37561
37561
  index2 += 1;
37562
37562
  }
37563
- editMap.map.push([at, remove, add]);
37563
+ editMap.map.push([at2, remove, add]);
37564
37564
  }
37565
37565
  function gfmTableAlign(events, index2) {
37566
37566
  let inDelimiterRow = false;
@@ -39717,7 +39717,7 @@ var css_248z = ".transform-component-module_wrapper__SPB86 {\n position: relati
39717
39717
  var styles = { "wrapper": "transform-component-module_wrapper__SPB86", "content": "transform-component-module_content__FBWxo" };
39718
39718
  styleInject(css_248z);
39719
39719
  var TransformComponent = function(_a) {
39720
- var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e = _a.contentProps, contentProps = _e === void 0 ? {} : _e;
39720
+ var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e2 = _a.contentProps, contentProps = _e2 === void 0 ? {} : _e2;
39721
39721
  var _f = useContext(Context), init = _f.init, cleanupWindowEvents = _f.cleanupWindowEvents;
39722
39722
  var wrapperRef = useRef(null);
39723
39723
  var contentRef = useRef(null);
@@ -39737,6 +39737,96 @@ var TransformComponent = function(_a) {
39737
39737
  React2__default.createElement("div", __assign({}, contentProps, { ref: contentRef, className: "".concat(baseClasses.contentClass, " ").concat(styles.content, " ").concat(contentClass), style: contentStyle }), children2)
39738
39738
  );
39739
39739
  };
39740
+ var isInjected = false;
39741
+ function injectHighlightStyles() {
39742
+ if (isInjected || typeof document === "undefined") {
39743
+ return;
39744
+ }
39745
+ const existingStyle = document.getElementById("themed-markdown-highlight-css");
39746
+ if (existingStyle) {
39747
+ isInjected = true;
39748
+ return;
39749
+ }
39750
+ const css2 = `
39751
+ pre code.hljs {
39752
+ display: block;
39753
+ overflow-x: auto;
39754
+ padding: 1em
39755
+ }
39756
+ code.hljs {
39757
+ padding: 3px 5px
39758
+ }
39759
+
39760
+ .hljs {
39761
+ color: #abb2bf;
39762
+ background: #282c34
39763
+ }
39764
+ .hljs-comment,
39765
+ .hljs-quote {
39766
+ color: #5c6370;
39767
+ font-style: italic
39768
+ }
39769
+ .hljs-doctag,
39770
+ .hljs-keyword,
39771
+ .hljs-formula {
39772
+ color: #c678dd
39773
+ }
39774
+ .hljs-section,
39775
+ .hljs-name,
39776
+ .hljs-selector-tag,
39777
+ .hljs-deletion,
39778
+ .hljs-subst {
39779
+ color: #e06c75
39780
+ }
39781
+ .hljs-literal {
39782
+ color: #56b6c2
39783
+ }
39784
+ .hljs-string,
39785
+ .hljs-regexp,
39786
+ .hljs-addition,
39787
+ .hljs-attribute,
39788
+ .hljs-meta .hljs-string {
39789
+ color: #98c379
39790
+ }
39791
+ .hljs-attr,
39792
+ .hljs-variable,
39793
+ .hljs-template-variable,
39794
+ .hljs-type,
39795
+ .hljs-selector-class,
39796
+ .hljs-selector-attr,
39797
+ .hljs-selector-pseudo,
39798
+ .hljs-number {
39799
+ color: #d19a66
39800
+ }
39801
+ .hljs-symbol,
39802
+ .hljs-bullet,
39803
+ .hljs-link,
39804
+ .hljs-meta,
39805
+ .hljs-selector-id,
39806
+ .hljs-title {
39807
+ color: #61aeee
39808
+ }
39809
+ .hljs-built_in,
39810
+ .hljs-title.class_,
39811
+ .hljs-class .hljs-title {
39812
+ color: #e6c07b
39813
+ }
39814
+ .hljs-emphasis {
39815
+ font-style: italic
39816
+ }
39817
+ .hljs-strong {
39818
+ font-weight: bold
39819
+ }
39820
+ .hljs-link {
39821
+ text-decoration: underline
39822
+ }`;
39823
+ const styleElement = document.createElement("style");
39824
+ styleElement.id = "themed-markdown-highlight-css";
39825
+ styleElement.textContent = css2;
39826
+ document.head.appendChild(styleElement);
39827
+ isInjected = true;
39828
+ }
39829
+ injectHighlightStyles();
39740
39830
  var terminalTheme = {
39741
39831
  space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
39742
39832
  fonts: {
@@ -39774,52 +39864,53 @@ var terminalTheme = {
39774
39864
  zIndices: [0, 1, 10, 20, 30, 40, 50],
39775
39865
  colors: {
39776
39866
  text: "#e4e4e4",
39777
- background: "rgba(10, 10, 10, 0.85)",
39867
+ background: "#0a0a0a",
39778
39868
  primary: "#66b3ff",
39779
39869
  secondary: "#80c4ff",
39780
39870
  accent: "#66ff99",
39781
- highlight: "rgba(102, 179, 255, 0.15)",
39782
- muted: "rgba(26, 26, 26, 0.8)",
39871
+ highlight: "#18283d",
39872
+ muted: "#1a1a1a",
39783
39873
  success: "#66ff99",
39784
39874
  warning: "#ffcc66",
39785
39875
  error: "#ff6666",
39786
39876
  info: "#66b3ff",
39787
- border: "rgba(255, 255, 255, 0.1)",
39788
- backgroundSecondary: "rgba(15, 15, 15, 0.9)",
39789
- backgroundTertiary: "rgba(20, 20, 20, 0.9)",
39790
- backgroundLight: "rgba(255, 255, 255, 0.05)",
39791
- backgroundHover: "rgba(102, 179, 255, 0.08)",
39792
- surface: "rgba(15, 15, 15, 0.95)",
39793
- textSecondary: "rgba(255, 255, 255, 0.7)",
39794
- textTertiary: "rgba(255, 255, 255, 0.5)",
39795
- textMuted: "rgba(255, 255, 255, 0.4)",
39796
- highlightBg: "rgba(255, 235, 59, 0.25)",
39797
- highlightBorder: "rgba(255, 235, 59, 0.5)"
39877
+ border: "#1a1a1a",
39878
+ backgroundSecondary: "#0f0f0f",
39879
+ backgroundTertiary: "#141414",
39880
+ backgroundLight: "#0d0d0d",
39881
+ backgroundHover: "#0d1520",
39882
+ surface: "#0f0f0f",
39883
+ textSecondary: "#b3b3b3",
39884
+ textTertiary: "#808080",
39885
+ textMuted: "#666666",
39886
+ highlightBg: "#40391e",
39887
+ highlightBorder: "#7f7530",
39888
+ textOnPrimary: "#ffffff"
39798
39889
  },
39799
39890
  modes: {
39800
39891
  light: {
39801
39892
  text: "#1a1a1a",
39802
- background: "rgba(255, 255, 255, 0.9)",
39893
+ background: "#ffffff",
39803
39894
  primary: "#0066cc",
39804
39895
  secondary: "#0052a3",
39805
39896
  accent: "#00cc88",
39806
- highlight: "rgba(0, 102, 204, 0.08)",
39807
- muted: "rgba(245, 245, 245, 0.8)",
39897
+ highlight: "#e6f2ff",
39898
+ muted: "#f5f5f5",
39808
39899
  success: "#00cc88",
39809
39900
  warning: "#ffaa00",
39810
39901
  error: "#ff3333",
39811
39902
  info: "#0066cc",
39812
- border: "rgba(0, 0, 0, 0.1)",
39813
- backgroundSecondary: "rgba(250, 250, 250, 0.9)",
39814
- backgroundTertiary: "rgba(245, 245, 245, 0.9)",
39815
- backgroundLight: "rgba(0, 0, 0, 0.02)",
39816
- backgroundHover: "rgba(0, 102, 204, 0.04)",
39817
- surface: "rgba(255, 255, 255, 0.95)",
39818
- textSecondary: "rgba(0, 0, 0, 0.6)",
39819
- textTertiary: "rgba(0, 0, 0, 0.4)",
39820
- textMuted: "rgba(0, 0, 0, 0.3)",
39821
- highlightBg: "rgba(255, 235, 59, 0.3)",
39822
- highlightBorder: "rgba(255, 235, 59, 0.6)"
39903
+ border: "#e6e6e6",
39904
+ backgroundSecondary: "#fafafa",
39905
+ backgroundTertiary: "#f5f5f5",
39906
+ backgroundLight: "#fafafa",
39907
+ backgroundHover: "#f5f9fd",
39908
+ surface: "#ffffff",
39909
+ textSecondary: "#666666",
39910
+ textTertiary: "#999999",
39911
+ textMuted: "#b3b3b3",
39912
+ highlightBg: "#fff9c4",
39913
+ highlightBorder: "#fff389"
39823
39914
  }
39824
39915
  },
39825
39916
  buttons: {
@@ -41136,8 +41227,8 @@ var createIndustryMarkdownComponents = ({
41136
41227
  };
41137
41228
  const darkMode = getLuminance(theme2.colors.background) < 0.5;
41138
41229
  const headerStyles = {};
41139
- if (index2 === 0 && slideHeaderMarginTopOverride) {
41140
- headerStyles.marginTop = `${slideHeaderMarginTopOverride}px`;
41230
+ if (index2 === 0) {
41231
+ headerStyles.marginTop = slideHeaderMarginTopOverride ? `${slideHeaderMarginTopOverride}px` : 0;
41141
41232
  }
41142
41233
  return {
41143
41234
  h1: ({ children: children2, ...props }) => /* @__PURE__ */ React2__default.createElement("h1", {
@@ -41253,7 +41344,7 @@ var createIndustryMarkdownComponents = ({
41253
41344
  ...props
41254
41345
  }, children2),
41255
41346
  li: ({ children: children2, ...props }) => {
41256
- var _a, _b, _c, _d, _e, _f, _g, _h;
41347
+ var _a, _b, _c, _d, _e2, _f, _g, _h;
41257
41348
  const isTaskListItem = Array.isArray(children2) && children2.length > 0 && React2__default.isValidElement(children2[0]) && ((_b = (_a = children2[0]) == null ? void 0 : _a.props) == null ? void 0 : _b.type) === "checkbox";
41258
41349
  if (isTaskListItem) {
41259
41350
  const checkbox = children2[0];
@@ -41268,7 +41359,7 @@ var createIndustryMarkdownComponents = ({
41268
41359
  }
41269
41360
  });
41270
41361
  const checked = ((_c = checkbox == null ? void 0 : checkbox.props) == null ? void 0 : _c.checked) || false;
41271
- const lineNumber = ((_e = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
41362
+ const lineNumber = ((_e2 = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e2.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
41272
41363
  const id = `${slideIdPrefix}-checkbox-${lineNumber}`;
41273
41364
  const isChecked = checkedItems[id] ?? checked;
41274
41365
  const handleChange = (e) => {
@@ -41413,7 +41504,7 @@ var createIndustryMarkdownComponents = ({
41413
41504
  });
41414
41505
  },
41415
41506
  code: ({ node: node2, className, children: children2, ...props }) => {
41416
- var _a, _b, _c, _d, _e, _f;
41507
+ var _a, _b, _c, _d, _e2, _f;
41417
41508
  const hasLanguageClass = className && (className.includes("language-") || className.includes("hljs"));
41418
41509
  const codeString = extractTextFromChildren(children2);
41419
41510
  const matchLang = /language-(\w+)/.exec(className || "");
@@ -41625,7 +41716,7 @@ var createIndustryMarkdownComponents = ({
41625
41716
  ...props
41626
41717
  }, children2)));
41627
41718
  }
41628
- const cleanClassName = (_f = (_e = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
41719
+ const cleanClassName = (_f = (_e2 = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e2.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
41629
41720
  return /* @__PURE__ */ React2__default.createElement("code", {
41630
41721
  style: {
41631
41722
  color: theme2.colors.accent,
@@ -42323,29 +42414,25 @@ var fontTransitionCSS = `
42323
42414
  font-size: 1rem !important; /* Fixed size for checkbox labels */
42324
42415
  }
42325
42416
 
42326
- /* Remove top margin from headings when they're the first element */
42327
- .markdown-slide > :first-child h1:first-child,
42328
- .markdown-slide > :first-child h2:first-child,
42329
- .markdown-slide > :first-child h3:first-child,
42330
- .markdown-slide > :first-child h4:first-child,
42331
- .markdown-slide > :first-child h5:first-child,
42332
- .markdown-slide > :first-child h6:first-child {
42417
+ /* Remove top margin from any first element - must override inline styles */
42418
+ .markdown-slide > *:first-child,
42419
+ .markdown-slide > *:first-child > *:first-child {
42333
42420
  margin-top: 0 !important;
42334
42421
  }
42335
-
42336
- /* Also handle when heading is inside the first paragraph/div from ReactMarkdown */
42337
- .markdown-slide > div:first-child > h1:first-child,
42338
- .markdown-slide > div:first-child > h2:first-child,
42339
- .markdown-slide > div:first-child > h3:first-child,
42340
- .markdown-slide > div:first-child > h4:first-child,
42341
- .markdown-slide > div:first-child > h5:first-child,
42342
- .markdown-slide > div:first-child > h6:first-child,
42343
- .markdown-slide > p:first-child > h1:first-child,
42344
- .markdown-slide > p:first-child > h2:first-child,
42345
- .markdown-slide > p:first-child > h3:first-child,
42346
- .markdown-slide > p:first-child > h4:first-child,
42347
- .markdown-slide > p:first-child > h5:first-child,
42348
- .markdown-slide > p:first-child > h6:first-child {
42422
+
42423
+ /* Specifically target all possible first-child elements */
42424
+ .markdown-slide > h1:first-child,
42425
+ .markdown-slide > h2:first-child,
42426
+ .markdown-slide > h3:first-child,
42427
+ .markdown-slide > h4:first-child,
42428
+ .markdown-slide > h5:first-child,
42429
+ .markdown-slide > h6:first-child,
42430
+ .markdown-slide > p:first-child,
42431
+ .markdown-slide > ul:first-child,
42432
+ .markdown-slide > ol:first-child,
42433
+ .markdown-slide > div:first-child,
42434
+ .markdown-slide > blockquote:first-child,
42435
+ .markdown-slide > pre:first-child {
42349
42436
  margin-top: 0 !important;
42350
42437
  }
42351
42438
  `;
@@ -42664,7 +42751,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
42664
42751
  }
42665
42752
  }, [slideIndex]);
42666
42753
  const sanitizeSchema = useMemo(() => {
42667
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
42754
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
42668
42755
  return {
42669
42756
  ...defaultSchema,
42670
42757
  tagNames: [...defaultSchema.tagNames || [], "picture", "source", "mark"],
@@ -42675,7 +42762,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
42675
42762
  span: [...((_b = defaultSchema.attributes) == null ? void 0 : _b.span) || [], "className", "style"],
42676
42763
  pre: [...((_c = defaultSchema.attributes) == null ? void 0 : _c.pre) || [], "className", "style"],
42677
42764
  div: [...((_d = defaultSchema.attributes) == null ? void 0 : _d.div) || [], "style", "className", "id"],
42678
- p: [...((_e = defaultSchema.attributes) == null ? void 0 : _e.p) || [], "style", "className", "id"],
42765
+ p: [...((_e2 = defaultSchema.attributes) == null ? void 0 : _e2.p) || [], "style", "className", "id"],
42679
42766
  h1: [...((_f = defaultSchema.attributes) == null ? void 0 : _f.h1) || [], "style", "className", "id"],
42680
42767
  h2: [...((_g = defaultSchema.attributes) == null ? void 0 : _g.h2) || [], "style", "className", "id"],
42681
42768
  h3: [...((_h = defaultSchema.attributes) == null ? void 0 : _h.h3) || [], "style", "className", "id"],
@@ -43071,7 +43158,6 @@ var panelConstraintFlags = /* @__PURE__ */ new Map();
43071
43158
  function reportConstraintsViolation(resizeHandleId, flag) {
43072
43159
  panelConstraintFlags.set(resizeHandleId, flag);
43073
43160
  }
43074
- new AbortController();
43075
43161
  function useForceUpdate() {
43076
43162
  const [_, setCount] = useState(0);
43077
43163
  return useCallback(() => setCount((prevCount) => prevCount + 1), []);
@@ -43235,7 +43321,7 @@ function adjustLayoutByDelta({
43235
43321
  if (!fuzzyNumbersEqual(prevSize, safeSize)) {
43236
43322
  deltaApplied += prevSize - safeSize;
43237
43323
  nextLayout[index2] = safeSize;
43238
- if (deltaApplied.toPrecision(3).localeCompare(Math.abs(delta).toPrecision(3), void 0, {
43324
+ if (deltaApplied.toFixed(3).localeCompare(Math.abs(delta).toFixed(3), void 0, {
43239
43325
  numeric: true
43240
43326
  }) >= 0) {
43241
43327
  break;
@@ -43344,9 +43430,14 @@ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
43344
43430
  const index2 = getResizeHandleElementIndex(groupId, dragHandleId, panelGroupElement);
43345
43431
  return index2 != null ? [index2, index2 + 1] : [-1, -1];
43346
43432
  }
43433
+ function isHTMLElement(target) {
43434
+ if (target instanceof HTMLElement) {
43435
+ return true;
43436
+ }
43437
+ return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
43438
+ }
43347
43439
  function getPanelGroupElement(id, rootElement = document) {
43348
- var _dataset;
43349
- if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
43440
+ if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
43350
43441
  return rootElement;
43351
43442
  }
43352
43443
  const element2 = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
@@ -43664,11 +43755,11 @@ function computePanelFlexBoxStyle({
43664
43755
  const size = layout[panelIndex];
43665
43756
  let flexGrow;
43666
43757
  if (size == null) {
43667
- flexGrow = defaultSize != null ? defaultSize.toPrecision(precision) : "1";
43758
+ flexGrow = defaultSize != null ? defaultSize.toFixed(precision) : "1";
43668
43759
  } else if (panelData.length === 1) {
43669
43760
  flexGrow = "1";
43670
43761
  } else {
43671
- flexGrow = size.toPrecision(precision);
43762
+ flexGrow = size.toFixed(precision);
43672
43763
  }
43673
43764
  return {
43674
43765
  flexBasis: 0,
@@ -44450,23 +44541,26 @@ function panelDataHelper(panelDataArray, panelData, layout) {
44450
44541
  pivotIndices
44451
44542
  };
44452
44543
  }
44453
- function S(e2) {
44544
+ function C(e2) {
44454
44545
  return { "--panel-background": e2.colors.background, "--panel-border": e2.colors.border, "--panel-handle": e2.colors.backgroundSecondary, "--panel-handle-hover": e2.colors.backgroundHover, "--panel-handle-active": e2.colors.primary, "--panel-button-bg": e2.colors.surface, "--panel-button-hover": e2.colors.backgroundHover, "--panel-button-border": e2.colors.border, "--panel-button-icon": e2.colors.textSecondary, "--panel-accent-bg": e2.colors.primary + "15" };
44455
44546
  }
44456
- var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minPanelWidth: u2 = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m2, preventKeyboardScroll: f2 = true }, g) => {
44457
- const v = useRef(null), b = S(d2);
44458
- useImperativeHandle(g, () => ({ scrollToPanel: (e2) => {
44459
- if (!v.current)
44547
+ var z = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minPanelWidth: u2 = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m2, preventKeyboardScroll: f2 = true, disableSwipe: g = false }, v) => {
44548
+ const b = useRef(null), y2 = useRef(false), w2 = useRef(null), x2 = C(d2);
44549
+ useImperativeHandle(v, () => ({ scrollToPanel: (e2) => {
44550
+ if (!b.current)
44460
44551
  return;
44461
- const t2 = v.current, n2 = t2.children[e2];
44552
+ const t2 = b.current, n2 = t2.children[e2];
44462
44553
  if (n2) {
44554
+ y2.current = true, w2.current && clearTimeout(w2.current);
44463
44555
  const e3 = n2.offsetLeft;
44464
- t2.scrollTo({ left: e3, behavior: "smooth" });
44556
+ t2.scrollTo({ left: e3, behavior: "smooth" }), w2.current = setTimeout(() => {
44557
+ y2.current = false;
44558
+ }, 500);
44465
44559
  }
44466
44560
  }, getCurrentPanel: () => {
44467
- if (!v.current || v.current.children.length === 0)
44561
+ if (!b.current || b.current.children.length === 0)
44468
44562
  return 0;
44469
- const e2 = v.current, t2 = e2.getBoundingClientRect().left;
44563
+ const e2 = b.current, t2 = e2.getBoundingClientRect().left;
44470
44564
  let n2 = 0, r2 = 1 / 0;
44471
44565
  for (let o3 = 0; o3 < e2.children.length; o3++) {
44472
44566
  const i2 = e2.children[o3].getBoundingClientRect(), a3 = Math.abs(i2.left - t2);
@@ -44475,9 +44569,9 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
44475
44569
  return n2;
44476
44570
  } }));
44477
44571
  useEffect(() => {
44478
- if (!f2 || !v.current)
44572
+ if (!f2 || !b.current)
44479
44573
  return;
44480
- const e2 = v.current, t2 = (e3) => {
44574
+ const e2 = b.current, t2 = (e3) => {
44481
44575
  const t3 = e3.target;
44482
44576
  if (t3.tagName === "INPUT" || t3.tagName === "TEXTAREA" || t3.tagName === "SELECT" || t3.isContentEditable || t3.closest(".xterm") !== null || t3.closest('[contenteditable="true"]') !== null)
44483
44577
  return;
@@ -44486,79 +44580,84 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
44486
44580
  return e2.addEventListener("keydown", t2), () => {
44487
44581
  e2.removeEventListener("keydown", t2);
44488
44582
  };
44489
- }, [f2]);
44490
- const y2 = o2.length, w2 = 2 * u2;
44491
- let x2;
44492
- x2 = y2 === 1 || y2 === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
44493
- const C = React2__default.useId().replace(/:/g, "_");
44583
+ }, [f2]), useEffect(() => () => {
44584
+ w2.current && clearTimeout(w2.current);
44585
+ }, []);
44586
+ const S = o2.length, R2 = 2 * u2;
44587
+ let N;
44588
+ N = S === 1 || S === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
44589
+ const E = React2__default.useId().replace(/:/g, "_");
44494
44590
  return jsxs(Fragment, { children: [
44495
- y2 === 2 && /* @__PURE__ */ jsx("style", { children: `
44496
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
44591
+ S === 2 && /* @__PURE__ */ jsx("style", { children: `
44592
+ .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
44497
44593
  width: 100%;
44498
44594
  }
44499
- @container (min-width: ${w2}px) {
44500
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
44595
+ @container (min-width: ${R2}px) {
44596
+ .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
44501
44597
  width: 50%;
44502
44598
  }
44503
44599
  }
44504
44600
  ` }),
44505
- /* @__PURE__ */ jsx("div", { ref: v, className: `snap-carousel-container ${a2}`, style: { ...b, ...s2, "--snap-carousel-min-width": `${u2}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": x2, "--snap-carousel-panel-count": y2, "--snap-carousel-two-panel-threshold": `${w2}px` }, onScroll: (e2) => {
44506
- if (!m2 || !v.current || v.current.children.length === 0)
44601
+ /* @__PURE__ */ jsx("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a2}`, style: { ...x2, ...s2, "--snap-carousel-min-width": `${u2}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": N, "--snap-carousel-panel-count": S, "--snap-carousel-two-panel-threshold": `${R2}px` }, onScroll: (e2) => {
44602
+ if (!m2 || !b.current || b.current.children.length === 0)
44603
+ return;
44604
+ if (y2.current)
44507
44605
  return;
44508
- const t2 = v.current, n2 = t2.getBoundingClientRect().left;
44606
+ const t2 = b.current, n2 = t2.getBoundingClientRect().left;
44509
44607
  let r2 = 0, o3 = 1 / 0;
44510
44608
  for (let i2 = 0; i2 < t2.children.length; i2++) {
44511
44609
  const e3 = t2.children[i2].getBoundingClientRect(), a3 = Math.abs(e3.left - n2);
44512
44610
  a3 < o3 && (o3 = a3, r2 = i2);
44513
44611
  }
44514
44612
  m2(r2);
44515
- }, "data-panel-count": y2, "data-carousel-id": C, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
44613
+ }, "data-panel-count": S, "data-carousel-id": E, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
44516
44614
  ] });
44517
44615
  });
44518
- M.displayName = "SnapCarousel";
44616
+ z.displayName = "SnapCarousel";
44617
+ var le;
44519
44618
  var se;
44520
- var ce;
44521
- (ce = se || (se = {})).DragStart = "dragStart", ce.DragMove = "dragMove", ce.DragEnd = "dragEnd", ce.DragCancel = "dragCancel", ce.DragOver = "dragOver", ce.RegisterDroppable = "registerDroppable", ce.SetDroppableDisabled = "setDroppableDisabled", ce.UnregisterDroppable = "unregisterDroppable";
44522
- var ue = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
44619
+ (se = le || (le = {})).DragStart = "dragStart", se.DragMove = "dragMove", se.DragEnd = "dragEnd", se.DragCancel = "dragCancel", se.DragOver = "dragOver", se.RegisterDroppable = "registerDroppable", se.SetDroppableDisabled = "setDroppableDisabled", se.UnregisterDroppable = "unregisterDroppable";
44620
+ var de = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
44523
44621
  var Te;
44524
- var ke;
44525
- (ke = Te || (Te = {}))[ke.Forward = 1] = "Forward", ke[ke.Backward = -1] = "Backward";
44622
+ var Ae;
44623
+ (Ae = Te || (Te = {}))[Ae.Forward = 1] = "Forward", Ae[Ae.Backward = -1] = "Backward";
44624
+ var _e;
44526
44625
  var je;
44527
44626
  var He;
44528
44627
  var Ke;
44529
- var Ue;
44530
- (He = je || (je = {})).Click = "click", He.DragStart = "dragstart", He.Keydown = "keydown", He.ContextMenu = "contextmenu", He.Resize = "resize", He.SelectionChange = "selectionchange", He.VisibilityChange = "visibilitychange", (Ue = Ke || (Ke = {})).Space = "Space", Ue.Down = "ArrowDown", Ue.Right = "ArrowRight", Ue.Left = "ArrowLeft", Ue.Up = "ArrowUp", Ue.Esc = "Escape", Ue.Enter = "Enter", Ue.Tab = "Tab";
44531
- ({ start: [Ke.Space, Ke.Enter], cancel: [Ke.Esc], end: [Ke.Space, Ke.Enter, Ke.Tab] });
44628
+ (je = _e || (_e = {})).Click = "click", je.DragStart = "dragstart", je.Keydown = "keydown", je.ContextMenu = "contextmenu", je.Resize = "resize", je.SelectionChange = "selectionchange", je.VisibilityChange = "visibilitychange", (Ke = He || (He = {})).Space = "Space", Ke.Down = "ArrowDown", Ke.Right = "ArrowRight", Ke.Left = "ArrowLeft", Ke.Up = "ArrowUp", Ke.Esc = "Escape", Ke.Enter = "Enter", Ke.Tab = "Tab";
44629
+ ({ start: [He.Space, He.Enter], cancel: [He.Esc], end: [He.Space, He.Enter, He.Tab] });
44630
+ var rt;
44532
44631
  var ot;
44533
- var it;
44534
- (it = ot || (ot = {}))[it.RightClick = 2] = "RightClick";
44632
+ (ot = rt || (rt = {}))[ot.RightClick = 2] = "RightClick";
44633
+ var at;
44535
44634
  var lt;
44536
44635
  var st;
44537
44636
  var ct;
44538
- var dt;
44539
- (st = lt || (lt = {}))[st.Pointer = 0] = "Pointer", st[st.DraggableRect = 1] = "DraggableRect", (dt = ct || (ct = {}))[dt.TreeOrder = 0] = "TreeOrder", dt[dt.ReversedTreeOrder = 1] = "ReversedTreeOrder";
44637
+ (lt = at || (at = {}))[lt.Pointer = 0] = "Pointer", lt[lt.DraggableRect = 1] = "DraggableRect", (ct = st || (st = {}))[ct.TreeOrder = 0] = "TreeOrder", ct[ct.ReversedTreeOrder = 1] = "ReversedTreeOrder";
44540
44638
  ({ x: { [Te.Backward]: false, [Te.Forward]: false }, y: { [Te.Backward]: false, [Te.Forward]: false } });
44639
+ var pt;
44541
44640
  var ht;
44542
44641
  var mt;
44543
- var ft;
44544
- (mt = ht || (ht = {}))[mt.Always = 0] = "Always", mt[mt.BeforeDragging = 1] = "BeforeDragging", mt[mt.WhileDragging = 2] = "WhileDragging", (ft || (ft = {})).Optimized = "optimized";
44545
- ({ droppable: { strategy: ht.WhileDragging, frequency: ft.Optimized } });
44546
- /* @__PURE__ */ createContext({ ...ue, scaleX: 1, scaleY: 1 });
44642
+ (ht = pt || (pt = {}))[ht.Always = 0] = "Always", ht[ht.BeforeDragging = 1] = "BeforeDragging", ht[ht.WhileDragging = 2] = "WhileDragging", (mt || (mt = {})).Optimized = "optimized";
44643
+ ({ droppable: { strategy: pt.WhileDragging, frequency: mt.Optimized } });
44644
+ /* @__PURE__ */ createContext({ ...de, scaleX: 1, scaleY: 1 });
44645
+ var $t;
44547
44646
  var Bt;
44548
- var Ot;
44549
- (Ot = Bt || (Bt = {}))[Ot.Uninitialized = 0] = "Uninitialized", Ot[Ot.Initializing = 1] = "Initializing", Ot[Ot.Initialized = 2] = "Initialized";
44550
- var Vt;
44647
+ (Bt = $t || ($t = {}))[Bt.Uninitialized = 0] = "Uninitialized", Bt[Bt.Initializing = 1] = "Initializing", Bt[Bt.Initialized = 2] = "Initialized";
44648
+ var Ut;
44551
44649
  (() => {
44552
44650
  if (typeof window != "undefined") {
44553
44651
  const e2 = window;
44554
44652
  return e2.__principlemd_theme_context__ || (e2.__principlemd_theme_context__ = createContext(void 0)), e2.__principlemd_theme_context__;
44555
44653
  }
44556
- return Vt || (Vt = createContext(void 0)), Vt;
44654
+ return Ut || (Ut = createContext(void 0)), Ut;
44557
44655
  })();
44558
44656
  var DocumentView = ({
44559
44657
  content: content2,
44560
44658
  onCheckboxChange,
44561
44659
  maxWidth = "900px",
44660
+ width,
44562
44661
  slideIdPrefix = "document",
44563
44662
  enableHtmlPopout = true,
44564
44663
  enableKeyboardScrolling = true,
@@ -44603,7 +44702,8 @@ var DocumentView = ({
44603
44702
  handlePromptCopy,
44604
44703
  repositoryInfo,
44605
44704
  transparentBackground,
44606
- editable
44705
+ editable,
44706
+ containerWidth: width
44607
44707
  })));
44608
44708
  };
44609
44709
  const GitCommitDetailPanelContent = ({
@@ -45063,9 +45163,9 @@ const GitPullRequestsPanel = ({
45063
45163
  const { theme: theme2 } = useTheme();
45064
45164
  const [selectedPrId, setSelectedPrId] = useState(null);
45065
45165
  const [showDrafts, setShowDrafts] = useState(false);
45066
- const prSlice = context.getSlice("pullRequests");
45067
- const hasPRs = context.hasSlice("pullRequests");
45068
- const isLoading = context.isSliceLoading("pullRequests");
45166
+ const { pullRequests: prSlice } = context;
45167
+ const hasPRs = !!prSlice;
45168
+ const isLoading = (prSlice == null ? void 0 : prSlice.loading) ?? false;
45069
45169
  const pullRequests = ((_a = prSlice == null ? void 0 : prSlice.data) == null ? void 0 : _a.pullRequests) ?? [];
45070
45170
  useEffect(() => {
45071
45171
  const unsubscribers = [
@@ -46142,7 +46242,8 @@ const panels = [
46142
46242
  },
46143
46243
  component: GitCommitHistoryPanel,
46144
46244
  onMount: async (context) => {
46145
- if (context.hasSlice("commits") && !context.isSliceLoading("commits")) {
46245
+ const commitsSlice = context.getSlice("commits");
46246
+ if (commitsSlice && !commitsSlice.loading) {
46146
46247
  await context.refresh("repository", "commits");
46147
46248
  }
46148
46249
  }
@@ -46174,7 +46275,8 @@ const panels = [
46174
46275
  },
46175
46276
  component: GitPullRequestsPanel,
46176
46277
  onMount: async (context) => {
46177
- if (context.hasSlice("pullRequests") && !context.isSliceLoading("pullRequests")) {
46278
+ const pullRequestsSlice = context.getSlice("pullRequests");
46279
+ if (pullRequestsSlice && !pullRequestsSlice.loading) {
46178
46280
  await context.refresh("repository", "pullRequests");
46179
46281
  }
46180
46282
  }