@deot/docs-client 1.1.4 → 1.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/docs-client",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "style": "dist/index.style.css",
@@ -21,15 +21,15 @@
21
21
  "access": "public"
22
22
  },
23
23
  "dependencies": {
24
- "@deot/docs-locale": "^1.1.1",
25
- "@deot/docs-markdown": "^1.1.4",
26
- "@deot/docs-playground": "^1.1.3",
27
- "@deot/docs-renderer": "^1.1.1",
28
- "@deot/docs-theme": "^1.1.1",
24
+ "@deot/docs-locale": "^1.1.2",
25
+ "@deot/docs-markdown": "^1.1.5",
26
+ "@deot/docs-playground": "^1.1.4",
27
+ "@deot/docs-renderer": "^1.1.2",
28
+ "@deot/docs-theme": "^1.1.2",
29
29
  "@deot/helper-cache": "^1.1.11",
30
- "@deot/helper-fp": "^1.1.6",
30
+ "@deot/helper": "^1.1.20",
31
31
  "@deot/http": "^1.1.10",
32
- "@deot/vc": "^1.2.1",
32
+ "@deot/vc": "^1.2.3",
33
33
  "es-module-lexer": "^2.3.1"
34
34
  },
35
35
  "devDependencies": {
@@ -1,39 +0,0 @@
1
- globalThis.process;
2
- import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
3
- //#region node_modules/.pnpm/@deot+helper-resize@1.1.4/node_modules/@deot/helper-resize/dist/index.js
4
- var t = /* @__PURE__ */ e({ Resize: () => n }), n = class e {
5
- el;
6
- static of(t) {
7
- return new e(t);
8
- }
9
- static on(t, n) {
10
- return new e(t).on(n);
11
- }
12
- static off(t, n) {
13
- return new e(t).off(n);
14
- }
15
- listeners = [];
16
- ro = null;
17
- constructor(t) {
18
- this.el = t;
19
- let n = t.__rz__;
20
- n && n instanceof e && (this.listeners = n.listeners, this.ro = n.ro);
21
- }
22
- handleResize = (e) => {
23
- /* istanbul ignore else -- @preserve */
24
- e.some((e) => e.target === this.el) && this.listeners?.forEach((e) => e());
25
- };
26
- on(e) {
27
- return typeof ResizeObserver > "u" ? () => {} : (this.listeners.length || (this.ro = this.ro || new ResizeObserver(this.handleResize), this.ro.observe(this.el), this.el.__rz__ = this), this.listeners.push(e), () => this.off(e));
28
- }
29
- off(e) {
30
- if (e) {
31
- let t = this.listeners.indexOf(e);
32
- if (t === -1) return;
33
- this.listeners.splice(t, 1);
34
- } else this.listeners = [];
35
- !this.listeners.length && this.ro && this.ro.disconnect();
36
- }
37
- };
38
- //#endregion
39
- export { t as n, n as t };
@@ -1,110 +0,0 @@
1
- globalThis.process;
2
- //#region packages/playground/dist/files-C5UMzYxA.js
3
- var e = /* @__PURE__ */ new Set(["import-map.json", "tsconfig.json"]), t = (e) => {
4
- let t = String(e || "").replace(/\\/gu, "/").trim();
5
- if (!t) return "/";
6
- let n = (t.startsWith("/") ? t : `/${t}`).split("/"), r = [];
7
- for (let e of n) if (e && e !== ".") {
8
- if (e === "..") {
9
- r.length && r.pop();
10
- continue;
11
- }
12
- r.push(e);
13
- }
14
- return `/${r.join("/")}`;
15
- }, n = (e) => {
16
- let n = t(e), r = n.lastIndexOf("/");
17
- return r <= 0 ? "/" : n.slice(0, r) || "/";
18
- }, r = (e) => {
19
- let n = t(e), r = n.lastIndexOf("/");
20
- return r === -1 ? n : n.slice(r + 1);
21
- }, i = (e, n) => {
22
- let r = String(n || "").replace(/\\/gu, "/");
23
- if (r.startsWith("/")) return t(r);
24
- let i = t(e);
25
- return t(`${i === "/" ? "" : i}/${r}`);
26
- }, a = (e) => {
27
- let t = r(e), n = t.lastIndexOf(".");
28
- return n <= 0 ? "" : t.slice(n).toLowerCase();
29
- }, o = (t) => e.has(r(t)), s = (e) => {
30
- let n = /* @__PURE__ */ new Map();
31
- return Object.entries(e || {}).forEach(([e, r]) => {
32
- let i = t(e);
33
- o(i) || n.set(i, r);
34
- }), n;
35
- }, c = (e, n) => {
36
- let i = s(e);
37
- if (!i.size) throw Error("[Playground] files 为空,无法确定入口");
38
- if (n) {
39
- let e = t(n);
40
- if (o(e)) throw Error(`[Playground] entry 不能是 ${r(e)}`);
41
- if (!i.has(e)) throw Error(`[Playground] entry 不在 files 中: ${n}`);
42
- return e;
43
- }
44
- for (let n of Object.keys(e || {})) {
45
- let e = t(n);
46
- if (!o(e) && i.has(e)) return e;
47
- }
48
- /* istanbul ignore next -- 忽略文件已在前面排除,正常 files 不会走到这里 */
49
- throw Error("[Playground] files 中没有可用的入口文件");
50
- }, l = [
51
- ".vue",
52
- ".ts",
53
- ".js",
54
- ".tsx",
55
- ".jsx",
56
- ".json",
57
- ".css",
58
- ".scss",
59
- ".sass"
60
- ], u = (e, t, r) => {
61
- if (!t || !(t.startsWith("./") || t.startsWith("../") || t.startsWith("/"))) return null;
62
- let a = i(n(e), t);
63
- if (r.has(a)) return a;
64
- for (let e of l) {
65
- let t = `${a}${e}`;
66
- if (r.has(t)) return t;
67
- }
68
- for (let e of l) {
69
- let t = `${a}/index${e}`;
70
- if (r.has(t)) return t;
71
- }
72
- return null;
73
- }, d = (e) => {
74
- let r = e.map(t);
75
- if (!r.length) return "/";
76
- let i = r.map((e) => e.split("/").filter(Boolean)), a = i[0], o = a.length;
77
- for (let e = 1; e < i.length; e += 1) {
78
- let t = 0;
79
- for (; t < o && t < i[e].length && a[t] === i[e][t];) t += 1;
80
- o = t;
81
- }
82
- if (!o) return "/";
83
- let s = `/${a.slice(0, o).join("/")}`;
84
- return r.some((e) => e === s) ? n(s) : s;
85
- }, f = (e, n) => {
86
- let r = t(e), i = t(n);
87
- return i === "/" || r === i || r.startsWith(`${i}/`);
88
- }, p = (e) => {
89
- let t = [], n = String(e || "");
90
- for (let e of n.matchAll(/(?:\bfrom\s+|import\s*\(\s*|import\s+)['"]([^'"]+)['"]/gu)) e[1] && t.push(e[1]);
91
- return t;
92
- }, m = (e) => e.startsWith("./") || e.startsWith("../") || e.startsWith("/"), h = (e, n) => {
93
- let r = s(e), i = [], a = /* @__PURE__ */ new Set(), o = (e) => {
94
- let n = t(e);
95
- !a.has(n) && r.has(n) && (a.add(n), i.push(n), p(r.get(n) || "").forEach((e) => {
96
- let t = u(n, e, r);
97
- t && o(t);
98
- }));
99
- };
100
- return o(n), i;
101
- }, g = (e, n) => {
102
- let r = s(e), i = [], a = /* @__PURE__ */ new Set();
103
- return n.forEach((e) => {
104
- p(r.get(t(e)) || "").forEach((e) => {
105
- !e || m(e) || a.has(e) || (a.add(e), i.push(e));
106
- });
107
- }), i;
108
- };
109
- //#endregion
110
- export { r as basename, g as collectBareSpecifiers, h as collectReachableFilenames, s as createFileIndex, n as dirname, d as getCommonRoot, a as getExtension, o as isIgnoredFilename, f as isInsideRoot, m as isRelativeSpecifier, i as joinVirtualPath, p as listImportSpecifiers, t as normalizeVirtualPath, c as resolveEntry, u as resolveModulePath };
@@ -1,75 +0,0 @@
1
- globalThis.process;
2
- import { isRelativeSpecifier as e, listImportSpecifiers as t } from "./files-C5UMzYxA-q9oJ4PrI.js";
3
- import { r as n, t as r } from "./script-xKUjE8pf-oF69rg-w.js";
4
- import { n as i, prefersLocalBuiltin as a, resolveHostModule as o, resolveImportTarget as s, t as c, toHostModule as l } from "./modules-DlLJF_vd-DcNdL6sc.js";
5
- //#region packages/playground/dist/remote-DfXAsO9n.js
6
- var u = /* @__PURE__ */ new Set(["vue", "vue/server-renderer"]), d = (d, f, p) => {
7
- let m = {
8
- vue: f.vue,
9
- "vue-router": f.vueRouter
10
- }, h = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set(), y = (e) => {
11
- if (d[e] && !a(e, d, p)) return null;
12
- if (a(e, d, p)) return e;
13
- let t = e;
14
- for (;;) {
15
- let e = t.lastIndexOf("/");
16
- if (e <= 0) return null;
17
- let n = t.slice(0, e);
18
- if (a(n, d, p)) return n;
19
- t = n;
20
- }
21
- }, b = (t, n) => {
22
- if (e(n)) return new URL(n, t).href;
23
- if (d[n] && !a(n, d, p)) return d[n];
24
- if (u.has(n) && a(n, d, p)) return null;
25
- let r = n;
26
- for (; r;) {
27
- if (i.has(r) && a(r, d, p)) return h.add(r), null;
28
- let e = r.lastIndexOf("/");
29
- if (e <= 0) break;
30
- r = r.slice(0, e);
31
- }
32
- let o = d[n] ? n : s(n, d);
33
- return !o || !d[o] ? null : d[o];
34
- }, x = async (e) => {
35
- if (v.has(e)) return;
36
- v.add(e);
37
- let n = await fetch(e);
38
- if (!n.ok) throw Error(`${n.status} ${e}`);
39
- let r = await n.text();
40
- g.set(e, r);
41
- let i = r.replace(/\/\*[\s\S]*?\*\//g, "");
42
- await Promise.all(t(i).map(async (t) => {
43
- let n = b(e, t);
44
- n && await x(n);
45
- }));
46
- }, S = (t) => (n) => {
47
- if (u.has(n) && a(n, d, p)) return l(f.vue);
48
- let r = y(n);
49
- if (r) return l(m[r]);
50
- if (e(n)) return C(new URL(n, t).href);
51
- let i = d[n] ? n : s(n, d);
52
- if (!i || !d[i]) throw Error(`[Playground] 未注册的模块 "${n}"`);
53
- let c = C(d[i]);
54
- if (i === n) return c;
55
- if (!o(n, { [i]: c }))
56
- /* istanbul ignore next -- 父包没有对应导出时才拒绝 */
57
- throw Error(`[Playground] 未注册的模块 "${n}"`);
58
- return c;
59
- }, C = (e) => {
60
- if (_.has(e)) return _.get(e);
61
- let t = g.get(e);
62
- if (t == null) throw Error(`[Playground] 远程模块尚未下载: ${e}`);
63
- let i = n(r(t, e), {
64
- transforms: ["imports"],
65
- production: !0,
66
- filePath: e
67
- }).code, a = { exports: {} };
68
- return _.set(e, a.exports), Function("require", "module", "exports", i)(S(e), a, a.exports), _.set(e, a.exports), a.exports;
69
- };
70
- return { load: async (e) => (await x(e), await Promise.all([...h].map(async (e) => {
71
- e !== "vue" && e !== "vue-router" && (m[e] = await c(e));
72
- })), C(e)) };
73
- };
74
- //#endregion
75
- export { d as createRemoteLoader };