@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.
- package/README.md +14 -5
- package/lib/fonts/embedded.js +120 -0
- package/lib/fonts/index.js +81 -0
- package/lib/fonts/index.js.map +1 -0
- package/lib/keypad/index.js +15 -17
- package/lib/keypad/index.js.map +1 -1
- package/lib/keys/geometry.js +7 -4
- package/lib/keys/geometry.js.map +1 -1
- package/lib/keys/misc.js +9 -2
- package/lib/keys/misc.js.map +1 -1
- package/lib/latex-bridge.js +48 -3
- package/lib/latex-bridge.js.map +1 -1
- package/lib/mathlive-instance.js +186 -15
- package/lib/mathlive-instance.js.map +1 -1
- package/lib/mf/common-styles.js +74 -10
- package/lib/mf/common-styles.js.map +1 -1
- package/lib/mf/index.js +6 -0
- package/lib/mf/index.js.map +1 -1
- package/lib/mf/input.js +29 -5
- package/lib/mf/input.js.map +1 -1
- package/lib/mf/static.js +105 -7
- package/lib/mf/static.js.map +1 -1
- package/package.json +3 -4
- package/scripts/generate-embedded-fonts.js +94 -0
- package/src/fonts/embedded.js +116 -0
- package/src/fonts/index.js +71 -0
- package/src/keypad/index.jsx +15 -14
- package/src/keys/geometry.js +7 -2
- package/src/keys/misc.js +8 -2
- package/src/latex-bridge.js +52 -3
- package/src/mathlive-instance.js +201 -14
- package/src/mf/common-styles.js +78 -8
- package/src/mf/index.js +2 -0
- package/src/mf/input.jsx +37 -5
- package/src/mf/static.jsx +121 -6
- package/CHANGELOG.md +0 -26
- package/LICENSE.md +0 -5
- package/src/__tests__/drop-in-compat.test.jsx +0 -112
- package/src/__tests__/index.test.jsx +0 -109
- package/src/__tests__/input-imperative.test.jsx +0 -144
- package/src/__tests__/keypad-label.test.jsx +0 -57
- package/src/__tests__/latex-bridge.test.js +0 -230
- 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/
|
|
118
|
-
configureFonts(null); //
|
|
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`.
|
|
122
|
-
|
|
123
|
-
|
|
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
|