portosaurus 2.0.2 → 2.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/bin/portosaurus.mjs +14 -327
- package/package.json +16 -11
- package/src/cli/build.mjs +43 -0
- package/src/cli/dev.mjs +31 -0
- package/src/cli/init.mjs +135 -0
- package/src/cli/serve.mjs +30 -0
- package/src/core/buildDocuConfig.mjs +664 -0
- package/src/core/{themePlugin.mjs → plugins/themePlugin.mjs} +1 -1
- package/src/template/.github/workflows/deploy.yml +52 -0
- package/src/template/.nojekyll +0 -0
- package/src/template/README.md +58 -0
- package/src/template/blog/authors.yml +1 -1
- package/src/template/blog/welcome.md +1 -1
- package/src/template/config.js +40 -23
- package/src/template/package.json +20 -0
- package/src/template/static/img/svg/icon-blog.svg +2 -0
- package/src/template/static/img/svg/icon-note.svg +2 -0
- package/src/{components → theme/components}/AboutSection/index.js +22 -13
- package/src/{components → theme/components}/AboutSection/styles.module.css +59 -48
- package/src/{components → theme/components}/ContactSection/index.js +31 -24
- package/src/{components → theme/components}/ContactSection/styles.module.css +31 -26
- package/src/{components → theme/components}/ExperienceSection/index.js +12 -7
- package/src/{components → theme/components}/ExperienceSection/styles.module.css +23 -20
- package/src/{components → theme/components}/HeroSection/index.js +9 -11
- package/src/{components → theme/components}/HeroSection/styles.module.css +44 -32
- package/src/{components → theme/components}/NoteIndex/index.js +10 -3
- package/src/{components → theme/components}/Preview/components/PreviewHeader.js +14 -8
- package/src/{components → theme/components}/Preview/components/Triggers/Pv.js +32 -7
- package/src/{components → theme/components}/Preview/components/Triggers/SrcPv.js +1 -5
- package/src/theme/components/Preview/index.js +3 -0
- package/src/{components → theme/components}/ProjectsSection/index.js +279 -224
- package/src/{components → theme/components}/ProjectsSection/styles.module.css +21 -17
- package/src/{components → theme/components}/ScrollToTop/index.js +18 -21
- package/src/{components → theme/components}/ScrollToTop/styles.module.css +10 -9
- package/src/theme/components/SocialLinks/index.js +125 -0
- package/src/{components → theme/components}/SocialLinks/styles.module.css +9 -7
- package/src/{components → theme/components}/Tooltip/index.js +4 -1
- package/src/theme/config/iconMappings.js +465 -0
- package/src/theme/config/metaTags.js +239 -0
- package/src/theme/config/prism.js +179 -0
- package/src/theme/config/sidebar.js +17 -0
- package/src/{css → theme/css}/bootstrap.css +0 -1
- package/src/theme/css/catppuccin.css +618 -0
- package/src/{css → theme/css}/custom.css +3 -9
- package/src/{css → theme/css}/tasks.css +43 -37
- package/src/theme/{MDXComponents.js → overrides/MDXComponents.js} +3 -3
- package/src/theme/{Root.js → overrides/Root.js} +2 -4
- package/src/{pages → theme/pages}/index.js +23 -39
- package/src/theme/pages/notes.js +83 -0
- package/src/{pages → theme/pages}/tasks.js +115 -56
- package/src/{core/client-utils → theme/utils}/HashNavigation.js +60 -49
- package/src/{core/client-utils → theme/utils}/updateTitle.js +21 -25
- package/src/{core/build-utils → utils/build}/cssUtils.mjs +5 -3
- package/src/{core/build-utils → utils/build}/generateFavicon.mjs +44 -12
- package/src/{core/build-utils → utils/build}/generateRobotsTxt.mjs +4 -3
- package/src/{core/build-utils → utils/build}/iconExtractor.mjs +7 -3
- package/src/utils/build/imageDownloader.mjs +159 -0
- package/src/{core/build-utils → utils/build}/imageProcessor.mjs +5 -6
- package/src/utils/helpers.mjs +153 -0
- package/src/utils/logger.mjs +53 -0
- package/src/utils/packageManager.mjs +88 -0
- package/src/components/Preview/index.js +0 -3
- package/src/components/SocialLinks/index.js +0 -130
- package/src/config/iconMappings.js +0 -329
- package/src/config/metaTags.js +0 -240
- package/src/config/prism.js +0 -179
- package/src/config/sidebar.js +0 -20
- package/src/core/build-utils/imageDownloader.mjs +0 -98
- package/src/core/createDocuConf.mjs +0 -490
- package/src/core/defaults.mjs +0 -67
- package/src/core/logger.mjs +0 -17
- package/src/core/packageManager.mjs +0 -72
- package/src/css/catppuccin.css +0 -632
- package/src/pages/notes.js +0 -87
- /package/src/template/notes/{welcome.md → welcome.mdx} +0 -0
- /package/src/{components → theme/components}/NoteIndex/styles.module.css +0 -0
- /package/src/{components → theme/components}/Preview/components/FeedbackStates.js +0 -0
- /package/src/{components → theme/components}/Preview/components/FileTabs.js +0 -0
- /package/src/{components → theme/components}/Preview/components/Triggers/index.js +0 -0
- /package/src/{components → theme/components}/Preview/components/ViewerWindow.js +0 -0
- /package/src/{components → theme/components}/Preview/hooks/useDeepLinkHash.js +0 -0
- /package/src/{components → theme/components}/Preview/hooks/useDockLayout.js +0 -0
- /package/src/{components → theme/components}/Preview/hooks/useFileFetch.js +0 -0
- /package/src/{components → theme/components}/Preview/renderers/CodeRenderer.js +0 -0
- /package/src/{components → theme/components}/Preview/renderers/ImageRenderer.js +0 -0
- /package/src/{components → theme/components}/Preview/renderers/PdfRenderer.js +0 -0
- /package/src/{components → theme/components}/Preview/renderers/WebRenderer.js +0 -0
- /package/src/{components → theme/components}/Preview/state/index.js +0 -0
- /package/src/{components → theme/components}/Preview/styles.module.css +0 -0
- /package/src/{components → theme/components}/Preview/utils/index.js +0 -0
- /package/src/{components → theme/components}/Tooltip/styles.module.css +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState, useRef } from "react";
|
|
2
|
-
import Tooltip from "
|
|
2
|
+
import Tooltip from "../../Tooltip";
|
|
3
3
|
import styles from "../styles.module.css";
|
|
4
4
|
|
|
5
|
-
import IconDock from "@
|
|
6
|
-
import IconPopup from "@
|
|
7
|
-
import IconSave from "@
|
|
8
|
-
import IconLink from "@
|
|
9
|
-
import IconClose from "@
|
|
5
|
+
import IconDock from "@porto/assets/img/svg/icon-dock.svg";
|
|
6
|
+
import IconPopup from "@porto/assets/img/svg/icon-popup.svg";
|
|
7
|
+
import IconSave from "@porto/assets/img/svg/icon-save.svg";
|
|
8
|
+
import IconLink from "@porto/assets/img/svg/icon-link.svg";
|
|
9
|
+
import IconClose from "@porto/assets/img/svg/icon-close.svg";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Preview window header with title, zoom controls, dock/popup toggle, and close button.
|
|
@@ -113,7 +113,11 @@ export default function PreviewHeader({
|
|
|
113
113
|
</a>
|
|
114
114
|
</Tooltip>
|
|
115
115
|
) : (
|
|
116
|
-
<Tooltip
|
|
116
|
+
<Tooltip
|
|
117
|
+
msg={isDownloading ? "Downloading..." : "Download file"}
|
|
118
|
+
position="bottom"
|
|
119
|
+
underline={false}
|
|
120
|
+
>
|
|
117
121
|
<button
|
|
118
122
|
onClick={onDownload}
|
|
119
123
|
disabled={isDownloading}
|
|
@@ -124,7 +128,9 @@ export default function PreviewHeader({
|
|
|
124
128
|
) : (
|
|
125
129
|
<IconSave className={styles.headerIconSmall} />
|
|
126
130
|
)}
|
|
127
|
-
<span className={styles.btnText}>
|
|
131
|
+
<span className={styles.btnText}>
|
|
132
|
+
{isDownloading ? "Saving" : "Save"}
|
|
133
|
+
</span>
|
|
128
134
|
</button>
|
|
129
135
|
</Tooltip>
|
|
130
136
|
)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from "react";
|
|
2
2
|
import { useLocation } from "@docusaurus/router";
|
|
3
3
|
import { usePreview } from "../../state";
|
|
4
|
-
import Tooltip from "
|
|
4
|
+
import Tooltip from "../../../Tooltip";
|
|
5
5
|
import { generatePvSlug, generatePvHash, parsePvHash } from "../../utils";
|
|
6
6
|
import styles from "../../styles.module.css";
|
|
7
7
|
|
|
@@ -42,12 +42,18 @@ export function normalizeSources({ href, path, sources, children, desc }) {
|
|
|
42
42
|
const cleanPath = sPath.split(/[?#]/)[0].toLowerCase();
|
|
43
43
|
if (cleanPath.endsWith(".pdf")) type = "PDF";
|
|
44
44
|
else if (cleanPath.match(/\.(png|jpe?g|gif|svg|webp)$/)) type = "Image";
|
|
45
|
-
else if (
|
|
45
|
+
else if (
|
|
46
|
+
sPath.includes("youtube.com") ||
|
|
47
|
+
sPath.includes("youtu.be") ||
|
|
48
|
+
sPath.includes("vimeo.com")
|
|
49
|
+
)
|
|
46
50
|
type = "Video";
|
|
47
51
|
|
|
48
52
|
try {
|
|
49
53
|
if (sPath.startsWith("http") || sPath.startsWith("//")) {
|
|
50
|
-
const url = new URL(
|
|
54
|
+
const url = new URL(
|
|
55
|
+
sPath.startsWith("//") ? `https:${sPath}` : sPath,
|
|
56
|
+
);
|
|
51
57
|
domain = url.hostname.replace("www.", "");
|
|
52
58
|
}
|
|
53
59
|
} catch (e) {}
|
|
@@ -78,7 +84,12 @@ export function normalizeSources({ href, path, sources, children, desc }) {
|
|
|
78
84
|
* --- Inline trigger: <Pv href="..." id="...">link text</Pv> ---
|
|
79
85
|
*/
|
|
80
86
|
export default function Pv(props) {
|
|
81
|
-
const {
|
|
87
|
+
const {
|
|
88
|
+
children,
|
|
89
|
+
id: manualId,
|
|
90
|
+
activeIdx = 0,
|
|
91
|
+
sources: overrideSources,
|
|
92
|
+
} = props;
|
|
82
93
|
const initialDocked = isTrue(props.docked);
|
|
83
94
|
const {
|
|
84
95
|
isOpen,
|
|
@@ -91,13 +102,19 @@ export default function Pv(props) {
|
|
|
91
102
|
} = usePreview();
|
|
92
103
|
const location = useLocation();
|
|
93
104
|
|
|
94
|
-
const srcList = useMemo(
|
|
105
|
+
const srcList = useMemo(
|
|
106
|
+
() => overrideSources || normalizeSources(props),
|
|
107
|
+
[props, overrideSources],
|
|
108
|
+
);
|
|
95
109
|
|
|
96
110
|
// Unified Slug & Hash Generation
|
|
97
111
|
const slug = useMemo(() => {
|
|
98
112
|
if (manualId) return manualId;
|
|
99
113
|
const label = typeof children === "string" ? children : null;
|
|
100
|
-
return generatePvSlug(
|
|
114
|
+
return generatePvSlug(
|
|
115
|
+
label,
|
|
116
|
+
props.href || props.path || srcList[activeIdx]?.path,
|
|
117
|
+
);
|
|
101
118
|
}, [manualId, children, props.href, props.path, srcList, activeIdx]);
|
|
102
119
|
|
|
103
120
|
// Deep Link Detection
|
|
@@ -110,7 +127,15 @@ export default function Pv(props) {
|
|
|
110
127
|
}
|
|
111
128
|
}, 150);
|
|
112
129
|
return () => clearTimeout(timer);
|
|
113
|
-
}, [
|
|
130
|
+
}, [
|
|
131
|
+
location.hash,
|
|
132
|
+
slug,
|
|
133
|
+
srcList,
|
|
134
|
+
openPreview,
|
|
135
|
+
setDocked,
|
|
136
|
+
initialDocked,
|
|
137
|
+
activeIdx,
|
|
138
|
+
]);
|
|
114
139
|
|
|
115
140
|
if (srcList.length === 0) return <span>{children}</span>;
|
|
116
141
|
|
|
@@ -17,11 +17,7 @@ export default function SrcPv(props) {
|
|
|
17
17
|
<span className={styles.sourceFooterLabel}>{prefixText}</span>
|
|
18
18
|
{srcList.map((src, idx) => (
|
|
19
19
|
<React.Fragment key={idx}>
|
|
20
|
-
<Pv
|
|
21
|
-
{...props}
|
|
22
|
-
sources={srcList}
|
|
23
|
-
activeIdx={idx}
|
|
24
|
-
>
|
|
20
|
+
<Pv {...props} sources={srcList} activeIdx={idx}>
|
|
25
21
|
{src.label}
|
|
26
22
|
</Pv>
|
|
27
23
|
{idx < srcList.length - 1 ? ", " : ""}
|