@pie-element/simple-cloze 0.1.4-next.19 → 0.1.4-next.20
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/author/index.js +1 -0
- package/dist/author/index.js.map +1 -1
- package/dist/browser/author/index.js +1 -0
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/author/index.js +1 -0
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/{i18n-CBClmRAq.js → i18n-BTsdzpBv.js} +220 -213
- package/dist/browser/editor-runtime/i18n-BTsdzpBv.js.map +1 -0
- package/dist/browser/editor-runtime/print/index.js +1 -1
- package/dist/browser/{i18n-CBClmRAq.js → i18n-BTsdzpBv.js} +220 -213
- package/dist/browser/i18n-BTsdzpBv.js.map +1 -0
- package/dist/browser/print/index.js +1 -1
- package/dist/delivery/index.js +64 -56
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +2 -2
- package/dist/print/index.js +64 -56
- package/dist/print/index.js.map +1 -1
- package/module/print.js +203 -196
- package/module/print.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/editor-runtime/i18n-CBClmRAq.js.map +0 -1
- package/dist/browser/i18n-CBClmRAq.js.map +0 -1
package/dist/print/index.js
CHANGED
|
@@ -4634,22 +4634,30 @@ function v() {
|
|
|
4634
4634
|
return window.MathJax;
|
|
4635
4635
|
}
|
|
4636
4636
|
function y(e) {
|
|
4637
|
-
let t
|
|
4638
|
-
|
|
4639
|
-
return t;
|
|
4637
|
+
for (let [t, n] of d) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
4638
|
+
return e;
|
|
4640
4639
|
}
|
|
4641
4640
|
function b(e) {
|
|
4641
|
+
return y(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
4642
|
+
}
|
|
4643
|
+
var x = "mathjax_ignore";
|
|
4644
|
+
var S = "mathjax_process";
|
|
4645
|
+
function C(e, t) {
|
|
4646
|
+
let n = e.closest(`.${x}, .${S}`);
|
|
4647
|
+
return n !== null && t.contains(n) && !n.classList.contains(S);
|
|
4648
|
+
}
|
|
4649
|
+
function w(e) {
|
|
4642
4650
|
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
4643
|
-
if (t.dataset.mathHandled || t.closest("mjx-container")) continue;
|
|
4644
|
-
let
|
|
4645
|
-
|
|
4651
|
+
if (t.dataset.mathHandled || t.closest("mjx-container") || C(t, e)) continue;
|
|
4652
|
+
let n = t.textContent;
|
|
4653
|
+
n && (t.textContent = `\\(${b(n)}\\)`.replace(u, "\\newline "), t.dataset.mathHandled = "true");
|
|
4646
4654
|
}
|
|
4647
4655
|
}
|
|
4648
|
-
function
|
|
4656
|
+
function T(e, t) {
|
|
4649
4657
|
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
4650
4658
|
return (t ? l : c).test(e.textContent ?? "");
|
|
4651
4659
|
}
|
|
4652
|
-
function
|
|
4660
|
+
function E(e) {
|
|
4653
4661
|
return new Promise((t, n) => {
|
|
4654
4662
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: c = !0, srcUrl: l } = e, u = {
|
|
4655
4663
|
loader: {
|
|
@@ -4660,7 +4668,7 @@ function S(e) {
|
|
|
4660
4668
|
typeset: !1,
|
|
4661
4669
|
ready: () => {
|
|
4662
4670
|
let e = v(), r = e?.startup, i = !!e?.version?.startsWith("4.");
|
|
4663
|
-
i &&
|
|
4671
|
+
i && D(e), r?.defaultReady?.(), i && O(r?.document), Promise.resolve(r?.promise).then(() => t(), n);
|
|
4664
4672
|
}
|
|
4665
4673
|
},
|
|
4666
4674
|
tex: { macros: { ...o } },
|
|
@@ -4678,11 +4686,11 @@ function S(e) {
|
|
|
4678
4686
|
d.src = l || a, d.async = !0, d.onerror = () => n(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(d);
|
|
4679
4687
|
});
|
|
4680
4688
|
}
|
|
4681
|
-
function
|
|
4689
|
+
function D(e) {
|
|
4682
4690
|
let t = e?._?.output?.chtml_ts?.CHTML;
|
|
4683
4691
|
t && (t.STYLESHEETID = p);
|
|
4684
4692
|
}
|
|
4685
|
-
function
|
|
4693
|
+
function O(e) {
|
|
4686
4694
|
if (!e) return;
|
|
4687
4695
|
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
4688
4696
|
let n = e.typesetRoot;
|
|
@@ -4696,32 +4704,32 @@ function w(e) {
|
|
|
4696
4704
|
return t && _(t), !1;
|
|
4697
4705
|
});
|
|
4698
4706
|
let r = e.outputJax?.chtmlStyles;
|
|
4699
|
-
r?.id === m && (r.id = p),
|
|
4707
|
+
r?.id === m && (r.id = p), j();
|
|
4700
4708
|
}
|
|
4701
|
-
function
|
|
4709
|
+
function k(e) {
|
|
4702
4710
|
return e instanceof HTMLStyleElement && h.includes(e.id);
|
|
4703
4711
|
}
|
|
4704
|
-
function
|
|
4712
|
+
function A(e) {
|
|
4705
4713
|
r$1("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
|
|
4706
4714
|
}
|
|
4707
|
-
function
|
|
4708
|
-
let e = document.head, t = [...e.children].find(
|
|
4715
|
+
function j() {
|
|
4716
|
+
let e = document.head, t = [...e.children].find(k);
|
|
4709
4717
|
if (t) {
|
|
4710
|
-
|
|
4718
|
+
A(t);
|
|
4711
4719
|
return;
|
|
4712
4720
|
}
|
|
4713
4721
|
let n = new MutationObserver((e) => {
|
|
4714
4722
|
for (let t of e) {
|
|
4715
|
-
let e = [...t.addedNodes].find(
|
|
4723
|
+
let e = [...t.addedNodes].find(k);
|
|
4716
4724
|
if (e) {
|
|
4717
|
-
|
|
4725
|
+
A(e), n.disconnect();
|
|
4718
4726
|
return;
|
|
4719
4727
|
}
|
|
4720
4728
|
}
|
|
4721
4729
|
});
|
|
4722
4730
|
n.observe(e, { childList: !0 });
|
|
4723
4731
|
}
|
|
4724
|
-
function
|
|
4732
|
+
function M(e) {
|
|
4725
4733
|
return new Promise((t, n) => {
|
|
4726
4734
|
let r = e.startup ?? {};
|
|
4727
4735
|
e.startup = r;
|
|
@@ -4732,27 +4740,27 @@ function O(e) {
|
|
|
4732
4740
|
};
|
|
4733
4741
|
});
|
|
4734
4742
|
}
|
|
4735
|
-
function
|
|
4743
|
+
function N(e) {
|
|
4736
4744
|
let t = v();
|
|
4737
|
-
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() :
|
|
4745
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : M(t) : E(e);
|
|
4738
4746
|
}
|
|
4739
|
-
function
|
|
4740
|
-
return
|
|
4747
|
+
function P(e) {
|
|
4748
|
+
return N(e).then(() => {
|
|
4741
4749
|
typeof v()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
|
|
4742
4750
|
});
|
|
4743
4751
|
}
|
|
4744
|
-
function
|
|
4752
|
+
function F(e) {
|
|
4745
4753
|
let t = globalThis, n = t[f];
|
|
4746
|
-
return n || (n =
|
|
4754
|
+
return n || (n = P(e), t[f] = n), n;
|
|
4747
4755
|
}
|
|
4748
|
-
function
|
|
4756
|
+
function I(e = {}) {
|
|
4749
4757
|
let t = e.useSingleDollar ?? !1;
|
|
4750
4758
|
return async (n) => {
|
|
4751
4759
|
if (typeof window > "u") return;
|
|
4752
4760
|
let a = i();
|
|
4753
|
-
a && r$1("mathjax-3-global", `window.MathJax is MathJax ${a}`),
|
|
4754
|
-
let o =
|
|
4755
|
-
if (!
|
|
4761
|
+
a && r$1("mathjax-3-global", `window.MathJax is MathJax ${a}`), w(n);
|
|
4762
|
+
let o = F(e);
|
|
4763
|
+
if (!T(n, t)) {
|
|
4756
4764
|
o.catch(() => {});
|
|
4757
4765
|
return;
|
|
4758
4766
|
}
|
|
@@ -4761,54 +4769,54 @@ function M(e = {}) {
|
|
|
4761
4769
|
await s?.startup?.promise, typeof s?.typesetPromise == "function" && (await s.typesetPromise([n]), _(n));
|
|
4762
4770
|
};
|
|
4763
4771
|
}
|
|
4764
|
-
var
|
|
4765
|
-
var
|
|
4766
|
-
var
|
|
4767
|
-
var
|
|
4768
|
-
var
|
|
4769
|
-
var
|
|
4770
|
-
function
|
|
4771
|
-
return !!window[
|
|
4772
|
+
var R = "@pie-lib/math-rendering";
|
|
4773
|
+
var z = "@pie-lib/math-rendering@2";
|
|
4774
|
+
var B = "pie-print";
|
|
4775
|
+
var V = 50;
|
|
4776
|
+
var H = 1e4;
|
|
4777
|
+
var U = null;
|
|
4778
|
+
function W() {
|
|
4779
|
+
return !!window[z]?.opts?.useSingleDollar;
|
|
4772
4780
|
}
|
|
4773
|
-
function
|
|
4774
|
-
return
|
|
4781
|
+
function G() {
|
|
4782
|
+
return U || (U = I({ useSingleDollar: W() })), U;
|
|
4775
4783
|
}
|
|
4776
|
-
function
|
|
4784
|
+
function K() {
|
|
4777
4785
|
if (typeof window > "u") return null;
|
|
4778
|
-
let e = window[
|
|
4779
|
-
return typeof e?.renderMath == "function" ? e : null;
|
|
4786
|
+
let e = window[R];
|
|
4787
|
+
return typeof e?.renderMath == "function" && e.renderMath !== X ? e : null;
|
|
4780
4788
|
}
|
|
4781
|
-
function
|
|
4789
|
+
function q(e) {
|
|
4782
4790
|
let t = e;
|
|
4783
4791
|
for (; t;) {
|
|
4784
|
-
if (t instanceof Element && t.localName ===
|
|
4792
|
+
if (t instanceof Element && t.localName === B) return t;
|
|
4785
4793
|
t = t instanceof ShadowRoot ? t.host : t.parentNode;
|
|
4786
4794
|
}
|
|
4787
4795
|
return null;
|
|
4788
4796
|
}
|
|
4789
|
-
function
|
|
4797
|
+
function J() {
|
|
4790
4798
|
let e = window.renderMath;
|
|
4791
4799
|
return typeof e == "function" ? e : null;
|
|
4792
4800
|
}
|
|
4793
|
-
async function
|
|
4794
|
-
let t =
|
|
4801
|
+
async function Y(e) {
|
|
4802
|
+
let t = q(e);
|
|
4795
4803
|
if (!t) return null;
|
|
4796
|
-
let n =
|
|
4804
|
+
let n = J();
|
|
4797
4805
|
if (n || t.mathRenderingModuleUrlImported !== !0) return n;
|
|
4798
|
-
let r = Date.now() +
|
|
4806
|
+
let r = Date.now() + H;
|
|
4799
4807
|
for (; Date.now() < r;) {
|
|
4800
|
-
await new Promise((e) => setTimeout(e,
|
|
4801
|
-
let e =
|
|
4808
|
+
await new Promise((e) => setTimeout(e, V));
|
|
4809
|
+
let e = J();
|
|
4802
4810
|
if (e) return e;
|
|
4803
4811
|
}
|
|
4804
4812
|
return null;
|
|
4805
4813
|
}
|
|
4806
|
-
var
|
|
4814
|
+
var X = async (e) => {
|
|
4807
4815
|
if (typeof window > "u") return;
|
|
4808
4816
|
let t = typeof e == "string", n;
|
|
4809
4817
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
4810
|
-
let r =
|
|
4811
|
-
return r ? await r.renderMath?.(n) : i ? await i(n) : await
|
|
4818
|
+
let r = K(), i = r || t ? null : await Y(n);
|
|
4819
|
+
return r ? await r.renderMath?.(n) : i && i !== X ? await i(n) : await G()(n), t ? n.innerHTML : void 0;
|
|
4812
4820
|
};
|
|
4813
4821
|
//#endregion
|
|
4814
4822
|
//#region src/controller/plain-text.ts
|
|
@@ -7236,7 +7244,7 @@ function Print($$anchor, $$props) {
|
|
|
7236
7244
|
if (!get$1(promptElement) || !get$1(prompt)) return;
|
|
7237
7245
|
const warn = (err) => console.warn("simple-cloze: MathJax render failed", err);
|
|
7238
7246
|
try {
|
|
7239
|
-
Promise.resolve(
|
|
7247
|
+
Promise.resolve(X(get$1(promptElement))).catch(warn);
|
|
7240
7248
|
} catch (err) {
|
|
7241
7249
|
warn(err);
|
|
7242
7250
|
}
|