@portosaur/theme 0.1.0
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/README.md +13 -0
- package/assets/img/icon-old.png +0 -0
- package/assets/img/icon.png +0 -0
- package/assets/img/project-blank.png +0 -0
- package/assets/img/social-card.jpeg +0 -0
- package/assets/img/svg/icon-blog.svg +2 -0
- package/assets/img/svg/icon-close.svg +3 -0
- package/assets/img/svg/icon-dock.svg +4 -0
- package/assets/img/svg/icon-link.svg +5 -0
- package/assets/img/svg/icon-note.svg +2 -0
- package/assets/img/svg/icon-popup.svg +1 -0
- package/assets/img/svg/icon-save.svg +5 -0
- package/assets/img/svg/icon.svg +240 -0
- package/assets/img/svg/project-blank.svg +140 -0
- package/assets/sample-resume.pdf +0 -0
- package/package.json +41 -0
- package/plugins/README.md +8 -0
- package/src/index.d.ts +11 -0
- package/src/index.mjs +14 -0
- package/src/plugins/theme.mjs +13 -0
- package/theme/DocCategoryGeneratedIndexPage/index.jsx +15 -0
- package/theme/MDXComponents.jsx +19 -0
- package/theme/README.md +9 -0
- package/theme/Root.jsx +11 -0
- package/theme/components/AboutSection/index.jsx +264 -0
- package/theme/components/AboutSection/styles.module.css +309 -0
- package/theme/components/ContactSection/index.jsx +188 -0
- package/theme/components/ContactSection/styles.module.css +343 -0
- package/theme/components/ExperienceSection/index.jsx +119 -0
- package/theme/components/ExperienceSection/styles.module.css +183 -0
- package/theme/components/HeroSection/index.jsx +198 -0
- package/theme/components/HeroSection/styles.module.css +484 -0
- package/theme/components/NavArrow/index.jsx +124 -0
- package/theme/components/NavArrow/styles.module.css +107 -0
- package/theme/components/NoteIndex/index.jsx +182 -0
- package/theme/components/NoteIndex/styles.module.css +167 -0
- package/theme/components/Preview/components/FeedbackStates.jsx +200 -0
- package/theme/components/Preview/components/FileTabs.jsx +41 -0
- package/theme/components/Preview/components/PreviewContent.jsx +104 -0
- package/theme/components/Preview/components/PreviewHeader.jsx +411 -0
- package/theme/components/Preview/components/Triggers/Pv.jsx +253 -0
- package/theme/components/Preview/components/Triggers/SrcPv.jsx +55 -0
- package/theme/components/Preview/components/Triggers/index.jsx +2 -0
- package/theme/components/Preview/components/ViewerWindow.jsx +489 -0
- package/theme/components/Preview/hooks/useAdaptiveSizing.jsx +90 -0
- package/theme/components/Preview/hooks/useDeepLinkHash.jsx +24 -0
- package/theme/components/Preview/hooks/useDockLayout.jsx +86 -0
- package/theme/components/Preview/hooks/useFileFetch.jsx +38 -0
- package/theme/components/Preview/hooks/useTouchZoom.jsx +98 -0
- package/theme/components/Preview/index.jsx +3 -0
- package/theme/components/Preview/renderers/CodeRenderer.jsx +124 -0
- package/theme/components/Preview/renderers/ImageRenderer.jsx +74 -0
- package/theme/components/Preview/renderers/PdfRenderer.jsx +93 -0
- package/theme/components/Preview/renderers/WebRenderer.jsx +59 -0
- package/theme/components/Preview/state/index.jsx +177 -0
- package/theme/components/Preview/styles.module.css +776 -0
- package/theme/components/Preview/utils/index.jsx +62 -0
- package/theme/components/ProjectsSection/index.jsx +790 -0
- package/theme/components/ProjectsSection/styles.module.css +900 -0
- package/theme/components/SocialLinks/index.jsx +115 -0
- package/theme/components/SocialLinks/styles.module.css +57 -0
- package/theme/components/Tooltip/index.jsx +104 -0
- package/theme/components/Tooltip/styles.module.css +168 -0
- package/theme/config/iconMappings.jsx +427 -0
- package/theme/config/prism.jsx +72 -0
- package/theme/config/sidebar.jsx +11 -0
- package/theme/css/bootstrap.css +5 -0
- package/theme/css/catppuccin.css +618 -0
- package/theme/css/custom.css +253 -0
- package/theme/css/tasks.css +874 -0
- package/theme/hooks/useScrollReveal.jsx +20 -0
- package/theme/pages/index.jsx +104 -0
- package/theme/pages/notes.jsx +131 -0
- package/theme/pages/tasks.jsx +989 -0
- package/theme/utils/HashNavigation.jsx +185 -0
- package/theme/utils/updateTitle.jsx +65 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const TEXT_EXTS = [
|
|
2
|
+
"md",
|
|
3
|
+
"txt",
|
|
4
|
+
"js",
|
|
5
|
+
"ts",
|
|
6
|
+
"jsx",
|
|
7
|
+
"tsx",
|
|
8
|
+
"py",
|
|
9
|
+
"json",
|
|
10
|
+
"css",
|
|
11
|
+
"yaml",
|
|
12
|
+
"yml",
|
|
13
|
+
"sh",
|
|
14
|
+
"toml",
|
|
15
|
+
"rs",
|
|
16
|
+
"go",
|
|
17
|
+
"java",
|
|
18
|
+
"c",
|
|
19
|
+
"cpp",
|
|
20
|
+
"h",
|
|
21
|
+
"html",
|
|
22
|
+
"xml",
|
|
23
|
+
"sql",
|
|
24
|
+
"diff",
|
|
25
|
+
"patch",
|
|
26
|
+
];
|
|
27
|
+
const IMAGE_EXTS = ["png", "jpg", "jpeg", "gif", "webp", "svg"];
|
|
28
|
+
export function getExt(path) {
|
|
29
|
+
return (path || "").split(".").pop().toLowerCase().split("?")[0];
|
|
30
|
+
}
|
|
31
|
+
export function classify(path) {
|
|
32
|
+
if (!path) return "text";
|
|
33
|
+
const ext = getExt(path);
|
|
34
|
+
if (ext === "pdf") return "pdf";
|
|
35
|
+
if (IMAGE_EXTS.includes(ext)) return "image";
|
|
36
|
+
if (TEXT_EXTS.includes(ext)) return "text";
|
|
37
|
+
if (path.startsWith("http")) return "web";
|
|
38
|
+
return "text";
|
|
39
|
+
}
|
|
40
|
+
export function resolveUrl(path) {
|
|
41
|
+
if (!path) return "";
|
|
42
|
+
if (path.startsWith("http") || path.startsWith("//")) return path;
|
|
43
|
+
if (typeof window === "undefined") return path;
|
|
44
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
45
|
+
}
|
|
46
|
+
export function generatePvSlug(text) {
|
|
47
|
+
return (text || "preview")
|
|
48
|
+
.toLowerCase()
|
|
49
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
50
|
+
.replace(/(^-|-$)/g, "");
|
|
51
|
+
}
|
|
52
|
+
export function generatePvHash(slug, mode) {
|
|
53
|
+
if (!slug) return "";
|
|
54
|
+
return `${slug}:pv-${mode || "popup"}`;
|
|
55
|
+
}
|
|
56
|
+
export function parsePvHash(hash) {
|
|
57
|
+
if (!hash) return null;
|
|
58
|
+
const cleanHash = hash.replace("#", "");
|
|
59
|
+
if (!cleanHash.includes(":pv-")) return null;
|
|
60
|
+
const [slug, mode] = cleanHash.split(":pv-");
|
|
61
|
+
return { slug, mode };
|
|
62
|
+
}
|