@zzish/math-rich-input 0.1.15 → 0.1.16
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/dist/index.js +5 -5
- package/dist/math-rich-input.css +130 -130
- package/package.json +1 -1
- package/src/mathRichInputHelper.js +4 -4
package/dist/index.js
CHANGED
|
@@ -21119,10 +21119,7 @@ function rawTextToHtml(katex, string, mimeType) {
|
|
|
21119
21119
|
|
|
21120
21120
|
if (parseAsTex) string = string.replace(DOLLAR_SLASH_REG_EXP, TEMP_CHAR); // console.log("Modded string: "+string)
|
|
21121
21121
|
|
|
21122
|
-
var stringElements = string.split(parseAsTex ? INLINE_TEX_REG_EXP : HTML_MATH_REG_EXP);
|
|
21123
|
-
|
|
21124
|
-
if (stringElements[0] === "") // This means the original string stars with latex
|
|
21125
|
-
stringElements[0] = "&#" + SMALL_SPACE$1.charCodeAt(0);
|
|
21122
|
+
var stringElements = string.split(parseAsTex ? INLINE_TEX_REG_EXP : HTML_MATH_REG_EXP);
|
|
21126
21123
|
|
|
21127
21124
|
if (parseAsTex) {
|
|
21128
21125
|
for (var i = 0; i < stringElements.length; i++) {
|
|
@@ -21134,8 +21131,11 @@ function rawTextToHtml(katex, string, mimeType) {
|
|
|
21134
21131
|
for (var _i = 0; _i < stringElements.length; _i++) {
|
|
21135
21132
|
stringElements[_i] = stringElements[_i].replace(P_TAG_REG_EXP, P_ELEMENT_SMALL_SPACE);
|
|
21136
21133
|
}
|
|
21137
|
-
}
|
|
21134
|
+
} // Insert small space at start of first element if it is an empty element
|
|
21138
21135
|
|
|
21136
|
+
|
|
21137
|
+
if (stringElements[0] === "") // This means the original string stars with latex
|
|
21138
|
+
stringElements[0] = "&#" + SMALL_SPACE$1.charCodeAt(0);
|
|
21139
21139
|
if (stringElements.length === 1) return stringElements[0];
|
|
21140
21140
|
var latexElements = string.match(parseAsTex ? INLINE_TEX_REG_EXP : HTML_MATH_REG_EXP);
|
|
21141
21141
|
var result = [];
|
package/dist/math-rich-input.css
CHANGED
|
@@ -69,6 +69,136 @@
|
|
|
69
69
|
padding: 2px;
|
|
70
70
|
margin: 0px 2px;
|
|
71
71
|
}
|
|
72
|
+
/* Note that the top left position of the toolbar is set programatically in componentDidMount */
|
|
73
|
+
|
|
74
|
+
.Toolbar {
|
|
75
|
+
position: absolute;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
display: flex;
|
|
78
|
+
height: 42px;
|
|
79
|
+
background-color: white;
|
|
80
|
+
border: 1px solid #d0d0d0;
|
|
81
|
+
border-radius: 5px;
|
|
82
|
+
box-shadow: 1px 1px 5px #a0a0a0;
|
|
83
|
+
animation: 0.5s fadeIn1;
|
|
84
|
+
animation-fill-mode: forwards;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@keyframes fadeIn1 {
|
|
88
|
+
0% {
|
|
89
|
+
opacity: 0;
|
|
90
|
+
}
|
|
91
|
+
100% {
|
|
92
|
+
opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.Toolbar-button {
|
|
97
|
+
font-family: sans-serif;
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
width: 40px;
|
|
100
|
+
height: 36px;
|
|
101
|
+
background-color: white;
|
|
102
|
+
border-radius: 5px;
|
|
103
|
+
border: 0px;
|
|
104
|
+
padding: 1px;
|
|
105
|
+
margin: 2px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.Toolbar-button:hover {
|
|
109
|
+
color: white;
|
|
110
|
+
background: #663676;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.Toolbar-button:active {
|
|
115
|
+
background: #808080;
|
|
116
|
+
color: white;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.TB-narrow {
|
|
121
|
+
width: 30px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.TB-wide {
|
|
125
|
+
width: 46px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.TB-selected {
|
|
129
|
+
background: #d0d0d0;
|
|
130
|
+
color: black;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
animation: 0.2s TB-fadeIn;
|
|
133
|
+
animation-fill-mode: forwards;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.TB-selected:hover {
|
|
137
|
+
color: white;
|
|
138
|
+
background: #663676;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@keyframes TB-fadeIn {
|
|
143
|
+
00% {
|
|
144
|
+
background: white;
|
|
145
|
+
}
|
|
146
|
+
100% {
|
|
147
|
+
background: #d0d0d0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Tooltip text */
|
|
152
|
+
.Toolbar-button .tooltiptext {
|
|
153
|
+
font-weight: normal;
|
|
154
|
+
visibility: hidden;
|
|
155
|
+
width: 100px;
|
|
156
|
+
background-color: #222;
|
|
157
|
+
color: #fff;
|
|
158
|
+
/*font-weight: bold;*/
|
|
159
|
+
font-size: 12px;
|
|
160
|
+
text-align: center;
|
|
161
|
+
padding: 4px 10px;
|
|
162
|
+
border-radius: 6px;
|
|
163
|
+
|
|
164
|
+
/* Position the tooltip text - see examples below! */
|
|
165
|
+
position: absolute;
|
|
166
|
+
z-index: 2;
|
|
167
|
+
top: -90%; /* Must leave a small gap between tooltip and button */
|
|
168
|
+
left: 50px;
|
|
169
|
+
|
|
170
|
+
/* transform: translate (50%,0%); */
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Show the tooltip text when you mouse over the tooltip container */
|
|
174
|
+
.Toolbar-button:hover .tooltiptext {
|
|
175
|
+
animation: 0.8s fadeIn2;
|
|
176
|
+
animation-fill-mode: forwards;
|
|
177
|
+
visibility: visible;
|
|
178
|
+
/* width: 100px; */
|
|
179
|
+
/* top: -90%; */ /* Must leave a small gap between tooltip and button */
|
|
180
|
+
/* left: 20%; */
|
|
181
|
+
/* margin-left: -50px; */
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@keyframes fadeIn2 {
|
|
185
|
+
00% {
|
|
186
|
+
opacity: 0;
|
|
187
|
+
}
|
|
188
|
+
70% {
|
|
189
|
+
opacity: 0;
|
|
190
|
+
}
|
|
191
|
+
100% {
|
|
192
|
+
visibility: visible;
|
|
193
|
+
opacity: 0.9;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* .tooltip {
|
|
198
|
+
position: relative;
|
|
199
|
+
display: inline-block;
|
|
200
|
+
border-bottom: 1px dotted black; /* If you want dots under the hoverable text
|
|
201
|
+
} */
|
|
72
202
|
/* Note that the top left position of the accent bar is set programatically in componentDidMount */
|
|
73
203
|
|
|
74
204
|
.AccentBar {
|
|
@@ -244,136 +374,6 @@
|
|
|
244
374
|
animation: 0.4s fadeIn1;
|
|
245
375
|
animation-fill-mode: forwards;
|
|
246
376
|
}
|
|
247
|
-
/* Note that the top left position of the toolbar is set programatically in componentDidMount */
|
|
248
|
-
|
|
249
|
-
.Toolbar {
|
|
250
|
-
position: absolute;
|
|
251
|
-
z-index: 1;
|
|
252
|
-
display: flex;
|
|
253
|
-
height: 42px;
|
|
254
|
-
background-color: white;
|
|
255
|
-
border: 1px solid #d0d0d0;
|
|
256
|
-
border-radius: 5px;
|
|
257
|
-
box-shadow: 1px 1px 5px #a0a0a0;
|
|
258
|
-
animation: 0.5s fadeIn1;
|
|
259
|
-
animation-fill-mode: forwards;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
@keyframes fadeIn1 {
|
|
263
|
-
0% {
|
|
264
|
-
opacity: 0;
|
|
265
|
-
}
|
|
266
|
-
100% {
|
|
267
|
-
opacity: 1;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.Toolbar-button {
|
|
272
|
-
font-family: sans-serif;
|
|
273
|
-
font-size: 16px;
|
|
274
|
-
width: 40px;
|
|
275
|
-
height: 36px;
|
|
276
|
-
background-color: white;
|
|
277
|
-
border-radius: 5px;
|
|
278
|
-
border: 0px;
|
|
279
|
-
padding: 1px;
|
|
280
|
-
margin: 2px;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.Toolbar-button:hover {
|
|
284
|
-
color: white;
|
|
285
|
-
background: #663676;
|
|
286
|
-
cursor: pointer;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.Toolbar-button:active {
|
|
290
|
-
background: #808080;
|
|
291
|
-
color: white;
|
|
292
|
-
cursor: pointer;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.TB-narrow {
|
|
296
|
-
width: 30px;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.TB-wide {
|
|
300
|
-
width: 46px;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.TB-selected {
|
|
304
|
-
background: #d0d0d0;
|
|
305
|
-
color: black;
|
|
306
|
-
cursor: pointer;
|
|
307
|
-
animation: 0.2s TB-fadeIn;
|
|
308
|
-
animation-fill-mode: forwards;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.TB-selected:hover {
|
|
312
|
-
color: white;
|
|
313
|
-
background: #663676;
|
|
314
|
-
cursor: pointer;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
@keyframes TB-fadeIn {
|
|
318
|
-
00% {
|
|
319
|
-
background: white;
|
|
320
|
-
}
|
|
321
|
-
100% {
|
|
322
|
-
background: #d0d0d0;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/* Tooltip text */
|
|
327
|
-
.Toolbar-button .tooltiptext {
|
|
328
|
-
font-weight: normal;
|
|
329
|
-
visibility: hidden;
|
|
330
|
-
width: 100px;
|
|
331
|
-
background-color: #222;
|
|
332
|
-
color: #fff;
|
|
333
|
-
/*font-weight: bold;*/
|
|
334
|
-
font-size: 12px;
|
|
335
|
-
text-align: center;
|
|
336
|
-
padding: 4px 10px;
|
|
337
|
-
border-radius: 6px;
|
|
338
|
-
|
|
339
|
-
/* Position the tooltip text - see examples below! */
|
|
340
|
-
position: absolute;
|
|
341
|
-
z-index: 2;
|
|
342
|
-
top: -90%; /* Must leave a small gap between tooltip and button */
|
|
343
|
-
left: 50px;
|
|
344
|
-
|
|
345
|
-
/* transform: translate (50%,0%); */
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/* Show the tooltip text when you mouse over the tooltip container */
|
|
349
|
-
.Toolbar-button:hover .tooltiptext {
|
|
350
|
-
animation: 0.8s fadeIn2;
|
|
351
|
-
animation-fill-mode: forwards;
|
|
352
|
-
visibility: visible;
|
|
353
|
-
/* width: 100px; */
|
|
354
|
-
/* top: -90%; */ /* Must leave a small gap between tooltip and button */
|
|
355
|
-
/* left: 20%; */
|
|
356
|
-
/* margin-left: -50px; */
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
@keyframes fadeIn2 {
|
|
360
|
-
00% {
|
|
361
|
-
opacity: 0;
|
|
362
|
-
}
|
|
363
|
-
70% {
|
|
364
|
-
opacity: 0;
|
|
365
|
-
}
|
|
366
|
-
100% {
|
|
367
|
-
visibility: visible;
|
|
368
|
-
opacity: 0.9;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
/* .tooltip {
|
|
373
|
-
position: relative;
|
|
374
|
-
display: inline-block;
|
|
375
|
-
border-bottom: 1px dotted black; /* If you want dots under the hoverable text
|
|
376
|
-
} */
|
|
377
377
|
.EquationEditorModal-background {
|
|
378
378
|
position: fixed;
|
|
379
379
|
top: 0;
|
package/package.json
CHANGED
|
@@ -497,10 +497,6 @@ export function rawTextToHtml(katex, string, mimeType) {
|
|
|
497
497
|
|
|
498
498
|
const stringElements = string.split(parseAsTex ? INLINE_TEX_REG_EXP : HTML_MATH_REG_EXP);
|
|
499
499
|
|
|
500
|
-
// Insert small space at start of first element if it is an empty element
|
|
501
|
-
if (stringElements[0] === "") // This means the original string stars with latex
|
|
502
|
-
stringElements[0] = "&#" + SMALL_SPACE.charCodeAt(0)
|
|
503
|
-
|
|
504
500
|
if (parseAsTex) {
|
|
505
501
|
for (let i = 0; i <stringElements.length; i++) {
|
|
506
502
|
stringElements[i] = stringElements[i].replace(TEMP_CHAR_REG_EXP, "$")
|
|
@@ -511,6 +507,10 @@ export function rawTextToHtml(katex, string, mimeType) {
|
|
|
511
507
|
for (let i = 0; i <stringElements.length; i++)
|
|
512
508
|
stringElements[i] = stringElements[i].replace(P_TAG_REG_EXP, P_ELEMENT_SMALL_SPACE)
|
|
513
509
|
}
|
|
510
|
+
|
|
511
|
+
// Insert small space at start of first element if it is an empty element
|
|
512
|
+
if (stringElements[0] === "") // This means the original string stars with latex
|
|
513
|
+
stringElements[0] = "&#" + SMALL_SPACE.charCodeAt(0)
|
|
514
514
|
|
|
515
515
|
if (stringElements.length === 1)
|
|
516
516
|
return stringElements[0]
|