@pie-element/element-player 0.1.7 → 0.1.8-next.20261018222107
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.
|
@@ -848,46 +848,46 @@ var pt = {
|
|
|
848
848
|
abs: ["\\left|#1\\right|", 1],
|
|
849
849
|
perpendicular: "\\perp",
|
|
850
850
|
divide: "\\div"
|
|
851
|
-
}, mt =
|
|
851
|
+
}, mt = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, ht = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, gt = /\\embed\{newLine\}\[\]/g, _t = [
|
|
852
852
|
["$$", "$$"],
|
|
853
853
|
["$", "$"],
|
|
854
854
|
["\\[", "\\]"],
|
|
855
855
|
["\\(", "\\)"]
|
|
856
|
-
]
|
|
856
|
+
];
|
|
857
|
+
function vt(e) {
|
|
858
|
+
for (let [t, n] of _t) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
859
|
+
return e;
|
|
860
|
+
}
|
|
861
|
+
function yt(e) {
|
|
862
|
+
return `\\(${vt(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e)}\\)`.replace(gt, "\\newline ");
|
|
863
|
+
}
|
|
864
|
+
var bt = "mathjax_ignore", xt = "mathjax_process", St = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", Ct = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), wt = "MJX-CHTML-styles", Tt = "PIE-MJX-SVG-styles", Z = "PIE-MathJax-Menu-Settings", Et = { "mjx-container[overflow=\"linebreak\"][display]": {
|
|
857
865
|
overflow: "auto clip",
|
|
858
866
|
"min-width": "initial !important"
|
|
859
|
-
} },
|
|
867
|
+
} }, Dt = 200, Ot = 201, kt = 202;
|
|
860
868
|
function Q(e) {
|
|
861
869
|
let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
|
|
862
870
|
for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
|
|
863
871
|
}
|
|
864
|
-
function
|
|
865
|
-
|
|
866
|
-
return
|
|
867
|
-
}
|
|
868
|
-
function Dt(e) {
|
|
869
|
-
return Et(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
870
|
-
}
|
|
871
|
-
var Ot = "mathjax_ignore", $ = "mathjax_process";
|
|
872
|
-
function kt(e, t) {
|
|
873
|
-
let n = e.closest(`.${Ot}, .${$}`);
|
|
874
|
-
return n !== null && t.contains(n) && !n.classList.contains($);
|
|
872
|
+
function At(e, t) {
|
|
873
|
+
let n = e.closest(`.${bt}, .${xt}`);
|
|
874
|
+
return n !== null && t.contains(n) && !n.classList.contains("mathjax_process");
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function jt(e) {
|
|
877
877
|
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
878
|
-
if (t.dataset.mathHandled || t.closest("mjx-container") ||
|
|
878
|
+
if (t.dataset.mathHandled || t.closest("mjx-container") || At(t, e)) continue;
|
|
879
879
|
let n = t.textContent;
|
|
880
|
-
n && (t.textContent =
|
|
880
|
+
n && (t.textContent = yt(n), t.dataset.mathHandled = "true");
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function Mt(e) {
|
|
884
884
|
for (let t of e.querySelectorAll("math")) t.closest("mjx-container") || t.setAttribute("displaystyle", "true");
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Nt(e, t) {
|
|
887
887
|
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
888
|
-
return (t ?
|
|
888
|
+
return (t ? ht : mt).test(e.textContent ?? "");
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Pt(e) {
|
|
891
891
|
return new Promise((t, n) => {
|
|
892
892
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = f(e, import.meta.url), l = c(), u = {
|
|
893
893
|
loader: {
|
|
@@ -895,14 +895,14 @@ function Nt(e) {
|
|
|
895
895
|
failed: (e) => n(e),
|
|
896
896
|
"output/svg": { ready: (e) => {
|
|
897
897
|
let t = y();
|
|
898
|
-
return
|
|
898
|
+
return Ft(t) && It(t), e;
|
|
899
899
|
} }
|
|
900
900
|
},
|
|
901
901
|
startup: {
|
|
902
902
|
typeset: !1,
|
|
903
903
|
ready: () => {
|
|
904
|
-
let e = y(), r = e?.startup, i =
|
|
905
|
-
i && (
|
|
904
|
+
let e = y(), r = e?.startup, i = Ft(e);
|
|
905
|
+
i && (It(e), Lt(e, s.speechLocales), p(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (Rt(r?.document), zt(r?.document), r?.document?.addStyles?.(Et), ft(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
|
|
906
906
|
}
|
|
907
907
|
},
|
|
908
908
|
tex: { macros: { ...pt } },
|
|
@@ -917,7 +917,7 @@ function Nt(e) {
|
|
|
917
917
|
a11y: { inTabOrder: l }
|
|
918
918
|
}
|
|
919
919
|
};
|
|
920
|
-
r && u.tex && (console.warn(
|
|
920
|
+
r && u.tex && (console.warn(St), u.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], u.tex.processEscapes = !0), a || (u.chtml = { fontURL: "" });
|
|
921
921
|
let d = m(s.speechLocales);
|
|
922
922
|
d && u.options && (u.options.sre = { locale: d }), ae(u, {
|
|
923
923
|
...s,
|
|
@@ -927,16 +927,16 @@ function Nt(e) {
|
|
|
927
927
|
}, n);
|
|
928
928
|
});
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function Ft(e) {
|
|
931
931
|
return !!e?.version?.startsWith("4.");
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function It(e) {
|
|
934
934
|
let t = e?._?.output, n = t?.chtml_ts?.CHTML;
|
|
935
935
|
n && (n.STYLESHEETID = b);
|
|
936
936
|
let r = t?.svg_ts?.SVG;
|
|
937
|
-
r && (r.STYLESHEETID =
|
|
937
|
+
r && (r.STYLESHEETID = Tt);
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function Lt(e, t) {
|
|
940
940
|
let n = e?._?.ui?.menu?.Menu?.Menu;
|
|
941
941
|
if (n) {
|
|
942
942
|
n.MENU_STORAGE = Z;
|
|
@@ -949,13 +949,13 @@ function It(e, t) {
|
|
|
949
949
|
} catch {}
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function Rt(e) {
|
|
953
953
|
if (!e) return;
|
|
954
954
|
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
955
955
|
let n = e.typesetRoot;
|
|
956
956
|
!n || t.has(n) || (Q(n), t.add(n));
|
|
957
957
|
};
|
|
958
|
-
e.addRenderAction?.("pie-strip-latex",
|
|
958
|
+
e.addRenderAction?.("pie-strip-latex", Ot, (e) => {
|
|
959
959
|
for (let t of e.math ?? []) n(t);
|
|
960
960
|
return !1;
|
|
961
961
|
}, (e) => {
|
|
@@ -963,32 +963,32 @@ function Lt(e) {
|
|
|
963
963
|
return t && Q(t), !1;
|
|
964
964
|
});
|
|
965
965
|
let r = e.outputJax?.chtmlStyles;
|
|
966
|
-
r?.id ===
|
|
966
|
+
r?.id === wt && (r.id = b), Vt();
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function zt(e) {
|
|
969
969
|
let t = (e) => {
|
|
970
970
|
e.typesetRoot && st(e.typesetRoot);
|
|
971
971
|
};
|
|
972
|
-
e?.addRenderAction?.("pie-name-math",
|
|
972
|
+
e?.addRenderAction?.("pie-name-math", kt, (e) => {
|
|
973
973
|
for (let n of e.math ?? []) t(n);
|
|
974
974
|
return !1;
|
|
975
975
|
}, (e) => (t(e), !1));
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function $(e) {
|
|
978
978
|
return e instanceof HTMLStyleElement && se.includes(e.id);
|
|
979
979
|
}
|
|
980
980
|
function Bt(e) {
|
|
981
981
|
ne("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
|
|
982
982
|
}
|
|
983
983
|
function Vt() {
|
|
984
|
-
let e = document.head, t = [...e.children].find(
|
|
984
|
+
let e = document.head, t = [...e.children].find($);
|
|
985
985
|
if (t) {
|
|
986
986
|
Bt(t);
|
|
987
987
|
return;
|
|
988
988
|
}
|
|
989
989
|
let n = new MutationObserver((e) => {
|
|
990
990
|
for (let t of e) {
|
|
991
|
-
let e = [...t.addedNodes].find(
|
|
991
|
+
let e = [...t.addedNodes].find($);
|
|
992
992
|
if (e) {
|
|
993
993
|
Bt(e), n.disconnect();
|
|
994
994
|
return;
|
|
@@ -1000,7 +1000,7 @@ function Vt() {
|
|
|
1000
1000
|
function Ht(e) {
|
|
1001
1001
|
let t = e?.math;
|
|
1002
1002
|
if (!t?.remove) return;
|
|
1003
|
-
let n = [...t].filter((e) => (e.state?.() ?? 0) >=
|
|
1003
|
+
let n = [...t].filter((e) => (e.state?.() ?? 0) >= Dt && e.typesetRoot?.isConnected === !1);
|
|
1004
1004
|
if (n.length !== 0) {
|
|
1005
1005
|
for (let e of [...n].reverse()) e.clear?.();
|
|
1006
1006
|
t.remove(...n);
|
|
@@ -1019,7 +1019,7 @@ function Ut(e) {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
function Wt(e) {
|
|
1021
1021
|
let t = y();
|
|
1022
|
-
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : Ut(t) :
|
|
1022
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : Ut(t) : Pt(e);
|
|
1023
1023
|
}
|
|
1024
1024
|
function Gt(e) {
|
|
1025
1025
|
return Wt(e).then(() => {
|
|
@@ -1028,17 +1028,17 @@ function Gt(e) {
|
|
|
1028
1028
|
});
|
|
1029
1029
|
}
|
|
1030
1030
|
function Kt(e) {
|
|
1031
|
-
let t = oe, n = t[
|
|
1032
|
-
return n || (n = Gt(e), t[
|
|
1031
|
+
let t = oe, n = t[Ct];
|
|
1032
|
+
return n || (n = Gt(e), t[Ct] = n), n;
|
|
1033
1033
|
}
|
|
1034
1034
|
function qt(e = {}) {
|
|
1035
1035
|
let t = e.useSingleDollar ?? !1;
|
|
1036
1036
|
return async (n) => {
|
|
1037
1037
|
if (typeof window > "u") return;
|
|
1038
1038
|
let r = ce();
|
|
1039
|
-
r && ne("mathjax-3-global", `window.MathJax is MathJax ${r}`),
|
|
1039
|
+
r && ne("mathjax-3-global", `window.MathJax is MathJax ${r}`), jt(n), de(n), Mt(n), Fe(n);
|
|
1040
1040
|
let i = Kt(e);
|
|
1041
|
-
if (!
|
|
1041
|
+
if (!Nt(n, t)) {
|
|
1042
1042
|
i.catch(() => {});
|
|
1043
1043
|
return;
|
|
1044
1044
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./math-mathjax-
|
|
1
|
+
import { t as e } from "./math-mathjax-Un6ar6JF.js";
|
|
2
2
|
//#region ../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/disclose-version.js
|
|
3
3
|
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
|
|
4
4
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/element-player",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8-next.20261018222107",
|
|
4
4
|
"description": "Shared PIE element player web component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"unpkg": "./dist/pie-element-player.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dev": "vite"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pie-element/shared-math-rendering-mathjax": "0.1.
|
|
29
|
+
"@pie-element/shared-math-rendering-mathjax": "0.1.7-next.20261018222107"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"publishConfig": {
|