@zzish/math-rich-input 0.1.5 → 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.
@@ -131,6 +131,8 @@
131
131
  }
132
132
 
133
133
  .EquationEditorModal .title {
134
+ display: flex;
135
+ justify-content: space-between;
134
136
  font-size: 14px;
135
137
  color: #404040;
136
138
  text-align: left;
@@ -142,6 +144,8 @@
142
144
  }
143
145
 
144
146
  .EquationEditorModal-mobile .title {
147
+ display: flex;
148
+ justify-content: space-between;
145
149
  font-size: 14px;
146
150
  color: #404040;
147
151
  text-align: left;
@@ -153,20 +157,12 @@
153
157
  margin: 0px;
154
158
  }
155
159
 
156
- .EquationEditorModal .expertModeSwitch {
157
- /* background: url(images/settings-icon.png) no-repeat; */
158
- float: right;
159
- /* width:36px;
160
- height:36px; */
161
- }
162
-
163
160
  .EquationEditorModal .expertModeSwitch .switch {
164
- margin-right: 10px;
165
161
  margin-left: 10px;
166
162
  }
167
163
 
168
164
  /* The switch - the box around the slider */
169
- .switch {
165
+ .EquationEditorModal .switch {
170
166
  position: relative;
171
167
  display: inline-block;
172
168
  width: 35px;
@@ -174,14 +170,14 @@
174
170
  }
175
171
 
176
172
  /* Hide default HTML checkbox */
177
- .switch input {
173
+ .EquationEditorModal .switch input {
178
174
  opacity: 0;
179
175
  width: 0;
180
176
  height: 0;
181
177
  }
182
178
 
183
179
  /* The slider */
184
- .slider {
180
+ .EquationEditorModal .slider {
185
181
  position: absolute;
186
182
  cursor: pointer;
187
183
  top: 0;
@@ -193,7 +189,7 @@
193
189
  transition: 0.4s;
194
190
  }
195
191
 
196
- .slider:before {
192
+ .EquationEditorModal .slider:before {
197
193
  position: absolute;
198
194
  content: "";
199
195
  height: 14px;
@@ -205,178 +201,35 @@
205
201
  transition: 0.4s;
206
202
  }
207
203
 
208
- input:checked + .slider {
204
+ .EquationEditorModal input:checked + .slider {
209
205
  background-color: #663676;
210
- /* background-color: #2196F3; */
211
206
  }
212
207
 
213
- input:focus + .slider {
208
+ .EquationEditorModal input:focus + .slider {
214
209
  box-shadow: 0 0 1px #2196f3;
215
210
  }
216
211
 
217
- input:checked + .slider:before {
212
+ .EquationEditorModal input:checked + .slider:before {
218
213
  -webkit-transform: translateX(13px);
219
214
  -ms-transform: translateX(13px);
220
215
  transform: translateX(13px);
221
216
  }
222
217
 
223
218
  /* Rounded sliders */
224
- .slider.round {
219
+ .EquationEditorModal .slider.round {
225
220
  border-radius: 18px;
226
221
  }
227
222
 
228
- .slider.round:before {
223
+ .EquationEditorModal .slider.round:before {
229
224
  border-radius: 50%;
230
225
  }
231
- /* Note that the top left position of the toolbar is set programatically in componentDidMount */
232
-
233
- .Toolbar {
234
- position: fixed;
235
- z-index: 1;
236
- /* width:270px; */
237
- height:42px;
238
- background-color: white;
239
- border: 1px solid #d0d0d0;
240
- border-radius: 5px;
241
- box-shadow: 1px 1px 5px #a0a0a0;
242
- animation: 0.5s fadeIn1;
243
- animation-fill-mode: forwards;
244
- top: 0px;
245
- left: 0px; /* important to set this so that toolbar initially renders full width */
246
- }
247
-
248
- @keyframes fadeIn1 {
249
- 0% {
250
- opacity: 0;
251
- }
252
- 100% {
253
- opacity: 1.0;
254
- }
255
- }
256
-
257
- .Toolbar-button {
258
- font-family:sans-serif;
259
- font-size: 16px;
260
- width:40px;
261
- height: 36px;
262
- background-color: white;
263
- border-radius: 5px;
264
- border: 0px;
265
- padding: 1px;
266
- margin: 2px;
267
- }
268
-
269
-
270
- .Toolbar-button:hover {
271
- color: white;
272
- background: #663676;
273
- cursor: pointer;
274
- }
275
-
276
- .Toolbar-button:active {
277
- background: #808080;
278
- color: white;
279
- cursor: pointer;
280
- }
281
-
282
- .TB-narrow {
283
- width:30px;
284
- }
285
-
286
- .TB-wide {
287
- width:46px;
288
- }
289
-
290
- .TB-up4 {
291
- position: relative;
292
- top:-4px;
293
- }
294
-
295
- .TB-selected {
296
- background: #D0D0D0;
297
- color: black;
298
- cursor: pointer;
299
- animation: 0.2s TB-fadeIn;
300
- animation-fill-mode: forwards;
301
- }
302
-
303
- .TB-selected:hover {
304
- color: white;
305
- background: #663676;
306
- cursor: pointer;
307
- }
308
-
309
- @keyframes TB-fadeIn {
310
- 00% {
311
- background: white;
312
- }
313
- 100% {
314
- background: #D0D0D0;
315
- }
316
- }
317
-
318
-
319
- /* Tooltip text */
320
- .Toolbar-button .tooltiptext {
321
- font-weight: normal;
322
- visibility: hidden;
323
- width: 100px;
324
- background-color: #222;
325
- color: #fff;
326
- /*font-weight: bold;*/
327
- font-size: 12px;
328
- text-align: center;
329
- padding: 4px 10px;
330
- border-radius: 6px;
331
-
332
- /* Position the tooltip text - see examples below! */
333
- position: absolute;
334
- z-index: 2;
335
- top: -90%; /* Must leave a small gap between tooltip and button */
336
- left: 50px;
337
-
338
- /* transform: translate (50%,0%); */
339
- }
340
-
341
- /* Show the tooltip text when you mouse over the tooltip container */
342
- .Toolbar-button:hover .tooltiptext {
343
- animation: 0.8s fadeIn2;
344
- animation-fill-mode: forwards;
345
- visibility: visible;
346
- /* width: 100px; */
347
- /* top: -90%; */ /* Must leave a small gap between tooltip and button */
348
- /* left: 20%; */
349
- /* margin-left: -50px; */
350
- }
351
-
352
- @keyframes fadeIn2 {
353
- 00% {
354
- opacity: 0;
355
- }
356
- 70% {
357
- opacity: 0;
358
- }
359
- 100% {
360
- visibility: visible;
361
- opacity: 0.9;
362
- }
363
- }
364
-
365
- /* .tooltip {
366
- position: relative;
367
- display: inline-block;
368
- border-bottom: 1px dotted black; /* If you want dots under the hoverable text
369
- } */
370
-
371
-
372
-
373
226
  /* Note that the top left position of the accent bar is set programatically in componentDidMount */
374
227
 
375
228
  .AccentBar {
376
229
  position: fixed;
377
230
  z-index: 1;
378
- width: 348px; /* max of 346px to ensure fits on Moto G4 mobile device screens */
379
- background-color: red;
231
+ width: 360px;
232
+ background-color: #fff;
380
233
  border: 1px solid #d0d0d0;
381
234
  border-radius: 5px;
382
235
  box-shadow: 1px 1px 5px #a0a0a0;
@@ -402,11 +255,10 @@ input:checked + .slider:before {
402
255
  .AccentBar-outerContainer {
403
256
  overflow-y: scroll;
404
257
  border-radius: 5px;
405
- overflow: overlay;
406
258
  }
407
259
 
408
260
  .AccentBar-innerContainer {
409
- height: 350px; /* Height of overall box */
261
+ height: 350px;
410
262
  }
411
263
 
412
264
  @keyframes fadeIn1 {
@@ -418,7 +270,19 @@ input:checked + .slider:before {
418
270
  }
419
271
  }
420
272
 
273
+ .AccentBar .symbols-grid {
274
+ display: grid;
275
+ grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
276
+ grid-auto-rows: minmax(min-content, max-content);
277
+ grid-gap: 3px;
278
+ }
279
+
280
+ .AccentBar .insert-grid {
281
+ padding: 5px;
282
+ }
283
+
421
284
  .AccentBar .type-a-letter {
285
+ grid-column: 1/-1;
422
286
  color: #a0a0a0;
423
287
  font-family: sans-serif;
424
288
  font-size: 14px;
@@ -437,7 +301,6 @@ input:checked + .slider:before {
437
301
  border-radius: 5px;
438
302
  border: 0px;
439
303
  padding: 1px;
440
- margin: 6px;
441
304
  }
442
305
 
443
306
  .AB-compact {
@@ -446,11 +309,10 @@ input:checked + .slider:before {
446
309
  }
447
310
 
448
311
  .AB-narrow {
449
- width: 30px;
312
+ width: 36px;
450
313
  }
451
314
 
452
315
  .AccentBar-button:hover {
453
- /* filter: saturate(2.0); */
454
316
  color: white;
455
317
  background: #663676;
456
318
  cursor: pointer;
@@ -488,8 +350,7 @@ input:checked + .slider:before {
488
350
  background: white;
489
351
  text-align: left;
490
352
  border: 0px;
491
- padding: 0px 0px 10px 0px;
492
- margin: 5px;
353
+ padding: 10px 0;
493
354
  }
494
355
 
495
356
  .AccentBar .tab {
@@ -521,9 +382,9 @@ input:checked + .slider:before {
521
382
  }
522
383
 
523
384
  .AccentBar .section-label {
385
+ grid-column: 1/-1;
524
386
  font-size: 13px;
525
387
  font-weight: bold;
526
- /* color: #A0A0A0; */
527
388
  color: #663676;
528
389
  margin-top: 8px;
529
390
  margin-left: 8px;
@@ -538,8 +399,139 @@ input:checked + .slider:before {
538
399
  animation: 0.4s fadeIn1;
539
400
  animation-fill-mode: forwards;
540
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
+ } */
541
534
  .EquationEditor {
542
- /* max-width:500px; */
543
535
  height: auto;
544
536
  text-align: center;
545
537
  }
@@ -625,7 +617,7 @@ input:checked + .slider:before {
625
617
  border-radius: 5px;
626
618
  /* height:36px; */
627
619
  padding: 7px 10px 4px 10px;
628
- margin: 5px 15px 5px 15px;
620
+ margin: 5px 15px;
629
621
  }
630
622
 
631
623
  .EquationEditor .latexInput {
@@ -710,6 +702,12 @@ input:checked + .slider:before {
710
702
  margin: 5px;
711
703
  }
712
704
 
705
+ @media (max-width: 500px) {
706
+ .EquationEditor .tabBar {
707
+ padding: 5px 0;
708
+ }
709
+ }
710
+
713
711
  .EquationEditor .tab {
714
712
  font-size: 14px;
715
713
  font-weight: bold;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzish/math-rich-input",
3
- "version": "0.1.5",
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",
package/src/AccentBar.css CHANGED
@@ -3,8 +3,8 @@
3
3
  .AccentBar {
4
4
  position: fixed;
5
5
  z-index: 1;
6
- width: 348px; /* max of 346px to ensure fits on Moto G4 mobile device screens */
7
- background-color: red;
6
+ width: 360px;
7
+ background-color: #fff;
8
8
  border: 1px solid #d0d0d0;
9
9
  border-radius: 5px;
10
10
  box-shadow: 1px 1px 5px #a0a0a0;
@@ -30,11 +30,10 @@
30
30
  .AccentBar-outerContainer {
31
31
  overflow-y: scroll;
32
32
  border-radius: 5px;
33
- overflow: overlay;
34
33
  }
35
34
 
36
35
  .AccentBar-innerContainer {
37
- height: 350px; /* Height of overall box */
36
+ height: 350px;
38
37
  }
39
38
 
40
39
  @keyframes fadeIn1 {
@@ -46,7 +45,19 @@
46
45
  }
47
46
  }
48
47
 
48
+ .AccentBar .symbols-grid {
49
+ display: grid;
50
+ grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
51
+ grid-auto-rows: minmax(min-content, max-content);
52
+ grid-gap: 3px;
53
+ }
54
+
55
+ .AccentBar .insert-grid {
56
+ padding: 5px;
57
+ }
58
+
49
59
  .AccentBar .type-a-letter {
60
+ grid-column: 1/-1;
50
61
  color: #a0a0a0;
51
62
  font-family: sans-serif;
52
63
  font-size: 14px;
@@ -65,7 +76,6 @@
65
76
  border-radius: 5px;
66
77
  border: 0px;
67
78
  padding: 1px;
68
- margin: 6px;
69
79
  }
70
80
 
71
81
  .AB-compact {
@@ -74,11 +84,10 @@
74
84
  }
75
85
 
76
86
  .AB-narrow {
77
- width: 30px;
87
+ width: 36px;
78
88
  }
79
89
 
80
90
  .AccentBar-button:hover {
81
- /* filter: saturate(2.0); */
82
91
  color: white;
83
92
  background: #663676;
84
93
  cursor: pointer;
@@ -116,8 +125,7 @@
116
125
  background: white;
117
126
  text-align: left;
118
127
  border: 0px;
119
- padding: 0px 0px 10px 0px;
120
- margin: 5px;
128
+ padding: 10px 0;
121
129
  }
122
130
 
123
131
  .AccentBar .tab {
@@ -149,9 +157,9 @@
149
157
  }
150
158
 
151
159
  .AccentBar .section-label {
160
+ grid-column: 1/-1;
152
161
  font-size: 13px;
153
162
  font-weight: bold;
154
- /* color: #A0A0A0; */
155
163
  color: #663676;
156
164
  margin-top: 8px;
157
165
  margin-left: 8px;