@forevka/wordcanvas 0.7.0 → 0.7.1
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/README.md +48 -1
- package/dist-lib/assets/{worker-BsOsK39A.js → worker-D8rUOKfg.js} +9603 -9451
- package/dist-lib/assets/worker-wXuuyshQ.js +2258 -0
- package/dist-lib/{blockFactory-Bcy0U40y.js → blockFactory-CUI4Rqiq.js} +50 -42
- package/dist-lib/{browser-5Sv4CuNy.js → browser-DkKxreJM.js} +404 -383
- package/dist-lib/builder.js +364 -109
- package/dist-lib/editorApp-DLXMmtu5.js +8023 -0
- package/dist-lib/export.js +3820 -3768
- package/dist-lib/generate-toc.js +4 -4
- package/dist-lib/import.js +4 -1538
- package/dist-lib/{lists-BegzmTmD.js → lists-Sc5I40JO.js} +2 -2
- package/dist-lib/pipeline-CbxmCE84.js +1705 -0
- package/dist-lib/recalc-docx.js +2 -2
- package/dist-lib/recalcToc-g1hFKSNs.js +3935 -0
- package/dist-lib/toc-B6VpkJge.js +213 -0
- package/dist-lib/{webmcp-B7Gvd58E.js → webmcp-6WxRNKCc.js} +2 -2
- package/dist-lib/{wordcanvas-BAxBeErX.js → wordcanvas-CFqpDK0k.js} +1 -1
- package/dist-lib/wordcanvas.js +1 -1
- package/dist-node/{chunk-GXFDF7UY.js → chunk-22JHAERT.js} +95 -23
- package/dist-node/chunk-22JHAERT.js.map +7 -0
- package/dist-node/{chunk-2RCPB7UZ.js → chunk-6AJJMHKY.js} +1 -1
- package/dist-node/chunk-6AJJMHKY.js.map +7 -0
- package/dist-node/{chunk-XDUDPPJW.js → chunk-CDN6WU2P.js} +89 -26
- package/dist-node/chunk-CDN6WU2P.js.map +7 -0
- package/dist-node/{chunk-TBSXA2I4.js → chunk-EGSAVPCC.js} +1 -1
- package/dist-node/chunk-EGSAVPCC.js.map +7 -0
- package/dist-node/{chunk-IJLL6IFJ.js → chunk-RNB336F3.js} +116 -5
- package/dist-node/{chunk-IJLL6IFJ.js.map → chunk-RNB336F3.js.map} +2 -2
- package/dist-node/{engine-FRCX7PXF.js → engine-5FGDJD2H.js} +3 -3
- package/dist-node/export.js +92 -31
- package/dist-node/export.js.map +2 -2
- package/dist-node/generate-toc.js +5 -5
- package/dist-node/import.js +3 -3
- package/dist-node/recalc-docx.js +4 -4
- package/dist-node/recalc-docx.js.map +1 -1
- package/package.json +1 -1
- package/types/model.d.ts +231 -225
- package/types/recalc-docx.d.ts +27 -27
- package/dist-lib/assets/worker-BbFAIxdy.js +0 -2163
- package/dist-lib/editorApp-DvjFPHiy.js +0 -7582
- package/dist-lib/recalcToc-uaLWt59L.js +0 -3835
- package/dist-lib/toc-CZel_Kk3.js +0 -127
- package/dist-node/chunk-2RCPB7UZ.js.map +0 -7
- package/dist-node/chunk-GXFDF7UY.js.map +0 -7
- package/dist-node/chunk-TBSXA2I4.js.map +0 -7
- package/dist-node/chunk-XDUDPPJW.js.map +0 -7
- /package/dist-node/{engine-FRCX7PXF.js.map → engine-5FGDJD2H.js.map} +0 -0
package/dist-lib/toc-CZel_Kk3.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { t as h, r as g, y as b } from "./browser-5Sv4CuNy.js";
|
|
2
|
-
const m = (t) => {
|
|
3
|
-
if (!t) return;
|
|
4
|
-
const e = t.match(/^(\d+)\s*-\s*(\d+)$/);
|
|
5
|
-
if (e) return { from: Number(e[1]), to: Number(e[2]) };
|
|
6
|
-
const o = t.match(/^\d+$/) ? Number(t) : NaN;
|
|
7
|
-
return Number.isNaN(o) ? void 0 : { from: o, to: o };
|
|
8
|
-
};
|
|
9
|
-
function x(t) {
|
|
10
|
-
const e = {
|
|
11
|
-
useOutlineLevels: /\\u\b/.test(t),
|
|
12
|
-
hyperlinks: /\\h\b/.test(t),
|
|
13
|
-
hideInWeb: /\\z\b/.test(t)
|
|
14
|
-
}, o = m(t.match(/\\o\s+"([^"]+)"/)?.[1]);
|
|
15
|
-
o && (e.outlineRange = o);
|
|
16
|
-
const s = m(t.match(/\\n\s+"?([0-9-]+)"?/)?.[1]);
|
|
17
|
-
s && (e.hidePageNumberRange = s);
|
|
18
|
-
const n = t.match(/\\p\s+"([^"]*)"/)?.[1];
|
|
19
|
-
n !== void 0 && (e.separator = n);
|
|
20
|
-
const a = t.match(/\\t\s+"([^"]+)"/)?.[1];
|
|
21
|
-
if (a) {
|
|
22
|
-
const i = a.split(","), r = {};
|
|
23
|
-
for (let l = 0; l + 1 < i.length; l += 2) {
|
|
24
|
-
const c = i[l].trim(), u = Number(i[l + 1].trim());
|
|
25
|
-
c && u >= 1 && (r[c] = u);
|
|
26
|
-
}
|
|
27
|
-
Object.keys(r).length > 0 && (e.customStyles = r);
|
|
28
|
-
}
|
|
29
|
-
return e;
|
|
30
|
-
}
|
|
31
|
-
const P = (t, e) => !!t && e >= t.from && e <= t.to;
|
|
32
|
-
function d(t, e) {
|
|
33
|
-
if (!e || !t.stylesheet) return;
|
|
34
|
-
const o = new Map(t.stylesheet.styles.map((a) => [a.id, a]));
|
|
35
|
-
let s = o.get(e);
|
|
36
|
-
const n = /* @__PURE__ */ new Set();
|
|
37
|
-
for (; s && !n.has(s.id); ) {
|
|
38
|
-
if (s.name && /(?:^|\s)heading\s*\d/i.test(s.name)) return s.name;
|
|
39
|
-
n.add(s.id), s = s.basedOn ? o.get(s.basedOn) : void 0;
|
|
40
|
-
}
|
|
41
|
-
return o.get(e)?.name;
|
|
42
|
-
}
|
|
43
|
-
function y(t, e, o) {
|
|
44
|
-
const s = t.style.namedStyle;
|
|
45
|
-
if (o?.customStyles && s) {
|
|
46
|
-
const i = o.customStyles[s] ?? o.customStyles[d(e, s) ?? ""];
|
|
47
|
-
if (i) return i;
|
|
48
|
-
}
|
|
49
|
-
if (t.style.outlineLevel !== void 0) return t.style.outlineLevel + 1;
|
|
50
|
-
const n = s?.match(/^heading\s*(\d)$/i);
|
|
51
|
-
if (n) return Number(n[1]);
|
|
52
|
-
const a = d(e, s)?.match(/(?:^|\s)heading\s*(\d)/i);
|
|
53
|
-
return a ? Number(a[1]) : null;
|
|
54
|
-
}
|
|
55
|
-
function S(t, e, o = 3) {
|
|
56
|
-
const s = e?.outlineRange?.to ?? o, n = [];
|
|
57
|
-
for (const a of b(t)) {
|
|
58
|
-
const i = y(a, t, e);
|
|
59
|
-
i === null || i < 1 || i > s || e?.outlineRange && (i < e.outlineRange.from || i > e.outlineRange.to) || n.push({ block: a, level: i });
|
|
60
|
-
}
|
|
61
|
-
return n;
|
|
62
|
-
}
|
|
63
|
-
function k(t, e = 20) {
|
|
64
|
-
if (!t.bookmarks) return 0;
|
|
65
|
-
const o = t.section.pageWidthPx - t.section.marginPx.left - t.section.marginPx.right;
|
|
66
|
-
let s = 0;
|
|
67
|
-
for (const n of t.blocks) {
|
|
68
|
-
if (n.kind !== "paragraph" || n.style.tocEntry) continue;
|
|
69
|
-
const a = n.runs.find((u) => u.style.link?.startsWith("#"))?.style.link?.slice(1);
|
|
70
|
-
if (!a) continue;
|
|
71
|
-
const i = t.bookmarks[a]?.start.blockId;
|
|
72
|
-
if (!i) continue;
|
|
73
|
-
const r = h(n.runs), l = r.match(/\t\d+\s*$/);
|
|
74
|
-
if (!l) continue;
|
|
75
|
-
n.runs = g(n.runs, 0, r.length - l[0].length), n.runs.length === 0 && (n.runs = [{ text: "", style: { ...f } }]);
|
|
76
|
-
const c = Math.min(9, Math.max(1, Math.round((n.style.indentLeftPx || 0) / e) + 1));
|
|
77
|
-
n.style.tocEntry = { targetId: i, level: c }, !n.style.tabStops?.length && o > 0 && (n.style.tabStops = [{ posPx: o, align: "right", leader: "dot" }]), n.revision++, s++;
|
|
78
|
-
}
|
|
79
|
-
return s;
|
|
80
|
-
}
|
|
81
|
-
const f = {
|
|
82
|
-
fontFamily: "Georgia, serif",
|
|
83
|
-
fontSizePx: 13,
|
|
84
|
-
bold: !1,
|
|
85
|
-
italic: !1,
|
|
86
|
-
underline: !1,
|
|
87
|
-
strikethrough: !1,
|
|
88
|
-
color: "#202124"
|
|
89
|
-
};
|
|
90
|
-
function N(t, e, o) {
|
|
91
|
-
const s = t.indentStepPx ?? 20, n = t.leader ?? "dot", i = { ...{ ...f, ...t.baseChar }, fontSizePx: e === 1 ? 14 : 13, bold: e === 1, ...t.levels?.[e]?.char }, r = {
|
|
92
|
-
align: "left",
|
|
93
|
-
lineHeight: 1.5,
|
|
94
|
-
spaceBeforePx: 0,
|
|
95
|
-
spaceAfterPx: 2,
|
|
96
|
-
indentFirstLinePx: 0,
|
|
97
|
-
indentLeftPx: (e - 1) * s,
|
|
98
|
-
...t.levels?.[e]?.para
|
|
99
|
-
};
|
|
100
|
-
return n !== "none" && o > 0 && (r.tabStops = [{ posPx: o, align: "right", leader: n }]), { char: i, para: r };
|
|
101
|
-
}
|
|
102
|
-
function v(t) {
|
|
103
|
-
if (t.title === null) return null;
|
|
104
|
-
const e = t.title ?? {}, o = { ...f, ...t.baseChar };
|
|
105
|
-
return {
|
|
106
|
-
text: e.text ?? "Table of Contents",
|
|
107
|
-
char: { ...o, fontSizePx: 20, bold: !0, ...e.char },
|
|
108
|
-
para: {
|
|
109
|
-
align: "left",
|
|
110
|
-
lineHeight: 1.4,
|
|
111
|
-
spaceBeforePx: 8,
|
|
112
|
-
spaceAfterPx: 12,
|
|
113
|
-
indentFirstLinePx: 0,
|
|
114
|
-
indentLeftPx: 0,
|
|
115
|
-
namedStyle: e.namedStyle ?? "tocTitle",
|
|
116
|
-
...e.para
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
export {
|
|
121
|
-
v as a,
|
|
122
|
-
S as d,
|
|
123
|
-
P as i,
|
|
124
|
-
k as m,
|
|
125
|
-
x as p,
|
|
126
|
-
N as t
|
|
127
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/import/docx/types.ts", "../../node_modules/txml/dist/txml.mjs", "../src/import/docx/xml.ts", "../src/import/docx/contentTypes.ts"],
|
|
4
|
-
"sourcesContent": ["// .docx import \u2014 shared types.\n//\n// The pipeline is: zip \u2192 XML parts \u2192 IR (intermediate representation) \u2192 model.\n// The IR is a faithful-but-minimal decode of document.xml: the parser keeps\n// everything it understands (even what the model can't hold yet); mapToModel\n// decides what survives and emits an ImportWarning for every lossy decision.\n\nimport type { Document, FieldDef } from \"@cw/shared\";\n\nexport type ImportPhase = \"unzip\" | \"styles\" | \"parse\" | \"map\";\n\nexport type ImportErrorCode = \"NOT_ZIP\" | \"ENCRYPTED\" | \"NO_DOCUMENT_PART\" | \"MALFORMED_XML\";\n\nexport class ImportError extends Error {\n readonly code: ImportErrorCode;\n constructor(code: ImportErrorCode, message: string) {\n super(message);\n this.name = \"ImportError\";\n this.code = code;\n }\n}\n\nexport interface ImportWarning {\n code: string;\n message: string;\n}\n\n/** Deduplicating warning collector \u2014 a 70-page doc with 400 tabs should say\n * \"tabs converted\" once, not 400 times. */\nexport class WarningSink {\n readonly list: ImportWarning[] = [];\n private readonly seen = new Set<string>();\n add(code: string, message: string): void {\n if (this.seen.has(code)) return;\n this.seen.add(code);\n this.list.push({ code, message });\n }\n}\n\nexport interface ImportResult {\n doc: Document;\n /** Every lossy mapping decision \u2014 surfaced, not swallowed. */\n warnings: ImportWarning[];\n /** blob: URLs created for embedded media; caller revokes when the doc is discarded. */\n mediaUrls: string[];\n /** Raw embedded image bytes, populated only when runImport is called with\n * { collectMediaBytes: true } \u2014 the Node/backend path, which content-addresses\n * them into its own media store instead of minting blob: URLs. Each `src`\n * matches the ImageBlock.src the mapper assigned, so the caller can swap in a\n * mediaId. Empty (and mediaUrls carry blob: URLs) in the browser path. */\n media: ImportMedia[];\n}\n\n/** A collected embedded image (Node/backend path). */\nexport interface ImportMedia {\n /** The synthetic src the mapper put on the ImageBlock (e.g. \"cw-media:0\"). */\n src: string;\n bytes: Uint8Array;\n mime: string;\n}\n\n/** Sink the media store routes raw image bytes to instead of creating a blob:\n * URL. Returns the src string to stamp on the ImageBlock. */\nexport interface MediaCollector {\n add(bytes: Uint8Array, mime: string): string;\n}\n\nexport interface RunImportOpts {\n onProgress?: (phase: ImportPhase, pct: number) => void;\n /** Collect raw image bytes (and skip blob: URL creation) for Node/backend\n * callers that content-address media themselves. */\n collectMediaBytes?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Worker protocol\n\nexport interface ToWorker {\n id: number;\n buf: ArrayBuffer; // transferred, not cloned\n}\n\nexport type FromWorker =\n | { id: number; type: \"progress\"; phase: ImportPhase; pct: number }\n | { id: number; type: \"done\"; result: ImportResult }\n | { id: number; type: \"error\"; code: ImportErrorCode; message: string };\n\n// ---------------------------------------------------------------------------\n// IR \u2014 what documentParser produces. Units stay as OOXML units (twips,\n// half-points); conversion to px happens in mapToModel via units.ts.\n\n/** Direct run formatting decoded from w:rPr. Absent field = \"inherit\" \u2014\n * resolved through the style cascade in milestone 2, from defaults today. */\nexport interface IRRunProps {\n /** w:rStyle reference \u2014 recorded now, resolved when StyleResolver lands. */\n styleId?: string;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n /** Raw w:color value: hex without '#' (\"FF0000\") or \"auto\". */\n color?: string;\n /** w:sz \u2014 half-points. */\n sizeHalfPoints?: number;\n /** w:rFonts w:ascii. */\n fontAscii?: string;\n /** w:rFonts w:asciiTheme \u2014 theme font slot (\"minorHAnsi\", \"majorHAnsi\", \u2026). */\n fontThemeAscii?: string;\n /** w:color w:themeColor \u2014 theme color slot (\"accent1\", \"text1\", \u2026). */\n colorTheme?: string;\n /** w:highlight w:val \u2014 named highlight color (\"yellow\", \"green\", \u2026). */\n highlight?: string;\n /** w:vertAlign w:val \u2014 \"superscript\" | \"subscript\" | \"baseline\". */\n vertAlign?: string;\n /** w:vanish \u2014 hidden text (Word shows it only with \u00B6 marks on). */\n vanish?: boolean;\n /** Hyperlink membership (set on runs inside a w:hyperlink). Resolved to a URL\n * in mapToModel: relId via the part's rels (external target), or anchor for\n * an in-document bookmark (kept as \"#name\"). */\n linkRelId?: string;\n linkAnchor?: string;\n /** w:footnoteReference w:id \u2014 this run is a footnote marker. mapToModel sets\n * the run text to the sequential note number and CharStyle.footnoteRef. */\n footnoteId?: string;\n}\n\n/** w:sdtPr \u2014 content-control properties, decoded faithfully (mapToModel turns\n * these into the model's SdtProps; runs inside the control carry the sdtId). */\nexport interface IRSdtProps {\n type: \"richText\" | \"plainText\" | \"checkbox\" | \"dropDown\" | \"comboBox\" | \"date\";\n alias?: string;\n tag?: string;\n /** w:showingPlcHdr \u2014 the content is currently the gray placeholder. */\n placeholder?: boolean;\n listItems?: { display: string; value: string }[];\n dateFormat?: string;\n checked?: boolean;\n lockContent?: boolean;\n lockControl?: boolean;\n}\n\nexport type IRInline =\n | { kind: \"run\"; text: string; props: IRRunProps; sdtId?: string }\n /** w:br / w:cr \u2014 soft line break (model has none; mapToModel splits the\n * paragraph). page=true for w:br w:type=\"page\" (\u2192 pageBreakBefore on the\n * follower); column=true for w:br w:type=\"column\" (\u2192 columnBreakBefore). */\n | { kind: \"break\"; page?: boolean; column?: boolean }\n /** w:drawing / w:pict \u2014 becomes a block-level ImageBlock (model has no inline images). */\n | {\n kind: \"image\";\n relId: string;\n widthEmu?: number;\n heightEmu?: number;\n anchored: boolean;\n /** For wp:anchor: square = text wraps around (maps to ImageBlock.wrap);\n * block = wrap mode the model can't express (none/topAndBottom). */\n anchorWrap?: \"square\" | \"block\";\n /** wp:positionH/wp:align when present. */\n anchorAlign?: \"left\" | \"right\" | \"center\";\n };\n\nexport interface IRParaProps {\n /** w:pStyle reference \u2014 recorded now, resolved when StyleResolver lands. */\n styleId?: string;\n align?: \"left\" | \"center\" | \"right\" | \"justify\";\n spaceBeforeTwips?: number;\n spaceAfterTwips?: number;\n /** Multiplier \u2014 only set when lineRule is \"auto\" (or absent). */\n lineHeight?: number;\n indentLeftTwips?: number;\n /** w:ind/@w:right|@w:end \u2014 right-edge indent. */\n indentRightTwips?: number;\n /** Negative = hanging indent (w:hanging). */\n indentFirstLineTwips?: number;\n /** w:keepNext \u2014 maps onto ParaStyle.keepWithNext. */\n keepWithNext?: boolean;\n /** w:keepLines \u2014 maps onto ParaStyle.keepLinesTogether. */\n keepLinesTogether?: boolean;\n /** w:pPr/w:tabs \u2014 raw tab stops (pos in twips; val/leader raw OOXML names). */\n tabStops?: { posTwips: number; val?: string; leader?: string }[];\n /** w:pageBreakBefore \u2014 this paragraph starts a new page. */\n pageBreakBefore?: boolean;\n /** w:outlineLvl \u2014 0-8. Heading styles set it; drives TOC `\\u`/heading detection. */\n outlineLevel?: number;\n /** w:numPr \u2014 list membership. numId \"0\" / null = explicitly NOT a list\n * (overrides an inherited list from the paragraph style). */\n list?: { numId: string; level: number } | null;\n /** w:pPr/w:sectPr \u2014 this paragraph ENDS a section. \"page\" (nextPage/odd/even)\n * implies the following content starts a new page; \"continuous\" doesn't. */\n sectionBreak?: \"page\" | \"continuous\";\n /** The ending section's page size (twips), when its w:sectPr declares pgSz.\n * A \"page\" break only forces a new page when this differs from the document's\n * page size \u2014 geometry-preserving breaks (footer/header switches, which these\n * generated reports emit by the dozen) flow instead of leaving half-empty\n * pages, matching Word. */\n sectionPgSize?: { w: number; h: number };\n /** The ending section's margins (twips) \u2014 for a SectionPatch when geometry differs. */\n sectionMarginTwips?: { top: number; right: number; bottom: number; left: number };\n /** The ending section's newspaper columns (count > 1). */\n sectionColumns?: { count: number; spaceTwips?: number };\n /** The ending section's w:pgNumType w:start (page-number restart). */\n sectionPageNumberStart?: number;\n /** The ending section's sectPr declares its own header/footer references \u2014\n * when such a section is flowed (not page-broken) its bands aren't applied. */\n sectionHasBands?: boolean;\n /** w:pPr/w:rPr \u2014 the paragraph MARK's run formatting. Word styles empty\n * paragraphs (and the \u00B6 itself) with this; we use it for empty-run style. */\n markRunProps?: IRRunProps;\n}\n\n/** A w:bookmarkStart / w:bookmarkEnd seen while walking a paragraph: its w:id\n * (pairs start\u2194end, possibly across paragraphs), w:name (start only), and the\n * UTF-16 offset within the paragraph text where it sits. */\nexport interface BookmarkMarker {\n id: string;\n name?: string;\n kind: \"start\" | \"end\";\n offset: number;\n}\n\nexport interface IRParagraph {\n kind: \"paragraph\";\n props: IRParaProps;\n inlines: IRInline[];\n /** w:bookmarkStart names anchored in this paragraph (TOC/cross-ref heuristics). */\n bookmarks?: string[];\n /** Start/end markers with offsets \u2014 resolved to model ranges in mapToModel. */\n bookmarkMarkers?: BookmarkMarker[];\n /** Custom-field result membership \u2014 mapped onto Block.fieldId. */\n fieldId?: string;\n}\n\n/** One raw border edge (w:top/w:left/\u2026 inside w:tblBorders or w:tcBorders).\n * Kept raw (OOXML units) until mapToModel collapses the cascade to px. */\nexport interface IRRawBorder {\n /** w:val \u2014 \"single\", \"double\", \"dashed\", \"nil\"/\"none\", \u2026 */\n val: string;\n /** w:sz \u2014 eighths of a point. */\n sizeEighthPt?: number;\n /** w:color \u2014 hex without '#', or \"auto\". */\n color?: string;\n}\n\nexport interface IRBorders {\n top?: IRRawBorder;\n left?: IRRawBorder;\n bottom?: IRRawBorder;\n right?: IRRawBorder;\n /** Interior horizontal/vertical edges (w:tblBorders only). */\n insideH?: IRRawBorder;\n insideV?: IRRawBorder;\n}\n\n/** Cell margins in twips, per side. Any side may be absent (inherits the next\n * level of the cascade: cell \u2192 table \u2192 Word default). w:tcMar / w:tblCellMar. */\nexport interface IRCellMargin {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n}\n\nexport interface IRTableCell {\n /** Full block content: paragraphs, images (inside paragraphs), nested tables. */\n blocks: IRBlock[];\n /** w:gridSpan \u2014 columns this cell covers (1 = normal). Maps to TableCell.colSpan. */\n gridSpan: number;\n /** w:vMerge continuation \u2014 this cell is swallowed by the cell above. */\n vMergeContinue: boolean;\n /** w:tcPr/w:tcBorders. */\n borders?: IRBorders;\n /** A w:tcBorders element is present \u2014 even if empty (all edges nil/absent), the\n * author explicitly chose this cell's borders, so it must NOT fall back to the\n * renderer's default grid. */\n bordersSpecified?: boolean;\n /** w:tcPr/w:shd \u2192 CSS fill. */\n shd?: string;\n /** w:tcPr/w:tcMar \u2014 per-side inner padding override (twips). */\n marginTwips?: IRCellMargin;\n}\n\nexport interface IRTableRow {\n cells: IRTableCell[];\n}\n\nexport interface IRTable {\n kind: \"table\";\n rows: IRTableRow[];\n /** w:tblGrid/w:gridCol widths \u2014 become TableBlock.colFractions. */\n colWidthsTwips?: number[];\n /** w:tblPr/w:tblStyle \u2014 table style id (its borders/shd are the cascade base). */\n styleId?: string;\n /** w:tblPr/w:tblBorders. */\n borders?: IRBorders;\n /** A w:tblBorders element is present \u2014 even if empty, the table explicitly\n * declares its borders (e.g. \"no borders\"), suppressing the default grid. */\n bordersSpecified?: boolean;\n /** w:tblPr/w:shd \u2192 CSS fill applied to every cell unless overridden. */\n shd?: string;\n /** w:tblPr/w:tblCellMar \u2014 table-wide cell-margin default (twips), the base each\n * cell's own w:tcMar overrides per side. */\n cellMarginTwips?: IRCellMargin;\n /** Custom-field result membership \u2014 mapped onto Block.fieldId. */\n fieldId?: string;\n}\n\nexport type IRBlock = IRParagraph | IRTable;\n\n// ---------------------------------------------------------------------------\n// Numbering (numbering.xml) \u2014 raw decode; mapToModel converts to model lists.\n\nexport interface IRListLevel {\n /** Raw w:numFmt w:val (\"decimal\", \"bullet\", \"lowerRoman\", \"none\", \u2026). */\n format: string;\n /** Raw w:lvlText w:val \u2014 \"%1.\" pattern, or the bullet glyph for bullets. */\n lvlText: string;\n start: number;\n indentLeftTwips?: number;\n hangingTwips?: number;\n /** w:lvl/w:rPr \u2014 marker glyph styling (esp. the bullet font). */\n markerRunProps?: IRRunProps;\n}\n\nexport interface IRListDefinition {\n /** numId (the id space paragraphs reference via w:numPr/w:numId). */\n id: string;\n levels: IRListLevel[];\n}\n\nexport interface IRSection {\n pageWidthTwips?: number;\n pageHeightTwips?: number;\n marginTwips?: { top: number; right: number; bottom: number; left: number };\n /** w:pgMar/@w:header and @w:footer \u2014 band distances from the page edges (twips). */\n headerDistTwips?: number;\n footerDistTwips?: number;\n /** w:headerReference / w:footerReference by type \u2014 r:id into the document\n * part's rels; the referenced parts are parsed separately. Variants are\n * gated downstream (first by w:titlePg, even by settings evenAndOdd). */\n headerRefs?: BandRefs;\n footerRefs?: BandRefs;\n /** w:titlePg \u2014 this section has a distinct first-page header/footer. */\n titlePg?: boolean;\n /** w:cols \u2014 newspaper columns (only count > 1 is meaningful). */\n columns?: { count: number; spaceTwips?: number };\n /** w:pgNumType w:start \u2014 restart page numbering at this value. */\n pageNumberStart?: number;\n}\n\n/** Header/footer relationship ids by Word variant. */\nexport interface BandRefs {\n default?: string;\n first?: string;\n even?: string;\n}\n\nexport interface IRDocument {\n blocks: IRBlock[];\n section: IRSection | null;\n /** Content controls found in the body (header/footer parsing extends it). */\n sdts: Record<string, IRSdtProps>;\n /** Custom (non-built-in) complex fields captured in the body, keyed by id. */\n fields?: Record<string, FieldDef>;\n}\n", "function t(t){return t.replace(/&(#x[0-9a-fA-F]+|#\\d+|amp|lt|gt|quot|apos);/g,function(t,r){if(\"amp\"===r)return\"&\";if(\"lt\"===r)return\"<\";if(\"gt\"===r)return\">\";if(\"quot\"===r)return'\"';if(\"apos\"===r)return\"'\";if(\"#\"===r[0]){var e=\"x\"===r[1]||\"X\"===r[1],a=parseInt(r.slice(e?2:1),e?16:10);if(!Number.isNaN(a)&&a>=0&&a<=1114111)try{return String.fromCodePoint(a)}catch(r){return t}}return t})}function r(t){return t.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\")}function e(t){return t.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\")}function a(r,e){var a=(e=e||{}).pos||0,i=!!e.keepComments,c=!!e.keepWhitespace,f=!!e.decodeEntities,s=\"<\".charCodeAt(0),u=\">\".charCodeAt(0),h=\"-\".charCodeAt(0),l=\"/\".charCodeAt(0),d=\"!\".charCodeAt(0),g=\"?\".charCodeAt(0),A=\"'\".charCodeAt(0),p='\"'.charCodeAt(0),C=\"=\".charCodeAt(0),v=\"[\".charCodeAt(0),y=\"]\".charCodeAt(0),m=\"?\".charCodeAt(0);function b(t){for(var e=[];r[a];)if(r.charCodeAt(a)==s){if(r.charCodeAt(a+1)===l){var n=a+2;if(a=r.indexOf(\">\",a),-1==r.substring(n,a).indexOf(t)){var o=r.substring(0,a).split(\"\\n\");throw new Error(\"Unexpected close tag\\nLine: \"+(o.length-1)+\"\\nColumn: \"+(o[o.length-1].length+1)+\"\\nChar: \"+r[a])}return a+1&&(a+=1),e}if(r.charCodeAt(a+1)===d){if(r.charCodeAt(a+2)==h){const t=a;for(;-1!==a&&(r.charCodeAt(a)!==u||r.charCodeAt(a-1)!=h||r.charCodeAt(a-2)!=h||-1==a);)a=r.indexOf(\">\",a+1);-1===a&&(a=r.length),i&&e.push(r.substring(t,a+1))}else{if(r.charCodeAt(a+2)===v&&r.charCodeAt(a+8)===v&&\"cdata\"===r.substr(a+3,5).toLowerCase()){var f=r.indexOf(\"]]>\",a);-1==f?(e.push(r.substr(a+9)),a=r.length):(e.push(r.substring(a+9,f)),a=f+3);continue}{const t=a+1;a+=2;for(var g=!1;(r.charCodeAt(a)!==u||!0===g)&&r[a];)r.charCodeAt(a)===v?g=!0:!0===g&&r.charCodeAt(a)===y&&(g=!1),a++;e.push(r.substring(t,a))}}a++;continue}var A=k();e.push(A)}else{var p=N();if(c)p.length>0&&e.push(p);else{var C=p.trim();C.length>0&&e.push(C)}a++}return e}function N(){var e=a;-2===(a=r.indexOf(\"<\",a)-1)&&(a=r.length);var n=r.slice(e,a+1);return f?t(n):n}var x=\"\\r\\n\\t>/= \";function O(){for(var t=a;-1===x.indexOf(r[a])&&r[a];)a++;return r.slice(t,a)}var j,E=e.selfClosingTags||e.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\",\"hr\"];function k(){a++;const e=O(),n=\"?\"===e[0],i=a,o={};let c=[];for(;r[a]&&r.charCodeAt(a)!==u&&(!n||r.charCodeAt(a)!==g||r.charCodeAt(a+1)!==u);){var s=r.charCodeAt(a);if(s>64&&s<91||s>96&&s<123){for(var h=O(),d=null;32===r.charCodeAt(a)||9===r.charCodeAt(a)||10===r.charCodeAt(a)||13===r.charCodeAt(a);)a++;if(r.charCodeAt(a)===C){for(a++;32===r.charCodeAt(a)||9===r.charCodeAt(a)||10===r.charCodeAt(a)||13===r.charCodeAt(a);)a++;var v=r.charCodeAt(a);if(v===A||v===p){if(d=w(),-1===a)return{tagName:e,attributes:o,children:c}}else if(v&&v!==u){for(var y=a;r[a]&&-1===x.indexOf(r[a]);)a++;d=r.slice(y,a),f&&(d=t(d))}}o[h]=d}else a++}if(n){var N=r.slice(i,a).trim();return N.length>0&&0===Object.keys(o).length&&(c=[N]),r.charCodeAt(a)===g&&r.charCodeAt(a+1)===u?a+=2:r.charCodeAt(a)===u&&(a+=1),{tagName:e,attributes:o,children:c}}if(r.charCodeAt(a-1)!==l&&r.charCodeAt(a-1)!==m)if(\"script\"==e){var j=a+1;a=r.indexOf(\"<\\/script>\",a),c=[r.slice(j,a)],a+=9}else if(\"style\"==e){j=a+1;a=r.indexOf(\"</style>\",a),c=[r.slice(j,a)],a+=8}else-1===E.indexOf(e)?(a++,c=b(e)):a++;else a++;return{tagName:e,attributes:o,children:c}}function w(){var e=r[a],n=a+1;a=r.indexOf(e,n);var i=r.slice(n,a);return f?t(i):i}function V(){if(!e||!e.attrName||!e.attrValue)return-1;var t=new RegExp(\"\\\\s\"+e.attrName+\"\\\\s*=['\\\"]\"+e.attrValue+\"['\\\"]\").exec(r);return t?t.index:-1}if(void 0!==e.attrValue)for(e.attrName=e.attrName||\"id\",j=[];-1!==(a=V());)-1!==(a=r.lastIndexOf(\"<\",a))&&j.push(k()),r=r.substr(a),a=0;else j=e.parseNode?k():b(\"\");if(e.filter&&Array.isArray(j)&&(j=o(j,e.filter)),e.simplify){return n(Array.isArray(j)?j:[j])}return e.setPos&&\"object\"==typeof j&&!Array.isArray(j)&&(j.pos=a),j}function n(t){if(\"string\"==typeof t)return n(a(t));if(!Array.isArray(t))throw new TypeError(\"simplify() expects parsed node array or XML string\");var r={};if(!t.length)return\"\";if(1===t.length&&\"string\"==typeof t[0])return t[0];for(var e in t.forEach(function(t){if(\"object\"==typeof t){r[t.tagName]||(r[t.tagName]=[]);var e=n(t.children);r[t.tagName].push(e),Object.keys(t.attributes).length&&\"object\"==typeof e&&!Array.isArray(e)&&(e._attributes=t.attributes)}}),r)1==r[e].length&&(r[e]=r[e][0]);return r}function i(t,r={}){var e={};return t.length?1===t.length&&\"string\"==typeof t[0]?Object.keys(r).length?{_attributes:r,value:t[0]}:t[0]:(t.forEach(function(t){if(\"object\"==typeof t){e[t.tagName]||(e[t.tagName]=[]);var r=i(t.children||[],t.attributes);e[t.tagName].push(r),Object.keys(t.attributes).length&&\"object\"==typeof r&&!Array.isArray(r)&&(r._attributes=t.attributes)}}),e):e}function o(t,r,e=0,a=\"\"){var n=[];return t.forEach(function(t,i){if(\"object\"==typeof t&&r(t,i,e,a)&&n.push(t),\"object\"==typeof t&&t.children){var c=o(t.children,r,e+1,(a?a+\".\":\"\")+i+\".\"+t.tagName);n=n.concat(c)}}),n}function c(t,a){if(!t)return\"\";var n=!!(a=a||{}).encodeEntities,i=\"\";function o(t){if(t)for(var e=0;e<t.length;e++){var a=t[e];if(\"string\"==typeof a){var o=a.trim();i+=n?r(o):o}else a&&c(a)}}function c(t){if(t){for(var r in i+=\"<\"+t.tagName,t.attributes){var a=t.attributes[r];null===a?i+=\" \"+r:n?i+=\" \"+r+'=\"'+e(a.trim())+'\"':-1===a.indexOf('\"')?i+=\" \"+r+'=\"'+a.trim()+'\"':i+=\" \"+r+\"='\"+a.trim()+\"'\"}if(\"?\"!==t.tagName[0])i+=\">\",o(t.children),i+=\"</\"+t.tagName+\">\";else{if(t.children&&t.children.length){var c=t.children.filter(function(t){return\"string\"==typeof t}).join(\" \").trim();c.length>0&&(i+=\" \"+c)}i+=\"?>\"}}}return o(Array.isArray(t)?t:[t]),i}function f(t){if(Array.isArray(t)){var r=\"\";return t.forEach(function(t){r=(r+=\" \"+f(t)).trim()}),r}return\"object\"==typeof t&&null!==t?f(t.children):\" \"+t}function s(t,r,e){var i=a(t,{attrValue:r});return e?n(i):i[0]}function u(t,r,e){const i=a(t,{attrName:\"class\",attrValue:\"[a-zA-Z0-9- ]*\"+r+\"[a-zA-Z0-9- ]*\"});return e?n(i):i}function h(t){return\"string\"==typeof t}function l(t){return\"object\"==typeof t&&null!==t&&\"tagName\"in t}export{o as filter,s as getElementById,u as getElementsByClassName,l as isElementNode,h as isTextNode,a as parse,n as simplify,i as simplifyLostLess,c as stringify,f as toContentString};\n", "// txml helpers. DOMParser is window-only (not available in workers), so we use\n// txml \u2014 a tiny pure-JS parser that returns an ORDERED node tree. Order matters:\n// in document.xml, run order IS the text.\n//\n// OOXML namespace handling: prefixes (w:, a:, wp:) are technically remappable,\n// but Word always emits the conventional ones, so we match qualified names\n// directly \u2014 the same pragmatic choice docx-preview and mammoth make.\n\nimport { isElementNode, parse, type TNode } from \"txml/txml\";\nimport { ImportError } from \"./types\";\n\nexport type XmlNode = TNode;\n\n/** Parse an XML part. keepWhitespace matters: a run whose text is a single\n * space (`<w:t xml:space=\"preserve\"> </w:t>`) must not be dropped. */\nexport function parseXml(text: string, partName: string): XmlNode[] {\n try {\n return parse(text, { keepWhitespace: true, decodeEntities: true }).filter(isElementNode);\n } catch (e) {\n throw new ImportError(\n \"MALFORMED_XML\",\n `Failed to parse ${partName}: ${e instanceof Error ? e.message : String(e)}`,\n );\n }\n}\n\n/** Top-level element by qualified name (skips the XML declaration / PIs). */\nexport function rootEl(nodes: XmlNode[], tagName: string): XmlNode | undefined {\n return nodes.find((n) => n.tagName === tagName);\n}\n\n/** Element children only (text nodes filtered out). */\nexport function children(node: XmlNode): XmlNode[] {\n return node.children.filter(isElementNode);\n}\n\n/** First child element with the given qualified name. */\nexport function el(node: XmlNode, tagName: string): XmlNode | undefined {\n return node.children.find((c): c is XmlNode => isElementNode(c) && c.tagName === tagName);\n}\n\n/** All child elements with the given qualified name. */\nexport function els(node: XmlNode, tagName: string): XmlNode[] {\n return node.children.filter((c): c is XmlNode => isElementNode(c) && c.tagName === tagName);\n}\n\n/** Attribute value by qualified name; valueless attributes read as \"\". */\nexport function attr(node: XmlNode, name: string): string | undefined {\n const v = node.attributes[name];\n return v === undefined ? undefined : (v ?? \"\");\n}\n\n/** Depth-first search for a descendant element. Used where the exact nesting\n * is deep and producer-dependent (e.g. a:blip inside w:drawing). */\nexport function findDeep(node: XmlNode, tagName: string): XmlNode | undefined {\n for (const c of node.children) {\n if (!isElementNode(c)) continue;\n if (c.tagName === tagName) return c;\n const found = findDeep(c, tagName);\n if (found) return found;\n }\n return undefined;\n}\n\n/** Concatenated text content (direct string children \u2014 w:t never nests). */\nexport function textOf(node: XmlNode): string {\n let out = \"\";\n for (const c of node.children) if (typeof c === \"string\") out += c;\n return out;\n}\n\n/** Shorthand for the ubiquitous `<w:x w:val=\"\u2026\"/>` child-element pattern. */\nexport function val(node: XmlNode, tagName: string): string | undefined {\n const child = el(node, tagName);\n return child ? attr(child, \"w:val\") : undefined;\n}\n\n/** OOXML on/off property: `<w:b/>` is on; w:val of 0/false/none/off is off. */\nexport function onOff(node: XmlNode | undefined): boolean | undefined {\n if (!node) return undefined;\n const v = attr(node, \"w:val\");\n if (v === undefined) return true;\n return ![\"0\", \"false\", \"none\", \"off\"].includes(v);\n}\n\n/** Numeric attribute (OOXML writes plain decimal integers). */\nexport function numAttr(node: XmlNode | undefined, name: string): number | undefined {\n if (!node) return undefined;\n const v = attr(node, name);\n if (v === undefined) return undefined;\n const n = Number(v);\n return Number.isFinite(n) ? n : undefined;\n}\n", "// [Content_Types].xml \u2192 locate the main document part. Usually\n// \"word/document.xml\", but the spec allows any part name (and macro-enabled\n// .docm uses a different content type), so don't hardcode.\n\nimport { attr, children, parseXml, rootEl } from \"./xml\";\n\nconst MAIN_CONTENT_TYPES = new Set([\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"application/vnd.ms-word.document.macroEnabled.main+xml\",\n]);\n\nexport function findMainDocumentPart(contentTypesXml: string): string | undefined {\n const types = rootEl(parseXml(contentTypesXml, \"[Content_Types].xml\"), \"Types\");\n if (!types) return undefined;\n for (const child of children(types)) {\n if (child.tagName !== \"Override\") continue;\n const ct = attr(child, \"ContentType\");\n const partName = attr(child, \"PartName\");\n if (ct && partName && MAIN_CONTENT_TYPES.has(ct)) {\n return partName.replace(/^\\//, \"\"); // OPC part names are /-rooted; zip entries aren't\n }\n }\n return undefined;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAaO,IAAM,cAAN,cAA0B,MAAM;AAAA,EAC5B;AAAA,EACT,YAAY,MAAuB,SAAiB;AAClD,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AACF;AASO,IAAM,cAAN,MAAkB;AAAA,EACd,OAAwB,CAAC;AAAA,EACjB,OAAO,oBAAI,IAAY;AAAA,EACxC,IAAI,MAAc,SAAuB;AACvC,QAAI,KAAK,KAAK,IAAI,IAAI,EAAG;AACzB,SAAK,KAAK,IAAI,IAAI;AAClB,SAAK,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAAA,EAClC;AACF;;;ACrCA,SAAS,EAAEA,IAAE;AAAC,SAAOA,GAAE,QAAQ,gDAA+C,SAASA,IAAE,GAAE;AAAC,QAAG,UAAQ,EAAE,QAAM;AAAI,QAAG,SAAO,EAAE,QAAM;AAAI,QAAG,SAAO,EAAE,QAAM;AAAI,QAAG,WAAS,EAAE,QAAM;AAAI,QAAG,WAAS,EAAE,QAAM;AAAI,QAAG,QAAM,EAAE,CAAC,GAAE;AAAC,UAAI,IAAE,QAAM,EAAE,CAAC,KAAG,QAAM,EAAE,CAAC,GAAEC,KAAE,SAAS,EAAE,MAAM,IAAE,IAAE,CAAC,GAAE,IAAE,KAAG,EAAE;AAAE,UAAG,CAAC,OAAO,MAAMA,EAAC,KAA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