@fangzhongya/vue-archive 0.0.2-21 → 0.0.2-23
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/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js +0 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js +0 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.js +0 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js +0 -0
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js +18 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js +0 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js +0 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js +0 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js +0 -0
- package/dist/es/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js +0 -0
- package/dist/es/packages/components/code/index.vue.js +17 -18
- package/dist/es/packages/components/use/index.js +1 -1
- package/dist/es/packages/components/use/retrie/choice/index.vue.js +1 -1
- package/dist/es/packages/components/use/set-code.vue.js +3 -3
- package/dist/es/packages/config.d.ts +2 -0
- package/dist/es/packages/config.js +1 -1
- package/dist/es/packages/index.d.ts +0 -1
- package/dist/es/packages/index.js +5 -7
- package/dist/es/packages/utils/common.d.ts +1 -1
- package/dist/es/packages/utils/common.js +15 -15
- package/dist/es/packages/utils/glob.d.ts +1 -1
- package/dist/es/packages/utils/glob.js +161 -137
- package/dist/es/packages/utils/index.d.ts +2 -1
- package/dist/es/packages/utils/index.js +16 -13
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js +0 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js +0 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.js +0 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js +0 -0
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js +1 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js +0 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js +0 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js +0 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js +0 -0
- package/dist/lib/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-15 → @fangzhongya_utils@0.0.7-16}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js +0 -0
- package/dist/lib/packages/components/code/index.vue.js +1 -1
- package/dist/lib/packages/components/use/index.js +1 -1
- package/dist/lib/packages/components/use/retrie/choice/index.vue.js +1 -1
- package/dist/lib/packages/components/use/set-code.vue.js +1 -1
- package/dist/lib/packages/config.d.ts +2 -0
- package/dist/lib/packages/config.js +1 -1
- package/dist/lib/packages/index.d.ts +0 -1
- package/dist/lib/packages/index.js +1 -1
- package/dist/lib/packages/utils/common.d.ts +1 -1
- package/dist/lib/packages/utils/common.js +1 -1
- package/dist/lib/packages/utils/glob.d.ts +1 -1
- package/dist/lib/packages/utils/glob.js +2 -2
- package/dist/lib/packages/utils/index.d.ts +2 -1
- package/dist/lib/packages/utils/index.js +1 -1
- package/dist/node/index.cjs +17984 -0
- package/dist/node/index.d.ts +110 -0
- package/dist/node/index.js +17984 -0
- package/package.json +10 -8
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js +0 -6
- package/dist/es/node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js +0 -18
- package/dist/es/packages/node/index.d.ts +0 -2
- package/dist/es/packages/node/index.js +0 -155
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js +0 -1
- package/dist/lib/node_modules/.pnpm/@fangzhongya_utils@0.0.7-15/node_modules/@fangzhongya/utils/dist/chunk-XQB2HUHZ.js +0 -1
- package/dist/lib/packages/node/index.d.ts +0 -2
- package/dist/lib/packages/node/index.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),d=require("./util.js"),V=require("../code/highlight.vue.js"),N=require("../../utils/index.js"),O=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-
|
|
1
|
+
"use strict";const e=require("vue"),d=require("./util.js"),V=require("../code/highlight.vue.js"),N=require("../../utils/index.js"),O=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),_=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js"),S=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js"),q={class:"set-code"},y=e.createElementVNode("div",null,"代码",-1),F={class:"but-div set-code-but"},w=["onClick"],B={class:"set-code-html"},J=e.defineComponent({__name:"set-code",props:{name:{type:String},value:{type:Object},slotValue:{type:Object},propsText:{type:Object}},setup(b){const r=b,m=e.computed(()=>{const s=[],t=[];let i=!0;const n=r.value;Object.keys(n).forEach(o=>{let p=n[o];if(/^on[A-Z]/.test(o)&&typeof p=="function"){let u=o.substring(2);const a=o.split(":");let l;if(a.length>1?(l=a[0]+a.slice(1).map(f=>_.firstUpper(f)).join(""),u=S.firstLower(u)):(l=a[0],u=O.humpToLine(u)),a.includes("-")){let f=l.split("-");f=f.map((g,E)=>E!=0?_.firstUpper(g):g),l=f.join("")}s.push(" @"+u+'="'+l+'"'),t.push("function "+l+"(...arr) {"),t.push(" console.log('"+l+"', arr)"),t.push("}")}else if(s.push(" :"+o+'="'+o+'"'),typeof p=="function")t.push("const "+o+" = "+$(p,o));else if(i&&(i=!1,t.unshift("import { ref } from 'vue';")),typeof p>"u")t.push("const "+o+" = ref();");else{let u=T(p,o);t.push("const "+o+" = ref("+u+");")}}),s.length>0&&s.unshift("");const c=x(r.slotValue);return`<!--${r.name}-->
|
|
2
2
|
<template>
|
|
3
3
|
<div>
|
|
4
4
|
<${r.name}${s.join(`
|
|
@@ -25,6 +25,7 @@ export interface Resolver extends Component {
|
|
|
25
25
|
}
|
|
26
26
|
export interface Components extends Component {
|
|
27
27
|
resolver?: Resolver;
|
|
28
|
+
urls?: string[];
|
|
28
29
|
comprops?: string;
|
|
29
30
|
curprops?: string;
|
|
30
31
|
components: GlobComs;
|
|
@@ -56,6 +57,7 @@ export interface ExampleObj {
|
|
|
56
57
|
*/
|
|
57
58
|
componentName?: string | number;
|
|
58
59
|
examples?: GlobComs;
|
|
60
|
+
urls?: string[];
|
|
59
61
|
examplesRaw?: Globs;
|
|
60
62
|
md?: string;
|
|
61
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../node_modules/.pnpm/@fangzhongya_utils@0.0.7-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js"),n={components:[]};function o(e){return t.mergeObject(n,e,2)}function r(e){return n[e]}exports.getConfig=r;exports.userConfig=o;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Config } from './config';
|
|
2
2
|
import type { App } from './vue/dist/vue.esm-bundler.js';
|
|
3
3
|
import type { Router } from 'vue-router';
|
|
4
|
-
export * from './node/index';
|
|
5
4
|
export declare function defineConfig(config: Config): Config;
|
|
6
5
|
declare const _default: {
|
|
7
6
|
install: (app: App, router: Router) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("./router/index.js"),t=require("./config.js")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("./router/index.js"),t=require("./config.js");function o(e){return t.userConfig(e)}const u={install:function(e,n){i.init(n)}};exports.default=u;exports.defineConfig=o;
|
|
@@ -73,4 +73,4 @@ export interface ComponentsObjs {
|
|
|
73
73
|
components: Array<ComponentsObj>;
|
|
74
74
|
}
|
|
75
75
|
export declare function getComponentsArr(urls: Array<string>, v: Resolver, comRaw: Globs, com: GlobComs, config: Components): ComponentsObjs;
|
|
76
|
-
export declare function getRawValue(comRaw: Globs, key: string): GetRaw;
|
|
76
|
+
export declare function getRawValue(comRaw: Globs, key: string): GetRaw | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./storage.js"),R=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./storage.js"),R=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),q=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),m=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),A=["vue","js"];function K(t,e){let n=R.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=m.appearNum(e,"/"),s=m.appearNum(n,"/");return i==s?n.length-e.length:s-i}),t}function C(t=[],e=[],n=[]){let i=e;(!i||i.length==0)&&(i=A);let s=[];return t&&t.length>0&&(s=t),n&&n.length>0&&n.forEach(l=>{i==null||i.forEach(a=>{s.push(l+"."+a)})}),s=[...new Set(s)],T(s)}function N(t,e,n={},i=""){for(let s=0;s<e.length;s++){const l=e[s],a=new RegExp("^.*/([^/]+)"+l+"$");let c=t.match(a);if(c){const p=[],u={};let f="";Object.keys(n).forEach(g=>{let h=n[g];t.startsWith(h+"/")&&(f=h,u[g]=h,p.push(g))});let o=c[1],r={dir:"",suffix:E.getSuffix(t),name:q.lineToLargeHump(o),value:o,key:"",tdir:"",adir:f,alias:i,aliass:u,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0};return r.aliasNames=K(r,p),r}}}function y(t){x.setSession("aside.key",t)}function D(){return x.getSession("aside.key")}function H(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function w(t,e){return e?new RegExp(e+".+(\\.(js|ts))?$").test(t):!1}function S(t,e){return e?new RegExp("/"+e+"(\\.(js|ts))?$").test(t):!1}function M(t,e,n,i,s){const l=[],a=[],c=C(e.matchexts,e.extensions,e.matchs),p=H(e.dir);return t.forEach(u=>{const f=new RegExp("^"+e.dir);let o=u.replace(f,"");if(s.comprops&&w(o,s.comprops)||s.curprops&&S(o,s.curprops)){let r={};r.comprops=s.comprops||"",r.curprops=s.curprops||"",r.value=o,r.dir=e.dir,r.suffix=E.getSuffix(u),r.tdir=p,r.key=u,r.raw="",r.getRaw=d(n,u),l.push(r)}else{let r=N(o,c,e.aliass,e.alias);r&&(r.comprops=s.comprops,r.curprops=s.curprops,r.dir=e.dir,r.tdir=p,r.key=u,r.component=i[u],r.getRaw=d(n,u),a.push(r))}}),{props:l,components:a}}function d(t,e){return typeof t=="function"?t:t?t[e]:null}exports.defaultExtensions=A;exports.getAsideKey=D;exports.getComponentsArr=M;exports.getMatchs=C;exports.getRawValue=d;exports.getUrlName=N;exports.isComprops=w;exports.isCurprops=S;exports.setAsideKey=y;
|
|
@@ -15,7 +15,7 @@ export declare function getKeyMds(key: string): MdObj[] | undefined;
|
|
|
15
15
|
* @param {*} arr
|
|
16
16
|
* @returns
|
|
17
17
|
*/
|
|
18
|
-
export declare function getTestImportUrl(url: string, text: string, type: string): Array<PropObj
|
|
18
|
+
export declare function getTestImportUrl(url: string, text: string, type: string): Promise<Array<PropObj>>;
|
|
19
19
|
export declare function getLocalTextArr(arr: Array<PropObj>): Promise<TextObj[]>;
|
|
20
20
|
export declare const defaultName = "default";
|
|
21
21
|
export declare function getCompoNameKey(key: string): ComponentsObj;
|
|
@@ -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 N=require("../config.js"),p=require("./common.js"),w=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js"),E=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js"),C=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js"),j=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js"),y=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js"),x=require("../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-16/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js"),K=require("./index.js"),f={},O={},P=[],q={},A={},d={};function b(){return N.getConfig("example")}function M(e,t,s){const n=Object.assign({exampless:[],examplessRaw:[]},t,s),r=[],a=n.examples;a&&Object.keys(a).forEach(o=>{r.push(o),A[o]=a[o]});const i=n.examplesRaw,l=[];n.urls&&n.urls.length>0?(n.exampless=n.urls,n.urls.forEach(o=>{l.push(o),i&&(d[o]=L(i,o))})):(n.exampless=r,i&&Object.keys(i).forEach(o=>{l.push(o),i&&(d[o]=L(i,o))})),n.examples=void 0,n.examplessRaw=l,n.examplesRaw=void 0,q[e]=n}function L(e,t){return typeof e=="function"?e:e&&(e[t]||e)}async function H(e,t="vue"){let s="";if(t=="vue"){let r=new RegExp(/(<script([^>]*)>)((.|\n|\r)*)(<\/script>)/g).exec(e);r&&(s=r[3])}else(t=="js"||t=="ts")&&(s=e);if(s){const n=await K.getTextImport(s);let r=n==null?void 0:n.map(i=>i.n);const a=[];return r&&r.length>0&&r.forEach(i=>{i&&(i.startsWith("./")||i.startsWith("../"))&&a.push(i)}),a}}function I(e){return new Promise(t=>{e?e.raw?t(e.raw):e.getRaw?e.getRaw(e).then(s=>{const n=(s||"")+"";e.raw=n,e.getRaw=null,t(n)}):t(""):t("")})}function k(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 U(e,t,s){var l,o;e=(e||"")+"",s=(s||"")+"";let n=w.humpToLine(t.name),r=[];const a=Object.values(t.aliass||{});if(e==="1")t.alias&&r.push(t.alias+"-"+n);else if(e==="2")a&&a.length>0&&a.forEach(c=>{r.push(c+"-"+n)});else if(e==="3"){let c="";t.alias&&(c=t.alias+"-"),a==null||a.forEach(u=>{r.push(c+u+"-"+n)})}else e==="4"?(l=t.aliasNames)==null||l.forEach(c=>{r.push(w.humpToLine(c))}):e=="9"&&(r.push(n),(o=t.aliasNames)==null||o.forEach(c=>{r.push(w.humpToLine(c))}));r.length==0&&r.push(n);let i=[];return s==="1"?r.forEach(c=>{let u=E.lineToLargeHump(c);i.push(u,C.firstLower(u))}):s==="2"?r.forEach(c=>{let u=E.lineToLargeHump(c);i.push(c,u,C.firstLower(u))}):i=[...r],i=[...new Set(i)],i}function V(e,t,s,n){const r=[];return s.examplessRaw.forEach(a=>{for(let i=0;i<t.length;i++){const l=t[i];if(a==e+l+"/"+s.md+".md"){r.push({topurl:e,comkey:n.key,suffix:x.getSuffix(a),name:n.name,value:l,key:a,raw:"",getRaw:p.getRawValue(d,a)});break}}}),r}function R(e){h();const t=f[e];if(t.tests)return t.tests;{const s=q[t.dir],n=s.dir+k(s.level||0,t),r=U(s.aliaslevel||0,t,s.componentName||0);t.mds=V(n,r,s,t);const a={};return s.exampless.forEach(i=>{for(let l=0;l<r.length;l++){const o=r[l];if(i.startsWith(n+o+"/")){const c=new RegExp("^\\"+n+o+"/(.*)/index\\."+p.defaultExtensions.join("|")+"$");let u="",m=i.match(c);m&&m.length>1&&(u=m[1]),a[i]={topurl:n,name:o,value:u,suffix:x.getSuffix(i),comname:t.name,comkey:t.key,key:i,component:A[i],raw:"",getRaw:p.getRawValue(d,i)};break}}}),t.tests=a,a}}function W(e){if(e){const t=R(e);return Object.values(t)}else return[]}function B(e,t,s){h();const n=R(s),r=[];if(t){let a=n[t];if(a)return r.push(a),r}return Object.values(n).forEach(a=>{a.name+"/"+a.value==e&&r.push(a)}),r}function D(e){return R(e),f[e].mds}async function T(e,t,s){let n=await H(t,s)||[],r=e.split("/");return n.map(a=>{if(a.startsWith("./")){let i=r.slice(0,r.length-1).join("/"),l=a.substring(2);return{name:a,value:l,suffix:x.getSuffix(a),head:i,key:i+"/"+l}}else{let i=a.split("/"),l=0;for(let m=0;m<i.length;m++)if(i[m]!=".."){l=m;break}let o=i.slice(l,i.length),c=r.slice(0,r.length-l-1).join("/"),u=o.join("/");return{name:a,value:u,suffix:x.getSuffix(a),head:c,key:c+"/"+u}}})}function F(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>({raw:"",value:n.value,suffix:x.getSuffix(n.key),key:n.key,getRaw:p.getRawValue(d,n.key)}));y.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw(a).then(l=>{const o=(l||"")+"";a.raw=o,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}function J(){const e=b(),t=N.getConfig("components");t==null||t.forEach(s=>{var r;Q(s);let n=s.dir||((r=s==null?void 0:s.resolver)==null?void 0:r.dir)||"";M(n,e,s.example)})}const g="default";function X(e){let t=w.humpToLine(e.name),s=[...e.aliasNames];s.push(t),s.forEach(n=>{P.push({name:n,value:e.key})})}function Z(e,t){const s={};t==null||t.forEach(n=>{f[n.key]=n,X(n);const r=Object.values(n.aliass||{});r&&r.length?r.forEach(a=>{s[a]=s[a]||[],s[a].push(n.key)}):(s[g]=s[g]||[],s[g].push(n.key))})}function Q(e){var n;let t,s;if(e.resolver)t=e.alias||((n=e.resolver)==null?void 0:n.alias)||g,s=p.getComponentsArr(e.resolver.urls||[],e.resolver,e.componentsRaw,e.components,e);else{t=e.alias||g;let r=(e==null?void 0:e.urls)||Object.keys(e.componentsRaw);s=p.getComponentsArr(r,e,e.componentsRaw,e.components,e)}s&&(s!=null&&s.props)&&s.props.forEach(r=>{O[r.key]=r}),Z(t,s.components)}function $(e){return h(),f[e]}function h(){return Object.keys(f).length==0&&J(),Object.values(f)}function G(e,t,s){h();const n=[];if(s){let a=f[s];if(a&&a.key)return[a]}let r=w.humpToLine(e);return P.forEach(a=>{t?a.name.includes(r)&&n.push(f[a.value]):a.name==r&&n.push(f[a.value])}),j.duplicateRemoval(n,"key")}async function Y(e,t){let s=e;if(e){let n=(await T(t.key,e,t.suffix)).filter(r=>r.key.startsWith(t.head));s+=await S(n)}return s}function _(e){return new Promise(t=>{if(e&&e.length>0){let s=e.map(n=>O[n.key]||O[n.key+".js"]||O[n.key+".ts"]);y.asyncMergeArray(s,(n,r,a,i)=>{a.raw?n():a.getRaw?a.getRaw(a).then(async l=>{const o=(l||"")+"";let c=await Y(o,e[i]);a.raw=c,a.getRaw=null,n()}):n()}).then(()=>{t(s)})}else t([])})}async function S(e){const t=await _(e);return((t==null?void 0:t.map(n=>n.raw))||[]).join(`
|
|
2
|
+
`)}async function z(e,t){let s=e;if(e&&(t.comprops||t.curprops)){let n=(await T(t.key,e,t.suffix)).filter(a=>p.isComprops(a.name,t.comprops||"")||p.isCurprops(a.name,t.curprops||"")),r=await S(n);s+=r}return s}function v(e){return new Promise(t=>{if(e){h();const s=f[e];s?s.raw?t(s.raw):s.getRaw?s.getRaw(s).then(async n=>{const r=(n||"")+"",a=await z(r,s);s.raw=a,s.getRaw=null,t(a)}):t(""):t("")}else t("")})}exports.defaultName=g;exports.getCompoName=G;exports.getCompoNameKey=$;exports.getCompoNameObj=h;exports.getKeyMds=D;exports.getLocalTextArr=F;exports.getLocalTextComponents=v;exports.getLocalTextTests=I;exports.getTestImportUrl=T;exports.getTestName=W;exports.getTestNameObj=B;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ImportSpecifier } from 'es-module-lexer';
|
|
1
2
|
export type Spec = {
|
|
2
3
|
tag: string;
|
|
3
4
|
name: string;
|
|
@@ -25,6 +26,6 @@ interface Descriptions {
|
|
|
25
26
|
}
|
|
26
27
|
export type SpecObjs = Descriptions & Specs;
|
|
27
28
|
export declare function getTextNotes(text: string): Block[] | undefined;
|
|
28
|
-
export declare function getTextImport(jstext: string): readonly
|
|
29
|
+
export declare function getTextImport(jstext: string): Promise<readonly ImportSpecifier[]>;
|
|
29
30
|
export declare function copyCode(text: string): void;
|
|
30
31
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../node_modules/.pnpm/comment-parser@1.3.1/node_modules/comment-parser/es6/index.js"),t=require("../../node_modules/.pnpm/es-module-lexer@1.1.1/node_modules/es-module-lexer/dist/lexer.js");function n(e){if(e)return i.parse(e)}function s(e){return new Promise(async o=>{await t.init;const[r]=t.parse(e);o(r)})}function c(e){navigator.clipboard.writeText(e)}exports.copyCode=c;exports.getTextImport=s;exports.getTextNotes=n;
|