@industry-theme/markdown-panels 0.2.16 → 0.2.18

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":"MarkdownPanel.d.ts","sourceRoot":"","sources":["../../src/panels/MarkdownPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAQ5D,OAAO,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAmB,MAAM,UAAU,CAAC;AAUrE;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiYvD,CAAC"}
1
+ {"version":3,"file":"MarkdownPanel.d.ts","sourceRoot":"","sources":["../../src/panels/MarkdownPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,OAAO,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAmB,MAAM,UAAU,CAAC;AAmBrE;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsZvD,CAAC"}
@@ -42227,8 +42227,7 @@ var createIndustryMarkdownComponents = ({
42227
42227
  style: {
42228
42228
  flex: 1,
42229
42229
  cursor: "pointer",
42230
- textDecoration: isChecked ? "line-through" : "none",
42231
- opacity: isChecked ? 0.6 : 1,
42230
+ color: isChecked ? theme2.colors.textMuted : "inherit",
42232
42231
  lineHeight: theme2.lineHeights.relaxed
42233
42232
  }
42234
42233
  }, labelContent.length > 0 ? labelContent : null)), nestedListElements.length > 0 ? nestedListElements : null);
@@ -43296,6 +43295,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
43296
43295
  handleRunBashCommand,
43297
43296
  handlePromptCopy,
43298
43297
  enableHtmlPopout = true,
43298
+ autoFocusOnVisible = true,
43299
43299
  searchQuery,
43300
43300
  slideHeaderMarginTopOverride,
43301
43301
  theme: themeOverride,
@@ -43502,11 +43502,11 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
43502
43502
  }
43503
43503
  }, [enableKeyboardScrolling, isVisible, slideIndex, scrollConfig]);
43504
43504
  useEffect(() => {
43505
- if (isVisible && slideRef.current) {
43505
+ if (autoFocusOnVisible && isVisible && slideRef.current) {
43506
43506
  console.log("🎯 Auto-focusing slide container");
43507
43507
  slideRef.current.focus();
43508
43508
  }
43509
- }, [isVisible]);
43509
+ }, [autoFocusOnVisible, isVisible]);
43510
43510
  const openPlaceholderModal = (placeholders, promptContent) => {
43511
43511
  if (!handlePromptCopy)
43512
43512
  return;
@@ -46595,11 +46595,13 @@ var SlidePresentationBook = ({
46595
46595
  slideIdPrefix = "slide",
46596
46596
  enableHtmlPopout = true,
46597
46597
  enableKeyboardScrolling = true,
46598
+ autoFocusOnVisible = true,
46598
46599
  onLinkClick,
46599
46600
  handleRunBashCommand,
46600
46601
  handlePromptCopy,
46601
46602
  fontSizeScale,
46602
- theme: theme2
46603
+ theme: theme2,
46604
+ repositoryInfo
46603
46605
  }) => {
46604
46606
  const [isMobile, setIsMobile] = useState(false);
46605
46607
  useEffect(() => {
@@ -46992,11 +46994,13 @@ var SlidePresentationBook = ({
46992
46994
  onCheckboxChange,
46993
46995
  enableHtmlPopout,
46994
46996
  enableKeyboardScrolling,
46997
+ autoFocusOnVisible,
46995
46998
  onLinkClick,
46996
46999
  handleRunBashCommand,
46997
47000
  handlePromptCopy,
46998
47001
  fontSizeScale,
46999
- searchQuery: showSearch ? searchQuery : void 0
47002
+ searchQuery: showSearch ? searchQuery : void 0,
47003
+ repositoryInfo
47000
47004
  }) : /* @__PURE__ */ React2__default.createElement("div", {
47001
47005
  style: {
47002
47006
  height: "100%",
@@ -47113,11 +47117,13 @@ var SlidePresentationBook = ({
47113
47117
  onCheckboxChange,
47114
47118
  enableHtmlPopout,
47115
47119
  enableKeyboardScrolling,
47120
+ autoFocusOnVisible,
47116
47121
  onLinkClick,
47117
47122
  handleRunBashCommand,
47118
47123
  handlePromptCopy,
47119
47124
  fontSizeScale,
47120
- searchQuery: showSearch ? searchQuery : void 0
47125
+ searchQuery: showSearch ? searchQuery : void 0,
47126
+ repositoryInfo
47121
47127
  }) : /* @__PURE__ */ React2__default.createElement("div", {
47122
47128
  style: {
47123
47129
  height: "100%",
@@ -47302,11 +47308,13 @@ var SlidePresentationBook = ({
47302
47308
  onCheckboxChange,
47303
47309
  enableHtmlPopout,
47304
47310
  enableKeyboardScrolling,
47311
+ autoFocusOnVisible,
47305
47312
  onLinkClick,
47306
47313
  handleRunBashCommand,
47307
47314
  handlePromptCopy,
47308
47315
  fontSizeScale,
47309
47316
  searchQuery: showSearch ? searchQuery : void 0,
47317
+ repositoryInfo,
47310
47318
  transparentBackground: true,
47311
47319
  additionalPadding: {
47312
47320
  left: `${theme2.space[4]}px`,
@@ -47346,11 +47354,13 @@ var SlidePresentationBook = ({
47346
47354
  onCheckboxChange,
47347
47355
  enableHtmlPopout,
47348
47356
  enableKeyboardScrolling,
47357
+ autoFocusOnVisible,
47349
47358
  onLinkClick,
47350
47359
  handleRunBashCommand,
47351
47360
  handlePromptCopy,
47352
47361
  fontSizeScale,
47353
47362
  searchQuery: showSearch ? searchQuery : void 0,
47363
+ repositoryInfo,
47354
47364
  transparentBackground: true,
47355
47365
  additionalPadding: {
47356
47366
  left: `${theme2.space[2]}px`,
@@ -47414,11 +47424,13 @@ var SlidePresentationBook = ({
47414
47424
  onCheckboxChange,
47415
47425
  enableHtmlPopout,
47416
47426
  enableKeyboardScrolling,
47427
+ autoFocusOnVisible,
47417
47428
  onLinkClick,
47418
47429
  handleRunBashCommand,
47419
47430
  handlePromptCopy,
47420
47431
  fontSizeScale,
47421
47432
  searchQuery: showSearch ? searchQuery : void 0,
47433
+ repositoryInfo,
47422
47434
  transparentBackground: false,
47423
47435
  disableScroll: false
47424
47436
  }))) : /* @__PURE__ */ React2__default.createElement("div", {
@@ -47494,6 +47506,7 @@ var DocumentView = ({
47494
47506
  slideIdPrefix = "document",
47495
47507
  enableHtmlPopout = true,
47496
47508
  enableKeyboardScrolling = true,
47509
+ autoFocusOnVisible = true,
47497
47510
  onLinkClick,
47498
47511
  handleRunBashCommand,
47499
47512
  handlePromptCopy,
@@ -47541,6 +47554,7 @@ var DocumentView = ({
47541
47554
  onCheckboxChange,
47542
47555
  enableHtmlPopout,
47543
47556
  enableKeyboardScrolling,
47557
+ autoFocusOnVisible,
47544
47558
  onLinkClick,
47545
47559
  handleRunBashCommand,
47546
47560
  fontSizeScale,
@@ -47577,6 +47591,7 @@ var DocumentView = ({
47577
47591
  onCheckboxChange,
47578
47592
  enableHtmlPopout,
47579
47593
  enableKeyboardScrolling,
47594
+ autoFocusOnVisible,
47580
47595
  onLinkClick,
47581
47596
  handleRunBashCommand,
47582
47597
  fontSizeScale,
@@ -47643,6 +47658,7 @@ var DocumentView = ({
47643
47658
  onCheckboxChange,
47644
47659
  enableHtmlPopout,
47645
47660
  enableKeyboardScrolling,
47661
+ autoFocusOnVisible,
47646
47662
  onLinkClick,
47647
47663
  handleRunBashCommand,
47648
47664
  fontSizeScale,
@@ -47666,12 +47682,17 @@ const basename = (path2) => {
47666
47682
  const parts = path2.split("/");
47667
47683
  return parts[parts.length - 1] || path2;
47668
47684
  };
47685
+ const getBasePath = (filePath) => {
47686
+ const parts = filePath.split("/");
47687
+ parts.pop();
47688
+ return parts.join("/");
47689
+ };
47669
47690
  const MarkdownPanel = ({
47670
47691
  context,
47671
47692
  actions: _actions,
47672
47693
  events
47673
47694
  }) => {
47674
- var _a, _b, _c, _d, _e;
47695
+ var _a, _b, _c, _d, _e, _f, _g;
47675
47696
  const { theme: theme2 } = useTheme();
47676
47697
  const [viewMode, setViewMode] = useState("book");
47677
47698
  const [currentSlide, setCurrentSlide] = useState(0);
@@ -47723,6 +47744,18 @@ const MarkdownPanel = ({
47723
47744
  );
47724
47745
  const slides = presentation.slides.map((slide) => slide.location.content);
47725
47746
  const hasSlides = slides.length > 1;
47747
+ const repositoryInfo = useMemo(() => {
47748
+ var _a2, _b2, _c2;
47749
+ const source2 = (_a2 = activeFile == null ? void 0 : activeFile.data) == null ? void 0 : _a2.source;
47750
+ if (!source2) return void 0;
47751
+ const branch = source2.locationType === "branch" ? source2.location : ((_b2 = source2.metadata) == null ? void 0 : _b2.currentBranch) || "main";
47752
+ return {
47753
+ owner: source2.owner,
47754
+ repo: source2.name,
47755
+ branch,
47756
+ basePath: getBasePath(((_c2 = activeFile == null ? void 0 : activeFile.data) == null ? void 0 : _c2.path) || "")
47757
+ };
47758
+ }, [(_e = activeFile == null ? void 0 : activeFile.data) == null ? void 0 : _e.source, (_f = activeFile == null ? void 0 : activeFile.data) == null ? void 0 : _f.path]);
47726
47759
  const handleFontSizeIncrease = () => {
47727
47760
  setFontSizeScale((prev) => {
47728
47761
  const newScale = Math.min(prev + 0.1, 3);
@@ -47771,7 +47804,7 @@ const MarkdownPanel = ({
47771
47804
  },
47772
47805
  children: /* @__PURE__ */ jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxs("p", { style: { color: theme2.colors.textSecondary }, children: [
47773
47806
  "Loading ",
47774
- ((_e = activeFile.data) == null ? void 0 : _e.path) || "file",
47807
+ ((_g = activeFile.data) == null ? void 0 : _g.path) || "file",
47775
47808
  "..."
47776
47809
  ] }) })
47777
47810
  }
@@ -47992,7 +48025,8 @@ const MarkdownPanel = ({
47992
48025
  onCheckboxChange: () => {
47993
48026
  },
47994
48027
  slideIdPrefix: "markdown-panel",
47995
- maxWidth: "100%"
48028
+ maxWidth: "100%",
48029
+ repositoryInfo
47996
48030
  }
47997
48031
  ) : /* @__PURE__ */ jsx(
47998
48032
  SlidePresentationBook,
@@ -48013,7 +48047,8 @@ const MarkdownPanel = ({
48013
48047
  enableKeyboardScrolling: true,
48014
48048
  tocDisplayMode: "sidebar",
48015
48049
  tocSidebarPosition: "left",
48016
- initialTocOpen: false
48050
+ initialTocOpen: false,
48051
+ repositoryInfo
48017
48052
  }
48018
48053
  )
48019
48054
  }