@sobree/core 0.1.36 → 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/doc/types/document.d.ts +3 -0
- package/dist/doc/types/sections.d.ts +2 -0
- 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/docx/import/settings.d.ts +4 -0
- package/dist/editor/view/docRenderer/block.d.ts +4 -1
- package/dist/editor/view/docRenderer/sectionFlow.d.ts +1 -1
- package/dist/index.js +2559 -2481
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -65,6 +65,9 @@ export interface SobreeDocument {
|
|
|
65
65
|
*/
|
|
66
66
|
settings?: {
|
|
67
67
|
defaultTabStopTwips?: number;
|
|
68
|
+
/** `<w:noColumnBalance/>` — disable column balancing at continuous
|
|
69
|
+
* section breaks document-wide (columns fill column-first). */
|
|
70
|
+
noColumnBalance?: boolean;
|
|
68
71
|
};
|
|
69
72
|
/**
|
|
70
73
|
* NOTE: inline-drawing frames are emitted as `InlineFrame` BLOCKS
|
|
@@ -39,6 +39,8 @@ export interface SectionColumns {
|
|
|
39
39
|
* (Word's `<w:cols w:equalWidth="0">`). Absent/`true` → equal columns,
|
|
40
40
|
* which the renderer flows with CSS multi-column. */
|
|
41
41
|
equalWidth?: boolean;
|
|
42
|
+
/** `<w:cols w:sep="1">` — draw a thin vertical rule between columns. */
|
|
43
|
+
separator?: boolean;
|
|
42
44
|
/** Per-column geometry from `<w:col w:w w:space>`, present only for the
|
|
43
45
|
* unequal case. `length === count`. Each entry's `spaceTwips` is the
|
|
44
46
|
* gap AFTER that column (the last column's is usually absent). The
|
|
@@ -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;
|
|
@@ -31,6 +31,10 @@ export interface DocSettings {
|
|
|
31
31
|
* for tab advances in paragraphs that don't declare their own
|
|
32
32
|
* `<w:tabs>`. Word's factory default is 720 twips (0.5"). */
|
|
33
33
|
defaultTabStopTwips?: number;
|
|
34
|
+
/** `<w:compat><w:noColumnBalance/>` — disable column balancing at
|
|
35
|
+
* continuous section breaks document-wide (columns fill column-first
|
|
36
|
+
* instead of equalising on the last page). */
|
|
37
|
+
noColumnBalance?: boolean;
|
|
34
38
|
}
|
|
35
39
|
export declare function parseSettingsXml(xml: string | undefined): DocSettings;
|
|
36
40
|
/**
|
|
@@ -14,4 +14,7 @@ export declare function renderBlocks(blocks: readonly Block[], host: HTMLElement
|
|
|
14
14
|
/** Body block indices that carry an anchored frame. Such a block counts
|
|
15
15
|
* as a valid target for a deferred page break even when its body flow is
|
|
16
16
|
* empty — a float-only brochure panel page is still a page. */
|
|
17
|
-
frameAnchoredIndices?: ReadonlySet<number
|
|
17
|
+
frameAnchoredIndices?: ReadonlySet<number>,
|
|
18
|
+
/** `<w:noColumnBalance/>` — fill multi-column sections column-first even
|
|
19
|
+
* at continuous breaks (document-wide opt-out of column balancing). */
|
|
20
|
+
noColumnBalance?: boolean): void;
|
|
@@ -21,7 +21,7 @@ import { SectionProperties } from '../../../doc/types';
|
|
|
21
21
|
* `nextSection` is the section that BEGINS immediately after this one; its
|
|
22
22
|
* break type is what TERMINATES this one, and so decides balance vs fill.
|
|
23
23
|
*/
|
|
24
|
-
export declare function openColumnContainerIfNeeded(host: HTMLElement, section: SectionProperties | undefined, sectionIndex?: number, nextSection?: SectionProperties | undefined): HTMLElement;
|
|
24
|
+
export declare function openColumnContainerIfNeeded(host: HTMLElement, section: SectionProperties | undefined, sectionIndex?: number, nextSection?: SectionProperties | undefined, noColumnBalance?: boolean): HTMLElement;
|
|
25
25
|
/**
|
|
26
26
|
* Whether a multi-column section should FILL column-first (column 0 to the
|
|
27
27
|
* page bottom, then column 1) rather than balance its last page.
|