@brillout/docpress 0.4.5 → 0.4.7
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/dist/index.d.ts +2 -1
- package/dist/index.js +25 -21
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -84,11 +84,12 @@ type Config = {
|
|
|
84
84
|
i18n?: true;
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
declare function Link(
|
|
87
|
+
declare function Link({ href, text, noBreadcrumb, doNotInferSectionTitle, titleNormalCase }: {
|
|
88
88
|
href: string;
|
|
89
89
|
text?: string | JSX.Element;
|
|
90
90
|
noBreadcrumb?: true;
|
|
91
91
|
doNotInferSectionTitle?: true;
|
|
92
|
+
titleNormalCase?: boolean;
|
|
92
93
|
}): JSX.Element;
|
|
93
94
|
|
|
94
95
|
declare function isRepoLink(href: string): boolean;
|
package/dist/index.js
CHANGED
|
@@ -27,28 +27,24 @@ import "./chunk-3QC7HYIF.js";
|
|
|
27
27
|
|
|
28
28
|
// src/components/Link.tsx
|
|
29
29
|
import React from "react";
|
|
30
|
-
function Link(
|
|
31
|
-
if (isRepoLink(props.href)) {
|
|
32
|
-
return /* @__PURE__ */ React.createElement(RepoLink, {
|
|
33
|
-
path: props.href,
|
|
34
|
-
text: props.text
|
|
35
|
-
});
|
|
36
|
-
} else {
|
|
37
|
-
return /* @__PURE__ */ React.createElement(DocLink, {
|
|
38
|
-
...props
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function DocLink({
|
|
30
|
+
function Link({
|
|
43
31
|
href,
|
|
44
32
|
text,
|
|
45
33
|
noBreadcrumb,
|
|
46
|
-
doNotInferSectionTitle
|
|
34
|
+
doNotInferSectionTitle,
|
|
35
|
+
titleNormalCase
|
|
47
36
|
}) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
if (isRepoLink(href)) {
|
|
38
|
+
return /* @__PURE__ */ React.createElement(RepoLink, {
|
|
39
|
+
path: href,
|
|
40
|
+
text
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
const pageContext = usePageContext();
|
|
44
|
+
return /* @__PURE__ */ React.createElement("a", {
|
|
45
|
+
href
|
|
46
|
+
}, text || getTitle({ href, noBreadcrumb, pageContext, doNotInferSectionTitle, titleNormalCase }));
|
|
47
|
+
}
|
|
52
48
|
}
|
|
53
49
|
function getTitle({
|
|
54
50
|
href,
|
|
@@ -65,17 +61,22 @@ function getTitle({
|
|
|
65
61
|
assert(hrefWithoutHash || urlHash);
|
|
66
62
|
}
|
|
67
63
|
let heading;
|
|
68
|
-
let linkIsOnSamePage;
|
|
64
|
+
let linkIsOnSamePage = false;
|
|
69
65
|
if (hrefWithoutHash) {
|
|
70
66
|
heading = findHeading(hrefWithoutHash, pageContext);
|
|
71
|
-
|
|
67
|
+
if (heading.url === pageContext.urlPathname) {
|
|
68
|
+
linkIsOnSamePage = true;
|
|
69
|
+
heading = pageContext.activeHeading;
|
|
70
|
+
}
|
|
72
71
|
} else {
|
|
73
72
|
assert(urlHash);
|
|
74
73
|
linkIsOnSamePage = true;
|
|
75
74
|
heading = pageContext.activeHeading;
|
|
76
75
|
}
|
|
77
76
|
assert(heading);
|
|
78
|
-
assert(heading === pageContext.
|
|
77
|
+
assert(linkIsOnSamePage === (heading.url === pageContext.urlPathname));
|
|
78
|
+
assert(linkIsOnSamePage === (heading.url === pageContext.activeHeading.url));
|
|
79
|
+
assert(linkIsOnSamePage === (heading === pageContext.activeHeading));
|
|
79
80
|
const breadcrumbs = [];
|
|
80
81
|
if (heading.parentHeadings) {
|
|
81
82
|
breadcrumbs.push(
|
|
@@ -270,6 +271,9 @@ var inlang_default = "/assets/inlang-GFRWND6X.png";
|
|
|
270
271
|
|
|
271
272
|
// src/components/Sponsors/sponsorsList.ts
|
|
272
273
|
var individuals = [
|
|
274
|
+
{
|
|
275
|
+
username: "royalswe"
|
|
276
|
+
},
|
|
273
277
|
{
|
|
274
278
|
username: "alexturpin"
|
|
275
279
|
},
|