@restnfeel/agentc-starter-kit
Version:
한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템
89 lines (70 loc) • 3.09 kB
JavaScript
import { __exports as officeXmlReader } from '../../../../_virtual/office-xml-reader.js';
import require$$0 from '../../../../_virtual/index-all.js';
import { __require as requirePromises } from '../promises.js';
import { __require as requireXml } from '../xml/index.js';
var hasRequiredOfficeXmlReader;
function requireOfficeXmlReader () {
if (hasRequiredOfficeXmlReader) return officeXmlReader;
hasRequiredOfficeXmlReader = 1;
var _ = require$$0;
var promises = /*@__PURE__*/ requirePromises();
var xml = /*@__PURE__*/ requireXml();
officeXmlReader.read = read;
officeXmlReader.readXmlFromZipFile = readXmlFromZipFile;
var xmlNamespaceMap = {
// Transitional format
"http://schemas.openxmlformats.org/wordprocessingml/2006/main": "w",
"http://schemas.openxmlformats.org/officeDocument/2006/relationships": "r",
"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing": "wp",
"http://schemas.openxmlformats.org/drawingml/2006/main": "a",
"http://schemas.openxmlformats.org/drawingml/2006/picture": "pic",
// Strict format
"http://purl.oclc.org/ooxml/wordprocessingml/main": "w",
"http://purl.oclc.org/ooxml/officeDocument/relationships": "r",
"http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing": "wp",
"http://purl.oclc.org/ooxml/drawingml/main": "a",
"http://purl.oclc.org/ooxml/drawingml/picture": "pic",
// Common
"http://schemas.openxmlformats.org/package/2006/content-types": "content-types",
"http://schemas.openxmlformats.org/package/2006/relationships": "relationships",
"http://schemas.openxmlformats.org/markup-compatibility/2006": "mc",
"urn:schemas-microsoft-com:vml": "v",
"urn:schemas-microsoft-com:office:word": "office-word",
// [MS-DOCX]: Word Extensions to the Office Open XML (.docx) File Format
// https://learn.microsoft.com/en-us/openspecs/office_standards/ms-docx/b839fe1f-e1ca-4fa6-8c26-5954d0abbccd
"http://schemas.microsoft.com/office/word/2010/wordml": "wordml"
};
function read(xmlString) {
return xml.readString(xmlString, xmlNamespaceMap)
.then(function(document) {
return collapseAlternateContent(document)[0];
});
}
function readXmlFromZipFile(docxFile, path) {
if (docxFile.exists(path)) {
return docxFile.read(path, "utf-8")
.then(stripUtf8Bom)
.then(read);
} else {
return promises.resolve(null);
}
}
function stripUtf8Bom(xmlString) {
return xmlString.replace(/^\uFEFF/g, '');
}
function collapseAlternateContent(node) {
if (node.type === "element") {
if (node.name === "mc:AlternateContent") {
return node.firstOrEmpty("mc:Fallback").children;
} else {
node.children = _.flatten(node.children.map(collapseAlternateContent, true));
return [node];
}
} else {
return [node];
}
}
return officeXmlReader;
}
export { requireOfficeXmlReader as __require };
//# sourceMappingURL=office-xml-reader.js.map