@industry-theme/markdown-panels 0.2.8 → 0.2.9

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,CA6UvD,CAAC"}
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,CA+UvD,CAAC"}
@@ -101,6 +101,23 @@ const createLucideIcon = (iconName, iconNode) => {
101
101
  Component.displayName = toPascalCase(iconName);
102
102
  return Component;
103
103
  };
104
+ /**
105
+ * @license lucide-react v0.552.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */
110
+ const __iconNode$l = [
111
+ ["path", { d: "M12 7v14", key: "1akyts" }],
112
+ [
113
+ "path",
114
+ {
115
+ d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
116
+ key: "ruj8y"
117
+ }
118
+ ]
119
+ ];
120
+ const BookOpen = createLucideIcon("book-open", __iconNode$l);
104
121
  /**
105
122
  * @license lucide-react v0.552.0 - ISC
106
123
  *
@@ -47746,6 +47763,15 @@ const MarkdownPanel = ({
47746
47763
  const [viewMode, setViewMode] = useState("book");
47747
47764
  const [currentSlide, setCurrentSlide] = useState(0);
47748
47765
  const [fontSizeScale, setFontSizeScale] = useState(1);
47766
+ const [isMobile, setIsMobile] = useState(false);
47767
+ useEffect(() => {
47768
+ const checkMobile = () => {
47769
+ setIsMobile(window.innerWidth < 768);
47770
+ };
47771
+ checkMobile();
47772
+ window.addEventListener("resize", checkMobile);
47773
+ return () => window.removeEventListener("resize", checkMobile);
47774
+ }, []);
47749
47775
  useEffect(() => {
47750
47776
  const unsubscribe = events.on("file:opened", (event) => {
47751
47777
  console.log("Markdown Panel: File opened:", event.payload);
@@ -47824,8 +47850,6 @@ const MarkdownPanel = ({
47824
47850
  }
47825
47851
  );
47826
47852
  }
47827
- const sourceInfo = activeFile.data.source;
47828
- const sourceLabel = sourceInfo.type === "local" ? `Local: ${sourceInfo.name}` : `${sourceInfo.provider}: ${sourceInfo.owner}/${sourceInfo.name}@${sourceInfo.location}`;
47829
47853
  return /* @__PURE__ */ jsxs(
47830
47854
  "div",
47831
47855
  {
@@ -47854,77 +47878,76 @@ const MarkdownPanel = ({
47854
47878
  gap: "12px"
47855
47879
  },
47856
47880
  children: [
47881
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ jsx(
47882
+ "span",
47883
+ {
47884
+ style: {
47885
+ fontSize: "14px",
47886
+ fontWeight: 600,
47887
+ color: theme2.colors.text,
47888
+ fontFamily: theme2.fonts.body
47889
+ },
47890
+ children: basename(activeFile.data.path)
47891
+ }
47892
+ ) }),
47857
47893
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
47858
- /* @__PURE__ */ jsx(FileText, { size: 20, color: theme2.colors.primary }),
47859
- /* @__PURE__ */ jsx(
47860
- "span",
47861
- {
47862
- style: {
47863
- fontSize: "14px",
47864
- fontWeight: 600,
47865
- color: theme2.colors.text,
47866
- fontFamily: theme2.fonts.body
47867
- },
47868
- children: basename(activeFile.data.path)
47869
- }
47870
- )
47871
- ] }),
47872
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
47873
- /* @__PURE__ */ jsx(
47874
- "button",
47875
- {
47876
- onClick: handleFontSizeDecrease,
47877
- title: "Decrease Font Size",
47878
- style: {
47879
- background: "none",
47880
- border: `1px solid ${theme2.colors.border}`,
47881
- padding: "6px 8px",
47882
- cursor: "pointer",
47883
- display: "flex",
47884
- alignItems: "center",
47885
- color: theme2.colors.textSecondary,
47886
- borderRadius: "4px",
47887
- transition: "all 0.2s"
47888
- },
47889
- children: /* @__PURE__ */ jsx(Minus, { size: 14 })
47890
- }
47891
- ),
47892
- /* @__PURE__ */ jsxs(
47893
- "span",
47894
- {
47895
- style: {
47896
- fontSize: "12px",
47897
- color: theme2.colors.textSecondary,
47898
- userSelect: "none",
47899
- minWidth: "45px",
47900
- textAlign: "center",
47901
- fontFamily: theme2.fonts.body
47902
- },
47903
- children: [
47904
- Math.round(fontSizeScale * 100),
47905
- "%"
47906
- ]
47907
- }
47908
- ),
47909
- /* @__PURE__ */ jsx(
47910
- "button",
47911
- {
47912
- onClick: handleFontSizeIncrease,
47913
- title: "Increase Font Size",
47914
- style: {
47915
- background: "none",
47916
- border: `1px solid ${theme2.colors.border}`,
47917
- padding: "6px 8px",
47918
- cursor: "pointer",
47919
- display: "flex",
47920
- alignItems: "center",
47921
- color: theme2.colors.textSecondary,
47922
- borderRadius: "4px",
47923
- transition: "all 0.2s"
47924
- },
47925
- children: /* @__PURE__ */ jsx(Plus, { size: 14 })
47926
- }
47927
- ),
47894
+ !isMobile && /* @__PURE__ */ jsxs(Fragment, { children: [
47895
+ /* @__PURE__ */ jsx(
47896
+ "button",
47897
+ {
47898
+ onClick: handleFontSizeDecrease,
47899
+ title: "Decrease Font Size",
47900
+ style: {
47901
+ background: "none",
47902
+ border: `1px solid ${theme2.colors.border}`,
47903
+ padding: "6px 8px",
47904
+ cursor: "pointer",
47905
+ display: "flex",
47906
+ alignItems: "center",
47907
+ color: theme2.colors.textSecondary,
47908
+ borderRadius: "4px",
47909
+ transition: "all 0.2s"
47910
+ },
47911
+ children: /* @__PURE__ */ jsx(Minus, { size: 14 })
47912
+ }
47913
+ ),
47914
+ /* @__PURE__ */ jsxs(
47915
+ "span",
47916
+ {
47917
+ style: {
47918
+ fontSize: "12px",
47919
+ color: theme2.colors.textSecondary,
47920
+ userSelect: "none",
47921
+ minWidth: "45px",
47922
+ textAlign: "center",
47923
+ fontFamily: theme2.fonts.body
47924
+ },
47925
+ children: [
47926
+ Math.round(fontSizeScale * 100),
47927
+ "%"
47928
+ ]
47929
+ }
47930
+ ),
47931
+ /* @__PURE__ */ jsx(
47932
+ "button",
47933
+ {
47934
+ onClick: handleFontSizeIncrease,
47935
+ title: "Increase Font Size",
47936
+ style: {
47937
+ background: "none",
47938
+ border: `1px solid ${theme2.colors.border}`,
47939
+ padding: "6px 8px",
47940
+ cursor: "pointer",
47941
+ display: "flex",
47942
+ alignItems: "center",
47943
+ color: theme2.colors.textSecondary,
47944
+ borderRadius: "4px",
47945
+ transition: "all 0.2s"
47946
+ },
47947
+ children: /* @__PURE__ */ jsx(Plus, { size: 14 })
47948
+ }
47949
+ )
47950
+ ] }),
47928
47951
  hasSlides && /* @__PURE__ */ jsxs(
47929
47952
  "div",
47930
47953
  {
@@ -47934,7 +47957,7 @@ const MarkdownPanel = ({
47934
47957
  borderRadius: "4px",
47935
47958
  border: `1px solid ${theme2.colors.border}`,
47936
47959
  overflow: "hidden",
47937
- marginLeft: "8px"
47960
+ marginLeft: isMobile ? "0" : "8px"
47938
47961
  },
47939
47962
  children: [
47940
47963
  /* @__PURE__ */ jsx(
@@ -47944,18 +47967,22 @@ const MarkdownPanel = ({
47944
47967
  setViewMode("book");
47945
47968
  setCurrentSlide(0);
47946
47969
  },
47970
+ title: "Sections",
47947
47971
  style: {
47948
47972
  background: viewMode === "book" ? theme2.colors.primary : "transparent",
47949
47973
  color: viewMode === "book" ? theme2.colors.background : theme2.colors.textSecondary,
47950
47974
  border: "none",
47951
- padding: "6px 12px",
47975
+ padding: isMobile ? "6px 8px" : "6px 12px",
47952
47976
  cursor: "pointer",
47953
47977
  fontSize: "12px",
47954
47978
  fontWeight: 500,
47955
47979
  fontFamily: theme2.fonts.body,
47956
- transition: "all 0.2s"
47980
+ transition: "all 0.2s",
47981
+ display: "flex",
47982
+ alignItems: "center",
47983
+ gap: "4px"
47957
47984
  },
47958
- children: "Sections"
47985
+ children: isMobile ? /* @__PURE__ */ jsx(BookOpen, { size: 16 }) : "Sections"
47959
47986
  }
47960
47987
  ),
47961
47988
  /* @__PURE__ */ jsx(
@@ -47965,18 +47992,22 @@ const MarkdownPanel = ({
47965
47992
  setViewMode("document");
47966
47993
  setCurrentSlide(0);
47967
47994
  },
47995
+ title: "Document",
47968
47996
  style: {
47969
47997
  background: viewMode === "document" ? theme2.colors.primary : "transparent",
47970
47998
  color: viewMode === "document" ? theme2.colors.background : theme2.colors.textSecondary,
47971
47999
  border: "none",
47972
- padding: "6px 12px",
48000
+ padding: isMobile ? "6px 8px" : "6px 12px",
47973
48001
  cursor: "pointer",
47974
48002
  fontSize: "12px",
47975
48003
  fontWeight: 500,
47976
48004
  fontFamily: theme2.fonts.body,
47977
- transition: "all 0.2s"
48005
+ transition: "all 0.2s",
48006
+ display: "flex",
48007
+ alignItems: "center",
48008
+ gap: "4px"
47978
48009
  },
47979
- children: "Document"
48010
+ children: isMobile ? /* @__PURE__ */ jsx(FileText, { size: 16 }) : "Document"
47980
48011
  }
47981
48012
  )
47982
48013
  ]
@@ -47986,23 +48017,6 @@ const MarkdownPanel = ({
47986
48017
  ]
47987
48018
  }
47988
48019
  ),
47989
- /* @__PURE__ */ jsxs(
47990
- "div",
47991
- {
47992
- style: {
47993
- padding: "8px 16px",
47994
- backgroundColor: theme2.colors.backgroundSecondary,
47995
- borderBottom: `1px solid ${theme2.colors.border}`,
47996
- fontSize: "12px",
47997
- color: theme2.colors.textSecondary,
47998
- fontFamily: theme2.fonts.body
47999
- },
48000
- children: [
48001
- "Source: ",
48002
- /* @__PURE__ */ jsx("code", { children: sourceLabel })
48003
- ]
48004
- }
48005
- ),
48006
48020
  /* @__PURE__ */ jsx(
48007
48021
  "div",
48008
48022
  {