@industry-theme/markdown-panels 0.2.7 → 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
  *
@@ -46237,6 +46254,7 @@ var SlideNavigationHeader = ({
46237
46254
  showFullscreenButton,
46238
46255
  showPopoutButton = false,
46239
46256
  isPopout = false,
46257
+ isMobile = false,
46240
46258
  theme: theme2,
46241
46259
  viewMode = "single",
46242
46260
  tocDisplayMode = "overlay",
@@ -46282,10 +46300,11 @@ var SlideNavigationHeader = ({
46282
46300
  disabled: currentSlide === 0,
46283
46301
  theme: theme2,
46284
46302
  title: "Previous slide",
46285
- minWidth: "100px"
46303
+ minWidth: isMobile ? void 0 : "100px",
46304
+ width: isMobile ? "36px" : void 0
46286
46305
  }, /* @__PURE__ */ React19__default.createElement(ChevronLeft, {
46287
46306
  size: 18
46288
- }), "Previous"), viewMode === "book" && onCollapseLeft && /* @__PURE__ */ React19__default.createElement(HeaderButton, {
46307
+ }), !isMobile && "Previous"), viewMode === "book" && onCollapseLeft && /* @__PURE__ */ React19__default.createElement(HeaderButton, {
46289
46308
  onClick: onCollapseLeft,
46290
46309
  active: collapseRight,
46291
46310
  theme: theme2,
@@ -46340,8 +46359,9 @@ var SlideNavigationHeader = ({
46340
46359
  disabled: currentSlide === totalSlides - 1,
46341
46360
  theme: theme2,
46342
46361
  title: "Next slide",
46343
- minWidth: "100px"
46344
- }, "Next", /* @__PURE__ */ React19__default.createElement(ChevronRight, {
46362
+ minWidth: isMobile ? void 0 : "100px",
46363
+ width: isMobile ? "36px" : void 0
46364
+ }, !isMobile && "Next", /* @__PURE__ */ React19__default.createElement(ChevronRight, {
46345
46365
  size: 18
46346
46366
  })), showPopoutButton && onPopout && !isPopout && /* @__PURE__ */ React19__default.createElement(HeaderButton, {
46347
46367
  onClick: onPopout,
@@ -46357,8 +46377,9 @@ var SlideNavigationHeader = ({
46357
46377
  size: 18
46358
46378
  })), showFullscreenButton && !showPopoutButton && /* @__PURE__ */ React19__default.createElement(HeaderButton, {
46359
46379
  onClick: onToggleFullscreen,
46380
+ disabled: isMobile,
46360
46381
  theme: theme2,
46361
- title: isFullscreen ? "Exit fullscreen (F)" : "Enter fullscreen (F)"
46382
+ title: isMobile ? "Fullscreen not available on mobile" : isFullscreen ? "Exit fullscreen (F)" : "Enter fullscreen (F)"
46362
46383
  }, isFullscreen ? /* @__PURE__ */ React19__default.createElement(Minimize2, {
46363
46384
  size: 18
46364
46385
  }) : /* @__PURE__ */ React19__default.createElement(Maximize2, {
@@ -46580,7 +46601,16 @@ var SlidePresentationBook = ({
46580
46601
  fontSizeScale,
46581
46602
  theme: theme2
46582
46603
  }) => {
46583
- const effectiveTocDisplayMode = tocDisplayMode ?? (viewMode === "single" ? "sidebar" : "overlay");
46604
+ const [isMobile, setIsMobile] = useState(false);
46605
+ useEffect(() => {
46606
+ const checkMobile = () => {
46607
+ setIsMobile(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent) || window.innerWidth < 768);
46608
+ };
46609
+ checkMobile();
46610
+ window.addEventListener("resize", checkMobile);
46611
+ return () => window.removeEventListener("resize", checkMobile);
46612
+ }, []);
46613
+ const effectiveTocDisplayMode = isMobile && viewMode === "single" ? "overlay" : tocDisplayMode ?? (viewMode === "single" ? "sidebar" : "overlay");
46584
46614
  const defaultTocOpen = initialTocOpen ?? false;
46585
46615
  const adjustedInitialSlide = viewMode === "book" ? Math.floor(initialSlide / 2) * 2 : initialSlide;
46586
46616
  const [currentSlide, setCurrentSlide] = useState(adjustedInitialSlide);
@@ -46831,6 +46861,7 @@ var SlidePresentationBook = ({
46831
46861
  showFullscreenButton,
46832
46862
  showPopoutButton,
46833
46863
  isPopout,
46864
+ isMobile,
46834
46865
  theme: theme2,
46835
46866
  viewMode,
46836
46867
  tocDisplayMode: effectiveTocDisplayMode,
@@ -47732,6 +47763,15 @@ const MarkdownPanel = ({
47732
47763
  const [viewMode, setViewMode] = useState("book");
47733
47764
  const [currentSlide, setCurrentSlide] = useState(0);
47734
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
+ }, []);
47735
47775
  useEffect(() => {
47736
47776
  const unsubscribe = events.on("file:opened", (event) => {
47737
47777
  console.log("Markdown Panel: File opened:", event.payload);
@@ -47810,8 +47850,6 @@ const MarkdownPanel = ({
47810
47850
  }
47811
47851
  );
47812
47852
  }
47813
- const sourceInfo = activeFile.data.source;
47814
- const sourceLabel = sourceInfo.type === "local" ? `Local: ${sourceInfo.name}` : `${sourceInfo.provider}: ${sourceInfo.owner}/${sourceInfo.name}@${sourceInfo.location}`;
47815
47853
  return /* @__PURE__ */ jsxs(
47816
47854
  "div",
47817
47855
  {
@@ -47840,77 +47878,76 @@ const MarkdownPanel = ({
47840
47878
  gap: "12px"
47841
47879
  },
47842
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
+ ) }),
47843
47893
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
47844
- /* @__PURE__ */ jsx(FileText, { size: 20, color: theme2.colors.primary }),
47845
- /* @__PURE__ */ jsx(
47846
- "span",
47847
- {
47848
- style: {
47849
- fontSize: "14px",
47850
- fontWeight: 600,
47851
- color: theme2.colors.text,
47852
- fontFamily: theme2.fonts.body
47853
- },
47854
- children: basename(activeFile.data.path)
47855
- }
47856
- )
47857
- ] }),
47858
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
47859
- /* @__PURE__ */ jsx(
47860
- "button",
47861
- {
47862
- onClick: handleFontSizeDecrease,
47863
- title: "Decrease Font Size",
47864
- style: {
47865
- background: "none",
47866
- border: `1px solid ${theme2.colors.border}`,
47867
- padding: "6px 8px",
47868
- cursor: "pointer",
47869
- display: "flex",
47870
- alignItems: "center",
47871
- color: theme2.colors.textSecondary,
47872
- borderRadius: "4px",
47873
- transition: "all 0.2s"
47874
- },
47875
- children: /* @__PURE__ */ jsx(Minus, { size: 14 })
47876
- }
47877
- ),
47878
- /* @__PURE__ */ jsxs(
47879
- "span",
47880
- {
47881
- style: {
47882
- fontSize: "12px",
47883
- color: theme2.colors.textSecondary,
47884
- userSelect: "none",
47885
- minWidth: "45px",
47886
- textAlign: "center",
47887
- fontFamily: theme2.fonts.body
47888
- },
47889
- children: [
47890
- Math.round(fontSizeScale * 100),
47891
- "%"
47892
- ]
47893
- }
47894
- ),
47895
- /* @__PURE__ */ jsx(
47896
- "button",
47897
- {
47898
- onClick: handleFontSizeIncrease,
47899
- title: "Increase 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(Plus, { size: 14 })
47912
- }
47913
- ),
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
+ ] }),
47914
47951
  hasSlides && /* @__PURE__ */ jsxs(
47915
47952
  "div",
47916
47953
  {
@@ -47920,7 +47957,7 @@ const MarkdownPanel = ({
47920
47957
  borderRadius: "4px",
47921
47958
  border: `1px solid ${theme2.colors.border}`,
47922
47959
  overflow: "hidden",
47923
- marginLeft: "8px"
47960
+ marginLeft: isMobile ? "0" : "8px"
47924
47961
  },
47925
47962
  children: [
47926
47963
  /* @__PURE__ */ jsx(
@@ -47930,18 +47967,22 @@ const MarkdownPanel = ({
47930
47967
  setViewMode("book");
47931
47968
  setCurrentSlide(0);
47932
47969
  },
47970
+ title: "Sections",
47933
47971
  style: {
47934
47972
  background: viewMode === "book" ? theme2.colors.primary : "transparent",
47935
47973
  color: viewMode === "book" ? theme2.colors.background : theme2.colors.textSecondary,
47936
47974
  border: "none",
47937
- padding: "6px 12px",
47975
+ padding: isMobile ? "6px 8px" : "6px 12px",
47938
47976
  cursor: "pointer",
47939
47977
  fontSize: "12px",
47940
47978
  fontWeight: 500,
47941
47979
  fontFamily: theme2.fonts.body,
47942
- transition: "all 0.2s"
47980
+ transition: "all 0.2s",
47981
+ display: "flex",
47982
+ alignItems: "center",
47983
+ gap: "4px"
47943
47984
  },
47944
- children: "Sections"
47985
+ children: isMobile ? /* @__PURE__ */ jsx(BookOpen, { size: 16 }) : "Sections"
47945
47986
  }
47946
47987
  ),
47947
47988
  /* @__PURE__ */ jsx(
@@ -47951,18 +47992,22 @@ const MarkdownPanel = ({
47951
47992
  setViewMode("document");
47952
47993
  setCurrentSlide(0);
47953
47994
  },
47995
+ title: "Document",
47954
47996
  style: {
47955
47997
  background: viewMode === "document" ? theme2.colors.primary : "transparent",
47956
47998
  color: viewMode === "document" ? theme2.colors.background : theme2.colors.textSecondary,
47957
47999
  border: "none",
47958
- padding: "6px 12px",
48000
+ padding: isMobile ? "6px 8px" : "6px 12px",
47959
48001
  cursor: "pointer",
47960
48002
  fontSize: "12px",
47961
48003
  fontWeight: 500,
47962
48004
  fontFamily: theme2.fonts.body,
47963
- transition: "all 0.2s"
48005
+ transition: "all 0.2s",
48006
+ display: "flex",
48007
+ alignItems: "center",
48008
+ gap: "4px"
47964
48009
  },
47965
- children: "Document"
48010
+ children: isMobile ? /* @__PURE__ */ jsx(FileText, { size: 16 }) : "Document"
47966
48011
  }
47967
48012
  )
47968
48013
  ]
@@ -47972,23 +48017,6 @@ const MarkdownPanel = ({
47972
48017
  ]
47973
48018
  }
47974
48019
  ),
47975
- /* @__PURE__ */ jsxs(
47976
- "div",
47977
- {
47978
- style: {
47979
- padding: "8px 16px",
47980
- backgroundColor: theme2.colors.backgroundSecondary,
47981
- borderBottom: `1px solid ${theme2.colors.border}`,
47982
- fontSize: "12px",
47983
- color: theme2.colors.textSecondary,
47984
- fontFamily: theme2.fonts.body
47985
- },
47986
- children: [
47987
- "Source: ",
47988
- /* @__PURE__ */ jsx("code", { children: sourceLabel })
47989
- ]
47990
- }
47991
- ),
47992
48020
  /* @__PURE__ */ jsx(
47993
48021
  "div",
47994
48022
  {