@brillout/docpress 0.5.10 → 0.5.12
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/{chunk-W5PDEMRM.js → chunk-PHRTR4OU.js} +1 -1
- package/dist/cli/index.js +3 -3
- package/dist/{devServer-5TMJUDWP.js → devServer-QUFP2E4K.js} +2 -2
- package/dist/index.d.ts +9 -2
- package/dist/renderer/_default.page.server.d.ts +3 -3
- package/dist/renderer/_default.page.server.js +12 -6
- package/package.json +2 -2
- package/readme.md +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_config_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-PHRTR4OU.js";
|
|
4
4
|
import "../chunk-OFUQWIQL.js";
|
|
5
5
|
import "../chunk-2ZTPUQGS.js";
|
|
6
6
|
import "../chunk-3QC7HYIF.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/index.ts
|
|
9
9
|
import { build, preview } from "vite";
|
|
10
|
-
import { prerender } from "
|
|
10
|
+
import { prerender } from "vike/prerender";
|
|
11
11
|
var args = process.argv.filter(Boolean).slice(2);
|
|
12
12
|
var isDev = args.includes("dev");
|
|
13
13
|
var isPreview = args.includes("preview");
|
|
@@ -16,7 +16,7 @@ Error.stackTraceLimit = Infinity;
|
|
|
16
16
|
cli();
|
|
17
17
|
async function cli() {
|
|
18
18
|
if (isDev) {
|
|
19
|
-
await import("../devServer-
|
|
19
|
+
await import("../devServer-QUFP2E4K.js");
|
|
20
20
|
} else if (isBuild) {
|
|
21
21
|
await build(vite_config_default);
|
|
22
22
|
await build({ ...vite_config_default, build: { ssr: true } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_config_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PHRTR4OU.js";
|
|
4
4
|
import "./chunk-OFUQWIQL.js";
|
|
5
5
|
import "./chunk-2ZTPUQGS.js";
|
|
6
6
|
import "./chunk-3QC7HYIF.js";
|
|
@@ -8,7 +8,7 @@ import "./chunk-3QC7HYIF.js";
|
|
|
8
8
|
// src/cli/devServer.ts
|
|
9
9
|
import express from "express";
|
|
10
10
|
import * as vite from "vite";
|
|
11
|
-
import { renderPage } from "
|
|
11
|
+
import { renderPage } from "vike/server";
|
|
12
12
|
var viteVersion = vite.version || "2.?.?";
|
|
13
13
|
startServer();
|
|
14
14
|
async function startServer() {
|
package/dist/index.d.ts
CHANGED
|
@@ -67,11 +67,17 @@ type Config = {
|
|
|
67
67
|
twitterProfile: string;
|
|
68
68
|
};
|
|
69
69
|
faviconUrl: string;
|
|
70
|
-
algolia: null | {
|
|
70
|
+
algolia: null | ({
|
|
71
|
+
PENDING_APPROVAL?: true;
|
|
72
|
+
} & ({
|
|
73
|
+
appId?: undefined;
|
|
74
|
+
apiKey?: undefined;
|
|
75
|
+
indexName?: undefined;
|
|
76
|
+
} | {
|
|
71
77
|
appId: string;
|
|
72
78
|
apiKey: string;
|
|
73
79
|
indexName: string;
|
|
74
|
-
};
|
|
80
|
+
}));
|
|
75
81
|
headings: HeadingDefinition[];
|
|
76
82
|
headingsDetached: HeadingDetachedDefinition[];
|
|
77
83
|
navHeaderMobile: React.ReactNode;
|
|
@@ -81,6 +87,7 @@ type Config = {
|
|
|
81
87
|
websiteUrl: string;
|
|
82
88
|
bannerUrl?: string;
|
|
83
89
|
twitterHandle: string;
|
|
90
|
+
globalNote?: React.ReactNode;
|
|
84
91
|
i18n?: true;
|
|
85
92
|
};
|
|
86
93
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { PageContextBuiltIn } from '
|
|
1
|
+
import * as vike_dist_esm_node_runtime_html_renderHtml from 'vike/dist/esm/node/runtime/html/renderHtml';
|
|
2
|
+
import { PageContextBuiltIn } from 'vike/types';
|
|
3
3
|
|
|
4
4
|
type MarkdownHeading = {
|
|
5
5
|
title: string;
|
|
@@ -17,6 +17,6 @@ type PageContextOriginal = PageContextBuiltIn & {
|
|
|
17
17
|
exports: Exports;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
declare function render(pageContextOriginal: PageContextOriginal): Promise<
|
|
20
|
+
declare function render(pageContextOriginal: PageContextOriginal): Promise<vike_dist_esm_node_runtime_html_renderHtml.TemplateWrapped>;
|
|
21
21
|
|
|
22
22
|
export { render };
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
// src/renderer/_default.page.server.tsx
|
|
23
23
|
import ReactDOMServer from "react-dom/server";
|
|
24
24
|
import React7 from "react";
|
|
25
|
-
import { escapeInject as escapeInject2, dangerouslySkipEscape as dangerouslySkipEscape2 } from "
|
|
25
|
+
import { escapeInject as escapeInject2, dangerouslySkipEscape as dangerouslySkipEscape2 } from "vike/server";
|
|
26
26
|
|
|
27
27
|
// src/PageLayout.tsx
|
|
28
28
|
import React6 from "react";
|
|
@@ -395,6 +395,7 @@ function EditPageNote({ pageContext }) {
|
|
|
395
395
|
// src/PageLayout.tsx
|
|
396
396
|
function PageLayout({ pageContext, children }) {
|
|
397
397
|
const { isLandingPage, pageTitle } = pageContext;
|
|
398
|
+
const { globalNote } = pageContext.config;
|
|
398
399
|
return /* @__PURE__ */ React6.createElement(React6.StrictMode, null, /* @__PURE__ */ React6.createElement(PageContextProvider, {
|
|
399
400
|
pageContext
|
|
400
401
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
@@ -410,7 +411,7 @@ function PageLayout({ pageContext, children }) {
|
|
|
410
411
|
id: "page-container"
|
|
411
412
|
}, /* @__PURE__ */ React6.createElement(MobileHeader, null), /* @__PURE__ */ React6.createElement("div", {
|
|
412
413
|
id: "page-content"
|
|
413
|
-
}, pageTitle && /* @__PURE__ */ React6.createElement("h1", null, pageTitle), children, !isLandingPage && /* @__PURE__ */ React6.createElement(EditPageNote, {
|
|
414
|
+
}, globalNote, pageTitle && /* @__PURE__ */ React6.createElement("h1", null, pageTitle), children, !isLandingPage && /* @__PURE__ */ React6.createElement(EditPageNote, {
|
|
414
415
|
pageContext
|
|
415
416
|
}))), /* @__PURE__ */ React6.createElement(NavigationMask, null)))));
|
|
416
417
|
}
|
|
@@ -561,20 +562,25 @@ function getPageHeadings(pageContext, currentHeading) {
|
|
|
561
562
|
}
|
|
562
563
|
|
|
563
564
|
// src/algolia/DocSearch.ts
|
|
564
|
-
import { dangerouslySkipEscape, escapeInject } from "
|
|
565
|
+
import { dangerouslySkipEscape, escapeInject } from "vike/server";
|
|
565
566
|
function getDocSearchCSS(pageContext) {
|
|
566
567
|
const docSearchCSS = !pageContext.meta.algolia ? "" : escapeInject`
|
|
567
568
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@alpha" />
|
|
568
569
|
`;
|
|
569
570
|
return docSearchCSS;
|
|
570
571
|
}
|
|
571
|
-
var _a;
|
|
572
|
+
var _a, _b;
|
|
572
573
|
function getDocSearchJS(pageContext) {
|
|
573
574
|
const { algolia } = pageContext.meta;
|
|
574
|
-
|
|
575
|
+
let docSearchJS = !algolia ? "" : escapeInject(_a || (_a = __template([`
|
|
575
576
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"><\/script>
|
|
576
577
|
<script type="text/javascript">
|
|
577
|
-
const appId = '`, "';\n const apiKey = '", "';\n const indexName = '", "';\n const transformItems = ", ";\n docsearch({\n container: '#docsearch-desktop',\n appId, apiKey, indexName, transformItems\n });\n docsearch({\n container: '#docsearch-mobile',\n appId, apiKey, indexName, transformItems\n });\n <\/script>\n "])), algolia.appId, algolia.apiKey, algolia.indexName, dangerouslySkipEscape(getTransformItems()));
|
|
578
|
+
const appId = '`, "';\n const apiKey = '", "';\n const indexName = '", "';\n const transformItems = ", ";\n docsearch({\n container: '#docsearch-desktop',\n appId, apiKey, indexName, transformItems\n });\n docsearch({\n container: '#docsearch-mobile',\n appId, apiKey, indexName, transformItems\n });\n <\/script>\n "])), algolia.appId || "FAKE", algolia.apiKey || "FAKE", algolia.indexName || "FAKE", dangerouslySkipEscape(getTransformItems()));
|
|
579
|
+
if (algolia == null ? void 0 : algolia.PENDING_APPROVAL) {
|
|
580
|
+
docSearchJS = escapeInject(_b || (_b = __template(["\n ", `
|
|
581
|
+
<script>[document.getElementById('docsearch-desktop'), document.getElementById('docsearch-mobile')].forEach(el => el.addEventListener('click', () => window.alert("Algolia approval is pending: the search results may be empty until the approval process is completed.")))<\/script>
|
|
582
|
+
`])), docSearchJS);
|
|
583
|
+
}
|
|
578
584
|
return docSearchJS;
|
|
579
585
|
}
|
|
580
586
|
function getTransformItems() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brillout/docpress",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"// Check types while developing": "",
|
|
6
6
|
"types": "tsc --noEmit --watch",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"shiki": "^0.10.1",
|
|
27
27
|
"twemoji": "^13.1.0",
|
|
28
28
|
"vite": "^4.3.9",
|
|
29
|
-
"
|
|
29
|
+
"vike": "^0.4.131"
|
|
30
30
|
},
|
|
31
31
|
"type": "module",
|
|
32
32
|
"exports": {
|
package/readme.md
CHANGED