@fangzhongya/vue-archive 0.0.46 → 0.0.48
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 +166 -134
- package/dist/node/index.d.cts +4 -0
- package/dist/node/index.d.ts +4 -0
- package/dist/node/index.js +166 -134
- 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/compo/index.vue.cjs +1 -1
- package/dist/packages/components/compo/index.vue.js +18 -16
- package/dist/packages/components/compo/info-top.vue.cjs +1 -0
- package/dist/packages/components/compo/info-top.vue.js +32 -0
- package/dist/packages/components/compo/info-top.vue2.cjs +1 -0
- package/dist/packages/components/compo/info-top.vue2.js +4 -0
- package/dist/packages/components/compo/props.vue.cjs +1 -1
- package/dist/packages/components/compo/props.vue.js +44 -40
- package/dist/packages/components/compo/top.cjs +1 -1
- package/dist/packages/components/compo/top.js +69 -48
- package/dist/packages/components/main/index.vue.cjs +1 -1
- package/dist/packages/components/main/index.vue.js +30 -25
- package/dist/packages/components/test/index.cjs +1 -1
- package/dist/packages/components/test/index.js +24 -22
- package/dist/packages/components/test/top.cjs +1 -1
- package/dist/packages/components/test/top.js +69 -84
- 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/page/develop/index.vue2.cjs +1 -1
- package/dist/packages/page/develop/index.vue2.js +2 -1
- 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";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
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`)}async function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../config.cjs"),B=require("@fangzhongya/utils/html/getVueText"),c=require("./common.cjs"),F=require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const T=require("@fangzhongya/utils/name/humpToLine"),W=require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const M=require("@fangzhongya/utils/basic/string/firstLower"),D=require("@fangzhongya/utils/basic/array/duplicateRemoval"),I=require("@fangzhongya/utils/basic/array/asyncMergeArray");require("@fangzhongya/utils/basic/string/firstUpper");const h=require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const J=require("./index.cjs"),w={},R={},K=[],U={},b={},g={};function Q(){return P.getConfig("example")}function X(t,e,n,r){const a=F.mergeObject(e,n||{},3,!0);a.exampless=a.exampless||[],a.examplessRaw=a.examplessRaw||[];const s=[],i=a.examples;i&&Object.keys(i).forEach(u=>{s.push(u),b[u]=i[u]});const l=a.examplesRaw,o=[];if(a.urls&&a.urls.length>0?(a.exampless=a.urls,a.urls.forEach(u=>{o.push(u),l&&(g[u]=j(l,u))})):(a.exampless=s,l&&Object.keys(l).forEach(u=>{o.push(u),g[u]=j(l,u)})),a.examples=void 0,e.tests&&r){const u=e.testsNanme||"/tests/";typeof u=="string"?Object.keys(r).forEach(f=>{f.includes(u)&&(a.exampless.push(f),o.push(f),g[f]=j(r,f))}):Object.keys(r).forEach(f=>{u.test(f)&&(a.exampless.push(f),o.push(f),g[f]=j(r,f))})}a.exampless=[...new Set(a.exampless)],a.examplessRaw=[...new Set(o)],a.examplesRaw=void 0,U[t]=a}function j(t,e){return typeof t=="function"?t:t&&(t[e]||t)}const q={};function Y(t){const e=P.getConfig("resolve");if(q[t])return q[t];for(let n of e)if(t.startsWith(n.find+"/")){const a=n.replacement.replaceAll("\\","/")+t.replace(n.find+"/","/");return q[t]=a,a}}async function Z(t,e){let n="";if(e=="vue"?n=B.getVueTexts(t).script:(e=="js"||e=="ts"||e=="")&&(n=t),n){const r=await J.getTextImport(n),a=[];return r&&r.length>0&&r.forEach(s=>{if(s)if(s.startsWith("./")||s.startsWith("../"))a.push(s);else{const i=Y(s);i&&a.push(i)}}),a}}function _(t){return new Promise(e=>{t?t.raw?e(t.raw):t.getRaw?t.getRaw(t).then(n=>{const r=L(n);t.raw=r,t.getRaw=null,e(r)}):e(""):e("")})}function $(t,e){t=(t||"")+"";let n="";switch(t){case"1":n=e.tdir+"/";break;case"2":n=e.adir+"/";break;case"3":n=e.tdir+"/"+e.adir+"/";break}return n}function y(t,e,n){t=(t||"")+"",n=(n||"")+"";let r=T.humpToLine(e.name),a=[];const s=Object.values(e.aliass||{});if(t==="1")e.alias&&a.push(e.alias+"-"+r);else if(t==="2")s&&s.length>0&&s.forEach(l=>{a.push(l+"-"+r)});else if(t==="3"){let l="";e.alias&&(l=e.alias+"-"),s?.forEach(o=>{a.push(l+o+"-"+r)})}else t==="4"?e.aliasNames?.forEach(l=>{a.push(T.humpToLine(l))}):t=="9"&&(a.push(r),e.aliasNames?.forEach(l=>{a.push(T.humpToLine(l))}));a.length==0&&a.push(r);let i=[];return n==="1"?a.forEach(l=>{let o=W.lineToLargeHump(l);i.push(o,M.firstLower(o))}):n==="2"?a.forEach(l=>{let o=W.lineToLargeHump(l);i.push(l,o,M.firstLower(o))}):i=[...a],i=[...new Set(i)],i}function z(t,e,n,r){const a=[];return n.examplessRaw.forEach(s=>{for(let i=0;i<e.length;i++){const l=e[i];if(s==t+l+n.md+".md"){a.push({cwd:n.cwd||r.cwd,topurl:t,comkey:r.key,suffix:h.getSuffix(s),name:r.name,value:l,key:s,raw:"",getRaw:c.getRawValue(g,s)});break}}}),a}function V(t){O();const e=w[t];if(e.tests&&Object.keys(e.tests).length>0)return e.tests;{const n=U[e.dir],r=n.dir+$(n.level||0,e),a=y(n.aliaslevel||0,e,n.componentName||0);e.mds=z(r,a,n,e);const s={};return n.exampless.forEach(i=>{for(let l=0;l<a.length;l++){const o=a[l];if(i.startsWith(r+o+"/")){const u=new RegExp("/([^/]+)/index\\."+c.defaultExtensions.join("|")+"$"),f=new RegExp("/([^/]+)\\."+c.defaultExtensions.join("|")+"$");let p=i.match(u)||i.match(f);if(p&&p.length>0){let m="";p&&p.length>1&&(m=p[1]),s[i]={topurl:r,name:o,value:m,suffix:h.getSuffix(i),comname:e.name,comkey:e.key,cwd:n.cwd||e.cwd,key:i,dir:e.dir,url:i,component:b[i],raw:"",getRaw:c.getRawValue(g,i)};break}}}}),n.tests&&k(s,e,n),e.tests=s,s}}function k(t,e,n){const r=e.url.substring(0,e.url.lastIndexOf("/"+e.value+"/"))+"/"+e.value,a=n.testsNanme||"/tests/";typeof a=="string"?n.examplessRaw.forEach(s=>{if(s.startsWith(r+"/")){if(s==r+n.md+".md")e.mds=e.mds||[],e.mds.push({cwd:e.cwd,topurl:r,comkey:e.key,suffix:h.getSuffix(s),name:e.name,value:e.value,key:s,raw:"",getRaw:c.getRawValue(g,s)});else if(s.startsWith(r+a)){const i=new RegExp("/([^/]+)/index\\."+c.defaultExtensions.join("|")+"$"),l=new RegExp("/([^/]+)\\."+c.defaultExtensions.join("|")+"$");let o=s.match(i)||s.match(l);if(o&&o.length>0){let u="";o&&o.length>1&&(u=o[1]),t[s]={topurl:r,name:e.value,value:u,suffix:h.getSuffix(s),comname:e.name,comkey:e.key,cwd:n.cwd||e.cwd,key:s,dir:e.dir,url:s,component:b[s],raw:"",getRaw:c.getRawValue(g,s)}}}}}):n.examplessRaw.forEach(s=>{if(s.startsWith(r+"/")){if(s==r+n.md+".md")e.mds=e.mds||[],e.mds.push({cwd:e.cwd,topurl:r,comkey:e.key,suffix:h.getSuffix(s),name:e.name,value:e.value,key:s,raw:"",getRaw:c.getRawValue(g,s)});else if(a.test(s)){const i=new RegExp("/([^/]+)/index\\."+c.defaultExtensions.join("|")+"$"),l=new RegExp("/([^/]+)\\."+c.defaultExtensions.join("|")+"$");let o=s.match(i)||s.match(l);if(o&&o.length>0){let u="";o&&o.length>1&&(u=o[1]),t[s]={cwd:n.cwd||e.cwd,topurl:r,name:e.value,value:u,suffix:h.getSuffix(s),comname:e.name,comkey:e.key,key:s,dir:e.dir,url:s,component:b[s],raw:"",getRaw:c.getRawValue(g,s)}}}}})}function ee(t){if(t){const e=V(t);return Object.values(e)}else return[]}function te(t,e,n){O();const r=V(n),a=[];if(e){let s=r[e];if(s)return a.push(s),a}return Object.values(r).forEach(s=>{s.name+"/"+s.value==t&&a.push(s)}),a}function se(t){return V(t),w[t].mds}async function A(t,e,n){let r=t.key,a=t.dir,s=t.url,i=t.comprops,l=t.curprops,o=await Z(e,n||t.suffix)||[],u=s.split("/");return o.map(f=>{if(f.startsWith("./")){let p=u.slice(0,u.length-1).join("/"),m=f.substring(2);const d=p.replace(/^\.\/|((\.\.\/)+)/,"/");let x=r.indexOf(d)+d.length;return{key:r.substring(0,x)+"/"+m,name:f,cwd:t.cwd,comprops:i||"",curprops:l||"",value:m,suffix:h.getSuffix(f),head:p,dir:a,url:p+"/"+m}}else if(f.startsWith("../")){let p=f.split("/"),m=0;for(let N=0;N<p.length;N++)if(p[N]!=".."){m=N;break}let d=p.slice(m,p.length),x=u.slice(0,u.length-m-1).join("/"),E=d.join("/");const S=x.replace(/^\.\/|((\.\.\/)+)/,"/");let G=r.indexOf(S)+S.length;return{key:r.substring(0,G)+"/"+E,name:E,cwd:t.cwd,comprops:i||"",curprops:l||"",value:E,suffix:h.getSuffix(f),head:x,dir:a,url:x+"/"+E}}else{const p=a.replace(/^\.\/|((\.\.\/)+)/,"/");let m=f.indexOf(p)+p.length,d=f.substring(m),x=a.substring(0,a.length-1);return{key:f,name:d,comprops:i||"",curprops:l||"",value:d,suffix:h.getSuffix(f),head:x,dir:a,cwd:t.cwd,url:x+"/"+d}}})}function ne(t){return new Promise(e=>{if(t&&t.length>0){let n=t.map(r=>({...r,raw:"",suffix:h.getSuffix(r.key),getRaw:c.getRawValue(g,r.key)}));I.asyncMergeArray(n,(r,a,s,i)=>{s.raw?r():s.getRaw?s.getRaw(s).then(l=>{const o=L(l);s.raw=o,s.getRaw=null,r()}):r()}).then(()=>{e(n)})}else e([])})}function re(){const t=Q();P.getConfig("components")?.forEach(n=>{const r=le(n);let a=n.dir||"";X(a,t,n.example,r)})}const C="default";function ae(t){let e=T.humpToLine(t.name),n=[...t.aliasNames];n.push(e),n.forEach(r=>{K.push({name:r,value:t.key})})}function ie(t,e){const n={};e?.forEach(r=>{w[r.key]=r,ae(r);const a=Object.values(r.aliass||{});a&&a.length?a.forEach(s=>{n[s]=n[s]||[],n[s].push(r.key)}):(n[C]=n[C]||[],n[C].push(r.key))})}function le(t){let e,n;const r=t.resolver;r&&Object.keys(r).forEach(s=>{typeof t[s]>"u"&&(t[s]=r[s])}),e=t.alias||C;let a=t?.urls||Object.keys(t.componentsRaw);return n=c.getComponentsArr(a,t,t.componentsRaw,t.components,t),n&&n?.props&&n.props.forEach(s=>{R[s.url]=s}),ie(e,n.components),t.componentsRaw}function oe(t){return O(),w[t]}function O(){return Object.keys(w).length==0&&re(),Object.values(w)}function ue(){return O(),R}function fe(t,e,n){O();const r=[];if(n){let s=w[n];if(s&&s.key)return[s]}let a=T.humpToLine(t);return K.forEach(s=>{e?s.name.includes(a)&&r.push(w[s.value]):s.name==a&&r.push(w[s.value])}),D.duplicateRemoval(r,"key")}async function ce(t,e){let n=t;if(t){let r=(await A(e,t)).filter(a=>c.isComprops(a.key,e.comprops||"")||c.isCurprops(a.key,e.curprops||""));n=await H(r)+n}return n}function pe(t){const e=t.url,n=t.key;return R[e]||R[e+".js"]||R[e+".ts"]||R[n]||R[n+".js"]||R[n+".ts"]}function v(t){return new Promise(e=>{if(t&&t.length>0){let n=t.map(r=>pe(r)).filter(r=>!!r);I.asyncMergeArray(n,(r,a,s,i)=>{s.raw?r():s.getRaw?s.getRaw(s).then(async l=>{const o=L(l);let u=await ce(o,t[i]);s.raw=u,s.getRaw=null,r()}):r()}).then(()=>{e(n)})}else e([])})}async function H(t){return((await v(t))?.map(r=>r.raw)||[]).join(`
|
|
2
|
+
`)}async function me(t,e){let n=t;if(t&&(e.comprops||e.curprops)){let r=(await A(e,t)).filter(s=>c.isComprops(s.key,e.comprops||"")||c.isCurprops(s.key,e.curprops||""));n=await H(r)+n}return n}function L(t){return t&&typeof t=="object"?t.default||"":(t||"")+""}function ge(t){return new Promise(e=>{if(t){O();const n=w[t];n?n.raw?e(n.raw):n.getRaw?n.getRaw(n).then(r=>{const a=L(r);me(a,n).then(s=>{n.raw=s,n.getRaw=null,e(s)})}):e(""):e("")}else e("")})}exports.defaultName=C;exports.getCompoName=fe;exports.getCompoNameKey=oe;exports.getCompoNameObj=O;exports.getComponentPropsObjs=ue;exports.getGetRawValue=L;exports.getKeyMds=se;exports.getLevelUrl=$;exports.getLocalTextArr=ne;exports.getLocalTextComponents=ge;exports.getLocalTextTests=_;exports.getPropsRaws=v;exports.getTestImportUrl=A;exports.getTestName=ee;exports.getTestNameObj=te;
|
|
@@ -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(
|
|
24
|
+
export declare function getTestImportUrl(cobj: PropObj | ComponentsObj, text: string, type?: 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;
|