@zzish/math-rich-input 0.1.58 → 0.1.59

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/README.md CHANGED
@@ -36,6 +36,28 @@ export default class App extends Component {
36
36
  }
37
37
  ```
38
38
 
39
+ ### KaTeX stylesheet
40
+
41
+ The field draws formulas with KaTeX and puts KaTeX's stylesheet on the page itself, as `<style id="katex-css">`,
42
+ when the first field mounts (and, in the standalone build, when the element is defined). It is the stylesheet of
43
+ `katex@0.11.1`, the one the field has always used, carried inside the package with its woff2 fonts inlined:
44
+ nothing is fetched from a CDN, and nothing arrives late to resize a field that was already drawn.
45
+
46
+ Up to 0.1.58 the same stylesheet was appended from `cdn.jsdelivr.net`. Hosts keep exactly the look they had.
47
+ A host that wants its own KaTeX stylesheet instead puts it on the page under the id `katex-css` first; the field
48
+ then adds nothing.
49
+
50
+ `src/katexStylesheet.generated.js` is built from the pinned `katex-0.11.1` dev dependency by
51
+ `scripts/build-katex-stylesheet.js`, which `npm run build` and `npm test` run first.
52
+
53
+ ### Custom element: drawn before the first paint
54
+
55
+ `<math-rich-input>` (the standalone build) draws its first render synchronously, before the browser
56
+ can paint, wherever it is connected from — inside a click, in a framework's microtask flush, or when
57
+ the bundle arrives and upgrades fields already on the page. Until 0.1.58 a field connected outside a
58
+ discrete event was drawn later, in React's scheduled slices: a host showed empty fields that filled
59
+ one at a time.
60
+
39
61
  ### Normal usage
40
62
 
41
63
  ```js