@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/delivery/index.js
CHANGED
|
@@ -4725,22 +4725,30 @@ function v() {
|
|
|
4725
4725
|
return window.MathJax;
|
|
4726
4726
|
}
|
|
4727
4727
|
function y(e) {
|
|
4728
|
-
let t
|
|
4729
|
-
|
|
4730
|
-
return t;
|
|
4728
|
+
for (let [t, n] of d) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
4729
|
+
return e;
|
|
4731
4730
|
}
|
|
4732
4731
|
function b(e) {
|
|
4732
|
+
return y(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
4733
|
+
}
|
|
4734
|
+
var x = "mathjax_ignore";
|
|
4735
|
+
var S = "mathjax_process";
|
|
4736
|
+
function C(e, t) {
|
|
4737
|
+
let n = e.closest(`.${x}, .${S}`);
|
|
4738
|
+
return n !== null && t.contains(n) && !n.classList.contains(S);
|
|
4739
|
+
}
|
|
4740
|
+
function w(e) {
|
|
4733
4741
|
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
4734
|
-
if (t.dataset.mathHandled || t.closest("mjx-container")) continue;
|
|
4735
|
-
let
|
|
4736
|
-
|
|
4742
|
+
if (t.dataset.mathHandled || t.closest("mjx-container") || C(t, e)) continue;
|
|
4743
|
+
let n = t.textContent;
|
|
4744
|
+
n && (t.textContent = `\\(${b(n)}\\)`.replace(u, "\\newline "), t.dataset.mathHandled = "true");
|
|
4737
4745
|
}
|
|
4738
4746
|
}
|
|
4739
|
-
function
|
|
4747
|
+
function T(e, t) {
|
|
4740
4748
|
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
4741
4749
|
return (t ? l : c$1).test(e.textContent ?? "");
|
|
4742
4750
|
}
|
|
4743
|
-
function
|
|
4751
|
+
function E(e) {
|
|
4744
4752
|
return new Promise((t, n) => {
|
|
4745
4753
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: c = !0, srcUrl: l } = e, u = {
|
|
4746
4754
|
loader: {
|
|
@@ -4751,7 +4759,7 @@ function S(e) {
|
|
|
4751
4759
|
typeset: !1,
|
|
4752
4760
|
ready: () => {
|
|
4753
4761
|
let e = v(), r = e?.startup, i = !!e?.version?.startsWith("4.");
|
|
4754
|
-
i &&
|
|
4762
|
+
i && D(e), r?.defaultReady?.(), i && O(r?.document), Promise.resolve(r?.promise).then(() => t(), n);
|
|
4755
4763
|
}
|
|
4756
4764
|
},
|
|
4757
4765
|
tex: { macros: { ...o } },
|
|
@@ -4769,11 +4777,11 @@ function S(e) {
|
|
|
4769
4777
|
d.src = l || a, d.async = !0, d.onerror = () => n(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(d);
|
|
4770
4778
|
});
|
|
4771
4779
|
}
|
|
4772
|
-
function
|
|
4780
|
+
function D(e) {
|
|
4773
4781
|
let t = e?._?.output?.chtml_ts?.CHTML;
|
|
4774
4782
|
t && (t.STYLESHEETID = p);
|
|
4775
4783
|
}
|
|
4776
|
-
function
|
|
4784
|
+
function O(e) {
|
|
4777
4785
|
if (!e) return;
|
|
4778
4786
|
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
4779
4787
|
let n = e.typesetRoot;
|
|
@@ -4787,32 +4795,32 @@ function w(e) {
|
|
|
4787
4795
|
return t && _(t), !1;
|
|
4788
4796
|
});
|
|
4789
4797
|
let r = e.outputJax?.chtmlStyles;
|
|
4790
|
-
r?.id === m && (r.id = p),
|
|
4798
|
+
r?.id === m && (r.id = p), j();
|
|
4791
4799
|
}
|
|
4792
|
-
function
|
|
4800
|
+
function k(e) {
|
|
4793
4801
|
return e instanceof HTMLStyleElement && h.includes(e.id);
|
|
4794
4802
|
}
|
|
4795
|
-
function
|
|
4803
|
+
function A(e) {
|
|
4796
4804
|
r$2("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
|
|
4797
4805
|
}
|
|
4798
|
-
function
|
|
4799
|
-
let e = document.head, t = [...e.children].find(
|
|
4806
|
+
function j() {
|
|
4807
|
+
let e = document.head, t = [...e.children].find(k);
|
|
4800
4808
|
if (t) {
|
|
4801
|
-
|
|
4809
|
+
A(t);
|
|
4802
4810
|
return;
|
|
4803
4811
|
}
|
|
4804
4812
|
let n = new MutationObserver((e) => {
|
|
4805
4813
|
for (let t of e) {
|
|
4806
|
-
let e = [...t.addedNodes].find(
|
|
4814
|
+
let e = [...t.addedNodes].find(k);
|
|
4807
4815
|
if (e) {
|
|
4808
|
-
|
|
4816
|
+
A(e), n.disconnect();
|
|
4809
4817
|
return;
|
|
4810
4818
|
}
|
|
4811
4819
|
}
|
|
4812
4820
|
});
|
|
4813
4821
|
n.observe(e, { childList: !0 });
|
|
4814
4822
|
}
|
|
4815
|
-
function
|
|
4823
|
+
function M(e) {
|
|
4816
4824
|
return new Promise((t, n) => {
|
|
4817
4825
|
let r = e.startup ?? {};
|
|
4818
4826
|
e.startup = r;
|
|
@@ -4823,27 +4831,27 @@ function O(e) {
|
|
|
4823
4831
|
};
|
|
4824
4832
|
});
|
|
4825
4833
|
}
|
|
4826
|
-
function
|
|
4834
|
+
function N(e) {
|
|
4827
4835
|
let t = v();
|
|
4828
|
-
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() :
|
|
4836
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : M(t) : E(e);
|
|
4829
4837
|
}
|
|
4830
|
-
function
|
|
4831
|
-
return
|
|
4838
|
+
function P(e) {
|
|
4839
|
+
return N(e).then(() => {
|
|
4832
4840
|
typeof v()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
|
|
4833
4841
|
});
|
|
4834
4842
|
}
|
|
4835
|
-
function
|
|
4843
|
+
function F(e) {
|
|
4836
4844
|
let t = globalThis, n = t[f];
|
|
4837
|
-
return n || (n =
|
|
4845
|
+
return n || (n = P(e), t[f] = n), n;
|
|
4838
4846
|
}
|
|
4839
|
-
function
|
|
4847
|
+
function I(e = {}) {
|
|
4840
4848
|
let t = e.useSingleDollar ?? !1;
|
|
4841
4849
|
return async (n) => {
|
|
4842
4850
|
if (typeof window > "u") return;
|
|
4843
4851
|
let a = i();
|
|
4844
|
-
a && r$2("mathjax-3-global", `window.MathJax is MathJax ${a}`),
|
|
4845
|
-
let o =
|
|
4846
|
-
if (!
|
|
4852
|
+
a && r$2("mathjax-3-global", `window.MathJax is MathJax ${a}`), w(n);
|
|
4853
|
+
let o = F(e);
|
|
4854
|
+
if (!T(n, t)) {
|
|
4847
4855
|
o.catch(() => {});
|
|
4848
4856
|
return;
|
|
4849
4857
|
}
|
|
@@ -4852,54 +4860,54 @@ function M(e = {}) {
|
|
|
4852
4860
|
await s?.startup?.promise, typeof s?.typesetPromise == "function" && (await s.typesetPromise([n]), _(n));
|
|
4853
4861
|
};
|
|
4854
4862
|
}
|
|
4855
|
-
var
|
|
4856
|
-
var
|
|
4857
|
-
var
|
|
4858
|
-
var
|
|
4859
|
-
var
|
|
4860
|
-
var
|
|
4861
|
-
function
|
|
4862
|
-
return !!window[
|
|
4863
|
+
var R = "@pie-lib/math-rendering";
|
|
4864
|
+
var z = "@pie-lib/math-rendering@2";
|
|
4865
|
+
var B = "pie-print";
|
|
4866
|
+
var V = 50;
|
|
4867
|
+
var H = 1e4;
|
|
4868
|
+
var U = null;
|
|
4869
|
+
function W() {
|
|
4870
|
+
return !!window[z]?.opts?.useSingleDollar;
|
|
4863
4871
|
}
|
|
4864
|
-
function
|
|
4865
|
-
return
|
|
4872
|
+
function G() {
|
|
4873
|
+
return U || (U = I({ useSingleDollar: W() })), U;
|
|
4866
4874
|
}
|
|
4867
|
-
function
|
|
4875
|
+
function K() {
|
|
4868
4876
|
if (typeof window > "u") return null;
|
|
4869
|
-
let e = window[
|
|
4870
|
-
return typeof e?.renderMath == "function" ? e : null;
|
|
4877
|
+
let e = window[R];
|
|
4878
|
+
return typeof e?.renderMath == "function" && e.renderMath !== X ? e : null;
|
|
4871
4879
|
}
|
|
4872
|
-
function
|
|
4880
|
+
function q(e) {
|
|
4873
4881
|
let t = e;
|
|
4874
4882
|
for (; t;) {
|
|
4875
|
-
if (t instanceof Element && t.localName ===
|
|
4883
|
+
if (t instanceof Element && t.localName === B) return t;
|
|
4876
4884
|
t = t instanceof ShadowRoot ? t.host : t.parentNode;
|
|
4877
4885
|
}
|
|
4878
4886
|
return null;
|
|
4879
4887
|
}
|
|
4880
|
-
function
|
|
4888
|
+
function J() {
|
|
4881
4889
|
let e = window.renderMath;
|
|
4882
4890
|
return typeof e == "function" ? e : null;
|
|
4883
4891
|
}
|
|
4884
|
-
async function
|
|
4885
|
-
let t =
|
|
4892
|
+
async function Y(e) {
|
|
4893
|
+
let t = q(e);
|
|
4886
4894
|
if (!t) return null;
|
|
4887
|
-
let n =
|
|
4895
|
+
let n = J();
|
|
4888
4896
|
if (n || t.mathRenderingModuleUrlImported !== !0) return n;
|
|
4889
|
-
let r = Date.now() +
|
|
4897
|
+
let r = Date.now() + H;
|
|
4890
4898
|
for (; Date.now() < r;) {
|
|
4891
|
-
await new Promise((e) => setTimeout(e,
|
|
4892
|
-
let e =
|
|
4899
|
+
await new Promise((e) => setTimeout(e, V));
|
|
4900
|
+
let e = J();
|
|
4893
4901
|
if (e) return e;
|
|
4894
4902
|
}
|
|
4895
4903
|
return null;
|
|
4896
4904
|
}
|
|
4897
|
-
var
|
|
4905
|
+
var X = async (e) => {
|
|
4898
4906
|
if (typeof window > "u") return;
|
|
4899
4907
|
let t = typeof e == "string", n;
|
|
4900
4908
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
4901
|
-
let r =
|
|
4902
|
-
return r ? await r.renderMath?.(n) : i ? await i(n) : await
|
|
4909
|
+
let r = K(), i = r || t ? null : await Y(n);
|
|
4910
|
+
return r ? await r.renderMath?.(n) : i && i !== X ? await i(n) : await G()(n), t ? n.innerHTML : void 0;
|
|
4903
4911
|
};
|
|
4904
4912
|
//#endregion
|
|
4905
4913
|
//#region ../../shared/translator/dist/en.js
|
|
@@ -7340,7 +7348,7 @@ function SimpleCloze($$anchor, $$props) {
|
|
|
7340
7348
|
if (!get$1(promptElement) || !get$1(prompt)) return;
|
|
7341
7349
|
const warn = (err) => console.warn("simple-cloze: MathJax render failed", err);
|
|
7342
7350
|
try {
|
|
7343
|
-
Promise.resolve(
|
|
7351
|
+
Promise.resolve(X(get$1(promptElement))).catch(warn);
|
|
7344
7352
|
} catch (err) {
|
|
7345
7353
|
warn(err);
|
|
7346
7354
|
}
|