@fangzhongya/vue-archive 0.0.6 → 0.0.8
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 +3 -2
- package/dist/node/index.cjs +135 -71
- package/dist/node/index.d.cts +8 -0
- package/dist/node/index.d.ts +8 -0
- package/dist/node/index.js +118 -54
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.cjs +1 -0
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.js +9 -0
- package/dist/packages/components/aside/index.vue.cjs +1 -1
- package/dist/packages/components/aside/index.vue.js +43 -45
- package/dist/packages/components/boxurl/index.vue.cjs +1 -1
- package/dist/packages/components/boxurl/index.vue.js +34 -37
- package/dist/packages/components/choice/choice.vue.cjs +1 -1
- package/dist/packages/components/choice/choice.vue.js +29 -32
- package/dist/packages/components/choice/index.vue.cjs +1 -1
- package/dist/packages/components/choice/index.vue.js +39 -42
- package/dist/packages/components/code/highlight.vue2.cjs +1 -1
- package/dist/packages/components/code/highlight.vue2.js +1 -1
- package/dist/packages/components/code/index.vue.cjs +1 -1
- package/dist/packages/components/code/index.vue.js +79 -87
- package/dist/packages/components/compo/ftable.vue.cjs +1 -1
- package/dist/packages/components/compo/ftable.vue.js +15 -15
- package/dist/packages/components/compo/index.cjs +1 -1
- package/dist/packages/components/compo/index.js +86 -97
- package/dist/packages/components/compo/index.vue.cjs +1 -1
- package/dist/packages/components/compo/index.vue.js +33 -34
- package/dist/packages/components/compo/info.vue.cjs +1 -1
- package/dist/packages/components/compo/info.vue.js +22 -25
- package/dist/packages/components/compo/top.cjs +1 -1
- package/dist/packages/components/compo/top.js +21 -21
- package/dist/packages/components/main/index.vue.cjs +1 -1
- package/dist/packages/components/main/index.vue.js +16 -17
- package/dist/packages/components/md/index.vue.cjs +1 -1
- package/dist/packages/components/md/index.vue.js +28 -32
- package/dist/packages/components/test/index.cjs +1 -1
- package/dist/packages/components/test/index.js +39 -42
- package/dist/packages/components/test/index.vue.cjs +1 -1
- package/dist/packages/components/test/index.vue.js +44 -49
- package/dist/packages/components/use/code.cjs +1 -1
- package/dist/packages/components/use/code.js +3 -3
- package/dist/packages/components/use/index.cjs +1 -1
- package/dist/packages/components/use/index.js +1 -1
- package/dist/packages/components/use/retrie/choice/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/choice/index.vue.js +32 -34
- package/dist/packages/components/use/retrie/expose/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/expose/index.vue.js +18 -19
- package/dist/packages/components/use/retrie/form/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/form/index.vue.js +110 -114
- package/dist/packages/components/use/retrie/function/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/function/index.vue.js +1 -4
- package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/index.vue.js +20 -21
- package/dist/packages/components/use/retrie/number/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/number/index.vue.js +12 -13
- package/dist/packages/components/use/retrie/select/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/select/index.vue.js +21 -23
- package/dist/packages/components/use/retrie/slot/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/slot/index.vue.js +15 -16
- package/dist/packages/components/use/retrie/string/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/string/index.vue.js +14 -15
- package/dist/packages/components/use/set-emit.vue.cjs +1 -1
- package/dist/packages/components/use/set-emit.vue.js +20 -24
- package/dist/packages/components/use/set-expose.vue.cjs +1 -1
- package/dist/packages/components/use/set-expose.vue.js +15 -18
- package/dist/packages/components/use/set-props.vue.cjs +1 -1
- package/dist/packages/components/use/set-props.vue.js +48 -49
- package/dist/packages/config.cjs +1 -1
- package/dist/packages/config.d.ts +8 -1
- package/dist/packages/config.js +1 -1
- package/dist/packages/directives/adjust/index copy.d.ts +6 -0
- package/dist/packages/directives/adjust/index.cjs +1 -1
- package/dist/packages/directives/adjust/index.js +96 -97
- package/dist/packages/page/comprops/index.vue2.cjs +1 -1
- package/dist/packages/page/comprops/index.vue2.js +65 -71
- package/dist/packages/page/index/index.vue2.cjs +1 -1
- package/dist/packages/page/index/index.vue2.js +19 -23
- package/dist/packages/page/single/index.vue2.cjs +1 -1
- package/dist/packages/page/single/index.vue2.js +46 -49
- package/dist/packages/router/index.cjs +1 -1
- package/dist/packages/router/index.js +44 -46
- package/dist/packages/utils/common.cjs +1 -1
- package/dist/packages/utils/common.d.ts +4 -0
- package/dist/packages/utils/common.js +57 -54
- package/dist/packages/utils/glob.cjs +3 -3
- package/dist/packages/utils/glob.d.ts +1 -1
- package/dist/packages/utils/glob.js +269 -227
- package/dist/packages/utils/props.cjs +1 -1
- package/dist/packages/utils/props.js +34 -28
- package/dist/src/components/common/cs3.d.ts +4 -0
- package/dist/src/components/common/index.d.ts +4 -0
- package/dist/src/components/cs/expose/index.d.ts +4 -1
- package/dist/src/components/cs/expose/src/index.vue.d.ts +4 -1
- package/dist/vue-archive.css +1 -1
- package/package.json +19 -20
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.cjs +0 -1
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js +0 -9
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-5RZYHE3X.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-5RZYHE3X.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-AM67P3W7.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-AM67P3W7.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-APKFW4LU.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-APKFW4LU.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VBS6YE6H.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VBS6YE6H.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VKE5JARB.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VKE5JARB.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XUL6LPTN.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XUL6LPTN.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js +0 -0
- /package/dist/node_modules/.pnpm/{@highlightjs_vue-plugin@2.1_0b670f4f8863792fd47bf820772b9cbf → @highlightjs_vue-plugin@2.1_b586068ec461434c266304f56a34d01a}/node_modules/@highlightjs/vue-plugin/dist/highlightjs-vue.esm.min.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@highlightjs_vue-plugin@2.1_0b670f4f8863792fd47bf820772b9cbf → @highlightjs_vue-plugin@2.1_b586068ec461434c266304f56a34d01a}/node_modules/@highlightjs/vue-plugin/dist/highlightjs-vue.esm.min.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),d=require("../../components/compo/info.vue.cjs"),v=require("../../components/choice/index.vue.cjs"),p=require("../../components/test/index.vue.cjs"),g=require("../../components/compo/index.vue.cjs"),m=require("../../utils/glob.cjs"),N=require("vue-router"),y=require("../../router/index.cjs"),V={class:"__document-single"},f={class:"single-top-li"},h={class:"single-top-li-span"},E={class:"single-top-li-span"},q={class:"single-top-li"},k={class:"single-top-li-span"},x={class:"single-test"},S={class:"single-compo"},w=e.defineComponent({__name:"index",setup(C){const i=N.useRoute(),a=y.getPageParams(i),n=e.ref({}),s=e.ref(),o=e.ref(!1);function u(t){return t.comkey}function c(t){return(t.id||"").split("/")[0]||""}function r(){o.value=!o.value}function _(t){n.value=t,s.value=m.getTestNameObj(i.query.id+"",a.key,t.key)[0]}return(t,l)=>(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(v,{"get-name":c,"get-key":u,onChange:_},{default:e.withCtx(()=>[e.createVNode(d,{value:n.value},null,8,["value"]),e.createElementVNode("div",{class:"single-top",onClick:r},[e.createElementVNode("div",f,[e.createElementVNode("div",h,e.toDisplayString(s.value?.name),1),e.createElementVNode("div",E,e.toDisplayString(s.value?.value),1)]),e.createElementVNode("div",q,[l[0]||(l[0]=e.createElementVNode("div",{class:"single-top-li-span"}," 文件路径 ",-1)),e.createElementVNode("div",k,e.toDisplayString(s.value?.key),1)])]),e.createElementVNode("div",x,[e.createVNode(p,{value:s.value},null,8,["value"])]),e.withDirectives(e.createElementVNode("div",S,[e.createVNode(g,{value:n.value},null,8,["value"])],512),[[e.vShow,o.value]])]),_:1})]))}});module.exports=w;
|
|
@@ -1,69 +1,66 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getTestNameObj as
|
|
7
|
-
import { useRoute as
|
|
8
|
-
import { getPageParams as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as d, ref as a, createElementBlock as f, openBlock as g, createVNode as o, withCtx as h, createElementVNode as e, withDirectives as k, toDisplayString as c, vShow as y } from "vue";
|
|
2
|
+
import w from "../../components/compo/info.vue.js";
|
|
3
|
+
import x from "../../components/choice/index.vue.js";
|
|
4
|
+
import C from "../../components/test/index.vue.js";
|
|
5
|
+
import N from "../../components/compo/index.vue.js";
|
|
6
|
+
import { getTestNameObj as $ } from "../../utils/glob.js";
|
|
7
|
+
import { useRoute as S } from "vue-router";
|
|
8
|
+
import { getPageParams as B } from "../../router/index.js";
|
|
9
|
+
const D = { class: "__document-single" }, E = { class: "single-top-li" }, P = { class: "single-top-li-span" }, V = { class: "single-top-li-span" }, b = { class: "single-top-li" }, j = { class: "single-top-li-span" }, q = { class: "single-test" }, K = { class: "single-compo" }, L = /* @__PURE__ */ d({
|
|
10
10
|
__name: "index",
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
function
|
|
11
|
+
setup(O) {
|
|
12
|
+
const r = S(), u = B(r), n = a({}), s = a(), i = a(!1);
|
|
13
|
+
function m(t) {
|
|
14
14
|
return t.comkey;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function _(t) {
|
|
17
17
|
return (t.id || "").split("/")[0] || "";
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function v() {
|
|
20
20
|
i.value = !i.value;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
n.value = t, s.value =
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
function p(t) {
|
|
23
|
+
n.value = t, s.value = $(
|
|
24
|
+
r.query.id + "",
|
|
25
|
+
u.key,
|
|
26
26
|
t.key
|
|
27
27
|
)[0];
|
|
28
28
|
}
|
|
29
|
-
return (t, l) => (
|
|
30
|
-
o(
|
|
31
|
-
"get-name":
|
|
32
|
-
"get-key":
|
|
33
|
-
onChange:
|
|
29
|
+
return (t, l) => (g(), f("div", D, [
|
|
30
|
+
o(x, {
|
|
31
|
+
"get-name": _,
|
|
32
|
+
"get-key": m,
|
|
33
|
+
onChange: p
|
|
34
34
|
}, {
|
|
35
|
-
default:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
e("div",
|
|
44
|
-
e("div", j, r((a = s.value) == null ? void 0 : a.name), 1),
|
|
45
|
-
e("div", q, r((m = s.value) == null ? void 0 : m.value), 1)
|
|
46
|
-
]),
|
|
47
|
-
e("div", K, [
|
|
48
|
-
l[0] || (l[0] = e("div", { class: "single-top-li-span" }, " 文件路径 ", -1)),
|
|
49
|
-
e("div", O, r((_ = s.value) == null ? void 0 : _.key), 1)
|
|
50
|
-
])
|
|
51
|
-
]),
|
|
52
|
-
e("div", R, [
|
|
53
|
-
o(S, { value: s.value }, null, 8, ["value"])
|
|
35
|
+
default: h(() => [
|
|
36
|
+
o(w, { value: n.value }, null, 8, ["value"]),
|
|
37
|
+
e("div", {
|
|
38
|
+
class: "single-top",
|
|
39
|
+
onClick: v
|
|
40
|
+
}, [
|
|
41
|
+
e("div", E, [
|
|
42
|
+
e("div", P, c(s.value?.name), 1),
|
|
43
|
+
e("div", V, c(s.value?.value), 1)
|
|
54
44
|
]),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
[C, i.value]
|
|
45
|
+
e("div", b, [
|
|
46
|
+
l[0] || (l[0] = e("div", { class: "single-top-li-span" }, " 文件路径 ", -1)),
|
|
47
|
+
e("div", j, c(s.value?.key), 1)
|
|
59
48
|
])
|
|
60
|
-
]
|
|
61
|
-
|
|
49
|
+
]),
|
|
50
|
+
e("div", q, [
|
|
51
|
+
o(C, { value: s.value }, null, 8, ["value"])
|
|
52
|
+
]),
|
|
53
|
+
k(e("div", K, [
|
|
54
|
+
o(N, { value: n.value }, null, 8, ["value"])
|
|
55
|
+
], 512), [
|
|
56
|
+
[y, i.value]
|
|
57
|
+
])
|
|
58
|
+
]),
|
|
62
59
|
_: 1
|
|
63
60
|
})
|
|
64
61
|
]));
|
|
65
62
|
}
|
|
66
63
|
});
|
|
67
64
|
export {
|
|
68
|
-
|
|
65
|
+
L as default
|
|
69
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../config.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../config.cjs"),s=require("../utils/storage.cjs"),f=require("./file.cjs"),g=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"})),i=[{path:"/__document",name:"__document",component:()=>Promise.resolve().then(()=>g(require("../index/index.vue.cjs"))),redirect:{name:"__documentIndex"},meta:{title:"文档"},children:[]}];let m=0;document.addEventListener("keydown",y);function y(e){e=e||window.event,(e.ctrlKey&&e.location==82||e.location==116)&&s.setSession("-keydown-F5",2)}let o="__document";function h(e){o=u.getConfig("router")||"__document";let t="/"+o;i[0].path=t,i[0].redirect={name:o+"Index"},i[0].children?.unshift({path:t+"/:chapters+",redirect:{name:o+"Index"}}),f.getFileName().forEach(n=>{i[0].children?.push({path:n.value,name:o+n.name,component:n.component})});const a=u.getConfig("redirect");if(i.forEach(n=>{e.addRoute(n),e.beforeEach((r,c)=>{if(c.fullPath=="/"){let p=s.getSession("-keydown-F5");document.referrer||p==2?(console.log("刷新"),m=2):(console.log("地址栏输入 或者 刷新"),m=3)}else console.log("跳转"),m=1;s.setSession("-keydown-F5",0)})}),a){const n=e.getRoutes().filter(r=>r.path=="/")[0]||{path:"/"};n.redirect=t,n.name?e.addRoute(n.name,n):e.addRoute(n)}}const d={};function k(e){let t=e.path,a=e.params;if(a&&Object.keys(a).length)return a;{let n=d[t];return n&&Object.keys(n).length?n:m==3?{}:s.getSession("router.toPage."+t)}}function l(e,t,a="push"){let n=t.path||"";const r=t.name,c=t.params||{};e[a](t),r&&(n=e.resolve({name:r}).path),d[n]=c,s.setSession("router.toPage."+n,c)}function _(e,t){l(e,{name:o+"Single",query:{id:t.name+"/"+t.value},params:{key:t.key,comkey:t.comkey}})}function v(e,t){l(e,{name:o+"Develop",query:{id:t.value},params:{key:t.key}})}function P(e,t){l(e,{name:o+"Tests",query:{id:t.value},params:{key:t.key}})}function S(e,t){l(e,{name:o+"Compon",query:{id:t.value},params:{key:t.key}})}exports.getPageParams=k;exports.init=h;exports.toCompon=S;exports.toDevelop=v;exports.toPage=l;exports.toSingle=_;exports.toTests=P;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getConfig as d } from "../config.js";
|
|
2
2
|
import { setSession as s, getSession as p } from "../utils/storage.js";
|
|
3
|
-
import { getFileName as
|
|
4
|
-
const
|
|
3
|
+
import { getFileName as h } from "./file.js";
|
|
4
|
+
const i = [
|
|
5
5
|
{
|
|
6
6
|
path: "/__document",
|
|
7
7
|
name: "__document",
|
|
@@ -12,38 +12,36 @@ const m = [
|
|
|
12
12
|
}
|
|
13
13
|
];
|
|
14
14
|
let c = 0;
|
|
15
|
-
document.addEventListener("keydown",
|
|
16
|
-
function
|
|
15
|
+
document.addEventListener("keydown", y);
|
|
16
|
+
function y(e) {
|
|
17
17
|
e = e || window.event, (e.ctrlKey && e.location == 82 || //ctrl+R
|
|
18
18
|
e.location == 116) && s("-keydown-F5", 2);
|
|
19
19
|
}
|
|
20
|
-
let
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
m[0].path = t, m[0].redirect = { name: a + "Index" }, (o = m[0].children) == null || o.unshift({
|
|
20
|
+
let o = "__document";
|
|
21
|
+
function _(e) {
|
|
22
|
+
o = d("router") || "__document";
|
|
23
|
+
let t = "/" + o;
|
|
24
|
+
i[0].path = t, i[0].redirect = { name: o + "Index" }, i[0].children?.unshift({
|
|
26
25
|
path: t + "/:chapters+",
|
|
27
|
-
redirect: { name:
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
(r = m[0].children) == null || r.push({
|
|
26
|
+
redirect: { name: o + "Index" }
|
|
27
|
+
}), h().forEach((n) => {
|
|
28
|
+
i[0].children?.push({
|
|
31
29
|
path: n.value,
|
|
32
|
-
name:
|
|
30
|
+
name: o + n.name,
|
|
33
31
|
component: n.component
|
|
34
32
|
});
|
|
35
33
|
});
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
e.addRoute(n), e.beforeEach((r,
|
|
39
|
-
if (
|
|
40
|
-
let
|
|
41
|
-
document.referrer ||
|
|
34
|
+
const a = d("redirect");
|
|
35
|
+
if (i.forEach((n) => {
|
|
36
|
+
e.addRoute(n), e.beforeEach((r, m) => {
|
|
37
|
+
if (m.fullPath == "/") {
|
|
38
|
+
let f = p("-keydown-F5");
|
|
39
|
+
document.referrer || f == 2 ? (console.log("刷新"), c = 2) : (console.log("地址栏输入 或者 刷新"), c = 3);
|
|
42
40
|
} else
|
|
43
41
|
console.log("跳转"), c = 1;
|
|
44
42
|
s("-keydown-F5", 0);
|
|
45
43
|
});
|
|
46
|
-
}),
|
|
44
|
+
}), a) {
|
|
47
45
|
const n = e.getRoutes().filter((r) => r.path == "/")[0] || {
|
|
48
46
|
path: "/"
|
|
49
47
|
};
|
|
@@ -51,50 +49,50 @@ function P(e) {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
const u = {};
|
|
54
|
-
function
|
|
55
|
-
let t = e.path,
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
52
|
+
function P(e) {
|
|
53
|
+
let t = e.path, a = e.params;
|
|
54
|
+
if (a && Object.keys(a).length)
|
|
55
|
+
return a;
|
|
58
56
|
{
|
|
59
|
-
let
|
|
60
|
-
return
|
|
57
|
+
let n = u[t];
|
|
58
|
+
return n && Object.keys(n).length ? n : c == 3 ? {} : p("router.toPage." + t);
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
|
-
function l(e, t,
|
|
64
|
-
let
|
|
65
|
-
const
|
|
66
|
-
e[
|
|
61
|
+
function l(e, t, a = "push") {
|
|
62
|
+
let n = t.path || "";
|
|
63
|
+
const r = t.name, m = t.params || {};
|
|
64
|
+
e[a](t), r && (n = e.resolve({ name: r }).path), u[n] = m, s("router.toPage." + n, m);
|
|
67
65
|
}
|
|
68
|
-
function
|
|
66
|
+
function w(e, t) {
|
|
69
67
|
l(e, {
|
|
70
|
-
name:
|
|
68
|
+
name: o + "Single",
|
|
71
69
|
query: {
|
|
72
70
|
id: t.name + "/" + t.value
|
|
73
71
|
},
|
|
74
72
|
params: { key: t.key, comkey: t.comkey }
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
|
-
function
|
|
75
|
+
function x(e, t) {
|
|
78
76
|
l(e, {
|
|
79
|
-
name:
|
|
77
|
+
name: o + "Develop",
|
|
80
78
|
query: {
|
|
81
79
|
id: t.value
|
|
82
80
|
},
|
|
83
81
|
params: { key: t.key }
|
|
84
82
|
});
|
|
85
83
|
}
|
|
86
|
-
function
|
|
84
|
+
function q(e, t) {
|
|
87
85
|
l(e, {
|
|
88
|
-
name:
|
|
86
|
+
name: o + "Tests",
|
|
89
87
|
query: {
|
|
90
88
|
id: t.value
|
|
91
89
|
},
|
|
92
90
|
params: { key: t.key }
|
|
93
91
|
});
|
|
94
92
|
}
|
|
95
|
-
function
|
|
93
|
+
function E(e, t) {
|
|
96
94
|
l(e, {
|
|
97
|
-
name:
|
|
95
|
+
name: o + "Compon",
|
|
98
96
|
query: {
|
|
99
97
|
id: t.value
|
|
100
98
|
},
|
|
@@ -102,11 +100,11 @@ function F(e, t) {
|
|
|
102
100
|
});
|
|
103
101
|
}
|
|
104
102
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
P as getPageParams,
|
|
104
|
+
_ as init,
|
|
105
|
+
E as toCompon,
|
|
106
|
+
x as toDevelop,
|
|
109
107
|
l as toPage,
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
w as toSingle,
|
|
109
|
+
q as toTests
|
|
112
110
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./storage.cjs"),M=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),q=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.cjs"),C=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.cjs"),w=["vue","js"];function K(t,e){let n=M.humpToLine(t.name),i=[];return t.alias&&i.push(t.alias+"-"+n),e&&e.length>0&&e.forEach(s=>{t.alias&&i.push(t.alias+"-"+s+"-"+n),i.push(s+"-"+n)}),i}function T(t){return t.sort((e,n)=>{let i=x.appearNum(e,"/"),s=x.appearNum(n,"/");return i==s?n.length-e.length:s-i}),t}function A(t=[],e=[],n=[]){let i=e;(!i||i.length==0)&&(i=w);let s=[];return t&&t.length>0&&(s=t),n&&n.length>0&&n.forEach(a=>{i?.forEach(p=>{s.push(a+"."+p)})}),s=[...new Set(s)],T(s)}function N(t,e,n={},i=""){for(let s=0;s<e.length;s++){const a=e[s],p=new RegExp("^.*/([^/]+)"+a+"$");let g=t.match(p);if(g){const c=[],u={};let d="";Object.keys(n).forEach(f=>{let l=n[f];t.startsWith(l+"/")&&(d=l,u[f]=l,c.push(f))});let h=g[1],o={url:"",dir:"",suffix:C.getSuffix(t),name:q.lineToLargeHump(h),value:h,key:"",tdir:"",adir:d,alias:i,aliass:u,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0};return o.aliasNames=K(o,c),o}}}function D(t){E.setSession("aside.key",t)}function H(){return E.getSession("aside.key")}function O(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function R(t,e){return e?new RegExp(e).test(t):!1}function S(t,e){return e?new RegExp("/"+e+"(\\.(js|ts))?$").test(t):!1}function v(t,e,n,i,s){const a=[],p=[],g=A(e.matchexts,e.extensions,e.matchs),c=O(e.dir);return t.forEach(u=>{const d=e.dir.replace(/^\./,"");let h=u.indexOf(d),o="."+u.substring(h);const f=new RegExp("^"+e.dir);let l=o.replace(f,"");if(s.comprops&&R("/"+l,s.comprops)||s.curprops&&S("/"+l,s.curprops)){let r={};r.url=o,r.comprops=s.comprops||"",r.curprops=s.curprops||"",r.value=l,r.dir=e.dir,r.suffix=C.getSuffix(u),r.tdir=c,r.key=u,r.raw="",r.getRaw=m(n,u),a.push(r)}else{let r=N(l,g,e.aliass,e.alias);r&&(r.url=o,r.comprops=s.comprops,r.curprops=s.curprops,r.dir=e.dir,r.tdir=c,r.key=u,r.component=i[u],r.getRaw=m(n,u),p.push(r))}}),{props:a,components:p}}function m(t,e){return typeof t=="function"?t:t?t[e]:null}exports.defaultExtensions=w;exports.getAsideKey=H;exports.getComponentsArr=v;exports.getMatchs=A;exports.getRawValue=m;exports.getUrlName=N;exports.isComprops=R;exports.isCurprops=S;exports.setAsideKey=D;
|
|
@@ -14,14 +14,17 @@ export interface TextObj {
|
|
|
14
14
|
getRaw: GetRaw | null;
|
|
15
15
|
}
|
|
16
16
|
export interface PropObj {
|
|
17
|
+
url: string;
|
|
17
18
|
comprops: string;
|
|
18
19
|
name: string;
|
|
19
20
|
value: string;
|
|
20
21
|
suffix: string;
|
|
21
22
|
head: string;
|
|
22
23
|
key: string;
|
|
24
|
+
dir: string;
|
|
23
25
|
}
|
|
24
26
|
export interface PropsObj extends TextObj {
|
|
27
|
+
url: string;
|
|
25
28
|
comprops: string;
|
|
26
29
|
curprops: string;
|
|
27
30
|
dir: string;
|
|
@@ -44,6 +47,7 @@ export interface TestsObj extends TextObj {
|
|
|
44
47
|
component: AsyncComponentLoader;
|
|
45
48
|
}
|
|
46
49
|
export interface ComponentsObj extends Component, TextObj {
|
|
50
|
+
url: string;
|
|
47
51
|
name: string;
|
|
48
52
|
tdir: string;
|
|
49
53
|
adir: string;
|
|
@@ -1,106 +1,109 @@
|
|
|
1
|
-
import { getSession as
|
|
2
|
-
import { humpToLine as
|
|
3
|
-
import { lineToLargeHump as
|
|
4
|
-
import { appearNum as h } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.
|
|
5
|
-
import { getSuffix as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
let n =
|
|
1
|
+
import { getSession as w, setSession as N } from "./storage.js";
|
|
2
|
+
import { humpToLine as A } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
|
|
3
|
+
import { lineToLargeHump as R } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js";
|
|
4
|
+
import { appearNum as h } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.js";
|
|
5
|
+
import { getSuffix as E } from "../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js";
|
|
6
|
+
const S = ["vue", "js"];
|
|
7
|
+
function z(t, e) {
|
|
8
|
+
let n = A(t.name), i = [];
|
|
9
9
|
return t.alias && i.push(t.alias + "-" + n), e && e.length > 0 && e.forEach((r) => {
|
|
10
10
|
t.alias && i.push(t.alias + "-" + r + "-" + n), i.push(r + "-" + n);
|
|
11
11
|
}), i;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function C(t) {
|
|
14
14
|
return t.sort((e, n) => {
|
|
15
15
|
let i = h(e, "/"), r = h(n, "/");
|
|
16
16
|
return i == r ? n.length - e.length : r - i;
|
|
17
17
|
}), t;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function T(t = [], e = [], n = []) {
|
|
20
20
|
let i = e;
|
|
21
|
-
(!i || i.length == 0) && (i =
|
|
21
|
+
(!i || i.length == 0) && (i = S);
|
|
22
22
|
let r = [];
|
|
23
|
-
return t && t.length > 0 && (r = t), n && n.length > 0 && n.forEach((
|
|
24
|
-
i
|
|
25
|
-
r.push(
|
|
23
|
+
return t && t.length > 0 && (r = t), n && n.length > 0 && n.forEach((p) => {
|
|
24
|
+
i?.forEach((a) => {
|
|
25
|
+
r.push(p + "." + a);
|
|
26
26
|
});
|
|
27
|
-
}), r = [...new Set(r)],
|
|
27
|
+
}), r = [...new Set(r)], C(r);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function $(t, e, n = {}, i = "") {
|
|
30
30
|
for (let r = 0; r < e.length; r++) {
|
|
31
|
-
const
|
|
32
|
-
let
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
let
|
|
36
|
-
Object.keys(n).forEach((
|
|
37
|
-
let
|
|
38
|
-
t.startsWith(
|
|
31
|
+
const p = e[r], a = new RegExp("^.*/([^/]+)" + p + "$");
|
|
32
|
+
let g = t.match(a);
|
|
33
|
+
if (g) {
|
|
34
|
+
const f = [], l = {};
|
|
35
|
+
let m = "";
|
|
36
|
+
Object.keys(n).forEach((c) => {
|
|
37
|
+
let o = n[c];
|
|
38
|
+
t.startsWith(o + "/") && (m = o, l[c] = o, f.push(c));
|
|
39
39
|
});
|
|
40
|
-
let
|
|
40
|
+
let d = g[1], u = {
|
|
41
|
+
url: "",
|
|
41
42
|
dir: "",
|
|
42
|
-
suffix:
|
|
43
|
-
name:
|
|
44
|
-
value:
|
|
43
|
+
suffix: E(t),
|
|
44
|
+
name: R(d),
|
|
45
|
+
value: d,
|
|
45
46
|
key: "",
|
|
46
47
|
tdir: "",
|
|
47
|
-
adir:
|
|
48
|
+
adir: m,
|
|
48
49
|
alias: i,
|
|
49
|
-
aliass:
|
|
50
|
+
aliass: l,
|
|
50
51
|
aliasNames: [],
|
|
51
52
|
raw: "",
|
|
52
53
|
getRaw: null,
|
|
53
54
|
mds: [],
|
|
54
55
|
tests: void 0
|
|
55
56
|
};
|
|
56
|
-
return
|
|
57
|
+
return u.aliasNames = z(u, f), u;
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
61
|
+
function V(t) {
|
|
62
|
+
N("aside.key", t);
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
64
|
+
function W() {
|
|
65
|
+
return w("aside.key");
|
|
65
66
|
}
|
|
66
67
|
function v(t) {
|
|
67
68
|
let e = t.match(/\/([^\/]+)\/$/);
|
|
68
69
|
return e && e.length > 1 ? e[1] : "";
|
|
69
70
|
}
|
|
70
71
|
function K(t, e) {
|
|
71
|
-
return e ? new RegExp(e
|
|
72
|
+
return e ? new RegExp(e).test(t) : !1;
|
|
72
73
|
}
|
|
73
74
|
function L(t, e) {
|
|
74
75
|
return e ? new RegExp("/" + e + "(\\.(js|ts))?$").test(t) : !1;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
const
|
|
78
|
-
return t.forEach((
|
|
77
|
+
function j(t, e, n, i, r) {
|
|
78
|
+
const p = [], a = [], g = T(e.matchexts, e.extensions, e.matchs), f = v(e.dir);
|
|
79
|
+
return t.forEach((l) => {
|
|
80
|
+
const m = e.dir.replace(/^\./, "");
|
|
81
|
+
let d = l.indexOf(m), u = "." + l.substring(d);
|
|
79
82
|
const c = new RegExp("^" + e.dir);
|
|
80
|
-
let
|
|
81
|
-
if (r.comprops && K(
|
|
83
|
+
let o = u.replace(c, "");
|
|
84
|
+
if (r.comprops && K("/" + o, r.comprops) || r.curprops && L("/" + o, r.curprops)) {
|
|
82
85
|
let s = {};
|
|
83
|
-
s.comprops = r.comprops || "", s.curprops = r.curprops || "", s.value =
|
|
86
|
+
s.url = u, s.comprops = r.comprops || "", s.curprops = r.curprops || "", s.value = o, s.dir = e.dir, s.suffix = E(l), s.tdir = f, s.key = l, s.raw = "", s.getRaw = x(n, l), p.push(s);
|
|
84
87
|
} else {
|
|
85
|
-
let s =
|
|
86
|
-
s && (s.comprops = r.comprops, s.curprops = r.curprops, s.dir = e.dir, s.tdir =
|
|
88
|
+
let s = $(o, g, e.aliass, e.alias);
|
|
89
|
+
s && (s.url = u, s.comprops = r.comprops, s.curprops = r.curprops, s.dir = e.dir, s.tdir = f, s.key = l, s.component = i[l], s.getRaw = x(n, l), a.push(s));
|
|
87
90
|
}
|
|
88
91
|
}), {
|
|
89
|
-
props:
|
|
90
|
-
components:
|
|
92
|
+
props: p,
|
|
93
|
+
components: a
|
|
91
94
|
};
|
|
92
95
|
}
|
|
93
|
-
function
|
|
96
|
+
function x(t, e) {
|
|
94
97
|
return typeof t == "function" ? t : t ? t[e] : null;
|
|
95
98
|
}
|
|
96
99
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
S as defaultExtensions,
|
|
101
|
+
W as getAsideKey,
|
|
102
|
+
j as getComponentsArr,
|
|
103
|
+
T as getMatchs,
|
|
104
|
+
x as getRawValue,
|
|
105
|
+
$ as getUrlName,
|
|
103
106
|
K as isComprops,
|
|
104
107
|
L as isCurprops,
|
|
105
|
-
|
|
108
|
+
V as setAsideKey
|
|
106
109
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`+
|
|
3
|
-
`)}async function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../config.cjs"),m=require("./common.cjs"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),b=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs"),j=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),H=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.cjs"),q=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.cjs"),w=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.cjs"),I=require("./index.cjs"),f={},p={},A=[],K={},V={},O={};function B(){return L.getConfig("example")}function v(e,t,s){const n=Object.assign({exampless:[],examplessRaw:[]},t,s),a=[],r=n.examples;r&&Object.keys(r).forEach(o=>{a.push(o),V[o]=r[o]});const l=n.examplesRaw,i=[];n.urls&&n.urls.length>0?(n.exampless=n.urls,n.urls.forEach(o=>{i.push(o),l&&(O[o]=S(l,o))})):(n.exampless=a,l&&Object.keys(l).forEach(o=>{i.push(o),l&&(O[o]=S(l,o))})),n.examples=void 0,n.examplessRaw=i,n.examplesRaw=void 0,K[e]=n}function S(e,t){return typeof e=="function"?e:e&&(e[t]||e)}const E={};function D(e){const t=L.getConfig("resolve");if(E[e])return E[e];for(let s of t)if(e.startsWith(s.find+"/")){const a=s.replacement.replaceAll("\\","/")+e.replace(s.find+"/","/");return E[e]=a,a}}async function F(e,t){let s="";if(t=="vue"){let a=new RegExp(/(<script([^>]*)>)((.|\n|\r)*)(<\/script>)/g).exec(e);if(a){s=a[3];const r=/((.|\n|\r)*)<\/script>/g.exec(s),l=/(<script([^>]*)>)((.|\n|\r)*)/g.exec(s);let i=s;r&&(i=r[1]),l&&(i=i+`
|
|
2
|
+
`+l[3]),s=i}}else(t=="js"||t=="ts"||t=="")&&(s=e);if(s){let a=(await I.getTextImport(s))?.map(l=>l.n);const r=[];return a&&a.length>0&&a.forEach(l=>{if(l)if(l.startsWith("./")||l.startsWith("../"))r.push(l);else{const i=D(l);i&&r.push(i)}}),r}}function J(e){return new Promise(t=>{e?e.raw?t(e.raw):e.getRaw?e.getRaw(e).then(s=>{const n=R(s);e.raw=n,e.getRaw=null,t(n)}):t(""):t("")})}function M(e,t){e=(e||"")+"";let s="";switch(e){case"1":s=t.tdir+"/";break;case"2":s=t.adir+"/";break;case"3":s=t.tdir+"/"+t.adir+"/";break}return s}function G(e,t,s){e=(e||"")+"",s=(s||"")+"";let n=x.humpToLine(t.name),a=[];const r=Object.values(t.aliass||{});if(e==="1")t.alias&&a.push(t.alias+"-"+n);else if(e==="2")r&&r.length>0&&r.forEach(i=>{a.push(i+"-"+n)});else if(e==="3"){let i="";t.alias&&(i=t.alias+"-"),r?.forEach(o=>{a.push(i+o+"-"+n)})}else e==="4"?t.aliasNames?.forEach(i=>{a.push(x.humpToLine(i))}):e=="9"&&(a.push(n),t.aliasNames?.forEach(i=>{a.push(x.humpToLine(i))}));a.length==0&&a.push(n);let l=[];return s==="1"?a.forEach(i=>{let o=b.lineToLargeHump(i);l.push(o,j.firstLower(o))}):s==="2"?a.forEach(i=>{let o=b.lineToLargeHump(i);l.push(i,o,j.firstLower(o))}):l=[...a],l=[...new Set(l)],l}function X(e,t,s,n){const a=[];return s.examplessRaw.forEach(r=>{for(let l=0;l<t.length;l++){const i=t[l];if(r==e+i+"/"+s.md+".md"){a.push({topurl:e,comkey:n.key,suffix:w.getSuffix(r),name:n.name,value:i,key:r,raw:"",getRaw:m.getRawValue(O,r)});break}}}),a}function N(e){h();const t=f[e];if(t.tests)return t.tests;{const s=K[t.dir],n=s.dir+M(s.level||0,t),a=G(s.aliaslevel||0,t,s.componentName||0);t.mds=X(n,a,s,t);const r={};return s.exampless.forEach(l=>{for(let i=0;i<a.length;i++){const o=a[i];if(l.startsWith(n+o+"/")){const c=new RegExp("^\\"+n+o+"/(.*)/index\\."+m.defaultExtensions.join("|")+"$");let g="",u=l.match(c);u&&u.length>1&&(g=u[1]),r[l]={topurl:n,name:o,value:g,suffix:w.getSuffix(l),comname:t.name,comkey:t.key,key:l,component:V[l],raw:"",getRaw:m.getRawValue(O,l)};break}}}),t.tests=r,r}}function Z(e){if(e){const t=N(e);return Object.values(t)}else return[]}function Q(e,t,s){h();const n=N(s),a=[];if(t){let r=n[t];if(r)return a.push(r),a}return Object.values(n).forEach(r=>{r.name+"/"+r.value==e&&a.push(r)}),a}function $(e){return N(e),f[e].mds}async function P(e,t,s,n,a){let r=await F(t,s)||[],l=e.split("/");return r.map(i=>{if(i.startsWith("./")){let o=l.slice(0,l.length-1).join("/"),c=i.substring(2);return{url:o+"/"+c,name:i,comprops:a||"",value:c,suffix:w.getSuffix(i),head:o,dir:n,key:i}}else if(i.startsWith("../")){let o=i.split("/"),c=0;for(let T=0;T<o.length;T++)if(o[T]!=".."){c=T;break}let g=o.slice(c,o.length),u=l.slice(0,l.length-c-1).join("/"),C=g.join("/");return{url:u+"/"+C,name:i,comprops:a||"",value:C,suffix:w.getSuffix(i),head:u,dir:n,key:i}}else{const o=n.replace(/^\./,"");let c=i.indexOf(o)+o.length,g=i.substring(c),u=n.substring(0,n.length-1);return{url:u+"/"+g,name:i,comprops:a||"",value:g,suffix:w.getSuffix(i),head:u,dir:n,key:i}}})}function z(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>({raw:"",name:n.name,value:n.value,suffix:w.getSuffix(n.key),key:n.key,getRaw:m.getRawValue(O,n.key)}));q.asyncMergeArray(s,(n,a,r,l)=>{r.raw?n():r.getRaw?r.getRaw(r).then(i=>{const o=R(i);r.raw=o,r.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}function Y(){const e=B();L.getConfig("components")?.forEach(s=>{k(s);let n=s.dir||"";v(n,e,s.example)})}const d="default";function _(e){let t=x.humpToLine(e.name),s=[...e.aliasNames];s.push(t),s.forEach(n=>{A.push({name:n,value:e.key})})}function y(e,t){const s={};t?.forEach(n=>{f[n.key]=n,_(n);const a=Object.values(n.aliass||{});a&&a.length?a.forEach(r=>{s[r]=s[r]||[],s[r].push(n.key)}):(s[d]=s[d]||[],s[d].push(n.key))})}function k(e){let t,s;const n=e.resolver;n&&Object.keys(n).forEach(r=>{typeof e[r]>"u"&&(e[r]=n[r])}),t=e.alias||d;let a=e?.urls||Object.keys(e.componentsRaw);s=m.getComponentsArr(a,e,e.componentsRaw,e.components,e),s&&s?.props&&s.props.forEach(r=>{p[r.url]=r}),y(t,s.components)}function ee(e){return h(),f[e]}function h(){return Object.keys(f).length==0&&Y(),Object.values(f)}function te(){return h(),p}function se(e,t,s){h();const n=[];if(s){let r=f[s];if(r&&r.key)return[r]}let a=x.humpToLine(e);return A.forEach(r=>{t?r.name.includes(a)&&n.push(f[r.value]):r.name==a&&n.push(f[r.value])}),H.duplicateRemoval(n,"key")}async function ne(e,t){let s=e;if(e){let n=(await P(t.key,e,t.suffix,t.dir,t.comprops)).filter(a=>a.key.startsWith(t.head)||m.isComprops(a.name,t.comprops||""));s=await W(n)+s}return s}function re(e){const t=e.url,s=e.key;return p[t]||p[t+".js"]||p[t+".ts"]||p[s]||p[s+".js"]||p[s+".ts"]}function U(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>re(n)).filter(n=>!!n);q.asyncMergeArray(s,(n,a,r,l)=>{r.raw?n():r.getRaw?r.getRaw(r).then(async i=>{const o=R(i);let c=await ne(o,e[l]);r.raw=c,r.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}async function W(e){return((await U(e))?.map(n=>n.raw)||[]).join(`
|
|
3
|
+
`)}async function ae(e,t){let s=e;if(e&&(t.comprops||t.curprops)){let n=(await P(t.key,e,t.suffix,t.dir,t.comprops||"")).filter(r=>m.isComprops(r.name,t.comprops||"")||m.isCurprops(r.name,t.curprops||""));s=await W(n)+s}return s}function R(e){return e&&typeof e=="object"?e.default||"":(e||"")+""}function ie(e){return new Promise(t=>{if(e){h();const s=f[e];s?s.raw?t(s.raw):s.getRaw?s.getRaw(s).then(n=>{const a=R(n);ae(a,s).then(r=>{s.raw=r,s.getRaw=null,t(r)})}):t(""):t("")}else t("")})}exports.defaultName=d;exports.getCompoName=se;exports.getCompoNameKey=ee;exports.getCompoNameObj=h;exports.getComponentPropsObjs=te;exports.getGetRawValue=R;exports.getKeyMds=$;exports.getLevelUrl=M;exports.getLocalTextArr=z;exports.getLocalTextComponents=ie;exports.getLocalTextTests=J;exports.getPropsRaws=U;exports.getTestImportUrl=P;exports.getTestName=Z;exports.getTestNameObj=Q;
|
|
@@ -21,7 +21,7 @@ export declare function getKeyMds(key: string): MdObj[] | undefined;
|
|
|
21
21
|
* @param {*} arr
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
|
-
export declare function getTestImportUrl(url: string, text: string, type: string, comprops?: string): Promise<Array<PropObj>>;
|
|
24
|
+
export declare function getTestImportUrl(url: string, text: string, type: string, dir: string, comprops?: string): Promise<Array<PropObj>>;
|
|
25
25
|
export declare function getLocalTextArr(arr: Array<PropObj>): Promise<TextObj[]>;
|
|
26
26
|
export declare const defaultName = "default";
|
|
27
27
|
export declare function getCompoNameKey(key: string): ComponentsObj;
|