@sobree/core 0.1.35 → 0.1.38
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/import/settings.d.ts +4 -0
- package/dist/editor/view/docRenderer/block.d.ts +4 -1
- package/dist/editor/view/docRenderer/sectionFlow.d.ts +24 -1
- package/dist/index.js +2086 -2030
- 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
|
|
@@ -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;
|
|
@@ -12,10 +12,33 @@ import { SectionProperties } from '../../../doc/types';
|
|
|
12
12
|
* - `data-col-count` — column count (every multi-column wrapper)
|
|
13
13
|
* - `data-pag-cid` — stable section id, so the flow pass can
|
|
14
14
|
* re-consolidate a section's per-page wrappers
|
|
15
|
+
* - `data-col-fill`="1" — fill column 0 to the page bottom, then column
|
|
16
|
+
* 1 (newspaper) instead of balancing the last
|
|
17
|
+
* page; see `columnsFillNotBalance`
|
|
15
18
|
* - unequal: `data-col-widths-mm` + `data-col-gaps-mm` (explicit)
|
|
16
19
|
* - equal: `data-col-gap-mm` (tracks sized by the flow pass)
|
|
20
|
+
*
|
|
21
|
+
* `nextSection` is the section that BEGINS immediately after this one; its
|
|
22
|
+
* break type is what TERMINATES this one, and so decides balance vs fill.
|
|
23
|
+
*/
|
|
24
|
+
export declare function openColumnContainerIfNeeded(host: HTMLElement, section: SectionProperties | undefined, sectionIndex?: number, nextSection?: SectionProperties | undefined, noColumnBalance?: boolean): HTMLElement;
|
|
25
|
+
/**
|
|
26
|
+
* Whether a multi-column section should FILL column-first (column 0 to the
|
|
27
|
+
* page bottom, then column 1) rather than balance its last page.
|
|
28
|
+
*
|
|
29
|
+
* Word balances a multi-column section's columns only when the section ends
|
|
30
|
+
* at a CONTINUOUS section break (or the document end); a section terminated
|
|
31
|
+
* by a hard page break (`nextPage` / `evenPage` / `oddPage`) fills column by
|
|
32
|
+
* column instead, leaving the second column short when the text runs out.
|
|
33
|
+
* `nextSection` is the section that begins right after — its break `type` is
|
|
34
|
+
* this section's terminator. No next section ⇒ document end ⇒ balance.
|
|
35
|
+
* (OOXML's `<w:type>` default is `nextPage`, so an unset type fills.)
|
|
17
36
|
*/
|
|
18
|
-
export declare function
|
|
37
|
+
export declare function columnsFillNotBalance(nextSection: SectionProperties | undefined): boolean;
|
|
38
|
+
/** Whether `section` begins on a fresh page — its break `type` is a hard
|
|
39
|
+
* page break (`nextPage` / `evenPage` / `oddPage`). A continuous (or unset)
|
|
40
|
+
* section continues on the running page. */
|
|
41
|
+
export declare function sectionStartsOnFreshPage(section: SectionProperties | undefined): boolean;
|
|
19
42
|
/**
|
|
20
43
|
* If `container` is a column-flow container, move any trailing
|
|
21
44
|
* visually-empty paragraphs out of it and append them to `host`. Keeps
|