@sobree/core 0.1.25 → 0.1.27
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/import/flowFrames.d.ts +2 -2
- package/dist/editor/index.d.ts +41 -181
- package/dist/editor/internal/changePipeline.d.ts +123 -0
- package/dist/editor/internal/frames.d.ts +105 -0
- package/dist/editor/view/docRenderer/block.d.ts +5 -1
- package/dist/index.js +3806 -3638
- package/dist/index.js.map +1 -1
- package/dist/paperStack/paperStack.d.ts +32 -6
- package/package.json +1 -1
|
@@ -8,14 +8,24 @@ import { PageSetup } from './pageSetup';
|
|
|
8
8
|
* templates. Cleared (set back to `null`) when the doc has no
|
|
9
9
|
* header/footer parts — falls back to the legacy text path.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The document render dependencies the anchored-frame layer needs to paint
|
|
13
|
+
* frame content — pictures (via `rawParts`) and textbox bodies (via
|
|
14
|
+
* `renderBlocks`, which wants `numbering` + `styles`). Deliberately
|
|
15
|
+
* independent of header/footer rich zones: a document with floating
|
|
16
|
+
* drawings but NO header/footer still needs these to render its frames, so
|
|
17
|
+
* the anchor layer must not be gated on {@link RichZonesSource}.
|
|
18
|
+
*/
|
|
19
|
+
export interface AnchorRenderDeps {
|
|
20
|
+
numbering: readonly NumberingDefinition[];
|
|
21
|
+
styles: readonly NamedStyle[];
|
|
22
|
+
rawParts: Record<string, Uint8Array>;
|
|
23
|
+
}
|
|
24
|
+
export interface RichZonesSource extends AnchorRenderDeps {
|
|
12
25
|
headerFooterBodies: Record<string, Block[]>;
|
|
13
26
|
/** Floating frames per header/footer part, keyed by the same partId as
|
|
14
27
|
* `headerFooterBodies`. Absent for docs whose zones have no floats. */
|
|
15
28
|
headerFooterFrames?: Record<string, AnchoredFrame[]>;
|
|
16
|
-
numbering: readonly NumberingDefinition[];
|
|
17
|
-
styles: readonly NamedStyle[];
|
|
18
|
-
rawParts: Record<string, Uint8Array>;
|
|
19
29
|
}
|
|
20
30
|
/**
|
|
21
31
|
* Stack of Paper elements. The stack's root is the single contentEditable
|
|
@@ -60,6 +70,14 @@ export declare class PaperStack {
|
|
|
60
70
|
* `null` → no floating layer at all (skeleton state during Phase B).
|
|
61
71
|
*/
|
|
62
72
|
private anchoredFrames;
|
|
73
|
+
/**
|
|
74
|
+
* Render deps for {@link anchoredFrames}, carried with them so the anchor
|
|
75
|
+
* layer can paint frame content (pictures, textbox bodies) WITHOUT a
|
|
76
|
+
* {@link RichZonesSource}. Set alongside `anchoredFrames`; the body
|
|
77
|
+
* floating layer used to wrongly source these from `richZones`, which
|
|
78
|
+
* dropped every frame in a header/footer-less document.
|
|
79
|
+
*/
|
|
80
|
+
private anchorRenderDeps;
|
|
63
81
|
/** Reused blob-URL cache across renders so the same image isn't re-uploaded. */
|
|
64
82
|
private readonly anchorPictureUrlCache;
|
|
65
83
|
constructor(container: HTMLElement, setup: PageSetup);
|
|
@@ -85,8 +103,13 @@ export declare class PaperStack {
|
|
|
85
103
|
*
|
|
86
104
|
* Call after `setRichZones`/`updateBodyBlocks` so the next render
|
|
87
105
|
* picks up the new floating content alongside body flow.
|
|
106
|
+
*
|
|
107
|
+
* `deps` carries the render context (rawParts / numbering / styles) the
|
|
108
|
+
* frames need to paint — supplied here, not borrowed from `richZones`, so
|
|
109
|
+
* floating content renders whether or not the document has header/footer
|
|
110
|
+
* zones.
|
|
88
111
|
*/
|
|
89
|
-
setAnchoredFrames(frames: readonly AnchoredFrame[] | null): void;
|
|
112
|
+
setAnchoredFrames(frames: readonly AnchoredFrame[] | null, deps: AnchorRenderDeps): void;
|
|
90
113
|
getSetup(): PageSetup;
|
|
91
114
|
getPageCount(): number;
|
|
92
115
|
onPaginate(cb: (pageCount: number) => void): () => void;
|
|
@@ -173,6 +196,9 @@ export declare class PaperStack {
|
|
|
173
196
|
*
|
|
174
197
|
* Cheap and idempotent; safe to call after any layout change.
|
|
175
198
|
*/
|
|
199
|
+
/** Body block indices a floating frame is anchored to. A body-empty page
|
|
200
|
+
* holding one of these carries an absolute overlay and must not collapse. */
|
|
201
|
+
private anchoredBlockIndices;
|
|
176
202
|
private paintAnchorLayers;
|
|
177
203
|
/**
|
|
178
204
|
* Walk every paper's content children once and record, for each
|
|
@@ -216,4 +242,4 @@ export declare class PaperStack {
|
|
|
216
242
|
* a real "last page with just a signature line" still gets its own
|
|
217
243
|
* page. Idempotent; safe to call on a single-page result.
|
|
218
244
|
*/
|
|
219
|
-
export declare function collapseTrailingEmptyPages(pages: readonly HTMLElement[][]): HTMLElement[][];
|
|
245
|
+
export declare function collapseTrailingEmptyPages(pages: readonly HTMLElement[][], anchoredBlockIndices?: ReadonlySet<number>): HTMLElement[][];
|