mirror of
https://github.com/quartz-community/folder-page.git
synced 2026-07-22 02:50:24 +00:00
build: bundle dependencies and ship pre-built dist
This commit is contained in:
parent
1c832a03d5
commit
59ae85b003
4 changed files with 230 additions and 147 deletions
181
dist/components/index.js
vendored
181
dist/components/index.js
vendored
|
|
@ -1,6 +1,3 @@
|
|||
import { jsx, jsxs, Fragment } from 'preact/jsx-runtime';
|
||||
import { h } from 'preact';
|
||||
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
|
|
@ -59,8 +56,8 @@ var require_cjs = __commonJS({
|
|||
function updatePosition(str) {
|
||||
var lines = str.match(NEWLINE_REGEX);
|
||||
if (lines) lineno += lines.length;
|
||||
var i = str.lastIndexOf(NEWLINE);
|
||||
column = ~i ? str.length - i : column + str.length;
|
||||
var i2 = str.lastIndexOf(NEWLINE);
|
||||
column = ~i2 ? str.length - i2 : column + str.length;
|
||||
}
|
||||
function position3() {
|
||||
var start2 = { line: lineno, column };
|
||||
|
|
@ -91,22 +88,22 @@ var require_cjs = __commonJS({
|
|||
}
|
||||
}
|
||||
function match(re2) {
|
||||
var m = re2.exec(style);
|
||||
if (!m) return;
|
||||
var str = m[0];
|
||||
var m2 = re2.exec(style);
|
||||
if (!m2) return;
|
||||
var str = m2[0];
|
||||
updatePosition(str);
|
||||
style = style.slice(str.length);
|
||||
return m;
|
||||
return m2;
|
||||
}
|
||||
function whitespace2() {
|
||||
match(WHITESPACE_REGEX);
|
||||
}
|
||||
function comments(rules) {
|
||||
var c;
|
||||
var c2;
|
||||
rules = rules || [];
|
||||
while (c = comment()) {
|
||||
if (c !== false) {
|
||||
rules.push(c);
|
||||
while (c2 = comment()) {
|
||||
if (c2 !== false) {
|
||||
rules.push(c2);
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
|
|
@ -114,18 +111,18 @@ var require_cjs = __commonJS({
|
|||
function comment() {
|
||||
var pos = position3();
|
||||
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
|
||||
var i = 2;
|
||||
while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
|
||||
++i;
|
||||
var i2 = 2;
|
||||
while (EMPTY_STRING != style.charAt(i2) && (ASTERISK != style.charAt(i2) || FORWARD_SLASH != style.charAt(i2 + 1))) {
|
||||
++i2;
|
||||
}
|
||||
i += 2;
|
||||
if (EMPTY_STRING === style.charAt(i - 1)) {
|
||||
i2 += 2;
|
||||
if (EMPTY_STRING === style.charAt(i2 - 1)) {
|
||||
return error("End of comment missing");
|
||||
}
|
||||
var str = style.slice(2, i - 2);
|
||||
var str = style.slice(2, i2 - 2);
|
||||
column += 2;
|
||||
updatePosition(str);
|
||||
style = style.slice(i);
|
||||
style = style.slice(i2);
|
||||
column += 2;
|
||||
return pos({
|
||||
type: TYPE_COMMENT,
|
||||
|
|
@ -275,9 +272,9 @@ function getDate(data) {
|
|||
return dates?.[defaultDateType];
|
||||
}
|
||||
function byDateAndAlphabetical() {
|
||||
return (f1, f2) => {
|
||||
return (f1, f22) => {
|
||||
const f1Date = getDate(f1);
|
||||
const f2Date = getDate(f2);
|
||||
const f2Date = getDate(f22);
|
||||
if (f1Date && f2Date) {
|
||||
return f2Date.getTime() - f1Date.getTime();
|
||||
} else if (f1Date && !f2Date) {
|
||||
|
|
@ -286,7 +283,7 @@ function byDateAndAlphabetical() {
|
|||
return 1;
|
||||
}
|
||||
const f1Title = (f1.frontmatter?.title ?? "").toLowerCase();
|
||||
const f2Title = (f2.frontmatter?.title ?? "").toLowerCase();
|
||||
const f2Title = (f22.frontmatter?.title ?? "").toLowerCase();
|
||||
return f1Title.localeCompare(f2Title);
|
||||
};
|
||||
}
|
||||
|
|
@ -311,29 +308,29 @@ function joinSegments(...args) {
|
|||
}
|
||||
return joined;
|
||||
}
|
||||
function endsWith(s, suffix) {
|
||||
return s === suffix || s.endsWith("/" + suffix);
|
||||
function endsWith(s2, suffix) {
|
||||
return s2 === suffix || s2.endsWith("/" + suffix);
|
||||
}
|
||||
function trimSuffix(s, suffix) {
|
||||
if (endsWith(s, suffix)) {
|
||||
s = s.slice(0, -suffix.length);
|
||||
function trimSuffix(s2, suffix) {
|
||||
if (endsWith(s2, suffix)) {
|
||||
s2 = s2.slice(0, -suffix.length);
|
||||
}
|
||||
return s;
|
||||
return s2;
|
||||
}
|
||||
function stripSlashes(s, onlyStripPrefix) {
|
||||
if (s.startsWith("/")) {
|
||||
s = s.substring(1);
|
||||
function stripSlashes(s2, onlyStripPrefix) {
|
||||
if (s2.startsWith("/")) {
|
||||
s2 = s2.substring(1);
|
||||
}
|
||||
if (!onlyStripPrefix && s.endsWith("/")) {
|
||||
s = s.slice(0, -1);
|
||||
if (!onlyStripPrefix && s2.endsWith("/")) {
|
||||
s2 = s2.slice(0, -1);
|
||||
}
|
||||
return s;
|
||||
return s2;
|
||||
}
|
||||
function isFolderPath(fplike) {
|
||||
return fplike.endsWith("/") || endsWith(fplike, "index") || endsWith(fplike, "index.md") || endsWith(fplike, "index.html");
|
||||
}
|
||||
function pathToRoot(slug2) {
|
||||
let rootPath = slug2.split("/").filter((x) => x !== "").slice(0, -1).map((_) => "..").join("/");
|
||||
let rootPath = slug2.split("/").filter((x2) => x2 !== "").slice(0, -1).map((_2) => "..").join("/");
|
||||
if (rootPath.length === 0) {
|
||||
rootPath = ".";
|
||||
}
|
||||
|
|
@ -343,26 +340,66 @@ function resolveRelative(current, target) {
|
|||
const res = joinSegments(pathToRoot(current), simplifySlug(target));
|
||||
return res;
|
||||
}
|
||||
|
||||
// node_modules/preact/dist/preact.mjs
|
||||
var n;
|
||||
var l;
|
||||
var u;
|
||||
var w = [];
|
||||
function k(l2, u3, t2) {
|
||||
var i2, r2, o2, e2 = {};
|
||||
for (o2 in u3) "key" == o2 ? i2 = u3[o2] : "ref" == o2 ? r2 = u3[o2] : e2[o2] = u3[o2];
|
||||
if (arguments.length > 2 && (e2.children = arguments.length > 3 ? n.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps) for (o2 in l2.defaultProps) void 0 === e2[o2] && (e2[o2] = l2.defaultProps[o2]);
|
||||
return x(l2, e2, i2, r2, null);
|
||||
}
|
||||
function x(n2, t2, i2, r2, o2) {
|
||||
var e2 = { type: n2, props: t2, key: i2, ref: r2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: null == o2 ? ++u : o2, __i: -1, __u: 0 };
|
||||
return null != l.vnode && l.vnode(e2), e2;
|
||||
}
|
||||
function S(n2) {
|
||||
return n2.children;
|
||||
}
|
||||
n = w.slice, l = { __e: function(n2, l2, u3, t2) {
|
||||
for (var i2, r2, o2; l2 = l2.__; ) if ((i2 = l2.__c) && !i2.__) try {
|
||||
if ((r2 = i2.constructor) && null != r2.getDerivedStateFromError && (i2.setState(r2.getDerivedStateFromError(n2)), o2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), o2 = i2.__d), o2) return i2.__E = i2;
|
||||
} catch (l3) {
|
||||
n2 = l3;
|
||||
}
|
||||
throw n2;
|
||||
} }, u = 0, "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Math.random().toString(8);
|
||||
|
||||
// node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs
|
||||
var f2 = 0;
|
||||
function u2(e2, t2, n2, o2, i2, u3) {
|
||||
t2 || (t2 = {});
|
||||
var a2, c2, p2 = t2;
|
||||
if ("ref" in p2) for (c2 in p2 = {}, t2) "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
|
||||
var l2 = { type: e2, props: p2, key: n2, ref: a2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --f2, __i: -1, __u: 0, __source: i2, __self: u3 };
|
||||
if ("function" == typeof e2 && (a2 = e2.defaultProps)) for (c2 in a2) void 0 === p2[c2] && (p2[c2] = a2[c2]);
|
||||
return l.vnode && l.vnode(l2), l2;
|
||||
}
|
||||
|
||||
// src/components/PageList.tsx
|
||||
function byDateAndAlphabeticalFolderFirst(_cfg) {
|
||||
return (f1, f2) => {
|
||||
return (f1, f22) => {
|
||||
const f1IsFolder = isFolderPath(f1.slug ?? "");
|
||||
const f2IsFolder = isFolderPath(f2.slug ?? "");
|
||||
const f2IsFolder = isFolderPath(f22.slug ?? "");
|
||||
if (f1IsFolder && !f2IsFolder) return -1;
|
||||
if (!f1IsFolder && f2IsFolder) return 1;
|
||||
if (f1.dates && f2.dates) {
|
||||
return (getDate(f2)?.getTime() ?? 0) - (getDate(f1)?.getTime() ?? 0);
|
||||
} else if (f1.dates && !f2.dates) {
|
||||
if (f1.dates && f22.dates) {
|
||||
return (getDate(f22)?.getTime() ?? 0) - (getDate(f1)?.getTime() ?? 0);
|
||||
} else if (f1.dates && !f22.dates) {
|
||||
return -1;
|
||||
} else if (!f1.dates && f2.dates) {
|
||||
} else if (!f1.dates && f22.dates) {
|
||||
return 1;
|
||||
}
|
||||
const f1Title = f1.frontmatter?.title?.toLowerCase() ?? "";
|
||||
const f2Title = f2.frontmatter?.title?.toLowerCase() ?? "";
|
||||
const f2Title = f22.frontmatter?.title?.toLowerCase() ?? "";
|
||||
return f1Title.localeCompare(f2Title);
|
||||
};
|
||||
}
|
||||
function DateDisplay({ date, locale }) {
|
||||
return /* @__PURE__ */ jsx("time", { dateTime: date.toISOString(), children: date.toLocaleDateString(locale, {
|
||||
return /* @__PURE__ */ u2("time", { dateTime: date.toISOString(), children: date.toLocaleDateString(locale, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "2-digit"
|
||||
|
|
@ -381,18 +418,18 @@ var PageList = ({
|
|||
list = list.slice(0, limit);
|
||||
}
|
||||
const fileSlug = fileData?.slug;
|
||||
return /* @__PURE__ */ jsx("ul", { class: "section-ul", children: list.map((page) => {
|
||||
return /* @__PURE__ */ u2("ul", { class: "section-ul", children: list.map((page) => {
|
||||
const title = page.frontmatter?.title;
|
||||
const tags = page.frontmatter?.tags ?? [];
|
||||
return /* @__PURE__ */ jsx("li", { class: "section-li", children: /* @__PURE__ */ jsxs("div", { class: "section", children: [
|
||||
/* @__PURE__ */ jsx("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ jsx(
|
||||
return /* @__PURE__ */ u2("li", { class: "section-li", children: /* @__PURE__ */ u2("div", { class: "section", children: [
|
||||
/* @__PURE__ */ u2("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ u2(
|
||||
DateDisplay,
|
||||
{
|
||||
date: getDate(page),
|
||||
locale: cfg?.locale ?? "en-US"
|
||||
}
|
||||
) }),
|
||||
/* @__PURE__ */ jsx("div", { class: "desc", children: /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(
|
||||
/* @__PURE__ */ u2("div", { class: "desc", children: /* @__PURE__ */ u2("h3", { children: /* @__PURE__ */ u2(
|
||||
"a",
|
||||
{
|
||||
href: resolveRelative(fileSlug ?? "", page.slug),
|
||||
|
|
@ -400,7 +437,7 @@ var PageList = ({
|
|||
children: title
|
||||
}
|
||||
) }) }),
|
||||
/* @__PURE__ */ jsx("ul", { class: "tags", children: tags.map((tag) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
||||
/* @__PURE__ */ u2("ul", { class: "tags", children: tags.map((tag) => /* @__PURE__ */ u2("li", { children: /* @__PURE__ */ u2(
|
||||
"a",
|
||||
{
|
||||
class: "internal tag-link",
|
||||
|
|
@ -659,7 +696,7 @@ var aria = create({
|
|||
ariaValueText: null,
|
||||
role: null
|
||||
},
|
||||
transform(_, property) {
|
||||
transform(_2, property) {
|
||||
return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
|
||||
}
|
||||
});
|
||||
|
|
@ -1612,7 +1649,7 @@ var xlink = create({
|
|||
xLinkType: null
|
||||
},
|
||||
space: "xlink",
|
||||
transform(_, property) {
|
||||
transform(_2, property) {
|
||||
return "xlink:" + property.slice(5).toLowerCase();
|
||||
}
|
||||
});
|
||||
|
|
@ -1629,7 +1666,7 @@ var xmlns = create({
|
|||
var xml = create({
|
||||
properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
|
||||
space: "xml",
|
||||
transform(_, property) {
|
||||
transform(_2, property) {
|
||||
return "xml:" + property.slice(3).toLowerCase();
|
||||
}
|
||||
});
|
||||
|
|
@ -2019,7 +2056,7 @@ function root(state, node, key) {
|
|||
addChildren(props, createChildren(state, node));
|
||||
return state.create(node, state.Fragment, props, key);
|
||||
}
|
||||
function text(_, node) {
|
||||
function text(_2, node) {
|
||||
return node.value;
|
||||
}
|
||||
function addNode(state, props, type, node) {
|
||||
|
|
@ -2035,11 +2072,11 @@ function addChildren(props, children) {
|
|||
}
|
||||
}
|
||||
}
|
||||
function productionCreate(_, jsx4, jsxs4) {
|
||||
function productionCreate(_2, jsx, jsxs) {
|
||||
return create2;
|
||||
function create2(_2, type, props, key) {
|
||||
function create2(_3, type, props, key) {
|
||||
const isStaticChildren = Array.isArray(props.children);
|
||||
const fn = isStaticChildren ? jsxs4 : jsx4;
|
||||
const fn = isStaticChildren ? jsxs : jsx;
|
||||
return key ? fn(type, props, key) : fn(type, props);
|
||||
}
|
||||
}
|
||||
|
|
@ -2256,24 +2293,26 @@ function transformStyleToCssCasing(from) {
|
|||
function toDash($0) {
|
||||
return "-" + $0.toLowerCase();
|
||||
}
|
||||
|
||||
// node_modules/@quartz-community/utils/dist/jsx.js
|
||||
function childrenToString(children) {
|
||||
if (typeof children === "string") return children;
|
||||
if (Array.isArray(children)) return children.map(childrenToString).join("");
|
||||
return String(children ?? "");
|
||||
}
|
||||
var builtinComponents = {
|
||||
table: (props) => /* @__PURE__ */ jsx("div", {
|
||||
table: (props) => /* @__PURE__ */ u2("div", {
|
||||
class: "table-container",
|
||||
children: /* @__PURE__ */ jsx("table", { ...props })
|
||||
children: /* @__PURE__ */ u2("table", { ...props })
|
||||
}),
|
||||
style: ({ children, ...rest }) => h("style", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } }),
|
||||
script: ({ children, ...rest }) => h("script", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } })
|
||||
style: ({ children, ...rest }) => k("style", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } }),
|
||||
script: ({ children, ...rest }) => k("script", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } })
|
||||
};
|
||||
function htmlToJsx(tree, components) {
|
||||
return toJsxRuntime(tree, {
|
||||
Fragment,
|
||||
jsx: jsx,
|
||||
jsxs: jsxs,
|
||||
Fragment: S,
|
||||
jsx: u2,
|
||||
jsxs: u2,
|
||||
elementAttributeNameCase: "html",
|
||||
components: { ...builtinComponents, ...components }
|
||||
});
|
||||
|
|
@ -2656,12 +2695,14 @@ function i18n(locale) {
|
|||
|
||||
// src/components/styles/listPage.scss
|
||||
var listPage_default = "ul.section-ul {\n list-style: none;\n margin-top: 2em;\n padding-left: 0;\n}\n\nli.section-li {\n margin-bottom: 1em;\n}\nli.section-li > .section {\n display: grid;\n grid-template-columns: fit-content(8em) 3fr 1fr;\n}\n@media all and (max-width: 600px) {\n li.section-li > .section > .tags {\n display: none;\n }\n}\nli.section-li > .section > .desc > h3 > a {\n background-color: transparent;\n}\nli.section-li > .section .meta {\n margin: 0 1em 0 0;\n opacity: 0.6;\n}\n\n.popover .section {\n grid-template-columns: fit-content(8em) 1fr !important;\n}\n.popover .section > .tags {\n display: none;\n}";
|
||||
|
||||
// src/components/FolderContent.tsx
|
||||
var defaultOptions = {
|
||||
showFolderCount: true,
|
||||
showSubfolders: true
|
||||
};
|
||||
function concatenateResources(...resources) {
|
||||
const result = resources.filter((r) => r !== void 0).flat();
|
||||
const result = resources.filter((r2) => r2 !== void 0).flat();
|
||||
return result.length === 0 ? void 0 : result;
|
||||
}
|
||||
function pagesFromTrie(folder, showSubfolders) {
|
||||
|
|
@ -2703,7 +2744,7 @@ function pagesFromAllFiles(allFiles, folderSlug, showSubfolders) {
|
|||
}
|
||||
}
|
||||
for (const [subfolderName, files] of subfolderFiles) {
|
||||
const indexFile = files.find((f) => f.slug === `${folderPrefix}${subfolderName}/index`);
|
||||
const indexFile = files.find((f3) => f3.slug === `${folderPrefix}${subfolderName}/index`);
|
||||
if (indexFile) continue;
|
||||
directChildren.push({
|
||||
slug: `${folderPrefix}${subfolderName}/index`,
|
||||
|
|
@ -2772,15 +2813,15 @@ var FolderContent_default = ((opts) => {
|
|||
const hastRoot = tree;
|
||||
const content = hastRoot.children.length === 0 ? fileData?.description : htmlToJsx(hastRoot);
|
||||
const pageListContent = PageList(listProps);
|
||||
return /* @__PURE__ */ jsxs("div", { class: "popover-hint", children: [
|
||||
/* @__PURE__ */ jsx("article", { class: classes, children: /* @__PURE__ */ jsx("div", { class: "markdown-preview-view markdown-rendered", children: content }) }),
|
||||
/* @__PURE__ */ jsxs("div", { class: "page-listing", children: [
|
||||
options.showFolderCount && /* @__PURE__ */ jsx("p", { children: i18n(
|
||||
return /* @__PURE__ */ u2("div", { class: "popover-hint", children: [
|
||||
/* @__PURE__ */ u2("article", { class: classes, children: /* @__PURE__ */ u2("div", { class: "markdown-preview-view markdown-rendered", children: content }) }),
|
||||
/* @__PURE__ */ u2("div", { class: "page-listing", children: [
|
||||
options.showFolderCount && /* @__PURE__ */ u2("p", { children: i18n(
|
||||
cfg?.locale ?? "en-US"
|
||||
).pages.folderContent.itemsUnderFolder({
|
||||
count: allPagesInFolder.length
|
||||
}) }),
|
||||
/* @__PURE__ */ jsx("div", { children: pageListContent })
|
||||
/* @__PURE__ */ u2("div", { children: pageListContent })
|
||||
] })
|
||||
] });
|
||||
};
|
||||
|
|
|
|||
2
dist/components/index.js.map
vendored
2
dist/components/index.js.map
vendored
File diff suppressed because one or more lines are too long
192
dist/index.js
vendored
192
dist/index.js
vendored
|
|
@ -1,5 +1,3 @@
|
|||
import { jsxs, jsx, Fragment } from 'preact/jsx-runtime';
|
||||
import { h } from 'preact';
|
||||
import path from 'path';
|
||||
|
||||
var __create = Object.create;
|
||||
|
|
@ -60,8 +58,8 @@ var require_cjs = __commonJS({
|
|||
function updatePosition(str) {
|
||||
var lines = str.match(NEWLINE_REGEX);
|
||||
if (lines) lineno += lines.length;
|
||||
var i = str.lastIndexOf(NEWLINE);
|
||||
column = ~i ? str.length - i : column + str.length;
|
||||
var i2 = str.lastIndexOf(NEWLINE);
|
||||
column = ~i2 ? str.length - i2 : column + str.length;
|
||||
}
|
||||
function position3() {
|
||||
var start2 = { line: lineno, column };
|
||||
|
|
@ -92,22 +90,22 @@ var require_cjs = __commonJS({
|
|||
}
|
||||
}
|
||||
function match(re2) {
|
||||
var m = re2.exec(style);
|
||||
if (!m) return;
|
||||
var str = m[0];
|
||||
var m2 = re2.exec(style);
|
||||
if (!m2) return;
|
||||
var str = m2[0];
|
||||
updatePosition(str);
|
||||
style = style.slice(str.length);
|
||||
return m;
|
||||
return m2;
|
||||
}
|
||||
function whitespace2() {
|
||||
match(WHITESPACE_REGEX);
|
||||
}
|
||||
function comments(rules) {
|
||||
var c;
|
||||
var c2;
|
||||
rules = rules || [];
|
||||
while (c = comment()) {
|
||||
if (c !== false) {
|
||||
rules.push(c);
|
||||
while (c2 = comment()) {
|
||||
if (c2 !== false) {
|
||||
rules.push(c2);
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
|
|
@ -115,18 +113,18 @@ var require_cjs = __commonJS({
|
|||
function comment() {
|
||||
var pos = position3();
|
||||
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
|
||||
var i = 2;
|
||||
while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
|
||||
++i;
|
||||
var i2 = 2;
|
||||
while (EMPTY_STRING != style.charAt(i2) && (ASTERISK != style.charAt(i2) || FORWARD_SLASH != style.charAt(i2 + 1))) {
|
||||
++i2;
|
||||
}
|
||||
i += 2;
|
||||
if (EMPTY_STRING === style.charAt(i - 1)) {
|
||||
i2 += 2;
|
||||
if (EMPTY_STRING === style.charAt(i2 - 1)) {
|
||||
return error("End of comment missing");
|
||||
}
|
||||
var str = style.slice(2, i - 2);
|
||||
var str = style.slice(2, i2 - 2);
|
||||
column += 2;
|
||||
updatePosition(str);
|
||||
style = style.slice(i);
|
||||
style = style.slice(i2);
|
||||
column += 2;
|
||||
return pos({
|
||||
type: TYPE_COMMENT,
|
||||
|
|
@ -296,29 +294,29 @@ function joinSegments(...args) {
|
|||
}
|
||||
return joined;
|
||||
}
|
||||
function endsWith(s, suffix) {
|
||||
return s === suffix || s.endsWith("/" + suffix);
|
||||
function endsWith(s2, suffix) {
|
||||
return s2 === suffix || s2.endsWith("/" + suffix);
|
||||
}
|
||||
function trimSuffix(s, suffix) {
|
||||
if (endsWith(s, suffix)) {
|
||||
s = s.slice(0, -suffix.length);
|
||||
function trimSuffix(s2, suffix) {
|
||||
if (endsWith(s2, suffix)) {
|
||||
s2 = s2.slice(0, -suffix.length);
|
||||
}
|
||||
return s;
|
||||
return s2;
|
||||
}
|
||||
function stripSlashes(s, onlyStripPrefix) {
|
||||
if (s.startsWith("/")) {
|
||||
s = s.substring(1);
|
||||
function stripSlashes(s2, onlyStripPrefix) {
|
||||
if (s2.startsWith("/")) {
|
||||
s2 = s2.substring(1);
|
||||
}
|
||||
if (!onlyStripPrefix && s.endsWith("/")) {
|
||||
s = s.slice(0, -1);
|
||||
if (!onlyStripPrefix && s2.endsWith("/")) {
|
||||
s2 = s2.slice(0, -1);
|
||||
}
|
||||
return s;
|
||||
return s2;
|
||||
}
|
||||
function isFolderPath(fplike) {
|
||||
return fplike.endsWith("/") || endsWith(fplike, "index") || endsWith(fplike, "index.md") || endsWith(fplike, "index.html");
|
||||
}
|
||||
function pathToRoot(slug2) {
|
||||
let rootPath = slug2.split("/").filter((x) => x !== "").slice(0, -1).map((_) => "..").join("/");
|
||||
let rootPath = slug2.split("/").filter((x2) => x2 !== "").slice(0, -1).map((_2) => "..").join("/");
|
||||
if (rootPath.length === 0) {
|
||||
rootPath = ".";
|
||||
}
|
||||
|
|
@ -328,26 +326,66 @@ function resolveRelative(current, target) {
|
|||
const res = joinSegments(pathToRoot(current), simplifySlug(target));
|
||||
return res;
|
||||
}
|
||||
|
||||
// node_modules/preact/dist/preact.mjs
|
||||
var n;
|
||||
var l;
|
||||
var u;
|
||||
var w = [];
|
||||
function k(l2, u3, t2) {
|
||||
var i2, r2, o2, e2 = {};
|
||||
for (o2 in u3) "key" == o2 ? i2 = u3[o2] : "ref" == o2 ? r2 = u3[o2] : e2[o2] = u3[o2];
|
||||
if (arguments.length > 2 && (e2.children = arguments.length > 3 ? n.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps) for (o2 in l2.defaultProps) void 0 === e2[o2] && (e2[o2] = l2.defaultProps[o2]);
|
||||
return x(l2, e2, i2, r2, null);
|
||||
}
|
||||
function x(n2, t2, i2, r2, o2) {
|
||||
var e2 = { type: n2, props: t2, key: i2, ref: r2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: null == o2 ? ++u : o2, __i: -1, __u: 0 };
|
||||
return null != l.vnode && l.vnode(e2), e2;
|
||||
}
|
||||
function S(n2) {
|
||||
return n2.children;
|
||||
}
|
||||
n = w.slice, l = { __e: function(n2, l2, u3, t2) {
|
||||
for (var i2, r2, o2; l2 = l2.__; ) if ((i2 = l2.__c) && !i2.__) try {
|
||||
if ((r2 = i2.constructor) && null != r2.getDerivedStateFromError && (i2.setState(r2.getDerivedStateFromError(n2)), o2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), o2 = i2.__d), o2) return i2.__E = i2;
|
||||
} catch (l3) {
|
||||
n2 = l3;
|
||||
}
|
||||
throw n2;
|
||||
} }, u = 0, "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Math.random().toString(8);
|
||||
|
||||
// node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs
|
||||
var f2 = 0;
|
||||
function u2(e2, t2, n2, o2, i2, u3) {
|
||||
t2 || (t2 = {});
|
||||
var a2, c2, p2 = t2;
|
||||
if ("ref" in p2) for (c2 in p2 = {}, t2) "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
|
||||
var l2 = { type: e2, props: p2, key: n2, ref: a2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --f2, __i: -1, __u: 0, __source: i2, __self: u3 };
|
||||
if ("function" == typeof e2 && (a2 = e2.defaultProps)) for (c2 in a2) void 0 === p2[c2] && (p2[c2] = a2[c2]);
|
||||
return l.vnode && l.vnode(l2), l2;
|
||||
}
|
||||
|
||||
// src/components/PageList.tsx
|
||||
function byDateAndAlphabeticalFolderFirst(_cfg) {
|
||||
return (f1, f2) => {
|
||||
return (f1, f22) => {
|
||||
const f1IsFolder = isFolderPath(f1.slug ?? "");
|
||||
const f2IsFolder = isFolderPath(f2.slug ?? "");
|
||||
const f2IsFolder = isFolderPath(f22.slug ?? "");
|
||||
if (f1IsFolder && !f2IsFolder) return -1;
|
||||
if (!f1IsFolder && f2IsFolder) return 1;
|
||||
if (f1.dates && f2.dates) {
|
||||
return (getDate(f2)?.getTime() ?? 0) - (getDate(f1)?.getTime() ?? 0);
|
||||
} else if (f1.dates && !f2.dates) {
|
||||
if (f1.dates && f22.dates) {
|
||||
return (getDate(f22)?.getTime() ?? 0) - (getDate(f1)?.getTime() ?? 0);
|
||||
} else if (f1.dates && !f22.dates) {
|
||||
return -1;
|
||||
} else if (!f1.dates && f2.dates) {
|
||||
} else if (!f1.dates && f22.dates) {
|
||||
return 1;
|
||||
}
|
||||
const f1Title = f1.frontmatter?.title?.toLowerCase() ?? "";
|
||||
const f2Title = f2.frontmatter?.title?.toLowerCase() ?? "";
|
||||
const f2Title = f22.frontmatter?.title?.toLowerCase() ?? "";
|
||||
return f1Title.localeCompare(f2Title);
|
||||
};
|
||||
}
|
||||
function DateDisplay({ date, locale }) {
|
||||
return /* @__PURE__ */ jsx("time", { dateTime: date.toISOString(), children: date.toLocaleDateString(locale, {
|
||||
return /* @__PURE__ */ u2("time", { dateTime: date.toISOString(), children: date.toLocaleDateString(locale, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "2-digit"
|
||||
|
|
@ -366,18 +404,18 @@ var PageList = ({
|
|||
list = list.slice(0, limit);
|
||||
}
|
||||
const fileSlug = fileData?.slug;
|
||||
return /* @__PURE__ */ jsx("ul", { class: "section-ul", children: list.map((page) => {
|
||||
return /* @__PURE__ */ u2("ul", { class: "section-ul", children: list.map((page) => {
|
||||
const title = page.frontmatter?.title;
|
||||
const tags = page.frontmatter?.tags ?? [];
|
||||
return /* @__PURE__ */ jsx("li", { class: "section-li", children: /* @__PURE__ */ jsxs("div", { class: "section", children: [
|
||||
/* @__PURE__ */ jsx("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ jsx(
|
||||
return /* @__PURE__ */ u2("li", { class: "section-li", children: /* @__PURE__ */ u2("div", { class: "section", children: [
|
||||
/* @__PURE__ */ u2("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ u2(
|
||||
DateDisplay,
|
||||
{
|
||||
date: getDate(page),
|
||||
locale: cfg?.locale ?? "en-US"
|
||||
}
|
||||
) }),
|
||||
/* @__PURE__ */ jsx("div", { class: "desc", children: /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(
|
||||
/* @__PURE__ */ u2("div", { class: "desc", children: /* @__PURE__ */ u2("h3", { children: /* @__PURE__ */ u2(
|
||||
"a",
|
||||
{
|
||||
href: resolveRelative(fileSlug ?? "", page.slug),
|
||||
|
|
@ -385,7 +423,7 @@ var PageList = ({
|
|||
children: title
|
||||
}
|
||||
) }) }),
|
||||
/* @__PURE__ */ jsx("ul", { class: "tags", children: tags.map((tag) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
||||
/* @__PURE__ */ u2("ul", { class: "tags", children: tags.map((tag) => /* @__PURE__ */ u2("li", { children: /* @__PURE__ */ u2(
|
||||
"a",
|
||||
{
|
||||
class: "internal tag-link",
|
||||
|
|
@ -644,7 +682,7 @@ var aria = create({
|
|||
ariaValueText: null,
|
||||
role: null
|
||||
},
|
||||
transform(_, property) {
|
||||
transform(_2, property) {
|
||||
return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
|
||||
}
|
||||
});
|
||||
|
|
@ -1597,7 +1635,7 @@ var xlink = create({
|
|||
xLinkType: null
|
||||
},
|
||||
space: "xlink",
|
||||
transform(_, property) {
|
||||
transform(_2, property) {
|
||||
return "xlink:" + property.slice(5).toLowerCase();
|
||||
}
|
||||
});
|
||||
|
|
@ -1614,7 +1652,7 @@ var xmlns = create({
|
|||
var xml = create({
|
||||
properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
|
||||
space: "xml",
|
||||
transform(_, property) {
|
||||
transform(_2, property) {
|
||||
return "xml:" + property.slice(3).toLowerCase();
|
||||
}
|
||||
});
|
||||
|
|
@ -2004,7 +2042,7 @@ function root(state, node, key) {
|
|||
addChildren(props, createChildren(state, node));
|
||||
return state.create(node, state.Fragment, props, key);
|
||||
}
|
||||
function text(_, node) {
|
||||
function text(_2, node) {
|
||||
return node.value;
|
||||
}
|
||||
function addNode(state, props, type, node) {
|
||||
|
|
@ -2020,11 +2058,11 @@ function addChildren(props, children) {
|
|||
}
|
||||
}
|
||||
}
|
||||
function productionCreate(_, jsx4, jsxs4) {
|
||||
function productionCreate(_2, jsx, jsxs) {
|
||||
return create2;
|
||||
function create2(_2, type, props, key) {
|
||||
function create2(_3, type, props, key) {
|
||||
const isStaticChildren = Array.isArray(props.children);
|
||||
const fn = isStaticChildren ? jsxs4 : jsx4;
|
||||
const fn = isStaticChildren ? jsxs : jsx;
|
||||
return key ? fn(type, props, key) : fn(type, props);
|
||||
}
|
||||
}
|
||||
|
|
@ -2241,24 +2279,26 @@ function transformStyleToCssCasing(from) {
|
|||
function toDash($0) {
|
||||
return "-" + $0.toLowerCase();
|
||||
}
|
||||
|
||||
// node_modules/@quartz-community/utils/dist/jsx.js
|
||||
function childrenToString(children) {
|
||||
if (typeof children === "string") return children;
|
||||
if (Array.isArray(children)) return children.map(childrenToString).join("");
|
||||
return String(children ?? "");
|
||||
}
|
||||
var builtinComponents = {
|
||||
table: (props) => /* @__PURE__ */ jsx("div", {
|
||||
table: (props) => /* @__PURE__ */ u2("div", {
|
||||
class: "table-container",
|
||||
children: /* @__PURE__ */ jsx("table", { ...props })
|
||||
children: /* @__PURE__ */ u2("table", { ...props })
|
||||
}),
|
||||
style: ({ children, ...rest }) => h("style", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } }),
|
||||
script: ({ children, ...rest }) => h("script", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } })
|
||||
style: ({ children, ...rest }) => k("style", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } }),
|
||||
script: ({ children, ...rest }) => k("script", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } })
|
||||
};
|
||||
function htmlToJsx(tree, components) {
|
||||
return toJsxRuntime(tree, {
|
||||
Fragment,
|
||||
jsx: jsx,
|
||||
jsxs: jsxs,
|
||||
Fragment: S,
|
||||
jsx: u2,
|
||||
jsxs: u2,
|
||||
elementAttributeNameCase: "html",
|
||||
components: { ...builtinComponents, ...components }
|
||||
});
|
||||
|
|
@ -2641,12 +2681,14 @@ function i18n(locale) {
|
|||
|
||||
// src/components/styles/listPage.scss
|
||||
var listPage_default = "ul.section-ul {\n list-style: none;\n margin-top: 2em;\n padding-left: 0;\n}\n\nli.section-li {\n margin-bottom: 1em;\n}\nli.section-li > .section {\n display: grid;\n grid-template-columns: fit-content(8em) 3fr 1fr;\n}\n@media all and (max-width: 600px) {\n li.section-li > .section > .tags {\n display: none;\n }\n}\nli.section-li > .section > .desc > h3 > a {\n background-color: transparent;\n}\nli.section-li > .section .meta {\n margin: 0 1em 0 0;\n opacity: 0.6;\n}\n\n.popover .section {\n grid-template-columns: fit-content(8em) 1fr !important;\n}\n.popover .section > .tags {\n display: none;\n}";
|
||||
|
||||
// src/components/FolderContent.tsx
|
||||
var defaultOptions = {
|
||||
showFolderCount: true,
|
||||
showSubfolders: true
|
||||
};
|
||||
function concatenateResources(...resources) {
|
||||
const result = resources.filter((r) => r !== void 0).flat();
|
||||
const result = resources.filter((r2) => r2 !== void 0).flat();
|
||||
return result.length === 0 ? void 0 : result;
|
||||
}
|
||||
function pagesFromTrie(folder, showSubfolders) {
|
||||
|
|
@ -2688,7 +2730,7 @@ function pagesFromAllFiles(allFiles, folderSlug, showSubfolders) {
|
|||
}
|
||||
}
|
||||
for (const [subfolderName, files] of subfolderFiles) {
|
||||
const indexFile = files.find((f) => f.slug === `${folderPrefix}${subfolderName}/index`);
|
||||
const indexFile = files.find((f3) => f3.slug === `${folderPrefix}${subfolderName}/index`);
|
||||
if (indexFile) continue;
|
||||
directChildren.push({
|
||||
slug: `${folderPrefix}${subfolderName}/index`,
|
||||
|
|
@ -2757,15 +2799,15 @@ var FolderContent_default = ((opts) => {
|
|||
const hastRoot = tree;
|
||||
const content = hastRoot.children.length === 0 ? fileData?.description : htmlToJsx(hastRoot);
|
||||
const pageListContent = PageList(listProps);
|
||||
return /* @__PURE__ */ jsxs("div", { class: "popover-hint", children: [
|
||||
/* @__PURE__ */ jsx("article", { class: classes, children: /* @__PURE__ */ jsx("div", { class: "markdown-preview-view markdown-rendered", children: content }) }),
|
||||
/* @__PURE__ */ jsxs("div", { class: "page-listing", children: [
|
||||
options.showFolderCount && /* @__PURE__ */ jsx("p", { children: i18n(
|
||||
return /* @__PURE__ */ u2("div", { class: "popover-hint", children: [
|
||||
/* @__PURE__ */ u2("article", { class: classes, children: /* @__PURE__ */ u2("div", { class: "markdown-preview-view markdown-rendered", children: content }) }),
|
||||
/* @__PURE__ */ u2("div", { class: "page-listing", children: [
|
||||
options.showFolderCount && /* @__PURE__ */ u2("p", { children: i18n(
|
||||
cfg?.locale ?? "en-US"
|
||||
).pages.folderContent.itemsUnderFolder({
|
||||
count: allPagesInFolder.length
|
||||
}) }),
|
||||
/* @__PURE__ */ jsx("div", { children: pageListContent })
|
||||
/* @__PURE__ */ u2("div", { children: pageListContent })
|
||||
] })
|
||||
] });
|
||||
};
|
||||
|
|
@ -2791,24 +2833,24 @@ var FolderPage = (opts) => {
|
|||
priority: 10,
|
||||
match: folderMatcher,
|
||||
generate({ content, cfg }) {
|
||||
const allFiles = content.map((c) => c[1].data).filter((d) => d?.unlisted !== true);
|
||||
const allFiles = content.map((c2) => c2[1].data).filter((d2) => d2?.unlisted !== true);
|
||||
const locale = cfg?.locale ?? "en-US";
|
||||
const folders = /* @__PURE__ */ new Set();
|
||||
const folderDisplayNames = /* @__PURE__ */ new Map();
|
||||
for (const file of allFiles) {
|
||||
const slug2 = file?.slug;
|
||||
if (!slug2) continue;
|
||||
const fileFolders = getFolders(slug2).filter((f) => f !== "." && f !== "tags");
|
||||
for (const f of fileFolders) {
|
||||
folders.add(f);
|
||||
const fileFolders = getFolders(slug2).filter((f3) => f3 !== "." && f3 !== "tags");
|
||||
for (const f3 of fileFolders) {
|
||||
folders.add(f3);
|
||||
}
|
||||
const relativePath = file?.relativePath;
|
||||
if (relativePath) {
|
||||
const slugParts = path.dirname(slug2).split("/").filter((s) => s !== ".");
|
||||
const pathParts = path.dirname(relativePath).split("/").filter((s) => s !== ".");
|
||||
for (let i = 0; i < slugParts.length && i < pathParts.length; i++) {
|
||||
const slugPart = slugParts[i];
|
||||
const pathPart = pathParts[i];
|
||||
const slugParts = path.dirname(slug2).split("/").filter((s2) => s2 !== ".");
|
||||
const pathParts = path.dirname(relativePath).split("/").filter((s2) => s2 !== ".");
|
||||
for (let i2 = 0; i2 < slugParts.length && i2 < pathParts.length; i2++) {
|
||||
const slugPart = slugParts[i2];
|
||||
const pathPart = pathParts[i2];
|
||||
if (slugPart && pathPart && !folderDisplayNames.has(slugPart)) {
|
||||
folderDisplayNames.set(slugPart, pathPart);
|
||||
}
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue