mirror of
https://github.com/quartz-community/folder-page.git
synced 2026-07-22 02:50:24 +00:00
Respect the file.data.unlisted convention in both the folder discovery loop (virtual folder index generation in pageType.generate) and the folder listing itself (pagesFromAllFiles and pagesFromTrie in FolderContent). Unlisted pages no longer contribute folders or subfolders, and no longer appear as entries inside any folder page listing. The foldersWithIndex detection loop also skips unlisted pages so a user-authored unlisted index file does not bypass the filter. Exports pagesFromAllFiles so its filter logic can be tested directly. Adds 5 unit tests covering unlisted exclusion, explicit unlisted: false passthrough, subfolder grouping, and folder-index self-exclusion.
2793 lines
No EOL
80 KiB
JavaScript
2793 lines
No EOL
80 KiB
JavaScript
import { jsx, jsxs, Fragment } from 'preact/jsx-runtime';
|
|
import { h } from 'preact';
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __export = (target, all) => {
|
|
for (var name2 in all)
|
|
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
// file that has been converted to a CommonJS file using a Babel-
|
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
mod
|
|
));
|
|
|
|
// node_modules/inline-style-parser/cjs/index.js
|
|
var require_cjs = __commonJS({
|
|
"node_modules/inline-style-parser/cjs/index.js"(exports$1, module) {
|
|
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
var NEWLINE_REGEX = /\n/g;
|
|
var WHITESPACE_REGEX = /^\s*/;
|
|
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
|
|
var COLON_REGEX = /^:\s*/;
|
|
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
|
|
var SEMICOLON_REGEX = /^[;\s]*/;
|
|
var TRIM_REGEX = /^\s+|\s+$/g;
|
|
var NEWLINE = "\n";
|
|
var FORWARD_SLASH = "/";
|
|
var ASTERISK = "*";
|
|
var EMPTY_STRING = "";
|
|
var TYPE_COMMENT = "comment";
|
|
var TYPE_DECLARATION = "declaration";
|
|
function index2(style, options) {
|
|
if (typeof style !== "string") {
|
|
throw new TypeError("First argument must be a string");
|
|
}
|
|
if (!style) return [];
|
|
options = options || {};
|
|
var lineno = 1;
|
|
var column = 1;
|
|
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;
|
|
}
|
|
function position3() {
|
|
var start2 = { line: lineno, column };
|
|
return function(node) {
|
|
node.position = new Position(start2);
|
|
whitespace2();
|
|
return node;
|
|
};
|
|
}
|
|
function Position(start2) {
|
|
this.start = start2;
|
|
this.end = { line: lineno, column };
|
|
this.source = options.source;
|
|
}
|
|
Position.prototype.content = style;
|
|
function error(msg) {
|
|
var err = new Error(
|
|
options.source + ":" + lineno + ":" + column + ": " + msg
|
|
);
|
|
err.reason = msg;
|
|
err.filename = options.source;
|
|
err.line = lineno;
|
|
err.column = column;
|
|
err.source = style;
|
|
if (options.silent) ;
|
|
else {
|
|
throw err;
|
|
}
|
|
}
|
|
function match(re2) {
|
|
var m = re2.exec(style);
|
|
if (!m) return;
|
|
var str = m[0];
|
|
updatePosition(str);
|
|
style = style.slice(str.length);
|
|
return m;
|
|
}
|
|
function whitespace2() {
|
|
match(WHITESPACE_REGEX);
|
|
}
|
|
function comments(rules) {
|
|
var c;
|
|
rules = rules || [];
|
|
while (c = comment()) {
|
|
if (c !== false) {
|
|
rules.push(c);
|
|
}
|
|
}
|
|
return rules;
|
|
}
|
|
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;
|
|
}
|
|
i += 2;
|
|
if (EMPTY_STRING === style.charAt(i - 1)) {
|
|
return error("End of comment missing");
|
|
}
|
|
var str = style.slice(2, i - 2);
|
|
column += 2;
|
|
updatePosition(str);
|
|
style = style.slice(i);
|
|
column += 2;
|
|
return pos({
|
|
type: TYPE_COMMENT,
|
|
comment: str
|
|
});
|
|
}
|
|
function declaration() {
|
|
var pos = position3();
|
|
var prop = match(PROPERTY_REGEX);
|
|
if (!prop) return;
|
|
comment();
|
|
if (!match(COLON_REGEX)) return error("property missing ':'");
|
|
var val = match(VALUE_REGEX);
|
|
var ret = pos({
|
|
type: TYPE_DECLARATION,
|
|
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
|
|
value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
|
|
});
|
|
match(SEMICOLON_REGEX);
|
|
return ret;
|
|
}
|
|
function declarations() {
|
|
var decls = [];
|
|
comments(decls);
|
|
var decl;
|
|
while (decl = declaration()) {
|
|
if (decl !== false) {
|
|
decls.push(decl);
|
|
comments(decls);
|
|
}
|
|
}
|
|
return decls;
|
|
}
|
|
whitespace2();
|
|
return declarations();
|
|
}
|
|
function trim(str) {
|
|
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
|
|
}
|
|
module.exports = index2;
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-object/cjs/index.js
|
|
var require_cjs2 = __commonJS({
|
|
"node_modules/style-to-object/cjs/index.js"(exports$1) {
|
|
var __importDefault = exports$1 && exports$1.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
exports$1.default = StyleToObject;
|
|
var inline_style_parser_1 = __importDefault(require_cjs());
|
|
function StyleToObject(style, iterator) {
|
|
let styleObject = null;
|
|
if (!style || typeof style !== "string") {
|
|
return styleObject;
|
|
}
|
|
const declarations = (0, inline_style_parser_1.default)(style);
|
|
const hasIterator = typeof iterator === "function";
|
|
declarations.forEach((declaration) => {
|
|
if (declaration.type !== "declaration") {
|
|
return;
|
|
}
|
|
const { property, value } = declaration;
|
|
if (hasIterator) {
|
|
iterator(property, value, declaration);
|
|
} else if (value) {
|
|
styleObject = styleObject || {};
|
|
styleObject[property] = value;
|
|
}
|
|
});
|
|
return styleObject;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-js/cjs/utilities.js
|
|
var require_utilities = __commonJS({
|
|
"node_modules/style-to-js/cjs/utilities.js"(exports$1) {
|
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
exports$1.camelCase = void 0;
|
|
var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
|
|
var HYPHEN_REGEX = /-([a-z])/g;
|
|
var NO_HYPHEN_REGEX = /^[^-]+$/;
|
|
var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
|
|
var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
|
|
var skipCamelCase = function(property) {
|
|
return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property);
|
|
};
|
|
var capitalize = function(match, character) {
|
|
return character.toUpperCase();
|
|
};
|
|
var trimHyphen = function(match, prefix) {
|
|
return "".concat(prefix, "-");
|
|
};
|
|
var camelCase = function(property, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
if (skipCamelCase(property)) {
|
|
return property;
|
|
}
|
|
property = property.toLowerCase();
|
|
if (options.reactCompat) {
|
|
property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
|
|
} else {
|
|
property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
|
|
}
|
|
return property.replace(HYPHEN_REGEX, capitalize);
|
|
};
|
|
exports$1.camelCase = camelCase;
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-js/cjs/index.js
|
|
var require_cjs3 = __commonJS({
|
|
"node_modules/style-to-js/cjs/index.js"(exports$1, module) {
|
|
var __importDefault = exports$1 && exports$1.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
var style_to_object_1 = __importDefault(require_cjs2());
|
|
var utilities_1 = require_utilities();
|
|
function StyleToJS(style, options) {
|
|
var output = {};
|
|
if (!style || typeof style !== "string") {
|
|
return output;
|
|
}
|
|
(0, style_to_object_1.default)(style, function(property, value) {
|
|
if (property && value) {
|
|
output[(0, utilities_1.camelCase)(property, options)] = value;
|
|
}
|
|
});
|
|
return output;
|
|
}
|
|
StyleToJS.default = StyleToJS;
|
|
module.exports = StyleToJS;
|
|
}
|
|
});
|
|
|
|
// node_modules/@quartz-community/utils/dist/sort.js
|
|
function getDate(data) {
|
|
const defaultDateType = data.defaultDateType;
|
|
if (!defaultDateType) {
|
|
return void 0;
|
|
}
|
|
const dates = data.dates;
|
|
return dates?.[defaultDateType];
|
|
}
|
|
function byDateAndAlphabetical() {
|
|
return (f1, f2) => {
|
|
const f1Date = getDate(f1);
|
|
const f2Date = getDate(f2);
|
|
if (f1Date && f2Date) {
|
|
return f2Date.getTime() - f1Date.getTime();
|
|
} else if (f1Date && !f2Date) {
|
|
return -1;
|
|
} else if (!f1Date && f2Date) {
|
|
return 1;
|
|
}
|
|
const f1Title = (f1.frontmatter?.title ?? "").toLowerCase();
|
|
const f2Title = (f2.frontmatter?.title ?? "").toLowerCase();
|
|
return f1Title.localeCompare(f2Title);
|
|
};
|
|
}
|
|
|
|
// node_modules/@quartz-community/utils/dist/path.js
|
|
function simplifySlug(fp) {
|
|
const res = stripSlashes(trimSuffix(fp, "index"), true);
|
|
return res.length === 0 ? "/" : res;
|
|
}
|
|
function joinSegments(...args) {
|
|
if (args.length === 0) {
|
|
return "";
|
|
}
|
|
let joined = args.filter((segment) => segment !== "" && segment !== "/").map((segment) => stripSlashes(segment)).join("/");
|
|
const first = args[0];
|
|
const last = args[args.length - 1];
|
|
if (first?.startsWith("/")) {
|
|
joined = "/" + joined;
|
|
}
|
|
if (last?.endsWith("/")) {
|
|
joined = joined + "/";
|
|
}
|
|
return joined;
|
|
}
|
|
function endsWith(s, suffix) {
|
|
return s === suffix || s.endsWith("/" + suffix);
|
|
}
|
|
function trimSuffix(s, suffix) {
|
|
if (endsWith(s, suffix)) {
|
|
s = s.slice(0, -suffix.length);
|
|
}
|
|
return s;
|
|
}
|
|
function stripSlashes(s, onlyStripPrefix) {
|
|
if (s.startsWith("/")) {
|
|
s = s.substring(1);
|
|
}
|
|
if (!onlyStripPrefix && s.endsWith("/")) {
|
|
s = s.slice(0, -1);
|
|
}
|
|
return s;
|
|
}
|
|
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("/");
|
|
if (rootPath.length === 0) {
|
|
rootPath = ".";
|
|
}
|
|
return rootPath;
|
|
}
|
|
function resolveRelative(current, target) {
|
|
const res = joinSegments(pathToRoot(current), simplifySlug(target));
|
|
return res;
|
|
}
|
|
function byDateAndAlphabeticalFolderFirst(_cfg) {
|
|
return (f1, f2) => {
|
|
const f1IsFolder = isFolderPath(f1.slug ?? "");
|
|
const f2IsFolder = isFolderPath(f2.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) {
|
|
return -1;
|
|
} else if (!f1.dates && f2.dates) {
|
|
return 1;
|
|
}
|
|
const f1Title = f1.frontmatter?.title?.toLowerCase() ?? "";
|
|
const f2Title = f2.frontmatter?.title?.toLowerCase() ?? "";
|
|
return f1Title.localeCompare(f2Title);
|
|
};
|
|
}
|
|
function DateDisplay({ date, locale }) {
|
|
return /* @__PURE__ */ jsx("time", { dateTime: date.toISOString(), children: date.toLocaleDateString(locale, {
|
|
year: "numeric",
|
|
month: "short",
|
|
day: "2-digit"
|
|
}) });
|
|
}
|
|
var PageList = ({
|
|
cfg,
|
|
fileData,
|
|
allFiles,
|
|
limit,
|
|
sort
|
|
}) => {
|
|
const sorter = sort ?? byDateAndAlphabeticalFolderFirst();
|
|
let list = [...allFiles].sort(sorter);
|
|
if (limit) {
|
|
list = list.slice(0, limit);
|
|
}
|
|
const fileSlug = fileData?.slug;
|
|
return /* @__PURE__ */ jsx("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(
|
|
DateDisplay,
|
|
{
|
|
date: getDate(page),
|
|
locale: cfg?.locale ?? "en-US"
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsx("div", { class: "desc", children: /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(
|
|
"a",
|
|
{
|
|
href: resolveRelative(fileSlug ?? "", page.slug),
|
|
class: "internal",
|
|
children: title
|
|
}
|
|
) }) }),
|
|
/* @__PURE__ */ jsx("ul", { class: "tags", children: tags.map((tag) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
"a",
|
|
{
|
|
class: "internal tag-link",
|
|
href: resolveRelative(
|
|
fileSlug ?? "",
|
|
`tags/${tag}`
|
|
),
|
|
children: tag
|
|
}
|
|
) })) })
|
|
] }) });
|
|
}) });
|
|
};
|
|
PageList.css = `
|
|
.section h3 {
|
|
margin: 0;
|
|
}
|
|
|
|
.section > .tags {
|
|
margin: 0;
|
|
}
|
|
`;
|
|
|
|
// node_modules/comma-separated-tokens/index.js
|
|
function stringify(values, options) {
|
|
const settings = {};
|
|
const input = values[values.length - 1] === "" ? [...values, ""] : values;
|
|
return input.join(
|
|
(settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ")
|
|
).trim();
|
|
}
|
|
|
|
// node_modules/devlop/lib/default.js
|
|
function ok() {
|
|
}
|
|
|
|
// node_modules/estree-util-is-identifier-name/lib/index.js
|
|
var nameRe = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u;
|
|
var nameReJsx = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u;
|
|
var emptyOptions = {};
|
|
function name(name2, options) {
|
|
const settings = emptyOptions;
|
|
const re2 = settings.jsx ? nameReJsx : nameRe;
|
|
return re2.test(name2);
|
|
}
|
|
|
|
// node_modules/hast-util-whitespace/lib/index.js
|
|
var re = /[ \t\n\f\r]/g;
|
|
function whitespace(thing) {
|
|
return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
|
|
}
|
|
function empty(value) {
|
|
return value.replace(re, "") === "";
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/schema.js
|
|
var Schema = class {
|
|
/**
|
|
* @param {SchemaType['property']} property
|
|
* Property.
|
|
* @param {SchemaType['normal']} normal
|
|
* Normal.
|
|
* @param {Space | undefined} [space]
|
|
* Space.
|
|
* @returns
|
|
* Schema.
|
|
*/
|
|
constructor(property, normal, space) {
|
|
this.normal = normal;
|
|
this.property = property;
|
|
if (space) {
|
|
this.space = space;
|
|
}
|
|
}
|
|
};
|
|
Schema.prototype.normal = {};
|
|
Schema.prototype.property = {};
|
|
Schema.prototype.space = void 0;
|
|
|
|
// node_modules/property-information/lib/util/merge.js
|
|
function merge(definitions, space) {
|
|
const property = {};
|
|
const normal = {};
|
|
for (const definition of definitions) {
|
|
Object.assign(property, definition.property);
|
|
Object.assign(normal, definition.normal);
|
|
}
|
|
return new Schema(property, normal, space);
|
|
}
|
|
|
|
// node_modules/property-information/lib/normalize.js
|
|
function normalize(value) {
|
|
return value.toLowerCase();
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/info.js
|
|
var Info = class {
|
|
/**
|
|
* @param {string} property
|
|
* Property.
|
|
* @param {string} attribute
|
|
* Attribute.
|
|
* @returns
|
|
* Info.
|
|
*/
|
|
constructor(property, attribute) {
|
|
this.attribute = attribute;
|
|
this.property = property;
|
|
}
|
|
};
|
|
Info.prototype.attribute = "";
|
|
Info.prototype.booleanish = false;
|
|
Info.prototype.boolean = false;
|
|
Info.prototype.commaOrSpaceSeparated = false;
|
|
Info.prototype.commaSeparated = false;
|
|
Info.prototype.defined = false;
|
|
Info.prototype.mustUseProperty = false;
|
|
Info.prototype.number = false;
|
|
Info.prototype.overloadedBoolean = false;
|
|
Info.prototype.property = "";
|
|
Info.prototype.spaceSeparated = false;
|
|
Info.prototype.space = void 0;
|
|
|
|
// node_modules/property-information/lib/util/types.js
|
|
var types_exports = {};
|
|
__export(types_exports, {
|
|
boolean: () => boolean,
|
|
booleanish: () => booleanish,
|
|
commaOrSpaceSeparated: () => commaOrSpaceSeparated,
|
|
commaSeparated: () => commaSeparated,
|
|
number: () => number,
|
|
overloadedBoolean: () => overloadedBoolean,
|
|
spaceSeparated: () => spaceSeparated
|
|
});
|
|
var powers = 0;
|
|
var boolean = increment();
|
|
var booleanish = increment();
|
|
var overloadedBoolean = increment();
|
|
var number = increment();
|
|
var spaceSeparated = increment();
|
|
var commaSeparated = increment();
|
|
var commaOrSpaceSeparated = increment();
|
|
function increment() {
|
|
return 2 ** ++powers;
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/defined-info.js
|
|
var checks = (
|
|
/** @type {ReadonlyArray<keyof typeof types>} */
|
|
Object.keys(types_exports)
|
|
);
|
|
var DefinedInfo = class extends Info {
|
|
/**
|
|
* @constructor
|
|
* @param {string} property
|
|
* Property.
|
|
* @param {string} attribute
|
|
* Attribute.
|
|
* @param {number | null | undefined} [mask]
|
|
* Mask.
|
|
* @param {Space | undefined} [space]
|
|
* Space.
|
|
* @returns
|
|
* Info.
|
|
*/
|
|
constructor(property, attribute, mask, space) {
|
|
let index2 = -1;
|
|
super(property, attribute);
|
|
mark(this, "space", space);
|
|
if (typeof mask === "number") {
|
|
while (++index2 < checks.length) {
|
|
const check = checks[index2];
|
|
mark(this, checks[index2], (mask & types_exports[check]) === types_exports[check]);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
DefinedInfo.prototype.defined = true;
|
|
function mark(values, key, value) {
|
|
if (value) {
|
|
values[key] = value;
|
|
}
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/create.js
|
|
function create(definition) {
|
|
const properties = {};
|
|
const normals = {};
|
|
for (const [property, value] of Object.entries(definition.properties)) {
|
|
const info = new DefinedInfo(
|
|
property,
|
|
definition.transform(definition.attributes || {}, property),
|
|
value,
|
|
definition.space
|
|
);
|
|
if (definition.mustUseProperty && definition.mustUseProperty.includes(property)) {
|
|
info.mustUseProperty = true;
|
|
}
|
|
properties[property] = info;
|
|
normals[normalize(property)] = property;
|
|
normals[normalize(info.attribute)] = property;
|
|
}
|
|
return new Schema(properties, normals, definition.space);
|
|
}
|
|
|
|
// node_modules/property-information/lib/aria.js
|
|
var aria = create({
|
|
properties: {
|
|
ariaActiveDescendant: null,
|
|
ariaAtomic: booleanish,
|
|
ariaAutoComplete: null,
|
|
ariaBusy: booleanish,
|
|
ariaChecked: booleanish,
|
|
ariaColCount: number,
|
|
ariaColIndex: number,
|
|
ariaColSpan: number,
|
|
ariaControls: spaceSeparated,
|
|
ariaCurrent: null,
|
|
ariaDescribedBy: spaceSeparated,
|
|
ariaDetails: null,
|
|
ariaDisabled: booleanish,
|
|
ariaDropEffect: spaceSeparated,
|
|
ariaErrorMessage: null,
|
|
ariaExpanded: booleanish,
|
|
ariaFlowTo: spaceSeparated,
|
|
ariaGrabbed: booleanish,
|
|
ariaHasPopup: null,
|
|
ariaHidden: booleanish,
|
|
ariaInvalid: null,
|
|
ariaKeyShortcuts: null,
|
|
ariaLabel: null,
|
|
ariaLabelledBy: spaceSeparated,
|
|
ariaLevel: number,
|
|
ariaLive: null,
|
|
ariaModal: booleanish,
|
|
ariaMultiLine: booleanish,
|
|
ariaMultiSelectable: booleanish,
|
|
ariaOrientation: null,
|
|
ariaOwns: spaceSeparated,
|
|
ariaPlaceholder: null,
|
|
ariaPosInSet: number,
|
|
ariaPressed: booleanish,
|
|
ariaReadOnly: booleanish,
|
|
ariaRelevant: null,
|
|
ariaRequired: booleanish,
|
|
ariaRoleDescription: spaceSeparated,
|
|
ariaRowCount: number,
|
|
ariaRowIndex: number,
|
|
ariaRowSpan: number,
|
|
ariaSelected: booleanish,
|
|
ariaSetSize: number,
|
|
ariaSort: null,
|
|
ariaValueMax: number,
|
|
ariaValueMin: number,
|
|
ariaValueNow: number,
|
|
ariaValueText: null,
|
|
role: null
|
|
},
|
|
transform(_, property) {
|
|
return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
|
|
}
|
|
});
|
|
|
|
// node_modules/property-information/lib/util/case-sensitive-transform.js
|
|
function caseSensitiveTransform(attributes, attribute) {
|
|
return attribute in attributes ? attributes[attribute] : attribute;
|
|
}
|
|
|
|
// node_modules/property-information/lib/util/case-insensitive-transform.js
|
|
function caseInsensitiveTransform(attributes, property) {
|
|
return caseSensitiveTransform(attributes, property.toLowerCase());
|
|
}
|
|
|
|
// node_modules/property-information/lib/html.js
|
|
var html = create({
|
|
attributes: {
|
|
acceptcharset: "accept-charset",
|
|
classname: "class",
|
|
htmlfor: "for",
|
|
httpequiv: "http-equiv"
|
|
},
|
|
mustUseProperty: ["checked", "multiple", "muted", "selected"],
|
|
properties: {
|
|
// Standard Properties.
|
|
abbr: null,
|
|
accept: commaSeparated,
|
|
acceptCharset: spaceSeparated,
|
|
accessKey: spaceSeparated,
|
|
action: null,
|
|
allow: null,
|
|
allowFullScreen: boolean,
|
|
allowPaymentRequest: boolean,
|
|
allowUserMedia: boolean,
|
|
alt: null,
|
|
as: null,
|
|
async: boolean,
|
|
autoCapitalize: null,
|
|
autoComplete: spaceSeparated,
|
|
autoFocus: boolean,
|
|
autoPlay: boolean,
|
|
blocking: spaceSeparated,
|
|
capture: null,
|
|
charSet: null,
|
|
checked: boolean,
|
|
cite: null,
|
|
className: spaceSeparated,
|
|
cols: number,
|
|
colSpan: null,
|
|
content: null,
|
|
contentEditable: booleanish,
|
|
controls: boolean,
|
|
controlsList: spaceSeparated,
|
|
coords: number | commaSeparated,
|
|
crossOrigin: null,
|
|
data: null,
|
|
dateTime: null,
|
|
decoding: null,
|
|
default: boolean,
|
|
defer: boolean,
|
|
dir: null,
|
|
dirName: null,
|
|
disabled: boolean,
|
|
download: overloadedBoolean,
|
|
draggable: booleanish,
|
|
encType: null,
|
|
enterKeyHint: null,
|
|
fetchPriority: null,
|
|
form: null,
|
|
formAction: null,
|
|
formEncType: null,
|
|
formMethod: null,
|
|
formNoValidate: boolean,
|
|
formTarget: null,
|
|
headers: spaceSeparated,
|
|
height: number,
|
|
hidden: overloadedBoolean,
|
|
high: number,
|
|
href: null,
|
|
hrefLang: null,
|
|
htmlFor: spaceSeparated,
|
|
httpEquiv: spaceSeparated,
|
|
id: null,
|
|
imageSizes: null,
|
|
imageSrcSet: null,
|
|
inert: boolean,
|
|
inputMode: null,
|
|
integrity: null,
|
|
is: null,
|
|
isMap: boolean,
|
|
itemId: null,
|
|
itemProp: spaceSeparated,
|
|
itemRef: spaceSeparated,
|
|
itemScope: boolean,
|
|
itemType: spaceSeparated,
|
|
kind: null,
|
|
label: null,
|
|
lang: null,
|
|
language: null,
|
|
list: null,
|
|
loading: null,
|
|
loop: boolean,
|
|
low: number,
|
|
manifest: null,
|
|
max: null,
|
|
maxLength: number,
|
|
media: null,
|
|
method: null,
|
|
min: null,
|
|
minLength: number,
|
|
multiple: boolean,
|
|
muted: boolean,
|
|
name: null,
|
|
nonce: null,
|
|
noModule: boolean,
|
|
noValidate: boolean,
|
|
onAbort: null,
|
|
onAfterPrint: null,
|
|
onAuxClick: null,
|
|
onBeforeMatch: null,
|
|
onBeforePrint: null,
|
|
onBeforeToggle: null,
|
|
onBeforeUnload: null,
|
|
onBlur: null,
|
|
onCancel: null,
|
|
onCanPlay: null,
|
|
onCanPlayThrough: null,
|
|
onChange: null,
|
|
onClick: null,
|
|
onClose: null,
|
|
onContextLost: null,
|
|
onContextMenu: null,
|
|
onContextRestored: null,
|
|
onCopy: null,
|
|
onCueChange: null,
|
|
onCut: null,
|
|
onDblClick: null,
|
|
onDrag: null,
|
|
onDragEnd: null,
|
|
onDragEnter: null,
|
|
onDragExit: null,
|
|
onDragLeave: null,
|
|
onDragOver: null,
|
|
onDragStart: null,
|
|
onDrop: null,
|
|
onDurationChange: null,
|
|
onEmptied: null,
|
|
onEnded: null,
|
|
onError: null,
|
|
onFocus: null,
|
|
onFormData: null,
|
|
onHashChange: null,
|
|
onInput: null,
|
|
onInvalid: null,
|
|
onKeyDown: null,
|
|
onKeyPress: null,
|
|
onKeyUp: null,
|
|
onLanguageChange: null,
|
|
onLoad: null,
|
|
onLoadedData: null,
|
|
onLoadedMetadata: null,
|
|
onLoadEnd: null,
|
|
onLoadStart: null,
|
|
onMessage: null,
|
|
onMessageError: null,
|
|
onMouseDown: null,
|
|
onMouseEnter: null,
|
|
onMouseLeave: null,
|
|
onMouseMove: null,
|
|
onMouseOut: null,
|
|
onMouseOver: null,
|
|
onMouseUp: null,
|
|
onOffline: null,
|
|
onOnline: null,
|
|
onPageHide: null,
|
|
onPageShow: null,
|
|
onPaste: null,
|
|
onPause: null,
|
|
onPlay: null,
|
|
onPlaying: null,
|
|
onPopState: null,
|
|
onProgress: null,
|
|
onRateChange: null,
|
|
onRejectionHandled: null,
|
|
onReset: null,
|
|
onResize: null,
|
|
onScroll: null,
|
|
onScrollEnd: null,
|
|
onSecurityPolicyViolation: null,
|
|
onSeeked: null,
|
|
onSeeking: null,
|
|
onSelect: null,
|
|
onSlotChange: null,
|
|
onStalled: null,
|
|
onStorage: null,
|
|
onSubmit: null,
|
|
onSuspend: null,
|
|
onTimeUpdate: null,
|
|
onToggle: null,
|
|
onUnhandledRejection: null,
|
|
onUnload: null,
|
|
onVolumeChange: null,
|
|
onWaiting: null,
|
|
onWheel: null,
|
|
open: boolean,
|
|
optimum: number,
|
|
pattern: null,
|
|
ping: spaceSeparated,
|
|
placeholder: null,
|
|
playsInline: boolean,
|
|
popover: null,
|
|
popoverTarget: null,
|
|
popoverTargetAction: null,
|
|
poster: null,
|
|
preload: null,
|
|
readOnly: boolean,
|
|
referrerPolicy: null,
|
|
rel: spaceSeparated,
|
|
required: boolean,
|
|
reversed: boolean,
|
|
rows: number,
|
|
rowSpan: number,
|
|
sandbox: spaceSeparated,
|
|
scope: null,
|
|
scoped: boolean,
|
|
seamless: boolean,
|
|
selected: boolean,
|
|
shadowRootClonable: boolean,
|
|
shadowRootDelegatesFocus: boolean,
|
|
shadowRootMode: null,
|
|
shape: null,
|
|
size: number,
|
|
sizes: null,
|
|
slot: null,
|
|
span: number,
|
|
spellCheck: booleanish,
|
|
src: null,
|
|
srcDoc: null,
|
|
srcLang: null,
|
|
srcSet: null,
|
|
start: number,
|
|
step: null,
|
|
style: null,
|
|
tabIndex: number,
|
|
target: null,
|
|
title: null,
|
|
translate: null,
|
|
type: null,
|
|
typeMustMatch: boolean,
|
|
useMap: null,
|
|
value: booleanish,
|
|
width: number,
|
|
wrap: null,
|
|
writingSuggestions: null,
|
|
// Legacy.
|
|
// See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
|
|
align: null,
|
|
// Several. Use CSS `text-align` instead,
|
|
aLink: null,
|
|
// `<body>`. Use CSS `a:active {color}` instead
|
|
archive: spaceSeparated,
|
|
// `<object>`. List of URIs to archives
|
|
axis: null,
|
|
// `<td>` and `<th>`. Use `scope` on `<th>`
|
|
background: null,
|
|
// `<body>`. Use CSS `background-image` instead
|
|
bgColor: null,
|
|
// `<body>` and table elements. Use CSS `background-color` instead
|
|
border: number,
|
|
// `<table>`. Use CSS `border-width` instead,
|
|
borderColor: null,
|
|
// `<table>`. Use CSS `border-color` instead,
|
|
bottomMargin: number,
|
|
// `<body>`
|
|
cellPadding: null,
|
|
// `<table>`
|
|
cellSpacing: null,
|
|
// `<table>`
|
|
char: null,
|
|
// Several table elements. When `align=char`, sets the character to align on
|
|
charOff: null,
|
|
// Several table elements. When `char`, offsets the alignment
|
|
classId: null,
|
|
// `<object>`
|
|
clear: null,
|
|
// `<br>`. Use CSS `clear` instead
|
|
code: null,
|
|
// `<object>`
|
|
codeBase: null,
|
|
// `<object>`
|
|
codeType: null,
|
|
// `<object>`
|
|
color: null,
|
|
// `<font>` and `<hr>`. Use CSS instead
|
|
compact: boolean,
|
|
// Lists. Use CSS to reduce space between items instead
|
|
declare: boolean,
|
|
// `<object>`
|
|
event: null,
|
|
// `<script>`
|
|
face: null,
|
|
// `<font>`. Use CSS instead
|
|
frame: null,
|
|
// `<table>`
|
|
frameBorder: null,
|
|
// `<iframe>`. Use CSS `border` instead
|
|
hSpace: number,
|
|
// `<img>` and `<object>`
|
|
leftMargin: number,
|
|
// `<body>`
|
|
link: null,
|
|
// `<body>`. Use CSS `a:link {color: *}` instead
|
|
longDesc: null,
|
|
// `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
|
|
lowSrc: null,
|
|
// `<img>`. Use a `<picture>`
|
|
marginHeight: number,
|
|
// `<body>`
|
|
marginWidth: number,
|
|
// `<body>`
|
|
noResize: boolean,
|
|
// `<frame>`
|
|
noHref: boolean,
|
|
// `<area>`. Use no href instead of an explicit `nohref`
|
|
noShade: boolean,
|
|
// `<hr>`. Use background-color and height instead of borders
|
|
noWrap: boolean,
|
|
// `<td>` and `<th>`
|
|
object: null,
|
|
// `<applet>`
|
|
profile: null,
|
|
// `<head>`
|
|
prompt: null,
|
|
// `<isindex>`
|
|
rev: null,
|
|
// `<link>`
|
|
rightMargin: number,
|
|
// `<body>`
|
|
rules: null,
|
|
// `<table>`
|
|
scheme: null,
|
|
// `<meta>`
|
|
scrolling: booleanish,
|
|
// `<frame>`. Use overflow in the child context
|
|
standby: null,
|
|
// `<object>`
|
|
summary: null,
|
|
// `<table>`
|
|
text: null,
|
|
// `<body>`. Use CSS `color` instead
|
|
topMargin: number,
|
|
// `<body>`
|
|
valueType: null,
|
|
// `<param>`
|
|
version: null,
|
|
// `<html>`. Use a doctype.
|
|
vAlign: null,
|
|
// Several. Use CSS `vertical-align` instead
|
|
vLink: null,
|
|
// `<body>`. Use CSS `a:visited {color}` instead
|
|
vSpace: number,
|
|
// `<img>` and `<object>`
|
|
// Non-standard Properties.
|
|
allowTransparency: null,
|
|
autoCorrect: null,
|
|
autoSave: null,
|
|
disablePictureInPicture: boolean,
|
|
disableRemotePlayback: boolean,
|
|
prefix: null,
|
|
property: null,
|
|
results: number,
|
|
security: null,
|
|
unselectable: null
|
|
},
|
|
space: "html",
|
|
transform: caseInsensitiveTransform
|
|
});
|
|
|
|
// node_modules/property-information/lib/svg.js
|
|
var svg = create({
|
|
attributes: {
|
|
accentHeight: "accent-height",
|
|
alignmentBaseline: "alignment-baseline",
|
|
arabicForm: "arabic-form",
|
|
baselineShift: "baseline-shift",
|
|
capHeight: "cap-height",
|
|
className: "class",
|
|
clipPath: "clip-path",
|
|
clipRule: "clip-rule",
|
|
colorInterpolation: "color-interpolation",
|
|
colorInterpolationFilters: "color-interpolation-filters",
|
|
colorProfile: "color-profile",
|
|
colorRendering: "color-rendering",
|
|
crossOrigin: "crossorigin",
|
|
dataType: "datatype",
|
|
dominantBaseline: "dominant-baseline",
|
|
enableBackground: "enable-background",
|
|
fillOpacity: "fill-opacity",
|
|
fillRule: "fill-rule",
|
|
floodColor: "flood-color",
|
|
floodOpacity: "flood-opacity",
|
|
fontFamily: "font-family",
|
|
fontSize: "font-size",
|
|
fontSizeAdjust: "font-size-adjust",
|
|
fontStretch: "font-stretch",
|
|
fontStyle: "font-style",
|
|
fontVariant: "font-variant",
|
|
fontWeight: "font-weight",
|
|
glyphName: "glyph-name",
|
|
glyphOrientationHorizontal: "glyph-orientation-horizontal",
|
|
glyphOrientationVertical: "glyph-orientation-vertical",
|
|
hrefLang: "hreflang",
|
|
horizAdvX: "horiz-adv-x",
|
|
horizOriginX: "horiz-origin-x",
|
|
horizOriginY: "horiz-origin-y",
|
|
imageRendering: "image-rendering",
|
|
letterSpacing: "letter-spacing",
|
|
lightingColor: "lighting-color",
|
|
markerEnd: "marker-end",
|
|
markerMid: "marker-mid",
|
|
markerStart: "marker-start",
|
|
navDown: "nav-down",
|
|
navDownLeft: "nav-down-left",
|
|
navDownRight: "nav-down-right",
|
|
navLeft: "nav-left",
|
|
navNext: "nav-next",
|
|
navPrev: "nav-prev",
|
|
navRight: "nav-right",
|
|
navUp: "nav-up",
|
|
navUpLeft: "nav-up-left",
|
|
navUpRight: "nav-up-right",
|
|
onAbort: "onabort",
|
|
onActivate: "onactivate",
|
|
onAfterPrint: "onafterprint",
|
|
onBeforePrint: "onbeforeprint",
|
|
onBegin: "onbegin",
|
|
onCancel: "oncancel",
|
|
onCanPlay: "oncanplay",
|
|
onCanPlayThrough: "oncanplaythrough",
|
|
onChange: "onchange",
|
|
onClick: "onclick",
|
|
onClose: "onclose",
|
|
onCopy: "oncopy",
|
|
onCueChange: "oncuechange",
|
|
onCut: "oncut",
|
|
onDblClick: "ondblclick",
|
|
onDrag: "ondrag",
|
|
onDragEnd: "ondragend",
|
|
onDragEnter: "ondragenter",
|
|
onDragExit: "ondragexit",
|
|
onDragLeave: "ondragleave",
|
|
onDragOver: "ondragover",
|
|
onDragStart: "ondragstart",
|
|
onDrop: "ondrop",
|
|
onDurationChange: "ondurationchange",
|
|
onEmptied: "onemptied",
|
|
onEnd: "onend",
|
|
onEnded: "onended",
|
|
onError: "onerror",
|
|
onFocus: "onfocus",
|
|
onFocusIn: "onfocusin",
|
|
onFocusOut: "onfocusout",
|
|
onHashChange: "onhashchange",
|
|
onInput: "oninput",
|
|
onInvalid: "oninvalid",
|
|
onKeyDown: "onkeydown",
|
|
onKeyPress: "onkeypress",
|
|
onKeyUp: "onkeyup",
|
|
onLoad: "onload",
|
|
onLoadedData: "onloadeddata",
|
|
onLoadedMetadata: "onloadedmetadata",
|
|
onLoadStart: "onloadstart",
|
|
onMessage: "onmessage",
|
|
onMouseDown: "onmousedown",
|
|
onMouseEnter: "onmouseenter",
|
|
onMouseLeave: "onmouseleave",
|
|
onMouseMove: "onmousemove",
|
|
onMouseOut: "onmouseout",
|
|
onMouseOver: "onmouseover",
|
|
onMouseUp: "onmouseup",
|
|
onMouseWheel: "onmousewheel",
|
|
onOffline: "onoffline",
|
|
onOnline: "ononline",
|
|
onPageHide: "onpagehide",
|
|
onPageShow: "onpageshow",
|
|
onPaste: "onpaste",
|
|
onPause: "onpause",
|
|
onPlay: "onplay",
|
|
onPlaying: "onplaying",
|
|
onPopState: "onpopstate",
|
|
onProgress: "onprogress",
|
|
onRateChange: "onratechange",
|
|
onRepeat: "onrepeat",
|
|
onReset: "onreset",
|
|
onResize: "onresize",
|
|
onScroll: "onscroll",
|
|
onSeeked: "onseeked",
|
|
onSeeking: "onseeking",
|
|
onSelect: "onselect",
|
|
onShow: "onshow",
|
|
onStalled: "onstalled",
|
|
onStorage: "onstorage",
|
|
onSubmit: "onsubmit",
|
|
onSuspend: "onsuspend",
|
|
onTimeUpdate: "ontimeupdate",
|
|
onToggle: "ontoggle",
|
|
onUnload: "onunload",
|
|
onVolumeChange: "onvolumechange",
|
|
onWaiting: "onwaiting",
|
|
onZoom: "onzoom",
|
|
overlinePosition: "overline-position",
|
|
overlineThickness: "overline-thickness",
|
|
paintOrder: "paint-order",
|
|
panose1: "panose-1",
|
|
pointerEvents: "pointer-events",
|
|
referrerPolicy: "referrerpolicy",
|
|
renderingIntent: "rendering-intent",
|
|
shapeRendering: "shape-rendering",
|
|
stopColor: "stop-color",
|
|
stopOpacity: "stop-opacity",
|
|
strikethroughPosition: "strikethrough-position",
|
|
strikethroughThickness: "strikethrough-thickness",
|
|
strokeDashArray: "stroke-dasharray",
|
|
strokeDashOffset: "stroke-dashoffset",
|
|
strokeLineCap: "stroke-linecap",
|
|
strokeLineJoin: "stroke-linejoin",
|
|
strokeMiterLimit: "stroke-miterlimit",
|
|
strokeOpacity: "stroke-opacity",
|
|
strokeWidth: "stroke-width",
|
|
tabIndex: "tabindex",
|
|
textAnchor: "text-anchor",
|
|
textDecoration: "text-decoration",
|
|
textRendering: "text-rendering",
|
|
transformOrigin: "transform-origin",
|
|
typeOf: "typeof",
|
|
underlinePosition: "underline-position",
|
|
underlineThickness: "underline-thickness",
|
|
unicodeBidi: "unicode-bidi",
|
|
unicodeRange: "unicode-range",
|
|
unitsPerEm: "units-per-em",
|
|
vAlphabetic: "v-alphabetic",
|
|
vHanging: "v-hanging",
|
|
vIdeographic: "v-ideographic",
|
|
vMathematical: "v-mathematical",
|
|
vectorEffect: "vector-effect",
|
|
vertAdvY: "vert-adv-y",
|
|
vertOriginX: "vert-origin-x",
|
|
vertOriginY: "vert-origin-y",
|
|
wordSpacing: "word-spacing",
|
|
writingMode: "writing-mode",
|
|
xHeight: "x-height",
|
|
// These were camelcased in Tiny. Now lowercased in SVG 2
|
|
playbackOrder: "playbackorder",
|
|
timelineBegin: "timelinebegin"
|
|
},
|
|
properties: {
|
|
about: commaOrSpaceSeparated,
|
|
accentHeight: number,
|
|
accumulate: null,
|
|
additive: null,
|
|
alignmentBaseline: null,
|
|
alphabetic: number,
|
|
amplitude: number,
|
|
arabicForm: null,
|
|
ascent: number,
|
|
attributeName: null,
|
|
attributeType: null,
|
|
azimuth: number,
|
|
bandwidth: null,
|
|
baselineShift: null,
|
|
baseFrequency: null,
|
|
baseProfile: null,
|
|
bbox: null,
|
|
begin: null,
|
|
bias: number,
|
|
by: null,
|
|
calcMode: null,
|
|
capHeight: number,
|
|
className: spaceSeparated,
|
|
clip: null,
|
|
clipPath: null,
|
|
clipPathUnits: null,
|
|
clipRule: null,
|
|
color: null,
|
|
colorInterpolation: null,
|
|
colorInterpolationFilters: null,
|
|
colorProfile: null,
|
|
colorRendering: null,
|
|
content: null,
|
|
contentScriptType: null,
|
|
contentStyleType: null,
|
|
crossOrigin: null,
|
|
cursor: null,
|
|
cx: null,
|
|
cy: null,
|
|
d: null,
|
|
dataType: null,
|
|
defaultAction: null,
|
|
descent: number,
|
|
diffuseConstant: number,
|
|
direction: null,
|
|
display: null,
|
|
dur: null,
|
|
divisor: number,
|
|
dominantBaseline: null,
|
|
download: boolean,
|
|
dx: null,
|
|
dy: null,
|
|
edgeMode: null,
|
|
editable: null,
|
|
elevation: number,
|
|
enableBackground: null,
|
|
end: null,
|
|
event: null,
|
|
exponent: number,
|
|
externalResourcesRequired: null,
|
|
fill: null,
|
|
fillOpacity: number,
|
|
fillRule: null,
|
|
filter: null,
|
|
filterRes: null,
|
|
filterUnits: null,
|
|
floodColor: null,
|
|
floodOpacity: null,
|
|
focusable: null,
|
|
focusHighlight: null,
|
|
fontFamily: null,
|
|
fontSize: null,
|
|
fontSizeAdjust: null,
|
|
fontStretch: null,
|
|
fontStyle: null,
|
|
fontVariant: null,
|
|
fontWeight: null,
|
|
format: null,
|
|
fr: null,
|
|
from: null,
|
|
fx: null,
|
|
fy: null,
|
|
g1: commaSeparated,
|
|
g2: commaSeparated,
|
|
glyphName: commaSeparated,
|
|
glyphOrientationHorizontal: null,
|
|
glyphOrientationVertical: null,
|
|
glyphRef: null,
|
|
gradientTransform: null,
|
|
gradientUnits: null,
|
|
handler: null,
|
|
hanging: number,
|
|
hatchContentUnits: null,
|
|
hatchUnits: null,
|
|
height: null,
|
|
href: null,
|
|
hrefLang: null,
|
|
horizAdvX: number,
|
|
horizOriginX: number,
|
|
horizOriginY: number,
|
|
id: null,
|
|
ideographic: number,
|
|
imageRendering: null,
|
|
initialVisibility: null,
|
|
in: null,
|
|
in2: null,
|
|
intercept: number,
|
|
k: number,
|
|
k1: number,
|
|
k2: number,
|
|
k3: number,
|
|
k4: number,
|
|
kernelMatrix: commaOrSpaceSeparated,
|
|
kernelUnitLength: null,
|
|
keyPoints: null,
|
|
// SEMI_COLON_SEPARATED
|
|
keySplines: null,
|
|
// SEMI_COLON_SEPARATED
|
|
keyTimes: null,
|
|
// SEMI_COLON_SEPARATED
|
|
kerning: null,
|
|
lang: null,
|
|
lengthAdjust: null,
|
|
letterSpacing: null,
|
|
lightingColor: null,
|
|
limitingConeAngle: number,
|
|
local: null,
|
|
markerEnd: null,
|
|
markerMid: null,
|
|
markerStart: null,
|
|
markerHeight: null,
|
|
markerUnits: null,
|
|
markerWidth: null,
|
|
mask: null,
|
|
maskContentUnits: null,
|
|
maskUnits: null,
|
|
mathematical: null,
|
|
max: null,
|
|
media: null,
|
|
mediaCharacterEncoding: null,
|
|
mediaContentEncodings: null,
|
|
mediaSize: number,
|
|
mediaTime: null,
|
|
method: null,
|
|
min: null,
|
|
mode: null,
|
|
name: null,
|
|
navDown: null,
|
|
navDownLeft: null,
|
|
navDownRight: null,
|
|
navLeft: null,
|
|
navNext: null,
|
|
navPrev: null,
|
|
navRight: null,
|
|
navUp: null,
|
|
navUpLeft: null,
|
|
navUpRight: null,
|
|
numOctaves: null,
|
|
observer: null,
|
|
offset: null,
|
|
onAbort: null,
|
|
onActivate: null,
|
|
onAfterPrint: null,
|
|
onBeforePrint: null,
|
|
onBegin: null,
|
|
onCancel: null,
|
|
onCanPlay: null,
|
|
onCanPlayThrough: null,
|
|
onChange: null,
|
|
onClick: null,
|
|
onClose: null,
|
|
onCopy: null,
|
|
onCueChange: null,
|
|
onCut: null,
|
|
onDblClick: null,
|
|
onDrag: null,
|
|
onDragEnd: null,
|
|
onDragEnter: null,
|
|
onDragExit: null,
|
|
onDragLeave: null,
|
|
onDragOver: null,
|
|
onDragStart: null,
|
|
onDrop: null,
|
|
onDurationChange: null,
|
|
onEmptied: null,
|
|
onEnd: null,
|
|
onEnded: null,
|
|
onError: null,
|
|
onFocus: null,
|
|
onFocusIn: null,
|
|
onFocusOut: null,
|
|
onHashChange: null,
|
|
onInput: null,
|
|
onInvalid: null,
|
|
onKeyDown: null,
|
|
onKeyPress: null,
|
|
onKeyUp: null,
|
|
onLoad: null,
|
|
onLoadedData: null,
|
|
onLoadedMetadata: null,
|
|
onLoadStart: null,
|
|
onMessage: null,
|
|
onMouseDown: null,
|
|
onMouseEnter: null,
|
|
onMouseLeave: null,
|
|
onMouseMove: null,
|
|
onMouseOut: null,
|
|
onMouseOver: null,
|
|
onMouseUp: null,
|
|
onMouseWheel: null,
|
|
onOffline: null,
|
|
onOnline: null,
|
|
onPageHide: null,
|
|
onPageShow: null,
|
|
onPaste: null,
|
|
onPause: null,
|
|
onPlay: null,
|
|
onPlaying: null,
|
|
onPopState: null,
|
|
onProgress: null,
|
|
onRateChange: null,
|
|
onRepeat: null,
|
|
onReset: null,
|
|
onResize: null,
|
|
onScroll: null,
|
|
onSeeked: null,
|
|
onSeeking: null,
|
|
onSelect: null,
|
|
onShow: null,
|
|
onStalled: null,
|
|
onStorage: null,
|
|
onSubmit: null,
|
|
onSuspend: null,
|
|
onTimeUpdate: null,
|
|
onToggle: null,
|
|
onUnload: null,
|
|
onVolumeChange: null,
|
|
onWaiting: null,
|
|
onZoom: null,
|
|
opacity: null,
|
|
operator: null,
|
|
order: null,
|
|
orient: null,
|
|
orientation: null,
|
|
origin: null,
|
|
overflow: null,
|
|
overlay: null,
|
|
overlinePosition: number,
|
|
overlineThickness: number,
|
|
paintOrder: null,
|
|
panose1: null,
|
|
path: null,
|
|
pathLength: number,
|
|
patternContentUnits: null,
|
|
patternTransform: null,
|
|
patternUnits: null,
|
|
phase: null,
|
|
ping: spaceSeparated,
|
|
pitch: null,
|
|
playbackOrder: null,
|
|
pointerEvents: null,
|
|
points: null,
|
|
pointsAtX: number,
|
|
pointsAtY: number,
|
|
pointsAtZ: number,
|
|
preserveAlpha: null,
|
|
preserveAspectRatio: null,
|
|
primitiveUnits: null,
|
|
propagate: null,
|
|
property: commaOrSpaceSeparated,
|
|
r: null,
|
|
radius: null,
|
|
referrerPolicy: null,
|
|
refX: null,
|
|
refY: null,
|
|
rel: commaOrSpaceSeparated,
|
|
rev: commaOrSpaceSeparated,
|
|
renderingIntent: null,
|
|
repeatCount: null,
|
|
repeatDur: null,
|
|
requiredExtensions: commaOrSpaceSeparated,
|
|
requiredFeatures: commaOrSpaceSeparated,
|
|
requiredFonts: commaOrSpaceSeparated,
|
|
requiredFormats: commaOrSpaceSeparated,
|
|
resource: null,
|
|
restart: null,
|
|
result: null,
|
|
rotate: null,
|
|
rx: null,
|
|
ry: null,
|
|
scale: null,
|
|
seed: null,
|
|
shapeRendering: null,
|
|
side: null,
|
|
slope: null,
|
|
snapshotTime: null,
|
|
specularConstant: number,
|
|
specularExponent: number,
|
|
spreadMethod: null,
|
|
spacing: null,
|
|
startOffset: null,
|
|
stdDeviation: null,
|
|
stemh: null,
|
|
stemv: null,
|
|
stitchTiles: null,
|
|
stopColor: null,
|
|
stopOpacity: null,
|
|
strikethroughPosition: number,
|
|
strikethroughThickness: number,
|
|
string: null,
|
|
stroke: null,
|
|
strokeDashArray: commaOrSpaceSeparated,
|
|
strokeDashOffset: null,
|
|
strokeLineCap: null,
|
|
strokeLineJoin: null,
|
|
strokeMiterLimit: number,
|
|
strokeOpacity: number,
|
|
strokeWidth: null,
|
|
style: null,
|
|
surfaceScale: number,
|
|
syncBehavior: null,
|
|
syncBehaviorDefault: null,
|
|
syncMaster: null,
|
|
syncTolerance: null,
|
|
syncToleranceDefault: null,
|
|
systemLanguage: commaOrSpaceSeparated,
|
|
tabIndex: number,
|
|
tableValues: null,
|
|
target: null,
|
|
targetX: number,
|
|
targetY: number,
|
|
textAnchor: null,
|
|
textDecoration: null,
|
|
textRendering: null,
|
|
textLength: null,
|
|
timelineBegin: null,
|
|
title: null,
|
|
transformBehavior: null,
|
|
type: null,
|
|
typeOf: commaOrSpaceSeparated,
|
|
to: null,
|
|
transform: null,
|
|
transformOrigin: null,
|
|
u1: null,
|
|
u2: null,
|
|
underlinePosition: number,
|
|
underlineThickness: number,
|
|
unicode: null,
|
|
unicodeBidi: null,
|
|
unicodeRange: null,
|
|
unitsPerEm: number,
|
|
values: null,
|
|
vAlphabetic: number,
|
|
vMathematical: number,
|
|
vectorEffect: null,
|
|
vHanging: number,
|
|
vIdeographic: number,
|
|
version: null,
|
|
vertAdvY: number,
|
|
vertOriginX: number,
|
|
vertOriginY: number,
|
|
viewBox: null,
|
|
viewTarget: null,
|
|
visibility: null,
|
|
width: null,
|
|
widths: null,
|
|
wordSpacing: null,
|
|
writingMode: null,
|
|
x: null,
|
|
x1: null,
|
|
x2: null,
|
|
xChannelSelector: null,
|
|
xHeight: number,
|
|
y: null,
|
|
y1: null,
|
|
y2: null,
|
|
yChannelSelector: null,
|
|
z: null,
|
|
zoomAndPan: null
|
|
},
|
|
space: "svg",
|
|
transform: caseSensitiveTransform
|
|
});
|
|
|
|
// node_modules/property-information/lib/xlink.js
|
|
var xlink = create({
|
|
properties: {
|
|
xLinkActuate: null,
|
|
xLinkArcRole: null,
|
|
xLinkHref: null,
|
|
xLinkRole: null,
|
|
xLinkShow: null,
|
|
xLinkTitle: null,
|
|
xLinkType: null
|
|
},
|
|
space: "xlink",
|
|
transform(_, property) {
|
|
return "xlink:" + property.slice(5).toLowerCase();
|
|
}
|
|
});
|
|
|
|
// node_modules/property-information/lib/xmlns.js
|
|
var xmlns = create({
|
|
attributes: { xmlnsxlink: "xmlns:xlink" },
|
|
properties: { xmlnsXLink: null, xmlns: null },
|
|
space: "xmlns",
|
|
transform: caseInsensitiveTransform
|
|
});
|
|
|
|
// node_modules/property-information/lib/xml.js
|
|
var xml = create({
|
|
properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
|
|
space: "xml",
|
|
transform(_, property) {
|
|
return "xml:" + property.slice(3).toLowerCase();
|
|
}
|
|
});
|
|
|
|
// node_modules/property-information/lib/hast-to-react.js
|
|
var hastToReact = {
|
|
classId: "classID",
|
|
dataType: "datatype",
|
|
itemId: "itemID",
|
|
strokeDashArray: "strokeDasharray",
|
|
strokeDashOffset: "strokeDashoffset",
|
|
strokeLineCap: "strokeLinecap",
|
|
strokeLineJoin: "strokeLinejoin",
|
|
strokeMiterLimit: "strokeMiterlimit",
|
|
typeOf: "typeof",
|
|
xLinkActuate: "xlinkActuate",
|
|
xLinkArcRole: "xlinkArcrole",
|
|
xLinkHref: "xlinkHref",
|
|
xLinkRole: "xlinkRole",
|
|
xLinkShow: "xlinkShow",
|
|
xLinkTitle: "xlinkTitle",
|
|
xLinkType: "xlinkType",
|
|
xmlnsXLink: "xmlnsXlink"
|
|
};
|
|
|
|
// node_modules/property-information/lib/find.js
|
|
var cap = /[A-Z]/g;
|
|
var dash = /-[a-z]/g;
|
|
var valid = /^data[-\w.:]+$/i;
|
|
function find(schema, value) {
|
|
const normal = normalize(value);
|
|
let property = value;
|
|
let Type = Info;
|
|
if (normal in schema.normal) {
|
|
return schema.property[schema.normal[normal]];
|
|
}
|
|
if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) {
|
|
if (value.charAt(4) === "-") {
|
|
const rest = value.slice(5).replace(dash, camelcase);
|
|
property = "data" + rest.charAt(0).toUpperCase() + rest.slice(1);
|
|
} else {
|
|
const rest = value.slice(4);
|
|
if (!dash.test(rest)) {
|
|
let dashes = rest.replace(cap, kebab);
|
|
if (dashes.charAt(0) !== "-") {
|
|
dashes = "-" + dashes;
|
|
}
|
|
value = "data" + dashes;
|
|
}
|
|
}
|
|
Type = DefinedInfo;
|
|
}
|
|
return new Type(property, value);
|
|
}
|
|
function kebab($0) {
|
|
return "-" + $0.toLowerCase();
|
|
}
|
|
function camelcase($0) {
|
|
return $0.charAt(1).toUpperCase();
|
|
}
|
|
|
|
// node_modules/property-information/index.js
|
|
var html2 = merge([aria, html, xlink, xmlns, xml], "html");
|
|
var svg2 = merge([aria, svg, xlink, xmlns, xml], "svg");
|
|
|
|
// node_modules/space-separated-tokens/index.js
|
|
function stringify2(values) {
|
|
return values.join(" ").trim();
|
|
}
|
|
|
|
// node_modules/hast-util-to-jsx-runtime/lib/index.js
|
|
var import_style_to_js = __toESM(require_cjs3());
|
|
var pointStart = point("start");
|
|
function point(type) {
|
|
return point3;
|
|
function point3(node) {
|
|
const point4 = node && node.position && node.position[type] || {};
|
|
if (typeof point4.line === "number" && point4.line > 0 && typeof point4.column === "number" && point4.column > 0) {
|
|
return {
|
|
line: point4.line,
|
|
column: point4.column,
|
|
offset: typeof point4.offset === "number" && point4.offset > -1 ? point4.offset : void 0
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
// node_modules/unist-util-stringify-position/lib/index.js
|
|
function stringifyPosition(value) {
|
|
if (!value || typeof value !== "object") {
|
|
return "";
|
|
}
|
|
if ("position" in value || "type" in value) {
|
|
return position2(value.position);
|
|
}
|
|
if ("start" in value || "end" in value) {
|
|
return position2(value);
|
|
}
|
|
if ("line" in value || "column" in value) {
|
|
return point2(value);
|
|
}
|
|
return "";
|
|
}
|
|
function point2(point3) {
|
|
return index(point3 && point3.line) + ":" + index(point3 && point3.column);
|
|
}
|
|
function position2(pos) {
|
|
return point2(pos && pos.start) + "-" + point2(pos && pos.end);
|
|
}
|
|
function index(value) {
|
|
return value && typeof value === "number" ? value : 1;
|
|
}
|
|
|
|
// node_modules/vfile-message/lib/index.js
|
|
var VFileMessage = class extends Error {
|
|
/**
|
|
* Create a message for `reason`.
|
|
*
|
|
* > 🪦 **Note**: also has obsolete signatures.
|
|
*
|
|
* @overload
|
|
* @param {string} reason
|
|
* @param {Options | null | undefined} [options]
|
|
* @returns
|
|
*
|
|
* @overload
|
|
* @param {string} reason
|
|
* @param {Node | NodeLike | null | undefined} parent
|
|
* @param {string | null | undefined} [origin]
|
|
* @returns
|
|
*
|
|
* @overload
|
|
* @param {string} reason
|
|
* @param {Point | Position | null | undefined} place
|
|
* @param {string | null | undefined} [origin]
|
|
* @returns
|
|
*
|
|
* @overload
|
|
* @param {string} reason
|
|
* @param {string | null | undefined} [origin]
|
|
* @returns
|
|
*
|
|
* @overload
|
|
* @param {Error | VFileMessage} cause
|
|
* @param {Node | NodeLike | null | undefined} parent
|
|
* @param {string | null | undefined} [origin]
|
|
* @returns
|
|
*
|
|
* @overload
|
|
* @param {Error | VFileMessage} cause
|
|
* @param {Point | Position | null | undefined} place
|
|
* @param {string | null | undefined} [origin]
|
|
* @returns
|
|
*
|
|
* @overload
|
|
* @param {Error | VFileMessage} cause
|
|
* @param {string | null | undefined} [origin]
|
|
* @returns
|
|
*
|
|
* @param {Error | VFileMessage | string} causeOrReason
|
|
* Reason for message, should use markdown.
|
|
* @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
|
|
* Configuration (optional).
|
|
* @param {string | null | undefined} [origin]
|
|
* Place in code where the message originates (example:
|
|
* `'my-package:my-rule'` or `'my-rule'`).
|
|
* @returns
|
|
* Instance of `VFileMessage`.
|
|
*/
|
|
// eslint-disable-next-line complexity
|
|
constructor(causeOrReason, optionsOrParentOrPlace, origin) {
|
|
super();
|
|
if (typeof optionsOrParentOrPlace === "string") {
|
|
origin = optionsOrParentOrPlace;
|
|
optionsOrParentOrPlace = void 0;
|
|
}
|
|
let reason = "";
|
|
let options = {};
|
|
let legacyCause = false;
|
|
if (optionsOrParentOrPlace) {
|
|
if ("line" in optionsOrParentOrPlace && "column" in optionsOrParentOrPlace) {
|
|
options = { place: optionsOrParentOrPlace };
|
|
} else if ("start" in optionsOrParentOrPlace && "end" in optionsOrParentOrPlace) {
|
|
options = { place: optionsOrParentOrPlace };
|
|
} else if ("type" in optionsOrParentOrPlace) {
|
|
options = {
|
|
ancestors: [optionsOrParentOrPlace],
|
|
place: optionsOrParentOrPlace.position
|
|
};
|
|
} else {
|
|
options = { ...optionsOrParentOrPlace };
|
|
}
|
|
}
|
|
if (typeof causeOrReason === "string") {
|
|
reason = causeOrReason;
|
|
} else if (!options.cause && causeOrReason) {
|
|
legacyCause = true;
|
|
reason = causeOrReason.message;
|
|
options.cause = causeOrReason;
|
|
}
|
|
if (!options.ruleId && !options.source && typeof origin === "string") {
|
|
const index2 = origin.indexOf(":");
|
|
if (index2 === -1) {
|
|
options.ruleId = origin;
|
|
} else {
|
|
options.source = origin.slice(0, index2);
|
|
options.ruleId = origin.slice(index2 + 1);
|
|
}
|
|
}
|
|
if (!options.place && options.ancestors && options.ancestors) {
|
|
const parent = options.ancestors[options.ancestors.length - 1];
|
|
if (parent) {
|
|
options.place = parent.position;
|
|
}
|
|
}
|
|
const start2 = options.place && "start" in options.place ? options.place.start : options.place;
|
|
this.ancestors = options.ancestors || void 0;
|
|
this.cause = options.cause || void 0;
|
|
this.column = start2 ? start2.column : void 0;
|
|
this.fatal = void 0;
|
|
this.file = "";
|
|
this.message = reason;
|
|
this.line = start2 ? start2.line : void 0;
|
|
this.name = stringifyPosition(options.place) || "1:1";
|
|
this.place = options.place || void 0;
|
|
this.reason = this.message;
|
|
this.ruleId = options.ruleId || void 0;
|
|
this.source = options.source || void 0;
|
|
this.stack = legacyCause && options.cause && typeof options.cause.stack === "string" ? options.cause.stack : "";
|
|
this.actual = void 0;
|
|
this.expected = void 0;
|
|
this.note = void 0;
|
|
this.url = void 0;
|
|
}
|
|
};
|
|
VFileMessage.prototype.file = "";
|
|
VFileMessage.prototype.name = "";
|
|
VFileMessage.prototype.reason = "";
|
|
VFileMessage.prototype.message = "";
|
|
VFileMessage.prototype.stack = "";
|
|
VFileMessage.prototype.column = void 0;
|
|
VFileMessage.prototype.line = void 0;
|
|
VFileMessage.prototype.ancestors = void 0;
|
|
VFileMessage.prototype.cause = void 0;
|
|
VFileMessage.prototype.fatal = void 0;
|
|
VFileMessage.prototype.place = void 0;
|
|
VFileMessage.prototype.ruleId = void 0;
|
|
VFileMessage.prototype.source = void 0;
|
|
|
|
// node_modules/hast-util-to-jsx-runtime/lib/index.js
|
|
var own2 = {}.hasOwnProperty;
|
|
var emptyMap = /* @__PURE__ */ new Map();
|
|
var cap2 = /[A-Z]/g;
|
|
var tableElements = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]);
|
|
var tableCellElement = /* @__PURE__ */ new Set(["td", "th"]);
|
|
var docs = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
|
|
function toJsxRuntime(tree, options) {
|
|
if (!options || options.Fragment === void 0) {
|
|
throw new TypeError("Expected `Fragment` in options");
|
|
}
|
|
const filePath = options.filePath || void 0;
|
|
let create2;
|
|
if (options.development) {
|
|
if (typeof options.jsxDEV !== "function") {
|
|
throw new TypeError(
|
|
"Expected `jsxDEV` in options when `development: true`"
|
|
);
|
|
}
|
|
create2 = developmentCreate(filePath, options.jsxDEV);
|
|
} else {
|
|
if (typeof options.jsx !== "function") {
|
|
throw new TypeError("Expected `jsx` in production options");
|
|
}
|
|
if (typeof options.jsxs !== "function") {
|
|
throw new TypeError("Expected `jsxs` in production options");
|
|
}
|
|
create2 = productionCreate(filePath, options.jsx, options.jsxs);
|
|
}
|
|
const state = {
|
|
Fragment: options.Fragment,
|
|
ancestors: [],
|
|
components: options.components || {},
|
|
create: create2,
|
|
elementAttributeNameCase: options.elementAttributeNameCase || "react",
|
|
evaluater: options.createEvaluater ? options.createEvaluater() : void 0,
|
|
filePath,
|
|
ignoreInvalidStyle: options.ignoreInvalidStyle || false,
|
|
passKeys: options.passKeys !== false,
|
|
passNode: options.passNode || false,
|
|
schema: options.space === "svg" ? svg2 : html2,
|
|
stylePropertyNameCase: options.stylePropertyNameCase || "dom",
|
|
tableCellAlignToStyle: options.tableCellAlignToStyle !== false
|
|
};
|
|
const result = one(state, tree, void 0);
|
|
if (result && typeof result !== "string") {
|
|
return result;
|
|
}
|
|
return state.create(
|
|
tree,
|
|
state.Fragment,
|
|
{ children: result || void 0 },
|
|
void 0
|
|
);
|
|
}
|
|
function one(state, node, key) {
|
|
if (node.type === "element") {
|
|
return element(state, node, key);
|
|
}
|
|
if (node.type === "mdxFlowExpression" || node.type === "mdxTextExpression") {
|
|
return mdxExpression(state, node);
|
|
}
|
|
if (node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") {
|
|
return mdxJsxElement(state, node, key);
|
|
}
|
|
if (node.type === "mdxjsEsm") {
|
|
return mdxEsm(state, node);
|
|
}
|
|
if (node.type === "root") {
|
|
return root(state, node, key);
|
|
}
|
|
if (node.type === "text") {
|
|
return text(state, node);
|
|
}
|
|
}
|
|
function element(state, node, key) {
|
|
const parentSchema = state.schema;
|
|
let schema = parentSchema;
|
|
if (node.tagName.toLowerCase() === "svg" && parentSchema.space === "html") {
|
|
schema = svg2;
|
|
state.schema = schema;
|
|
}
|
|
state.ancestors.push(node);
|
|
const type = findComponentFromName(state, node.tagName, false);
|
|
const props = createElementProps(state, node);
|
|
let children = createChildren(state, node);
|
|
if (tableElements.has(node.tagName)) {
|
|
children = children.filter(function(child) {
|
|
return typeof child === "string" ? !whitespace(child) : true;
|
|
});
|
|
}
|
|
addNode(state, props, type, node);
|
|
addChildren(props, children);
|
|
state.ancestors.pop();
|
|
state.schema = parentSchema;
|
|
return state.create(node, type, props, key);
|
|
}
|
|
function mdxExpression(state, node) {
|
|
if (node.data && node.data.estree && state.evaluater) {
|
|
const program = node.data.estree;
|
|
const expression = program.body[0];
|
|
ok(expression.type === "ExpressionStatement");
|
|
return (
|
|
/** @type {Child | undefined} */
|
|
state.evaluater.evaluateExpression(expression.expression)
|
|
);
|
|
}
|
|
crashEstree(state, node.position);
|
|
}
|
|
function mdxEsm(state, node) {
|
|
if (node.data && node.data.estree && state.evaluater) {
|
|
return (
|
|
/** @type {Child | undefined} */
|
|
state.evaluater.evaluateProgram(node.data.estree)
|
|
);
|
|
}
|
|
crashEstree(state, node.position);
|
|
}
|
|
function mdxJsxElement(state, node, key) {
|
|
const parentSchema = state.schema;
|
|
let schema = parentSchema;
|
|
if (node.name === "svg" && parentSchema.space === "html") {
|
|
schema = svg2;
|
|
state.schema = schema;
|
|
}
|
|
state.ancestors.push(node);
|
|
const type = node.name === null ? state.Fragment : findComponentFromName(state, node.name, true);
|
|
const props = createJsxElementProps(state, node);
|
|
const children = createChildren(state, node);
|
|
addNode(state, props, type, node);
|
|
addChildren(props, children);
|
|
state.ancestors.pop();
|
|
state.schema = parentSchema;
|
|
return state.create(node, type, props, key);
|
|
}
|
|
function root(state, node, key) {
|
|
const props = {};
|
|
addChildren(props, createChildren(state, node));
|
|
return state.create(node, state.Fragment, props, key);
|
|
}
|
|
function text(_, node) {
|
|
return node.value;
|
|
}
|
|
function addNode(state, props, type, node) {
|
|
if (typeof type !== "string" && type !== state.Fragment && state.passNode) {
|
|
props.node = node;
|
|
}
|
|
}
|
|
function addChildren(props, children) {
|
|
if (children.length > 0) {
|
|
const value = children.length > 1 ? children : children[0];
|
|
if (value) {
|
|
props.children = value;
|
|
}
|
|
}
|
|
}
|
|
function productionCreate(_, jsx4, jsxs4) {
|
|
return create2;
|
|
function create2(_2, type, props, key) {
|
|
const isStaticChildren = Array.isArray(props.children);
|
|
const fn = isStaticChildren ? jsxs4 : jsx4;
|
|
return key ? fn(type, props, key) : fn(type, props);
|
|
}
|
|
}
|
|
function developmentCreate(filePath, jsxDEV) {
|
|
return create2;
|
|
function create2(node, type, props, key) {
|
|
const isStaticChildren = Array.isArray(props.children);
|
|
const point3 = pointStart(node);
|
|
return jsxDEV(
|
|
type,
|
|
props,
|
|
key,
|
|
isStaticChildren,
|
|
{
|
|
columnNumber: point3 ? point3.column - 1 : void 0,
|
|
fileName: filePath,
|
|
lineNumber: point3 ? point3.line : void 0
|
|
},
|
|
void 0
|
|
);
|
|
}
|
|
}
|
|
function createElementProps(state, node) {
|
|
const props = {};
|
|
let alignValue;
|
|
let prop;
|
|
for (prop in node.properties) {
|
|
if (prop !== "children" && own2.call(node.properties, prop)) {
|
|
const result = createProperty(state, prop, node.properties[prop]);
|
|
if (result) {
|
|
const [key, value] = result;
|
|
if (state.tableCellAlignToStyle && key === "align" && typeof value === "string" && tableCellElement.has(node.tagName)) {
|
|
alignValue = value;
|
|
} else {
|
|
props[key] = value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (alignValue) {
|
|
const style = (
|
|
/** @type {Style} */
|
|
props.style || (props.style = {})
|
|
);
|
|
style[state.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = alignValue;
|
|
}
|
|
return props;
|
|
}
|
|
function createJsxElementProps(state, node) {
|
|
const props = {};
|
|
for (const attribute of node.attributes) {
|
|
if (attribute.type === "mdxJsxExpressionAttribute") {
|
|
if (attribute.data && attribute.data.estree && state.evaluater) {
|
|
const program = attribute.data.estree;
|
|
const expression = program.body[0];
|
|
ok(expression.type === "ExpressionStatement");
|
|
const objectExpression = expression.expression;
|
|
ok(objectExpression.type === "ObjectExpression");
|
|
const property = objectExpression.properties[0];
|
|
ok(property.type === "SpreadElement");
|
|
Object.assign(
|
|
props,
|
|
state.evaluater.evaluateExpression(property.argument)
|
|
);
|
|
} else {
|
|
crashEstree(state, node.position);
|
|
}
|
|
} else {
|
|
const name2 = attribute.name;
|
|
let value;
|
|
if (attribute.value && typeof attribute.value === "object") {
|
|
if (attribute.value.data && attribute.value.data.estree && state.evaluater) {
|
|
const program = attribute.value.data.estree;
|
|
const expression = program.body[0];
|
|
ok(expression.type === "ExpressionStatement");
|
|
value = state.evaluater.evaluateExpression(expression.expression);
|
|
} else {
|
|
crashEstree(state, node.position);
|
|
}
|
|
} else {
|
|
value = attribute.value === null ? true : attribute.value;
|
|
}
|
|
props[name2] = /** @type {Props[keyof Props]} */
|
|
value;
|
|
}
|
|
}
|
|
return props;
|
|
}
|
|
function createChildren(state, node) {
|
|
const children = [];
|
|
let index2 = -1;
|
|
const countsByName = state.passKeys ? /* @__PURE__ */ new Map() : emptyMap;
|
|
while (++index2 < node.children.length) {
|
|
const child = node.children[index2];
|
|
let key;
|
|
if (state.passKeys) {
|
|
const name2 = child.type === "element" ? child.tagName : child.type === "mdxJsxFlowElement" || child.type === "mdxJsxTextElement" ? child.name : void 0;
|
|
if (name2) {
|
|
const count = countsByName.get(name2) || 0;
|
|
key = name2 + "-" + count;
|
|
countsByName.set(name2, count + 1);
|
|
}
|
|
}
|
|
const result = one(state, child, key);
|
|
if (result !== void 0) children.push(result);
|
|
}
|
|
return children;
|
|
}
|
|
function createProperty(state, prop, value) {
|
|
const info = find(state.schema, prop);
|
|
if (value === null || value === void 0 || typeof value === "number" && Number.isNaN(value)) {
|
|
return;
|
|
}
|
|
if (Array.isArray(value)) {
|
|
value = info.commaSeparated ? stringify(value) : stringify2(value);
|
|
}
|
|
if (info.property === "style") {
|
|
let styleObject = typeof value === "object" ? value : parseStyle(state, String(value));
|
|
if (state.stylePropertyNameCase === "css") {
|
|
styleObject = transformStylesToCssCasing(styleObject);
|
|
}
|
|
return ["style", styleObject];
|
|
}
|
|
return [
|
|
state.elementAttributeNameCase === "react" && info.space ? hastToReact[info.property] || info.property : info.attribute,
|
|
value
|
|
];
|
|
}
|
|
function parseStyle(state, value) {
|
|
try {
|
|
return (0, import_style_to_js.default)(value, { reactCompat: true });
|
|
} catch (error) {
|
|
if (state.ignoreInvalidStyle) {
|
|
return {};
|
|
}
|
|
const cause = (
|
|
/** @type {Error} */
|
|
error
|
|
);
|
|
const message = new VFileMessage("Cannot parse `style` attribute", {
|
|
ancestors: state.ancestors,
|
|
cause,
|
|
ruleId: "style",
|
|
source: "hast-util-to-jsx-runtime"
|
|
});
|
|
message.file = state.filePath || void 0;
|
|
message.url = docs + "#cannot-parse-style-attribute";
|
|
throw message;
|
|
}
|
|
}
|
|
function findComponentFromName(state, name2, allowExpression) {
|
|
let result;
|
|
if (!allowExpression) {
|
|
result = { type: "Literal", value: name2 };
|
|
} else if (name2.includes(".")) {
|
|
const identifiers = name2.split(".");
|
|
let index2 = -1;
|
|
let node;
|
|
while (++index2 < identifiers.length) {
|
|
const prop = name(identifiers[index2]) ? { type: "Identifier", name: identifiers[index2] } : { type: "Literal", value: identifiers[index2] };
|
|
node = node ? {
|
|
type: "MemberExpression",
|
|
object: node,
|
|
property: prop,
|
|
computed: Boolean(index2 && prop.type === "Literal"),
|
|
optional: false
|
|
} : prop;
|
|
}
|
|
result = node;
|
|
} else {
|
|
result = name(name2) && !/^[a-z]/.test(name2) ? { type: "Identifier", name: name2 } : { type: "Literal", value: name2 };
|
|
}
|
|
if (result.type === "Literal") {
|
|
const name3 = (
|
|
/** @type {string | number} */
|
|
result.value
|
|
);
|
|
return own2.call(state.components, name3) ? state.components[name3] : name3;
|
|
}
|
|
if (state.evaluater) {
|
|
return state.evaluater.evaluateExpression(result);
|
|
}
|
|
crashEstree(state);
|
|
}
|
|
function crashEstree(state, place) {
|
|
const message = new VFileMessage(
|
|
"Cannot handle MDX estrees without `createEvaluater`",
|
|
{
|
|
ancestors: state.ancestors,
|
|
place,
|
|
ruleId: "mdx-estree",
|
|
source: "hast-util-to-jsx-runtime"
|
|
}
|
|
);
|
|
message.file = state.filePath || void 0;
|
|
message.url = docs + "#cannot-handle-mdx-estrees-without-createevaluater";
|
|
throw message;
|
|
}
|
|
function transformStylesToCssCasing(domCasing) {
|
|
const cssCasing = {};
|
|
let from;
|
|
for (from in domCasing) {
|
|
if (own2.call(domCasing, from)) {
|
|
cssCasing[transformStyleToCssCasing(from)] = domCasing[from];
|
|
}
|
|
}
|
|
return cssCasing;
|
|
}
|
|
function transformStyleToCssCasing(from) {
|
|
let to = from.replace(cap2, toDash);
|
|
if (to.slice(0, 3) === "ms-") to = "-" + to;
|
|
return to;
|
|
}
|
|
function toDash($0) {
|
|
return "-" + $0.toLowerCase();
|
|
}
|
|
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", {
|
|
class: "table-container",
|
|
children: /* @__PURE__ */ jsx("table", { ...props })
|
|
}),
|
|
style: ({ children, ...rest }) => h("style", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } }),
|
|
script: ({ children, ...rest }) => h("script", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } })
|
|
};
|
|
function htmlToJsx(tree, components) {
|
|
return toJsxRuntime(tree, {
|
|
Fragment,
|
|
jsx: jsx,
|
|
jsxs: jsxs,
|
|
elementAttributeNameCase: "html",
|
|
components: { ...builtinComponents, ...components }
|
|
});
|
|
}
|
|
|
|
// src/i18n/locales/en-US.ts
|
|
var en_US_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Folder",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 item under this folder." : `${count} items under this folder.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/ar-SA.ts
|
|
var ar_SA_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u0645\u062C\u0644\u062F",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "\u064A\u0648\u062C\u062F \u0639\u0646\u0635\u0631 \u0648\u0627\u062D\u062F \u0641\u0642\u0637 \u062A\u062D\u062A \u0647\u0630\u0627 \u0627\u0644\u0645\u062C\u0644\u062F" : `\u064A\u0648\u062C\u062F ${count} \u0639\u0646\u0627\u0635\u0631 \u062A\u062D\u062A \u0647\u0630\u0627 \u0627\u0644\u0645\u062C\u0644\u062F.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/ca-ES.ts
|
|
var ca_ES_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Carpeta",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 article en aquesta carpeta." : `${count} articles en esta carpeta.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/cs-CZ.ts
|
|
var cs_CZ_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Slo\u017Eka",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 polo\u017Eka v t\xE9to slo\u017Ece." : `${count} polo\u017Eek v t\xE9to slo\u017Ece.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/de-DE.ts
|
|
var de_DE_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Ordner",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 Datei in diesem Ordner." : `${count} Dateien in diesem Ordner.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/en-GB.ts
|
|
var en_GB_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Folder",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 item under this folder." : `${count} items under this folder.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/es-ES.ts
|
|
var es_ES_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Carpeta",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 art\xEDculo en esta carpeta." : `${count} art\xEDculos en esta carpeta.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/fa-IR.ts
|
|
var fa_IR_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u067E\u0648\u0634\u0647",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? ".\u06CC\u06A9 \u0645\u0637\u0644\u0628 \u062F\u0631 \u0627\u06CC\u0646 \u067E\u0648\u0634\u0647 \u0627\u0633\u062A" : `${count} \u0645\u0637\u0644\u0628 \u062F\u0631 \u0627\u06CC\u0646 \u067E\u0648\u0634\u0647 \u0627\u0633\u062A.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/fi-FI.ts
|
|
var fi_FI_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Kansio",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 kohde t\xE4ss\xE4 kansiossa." : `${count} kohdetta t\xE4ss\xE4 kansiossa.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/fr-FR.ts
|
|
var fr_FR_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Dossier",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 \xE9l\xE9ment sous ce dossier." : `${count} \xE9l\xE9ments sous ce dossier.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/he-IL.ts
|
|
var he_IL_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u05EA\u05D9\u05E7\u05D9\u05D9\u05D4",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "\u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3 \u05EA\u05D7\u05EA \u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05D6\u05D5." : `${count} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05EA\u05D7\u05EA \u05EA\u05D9\u05E7\u05D9\u05D9\u05D4 \u05D6\u05D5.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/hu-HU.ts
|
|
var hu_HU_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Mappa",
|
|
itemsUnderFolder: ({ count }) => `Ebben a mapp\xE1ban ${count} elem tal\xE1lhat\xF3.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/id-ID.ts
|
|
var id_ID_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Folder",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 item di bawah folder ini." : `${count} item di bawah folder ini.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/it-IT.ts
|
|
var it_IT_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Cartella",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 oggetto in questa cartella." : `${count} oggetti in questa cartella.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/ja-JP.ts
|
|
var ja_JP_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u30D5\u30A9\u30EB\u30C0",
|
|
itemsUnderFolder: ({ count }) => `${count}\u4EF6\u306E\u30DA\u30FC\u30B8`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/kk-KZ.ts
|
|
var kk_KZ_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u049A\u0430\u043B\u0442\u0430",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "\u0411\u04B1\u043B \u049B\u0430\u043B\u0442\u0430\u0434\u0430 1 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0431\u0430\u0440." : `\u0411\u04B1\u043B \u049B\u0430\u043B\u0442\u0430\u0434\u0430 ${count} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0431\u0430\u0440.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/ko-KR.ts
|
|
var ko_KR_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\uD3F4\uB354",
|
|
itemsUnderFolder: ({ count }) => `${count}\uAC74\uC758 \uD56D\uBAA9`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/lt-LT.ts
|
|
var lt_LT_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Aplankas",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 elementas \u0161iame aplanke." : count < 10 ? `${count} elementai \u0161iame aplanke.` : `${count} element\u0173 \u0161iame aplanke.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/nb-NO.ts
|
|
var nb_NO_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Mappe",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 gjenstand i denne mappen." : `${count} gjenstander i denne mappen.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/nl-NL.ts
|
|
var nl_NL_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Map",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 item in deze map." : `${count} items in deze map.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/pl-PL.ts
|
|
var pl_PL_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Folder",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "W tym folderze jest 1 element." : `Element\xF3w w folderze: ${count}.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/pt-BR.ts
|
|
var pt_BR_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Arquivo",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 item neste arquivo." : `${count} items neste arquivo.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/ro-RO.ts
|
|
var ro_RO_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Dosar",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "1 articol \xEEn acest dosar." : `${count} elemente \xEEn acest dosar.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/ru-RU.ts
|
|
var ru_RU_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u041F\u0430\u043F\u043A\u0430",
|
|
itemsUnderFolder: ({ count }) => `\u0432 \u044D\u0442\u043E\u0439 \u043F\u0430\u043F\u043A\u0435 ${count} \u044D\u043B\u0435\u043C\u0435\u043D\u0442${getForm(count, "", "\u0430", "\u043E\u0432")}`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
function getForm(number2, form1, form2, form5) {
|
|
const remainder100 = number2 % 100;
|
|
const remainder10 = remainder100 % 10;
|
|
if (remainder100 >= 10 && remainder100 <= 20) return form5;
|
|
if (remainder10 > 1 && remainder10 < 5) return form2;
|
|
if (remainder10 == 1) return form1;
|
|
return form5;
|
|
}
|
|
|
|
// src/i18n/locales/th-TH.ts
|
|
var th_TH_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u0E42\u0E1F\u0E25\u0E40\u0E14\u0E2D\u0E23\u0E4C",
|
|
itemsUnderFolder: ({ count }) => `\u0E21\u0E35 ${count} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E43\u0E19\u0E42\u0E1F\u0E25\u0E40\u0E14\u0E2D\u0E23\u0E4C\u0E19\u0E35\u0E49`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/tr-TR.ts
|
|
var tr_TR_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Klas\xF6r",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "Bu klas\xF6r alt\u0131nda 1 \xF6\u011Fe." : `Bu klas\xF6r alt\u0131ndaki ${count} \xF6\u011Fe.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/uk-UA.ts
|
|
var uk_UA_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u0422\u0435\u043A\u0430",
|
|
itemsUnderFolder: ({ count }) => count === 1 ? "\u0423 \u0446\u0456\u0439 \u0442\u0435\u0446\u0456 1 \u0435\u043B\u0435\u043C\u0435\u043D\u0442." : `\u0415\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u0443 \u0446\u0456\u0439 \u0442\u0435\u0446\u0456: ${count}.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/vi-VN.ts
|
|
var vi_VN_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "Th\u01B0 m\u1EE5c",
|
|
itemsUnderFolder: ({ count }) => `C\xF3 ${count} trang trong th\u01B0 m\u1EE5c n\xE0y.`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/zh-CN.ts
|
|
var zh_CN_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u6587\u4EF6\u5939",
|
|
itemsUnderFolder: ({ count }) => `\u6B64\u6587\u4EF6\u5939\u4E0B\u6709${count}\u6761\u7B14\u8BB0\u3002`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/locales/zh-TW.ts
|
|
var zh_TW_default = {
|
|
pages: {
|
|
folderContent: {
|
|
folder: "\u8CC7\u6599\u593E",
|
|
itemsUnderFolder: ({ count }) => `\u6B64\u8CC7\u6599\u593E\u4E0B\u6709 ${count} \u689D\u7B46\u8A18\u3002`
|
|
}
|
|
},
|
|
components: {}
|
|
};
|
|
|
|
// src/i18n/index.ts
|
|
var locales = {
|
|
"en-US": en_US_default,
|
|
"ar-SA": ar_SA_default,
|
|
"ca-ES": ca_ES_default,
|
|
"cs-CZ": cs_CZ_default,
|
|
"de-DE": de_DE_default,
|
|
"en-GB": en_GB_default,
|
|
"es-ES": es_ES_default,
|
|
"fa-IR": fa_IR_default,
|
|
"fi-FI": fi_FI_default,
|
|
"fr-FR": fr_FR_default,
|
|
"he-IL": he_IL_default,
|
|
"hu-HU": hu_HU_default,
|
|
"id-ID": id_ID_default,
|
|
"it-IT": it_IT_default,
|
|
"ja-JP": ja_JP_default,
|
|
"kk-KZ": kk_KZ_default,
|
|
"ko-KR": ko_KR_default,
|
|
"lt-LT": lt_LT_default,
|
|
"nb-NO": nb_NO_default,
|
|
"nl-NL": nl_NL_default,
|
|
"pl-PL": pl_PL_default,
|
|
"pt-BR": pt_BR_default,
|
|
"ro-RO": ro_RO_default,
|
|
"ru-RU": ru_RU_default,
|
|
"th-TH": th_TH_default,
|
|
"tr-TR": tr_TR_default,
|
|
"uk-UA": uk_UA_default,
|
|
"vi-VN": vi_VN_default,
|
|
"zh-CN": zh_CN_default,
|
|
"zh-TW": zh_TW_default
|
|
};
|
|
function i18n(locale) {
|
|
return locales[locale] || en_US_default;
|
|
}
|
|
|
|
// 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}";
|
|
var defaultOptions = {
|
|
showFolderCount: true,
|
|
showSubfolders: true
|
|
};
|
|
function concatenateResources(...resources) {
|
|
const result = resources.filter((r) => r !== void 0).flat();
|
|
return result.length === 0 ? void 0 : result;
|
|
}
|
|
function pagesFromTrie(folder, showSubfolders) {
|
|
return folder.children.map((node) => {
|
|
const nodeData = node.data;
|
|
if (nodeData) {
|
|
if (nodeData.unlisted === true) return void 0;
|
|
return nodeData;
|
|
}
|
|
if (node.isFolder && showSubfolders) {
|
|
return {
|
|
slug: node.slug,
|
|
dates: mostRecentDatesFromChildren(node.children),
|
|
frontmatter: { title: node.displayName, tags: [] }
|
|
};
|
|
}
|
|
return void 0;
|
|
}).filter((page) => page !== void 0);
|
|
}
|
|
function pagesFromAllFiles(allFiles, folderSlug, showSubfolders) {
|
|
const folderPrefix = folderSlug.endsWith("/index") ? folderSlug.slice(0, -"index".length) : folderSlug.endsWith("/") ? folderSlug : folderSlug + "/";
|
|
const directChildren = [];
|
|
const subfolderFiles = /* @__PURE__ */ new Map();
|
|
for (const file of allFiles) {
|
|
if (file.unlisted === true) continue;
|
|
const fileSlug = file.slug;
|
|
if (!fileSlug || !fileSlug.startsWith(folderPrefix)) continue;
|
|
const relativePath = fileSlug.slice(folderPrefix.length);
|
|
if (!relativePath || relativePath === "index") continue;
|
|
const segments = relativePath.split("/");
|
|
if (segments.length === 1) {
|
|
directChildren.push(file);
|
|
} else if (showSubfolders) {
|
|
const subfolderName = segments[0];
|
|
if (!subfolderFiles.has(subfolderName)) {
|
|
subfolderFiles.set(subfolderName, []);
|
|
}
|
|
subfolderFiles.get(subfolderName).push(file);
|
|
}
|
|
}
|
|
for (const [subfolderName, files] of subfolderFiles) {
|
|
const indexFile = files.find((f) => f.slug === `${folderPrefix}${subfolderName}/index`);
|
|
if (indexFile) continue;
|
|
directChildren.push({
|
|
slug: `${folderPrefix}${subfolderName}/index`,
|
|
dates: mostRecentDatesFromEntries(files),
|
|
frontmatter: { title: subfolderName, tags: [] }
|
|
});
|
|
}
|
|
return directChildren;
|
|
}
|
|
function mostRecentDatesFromChildren(children) {
|
|
let maybeDates;
|
|
for (const child of children) {
|
|
const childDates = child.data?.dates;
|
|
if (childDates) {
|
|
if (!maybeDates) {
|
|
maybeDates = { ...childDates };
|
|
} else {
|
|
if (childDates.created > maybeDates.created) maybeDates.created = childDates.created;
|
|
if (childDates.modified > maybeDates.modified) maybeDates.modified = childDates.modified;
|
|
if (childDates.published > maybeDates.published)
|
|
maybeDates.published = childDates.published;
|
|
}
|
|
}
|
|
}
|
|
return maybeDates ?? { created: /* @__PURE__ */ new Date(), modified: /* @__PURE__ */ new Date(), published: /* @__PURE__ */ new Date() };
|
|
}
|
|
function mostRecentDatesFromEntries(entries) {
|
|
let maybeDates;
|
|
for (const entry of entries) {
|
|
if (entry.dates) {
|
|
if (!maybeDates) {
|
|
maybeDates = { ...entry.dates };
|
|
} else {
|
|
if (entry.dates.created > maybeDates.created) maybeDates.created = entry.dates.created;
|
|
if (entry.dates.modified > maybeDates.modified) maybeDates.modified = entry.dates.modified;
|
|
if (entry.dates.published > maybeDates.published)
|
|
maybeDates.published = entry.dates.published;
|
|
}
|
|
}
|
|
}
|
|
return maybeDates ?? { created: /* @__PURE__ */ new Date(), modified: /* @__PURE__ */ new Date(), published: /* @__PURE__ */ new Date() };
|
|
}
|
|
var FolderContent_default = ((opts) => {
|
|
const options = { ...defaultOptions, ...opts };
|
|
const FolderContent = (props) => {
|
|
const { tree, fileData, allFiles, cfg } = props;
|
|
const ctx = props.ctx;
|
|
const slug2 = fileData?.slug;
|
|
if (!slug2) return null;
|
|
const trie = ctx?.trie;
|
|
let allPagesInFolder;
|
|
if (trie) {
|
|
const folder = trie.findNode(slug2.split("/"));
|
|
if (!folder) return null;
|
|
allPagesInFolder = pagesFromTrie(folder, options.showSubfolders);
|
|
} else {
|
|
allPagesInFolder = pagesFromAllFiles(allFiles ?? [], slug2, options.showSubfolders);
|
|
}
|
|
const cssClasses = fileData?.frontmatter?.cssclasses ?? [];
|
|
const classes = cssClasses.join(" ");
|
|
const listProps = {
|
|
...props,
|
|
sort: options.sort,
|
|
allFiles: allPagesInFolder
|
|
};
|
|
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: content }),
|
|
/* @__PURE__ */ jsxs("div", { class: "page-listing", children: [
|
|
options.showFolderCount && /* @__PURE__ */ jsx("p", { children: i18n(
|
|
cfg?.locale ?? "en-US"
|
|
).pages.folderContent.itemsUnderFolder({
|
|
count: allPagesInFolder.length
|
|
}) }),
|
|
/* @__PURE__ */ jsx("div", { children: pageListContent })
|
|
] })
|
|
] });
|
|
};
|
|
FolderContent.css = concatenateResources(listPage_default, PageList.css);
|
|
return FolderContent;
|
|
});
|
|
|
|
export { FolderContent_default as FolderContent, PageList, byDateAndAlphabetical, byDateAndAlphabeticalFolderFirst };
|
|
//# sourceMappingURL=index.js.map
|
|
//# sourceMappingURL=index.js.map
|