@industry-theme/github-panels 0.1.45 → 0.1.47

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":"GitHubMessagesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitHubMessagesPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAqBnD,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,UAAU,CAAC;AA4nCvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAE7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;CAQvC,CAAC"}
1
+ {"version":3,"file":"GitHubMessagesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitHubMessagesPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAqBnD,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,UAAU,CAAC;AAymCvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAE7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;CAQvC,CAAC"}
@@ -44530,8 +44530,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
44530
44530
  }, [enableKeyboardScrolling, isVisible, slideIndex, scrollConfig]);
44531
44531
  useEffect(() => {
44532
44532
  if (autoFocusOnVisible && isVisible && slideRef.current) {
44533
- console.log("🎯 Auto-focusing slide container");
44534
- slideRef.current.focus();
44533
+ slideRef.current.focus({ preventScroll: true });
44535
44534
  }
44536
44535
  }, [autoFocusOnVisible, isVisible]);
44537
44536
  const openPlaceholderModal = (placeholders, promptContent) => {
@@ -46498,12 +46497,8 @@ var Vt;
46498
46497
  })();
46499
46498
  var DocumentView = ({
46500
46499
  content: content2,
46501
- showSegmented = false,
46502
46500
  onCheckboxChange,
46503
- onSectionClick,
46504
46501
  maxWidth = "900px",
46505
- showSectionHeaders = true,
46506
- showSeparators = true,
46507
46502
  slideIdPrefix = "document",
46508
46503
  enableHtmlPopout = true,
46509
46504
  enableKeyboardScrolling = true,
@@ -46517,90 +46512,7 @@ var DocumentView = ({
46517
46512
  transparentBackground = false
46518
46513
  }) => {
46519
46514
  const containerRef = useRef(null);
46520
- const sectionRefs = useRef([]);
46521
46515
  const backgroundColor = transparentBackground ? "transparent" : theme2.colors.background;
46522
- const scrollToSection = useCallback((sectionIndex) => {
46523
- var _a;
46524
- if (sectionRefs.current[sectionIndex]) {
46525
- (_a = sectionRefs.current[sectionIndex]) == null ? void 0 : _a.scrollIntoView({
46526
- behavior: "smooth",
46527
- block: "start"
46528
- });
46529
- }
46530
- }, []);
46531
- const handleSectionClick = useCallback((index2) => {
46532
- scrollToSection(index2);
46533
- onSectionClick == null ? void 0 : onSectionClick(index2);
46534
- }, [scrollToSection, onSectionClick]);
46535
- if (typeof content2 === "string") {
46536
- return /* @__PURE__ */ React2__default.createElement("div", {
46537
- ref: containerRef,
46538
- style: {
46539
- height: "100%",
46540
- overflow: "auto",
46541
- backgroundColor
46542
- }
46543
- }, /* @__PURE__ */ React2__default.createElement("div", {
46544
- style: {
46545
- maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
46546
- margin: "0 auto",
46547
- height: "100%"
46548
- }
46549
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
46550
- content: content2,
46551
- slideIdPrefix,
46552
- slideIndex: 0,
46553
- isVisible: true,
46554
- theme: theme2,
46555
- onCheckboxChange,
46556
- enableHtmlPopout,
46557
- enableKeyboardScrolling,
46558
- autoFocusOnVisible,
46559
- onLinkClick,
46560
- handleRunBashCommand,
46561
- fontSizeScale,
46562
- handlePromptCopy,
46563
- repositoryInfo,
46564
- transparentBackground
46565
- })));
46566
- }
46567
- if (!showSegmented) {
46568
- const fullContent = content2.join(`
46569
-
46570
- ---
46571
-
46572
- `);
46573
- return /* @__PURE__ */ React2__default.createElement("div", {
46574
- ref: containerRef,
46575
- style: {
46576
- height: "100%",
46577
- overflow: "auto",
46578
- backgroundColor
46579
- }
46580
- }, /* @__PURE__ */ React2__default.createElement("div", {
46581
- style: {
46582
- maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
46583
- margin: "0 auto",
46584
- height: "100%"
46585
- }
46586
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
46587
- content: fullContent,
46588
- slideIdPrefix,
46589
- slideIndex: 0,
46590
- isVisible: true,
46591
- theme: theme2,
46592
- onCheckboxChange,
46593
- enableHtmlPopout,
46594
- enableKeyboardScrolling,
46595
- autoFocusOnVisible,
46596
- onLinkClick,
46597
- handleRunBashCommand,
46598
- fontSizeScale,
46599
- handlePromptCopy,
46600
- repositoryInfo,
46601
- transparentBackground
46602
- })));
46603
- }
46604
46516
  return /* @__PURE__ */ React2__default.createElement("div", {
46605
46517
  ref: containerRef,
46606
46518
  style: {
@@ -46611,49 +46523,13 @@ var DocumentView = ({
46611
46523
  }, /* @__PURE__ */ React2__default.createElement("div", {
46612
46524
  style: {
46613
46525
  maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
46614
- margin: "0 auto"
46615
- }
46616
- }, content2.map((slideContent, index2) => /* @__PURE__ */ React2__default.createElement("div", {
46617
- key: index2,
46618
- ref: (el) => {
46619
- if (el)
46620
- sectionRefs.current[index2] = el;
46621
- },
46622
- style: {
46623
- marginBottom: index2 < content2.length - 1 ? "48px" : "0",
46624
- scrollMarginTop: "20px"
46625
- }
46626
- }, showSectionHeaders && /* @__PURE__ */ React2__default.createElement("div", {
46627
- onClick: () => handleSectionClick(index2),
46628
- style: {
46629
- display: "flex",
46630
- alignItems: "center",
46631
- justifyContent: "space-between",
46632
- marginBottom: "16px",
46633
- paddingBottom: "8px",
46634
- borderBottom: `1px solid ${theme2.colors.border}`,
46635
- opacity: 0.7,
46636
- cursor: "pointer",
46637
- transition: "opacity 0.2s ease"
46638
- },
46639
- onMouseOver: (e2) => {
46640
- e2.currentTarget.style.opacity = "1";
46641
- },
46642
- onMouseOut: (e2) => {
46643
- e2.currentTarget.style.opacity = "0.7";
46526
+ margin: "0 auto",
46527
+ height: "100%"
46644
46528
  }
46645
- }, /* @__PURE__ */ React2__default.createElement("span", {
46646
- style: {
46647
- fontSize: "11px",
46648
- fontWeight: 600,
46649
- color: theme2.colors.textSecondary,
46650
- textTransform: "uppercase",
46651
- letterSpacing: "0.5px"
46652
- }
46653
- }, "Section ", index2 + 1, " of ", content2.length)), /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
46654
- content: slideContent,
46655
- slideIdPrefix: `${slideIdPrefix}-${index2}`,
46656
- slideIndex: index2,
46529
+ }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
46530
+ content: content2,
46531
+ slideIdPrefix,
46532
+ slideIndex: 0,
46657
46533
  isVisible: true,
46658
46534
  theme: theme2,
46659
46535
  onCheckboxChange,
@@ -46666,15 +46542,7 @@ var DocumentView = ({
46666
46542
  handlePromptCopy,
46667
46543
  repositoryInfo,
46668
46544
  transparentBackground
46669
- }), showSeparators && index2 < content2.length - 1 && /* @__PURE__ */ React2__default.createElement("div", {
46670
- style: {
46671
- marginTop: "32px",
46672
- marginBottom: "32px",
46673
- height: "1px",
46674
- backgroundColor: theme2.colors.border,
46675
- opacity: 0.3
46676
- }
46677
- })))));
46545
+ })));
46678
46546
  };
46679
46547
  const formatDate$1 = (dateString) => {
46680
46548
  const date = new Date(dateString);
@@ -47732,25 +47600,10 @@ const TimelineEventRenderer = ({ event }) => {
47732
47600
  };
47733
47601
  const GitHubMessagesPanelContent = ({ context, events }) => {
47734
47602
  const { theme: theme2 } = useTheme();
47735
- const [messagesData, setMessagesData] = useState(null);
47736
- useEffect(() => {
47737
- var _a;
47738
- if (!context) return;
47739
- const sliceData = (_a = context.getSlice) == null ? void 0 : _a.call(context, "github-messages");
47740
- if (sliceData) {
47741
- setMessagesData(sliceData);
47742
- }
47743
- }, [context]);
47744
- useEffect(() => {
47745
- if (!events) return;
47746
- const handleMessagesData = (event) => {
47747
- setMessagesData(event.payload);
47748
- };
47749
- const unsubData = events.on("github-messages:data", handleMessagesData);
47750
- return () => {
47751
- if (typeof unsubData === "function") unsubData();
47752
- };
47753
- }, [events]);
47603
+ const messagesSlice = context.getSlice("github-messages");
47604
+ const isLoading = context.isSliceLoading("github-messages");
47605
+ const hasData = context.hasSlice("github-messages");
47606
+ const messagesData = messagesSlice == null ? void 0 : messagesSlice.data;
47754
47607
  useEffect(() => {
47755
47608
  if (!events) return;
47756
47609
  const handleIssueSelected = (event) => {
@@ -47793,6 +47646,21 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47793
47646
  backgroundColor: theme2.colors.background,
47794
47647
  overflow: "hidden"
47795
47648
  };
47649
+ if (isLoading && !hasData) {
47650
+ return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
47651
+ "div",
47652
+ {
47653
+ style: {
47654
+ flex: 1,
47655
+ display: "flex",
47656
+ alignItems: "center",
47657
+ justifyContent: "center",
47658
+ color: theme2.colors.textSecondary
47659
+ },
47660
+ children: "Loading conversation..."
47661
+ }
47662
+ ) });
47663
+ }
47796
47664
  if (!messagesData || !messagesData.target) {
47797
47665
  return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
47798
47666
  "div",
@@ -47842,21 +47710,6 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47842
47710
  }
47843
47711
  ) });
47844
47712
  }
47845
- if (messagesData.loading) {
47846
- return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
47847
- "div",
47848
- {
47849
- style: {
47850
- flex: 1,
47851
- display: "flex",
47852
- alignItems: "center",
47853
- justifyContent: "center",
47854
- color: theme2.colors.textSecondary
47855
- },
47856
- children: "Loading conversation..."
47857
- }
47858
- ) });
47859
- }
47860
47713
  if (messagesData.error) {
47861
47714
  return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
47862
47715
  "div",