@zzish/math-rich-input 0.1.6 → 0.1.7

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 CHANGED
@@ -21974,7 +21974,7 @@ var MathRichInput = /*#__PURE__*/function (_React$Component) {
21974
21974
  });
21975
21975
  } else {
21976
21976
  _this2.setState({
21977
- showAccentBar: true
21977
+ showAccentBar: false
21978
21978
  });
21979
21979
  }
21980
21980
 
@@ -21993,7 +21993,7 @@ var MathRichInput = /*#__PURE__*/function (_React$Component) {
21993
21993
  if (_this2.keyPressStartTime < 0) {
21994
21994
  _this2.keyPressStartTime = Date.now();
21995
21995
  if (_this2.state.showAccentBar) _this2.setState({
21996
- showAccentBar: true
21996
+ showAccentBar: false
21997
21997
  });
21998
21998
  }
21999
21999
 
@@ -22752,7 +22752,7 @@ var MathRichInput = /*#__PURE__*/function (_React$Component) {
22752
22752
  _this2.insertAccentLetter(event, oldCharacter, newCharacter);
22753
22753
 
22754
22754
  _this2.setState({
22755
- showAccentBar: true
22755
+ showAccentBar: false
22756
22756
  });
22757
22757
  } catch (error) {
22758
22758
  console.error(error);
@@ -22772,17 +22772,21 @@ var MathRichInput = /*#__PURE__*/function (_React$Component) {
22772
22772
  }
22773
22773
  });
22774
22774
 
22775
- _defineProperty(_assertThisInitialized(_this2), "handleBlur", function (event) {// try {
22776
- // this.setState({ hasFocus: false, showAccentBar: true });
22777
- // } catch (error) {
22778
- // console.error(error);
22779
- // }
22775
+ _defineProperty(_assertThisInitialized(_this2), "handleBlur", function (event) {
22776
+ try {
22777
+ _this2.setState({
22778
+ hasFocus: false,
22779
+ showAccentBar: false
22780
+ });
22781
+ } catch (error) {
22782
+ console.error(error);
22783
+ }
22780
22784
  });
22781
22785
 
22782
22786
  _this2.state = {
22783
22787
  showEquationEditor: false,
22784
22788
  equationEditorLatex: "",
22785
- showAccentBar: true,
22789
+ showAccentBar: false,
22786
22790
  activeButtons: {
22787
22791
  bold: false,
22788
22792
  italic: false,
@@ -223,143 +223,6 @@
223
223
  .EquationEditorModal .slider.round:before {
224
224
  border-radius: 50%;
225
225
  }
226
- /* Note that the top left position of the toolbar is set programatically in componentDidMount */
227
-
228
- .Toolbar {
229
- position: fixed;
230
- z-index: 1;
231
- display: flex;
232
- height: 42px;
233
- background-color: white;
234
- border: 1px solid #d0d0d0;
235
- border-radius: 5px;
236
- box-shadow: 1px 1px 5px #a0a0a0;
237
- animation: 0.5s fadeIn1;
238
- animation-fill-mode: forwards;
239
- top: 0px;
240
- left: 0px; /* important to set this so that toolbar initially renders full width */
241
- }
242
-
243
- @keyframes fadeIn1 {
244
- 0% {
245
- opacity: 0;
246
- }
247
- 100% {
248
- opacity: 1;
249
- }
250
- }
251
-
252
- .Toolbar-button {
253
- font-family: sans-serif;
254
- font-size: 16px;
255
- width: 40px;
256
- height: 36px;
257
- background-color: white;
258
- border-radius: 5px;
259
- border: 0px;
260
- padding: 1px;
261
- margin: 2px;
262
- }
263
-
264
- .Toolbar-button:hover {
265
- color: white;
266
- background: #663676;
267
- cursor: pointer;
268
- }
269
-
270
- .Toolbar-button:active {
271
- background: #808080;
272
- color: white;
273
- cursor: pointer;
274
- }
275
-
276
- .TB-narrow {
277
- width: 30px;
278
- }
279
-
280
- .TB-wide {
281
- width: 46px;
282
- }
283
-
284
- .TB-up4 {
285
- position: relative;
286
- top: -4px;
287
- }
288
-
289
- .TB-selected {
290
- background: #d0d0d0;
291
- color: black;
292
- cursor: pointer;
293
- animation: 0.2s TB-fadeIn;
294
- animation-fill-mode: forwards;
295
- }
296
-
297
- .TB-selected:hover {
298
- color: white;
299
- background: #663676;
300
- cursor: pointer;
301
- }
302
-
303
- @keyframes TB-fadeIn {
304
- 00% {
305
- background: white;
306
- }
307
- 100% {
308
- background: #d0d0d0;
309
- }
310
- }
311
-
312
- /* Tooltip text */
313
- .Toolbar-button .tooltiptext {
314
- font-weight: normal;
315
- visibility: hidden;
316
- width: 100px;
317
- background-color: #222;
318
- color: #fff;
319
- /*font-weight: bold;*/
320
- font-size: 12px;
321
- text-align: center;
322
- padding: 4px 10px;
323
- border-radius: 6px;
324
-
325
- /* Position the tooltip text - see examples below! */
326
- position: absolute;
327
- z-index: 2;
328
- top: -90%; /* Must leave a small gap between tooltip and button */
329
- left: 50px;
330
-
331
- /* transform: translate (50%,0%); */
332
- }
333
-
334
- /* Show the tooltip text when you mouse over the tooltip container */
335
- .Toolbar-button:hover .tooltiptext {
336
- animation: 0.8s fadeIn2;
337
- animation-fill-mode: forwards;
338
- visibility: visible;
339
- /* width: 100px; */
340
- /* top: -90%; */ /* Must leave a small gap between tooltip and button */
341
- /* left: 20%; */
342
- /* margin-left: -50px; */
343
- }
344
-
345
- @keyframes fadeIn2 {
346
- 00% {
347
- opacity: 0;
348
- }
349
- 70% {
350
- opacity: 0;
351
- }
352
- 100% {
353
- visibility: visible;
354
- opacity: 0.9;
355
- }
356
- }
357
-
358
- /* .tooltip {
359
- position: relative;
360
- display: inline-block;
361
- border-bottom: 1px dotted black; /* If you want dots under the hoverable text
362
- } */
363
226
  /* Note that the top left position of the accent bar is set programatically in componentDidMount */
364
227
 
365
228
  .AccentBar {
@@ -536,6 +399,138 @@
536
399
  animation: 0.4s fadeIn1;
537
400
  animation-fill-mode: forwards;
538
401
  }
402
+ /* Note that the top left position of the toolbar is set programatically in componentDidMount */
403
+
404
+ .Toolbar {
405
+ position: fixed;
406
+ z-index: 1;
407
+ display: flex;
408
+ height: 42px;
409
+ background-color: white;
410
+ border: 1px solid #d0d0d0;
411
+ border-radius: 5px;
412
+ box-shadow: 1px 1px 5px #a0a0a0;
413
+ animation: 0.5s fadeIn1;
414
+ animation-fill-mode: forwards;
415
+ top: 0px;
416
+ left: 0px; /* important to set this so that toolbar initially renders full width */
417
+ }
418
+
419
+ @keyframes fadeIn1 {
420
+ 0% {
421
+ opacity: 0;
422
+ }
423
+ 100% {
424
+ opacity: 1;
425
+ }
426
+ }
427
+
428
+ .Toolbar-button {
429
+ font-family: sans-serif;
430
+ font-size: 16px;
431
+ width: 40px;
432
+ height: 36px;
433
+ background-color: white;
434
+ border-radius: 5px;
435
+ border: 0px;
436
+ padding: 1px;
437
+ margin: 2px;
438
+ }
439
+
440
+ .Toolbar-button:hover {
441
+ color: white;
442
+ background: #663676;
443
+ cursor: pointer;
444
+ }
445
+
446
+ .Toolbar-button:active {
447
+ background: #808080;
448
+ color: white;
449
+ cursor: pointer;
450
+ }
451
+
452
+ .TB-narrow {
453
+ width: 30px;
454
+ }
455
+
456
+ .TB-wide {
457
+ width: 46px;
458
+ }
459
+
460
+ .TB-selected {
461
+ background: #d0d0d0;
462
+ color: black;
463
+ cursor: pointer;
464
+ animation: 0.2s TB-fadeIn;
465
+ animation-fill-mode: forwards;
466
+ }
467
+
468
+ .TB-selected:hover {
469
+ color: white;
470
+ background: #663676;
471
+ cursor: pointer;
472
+ }
473
+
474
+ @keyframes TB-fadeIn {
475
+ 00% {
476
+ background: white;
477
+ }
478
+ 100% {
479
+ background: #d0d0d0;
480
+ }
481
+ }
482
+
483
+ /* Tooltip text */
484
+ .Toolbar-button .tooltiptext {
485
+ font-weight: normal;
486
+ visibility: hidden;
487
+ width: 100px;
488
+ background-color: #222;
489
+ color: #fff;
490
+ /*font-weight: bold;*/
491
+ font-size: 12px;
492
+ text-align: center;
493
+ padding: 4px 10px;
494
+ border-radius: 6px;
495
+
496
+ /* Position the tooltip text - see examples below! */
497
+ position: absolute;
498
+ z-index: 2;
499
+ top: -90%; /* Must leave a small gap between tooltip and button */
500
+ left: 50px;
501
+
502
+ /* transform: translate (50%,0%); */
503
+ }
504
+
505
+ /* Show the tooltip text when you mouse over the tooltip container */
506
+ .Toolbar-button:hover .tooltiptext {
507
+ animation: 0.8s fadeIn2;
508
+ animation-fill-mode: forwards;
509
+ visibility: visible;
510
+ /* width: 100px; */
511
+ /* top: -90%; */ /* Must leave a small gap between tooltip and button */
512
+ /* left: 20%; */
513
+ /* margin-left: -50px; */
514
+ }
515
+
516
+ @keyframes fadeIn2 {
517
+ 00% {
518
+ opacity: 0;
519
+ }
520
+ 70% {
521
+ opacity: 0;
522
+ }
523
+ 100% {
524
+ visibility: visible;
525
+ opacity: 0.9;
526
+ }
527
+ }
528
+
529
+ /* .tooltip {
530
+ position: relative;
531
+ display: inline-block;
532
+ border-bottom: 1px dotted black; /* If you want dots under the hoverable text
533
+ } */
539
534
  .EquationEditor {
540
535
  height: auto;
541
536
  text-align: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzish/math-rich-input",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "React component for user to enter rich text with embedded math equations.",
5
5
  "repository": {
6
6
  "type": "git",