@pie-lib/math-input 9.0.8-next.20261027193325 → 9.0.8-next.20261103123052
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/keypad/index.js +27 -25
- package/package.json +3 -3
package/dist/keypad/index.js
CHANGED
|
@@ -12,15 +12,14 @@ import u from "debug";
|
|
|
12
12
|
import { color as d } from "@pie-lib/render-ui";
|
|
13
13
|
import { jsx as f } from "react/jsx-runtime";
|
|
14
14
|
//#region src/keypad/index.tsx
|
|
15
|
-
var p = u("pie-lib:math-inline:keypad"), m =
|
|
16
|
-
outline: `
|
|
17
|
-
outlineOffset: "-
|
|
18
|
-
|
|
19
|
-
} }, v = l(n)(({ latex: e }) => {
|
|
15
|
+
var p = u("pie-lib:math-inline:keypad"), m = [d.text(), d.keypadInk()], h = { "& .MuiTouchRipple-root": { color: `rgb(from ${d.text()} min(r, 255 - r) min(g, 255 - g) min(b, 255 - b))` } }, g = { "&.Mui-focusVisible": {
|
|
16
|
+
outline: `4px solid ${d.keyboardFocusOutline()}`,
|
|
17
|
+
outlineOffset: "-4px"
|
|
18
|
+
} }, _ = l(n)(({ latex: e }) => {
|
|
20
19
|
let t = {
|
|
21
20
|
pointerEvents: "none",
|
|
22
21
|
textTransform: "none !important",
|
|
23
|
-
color:
|
|
22
|
+
color: m,
|
|
24
23
|
"& .mq-scaled.mq-sqrt-prefix": { transform: "scale(1, 0.9) !important" },
|
|
25
24
|
"& .mq-sup-only .mq-sup": { marginBottom: "0.9px !important" },
|
|
26
25
|
"& .mq-empty": { backgroundColor: `${d.keypadEmptyPlaceholder()} !important` },
|
|
@@ -114,12 +113,12 @@ var p = u("pie-lib:math-inline:keypad"), m = d.v("pie"), h = [d.text(), d.keypad
|
|
|
114
113
|
}
|
|
115
114
|
} : t;
|
|
116
115
|
});
|
|
117
|
-
|
|
118
|
-
var
|
|
116
|
+
_.propTypes = { latex: o.string.isRequired };
|
|
117
|
+
var v = (e) => e ? {
|
|
119
118
|
gridTemplateColumns: `repeat(${e.columns}, minmax(min-content, 150px))`,
|
|
120
119
|
gridTemplateRows: `repeat(${e.rows}, minmax(40px, 60px))`,
|
|
121
120
|
gridAutoFlow: "initial"
|
|
122
|
-
} : {},
|
|
121
|
+
} : {}, y = l("div")(() => ({
|
|
123
122
|
...t,
|
|
124
123
|
width: "100%",
|
|
125
124
|
display: "grid",
|
|
@@ -135,19 +134,19 @@ var y = (e) => e ? {
|
|
|
135
134
|
gridTemplateRows: "repeat(4, minmax(40px, 50px)) !important",
|
|
136
135
|
"& *": { fontFamily: "Roboto, Helvetica, Arial, sans-serif !important" }
|
|
137
136
|
}
|
|
138
|
-
})),
|
|
137
|
+
})), b = l(s)(({ category: e, isDelete: t, isComma: n, isDot: r }) => ({
|
|
139
138
|
minWidth: "auto",
|
|
140
139
|
textTransform: "none",
|
|
141
140
|
fontSize: n || r ? "200% !important" : "140% !important",
|
|
142
141
|
lineHeight: n || r ? "100%" : "normal",
|
|
143
|
-
color:
|
|
142
|
+
color: m,
|
|
144
143
|
backgroundColor: e === "operators" ? d.keypadButtonOperator() : d.keypadButton(),
|
|
145
144
|
"&:hover": { backgroundColor: e === "operators" ? d.keypadButtonOperatorHover() : d.keypadButtonHover() },
|
|
145
|
+
...h,
|
|
146
146
|
...g,
|
|
147
|
-
..._,
|
|
148
147
|
borderRadius: 0,
|
|
149
148
|
...t && { fontFamily: "Roboto, Helvetica, Arial, sans-serif !important" }
|
|
150
|
-
})),
|
|
149
|
+
})), x = l(s)(({ category: e }) => ({
|
|
151
150
|
textTransform: "none",
|
|
152
151
|
padding: 0,
|
|
153
152
|
margin: 0,
|
|
@@ -156,15 +155,15 @@ var y = (e) => e ? {
|
|
|
156
155
|
borderRadius: 0,
|
|
157
156
|
backgroundColor: e === "operators" ? d.keypadButtonOperator() : d.keypadButton(),
|
|
158
157
|
"&:hover": { backgroundColor: e === "operators" ? d.keypadButtonOperatorHover() : d.keypadButtonHover() },
|
|
159
|
-
...
|
|
160
|
-
...
|
|
161
|
-
})),
|
|
158
|
+
...h,
|
|
159
|
+
...g
|
|
160
|
+
})), S = l(c)(({ category: e }) => ({
|
|
162
161
|
minWidth: "auto",
|
|
163
162
|
backgroundColor: e === "operators" ? d.keypadButtonOperator() : d.keypadButton(),
|
|
164
163
|
"&:hover": { backgroundColor: e === "operators" ? d.keypadButtonOperatorHover() : d.keypadButtonHover() },
|
|
165
164
|
borderRadius: 0,
|
|
166
165
|
"& .icon": { height: "30px" }
|
|
167
|
-
})),
|
|
166
|
+
})), C = class extends a.Component {
|
|
168
167
|
static propTypes = {
|
|
169
168
|
className: o.string,
|
|
170
169
|
controlledKeypadMode: o.bool,
|
|
@@ -229,9 +228,9 @@ var y = (e) => e ? {
|
|
|
229
228
|
"language"
|
|
230
229
|
].includes(a), s = o ? this.flowKeys([], n || []) : this.flowKeys(t, n || []), c = s.length % 5 ? 1 : 0, l = {
|
|
231
230
|
gridTemplateColumns: `repeat(${Math.floor(s.length / 5) + c}, minmax(min-content, 150px))`,
|
|
232
|
-
...
|
|
231
|
+
...v(r)
|
|
233
232
|
};
|
|
234
|
-
return /* @__PURE__ */ f(
|
|
233
|
+
return /* @__PURE__ */ f(y, {
|
|
235
234
|
ref: this.keypadRef,
|
|
236
235
|
className: [e, a].filter(Boolean).join(" "),
|
|
237
236
|
style: l,
|
|
@@ -239,7 +238,7 @@ var y = (e) => e ? {
|
|
|
239
238
|
children: s.map((e, t) => {
|
|
240
239
|
let n = this.buttonClick.bind(this, e);
|
|
241
240
|
if (!e) return /* @__PURE__ */ f("span", {}, `empty-${t}`);
|
|
242
|
-
if (!(e.label || e.latex || e.icon || e.command || e.keystroke || e.write || e.type || e.actions || e.extraProps)) return /* @__PURE__ */ f(
|
|
241
|
+
if (!(e.label || e.latex || e.icon || e.command || e.keystroke || e.write || e.type || e.actions || e.extraProps)) return /* @__PURE__ */ f(b, {
|
|
243
242
|
disabled: !0,
|
|
244
243
|
"aria-hidden": "true",
|
|
245
244
|
tabIndex: -1,
|
|
@@ -252,16 +251,18 @@ var y = (e) => e ? {
|
|
|
252
251
|
...e.actions || {},
|
|
253
252
|
...e.extraProps || {}
|
|
254
253
|
};
|
|
255
|
-
if (e.latex) return /* @__PURE__ */ f(
|
|
254
|
+
if (e.latex) return /* @__PURE__ */ f(x, {
|
|
255
|
+
disableFocusRipple: !0,
|
|
256
256
|
onClick: r.onClick,
|
|
257
257
|
disabled: r.disabled,
|
|
258
258
|
category: o ? void 0 : e.category,
|
|
259
259
|
"aria-label": e.ariaLabel ? e.ariaLabel : e.name || e.label,
|
|
260
260
|
...e.actions || {},
|
|
261
261
|
...e.extraProps || {},
|
|
262
|
-
children: /* @__PURE__ */ f(
|
|
262
|
+
children: /* @__PURE__ */ f(_, { latex: e.latex })
|
|
263
263
|
}, r.key);
|
|
264
|
-
if (e.label) return /* @__PURE__ */ f(
|
|
264
|
+
if (e.label) return /* @__PURE__ */ f(b, {
|
|
265
|
+
disableFocusRipple: !0,
|
|
265
266
|
onClick: r.onClick,
|
|
266
267
|
disabled: r.disabled,
|
|
267
268
|
category: o ? void 0 : e.category,
|
|
@@ -275,7 +276,8 @@ var y = (e) => e ? {
|
|
|
275
276
|
}, r.key);
|
|
276
277
|
{
|
|
277
278
|
let t = e.icon ? e.icon : "div";
|
|
278
|
-
return /* @__PURE__ */ f(
|
|
279
|
+
return /* @__PURE__ */ f(S, {
|
|
280
|
+
disableFocusRipple: !0,
|
|
279
281
|
tabIndex: "-1",
|
|
280
282
|
onClick: r.onClick,
|
|
281
283
|
disabled: r.disabled,
|
|
@@ -291,4 +293,4 @@ var y = (e) => e ? {
|
|
|
291
293
|
}
|
|
292
294
|
};
|
|
293
295
|
//#endregion
|
|
294
|
-
export {
|
|
296
|
+
export { C as KeyPad, C as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/math-input",
|
|
3
|
-
"version": "9.0.8-next.
|
|
3
|
+
"version": "9.0.8-next.20261103123052",
|
|
4
4
|
"description": "React implementation of @pie-lib/math-input",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"debug": "^4.1.1",
|
|
17
17
|
"prop-types": "^15.7.2",
|
|
18
18
|
"@pie-element/shared-lodash": "0.1.4-next.20261026212738",
|
|
19
|
-
"@pie-lib/render-ui": "8.0.8-next.
|
|
20
|
-
"@pie-lib/translator": "5.0.3-next.
|
|
19
|
+
"@pie-lib/render-ui": "8.0.8-next.20261103123052",
|
|
20
|
+
"@pie-lib/translator": "5.0.3-next.20261103123052"
|
|
21
21
|
},
|
|
22
22
|
"type": "module",
|
|
23
23
|
"main": "./dist/index.js",
|