@zzish/math-rich-input 0.1.42 → 0.1.44
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 +937 -1536
- package/dist/math-rich-input.css +550 -518
- package/package.json +3 -3
- package/src/AccentBar.css +113 -111
- package/src/EquationEditor.css +160 -159
- package/src/EquationEditor.jsx +528 -560
- package/src/EquationEditorModal.css +109 -101
- package/src/EquationEditorModal.jsx +65 -68
- package/src/MathRichInput.css +86 -66
- package/src/MathRichInput.jsx +1981 -2070
- package/src/Toolbar.css +83 -82
- package/src/Toolbar.jsx +220 -234
- package/src/index.js +4 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zzish/math-rich-input",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"description": "React component for user to enter rich text with embedded math equations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.13.10",
|
|
33
33
|
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
34
|
-
"@babel/preset-env": "^7.
|
|
35
|
-
"@babel/preset-react": "^7.
|
|
34
|
+
"@babel/preset-env": "^7.24.5",
|
|
35
|
+
"@babel/preset-react": "^7.24.1",
|
|
36
36
|
"@babel/register": "^7.13.8",
|
|
37
37
|
"@rollup/plugin-babel": "^5.3.0",
|
|
38
38
|
"@rollup/plugin-commonjs": "^17.1.0",
|
package/src/AccentBar.css
CHANGED
|
@@ -1,175 +1,177 @@
|
|
|
1
1
|
/* Note that the top left position of the accent bar is set programatically in componentDidMount */
|
|
2
2
|
|
|
3
3
|
.AccentBar {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
position: absolute;
|
|
5
|
+
z-index: 1;
|
|
6
|
+
width: 360px;
|
|
7
|
+
background-color: #fff;
|
|
8
|
+
border: 1px solid #d0d0d0;
|
|
9
|
+
border-radius: 5px;
|
|
10
|
+
box-shadow: 1px 1px 5px #a0a0a0;
|
|
11
|
+
padding: 8px;
|
|
12
|
+
animation: 0.4s fadeIn1;
|
|
13
|
+
animation-fill-mode: forwards;
|
|
14
|
+
color: black;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.AccentBar-compact {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
display: flex;
|
|
19
|
+
position: absolute;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
background-color: white;
|
|
22
|
+
border: 1px solid #d0d0d0;
|
|
23
|
+
border-radius: 5px;
|
|
24
|
+
box-shadow: 1px 1px 5px #a0a0a0;
|
|
25
|
+
padding: 5px;
|
|
26
|
+
animation: 0.4s fadeIn1;
|
|
27
|
+
animation-fill-mode: forwards;
|
|
28
|
+
color: black;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
.AccentBar-outerContainer {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
overflow-y: scroll;
|
|
33
|
+
border-radius: 5px;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
.AccentBar-innerContainer {
|
|
35
|
-
|
|
37
|
+
height: 350px;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
@keyframes fadeIn1 {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
0% {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
100% {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
.AccentBar .symbols-grid {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
display: grid;
|
|
51
|
+
grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
|
|
52
|
+
grid-auto-rows: minmax(min-content, max-content);
|
|
53
|
+
grid-gap: 3px;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
.AccentBar .insert-grid {
|
|
55
|
-
|
|
57
|
+
padding: 5px;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
.AccentBar .type-a-letter {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
grid-column: 1/-1;
|
|
62
|
+
color: #a0a0a0;
|
|
63
|
+
font-family: sans-serif;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
font-weight: bold;
|
|
66
|
+
height: 36px;
|
|
67
|
+
padding-top: 12px;
|
|
68
|
+
padding-left: 20px;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
.AccentBar-button {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
font-family: sans-serif;
|
|
73
|
+
font-size: 17px;
|
|
74
|
+
width: 40px;
|
|
75
|
+
height: 36px;
|
|
76
|
+
background: #f4f4f4;
|
|
77
|
+
border-radius: 5px;
|
|
78
|
+
border: 0px;
|
|
79
|
+
padding: 1px;
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
.AB-compact {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
margin: 0px;
|
|
84
|
+
background: white;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
.AB-narrow {
|
|
86
|
-
|
|
88
|
+
width: 36px;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
.AccentBar-button:hover {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
color: white;
|
|
93
|
+
background: #663676;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
box-shadow: 1px 1px 3px #808080;
|
|
96
|
+
animation: 2s grow;
|
|
97
|
+
animation-fill-mode: forwards;
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
@keyframes grow {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
101
|
+
00% {
|
|
102
|
+
transform: scale(1);
|
|
103
|
+
box-shadow: 0px 0px 0px #808080;
|
|
104
|
+
}
|
|
105
|
+
10% {
|
|
106
|
+
transform: scale(1.3);
|
|
107
|
+
box-shadow: 1px 1px 3px #808080;
|
|
108
|
+
}
|
|
109
|
+
90% {
|
|
110
|
+
transform: scale(1.3);
|
|
111
|
+
box-shadow: 1px 1px 3px #808080;
|
|
112
|
+
}
|
|
113
|
+
100% {
|
|
114
|
+
transform: scale(1.8);
|
|
115
|
+
box-shadow: 1px 1px 3px #808080;
|
|
116
|
+
}
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
.AccentBar-button:active {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
background: #808080;
|
|
121
|
+
color: white;
|
|
122
|
+
cursor: pointer;
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
.AccentBar .tabBar {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
background: white;
|
|
127
|
+
text-align: left;
|
|
128
|
+
border: 0px;
|
|
129
|
+
padding: 10px 0;
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
.AccentBar .tab {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
font-weight: bold;
|
|
135
|
+
color: #404040;
|
|
136
|
+
text-align: left;
|
|
137
|
+
border: 0px;
|
|
138
|
+
height: 30px;
|
|
139
|
+
padding: 2px 5px 2px 5px;
|
|
140
|
+
margin: 2px;
|
|
141
|
+
border-bottom: 4px solid #d0d0d0;
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
.AccentBar .tab:hover {
|
|
143
|
-
|
|
145
|
+
cursor: pointer;
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
.AccentBar .tab-selected {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
font-size: 14px;
|
|
150
|
+
font-weight: bold;
|
|
151
|
+
color: #404040;
|
|
152
|
+
text-align: left;
|
|
153
|
+
border: 0px;
|
|
154
|
+
height: 30px;
|
|
155
|
+
padding: 2px 5px 2px 5px;
|
|
156
|
+
margin: 2px;
|
|
157
|
+
border-bottom: 4px solid #663676;
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
.AccentBar .section-label {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
grid-column: 1/-1;
|
|
162
|
+
font-size: 13px;
|
|
163
|
+
font-weight: bold;
|
|
164
|
+
color: #663676;
|
|
165
|
+
margin-top: 8px;
|
|
166
|
+
margin-left: 8px;
|
|
167
|
+
margin-bottom: 4px;
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
.AccentBar .replace-section {
|
|
169
|
-
|
|
171
|
+
min-height: 70px;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
.AccentBar .tabArea {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
animation: 0.4s fadeIn1;
|
|
176
|
+
animation-fill-mode: forwards;
|
|
175
177
|
}
|