@uniweb/press 0.4.12 → 0.4.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/press",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "description": "Press your React components into downloadable files — Word, Excel, PDF. Registration-based pattern with lazy-loaded format adapters.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -63,7 +63,14 @@ export async function compileEpub(input, options = {}) {
63
63
  const { meta = {}, stylesheet, identifier, cover, loadAsset } = options
64
64
 
65
65
  const resolvedMeta = { ...(metadata || {}), ...meta }
66
- const css = stylesheet || DEFAULT_STYLESHEET
66
+ // Math CSS is emitted ahead of the design stylesheet, not inside it.
67
+ // Temml's MathML needs these rules to lay out at all -- without them a
68
+ // pmatrix's rows touch and an aligned environment's = signs drift -- and a
69
+ // foundation that supplies its own `stylesheet` REPLACES the default, so
70
+ // folding them into DEFAULT_STYLESHEET meant customizing the design
71
+ // silently broke the maths. Emitting first also leaves the foundation's
72
+ // sheet able to override any of it.
73
+ const css = `${MATH_CSS}\n${stylesheet || DEFAULT_STYLESHEET}`
67
74
  const id = identifier || resolvedMeta.identifier || generateUuid()
68
75
  const coverUrl = cover || resolvedMeta.cover || resolvedMeta.coverImage
69
76
 
@@ -626,5 +633,4 @@ pre {
626
633
  overflow: auto;
627
634
  white-space: pre-wrap;
628
635
  }
629
- ${MATH_CSS}
630
636
  `
@@ -131,7 +131,14 @@ async function compileServerSide(htmlDoc, options = {}) {
131
131
  export function emitDocument({ body = '', meta = {}, stylesheet, polyfillUrl } = {}) {
132
132
  const lang = meta.language ?? 'en'
133
133
  const title = meta.title ?? 'Book'
134
- const css = stylesheet || DEFAULT_STYLESHEET
134
+ // Math CSS is emitted ahead of the design stylesheet, not inside it.
135
+ // Temml's MathML needs these rules to lay out at all -- without them a
136
+ // pmatrix's rows touch and an aligned environment's = signs drift -- and a
137
+ // foundation that supplies its own `stylesheet` REPLACES the default, so
138
+ // folding them into DEFAULT_STYLESHEET meant customizing the design
139
+ // silently broke the maths. Emitting first also leaves the foundation's
140
+ // sheet able to override any of it.
141
+ const css = `${MATH_CSS}\n${stylesheet || DEFAULT_STYLESHEET}`
135
142
  const polyfill = polyfillUrl || DEFAULT_POLYFILL_URL
136
143
 
137
144
  return `<!doctype html>
@@ -294,5 +301,4 @@ blockquote {
294
301
  }
295
302
  ul, ol { margin: 0.5em 0 0.75em 1.5em; }
296
303
  figure { break-inside: avoid; }
297
- ${MATH_CSS}
298
304
  `