@fangzhongya/vue-archive 0.1.3 → 0.1.4
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/node/index.cjs +104 -19
- package/dist/node/index.js +104 -19
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1 -1
- package/dist/packages/components/use/code.cjs +5 -5
- package/dist/packages/components/use/code.js +25 -26
- package/dist/packages/components/use/retrie/input/editor/editor.d.ts +0 -49
- package/dist/packages/components/use/util.cjs +3 -3
- package/dist/packages/components/use/util.d.ts +1 -0
- package/dist/packages/components/use/util.js +166 -79
- package/package.json +11 -11
package/dist/node/index.cjs
CHANGED
|
@@ -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.
|
|
90
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
95
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
111
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
135
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
140
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
849
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
|
|
850
850
|
var zObj = {
|
|
851
851
|
"<": "<",
|
|
852
852
|
">": ">",
|
|
@@ -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.
|
|
870
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
924
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
971
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
993
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
998
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1022
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1032
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1052
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1715
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1807
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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();
|
|
@@ -3230,7 +3230,7 @@ var top_default2 = (0, import_vue2.defineComponent)({
|
|
|
3230
3230
|
}
|
|
3231
3231
|
});
|
|
3232
3232
|
|
|
3233
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
3233
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
|
|
3234
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]*))$/;
|
|
3235
3235
|
function getFunctionFormat(v) {
|
|
3236
3236
|
if (!v) return;
|
|
@@ -3569,9 +3569,94 @@ function getTypeValue(arr) {
|
|
|
3569
3569
|
return "undefined";
|
|
3570
3570
|
}
|
|
3571
3571
|
}
|
|
3572
|
+
var allReservedWords = [
|
|
3573
|
+
// JavaScript 基本关键字
|
|
3574
|
+
"break",
|
|
3575
|
+
"case",
|
|
3576
|
+
"catch",
|
|
3577
|
+
"class",
|
|
3578
|
+
"const",
|
|
3579
|
+
"continue",
|
|
3580
|
+
"debugger",
|
|
3581
|
+
"default",
|
|
3582
|
+
"delete",
|
|
3583
|
+
"do",
|
|
3584
|
+
"else",
|
|
3585
|
+
"export",
|
|
3586
|
+
"extends",
|
|
3587
|
+
"finally",
|
|
3588
|
+
"for",
|
|
3589
|
+
"function",
|
|
3590
|
+
"if",
|
|
3591
|
+
"import",
|
|
3592
|
+
"in",
|
|
3593
|
+
"instanceof",
|
|
3594
|
+
"new",
|
|
3595
|
+
"return",
|
|
3596
|
+
"super",
|
|
3597
|
+
"switch",
|
|
3598
|
+
"this",
|
|
3599
|
+
"throw",
|
|
3600
|
+
"try",
|
|
3601
|
+
"typeof",
|
|
3602
|
+
"var",
|
|
3603
|
+
"void",
|
|
3604
|
+
"while",
|
|
3605
|
+
"with",
|
|
3606
|
+
"yield",
|
|
3607
|
+
// 严格模式下的保留字
|
|
3608
|
+
"implements",
|
|
3609
|
+
"interface",
|
|
3610
|
+
"let",
|
|
3611
|
+
"package",
|
|
3612
|
+
"private",
|
|
3613
|
+
"protected",
|
|
3614
|
+
"public",
|
|
3615
|
+
"static",
|
|
3616
|
+
// 字面量值
|
|
3617
|
+
"true",
|
|
3618
|
+
"false",
|
|
3619
|
+
"null",
|
|
3620
|
+
"undefined",
|
|
3621
|
+
// TypeScript 特有类型关键字
|
|
3622
|
+
"any",
|
|
3623
|
+
"boolean",
|
|
3624
|
+
"number",
|
|
3625
|
+
"string",
|
|
3626
|
+
"object",
|
|
3627
|
+
"symbol",
|
|
3628
|
+
"unknown",
|
|
3629
|
+
"never",
|
|
3630
|
+
"void",
|
|
3631
|
+
"undefined",
|
|
3632
|
+
"null",
|
|
3633
|
+
// TypeScript 类型操作与定义
|
|
3634
|
+
"type",
|
|
3635
|
+
"interface",
|
|
3636
|
+
"enum",
|
|
3637
|
+
"as",
|
|
3638
|
+
"is",
|
|
3639
|
+
"infer",
|
|
3640
|
+
"unique",
|
|
3641
|
+
// TypeScript 类修饰符
|
|
3642
|
+
"abstract",
|
|
3643
|
+
"readonly",
|
|
3644
|
+
// TypeScript 模块与声明
|
|
3645
|
+
"namespace",
|
|
3646
|
+
"module",
|
|
3647
|
+
"declare",
|
|
3648
|
+
"require",
|
|
3649
|
+
// 其他(访问器、未来保留字等)
|
|
3650
|
+
"get",
|
|
3651
|
+
"set",
|
|
3652
|
+
"async",
|
|
3653
|
+
"await",
|
|
3654
|
+
"from",
|
|
3655
|
+
"of",
|
|
3656
|
+
"package"
|
|
3657
|
+
];
|
|
3572
3658
|
|
|
3573
3659
|
// packages/components/use/code.ts
|
|
3574
|
-
var keywords = ["class"];
|
|
3575
3660
|
function getSpecObjs(specs, name) {
|
|
3576
3661
|
return specs.filter((o) => o.name == name)[0];
|
|
3577
3662
|
}
|
|
@@ -3627,7 +3712,7 @@ async function getHmtl(propsname, param, value, slotValue, propsText, exposeText
|
|
|
3627
3712
|
sarr.push("}");
|
|
3628
3713
|
} else {
|
|
3629
3714
|
let z = key;
|
|
3630
|
-
if (
|
|
3715
|
+
if (allReservedWords.includes(key)) {
|
|
3631
3716
|
z = key + "1";
|
|
3632
3717
|
}
|
|
3633
3718
|
tarr.push(" :" + key + '="' + z + '"');
|
package/dist/node/index.js
CHANGED
|
@@ -58,12 +58,12 @@ var init_prettier = __esm({
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
61
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
66
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
82
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
106
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
111
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
831
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
|
|
832
832
|
var zObj = {
|
|
833
833
|
"<": "<",
|
|
834
834
|
">": ">",
|
|
@@ -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.
|
|
852
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
906
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
953
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
975
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
980
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1004
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1014
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1034
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1697
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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.
|
|
1789
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/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();
|
|
@@ -3212,7 +3212,7 @@ var top_default2 = defineComponent2({
|
|
|
3212
3212
|
}
|
|
3213
3213
|
});
|
|
3214
3214
|
|
|
3215
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
3215
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.59/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
|
|
3216
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]*))$/;
|
|
3217
3217
|
function getFunctionFormat(v) {
|
|
3218
3218
|
if (!v) return;
|
|
@@ -3551,9 +3551,94 @@ function getTypeValue(arr) {
|
|
|
3551
3551
|
return "undefined";
|
|
3552
3552
|
}
|
|
3553
3553
|
}
|
|
3554
|
+
var allReservedWords = [
|
|
3555
|
+
// JavaScript 基本关键字
|
|
3556
|
+
"break",
|
|
3557
|
+
"case",
|
|
3558
|
+
"catch",
|
|
3559
|
+
"class",
|
|
3560
|
+
"const",
|
|
3561
|
+
"continue",
|
|
3562
|
+
"debugger",
|
|
3563
|
+
"default",
|
|
3564
|
+
"delete",
|
|
3565
|
+
"do",
|
|
3566
|
+
"else",
|
|
3567
|
+
"export",
|
|
3568
|
+
"extends",
|
|
3569
|
+
"finally",
|
|
3570
|
+
"for",
|
|
3571
|
+
"function",
|
|
3572
|
+
"if",
|
|
3573
|
+
"import",
|
|
3574
|
+
"in",
|
|
3575
|
+
"instanceof",
|
|
3576
|
+
"new",
|
|
3577
|
+
"return",
|
|
3578
|
+
"super",
|
|
3579
|
+
"switch",
|
|
3580
|
+
"this",
|
|
3581
|
+
"throw",
|
|
3582
|
+
"try",
|
|
3583
|
+
"typeof",
|
|
3584
|
+
"var",
|
|
3585
|
+
"void",
|
|
3586
|
+
"while",
|
|
3587
|
+
"with",
|
|
3588
|
+
"yield",
|
|
3589
|
+
// 严格模式下的保留字
|
|
3590
|
+
"implements",
|
|
3591
|
+
"interface",
|
|
3592
|
+
"let",
|
|
3593
|
+
"package",
|
|
3594
|
+
"private",
|
|
3595
|
+
"protected",
|
|
3596
|
+
"public",
|
|
3597
|
+
"static",
|
|
3598
|
+
// 字面量值
|
|
3599
|
+
"true",
|
|
3600
|
+
"false",
|
|
3601
|
+
"null",
|
|
3602
|
+
"undefined",
|
|
3603
|
+
// TypeScript 特有类型关键字
|
|
3604
|
+
"any",
|
|
3605
|
+
"boolean",
|
|
3606
|
+
"number",
|
|
3607
|
+
"string",
|
|
3608
|
+
"object",
|
|
3609
|
+
"symbol",
|
|
3610
|
+
"unknown",
|
|
3611
|
+
"never",
|
|
3612
|
+
"void",
|
|
3613
|
+
"undefined",
|
|
3614
|
+
"null",
|
|
3615
|
+
// TypeScript 类型操作与定义
|
|
3616
|
+
"type",
|
|
3617
|
+
"interface",
|
|
3618
|
+
"enum",
|
|
3619
|
+
"as",
|
|
3620
|
+
"is",
|
|
3621
|
+
"infer",
|
|
3622
|
+
"unique",
|
|
3623
|
+
// TypeScript 类修饰符
|
|
3624
|
+
"abstract",
|
|
3625
|
+
"readonly",
|
|
3626
|
+
// TypeScript 模块与声明
|
|
3627
|
+
"namespace",
|
|
3628
|
+
"module",
|
|
3629
|
+
"declare",
|
|
3630
|
+
"require",
|
|
3631
|
+
// 其他(访问器、未来保留字等)
|
|
3632
|
+
"get",
|
|
3633
|
+
"set",
|
|
3634
|
+
"async",
|
|
3635
|
+
"await",
|
|
3636
|
+
"from",
|
|
3637
|
+
"of",
|
|
3638
|
+
"package"
|
|
3639
|
+
];
|
|
3554
3640
|
|
|
3555
3641
|
// packages/components/use/code.ts
|
|
3556
|
-
var keywords = ["class"];
|
|
3557
3642
|
function getSpecObjs(specs, name) {
|
|
3558
3643
|
return specs.filter((o) => o.name == name)[0];
|
|
3559
3644
|
}
|
|
@@ -3609,7 +3694,7 @@ async function getHmtl(propsname, param, value, slotValue, propsText, exposeText
|
|
|
3609
3694
|
sarr.push("}");
|
|
3610
3695
|
} else {
|
|
3611
3696
|
let z = key;
|
|
3612
|
-
if (
|
|
3697
|
+
if (allReservedWords.includes(key)) {
|
|
3613
3698
|
z = key + "1";
|
|
3614
3699
|
}
|
|
3615
3700
|
tarr.push(" :" + key + '="' + z + '"');
|
|
@@ -646,7 +646,7 @@ function zt() {
|
|
|
646
646
|
super(t), this.name = "HTMLInjectionError", this.html = i;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
const Q = ae, Oe = T, Re = Symbol("nomatch"), yt = 7, ye = function(e) {
|
|
649
|
+
const Q = ae, Oe = T, Re = /* @__PURE__ */ Symbol("nomatch"), yt = 7, ye = function(e) {
|
|
650
650
|
const t = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null), u = [];
|
|
651
651
|
let b = !0;
|
|
652
652
|
const _ = "Could not find the language '{}', did you forget to load/include a language module?", c = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const N=require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const A=require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const N=require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const A=require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const v=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const o=require("./util.cjs"),S=require("../../utils/props.cjs"),C=require("@fangzhongya/utils/basic/string/toFunction");function q(e,n){return e.filter(t=>t.name==n)[0]}function x(e){return e.map(n=>(n.prop||"...arr")+":"+o.setDataType(n.dataType)).join(",")}async function M(e,n,t,s,u,y){const g=[],r=[];let T=!0;const B=S.getPropsValue(n.propss||[]),H=S.getEmitsValue(n.emitss||[]),U=S.getExposeValue(n.exposes||[]),z=S.getSlotValue(n.slots||[]);Object.keys(t).forEach(async i=>{let a=t[i];if(/^on[A-Z]/.test(i)&&typeof a=="function"){let c=i.substring(2);const f=i.split(":");let l;if(f.length>1?(l=f[0]+f.slice(1).map(m=>v.firstUpper(m)).join(""),c=A.firstLower(c)):(l=f[0],c=N.humpToLine(c)),f.includes("-")){let m=l.split("-");m=m.map((h,D)=>D!=0?v.firstUpper(h):h),l=m.join("")}g.push(" @"+c+'="'+l+'"');const p=q(H,c)||{},d=p.selectable||"",b=o.parseParamString(d),$=x(b);r.push(`// ${p.description} ${p.name}: (${p.selectable})`),r.push("function "+l+"("+$+") {"),b.forEach(m=>{const h=m.name||"arr";r.push(" console.log('"+m.label+"', "+h+")")}),r.push("}")}else{let c=i;o.allReservedWords.includes(i)&&(c=i+"1"),g.push(" :"+i+'="'+c+'"');const f=q(B,i)||{},l=w(f);if(r.push(`// ${f.description} ${f.name}: {${f.type}} (${f.selectable})`),typeof a=="function"||l.dataType.length==1&&l.type=="function"&&a)r.push("const "+i+" = "+await L(a,i,u));else if(T&&(T=!1,r.unshift("import { ref } from 'vue';")),typeof a>"u")if(l.type=="function"){const p=W(f);r.push("const "+c+" = "+p+";")}else{const p=o.getTypeValue(l.dataType);r.push("const "+c+" = ref("+(p==="undefined"?"":p)+");")}else{let p=E(a,i,u);r.push("const "+c+" = ref("+p+");")}}});const P=Object.values(y||{});P.length>0&&(T&&(T=!1,r.unshift("import { ref } from 'vue';")),g.unshift(' ref="refDom"'),r.push("const refDom = ref()"),P.forEach(i=>{const a=q(U,i.name)||{};r.push(`// ${a.description} ${a.name}:(${a.selectable}) ${a.type}`);const c=i.name+"Value",f=o.parseParamString(a?.selectable||""),l=[],p=i.params||[];f.forEach((d,b)=>{const $=d.name;if($){const m=$+i.name,h=p[b];if(r.push(`// ${d.label}`),typeof h=="function")r.push("const "+m+" = "+L(h,$,i.text));else if(typeof h>"u")r.push("const "+m+" = "+o.getTypeValue(d.dataType)+";");else{let D=E(h,$,i.text);r.push("const "+m+" = "+D+";")}l.push(m)}}),i.type==="function"?(a.return?r.push(`const ${c} = refDom.value?.${i.name}(${l.join(", ")})`):r.push(`refDom.value?.${i.name}(${l.join(", ")})`),a.return&&r.push(`console.log('${a.return}', ${c})`)):(r.push(`const ${c} = refDom.value?.${i.name}`),r.push(`console.log('${a.type||a.name}', ${c})`))})),g.length>0&&g.unshift("");const J=R(s,z);let V=`<template>
|
|
2
2
|
<div>
|
|
3
3
|
<${e}${g.join(`
|
|
4
4
|
`)}>${J.join(`
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
${V}
|
|
11
11
|
<script lang="ts" setup>
|
|
12
12
|
${j}
|
|
13
|
-
<\/script>`}function
|
|
13
|
+
<\/script>`}function R(e={},n){const t=[];return Object.keys(e).forEach(s=>{const u=q(n,s)||{},y=e[s];if(y){const g=` <!-- ${u.description} ${u.name}:(${u.selectable}) -->
|
|
14
14
|
<template #${s}="scope">
|
|
15
15
|
${o.vueFormat(y," ")}
|
|
16
|
-
</template>`;t.push(g)}}),t&&t.length>0&&t.unshift(""),t}function
|
|
16
|
+
</template>`;t.push(g)}}),t&&t.length>0&&t.unshift(""),t}function L(e,n,t){const s=t?t[n]:"";return s&&(s.includes("=>")||s.includes("function"))?s:F(e.toString())}async function F(e){const n=C.getFunctionFormat(e);if(n){let t=`{
|
|
17
17
|
${o.vueFormat(o.getFunBody(n.body)," ")}
|
|
18
|
-
}`;return`function (${n.param.split(",").map(s=>s+":any").join(",")}) ${t}`}else return"undefined"}function
|
|
18
|
+
}`;return`function (${n.param.split(",").map(s=>s+":any").join(",")}) ${t}`}else return"undefined"}function W(e){const n=o.parseParamString(e.selectable),t=x(n);let s="";e.return&&(s="return ");let u=`{
|
|
19
19
|
${o.vueFormat(o.getFunBody(s)," ")}
|
|
20
|
-
}`;return`function (${t}) ${u}`}function
|
|
20
|
+
}`;return`function (${t}) ${u}`}function Z(e){const n=e.trim();return/^\(/.test(n)?F(n):JSON.stringify(e)}function E(e,n,t){const s=t?t[n]:"";return s||(typeof e=="string"?Z(e+""):JSON.stringify(e))}function w(e){let n=o.getDataType(o.parseTypeDefinition(e?.type)),t=o.getDataTypeType(n);n.length>1&&(t="any");let s=(e?.selectable||"").trim(),u=[];return s&&t!="boolean"&&(s.includes("|")?s.split("|").forEach(y=>{if(y){let g=y.split(":");u.push({label:y,prop:O(g[0].trim())})}}):u=o.parseParamString(s),t=="array"?t="choice":t!="function"&&u.length>1&&(t="select")),{arr:u,type:t,dataType:n}}function O(e,n){try{if(n=="function")if(typeof e=="string"){if(/^\((.|\n|\r)*\)$/.test(e))return e=e.substring(1,e.length-1),new Function(`{ return ${e} }`)()}else return e;else return new Function(`{ return ${e} }`)()}catch{return""+e}}function G(e,n=!0){const t=w(e),s=o.getTypeValue(t.dataType);if(n){const u=(e.default||"").trim();return O(u||s,o.getDataTypeType(t.dataType))}else{const u=(e.default||"").trim();return O(u,o.getDataTypeType(t.dataType))}}exports.getDefaultValue=G;exports.getHmtl=M;exports.getSpecType=w;exports.setValStringify=E;
|
|
@@ -1,48 +1,47 @@
|
|
|
1
1
|
import "@fangzhongya/utils/basic/object/mergeObject";
|
|
2
2
|
import "@fangzhongya/utils/basic/array/toggleArray";
|
|
3
|
-
import { humpToLine as
|
|
3
|
+
import { humpToLine as W } from "@fangzhongya/utils/name/humpToLine";
|
|
4
4
|
import "@fangzhongya/utils/name/lineToLargeHump";
|
|
5
5
|
import "@fangzhongya/utils/basic/string/appearNum";
|
|
6
|
-
import { firstLower as
|
|
6
|
+
import { firstLower as Z } from "@fangzhongya/utils/basic/string/firstLower";
|
|
7
7
|
import "@fangzhongya/utils/basic/array/duplicateRemoval";
|
|
8
8
|
import "@fangzhongya/utils/basic/array/asyncMergeArray";
|
|
9
9
|
import { firstUpper as z } from "@fangzhongya/utils/basic/string/firstUpper";
|
|
10
10
|
import "@fangzhongya/utils/urls/getSuffix";
|
|
11
11
|
import "@fangzhongya/utils/basic/array/replaceAfter";
|
|
12
|
-
import { getTypeValue as E, getDataTypeType as F, parseParamString as j, prettierHtml as
|
|
13
|
-
import { getPropsValue as
|
|
14
|
-
import { getFunctionFormat as
|
|
15
|
-
const tt = ["class"];
|
|
12
|
+
import { getTypeValue as E, getDataTypeType as F, parseParamString as j, prettierHtml as q, prettierTs as G, getDataType as I, parseTypeDefinition as K, setDataType as M, vueFormat as x, getFunBody as J, allReservedWords as Q } from "./util.js";
|
|
13
|
+
import { getPropsValue as X, getEmitsValue as Y, getExposeValue as _, getSlotValue as k } from "../../utils/props.js";
|
|
14
|
+
import { getFunctionFormat as tt } from "@fangzhongya/utils/basic/string/toFunction";
|
|
16
15
|
function T(t, n) {
|
|
17
16
|
return t.filter((e) => e.name == n)[0];
|
|
18
17
|
}
|
|
19
18
|
function L(t) {
|
|
20
|
-
return t.map((n) => (n.prop || "...arr") + ":" +
|
|
19
|
+
return t.map((n) => (n.prop || "...arr") + ":" + M(n.dataType)).join(",");
|
|
21
20
|
}
|
|
22
21
|
async function bt(t, n, e, s, i, $) {
|
|
23
22
|
const m = [], r = [];
|
|
24
23
|
let d = !0;
|
|
25
|
-
const
|
|
24
|
+
const v = X(n.propss || []), A = Y(n.emitss || []), C = _(n.exposes || []), R = k(n.slots || []);
|
|
26
25
|
Object.keys(e).forEach(async (o) => {
|
|
27
26
|
let c = e[o];
|
|
28
27
|
if (/^on[A-Z]/.test(o) && typeof c == "function") {
|
|
29
28
|
let u = o.substring(2);
|
|
30
29
|
const a = o.split(":");
|
|
31
30
|
let l;
|
|
32
|
-
if (a.length > 1 ? (l = a[0] + a.slice(1).map((p) => z(p)).join(""), u =
|
|
31
|
+
if (a.length > 1 ? (l = a[0] + a.slice(1).map((p) => z(p)).join(""), u = Z(u)) : (l = a[0], u = W(u)), a.includes("-")) {
|
|
33
32
|
let p = l.split("-");
|
|
34
33
|
p = p.map((h, V) => V != 0 ? z(h) : h), l = p.join("");
|
|
35
34
|
}
|
|
36
35
|
m.push(" @" + u + '="' + l + '"');
|
|
37
|
-
const f = T(
|
|
36
|
+
const f = T(A, u) || {}, y = f.selectable || "", b = j(y), g = L(b);
|
|
38
37
|
r.push(`// ${f.description} ${f.name}: (${f.selectable})`), r.push("function " + l + "(" + g + ") {"), b.forEach((p) => {
|
|
39
38
|
const h = p.name || "arr";
|
|
40
39
|
r.push(" console.log('" + p.label + "', " + h + ")");
|
|
41
40
|
}), r.push("}");
|
|
42
41
|
} else {
|
|
43
42
|
let u = o;
|
|
44
|
-
|
|
45
|
-
const a = T(
|
|
43
|
+
Q.includes(o) && (u = o + "1"), m.push(" :" + o + '="' + u + '"');
|
|
44
|
+
const a = T(v, o) || {}, l = N(a);
|
|
46
45
|
if (r.push(
|
|
47
46
|
`// ${a.description} ${a.name}: {${a.type}} (${a.selectable})`
|
|
48
47
|
), typeof c == "function" || l.dataType.length == 1 && l.type == "function" && c)
|
|
@@ -71,7 +70,7 @@ async function bt(t, n, e, s, i, $) {
|
|
|
71
70
|
});
|
|
72
71
|
const P = Object.values($ || {});
|
|
73
72
|
P.length > 0 && (d && (d = !1, r.unshift("import { ref } from 'vue';")), m.unshift(' ref="refDom"'), r.push("const refDom = ref()"), P.forEach((o) => {
|
|
74
|
-
const c = T(
|
|
73
|
+
const c = T(C, o.name) || {};
|
|
75
74
|
r.push(
|
|
76
75
|
`// ${c.description} ${c.name}:(${c.selectable}) ${c.type}`
|
|
77
76
|
);
|
|
@@ -100,19 +99,19 @@ async function bt(t, n, e, s, i, $) {
|
|
|
100
99
|
)})`
|
|
101
100
|
) : r.push(`refDom.value?.${o.name}(${l.join(", ")})`), c.return && r.push(`console.log('${c.return}', ${u})`)) : (r.push(`const ${u} = refDom.value?.${o.name}`), r.push(`console.log('${c.type || c.name}', ${u})`));
|
|
102
101
|
})), m.length > 0 && m.unshift("");
|
|
103
|
-
const
|
|
102
|
+
const U = et(s, R);
|
|
104
103
|
let S = `<template>
|
|
105
104
|
<div>
|
|
106
105
|
<${t}${m.join(`
|
|
107
|
-
`)}>${
|
|
106
|
+
`)}>${U.join(`
|
|
108
107
|
`)}
|
|
109
108
|
</${t}>
|
|
110
109
|
</div>
|
|
111
110
|
</template>`;
|
|
112
|
-
S = await
|
|
111
|
+
S = await q(S);
|
|
113
112
|
let D = r.join(`
|
|
114
113
|
`);
|
|
115
|
-
return D = await
|
|
114
|
+
return D = await G(D), `<!--${t}-->
|
|
116
115
|
${S}
|
|
117
116
|
<script lang="ts" setup>
|
|
118
117
|
${D}
|
|
@@ -133,10 +132,10 @@ ${x($, " ")}
|
|
|
133
132
|
}
|
|
134
133
|
function B(t, n, e) {
|
|
135
134
|
const s = e ? e[n] : "";
|
|
136
|
-
return s && (s.includes("=>") || s.includes("function")) ? s :
|
|
135
|
+
return s && (s.includes("=>") || s.includes("function")) ? s : O(t.toString());
|
|
137
136
|
}
|
|
138
|
-
async function
|
|
139
|
-
const n =
|
|
137
|
+
async function O(t) {
|
|
138
|
+
const n = tt(t);
|
|
140
139
|
if (n) {
|
|
141
140
|
let e = `{
|
|
142
141
|
${x(J(n.body), " ")}
|
|
@@ -156,14 +155,14 @@ ${x(J(s), " ")}
|
|
|
156
155
|
}
|
|
157
156
|
function st(t) {
|
|
158
157
|
const n = t.trim();
|
|
159
|
-
return /^\(/.test(n) ?
|
|
158
|
+
return /^\(/.test(n) ? O(n) : JSON.stringify(t);
|
|
160
159
|
}
|
|
161
160
|
function H(t, n, e) {
|
|
162
161
|
const s = e ? e[n] : "";
|
|
163
162
|
return s || (typeof t == "string" ? st(t + "") : JSON.stringify(t));
|
|
164
163
|
}
|
|
165
164
|
function N(t) {
|
|
166
|
-
let n =
|
|
165
|
+
let n = I(K(t?.type)), e = F(n);
|
|
167
166
|
n.length > 1 && (e = "any");
|
|
168
167
|
let s = (t?.selectable || "").trim(), i = [];
|
|
169
168
|
return s && e != "boolean" && (s.includes("|") ? s.split("|").forEach(($) => {
|
|
@@ -171,7 +170,7 @@ function N(t) {
|
|
|
171
170
|
let m = $.split(":");
|
|
172
171
|
i.push({
|
|
173
172
|
label: $,
|
|
174
|
-
prop:
|
|
173
|
+
prop: w(m[0].trim())
|
|
175
174
|
});
|
|
176
175
|
}
|
|
177
176
|
}) : i = j(s), e == "array" ? e = "choice" : e != "function" && i.length > 1 && (e = "select")), {
|
|
@@ -180,7 +179,7 @@ function N(t) {
|
|
|
180
179
|
dataType: n
|
|
181
180
|
};
|
|
182
181
|
}
|
|
183
|
-
function
|
|
182
|
+
function w(t, n) {
|
|
184
183
|
try {
|
|
185
184
|
if (n == "function")
|
|
186
185
|
if (typeof t == "string") {
|
|
@@ -198,10 +197,10 @@ function Tt(t, n = !0) {
|
|
|
198
197
|
const e = N(t), s = E(e.dataType);
|
|
199
198
|
if (n) {
|
|
200
199
|
const i = (t.default || "").trim();
|
|
201
|
-
return
|
|
200
|
+
return w(i || s, F(e.dataType));
|
|
202
201
|
} else {
|
|
203
202
|
const i = (t.default || "").trim();
|
|
204
|
-
return
|
|
203
|
+
return w(i, F(e.dataType));
|
|
205
204
|
}
|
|
206
205
|
}
|
|
207
206
|
export {
|
|
@@ -3,52 +3,3 @@ export declare function getJs(parent: HTMLElement, value: string, options?: stri
|
|
|
3
3
|
export declare function getHtml(parent: HTMLElement, value: string, options?: string[]): monaco.editor.IStandaloneCodeEditor;
|
|
4
4
|
export declare function getJson(parent: HTMLElement, value: string, options?: string[]): monaco.editor.IStandaloneCodeEditor;
|
|
5
5
|
export declare function getCss(parent: HTMLElement, value: string, options?: string[]): monaco.editor.IStandaloneCodeEditor;
|
|
6
|
-
...items: string[]): string[];
|
|
7
|
-
isArray(arg: any): arg is any[];
|
|
8
|
-
readonly prototype: any[];
|
|
9
|
-
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
10
|
-
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
11
|
-
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
12
|
-
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
13
|
-
of<T>(...items: T[]): T[];
|
|
14
|
-
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
15
|
-
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
16
|
-
readonly [Symbol.species]: ArrayConstructor;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
20
|
-
"update:modelValue": (...args: any[]) => void;
|
|
21
|
-
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
22
|
-
modelValue: {
|
|
23
|
-
type: StringConstructor;
|
|
24
|
-
default: string;
|
|
25
|
-
};
|
|
26
|
-
format: {
|
|
27
|
-
type: StringConstructor;
|
|
28
|
-
};
|
|
29
|
-
options: {
|
|
30
|
-
type: {
|
|
31
|
-
(arrayLength: number): string[];
|
|
32
|
-
(...items: string[]): string[];
|
|
33
|
-
new (arrayLength: number): string[];
|
|
34
|
-
new (...items: string[]): string[];
|
|
35
|
-
isArray(arg: any): arg is any[];
|
|
36
|
-
readonly prototype: any[];
|
|
37
|
-
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
38
|
-
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
39
|
-
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
40
|
-
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
41
|
-
of<T>(...items: T[]): T[];
|
|
42
|
-
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
43
|
-
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
44
|
-
readonly [Symbol.species]: ArrayConstructor;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}>> & Readonly<{
|
|
48
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
49
|
-
}>, {
|
|
50
|
-
modelValue: string;
|
|
51
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
52
|
-
refText: HTMLDivElement;
|
|
53
|
-
}, HTMLDivElement>;
|
|
54
|
-
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`)}function
|
|
3
|
-
|\r)+?)\\}[\\s|\\n|\\r]*`,n=new RegExp("^"+t+"$").exec(e);return n&&n.length>0?
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../../config.cjs"),W=require("@fangzhongya/utils/basic/string/toFunction"),A=require("@fangzhongya/utils/basic/string/firstLower");let c=e=>e;const f=O.getConfig("prettier");f&&Promise.resolve().then(()=>require("./prettier.cjs")).then(e=>{c=e.getFormat});function g(e){return f?c(e,"js"):e.replace(/\;(\s|\n\r)*$/,"")}async function q(e){return e="let a = "+e,(await g(e)).replace(/^let a = /,"")}function C(e){return g(e)}async function x(e){return!/^\s*function/.test(e)&&!/^\s*\([^\)]*\)\s*\=\>/.test(e)?(e="function a"+e,(await g(e)).replace(/^function a/,"")):await g(e)}function L(e){return f?c(e,"html"):e}function B(e){return f?c(e,"ts"):e}function E(e){return f?c(e,"js"):e}function N(e){return f?c(e,"css"):e}function P(e,t=""){let r=(e+"").trim().split(/\n/);return r=r.map(n=>t+n),r.join(`
|
|
2
|
+
`)}function F(e=""){e=e.trim();let t=`[\\s|\\n|\\r]*\\{((.|
|
|
3
|
+
|\r)+?)\\}[\\s|\\n|\\r]*`,n=new RegExp("^"+t+"$").exec(e);return n&&n.length>0?F(n[1]):e}const R=["Boolean","Any","String","Number","Array","Object","Function"];function z(e){return R.includes(e)?A.firstLower(e):e}function H(e){if(typeof e=="string"){let t=!1;return(/^\'(.|\n|\r)*\'$/.test(e)||/^\"(.|\n|\r)*\"$/.test(e)||/^\`(.|\n|\r)*\`$/.test(e))&&(t=!0),t&&(e=e.substring(1,e.length-1)),e+""}else return typeof e=="object"&&e?e.toString():typeof e>"u"||typeof e=="object"&&!e?"":e+""}function I(e){const t=typeof e;if(t=="string"){e=(e+"").replace(/^(\s|\n|r)*/,"").replace(/(\s|\n|r)*$/,"");let r="";return/^\'(.|\n|\r)*\'$/.test(e)||/^\"(.|\n|\r)*\"$/.test(e)||/^\`(.|\n|\r)*\`$/.test(e)?r="string":/^\[(.|\n|\r)*\]$/.test(e)?r="array":/^\{(.|\n|\r)*\}$/.test(e)?r="object":/^[0-9]*$/.test(e)?r="number":e==="true"||e==="false"?r="boolean":e=="undefined"?r="undefined":e=="null"?r="null":e&&(r="string"),r}else return t==="object"?e instanceof Array?"array":t===null?"null":t:t}const y=(e,t)=>{let r=[],n=[],i="";for(let o=0;o<e.length;o++){const s=e[o];s==="["||s==="<"||s==="("?(r.push(s),i+=s):s==="]"&&r.length>0&&r[r.length-1]==="["||s===">"&&r.length>0&&r[r.length-1]==="<"||s===")"&&r.length>0&&r[r.length-1]==="("?(r.pop(),i+=s):s===t&&r.length===0?(n.push(i.trim()),i=""):i+=s}return i.trim()!==""&&n.push(i.trim()),n},J=e=>{let t=[],r=!1,n=!1,i=0;for(let o=0;o<e.length;o++){const s=e[o];if(s==="["||s==="<"||s==="("?(n=!0,t.push(s),s=="["&&(r=!0),i==0&&(i=o)):(s==="]"&&t[t.length-1]==="["||s===">"&&t[t.length-1]==="<"||s===")"&&t[t.length-1]==="(")&&t.pop(),n&&t.length===0)return r&&i+1==o?{top:"Array",type:e.substring(0,i)}:{top:e.substring(0,i),type:e.substring(i+1,o)}}return{top:e,type:""}},b=e=>{if(e)if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("(")&&e.endsWith(")")){const t=e.slice(1,-1).trim();return t?y(t,","):["any"]}else{if(e.startsWith("{")&&e.endsWith("}"))return["Object"];if(e.startsWith("<")&&e.endsWith(">")){const t=e.slice(1,-1).trim();return t?y(t,"|"):["any"]}else return y(e,",")}else return["any"]};function M(e){return y(e,",").map(r=>{const n=r.trim(),i=r.match(/^([^:?]+)(\??):/);if(!i)return null;const o=i[1].trim(),s=!i[2],S=i[0].length,p=r.substring(S).trim();let a=[],d="",m="";for(let u=0;u<p.length;u++){const l=p[u];if(l==="["||l==="<"||l==="("||l==="{"?a.push(l):(l==="]"&&a[a.length-1]==="["||l===">"&&a[a.length-1]==="<"||l==="}"&&a[a.length-1]==="{"||l===")"&&a[a.length-1]==="(")&&a.pop(),a.length===0&&u>0){u==1&&l!=="]"&&l!==">"&&l!=="}"&&l!==")"?(d="",m=p.substring(0)):(d=p.substring(0,u+1).trim(),m=p.substring(u+1));break}}const k=b(d),T=v(k);return{name:o,prop:o,type:h(T),dataType:T,must:s,label:n,description:m}}).filter(Boolean)}function j(e){return e.map(r=>{if(typeof r=="string")return r.toLowerCase()==="array"?"Array<any>":r;if(r.children&&r.children.length>0){const n=j(r.children);return r.value+"<"+n+">"}else{const n=r.value;return n.toLowerCase()==="array"?"Array<any>":n}}).join(" | ")||"any"}function v(e){const t=[];return e.forEach(r=>{const n=J(r);if(n.type){const i=b(n.type),o=v(i);t.push({label:r,value:n.top,children:o})}else t.push(n.top)}),t}function V(e){let t="";return typeof e=="string"?t=e:t=e.value,z(t||"any")}function h(e){const t=e[0]||"any";return V(t)}function w(e){const t=e[0];switch(h(e)){case"string":return'""';case"boolean":return"false";case"number":return"0";case"array":if(typeof t=="string")return"[]";{let n=t.children;if(n&&n.length>0){let i=w([n[0]]);return i=i=="undefined"?"":i,`[${i}]`}else return"[]"}case"object":return"{}";case"function":return"()=>{}";case"any":return'""';default:return"undefined"}}function $(e){const t=Object.prototype.toString.call(e);let n=/^\[[O|o]bject (.*)\]$/.exec(t),i=typeof e;return n&&n.length>0&&(i=n[1].toLowerCase()),i}function D(e,t){const r=$(e),n=h(t);return n&&n!="any"?r==n:!0}const G=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","implements","interface","let","package","private","protected","public","static","true","false","null","undefined","any","boolean","number","string","object","symbol","unknown","never","void","undefined","null","type","interface","enum","as","is","infer","unique","abstract","readonly","namespace","module","declare","require","get","set","async","await","from","of","package"];Object.defineProperty(exports,"getFunctionFormat",{enumerable:!0,get:()=>W.getFunctionFormat});exports.allReservedWords=G;exports.getDataType=v;exports.getDataTypeType=h;exports.getFunBody=F;exports.getObjType=$;exports.getString=H;exports.getTypeValue=w;exports.isDefaultType=I;exports.isTypeEqual=D;exports.parseParamString=M;exports.parseTypeDefinition=b;exports.prettierArrFormat=C;exports.prettierCss=N;exports.prettierFormat=g;exports.prettierFunFormat=x;exports.prettierHtml=L;exports.prettierJs=E;exports.prettierObjFormat=q;exports.prettierTs=B;exports.setDataType=j;exports.vueFormat=P;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { getConfig as
|
|
2
|
-
import { getFunctionFormat as
|
|
3
|
-
import { firstLower as
|
|
1
|
+
import { getConfig as $ } from "../../config.js";
|
|
2
|
+
import { getFunctionFormat as Z } from "@fangzhongya/utils/basic/string/toFunction";
|
|
3
|
+
import { firstLower as F } from "@fangzhongya/utils/basic/string/firstLower";
|
|
4
4
|
let c = (e) => e;
|
|
5
|
-
const f =
|
|
5
|
+
const f = $("prettier");
|
|
6
6
|
f && import("./prettier.js").then((e) => {
|
|
7
7
|
c = e.getFormat;
|
|
8
8
|
});
|
|
9
9
|
function y(e) {
|
|
10
10
|
return f ? c(e, "js") : e.replace(/\;(\s|\n\r)*$/, "");
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
12
|
+
async function E(e) {
|
|
13
13
|
return e = "let a = " + e, (await y(e)).replace(/^let a = /, "");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function N(e) {
|
|
16
16
|
return y(e);
|
|
17
17
|
}
|
|
18
|
-
async function
|
|
18
|
+
async function z(e) {
|
|
19
19
|
return !/^\s*function/.test(e) && !/^\s*\([^\)]*\)\s*\=\>/.test(e) ? (e = "function a" + e, (await y(e)).replace(/^function a/, "")) : await y(e);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function I(e) {
|
|
22
22
|
return f ? c(e, "html") : e;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function R(e) {
|
|
25
25
|
return f ? c(e, "ts") : e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function H(e) {
|
|
28
28
|
return f ? c(e, "js") : e;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function J(e) {
|
|
31
31
|
return f ? c(e, "css") : e;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
35
|
-
return
|
|
33
|
+
function M(e, t = "") {
|
|
34
|
+
let n = (e + "").trim().split(/\n/);
|
|
35
|
+
return n = n.map((r) => t + r), n.join(`
|
|
36
36
|
`);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function k(e = "") {
|
|
39
39
|
e = e.trim();
|
|
40
40
|
let t = `[\\s|\\n|\\r]*\\{((.|
|
|
41
|
-
|\r)+?)\\}[\\s|\\n|\\r]*`,
|
|
42
|
-
return
|
|
41
|
+
|\r)+?)\\}[\\s|\\n|\\r]*`, r = new RegExp("^" + t + "$").exec(e);
|
|
42
|
+
return r && r.length > 0 ? k(r[1]) : e;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const S = [
|
|
45
45
|
"Boolean",
|
|
46
46
|
"Any",
|
|
47
47
|
"String",
|
|
@@ -51,7 +51,7 @@ const A = [
|
|
|
51
51
|
"Function"
|
|
52
52
|
];
|
|
53
53
|
function W(e) {
|
|
54
|
-
return
|
|
54
|
+
return S.includes(e) ? F(e) : e;
|
|
55
55
|
}
|
|
56
56
|
function V(e) {
|
|
57
57
|
if (typeof e == "string") {
|
|
@@ -63,24 +63,24 @@ function G(e) {
|
|
|
63
63
|
const t = typeof e;
|
|
64
64
|
if (t == "string") {
|
|
65
65
|
e = (e + "").replace(/^(\s|\n|r)*/, "").replace(/(\s|\n|r)*$/, "");
|
|
66
|
-
let
|
|
67
|
-
return /^\'(.|\n|\r)*\'$/.test(e) || /^\"(.|\n|\r)*\"$/.test(e) || /^\`(.|\n|\r)*\`$/.test(e) ?
|
|
66
|
+
let n = "";
|
|
67
|
+
return /^\'(.|\n|\r)*\'$/.test(e) || /^\"(.|\n|\r)*\"$/.test(e) || /^\`(.|\n|\r)*\`$/.test(e) ? n = "string" : /^\[(.|\n|\r)*\]$/.test(e) ? n = "array" : /^\{(.|\n|\r)*\}$/.test(e) ? n = "object" : /^[0-9]*$/.test(e) ? n = "number" : e === "true" || e === "false" ? n = "boolean" : e == "undefined" ? n = "undefined" : e == "null" ? n = "null" : e && (n = "string"), n;
|
|
68
68
|
} else
|
|
69
69
|
return t === "object" ? e instanceof Array ? "array" : t === null ? "null" : t : t;
|
|
70
70
|
}
|
|
71
71
|
const g = (e, t) => {
|
|
72
|
-
let
|
|
72
|
+
let n = [], r = [], i = "";
|
|
73
73
|
for (let l = 0; l < e.length; l++) {
|
|
74
74
|
const s = e[l];
|
|
75
|
-
s === "[" || s === "<" || s === "(" ? (
|
|
75
|
+
s === "[" || s === "<" || s === "(" ? (n.push(s), i += s) : s === "]" && n.length > 0 && n[n.length - 1] === "[" || s === ">" && n.length > 0 && n[n.length - 1] === "<" || s === ")" && n.length > 0 && n[n.length - 1] === "(" ? (n.pop(), i += s) : s === t && n.length === 0 ? (r.push(i.trim()), i = "") : i += s;
|
|
76
76
|
}
|
|
77
|
-
return i.trim() !== "" &&
|
|
78
|
-
},
|
|
79
|
-
let t = [],
|
|
77
|
+
return i.trim() !== "" && r.push(i.trim()), r;
|
|
78
|
+
}, A = (e) => {
|
|
79
|
+
let t = [], n = !1, r = !1, i = 0;
|
|
80
80
|
for (let l = 0; l < e.length; l++) {
|
|
81
81
|
const s = e[l];
|
|
82
|
-
if (s === "[" || s === "<" || s === "(" ? (
|
|
83
|
-
return
|
|
82
|
+
if (s === "[" || s === "<" || s === "(" ? (r = !0, t.push(s), s == "[" && (n = !0), i == 0 && (i = l)) : (s === "]" && t[t.length - 1] === "[" || s === ">" && t[t.length - 1] === "<" || s === ")" && t[t.length - 1] === "(") && t.pop(), r && t.length === 0)
|
|
83
|
+
return n && i + 1 == l ? {
|
|
84
84
|
top: "Array",
|
|
85
85
|
type: e.substring(0, i)
|
|
86
86
|
} : {
|
|
@@ -109,69 +109,69 @@ const g = (e, t) => {
|
|
|
109
109
|
else return ["any"];
|
|
110
110
|
};
|
|
111
111
|
function K(e) {
|
|
112
|
-
return g(e, ",").map((
|
|
113
|
-
const
|
|
112
|
+
return g(e, ",").map((n) => {
|
|
113
|
+
const r = n.trim(), i = n.match(/^([^:?]+)(\??):/);
|
|
114
114
|
if (!i) return null;
|
|
115
|
-
const l = i[1].trim(), s = !i[2],
|
|
116
|
-
let u = [], h = "",
|
|
115
|
+
const l = i[1].trim(), s = !i[2], w = i[0].length, p = n.substring(w).trim();
|
|
116
|
+
let u = [], h = "", d = "";
|
|
117
117
|
for (let a = 0; a < p.length; a++) {
|
|
118
118
|
const o = p[a];
|
|
119
119
|
if (o === "[" || o === "<" || o === "(" || o === "{" ? u.push(o) : (o === "]" && u[u.length - 1] === "[" || o === ">" && u[u.length - 1] === "<" || o === "}" && u[u.length - 1] === "{" || o === ")" && u[u.length - 1] === "(") && u.pop(), u.length === 0 && a > 0) {
|
|
120
|
-
a == 1 && o !== "]" && o !== ">" && o !== "}" && o !== ")" ? (h = "",
|
|
120
|
+
a == 1 && o !== "]" && o !== ">" && o !== "}" && o !== ")" ? (h = "", d = p.substring(0)) : (h = p.substring(0, a + 1).trim(), d = p.substring(a + 1));
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const T = v(h), b = j(T);
|
|
125
125
|
return {
|
|
126
126
|
name: l,
|
|
127
127
|
prop: l,
|
|
128
|
-
type: b
|
|
129
|
-
dataType:
|
|
128
|
+
type: m(b),
|
|
129
|
+
dataType: b,
|
|
130
130
|
must: s,
|
|
131
|
-
label:
|
|
132
|
-
description:
|
|
131
|
+
label: r,
|
|
132
|
+
description: d
|
|
133
133
|
};
|
|
134
134
|
}).filter(Boolean);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return e.map((
|
|
138
|
-
if (typeof
|
|
139
|
-
return r.toLowerCase() === "array" ? "Array<any>" : r;
|
|
140
|
-
if (r.children && r.children.length > 0) {
|
|
141
|
-
const n = O(r.children);
|
|
142
|
-
return r.value + "<" + n + ">";
|
|
143
|
-
} else {
|
|
144
|
-
const n = r.value;
|
|
136
|
+
function x(e) {
|
|
137
|
+
return e.map((n) => {
|
|
138
|
+
if (typeof n == "string")
|
|
145
139
|
return n.toLowerCase() === "array" ? "Array<any>" : n;
|
|
140
|
+
if (n.children && n.children.length > 0) {
|
|
141
|
+
const r = x(n.children);
|
|
142
|
+
return n.value + "<" + r + ">";
|
|
143
|
+
} else {
|
|
144
|
+
const r = n.value;
|
|
145
|
+
return r.toLowerCase() === "array" ? "Array<any>" : r;
|
|
146
146
|
}
|
|
147
147
|
}).join(" | ") || "any";
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function j(e) {
|
|
150
150
|
const t = [];
|
|
151
|
-
return e.forEach((
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
const i = v(
|
|
151
|
+
return e.forEach((n) => {
|
|
152
|
+
const r = A(n);
|
|
153
|
+
if (r.type) {
|
|
154
|
+
const i = v(r.type), l = j(i);
|
|
155
155
|
t.push({
|
|
156
|
-
label:
|
|
157
|
-
value:
|
|
156
|
+
label: n,
|
|
157
|
+
value: r.top,
|
|
158
158
|
children: l
|
|
159
159
|
});
|
|
160
160
|
} else
|
|
161
|
-
t.push(
|
|
161
|
+
t.push(r.top);
|
|
162
162
|
}), t;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function O(e) {
|
|
165
165
|
let t = "";
|
|
166
166
|
return typeof e == "string" ? t = e : t = e.value, W(t || "any");
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function m(e) {
|
|
169
169
|
const t = e[0] || "any";
|
|
170
|
-
return
|
|
170
|
+
return O(t);
|
|
171
171
|
}
|
|
172
172
|
function C(e) {
|
|
173
173
|
const t = e[0];
|
|
174
|
-
switch (
|
|
174
|
+
switch (m(e)) {
|
|
175
175
|
case "string":
|
|
176
176
|
return '""';
|
|
177
177
|
case "boolean":
|
|
@@ -182,9 +182,9 @@ function C(e) {
|
|
|
182
182
|
if (typeof t == "string")
|
|
183
183
|
return "[]";
|
|
184
184
|
{
|
|
185
|
-
let
|
|
186
|
-
if (
|
|
187
|
-
let i = C([
|
|
185
|
+
let r = t.children;
|
|
186
|
+
if (r && r.length > 0) {
|
|
187
|
+
let i = C([r[0]]);
|
|
188
188
|
return i = i == "undefined" ? "" : i, `[${i}]`;
|
|
189
189
|
} else
|
|
190
190
|
return "[]";
|
|
@@ -201,18 +201,105 @@ function C(e) {
|
|
|
201
201
|
}
|
|
202
202
|
function L(e) {
|
|
203
203
|
const t = Object.prototype.toString.call(e);
|
|
204
|
-
let
|
|
205
|
-
return
|
|
204
|
+
let r = /^\[[O|o]bject (.*)\]$/.exec(t), i = typeof e;
|
|
205
|
+
return r && r.length > 0 && (i = r[1].toLowerCase()), i;
|
|
206
206
|
}
|
|
207
207
|
function Q(e, t) {
|
|
208
|
-
const
|
|
209
|
-
return
|
|
208
|
+
const n = L(e), r = m(t);
|
|
209
|
+
return r && r != "any" ? n == r : !0;
|
|
210
210
|
}
|
|
211
|
+
const U = [
|
|
212
|
+
// JavaScript 基本关键字
|
|
213
|
+
"break",
|
|
214
|
+
"case",
|
|
215
|
+
"catch",
|
|
216
|
+
"class",
|
|
217
|
+
"const",
|
|
218
|
+
"continue",
|
|
219
|
+
"debugger",
|
|
220
|
+
"default",
|
|
221
|
+
"delete",
|
|
222
|
+
"do",
|
|
223
|
+
"else",
|
|
224
|
+
"export",
|
|
225
|
+
"extends",
|
|
226
|
+
"finally",
|
|
227
|
+
"for",
|
|
228
|
+
"function",
|
|
229
|
+
"if",
|
|
230
|
+
"import",
|
|
231
|
+
"in",
|
|
232
|
+
"instanceof",
|
|
233
|
+
"new",
|
|
234
|
+
"return",
|
|
235
|
+
"super",
|
|
236
|
+
"switch",
|
|
237
|
+
"this",
|
|
238
|
+
"throw",
|
|
239
|
+
"try",
|
|
240
|
+
"typeof",
|
|
241
|
+
"var",
|
|
242
|
+
"void",
|
|
243
|
+
"while",
|
|
244
|
+
"with",
|
|
245
|
+
"yield",
|
|
246
|
+
// 严格模式下的保留字
|
|
247
|
+
"implements",
|
|
248
|
+
"interface",
|
|
249
|
+
"let",
|
|
250
|
+
"package",
|
|
251
|
+
"private",
|
|
252
|
+
"protected",
|
|
253
|
+
"public",
|
|
254
|
+
"static",
|
|
255
|
+
// 字面量值
|
|
256
|
+
"true",
|
|
257
|
+
"false",
|
|
258
|
+
"null",
|
|
259
|
+
"undefined",
|
|
260
|
+
// TypeScript 特有类型关键字
|
|
261
|
+
"any",
|
|
262
|
+
"boolean",
|
|
263
|
+
"number",
|
|
264
|
+
"string",
|
|
265
|
+
"object",
|
|
266
|
+
"symbol",
|
|
267
|
+
"unknown",
|
|
268
|
+
"never",
|
|
269
|
+
"void",
|
|
270
|
+
"undefined",
|
|
271
|
+
"null",
|
|
272
|
+
// TypeScript 类型操作与定义
|
|
273
|
+
"type",
|
|
274
|
+
"interface",
|
|
275
|
+
"enum",
|
|
276
|
+
"as",
|
|
277
|
+
"is",
|
|
278
|
+
"infer",
|
|
279
|
+
"unique",
|
|
280
|
+
// TypeScript 类修饰符
|
|
281
|
+
"abstract",
|
|
282
|
+
"readonly",
|
|
283
|
+
// TypeScript 模块与声明
|
|
284
|
+
"namespace",
|
|
285
|
+
"module",
|
|
286
|
+
"declare",
|
|
287
|
+
"require",
|
|
288
|
+
// 其他(访问器、未来保留字等)
|
|
289
|
+
"get",
|
|
290
|
+
"set",
|
|
291
|
+
"async",
|
|
292
|
+
"await",
|
|
293
|
+
"from",
|
|
294
|
+
"of",
|
|
295
|
+
"package"
|
|
296
|
+
];
|
|
211
297
|
export {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
298
|
+
U as allReservedWords,
|
|
299
|
+
j as getDataType,
|
|
300
|
+
m as getDataTypeType,
|
|
301
|
+
k as getFunBody,
|
|
302
|
+
Z as getFunctionFormat,
|
|
216
303
|
L as getObjType,
|
|
217
304
|
V as getString,
|
|
218
305
|
C as getTypeValue,
|
|
@@ -220,14 +307,14 @@ export {
|
|
|
220
307
|
Q as isTypeEqual,
|
|
221
308
|
K as parseParamString,
|
|
222
309
|
v as parseTypeDefinition,
|
|
223
|
-
|
|
224
|
-
|
|
310
|
+
N as prettierArrFormat,
|
|
311
|
+
J as prettierCss,
|
|
225
312
|
y as prettierFormat,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
313
|
+
z as prettierFunFormat,
|
|
314
|
+
I as prettierHtml,
|
|
315
|
+
H as prettierJs,
|
|
316
|
+
E as prettierObjFormat,
|
|
317
|
+
R as prettierTs,
|
|
318
|
+
x as setDataType,
|
|
319
|
+
M as vueFormat
|
|
233
320
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fangzhongya/vue-archive",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "vue 组件注释生成文档",
|
|
7
7
|
"author": "fangzhongya ",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
25
25
|
"@codemirror/lang-json": "^6.0.2",
|
|
26
26
|
"@codemirror/state": "^6.5.2",
|
|
27
|
-
"@codemirror/view": "^6.
|
|
27
|
+
"@codemirror/view": "^6.39.4",
|
|
28
28
|
"@fangzhongya/create": "0.2.43",
|
|
29
|
-
"@fangzhongya/utils": "0.0.
|
|
29
|
+
"@fangzhongya/utils": "0.0.59",
|
|
30
30
|
"@fangzhongya/vue-components": "0.1.20",
|
|
31
31
|
"@highlightjs/vue-plugin": "^2.1.0",
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
32
|
+
"@types/node": "^25.0.3",
|
|
33
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
34
34
|
"@vue/compiler-dom": "3.5.25",
|
|
35
35
|
"@vue/compiler-sfc": "3.5.25",
|
|
36
36
|
"@vue/runtime-dom": "3.5.25",
|
|
@@ -38,24 +38,24 @@
|
|
|
38
38
|
"@vue/shared": "3.5.25",
|
|
39
39
|
"codemirror": "^6.0.2",
|
|
40
40
|
"fast-glob": "^3.3.3",
|
|
41
|
-
"sass": "^1.
|
|
41
|
+
"sass": "^1.97.0",
|
|
42
42
|
"ts-node": "^10.9.2",
|
|
43
43
|
"tsup": "^8.5.1",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
45
|
"unplugin-vue-components": "^30.0.0",
|
|
46
|
-
"vite": "^7.
|
|
46
|
+
"vite": "^7.3.0",
|
|
47
47
|
"vite-plugin-dts": "4.5.4",
|
|
48
|
-
"vitest": "^4.0.
|
|
49
|
-
"vue-tsc": "^3.1.
|
|
48
|
+
"vitest": "^4.0.16",
|
|
49
|
+
"vue-tsc": "^3.1.8"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"comment-parser": "^1.4.1",
|
|
53
53
|
"highlight.js": "^11.11.1",
|
|
54
54
|
"markdown-it": "^14.1.0",
|
|
55
55
|
"monaco-editor": "^0.55.1",
|
|
56
|
-
"prettier": "^3.7.
|
|
56
|
+
"prettier": "^3.7.4",
|
|
57
57
|
"vue": "^3.5.25",
|
|
58
|
-
"vue-router": "^4.6.
|
|
58
|
+
"vue-router": "^4.6.4"
|
|
59
59
|
},
|
|
60
60
|
"types": "./dist/packages/index.d.ts",
|
|
61
61
|
"main": "./dist/packages/index.cjs",
|