@pie-element/shared-math-rendering-mathjax 0.1.8-next.20261021000713 → 0.1.8

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.
Files changed (47) hide show
  1. package/dist/browser/{PUA-CbN4yDmT.js → PUA-CJdZh2Wf.js} +1 -1
  2. package/dist/browser/{accents-CuTAD9hz.js → accents-DUN0SGpR.js} +1 -1
  3. package/dist/browser/{accents-b-i-kTUl6uGi.js → accents-b-i-BonjkJko.js} +1 -1
  4. package/dist/browser/{arabic-Cuxbegyx.js → arabic-DPsBZ_6r.js} +1 -1
  5. package/dist/browser/{arrows-Do9BFEGJ.js → arrows-BdSPBhI1.js} +1 -1
  6. package/dist/browser/{braille-C2YZEvXz.js → braille-D67IP_T7.js} +1 -1
  7. package/dist/browser/{braille-d-CwSD319B.js → braille-d-CP1DcXKB.js} +1 -1
  8. package/dist/browser/{calligraphic-DQVVeBro.js → calligraphic-D3g8rnJG.js} +1 -1
  9. package/dist/browser/{cherokee-CrPMaIKH.js → cherokee-D9O6NlBu.js} +1 -1
  10. package/dist/browser/{cyrillic-CaFzNnzy.js → cyrillic-DJvnsbqS.js} +1 -1
  11. package/dist/browser/{cyrillic-ss-CcSXB7Cf.js → cyrillic-ss-C1kj2CQV.js} +1 -1
  12. package/dist/browser/{devanagari-I6l5QKGg.js → devanagari-DaEPBZJl.js} +1 -1
  13. package/dist/browser/{double-struck-L6xkxWZd.js → double-struck-DMCx5OKu.js} +1 -1
  14. package/dist/browser/{fraktur-ClbpHv7v.js → fraktur-BhEkb_dS.js} +1 -1
  15. package/dist/browser/{greek-r3EyO7jP.js → greek-BUUqFJHy.js} +1 -1
  16. package/dist/browser/{greek-ss-BtGf6Dlt.js → greek-ss-BEMpAOeY.js} +1 -1
  17. package/dist/browser/{hebrew-DiqU3zjt.js → hebrew-Bzl8nOEB.js} +1 -1
  18. package/dist/browser/index.js +360 -8994
  19. package/dist/browser/{latin-owjqN_GN.js → latin-P9zTNHCd.js} +1 -1
  20. package/dist/browser/{latin-b-Bzvjr2WB.js → latin-b-PZ4kq6lM.js} +1 -1
  21. package/dist/browser/{latin-bi-ek_n1Eq7.js → latin-bi-CmN1JUsd.js} +1 -1
  22. package/dist/browser/{latin-i-CZNhuMaR.js → latin-i-CXBnDzSq.js} +1 -1
  23. package/dist/browser/{marrows-4z_l10iZ.js → marrows-B7SUVmW5.js} +1 -1
  24. package/dist/browser/{math-Cs97lB_F.js → math-vXr73lk6.js} +1 -1
  25. package/dist/browser/{mathjax-7Uf03266.js → mathjax-2nQh1S7u.js} +6701 -6672
  26. package/dist/browser/{monospace-CGXct8fs.js → monospace-DoS6YAxd.js} +1 -1
  27. package/dist/browser/{monospace-ex-DvsIXSF9.js → monospace-ex-DRTvVzi3.js} +1 -1
  28. package/dist/browser/{monospace-l-BGVS0yCI.js → monospace-l-DUCa7CxU.js} +1 -1
  29. package/dist/browser/{mshapes-B4HEzEgD.js → mshapes-CpjjJVqV.js} +1 -1
  30. package/dist/browser/{phonetics-D5AM_a_d.js → phonetics-bqiQHE22.js} +1 -1
  31. package/dist/browser/{phonetics-ss-ChDEGY5y.js → phonetics-ss-Q6DbUcOI.js} +1 -1
  32. package/dist/browser/{sans-serif-Cj9spRF-.js → sans-serif-Bp2jHFky.js} +1 -1
  33. package/dist/browser/{sans-serif-b-BdUb_Z_y.js → sans-serif-b-BibGpEzd.js} +1 -1
  34. package/dist/browser/{sans-serif-bi-DfdLvy57.js → sans-serif-bi-iTiG6eGH.js} +1 -1
  35. package/dist/browser/{sans-serif-ex-CClUQG0Y.js → sans-serif-ex-C8xaAvoq.js} +1 -1
  36. package/dist/browser/{sans-serif-i-D3KODAl0.js → sans-serif-i-BU3dKyZu.js} +1 -1
  37. package/dist/browser/{sans-serif-r-MNhQrum9.js → sans-serif-r-CgglPh5w.js} +1 -1
  38. package/dist/browser/{script-CKFQLx5d.js → script-ClY84mt2.js} +1 -1
  39. package/dist/browser/{shapes-DyVxqSxY.js → shapes-myFFmw20.js} +1 -1
  40. package/dist/browser/speech-worker-BeK2X8Ed.js +132 -0
  41. package/dist/browser/{symbols-BKRxgFQ3.js → symbols-Cm-dpMqm.js} +1 -1
  42. package/dist/browser/{symbols-b-i-D3kdYI4S.js → symbols-b-i-Ckpc29j-.js} +1 -1
  43. package/dist/browser/{variants-vyRqULni.js → variants-CXvLtZew.js} +1 -1
  44. package/dist/index.js +395 -9029
  45. package/dist/render-math.d.ts +1 -6
  46. package/package.json +1 -1
  47. package/dist/browser/speech-worker-DFQhVkcx.js +0 -158
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/monospace.js
3
3
  t.dynamicSetup("", "monospace", e({ M: {
4
4
  normal: {
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/monospace-ex.js
3
3
  t.dynamicSetup("", "monospace-ex", e({ MX: { monospace: {
4
4
  161: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/monospace-l.js
3
3
  t.dynamicSetup("", "monospace-l", e({ ML: { monospace: {
4
4
  192: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/mshapes.js
3
3
  t.dynamicSetup("", "mshapes", e({ MSH: { normal: {
4
4
  128896: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/phonetics.js
3
3
  t.dynamicSetup("", "phonetics", e({
4
4
  PH: { normal: {
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/phonetics-ss.js
3
3
  t.dynamicSetup("", "phonetics-ss", e({
4
4
  PHSS: { "sans-serif": {
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/sans-serif.js
3
3
  t.dynamicSetup("", "sans-serif", e({
4
4
  SS: {
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/sans-serif-b.js
3
3
  t.dynamicSetup("", "sans-serif-b", e({ SSLB: { "bold-sans-serif": {
4
4
  192: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/sans-serif-bi.js
3
3
  t.dynamicSetup("", "sans-serif-bi", e({ SSLIB: { "sans-serif-bold-italic": {
4
4
  192: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/sans-serif-ex.js
3
3
  t.dynamicSetup("", "sans-serif-ex", e({
4
4
  SSX: { "sans-serif": {
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/sans-serif-i.js
3
3
  t.dynamicSetup("", "sans-serif-i", e({ SSLI: { "sans-serif-italic": {
4
4
  192: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/sans-serif-r.js
3
3
  t.dynamicSetup("", "sans-serif-r", e({ SSLR: { "sans-serif": {
4
4
  192: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/script.js
3
3
  t.dynamicSetup("", "script", e({
4
4
  S: {
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/shapes.js
3
3
  t.dynamicSetup("", "shapes", e({
4
4
  SH: { normal: {
@@ -0,0 +1,132 @@
1
+ //#region src/assets.ts
2
+ var e = "4.1.3", t = "https://github.com/pie-framework/pie-elements-ng/blob/develop/docs/MATH-RENDERING.md#assets", n = "@pie-lib/math-rendering@2", r = ["nemeth", "euro"], i = `mathjax@${e}/sre`, a = /^[^@]+@[^@]+$/;
3
+ function o(e) {
4
+ if (!e) return;
5
+ let t;
6
+ try {
7
+ t = new URL(e);
8
+ } catch {
9
+ return;
10
+ }
11
+ if (t.origin === "null") return;
12
+ let n = t.pathname.split("/");
13
+ for (let e = n.length - 1; e > 0; e--) {
14
+ let r = n[e];
15
+ if (r === "node_modules") return;
16
+ if (!a.test(r)) continue;
17
+ let i = n[e - 1]?.startsWith("@") ? e - 1 : e;
18
+ return t.origin + n.slice(0, i).join("/");
19
+ }
20
+ }
21
+ function s() {
22
+ let e = globalThis[n]?.opts;
23
+ return e && typeof e == "object" ? e : {};
24
+ }
25
+ function c() {
26
+ return s().inTabOrder === !0;
27
+ }
28
+ function l(e) {
29
+ if (typeof e != "string" || !e) return;
30
+ let t = typeof document > "u" ? void 0 : document.baseURI;
31
+ try {
32
+ return new URL(e, t).href.replace(/\/+$/, "");
33
+ } catch {
34
+ return;
35
+ }
36
+ }
37
+ function u(e) {
38
+ if (!e || typeof e != "object") return;
39
+ let t = /* @__PURE__ */ new Map();
40
+ for (let [n, r] of Object.entries(e)) {
41
+ let e = l(r);
42
+ e && t.set(n, e);
43
+ }
44
+ return t.size ? t : void 0;
45
+ }
46
+ function d(e) {
47
+ if (Array.isArray(e)) return new Map(e.filter((e) => typeof e == "string").map((e) => [e, void 0]));
48
+ if (e && typeof e == "object") return new Map(Object.entries(e).map(([e, t]) => [e, typeof t == "string" ? t : void 0]));
49
+ }
50
+ function f(e, t) {
51
+ let n = s(), r = l(e.assetRoot ?? n.assetRoot) ?? o(t);
52
+ return {
53
+ root: r,
54
+ speechPath: l(e.speechPath ?? n.speechPath) ?? (r ? `${r}/mathjax@4.1.3/sre` : void 0),
55
+ speechLocales: d(e.speechLocales ?? n.speechLocales),
56
+ urls: u(e.assetUrls ?? n.assetUrls)
57
+ };
58
+ }
59
+ function p({ root: e, urls: t }, n) {
60
+ return t?.get(n) ?? (e ? `${e}/${n}` : void 0);
61
+ }
62
+ function m({ speechPath: e, urls: t }, n) {
63
+ return t?.get(`mathjax@4.1.3/sre/${n}`) ?? (e ? `${e}/${n}` : void 0);
64
+ }
65
+ function h(e, t) {
66
+ if (e && t) {
67
+ for (let n of [...e.keys()]) !t.has(n) && !r.includes(n) && e.delete(n);
68
+ for (let [n, r] of t) (r || !e.has(n)) && e.set(n, r ?? n);
69
+ }
70
+ }
71
+ function g(e) {
72
+ if (e && !e.has("en")) return [...e.keys()].find((e) => !r.includes(e));
73
+ }
74
+ var _ = "pie-mathjax-no-asset-root", v = {
75
+ untypeset: "no MathJax loads, so math stays untypeset",
76
+ "no-web-fonts": "math renders without web fonts",
77
+ "no-web-fonts-or-speech": "math renders without web fonts and speech"
78
+ }, y = Symbol.for("@pie-element/shared-math-rendering-mathjax/no-assets");
79
+ function b(e) {
80
+ let r = globalThis;
81
+ r[y] ??= [];
82
+ let i = r[y];
83
+ if (i.includes(e)) return;
84
+ i.push(e);
85
+ let a = `[math-rendering] No asset root for MathJax: ${v[e]}. Set window['${n}'].opts.assetRoot to an npm root. See ${t}`;
86
+ e === "untypeset" ? console.error(a) : console.warn(a), typeof window < "u" && window.dispatchEvent(new CustomEvent(_, { detail: {
87
+ effect: e,
88
+ message: a,
89
+ docsUrl: t
90
+ } }));
91
+ }
92
+ //#endregion
93
+ //#region src/speech-worker.ts
94
+ var x = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
95
+ function S() {
96
+ let e = globalThis;
97
+ e[x] || (e[x] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${t}`));
98
+ }
99
+ function C(e) {
100
+ let t = e.webworker;
101
+ if (!t || t.ready) return;
102
+ e.options ??= {};
103
+ let n = e.options;
104
+ n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), S();
105
+ }
106
+ function w(e) {
107
+ let t = e?.adaptor, n = t?.createWorker;
108
+ e && t && n && (t.createWorker = async (r, i) => {
109
+ let a = await n.call(t, r, i);
110
+ return a.addEventListener("error", () => C(e), { once: !0 }), a;
111
+ });
112
+ }
113
+ var T = `${i}/mathmaps/`;
114
+ function E(e) {
115
+ let t = m(e, "speech-worker.js");
116
+ if (!t) return;
117
+ let n = e.speechPath ? `${e.speechPath}/mathmaps` : "mathmaps", r = {};
118
+ for (let [t, i] of e.urls ?? []) t.startsWith(T) && (r[`${n}/${t.slice(T.length)}`] = i);
119
+ let i = [`self.maps = ${JSON.stringify(n)};`];
120
+ return Object.keys(r).length && i.push("{", ` const urls = new Map(Object.entries(${JSON.stringify(r)}));`, " const fetchFile = self.fetch.bind(self);", " self.fetch = (input, init) => fetchFile(urls.get(input) ?? input, init);", "}"), i.push(`importScripts(${JSON.stringify(t)});`), i.join("\n");
121
+ }
122
+ function D(e, t) {
123
+ let n = URL.createObjectURL(new Blob([e], { type: "text/javascript" }));
124
+ try {
125
+ let e = new Worker(n);
126
+ return e.onmessage = t, e;
127
+ } finally {
128
+ URL.revokeObjectURL(n);
129
+ }
130
+ }
131
+ //#endregion
132
+ export { _ as a, h as c, f as d, e as i, c as l, E as n, p as o, D as r, g as s, w as t, b as u };
@@ -1,4 +1,4 @@
1
- import { a as e, n as t, r as n } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t, r as n } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/symbols.js
3
3
  t.dynamicSetup("", "symbols", e({ SY: { normal: {
4
4
  161: [
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/symbols-b-i.js
3
3
  t.dynamicSetup("", "symbols-b-i", e({
4
4
  SYB: { bold: {
@@ -1,4 +1,4 @@
1
- import { a as e, n as t } from "./mathjax-7Uf03266.js";
1
+ import { a as e, n as t } from "./mathjax-2nQh1S7u.js";
2
2
  //#region ../../../node_modules/.bun/@mathjax+mathjax-newcm-font@4.1.3/node_modules/@mathjax/mathjax-newcm-font/mjs/chtml/dynamic/variants.js
3
3
  t.dynamicSetup("", "variants", e({ VX: { "-tex-variant": {
4
4
  34: [