@sobree/core 0.1.25 → 0.1.26

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.
@@ -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
- export interface RichZonesSource {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sobree/core",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },