@sobree/core 0.1.16 → 0.1.18
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/createSobree.d.ts +9 -0
- package/dist/editor/index.d.ts +7 -0
- package/dist/editor/types.d.ts +7 -0
- package/dist/editor/view/docRenderer/sectionFlow.d.ts +15 -4
- package/dist/index.css +1 -1
- package/dist/index.js +2029 -1938
- package/dist/index.js.map +1 -1
- package/dist/paperStack/paginationAdapter/columnFlow.d.ts +35 -34
- package/dist/sobree.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Multi-column section flow — equal AND unequal, across pages.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* explicit per-column widths
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* A Word multi-column section (`<w:cols w:num="2">`, with or without
|
|
5
|
+
* explicit per-column widths) flows its content in newspaper order:
|
|
6
|
+
* fill column 0 to the page bottom, then column 1, then continue on the
|
|
7
|
+
* NEXT page. CSS can express neither unequal column widths nor a flow
|
|
8
|
+
* that fragments across our manually-paginated, fixed-height page boxes,
|
|
9
|
+
* so this pass owns the whole 2-D layout: it restructures a section's
|
|
10
|
+
* blocks into explicit width tracks, chunked one wrapper per page.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* pixels of font-metric drift between renders (web fonts loaded vs not)
|
|
21
|
-
* flip blocks across the boundary. Balancing both matches Word and is
|
|
22
|
-
* stable: the split lands at the block boundary that minimises the
|
|
23
|
-
* tallest column, which block granularity pins in place.
|
|
12
|
+
* The renderer (`openColumnContainerIfNeeded`) emits ONE flat
|
|
13
|
+
* `.sobree-cols` wrapper per section, stamped with the geometry and a
|
|
14
|
+
* stable section id (`data-pag-cid`). This pass — run after layout, when
|
|
15
|
+
* heights are measurable — replaces that wrapper with a sequence of
|
|
16
|
+
* page-sized wrappers (the first reused in place, the rest inserted as
|
|
17
|
+
* siblings). Each is at most one page tall, so the column-agnostic
|
|
18
|
+
* paginator downstream simply places each on its own page; the columns
|
|
19
|
+
* "snake" because page K+1 continues page K's content.
|
|
24
20
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
21
|
+
* Fill model:
|
|
22
|
+
* - Interior pages are FILLED: column 0 packed to the page budget,
|
|
23
|
+
* then column 1, etc.
|
|
24
|
+
* - The FINAL page is BALANCED (equalised column heights), matching
|
|
25
|
+
* Word's "balance columns at section end". A section that fits one
|
|
26
|
+
* page is a single, balanced chunk — identical to the previous
|
|
27
|
+
* single-page behaviour.
|
|
28
|
+
*
|
|
29
|
+
* Blocks move whole (a paragraph is never split across a column or page
|
|
30
|
+
* boundary); that's faithful for the templates this targets, where
|
|
31
|
+
* columns break at block boundaries.
|
|
32
|
+
*
|
|
33
|
+
* Idempotent: the repaginate loop re-collects every block and re-runs
|
|
34
|
+
* this pass each iteration. On entry we re-consolidate the per-page
|
|
35
|
+
* wrappers of each section (matched by `data-pag-cid`) back into one,
|
|
36
|
+
* then re-chunk — so re-running is a no-op on a settled layout.
|
|
35
37
|
*/
|
|
36
38
|
/**
|
|
37
|
-
* Flow every
|
|
38
|
-
* `
|
|
39
|
-
* column may fill before spilling to the next).
|
|
39
|
+
* Flow every multi-column section under `root` into per-page column
|
|
40
|
+
* chunks. `pageHeightPx` is the page content-height budget.
|
|
40
41
|
*/
|
|
41
|
-
export declare function
|
|
42
|
+
export declare function flowColumnSections(root: HTMLElement, pageHeightPx: number): void;
|
package/dist/sobree.d.ts
CHANGED
|
@@ -68,6 +68,11 @@ export interface SobreeOptions {
|
|
|
68
68
|
* after a deploy) — it has no other behaviour.
|
|
69
69
|
*/
|
|
70
70
|
versionBadge?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Show hidden text (`<w:vanish/>`) from the start. Off by default
|
|
73
|
+
* (print-faithful). Toggle later with `editor.setShowHiddenText`.
|
|
74
|
+
*/
|
|
75
|
+
showHiddenText?: boolean;
|
|
71
76
|
}
|
|
72
77
|
/**
|
|
73
78
|
* Top-level embeddable product surface. Composes a framework-free `Editor`
|