mirror of
https://github.com/quartz-community/page-title.git
synced 2026-07-22 02:50:31 +00:00
build: bundle dependencies and ship pre-built dist
This commit is contained in:
parent
9de1035319
commit
b56138e469
4 changed files with 50 additions and 10 deletions
28
dist/components/index.js
vendored
28
dist/components/index.js
vendored
|
|
@ -1,5 +1,3 @@
|
|||
import { jsx } from 'preact/jsx-runtime';
|
||||
|
||||
// node_modules/@quartz-community/utils/dist/lang.js
|
||||
function classNames(...classes) {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
|
|
@ -7,7 +5,7 @@ function classNames(...classes) {
|
|||
|
||||
// src/util/path.ts
|
||||
function pathToRoot(slug) {
|
||||
let rootPath = slug.split("/").filter((x) => x !== "").slice(0, -1).map((_) => "..").join("/");
|
||||
let rootPath = slug.split("/").filter((x2) => x2 !== "").slice(0, -1).map((_2) => "..").join("/");
|
||||
if (rootPath.length === 0) {
|
||||
rootPath = ".";
|
||||
}
|
||||
|
|
@ -28,11 +26,33 @@ var locales = {
|
|||
function i18n(locale) {
|
||||
return locales[locale] || en_US_default;
|
||||
}
|
||||
var l;
|
||||
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;
|
||||
} }, "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/PageTitle.tsx
|
||||
var PageTitle = ({ fileData, cfg, displayClass }) => {
|
||||
const locale = cfg?.locale ?? "en-US";
|
||||
const title = cfg?.pageTitle ?? i18n(locale).propertyDefaults.title;
|
||||
const baseDir = pathToRoot(fileData.slug);
|
||||
return /* @__PURE__ */ jsx("h2", { class: classNames(displayClass, "page-title"), children: /* @__PURE__ */ jsx("a", { href: baseDir, children: title }) });
|
||||
return /* @__PURE__ */ u2("h2", { class: classNames(displayClass, "page-title"), children: /* @__PURE__ */ u2("a", { href: baseDir, children: title }) });
|
||||
};
|
||||
PageTitle.css = `
|
||||
.page-title {
|
||||
|
|
|
|||
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
28
dist/index.js
vendored
28
dist/index.js
vendored
|
|
@ -1,5 +1,3 @@
|
|||
import { jsx } from 'preact/jsx-runtime';
|
||||
|
||||
// node_modules/@quartz-community/utils/dist/lang.js
|
||||
function classNames(...classes) {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
|
|
@ -7,7 +5,7 @@ function classNames(...classes) {
|
|||
|
||||
// src/util/path.ts
|
||||
function pathToRoot(slug) {
|
||||
let rootPath = slug.split("/").filter((x) => x !== "").slice(0, -1).map((_) => "..").join("/");
|
||||
let rootPath = slug.split("/").filter((x2) => x2 !== "").slice(0, -1).map((_2) => "..").join("/");
|
||||
if (rootPath.length === 0) {
|
||||
rootPath = ".";
|
||||
}
|
||||
|
|
@ -28,11 +26,33 @@ var locales = {
|
|||
function i18n(locale) {
|
||||
return locales[locale] || en_US_default;
|
||||
}
|
||||
var l;
|
||||
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;
|
||||
} }, "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/PageTitle.tsx
|
||||
var PageTitle = ({ fileData, cfg, displayClass }) => {
|
||||
const locale = cfg?.locale ?? "en-US";
|
||||
const title = cfg?.pageTitle ?? i18n(locale).propertyDefaults.title;
|
||||
const baseDir = pathToRoot(fileData.slug);
|
||||
return /* @__PURE__ */ jsx("h2", { class: classNames(displayClass, "page-title"), children: /* @__PURE__ */ jsx("a", { href: baseDir, children: title }) });
|
||||
return /* @__PURE__ */ u2("h2", { class: classNames(displayClass, "page-title"), children: /* @__PURE__ */ u2("a", { href: baseDir, children: title }) });
|
||||
};
|
||||
PageTitle.css = `
|
||||
.page-title {
|
||||
|
|
|
|||
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