reamkit 1.1.0 → 1.2.0
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 +9 -4
- package/dist/esm/{layout → core}/arc-to-bezier.d.ts +1 -1
- package/dist/esm/{layout → core}/arc-to-bezier.js +2 -2
- package/dist/esm/core/converter/project.js +2 -0
- package/dist/esm/core/document-model/index.d.ts +1 -1
- package/dist/esm/core/document-model/types.d.ts +58 -0
- package/dist/esm/{layout → core/drawingml}/chart-geometry.d.ts +1 -1
- package/dist/esm/{layout → core/drawingml}/preset-geometry.d.ts +2 -2
- package/dist/esm/{layout → core/drawingml}/preset-geometry.js +3 -3
- package/dist/esm/core/drawingml/shape-render.d.ts +8 -0
- package/dist/esm/core/drawingml/shape-render.js +71 -0
- package/dist/esm/core/ir/features.d.ts +1 -0
- package/dist/esm/core/ir/features.js +1 -0
- package/dist/esm/core/ir/flow.d.ts +3 -0
- package/dist/esm/core/links.d.ts +6 -0
- package/dist/esm/core/links.js +19 -0
- package/dist/esm/core/numbering/apply.js +3 -1
- package/dist/esm/core/style-cascade/index.d.ts +1 -0
- package/dist/esm/core/style-cascade/index.js +1 -0
- package/dist/esm/core/style-cascade/table.d.ts +2 -0
- package/dist/esm/core/style-cascade/table.js +161 -0
- package/dist/esm/core/vector.d.ts +2 -0
- package/dist/esm/core/vector.js +19 -1
- package/dist/esm/html/html-writer.js +188 -16
- package/dist/esm/layout/page-doc.d.ts +3 -0
- package/dist/esm/layout/styled-layout.d.ts +19 -3
- package/dist/esm/layout/styled-layout.js +533 -197
- package/dist/esm/pdf/struct-tree.d.ts +7 -1
- package/dist/esm/pdf/struct-tree.js +22 -6
- package/dist/esm/pdf/styled-page-emitter.d.ts +1 -1
- package/dist/esm/pdf/styled-page-emitter.js +161 -29
- package/dist/esm/pdf/xmp.d.ts +1 -0
- package/dist/esm/pdf/xmp.js +4 -0
- package/dist/esm/svg/svg-writer.js +2 -6
- package/dist/esm/word/document-parser.d.ts +3 -0
- package/dist/esm/word/document-parser.js +210 -23
- package/dist/esm/word/docx-reader.js +30 -4
- package/dist/esm/word/drawing-parser.d.ts +4 -1
- package/dist/esm/word/drawing-parser.js +53 -2
- package/dist/esm/word/index.d.ts +2 -2
- package/dist/esm/word/styles-parser.js +134 -1
- package/dist/esm/word/table-parser.js +35 -0
- package/package.json +1 -1
- /package/dist/esm/{layout → core/drawingml}/chart-geometry.js +0 -0
|
@@ -80,6 +80,16 @@ function resolveMergeRoles(rows) {
|
|
|
80
80
|
function parseTableProperties(tblPr) {
|
|
81
81
|
if (!tblPr) return {};
|
|
82
82
|
const out = {};
|
|
83
|
+
const tblStyle = poFirstChild(tblPr, "w:tblStyle");
|
|
84
|
+
if (tblStyle) {
|
|
85
|
+
const id = poVal(tblStyle);
|
|
86
|
+
if (id) out.styleId = id;
|
|
87
|
+
}
|
|
88
|
+
const tblLook = poFirstChild(tblPr, "w:tblLook");
|
|
89
|
+
if (tblLook) {
|
|
90
|
+
const look = parseTableLook(tblLook);
|
|
91
|
+
if (look) out.look = look;
|
|
92
|
+
}
|
|
83
93
|
const tblW = poFirstChild(tblPr, "w:tblW");
|
|
84
94
|
if (tblW) {
|
|
85
95
|
const w = poIntAttr(tblW, "w");
|
|
@@ -99,6 +109,31 @@ function parseTableProperties(tblPr) {
|
|
|
99
109
|
if (margins) out.defaultCellMargins = margins;
|
|
100
110
|
return out;
|
|
101
111
|
}
|
|
112
|
+
function parseTableLook(node) {
|
|
113
|
+
const flag = (name, bit) => {
|
|
114
|
+
const attr = poAttr(node, name);
|
|
115
|
+
if (attr !== void 0) return attr === "1" || attr === "true";
|
|
116
|
+
const valRaw = poAttr(node, "val");
|
|
117
|
+
if (valRaw === void 0) return void 0;
|
|
118
|
+
const mask = parseInt(valRaw, 16);
|
|
119
|
+
return Number.isFinite(mask) ? (mask & bit) !== 0 : void 0;
|
|
120
|
+
};
|
|
121
|
+
const firstRow = flag("firstRow", 32);
|
|
122
|
+
const lastRow = flag("lastRow", 64);
|
|
123
|
+
const firstColumn = flag("firstColumn", 128);
|
|
124
|
+
const lastColumn = flag("lastColumn", 256);
|
|
125
|
+
const noHBand = flag("noHBand", 512);
|
|
126
|
+
const noVBand = flag("noVBand", 1024);
|
|
127
|
+
const out = {
|
|
128
|
+
...firstRow !== void 0 ? { firstRow } : {},
|
|
129
|
+
...lastRow !== void 0 ? { lastRow } : {},
|
|
130
|
+
...firstColumn !== void 0 ? { firstColumn } : {},
|
|
131
|
+
...lastColumn !== void 0 ? { lastColumn } : {},
|
|
132
|
+
...noHBand !== void 0 ? { noHBand } : {},
|
|
133
|
+
...noVBand !== void 0 ? { noVBand } : {}
|
|
134
|
+
};
|
|
135
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
136
|
+
}
|
|
102
137
|
function parseTableGrid(tblGrid) {
|
|
103
138
|
if (!tblGrid) return [];
|
|
104
139
|
const cols = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reamkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Ream — DOCX/XLSX to PDF (and SVG), built from scratch on the ECMA-376 and ISO 32000 specifications. Parse once, convert anywhere.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alex Krassavin <info@reamkit.dev>",
|
|
File without changes
|