@industry-theme/markdown-panels 0.2.18 → 0.2.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.
@@ -42082,7 +42082,8 @@ var createIndustryMarkdownComponents = ({
42082
42082
  enableHtmlPopout,
42083
42083
  slideHeaderMarginTopOverride,
42084
42084
  index: index2,
42085
- repositoryInfo
42085
+ repositoryInfo,
42086
+ editable = false
42086
42087
  }) => {
42087
42088
  const getLuminance = (hex) => {
42088
42089
  const rgb = hex.replace("#", "").match(/.{2}/g);
@@ -42103,9 +42104,11 @@ var createIndustryMarkdownComponents = ({
42103
42104
  fontSize: theme2.fontSizes[5],
42104
42105
  lineHeight: theme2.lineHeights.heading,
42105
42106
  fontWeight: theme2.fontWeights.bold,
42106
- marginTop: index2 === 0 ? 0 : theme2.space[4],
42107
+ marginTop: theme2.space[4],
42107
42108
  marginBottom: theme2.space[4],
42108
42109
  fontFamily: theme2.fonts.heading,
42110
+ paddingBottom: theme2.space[2],
42111
+ borderBottom: `1px solid ${theme2.colors.border}`,
42109
42112
  ...headerStyles
42110
42113
  },
42111
42114
  ...props2
@@ -42116,9 +42119,11 @@ var createIndustryMarkdownComponents = ({
42116
42119
  fontSize: theme2.fontSizes[4],
42117
42120
  lineHeight: theme2.lineHeights.heading,
42118
42121
  fontWeight: theme2.fontWeights.bold,
42119
- marginTop: index2 === 0 ? 0 : theme2.space[4],
42122
+ marginTop: theme2.space[4],
42120
42123
  marginBottom: theme2.space[3],
42121
42124
  fontFamily: theme2.fonts.heading,
42125
+ paddingBottom: theme2.space[2],
42126
+ borderBottom: `1px solid ${theme2.colors.border}`,
42122
42127
  ...headerStyles
42123
42128
  },
42124
42129
  ...props2
@@ -42129,12 +42134,48 @@ var createIndustryMarkdownComponents = ({
42129
42134
  fontSize: theme2.fontSizes[3],
42130
42135
  lineHeight: theme2.lineHeights.heading,
42131
42136
  fontWeight: theme2.fontWeights.semibold,
42132
- marginTop: index2 === 0 ? 0 : theme2.space[4],
42137
+ marginTop: theme2.space[4],
42133
42138
  marginBottom: theme2.space[3],
42134
42139
  fontFamily: theme2.fonts.heading
42135
42140
  },
42136
42141
  ...props2
42137
42142
  }, children2),
42143
+ h4: ({ children: children2, ...props2 }) => /* @__PURE__ */ React2__default.createElement("h4", {
42144
+ style: {
42145
+ color: theme2.colors.text,
42146
+ fontSize: theme2.fontSizes[2],
42147
+ lineHeight: theme2.lineHeights.heading,
42148
+ fontWeight: theme2.fontWeights.semibold,
42149
+ marginTop: theme2.space[3],
42150
+ marginBottom: theme2.space[2],
42151
+ fontFamily: theme2.fonts.heading
42152
+ },
42153
+ ...props2
42154
+ }, children2),
42155
+ h5: ({ children: children2, ...props2 }) => /* @__PURE__ */ React2__default.createElement("h5", {
42156
+ style: {
42157
+ color: theme2.colors.text,
42158
+ fontSize: theme2.fontSizes[1],
42159
+ lineHeight: theme2.lineHeights.heading,
42160
+ fontWeight: theme2.fontWeights.semibold,
42161
+ marginTop: theme2.space[3],
42162
+ marginBottom: theme2.space[1],
42163
+ fontFamily: theme2.fonts.heading
42164
+ },
42165
+ ...props2
42166
+ }, children2),
42167
+ h6: ({ children: children2, ...props2 }) => /* @__PURE__ */ React2__default.createElement("h6", {
42168
+ style: {
42169
+ color: theme2.colors.text,
42170
+ fontSize: theme2.fontSizes[1],
42171
+ lineHeight: theme2.lineHeights.heading,
42172
+ fontWeight: theme2.fontWeights.medium,
42173
+ marginTop: theme2.space[3],
42174
+ marginBottom: theme2.space[1],
42175
+ fontFamily: theme2.fonts.heading
42176
+ },
42177
+ ...props2
42178
+ }, children2),
42138
42179
  p: ({ children: children2, ...props2 }) => /* @__PURE__ */ React2__default.createElement("p", {
42139
42180
  style: {
42140
42181
  color: theme2.colors.text,
@@ -42214,19 +42255,20 @@ var createIndustryMarkdownComponents = ({
42214
42255
  checked: isChecked,
42215
42256
  onChange: handleChange,
42216
42257
  onClick: (e) => e.stopPropagation(),
42258
+ disabled: !editable,
42217
42259
  style: {
42218
42260
  marginRight: theme2.space[2],
42219
42261
  marginTop: theme2.space[1],
42220
42262
  width: "16px",
42221
42263
  height: "16px",
42222
- cursor: "pointer"
42264
+ cursor: editable ? "pointer" : "default"
42223
42265
  },
42224
42266
  id
42225
42267
  }), /* @__PURE__ */ React2__default.createElement("label", {
42226
42268
  htmlFor: id,
42227
42269
  style: {
42228
42270
  flex: 1,
42229
- cursor: "pointer",
42271
+ cursor: editable ? "pointer" : "default",
42230
42272
  color: isChecked ? theme2.colors.textMuted : "inherit",
42231
42273
  lineHeight: theme2.lineHeights.relaxed
42232
42274
  }
@@ -42496,7 +42538,7 @@ var createIndustryMarkdownComponents = ({
42496
42538
  }), "Fill & Copy (", placeholders.length, ")"))), isPrompt ? /* @__PURE__ */ React2__default.createElement("div", {
42497
42539
  style: {
42498
42540
  margin: 0,
42499
- padding: theme2.space[5],
42541
+ padding: theme2.space[1],
42500
42542
  backgroundColor: "transparent",
42501
42543
  fontSize: theme2.fontSizes[1],
42502
42544
  lineHeight: theme2.lineHeights.body,
@@ -42523,7 +42565,7 @@ var createIndustryMarkdownComponents = ({
42523
42565
  })) : /* @__PURE__ */ React2__default.createElement("pre", {
42524
42566
  style: {
42525
42567
  margin: 0,
42526
- padding: theme2.space[4],
42568
+ padding: theme2.space[1],
42527
42569
  backgroundColor: "transparent",
42528
42570
  overflow: "auto",
42529
42571
  fontSize: theme2.fontSizes[1],
@@ -43308,7 +43350,8 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
43308
43350
  maxScreenWidth: _maxScreenWidth,
43309
43351
  enableKeyboardScrolling = true,
43310
43352
  keyboardScrollConfig,
43311
- repositoryInfo
43353
+ repositoryInfo,
43354
+ editable = false
43312
43355
  }) {
43313
43356
  const slideRef = useRef(null);
43314
43357
  const scrollPositionsRef = useRef(/* @__PURE__ */ new Map());
@@ -43503,8 +43546,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
43503
43546
  }, [enableKeyboardScrolling, isVisible, slideIndex, scrollConfig]);
43504
43547
  useEffect(() => {
43505
43548
  if (autoFocusOnVisible && isVisible && slideRef.current) {
43506
- console.log("🎯 Auto-focusing slide container");
43507
- slideRef.current.focus();
43549
+ slideRef.current.focus({ preventScroll: true });
43508
43550
  }
43509
43551
  }, [autoFocusOnVisible, isVisible]);
43510
43552
  const openPlaceholderModal = (placeholders, promptContent) => {
@@ -43665,7 +43707,8 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
43665
43707
  enableHtmlPopout,
43666
43708
  slideHeaderMarginTopOverride,
43667
43709
  index: chunkIndex,
43668
- repositoryInfo
43710
+ repositoryInfo,
43711
+ editable
43669
43712
  });
43670
43713
  if (searchQuery) {
43671
43714
  return {
@@ -43698,7 +43741,8 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
43698
43741
  enableHtmlPopout,
43699
43742
  slideHeaderMarginTopOverride,
43700
43743
  repositoryInfo,
43701
- searchQuery
43744
+ searchQuery,
43745
+ editable
43702
43746
  ]);
43703
43747
  return /* @__PURE__ */ React2__default.createElement("div", {
43704
43748
  className: "markdown-slide",
@@ -47497,12 +47541,8 @@ var SlidePresentationBook = ({
47497
47541
  };
47498
47542
  var DocumentView = ({
47499
47543
  content: content2,
47500
- showSegmented = false,
47501
47544
  onCheckboxChange,
47502
- onSectionClick,
47503
47545
  maxWidth = "900px",
47504
- showSectionHeaders = true,
47505
- showSeparators = true,
47506
47546
  slideIdPrefix = "document",
47507
47547
  enableHtmlPopout = true,
47508
47548
  enableKeyboardScrolling = true,
@@ -47513,93 +47553,11 @@ var DocumentView = ({
47513
47553
  repositoryInfo,
47514
47554
  fontSizeScale,
47515
47555
  theme: theme2,
47516
- transparentBackground = false
47556
+ transparentBackground = false,
47557
+ editable = false
47517
47558
  }) => {
47518
47559
  const containerRef = useRef(null);
47519
- const sectionRefs = useRef([]);
47520
47560
  const backgroundColor = transparentBackground ? "transparent" : theme2.colors.background;
47521
- const scrollToSection = useCallback((sectionIndex) => {
47522
- var _a;
47523
- if (sectionRefs.current[sectionIndex]) {
47524
- (_a = sectionRefs.current[sectionIndex]) == null ? void 0 : _a.scrollIntoView({
47525
- behavior: "smooth",
47526
- block: "start"
47527
- });
47528
- }
47529
- }, []);
47530
- const handleSectionClick = useCallback((index2) => {
47531
- scrollToSection(index2);
47532
- onSectionClick == null ? void 0 : onSectionClick(index2);
47533
- }, [scrollToSection, onSectionClick]);
47534
- if (typeof content2 === "string") {
47535
- return /* @__PURE__ */ React2__default.createElement("div", {
47536
- ref: containerRef,
47537
- style: {
47538
- height: "100%",
47539
- overflow: "auto",
47540
- backgroundColor
47541
- }
47542
- }, /* @__PURE__ */ React2__default.createElement("div", {
47543
- style: {
47544
- maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
47545
- margin: "0 auto",
47546
- height: "100%"
47547
- }
47548
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47549
- content: content2,
47550
- slideIdPrefix,
47551
- slideIndex: 0,
47552
- isVisible: true,
47553
- theme: theme2,
47554
- onCheckboxChange,
47555
- enableHtmlPopout,
47556
- enableKeyboardScrolling,
47557
- autoFocusOnVisible,
47558
- onLinkClick,
47559
- handleRunBashCommand,
47560
- fontSizeScale,
47561
- handlePromptCopy,
47562
- repositoryInfo,
47563
- transparentBackground
47564
- })));
47565
- }
47566
- if (!showSegmented) {
47567
- const fullContent = content2.join(`
47568
-
47569
- ---
47570
-
47571
- `);
47572
- return /* @__PURE__ */ React2__default.createElement("div", {
47573
- ref: containerRef,
47574
- style: {
47575
- height: "100%",
47576
- overflow: "auto",
47577
- backgroundColor
47578
- }
47579
- }, /* @__PURE__ */ React2__default.createElement("div", {
47580
- style: {
47581
- maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
47582
- margin: "0 auto",
47583
- height: "100%"
47584
- }
47585
- }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47586
- content: fullContent,
47587
- slideIdPrefix,
47588
- slideIndex: 0,
47589
- isVisible: true,
47590
- theme: theme2,
47591
- onCheckboxChange,
47592
- enableHtmlPopout,
47593
- enableKeyboardScrolling,
47594
- autoFocusOnVisible,
47595
- onLinkClick,
47596
- handleRunBashCommand,
47597
- fontSizeScale,
47598
- handlePromptCopy,
47599
- repositoryInfo,
47600
- transparentBackground
47601
- })));
47602
- }
47603
47561
  return /* @__PURE__ */ React2__default.createElement("div", {
47604
47562
  ref: containerRef,
47605
47563
  style: {
@@ -47610,49 +47568,13 @@ var DocumentView = ({
47610
47568
  }, /* @__PURE__ */ React2__default.createElement("div", {
47611
47569
  style: {
47612
47570
  maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
47613
- margin: "0 auto"
47614
- }
47615
- }, content2.map((slideContent, index2) => /* @__PURE__ */ React2__default.createElement("div", {
47616
- key: index2,
47617
- ref: (el) => {
47618
- if (el)
47619
- sectionRefs.current[index2] = el;
47620
- },
47621
- style: {
47622
- marginBottom: index2 < content2.length - 1 ? "48px" : "0",
47623
- scrollMarginTop: "20px"
47624
- }
47625
- }, showSectionHeaders && /* @__PURE__ */ React2__default.createElement("div", {
47626
- onClick: () => handleSectionClick(index2),
47627
- style: {
47628
- display: "flex",
47629
- alignItems: "center",
47630
- justifyContent: "space-between",
47631
- marginBottom: "16px",
47632
- paddingBottom: "8px",
47633
- borderBottom: `1px solid ${theme2.colors.border}`,
47634
- opacity: 0.7,
47635
- cursor: "pointer",
47636
- transition: "opacity 0.2s ease"
47637
- },
47638
- onMouseOver: (e2) => {
47639
- e2.currentTarget.style.opacity = "1";
47640
- },
47641
- onMouseOut: (e2) => {
47642
- e2.currentTarget.style.opacity = "0.7";
47643
- }
47644
- }, /* @__PURE__ */ React2__default.createElement("span", {
47645
- style: {
47646
- fontSize: "11px",
47647
- fontWeight: 600,
47648
- color: theme2.colors.textSecondary,
47649
- textTransform: "uppercase",
47650
- letterSpacing: "0.5px"
47571
+ margin: "0 auto",
47572
+ height: "100%"
47651
47573
  }
47652
- }, "Section ", index2 + 1, " of ", content2.length)), /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47653
- content: slideContent,
47654
- slideIdPrefix: `${slideIdPrefix}-${index2}`,
47655
- slideIndex: index2,
47574
+ }, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
47575
+ content: content2,
47576
+ slideIdPrefix,
47577
+ slideIndex: 0,
47656
47578
  isVisible: true,
47657
47579
  theme: theme2,
47658
47580
  onCheckboxChange,
@@ -47664,16 +47586,9 @@ var DocumentView = ({
47664
47586
  fontSizeScale,
47665
47587
  handlePromptCopy,
47666
47588
  repositoryInfo,
47667
- transparentBackground
47668
- }), showSeparators && index2 < content2.length - 1 && /* @__PURE__ */ React2__default.createElement("div", {
47669
- style: {
47670
- marginTop: "32px",
47671
- marginBottom: "32px",
47672
- height: "1px",
47673
- backgroundColor: theme2.colors.border,
47674
- opacity: 0.3
47675
- }
47676
- })))));
47589
+ transparentBackground,
47590
+ editable
47591
+ })));
47677
47592
  };
47678
47593
  function parseMarkdownIntoPresentation2(markdownContent, repositoryInfo) {
47679
47594
  return parseMarkdownIntoPresentation(markdownContent, repositoryInfo);