@zzish/math-rich-input 0.1.0

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/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@zzish/math-rich-input",
3
+ "version": "0.1.0",
4
+ "description": "React component for user to enter rich text with embedded math equations.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/zzish/math-rich-input"
8
+ },
9
+ "license": "MIT",
10
+ "author:": {
11
+ "name": "Charles Wiles",
12
+ "email": "charles@zzish.com"
13
+ },
14
+ "main": "dist/index.js",
15
+ "scripts": {
16
+ "build": "rollup --config"
17
+ },
18
+ "dependencies": {
19
+ "katex": "^0.12.0",
20
+ "react": "^17.0.1",
21
+ "react-dom": "^17.0.1",
22
+ "react-mathquill": "^1.0.1",
23
+ "react-transition-group": "^4.4.1",
24
+ "web-vitals": "^0.2.4"
25
+ },
26
+ "eslintConfig": {
27
+ "extends": [
28
+ "react-app",
29
+ "react-app/jest"
30
+ ]
31
+ },
32
+ "devDependencies": {
33
+ "@babel/core": "^7.13.10",
34
+ "@babel/plugin-proposal-class-properties": "^7.13.0",
35
+ "@babel/preset-env": "^7.13.10",
36
+ "@babel/preset-react": "^7.12.13",
37
+ "@babel/register": "^7.13.8",
38
+ "@rollup/plugin-babel": "^5.3.0",
39
+ "@rollup/plugin-commonjs": "^17.1.0",
40
+ "@rollup/plugin-node-resolve": "^11.2.0",
41
+ "rollup": "^2.41.4",
42
+ "rollup-plugin-css-only": "^3.1.0"
43
+ }
44
+ }
@@ -0,0 +1,31 @@
1
+ import { babel } from "@rollup/plugin-babel";
2
+ import { nodeResolve } from "@rollup/plugin-node-resolve";
3
+ import commonjs from "@rollup/plugin-commonjs";
4
+ import css from "rollup-plugin-css-only";
5
+
6
+ const extensions = [".js", ".jsx"];
7
+
8
+ export default {
9
+ input: "src/index.js",
10
+ output: {
11
+ file: "dist/index.js",
12
+ // format: "cjs",
13
+ },
14
+ plugins: [
15
+ nodeResolve({ main: true }),
16
+ css({
17
+ output: "math-rich-input.css"
18
+ }),
19
+ babel({
20
+ babelHelpers: "bundled",
21
+ exclude: "node_modules/**",
22
+ extensions,
23
+ presets: ["@babel/env", "@babel/react"],
24
+ plugins: ["@babel/plugin-proposal-class-properties"]
25
+ }),
26
+ commonjs({
27
+ extensions,
28
+ }),
29
+ ],
30
+ external: ["react", "react-dom"],
31
+ };
@@ -0,0 +1,169 @@
1
+
2
+ /* Note that the top left position of the accent bar is set programatically in componentDidMount */
3
+
4
+ .AccentBar {
5
+ position: fixed;
6
+ z-index: 1;
7
+ width:348px; /* max of 346px to ensure fits on Moto G4 mobile device screens */
8
+ background-color: white;
9
+ border: 1px solid #d0d0d0;
10
+ border-radius: 5px;
11
+ box-shadow: 1px 1px 5px #a0a0a0;
12
+ padding:5px;
13
+ animation: 0.4s fadeIn1;
14
+ animation-fill-mode: forwards;
15
+ }
16
+
17
+ .AccentBar-compact {
18
+ position: fixed;
19
+ z-index: 1;
20
+ background-color: white;
21
+ border: 1px solid #d0d0d0;
22
+ border-radius: 5px;
23
+ box-shadow: 1px 1px 5px #a0a0a0;
24
+ padding:5px;
25
+ top:0px;
26
+ left:0px; /* Important to set this default so that accent bar renders to optimal width */
27
+ animation: 0.4s fadeIn1;
28
+ animation-fill-mode: forwards;
29
+ }
30
+
31
+ .AccentBar-outerContainer {
32
+ overflow-y:scroll;
33
+ border-radius:5px;
34
+ overflow: overlay;
35
+ }
36
+
37
+ .AccentBar-innerContainer {
38
+ height:350px; /* Height of overall box */
39
+ }
40
+
41
+ @keyframes fadeIn1 {
42
+ 0% {
43
+ opacity: 0;
44
+ }
45
+ 100% {
46
+ opacity: 1.0;
47
+ }
48
+ }
49
+
50
+ .AccentBar .type-a-letter {
51
+ color: #A0A0A0;
52
+ font-family:sans-serif;
53
+ font-size: 14px;
54
+ font-weight: bold;
55
+ height: 36px;
56
+ padding-top:12px;
57
+ padding-left:20px;
58
+ }
59
+
60
+ .AccentBar-button {
61
+ font-family:sans-serif;
62
+ font-size: 17px;
63
+ width:40px;
64
+ height: 36px;
65
+ background: #f4f4f4;
66
+ border-radius: 5px;
67
+ border: 0px;
68
+ padding: 1px;
69
+ margin: 6px;
70
+ }
71
+
72
+ .AB-compact {
73
+ margin: 0px;
74
+ background: white;
75
+ }
76
+
77
+ .AB-narrow {
78
+ width:30px;
79
+ }
80
+
81
+ .AccentBar-button:hover {
82
+ /* filter: saturate(2.0); */
83
+ color: white;
84
+ background: #663676;
85
+ cursor: pointer;
86
+ box-shadow: 1px 1px 3px #808080;
87
+ animation: 2s grow;
88
+ animation-fill-mode: forwards;
89
+ }
90
+
91
+ @keyframes grow {
92
+ 00% {
93
+ transform: scale(1);
94
+ box-shadow: 0px 0px 0px #808080;
95
+ }
96
+ 10% {
97
+ transform: scale(1.3);
98
+ box-shadow: 1px 1px 3px #808080;
99
+ }
100
+ 90% {
101
+ transform: scale(1.3);
102
+ box-shadow: 1px 1px 3px #808080;
103
+ }
104
+ 100% {
105
+ transform: scale(1.8);
106
+ box-shadow: 1px 1px 3px #808080;
107
+ }
108
+ }
109
+
110
+ .AccentBar-button:active {
111
+ background: #808080;
112
+ color: white;
113
+ cursor: pointer;
114
+ }
115
+
116
+ .AccentBar .tabBar {
117
+ background: white;
118
+ text-align: left;
119
+ border:0px;
120
+ padding:0px 0px 10px 0px;
121
+ margin:5px;
122
+ }
123
+
124
+ .AccentBar .tab {
125
+ font-size: 14px;
126
+ font-weight: bold;
127
+ color: #404040;
128
+ text-align: left;
129
+ border:0px;
130
+ height:30px;
131
+ padding:2px 5px 2px 5px;
132
+ margin:2px;
133
+ border-bottom: 4px solid #d0d0d0;
134
+ }
135
+
136
+ .AccentBar .tab:hover {
137
+ cursor:pointer
138
+ }
139
+
140
+ .AccentBar .tab-selected {
141
+ font-size: 14px;
142
+ font-weight: bold;
143
+ color: #404040;
144
+ text-align: left;
145
+ border:0px;
146
+ height:30px;
147
+ padding:2px 5px 2px 5px;
148
+ margin:2px;
149
+ border-bottom: 4px solid #663676;
150
+ }
151
+
152
+ .AccentBar .section-label {
153
+ font-size: 13px;
154
+ font-weight: bold;
155
+ /* color: #A0A0A0; */
156
+ color: #663676;
157
+ margin-top:8px;
158
+ margin-left:8px;
159
+ margin-bottom:4px;
160
+ }
161
+
162
+ .AccentBar .replace-section {
163
+ min-height: 70px;
164
+ }
165
+
166
+ .AccentBar .tabArea {
167
+ animation: 0.4s fadeIn1;
168
+ animation-fill-mode: forwards;
169
+ }