@deot/docs-client 1.1.3 → 1.1.4
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 +2 -3
- package/dist/chunks/browser-Cmwcvs-d.js +505 -0
- package/dist/chunks/cdn-DEvdGJu2-bmlgKy4E.js +38 -0
- package/dist/chunks/chunk-rhk8Qtmk-CUgXtmq_.js +14 -0
- package/dist/chunks/compile-Bw7v7QE--Dd1-R95H.js +79920 -0
- package/dist/chunks/compiler-sfc.esm-browser-B4_kBkG5.js +24975 -0
- package/dist/chunks/dayjs.min-B3g34Qcz.js +300 -0
- package/dist/chunks/dist-0ySyXNpo.js +415 -0
- package/dist/chunks/dist-BUw25nXJ.js +65 -0
- package/dist/chunks/dist-BeOE8qTX.js +345 -0
- package/dist/chunks/dist-Bm7SK-km.js +24517 -0
- package/dist/chunks/dist-C3V7reR4.js +197 -0
- package/dist/chunks/dist-C8z9l0mA.js +58 -0
- package/dist/chunks/dist-CI9Lp9Cj.js +247 -0
- package/dist/chunks/dist-COjpr4FU.js +426 -0
- package/dist/chunks/dist-CQir6D4y.js +244 -0
- package/dist/chunks/dist-CuJyl-ef.js +17 -0
- package/dist/chunks/dist-Cxf7_ocf.js +44 -0
- package/dist/chunks/dist-DF4kisl2.js +43 -0
- package/dist/chunks/dist-DLj8yJdm.js +38 -0
- package/dist/chunks/dist-DN0sqx7H.js +39 -0
- package/dist/chunks/dist-DWqBe2Ah.js +132 -0
- package/dist/chunks/dist-D_Uqh6m9.js +80 -0
- package/dist/chunks/dist-DcIU51zW.js +166 -0
- package/dist/chunks/dist-DlmO7OlF.js +22 -0
- package/dist/chunks/dist-kiZUqqzR.js +27 -0
- package/dist/chunks/dist-oZ12SGqg.js +6 -0
- package/dist/chunks/dist-uXnwGrO3.js +76 -0
- package/dist/chunks/dist-va7FmnW4.js +156 -0
- package/dist/chunks/{echarts-I1Rk_oCV.js → echarts-Dk-pu7GM.js} +450 -398
- package/dist/chunks/files-C5UMzYxA-q9oJ4PrI.js +110 -0
- package/dist/chunks/html2canvas-Deo0mM5K.js +4022 -0
- package/dist/chunks/index.es-UlJ0gfdF.js +5757 -0
- package/dist/chunks/jspdf.es.min-CJc40v7q.js +17873 -0
- package/dist/chunks/jsx-CwMPlI4_-CAiik-V7.js +128454 -0
- package/dist/chunks/jszip.min-BbVwZKYP.js +3044 -0
- package/dist/chunks/linker-JHdz37DK-CWgUtxZ5.js +118 -0
- package/dist/chunks/local-sandbox-B8IJ5jWb-BgfU3iQ4.js +300 -0
- package/dist/chunks/lodash-Cxf6dD_I.js +5161 -0
- package/dist/chunks/modules-DlLJF_vd-DcNdL6sc.js +153 -0
- package/dist/chunks/{photoswipe.esm-CT37djgx.js → photoswipe.esm-B0V-xGTB.js} +36 -31
- package/dist/chunks/pinia-pDJilYOg.js +326 -0
- package/dist/chunks/purify.es-BiqY1C6m.js +867 -0
- package/dist/chunks/remote-DfXAsO9n-C_MtPVYr.js +75 -0
- package/dist/chunks/script-xKUjE8pf-oF69rg-w.js +14941 -0
- package/dist/chunks/store-D8vwi-HV-RFStijWr.js +16936 -0
- package/dist/chunks/vue-router-C0mj8Ot5.js +1196 -0
- package/dist/chunks/vue.runtime.esm-bundler-XxHGOLq2.js +4879 -0
- package/dist/index.cjs +17 -17
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41713 -103389
- package/dist/index.style.css +3 -4
- package/package.json +9 -9
- package/dist/chunks/_commonjsHelpers-BFTU3MAI-D_7z5o6A.js +0 -8
- package/dist/chunks/jsx-H2PmTOgp-C0GVSSMR.js +0 -128281
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { S as e, t, w as n, z as r } from "./vue.runtime.esm-bundler-XxHGOLq2.js";
|
|
3
|
+
import { createFileIndex as i, getCommonRoot as a, isInsideRoot as o, isRelativeSpecifier as s, normalizeVirtualPath as c, resolveModulePath as l } from "./files-C5UMzYxA-q9oJ4PrI.js";
|
|
4
|
+
import { resolveHostModule as u } from "./modules-DlLJF_vd-DcNdL6sc.js";
|
|
5
|
+
//#region packages/playground/dist/linker-JHdz37DK.js
|
|
6
|
+
var d = (i) => {
|
|
7
|
+
let a = (t, a) => {
|
|
8
|
+
let o = {
|
|
9
|
+
_component: t,
|
|
10
|
+
_props: a,
|
|
11
|
+
config: {
|
|
12
|
+
errorHandler: null,
|
|
13
|
+
warnHandler: null,
|
|
14
|
+
globalProperties: {}
|
|
15
|
+
},
|
|
16
|
+
_context: {
|
|
17
|
+
provides: Object.create(null),
|
|
18
|
+
components: Object.create(null),
|
|
19
|
+
directives: Object.create(null),
|
|
20
|
+
mixins: []
|
|
21
|
+
},
|
|
22
|
+
use() {
|
|
23
|
+
return o;
|
|
24
|
+
},
|
|
25
|
+
mixin(e) {
|
|
26
|
+
return o._context.mixins.push(e), o;
|
|
27
|
+
},
|
|
28
|
+
component(e, t) {
|
|
29
|
+
return t ? (o._context.components[e] = t, o) : o._context.components[e];
|
|
30
|
+
},
|
|
31
|
+
directive() {
|
|
32
|
+
return o;
|
|
33
|
+
},
|
|
34
|
+
provide(e, t) {
|
|
35
|
+
return o._context.provides[e] = t, o;
|
|
36
|
+
},
|
|
37
|
+
mount() {
|
|
38
|
+
return i.components = { ...o._context.components }, i.provides = { ...o._context.provides }, i.mountedComponent = e({
|
|
39
|
+
name: "PlaygroundCapturedApp",
|
|
40
|
+
components: o._context.components,
|
|
41
|
+
setup() {
|
|
42
|
+
return Reflect.ownKeys(o._context.provides).forEach((e) => {
|
|
43
|
+
r(e, o._context.provides[e]);
|
|
44
|
+
}), () => n(t, a || null);
|
|
45
|
+
}
|
|
46
|
+
}), i.mountedComponent;
|
|
47
|
+
},
|
|
48
|
+
unmount() {},
|
|
49
|
+
onUnmount() {
|
|
50
|
+
return o;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return o;
|
|
54
|
+
};
|
|
55
|
+
return new Proxy(t, { get(e, t, n) {
|
|
56
|
+
return t === "createApp" || t === "createSSRApp" ? a : t === "default" ? n : Reflect.get(e, t, n);
|
|
57
|
+
} });
|
|
58
|
+
}, f = (e, n, r = {}) => {
|
|
59
|
+
let f = [...e.errors || []];
|
|
60
|
+
if (!e.entry || f.length) return {
|
|
61
|
+
component: null,
|
|
62
|
+
css: e.css || [],
|
|
63
|
+
errors: f
|
|
64
|
+
};
|
|
65
|
+
let p = {
|
|
66
|
+
mountedComponent: null,
|
|
67
|
+
components: {},
|
|
68
|
+
provides: {}
|
|
69
|
+
}, m = { ...r.modules || {} };
|
|
70
|
+
(m.vue == null || m.vue === t) && (m.vue = d(p));
|
|
71
|
+
let h = i(n), g = a([...h.keys()]), _ = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set(), y = (e) => (t) => {
|
|
72
|
+
if (s(t)) {
|
|
73
|
+
let n = l(e, t, h);
|
|
74
|
+
if (!n) throw Error(`[Playground] 无法解析相对模块 "${t}"(来自 ${e})`);
|
|
75
|
+
/* istanbul ignore if -- 公共根已包含全部 files,正常解析不会逃出 */
|
|
76
|
+
if (!o(n, g)) throw Error(`[Playground] 模块逃出虚拟根: ${n}`);
|
|
77
|
+
return b(n);
|
|
78
|
+
}
|
|
79
|
+
let n = u(t, m);
|
|
80
|
+
if (n) return n;
|
|
81
|
+
throw Error(`[Playground] 未注册的模块 "${t}"。请在 import map 中提供可加载的地址。`);
|
|
82
|
+
}, b = (t) => {
|
|
83
|
+
let n = c(t);
|
|
84
|
+
if (_.has(n) || v.has(n)) return _.get(n);
|
|
85
|
+
let r = e.modules[n];
|
|
86
|
+
if (!r) throw Error(`[Playground] 缺少编译模块: ${n}`);
|
|
87
|
+
let i = { exports: {} };
|
|
88
|
+
_.set(n, i.exports), v.add(n);
|
|
89
|
+
try {
|
|
90
|
+
return Function("require", "module", "exports", r.js)(y(n), i, i.exports), _.set(n, i.exports), i.exports;
|
|
91
|
+
} catch (e) {
|
|
92
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
93
|
+
throw f.push(`[Playground] 执行失败 ${n}: ${t}`), e;
|
|
94
|
+
} finally {
|
|
95
|
+
v.delete(n);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
try {
|
|
99
|
+
let t = b(e.entry), n = t?.default ?? t;
|
|
100
|
+
return p.mountedComponent && (n = p.mountedComponent), n ? {
|
|
101
|
+
component: n,
|
|
102
|
+
css: e.css || [],
|
|
103
|
+
errors: f
|
|
104
|
+
} : (f.push("[Playground] 入口必须 export default 组件,或调用 createApp(App).mount()"), {
|
|
105
|
+
component: null,
|
|
106
|
+
css: e.css || [],
|
|
107
|
+
errors: f
|
|
108
|
+
});
|
|
109
|
+
} catch (t) {
|
|
110
|
+
return f.length || f.push(t instanceof Error ? t.message : String(t)), {
|
|
111
|
+
component: null,
|
|
112
|
+
css: e.css || [],
|
|
113
|
+
errors: f
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
export { f as linkPlayground };
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { F as e, M as t, P as n, R as r, S as i, at as a, dt as o, g as s, i as c, k as l, p as u, q as d, st as f, t as p, w as m, z as h } from "./vue.runtime.esm-bundler-XxHGOLq2.js";
|
|
3
|
+
import { gr as g } from "./dist-Bm7SK-km.js";
|
|
4
|
+
import { o as _ } from "./vue-router-C0mj8Ot5.js";
|
|
5
|
+
import { f as v, i as y } from "./store-D8vwi-HV-RFStijWr.js";
|
|
6
|
+
import "../index.js";
|
|
7
|
+
//#region packages/playground/dist/local-sandbox-B8IJ5jWb.js
|
|
8
|
+
var b = Object.defineProperty, x = (e, t) => {
|
|
9
|
+
let n = {};
|
|
10
|
+
for (var r in e) b(n, r, {
|
|
11
|
+
get: e[r],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
return t || b(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
15
|
+
}, S = (e) => {
|
|
16
|
+
let t = [];
|
|
17
|
+
return e.forEach((e) => {
|
|
18
|
+
let n = String(e || "").trim();
|
|
19
|
+
n && t.push(n);
|
|
20
|
+
}), t;
|
|
21
|
+
}, C = (e, t) => {
|
|
22
|
+
/* istanbul ignore if -- 仅浏览器注入样式 */
|
|
23
|
+
if (typeof document > "u") return null;
|
|
24
|
+
document.querySelector(`style[data-playground-id="${e}"]`)?.remove();
|
|
25
|
+
let n = t.filter(Boolean).join("\n");
|
|
26
|
+
if (!n) return null;
|
|
27
|
+
let r = document.createElement("style");
|
|
28
|
+
return r.setAttribute("data-playground-id", e), r.textContent = n, document.head.appendChild(r), r;
|
|
29
|
+
}, w = (e) => {
|
|
30
|
+
/* istanbul ignore if -- 仅浏览器注入样式 */
|
|
31
|
+
typeof document < "u" && document.querySelector(`style[data-playground-id="${e}"]`)?.remove();
|
|
32
|
+
}, T = (e) => ({
|
|
33
|
+
enable: () => Promise.resolve(!0),
|
|
34
|
+
disable() {},
|
|
35
|
+
dispose() {},
|
|
36
|
+
run: (t, n, r) => {
|
|
37
|
+
let i = (typeof n == "function" || n == null ? {} : n).visible, a = typeof n == "function" ? n : typeof r == "function" ? r : e.isRef(i) ? () => {
|
|
38
|
+
i.value = !0;
|
|
39
|
+
} : void 0;
|
|
40
|
+
return (...e) => {
|
|
41
|
+
if (typeof a == "function") return a(...e);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}), E = "docs:local-out", D = `
|
|
45
|
+
if (!window.__docsLocalBridge) {
|
|
46
|
+
window.__docsLocalBridge = true;
|
|
47
|
+
window.addEventListener('message', function (event) {
|
|
48
|
+
var data = event.data;
|
|
49
|
+
if (!data || data.channel !== ${JSON.stringify(E)}) return;
|
|
50
|
+
window.parent.postMessage(data.payload, '*');
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
`, O = `<!doctype html><html><head></head><body><script>${D}<\/script></body></html>`, k = (e) => {
|
|
54
|
+
let t = e.contentWindow;
|
|
55
|
+
return !t || t.__docsLocalBridge ? !!t?.__docsLocalBridge : (t.eval(D), !!t.__docsLocalBridge);
|
|
56
|
+
}, A = class {
|
|
57
|
+
iframe;
|
|
58
|
+
parent;
|
|
59
|
+
listeners = /* @__PURE__ */ new Map();
|
|
60
|
+
constructor(e) {
|
|
61
|
+
this.iframe = e, this.parent = { postMessage: (e) => {
|
|
62
|
+
this.iframe.contentWindow?.postMessage({
|
|
63
|
+
channel: E,
|
|
64
|
+
payload: e
|
|
65
|
+
}, "*");
|
|
66
|
+
} };
|
|
67
|
+
}
|
|
68
|
+
get contentWindow() {
|
|
69
|
+
return this.iframe.contentWindow;
|
|
70
|
+
}
|
|
71
|
+
get innerHeight() {
|
|
72
|
+
let e = this.iframe.contentWindow?.innerHeight ?? 0;
|
|
73
|
+
return e > 0 ? e : this.iframe.clientHeight || this.iframe.parentElement?.clientHeight || 0;
|
|
74
|
+
}
|
|
75
|
+
addEventListener(e, t) {
|
|
76
|
+
let n = this.iframe.contentWindow;
|
|
77
|
+
if (!n) return;
|
|
78
|
+
if (e !== "message") {
|
|
79
|
+
n.addEventListener(e, t);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let r = (e) => {
|
|
83
|
+
let n = e, r = n.data;
|
|
84
|
+
r && r.channel === "docs:local-out" || t({
|
|
85
|
+
data: n.data,
|
|
86
|
+
source: this.parent
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
this.listeners.set(t, r), n.addEventListener("message", r);
|
|
90
|
+
}
|
|
91
|
+
removeEventListener(e, t) {
|
|
92
|
+
let n = this.iframe.contentWindow;
|
|
93
|
+
if (!n) return;
|
|
94
|
+
let r = this.listeners.get(t);
|
|
95
|
+
if (r) {
|
|
96
|
+
this.listeners.delete(t), n.removeEventListener(e, r);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
n.removeEventListener(e, t);
|
|
100
|
+
}
|
|
101
|
+
requestAnimationFrame(e) {
|
|
102
|
+
return window.requestAnimationFrame(e);
|
|
103
|
+
}
|
|
104
|
+
cancelAnimationFrame(e) {
|
|
105
|
+
window.cancelAnimationFrame(e);
|
|
106
|
+
}
|
|
107
|
+
setTimeout(e, t, ...n) {
|
|
108
|
+
return window.setTimeout(e, t, ...n);
|
|
109
|
+
}
|
|
110
|
+
clearTimeout(e) {
|
|
111
|
+
window.clearTimeout(e);
|
|
112
|
+
}
|
|
113
|
+
}, j = (e) => {
|
|
114
|
+
if (e == null) return "";
|
|
115
|
+
let t = typeof e == "object" && "message" in e ? e.message : e;
|
|
116
|
+
if (t == null || t === "") return "";
|
|
117
|
+
let n = String(t);
|
|
118
|
+
return n === "undefined" || n === "null" ? "" : n;
|
|
119
|
+
}, M = ["srcdoc"], N = /*@__PURE__*/ i({
|
|
120
|
+
__name: "local-sandbox",
|
|
121
|
+
props: {
|
|
122
|
+
files: {},
|
|
123
|
+
entry: {},
|
|
124
|
+
options: {},
|
|
125
|
+
previewScroller: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: !1
|
|
128
|
+
},
|
|
129
|
+
clearConsole: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: !1
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
emits: ["error"],
|
|
135
|
+
setup(b, { expose: x, emit: S }) {
|
|
136
|
+
let E = b, D = S, N = O, P = a(null), F = a(null), I = a(null), L = a(""), R = a(""), z = f(null), B = null, V = null, H = 0, U = null, W = `docs-local-${Math.random().toString(36).slice(2, 10)}`, G = () => {
|
|
137
|
+
D("error", {
|
|
138
|
+
compile: L.value,
|
|
139
|
+
runtime: R.value
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
d([L, R], G);
|
|
143
|
+
let K = (e) => i({
|
|
144
|
+
name: "DocsLink",
|
|
145
|
+
props: { to: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: ""
|
|
148
|
+
} },
|
|
149
|
+
setup(t, { slots: n }) {
|
|
150
|
+
return () => m("a", {
|
|
151
|
+
href: t.to,
|
|
152
|
+
style: {
|
|
153
|
+
color: "inherit",
|
|
154
|
+
textDecoration: "none"
|
|
155
|
+
},
|
|
156
|
+
onClick(n) {
|
|
157
|
+
n.preventDefault(), e.parent.postMessage({
|
|
158
|
+
action: "docs:navigate",
|
|
159
|
+
to: t.to
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}, n.default?.());
|
|
163
|
+
}
|
|
164
|
+
}), q = () => {
|
|
165
|
+
V?.unmount(), V = null, w(W);
|
|
166
|
+
}, J = (e, r, i) => {
|
|
167
|
+
if (!I.value) return;
|
|
168
|
+
q(), C(W, i), E.clearConsole && console.clear();
|
|
169
|
+
let a = E.previewScroller === !0, o = c({
|
|
170
|
+
name: "LocalSandboxRoot",
|
|
171
|
+
setup() {
|
|
172
|
+
let r = T(p);
|
|
173
|
+
return h("docs:playground", r), n((e) => {
|
|
174
|
+
let t = j(e);
|
|
175
|
+
return t && (R.value = t), !1;
|
|
176
|
+
}), t(() => r.dispose()), () => {
|
|
177
|
+
let t = m(e);
|
|
178
|
+
return a ? m(g, {
|
|
179
|
+
height: "100%",
|
|
180
|
+
native: !1,
|
|
181
|
+
autoResize: !0,
|
|
182
|
+
showBar: !0,
|
|
183
|
+
contentClass: y
|
|
184
|
+
}, { default: () => t }) : t;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
o.component("DocsLink", K(r)), o.config.errorHandler = (e) => {
|
|
189
|
+
let t = j(e);
|
|
190
|
+
t && (R.value = t);
|
|
191
|
+
}, o.mount(I.value), V = o;
|
|
192
|
+
}, Y = () => {
|
|
193
|
+
let e = F.value;
|
|
194
|
+
if (!e?.contentWindow) return null;
|
|
195
|
+
try {
|
|
196
|
+
if (!k(e)) return null;
|
|
197
|
+
} catch {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
return B ??= new A(e), z.value = e.contentWindow, B;
|
|
201
|
+
}, X = async () => {
|
|
202
|
+
let e = U;
|
|
203
|
+
/* istanbul ignore if -- 桥接 iframe 尚未就绪或编译已被取代 */
|
|
204
|
+
if (!e || e.version !== H) return;
|
|
205
|
+
let t = Y();
|
|
206
|
+
/* istanbul ignore if -- 挂载点在编译完成时已经存在 */
|
|
207
|
+
t && I.value && (await l(), U === e && I.value && (U = null, J(e.component, t, e.css)));
|
|
208
|
+
}, Z = async () => {
|
|
209
|
+
let e = ++H;
|
|
210
|
+
U = null, L.value = "", R.value = "", G(), q();
|
|
211
|
+
try {
|
|
212
|
+
let [{ compilePlayground: t }, { linkPlayground: n }, r, i] = await Promise.all([
|
|
213
|
+
import("./compile-Bw7v7QE--Dd1-R95H.js"),
|
|
214
|
+
import("./linker-JHdz37DK-CWgUtxZ5.js"),
|
|
215
|
+
import("./modules-DlLJF_vd-DcNdL6sc.js"),
|
|
216
|
+
import("./files-C5UMzYxA-q9oJ4PrI.js")
|
|
217
|
+
]);
|
|
218
|
+
/* istanbul ignore if -- 并发编译时只保留最后一次 */
|
|
219
|
+
if (e !== H) return;
|
|
220
|
+
let a = await t(E.files, { entry: E.entry });
|
|
221
|
+
/* istanbul ignore if -- 并发编译时只保留最后一次 */
|
|
222
|
+
if (e !== H) return;
|
|
223
|
+
if (a.errors.length || !a.entry) {
|
|
224
|
+
L.value = a.errors.join("\n") || "[Playground] 未能确定入口", G();
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
let o = v(E.options.cdnURL, E.options.builtinImportMap), s = i.collectBareSpecifiers(E.files, i.collectReachableFilenames(E.files, a.entry)), { createRemoteLoader: c } = await import("./remote-DfXAsO9n-C_MtPVYr.js"), l = c(o, {
|
|
228
|
+
vue: p,
|
|
229
|
+
vueRouter: _
|
|
230
|
+
}, E.options.cdnURL), u = await r.loadLocalModules(s, o, {
|
|
231
|
+
vue: p,
|
|
232
|
+
vueRouter: _
|
|
233
|
+
}, (e) => l.load(e), E.options.cdnURL);
|
|
234
|
+
/* istanbul ignore if -- 并发编译时只保留最后一次 */
|
|
235
|
+
if (e !== H) return;
|
|
236
|
+
if (u.errors.length) {
|
|
237
|
+
L.value = u.errors.join("\n"), G();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
let d = n(a, E.files, { modules: u.modules });
|
|
241
|
+
/* istanbul ignore if -- 并发编译时只保留最后一次 */
|
|
242
|
+
if (e !== H) return;
|
|
243
|
+
if (d.errors.length || !d.component) {
|
|
244
|
+
L.value = (d.errors.length ? d.errors : ["[Playground] 未能解析入口组件"]).join("\n"), G();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
U = {
|
|
248
|
+
component: d.component,
|
|
249
|
+
css: d.css,
|
|
250
|
+
version: e
|
|
251
|
+
}, await X();
|
|
252
|
+
} catch (t) {
|
|
253
|
+
/* istanbul ignore next -- 编译器自身异常才进入,普通错误走结果里的 errors */
|
|
254
|
+
if (e !== H) return;
|
|
255
|
+
/* istanbul ignore next -- 同上,只兜底编译器抛错 */
|
|
256
|
+
L.value = t instanceof Error ? t.message : String(t), G();
|
|
257
|
+
}
|
|
258
|
+
}, Q = () => {
|
|
259
|
+
X();
|
|
260
|
+
};
|
|
261
|
+
return e(() => {
|
|
262
|
+
Z();
|
|
263
|
+
}), d(() => [
|
|
264
|
+
E.files,
|
|
265
|
+
E.entry,
|
|
266
|
+
E.options,
|
|
267
|
+
E.previewScroller
|
|
268
|
+
], () => {
|
|
269
|
+
P.value && Z();
|
|
270
|
+
}, { deep: !0 }), t(() => {
|
|
271
|
+
H += 1, U = null, q();
|
|
272
|
+
}), x({
|
|
273
|
+
container: P,
|
|
274
|
+
messageSource: z,
|
|
275
|
+
local: !0,
|
|
276
|
+
refresh: () => {
|
|
277
|
+
Z();
|
|
278
|
+
}
|
|
279
|
+
}), (e, t) => (r(), s("div", {
|
|
280
|
+
ref_key: "containerEl",
|
|
281
|
+
ref: P,
|
|
282
|
+
class: "docs-playground-local"
|
|
283
|
+
}, [u("iframe", {
|
|
284
|
+
ref_key: "bridgeEl",
|
|
285
|
+
ref: F,
|
|
286
|
+
class: "docs-playground-local__bridge",
|
|
287
|
+
tabindex: "-1",
|
|
288
|
+
"aria-hidden": "true",
|
|
289
|
+
title: "",
|
|
290
|
+
srcdoc: o(N),
|
|
291
|
+
onLoad: Q
|
|
292
|
+
}, null, 40, M), u("div", {
|
|
293
|
+
ref_key: "mountEl",
|
|
294
|
+
ref: I,
|
|
295
|
+
class: "docs-playground-local__mount"
|
|
296
|
+
}, null, 512)], 512));
|
|
297
|
+
}
|
|
298
|
+
}), P = /* @__PURE__ */ x({ default: () => F }), F = N;
|
|
299
|
+
//#endregion
|
|
300
|
+
export { S as n, P as t };
|