themed-markdown 0.1.74 → 0.1.75

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.
package/dist/index.mjs CHANGED
@@ -3722,8 +3722,7 @@ var IndustryMarkdownSlide = React13.memo(function IndustryMarkdownSlide2({
3722
3722
  }, [enableKeyboardScrolling, isVisible, slideIndex, scrollConfig]);
3723
3723
  useEffect7(() => {
3724
3724
  if (autoFocusOnVisible && isVisible && slideRef.current) {
3725
- console.log("\uD83C\uDFAF Auto-focusing slide container");
3726
- slideRef.current.focus();
3725
+ slideRef.current.focus({ preventScroll: true });
3727
3726
  }
3728
3727
  }, [autoFocusOnVisible, isVisible]);
3729
3728
  const openPlaceholderModal = (placeholders, promptContent) => {
@@ -8820,15 +8819,11 @@ var SlidePresentationBook = ({
8820
8819
  }));
8821
8820
  };
8822
8821
  // industryMarkdown/components/DocumentView.tsx
8823
- import React20, { useRef as useRef12, useCallback as useCallback5 } from "react";
8822
+ import React20, { useRef as useRef12 } from "react";
8824
8823
  var DocumentView = ({
8825
8824
  content,
8826
- showSegmented = false,
8827
8825
  onCheckboxChange,
8828
- onSectionClick,
8829
8826
  maxWidth = "900px",
8830
- showSectionHeaders = true,
8831
- showSeparators = true,
8832
8827
  slideIdPrefix = "document",
8833
8828
  enableHtmlPopout = true,
8834
8829
  enableKeyboardScrolling = true,
@@ -8842,89 +8837,7 @@ var DocumentView = ({
8842
8837
  transparentBackground = false
8843
8838
  }) => {
8844
8839
  const containerRef = useRef12(null);
8845
- const sectionRefs = useRef12([]);
8846
8840
  const backgroundColor = transparentBackground ? "transparent" : theme2.colors.background;
8847
- const scrollToSection = useCallback5((sectionIndex) => {
8848
- if (sectionRefs.current[sectionIndex]) {
8849
- sectionRefs.current[sectionIndex]?.scrollIntoView({
8850
- behavior: "smooth",
8851
- block: "start"
8852
- });
8853
- }
8854
- }, []);
8855
- const handleSectionClick = useCallback5((index) => {
8856
- scrollToSection(index);
8857
- onSectionClick?.(index);
8858
- }, [scrollToSection, onSectionClick]);
8859
- if (typeof content === "string") {
8860
- return /* @__PURE__ */ React20.createElement("div", {
8861
- ref: containerRef,
8862
- style: {
8863
- height: "100%",
8864
- overflow: "auto",
8865
- backgroundColor
8866
- }
8867
- }, /* @__PURE__ */ React20.createElement("div", {
8868
- style: {
8869
- maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
8870
- margin: "0 auto",
8871
- height: "100%"
8872
- }
8873
- }, /* @__PURE__ */ React20.createElement(IndustryMarkdownSlide, {
8874
- content,
8875
- slideIdPrefix,
8876
- slideIndex: 0,
8877
- isVisible: true,
8878
- theme: theme2,
8879
- onCheckboxChange,
8880
- enableHtmlPopout,
8881
- enableKeyboardScrolling,
8882
- autoFocusOnVisible,
8883
- onLinkClick,
8884
- handleRunBashCommand,
8885
- fontSizeScale,
8886
- handlePromptCopy,
8887
- repositoryInfo,
8888
- transparentBackground
8889
- })));
8890
- }
8891
- if (!showSegmented) {
8892
- const fullContent = content.join(`
8893
-
8894
- ---
8895
-
8896
- `);
8897
- return /* @__PURE__ */ React20.createElement("div", {
8898
- ref: containerRef,
8899
- style: {
8900
- height: "100%",
8901
- overflow: "auto",
8902
- backgroundColor
8903
- }
8904
- }, /* @__PURE__ */ React20.createElement("div", {
8905
- style: {
8906
- maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
8907
- margin: "0 auto",
8908
- height: "100%"
8909
- }
8910
- }, /* @__PURE__ */ React20.createElement(IndustryMarkdownSlide, {
8911
- content: fullContent,
8912
- slideIdPrefix,
8913
- slideIndex: 0,
8914
- isVisible: true,
8915
- theme: theme2,
8916
- onCheckboxChange,
8917
- enableHtmlPopout,
8918
- enableKeyboardScrolling,
8919
- autoFocusOnVisible,
8920
- onLinkClick,
8921
- handleRunBashCommand,
8922
- fontSizeScale,
8923
- handlePromptCopy,
8924
- repositoryInfo,
8925
- transparentBackground
8926
- })));
8927
- }
8928
8841
  return /* @__PURE__ */ React20.createElement("div", {
8929
8842
  ref: containerRef,
8930
8843
  style: {
@@ -8935,49 +8848,13 @@ var DocumentView = ({
8935
8848
  }, /* @__PURE__ */ React20.createElement("div", {
8936
8849
  style: {
8937
8850
  maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
8938
- margin: "0 auto"
8939
- }
8940
- }, content.map((slideContent, index) => /* @__PURE__ */ React20.createElement("div", {
8941
- key: index,
8942
- ref: (el) => {
8943
- if (el)
8944
- sectionRefs.current[index] = el;
8945
- },
8946
- style: {
8947
- marginBottom: index < content.length - 1 ? "48px" : "0",
8948
- scrollMarginTop: "20px"
8851
+ margin: "0 auto",
8852
+ height: "100%"
8949
8853
  }
8950
- }, showSectionHeaders && /* @__PURE__ */ React20.createElement("div", {
8951
- onClick: () => handleSectionClick(index),
8952
- style: {
8953
- display: "flex",
8954
- alignItems: "center",
8955
- justifyContent: "space-between",
8956
- marginBottom: "16px",
8957
- paddingBottom: "8px",
8958
- borderBottom: `1px solid ${theme2.colors.border}`,
8959
- opacity: 0.7,
8960
- cursor: "pointer",
8961
- transition: "opacity 0.2s ease"
8962
- },
8963
- onMouseOver: (e2) => {
8964
- e2.currentTarget.style.opacity = "1";
8965
- },
8966
- onMouseOut: (e2) => {
8967
- e2.currentTarget.style.opacity = "0.7";
8968
- }
8969
- }, /* @__PURE__ */ React20.createElement("span", {
8970
- style: {
8971
- fontSize: "11px",
8972
- fontWeight: 600,
8973
- color: theme2.colors.textSecondary,
8974
- textTransform: "uppercase",
8975
- letterSpacing: "0.5px"
8976
- }
8977
- }, "Section ", index + 1, " of ", content.length)), /* @__PURE__ */ React20.createElement(IndustryMarkdownSlide, {
8978
- content: slideContent,
8979
- slideIdPrefix: `${slideIdPrefix}-${index}`,
8980
- slideIndex: index,
8854
+ }, /* @__PURE__ */ React20.createElement(IndustryMarkdownSlide, {
8855
+ content,
8856
+ slideIdPrefix,
8857
+ slideIndex: 0,
8981
8858
  isVisible: true,
8982
8859
  theme: theme2,
8983
8860
  onCheckboxChange,
@@ -8990,15 +8867,7 @@ var DocumentView = ({
8990
8867
  handlePromptCopy,
8991
8868
  repositoryInfo,
8992
8869
  transparentBackground
8993
- }), showSeparators && index < content.length - 1 && /* @__PURE__ */ React20.createElement("div", {
8994
- style: {
8995
- marginTop: "32px",
8996
- marginBottom: "32px",
8997
- height: "1px",
8998
- backgroundColor: theme2.colors.border,
8999
- opacity: 0.3
9000
- }
9001
- })))));
8870
+ })));
9002
8871
  };
9003
8872
  // industryMarkdown/utils/presentationUtils.ts
9004
8873
  var extractSlideTitle3 = extractSlideTitle;
@@ -2,13 +2,9 @@ import { Theme } from '@principal-ade/industry-theme';
2
2
  import { BashCommandOptions, BashCommandResult, RepositoryInfo } from '@principal-ade/markdown-utils';
3
3
  import React from 'react';
4
4
  export interface DocumentViewProps {
5
- content: string | string[];
6
- showSegmented?: boolean;
5
+ content: string;
7
6
  onCheckboxChange?: (slideIndex: number, lineNumber: number, checked: boolean) => void;
8
- onSectionClick?: (sectionIndex: number) => void;
9
7
  maxWidth?: string | number;
10
- showSectionHeaders?: boolean;
11
- showSeparators?: boolean;
12
8
  slideIdPrefix?: string;
13
9
  enableHtmlPopout?: boolean;
14
10
  enableKeyboardScrolling?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentView.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/DocumentView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,iBAAiB;IAEhC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAG3B,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO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UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAGtF,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAG3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzD,oBAAoB,CAAC,EAAE,CACrB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,KACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,gBAAgB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuDpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "themed-markdown",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "description": "Industry-themed markdown renderer with presentation capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",