markstream-vue 0.0.2-beta.8 → 0.0.2
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/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/dist/exports-CnH6kN6F.js +4908 -0
- package/dist/exports-DsdRlFsA.cjs +246 -0
- package/dist/exports.js +1 -1
- package/dist/index-BVEX3mF2.js +113 -0
- package/dist/index-Bie7KQwi.js +950 -0
- package/dist/index-D4WvXLjB.cjs +22 -0
- package/dist/index-DObBCK_f.cjs +1 -0
- package/dist/index-DRwD-ixu.js +122 -0
- package/dist/index-Dp_yMiDW.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +68 -57
- package/dist/index.tailwind.css +1 -1
- package/dist/index2.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/index4.js +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +9 -9
- package/dist/exports-BD7Y_TjZ.cjs +0 -247
- package/dist/exports-BreegGo9.js +0 -4719
- package/dist/index-BM9Oro93.js +0 -860
- package/dist/index-Cc3u_ylp.js +0 -117
- package/dist/index-CoB_G9GJ.cjs +0 -1
- package/dist/index-DbbC_URx.cjs +0 -1
- package/dist/index-Dq586yJ8.cjs +0 -1
- package/dist/index-ELonlW3Z.js +0 -108
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
var v = (d, n, r) => new Promise((a, s) => {
|
|
2
|
+
var f = (l) => {
|
|
3
|
+
try {
|
|
4
|
+
o(r.next(l));
|
|
5
|
+
} catch (e) {
|
|
6
|
+
s(e);
|
|
7
|
+
}
|
|
8
|
+
}, u = (l) => {
|
|
9
|
+
try {
|
|
10
|
+
o(r.throw(l));
|
|
11
|
+
} catch (e) {
|
|
12
|
+
s(e);
|
|
13
|
+
}
|
|
14
|
+
}, o = (l) => l.done ? a(l.value) : Promise.resolve(l.value).then(f, u);
|
|
15
|
+
o((r = r.apply(d, n)).next());
|
|
16
|
+
});
|
|
17
|
+
import { defineComponent as O, ref as p, watch as y, onMounted as I, onBeforeUnmount as M, createElementBlock as T, openBlock as g, createVNode as K, createElementVNode as w, Transition as b, withCtx as N, createCommentVNode as V, normalizeClass as W } from "vue";
|
|
18
|
+
import { a as A, e as D, f as L, i as U, W as S, _ as X } from "./exports-CnH6kN6F.js";
|
|
19
|
+
const z = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "math-loading-overlay"
|
|
22
|
+
}, F = /* @__PURE__ */ O({
|
|
23
|
+
__name: "MathBlockNode",
|
|
24
|
+
props: {
|
|
25
|
+
node: {}
|
|
26
|
+
},
|
|
27
|
+
setup(d) {
|
|
28
|
+
const n = d, r = p(null), a = p(null);
|
|
29
|
+
let s = !1, f = 0, u = !1, o = null;
|
|
30
|
+
const l = A();
|
|
31
|
+
let e = null;
|
|
32
|
+
const c = p(!0);
|
|
33
|
+
function k() {
|
|
34
|
+
return v(this, null, function* () {
|
|
35
|
+
if (!n.node.content || !a.value || u)
|
|
36
|
+
return;
|
|
37
|
+
if (!s)
|
|
38
|
+
try {
|
|
39
|
+
!e && r.value && (e = l(r.value)), yield e == null ? void 0 : e.whenVisible;
|
|
40
|
+
} catch (t) {
|
|
41
|
+
}
|
|
42
|
+
o && (o.abort(), o = null);
|
|
43
|
+
const i = ++f, m = new AbortController();
|
|
44
|
+
o = m, D(n.node.content, !0, {
|
|
45
|
+
timeout: 3e3,
|
|
46
|
+
waitTimeout: 2e3,
|
|
47
|
+
maxRetries: 1,
|
|
48
|
+
signal: m.signal
|
|
49
|
+
}).then((t) => {
|
|
50
|
+
u || i !== f || a.value && (a.value.innerHTML = t, s = !0, c.value = !1);
|
|
51
|
+
}).catch((t) => v(null, null, function* () {
|
|
52
|
+
if (u || i !== f || !a.value)
|
|
53
|
+
return;
|
|
54
|
+
const h = (t == null ? void 0 : t.code) || (t == null ? void 0 : t.name), x = h === "WORKER_INIT_ERROR" || (t == null ? void 0 : t.fallbackToRenderer), B = h === S || h === "WORKER_TIMEOUT", C = h === "KATEX_DISABLED";
|
|
55
|
+
if (x || B) {
|
|
56
|
+
const R = yield L();
|
|
57
|
+
if (R) {
|
|
58
|
+
try {
|
|
59
|
+
const _ = R.renderToString(n.node.content, {
|
|
60
|
+
throwOnError: n.node.loading,
|
|
61
|
+
displayMode: !0
|
|
62
|
+
});
|
|
63
|
+
a.value.innerHTML = _, s = !0, c.value = !1, U(n.node.content, !0, _);
|
|
64
|
+
} catch (_) {
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (C) {
|
|
70
|
+
c.value = !1, a.value.textContent = n.node.raw;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
s || (c.value = !0), n.node.loading || (c.value = !1, a.value.textContent = n.node.raw);
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return y(
|
|
78
|
+
() => n.node.content,
|
|
79
|
+
() => {
|
|
80
|
+
k();
|
|
81
|
+
}
|
|
82
|
+
), I(() => {
|
|
83
|
+
k();
|
|
84
|
+
}), M(() => {
|
|
85
|
+
var i;
|
|
86
|
+
u = !0, o && (o.abort(), o = null), (i = e == null ? void 0 : e.destroy) == null || i.call(e), e = null;
|
|
87
|
+
}), (i, m) => (g(), T("div", {
|
|
88
|
+
ref_key: "containerEl",
|
|
89
|
+
ref: r,
|
|
90
|
+
class: "math-block text-center overflow-x-auto relative min-h-[40px]"
|
|
91
|
+
}, [
|
|
92
|
+
K(b, { name: "math-fade" }, {
|
|
93
|
+
default: N(() => [
|
|
94
|
+
c.value ? (g(), T("div", z, [...m[0] || (m[0] = [
|
|
95
|
+
w("div", { class: "math-loading-spinner" }, null, -1)
|
|
96
|
+
])])) : V("", !0)
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
}),
|
|
100
|
+
w("div", {
|
|
101
|
+
ref_key: "mathBlockElement",
|
|
102
|
+
ref: a,
|
|
103
|
+
class: W({ "math-rendering": c.value })
|
|
104
|
+
}, null, 2)
|
|
105
|
+
], 512));
|
|
106
|
+
}
|
|
107
|
+
}), E = /* @__PURE__ */ X(F, [["__scopeId", "data-v-dab27d4f"]]);
|
|
108
|
+
E.install = (d) => {
|
|
109
|
+
d.component(E.__name, E);
|
|
110
|
+
};
|
|
111
|
+
export {
|
|
112
|
+
E as default
|
|
113
|
+
};
|