@otomate/css-docx 0.0.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/dist/convert.d.ts +12 -0
- package/dist/convert.d.ts.map +1 -0
- package/dist/convert.js +160 -0
- package/dist/convert.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/serialize.d.ts +8 -0
- package/dist/serialize.d.ts.map +1 -0
- package/dist/serialize.js +81 -0
- package/dist/serialize.js.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +18 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OoxmlRunProps, OoxmlParaProps } from "./types.js";
|
|
2
|
+
/** Parse a CSS color value to "RRGGBB" (no hash). Returns undefined if unparseable. */
|
|
3
|
+
export declare function parseColor(value: string): string | undefined;
|
|
4
|
+
/** Parse a CSS length to twips. Returns undefined if unparseable. */
|
|
5
|
+
export declare function parseLengthTwips(value: string): number | undefined;
|
|
6
|
+
/** Parse a CSS length to half-points (for font-size). */
|
|
7
|
+
export declare function parseLengthHalfPts(value: string): number | undefined;
|
|
8
|
+
/** Convert CSS declarations to OOXML run properties. */
|
|
9
|
+
export declare function cssToRunProps(decls: Record<string, string>): OoxmlRunProps;
|
|
10
|
+
/** Convert CSS declarations to OOXML paragraph properties. */
|
|
11
|
+
export declare function cssToParaProps(decls: Record<string, string>): OoxmlParaProps;
|
|
12
|
+
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAa,MAAM,YAAY,CAAC;AAY3E,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAkB5D;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAalE;AAED,yDAAyD;AACzD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUpE;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa,CAiC1E;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,cAAc,CA8B5E"}
|
package/dist/convert.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// 1pt = 20 twips, 1pt = 2 half-points, 1px ≈ 0.75pt, 1in = 1440 twips, 1cm = 567 twips
|
|
2
|
+
const NAMED_COLORS = {
|
|
3
|
+
black: "000000", white: "FFFFFF", red: "FF0000", green: "008000",
|
|
4
|
+
blue: "0000FF", yellow: "FFFF00", gray: "808080", grey: "808080",
|
|
5
|
+
orange: "FFA500", purple: "800080", navy: "000080", teal: "008080",
|
|
6
|
+
maroon: "800000", silver: "C0C0C0", olive: "808000", aqua: "00FFFF",
|
|
7
|
+
fuchsia: "FF00FF", lime: "00FF00",
|
|
8
|
+
};
|
|
9
|
+
/** Parse a CSS color value to "RRGGBB" (no hash). Returns undefined if unparseable. */
|
|
10
|
+
export function parseColor(value) {
|
|
11
|
+
const v = value.trim().toLowerCase();
|
|
12
|
+
if (NAMED_COLORS[v])
|
|
13
|
+
return NAMED_COLORS[v];
|
|
14
|
+
// #rgb or #rrggbb
|
|
15
|
+
const hex = v.match(/^#([0-9a-f]{3,8})$/);
|
|
16
|
+
if (hex) {
|
|
17
|
+
const h = hex[1];
|
|
18
|
+
if (h.length === 3)
|
|
19
|
+
return h[0] + h[0] + h[1] + h[1] + h[2] + h[2];
|
|
20
|
+
if (h.length === 4)
|
|
21
|
+
return h[0] + h[0] + h[1] + h[1] + h[2] + h[2]; // #rgba → drop alpha
|
|
22
|
+
if (h.length === 6)
|
|
23
|
+
return h;
|
|
24
|
+
if (h.length === 8)
|
|
25
|
+
return h.slice(0, 6); // #rrggbbaa → drop alpha
|
|
26
|
+
}
|
|
27
|
+
// rgb(r, g, b)
|
|
28
|
+
const rgb = v.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
29
|
+
if (rgb) {
|
|
30
|
+
return [rgb[1], rgb[2], rgb[3]].map(n => Number(n).toString(16).padStart(2, "0")).join("");
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
/** Parse a CSS length to twips. Returns undefined if unparseable. */
|
|
35
|
+
export function parseLengthTwips(value) {
|
|
36
|
+
const m = value.trim().match(/^(-?[\d.]+)(px|pt|em|rem|cm|mm|in|%)$/);
|
|
37
|
+
if (!m)
|
|
38
|
+
return undefined;
|
|
39
|
+
const n = parseFloat(m[1]);
|
|
40
|
+
switch (m[2]) {
|
|
41
|
+
case "pt": return Math.round(n * 20);
|
|
42
|
+
case "px": return Math.round(n * 0.75 * 20);
|
|
43
|
+
case "in": return Math.round(n * 1440);
|
|
44
|
+
case "cm": return Math.round(n * 567);
|
|
45
|
+
case "mm": return Math.round(n * 56.7);
|
|
46
|
+
case "em":
|
|
47
|
+
case "rem": return Math.round(n * 12 * 20); // assume 12pt base
|
|
48
|
+
default: return undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Parse a CSS length to half-points (for font-size). */
|
|
52
|
+
export function parseLengthHalfPts(value) {
|
|
53
|
+
const m = value.trim().match(/^(-?[\d.]+)(px|pt|em|rem)$/);
|
|
54
|
+
if (!m)
|
|
55
|
+
return undefined;
|
|
56
|
+
const n = parseFloat(m[1]);
|
|
57
|
+
switch (m[2]) {
|
|
58
|
+
case "pt": return Math.round(n * 2);
|
|
59
|
+
case "px": return Math.round(n * 0.75 * 2);
|
|
60
|
+
case "em":
|
|
61
|
+
case "rem": return Math.round(n * 12 * 2);
|
|
62
|
+
default: return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** Convert CSS declarations to OOXML run properties. */
|
|
66
|
+
export function cssToRunProps(decls) {
|
|
67
|
+
const props = {};
|
|
68
|
+
if (decls["font-family"]) {
|
|
69
|
+
const font = decls["font-family"].replace(/['"]/g, "").split(",")[0].trim();
|
|
70
|
+
props.rFonts = { ascii: font, hAnsi: font };
|
|
71
|
+
}
|
|
72
|
+
if (decls["font-size"]) {
|
|
73
|
+
const sz = parseLengthHalfPts(decls["font-size"]);
|
|
74
|
+
if (sz)
|
|
75
|
+
props.sz = sz;
|
|
76
|
+
}
|
|
77
|
+
if (decls["font-weight"]) {
|
|
78
|
+
const fw = decls["font-weight"];
|
|
79
|
+
if (fw === "bold" || fw === "bolder" || Number(fw) >= 700)
|
|
80
|
+
props.b = true;
|
|
81
|
+
}
|
|
82
|
+
if (decls["font-style"]) {
|
|
83
|
+
if (decls["font-style"] === "italic" || decls["font-style"] === "oblique")
|
|
84
|
+
props.i = true;
|
|
85
|
+
}
|
|
86
|
+
if (decls["color"]) {
|
|
87
|
+
const c = parseColor(decls["color"]);
|
|
88
|
+
if (c)
|
|
89
|
+
props.color = c;
|
|
90
|
+
}
|
|
91
|
+
if (decls["background-color"]) {
|
|
92
|
+
const c = parseColor(decls["background-color"]);
|
|
93
|
+
if (c)
|
|
94
|
+
props.shd = c;
|
|
95
|
+
}
|
|
96
|
+
if (decls["text-decoration"]) {
|
|
97
|
+
const td = decls["text-decoration"];
|
|
98
|
+
if (td.includes("underline"))
|
|
99
|
+
props.u = "single";
|
|
100
|
+
if (td.includes("line-through"))
|
|
101
|
+
props.strike = true;
|
|
102
|
+
}
|
|
103
|
+
return props;
|
|
104
|
+
}
|
|
105
|
+
/** Convert CSS declarations to OOXML paragraph properties. */
|
|
106
|
+
export function cssToParaProps(decls) {
|
|
107
|
+
const props = {};
|
|
108
|
+
if (decls["text-align"]) {
|
|
109
|
+
const a = decls["text-align"];
|
|
110
|
+
if (a === "left" || a === "center" || a === "right")
|
|
111
|
+
props.jc = a;
|
|
112
|
+
if (a === "justify")
|
|
113
|
+
props.jc = "both";
|
|
114
|
+
}
|
|
115
|
+
const spacing = {};
|
|
116
|
+
if (decls["margin-top"]) {
|
|
117
|
+
const v = parseLengthTwips(decls["margin-top"]);
|
|
118
|
+
if (v)
|
|
119
|
+
spacing.before = v;
|
|
120
|
+
}
|
|
121
|
+
if (decls["margin-bottom"]) {
|
|
122
|
+
const v = parseLengthTwips(decls["margin-bottom"]);
|
|
123
|
+
if (v)
|
|
124
|
+
spacing.after = v;
|
|
125
|
+
}
|
|
126
|
+
if (decls["line-height"]) {
|
|
127
|
+
const m = decls["line-height"].match(/^([\d.]+)(px|pt)?$/);
|
|
128
|
+
if (m) {
|
|
129
|
+
const n = parseFloat(m[1]);
|
|
130
|
+
if (m[2] === "pt")
|
|
131
|
+
spacing.line = Math.round(n * 20);
|
|
132
|
+
else if (m[2] === "px")
|
|
133
|
+
spacing.line = Math.round(n * 0.75 * 20);
|
|
134
|
+
else
|
|
135
|
+
spacing.line = Math.round(n * 240); // unitless = proportion of 12pt (240 twips)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (Object.keys(spacing).length > 0)
|
|
139
|
+
props.spacing = spacing;
|
|
140
|
+
const ind = {};
|
|
141
|
+
if (decls["margin-left"]) {
|
|
142
|
+
const v = parseLengthTwips(decls["margin-left"]);
|
|
143
|
+
if (v)
|
|
144
|
+
ind.left = v;
|
|
145
|
+
}
|
|
146
|
+
if (decls["margin-right"]) {
|
|
147
|
+
const v = parseLengthTwips(decls["margin-right"]);
|
|
148
|
+
if (v)
|
|
149
|
+
ind.right = v;
|
|
150
|
+
}
|
|
151
|
+
if (decls["text-indent"]) {
|
|
152
|
+
const v = parseLengthTwips(decls["text-indent"]);
|
|
153
|
+
if (v)
|
|
154
|
+
ind.firstLine = v;
|
|
155
|
+
}
|
|
156
|
+
if (Object.keys(ind).length > 0)
|
|
157
|
+
props.ind = ind;
|
|
158
|
+
return props;
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=convert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAEA,uFAAuF;AAEvF,MAAM,YAAY,GAA2B;IAC3C,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ;IAChE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;IAChE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;IAClE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;IACnE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;CAClC,CAAC;AAEF,uFAAuF;AACvF,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,YAAY,CAAC,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;IAC5C,kBAAkB;IAClB,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC1C,IAAI,GAAG,EAAE,CAAC;QACR,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC,C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Aa,CAAC,EAAE,CAAC;QAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAAC,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC;IAAC,CAAC;IACpG,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;QAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;QAAC,IAAI,CAAC;YAAE,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAAC,CAAC;IACvG,IAAI,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;QAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAAC,IAAI,CAAC;YAAE,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC;IAAC,CAAC;IACzG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;IAEjD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OoxmlRunProps, OoxmlParaProps } from "./types.js";
|
|
2
|
+
/** Build w:rPr XML fragment from run properties. */
|
|
3
|
+
export declare function runPropsToXml(props: OoxmlRunProps): string;
|
|
4
|
+
/** Build w:pPr XML fragment from paragraph properties. */
|
|
5
|
+
export declare function paraPropsToXml(props: OoxmlParaProps): string;
|
|
6
|
+
/** Build a complete w:style element for styles.xml. */
|
|
7
|
+
export declare function buildStyleElement(styleId: string, styleName: string, type: "paragraph" | "character", runProps?: OoxmlRunProps, paraProps?: OoxmlParaProps): string;
|
|
8
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEhE,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAkB1D;AAED,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAmB5D;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,WAAW,GAAG,WAAW,EAC/B,QAAQ,CAAC,EAAE,aAAa,EACxB,SAAS,CAAC,EAAE,cAAc,GACzB,MAAM,CAeR"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** Build w:rPr XML fragment from run properties. */
|
|
2
|
+
export function runPropsToXml(props) {
|
|
3
|
+
const parts = [];
|
|
4
|
+
if (props.rFonts) {
|
|
5
|
+
const attrs = [];
|
|
6
|
+
if (props.rFonts.ascii)
|
|
7
|
+
attrs.push(`w:ascii="${props.rFonts.ascii}"`);
|
|
8
|
+
if (props.rFonts.hAnsi)
|
|
9
|
+
attrs.push(`w:hAnsi="${props.rFonts.hAnsi}"`);
|
|
10
|
+
if (props.rFonts.cs)
|
|
11
|
+
attrs.push(`w:cs="${props.rFonts.cs}"`);
|
|
12
|
+
parts.push(`<w:rFonts ${attrs.join(" ")}/>`);
|
|
13
|
+
}
|
|
14
|
+
if (props.b)
|
|
15
|
+
parts.push("<w:b/>");
|
|
16
|
+
if (props.i)
|
|
17
|
+
parts.push("<w:i/>");
|
|
18
|
+
if (props.sz)
|
|
19
|
+
parts.push(`<w:sz w:val="${props.sz}"/>`);
|
|
20
|
+
if (props.color)
|
|
21
|
+
parts.push(`<w:color w:val="${props.color}"/>`);
|
|
22
|
+
if (props.u)
|
|
23
|
+
parts.push(`<w:u w:val="${props.u}"/>`);
|
|
24
|
+
if (props.strike)
|
|
25
|
+
parts.push("<w:strike/>");
|
|
26
|
+
if (props.shd)
|
|
27
|
+
parts.push(`<w:shd w:val="clear" w:color="auto" w:fill="${props.shd}"/>`);
|
|
28
|
+
if (props.vertAlign)
|
|
29
|
+
parts.push(`<w:vertAlign w:val="${props.vertAlign}"/>`);
|
|
30
|
+
return parts.length > 0 ? `<w:rPr>${parts.join("")}</w:rPr>` : "";
|
|
31
|
+
}
|
|
32
|
+
/** Build w:pPr XML fragment from paragraph properties. */
|
|
33
|
+
export function paraPropsToXml(props) {
|
|
34
|
+
const parts = [];
|
|
35
|
+
if (props.jc)
|
|
36
|
+
parts.push(`<w:jc w:val="${props.jc}"/>`);
|
|
37
|
+
if (props.spacing) {
|
|
38
|
+
const attrs = [];
|
|
39
|
+
if (props.spacing.before !== undefined)
|
|
40
|
+
attrs.push(`w:before="${props.spacing.before}"`);
|
|
41
|
+
if (props.spacing.after !== undefined)
|
|
42
|
+
attrs.push(`w:after="${props.spacing.after}"`);
|
|
43
|
+
if (props.spacing.line !== undefined)
|
|
44
|
+
attrs.push(`w:line="${props.spacing.line}"`);
|
|
45
|
+
parts.push(`<w:spacing ${attrs.join(" ")}/>`);
|
|
46
|
+
}
|
|
47
|
+
if (props.ind) {
|
|
48
|
+
const attrs = [];
|
|
49
|
+
if (props.ind.left !== undefined)
|
|
50
|
+
attrs.push(`w:left="${props.ind.left}"`);
|
|
51
|
+
if (props.ind.right !== undefined)
|
|
52
|
+
attrs.push(`w:right="${props.ind.right}"`);
|
|
53
|
+
if (props.ind.firstLine !== undefined)
|
|
54
|
+
attrs.push(`w:firstLine="${props.ind.firstLine}"`);
|
|
55
|
+
if (props.ind.hanging !== undefined)
|
|
56
|
+
attrs.push(`w:hanging="${props.ind.hanging}"`);
|
|
57
|
+
parts.push(`<w:ind ${attrs.join(" ")}/>`);
|
|
58
|
+
}
|
|
59
|
+
return parts.length > 0 ? `<w:pPr>${parts.join("")}</w:pPr>` : "";
|
|
60
|
+
}
|
|
61
|
+
/** Build a complete w:style element for styles.xml. */
|
|
62
|
+
export function buildStyleElement(styleId, styleName, type, runProps, paraProps) {
|
|
63
|
+
const parts = [];
|
|
64
|
+
parts.push(`<w:style w:type="${type}" w:customStyle="1" w:styleId="${styleId}">`);
|
|
65
|
+
parts.push(`<w:name w:val="${styleName}"/>`);
|
|
66
|
+
if (type === "paragraph")
|
|
67
|
+
parts.push(`<w:basedOn w:val="Normal"/>`);
|
|
68
|
+
if (paraProps) {
|
|
69
|
+
const pPr = paraPropsToXml(paraProps);
|
|
70
|
+
if (pPr)
|
|
71
|
+
parts.push(pPr);
|
|
72
|
+
}
|
|
73
|
+
if (runProps) {
|
|
74
|
+
const rPr = runPropsToXml(runProps);
|
|
75
|
+
if (rPr)
|
|
76
|
+
parts.push(rPr);
|
|
77
|
+
}
|
|
78
|
+
parts.push("</w:style>");
|
|
79
|
+
return parts.join("");
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=serialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,MAAM,UAAU,aAAa,CAAC,KAAoB;IAChD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM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I,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzB,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** OOXML run (character) properties */
|
|
2
|
+
export interface OoxmlRunProps {
|
|
3
|
+
rFonts?: {
|
|
4
|
+
ascii?: string;
|
|
5
|
+
hAnsi?: string;
|
|
6
|
+
cs?: string;
|
|
7
|
+
};
|
|
8
|
+
sz?: number;
|
|
9
|
+
b?: boolean;
|
|
10
|
+
i?: boolean;
|
|
11
|
+
u?: string;
|
|
12
|
+
strike?: boolean;
|
|
13
|
+
color?: string;
|
|
14
|
+
shd?: string;
|
|
15
|
+
vertAlign?: "superscript" | "subscript";
|
|
16
|
+
}
|
|
17
|
+
/** OOXML paragraph properties */
|
|
18
|
+
export interface OoxmlParaProps {
|
|
19
|
+
jc?: "left" | "center" | "right" | "both";
|
|
20
|
+
spacing?: {
|
|
21
|
+
before?: number;
|
|
22
|
+
after?: number;
|
|
23
|
+
line?: number;
|
|
24
|
+
};
|
|
25
|
+
ind?: {
|
|
26
|
+
left?: number;
|
|
27
|
+
right?: number;
|
|
28
|
+
firstLine?: number;
|
|
29
|
+
hanging?: number;
|
|
30
|
+
};
|
|
31
|
+
pBdr?: {
|
|
32
|
+
top?: BorderDef;
|
|
33
|
+
bottom?: BorderDef;
|
|
34
|
+
left?: BorderDef;
|
|
35
|
+
right?: BorderDef;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface BorderDef {
|
|
39
|
+
val: string;
|
|
40
|
+
sz: number;
|
|
41
|
+
color: string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mapp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f"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@otomate/css-docx",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } },
|
|
8
|
+
"files": ["dist"],
|
|
9
|
+
"scripts": { "build": "tsc", "typecheck": "tsc --noEmit" },
|
|
10
|
+
"devDependencies": { "typescript": "^5.7.0" },
|
|
11
|
+
"description": "CSS property to OOXML style mapping",
|
|
12
|
+
"license": "BUSL-1.1",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/Alessio-G/occam",
|
|
16
|
+
"directory": "packages/css-docx"
|
|
17
|
+
}
|
|
18
|
+
}
|