@pie-lib/math-input-mathlive 1.1.5-beta.9 → 2.0.1-next.20261107131445

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 (195) hide show
  1. package/README.md +84 -109
  2. package/dist/_virtual/_rolldown/runtime.js +11 -0
  3. package/dist/horizontal-keypad.d.ts +22 -0
  4. package/dist/horizontal-keypad.js +54 -0
  5. package/dist/index.d.ts +20 -0
  6. package/dist/index.js +12 -0
  7. package/dist/keypad/index.d.ts +40 -0
  8. package/dist/keypad/index.js +245 -0
  9. package/dist/keypad/keys-layout.d.ts +7 -0
  10. package/dist/keypad/keys-layout.js +5 -0
  11. package/dist/keys/basic-operators.d.ts +5 -0
  12. package/dist/keys/basic-operators.js +30 -0
  13. package/dist/keys/chars.d.ts +5 -0
  14. package/dist/keys/comparison.d.ts +4 -0
  15. package/dist/keys/comparison.js +32 -0
  16. package/dist/keys/constants.d.ts +4 -0
  17. package/dist/keys/constants.js +35 -0
  18. package/dist/keys/digits.d.ts +15 -0
  19. package/dist/keys/digits.js +34 -0
  20. package/dist/keys/edit.d.ts +6 -0
  21. package/dist/keys/edit.js +9 -0
  22. package/dist/keys/exponent.d.ts +4 -0
  23. package/dist/keys/exponent.js +28 -0
  24. package/dist/keys/fractions.d.ts +3 -0
  25. package/dist/keys/fractions.js +27 -0
  26. package/dist/keys/geometry.d.ts +23 -0
  27. package/dist/keys/geometry.js +127 -0
  28. package/dist/keys/grades.d.ts +9 -0
  29. package/dist/keys/grades.js +414 -0
  30. package/dist/keys/index.d.ts +6 -0
  31. package/dist/keys/index.js +50 -0
  32. package/dist/keys/log.d.ts +3 -0
  33. package/dist/keys/log.js +25 -0
  34. package/dist/keys/logic.d.ts +2 -0
  35. package/dist/keys/logic.js +13 -0
  36. package/dist/keys/matrices.d.ts +2 -0
  37. package/dist/keys/matrices.js +17 -0
  38. package/dist/keys/misc.d.ts +10 -0
  39. package/dist/keys/misc.js +60 -0
  40. package/dist/keys/navigation.d.ts +2 -0
  41. package/dist/keys/navigation.js +13 -0
  42. package/dist/keys/operators.d.ts +1 -0
  43. package/dist/keys/operators.js +11 -0
  44. package/dist/keys/statistics.d.ts +5 -0
  45. package/dist/keys/statistics.js +38 -0
  46. package/dist/keys/sub-sup.d.ts +2 -0
  47. package/dist/keys/sub-sup.js +17 -0
  48. package/dist/keys/trigonometry.d.ts +6 -0
  49. package/dist/keys/trigonometry.js +43 -0
  50. package/dist/keys/utils.d.ts +5 -0
  51. package/dist/keys/utils.js +24 -0
  52. package/dist/keys/vars.d.ts +3 -0
  53. package/dist/keys/vars.js +22 -0
  54. package/dist/latex-bridge.d.ts +197 -0
  55. package/dist/latex-bridge.js +210 -0
  56. package/dist/longdiv.d.ts +24 -0
  57. package/dist/longdiv.js +43 -0
  58. package/dist/math-input.d.ts +26 -0
  59. package/dist/math-input.js +74 -0
  60. package/dist/mathlive-instance.d.ts +221 -0
  61. package/dist/mathlive-instance.js +159 -0
  62. package/dist/mf/common-styles.d.ts +594 -0
  63. package/dist/mf/common-styles.js +80 -0
  64. package/dist/mf/field-label.d.ts +16 -0
  65. package/dist/mf/field-label.js +13 -0
  66. package/dist/mf/index.d.ts +4 -0
  67. package/dist/mf/index.js +21 -0
  68. package/dist/mf/input.d.ts +94 -0
  69. package/dist/mf/input.js +127 -0
  70. package/dist/mf/static.d.ts +143 -0
  71. package/dist/mf/static.js +230 -0
  72. package/dist/selection.d.ts +43 -0
  73. package/dist/selection.js +39 -0
  74. package/package.json +32 -18
  75. package/lib/__tests__/composites.test.js +0 -255
  76. package/lib/__tests__/drop-in-compat.test.js +0 -133
  77. package/lib/__tests__/embedded-fonts.test.js +0 -121
  78. package/lib/__tests__/index.test.js +0 -118
  79. package/lib/__tests__/input-imperative.test.js +0 -155
  80. package/lib/__tests__/keypad-label.test.js +0 -231
  81. package/lib/__tests__/keypad-render.test.js +0 -206
  82. package/lib/__tests__/latex-bridge.test.js +0 -386
  83. package/lib/__tests__/mathlive-instance.test.js +0 -419
  84. package/lib/__tests__/mount-race.test.js +0 -218
  85. package/lib/__tests__/static-prompts.test.js +0 -405
  86. package/lib/__tests__/tmp-markup.test.js +0 -26
  87. package/lib/horizontal-keypad.js +0 -101
  88. package/lib/horizontal-keypad.js.map +0 -1
  89. package/lib/index.js +0 -143
  90. package/lib/index.js.map +0 -1
  91. package/lib/keypad/index.js +0 -431
  92. package/lib/keypad/index.js.map +0 -1
  93. package/lib/keypad/keys-layout.js +0 -22
  94. package/lib/keypad/keys-layout.js.map +0 -1
  95. package/lib/keys/basic-operators.js +0 -33
  96. package/lib/keys/basic-operators.js.map +0 -1
  97. package/lib/keys/chars.js +0 -12
  98. package/lib/keys/chars.js.map +0 -1
  99. package/lib/keys/comparison.js +0 -39
  100. package/lib/keys/comparison.js.map +0 -1
  101. package/lib/keys/constants.js +0 -37
  102. package/lib/keys/constants.js.map +0 -1
  103. package/lib/keys/digits.js +0 -46
  104. package/lib/keys/digits.js.map +0 -1
  105. package/lib/keys/edit.js +0 -14
  106. package/lib/keys/edit.js.map +0 -1
  107. package/lib/keys/exponent.js +0 -30
  108. package/lib/keys/exponent.js.map +0 -1
  109. package/lib/keys/fractions.js +0 -29
  110. package/lib/keys/fractions.js.map +0 -1
  111. package/lib/keys/geometry.js +0 -143
  112. package/lib/keys/geometry.js.map +0 -1
  113. package/lib/keys/grades.js +0 -259
  114. package/lib/keys/grades.js.map +0 -1
  115. package/lib/keys/index.js +0 -35
  116. package/lib/keys/index.js.map +0 -1
  117. package/lib/keys/log.js +0 -27
  118. package/lib/keys/log.js.map +0 -1
  119. package/lib/keys/logic.js +0 -19
  120. package/lib/keys/logic.js.map +0 -1
  121. package/lib/keys/matrices.js +0 -19
  122. package/lib/keys/matrices.js.map +0 -1
  123. package/lib/keys/misc.js +0 -69
  124. package/lib/keys/misc.js.map +0 -1
  125. package/lib/keys/navigation.js +0 -20
  126. package/lib/keys/navigation.js.map +0 -1
  127. package/lib/keys/operators.js +0 -15
  128. package/lib/keys/operators.js.map +0 -1
  129. package/lib/keys/statistics.js +0 -40
  130. package/lib/keys/statistics.js.map +0 -1
  131. package/lib/keys/sub-sup.js +0 -19
  132. package/lib/keys/sub-sup.js.map +0 -1
  133. package/lib/keys/trigonometry.js +0 -45
  134. package/lib/keys/trigonometry.js.map +0 -1
  135. package/lib/keys/utils.js +0 -87
  136. package/lib/keys/utils.js.map +0 -1
  137. package/lib/keys/vars.js +0 -24
  138. package/lib/keys/vars.js.map +0 -1
  139. package/lib/latex-bridge.js +0 -508
  140. package/lib/latex-bridge.js.map +0 -1
  141. package/lib/math-input.js +0 -143
  142. package/lib/math-input.js.map +0 -1
  143. package/lib/mathlive-instance.js +0 -585
  144. package/lib/mathlive-instance.js.map +0 -1
  145. package/lib/mf/common-styles.js +0 -203
  146. package/lib/mf/common-styles.js.map +0 -1
  147. package/lib/mf/index.js +0 -84
  148. package/lib/mf/index.js.map +0 -1
  149. package/lib/mf/input.js +0 -364
  150. package/lib/mf/input.js.map +0 -1
  151. package/lib/mf/static.js +0 -500
  152. package/lib/mf/static.js.map +0 -1
  153. package/src/__tests__/composites.test.jsx +0 -220
  154. package/src/__tests__/drop-in-compat.test.jsx +0 -112
  155. package/src/__tests__/index.test.jsx +0 -109
  156. package/src/__tests__/input-imperative.test.jsx +0 -144
  157. package/src/__tests__/keypad-label.test.jsx +0 -283
  158. package/src/__tests__/keypad-render.test.jsx +0 -123
  159. package/src/__tests__/latex-bridge.test.js +0 -389
  160. package/src/__tests__/mathlive-instance.test.js +0 -418
  161. package/src/__tests__/mount-race.test.jsx +0 -142
  162. package/src/__tests__/static-prompts.test.jsx +0 -364
  163. package/src/horizontal-keypad.jsx +0 -73
  164. package/src/index.jsx +0 -63
  165. package/src/keypad/index.jsx +0 -386
  166. package/src/keypad/keys-layout.js +0 -16
  167. package/src/keys/basic-operators.js +0 -32
  168. package/src/keys/chars.js +0 -5
  169. package/src/keys/comparison.js +0 -28
  170. package/src/keys/constants.js +0 -35
  171. package/src/keys/digits.js +0 -40
  172. package/src/keys/edit.js +0 -3
  173. package/src/keys/exponent.js +0 -28
  174. package/src/keys/fractions.js +0 -26
  175. package/src/keys/geometry.js +0 -149
  176. package/src/keys/grades.js +0 -367
  177. package/src/keys/index.js +0 -20
  178. package/src/keys/log.js +0 -22
  179. package/src/keys/logic.js +0 -15
  180. package/src/keys/matrices.js +0 -15
  181. package/src/keys/misc.js +0 -71
  182. package/src/keys/navigation.js +0 -8
  183. package/src/keys/operators.js +0 -10
  184. package/src/keys/statistics.js +0 -38
  185. package/src/keys/sub-sup.js +0 -15
  186. package/src/keys/trigonometry.js +0 -15
  187. package/src/keys/utils.js +0 -66
  188. package/src/keys/vars.js +0 -19
  189. package/src/latex-bridge.js +0 -524
  190. package/src/math-input.jsx +0 -115
  191. package/src/mathlive-instance.js +0 -582
  192. package/src/mf/common-styles.js +0 -210
  193. package/src/mf/index.js +0 -30
  194. package/src/mf/input.jsx +0 -319
  195. package/src/mf/static.jsx +0 -479
@@ -0,0 +1,594 @@
1
+ /**
2
+ * Shared MathLive styling.
3
+ *
4
+ * Replaces @pie-lib/math-input's `common-mq-styles.js`. That file was built
5
+ * around MathQuill's `.mq-*` class names, none of which exist in MathLive
6
+ * output, so the selectors here target MathLive's own structure instead.
7
+ *
8
+ * The four named groups are kept because consumers destructure them:
9
+ *
10
+ * const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles }
11
+ * = mq.CommonMqStyles; // math-toolbar/src/editor-and-pad.jsx, math-preview.jsx
12
+ *
13
+ * Most are intentionally near-empty: MathLive sizes scripts, radicals and
14
+ * fences correctly on its own, so the MathQuill-era corrections are not needed.
15
+ * They stay as documented extension points rather than being deleted, so the
16
+ * destructuring above keeps working. The exception is the radical index, which
17
+ * MathLive sizes to TeX metrics that read too small here - see
18
+ * `rootIndexStyles`.
19
+ */
20
+ /**
21
+ * Font styling. MathQuill needed explicit MathJax font families to match the
22
+ * static renderer; MathLive ships the KaTeX fonts it renders with, so this only
23
+ * smooths rendering and lets the host override the family.
24
+ */
25
+ export declare const commonMqFontStyles: {
26
+ '-webkit-font-smoothing': string;
27
+ '& math-field': {
28
+ fontFamily: string;
29
+ };
30
+ };
31
+ /**
32
+ * Long division. The MathQuill fork drew this with nested `.mq-longdiv-*`
33
+ * elements that needed manual offsets; here it comes from the `\longdiv` macro
34
+ * (see `PIE_MACROS`), tagged with `data-pie-macro="longdiv"`.
35
+ */
36
+ export declare const longdivStyles: {
37
+ '& [data-pie-macro="longdiv"]': {
38
+ display: string;
39
+ };
40
+ };
41
+ export declare const rootIndexStyles: {
42
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
43
+ fontSize: string;
44
+ };
45
+ };
46
+ /**
47
+ * The same rule as a CSS string, for a live mathfield's shadow root - see
48
+ * `SHADOW_CSS` in mathlive-instance.js. Static markup is styled by
49
+ * {@link rootIndexStyles}.
50
+ */
51
+ export declare const ROOT_INDEX_CSS = ".ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]{font-size:80% !important}";
52
+ export declare const parallelStyles: {
53
+ "& [data-pie-macro=\"parallel\"]": {
54
+ fontSize: string;
55
+ };
56
+ };
57
+ /** The same rule as a CSS string, for a live mathfield's shadow root. */
58
+ export declare const PARALLEL_CSS = "[data-pie-macro=\"parallel\"]{font-size:1.4em}";
59
+ /**
60
+ * Superscript/subscript sizing. MathLive follows TeX metrics for scripts, so the
61
+ * MathQuill-era corrections are gone; the radical index is the one place where a
62
+ * TeX-correct size reads too small in the authoring UI.
63
+ */
64
+ export declare const supsubStyles: {
65
+ "& [data-pie-macro=\"parallel\"]": {
66
+ fontSize: string;
67
+ };
68
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
69
+ fontSize: string;
70
+ };
71
+ };
72
+ /** Empty placeholder boxes (answer blocks / open slots). */
73
+ export declare const placeholderStyles: {
74
+ '& .ML__placeholder': {
75
+ borderBottom: string;
76
+ minWidth: string;
77
+ };
78
+ '& [data-pie-empty]': {
79
+ opacity: number;
80
+ };
81
+ '& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line': {
82
+ position: string;
83
+ top: string;
84
+ };
85
+ '& .ML__mfrac:has([data-pie-empty]) .ML__frac-line': {
86
+ position: string;
87
+ top: string;
88
+ };
89
+ '& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line': {
90
+ top: string;
91
+ };
92
+ '& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line': {
93
+ top: string;
94
+ };
95
+ '& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)': {
96
+ top: string;
97
+ };
98
+ '& .overline .overline-line': {
99
+ position: string;
100
+ };
101
+ '& .overline .overline-line:before': {
102
+ content: string;
103
+ display: string;
104
+ position: string;
105
+ left: number;
106
+ right: number;
107
+ top: string;
108
+ height: string;
109
+ border: string;
110
+ background: string;
111
+ WebkitMask: string;
112
+ mask: string;
113
+ };
114
+ '& .overline .overline-line:after': {
115
+ display: string;
116
+ };
117
+ '& .ML__base': {
118
+ position: string;
119
+ };
120
+ '& .ML__stretchy': {
121
+ position: string;
122
+ left: number;
123
+ width: string;
124
+ };
125
+ '& .ML__center:has(.ML__stretchy)': {
126
+ marginLeft: string;
127
+ };
128
+ };
129
+ /**
130
+ * Styling for the on-screen keyboard and any container rendering math labels.
131
+ * Also hides MathLive's own affordances, since pie supplies its own keypad.
132
+ */
133
+ export declare const commonMqKeyboardStyles: {
134
+ touchAction: string;
135
+ '& math-field': {
136
+ fontSize: string;
137
+ outline: string;
138
+ };
139
+ '& math-field::part(virtual-keyboard-toggle)': {
140
+ display: string;
141
+ };
142
+ '& math-field::part(menu-toggle)': {
143
+ display: string;
144
+ };
145
+ '& .ML__placeholder': {
146
+ borderBottom: string;
147
+ minWidth: string;
148
+ };
149
+ '& [data-pie-empty]': {
150
+ opacity: number;
151
+ };
152
+ '& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line': {
153
+ position: string;
154
+ top: string;
155
+ };
156
+ '& .ML__mfrac:has([data-pie-empty]) .ML__frac-line': {
157
+ position: string;
158
+ top: string;
159
+ };
160
+ '& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line': {
161
+ top: string;
162
+ };
163
+ '& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line': {
164
+ top: string;
165
+ };
166
+ '& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)': {
167
+ top: string;
168
+ };
169
+ '& .overline .overline-line': {
170
+ position: string;
171
+ };
172
+ '& .overline .overline-line:before': {
173
+ content: string;
174
+ display: string;
175
+ position: string;
176
+ left: number;
177
+ right: number;
178
+ top: string;
179
+ height: string;
180
+ border: string;
181
+ background: string;
182
+ WebkitMask: string;
183
+ mask: string;
184
+ };
185
+ '& .overline .overline-line:after': {
186
+ display: string;
187
+ };
188
+ '& .ML__base': {
189
+ position: string;
190
+ };
191
+ '& .ML__stretchy': {
192
+ position: string;
193
+ left: number;
194
+ width: string;
195
+ };
196
+ '& .ML__center:has(.ML__stretchy)': {
197
+ marginLeft: string;
198
+ };
199
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
200
+ fontSize: string;
201
+ };
202
+ '& [data-pie-macro="longdiv"]': {
203
+ display: string;
204
+ };
205
+ '-webkit-font-smoothing': string;
206
+ };
207
+ /** Everything combined - the common case for a container of math. */
208
+ export declare const commonMathLiveStyles: {
209
+ '& math-field': {
210
+ fontSize: string;
211
+ outline: string;
212
+ };
213
+ '& math-field::part(virtual-keyboard-toggle)': {
214
+ display: string;
215
+ };
216
+ '& math-field::part(menu-toggle)': {
217
+ display: string;
218
+ };
219
+ '& .ML__placeholder': {
220
+ borderBottom: string;
221
+ minWidth: string;
222
+ };
223
+ '& [data-pie-empty]': {
224
+ opacity: number;
225
+ };
226
+ '& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line': {
227
+ position: string;
228
+ top: string;
229
+ };
230
+ '& .ML__mfrac:has([data-pie-empty]) .ML__frac-line': {
231
+ position: string;
232
+ top: string;
233
+ };
234
+ '& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line': {
235
+ top: string;
236
+ };
237
+ '& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line': {
238
+ top: string;
239
+ };
240
+ '& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)': {
241
+ top: string;
242
+ };
243
+ '& .overline .overline-line': {
244
+ position: string;
245
+ };
246
+ '& .overline .overline-line:before': {
247
+ content: string;
248
+ display: string;
249
+ position: string;
250
+ left: number;
251
+ right: number;
252
+ top: string;
253
+ height: string;
254
+ border: string;
255
+ background: string;
256
+ WebkitMask: string;
257
+ mask: string;
258
+ };
259
+ '& .overline .overline-line:after': {
260
+ display: string;
261
+ };
262
+ '& .ML__base': {
263
+ position: string;
264
+ };
265
+ '& .ML__stretchy': {
266
+ position: string;
267
+ left: number;
268
+ width: string;
269
+ };
270
+ '& .ML__center:has(.ML__stretchy)': {
271
+ marginLeft: string;
272
+ };
273
+ "& [data-pie-macro=\"parallel\"]": {
274
+ fontSize: string;
275
+ };
276
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
277
+ fontSize: string;
278
+ };
279
+ '& [data-pie-macro="longdiv"]': {
280
+ display: string;
281
+ };
282
+ '-webkit-font-smoothing': string;
283
+ };
284
+ export declare const commonKeyboardStyles: {
285
+ touchAction: string;
286
+ '& math-field': {
287
+ fontSize: string;
288
+ outline: string;
289
+ };
290
+ '& math-field::part(virtual-keyboard-toggle)': {
291
+ display: string;
292
+ };
293
+ '& math-field::part(menu-toggle)': {
294
+ display: string;
295
+ };
296
+ '& .ML__placeholder': {
297
+ borderBottom: string;
298
+ minWidth: string;
299
+ };
300
+ '& [data-pie-empty]': {
301
+ opacity: number;
302
+ };
303
+ '& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line': {
304
+ position: string;
305
+ top: string;
306
+ };
307
+ '& .ML__mfrac:has([data-pie-empty]) .ML__frac-line': {
308
+ position: string;
309
+ top: string;
310
+ };
311
+ '& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line': {
312
+ top: string;
313
+ };
314
+ '& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line': {
315
+ top: string;
316
+ };
317
+ '& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)': {
318
+ top: string;
319
+ };
320
+ '& .overline .overline-line': {
321
+ position: string;
322
+ };
323
+ '& .overline .overline-line:before': {
324
+ content: string;
325
+ display: string;
326
+ position: string;
327
+ left: number;
328
+ right: number;
329
+ top: string;
330
+ height: string;
331
+ border: string;
332
+ background: string;
333
+ WebkitMask: string;
334
+ mask: string;
335
+ };
336
+ '& .overline .overline-line:after': {
337
+ display: string;
338
+ };
339
+ '& .ML__base': {
340
+ position: string;
341
+ };
342
+ '& .ML__stretchy': {
343
+ position: string;
344
+ left: number;
345
+ width: string;
346
+ };
347
+ '& .ML__center:has(.ML__stretchy)': {
348
+ marginLeft: string;
349
+ };
350
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
351
+ fontSize: string;
352
+ };
353
+ '& [data-pie-macro="longdiv"]': {
354
+ display: string;
355
+ };
356
+ '-webkit-font-smoothing': string;
357
+ };
358
+ /**
359
+ * Default export mirrors @pie-lib/math-input's `CommonMqStyles` object so
360
+ * existing destructuring keeps working.
361
+ */
362
+ declare const _default: {
363
+ commonMqFontStyles: {
364
+ '-webkit-font-smoothing': string;
365
+ '& math-field': {
366
+ fontFamily: string;
367
+ };
368
+ };
369
+ longdivStyles: {
370
+ '& [data-pie-macro="longdiv"]': {
371
+ display: string;
372
+ };
373
+ };
374
+ rootIndexStyles: {
375
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
376
+ fontSize: string;
377
+ };
378
+ };
379
+ supsubStyles: {
380
+ "& [data-pie-macro=\"parallel\"]": {
381
+ fontSize: string;
382
+ };
383
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
384
+ fontSize: string;
385
+ };
386
+ };
387
+ commonMqKeyboardStyles: {
388
+ touchAction: string;
389
+ '& math-field': {
390
+ fontSize: string;
391
+ outline: string;
392
+ };
393
+ '& math-field::part(virtual-keyboard-toggle)': {
394
+ display: string;
395
+ };
396
+ '& math-field::part(menu-toggle)': {
397
+ display: string;
398
+ };
399
+ '& .ML__placeholder': {
400
+ borderBottom: string;
401
+ minWidth: string;
402
+ };
403
+ '& [data-pie-empty]': {
404
+ opacity: number;
405
+ };
406
+ '& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line': {
407
+ position: string;
408
+ top: string;
409
+ };
410
+ '& .ML__mfrac:has([data-pie-empty]) .ML__frac-line': {
411
+ position: string;
412
+ top: string;
413
+ };
414
+ '& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line': {
415
+ top: string;
416
+ };
417
+ '& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line': {
418
+ top: string;
419
+ };
420
+ '& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)': {
421
+ top: string;
422
+ };
423
+ '& .overline .overline-line': {
424
+ position: string;
425
+ };
426
+ '& .overline .overline-line:before': {
427
+ content: string;
428
+ display: string;
429
+ position: string;
430
+ left: number;
431
+ right: number;
432
+ top: string;
433
+ height: string;
434
+ border: string;
435
+ background: string;
436
+ WebkitMask: string;
437
+ mask: string;
438
+ };
439
+ '& .overline .overline-line:after': {
440
+ display: string;
441
+ };
442
+ '& .ML__base': {
443
+ position: string;
444
+ };
445
+ '& .ML__stretchy': {
446
+ position: string;
447
+ left: number;
448
+ width: string;
449
+ };
450
+ '& .ML__center:has(.ML__stretchy)': {
451
+ marginLeft: string;
452
+ };
453
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
454
+ fontSize: string;
455
+ };
456
+ '& [data-pie-macro="longdiv"]': {
457
+ display: string;
458
+ };
459
+ '-webkit-font-smoothing': string;
460
+ };
461
+ placeholderStyles: {
462
+ '& .ML__placeholder': {
463
+ borderBottom: string;
464
+ minWidth: string;
465
+ };
466
+ '& [data-pie-empty]': {
467
+ opacity: number;
468
+ };
469
+ '& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line': {
470
+ position: string;
471
+ top: string;
472
+ };
473
+ '& .ML__mfrac:has([data-pie-empty]) .ML__frac-line': {
474
+ position: string;
475
+ top: string;
476
+ };
477
+ '& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line': {
478
+ top: string;
479
+ };
480
+ '& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line': {
481
+ top: string;
482
+ };
483
+ '& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)': {
484
+ top: string;
485
+ };
486
+ '& .overline .overline-line': {
487
+ position: string;
488
+ };
489
+ '& .overline .overline-line:before': {
490
+ content: string;
491
+ display: string;
492
+ position: string;
493
+ left: number;
494
+ right: number;
495
+ top: string;
496
+ height: string;
497
+ border: string;
498
+ background: string;
499
+ WebkitMask: string;
500
+ mask: string;
501
+ };
502
+ '& .overline .overline-line:after': {
503
+ display: string;
504
+ };
505
+ '& .ML__base': {
506
+ position: string;
507
+ };
508
+ '& .ML__stretchy': {
509
+ position: string;
510
+ left: number;
511
+ width: string;
512
+ };
513
+ '& .ML__center:has(.ML__stretchy)': {
514
+ marginLeft: string;
515
+ };
516
+ };
517
+ commonMathLiveStyles: {
518
+ '& math-field': {
519
+ fontSize: string;
520
+ outline: string;
521
+ };
522
+ '& math-field::part(virtual-keyboard-toggle)': {
523
+ display: string;
524
+ };
525
+ '& math-field::part(menu-toggle)': {
526
+ display: string;
527
+ };
528
+ '& .ML__placeholder': {
529
+ borderBottom: string;
530
+ minWidth: string;
531
+ };
532
+ '& [data-pie-empty]': {
533
+ opacity: number;
534
+ };
535
+ '& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line': {
536
+ position: string;
537
+ top: string;
538
+ };
539
+ '& .ML__mfrac:has([data-pie-empty]) .ML__frac-line': {
540
+ position: string;
541
+ top: string;
542
+ };
543
+ '& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line': {
544
+ top: string;
545
+ };
546
+ '& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line': {
547
+ top: string;
548
+ };
549
+ '& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)': {
550
+ top: string;
551
+ };
552
+ '& .overline .overline-line': {
553
+ position: string;
554
+ };
555
+ '& .overline .overline-line:before': {
556
+ content: string;
557
+ display: string;
558
+ position: string;
559
+ left: number;
560
+ right: number;
561
+ top: string;
562
+ height: string;
563
+ border: string;
564
+ background: string;
565
+ WebkitMask: string;
566
+ mask: string;
567
+ };
568
+ '& .overline .overline-line:after': {
569
+ display: string;
570
+ };
571
+ '& .ML__base': {
572
+ position: string;
573
+ };
574
+ '& .ML__stretchy': {
575
+ position: string;
576
+ left: number;
577
+ width: string;
578
+ };
579
+ '& .ML__center:has(.ML__stretchy)': {
580
+ marginLeft: string;
581
+ };
582
+ "& [data-pie-macro=\"parallel\"]": {
583
+ fontSize: string;
584
+ };
585
+ "& .ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]": {
586
+ fontSize: string;
587
+ };
588
+ '& [data-pie-macro="longdiv"]': {
589
+ display: string;
590
+ };
591
+ '-webkit-font-smoothing': string;
592
+ };
593
+ };
594
+ export default _default;
@@ -0,0 +1,80 @@
1
+ //#region src/mf/common-styles.ts
2
+ var e = {
3
+ "-webkit-font-smoothing": "antialiased",
4
+ "& math-field": { fontFamily: "inherit" }
5
+ }, t = { "& [data-pie-macro=\"longdiv\"]": { display: "inline-flex" } }, n = ".ML__sqrt-index > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span > [style*=\"font-size\"]", r = "80%", i = { [`& ${n}`]: { fontSize: `${r} !important` } }, a = `${n}{font-size:${r} !important}`, o = "[data-pie-macro=\"parallel\"]", s = "1.4em", c = { [`& ${o}`]: { fontSize: s } }, l = `${o}{font-size:${s}}`, u = {
6
+ ...i,
7
+ ...c
8
+ }, d = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 522' preserveAspectRatio='none'%3E%3Crect y='241' width='100' height='40'/%3E%3C/svg%3E\") 0 0/100% 100% no-repeat", f = {
9
+ "& .ML__placeholder": {
10
+ borderBottom: "1px solid currentColor",
11
+ minWidth: "1em"
12
+ },
13
+ "& [data-pie-empty]": { opacity: .5 },
14
+ "& .ML__mfrac:not(:has([data-pie-empty])) .ML__frac-line": {
15
+ position: "relative",
16
+ top: "0.04em"
17
+ },
18
+ "& .ML__mfrac:has([data-pie-empty]) .ML__frac-line": {
19
+ position: "relative",
20
+ top: "0.14em"
21
+ },
22
+ "& .ML__mfrac:has([data-pie-empty]):not(:has(.ML__center ~ .ML__center [data-pie-empty])) .ML__frac-line": { top: "0.13em" },
23
+ "& .ML__mfrac:has([data-pie-empty]):not(:only-child) .ML__frac-line": { top: "0.1em" },
24
+ "& .overline:not(:has([data-pie-empty])) > .ML__vlist-t > .ML__vlist-r > .ML__vlist > span:has(> .overline-line)": { top: "-4.07em !important" },
25
+ "& .overline .overline-line": { position: "relative" },
26
+ "& .overline .overline-line:before": {
27
+ content: "\"\"",
28
+ display: "block",
29
+ position: "absolute",
30
+ left: 0,
31
+ right: 0,
32
+ top: "-0.241em",
33
+ height: "0.522em !important",
34
+ border: "0 !important",
35
+ background: "currentColor",
36
+ WebkitMask: d,
37
+ mask: d
38
+ },
39
+ "& .overline .overline-line:after": { display: "none !important" },
40
+ "& .ML__base": { position: "relative" },
41
+ "& .ML__stretchy": {
42
+ position: "absolute",
43
+ left: 0,
44
+ width: "100%"
45
+ },
46
+ "& .ML__center:has(.ML__stretchy)": { marginLeft: "0 !important" }
47
+ }, p = {
48
+ ...e,
49
+ ...t,
50
+ ...i,
51
+ ...f,
52
+ touchAction: "manipulation",
53
+ "& math-field": {
54
+ fontSize: "inherit",
55
+ outline: "none"
56
+ },
57
+ "& math-field::part(virtual-keyboard-toggle)": { display: "none" },
58
+ "& math-field::part(menu-toggle)": { display: "none" }
59
+ }, m = {
60
+ ...e,
61
+ ...t,
62
+ ...u,
63
+ ...f,
64
+ "& math-field": {
65
+ fontSize: "inherit",
66
+ outline: "none"
67
+ },
68
+ "& math-field::part(virtual-keyboard-toggle)": { display: "none" },
69
+ "& math-field::part(menu-toggle)": { display: "none" }
70
+ }, h = p, g = {
71
+ commonMqFontStyles: e,
72
+ longdivStyles: t,
73
+ rootIndexStyles: i,
74
+ supsubStyles: u,
75
+ commonMqKeyboardStyles: p,
76
+ placeholderStyles: f,
77
+ commonMathLiveStyles: m
78
+ };
79
+ //#endregion
80
+ export { l as PARALLEL_CSS, a as ROOT_INDEX_CSS, h as commonKeyboardStyles, m as commonMathLiveStyles, e as commonMqFontStyles, p as commonMqKeyboardStyles, g as default, t as longdivStyles, c as parallelStyles, f as placeholderStyles, i as rootIndexStyles, u as supsubStyles };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Names a `<math-field>`. MathLive falls back to an untranslated "math input field" when the
3
+ * element has no `aria-label` of its own.
4
+ *
5
+ * What a screen reader lands on is MathLive's keyboard input, a textbox inside the field's
6
+ * shadow root, so it gets the name too: the field's own label does not reach it, and MathLive
7
+ * only names it with the spoken math once it has focus. That input only exists once the field
8
+ * is connected, so call this again after mounting the field.
9
+ *
10
+ * The field is a group around that textbox. With MathLive's own `math` role, which it sets
11
+ * through ElementInternals, a focusable field holding a focusable textbox is a nested
12
+ * interactive control.
13
+ */
14
+ export declare function labelMathField(mathField: Element | null | undefined, language?: string): void;
15
+ /** Points a `<math-field>` at the element that describes it, or drops the reference. */
16
+ export declare function describeMathField(mathField: Element | null | undefined, describedBy?: string): void;
@@ -0,0 +1,13 @@
1
+ import e from "@pie-lib/translator";
2
+ //#region src/mf/field-label.ts
3
+ var { translator: t } = e;
4
+ function n(e, n) {
5
+ if (!e) return;
6
+ let r = t.t("mathInput.enterAnswer", { lng: n });
7
+ e.setAttribute("role", "group"), e.setAttribute("aria-label", r), e.shadowRoot?.querySelector(".ML__keyboard-sink")?.setAttribute("aria-label", r);
8
+ }
9
+ function r(e, t) {
10
+ e && (t ? e.setAttribute("aria-describedby", t) : e.removeAttribute("aria-describedby"));
11
+ }
12
+ //#endregion
13
+ export { r as describeMathField, n as labelMathField };