@pie-lib/math-toolbar 3.0.3-next.38 → 3.0.3-next.57

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.
@@ -1,125 +0,0 @@
1
- import { markFractionBaseSuperscripts as e } from "./utils.js";
2
- import t from "react";
3
- import n from "prop-types";
4
- import r from "debug";
5
- import { styled as i } from "@mui/material/styles";
6
- import { mq as a } from "@pie-lib/math-input";
7
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
- //#region src/math-preview.tsx
9
- var { commonMqFontStyles: c, longdivStyles: l, supsubStyles: u } = a.CommonMqStyles, d = r("@pie-lib:math-toolbar:math-preview"), f = i("div")(({ theme: e, isSelected: t }) => ({
10
- display: "inline-flex",
11
- alignItems: "center",
12
- position: "relative",
13
- "& *": c,
14
- ...u,
15
- ...l,
16
- "& > .mq-math-mode": { border: t ? "solid 0px lightgrey" : "solid 1px lightgrey" },
17
- "& > .mq-focused": {
18
- outline: "none",
19
- boxShadow: "none",
20
- border: "solid 1px black",
21
- borderRadius: "0px"
22
- },
23
- "& > .mq-math-mode .mq-root-block": { paddingTop: "7px !important" },
24
- "& > .mq-math-mode .mq-overarc ": { paddingTop: "0.45em !important" },
25
- "& > .mq-math-mode .mq-sqrt-prefix": {
26
- verticalAlign: "baseline !important",
27
- top: "1px !important",
28
- left: "-0.1em !important"
29
- },
30
- "& > .mq-math-mode .mq-denominator": {
31
- marginTop: "-5px !important",
32
- padding: "0.5em 0.1em 0.1em !important"
33
- },
34
- "& > .mq-math-mode .mq-numerator, .mq-math-mode .mq-over": {
35
- padding: "0 0.1em !important",
36
- paddingBottom: "0 !important",
37
- marginBottom: "-2px"
38
- },
39
- "& > .mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty": {
40
- paddingTop: "6px !important",
41
- paddingLeft: "4px !important"
42
- },
43
- "& > .mq-math-mode .mq-longdiv .mq-longdiv-inner": { marginLeft: "0 !important" },
44
- "& > .mq-math-mode .mq-overarrow": { fontFamily: "Roboto, Helvetica, Arial, sans-serif !important" },
45
- "& > .mq-math-mode .mq-paren": {
46
- verticalAlign: "top !important",
47
- padding: "1px 0.1em !important"
48
- },
49
- "& > .mq-math-mode .mq-sqrt-stem": {
50
- borderTop: "0.07em solid",
51
- marginLeft: "-1.5px",
52
- marginTop: "-2px !important",
53
- paddingTop: "5px !important"
54
- },
55
- "& .mq-overarrow-inner": {
56
- paddingTop: "0 !important",
57
- border: "none !important"
58
- },
59
- "& .mq-editable-field .mq-cursor": { marginTop: "-15px !important" },
60
- "& .mq-overarrow.mq-arrow-both": {
61
- top: "7.5px",
62
- marginTop: "0px",
63
- minWidth: "1.23em",
64
- "& *": { lineHeight: "1 !important" },
65
- "&:before": {
66
- top: "-0.4em",
67
- left: "-1px"
68
- },
69
- "&:after": {
70
- top: "0px !important",
71
- position: "absolute !important",
72
- right: "-2px"
73
- },
74
- "&.mq-empty:after": { top: "-0.45em" }
75
- },
76
- "& .mq-overarrow.mq-arrow-right": { "&:before": {
77
- top: "-0.4em",
78
- right: "-1px"
79
- } },
80
- "& .mq-overarrow-inner-right": { display: "none !important" },
81
- "& .mq-overarrow-inner-left": { display: "none !important" },
82
- "& .mq-longdiv-inner": {
83
- borderTop: "1px solid !important",
84
- paddingTop: "1.5px !important"
85
- },
86
- "& .mq-parallelogram": { lineHeight: .85 },
87
- "& span[data-prime=\"true\"]": { fontFamily: "Roboto, Helvetica, Arial, sans-serif !important" },
88
- ...t && { border: `solid 1px ${e.palette.primary.main}` }
89
- })), p = i("span")({
90
- position: "absolute",
91
- bottom: 0,
92
- left: 0,
93
- right: 0,
94
- top: 0
95
- }), m = class extends t.Component {
96
- static propTypes = {
97
- latex: n.string,
98
- isSelected: n.bool,
99
- onFocus: n.func,
100
- onBlur: n.func
101
- };
102
- componentDidMount() {
103
- e();
104
- }
105
- componentDidUpdate(t) {
106
- this.props.latex !== t.latex && e();
107
- }
108
- render() {
109
- let { isSelected: e, onFocus: t, onBlur: n, latex: r } = this.props;
110
- return d("[render] latex: ", r), /* @__PURE__ */ s(f, {
111
- isSelected: e,
112
- children: [
113
- " ",
114
- /* @__PURE__ */ o(p, {}),
115
- /* @__PURE__ */ o(a.Static, {
116
- latex: r,
117
- onFocus: t,
118
- onBlur: n
119
- })
120
- ]
121
- });
122
- }
123
- };
124
- //#endregion
125
- export { m as default };
package/dist/utils.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/math-toolbar/src/utils.js
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- export declare const markFractionBaseSuperscripts: () => void;
package/dist/utils.js DELETED
@@ -1,9 +0,0 @@
1
- //#region src/utils.ts
2
- var e = () => {
3
- document.querySelectorAll(".mq-supsub.mq-sup-only").forEach((e) => {
4
- let t = e.previousElementSibling;
5
- t && t.classList.contains("mq-non-leaf") && t.querySelector(".mq-fraction") ? e.classList.add("mq-after-fraction-group") : e.classList.remove("mq-after-fraction-group");
6
- });
7
- };
8
- //#endregion
9
- export { e as markFractionBaseSuperscripts };