@zzish/math-rich-input 0.1.5 → 0.1.6

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,27 +201,26 @@
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
226
  /* Note that the top left position of the toolbar is set programatically in componentDidMount */
@@ -233,31 +228,31 @@ input:checked + .slider:before {
233
228
  .Toolbar {
234
229
  position: fixed;
235
230
  z-index: 1;
236
- /* width:270px; */
237
- height:42px;
231
+ display: flex;
232
+ height: 42px;
238
233
  background-color: white;
239
234
  border: 1px solid #d0d0d0;
240
235
  border-radius: 5px;
241
236
  box-shadow: 1px 1px 5px #a0a0a0;
242
- animation: 0.5s fadeIn1;
237
+ animation: 0.5s fadeIn1;
243
238
  animation-fill-mode: forwards;
244
239
  top: 0px;
245
- left: 0px; /* important to set this so that toolbar initially renders full width */
240
+ left: 0px; /* important to set this so that toolbar initially renders full width */
246
241
  }
247
242
 
248
243
  @keyframes fadeIn1 {
249
244
  0% {
250
245
  opacity: 0;
251
- }
246
+ }
252
247
  100% {
253
- opacity: 1.0;
248
+ opacity: 1;
254
249
  }
255
250
  }
256
251
 
257
252
  .Toolbar-button {
258
- font-family:sans-serif;
253
+ font-family: sans-serif;
259
254
  font-size: 16px;
260
- width:40px;
255
+ width: 40px;
261
256
  height: 36px;
262
257
  background-color: white;
263
258
  border-radius: 5px;
@@ -266,7 +261,6 @@ input:checked + .slider:before {
266
261
  margin: 2px;
267
262
  }
268
263
 
269
-
270
264
  .Toolbar-button:hover {
271
265
  color: white;
272
266
  background: #663676;
@@ -280,23 +274,23 @@ input:checked + .slider:before {
280
274
  }
281
275
 
282
276
  .TB-narrow {
283
- width:30px;
277
+ width: 30px;
284
278
  }
285
279
 
286
280
  .TB-wide {
287
- width:46px;
281
+ width: 46px;
288
282
  }
289
283
 
290
284
  .TB-up4 {
291
285
  position: relative;
292
- top:-4px;
286
+ top: -4px;
293
287
  }
294
288
 
295
289
  .TB-selected {
296
- background: #D0D0D0;
290
+ background: #d0d0d0;
297
291
  color: black;
298
292
  cursor: pointer;
299
- animation: 0.2s TB-fadeIn;
293
+ animation: 0.2s TB-fadeIn;
300
294
  animation-fill-mode: forwards;
301
295
  }
302
296
 
@@ -309,13 +303,12 @@ input:checked + .slider:before {
309
303
  @keyframes TB-fadeIn {
310
304
  00% {
311
305
  background: white;
312
- }
306
+ }
313
307
  100% {
314
- background: #D0D0D0;
308
+ background: #d0d0d0;
315
309
  }
316
310
  }
317
311
 
318
-
319
312
  /* Tooltip text */
320
313
  .Toolbar-button .tooltiptext {
321
314
  font-weight: normal;
@@ -328,11 +321,11 @@ input:checked + .slider:before {
328
321
  text-align: center;
329
322
  padding: 4px 10px;
330
323
  border-radius: 6px;
331
-
324
+
332
325
  /* Position the tooltip text - see examples below! */
333
326
  position: absolute;
334
327
  z-index: 2;
335
- top: -90%; /* Must leave a small gap between tooltip and button */
328
+ top: -90%; /* Must leave a small gap between tooltip and button */
336
329
  left: 50px;
337
330
 
338
331
  /* transform: translate (50%,0%); */
@@ -340,11 +333,11 @@ input:checked + .slider:before {
340
333
 
341
334
  /* Show the tooltip text when you mouse over the tooltip container */
342
335
  .Toolbar-button:hover .tooltiptext {
343
- animation: 0.8s fadeIn2;
336
+ animation: 0.8s fadeIn2;
344
337
  animation-fill-mode: forwards;
345
338
  visibility: visible;
346
339
  /* width: 100px; */
347
- /* top: -90%; */ /* Must leave a small gap between tooltip and button */
340
+ /* top: -90%; */ /* Must leave a small gap between tooltip and button */
348
341
  /* left: 20%; */
349
342
  /* margin-left: -50px; */
350
343
  }
@@ -352,10 +345,10 @@ input:checked + .slider:before {
352
345
  @keyframes fadeIn2 {
353
346
  00% {
354
347
  opacity: 0;
355
- }
348
+ }
356
349
  70% {
357
350
  opacity: 0;
358
- }
351
+ }
359
352
  100% {
360
353
  visibility: visible;
361
354
  opacity: 0.9;
@@ -367,16 +360,13 @@ input:checked + .slider:before {
367
360
  display: inline-block;
368
361
  border-bottom: 1px dotted black; /* If you want dots under the hoverable text
369
362
  } */
370
-
371
-
372
-
373
363
  /* Note that the top left position of the accent bar is set programatically in componentDidMount */
374
364
 
375
365
  .AccentBar {
376
366
  position: fixed;
377
367
  z-index: 1;
378
- width: 348px; /* max of 346px to ensure fits on Moto G4 mobile device screens */
379
- background-color: red;
368
+ width: 360px;
369
+ background-color: #fff;
380
370
  border: 1px solid #d0d0d0;
381
371
  border-radius: 5px;
382
372
  box-shadow: 1px 1px 5px #a0a0a0;
@@ -402,11 +392,10 @@ input:checked + .slider:before {
402
392
  .AccentBar-outerContainer {
403
393
  overflow-y: scroll;
404
394
  border-radius: 5px;
405
- overflow: overlay;
406
395
  }
407
396
 
408
397
  .AccentBar-innerContainer {
409
- height: 350px; /* Height of overall box */
398
+ height: 350px;
410
399
  }
411
400
 
412
401
  @keyframes fadeIn1 {
@@ -418,7 +407,19 @@ input:checked + .slider:before {
418
407
  }
419
408
  }
420
409
 
410
+ .AccentBar .symbols-grid {
411
+ display: grid;
412
+ grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
413
+ grid-auto-rows: minmax(min-content, max-content);
414
+ grid-gap: 3px;
415
+ }
416
+
417
+ .AccentBar .insert-grid {
418
+ padding: 5px;
419
+ }
420
+
421
421
  .AccentBar .type-a-letter {
422
+ grid-column: 1/-1;
422
423
  color: #a0a0a0;
423
424
  font-family: sans-serif;
424
425
  font-size: 14px;
@@ -437,7 +438,6 @@ input:checked + .slider:before {
437
438
  border-radius: 5px;
438
439
  border: 0px;
439
440
  padding: 1px;
440
- margin: 6px;
441
441
  }
442
442
 
443
443
  .AB-compact {
@@ -446,11 +446,10 @@ input:checked + .slider:before {
446
446
  }
447
447
 
448
448
  .AB-narrow {
449
- width: 30px;
449
+ width: 36px;
450
450
  }
451
451
 
452
452
  .AccentBar-button:hover {
453
- /* filter: saturate(2.0); */
454
453
  color: white;
455
454
  background: #663676;
456
455
  cursor: pointer;
@@ -488,8 +487,7 @@ input:checked + .slider:before {
488
487
  background: white;
489
488
  text-align: left;
490
489
  border: 0px;
491
- padding: 0px 0px 10px 0px;
492
- margin: 5px;
490
+ padding: 10px 0;
493
491
  }
494
492
 
495
493
  .AccentBar .tab {
@@ -521,9 +519,9 @@ input:checked + .slider:before {
521
519
  }
522
520
 
523
521
  .AccentBar .section-label {
522
+ grid-column: 1/-1;
524
523
  font-size: 13px;
525
524
  font-weight: bold;
526
- /* color: #A0A0A0; */
527
525
  color: #663676;
528
526
  margin-top: 8px;
529
527
  margin-left: 8px;
@@ -539,7 +537,6 @@ input:checked + .slider:before {
539
537
  animation-fill-mode: forwards;
540
538
  }
541
539
  .EquationEditor {
542
- /* max-width:500px; */
543
540
  height: auto;
544
541
  text-align: center;
545
542
  }
@@ -625,7 +622,7 @@ input:checked + .slider:before {
625
622
  border-radius: 5px;
626
623
  /* height:36px; */
627
624
  padding: 7px 10px 4px 10px;
628
- margin: 5px 15px 5px 15px;
625
+ margin: 5px 15px;
629
626
  }
630
627
 
631
628
  .EquationEditor .latexInput {
@@ -710,6 +707,12 @@ input:checked + .slider:before {
710
707
  margin: 5px;
711
708
  }
712
709
 
710
+ @media (max-width: 500px) {
711
+ .EquationEditor .tabBar {
712
+ padding: 5px 0;
713
+ }
714
+ }
715
+
713
716
  .EquationEditor .tab {
714
717
  font-size: 14px;
715
718
  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.6",
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;