studiograph 1.3.48-next.261 → 1.3.48-next.262

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.
Files changed (175) hide show
  1. package/dist/agent/prompts/system.md +2 -2
  2. package/dist/agent/skills/artifact-canvas/skill.md +25 -37
  3. package/dist/agent/skills/paged-documents/skill.md +53 -103
  4. package/dist/agent/tools/artifact-tools.js +1 -1
  5. package/dist/agent/tools/artifact-tools.js.map +1 -1
  6. package/dist/core/artifact-columns-css.d.ts +38 -0
  7. package/dist/core/artifact-columns-css.js +157 -0
  8. package/dist/core/artifact-columns-css.js.map +1 -0
  9. package/dist/core/artifact-frame-document.d.ts +57 -15
  10. package/dist/core/artifact-frame-document.js +351 -346
  11. package/dist/core/artifact-frame-document.js.map +1 -1
  12. package/dist/mcp/tools.js +8 -8
  13. package/dist/mcp/tools.js.map +1 -1
  14. package/dist/server/routes/artifact-export-api.js +2 -3
  15. package/dist/server/routes/artifact-export-api.js.map +1 -1
  16. package/dist/services/artifact-library-sources.d.ts +1 -6
  17. package/dist/services/artifact-library-sources.js +1 -9
  18. package/dist/services/artifact-library-sources.js.map +1 -1
  19. package/dist/services/artifact-render-export.d.ts +3 -3
  20. package/dist/services/artifact-render-export.js +57 -50
  21. package/dist/services/artifact-render-export.js.map +1 -1
  22. package/dist/web/_app/immutable/chunks/2jM_FrdF.js +1 -0
  23. package/dist/web/_app/immutable/chunks/{DtXJCaQc2.js → 3Jf1z4Hy2.js} +1 -1
  24. package/dist/web/_app/immutable/chunks/3e54b3S0.js +1 -0
  25. package/dist/web/_app/immutable/chunks/7pkBLE0o.js +23 -0
  26. package/dist/web/_app/immutable/chunks/{B9VQbssY.js → B1pVemww.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/{DMFH9Cnt2.js → B4K-yj0D2.js} +1 -1
  28. package/dist/web/_app/immutable/chunks/B7P31uII.js +1 -0
  29. package/dist/web/_app/immutable/chunks/B7QhSEou.js +1 -0
  30. package/dist/web/_app/immutable/chunks/{F5xZdLlB.js → B7WN6QF2.js} +1 -1
  31. package/dist/web/_app/immutable/chunks/{Cg7m1gqN.js → BBiZOxjN.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/BH8Lm2ff.js +1 -0
  33. package/dist/web/_app/immutable/chunks/BLw5bIbe.js +1 -0
  34. package/dist/web/_app/immutable/chunks/{Oglnp7sm.js → BNq2--8a.js} +1 -1
  35. package/dist/web/_app/immutable/chunks/BaEbafZv.js +1 -0
  36. package/dist/web/_app/immutable/chunks/{sUAtda6y2.js → BeMEksa_2.js} +1 -1
  37. package/dist/web/_app/immutable/chunks/BksI9pEP.js +2 -0
  38. package/dist/web/_app/immutable/chunks/{CLninaDG2.js → Bncd_2iV2.js} +2 -2
  39. package/dist/web/_app/immutable/chunks/Bo6vsMxZ.js +1 -0
  40. package/dist/web/_app/immutable/chunks/{D0_Iu3Uj.js → BwZmyfEX.js} +1 -1
  41. package/dist/web/_app/immutable/chunks/{7l950wkn.js → CB2VdVc2.js} +1 -1
  42. package/dist/web/_app/immutable/chunks/CGG26Xmx.js +1 -0
  43. package/dist/web/_app/immutable/chunks/{K5YHt1WL2.js → CRANgTjw2.js} +1 -1
  44. package/dist/web/_app/immutable/chunks/{CuatNdzp.js → CSkL5wO6.js} +1 -1
  45. package/dist/web/_app/immutable/chunks/C_vyTCDY.js +1 -0
  46. package/dist/web/_app/immutable/chunks/{CQW66fYJ.js → Ca57r8F-.js} +1 -1
  47. package/dist/web/_app/immutable/chunks/CbnTIbQI2.js +915 -0
  48. package/dist/web/_app/immutable/chunks/{CR1JY_cb.js → CdvkVymz2.js} +1 -1
  49. package/dist/web/_app/immutable/chunks/{atFSAfcd2.js → Cf7pPlrJ2.js} +2 -2
  50. package/dist/web/_app/immutable/chunks/{CKwV6HKc.js → Cg5kjIaW.js} +1 -1
  51. package/dist/web/_app/immutable/chunks/{BvyVm7-j.js → CmPtL-Rn.js} +1 -1
  52. package/dist/web/_app/immutable/chunks/{B3u4QMoU.js → CnpFxw1N2.js} +1 -1
  53. package/dist/web/_app/immutable/chunks/D2G8GgRX.js +1 -0
  54. package/dist/web/_app/immutable/chunks/D3ZdQV1G2.js +66 -0
  55. package/dist/web/_app/immutable/chunks/{snCOoD78.js → D74E7DtA.js} +1 -1
  56. package/dist/web/_app/immutable/chunks/{B4PrlkmE.js → D8nBN3-t.js} +1 -1
  57. package/dist/web/_app/immutable/chunks/{Bpmx7Umc.js → DE5MFphK.js} +1 -1
  58. package/dist/web/_app/immutable/chunks/DGayKSDC.js +1 -0
  59. package/dist/web/_app/immutable/chunks/{BU5TCj7m.js → DHtwYMGu2.js} +1 -1
  60. package/dist/web/_app/immutable/chunks/DIro3eQz.js +1 -0
  61. package/dist/web/_app/immutable/chunks/{DgP0Pxes.js → DJ61sY6B.js} +1 -1
  62. package/dist/web/_app/immutable/chunks/{-MYqXlc3.js → DLFxzom2.js} +1 -1
  63. package/dist/web/_app/immutable/chunks/{BIeOkmiV.js → DOTPES0g.js} +1 -1
  64. package/dist/web/_app/immutable/chunks/DWbRq2tL.js +1 -0
  65. package/dist/web/_app/immutable/chunks/{BBrP9GiZ.js → D_iZ9buk.js} +1 -1
  66. package/dist/web/_app/immutable/chunks/Dm-W1U3E.js +1 -0
  67. package/dist/web/_app/immutable/chunks/{DhD1HF7R.js → DnUROuxo.js} +1 -1
  68. package/dist/web/_app/immutable/chunks/{B5UH1FNe.js → DqGcR20a.js} +3 -3
  69. package/dist/web/_app/immutable/chunks/{DaB0hU8_.js → DqGo4lyB2.js} +1 -1
  70. package/dist/web/_app/immutable/chunks/{ChS3kWO-.js → DrD4p8T22.js} +1 -1
  71. package/dist/web/_app/immutable/chunks/{-Tbr-96c2.js → DtsNBsm82.js} +1 -1
  72. package/dist/web/_app/immutable/chunks/{B06uE1qJ.js → DwvPlTQh.js} +1 -1
  73. package/dist/web/_app/immutable/chunks/{CZBW5wi82.js → DxPoYrW02.js} +1 -1
  74. package/dist/web/_app/immutable/chunks/DxQ5eC8d.js +1 -0
  75. package/dist/web/_app/immutable/chunks/{2z2ekE6D2.js → DzBvLWrB2.js} +2 -2
  76. package/dist/web/_app/immutable/chunks/{CcgYvk_3.js → G9YEWi42.js} +1 -1
  77. package/dist/web/_app/immutable/chunks/{CQl_RUVN2.js → HMuf07932.js} +1 -1
  78. package/dist/web/_app/immutable/chunks/{CG8YKaqc.js → HdbzGSgU.js} +1 -1
  79. package/dist/web/_app/immutable/chunks/{Cxdio_Al.js → Mozc9LAu.js} +3 -3
  80. package/dist/web/_app/immutable/chunks/{D-vvXTU3.js → Ryiz4ZhP.js} +2 -2
  81. package/dist/web/_app/immutable/chunks/{1QRy7-wo.js → gIVpw0C1.js} +1 -1
  82. package/dist/web/_app/immutable/chunks/{Cx5IiiDO2.js → gwOFYscJ2.js} +1 -1
  83. package/dist/web/_app/immutable/chunks/nacCpTNj.js +83 -0
  84. package/dist/web/_app/immutable/chunks/{PwUOTfSv.js → rSrKfaH92.js} +1 -1
  85. package/dist/web/_app/immutable/chunks/{CkivrILi.js → tvHn3XYh.js} +1 -1
  86. package/dist/web/_app/immutable/chunks/{pPsy4008.js → w53PifJt.js} +1 -1
  87. package/dist/web/_app/immutable/entry/app.D9mnvkg5.js +2 -0
  88. package/dist/web/_app/immutable/entry/start.B1L019Jv.js +1 -0
  89. package/dist/web/_app/immutable/nodes/{0.v0W5DL7W.js → 0.GCsQhZXx.js} +2 -2
  90. package/dist/web/_app/immutable/nodes/{1.81Rb3Ith.js → 1.Bai1Q_j6.js} +1 -1
  91. package/dist/web/_app/immutable/nodes/{10.CAlZNFOq.js → 10.Y-zXN2Lv.js} +1 -1
  92. package/dist/web/_app/immutable/nodes/{11.CCfUginI.js → 11.BGLbrt6p.js} +1 -1
  93. package/dist/web/_app/immutable/nodes/{12.BJLboAyk.js → 12.kkg6EDtl.js} +1 -1
  94. package/dist/web/_app/immutable/nodes/{13.Cz4UTl2G.js → 13.DVLmp3Ll.js} +1 -1
  95. package/dist/web/_app/immutable/nodes/15.B6Aw4lhr.js +1 -0
  96. package/dist/web/_app/immutable/nodes/{16.BjohAUt9.js → 16.BvduImqP.js} +1 -1
  97. package/dist/web/_app/immutable/nodes/{18.DsOT0tDo.js → 18.pwlJhpUE.js} +1 -1
  98. package/dist/web/_app/immutable/nodes/{19.BiJWLOUT.js → 19.CC1kL3Df.js} +1 -1
  99. package/dist/web/_app/immutable/nodes/2.CvV_5gfw.js +124 -0
  100. package/dist/web/_app/immutable/nodes/{3.BIT9mm9r.js → 3.DBPrinvQ.js} +1 -1
  101. package/dist/web/_app/immutable/nodes/{4.Cn7r0Poe.js → 4.A-1yULWB.js} +3 -3
  102. package/dist/web/_app/immutable/nodes/{5.CkJNdCZG.js → 5.CN9jkFSb.js} +1 -1
  103. package/dist/web/_app/immutable/nodes/{6.1rbIRQgQ.js → 6.B2TGmdUT.js} +1 -1
  104. package/dist/web/_app/immutable/nodes/{7.w17Zl36i.js → 7.DQFIEPX4.js} +1 -1
  105. package/dist/web/_app/immutable/nodes/{8.DqTsYuU-.js → 8.CsTDHJ_M.js} +1 -1
  106. package/dist/web/_app/immutable/nodes/{9.BJhYZPfc.js → 9.B9zlBMg4.js} +1 -1
  107. package/dist/web/_app/version.json +1 -1
  108. package/dist/web/index.html +17 -17
  109. package/package.json +1 -2
  110. package/dist/core/artifact-bundle.d.ts +0 -69
  111. package/dist/core/artifact-bundle.js +0 -305
  112. package/dist/core/artifact-bundle.js.map +0 -1
  113. package/dist/core/artifact-export.d.ts +0 -83
  114. package/dist/core/artifact-export.js +0 -1567
  115. package/dist/core/artifact-export.js.map +0 -1
  116. package/dist/core/artifact-frame-selectors.d.ts +0 -42
  117. package/dist/core/artifact-frame-selectors.js +0 -65
  118. package/dist/core/artifact-frame-selectors.js.map +0 -1
  119. package/dist/core/artifact-paged-css.d.ts +0 -64
  120. package/dist/core/artifact-paged-css.js +0 -253
  121. package/dist/core/artifact-paged-css.js.map +0 -1
  122. package/dist/core/field-library.d.ts +0 -62
  123. package/dist/core/field-library.js +0 -129
  124. package/dist/core/field-library.js.map +0 -1
  125. package/dist/mcp/comment-virtual-entity.d.ts +0 -36
  126. package/dist/mcp/comment-virtual-entity.js +0 -71
  127. package/dist/mcp/comment-virtual-entity.js.map +0 -1
  128. package/dist/server/routes/field-library-api.d.ts +0 -28
  129. package/dist/server/routes/field-library-api.js +0 -126
  130. package/dist/server/routes/field-library-api.js.map +0 -1
  131. package/dist/server/routes/import-batch.d.ts +0 -24
  132. package/dist/server/routes/import-batch.js +0 -33
  133. package/dist/server/routes/import-batch.js.map +0 -1
  134. package/dist/services/artifact-inspect-metadata.d.ts +0 -21
  135. package/dist/services/artifact-inspect-metadata.js +0 -66
  136. package/dist/services/artifact-inspect-metadata.js.map +0 -1
  137. package/dist/services/asset-upload-service.d.ts +0 -56
  138. package/dist/services/asset-upload-service.js +0 -200
  139. package/dist/services/asset-upload-service.js.map +0 -1
  140. package/dist/services/bookmark-import-service.d.ts +0 -49
  141. package/dist/services/bookmark-import-service.js +0 -250
  142. package/dist/services/bookmark-import-service.js.map +0 -1
  143. package/dist/web/_app/immutable/chunks/1_BWKAKA2.js +0 -23
  144. package/dist/web/_app/immutable/chunks/9Sn2PwSn2.js +0 -1025
  145. package/dist/web/_app/immutable/chunks/B2cjR0rG.js +0 -83
  146. package/dist/web/_app/immutable/chunks/BIwe25Lk.js +0 -1
  147. package/dist/web/_app/immutable/chunks/BnYohOts2.js +0 -1
  148. package/dist/web/_app/immutable/chunks/BxeOdaUQ.js +0 -1
  149. package/dist/web/_app/immutable/chunks/C6d9nn3k.js +0 -1
  150. package/dist/web/_app/immutable/chunks/C85NG5lS.js +0 -1
  151. package/dist/web/_app/immutable/chunks/CB-t1Bv-.js +0 -1
  152. package/dist/web/_app/immutable/chunks/CJbr-v9X.js +0 -1
  153. package/dist/web/_app/immutable/chunks/CKGHeJzq.js +0 -1
  154. package/dist/web/_app/immutable/chunks/CXPMb3zd.js +0 -1
  155. package/dist/web/_app/immutable/chunks/CgCz4Fj6.js +0 -1
  156. package/dist/web/_app/immutable/chunks/CuYL65Bn.js +0 -2
  157. package/dist/web/_app/immutable/chunks/D4vfNy_f.js +0 -1
  158. package/dist/web/_app/immutable/chunks/DBGaXAP8.js +0 -1
  159. package/dist/web/_app/immutable/chunks/DG7uGoZb2.js +0 -58
  160. package/dist/web/_app/immutable/chunks/DTOO9nUj.js +0 -1
  161. package/dist/web/_app/immutable/chunks/Dav8Lgyy2.js +0 -5
  162. package/dist/web/_app/immutable/chunks/DiiXREv7.js +0 -1
  163. package/dist/web/_app/immutable/chunks/DjXtgWTP.js +0 -1
  164. package/dist/web/_app/immutable/chunks/oIZupUnz.js +0 -1
  165. package/dist/web/_app/immutable/entry/app.1tcNTKI-.js +0 -2
  166. package/dist/web/_app/immutable/entry/start.BJMsySI1.js +0 -1
  167. package/dist/web/_app/immutable/nodes/15.D2mNE6C-.js +0 -1
  168. package/dist/web/_app/immutable/nodes/2.Cd72nG2V.js +0 -124
  169. /package/dist/web/_app/immutable/chunks/{B9KfEsQw2.js → B9KfEsQw.js} +0 -0
  170. /package/dist/web/_app/immutable/chunks/{BO6-nRV9.js → BO6-nRV92.js} +0 -0
  171. /package/dist/web/_app/immutable/chunks/{CcWaWbrI2.js → CcWaWbrI.js} +0 -0
  172. /package/dist/web/_app/immutable/chunks/{CsIWxmio2.js → CsIWxmio.js} +0 -0
  173. /package/dist/web/_app/immutable/chunks/{DQMWa2t7.js → DQMWa2t72.js} +0 -0
  174. /package/dist/web/_app/immutable/chunks/{MAYbL-xn2.js → MAYbL-xn.js} +0 -0
  175. /package/dist/web/_app/immutable/chunks/{MtN4vJa02.js → MtN4vJa0.js} +0 -0
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Rewrite author CSS so a `pages` document's flowing content paginates under
3
+ * NATIVE CSS multi-column (the columns compositor) instead of Paged.js.
4
+ *
5
+ * WHY: the compositor lays the document body out as one tall multi-column flow
6
+ * (`column-width` = the page content width); each column == one page. Two author
7
+ * CSS idioms were written for Paged.js's `@page` model and DON'T translate:
8
+ * 1. Forced PAGE breaks (`break-before:page`, legacy `page-break-*:always`, …)
9
+ * do nothing inside a multicol container — they must become COLUMN breaks.
10
+ * 2. `position:running(name)` elements (the source for `@page` margin-box
11
+ * running headers) are inert outside `@page`; left in the body flow they
12
+ * render as stray in-flow content. They must be removed from the flow.
13
+ *
14
+ * This is a BUILD-TIME transform (run once on the emitted shared CSS + each
15
+ * paginated frame's inline `<style>` blocks), so there is no sandboxed-runtime
16
+ * twin to keep in lock-step — unlike the former Paged.js url() sanitizer.
17
+ *
18
+ * PARSER, NOT BARE REGEX: a naive `String.replace` would corrupt a
19
+ * `content:"break-before:page"` string literal, a `/* break-before:page *​/`
20
+ * comment, or text inside a `url()`. So we first SEGMENT the CSS — copying
21
+ * comments, string literals, and `url()` tokens through VERBATIM — and apply the
22
+ * property/value rewrites ONLY to the "normal" CSS runs between them. The
23
+ * segmenter mirrors the skip logic of the (removed) `artifact-paged-css.ts` url
24
+ * scanner: it honors `\` escapes and never matches `url(` inside a comment or
25
+ * string.
26
+ *
27
+ * Scope: `@page` blocks and the `page:` property are left untouched — they are
28
+ * simply ignored by the screen render (and the PDF export composites the page
29
+ * tiles, so it never consults the author's `@page`). Named-page break values are
30
+ * not real `break-before` keywords, so they need no mapping.
31
+ */
32
+ const IDENT = /[A-Za-z0-9_-]/;
33
+ const SPACE = /\s/;
34
+ /** Apply the break/running rewrites to a run of NORMAL css (no comments, strings,
35
+ * or url() tokens — the segmenter guarantees that). Property names + values are
36
+ * matched with `\b` boundaries so `break-before:pagex` (a longer value) is never
37
+ * partially rewritten. Order matters: the `avoid-page` and legacy `page-break-*`
38
+ * rules run before the generic forced-break rule so each declaration maps once. */
39
+ function rewriteColumnsInNormalCss(s) {
40
+ const lc = (x) => x.toLowerCase();
41
+ // Each property name is left-anchored with `(?<![\w-])` so it matches a WHOLE
42
+ // property, never a substring of a longer one — e.g. a custom property
43
+ // `--page-break-before` or a vendor prefix `-webkit-page-break-before` /
44
+ // `-webkit-column-break-before` (both preceded by `-`) are left untouched rather
45
+ // than mangled into an invalid property. Legitimate declarations are preceded by
46
+ // `{`, `;`, whitespace, a quote, or start-of-string — none of which are `[\w-]`.
47
+ return s
48
+ // position:running(header) → display:none (remove the running source from flow).
49
+ .replace(/(?<![\w-])position\s*:\s*running\([^)]*\)/gi, 'display:none')
50
+ // break-inside:avoid-page → break-inside:avoid (page-specific avoidance → generic).
51
+ .replace(/(?<![\w-])break-(inside|before|after)\s*:\s*avoid-page\b/gi, (_m, d) => `break-${lc(d)}:avoid`)
52
+ // Legacy page-break-* shorthand → modern break-*.
53
+ .replace(/(?<![\w-])page-break-(before|after)\s*:\s*(?:always|left|right|recto|verso|page)\b/gi, (_m, d) => `break-${lc(d)}:column`)
54
+ .replace(/(?<![\w-])page-break-(before|after)\s*:\s*avoid\b/gi, (_m, d) => `break-${lc(d)}:avoid`)
55
+ .replace(/(?<![\w-])page-break-inside\s*:\s*avoid\b/gi, 'break-inside:avoid')
56
+ // Modern forced PAGE break → forced COLUMN break.
57
+ .replace(/(?<![\w-])break-(before|after)\s*:\s*(?:page|always|left|right|recto|verso)\b/gi, (_m, d) => `break-${lc(d)}:column`);
58
+ }
59
+ /**
60
+ * Token-aware rewrite of author CSS for the native-columns compositor. Copies
61
+ * comments / string literals / `url()` tokens through verbatim; rewrites forced
62
+ * page breaks → column breaks and neutralizes `position:running()` only in the
63
+ * normal CSS between them. Idempotent (a second pass finds nothing to change).
64
+ */
65
+ export function rewriteAuthorCssForColumns(css) {
66
+ if (!css)
67
+ return css;
68
+ const len = css.length;
69
+ const isIdent = (c) => c !== undefined && IDENT.test(c);
70
+ const isSpace = (c) => c !== undefined && SPACE.test(c);
71
+ let out = '';
72
+ let normal = '';
73
+ const flush = () => { if (normal) {
74
+ out += rewriteColumnsInNormalCss(normal);
75
+ normal = '';
76
+ } };
77
+ let i = 0;
78
+ while (i < len) {
79
+ const c = css[i];
80
+ // CSS comment — copy through untouched.
81
+ if (c === '/' && css[i + 1] === '*') {
82
+ flush();
83
+ const end = css.indexOf('*/', i + 2);
84
+ const stop = end === -1 ? len : end + 2;
85
+ out += css.slice(i, stop);
86
+ i = stop;
87
+ continue;
88
+ }
89
+ // String literal — copy through (a break/running token inside a string is data).
90
+ if (c === '"' || c === "'") {
91
+ flush();
92
+ let j = i + 1;
93
+ while (j < len) {
94
+ if (css[j] === '\\') {
95
+ j += 2;
96
+ continue;
97
+ }
98
+ if (css[j] === c) {
99
+ j++;
100
+ break;
101
+ }
102
+ j++;
103
+ }
104
+ out += css.slice(i, j);
105
+ i = j;
106
+ continue;
107
+ }
108
+ // url( … ) token — copy through verbatim (only when `url` is a standalone
109
+ // function name, so `myurl(` / `figurl(` are normal text).
110
+ if ((c === 'u' || c === 'U') && css.slice(i, i + 4).toLowerCase() === 'url(' && !isIdent(css[i - 1])) {
111
+ flush();
112
+ let j = i + 4;
113
+ while (j < len && isSpace(css[j]))
114
+ j++;
115
+ if (css[j] === '"' || css[j] === "'") {
116
+ const q = css[j];
117
+ j++;
118
+ while (j < len) {
119
+ if (css[j] === '\\') {
120
+ j += 2;
121
+ continue;
122
+ }
123
+ if (css[j] === q) {
124
+ j++;
125
+ break;
126
+ }
127
+ j++;
128
+ }
129
+ while (j < len && isSpace(css[j]))
130
+ j++;
131
+ if (css[j] === ')')
132
+ j++;
133
+ }
134
+ else {
135
+ while (j < len) {
136
+ if (css[j] === '\\') {
137
+ j += 2;
138
+ continue;
139
+ }
140
+ if (css[j] === ')') {
141
+ j++;
142
+ break;
143
+ }
144
+ j++;
145
+ }
146
+ }
147
+ out += css.slice(i, j);
148
+ i = j;
149
+ continue;
150
+ }
151
+ normal += c;
152
+ i++;
153
+ }
154
+ flush();
155
+ return out;
156
+ }
157
+ //# sourceMappingURL=artifact-columns-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-columns-css.js","sourceRoot":"","sources":["../../src/core/artifact-columns-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;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BACjC,CAAC,EAAE,CAAC;gBACN,CAAC;gBACD,OAAO,CAAC,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBAAE,CAAC,EAAE,CAAC;gBACvC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;oBAAE,CAAC,EAAE,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC;oBACf,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;wBAAC,CAAC,IAAI,CAAC,CAAC;wBAAC,SAAS;oBAAC,CAAC;oBAC1C,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;wBAAC,CAAC,EAAE,CAAC;wBAAC,MAAM;oBAAC,CAAC;oBACnC,CAAC,EAAE,CAAC;gBACN,CAAC;YACH,CAAC;YACD,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACvB,CAAC,GAAG,CAAC,CAAC;YACN,SAAS;QACX,CAAC;QACD,MAAM,IAAI,CAAC,CAAC;QACZ,CAAC,EAAE,CAAC;IACN,CAAC;IACD,KAAK,EAAE,CAAC;IACR,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -38,12 +38,6 @@ export interface FrameDocumentContext {
38
38
  /** Base URL for a headless render so root-relative `/api/assets/...` resolve.
39
39
  * Never set on a downloaded file (it must not phone home). */
40
40
  baseHref?: string;
41
- /** Paged.js source (the `Paged` UMD global). Supplied by the host loader when
42
- * the bundle has any paginated `document` frame; absent otherwise. Injected
43
- * in-sandbox so the platform fragments a document's flowing content stream
44
- * into page boxes (P3.3). Pure @core can't read it from disk, so it threads
45
- * in like `librarySources`. */
46
- pagedSource?: string;
47
41
  /** Opaque per-render id echoed back in the runtime's `frame-pages` message so
48
42
  * the host can drop a stale pagination result from a superseded render (the
49
43
  * double-buffer slot may be reset/reloaded with newer content before a slow
@@ -81,25 +75,73 @@ export declare function isPagesArtifact(bundle: ArtifactBundle): boolean;
81
75
  * present (no stepper). The host (FrameCanvas) imports this so its whiteboard
82
76
  * predicate can't drift from the renderer. */
83
77
  export declare function isWhiteboard(bundle: ArtifactBundle): boolean;
84
- /** Whether a HOST-LESS render (PNG/PDF/inspect/standalone download) should carry
85
- * the Paged.js source to fragment this bundle into a page column. THE single
78
+ /** Rewrite a paginated frame's CSS for the native-columns compositor (forced page
79
+ * breaks column breaks; `position:running()` removed), covering BOTH `<style>`
80
+ * blocks AND inline `style="…"` / `style='…'` attributes. An element with an inline
81
+ * `style="break-before:page"` (the offer-letter signature-block idiom) would
82
+ * otherwise survive un-mapped and only paginate by Chromium's lenient page→column
83
+ * coercion inside multicol — not guaranteed cross-browser. Each value runs through
84
+ * the same token-safe {@link rewriteAuthorCssForColumns}.
85
+ *
86
+ * ONE left-to-right scan over an alternation whose `<style>`-block branch is FIRST,
87
+ * so the scanner consumes a whole style element before it can reach a `style=`
88
+ * literal sitting in that element's CSS text (an `[style]` attribute selector, a
89
+ * `content:"…style=…"` string): only real markup attributes match the inline branch
90
+ * — no double-processing. A style element's text can't contain `</style>`, so the
91
+ * non-greedy block match is safe. (Limitation, mirroring the url() segmenter's: body
92
+ * TEXT shaped exactly like `style="break-before:page"` would also be rewritten; that
93
+ * pathological case is not worth a full HTML parser, and the value itself is still
94
+ * token-safe — strings/url()/comments inside it are preserved. Only QUOTED
95
+ * attribute values are matched; a rare unquoted single-declaration
96
+ * `style=break-before:page` is left to the browser's lenient page→column coercion,
97
+ * as it was before this mapping existed.) */
98
+ export declare function rewritePaginatedContentStyles(html: string): string;
99
+ /** Whether a HOST-LESS render (PNG/PDF/inspect/standalone download) lays this
100
+ * bundle out as a scrolling page COLUMN of compositor-built page tiles. THE single
86
101
  * source of truth for that decision across every host-less caller (the headless
87
102
  * render, the export route, the MCP export tool), so none drifts from the
88
103
  * builder's actual column layout.
89
104
  *
90
105
  * Requires a FULLY-paginated document — every frame is a `pages` frame — with at
91
106
  * least one fixed page box. A MIXED artifact (pages + other layouts) is NOT
92
- * paginated host-less: the column layout ({@link isPagesArtifact}) wouldn't
93
- * apply, so it would fall to the clipped grid AND the render's page-box selector
94
- * would switch to `.pagedjs_page` and drop the non-page frames entirely. Instead
95
- * a mixed artifact renders as the grid with every frame present (the live editor,
96
- * which PROMOTES pages into the grid, is the surface that paginates mixed). This
97
- * also drops the `.some(layout === 'pages')` variants that shipped ~500KB of
98
- * Paged.js for an auto/fill `pages` frame the builder never paginates. */
107
+ * paginated host-less: the column layout ({@link isPagesArtifact}) wouldn't apply,
108
+ * so it would fall to the clipped grid AND the render's page-box selector would
109
+ * switch to the page TILES and drop the non-page frames entirely. Instead a mixed
110
+ * artifact renders as the grid with every frame present (the live editor, which
111
+ * composites pages into the grid, is the surface that paginates mixed). The
112
+ * compositor itself is always inlined (no library to load), so this no longer
113
+ * gates a multi-hundred-KB Paged.js fetch only the host-less COLUMN vs GRID
114
+ * layout choice + the page-box selector. */
99
115
  export declare function bundleNeedsPagination(bundle: ArtifactBundle): boolean;
116
+ interface ResolvedPageMargins {
117
+ top: number;
118
+ right: number;
119
+ bottom: number;
120
+ left: number;
121
+ }
122
+ /** The native-columns geometry for one paginated `pages` frame: the page box
123
+ * (`width`×`height`), the content area inside the margins (`contentWidth`×
124
+ * `contentHeight`), the inter-page gutter in the measurement/clip flow (`gap` =
125
+ * both side margins + a 40px buffer so adjacent pages never visually touch), and
126
+ * the column `pitch` (`contentWidth + gap`). The compositor lays the document
127
+ * body out as one tall multi-column flow of `contentWidth`-wide columns; each
128
+ * column is one page, and translating the flow by `−i*pitch` reveals page `i` in
129
+ * a clipped window. PURE + exported so the arithmetic is unit-testable (the
130
+ * in-browser two-pass measure on top of it can only be covered by e2e). */
131
+ export interface ColumnPageGeometry {
132
+ width: number;
133
+ height: number;
134
+ contentWidth: number;
135
+ contentHeight: number;
136
+ gap: number;
137
+ pitch: number;
138
+ margins: ResolvedPageMargins;
139
+ }
140
+ export declare function columnPageGeometry(frame: ArtifactBundle['frames'][number]): ColumnPageGeometry;
100
141
  /**
101
142
  * Build the single sandboxed-iframe document for a frame-model bundle. Every
102
143
  * surface calls this; `host` selects whether a live host drives chrome/transform
103
144
  * (`iframe`) or the file is self-contained (`none`).
104
145
  */
105
146
  export declare function buildFrameDocument(bundle: ArtifactBundle, ctx: FrameDocumentContext): string;
147
+ export {};