@brillout/docpress 0.5.40 → 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.
Files changed (146) hide show
  1. package/+config.ts +17 -0
  2. package/MobileHeader.tsx +68 -0
  3. package/PageLayout.css +42 -0
  4. package/PageLayout.tsx +39 -0
  5. package/algolia/DocSearch.css +34 -0
  6. package/algolia/DocSearch.ts +62 -0
  7. package/autoScrollNav.ts +36 -0
  8. package/components/CodeBlockTransformer.css +9 -0
  9. package/components/CodeBlockTransformer.tsx +18 -0
  10. package/components/Comment.tsx +7 -0
  11. package/components/Consulting.tsx +47 -0
  12. package/components/Contributors.tsx +113 -0
  13. package/components/EditPageNote.tsx +18 -0
  14. package/components/FeatureList/FeatureList.client.ts +66 -0
  15. package/{dist/components/features → components/FeatureList}/FeatureList.css +10 -2
  16. package/components/FeatureList/FeatureList.tsx +114 -0
  17. package/components/HorizontalLine.tsx +20 -0
  18. package/components/ImportMeta.tsx +11 -0
  19. package/components/Link.tsx +144 -0
  20. package/components/Note.css +54 -0
  21. package/components/Note.tsx +78 -0
  22. package/components/P.css +8 -0
  23. package/components/P.tsx +8 -0
  24. package/components/ReadingRecommendation.tsx +56 -0
  25. package/components/RepoLink.tsx +24 -0
  26. package/components/Sponsors/label.draft.svg +108 -0
  27. package/components/Sponsors.tsx +218 -0
  28. package/components/Supporters.tsx +136 -0
  29. package/components/index.ts +14 -0
  30. package/config/getConfig.ts +18 -0
  31. package/config/resolveConfig/resolveHeading.ts +0 -0
  32. package/config/resolvePageContext.ts +186 -0
  33. package/css/button.css +7 -0
  34. package/css/code/block.css +36 -0
  35. package/css/code/inline.css +27 -0
  36. package/css/code.css +20 -0
  37. package/css/colorize-on-hover.css +29 -0
  38. package/css/font.css +25 -0
  39. package/css/heading.css +45 -0
  40. package/css/index.css +12 -0
  41. package/css/link.css +17 -0
  42. package/css/reset.css +12 -0
  43. package/css/table.css +14 -0
  44. package/css/tooltip.css +11 -0
  45. package/data/maintainersList.tsx +92 -0
  46. package/data/sponsorsList.ts +147 -0
  47. package/dist/+config.d.ts +19 -0
  48. package/dist/+config.js +15 -0
  49. package/dist/markdownHeadingsVitePlugin.d.ts +13 -0
  50. package/dist/markdownHeadingsVitePlugin.js +170 -0
  51. package/dist/utils/assert.d.ts +6 -0
  52. package/dist/utils/assert.js +48 -0
  53. package/dist/utils/determineSectionUrlHash.d.ts +4 -0
  54. package/dist/utils/determineSectionUrlHash.js +38 -0
  55. package/dist/vite.config.d.ts +3 -0
  56. package/dist/vite.config.js +32 -0
  57. package/index.ts +4 -0
  58. package/installSectionUrlHashs.ts +60 -0
  59. package/markdownHeadingsVitePlugin.ts +150 -0
  60. package/navigation/Navigation-highlight.css +41 -0
  61. package/navigation/Navigation-items.css +119 -0
  62. package/navigation/Navigation-layout.css +127 -0
  63. package/navigation/Navigation.client.ts +43 -0
  64. package/navigation/Navigation.css +3 -0
  65. package/navigation/Navigation.tsx +211 -0
  66. package/navigation/NavigationHeader.tsx +111 -0
  67. package/navigation/navigation-fullscreen/NavigationFullscreenButton.css +32 -0
  68. package/navigation/navigation-fullscreen/NavigationFullscreenButton.tsx +44 -0
  69. package/navigation/navigation-fullscreen/initNavigationFullscreen.ts +116 -0
  70. package/package.json +38 -53
  71. package/parseEmojis.ts +35 -0
  72. package/parseTitle.ts +139 -0
  73. package/renderer/client.ts +4 -0
  74. package/renderer/onRenderHtml.tsx +69 -0
  75. package/renderer/usePageContext.tsx +25 -0
  76. package/tsconfig.config.json +7 -0
  77. package/tsconfig.json +15 -0
  78. package/types/Config.ts +46 -0
  79. package/types/Heading.ts +49 -0
  80. package/utils/Emoji/Emoji.ts +224 -0
  81. package/utils/Emoji/assets.ts +9 -0
  82. package/utils/Emoji/index.ts +1 -0
  83. package/utils/Emoji/mountain.svg +1 -0
  84. package/utils/assert.ts +51 -0
  85. package/utils/client.ts +2 -0
  86. package/utils/determineSectionUrlHash.ts +44 -0
  87. package/utils/filesystemPathHandling.ts +42 -0
  88. package/utils/filter.ts +12 -0
  89. package/utils/isBrowser.ts +5 -0
  90. package/utils/jsxToTextContent.ts +11 -0
  91. package/utils/objectAssign.ts +9 -0
  92. package/utils/server.ts +7 -0
  93. package/vite.config.ts +36 -0
  94. package/bin.js +0 -3
  95. package/dist/chunk-2ZTPUQGS.js +0 -58
  96. package/dist/chunk-3QC7HYIF.js +0 -7
  97. package/dist/chunk-MGOI4AFO.js +0 -165
  98. package/dist/chunk-NVJING6T.js +0 -91
  99. package/dist/chunk-QWL3MA4E.js +0 -171
  100. package/dist/chunk-UN23G34B.js +0 -157
  101. package/dist/cli/index.d.ts +0 -1
  102. package/dist/cli/index.js +0 -34
  103. package/dist/components/features/FeatureList.d.ts +0 -13
  104. package/dist/components/features/FeatureList.js +0 -7
  105. package/dist/components/features/initFeatureList.d.ts +0 -3
  106. package/dist/components/features/initFeatureList.js +0 -59
  107. package/dist/devServer-JKH6U5PF.js +0 -36
  108. package/dist/index.css +0 -120
  109. package/dist/index.d.ts +0 -221
  110. package/dist/index.js +0 -947
  111. package/dist/renderer/_default.page.client.css +0 -318
  112. package/dist/renderer/_default.page.client.d.ts +0 -1
  113. package/dist/renderer/_default.page.client.js +0 -218
  114. package/dist/renderer/_default.page.server.css +0 -310
  115. package/dist/renderer/_default.page.server.d.ts +0 -22
  116. package/dist/renderer/_default.page.server.js +0 -665
  117. package/readme.md +0 -5
  118. /package/{dist/chevron-R2IYJD62.svg → components/FeatureList/chevron.svg} +0 -0
  119. /package/{dist/label-MP75CTIA.svg → components/Sponsors/label.svg} +0 -0
  120. /package/{dist/medalBronze-CO4CTUR4.svg → components/Sponsors/medalBronze.svg} +0 -0
  121. /package/{dist/medalGold-UP6A73FL.svg → components/Sponsors/medalGold.svg} +0 -0
  122. /package/{dist/medalSilver-FAPGGOBN.svg → components/Sponsors/medalSilver.svg} +0 -0
  123. /package/{dist/Inter-Var-IOAEQULN.ttf → css/Inter-Var.ttf} +0 -0
  124. /package/{dist/alignable-B4QZV4X7.svg → data/sponsorsList/companyLogos/alignable.svg} +0 -0
  125. /package/{dist/bluefin-JQABZFGV.svg → data/sponsorsList/companyLogos/bluefin.svg} +0 -0
  126. /package/{dist/burdaforward-EUGURYZY.png → data/sponsorsList/companyLogos/burdaforward.png} +0 -0
  127. /package/{dist/contra-WLZBOPBV.svg → data/sponsorsList/companyLogos/contra.svg} +0 -0
  128. /package/{dist/ecosia-OYRLTR5T.svg → data/sponsorsList/companyLogos/ecosia.svg} +0 -0
  129. /package/{dist/inlang-GFRWND6X.png → data/sponsorsList/companyLogos/inlang.png} +0 -0
  130. /package/{dist/optimizers-SFEZF3NW.svg → data/sponsorsList/companyLogos/optimizers.svg} +0 -0
  131. /package/{dist/sourcegraph-YR2HADLS.svg → data/sponsorsList/companyLogos/sourcegraph.svg} +0 -0
  132. /package/{dist/changelog-IPI5F42D.svg → icons/changelog.svg} +0 -0
  133. /package/{dist/discord-JD33TUSF.svg → icons/discord.svg} +0 -0
  134. /package/{dist/github-P5ZSKN2N.svg → icons/github.svg} +0 -0
  135. /package/{dist/heart-OINVKOXO.svg → icons/heart.svg} +0 -0
  136. /package/{dist/languages-KXPKJFQL.svg → icons/languages.svg} +0 -0
  137. /package/{dist/people-72KKQHU4.svg → icons/people.svg} +0 -0
  138. /package/{dist/twitter-I7DXDN3J.svg → icons/twitter.svg} +0 -0
  139. /package/{dist/chevron-K3WPYLOP.svg → navigation/navigation-fullscreen/chevron.svg} +0 -0
  140. /package/{dist/close-IQXTDOHV.svg → navigation/navigation-fullscreen/close.svg} +0 -0
  141. /package/{dist/compass-2RWQU3E4.svg → utils/Emoji/compass.svg} +0 -0
  142. /package/{dist/engine-6Q6VSCVA.png → utils/Emoji/engine.png} +0 -0
  143. /package/{dist/mechanical-arm-TR7IQQMG.svg → utils/Emoji/mechanical-arm.svg} +0 -0
  144. /package/{dist/road-fork-3WZLW3HB.svg → utils/Emoji/road-fork.svg} +0 -0
  145. /package/{dist/shield-CU45RG5C.svg → utils/Emoji/shield.svg} +0 -0
  146. /package/{dist/typescript-ALIPKLRM.svg → utils/Emoji/typescript.svg} +0 -0
@@ -1,171 +0,0 @@
1
- import {
2
- determineSectionUrlHash
3
- } from "./chunk-UN23G34B.js";
4
- import {
5
- assert
6
- } from "./chunk-2ZTPUQGS.js";
7
-
8
- // src/vite.config.ts
9
- import mdx from "@mdx-js/rollup";
10
- import react from "@vitejs/plugin-react-swc";
11
- import ssr from "vike/plugin";
12
-
13
- // src/markdownHeadingsVitePlugin.ts
14
- import os from "os";
15
- function markdownHeadingsVitePlugin() {
16
- return {
17
- name: "mdx-headings",
18
- enforce: "pre",
19
- transform: async (code, id) => {
20
- if (!id.includes(".page.") || !id.endsWith(".mdx")) {
21
- return;
22
- }
23
- const codeNew = transform(code);
24
- return codeNew;
25
- }
26
- };
27
- }
28
- function transform(code) {
29
- const headings = [];
30
- let isCodeBlock = false;
31
- let codeNew = code.split("\n").map((line) => {
32
- if (line.startsWith("~~~") || line.startsWith("```")) {
33
- isCodeBlock = !isCodeBlock;
34
- return line;
35
- }
36
- if (isCodeBlock) {
37
- return line;
38
- }
39
- if (line.startsWith("#")) {
40
- const { headingId, headingLevel, title, headingHtml } = parseMarkdownHeading(line);
41
- headings.push({ headingId, headingLevel, title });
42
- return headingHtml;
43
- }
44
- return line;
45
- }).join("\n");
46
- const headingsExportCode = `export const headings = [${headings.map((heading) => JSON.stringify(heading)).join(", ")}];`;
47
- codeNew += `
48
-
49
- ${headingsExportCode}
50
- `;
51
- return codeNew;
52
- }
53
- function parseMarkdownHeading(line) {
54
- var _a;
55
- const [lineBegin, ...lineWords] = line.split(" ");
56
- assert(lineBegin.split("#").join("") === "", { line, lineWords });
57
- const headingLevel = lineBegin.length;
58
- const titleMdx = lineWords.join(" ");
59
- assert(!titleMdx.startsWith(" "), { line, lineWords });
60
- assert(titleMdx, { line, lineWords });
61
- const headingMdx = {
62
- title: titleMdx,
63
- anchor: titleMdx
64
- };
65
- {
66
- const customAnchor = (_a = /(?<={#).*(?=})/g.exec(titleMdx)) == null ? void 0 : _a[0];
67
- if (customAnchor) {
68
- headingMdx.anchor = customAnchor;
69
- headingMdx.title = titleMdx.replace(/{#.*}/g, "");
70
- }
71
- }
72
- const headingId = determineSectionUrlHash(headingMdx.anchor);
73
- const title = headingMdx.title;
74
- const titleParsed = parseTitle(title);
75
- assert(headingId === null || headingId.length > 0);
76
- const headingAttrId = headingId === null ? "" : ` id="${headingId}"`;
77
- const headingHtml = `<h${headingLevel}${headingAttrId}>${titleParsed}</h${headingLevel}>`;
78
- const heading = { headingLevel, title, headingId, headingHtml };
79
- return heading;
80
- }
81
- function parseTitle(titleMarkdown) {
82
- const parts = [];
83
- let current;
84
- titleMarkdown.split("").forEach((letter) => {
85
- if (letter === "`") {
86
- if ((current == null ? void 0 : current.nodeType) === "code") {
87
- parts.push(current);
88
- current = void 0;
89
- } else {
90
- if (current) {
91
- parts.push(current);
92
- }
93
- current = { nodeType: "code", content: "" };
94
- }
95
- } else {
96
- if (!current) {
97
- current = { nodeType: "text", content: "" };
98
- }
99
- current.content += letter;
100
- }
101
- });
102
- if (current) {
103
- parts.push(current);
104
- }
105
- const titleHtml = parts.map((part) => {
106
- if (part.nodeType === "code") {
107
- return `<code>${serializeText(part.content)}</code>`;
108
- } else {
109
- assert(part.nodeType === "text", { parts });
110
- return serializeText(part.content);
111
- }
112
- }).join("");
113
- return titleHtml;
114
- function serializeText(text) {
115
- let textEscaped = text.split("'").join("\\'");
116
- if (isWindows()) {
117
- textEscaped = textEscaped.replace(/\r/, "");
118
- }
119
- return `{'${textEscaped}'}`;
120
- }
121
- }
122
- function isWindows() {
123
- return os.platform() === "win32";
124
- }
125
-
126
- // src/vite.config.ts
127
- import rehypePrettyCode from "rehype-pretty-code";
128
- import remarkGfm from "remark-gfm";
129
- var root = process.cwd();
130
- var prettyCode = [rehypePrettyCode, { theme: "github-light" }];
131
- var rehypePlugins = [prettyCode];
132
- var remarkPlugins = [remarkGfm];
133
- var isDev = !process.argv[1].endsWith("/bin.js");
134
- var extensionFiles = isDev ? { pageFilesSrc: "/src/renderer/*" } : {
135
- pageFilesDist: [
136
- "@brillout/docpress/renderer/_default.page.server.js",
137
- "@brillout/docpress/renderer/_default.page.client.js"
138
- ],
139
- assetsDir: "/dist/"
140
- };
141
- var config = {
142
- root,
143
- plugins: [
144
- markdownHeadingsVitePlugin(),
145
- mdx({ rehypePlugins, remarkPlugins }),
146
- react(),
147
- ssr({
148
- prerender: {
149
- noExtraDir: true
150
- },
151
- extensions: [
152
- {
153
- npmPackageName: "@brillout/docpress",
154
- ...extensionFiles
155
- }
156
- ],
157
- includeAssetsImportedByServer: true,
158
- disableAutoFullBuild: true
159
- })
160
- ],
161
- optimizeDeps: { include: ["@mdx-js/react", "react-dom"] },
162
- ssr: {
163
- noExternal: ["@brillout/docpress"]
164
- },
165
- clearScreen: false
166
- };
167
- var vite_config_default = config;
168
-
169
- export {
170
- vite_config_default
171
- };
@@ -1,157 +0,0 @@
1
- import {
2
- assert
3
- } from "./chunk-2ZTPUQGS.js";
4
-
5
- // src/utils/filter.ts
6
- function filter(obj, predicate) {
7
- const result = {};
8
- Object.keys(obj).forEach((name) => {
9
- if (predicate(obj[name], name)) {
10
- result[name] = obj[name];
11
- }
12
- });
13
- return result;
14
- }
15
-
16
- // src/utils/determineSectionUrlHash.ts
17
- function determineSectionUrlHash(title) {
18
- title = title.toLowerCase();
19
- title = removeAccentsAndDiacritics(title);
20
- const urlHash = title.split(/[^a-z0-9\u4E00-\u9FA5]+/).filter(Boolean).join("-");
21
- if (urlHash === "")
22
- return null;
23
- return urlHash;
24
- }
25
- function removeAccentsAndDiacritics(str) {
26
- return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
27
- }
28
- function determineSectionTitle(urlWithHash) {
29
- assert(urlWithHash.includes("#"), { urlWithHash });
30
- const urlHash = urlWithHash.split("#")[1];
31
- const title = urlHash.split("-").map((word, i) => {
32
- if (i === 0) {
33
- return capitalizeFirstLetter(word);
34
- }
35
- return word;
36
- }).join(" ");
37
- return title;
38
- }
39
- function capitalizeFirstLetter(word) {
40
- return word[0].toUpperCase() + word.slice(1);
41
- }
42
-
43
- // src/utils/jsxToTextContent.ts
44
- function jsxToTextContent(node) {
45
- if (["string", "number"].includes(typeof node))
46
- return String(node);
47
- if (node instanceof Array)
48
- return node.map(jsxToTextContent).join("");
49
- if (typeof node === "object" && node)
50
- return jsxToTextContent(node.props.children);
51
- assert(false);
52
- }
53
-
54
- // src/utils/objectAssign.ts
55
- function objectAssign(obj, objAddendum) {
56
- Object.assign(obj, objAddendum);
57
- }
58
-
59
- // src/utils/crawlAllFiles.ts
60
- import path from "path";
61
- import { promises as fsp } from "fs";
62
-
63
- // src/utils/filesystemPathHandling.ts
64
- import assert2 from "assert";
65
- var sepPosix = "/";
66
- var sepWin32 = "\\";
67
- function toPosixPath(path2) {
68
- if (isPosix()) {
69
- assertPosixPath(path2);
70
- return path2;
71
- }
72
- if (isWin32()) {
73
- const pathPosix = path2.split(sepWin32).join(sepPosix);
74
- assertPosixPath(pathPosix);
75
- return pathPosix;
76
- }
77
- assert2(false);
78
- }
79
- function assertPosixPath(path2) {
80
- assert2(path2 && !path2.includes(sepWin32), `Wrongly formatted path: ${path2}`);
81
- }
82
- function isWin32() {
83
- return process.platform === "win32";
84
- }
85
- function isPosix() {
86
- return !isWin32();
87
- }
88
-
89
- // src/utils/crawlAllFiles.ts
90
- async function crawlAllFiles(dir) {
91
- const dirFiles = await fsp.readdir(dir, { withFileTypes: true });
92
- const allFiles = await Promise.all(
93
- dirFiles.map((file) => {
94
- const filePath = path.resolve(dir, file.name);
95
- return file.isDirectory() ? crawlAllFiles(filePath) : filePath;
96
- })
97
- );
98
- return allFiles.flat().map(toPosixPath);
99
- }
100
-
101
- // src/utils/Emoji/Emoji.ts
102
- import React from "react";
103
-
104
- // src/utils/Emoji/mechanical-arm.svg
105
- var mechanical_arm_default = "/assets/mechanical-arm-TR7IQQMG.svg";
106
-
107
- // src/utils/Emoji/compass.svg
108
- var compass_default = "/assets/compass-2RWQU3E4.svg";
109
-
110
- // src/utils/Emoji/road-fork.svg
111
- var road_fork_default = "/assets/road-fork-3WZLW3HB.svg";
112
-
113
- // src/utils/Emoji/shield.svg
114
- var shield_default = "/assets/shield-CU45RG5C.svg";
115
-
116
- // src/utils/Emoji/typescript.svg
117
- var typescript_default = "/assets/typescript-ALIPKLRM.svg";
118
-
119
- // src/utils/Emoji/engine.png
120
- var engine_default = "/assets/engine-6Q6VSCVA.png";
121
-
122
- // src/utils/Emoji/Emoji.ts
123
- function Emoji({ name, style }) {
124
- const emoji = name === "warning" && Unicode(9888, { fontFamily: "emoji" }) || name === "lab" && Unicode(9879) || name === "info" && Unicode(8505, { fontFamily: "emoji" }) || name === "package" && Unicode(128230) || name === "gift" && Unicode(127873) || name === "sparkling-heart" && Unicode(128150) || name === "red-circle" && Unicode(11093) || name === "engine" && Img(engine_default) || name === "typescript" && Img(typescript_default) || name === "shield" && Img(shield_default) || name === "road-fork" && Img(road_fork_default, "1.4em") || name === "writing-hang" && Unicode(9997) || name === "dizzy" && Unicode(128171) || name === "mechanical-arm" && Img(mechanical_arm_default) || name === "rocket" && Unicode(128640) || name === "wrench" && Unicode(128295) || name === "compass" && Img(compass_default, "1.4em") || name === "seedling" && Unicode(127793) || name === "books" && Unicode(128218) || name === "plug" && Unicode(128268) || name === "earth" && Unicode(127757) || name === "gear" && Unicode(9881) || name === "red-heart" && Unicode(10084, { fontFamily: "emoji" }) || name === "high-voltage" && Unicode(9889) || name === "sparkles" && Unicode(10024) || name === "gem-stone" && Unicode(128142) || name === "trophy" && Unicode(127942) || name === "ribbon" && Unicode(127895, { fontFamily: "emoji" }) || false;
125
- assert(emoji, { name });
126
- return emoji;
127
- function Unicode(codePoint, styleAddendum) {
128
- const text = String.fromCodePoint(codePoint);
129
- if (style || styleAddendum) {
130
- return React.createElement("span", { style: { ...style, ...styleAddendum } }, text);
131
- } else {
132
- return React.createElement(React.Fragment, null, text);
133
- }
134
- }
135
- function Img(imgSrc, width = "1.15em") {
136
- const props = {
137
- src: imgSrc,
138
- style: {
139
- verticalAlign: "text-top",
140
- fontSize: "1em",
141
- width,
142
- ...style
143
- }
144
- };
145
- return React.createElement("img", props);
146
- }
147
- }
148
-
149
- export {
150
- filter,
151
- determineSectionUrlHash,
152
- determineSectionTitle,
153
- jsxToTextContent,
154
- objectAssign,
155
- crawlAllFiles,
156
- Emoji
157
- };
@@ -1 +0,0 @@
1
-
package/dist/cli/index.js DELETED
@@ -1,34 +0,0 @@
1
- import {
2
- vite_config_default
3
- } from "../chunk-QWL3MA4E.js";
4
- import "../chunk-UN23G34B.js";
5
- import "../chunk-2ZTPUQGS.js";
6
- import "../chunk-3QC7HYIF.js";
7
-
8
- // src/cli/index.ts
9
- import { build, preview } from "vite";
10
- import { prerender } from "vike/prerender";
11
- var args = process.argv.filter(Boolean).slice(2);
12
- var isDev = args.includes("dev");
13
- var isPreview = args.includes("preview");
14
- var isBuild = args.includes("build");
15
- Error.stackTraceLimit = Infinity;
16
- cli();
17
- async function cli() {
18
- if (isDev) {
19
- await import("../devServer-JKH6U5PF.js");
20
- } else if (isBuild) {
21
- await build(vite_config_default);
22
- await build({ ...vite_config_default, build: { ssr: true } });
23
- await prerender({ viteConfig: vite_config_default });
24
- } else if (isPreview) {
25
- const server = await preview({ ...vite_config_default, preview: { host: true } });
26
- server.printUrls();
27
- } else {
28
- throw new Error(
29
- `DocPress: unknown command \`$ docpress ${args.join(
30
- " "
31
- )}\`. Known commands: \`$ docpress dev\` and \`$ docpress preview\`.`
32
- );
33
- }
34
- }
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
-
3
- type FeatureProps = {
4
- title: React.ReactNode;
5
- desc: React.ReactNode;
6
- learnMore?: React.ReactNode;
7
- isSecondaryFeature?: true;
8
- };
9
- declare function FeatureList({ features }: {
10
- features: FeatureProps[];
11
- }): JSX.Element;
12
-
13
- export { FeatureList };
@@ -1,7 +0,0 @@
1
- import {
2
- FeatureList
3
- } from "../../chunk-NVJING6T.js";
4
- import "../../chunk-3QC7HYIF.js";
5
- export {
6
- FeatureList
7
- };
@@ -1,3 +0,0 @@
1
- declare global {
2
- var __docpress_hydrationFinished: undefined | true;
3
- }
@@ -1,59 +0,0 @@
1
- import {
2
- assert
3
- } from "../../chunk-2ZTPUQGS.js";
4
- import "../../chunk-3QC7HYIF.js";
5
-
6
- // src/components/features/initFeatureList.ts
7
- addTwitterWidgets();
8
- addFeatureClickHandlers();
9
- window.__docpress_hydrationFinished = true;
10
- function addTwitterWidgets() {
11
- loadScript("https://platform.twitter.com/widgets.js");
12
- }
13
- function addFeatureClickHandlers() {
14
- const featureEls = Array.from(
15
- document.getElementById("features").querySelectorAll(".feature.has-learn-more")
16
- );
17
- featureEls.forEach((featureEl) => {
18
- featureEl.onclick = () => {
19
- expandLearnMore(featureEl);
20
- };
21
- });
22
- }
23
- function expandLearnMore(featureEl) {
24
- const featureId = featureEl.id;
25
- assert(featureId.startsWith("feature-"), { featureId });
26
- const featureName = featureId.slice("feature-".length);
27
- const selectedClass = "selected";
28
- const learnId = "learn-more-" + featureName;
29
- const learnEl = document.getElementById(learnId);
30
- assert(learnEl, { learnId });
31
- const isExpanded = featureEl.classList.contains(selectedClass);
32
- if (!isExpanded) {
33
- const rowEl = featureEl.parentNode;
34
- if (getComputedStyle(rowEl, "display") === "grid") {
35
- ;
36
- [
37
- ...rowEl.querySelectorAll(".learn-more"),
38
- ...rowEl.querySelectorAll(".feature")
39
- ].forEach((el) => {
40
- el.classList.remove(selectedClass);
41
- });
42
- }
43
- }
44
- ;
45
- [featureEl, learnEl].forEach((el) => {
46
- el.classList.toggle(selectedClass);
47
- });
48
- }
49
- function loadScript(scriptUrl) {
50
- assert(scriptUrl.startsWith("https://"));
51
- const scriptEl = document.createElement("script");
52
- scriptEl.src = scriptUrl;
53
- scriptEl.async = true;
54
- scriptEl.setAttribute("charset", "utf-8");
55
- document.getElementsByTagName("head")[0].appendChild(scriptEl);
56
- }
57
- function getComputedStyle(el, styleProp) {
58
- return window.document.defaultView.getComputedStyle(el).getPropertyValue(styleProp);
59
- }
@@ -1,36 +0,0 @@
1
- import {
2
- vite_config_default
3
- } from "./chunk-QWL3MA4E.js";
4
- import "./chunk-UN23G34B.js";
5
- import "./chunk-2ZTPUQGS.js";
6
- import "./chunk-3QC7HYIF.js";
7
-
8
- // src/cli/devServer.ts
9
- import express from "express";
10
- import * as vite from "vite";
11
- import { renderPage } from "vike/server";
12
- var viteVersion = vite.version || "2.?.?";
13
- startServer();
14
- async function startServer() {
15
- const app = express();
16
- const viteDevServer = await vite.createServer({
17
- ...vite_config_default,
18
- server: { middlewareMode: viteVersion.startsWith("2") ? "ssr" : true }
19
- });
20
- app.use(viteDevServer.middlewares);
21
- app.get("*", async (req, res, next) => {
22
- const pageContextInit = {
23
- urlOriginal: req.originalUrl
24
- };
25
- const pageContext = await renderPage(pageContextInit);
26
- if (!pageContext.httpResponse)
27
- return next();
28
- const { body, statusCode, headers } = pageContext.httpResponse;
29
- res.status(statusCode);
30
- headers.forEach(([name, value]) => res.setHeader(name, value));
31
- res.send(body);
32
- });
33
- const port = 3e3;
34
- app.listen(port);
35
- console.log(`Server running at http://localhost:${port}`);
36
- }
package/dist/index.css DELETED
@@ -1,120 +0,0 @@
1
- /* src/components/P.css */
2
- div.paragraph {
3
- display: block;
4
- margin-block-start: 1em;
5
- margin-block-end: 1em;
6
- margin-inline-start: 0px;
7
- margin-inline-end: 0px;
8
- }
9
-
10
- /* src/components/features/FeatureList.css */
11
- @media screen and (min-width: 840px) {
12
- .features-row {
13
- display: grid;
14
- grid-template-columns: repeat(2, 1fr);
15
- }
16
- .features-row summary:nth-of-type(1) {
17
- grid-row: 1;
18
- grid-column: 1 / 2;
19
- }
20
- .features-row summary:nth-of-type(2) {
21
- grid-row: 1;
22
- grid-column: 2 / 3;
23
- }
24
- .features-row aside {
25
- grid-row: 2;
26
- grid-column: 1 / 3;
27
- }
28
- }
29
- @media screen and (min-width: 840px) {
30
- .features-row.single-column .feature {
31
- grid-column: 1 / span 2 !important;
32
- width: 100% !important;
33
- max-width: calc(1010px / 2) !important;
34
- margin: auto !important;
35
- }
36
- }
37
- #features {
38
- margin: auto;
39
- margin-top: 0;
40
- max-width: 1080px;
41
- }
42
- #features summary p {
43
- margin: 10px 0;
44
- }
45
- #features h2 {
46
- margin-bottom: 0.7em;
47
- margin-top: 0.5em;
48
- }
49
- #features .secondary-feature h2 {
50
- font-size: 1.1em;
51
- margin-bottom: 0.7em;
52
- }
53
- .learn-more h3:first-of-type {
54
- margin-top: 15px;
55
- }
56
- .learn-more {
57
- border: var(--border-width) solid var(--border-color);
58
- padding: 10px 8px;
59
- }
60
- @media screen and (min-width: 840px) {
61
- .learn-more {
62
- max-width: 886px;
63
- border-radius: var(--border-radius);
64
- }
65
- }
66
- aside.learn-more:not(.right-side) {
67
- border-top-left-radius: 0;
68
- }
69
- aside.learn-more.right-side {
70
- border-top-right-radius: 0;
71
- justify-self: end;
72
- width: 100%;
73
- }
74
- @media screen and (max-width: 340px) {
75
- .learn-more {
76
- padding-right: 5px;
77
- padding-left: 5px;
78
- }
79
- }
80
- .learn-more {
81
- display: none;
82
- }
83
- .learn-more.selected {
84
- display: block;
85
- }
86
- #features {
87
- --border-radius: 20px;
88
- --border-width: 10px;
89
- --border-color: #f6f6f6;
90
- }
91
- .feature {
92
- padding: 8px;
93
- border-width: var(--border-width);
94
- border-style: solid;
95
- border-color: transparent;
96
- border-top-left-radius: var(--border-radius);
97
- border-top-right-radius: var(--border-radius);
98
- }
99
- .selected {
100
- border-color: var(--border-color);
101
- background-color: #fcfcfc;
102
- }
103
- .feature.selected {
104
- border-bottom: 0 !important;
105
- z-index: 1;
106
- }
107
- .learn-more {
108
- position: relative;
109
- top: calc(-1 * var(--border-width));
110
- }
111
- .feature {
112
- position: relative;
113
- z-index: 1;
114
- }
115
- .feature .chevron {
116
- transition: filter 0.3s ease-in-out, transform 0.3s ease-in-out !important;
117
- }
118
- .feature.selected .chevron {
119
- transform: rotate(180deg);
120
- }