Add capacitorjs runtime

This commit is contained in:
olcxja 2026-05-03 17:09:55 +02:00
commit f90c0e6c40
8362 changed files with 1502407 additions and 1 deletions

102
node_modules/@prettier/plugin-xml/dist/embed.js generated vendored Normal file
View file

@ -0,0 +1,102 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const doc_1 = require("prettier/doc");
const { dedentToRoot, group, hardline, indent, join, line, literalline, softline } = doc_1.builders;
// Replace the string content newlines within a doc tree with literallines so
// that all of the indentation lines up appropriately
function replaceNewlines(doc) {
return doc_1.utils.mapDoc(doc, (currentDoc) => typeof currentDoc === "string" && currentDoc.includes("\n")
? currentDoc.split(/(\n)/g).map((v, i) => (i % 2 === 0 ? v : literalline))
: currentDoc);
}
// Get the start and end element tags from the current node on the tree
function getElementTags(path, opts, print) {
const node = path.getValue();
const { OPEN, Name, attribute, START_CLOSE, SLASH_OPEN, END_NAME, END } = node.children;
const parts = [OPEN[0].image, Name[0].image];
if (attribute) {
parts.push(indent([line, join(line, path.map(print, "children", "attribute"))]));
}
if (!opts.bracketSameLine) {
parts.push(softline);
}
return {
openTag: group([...parts, START_CLOSE[0].image]),
closeTag: group([SLASH_OPEN[0].image, END_NAME[0].image, END[0].image])
};
}
// Get the name of the parser that is represented by the given element node,
// return null if a matching parser cannot be found
function getParser(node, opts) {
const { Name, attribute } = node.children;
const parser = Name[0].image.toLowerCase();
// We don't want to deal with some weird recursive parser situation, so we
// need to explicitly call out the XML parser here and just return null
if (parser === "xml") {
return null;
}
// If this is a style tag with a text/css type, then we can skip straight to
// saying that this needs a CSS parser
if (parser === "style" &&
attribute &&
attribute.some((attr) => attr.children.Name[0].image === "type" &&
attr.children.STRING[0].image === '"text/css"')) {
return "css";
}
// If there is a plugin that has a parser that matches the name of this
// element, then we're going to assume that's correct for embedding and go
// ahead and switch to that parser
if (opts.plugins.some((plugin) => typeof plugin !== "string" &&
plugin.parsers &&
Object.prototype.hasOwnProperty.call(plugin.parsers, parser))) {
return parser;
}
return null;
}
// Get the source string that will be passed into the embedded parser from the
// content of the inside of the element node
function getSource(content) {
return content.chardata
.map((node) => {
const { SEA_WS, TEXT } = node.children;
const [{ image }] = SEA_WS || TEXT;
return {
offset: node.location.startOffset,
printed: image
};
})
.sort(({ offset }) => offset)
.map(({ printed }) => printed)
.join("");
}
const embed = (path, print, textToDoc, opts) => {
const node = path.getValue();
// If the node isn't an element node, then skip
if (node.name !== "element") {
return null;
}
// If the name of the node does not correspond to the name of a parser that
// prettier knows about, then skip
const parser = getParser(node, opts);
if (!parser) {
return null;
}
// If the node does not actually contain content, or it contains any content
// that is not just plain text, then skip
const content = node.children.content[0].children;
if (Object.keys(content).length !== 1 || !content.chardata) {
return null;
}
// Get the open and close tags of this element, then return the properly
// formatted content enclosed within them
const nodePath = path;
const { openTag, closeTag } = getElementTags(nodePath, opts, print);
return group([
openTag,
literalline,
dedentToRoot(replaceNewlines(doc_1.utils.stripTrailingHardline(textToDoc(getSource(content), { ...opts, parser })))),
hardline,
closeTag
]);
};
exports.default = embed;

39
node_modules/@prettier/plugin-xml/dist/parser.js generated vendored Normal file
View file

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const parser_1 = require("@xml-tools/parser");
const parser = {
parse(text) {
const { lexErrors, parseErrors, cst } = (0, parser_1.parse)(text);
// If there are any lexical errors, throw the first of them as an error.
if (lexErrors.length > 0) {
const lexError = lexErrors[0];
const error = new Error(lexError.message);
error.loc = {
start: { line: lexError.line, column: lexError.column },
end: { line: lexError.line, column: lexError.column + lexError.length }
};
throw error;
}
// If there are any parse errors, throw the first of them as an error.
if (parseErrors.length > 0) {
const parseError = parseErrors[0];
const error = new Error(parseError.message);
const { token } = parseError;
error.loc = {
start: { line: token.startLine, column: token.startColumn },
end: { line: token.endLine, column: token.endColumn }
};
throw error;
}
// Otherwise return the CST.
return cst;
},
astFormat: "xml",
locStart(node) {
return node.location.startOffset;
},
locEnd(node) {
return node.location.endOffset;
}
};
exports.default = parser;

175
node_modules/@prettier/plugin-xml/dist/plugin.js generated vendored Normal file
View file

@ -0,0 +1,175 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
const parser_1 = __importDefault(require("./parser"));
const printer_1 = __importDefault(require("./printer"));
const plugin = {
languages: [
{
name: "XML",
parsers: ["xml"],
aliases: ["rss", "xsd", "wsdl"],
extensions: [
".xml",
".adml",
".admx",
".ant",
".axml",
".builds",
".ccproj",
".ccxml",
".clixml",
".cproject",
".cscfg",
".csdef",
".csl",
".csproj",
".ct",
".depproj",
".dita",
".ditamap",
".ditaval",
".dll.config",
".dotsettings",
".filters",
".fsproj",
".fxml",
".glade",
".gml",
".gmx",
".grxml",
".iml",
".inx",
".ivy",
".jelly",
".jsproj",
".kml",
".launch",
".mdpolicy",
".mjml",
".mm",
".mod",
".mxml",
".natvis",
".ncl",
".ndproj",
".nproj",
".nuspec",
".odd",
".osm",
".pkgproj",
".pluginspec",
".proj",
".props",
".ps1xml",
".psc1",
".pt",
".rdf",
".resx",
".rss",
".runsettings",
".sch",
".scxml",
".sfproj",
".shproj",
".srdf",
".storyboard",
".sublime-snippet",
".targets",
".tml",
".ts",
".tsx",
".ui",
".urdf",
".ux",
".vbproj",
".vcxproj",
".vsixmanifest",
".vssettings",
".vstemplate",
".vxml",
".wixproj",
".workflow",
".wsdl",
".wsf",
".wxi",
".wxl",
".wxs",
".x3d",
".xacro",
".xaml",
".xib",
".xlf",
".xliff",
".xmi",
".xml.dist",
".xproj",
".xsd",
".xsl",
".xslt",
".xspec",
".xul",
".zcml"
],
filenames: [
".classpath",
".cproject",
".project",
"App.config",
"NuGet.config",
"Settings.StyleCop",
"Web.Debug.config",
"Web.Release.config",
"Web.config",
"packages.config"
],
vscodeLanguageIds: ["xml", "forcesourcemanifest"],
linguistLanguageId: 399
},
{
name: "SVG",
parsers: ["xml"],
extensions: [".svg"],
vscodeLanguageIds: ["svg"],
linguistLanguageId: 337
}
],
parsers: {
xml: parser_1.default
},
printers: {
xml: printer_1.default
},
options: {
xmlSelfClosingSpace: {
type: "boolean",
category: "XML",
default: true,
description: "Adds a space before self-closing tags.",
since: "1.1.0"
},
xmlWhitespaceSensitivity: {
type: "choice",
category: "XML",
default: "strict",
description: "How to handle whitespaces in XML.",
choices: [
{
value: "strict",
description: "Whitespaces are considered sensitive in all elements."
},
{
value: "ignore",
description: "Whitespaces are considered insensitive in all elements."
}
],
since: "0.6.0"
}
},
defaultOptions: {
printWidth: 80,
tabWidth: 2
}
};
module.exports = plugin;

326
node_modules/@prettier/plugin-xml/dist/printer.js generated vendored Normal file
View file

@ -0,0 +1,326 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const doc_1 = require("prettier/doc");
const embed_1 = __importDefault(require("./embed"));
const { fill, group, hardline, indent, join, line, literalline, softline } = doc_1.builders;
const ignoreStartComment = "<!-- prettier-ignore-start -->";
const ignoreEndComment = "<!-- prettier-ignore-end -->";
function hasIgnoreRanges(comments) {
if (!comments || comments.length === 0) {
return false;
}
comments.sort((left, right) => left.startOffset - right.startOffset);
let startFound = false;
for (let idx = 0; idx < comments.length; idx += 1) {
if (comments[idx].image === ignoreStartComment) {
startFound = true;
}
else if (startFound && comments[idx].image === ignoreEndComment) {
return true;
}
}
return false;
}
function isWhitespaceIgnorable(node) {
const { CData, Comment, reference } = node.children;
return !CData && !reference && !hasIgnoreRanges(Comment);
}
function printIToken(path) {
const node = path.getValue();
return {
offset: node.startOffset,
startLine: node.startLine,
endLine: node.endLine,
printed: node.image
};
}
function replaceNewlinesWithLiteralLines(content) {
return content
.split(/(\n)/g)
.map((value, idx) => (idx % 2 === 0 ? value : literalline));
}
const printer = {
embed: embed_1.default,
print(path, opts, print) {
const node = path.getValue();
switch (node.name) {
case "attribute": {
const { Name, EQUALS, STRING } = node.children;
return [Name[0].image, EQUALS[0].image, STRING[0].image];
}
case "chardata": {
const { SEA_WS, TEXT } = node.children;
const [{ image }] = SEA_WS || TEXT;
return image
.split(/(\n)/g)
.map((value, index) => (index % 2 === 0 ? value : literalline));
}
case "content": {
const nodePath = path;
let fragments = nodePath.call((childrenPath) => {
let response = [];
const children = childrenPath.getValue();
if (children.CData) {
response = response.concat(childrenPath.map(printIToken, "CData"));
}
if (children.Comment) {
response = response.concat(childrenPath.map(printIToken, "Comment"));
}
if (children.chardata) {
response = response.concat(childrenPath.map((charDataPath) => ({
offset: charDataPath.getValue().location.startOffset,
printed: print(charDataPath)
}), "chardata"));
}
if (children.element) {
response = response.concat(childrenPath.map((elementPath) => ({
offset: elementPath.getValue().location.startOffset,
printed: print(elementPath)
}), "element"));
}
if (children.PROCESSING_INSTRUCTION) {
response = response.concat(childrenPath.map(printIToken, "PROCESSING_INSTRUCTION"));
}
if (children.reference) {
response = response.concat(childrenPath.map((referencePath) => {
const referenceNode = referencePath.getValue();
return {
offset: referenceNode.location.startOffset,
printed: (referenceNode.children.CharRef ||
referenceNode.children.EntityRef)[0].image
};
}, "reference"));
}
return response;
}, "children");
const { Comment } = node.children;
if (hasIgnoreRanges(Comment)) {
Comment.sort((left, right) => left.startOffset - right.startOffset);
const ignoreRanges = [];
let ignoreStart = null;
// Build up a list of ignored ranges from the original text based on the
// special prettier-ignore-* comments
Comment.forEach((comment) => {
if (comment.image === ignoreStartComment) {
ignoreStart = comment;
}
else if (ignoreStart && comment.image === ignoreEndComment) {
ignoreRanges.push({
start: ignoreStart.startOffset,
end: comment.endOffset
});
ignoreStart = null;
}
});
// Filter the printed children to only include the ones that are outside
// of each of the ignored ranges
fragments = fragments.filter((fragment) => ignoreRanges.every(({ start, end }) => fragment.offset < start || fragment.offset > end));
// Push each of the ignored ranges into the child list as its own element
// so that the original content is still included
ignoreRanges.forEach(({ start, end }) => {
const content = opts.originalText.slice(start, end + 1);
fragments.push({
offset: start,
printed: replaceNewlinesWithLiteralLines(content)
});
});
}
fragments.sort((left, right) => left.offset - right.offset);
return group(fragments.map(({ printed }) => printed));
}
case "docTypeDecl": {
const { DocType, Name, externalID, CLOSE } = node.children;
const parts = [DocType[0].image, " ", Name[0].image];
if (externalID) {
parts.push(" ", path.call(print, "children", "externalID", 0));
}
return group([...parts, CLOSE[0].image]);
}
case "document": {
const { docTypeDecl, element, misc, prolog } = node.children;
const fragments = [];
if (docTypeDecl) {
fragments.push({
offset: docTypeDecl[0].location.startOffset,
printed: path.call(print, "children", "docTypeDecl", 0)
});
}
if (prolog) {
fragments.push({
offset: prolog[0].location.startOffset,
printed: path.call(print, "children", "prolog", 0)
});
}
if (misc) {
misc.forEach((node) => {
if (node.children.PROCESSING_INSTRUCTION) {
fragments.push({
offset: node.location.startOffset,
printed: node.children.PROCESSING_INSTRUCTION[0].image
});
}
else if (node.children.Comment) {
fragments.push({
offset: node.location.startOffset,
printed: node.children.Comment[0].image
});
}
});
}
if (element) {
fragments.push({
offset: element[0].location.startOffset,
printed: path.call(print, "children", "element", 0)
});
}
fragments.sort((left, right) => left.offset - right.offset);
return [
join(hardline, fragments.map(({ printed }) => printed)),
hardline
];
}
case "element": {
const { OPEN, Name, attribute, START_CLOSE, content, SLASH_OPEN, END_NAME, END, SLASH_CLOSE } = node.children;
const parts = [OPEN[0].image, Name[0].image];
if (attribute) {
const separator = opts.singleAttributePerLine ? hardline : line;
parts.push(indent([
line,
join(separator, path.map(print, "children", "attribute"))
]));
}
// Determine the value that will go between the <, name, and attributes
// of an element and the /> of an element.
const space = opts.xmlSelfClosingSpace ? line : softline;
if (SLASH_CLOSE) {
return group([...parts, space, SLASH_CLOSE[0].image]);
}
if (Object.keys(content[0].children).length === 0) {
return group([...parts, space, "/>"]);
}
const openTag = group([
...parts,
opts.bracketSameLine ? "" : softline,
START_CLOSE[0].image
]);
const closeTag = group([
SLASH_OPEN[0].image,
END_NAME[0].image,
END[0].image
]);
if (opts.xmlWhitespaceSensitivity === "ignore" &&
isWhitespaceIgnorable(content[0])) {
const nodePath = path;
const fragments = nodePath.call((childrenPath) => {
const children = childrenPath.getValue();
let response = [];
if (children.Comment) {
response = response.concat(childrenPath.map(printIToken, "Comment"));
}
if (children.chardata) {
childrenPath.each((charDataPath) => {
const chardata = charDataPath.getValue();
if (!chardata.children.TEXT) {
return;
}
const content = chardata.children.TEXT[0].image.trim();
const printed = group(content.split(/(\n)/g).map((value) => {
if (value === "\n") {
return literalline;
}
return fill(value
.split(/\b( +)\b/g)
.map((segment, index) => index % 2 === 0 ? segment : line));
}));
const location = chardata.location;
response.push({
offset: location.startOffset,
startLine: location.startLine,
endLine: location.endLine,
printed
});
}, "chardata");
}
if (children.element) {
response = response.concat(childrenPath.map((elementPath) => {
const location = elementPath.getValue().location;
return {
offset: location.startOffset,
startLine: location.startLine,
endLine: location.endLine,
printed: print(elementPath)
};
}, "element"));
}
if (children.PROCESSING_INSTRUCTION) {
response = response.concat(childrenPath.map(printIToken, "PROCESSING_INSTRUCTION"));
}
return response;
}, "children", "content", 0, "children");
fragments.sort((left, right) => left.offset - right.offset);
// If the only content of this tag is chardata, then use a softline so
// that we won't necessarily break (to allow <foo>bar</foo>).
if (fragments.length === 1 &&
(content[0].children.chardata || []).filter((chardata) => chardata.children.TEXT).length === 1) {
return group([
openTag,
indent([softline, fragments[0].printed]),
softline,
closeTag
]);
}
if (fragments.length === 0) {
return group([...parts, space, "/>"]);
}
const docs = [];
let lastLine = fragments[0].startLine;
fragments.forEach((node) => {
if (node.startLine - lastLine >= 2) {
docs.push(hardline, hardline);
}
else {
docs.push(hardline);
}
docs.push(node.printed);
lastLine = node.endLine;
});
return group([openTag, indent(docs), hardline, closeTag]);
}
return group([
openTag,
indent(path.call(print, "children", "content", 0)),
closeTag
]);
}
case "externalID": {
const { Public, PubIDLiteral, System, SystemLiteral } = node.children;
if (System) {
return group([
System[0].image,
indent([line, SystemLiteral[0].image])
]);
}
return group([
group([Public[0].image, indent([line, PubIDLiteral[0].image])]),
indent([line, SystemLiteral[0].image])
]);
}
case "prolog": {
const { XMLDeclOpen, attribute, SPECIAL_CLOSE } = node.children;
const parts = [XMLDeclOpen[0].image];
if (attribute) {
parts.push(indent([
softline,
join(line, path.map(print, "children", "attribute"))
]));
}
const space = opts.xmlSelfClosingSpace ? line : softline;
return group([...parts, space, SPECIAL_CLOSE[0].image]);
}
}
}
};
exports.default = printer;

20
node_modules/@prettier/plugin-xml/dist/types.js generated vendored Normal file
View file

@ -0,0 +1,20 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
;
// Reexporting every export from the parser so that the different node types can
// be referenced.
__exportStar(require("@xml-tools/parser"), exports);