@pie-lib/math-input-mathlive 1.1.3 → 1.1.5-beta.1

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 (43) hide show
  1. package/README.md +14 -5
  2. package/lib/fonts/embedded.js +120 -0
  3. package/lib/fonts/index.js +81 -0
  4. package/lib/fonts/index.js.map +1 -0
  5. package/lib/keypad/index.js +15 -17
  6. package/lib/keypad/index.js.map +1 -1
  7. package/lib/keys/geometry.js +7 -4
  8. package/lib/keys/geometry.js.map +1 -1
  9. package/lib/keys/misc.js +9 -2
  10. package/lib/keys/misc.js.map +1 -1
  11. package/lib/latex-bridge.js +48 -3
  12. package/lib/latex-bridge.js.map +1 -1
  13. package/lib/mathlive-instance.js +186 -15
  14. package/lib/mathlive-instance.js.map +1 -1
  15. package/lib/mf/common-styles.js +74 -10
  16. package/lib/mf/common-styles.js.map +1 -1
  17. package/lib/mf/index.js +6 -0
  18. package/lib/mf/index.js.map +1 -1
  19. package/lib/mf/input.js +29 -5
  20. package/lib/mf/input.js.map +1 -1
  21. package/lib/mf/static.js +105 -7
  22. package/lib/mf/static.js.map +1 -1
  23. package/package.json +3 -4
  24. package/scripts/generate-embedded-fonts.js +94 -0
  25. package/src/fonts/embedded.js +116 -0
  26. package/src/fonts/index.js +71 -0
  27. package/src/keypad/index.jsx +15 -14
  28. package/src/keys/geometry.js +7 -2
  29. package/src/keys/misc.js +8 -2
  30. package/src/latex-bridge.js +52 -3
  31. package/src/mathlive-instance.js +201 -14
  32. package/src/mf/common-styles.js +78 -8
  33. package/src/mf/index.js +2 -0
  34. package/src/mf/input.jsx +37 -5
  35. package/src/mf/static.jsx +121 -6
  36. package/CHANGELOG.md +0 -26
  37. package/LICENSE.md +0 -5
  38. package/src/__tests__/drop-in-compat.test.jsx +0 -112
  39. package/src/__tests__/index.test.jsx +0 -109
  40. package/src/__tests__/input-imperative.test.jsx +0 -144
  41. package/src/__tests__/keypad-label.test.jsx +0 -57
  42. package/src/__tests__/latex-bridge.test.js +0 -230
  43. package/src/__tests__/mathlive-instance.test.js +0 -181
package/README.md CHANGED
@@ -108,19 +108,28 @@ widget do not port and need a redesign (`mf.getElementInfo()` exposes per-elemen
108
108
  corrupt these fonts (it emits a JS module under a `.woff2` name). Exclude
109
109
  mathlive from such rules - see `packages/demo/next.config.js`.
110
110
 
111
+ **Fonts are required, not cosmetic.** Some symbols are composed from Private
112
+ Use Area glyphs that exist only in the KaTeX fonts: `\neq` is U+E020 (a
113
+ negation slash) overlapped on `=`, and `\nsim` / `\ncong` are the same. With
114
+ no fonts the browser substitutes an arbitrary glyph for U+E020, so those keys
115
+ render as garbage rather than in a plainer face.
116
+
111
117
  **Alternative** - serve the fonts yourself (a static path, or a CDN):
112
118
 
113
119
  ```js
114
120
  import { configureFonts } from '@pie-lib/math-input-mathlive';
115
121
 
116
122
  configureFonts('/mathlive-fonts'); // before loadMathLive()
117
- configureFonts('https://unpkg.com/mathlive@0.110.0/dist/fonts');
118
- configureFonts(null); // system fonts
123
+ configureFonts('https://unpkg.com/mathlive@0.110.0/fonts'); // note: /fonts, /dist/fonts 404s
124
+ configureFonts(null); // opt out; \neq and friends will render incorrectly
119
125
  ```
120
126
 
121
- Paths are resolved to absolute URLs against `document.baseURI`. If you neither
122
- import the stylesheet nor call `configureFonts`, the package disables font
123
- loading rather than leaving MathLive's crashing default in place.
127
+ Paths are resolved to absolute URLs against `document.baseURI`.
128
+
129
+ If you neither import the stylesheet nor call `configureFonts`, the package
130
+ falls back to a **version-pinned CDN** - `https://unpkg.com/mathlive@<engine
131
+ version>/fonts` - so those glyph-dependent symbols still render. Serve the
132
+ fonts yourself to avoid the third-party request.
124
133
 
125
134
  - **Custom macros.** `PIE_MACROS` covers the pie-specific commands the MathQuill
126
135
  fork understood (`\parallelogram`, `\longdiv`, `\napprox`, …) and is kept in