@fangzhongya/vue-archive 0.0.82 → 0.0.84
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 +73 -65
- package/dist/node/index.js +73 -65
- package/dist/packages/components/compo/index.cjs +1 -1
- package/dist/packages/components/compo/index.js +99 -99
- package/dist/packages/components/md/index.vue.cjs +1 -1
- package/dist/packages/components/md/index.vue.js +1 -1
- package/dist/packages/components/use/code.d.ts +25 -18
- package/dist/packages/config.cjs +1 -1
- package/dist/packages/config.js +8 -18
- package/dist/packages/node/index.d.ts +1 -1
- package/dist/packages/page/index/index.vue2.cjs +1 -1
- package/dist/packages/page/index/index.vue2.js +30 -28
- package/dist/packages/router/index.cjs +1 -1
- package/dist/packages/router/index.d.ts +1 -1
- package/dist/packages/router/index.js +10 -10
- package/dist/packages/utils/common.d.ts +2 -62
- package/dist/packages/utils/glob.d.ts +1 -1
- package/dist/packages/utils/type.d.ts +62 -0
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -913,6 +913,64 @@ function mergeObject(a, b, j = 0, i) {
|
|
|
913
913
|
return a;
|
|
914
914
|
}
|
|
915
915
|
|
|
916
|
+
// packages/config.ts
|
|
917
|
+
var config = {
|
|
918
|
+
components: []
|
|
919
|
+
};
|
|
920
|
+
function userConfig(defaultConfig3) {
|
|
921
|
+
return mergeObject(config, defaultConfig3, 2);
|
|
922
|
+
}
|
|
923
|
+
function getConfig(key) {
|
|
924
|
+
return config[key];
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
|
|
928
|
+
function getVueText(content) {
|
|
929
|
+
const result = {
|
|
930
|
+
template: "",
|
|
931
|
+
scripts: [],
|
|
932
|
+
styles: [],
|
|
933
|
+
customBlocks: []
|
|
934
|
+
};
|
|
935
|
+
const templateRegex = /<template([\s\S]*?)>([\s\S]*?)<\/template>/;
|
|
936
|
+
const templateMatch = content.match(templateRegex);
|
|
937
|
+
if (templateMatch && templateMatch[2]) {
|
|
938
|
+
result.template = templateMatch[2];
|
|
939
|
+
}
|
|
940
|
+
const scriptRegex = /<script([\s\S]*?)>([\s\S]*?)<\/script>/g;
|
|
941
|
+
let scriptMatch;
|
|
942
|
+
while ((scriptMatch = scriptRegex.exec(content)) !== null) {
|
|
943
|
+
if (scriptMatch[2]) {
|
|
944
|
+
result.scripts.push(scriptMatch[2]);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
const styleRegex = /<style([\s\S]*?)>([\s\S]*?)<\/style>/g;
|
|
948
|
+
let styleMatch;
|
|
949
|
+
while ((styleMatch = styleRegex.exec(content)) !== null) {
|
|
950
|
+
if (styleMatch[2]) {
|
|
951
|
+
result.styles.push(styleMatch[2]);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
const customBlockRegex = /<([a-z][a-z0-9-]*)([\s\S]*?)>([\s\S]*?)<\/\1>/g;
|
|
955
|
+
let customMatch;
|
|
956
|
+
while ((customMatch = customBlockRegex.exec(content)) !== null) {
|
|
957
|
+
if (!["template", "script", "style"].includes(customMatch[1])) {
|
|
958
|
+
result.customBlocks.push({
|
|
959
|
+
type: customMatch[1],
|
|
960
|
+
content: customMatch[3]
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
return result;
|
|
965
|
+
}
|
|
966
|
+
function getVueTexts(content) {
|
|
967
|
+
const obj2 = getVueText(content);
|
|
968
|
+
return {
|
|
969
|
+
script: obj2.scripts.join("\n"),
|
|
970
|
+
style: obj2.styles.join("\n")
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
|
|
916
974
|
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
|
|
917
975
|
function humpToLine(name) {
|
|
918
976
|
const reg = /(([A-Z])([^A-Z]*))/g;
|
|
@@ -974,64 +1032,6 @@ function getSuffix2(url) {
|
|
|
974
1032
|
return "";
|
|
975
1033
|
}
|
|
976
1034
|
|
|
977
|
-
// packages/config.ts
|
|
978
|
-
var config = {
|
|
979
|
-
components: []
|
|
980
|
-
};
|
|
981
|
-
function userConfig(defaultConfig3) {
|
|
982
|
-
return mergeObject(config, defaultConfig3, 2);
|
|
983
|
-
}
|
|
984
|
-
function getConfig(key) {
|
|
985
|
-
return config[key];
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
|
|
989
|
-
function getVueText(content) {
|
|
990
|
-
const result = {
|
|
991
|
-
template: "",
|
|
992
|
-
scripts: [],
|
|
993
|
-
styles: [],
|
|
994
|
-
customBlocks: []
|
|
995
|
-
};
|
|
996
|
-
const templateRegex = /<template([\s\S]*?)>([\s\S]*?)<\/template>/;
|
|
997
|
-
const templateMatch = content.match(templateRegex);
|
|
998
|
-
if (templateMatch && templateMatch[2]) {
|
|
999
|
-
result.template = templateMatch[2];
|
|
1000
|
-
}
|
|
1001
|
-
const scriptRegex = /<script([\s\S]*?)>([\s\S]*?)<\/script>/g;
|
|
1002
|
-
let scriptMatch;
|
|
1003
|
-
while ((scriptMatch = scriptRegex.exec(content)) !== null) {
|
|
1004
|
-
if (scriptMatch[2]) {
|
|
1005
|
-
result.scripts.push(scriptMatch[2]);
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
const styleRegex = /<style([\s\S]*?)>([\s\S]*?)<\/style>/g;
|
|
1009
|
-
let styleMatch;
|
|
1010
|
-
while ((styleMatch = styleRegex.exec(content)) !== null) {
|
|
1011
|
-
if (styleMatch[2]) {
|
|
1012
|
-
result.styles.push(styleMatch[2]);
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
const customBlockRegex = /<([a-z][a-z0-9-]*)([\s\S]*?)>([\s\S]*?)<\/\1>/g;
|
|
1016
|
-
let customMatch;
|
|
1017
|
-
while ((customMatch = customBlockRegex.exec(content)) !== null) {
|
|
1018
|
-
if (!["template", "script", "style"].includes(customMatch[1])) {
|
|
1019
|
-
result.customBlocks.push({
|
|
1020
|
-
type: customMatch[1],
|
|
1021
|
-
content: customMatch[3]
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
return result;
|
|
1026
|
-
}
|
|
1027
|
-
function getVueTexts(content) {
|
|
1028
|
-
const obj2 = getVueText(content);
|
|
1029
|
-
return {
|
|
1030
|
-
script: obj2.scripts.join("\n"),
|
|
1031
|
-
style: obj2.styles.join("\n")
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
1035
|
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
|
|
1036
1036
|
function matchsStart2(key, matchs) {
|
|
1037
1037
|
if (matchs && matchs.length > 0) {
|
|
@@ -3873,7 +3873,7 @@ var notesObj = {
|
|
|
3873
3873
|
exposes: []
|
|
3874
3874
|
};
|
|
3875
3875
|
function getDefault(ss, iss) {
|
|
3876
|
-
let
|
|
3876
|
+
let char = ss.charAt(0);
|
|
3877
3877
|
let css2 = [
|
|
3878
3878
|
['"', '"'],
|
|
3879
3879
|
["'", "'"],
|
|
@@ -3883,16 +3883,24 @@ function getDefault(ss, iss) {
|
|
|
3883
3883
|
["[", "]"]
|
|
3884
3884
|
];
|
|
3885
3885
|
const cs = css2.map((o) => o[0]);
|
|
3886
|
-
let ci = cs.indexOf(
|
|
3886
|
+
let ci = cs.indexOf(char);
|
|
3887
3887
|
if (ci != -1) {
|
|
3888
|
-
let bracketStack = [
|
|
3888
|
+
let bracketStack = [char];
|
|
3889
3889
|
for (let i = 1; i < ss.length; i++) {
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3890
|
+
char = ss[i];
|
|
3891
|
+
ci = cs.indexOf(char);
|
|
3892
|
+
if (ci != -1) {
|
|
3893
|
+
if (ci > 2) {
|
|
3894
|
+
bracketStack.push(char);
|
|
3895
|
+
} else {
|
|
3896
|
+
if (bracketStack[bracketStack.length - 1] === char) {
|
|
3897
|
+
bracketStack.pop();
|
|
3898
|
+
} else {
|
|
3899
|
+
bracketStack.push(char);
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3893
3902
|
} else {
|
|
3894
3903
|
let is = false;
|
|
3895
|
-
char === "]" && bracketStack[bracketStack.length - 1] === "[";
|
|
3896
3904
|
for (let v of css2) {
|
|
3897
3905
|
if (char === v[1] && bracketStack[bracketStack.length - 1] === v[0]) {
|
|
3898
3906
|
is = true;
|
package/dist/node/index.js
CHANGED
|
@@ -895,6 +895,64 @@ function mergeObject(a, b, j = 0, i) {
|
|
|
895
895
|
return a;
|
|
896
896
|
}
|
|
897
897
|
|
|
898
|
+
// packages/config.ts
|
|
899
|
+
var config = {
|
|
900
|
+
components: []
|
|
901
|
+
};
|
|
902
|
+
function userConfig(defaultConfig3) {
|
|
903
|
+
return mergeObject(config, defaultConfig3, 2);
|
|
904
|
+
}
|
|
905
|
+
function getConfig(key) {
|
|
906
|
+
return config[key];
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
|
|
910
|
+
function getVueText(content) {
|
|
911
|
+
const result = {
|
|
912
|
+
template: "",
|
|
913
|
+
scripts: [],
|
|
914
|
+
styles: [],
|
|
915
|
+
customBlocks: []
|
|
916
|
+
};
|
|
917
|
+
const templateRegex = /<template([\s\S]*?)>([\s\S]*?)<\/template>/;
|
|
918
|
+
const templateMatch = content.match(templateRegex);
|
|
919
|
+
if (templateMatch && templateMatch[2]) {
|
|
920
|
+
result.template = templateMatch[2];
|
|
921
|
+
}
|
|
922
|
+
const scriptRegex = /<script([\s\S]*?)>([\s\S]*?)<\/script>/g;
|
|
923
|
+
let scriptMatch;
|
|
924
|
+
while ((scriptMatch = scriptRegex.exec(content)) !== null) {
|
|
925
|
+
if (scriptMatch[2]) {
|
|
926
|
+
result.scripts.push(scriptMatch[2]);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
const styleRegex = /<style([\s\S]*?)>([\s\S]*?)<\/style>/g;
|
|
930
|
+
let styleMatch;
|
|
931
|
+
while ((styleMatch = styleRegex.exec(content)) !== null) {
|
|
932
|
+
if (styleMatch[2]) {
|
|
933
|
+
result.styles.push(styleMatch[2]);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
const customBlockRegex = /<([a-z][a-z0-9-]*)([\s\S]*?)>([\s\S]*?)<\/\1>/g;
|
|
937
|
+
let customMatch;
|
|
938
|
+
while ((customMatch = customBlockRegex.exec(content)) !== null) {
|
|
939
|
+
if (!["template", "script", "style"].includes(customMatch[1])) {
|
|
940
|
+
result.customBlocks.push({
|
|
941
|
+
type: customMatch[1],
|
|
942
|
+
content: customMatch[3]
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
return result;
|
|
947
|
+
}
|
|
948
|
+
function getVueTexts(content) {
|
|
949
|
+
const obj2 = getVueText(content);
|
|
950
|
+
return {
|
|
951
|
+
script: obj2.scripts.join("\n"),
|
|
952
|
+
style: obj2.styles.join("\n")
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
|
|
898
956
|
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
|
|
899
957
|
function humpToLine(name) {
|
|
900
958
|
const reg = /(([A-Z])([^A-Z]*))/g;
|
|
@@ -956,64 +1014,6 @@ function getSuffix2(url) {
|
|
|
956
1014
|
return "";
|
|
957
1015
|
}
|
|
958
1016
|
|
|
959
|
-
// packages/config.ts
|
|
960
|
-
var config = {
|
|
961
|
-
components: []
|
|
962
|
-
};
|
|
963
|
-
function userConfig(defaultConfig3) {
|
|
964
|
-
return mergeObject(config, defaultConfig3, 2);
|
|
965
|
-
}
|
|
966
|
-
function getConfig(key) {
|
|
967
|
-
return config[key];
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
|
|
971
|
-
function getVueText(content) {
|
|
972
|
-
const result = {
|
|
973
|
-
template: "",
|
|
974
|
-
scripts: [],
|
|
975
|
-
styles: [],
|
|
976
|
-
customBlocks: []
|
|
977
|
-
};
|
|
978
|
-
const templateRegex = /<template([\s\S]*?)>([\s\S]*?)<\/template>/;
|
|
979
|
-
const templateMatch = content.match(templateRegex);
|
|
980
|
-
if (templateMatch && templateMatch[2]) {
|
|
981
|
-
result.template = templateMatch[2];
|
|
982
|
-
}
|
|
983
|
-
const scriptRegex = /<script([\s\S]*?)>([\s\S]*?)<\/script>/g;
|
|
984
|
-
let scriptMatch;
|
|
985
|
-
while ((scriptMatch = scriptRegex.exec(content)) !== null) {
|
|
986
|
-
if (scriptMatch[2]) {
|
|
987
|
-
result.scripts.push(scriptMatch[2]);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
const styleRegex = /<style([\s\S]*?)>([\s\S]*?)<\/style>/g;
|
|
991
|
-
let styleMatch;
|
|
992
|
-
while ((styleMatch = styleRegex.exec(content)) !== null) {
|
|
993
|
-
if (styleMatch[2]) {
|
|
994
|
-
result.styles.push(styleMatch[2]);
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
const customBlockRegex = /<([a-z][a-z0-9-]*)([\s\S]*?)>([\s\S]*?)<\/\1>/g;
|
|
998
|
-
let customMatch;
|
|
999
|
-
while ((customMatch = customBlockRegex.exec(content)) !== null) {
|
|
1000
|
-
if (!["template", "script", "style"].includes(customMatch[1])) {
|
|
1001
|
-
result.customBlocks.push({
|
|
1002
|
-
type: customMatch[1],
|
|
1003
|
-
content: customMatch[3]
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return result;
|
|
1008
|
-
}
|
|
1009
|
-
function getVueTexts(content) {
|
|
1010
|
-
const obj2 = getVueText(content);
|
|
1011
|
-
return {
|
|
1012
|
-
script: obj2.scripts.join("\n"),
|
|
1013
|
-
style: obj2.styles.join("\n")
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
1017
|
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-S6JRKYPY.js
|
|
1018
1018
|
function matchsStart2(key, matchs) {
|
|
1019
1019
|
if (matchs && matchs.length > 0) {
|
|
@@ -3855,7 +3855,7 @@ var notesObj = {
|
|
|
3855
3855
|
exposes: []
|
|
3856
3856
|
};
|
|
3857
3857
|
function getDefault(ss, iss) {
|
|
3858
|
-
let
|
|
3858
|
+
let char = ss.charAt(0);
|
|
3859
3859
|
let css2 = [
|
|
3860
3860
|
['"', '"'],
|
|
3861
3861
|
["'", "'"],
|
|
@@ -3865,16 +3865,24 @@ function getDefault(ss, iss) {
|
|
|
3865
3865
|
["[", "]"]
|
|
3866
3866
|
];
|
|
3867
3867
|
const cs = css2.map((o) => o[0]);
|
|
3868
|
-
let ci = cs.indexOf(
|
|
3868
|
+
let ci = cs.indexOf(char);
|
|
3869
3869
|
if (ci != -1) {
|
|
3870
|
-
let bracketStack = [
|
|
3870
|
+
let bracketStack = [char];
|
|
3871
3871
|
for (let i = 1; i < ss.length; i++) {
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3872
|
+
char = ss[i];
|
|
3873
|
+
ci = cs.indexOf(char);
|
|
3874
|
+
if (ci != -1) {
|
|
3875
|
+
if (ci > 2) {
|
|
3876
|
+
bracketStack.push(char);
|
|
3877
|
+
} else {
|
|
3878
|
+
if (bracketStack[bracketStack.length - 1] === char) {
|
|
3879
|
+
bracketStack.pop();
|
|
3880
|
+
} else {
|
|
3881
|
+
bracketStack.push(char);
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3875
3884
|
} else {
|
|
3876
3885
|
let is = false;
|
|
3877
|
-
char === "]" && bracketStack[bracketStack.length - 1] === "[";
|
|
3878
3886
|
for (let v of css2) {
|
|
3879
3887
|
if (char === v[1] && bracketStack[bracketStack.length - 1] === v[0]) {
|
|
3880
3888
|
is = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../../utils/index.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");require("@fangzhongya/utils/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../../utils/index.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/html/getVueText");require("@fangzhongya/utils/basic/array/toggleArray");require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");require("@fangzhongya/utils/judge/matchsStart");require("@fangzhongya/utils/judge/matchsEnd");const a=require("../../utils/props.cjs"),p={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function x(e,s){let t=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]];const r=l.map(o=>o[0]);let i=r.indexOf(t);if(i!=-1){let o=[t];for(let n=1;n<e.length;n++){if(t=e[n],i=r.indexOf(t),i!=-1)i>2?o.push(t):o[o.length-1]===t?o.pop():o.push(t);else{let c=!1;for(let f of l)if(t===f[1]&&o[o.length-1]===f[0]){c=!0;break}c&&o.pop()}if(o.length===0)return s&&e[n+1]===" ",e.substring(0,n+1)}}else return s?e.substring(0,e.indexOf(" ")):e}function E(e){delete e.problems,delete e.source;let s=e.tag,t=e.name,l=e.description,r=e.default,i="",o="";if(s=="default")t=t.trim(),t=x(t)||t;else if(s=="selectable")t=t.trim();else{if(t.includes("=")){const f=t.split("=");t=f[0];const h=f[1]+" "+l,b=x(h,!0);b?(r=b,l=h.replace(b,"")):r=e.default||f[1]||""}const c=/\s*\((.*)\)\s/gi.exec(l);c&&c.length>0&&(i=c[1],l=l.replace(c[0],""))}return t.endsWith("*")&&(o="*",t=t.substring(0,t.length-1)),e.name=t,e.required=o,e.default=r||"",e.description=l,e.selectable=i,e}function O(e){let s=["title","text","author","date"],t=m(e),l={};s.forEach(r=>{l[r]=t.obj[r]}),g(l),t.arr.forEach(r=>{d(r.key,r.value)})}function g(e){p.titles.push(e)}function T(e){let s=["props","name","type","default","required","selectable","description","descriptions","return"],t=m(e),l={};s.forEach(r=>{l[r]=t.obj[r]}),u(l,"props"),t.arr.forEach(r=>{d(r.key,r.value)})}function y(e){let s=["slot","name","selectable","description","descriptions"],t=m(e),l={};s.forEach(r=>{l[r]=t.obj[r]}),u(l,"slot"),t.arr.forEach(r=>{d(r.key,r.value)})}function k(e){let s=["emits","name","selectable","description","descriptions"],t=m(e),l={};s.forEach(r=>{l[r]=t.obj[r]}),u(l,"emits"),t.arr.forEach(r=>{d(r.key,r.value)})}function j(e){let s=["expose","name","type","return","selectable","description","descriptions"],t=m(e),l={};s.forEach(r=>{l[r]=t.obj[r]}),u(l,"expose"),t.arr.forEach(r=>{d(r.key,r.value)})}function u(e,s){const t=p[s+"name"]||[],l=e.name??e[s]?.name,r=t.indexOf(l);r>=0&&(p[s+"s"].splice(r,1),t.splice(r,1)),p[s+"s"].push(e),t.push(l),p[s+"name"]=t}function S(){Object.keys(p).forEach(e=>{p[e]=[]})}function m(e,s){const t={descriptions:e?.description||""},l=[];return e?.tags&&e.tags?.forEach(r=>{let i=r.tag,o=E(r);if(!t.hasOwnProperty(i))t[i]=o;else{const n={};n[i]=o,l.push({key:i,value:n})}}),{arr:l,obj:t}}function d(e,s){switch(e){case"title":return g(s),!0;case"text":return g(s),!0;case"props":return u(s,"props"),!0;case"slot":return u(s,"slot"),!0;case"emits":return u(s,"emits"),!0;case"expose":return u(s,"expose"),!0;default:return!1}}function w(e,s){switch(e){case"title":return O(s),!0;case"props":return T(s),!0;case"slot":return y(s),!0;case"emits":return k(s),!0;case"expose":return j(s),!0;default:return!1}}function N(e){return S(),e?.forEach(s=>{let t=s?.tags||[],l=t?.length||0;if(l>0)for(let r=0;r<l;r++){const i=t[r]||{};if(w(i.tag,s))break}}),p}function P(e){let s=q.getTextNotes(e);return N(s)}const F=[{label:"属性名",prop:"name",formatter:a.props.name},{label:"说明",prop:"description",formatter:a.props.description},{label:"类型",prop:"type",formatter:a.props.type},{label:"可选值",prop:"selectable",formatter:a.props.selectable},{label:"默认值",prop:"default",formatter:a.props.default},{label:"必传",prop:"required",formatter:a.props.required},{label:"方法返回值",prop:"return",formatter:a.props.return}],v=[{label:"事件名",prop:"name",formatter:a.emits.name},{label:"说明",prop:"description",formatter:a.emits.description},{label:"回调参数",prop:"selectable",formatter:a.emits.selectable}],z=[{label:"方法名",prop:"name",formatter:a.expose.name},{label:"说明",prop:"description",formatter:a.expose.description},{label:"参数",prop:"selectable",formatter:a.expose.selectable},{label:"返回值",prop:"return",formatter(e){return a.expose.return(e)||e.expose.default||""}},{label:"类型",prop:"type",formatter(e){return a.expose.type(e)||"function"}}],A=[{label:"插槽名",prop:"name",formatter:a.slot.name},{label:"说明",prop:"description",formatter:a.slot.description},{label:"作用域参数",prop:"selectable",formatter:a.slot.selectable}];exports.getNotesText=P;exports.temits=v;exports.texpose=z;exports.tprops=F;exports.tslot=A;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getTextNotes as T } from "../../utils/index.js";
|
|
2
2
|
import "@fangzhongya/utils/basic/object/mergeObject";
|
|
3
|
+
import "@fangzhongya/utils/html/getVueText";
|
|
3
4
|
import "@fangzhongya/utils/basic/array/toggleArray";
|
|
4
5
|
import "@fangzhongya/utils/name/humpToLine";
|
|
5
6
|
import "@fangzhongya/utils/name/lineToLargeHump";
|
|
@@ -10,11 +11,10 @@ import "@fangzhongya/utils/basic/array/asyncMergeArray";
|
|
|
10
11
|
import "@fangzhongya/utils/basic/string/firstUpper";
|
|
11
12
|
import "@fangzhongya/utils/urls/getSuffix";
|
|
12
13
|
import "@fangzhongya/utils/basic/array/replaceAfter";
|
|
13
|
-
import "@fangzhongya/utils/html/getVueText";
|
|
14
14
|
import "@fangzhongya/utils/judge/matchsStart";
|
|
15
15
|
import "@fangzhongya/utils/judge/matchsEnd";
|
|
16
|
-
import { props as
|
|
17
|
-
const
|
|
16
|
+
import { props as f, emits as g, expose as m, slot as x } from "../../utils/props.js";
|
|
17
|
+
const n = {
|
|
18
18
|
titles: [],
|
|
19
19
|
propss: [],
|
|
20
20
|
slots: [],
|
|
@@ -22,7 +22,7 @@ const p = {
|
|
|
22
22
|
exposes: []
|
|
23
23
|
};
|
|
24
24
|
function k(e, l) {
|
|
25
|
-
let
|
|
25
|
+
let t = e.charAt(0), s = [
|
|
26
26
|
['"', '"'],
|
|
27
27
|
["'", "'"],
|
|
28
28
|
["`", "`"],
|
|
@@ -30,46 +30,46 @@ function k(e, l) {
|
|
|
30
30
|
["{", "}"],
|
|
31
31
|
["[", "]"]
|
|
32
32
|
];
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (t.
|
|
39
|
-
o.push(
|
|
33
|
+
const r = s.map((o) => o[0]);
|
|
34
|
+
let a = r.indexOf(t);
|
|
35
|
+
if (a != -1) {
|
|
36
|
+
let o = [t];
|
|
37
|
+
for (let i = 1; i < e.length; i++) {
|
|
38
|
+
if (t = e[i], a = r.indexOf(t), a != -1)
|
|
39
|
+
a > 2 ? o.push(t) : o[o.length - 1] === t ? o.pop() : o.push(t);
|
|
40
40
|
else {
|
|
41
|
-
let
|
|
42
|
-
for (let
|
|
43
|
-
if (
|
|
44
|
-
|
|
41
|
+
let c = !1;
|
|
42
|
+
for (let u of s)
|
|
43
|
+
if (t === u[1] && o[o.length - 1] === u[0]) {
|
|
44
|
+
c = !0;
|
|
45
45
|
break;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
c && o.pop();
|
|
48
48
|
}
|
|
49
49
|
if (o.length === 0)
|
|
50
|
-
return l && e[
|
|
50
|
+
return l && e[i + 1] === " ", e.substring(0, i + 1);
|
|
51
51
|
}
|
|
52
52
|
} else
|
|
53
53
|
return l ? e.substring(0, e.indexOf(" ")) : e;
|
|
54
54
|
}
|
|
55
55
|
function q(e) {
|
|
56
56
|
delete e.problems, delete e.source;
|
|
57
|
-
let l = e.tag,
|
|
57
|
+
let l = e.tag, t = e.name, s = e.description, r = e.default, a = "", o = "";
|
|
58
58
|
if (l == "default")
|
|
59
|
-
|
|
59
|
+
t = t.trim(), t = k(t) || t;
|
|
60
60
|
else if (l == "selectable")
|
|
61
|
-
|
|
61
|
+
t = t.trim();
|
|
62
62
|
else {
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
63
|
+
if (t.includes("=")) {
|
|
64
|
+
const u = t.split("=");
|
|
65
|
+
t = u[0];
|
|
66
|
+
const O = u[1] + " " + s, h = k(O, !0);
|
|
67
|
+
h ? (r = h, s = O.replace(h, "")) : r = e.default || u[1] || "";
|
|
68
68
|
}
|
|
69
|
-
const
|
|
70
|
-
|
|
69
|
+
const c = /\s*\((.*)\)\s/gi.exec(s);
|
|
70
|
+
c && c.length > 0 && (a = c[1], s = s.replace(c[0], ""));
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return t.endsWith("*") && (o = "*", t = t.substring(0, t.length - 1)), e.name = t, e.required = o, e.default = r || "", e.description = s, e.selectable = a, e;
|
|
73
73
|
}
|
|
74
74
|
function y(e) {
|
|
75
75
|
let l = [
|
|
@@ -80,15 +80,15 @@ function y(e) {
|
|
|
80
80
|
"date"
|
|
81
81
|
// 'description',
|
|
82
82
|
// 'descriptions',
|
|
83
|
-
],
|
|
84
|
-
l.forEach((
|
|
85
|
-
s[
|
|
86
|
-
}),
|
|
87
|
-
|
|
83
|
+
], t = d(e), s = {};
|
|
84
|
+
l.forEach((r) => {
|
|
85
|
+
s[r] = t.obj[r];
|
|
86
|
+
}), E(s), t.arr.forEach((r) => {
|
|
87
|
+
b(r.key, r.value);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
90
|
+
function E(e) {
|
|
91
|
+
n.titles.push(e);
|
|
92
92
|
}
|
|
93
93
|
function j(e) {
|
|
94
94
|
let l = [
|
|
@@ -101,27 +101,27 @@ function j(e) {
|
|
|
101
101
|
"description",
|
|
102
102
|
"descriptions",
|
|
103
103
|
"return"
|
|
104
|
-
],
|
|
105
|
-
l.forEach((
|
|
106
|
-
s[
|
|
107
|
-
}),
|
|
108
|
-
|
|
104
|
+
], t = d(e), s = {};
|
|
105
|
+
l.forEach((r) => {
|
|
106
|
+
s[r] = t.obj[r];
|
|
107
|
+
}), p(s, "props"), t.arr.forEach((r) => {
|
|
108
|
+
b(r.key, r.value);
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
function w(e) {
|
|
112
|
-
let l = ["slot", "name", "selectable", "description", "descriptions"],
|
|
113
|
-
l.forEach((
|
|
114
|
-
s[
|
|
115
|
-
}),
|
|
116
|
-
|
|
112
|
+
let l = ["slot", "name", "selectable", "description", "descriptions"], t = d(e), s = {};
|
|
113
|
+
l.forEach((r) => {
|
|
114
|
+
s[r] = t.obj[r];
|
|
115
|
+
}), p(s, "slot"), t.arr.forEach((r) => {
|
|
116
|
+
b(r.key, r.value);
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
function F(e) {
|
|
120
|
-
let l = ["emits", "name", "selectable", "description", "descriptions"],
|
|
121
|
-
l.forEach((
|
|
122
|
-
s[
|
|
123
|
-
}),
|
|
124
|
-
|
|
120
|
+
let l = ["emits", "name", "selectable", "description", "descriptions"], t = d(e), s = {};
|
|
121
|
+
l.forEach((r) => {
|
|
122
|
+
s[r] = t.obj[r];
|
|
123
|
+
}), p(s, "emits"), t.arr.forEach((r) => {
|
|
124
|
+
b(r.key, r.value);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
function N(e) {
|
|
@@ -133,56 +133,56 @@ function N(e) {
|
|
|
133
133
|
"selectable",
|
|
134
134
|
"description",
|
|
135
135
|
"descriptions"
|
|
136
|
-
],
|
|
137
|
-
l.forEach((
|
|
138
|
-
s[
|
|
139
|
-
}),
|
|
140
|
-
|
|
136
|
+
], t = d(e), s = {};
|
|
137
|
+
l.forEach((r) => {
|
|
138
|
+
s[r] = t.obj[r];
|
|
139
|
+
}), p(s, "expose"), t.arr.forEach((r) => {
|
|
140
|
+
b(r.key, r.value);
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
const
|
|
145
|
-
|
|
143
|
+
function p(e, l) {
|
|
144
|
+
const t = n[l + "name"] || [], s = e.name ?? e[l]?.name, r = t.indexOf(s);
|
|
145
|
+
r >= 0 && (n[l + "s"].splice(r, 1), t.splice(r, 1)), n[l + "s"].push(e), t.push(s), n[l + "name"] = t;
|
|
146
146
|
}
|
|
147
147
|
function P() {
|
|
148
|
-
Object.keys(
|
|
149
|
-
|
|
148
|
+
Object.keys(n).forEach((e) => {
|
|
149
|
+
n[e] = [];
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const
|
|
152
|
+
function d(e, l) {
|
|
153
|
+
const t = {
|
|
154
154
|
descriptions: e?.description || ""
|
|
155
155
|
}, s = [];
|
|
156
|
-
return e?.tags && e.tags?.forEach((
|
|
157
|
-
let a =
|
|
158
|
-
if (!
|
|
159
|
-
|
|
156
|
+
return e?.tags && e.tags?.forEach((r) => {
|
|
157
|
+
let a = r.tag, o = q(r);
|
|
158
|
+
if (!t.hasOwnProperty(a))
|
|
159
|
+
t[a] = o;
|
|
160
160
|
else {
|
|
161
|
-
const
|
|
162
|
-
|
|
161
|
+
const i = {};
|
|
162
|
+
i[a] = o, s.push({
|
|
163
163
|
key: a,
|
|
164
|
-
value:
|
|
164
|
+
value: i
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
}), {
|
|
168
168
|
arr: s,
|
|
169
|
-
obj:
|
|
169
|
+
obj: t
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function b(e, l) {
|
|
173
173
|
switch (e) {
|
|
174
174
|
case "title":
|
|
175
|
-
return
|
|
175
|
+
return E(l), !0;
|
|
176
176
|
case "text":
|
|
177
|
-
return
|
|
177
|
+
return E(l), !0;
|
|
178
178
|
case "props":
|
|
179
|
-
return
|
|
179
|
+
return p(l, "props"), !0;
|
|
180
180
|
case "slot":
|
|
181
|
-
return
|
|
181
|
+
return p(l, "slot"), !0;
|
|
182
182
|
case "emits":
|
|
183
|
-
return
|
|
183
|
+
return p(l, "emits"), !0;
|
|
184
184
|
case "expose":
|
|
185
|
-
return
|
|
185
|
+
return p(l, "expose"), !0;
|
|
186
186
|
default:
|
|
187
187
|
return !1;
|
|
188
188
|
}
|
|
@@ -205,14 +205,14 @@ function S(e, l) {
|
|
|
205
205
|
}
|
|
206
206
|
function z(e) {
|
|
207
207
|
return P(), e?.forEach((l) => {
|
|
208
|
-
let
|
|
208
|
+
let t = l?.tags || [], s = t?.length || 0;
|
|
209
209
|
if (s > 0)
|
|
210
|
-
for (let
|
|
211
|
-
const a = r
|
|
210
|
+
for (let r = 0; r < s; r++) {
|
|
211
|
+
const a = t[r] || {};
|
|
212
212
|
if (S(a.tag, l))
|
|
213
213
|
break;
|
|
214
214
|
}
|
|
215
|
-
}),
|
|
215
|
+
}), n;
|
|
216
216
|
}
|
|
217
217
|
function U(e) {
|
|
218
218
|
let l = T(e);
|
|
@@ -222,99 +222,99 @@ const V = [
|
|
|
222
222
|
{
|
|
223
223
|
label: "属性名",
|
|
224
224
|
prop: "name",
|
|
225
|
-
formatter:
|
|
225
|
+
formatter: f.name
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
label: "说明",
|
|
229
229
|
prop: "description",
|
|
230
|
-
formatter:
|
|
230
|
+
formatter: f.description
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
label: "类型",
|
|
234
234
|
prop: "type",
|
|
235
|
-
formatter:
|
|
235
|
+
formatter: f.type
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
label: "可选值",
|
|
239
239
|
prop: "selectable",
|
|
240
|
-
formatter:
|
|
240
|
+
formatter: f.selectable
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
label: "默认值",
|
|
244
244
|
prop: "default",
|
|
245
|
-
formatter:
|
|
245
|
+
formatter: f.default
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
248
|
label: "必传",
|
|
249
249
|
prop: "required",
|
|
250
|
-
formatter:
|
|
250
|
+
formatter: f.required
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
253
|
label: "方法返回值",
|
|
254
254
|
prop: "return",
|
|
255
|
-
formatter:
|
|
255
|
+
formatter: f.return
|
|
256
256
|
}
|
|
257
257
|
], X = [
|
|
258
258
|
{
|
|
259
259
|
label: "事件名",
|
|
260
260
|
prop: "name",
|
|
261
|
-
formatter:
|
|
261
|
+
formatter: g.name
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
label: "说明",
|
|
265
265
|
prop: "description",
|
|
266
|
-
formatter:
|
|
266
|
+
formatter: g.description
|
|
267
267
|
},
|
|
268
268
|
{
|
|
269
269
|
label: "回调参数",
|
|
270
270
|
prop: "selectable",
|
|
271
|
-
formatter:
|
|
271
|
+
formatter: g.selectable
|
|
272
272
|
}
|
|
273
273
|
], Y = [
|
|
274
274
|
{
|
|
275
275
|
label: "方法名",
|
|
276
276
|
prop: "name",
|
|
277
|
-
formatter:
|
|
277
|
+
formatter: m.name
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
280
|
label: "说明",
|
|
281
281
|
prop: "description",
|
|
282
|
-
formatter:
|
|
282
|
+
formatter: m.description
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
label: "参数",
|
|
286
286
|
prop: "selectable",
|
|
287
|
-
formatter:
|
|
287
|
+
formatter: m.selectable
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
label: "返回值",
|
|
291
291
|
prop: "return",
|
|
292
292
|
formatter(e) {
|
|
293
|
-
return
|
|
293
|
+
return m.return(e) || e.expose.default || "";
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
296
|
{
|
|
297
297
|
label: "类型",
|
|
298
298
|
prop: "type",
|
|
299
299
|
formatter(e) {
|
|
300
|
-
return
|
|
300
|
+
return m.type(e) || "function";
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
], Z = [
|
|
304
304
|
{
|
|
305
305
|
label: "插槽名",
|
|
306
306
|
prop: "name",
|
|
307
|
-
formatter:
|
|
307
|
+
formatter: x.name
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
310
|
label: "说明",
|
|
311
311
|
prop: "description",
|
|
312
|
-
formatter:
|
|
312
|
+
formatter: x.description
|
|
313
313
|
},
|
|
314
314
|
{
|
|
315
315
|
label: "作用域参数",
|
|
316
316
|
prop: "selectable",
|
|
317
|
-
formatter:
|
|
317
|
+
formatter: x.selectable
|
|
318
318
|
}
|
|
319
319
|
];
|
|
320
320
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),s=require("../boxurl/index.vue.cjs"),u=require("../../../_virtual/common.cjs"),i=require("markdown-it"),_=require("../../utils/glob.cjs"),d={class:"md"},v={class:"md-top-name"},m=["innerHTML"],h=e.defineComponent({__name:"index",props:{value:Object},setup(a){const t=a,n=e.ref(""),l=new i({html:!0,xhtmlOut:!0,highlight:function(r,o){if(o&&u.getLanguage(o))try{return u.highlight(r,{language:o}).value}catch{}return""}});e.watch(()=>t.value,()=>{c()});function c(){t.value?.key&&_.getLocalTextTests(t.value).then(r=>{n.value=l.render(r)}).catch(()=>{n.value=""})}return c(),(r,o)=>(e.openBlock(),e.createElementBlock("div",d,[n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s,{value:t.value},{default:e.withCtx(()=>[e.createElementVNode("div",v,e.toDisplayString(t.value?.value)+" 说明文档
|
|
1
|
+
"use strict";const e=require("vue"),s=require("../boxurl/index.vue.cjs"),u=require("../../../_virtual/common.cjs"),i=require("markdown-it"),_=require("../../utils/glob.cjs"),d={class:"md"},v={class:"md-top-name"},m=["innerHTML"],h=e.defineComponent({__name:"index",props:{value:Object},setup(a){const t=a,n=e.ref(""),l=new i({html:!0,xhtmlOut:!0,highlight:function(r,o){if(o&&u.getLanguage(o))try{return u.highlight(r,{language:o}).value}catch{}return""}});e.watch(()=>t.value,()=>{c()});function c(){t.value?.key&&_.getLocalTextTests(t.value).then(r=>{n.value=l.render(r)}).catch(()=>{n.value=""})}return c(),(r,o)=>(e.openBlock(),e.createElementBlock("div",d,[n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s,{value:t.value},{default:e.withCtx(()=>[e.createElementVNode("div",v,e.toDisplayString(t.value?.value)+" 说明文档",1)]),_:1},8,["value"]),e.createElementVNode("div",{innerHTML:n.value},null,8,m)],64)):e.createCommentVNode("",!0)]))}});module.exports=h;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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;
|
package/dist/packages/config.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@fangzhongya/utils/basic/object/mergeObject"),n={components:[]};function o(e){return t.mergeObject(n,e,2)}function r(e){return n[e]}exports.getConfig=r;exports.userConfig=o;
|
package/dist/packages/config.js
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import { mergeObject as
|
|
2
|
-
|
|
3
|
-
import "@fangzhongya/utils/name/humpToLine";
|
|
4
|
-
import "@fangzhongya/utils/name/lineToLargeHump";
|
|
5
|
-
import "@fangzhongya/utils/basic/string/appearNum";
|
|
6
|
-
import "@fangzhongya/utils/basic/string/firstLower";
|
|
7
|
-
import "@fangzhongya/utils/basic/array/duplicateRemoval";
|
|
8
|
-
import "@fangzhongya/utils/basic/array/asyncMergeArray";
|
|
9
|
-
import "@fangzhongya/utils/basic/string/firstUpper";
|
|
10
|
-
import "@fangzhongya/utils/urls/getSuffix";
|
|
11
|
-
import "@fangzhongya/utils/basic/array/replaceAfter";
|
|
12
|
-
const t = {
|
|
1
|
+
import { mergeObject as t } from "@fangzhongya/utils/basic/object/mergeObject";
|
|
2
|
+
const o = {
|
|
13
3
|
components: []
|
|
14
4
|
};
|
|
15
|
-
function
|
|
16
|
-
return
|
|
5
|
+
function r(n) {
|
|
6
|
+
return t(o, n, 2);
|
|
17
7
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
8
|
+
function c(n) {
|
|
9
|
+
return o[n];
|
|
20
10
|
}
|
|
21
11
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
c as getConfig,
|
|
13
|
+
r as userConfig
|
|
24
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),c=require("../../directives/adjust/index.cjs"),d=require("../../components/aside/index.vue.cjs"),a=require("../../components/header/index.vue.cjs"),r=require("../../components/main/index.vue.cjs"),u=require("../../utils/glob.cjs"),_=require("vue-router"),l={class:"__document-index"},v={class:"index-aside"},m={class:"index-aside-div"},h={class:"index-body"},p={class:"index-div"},x={class:"index-header"},q={class:"index-main"},N={class:"index-main-div"},g=e.defineComponent({__name:"index",setup(E){const n=_.useRoute(),t=e.ref({});function s(i){t.value=i}e.watch(()=>n.query?.id,()=>{o()});function o(){n.query?.id&&(t.value=u.getCompoName(n.query.id+"")[0])}return o(),(i,V)=>(e.openBlock(),e.createElementBlock("div",l,[e.withDirectives((e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",m,[e.createVNode(d,{value:t.value,onChange:s},null,8,["value"])])])),[[e.unref(c),{right:{}}]]),e.createElementVNode("div",h,[e.createElementVNode("div",p,[e.createElementVNode("div",x,[e.createVNode(a)]),e.createElementVNode("div",q,[e.createElementVNode("div",N,[(e.openBlock(),e.createBlock(r,{key:t.value?.name,value:t.value},null,8,["value"]))])])])])]))}});module.exports=g;
|
|
1
|
+
"use strict";const e=require("vue"),c=require("../../directives/adjust/index.cjs"),d=require("../../components/aside/index.vue.cjs"),a=require("../../components/header/index.vue.cjs"),r=require("../../components/main/index.vue.cjs"),u=require("../../utils/glob.cjs"),_=require("vue-router"),l={class:"__document-index"},v={class:"index-aside"},m={class:"index-aside-div"},h={class:"index-body"},p={class:"index-div"},x={class:"index-header"},q={class:"index-main"},N={class:"index-main-div"},g=e.defineComponent({__name:"index",setup(E){const n=_.useRoute(),t=e.ref({});function s(i){t.value=i}e.watch(()=>n.query?.id,()=>{o()});function o(){n.query?.id&&(t.value=u.getCompoName(n.query.id+"")[0]||{})}return e.onMounted(()=>{o()}),(i,V)=>(e.openBlock(),e.createElementBlock("div",l,[e.withDirectives((e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",m,[e.createVNode(d,{value:t.value,onChange:s},null,8,["value"])])])),[[e.unref(c),{right:{}}]]),e.createElementVNode("div",h,[e.createElementVNode("div",p,[e.createElementVNode("div",x,[e.createVNode(a)]),e.createElementVNode("div",q,[e.createElementVNode("div",N,[(e.openBlock(),e.createBlock(r,{key:t.value?.name,value:t.value},null,8,["value"]))])])])])]))}});module.exports=g;
|
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
import { defineComponent as r, ref as _, watch as l, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getCompoName as
|
|
7
|
-
import { useRoute as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as r, ref as _, watch as l, onMounted as m, createElementBlock as d, openBlock as t, withDirectives as u, createElementVNode as e, createVNode as a, unref as v, createBlock as f } from "vue";
|
|
2
|
+
import h from "../../directives/adjust/index.js";
|
|
3
|
+
import p from "../../components/aside/index.vue.js";
|
|
4
|
+
import x from "../../components/header/index.vue.js";
|
|
5
|
+
import g from "../../components/main/index.vue.js";
|
|
6
|
+
import { getCompoName as y } from "../../utils/glob.js";
|
|
7
|
+
import { useRoute as k } from "vue-router";
|
|
8
|
+
const C = { class: "__document-index" }, q = { class: "index-aside" }, B = { class: "index-aside-div" }, N = { class: "index-body" }, w = { class: "index-div" }, D = { class: "index-header" }, E = { class: "index-main" }, V = { class: "index-main-div" }, G = /* @__PURE__ */ r({
|
|
9
9
|
__name: "index",
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
10
|
+
setup($) {
|
|
11
|
+
const i = k(), o = _({});
|
|
12
12
|
function c(s) {
|
|
13
|
-
|
|
13
|
+
o.value = s;
|
|
14
14
|
}
|
|
15
15
|
l(
|
|
16
|
-
() =>
|
|
16
|
+
() => i.query?.id,
|
|
17
17
|
() => {
|
|
18
18
|
n();
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
21
|
function n() {
|
|
22
|
-
|
|
22
|
+
i.query?.id && (o.value = y(i.query.id + "")[0] || {});
|
|
23
23
|
}
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
return m(() => {
|
|
25
|
+
n();
|
|
26
|
+
}), (s, b) => (t(), d("div", C, [
|
|
27
|
+
u((t(), d("div", q, [
|
|
28
|
+
e("div", B, [
|
|
29
|
+
a(p, {
|
|
30
|
+
value: o.value,
|
|
29
31
|
onChange: c
|
|
30
32
|
}, null, 8, ["value"])
|
|
31
33
|
])
|
|
32
34
|
])), [
|
|
33
|
-
[
|
|
35
|
+
[v(h), {
|
|
34
36
|
right: {}
|
|
35
37
|
}]
|
|
36
38
|
]),
|
|
37
|
-
e("div",
|
|
38
|
-
e("div",
|
|
39
|
-
e("div", w, [
|
|
40
|
-
d(p)
|
|
41
|
-
]),
|
|
39
|
+
e("div", N, [
|
|
40
|
+
e("div", w, [
|
|
42
41
|
e("div", D, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
a(x)
|
|
43
|
+
]),
|
|
44
|
+
e("div", E, [
|
|
45
|
+
e("div", V, [
|
|
46
|
+
(t(), f(g, {
|
|
47
|
+
key: o.value?.name,
|
|
48
|
+
value: o.value
|
|
47
49
|
}, null, 8, ["value"]))
|
|
48
50
|
])
|
|
49
51
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../config.cjs"),l=require("../utils/storage.cjs");require("@fangzhongya/utils/basic/string/firstUpper");const f=require("./file.cjs"),g=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"})),s=[{path:"/__document",name:"__document",component:()=>Promise.resolve().then(()=>g(require("../index/index.vue.cjs"))),redirect:{name:"__documentIndex"},meta:{title:"文档"},children:[]}];let m=0;document.addEventListener("keydown",y);function y(e){e=e||window.event,(e.ctrlKey&&e.location==82||e.location==116)&&l.setSession("-keydown-F5",2)}let o="__document";function h(e){o=u.getConfig("router")||"__document";let t="/"+o;s[0].path=t,s[0].redirect={name:o+"Index"},s[0].children?.unshift({path:t+"/:chapters+",redirect:{name:o+"Index"}}),f.getFileName().forEach(n=>{s[0].children?.push({path:n.value,name:o+n.name,component:n.component})});const a=u.getConfig("redirect");if(s.forEach(n=>{e.addRoute(n),e.beforeEach((i,c)=>{if(c.fullPath=="/"){let p=l.getSession("-keydown-F5");document.referrer||p==2?(console.log("刷新"),m=2):(console.log("地址栏输入 或者 刷新"),m=3)}else console.log("跳转"),m=1;l.setSession("-keydown-F5",0)})}),a){const n=e.getRoutes().filter(i=>i.path=="/")[0]||{path:"/"};n.redirect=t,n.name?e.addRoute(n.name,n):e.addRoute(n)}}const d={};function k(e){let t=e.path,a=e.params;if(a&&Object.keys(a).length)return a;{let n=d[t];return n&&Object.keys(n).length?n:m==3?{}:l.getSession("router.toPage."+t)}}function r(e,t,a="push"){let n=t.path||"";const i=t.name,c=t.params||{};e[a](t),i&&(n=e.resolve({name:i}).path),d[n]=c,l.setSession("router.toPage."+n,c)}function v(e,t){r(e,{name:o+"Single",query:{id:t
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../config.cjs"),l=require("../utils/storage.cjs");require("@fangzhongya/utils/basic/string/firstUpper");const f=require("./file.cjs"),g=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"})),s=[{path:"/__document",name:"__document",component:()=>Promise.resolve().then(()=>g(require("../index/index.vue.cjs"))),redirect:{name:"__documentIndex"},meta:{title:"文档"},children:[]}];let m=0;document.addEventListener("keydown",y);function y(e){e=e||window.event,(e.ctrlKey&&e.location==82||e.location==116)&&l.setSession("-keydown-F5",2)}let o="__document";function h(e){o=u.getConfig("router")||"__document";let t="/"+o;s[0].path=t,s[0].redirect={name:o+"Index"},s[0].children?.unshift({path:t+"/:chapters+",redirect:{name:o+"Index"}}),f.getFileName().forEach(n=>{s[0].children?.push({path:n.value,name:o+n.name,component:n.component})});const a=u.getConfig("redirect");if(s.forEach(n=>{e.addRoute(n),e.beforeEach((i,c)=>{if(c.fullPath=="/"){let p=l.getSession("-keydown-F5");document.referrer||p==2?(console.log("刷新"),m=2):(console.log("地址栏输入 或者 刷新"),m=3)}else console.log("跳转"),m=1;l.setSession("-keydown-F5",0)})}),a){const n=e.getRoutes().filter(i=>i.path=="/")[0]||{path:"/"};n.redirect=t,n.name?e.addRoute(n.name,n):e.addRoute(n)}}const d={};function k(e){let t=e.path,a=e.params;if(a&&Object.keys(a).length)return a;{let n=d[t];return n&&Object.keys(n).length?n:m==3?{}:l.getSession("router.toPage."+t)}}function r(e,t,a="push"){let n=t.path||"";const i=t.name,c=t.params||{};e[a](t),i&&(n=e.resolve({name:i}).path),d[n]=c,l.setSession("router.toPage."+n,c)}function v(e,t){r(e,{name:o+"Single",query:{id:t?.name+"/"+t?.value},params:{key:t?.key,comkey:t?.comkey}})}function _(e,t){r(e,{name:o+"Develop",query:{id:t?.value},params:{key:t?.key}})}function P(e,t){r(e,{name:o+"Edit",query:{id:t?.value},params:{key:t?.key}})}function S(e,t){r(e,{name:o+"Tests",query:{id:t?.value},params:{key:t?.key}})}function q(e,t){r(e,{name:o+"Compon",query:{id:t?.value},params:{key:t?.key}})}exports.getPageParams=k;exports.init=h;exports.toCompon=q;exports.toDevelop=_;exports.toEdit=P;exports.toPage=r;exports.toSingle=v;exports.toTests=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Router, LocationQueryRaw, RouteParamsRaw, RouteLocationNormalizedLoaded } from 'vue-router';
|
|
2
|
-
import { TestsObj, ComponentsObj } from '../utils/
|
|
2
|
+
import { TestsObj, ComponentsObj } from '../utils/type';
|
|
3
3
|
import { ObjUnk } from '../config';
|
|
4
4
|
export declare function init(router: Router): void;
|
|
5
5
|
type ToPush = 'replace' | 'push';
|
|
@@ -68,45 +68,45 @@ function E(t, e) {
|
|
|
68
68
|
m(t, {
|
|
69
69
|
name: o + "Single",
|
|
70
70
|
query: {
|
|
71
|
-
id: e
|
|
71
|
+
id: e?.name + "/" + e?.value
|
|
72
72
|
},
|
|
73
|
-
params: { key: e
|
|
73
|
+
params: { key: e?.key, comkey: e?.comkey }
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
function q(t, e) {
|
|
77
77
|
m(t, {
|
|
78
78
|
name: o + "Develop",
|
|
79
79
|
query: {
|
|
80
|
-
id: e
|
|
80
|
+
id: e?.value
|
|
81
81
|
},
|
|
82
|
-
params: { key: e
|
|
82
|
+
params: { key: e?.key }
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
function x(t, e) {
|
|
86
86
|
m(t, {
|
|
87
87
|
name: o + "Edit",
|
|
88
88
|
query: {
|
|
89
|
-
id: e
|
|
89
|
+
id: e?.value
|
|
90
90
|
},
|
|
91
|
-
params: { key: e
|
|
91
|
+
params: { key: e?.key }
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
function F(t, e) {
|
|
95
95
|
m(t, {
|
|
96
96
|
name: o + "Tests",
|
|
97
97
|
query: {
|
|
98
|
-
id: e
|
|
98
|
+
id: e?.value
|
|
99
99
|
},
|
|
100
|
-
params: { key: e
|
|
100
|
+
params: { key: e?.key }
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
function R(t, e) {
|
|
104
104
|
m(t, {
|
|
105
105
|
name: o + "Compon",
|
|
106
106
|
query: {
|
|
107
|
-
id: e
|
|
107
|
+
id: e?.value
|
|
108
108
|
},
|
|
109
|
-
params: { key: e
|
|
109
|
+
params: { key: e?.key }
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
export {
|
|
@@ -1,70 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Components, Globs, GlobComs, FangMatch, GetRaw } from '../config';
|
|
2
|
+
import { PropsObj, ComponentsObj } from './type';
|
|
3
3
|
export declare const defaultExtensions: string[];
|
|
4
4
|
/**
|
|
5
5
|
* 判断是否匹配
|
|
6
6
|
*/
|
|
7
7
|
export declare function isUrlsMatchistarts(key: string, arr: Array<string>): boolean;
|
|
8
|
-
export interface TextObj {
|
|
9
|
-
name: string;
|
|
10
|
-
value: string;
|
|
11
|
-
suffix: string;
|
|
12
|
-
key: string;
|
|
13
|
-
cwd?: string;
|
|
14
|
-
raw: string;
|
|
15
|
-
getRaw: GetRaw | null;
|
|
16
|
-
}
|
|
17
|
-
export interface PropObj {
|
|
18
|
-
url: string;
|
|
19
|
-
comprops?: Array<FangMatch>;
|
|
20
|
-
curprops?: Array<FangMatch>;
|
|
21
|
-
name: string;
|
|
22
|
-
value: string;
|
|
23
|
-
suffix: string;
|
|
24
|
-
head: string;
|
|
25
|
-
key: string;
|
|
26
|
-
cwd?: string;
|
|
27
|
-
dir: string;
|
|
28
|
-
}
|
|
29
|
-
export interface PropsObj extends TextObj {
|
|
30
|
-
url: string;
|
|
31
|
-
comprops?: Array<FangMatch>;
|
|
32
|
-
curprops?: Array<FangMatch>;
|
|
33
|
-
dir: string;
|
|
34
|
-
tdir: string;
|
|
35
|
-
key: string;
|
|
36
|
-
}
|
|
37
|
-
export interface MdObj extends TextObj {
|
|
38
|
-
topurl: string;
|
|
39
|
-
comkey: string;
|
|
40
|
-
name: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* 调试文件对象
|
|
44
|
-
*/
|
|
45
|
-
export interface TestsObj extends TextObj {
|
|
46
|
-
dir: string;
|
|
47
|
-
url: string;
|
|
48
|
-
topurl: string;
|
|
49
|
-
name: string;
|
|
50
|
-
comname: string;
|
|
51
|
-
comkey: string;
|
|
52
|
-
component: AsyncComponentLoader;
|
|
53
|
-
}
|
|
54
|
-
export interface ComponentsObj extends Component, TextObj {
|
|
55
|
-
url: string;
|
|
56
|
-
name: string;
|
|
57
|
-
tdir: string;
|
|
58
|
-
adir: string;
|
|
59
|
-
aliasNames: Array<string>;
|
|
60
|
-
component?: AsyncComponentLoader;
|
|
61
|
-
comprops?: Array<FangMatch>;
|
|
62
|
-
curprops?: Array<FangMatch>;
|
|
63
|
-
tests: {
|
|
64
|
-
[key: string]: TestsObj;
|
|
65
|
-
} | undefined;
|
|
66
|
-
mds?: MdObj[];
|
|
67
|
-
}
|
|
68
8
|
/**
|
|
69
9
|
* 通过url 地址获取对应数据
|
|
70
10
|
* @param url
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AsyncComponentLoader } from '../../vue/dist/vue.esm-bundler.js';
|
|
2
|
+
import { Component, GetRaw, FangMatch } from '../config';
|
|
3
|
+
export interface TextObj {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
suffix: string;
|
|
7
|
+
key: string;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
raw: string;
|
|
10
|
+
getRaw: GetRaw | null;
|
|
11
|
+
}
|
|
12
|
+
export interface PropObj {
|
|
13
|
+
url: string;
|
|
14
|
+
comprops?: Array<FangMatch>;
|
|
15
|
+
curprops?: Array<FangMatch>;
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
suffix: string;
|
|
19
|
+
head: string;
|
|
20
|
+
key: string;
|
|
21
|
+
cwd?: string;
|
|
22
|
+
dir: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PropsObj extends TextObj {
|
|
25
|
+
url: string;
|
|
26
|
+
comprops?: Array<FangMatch>;
|
|
27
|
+
curprops?: Array<FangMatch>;
|
|
28
|
+
dir: string;
|
|
29
|
+
tdir: string;
|
|
30
|
+
key: string;
|
|
31
|
+
}
|
|
32
|
+
export interface MdObj extends TextObj {
|
|
33
|
+
topurl: string;
|
|
34
|
+
comkey: string;
|
|
35
|
+
name: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 调试文件对象
|
|
39
|
+
*/
|
|
40
|
+
export interface TestsObj extends TextObj {
|
|
41
|
+
dir: string;
|
|
42
|
+
url: string;
|
|
43
|
+
topurl: string;
|
|
44
|
+
name: string;
|
|
45
|
+
comname: string;
|
|
46
|
+
comkey: string;
|
|
47
|
+
component: AsyncComponentLoader;
|
|
48
|
+
}
|
|
49
|
+
export interface ComponentsObj extends Component, TextObj {
|
|
50
|
+
url: string;
|
|
51
|
+
name: string;
|
|
52
|
+
tdir: string;
|
|
53
|
+
adir: string;
|
|
54
|
+
aliasNames: Array<string>;
|
|
55
|
+
component?: AsyncComponentLoader;
|
|
56
|
+
comprops?: Array<FangMatch>;
|
|
57
|
+
curprops?: Array<FangMatch>;
|
|
58
|
+
tests: {
|
|
59
|
+
[key: string]: TestsObj;
|
|
60
|
+
} | undefined;
|
|
61
|
+
mds?: MdObj[];
|
|
62
|
+
}
|