@fangzhongya/vue-archive 0.0.97 → 0.1.1

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.
@@ -87,12 +87,12 @@ __export(index_exports, {
87
87
  });
88
88
  module.exports = __toCommonJS(index_exports);
89
89
 
90
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js
90
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js
91
91
  function isArray(obj2) {
92
92
  return Object.prototype.toString.call(obj2) == "[object Array]";
93
93
  }
94
94
 
95
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-A276ZDLP.js
95
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-A276ZDLP.js
96
96
  function getStartSames(str, val) {
97
97
  let s = "";
98
98
  const vs = [...val];
@@ -108,7 +108,7 @@ function getStartSames(str, val) {
108
108
  return [s, str.substring(index), val.substring(index)];
109
109
  }
110
110
 
111
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-KDOS4NFR.js
111
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-KDOS4NFR.js
112
112
  function getImportUrl(url, imp) {
113
113
  const arr = getStartSames(url, imp);
114
114
  const ts2 = arr[0];
@@ -132,12 +132,12 @@ function getImportUrl(url, imp) {
132
132
  return ds.join("") + arr[2].replace(/\\/g, "/");
133
133
  }
134
134
 
135
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
135
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
136
136
  function firstUpper(str) {
137
137
  return str.slice(0, 1).toUpperCase() + str.slice(1);
138
138
  }
139
139
 
140
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
140
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
141
141
  function lineToLargeHump(name) {
142
142
  let arr = name.split("-");
143
143
  arr = arr.map((vs) => {
@@ -846,7 +846,7 @@ function runDev(config2, configCallback) {
846
846
  return new FangMd(config2, configCallback);
847
847
  }
848
848
 
849
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
849
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
850
850
  var zObj = {
851
851
  "<": "&lt;",
852
852
  ">": "&gt;",
@@ -867,7 +867,7 @@ function htmlEscape(str) {
867
867
  // packages/node/index.ts
868
868
  var import_node_path = require("path");
869
869
 
870
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js
870
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js
871
871
  function mergeObject(a, b, j = 0, i) {
872
872
  if (a instanceof Array) {
873
873
  if (j > 0 && i) {
@@ -921,7 +921,7 @@ function getConfig(key) {
921
921
  return config[key];
922
922
  }
923
923
 
924
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
924
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
925
925
  function getVueText(content) {
926
926
  const result = {
927
927
  template: "",
@@ -968,7 +968,7 @@ function getVueTexts(content) {
968
968
  };
969
969
  }
970
970
 
971
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
971
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
972
972
  function humpToLine(name) {
973
973
  const reg = /(([A-Z])([^A-Z]*))/g;
974
974
  let result;
@@ -990,12 +990,12 @@ function humpToLine(name) {
990
990
  }
991
991
  }
992
992
 
993
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
993
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
994
994
  function firstLower(str) {
995
995
  return str.slice(0, 1).toLowerCase() + str.slice(1);
996
996
  }
997
997
 
998
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js
998
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js
999
999
  function asyncMergeArray(arr, callback) {
1000
1000
  return new Promise((resolve2, reject) => {
1001
1001
  let index = 0;
@@ -1019,7 +1019,7 @@ function asyncMergeArray(arr, callback) {
1019
1019
  });
1020
1020
  }
1021
1021
 
1022
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-Z7NTQAAJ.js
1022
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-Z7NTQAAJ.js
1023
1023
  function getSuffix2(url) {
1024
1024
  const reg = /\.([a-z|A-Z][a-z|A-Z|0-9]*)$/;
1025
1025
  const regs = reg.exec(url);
@@ -1029,7 +1029,7 @@ function getSuffix2(url) {
1029
1029
  return "";
1030
1030
  }
1031
1031
 
1032
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
1032
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
1033
1033
  function matchsStart2(key, matchs) {
1034
1034
  if (matchs && matchs.length > 0) {
1035
1035
  for (const value of matchs) {
@@ -1049,7 +1049,7 @@ function matchsStart2(key, matchs) {
1049
1049
  }
1050
1050
  }
1051
1051
 
1052
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-YNOFNHEK.js
1052
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-YNOFNHEK.js
1053
1053
  function matchsEnd2(key, matchs) {
1054
1054
  if (matchs && matchs.length > 0) {
1055
1055
  for (const value of matchs) {
@@ -1712,7 +1712,7 @@ function parse(source, options = {}) {
1712
1712
  }
1713
1713
  var stringify = getStringifier();
1714
1714
 
1715
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-FS4JPT23.js
1715
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-FS4JPT23.js
1716
1716
  function deComment(code) {
1717
1717
  let output = "";
1718
1718
  let state = "code";
@@ -1804,7 +1804,7 @@ function deComment(code) {
1804
1804
  return output;
1805
1805
  }
1806
1806
 
1807
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-75J5ZAUX.js
1807
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-N5Y3XGHX.js
1808
1808
  function getImports(code, includeType = false) {
1809
1809
  code = deComment(code);
1810
1810
  const imports = /* @__PURE__ */ new Set();
@@ -1815,7 +1815,7 @@ function getImports(code, includeType = false) {
1815
1815
  if (!path) continue;
1816
1816
  const fullMatch = match[0];
1817
1817
  if (!includeType) {
1818
- if (fullMatch.includes("import") && containsNonTypeImport(fullMatch) || fullMatch.includes("export") && containsNonTypeExport(fullMatch)) {
1818
+ if (fullMatch.includes("import") && isPureTypeImport(fullMatch) || fullMatch.includes("export") && isPureTypeExport(fullMatch)) {
1819
1819
  continue;
1820
1820
  }
1821
1821
  }
@@ -1823,19 +1823,29 @@ function getImports(code, includeType = false) {
1823
1823
  }
1824
1824
  return Array.from(imports);
1825
1825
  }
1826
- function containsNonTypeImport(importStatement) {
1826
+ function isPureTypeImport(importStatement) {
1827
+ const importTypeRegex = /^\s*import\s+type\b/;
1828
+ if (importTypeRegex.test(importStatement)) {
1829
+ return true;
1830
+ }
1827
1831
  if (importStatement.includes("{")) {
1828
1832
  const braceContent = importStatement.match(/\{([^}]*)\}/)?.[1] || "";
1829
- return braceContent.split(",").some((item) => item.trim() && item.trim().startsWith("type "));
1833
+ const items = braceContent.split(",").map((item) => item.trim()).filter(Boolean);
1834
+ return items.length > 0 && items.every((item) => item.startsWith("type "));
1830
1835
  }
1831
- return importStatement.includes("import type");
1836
+ return false;
1832
1837
  }
1833
- function containsNonTypeExport(exportStatement) {
1838
+ function isPureTypeExport(exportStatement) {
1839
+ const exportTypeRegex = /^\s*export\s+type\b/;
1840
+ if (exportTypeRegex.test(exportStatement)) {
1841
+ return true;
1842
+ }
1834
1843
  if (exportStatement.includes("{")) {
1835
1844
  const braceContent = exportStatement.match(/\{([^}]*)\}/)?.[1] || "";
1836
- return braceContent.split(",").some((item) => item.trim() && item.trim().startsWith("type "));
1845
+ const items = braceContent.split(",").map((item) => item.trim()).filter(Boolean);
1846
+ return items.length > 0 && items.every((item) => item.startsWith("type "));
1837
1847
  }
1838
- return exportStatement.includes("export type");
1848
+ return false;
1839
1849
  }
1840
1850
 
1841
1851
  // packages/utils/index.ts
@@ -2377,16 +2387,6 @@ function getCompoNameObj() {
2377
2387
  }
2378
2388
  return Object.values(componentsObj);
2379
2389
  }
2380
- async function getPropsImport(text, obj2) {
2381
- let ts2 = text;
2382
- if (text) {
2383
- let arr = (await getTestImportUrl(obj2, text)).filter((v) => {
2384
- return isComprops(v.key, obj2.comprops) || isCurprops(v.key, obj2.curprops);
2385
- });
2386
- ts2 = await getPropsTexts(arr) + ts2;
2387
- }
2388
- return ts2;
2389
- }
2390
2390
  function getPropsValue(o) {
2391
2391
  const u = o.url;
2392
2392
  const k = o.key;
@@ -2404,8 +2404,7 @@ function getPropsRaws(arr) {
2404
2404
  } else if (value.getRaw) {
2405
2405
  value.getRaw(value).then(async (s) => {
2406
2406
  const m = getGetRawValue(s);
2407
- let ts2 = await getPropsImport(m, arr[index]);
2408
- value.raw = ts2;
2407
+ value.raw = await getComponentsProps(m, arr[index]);
2409
2408
  value.getRaw = null;
2410
2409
  res();
2411
2410
  });
@@ -2420,23 +2419,30 @@ function getPropsRaws(arr) {
2420
2419
  }
2421
2420
  });
2422
2421
  }
2422
+ var spliceName = "\nfangzhongya@vue-archive@glob@vue-archive@fangzhongya\n";
2423
+ function deduplication(text) {
2424
+ const arr = text.split(spliceName);
2425
+ const qcs = [...new Set(arr)];
2426
+ return qcs.join("\n");
2427
+ }
2423
2428
  async function getPropsTexts(arr) {
2424
2429
  const arrs = await getPropsRaws(arr);
2425
2430
  const sts = arrs?.map((o) => o.raw) || [];
2426
- return sts.join("\n");
2431
+ return sts.filter((o) => Boolean(o)).join(spliceName);
2427
2432
  }
2428
2433
  async function getComponentsProps(text, obj2) {
2429
- let ts2 = text;
2430
2434
  if (text) {
2435
+ text = `/**${obj2.url}**/
2436
+ ` + text;
2431
2437
  if (obj2.comprops || obj2.curprops) {
2432
2438
  let arr = (await getTestImportUrl(obj2, text)).filter((v) => {
2433
2439
  return isComprops(v.key, obj2.comprops) || isCurprops(v.key, obj2.curprops);
2434
2440
  });
2435
- let str = await getPropsTexts(arr);
2436
- ts2 = str + ts2;
2441
+ return text + spliceName + await getPropsTexts(arr);
2437
2442
  }
2443
+ return text;
2438
2444
  }
2439
- return ts2;
2445
+ return "";
2440
2446
  }
2441
2447
  function getGetRawValue(s) {
2442
2448
  if (s && typeof s == "object") {
@@ -2457,7 +2463,8 @@ function getLocalTextComponents(u) {
2457
2463
  } else if (componentObj.getRaw) {
2458
2464
  componentObj.getRaw(componentObj).then((s) => {
2459
2465
  const m = getGetRawValue(s);
2460
- getComponentsProps(m, componentObj).then((text) => {
2466
+ getComponentsProps(m, componentObj).then((texts) => {
2467
+ const text = deduplication(texts);
2461
2468
  componentObj.raw = text;
2462
2469
  componentObj.getRaw = null;
2463
2470
  resolve2(text);
@@ -3223,7 +3230,7 @@ var top_default2 = (0, import_vue2.defineComponent)({
3223
3230
  }
3224
3231
  });
3225
3232
 
3226
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
3233
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
3227
3234
  var FUNCTION_REGEX = /^\s*(?:(async)\s+)?(?:function\s*(\*?)\s*(\w*)\s*\(([\s\S]*?)\)|(\*?\s*)\b(\w+)\s*\(([\s\S]*?)\)|\(([\s\S]*?)\)|([^=>,\(\)]+?))\s*(?:=>)?\s*(?:\{([\s\S]*?)\}|([\s\S]*))$/;
3228
3235
  function getFunctionFormat(v) {
3229
3236
  if (!v) return;
@@ -58,12 +58,12 @@ var init_prettier = __esm({
58
58
  }
59
59
  });
60
60
 
61
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js
61
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js
62
62
  function isArray(obj2) {
63
63
  return Object.prototype.toString.call(obj2) == "[object Array]";
64
64
  }
65
65
 
66
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-A276ZDLP.js
66
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-A276ZDLP.js
67
67
  function getStartSames(str, val) {
68
68
  let s = "";
69
69
  const vs = [...val];
@@ -79,7 +79,7 @@ function getStartSames(str, val) {
79
79
  return [s, str.substring(index), val.substring(index)];
80
80
  }
81
81
 
82
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-KDOS4NFR.js
82
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-KDOS4NFR.js
83
83
  function getImportUrl(url, imp) {
84
84
  const arr = getStartSames(url, imp);
85
85
  const ts2 = arr[0];
@@ -103,12 +103,12 @@ function getImportUrl(url, imp) {
103
103
  return ds.join("") + arr[2].replace(/\\/g, "/");
104
104
  }
105
105
 
106
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
106
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
107
107
  function firstUpper(str) {
108
108
  return str.slice(0, 1).toUpperCase() + str.slice(1);
109
109
  }
110
110
 
111
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
111
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
112
112
  function lineToLargeHump(name) {
113
113
  let arr = name.split("-");
114
114
  arr = arr.map((vs) => {
@@ -828,7 +828,7 @@ function runDev(config2, configCallback) {
828
828
  return new FangMd(config2, configCallback);
829
829
  }
830
830
 
831
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
831
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
832
832
  var zObj = {
833
833
  "<": "&lt;",
834
834
  ">": "&gt;",
@@ -849,7 +849,7 @@ function htmlEscape(str) {
849
849
  // packages/node/index.ts
850
850
  import { join as join4 } from "path";
851
851
 
852
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js
852
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js
853
853
  function mergeObject(a, b, j = 0, i) {
854
854
  if (a instanceof Array) {
855
855
  if (j > 0 && i) {
@@ -903,7 +903,7 @@ function getConfig(key) {
903
903
  return config[key];
904
904
  }
905
905
 
906
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
906
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
907
907
  function getVueText(content) {
908
908
  const result = {
909
909
  template: "",
@@ -950,7 +950,7 @@ function getVueTexts(content) {
950
950
  };
951
951
  }
952
952
 
953
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
953
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
954
954
  function humpToLine(name) {
955
955
  const reg = /(([A-Z])([^A-Z]*))/g;
956
956
  let result;
@@ -972,12 +972,12 @@ function humpToLine(name) {
972
972
  }
973
973
  }
974
974
 
975
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
975
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
976
976
  function firstLower(str) {
977
977
  return str.slice(0, 1).toLowerCase() + str.slice(1);
978
978
  }
979
979
 
980
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js
980
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js
981
981
  function asyncMergeArray(arr, callback) {
982
982
  return new Promise((resolve2, reject) => {
983
983
  let index = 0;
@@ -1001,7 +1001,7 @@ function asyncMergeArray(arr, callback) {
1001
1001
  });
1002
1002
  }
1003
1003
 
1004
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-Z7NTQAAJ.js
1004
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-Z7NTQAAJ.js
1005
1005
  function getSuffix2(url) {
1006
1006
  const reg = /\.([a-z|A-Z][a-z|A-Z|0-9]*)$/;
1007
1007
  const regs = reg.exec(url);
@@ -1011,7 +1011,7 @@ function getSuffix2(url) {
1011
1011
  return "";
1012
1012
  }
1013
1013
 
1014
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
1014
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
1015
1015
  function matchsStart2(key, matchs) {
1016
1016
  if (matchs && matchs.length > 0) {
1017
1017
  for (const value of matchs) {
@@ -1031,7 +1031,7 @@ function matchsStart2(key, matchs) {
1031
1031
  }
1032
1032
  }
1033
1033
 
1034
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-YNOFNHEK.js
1034
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-YNOFNHEK.js
1035
1035
  function matchsEnd2(key, matchs) {
1036
1036
  if (matchs && matchs.length > 0) {
1037
1037
  for (const value of matchs) {
@@ -1694,7 +1694,7 @@ function parse(source, options = {}) {
1694
1694
  }
1695
1695
  var stringify = getStringifier();
1696
1696
 
1697
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-FS4JPT23.js
1697
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-FS4JPT23.js
1698
1698
  function deComment(code) {
1699
1699
  let output = "";
1700
1700
  let state = "code";
@@ -1786,7 +1786,7 @@ function deComment(code) {
1786
1786
  return output;
1787
1787
  }
1788
1788
 
1789
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-75J5ZAUX.js
1789
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-N5Y3XGHX.js
1790
1790
  function getImports(code, includeType = false) {
1791
1791
  code = deComment(code);
1792
1792
  const imports = /* @__PURE__ */ new Set();
@@ -1797,7 +1797,7 @@ function getImports(code, includeType = false) {
1797
1797
  if (!path) continue;
1798
1798
  const fullMatch = match[0];
1799
1799
  if (!includeType) {
1800
- if (fullMatch.includes("import") && containsNonTypeImport(fullMatch) || fullMatch.includes("export") && containsNonTypeExport(fullMatch)) {
1800
+ if (fullMatch.includes("import") && isPureTypeImport(fullMatch) || fullMatch.includes("export") && isPureTypeExport(fullMatch)) {
1801
1801
  continue;
1802
1802
  }
1803
1803
  }
@@ -1805,19 +1805,29 @@ function getImports(code, includeType = false) {
1805
1805
  }
1806
1806
  return Array.from(imports);
1807
1807
  }
1808
- function containsNonTypeImport(importStatement) {
1808
+ function isPureTypeImport(importStatement) {
1809
+ const importTypeRegex = /^\s*import\s+type\b/;
1810
+ if (importTypeRegex.test(importStatement)) {
1811
+ return true;
1812
+ }
1809
1813
  if (importStatement.includes("{")) {
1810
1814
  const braceContent = importStatement.match(/\{([^}]*)\}/)?.[1] || "";
1811
- return braceContent.split(",").some((item) => item.trim() && item.trim().startsWith("type "));
1815
+ const items = braceContent.split(",").map((item) => item.trim()).filter(Boolean);
1816
+ return items.length > 0 && items.every((item) => item.startsWith("type "));
1812
1817
  }
1813
- return importStatement.includes("import type");
1818
+ return false;
1814
1819
  }
1815
- function containsNonTypeExport(exportStatement) {
1820
+ function isPureTypeExport(exportStatement) {
1821
+ const exportTypeRegex = /^\s*export\s+type\b/;
1822
+ if (exportTypeRegex.test(exportStatement)) {
1823
+ return true;
1824
+ }
1816
1825
  if (exportStatement.includes("{")) {
1817
1826
  const braceContent = exportStatement.match(/\{([^}]*)\}/)?.[1] || "";
1818
- return braceContent.split(",").some((item) => item.trim() && item.trim().startsWith("type "));
1827
+ const items = braceContent.split(",").map((item) => item.trim()).filter(Boolean);
1828
+ return items.length > 0 && items.every((item) => item.startsWith("type "));
1819
1829
  }
1820
- return exportStatement.includes("export type");
1830
+ return false;
1821
1831
  }
1822
1832
 
1823
1833
  // packages/utils/index.ts
@@ -2359,16 +2369,6 @@ function getCompoNameObj() {
2359
2369
  }
2360
2370
  return Object.values(componentsObj);
2361
2371
  }
2362
- async function getPropsImport(text, obj2) {
2363
- let ts2 = text;
2364
- if (text) {
2365
- let arr = (await getTestImportUrl(obj2, text)).filter((v) => {
2366
- return isComprops(v.key, obj2.comprops) || isCurprops(v.key, obj2.curprops);
2367
- });
2368
- ts2 = await getPropsTexts(arr) + ts2;
2369
- }
2370
- return ts2;
2371
- }
2372
2372
  function getPropsValue(o) {
2373
2373
  const u = o.url;
2374
2374
  const k = o.key;
@@ -2386,8 +2386,7 @@ function getPropsRaws(arr) {
2386
2386
  } else if (value.getRaw) {
2387
2387
  value.getRaw(value).then(async (s) => {
2388
2388
  const m = getGetRawValue(s);
2389
- let ts2 = await getPropsImport(m, arr[index]);
2390
- value.raw = ts2;
2389
+ value.raw = await getComponentsProps(m, arr[index]);
2391
2390
  value.getRaw = null;
2392
2391
  res();
2393
2392
  });
@@ -2402,23 +2401,30 @@ function getPropsRaws(arr) {
2402
2401
  }
2403
2402
  });
2404
2403
  }
2404
+ var spliceName = "\nfangzhongya@vue-archive@glob@vue-archive@fangzhongya\n";
2405
+ function deduplication(text) {
2406
+ const arr = text.split(spliceName);
2407
+ const qcs = [...new Set(arr)];
2408
+ return qcs.join("\n");
2409
+ }
2405
2410
  async function getPropsTexts(arr) {
2406
2411
  const arrs = await getPropsRaws(arr);
2407
2412
  const sts = arrs?.map((o) => o.raw) || [];
2408
- return sts.join("\n");
2413
+ return sts.filter((o) => Boolean(o)).join(spliceName);
2409
2414
  }
2410
2415
  async function getComponentsProps(text, obj2) {
2411
- let ts2 = text;
2412
2416
  if (text) {
2417
+ text = `/**${obj2.url}**/
2418
+ ` + text;
2413
2419
  if (obj2.comprops || obj2.curprops) {
2414
2420
  let arr = (await getTestImportUrl(obj2, text)).filter((v) => {
2415
2421
  return isComprops(v.key, obj2.comprops) || isCurprops(v.key, obj2.curprops);
2416
2422
  });
2417
- let str = await getPropsTexts(arr);
2418
- ts2 = str + ts2;
2423
+ return text + spliceName + await getPropsTexts(arr);
2419
2424
  }
2425
+ return text;
2420
2426
  }
2421
- return ts2;
2427
+ return "";
2422
2428
  }
2423
2429
  function getGetRawValue(s) {
2424
2430
  if (s && typeof s == "object") {
@@ -2439,7 +2445,8 @@ function getLocalTextComponents(u) {
2439
2445
  } else if (componentObj.getRaw) {
2440
2446
  componentObj.getRaw(componentObj).then((s) => {
2441
2447
  const m = getGetRawValue(s);
2442
- getComponentsProps(m, componentObj).then((text) => {
2448
+ getComponentsProps(m, componentObj).then((texts) => {
2449
+ const text = deduplication(texts);
2443
2450
  componentObj.raw = text;
2444
2451
  componentObj.getRaw = null;
2445
2452
  resolve2(text);
@@ -3205,7 +3212,7 @@ var top_default2 = defineComponent2({
3205
3212
  }
3206
3213
  });
3207
3214
 
3208
- // node_modules/.pnpm/@fangzhongya+utils@0.0.44/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
3215
+ // node_modules/.pnpm/@fangzhongya+utils@0.0.47/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
3209
3216
  var FUNCTION_REGEX = /^\s*(?:(async)\s+)?(?:function\s*(\*?)\s*(\w*)\s*\(([\s\S]*?)\)|(\*?\s*)\b(\w+)\s*\(([\s\S]*?)\)|\(([\s\S]*?)\)|([^=>,\(\)]+?))\s*(?:=>)?\s*(?:\{([\s\S]*?)\}|([\s\S]*))$/;
3210
3217
  function getFunctionFormat(v) {
3211
3218
  if (!v) return;
@@ -1,25 +1,18 @@
1
- import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../vue/dist/vue.esm-bundler.js';
2
- declare const _default: DefineComponent<ExtractPropTypes<{
3
- name: {
4
- type: StringConstructor;
5
- };
6
- html: {
7
- type: StringConstructor;
8
- default(): string;
9
- };
10
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
11
- refresh: (...args: any[]) => void;
12
- }, string, PublicProps, Readonly< ExtractPropTypes<{
13
- name: {
14
- type: StringConstructor;
15
- };
16
- html: {
17
- type: StringConstructor;
18
- default(): string;
19
- };
20
- }>> & Readonly<{
21
- onRefresh?: ((...args: any[]) => any) | undefined;
22
- }>, {
23
- html: string;
24
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
25
- export default _default;
1
+ import { ObjStr, ObjUnk } from '../../config';
2
+ import { SpecObjs, Spec } from '../../utils/index';
3
+ import { DataType } from './util';
4
+ export declare function getHmtl(propsname: string, param: {
5
+ [key: string]: SpecObjs[];
6
+ }, value: ObjUnk, slotValue?: ObjStr, propsText?: ObjStr, exposeText?: ObjUnk): Promise<string>;
7
+ export declare function setValStringify(v: unknown, key: string, propsText?: ObjStr): string | Promise<string>;
8
+ type SelectsObj = {
9
+ label: string;
10
+ prop: unknown;
11
+ };
12
+ export declare function getSpecType(val: Spec): {
13
+ arr: SelectsObj[];
14
+ type: string;
15
+ dataType: DataType[];
16
+ };
17
+ export declare function getDefaultValue(obj: Spec, is?: boolean): any;
18
+ export {};
@@ -1,2 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=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"),A=require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const W=require("@fangzhongya/utils/basic/string/firstLower"),D=require("@fangzhongya/utils/basic/array/duplicateRemoval"),M=require("@fangzhongya/utils/basic/array/asyncMergeArray");require("@fangzhongya/utils/basic/string/firstUpper");const w=require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const J=require("./index.cjs"),h={},R={},I=[],K={},j={},g={};function Q(){return q.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(o=>{s.push(o),j[o]=i[o]});const l=a.examplesRaw,u=[];if(a.urls&&a.urls.length>0?(a.exampless=a.urls,a.urls.forEach(o=>{u.push(o),l&&(g[o]=N(l,o))})):(a.exampless=s,l&&Object.keys(l).forEach(o=>{u.push(o),g[o]=N(l,o)})),a.examples=void 0,e.tests&&r){const o=e.testsNanme||"/tests/";typeof o=="string"?Object.keys(r).forEach(f=>{f.includes(o)&&(a.exampless.push(f),u.push(f),g[f]=N(r,f))}):Object.keys(r).forEach(f=>{o.test(f)&&(a.exampless.push(f),u.push(f),g[f]=N(r,f))})}a.exampless=[...new Set(a.exampless)],a.examplessRaw=[...new Set(u)],a.examplesRaw=void 0,K[t]=a}function N(t,e){return typeof t=="function"?t:t&&(t[e]||t)}const b={};function Y(t){const e=q.getConfig("resolve");if(b[t])return b[t];for(let n of e)if(t.startsWith(n.find+"/")){const a=n.replacement.replaceAll("\\","/")+t.replace(n.find+"/","/");return b[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=C(n);t.raw=r,t.getRaw=null,e(r)}):e(""):e("")})}function U(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 z(t,e,n){t=(t||"")+"",n=(n||"")+"";let r=T.humpToLine(e.name),a=[];t==="1"?e.alias&&a.push(e.alias+"-"+r):t==="3"?e.alias&&e.alias+"":t==="4"?e.aliasNames?.forEach(i=>{a.push(T.humpToLine(i))}):t=="9"&&(a.push(r),e.aliasNames?.forEach(i=>{a.push(T.humpToLine(i))})),a.length==0&&a.push(r);let s=[];return n==="1"?a.forEach(i=>{let l=A.lineToLargeHump(i);s.push(l,W.firstLower(l))}):n==="2"?a.forEach(i=>{let l=A.lineToLargeHump(i);s.push(i,l,W.firstLower(l))}):s=[...a],s=[...new Set(s)],s}function y(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:w.getSuffix(s),name:r.name,value:l,key:s,raw:"",getRaw:c.getRawValue(g,s)});break}}}),a}function P(t){O();const e=h[t];if(e.tests&&Object.keys(e.tests).length>0)return e.tests;{const n=K[e.dir],r=n.dir+U(n.level||0,e),a=z(n.aliaslevel||0,e,n.componentName||0);e.mds=y(r,a,n,e);const s={};return n.exampless.forEach(i=>{for(let l=0;l<a.length;l++){const u=a[l];if(i.startsWith(r+u+"/")){const o=new RegExp("/([^/]+)/index\\."+c.defaultExtensions.join("|")+"$"),f=new RegExp("/([^/]+)\\."+c.defaultExtensions.join("|")+"$");let p=i.match(o)||i.match(f);if(p&&p.length>0){let m="";p&&p.length>1&&(m=p[1]),s[i]={topurl:r,name:u,value:m,suffix:w.getSuffix(i),comname:e.name,comkey:e.key,cwd:n.cwd||e.cwd,key:i,dir:e.dir,url:i,component:j[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:w.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 u=s.match(i)||s.match(l);if(u&&u[1]){let o="";u&&u.length>1&&(o=u[1]),t[s]={topurl:r,name:e.value,value:o,suffix:w.getSuffix(s),comname:e.name,comkey:e.key,cwd:n.cwd||e.cwd,key:s,dir:e.dir,url:s,component:j[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:w.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 u=s.match(i)||s.match(l);if(u&&u.length>0){let o="";u&&u.length>1&&(o=u[1]),t[s]={cwd:n.cwd||e.cwd,topurl:r,name:e.value,value:o,suffix:w.getSuffix(s),comname:e.name,comkey:e.key,key:s,dir:e.dir,url:s,component:j[s],raw:"",getRaw:c.getRawValue(g,s)}}}}})}function ee(t){if(t){const e=P(t);return Object.values(e)}else return[]}function te(t,e,n){O();const r=P(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 P(t),h[t].mds}async function V(t,e,n){let r=t.key,a=t.dir,s=t.url,i=t.comprops,l=t.curprops,u=await Z(e,n||t.suffix)||[],o=s.split("/");return u.map(f=>{if(f.startsWith("./")){let p=o.slice(0,o.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:w.getSuffix(f),head:p,dir:a,url:p+"/"+m}}else if(f.startsWith("../")){let p=f.split("/"),m=0;for(let L=0;L<p.length;L++)if(p[L]!=".."){m=L;break}let d=p.slice(m,p.length),x=o.slice(0,o.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:w.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:w.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:w.getSuffix(r.key),getRaw:c.getRawValue(g,r.key)}));M.asyncMergeArray(n,(r,a,s,i)=>{s.raw?r():s.getRaw?s.getRaw(s).then(l=>{const u=C(l);s.raw=u,s.getRaw=null,r()}):r()}).then(()=>{e(n)})}else e([])})}function re(){const t=Q();q.getConfig("components")?.forEach(n=>{const r=le(n);let a=n.dir||"";X(a,t,n.example,r)})}const $="default";function ae(t){let e=T.humpToLine(t.name),n=[...t.aliasNames];n.push(e),n.forEach(r=>{I.push({name:r,value:t.key})})}function ie(t,e){e?.forEach(n=>{h[n.key]=n,ae(n)})}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||$;let a=t?.urls||Object.keys(t.componentsRaw);return n=c.getComponentsArr(a,t,t.componentsRaw,t.components),n&&n?.props&&n.props.forEach(s=>{R[s.url]=s}),ie(e,n.components),t.componentsRaw}function oe(t){return O(),h[t]}function O(){return Object.keys(h).length==0&&re(),Object.values(h)}function ue(){return O(),R}function fe(t,e,n){O();const r=[];if(n){let s=h[n];if(s&&s.key)return[s]}let a=T.humpToLine(t);return I.forEach(s=>{e?s.name.includes(a)&&r.push(h[s.value]):s.name==a&&r.push(h[s.value])}),D.duplicateRemoval(r,"key")}async function ce(t,e){let n=t;if(t){let r=(await V(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);M.asyncMergeArray(n,(r,a,s,i)=>{s.raw?r():s.getRaw?s.getRaw(s).then(async l=>{const u=C(l);let o=await ce(u,t[i]);s.raw=o,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 V(e,t)).filter(s=>c.isComprops(s.key,e.comprops)||c.isCurprops(s.key,e.curprops));n=await H(r)+n}return n}function C(t){return t&&typeof t=="object"?t.default||"":(t||"")+""}function ge(t){return new Promise(e=>{if(t){O();const n=h[t];n?n.raw?e(n.raw):n.getRaw?n.getRaw(n).then(r=>{const a=C(r);me(a,n).then(s=>{n.raw=s,n.getRaw=null,e(s)})}):e(""):e("")}else e("")})}exports.defaultName=$;exports.getCompoName=fe;exports.getCompoNameKey=oe;exports.getCompoNameObj=O;exports.getComponentPropsObjs=ue;exports.getGetRawValue=C;exports.getKeyMds=se;exports.getLevelUrl=U;exports.getLocalTextArr=ne;exports.getLocalTextComponents=ge;exports.getLocalTextTests=_;exports.getPropsRaws=v;exports.getTestImportUrl=V;exports.getTestName=ee;exports.getTestNameObj=te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../config.cjs"),z=require("@fangzhongya/utils/html/getVueText"),p=require("./common.cjs"),F=require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const T=require("@fangzhongya/utils/name/humpToLine"),v=require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const A=require("@fangzhongya/utils/basic/string/firstLower"),D=require("@fangzhongya/utils/basic/array/duplicateRemoval"),W=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={},M=[],$={},j={},m={};function Q(){return S.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(o=>{s.push(o),j[o]=i[o]});const l=a.examplesRaw,u=[];if(a.urls&&a.urls.length>0?(a.exampless=a.urls,a.urls.forEach(o=>{u.push(o),l&&(m[o]=N(l,o))})):(a.exampless=s,l&&Object.keys(l).forEach(o=>{u.push(o),m[o]=N(l,o)})),a.examples=void 0,e.tests&&r){const o=e.testsNanme||"/tests/";typeof o=="string"?Object.keys(r).forEach(f=>{f.includes(o)&&(a.exampless.push(f),u.push(f),m[f]=N(r,f))}):Object.keys(r).forEach(f=>{o.test(f)&&(a.exampless.push(f),u.push(f),m[f]=N(r,f))})}a.exampless=[...new Set(a.exampless)],a.examplessRaw=[...new Set(u)],a.examplesRaw=void 0,$[t]=a}function N(t,e){return typeof t=="function"?t:t&&(t[e]||t)}const q={};function Y(t){const e=S.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=z.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=C(n);t.raw=r,t.getRaw=null,e(r)}):e(""):e("")})}function K(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=[];t==="1"?e.alias&&a.push(e.alias+"-"+r):t==="3"?e.alias&&e.alias+"":t==="4"?e.aliasNames?.forEach(i=>{a.push(T.humpToLine(i))}):t=="9"&&(a.push(r),e.aliasNames?.forEach(i=>{a.push(T.humpToLine(i))})),a.length==0&&a.push(r);let s=[];return n==="1"?a.forEach(i=>{let l=v.lineToLargeHump(i);s.push(l,A.firstLower(l))}):n==="2"?a.forEach(i=>{let l=v.lineToLargeHump(i);s.push(i,l,A.firstLower(l))}):s=[...a],s=[...new Set(s)],s}function k(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:p.getRawValue(m,s)});break}}}),a}function P(t){O();const e=w[t];if(e.tests&&Object.keys(e.tests).length>0)return e.tests;{const n=$[e.dir],r=n.dir+K(n.level||0,e),a=y(n.aliaslevel||0,e,n.componentName||0);e.mds=k(r,a,n,e);const s={};return n.exampless.forEach(i=>{for(let l=0;l<a.length;l++){const u=a[l];if(i.startsWith(r+u+"/")){const o=new RegExp("/([^/]+)/index\\."+p.defaultExtensions.join("|")+"$"),f=new RegExp("/([^/]+)\\."+p.defaultExtensions.join("|")+"$");let c=i.match(o)||i.match(f);if(c&&c.length>0){let g="";c&&c.length>1&&(g=c[1]),s[i]={topurl:r,name:u,value:g,suffix:h.getSuffix(i),comname:e.name,comkey:e.key,cwd:n.cwd||e.cwd,key:i,dir:e.dir,url:i,component:j[i],raw:"",getRaw:p.getRawValue(m,i)};break}}}}),n.tests&&ee(s,e,n),e.tests=s,s}}function ee(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:p.getRawValue(m,s)});else if(s.startsWith(r+a)){const i=new RegExp("/([^/]+)/index\\."+p.defaultExtensions.join("|")+"$"),l=new RegExp("/([^/]+)\\."+p.defaultExtensions.join("|")+"$");let u=s.match(i)||s.match(l);if(u&&u[1]){let o="";u&&u.length>1&&(o=u[1]),t[s]={topurl:r,name:e.value,value:o,suffix:h.getSuffix(s),comname:e.name,comkey:e.key,cwd:n.cwd||e.cwd,key:s,dir:e.dir,url:s,component:j[s],raw:"",getRaw:p.getRawValue(m,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:p.getRawValue(m,s)});else if(a.test(s)){const i=new RegExp("/([^/]+)/index\\."+p.defaultExtensions.join("|")+"$"),l=new RegExp("/([^/]+)\\."+p.defaultExtensions.join("|")+"$");let u=s.match(i)||s.match(l);if(u&&u.length>0){let o="";u&&u.length>1&&(o=u[1]),t[s]={cwd:n.cwd||e.cwd,topurl:r,name:e.value,value:o,suffix:h.getSuffix(s),comname:e.name,comkey:e.key,key:s,dir:e.dir,url:s,component:j[s],raw:"",getRaw:p.getRawValue(m,s)}}}}})}function te(t){if(t){const e=P(t);return Object.values(e)}else return[]}function se(t,e,n){O();const r=P(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 ne(t){return P(t),w[t].mds}async function U(t,e,n){let r=t.key,a=t.dir,s=t.url,i=t.comprops,l=t.curprops,u=await Z(e,n||t.suffix)||[],o=s.split("/");return u.map(f=>{if(f.startsWith("./")){let c=o.slice(0,o.length-1).join("/"),g=f.substring(2);const d=c.replace(/^\.\/|((\.\.\/)+)/,"/");let x=r.indexOf(d)+d.length;return{key:r.substring(0,x)+"/"+g,name:f,cwd:t.cwd,comprops:i,curprops:l,value:g,suffix:h.getSuffix(f),head:c,dir:a,url:c+"/"+g}}else if(f.startsWith("../")){let c=f.split("/"),g=0;for(let L=0;L<c.length;L++)if(c[L]!=".."){g=L;break}let d=c.slice(g,c.length),x=o.slice(0,o.length-g-1).join("/"),E=d.join("/");const b=x.replace(/^\.\/|((\.\.\/)+)/,"/");let G=r.indexOf(b)+b.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 c=a.replace(/^\.\/|((\.\.\/)+)/,"/");let g=f.indexOf(c)+c.length,d=f.substring(g),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 re(t){return new Promise(e=>{if(t&&t.length>0){let n=t.map(r=>({...r,raw:"",suffix:h.getSuffix(r.key),getRaw:p.getRawValue(m,r.key)}));W.asyncMergeArray(n,(r,a,s,i)=>{s.raw?r():s.getRaw?s.getRaw(s).then(l=>{const u=C(l);s.raw=u,s.getRaw=null,r()}):r()}).then(()=>{e(n)})}else e([])})}function ae(){const t=Q();S.getConfig("components")?.forEach(n=>{const r=oe(n);let a=n.dir||"";X(a,t,n.example,r)})}const I="default";function ie(t){let e=T.humpToLine(t.name),n=[...t.aliasNames];n.push(e),n.forEach(r=>{M.push({name:r,value:t.key})})}function le(t,e){e?.forEach(n=>{w[n.key]=n,ie(n)})}function oe(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||I;let a=t?.urls||Object.keys(t.componentsRaw);return n=p.getComponentsArr(a,t,t.componentsRaw,t.components),n&&n?.props&&n.props.forEach(s=>{R[s.url]=s}),le(e,n.components),t.componentsRaw}function ue(t){return O(),w[t]}function O(){return Object.keys(w).length==0&&ae(),Object.values(w)}function fe(){return O(),R}function ce(t,e,n){O();const r=[];if(n){let s=w[n];if(s&&s.key)return[s]}let a=T.humpToLine(t);return M.forEach(s=>{e?s.name.includes(a)&&r.push(w[s.value]):s.name==a&&r.push(w[s.value])}),D.duplicateRemoval(r,"key")}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 H(t){return new Promise(e=>{if(t&&t.length>0){let n=t.map(r=>pe(r)).filter(r=>!!r);W.asyncMergeArray(n,(r,a,s,i)=>{s.raw?r():s.getRaw?s.getRaw(s).then(async l=>{const u=C(l);s.raw=await B(u,t[i]),s.getRaw=null,r()}):r()}).then(()=>{e(n)})}else e([])})}const V=`
2
+ fangzhongya@vue-archive@glob@vue-archive@fangzhongya
3
+ `;function ge(t){const e=t.split(V);return[...new Set(e)].join(`
4
+ `)}async function me(t){return((await H(t))?.map(r=>r.raw)||[]).filter(r=>!!r).join(V)}async function B(t,e){if(t){if(t=`/**${e.url}**/
5
+ `+t,e.comprops||e.curprops){let n=(await U(e,t)).filter(r=>p.isComprops(r.key,e.comprops)||p.isCurprops(r.key,e.curprops));return t+V+await me(n)}return t}return""}function C(t){return t&&typeof t=="object"?t.default||"":(t||"")+""}function he(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=C(r);B(a,n).then(s=>{const i=ge(s);n.raw=i,n.getRaw=null,e(i)})}):e(""):e("")}else e("")})}exports.defaultName=I;exports.getCompoName=ce;exports.getCompoNameKey=ue;exports.getCompoNameObj=O;exports.getComponentPropsObjs=fe;exports.getGetRawValue=C;exports.getKeyMds=ne;exports.getLevelUrl=K;exports.getLocalTextArr=re;exports.getLocalTextComponents=he;exports.getLocalTextTests=_;exports.getPropsRaws=H;exports.getTestImportUrl=U;exports.getTestName=te;exports.getTestNameObj=se;
@@ -1,50 +1,50 @@
1
- import { getConfig as A } from "../config.js";
2
- import { getVueTexts as H } from "@fangzhongya/utils/html/getVueText";
3
- import { getRawValue as R, isComprops as K, isCurprops as S, getComponentsArr as q, defaultExtensions as E } from "./common.js";
4
- import { mergeObject as D } from "@fangzhongya/utils/basic/object/mergeObject";
1
+ import { getConfig as v } from "../config.js";
2
+ import { getVueTexts as B } from "@fangzhongya/utils/html/getVueText";
3
+ import { getRawValue as R, isComprops as z, isCurprops as F, getComponentsArr as G, defaultExtensions as E } from "./common.js";
4
+ import { mergeObject as H } from "@fangzhongya/utils/basic/object/mergeObject";
5
5
  import "@fangzhongya/utils/basic/array/toggleArray";
6
- import { humpToLine as C } from "@fangzhongya/utils/name/humpToLine";
7
- import { lineToLargeHump as I } from "@fangzhongya/utils/name/lineToLargeHump";
6
+ import { humpToLine as N } from "@fangzhongya/utils/name/humpToLine";
7
+ import { lineToLargeHump as S } from "@fangzhongya/utils/name/lineToLargeHump";
8
8
  import "@fangzhongya/utils/basic/string/appearNum";
9
9
  import { firstLower as V } from "@fangzhongya/utils/basic/string/firstLower";
10
- import { duplicateRemoval as J } from "@fangzhongya/utils/basic/array/duplicateRemoval";
11
- import { asyncMergeArray as U } from "@fangzhongya/utils/basic/array/asyncMergeArray";
10
+ import { duplicateRemoval as D } from "@fangzhongya/utils/basic/array/duplicateRemoval";
11
+ import { asyncMergeArray as I } from "@fangzhongya/utils/basic/array/asyncMergeArray";
12
12
  import "@fangzhongya/utils/basic/string/firstUpper";
13
13
  import { getSuffix as g } from "@fangzhongya/utils/urls/getSuffix";
14
14
  import "@fangzhongya/utils/basic/array/replaceAfter";
15
- import { getTextImport as Q } from "./index.js";
16
- const h = {}, x = {}, M = [], v = {}, P = {}, m = {};
17
- function X() {
18
- return A("example");
15
+ import { getTextImport as J } from "./index.js";
16
+ const h = {}, x = {}, K = [], U = {}, b = {}, m = {};
17
+ function Q() {
18
+ return v("example");
19
19
  }
20
- function Y(t, e, n, r) {
21
- const a = D(e, n || {}, 3, !0);
20
+ function X(t, e, n, r) {
21
+ const a = H(e, n || {}, 3, !0);
22
22
  a.exampless = a.exampless || [], a.examplessRaw = a.examplessRaw || [];
23
23
  const s = [], i = a.examples;
24
24
  i && Object.keys(i).forEach((o) => {
25
- s.push(o), P[o] = i[o];
25
+ s.push(o), b[o] = i[o];
26
26
  });
27
27
  const l = a.examplesRaw, f = [];
28
28
  if (a.urls && a.urls.length > 0 ? (a.exampless = a.urls, a.urls.forEach((o) => {
29
- f.push(o), l && (m[o] = j(l, o));
29
+ f.push(o), l && (m[o] = C(l, o));
30
30
  })) : (a.exampless = s, l && Object.keys(l).forEach((o) => {
31
- f.push(o), m[o] = j(l, o);
31
+ f.push(o), m[o] = C(l, o);
32
32
  })), a.examples = void 0, e.tests && r) {
33
33
  const o = e.testsNanme || "/tests/";
34
34
  typeof o == "string" ? Object.keys(r).forEach((c) => {
35
- c.includes(o) && (a.exampless.push(c), f.push(c), m[c] = j(r, c));
35
+ c.includes(o) && (a.exampless.push(c), f.push(c), m[c] = C(r, c));
36
36
  }) : Object.keys(r).forEach((c) => {
37
- o.test(c) && (a.exampless.push(c), f.push(c), m[c] = j(r, c));
37
+ o.test(c) && (a.exampless.push(c), f.push(c), m[c] = C(r, c));
38
38
  });
39
39
  }
40
- a.exampless = [...new Set(a.exampless)], a.examplessRaw = [...new Set(f)], a.examplesRaw = void 0, v[t] = a;
40
+ a.exampless = [...new Set(a.exampless)], a.examplessRaw = [...new Set(f)], a.examplesRaw = void 0, U[t] = a;
41
41
  }
42
- function j(t, e) {
42
+ function C(t, e) {
43
43
  return typeof t == "function" ? t : t && (t[e] || t);
44
44
  }
45
45
  const L = {};
46
- function Z(t) {
47
- const e = A("resolve");
46
+ function Y(t) {
47
+ const e = v("resolve");
48
48
  if (L[t])
49
49
  return L[t];
50
50
  for (let n of e)
@@ -53,30 +53,30 @@ function Z(t) {
53
53
  return L[t] = a, a;
54
54
  }
55
55
  }
56
- async function _(t, e) {
56
+ async function Z(t, e) {
57
57
  let n = "";
58
- if (e == "vue" ? n = H(t).script : (e == "js" || e == "ts" || e == "") && (n = t), n) {
59
- const r = await Q(n), a = [];
58
+ if (e == "vue" ? n = B(t).script : (e == "js" || e == "ts" || e == "") && (n = t), n) {
59
+ const r = await J(n), a = [];
60
60
  return r && r.length > 0 && r.forEach((s) => {
61
61
  if (s)
62
62
  if (s.startsWith("./") || s.startsWith("../"))
63
63
  a.push(s);
64
64
  else {
65
- const i = Z(s);
65
+ const i = Y(s);
66
66
  i && a.push(i);
67
67
  }
68
68
  }), a;
69
69
  }
70
70
  }
71
- function We(t) {
71
+ function Le(t) {
72
72
  return new Promise((e) => {
73
73
  t ? t.raw ? e(t.raw) : t.getRaw ? t.getRaw(t).then((n) => {
74
- const r = b(n);
74
+ const r = P(n);
75
75
  t.raw = r, t.getRaw = null, e(r);
76
76
  }) : e("") : e("");
77
77
  });
78
78
  }
79
- function z(t, e) {
79
+ function _(t, e) {
80
80
  t = (t || "") + "";
81
81
  let n = "";
82
82
  switch (t) {
@@ -94,18 +94,18 @@ function z(t, e) {
94
94
  }
95
95
  function y(t, e, n) {
96
96
  t = (t || "") + "", n = (n || "") + "";
97
- let r = C(e.name), a = [];
97
+ let r = N(e.name), a = [];
98
98
  t === "1" ? e.alias && a.push(e.alias + "-" + r) : t === "3" ? e.alias && e.alias + "" : t === "4" ? e.aliasNames?.forEach((i) => {
99
- a.push(C(i));
99
+ a.push(N(i));
100
100
  }) : t == "9" && (a.push(r), e.aliasNames?.forEach((i) => {
101
- a.push(C(i));
101
+ a.push(N(i));
102
102
  })), a.length == 0 && a.push(r);
103
103
  let s = [];
104
104
  return n === "1" ? a.forEach((i) => {
105
- let l = I(i);
105
+ let l = S(i);
106
106
  s.push(l, V(l));
107
107
  }) : n === "2" ? a.forEach((i) => {
108
- let l = I(i);
108
+ let l = S(i);
109
109
  s.push(i, l, V(l));
110
110
  }) : s = [...a], s = [...new Set(s)], s;
111
111
  }
@@ -137,7 +137,7 @@ function $(t) {
137
137
  if (e.tests && Object.keys(e.tests).length > 0)
138
138
  return e.tests;
139
139
  {
140
- const n = v[e.dir], r = n.dir + z(n.level || 0, e), a = y(
140
+ const n = U[e.dir], r = n.dir + _(n.level || 0, e), a = y(
141
141
  n.aliaslevel || 0,
142
142
  e,
143
143
  n.componentName || 0
@@ -167,7 +167,7 @@ function $(t) {
167
167
  key: i,
168
168
  dir: e.dir,
169
169
  url: i,
170
- component: P[i],
170
+ component: b[i],
171
171
  raw: "",
172
172
  getRaw: R(m, i)
173
173
  };
@@ -214,7 +214,7 @@ function ee(t, e, n) {
214
214
  key: s,
215
215
  dir: e.dir,
216
216
  url: s,
217
- component: P[s],
217
+ component: b[s],
218
218
  raw: "",
219
219
  getRaw: R(m, s)
220
220
  };
@@ -255,7 +255,7 @@ function ee(t, e, n) {
255
255
  key: s,
256
256
  dir: e.dir,
257
257
  url: s,
258
- component: P[s],
258
+ component: b[s],
259
259
  raw: "",
260
260
  getRaw: R(m, s)
261
261
  };
@@ -264,14 +264,14 @@ function ee(t, e, n) {
264
264
  }
265
265
  });
266
266
  }
267
- function Le(t) {
267
+ function ve(t) {
268
268
  if (t) {
269
269
  const e = $(t);
270
270
  return Object.values(e);
271
271
  } else
272
272
  return [];
273
273
  }
274
- function Ae(t, e, n) {
274
+ function $e(t, e, n) {
275
275
  T();
276
276
  const r = $(n), a = [];
277
277
  if (e) {
@@ -283,11 +283,11 @@ function Ae(t, e, n) {
283
283
  s.name + "/" + s.value == t && a.push(s);
284
284
  }), a;
285
285
  }
286
- function $e(t) {
286
+ function Ae(t) {
287
287
  return $(t), h[t].mds;
288
288
  }
289
- async function B(t, e, n) {
290
- let r = t.key, a = t.dir, s = t.url, i = t.comprops, l = t.curprops, f = await _(e, n || t.suffix) || [], o = s.split("/");
289
+ async function te(t, e, n) {
290
+ let r = t.key, a = t.dir, s = t.url, i = t.comprops, l = t.curprops, f = await Z(e, n || t.suffix) || [], o = s.split("/");
291
291
  return f.map((c) => {
292
292
  if (c.startsWith("./")) {
293
293
  let u = o.slice(0, o.length - 1).join("/"), p = c.substring(2);
@@ -307,16 +307,16 @@ async function B(t, e, n) {
307
307
  };
308
308
  } else if (c.startsWith("../")) {
309
309
  let u = c.split("/"), p = 0;
310
- for (let N = 0; N < u.length; N++)
311
- if (u[N] != "..") {
312
- p = N;
310
+ for (let j = 0; j < u.length; j++)
311
+ if (u[j] != "..") {
312
+ p = j;
313
313
  break;
314
314
  }
315
315
  let w = u.slice(p, u.length), d = o.slice(0, o.length - p - 1).join("/"), O = w.join("/");
316
316
  const W = d.replace(/^\.\/|((\.\.\/)+)/, "/");
317
- let G = r.indexOf(W) + W.length;
317
+ let q = r.indexOf(W) + W.length;
318
318
  return {
319
- key: r.substring(0, G) + "/" + O,
319
+ key: r.substring(0, q) + "/" + O,
320
320
  name: O,
321
321
  cwd: t.cwd,
322
322
  comprops: i,
@@ -345,7 +345,7 @@ async function B(t, e, n) {
345
345
  }
346
346
  });
347
347
  }
348
- function Ie(t) {
348
+ function Se(t) {
349
349
  return new Promise((e) => {
350
350
  if (t && t.length > 0) {
351
351
  let n = t.map((r) => ({
@@ -354,9 +354,9 @@ function Ie(t) {
354
354
  suffix: g(r.key),
355
355
  getRaw: R(m, r.key)
356
356
  }));
357
- U(n, (r, a, s, i) => {
357
+ I(n, (r, a, s, i) => {
358
358
  s.raw ? r() : s.getRaw ? s.getRaw(s).then((l) => {
359
- const f = b(l);
359
+ const f = P(l);
360
360
  s.raw = f, s.getRaw = null, r();
361
361
  }) : r();
362
362
  }).then(() => {
@@ -366,50 +366,50 @@ function Ie(t) {
366
366
  e([]);
367
367
  });
368
368
  }
369
- function te() {
370
- const t = X();
371
- A("components")?.forEach((n) => {
372
- const r = ae(n);
369
+ function se() {
370
+ const t = Q();
371
+ v("components")?.forEach((n) => {
372
+ const r = ie(n);
373
373
  let a = n.dir || "";
374
- Y(a, t, n.example, r);
374
+ X(a, t, n.example, r);
375
375
  });
376
376
  }
377
- const se = "default";
378
- function ne(t) {
379
- let e = C(t.name), n = [...t.aliasNames];
377
+ const ne = "default";
378
+ function re(t) {
379
+ let e = N(t.name), n = [...t.aliasNames];
380
380
  n.push(e), n.forEach((r) => {
381
- M.push({
381
+ K.push({
382
382
  name: r,
383
383
  value: t.key
384
384
  });
385
385
  });
386
386
  }
387
- function re(t, e) {
387
+ function ae(t, e) {
388
388
  e?.forEach((n) => {
389
- h[n.key] = n, ne(n);
389
+ h[n.key] = n, re(n);
390
390
  });
391
391
  }
392
- function ae(t) {
392
+ function ie(t) {
393
393
  let e, n;
394
394
  const r = t.resolver;
395
395
  r && Object.keys(r).forEach((s) => {
396
396
  typeof t[s] > "u" && (t[s] = r[s]);
397
- }), e = t.alias || se;
397
+ }), e = t.alias || ne;
398
398
  let a = t?.urls || Object.keys(t.componentsRaw);
399
- return n = q(a, t, t.componentsRaw, t.components), n && n?.props && n.props.forEach((s) => {
399
+ return n = G(a, t, t.componentsRaw, t.components), n && n?.props && n.props.forEach((s) => {
400
400
  x[s.url] = s;
401
- }), re(e, n.components), t.componentsRaw;
401
+ }), ae(e, n.components), t.componentsRaw;
402
402
  }
403
403
  function Ve(t) {
404
404
  return T(), h[t];
405
405
  }
406
406
  function T() {
407
- return Object.keys(h).length == 0 && te(), Object.values(h);
407
+ return Object.keys(h).length == 0 && se(), Object.values(h);
408
408
  }
409
- function Ke() {
409
+ function Ie() {
410
410
  return T(), x;
411
411
  }
412
- function Se(t, e, n) {
412
+ function Ke(t, e, n) {
413
413
  T();
414
414
  const r = [];
415
415
  if (n) {
@@ -417,18 +417,10 @@ function Se(t, e, n) {
417
417
  if (s && s.key)
418
418
  return [s];
419
419
  }
420
- let a = C(t);
421
- return M.forEach((s) => {
420
+ let a = N(t);
421
+ return K.forEach((s) => {
422
422
  e ? s.name.includes(a) && r.push(h[s.value]) : s.name == a && r.push(h[s.value]);
423
- }), J(r, "key");
424
- }
425
- async function ie(t, e) {
426
- let n = t;
427
- if (t) {
428
- let r = (await B(e, t)).filter((a) => K(a.key, e.comprops) || S(a.key, e.curprops));
429
- n = await F(r) + n;
430
- }
431
- return n;
423
+ }), D(r, "key");
432
424
  }
433
425
  function le(t) {
434
426
  const e = t.url, n = t.key;
@@ -438,11 +430,10 @@ function oe(t) {
438
430
  return new Promise((e) => {
439
431
  if (t && t.length > 0) {
440
432
  let n = t.map((r) => le(r)).filter((r) => !!r);
441
- U(n, (r, a, s, i) => {
433
+ I(n, (r, a, s, i) => {
442
434
  s.raw ? r() : s.getRaw ? s.getRaw(s).then(async (l) => {
443
- const f = b(l);
444
- let o = await ie(f, t[i]);
445
- s.raw = o, s.getRaw = null, r();
435
+ const f = P(l);
436
+ s.raw = await M(f, t[i]), s.getRaw = null, r();
446
437
  }) : r();
447
438
  }).then(() => {
448
439
  e(n);
@@ -451,19 +442,29 @@ function oe(t) {
451
442
  e([]);
452
443
  });
453
444
  }
454
- async function F(t) {
455
- return ((await oe(t))?.map((r) => r.raw) || []).join(`
445
+ const A = `
446
+ fangzhongya@vue-archive@glob@vue-archive@fangzhongya
447
+ `;
448
+ function fe(t) {
449
+ const e = t.split(A);
450
+ return [...new Set(e)].join(`
456
451
  `);
457
452
  }
458
- async function fe(t, e) {
459
- let n = t;
460
- if (t && (e.comprops || e.curprops)) {
461
- let r = (await B(e, t)).filter((s) => K(s.key, e.comprops) || S(s.key, e.curprops));
462
- n = await F(r) + n;
453
+ async function ce(t) {
454
+ return ((await oe(t))?.map((r) => r.raw) || []).filter((r) => !!r).join(A);
455
+ }
456
+ async function M(t, e) {
457
+ if (t) {
458
+ if (t = `/**${e.url}**/
459
+ ` + t, e.comprops || e.curprops) {
460
+ let n = (await te(e, t)).filter((r) => z(r.key, e.comprops) || F(r.key, e.curprops));
461
+ return t + A + await ce(n);
462
+ }
463
+ return t;
463
464
  }
464
- return n;
465
+ return "";
465
466
  }
466
- function b(t) {
467
+ function P(t) {
467
468
  return t && typeof t == "object" ? t.default || "" : (t || "") + "";
468
469
  }
469
470
  function Ue(t) {
@@ -472,9 +473,10 @@ function Ue(t) {
472
473
  T();
473
474
  const n = h[t];
474
475
  n ? n.raw ? e(n.raw) : n.getRaw ? n.getRaw(n).then((r) => {
475
- const a = b(r);
476
- fe(a, n).then((s) => {
477
- n.raw = s, n.getRaw = null, e(s);
476
+ const a = P(r);
477
+ M(a, n).then((s) => {
478
+ const i = fe(s);
479
+ n.raw = i, n.getRaw = null, e(i);
478
480
  });
479
481
  }) : e("") : e("");
480
482
  } else
@@ -482,19 +484,19 @@ function Ue(t) {
482
484
  });
483
485
  }
484
486
  export {
485
- se as defaultName,
486
- Se as getCompoName,
487
+ ne as defaultName,
488
+ Ke as getCompoName,
487
489
  Ve as getCompoNameKey,
488
490
  T as getCompoNameObj,
489
- Ke as getComponentPropsObjs,
490
- b as getGetRawValue,
491
- $e as getKeyMds,
492
- z as getLevelUrl,
493
- Ie as getLocalTextArr,
491
+ Ie as getComponentPropsObjs,
492
+ P as getGetRawValue,
493
+ Ae as getKeyMds,
494
+ _ as getLevelUrl,
495
+ Se as getLocalTextArr,
494
496
  Ue as getLocalTextComponents,
495
- We as getLocalTextTests,
497
+ Le as getLocalTextTests,
496
498
  oe as getPropsRaws,
497
- B as getTestImportUrl,
498
- Le as getTestName,
499
- Ae as getTestNameObj
499
+ te as getTestImportUrl,
500
+ ve as getTestName,
501
+ $e as getTestNameObj
500
502
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.97",
4
+ "version": "0.1.1",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",
@@ -26,10 +26,10 @@
26
26
  "@codemirror/state": "^6.5.2",
27
27
  "@codemirror/view": "^6.38.6",
28
28
  "@fangzhongya/create": "0.2.41",
29
- "@fangzhongya/utils": "0.0.44",
29
+ "@fangzhongya/utils": "0.0.47",
30
30
  "@fangzhongya/vue-components": "0.1.20",
31
31
  "@highlightjs/vue-plugin": "^2.1.0",
32
- "@types/node": "^24.10.0",
32
+ "@types/node": "^24.10.1",
33
33
  "@vitejs/plugin-vue": "^6.0.1",
34
34
  "@vue/compiler-dom": "3.5.24",
35
35
  "@vue/compiler-sfc": "3.5.24",
@@ -38,9 +38,9 @@
38
38
  "@vue/shared": "3.5.24",
39
39
  "codemirror": "^6.0.2",
40
40
  "fast-glob": "^3.3.3",
41
- "sass": "^1.93.3",
41
+ "sass": "^1.94.0",
42
42
  "ts-node": "^10.9.2",
43
- "tsup": "^8.5.0",
43
+ "tsup": "^8.5.1",
44
44
  "typescript": "^5.9.3",
45
45
  "unplugin-vue-components": "^30.0.0",
46
46
  "vite": "^7.2.2",