@taloswork/ose-shared 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/skills/document/SKILL.md +33 -45
- package/skills/document/bin/deck-build.cjs +10482 -272
- package/skills/document/bin/deck-chart.cjs +21 -12
- package/skills/document/bin/deck-plan.cjs +11654 -42
- package/skills/document/bin/deck-qa.cjs +107 -23
- package/skills/document/bin/deck-scenario.cjs +20 -3
- package/skills/document/bin/deck-styles.cjs +1604 -0
- package/skills/document/bin/doc-convert.cjs +200 -260
- package/skills/document/bin/doc-fill.cjs +140 -19
- package/skills/document/bin/doc-gen.cjs +1909 -282
- package/skills/document/bin/doc-scan.cjs +6 -1
- package/skills/document/bin/doc-text.cjs +6 -1
- package/skills/document/bin/doc-validate.cjs +139 -54
- package/skills/document/bin/docx-defaults.cjs +9907 -0
- package/skills/document/bin/html2pptx.cjs +35960 -31973
- package/skills/document/bin/pdf-form.cjs +14 -1
- package/skills/document/bin/pdf-images.cjs +6 -1
- package/skills/document/bin/pdf-ops.cjs +14 -1
- package/skills/document/bin/pdf-render.cjs +6 -1
- package/skills/document/bin/pdf-tables.cjs +6 -1
- package/skills/document/bin/pptx-notes.cjs +10038 -0
- package/skills/document/bin/pptx-tokenize.cjs +19 -4
- package/skills/document/bin/template-skin.cjs +10915 -0
- package/skills/document/bin-reference.md +15 -10
- package/skills/document/catalog.json +33 -32
- package/skills/document/content-pipeline.md +79 -44
- package/skills/document/deck-design.md +55 -32
- package/skills/document/generated-visuals.md +99 -0
- package/skills/document/layouts/MAINTAINERS.md +33 -0
- package/skills/document/layouts/README.md +20 -20
- package/skills/document/layouts/big-stat.tpl +1 -1
- package/skills/document/layouts/capacity.json +1 -1
- package/skills/document/layouts/cards-3.tpl +1 -1
- package/skills/document/layouts/chart-full.tpl +1 -1
- package/skills/document/layouts/chart-kpi.tpl +1 -1
- package/skills/document/layouts/comparison.tpl +1 -1
- package/skills/document/layouts/data-table.tpl +1 -1
- package/skills/document/layouts/funnel.tpl +1 -1
- package/skills/document/layouts/gantt.tpl +1 -1
- package/skills/document/layouts/hub-flow.tpl +4 -0
- package/skills/document/layouts/icon-row.tpl +1 -1
- package/skills/document/layouts/image-grid.tpl +1 -1
- package/skills/document/layouts/matrix-2x2.tpl +1 -1
- package/skills/document/layouts/mock-qa.tpl +4 -0
- package/skills/document/layouts/profiles.json +2 -2
- package/skills/document/layouts/pyramid.tpl +1 -1
- package/skills/document/layouts/radar.tpl +1 -1
- package/skills/document/layouts/ring-progress.tpl +1 -1
- package/skills/document/layouts/slots.json +1 -1
- package/skills/document/layouts/steps-vertical.tpl +1 -1
- package/skills/document/layouts/steps.tpl +1 -1
- package/skills/document/layouts/three-kpi.tpl +1 -1
- package/skills/document/layouts/timeline.tpl +1 -1
- package/skills/document/layouts/toc-panel.tpl +1 -1
- package/skills/document/layouts/two-kpi.tpl +2 -2
- package/skills/document/layouts/versus.tpl +1 -1
- package/skills/document/packs/README.md +1 -1
- package/skills/document/pdf.md +13 -0
- package/skills/document/rewrite.md +23 -8
- package/skills/document/scenarios.json +19 -2
- package/skills/document/scenarios.schema.json +1 -0
- package/skills/document/styles/_backdrops/rimlight.html +3 -2
- package/skills/document/styles/_contract-defaults.css +6 -1
- package/skills/document/styles/_samples/_groups/biz-premium.webp +0 -0
- package/skills/document/styles/_samples/mckinsey.webp +0 -0
- package/skills/document/styles/mckinsey/backdrop.html +7 -5
- package/skills/grill-me/SKILL.md +6 -0
- package/skills/grill-me/agents/openai.yaml +5 -0
- package/skills/grilling/SKILL.md +28 -0
- package/skills/grilling/agents/openai.yaml +3 -0
|
@@ -24,7 +24,12 @@ function loadMupdf() {
|
|
|
24
24
|
if (!_mupdf) {
|
|
25
25
|
const deps = process.env.TALOS_SKILL_DEPS;
|
|
26
26
|
const spec = deps ? (0, import_node_url.pathToFileURL)((0, import_node_path.join)(deps, "mupdf", "dist", "mupdf.js")).href : "mupdf";
|
|
27
|
-
|
|
27
|
+
const loading = import(spec);
|
|
28
|
+
_mupdf = loading;
|
|
29
|
+
loading.catch(() => {
|
|
30
|
+
if (_mupdf === loading)
|
|
31
|
+
_mupdf = null;
|
|
32
|
+
});
|
|
28
33
|
}
|
|
29
34
|
return _mupdf;
|
|
30
35
|
}
|
|
@@ -24,7 +24,12 @@ function loadMupdf() {
|
|
|
24
24
|
if (!_mupdf) {
|
|
25
25
|
const deps = process.env.TALOS_SKILL_DEPS;
|
|
26
26
|
const spec = deps ? (0, import_node_url.pathToFileURL)((0, import_node_path.join)(deps, "mupdf", "dist", "mupdf.js")).href : "mupdf";
|
|
27
|
-
|
|
27
|
+
const loading = import(spec);
|
|
28
|
+
_mupdf = loading;
|
|
29
|
+
loading.catch(() => {
|
|
30
|
+
if (_mupdf === loading)
|
|
31
|
+
_mupdf = null;
|
|
32
|
+
});
|
|
28
33
|
}
|
|
29
34
|
return _mupdf;
|
|
30
35
|
}
|
|
@@ -9790,9 +9790,9 @@ var require_load = __commonJS({
|
|
|
9790
9790
|
var require_lib3 = __commonJS({
|
|
9791
9791
|
"node_modules/jszip/lib/index.js"(exports2, module2) {
|
|
9792
9792
|
"use strict";
|
|
9793
|
-
function
|
|
9794
|
-
if (!(this instanceof
|
|
9795
|
-
return new
|
|
9793
|
+
function JSZip6() {
|
|
9794
|
+
if (!(this instanceof JSZip6)) {
|
|
9795
|
+
return new JSZip6();
|
|
9796
9796
|
}
|
|
9797
9797
|
if (arguments.length) {
|
|
9798
9798
|
throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
@@ -9801,7 +9801,7 @@ var require_lib3 = __commonJS({
|
|
|
9801
9801
|
this.comment = null;
|
|
9802
9802
|
this.root = "";
|
|
9803
9803
|
this.clone = function() {
|
|
9804
|
-
var newObj = new
|
|
9804
|
+
var newObj = new JSZip6();
|
|
9805
9805
|
for (var i in this) {
|
|
9806
9806
|
if (typeof this[i] !== "function") {
|
|
9807
9807
|
newObj[i] = this[i];
|
|
@@ -9810,16 +9810,16 @@ var require_lib3 = __commonJS({
|
|
|
9810
9810
|
return newObj;
|
|
9811
9811
|
};
|
|
9812
9812
|
}
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
return new
|
|
9813
|
+
JSZip6.prototype = require_object();
|
|
9814
|
+
JSZip6.prototype.loadAsync = require_load();
|
|
9815
|
+
JSZip6.support = require_support();
|
|
9816
|
+
JSZip6.defaults = require_defaults();
|
|
9817
|
+
JSZip6.version = "3.10.1";
|
|
9818
|
+
JSZip6.loadAsync = function(content, options) {
|
|
9819
|
+
return new JSZip6().loadAsync(content, options);
|
|
9820
9820
|
};
|
|
9821
|
-
|
|
9822
|
-
module2.exports =
|
|
9821
|
+
JSZip6.external = require_external();
|
|
9822
|
+
module2.exports = JSZip6;
|
|
9823
9823
|
}
|
|
9824
9824
|
});
|
|
9825
9825
|
|
|
@@ -27608,6 +27608,7 @@ __export(pdf_extract_exports, {
|
|
|
27608
27608
|
extractPdfText: () => extractPdfText,
|
|
27609
27609
|
extractPdfTextLines: () => extractPdfTextLines,
|
|
27610
27610
|
pdfNeedsPassword: () => pdfNeedsPassword,
|
|
27611
|
+
pngPixels: () => pngPixels,
|
|
27611
27612
|
renderPdfPages: () => renderPdfPages,
|
|
27612
27613
|
scanPdfSignals: () => scanPdfSignals,
|
|
27613
27614
|
textMathHint: () => textMathHint,
|
|
@@ -27617,7 +27618,12 @@ function loadMupdf() {
|
|
|
27617
27618
|
if (!_mupdf) {
|
|
27618
27619
|
const deps = process.env.TALOS_SKILL_DEPS;
|
|
27619
27620
|
const spec = deps ? (0, import_node_url.pathToFileURL)((0, import_node_path.join)(deps, "mupdf", "dist", "mupdf.js")).href : "mupdf";
|
|
27620
|
-
|
|
27621
|
+
const loading = import(spec);
|
|
27622
|
+
_mupdf = loading;
|
|
27623
|
+
loading.catch(() => {
|
|
27624
|
+
if (_mupdf === loading)
|
|
27625
|
+
_mupdf = null;
|
|
27626
|
+
});
|
|
27621
27627
|
}
|
|
27622
27628
|
return _mupdf;
|
|
27623
27629
|
}
|
|
@@ -27901,6 +27907,13 @@ async function renderPdfPages(bytes, pages, scale = 2, maxEdge) {
|
|
|
27901
27907
|
}
|
|
27902
27908
|
return out;
|
|
27903
27909
|
}
|
|
27910
|
+
async function pngPixels(png) {
|
|
27911
|
+
const mupdf = await loadMupdf();
|
|
27912
|
+
const pix = new mupdf.Image(png).toPixmap();
|
|
27913
|
+
const width = pix.getWidth(), height = pix.getHeight();
|
|
27914
|
+
const channels = pix.getStride() / width;
|
|
27915
|
+
return { width, height, channels, data: pix.getPixels() };
|
|
27916
|
+
}
|
|
27904
27917
|
async function extractPdfImages(bytes, pages) {
|
|
27905
27918
|
const { doc } = await openDoc(bytes);
|
|
27906
27919
|
const total = doc.countPages();
|
|
@@ -27973,8 +27986,74 @@ var import_promises2 = require("node:fs/promises");
|
|
|
27973
27986
|
var import_node_path3 = require("node:path");
|
|
27974
27987
|
|
|
27975
27988
|
// packages/core/dist/document/doc-validate.js
|
|
27976
|
-
var
|
|
27989
|
+
var import_jszip3 = __toESM(require_lib3(), 1);
|
|
27977
27990
|
var import_pdf_lib = __toESM(require_cjs(), 1);
|
|
27991
|
+
|
|
27992
|
+
// packages/core/dist/document/pptx-notes.js
|
|
27993
|
+
var import_jszip = __toESM(require_lib3(), 1);
|
|
27994
|
+
|
|
27995
|
+
// packages/core/dist/document/pptx-parts.js
|
|
27996
|
+
var SLIDE_PART = /^ppt\/slides\/(slide\d+\.xml)$/;
|
|
27997
|
+
function relsPathFor(path) {
|
|
27998
|
+
return path.replace(SLIDE_PART, "ppt/slides/_rels/$1.rels");
|
|
27999
|
+
}
|
|
28000
|
+
function attr(el, name) {
|
|
28001
|
+
return new RegExp(`\\b${name}="([^"]*)"`).exec(el)?.[1];
|
|
28002
|
+
}
|
|
28003
|
+
async function slidePartsInOrder(zip) {
|
|
28004
|
+
const byNumber = Object.keys(zip.files).filter((p) => SLIDE_PART.test(p)).sort((a, b) => Number(/(\d+)\.xml$/.exec(a)[1]) - Number(/(\d+)\.xml$/.exec(b)[1]));
|
|
28005
|
+
const toParts = (paths) => paths.map((path, i) => ({ position: i + 1, path, relsPath: relsPathFor(path) }));
|
|
28006
|
+
const pres = await zip.file("ppt/presentation.xml")?.async("string");
|
|
28007
|
+
const rels = await zip.file("ppt/_rels/presentation.xml.rels")?.async("string");
|
|
28008
|
+
if (!pres || !rels)
|
|
28009
|
+
return toParts(byNumber);
|
|
28010
|
+
const targetById = /* @__PURE__ */ new Map();
|
|
28011
|
+
for (const [el] of rels.matchAll(/<Relationship\b[^>]*>/g)) {
|
|
28012
|
+
const id = attr(el, "Id");
|
|
28013
|
+
const target = attr(el, "Target");
|
|
28014
|
+
if (!id || !target)
|
|
28015
|
+
continue;
|
|
28016
|
+
targetById.set(id, target.startsWith("/") ? target.slice(1) : `ppt/${target.replace(/^\.\//, "")}`);
|
|
28017
|
+
}
|
|
28018
|
+
const list = /<p:sldIdLst\b[^>]*>([\s\S]*?)<\/p:sldIdLst>/.exec(pres)?.[1] ?? "";
|
|
28019
|
+
const ordered = [...list.matchAll(/<p:sldId\b[^>]*>/g)].map(([el]) => targetById.get(attr(el, "r:id") ?? "")).filter((p) => p !== void 0 && SLIDE_PART.test(p) && zip.file(p) !== null);
|
|
28020
|
+
const complete = ordered.length === byNumber.length && new Set(ordered).size === ordered.length;
|
|
28021
|
+
return toParts(complete ? ordered : byNumber);
|
|
28022
|
+
}
|
|
28023
|
+
|
|
28024
|
+
// packages/core/dist/document/pptx-notes.js
|
|
28025
|
+
var REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
28026
|
+
var NOTES_SLIDE_REL = `${REL_NS}/notesSlide`;
|
|
28027
|
+
var NOTES_MASTER_REL = `${REL_NS}/notesMaster`;
|
|
28028
|
+
var SLIDE_REL = `${REL_NS}/slide`;
|
|
28029
|
+
async function notesKeynoteIssues(zip) {
|
|
28030
|
+
const out = [];
|
|
28031
|
+
for (const p of Object.keys(zip.files).filter((p2) => /^ppt\/notesSlides\/notesSlide\d+\.xml$/.test(p2)).sort()) {
|
|
28032
|
+
const xml = await zip.file(p).async("string");
|
|
28033
|
+
if (!/<p:clrMapOvr\b/.test(xml))
|
|
28034
|
+
out.push(p);
|
|
28035
|
+
}
|
|
28036
|
+
return out;
|
|
28037
|
+
}
|
|
28038
|
+
async function unlistedNotesMaster(zip) {
|
|
28039
|
+
const relsFile = zip.file("ppt/_rels/presentation.xml.rels");
|
|
28040
|
+
const presFile = zip.file("ppt/presentation.xml");
|
|
28041
|
+
if (!relsFile || !presFile)
|
|
28042
|
+
return null;
|
|
28043
|
+
const rel = new RegExp(`<Relationship\\b[^>]*Type="${NOTES_MASTER_REL}"[^>]*>`).exec(await relsFile.async("string"))?.[0];
|
|
28044
|
+
const rid = rel ? /\bId="([^"]+)"/.exec(rel)?.[1] : void 0;
|
|
28045
|
+
if (!rid)
|
|
28046
|
+
return null;
|
|
28047
|
+
return /<p:notesMasterId\b/.test(await presFile.async("string")) ? null : rid;
|
|
28048
|
+
}
|
|
28049
|
+
|
|
28050
|
+
// packages/core/dist/document/docx-defaults.js
|
|
28051
|
+
var import_jszip2 = __toESM(require_lib3(), 1);
|
|
28052
|
+
function hasDefaultParagraphStyle(stylesXml) {
|
|
28053
|
+
return [...stylesXml.matchAll(/<w:style\b[^>]*>/g)].some(([tag]) => /\bw:type="paragraph"/.test(tag) && /\bw:default="(1|true|on)"/.test(tag));
|
|
28054
|
+
}
|
|
28055
|
+
|
|
28056
|
+
// packages/core/dist/document/doc-validate.js
|
|
27978
28057
|
function looksLikePdf(bytes) {
|
|
27979
28058
|
const head = Buffer.from(bytes.subarray(0, 1024)).toString("latin1");
|
|
27980
28059
|
return head.includes("%PDF-");
|
|
@@ -28154,7 +28233,7 @@ async function validateOoxml(bytes) {
|
|
|
28154
28233
|
const result = (kind) => ({ ok: errors.length === 0, kind, errors, warnings });
|
|
28155
28234
|
let zip;
|
|
28156
28235
|
try {
|
|
28157
|
-
zip = await
|
|
28236
|
+
zip = await import_jszip3.default.loadAsync(Buffer.from(bytes));
|
|
28158
28237
|
} catch (e) {
|
|
28159
28238
|
errors.push({ code: "zip-unreadable", message: `not a readable OOXML zip: ${e.message}` });
|
|
28160
28239
|
return result("unknown");
|
|
@@ -28222,6 +28301,30 @@ async function validateOoxml(bytes) {
|
|
|
28222
28301
|
}
|
|
28223
28302
|
}
|
|
28224
28303
|
}
|
|
28304
|
+
if (root.kind === "pptx") {
|
|
28305
|
+
const bad = await notesKeynoteIssues(zip);
|
|
28306
|
+
if (bad.length) {
|
|
28307
|
+
errors.push({
|
|
28308
|
+
code: "notes-keynote",
|
|
28309
|
+
part: bad[0],
|
|
28310
|
+
message: `${bad.length} notes slide(s) lack <p:clrMapOvr> (${bad.slice(0, 3).join(", ")}${bad.length > 3 ? ", \u2026" : ""}) \u2014 Keynote refuses the whole file ("\u6587\u4EF6\u683C\u5F0F\u65E0\u6548"). Repair with \`pptx-notes <in.pptx> {} <out.pptx>\`; write notes with pptx-notes, never by hand`
|
|
28311
|
+
});
|
|
28312
|
+
}
|
|
28313
|
+
}
|
|
28314
|
+
if (root.kind === "pptx" && await unlistedNotesMaster(zip)) {
|
|
28315
|
+
errors.push({
|
|
28316
|
+
code: "notes-keynote",
|
|
28317
|
+
part: "ppt/presentation.xml",
|
|
28318
|
+
message: 'the notes master is not listed in <p:notesMasterIdLst> (python-pptx leaves it out) \u2014 Keynote refuses the whole file ("\u6587\u4EF6\u683C\u5F0F\u65E0\u6548"). Repair with `pptx-notes <in.pptx> {} <out.pptx>`'
|
|
28319
|
+
});
|
|
28320
|
+
}
|
|
28321
|
+
if (root.kind === "docx" && has("word/styles.xml") && !hasDefaultParagraphStyle(await text("word/styles.xml"))) {
|
|
28322
|
+
errors.push({
|
|
28323
|
+
code: "docx-default-style",
|
|
28324
|
+
part: "word/styles.xml",
|
|
28325
|
+
message: 'no default paragraph style (w:default="1", usually "Normal") \u2014 Word fills the gap, but Pages lays every unstyled paragraph out like the one before it (a centred title turns the whole body huge and centred). Repair with `docx-defaults <in.docx> <out.docx>`; docx from doc-gen already has it'
|
|
28326
|
+
});
|
|
28327
|
+
}
|
|
28225
28328
|
return result(root.kind);
|
|
28226
28329
|
}
|
|
28227
28330
|
|
|
@@ -28229,13 +28332,18 @@ async function validateOoxml(bytes) {
|
|
|
28229
28332
|
var import_node_path2 = require("node:path");
|
|
28230
28333
|
var import_node_url2 = require("node:url");
|
|
28231
28334
|
var import_promises = require("node:fs/promises");
|
|
28232
|
-
var
|
|
28335
|
+
var import_jszip4 = __toESM(require_lib3(), 1);
|
|
28233
28336
|
var _xmllint = null;
|
|
28234
28337
|
function loadXmllint() {
|
|
28235
28338
|
if (!_xmllint) {
|
|
28236
28339
|
const deps = process.env.TALOS_SKILL_DEPS;
|
|
28237
28340
|
const spec = deps ? (0, import_node_url2.pathToFileURL)((0, import_node_path2.join)(deps, "xmllint-wasm", "index-node.js")).href : "xmllint-wasm";
|
|
28238
|
-
|
|
28341
|
+
const loading = import(spec);
|
|
28342
|
+
_xmllint = loading;
|
|
28343
|
+
loading.catch(() => {
|
|
28344
|
+
if (_xmllint === loading)
|
|
28345
|
+
_xmllint = null;
|
|
28346
|
+
});
|
|
28239
28347
|
}
|
|
28240
28348
|
return _xmllint;
|
|
28241
28349
|
}
|
|
@@ -28285,7 +28393,7 @@ function errText(e) {
|
|
|
28285
28393
|
}
|
|
28286
28394
|
async function validateOoxmlStrict(bytes, schemaDir) {
|
|
28287
28395
|
const [{ validateXML }, schemas] = await Promise.all([loadXmllint(), loadSchemaSet(schemaDir)]);
|
|
28288
|
-
const zip = await
|
|
28396
|
+
const zip = await import_jszip4.default.loadAsync(Buffer.from(bytes));
|
|
28289
28397
|
const checked = [];
|
|
28290
28398
|
const skipped = [];
|
|
28291
28399
|
const errors = [];
|
|
@@ -28328,7 +28436,7 @@ async function validateOoxmlStrict(bytes, schemaDir) {
|
|
|
28328
28436
|
}
|
|
28329
28437
|
|
|
28330
28438
|
// packages/core/dist/document/doc-design-lint.js
|
|
28331
|
-
var
|
|
28439
|
+
var import_jszip5 = __toESM(require_lib3(), 1);
|
|
28332
28440
|
|
|
28333
28441
|
// packages/core/dist/document/ooxml-util.js
|
|
28334
28442
|
function unescXml(s) {
|
|
@@ -28352,35 +28460,6 @@ function unescXml(s) {
|
|
|
28352
28460
|
});
|
|
28353
28461
|
}
|
|
28354
28462
|
|
|
28355
|
-
// packages/core/dist/document/pptx-parts.js
|
|
28356
|
-
var SLIDE_PART = /^ppt\/slides\/(slide\d+\.xml)$/;
|
|
28357
|
-
function relsPathFor(path) {
|
|
28358
|
-
return path.replace(SLIDE_PART, "ppt/slides/_rels/$1.rels");
|
|
28359
|
-
}
|
|
28360
|
-
function attr(el, name) {
|
|
28361
|
-
return new RegExp(`\\b${name}="([^"]*)"`).exec(el)?.[1];
|
|
28362
|
-
}
|
|
28363
|
-
async function slidePartsInOrder(zip) {
|
|
28364
|
-
const byNumber = Object.keys(zip.files).filter((p) => SLIDE_PART.test(p)).sort((a, b) => Number(/(\d+)\.xml$/.exec(a)[1]) - Number(/(\d+)\.xml$/.exec(b)[1]));
|
|
28365
|
-
const toParts = (paths) => paths.map((path, i) => ({ position: i + 1, path, relsPath: relsPathFor(path) }));
|
|
28366
|
-
const pres = await zip.file("ppt/presentation.xml")?.async("string");
|
|
28367
|
-
const rels = await zip.file("ppt/_rels/presentation.xml.rels")?.async("string");
|
|
28368
|
-
if (!pres || !rels)
|
|
28369
|
-
return toParts(byNumber);
|
|
28370
|
-
const targetById = /* @__PURE__ */ new Map();
|
|
28371
|
-
for (const [el] of rels.matchAll(/<Relationship\b[^>]*>/g)) {
|
|
28372
|
-
const id = attr(el, "Id");
|
|
28373
|
-
const target = attr(el, "Target");
|
|
28374
|
-
if (!id || !target)
|
|
28375
|
-
continue;
|
|
28376
|
-
targetById.set(id, target.startsWith("/") ? target.slice(1) : `ppt/${target.replace(/^\.\//, "")}`);
|
|
28377
|
-
}
|
|
28378
|
-
const list = /<p:sldIdLst\b[^>]*>([\s\S]*?)<\/p:sldIdLst>/.exec(pres)?.[1] ?? "";
|
|
28379
|
-
const ordered = [...list.matchAll(/<p:sldId\b[^>]*>/g)].map(([el]) => targetById.get(attr(el, "r:id") ?? "")).filter((p) => p !== void 0 && SLIDE_PART.test(p) && zip.file(p) !== null);
|
|
28380
|
-
const complete = ordered.length === byNumber.length && new Set(ordered).size === ordered.length;
|
|
28381
|
-
return toParts(complete ? ordered : byNumber);
|
|
28382
|
-
}
|
|
28383
|
-
|
|
28384
28463
|
// packages/core/dist/document/png-decode.js
|
|
28385
28464
|
var import_node_zlib = require("node:zlib");
|
|
28386
28465
|
var SIG = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
@@ -28477,6 +28556,14 @@ function decodePng(bytes) {
|
|
|
28477
28556
|
}
|
|
28478
28557
|
}
|
|
28479
28558
|
|
|
28559
|
+
// packages/core/dist/document/readable-type.js
|
|
28560
|
+
var MIN_FONT_PT = 10;
|
|
28561
|
+
var LABEL_MAX_CHARS = 24;
|
|
28562
|
+
var MIN_LABEL_FONT_PT = 8;
|
|
28563
|
+
function readableFloorPt(text) {
|
|
28564
|
+
return [...text.trim()].length <= LABEL_MAX_CHARS ? MIN_LABEL_FONT_PT : MIN_FONT_PT;
|
|
28565
|
+
}
|
|
28566
|
+
|
|
28480
28567
|
// packages/core/dist/document/text-slack.js
|
|
28481
28568
|
var SLACK_CJK_RE = /[\u3000-\u303F\u3400-\u9FFF\uF900-\uFAFF\uFF00-\uFFEF]/;
|
|
28482
28569
|
var PCT = { single: { cjk: 0.22, latin: 0.16 }, multi: { cjk: 0.1, latin: 0.06 } };
|
|
@@ -28672,9 +28759,7 @@ function lintSlideXml(slideXml, slideNumber, masterBg, expectedLang = detectDeck
|
|
|
28672
28759
|
var EMU_PER_INCH = 914400;
|
|
28673
28760
|
var DEFAULT_CANVAS = { w: 12192e3, h: 6858e3 };
|
|
28674
28761
|
var OFFCANVAS_TOL = EMU_PER_INCH / 10;
|
|
28675
|
-
var MIN_FONT_HUNDREDTHS =
|
|
28676
|
-
var LABEL_MAX_CHARS = 24;
|
|
28677
|
-
var MIN_LABEL_FONT_HUNDREDTHS = 800;
|
|
28762
|
+
var MIN_FONT_HUNDREDTHS = MIN_FONT_PT * 100;
|
|
28678
28763
|
var CHART_TEXT_RE = new RegExp(`<p:cNvPr\\b[^>]*\\bname="${CHART_TEXT_NAME}\\b`);
|
|
28679
28764
|
var OVERLAP_RATIO = 0.3;
|
|
28680
28765
|
function firstBox(block) {
|
|
@@ -28776,7 +28861,7 @@ function lintSlideGeometry(slideXml, slideNumber, canvas = DEFAULT_CANVAS) {
|
|
|
28776
28861
|
continue;
|
|
28777
28862
|
const text = unescXml(raw).trim();
|
|
28778
28863
|
const sz = /<a:rPr\b[^>]*\bsz="(\d+)"/.exec(run)?.[1];
|
|
28779
|
-
const floor =
|
|
28864
|
+
const floor = readableFloorPt(text) * 100;
|
|
28780
28865
|
if (sz && +sz < floor && (!smallest || +sz < smallest.sz)) {
|
|
28781
28866
|
smallest = { sz: +sz, text, floor };
|
|
28782
28867
|
}
|
|
@@ -28951,7 +29036,7 @@ async function backdropRaster(zip, slideXml, relsPath, canvas) {
|
|
|
28951
29036
|
return media ? decodePng(await media.async("uint8array")) : void 0;
|
|
28952
29037
|
}
|
|
28953
29038
|
async function designLintPptx(bytes) {
|
|
28954
|
-
const zip = await
|
|
29039
|
+
const zip = await import_jszip5.default.loadAsync(Buffer.from(bytes));
|
|
28955
29040
|
const findings = [];
|
|
28956
29041
|
let masterBg = { colored: false };
|
|
28957
29042
|
const masterFile = Object.keys(zip.files).find((p) => /^ppt\/slideMasters\/slideMaster\d+\.xml$/.test(p));
|