@squirrel-cloud/ui-vue 0.6.2 → 0.6.3
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/index.js +22 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -204,26 +204,30 @@ function an() {
|
|
|
204
204
|
};
|
|
205
205
|
const l = Ue[e];
|
|
206
206
|
if (l !== void 0) {
|
|
207
|
-
const
|
|
207
|
+
const p = await l;
|
|
208
208
|
return me[e] = (me[e] ?? 0) + 1, {
|
|
209
209
|
key: e,
|
|
210
|
-
highlighter:
|
|
210
|
+
highlighter: p
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
213
|
+
try {
|
|
214
|
+
const { createHighlighterCore: p } = await import("@shikijs/core"), { createJavaScriptRegexEngine: f } = await import("@shikijs/engine-javascript"), d = f(), r = new Promise((c) => {
|
|
215
|
+
try {
|
|
216
|
+
p({
|
|
217
|
+
langs: s.map((h) => nn[h]()),
|
|
218
|
+
themes: t.map((h) => sn[h]()),
|
|
219
|
+
engine: d
|
|
220
|
+
}).then((h) => {
|
|
221
|
+
c(h), Ee[e] = h, me[e] = (me[e] ?? 0) + 1, delete Ue[e];
|
|
222
|
+
});
|
|
223
|
+
} catch {
|
|
224
|
+
delete Ue[e], c(!1);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
return { key: e, highlighter: await r };
|
|
228
|
+
} catch {
|
|
229
|
+
return { key: e, highlighter: !1 };
|
|
230
|
+
}
|
|
227
231
|
}
|
|
228
232
|
function n(s) {
|
|
229
233
|
const t = Ee[s], e = me[s];
|
|
@@ -888,10 +892,11 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
888
892
|
}) : `<pre>${e.code}</pre>`);
|
|
889
893
|
return oe(async () => {
|
|
890
894
|
const p = e.lang ? [e.lang] : void 0, f = e.theme ? [e.theme] : void 0, d = await n(p, f);
|
|
891
|
-
if (
|
|
895
|
+
if (!d.highlighter) {
|
|
892
896
|
console.warn("[squirrel-cloud/ui-vue] SqCode 组件代码高亮依赖 shiki");
|
|
893
897
|
return;
|
|
894
898
|
}
|
|
899
|
+
t = d.key, o.value = d.highlighter;
|
|
895
900
|
}), ye(() => {
|
|
896
901
|
t && s(t);
|
|
897
902
|
}), (p, f) => (v(), _("div", {
|