@sobree/core 0.1.38 → 0.1.39
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/docx/drawing/anchored.d.ts +3 -0
- package/dist/docx/drawing/colors.d.ts +7 -0
- package/dist/docx/drawing/index.d.ts +1 -1
- package/dist/docx/drawing/inline.d.ts +3 -0
- package/dist/docx/drawing/shapeProps.d.ts +1 -1
- package/dist/index.js +2159 -2124
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,6 +24,9 @@ export interface AnchoredFramesContext {
|
|
|
24
24
|
/** Theme colour palette (from `word/theme/theme1.xml`) so shape fills /
|
|
25
25
|
* strokes declared as `<a:schemeClr>` resolve instead of vanishing. */
|
|
26
26
|
theme?: ThemePalette;
|
|
27
|
+
/** Theme `<a:lnStyleLst>` outline widths (EMU), indexed by a shape's
|
|
28
|
+
* `<a:lnRef idx>` so a style-referenced border imports at full width. */
|
|
29
|
+
themeLineWidthsEmu?: number[];
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Walk every `<w:drawing>/<wp:anchor>` in the document and return one
|
|
@@ -22,6 +22,13 @@ export type ThemePalette = Record<string, string>;
|
|
|
22
22
|
/** Parse `word/theme/theme1.xml` into the colour-scheme palette.
|
|
23
23
|
* Returns undefined when the part is absent or malformed. */
|
|
24
24
|
export declare function parseThemeXml(xml: string | undefined): ThemePalette | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Parse the theme's `<a:fmtScheme><a:lnStyleLst>` outline widths (EMU), in
|
|
27
|
+
* order. A shape's `<a:lnRef idx="N">` references the Nth (1-based) entry
|
|
28
|
+
* for its outline WIDTH, while the lnRef's own colour child gives the
|
|
29
|
+
* stroke colour. Empty when the theme omits the list.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseThemeLineWidthsEmu(xml: string | undefined): number[];
|
|
25
32
|
/**
|
|
26
33
|
* Resolve the colour child of `parent` (an `<a:solidFill>` or `<a:ln>`-
|
|
27
34
|
* style container): literal `srgbClr` or theme `schemeClr`, transforms
|
|
@@ -15,6 +15,6 @@ export { readTextDistances } from './margins';
|
|
|
15
15
|
export type { TextDistancesEmu } from './margins';
|
|
16
16
|
export { normalizePartPath, readBlipEmbedPart } from './relationships';
|
|
17
17
|
export { readBorder, readGeometry, readSolidFill } from './shapeProps';
|
|
18
|
-
export { parseThemeXml, readDrawingColor } from './colors';
|
|
18
|
+
export { parseThemeLineWidthsEmu, parseThemeXml, readDrawingColor } from './colors';
|
|
19
19
|
export type { ThemePalette } from './colors';
|
|
20
20
|
export type { EmuExtent, EmuOffset, RelativeFromH, RelativeFromV, XfrmBox, } from './model';
|
|
@@ -30,6 +30,9 @@ export interface InlineFramesContext {
|
|
|
30
30
|
/** Theme colour palette (from `word/theme/theme1.xml`) so textbox /
|
|
31
31
|
* shape fills declared as `<a:schemeClr>` resolve instead of vanishing. */
|
|
32
32
|
theme?: ThemePalette;
|
|
33
|
+
/** Theme `<a:lnStyleLst>` outline widths (EMU), indexed by a shape's
|
|
34
|
+
* `<a:lnRef idx>` so a style-referenced border imports at full width. */
|
|
35
|
+
themeLineWidthsEmu?: number[];
|
|
33
36
|
/**
|
|
34
37
|
* Body content width in EMU (page width − left/right margins). Needed
|
|
35
38
|
* only to lay out a paragraph that holds MORE THAN ONE inline drawing
|
|
@@ -15,4 +15,4 @@ export declare function readGeometry(wsp: Element): "rect" | "ellipse" | "rounde
|
|
|
15
15
|
export declare function readSolidFill(shape: Element, theme?: ThemePalette): string | undefined;
|
|
16
16
|
/** Read the shape outline `<a:ln>` (width + colour + dash) into a
|
|
17
17
|
* `FrameBorder`; `undefined` when there's no outline or no stroke colour. */
|
|
18
|
-
export declare function readBorder(shape: Element, theme?: ThemePalette): FrameBorder | undefined;
|
|
18
|
+
export declare function readBorder(shape: Element, theme?: ThemePalette, themeLineWidthsEmu?: number[]): FrameBorder | undefined;
|