@tomehq/theme 0.5.0 → 0.6.1

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.
@@ -1096,8 +1096,8 @@ function Shell({
1096
1096
  }, []);
1097
1097
  const allNavPages = navigation2.flatMap((g) => g.pages);
1098
1098
  const idx = allNavPages.findIndex((p) => p.id === currentPageId);
1099
- const prev = idx > 0 ? allNavPages[idx - 1] : null;
1100
- const next = idx < allNavPages.length - 1 ? allNavPages[idx + 1] : null;
1099
+ const prev = idx > 0 ? allNavPages[idx - 1] : allNavPages[allNavPages.length - 1] ?? null;
1100
+ const next = idx < allNavPages.length - 1 ? allNavPages[idx + 1] : allNavPages[0] ?? null;
1101
1101
  const breadcrumbs = getBreadcrumbs(navigation2, currentPageId, pageTitle);
1102
1102
  const togSec = (s) => setExpanded((p) => p.includes(s) ? p.filter((x) => x !== s) : [...p, s]);
1103
1103
  const cssVars = {
@@ -1697,7 +1697,7 @@ function Shell({
1697
1697
  currentPageId
1698
1698
  )
1699
1699
  ) }),
1700
- overrides2?.PageFooter ? /* @__PURE__ */ jsx2(
1700
+ !pageHtml && !pageComponent ? null : overrides2?.PageFooter ? /* @__PURE__ */ jsx2(
1701
1701
  overrides2.PageFooter,
1702
1702
  {
1703
1703
  editUrl,
@@ -1774,43 +1774,79 @@ function Shell({
1774
1774
  transition: "border-color .15s"
1775
1775
  }, children: "\u{1F44E}" })
1776
1776
  ] }) }),
1777
- /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: mobile ? "column" : "row", justifyContent: "space-between", marginTop: 16, paddingTop: 24, borderTop: "1px solid var(--bd)", gap: mobile ? 12 : 16 }, children: [
1778
- prev ? /* @__PURE__ */ jsxs2("button", { onClick: () => onNavigate(prev.id), style: {
1779
- display: "flex",
1780
- alignItems: "center",
1781
- gap: 8,
1782
- background: "none",
1783
- border: "1px solid var(--bd)",
1784
- borderRadius: 2,
1785
- padding: "10px 16px",
1786
- cursor: "pointer",
1787
- color: "var(--tx2)",
1788
- fontSize: 13,
1789
- fontFamily: "var(--font-body)",
1790
- transition: "border-color .15s, color .15s"
1791
- }, children: [
1792
- isRtl ? /* @__PURE__ */ jsx2(ArrowRight, {}) : /* @__PURE__ */ jsx2(ArrowLeft, {}),
1793
- " ",
1794
- prev.title
1795
- ] }) : /* @__PURE__ */ jsx2("div", {}),
1796
- next ? /* @__PURE__ */ jsxs2("button", { onClick: () => onNavigate(next.id), style: {
1797
- display: "flex",
1798
- alignItems: "center",
1799
- gap: 8,
1800
- background: "none",
1801
- border: "1px solid var(--bd)",
1802
- borderRadius: 2,
1803
- padding: "10px 16px",
1804
- cursor: "pointer",
1805
- color: "var(--tx2)",
1806
- fontSize: 13,
1807
- fontFamily: "var(--font-body)",
1808
- transition: "border-color .15s, color .15s"
1809
- }, children: [
1810
- next.title,
1811
- " ",
1812
- isRtl ? /* @__PURE__ */ jsx2(ArrowLeft, {}) : /* @__PURE__ */ jsx2(ArrowRight, {})
1813
- ] }) : /* @__PURE__ */ jsx2("div", {})
1777
+ /* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridTemplateColumns: mobile ? "1fr" : "1fr 1fr", marginTop: 24, paddingTop: 32, paddingBottom: 40, borderTop: "1px solid var(--bd)", gap: 16 }, children: [
1778
+ prev ? /* @__PURE__ */ jsxs2(
1779
+ "button",
1780
+ {
1781
+ onClick: () => onNavigate(prev.id),
1782
+ style: {
1783
+ display: "flex",
1784
+ flexDirection: "column",
1785
+ alignItems: "flex-start",
1786
+ gap: 6,
1787
+ background: "var(--sf)",
1788
+ border: "1px solid var(--bd)",
1789
+ borderRadius: 8,
1790
+ padding: "16px 20px",
1791
+ cursor: "pointer",
1792
+ textAlign: "left",
1793
+ fontFamily: "var(--font-body)",
1794
+ transition: "all .3s ease",
1795
+ boxShadow: "0 2px 8px rgba(0,0,0,0.06)"
1796
+ },
1797
+ onMouseOver: (e) => {
1798
+ e.currentTarget.style.borderColor = "var(--ac)";
1799
+ e.currentTarget.style.boxShadow = "0 4px 16px rgba(0,0,0,0.1)";
1800
+ },
1801
+ onMouseOut: (e) => {
1802
+ e.currentTarget.style.borderColor = "var(--bd)";
1803
+ e.currentTarget.style.boxShadow = "0 2px 8px rgba(0,0,0,0.06)";
1804
+ },
1805
+ children: [
1806
+ /* @__PURE__ */ jsxs2("span", { style: { fontSize: 11, color: "var(--txM)", textTransform: "uppercase", letterSpacing: "0.5px", display: "flex", alignItems: "center", gap: 4 }, children: [
1807
+ isRtl ? /* @__PURE__ */ jsx2(ArrowRight, {}) : /* @__PURE__ */ jsx2(ArrowLeft, {}),
1808
+ " Previous"
1809
+ ] }),
1810
+ /* @__PURE__ */ jsx2("span", { style: { fontSize: 14, fontWeight: 500, color: "var(--tx)" }, children: prev.title })
1811
+ ]
1812
+ }
1813
+ ) : /* @__PURE__ */ jsx2("div", {}),
1814
+ next ? /* @__PURE__ */ jsxs2(
1815
+ "button",
1816
+ {
1817
+ onClick: () => onNavigate(next.id),
1818
+ style: {
1819
+ display: "flex",
1820
+ flexDirection: "column",
1821
+ alignItems: "flex-end",
1822
+ gap: 6,
1823
+ background: "var(--sf)",
1824
+ border: "1px solid var(--bd)",
1825
+ borderRadius: 8,
1826
+ padding: "16px 20px",
1827
+ cursor: "pointer",
1828
+ textAlign: "right",
1829
+ fontFamily: "var(--font-body)",
1830
+ transition: "all .3s ease",
1831
+ boxShadow: "0 2px 8px rgba(0,0,0,0.06)"
1832
+ },
1833
+ onMouseOver: (e) => {
1834
+ e.currentTarget.style.borderColor = "var(--ac)";
1835
+ e.currentTarget.style.boxShadow = "0 4px 16px rgba(0,0,0,0.1)";
1836
+ },
1837
+ onMouseOut: (e) => {
1838
+ e.currentTarget.style.borderColor = "var(--bd)";
1839
+ e.currentTarget.style.boxShadow = "0 2px 8px rgba(0,0,0,0.06)";
1840
+ },
1841
+ children: [
1842
+ /* @__PURE__ */ jsxs2("span", { style: { fontSize: 11, color: "var(--txM)", textTransform: "uppercase", letterSpacing: "0.5px", display: "flex", alignItems: "center", gap: 4 }, children: [
1843
+ "Next ",
1844
+ isRtl ? /* @__PURE__ */ jsx2(ArrowLeft, {}) : /* @__PURE__ */ jsx2(ArrowRight, {})
1845
+ ] }),
1846
+ /* @__PURE__ */ jsx2("span", { style: { fontSize: 14, fontWeight: 500, color: "var(--tx)" }, children: next.title })
1847
+ ]
1848
+ }
1849
+ ) : /* @__PURE__ */ jsx2("div", {})
1814
1850
  ] })
1815
1851
  ] })
1816
1852
  ] }),
package/dist/entry.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  entry_default
3
- } from "./chunk-FIUZY65C.js";
3
+ } from "./chunk-NIWVZJLG.js";
4
4
  export {
5
5
  entry_default as default
6
6
  };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Shell,
4
4
  THEME_PRESETS,
5
5
  entry_default
6
- } from "./chunk-FIUZY65C.js";
6
+ } from "./chunk-NIWVZJLG.js";
7
7
  export {
8
8
  AiChat,
9
9
  entry_default as App,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomehq/theme",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Tome default theme and React app shell",
5
5
  "type": "module",
6
6
  "main": "./src/index.tsx",
@@ -9,8 +9,8 @@
9
9
  "./entry": "./src/entry.tsx"
10
10
  },
11
11
  "dependencies": {
12
- "@tomehq/components": "0.5.0",
13
- "@tomehq/core": "0.5.0"
12
+ "@tomehq/components": "0.6.1",
13
+ "@tomehq/core": "0.6.1"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "react": "^18.0.0 || ^19.0.0",
package/src/Shell.tsx CHANGED
@@ -643,8 +643,8 @@ export function Shell({
643
643
  // Prev / Next
644
644
  const allNavPages = navigation.flatMap(g => g.pages);
645
645
  const idx = allNavPages.findIndex(p => p.id === currentPageId);
646
- const prev = idx > 0 ? allNavPages[idx - 1] : null;
647
- const next = idx < allNavPages.length - 1 ? allNavPages[idx + 1] : null;
646
+ const prev = idx > 0 ? allNavPages[idx - 1] : allNavPages[allNavPages.length - 1] ?? null;
647
+ const next = idx < allNavPages.length - 1 ? allNavPages[idx + 1] : allNavPages[0] ?? null;
648
648
 
649
649
  // Breadcrumbs
650
650
  const breadcrumbs = getBreadcrumbs(navigation, currentPageId, pageTitle);
@@ -1186,7 +1186,7 @@ export function Shell({
1186
1186
  </div>
1187
1187
 
1188
1188
  {/* TOM-48: Edit this page link + TOM-54: Last updated + Feedback + Prev/Next */}
1189
- {overrides?.PageFooter ? (
1189
+ {!pageHtml && !pageComponent ? null : overrides?.PageFooter ? (
1190
1190
  <overrides.PageFooter
1191
1191
  editUrl={editUrl}
1192
1192
  lastUpdated={lastUpdated}
@@ -1243,23 +1243,41 @@ export function Shell({
1243
1243
  )}
1244
1244
  </div>
1245
1245
 
1246
- {/* Prev / Next */}
1247
- <div style={{ display: "flex", flexDirection: mobile ? "column" : "row", justifyContent: "space-between", marginTop: 16, paddingTop: 24, borderTop: "1px solid var(--bd)", gap: mobile ? 12 : 16 }}>
1246
+ {/* Prev / Next link cards */}
1247
+ <div style={{ display: "grid", gridTemplateColumns: mobile ? "1fr" : "1fr 1fr", marginTop: 24, paddingTop: 32, paddingBottom: 40, borderTop: "1px solid var(--bd)", gap: 16 }}>
1248
1248
  {prev ? (
1249
1249
  <button onClick={() => onNavigate(prev.id)} style={{
1250
- display: "flex", alignItems: "center", gap: 8, background: "none",
1251
- border: "1px solid var(--bd)", borderRadius: 2, padding: "10px 16px",
1252
- cursor: "pointer", color: "var(--tx2)", fontSize: 13, fontFamily: "var(--font-body)",
1253
- transition: "border-color .15s, color .15s",
1254
- }}>{isRtl ? <ArrowRight /> : <ArrowLeft />} {prev.title}</button>
1250
+ display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 6,
1251
+ background: "var(--sf)", border: "1px solid var(--bd)", borderRadius: 8,
1252
+ padding: "16px 20px", cursor: "pointer", textAlign: "left",
1253
+ fontFamily: "var(--font-body)", transition: "all .3s ease",
1254
+ boxShadow: "0 2px 8px rgba(0,0,0,0.06)",
1255
+ }}
1256
+ onMouseOver={(e) => { e.currentTarget.style.borderColor = "var(--ac)"; e.currentTarget.style.boxShadow = "0 4px 16px rgba(0,0,0,0.1)"; }}
1257
+ onMouseOut={(e) => { e.currentTarget.style.borderColor = "var(--bd)"; e.currentTarget.style.boxShadow = "0 2px 8px rgba(0,0,0,0.06)"; }}
1258
+ >
1259
+ <span style={{ fontSize: 11, color: "var(--txM)", textTransform: "uppercase", letterSpacing: "0.5px", display: "flex", alignItems: "center", gap: 4 }}>
1260
+ {isRtl ? <ArrowRight /> : <ArrowLeft />} Previous
1261
+ </span>
1262
+ <span style={{ fontSize: 14, fontWeight: 500, color: "var(--tx)" }}>{prev.title}</span>
1263
+ </button>
1255
1264
  ) : <div />}
1256
1265
  {next ? (
1257
1266
  <button onClick={() => onNavigate(next.id)} style={{
1258
- display: "flex", alignItems: "center", gap: 8, background: "none",
1259
- border: "1px solid var(--bd)", borderRadius: 2, padding: "10px 16px",
1260
- cursor: "pointer", color: "var(--tx2)", fontSize: 13, fontFamily: "var(--font-body)",
1261
- transition: "border-color .15s, color .15s",
1262
- }}>{next.title} {isRtl ? <ArrowLeft /> : <ArrowRight />}</button>
1267
+ display: "flex", flexDirection: "column", alignItems: "flex-end", gap: 6,
1268
+ background: "var(--sf)", border: "1px solid var(--bd)", borderRadius: 8,
1269
+ padding: "16px 20px", cursor: "pointer", textAlign: "right",
1270
+ fontFamily: "var(--font-body)", transition: "all .3s ease",
1271
+ boxShadow: "0 2px 8px rgba(0,0,0,0.06)",
1272
+ }}
1273
+ onMouseOver={(e) => { e.currentTarget.style.borderColor = "var(--ac)"; e.currentTarget.style.boxShadow = "0 4px 16px rgba(0,0,0,0.1)"; }}
1274
+ onMouseOut={(e) => { e.currentTarget.style.borderColor = "var(--bd)"; e.currentTarget.style.boxShadow = "0 2px 8px rgba(0,0,0,0.06)"; }}
1275
+ >
1276
+ <span style={{ fontSize: 11, color: "var(--txM)", textTransform: "uppercase", letterSpacing: "0.5px", display: "flex", alignItems: "center", gap: 4 }}>
1277
+ Next {isRtl ? <ArrowLeft /> : <ArrowRight />}
1278
+ </span>
1279
+ <span style={{ fontSize: 14, fontWeight: 500, color: "var(--tx)" }}>{next.title}</span>
1280
+ </button>
1263
1281
  ) : <div />}
1264
1282
  </div>
1265
1283
  </>