@fangzhongya/vue-archive 0.0.47 → 0.0.49
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.css +1 -1
- package/dist/node/index.cjs +37 -36
- package/dist/node/index.d.cts +4 -0
- package/dist/node/index.d.ts +4 -0
- package/dist/node/index.js +37 -36
- package/dist/packages/components/aside/index.vue.cjs +1 -1
- package/dist/packages/components/aside/index.vue.js +1 -1
- package/dist/packages/components/boxurl/index.vue.cjs +1 -1
- package/dist/packages/components/boxurl/index.vue.js +37 -27
- package/dist/packages/components/code/index.vue.cjs +1 -1
- package/dist/packages/components/code/index.vue.js +67 -57
- package/dist/packages/components/use/set-code.vue.cjs +1 -1
- package/dist/packages/components/use/set-code.vue.js +31 -36
- package/dist/packages/config.d.ts +3 -0
- package/dist/packages/utils/common.cjs +1 -1
- package/dist/packages/utils/common.d.ts +2 -0
- package/dist/packages/utils/common.js +13 -12
- package/dist/packages/utils/glob.cjs +2 -2
- package/dist/packages/utils/glob.d.ts +1 -1
- package/dist/packages/utils/glob.js +226 -235
- package/dist/packages/utils/util.cjs +1 -0
- package/dist/packages/utils/util.d.ts +4 -0
- package/dist/packages/utils/util.js +46 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),u=require("../../utils/util.cjs"),m=require("../../config.cjs"),x=require("@fangzhongya/utils/urls/getReplaceUrls"),p={class:"box-url-span"},b={class:"box-url-box-div"},y={class:"box-div-li"},E={class:"box-div-li-span"},N={class:"box-div-li-span"},g={key:0,class:"box-div-li"},f={class:"box-div-li-span"},k={class:"box-div-li"},V={class:"box-div-li-span"},B=e.defineComponent({__name:"index",props:{value:Object},setup(l){const a=l,i=e.ref(),c=e.ref(""),r=e.ref(""),d=m.getConfig("directory"),v=()=>{const s=a.value?.key,t=x.getReplaceUrls(s,a.value?.cwd||d);u.openInEditor(t)};return e.onMounted(()=>{i.value.onmouseenter=t=>{var t=t||window.event;let o,n;t.x||t.y?(o=t.x,n=t.y):(t.pageX||t.pageY)&&(o=t.pageX-1,n=t.pageY-1),c.value=o+"px",r.value=n+"px"}}),(s,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"boxurl",ref:i,class:"box-url"},[e.createElementVNode("span",p,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",{class:"box-url-box",style:e.normalizeStyle({top:r.value,left:c.value})},[e.createElementVNode("div",b,[e.createElementVNode("div",y,[e.createElementVNode("div",E,e.toDisplayString(l.value?.name),1),e.createElementVNode("div",N,e.toDisplayString(l.value?.value),1)]),l.value?.aliasNames&&l.value?.aliasNames.length?(e.openBlock(),e.createElementBlock("div",g,[t[0]||(t[0]=e.createElementVNode("div",{class:"box-div-li-span"},"别名",-1)),e.createElementVNode("div",f,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value?.aliasNames,o=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(o),1))),256))])])):e.createCommentVNode("",!0),e.createElementVNode("div",k,[t[1]||(t[1]=e.createElementVNode("div",{class:"box-div-li-span"},"文件路径",-1)),e.createElementVNode("div",V,e.toDisplayString(l.value?.key),1)]),e.createElementVNode("div",{class:"box-div-but",onClick:v},"打开vscode")])],4)],512))}});module.exports=B;
|
|
@@ -1,52 +1,62 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as p, ref as v, onMounted as f, createElementBlock as l, openBlock as i, createElementVNode as s, renderSlot as y, normalizeStyle as g, createCommentVNode as k, toDisplayString as a, Fragment as _, renderList as h } from "vue";
|
|
2
|
+
import { openInEditor as N } from "../../utils/util.js";
|
|
3
|
+
import { getConfig as C } from "../../config.js";
|
|
4
|
+
import { getReplaceUrls as w } from "@fangzhongya/utils/urls/getReplaceUrls";
|
|
5
|
+
const E = { class: "box-url-span" }, S = { class: "box-url-box-div" }, B = { class: "box-div-li" }, V = { class: "box-div-li-span" }, X = { class: "box-div-li-span" }, Y = {
|
|
3
6
|
key: 0,
|
|
4
7
|
class: "box-div-li"
|
|
5
|
-
},
|
|
8
|
+
}, j = { class: "box-div-li-span" }, z = { class: "box-div-li" }, D = { class: "box-div-li-span" }, O = /* @__PURE__ */ p({
|
|
6
9
|
__name: "index",
|
|
7
10
|
props: {
|
|
8
11
|
value: Object
|
|
9
12
|
},
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
setup(o) {
|
|
14
|
+
const r = o, c = v(), u = v(""), x = v(""), m = C("directory"), b = () => {
|
|
15
|
+
const n = r.value?.key, e = w(n, r.value?.cwd || m);
|
|
16
|
+
N(e);
|
|
17
|
+
};
|
|
18
|
+
return f(() => {
|
|
19
|
+
c.value.onmouseenter = (e) => {
|
|
14
20
|
var e = e || window.event;
|
|
15
|
-
let t,
|
|
16
|
-
e.x || e.y ? (t = e.x,
|
|
21
|
+
let t, d;
|
|
22
|
+
e.x || e.y ? (t = e.x, d = e.y) : (e.pageX || e.pageY) && (t = e.pageX - 1, d = e.pageY - 1), u.value = t + "px", x.value = d + "px";
|
|
17
23
|
};
|
|
18
|
-
}), (
|
|
24
|
+
}), (n, e) => (i(), l("div", {
|
|
19
25
|
ref_key: "boxurl",
|
|
20
|
-
ref:
|
|
26
|
+
ref: c,
|
|
21
27
|
class: "box-url"
|
|
22
28
|
}, [
|
|
23
|
-
s("span",
|
|
24
|
-
|
|
29
|
+
s("span", E, [
|
|
30
|
+
y(n.$slots, "default")
|
|
25
31
|
]),
|
|
26
32
|
s("div", {
|
|
27
33
|
class: "box-url-box",
|
|
28
|
-
style:
|
|
34
|
+
style: g({ top: x.value, left: u.value })
|
|
29
35
|
}, [
|
|
30
|
-
s("div",
|
|
31
|
-
s("div",
|
|
32
|
-
s("div",
|
|
33
|
-
s("div",
|
|
36
|
+
s("div", S, [
|
|
37
|
+
s("div", B, [
|
|
38
|
+
s("div", V, a(o.value?.name), 1),
|
|
39
|
+
s("div", X, a(o.value?.value), 1)
|
|
34
40
|
]),
|
|
35
|
-
|
|
41
|
+
o.value?.aliasNames && o.value?.aliasNames.length ? (i(), l("div", Y, [
|
|
36
42
|
e[0] || (e[0] = s("div", { class: "box-div-li-span" }, "别名", -1)),
|
|
37
|
-
s("div",
|
|
38
|
-
(
|
|
43
|
+
s("div", j, [
|
|
44
|
+
(i(!0), l(_, null, h(o.value?.aliasNames, (t) => (i(), l("span", null, a(t), 1))), 256))
|
|
39
45
|
])
|
|
40
|
-
])) :
|
|
41
|
-
s("div",
|
|
42
|
-
e[1] || (e[1] = s("div", { class: "box-div-li-span" }, "
|
|
43
|
-
s("div",
|
|
44
|
-
])
|
|
46
|
+
])) : k("", !0),
|
|
47
|
+
s("div", z, [
|
|
48
|
+
e[1] || (e[1] = s("div", { class: "box-div-li-span" }, "文件路径", -1)),
|
|
49
|
+
s("div", D, a(o.value?.key), 1)
|
|
50
|
+
]),
|
|
51
|
+
s("div", {
|
|
52
|
+
class: "box-div-but",
|
|
53
|
+
onClick: b
|
|
54
|
+
}, "打开vscode")
|
|
45
55
|
])
|
|
46
56
|
], 4)
|
|
47
57
|
], 512));
|
|
48
58
|
}
|
|
49
59
|
});
|
|
50
60
|
export {
|
|
51
|
-
|
|
61
|
+
O as default
|
|
52
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),u=require("../boxurl/index.vue.cjs"),
|
|
1
|
+
"use strict";const e=require("vue"),u=require("../boxurl/index.vue.cjs"),x=require("../../router/index.cjs"),w=require("./highlight.vue.cjs"),v=require("../../utils/index.cjs"),d=require("../../utils/glob.cjs"),f=require("../../utils/util.cjs"),_=require("@fangzhongya/utils/urls/getUrlCatalogueObj"),b=require("vue-router"),y={class:"code"},E={class:"code-top"},N={class:"code-top-but"},V={class:"top-but-files"},q=["onClick"],S={class:"code-highlightjs"},B=e.defineComponent({__name:"index",props:{text:String,value:Object},setup(p){const g=b.useRouter(),t=p;e.watch(()=>t.text,()=>{s()});const c=e.ref([]),o=e.ref(),a=e.ref(!1);function k(){o.value?.raw?v.copyCode(o.value.raw):v.copyCode(t.text)}function h(){if(o.value?.raw){const l=_.getUrlCatalogueObj(o.value?.key),n=t.value?.name+"_"+l.name+"."+l.suffix;f.exportStringToFile(o.value.raw,n)}else{const l=_.getUrlCatalogueObj(t.value?.key),n=t.value?.name+"_"+l.name+"."+l.suffix;f.exportStringToFile(t.text,n)}}function m(){a.value=!a.value}function C(){x.toSingle(g,t.value)}function r(l){a.value=!0,o.value=l}function s(){o.value=void 0,a.value=!1,t.text&&d.getTestImportUrl(t.value,t.text,"vue").then(l=>{d.getLocalTextArr(l).then(n=>{c.value=n.filter(i=>i.raw)})})}return s(),(l,n)=>(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",E,[e.createElementVNode("div",N,[e.createElementVNode("div",{class:"but-div",onClick:C},"go"),e.createElementVNode("div",{class:"but-div",onClick:k},"复制"),e.createElementVNode("div",{class:"but-div",onClick:h},"下载"),e.createElementVNode("div",{class:"but-div",onClick:m},e.toDisplayString(a.value?"隐藏":"显示"),1),e.createElementVNode("div",V,[e.createVNode(u,{value:t.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["but-div",{on:!(o.value&&o.value.value)}]),onClick:n[0]||(n[0]=e.withModifiers(i=>r(),["stop"]))}," index.vue ",2)]),_:1},8,["value"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(i,j)=>(e.openBlock(),e.createBlock(u,{value:i},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["but-div",{on:i.key==o.value?.key}]),onClick:e.withModifiers(D=>r(i),["stop"])},e.toDisplayString(i.value),11,q)]),_:2},1032,["value"]))),256))])])]),e.withDirectives(e.createElementVNode("div",S,[e.createVNode(w,{language:"html",code:o.value?.raw||t.text},null,8,["code"])],512),[[e.vShow,a.value]])]))}});module.exports=B;
|
|
@@ -1,105 +1,115 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { toSingle as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as j, watch as B, ref as s, createElementBlock as d, openBlock as u, createElementVNode as l, withDirectives as $, toDisplayString as f, createVNode as m, withCtx as p, withModifiers as _, normalizeClass as k, Fragment as E, renderList as F, createBlock as L, vShow as N } from "vue";
|
|
2
|
+
import h from "../boxurl/index.vue.js";
|
|
3
|
+
import { toSingle as O } from "../../router/index.js";
|
|
4
|
+
import U from "./highlight.vue.js";
|
|
5
5
|
import { copyCode as g } from "../../utils/index.js";
|
|
6
6
|
import { getTestImportUrl as V, getLocalTextArr as z } from "../../utils/glob.js";
|
|
7
|
+
import { exportStringToFile as C } from "../../utils/util.js";
|
|
8
|
+
import { getUrlCatalogueObj as x } from "@fangzhongya/utils/urls/getUrlCatalogueObj";
|
|
7
9
|
import { useRouter as A } from "vue-router";
|
|
8
|
-
const
|
|
10
|
+
const H = { class: "code" }, I = { class: "code-top" }, M = { class: "code-top-but" }, R = { class: "top-but-files" }, q = ["onClick"], G = { class: "code-highlightjs" }, le = /* @__PURE__ */ j({
|
|
9
11
|
__name: "index",
|
|
10
12
|
props: {
|
|
11
13
|
text: String,
|
|
12
14
|
value: Object
|
|
13
15
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
+
setup(w) {
|
|
17
|
+
const b = A(), e = w;
|
|
16
18
|
B(
|
|
17
19
|
() => e.text,
|
|
18
20
|
() => {
|
|
19
21
|
v();
|
|
20
22
|
}
|
|
21
23
|
);
|
|
22
|
-
const c =
|
|
23
|
-
function
|
|
24
|
-
|
|
24
|
+
const c = s([]), t = s(), n = s(!1);
|
|
25
|
+
function y() {
|
|
26
|
+
t.value?.raw ? g(t.value.raw) : g(e.text);
|
|
27
|
+
}
|
|
28
|
+
function S() {
|
|
29
|
+
if (t.value?.raw) {
|
|
30
|
+
const o = x(t.value?.key), i = e.value?.name + "_" + o.name + "." + o.suffix;
|
|
31
|
+
C(t.value.raw, i);
|
|
32
|
+
} else {
|
|
33
|
+
const o = x(e.value?.key), i = e.value?.name + "_" + o.name + "." + o.suffix;
|
|
34
|
+
C(e.text, i);
|
|
35
|
+
}
|
|
25
36
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
37
|
+
function D() {
|
|
38
|
+
n.value = !n.value;
|
|
28
39
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
40
|
+
function T() {
|
|
41
|
+
O(b, e.value);
|
|
31
42
|
}
|
|
32
|
-
function r(
|
|
33
|
-
|
|
43
|
+
function r(o) {
|
|
44
|
+
n.value = !0, t.value = o;
|
|
34
45
|
}
|
|
35
46
|
function v() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
).then((a) => {
|
|
44
|
-
z(a).then((s) => {
|
|
45
|
-
c.value = s.filter((l) => l.raw);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
47
|
+
t.value = void 0, n.value = !1, e.text && V(e.value, e.text, "vue").then(
|
|
48
|
+
(o) => {
|
|
49
|
+
z(o).then((i) => {
|
|
50
|
+
c.value = i.filter((a) => a.raw);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
);
|
|
48
54
|
}
|
|
49
|
-
return v(), (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
return v(), (o, i) => (u(), d("div", H, [
|
|
56
|
+
l("div", I, [
|
|
57
|
+
l("div", M, [
|
|
58
|
+
l("div", {
|
|
53
59
|
class: "but-div",
|
|
54
|
-
onClick:
|
|
60
|
+
onClick: T
|
|
55
61
|
}, "go"),
|
|
56
|
-
|
|
62
|
+
l("div", {
|
|
57
63
|
class: "but-div",
|
|
58
|
-
onClick:
|
|
64
|
+
onClick: y
|
|
59
65
|
}, "复制"),
|
|
60
|
-
|
|
66
|
+
l("div", {
|
|
67
|
+
class: "but-div",
|
|
68
|
+
onClick: S
|
|
69
|
+
}, "下载"),
|
|
70
|
+
l("div", {
|
|
61
71
|
class: "but-div",
|
|
62
|
-
onClick:
|
|
63
|
-
}, f(
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
onClick: D
|
|
73
|
+
}, f(n.value ? "隐藏" : "显示"), 1),
|
|
74
|
+
l("div", R, [
|
|
75
|
+
m(h, {
|
|
66
76
|
value: e.value
|
|
67
77
|
}, {
|
|
68
|
-
default:
|
|
69
|
-
|
|
70
|
-
class:
|
|
71
|
-
on: !(
|
|
78
|
+
default: p(() => [
|
|
79
|
+
l("div", {
|
|
80
|
+
class: k(["but-div", {
|
|
81
|
+
on: !(t.value && t.value.value)
|
|
72
82
|
}]),
|
|
73
|
-
onClick:
|
|
83
|
+
onClick: i[0] || (i[0] = _((a) => r(), ["stop"]))
|
|
74
84
|
}, " index.vue ", 2)
|
|
75
85
|
]),
|
|
76
86
|
_: 1
|
|
77
87
|
}, 8, ["value"]),
|
|
78
|
-
(u(!0), d(
|
|
79
|
-
default:
|
|
80
|
-
|
|
81
|
-
class:
|
|
82
|
-
on:
|
|
88
|
+
(u(!0), d(E, null, F(c.value, (a, J) => (u(), L(h, { value: a }, {
|
|
89
|
+
default: p(() => [
|
|
90
|
+
l("div", {
|
|
91
|
+
class: k(["but-div", {
|
|
92
|
+
on: a.key == t.value?.key
|
|
83
93
|
}]),
|
|
84
|
-
onClick:
|
|
85
|
-
}, f(
|
|
94
|
+
onClick: _((K) => r(a), ["stop"])
|
|
95
|
+
}, f(a.value), 11, q)
|
|
86
96
|
]),
|
|
87
97
|
_: 2
|
|
88
98
|
}, 1032, ["value"]))), 256))
|
|
89
99
|
])
|
|
90
100
|
])
|
|
91
101
|
]),
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
$(l("div", G, [
|
|
103
|
+
m(U, {
|
|
94
104
|
language: "html",
|
|
95
|
-
code:
|
|
105
|
+
code: t.value?.raw || e.text
|
|
96
106
|
}, null, 8, ["code"])
|
|
97
107
|
], 512), [
|
|
98
|
-
[
|
|
108
|
+
[N, n.value]
|
|
99
109
|
])
|
|
100
110
|
]));
|
|
101
111
|
}
|
|
102
112
|
});
|
|
103
113
|
export {
|
|
104
|
-
|
|
114
|
+
le as default
|
|
105
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),d=require("../code/highlight.vue.cjs"),p=require("../../utils/index.cjs"),l=require("./code.cjs"),v=require("../../utils/util.cjs"),m={class:"set-code"},h={class:"but-div set-code-but"},x={class:"set-code-html"},b=e.defineComponent({__name:"set-code",props:{name:{type:String},param:{type:Object},value:{type:Object},slotValue:{type:Object},propsText:{type:Object},exposeText:{type:Object}},setup(i){const t=i,o=e.ref("");e.watch([()=>t.name,()=>t.param,()=>t.value,()=>t.slotValue,()=>t.propsText,()=>t.exposeText],()=>{o.value=l.getHmtl(t.name||"",t.param||{},t.value||{},t.slotValue,t.propsText,t.exposeText)},{deep:!0});const s=e.ref(!1);function n(){o.value=l.getHmtl(t.name||"",t.param||{},t.value||{},t.slotValue,t.propsText,t.exposeText)}function a(){s.value=!s.value}function r(){p.copyCode(o.value)}function u(){v.exportStringToFile(o.value,t.name+".vue")}return(f,c)=>(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",{onClick:a,class:"set-code-buts"},[c[0]||(c[0]=e.createElementVNode("div",null,"代码",-1)),e.createElementVNode("div",h,e.toDisplayString(s.value?"显示":"隐藏"),1),e.createElementVNode("div",{onClick:e.withModifiers(r,["stop"]),class:"but-div set-code-but"}," 复制 "),e.createElementVNode("div",{onClick:e.withModifiers(u,["stop"]),class:"but-div set-code-but"}," 下载 "),e.createElementVNode("div",{onClick:e.withModifiers(n,["stop"]),class:"but-div set-code-but"}," 刷新 ")]),e.withDirectives(e.createElementVNode("div",x,[e.createVNode(d,{language:"html",code:o.value},null,8,["code"])],512),[[e.vShow,s.value]])]))}});module.exports=b;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { copyCode as
|
|
4
|
-
import { getHmtl as
|
|
5
|
-
|
|
1
|
+
import { defineComponent as v, ref as c, watch as m, createElementBlock as f, openBlock as x, createElementVNode as t, withDirectives as b, toDisplayString as h, withModifiers as l, createVNode as C, vShow as _ } from "vue";
|
|
2
|
+
import k from "../code/highlight.vue.js";
|
|
3
|
+
import { copyCode as y } from "../../utils/index.js";
|
|
4
|
+
import { getHmtl as i } from "./code.js";
|
|
5
|
+
import { exportStringToFile as T } from "../../utils/util.js";
|
|
6
|
+
const g = { class: "set-code" }, V = { class: "but-div set-code-but" }, j = { class: "set-code-html" }, H = /* @__PURE__ */ v({
|
|
6
7
|
__name: "set-code",
|
|
7
8
|
props: {
|
|
8
9
|
name: {
|
|
@@ -24,9 +25,9 @@ const R = { class: "set-code" }, S = { class: "but-div set-code-but" }, L = { cl
|
|
|
24
25
|
type: Object
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const e =
|
|
29
|
-
|
|
28
|
+
setup(n) {
|
|
29
|
+
const e = n, o = c("");
|
|
30
|
+
m(
|
|
30
31
|
[
|
|
31
32
|
() => e.name,
|
|
32
33
|
() => e.param,
|
|
@@ -36,7 +37,7 @@ const R = { class: "set-code" }, S = { class: "but-div set-code-but" }, L = { cl
|
|
|
36
37
|
() => e.exposeText
|
|
37
38
|
],
|
|
38
39
|
() => {
|
|
39
|
-
|
|
40
|
+
o.value = i(
|
|
40
41
|
e.name || "",
|
|
41
42
|
e.param || {},
|
|
42
43
|
e.value || {},
|
|
@@ -47,9 +48,9 @@ const R = { class: "set-code" }, S = { class: "but-div set-code-but" }, L = { cl
|
|
|
47
48
|
},
|
|
48
49
|
{ deep: !0 }
|
|
49
50
|
);
|
|
50
|
-
const
|
|
51
|
-
function
|
|
52
|
-
|
|
51
|
+
const s = c(!1);
|
|
52
|
+
function p() {
|
|
53
|
+
o.value = i(
|
|
53
54
|
e.name || "",
|
|
54
55
|
e.param || {},
|
|
55
56
|
e.value || {},
|
|
@@ -58,48 +59,42 @@ const R = { class: "set-code" }, S = { class: "but-div set-code-but" }, L = { cl
|
|
|
58
59
|
e.exposeText
|
|
59
60
|
);
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
function v() {
|
|
65
|
-
V(s.value);
|
|
62
|
+
function u() {
|
|
63
|
+
s.value = !s.value;
|
|
66
64
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
o.href = i, o.download = c, o.style.display = "none", document.body.appendChild(o), o.click(), setTimeout(() => {
|
|
70
|
-
document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
71
|
-
}, 100);
|
|
65
|
+
function r() {
|
|
66
|
+
y(o.value);
|
|
72
67
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
68
|
+
function d() {
|
|
69
|
+
T(o.value, e.name + ".vue");
|
|
75
70
|
}
|
|
76
|
-
return (
|
|
71
|
+
return (w, a) => (x(), f("div", g, [
|
|
77
72
|
t("div", {
|
|
78
|
-
onClick:
|
|
73
|
+
onClick: u,
|
|
79
74
|
class: "set-code-buts"
|
|
80
75
|
}, [
|
|
81
|
-
|
|
82
|
-
t("div",
|
|
76
|
+
a[0] || (a[0] = t("div", null, "代码", -1)),
|
|
77
|
+
t("div", V, h(s.value ? "显示" : "隐藏"), 1),
|
|
83
78
|
t("div", {
|
|
84
|
-
onClick:
|
|
79
|
+
onClick: l(r, ["stop"]),
|
|
85
80
|
class: "but-div set-code-but"
|
|
86
81
|
}, " 复制 "),
|
|
87
82
|
t("div", {
|
|
88
|
-
onClick:
|
|
83
|
+
onClick: l(d, ["stop"]),
|
|
89
84
|
class: "but-div set-code-but"
|
|
90
|
-
}, "
|
|
85
|
+
}, " 下载 "),
|
|
91
86
|
t("div", {
|
|
92
|
-
onClick:
|
|
87
|
+
onClick: l(p, ["stop"]),
|
|
93
88
|
class: "but-div set-code-but"
|
|
94
89
|
}, " 刷新 ")
|
|
95
90
|
]),
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
b(t("div", j, [
|
|
92
|
+
C(k, {
|
|
98
93
|
language: "html",
|
|
99
|
-
code:
|
|
94
|
+
code: o.value
|
|
100
95
|
}, null, 8, ["code"])
|
|
101
96
|
], 512), [
|
|
102
|
-
[
|
|
97
|
+
[_, s.value]
|
|
103
98
|
])
|
|
104
99
|
]));
|
|
105
100
|
}
|
|
@@ -12,6 +12,7 @@ export interface GlobComs {
|
|
|
12
12
|
}
|
|
13
13
|
export interface Component {
|
|
14
14
|
dir: string;
|
|
15
|
+
cwd?: string;
|
|
15
16
|
extensions?: Array<string>;
|
|
16
17
|
alias?: string;
|
|
17
18
|
aliass?: ObjStr;
|
|
@@ -34,6 +35,7 @@ export interface ExampleObj {
|
|
|
34
35
|
tests?: boolean;
|
|
35
36
|
testsNanme?: string;
|
|
36
37
|
dir?: string;
|
|
38
|
+
cwd?: string;
|
|
37
39
|
/**
|
|
38
40
|
* 0 : url 下面就是组件
|
|
39
41
|
* 1 : dir 名称开始
|
|
@@ -73,6 +75,7 @@ export interface Config {
|
|
|
73
75
|
redirect?: boolean;
|
|
74
76
|
useparam?: boolean;
|
|
75
77
|
resolve?: Resolve[];
|
|
78
|
+
directory?: string;
|
|
76
79
|
components: Array<Components>;
|
|
77
80
|
example?: ExampleObj;
|
|
78
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./storage.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const T=require("@fangzhongya/utils/name/humpToLine"),R=require("@fangzhongya/utils/name/lineToLargeHump"),x=require("@fangzhongya/utils/basic/string/appearNum");require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");require("@fangzhongya/utils/basic/string/firstUpper");const q=require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const E=["vue","js","ts"];function K(r,e){let n=T.humpToLine(r.name),i=[];return r.alias&&i.push(r.alias+"-"+n),e&&e.length>0&&e.forEach(t=>{r.alias&&i.push(r.alias+"-"+t+"-"+n),i.push(t+"-"+n)}),i}function L(r){return r.sort((e,n)=>{let i=x.appearNum(e,"/"),t=x.appearNum(n,"/");return i==t?n.length-e.length:t-i}),r}function N(r=[],e=[],n=[]){let i=e;(!i||i.length==0)&&(i=E);let t=[];return r&&r.length>0&&(t=r),n&&n.length>0&&n.forEach(a=>{i?.forEach(p=>{t.push(a+"."+p)})}),t=[...new Set(t)],L(t)}function S(r,e,n={},i=""){for(let t=0;t<e.length;t++){const a=e[t],p=new RegExp("^.*/([^/]+)"+a+"$");let d=r.match(p);if(d){const c=[],u={};let f="";Object.keys(n).forEach(g=>{let l=n[g];r.startsWith(l+"/")&&(f=l,u[g]=l,c.push(g))});let h=d[1],o={url:"",dir:"",cwd:"",suffix:q.getSuffix(r),name:R.lineToLargeHump(h),value:h,key:"",tdir:"",adir:f,alias:i,aliass:u,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0};return o.aliasNames=K(o,c),o}}}function M(r){w.setSession("aside.key",r)}function O(){return w.getSession("aside.key")}function y(r){let e=r.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function A(r,e){return e?new RegExp(e).test(r):!1}function C(r,e){return e?new RegExp(e+"(\\.(js|ts))?$").test(r):!1}function z(r,e,n,i,t){const a=[],p=[],d=N(e.matchexts,e.extensions,e.matchs),c=y(e.dir);return r.forEach(u=>{const f=e.dir.replace(/^\.\/|((\.\.\/)+)/,"/");let h=u.indexOf(f),o=e.dir.substring(0,e.dir.indexOf(f))+u.substring(h);const g=new RegExp("^"+e.dir);let l=o.replace(g,"");if(t.comprops&&A("/"+l,t.comprops)||t.curprops&&C("/"+l,t.curprops)){let s={};s.url=o,s.comprops=t.comprops||"",s.curprops=t.curprops||"",s.value=l,s.dir=e.dir,s.cwd=e.cwd,s.suffix=q.getSuffix(u),s.tdir=c,s.key=u,s.raw="",s.getRaw=m(n,u),a.push(s)}else{let s=S(l,d,e.aliass,e.alias);s&&(s.url=o,s.comprops=t.comprops,s.curprops=t.curprops,s.dir=e.dir,s.cwd=e.cwd,s.tdir=c,s.key=u,s.component=i[u],s.getRaw=m(n,u),p.push(s))}}),{props:a,components:p}}function m(r,e){return typeof r=="function"?r:r?r[e]:null}exports.defaultExtensions=E;exports.getAsideKey=O;exports.getComponentsArr=z;exports.getMatchs=N;exports.getRawValue=m;exports.getUrlName=S;exports.isComprops=A;exports.isCurprops=C;exports.setAsideKey=M;
|
|
@@ -10,6 +10,7 @@ export interface TextObj {
|
|
|
10
10
|
value: string;
|
|
11
11
|
suffix: string;
|
|
12
12
|
key: string;
|
|
13
|
+
cwd?: string;
|
|
13
14
|
raw: string;
|
|
14
15
|
getRaw: GetRaw | null;
|
|
15
16
|
}
|
|
@@ -22,6 +23,7 @@ export interface PropObj {
|
|
|
22
23
|
suffix: string;
|
|
23
24
|
head: string;
|
|
24
25
|
key: string;
|
|
26
|
+
cwd?: string;
|
|
25
27
|
dir: string;
|
|
26
28
|
}
|
|
27
29
|
export interface PropsObj extends TextObj {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getSession as
|
|
1
|
+
import { getSession as E, setSession as N } from "./storage.js";
|
|
2
2
|
import "@fangzhongya/utils/basic/object/mergeObject";
|
|
3
3
|
import "@fangzhongya/utils/basic/array/toggleArray";
|
|
4
4
|
import { humpToLine as A } from "@fangzhongya/utils/name/humpToLine";
|
|
@@ -8,7 +8,7 @@ import "@fangzhongya/utils/basic/string/firstLower";
|
|
|
8
8
|
import "@fangzhongya/utils/basic/array/duplicateRemoval";
|
|
9
9
|
import "@fangzhongya/utils/basic/array/asyncMergeArray";
|
|
10
10
|
import "@fangzhongya/utils/basic/string/firstUpper";
|
|
11
|
-
import { getSuffix as
|
|
11
|
+
import { getSuffix as w } from "@fangzhongya/utils/urls/getSuffix";
|
|
12
12
|
import "@fangzhongya/utils/basic/array/replaceAfter";
|
|
13
13
|
const S = ["vue", "js", "ts"];
|
|
14
14
|
function z(t, e) {
|
|
@@ -47,7 +47,8 @@ function T(t, e, n = {}, i = "") {
|
|
|
47
47
|
let g = d[1], p = {
|
|
48
48
|
url: "",
|
|
49
49
|
dir: "",
|
|
50
|
-
|
|
50
|
+
cwd: "",
|
|
51
|
+
suffix: w(t),
|
|
51
52
|
name: R(g),
|
|
52
53
|
value: g,
|
|
53
54
|
key: "",
|
|
@@ -65,11 +66,11 @@ function T(t, e, n = {}, i = "") {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
+
function I(t) {
|
|
69
70
|
N("aside.key", t);
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
72
|
+
function J() {
|
|
73
|
+
return E("aside.key");
|
|
73
74
|
}
|
|
74
75
|
function $(t) {
|
|
75
76
|
let e = t.match(/\/([^\/]+)\/$/);
|
|
@@ -81,7 +82,7 @@ function K(t, e) {
|
|
|
81
82
|
function L(t, e) {
|
|
82
83
|
return e ? new RegExp(e + "(\\.(js|ts))?$").test(t) : !1;
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function P(t, e, n, i, r) {
|
|
85
86
|
const u = [], a = [], d = O(e.matchexts, e.extensions, e.matchs), f = $(e.dir);
|
|
86
87
|
return t.forEach((o) => {
|
|
87
88
|
const c = e.dir.replace(/^\.\/|((\.\.\/)+)/, "/");
|
|
@@ -90,10 +91,10 @@ function J(t, e, n, i, r) {
|
|
|
90
91
|
let l = p.replace(m, "");
|
|
91
92
|
if (r.comprops && K("/" + l, r.comprops) || r.curprops && L("/" + l, r.curprops)) {
|
|
92
93
|
let s = {};
|
|
93
|
-
s.url = p, s.comprops = r.comprops || "", s.curprops = r.curprops || "", s.value = l, s.dir = e.dir, s.suffix =
|
|
94
|
+
s.url = p, s.comprops = r.comprops || "", s.curprops = r.curprops || "", s.value = l, s.dir = e.dir, s.cwd = e.cwd, s.suffix = w(o), s.tdir = f, s.key = o, s.raw = "", s.getRaw = x(n, o), u.push(s);
|
|
94
95
|
} else {
|
|
95
96
|
let s = T(l, d, e.aliass, e.alias);
|
|
96
|
-
s && (s.url = p, s.comprops = r.comprops, s.curprops = r.curprops, s.dir = e.dir, s.tdir = f, s.key = o, s.component = i[o], s.getRaw = x(n, o), a.push(s));
|
|
97
|
+
s && (s.url = p, s.comprops = r.comprops, s.curprops = r.curprops, s.dir = e.dir, s.cwd = e.cwd, s.tdir = f, s.key = o, s.component = i[o], s.getRaw = x(n, o), a.push(s));
|
|
97
98
|
}
|
|
98
99
|
}), {
|
|
99
100
|
props: u,
|
|
@@ -105,12 +106,12 @@ function x(t, e) {
|
|
|
105
106
|
}
|
|
106
107
|
export {
|
|
107
108
|
S as defaultExtensions,
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
J as getAsideKey,
|
|
110
|
+
P as getComponentsArr,
|
|
110
111
|
O as getMatchs,
|
|
111
112
|
x as getRawValue,
|
|
112
113
|
T as getUrlName,
|
|
113
114
|
K as isComprops,
|
|
114
115
|
L as isCurprops,
|
|
115
|
-
|
|
116
|
+
I as setAsideKey
|
|
116
117
|
};
|